@economic/taco 2.25.1 → 2.26.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Provider/Localization.d.ts +47 -55
- package/dist/components/Report/Report.d.ts +5 -19
- package/dist/components/Report/useReport.d.ts +3 -7
- package/dist/components/Select2/hooks/useChildren.d.ts +2 -1
- package/dist/components/Table/Table.d.ts +2 -2
- package/dist/components/Table3/Table3.d.ts +14 -14
- package/dist/components/Table3/components/Columns/Cell/Cell.d.ts +3 -0
- package/dist/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.d.ts +9 -0
- package/dist/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.d.ts +10 -0
- package/dist/components/Table3/components/Columns/Cell/EditingControlCell.d.ts +3 -0
- package/dist/components/Table3/components/Columns/Cell/EditingDisplayCell.d.ts +3 -0
- package/dist/components/Table3/components/Columns/Cell/util.d.ts +3 -0
- package/dist/components/Table3/components/Columns/Internal/EditingActionsMenu.d.ts +10 -0
- package/dist/components/Table3/components/Editing/Alert.d.ts +12 -0
- package/dist/components/Table3/components/Row/Editing/SaveStatus.d.ts +8 -0
- package/dist/components/Table3/components/Row/Row.d.ts +3 -0
- package/dist/components/Table3/components/Toolbar/Editing/Editing.d.ts +8 -0
- package/dist/components/Table3/features/useTableEditing.d.ts +46 -0
- package/dist/components/Table3/listeners/useTableEditingListener.d.ts +2 -0
- package/dist/components/Table3/types.d.ts +28 -351
- package/dist/components/Table3/useTable3.d.ts +11 -0
- package/dist/components/Table3/util/editing.d.ts +2 -10
- package/dist/esm/index.css +216 -515
- package/dist/esm/packages/taco/src/components/Field/Field.js +1 -0
- package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js +5 -6
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +48 -59
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/Report.js +8 -51
- package/dist/esm/packages/taco/src/components/Report/Report.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/useReport.js +8 -45
- package/dist/esm/packages/taco/src/components/Report/useReport.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js +10 -10
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +30 -218
- 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 +39 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js +85 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.js +71 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +216 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingDisplayCell.js +14 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingDisplayCell.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js +45 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js +62 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js +134 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js +54 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +41 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js +49 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +349 -0
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js +49 -0
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js +36 -0
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js +46 -38
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js +2 -0
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +52 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Body/Body.js +21 -12
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/EmptyStateBody.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/components/Cell → primitives/Table/Core/components/Columns/Cell/BuiltIns}/DisplayCell.js +6 -4
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/components/Cell → primitives/Table/Core/components/Columns/Cell/BuiltIns}/GroupedCell.js +8 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/components → primitives/Table/Core/components/Columns}/Cell/Cell.js +6 -5
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/Cell.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/components → primitives/Table/Core/components/Columns}/Cell/util.js +5 -4
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/components → primitives/Table/Core/components/Columns}/Internal/Actions.js +28 -17
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js +73 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/components → primitives/Table/Core/components/Columns}/Internal/Expansion.js +18 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/components → primitives/Table/Core/components/Columns}/Internal/Selection.js +23 -10
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Footer/Summary.js +7 -7
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Header/Header.js +12 -7
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Table3/components/columns/header → primitives/Table/Core/components/Header/components}/Goto.js +5 -5
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Header/components/Menu.js +15 -16
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Header/components/Resizer.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Header/components/SortIndicator.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Header/util.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/components/Row → primitives/Table/Core/components/Row/BuiltIns}/DisplayRow.js +30 -12
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Row/Row.js +13 -7
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Row/RowContext.js +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js +54 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/Filters.js +9 -9
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/ManageFiltersPopover.js +9 -9
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/components/Filter.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/components/FilterColumn.js +7 -7
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/components/FilterComparator.js +17 -17
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/components/FilterValue.js +7 -7
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Print/Print.js +11 -11
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.js +88 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Search/Search.js +26 -7
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Settings/HideOrOrderPopover.js +27 -13
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Settings/Settings.js +17 -17
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/styles/util.js → primitives/Table/Core/features/useStylesheet.js} +18 -2
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useStylesheet.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/styles/useColumnPinningStylesheet.js → primitives/Table/Core/features/useStylesheetColumnFreezing.js} +12 -12
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useStylesheetColumnFreezing.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/styles/useCssGridStylesheet.js → primitives/Table/Core/features/useStylesheetCssGrid.js} +9 -9
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useStylesheetCssGrid.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/util → primitives/Table/Core/features}/useTableGlobalShortcuts.js +3 -5
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRef.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report/util → primitives/Table/Core/features}/useTableRenderer.js +5 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/listeners/useTableRowActiveListener.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/listeners/useTableRowActiveListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js +50 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js +5 -15
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrag.js +14 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrag.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrop.js +9 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrop.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js +1 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +13 -9
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +58 -24
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js +1 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/dom.js +19 -3
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/input.js +1 -14
- package/dist/esm/packages/taco/src/utils/input.js.map +1 -1
- package/dist/index.css +216 -515
- package/dist/index.d.ts +1 -0
- package/dist/primitives/Table/Core/Table.d.ts +19 -0
- package/dist/{components/Report → primitives/Table/Core}/components/Body/Body.d.ts +1 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Body/EmptyStateBody.d.ts +2 -2
- package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.d.ts +3 -0
- package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.d.ts +3 -0
- package/dist/{components/Report/components → primitives/Table/Core/components/Columns}/Cell/Cell.d.ts +4 -2
- package/dist/{components/Report/components → primitives/Table/Core/components/Columns}/Cell/util.d.ts +2 -1
- package/dist/{components/Report/components → primitives/Table/Core/components/Columns}/Internal/Actions.d.ts +4 -4
- package/dist/primitives/Table/Core/components/Columns/Internal/Drag.d.ts +2 -0
- package/dist/primitives/Table/Core/components/Columns/Internal/Expansion.d.ts +2 -0
- package/dist/primitives/Table/Core/components/Columns/Internal/Selection.d.ts +2 -0
- package/dist/{components/Report → primitives/Table/Core}/components/Header/Header.d.ts +7 -2
- package/dist/{components/Table3/components/columns/header → primitives/Table/Core/components/Header/components}/Goto.d.ts +1 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Header/components/Menu.d.ts +2 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Header/components/Resizer.d.ts +1 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Header/components/SortIndicator.d.ts +1 -1
- package/dist/primitives/Table/Core/components/Header/util.d.ts +4 -0
- package/dist/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.d.ts +4 -0
- package/dist/primitives/Table/Core/components/Row/Row.d.ts +6 -0
- package/dist/{components/Report → primitives/Table/Core}/components/Row/RowContext.d.ts +0 -1
- package/dist/primitives/Table/Core/components/Toolbar/Toolbar.d.ts +7 -0
- package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/components/Filter.d.ts +1 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/components/FilterColumn.d.ts +2 -2
- package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/components/FilterComparator.d.ts +1 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/components/FilterValue.d.ts +1 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/util.d.ts +1 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Print/Print.d.ts +1 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Print/PrintDialog.d.ts +2 -2
- package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Search/Search.d.ts +3 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Settings/HideOrOrderPopover.d.ts +1 -1
- package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Settings/Settings.d.ts +2 -2
- package/dist/primitives/Table/Core/features/useStylesheetColumnFreezing.d.ts +2 -0
- package/dist/{components/Report/styles/useCssGridStylesheet.d.ts → primitives/Table/Core/features/useStylesheetCssGrid.d.ts} +2 -2
- package/dist/{components/Report/util → primitives/Table/Core/features}/useTableGlobalShortcuts.d.ts +1 -1
- package/dist/{components/Report/util → primitives/Table/Core/features}/useTableRenderer.d.ts +3 -2
- package/dist/primitives/Table/Core/types.d.ts +21 -0
- package/dist/primitives/Table/Core/useTable.d.ts +27 -0
- package/dist/primitives/Table/types.d.ts +168 -3
- package/dist/primitives/Table/useTableManager/features/useTableRowActive.d.ts +4 -2
- package/dist/primitives/Table/useTableManager/features/useTableRowDrag.d.ts +8 -0
- package/dist/primitives/Table/useTableManager/features/useTableRowDrop.d.ts +5 -0
- package/dist/primitives/Table/useTableManager/types.d.ts +1 -0
- package/dist/primitives/Table/useTableManager/useTableManager.d.ts +9 -3
- package/dist/primitives/Table/useTableManager/util/settings.d.ts +1 -1
- package/dist/taco.cjs.development.js +7134 -11743
- 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/dist/utils/dom.d.ts +2 -1
- package/package.json +3 -5
- package/dist/components/Report/components/Cell/DisplayCell.d.ts +0 -8
- package/dist/components/Report/components/Cell/GroupedCell.d.ts +0 -8
- package/dist/components/Report/components/Header/components/Goto.d.ts +0 -6
- package/dist/components/Report/components/Header/util.d.ts +0 -4
- package/dist/components/Report/components/Internal/Expansion.d.ts +0 -4
- package/dist/components/Report/components/Internal/Selection.d.ts +0 -4
- package/dist/components/Report/components/Row/DisplayRow.d.ts +0 -9
- package/dist/components/Report/components/Row/Row.d.ts +0 -9
- package/dist/components/Report/components/Toolbar/Toolbar.d.ts +0 -15
- package/dist/components/Report/styles/useColumnPinningStylesheet.d.ts +0 -2
- package/dist/components/Report/styles/util.d.ts +0 -3
- package/dist/components/Report/types.d.ts +0 -20
- package/dist/components/Table3/components/alert/ErrorAlert.d.ts +0 -10
- package/dist/components/Table3/components/columns/cell/Cell.d.ts +0 -6
- package/dist/components/Table3/components/columns/cell/DisplayCell.d.ts +0 -25
- package/dist/components/Table3/components/columns/cell/EditingCell.d.ts +0 -14
- package/dist/components/Table3/components/columns/cell/EditingControl.d.ts +0 -21
- package/dist/components/Table3/components/columns/cell/Highlight.d.ts +0 -2
- package/dist/components/Table3/components/columns/cell/Indicator.d.ts +0 -22
- package/dist/components/Table3/components/columns/cell/controls/TextareaControl.d.ts +0 -2
- package/dist/components/Table3/components/columns/footer/Footer.d.ts +0 -14
- package/dist/components/Table3/components/columns/footer/Summary.d.ts +0 -8
- package/dist/components/Table3/components/columns/header/Group.d.ts +0 -15
- package/dist/components/Table3/components/columns/header/Header.d.ts +0 -37
- package/dist/components/Table3/components/columns/header/Menu.d.ts +0 -20
- package/dist/components/Table3/components/columns/header/Resizer.d.ts +0 -7
- package/dist/components/Table3/components/columns/header/SortIndicator.d.ts +0 -12
- package/dist/components/Table3/components/columns/internal/Actions.d.ts +0 -3
- package/dist/components/Table3/components/columns/internal/Drag.d.ts +0 -4
- package/dist/components/Table3/components/columns/internal/EditingActions.d.ts +0 -8
- package/dist/components/Table3/components/columns/internal/Expansion.d.ts +0 -4
- package/dist/components/Table3/components/columns/internal/Selection.d.ts +0 -3
- package/dist/components/Table3/components/columns/styles.d.ts +0 -5
- package/dist/components/Table3/components/rows/ExpandedRow.d.ts +0 -8
- package/dist/components/Table3/components/rows/Row.d.ts +0 -26
- package/dist/components/Table3/components/rows/RowContext.d.ts +0 -10
- package/dist/components/Table3/components/rows/SkeletonRow.d.ts +0 -10
- package/dist/components/Table3/components/rows/styles.d.ts +0 -6
- package/dist/components/Table3/components/toolbar/ColumnSettings.d.ts +0 -7
- package/dist/components/Table3/components/toolbar/EditButton.d.ts +0 -7
- package/dist/components/Table3/components/toolbar/Filter/filters/Filters.d.ts +0 -7
- package/dist/components/Table3/components/toolbar/Filter/filters/components/Filter.d.ts +0 -12
- package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.d.ts +0 -12
- package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.d.ts +0 -7
- package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterValue.d.ts +0 -10
- package/dist/components/Table3/components/toolbar/FontSize.d.ts +0 -7
- package/dist/components/Table3/components/toolbar/PrintButton/PrintButton.d.ts +0 -8
- package/dist/components/Table3/components/toolbar/PrintButton/PrintIFrame.d.ts +0 -8
- package/dist/components/Table3/components/toolbar/PrintButton/WarningDialog.d.ts +0 -9
- package/dist/components/Table3/components/toolbar/PrintButton/hooks/useParentStylesheets.d.ts +0 -1
- package/dist/components/Table3/components/toolbar/RowHeight.d.ts +0 -7
- package/dist/components/Table3/components/toolbar/Search.d.ts +0 -8
- package/dist/components/Table3/components/toolbar/Settings.d.ts +0 -8
- package/dist/components/Table3/components/toolbar/Toolbar.d.ts +0 -13
- package/dist/components/Table3/hooks/features/useColumnFreezing.d.ts +0 -13
- package/dist/components/Table3/hooks/features/useEditing.d.ts +0 -31
- package/dist/components/Table3/hooks/features/useHeaderOffsetStyle.d.ts +0 -3
- package/dist/components/Table3/hooks/features/usePauseShortcuts.d.ts +0 -5
- package/dist/components/Table3/hooks/features/usePrinting.d.ts +0 -7
- package/dist/components/Table3/hooks/features/useRowActions.d.ts +0 -5
- package/dist/components/Table3/hooks/features/useRowDrag.d.ts +0 -6
- package/dist/components/Table3/hooks/features/useRowDrop.d.ts +0 -5
- package/dist/components/Table3/hooks/features/useSearch.d.ts +0 -16
- package/dist/components/Table3/hooks/features/useSettings.d.ts +0 -3
- package/dist/components/Table3/hooks/features/useValidation.d.ts +0 -13
- package/dist/components/Table3/hooks/listeners/useEditingStateListener.d.ts +0 -2
- package/dist/components/Table3/hooks/listeners/useSettingsStateListener.d.ts +0 -3
- package/dist/components/Table3/hooks/useConvertChildrenToColumns.d.ts +0 -9
- package/dist/components/Table3/hooks/useCssGrid.d.ts +0 -6
- package/dist/components/Table3/hooks/useCssVars.d.ts +0 -8
- package/dist/components/Table3/hooks/useTable.d.ts +0 -74
- package/dist/components/Table3/hooks/useTableDataLoader.d.ts +0 -22
- package/dist/components/Table3/hooks/useTablePreset.d.ts +0 -2
- package/dist/components/Table3/hooks/useTableRefInstanceSetup.d.ts +0 -4
- package/dist/components/Table3/strategies/index.d.ts +0 -4
- package/dist/components/Table3/strategies/virtualised.d.ts +0 -4
- package/dist/components/Table3/util/columns.d.ts +0 -8
- package/dist/components/Table3/util/filtering.d.ts +0 -3
- package/dist/components/Table3/util/scrolling.d.ts +0 -2
- package/dist/esm/packages/taco/src/components/Report/components/Body/Body.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Body/EmptyStateBody.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Body/util.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Cell/Cell.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Cell/DisplayCell.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Cell/GroupedCell.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Cell/util.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Footer.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Summary.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/Header.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Goto.js +0 -28
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Goto.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Menu.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Resizer.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/SortIndicator.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/util.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Actions.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Expansion.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Selection.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Row/DisplayRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Row/Row.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Row/RowContext.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Row/SkeletonRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/Toolbar.js +0 -63
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/Toolbar.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/Filters.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Filter.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterColumn.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterComparator.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterValue.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/util.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/Print.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/PrintDialog.js +0 -88
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/PrintDialog.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Search/Search.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/Settings.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/listeners/useTableRowActiveListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/styles/useColumnPinningStylesheet.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/styles/useCssGridStylesheet.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/styles/useStylesheet.js +0 -20
- package/dist/esm/packages/taco/src/components/Report/styles/useStylesheet.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/styles/util.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/util/rows.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/util/useTableGlobalShortcuts.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Report/util/useTableRenderer.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js +0 -154
- package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js +0 -84
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +0 -84
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +0 -212
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +0 -194
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js +0 -41
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Indicator.js +0 -88
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Indicator.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +0 -144
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js +0 -50
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Summary.js +0 -41
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Summary.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Goto.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +0 -74
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +0 -186
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +0 -206
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Resizer.js +0 -42
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Resizer.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/SortIndicator.js +0 -38
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/SortIndicator.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +0 -129
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Drag.js +0 -86
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Drag.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +0 -174
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Expansion.js +0 -104
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Expansion.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js +0 -187
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +0 -19
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/ExpandedRow.js +0 -27
- package/dist/esm/packages/taco/src/components/Table3/components/rows/ExpandedRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js +0 -327
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/RowContext.js +0 -14
- package/dist/esm/packages/taco/src/components/Table3/components/rows/RowContext.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/SkeletonRow.js +0 -43
- package/dist/esm/packages/taco/src/components/Table3/components/rows/SkeletonRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/styles.js +0 -9
- package/dist/esm/packages/taco/src/components/Table3/components/rows/styles.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +0 -109
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/EditButton.js +0 -29
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/EditButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +0 -164
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js +0 -102
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js +0 -50
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js +0 -111
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js +0 -118
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js +0 -26
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js +0 -211
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +0 -224
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/WarningDialog.js +0 -60
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/WarningDialog.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/hooks/useParentStylesheets.js +0 -97
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/hooks/useParentStylesheets.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js +0 -33
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js +0 -238
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +0 -65
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Toolbar.js +0 -64
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Toolbar.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnFreezing.js +0 -95
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnFreezing.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useEditing.js +0 -299
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useEditing.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js +0 -24
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePauseShortcuts.js +0 -12
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePauseShortcuts.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePrinting.js +0 -14
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePrinting.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowActions.js +0 -10
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowActions.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowDrag.js +0 -13
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowDrag.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowDrop.js +0 -9
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowDrop.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSearch.js +0 -29
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSearch.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js +0 -23
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useValidation.js +0 -178
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useValidation.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useEditingStateListener.js +0 -28
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useEditingStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js +0 -24
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js +0 -143
- package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js +0 -66
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +0 -74
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +0 -234
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTableDataLoader.js +0 -130
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTableDataLoader.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTablePreset.js +0 -122
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTablePreset.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTableRefInstanceSetup.js +0 -19
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTableRefInstanceSetup.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/strategies/index.js +0 -8
- package/dist/esm/packages/taco/src/components/Table3/strategies/index.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/strategies/virtualised.js +0 -117
- package/dist/esm/packages/taco/src/components/Table3/strategies/virtualised.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js +0 -20
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/util/columns.js +0 -60
- package/dist/esm/packages/taco/src/components/Table3/util/columns.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/util/filtering.js +0 -120
- package/dist/esm/packages/taco/src/components/Table3/util/filtering.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/util/scrolling.js +0 -53
- package/dist/esm/packages/taco/src/components/Table3/util/scrolling.js.map +0 -1
- package/dist/esm/packages/taco/src/hooks/useDebouncedEffect.js +0 -15
- package/dist/esm/packages/taco/src/hooks/useDebouncedEffect.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRef.js.map +0 -1
- package/types.json +0 -588211
- /package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Body/EmptyStateBody.js +0 -0
- /package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Body/util.js +0 -0
- /package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Footer/Footer.js +0 -0
- /package/dist/esm/packages/taco/src/{components/Report/components/Row → primitives/Table/Core/components/Row/BuiltIns}/SkeletonRow.js +0 -0
- /package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/util.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTableManager → Core}/features/useTableRef.js +0 -0
- /package/dist/esm/packages/taco/src/{components/Report → primitives/Table/Core}/util/rows.js +0 -0
- /package/dist/{components/Report → primitives/Table/Core}/components/Body/util.d.ts +0 -0
- /package/dist/{components/Report → primitives/Table/Core}/components/Footer/Footer.d.ts +0 -0
- /package/dist/{components/Report → primitives/Table/Core}/components/Footer/Summary.d.ts +0 -0
- /package/dist/{components/Report/components/Row → primitives/Table/Core/components/Row/BuiltIns}/SkeletonRow.d.ts +0 -0
- /package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/Filters.d.ts +0 -0
- /package/dist/{components/Report → primitives/Table/Core}/components/Toolbar/components/Filters/ManageFiltersPopover.d.ts +0 -0
- /package/dist/{components/Report/styles → primitives/Table/Core/features}/useStylesheet.d.ts +0 -0
- /package/dist/primitives/Table/{useTableManager → Core}/features/useTableRef.d.ts +0 -0
- /package/dist/{components/Report → primitives/Table/Core}/listeners/useTableRowActiveListener.d.ts +0 -0
- /package/dist/{components/Report → primitives/Table/Core}/util/rows.d.ts +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Search.js","sources":["../../../../../../../../../../../src/components/Report/components/Toolbar/components/Search/Search.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLocalization } from '../../../../../Provider/Localization';\nimport { SearchInput2 } from '../../../../../SearchInput2/SearchInput2';\nimport { Switch } from '../../../../../Switch/Switch';\nimport { TableServerLoadAllState } from '../../../../../../primitives/Table/types';\n\ntype SearchProps<TType = unknown> = {\n scrollToIndex: any;\n table: ReactTable<TType>;\n};\n\nexport function Search<TType = unknown>(props: SearchProps<TType>) {\n const { scrollToIndex, table } = props;\n const { texts } = useLocalization();\n const ref = React.useRef<HTMLInputElement>(null);\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const query = table.getState().globalFilter;\n const scrollTo = (rowIndex: number) => scrollToIndex(rowIndex, { align: 'center' });\n\n React.useEffect(() => {\n if (tableMeta.search.highlightedColumnIndexes.length) {\n scrollTo(tableMeta.search.highlightedColumnIndexes[0][0]);\n }\n }, [tableMeta.search.highlightedColumnIndexes.length]);\n\n const handleFocus = async () => {\n // load all data if that is possible\n if (tableMeta.server.loadAllIfNeeded) {\n // don't pass the search query because we need all data - not filtered data\n await tableMeta.server.loadAllIfNeeded(table.getState().sorting, table.getState().columnFilters, undefined);\n }\n };\n\n const handleChange = (query: any) => {\n table.setGlobalFilter(String(query ?? ''));\n };\n\n const handleToggleExcludeUnmatchedResults = (enabled: boolean) => {\n tableMeta.search.setEnableGlobalFilter(enabled, table);\n requestAnimationFrame(() => ref.current?.focus());\n };\n\n const handleNextResult = () => {\n if (!tableMeta.search.highlightedColumnIndexes.length) {\n return;\n }\n\n const nextIndex =\n tableMeta.search.currentHighlightColumnIndex === undefined ||\n tableMeta.search.currentHighlightColumnIndex === tableMeta.search.highlightedColumnIndexes.length - 1\n ? 0\n : tableMeta.search.currentHighlightColumnIndex + 1;\n\n tableMeta.search.setCurrentHighlightColumnIndex(nextIndex);\n // we scroll to the row here, the cell scrolls itself into view\n scrollTo(tableMeta.search.highlightedColumnIndexes[nextIndex][0]);\n };\n\n const handlePreviousResult = () => {\n if (!tableMeta.search.highlightedColumnIndexes.length) {\n return;\n }\n\n const nextIndex =\n tableMeta.search.currentHighlightColumnIndex === undefined\n ? 0\n : tableMeta.search.currentHighlightColumnIndex === 0\n ? tableMeta.search.highlightedColumnIndexes.length - 1\n : tableMeta.search.currentHighlightColumnIndex - 1;\n\n tableMeta.search.setCurrentHighlightColumnIndex(nextIndex);\n // we scroll to the row here, the cell scrolls itself into view\n scrollTo(tableMeta.search.highlightedColumnIndexes[nextIndex][0]);\n };\n\n const settings = (\n <Switch\n label={texts.table3.search.excludeUnmatchedResults}\n checked={!!table.options.enableGlobalFilter}\n onChange={handleToggleExcludeUnmatchedResults}\n />\n );\n\n return (\n <>\n <SearchInput2\n findCurrent={\n tableMeta.search.currentHighlightColumnIndex !== undefined\n ? tableMeta.search.currentHighlightColumnIndex + 1\n : null\n }\n findTotal={tableMeta.search.highlightedColumnIndexes?.length ?? null}\n loading={tableMeta.server.loadAllStatus === TableServerLoadAllState.Loading}\n onClickFindPrevious={handlePreviousResult}\n onClickFindNext={handleNextResult}\n onChange={handleChange}\n onFocus={handleFocus}\n placeholder={texts.table3.search.placeholder}\n settingsContent={settings}\n ref={ref}\n shortcut={{ key: 'f', meta: true, shift: false }}\n value={query}\n />\n </>\n );\n}\n"],"names":["Search","props","scrollToIndex","table","texts","useLocalization","ref","React","useRef","tableMeta","options","meta","query","getState","globalFilter","scrollTo","rowIndex","align","useEffect","search","highlightedColumnIndexes","length","handleFocus","server","loadAllIfNeeded","Promise","resolve","sorting","columnFilters","undefined","then","_temp","e","reject","handleChange","setGlobalFilter","String","handleToggleExcludeUnmatchedResults","enabled","setEnableGlobalFilter","requestAnimationFrame","_ref$current","current","focus","handleNextResult","nextIndex","currentHighlightColumnIndex","setCurrentHighlightColumnIndex","handlePreviousResult","settings","Switch","label","table3","excludeUnmatchedResults","checked","enableGlobalFilter","onChange","SearchInput2","findCurrent","findTotal","_tableMeta$search$hig","_tableMeta$search$hig2","loading","loadAllStatus","TableServerLoadAllState","Loading","onClickFindPrevious","onClickFindNext","onFocus","placeholder","settingsContent","shortcut","key","shift","value"],"mappings":";;;;;;SAYgBA,MAAMA,CAAkBC,K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AACN,SAAS,CAACU,MAAM,CAACC,wBAAwB,CAACyB,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;GACpE;EAED,MAAMI,QAAQ,gBACV1C,6BAAC2C,MAAM;IACHC,KAAK,EAAE/C,KAAK,CAACgD,MAAM,CAACjC,MAAM,CAACkC,uBAAuB;IAClDC,OAAO,EAAE,CAAC,CAACnD,KAAK,CAACO,OAAO,CAAC6C,kBAAkB;IAC3CC,QAAQ,EAAEnB;IAEjB;EAED,oBACI9B,yEACIA,6BAACkD,YAAY;IACTC,WAAW,EACPjD,SAAS,CAACU,MAAM,CAAC2B,2BAA2B,KAAKjB,SAAS,GACpDpB,SAAS,CAACU,MAAM,CAAC2B,2BAA2B,GAAG,CAAC,GAChD,IAAI;IAEda,SAAS,GAAAC,qBAAA,IAAAC,sBAAA,GAAEpD,SAAS,CAACU,MAAM,CAACC,wBAAwB,cAAAyC,sBAAA,uBAAzCA,sBAAA,CAA2CxC,MAAM,cAAAuC,qBAAA,cAAAA,qBAAA,GAAI,IAAI;IACpEE,OAAO,EAAErD,SAAS,CAACc,MAAM,CAACwC,aAAa,KAAKC,uBAAuB,CAACC,OAAO;IAC3EC,mBAAmB,EAAElB,oBAAoB;IACzCmB,eAAe,EAAEvB,gBAAgB;IACjCY,QAAQ,EAAEtB,YAAY;IACtBkC,OAAO,EAAE9C,WAAW;IACpB+C,WAAW,EAAEjE,KAAK,CAACgD,MAAM,CAACjC,MAAM,CAACkD,WAAW;IAC5CC,eAAe,EAAErB,QAAQ;IACzB3C,GAAG,EAAEA,GAAG;IACRiE,QAAQ,EAAE;MAAEC,GAAG,EAAE,GAAG;MAAE7D,IAAI,EAAE,IAAI;MAAE8D,KAAK,EAAE;KAAO;IAChDC,KAAK,EAAE9D;IACT,CACH;AAEX;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"HideOrOrderPopover.js","sources":["../../../../../../../../../../../src/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { Table as ReactTable, Column as ReactTableColumn, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { Popover, PopoverProps } from '../../../../../Popover/Popover';\nimport { Input } from '../../../../../Input/Input';\nimport * as SortablePrimitive from '../../../../../../primitives/Sortable/Sortable';\nimport { Icon } from '../../../../../Icon/Icon';\nimport { Checkbox } from '../../../../../Checkbox/Checkbox';\nimport { useLocalization } from '../../../../../Provider/Localization';\nimport { ensureOrdering, isInternalColumn } from '../../../../../../primitives/Table/useTableManager/util/columns';\n\ntype ColumnProps<TType = unknown> = React.HTMLAttributes<HTMLDivElement> & {\n column: ReactTableColumn<TType, unknown>;\n draggable?: boolean;\n};\n\nconst Column = React.forwardRef(function Column<TType = unknown>(props: ColumnProps<TType>, ref: React.Ref<HTMLDivElement>) {\n const { column, draggable = false, ...dragAttributes } = props;\n const canHide = column.getCanHide();\n\n const className = cn('group/column flex items-center gap-x-2 rounded py-1 px-2', {\n 'hover:bg-grey-200': canHide || draggable,\n 'hover:cursor-pointer': canHide,\n 'active:cursor-move active:bg-grey-300': draggable,\n });\n\n const attributes = draggable ? dragAttributes : undefined;\n const isVisible = column.getIsVisible();\n const parentHeader = column.parent?.columnDef?.header;\n\n return (\n <div {...attributes} className={className} onClick={() => column.toggleVisibility(!isVisible)} ref={ref}>\n {draggable ? <Icon name=\"drag\" className=\"text-grey-500 group-hover/column:text-grey-700 -mx-2 !h-5\" /> : null}\n <span className=\"flex-grow truncate\">\n {column.columnDef.meta?.header}\n {parentHeader ? <span className=\"italic\">({parentHeader})</span> : null}\n </span>\n {canHide ? <Checkbox checked={isVisible} onChange={() => column.toggleVisibility(!isVisible)} /> : null}\n </div>\n );\n});\n\nexport type HideOrOrderPopoverProps<TType = unknown> = PopoverProps & {\n table: ReactTable<TType>;\n};\n\nexport function HideOrOrderPopover<TType = unknown>(props: HideOrOrderPopoverProps<TType>) {\n const { table, trigger, ...popoverProps } = props;\n const { texts } = useLocalization();\n const [query, setQuery] = React.useState('');\n const allColumns = table.getAllLeafColumns();\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const columns = React.useMemo(\n () =>\n allColumns\n .filter(column => !isInternalColumn(column.id))\n .filter(column =>\n query?.length\n ? column.columnDef.meta?.header.toLowerCase().includes(query.toLowerCase()) ||\n column.parent?.columnDef.meta?.header.toLowerCase().includes(query.toLowerCase())\n : true\n ),\n [allColumns, query]\n );\n\n const listClassName = 'flex max-h-64 flex-col gap-y-px overflow-auto';\n\n const handleReorder = (activeId, overId) => {\n if (columns.find(column => column.id === overId && column.columnDef.meta?.enableOrdering === false)) {\n return;\n }\n\n table.setColumnOrder((currentOrder = []) =>\n ensureOrdering(\n allColumns,\n SortablePrimitive.arrayMove(\n currentOrder,\n currentOrder.findIndex(c => c === activeId),\n currentOrder.findIndex(c => c === overId)\n )\n )\n );\n };\n\n return (\n <Popover {...popoverProps} anchor={trigger}>\n <Popover.Content>\n <div className=\"flex max-w-sm flex-col gap-2\">\n {table.options.enableHiding ? (\n <Input\n onChange={event => setQuery(event.target.value)}\n placeholder={texts.table3.columnSettings.search}\n value={query}\n />\n ) : null}\n {tableMeta.columnOrdering.isEnabled && columns.length && !query?.length ? (\n <SortablePrimitive.Container reorder={handleReorder}>\n <SortablePrimitive.List id=\"columns\" className={listClassName}>\n {columns\n .filter(column => !column.getIsGrouped())\n .map(column => (\n <SortablePrimitive.Item\n key={column.id}\n id={column.id}\n disabled={!column.columnDef.meta?.enableOrdering}\n asChild>\n <Column column={column as any} draggable={column.columnDef.meta?.enableOrdering} />\n </SortablePrimitive.Item>\n ))}\n </SortablePrimitive.List>\n </SortablePrimitive.Container>\n ) : (\n <div className={listClassName}>\n {columns.length\n ? columns.map(column => <Column column={column as any} key={column.id} />)\n : texts.table3.columnSettings.noResults}\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover>\n );\n}\n"],"names":["Column","React","forwardRef","props","ref","column","draggable","dragAttributes","canHide","getCanHide","className","cn","attributes","undefined","isVisible","getIsVisible","parentHeader","_column$parent","parent","_column$parent$column","columnDef","header","onClick","toggleVisibility","Icon","name","meta","_column$columnDef$met","Checkbox","checked","onChange","HideOrOrderPopover","table","trigger","popoverProps","texts","useLocalization","query","setQuery","useState","allColumns","getAllLeafColumns","tableMeta","options","columns","useMemo","filter","isInternalColumn","id","_column$columnDef$met2","_column$parent2","_column$parent2$colum","length","toLowerCase","includes","listClassName","handleReorder","activeId","overId","find","_column$columnDef$met3","enableOrdering","setColumnOrder","currentOrder","ensureOrdering","SortablePrimitive","findIndex","c","Popover","anchor","Content","enableHiding","Input","event","target","value","placeholder","table3","columnSettings","search","columnOrdering","isEnabled","reorder","getIsGrouped","map","_column$columnDef$met4","_column$columnDef$met5","key","disabled","asChild","noResults"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,MAAM,gBAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,MAAMA,CAAkBG,KAAyB,EAAEC,GAA8B;;EACtH,MAAM;IAAEC,MAAM;IAAEC,SAAS,GAAG,KAAK;IAAE,GAAGC;GAAgB,GAAGJ,KAAK;EAC9D,MAAMK,OAAO,GAAGH,MAAM,CAACI,UAAU,EAAE;EAEnC,MAAMC,SAAS,GAAGC,EAAE,CAAC,0DAA0D,EAAE;IAC7E,mBAAmB,EAAEH,OAAO,IAAIF,SAAS;IACzC,sBAAsB,EAAEE,OAAO;IAC/B,uCAAuC,EAAEF;GAC5C,CAAC;EAEF,MAAMM,UAAU,GAAGN,SAAS,GAAGC,cAAc,GAAGM,SAAS;EACzD,MAAMC,SAAS,GAAGT,MAAM,CAACU,YAAY,EAAE;EACvC,MAAMC,YAAY,IAAAC,cAAA,GAAGZ,MAAM,CAACa,MAAM,cAAAD,cAAA,wBAAAE,qBAAA,GAAbF,cAAA,CAAeG,SAAS,cAAAD,qBAAA,uBAAxBA,qBAAA,CAA0BE,MAAM;EAErD,oBACIpB,sDAASW,UAAU;IAAEF,SAAS,EAAEA,SAAS;IAAEY,OAAO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AAC0C,MAAM,CAACC,cAAc,CAACY,SAAS,CACzC,CACT,CACC,CACQ,CACZ;AAElB;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Settings.js","sources":["../../../../../../../../../../../src/components/Report/components/Toolbar/components/Settings/Settings.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { IconButton } from '../../../../../IconButton/IconButton';\nimport { useLocalization } from '../../../../../Provider/Localization';\nimport { Menu } from '../../../../../Menu/Menu';\nimport { HideOrOrderPopover } from './HideOrOrderPopover';\nimport { ReportCustomSettingsRenderer } from '../../../../types';\nimport { getSettings } from '../../../../../../primitives/Table/useTableManager/util/settings';\nimport { FontSizes } from '../../../../../../types';\nimport { IconName } from '../../../../../Icon/Icon';\n\nexport type SettingsProps<TType = unknown> = {\n customSettings?: ReportCustomSettingsRenderer;\n table: ReactTable<TType>;\n};\n\nexport function Settings<TType = unknown>(props: SettingsProps<TType>) {\n const { customSettings, table } = props;\n const { texts } = useLocalization();\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n\n const canHideOrOrder = table.options.enableHiding || tableMeta.columnOrdering.isEnabled;\n const canChangeFontSize = tableMeta.fontSize.isEnabled;\n const canChangeRowHeight = tableMeta.rowHeight.isEnabled;\n\n const [popover, setPopover] = React.useState<string | undefined>(undefined);\n\n let popoverElement;\n\n if (popover) {\n const handleClosePopover = () => setPopover(undefined);\n\n switch (popover) {\n case 'columnSettings': {\n if (canHideOrOrder) {\n popoverElement = popoverProps => (\n <HideOrOrderPopover {...popoverProps} open onChange={handleClosePopover} table={table} />\n );\n }\n }\n }\n }\n\n return (\n <IconButton\n aria-label={texts.table3.otherOptions.tooltip}\n icon=\"sliders\"\n menu={\n popoverElement\n ? undefined\n : menuProps => (\n <Menu {...menuProps}>\n <Menu.Content align=\"end\">\n {canHideOrOrder ? (\n <Menu.Item icon=\"columns\" onClick={() => setPopover('columnSettings')}>\n {texts.table3.columnSettings.button}\n </Menu.Item>\n ) : null}\n {canHideOrOrder && (canChangeRowHeight || canChangeFontSize || customSettings) ? (\n <Menu.Separator />\n ) : null}\n {canChangeRowHeight ? (\n <Menu.Item\n icon={`height-${tableMeta.rowHeight.height}` as IconName}\n subMenu={() => <RowHeightMenuItem tableMeta={tableMeta} />}>\n {texts.table3.rowHeight.tooltip}\n </Menu.Item>\n ) : null}\n {canChangeFontSize ? (\n <Menu.Item icon=\"font-size\" subMenu={() => <FontSizeMenuItem tableMeta={tableMeta} />}>\n {texts.table3.fontSize.tooltip}\n </Menu.Item>\n ) : null}\n\n {customSettings ? (\n <>\n {canChangeRowHeight || canChangeFontSize ? <Menu.Separator /> : null}\n {customSettings(getSettings(table)).map((item, index) => (\n <React.Fragment key={index}>{item}</React.Fragment>\n ))}\n </>\n ) : null}\n </Menu.Content>\n </Menu>\n )\n }\n popover={popoverElement}\n onClickCapture={event => event.preventDefault()}\n tooltip={texts.table3.otherOptions.tooltip}\n />\n );\n}\n\nfunction FontSizeMenuItem<TType = unknown>({ tableMeta }: { tableMeta: ReactTableMeta<TType> }) {\n const { texts } = useLocalization();\n\n return (\n <Menu.SubMenu>\n <Menu.RadioGroup onChange={tableMeta.fontSize.setSize as any} value={tableMeta.fontSize.size}>\n <Menu.RadioGroup.Item value={FontSizes.small}>{texts.table3.fontSize.sizes.small}</Menu.RadioGroup.Item>\n <Menu.RadioGroup.Item value={FontSizes.medium}>{texts.table3.fontSize.sizes.medium}</Menu.RadioGroup.Item>\n <Menu.RadioGroup.Item disabled={tableMeta.rowHeight.height === 'short'} value={FontSizes.large}>\n {texts.table3.fontSize.sizes.large}\n </Menu.RadioGroup.Item>\n </Menu.RadioGroup>\n </Menu.SubMenu>\n );\n}\n\nfunction RowHeightMenuItem<TType = unknown>({ tableMeta }: { tableMeta: ReactTableMeta<TType> }) {\n const { texts } = useLocalization();\n\n return (\n <Menu.SubMenu>\n <Menu.RadioGroup onChange={tableMeta.rowHeight.setHeight as any} value={tableMeta.rowHeight.height}>\n <Menu.RadioGroup.Item value=\"short\">{texts.table3.rowHeight.sizes.short}</Menu.RadioGroup.Item>\n <Menu.RadioGroup.Item value=\"medium\">{texts.table3.rowHeight.sizes.medium}</Menu.RadioGroup.Item>\n <Menu.RadioGroup.Item value=\"tall\">{texts.table3.rowHeight.sizes.tall}</Menu.RadioGroup.Item>\n <Menu.RadioGroup.Item value=\"extra-tall\">{texts.table3.rowHeight.sizes.extraTall}</Menu.RadioGroup.Item>\n </Menu.RadioGroup>\n </Menu.SubMenu>\n );\n}\n"],"names":["Settings","props","customSettings","table","texts","useLocalization","tableMeta","options","meta","canHideOrOrder","enableHiding","columnOrdering","isEnabled","canChangeFontSize","fontSize","canChangeRowHeight","rowHeight","popover","setPopover","React","useState","undefined","popoverElement","handleClosePopover","popoverProps","HideOrOrderPopover","open","onChange","IconButton","table3","otherOptions","tooltip","icon","menu","menuProps","Menu","Content","align","Item","onClick","columnSettings","button","Separator","height","subMenu","RowHeightMenuItem","FontSizeMenuItem","getSettings","map","item","index","Fragment","key","onClickCapture","event","preventDefault","SubMenu","RadioGroup","setSize","value","size","FontSizes","small","sizes","medium","disabled","large","setHeight","short","tall","extraTall"],"mappings":";;;;;;;;SAgBgBA,QAAQA,CAAkBC,KAA2B;EACjE,MAAM;IAAEC,cAAc;IAAEC;GAAO,GAAGF,KAAK;EACvC,MAAM;IAAEG;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,SAAS,GAAGH,KAAK,CAACI,OAAO,CAACC,IAA6B;EAE7D,MAAMC,cAAc,GAAGN,KAAK,CAACI,OAAO,CAACG,YAAY,IAAIJ,SAAS,CAACK,cAAc,CAACC,SAAS;EACvF,MAAMC,iBAAiB,GAAGP,SAAS,CAACQ,QAAQ,CAACF,SAAS;EACtD,MAAMG,kBAAkB,GAAGT,SAAS,CAACU,SAAS,CAACJ,SAAS;EAExD,MAAM,CAACK,OAAO,EAAEC,UAAU,CAAC,GAAGC,cAAK,CAACC,QAAQ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AU,CAACnB,IAAI;IAAC2B,QAAQ,EAAE3D,SAAS,CAACU,SAAS,CAAC2B,MAAM,KAAK,OAAO;IAAEgB,KAAK,EAAEE,SAAS,CAACK;KACpF9D,KAAK,CAACyB,MAAM,CAACf,QAAQ,CAACiD,KAAK,CAACG,KAAK,CACf,CACT,CACP;AAEvB;AAEA,SAASrB,iBAAiBA,CAAkB;EAAEvC;CAAiD;EAC3F,MAAM;IAAEF;GAAO,GAAGC,eAAe,EAAE;EAEnC,oBACIc,6BAACgB,IAAI,CAACqB,OAAO,qBACTrC,6BAACgB,IAAI,CAACsB,UAAU;IAAC9B,QAAQ,EAAErB,SAAS,CAACU,SAAS,CAACmD,SAAgB;IAAER,KAAK,EAAErD,SAAS,CAACU,SAAS,CAAC2B;kBACxFxB,6BAACgB,IAAI,CAACsB,UAAU,CAACnB,IAAI;IAACqB,KAAK,EAAC;KAASvD,KAAK,CAACyB,MAAM,CAACb,SAAS,CAAC+C,KAAK,CAACK,KAAK,CAAwB,eAC/FjD,6BAACgB,IAAI,CAACsB,UAAU,CAACnB,IAAI;IAACqB,KAAK,EAAC;KAAUvD,KAAK,CAACyB,MAAM,CAACb,SAAS,CAAC+C,KAAK,CAACC,MAAM,CAAwB,eACjG7C,6BAACgB,IAAI,CAACsB,UAAU,CAACnB,IAAI;IAACqB,KAAK,EAAC;KAAQvD,KAAK,CAACyB,MAAM,CAACb,SAAS,CAAC+C,KAAK,CAACM,IAAI,CAAwB,eAC7FlD,6BAACgB,IAAI,CAACsB,UAAU,CAACnB,IAAI;IAACqB,KAAK,EAAC;KAAcvD,KAAK,CAACyB,MAAM,CAACb,SAAS,CAAC+C,KAAK,CAACO,SAAS,CAAwB,CAC1F,CACP;AAEvB;;;;"}
|
package/dist/esm/packages/taco/src/components/Report/listeners/useTableRowActiveListener.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableRowActiveListener.js","sources":["../../../../../../../../src/components/Report/listeners/useTableRowActiveListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { isElementInsideOrTriggeredFromContainer, isElementInteractive } from '../../../utils/dom';\n\nexport function useTableRowActiveListener<TType = unknown>(\n table: ReactTable<TType>,\n tableRef: React.RefObject<HTMLTableElement>\n) {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n\n // move focus to the row when active row changes, this makes sure we start within the row when tabbing\n React.useEffect(() => {\n if (tableMeta.rowActive.rowActiveIndex !== undefined) {\n const activeRow = tableRef.current?.querySelector('tbody tr[data-row-active=\"true\"]') ?? null;\n\n // if the focused element, or it's parent if it's portalled, aren't in the row, then focus the row\n // this ensures the next tab press starts at the row\n if (\n !isElementInsideOrTriggeredFromContainer(document.activeElement, activeRow) &&\n !isElementInteractive(document.activeElement)\n ) {\n (activeRow as HTMLElement)?.focus?.({ preventScroll: true });\n }\n }\n }, [tableMeta.rowActive.rowActiveIndex]);\n}\n"],"names":["useTableRowActiveListener","table","tableRef","tableMeta","options","meta","React","useEffect","rowActive","rowActiveIndex","undefined","_tableRef$current$que","_tableRef$current","activeRow","current","querySelector","isElementInsideOrTriggeredFromContainer","document","activeElement","isElementInteractive","_activeRow$focus","focus","call","preventScroll"],"mappings":";;;SAIgBA,yBAAyBA,CACrCC,KAAwB,EACxBC,QAA2C;EAE3C,MAAMC,SAAS,GAAGF,KAAK,CAACG,OAAO,CAACC,IAA6B;;EAG7DC,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIJ,SAAS,CAACK,SAAS,CAACC,cAAc,KAAKC,SAAS,EAAE;MAAA,IAAAC,qBAAA,EAAAC,iBAAA;MAClD,MAAMC,SAAS,IAAAF,qBAAA,IAAAC,iBAAA,GAAGV,QAAQ,CAACY,OAAO,cAAAF,iBAAA,uBAAhBA,iBAAA,CAAkBG,aAAa,CAAC,kCAAkC,CAAC,cAAAJ,qBAAA,cAAAA,qBAAA,GAAI,IAAI;;;MAI7F,IACI,CAACK,uCAAuC,CAACC,QAAQ,CAACC,aAAa,EAAEL,SAAS,CAAC,IAC3E,CAACM,oBAAoB,CAACF,QAAQ,CAACC,aAAa,CAAC,EAC/C;QAAA,IAAAE,gBAAA;QACGP,SAAyB,aAAzBA,SAAyB,wBAAAO,gBAAA,GAAzBP,SAAyB,CAAEQ,KAAK,cAAAD,gBAAA,uBAAhCA,gBAAA,CAAAE,IAAA,CAAAT,SAAyB,EAAU;UAAEU,aAAa,EAAE;SAAM,CAAC;;;GAGvE,EAAE,CAACpB,SAAS,CAACK,SAAS,CAACC,cAAc,CAAC,CAAC;AAC5C;;;;"}
|
package/dist/esm/packages/taco/src/components/Report/styles/useColumnPinningStylesheet.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useColumnPinningStylesheet.js","sources":["../../../../../../../../src/components/Report/styles/useColumnPinningStylesheet.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable } from '@tanstack/react-table';\n\nexport function useColumnPinningStylesheet<TType = unknown>(tableId: string, table: ReactTable<TType>) {\n const { columnPinning } = table.getState();\n\n const stylesheet = React.useMemo(() => {\n const styles: string[] = [];\n\n // might be a better way to get this information, but it wasn't obvious\n const all = table\n .getFlatHeaders()\n .filter(column => !column.subHeaders.length)\n .map(x => x.id);\n const left = table\n .getLeftFlatHeaders()\n .filter(column => !column.subHeaders.length)\n .map(x => x.id);\n const right = table\n .getRightFlatHeaders()\n .filter(column => !column.subHeaders.length)\n .map(x => x.id);\n\n if (left.length) {\n const index = all.indexOf(left[left.length - 1]);\n\n // add right border, hide the header seperator and add shadow when scrolled\n // we have to be specific so that nested tables don't inherit the same css\n styles.push(`table[data-taco='report']#${tableId} > thead > tr > th:nth-child(${index + 1}),\n table[data-taco='report']#${tableId} > tbody > tr > td:nth-child(${index + 1}) {\n border-right-width: 1px;\n }\\ntable[data-taco='report']#${tableId} > thead > tr > th:nth-child(${index + 1})[data-cell-id^=\"__\"],\n table[data-taco='report']#${tableId} > tbody > tr > td:nth-child(${index + 1})[data-cell-id^=\"__\"] {\n border-right-color: transparent;\n }\\ntable[data-taco='report']#${tableId} > thead > tr > th:nth-child(${index + 1}):after {\n content: none;\n }\\ntable[data-taco='report'][data-table-horizontally-scrolled=\"true\"]#${tableId} > thead > tr > th:nth-child(${\n index + 1\n }),\n table[data-taco='report'][data-table-horizontally-scrolled=\"true\"]#${tableId} > tbody > tr > td:nth-child(${\n index + 1\n }) {\n border-right-color: rgb(221, 221, 221);\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%);\n }`);\n }\n\n if (right.length) {\n const index = all.indexOf(right[right.length - 1]);\n\n styles.push(`table[data-taco='report']#${tableId} > thead > tr > th:nth-child(${index + 1}):not([data-cell-id^=\"__\"]),\n table[data-taco='report']#${tableId} > tbody > tr > td:nth-child(${index + 1}):not([data-cell-id^=\"__\"]) {\n border-left-width: 1px;\n }`);\n }\n\n return styles.join('\\n');\n }, [columnPinning]);\n\n return stylesheet;\n}\n"],"names":["useColumnPinningStylesheet","tableId","table","columnPinning","getState","stylesheet","React","useMemo","styles","all","getFlatHeaders","filter","column","subHeaders","length","map","x","id","left","getLeftFlatHeaders","right","getRightFlatHeaders","index","indexOf","push","join"],"mappings":";;SAGgBA,0BAA0BA,CAAkBC,OAAe,EAAEC,KAAwB;EACjG,MAAM;IAAEC;GAAe,GAAGD,KAAK,CAACE,QAAQ,EAAE;EAE1C,MAAMC,UAAU,GAAGC,cAAK,CAACC,OAAO,CAAC;IAC7B,MAAMC,MAAM,GAAa,EAAE;;IAG3B,MAAMC,GAAG,GAAGP,KAAK,CACZQ,cAAc,EAAE,CAChBC,MAAM,CAACC,MAAM,IAAI,CAACA,MAAM,CAACC,UAAU,CAACC,MAAM,CAAC,CAC3CC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,CAAC;IACnB,MAAMC,IAAI,GAAGhB,KAAK,CACbiB,kBAAkB,EAAE,CACpBR,MAAM,CAACC,MAAM,IAAI,CAACA,MAAM,CAACC,UAAU,CAACC,MAAM,CAAC,CAC3CC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,CAAC;IACnB,MAAMG,KAAK,GAAGlB,KAAK,CACdmB,mBAAmB,EAAE,CACrBV,MAAM,CAACC,MAAM,IAAI,CAACA,MAAM,CAACC,UAAU,CAACC,MAAM,CAAC,CAC3CC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,CAAC;IAEnB,IAAIC,IAAI,CAACJ,MAAM,EAAE;MACb,MAAMQ,KAAK,GAAGb,GAAG,CAACc,OAAO,CAACL,IAAI,CAACA,IAAI,CAACJ,MAAM,GAAG,CAAC,CAAC,CAAC;;;MAIhDN,MAAM,CAACgB,IAAI,8BAA8BvB,uCAAuCqB,KAAK,GAAG;4CACxDrB,wCAAwCqB,KAAK,GAAG;;+CAE7CrB,wCAAwCqB,KAAK,GAAG;4CACnDrB,wCAAwCqB,KAAK,GAAG;;+CAE7CrB,wCAAwCqB,KAAK,GAAG;;wFAEPrB,wCACxEqB,KAAK,GAAG;qFAE6DrB,wCACrEqB,KAAK,GAAG;;;kBAIN,CAAC;;IAGX,IAAIF,KAAK,CAACN,MAAM,EAAE;MACd,MAAMQ,KAAK,GAAGb,GAAG,CAACc,OAAO,CAACH,KAAK,CAACA,KAAK,CAACN,MAAM,GAAG,CAAC,CAAC,CAAC;MAElDN,MAAM,CAACgB,IAAI,8BAA8BvB,uCAAuCqB,KAAK,GAAG;4CACxDrB,uCAAuCqB,KAAK,GAAG;;kBAEzE,CAAC;;IAGX,OAAOd,MAAM,CAACiB,IAAI,CAAC,IAAI,CAAC;GAC3B,EAAE,CAACtB,aAAa,CAAC,CAAC;EAEnB,OAAOE,UAAU;AACrB;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useCssGridStylesheet.js","sources":["../../../../../../../../src/components/Report/styles/useCssGridStylesheet.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { TableFontSize } from '../../../primitives/Table/types';\nimport { getCellMinWidth } from '../../../primitives/Table/useTableManager/util/columns';\n\nexport function useCssGridStylesheet<TType = unknown>(\n tableId: string,\n table: ReactTable<TType>,\n fontSize: TableFontSize\n): string {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const allVisibleColumns = table.getVisibleLeafColumns();\n const columnSizing = table.getState().columnSizing;\n const globalMinSize = getCellMinWidth(fontSize);\n\n // header body ?footer\n const gridTemplateRows = table.getRowModel().rows.length ? 'min-content 1fr min-content' : 'min-content 1fr';\n\n return React.useMemo(() => {\n let printGridTemplateColumns = '';\n const printHiddenColumns: string[] = [];\n\n const gridTemplateColumns = allVisibleColumns.reduce((accum, column, index) => {\n if (table.options.enableGrouping && column.getIsGrouped()) {\n return accum;\n }\n\n const minSize = column.columnDef.minSize ?? globalMinSize;\n const width = columnSizing[column.id] as number | 'grow';\n\n let size;\n let printSize;\n\n if (column.id === '__actions') {\n const minWidth = tableMeta.rowActions.rowActionsLength * 32 + 8; /* button margins l+r */\n size = `minmax(${minWidth}px, auto)`;\n } else if (width !== undefined) {\n const isLastColumn = index === allVisibleColumns.length - 1;\n\n if (width === 'grow' || (Number.isNaN(width) && !isLastColumn)) {\n size = `minmax(${minSize}px, 1fr)`;\n } else {\n const minWidth = width < minSize ? minSize : width;\n\n if (isLastColumn) {\n size = `minmax(${minWidth}px, auto)`;\n } else {\n size = `${minWidth}px`;\n }\n }\n } else {\n size = `minmax(${minSize}px, auto)`;\n }\n\n if (column.columnDef.meta?.enablePrinting === false) {\n printSize = '';\n printHiddenColumns.push(column.id);\n } else {\n printSize = 'auto';\n }\n\n printGridTemplateColumns = `${printGridTemplateColumns} ${printSize}`.trim();\n\n return `${accum} ${size}`.trim();\n }, '');\n\n // we have to be specific so that nested tables don't inherit the same css\n const hiddenColumns = printHiddenColumns\n .map(\n id =>\n `table[data-taco='report']#${tableId} > thead > tr > th[data-cell-id='${id}']\\n,table[data-taco='report']#${tableId} > tbody > tr > td[data-cell-id='${id}']\\n`\n )\n .join(',');\n\n return `table[data-taco='report']#${tableId} { grid-template-columns: ${gridTemplateColumns}; grid-template-rows: ${gridTemplateRows}; }\n@media print { table[data-taco='report']#${tableId} { grid-template-columns: ${printGridTemplateColumns}; } ${\n hiddenColumns ? `${hiddenColumns} { display: none; }` : ''\n } }`;\n }, [allVisibleColumns, columnSizing, globalMinSize, tableMeta.rowActions.rowActionsLength]);\n}\n"],"names":["useCssGridStylesheet","tableId","table","fontSize","tableMeta","options","meta","allVisibleColumns","getVisibleLeafColumns","columnSizing","getState","globalMinSize","getCellMinWidth","gridTemplateRows","getRowModel","rows","length","React","useMemo","printGridTemplateColumns","printHiddenColumns","gridTemplateColumns","reduce","accum","column","index","enableGrouping","getIsGrouped","minSize","_column$columnDef$min","columnDef","width","id","size","printSize","minWidth","rowActions","rowActionsLength","undefined","isLastColumn","Number","isNaN","_column$columnDef$met","enablePrinting","push","trim","hiddenColumns","map","join"],"mappings":";;;SAKgBA,oBAAoBA,CAChCC,OAAe,EACfC,KAAwB,EACxBC,QAAuB;EAEvB,MAAMC,SAAS,GAAGF,KAAK,CAACG,OAAO,CAACC,IAA6B;EAC7D,MAAMC,iBAAiB,GAAGL,KAAK,CAACM,qBAAqB,EAAE;EACvD,MAAMC,YAAY,GAAGP,KAAK,CAACQ,QAAQ,EAAE,CAACD,YAAY;EAClD,MAAME,aAAa,GAAGC,eAAe,CAACT,QAAQ,CAAC;;EAG/C,MAAMU,gBAAgB,GAAGX,KAAK,CAACY,WAAW,EAAE,CAACC,IAAI,CAACC,MAAM,GAAG,6BAA6B,GAAG,iBAAiB;EAE5G,OAAOC,cAAK,CAACC,OAAO,CAAC;IACjB,IAAIC,wBAAwB,GAAG,EAAE;IACjC,MAAMC,kBAAkB,GAAa,EAAE;IAEvC,MAAMC,mBAAmB,GAAGd,iBAAiB,CAACe,MAAM,CAAC,CA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AAM;QACHE,SAAS,GAAG,MAAM;;MAGtBf,wBAAwB,MAAMA,4BAA4Be,WAAW,CAACW,IAAI,EAAE;MAE5E,UAAUtB,SAASU,MAAM,CAACY,IAAI,EAAE;KACnC,EAAE,EAAE,CAAC;;IAGN,MAAMC,aAAa,GAAG1B,kBAAkB,CACnC2B,GAAG,CACAf,EAAE,iCAC+B/B,2CAA2C+B,oCAAoC/B,2CAA2C+B,QAAQ,CACtK,CACAgB,IAAI,CAAC,GAAG,CAAC;IAEd,oCAAoC/C,oCAAoCoB,4CAA4CR;2CACjFZ,oCAAoCkB,+BACnE2B,aAAa,MAAMA,kCAAkC,GAAG,MACxD;GACP,EAAE,CAACvC,iBAAiB,EAAEE,YAAY,EAAEE,aAAa,EAAEP,SAAS,CAACgC,UAAU,CAACC,gBAAgB,CAAC,CAAC;AAC/F;;;;"}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import { useCssGridStylesheet } from './useCssGridStylesheet.js';
|
3
|
-
import { useColumnPinningStylesheet } from './useColumnPinningStylesheet.js';
|
4
|
-
import { getCellWidthPadding, getCellHeightPadding } from './util.js';
|
5
|
-
|
6
|
-
function useStylesheet(tableId, table) {
|
7
|
-
const tableMeta = table.options.meta;
|
8
|
-
const cssGridStylesheet = useCssGridStylesheet(tableId, table, tableMeta.fontSize.size);
|
9
|
-
const columnPinningStylesheet = useColumnPinningStylesheet(tableId, table);
|
10
|
-
const genericStylesheet = `table[data-taco='report']#${tableId} {
|
11
|
-
--table-header-group-depth: ${table.getHeaderGroups().length};
|
12
|
-
--table-cell-padding-x: ${getCellWidthPadding(tableMeta.fontSize.size)};
|
13
|
-
--table-cell-padding-y: ${getCellHeightPadding(tableMeta.rowHeight.height, tableMeta.fontSize.size)};
|
14
|
-
}`;
|
15
|
-
const css = [genericStylesheet, cssGridStylesheet, columnPinningStylesheet].filter(s => !!s).join('\n');
|
16
|
-
return /*#__PURE__*/React__default.createElement("style", null, css);
|
17
|
-
}
|
18
|
-
|
19
|
-
export { useStylesheet };
|
20
|
-
//# sourceMappingURL=useStylesheet.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useStylesheet.js","sources":["../../../../../../../../src/components/Report/styles/useStylesheet.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useCssGridStylesheet } from './useCssGridStylesheet';\nimport { useColumnPinningStylesheet } from './useColumnPinningStylesheet';\nimport { getCellHeightPadding, getCellWidthPadding } from './util';\n\nexport function useStylesheet<TType = unknown>(tableId: string, table: ReactTable<TType>) {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const cssGridStylesheet = useCssGridStylesheet<TType>(tableId, table, tableMeta.fontSize.size);\n const columnPinningStylesheet = useColumnPinningStylesheet(tableId, table);\n\n const genericStylesheet = `table[data-taco='report']#${tableId} {\n --table-header-group-depth: ${table.getHeaderGroups().length};\n --table-cell-padding-x: ${getCellWidthPadding(tableMeta.fontSize.size)};\n --table-cell-padding-y: ${getCellHeightPadding(tableMeta.rowHeight.height, tableMeta.fontSize.size)};\n }`;\n\n const css = [genericStylesheet, cssGridStylesheet, columnPinningStylesheet].filter(s => !!s).join('\\n');\n\n return <style>{css}</style>;\n}\n"],"names":["useStylesheet","tableId","table","tableMeta","options","meta","cssGridStylesheet","useCssGridStylesheet","fontSize","size","columnPinningStylesheet","useColumnPinningStylesheet","genericStylesheet","getHeaderGroups","length","getCellWidthPadding","getCellHeightPadding","rowHeight","height","css","filter","s","join","React"],"mappings":";;;;;SAMgBA,aAAaA,CAAkBC,OAAe,EAAEC,KAAwB;EACpF,MAAMC,SAAS,GAAGD,KAAK,CAACE,OAAO,CAACC,IAA6B;EAC7D,MAAMC,iBAAiB,GAAGC,oBAAoB,CAAQN,OAAO,EAAEC,KAAK,EAAEC,SAAS,CAACK,QAAQ,CAACC,IAAI,CAAC;EAC9F,MAAMC,uBAAuB,GAAGC,0BAA0B,CAACV,OAAO,EAAEC,KAAK,CAAC;EAE1E,MAAMU,iBAAiB,gCAAgCX;sCACrBC,KAAK,CAACW,eAAe,EAAE,CAACC;kCAC5BC,mBAAmB,CAACZ,SAAS,CAACK,QAAQ,CAACC,IAAI;kCAC3CO,oBAAoB,CAACb,SAAS,CAACc,SAAS,CAACC,MAAM,EAAEf,SAAS,CAACK,QAAQ,CAACC,IAAI;MACpG;EAEF,MAAMU,GAAG,GAAG,CAACP,iBAAiB,EAAEN,iBAAiB,EAAEI,uBAAuB,CAAC,CAACU,MAAM,CAACC,CAAC,IAAI,CAAC,CAACA,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;EAEvG,oBAAOC,4CAAQJ,GAAG,CAAS;AAC/B;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../../../../src/components/Report/styles/util.ts"],"sourcesContent":["import { TableFontSize, TableRowHeight } from '../../../primitives/Table/types';\n\n// we cannot just use a fixed height because our rows need to grow in height (images, edit mode validation etc)\nexport function getCellHeightPadding(height: TableRowHeight, fontSize: TableFontSize) {\n // TODO: can we get the rem values from tailwind\n switch (height) {\n case 'short': {\n switch (fontSize) {\n case 'small':\n return '8px';\n\n default:\n return '6px';\n }\n }\n\n case 'tall': {\n switch (fontSize) {\n case 'small':\n return '16px';\n\n case 'large':\n return '12px';\n\n default:\n return '14px';\n }\n }\n\n case 'extra-tall': {\n switch (fontSize) {\n case 'small':\n return '22px';\n\n case 'large':\n return '18px';\n\n default:\n return '20px';\n }\n }\n\n default: {\n switch (fontSize) {\n case 'small':\n return '12px';\n\n case 'large':\n return '8px';\n\n default:\n return '10px';\n }\n }\n }\n}\n\nexport function getCellWidthPadding(fontSize: TableFontSize) {\n switch (fontSize) {\n case 'small':\n return '8px';\n\n case 'medium':\n return '12px';\n\n default:\n return '16px';\n }\n}\n"],"names":["getCellHeightPadding","height","fontSize","getCellWidthPadding"],"mappings":"AAEA;SACgBA,oBAAoBA,CAACC,MAAsB,EAAEC,QAAuB;;EAEhF,QAAQD,MAAM;IACV,KAAK,OAAO;MAAE;QACV,QAAQC,QAAQ;UACZ,KAAK,OAAO;YACR,OAAO,KAAK;UAEhB;YACI,OAAO,KAAK;;;IAIxB,KAAK,MAAM;MAAE;QACT,QAAQA,QAAQ;UACZ,KAAK,OAAO;YACR,OAAO,MAAM;UAEjB,KAAK,OAAO;YACR,OAAO,MAAM;UAEjB;YACI,OAAO,MAAM;;;IAIzB,KAAK,YAAY;MAAE;QACf,QAAQA,QAAQ;UACZ,KAAK,OAAO;YACR,OAAO,MAAM;UAEjB,KAAK,OAAO;YACR,OAAO,MAAM;UAEjB;YACI,OAAO,MAAM;;;IAIzB;MAAS;QACL,QAAQA,QAAQ;UACZ,KAAK,OAAO;YACR,OAAO,MAAM;UAEjB,KAAK,OAAO;YACR,OAAO,KAAK;UAEhB;YACI,OAAO,MAAM;;;;AAIjC;SAEgBC,mBAAmBA,CAACD,QAAuB;EACvD,QAAQA,QAAQ;IACZ,KAAK,OAAO;MACR,OAAO,KAAK;IAEhB,KAAK,QAAQ;MACT,OAAO,MAAM;IAEjB;MACI,OAAO,MAAM;;AAEzB;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"rows.js","sources":["../../../../../../../../src/components/Report/util/rows.ts"],"sourcesContent":["export const ROW_HEIGHT_ESTIMATES = {\n short: 33,\n medium: 41,\n tall: 49,\n 'extra-tall': 57,\n};\n\nexport const HEADER_ROW_HEIGHT_ESTIMATE = ROW_HEIGHT_ESTIMATES.medium + 2; // header includes 2px border\n"],"names":["ROW_HEIGHT_ESTIMATES","short","medium","tall","HEADER_ROW_HEIGHT_ESTIMATE"],"mappings":"MAAaA,oBAAoB,GAAG;EAChCC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,EAAE;EACVC,IAAI,EAAE,EAAE;EACR,YAAY,EAAE;;MAGLC,0BAA0B,GAAGJ,oBAAoB,CAACE,MAAM,GAAG,EAAE;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableGlobalShortcuts.js","sources":["../../../../../../../../src/components/Report/util/useTableGlobalShortcuts.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { TableRef } from '../../../primitives/Table/types';\nimport {\n isElementInsideOrTriggeredFromContainer,\n isElementInsideOverlay,\n isElementInteractive,\n isSiblingElementInsideSameParentOverlay,\n} from '../../../utils/dom';\n\nexport function useTableGlobalShortcuts<TType = unknown>(\n table: ReactTable<TType>,\n tableRef: React.RefObject<TableRef>,\n scrollToIndex: (index: number) => void\n) {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n React.useEffect(\n () => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const trigger = event.target as HTMLElement;\n\n if (\n (isElementInsideOverlay(trigger) && !isSiblingElementInsideSameParentOverlay(trigger, tableRef.current)) ||\n (isElementInteractive(trigger) && !isElementInsideOrTriggeredFromContainer(trigger, tableRef.current))\n ) {\n return;\n }\n\n tableMeta.rowActive.handleKeyDown(event, rows.length, scrollToIndex, tableRef);\n tableMeta.rowSelection.handleKeyDown(event, table);\n\n if (tableMeta.rowActive.rowActiveIndex !== undefined) {\n tableMeta.rowClick.handleKeyDown(event, rows[tableMeta.rowActive.rowActiveIndex]?.original);\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n },\n // See https://github.com/e-conomic/taco/blob/dev/packages/taco/src/components/Table3/strategies/virtualised.tsx#L143\n // scrollToIndex function changes when row count changes, so it is important to update handlers with new\n // scrollToIndex function.\n [tableRef.current, tableMeta.rowActive.rowActiveIndex, scrollToIndex]\n );\n}\n"],"names":["useTableGlobalShortcuts","table","tableRef","scrollToIndex","tableMeta","options","meta","rows","getRowModel","React","useEffect","handleKeyDown","event","trigger","target","isElementInsideOverlay","isSiblingElementInsideSameParentOverlay","current","isElementInteractive","isElementInsideOrTriggeredFromContainer","rowActive","length","rowSelection","rowActiveIndex","undefined","_rows$tableMeta$rowAc","rowClick","original","document","addEventListener","removeEventListener"],"mappings":";;;SAUgBA,uBAAuBA,CACnCC,KAAwB,EACxBC,QAAmC,EACnCC,aAAsC;EAEtC,MAAMC,SAAS,GAAGH,KAAK,CAACI,OAAO,CAACC,IAA6B;EAC7D,MAAMC,IAAI,GAAGN,KAAK,CAACO,WAAW,EAAE,CAACD,IAAI;EAErCE,cAAK,CAACC,SAAS,CACX;IACI,MAAMC,aAAa,GAAIC,KAAoB;MACvC,MAAMC,OAAO,GAAGD,KAAK,CAACE,MAAqB;MAE3C,IACKC,sBAAsB,CAACF,OAAO,CAAC,IAAI,CAACG,uCAAuC,CAACH,OAAO,EAAEX,QAAQ,CAACe,OAAO,CAAC,IACtGC,oBAAoB,CAACL,OAAO,CAAC,IAAI,CAACM,uCAAuC,CAACN,OAAO,EAAEX,QAAQ,CAACe,OAAO,CAAE,EACxG;QACE;;MAGJb,SAAS,CAACgB,SAAS,CAACT,aAAa,CAACC,KAAK,EAAEL,IAAI,CAACc,MAAM,EAAElB,aAAa,EAAED,QAAQ,CAAC;MAC9EE,SAAS,CAACkB,YAAY,CAACX,aAAa,CAACC,KAAK,EAAEX,KAAK,CAAC;MAElD,IAAIG,SAAS,CAACgB,SAAS,CAACG,cAAc,KAAKC,SAAS,EAAE;QAAA,IAAAC,qBAAA;QAClDrB,SAAS,CAACsB,QAAQ,CAACf,aAAa,CAACC,KAAK,GAAAa,qBAAA,GAAElB,IAAI,CAACH,SAAS,CAACgB,SAAS,CAACG,cAAc,CAAC,cAAAE,qBAAA,uBAAxCA,qBAAA,CAA0CE,QAAQ,CAAC;;KAElG;IAEDC,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAElB,aAAa,CAAC;IAEnD,OAAO;MACHiB,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAEnB,aAAa,CAAC;KACzD;GACJ;;;;EAID,CAACT,QAAQ,CAACe,OAAO,EAAEb,SAAS,CAACgB,SAAS,CAACG,cAAc,EAAEpB,aAAa,CAAC,CACxE;AACL;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableRenderer.js","sources":["../../../../../../../../src/components/Report/util/useTableRenderer.tsx"],"sourcesContent":["import React, { CSSProperties } from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport {\n useVirtualizer,\n defaultRangeExtractor,\n ScrollToOptions as ReactVirtualScrollToOptions,\n VirtualItem,\n} from '@tanstack/react-virtual';\nimport { TableRef } from '../../../primitives/Table/types';\nimport { HEADER_ROW_HEIGHT_ESTIMATE, ROW_HEIGHT_ESTIMATES } from './rows';\nimport { Row } from '../components/Row/Row';\n\nconst TABLE_SCROLL_PADDING_BOTTOM = 36;\nconst TABLE_PADDING_BOTTOM = 120;\n\nexport function useTableRenderer<TType = unknown>(\n table: ReactTable<TType>,\n tableRef: React.RefObject<TableRef>,\n defaultRowActiveIndex?: number | undefined\n) {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n const HEADER_OFFSET_TOTAL = HEADER_ROW_HEIGHT_ESTIMATE * table.getHeaderGroups().length;\n\n // expanded rows\n const { createRowMeasurer, estimateSize } = useRowHeightVirtualisation<TType>(table);\n\n // row groups\n const rangeExtractor = useRowGroupVirtualisation<TType>(table);\n\n const virtualiser = useVirtualizer({\n count: rows.length,\n estimateSize,\n getScrollElement: () => tableRef.current,\n overscan: tableMeta.printing.isPrinting ? rows.length : undefined,\n rangeExtractor,\n scrollPaddingStart: table.getState().grouping?.length ? HEADER_ROW_HEIGHT_ESTIMATE : undefined,\n scrollPaddingEnd: HEADER_OFFSET_TOTAL + TABLE_SCROLL_PADDING_BOTTOM,\n paddingEnd: TABLE_PADDING_BOTTOM,\n });\n\n const virtualItems = virtualiser.getVirtualItems();\n\n const scrollToIndex = React.useCallback(\n (index: number, options: ReactVirtualScrollToOptions = { align: 'auto', behavior: 'smooth' }) => {\n const notSmooth: ReactVirtualScrollToOptions = { ...options, behavior: 'auto' };\n\n if (tableRef.current) {\n if (index === 0) {\n virtualiser.scrollToOffset(0, notSmooth);\n } else if (index >= virtualItems.length - 1) {\n // scrolling to the last row isn't easy when rows have dynamic height\n // because you don't know all the heights until they render...\n // so when you skip to the last you don't know if \"the end\" is actually the end\n virtualiser.scrollToIndex(index, notSmooth);\n\n // https://github.com/TanStack/virtual/issues/216\n setTimeout(() => {\n virtualiser.scrollToIndex(index, notSmooth);\n\n setTimeout(() => {\n virtualiser.scrollToIndex(index, notSmooth);\n }, 150);\n }, 150);\n } else {\n virtualiser.scrollToIndex(index, options);\n }\n }\n },\n [virtualItems.length, tableRef.current]\n );\n\n // styling for offsetting rows - this \"is\" the virtualisation\n const [paddingTop, paddingBottom] =\n virtualItems.length > 0\n ? [\n // use row 1 not 0, because 0 might be sticky in grouped tables and it's start value will always be 0\n Math.max(\n 0,\n (virtualItems[1] ?? virtualItems[0]).start - virtualiser.options.scrollMargin - virtualItems[0].size\n ),\n Math.max(0, virtualiser.getTotalSize() - virtualItems[virtualItems.length - 1].end),\n ]\n : [0, 0];\n\n // ensure default active rows are scrolled to\n React.useEffect(() => {\n if (defaultRowActiveIndex) {\n scrollToIndex(defaultRowActiveIndex, { align: 'center', behavior: 'auto' });\n }\n }, []);\n\n // rendered output\n let style: CSSProperties = {};\n let content: JSX.Element[] | null = null;\n\n if (rows.length) {\n style = {\n height: `${virtualiser.getTotalSize()}px`,\n paddingBottom,\n paddingTop,\n };\n content = virtualItems.map(virtualRow => {\n const row = rows[virtualRow.index];\n const measureRow = createRowMeasurer(virtualiser.resizeItem, virtualRow);\n return <Row key={row.id} row={row} index={virtualRow.index} table={table} measureRow={measureRow} />;\n });\n }\n\n return {\n rows: content,\n style,\n scrollToIndex,\n };\n}\n\n// support varying row heights - variable row heights, row expansion\nfunction useRowHeightVirtualisation<TType = unknown>(table: ReactTable<TType>) {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n const expandedState = table.getState().expanded;\n\n const [expandedRowHeightsCache, setExpandedRowHeightsCache] = React.useState<Record<number, number>>({});\n\n // look at all registered expanded row heights and use them to form a more accurate average size\n // it might be worth considering if taking the max, or an upper bound, would be better\n const averageExpandedRowHeight = React.useMemo(() => {\n const values: number[] = Object.values(expandedRowHeightsCache);\n return values.length ? values.reduce((a, b) => a + b, 0) / values.length : 0;\n }, [expandedRowHeightsCache]);\n\n // row heights\n const estimateSize = React.useCallback(\n (index: number) => {\n const rowHeight = tableMeta.rowHeight.height\n ? ROW_HEIGHT_ESTIMATES[tableMeta.rowHeight.height]\n : ROW_HEIGHT_ESTIMATES.medium;\n\n if (expandedState === true || rows[index]?.getIsExpanded?.()) {\n return rowHeight + averageExpandedRowHeight;\n }\n\n return rowHeight;\n },\n [tableMeta.rowHeight.height, averageExpandedRowHeight, expandedState]\n );\n\n const createRowMeasurer = React.useCallback(\n (resizeItem: (item: VirtualItem, size: number) => void, virtualRow: VirtualItem) =>\n (rowHeight: number, expansionHeight?: number) => {\n // register the expansion height so that it can be used to determine an average\n if (expansionHeight) {\n setExpandedRowHeightsCache(cache => ({ ...cache, [virtualRow.index]: expansionHeight }));\n }\n\n // update the whole row's size to include the expanded height\n resizeItem(virtualRow, rowHeight + (expansionHeight ?? 0));\n },\n []\n );\n\n return { estimateSize, createRowMeasurer };\n}\n\n// support virtualised row groups (where the row group headers are sticky)\nfunction useRowGroupVirtualisation<TType = unknown>(table: ReactTable<TType>) {\n const rows = table.getRowModel().rows;\n const isTableGrouped = !!table.getState().grouping.length;\n\n const rowGroupIndexes = React.useMemo(() => {\n const indexes: number[] = [];\n\n if (isTableGrouped) {\n rows.forEach((row, index) => {\n if (row.getIsGrouped()) {\n indexes.push(index);\n }\n });\n }\n\n return indexes;\n }, []);\n\n // this is taken from the react-virtual docs/examples\n const rangeExtractor = React.useCallback(\n range => {\n const activeRowGroupIndex =\n [...rowGroupIndexes].reverse().find(index => range.startIndex >= index) ?? rowGroupIndexes[0];\n\n const next = new Set([activeRowGroupIndex, ...defaultRangeExtractor(range)]);\n return [...next].sort((a, b) => a - b);\n },\n [rowGroupIndexes]\n );\n\n return isTableGrouped ? rangeExtractor : undefined;\n}\n"],"names":["TABLE_SCROLL_PADDING_BOTTOM","TABLE_PADDING_BOTTOM","useTableRenderer","table","tableRef","defaultRowActiveIndex","tableMeta","options","meta","rows","getRowModel","HEADER_OFFSET_TOTAL","HEADER_ROW_HEIGHT_ESTIMATE","getHeaderGroups","length","createRowMeasurer","estimateSize","useRowHeightVirtualisation","rangeExtractor","useRowGroupVirtualisation","virtualiser","useVirtualizer","count","getScrollElement","current","overscan","printing","isPrinting","undefined","scrollPaddingStart","_table$getState$group","getState","grouping","scrollPaddingEnd","paddingEnd","virtualItems","getVirtualItems","scrollToIndex","React","useCallback","index","align","behavior","notSmooth","scrollToOffset","setTimeout","paddingTop","paddingBottom","Math","max","_virtualItems$","start","scrollMargin","size","getTotalSize","end","useEffect","style","content","height","map","virtualRow","row","measureRow","resizeItem","Row","key","id","expandedState","expanded","expandedRowHeightsCache","setExpandedRowHeightsCache","useState","averageExpandedRowHeight","useMemo","values","Object","reduce","a","b","rowHeight","ROW_HEIGHT_ESTIMATES","medium","_rows$index","_rows$index$getIsExpa","getIsExpanded","call","expansionHeight","cache","isTableGrouped","rowGroupIndexes","indexes","forEach","getIsGrouped","push","range","activeRowGroupIndex","_reverse$find","reverse","find","startIndex","next","Set","defaultRangeExtractor","sort"],"mappings":";;;;;AAYA,MAAMA,2BAA2B,GAAG,EAAE;AACtC,MAAMC,oBAAoB,GAAG,GAAG;SAEhBC,gBAAgBA,CAC5BC,KAAwB,EACxBC,QAAmC,EACnCC,qBAA0C;;EAE1C,MAAMC,SAAS,GAAGH,KAAK,CAACI,OAAO,CAACC,IAA6B;EAC7D,MAAMC,IAAI,GAAGN,KAAK,CAACO,WAAW,EAAE,CAACD,IAAI;E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;IAClC,MAAMiB,OAAO,GAAa,EAAE;IAE5B,IAAIF,cAAc,EAAE;MAChBhF,IAAI,CAACmF,OAAO,CAAC,CAAC9B,GAAG,EAAEtB,KAAK;QACpB,IAAIsB,GAAG,CAAC+B,YAAY,EAAE,EAAE;UACpBF,OAAO,CAACG,IAAI,CAACtD,KAAK,CAAC;;OAE1B,CAAC;;IAGN,OAAOmD,OAAO;GACjB,EAAE,EAAE,CAAC;;EAGN,MAAMzE,cAAc,GAAGoB,cAAK,CAACC,WAAW,CACpCwD,KAAK;;IACD,MAAMC,mBAAmB,IAAAC,aAAA,GACrB,CAAC,GAAGP,eAAe,CAAC,CAACQ,OAAO,EAAE,CAACC,IAAI,CAAC3D,KAAK,IAAIuD,KAAK,CAACK,UAAU,IAAI5D,KAAK,CAAC,cAAAyD,aAAA,cAAAA,aAAA,GAAIP,eAAe,CAAC,CAAC,CAAC;IAEjG,MAAMW,IAAI,GAAG,IAAIC,GAAG,CAAC,CAACN,mBAAmB,EAAE,GAAGO,qBAAqB,CAACR,KAAK,CAAC,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAGM,IAAI,CAAC,CAACG,IAAI,CAAC,CAAC1B,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;GACzC,EACD,CAACW,eAAe,CAAC,CACpB;EAED,OAAOD,cAAc,GAAGvE,cAAc,GAAGU,SAAS;AACtD;;;;"}
|
@@ -1,154 +0,0 @@
|
|
1
|
-
import React__default, { Fragment } from 'react';
|
2
|
-
import { Alert } from '../../../Alert/Alert.js';
|
3
|
-
import { useLocalization } from '../../../Provider/Localization.js';
|
4
|
-
import { Button } from '../../../Button/Button.js';
|
5
|
-
import { Dialog } from '../../../Dialog/Dialog.js';
|
6
|
-
import { Group } from '../../../Group/Group.js';
|
7
|
-
import { focusableSelector } from '../../util/editing.js';
|
8
|
-
import { lastCellIndex } from '../rows/Row.js';
|
9
|
-
|
10
|
-
function ErrorAlert(props) {
|
11
|
-
var _column$columnDef$met;
|
12
|
-
const {
|
13
|
-
table,
|
14
|
-
tableRef,
|
15
|
-
scrollToIndex,
|
16
|
-
rowIdentifier
|
17
|
-
} = props;
|
18
|
-
const tableMeta = table.options.meta;
|
19
|
-
const errors = tableMeta.validation.errors;
|
20
|
-
const errorsRowIds = errors ? Object.keys(errors) : [];
|
21
|
-
const rows = table.getRowModel().rows;
|
22
|
-
const coreRows = table.getCoreRowModel().rows;
|
23
|
-
const {
|
24
|
-
texts
|
25
|
-
} = useLocalization();
|
26
|
-
const [resetFiltersConfirmationOpen, setResetFiltersConfirmationOpen] = React__default.useState(false);
|
27
|
-
const [internalRowId, setInternalRowId] = React__default.useState(null);
|
28
|
-
const [internalRowIndex, setInternalRowIndex] = React__default.useState(null);
|
29
|
-
const [isFiltersReset, setIsFiltersReset] = React__default.useState(false);
|
30
|
-
const columns = table.getAllFlatColumns();
|
31
|
-
const column = columns.find(column => column.id === rowIdentifier);
|
32
|
-
const rowIdentifierHeader = column === null || column === void 0 ? void 0 : (_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.header;
|
33
|
-
// Find and focus first invalid cell
|
34
|
-
const navigateToFirstInvalidCell = () => {
|
35
|
-
var _tableRef$current;
|
36
|
-
const firstInvalidCell = (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.querySelector('[role="row"][data-current="true"] [role="cell"][data-invalid="true"]');
|
37
|
-
const firstInvalidElement = firstInvalidCell === null || firstInvalidCell === void 0 ? void 0 : firstInvalidCell.querySelector(focusableSelector);
|
38
|
-
if (firstInvalidElement) {
|
39
|
-
firstInvalidElement === null || firstInvalidElement === void 0 ? void 0 : firstInvalidElement.focus();
|
40
|
-
lastCellIndex.value = firstInvalidCell === null || firstInvalidCell === void 0 ? void 0 : firstInvalidCell.getAttribute('data-column-index');
|
41
|
-
}
|
42
|
-
};
|
43
|
-
// Navigate to row and focus first invalid cell
|
44
|
-
const navigateToRow = rowIndex => {
|
45
|
-
tableMeta.rowActive.setRowActiveIndex(rowIndex);
|
46
|
-
scrollToIndex(rowIndex, {
|
47
|
-
align: 'center'
|
48
|
-
});
|
49
|
-
lastCellIndex.value = undefined;
|
50
|
-
// Need to request animation frame here, because newly selected row is not rendered yet.
|
51
|
-
requestAnimationFrame(() => {
|
52
|
-
navigateToFirstInvalidCell();
|
53
|
-
});
|
54
|
-
};
|
55
|
-
// When internal row index is changed after click on row link, we should navigate to the row.
|
56
|
-
React__default.useEffect(() => {
|
57
|
-
if (internalRowIndex !== null && internalRowIndex >= 0) {
|
58
|
-
navigateToRow(internalRowIndex);
|
59
|
-
}
|
60
|
-
}, [internalRowIndex]);
|
61
|
-
// When filters are reset, we're able to get the real row index by rowId
|
62
|
-
React__default.useEffect(() => {
|
63
|
-
if (isFiltersReset) {
|
64
|
-
const rowIndex = rows.findIndex(row => row.id === internalRowId);
|
65
|
-
if (rowIndex === -1) {
|
66
|
-
return;
|
67
|
-
}
|
68
|
-
setInternalRowIndex(rowIndex);
|
69
|
-
}
|
70
|
-
}, [isFiltersReset]);
|
71
|
-
const onRowNumberClick = React__default.useCallback(rowId => {
|
72
|
-
// When row is hidden due filtering it will not be present in rows (but it still will be present in coreRows)
|
73
|
-
const foundIndex = rows.findIndex(row => row.id === rowId);
|
74
|
-
if (foundIndex === -1) {
|
75
|
-
setIsFiltersReset(false);
|
76
|
-
setResetFiltersConfirmationOpen(true);
|
77
|
-
// Since row indexes changed due filtering, we need to save row id, so that we can find it when filters will be reset
|
78
|
-
setInternalRowId(rowId);
|
79
|
-
return;
|
80
|
-
}
|
81
|
-
// In cases when user clicked on a row link multiple times we still need to navigate to the row, and focus the cell,
|
82
|
-
// because row/cell will loose focus on next click, but row index will not change.
|
83
|
-
if (foundIndex === internalRowIndex) {
|
84
|
-
navigateToRow(foundIndex);
|
85
|
-
} else {
|
86
|
-
setInternalRowIndex(foundIndex);
|
87
|
-
}
|
88
|
-
}, [rows, internalRowIndex]);
|
89
|
-
const onResetFiltersConfirm = () => {
|
90
|
-
setIsFiltersReset(true);
|
91
|
-
};
|
92
|
-
// Getting the row from core rows (ignoring search and filtering)
|
93
|
-
const getCoreRow = React__default.useCallback(rowId => coreRows.find(coreRow => coreRow.id === rowId), [coreRows]);
|
94
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
95
|
-
className: "mb-4 empty:hidden"
|
96
|
-
}, errorsRowIds.length ? ( /*#__PURE__*/React__default.createElement(Alert, {
|
97
|
-
state: "error",
|
98
|
-
className: "mb-1"
|
99
|
-
}, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("b", null, errorsRowIds.length, " ", texts.table3.validation.alert.unsavedEntries(errorsRowIds.length)), ' '), rowIdentifierHeader || texts.table3.validation.index, ' ', errorsRowIds.map((rowId, index) => {
|
100
|
-
const coreRow = getCoreRow(rowId);
|
101
|
-
return /*#__PURE__*/React__default.createElement(Fragment, {
|
102
|
-
key: `${rowId}`
|
103
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
104
|
-
className: "!min-h-[theme(spacing.2)] !min-w-[theme(spacing.2)] !px-1",
|
105
|
-
appearance: "discrete",
|
106
|
-
onClick: () => {
|
107
|
-
onRowNumberClick(rowId);
|
108
|
-
}
|
109
|
-
}, rowIdentifier ? coreRow === null || coreRow === void 0 ? void 0 : coreRow.original[rowIdentifier] : coreRow === null || coreRow === void 0 ? void 0 : coreRow.index), /*#__PURE__*/React__default.createElement("span", null, index < errorsRowIds.length - 1 ? ',' : ''));
|
110
|
-
}), texts.table3.validation.alert.incompleteAndHavntBeenSaved(errorsRowIds.length))) : null, /*#__PURE__*/React__default.createElement(FilterResetDialog, {
|
111
|
-
open: resetFiltersConfirmationOpen,
|
112
|
-
onClose: () => {
|
113
|
-
setResetFiltersConfirmationOpen(false);
|
114
|
-
},
|
115
|
-
onConfirm: onResetFiltersConfirm,
|
116
|
-
table: table
|
117
|
-
}));
|
118
|
-
}
|
119
|
-
function FilterResetDialog(props) {
|
120
|
-
const {
|
121
|
-
open,
|
122
|
-
onClose,
|
123
|
-
onConfirm,
|
124
|
-
table
|
125
|
-
} = props;
|
126
|
-
const tableMeta = table.options.meta;
|
127
|
-
const {
|
128
|
-
texts
|
129
|
-
} = useLocalization();
|
130
|
-
const resetFilters = React__default.useCallback(() => {
|
131
|
-
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
132
|
-
tableMeta.search.setQuery('');
|
133
|
-
table.resetGlobalFilter();
|
134
|
-
table.resetColumnFilters();
|
135
|
-
}, [table, tableMeta.search]);
|
136
|
-
const handleConfirmClick = () => {
|
137
|
-
resetFilters();
|
138
|
-
onConfirm();
|
139
|
-
onClose();
|
140
|
-
};
|
141
|
-
return /*#__PURE__*/React__default.createElement(Dialog, {
|
142
|
-
open: open,
|
143
|
-
onClose: onClose,
|
144
|
-
size: "xs"
|
145
|
-
}, /*#__PURE__*/React__default.createElement(Dialog.Content, {
|
146
|
-
"aria-label": "Create a new account"
|
147
|
-
}, /*#__PURE__*/React__default.createElement(Dialog.Title, null, texts.table3.validation.resetFiltersDialog.title), /*#__PURE__*/React__default.createElement("p", null, texts.table3.validation.resetFiltersDialog.description), /*#__PURE__*/React__default.createElement(Dialog.Footer, null, /*#__PURE__*/React__default.createElement(Group, null, /*#__PURE__*/React__default.createElement(Dialog.Close, null, /*#__PURE__*/React__default.createElement(Button, null, texts.table3.validation.resetFiltersDialog.cancel)), /*#__PURE__*/React__default.createElement(Button, {
|
148
|
-
appearance: "primary",
|
149
|
-
onClick: handleConfirmClick
|
150
|
-
}, texts.table3.validation.resetFiltersDialog.confirm)))));
|
151
|
-
}
|
152
|
-
|
153
|
-
export { ErrorAlert };
|
154
|
-
//# sourceMappingURL=ErrorAlert.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ErrorAlert.js","sources":["../../../../../../../../../src/components/Table3/components/alert/ErrorAlert.tsx"],"sourcesContent":["import { Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { TableStrategy } from '../../types';\nimport React, { Fragment } from 'react';\nimport { Alert } from '../../../Alert/Alert';\nimport { Button } from '../../../Button/Button';\nimport { useLocalization } from '../../../Provider/Localization';\nimport { focusableSelector } from '../../util/editing';\nimport { lastCellIndex } from '../rows/Row';\nimport { Dialog } from '../../../Dialog/Dialog';\nimport { Group } from '../../../Group/Group';\n\nexport type ErrorAlertProps<TType = unknown> = {\n table: RTable<TType>;\n tableRef: React.RefObject<HTMLDivElement>;\n scrollToIndex: TableStrategy['scrollToIndex'];\n rowIdentifier?: string;\n};\n\nexport function ErrorAlert<TType = unknown>(props: ErrorAlertProps<TType>) {\n const { table, tableRef, scrollToIndex, rowIdentifier } = props;\n const tableMeta = table.options.meta as TableMeta<TType>;\n const errors = tableMeta.validation.errors;\n const errorsRowIds = errors ? Object.keys(errors) : [];\n const rows = table.getRowModel().rows;\n const coreRows = table.getCoreRowModel().rows;\n const { texts } = useLocalization();\n const [resetFiltersConfirmationOpen, setResetFiltersConfirmationOpen] = React.useState(false);\n const [internalRowId, setInternalRowId] = React.useState<string | null>(null);\n const [internalRowIndex, setInternalRowIndex] = React.useState<number | null>(null);\n const [isFiltersReset, setIsFiltersReset] = React.useState(false);\n const columns = table.getAllFlatColumns();\n const column = columns.find(column => column.id === rowIdentifier);\n const rowIdentifierHeader = column?.columnDef.meta?.header;\n\n // Find and focus first invalid cell\n const navigateToFirstInvalidCell = () => {\n const firstInvalidCell = tableRef.current?.querySelector(\n '[role=\"row\"][data-current=\"true\"] [role=\"cell\"][data-invalid=\"true\"]'\n );\n const firstInvalidElement = firstInvalidCell?.querySelector(focusableSelector);\n\n if (firstInvalidElement) {\n (firstInvalidElement as HTMLElement)?.focus();\n lastCellIndex.value = firstInvalidCell?.getAttribute('data-column-index');\n }\n };\n\n // Navigate to row and focus first invalid cell\n const navigateToRow = rowIndex => {\n tableMeta.rowActive.setRowActiveIndex(rowIndex);\n scrollToIndex(rowIndex, { align: 'center' });\n lastCellIndex.value = undefined;\n\n // Need to request animation frame here, because newly selected row is not rendered yet.\n requestAnimationFrame(() => {\n navigateToFirstInvalidCell();\n });\n };\n\n // When internal row index is changed after click on row link, we should navigate to the row.\n React.useEffect(() => {\n if (internalRowIndex !== null && internalRowIndex >= 0) {\n navigateToRow(internalRowIndex);\n }\n }, [internalRowIndex]);\n\n // When filters are reset, we're able to get the real row index by rowId\n React.useEffect(() => {\n if (isFiltersReset) {\n const rowIndex = rows.findIndex(row => row.id === internalRowId);\n if (rowIndex === -1) {\n return;\n }\n setInternalRowIndex(rowIndex);\n }\n }, [isFiltersReset]);\n\n const onRowNumberClick = React.useCallback(\n (rowId: string) => {\n // When row is hidden due filtering it will not be present in rows (but it still will be present in coreRows)\n const foundIndex = rows.findIndex(row => row.id === rowId);\n if (foundIndex === -1) {\n setIsFiltersReset(false);\n setResetFiltersConfirmationOpen(true);\n\n // Since row indexes changed due filtering, we need to save row id, so that we can find it when filters will be reset\n setInternalRowId(rowId);\n return;\n }\n\n // In cases when user clicked on a row link multiple times we still need to navigate to the row, and focus the cell,\n // because row/cell will loose focus on next click, but row index will not change.\n if (foundIndex === internalRowIndex) {\n navigateToRow(foundIndex);\n } else {\n setInternalRowIndex(foundIndex);\n }\n },\n [rows, internalRowIndex]\n );\n\n const onResetFiltersConfirm = () => {\n setIsFiltersReset(true);\n };\n\n // Getting the row from core rows (ignoring search and filtering)\n const getCoreRow = React.useCallback((rowId: string) => coreRows.find(coreRow => coreRow.id === rowId), [coreRows]);\n\n return (\n <div className=\"mb-4 empty:hidden\">\n {errorsRowIds.length ? (\n <Alert state=\"error\" className=\"mb-1\">\n <>\n <b>\n {errorsRowIds.length} {texts.table3.validation.alert.unsavedEntries(errorsRowIds.length)}\n </b>{' '}\n </>\n {rowIdentifierHeader || texts.table3.validation.index}{' '}\n {errorsRowIds.map((rowId: string, index) => {\n const coreRow = getCoreRow(rowId);\n return (\n <Fragment key={`${rowId}`}>\n <Button\n className=\"!min-h-[theme(spacing.2)] !min-w-[theme(spacing.2)] !px-1\"\n appearance=\"discrete\"\n onClick={() => {\n onRowNumberClick(rowId);\n }}>\n {/* Getting row from core rows, because 'table.getRow' will fail if row is hidden due filtering */}\n {rowIdentifier ? coreRow?.original[rowIdentifier] : coreRow?.index}\n </Button>\n <span>{index < errorsRowIds.length - 1 ? ',' : ''}</span>\n </Fragment>\n );\n })}\n {texts.table3.validation.alert.incompleteAndHavntBeenSaved(errorsRowIds.length)}\n </Alert>\n ) : null}\n <FilterResetDialog\n open={resetFiltersConfirmationOpen}\n onClose={() => {\n setResetFiltersConfirmationOpen(false);\n }}\n onConfirm={onResetFiltersConfirm}\n table={table}\n />\n </div>\n );\n}\n\ntype FilterResetDialogProps<TType = unknown> = {\n open: boolean;\n onClose: () => void;\n onConfirm: () => void;\n table: RTable<TType>;\n};\nfunction FilterResetDialog<TType = unknown>(props: FilterResetDialogProps<TType>) {\n const { open, onClose, onConfirm, table } = props;\n const tableMeta = table.options.meta as TableMeta<TType>;\n const { texts } = useLocalization();\n\n const resetFilters = React.useCallback(() => {\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n tableMeta.search.setQuery('');\n table.resetGlobalFilter();\n table.resetColumnFilters();\n }, [table, tableMeta.search]);\n\n const handleConfirmClick = () => {\n resetFilters();\n onConfirm();\n onClose();\n };\n\n return (\n <Dialog open={open} onClose={onClose} size=\"xs\">\n <Dialog.Content aria-label=\"Create a new account\">\n <Dialog.Title>{texts.table3.validation.resetFiltersDialog.title}</Dialog.Title>\n\n <p>{texts.table3.validation.resetFiltersDialog.description}</p>\n\n <Dialog.Footer>\n <Group>\n <Dialog.Close>\n <Button>{texts.table3.validation.resetFiltersDialog.cancel}</Button>\n </Dialog.Close>\n <Button appearance=\"primary\" onClick={handleConfirmClick}>\n {texts.table3.validation.resetFiltersDialog.confirm}\n </Button>\n </Group>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n );\n}\n"],"names":["ErrorAlert","props","table","tableRef","scrollToIndex","rowIdentifier","tableMeta","options","meta","errors","validation","errorsRowIds","Object","keys","rows","getRowModel","coreRows","getCoreRowModel","texts","useLocalization","resetFiltersConfirmationOpen","setResetFiltersConfirmationOpen","React","useState","internalRowId","setInternalRowId","internalRowIndex","setInternalRowIndex","isFiltersReset","setIsFiltersReset","columns","getAllFlatColumns","column","find","id","rowIdentifierHeader","_column$columnDef$met","columnDef","header","navigateToFirstInvalidCell","firstInvalidCell","_tableRef$current","current","querySelector","firstInvalidElement","focusableSelector","focus","lastCellIndex","value","getAttribute","navigateToRow","rowIndex","rowActive","setRowActiveIndex","align","undefined","requestAnimationFrame","useEffect","findIndex","row","onRowNumberClick","useCallback","rowId","foundIndex","onResetFiltersConfirm","getCoreRow","coreRow","className","length","Alert","state","table3","alert","unsavedEntries","index","map","Fragment","key","Button","appearance","onClick","original","incompleteAndHavntBeenSaved","FilterResetDialog","open","onClose","onConfirm","resetFilters","search","setQuery","resetGlobalFilter","resetColumnFilters","handleConfirmClick","Dialog","size","Content","Title","resetFiltersDialog","title","description","Footer","Group","Close","cancel","confirm"],"mappings":";;;;;;;;;SAkBgBA,UAAUA,CAAkBC,KAA6B;;EACrE,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,aAAa;IAAEC;GAAe,GAAGJ,KAAK;EAC/D,MAAMK,SAAS,GAAGJ,KAAK,CAACK,OAAO,CAACC,IAAwB;EACxD,MAAMC,MAAM,GAAGH,SAAS,CAACI,UAAU,CAACD,MAAM;EAC1C,MAAME,YAAY,GAAGF,MAAM,GAAGG,MAAM,CAACC,IAAI,CAACJ,MAAM,CAAC,GAAG,EAAE;EACtD,MAAMK,IAAI,GAAGZ,KAAK,CAACa,WAAW,EAAE,CAACD,IAAI;EACrC,MAAME,QAAQ,GAAGd,KAAK,CAACe,eAAe,EAAE,CAACH,IAAI;EAC7C,MAAM;IAAEI;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAM,CAACC,4BAA4B,EAAEC,+BAA+B,CAAC,GAAGC,cAAK,C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AC7D,UAAU,CAACuF,kBAAkB,CAACM,MAAM,CAAU,CACzD,eACfjF,6BAACwD,MAAM;IAACC,UAAU,EAAC,SAAS;IAACC,OAAO,EAAEY;KACjC1E,KAAK,CAACqD,MAAM,CAAC7D,UAAU,CAACuF,kBAAkB,CAACO,OAAO,CAC9C,CACL,CACI,CACH,CACZ;AAEjB;;;;"}
|
@@ -1,84 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import { useRowContext } from '../../rows/RowContext.js';
|
3
|
-
import { DisplayCell } from './DisplayCell.js';
|
4
|
-
import { isIndicatorVisible, getIndicatorCellClassName } from './Indicator.js';
|
5
|
-
import { isCellHighlighted } from '../../../util/columns.js';
|
6
|
-
import { EditingCell } from './EditingCell.js';
|
7
|
-
|
8
|
-
function Cell(props) {
|
9
|
-
var _rows$rowActiveIndex;
|
10
|
-
const {
|
11
|
-
column,
|
12
|
-
row,
|
13
|
-
table,
|
14
|
-
index,
|
15
|
-
getValue,
|
16
|
-
cell
|
17
|
-
} = props;
|
18
|
-
const {
|
19
|
-
isHovered: isHoveredRow,
|
20
|
-
hasError,
|
21
|
-
rowIndex
|
22
|
-
} = useRowContext();
|
23
|
-
const rows = table.getRowModel().rows;
|
24
|
-
const tableMeta = table.options.meta;
|
25
|
-
const columnMeta = column.columnDef.meta;
|
26
|
-
const rowErrors = tableMeta.validation.errors ? tableMeta.validation.errors[row.id] : null;
|
27
|
-
const isColumnError = hasError && rowErrors && !!rowErrors[column.id];
|
28
|
-
const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;
|
29
|
-
const isActiveRow = rowActiveIndex !== undefined && ((_rows$rowActiveIndex = rows[rowActiveIndex]) === null || _rows$rowActiveIndex === void 0 ? void 0 : _rows$rowActiveIndex.id) === row.id;
|
30
|
-
let value = getValue();
|
31
|
-
const allVisibleColumns = table.getVisibleLeafColumns();
|
32
|
-
const lastColumnIndex = allVisibleColumns.length > 0 ? allVisibleColumns.length - 1 : 0;
|
33
|
-
const className = isIndicatorVisible(rowIndex, rowActiveIndex, tableMeta.editing.rowMoveReason) ? getIndicatorCellClassName(index, lastColumnIndex) : undefined;
|
34
|
-
// When row has changes we always need to show the editing state value, end revert it to original value only when row got saved successfully.
|
35
|
-
// Otherwise it might confuse user because it will look like display value is getting reverted everytime user leaves the row.
|
36
|
-
if (tableMeta.editing.isEditing) {
|
37
|
-
const editingValue = tableMeta.editing.getCellValue(cell);
|
38
|
-
value = editingValue !== null && editingValue !== void 0 ? editingValue : value;
|
39
|
-
}
|
40
|
-
const memoedHighlight = React__default.useMemo(() => {
|
41
|
-
var _tableMeta$search$que;
|
42
|
-
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
43
|
-
if (!tableMeta.search.isHighlightingEnabled || !columnMeta.enableSearch) {
|
44
|
-
return false;
|
45
|
-
}
|
46
|
-
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
47
|
-
if ((_tableMeta$search$que = tableMeta.search.query) !== null && _tableMeta$search$que !== void 0 && _tableMeta$search$que.length) {
|
48
|
-
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
49
|
-
return isCellHighlighted(tableMeta.search.query, value, columnMeta.dataType);
|
50
|
-
}
|
51
|
-
return false;
|
52
|
-
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
53
|
-
}, [value, tableMeta.search.isHighlightingEnabled, tableMeta.search.excludeUnmatchedResults, tableMeta.search.query]);
|
54
|
-
const memoedHighlightCurrent = React__default.useMemo(() => {
|
55
|
-
if (
|
56
|
-
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
57
|
-
!tableMeta.search.isHighlightingEnabled || !memoedHighlight || tableMeta.search.currentHighlightColumnIndex === undefined) {
|
58
|
-
return false;
|
59
|
-
}
|
60
|
-
const [rowActiveIndex, currentColumnIndex] = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex];
|
61
|
-
if (rowActiveIndex === rowIndex && currentColumnIndex === index) {
|
62
|
-
return true;
|
63
|
-
}
|
64
|
-
return false;
|
65
|
-
}, [memoedHighlight, tableMeta.search.highlightedColumnIndexes.length, tableMeta.search.currentHighlightColumnIndex]);
|
66
|
-
const highlightProps = {
|
67
|
-
highlighted: memoedHighlight,
|
68
|
-
highlightedAsCurrent: memoedHighlightCurrent
|
69
|
-
};
|
70
|
-
if (tableMeta.editing.isEditing && columnMeta.control && (isActiveRow || isHoveredRow && !tableMeta.rowActive.isHoverStatePaused ||
|
71
|
-
// When cell has error, we renderimg it in edit mode (UX reqirement)
|
72
|
-
isColumnError)) {
|
73
|
-
return /*#__PURE__*/React__default.createElement(EditingCell, Object.assign({}, props, highlightProps, {
|
74
|
-
className: className
|
75
|
-
}));
|
76
|
-
}
|
77
|
-
return /*#__PURE__*/React__default.createElement(DisplayCell, Object.assign({}, props, highlightProps, {
|
78
|
-
value: value,
|
79
|
-
className: className
|
80
|
-
}));
|
81
|
-
}
|
82
|
-
|
83
|
-
export { Cell };
|
84
|
-
//# sourceMappingURL=Cell.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Cell.js","sources":["../../../../../../../../../../src/components/Table3/components/columns/cell/Cell.tsx"],"sourcesContent":["import React from 'react';\nimport { CellContext, ColumnMeta, TableMeta } from '@tanstack/react-table';\nimport { DisplayCell } from './DisplayCell';\nimport { EditingCell } from './EditingCell';\nimport { useRowContext } from '../../rows/RowContext';\nimport { isCellHighlighted } from '../../../util/columns';\nimport { getIndicatorCellClassName, isIndicatorVisible } from './Indicator';\n\nexport type CellProps<TType = unknown> = CellContext<TType, unknown> & {\n children?: string | JSX.Element;\n};\n\nexport function Cell<TType = unknown>(props: CellProps<TType>) {\n const { column, row, table, index, getValue, cell } = props;\n const { isHovered: isHoveredRow, hasError, rowIndex } = useRowContext();\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as TableMeta<unknown>;\n const columnMeta = column.columnDef.meta as ColumnMeta<TType, unknown>;\n const rowErrors = tableMeta.validation.errors ? tableMeta.validation.errors[row.id] : null;\n const isColumnError = hasError && rowErrors && !!rowErrors[column.id];\n\n const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;\n const isActiveRow = rowActiveIndex !== undefined && rows[rowActiveIndex]?.id === row.id;\n let value = getValue();\n\n const allVisibleColumns = table.getVisibleLeafColumns();\n const lastColumnIndex = allVisibleColumns.length > 0 ? allVisibleColumns.length - 1 : 0;\n const className = isIndicatorVisible(rowIndex, rowActiveIndex, tableMeta.editing.rowMoveReason)\n ? getIndicatorCellClassName(index, lastColumnIndex)\n : undefined;\n\n // When row has changes we always need to show the editing state value, end revert it to original value only when row got saved successfully.\n // Otherwise it might confuse user because it will look like display value is getting reverted everytime user leaves the row.\n if (tableMeta.editing.isEditing) {\n const editingValue = tableMeta.editing.getCellValue(cell);\n value = editingValue ?? value;\n }\n\n const memoedHighlight = React.useMemo(() => {\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n if (!tableMeta.search.isHighlightingEnabled || !columnMeta.enableSearch) {\n return false;\n }\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n if (tableMeta.search.query?.length) {\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n return isCellHighlighted(tableMeta.search.query, value, columnMeta.dataType);\n }\n\n return false;\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n }, [value, tableMeta.search.isHighlightingEnabled, tableMeta.search.excludeUnmatchedResults, tableMeta.search.query]);\n\n const memoedHighlightCurrent = React.useMemo(() => {\n if (\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n !tableMeta.search.isHighlightingEnabled ||\n !memoedHighlight ||\n tableMeta.search.currentHighlightColumnIndex === undefined\n ) {\n return false;\n }\n\n const [rowActiveIndex, currentColumnIndex] =\n tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex];\n\n if (rowActiveIndex === rowIndex && currentColumnIndex === index) {\n return true;\n }\n\n return false;\n }, [memoedHighlight, tableMeta.search.highlightedColumnIndexes.length, tableMeta.search.currentHighlightColumnIndex]);\n\n const highlightProps = {\n highlighted: memoedHighlight,\n highlightedAsCurrent: memoedHighlightCurrent,\n };\n\n if (\n tableMeta.editing.isEditing &&\n columnMeta.control &&\n (isActiveRow ||\n (isHoveredRow && !tableMeta.rowActive.isHoverStatePaused) ||\n // When cell has error, we renderimg it in edit mode (UX reqirement)\n isColumnError)\n ) {\n return <EditingCell {...props} {...highlightProps} className={className} />;\n }\n\n return <DisplayCell {...props} {...highlightProps} value={value} className={className} />;\n}\n"],"names":["Cell","props","column","row","table","index","getValue","cell","isHovered","isHoveredRow","hasError","rowIndex","useRowContext","rows","getRowModel","tableMeta","options","meta","columnMeta","columnDef","rowErrors","validation","errors","id","isColumnError","rowActiveIndex","rowActive","isActiveRow","undefined","_rows$rowActiveIndex","value","allVisibleColumns","getVisibleLeafColumns","lastColumnIndex","length","className","isIndicatorVisible","editing","rowMoveReason","getIndicatorCellClassName","isEditing","editingValue","getCellValue","memoedHighlight","React","useMemo","search","isHighlightingEnabled","enableSearch","_tableMeta$search$que","query","isCellHighlighted","dataType","excludeUnmatchedResults","memoedHighlightCurrent","currentHighlightColumnIndex","currentColumnIndex","highlightedColumnIndexes","highlightProps","highlighted","highlightedAsCurrent","control","isHoverStatePaused","EditingCell","DisplayCell"],"mappings":";;;;;;;SAYgBA,IAAIA,CAAkBC,KAAuB;;EACzD,MAAM;IAAEC,MAAM;IAAEC,GAAG;IAAEC,KAAK;IAAEC,KAAK;IAAEC,QAAQ;IAAEC;GAAM,GAAGN,KAAK;EAC3D,MAAM;IAAEO,SAAS,EAAEC,YAAY;IAAEC,QAAQ;IAAEC;GAAU,GAAGC,aAAa,EAAE;EACvE,MAAMC,IAAI,GAAGT,KAAK,CAACU,WAAW,EAAE,CAACD,IAAI;EACrC,MAAME,SAAS,GAAGX,KAAK,CAACY,OAAO,CAACC,IAA0B;EAC1D,MAAMC,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AY,IAAI,CAACM,SAAS,CAACW,SAAS,CAACoC,kBAAmB;;EAEzDtC,aAAa,CAAC,EACpB;IACE,oBAAOoB,6BAACmB,WAAW,oBAAK9D,KAAK,EAAMyD,cAAc;MAAEvB,SAAS,EAAEA;OAAa;;EAG/E,oBAAOS,6BAACoB,WAAW,oBAAK/D,KAAK,EAAMyD,cAAc;IAAE5B,KAAK,EAAEA,KAAK;IAAEK,SAAS,EAAEA;KAAa;AAC7F;;;;"}
|
@@ -1,84 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import cn from 'clsx';
|
3
|
-
import { Highlight } from './Highlight.js';
|
4
|
-
|
5
|
-
function DisplayCell(props) {
|
6
|
-
const {
|
7
|
-
cell,
|
8
|
-
className,
|
9
|
-
column,
|
10
|
-
value,
|
11
|
-
index,
|
12
|
-
row,
|
13
|
-
table,
|
14
|
-
tableRef,
|
15
|
-
highlighted,
|
16
|
-
highlightedAsCurrent
|
17
|
-
} = props;
|
18
|
-
const columnMeta = React__default.useMemo(() => column.columnDef.meta, []);
|
19
|
-
const tableMeta = table.options.meta;
|
20
|
-
// cells are heavily memoized because performance in our table is critical
|
21
|
-
// be careful and selective about props that you pass to the cell
|
22
|
-
const memoedProps = React__default.useMemo(() => {
|
23
|
-
var _ref, _ref2, _props$children, _columnMeta$renderer;
|
24
|
-
return {
|
25
|
-
align: columnMeta.align,
|
26
|
-
children: (_ref = (_ref2 = (_props$children = props.children) !== null && _props$children !== void 0 ? _props$children : (_columnMeta$renderer = columnMeta.renderer) === null || _columnMeta$renderer === void 0 ? void 0 : _columnMeta$renderer.call(columnMeta, value, row.original)) !== null && _ref2 !== void 0 ? _ref2 : value) !== null && _ref !== void 0 ? _ref : null,
|
27
|
-
className: cn(className, typeof columnMeta.className === 'function' ? columnMeta.className(row.original) : columnMeta.className),
|
28
|
-
data: row.original,
|
29
|
-
debug: table.options.debugAll,
|
30
|
-
enableTruncate: columnMeta.enableTruncate,
|
31
|
-
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
32
|
-
frozenColumnIndex: tableMeta.columnFreezing.frozenColumnIndex,
|
33
|
-
id: cell.id,
|
34
|
-
index,
|
35
|
-
tableRef
|
36
|
-
};
|
37
|
-
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
38
|
-
}, [row.original, props.children, value, tableMeta.columnFreezing.frozenColumnIndex, className]);
|
39
|
-
return /*#__PURE__*/React__default.createElement(MemoedDisplayCell, Object.assign({}, memoedProps, {
|
40
|
-
highlighted: highlighted,
|
41
|
-
highlightedAsCurrent: highlightedAsCurrent
|
42
|
-
}));
|
43
|
-
}
|
44
|
-
const MemoedDisplayCell = /*#__PURE__*/React__default.memo(function MemoedDisplayCell(props) {
|
45
|
-
const {
|
46
|
-
align = 'left',
|
47
|
-
children,
|
48
|
-
className: customClassName,
|
49
|
-
debug,
|
50
|
-
enableTruncate,
|
51
|
-
frozenColumnIndex,
|
52
|
-
highlighted,
|
53
|
-
highlightedAsCurrent = false,
|
54
|
-
id,
|
55
|
-
index,
|
56
|
-
tableRef
|
57
|
-
} = props;
|
58
|
-
const layoutClassName = cn('py-[var(--table3-cell-padding-y)] px-[var(--table3-cell-padding-x)] focus:outline-none break-word hyphens-auto', customClassName);
|
59
|
-
const className = highlighted ? undefined : layoutClassName;
|
60
|
-
const content = enableTruncate ? /*#__PURE__*/React__default.createElement("span", {
|
61
|
-
className: "truncate"
|
62
|
-
}, children) : children;
|
63
|
-
if (debug) {
|
64
|
-
console.log('cell render', id);
|
65
|
-
}
|
66
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
67
|
-
className: className,
|
68
|
-
"data-align": align,
|
69
|
-
"data-column-index": index,
|
70
|
-
"data-highlighted": highlighted,
|
71
|
-
role: "cell",
|
72
|
-
// cells must be focusable (but not included in tabbing - hence -1)
|
73
|
-
tabIndex: -1
|
74
|
-
}, highlighted ? ( /*#__PURE__*/React__default.createElement(Highlight, {
|
75
|
-
className: layoutClassName,
|
76
|
-
current: highlightedAsCurrent,
|
77
|
-
frozenColumnIndex: frozenColumnIndex,
|
78
|
-
index: index,
|
79
|
-
tableRef: tableRef
|
80
|
-
}, content)) : content);
|
81
|
-
});
|
82
|
-
|
83
|
-
export { DisplayCell };
|
84
|
-
//# sourceMappingURL=DisplayCell.js.map
|