@economic/taco 2.23.0 → 2.25.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/components/Provider/Localization.d.ts +6 -0
- package/dist/components/Report/Report.d.ts +2 -2
- package/dist/components/Report/components/Body/Body.d.ts +0 -1
- package/dist/components/Report/components/Footer/Summary.d.ts +0 -1
- package/dist/components/Report/components/Header/Header.d.ts +3 -0
- package/dist/components/Report/components/Header/components/Menu.d.ts +3 -0
- package/dist/components/Report/components/Toolbar/components/Filters/components/Filter.d.ts +2 -2
- package/dist/components/Report/components/Toolbar/components/Filters/components/FilterColumn.d.ts +5 -2
- package/dist/components/Report/components/Toolbar/components/Filters/util.d.ts +2 -0
- package/dist/components/Report/types.d.ts +2 -2
- package/dist/components/Report/useReport.d.ts +0 -1
- package/dist/components/Select2/Select2.d.ts +22 -0
- package/dist/components/Select2/hooks/useChildren.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/components/BaseTable.d.ts +1 -1
- package/dist/components/Table/hooks/useRowCreation.d.ts +2 -2
- package/dist/components/Table/hooks/useTable.d.ts +5 -5
- package/dist/components/Table/hooks/useTableKeyboardNavigation.d.ts +2 -2
- package/dist/components/Table/types.d.ts +37 -37
- package/dist/components/Table/util/sortTypes.d.ts +2 -2
- package/dist/components/Table/util.d.ts +4 -4
- package/dist/components/Table3/components/toolbar/Filter/filters/components/Filter.d.ts +2 -2
- package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.d.ts +5 -2
- package/dist/components/Table3/hooks/useTable.d.ts +8 -8
- package/dist/components/Table3/types.d.ts +2 -0
- package/dist/esm/index.css +55 -46
- package/dist/esm/packages/taco/src/components/Button/util.js +8 -8
- package/dist/esm/packages/taco/src/components/Button/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Card/Card.js +2 -1
- package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js +11 -2
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js +12 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +7 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/Report.js +3 -8
- package/dist/esm/packages/taco/src/components/Report/Report.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Body/Body.js +4 -3
- package/dist/esm/packages/taco/src/components/Report/components/Body/Body.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Cell/Cell.js +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Cell/GroupedCell.js +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Cell/GroupedCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Cell/util.js +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Cell/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Footer.js +14 -2
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Summary.js +3 -3
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Summary.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/Header.js +18 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Menu.js +10 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/util.js +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Header/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Selection.js +47 -11
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Selection.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/Filters.js +13 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/ManageFiltersPopover.js +44 -51
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Filter.js +14 -7
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Filter.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterColumn.js +4 -3
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterValue.js +11 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/util.js +4 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/Print.js +10 -8
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/Print.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.js +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/Settings.js +1 -1
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/Settings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/listeners/useTableRowActiveListener.js +2 -2
- package/dist/esm/packages/taco/src/components/Report/listeners/useTableRowActiveListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/styles/useCssGridStylesheet.js +8 -5
- package/dist/esm/packages/taco/src/components/Report/styles/useCssGridStylesheet.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/useReport.js +3 -3
- package/dist/esm/packages/taco/src/components/Report/useReport.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/util/useTableGlobalShortcuts.js +3 -10
- package/dist/esm/packages/taco/src/components/Report/util/useTableGlobalShortcuts.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +2 -1
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +43 -4
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/PaginatedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useRowCreation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/sortTypes.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +4 -6
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Summary.js +1 -1
- 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/internal/Selection.js +66 -14
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +27 -44
- 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/Filter.js +14 -7
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js +4 -3
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js +1 -1
- 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 +2 -0
- 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 +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 +3 -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 +26 -19
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useLocalStorage.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Button.js +1 -0
- 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/useTableManager/features/useTableColumnFreezing.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnOrdering.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFooter.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js +36 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRef.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActions.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowClick.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGoto.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGroups.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowHeight.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableSettings.js +1 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableDataListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/listeners/useTableSettingsListener.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSortingListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/{useTable/useTable.js → useTableManager/useTableManager.js} +10 -8
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/util/columns.js +33 -7
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/util/settings.js +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js.map +1 -0
- package/dist/esm/packages/taco/src/utils/dom.js +12 -3
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/keyboard.js +2 -2
- package/dist/esm/packages/taco/src/utils/keyboard.js.map +1 -1
- package/dist/hooks/useLocalStorage.d.ts +2 -1
- package/dist/index.css +55 -46
- package/dist/primitives/Table/types.d.ts +5 -18
- package/dist/primitives/Table/useTableManager/features/useTablePrinting.d.ts +15 -0
- package/dist/primitives/Table/useTableManager/types.d.ts +13 -0
- package/dist/primitives/Table/{useTable/useTable.d.ts → useTableManager/useTableManager.d.ts} +4 -3
- package/dist/primitives/Table/useTableManager/util/presets.d.ts +2 -0
- package/dist/primitives/Table/{useTable → useTableManager}/util/settings.d.ts +0 -1
- package/dist/primitives/Table/{useTable → useTableManager}/util/setup.d.ts +5 -4
- package/dist/taco.cjs.development.js +603 -408
- 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 +3 -1
- package/package.json +2 -2
- package/types.json +10314 -9345
- package/dist/components/Report/components/Toolbar/components/Filters/components/Placeholder.d.ts +0 -12
- package/dist/components/Table3/components/toolbar/Filter/filters/components/Placeholder.d.ts +0 -12
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Placeholder.js +0 -41
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Placeholder.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.js +0 -41
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnFreezing.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFontSize.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFooter.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js +0 -16
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRef.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActions.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowClick.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowExpansion.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGroups.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowHeight.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSearch.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSettings.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableDataListener.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFilterListener.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableRowHeightListener.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableRowSelectionListener.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSearchListener.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableServerLoadingListener.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSettingsListener.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableShortcutsListener.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSortingListener.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/useTable.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/filtering.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/presets.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/search.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/settings.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/setup.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/sorting.js.map +0 -1
- package/dist/primitives/Table/useTable/features/useTablePrinting.d.ts +0 -8
- package/dist/primitives/Table/useTable/util/presets.d.ts +0 -2
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableColumnFreezing.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableColumnOrdering.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableFontSize.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableFooter.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableRef.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableRowActions.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableRowActive.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableRowClick.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableRowExpansion.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableRowGoto.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableRowGroups.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableRowHeight.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableRowSelection.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableSearch.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/features/useTableServerLoading.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/listeners/useTableDataListener.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/listeners/useTableFilterListener.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/listeners/useTableFontSizeListener.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/listeners/useTableRowHeightListener.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/listeners/useTableRowSelectionListener.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/listeners/useTableSearchListener.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/listeners/useTableServerLoadingListener.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/listeners/useTableShortcutsListener.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/listeners/useTableSortingListener.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/util/filtering.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/util/presets.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/util/search.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/util/setup.js +0 -0
- /package/dist/esm/packages/taco/src/primitives/Table/{useTable → useTableManager}/util/sorting.js +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableColumnFreezing.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableColumnOrdering.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableFontSize.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableFooter.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableRef.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableRowActions.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableRowActive.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableRowClick.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableRowExpansion.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableRowGoto.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableRowGroups.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableRowHeight.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableRowSelection.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableSearch.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableServerLoading.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/features/useTableSettings.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/listeners/useTableDataListener.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/listeners/useTableFilterListener.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/listeners/useTableFontSizeListener.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/listeners/useTableRowHeightListener.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/listeners/useTableRowSelectionListener.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/listeners/useTableSearchListener.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/listeners/useTableServerLoadingListener.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/listeners/useTableSettingsListener.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/listeners/useTableShortcutsListener.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/listeners/useTableSortingListener.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/util/columns.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/util/columns.spec.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/util/filtering.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/util/search.d.ts +0 -0
- /package/dist/primitives/Table/{useTable → useTableManager}/util/sorting.d.ts +0 -0
package/dist/components/Report/components/Toolbar/components/Filters/components/Placeholder.d.ts
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { Column as ReactTableColumn } from '@tanstack/react-table';
|
3
|
-
import { Select2Value } from '../../../../../../Select2/Select2';
|
4
|
-
import { TableFilter } from '../../../../../types';
|
5
|
-
export declare type PlaceholderFilterProps<TType = unknown> = {
|
6
|
-
allColumns: ReactTableColumn<TType, unknown>[];
|
7
|
-
filters: TableFilter[];
|
8
|
-
onCreate?: (value: Select2Value) => void;
|
9
|
-
onRemove?: () => void;
|
10
|
-
position: number;
|
11
|
-
};
|
12
|
-
export declare function Placeholder<TType = unknown>(props: PlaceholderFilterProps<TType>): JSX.Element;
|
package/dist/components/Table3/components/toolbar/Filter/filters/components/Placeholder.d.ts
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { Column as RTColumn } from '@tanstack/react-table';
|
3
|
-
import { Select2Value } from '../../../../../../Select2/Select2';
|
4
|
-
import { Table3Filter } from '../../../../../types';
|
5
|
-
export declare type PlaceholderFilterProps<TType = unknown> = {
|
6
|
-
allColumns: RTColumn<TType, unknown>[];
|
7
|
-
filters: Table3Filter[];
|
8
|
-
position: number;
|
9
|
-
onCreate?: (value: Select2Value) => void;
|
10
|
-
onRemove?: () => void;
|
11
|
-
};
|
12
|
-
export declare function Placeholder<TType = unknown>(props: PlaceholderFilterProps<TType>): JSX.Element;
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import { IconButton } from '../../../../../../IconButton/IconButton.js';
|
3
|
-
import { useLocalization } from '../../../../../../Provider/Localization.js';
|
4
|
-
import { Input } from '../../../../../../Input/Input.js';
|
5
|
-
import { FilterColumn } from './FilterColumn.js';
|
6
|
-
import { FilterComparator } from './FilterComparator.js';
|
7
|
-
|
8
|
-
function Placeholder(props) {
|
9
|
-
const {
|
10
|
-
allColumns,
|
11
|
-
filters,
|
12
|
-
onCreate: handleCreate,
|
13
|
-
onRemove: handleRemove,
|
14
|
-
position
|
15
|
-
} = props;
|
16
|
-
const {
|
17
|
-
texts
|
18
|
-
} = useLocalization();
|
19
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
20
|
-
className: "flex items-start gap-2"
|
21
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
22
|
-
className: "flex min-h-[theme(spacing.8)] w-14 flex-shrink-0 items-center justify-end pr-2 text-right"
|
23
|
-
}, position > 0 ? texts.table3.filters.conditions.and : texts.table3.filters.conditions.where), /*#__PURE__*/React__default.createElement(FilterColumn, {
|
24
|
-
allColumns: allColumns,
|
25
|
-
filters: filters,
|
26
|
-
onChange: handleCreate,
|
27
|
-
value: null
|
28
|
-
}), /*#__PURE__*/React__default.createElement(FilterComparator, null), /*#__PURE__*/React__default.createElement(Input, {
|
29
|
-
"aria-label": texts.table3.filters.emptyFilter.value,
|
30
|
-
className: "flex-grow",
|
31
|
-
disabled: true,
|
32
|
-
value: texts.table3.filters.emptyFilter.value
|
33
|
-
}), handleRemove ? /*#__PURE__*/React__default.createElement(IconButton, {
|
34
|
-
appearance: "discrete",
|
35
|
-
icon: "close",
|
36
|
-
onClick: handleRemove
|
37
|
-
}) : null);
|
38
|
-
}
|
39
|
-
|
40
|
-
export { Placeholder };
|
41
|
-
//# sourceMappingURL=Placeholder.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Placeholder.js","sources":["../../../../../../../../../../../../src/components/Report/components/Toolbar/components/Filters/components/Placeholder.tsx"],"sourcesContent":["import React from 'react';\nimport { Column as ReactTableColumn } from '@tanstack/react-table';\nimport { Select2Value } from '../../../../../../Select2/Select2';\nimport { useLocalization } from '../../../../../../Provider/Localization';\nimport { Input } from '../../../../../../Input/Input';\nimport { IconButton } from '../../../../../../IconButton/IconButton';\nimport { FilterColumn } from './FilterColumn';\nimport { FilterComparator } from './FilterComparator';\nimport { TableFilter } from '../../../../../types';\n\nexport type PlaceholderFilterProps<TType = unknown> = {\n allColumns: ReactTableColumn<TType, unknown>[];\n filters: TableFilter[];\n onCreate?: (value: Select2Value) => void;\n onRemove?: () => void;\n position: number;\n};\n\nexport function Placeholder<TType = unknown>(props: PlaceholderFilterProps<TType>) {\n const { allColumns, filters, onCreate: handleCreate, onRemove: handleRemove, position } = props;\n const { texts } = useLocalization();\n\n return (\n <div className=\"flex items-start gap-2\">\n <div className=\"flex min-h-[theme(spacing.8)] w-14 flex-shrink-0 items-center justify-end pr-2 text-right\">\n {position > 0 ? texts.table3.filters.conditions.and : texts.table3.filters.conditions.where}\n </div>\n <FilterColumn allColumns={allColumns} filters={filters} onChange={handleCreate} value={null} />\n <FilterComparator />\n <Input\n aria-label={texts.table3.filters.emptyFilter.value}\n className=\"flex-grow\"\n disabled\n value={texts.table3.filters.emptyFilter.value}\n />\n {handleRemove ? <IconButton appearance=\"discrete\" icon=\"close\" onClick={handleRemove} /> : null}\n </div>\n );\n}\n"],"names":["Placeholder","props","allColumns","filters","onCreate","handleCreate","onRemove","handleRemove","position","texts","useLocalization","React","className","table3","conditions","and","where","FilterColumn","onChange","value","FilterComparator","Input","emptyFilter","disabled","IconButton","appearance","icon","onClick"],"mappings":";;;;;;;SAkBgBA,WAAWA,CAAkBC,KAAoC;EAC7E,MAAM;IAAEC,UAAU;IAAEC,OAAO;IAAEC,QAAQ,EAAEC,YAAY;IAAEC,QAAQ,EAAEC,YAAY;IAAEC;GAAU,GAAGP,KAAK;EAC/F,MAAM;IAAEQ;GAAO,GAAGC,eAAe,EAAE;EAEnC,oBACIC;IAAKC,SAAS,EAAC;kBACXD;IAAKC,SAAS,EAAC;KACVJ,QAAQ,GAAG,CAAC,GAAGC,KAAK,CAACI,MAAM,CAACV,OAAO,CAACW,UAAU,CAACC,GAAG,GAAGN,KAAK,CAACI,MAAM,CAACV,OAAO,CAACW,UAAU,CAACE,KAAK,CACzF,eACNL,6BAACM,YAAY;IAACf,UAAU,EAAEA,UAAU;IAAEC,OAAO,EAAEA,OAAO;IAAEe,QAAQ,EAAEb,YAAY;IAAEc,KAAK,EAAE;IAAQ,eAC/FR,6BAACS,gBAAgB,OAAG,eACpBT,6BAACU,KAAK;kBACUZ,KAAK,CAACI,MAAM,CAACV,OAAO,CAACmB,WAAW,CAACH,KAAK;IAClDP,SAAS,EAAC,WAAW;IACrBW,QAAQ;IACRJ,KAAK,EAAEV,KAAK,CAACI,MAAM,CAACV,OAAO,CAACmB,WAAW,CAACH;IAC1C,EACDZ,YAAY,gBAAGI,6BAACa,UAAU;IAACC,UAAU,EAAC,UAAU;IAACC,IAAI,EAAC,OAAO;IAACC,OAAO,EAAEpB;IAAgB,GAAG,IAAI,CAC7F;AAEd;;;;"}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import { IconButton } from '../../../../../../IconButton/IconButton.js';
|
3
|
-
import { useLocalization } from '../../../../../../Provider/Localization.js';
|
4
|
-
import { Input } from '../../../../../../Input/Input.js';
|
5
|
-
import { FilterColumn } from './FilterColumn.js';
|
6
|
-
import { FilterComparator } from './FilterComparator.js';
|
7
|
-
|
8
|
-
function Placeholder(props) {
|
9
|
-
const {
|
10
|
-
allColumns,
|
11
|
-
filters,
|
12
|
-
onCreate: handleCreate,
|
13
|
-
onRemove: handleRemove,
|
14
|
-
position
|
15
|
-
} = props;
|
16
|
-
const {
|
17
|
-
texts
|
18
|
-
} = useLocalization();
|
19
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
20
|
-
className: "flex items-start gap-2"
|
21
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
22
|
-
className: "flex min-h-[theme(spacing.8)] w-14 flex-shrink-0 items-center justify-end pr-2 text-right"
|
23
|
-
}, position > 0 ? texts.table3.filters.conditions.and : texts.table3.filters.conditions.where), /*#__PURE__*/React__default.createElement(FilterColumn, {
|
24
|
-
allColumns: allColumns,
|
25
|
-
filters: filters,
|
26
|
-
onChange: handleCreate,
|
27
|
-
value: null
|
28
|
-
}), /*#__PURE__*/React__default.createElement(FilterComparator, null), /*#__PURE__*/React__default.createElement(Input, {
|
29
|
-
"aria-label": texts.table3.filters.emptyFilter.value,
|
30
|
-
className: "flex-grow",
|
31
|
-
disabled: true,
|
32
|
-
value: texts.table3.filters.emptyFilter.value
|
33
|
-
}), handleRemove ? /*#__PURE__*/React__default.createElement(IconButton, {
|
34
|
-
appearance: "discrete",
|
35
|
-
icon: "close",
|
36
|
-
onClick: handleRemove
|
37
|
-
}) : null);
|
38
|
-
}
|
39
|
-
|
40
|
-
export { Placeholder };
|
41
|
-
//# sourceMappingURL=Placeholder.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Placeholder.js","sources":["../../../../../../../../../../../../src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.tsx"],"sourcesContent":["import React from 'react';\nimport { Column as RTColumn } from '@tanstack/react-table';\nimport { Select2Value } from '../../../../../../Select2/Select2';\nimport { useLocalization } from '../../../../../../Provider/Localization';\nimport { Input } from '../../../../../../Input/Input';\nimport { IconButton } from '../../../../../../IconButton/IconButton';\nimport { FilterColumn } from './FilterColumn';\nimport { FilterComparator } from './FilterComparator';\nimport { Table3Filter } from '../../../../../types';\n\nexport type PlaceholderFilterProps<TType = unknown> = {\n allColumns: RTColumn<TType, unknown>[];\n filters: Table3Filter[];\n position: number;\n onCreate?: (value: Select2Value) => void;\n onRemove?: () => void;\n};\n\nexport function Placeholder<TType = unknown>(props: PlaceholderFilterProps<TType>) {\n const { allColumns, filters, onCreate: handleCreate, onRemove: handleRemove, position } = props;\n const { texts } = useLocalization();\n\n return (\n <div className=\"flex items-start gap-2\">\n <div className=\"flex min-h-[theme(spacing.8)] w-14 flex-shrink-0 items-center justify-end pr-2 text-right\">\n {position > 0 ? texts.table3.filters.conditions.and : texts.table3.filters.conditions.where}\n </div>\n <FilterColumn allColumns={allColumns} filters={filters} onChange={handleCreate} value={null} />\n <FilterComparator />\n <Input\n aria-label={texts.table3.filters.emptyFilter.value}\n className=\"flex-grow\"\n disabled\n value={texts.table3.filters.emptyFilter.value}\n />\n {handleRemove ? <IconButton appearance=\"discrete\" icon=\"close\" onClick={handleRemove} /> : null}\n </div>\n );\n}\n"],"names":["Placeholder","props","allColumns","filters","onCreate","handleCreate","onRemove","handleRemove","position","texts","useLocalization","React","className","table3","conditions","and","where","FilterColumn","onChange","value","FilterComparator","Input","emptyFilter","disabled","IconButton","appearance","icon","onClick"],"mappings":";;;;;;;SAkBgBA,WAAWA,CAAkBC,KAAoC;EAC7E,MAAM;IAAEC,UAAU;IAAEC,OAAO;IAAEC,QAAQ,EAAEC,YAAY;IAAEC,QAAQ,EAAEC,YAAY;IAAEC;GAAU,GAAGP,KAAK;EAC/F,MAAM;IAAEQ;GAAO,GAAGC,eAAe,EAAE;EAEnC,oBACIC;IAAKC,SAAS,EAAC;kBACXD;IAAKC,SAAS,EAAC;KACVJ,QAAQ,GAAG,CAAC,GAAGC,KAAK,CAACI,MAAM,CAACV,OAAO,CAACW,UAAU,CAACC,GAAG,GAAGN,KAAK,CAACI,MAAM,CAACV,OAAO,CAACW,UAAU,CAACE,KAAK,CACzF,eACNL,6BAACM,YAAY;IAACf,UAAU,EAAEA,UAAU;IAAEC,OAAO,EAAEA,OAAO;IAAEe,QAAQ,EAAEb,YAAY;IAAEc,KAAK,EAAE;IAAQ,eAC/FR,6BAACS,gBAAgB,OAAG,eACpBT,6BAACU,KAAK;kBACUZ,KAAK,CAACI,MAAM,CAACV,OAAO,CAACmB,WAAW,CAACH,KAAK;IAClDP,SAAS,EAAC,WAAW;IACrBW,QAAQ;IACRJ,KAAK,EAAEV,KAAK,CAACI,MAAM,CAACV,OAAO,CAACmB,WAAW,CAACH;IAC1C,EACDZ,YAAY,gBAAGI,6BAACa,UAAU;IAACC,UAAU,EAAC,UAAU;IAACC,IAAI,EAAC,OAAO;IAACC,OAAO,EAAEpB;IAAgB,GAAG,IAAI,CAC7F;AAEd;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnFreezing.js.map
DELETED
@@ -1 +0,0 @@
|
|
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;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableColumnOrdering.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableColumnOrdering.ts"],"sourcesContent":["export function useTableColumnOrdering(isEnabled = false) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableColumnOrdering","isEnabled"],"mappings":"SAAgBA,sBAAsBA,CAACC,SAAS,GAAG,KAAK;EACpD,OAAO;IACHA;GACH;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFontSize.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableFontSize.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableFontSize.ts"],"sourcesContent":["import React from 'react';\nimport { FontSize } from '../../../../types';\n\nexport function useTableFontSize(isEnabled = false, defaultFontSize: FontSize = 'medium') {\n const [size, setSize] = React.useState<FontSize>(defaultFontSize);\n\n return {\n isEnabled,\n size,\n setSize: isEnabled ? setSize : () => undefined,\n };\n}\n"],"names":["useTableFontSize","isEnabled","defaultFontSize","size","setSize","React","useState","undefined"],"mappings":";;SAGgBA,gBAAgBA,CAACC,SAAS,GAAG,KAAK,EAAEC,kBAA4B,QAAQ;EACpF,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAWJ,eAAe,CAAC;EAEjE,OAAO;IACHD,SAAS;IACTE,IAAI;IACJC,OAAO,EAAEH,SAAS,GAAGG,OAAO,GAAG,MAAMG;GACxC;AACL;;;;"}
|
@@ -1 +0,0 @@
|
|
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;;;;"}
|
@@ -1,16 +0,0 @@
|
|
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
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js.map
DELETED
@@ -1 +0,0 @@
|
|
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;;;;"}
|
@@ -1 +0,0 @@
|
|
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;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActions.js.map
DELETED
@@ -1 +0,0 @@
|
|
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/useTableRowActive.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableRowActive.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowActive.ts"],"sourcesContent":["import React from 'react';\nimport { TableRef, TableScrollToIndexHandler } from '../../types';\nimport { useIsHoverStatePaused } from '../../../../hooks/useIsHoverStatePaused';\nimport { isElementInsideOrTriggeredFromContainer } from '../../../../utils/dom';\n\nfunction focusFirstElementInActiveRow(tableRef: React.RefObject<TableRef>) {\n const selector = '[data-taco=\"table2-body\"] [role=\"row\"] [role=\"cell\"]:first-child';\n\n setTimeout(() => {\n (tableRef.current?.querySelector(selector) as HTMLElement)?.focus();\n }, 1);\n}\n\nexport function useTableRowActive(isEnabled = false, initialRowActiveIndex?: number) {\n const [rowActiveIndex, setRowActiveIndex] = React.useState<number | undefined>(initialRowActiveIndex);\n const [isHoverStatePaused, setHoverStatePaused] = useIsHoverStatePaused();\n\n const move = (direction: -1 | 1, length: number, scrollToIndex: TableScrollToIndexHandler) =>\n setRowActiveIndex(currentIndex => {\n const nextIndex = currentIndex !== undefined ? getNextIndex(direction, currentIndex, length) : 0;\n setTimeout(() => scrollToIndex(nextIndex), 1);\n return nextIndex;\n });\n\n const onKeyDown = React.useCallback(\n (\n event: KeyboardEvent,\n length: number,\n scrollToIndex: TableScrollToIndexHandler,\n tableRef?: React.RefObject<TableRef>\n ) => {\n if (!isEnabled || event.defaultPrevented) {\n return;\n }\n\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n setHoverStatePaused(true);\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n const newIndex = 0;\n setRowActiveIndex(newIndex);\n scrollToIndex(newIndex);\n } else {\n move(-1, length, scrollToIndex);\n }\n\n if (tableRef) {\n focusFirstElementInActiveRow(tableRef);\n }\n\n return;\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n const newIndex = length - 1;\n setRowActiveIndex(newIndex);\n scrollToIndex(newIndex);\n } else {\n move(+1, length, scrollToIndex);\n }\n\n if (tableRef) {\n focusFirstElementInActiveRow(tableRef);\n }\n\n return;\n }\n },\n [isEnabled]\n );\n\n const onFocus = React.useCallback(\n (event: React.FocusEvent, length: number, scrollToIndex: TableScrollToIndexHandler) => {\n if (!isEnabled || event.isDefaultPrevented()) {\n return;\n }\n\n if (\n event.target.closest('tbody') ||\n event.target.closest('[data-taco=\"table2-body\"]') ||\n isElementInsideOrTriggeredFromContainer(event.target, event.currentTarget)\n ) {\n return;\n }\n\n if (rowActiveIndex === undefined && length > 0) {\n setRowActiveIndex(index => {\n if (index === undefined) {\n scrollToIndex(0);\n return 0;\n }\n return index;\n });\n }\n },\n [rowActiveIndex, length, isEnabled]\n );\n\n return {\n isEnabled,\n rowActiveIndex,\n setRowActiveIndex: isEnabled ? setRowActiveIndex : () => undefined,\n isHoverStatePaused,\n setHoverStatePaused: isEnabled ? setHoverStatePaused : () => undefined,\n handleFocus: isEnabled ? onFocus : () => undefined,\n handleKeyDown: isEnabled ? onKeyDown : () => undefined,\n };\n}\n\nfunction getNextIndex(direction: -1 | 1, currentIndex: number, length: number) {\n if (direction === -1) {\n return currentIndex - 1 > 0 ? currentIndex - 1 : 0;\n }\n\n return currentIndex + 1 < length ? currentIndex + 1 : currentIndex;\n}\n"],"names":["focusFirstElementInActiveRow","tableRef","selector","setTimeout","_tableRef$current","current","_tableRef$current$que","querySelector","focus","useTableRowActive","isEnabled","initialRowActiveIndex","rowActiveIndex","setRowActiveIndex","React","useState","isHoverStatePaused","setHoverStatePaused","useIsHoverStatePaused","move","direction","length","scrollToIndex","currentIndex","nextIndex","undefined","getNextIndex","onKeyDown","useCallback","event","defaultPrevented","key","preventDefault","ctrlKey","metaKey","newIndex","onFocus","isDefaultPrevented","target","closest","isElementInsideOrTriggeredFromContainer","currentTarget","index","handleFocus","handleKeyDown"],"mappings":";;;;AAKA,SAASA,4BAA4BA,CAACC,QAAmC;EACrE,MAAMC,QAAQ,GAAG,kEAAkE;EAEnFC,UAAU,CAAC;;IACN,CAAAC,iBAAA,GAAAH,QAAQ,CAACI,OAAO,cAAAD,iBAAA,wBAAAE,qBAAA,GAAhBF,iBAAA,CAAkBG,aAAa,CAACL,QAAQ,CAAiB,cAAAI,qBAAA,uBAAzDA,qBAAA,CAA2DE,KAAK,EAAE;GACtE,EAAE,CAAC,CAAC;AACT;SAEgBC,iBAAiBA,CAACC,SAAS,GAAG,KAAK,EAAEC,qBAA8B;EAC/E,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAqBJ,qBAAqB,CAAC;EACrG,MAAM,CAACK,kBAAkB,EAAEC,mBAAmB,CAAC,GAAGC,qBAAqB,EAAE;EAEzE,MAAMC,IAAI,GAAGA,CAACC,SAAiB,EAAEC,MAAc,EAAEC,aAAwC,KACrFT,iBAAiB,CAACU,YAAY;IAC1B,MAAMC,SAAS,GAAGD,YAAY,KAAKE,SAAS,GAAGC,YAAY,CAACN,SAAS,EAAEG,YAAY,EAAEF,MAAM,CAAC,GAAG,CAAC;IAChGlB,UAAU,C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Y;AACtE;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowClick.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableRowClick.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowClick.ts"],"sourcesContent":["import React from 'react';\nimport { TableRowClickHandler } from '../../types';\n\nexport function useTableRowClick<TType = unknown>(isEnabled = false, onRowClick?: TableRowClickHandler<TType>) {\n const handleKeyDown = React.useCallback(\n function (event: KeyboardEvent, data: TType) {\n if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {\n return;\n }\n\n if (data && event.key === 'Enter') {\n event.preventDefault();\n onRowClick(data);\n return;\n }\n },\n [isEnabled, onRowClick]\n ) as <TType = unknown>(event: KeyboardEvent, data: TType) => void;\n\n const handleClick = React.useCallback(\n function (event: React.MouseEvent<HTMLTableRowElement>, data: TType) {\n if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {\n return;\n }\n\n event.preventDefault();\n onRowClick(data);\n return;\n },\n [isEnabled, onRowClick]\n );\n\n return {\n isEnabled,\n handleClick,\n handleKeyDown,\n };\n}\n"],"names":["useTableRowClick","isEnabled","onRowClick","handleKeyDown","React","useCallback","event","data","defaultPrevented","key","preventDefault","handleClick"],"mappings":";;SAGgBA,gBAAgBA,CAAkBC,SAAS,GAAG,KAAK,EAAEC,UAAwC;EACzG,MAAMC,aAAa,GAAGC,cAAK,CAACC,WAAW,CACnC,UAAUC,KAAoB,EAAEC,IAAW;IACvC,IAAI,CAACN,SAAS,IAAI,OAAOC,UAAU,KAAK,UAAU,IAAII,KAAK,CAACE,gBAAgB,EAAE;MAC1E;;IAGJ,IAAID,IAAI,IAAID,KAAK,CAACG,GAAG,KAAK,OAAO,EAAE;MAC/BH,KAAK,CAACI,cAAc,EAAE;MACtBR,UAAU,CAACK,IAAI,CAAC;MAChB;;GAEP,EACD,CAACN,SAAS,EAAEC,UAAU,CAAC,CACsC;EAEjE,MAAMS,WAAW,GAAGP,cAAK,CAACC,WAAW,CACjC,UAAUC,KAA4C,EAAEC,IAAW;IAC/D,IAAI,CAACN,SAAS,IAAI,OAAOC,UAAU,KAAK,UAAU,IAAII,KAAK,CAACE,gBAAgB,EAAE;MAC1E;;IAGJF,KAAK,CAACI,cAAc,EAAE;IACtBR,UAAU,CAACK,IAAI,CAAC;IAChB;GACH,EACD,CAACN,SAAS,EAAEC,UAAU,CAAC,CAC1B;EAED,OAAO;IACHD,SAAS;IACTU,WAAW;IACXR;GACH;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowExpansion.js.map
DELETED
@@ -1 +0,0 @@
|
|
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/useTableRowGoto.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableRowGoto.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowGoto.ts"],"sourcesContent":["import { TableRowGotoHandler } from '../../types';\n\nexport function useTableRowGoto(isEnabled = false, handler?: TableRowGotoHandler) {\n return {\n isEnabled,\n handleGoto: isEnabled ? handler : undefined,\n };\n}\n"],"names":["useTableRowGoto","isEnabled","handler","handleGoto","undefined"],"mappings":"SAEgBA,eAAeA,CAACC,SAAS,GAAG,KAAK,EAAEC,OAA6B;EAC5E,OAAO;IACHD,SAAS;IACTE,UAAU,EAAEF,SAAS,GAAGC,OAAO,GAAGE;GACrC;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGroups.js.map
DELETED
@@ -1 +0,0 @@
|
|
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;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowHeight.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableRowHeight.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowHeight.ts"],"sourcesContent":["import React from 'react';\nimport { TableRowHeight } from '../../types';\n\nexport function useTableRowHeight(isEnabled = false, defaultRowHeight: TableRowHeight = 'medium') {\n const [height, setHeight] = React.useState<TableRowHeight>(defaultRowHeight);\n\n return {\n isEnabled,\n height,\n setHeight: isEnabled ? setHeight : () => undefined,\n };\n}\n"],"names":["useTableRowHeight","isEnabled","defaultRowHeight","height","setHeight","React","useState","undefined"],"mappings":";;SAGgBA,iBAAiBA,CAACC,SAAS,GAAG,KAAK,EAAEC,mBAAmC,QAAQ;EAC5F,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAiBJ,gBAAgB,CAAC;EAE5E,OAAO;IACHD,SAAS;IACTE,MAAM;IACNC,SAAS,EAAEH,SAAS,GAAGG,SAAS,GAAG,MAAMG;GAC5C;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableRowSelection.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowSelection.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\n\nexport function useTableRowSelection(isEnabled = false) {\n const lastSelectedRowIndex = React.useRef<number>();\n\n const onKeyDown = React.useCallback(\n <TType = unknown>(event: KeyboardEvent, table: ReactTable<TType>) => {\n if (!isEnabled || !table.options.enableRowSelection || event.defaultPrevented) {\n return;\n }\n\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n\n if (event.key === ' ') {\n event.preventDefault();\n const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;\n\n if (rowActiveIndex !== undefined) {\n rows[rowActiveIndex]?.toggleSelected();\n }\n\n return;\n } else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {\n event.preventDefault();\n table.toggleAllRowsSelected();\n return;\n }\n },\n [isEnabled]\n ) as <TType = unknown>(event: KeyboardEvent, table: ReactTable<TType>) => void;\n\n return {\n isEnabled,\n handleKeyDown: isEnabled ? onKeyDown : () => undefined,\n lastSelectedRowIndex,\n };\n}\n"],"names":["useTableRowSelection","isEnabled","lastSelectedRowIndex","React","useRef","onKeyDown","useCallback","event","table","options","enableRowSelection","defaultPrevented","rows","getRowModel","tableMeta","meta","key","preventDefault","rowActiveIndex","rowActive","undefined","_rows$rowActiveIndex","toggleSelected","ctrlKey","metaKey","toggleAllRowsSelected","handleKeyDown"],"mappings":";;SAGgBA,oBAAoBA,CAACC,SAAS,GAAG,KAAK;EAClD,MAAMC,oBAAoB,GAAGC,cAAK,CAACC,MAAM,EAAU;EAEnD,MAAMC,SAAS,GAAGF,cAAK,CAACG,WAAW,CAC/B,CAAkBC,KAAoB,EAAEC,KAAwB;IAC5D,IAAI,CAACP,SAAS,IAAI,CAACO,KAAK,CAACC,OAAO,CAACC,kBAAkB,IAAIH,KAAK,CAACI,gBAAgB,EAAE;MAC3E;;IAGJ,MAAMC,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;IACrC,MAAME,SAAS,GAAGN,KAAK,CAACC,OAAO,CAACM,IAA6B;IAE7D,IAAIR,KAAK,CAACS,GAAG,KAAK,GAAG,EAAE;MACnBT,KAAK,CAACU,cAAc,EAAE;MACtB,MAAMC,cAAc,GAAGJ,SAAS,CAACK,SAAS,CAACD,cAAc;MAEzD,IAAIA,cAAc,KAAKE,SAAS,EAAE;QAAA,IAAAC,oBAAA;QAC9B,CAAAA,oBAAA,GAAAT,IAAI,CAACM,cAAc,CAAC,cAAAG,oBAAA,uBAApBA,oBAAA,CAAsBC,cAAc,EAAE;;MAG1C;KACH,MAAM,IAAI,CAACf,KAAK,CAACgB,OAAO,IAAIhB,KAAK,CAACiB,OAAO,KAAKjB,KAAK,CAACS,GAAG,KAAK,GAAG,EAAE;MAC9DT,KAAK,CAACU,cAAc,EAAE;MACtBT,KAAK,CAACiB,qBAAqB,EAAE;MAC7B;;GAEP,EACD,CAACxB,SAAS,CAAC,CAC+D;EAE9E,OAAO;IACHA,SAAS;IACTyB,aAAa,EAAEzB,SAAS,GAAGI,SAAS,GAAG,MAAMe,SAAS;IACtDlB;GACH;AACL;;;;"}
|
@@ -1 +0,0 @@
|
|
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;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableServerLoading.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableServerLoading.ts"],"sourcesContent":["import React from 'react';\nimport { TableServerLoadAllHandler, TableServerLoadAllState, TableServerLoadPageHandler } from '../../types';\nimport { DEFAULT_PAGE_SIZE } from '../../useTableDataLoader';\n\nexport function useTableServerLoading(\n loadPage?: TableServerLoadPageHandler,\n loadAll?: TableServerLoadAllHandler,\n pageSize = DEFAULT_PAGE_SIZE\n) {\n const isEnabled = !!loadPage && !!loadAll;\n const [loadAllStatus, setLoadedStatus] = React.useState<TableServerLoadAllState>(TableServerLoadAllState.Incomplete);\n\n let _loadAll: TableServerLoadAllHandler | undefined;\n let _loadAllIfNeeded: TableServerLoadAllHandler | undefined;\n\n if (typeof loadAll === 'function') {\n _loadAll = async (...args) => {\n if (typeof loadAll === 'function') {\n setLoadedStatus(TableServerLoadAllState.Loading);\n await loadAll(...args);\n setLoadedStatus(TableServerLoadAllState.Completed);\n }\n };\n\n _loadAllIfNeeded = async (...args) => {\n if (loadAllStatus === TableServerLoadAllState.Incomplete) {\n await _loadAll?.(...args);\n }\n };\n }\n\n return {\n isEnabled,\n loadPage,\n loadAll: _loadAll,\n loadAllIfNeeded: _loadAllIfNeeded,\n loadAllStatus,\n pageSize,\n };\n}\n"],"names":["useTableServerLoading","loadPage","loadAll","pageSize","DEFAULT_PAGE_SIZE","isEnabled","loadAllStatus","setLoadedStatus","React","useState","TableServerLoadAllState","Incomplete","_loadAll","_loadAllIfNeeded","args","Loading","Promise","resolve","then","Completed","_temp","e","reject","_loadAll2","_temp2","loadAllIfNeeded"],"mappings":";;;;SAIgBA,qBAAqBA,CACjCC,QAAqC,EACrCC,OAAmC,EACnCC,QAAQ,GAAGC,iBAAiB;EAE5B,MAAMC,SAAS,GAAG,CAAC,CAACJ,QAAQ,IAAI,CAAC,CAACC,OAAO;EACzC,MAAM,CAACI,aAAa,EAAEC,eAAe,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAA0BC,uBAAuB,CAACC,UAAU,CAAC;EAEpH,IAAIC,QAA+C;EACnD,IAAIC,gBAAuD;EAE3D,IAAI,OAAOX,OAAO,KAAK,UAAU,EAAE;IAC/BU,QAAQ,aAAU,GAAGE,IAAI;MAAA;;cACjB,OAAOZ,OAAO,KAAK,UAAU;YAC7BK,eAAe,CAACG,uBAAuB,CAACK,OAAO,CAAC;YAAC,OAAAC,OAAA,CAAAC,OAAA,CAC3Cf,OAAO,CAAC,GAAGY,IAAI,CAAC,EAAAI,IAAA;cACtBX,eAAe,CAACG,uBAAuB,CAACS,SAAS,CAAC;;;;QAAC,OAAAH,OAAA,CAAAC,OAAA,CAAAG,KAAA,IAAAA,KAAA,CAAAF,IAAA,GAAAE,KAAA,CAAAF,IAAA;OAE1D,QAAAG,CAAA;QAAA,OAAAL,OAAA,CAAAM,MAAA,CAAAD,CAAA;;;IAEDR,gBAAgB,aAAU,GAAGC,IAAI;MAAA;;cACzBR,aAAa,KAAKI,uBAAuB,CAACC,UAAU;YAAA,IAAAY,SAAA;YAAA,OAAAP,OAAA,CAAAC,OAAA,EAAAM,SAAA,GAC9CX,QAAQ,cAAAW,SAAA,uBAARA,SAAA,CAAW,GAAGT,IAAI,CAAC,EAAAI,IAAA;;;QAAA,OAAAF,OAAA,CAAAC,OAAA,CAAAO,MAAA,IAAAA,MAAA,CAAAN,IAAA,GAAAM,MAAA,CAAAN,IAAA;OAEhC,QAAAG,CAAA;QAAA,OAAAL,OAAA,CAAAM,MAAA,CAAAD,CAAA;;;;EAGL,OAAO;IACHhB,SAAS;IACTJ,QAAQ;IACRC,OAAO,EAAEU,QAAQ;IACjBa,eAAe,EAAEZ,gBAAgB;IACjCP,aAAa;IACbH;GACH;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSettings.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableSettings.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableSettings.ts"],"sourcesContent":["import React from 'react';\nimport { useLocalStorage } from '../../../../hooks/useLocalStorage';\nimport { useTacoSettings } from '../../../../hooks/useTacoSettings';\nimport { EnableSettingsOptions, TableSettings, TableSettingsHandler } from '../../types';\n\nconst DEFAULT_ENABLED_OPTIONS = {\n columnOrder: true,\n columnPinning: true,\n columnSizing: true,\n columnVisibility: true,\n excludeUnmatchedRecordsInSearch: true,\n fontSize: true,\n grouping: true,\n rowHeight: true,\n showWarningWhenPrintingLargeDataset: true,\n sorting: true,\n};\n\nexport function useUniqueTableId(tableId: string) {\n const tacoSettings = useTacoSettings();\n return `taco.${tacoSettings.uniqueUserIdentifier}.table.${tableId}.settings`;\n}\n\nfunction useEnabledSettings(isEnabled: boolean | Partial<EnableSettingsOptions>): [EnableSettingsOptions, boolean] {\n return React.useMemo(() => {\n if (isEnabled === false) {\n return [\n Object.keys(DEFAULT_ENABLED_OPTIONS).reduce((o, key) => ({ ...o, [key]: false }), {}) as EnableSettingsOptions,\n false,\n ];\n } else if (isEnabled === true) {\n return [DEFAULT_ENABLED_OPTIONS, true];\n }\n\n const options = { ...DEFAULT_ENABLED_OPTIONS, ...isEnabled };\n return [options, Object.values(options).some(o => o === true)];\n }, [isEnabled]);\n}\n\nexport function useTableSettings(\n isEnabled: boolean | Partial<EnableSettingsOptions> = false,\n id: string,\n defaultSettings: TableSettings | undefined = {},\n onChangeSettings: TableSettingsHandler | undefined\n): [TableSettings, TableSettingsHandler] {\n const uniqueId = useUniqueTableId(id);\n const [enabledSettings, hasSomeEnabledSettings] = useEnabledSettings(isEnabled);\n\n const [persistedSettings, _setPersistedSettings] = useLocalStorage<TableSettings>(\n hasSomeEnabledSettings ? uniqueId : undefined,\n removeDisabledSettings(defaultSettings, enabledSettings)\n );\n\n const setPersistedSettings = React.useCallback(\n (value: TableSettings) => {\n if (!hasSomeEnabledSettings) {\n return;\n }\n\n const sanitizedSettings = removeDisabledSettings(value, enabledSettings);\n _setPersistedSettings(sanitizedSettings);\n\n if (typeof onChangeSettings === 'function') {\n onChangeSettings(sanitizedSettings);\n }\n },\n [hasSomeEnabledSettings, onChangeSettings, JSON.stringify(enabledSettings)]\n );\n\n if (!hasSomeEnabledSettings) {\n return [defaultSettings, () => undefined];\n }\n\n return [persistedSettings, setPersistedSettings];\n}\n\nfunction removeDisabledSettings(settings: TableSettings, enabledSettings: EnableSettingsOptions) {\n const sanitizedSettings: TableSettings = { ...settings };\n\n Object.keys(enabledSettings).forEach(setting => {\n if (!enabledSettings[setting]) {\n delete sanitizedSettings[setting];\n }\n });\n\n return sanitizedSettings;\n}\n"],"names":["DEFAULT_ENABLED_OPTIONS","columnOrder","columnPinning","columnSizing","columnVisibility","excludeUnmatchedRecordsInSearch","fontSize","grouping","rowHeight","showWarningWhenPrintingLargeDataset","sorting","useUniqueTableId","tableId","tacoSettings","useTacoSettings","uniqueUserIdentifier","useEnabledSettings","isEnabled","React","useMemo","Object","keys","reduce","o","key","options","values","some","useTableSettings","id","defaultSettings","onChangeSettings","uniqueId","enabledSettings","hasSomeEnabledSettings","persistedSettings","_setPersistedSettings","useLocalStorage","undefined","removeDisabledSettings","setPersistedSettings","useCallback","value","sanitizedSettings","JSON","stringify","settings","forEach","setting"],"mappings":";;;;AAKA,MAAMA,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C,GAAGlB,kBAAkB,CAACC,SAAS,CAAC;EAE/E,MAAM,CAACkB,iBAAiB,EAAEC,qBAAqB,CAAC,GAAGC,eAAe,CAC9DH,sBAAsB,GAAGF,QAAQ,GAAGM,SAAS,EAC7CC,sBAAsB,CAACT,eAAe,EAAEG,eAAe,CAAC,CAC3D;EAED,MAAMO,oBAAoB,GAAGtB,cAAK,CAACuB,WAAW,CACzCC,KAAoB;IACjB,IAAI,CAACR,sBAAsB,EAAE;MACzB;;IAGJ,MAAMS,iBAAiB,GAAGJ,sBAAsB,CAACG,KAAK,EAAET,eAAe,CAAC;IACxEG,qBAAqB,CAACO,iBAAiB,CAAC;IAExC,IAAI,OAAOZ,gBAAgB,KAAK,UAAU,EAAE;MACxCA,gBAAgB,CAACY,iBAAiB,CAAC;;GAE1C,EACD,CAACT,sBAAsB,EAAEH,gBAAgB,EAAEa,IAAI,CAACC,SAAS,CAACZ,eAAe,CAAC,CAAC,CAC9E;EAED,IAAI,CAACC,sBAAsB,EAAE;IACzB,OAAO,CAACJ,eAAe,EAAE,MAAMQ,SAAS,CAAC;;EAG7C,OAAO,CAACH,iBAAiB,EAAEK,oBAAoB,CAAC;AACpD;AAEA,SAASD,sBAAsBA,CAACO,QAAuB,EAAEb,eAAsC;EAC3F,MAAMU,iBAAiB,GAAkB;IAAE,GAAGG;GAAU;EAExD1B,MAAM,CAACC,IAAI,CAACY,eAAe,CAAC,CAACc,OAAO,CAACC,OAAO;IACxC,IAAI,CAACf,eAAe,CAACe,OAAO,CAAC,EAAE;MAC3B,OAAOL,iBAAiB,CAACK,OAAO,CAAC;;GAExC,CAAC;EAEF,OAAOL,iBAAiB;AAC5B;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableDataListener.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableDataListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableDataListener.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\n\nexport function useTableDataListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n useLazyEffect(() => {\n const rowActiveIndex = meta.rowActive.rowActiveIndex;\n\n if (rowActiveIndex !== undefined && rowActiveIndex > rows.length) {\n meta.rowActive.setRowActiveIndex(0);\n }\n }, [rows.length]);\n}\n"],"names":["useTableDataListener","table","meta","options","rows","getRowModel","useLazyEffect","rowActiveIndex","rowActive","undefined","length","setRowActiveIndex"],"mappings":";;SAGgBA,oBAAoBA,CAAkBC,KAAwB;EAC1E,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EACxD,MAAME,IAAI,GAAGH,KAAK,CAACI,WAAW,EAAE,CAACD,IAAI;EAErCE,aAAa,CAAC;IACV,MAAMC,cAAc,GAAGL,IAAI,CAACM,SAAS,CAACD,cAAc;IAEpD,IAAIA,cAAc,KAAKE,SAAS,IAAIF,cAAc,GAAGH,IAAI,CAACM,MAAM,EAAE;MAC9DR,IAAI,CAACM,SAAS,CAACG,iBAAiB,CAAC,CAAC,CAAC;;GAE1C,EAAE,CAACP,IAAI,CAACM,MAAM,CAAC,CAAC;AACrB;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFilterListener.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableFilterListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableFilterListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableFilterHandler } from '../../types';\n\n// we use a listener, and not the internal \"controlled\" change handlers because we don't actually want consumers\n// to control the state outside the table. this listener is really here to let the consumer make a server request\n// and provide the server with the filtering state, so that it can filter server side\nexport function useTableFilterListener<TType = unknown>(table: ReactTable<TType>, onFilter?: TableFilterHandler) {\n const columnFilters = table.getState().columnFilters;\n\n useLazyEffect(() => {\n if (table.options.enableColumnFilters && typeof onFilter === 'function') {\n onFilter(columnFilters);\n\n if (table.options.enableRowSelection) {\n table.resetRowSelection();\n }\n }\n }, [table.options.enableColumnFilters, columnFilters]);\n}\n"],"names":["useTableFilterListener","table","onFilter","columnFilters","getState","useLazyEffect","options","enableColumnFilters","enableRowSelection","resetRowSelection"],"mappings":";;AAIA;AACA;AACA;SACgBA,sBAAsBA,CAAkBC,KAAwB,EAAEC,QAA6B;EAC3G,MAAMC,aAAa,GAAGF,KAAK,CAACG,QAAQ,EAAE,CAACD,aAAa;EAEpDE,aAAa,CAAC;IACV,IAAIJ,KAAK,CAACK,OAAO,CAACC,mBAAmB,IAAI,OAAOL,QAAQ,KAAK,UAAU,EAAE;MACrEA,QAAQ,CAACC,aAAa,CAAC;MAEvB,IAAIF,KAAK,CAACK,OAAO,CAACE,kBAAkB,EAAE;QAClCP,KAAK,CAACQ,iBAAiB,EAAE;;;GAGpC,EAAE,CAACR,KAAK,CAACK,OAAO,CAACC,mBAAmB,EAAEJ,aAAa,CAAC,CAAC;AAC1D;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableFontSizeListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableFontSizeListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { FontSizes } from '../../../../types';\nimport { getCellMinWidth } from '../util/columns';\n\nexport function useTableFontSizeListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const previousFontSizeRef = React.useRef(meta.fontSize.size);\n\n useLazyEffect(() => {\n const cellWidthDifference = getCellWidthDifference(`${previousFontSizeRef.current}-${meta.fontSize.size}`);\n\n table.setColumnSizing(sizes => {\n const minColumnSize = getCellMinWidth(meta.fontSize.size);\n\n return Object.fromEntries(\n Object.entries(sizes).map(([columnName, prevColumnSize]) => {\n // Prevents width value in the setting to go below the minColumnSize\n const newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);\n return [columnName, newSize];\n })\n );\n });\n previousFontSizeRef.current = meta.fontSize.size;\n }, [meta.fontSize.size]);\n}\n\nfunction getCellWidthDifference(fontSizeKey: string) {\n switch (fontSizeKey) {\n case `${FontSizes.small}-${FontSizes.medium}`:\n case `${FontSizes.medium}-${FontSizes.large}`:\n return 8;\n\n case `${FontSizes.medium}-${FontSizes.small}`:\n case `${FontSizes.large}-${FontSizes.medium}`:\n return -8;\n\n case `${FontSizes.small}-${FontSizes.large}`:\n return 16;\n\n case `${FontSizes.large}-${FontSizes.small}`:\n return -16;\n\n default:\n return 0;\n }\n}\n"],"names":["useTableFontSizeListener","table","meta","options","previousFontSizeRef","React","useRef","fontSize","size","useLazyEffect","cellWidthDifference","getCellWidthDifference","current","setColumnSizing","sizes","minColumnSize","getCellMinWidth","Object","fromEntries","entries","map","columnName","prevColumnSize","newSize","Math","max","fontSizeKey","FontSizes","small","medium","large"],"mappings":";;;;;SAMgBA,wBAAwBA,CAAkBC,KAAwB;EAC9E,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EACxD,MAAME,mBAAmB,GAAGC,cAAK,CAACC,MAAM,CAACJ,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC;EAE5DC,aAAa,CAAC;IACV,MAAMC,mBAAmB,GAAGC,sBAAsB,IAAIP,mBAAmB,CAACQ,WAAWV,IAAI,CAACK,QAAQ,CAACC,MAAM,CAAC;IAE1GP,KAAK,CAACY,eAAe,CAACC,KAAK;MACvB,MAAMC,aAAa,GAAGC,eAAe,CAACd,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC;MAEzD,OAAOS,MAAM,CAACC,WAAW,CACrBD,MAAM,CAACE,OAAO,CAACL,KAAK,CAAC,CAACM,GAAG,CAAC,CAAC,CAACC,UAAU,EAAEC,cAAc,CAAC;;QAEnD,MAAMC,OAAO,GAAGC,IAAI,CAACC,GAAG,CAACV,aAAa,EAAEO,cAAc,GAAGZ,mBAAmB,CAAC;QAC7E,OAAO,CAACW,UAAU,EAAEE,OAAO,CAAC;OAC/B,CAAC,CACL;KACJ,CAAC;IACFnB,mBAAmB,CAACQ,OAAO,GAAGV,IAAI,CAACK,QAAQ,CAACC,IAAI;GACnD,EAAE,CAACN,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC,CAAC;AAC5B;AAEA,SAASG,sBAAsBA,CAACe,WAAmB;EAC/C,QAAQA,WAAW;IACf,QAAQC,SAAS,CAACC,SAASD,SAAS,CAACE,QAAQ;IAC7C,QAAQF,SAAS,CAACE,UAAUF,SAAS,CAACG,OAAO;MACzC,OAAO,CAAC;IAEZ,QAAQH,SAAS,CAACE,UAAUF,SAAS,CAACC,OAAO;IAC7C,QAAQD,SAAS,CAACG,SAASH,SAAS,CAACE,QAAQ;MACzC,OAAO,CAAC,CAAC;IAEb,QAAQF,SAAS,CAACC,SAASD,SAAS,CAACG,OAAO;MACxC,OAAO,EAAE;IAEb,QAAQH,SAAS,CAACG,SAASH,SAAS,CAACC,OAAO;MACxC,OAAO,CAAC,EAAE;IAEd;MACI,OAAO,CAAC;;AAEpB;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableRowHeightListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableRowHeightListener.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { FontSizes } from '../../../../types';\n\nexport function useTableRowHeightListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n\n useLazyEffect(() => {\n if (meta.rowHeight.height === 'short' && meta.fontSize.size === FontSizes.large) {\n meta.fontSize.setSize(FontSizes.medium);\n }\n }, [meta.rowHeight.height]);\n}\n"],"names":["useTableRowHeightListener","table","meta","options","useLazyEffect","rowHeight","height","fontSize","size","FontSizes","large","setSize","medium"],"mappings":";;;SAIgBA,yBAAyBA,CAAkBC,KAAwB;EAC/E,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EAExDE,aAAa,CAAC;IACV,IAAIF,IAAI,CAACG,SAAS,CAACC,MAAM,KAAK,OAAO,IAAIJ,IAAI,CAACK,QAAQ,CAACC,IAAI,KAAKC,SAAS,CAACC,KAAK,EAAE;MAC7ER,IAAI,CAACK,QAAQ,CAACI,OAAO,CAACF,SAAS,CAACG,MAAM,CAAC;;GAE9C,EAAE,CAACV,IAAI,CAACG,SAAS,CAACC,MAAM,CAAC,CAAC;AAC/B;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableRowSelectionListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableRowSelectionListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableRowSelectHandler } from '../../types';\n\nexport function useTableRowSelectionListener<TType = unknown>(\n table: ReactTable<TType>,\n onRowSelect?: TableRowSelectHandler<TType>\n) {\n const rowSelection = table.getState().rowSelection;\n\n useLazyEffect(() => {\n const selectedRows = table.getSelectedRowModel().rows;\n\n if (table.options.enableRowSelection && typeof onRowSelect === 'function') {\n if (table.options.enableMultiRowSelection) {\n onRowSelect(selectedRows.map(row => row.original));\n } else {\n onRowSelect([selectedRows[0]?.original] ?? []);\n }\n }\n // It is important to stringify either rowSelection state or selectedRows, because we don't\n // know if the array or object that is returned by react-table has the same reference or not.\n // rowSelection state is used here because it will be more expensive to strigify selectedRows\n // than rowSelection state.\n }, [table.options.enableRowSelection, table.options.enableMultiRowSelection, JSON.stringify(rowSelection)]);\n}\n"],"names":["useTableRowSelectionListener","table","onRowSelect","rowSelection","getState","useLazyEffect","selectedRows","getSelectedRowModel","rows","options","enableRowSelection","enableMultiRowSelection","map","row","original","_ref","_selectedRows$","JSON","stringify"],"mappings":";;SAIgBA,4BAA4BA,CACxCC,KAAwB,EACxBC,WAA0C;EAE1C,MAAMC,YAAY,GAAGF,KAAK,CAACG,QAAQ,EAAE,CAACD,YAAY;EAElDE,aAAa,CAAC;IACV,MAAMC,YAAY,GAAGL,KAAK,CAACM,mBAAmB,EAAE,CAACC,IAAI;IAErD,IAAIP,KAAK,CAACQ,OAAO,CAACC,kBAAkB,IAAI,OAAOR,WAAW,KAAK,UAAU,EAAE;MACvE,IAAID,KAAK,CAACQ,OAAO,CAACE,uBAAuB,EAAE;QACvCT,WAAW,CAACI,YAAY,CAACM,GAAG,CAACC,GAAG,IAAIA,GAAG,CAACC,QAAQ,CAAC,CAAC;OACrD,MAAM;QAAA,IAAAC,IAAA,EAAAC,cAAA;QACHd,WAAW,EAAAa,IAAA,GAAC,EAAAC,cAAA,GAACV,YAAY,CAAC,CAAC,CAAC,cAAAU,cAAA,uBAAfA,cAAA,CAAiBF,QAAQ,CAAC,cAAAC,IAAA,cAAAA,IAAA,GAAI,EAAE,CAAC;;;;;;;GAOzD,EAAE,CAACd,KAAK,CAACQ,OAAO,CAACC,kBAAkB,EAAET,KAAK,CAACQ,OAAO,CAACE,uBAAuB,EAAEM,IAAI,CAACC,SAAS,CAACf,YAAY,CAAC,CAAC,CAAC;AAC/G;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSearchListener.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableSearchListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableSearchListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { resetHighlightedColumnIndexes } from '../util/search';\n\nexport function useTableSearchListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n\n // recalculates highlighted indexes whenever something important changes\n React.useEffect(() => {\n if (meta.search.isEnabled) {\n resetHighlightedColumnIndexes(table.getState().globalFilter, table);\n }\n }, [\n meta.server.loadAllStatus,\n meta.search.isEnabled,\n meta.search.enableGlobalFilter,\n table.getRowModel().rows.length,\n table.getState().globalFilter,\n JSON.stringify(table.getState().sorting),\n JSON.stringify(table.getState().columnVisibility),\n ]);\n}\n"],"names":["useTableSearchListener","table","meta","options","React","useEffect","search","isEnabled","resetHighlightedColumnIndexes","getState","globalFilter","server","loadAllStatus","enableGlobalFilter","getRowModel","rows","length","JSON","stringify","sorting","columnVisibility"],"mappings":";;;SAIgBA,sBAAsBA,CAAkBC,KAAwB;EAC5E,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;;EAGxDE,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIH,IAAI,CAACI,MAAM,CAACC,SAAS,EAAE;MACvBC,6BAA6B,CAACP,KAAK,CAACQ,QAAQ,EAAE,CAACC,YAAY,EAAET,KAAK,CAAC;;GAE1E,EAAE,CACCC,IAAI,CAACS,MAAM,CAACC,aAAa,EACzBV,IAAI,CAACI,MAAM,CAACC,SAAS,EACrBL,IAAI,CAACI,MAAM,CAACO,kBAAkB,EAC9BZ,KAAK,CAACa,WAAW,EAAE,CAACC,IAAI,CAACC,MAAM,EAC/Bf,KAAK,CAACQ,QAAQ,EAAE,CAACC,YAAY,EAC7BO,IAAI,CAACC,SAAS,CAACjB,KAAK,CAACQ,QAAQ,EAAE,CAACU,OAAO,CAAC,EACxCF,IAAI,CAACC,SAAS,CAACjB,KAAK,CAACQ,QAAQ,EAAE,CAACW,gBAAgB,CAAC,CACpD,CAAC;AACN;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableServerLoadingListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableServerLoadingListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable } from '@tanstack/react-table';\nimport { TableServerLoadPageHandler } from '../../types';\n\nexport function useTableServerLoadingListener<TType = unknown>(table: ReactTable<TType>, loadPage?: TableServerLoadPageHandler) {\n const sorting = table.getState().sorting;\n const columnFilters = table.getState().columnFilters;\n const search = table.getState().globalFilter;\n\n // trigger load of the first page on mount\n React.useEffect(() => {\n if (loadPage) {\n loadPage(0, sorting, columnFilters, search);\n }\n }, []);\n}\n"],"names":["useTableServerLoadingListener","table","loadPage","sorting","getState","columnFilters","search","globalFilter","React","useEffect"],"mappings":";;SAIgBA,6BAA6BA,CAAkBC,KAAwB,EAAEC,QAAqC;EAC1H,MAAMC,OAAO,GAAGF,KAAK,CAACG,QAAQ,EAAE,CAACD,OAAO;EACxC,MAAME,aAAa,GAAGJ,KAAK,CAACG,QAAQ,EAAE,CAACC,aAAa;EACpD,MAAMC,MAAM,GAAGL,KAAK,CAACG,QAAQ,EAAE,CAACG,YAAY;;EAG5CC,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIP,QAAQ,EAAE;MACVA,QAAQ,CAAC,CAAC,EAAEC,OAAO,EAAEE,aAAa,EAAEC,MAAM,CAAC;;GAElD,EAAE,EAAE,CAAC;AACV;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableSettingsListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableSettingsListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { TableSettingsHandler } from '../../types';\nimport { getSettings } from '../util/settings';\n\nexport function useTableSettingsListener<TType = unknown>(\n table: ReactTable<TType>,\n onChangeSettings: TableSettingsHandler | undefined\n) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const state = table.getState();\n\n React.useEffect(() => {\n let handler;\n\n if (typeof onChangeSettings === 'function') {\n handler = setTimeout(() => {\n // some settings shouldn't be persisted, but we comment them out here to highlight the intention\n onChangeSettings(getSettings(table));\n }, 250);\n }\n\n return () => clearTimeout(handler);\n }, [\n //state.columnFilters,\n state.columnOrder,\n state.columnPinning,\n state.columnSizing,\n state.columnVisibility,\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n meta.search.excludeUnmatchedResults,\n meta.fontSize.size,\n state.grouping,\n meta.rowHeight.height,\n meta.printing.isWarningVisibleForLargeDatasets,\n //state.globalFilter,\n state.sorting,\n ]);\n}\n"],"names":["useTableSettingsListener","table","onChangeSettings","meta","options","state","getState","React","useEffect","handler","setTimeout","getSettings","clearTimeout","columnOrder","columnPinning","columnSizing","columnVisibility","search","excludeUnmatchedResults","fontSize","size","grouping","rowHeight","height","printing","isWarningVisibleForLargeDatasets","sorting"],"mappings":";;;SAKgBA,wBAAwBA,CACpCC,KAAwB,EACxBC,gBAAkD;EAElD,MAAMC,IAAI,GAAGF,KAAK,CAACG,OAAO,CAACD,IAA6B;EACxD,MAAME,KAAK,GAAGJ,KAAK,CAACK,QAAQ,EAAE;EAE9BC,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIC,OAAO;IAEX,IAAI,OAAOP,gBAAgB,KAAK,UAAU,EAAE;MACxCO,OAAO,GAAGC,UAAU,CAAC;;QAEjBR,gBAAgB,CAACS,WAAW,CAACV,KAAK,CAAC,CAAC;OACvC,EAAE,GAAG,CAAC;;IAGX,OAAO,MAAMW,YAAY,CAACH,OAAO,CAAC;GACrC,EAAE;;EAECJ,KAAK,CAACQ,WAAW,EACjBR,KAAK,CAACS,aAAa,EACnBT,KAAK,CAACU,YAAY,EAClBV,KAAK,CAACW,gBAAgB;;EAEtBb,IAAI,CAACc,MAAM,CAACC,uBAAuB,EACnCf,IAAI,CAACgB,QAAQ,CAACC,IAAI,EAClBf,KAAK,CAACgB,QAAQ,EACdlB,IAAI,CAACmB,SAAS,CAACC,MAAM,EACrBpB,IAAI,CAACqB,QAAQ,CAACC,gCAAgC;;EAE9CpB,KAAK,CAACqB,OAAO,CAChB,CAAC;AACN;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableShortcutsListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableShortcutsListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { KeyDownHandlerOptions, createShortcutKeyDownHandler } from '../../../../utils/keyboard';\nimport { TableShortcutHandlerObject, TableShortcuts } from '../../types';\n\nexport function useTableShortcutsListener<TType = unknown>(\n table: ReactTable<TType>,\n shortcuts: TableShortcuts<TType> | undefined\n) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n React.useEffect(() => {\n const shortcutKeys = Object.keys(shortcuts ?? {});\n const globalHandlers: Array<(event: KeyboardEvent) => void> = [];\n\n // convert the shortcut into the correct format to register it\n if (shortcuts && shortcutKeys.length && meta.rowActive.rowActiveIndex !== undefined) {\n const rowActive = rows[meta.rowActive.rowActiveIndex];\n\n shortcutKeys.forEach(key => {\n const handler = shortcuts[key];\n\n let keyDownHandler;\n let keyDownHandlerOptions: KeyDownHandlerOptions;\n\n if (typeof handler === 'function') {\n keyDownHandler = handler;\n keyDownHandlerOptions = {\n key,\n };\n } else {\n const handlerObject = handler as TableShortcutHandlerObject<TType>;\n keyDownHandler = handlerObject.handler;\n keyDownHandlerOptions = {\n key,\n meta: handlerObject.meta,\n shift: handlerObject.shift,\n };\n }\n\n globalHandlers.push(\n createShortcutKeyDownHandler(keyDownHandlerOptions, event => {\n event.preventDefault();\n keyDownHandler(rowActive?.original);\n })\n );\n });\n }\n\n globalHandlers.forEach(handler => {\n document.addEventListener('keydown', handler);\n });\n\n return () => {\n globalHandlers.forEach(handler => {\n document.removeEventListener('keydown', handler);\n });\n };\n }, [shortcuts, meta.rowActive.rowActiveIndex, rows.length]);\n}\n"],"names":["useTableShortcutsListener","table","shortcuts","meta","options","rows","getRowModel","React","useEffect","shortcutKeys","Object","keys","globalHandlers","length","rowActive","rowActiveIndex","undefined","forEach","key","handler","keyDownHandler","keyDownHandlerOptions","handlerObject","shift","push","createShortcutKeyDownHandler","event","preventDefault","original","document","addEventListener","removeEventListener"],"mappings":";;;SAKgBA,yBAAyBA,CACrCC,KAAwB,EACxBC,SAA4C;EAE5C,MAAMC,IAAI,GAAGF,KAAK,CAACG,OAAO,CAACD,IAA6B;EACxD,MAAME,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;EAErCE,cAAK,CAACC,SAAS,CAAC;IACZ,MAAMC,YAAY,GAAGC,MAAM,CAACC,IAAI,CAACT,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,CAAC;IACjD,MAAMU,cAAc,GAA0C,EAAE;;IAGhE,IAAIV,SAAS,IAAIO,YAAY,CAACI,MAAM,IAAIV,IAAI,CAACW,SAAS,CAACC,cAAc,KAAKC,SAAS,EAAE;MACjF,MAAMF,SAAS,GAAGT,IAAI,CAACF,IAAI,CAACW,SAAS,CAACC,cAAc,CAAC;MAErDN,YAAY,CAACQ,OAAO,CAACC,GAAG;QACpB,MAAMC,OAAO,GAAGjB,SAAS,CAACgB,GAAG,CAAC;QAE9B,IAAIE,cAAc;QAClB,IAAIC,qBAA4C;QAEhD,IAAI,OAAOF,OAAO,KAAK,UAAU,EAAE;UAC/BC,cAAc,GAAGD,OAAO;UACxBE,qBAAqB,GAAG;YACpBH;WACH;SACJ,MAAM;UACH,MAAMI,aAAa,GAAGH,OAA4C;UAClEC,cAAc,GAAGE,aAAa,CAACH,OAAO;UACtCE,qBAAqB,GAAG;YACpBH,GAAG;YACHf,IAAI,EAAEmB,aAAa,CAACnB,IAAI;YACxBoB,KAAK,EAAED,aAAa,CAACC;WACxB;;QAGLX,cAAc,CAACY,IAAI,CACfC,4BAA4B,CAACJ,qBAAqB,EAAEK,KAAK;UACrDA,KAAK,CAACC,cAAc,EAAE;UACtBP,cAAc,CAACN,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEc,QAAQ,CAAC;SACtC,CAAC,CACL;OACJ,CAAC;;IAGNhB,cAAc,CAACK,OAAO,CAACE,OAAO;MAC1BU,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEX,OAAO,CAAC;KAChD,CAAC;IAEF,OAAO;MACHP,cAAc,CAACK,OAAO,CAACE,OAAO;QAC1BU,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAEZ,OAAO,CAAC;OACnD,CAAC;KACL;GACJ,EAAE,CAACjB,SAAS,EAAEC,IAAI,CAACW,SAAS,CAACC,cAAc,EAAEV,IAAI,CAACQ,MAAM,CAAC,CAAC;AAC/D;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTableSortingListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableSortingListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableSortHandler } from '../../types';\n\n// we use a listener, and not the internal \"controlled\" change handlers because we don't actually want consumers\n// to control the state outside the table. this listener is really here to let the consumer make a server request\n// and provide the server with the sorting state, so that it can sort server side\nexport function useTableSortingListener<TType = unknown>(table: ReactTable<TType>, onSort?: TableSortHandler) {\n const sorting = table.getState().sorting;\n\n useLazyEffect(() => {\n if (table.options.enableSorting && typeof onSort === 'function') {\n onSort(sorting);\n\n if (table.options.enableRowSelection) {\n table.resetRowSelection();\n }\n }\n }, [table.options.enableSorting, sorting]);\n}\n"],"names":["useTableSortingListener","table","onSort","sorting","getState","useLazyEffect","options","enableSorting","enableRowSelection","resetRowSelection"],"mappings":";;AAIA;AACA;AACA;SACgBA,uBAAuBA,CAAkBC,KAAwB,EAAEC,MAAyB;EACxG,MAAMC,OAAO,GAAGF,KAAK,CAACG,QAAQ,EAAE,CAACD,OAAO;EAExCE,aAAa,CAAC;IACV,IAAIJ,KAAK,CAACK,OAAO,CAACC,aAAa,IAAI,OAAOL,MAAM,KAAK,UAAU,EAAE;MAC7DA,MAAM,CAACC,OAAO,CAAC;MAEf,IAAIF,KAAK,CAACK,OAAO,CAACE,kBAAkB,EAAE;QAClCP,KAAK,CAACQ,iBAAiB,EAAE;;;GAGpC,EAAE,CAACR,KAAK,CAACK,OAAO,CAACC,aAAa,EAAEJ,OAAO,CAAC,CAAC;AAC9C;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useTable.js","sources":["../../../../../../../../src/primitives/Table/useTable/useTable.ts"],"sourcesContent":["import { useReactTable, TableMeta as ReactTableMeta, RowData } from '@tanstack/react-table';\nimport {\n TableColumnAlignment,\n TableColumnClassNameHandler,\n TableColumnDataType,\n TableColumnMenu,\n TableColumnRendererControl,\n TableFilterComparator,\n TableRef,\n useTableInternalColumns,\n useTableProps,\n} from '../types';\nimport { useReactTableInitialState, configureReactTableOptions, mapTableChildrenToColumns } from './util/setup';\nimport { useTableFeaturePreset } from './util/presets';\nimport { useTableColumnFreezing } from './features/useTableColumnFreezing';\nimport { useTableColumnOrdering } from './features/useTableColumnOrdering';\nimport { useTableFooter } from './features/useTableFooter';\nimport { useTableFontSize } from './features/useTableFontSize';\nimport { useTablePrinting } from './features/useTablePrinting';\nimport { useTableRowActions } from './features/useTableRowActions';\nimport { useTableRowActive } from './features/useTableRowActive';\nimport { useTableRowClick } from './features/useTableRowClick';\nimport { useTableRowExpansion } from './features/useTableRowExpansion';\nimport { useTableRowGoto } from './features/useTableRowGoto';\nimport { useTableRowGroups } from './features/useTableRowGroups';\nimport { useTableRowHeight } from './features/useTableRowHeight';\nimport { useTableRowSelection } from './features/useTableRowSelection';\nimport { useTableSearch } from './features/useTableSearch';\nimport { useTableServerLoading } from './features/useTableServerLoading';\nimport { useTableSettings } from './features/useTableSettings';\nimport { useTableDataListener } from './listeners/useTableDataListener';\nimport { useTableFilterListener } from './listeners/useTableFilterListener';\nimport { useTableFontSizeListener } from './listeners/useTableFontSizeListener';\nimport { useTableRowHeightListener } from './listeners/useTableRowHeightListener';\nimport { useTableRowSelectionListener } from './listeners/useTableRowSelectionListener';\nimport { useTableSearchListener } from './listeners/useTableSearchListener';\nimport { useTableSettingsListener } from './listeners/useTableSettingsListener';\nimport { useTableShortcutsListener } from './listeners/useTableShortcutsListener';\nimport { useTableSortingListener } from './listeners/useTableSortingListener';\nimport { useTableServerLoadingListener } from './listeners/useTableServerLoadingListener';\nimport { useTableRef } from './features/useTableRef';\n\n/*\n EDITING THIS FILE? READ ME FIRST!\n\n This is a shared, common hook for multiple tables. It's feature set is specifically chosen to support features\n common across those tables. If you are adding a new feature or changing an existing one, before writing any code\n in this file ask yourself the question - is this specific to a given table, or is it common to all of them.\n If you are unsure, ask your team first.\n*/\n\ndeclare module '@tanstack/table-core' {\n interface TableMeta<TData extends RowData> {\n columnFreezing: ReturnType<typeof useTableColumnFreezing>;\n columnOrdering: ReturnType<typeof useTableColumnOrdering>;\n fontSize: ReturnType<typeof useTableFontSize>;\n footer: ReturnType<typeof useTableFooter>;\n printing: ReturnType<typeof useTablePrinting>;\n rowActions: ReturnType<typeof useTableRowActions>;\n rowActive: ReturnType<typeof useTableRowActive>;\n rowClick: ReturnType<typeof useTableRowClick>;\n rowExpansion: ReturnType<typeof useTableRowExpansion>;\n rowGoto: ReturnType<typeof useTableRowGoto>;\n rowGroups: ReturnType<typeof useTableRowGroups>;\n rowHeight: ReturnType<typeof useTableRowHeight>;\n rowSelection: ReturnType<typeof useTableRowSelection>;\n search: ReturnType<typeof useTableSearch>;\n server: ReturnType<typeof useTableServerLoading>;\n //shortcutsState: ReturnType<typeof usePauseShortcuts>;\n }\n\n interface ColumnMeta<TData extends RowData, TValue> {\n align?: TableColumnAlignment;\n className?: TableColumnClassNameHandler<TData>;\n control?: TableColumnRendererControl<TData>;\n dataType?: TableColumnDataType;\n enableOrdering?: boolean;\n enablePrinting?: boolean;\n enableTruncate?: boolean;\n filters?: TableFilterComparator[];\n header: string;\n headerClassName?: string;\n menu?: TableColumnMenu;\n tooltip?: string;\n }\n}\n\nexport function useTable<TType = unknown, TMeta = {}>(\n props: useTableProps<TType>,\n ref: React.RefObject<TableRef>,\n meta?: Partial<ReactTableMeta<TType>> & TMeta,\n internalColumns?: useTableInternalColumns<TType>\n) {\n // CSS.escape would be best here, but it doesn't seem to work very well\n const safeId = props.id.replace('.', '_');\n // configure table options, merging props with presets\n const options = useTableFeaturePreset(props);\n\n // load any persisted table settings and merge them with any defaults\n const [settings, setSettings] = useTableSettings(\n options.enableSaveSettings,\n safeId,\n props.defaultSettings,\n props.onChangeSettings\n );\n\n // configure common custom features\n const columnFreezing = useTableColumnFreezing(options.enableColumnFreezing);\n const columnOrdering = useTableColumnOrdering(options.enableColumnOrdering);\n const fontSize = useTableFontSize(options.enableFontSize, settings.fontSize);\n const footer = useTableFooter(options.enableFooter);\n const printing = useTablePrinting(options.enablePrinting, settings.showWarningWhenPrintingLargeDataset);\n const rowActive = useTableRowActive(options.enableRowActive, props.defaultRowActiveIndex);\n const rowActions = useTableRowActions<TType>(options.enableRowActions, props.rowActions, props.rowActionsLength);\n const rowClick = useTableRowClick<TType>(options.enableRowClick, props.onRowClick);\n const rowExpansion = useTableRowExpansion<TType>(options.enableRowExpansion, props.rowExpansionRenderer);\n const rowGoto = useTableRowGoto(options.enableRowGoto, props.onRowGoto);\n const rowGroups = useTableRowGroups(props.rowActionsForGroup);\n const rowHeight = useTableRowHeight(options.enableRowHeight, settings.rowHeight);\n const rowSelection = useTableRowSelection(options.enableRowSelection);\n const search = useTableSearch(options.enableSearch, settings.excludeUnmatchedRecordsInSearch);\n const server = useTableServerLoading(props.loadPage, props.loadAll, props.pageSize);\n\n // TODO: memoise\n // convert jsx column components into valid table columns\n const { columns, ...defaultState } = mapTableChildrenToColumns<TType>(props, settings, options, internalColumns);\n\n // configure initial table state\n const initialState = useReactTableInitialState<TType>(props, columns, settings, defaultState);\n\n // create a react-table instance\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n const instance = useReactTable<TType>({\n data: props.data,\n columns,\n // configure initial table state\n initialState,\n // configure react-table built-in features\n ...configureReactTableOptions(options, props),\n // settings that can be toggled by the user, and therefore require our own state\n enableGlobalFilter: search.enableGlobalFilter,\n // custom context\n meta: {\n // spread features from specific implementations\n ...meta,\n columnFreezing,\n columnOrdering,\n fontSize,\n footer,\n //getSettings\n printing,\n rowActions,\n rowActive,\n rowClick: rowClick as any,\n rowExpansion,\n rowGoto,\n rowGroups,\n rowHeight,\n rowSelection,\n search,\n server,\n },\n });\n\n // state listeners - we have these so that we don't have to control state outside the table\n useTableDataListener(instance);\n useTableFilterListener(instance, props.onChangeFilter);\n useTableFontSizeListener(instance);\n useTableRowHeightListener(instance);\n useTableRowSelectionListener(instance, props.onRowSelect);\n useTableSearchListener(instance);\n useTableServerLoadingListener(instance, server.loadPage);\n useTableSettingsListener(instance, setSettings);\n useTableShortcutsListener(instance, props.shortcuts);\n useTableSortingListener(instance, props.onChangeSort);\n\n // configure ref with reset functions\n useTableRef(instance, ref);\n\n return {\n id: safeId,\n instance,\n length: props.length ?? props.data.length,\n meta: (instance.options.meta ?? {}) as ReactTableMeta<TType> & TMeta,\n state: instance.getState(),\n };\n}\n"],"names":["useTable","props","ref","meta","internalColumns","safeId","id","replace","options","useTableFeaturePreset","settings","setSettings","useTableSettings","enableSaveSettings","defaultSettings","onChangeSettings","columnFreezing","useTableColumnFreezing","enableColumnFreezing","columnOrdering","useTableColumnOrdering","enableColumnOrdering","fontSize","useTableFontSize","enableFontSize","footer","useTableFooter","enableFooter","printing","useTablePrinting","enablePrinting","showWarningWhenPrintingLargeDataset","rowActive","useTableRowActive","enableRowActive","defaultRowActiveIndex","rowActions","useTableRowActions","enableRowActions","rowActionsLength","rowClick","useTableRowClick","enableRowClick","onRowClick","rowExpansion","useTableRowExpansion","enableRowExpansion","rowExpansionRenderer","rowGoto","useTableRowGoto","enableRowGoto","onRowGoto","rowGroups","useTableRowGroups","rowActionsForGroup","rowHeight","useTableRowHeight","enableRowHeight","rowSelection","useTableRowSelection","enableRowSelection","search","useTableSearch","enableSearch","excludeUnmatchedRecordsInSearch","server","useTableServerLoading","loadPage","loadAll","pageSize","columns","defaultState","mapTableChildrenToColumns","initialState","useReactTableInitialState","instance","useReactTable","data","configureReactTableOptions","enableGlobalFilter","useTableDataListener","useTableFilterListener","onChangeFilter","useTableFontSizeListener","useTableRowHeightListener","useTableRowSelectionListener","onRowSelect","useTableSearchListener","useTableServerLoadingListener","useTableSettingsListener","useTableShortcutsListener","shortcuts","useTableSortingListener","onChangeSort","useTableRef","length","_props$length","_instance$options$met","state","getState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAuFgBA,QAAQA,CACpBC,KAA2B,EAC3BC,GAA8B,EAC9BC,IAA6C,EAC7CC,eAAgD;;;EAGhD,MAAMC,MAAM,GAAGJ,KAAK,CAACK,EAAE,CAACC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;;EAEzC,MAAMC,OAAO,GAAGC,qBAAqB,CAACR,KAAK,CAAC;;EAG5C,MAAM,CAACS,QAAQ,EAAEC,WAAW,CAAC,GAAGC,gBAAgB,CAC5CJ,OAAO,CAACK,kBAAkB,EAC1BR,MAAM,EACNJ,KAAK,CAACa,eAAe,EACrBb,KAAK,CAACc,gBAAgB,CACzB;;EAGD,MAAMC,cAAc,GAAGC,sBAAsB,CAACT,OAAO,CAACU,oBAAoB,CAAC;EAC3E,MAAMC,cAAc,GAAGC,sBAAsB,CAACZ,OAAO,CAACa,oBAAoB,CAAC;EAC3E,MAAMC,QAAQ,GAAGC,gBAAgB,CAACf,OAAO,CAACgB,cAAc,EAAEd,QAAQ,CAACY,QAAQ,CAAC;EAC5E,MAAMG,MAAM,GAAGC,cAAc,CAAClB,OAAO,CAACmB,YAAY,CAAC;EACnD,MAAMC,QAAQ,GAAGC,gBAAgB,CAACrB,OAAO,CAACsB,cAAc,EAAEpB,QAAQ,CAACqB,mCAAmC,CAAC;EACvG,MAAMC,SAAS,GAAGC,iBAAiB,CAACzB,OAAO,CAAC0B,eAAe,EAAEjC,KAAK,CAACk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,EAAEvB,QAAQ,CAACwB,QAAQ;GAC3B;AACL;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"columns.js","sources":["../../../../../../../../../src/primitives/Table/useTable/util/columns.ts"],"sourcesContent":["import { ColumnDef as ReactTableColumnDef } from '@tanstack/react-table';\nimport { isDate } from 'date-fns';\nimport { FontSize, FontSizes } from '../../../../types';\nimport { format, parseFromISOString } from '../../../../utils/date';\nimport { TableColumnDataType } from '../../types';\n\nexport function isInternalColumn(id: string | undefined) {\n return id?.startsWith('__');\n}\n\n// column widths\nexport const getCellMinWidth = (fontSize: FontSize = 'medium') => {\n switch (fontSize) {\n case FontSizes.small:\n return 57;\n\n case FontSizes.large:\n return 83;\n\n default:\n case FontSizes.medium:\n return 72;\n }\n};\n\n// highlighting\nexport function isCellHighlighted(query: string, value: unknown, dataType?: TableColumnDataType) {\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?: TableColumnDataType): 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\n// ordering\nexport function ensureOrdering<TType = unknown>(\n columns: ReactTableColumnDef<TType>[],\n settingsOrder: string[] | undefined,\n internalColumnsPinnedToTheRight: string[] = ['__actions']\n): string[] {\n // internal columns come with a defined order\n const internalColumns = columns\n .filter(column => isInternalColumn(column.id) && !internalColumnsPinnedToTheRight.includes(String(column.id)))\n .map(column => column.id) as string[];\n\n // columns with ordering disabled should be moved to the front\n const orderingDisabled: string[] = [];\n const orderingEnabled: string[] = [];\n\n let orderedColumns = columns;\n\n // if settings is defined, make sure the columns that are actual children are sorted by it\n if (Array.isArray(settingsOrder)) {\n orderedColumns = columns.slice().sort(\n // the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end\n (a, b) => (settingsOrder.indexOf(a.id as string) >>> 0) - (settingsOrder.indexOf(b.id as string) >>> 0)\n );\n }\n\n orderedColumns.forEach(column => {\n if (isInternalColumn(column.id)) {\n return;\n }\n\n if (column.meta?.enableOrdering) {\n orderingEnabled.push(column.id as string);\n } else {\n orderingDisabled.push(column.id as string);\n }\n });\n\n const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];\n\n // actions should always be last, enforce that\n internalColumnsPinnedToTheRight.forEach(id => {\n if (columns.findIndex(column => column.id === id) > -1) {\n order.push(id);\n }\n });\n\n return order;\n}\n\n// freezing - we use the react-table pinning state, but that requires some mapping between them\nexport function unfreezeAllExternalColumns(leftPinnedState?: string[]): string[] {\n return leftPinnedState?.filter(id => isInternalColumn(id) && id !== '__actions') ?? [];\n}\n\nexport function freezeUptoExternalColumn(index: number, columns: string[]): string[] {\n return columns.slice(0, index + 1);\n}\n"],"names":["isInternalColumn","id","startsWith","getCellMinWidth","fontSize","FontSizes","small","large","medium","isCellHighlighted","query","value","dataType","undefined","String","getCellValueAsString","toLocaleLowerCase","includes","isDate","_format","format","_format2","parseFromISOString","ensureOrdering","columns","settingsOrder","internalColumnsPinnedToTheRight","internalColumns","filter","column","map","orderingDisabled","orderingEnabled","orderedColumns","Array","isArray","slice","sort","a","b","indexOf","forEach","_column$meta","meta","enableOrdering","push","order","findIndex","unfreezeAllExternalColumns","leftPinnedState","_leftPinnedState$filt","freezeUptoExternalColumn","index"],"mappings":";;;;SAMgBA,gBAAgBA,CAACC,EAAsB;EACnD,OAAOA,EAAE,aAAFA,EAAE,uBAAFA,EAAE,CAAEC,UAAU,CAAC,IAAI,CAAC;AAC/B;AAEA;MACaC,eAAe,GAAGA,CAACC,WAAqB,QAAQ;EACzD,QAAQA,QAAQ;IACZ,KAAKC,SAAS,CAACC,KAAK;MAChB,OAAO,EAAE;IAEb,KAAKD,SAAS,CAACE,KAAK;MAChB,OAAO,EAAE;IAEb;IACA,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C3B,EAAE,IAAID,gBAAgB,CAACC,EAAE,CAAC,IAAIA,EAAE,KAAK,WAAW,CAAC,cAAAiD,qBAAA,cAAAA,qBAAA,GAAI,EAAE;AAC1F;SAEgBC,wBAAwBA,CAACC,KAAa,EAAE5B,OAAiB;EACrE,OAAOA,OAAO,CAACY,KAAK,CAAC,CAAC,EAAEgB,KAAK,GAAG,CAAC,CAAC;AACtC;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"filtering.js","sources":["../../../../../../../../../src/primitives/Table/useTable/util/filtering.ts"],"sourcesContent":["import { Row as ReactTableRow } from '@tanstack/react-table';\nimport { isDate, isAfter as isAfterDate, isBefore as isBeforeDate, isEqual as isEqualDate } from 'date-fns';\nimport { isWeakEqual as isWeakEqualDate } from '../../../../utils/date';\nimport { TableFilterValue, TableFilterComparator } from '../../types';\nimport { getCellValueAsString } from './columns';\n\nexport const toLowerCase = (value: string | number) => String(value ?? '').toLocaleLowerCase();\nexport const isWeakContains = (left: string | number, right: string | number) => toLowerCase(left).includes(toLowerCase(right));\nexport const isWeakEqual = (left: string | number, right: string | number) => toLowerCase(left) === toLowerCase(right);\n\n// the filter type is only settable on the column definition, which would re-render all columns.\n// so instead we store it in the filter value, but that means we also have to destructure that\n// before we filter - that's why this custom filter function exists\nexport function columnFilterFn(value: any, filter: TableFilterValue) {\n try {\n if (filter.comparator === TableFilterComparator.IsEmpty || filter.comparator === TableFilterComparator.IsNotEmpty) {\n const isEmpty = value === undefined || value === null || value === '';\n return filter.comparator === TableFilterComparator.IsEmpty ? isEmpty : !isEmpty;\n }\n\n if (filter.value === undefined || filter.value === null || filter.value === '') {\n return true;\n }\n\n switch (filter.comparator) {\n case TableFilterComparator.Contains:\n return isWeakContains(value, filter.value);\n\n case TableFilterComparator.DoesNotContain:\n return !isWeakContains(value, filter.value);\n\n case TableFilterComparator.IsEqualTo: {\n if (isDate(value)) {\n return isDate(filter.value) && isWeakEqualDate(value, filter.value);\n } else if (typeof filter.value === 'boolean') {\n return value === filter.value;\n }\n\n return isWeakEqual(value, filter.value);\n }\n\n case TableFilterComparator.IsNotEqualTo: {\n if (isDate(value)) {\n return isDate(filter.value) && isWeakEqualDate(value, filter.value) === false;\n } else if (typeof filter.value === 'boolean') {\n return value !== filter.value;\n }\n\n return !isWeakEqual(value, filter.value);\n }\n\n case TableFilterComparator.IsGreaterThan: {\n if (isDate(value)) {\n return isDate(filter.value) && isAfterDate(value, filter.value);\n } else {\n const valueAsNumber = parseInt(value);\n return !isNaN(valueAsNumber) && filter.value !== undefined && valueAsNumber > filter.value;\n }\n }\n\n case TableFilterComparator.IsLessThan: {\n if (isDate(value)) {\n return isDate(filter.value) && isBeforeDate(value, filter.value);\n } else {\n const valueAsNumber = parseInt(value);\n return !isNaN(valueAsNumber) && filter.value !== undefined && valueAsNumber < filter.value;\n }\n }\n\n case TableFilterComparator.IsLessThanOrEqualTo: {\n if (isDate(value)) {\n return isDate(filter.value) && (isBeforeDate(value, filter.value) || isEqualDate(value, filter.value));\n } else {\n const valueAsNumber = parseInt(value);\n return !isNaN(valueAsNumber) && filter.value !== undefined && valueAsNumber <= filter.value;\n }\n }\n\n case TableFilterComparator.IsGreaterThanOrEqualTo: {\n if (isDate(value)) {\n return isDate(filter.value) && (isAfterDate(value, filter.value) || isEqualDate(value, filter.value));\n } else {\n const valueAsNumber = parseInt(value);\n return !isNaN(valueAsNumber) && filter.value !== undefined && valueAsNumber >= filter.value;\n }\n }\n\n case TableFilterComparator.IsBetween: {\n const [fromValue, toValue] = filter.value;\n\n if (isDate(value)) {\n if (isDate(fromValue) && isBeforeDate(value, fromValue)) {\n return false;\n } else if (isDate(toValue) && isAfterDate(value, toValue)) {\n return false;\n }\n\n return true;\n } else {\n const valueAsNumber = parseInt(value);\n\n if (isNaN(valueAsNumber)) {\n return false;\n }\n\n if (fromValue !== undefined && valueAsNumber < fromValue) {\n return false;\n } else if (toValue !== undefined && valueAsNumber > toValue) {\n return false;\n }\n\n return true;\n }\n }\n\n case TableFilterComparator.HasAnyOf:\n return Array.isArray(filter.value) && Array.isArray(value)\n ? filter.value.some(item => value.includes(item))\n : false;\n\n case TableFilterComparator.HasNoneOf:\n return Array.isArray(filter.value) && Array.isArray(value)\n ? filter.value.every(item => value.includes(item) === false)\n : false;\n\n case TableFilterComparator.HasAllOf:\n return Array.isArray(filter.value) && Array.isArray(value)\n ? filter.value.filter(v => value.includes(v)).length === filter.value.length\n : false;\n }\n\n return false;\n } catch (e) {\n console.error(e);\n return true;\n }\n}\n\nexport function globalFilterFn<TType = unknown>(row: ReactTableRow<TType>, columnId: string, searchQuery: string) {\n try {\n if (row.original) {\n const dataType = row._getAllCellsByColumnId()[columnId]?.column.columnDef.meta?.dataType;\n const cellValue = getCellValueAsString(row.original[columnId], dataType);\n return isWeakContains(cellValue, searchQuery);\n }\n } catch {\n // we don't care, just fail silently and return no results\n }\n\n return false;\n}\n"],"names":["toLowerCase","value","String","toLocaleLowerCase","isWeakContains","left","right","includes","isWeakEqual","columnFilterFn","filter","comparator","TableFilterComparator","IsEmpty","IsNotEmpty","isEmpty","undefined","Contains","DoesNotContain","IsEqualTo","isDate","isWeakEqualDate","IsNotEqualTo","IsGreaterThan","isAfterDate","valueAsNumber","parseInt","isNaN","IsLessThan","isBeforeDate","IsLessThanOrEqualTo","isEqualDate","IsGreaterThanOrEqualTo","IsBetween","fromValue","toValue","HasAnyOf","Array","isArray","some","item","HasNoneOf","every","HasAllOf","v","length","e","console","error","globalFilterFn","row","columnId","searchQuery","original","_row$_getAllCellsByCo","_row$_getAllCellsByCo2","dataType","_getAllCellsByColumnId","column","columnDef","meta","cellValue","getCellValueAsString"],"mappings":";;;;;MAMaA,WAAW,GAAIC,KAAsB,IAAKC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC,CAACE,iBAAiB;MAC/EC,cAAc,GAAGA,CAACC,IAAqB,EAAEC,KAAsB,KAAKN,WAAW,CAACK,IAAI,CAAC,CAACE,QAA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EAAE;IACRC,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;IAChB,OAAO,IAAI;;AAEnB;SAEgBG,cAAcA,CAAkBC,GAAyB,EAAEC,QAAgB,EAAEC,WAAmB;EAC5G,IAAI;IACA,IAAIF,GAAG,CAACG,QAAQ,EAAE;MAAA,IAAAC,qBAAA,EAAAC,sBAAA;MACd,MAAMC,QAAQ,IAAAF,qBAAA,GAAGJ,GAAG,CAACO,sBAAsB,EAAE,CAACN,QAAQ,CAAC,cAAAG,qBAAA,wBAAAC,sBAAA,GAAtCD,qBAAA,CAAwCI,MAAM,CAACC,SAAS,CAACC,IAAI,cAAAL,sBAAA,uBAA7DA,sBAAA,CAA+DC,QAAQ;MACxF,MAAMK,SAAS,GAAGC,oBAAoB,CAACZ,GAAG,CAACG,QAAQ,CAACF,QAAQ,CAAC,EAAEK,QAAQ,CAAC;MACxE,OAAOpD,cAAc,CAACyD,SAAS,EAAET,WAAW,CAAC;;GAEpD,CAAC,MAAM;;;EAIR,OAAO,KAAK;AAChB;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"presets.js","sources":["../../../../../../../../../src/primitives/Table/useTable/util/presets.ts"],"sourcesContent":["import React from 'react';\nimport { TableFeatureProps, TablePreset, useTableProps } from '../../types';\n\nconst DEFAULT_PRESET: TableFeatureProps = {\n // react-table built-in\n enableFiltering: false,\n enableSearch: false,\n enableSorting: false,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: false,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: false,\n enableRowClick: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: false,\n};\n\nconst presets: Record<TablePreset, TableFeatureProps> = {\n lite: {\n // react-table built-in\n enableFiltering: true,\n enableSearch: true,\n enableSorting: true,\n enableColumnFreezing: true,\n enableColumnHiding: false,\n enableColumnResizing: true,\n enableRowExpansion: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: true,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: true,\n enableRowGoto: true,\n enableRowHeight: false,\n enableSaveSettings: true,\n },\n complex: {\n // react-table built-in\n enableFiltering: true,\n enableSearch: true,\n enableSorting: true,\n enableColumnFreezing: true,\n enableColumnHiding: true,\n enableColumnResizing: true,\n enableRowExpansion: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: true,\n enableFontSize: true,\n enableFooter: true,\n enablePrinting: true,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: true,\n enableRowGoto: true,\n enableRowHeight: true,\n enableSaveSettings: true,\n },\n};\n\nexport function useTableFeaturePreset<TType = unknown>(props: useTableProps<TType>): TableFeatureProps {\n const presetOptions = props.preset ? presets[props.preset] : DEFAULT_PRESET;\n\n const enableRowActions = props.enableRowActions ?? presetOptions.enableRowActions;\n const enableRowClick = props.enableRowClick ?? presetOptions.enableRowClick;\n const enableRowGoto = props.enableRowGoto ?? presetOptions.enableRowGoto;\n const enableRowExpansion = props.enableRowExpansion ?? presetOptions.enableRowExpansion;\n const enableRowSelection = props.enableRowSelection ?? presetOptions.enableRowSelection;\n const enableRowSelectionSingle = props.enableRowSelectionSingle ?? presetOptions.enableRowSelectionSingle;\n\n // guard options that might be unintentionally broken\n React.useEffect(() => {\n if (enableRowActions && !props.rowActions?.length) {\n console.warn(\n `Table (id: ${props.id}) - Row actions is enabled but no \\`rowActions\\` has been provided. Provide one to enable row actions or set \\`enableRowActions\\` to \\`false\\`.`\n );\n }\n\n if (enableRowClick && !props.onRowClick) {\n console.warn(\n `Table (id: ${props.id}) - Row click is enabled but no \\`onRowClick\\` handler has been provided. Provide one to enable row click or set \\`enableRowClick\\` to \\`false\\`.`\n );\n }\n\n if (enableRowGoto && !props.onRowGoto) {\n console.warn(\n `Table (id: ${props.id}) - Row click is enabled but no \\`onRowGoto\\` handler has been provided. Provide one to enable row goto or set \\`enableRowGoto\\` to \\`false\\`.`\n );\n }\n\n if (enableRowExpansion && !props.rowExpansionRenderer) {\n console.warn(\n `Table (id: ${props.id}) - Row expansion is enabled but no \\`rowExpansionRenderer\\` 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 `Table (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 if (enableRowSelectionSingle && !props.onRowSelect) {\n console.warn(\n `Table (id: ${props.id}) - Row selection (single) is enabled but no \\`onRowSelect\\` handler has been provided. Provide one to enable row selection or set \\`enableRowSelectionSingle\\` to \\`false\\`.`\n );\n }\n }, []);\n\n return {\n // react-table built-in\n enableFiltering: props.enableFiltering ?? presetOptions.enableFiltering,\n enableSearch: props.enableSearch ?? presetOptions.enableSearch,\n enableSorting: props.enableSorting ?? presetOptions.enableSorting,\n enableColumnFreezing: props.enableColumnFreezing ?? presetOptions.enableColumnFreezing,\n enableColumnHiding: props.enableColumnHiding ?? presetOptions.enableColumnHiding,\n enableColumnResizing: props.enableColumnResizing ?? presetOptions.enableColumnResizing,\n enableRowExpansion: enableRowExpansion && !!props.rowExpansionRenderer,\n enableRowSelection: enableRowSelection && !!props.onRowSelect,\n enableRowSelectionSingle: enableRowSelectionSingle && !!props.onRowSelect,\n\n // custom -- common between all table types\n enableColumnOrdering: props.enableColumnOrdering ?? presetOptions.enableColumnOrdering,\n enableFontSize: props.enableFontSize ?? presetOptions.enableFontSize,\n enableFooter: props.enableFooter ?? presetOptions.enableFooter,\n enablePrinting: props.enablePrinting ?? presetOptions.enablePrinting,\n enableRowActive: props.enableRowActive ?? presetOptions.enableRowActive,\n enableRowActions: enableRowActions && !!props.rowActions?.length,\n enableRowClick: enableRowClick && !!props.onRowClick,\n enableRowGoto: enableRowGoto && !!props.onRowGoto,\n enableRowHeight: props.enableRowHeight ?? presetOptions.enableRowHeight,\n enableSaveSettings: props.enableSaveSettings ?? presetOptions.enableSaveSettings,\n };\n}\n"],"names":["DEFAULT_PRESET","enableFiltering","enableSearch","enableSorting","enableColumnFreezing","enableColumnHiding","enableColumnResizing","enableRowExpansion","enableRowSelection","enableRowSelectionSingle","enableColumnOrdering","enableFontSize","enableFooter","enablePrinting","enableRowActive","enableRowActions","enableRowClick","enableRowGoto","enableRowHeight","enableSaveSettings","presets","lite","complex","useTableFeaturePreset","props","presetOptions","preset","_props$enableRowActio","_props$enableRowClick","_props$enableRowGoto","_props$enableRowExpan","_props$enableRowSelec","_props$enableRowSelec2","React","useEffect","_props$rowActions","rowActions","length","console","warn","id","onRowClick","onRowGoto","rowExpansionRenderer","onRowSelect","_props$enableFilterin","_props$enableSearch","_props$enableSorting","_props$enableColumnFr","_props$enableColumnHi","_props$enableColumnRe","_props$enableColumnOr","_props$enableFontSize","_props$enableFooter","_props$enablePrinting","_props$enableRowActiv","_props$rowActions2","_props$enableRowHeigh","_props$enableSaveSett"],"mappings":";;AAGA,MAAMA,cAAc,GAAsB;;EAEtCC,eAAe,EAAE,KAAK;EACtBC,YAAY,EAAE,KAAK;EACnBC,aAAa,EAAE,KAAK;EACpBC,oBAAoB,EAAE,KAAK;EAC3BC,kBAAkB,EAAE,KAAK;EACzBC,oBAAoB,EAAE,KAAK;EAC3BC,kBAAkB,EAAE,KAAK;EACzBC,kBAAkB,EAAE,KAAK;EACzBC,wBAAwB,EAAE,KAAK;;EAG/BC,oBAAoB,EAAE,KAAK;EAC3BC,cAAc,EAAE,KAAK;EACrBC,YAAY,EAAE,KAAK;EACnBC,cAAc,EAAE,KAAK;EACrBC,eAAe,EAAE,IAAI;EACrBC,gBAAgB,EAAE,KAAK;EACvBC,cAAc,EAAE,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"file":"search.js","sources":["../../../../../../../../../src/primitives/Table/useTable/util/search.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { getCellValueAsString } from './columns';\nimport { isWeakContains } from './filtering';\n\nexport function resetHighlightedColumnIndexes<TType = unknown>(value: string | undefined, table: ReactTable<TType>) {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n let firstRowIndex: undefined | number;\n\n if (value) {\n const indexes: number[][] = [];\n const columns = table.getVisibleLeafColumns();\n const rowGrouping = table.getState().grouping;\n\n table.getRowModel().rows.forEach((row, rowIndex) => {\n columns.forEach((column, columnIndex) => {\n try {\n let allowSearch = true;\n\n if (rowGrouping?.length) {\n // if it's the grouped row, only allow search of the grouped column - because that's all that's visible\n if (row.getIsGrouped()) {\n allowSearch = column.getIsGrouped();\n }\n // otherwise for other rows, don't search the grouped column - because it isn't visible\n else if (rowGrouping.includes(column.id)) {\n allowSearch = false;\n }\n }\n\n if (column.getIsVisible() && column.columnDef.enableGlobalFilter && allowSearch) {\n const cellValue = getCellValueAsString(row.original?.[column.id], column.columnDef.meta?.dataType);\n\n // indexes don't map to sorted data\n if (cellValue !== undefined && isWeakContains(cellValue, value)) {\n indexes.push([rowIndex, columnIndex]);\n }\n }\n } catch (e) {\n //\n }\n });\n });\n\n tableMeta.search.setHighlightedColumnIndexes(indexes);\n\n if (indexes.length) {\n firstRowIndex = indexes[0][0];\n tableMeta.search.setCurrentHighlightColumnIndex(0);\n } else {\n tableMeta.search.setCurrentHighlightColumnIndex(undefined);\n }\n } else {\n tableMeta.search.setHighlightedColumnIndexes([]);\n tableMeta.search.setCurrentHighlightColumnIndex(undefined);\n }\n\n if (firstRowIndex !== undefined) {\n tableMeta.rowActive.setRowActiveIndex(firstRowIndex);\n }\n\n return firstRowIndex;\n}\n"],"names":["resetHighlightedColumnIndexes","value","table","tableMeta","options","meta","firstRowIndex","indexes","columns","getVisibleLeafColumns","rowGrouping","getState","grouping","getRowModel","rows","forEach","row","rowIndex","column","columnIndex","allowSearch","length","getIsGrouped","includes","id","getIsVisible","columnDef","enableGlobalFilter","_row$original","_column$columnDef$met","cellValue","getCellValueAsString","original","dataType","undefined","isWeakContains","push","e","search","setHighlightedColumnIndexes","setCurrentHighlightColumnIndex","rowActive","setRowActiveIndex"],"mappings":";;;SAIgBA,6BAA6BA,CAAkBC,KAAyB,EAAEC,KAAwB;EAC9G,MAAMC,SAAS,GAAGD,KAAK,CAACE,OAAO,CAACC,IAA6B;EAC7D,IAAIC,aAAiC;EAErC,IAAIL,KAAK,EAAE;IACP,MAAMM,OAAO,GAAe,EAAE;IAC9B,MAAMC,OAAO,GAAGN,KAAK,CAACO,qBAAqB,EAAE;IAC7C,MAAMC,WAAW,GAAGR,KAAK,CAACS,QAAQ,EAAE,CAACC,QAAQ;IAE7CV,KAAK,CAACW,WAAW,EAAE,CAACC,IAAI,CAACC,OAAO,CAAC,CAACC,GAAG,EAAEC,QAAQ;MAC3CT,OAAO,CAACO,OAAO,CAAC,CAACG,MAAM,EAAEC,WAAW;QAChC,IAAI;UACA,IAAIC,WAAW,GAAG,IAAI;UAEtB,IAAIV,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAEW,MAAM,EAAE;;YAErB,IAAIL,GAAG,CAACM,YAAY,EAAE,EAAE;cACpBF,WAAW,GAAGF,MAAM,CAACI,YAAY,EAAE;;;iBAGlC,IAAIZ,WAAW,CAACa,QAAQ,CAACL,MAAM,CAACM,EAAE,CAAC,EAAE;cACtCJ,WAAW,GAAG,KAAK;;;UAI3B,IAAIF,MAAM,CAACO,YAAY,EAAE,IAAIP,MAAM,CAACQ,SAAS,CAACC,kBAAkB,IAAIP,WAAW,EAAE;YAAA,IAAAQ,aAAA,EAAAC,qBAAA;YAC7E,MAAMC,SAAS,GAAGC,oBAAoB,EAAAH,aAAA,GAACZ,GAAG,CAACgB,QAAQ,cAAAJ,aAAA,uBAAZA,aAAA,CAAeV,MAAM,CAACM,EAAE,CAAC,GAAAK,qBAAA,GAAEX,MAAM,CAACQ,SAAS,CAACrB,IAAI,cAAAwB,qBAAA,uBAArBA,qBAAA,CAAuBI,QAAQ,CAAC;;YAGlG,IAAIH,SAAS,KAAKI,SAAS,IAAIC,cAAc,CAACL,SAAS,EAAE7B,KAAK,CAAC,EAAE;cAC7DM,OAAO,CAAC6B,IAAI,CAAC,CAACnB,QAAQ,EAAEE,WAAW,CAAC,CAAC;;;SAGhD,CAAC,OAAOkB,CAAC,EAAE;;;OAGf,CAAC;KACL,CAAC;IAEFlC,SAAS,CAACmC,MAAM,CAACC,2BAA2B,CAAChC,OAAO,CAAC;IAErD,IAAIA,OAAO,CAACc,MAAM,EAAE;MAChBf,aAAa,GAAGC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;MAC7BJ,SAAS,CAACmC,MAAM,CAACE,8BAA8B,CAAC,CAAC,CAAC;KACrD,MAAM;MACHrC,SAAS,CAACmC,MAAM,CAACE,8BAA8B,CAACN,SAAS,CAAC;;GAEjE,MAAM;IACH/B,SAAS,CAACmC,MAAM,CAACC,2BAA2B,CAAC,EAAE,CAAC;IAChDpC,SAAS,CAACmC,MAAM,CAACE,8BAA8B,CAACN,SAAS,CAAC;;EAG9D,IAAI5B,aAAa,KAAK4B,SAAS,EAAE;IAC7B/B,SAAS,CAACsC,SAAS,CAACC,iBAAiB,CAACpC,aAAa,CAAC;;EAGxD,OAAOA,aAAa;AACxB;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.js","sources":["../../../../../../../../../src/primitives/Table/useTable/util/settings.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\n\nexport function getSettings<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const state = table.getState();\n\n return {\n //columnFilters: table.options.enableColumnFilters ? state.columnFilters : undefined,\n columnOrder: meta.columnOrdering.isEnabled ? state.columnOrder : undefined,\n columnPinning: state.columnPinning,\n columnSizing: state.columnSizing,\n columnVisibility: table.options.enableHiding ? state.columnVisibility : undefined,\n // @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel\n excludeUnmatchedRecordsInSearch: meta.search.excludeUnmatchedResults,\n fontSize: meta.fontSize.isEnabled ? meta.fontSize.size : undefined,\n grouping: table.options.enableGrouping ? state.grouping : undefined,\n rowHeight: meta.rowHeight.isEnabled ? meta.rowHeight.height : undefined,\n showWarningWhenPrintingLargeDataset: meta.printing.isWarningVisibleForLargeDatasets,\n //searchQuery: table.options.enableGlobalFilter ? state.globalFilter : undefined,\n sorting: state.sorting,\n };\n}\n"],"names":["getSettings","table","meta","options","state","getState","columnOrder","columnOrdering","isEnabled","undefined","columnPinning","columnSizing","columnVisibility","enableHiding","excludeUnmatchedRecordsInSearch","search","excludeUnmatchedResults","fontSize","size","grouping","enableGrouping","rowHeight","height","showWarningWhenPrintingLargeDataset","printing","isWarningVisibleForLargeDatasets","sorting"],"mappings":"SAEgBA,WAAWA,CAAkBC,KAAwB;EACjE,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EACxD,MAAME,KAAK,GAAGH,KAAK,CAACI,QAAQ,EAAE;EAE9B,OAAO;;IAEHC,WAAW,EAAEJ,IAAI,CAACK,cAAc,CAACC,SAAS,GAAGJ,KAAK,CAACE,WAAW,GAAGG,SAAS;IAC1EC,aAAa,EAAEN,KAAK,CAACM,aAAa;IAClCC,YAAY,EAAEP,KAAK,CAACO,YAAY;IAChCC,gBAAgB,EAAEX,KAAK,CAACE,OAAO,CAACU,YAAY,GAAGT,KAAK,CAACQ,gBAAgB,GAAGH,SAAS;;IAEjFK,+BAA+B,EAAEZ,IAAI,CAACa,MAAM,CAACC,uBAAuB;IACpEC,QAAQ,EAAEf,IAAI,CAACe,QAAQ,CAACT,SAAS,GAAGN,IAAI,CAACe,QAAQ,CAACC,IAAI,GAAGT,SAAS;IAClEU,QAAQ,EAAElB,KAAK,CAACE,OAAO,CAACiB,cAAc,GAAGhB,KAAK,CAACe,QAAQ,GAAGV,SAAS;IACnEY,SAAS,EAAEnB,IAAI,CAACmB,SAAS,CAACb,SAAS,GAAGN,IAAI,CAACmB,SAAS,CAACC,MAAM,GAAGb,SAAS;IACvEc,mCAAmC,EAAErB,IAAI,CAACsB,QAAQ,CAACC,gCAAgC;;IAEnFC,OAAO,EAAEtB,KAAK,CAACsB;GAClB;AACL;;;;"}
|