@economic/taco 2.21.2 → 2.22.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Report/Report.d.ts +21 -0
- package/dist/components/Report/components/Cell/Cell.d.ts +0 -1
- package/dist/components/Report/components/Cell/DisplayCell.d.ts +1 -1
- package/dist/components/Report/components/Cell/util.d.ts +1 -1
- package/dist/components/Report/components/Row/DisplayRow.d.ts +2 -9
- package/dist/components/Report/components/Toolbar/components/Filters/components/Placeholder.d.ts +5 -5
- package/dist/components/Report/listeners/useTableRowActiveListener.d.ts +3 -0
- package/dist/components/Report/styles/util.d.ts +2 -2
- package/dist/components/Report/types.d.ts +1 -3
- package/dist/components/Report/useReport.d.ts +2 -7
- package/dist/components/Table3/types.d.ts +1 -1
- package/dist/esm/index.css +501 -9
- package/dist/esm/packages/taco/src/components/Card/Card.js +1 -1
- package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Group/Group.js +1 -1
- package/dist/esm/packages/taco/src/components/Group/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/Input.js +37 -7
- package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/util.js +3 -1
- package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/Report.js +70 -0
- package/dist/esm/packages/taco/src/components/Report/Report.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Body/Body.js +61 -0
- package/dist/esm/packages/taco/src/components/Report/components/Body/Body.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Body/util.js +22 -0
- package/dist/esm/packages/taco/src/components/Report/components/Body/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/Cell.js +32 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/Cell.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/DisplayCell.js +23 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/DisplayCell.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/GroupedCell.js +58 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/GroupedCell.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/util.js +69 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Footer.js +34 -0
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Footer.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Summary.js +39 -0
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Summary.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/Header.js +194 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/Header.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Goto.js +28 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Goto.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Menu.js +150 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Menu.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Resizer.js +60 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Resizer.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/SortIndicator.js +41 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/SortIndicator.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/util.js +24 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Actions.js +90 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Actions.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Expansion.js +59 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Expansion.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Selection.js +118 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Selection.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/DisplayRow.js +102 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/DisplayRow.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/Row.js +24 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/Row.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/RowContext.js +10 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/RowContext.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/SkeletonRow.js +62 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/SkeletonRow.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/Toolbar.js +63 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/Toolbar.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/Filters.js +50 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/Filters.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/ManageFiltersPopover.js +136 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Filter.js +95 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Filter.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterColumn.js +49 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterColumn.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterComparator.js +110 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterComparator.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterValue.js +118 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Placeholder.js +41 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Placeholder.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/util.js +7 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/Print.js +123 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/Print.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/PrintDialog.js +88 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/PrintDialog.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Search/Search.js +95 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Search/Search.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.js +105 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/Settings.js +103 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/Settings.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/listeners/useTableRowActiveListener.js +24 -0
- package/dist/esm/packages/taco/src/components/Report/listeners/useTableRowActiveListener.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useColumnPinningStylesheet.js +44 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useColumnPinningStylesheet.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useCssGridStylesheet.js +54 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useCssGridStylesheet.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useStylesheet.js +20 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useStylesheet.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/styles/util.js +61 -0
- package/dist/esm/packages/taco/src/components/Report/styles/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/useReport.js +51 -0
- package/dist/esm/packages/taco/src/components/Report/useReport.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/util/rows.js +10 -0
- package/dist/esm/packages/taco/src/components/Report/util/rows.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/util/useTableGlobalShortcuts.js +39 -0
- package/dist/esm/packages/taco/src/components/Report/util/useTableGlobalShortcuts.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/util/useTableRenderer.js +162 -0
- package/dist/esm/packages/taco/src/components/Report/util/useTableRenderer.js.map +1 -0
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +2 -1
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +2 -2
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +6 -7
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +7 -2
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js +6 -6
- package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js +7 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +2 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +6 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +3 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Summary.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Summary.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +9 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js +2 -0
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +3 -3
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +4 -8
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js +19 -14
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +6 -5
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js +18 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnFreezing.js +8 -14
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnFreezing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useEditing.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js +5 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +15 -15
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTablePreset.js +20 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTablePreset.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/util/columns.js +2 -0
- package/dist/esm/packages/taco/src/components/Table3/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js +1 -1
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js +1 -1
- package/dist/esm/packages/taco/src/index.js +7 -6
- package/dist/esm/packages/taco/src/index.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Button.js +2 -1
- package/dist/esm/packages/taco/src/primitives/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnFreezing.js +21 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnFreezing.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFooter.js +8 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFooter.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js +16 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRef.js +17 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRef.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActions.js +11 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActions.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowExpansion.js +9 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowExpansion.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGroups.js +9 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGroups.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSearch.js +38 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSearch.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSettings.js +28 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSettings.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableRowHeightListener.js +14 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableRowHeightListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSearchListener.js +15 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSearchListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSettingsListener.js +26 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSettingsListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/useTable.js +117 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/useTable.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js +30 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/filtering.js +131 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/filtering.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/presets.js +131 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/presets.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/search.js +43 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/search.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/settings.js +22 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/settings.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/setup.js +270 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/setup.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/sorting.js +18 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/sorting.js.map +1 -0
- package/dist/esm/packages/taco/src/utils/dom.js +5 -1
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/keyboard.js +3 -5
- package/dist/esm/packages/taco/src/utils/keyboard.js.map +1 -1
- package/dist/index.css +501 -9
- package/dist/index.d.ts +1 -0
- package/dist/primitives/Table/types.d.ts +2 -2
- package/dist/primitives/Table/useTable/features/useTablePrinting.d.ts +1 -1
- package/dist/primitives/Table/useTable/util/settings.d.ts +1 -1
- package/dist/primitives/Table/useTable/util/sorting.d.ts +1 -1
- package/dist/taco.cjs.development.js +6380 -2731
- 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 +1 -0
- package/dist/utils/keyboard.d.ts +0 -1
- package/package.json +2 -2
- package/types.json +4682 -4776
- package/dist/components/Report/features/useReportExport.d.ts +0 -3
@@ -60,6 +60,26 @@ const presets = {
|
|
60
60
|
enableFiltering: true,
|
61
61
|
enableSearch: true,
|
62
62
|
enableSorting: true
|
63
|
+
},
|
64
|
+
card: {
|
65
|
+
enableColumnFreezing: false,
|
66
|
+
enableColumnHiding: false,
|
67
|
+
enableColumnOrdering: false,
|
68
|
+
enableColumnResizing: false,
|
69
|
+
enableFontSize: false,
|
70
|
+
enableFooter: false,
|
71
|
+
enablePrinting: false,
|
72
|
+
enableRowDrag: false,
|
73
|
+
enableRowDrop: false,
|
74
|
+
enableRowExpansion: false,
|
75
|
+
enableRowGoto: false,
|
76
|
+
enableRowHeight: false,
|
77
|
+
enableRowSelection: false,
|
78
|
+
enableRowSelectionSingle: false,
|
79
|
+
enableEditing: false,
|
80
|
+
enableFiltering: false,
|
81
|
+
enableSearch: false,
|
82
|
+
enableSorting: true
|
63
83
|
}
|
64
84
|
};
|
65
85
|
function useTablePreset(props) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTablePreset.js","sources":["../../../../../../../../src/components/Table3/hooks/useTablePreset.ts"],"sourcesContent":["import React from 'react';\nimport { Table3Options, Table3Preset, Table3Props } from '../types';\n\nconst DEFAULT_ALL_DISABLED: Table3Options = {\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnOrdering: false,\n enableColumnResizing: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowExpansion: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n enableEditing: false,\n enableFiltering: false,\n enableSearch: false,\n enableSorting: false,\n};\n\nconst presets: Record<Table3Preset, Table3Options> = {\n display: {\n enableColumnFreezing: true,\n enableColumnHiding: true,\n enableColumnOrdering: true,\n enableColumnResizing: true,\n enableFontSize: true,\n enableFooter: true,\n enablePrinting: false,\n enableRowDrag: true,\n enableRowDrop: true,\n enableRowExpansion: true,\n enableRowGoto: true,\n enableRowHeight: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n enableEditing: false,\n enableFiltering: true,\n enableSearch: true,\n enableSorting: true,\n },\n editable: {\n enableColumnFreezing: true,\n enableColumnHiding: true,\n enableColumnOrdering: true,\n enableColumnResizing: true,\n enableFontSize: true,\n enableFooter: true,\n enablePrinting: false,\n enableRowDrag: true,\n enableRowDrop: true,\n enableRowExpansion: true,\n enableRowGoto: true,\n enableRowHeight: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n enableEditing: true,\n enableFiltering: true,\n enableSearch: true,\n enableSorting: true,\n },\n};\n\nexport function useTablePreset<TType = unknown>(props: Table3Props<TType>): Table3Options {\n const presetOptions = props.preset ? presets[props.preset] : DEFAULT_ALL_DISABLED;\n\n const enableRowExpansion = props.enableRowExpansion ?? presetOptions.enableRowExpansion;\n const enableRowSelection = props.enableRowSelection ?? presetOptions.enableRowSelection;\n\n // guard options that might be unintentionally broken\n React.useEffect(() => {\n if (enableRowExpansion && !props.expandedRowRenderer) {\n console.warn(\n `Table3 (id: ${props.id}) - Row expansion is enabled but no \\`expandedRowRenderer\\` has been provided. Provide one to enable row expansion or set \\`enableRowExpansion\\` to \\`false\\`.`\n );\n }\n\n if (enableRowSelection && !props.onRowSelect) {\n console.warn(\n `Table3 (id: ${props.id}) - Row selection is enabled but no \\`onRowSelect\\` handler has been provided. Provide one to enable row selection or set \\`enableRowSelection\\` to \\`false\\`.`\n );\n }\n }, []);\n\n return {\n enableColumnFreezing: props.enableColumnFreezing ?? presetOptions.enableColumnFreezing,\n enableColumnHiding: props.enableColumnHiding ?? presetOptions.enableColumnHiding,\n enableColumnOrdering: props.enableColumnOrdering ?? presetOptions.enableColumnOrdering,\n enableColumnResizing: props.enableColumnResizing ?? presetOptions.enableColumnResizing,\n enableFontSize: props.enableFontSize ?? presetOptions.enableFontSize,\n enableFooter: props.enableFooter ?? presetOptions.enableFooter,\n enablePrinting: props.enablePrinting ?? presetOptions.enablePrinting,\n enableRowDrag: (props.enableRowDrag ?? presetOptions.enableRowDrag) && !!props.onRowDrag,\n enableRowDrop: (props.enableRowDrop ?? presetOptions.enableRowDrop) && !!props.onRowDrop,\n enableRowExpansion: enableRowExpansion && !!props.expandedRowRenderer,\n enableRowGoto: (props.enableRowGoto ?? presetOptions.enableRowGoto) && !!props.onRowGoto,\n enableRowHeight: props.enableRowHeight ?? presetOptions.enableRowHeight,\n enableRowSelection: enableRowSelection && !!props.onRowSelect,\n enableRowSelectionSingle:\n (props.enableRowSelectionSingle ?? presetOptions.enableRowSelectionSingle) &&\n enableRowSelection &&\n !!props.onRowSelect,\n enableEditing: props.enableEditing ?? presetOptions.enableEditing,\n enableFiltering: props.enableFiltering ?? presetOptions.enableFiltering,\n enableSearch: props.enableSearch ?? presetOptions.enableSearch,\n enableSorting: props.enableSorting ?? presetOptions.enableSorting,\n };\n}\n"],"names":["DEFAULT_ALL_DISABLED","enableColumnFreezing","enableColumnHiding","enableColumnOrdering","enableColumnResizing","enableFontSize","enableFooter","enablePrinting","enableRowDrag","enableRowDrop","enableRowExpansion","enableRowGoto","enableRowHeight","enableRowSelection","enableRowSelectionSingle","enableEditing","enableFiltering","enableSearch","enableSorting","presets","display","editable","useTablePreset","props","presetOptions","preset","_props$enableRowExpan","_props$enableRowSelec","React","useEffect","expandedRowRenderer","console","warn","id","onRowSelect","_props$enableColumnFr","_props$enableColumnHi","_props$enableColumnOr","_props$enableColumnRe","_props$enableFontSize","_props$enableFooter","_props$enablePrinting","_props$enableRowDrag","onRowDrag","_props$enableRowDrop","onRowDrop","_props$enableRowGoto","onRowGoto","_props$enableRowHeigh","_props$enableRowSelec2","_props$enableEditing","_props$enableFilterin","_props$enableSearch","_props$enableSorting"],"mappings":"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"}
|
1
|
+
{"version":3,"file":"useTablePreset.js","sources":["../../../../../../../../src/components/Table3/hooks/useTablePreset.ts"],"sourcesContent":["import React from 'react';\nimport { Table3Options, Table3Preset, Table3Props } from '../types';\n\nconst DEFAULT_ALL_DISABLED: Table3Options = {\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnOrdering: false,\n enableColumnResizing: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowExpansion: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n enableEditing: false,\n enableFiltering: false,\n enableSearch: false,\n enableSorting: false,\n};\n\nconst presets: Record<Table3Preset, Table3Options> = {\n display: {\n enableColumnFreezing: true,\n enableColumnHiding: true,\n enableColumnOrdering: true,\n enableColumnResizing: true,\n enableFontSize: true,\n enableFooter: true,\n enablePrinting: false,\n enableRowDrag: true,\n enableRowDrop: true,\n enableRowExpansion: true,\n enableRowGoto: true,\n enableRowHeight: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n enableEditing: false,\n enableFiltering: true,\n enableSearch: true,\n enableSorting: true,\n },\n editable: {\n enableColumnFreezing: true,\n enableColumnHiding: true,\n enableColumnOrdering: true,\n enableColumnResizing: true,\n enableFontSize: true,\n enableFooter: true,\n enablePrinting: false,\n enableRowDrag: true,\n enableRowDrop: true,\n enableRowExpansion: true,\n enableRowGoto: true,\n enableRowHeight: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n enableEditing: true,\n enableFiltering: true,\n enableSearch: true,\n enableSorting: true,\n },\n card: {\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnOrdering: false,\n enableColumnResizing: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowExpansion: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n enableEditing: false,\n enableFiltering: false,\n enableSearch: false,\n enableSorting: true,\n },\n};\n\nexport function useTablePreset<TType = unknown>(props: Table3Props<TType>): Table3Options {\n const presetOptions = props.preset ? presets[props.preset] : DEFAULT_ALL_DISABLED;\n\n const enableRowExpansion = props.enableRowExpansion ?? presetOptions.enableRowExpansion;\n const enableRowSelection = props.enableRowSelection ?? presetOptions.enableRowSelection;\n\n // guard options that might be unintentionally broken\n React.useEffect(() => {\n if (enableRowExpansion && !props.expandedRowRenderer) {\n console.warn(\n `Table3 (id: ${props.id}) - Row expansion is enabled but no \\`expandedRowRenderer\\` has been provided. Provide one to enable row expansion or set \\`enableRowExpansion\\` to \\`false\\`.`\n );\n }\n\n if (enableRowSelection && !props.onRowSelect) {\n console.warn(\n `Table3 (id: ${props.id}) - Row selection is enabled but no \\`onRowSelect\\` handler has been provided. Provide one to enable row selection or set \\`enableRowSelection\\` to \\`false\\`.`\n );\n }\n }, []);\n\n return {\n enableColumnFreezing: props.enableColumnFreezing ?? presetOptions.enableColumnFreezing,\n enableColumnHiding: props.enableColumnHiding ?? presetOptions.enableColumnHiding,\n enableColumnOrdering: props.enableColumnOrdering ?? presetOptions.enableColumnOrdering,\n enableColumnResizing: props.enableColumnResizing ?? presetOptions.enableColumnResizing,\n enableFontSize: props.enableFontSize ?? presetOptions.enableFontSize,\n enableFooter: props.enableFooter ?? presetOptions.enableFooter,\n enablePrinting: props.enablePrinting ?? presetOptions.enablePrinting,\n enableRowDrag: (props.enableRowDrag ?? presetOptions.enableRowDrag) && !!props.onRowDrag,\n enableRowDrop: (props.enableRowDrop ?? presetOptions.enableRowDrop) && !!props.onRowDrop,\n enableRowExpansion: enableRowExpansion && !!props.expandedRowRenderer,\n enableRowGoto: (props.enableRowGoto ?? presetOptions.enableRowGoto) && !!props.onRowGoto,\n enableRowHeight: props.enableRowHeight ?? presetOptions.enableRowHeight,\n enableRowSelection: enableRowSelection && !!props.onRowSelect,\n enableRowSelectionSingle:\n (props.enableRowSelectionSingle ?? presetOptions.enableRowSelectionSingle) &&\n enableRowSelection &&\n !!props.onRowSelect,\n enableEditing: props.enableEditing ?? presetOptions.enableEditing,\n enableFiltering: props.enableFiltering ?? presetOptions.enableFiltering,\n enableSearch: props.enableSearch ?? presetOptions.enableSearch,\n enableSorting: props.enableSorting ?? presetOptions.enableSorting,\n };\n}\n"],"names":["DEFAULT_ALL_DISABLED","enableColumnFreezing","enableColumnHiding","enableColumnOrdering","enableColumnResizing","enableFontSize","enableFooter","enablePrinting","enableRowDrag","enableRowDrop","enableRowExpansion","enableRowGoto","enableRowHeight","enableRowSelection","enableRowSelectionSingle","enableEditing","enableFiltering","enableSearch","enableSorting","presets","display","editable","card","useTablePreset","props","presetOptions","preset","_props$enableRowExpan","_props$enableRowSelec","React","useEffect","expandedRowRenderer","console","warn","id","onRowSelect","_props$enableColumnFr","_props$enableColumnHi","_props$enableColumnOr","_props$enableColumnRe","_props$enableFontSize","_props$enableFooter","_props$enablePrinting","_props$enableRowDrag","onRowDrag","_props$enableRowDrop","onRowDrop","_props$enableRowGoto","onRowGoto","_props$enableRowHeigh","_props$enableRowSelec2","_props$enableEditing","_props$enableFilterin","_props$enableSearch","_props$enableSorting"],"mappings":"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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../../../../src/components/Table3/types.ts"],"sourcesContent":["import { ColumnOrderState, ColumnSizingState, SortingState, VisibilityState, BuiltInSortingFn } from '@tanstack/react-table';\nimport { MenuProps } from '../Menu/Menu';\nimport { MenuItemProps } from '../Menu/components/Item';\nimport {\n TableColumnFilter,\n TableColumnRendererControl,\n TableColumnRendererControlProps,\n TableColumnSort,\n TableFilterHandler,\n TableRef,\n TableRowClickHandler,\n TableRowGotoHandler,\n TableRowHeight,\n TableRowSelectHandler,\n TableServerLoadAllHandler,\n TableServerLoadPageHandler,\n TableSortHandler,\n} from '../../primitives/Table/types';\nimport { FontSize, ValueOf } from '../../types';\n\nexport type Table3SortDirection = 'asc' | 'desc';\nexport type Table3SortFn<TType = unknown> =\n | ((rowA: TType, rowB: TType, columnId: string) => -1 | 0 | 1)\n | BuiltInSortingFn\n | 'auto';\n\n// columns\nexport type Table3ColumnRenderer<TValue = unknown, TType = unknown> = (\n value: TValue,\n row: TType\n) => JSX.Element | string | number | null;\nexport type Table3ColumnFooterRenderer<TValue = unknown> = (values: TValue[]) => JSX.Element | string | number | null;\nexport type Table3ColumnClassNameHandler<TType = unknown> = string | ((row: TType) => string | undefined);\nexport type Table3ColumnAlignment = 'left' | 'center' | 'right';\nexport type Table3ColumnDataType = 'auto' | 'number' | 'alphanumeric' | 'alphanumericCaseSensitive' | 'datetime' | 'boolean';\nexport type Table3ColumnHeaderMenu = (props: Partial<MenuProps>) => JSX.Element;\n\nexport type Table3ColumnControlProps = TableColumnRendererControlProps;\nexport type Table3ColumnControlRenderer<TType = unknown> = TableColumnRendererControl<TType>;\n\nexport type Table3ColumnProps<TType = unknown> = ValueOf<{\n [K in keyof TType]: {\n accessor: K;\n } & {\n align?: Table3ColumnAlignment;\n className?: Table3ColumnClassNameHandler<TType>;\n control?: Table3ColumnControlRenderer<TType>;\n dataType?: Table3ColumnDataType;\n defaultHidden?: boolean;\n defaultWidth?: number | 'grow';\n enableFiltering?: boolean;\n enableHiding?: boolean;\n enableOrdering?: boolean;\n enablePrinting?: boolean;\n enableResizing?: boolean;\n enableSearch?: boolean;\n enableSorting?: boolean;\n enableTruncate?: boolean;\n filters?: Table3FilterComparator[];\n footer?: Table3ColumnFooterRenderer;\n header: string;\n headerClassName?: string;\n menu?: Table3ColumnHeaderMenu;\n minWidth?: number;\n renderer?: Table3ColumnRenderer<TType[K], TType>;\n sort?: Table3SortDirection;\n sortFn?: Table3SortFn<TType>;\n tooltip?: string;\n };\n}>;\n\nexport type Table3GroupProps = {\n id: string;\n header: string;\n colSpan?: number;\n children: (JSX.Element | boolean | null | undefined)[];\n};\n\n// rows\nexport type DeprecatedRowDensity = 'compact' | 'normal' | 'comfortable' | 'spacious';\nexport type Table3RowHeight = TableRowHeight;\nexport type Table3RowClickHandler<TType = unknown> = TableRowClickHandler<TType>;\nexport type Table3RowDragHandler<TType = unknown> = (\n rows: TType[],\n showPlaceholder: (string) => void,\n setDataTransfer: (data: string) => void\n) => void;\nexport type Table3RowDropHandler<TType = any> = (event: React.DragEvent, row: TType) => void;\nexport type Table3RowExpansionRenderer<TType = unknown> = (row: TType) => (() => JSX.Element) | null;\nexport type Table3RowSelectionHandler<TType = unknown> = TableRowSelectHandler<TType>;\nexport type Table3RowActionRenderer<TType = unknown> = (row: TType) => JSX.Element | null;\n\n// table\nexport type Table3Preset = 'display' | 'editable';\nexport type Table3Settings = {\n columnFreezingIndex?: number;\n columnOrder?: ColumnOrderState;\n columnSizing?: ColumnSizingState;\n columnVisibility?: VisibilityState;\n excludeUnmatchedRecordsInSearch?: boolean;\n fontSize?: FontSize;\n rowHeight?: Table3RowHeight;\n showWarningWhenPrintingLargeDataset?: boolean;\n sorting?: SortingState;\n};\nexport type Table3SettingsHandler = (settings: Table3Settings) => void | Promise<void>;\n\nexport enum Table3FilterComparator {\n Contains,\n DoesNotContain,\n IsEqualTo,\n IsNotEqualTo,\n IsGreaterThan,\n IsLessThan,\n IsBetween,\n IsEmpty,\n IsNotEmpty,\n IsLessThanOrEqualTo,\n IsGreaterThanOrEqualTo,\n HasAnyOf,\n HasAllOf,\n HasNoneOf,\n}\n\nexport type Table3FilterValue = {\n comparator: Table3FilterComparator | null;\n value: any;\n};\n\nexport type Table3Filter = { id: string | null; value: Table3FilterValue };\n\nexport type ColumnFilter = TableColumnFilter;\nexport type Table3FilterHandler = TableFilterHandler;\nexport type Table3LoadPageHandler = TableServerLoadPageHandler;\nexport type Table3LoadAllHandler = TableServerLoadAllHandler;\nexport type Table3RowGotoHandler = TableRowGotoHandler;\nexport type Table3ColumnSort = TableColumnSort;\nexport type Table3SortHandler = TableSortHandler;\nexport type RowErrors = Record<string, string>;\nexport type Table3CellValidationHandler<TType = unknown> = (\n cellValue: any,\n cellId: string,\n row: TType\n) => Promise<RowErrors | undefined | void>;\nexport type Table3RowValidationHandler<TType = unknown> = (row: TType) => Promise<RowErrors | undefined | void>;\nexport type TableStrategy = {\n renderBody: () => JSX.Element | JSX.Element[] | null;\n scrollToIndex: (index: number, options?: { align: 'start' | 'center' | 'end' | 'auto' }) => void;\n};\nexport type Table3ShortcutHandlerFn<TType = unknown> = (row: TType) => void;\nexport type Table3ShortcutHandlerObject<TType = unknown> = {\n handler: Table3ShortcutHandlerFn<TType>;\n meta?: boolean;\n shift?: boolean;\n};\nexport type Table3Shortcuts<TType = unknown> = Record<\n string,\n Table3ShortcutHandlerFn<TType> | Table3ShortcutHandlerObject<TType>\n>;\nexport type Table3SaveHandler<TType = unknown> = (data: TType) => Promise<void>;\n\nexport type Table3Options = {\n enableColumnFreezing: boolean;\n enableColumnHiding: boolean;\n enableColumnOrdering: boolean;\n enableColumnResizing: boolean;\n enableFontSize: boolean;\n enableFooter: boolean;\n enablePrinting: boolean;\n enableRowDrag: boolean;\n enableRowDrop: boolean;\n enableRowExpansion: boolean;\n enableRowGoto: boolean;\n enableRowHeight: boolean;\n enableRowSelection: boolean;\n enableRowSelectionSingle: boolean;\n enableEditing: boolean;\n enableFiltering: boolean;\n enableSearch: boolean;\n enableSorting: boolean;\n};\n\nexport type Table3CustomSettingRenderer = (props: Table3Settings) => React.ReactElement<MenuItemProps> | null;\n\nexport type Table3CommonProps<TType = unknown> = Partial<Table3Options> & {\n actionsForRow?: Table3RowActionRenderer<TType>[];\n actionsForRowLength?: number;\n autoFocus?: boolean;\n children: (JSX.Element | boolean | null | undefined)[];\n customSettings?: Table3CustomSettingRenderer[];\n data: TType[];\n defaultColumnFreezingIndex?: number;\n defaultCurrentRowIndex?: number;\n defaultSettings?: Table3Settings;\n emptyState?: () => JSX.Element | null;\n expandedRowRenderer?: Table3RowExpansionRenderer<TType>;\n id: string;\n onChangeSettings?: Table3SettingsHandler;\n onRowClick?: Table3RowClickHandler<TType>;\n onRowDrag?: Table3RowDragHandler<TType>;\n onRowDrop?: Table3RowDropHandler<TType>;\n onRowGoto?: Table3RowGotoHandler;\n onRowSelect?: Table3RowSelectionHandler<TType>;\n onFilter?: Table3FilterHandler;\n onSave?: Table3SaveHandler<TType>;\n onSort?: Table3SortHandler;\n onCellValidate?: Table3CellValidationHandler<TType>;\n onRowValidate?: Table3RowValidationHandler<TType>;\n preset?: Table3Preset;\n shortcuts?: Table3Shortcuts<TType>;\n toolbarLeft?: JSX.Element;\n toolbarRight?: JSX.Element;\n rowIdentifier?: string;\n};\n\ninterface Table3ClientProps<TType = unknown> extends Table3CommonProps<TType> {\n length?: never;\n loadPage?: never;\n loadAll?: never;\n pageSize?: never;\n}\n\ninterface Table3ServerProps<TType = unknown> extends Table3CommonProps<TType> {\n length: number | undefined;\n loadPage: Table3LoadPageHandler;\n loadAll: Table3LoadAllHandler;\n pageSize?: number;\n}\n\nexport type Table3Props<TType = unknown> = Table3ClientProps<TType> | Table3ServerProps<TType>;\n\nexport type Table3Ref = TableRef & {\n instance: {\n toggleEditing: (enabled: boolean | undefined) => void;\n };\n};\n\nexport type Table3Texts = {\n columns: {\n actions: {\n tooltip: string;\n };\n drag: {\n tooltip: string;\n };\n expansion: {\n collapse: string;\n collapseAll: string;\n expand: string;\n expandAll: string;\n };\n menu: {\n freezeFirstColumn: string;\n freezeUptoColumn: string;\n gotoRow: string;\n hideColumn: string;\n unfreezeColumns: string;\n sorting: string;\n sortingOrder: {\n ascending: string;\n descending: string;\n unsorted: string;\n };\n };\n resize: {\n tooltip: string;\n };\n select: {\n deselect: string;\n deselectAll: string;\n select: string;\n selectAll: string;\n };\n };\n columnSettings: {\n button: string;\n noResults: string;\n search: string;\n tooltip: string;\n };\n editing: {\n actions: {\n tooltip: string;\n save: string;\n clear: string;\n exit: string;\n };\n buttons: {\n edit: {\n tooltip: string;\n };\n };\n rowIndicator: {\n rowWillMove: string;\n rowWillBeHidden: string;\n rowWillMoveReasonSearch: string;\n rowWillMoveReasonFilter: string;\n rowWillMoveReasonSorting: string;\n };\n saving: {\n progress: string;\n complete: string;\n };\n clearChangesConfirmationDialog: {\n title: string;\n description: string;\n cancel: string;\n confirm: string;\n };\n };\n filters: {\n button: string;\n buttons: {\n addFilter: string;\n clearFilters: string;\n };\n comparators: {\n contains: string;\n doesNotContain: string;\n isEqualTo: string;\n isNotEqualTo: string;\n isGreaterThan: string;\n isLessThan: string;\n isBetween: string;\n isEmpty: string;\n isNotEmpty: string;\n isBefore: string;\n isAfter: string;\n isLessThanOrEqualTo: string;\n isGreaterThanOrEqualTo: string;\n isOnOrBefore: string;\n isOnOrAfter: string;\n hasAnyOf: string;\n hasAllOf: string;\n hasNoneOf: string;\n };\n conditions: {\n and: string;\n where: string;\n };\n emptyFilter: {\n condition: string;\n value: string;\n };\n hiddenColumn: string;\n hiddenGroupedColumn: string;\n tooltip: string;\n total: string;\n };\n fontSize: {\n tooltip: string;\n sizes: {\n small: string;\n medium: string;\n large: string;\n };\n };\n footer: {\n summary: {\n count: string;\n records: string;\n selected: string;\n };\n };\n print: {\n error: string;\n loading: string;\n tooltip: string;\n warningDialog: {\n title: string;\n description: string;\n checkboxVisibilityLabel: string;\n cancelButtonText: string;\n printButtonText: string;\n };\n settingsDialog: {\n title: string;\n size: string;\n sizeA5: string;\n sizeA4: string;\n sizeA3: string;\n sizeLetter: string;\n sizeLegal: string;\n orientation: string;\n orientationLandscape: string;\n orientationPortrait: string;\n rows: string;\n rowsAll: string;\n rowsSelected: string;\n layout: string;\n layoutSplitGroups: string;\n };\n };\n rowHeight: {\n tooltip: string;\n sizes: {\n short: string;\n medium: string;\n tall: string;\n extraTall: string;\n };\n };\n search: {\n excludeUnmatchedResults: string;\n placeholder: string;\n };\n otherOptions: {\n tooltip: string;\n };\n validation: {\n index: string;\n alert: {\n unsavedEntries: (count?: number) => string;\n incompleteAndHavntBeenSaved: (count?: number) => string;\n };\n resetFiltersDialog: {\n title: string;\n description: string;\n cancel: string;\n confirm: string;\n };\n };\n};\n"],"names":["Table3FilterComparator"],"mappings":"IA2GYA;AAAZ,WAAYA,sBAAsB;EAC9BA,2EAAQ;EACRA,uFAAc;EACdA,6EAAS;EACTA,mFAAY;EACZA,qFAAa;EACbA,+EAAU;EACVA,6EAAS;EACTA,yEAAO;EACPA,+EAAU;EACVA,iGAAmB;EACnBA,wGAAsB;EACtBA,4EAAQ;EACRA,4EAAQ;EACRA,8EAAS;AACb,CAAC,EAfWA,sBAAsB,KAAtBA,sBAAsB;;;;"}
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../../../../src/components/Table3/types.ts"],"sourcesContent":["import { ColumnOrderState, ColumnSizingState, SortingState, VisibilityState, BuiltInSortingFn } from '@tanstack/react-table';\nimport { MenuProps } from '../Menu/Menu';\nimport { MenuItemProps } from '../Menu/components/Item';\nimport {\n TableColumnFilter,\n TableColumnRendererControl,\n TableColumnRendererControlProps,\n TableColumnSort,\n TableFilterHandler,\n TableRef,\n TableRowClickHandler,\n TableRowGotoHandler,\n TableRowHeight,\n TableRowSelectHandler,\n TableServerLoadAllHandler,\n TableServerLoadPageHandler,\n TableSortHandler,\n} from '../../primitives/Table/types';\nimport { FontSize, ValueOf } from '../../types';\n\nexport type Table3SortDirection = 'asc' | 'desc';\nexport type Table3SortFn<TType = unknown> =\n | ((rowA: TType, rowB: TType, columnId: string) => -1 | 0 | 1)\n | BuiltInSortingFn\n | 'auto';\n\n// columns\nexport type Table3ColumnRenderer<TValue = unknown, TType = unknown> = (\n value: TValue,\n row: TType\n) => JSX.Element | string | number | null;\nexport type Table3ColumnFooterRenderer<TValue = unknown> = (values: TValue[]) => JSX.Element | string | number | null;\nexport type Table3ColumnClassNameHandler<TType = unknown> = string | ((row: TType) => string | undefined);\nexport type Table3ColumnAlignment = 'left' | 'center' | 'right';\nexport type Table3ColumnDataType = 'auto' | 'number' | 'alphanumeric' | 'alphanumericCaseSensitive' | 'datetime' | 'boolean';\nexport type Table3ColumnHeaderMenu = (props: Partial<MenuProps>) => JSX.Element;\n\nexport type Table3ColumnControlProps = TableColumnRendererControlProps;\nexport type Table3ColumnControlRenderer<TType = unknown> = TableColumnRendererControl<TType>;\n\nexport type Table3ColumnProps<TType = unknown> = ValueOf<{\n [K in keyof TType]: {\n accessor: K;\n } & {\n align?: Table3ColumnAlignment;\n className?: Table3ColumnClassNameHandler<TType>;\n control?: Table3ColumnControlRenderer<TType>;\n dataType?: Table3ColumnDataType;\n defaultHidden?: boolean;\n defaultWidth?: number | 'grow';\n enableFiltering?: boolean;\n enableHiding?: boolean;\n enableOrdering?: boolean;\n enablePrinting?: boolean;\n enableResizing?: boolean;\n enableSearch?: boolean;\n enableSorting?: boolean;\n enableTruncate?: boolean;\n filters?: Table3FilterComparator[];\n footer?: Table3ColumnFooterRenderer;\n header: string;\n headerClassName?: string;\n menu?: Table3ColumnHeaderMenu;\n minWidth?: number;\n renderer?: Table3ColumnRenderer<TType[K], TType>;\n sort?: Table3SortDirection;\n sortFn?: Table3SortFn<TType>;\n tooltip?: string;\n };\n}>;\n\nexport type Table3GroupProps = {\n id: string;\n header: string;\n colSpan?: number;\n children: (JSX.Element | boolean | null | undefined)[];\n};\n\n// rows\nexport type DeprecatedRowDensity = 'compact' | 'normal' | 'comfortable' | 'spacious';\nexport type Table3RowHeight = TableRowHeight;\nexport type Table3RowClickHandler<TType = unknown> = TableRowClickHandler<TType>;\nexport type Table3RowDragHandler<TType = unknown> = (\n rows: TType[],\n showPlaceholder: (string) => void,\n setDataTransfer: (data: string) => void\n) => void;\nexport type Table3RowDropHandler<TType = any> = (event: React.DragEvent, row: TType) => void;\nexport type Table3RowExpansionRenderer<TType = unknown> = (row: TType) => (() => JSX.Element) | null;\nexport type Table3RowSelectionHandler<TType = unknown> = TableRowSelectHandler<TType>;\nexport type Table3RowActionRenderer<TType = unknown> = (row: TType) => JSX.Element | null;\n\n// table\nexport type Table3Preset = 'display' | 'editable' | 'card';\nexport type Table3Settings = {\n columnFreezingIndex?: number;\n columnOrder?: ColumnOrderState;\n columnSizing?: ColumnSizingState;\n columnVisibility?: VisibilityState;\n excludeUnmatchedRecordsInSearch?: boolean;\n fontSize?: FontSize;\n rowHeight?: Table3RowHeight;\n showWarningWhenPrintingLargeDataset?: boolean;\n sorting?: SortingState;\n};\nexport type Table3SettingsHandler = (settings: Table3Settings) => void | Promise<void>;\n\nexport enum Table3FilterComparator {\n Contains,\n DoesNotContain,\n IsEqualTo,\n IsNotEqualTo,\n IsGreaterThan,\n IsLessThan,\n IsBetween,\n IsEmpty,\n IsNotEmpty,\n IsLessThanOrEqualTo,\n IsGreaterThanOrEqualTo,\n HasAnyOf,\n HasAllOf,\n HasNoneOf,\n}\n\nexport type Table3FilterValue = {\n comparator: Table3FilterComparator | null;\n value: any;\n};\n\nexport type Table3Filter = { id: string | null; value: Table3FilterValue };\n\nexport type ColumnFilter = TableColumnFilter;\nexport type Table3FilterHandler = TableFilterHandler;\nexport type Table3LoadPageHandler = TableServerLoadPageHandler;\nexport type Table3LoadAllHandler = TableServerLoadAllHandler;\nexport type Table3RowGotoHandler = TableRowGotoHandler;\nexport type Table3ColumnSort = TableColumnSort;\nexport type Table3SortHandler = TableSortHandler;\nexport type RowErrors = Record<string, string>;\nexport type Table3CellValidationHandler<TType = unknown> = (\n cellValue: any,\n cellId: string,\n row: TType\n) => Promise<RowErrors | undefined | void>;\nexport type Table3RowValidationHandler<TType = unknown> = (row: TType) => Promise<RowErrors | undefined | void>;\nexport type TableStrategy = {\n renderBody: () => JSX.Element | JSX.Element[] | null;\n scrollToIndex: (index: number, options?: { align: 'start' | 'center' | 'end' | 'auto' }) => void;\n};\nexport type Table3ShortcutHandlerFn<TType = unknown> = (row: TType) => void;\nexport type Table3ShortcutHandlerObject<TType = unknown> = {\n handler: Table3ShortcutHandlerFn<TType>;\n meta?: boolean;\n shift?: boolean;\n};\nexport type Table3Shortcuts<TType = unknown> = Record<\n string,\n Table3ShortcutHandlerFn<TType> | Table3ShortcutHandlerObject<TType>\n>;\nexport type Table3SaveHandler<TType = unknown> = (data: TType) => Promise<void>;\n\nexport type Table3Options = {\n enableColumnFreezing: boolean;\n enableColumnHiding: boolean;\n enableColumnOrdering: boolean;\n enableColumnResizing: boolean;\n enableFontSize: boolean;\n enableFooter: boolean;\n enablePrinting: boolean;\n enableRowDrag: boolean;\n enableRowDrop: boolean;\n enableRowExpansion: boolean;\n enableRowGoto: boolean;\n enableRowHeight: boolean;\n enableRowSelection: boolean;\n enableRowSelectionSingle: boolean;\n enableEditing: boolean;\n enableFiltering: boolean;\n enableSearch: boolean;\n enableSorting: boolean;\n};\n\nexport type Table3CustomSettingRenderer = (props: Table3Settings) => React.ReactElement<MenuItemProps> | null;\n\nexport type Table3CommonProps<TType = unknown> = Partial<Table3Options> & {\n actionsForRow?: Table3RowActionRenderer<TType>[];\n actionsForRowLength?: number;\n autoFocus?: boolean;\n children: (JSX.Element | boolean | null | undefined)[];\n customSettings?: Table3CustomSettingRenderer[];\n data: TType[];\n defaultColumnFreezingIndex?: number;\n defaultCurrentRowIndex?: number;\n defaultSettings?: Table3Settings;\n emptyState?: () => JSX.Element | null;\n expandedRowRenderer?: Table3RowExpansionRenderer<TType>;\n id: string;\n onChangeSettings?: Table3SettingsHandler;\n onRowClick?: Table3RowClickHandler<TType>;\n onRowDrag?: Table3RowDragHandler<TType>;\n onRowDrop?: Table3RowDropHandler<TType>;\n onRowGoto?: Table3RowGotoHandler;\n onRowSelect?: Table3RowSelectionHandler<TType>;\n onFilter?: Table3FilterHandler;\n onSave?: Table3SaveHandler<TType>;\n onSort?: Table3SortHandler;\n onCellValidate?: Table3CellValidationHandler<TType>;\n onRowValidate?: Table3RowValidationHandler<TType>;\n preset?: Table3Preset;\n shortcuts?: Table3Shortcuts<TType>;\n toolbarLeft?: JSX.Element;\n toolbarRight?: JSX.Element;\n rowIdentifier?: string;\n};\n\ninterface Table3ClientProps<TType = unknown> extends Table3CommonProps<TType> {\n length?: never;\n loadPage?: never;\n loadAll?: never;\n pageSize?: never;\n}\n\ninterface Table3ServerProps<TType = unknown> extends Table3CommonProps<TType> {\n length: number | undefined;\n loadPage: Table3LoadPageHandler;\n loadAll: Table3LoadAllHandler;\n pageSize?: number;\n}\n\nexport type Table3Props<TType = unknown> = Table3ClientProps<TType> | Table3ServerProps<TType>;\n\nexport type Table3Ref = TableRef & {\n instance: {\n toggleEditing: (enabled: boolean | undefined) => void;\n };\n};\n\nexport type Table3Texts = {\n columns: {\n actions: {\n tooltip: string;\n };\n drag: {\n tooltip: string;\n };\n expansion: {\n collapse: string;\n collapseAll: string;\n expand: string;\n expandAll: string;\n };\n menu: {\n freezeFirstColumn: string;\n freezeUptoColumn: string;\n gotoRow: string;\n hideColumn: string;\n unfreezeColumns: string;\n sorting: string;\n sortingOrder: {\n ascending: string;\n descending: string;\n unsorted: string;\n };\n };\n resize: {\n tooltip: string;\n };\n select: {\n deselect: string;\n deselectAll: string;\n select: string;\n selectAll: string;\n };\n };\n columnSettings: {\n button: string;\n noResults: string;\n search: string;\n tooltip: string;\n };\n editing: {\n actions: {\n tooltip: string;\n save: string;\n clear: string;\n exit: string;\n };\n buttons: {\n edit: {\n tooltip: string;\n };\n };\n rowIndicator: {\n rowWillMove: string;\n rowWillBeHidden: string;\n rowWillMoveReasonSearch: string;\n rowWillMoveReasonFilter: string;\n rowWillMoveReasonSorting: string;\n };\n saving: {\n progress: string;\n complete: string;\n };\n clearChangesConfirmationDialog: {\n title: string;\n description: string;\n cancel: string;\n confirm: string;\n };\n };\n filters: {\n button: string;\n buttons: {\n addFilter: string;\n clearFilters: string;\n };\n comparators: {\n contains: string;\n doesNotContain: string;\n isEqualTo: string;\n isNotEqualTo: string;\n isGreaterThan: string;\n isLessThan: string;\n isBetween: string;\n isEmpty: string;\n isNotEmpty: string;\n isBefore: string;\n isAfter: string;\n isLessThanOrEqualTo: string;\n isGreaterThanOrEqualTo: string;\n isOnOrBefore: string;\n isOnOrAfter: string;\n hasAnyOf: string;\n hasAllOf: string;\n hasNoneOf: string;\n };\n conditions: {\n and: string;\n where: string;\n };\n emptyFilter: {\n condition: string;\n value: string;\n };\n hiddenColumn: string;\n hiddenGroupedColumn: string;\n tooltip: string;\n total: string;\n };\n fontSize: {\n tooltip: string;\n sizes: {\n small: string;\n medium: string;\n large: string;\n };\n };\n footer: {\n summary: {\n count: string;\n records: string;\n selected: string;\n };\n };\n print: {\n error: string;\n loading: string;\n tooltip: string;\n warningDialog: {\n title: string;\n description: string;\n checkboxVisibilityLabel: string;\n cancelButtonText: string;\n printButtonText: string;\n };\n settingsDialog: {\n title: string;\n size: string;\n sizeA5: string;\n sizeA4: string;\n sizeA3: string;\n sizeLetter: string;\n sizeLegal: string;\n orientation: string;\n orientationLandscape: string;\n orientationPortrait: string;\n rows: string;\n rowsAll: string;\n rowsSelected: string;\n layout: string;\n layoutSplitGroups: string;\n };\n };\n rowHeight: {\n tooltip: string;\n sizes: {\n short: string;\n medium: string;\n tall: string;\n extraTall: string;\n };\n };\n search: {\n excludeUnmatchedResults: string;\n placeholder: string;\n };\n otherOptions: {\n tooltip: string;\n };\n validation: {\n index: string;\n alert: {\n unsavedEntries: (count?: number) => string;\n incompleteAndHavntBeenSaved: (count?: number) => string;\n };\n resetFiltersDialog: {\n title: string;\n description: string;\n cancel: string;\n confirm: string;\n };\n };\n};\n"],"names":["Table3FilterComparator"],"mappings":"IA2GYA;AAAZ,WAAYA,sBAAsB;EAC9BA,2EAAQ;EACRA,uFAAc;EACdA,6EAAS;EACTA,mFAAY;EACZA,qFAAa;EACbA,+EAAU;EACVA,6EAAS;EACTA,yEAAO;EACPA,+EAAU;EACVA,iGAAmB;EACnBA,wGAAsB;EACtBA,4EAAQ;EACRA,4EAAQ;EACRA,8EAAS;AACb,CAAC,EAfWA,sBAAsB,KAAtBA,sBAAsB;;;;"}
|
@@ -9,9 +9,11 @@ const isFrozenColumn = (header, table) => {
|
|
9
9
|
if (header.column.id !== COLUMN_ID && isInternalColumn(header.column.id)) {
|
10
10
|
return true;
|
11
11
|
}
|
12
|
+
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
12
13
|
if (!tableMeta.columnFreezing.isEnabled || tableMeta.columnFreezing.frozenColumnIndex === undefined) {
|
13
14
|
return false;
|
14
15
|
}
|
16
|
+
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
15
17
|
return tableMeta.columnFreezing.frozenColumnIndex + ((_tableMeta$columnFree = tableMeta.columnFreezing.frozenInternalColumnCount) !== null && _tableMeta$columnFree !== void 0 ? _tableMeta$columnFree : 0) >= header.index;
|
16
18
|
};
|
17
19
|
const getCurrentRowCellElement = (index, table) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"columns.js","sources":["../../../../../../../../src/components/Table3/util/columns.ts"],"sourcesContent":["import { Header as RTHeader, Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { isDate } from 'date-fns';\nimport { format, parseFromISOString } from '../../../utils/date';\nimport { COLUMN_ID } from '../components/columns/internal/Actions';\nimport { Table3ColumnDataType } from '../types';\n\nexport const isInternalColumn = (id: string) => id.startsWith('__');\n\nexport const isFrozenColumn = <TType = unknown>(header: RTHeader<TType, unknown>, table: RTable<TType>) => {\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n if (header.column.id !== COLUMN_ID && isInternalColumn(header.column.id)) {\n return true;\n }\n\n if (!tableMeta.columnFreezing.isEnabled || tableMeta.columnFreezing.frozenColumnIndex === undefined) {\n return false;\n }\n\n return tableMeta.columnFreezing.frozenColumnIndex + (tableMeta.columnFreezing.frozenInternalColumnCount ?? 0) >= header.index;\n};\n\nexport const getCurrentRowCellElement = (index: number, table: HTMLElement) => {\n const cellSelector = `[data-current=\"true\"] [data-column-index=\"${index}\"`;\n return table.querySelector(cellSelector);\n};\n\nexport function scrollColumnIntoView(columnIndex: number, frozenColumnIndex: number, column: HTMLElement, table: HTMLElement) {\n if (frozenColumnIndex !== undefined && columnIndex > frozenColumnIndex) {\n const lastFrozenColumnElement = getCurrentRowCellElement(frozenColumnIndex, table);\n const highlightRef = column?.getBoundingClientRect();\n const lastFrozenRect = lastFrozenColumnElement?.getBoundingClientRect();\n\n // offset the width of frozen columns so that the column being scrolled to is not hidden behind them\n if (highlightRef && lastFrozenRect && highlightRef.left < lastFrozenRect.left + lastFrozenRect.width) {\n const pinnedColumnsWidth = lastFrozenRect.left + lastFrozenRect.width;\n table?.scrollTo(highlightRef.left - pinnedColumnsWidth, table.scrollTop);\n }\n } else {\n column.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n}\n\nexport function isCellHighlighted(query: string, value: unknown, dataType?: Table3ColumnDataType) {\n if (value === undefined || value === null) {\n return false;\n }\n\n return String(getCellValueAsString(value, dataType)).toLocaleLowerCase().includes(query.toLocaleLowerCase());\n}\n\nexport function getCellValueAsString(value: unknown, dataType?: Table3ColumnDataType): string {\n if (value === undefined || value === null) {\n return '';\n } else if (isDate(value)) {\n return format(value as Date) ?? '';\n } else if (dataType === 'datetime' && typeof value === 'string') {\n return format(parseFromISOString(value as string)) ?? '';\n }\n\n return String(value);\n}\n"],"names":["isInternalColumn","id","startsWith","isFrozenColumn","header","table","tableMeta","options","meta","column","COLUMN_ID","columnFreezing","isEnabled","frozenColumnIndex","undefined","_tableMeta$columnFree","frozenInternalColumnCount","index","getCurrentRowCellElement","cellSelector","querySelector","scrollColumnIntoView","columnIndex","lastFrozenColumnElement","highlightRef","getBoundingClientRect","lastFrozenRect","left","width","pinnedColumnsWidth","scrollTo","scrollTop","scrollIntoView","block","inline","isCellHighlighted","query","value","dataType","String","getCellValueAsString","toLocaleLowerCase","includes","isDate","_format","format","_format2","parseFromISOString"],"mappings":";;;;MAMaA,gBAAgB,GAAIC,EAAU,IAAKA,EAAE,CAACC,UAAU,CAAC,IAAI;MAErDC,cAAc,GAAGA,CAAkBC,MAAgC,EAAEC,KAAoB;;EAClG,MAAMC,SAAS,GAAGD,KAAK,CAACE,OAAO,CAACC,IAAwB;EAExD,IAAIJ,MAAM,CAACK,MAAM,CAACR,EAAE,KAAKS,SAAS,IAAIV,gBAAgB,CAACI,MAAM,CAACK,MAAM,CAACR,EAAE,CAAC,EAAE;IACtE,OAAO,IAAI
|
1
|
+
{"version":3,"file":"columns.js","sources":["../../../../../../../../src/components/Table3/util/columns.ts"],"sourcesContent":["import { Header as RTHeader, Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { isDate } from 'date-fns';\nimport { format, parseFromISOString } from '../../../utils/date';\nimport { COLUMN_ID } from '../components/columns/internal/Actions';\nimport { Table3ColumnDataType } from '../types';\n\nexport const isInternalColumn = (id: string) => id.startsWith('__');\n\nexport const isFrozenColumn = <TType = unknown>(header: RTHeader<TType, unknown>, table: RTable<TType>) => {\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n if (header.column.id !== COLUMN_ID && isInternalColumn(header.column.id)) {\n return true;\n }\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n if (!tableMeta.columnFreezing.isEnabled || tableMeta.columnFreezing.frozenColumnIndex === undefined) {\n return false;\n }\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n return tableMeta.columnFreezing.frozenColumnIndex + (tableMeta.columnFreezing.frozenInternalColumnCount ?? 0) >= header.index;\n};\n\nexport const getCurrentRowCellElement = (index: number, table: HTMLElement) => {\n const cellSelector = `[data-current=\"true\"] [data-column-index=\"${index}\"`;\n return table.querySelector(cellSelector);\n};\n\nexport function scrollColumnIntoView(columnIndex: number, frozenColumnIndex: number, column: HTMLElement, table: HTMLElement) {\n if (frozenColumnIndex !== undefined && columnIndex > frozenColumnIndex) {\n const lastFrozenColumnElement = getCurrentRowCellElement(frozenColumnIndex, table);\n const highlightRef = column?.getBoundingClientRect();\n const lastFrozenRect = lastFrozenColumnElement?.getBoundingClientRect();\n\n // offset the width of frozen columns so that the column being scrolled to is not hidden behind them\n if (highlightRef && lastFrozenRect && highlightRef.left < lastFrozenRect.left + lastFrozenRect.width) {\n const pinnedColumnsWidth = lastFrozenRect.left + lastFrozenRect.width;\n table?.scrollTo(highlightRef.left - pinnedColumnsWidth, table.scrollTop);\n }\n } else {\n column.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n}\n\nexport function isCellHighlighted(query: string, value: unknown, dataType?: Table3ColumnDataType) {\n if (value === undefined || value === null) {\n return false;\n }\n\n return String(getCellValueAsString(value, dataType)).toLocaleLowerCase().includes(query.toLocaleLowerCase());\n}\n\nexport function getCellValueAsString(value: unknown, dataType?: Table3ColumnDataType): string {\n if (value === undefined || value === null) {\n return '';\n } else if (isDate(value)) {\n return format(value as Date) ?? '';\n } else if (dataType === 'datetime' && typeof value === 'string') {\n return format(parseFromISOString(value as string)) ?? '';\n }\n\n return String(value);\n}\n"],"names":["isInternalColumn","id","startsWith","isFrozenColumn","header","table","tableMeta","options","meta","column","COLUMN_ID","columnFreezing","isEnabled","frozenColumnIndex","undefined","_tableMeta$columnFree","frozenInternalColumnCount","index","getCurrentRowCellElement","cellSelector","querySelector","scrollColumnIntoView","columnIndex","lastFrozenColumnElement","highlightRef","getBoundingClientRect","lastFrozenRect","left","width","pinnedColumnsWidth","scrollTo","scrollTop","scrollIntoView","block","inline","isCellHighlighted","query","value","dataType","String","getCellValueAsString","toLocaleLowerCase","includes","isDate","_format","format","_format2","parseFromISOString"],"mappings":"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"}
|
@@ -11,7 +11,7 @@ const Textarea = /*#__PURE__*/forwardRef(function Textarea(props, ref) {
|
|
11
11
|
onKeyDown,
|
12
12
|
...otherProps
|
13
13
|
} = props;
|
14
|
-
const classNames = cn(getInputClasses(props), '
|
14
|
+
const classNames = cn(getInputClasses(props), 'pt-[5px] pb-[7px] min-h-[75px] disabled:resize-none !leading-5', props.className);
|
15
15
|
// home and end keys only navigate to the start/end of textarea value if the textarea container does not scroll
|
16
16
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
17
17
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textarea.js","sources":["../../../../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { getInputClasses } from '../Input/util';\nimport { isPressingMetaKey } from '../../utils/keyboard';\n\nexport type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n /** Draws attention to the textarea by changing its style and making it visually prominent */\n highlighted?: boolean;\n /* Whether the input is in an invalid state */\n invalid?: boolean;\n /** Value of the textarea */\n value?: string;\n};\n\nexport const Textarea = React.forwardRef(function Textarea(props: TextareaProps, ref: React.Ref<HTMLTextAreaElement>) {\n const { defaultValue: _, highlighted, invalid, onKeyDown, ...otherProps } = props;\n const classNames = cn(getInputClasses(props)
|
1
|
+
{"version":3,"file":"Textarea.js","sources":["../../../../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { getInputClasses } from '../Input/util';\nimport { isPressingMetaKey } from '../../utils/keyboard';\n\nexport type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n /** Draws attention to the textarea by changing its style and making it visually prominent */\n highlighted?: boolean;\n /* Whether the input is in an invalid state */\n invalid?: boolean;\n /** Value of the textarea */\n value?: string;\n};\n\nexport const Textarea = React.forwardRef(function Textarea(props: TextareaProps, ref: React.Ref<HTMLTextAreaElement>) {\n const { defaultValue: _, highlighted, invalid, onKeyDown, ...otherProps } = props;\n const classNames = cn(\n getInputClasses(props),\n 'pt-[5px] pb-[7px] min-h-[75px] disabled:resize-none !leading-5',\n props.className\n );\n\n // home and end keys only navigate to the start/end of textarea value if the textarea container does not scroll\n // if it has scroll height then the browser reverts to native scrolling behaviour only\n // so we manually override it to ensure _our_ desired behaviour remains intact\n const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n // prevent any external keyboard shortcuts from executing while typing single characters in textarea\n if (event.key.length === 1 && !isPressingMetaKey(event)) {\n event.stopPropagation();\n }\n\n if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault();\n const position = event.key === 'End' ? event.currentTarget.value.length : 0;\n event.currentTarget.setSelectionRange(position, position);\n event.currentTarget.scrollTop = event.key === 'End' ? event.currentTarget.scrollHeight : 0;\n }\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n };\n\n return <textarea {...otherProps} className={classNames} data-taco=\"textarea\" onKeyDown={handleKeyDown} ref={ref} />;\n});\n"],"names":["Textarea","React","props","ref","defaultValue","_","highlighted","invalid","onKeyDown","otherProps","classNames","cn","getInputClasses","className","handleKeyDown","event","key","length","isPressingMetaKey","stopPropagation","preventDefault","position","currentTarget","value","setSelectionRange","scrollTop","scrollHeight"],"mappings":";;;;;MAcaA,QAAQ,gBAAGC,UAAgB,CAAC,SAASD,QAAQA,CAACE,KAAoB,EAAEC,GAAmC;EAChH,MAAM;IAAEC,YAAY,EAAEC,CAAC;IAAEC,WAAW;IAAEC,OAAO;IAAEC,SAAS;IAAE,GAAGC;GAAY,GAAGP,KAAK;EACjF,MAAMQ,UAAU,GAAGC,EAAE,CACjBC,eAAe,CAACV,KAAK,CAAC,EACtB,gEAAgE,EAChEA,KAAK,CAACW,SAAS,CAClB;;;;EAKD,MAAMC,aAAa,GAAIC,KAA+C;;IAElE,IAAIA,KAAK,CAACC,GAAG,CAACC,MAAM,KAAK,CAAC,IAAI,CAACC,iBAAiB,CAACH,KAAK,CAAC,EAAE;MACrDA,KAAK,CAACI,eAAe,EAAE;;IAG3B,IAAIJ,KAAK,CAACC,GAAG,KAAK,MAAM,IAAID,KAAK,CAACC,GAAG,KAAK,KAAK,EAAE;MAC7CD,KAAK,CAACK,cAAc,EAAE;MACtB,MAAMC,QAAQ,GAAGN,KAAK,CAACC,GAAG,KAAK,KAAK,GAAGD,KAAK,CAACO,aAAa,CAACC,KAAK,CAACN,MAAM,GAAG,CAAC;MAC3EF,KAAK,CAACO,aAAa,CAACE,iBAAiB,CAACH,QAAQ,EAAEA,QAAQ,CAAC;MACzDN,KAAK,CAACO,aAAa,CAACG,SAAS,GAAGV,KAAK,CAACC,GAAG,KAAK,KAAK,GAAGD,KAAK,CAACO,aAAa,CAACI,YAAY,GAAG,CAAC;;IAG9F,IAAIlB,SAAS,EAAE;MACXA,SAAS,CAACO,KAAK,CAAC;;GAEvB;EAED,oBAAOd,4CAAcQ,UAAU;IAAEI,SAAS,EAAEH,UAAU;iBAAY,UAAU;IAACF,SAAS,EAAEM,aAAa;IAAEX,GAAG,EAAEA;KAAO;AACvH,CAAC;;;;"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React__default from 'react';
|
2
|
-
import { useBoundingClientRectListener } from './useBoundingClientRectListener.js';
|
3
2
|
import { getIndexOfFirstChildOverflowingParent } from '../utils/dom.js';
|
3
|
+
import { useBoundingClientRectListener } from './useBoundingClientRectListener.js';
|
4
4
|
|
5
5
|
const useBoundaryOverflowDetection = (ref, dependencies = []) => {
|
6
6
|
const [boundaryIndex, setBoundaryIndex] = React__default.useState();
|
@@ -9,7 +9,7 @@ export { Accordion } from './components/Accordion/Accordion.js';
|
|
9
9
|
export { VisuallyHidden } from './components/VisuallyHidden/VisuallyHidden.js';
|
10
10
|
export { Badge } from './components/Badge/Badge.js';
|
11
11
|
export { useMergedRef } from './hooks/useMergedRef.js';
|
12
|
-
export { createShortcutKeyDownHandler,
|
12
|
+
export { createShortcutKeyDownHandler, isMacOs, isPressingMetaKey, shouldTriggerShortcut } from './utils/keyboard.js';
|
13
13
|
export { Tooltip } from './components/Tooltip/Tooltip.js';
|
14
14
|
export { Base, IconButton } from './components/IconButton/IconButton.js';
|
15
15
|
export { LocalizationContext, LocalizationProvider, defaultLocalisationTexts, defaultLocalizationContext, useLocalization } from './components/Provider/Localization.js';
|
@@ -50,23 +50,24 @@ export { Pagination } from './components/Pagination/Pagination.js';
|
|
50
50
|
export { Progress } from './components/Progress/Progress.js';
|
51
51
|
export { ToastProvider, useToast } from './components/Toast/Toaster.js';
|
52
52
|
export { Provider, TacoContext } from './components/Provider/Provider.js';
|
53
|
+
export { FontSizes, fixedForwardRef } from './types.js';
|
54
|
+
export { useLazyEffect } from './hooks/useLazyEffect.js';
|
53
55
|
export { SearchInput } from './components/SearchInput/SearchInput.js';
|
54
56
|
export { SearchInput2 } from './components/SearchInput2/SearchInput2.js';
|
57
|
+
export { Switch } from './components/Switch/Switch.js';
|
55
58
|
import * as Collection from './primitives/Collection/Collection.js';
|
56
59
|
export { Collection as CollectionPrimitive };
|
57
60
|
export { Tag } from './components/Tag/Tag.js';
|
58
|
-
export { FontSizes, fixedForwardRef } from './types.js';
|
59
61
|
export { Select2 } from './components/Select2/Select2.js';
|
60
|
-
export {
|
62
|
+
export { useMatchMedia } from './hooks/useMatchMedia.js';
|
63
|
+
export { useIsLargeScreen } from './hooks/useIsLargeScreen.js';
|
64
|
+
export { Report } from './components/Report/Report.js';
|
61
65
|
export { Table } from './components/Table/components/Table.js';
|
62
66
|
export { PaginatedTable } from './components/Table/components/PaginatedTable.js';
|
63
67
|
export { WindowedTable } from './components/Table/components/WindowedTable.js';
|
64
68
|
export { convertRowIndexPathToNumberArray, getByRowIndexPath, getParentRowIndexPath, setByRowIndexPath } from './components/Table/util/rowIndexPath.js';
|
65
69
|
export { insertChildTableRow, removeChildTableRow, useTableRowCreation } from './components/Table/hooks/useRowCreation.js';
|
66
|
-
export { useLazyEffect } from './hooks/useLazyEffect.js';
|
67
70
|
export { Textarea } from './components/Textarea/Textarea.js';
|
68
|
-
export { useMatchMedia } from './hooks/useMatchMedia.js';
|
69
|
-
export { useIsLargeScreen } from './hooks/useIsLargeScreen.js';
|
70
71
|
export { useTable3DataLoader } from './components/Table3/hooks/useTableDataLoader.js';
|
71
72
|
export { Table3 } from './components/Table3/Table3.js';
|
72
73
|
export { Tabs } from './components/Tabs/Tabs.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -11,8 +11,9 @@ const Button = /*#__PURE__*/forwardRef(function Button(props, ref) {
|
|
11
11
|
...otherProps
|
12
12
|
} = props;
|
13
13
|
const internalRef = useMergedRef(ref);
|
14
|
-
useGlobalKeyDown(shortcut,
|
14
|
+
useGlobalKeyDown(shortcut, event => {
|
15
15
|
var _internalRef$current;
|
16
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
16
17
|
const dialog = document.querySelector('[role="dialog"]');
|
17
18
|
// Don't trigger the click on the button if it is outside of the dialog
|
18
19
|
if (dialog && !(dialog !== null && dialog !== void 0 && dialog.contains(internalRef.current))) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../../../src/primitives/Button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { KeyDownHandlerOptions } from '../utils/keyboard';\nimport { useMergedRef } from '../hooks/useMergedRef';\nimport { useGlobalKeyDown } from '../hooks/useGlobalKeyDown';\n\ntype ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> & {\n /** Content should be a text */\n children: React.ReactNode;\n /** Provides url for buttons being used as a link */\n href?: string;\n shortcut?: string | KeyDownHandlerOptions;\n /** Provides target for buttons being used as a link */\n target?: '_self' | '_blank' | '_parent' | '_top';\n};\n\nconst Button = React.forwardRef(function Button(props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) {\n const { disabled, shortcut, target, type = 'button', ...otherProps } = props;\n const internalRef = useMergedRef<HTMLButtonElement | HTMLAnchorElement>(ref);\n\n useGlobalKeyDown(shortcut,
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../../../src/primitives/Button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { KeyDownHandlerOptions } from '../utils/keyboard';\nimport { useMergedRef } from '../hooks/useMergedRef';\nimport { useGlobalKeyDown } from '../hooks/useGlobalKeyDown';\n\ntype ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> & {\n /** Content should be a text */\n children: React.ReactNode;\n /** Provides url for buttons being used as a link */\n href?: string;\n shortcut?: string | KeyDownHandlerOptions;\n /** Provides target for buttons being used as a link */\n target?: '_self' | '_blank' | '_parent' | '_top';\n};\n\nconst Button = React.forwardRef(function Button(props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) {\n const { disabled, shortcut, target, type = 'button', ...otherProps } = props;\n const internalRef = useMergedRef<HTMLButtonElement | HTMLAnchorElement>(ref);\n\n useGlobalKeyDown(shortcut, event => {\n event?.preventDefault();\n const dialog = document.querySelector('[role=\"dialog\"]');\n\n // Don't trigger the click on the button if it is outside of the dialog\n if (dialog && !dialog?.contains(internalRef.current)) {\n return;\n }\n\n internalRef.current?.click();\n });\n\n const Tag = props.href ? 'a' : 'button';\n\n return (\n <Tag\n {...otherProps}\n aria-disabled={disabled ? 'true' : undefined}\n disabled={disabled}\n target={Tag === 'a' ? target : undefined}\n type={Tag !== 'a' ? type : undefined}\n ref={internalRef as any}>\n {React.Children.count(props.children) > 1\n ? React.Children.map(props.children, child => (typeof child === 'string' ? <span>{child}</span> : child))\n : props.children}\n </Tag>\n );\n});\n\nexport { Button };\nexport type { ButtonProps };\n"],"names":["Button","React","props","ref","disabled","shortcut","target","type","otherProps","internalRef","useMergedRef","useGlobalKeyDown","event","preventDefault","dialog","document","querySelector","contains","current","_internalRef$current","click","Tag","href","undefined","count","children","map","child"],"mappings":";;;;MAeMA,MAAM,gBAAGC,UAAgB,CAAC,SAASD,MAAMA,CAACE,KAAkB,EAAEC,GAAqD;EACrH,MAAM;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,IAAI,GAAG,QAAQ;IAAE,GAAGC;GAAY,GAAGN,KAAK;EAC5E,MAAMO,WAAW,GAAGC,YAAY,CAAwCP,GAAG,CAAC;EAE5EQ,gBAAgB,CAACN,QAAQ,EAAEO,KAAK;;IAC5BA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEC,cAAc,EAAE;IACvB,MAAMC,MAAM,GAAGC,QAAQ,CAACC,aAAa,CAAC,iBAAiB,CAAC;;IAGxD,IAAIF,MAAM,IAAI,EAACA,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEG,QAAQ,CAACR,WAAW,CAACS,OAAO,CAAC,GAAE;MAClD;;IAGJ,CAAAC,oBAAA,GAAAV,WAAW,CAACS,OAAO,cAAAC,oBAAA,uBAAnBA,oBAAA,CAAqBC,KAAK,EAAE;GAC/B,CAAC;EAEF,MAAMC,GAAG,GAAGnB,KAAK,CAACoB,IAAI,GAAG,GAAG,GAAG,QAAQ;EAEvC,oBACIrB,cAACoB,GAAG,oBACIb,UAAU;qBACCJ,QAAQ,GAAG,MAAM,GAAGmB,SAAS;IAC5CnB,QAAQ,EAAEA,QAAQ;IAClBE,MAAM,EAAEe,GAAG,KAAK,GAAG,GAAGf,MAAM,GAAGiB,SAAS;IACxChB,IAAI,EAAEc,GAAG,KAAK,GAAG,GAAGd,IAAI,GAAGgB,SAAS;IACpCpB,GAAG,EAAEM;MACJR,QAAc,CAACuB,KAAK,CAACtB,KAAK,CAACuB,QAAQ,CAAC,GAAG,CAAC,GACnCxB,QAAc,CAACyB,GAAG,CAACxB,KAAK,CAACuB,QAAQ,EAAEE,KAAK,IAAK,OAAOA,KAAK,KAAK,QAAQ,gBAAG1B,4BAAO0B,KAAK,CAAQ,GAAGA,KAAM,CAAC,GACvGzB,KAAK,CAACuB,QAAQ,CAClB;AAEd,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../../../../src/primitives/Table/types.ts"],"sourcesContent":["import {\n ColumnFilter as ReactTableColumnFilter,\n ColumnFiltersState as ReactTableColumnFilterState,\n ColumnOrderState as ReactTableColumnOrderState,\n ColumnPinningState as ReactTableColumnPinningState,\n ColumnSort as ReactTableColumnSort,\n ColumnSizingState as ReactTableColumnSizingState,\n GroupingState as ReactTableGroupingState,\n VisibilityState as ReactTableColumnVisibilityState,\n SortingState as ReactTableSortingState,\n BuiltInAggregationFn as ReactTableBuiltInAggregationFn,\n BuiltInSortingFn as ReactTableBuiltInSortingFn,\n HeaderContext as ReactTableHeaderContext,\n CellContext as ReactTableCellContext,\n ColumnMeta as ReactTableColumnMeta,\n} from '@tanstack/react-table';\nimport { FontSize, FontSizes, ValueOf } from '../../types';\nimport { MenuProps } from '../../components/Menu/Menu';\n\ntype TODO = any;\n\nexport type TableRef = HTMLTableElement & {\n instance: {\n resetFiltering: () => void;\n resetRowExpansion: () => void;\n resetRowSelection: () => void;\n resetSorting: () => void;\n };\n};\n\n// filtering\nexport enum TableFilterComparator {\n Contains,\n DoesNotContain,\n IsEqualTo,\n IsNotEqualTo,\n IsGreaterThan,\n IsLessThan,\n IsBetween,\n IsEmpty,\n IsNotEmpty,\n IsLessThanOrEqualTo,\n IsGreaterThanOrEqualTo,\n HasAnyOf,\n HasAllOf,\n HasNoneOf,\n}\nexport type TableFilterValue = {\n comparator: TableFilterComparator;\n value: any;\n};\nexport type TableFilter = {\n id: string;\n value: TableFilterValue;\n};\n\n// columns\nexport type TableColumnAlignment = 'left' | 'center' | 'right';\nexport type TableColumnClassNameHandler<TType = unknown> = string | ((row: TType) => string | undefined);\nexport type TableColumnDataType = 'auto' | 'number' | 'alphanumeric' | 'alphanumericCaseSensitive' | 'datetime' | 'boolean';\nexport type TableColumnFilter = ReactTableColumnFilter;\nexport type TableColumnMenu = (props: Partial<MenuProps>) => JSX.Element;\nexport type TableColumnRenderer<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;\nexport type TableColumnRendererAggregate<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;\nexport type TableColumnRendererControl<TType = unknown> =\n | ((props: TableColumnRendererControlProps, row?: TType) => JSX.Element)\n | 'datepicker'\n | 'input'\n | 'switch'\n | 'textarea';\nexport type TableColumnRendererControlProps = {\n className?: string;\n disabled?: boolean;\n fontSize?: FontSize;\n invalid?: boolean;\n onBlur?: (value: any) => void;\n onFocus?: React.FocusEventHandler;\n readOnly?: boolean;\n ref: React.RefObject<HTMLElement> | ((instance: HTMLElement | null | undefined) => void);\n setValue: (value: any) => void;\n value: any;\n};\nexport type TableColumnRendererHeader = string;\nexport type TableColumnRendererFooter<TValue> = (values: TValue[]) => JSX.Element | string | number | null;\nexport type TableColumnSort = ReactTableColumnSort;\nexport type TableColumnSortDirection = 'asc' | 'desc';\nexport type TableColumnSortFn<TType = unknown> =\n | ((rowA: TType, rowB: TType, columnId: string) => -1 | 0 | 1)\n | ReactTableBuiltInSortingFn\n | 'auto';\nexport type TableColumnWidth = number | 'grow';\n\n// rows\nexport type TableRowActionRenderer<TType = unknown> = (row: TType) => JSX.Element | null;\nexport type TableRowActionGroupRenderer<TType = unknown> = (rows: TType[]) => JSX.Element | null;\nexport type TableRowClickHandler<TType = unknown> = (row: TType) => void;\nexport type TableRowGotoHandler = (\n column: string,\n query: string,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<number>;\nexport type TableRowHeight = 'short' | 'medium' | 'tall' | 'extra-tall';\nexport type TableRowSelectHandler<TType = unknown> = (rows: TType[]) => void;\n\n// shortcuts\nexport type TableShortcutHandlerFn<TType = unknown> = (row: TType) => void;\nexport type TableShortcutHandlerObject<TType = unknown> = {\n handler: TableShortcutHandlerFn<TType>;\n meta?: boolean;\n shift?: boolean;\n};\n\n// table\nexport type TableFilterHandler = (filters: TableColumnFilter[]) => void;\nexport type TableFontSize = keyof typeof FontSizes;\nexport type TablePreset = 'lite' | 'complex';\nexport type TableRowExpansionRenderer<TType = unknown> = (row: TType) => (() => JSX.Element) | null;\nexport type TableScrollToIndexHandler = (index: number, options?: { align: 'start' | 'center' | 'end' | 'auto' }) => void;\nexport type TableServerLoadPageHandler = (\n pageIndex: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<void>;\nexport type TableServerLoadAllHandler = (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<void>;\nexport enum TableServerLoadAllState {\n Incomplete,\n Loading,\n Completed,\n}\nexport type TableSettingsHandler = (settings: TableSettings) => void | Promise<void>;\nexport type TableShortcuts<TType = unknown> = Record<string, TableShortcutHandlerFn<TType> | TableShortcutHandlerObject<TType>>;\nexport type TableSortHandler = (sorting: TableColumnSort[]) => void;\n\n// settings\nexport type TableSettings = {\n columnFilters?: ReactTableColumnFilterState;\n columnOrder?: ReactTableColumnOrderState;\n columnPinning?: ReactTableColumnPinningState;\n columnSizing?: ReactTableColumnSizingState;\n columnVisibility?: ReactTableColumnVisibilityState;\n excludeUnmatchedRecordsInSearch?: boolean;\n fontSize?: TableFontSize;\n grouping?: ReactTableGroupingState;\n rowHeight?: TableRowHeight;\n showWarningWhenPrintingLargeDataset?: boolean;\n searchQuery?: string;\n sorting?: ReactTableSortingState;\n};\n\n// props\nexport type TableFeatureProps = {\n // react-table built-in\n enableFiltering?: boolean;\n enableSearch?: boolean;\n enableSorting?: boolean;\n enableColumnFreezing?: boolean;\n enableColumnHiding?: boolean;\n enableColumnResizing?: boolean;\n enableRowExpansion?: boolean;\n enableRowSelection?: boolean;\n enableRowSelectionSingle?: boolean;\n\n // custom -- common between all table types\n enableColumnOrdering?: boolean;\n enableFontSize?: boolean;\n enableFooter?: boolean;\n enablePrinting?: boolean;\n enableRowActions?: boolean;\n enableRowActive?: boolean;\n enableRowClick?: boolean;\n enableRowGoto?: boolean;\n enableRowHeight?: boolean;\n enableSettings?: boolean;\n /*\n\n | {\n columnOrder: boolean;\n columnPinning: boolean;\n columnSizing: boolean;\n columnVisibility: boolean;\n fontSize: boolean;\n grouping: boolean;\n rowHeight: boolean;\n sorting: boolean;\n };\n */\n};\n\nexport type useTableInternalColumn<TType = unknown> = {\n header?: (info: ReactTableHeaderContext<TType, unknown>) => JSX.Element | string | null;\n renderer: (info: ReactTableCellContext<TType, unknown>) => JSX.Element | string | null;\n meta?: ReactTableColumnMeta<TType, unknown>;\n size?: number;\n};\n\nexport type useTableInternalColumns<TType = unknown> = {\n rowActions?: useTableInternalColumn<TType>;\n rowExpansion?: useTableInternalColumn<TType>;\n rowSelection?: useTableInternalColumn<TType>;\n};\n\ntype useTableCommonProps<TType = unknown> = TableFeatureProps & {\n children: (JSX.Element | boolean | null | undefined)[];\n data: TType[];\n id: string;\n\n // misc\n defaultColumnFreezingIndex?: number;\n defaultRowActiveIndex?: number;\n defaultRowGroupColumnId?: keyof TType;\n defaultSettings?: TableSettings;\n preset?: TablePreset;\n rowActions?: TableRowActionRenderer<TType>[];\n rowActionsForGroup?: TableRowActionGroupRenderer<TType>[];\n rowActionsLength?: number;\n rowExpansionRenderer?: TableRowExpansionRenderer<TType>;\n shortcuts?: TableShortcuts<TType>;\n\n // handlers\n onRowClick?: TableRowClickHandler<TType>;\n onRowGoto?: TableRowGotoHandler;\n onRowSelect?: TableRowSelectHandler<TType>;\n\n // state change handlers\n onChangeFilter?: TableFilterHandler;\n onChangeSearch?: TODO; // not currently supported\n onChangeSettings?: TableSettingsHandler;\n onChangeSort?: TableSortHandler;\n};\n\ninterface useTableClientProps<TType = unknown> extends useTableCommonProps<TType> {\n length?: never;\n loadAll?: never;\n loadPage?: never;\n pageSize?: never;\n}\n\ninterface useTableServerProps<TType = unknown> extends useTableCommonProps<TType> {\n length: number | undefined;\n loadAll: TableServerLoadAllHandler;\n loadPage: TableServerLoadPageHandler;\n pageSize?: number;\n}\n\nexport type useTableProps<TType = unknown> = useTableClientProps<TType> | useTableServerProps<TType>;\n\nexport type TableColumnProps<TType = unknown> = ValueOf<{\n [Key in keyof TType]: {\n accessor?: Key;\n id: string;\n } & {\n // renderers\n renderer?: TableColumnRenderer<TType, TType[Key]>;\n /** Renderer to use if the cell is an aggregate cell and part of a grouped row */\n aggregate?: TableColumnRendererAggregate<TType, TType[Key]>;\n control?: TableColumnRendererControl<TType>;\n footer?: TableColumnRendererFooter<TType[Key]>;\n header: TableColumnRendererHeader;\n // options\n /** Aggregation function to be used when the column is part of a grouped row */\n aggregationFn?: 'auto' | ReactTableBuiltInAggregationFn;\n align?: TableColumnAlignment;\n className?: TableColumnClassNameHandler<TType>;\n dataType?: TableColumnDataType;\n defaultHidden?: boolean;\n defaultWidth?: TableColumnWidth;\n enableFiltering?: boolean;\n enableGrouping?: boolean;\n enableHiding?: boolean;\n enableOrdering?: boolean;\n enablePrinting?: boolean;\n enableResizing?: boolean;\n enableSearch?: boolean;\n enableSorting?: boolean;\n enableTruncate?: boolean;\n filters?: TableFilterComparator[];\n headerClassName?: string;\n menu?: TableColumnMenu;\n minWidth?: number;\n sort?: TableColumnSortDirection;\n sortFn?: TableColumnSortFn<TType>;\n tooltip?: string;\n };\n}>;\n\nexport type TableGroupProps = {\n children: (JSX.Element | boolean | null | undefined)[];\n header: string;\n id: string;\n};\n"],"names":["TableFilterComparator","TableServerLoadAllState"],"mappings":"AA8BA;IACYA;AAAZ,WAAYA,qBAAqB;EAC7BA,yEAAQ;EACRA,qFAAc;EACdA,2EAAS;EACTA,iFAAY;EACZA,mFAAa;EACbA,6EAAU;EACVA,2EAAS;EACTA,uEAAO;EACPA,6EAAU;EACVA,+FAAmB;EACnBA,sGAAsB;EACtBA,0EAAQ;EACRA,0EAAQ;EACRA,4EAAS;AACb,CAAC,EAfWA,qBAAqB,KAArBA,qBAAqB;IAoGrBC;AAAZ,WAAYA,uBAAuB;EAC/BA,iFAAU;EACVA,2EAAO;EACPA,+EAAS;AACb,CAAC,EAJWA,uBAAuB,KAAvBA,uBAAuB;;;;"}
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../../../../src/primitives/Table/types.ts"],"sourcesContent":["import {\n ColumnFilter as ReactTableColumnFilter,\n ColumnFiltersState as ReactTableColumnFilterState,\n ColumnOrderState as ReactTableColumnOrderState,\n ColumnPinningState as ReactTableColumnPinningState,\n ColumnSort as ReactTableColumnSort,\n ColumnSizingState as ReactTableColumnSizingState,\n GroupingState as ReactTableGroupingState,\n VisibilityState as ReactTableColumnVisibilityState,\n SortingState as ReactTableSortingState,\n BuiltInAggregationFn as ReactTableBuiltInAggregationFn,\n BuiltInSortingFn as ReactTableBuiltInSortingFn,\n HeaderContext as ReactTableHeaderContext,\n CellContext as ReactTableCellContext,\n ColumnMeta as ReactTableColumnMeta,\n} from '@tanstack/react-table';\nimport { FontSize, FontSizes, ValueOf } from '../../types';\nimport { MenuProps } from '../../components/Menu/Menu';\n\ntype TODO = any;\n\nexport type TableRef = HTMLTableElement & {\n instance: {\n resetFiltering: () => void;\n resetRowExpansion: () => void;\n resetRowSelection: () => void;\n resetSorting: () => void;\n };\n};\n\n// filtering\nexport enum TableFilterComparator {\n Contains,\n DoesNotContain,\n IsEqualTo,\n IsNotEqualTo,\n IsGreaterThan,\n IsLessThan,\n IsBetween,\n IsEmpty,\n IsNotEmpty,\n IsLessThanOrEqualTo,\n IsGreaterThanOrEqualTo,\n HasAnyOf,\n HasAllOf,\n HasNoneOf,\n}\nexport type TableFilterValue = {\n comparator: TableFilterComparator;\n value: any;\n};\nexport type TableFilter = {\n id: string;\n value: TableFilterValue;\n};\n\n// columns\nexport type TableColumnAlignment = 'left' | 'center' | 'right';\nexport type TableColumnClassNameHandler<TType = unknown> = string | ((row: TType) => string | undefined);\nexport type TableColumnDataType = 'auto' | 'number' | 'alphanumeric' | 'alphanumericCaseSensitive' | 'datetime' | 'boolean';\nexport type TableColumnFilter = ReactTableColumnFilter;\nexport type TableColumnMenu = (props: Partial<MenuProps>) => JSX.Element;\nexport type TableColumnRenderer<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;\nexport type TableColumnRendererAggregate<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;\nexport type TableColumnRendererControl<TType = unknown> =\n | ((props: TableColumnRendererControlProps, row?: TType) => JSX.Element)\n | 'datepicker'\n | 'input'\n | 'switch'\n | 'textarea';\nexport type TableColumnRendererControlProps = {\n className?: string;\n disabled?: boolean;\n fontSize?: FontSize;\n invalid?: boolean;\n onBlur?: (value: any) => void;\n onFocus?: React.FocusEventHandler;\n readOnly?: boolean;\n ref: React.RefObject<HTMLElement> | ((instance: HTMLElement | null | undefined) => void);\n setValue: (value: any) => void;\n value: any;\n};\nexport type TableColumnRendererHeader = string;\nexport type TableColumnRendererFooter<TValue> = (values: TValue[]) => JSX.Element | string | number | null;\nexport type TableColumnSort = ReactTableColumnSort;\nexport type TableColumnSortDirection = 'asc' | 'desc';\nexport type TableColumnSortFn<TType = unknown> =\n | ((rowA: TType, rowB: TType, columnId: string) => -1 | 0 | 1)\n | ReactTableBuiltInSortingFn\n | 'auto';\nexport type TableColumnWidth = number | 'grow';\n\n// rows\nexport type TableRowActionRenderer<TType = unknown> = (row: TType) => JSX.Element | null;\nexport type TableRowActionGroupRenderer<TType = unknown> = (rows: TType[]) => JSX.Element | null;\nexport type TableRowClickHandler<TType = unknown> = (row: TType) => void;\nexport type TableRowGotoHandler = (\n column: string,\n query: string,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<number>;\nexport type TableRowHeight = 'short' | 'medium' | 'tall' | 'extra-tall';\nexport type TableRowSelectHandler<TType = unknown> = (rows: TType[]) => void;\n\n// shortcuts\nexport type TableShortcutHandlerFn<TType = unknown> = (row: TType) => void;\nexport type TableShortcutHandlerObject<TType = unknown> = {\n handler: TableShortcutHandlerFn<TType>;\n meta?: boolean;\n shift?: boolean;\n};\n\n// table\nexport type TableFilterHandler = (filters: TableColumnFilter[]) => void;\nexport type TableFontSize = keyof typeof FontSizes;\nexport type TablePreset = 'lite' | 'complex';\nexport type TableRowExpansionRenderer<TType = unknown> = (row: TType) => (() => JSX.Element) | null;\nexport type TableScrollToIndexHandler = (index: number, options?: { align: 'start' | 'center' | 'end' | 'auto' }) => void;\nexport type TableServerLoadPageHandler = (\n pageIndex: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<void>;\nexport type TableServerLoadAllHandler = (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<void>;\nexport enum TableServerLoadAllState {\n Incomplete,\n Loading,\n Completed,\n}\nexport type TableSettingsHandler = (settings: TableSettings) => void | Promise<void>;\nexport type TableShortcuts<TType = unknown> = Record<string, TableShortcutHandlerFn<TType> | TableShortcutHandlerObject<TType>>;\nexport type TableSortHandler = (sorting: TableColumnSort[]) => void;\n\n// settings\nexport type TableSettings = {\n columnFilters?: ReactTableColumnFilterState;\n columnOrder?: ReactTableColumnOrderState;\n columnPinning?: ReactTableColumnPinningState;\n columnSizing?: ReactTableColumnSizingState;\n columnVisibility?: ReactTableColumnVisibilityState;\n excludeUnmatchedRecordsInSearch?: boolean;\n fontSize?: TableFontSize;\n grouping?: ReactTableGroupingState;\n rowHeight?: TableRowHeight;\n showWarningWhenPrintingLargeDataset?: boolean;\n searchQuery?: string;\n sorting?: ReactTableSortingState;\n};\n\n// props\nexport type TableFeatureProps = {\n // react-table built-in\n enableFiltering?: boolean;\n enableSearch?: boolean;\n enableSorting?: boolean;\n enableColumnFreezing?: boolean;\n enableColumnHiding?: boolean;\n enableColumnResizing?: boolean;\n enableRowExpansion?: boolean;\n enableRowSelection?: boolean;\n enableRowSelectionSingle?: boolean;\n\n // custom -- common between all table types\n enableColumnOrdering?: boolean;\n enableFontSize?: boolean;\n enableFooter?: boolean;\n enablePrinting?: boolean;\n enableRowActions?: boolean;\n enableRowActive?: boolean;\n enableRowClick?: boolean;\n enableRowGoto?: boolean;\n enableRowHeight?: boolean;\n enableSettings?: boolean;\n /*\n\n | {\n columnOrder: boolean;\n columnPinning: boolean;\n columnSizing: boolean;\n columnVisibility: boolean;\n fontSize: boolean;\n grouping: boolean;\n rowHeight: boolean;\n sorting: boolean;\n };\n */\n};\n\nexport type useTableInternalColumn<TType = unknown> = {\n header?: (info: ReactTableHeaderContext<TType, unknown>) => JSX.Element | string | null;\n renderer: (info: ReactTableCellContext<TType, unknown>) => JSX.Element | string | null;\n meta?: ReactTableColumnMeta<TType, unknown>;\n size?: number;\n};\n\nexport type useTableInternalColumns<TType = unknown> = {\n rowActions?: useTableInternalColumn<TType>;\n rowExpansion?: useTableInternalColumn<TType>;\n rowSelection?: useTableInternalColumn<TType>;\n};\n\ntype useTableCommonProps<TType = unknown> = TableFeatureProps & {\n children: (JSX.Element | boolean | null | undefined)[];\n data: TType[];\n id: string;\n\n // misc\n defaultColumnFreezingIndex?: number;\n defaultRowActiveIndex?: number;\n defaultRowGroupColumnId?: keyof TType;\n defaultSettings?: TableSettings;\n preset?: TablePreset;\n rowActions?: TableRowActionRenderer<TType>[];\n rowActionsForGroup?: TableRowActionGroupRenderer<TType>[];\n rowActionsLength?: number;\n rowExpansionRenderer?: TableRowExpansionRenderer<TType>;\n shortcuts?: TableShortcuts<TType>;\n\n // handlers\n onRowClick?: TableRowClickHandler<TType>;\n onRowGoto?: TableRowGotoHandler;\n onRowSelect?: TableRowSelectHandler<TType>;\n\n // state change handlers\n onChangeFilter?: TableFilterHandler;\n onChangeSearch?: TODO; // not currently supported\n onChangeSettings?: TableSettingsHandler;\n onChangeSort?: TableSortHandler;\n};\n\nexport interface useTableClientProps<TType = unknown> extends useTableCommonProps<TType> {\n length?: never;\n loadAll?: never;\n loadPage?: never;\n pageSize?: never;\n}\n\nexport interface useTableServerProps<TType = unknown> extends useTableCommonProps<TType> {\n length: number | undefined;\n loadAll: TableServerLoadAllHandler;\n loadPage: TableServerLoadPageHandler;\n pageSize?: number;\n}\n\nexport type useTableProps<TType = unknown> = useTableClientProps<TType> | useTableServerProps<TType>;\n\nexport type TableColumnProps<TType = unknown> = ValueOf<{\n [Key in keyof TType]: {\n accessor?: Key;\n id: string;\n } & {\n // renderers\n renderer?: TableColumnRenderer<TType, TType[Key]>;\n /** Renderer to use if the cell is an aggregate cell and part of a grouped row */\n aggregate?: TableColumnRendererAggregate<TType, TType[Key]>;\n control?: TableColumnRendererControl<TType>;\n footer?: TableColumnRendererFooter<TType[Key]>;\n header: TableColumnRendererHeader;\n // options\n /** Aggregation function to be used when the column is part of a grouped row */\n aggregationFn?: 'auto' | ReactTableBuiltInAggregationFn;\n align?: TableColumnAlignment;\n className?: TableColumnClassNameHandler<TType>;\n dataType?: TableColumnDataType;\n defaultHidden?: boolean;\n defaultWidth?: TableColumnWidth;\n enableFiltering?: boolean;\n enableGrouping?: boolean;\n enableHiding?: boolean;\n enableOrdering?: boolean;\n enablePrinting?: boolean;\n enableResizing?: boolean;\n enableSearch?: boolean;\n enableSorting?: boolean;\n enableTruncate?: boolean;\n filters?: TableFilterComparator[];\n headerClassName?: string;\n menu?: TableColumnMenu;\n minWidth?: number;\n sort?: TableColumnSortDirection;\n sortFn?: TableColumnSortFn<TType>;\n tooltip?: string;\n };\n}>;\n\nexport type TableGroupProps = {\n children: (JSX.Element | boolean | null | undefined)[];\n header: string;\n id: string;\n};\n"],"names":["TableFilterComparator","TableServerLoadAllState"],"mappings":"AA8BA;IACYA;AAAZ,WAAYA,qBAAqB;EAC7BA,yEAAQ;EACRA,qFAAc;EACdA,2EAAS;EACTA,iFAAY;EACZA,mFAAa;EACbA,6EAAU;EACVA,2EAAS;EACTA,uEAAO;EACPA,6EAAU;EACVA,+FAAmB;EACnBA,sGAAsB;EACtBA,0EAAQ;EACRA,0EAAQ;EACRA,4EAAS;AACb,CAAC,EAfWA,qBAAqB,KAArBA,qBAAqB;IAoGrBC;AAAZ,WAAYA,uBAAuB;EAC/BA,iFAAU;EACVA,2EAAO;EACPA,+EAAS;AACb,CAAC,EAJWA,uBAAuB,KAAvBA,uBAAuB;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnFreezing.js
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
|
3
|
+
/* column freezing uses the native column pinning feature, this hook is really just a container for scrolled state */
|
4
|
+
function useTableColumnFreezing(isEnabled = false) {
|
5
|
+
const [isHorizontallyScrolled, setHorizontallyScrolled] = React__default.useState(false);
|
6
|
+
const handleScroll = event => {
|
7
|
+
if (event.currentTarget.scrollLeft > 0 && !isHorizontallyScrolled) {
|
8
|
+
setHorizontallyScrolled(true);
|
9
|
+
} else if (event.currentTarget.scrollLeft === 0 && isHorizontallyScrolled) {
|
10
|
+
setHorizontallyScrolled(false);
|
11
|
+
}
|
12
|
+
};
|
13
|
+
return {
|
14
|
+
isEnabled,
|
15
|
+
isHorizontallyScrolled,
|
16
|
+
handleScroll
|
17
|
+
};
|
18
|
+
}
|
19
|
+
|
20
|
+
export { useTableColumnFreezing };
|
21
|
+
//# sourceMappingURL=useTableColumnFreezing.js.map
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnFreezing.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useTableColumnFreezing.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableColumnFreezing.ts"],"sourcesContent":["import React from 'react';\n\n/* column freezing uses the native column pinning feature, this hook is really just a container for scrolled state */\nexport function useTableColumnFreezing(isEnabled = false) {\n const [isHorizontallyScrolled, setHorizontallyScrolled] = React.useState(false);\n\n const handleScroll = (event: React.MouseEvent<HTMLTableElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !isHorizontallyScrolled) {\n setHorizontallyScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && isHorizontallyScrolled) {\n setHorizontallyScrolled(false);\n }\n };\n\n return {\n isEnabled,\n isHorizontallyScrolled,\n handleScroll,\n };\n}\n"],"names":["useTableColumnFreezing","isEnabled","isHorizontallyScrolled","setHorizontallyScrolled","React","useState","handleScroll","event","currentTarget","scrollLeft"],"mappings":";;AAEA;SACgBA,sBAAsBA,CAACC,SAAS,GAAG,KAAK;EACpD,MAAM,CAACC,sBAAsB,EAAEC,uBAAuB,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;EAE/E,MAAMC,YAAY,GAAIC,KAAyC;IAC3D,IAAIA,KAAK,CAACC,aAAa,CAACC,UAAU,GAAG,CAAC,IAAI,CAACP,sBAAsB,EAAE;MAC/DC,uBAAuB,CAAC,IAAI,CAAC;KAChC,MAAM,IAAII,KAAK,CAACC,aAAa,CAACC,UAAU,KAAK,CAAC,IAAIP,sBAAsB,EAAE;MACvEC,uBAAuB,CAAC,KAAK,CAAC;;GAErC;EAED,OAAO;IACHF,SAAS;IACTC,sBAAsB;IACtBI;GACH;AACL;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useTableFooter.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableFooter.ts"],"sourcesContent":["export function useTableFooter(isEnabled = false) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableFooter","isEnabled"],"mappings":"SAAgBA,cAAcA,CAACC,SAAS,GAAG,KAAK;EAC5C,OAAO;IACHA;GACH;AACL;;;;"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
|
3
|
+
function useTablePrinting(isEnabled = false, defaultIsWarningVisible = true) {
|
4
|
+
const [isPrinting, setIsPrinting] = React__default.useState(false);
|
5
|
+
const [isWarningVisibleForLargeDatasets, setIsWarningVisibleForLargeDatasets] = React__default.useState(defaultIsWarningVisible);
|
6
|
+
return {
|
7
|
+
isEnabled,
|
8
|
+
isPrinting,
|
9
|
+
setIsPrinting,
|
10
|
+
isWarningVisibleForLargeDatasets,
|
11
|
+
setIsWarningVisibleForLargeDatasets: isEnabled ? setIsWarningVisibleForLargeDatasets : () => undefined
|
12
|
+
};
|
13
|
+
}
|
14
|
+
|
15
|
+
export { useTablePrinting };
|
16
|
+
//# sourceMappingURL=useTablePrinting.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useTablePrinting.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTablePrinting.ts"],"sourcesContent":["import React from 'react';\n\nexport function useTablePrinting(isEnabled = false, defaultIsWarningVisible = true) {\n const [isPrinting, setIsPrinting] = React.useState(false);\n const [isWarningVisibleForLargeDatasets, setIsWarningVisibleForLargeDatasets] = React.useState(defaultIsWarningVisible);\n\n return {\n isEnabled,\n isPrinting,\n setIsPrinting,\n isWarningVisibleForLargeDatasets,\n setIsWarningVisibleForLargeDatasets: isEnabled ? setIsWarningVisibleForLargeDatasets : () => undefined,\n };\n}\n"],"names":["useTablePrinting","isEnabled","defaultIsWarningVisible","isPrinting","setIsPrinting","React","useState","isWarningVisibleForLargeDatasets","setIsWarningVisibleForLargeDatasets","undefined"],"mappings":";;SAEgBA,gBAAgBA,CAACC,SAAS,GAAG,KAAK,EAAEC,uBAAuB,GAAG,IAAI;EAC9E,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;EACzD,MAAM,CAACC,gCAAgC,EAAEC,mCAAmC,CAAC,GAAGH,cAAK,CAACC,QAAQ,CAACJ,uBAAuB,CAAC;EAEvH,OAAO;IACHD,SAAS;IACTE,UAAU;IACVC,aAAa;IACbG,gCAAgC;IAChCC,mCAAmC,EAAEP,SAAS,GAAGO,mCAAmC,GAAG,MAAMC;GAChG;AACL;;;;"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
|
3
|
+
function useTableRef(table, ref) {
|
4
|
+
React__default.useEffect(() => {
|
5
|
+
if (ref.current) {
|
6
|
+
ref.current.instance = {
|
7
|
+
resetFiltering: () => table.resetColumnFilters(),
|
8
|
+
resetRowExpansion: () => table.resetExpanded(),
|
9
|
+
resetRowSelection: () => table.resetRowSelection(),
|
10
|
+
resetSorting: () => table.resetSorting()
|
11
|
+
};
|
12
|
+
}
|
13
|
+
}, [table, ref.current]);
|
14
|
+
}
|
15
|
+
|
16
|
+
export { useTableRef };
|
17
|
+
//# sourceMappingURL=useTableRef.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useTableRef.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRef.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable } from '@tanstack/react-table';\nimport { TableRef } from '../../types';\n\nexport function useTableRef<TType = unknown>(table: ReactTable<TType>, ref: React.RefObject<TableRef>) {\n React.useEffect(() => {\n if (ref.current) {\n ref.current.instance = {\n resetFiltering: () => table.resetColumnFilters(),\n resetRowExpansion: () => table.resetExpanded(),\n resetRowSelection: () => table.resetRowSelection(),\n resetSorting: () => table.resetSorting(),\n };\n }\n }, [table, ref.current]);\n}\n"],"names":["useTableRef","table","ref","React","useEffect","current","instance","resetFiltering","resetColumnFilters","resetRowExpansion","resetExpanded","resetRowSelection","resetSorting"],"mappings":";;SAIgBA,WAAWA,CAAkBC,KAAwB,EAAEC,GAA8B;EACjGC,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIF,GAAG,CAACG,OAAO,EAAE;MACbH,GAAG,CAACG,OAAO,CAACC,QAAQ,GAAG;QACnBC,cAAc,EAAEA,MAAMN,KAAK,CAACO,kBAAkB,EAAE;QAChDC,iBAAiB,EAAEA,MAAMR,KAAK,CAACS,aAAa,EAAE;QAC9CC,iBAAiB,EAAEA,MAAMV,KAAK,CAACU,iBAAiB,EAAE;QAClDC,YAAY,EAAEA,MAAMX,KAAK,CAACW,YAAY;OACzC;;GAER,EAAE,CAACX,KAAK,EAAEC,GAAG,CAACG,OAAO,CAAC,CAAC;AAC5B;;;;"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
const DEFAULT_ROW_ACTIONS_LENGTH = 4;
|
2
|
+
function useTableRowActions(isEnabled = false, rowActions, rowActionsLength = DEFAULT_ROW_ACTIONS_LENGTH) {
|
3
|
+
return {
|
4
|
+
isEnabled,
|
5
|
+
rowActions: isEnabled ? rowActions : undefined,
|
6
|
+
rowActionsLength: rowActions ? Math.min(rowActions.length, rowActionsLength) : 0
|
7
|
+
};
|
8
|
+
}
|
9
|
+
|
10
|
+
export { useTableRowActions };
|
11
|
+
//# sourceMappingURL=useTableRowActions.js.map
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActions.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useTableRowActions.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowActions.ts"],"sourcesContent":["import { TableRowActionRenderer } from '../../types';\n\nconst DEFAULT_ROW_ACTIONS_LENGTH = 4;\n\nexport function useTableRowActions<TType = unknown>(\n isEnabled = false,\n rowActions?: TableRowActionRenderer<TType>[],\n rowActionsLength = DEFAULT_ROW_ACTIONS_LENGTH\n) {\n return {\n isEnabled,\n rowActions: isEnabled ? rowActions : undefined,\n rowActionsLength: rowActions ? Math.min(rowActions.length, rowActionsLength) : 0,\n };\n}\n"],"names":["DEFAULT_ROW_ACTIONS_LENGTH","useTableRowActions","isEnabled","rowActions","rowActionsLength","undefined","Math","min","length"],"mappings":"AAEA,MAAMA,0BAA0B,GAAG,CAAC;SAEpBC,kBAAkBA,CAC9BC,SAAS,GAAG,KAAK,EACjBC,UAA4C,EAC5CC,gBAAgB,GAAGJ,0BAA0B;EAE7C,OAAO;IACHE,SAAS;IACTC,UAAU,EAAED,SAAS,GAAGC,UAAU,GAAGE,SAAS;IAC9CD,gBAAgB,EAAED,UAAU,GAAGG,IAAI,CAACC,GAAG,CAACJ,UAAU,CAACK,MAAM,EAAEJ,gBAAgB,CAAC,GAAG;GAClF;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowExpansion.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useTableRowExpansion.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowExpansion.ts"],"sourcesContent":["import { TableRowExpansionRenderer } from '../../types';\n\nexport function useTableRowExpansion<TType = unknown>(\n isEnabled = false,\n rowExpansionRenderer?: TableRowExpansionRenderer<TType>\n) {\n return {\n isEnabled,\n rowExpansionRenderer: isEnabled ? rowExpansionRenderer : undefined,\n };\n}\n"],"names":["useTableRowExpansion","isEnabled","rowExpansionRenderer","undefined"],"mappings":"SAEgBA,oBAAoBA,CAChCC,SAAS,GAAG,KAAK,EACjBC,oBAAuD;EAEvD,OAAO;IACHD,SAAS;IACTC,oBAAoB,EAAED,SAAS,GAAGC,oBAAoB,GAAGC;GAC5D;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGroups.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useTableRowGroups.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowGroups.ts"],"sourcesContent":["import { TableRowActionGroupRenderer } from '../../types';\n\nexport function useTableRowGroups<TType = unknown>(rowActionsForGroup?: TableRowActionGroupRenderer<TType>[]) {\n return {\n isEnabled: true,\n rowActionsForGroup,\n };\n}\n"],"names":["useTableRowGroups","rowActionsForGroup","isEnabled"],"mappings":"SAEgBA,iBAAiBA,CAAkBC,kBAAyD;EACxG,OAAO;IACHC,SAAS,EAAE,IAAI;IACfD;GACH;AACL;;;;"}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
|
3
|
+
/*
|
4
|
+
Search has two behaviours:
|
5
|
+
- Highlighting search results, this is custom and only uses the state part of globalFilter (to store the search query)
|
6
|
+
- Filtering of results, this is essentially the built in filtering, and relies on enableGlobalFilter being on or off
|
7
|
+
*/
|
8
|
+
function useTableSearch(isEnabled = false, defaultEnableGlobalFilter = false) {
|
9
|
+
const [enableGlobalFilter, _setEnableGlobalFilter] = React__default.useState(defaultEnableGlobalFilter);
|
10
|
+
function setEnableGlobalFilter(enabled, instance) {
|
11
|
+
_setEnableGlobalFilter(enabled);
|
12
|
+
// react-table doesn't re-render when options.enableGlobalFilter changes, so for now we force it
|
13
|
+
const currentFilter = instance.getState().globalFilter;
|
14
|
+
if (currentFilter) {
|
15
|
+
setTimeout(() => {
|
16
|
+
instance.setGlobalFilter('');
|
17
|
+
instance.setGlobalFilter(currentFilter);
|
18
|
+
}, 1);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
// highlighting
|
22
|
+
const [highlightedColumnIndexes, setHighlightedColumnIndexes] = React__default.useState([]);
|
23
|
+
const [currentHighlightColumnIndex, setCurrentHighlightColumnIndex] = React__default.useState(undefined);
|
24
|
+
return {
|
25
|
+
isEnabled,
|
26
|
+
// filtering - built-in
|
27
|
+
enableGlobalFilter,
|
28
|
+
setEnableGlobalFilter,
|
29
|
+
// highlighting - custom
|
30
|
+
highlightedColumnIndexes,
|
31
|
+
setHighlightedColumnIndexes,
|
32
|
+
currentHighlightColumnIndex,
|
33
|
+
setCurrentHighlightColumnIndex
|
34
|
+
};
|
35
|
+
}
|
36
|
+
|
37
|
+
export { useTableSearch };
|
38
|
+
//# sourceMappingURL=useTableSearch.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useTableSearch.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableSearch.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable } from '@tanstack/react-table';\n\n/*\n Search has two behaviours:\n - Highlighting search results, this is custom and only uses the state part of globalFilter (to store the search query)\n - Filtering of results, this is essentially the built in filtering, and relies on enableGlobalFilter being on or off\n*/\nexport function useTableSearch(isEnabled = false, defaultEnableGlobalFilter = false) {\n const [enableGlobalFilter, _setEnableGlobalFilter] = React.useState<boolean>(defaultEnableGlobalFilter);\n\n function setEnableGlobalFilter<TType = unknown>(enabled: boolean, instance: ReactTable<TType>) {\n _setEnableGlobalFilter(enabled);\n\n // react-table doesn't re-render when options.enableGlobalFilter changes, so for now we force it\n const currentFilter = instance.getState().globalFilter;\n\n if (currentFilter) {\n setTimeout(() => {\n instance.setGlobalFilter('');\n instance.setGlobalFilter(currentFilter);\n }, 1);\n }\n }\n\n // highlighting\n const [highlightedColumnIndexes, setHighlightedColumnIndexes] = React.useState<number[][]>([]);\n const [currentHighlightColumnIndex, setCurrentHighlightColumnIndex] = React.useState<number | undefined>(undefined);\n\n return {\n isEnabled,\n // filtering - built-in\n enableGlobalFilter,\n setEnableGlobalFilter,\n // highlighting - custom\n highlightedColumnIndexes,\n setHighlightedColumnIndexes,\n currentHighlightColumnIndex,\n setCurrentHighlightColumnIndex,\n };\n}\n"],"names":["useTableSearch","isEnabled","defaultEnableGlobalFilter","enableGlobalFilter","_setEnableGlobalFilter","React","useState","setEnableGlobalFilter","enabled","instance","currentFilter","getState","globalFilter","setTimeout","setGlobalFilter","highlightedColumnIndexes","setHighlightedColumnIndexes","currentHighlightColumnIndex","setCurrentHighlightColumnIndex","undefined"],"mappings":";;AAGA;;;;;SAKgBA,cAAcA,CAACC,SAAS,GAAG,KAAK,EAAEC,yBAAyB,GAAG,KAAK;EAC/E,MAAM,CAACC,kBAAkB,EAAEC,sBAAsB,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAUJ,yBAAyB,CAAC;EAEvG,SAASK,qBAAqBA,CAAkBC,OAAgB,EAAEC,QAA2B;IACzFL,sBAAsB,CAACI,OAAO,CAAC;;IAG/B,MAAME,aAAa,GAAGD,QAAQ,CAACE,QAAQ,EAAE,CAACC,YAAY;IAEtD,IAAIF,aAAa,EAAE;MACfG,UAAU,CAAC;QACPJ,QAAQ,CAACK,eAAe,CAAC,EAAE,CAAC;QAC5BL,QAAQ,CAACK,eAAe,CAACJ,aAAa,CAAC;OAC1C,EAAE,CAAC,CAAC;;;;EAKb,MAAM,CAACK,wBAAwB,EAAEC,2BAA2B,CAAC,GAAGX,cAAK,CAACC,QAAQ,CAAa,EAAE,CAAC;EAC9F,MAAM,CAACW,2BAA2B,EAAEC,8BAA8B,CAAC,GAAGb,cAAK,CAACC,QAAQ,CAAqBa,SAAS,CAAC;EAEnH,OAAO;IACHlB,SAAS;;IAETE,kBAAkB;IAClBI,qBAAqB;;IAErBQ,wBAAwB;IACxBC,2BAA2B;IAC3BC,2BAA2B;IAC3BC;GACH;AACL;;;;"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import { useLocalStorage } from '../../../../hooks/useLocalStorage.js';
|
3
|
+
import { useTacoSettings } from '../../../../hooks/useTacoSettings.js';
|
4
|
+
|
5
|
+
function useUniqueTableId(tableId) {
|
6
|
+
const tacoSettings = useTacoSettings();
|
7
|
+
return `taco.${tacoSettings.uniqueUserIdentifier}.table.${tableId}.settings`;
|
8
|
+
}
|
9
|
+
function useTableSettings(isEnabled = false, id, defaultSettings = {}, onChangeSettings) {
|
10
|
+
const uniqueId = useUniqueTableId(id);
|
11
|
+
const [persistedSettings, _setPersistedSettings] = useLocalStorage(isEnabled ? uniqueId : undefined, defaultSettings);
|
12
|
+
const setPersistedSettings = React__default.useCallback(value => {
|
13
|
+
if (!isEnabled) {
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
_setPersistedSettings(value);
|
17
|
+
if (typeof onChangeSettings === 'function') {
|
18
|
+
onChangeSettings(value);
|
19
|
+
}
|
20
|
+
}, [isEnabled, onChangeSettings]);
|
21
|
+
if (!isEnabled) {
|
22
|
+
return [defaultSettings, () => undefined];
|
23
|
+
}
|
24
|
+
return [persistedSettings, setPersistedSettings];
|
25
|
+
}
|
26
|
+
|
27
|
+
export { useTableSettings, useUniqueTableId };
|
28
|
+
//# sourceMappingURL=useTableSettings.js.map
|