@economic/taco 2.41.1 → 2.41.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -1
- package/dist/taco.cjs.development.js +1 -1
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
@@ -19,7 +19,7 @@ function useTableRowSelectionListener(table, onRowSelect) {
|
|
19
19
|
* we only need to know if selection was enabled or disabled, because enableRowSelection/enableMultiRowSelection functions
|
20
20
|
* will be applied directly to particular rows.
|
21
21
|
*/
|
22
|
-
}, [!!table.options.enableRowSelection, !!table.options.enableMultiRowSelection, rowSelection]);
|
22
|
+
}, [!!table.options.enableRowSelection, !!table.options.enableMultiRowSelection, JSON.stringify(rowSelection)]);
|
23
23
|
}
|
24
24
|
|
25
25
|
export { useTableRowSelectionListener };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableRowSelectionListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableRowSelectHandler } from '../../types';\nimport React from 'react';\n\nexport function useTableRowSelectionListener<TType = unknown>(\n table: ReactTable<TType>,\n onRowSelect?: TableRowSelectHandler<TType>\n) {\n const rows = table.getSelectedRowModel().flatRows;\n const rowSelection = React.useMemo(() => rows.map(row => row.original), [rows]);\n\n useLazyEffect(() => {\n if (table.options.enableRowSelection && typeof onRowSelect === 'function') {\n if (table.options.enableMultiRowSelection) {\n onRowSelect(rowSelection);\n } else {\n onRowSelect([rowSelection[0]] ?? []);\n }\n }\n /**\n * Casting to a boolean, since enableRowSelection and enableMultiRowSelection can be a functions,\n * and setting a function as depoendency will lead to infinity loop. And in case of row selection useEffect,\n * we only need to know if selection was enabled or disabled, because enableRowSelection/enableMultiRowSelection functions\n * will be applied directly to particular rows.\n */\n }, [!!table.options.enableRowSelection, !!table.options.enableMultiRowSelection, rowSelection]);\n}\n"],"names":["useTableRowSelectionListener","table","onRowSelect","rows","getSelectedRowModel","flatRows","rowSelection","React","useMemo","map","row","original","useLazyEffect","options","enableRowSelection","enableMultiRowSelection","_ref"],"mappings":";;;SAKgBA,4BAA4BA,CACxCC,KAAwB,EACxBC,WAA0C;EAE1C,MAAMC,IAAI,GAAGF,KAAK,CAACG,mBAAmB,EAAE,CAACC,QAAQ;EACjD,MAAMC,YAAY,GAAGC,cAAK,CAACC,OAAO,CAAC,MAAML,IAAI,CAACM,GAAG,CAACC,GAAG,IAAIA,GAAG,CAACC,QAAQ,CAAC,EAAE,CAACR,IAAI,CAAC,CAAC;EAE/ES,aAAa,CAAC;IACV,IAAIX,KAAK,CAACY,OAAO,CAACC,kBAAkB,IAAI,OAAOZ,WAAW,KAAK,UAAU,EAAE;MACvE,IAAID,KAAK,CAACY,OAAO,CAACE,uBAAuB,EAAE;QACvCb,WAAW,CAACI,YAAY,CAAC;OAC5B,MAAM;QAAA,IAAAU,IAAA;QACHd,WAAW,EAAAc,IAAA,GAAC,CAACV,YAAY,CAAC,CAAC,CAAC,CAAC,cAAAU,IAAA,cAAAA,IAAA,GAAI,EAAE,CAAC;;;;;;;;;GAS/C,EAAE,CAAC,CAAC,CAACf,KAAK,CAACY,OAAO,CAACC,kBAAkB,EAAE,CAAC,CAACb,KAAK,CAACY,OAAO,CAACE,uBAAuB,
|
1
|
+
{"version":3,"file":"useTableRowSelectionListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableRowSelectHandler } from '../../types';\nimport React from 'react';\n\nexport function useTableRowSelectionListener<TType = unknown>(\n table: ReactTable<TType>,\n onRowSelect?: TableRowSelectHandler<TType>\n) {\n const rows = table.getSelectedRowModel().flatRows;\n const rowSelection = React.useMemo(() => rows.map(row => row.original), [rows]);\n\n useLazyEffect(() => {\n if (table.options.enableRowSelection && typeof onRowSelect === 'function') {\n if (table.options.enableMultiRowSelection) {\n onRowSelect(rowSelection);\n } else {\n onRowSelect([rowSelection[0]] ?? []);\n }\n }\n /**\n * Casting to a boolean, since enableRowSelection and enableMultiRowSelection can be a functions,\n * and setting a function as depoendency will lead to infinity loop. And in case of row selection useEffect,\n * we only need to know if selection was enabled or disabled, because enableRowSelection/enableMultiRowSelection functions\n * will be applied directly to particular rows.\n */\n }, [!!table.options.enableRowSelection, !!table.options.enableMultiRowSelection, JSON.stringify(rowSelection)]);\n}\n"],"names":["useTableRowSelectionListener","table","onRowSelect","rows","getSelectedRowModel","flatRows","rowSelection","React","useMemo","map","row","original","useLazyEffect","options","enableRowSelection","enableMultiRowSelection","_ref","JSON","stringify"],"mappings":";;;SAKgBA,4BAA4BA,CACxCC,KAAwB,EACxBC,WAA0C;EAE1C,MAAMC,IAAI,GAAGF,KAAK,CAACG,mBAAmB,EAAE,CAACC,QAAQ;EACjD,MAAMC,YAAY,GAAGC,cAAK,CAACC,OAAO,CAAC,MAAML,IAAI,CAACM,GAAG,CAACC,GAAG,IAAIA,GAAG,CAACC,QAAQ,CAAC,EAAE,CAACR,IAAI,CAAC,CAAC;EAE/ES,aAAa,CAAC;IACV,IAAIX,KAAK,CAACY,OAAO,CAACC,kBAAkB,IAAI,OAAOZ,WAAW,KAAK,UAAU,EAAE;MACvE,IAAID,KAAK,CAACY,OAAO,CAACE,uBAAuB,EAAE;QACvCb,WAAW,CAACI,YAAY,CAAC;OAC5B,MAAM;QAAA,IAAAU,IAAA;QACHd,WAAW,EAAAc,IAAA,GAAC,CAACV,YAAY,CAAC,CAAC,CAAC,CAAC,cAAAU,IAAA,cAAAA,IAAA,GAAI,EAAE,CAAC;;;;;;;;;GAS/C,EAAE,CAAC,CAAC,CAACf,KAAK,CAACY,OAAO,CAACC,kBAAkB,EAAE,CAAC,CAACb,KAAK,CAACY,OAAO,CAACE,uBAAuB,EAAEE,IAAI,CAACC,SAAS,CAACZ,YAAY,CAAC,CAAC,CAAC;AACnH;;;;"}
|
@@ -11391,7 +11391,7 @@ function useTableRowSelectionListener(table, onRowSelect) {
|
|
11391
11391
|
* we only need to know if selection was enabled or disabled, because enableRowSelection/enableMultiRowSelection functions
|
11392
11392
|
* will be applied directly to particular rows.
|
11393
11393
|
*/
|
11394
|
-
}, [!!table.options.enableRowSelection, !!table.options.enableMultiRowSelection, rowSelection]);
|
11394
|
+
}, [!!table.options.enableRowSelection, !!table.options.enableMultiRowSelection, JSON.stringify(rowSelection)]);
|
11395
11395
|
}
|
11396
11396
|
|
11397
11397
|
function resetHighlightedColumnIndexes(value, table) {
|