{"version":3,"sources":["webpack:///./src/utills/sort.ts","webpack:///./src/components/Table/TableHeadCell.vue?4673","webpack:///./src/mixins/TableCellMixin.js","webpack:///./src/components/Table/TableHeadCell.vue","webpack:///./src/components/Table/TableHeadCell.vue?e2f8","webpack:///./src/components/Table/ts/AppTableLayout.vue?d4d3","webpack:///./src/components/Table/ts/AppTableLayout.vue","webpack:///./src/components/Table/ts/AppTableLayout.vue?84b5","webpack:///./src/components/Table/ts/AppTableLayout.vue?3e15","webpack:///./src/components/Table/TableHeadCell.vue?7d22","webpack:///./src/components/Table/ts/AppTableLayout.vue?f5f6","webpack:///./src/hooks/tables/modules/baseTable/mapTableRowsToTableContent.ts","webpack:///./src/hooks/tables/modules/baseTable/useTableViewConfiguration.ts","webpack:///./src/utills/getNestedValue.ts","webpack:///./src/hooks/tables/modules/baseTable/useSortedModel.ts","webpack:///./src/hooks/tables/modules/baseTable/useSortedTableRows.ts","webpack:///./src/hooks/tables/modules/baseTable/useTableTabConfiguration.ts","webpack:///./src/hooks/tables/useTable.ts"],"names":["updateSortValueString","value","toLowerCase","sortByAsc","a","b","updatedA","updatedB","sortByDesc","sortController","order","sortOrders","asc","_hoisted_1","class","render","_ctx","_cache","$props","$setup","$data","$options","_component_SortButton","_resolveComponent","_openBlock","_createElementBlock","_mergeProps","size","sort","$attrs","onClick","args","sortHandler","_createElementVNode","_toDisplayString","name","_createBlock","key","sortOrder","_createCommentVNode","TableCellMixin","props","id","type","String","required","default","defineComponent","components","SortButton","mixins","inheritAttrs","emits","Object","onSort","Function","computed","this","methods","$emit","keyName","__exports__","_hoisted_2","_hoisted_3","_hoisted_4","_component_TableHeadCell","_component_TableRow","_component_TableFooter","_createVNode","spaceBetween","content","_withCtx","_Fragment","_renderList","tableHead","label","rightAlign","_normalizeClass","_","_renderSlot","$slots","withFooter","paginationCapture","pagination","total","paginationTotal","current","currentPage","viewConfiguration","perPage","totalRows","onChangePage","changeCurrentPageHandler","onChangePerPage","changePerPageHandler","TableFooter","TableHeadCell","TableRow","Array","paginationCaptureKey","Number","Boolean","data","page","Math","ceil","count","watch","handler","deep","module","exports","mapTableRowsToTableContent","rows","map","cells","row","infoWithImage","country","checkmark","userActions","badge","json","cell","componentName","tableComponentNames","cellLabel","cellInfoWithImage","cellCountry","undefined","cellCheckmark","cellBadge","cellJson","componentContent","cellProps","params","useTableViewConfiguration","initialViewConfiguration","configuration","reactive","changeViewConfiguration","newConfiguration","entries","forEach","getNestedValue","path","obj","nestedFields","split","val","i","length","useSortedModel","model","activeSort","keyNameInModel","aValue","bValue","aType","bType","searchSortTargetCell","sorting","find","useSortedTableRows","activeSortOption","useTableTabConfiguration","changeTab","useTableWithOutViewConfiguration","options","generateRows","initialSortOptions","currentSort","values","turnOff","sortedModel","ref","immediate","changeSorting","sortByKeyName","option","currentSortOrder","desc","useBaseTable","onViewConfigurationChanged","useTableWithTabs","onTabChanged","initialTab","selectedTab"],"mappings":"iNAAA,kDAIA,SAASA,EAAsBC,GAC7B,MAAqB,kBAAVA,EACFA,EAAMC,cAGRD,EAGH,SAAUE,EAAUC,EAAcC,GACtC,MAAMC,EAAWN,EAAsBI,GACjCG,EAAWP,EAAsBK,GAEvC,MAAU,KAAND,GAAkB,OAANA,EAAmB,EACzB,KAANC,GAAkB,OAANA,GAAoB,EAE7BC,EAAWC,EAAW,EAAID,EAAWC,GAAY,EAAI,EAGxD,SAAUC,EAAWJ,EAAcC,GACvC,MAAMC,EAAWN,EAAsBI,GACjCG,EAAWP,EAAsBK,GAEvC,MAAU,KAAND,GAAkB,OAANA,EAAmB,EACzB,KAANC,GAAkB,OAANA,GAAoB,EAE7BC,EAAWC,EAAW,EAAID,EAAWC,GAAY,EAAI,EAGvD,MAAME,EAAkBC,GACzBA,IAAUC,OAAWC,IAChBT,EAGFK,G,oDCnCT,MACMK,EAAa,CAAEC,MAAO,mBAEtB,SAAUC,EAAOC,EAAUC,EAAYC,EAAYC,EAAYC,EAAWC,GAC9E,MAAMC,EAAwBC,8BAAkB,cAEhD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BjC,EAAwB,2BACxB8C,EAA0B,MAC1B9B,GACEe,GAGF9B,cAAelD,EAAiB,wBAChCoD,GACEJ,EAA0BC,GAE9B9B,mBAAMnB,EAAoBqD,IACE,OAA1B0C,QAA0B,IAA1BA,KAA6B1C,KAG/B,MAAM8B,EAAchC,sBAAS+B,GAAsB,IAE7CN,EAAmB5G,sBAAS,IAE9BH,OAAOuH,OAAgBD,GAAaT,KAClC,EAAGxJ,WAAYA,IAAUC,OAAWkK,UACjCH,EAAmB,IAItBI,EAAcC,iBAAIvB,EAAeC,EAAMxJ,MAAOmK,EAAiBnK,QAUrE,OARA0G,mBACE,CAAC,IAAM8C,EAAMxJ,MAAO,IAAMmK,EAAiBnK,OAC3C,KACE6K,EAAY7K,MAAQuJ,EAAeC,EAAMxJ,MAAOmK,EAAiBnK,QAEnE,CAAE+K,WAAW,EAAMnE,MAAM,IAGpB,CACLI,KAAMzD,sBAAS,IACN2G,EACLM,EAAaK,EAAY7K,OAASwJ,EAAMxJ,OACxCmK,GACAnK,OAEJ6K,cACAtF,oBACAoD,0BACA+B,cACAM,cAAcC,GACRP,GACFtH,OAAOuH,OAAgBD,GAAa5B,QAASoC,IAC3C,GAAIA,EAAOvH,UAAYsH,EAAe,CACpC,MAAME,EAAmBD,EAAOzK,MAEhCyK,EAAOzK,MACL0K,IAAqBzK,OAAWC,IAC5BD,OAAW0K,KACX1K,OAAWC,SAEjBuK,EAAOzK,MAAQC,OAAWkK,YAahC,SAAUW,EACdhB,GAEA,MAAM,aAAEiB,EAAY,WAAEC,GAAelB,GAE7B9B,cAAeiD,EAAW,UAAErB,GAAcD,EAChDqB,GAOF,OAJA/E,mBAAMgF,EAAc9C,IACN,OAAZ4C,QAAY,IAAZA,KAAe5C,KAGV,CACLyB,YACAqB","file":"js/Accounts~Templates~about~admins~brands~categories~devices~esim-bundles~esim-directory~esim-plans~esi~b8330e79.d2225444.js","sourcesContent":["import { sortOrder, sortOrders } from \"@/enums/main/sortOrders\";\r\n\r\ntype sortValue = string | number | boolean;\r\n\r\nfunction updateSortValueString(value: sortValue) {\r\n if (typeof value === \"string\") {\r\n return value.toLowerCase();\r\n }\r\n\r\n return value;\r\n}\r\n\r\nexport function sortByAsc(a: sortValue, b: sortValue): number {\r\n const updatedA = updateSortValueString(a);\r\n const updatedB = updateSortValueString(b);\r\n\r\n if (a === \"\" || a === null) return 1;\r\n if (b === \"\" || b === null) return -1;\r\n\r\n return updatedA > updatedB ? 1 : updatedA < updatedB ? -1 : 0;\r\n}\r\n\r\nexport function sortByDesc(a: sortValue, b: sortValue): number {\r\n const updatedA = updateSortValueString(a);\r\n const updatedB = updateSortValueString(b);\r\n\r\n if (a === \"\" || a === null) return 1;\r\n if (b === \"\" || b === null) return -1;\r\n\r\n return updatedA < updatedB ? 1 : updatedA > updatedB ? -1 : 0;\r\n}\r\n\r\nexport const sortController = (order: sortOrder) => {\r\n if (order === sortOrders.asc) {\r\n return sortByAsc;\r\n }\r\n\r\n return sortByDesc;\r\n};\r\n","import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3be116fa\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"table-cell-name\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_SortButton = _resolveComponent(\"SortButton\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _mergeProps({\n class: \r\n `pseudo-table--cell pseudo-table--cell-size--${_ctx.size} ${\r\n _ctx.sort ? 'sortable' : ''\r\n }`\r\n \n }, _ctx.$attrs, {\n onClick: _cache[0] || (_cache[0] = \n//@ts-ignore\n(...args) => (_ctx.sortHandler && _ctx.sortHandler(...args)))\n }), [\n _createElementVNode(\"span\", _hoisted_1, _toDisplayString(_ctx.name), 1),\n (_ctx.sort)\n ? (_openBlock(), _createBlock(_component_SortButton, {\n key: 0,\n sort: _ctx.sortOrder\n }, null, 8, [\"sort\"]))\n : _createCommentVNode(\"\", true)\n ], 16))\n}","export const TableCellMixin = {\r\n props: {\r\n id: {\r\n type: String,\r\n required: true\r\n },\r\n\r\n name: {\r\n type: String,\r\n required: true\r\n },\r\n\r\n size: {\r\n type: String,\r\n default: \"xs\"\r\n }\r\n }\r\n};\r\n","\r\nimport { defineComponent, PropType } from \"vue\";\r\nimport SortButton from \"@/components/ui/SortButton.vue\";\r\nimport { TableCellMixin } from \"@/mixins/TableCellMixin\";\r\nimport { sortItem } from \"@/enums/main/sortOrders\";\r\n\r\nexport default defineComponent({\r\n name: \"TableHeadCell\",\r\n components: { SortButton },\r\n mixins: [TableCellMixin],\r\n inheritAttrs: false,\r\n emits: { sort: null },\r\n props: {\r\n sort: {\r\n type: Object as PropType,\r\n default: null\r\n },\r\n\r\n onSort: {\r\n // todo: is deprecated. Will be removed. Use emit\r\n type: Function,\r\n required: false\r\n }\r\n },\r\n\r\n computed: {\r\n sortOrder() {\r\n return this.sort?.order || \"\";\r\n }\r\n },\r\n\r\n methods: {\r\n sortHandler(): void {\r\n if (this.sort) {\r\n this.$emit(\"sort\", this.sort.keyName);\r\n }\r\n }\r\n }\r\n});\r\n","import { render } from \"./TableHeadCell.vue?vue&type=template&id=3be116fa&scoped=true&ts=true\"\nimport script from \"./TableHeadCell.vue?vue&type=script&lang=tsx\"\nexport * from \"./TableHeadCell.vue?vue&type=script&lang=tsx\"\n\nimport \"./TableHeadCell.vue?vue&type=style&index=0&id=3be116fa&lang=scss&scoped=true\"\n\nimport exportComponent from \"C:\\\\Bohdan\\\\telesim_test\\\\telesim-admin-panel\\\\node_modules\\\\@vue\\\\cli-service\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-3be116fa\"]])\n\nexport default __exports__","import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, createBlock as _createBlock, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps } from \"vue\"\n\nconst _hoisted_1 = { class: \"pseudo-table-content\" }\nconst _hoisted_2 = { class: \"pseudo-table--head\" }\nconst _hoisted_3 = { class: \"pseudo-table--body\" }\nconst _hoisted_4 = {\n key: 0,\n class: \"pseudo-table--footer\"\n}\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_TableHeadCell = _resolveComponent(\"TableHeadCell\")!\n const _component_TableRow = _resolveComponent(\"TableRow\")!\n const _component_TableFooter = _resolveComponent(\"TableFooter\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _mergeProps({ class: \"pseudo-table inline-table\" }, _ctx.$attrs), [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_TableRow, { \"space-between\": _ctx.spaceBetween }, {\n content: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.tableHead, ({ id, size, label, sort, rightAlign }) => {\n return (_openBlock(), _createBlock(_component_TableHeadCell, {\n id: id,\n key: id,\n name: label,\n sort: sort,\n size: size,\n class: _normalizeClass({ 'right-align': rightAlign }),\n onSort: _ctx.sortHandler\n }, null, 8, [\"id\", \"name\", \"sort\", \"size\", \"class\", \"onSort\"]))\n }), 128))\n ]),\n _: 1\n }, 8, [\"space-between\"])\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _renderSlot(_ctx.$slots, \"table-body\")\n ]),\n (_ctx.withFooter)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_4, [\n _createVNode(_component_TableFooter, {\n \"count-text\": _ctx.paginationCapture,\n pagination: {\r\n total: _ctx.paginationTotal,\r\n current: _ctx.currentPage\r\n },\n \"per-page\": _ctx.viewConfiguration.perPage,\n \"total-rows\": _ctx.totalRows,\n \"use-select\": true,\n onChangePage: _ctx.changeCurrentPageHandler,\n onChangePerPage: _ctx.changePerPageHandler\n }, null, 8, [\"count-text\", \"pagination\", \"per-page\", \"total-rows\", \"onChangePage\", \"onChangePerPage\"])\n ]))\n : _createCommentVNode(\"\", true)\n ])\n ], 16))\n}","\r\nimport { defineComponent, PropType } from \"vue\";\r\nimport { tableHeadCellsList } from \"@/components/Table/ts/AppTable.vue\";\r\nimport TableRow from \"@/components/Table/TableRow.vue\";\r\nimport TableHeadCell from \"@/components/Table/TableHeadCell.vue\";\r\nimport TableFooter from \"@/components/Table/TableFooter.vue\";\r\nimport { ITableViewConfiguration } from \"@/components/Table/ts/interfaces/common\";\r\n\r\nexport default defineComponent({\r\n name: \"AppTableLayout\",\r\n components: { TableFooter, TableHeadCell, TableRow },\r\n inheritAttrs: false,\r\n props: {\r\n tableHead: {\r\n type: Array as PropType,\r\n required: true\r\n },\r\n\r\n paginationCaptureKey: {\r\n type: String,\r\n default: \"\"\r\n },\r\n\r\n totalRows: { type: Number, default: 0 },\r\n perPage: { type: Number, default: 10 },\r\n currentPage: { type: Number, default: 1 },\r\n spaceBetween: { type: Boolean, default: true },\r\n withFooter: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n emits: [\"sort\", \"changeViewConfiguration\"],\r\n\r\n data() {\r\n return {\r\n viewConfiguration: {\r\n perPage: this.perPage,\r\n page: this.currentPage\r\n }\r\n } as {\r\n viewConfiguration: ITableViewConfiguration;\r\n };\r\n },\r\n\r\n computed: {\r\n paginationTotal(): number {\r\n if (this.totalRows === 0) {\r\n return 0;\r\n }\r\n\r\n return Math.ceil(this.totalRows / this.perPage);\r\n },\r\n\r\n paginationCapture(): string {\r\n if (!this.paginationCaptureKey) {\r\n return \"\";\r\n }\r\n\r\n const { totalRows = 0 } = this;\r\n const { perPage, page } = this.viewConfiguration;\r\n let count = totalRows > perPage ? perPage * page : this.totalRows;\r\n\r\n if (count > totalRows) {\r\n count = totalRows;\r\n }\r\n\r\n return `${count} of ${this.totalRows} ${this.paginationCaptureKey}`;\r\n }\r\n },\r\n\r\n watch: {\r\n perPage(perPage) {\r\n this.viewConfiguration.perPage = perPage;\r\n },\r\n\r\n currentPage(page) {\r\n this.viewConfiguration.page = page;\r\n },\r\n\r\n viewConfiguration: {\r\n handler({ page, perPage }: ITableViewConfiguration) {\r\n if (page === this.currentPage && perPage === this.perPage) {\r\n return;\r\n }\r\n\r\n this.$emit(\"changeViewConfiguration\", this.viewConfiguration);\r\n },\r\n deep: true\r\n }\r\n },\r\n\r\n methods: {\r\n changeCurrentPageHandler(page: number): void {\r\n this.viewConfiguration.page = page;\r\n },\r\n\r\n changePerPageHandler(perPage: number): void {\r\n this.viewConfiguration.perPage = perPage;\r\n },\r\n\r\n sortHandler(keyName: string): void {\r\n this.$emit(\"sort\", keyName);\r\n }\r\n }\r\n});\r\n","import { render } from \"./AppTableLayout.vue?vue&type=template&id=4272d394&ts=true\"\nimport script from \"./AppTableLayout.vue?vue&type=script&lang=ts\"\nexport * from \"./AppTableLayout.vue?vue&type=script&lang=ts\"\n\nimport \"./AppTableLayout.vue?vue&type=style&index=0&id=4272d394&lang=scss\"\n\nimport exportComponent from \"C:\\\\Bohdan\\\\telesim_test\\\\telesim-admin-panel\\\\node_modules\\\\@vue\\\\cli-service\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./AppTableLayout.vue?vue&type=style&index=0&id=4272d394&lang=scss\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./TableHeadCell.vue?vue&type=style&index=0&id=3be116fa&lang=scss&scoped=true\"","// extracted by mini-css-extract-plugin\nmodule.exports = {\"bgColor\":\"#f5f6fa\",\"fontColor\":\"#333\",\"lightColor\":\"#fff\",\"primaryColor\":\"#2f80ed\",\"successColor\":\"#27ae60\",\"warningColor\":\"#f2994a\",\"warningLightColor\":\"#fef5ed\",\"dangerColor\":\"#eb5757\",\"dangerLightColor\":\"#fdefef\",\"darkBackgroundColor\":\"rgba(0,0,0,.1)\",\"activeMenuItemGradient\":\"linear-gradient(0deg, #F3F4F8, #F3F4F8)\",\"gradientPrimaryLight\":\"linear-gradient(90.25deg, #DFE9F7 1.96%, #F5F6FA 99.73%)\",\"gradientPrimaryLightTransparent\":\"linear-gradient(90.25deg, #DFE9F7 1.96%, #F5F6FA 99.73%)\",\"colIndent\":\"1rem\",\"tableColXxs\":\"4rem\",\"tableColXs\":\"5.2rem\",\"tableColSm\":\"7rem\",\"tableColSmL\":\"9.5rem\",\"tableColMd\":\"11.5rem\",\"tableColLg\":\"18rem\",\"tableColXg\":\"25rem\",\"buttonSizesArray\":\"icon,xs,sm,smL,md-fluid,md,lg,xl,fluid\"};","import {\r\n ITableBodyRow,\r\n tableComponentNames,\r\n tableContentItem\r\n} from \"@/components/Table/ts/interfaces/TableStructure\";\r\n\r\nexport function mapTableRowsToTableContent(rows: ITableBodyRow[]) {\r\n return rows.map(({ cells, ...row }) => {\r\n return {\r\n ...row,\r\n cells: cells.map(\r\n ({\r\n infoWithImage,\r\n country,\r\n checkmark,\r\n label,\r\n userActions,\r\n badge,\r\n rightAlign,\r\n json,\r\n ...cell\r\n }) => {\r\n let componentName = tableComponentNames.cellLabel;\r\n\r\n if (infoWithImage) {\r\n componentName = tableComponentNames.cellInfoWithImage;\r\n } else if (country) {\r\n componentName = tableComponentNames.cellCountry;\r\n } else if (checkmark !== undefined) {\r\n componentName = tableComponentNames.cellCheckmark;\r\n } else if (userActions) {\r\n componentName = tableComponentNames.userActions;\r\n } else if (badge) {\r\n componentName = tableComponentNames.cellBadge;\r\n } else if (json) {\r\n componentName = tableComponentNames.cellJson;\r\n }\r\n\r\n return {\r\n componentName,\r\n componentContent: (infoWithImage ??\r\n country ??\r\n checkmark ??\r\n label ??\r\n userActions ??\r\n badge) as tableContentItem,\r\n cellProps: cell,\r\n params: {\r\n rightAlign: rightAlign ?? false\r\n }\r\n };\r\n }\r\n )\r\n };\r\n });\r\n}\r\n","import { reactive } from \"vue\";\r\nimport { ITableViewConfiguration } from \"@/components/Table/ts/interfaces/common\";\r\n\r\nexport type changeViewConfigurationType = (\r\n newConfiguration: ITableViewConfiguration\r\n) => ITableViewConfiguration;\r\n\r\nexport type useTableViewConfigurationData = {\r\n configuration: ITableViewConfiguration;\r\n changeViewConfiguration: changeViewConfigurationType;\r\n};\r\n\r\nexport function useTableViewConfiguration(\r\n initialViewConfiguration: ITableViewConfiguration\r\n): useTableViewConfigurationData {\r\n const configuration: ITableViewConfiguration = reactive(\r\n initialViewConfiguration\r\n );\r\n\r\n return {\r\n configuration,\r\n changeViewConfiguration(newConfiguration: ITableViewConfiguration) {\r\n Object.entries(newConfiguration).forEach(([key, value]) => {\r\n configuration[key] = value;\r\n });\r\n\r\n return configuration;\r\n }\r\n };\r\n}\r\n","import { IObjectKeys } from \"@/interfaces/IObjectKeys\";\r\n\r\nexport function getNestedValue(path: string, obj: IObjectKeys): any {\r\n const nestedFields = path.split(\".\"); // ?;\r\n let val: any = obj;\r\n let i = 0;\r\n\r\n while (i < nestedFields.length) {\r\n const key: string = nestedFields[i];\r\n\r\n if (typeof val !== \"object\") {\r\n i = nestedFields.length;\r\n break;\r\n }\r\n\r\n if (val[key] === undefined) {\r\n return null;\r\n }\r\n\r\n if (typeof val === \"object\" && val[key]) {\r\n val = val[key];\r\n i++;\r\n } else {\r\n i = nestedFields.length;\r\n }\r\n }\r\n\r\n return val;\r\n}\r\n//\r\n// getNestedValue(\"updatedAt.fullName\", {\r\n// id: 170,\r\n// name: \"Algeria\",\r\n// isoCode: \"AG\",\r\n// icon:\r\n// \"https://telesim-api.dev2.4k.com.ua/share/locations/icon/c5db84d3-da92-4842-b7cf-1112cdb83d64.png\",\r\n// smallImage: \"\",\r\n// bigImage:\r\n// \"https://telesim-api.dev2.4k.com.ua/share/locations/bigImage/10942e9b-eb93-46f7-9837-9b481d0cd9c6.png\",\r\n// secondaryBigImage: null,\r\n// popular: false,\r\n// active: true,\r\n// createdAt: \"2021-03-30T07:20:31.722Z\",\r\n// updatedAt: \"2021-07-29T12:06:20.424Z\",\r\n// countryPlans: [\r\n// {\r\n// id: 350,\r\n// active: true,\r\n// zone: {\r\n// id: 12,\r\n// title: \"Zone L\",\r\n// key: \"zonel\"\r\n// },\r\n// planOperators: [\r\n// {\r\n// id: 218,\r\n// active: true,\r\n// operator: {\r\n// id: 92,\r\n// name: \"Mobilis\",\r\n// image:\r\n// \"https://telesim-api.dev2.4k.com.ua/share/locations/icon/1696a7f9-856e-4d8a-a110-7d4056c9588d.png\",\r\n// countryId: 170,\r\n// netGens: [\r\n// {\r\n// id: 287,\r\n// active: true,\r\n// networkGeneration: {\r\n// id: 5,\r\n// title: \"2G\",\r\n// key: \"2g\",\r\n// active: true\r\n// }\r\n// },\r\n// {\r\n// id: 284,\r\n// active: true,\r\n// networkGeneration: {\r\n// id: 2,\r\n// title: \"3G\",\r\n// key: \"three_g\",\r\n// active: true\r\n// }\r\n// }\r\n// ]\r\n// }\r\n// }\r\n// ],\r\n// plan: {\r\n// id: 1,\r\n// name: \"Tourist\",\r\n// planType: \"tourist\",\r\n// description: \"Stay connected everywhere\",\r\n// active: true,\r\n// icon1:\r\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/7ff7987d-9696-4c2d-9117-f758ffb3bde1.png\",\r\n// icon2: \"\",\r\n// packages: [\r\n// {\r\n// id: 967,\r\n// title: \"3 GB\",\r\n// product: 32098,\r\n// defaultPrice: 51,\r\n// discount: false,\r\n// discountPercent: null,\r\n// discountAmount: 0,\r\n// priceWithDiscount: 51,\r\n// validity: {\r\n// id: 4,\r\n// title: \"30 days\",\r\n// period: 30,\r\n// active: true\r\n// },\r\n// purchaseType: {\r\n// id: 1,\r\n// title: \"Prepaid\",\r\n// key: \"prepaid\",\r\n// active: true\r\n// },\r\n// plan: {\r\n// id: 1,\r\n// name: \"Tourist\",\r\n// planType: \"tourist\",\r\n// description: \"Stay connected everywhere\",\r\n// active: true,\r\n// icon1:\r\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/7ff7987d-9696-4c2d-9117-f758ffb3bde1.png\",\r\n// icon2: \"\"\r\n// },\r\n// dataType: {\r\n// id: 2,\r\n// title: \"DATA only\",\r\n// key: \"data_only\",\r\n// active: true\r\n// }\r\n// },\r\n// {\r\n// id: 968,\r\n// title: \"1 GB\",\r\n// product: 32097,\r\n// defaultPrice: 23,\r\n// discount: false,\r\n// discountPercent: null,\r\n// discountAmount: 0,\r\n// priceWithDiscount: 23,\r\n// validity: {\r\n// id: 14,\r\n// title: \"1 year\",\r\n// period: 365,\r\n// active: true\r\n// },\r\n// purchaseType: {\r\n// id: 1,\r\n// title: \"Prepaid\",\r\n// key: \"prepaid\",\r\n// active: true\r\n// },\r\n// plan: {\r\n// id: 1,\r\n// name: \"Tourist\",\r\n// planType: \"tourist\",\r\n// description: \"Stay connected everywhere\",\r\n// active: true,\r\n// icon1:\r\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/7ff7987d-9696-4c2d-9117-f758ffb3bde1.png\",\r\n// icon2: \"\"\r\n// },\r\n// dataType: {\r\n// id: 2,\r\n// title: \"DATA only\",\r\n// key: \"data_only\",\r\n// active: true\r\n// }\r\n// },\r\n// {\r\n// id: 969,\r\n// title: \"3 GB\",\r\n// product: 32098,\r\n// defaultPrice: 56.5,\r\n// discount: false,\r\n// discountPercent: null,\r\n// discountAmount: 0,\r\n// priceWithDiscount: 56.5,\r\n// validity: {\r\n// id: 14,\r\n// title: \"1 year\",\r\n// period: 365,\r\n// active: true\r\n// },\r\n// purchaseType: {\r\n// id: 1,\r\n// title: \"Prepaid\",\r\n// key: \"prepaid\",\r\n// active: true\r\n// },\r\n// plan: {\r\n// id: 1,\r\n// name: \"Tourist\",\r\n// planType: \"tourist\",\r\n// description: \"Stay connected everywhere\",\r\n// active: true,\r\n// icon1:\r\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/7ff7987d-9696-4c2d-9117-f758ffb3bde1.png\",\r\n// icon2: \"\"\r\n// },\r\n// dataType: {\r\n// id: 2,\r\n// title: \"DATA only\",\r\n// key: \"data_only\",\r\n// active: true\r\n// }\r\n// },\r\n// {\r\n// id: 966,\r\n// title: \"1 GB\",\r\n// product: 32097,\r\n// defaultPrice: 19,\r\n// discount: false,\r\n// discountPercent: null,\r\n// discountAmount: 0,\r\n// priceWithDiscount: 19,\r\n// validity: {\r\n// id: 4,\r\n// title: \"30 days\",\r\n// period: 30,\r\n// active: true\r\n// },\r\n// purchaseType: {\r\n// id: 1,\r\n// title: \"Prepaid\",\r\n// key: \"prepaid\",\r\n// active: true\r\n// },\r\n// plan: {\r\n// id: 1,\r\n// name: \"Tourist\",\r\n// planType: \"tourist\",\r\n// description: \"Stay connected everywhere\",\r\n// active: true,\r\n// icon1:\r\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/7ff7987d-9696-4c2d-9117-f758ffb3bde1.png\",\r\n// icon2: \"\"\r\n// },\r\n// dataType: {\r\n// id: 2,\r\n// title: \"DATA only\",\r\n// key: \"data_only\",\r\n// active: true\r\n// }\r\n// }\r\n// ]\r\n// }\r\n// },\r\n// {\r\n// id: 352,\r\n// active: true,\r\n// zone: null,\r\n// planOperators: [\r\n// {\r\n// id: 220,\r\n// active: true,\r\n// operator: {\r\n// id: 92,\r\n// name: \"Mobilis\",\r\n// image:\r\n// \"https://telesim-api.dev2.4k.com.ua/share/locations/icon/1696a7f9-856e-4d8a-a110-7d4056c9588d.png\",\r\n// countryId: 170,\r\n// netGens: [\r\n// {\r\n// id: 287,\r\n// active: true,\r\n// networkGeneration: {\r\n// id: 5,\r\n// title: \"2G\",\r\n// key: \"2g\",\r\n// active: true\r\n// }\r\n// },\r\n// {\r\n// id: 284,\r\n// active: true,\r\n// networkGeneration: {\r\n// id: 2,\r\n// title: \"3G\",\r\n// key: \"three_g\",\r\n// active: true\r\n// }\r\n// }\r\n// ]\r\n// }\r\n// }\r\n// ],\r\n// plan: {\r\n// id: 3,\r\n// name: \"Tourist+\",\r\n// planType: \"tourist_plus\",\r\n// description: \"Get strong network\",\r\n// active: true,\r\n// icon1:\r\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/996000e4-5cfc-4248-8860-a1c8954144b3.png\",\r\n// icon2: \"\",\r\n// packages: []\r\n// }\r\n// }\r\n// ],\r\n// updatedBy: {}\r\n// });\r\n","import { IObjectKeys } from \"@/interfaces/IObjectKeys\";\r\nimport { sortItem } from \"@/enums/main/sortOrders\";\r\nimport { sortController } from \"@/utills/sort\";\r\nimport { getNestedValue } from \"@/utills/getNestedValue\";\r\n\r\nexport function useSortedModel(model: IObjectKeys[], activeSort?: sortItem) {\r\n if (!activeSort) {\r\n return model;\r\n }\r\n\r\n const { order, keyNameInModel = \"\" } = activeSort;\r\n const sort = sortController(order);\r\n\r\n const data = model ? [...model] : [];\r\n return data.sort((a, b) => {\r\n let aValue = getNestedValue(keyNameInModel, a) || \"\";\r\n let bValue = getNestedValue(keyNameInModel, b) || \"\";\r\n\r\n const aType = typeof aValue;\r\n const bType = typeof bValue;\r\n\r\n if (aType !== \"string\" && aType !== \"number\" && aType !== \"boolean\") {\r\n aValue = \"-1\";\r\n }\r\n if (bType !== \"string\" && bType !== \"number\" && bType !== \"boolean\") {\r\n bValue = \"-1\";\r\n }\r\n\r\n return sort(aValue, bValue);\r\n });\r\n}\r\n","import { ComputedRef, computed } from \"vue\";\r\nimport {\r\n ITableBodyCell,\r\n ITableBodyRow\r\n} from \"@/components/Table/ts/interfaces/TableStructure\";\r\nimport { sortItem } from \"@/enums/main/sortOrders\";\r\nimport { sortController } from \"@/utills/sort\";\r\n\r\nfunction searchSortTargetCell(\r\n row: ITableBodyRow,\r\n sorting: ComputedRef\r\n): ITableBodyCell | null {\r\n if (!sorting) {\r\n return null;\r\n }\r\n\r\n return (\r\n row.cells.find(\r\n ({ sort }: ITableBodyCell) => sort?.keyName === sorting?.value?.keyName\r\n ) || null\r\n );\r\n}\r\n\r\nexport function useSortedTableRows(\r\n rows: ITableBodyRow[],\r\n activeSortOption: ComputedRef\r\n): ComputedRef {\r\n return computed(() => {\r\n if (!activeSortOption.value) {\r\n return rows;\r\n }\r\n\r\n return [...rows].sort((a: ITableBodyRow, b: ITableBodyRow) => {\r\n const aValue: ITableBodyCell | null = searchSortTargetCell(\r\n a,\r\n activeSortOption\r\n );\r\n\r\n const bValue: ITableBodyCell | null = searchSortTargetCell(\r\n b,\r\n activeSortOption\r\n );\r\n\r\n if (!activeSortOption.value) return 0;\r\n\r\n if (aValue?.sort && bValue?.sort) {\r\n return sortController(activeSortOption.value.order)(\r\n aValue.sort.value,\r\n bValue.sort.value\r\n );\r\n }\r\n\r\n return 0;\r\n });\r\n });\r\n}\r\n","import { reactive } from \"vue\";\r\nimport { ITableHeadTab } from \"@/components/Table/ts/interfaces/TableStructure\";\r\n\r\nexport type changeTabType = (\r\n newConfiguration: ITableHeadTab\r\n) => ITableHeadTab | null;\r\n\r\nexport type useTableTabData = {\r\n configuration: ITableHeadTab;\r\n changeTab: changeTabType;\r\n};\r\n\r\nexport function useTableTabConfiguration(\r\n initialViewConfiguration: ITableHeadTab\r\n): useTableTabData {\r\n const configuration: ITableHeadTab = reactive(initialViewConfiguration);\r\n\r\n return {\r\n configuration,\r\n changeTab(newConfiguration: ITableHeadTab) {\r\n if (newConfiguration) {\r\n Object.entries(newConfiguration).forEach(([key, value]) => {\r\n configuration[key] = value;\r\n });\r\n\r\n return configuration;\r\n }\r\n return null;\r\n }\r\n };\r\n}\r\n","import { computed, ComputedRef, reactive, ref, Ref, watch } from \"vue\";\r\nimport {\r\n ITableBodyRow,\r\n ITableHeadTab\r\n} from \"@/components/Table/ts/interfaces/TableStructure\";\r\nimport { ITableViewConfiguration } from \"@/components/Table/ts/interfaces/common\";\r\nimport { sortItem, sortOrders } from \"@/enums/main/sortOrders\";\r\nimport {\r\n changeViewConfigurationType,\r\n useTableViewConfiguration\r\n} from \"@/hooks/tables/modules/baseTable/useTableViewConfiguration\";\r\nimport { useSortedModel } from \"@/hooks/tables/modules/baseTable/useSortedModel\";\r\nimport { useSortedTableRows } from \"@/hooks/tables/modules/baseTable/useSortedTableRows\";\r\nimport {\r\n changeTabType,\r\n useTableTabConfiguration\r\n} from \"@/hooks/tables/modules/baseTable/useTableTabConfiguration\";\r\n\r\nexport interface sorting {\r\n [key: string]: sortItem;\r\n}\r\n\r\ninterface useBaseTableOptions {\r\n initialViewConfiguration: ITableViewConfiguration;\r\n initialSortOptions: sorting;\r\n model: ComputedRef | Ref;\r\n sortRows?: boolean;\r\n\r\n // handlers\r\n generateRows: (model: any[]) => ITableBodyRow[];\r\n onViewConfigurationChanged?: (\r\n newConfiguration: ITableViewConfiguration\r\n ) => void;\r\n}\r\n\r\ninterface useTableWithTabsOptions {\r\n initialTab: ITableHeadTab;\r\n onTabChanged: (newTab: ITableHeadTab) => void;\r\n}\r\n\r\nexport interface useTableWithOutViewConfigurationOptions {\r\n initialSortOptions: sorting;\r\n model: ComputedRef;\r\n initialTab?: ITableHeadTab;\r\n\r\n // handlers\r\n generateRows: (model: any[]) => ITableBodyRow[];\r\n onTabChanged?: (newTab: ITableHeadTab) => void;\r\n}\r\n\r\nexport interface useTableWithOutViewConfig {\r\n rows: ComputedRef;\r\n viewConfiguration?: ITableViewConfiguration;\r\n changeSorting: (sortByKeyName: string) => void;\r\n currentSort: sorting;\r\n sortedModel: ComputedRef | Ref;\r\n}\r\n\r\nexport function useTableWithOutViewConfiguration(\r\n options: useTableWithOutViewConfigurationOptions\r\n): useTableWithOutViewConfig {\r\n const { generateRows, initialSortOptions, model } = options;\r\n\r\n const currentSort = reactive(initialSortOptions);\r\n\r\n const activeSortOption = computed(() => {\r\n return (\r\n Object.values(currentSort).find(\r\n ({ order }) => order !== sortOrders.turnOff\r\n ) || initialSortOptions[0]\r\n );\r\n });\r\n\r\n const sortedModel = ref(useSortedModel(model.value, activeSortOption.value));\r\n\r\n watch(\r\n [() => model.value, () => activeSortOption.value],\r\n () => {\r\n sortedModel.value = useSortedModel(model.value, activeSortOption.value);\r\n },\r\n { immediate: true, deep: true }\r\n );\r\n return {\r\n rows: computed(() => {\r\n return useSortedTableRows(\r\n generateRows(sortedModel.value || model.value),\r\n activeSortOption\r\n ).value;\r\n }),\r\n currentSort,\r\n changeSorting(sortByKeyName: string): void {\r\n if (currentSort) {\r\n Object.values(currentSort).forEach((option: sortItem) => {\r\n if (option.keyName === sortByKeyName) {\r\n const currentSortOrder = option.order;\r\n\r\n option.order =\r\n currentSortOrder === sortOrders.asc\r\n ? sortOrders.desc\r\n : sortOrders.asc;\r\n } else {\r\n option.order = sortOrders.turnOff;\r\n }\r\n });\r\n }\r\n },\r\n sortedModel\r\n };\r\n}\r\n\r\nexport interface useBaseTable {\r\n rows: ComputedRef;\r\n changeViewConfiguration: changeViewConfigurationType;\r\n changeSorting: (sortByKeyName: string) => void;\r\n viewConfiguration: ITableViewConfiguration;\r\n currentSort: sorting;\r\n sortedModel: ComputedRef | Ref;\r\n}\r\n\r\nexport function useBaseTable(options: useBaseTableOptions): useBaseTable {\r\n const {\r\n generateRows,\r\n initialSortOptions,\r\n initialViewConfiguration,\r\n onViewConfigurationChanged,\r\n model\r\n } = options;\r\n\r\n const {\r\n configuration: viewConfiguration,\r\n changeViewConfiguration\r\n } = useTableViewConfiguration(initialViewConfiguration);\r\n\r\n watch(viewConfiguration, (newConfiguration: ITableViewConfiguration) => {\r\n onViewConfigurationChanged?.(newConfiguration);\r\n });\r\n\r\n const currentSort = reactive(initialSortOptions || {});\r\n\r\n const activeSortOption = computed(() => {\r\n return (\r\n Object.values(currentSort).find(\r\n ({ order }) => order !== sortOrders.turnOff\r\n ) || initialSortOptions[0]\r\n );\r\n });\r\n\r\n const sortedModel = ref(useSortedModel(model.value, activeSortOption.value));\r\n\r\n watch(\r\n [() => model.value, () => activeSortOption.value],\r\n () => {\r\n sortedModel.value = useSortedModel(model.value, activeSortOption.value);\r\n },\r\n { immediate: true, deep: true }\r\n );\r\n\r\n return {\r\n rows: computed(() => {\r\n return useSortedTableRows(\r\n generateRows(sortedModel.value || model.value),\r\n activeSortOption\r\n ).value;\r\n }),\r\n sortedModel,\r\n viewConfiguration,\r\n changeViewConfiguration,\r\n currentSort,\r\n changeSorting(sortByKeyName: string): void {\r\n if (currentSort) {\r\n Object.values(currentSort).forEach((option: sortItem) => {\r\n if (option.keyName === sortByKeyName) {\r\n const currentSortOrder = option.order;\r\n\r\n option.order =\r\n currentSortOrder === sortOrders.asc\r\n ? sortOrders.desc\r\n : sortOrders.asc;\r\n } else {\r\n option.order = sortOrders.turnOff;\r\n }\r\n });\r\n }\r\n }\r\n };\r\n}\r\n\r\nexport interface useTableWithTabs {\r\n changeTab: changeTabType;\r\n selectedTab: ITableHeadTab;\r\n}\r\n\r\nexport function useTableWithTabs(\r\n options: useTableWithTabsOptions\r\n): useTableWithTabs {\r\n const { onTabChanged, initialTab } = options;\r\n\r\n const { configuration: selectedTab, changeTab } = useTableTabConfiguration(\r\n initialTab\r\n );\r\n\r\n watch(selectedTab, (newConfiguration: ITableHeadTab) => {\r\n onTabChanged?.(newConfiguration);\r\n });\r\n\r\n return {\r\n changeTab,\r\n selectedTab\r\n };\r\n}\r\n"],"sourceRoot":""}