{"version":3,"sources":["webpack:///./src/utills/sort.ts","webpack:///./src/components/Table/TableHeadCell.vue?947b","webpack:///./src/mixins/TableCellMixin.js","webpack:///./src/components/Table/TableHeadCell.vue","webpack:///./src/components/Table/TableHeadCell.vue?ae5b","webpack:///./src/components/Table/ts/AppTableLayout.vue?51ff","webpack:///./src/components/Table/ts/AppTableLayout.vue","webpack:///./src/components/Table/ts/AppTableLayout.vue?ef61","webpack:///./src/components/Table/ts/AppTableLayout.vue?8232","webpack:///./src/components/Table/TableHeadCell.vue?2269","webpack:///./src/components/Table/ts/AppTableLayout.vue?406a","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,OAAQ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AAwB,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.aefc08e7.js","sourcesContent":["import { sortOrder, sortOrders } from \"@/enums/main/sortOrders\";\n\ntype sortValue = string | number | boolean;\n\nfunction updateSortValueString(value: sortValue) {\n if (typeof value === \"string\") {\n return value.toLowerCase();\n }\n\n return value;\n}\n\nexport function sortByAsc(a: sortValue, b: sortValue): number {\n const updatedA = updateSortValueString(a);\n const updatedB = updateSortValueString(b);\n\n if (a === \"\" || a === null) return 1;\n if (b === \"\" || b === null) return -1;\n\n return updatedA > updatedB ? 1 : updatedA < updatedB ? -1 : 0;\n}\n\nexport function sortByDesc(a: sortValue, b: sortValue): number {\n const updatedA = updateSortValueString(a);\n const updatedB = updateSortValueString(b);\n\n if (a === \"\" || a === null) return 1;\n if (b === \"\" || b === null) return -1;\n\n return updatedA < updatedB ? 1 : updatedA > updatedB ? -1 : 0;\n}\n\nexport const sortController = (order: sortOrder) => {\n if (order === sortOrders.asc) {\n return sortByAsc;\n }\n\n return sortByDesc;\n};\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: \n `pseudo-table--cell pseudo-table--cell-size--${_ctx.size} ${\n _ctx.sort ? 'sortable' : ''\n }`\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 = {\n props: {\n id: {\n type: String,\n required: true\n },\n\n name: {\n type: String,\n required: true\n },\n\n size: {\n type: String,\n default: \"xs\"\n }\n }\n};\n","\nimport { defineComponent, PropType } from \"vue\";\nimport SortButton from \"@/components/ui/SortButton.vue\";\nimport { TableCellMixin } from \"@/mixins/TableCellMixin\";\nimport { sortItem } from \"@/enums/main/sortOrders\";\n\nexport default defineComponent({\n name: \"TableHeadCell\",\n components: { SortButton },\n mixins: [TableCellMixin],\n inheritAttrs: false,\n emits: { sort: null },\n props: {\n sort: {\n type: Object as PropType,\n default: null\n },\n\n onSort: {\n // todo: is deprecated. Will be removed. Use emit\n type: Function,\n required: false\n }\n },\n\n computed: {\n sortOrder() {\n return this.sort?.order || \"\";\n }\n },\n\n methods: {\n sortHandler(): void {\n if (this.sort) {\n this.$emit(\"sort\", this.sort.keyName);\n }\n }\n }\n});\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 \"/var/www/html/telesim-admin-panel/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: {\n total: _ctx.paginationTotal,\n current: _ctx.currentPage\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}","\nimport { defineComponent, PropType } from \"vue\";\nimport { tableHeadCellsList } from \"@/components/Table/ts/AppTable.vue\";\nimport TableRow from \"@/components/Table/TableRow.vue\";\nimport TableHeadCell from \"@/components/Table/TableHeadCell.vue\";\nimport TableFooter from \"@/components/Table/TableFooter.vue\";\nimport { ITableViewConfiguration } from \"@/components/Table/ts/interfaces/common\";\n\nexport default defineComponent({\n name: \"AppTableLayout\",\n components: { TableFooter, TableHeadCell, TableRow },\n inheritAttrs: false,\n props: {\n tableHead: {\n type: Array as PropType,\n required: true\n },\n\n paginationCaptureKey: {\n type: String,\n default: \"\"\n },\n\n totalRows: { type: Number, default: 0 },\n perPage: { type: Number, default: 10 },\n currentPage: { type: Number, default: 1 },\n spaceBetween: { type: Boolean, default: true },\n withFooter: {\n type: Boolean,\n default: true\n }\n },\n emits: [\"sort\", \"changeViewConfiguration\"],\n\n data() {\n return {\n viewConfiguration: {\n perPage: this.perPage,\n page: this.currentPage\n }\n } as {\n viewConfiguration: ITableViewConfiguration;\n };\n },\n\n computed: {\n paginationTotal(): number {\n if (this.totalRows === 0) {\n return 0;\n }\n\n return Math.ceil(this.totalRows / this.perPage);\n },\n\n paginationCapture(): string {\n if (!this.paginationCaptureKey) {\n return \"\";\n }\n\n const { totalRows = 0 } = this;\n const { perPage, page } = this.viewConfiguration;\n let count = totalRows > perPage ? perPage * page : this.totalRows;\n\n if (count > totalRows) {\n count = totalRows;\n }\n\n return `${count} of ${this.totalRows} ${this.paginationCaptureKey}`;\n }\n },\n\n watch: {\n perPage(perPage) {\n this.viewConfiguration.perPage = perPage;\n },\n\n currentPage(page) {\n this.viewConfiguration.page = page;\n },\n\n viewConfiguration: {\n handler({ page, perPage }: ITableViewConfiguration) {\n if (page === this.currentPage && perPage === this.perPage) {\n return;\n }\n\n this.$emit(\"changeViewConfiguration\", this.viewConfiguration);\n },\n deep: true\n }\n },\n\n methods: {\n changeCurrentPageHandler(page: number): void {\n this.viewConfiguration.page = page;\n },\n\n changePerPageHandler(perPage: number): void {\n this.viewConfiguration.perPage = perPage;\n },\n\n sortHandler(keyName: string): void {\n this.$emit(\"sort\", keyName);\n }\n }\n});\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 \"/var/www/html/telesim-admin-panel/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/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../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-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/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../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-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 {\n ITableBodyRow,\n tableComponentNames,\n tableContentItem\n} from \"@/components/Table/ts/interfaces/TableStructure\";\n\nexport function mapTableRowsToTableContent(rows: ITableBodyRow[]) {\n return rows.map(({ cells, ...row }) => {\n return {\n ...row,\n cells: cells.map(\n ({\n infoWithImage,\n country,\n checkmark,\n label,\n userActions,\n badge,\n rightAlign,\n json,\n ...cell\n }) => {\n let componentName = tableComponentNames.cellLabel;\n\n if (infoWithImage) {\n componentName = tableComponentNames.cellInfoWithImage;\n } else if (country) {\n componentName = tableComponentNames.cellCountry;\n } else if (checkmark !== undefined) {\n componentName = tableComponentNames.cellCheckmark;\n } else if (userActions) {\n componentName = tableComponentNames.userActions;\n } else if (badge) {\n componentName = tableComponentNames.cellBadge;\n } else if (json) {\n componentName = tableComponentNames.cellJson;\n }\n\n return {\n componentName,\n componentContent: (infoWithImage ??\n country ??\n checkmark ??\n label ??\n userActions ??\n badge) as tableContentItem,\n cellProps: cell,\n params: {\n rightAlign: rightAlign ?? false\n }\n };\n }\n )\n };\n });\n}\n","import { reactive } from \"vue\";\nimport { ITableViewConfiguration } from \"@/components/Table/ts/interfaces/common\";\n\nexport type changeViewConfigurationType = (\n newConfiguration: ITableViewConfiguration\n) => ITableViewConfiguration;\n\nexport type useTableViewConfigurationData = {\n configuration: ITableViewConfiguration;\n changeViewConfiguration: changeViewConfigurationType;\n};\n\nexport function useTableViewConfiguration(\n initialViewConfiguration: ITableViewConfiguration\n): useTableViewConfigurationData {\n const configuration: ITableViewConfiguration = reactive(\n initialViewConfiguration\n );\n\n return {\n configuration,\n changeViewConfiguration(newConfiguration: ITableViewConfiguration) {\n Object.entries(newConfiguration).forEach(([key, value]) => {\n configuration[key] = value;\n });\n\n return configuration;\n }\n };\n}\n","import { IObjectKeys } from \"@/interfaces/IObjectKeys\";\n\nexport function getNestedValue(path: string, obj: IObjectKeys): any {\n const nestedFields = path.split(\".\"); // ?;\n let val: any = obj;\n let i = 0;\n\n while (i < nestedFields.length) {\n const key: string = nestedFields[i];\n\n if (typeof val !== \"object\") {\n i = nestedFields.length;\n break;\n }\n\n if (val[key] === undefined) {\n return null;\n }\n\n if (typeof val === \"object\" && val[key]) {\n val = val[key];\n i++;\n } else {\n i = nestedFields.length;\n }\n }\n\n return val;\n}\n//\n// getNestedValue(\"updatedAt.fullName\", {\n// id: 170,\n// name: \"Algeria\",\n// isoCode: \"AG\",\n// icon:\n// \"https://telesim-api.dev2.4k.com.ua/share/locations/icon/c5db84d3-da92-4842-b7cf-1112cdb83d64.png\",\n// smallImage: \"\",\n// bigImage:\n// \"https://telesim-api.dev2.4k.com.ua/share/locations/bigImage/10942e9b-eb93-46f7-9837-9b481d0cd9c6.png\",\n// secondaryBigImage: null,\n// popular: false,\n// active: true,\n// createdAt: \"2021-03-30T07:20:31.722Z\",\n// updatedAt: \"2021-07-29T12:06:20.424Z\",\n// countryPlans: [\n// {\n// id: 350,\n// active: true,\n// zone: {\n// id: 12,\n// title: \"Zone L\",\n// key: \"zonel\"\n// },\n// planOperators: [\n// {\n// id: 218,\n// active: true,\n// operator: {\n// id: 92,\n// name: \"Mobilis\",\n// image:\n// \"https://telesim-api.dev2.4k.com.ua/share/locations/icon/1696a7f9-856e-4d8a-a110-7d4056c9588d.png\",\n// countryId: 170,\n// netGens: [\n// {\n// id: 287,\n// active: true,\n// networkGeneration: {\n// id: 5,\n// title: \"2G\",\n// key: \"2g\",\n// active: true\n// }\n// },\n// {\n// id: 284,\n// active: true,\n// networkGeneration: {\n// id: 2,\n// title: \"3G\",\n// key: \"three_g\",\n// active: true\n// }\n// }\n// ]\n// }\n// }\n// ],\n// plan: {\n// id: 1,\n// name: \"Tourist\",\n// planType: \"tourist\",\n// description: \"Stay connected everywhere\",\n// active: true,\n// icon1:\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/7ff7987d-9696-4c2d-9117-f758ffb3bde1.png\",\n// icon2: \"\",\n// packages: [\n// {\n// id: 967,\n// title: \"3 GB\",\n// product: 32098,\n// defaultPrice: 51,\n// discount: false,\n// discountPercent: null,\n// discountAmount: 0,\n// priceWithDiscount: 51,\n// validity: {\n// id: 4,\n// title: \"30 days\",\n// period: 30,\n// active: true\n// },\n// purchaseType: {\n// id: 1,\n// title: \"Prepaid\",\n// key: \"prepaid\",\n// active: true\n// },\n// plan: {\n// id: 1,\n// name: \"Tourist\",\n// planType: \"tourist\",\n// description: \"Stay connected everywhere\",\n// active: true,\n// icon1:\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/7ff7987d-9696-4c2d-9117-f758ffb3bde1.png\",\n// icon2: \"\"\n// },\n// dataType: {\n// id: 2,\n// title: \"DATA only\",\n// key: \"data_only\",\n// active: true\n// }\n// },\n// {\n// id: 968,\n// title: \"1 GB\",\n// product: 32097,\n// defaultPrice: 23,\n// discount: false,\n// discountPercent: null,\n// discountAmount: 0,\n// priceWithDiscount: 23,\n// validity: {\n// id: 14,\n// title: \"1 year\",\n// period: 365,\n// active: true\n// },\n// purchaseType: {\n// id: 1,\n// title: \"Prepaid\",\n// key: \"prepaid\",\n// active: true\n// },\n// plan: {\n// id: 1,\n// name: \"Tourist\",\n// planType: \"tourist\",\n// description: \"Stay connected everywhere\",\n// active: true,\n// icon1:\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/7ff7987d-9696-4c2d-9117-f758ffb3bde1.png\",\n// icon2: \"\"\n// },\n// dataType: {\n// id: 2,\n// title: \"DATA only\",\n// key: \"data_only\",\n// active: true\n// }\n// },\n// {\n// id: 969,\n// title: \"3 GB\",\n// product: 32098,\n// defaultPrice: 56.5,\n// discount: false,\n// discountPercent: null,\n// discountAmount: 0,\n// priceWithDiscount: 56.5,\n// validity: {\n// id: 14,\n// title: \"1 year\",\n// period: 365,\n// active: true\n// },\n// purchaseType: {\n// id: 1,\n// title: \"Prepaid\",\n// key: \"prepaid\",\n// active: true\n// },\n// plan: {\n// id: 1,\n// name: \"Tourist\",\n// planType: \"tourist\",\n// description: \"Stay connected everywhere\",\n// active: true,\n// icon1:\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/7ff7987d-9696-4c2d-9117-f758ffb3bde1.png\",\n// icon2: \"\"\n// },\n// dataType: {\n// id: 2,\n// title: \"DATA only\",\n// key: \"data_only\",\n// active: true\n// }\n// },\n// {\n// id: 966,\n// title: \"1 GB\",\n// product: 32097,\n// defaultPrice: 19,\n// discount: false,\n// discountPercent: null,\n// discountAmount: 0,\n// priceWithDiscount: 19,\n// validity: {\n// id: 4,\n// title: \"30 days\",\n// period: 30,\n// active: true\n// },\n// purchaseType: {\n// id: 1,\n// title: \"Prepaid\",\n// key: \"prepaid\",\n// active: true\n// },\n// plan: {\n// id: 1,\n// name: \"Tourist\",\n// planType: \"tourist\",\n// description: \"Stay connected everywhere\",\n// active: true,\n// icon1:\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/7ff7987d-9696-4c2d-9117-f758ffb3bde1.png\",\n// icon2: \"\"\n// },\n// dataType: {\n// id: 2,\n// title: \"DATA only\",\n// key: \"data_only\",\n// active: true\n// }\n// }\n// ]\n// }\n// },\n// {\n// id: 352,\n// active: true,\n// zone: null,\n// planOperators: [\n// {\n// id: 220,\n// active: true,\n// operator: {\n// id: 92,\n// name: \"Mobilis\",\n// image:\n// \"https://telesim-api.dev2.4k.com.ua/share/locations/icon/1696a7f9-856e-4d8a-a110-7d4056c9588d.png\",\n// countryId: 170,\n// netGens: [\n// {\n// id: 287,\n// active: true,\n// networkGeneration: {\n// id: 5,\n// title: \"2G\",\n// key: \"2g\",\n// active: true\n// }\n// },\n// {\n// id: 284,\n// active: true,\n// networkGeneration: {\n// id: 2,\n// title: \"3G\",\n// key: \"three_g\",\n// active: true\n// }\n// }\n// ]\n// }\n// }\n// ],\n// plan: {\n// id: 3,\n// name: \"Tourist+\",\n// planType: \"tourist_plus\",\n// description: \"Get strong network\",\n// active: true,\n// icon1:\n// \"https://telesim-api.dev2.4k.com.ua/share/plans/icon1/996000e4-5cfc-4248-8860-a1c8954144b3.png\",\n// icon2: \"\",\n// packages: []\n// }\n// }\n// ],\n// updatedBy: {}\n// });\n","import { IObjectKeys } from \"@/interfaces/IObjectKeys\";\nimport { sortItem } from \"@/enums/main/sortOrders\";\nimport { sortController } from \"@/utills/sort\";\nimport { getNestedValue } from \"@/utills/getNestedValue\";\n\nexport function useSortedModel(model: IObjectKeys[], activeSort?: sortItem) {\n if (!activeSort) {\n return model;\n }\n\n const { order, keyNameInModel = \"\" } = activeSort;\n const sort = sortController(order);\n\n const data = model ? [...model] : [];\n return data.sort((a, b) => {\n let aValue = getNestedValue(keyNameInModel, a) || \"\";\n let bValue = getNestedValue(keyNameInModel, b) || \"\";\n\n const aType = typeof aValue;\n const bType = typeof bValue;\n\n if (aType !== \"string\" && aType !== \"number\" && aType !== \"boolean\") {\n aValue = \"-1\";\n }\n if (bType !== \"string\" && bType !== \"number\" && bType !== \"boolean\") {\n bValue = \"-1\";\n }\n\n return sort(aValue, bValue);\n });\n}\n","import { ComputedRef, computed } from \"vue\";\nimport {\n ITableBodyCell,\n ITableBodyRow\n} from \"@/components/Table/ts/interfaces/TableStructure\";\nimport { sortItem } from \"@/enums/main/sortOrders\";\nimport { sortController } from \"@/utills/sort\";\n\nfunction searchSortTargetCell(\n row: ITableBodyRow,\n sorting: ComputedRef\n): ITableBodyCell | null {\n if (!sorting) {\n return null;\n }\n\n return (\n row.cells.find(\n ({ sort }: ITableBodyCell) => sort?.keyName === sorting?.value?.keyName\n ) || null\n );\n}\n\nexport function useSortedTableRows(\n rows: ITableBodyRow[],\n activeSortOption: ComputedRef\n): ComputedRef {\n return computed(() => {\n if (!activeSortOption.value) {\n return rows;\n }\n\n return [...rows].sort((a: ITableBodyRow, b: ITableBodyRow) => {\n const aValue: ITableBodyCell | null = searchSortTargetCell(\n a,\n activeSortOption\n );\n\n const bValue: ITableBodyCell | null = searchSortTargetCell(\n b,\n activeSortOption\n );\n\n if (!activeSortOption.value) return 0;\n\n if (aValue?.sort && bValue?.sort) {\n return sortController(activeSortOption.value.order)(\n aValue.sort.value,\n bValue.sort.value\n );\n }\n\n return 0;\n });\n });\n}\n","import { reactive } from \"vue\";\nimport { ITableHeadTab } from \"@/components/Table/ts/interfaces/TableStructure\";\n\nexport type changeTabType = (\n newConfiguration: ITableHeadTab\n) => ITableHeadTab | null;\n\nexport type useTableTabData = {\n configuration: ITableHeadTab;\n changeTab: changeTabType;\n};\n\nexport function useTableTabConfiguration(\n initialViewConfiguration: ITableHeadTab\n): useTableTabData {\n const configuration: ITableHeadTab = reactive(initialViewConfiguration);\n\n return {\n configuration,\n changeTab(newConfiguration: ITableHeadTab) {\n if (newConfiguration) {\n Object.entries(newConfiguration).forEach(([key, value]) => {\n configuration[key] = value;\n });\n\n return configuration;\n }\n return null;\n }\n };\n}\n","import { computed, ComputedRef, reactive, ref, Ref, watch } from \"vue\";\nimport {\n ITableBodyRow,\n ITableHeadTab\n} from \"@/components/Table/ts/interfaces/TableStructure\";\nimport { ITableViewConfiguration } from \"@/components/Table/ts/interfaces/common\";\nimport { sortItem, sortOrders } from \"@/enums/main/sortOrders\";\nimport {\n changeViewConfigurationType,\n useTableViewConfiguration\n} from \"@/hooks/tables/modules/baseTable/useTableViewConfiguration\";\nimport { useSortedModel } from \"@/hooks/tables/modules/baseTable/useSortedModel\";\nimport { useSortedTableRows } from \"@/hooks/tables/modules/baseTable/useSortedTableRows\";\nimport {\n changeTabType,\n useTableTabConfiguration\n} from \"@/hooks/tables/modules/baseTable/useTableTabConfiguration\";\n\nexport interface sorting {\n [key: string]: sortItem;\n}\n\ninterface useBaseTableOptions {\n initialViewConfiguration: ITableViewConfiguration;\n initialSortOptions: sorting;\n model: ComputedRef | Ref;\n sortRows?: boolean;\n\n // handlers\n generateRows: (model: any[]) => ITableBodyRow[];\n onViewConfigurationChanged?: (\n newConfiguration: ITableViewConfiguration\n ) => void;\n}\n\ninterface useTableWithTabsOptions {\n initialTab: ITableHeadTab;\n onTabChanged: (newTab: ITableHeadTab) => void;\n}\n\nexport interface useTableWithOutViewConfigurationOptions {\n initialSortOptions: sorting;\n model: ComputedRef;\n initialTab?: ITableHeadTab;\n\n // handlers\n generateRows: (model: any[]) => ITableBodyRow[];\n onTabChanged?: (newTab: ITableHeadTab) => void;\n}\n\nexport interface useTableWithOutViewConfig {\n rows: ComputedRef;\n viewConfiguration?: ITableViewConfiguration;\n changeSorting: (sortByKeyName: string) => void;\n currentSort: sorting;\n sortedModel: ComputedRef | Ref;\n}\n\nexport function useTableWithOutViewConfiguration(\n options: useTableWithOutViewConfigurationOptions\n): useTableWithOutViewConfig {\n const { generateRows, initialSortOptions, model } = options;\n\n const currentSort = reactive(initialSortOptions);\n\n const activeSortOption = computed(() => {\n return (\n Object.values(currentSort).find(\n ({ order }) => order !== sortOrders.turnOff\n ) || initialSortOptions[0]\n );\n });\n\n const sortedModel = ref(useSortedModel(model.value, activeSortOption.value));\n\n watch(\n [() => model.value, () => activeSortOption.value],\n () => {\n sortedModel.value = useSortedModel(model.value, activeSortOption.value);\n },\n { immediate: true, deep: true }\n );\n return {\n rows: computed(() => {\n return useSortedTableRows(\n generateRows(sortedModel.value || model.value),\n activeSortOption\n ).value;\n }),\n currentSort,\n changeSorting(sortByKeyName: string): void {\n if (currentSort) {\n Object.values(currentSort).forEach((option: sortItem) => {\n if (option.keyName === sortByKeyName) {\n const currentSortOrder = option.order;\n\n option.order =\n currentSortOrder === sortOrders.asc\n ? sortOrders.desc\n : sortOrders.asc;\n } else {\n option.order = sortOrders.turnOff;\n }\n });\n }\n },\n sortedModel\n };\n}\n\nexport interface useBaseTable {\n rows: ComputedRef;\n changeViewConfiguration: changeViewConfigurationType;\n changeSorting: (sortByKeyName: string) => void;\n viewConfiguration: ITableViewConfiguration;\n currentSort: sorting;\n sortedModel: ComputedRef | Ref;\n}\n\nexport function useBaseTable(options: useBaseTableOptions): useBaseTable {\n const {\n generateRows,\n initialSortOptions,\n initialViewConfiguration,\n onViewConfigurationChanged,\n model\n } = options;\n\n const {\n configuration: viewConfiguration,\n changeViewConfiguration\n } = useTableViewConfiguration(initialViewConfiguration);\n\n watch(viewConfiguration, (newConfiguration: ITableViewConfiguration) => {\n onViewConfigurationChanged?.(newConfiguration);\n });\n\n const currentSort = reactive(initialSortOptions || {});\n\n const activeSortOption = computed(() => {\n return (\n Object.values(currentSort).find(\n ({ order }) => order !== sortOrders.turnOff\n ) || initialSortOptions[0]\n );\n });\n\n const sortedModel = ref(useSortedModel(model.value, activeSortOption.value));\n\n watch(\n [() => model.value, () => activeSortOption.value],\n () => {\n sortedModel.value = useSortedModel(model.value, activeSortOption.value);\n },\n { immediate: true, deep: true }\n );\n\n return {\n rows: computed(() => {\n return useSortedTableRows(\n generateRows(sortedModel.value || model.value),\n activeSortOption\n ).value;\n }),\n sortedModel,\n viewConfiguration,\n changeViewConfiguration,\n currentSort,\n changeSorting(sortByKeyName: string): void {\n if (currentSort) {\n Object.values(currentSort).forEach((option: sortItem) => {\n if (option.keyName === sortByKeyName) {\n const currentSortOrder = option.order;\n\n option.order =\n currentSortOrder === sortOrders.asc\n ? sortOrders.desc\n : sortOrders.asc;\n } else {\n option.order = sortOrders.turnOff;\n }\n });\n }\n }\n };\n}\n\nexport interface useTableWithTabs {\n changeTab: changeTabType;\n selectedTab: ITableHeadTab;\n}\n\nexport function useTableWithTabs(\n options: useTableWithTabsOptions\n): useTableWithTabs {\n const { onTabChanged, initialTab } = options;\n\n const { configuration: selectedTab, changeTab } = useTableTabConfiguration(\n initialTab\n );\n\n watch(selectedTab, (newConfiguration: ITableHeadTab) => {\n onTabChanged?.(newConfiguration);\n });\n\n return {\n changeTab,\n selectedTab\n };\n}\n"],"sourceRoot":""}