{"version":3,"file":"pagination-8a314249.js","sources":["../../../app/frontend/models/pagination.ts"],"sourcesContent":["import { computed } from 'vue'\n\nconst DEFAULT_PER_PAGE = 15\n\nexport default function(paginationState: Pagination) {\n /**\n * 不正な値を排除したページネーション情報\n */\n const pagination = computed((): Pagination => {\n const _page = (Number.isInteger(paginationState.page) && paginationState.page)\n ? paginationState.page\n : 1\n\n const _totalCount = (Number.isInteger(paginationState.totalCount) && paginationState.totalCount)\n ? paginationState.totalCount\n : 0\n\n const _per = (Number.isInteger(paginationState.per) && paginationState.per)\n ? paginationState.per\n : DEFAULT_PER_PAGE\n\n const _totalPage = _totalCount && _per\n ? Math.ceil(paginationState.totalCount / paginationState.per)\n : 0\n\n return {\n page: _page,\n per: _per,\n totalCount: _totalCount,\n totalPage: _totalPage,\n }\n })\n\n return {\n // computed\n pagination,\n }\n}\n"],"names":["DEFAULT_PER_PAGE","paginationModel","paginationState","computed","_page","_totalCount","_per","_totalPage"],"mappings":"8CAEA,MAAMA,EAAmB,GAEzB,SAAAC,EAAwBC,EAA6B,CA6B5C,MAAA,CAEL,WA3BiBC,EAAS,IAAkB,CACtC,MAAAC,EAAS,OAAO,UAAUF,EAAgB,IAAI,GAAKA,EAAgB,KACrEA,EAAgB,KAChB,EAEEG,EAAe,OAAO,UAAUH,EAAgB,UAAU,GAAKA,EAAgB,WACjFA,EAAgB,WAChB,EAEEI,EAAQ,OAAO,UAAUJ,EAAgB,GAAG,GAAKA,EAAgB,IACnEA,EAAgB,IAChBF,EAEEO,EAAaF,GAAeC,EAC9B,KAAK,KAAKJ,EAAgB,WAAaA,EAAgB,GAAG,EAC1D,EAEG,MAAA,CACL,KAAME,EACN,IAAKE,EACL,WAAYD,EACZ,UAAWE,CAAA,CACb,CACD,CAIC,CAEJ"}