You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
4.3 KiB
1 lines
4.3 KiB
{"ast":null,"code":"function useUtils(store) {\n const setCurrentRow = row => {\n store.commit(\"setCurrentRow\", row);\n };\n const getSelectionRows = () => {\n return store.getSelectionRows();\n };\n const toggleRowSelection = (row, selected, ignoreSelectable = true) => {\n store.toggleRowSelection(row, selected, false, ignoreSelectable);\n store.updateAllSelected();\n };\n const clearSelection = () => {\n store.clearSelection();\n };\n const clearFilter = columnKeys => {\n store.clearFilter(columnKeys);\n };\n const toggleAllSelection = () => {\n store.commit(\"toggleAllSelection\");\n };\n const toggleRowExpansion = (row, expanded) => {\n store.toggleRowExpansionAdapter(row, expanded);\n };\n const clearSort = () => {\n store.clearSort();\n };\n const sort = (prop, order) => {\n store.commit(\"sort\", {\n prop,\n order\n });\n };\n const updateKeyChildren = (key, data) => {\n store.updateKeyChildren(key, data);\n };\n return {\n setCurrentRow,\n getSelectionRows,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n sort,\n updateKeyChildren\n };\n}\nexport { useUtils as default };","map":{"version":3,"names":["useUtils","store","setCurrentRow","row","commit","getSelectionRows","toggleRowSelection","selected","ignoreSelectable","updateAllSelected","clearSelection","clearFilter","columnKeys","toggleAllSelection","toggleRowExpansion","expanded","toggleRowExpansionAdapter","clearSort","sort","prop","order","updateKeyChildren","key","data"],"sources":["../../../../../../../packages/components/table/src/table/utils-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport type { Store } from '../store'\n\nfunction useUtils<T>(store: Store<T>) {\n const setCurrentRow = (row: T) => {\n store.commit('setCurrentRow', row)\n }\n const getSelectionRows = () => {\n return store.getSelectionRows()\n }\n const toggleRowSelection = (\n row: T,\n selected?: boolean,\n ignoreSelectable = true\n ) => {\n store.toggleRowSelection(row, selected, false, ignoreSelectable)\n store.updateAllSelected()\n }\n const clearSelection = () => {\n store.clearSelection()\n }\n const clearFilter = (columnKeys?: string[]) => {\n store.clearFilter(columnKeys)\n }\n const toggleAllSelection = () => {\n store.commit('toggleAllSelection')\n }\n const toggleRowExpansion = (row: T, expanded?: boolean) => {\n store.toggleRowExpansionAdapter(row, expanded)\n }\n const clearSort = () => {\n store.clearSort()\n }\n const sort = (prop: string, order: string) => {\n store.commit('sort', { prop, order })\n }\n const updateKeyChildren = (key: string, data: T[]) => {\n store.updateKeyChildren(key, data)\n }\n\n return {\n setCurrentRow,\n getSelectionRows,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n sort,\n updateKeyChildren,\n }\n}\n\nexport default useUtils\n"],"mappings":"AAAA,SAASA,QAAQA,CAACC,KAAK,EAAE;EACvB,MAAMC,aAAa,GAAIC,GAAG,IAAK;IAC7BF,KAAK,CAACG,MAAM,CAAC,eAAe,EAAED,GAAG,CAAC;EACtC,CAAG;EACD,MAAME,gBAAgB,GAAGA,CAAA,KAAM;IAC7B,OAAOJ,KAAK,CAACI,gBAAgB,EAAE;EACnC,CAAG;EACD,MAAMC,kBAAkB,GAAGA,CAACH,GAAG,EAAEI,QAAQ,EAAEC,gBAAgB,GAAG,IAAI,KAAK;IACrEP,KAAK,CAACK,kBAAkB,CAACH,GAAG,EAAEI,QAAQ,EAAE,KAAK,EAAEC,gBAAgB,CAAC;IAChEP,KAAK,CAACQ,iBAAiB,EAAE;EAC7B,CAAG;EACD,MAAMC,cAAc,GAAGA,CAAA,KAAM;IAC3BT,KAAK,CAACS,cAAc,EAAE;EAC1B,CAAG;EACD,MAAMC,WAAW,GAAIC,UAAU,IAAK;IAClCX,KAAK,CAACU,WAAW,CAACC,UAAU,CAAC;EACjC,CAAG;EACD,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;IAC/BZ,KAAK,CAACG,MAAM,CAAC,oBAAoB,CAAC;EACtC,CAAG;EACD,MAAMU,kBAAkB,GAAGA,CAACX,GAAG,EAAEY,QAAQ,KAAK;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