@economic/taco 2.8.1 → 2.9.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Icon/components/Lock.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Navigation2/components/Link.d.ts +1 -1
- package/dist/components/Select2/components/Option.d.ts +1 -1
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Table3/components/columns/styles.d.ts +1 -0
- package/dist/components/Table3/components/toolbar/ColumnSettings.d.ts +3 -2
- package/dist/components/Table3/components/toolbar/Filter/filters/Filters.d.ts +1 -1
- package/dist/components/Table3/components/toolbar/PrintButton/WarningDialog.d.ts +2 -1
- package/dist/components/Table3/components/toolbar/Settings.d.ts +6 -0
- package/dist/components/Table3/hooks/features/useCurrentRow.d.ts +3 -3
- package/dist/components/Table3/hooks/useCssGrid.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Lock.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Lock.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +2 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +3 -3
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +3 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js +3 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +3 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +2 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +34 -35
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +19 -7
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js +66 -18
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +12 -8
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/WarningDialog.js +5 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/WarningDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +61 -0
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Toolbar.js +8 -35
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Toolbar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnFreezing.js +3 -2
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnFreezing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useCurrentRow.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useCurrentRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowClick.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowClick.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowSelection.js +5 -2
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowSelection.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useCurrentRowListener.js +2 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useCurrentRowListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useEditingStateListener.js +8 -4
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useEditingStateListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useShortcutsListener.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useShortcutsListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js +7 -3
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +9 -4
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +2 -2
- package/dist/taco.cjs.development.js +352 -217
- 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
- package/types.json +14055 -11802
@@ -1,16 +1,10 @@
|
|
1
1
|
import React__default from 'react';
|
2
|
-
import { Tooltip } from '../../../Tooltip/Tooltip.js';
|
3
|
-
import { IconButton } from '../../../IconButton/IconButton.js';
|
4
|
-
import { useLocalization } from '../../../Provider/Localization.js';
|
5
2
|
import { Group } from '../../../Group/Group.js';
|
6
|
-
import { Menu } from '../../../Menu/Menu.js';
|
7
|
-
import { RowHeight } from './RowHeight.js';
|
8
3
|
import { Search } from './Search.js';
|
9
|
-
import {
|
10
|
-
import { ColumnSettings } from './ColumnSettings.js';
|
4
|
+
import { FiltersButton } from './Filter/filters/Filters.js';
|
11
5
|
import { EditButton } from './EditButton.js';
|
12
6
|
import { PrintButton } from './PrintButton/PrintButton.js';
|
13
|
-
import {
|
7
|
+
import { SettingsButton } from './Settings.js';
|
14
8
|
|
15
9
|
function Toolbar(props) {
|
16
10
|
const {
|
@@ -21,9 +15,6 @@ function Toolbar(props) {
|
|
21
15
|
tableProps,
|
22
16
|
total
|
23
17
|
} = props;
|
24
|
-
const {
|
25
|
-
texts
|
26
|
-
} = useLocalization();
|
27
18
|
if (!isToolbarVisible(props)) {
|
28
19
|
return null;
|
29
20
|
}
|
@@ -35,38 +26,20 @@ function Toolbar(props) {
|
|
35
26
|
className: "ml-auto flex-shrink-0 print:hidden"
|
36
27
|
}, tableMeta.editing.isEnabled ? /*#__PURE__*/React__default.createElement(EditButton, {
|
37
28
|
table: table
|
38
|
-
}) : null, table.options.enableColumnFilters ? /*#__PURE__*/React__default.createElement(
|
29
|
+
}) : null, table.options.enableColumnFilters ? /*#__PURE__*/React__default.createElement(FiltersButton, {
|
39
30
|
table: table,
|
40
31
|
total: total
|
41
|
-
}) : null,
|
42
|
-
table: table
|
43
|
-
}) : null, tableMeta.printing.isEnabled ? /*#__PURE__*/React__default.createElement(PrintButton, {
|
32
|
+
}) : null, right, tableMeta.printing.isEnabled ? /*#__PURE__*/React__default.createElement(PrintButton, {
|
44
33
|
table: table,
|
45
34
|
tableProps: tableProps
|
46
|
-
}) : null,
|
47
|
-
|
48
|
-
}, /*#__PURE__*/React__default.createElement(
|
49
|
-
"aria-label": texts.table3.otherOptions.tooltip,
|
50
|
-
icon: "more",
|
51
|
-
menu: menuProps => /*#__PURE__*/React__default.createElement(Menu, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu.Content, {
|
52
|
-
align: "end"
|
53
|
-
}, tableMeta.rowHeight.isEnabled ? /*#__PURE__*/React__default.createElement(Menu.Item, {
|
54
|
-
icon: `height-${tableMeta.rowHeight.height}`,
|
55
|
-
subMenu: () => /*#__PURE__*/React__default.createElement(RowHeight, {
|
56
|
-
table: table
|
57
|
-
})
|
58
|
-
}, texts.table3.rowHeight.tooltip) : null, tableMeta.fontSize.isEnabled ? /*#__PURE__*/React__default.createElement(Menu.Item, {
|
59
|
-
icon: "font-size",
|
60
|
-
subMenu: () => /*#__PURE__*/React__default.createElement(FontSize, {
|
61
|
-
table: table
|
62
|
-
})
|
63
|
-
}, texts.table3.fontSize.tooltip) : null))
|
64
|
-
})) : null, tableMeta.search.isEnabled ? /*#__PURE__*/React__default.createElement(Search, {
|
35
|
+
}) : null, isSettingsVisible(props) ? /*#__PURE__*/React__default.createElement(SettingsButton, {
|
36
|
+
table: table
|
37
|
+
}) : null, tableMeta.search.isEnabled ? /*#__PURE__*/React__default.createElement(Search, {
|
65
38
|
scrollToIndex: scrollToIndex,
|
66
39
|
table: table
|
67
40
|
}) : null));
|
68
41
|
}
|
69
|
-
function
|
42
|
+
function isSettingsVisible(props) {
|
70
43
|
const {
|
71
44
|
table
|
72
45
|
} = props;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sources":["../../../../../../../../../src/components/Table3/components/toolbar/Toolbar.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\nimport {
|
1
|
+
{"version":3,"file":"Toolbar.js","sources":["../../../../../../../../../src/components/Table3/components/toolbar/Toolbar.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { Search } from './Search';\nimport { Group } from '../../../Group/Group';\nimport { FiltersButton } from './Filter/filters/Filters';\nimport { EditButton } from './EditButton';\nimport { PrintButton } from './PrintButton/PrintButton';\nimport { Table3Props } from '../../types';\nimport { SettingsButton } from './Settings';\n\nexport type ToolbarProps<TType = unknown> = {\n left?: JSX.Element;\n right?: JSX.Element;\n scrollToIndex: any;\n table: RTable<TType>;\n tableProps: Table3Props<TType>;\n total: number;\n};\nexport function Toolbar<TType = unknown>(props: ToolbarProps<TType>) {\n const { left, right, scrollToIndex, table, tableProps, total } = props;\n\n if (!isToolbarVisible(props)) {\n return null;\n }\n\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n return (\n <div className=\"mb-4 flex flex-shrink flex-grow-0 flex-wrap gap-2\" data-taco=\"table3-toolbar\">\n {left}\n <Group className=\"ml-auto flex-shrink-0 print:hidden\">\n {tableMeta.editing.isEnabled ? <EditButton table={table} /> : null}\n {table.options.enableColumnFilters ? <FiltersButton table={table} total={total} /> : null}\n {right}\n {tableMeta.printing.isEnabled ? <PrintButton table={table} tableProps={tableProps} /> : null}\n {isSettingsVisible(props) ? <SettingsButton table={table} /> : null}\n {tableMeta.search.isEnabled ? <Search scrollToIndex={scrollToIndex} table={table} /> : null}\n </Group>\n </div>\n );\n}\n\nfunction isSettingsVisible<TType = unknown>(props: ToolbarProps<TType>) {\n const { table } = props;\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n return tableMeta.fontSize.isEnabled || tableMeta.rowHeight.isEnabled;\n}\n\nfunction isToolbarVisible<TType = unknown>(props: ToolbarProps<TType>) {\n const { left, right, table } = props;\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n const enableSettingsButton = table.options.enableHiding || tableMeta.columnOrdering.isEnabled;\n const hasInternalToolbar =\n enableSettingsButton ||\n tableMeta.editing.isEnabled ||\n tableMeta.printing.isEnabled ||\n table.options.enableColumnFilters ||\n tableMeta.fontSize.isEnabled ||\n tableMeta.rowHeight.isEnabled ||\n tableMeta.search.isEnabled;\n\n return hasInternalToolbar || !!left || !!right;\n}\n"],"names":["Toolbar","props","left","right","scrollToIndex","table","tableProps","total","isToolbarVisible","tableMeta","options","meta","React","className","Group","editing","isEnabled","EditButton","enableColumnFilters","FiltersButton","printing","PrintButton","isSettingsVisible","SettingsButton","search","Search","fontSize","rowHeight","enableSettingsButton","enableHiding","columnOrdering","hasInternalToolbar"],"mappings":";;;;;;;;SAkBgBA,OAAOA,CAAkBC,KAA0B;EAC/D,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC,aAAa;IAAEC,KAAK;IAAEC,UAAU;IAAEC;GAAO,GAAGN,KAAK;EAEtE,IAAI,CAACO,gBAAgB,CAACP,KAAK,CAAC,EAAE;IAC1B,OAAO,IAAI;;EAGf,MAAMQ,SAAS,GAAGJ,KAAK,CAACK,OAAO,CAACC,IAAwB;EAExD,oBACIC;IAAKC,SAAS,EAAC,mDAAmD;iBAAW;KACxEX,IAAI,eACLU,6BAACE,KAAK;IAACD,SAAS,EAAC;KACZJ,SAAS,CAACM,OAAO,CAACC,SAAS,gBAAGJ,6BAACK,UAAU;IAACZ,KAAK,EAAEA;IAAS,GAAG,IAAI,EACjEA,KAAK,CAACK,OAAO,CAACQ,mBAAmB,gBAAGN,6BAACO,aAAa;IAACd,KAAK,EAAEA,KAAK;IAAEE,KAAK,EAAEA;IAAS,GAAG,IAAI,EACxFJ,KAAK,EACLM,SAAS,CAACW,QAAQ,CAACJ,SAAS,gBAAGJ,6BAACS,WAAW;IAAChB,KAAK,EAAEA,KAAK;IAAEC,UAAU,EAAEA;IAAc,GAAG,IAAI,EAC3FgB,iBAAiB,CAACrB,KAAK,CAAC,gBAAGW,6BAACW,cAAc;IAAClB,KAAK,EAAEA;IAAS,GAAG,IAAI,EAClEI,SAAS,CAACe,MAAM,CAACR,SAAS,gBAAGJ,6BAACa,MAAM;IAACrB,aAAa,EAAEA,aAAa;IAAEC,KAAK,EAAEA;IAAS,GAAG,IAAI,CACvF,CACN;AAEd;AAEA,SAASiB,iBAAiBA,CAAkBrB,KAA0B;EAClE,MAAM;IAAEI;GAAO,GAAGJ,KAAK;EACvB,MAAMQ,SAAS,GAAGJ,KAAK,CAACK,OAAO,CAACC,IAAwB;EAExD,OAAOF,SAAS,CAACiB,QAAQ,CAACV,SAAS,IAAIP,SAAS,CAACkB,SAAS,CAACX,SAAS;AACxE;AAEA,SAASR,gBAAgBA,CAAkBP,KAA0B;EACjE,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEE;GAAO,GAAGJ,KAAK;EACpC,MAAMQ,SAAS,GAAGJ,KAAK,CAACK,OAAO,CAACC,IAAwB;EAExD,MAAMiB,oBAAoB,GAAGvB,KAAK,CAACK,OAAO,CAACmB,YAAY,IAAIpB,SAAS,CAACqB,cAAc,CAACd,SAAS;EAC7F,MAAMe,kBAAkB,GACpBH,oBAAoB,IACpBnB,SAAS,CAACM,OAAO,CAACC,SAAS,IAC3BP,SAAS,CAACW,QAAQ,CAACJ,SAAS,IAC5BX,KAAK,CAACK,OAAO,CAACQ,mBAAmB,IACjCT,SAAS,CAACiB,QAAQ,CAACV,SAAS,IAC5BP,SAAS,CAACkB,SAAS,CAACX,SAAS,IAC7BP,SAAS,CAACe,MAAM,CAACR,SAAS;EAE9B,OAAOe,kBAAkB,IAAI,CAAC,CAAC7B,IAAI,IAAI,CAAC,CAACC,KAAK;AAClD;;;;"}
|
@@ -58,8 +58,9 @@ function useColumnFreezingStyle(tableId, table) {
|
|
58
58
|
if (tableMeta.columnFreezing.frozenInternalColumnCount > 0 || tableMeta.columnFreezing.isEnabled && frozenColumnIndex !== undefined) {
|
59
59
|
var _visibleFrozenColumns;
|
60
60
|
const visibleFrozenColumns = table.getVisibleLeafColumns().slice(0, frozenColumnIndex + 1);
|
61
|
-
|
62
|
-
if
|
61
|
+
const visibleExternalFrozenColumns = visibleFrozenColumns.filter(column => !isInternalColumn(column.id));
|
62
|
+
// if all external frozen columns haven't had their size set yet, then abort
|
63
|
+
if (visibleExternalFrozenColumns.length && visibleExternalFrozenColumns.every(column => columnSizing[column.id] === undefined)) {
|
63
64
|
return undefined;
|
64
65
|
}
|
65
66
|
const offsets = {};
|
package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnFreezing.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useColumnFreezing.js","sources":["../../../../../../../../../src/components/Table3/hooks/features/useColumnFreezing.ts"],"sourcesContent":["import { Table, TableMeta } from '@tanstack/react-table';\nimport React from 'react';\nimport { Table3Options } from '../../types';\nimport { isInternalColumn } from '../../util/columns';\n\nexport function getFrozenInternalColumnCount(options: Table3Options) {\n let index = 0;\n\n if (options.enableRowDrag) {\n index++;\n }\n\n if (options.enableRowSelection) {\n index++;\n }\n\n if (options.enableRowExpansion) {\n index++;\n }\n\n return index;\n}\n\n/*\nBecause of the desired behaviour of column freezing we use custom state and just an index.\nIf a frozen column is, for example, hidden, then the desired behaviour is that the next available column gets frozen.\nIf this behaviour were different we would just use the native column pinning functionality\n*/\nexport function useColumnFreezing(defaultFrozenIndex: number | undefined, options: Table3Options) {\n const [frozenColumnIndex, _setFrozenColumnIndex] = React.useState<number | undefined>(() => defaultFrozenIndex);\n const [horizontallyScrolled, setHorizontallyScrolled] = React.useState(false);\n\n const onScroll = (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !horizontallyScrolled) {\n setHorizontallyScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && horizontallyScrolled) {\n setHorizontallyScrolled(false);\n }\n };\n\n const frozenInternalColumnCount = React.useMemo(() => getFrozenInternalColumnCount(options), []);\n // we must set a value when undefined is explicitly set, otherwise nothing is saved to settings\n // and the next time the table loads it will fall back to the initial value even though the user changed it\n const setFrozenColumnIndex = (index: number | undefined) => _setFrozenColumnIndex(index ?? -1);\n\n return {\n isEnabled: options.enableColumnFreezing,\n frozenInternalColumnCount,\n frozenColumnIndex,\n setFrozenColumnIndex,\n horizontallyScrolled,\n handleScroll: onScroll,\n };\n}\n\nexport function useColumnFreezingStyle<TType = unknown>(tableId: string, table: Table<TType>) {\n const { columnOrder, columnSizing, columnSizingInfo, columnVisibility } = table.getState();\n const tableMeta = table.options.meta as TableMeta<TType>;\n const frozenColumnIndex =\n // If column freezing is not enabled then only internal frozen column should be frozen.\n (tableMeta.columnFreezing.isEnabled ? tableMeta.columnFreezing.frozenColumnIndex ?? -1 : -1) +\n tableMeta.columnFreezing.frozenInternalColumnCount;\n\n const style = React.useMemo(() => {\n if (\n tableMeta.columnFreezing.frozenInternalColumnCount > 0 ||\n (tableMeta.columnFreezing.isEnabled && frozenColumnIndex !== undefined)\n ) {\n const visibleFrozenColumns = table.getVisibleLeafColumns().slice(0, frozenColumnIndex + 1);\n\n // if all frozen columns haven't had their size set yet, then abort\n if (
|
1
|
+
{"version":3,"file":"useColumnFreezing.js","sources":["../../../../../../../../../src/components/Table3/hooks/features/useColumnFreezing.ts"],"sourcesContent":["import { Table, TableMeta } from '@tanstack/react-table';\nimport React from 'react';\nimport { Table3Options } from '../../types';\nimport { isInternalColumn } from '../../util/columns';\n\nexport function getFrozenInternalColumnCount(options: Table3Options) {\n let index = 0;\n\n if (options.enableRowDrag) {\n index++;\n }\n\n if (options.enableRowSelection) {\n index++;\n }\n\n if (options.enableRowExpansion) {\n index++;\n }\n\n return index;\n}\n\n/*\nBecause of the desired behaviour of column freezing we use custom state and just an index.\nIf a frozen column is, for example, hidden, then the desired behaviour is that the next available column gets frozen.\nIf this behaviour were different we would just use the native column pinning functionality\n*/\nexport function useColumnFreezing(defaultFrozenIndex: number | undefined, options: Table3Options) {\n const [frozenColumnIndex, _setFrozenColumnIndex] = React.useState<number | undefined>(() => defaultFrozenIndex);\n const [horizontallyScrolled, setHorizontallyScrolled] = React.useState(false);\n\n const onScroll = (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !horizontallyScrolled) {\n setHorizontallyScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && horizontallyScrolled) {\n setHorizontallyScrolled(false);\n }\n };\n\n const frozenInternalColumnCount = React.useMemo(() => getFrozenInternalColumnCount(options), []);\n\n // we must set a value when undefined is explicitly set, otherwise nothing is saved to settings\n // and the next time the table loads it will fall back to the initial value even though the user changed it\n const setFrozenColumnIndex = (index: number | undefined) => _setFrozenColumnIndex(index ?? -1);\n\n return {\n isEnabled: options.enableColumnFreezing,\n frozenInternalColumnCount,\n frozenColumnIndex,\n setFrozenColumnIndex,\n horizontallyScrolled,\n handleScroll: onScroll,\n };\n}\n\nexport function useColumnFreezingStyle<TType = unknown>(tableId: string, table: Table<TType>) {\n const { columnOrder, columnSizing, columnSizingInfo, columnVisibility } = table.getState();\n const tableMeta = table.options.meta as TableMeta<TType>;\n const frozenColumnIndex =\n // If column freezing is not enabled then only internal frozen column should be frozen.\n (tableMeta.columnFreezing.isEnabled ? tableMeta.columnFreezing.frozenColumnIndex ?? -1 : -1) +\n tableMeta.columnFreezing.frozenInternalColumnCount;\n\n const style = React.useMemo(() => {\n if (\n tableMeta.columnFreezing.frozenInternalColumnCount > 0 ||\n (tableMeta.columnFreezing.isEnabled && frozenColumnIndex !== undefined)\n ) {\n const visibleFrozenColumns = table.getVisibleLeafColumns().slice(0, frozenColumnIndex + 1);\n\n const visibleExternalFrozenColumns = visibleFrozenColumns.filter(column => !isInternalColumn(column.id));\n\n // if all external frozen columns haven't had their size set yet, then abort\n if (\n visibleExternalFrozenColumns.length &&\n visibleExternalFrozenColumns.every(column => columnSizing[column.id] === undefined)\n ) {\n return undefined;\n }\n\n const offsets = {};\n\n visibleFrozenColumns.reduce((offset, column) => {\n const columnId = column.id;\n\n offsets[columnId] = offset;\n\n if (isInternalColumn(columnId)) {\n // getSize method is used instead of columnSizing state because columnSizing state doesn't have\n // sizes of internal columns.\n return offset + column.getSize();\n }\n\n return offset + columnSizing[columnId];\n }, 0);\n\n const styles = [\n Object.values(offsets)\n .map((offset, index) => `#${tableId} [role=\"row\"] > :nth-child(${index + 1}) { left: ${offset}px }`)\n .join('\\n'),\n `#${tableId} [role=\"row\"] > :not(:nth-child(n+${frozenColumnIndex + 2})) {\n position: sticky;\n z-index: 20;\n }`,\n `#${tableId}[data-horizontally-scrolled=\"true\"] [role=\"row\"] > :nth-child(${frozenColumnIndex + 1}) {\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), 6px 0px 6px rgb(0 0 0/8%), 1px 0px 0px #DDDDDD;\n }`,\n ];\n\n const columnId = visibleFrozenColumns[frozenColumnIndex]?.id;\n\n // frozenColumnIndex could not be in the visible frozen column so it is important to check if columnId\n // exists before checking if it is internal.\n //\n // only add a border to the edge column if it isn't an internal column\n if (columnId && !isInternalColumn(columnId)) {\n styles.push(`#${tableId}[data-horizontally-scrolled=\"false\"] [role=\"row\"] > :nth-child(${frozenColumnIndex + 1}) {\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), 1px 0px 0px #DDDDDD;\n }`);\n }\n\n return styles.join('\\n');\n }\n\n return undefined;\n }, [columnOrder, columnSizing, columnSizingInfo, columnVisibility, tableMeta.columnFreezing.isEnabled, frozenColumnIndex]);\n\n return style;\n}\n"],"names":["getFrozenInternalColumnCount","options","index","enableRowDrag","enableRowSelection","enableRowExpansion","useColumnFreezing","defaultFrozenIndex","frozenColumnIndex","_setFrozenColumnIndex","React","useState","horizontallyScrolled","setHorizontallyScrolled","onScroll","event","currentTarget","scrollLeft","frozenInternalColumnCount","useMemo","setFrozenColumnIndex","isEnabled","enableColumnFreezing","handleScroll","useColumnFreezingStyle","tableId","table","columnOrder","columnSizing","columnSizingInfo","columnVisibility","getState","tableMeta","meta","columnFreezing","_tableMeta$columnFree","style","undefined","_visibleFrozenColumns","visibleFrozenColumns","getVisibleLeafColumns","slice","visibleExternalFrozenColumns","filter","column","isInternalColumn","id","length","every","offsets","reduce","offset","columnId","getSize","styles","Object","values","map","join","push"],"mappings":";;;SAKgBA,4BAA4BA,CAACC,OAAsB;EAC/D,IAAIC,KAAK,GAAG,CAAC;EAEb,IAAID,OAAO,CAACE,aAAa,EAAE;IACvBD,KAAK,E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E,CAAC,CAAC;MAEL,MAAME,MAAM,GAAG,CACXC,MAAM,CAACC,MAAM,CAACP,OAAO,CAAC,CACjBQ,GAAG,CAAC,CAACN,MAAM,EAAEjD,KAAK,SAASuB,qCAAqCvB,KAAK,GAAG,cAAciD,YAAY,CAAC,CACnGO,IAAI,CAAC,IAAI,CAAC,MACXjC,4CAA4CjB,iBAAiB,GAAG;;;kBAGlE,MACEiB,wEAAwEjB,iBAAiB,GAAG;;kBAE9F,CACL;MAED,MAAM4C,QAAQ,IAAAd,qBAAA,GAAGC,oBAAoB,CAAC/B,iBAAiB,CAAC,cAAA8B,qBAAA,uBAAvCA,qBAAA,CAAyCQ,EAAE;;;;;MAM5D,IAAIM,QAAQ,IAAI,CAACP,gBAAgB,CAACO,QAAQ,CAAC,EAAE;QACzCE,MAAM,CAACK,IAAI,KAAKlC,yEAAyEjB,iBAAiB,GAAG;;kBAE3G,CAAC;;MAGP,OAAO8C,MAAM,CAACI,IAAI,CAAC,IAAI,CAAC;;IAG5B,OAAOrB,SAAS;GACnB,EAAE,CAACV,WAAW,EAAEC,YAAY,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAEE,SAAS,CAACE,cAAc,CAACb,SAAS,EAAEb,iBAAiB,CAAC,CAAC;EAE1H,OAAO4B,KAAK;AAChB;;;;"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React__default from 'react';
|
2
2
|
|
3
|
-
function useCurrentRow(defaultCurrentRowIndex
|
3
|
+
function useCurrentRow(defaultCurrentRowIndex) {
|
4
4
|
const [currentRowIndex, setCurrentRowIndex] = React__default.useState(defaultCurrentRowIndex);
|
5
5
|
const move = (direction, length, scrollToIndex) => setCurrentRowIndex(currentIndex => {
|
6
6
|
const nextIndex = currentIndex !== undefined ? getNextIndex(direction, currentIndex, length) : 0;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCurrentRow.js","sources":["../../../../../../../../../src/components/Table3/hooks/features/useCurrentRow.ts"],"sourcesContent":["import React from 'react';\nimport { TableStrategy } from '../../types';\n\ntype CurrentRowHandlerCallback = TableStrategy['scrollToIndex'];\n\nexport function useCurrentRow(defaultCurrentRowIndex: number | undefined
|
1
|
+
{"version":3,"file":"useCurrentRow.js","sources":["../../../../../../../../../src/components/Table3/hooks/features/useCurrentRow.ts"],"sourcesContent":["import React from 'react';\nimport { TableStrategy } from '../../types';\n\ntype CurrentRowHandlerCallback = TableStrategy['scrollToIndex'];\n\nexport function useCurrentRow(defaultCurrentRowIndex: number | undefined) {\n const [currentRowIndex, setCurrentRowIndex] = React.useState<number | undefined>(defaultCurrentRowIndex);\n\n const move = (direction: -1 | 1, length: number, scrollToIndex: CurrentRowHandlerCallback) =>\n setCurrentRowIndex(currentIndex => {\n const nextIndex = currentIndex !== undefined ? getNextIndex(direction, currentIndex, length) : 0;\n scrollToIndex(direction === -1 ? nextIndex : nextIndex + 3);\n return nextIndex;\n });\n const moveUp = (length: number, callback: CurrentRowHandlerCallback) => move(-1, length, callback);\n const moveDown = (length: number, callback: CurrentRowHandlerCallback) => move(1, length, callback);\n\n const onKeyDown = React.useCallback((event: KeyboardEvent, length: number, scrollToIndex: CurrentRowHandlerCallback) => {\n if (event.defaultPrevented) {\n return;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n const newIndex = 0;\n setCurrentRowIndex(newIndex);\n scrollToIndex(newIndex);\n } else {\n moveUp(length, scrollToIndex);\n }\n\n return;\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n const newIndex = length - 1;\n setCurrentRowIndex(newIndex);\n scrollToIndex(newIndex);\n } else {\n moveDown(length, scrollToIndex);\n }\n\n return;\n }\n }, []);\n\n return {\n currentRowIndex,\n setCurrentRowIndex,\n handleKeyDown: onKeyDown,\n };\n}\n\nconst getNextIndex = (direction: -1 | 1, currentIndex: number, length: number) => {\n if (direction === -1) {\n return currentIndex - 1 > 0 ? currentIndex - 1 : 0;\n }\n\n return currentIndex + 1 < length ? currentIndex + 1 : currentIndex;\n};\n"],"names":["useCurrentRow","defaultCurrentRowIndex","currentRowIndex","setCurrentRowIndex","React","useState","move","direction","length","scrollToIndex","currentIndex","nextIndex","undefined","getNextIndex","moveUp","callback","moveDown","onKeyDown","useCallback","event","defaultPrevented","key","preventDefault","ctrlKey","metaKey","newIndex","handleKeyDown"],"mappings":";;SAKgBA,aAAaA,CAACC,sBAA0C;EACpE,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAqBJ,sBAAsB,CAAC;EAExG,MAAMK,IAAI,GAAGA,CAACC,SAAiB,EAAEC,MAAc,EAAEC,aAAwC,KACrFN,kBAAkB,CAACO,YAAY;IAC3B,MAAMC,SAAS,GAAGD,YAAY,KAAKE,SAAS,GAAGC,YAAY,CAACN,SAAS,EAAEG,YAAY,EAAEF,MAAM,CAAC,GAAG,CAAC;IAChGC,aAAa,CAACF,SAAS,KAAK,CAAC,CAAC,GAAGI,SAAS,GAAGA,SAAS,GAAG,CAAC,CAAC;IAC3D,OAAOA,SAAS;GACnB,CAAC;EACN,MAAMG,MAAM,GAAGA,CAACN,MAAc,EAAEO,QAAmC,KAAKT,IAAI,CAAC,CAAC,CAAC,EAAEE,MAAM,EAAEO,QAAQ,CAAC;EAClG,MAAMC,QAAQ,GAAGA,CAACR,MAAc,EAAEO,QAAmC,KAAKT,IAAI,CAAC,CAAC,EAAEE,MAAM,EAAEO,QAAQ,CAAC;EAEnG,MAAME,SAAS,GAAGb,cAAK,CAACc,WAAW,CAAC,CAACC,KAAoB,EAAEX,MAAc,EAAEC,aAAwC;IAC/G,IAAIU,KAAK,CAACC,gBAAgB,EAAE;MACxB;;IAGJ,IAAID,KAAK,CAACE,GAAG,KAAK,SAAS,EAAE;MACzBF,KAAK,CAACG,cAAc,EAAE;MAEtB,IAAIH,KAAK,CAACI,OAAO,IAAIJ,KAAK,CAACK,OAAO,EAAE;QAChC,MAAMC,QAAQ,GAAG,CAAC;QAClBtB,kBAAkB,CAACsB,QAAQ,CAAC;QAC5BhB,aAAa,CAACgB,QAAQ,CAAC;OAC1B,MAAM;QACHX,MAAM,CAACN,MAAM,EAAEC,aAAa,CAAC;;MAGjC;KACH,MAAM,IAAIU,KAAK,CAACE,GAAG,KAAK,WAAW,EAAE;MAClCF,KAAK,CAACG,cAAc,EAAE;MAEtB,IAAIH,KAAK,CAACI,OAAO,IAAIJ,KAAK,CAACK,OAAO,EAAE;QAChC,MAAMC,QAAQ,GAAGjB,MAAM,GAAG,CAAC;QAC3BL,kBAAkB,CAACsB,QAAQ,CAAC;QAC5BhB,aAAa,CAACgB,QAAQ,CAAC;OAC1B,MAAM;QACHT,QAAQ,CAACR,MAAM,EAAEC,aAAa,CAAC;;MAGnC;;GAEP,EAAE,EAAE,CAAC;EAEN,OAAO;IACHP,eAAe;IACfC,kBAAkB;IAClBuB,aAAa,EAAET;GAClB;AACL;AAEA,MAAMJ,YAAY,GAAGA,CAACN,SAAiB,EAAEG,YAAoB,EAAEF,MAAc;EACzE,IAAID,SAAS,KAAK,CAAC,CAAC,EAAE;IAClB,OAAOG,YAAY,GAAG,CAAC,GAAG,CAAC,GAAGA,YAAY,GAAG,CAAC,GAAG,CAAC;;EAGtD,OAAOA,YAAY,GAAG,CAAC,GAAGF,MAAM,GAAGE,YAAY,GAAG,CAAC,GAAGA,YAAY;AACtE,CAAC;;;;"}
|
@@ -9,7 +9,7 @@ function useRowClick(onRowClick) {
|
|
9
9
|
const tableMeta = table.options.meta;
|
10
10
|
if (event.key === 'Enter') {
|
11
11
|
event.preventDefault();
|
12
|
-
if (onRowClick) {
|
12
|
+
if (onRowClick && tableMeta.currentRow.currentRowIndex !== undefined) {
|
13
13
|
onRowClick(rows[tableMeta.currentRow.currentRowIndex].original);
|
14
14
|
}
|
15
15
|
return;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useRowClick.js","sources":["../../../../../../../../../src/components/Table3/hooks/features/useRowClick.ts"],"sourcesContent":["import React from 'react';\nimport { Table3RowClickHandler } from '../../types';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\n\nexport function useRowClick<TType = unknown>(onRowClick?: Table3RowClickHandler<TType>) {\n const onKeyDown = React.useCallback(\n (event: KeyboardEvent, table: RTable<TType>) => {\n if (typeof onRowClick !== 'function' || event.defaultPrevented) {\n return;\n }\n\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (onRowClick) {\n onRowClick(rows[tableMeta.currentRow.currentRowIndex].original as TType);\n }\n\n return;\n }\n },\n [onRowClick]\n ) as <TType = unknown>(event: KeyboardEvent, table: RTable<TType>) => void;\n\n return {\n handleKeyDown: onKeyDown,\n handleClick: onRowClick,\n };\n}\n"],"names":["useRowClick","onRowClick","onKeyDown","React","useCallback","event","table","defaultPrevented","rows","getRowModel","tableMeta","options","meta","key","preventDefault","currentRow","currentRowIndex","original","handleKeyDown","handleClick"],"mappings":";;SAIgBA,WAAWA,CAAkBC,UAAyC;EAClF,MAAMC,SAAS,GAAGC,cAAK,CAACC,WAAW,CAC/B,CAACC,KAAoB,EAAEC,KAAoB;IACvC,IAAI,OAAOL,UAAU,KAAK,UAAU,IAAII,KAAK,CAACE,gBAAgB,EAAE;MAC5D;;IAGJ,MAAMC,IAAI,GAAGF,KAAK,CAACG,WAAW,EAAE,CAACD,IAAI;IACrC,MAAME,SAAS,GAAGJ,KAAK,CAACK,OAAO,CAACC,IAAwB;IAExD,IAAIP,KAAK,CAACQ,GAAG,KAAK,OAAO,EAAE;MACvBR,KAAK,CAACS,cAAc,EAAE;MAEtB,IAAIb,UAAU,EAAE;
|
1
|
+
{"version":3,"file":"useRowClick.js","sources":["../../../../../../../../../src/components/Table3/hooks/features/useRowClick.ts"],"sourcesContent":["import React from 'react';\nimport { Table3RowClickHandler } from '../../types';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\n\nexport function useRowClick<TType = unknown>(onRowClick?: Table3RowClickHandler<TType>) {\n const onKeyDown = React.useCallback(\n (event: KeyboardEvent, table: RTable<TType>) => {\n if (typeof onRowClick !== 'function' || event.defaultPrevented) {\n return;\n }\n\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (onRowClick && tableMeta.currentRow.currentRowIndex !== undefined) {\n onRowClick(rows[tableMeta.currentRow.currentRowIndex].original as TType);\n }\n\n return;\n }\n },\n [onRowClick]\n ) as <TType = unknown>(event: KeyboardEvent, table: RTable<TType>) => void;\n\n return {\n handleKeyDown: onKeyDown,\n handleClick: onRowClick,\n };\n}\n"],"names":["useRowClick","onRowClick","onKeyDown","React","useCallback","event","table","defaultPrevented","rows","getRowModel","tableMeta","options","meta","key","preventDefault","currentRow","currentRowIndex","undefined","original","handleKeyDown","handleClick"],"mappings":";;SAIgBA,WAAWA,CAAkBC,UAAyC;EAClF,MAAMC,SAAS,GAAGC,cAAK,CAACC,WAAW,CAC/B,CAACC,KAAoB,EAAEC,KAAoB;IACvC,IAAI,OAAOL,UAAU,KAAK,UAAU,IAAII,KAAK,CAACE,gBAAgB,EAAE;MAC5D;;IAGJ,MAAMC,IAAI,GAAGF,KAAK,CAACG,WAAW,EAAE,CAACD,IAAI;IACrC,MAAME,SAAS,GAAGJ,KAAK,CAACK,OAAO,CAACC,IAAwB;IAExD,IAAIP,KAAK,CAACQ,GAAG,KAAK,OAAO,EAAE;MACvBR,KAAK,CAACS,cAAc,EAAE;MAEtB,IAAIb,UAAU,IAAIS,SAAS,CAACK,UAAU,CAACC,eAAe,KAAKC,SAAS,EAAE;QAClEhB,UAAU,CAACO,IAAI,CAACE,SAAS,CAACK,UAAU,CAACC,eAAe,CAAC,CAACE,QAAiB,CAAC;;MAG5E;;GAEP,EACD,CAACjB,UAAU,CAAC,CAC0D;EAE1E,OAAO;IACHkB,aAAa,EAAEjB,SAAS;IACxBkB,WAAW,EAAEnB;GAChB;AACL;;;;"}
|
@@ -9,9 +9,12 @@ function useRowSelection() {
|
|
9
9
|
const rows = table.getRowModel().rows;
|
10
10
|
const tableMeta = table.options.meta;
|
11
11
|
if (event.key === ' ') {
|
12
|
-
var _rows$tableMeta$curre;
|
13
12
|
event.preventDefault();
|
14
|
-
|
13
|
+
const currentRowIndex = tableMeta.currentRow.currentRowIndex;
|
14
|
+
if (currentRowIndex !== undefined) {
|
15
|
+
var _rows$currentRowIndex;
|
16
|
+
(_rows$currentRowIndex = rows[currentRowIndex]) === null || _rows$currentRowIndex === void 0 ? void 0 : _rows$currentRowIndex.toggleSelected();
|
17
|
+
}
|
15
18
|
return;
|
16
19
|
} else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {
|
17
20
|
event.preventDefault();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useRowSelection.js","sources":["../../../../../../../../../src/components/Table3/hooks/features/useRowSelection.ts"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\n\nexport function useRowSelection() {\n const lastSelectedRowIndex = React.useRef<number>();\n\n const onKeyDown = React.useCallback(<TType = unknown>(event: KeyboardEvent, table: RTable<TType>) => {\n if (!table.options.enableRowSelection || event.defaultPrevented) {\n return;\n }\n\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n if (event.key === ' ') {\n event.preventDefault();\n
|
1
|
+
{"version":3,"file":"useRowSelection.js","sources":["../../../../../../../../../src/components/Table3/hooks/features/useRowSelection.ts"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\n\nexport function useRowSelection() {\n const lastSelectedRowIndex = React.useRef<number>();\n\n const onKeyDown = React.useCallback(<TType = unknown>(event: KeyboardEvent, table: RTable<TType>) => {\n if (!table.options.enableRowSelection || event.defaultPrevented) {\n return;\n }\n\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n if (event.key === ' ') {\n event.preventDefault();\n const currentRowIndex = tableMeta.currentRow.currentRowIndex;\n if (currentRowIndex !== undefined) {\n rows[currentRowIndex]?.toggleSelected();\n }\n return;\n } else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {\n event.preventDefault();\n table.toggleAllRowsSelected();\n return;\n }\n }, []) as <TType = unknown>(event: KeyboardEvent, table: RTable<TType>) => void;\n\n return {\n handleKeyDown: onKeyDown,\n lastSelectedRowIndex,\n };\n}\n"],"names":["useRowSelection","lastSelectedRowIndex","React","useRef","onKeyDown","useCallback","event","table","options","enableRowSelection","defaultPrevented","rows","getRowModel","tableMeta","meta","key","preventDefault","currentRowIndex","currentRow","undefined","_rows$currentRowIndex","toggleSelected","ctrlKey","metaKey","toggleAllRowsSelected","handleKeyDown"],"mappings":";;SAGgBA,eAAeA;EAC3B,MAAMC,oBAAoB,GAAGC,cAAK,CAACC,MAAM,EAAU;EAEnD,MAAMC,SAAS,GAAGF,cAAK,CAACG,WAAW,CAAC,CAAkBC,KAAoB,EAAEC,KAAoB;IAC5F,IAAI,CAACA,KAAK,CAACC,OAAO,CAACC,kBAAkB,IAAIH,KAAK,CAACI,gBAAgB,EAAE;MAC7D;;IAGJ,MAAMC,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;IACrC,MAAME,SAAS,GAAGN,KAAK,CAACC,OAAO,CAACM,IAAwB;IAExD,IAAIR,KAAK,CAACS,GAAG,KAAK,GAAG,EAAE;MACnBT,KAAK,CAACU,cAAc,EAAE;MACtB,MAAMC,eAAe,GAAGJ,SAAS,CAACK,UAAU,CAACD,eAAe;MAC5D,IAAIA,eAAe,KAAKE,SAAS,EAAE;QAAA,IAAAC,qBAAA;QAC/B,CAAAA,qBAAA,GAAAT,IAAI,CAACM,eAAe,CAAC,cAAAG,qBAAA,uBAArBA,qBAAA,CAAuBC,cAAc,EAAE;;MAE3C;KACH,MAAM,IAAI,CAACf,KAAK,CAACgB,OAAO,IAAIhB,KAAK,CAACiB,OAAO,KAAKjB,KAAK,CAACS,GAAG,KAAK,GAAG,EAAE;MAC9DT,KAAK,CAACU,cAAc,EAAE;MACtBT,KAAK,CAACiB,qBAAqB,EAAE;MAC7B;;GAEP,EAAE,EAAE,CAA0E;EAE/E,OAAO;IACHC,aAAa,EAAErB,SAAS;IACxBH;GACH;AACL;;;;"}
|
package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useCurrentRowListener.js
CHANGED
@@ -4,7 +4,8 @@ function useCurrentRowListener(table) {
|
|
4
4
|
const meta = table.options.meta;
|
5
5
|
const rows = table.getRowModel().rows;
|
6
6
|
React__default.useEffect(() => {
|
7
|
-
|
7
|
+
const currentRowIndex = meta.currentRow.currentRowIndex;
|
8
|
+
if (currentRowIndex !== undefined && currentRowIndex > rows.length) {
|
8
9
|
meta.currentRow.setCurrentRowIndex(0);
|
9
10
|
}
|
10
11
|
}, [rows.length]);
|
package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useCurrentRowListener.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCurrentRowListener.js","sources":["../../../../../../../../../src/components/Table3/hooks/listeners/useCurrentRowListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\n\nexport function useCurrentRowListener<TType = unknown>(table: RTable<TType>) {\n const meta = table.options.meta as TableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n React.useEffect(() => {\n
|
1
|
+
{"version":3,"file":"useCurrentRowListener.js","sources":["../../../../../../../../../src/components/Table3/hooks/listeners/useCurrentRowListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\n\nexport function useCurrentRowListener<TType = unknown>(table: RTable<TType>) {\n const meta = table.options.meta as TableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n React.useEffect(() => {\n const currentRowIndex = meta.currentRow.currentRowIndex;\n if (currentRowIndex !== undefined && currentRowIndex > rows.length) {\n meta.currentRow.setCurrentRowIndex(0);\n }\n }, [rows.length]);\n}\n"],"names":["useCurrentRowListener","table","meta","options","rows","getRowModel","React","useEffect","currentRowIndex","currentRow","undefined","length","setCurrentRowIndex"],"mappings":";;SAGgBA,qBAAqBA,CAAkBC,KAAoB;EACvE,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAAwB;EACnD,MAAME,IAAI,GAAGH,KAAK,CAACI,WAAW,EAAE,CAACD,IAAI;EAErCE,cAAK,CAACC,SAAS,CAAC;IACZ,MAAMC,eAAe,GAAGN,IAAI,CAACO,UAAU,CAACD,eAAe;IACvD,IAAIA,eAAe,KAAKE,SAAS,IAAIF,eAAe,GAAGJ,IAAI,CAACO,MAAM,EAAE;MAChET,IAAI,CAACO,UAAU,CAACG,kBAAkB,CAAC,CAAC,CAAC;;GAE5C,EAAE,CAACR,IAAI,CAACO,MAAM,CAAC,CAAC;AACrB;;;;"}
|
package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useEditingStateListener.js
CHANGED
@@ -12,10 +12,14 @@ function useEditingStateListener(table) {
|
|
12
12
|
}, [meta.currentRow.currentRowIndex]);
|
13
13
|
// save if editing gets toggled off
|
14
14
|
React__default.useEffect(() => {
|
15
|
-
if (meta.editing.isEnabled
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
if (meta.editing.isEnabled) {
|
16
|
+
if (!meta.editing.isEditing) {
|
17
|
+
requestAnimationFrame(() => {
|
18
|
+
meta.editing.saveChangesIfNeeded();
|
19
|
+
});
|
20
|
+
} else if (meta.currentRow.currentRowIndex === undefined) {
|
21
|
+
meta.currentRow.setCurrentRowIndex(0);
|
22
|
+
}
|
19
23
|
}
|
20
24
|
}, [meta.editing.isEditing]);
|
21
25
|
}
|
package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useEditingStateListener.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useEditingStateListener.js","sources":["../../../../../../../../../src/components/Table3/hooks/listeners/useEditingStateListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\n\nexport function useEditingStateListener<TType = unknown>(table: RTable<TType>) {\n const meta = table.options.meta as TableMeta<TType>;\n\n // save when the row changes\n React.useEffect(() => {\n if (meta.editing.isEnabled && meta.editing.isEditing) {\n requestAnimationFrame(() => {\n meta.editing.saveChangesIfNeeded();\n });\n }\n }, [meta.currentRow.currentRowIndex]);\n\n // save if editing gets toggled off\n React.useEffect(() => {\n if (meta.editing.isEnabled
|
1
|
+
{"version":3,"file":"useEditingStateListener.js","sources":["../../../../../../../../../src/components/Table3/hooks/listeners/useEditingStateListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\n\nexport function useEditingStateListener<TType = unknown>(table: RTable<TType>) {\n const meta = table.options.meta as TableMeta<TType>;\n\n // save when the row changes\n React.useEffect(() => {\n if (meta.editing.isEnabled && meta.editing.isEditing) {\n requestAnimationFrame(() => {\n meta.editing.saveChangesIfNeeded();\n });\n }\n }, [meta.currentRow.currentRowIndex]);\n\n // save if editing gets toggled off\n React.useEffect(() => {\n if (meta.editing.isEnabled) {\n if (!meta.editing.isEditing) {\n requestAnimationFrame(() => {\n meta.editing.saveChangesIfNeeded();\n });\n } else if (meta.currentRow.currentRowIndex === undefined) {\n meta.currentRow.setCurrentRowIndex(0);\n }\n }\n }, [meta.editing.isEditing]);\n}\n"],"names":["useEditingStateListener","table","meta","options","React","useEffect","editing","isEnabled","isEditing","requestAnimationFrame","saveChangesIfNeeded","currentRow","currentRowIndex","undefined","setCurrentRowIndex"],"mappings":";;SAGgBA,uBAAuBA,CAAkBC,KAAoB;EACzE,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAAwB;;EAGnDE,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIH,IAAI,CAACI,OAAO,CAACC,SAAS,IAAIL,IAAI,CAACI,OAAO,CAACE,SAAS,EAAE;MAClDC,qBAAqB,CAAC;QAClBP,IAAI,CAACI,OAAO,CAACI,mBAAmB,EAAE;OACrC,CAAC;;GAET,EAAE,CAACR,IAAI,CAACS,UAAU,CAACC,eAAe,CAAC,CAAC;;EAGrCR,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIH,IAAI,CAACI,OAAO,CAACC,SAAS,EAAE;MACxB,IAAI,CAACL,IAAI,CAACI,OAAO,CAACE,SAAS,EAAE;QACzBC,qBAAqB,CAAC;UAClBP,IAAI,CAACI,OAAO,CAACI,mBAAmB,EAAE;SACrC,CAAC;OACL,MAAM,IAAIR,IAAI,CAACS,UAAU,CAACC,eAAe,KAAKC,SAAS,EAAE;QACtDX,IAAI,CAACS,UAAU,CAACG,kBAAkB,CAAC,CAAC,CAAC;;;GAGhD,EAAE,CAACZ,IAAI,CAACI,OAAO,CAACE,SAAS,CAAC,CAAC;AAChC;;;;"}
|
package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useShortcutsListener.js
CHANGED
@@ -8,7 +8,7 @@ function useShortcutsListener(table, shortcuts) {
|
|
8
8
|
const shortcutKeys = Object.keys(shortcuts !== null && shortcuts !== void 0 ? shortcuts : {});
|
9
9
|
const globalHandlers = [];
|
10
10
|
// convert the shortcut into the correct format to register it
|
11
|
-
if (shortcuts && shortcutKeys.length) {
|
11
|
+
if (shortcuts && shortcutKeys.length && meta.currentRow.currentRowIndex !== undefined) {
|
12
12
|
const currentRow = rows[meta.currentRow.currentRowIndex];
|
13
13
|
shortcutKeys.forEach(key => {
|
14
14
|
const handler = shortcuts[key];
|
package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useShortcutsListener.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useShortcutsListener.js","sources":["../../../../../../../../../src/components/Table3/hooks/listeners/useShortcutsListener.ts"],"sourcesContent":["import React from 'react';\nimport { TableMeta, Table as RTable } from '@tanstack/react-table';\nimport { KeyDownHandlerOptions, createShortcutKeyDownHandler } from '../../../../utils/keyboard';\nimport { Table3ShortcutHandlerObject, Table3Shortcuts } from '../../types';\n\nexport function useShortcutsListener<TType = unknown>(table: RTable<TType>, shortcuts: Table3Shortcuts<TType> | undefined) {\n const meta = table.options.meta as TableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n React.useEffect(() => {\n const shortcutKeys = Object.keys(shortcuts ?? {});\n const globalHandlers: Array<(event: KeyboardEvent) => void> = [];\n\n // convert the shortcut into the correct format to register it\n if (shortcuts && shortcutKeys.length) {\n const currentRow = rows[meta.currentRow.currentRowIndex];\n\n shortcutKeys.forEach(key => {\n const handler = shortcuts[key];\n\n let keyDownHandler;\n let keyDownHandlerOptions: KeyDownHandlerOptions;\n\n if (typeof handler === 'function') {\n keyDownHandler = handler;\n keyDownHandlerOptions = {\n key,\n };\n } else {\n const handlerObject = handler as Table3ShortcutHandlerObject<TType>;\n keyDownHandler = handlerObject.handler;\n keyDownHandlerOptions = {\n key,\n meta: handlerObject.meta,\n shift: handlerObject.shift,\n };\n }\n\n globalHandlers.push(\n createShortcutKeyDownHandler(keyDownHandlerOptions, event => {\n event.preventDefault();\n keyDownHandler(currentRow?.original);\n })\n );\n });\n }\n\n globalHandlers.forEach(handler => {\n document.addEventListener('keydown', handler);\n });\n\n return () => {\n globalHandlers.forEach(handler => {\n document.removeEventListener('keydown', handler);\n });\n };\n }, [shortcuts, meta.currentRow.currentRowIndex, rows.length]);\n}\n"],"names":["useShortcutsListener","table","shortcuts","meta","options","rows","getRowModel","React","useEffect","shortcutKeys","Object","keys","globalHandlers","length","currentRow","currentRowIndex","forEach","key","handler","keyDownHandler","keyDownHandlerOptions","handlerObject","shift","push","createShortcutKeyDownHandler","event","preventDefault","original","document","addEventListener","removeEventListener"],"mappings":";;;SAKgBA,oBAAoBA,CAAkBC,KAAoB,EAAEC,SAA6C;EACrH,MAAMC,IAAI,GAAGF,KAAK,CAACG,OAAO,CAACD,IAAwB;EACnD,MAAME,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;EAErCE,cAAK,CAACC,SAAS,CAAC;IACZ,MAAMC,YAAY,GAAGC,MAAM,CAACC,IAAI,CAACT,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,CAAC;IACjD,MAAMU,cAAc,GAA0C,EAAE;;IAGhE,IAAIV,SAAS,IAAIO,YAAY,CAACI,MAAM,EAAE;
|
1
|
+
{"version":3,"file":"useShortcutsListener.js","sources":["../../../../../../../../../src/components/Table3/hooks/listeners/useShortcutsListener.ts"],"sourcesContent":["import React from 'react';\nimport { TableMeta, Table as RTable } from '@tanstack/react-table';\nimport { KeyDownHandlerOptions, createShortcutKeyDownHandler } from '../../../../utils/keyboard';\nimport { Table3ShortcutHandlerObject, Table3Shortcuts } from '../../types';\n\nexport function useShortcutsListener<TType = unknown>(table: RTable<TType>, shortcuts: Table3Shortcuts<TType> | undefined) {\n const meta = table.options.meta as TableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n React.useEffect(() => {\n const shortcutKeys = Object.keys(shortcuts ?? {});\n const globalHandlers: Array<(event: KeyboardEvent) => void> = [];\n\n // convert the shortcut into the correct format to register it\n if (shortcuts && shortcutKeys.length && meta.currentRow.currentRowIndex !== undefined) {\n const currentRow = rows[meta.currentRow.currentRowIndex];\n\n shortcutKeys.forEach(key => {\n const handler = shortcuts[key];\n\n let keyDownHandler;\n let keyDownHandlerOptions: KeyDownHandlerOptions;\n\n if (typeof handler === 'function') {\n keyDownHandler = handler;\n keyDownHandlerOptions = {\n key,\n };\n } else {\n const handlerObject = handler as Table3ShortcutHandlerObject<TType>;\n keyDownHandler = handlerObject.handler;\n keyDownHandlerOptions = {\n key,\n meta: handlerObject.meta,\n shift: handlerObject.shift,\n };\n }\n\n globalHandlers.push(\n createShortcutKeyDownHandler(keyDownHandlerOptions, event => {\n event.preventDefault();\n keyDownHandler(currentRow?.original);\n })\n );\n });\n }\n\n globalHandlers.forEach(handler => {\n document.addEventListener('keydown', handler);\n });\n\n return () => {\n globalHandlers.forEach(handler => {\n document.removeEventListener('keydown', handler);\n });\n };\n }, [shortcuts, meta.currentRow.currentRowIndex, rows.length]);\n}\n"],"names":["useShortcutsListener","table","shortcuts","meta","options","rows","getRowModel","React","useEffect","shortcutKeys","Object","keys","globalHandlers","length","currentRow","currentRowIndex","undefined","forEach","key","handler","keyDownHandler","keyDownHandlerOptions","handlerObject","shift","push","createShortcutKeyDownHandler","event","preventDefault","original","document","addEventListener","removeEventListener"],"mappings":";;;SAKgBA,oBAAoBA,CAAkBC,KAAoB,EAAEC,SAA6C;EACrH,MAAMC,IAAI,GAAGF,KAAK,CAACG,OAAO,CAACD,IAAwB;EACnD,MAAME,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;EAErCE,cAAK,CAACC,SAAS,CAAC;IACZ,MAAMC,YAAY,GAAGC,MAAM,CAACC,IAAI,CAACT,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,CAAC;IACjD,MAAMU,cAAc,GAA0C,EAAE;;IAGhE,IAAIV,SAAS,IAAIO,YAAY,CAACI,MAAM,IAAIV,IAAI,CAACW,UAAU,CAACC,eAAe,KAAKC,SAAS,EAAE;MACnF,MAAMF,UAAU,GAAGT,IAAI,CAACF,IAAI,CAACW,UAAU,CAACC,eAAe,CAAC;MAExDN,YAAY,CAACQ,OAAO,CAACC,GAAG;QACpB,MAAMC,OAAO,GAAGjB,SAAS,CAACgB,GAAG,CAAC;QAE9B,IAAIE,cAAc;QAClB,IAAIC,qBAA4C;QAEhD,IAAI,OAAOF,OAAO,KAAK,UAAU,EAAE;UAC/BC,cAAc,GAAGD,OAAO;UACxBE,qBAAqB,GAAG;YACpBH;WACH;SACJ,MAAM;UACH,MAAMI,aAAa,GAAGH,OAA6C;UACnEC,cAAc,GAAGE,aAAa,CAACH,OAAO;UACtCE,qBAAqB,GAAG;YACpBH,GAAG;YACHf,IAAI,EAAEmB,aAAa,CAACnB,IAAI;YACxBoB,KAAK,EAAED,aAAa,CAACC;WACxB;;QAGLX,cAAc,CAACY,IAAI,CACfC,4BAA4B,CAACJ,qBAAqB,EAAEK,KAAK;UACrDA,KAAK,CAACC,cAAc,EAAE;UACtBP,cAAc,CAACN,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEc,QAAQ,CAAC;SACvC,CAAC,CACL;OACJ,CAAC;;IAGNhB,cAAc,CAACK,OAAO,CAACE,OAAO;MAC1BU,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEX,OAAO,CAAC;KAChD,CAAC;IAEF,OAAO;MACHP,cAAc,CAACK,OAAO,CAACE,OAAO;QAC1BU,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAEZ,OAAO,CAAC;OACnD,CAAC;KACL;GACJ,EAAE,CAACjB,SAAS,EAAEC,IAAI,CAACW,UAAU,CAACC,eAAe,EAAEV,IAAI,CAACQ,MAAM,CAAC,CAAC;AACjE;;;;"}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React__default from 'react';
|
2
2
|
import { COLUMN_ID } from '../components/columns/internal/Actions.js';
|
3
3
|
import { isInternalColumn } from '../util/columns.js';
|
4
|
-
import { MIN_COLUMN_SIZE } from '../components/columns/styles.js';
|
4
|
+
import { MIN_COLUMN_SIZE, PRINT_MIN_COLUMN_SIZE } from '../components/columns/styles.js';
|
5
5
|
|
6
|
-
const useCssGrid = table => {
|
6
|
+
const useCssGrid = (table, isPrintTable = false) => {
|
7
7
|
const allVisibleColumns = table.getVisibleLeafColumns();
|
8
8
|
const columnSizing = table.getState().columnSizing;
|
9
9
|
const rowsLength = table.getRowModel().rows.length;
|
@@ -16,7 +16,11 @@ const useCssGrid = table => {
|
|
16
16
|
// column has a getSize function, but it always returns a default value (150), and we want the
|
17
17
|
// first render to use auto layout - so we get the size directly from table state where it is undefined
|
18
18
|
const width = columnSizing[column.id];
|
19
|
-
|
19
|
+
const isColumnInternal = isInternalColumn(column.id);
|
20
|
+
if (isPrintTable) {
|
21
|
+
const maxWidth = isColumnInternal ? `${column.getSize()}px` : '1fr';
|
22
|
+
size = `minmax(${PRINT_MIN_COLUMN_SIZE}px, ${maxWidth})`;
|
23
|
+
} else if (isColumnInternal) {
|
20
24
|
if (column.id === COLUMN_ID) {
|
21
25
|
size = 'minmax(max-content, auto)';
|
22
26
|
} else {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCssGrid.js","sources":["../../../../../../../../src/components/Table3/hooks/useCssGrid.ts"],"sourcesContent":["import React from 'react';\nimport { Table as RTable } from '@tanstack/react-table';\nimport { isInternalColumn } from '../util/columns';\nimport { MIN_COLUMN_SIZE } from '../components/columns/styles';\nimport { COLUMN_ID as ACTIONS_COLUMN_ID } from '../components/columns/internal/Actions';\n\nexport const useCssGrid = <TType = unknown>(table: RTable<TType
|
1
|
+
{"version":3,"file":"useCssGrid.js","sources":["../../../../../../../../src/components/Table3/hooks/useCssGrid.ts"],"sourcesContent":["import React from 'react';\nimport { Table as RTable } from '@tanstack/react-table';\nimport { isInternalColumn } from '../util/columns';\nimport { MIN_COLUMN_SIZE, PRINT_MIN_COLUMN_SIZE } from '../components/columns/styles';\nimport { COLUMN_ID as ACTIONS_COLUMN_ID } from '../components/columns/internal/Actions';\n\nexport const useCssGrid = <TType = unknown>(table: RTable<TType>, isPrintTable = false) => {\n const allVisibleColumns = table.getVisibleLeafColumns();\n const columnSizing = table.getState().columnSizing;\n const rowsLength = table.getRowModel().rows.length;\n const expandedRowsLength = Object.keys(table.getState().expanded).length;\n const length = rowsLength + expandedRowsLength;\n const gridTemplateColumns = React.useMemo(() => {\n return allVisibleColumns.reduce((accum, column, index) => {\n let size;\n const isLastColumn = index === allVisibleColumns.length - 1;\n // column has a getSize function, but it always returns a default value (150), and we want the\n // first render to use auto layout - so we get the size directly from table state where it is undefined\n const width = columnSizing[column.id] as number | '1fr';\n const isColumnInternal = isInternalColumn(column.id);\n\n if (isPrintTable) {\n const maxWidth = isColumnInternal ? `${column.getSize()}px` : '1fr';\n\n size = `minmax(${PRINT_MIN_COLUMN_SIZE}px, ${maxWidth})`;\n } else if (isColumnInternal) {\n if (column.id === ACTIONS_COLUMN_ID) {\n size = 'minmax(max-content, auto)';\n } else {\n // getSize method is used instead of columnSizing state because columnSizing state doesn't have\n // sizes of internal columns.\n size = `${column.getSize()}px`;\n }\n } else if (width !== undefined) {\n if (width === '1fr') {\n size = 'minmax(max-content, 1fr)';\n } else if (isLastColumn) {\n size = `minmax(${width}px, auto)`;\n } else if (width < MIN_COLUMN_SIZE) {\n // the react-table getResizeHandler function does not respect the minSize property on columns, it is possible\n // to go below the minSize - so we have to prevent it entirely on the grid layout\n size = `${MIN_COLUMN_SIZE}px`;\n } else {\n size = `${width}px`;\n }\n } else {\n size = 'minmax(max-content, auto)';\n }\n\n return `${accum} ${size}`.trim();\n }, '');\n }, [allVisibleColumns, columnSizing]);\n\n const gridTemplateRows = React.useMemo(() => {\n // 1fr makes sure that there is always a free space between the rows and footer when table height exceeds the\n // cumulative height of all rows\n return `min-content repeat(${length}, min-content) 1fr min-content`;\n }, [length]);\n\n const style: React.CSSProperties = {\n gridTemplateColumns,\n gridTemplateRows,\n };\n\n return { style };\n};\n"],"names":["useCssGrid","table","isPrintTable","allVisibleColumns","getVisibleLeafColumns","columnSizing","getState","rowsLength","getRowModel","rows","length","expandedRowsLength","Object","keys","expanded","gridTemplateColumns","React","useMemo","reduce","accum","column","index","size","isLastColumn","width","id","isColumnInternal","isInternalColumn","maxWidth","getSize","PRINT_MIN_COLUMN_SIZE","ACTIONS_COLUMN_ID","undefined","MIN_COLUMN_SIZE","trim","gridTemplateRows","style"],"mappings":";;;;;MAMaA,UAAU,GAAGA,CAAkBC,KAAoB,EAAEC,YAAY,GAAG,KAAK;EAClF,MAAMC,iBAAiB,GAAGF,KAAK,CAACG,qBAAqB,EAAE;EACvD,MAAMC,YAAY,GAAGJ,KAAK,CAACK,QAAQ,EAAE,CAACD,YAAY;EAClD,MAAME,UAAU,GAAGN,KAAK,CAACO,WAAW,EAAE,CAACC,IAAI,CAACC,MAAM;E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AC;GACT,EAAE,CAAC/B,iBAAiB,EAAEE,YAAY,CAAC,CAAC;EAErC,MAAM8B,gBAAgB,GAAGnB,cAAK,CAACC,OAAO,CAAC;;;IAGnC,6BAA6BP,sCAAsC;GACtE,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,MAAM0B,KAAK,GAAwB;IAC/BrB,mBAAmB;IACnBoB;GACH;EAED,OAAO;IAAEC;GAAO;AACpB;;;;"}
|
@@ -63,10 +63,15 @@ function useTable(props) {
|
|
63
63
|
tableOptions.globalFilterFn = (row, columnId, searchQuery) => {
|
64
64
|
try {
|
65
65
|
if (row.original) {
|
66
|
-
|
67
|
-
const
|
68
|
-
|
69
|
-
|
66
|
+
const cell = row.getAllCells().find(cell => cell.column.id === columnId);
|
67
|
+
const columnMeta = cell === null || cell === void 0 ? void 0 : cell.column.columnDef.meta;
|
68
|
+
if (cell && cell.column.getIsVisible() && columnMeta !== null && columnMeta !== void 0 && columnMeta.enableSearch) {
|
69
|
+
const cellValue = getCellValueAsString(row.original[columnId], columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.dataType);
|
70
|
+
if (cellValue !== undefined) {
|
71
|
+
return globalFilterFn(cellValue, searchQuery);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
return false;
|
70
75
|
}
|
71
76
|
} catch {
|
72
77
|
//
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTable.js","sources":["../../../../../../../../src/components/Table3/hooks/useTable.tsx"],"sourcesContent":["import React from 'react';\nimport {\n getCoreRowModel,\n useReactTable,\n Row as RTRow,\n RowData,\n Column as RTColumn,\n TableOptions as RTableOptions,\n TableState,\n getSortedRowModel,\n getFilteredRowModel,\n ColumnMeta,\n} from '@tanstack/react-table';\nimport {\n Table3ColumnAlignment,\n Table3ColumnRenderer,\n Table3Props,\n Table3ColumnHeaderMenu,\n Table3ColumnControlRenderer,\n Table3ColumnDataType,\n Table3ColumnClassNameHandler,\n Table3ColumnFooterRenderer,\n TableStrategy,\n Table3FilterComparator,\n} from '../types';\nimport { useCurrentRow } from './features/useCurrentRow';\nimport { usePauseHoverState } from './features/usePauseHoverState';\nimport { useTablePreset } from './useTablePreset';\nimport { useRowHeight } from './features/useRowHeight';\nimport { useFontSize } from './features/useFontSize';\nimport { useRowSelectionListener } from './listeners/useRowSelectionListener';\nimport { useRowDrag } from './features/useRowDrag';\nimport { useSettingsStateListener } from './listeners/useSettingsStateListener';\nimport { columnFilterFn, globalFilterFn } from '../util/filtering';\nimport { useSortingStateListener } from './listeners/useSortingStateListener';\nimport { useFilteringStateListener } from './listeners/useFilteringStateListener';\nimport { useCurrentRowListener } from './listeners/useCurrentRowListener';\nimport { useColumnFreezing } from './features/useColumnFreezing';\nimport { useRowSelection } from './features/useRowSelection';\nimport { useRowClick } from './features/useRowClick';\nimport { ensureOrdering, useColumnOrdering } from './features/useColumnOrdering';\nimport { useRowDrop } from './features/useRowDrop';\nimport { useConvertChildrenToColumns } from './useConvertChildrenToColumns';\nimport { useEditing } from './features/useEditing';\nimport { usePrinting } from './features/usePrinting';\nimport { useShortcutsListener } from './listeners/useShortcutsListener';\nimport { useRowGoto } from './features/useRowGoto';\nimport { useServerLoadingListener } from './listeners/useServerLoadingListener';\nimport { useEditingStateListener } from './listeners/useEditingStateListener';\nimport { useSearch } from './features/useSearch';\nimport { useRowActions } from './features/useRowActions';\nimport { useSettings } from './features/useSettings';\nimport { getCellValueAsString } from '../util/columns';\n\ndeclare module '@tanstack/table-core' {\n interface TableMeta<TData extends RowData> {\n columnFreezing: ReturnType<typeof useColumnFreezing>;\n columnOrdering: ReturnType<typeof useColumnOrdering>;\n currentRow: ReturnType<typeof useCurrentRow>;\n editing: ReturnType<typeof useEditing>;\n enableFooter: boolean;\n fontSize: ReturnType<typeof useFontSize>;\n hoverState: ReturnType<typeof usePauseHoverState>;\n isUsingServer: boolean;\n printing: ReturnType<typeof usePrinting>;\n rowActions: ReturnType<typeof useRowActions>;\n rowClick: ReturnType<typeof useRowClick>;\n rowDrag: ReturnType<typeof useRowDrag>;\n rowDrop: ReturnType<typeof useRowDrop>;\n rowGoto: ReturnType<typeof useRowGoto>;\n rowHeight: ReturnType<typeof useRowHeight>;\n rowSelection: ReturnType<typeof useRowSelection>;\n search: ReturnType<typeof useSearch>;\n }\n\n interface ColumnMeta<TData extends RowData, TValue> {\n align?: Table3ColumnAlignment;\n // @ts-expect-error -- we ignore it because it conflicts with Table2 also overridding ColumnMeta\n className?: Table3ColumnClassNameHandler<TData>;\n // @ts-expect-error -- we ignore it because it conflicts with Table2 also overridding ColumnMeta\n control?: Table3ColumnControlRenderer<TData>;\n // @ts-expect-error -- we ignore it because it conflicts with Table2 also overridding ColumnMeta\n dataType?: Table3ColumnDataType;\n // @ts-expect-error -- we ignore it because it conflicts with Table2 also overridding ColumnMeta\n defaultWidth?: number;\n enableOrdering: boolean;\n enableSearch: boolean;\n enableTruncate: boolean;\n filters?: Table3FilterComparator[];\n footer?: Table3ColumnFooterRenderer;\n header: string;\n headerClassName?: string;\n menu?: Table3ColumnHeaderMenu;\n renderer?: Table3ColumnRenderer<TValue, TData>;\n tooltip?: string;\n }\n\n interface CellContext<TData extends RowData, TValue> {\n index: number;\n tableRef: React.RefObject<HTMLDivElement>;\n }\n\n interface HeaderContext<TData extends RowData, TValue> {\n scrollToIndex: TableStrategy['scrollToIndex'];\n }\n}\n\nexport function useTable<TType = unknown>(props: Table3Props<TType>) {\n // options\n const options = useTablePreset(props);\n\n const tableOptions: Partial<RTableOptions<TType>> = {\n enableColumnFilters: options.enableFiltering,\n enableColumnResizing: options.enableColumnResizing,\n enableExpanding: options.enableRowExpansion,\n enableGlobalFilter: options.enableSearch,\n enableHiding: options.enableColumnHiding,\n enableRowSelection: options.enableRowSelection,\n enableMultiRowSelection: !options.enableRowSelectionSingle,\n enableSorting: options.enableSorting,\n };\n\n // resizing\n if (tableOptions.enableColumnResizing) {\n tableOptions.columnResizeMode = 'onChange';\n }\n\n // filtering\n if (tableOptions.enableColumnFilters) {\n if (!props.onFilter) {\n tableOptions.filterFns = {\n tacoFilter: (row: RTRow<TType>, columnId: string, filter: any) => columnFilterFn(row.getValue(columnId), filter),\n };\n tableOptions.getFilteredRowModel = getFilteredRowModel();\n }\n\n // we don't tableOptions.manualFiltering = true; because it breaks global filtering, server filtering still works :shrug:\n }\n\n // search\n if (tableOptions.enableGlobalFilter) {\n // search is always client side, since we call loadAll when searching\n tableOptions.globalFilterFn = (row: RTRow<TType>, columnId: string, searchQuery: string) => {\n try {\n if (row.original) {\n const dataType = row._getAllCellsByColumnId()[columnId]?.column.columnDef.meta?.dataType;\n const cellValue = getCellValueAsString(row.original[columnId], dataType);\n return globalFilterFn(cellValue, searchQuery);\n }\n } catch {\n //\n }\n\n return false;\n };\n tableOptions.getFilteredRowModel = getFilteredRowModel();\n tableOptions.getColumnCanGlobalFilter = (column: RTColumn<TType>) =>\n (column.columnDef.meta as ColumnMeta<TType, unknown>).enableSearch ?? true;\n }\n\n // sorting\n if (options.enableSorting) {\n if (props.onSort) {\n tableOptions.manualSorting = true;\n // onSort is called as a listener to let the consumer update their data, so we don't use onSortingChange\n } else {\n tableOptions.getSortedRowModel = getSortedRowModel();\n }\n }\n\n const [defaultSettings, setSettings] = useSettings(props.id, props.defaultSettings, props.onChangeSettings);\n\n // custom features\n const columnFreezing = useColumnFreezing(\n // temporarily see if deprecated frozenColumnCount is there\n defaultSettings.columnFreezingIndex ?? (defaultSettings as any)?.frozenColumnCount ?? props.defaultColumnFreezingIndex,\n options\n );\n const columnOrdering = useColumnOrdering(options);\n const currentRow = useCurrentRow(props.defaultCurrentRowIndex);\n const editing = useEditing(options.enableEditing, props.onSave);\n const fontSize = useFontSize(options.enableFontSize, defaultSettings.fontSize);\n const hoverState = usePauseHoverState();\n const printing = usePrinting(options.enablePrinting, props.loadAll, defaultSettings.showWarningWhenPrintingLargeDataset);\n const rowActions = useRowActions<TType>(props.actionsForRow, props.actionsForRowLength);\n const rowClick = useRowClick<TType>(props.onRowClick);\n const rowDrag = useRowDrag(options.enableRowDrag);\n const rowDrop = useRowDrop(options.enableRowDrop, props.onRowDrop);\n const rowGoto = useRowGoto(options.enableRowGoto, props.onRowGoto);\n const rowHeight = useRowHeight(\n options.enableRowHeight,\n // temporarily see if deprecated rowDensity is there\n defaultSettings.rowHeight ?? (defaultSettings as any)?.rowDensity\n );\n const rowSelection = useRowSelection();\n const search = useSearch(options.enableSearch, defaultSettings.excludeUnmatchedRecordsInSearch, props.loadAll);\n\n // columns\n const { columns, defaultColumnSizing, defaultColumnVisibility, defaultSorting } = useConvertChildrenToColumns<TType>(\n props,\n options,\n editing\n );\n\n // built-in features\n const initialState: Partial<TableState> = React.useMemo(() => {\n const sanitizeSortedColumns = column => columns.find(definedColumn => definedColumn.id === column.id);\n\n const state: Partial<TableState> = {\n columnOrder: ensureOrdering<TType>(columns, defaultSettings.columnOrder),\n columnSizing: defaultSettings.columnSizing ?? defaultColumnSizing,\n columnVisibility: defaultSettings.columnVisibility ?? defaultColumnVisibility,\n sorting: defaultSettings.sorting ? defaultSettings.sorting.filter(sanitizeSortedColumns) : defaultSorting,\n };\n\n // we don't save these outside the table, but they need to be here for print to inherit them - see PrintButton.tsx\n if ((props.defaultSettings as any)?.columnFilters) {\n state.columnFilters = (props.defaultSettings as any)?.columnFilters;\n }\n\n if ((props.defaultSettings as any)?.globalFilter) {\n state.globalFilter = (props.defaultSettings as any)?.globalFilter;\n }\n\n return state;\n }, []);\n\n const table = useReactTable<TType>({\n data: props.data,\n columns,\n getCoreRowModel: getCoreRowModel(),\n initialState,\n ...tableOptions,\n //debugAll: true,\n meta: {\n columnFreezing,\n columnOrdering,\n currentRow,\n editing,\n enableFooter: options.enableFooter,\n fontSize,\n hoverState,\n isUsingServer: !!props.loadPage,\n printing,\n rowActions: rowActions as any,\n rowClick: rowClick as any,\n rowDrag,\n rowDrop,\n rowGoto,\n rowHeight,\n rowSelection,\n search,\n },\n });\n\n // listeners\n useCurrentRowListener(table);\n useEditingStateListener(table);\n useFilteringStateListener(table, props.onFilter);\n useRowSelectionListener(table, props.onRowSelect);\n useSettingsStateListener(table, setSettings);\n useShortcutsListener(table, props.shortcuts);\n useServerLoadingListener(table, props.loadPage);\n useSortingStateListener(table, props.onSort);\n\n return { table, length: props.length ?? props.data.length };\n}\n"],"names":["useTable","props","options","useTablePreset","tableOptions","enableColumnFilters","enableFiltering","enableColumnResizing","enableExpanding","enableRowExpansion","enableGlobalFilter","enableSearch","enableHiding","enableColumnHiding","enableRowSelection","enableMultiRowSelection","enableRowSelectionSingle","enableSorting","columnResizeMode","onFilter","filterFns","tacoFilter","row","columnId","filter","columnFilterFn","getValue","getFilteredRowModel","globalFilterFn","searchQuery","original","_row$_getAllCellsByCo","_row$_getAllCellsByCo2","dataType","_getAllCellsByColumnId","column","columnDef","meta","cellValue","getCellValueAsString","getColumnCanGlobalFilter","_column$columnDef$met","onSort","manualSorting","getSortedRowModel","defaultSettings","setSettings","useSettings","id","onChangeSettings","columnFreezing","useColumnFreezing","_ref","_defaultSettings$colu","columnFreezingIndex","frozenColumnCount","defaultColumnFreezingIndex","columnOrdering","useColumnOrdering","currentRow","useCurrentRow","defaultCurrentRowIndex","editing","useEditing","enableEditing","onSave","fontSize","useFontSize","enableFontSize","hoverState","usePauseHoverState","printing","usePrinting","enablePrinting","loadAll","showWarningWhenPrintingLargeDataset","rowActions","useRowActions","actionsForRow","actionsForRowLength","rowClick","useRowClick","onRowClick","rowDrag","useRowDrag","enableRowDrag","rowDrop","useRowDrop","enableRowDrop","onRowDrop","rowGoto","useRowGoto","enableRowGoto","onRowGoto","rowHeight","useRowHeight","enableRowHeight","_defaultSettings$rowH","rowDensity","rowSelection","useRowSelection","search","useSearch","excludeUnmatchedRecordsInSearch","columns","defaultColumnSizing","defaultColumnVisibility","defaultSorting","useConvertChildrenToColumns","initialState","React","useMemo","sanitizeSortedColumns","find","definedColumn","state","columnOrder","ensureOrdering","columnSizing","_defaultSettings$colu2","columnVisibility","_defaultSettings$colu3","sorting","_props$defaultSetting","columnFilters","_props$defaultSetting2","_props$defaultSetting3","globalFilter","_props$defaultSetting4","table","useReactTable","data","getCoreRowModel","enableFooter","isUsingServer","loadPage","useCurrentRowListener","useEditingStateListener","useFilteringStateListener","useRowSelectionListener","onRowSelect","useSettingsStateListener","useShortcutsListener","shortcuts","useServerLoadingListener","useSortingStateListener","length","_props$length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2GgBA,QAAQA,CAAkBC,KAAyB;;;EAE/D,MAAMC,OAAO,GAAGC,cAAc,CAACF,KAAK,CAAC;EAErC,MAAMG,YAAY,GAAkC;IAChDC,mBAAmB,EAAEH,OAAO,CAACI,eAAe;IAC5CC,oBAAoB,EAAEL,OAAO,CAACK,oBAAoB;IAClDC,eAAe,EAAEN,OAAO,CAACO,kBAAkB;IAC3CC,kBAAkB,EAAER,OAAO,CAACS,YAAY;IACxCC,YAAY,EAAEV,OAAO,CAACW,kBAAkB;IACxCC,kBAAkB,EAAEZ,OAAO,CAACY,kBAAkB;IAC9CC,uBAAuB,EAAE,CAACb,OAAO,CAACc,wBAAwB;IAC1DC,aAAa,EAAEf,OAAO,CAACe;GAC1B;;EAGD,IAAIb,YAAY,CAACG,oBAAoB,EAAE;IACnCH,YAAY,CAACc,gBAAgB,GAAG,UAAU;;;EAI9C,IAAId,YAAY,CAACC,mBAAmB,EAAE;IAClC,IAAI,CAACJ,KAAK,CAACkB,QAAQ,EAAE;MACjBf,YAAY,CAACgB,SAAS,GAAG;QACrBC,UAAU,EAAEA,CAACC,GAAiB,EAAEC,QAAgB,EAAEC,MAAW,KAAKC,cAAc,CAACH,GAAG,CAACI,QAAQ,CAACH,QAAQ,CAAC,EAAEC,MAAM;OAClH;MACDpB,YAAY,CAACuB,mBAAmB,GAAGA,mBAAmB,EAAE;;;;;EAOhE,IAAIvB,YAAY,CAACM,kBAAkB,EAAE;;IAEjCN,YAAY,CAACwB,cAAc,GAAG,CAACN,GAAiB,EAAEC,QAAgB,EAAEM,WAAmB;MACnF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AA,cAAAA,aAAA,GAAIlJ,KAAK,CAACkI,IAAI,CAACe;GAAQ;AAC/D;;;;"}
|
1
|
+
{"version":3,"file":"useTable.js","sources":["../../../../../../../../src/components/Table3/hooks/useTable.tsx"],"sourcesContent":["import React from 'react';\nimport {\n getCoreRowModel,\n useReactTable,\n Row as RTRow,\n RowData,\n Column as RTColumn,\n TableOptions as RTableOptions,\n TableState,\n getSortedRowModel,\n getFilteredRowModel,\n ColumnMeta,\n} from '@tanstack/react-table';\nimport {\n Table3ColumnAlignment,\n Table3ColumnRenderer,\n Table3Props,\n Table3ColumnHeaderMenu,\n Table3ColumnControlRenderer,\n Table3ColumnDataType,\n Table3ColumnClassNameHandler,\n Table3ColumnFooterRenderer,\n TableStrategy,\n Table3FilterComparator,\n} from '../types';\nimport { useCurrentRow } from './features/useCurrentRow';\nimport { usePauseHoverState } from './features/usePauseHoverState';\nimport { useTablePreset } from './useTablePreset';\nimport { useRowHeight } from './features/useRowHeight';\nimport { useFontSize } from './features/useFontSize';\nimport { useRowSelectionListener } from './listeners/useRowSelectionListener';\nimport { useRowDrag } from './features/useRowDrag';\nimport { useSettingsStateListener } from './listeners/useSettingsStateListener';\nimport { columnFilterFn, globalFilterFn } from '../util/filtering';\nimport { useSortingStateListener } from './listeners/useSortingStateListener';\nimport { useFilteringStateListener } from './listeners/useFilteringStateListener';\nimport { useCurrentRowListener } from './listeners/useCurrentRowListener';\nimport { useColumnFreezing } from './features/useColumnFreezing';\nimport { useRowSelection } from './features/useRowSelection';\nimport { useRowClick } from './features/useRowClick';\nimport { ensureOrdering, useColumnOrdering } from './features/useColumnOrdering';\nimport { useRowDrop } from './features/useRowDrop';\nimport { useConvertChildrenToColumns } from './useConvertChildrenToColumns';\nimport { useEditing } from './features/useEditing';\nimport { usePrinting } from './features/usePrinting';\nimport { useShortcutsListener } from './listeners/useShortcutsListener';\nimport { useRowGoto } from './features/useRowGoto';\nimport { useServerLoadingListener } from './listeners/useServerLoadingListener';\nimport { useEditingStateListener } from './listeners/useEditingStateListener';\nimport { useSearch } from './features/useSearch';\nimport { useRowActions } from './features/useRowActions';\nimport { useSettings } from './features/useSettings';\nimport { getCellValueAsString } from '../util/columns';\n\ndeclare module '@tanstack/table-core' {\n interface TableMeta<TData extends RowData> {\n columnFreezing: ReturnType<typeof useColumnFreezing>;\n columnOrdering: ReturnType<typeof useColumnOrdering>;\n currentRow: ReturnType<typeof useCurrentRow>;\n editing: ReturnType<typeof useEditing>;\n enableFooter: boolean;\n fontSize: ReturnType<typeof useFontSize>;\n hoverState: ReturnType<typeof usePauseHoverState>;\n isUsingServer: boolean;\n printing: ReturnType<typeof usePrinting>;\n rowActions: ReturnType<typeof useRowActions>;\n rowClick: ReturnType<typeof useRowClick>;\n rowDrag: ReturnType<typeof useRowDrag>;\n rowDrop: ReturnType<typeof useRowDrop>;\n rowGoto: ReturnType<typeof useRowGoto>;\n rowHeight: ReturnType<typeof useRowHeight>;\n rowSelection: ReturnType<typeof useRowSelection>;\n search: ReturnType<typeof useSearch>;\n }\n\n interface ColumnMeta<TData extends RowData, TValue> {\n align?: Table3ColumnAlignment;\n // @ts-expect-error -- we ignore it because it conflicts with Table2 also overridding ColumnMeta\n className?: Table3ColumnClassNameHandler<TData>;\n // @ts-expect-error -- we ignore it because it conflicts with Table2 also overridding ColumnMeta\n control?: Table3ColumnControlRenderer<TData>;\n // @ts-expect-error -- we ignore it because it conflicts with Table2 also overridding ColumnMeta\n dataType?: Table3ColumnDataType;\n // @ts-expect-error -- we ignore it because it conflicts with Table2 also overridding ColumnMeta\n defaultWidth?: number;\n enableOrdering: boolean;\n enableSearch: boolean;\n enableTruncate: boolean;\n filters?: Table3FilterComparator[];\n footer?: Table3ColumnFooterRenderer;\n header: string;\n headerClassName?: string;\n menu?: Table3ColumnHeaderMenu;\n renderer?: Table3ColumnRenderer<TValue, TData>;\n tooltip?: string;\n }\n\n interface CellContext<TData extends RowData, TValue> {\n index: number;\n tableRef: React.RefObject<HTMLDivElement>;\n }\n\n interface HeaderContext<TData extends RowData, TValue> {\n scrollToIndex: TableStrategy['scrollToIndex'];\n }\n}\n\nexport function useTable<TType = unknown>(props: Table3Props<TType>) {\n // options\n const options = useTablePreset(props);\n\n const tableOptions: Partial<RTableOptions<TType>> = {\n enableColumnFilters: options.enableFiltering,\n enableColumnResizing: options.enableColumnResizing,\n enableExpanding: options.enableRowExpansion,\n enableGlobalFilter: options.enableSearch,\n enableHiding: options.enableColumnHiding,\n enableRowSelection: options.enableRowSelection,\n enableMultiRowSelection: !options.enableRowSelectionSingle,\n enableSorting: options.enableSorting,\n };\n\n // resizing\n if (tableOptions.enableColumnResizing) {\n tableOptions.columnResizeMode = 'onChange';\n }\n\n // filtering\n if (tableOptions.enableColumnFilters) {\n if (!props.onFilter) {\n tableOptions.filterFns = {\n tacoFilter: (row: RTRow<TType>, columnId: string, filter: any) => columnFilterFn(row.getValue(columnId), filter),\n };\n tableOptions.getFilteredRowModel = getFilteredRowModel();\n }\n\n // we don't tableOptions.manualFiltering = true; because it breaks global filtering, server filtering still works :shrug:\n }\n\n // search\n if (tableOptions.enableGlobalFilter) {\n // search is always client side, since we call loadAll when searching\n tableOptions.globalFilterFn = (row: RTRow<TType>, columnId: string, searchQuery: string) => {\n try {\n if (row.original) {\n const cell = row.getAllCells().find(cell => cell.column.id === columnId);\n const columnMeta = cell?.column.columnDef.meta;\n\n if (cell && cell.column.getIsVisible() && columnMeta?.enableSearch) {\n const cellValue = getCellValueAsString(row.original[columnId], columnMeta?.dataType);\n\n if (cellValue !== undefined) {\n return globalFilterFn(cellValue, searchQuery);\n }\n }\n return false;\n }\n } catch {\n //\n }\n\n return false;\n };\n tableOptions.getFilteredRowModel = getFilteredRowModel();\n tableOptions.getColumnCanGlobalFilter = (column: RTColumn<TType>) =>\n (column.columnDef.meta as ColumnMeta<TType, unknown>).enableSearch ?? true;\n }\n\n // sorting\n if (options.enableSorting) {\n if (props.onSort) {\n tableOptions.manualSorting = true;\n // onSort is called as a listener to let the consumer update their data, so we don't use onSortingChange\n } else {\n tableOptions.getSortedRowModel = getSortedRowModel();\n }\n }\n\n const [defaultSettings, setSettings] = useSettings(props.id, props.defaultSettings, props.onChangeSettings);\n\n // custom features\n const columnFreezing = useColumnFreezing(\n // temporarily see if deprecated frozenColumnCount is there\n defaultSettings.columnFreezingIndex ?? (defaultSettings as any)?.frozenColumnCount ?? props.defaultColumnFreezingIndex,\n options\n );\n const columnOrdering = useColumnOrdering(options);\n const currentRow = useCurrentRow(props.defaultCurrentRowIndex);\n const editing = useEditing(options.enableEditing, props.onSave);\n const fontSize = useFontSize(options.enableFontSize, defaultSettings.fontSize);\n const hoverState = usePauseHoverState();\n const printing = usePrinting(options.enablePrinting, props.loadAll, defaultSettings.showWarningWhenPrintingLargeDataset);\n const rowActions = useRowActions<TType>(props.actionsForRow, props.actionsForRowLength);\n const rowClick = useRowClick<TType>(props.onRowClick);\n const rowDrag = useRowDrag(options.enableRowDrag);\n const rowDrop = useRowDrop(options.enableRowDrop, props.onRowDrop);\n const rowGoto = useRowGoto(options.enableRowGoto, props.onRowGoto);\n const rowHeight = useRowHeight(\n options.enableRowHeight,\n // temporarily see if deprecated rowDensity is there\n defaultSettings.rowHeight ?? (defaultSettings as any)?.rowDensity\n );\n const rowSelection = useRowSelection();\n const search = useSearch(options.enableSearch, defaultSettings.excludeUnmatchedRecordsInSearch, props.loadAll);\n\n // columns\n const { columns, defaultColumnSizing, defaultColumnVisibility, defaultSorting } = useConvertChildrenToColumns<TType>(\n props,\n options,\n editing\n );\n\n // built-in features\n const initialState: Partial<TableState> = React.useMemo(() => {\n const sanitizeSortedColumns = column => columns.find(definedColumn => definedColumn.id === column.id);\n\n const state: Partial<TableState> = {\n columnOrder: ensureOrdering<TType>(columns, defaultSettings.columnOrder),\n columnSizing: defaultSettings.columnSizing ?? defaultColumnSizing,\n columnVisibility: defaultSettings.columnVisibility ?? defaultColumnVisibility,\n sorting: defaultSettings.sorting ? defaultSettings.sorting.filter(sanitizeSortedColumns) : defaultSorting,\n };\n\n // we don't save these outside the table, but they need to be here for print to inherit them - see PrintButton.tsx\n if ((props.defaultSettings as any)?.columnFilters) {\n state.columnFilters = (props.defaultSettings as any)?.columnFilters;\n }\n\n if ((props.defaultSettings as any)?.globalFilter) {\n state.globalFilter = (props.defaultSettings as any)?.globalFilter;\n }\n\n return state;\n }, []);\n\n const table = useReactTable<TType>({\n data: props.data,\n columns,\n getCoreRowModel: getCoreRowModel(),\n initialState,\n ...tableOptions,\n //debugAll: true,\n meta: {\n columnFreezing,\n columnOrdering,\n currentRow,\n editing,\n enableFooter: options.enableFooter,\n fontSize,\n hoverState,\n isUsingServer: !!props.loadPage,\n printing,\n rowActions: rowActions as any,\n rowClick: rowClick as any,\n rowDrag,\n rowDrop,\n rowGoto,\n rowHeight,\n rowSelection,\n search,\n },\n });\n\n // listeners\n useCurrentRowListener(table);\n useEditingStateListener(table);\n useFilteringStateListener(table, props.onFilter);\n useRowSelectionListener(table, props.onRowSelect);\n useSettingsStateListener(table, setSettings);\n useShortcutsListener(table, props.shortcuts);\n useServerLoadingListener(table, props.loadPage);\n useSortingStateListener(table, props.onSort);\n\n return { table, length: props.length ?? props.data.length };\n}\n"],"names":["useTable","props","options","useTablePreset","tableOptions","enableColumnFilters","enableFiltering","enableColumnResizing","enableExpanding","enableRowExpansion","enableGlobalFilter","enableSearch","enableHiding","enableColumnHiding","enableRowSelection","enableMultiRowSelection","enableRowSelectionSingle","enableSorting","columnResizeMode","onFilter","filterFns","tacoFilter","row","columnId","filter","columnFilterFn","getValue","getFilteredRowModel","globalFilterFn","searchQuery","original","cell","getAllCells","find","column","id","columnMeta","columnDef","meta","getIsVisible","cellValue","getCellValueAsString","dataType","undefined","getColumnCanGlobalFilter","_column$columnDef$met","onSort","manualSorting","getSortedRowModel","defaultSettings","setSettings","useSettings","onChangeSettings","columnFreezing","useColumnFreezing","_ref","_defaultSettings$colu","columnFreezingIndex","frozenColumnCount","defaultColumnFreezingIndex","columnOrdering","useColumnOrdering","currentRow","useCurrentRow","defaultCurrentRowIndex","editing","useEditing","enableEditing","onSave","fontSize","useFontSize","enableFontSize","hoverState","usePauseHoverState","printing","usePrinting","enablePrinting","loadAll","showWarningWhenPrintingLargeDataset","rowActions","useRowActions","actionsForRow","actionsForRowLength","rowClick","useRowClick","onRowClick","rowDrag","useRowDrag","enableRowDrag","rowDrop","useRowDrop","enableRowDrop","onRowDrop","rowGoto","useRowGoto","enableRowGoto","onRowGoto","rowHeight","useRowHeight","enableRowHeight","_defaultSettings$rowH","rowDensity","rowSelection","useRowSelection","search","useSearch","excludeUnmatchedRecordsInSearch","columns","defaultColumnSizing","defaultColumnVisibility","defaultSorting","useConvertChildrenToColumns","initialState","React","useMemo","sanitizeSortedColumns","definedColumn","state","columnOrder","ensureOrdering","columnSizing","_defaultSettings$colu2","columnVisibility","_defaultSettings$colu3","sorting","_props$defaultSetting","columnFilters","_props$defaultSetting2","_props$defaultSetting3","globalFilter","_props$defaultSetting4","table","useReactTable","data","getCoreRowModel","enableFooter","isUsingServer","loadPage","useCurrentRowListener","useEditingStateListener","useFilteringStateListener","useRowSelectionListener","onRowSelect","useSettingsStateListener","useShortcutsListener","shortcuts","useServerLoadingListener","useSortingStateListener","length","_props$length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2GgBA,QAAQA,CAAkBC,KAAyB;;;EAE/D,MAAMC,OAAO,GAAGC,cAAc,CAACF,KAAK,CAAC;EAErC,MAAMG,YAAY,GAAkC;IAChDC,mBAAmB,EAAEH,OAAO,CAACI,eAAe;IAC5CC,oBAAoB,EAAEL,OAAO,CAACK,oBAAoB;IAClDC,eAAe,EAAEN,OAAO,CAACO,kBAAkB;IAC3CC,kBAAkB,EAAER,OAAO,CAACS,YAAY;IACxCC,YAAY,EAAEV,OAAO,CAACW,kBAAkB;IACxCC,kBAAkB,EAAEZ,OAAO,CAACY,kBAAkB;IAC9CC,uBAAuB,EAAE,CAACb,OAAO,CAACc,wBAAwB;IAC1DC,aAAa,EAA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AU;MACVgE,aAAa,EAAE,CAAC,CAACvI,KAAK,CAACwI,QAAQ;MAC/B/D,QAAQ;MACRK,UAAU,EAAEA,UAAiB;MAC7BI,QAAQ,EAAEA,QAAe;MACzBG,OAAO;MACPG,OAAO;MACPI,OAAO;MACPI,SAAS;MACTK,YAAY;MACZE;;GAEP,CAAC;;EAGFkC,qBAAqB,CAACP,KAAK,CAAC;EAC5BQ,uBAAuB,CAACR,KAAK,CAAC;EAC9BS,yBAAyB,CAACT,KAAK,EAAElI,KAAK,CAACkB,QAAQ,CAAC;EAChD0H,uBAAuB,CAACV,KAAK,EAAElI,KAAK,CAAC6I,WAAW,CAAC;EACjDC,wBAAwB,CAACZ,KAAK,EAAEjF,WAAW,CAAC;EAC5C8F,oBAAoB,CAACb,KAAK,EAAElI,KAAK,CAACgJ,SAAS,CAAC;EAC5CC,wBAAwB,CAACf,KAAK,EAAElI,KAAK,CAACwI,QAAQ,CAAC;EAC/CU,uBAAuB,CAAChB,KAAK,EAAElI,KAAK,CAAC6C,MAAM,CAAC;EAE5C,OAAO;IAAEqF,KAAK;IAAEiB,MAAM,GAAAC,aAAA,GAAEpJ,KAAK,CAACmJ,MAAM,cAAAC,aAAA,cAAAA,aAAA,GAAIpJ,KAAK,CAACoI,IAAI,CAACe;GAAQ;AAC/D;;;;"}
|
@@ -65,13 +65,13 @@ export { useBoundaryOverflowDetection } from './hooks/useBoundaryOverflowDetecti
|
|
65
65
|
export { Table2 } from './components/Table2/Table2.js';
|
66
66
|
export { useLazyEffect } from './hooks/useLazyEffect.js';
|
67
67
|
export { Textarea } from './components/Textarea/Textarea.js';
|
68
|
+
export { useMatchMedia } from './hooks/useMatchMedia.js';
|
69
|
+
export { useIsLargeScreen } from './hooks/useIsLargeScreen.js';
|
68
70
|
export { useTable3DataLoader } from './components/Table3/hooks/useTableDataLoader.js';
|
69
71
|
export { Table3, fixedForwardRef } from './components/Table3/Table3.js';
|
70
72
|
export { Tabs } from './components/Tabs/Tabs.js';
|
71
73
|
export { Tour, TourStep } from './components/Tour/Tour.js';
|
72
|
-
export { useMatchMedia } from './hooks/useMatchMedia.js';
|
73
74
|
export { Header } from './components/Header/Header.js';
|
74
|
-
export { useIsLargeScreen } from './hooks/useIsLargeScreen.js';
|
75
75
|
export { Layout } from './components/Layout/Layout.js';
|
76
76
|
export { getNavigationLinkClasses } from './components/Navigation2/components/Link.js';
|
77
77
|
export { Navigation2 } from './components/Navigation2/Navigation2.js';
|