@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
@@ -4061,8 +4061,17 @@ function isElementInsideOrTriggeredFromContainer(element, container) {
|
|
4061
4061
|
}
|
4062
4062
|
return !!(container !== null && container !== void 0 && container.contains(element));
|
4063
4063
|
}
|
4064
|
-
function
|
4065
|
-
|
4064
|
+
function isElementInsideOverlay(element) {
|
4065
|
+
return !!(element !== null && element !== void 0 && element.closest('[role=dialog],[role=menu]'));
|
4066
|
+
}
|
4067
|
+
function isSiblingElementInsideSameParentOverlay(element, sibling) {
|
4068
|
+
var _element$closest2;
|
4069
|
+
return !!(element !== null && element !== void 0 && (_element$closest2 = element.closest('[role=dialog],[role=menu]')) !== null && _element$closest2 !== void 0 && _element$closest2.contains(sibling));
|
4070
|
+
}
|
4071
|
+
function isElementInteractive(element) {
|
4072
|
+
if (!element) {
|
4073
|
+
return false;
|
4074
|
+
}
|
4066
4075
|
return ['A', 'BUTTON', 'INPUT', 'TEXTAREA', 'SELECT', 'LABEL', 'OPTION'].includes(element.tagName) && !element.hidden && !element.disabled && !element.readOnly;
|
4067
4076
|
}
|
4068
4077
|
|
@@ -4085,7 +4094,7 @@ function shouldTriggerShortcut(event, key) {
|
|
4085
4094
|
}
|
4086
4095
|
function createShortcutKeyDownHandler(key, handler, stopPropagation = true) {
|
4087
4096
|
return function (event) {
|
4088
|
-
if (event.target !== event.currentTarget &&
|
4097
|
+
if (event.target !== event.currentTarget && isElementInteractive(event.target) && !isPressingMetaKey(event)) {
|
4089
4098
|
return;
|
4090
4099
|
}
|
4091
4100
|
const condition = shouldTriggerShortcut(event, key);
|
@@ -4142,6 +4151,7 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
|
4142
4151
|
});
|
4143
4152
|
const Tag = props.href ? 'a' : 'button';
|
4144
4153
|
return /*#__PURE__*/React.createElement(Tag, Object.assign({}, otherProps, {
|
4154
|
+
href: disabled ? undefined : props.href,
|
4145
4155
|
"aria-disabled": disabled ? 'true' : undefined,
|
4146
4156
|
disabled: disabled,
|
4147
4157
|
target: Tag === 'a' ? target : undefined,
|
@@ -4184,29 +4194,29 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(props, ref) {
|
|
4184
4194
|
});
|
4185
4195
|
|
4186
4196
|
const getButtonClasses = () => {
|
4187
|
-
return 'flex-shrink-0 min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] gap-1 h-max leading-5 inline-flex items-center justify-center focus-visible:yt-focus disabled:cursor-not-allowed';
|
4197
|
+
return 'flex-shrink-0 min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] gap-1 h-max leading-5 inline-flex items-center justify-center focus-visible:yt-focus aria-disabled:cursor-not-allowed';
|
4188
4198
|
};
|
4189
4199
|
const getAppearanceClasses = (value, icon = false) => {
|
4190
4200
|
switch (value) {
|
4191
4201
|
case 'primary':
|
4192
|
-
return `wcag-blue-500
|
4202
|
+
return `wcag-blue-500 visited:wcag-blue-500 hover:wcag-blue-700 hover:active:wcag-blue-500 aria-disabled:bg-blue-500/50 aria-disabled:active:bg-blue-500/50`;
|
4193
4203
|
case 'danger':
|
4194
|
-
return `wcag-red-500
|
4204
|
+
return `wcag-red-500 visited:wcag-red-500 hover:wcag-red-700 hover:active:wcag-red-500 aria-disabled:bg-red-500/50 aria-disabled:active:bg-red-500/50`;
|
4195
4205
|
case 'ghost':
|
4196
|
-
return `bg-white border border-blue-500 text-blue-500
|
4206
|
+
return `bg-white border border-blue-500 text-blue-500 visited:text-blue-500 hover:bg-blue-100 hover:text-blue-700 aria-disabled:border-blue-500/50 aria-disabled:text-blue-500/50 aria-disabled:bg-white`;
|
4197
4207
|
case 'discrete':
|
4198
4208
|
{
|
4199
4209
|
if (icon) {
|
4200
|
-
return `bg-transparent text-black
|
4210
|
+
return `bg-transparent text-black visited:text-black hover:bg-[#000]/[0.08] aria-disabled:text-black/30`;
|
4201
4211
|
}
|
4202
|
-
return `bg-transparent text-blue-500
|
4212
|
+
return `bg-transparent text-blue-500 visited:text-blue-500 hover:text-blue-700 aria-disabled:text-blue-500/50`;
|
4203
4213
|
}
|
4204
4214
|
case 'transparent':
|
4205
4215
|
{
|
4206
|
-
return `bg-transparent text-black
|
4216
|
+
return `bg-transparent text-black visited:text-black hover:text-black hover:bg-[#000]/[0.08] aria-disabled:text-black/30 aria-disabled:bg-transparent`;
|
4207
4217
|
}
|
4208
4218
|
default:
|
4209
|
-
return `wcag-grey-200
|
4219
|
+
return `wcag-grey-200 visited:wcag-grey-200 hover:wcag-grey-300 aria-disabled:bg-grey-200/50 aria-disabled:text-black/30`;
|
4210
4220
|
}
|
4211
4221
|
};
|
4212
4222
|
const createButtonWithTooltip = (props, className, ref) => {
|
@@ -4383,6 +4393,8 @@ const defaultLocalisationTexts = {
|
|
4383
4393
|
expandAll: 'Expand all rows'
|
4384
4394
|
},
|
4385
4395
|
menu: {
|
4396
|
+
editFilter: 'Edit filter',
|
4397
|
+
filter: 'Filter',
|
4386
4398
|
freezeFirstColumn: 'Freeze the first column',
|
4387
4399
|
freezeUptoColumn: `Freeze first [TOTAL] columns`,
|
4388
4400
|
freezeColumns: (count = 1) => count === 1 ? 'Freeze the first column' : `Freeze first ${count} columns`,
|
@@ -4592,7 +4604,11 @@ const defaultLocalisationTexts = {
|
|
4592
4604
|
delete: 'Delete',
|
4593
4605
|
save: 'Save',
|
4594
4606
|
search: 'Search...',
|
4595
|
-
searchOrCreate: 'Search or create...'
|
4607
|
+
searchOrCreate: 'Search or create...',
|
4608
|
+
selectAll: 'Select all',
|
4609
|
+
selectAllResults: 'Select all results',
|
4610
|
+
deselectAll: 'Deselect all',
|
4611
|
+
deselectAllResults: 'Deselect all results'
|
4596
4612
|
},
|
4597
4613
|
toasts: {
|
4598
4614
|
dismiss: 'Dismiss'
|
@@ -4872,6 +4888,7 @@ const Content$2 = /*#__PURE__*/React.forwardRef(function CardContent(externalPro
|
|
4872
4888
|
}, props.className);
|
4873
4889
|
return /*#__PURE__*/React.createElement("div", Object.assign({}, props, {
|
4874
4890
|
className: className,
|
4891
|
+
"data-taco": "card-content",
|
4875
4892
|
ref: ref
|
4876
4893
|
}));
|
4877
4894
|
});
|
@@ -4881,7 +4898,7 @@ const Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
|
|
4881
4898
|
menu,
|
4882
4899
|
children
|
4883
4900
|
} = props;
|
4884
|
-
const className = cn('bg-white flex flex-col rounded-xl border border-solid border-radius-[12px] border-grey-300 hover:border-grey-500
|
4901
|
+
const className = cn('bg-white flex flex-col rounded-xl border border-solid border-radius-[12px] border-grey-300 hover:border-grey-500', props.className);
|
4885
4902
|
return /*#__PURE__*/React.createElement("div", {
|
4886
4903
|
className: className,
|
4887
4904
|
"data-taco": "card",
|
@@ -4906,12 +4923,52 @@ const useId = nativeId => {
|
|
4906
4923
|
return React__default.useMemo(() => nativeId !== null && nativeId !== void 0 ? nativeId : uuid.v4(), []);
|
4907
4924
|
};
|
4908
4925
|
|
4926
|
+
const Spinner = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
|
4927
|
+
const {
|
4928
|
+
delay = 350,
|
4929
|
+
label,
|
4930
|
+
...otherProps
|
4931
|
+
} = props;
|
4932
|
+
const [visible, setVisibility] = React__default.useState(!delay);
|
4933
|
+
React__default.useEffect(() => {
|
4934
|
+
let timeout;
|
4935
|
+
if (delay) {
|
4936
|
+
timeout = window.setTimeout(() => setVisibility(true), delay);
|
4937
|
+
}
|
4938
|
+
return () => {
|
4939
|
+
if (timeout) {
|
4940
|
+
clearTimeout(timeout);
|
4941
|
+
}
|
4942
|
+
};
|
4943
|
+
}, [delay]);
|
4944
|
+
if (!visible) {
|
4945
|
+
return null;
|
4946
|
+
}
|
4947
|
+
const className = cn('inline-flex flex-col relative items-center', otherProps.className);
|
4948
|
+
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, otherProps, {
|
4949
|
+
className: className,
|
4950
|
+
"data-taco": "spinner",
|
4951
|
+
ref: ref
|
4952
|
+
}), /*#__PURE__*/React__default.createElement("svg", {
|
4953
|
+
className: "h-10 w-10 animate-[spinnerRotation_2s_linear_infinite]",
|
4954
|
+
viewBox: "0 0 100 100",
|
4955
|
+
xmlns: "http://www.w3.org/2000/svg"
|
4956
|
+
}, /*#__PURE__*/React__default.createElement("circle", {
|
4957
|
+
cx: "50",
|
4958
|
+
cy: "50",
|
4959
|
+
r: "45"
|
4960
|
+
})), label && /*#__PURE__*/React__default.createElement("span", {
|
4961
|
+
className: "mt-4"
|
4962
|
+
}, label));
|
4963
|
+
});
|
4964
|
+
|
4909
4965
|
const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
4910
4966
|
const {
|
4911
4967
|
checked,
|
4912
4968
|
indeterminate,
|
4913
4969
|
invalid,
|
4914
4970
|
label,
|
4971
|
+
loading,
|
4915
4972
|
onChange,
|
4916
4973
|
...otherProps
|
4917
4974
|
} = props;
|
@@ -4942,6 +4999,11 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4942
4999
|
event.currentTarget.click();
|
4943
5000
|
}
|
4944
5001
|
};
|
5002
|
+
const spinnerClassname = cn(
|
5003
|
+
//Spinner is slightly bigger then 'line' and 'tick' icons, so making it 2px smaller from each side
|
5004
|
+
"m-0.5 !h-[calc(100%-theme('spacing.1'))] !w-[calc(100%-theme('spacing.1'))]", {
|
5005
|
+
'text-blue-500': !checked && !indeterminate
|
5006
|
+
});
|
4945
5007
|
const element = /*#__PURE__*/React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, labelledByProps, {
|
4946
5008
|
"aria-invalid": invalid ? 'true' : undefined,
|
4947
5009
|
"data-taco": "checkbox",
|
@@ -4950,12 +5012,14 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4950
5012
|
onCheckedChange: handleChange,
|
4951
5013
|
onKeyDown: handleKeyDown,
|
4952
5014
|
ref: ref
|
4953
|
-
}), /*#__PURE__*/React.createElement(
|
5015
|
+
}), loading ? ( /*#__PURE__*/React.createElement(Spinner, {
|
5016
|
+
className: spinnerClassname
|
5017
|
+
})) : ( /*#__PURE__*/React.createElement(CheckboxPrimitive.Indicator, {
|
4954
5018
|
className: "flex h-full w-full"
|
4955
5019
|
}, /*#__PURE__*/React.createElement(Icon, {
|
4956
5020
|
name: indeterminate ? 'line' : 'tick',
|
4957
5021
|
className: "!h-full !w-full"
|
4958
|
-
})));
|
5022
|
+
}))));
|
4959
5023
|
if (label) {
|
4960
5024
|
const labelContainerClassName = cn('flex items-center cursor-pointer gap-2', {
|
4961
5025
|
'cursor-not-allowed text-grey-300': props.disabled
|
@@ -5254,45 +5318,6 @@ const useListScrollTo = (internalRef, itemRefs) => {
|
|
5254
5318
|
};
|
5255
5319
|
};
|
5256
5320
|
|
5257
|
-
const Spinner = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
|
5258
|
-
const {
|
5259
|
-
delay = 350,
|
5260
|
-
label,
|
5261
|
-
...otherProps
|
5262
|
-
} = props;
|
5263
|
-
const [visible, setVisibility] = React__default.useState(!delay);
|
5264
|
-
React__default.useEffect(() => {
|
5265
|
-
let timeout;
|
5266
|
-
if (delay) {
|
5267
|
-
timeout = window.setTimeout(() => setVisibility(true), delay);
|
5268
|
-
}
|
5269
|
-
return () => {
|
5270
|
-
if (timeout) {
|
5271
|
-
clearTimeout(timeout);
|
5272
|
-
}
|
5273
|
-
};
|
5274
|
-
}, [delay]);
|
5275
|
-
if (!visible) {
|
5276
|
-
return null;
|
5277
|
-
}
|
5278
|
-
const className = cn('inline-flex flex-col relative items-center', otherProps.className);
|
5279
|
-
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, otherProps, {
|
5280
|
-
className: className,
|
5281
|
-
"data-taco": "spinner",
|
5282
|
-
ref: ref
|
5283
|
-
}), /*#__PURE__*/React__default.createElement("svg", {
|
5284
|
-
className: "h-10 w-10 animate-[spinnerRotation_2s_linear_infinite]",
|
5285
|
-
viewBox: "0 0 100 100",
|
5286
|
-
xmlns: "http://www.w3.org/2000/svg"
|
5287
|
-
}, /*#__PURE__*/React__default.createElement("circle", {
|
5288
|
-
cx: "50",
|
5289
|
-
cy: "50",
|
5290
|
-
r: "45"
|
5291
|
-
})), label && /*#__PURE__*/React__default.createElement("span", {
|
5292
|
-
className: "mt-4"
|
5293
|
-
}, label));
|
5294
|
-
});
|
5295
|
-
|
5296
5321
|
const getId = (id, value) => `${id}_${value}`;
|
5297
5322
|
const getNextEnabledItem = (event, data, index) => {
|
5298
5323
|
const nextIndex = getNextIndexFromKey(event.key, data.length, index);
|
@@ -7873,6 +7898,15 @@ const Link = /*#__PURE__*/React.forwardRef(function MenuLink(props, ref) {
|
|
7873
7898
|
const Trigger$6 = /*#__PURE__*/React.forwardRef(function MenuTrigger(props, ref) {
|
7874
7899
|
const menu = useCurrentMenu();
|
7875
7900
|
const internalRef = useMergedRef(ref);
|
7901
|
+
const preventArrowDownShortcut = event => {
|
7902
|
+
var _internalRef$current, _internalRef$current2;
|
7903
|
+
const isRenderedInTable = !!((_internalRef$current = internalRef.current) !== null && _internalRef$current !== void 0 && _internalRef$current.closest('[data-taco="table2-body"]'));
|
7904
|
+
const isRenderedInReport = !!((_internalRef$current2 = internalRef.current) !== null && _internalRef$current2 !== void 0 && _internalRef$current2.closest('[data-taco="report-body"]'));
|
7905
|
+
if ((isRenderedInTable || isRenderedInReport) && event.key === 'ArrowDown') {
|
7906
|
+
var _internalRef$current3, _internalRef$current4;
|
7907
|
+
internalRef === null || internalRef === void 0 ? void 0 : (_internalRef$current3 = internalRef.current) === null || _internalRef$current3 === void 0 ? void 0 : (_internalRef$current4 = _internalRef$current3.parentNode) === null || _internalRef$current4 === void 0 ? void 0 : _internalRef$current4.dispatchEvent(createCustomKeyboardEvent(event));
|
7908
|
+
}
|
7909
|
+
};
|
7876
7910
|
React.useEffect(() => {
|
7877
7911
|
if (internalRef.current) {
|
7878
7912
|
menu === null || menu === void 0 ? void 0 : menu.setMinWidth(internalRef.current.getBoundingClientRect().width);
|
@@ -7880,7 +7914,8 @@ const Trigger$6 = /*#__PURE__*/React.forwardRef(function MenuTrigger(props, ref)
|
|
7880
7914
|
}, [internalRef]);
|
7881
7915
|
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Trigger, Object.assign({}, props, {
|
7882
7916
|
asChild: true,
|
7883
|
-
ref: internalRef
|
7917
|
+
ref: internalRef,
|
7918
|
+
onKeyDown: preventArrowDownShortcut
|
7884
7919
|
}));
|
7885
7920
|
});
|
7886
7921
|
|
@@ -9277,13 +9312,32 @@ function getCellValueAsString(value, dataType) {
|
|
9277
9312
|
}
|
9278
9313
|
return String(value);
|
9279
9314
|
}
|
9315
|
+
function orderColumn(column, {
|
9316
|
+
orderingDisabled,
|
9317
|
+
orderingEnabled
|
9318
|
+
}) {
|
9319
|
+
const groupedColumn = column;
|
9320
|
+
if (Array.isArray(groupedColumn.columns) && groupedColumn.columns.length > 0) {
|
9321
|
+
groupedColumn.columns.forEach(subcolumn => orderColumn(subcolumn, {
|
9322
|
+
orderingDisabled,
|
9323
|
+
orderingEnabled
|
9324
|
+
}));
|
9325
|
+
} else {
|
9326
|
+
var _column$meta;
|
9327
|
+
if ((_column$meta = column.meta) !== null && _column$meta !== void 0 && _column$meta.enableOrdering) {
|
9328
|
+
orderingEnabled.push(column.id);
|
9329
|
+
} else {
|
9330
|
+
orderingDisabled.push(column.id);
|
9331
|
+
}
|
9332
|
+
}
|
9333
|
+
}
|
9280
9334
|
// ordering
|
9281
9335
|
function ensureOrdering(columns, settingsOrder, internalColumnsPinnedToTheRight = ['__actions']) {
|
9282
9336
|
// internal columns come with a defined order
|
9283
9337
|
const internalColumns = columns.filter(column => isInternalColumn(column.id) && !internalColumnsPinnedToTheRight.includes(String(column.id))).map(column => column.id);
|
9284
9338
|
// columns with ordering disabled should be moved to the front
|
9285
9339
|
const orderingDisabled = [];
|
9286
|
-
|
9340
|
+
let orderingEnabled = [];
|
9287
9341
|
let orderedColumns = columns;
|
9288
9342
|
// if settings is defined, make sure the columns that are actual children are sorted by it
|
9289
9343
|
if (Array.isArray(settingsOrder)) {
|
@@ -9292,16 +9346,23 @@ function ensureOrdering(columns, settingsOrder, internalColumnsPinnedToTheRight
|
|
9292
9346
|
(a, b) => (settingsOrder.indexOf(a.id) >>> 0) - (settingsOrder.indexOf(b.id) >>> 0));
|
9293
9347
|
}
|
9294
9348
|
orderedColumns.forEach(column => {
|
9295
|
-
var _column$meta;
|
9296
9349
|
if (isInternalColumn(column.id)) {
|
9297
9350
|
return;
|
9298
9351
|
}
|
9299
|
-
|
9300
|
-
|
9301
|
-
|
9302
|
-
|
9303
|
-
}
|
9352
|
+
orderColumn(column, {
|
9353
|
+
orderingDisabled,
|
9354
|
+
orderingEnabled
|
9355
|
+
});
|
9304
9356
|
});
|
9357
|
+
if (settingsOrder && settingsOrder.length > 0) {
|
9358
|
+
orderingEnabled = orderingEnabled.reduce((acc, column) => {
|
9359
|
+
const index = settingsOrder.indexOf(column);
|
9360
|
+
if (index > -1) {
|
9361
|
+
acc[index] = column;
|
9362
|
+
}
|
9363
|
+
return acc;
|
9364
|
+
}, []).filter(column => !!column);
|
9365
|
+
}
|
9305
9366
|
const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];
|
9306
9367
|
// actions should always be last, enforce that
|
9307
9368
|
internalColumnsPinnedToTheRight.forEach(id => {
|
@@ -9896,17 +9957,79 @@ function useTableFontSize(isEnabled = false, defaultFontSize = 'medium') {
|
|
9896
9957
|
};
|
9897
9958
|
}
|
9898
9959
|
|
9899
|
-
function
|
9960
|
+
function useTacoSettings() {
|
9961
|
+
return React__default.useContext(TacoContext);
|
9962
|
+
}
|
9963
|
+
|
9964
|
+
const useLocalStorage = (key, initialValue) => {
|
9965
|
+
const [state, setState] = React__default.useState(() => {
|
9966
|
+
if (!key) {
|
9967
|
+
return initialValue;
|
9968
|
+
}
|
9969
|
+
try {
|
9970
|
+
const localStorageValue = localStorage.getItem(key);
|
9971
|
+
if (typeof localStorageValue !== 'string') {
|
9972
|
+
localStorage.setItem(key, JSON.stringify(initialValue));
|
9973
|
+
return initialValue;
|
9974
|
+
} else {
|
9975
|
+
return JSON.parse(localStorageValue || 'null');
|
9976
|
+
}
|
9977
|
+
} catch {
|
9978
|
+
// If user is in private mode or has storage restriction
|
9979
|
+
// localStorage can throw. JSON.parse and JSON.stringify
|
9980
|
+
// can throw, too.
|
9981
|
+
return initialValue;
|
9982
|
+
}
|
9983
|
+
});
|
9984
|
+
React__default.useEffect(() => {
|
9985
|
+
if (!key) {
|
9986
|
+
return;
|
9987
|
+
}
|
9988
|
+
try {
|
9989
|
+
const serializedState = JSON.stringify(state);
|
9990
|
+
localStorage.setItem(key, serializedState);
|
9991
|
+
} catch {
|
9992
|
+
// If user is in private mode or has storage restriction
|
9993
|
+
// localStorage can throw. Also JSON.stringify can throw.
|
9994
|
+
}
|
9995
|
+
}, [key, state]);
|
9996
|
+
const clear = () => {
|
9997
|
+
if (key) {
|
9998
|
+
localStorage.removeItem(key);
|
9999
|
+
}
|
10000
|
+
};
|
10001
|
+
return [state, setState, clear];
|
10002
|
+
};
|
10003
|
+
|
10004
|
+
function useTablePrinting(isEnabled = false, tableId) {
|
9900
10005
|
const [isPrinting, setIsPrinting] = React__default.useState(false);
|
9901
|
-
const [
|
10006
|
+
const [settings, setSetting] = useTablePrintingSettings(tableId);
|
9902
10007
|
return {
|
9903
10008
|
isEnabled,
|
9904
10009
|
isPrinting,
|
9905
10010
|
setIsPrinting,
|
9906
|
-
|
9907
|
-
|
10011
|
+
settings,
|
10012
|
+
setSetting
|
9908
10013
|
};
|
9909
10014
|
}
|
10015
|
+
const DEFAULT_PRINT_SETTINGS = {
|
10016
|
+
size: 'A4',
|
10017
|
+
orientation: 'portrait',
|
10018
|
+
allRows: true,
|
10019
|
+
splitGroups: true
|
10020
|
+
};
|
10021
|
+
function useTablePrintingSettings(tableId) {
|
10022
|
+
const tacoSettings = useTacoSettings();
|
10023
|
+
const uniqueId = `taco.${tacoSettings.uniqueUserIdentifier}.table.${tableId}.print.settings`;
|
10024
|
+
const [persistedSettings, setPersistedSettings] = useLocalStorage(uniqueId, DEFAULT_PRINT_SETTINGS);
|
10025
|
+
function setSetting(key, value) {
|
10026
|
+
setPersistedSettings(currentSettings => ({
|
10027
|
+
...currentSettings,
|
10028
|
+
[key]: value
|
10029
|
+
}));
|
10030
|
+
}
|
10031
|
+
return [persistedSettings, setSetting];
|
10032
|
+
}
|
9910
10033
|
|
9911
10034
|
const DEFAULT_ROW_ACTIONS_LENGTH = 4;
|
9912
10035
|
function useTableRowActions(isEnabled = false, rowActions, rowActionsLength = DEFAULT_ROW_ACTIONS_LENGTH) {
|
@@ -10336,50 +10459,6 @@ function useTableServerLoading(loadPage, loadAll, pageSize = DEFAULT_PAGE_SIZE)
|
|
10336
10459
|
};
|
10337
10460
|
}
|
10338
10461
|
|
10339
|
-
const useLocalStorage = (key, initialValue) => {
|
10340
|
-
const [state, setState] = React__default.useState(() => {
|
10341
|
-
if (!key) {
|
10342
|
-
return initialValue;
|
10343
|
-
}
|
10344
|
-
try {
|
10345
|
-
const localStorageValue = localStorage.getItem(key);
|
10346
|
-
if (typeof localStorageValue !== 'string') {
|
10347
|
-
localStorage.setItem(key, JSON.stringify(initialValue));
|
10348
|
-
return initialValue;
|
10349
|
-
} else {
|
10350
|
-
return JSON.parse(localStorageValue || 'null');
|
10351
|
-
}
|
10352
|
-
} catch {
|
10353
|
-
// If user is in private mode or has storage restriction
|
10354
|
-
// localStorage can throw. JSON.parse and JSON.stringify
|
10355
|
-
// can throw, too.
|
10356
|
-
return initialValue;
|
10357
|
-
}
|
10358
|
-
});
|
10359
|
-
React__default.useEffect(() => {
|
10360
|
-
if (!key) {
|
10361
|
-
return;
|
10362
|
-
}
|
10363
|
-
try {
|
10364
|
-
const serializedState = JSON.stringify(state);
|
10365
|
-
localStorage.setItem(key, serializedState);
|
10366
|
-
} catch {
|
10367
|
-
// If user is in private mode or has storage restriction
|
10368
|
-
// localStorage can throw. Also JSON.stringify can throw.
|
10369
|
-
}
|
10370
|
-
}, [key, state]);
|
10371
|
-
const clear = () => {
|
10372
|
-
if (key) {
|
10373
|
-
localStorage.removeItem(key);
|
10374
|
-
}
|
10375
|
-
};
|
10376
|
-
return [state, setState, clear];
|
10377
|
-
};
|
10378
|
-
|
10379
|
-
function useTacoSettings() {
|
10380
|
-
return React__default.useContext(TacoContext);
|
10381
|
-
}
|
10382
|
-
|
10383
10462
|
const DEFAULT_ENABLED_OPTIONS = {
|
10384
10463
|
columnOrder: true,
|
10385
10464
|
columnPinning: true,
|
@@ -10389,7 +10468,6 @@ const DEFAULT_ENABLED_OPTIONS = {
|
|
10389
10468
|
fontSize: true,
|
10390
10469
|
grouping: true,
|
10391
10470
|
rowHeight: true,
|
10392
|
-
showWarningWhenPrintingLargeDataset: true,
|
10393
10471
|
sorting: true
|
10394
10472
|
};
|
10395
10473
|
function useUniqueTableId(tableId) {
|
@@ -10618,7 +10696,6 @@ function getSettings(table) {
|
|
10618
10696
|
fontSize: meta.fontSize.isEnabled ? meta.fontSize.size : undefined,
|
10619
10697
|
grouping: table.options.enableGrouping ? state.grouping : undefined,
|
10620
10698
|
rowHeight: meta.rowHeight.isEnabled ? meta.rowHeight.height : undefined,
|
10621
|
-
showWarningWhenPrintingLargeDataset: meta.printing.isWarningVisibleForLargeDatasets,
|
10622
10699
|
//searchQuery: table.options.enableGlobalFilter ? state.globalFilter : undefined,
|
10623
10700
|
sorting: state.sorting
|
10624
10701
|
};
|
@@ -10640,7 +10717,7 @@ function useTableSettingsListener(table, onChangeSettings) {
|
|
10640
10717
|
//state.columnFilters,
|
10641
10718
|
state.columnOrder, state.columnPinning, state.columnSizing, state.columnVisibility,
|
10642
10719
|
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
10643
|
-
meta.search.excludeUnmatchedResults, meta.fontSize.size, state.grouping, meta.rowHeight.height,
|
10720
|
+
meta.search.excludeUnmatchedResults, meta.fontSize.size, state.grouping, meta.rowHeight.height,
|
10644
10721
|
//state.globalFilter,
|
10645
10722
|
state.sorting]);
|
10646
10723
|
}
|
@@ -10729,8 +10806,8 @@ function useTableRef(table, ref) {
|
|
10729
10806
|
}, [table, ref.current]);
|
10730
10807
|
}
|
10731
10808
|
|
10732
|
-
function
|
10733
|
-
var _props$length, _instance$options$met;
|
10809
|
+
function useTableManager(props, ref, meta, internalColumns) {
|
10810
|
+
var _props$data, _props$length, _instance$options$met;
|
10734
10811
|
// CSS.escape would be best here, but it doesn't seem to work very well
|
10735
10812
|
const safeId = props.id.replace('.', '_');
|
10736
10813
|
// configure table options, merging props with presets
|
@@ -10742,7 +10819,7 @@ function useTable(props, ref, meta, internalColumns) {
|
|
10742
10819
|
const columnOrdering = useTableColumnOrdering(options.enableColumnOrdering);
|
10743
10820
|
const fontSize = useTableFontSize(options.enableFontSize, settings.fontSize);
|
10744
10821
|
const footer = useTableFooter(options.enableFooter);
|
10745
|
-
const printing = useTablePrinting(options.enablePrinting,
|
10822
|
+
const printing = useTablePrinting(options.enablePrinting, safeId);
|
10746
10823
|
const rowActive = useTableRowActive(options.enableRowActive, props.defaultRowActiveIndex);
|
10747
10824
|
const rowActions = useTableRowActions(options.enableRowActions, props.rowActions, props.rowActionsLength);
|
10748
10825
|
const rowClick = useTableRowClick(options.enableRowClick, props.onRowClick);
|
@@ -10761,10 +10838,13 @@ function useTable(props, ref, meta, internalColumns) {
|
|
10761
10838
|
} = mapTableChildrenToColumns(props, settings, options, internalColumns);
|
10762
10839
|
// configure initial table state
|
10763
10840
|
const initialState = useReactTableInitialState(props, columns, settings, defaultState);
|
10841
|
+
// ensure data is always valid
|
10842
|
+
const data = (_props$data = props.data) !== null && _props$data !== void 0 ? _props$data : [];
|
10843
|
+
const length = (_props$length = props.length) !== null && _props$length !== void 0 ? _props$length : data.length;
|
10764
10844
|
// create a react-table instance
|
10765
10845
|
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
10766
10846
|
const instance = reactTable.useReactTable({
|
10767
|
-
data
|
10847
|
+
data,
|
10768
10848
|
columns,
|
10769
10849
|
// configure initial table state
|
10770
10850
|
initialState,
|
@@ -10780,7 +10860,7 @@ function useTable(props, ref, meta, internalColumns) {
|
|
10780
10860
|
columnOrdering,
|
10781
10861
|
fontSize,
|
10782
10862
|
footer,
|
10783
|
-
|
10863
|
+
length,
|
10784
10864
|
printing,
|
10785
10865
|
rowActions,
|
10786
10866
|
rowActive,
|
@@ -10810,7 +10890,6 @@ function useTable(props, ref, meta, internalColumns) {
|
|
10810
10890
|
return {
|
10811
10891
|
id: safeId,
|
10812
10892
|
instance,
|
10813
|
-
length: (_props$length = props.length) !== null && _props$length !== void 0 ? _props$length : props.data.length,
|
10814
10893
|
meta: (_instance$options$met = instance.options.meta) !== null && _instance$options$met !== void 0 ? _instance$options$met : {},
|
10815
10894
|
state: instance.getState()
|
10816
10895
|
};
|
@@ -10990,6 +11069,7 @@ function Header$3(context) {
|
|
10990
11069
|
key: String(`${isAllRowsSelected}_${isSomeRowsSelected}`),
|
10991
11070
|
checked: isAllRowsSelected,
|
10992
11071
|
indeterminate: isSomeRowsSelected,
|
11072
|
+
loading: tableMeta.server.loadAllStatus === TableServerLoadAllState.Loading,
|
10993
11073
|
onChange: handleChange
|
10994
11074
|
}));
|
10995
11075
|
}
|
@@ -11009,6 +11089,9 @@ function Cell$2(context) {
|
|
11009
11089
|
row,
|
11010
11090
|
table
|
11011
11091
|
} = context;
|
11092
|
+
const {
|
11093
|
+
rowIndex
|
11094
|
+
} = React__default.useContext(RowContext);
|
11012
11095
|
const tableMeta = table.options.meta;
|
11013
11096
|
if (table.options.enableGrouping && (_table$getState$group = table.getState().grouping) !== null && _table$getState$group !== void 0 && _table$getState$group.length && !row.getIsGrouped()) {
|
11014
11097
|
return null;
|
@@ -11016,18 +11099,48 @@ function Cell$2(context) {
|
|
11016
11099
|
const isSelected = row.getIsGrouped() ? row.getIsAllSubRowsSelected() : row.getIsSelected();
|
11017
11100
|
const title = isSelected ? texts.table3.columns.select.deselect : texts.table3.columns.select.select;
|
11018
11101
|
if (table.options.enableMultiRowSelection) {
|
11019
|
-
const handleClick = event
|
11020
|
-
|
11021
|
-
|
11022
|
-
|
11023
|
-
|
11024
|
-
|
11025
|
-
const
|
11026
|
-
|
11027
|
-
|
11028
|
-
|
11102
|
+
const handleClick = function (event) {
|
11103
|
+
try {
|
11104
|
+
function _temp7() {
|
11105
|
+
tableMeta.rowSelection.lastSelectedRowIndex.current = row.index;
|
11106
|
+
}
|
11107
|
+
event.stopPropagation();
|
11108
|
+
const _temp6 = function () {
|
11109
|
+
if (row.getIsGrouped()) {
|
11110
|
+
row.subRows.forEach(row => row.toggleSelected());
|
11111
|
+
} else {
|
11112
|
+
const _temp5 = function () {
|
11113
|
+
if (event.shiftKey) {
|
11114
|
+
var _tableMeta$rowSelecti;
|
11115
|
+
function _temp4() {
|
11116
|
+
table.setRowSelection(currentRowSelection => ({
|
11117
|
+
...currentRowSelection,
|
11118
|
+
...selectedRows.reduce((state, row) => ({
|
11119
|
+
...state,
|
11120
|
+
[row.id]: true
|
11121
|
+
}), {})
|
11122
|
+
}));
|
11123
|
+
}
|
11124
|
+
const [fromIndex, toIndex] = toggleBetween((_tableMeta$rowSelecti = tableMeta.rowSelection.lastSelectedRowIndex.current) !== null && _tableMeta$rowSelecti !== void 0 ? _tableMeta$rowSelecti : 0, rowIndex);
|
11125
|
+
const selectedRows = table.getRowModel().rows.slice(fromIndex, toIndex + 1);
|
11126
|
+
const _temp3 = function () {
|
11127
|
+
if (tableMeta.server.loadAllIfNeeded && selectedRows.some(row => row.original === undefined)) {
|
11128
|
+
// don't pass the search query because we need all data - not filtered data
|
11129
|
+
return Promise.resolve(tableMeta.server.loadAllIfNeeded(table.getState().sorting, table.getState().columnFilters, undefined)).then(function () {});
|
11130
|
+
}
|
11131
|
+
}();
|
11132
|
+
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
|
11133
|
+
} else {
|
11134
|
+
row.toggleSelected();
|
11135
|
+
}
|
11136
|
+
}();
|
11137
|
+
if (_temp5 && _temp5.then) return _temp5.then(function () {});
|
11138
|
+
}
|
11139
|
+
}();
|
11140
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp7) : _temp7(_temp6));
|
11141
|
+
} catch (e) {
|
11142
|
+
return Promise.reject(e);
|
11029
11143
|
}
|
11030
|
-
tableMeta.rowSelection.lastSelectedRowIndex.current = row.index;
|
11031
11144
|
};
|
11032
11145
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
11033
11146
|
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, title, /*#__PURE__*/React__default.createElement(Shortcut, {
|
@@ -11070,7 +11183,7 @@ function useTableRowActiveListener(table, tableRef) {
|
|
11070
11183
|
const activeRow = (_tableRef$current$que = (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.querySelector('tbody tr[data-row-active="true"]')) !== null && _tableRef$current$que !== void 0 ? _tableRef$current$que : null;
|
11071
11184
|
// if the focused element, or it's parent if it's portalled, aren't in the row, then focus the row
|
11072
11185
|
// this ensures the next tab press starts at the row
|
11073
|
-
if (!isElementInsideOrTriggeredFromContainer(document.activeElement, activeRow) && !
|
11186
|
+
if (!isElementInsideOrTriggeredFromContainer(document.activeElement, activeRow) && !isElementInteractive(document.activeElement)) {
|
11074
11187
|
var _activeRow$focus;
|
11075
11188
|
activeRow === null || activeRow === void 0 ? void 0 : (_activeRow$focus = activeRow.focus) === null || _activeRow$focus === void 0 ? void 0 : _activeRow$focus.call(activeRow, {
|
11076
11189
|
preventScroll: true
|
@@ -11082,7 +11195,6 @@ function useTableRowActiveListener(table, tableRef) {
|
|
11082
11195
|
|
11083
11196
|
function useReport(props, ref) {
|
11084
11197
|
const meta = {};
|
11085
|
-
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
11086
11198
|
const INTERNAL_COLUMNS = React__default.useMemo(() => ({
|
11087
11199
|
rowActions: {
|
11088
11200
|
header: Header$1,
|
@@ -11115,7 +11227,8 @@ function useReport(props, ref) {
|
|
11115
11227
|
}
|
11116
11228
|
}
|
11117
11229
|
}), []);
|
11118
|
-
|
11230
|
+
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
11231
|
+
const report = useTableManager(props, ref, meta, INTERNAL_COLUMNS);
|
11119
11232
|
// listeners
|
11120
11233
|
useTableRowActiveListener(report.instance, ref);
|
11121
11234
|
return report;
|
@@ -11292,12 +11405,15 @@ function GotoPopover(props) {
|
|
11292
11405
|
|
11293
11406
|
function HeaderMenu(props) {
|
11294
11407
|
const {
|
11408
|
+
canFilter,
|
11295
11409
|
canGoto,
|
11296
11410
|
canHide,
|
11297
11411
|
canPin,
|
11298
11412
|
canSort,
|
11299
11413
|
customMenu,
|
11300
11414
|
index,
|
11415
|
+
isFiltered,
|
11416
|
+
onFilter: handleFilter,
|
11301
11417
|
onGoto: handleGoto,
|
11302
11418
|
onHide: handleHide,
|
11303
11419
|
onPin: handlePin,
|
@@ -11391,6 +11507,12 @@ function HeaderMenu(props) {
|
|
11391
11507
|
onClick: () => handlePin(undefined)
|
11392
11508
|
}, texts.table3.columns.menu.unfreezeColumns));
|
11393
11509
|
}
|
11510
|
+
if (canFilter && handleFilter) {
|
11511
|
+
menuItems.push( /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
11512
|
+
icon: isFiltered ? 'filter-solid' : 'filter',
|
11513
|
+
onClick: () => handleFilter()
|
11514
|
+
}, isFiltered ? texts.table3.columns.menu.editFilter : texts.table3.columns.menu.filter));
|
11515
|
+
}
|
11394
11516
|
if (customMenu) {
|
11395
11517
|
const menu = customMenu({
|
11396
11518
|
trigger: undefined
|
@@ -11406,7 +11528,7 @@ function HeaderMenu(props) {
|
|
11406
11528
|
return menuItems.map((item, key) => /*#__PURE__*/React__default.cloneElement(item, {
|
11407
11529
|
key
|
11408
11530
|
}));
|
11409
|
-
}, [canGoto, canHide, canPin, canSort, customMenu, handleGoto, handleSortToggle, index, sortDirection]);
|
11531
|
+
}, [canFilter, canGoto, canHide, canPin, canSort, customMenu, handleGoto, handleSortToggle, index, isFiltered, sortDirection]);
|
11410
11532
|
// can't use display: none because the button needs to be focusable
|
11411
11533
|
const className = cn(
|
11412
11534
|
// positioning
|
@@ -11461,6 +11583,7 @@ function Header$4(header) {
|
|
11461
11583
|
const columnMeta = (_header$column$column = header.column.columnDef.meta) !== null && _header$column$column !== void 0 ? _header$column$column : {};
|
11462
11584
|
const isGroup = !!header.subHeaders.length;
|
11463
11585
|
const isPinned = getIsPinned(header);
|
11586
|
+
const canFilter = !header.isPlaceholder && header.column.getCanFilter() && !!table.options.enableColumnFilters;
|
11464
11587
|
const canHide = !header.isPlaceholder && !isGroup && header.column.getCanHide();
|
11465
11588
|
const canMeasureSize = !!table.getRowModel().rows.length;
|
11466
11589
|
const canPin = !header.isPlaceholder && !isGroup && header.column.getCanPin();
|
@@ -11474,6 +11597,7 @@ function Header$4(header) {
|
|
11474
11597
|
// passing header or column results in re-renders on scroll, so anything from those objects as memoed props
|
11475
11598
|
const memoedProps = {
|
11476
11599
|
align: columnMeta.align,
|
11600
|
+
canFilter,
|
11477
11601
|
canHide,
|
11478
11602
|
canGoto,
|
11479
11603
|
canMeasureSize,
|
@@ -11487,6 +11611,7 @@ function Header$4(header) {
|
|
11487
11611
|
defaultWidth: columnMeta.defaultWidth,
|
11488
11612
|
hasMenu,
|
11489
11613
|
id: header.id,
|
11614
|
+
isFiltered: header.column.getIsFiltered(),
|
11490
11615
|
index: header.index,
|
11491
11616
|
isGroup,
|
11492
11617
|
isPinned,
|
@@ -11503,6 +11628,13 @@ function Header$4(header) {
|
|
11503
11628
|
'after:!content-none': nextHeader === null || nextHeader === void 0 ? void 0 : nextHeader.isPlaceholder
|
11504
11629
|
});
|
11505
11630
|
}
|
11631
|
+
if (canFilter) {
|
11632
|
+
memoedProps.onFilter = () => {
|
11633
|
+
header.column.setFilterValue({
|
11634
|
+
comparator: TableFilterComparator.Contains
|
11635
|
+
});
|
11636
|
+
};
|
11637
|
+
}
|
11506
11638
|
if (canGoto) {
|
11507
11639
|
memoedProps.onGoto = query => {
|
11508
11640
|
var _tableMeta$rowGoto$ha, _tableMeta$rowGoto;
|
@@ -11546,6 +11678,7 @@ function Header$4(header) {
|
|
11546
11678
|
const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(props) {
|
11547
11679
|
const {
|
11548
11680
|
align,
|
11681
|
+
canFilter,
|
11549
11682
|
canGoto,
|
11550
11683
|
canHide,
|
11551
11684
|
canMeasureSize,
|
@@ -11560,11 +11693,13 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
11560
11693
|
hasMenu,
|
11561
11694
|
id,
|
11562
11695
|
index,
|
11696
|
+
isFiltered,
|
11563
11697
|
isGroup,
|
11564
11698
|
isPinned,
|
11565
11699
|
isPlaceholder,
|
11566
11700
|
isResizing,
|
11567
11701
|
offset,
|
11702
|
+
onFilter: handleFilter,
|
11568
11703
|
onGoto: handleGoto,
|
11569
11704
|
onHide: handleHide,
|
11570
11705
|
onPin: handlePin,
|
@@ -11605,6 +11740,7 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
11605
11740
|
}, children))), sortDirection ? /*#__PURE__*/React__default.createElement(SortIndicator, {
|
11606
11741
|
direction: sortDirection
|
11607
11742
|
}) : null, hasMenu ? ( /*#__PURE__*/React__default.createElement(HeaderMenu, {
|
11743
|
+
canFilter: canFilter,
|
11608
11744
|
canGoto: canGoto,
|
11609
11745
|
canHide: canHide,
|
11610
11746
|
canPin: canPin,
|
@@ -11615,6 +11751,8 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
11615
11751
|
}),
|
11616
11752
|
customMenu: customMenu,
|
11617
11753
|
index: index,
|
11754
|
+
isFiltered: isFiltered,
|
11755
|
+
onFilter: handleFilter,
|
11618
11756
|
onGoto: handleGoto,
|
11619
11757
|
onHide: handleHide,
|
11620
11758
|
onPin: handlePin,
|
@@ -11652,7 +11790,6 @@ function useAugmentedFocusManager() {
|
|
11652
11790
|
function Body(props) {
|
11653
11791
|
const {
|
11654
11792
|
enableArrowKeyFocusing = false,
|
11655
|
-
length,
|
11656
11793
|
table,
|
11657
11794
|
...attributes
|
11658
11795
|
} = props;
|
@@ -11667,7 +11804,7 @@ function Body(props) {
|
|
11667
11804
|
}
|
11668
11805
|
if (tableMeta.rowActive.rowActiveIndex !== undefined) {
|
11669
11806
|
const isFirstRow = tableMeta.rowActive.rowActiveIndex === 0;
|
11670
|
-
const isLastRow = tableMeta.rowActive.rowActiveIndex === length - 1;
|
11807
|
+
const isLastRow = tableMeta.rowActive.rowActiveIndex === tableMeta.length - 1;
|
11671
11808
|
if (event.key === 'Tab' || enableArrowKeyFocusing && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {
|
11672
11809
|
tableMeta.rowActive.setHoverStatePaused(true);
|
11673
11810
|
const focusedElement = event.shiftKey || event.key === 'ArrowLeft' ? focusManager.focusPrevious() : focusManager.focusNext();
|
@@ -11699,56 +11836,29 @@ function Body(props) {
|
|
11699
11836
|
}
|
11700
11837
|
}
|
11701
11838
|
};
|
11702
|
-
return /*#__PURE__*/React__default.createElement("tbody", Object.assign({
|
11839
|
+
return /*#__PURE__*/React__default.createElement("tbody", Object.assign({
|
11840
|
+
"data-taco": "report-body"
|
11841
|
+
}, attributes, {
|
11703
11842
|
onKeyDown: handleKeyDown,
|
11704
11843
|
ref: ref
|
11705
11844
|
}));
|
11706
11845
|
}
|
11707
11846
|
|
11708
|
-
function Footer$3(header) {
|
11709
|
-
return /*#__PURE__*/React__default.createElement(MemoedFooter, {
|
11710
|
-
key: header.id,
|
11711
|
-
footer: header
|
11712
|
-
});
|
11713
|
-
}
|
11714
|
-
const MemoedFooter = /*#__PURE__*/React__default.memo(function MemoedFooter(props) {
|
11715
|
-
var _footer$subHeaders, _footer$subHeaders$fi;
|
11716
|
-
const {
|
11717
|
-
footer
|
11718
|
-
} = props;
|
11719
|
-
const columnMeta = footer.column.columnDef.meta;
|
11720
|
-
// getIsPinned returns true for split header groups, even if the split group has no pinned sub headers
|
11721
|
-
const isHeaderGroup = !!((_footer$subHeaders = footer.subHeaders) !== null && _footer$subHeaders !== void 0 && _footer$subHeaders.length);
|
11722
|
-
const isPinned = isHeaderGroup ? (_footer$subHeaders$fi = footer.subHeaders.find(x => x.column.getIsPinned())) === null || _footer$subHeaders$fi === void 0 ? void 0 : _footer$subHeaders$fi.column.getIsPinned() : footer.column.getIsPinned();
|
11723
|
-
const style = {};
|
11724
|
-
if (isPinned) {
|
11725
|
-
// pinned columns should be offset from either the left or right
|
11726
|
-
style[isPinned] = `${footer.column.getStart(isPinned) - 1}px`;
|
11727
|
-
}
|
11728
|
-
return /*#__PURE__*/React__default.createElement("td", {
|
11729
|
-
key: footer.id,
|
11730
|
-
"data-cell-align": columnMeta.align,
|
11731
|
-
"data-cell-id": footer.id,
|
11732
|
-
"data-cell-pinned": isPinned ? isPinned : undefined,
|
11733
|
-
style: style
|
11734
|
-
}, footer.isPlaceholder ? null : reactTable.flexRender(footer.column.columnDef.footer, footer.getContext()));
|
11735
|
-
});
|
11736
|
-
|
11737
11847
|
function Summary(props) {
|
11738
11848
|
var _table$getState$colum;
|
11739
11849
|
const {
|
11740
|
-
length,
|
11741
11850
|
table
|
11742
11851
|
} = props;
|
11743
11852
|
const {
|
11744
11853
|
locale,
|
11745
11854
|
texts
|
11746
11855
|
} = useLocalization();
|
11856
|
+
const length = table.options.meta.length;
|
11747
11857
|
const currentLength = table.getRowModel().rows.length;
|
11748
11858
|
let label;
|
11749
11859
|
let count;
|
11750
11860
|
// row selection
|
11751
|
-
const rowsSelectedLength = table.
|
11861
|
+
const rowsSelectedLength = table.getSelectedRowModel().rows.length;
|
11752
11862
|
if (rowsSelectedLength > 0) {
|
11753
11863
|
label = texts.table3.footer.summary.selected;
|
11754
11864
|
count = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(rowsSelectedLength)), "\u00A0", texts.table3.footer.summary.count, "\u00A0", /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(length)));
|
@@ -11763,11 +11873,51 @@ function Summary(props) {
|
|
11763
11873
|
count = /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(length));
|
11764
11874
|
}
|
11765
11875
|
return /*#__PURE__*/React__default.createElement("div", {
|
11766
|
-
className: "
|
11876
|
+
className: "sticky left-0 z-20 flex h-full w-fit items-center whitespace-nowrap bg-white pr-1 shadow-[12px_0px_6px_white]",
|
11767
11877
|
"data-taco": "table2-footer-summary"
|
11768
11878
|
}, label, "\u00A0", count);
|
11769
11879
|
}
|
11770
11880
|
|
11881
|
+
function Footer$3(header) {
|
11882
|
+
return /*#__PURE__*/React__default.createElement(MemoedFooter, {
|
11883
|
+
key: header.id,
|
11884
|
+
footer: header
|
11885
|
+
});
|
11886
|
+
}
|
11887
|
+
const MemoedFooter = /*#__PURE__*/React__default.memo(function MemoedFooter(props) {
|
11888
|
+
var _footer$subHeaders, _footer$subHeaders$fi;
|
11889
|
+
const {
|
11890
|
+
footer
|
11891
|
+
} = props;
|
11892
|
+
const columnMeta = footer.column.columnDef.meta;
|
11893
|
+
// getIsPinned returns true for split header groups, even if the split group has no pinned sub headers
|
11894
|
+
const isHeaderGroup = !!((_footer$subHeaders = footer.subHeaders) !== null && _footer$subHeaders !== void 0 && _footer$subHeaders.length);
|
11895
|
+
const isPinned = isHeaderGroup ? (_footer$subHeaders$fi = footer.subHeaders.find(x => x.column.getIsPinned())) === null || _footer$subHeaders$fi === void 0 ? void 0 : _footer$subHeaders$fi.column.getIsPinned() : footer.column.getIsPinned();
|
11896
|
+
const style = {};
|
11897
|
+
if (isPinned) {
|
11898
|
+
// pinned columns should be offset from either the left or right
|
11899
|
+
style[isPinned] = `${footer.column.getStart(isPinned) - 1}px`;
|
11900
|
+
}
|
11901
|
+
let content;
|
11902
|
+
let align;
|
11903
|
+
if (footer.index === 0) {
|
11904
|
+
align = 'left';
|
11905
|
+
content = /*#__PURE__*/React__default.createElement(Summary, {
|
11906
|
+
table: footer.getContext().table
|
11907
|
+
});
|
11908
|
+
} else {
|
11909
|
+
align = columnMeta.align;
|
11910
|
+
content = footer.isPlaceholder ? null : reactTable.flexRender(footer.column.columnDef.footer, footer.getContext());
|
11911
|
+
}
|
11912
|
+
return /*#__PURE__*/React__default.createElement("td", {
|
11913
|
+
key: footer.id,
|
11914
|
+
"data-cell-align": align,
|
11915
|
+
"data-cell-id": footer.id,
|
11916
|
+
"data-cell-pinned": isPinned ? isPinned : undefined,
|
11917
|
+
style: style
|
11918
|
+
}, content);
|
11919
|
+
});
|
11920
|
+
|
11771
11921
|
const SearchInput2 = /*#__PURE__*/React__default.forwardRef(function SearchInput2(props, ref) {
|
11772
11922
|
var _attributes$ariaLabe, _attributes$placehold;
|
11773
11923
|
const {
|
@@ -11838,6 +11988,7 @@ const SearchInput2 = /*#__PURE__*/React__default.forwardRef(function SearchInput
|
|
11838
11988
|
}
|
11839
11989
|
if (event.key === 'Escape') {
|
11840
11990
|
handleClear();
|
11991
|
+
event.stopPropagation();
|
11841
11992
|
return;
|
11842
11993
|
}
|
11843
11994
|
};
|
@@ -13731,7 +13882,39 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
13731
13882
|
(_internalRef$current = internalRef.current) === null || _internalRef$current === void 0 ? void 0 : _internalRef$current.focus();
|
13732
13883
|
}
|
13733
13884
|
};
|
13734
|
-
const
|
13885
|
+
const selectOptions = searchQuery === '' ? flattenedChildren.map(child => child.key) : filteredChildren.map(child => isGroup(child) ? Array.isArray(child.props.children) && child.props.children.map(subChild => subChild.key) : child.key).flatMap(c => c) || [];
|
13886
|
+
const areAllSelected = Array.isArray(value) && selectOptions.every(option => value.includes(option));
|
13887
|
+
const selectAllText = React__default.useMemo(() => {
|
13888
|
+
if (searchQuery === '') {
|
13889
|
+
if (areAllSelected) {
|
13890
|
+
return texts.select2.deselectAll;
|
13891
|
+
} else {
|
13892
|
+
return texts.select2.selectAll;
|
13893
|
+
}
|
13894
|
+
} else if (areAllSelected) {
|
13895
|
+
return texts.select2.deselectAllResults;
|
13896
|
+
} else {
|
13897
|
+
return texts.select2.selectAllResults;
|
13898
|
+
}
|
13899
|
+
}, [areAllSelected, searchQuery]);
|
13900
|
+
const selectAll = () => {
|
13901
|
+
if (!Array.isArray(value) || value.length === 0) {
|
13902
|
+
setValue(selectOptions);
|
13903
|
+
} else {
|
13904
|
+
// array of all available options which are not selected
|
13905
|
+
const preselectedValues = selectOptions.filter(option => !value.includes(option));
|
13906
|
+
setValue([...value, ...preselectedValues]);
|
13907
|
+
}
|
13908
|
+
};
|
13909
|
+
const deselectAll = () => {
|
13910
|
+
if (searchQuery === '') {
|
13911
|
+
setValue([]);
|
13912
|
+
} else {
|
13913
|
+
const nextValue = Array.isArray(value) && value.filter(subValue => !selectOptions.includes(subValue));
|
13914
|
+
setValue(nextValue);
|
13915
|
+
}
|
13916
|
+
};
|
13917
|
+
const className = cn('border-grey-300 rounded border bg-white py-1.5 shadow-md outline-none"', createCollectionClassName());
|
13735
13918
|
return /*#__PURE__*/React__default.createElement(Select2Context.Provider, {
|
13736
13919
|
value: context
|
13737
13920
|
}, /*#__PURE__*/React__default.createElement(PopoverPrimitive.Root, {
|
@@ -13771,11 +13954,17 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
13771
13954
|
style: {
|
13772
13955
|
minWidth: dimensions !== null && dimensions !== void 0 && dimensions.width ? `${dimensions.width}px` : undefined
|
13773
13956
|
}
|
13774
|
-
}, flattenedChildren.length > 0 || onCreate ? ( /*#__PURE__*/React__default.createElement(Search$2, {
|
13957
|
+
}, flattenedChildren.length > 0 || onCreate ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Search$2, {
|
13775
13958
|
placeholder: onCreate ? texts.select2.searchOrCreate : texts.select2.search,
|
13776
13959
|
ref: searchRef,
|
13777
13960
|
onTabKeyPress: () => setTabTriggeredClose(true)
|
13778
|
-
})
|
13961
|
+
}), multiple && selectOptions.length > 1 && ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Button$1, {
|
13962
|
+
className: "!justify-start",
|
13963
|
+
appearance: "discrete",
|
13964
|
+
onClick: areAllSelected ? deselectAll : selectAll
|
13965
|
+
}, selectAllText), /*#__PURE__*/React__default.createElement("div", {
|
13966
|
+
className: "border-grey-300 mx-3 rounded border-t"
|
13967
|
+
}))))) : null, flattenedChildren.length <= 0 ? ( /*#__PURE__*/React__default.createElement("div", {
|
13779
13968
|
className: "text-grey-700 -mt-0.5 flex h-8 items-center px-2",
|
13780
13969
|
role: "presentation"
|
13781
13970
|
}, "No results found...")) : ( /*#__PURE__*/React__default.createElement(Root$1, {
|
@@ -13922,6 +14111,12 @@ function Print$1(props) {
|
|
13922
14111
|
const lastScrollTopRef = React__default.useRef();
|
13923
14112
|
const toast = useToast();
|
13924
14113
|
const tableMeta = table.options.meta;
|
14114
|
+
const {
|
14115
|
+
allRows,
|
14116
|
+
orientation,
|
14117
|
+
size,
|
14118
|
+
splitGroups
|
14119
|
+
} = tableMeta.printing.settings;
|
13925
14120
|
const togglePrinting = React__default.useCallback(enabled => {
|
13926
14121
|
tableMeta.printing.setIsPrinting(enabled);
|
13927
14122
|
if (tableRef.current) {
|
@@ -13979,10 +14174,6 @@ function Print$1(props) {
|
|
13979
14174
|
return Promise.reject(e);
|
13980
14175
|
}
|
13981
14176
|
};
|
13982
|
-
const [orientation, setOrientation] = React__default.useState('portrait');
|
13983
|
-
const [size, setSize] = React__default.useState('A4');
|
13984
|
-
const [allRows, setAllRows] = React__default.useState(true);
|
13985
|
-
const [splitGroups, setSplitGroups] = React__default.useState(true);
|
13986
14177
|
const printStyle = [`@page { size: ${size} ${orientation}; }`];
|
13987
14178
|
if (!allRows) {
|
13988
14179
|
printStyle.push(`table[data-taco='report']#${tableId} tr:not([data-row-selected="true"]) { display: none; }`);
|
@@ -14008,13 +14199,13 @@ function Print$1(props) {
|
|
14008
14199
|
table: table,
|
14009
14200
|
onAccept: print,
|
14010
14201
|
orientation: orientation,
|
14011
|
-
setOrientation:
|
14202
|
+
setOrientation: value => tableMeta.printing.setSetting('orientation', value),
|
14012
14203
|
size: size,
|
14013
|
-
setSize:
|
14204
|
+
setSize: value => tableMeta.printing.setSetting('size', value),
|
14014
14205
|
allRows: allRows,
|
14015
|
-
setAllRows:
|
14206
|
+
setAllRows: value => tableMeta.printing.setSetting('allRows', value),
|
14016
14207
|
splitGroups: splitGroups,
|
14017
|
-
setSplitGroups:
|
14208
|
+
setSplitGroups: value => tableMeta.printing.setSetting('splitGroups', value)
|
14018
14209
|
}))),
|
14019
14210
|
ref: ref,
|
14020
14211
|
shortcut: shortcut,
|
@@ -14042,8 +14233,11 @@ function sortByHeader(a, b) {
|
|
14042
14233
|
var _a$columnDef$meta, _a$columnDef$meta$hea, _a$columnDef$meta$hea2, _b$columnDef$meta;
|
14043
14234
|
return (_a$columnDef$meta = a.columnDef.meta) === null || _a$columnDef$meta === void 0 ? void 0 : (_a$columnDef$meta$hea = _a$columnDef$meta.header) === null || _a$columnDef$meta$hea === void 0 ? void 0 : (_a$columnDef$meta$hea2 = _a$columnDef$meta$hea.localeCompare) === null || _a$columnDef$meta$hea2 === void 0 ? void 0 : _a$columnDef$meta$hea2.call(_a$columnDef$meta$hea, (_b$columnDef$meta = b.columnDef.meta) === null || _b$columnDef$meta === void 0 ? void 0 : _b$columnDef$meta.header);
|
14044
14235
|
}
|
14236
|
+
function isEmptyFilter(filter) {
|
14237
|
+
return !filter.value.hasOwnProperty('value'); // eslint-disable-line no-prototype-builtins
|
14238
|
+
}
|
14045
14239
|
|
14046
|
-
|
14240
|
+
const FilterColumn = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
14047
14241
|
const {
|
14048
14242
|
allColumns,
|
14049
14243
|
filters,
|
@@ -14063,7 +14257,8 @@ function FilterColumn(props) {
|
|
14063
14257
|
warning: warning,
|
14064
14258
|
className: "min-h-[theme(spacing.8)]"
|
14065
14259
|
}, /*#__PURE__*/React__default.createElement(Select2, Object.assign({}, attributes, {
|
14066
|
-
|
14260
|
+
ref: ref,
|
14261
|
+
className: "focus:yt-focus !w-32 flex-shrink-0 ",
|
14067
14262
|
emptyValue: null,
|
14068
14263
|
onChange: handleChange,
|
14069
14264
|
value: value
|
@@ -14081,7 +14276,7 @@ function FilterColumn(props) {
|
|
14081
14276
|
disabled: column.id !== value && (!column.getCanFilter() || !!filters.find(f => f.id === column.id))
|
14082
14277
|
}, ((_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.header) + (column.parent ? ` (${(_column$parent = column.parent) === null || _column$parent === void 0 ? void 0 : (_column$parent$column = _column$parent.columnDef.meta) === null || _column$parent$column === void 0 ? void 0 : _column$parent$column.header})` : ''));
|
14083
14278
|
}))));
|
14084
|
-
}
|
14279
|
+
});
|
14085
14280
|
|
14086
14281
|
function FilterComparator(props) {
|
14087
14282
|
const {
|
@@ -14186,6 +14381,7 @@ function getComparatorText(comparator, texts, column) {
|
|
14186
14381
|
}
|
14187
14382
|
}
|
14188
14383
|
|
14384
|
+
const querySelector = 'filter-value';
|
14189
14385
|
function FilterValue(props) {
|
14190
14386
|
const {
|
14191
14387
|
column,
|
@@ -14207,6 +14403,7 @@ function FilterValue(props) {
|
|
14207
14403
|
return /*#__PURE__*/React__default.createElement(Input, {
|
14208
14404
|
"aria-label": texts.table3.filters.emptyFilter.value,
|
14209
14405
|
className: "flex-grow",
|
14406
|
+
"data-query-selector": querySelector,
|
14210
14407
|
disabled: true,
|
14211
14408
|
value: texts.table3.filters.emptyFilter.value
|
14212
14409
|
});
|
@@ -14216,10 +14413,12 @@ function FilterValue(props) {
|
|
14216
14413
|
className: "flex flex-grow items-center gap-2"
|
14217
14414
|
}, /*#__PURE__*/React__default.createElement(Control, {
|
14218
14415
|
column: column,
|
14416
|
+
"data-query-selector": querySelector,
|
14219
14417
|
onChange: value => handleChange([value, toValue]),
|
14220
14418
|
value: fromValue
|
14221
14419
|
}), /*#__PURE__*/React__default.createElement(Control, {
|
14222
14420
|
column: column,
|
14421
|
+
"data-query-selector": querySelector,
|
14223
14422
|
onChange: value => handleChange([fromValue, value]),
|
14224
14423
|
value: toValue
|
14225
14424
|
}));
|
@@ -14228,11 +14427,13 @@ function FilterValue(props) {
|
|
14228
14427
|
className: "flex flex-grow items-center gap-2"
|
14229
14428
|
}, /*#__PURE__*/React__default.createElement(Control, {
|
14230
14429
|
column: column,
|
14430
|
+
"data-query-selector": querySelector,
|
14231
14431
|
onChange: value => handleChange([isNaN(value) ? undefined : value, toValue]),
|
14232
14432
|
placeholder: "from",
|
14233
14433
|
value: fromValue !== null && fromValue !== void 0 ? fromValue : ''
|
14234
14434
|
}), /*#__PURE__*/React__default.createElement(Control, {
|
14235
14435
|
column: column,
|
14436
|
+
"data-query-selector": querySelector,
|
14236
14437
|
onChange: value => handleChange([fromValue, isNaN(value) ? undefined : value]),
|
14237
14438
|
placeholder: "to",
|
14238
14439
|
value: toValue !== null && toValue !== void 0 ? toValue : ''
|
@@ -14241,6 +14442,7 @@ function FilterValue(props) {
|
|
14241
14442
|
return /*#__PURE__*/React__default.createElement(Control, {
|
14242
14443
|
comparator: comparator,
|
14243
14444
|
column: column,
|
14445
|
+
"data-query-selector": querySelector,
|
14244
14446
|
onChange: handleChange,
|
14245
14447
|
value: value
|
14246
14448
|
});
|
@@ -14262,10 +14464,13 @@ function Control(props) {
|
|
14262
14464
|
}
|
14263
14465
|
}, []);
|
14264
14466
|
if (typeof controlRenderer === 'function') {
|
14265
|
-
return controlRenderer({
|
14467
|
+
return /*#__PURE__*/React__default.cloneElement(controlRenderer({
|
14266
14468
|
...attributes,
|
14267
14469
|
setValue: value => onChange(value),
|
14268
14470
|
value
|
14471
|
+
}), {
|
14472
|
+
['data-query-selector']: querySelector,
|
14473
|
+
className: 'focus:yt-focus'
|
14269
14474
|
});
|
14270
14475
|
} else if (controlRenderer === 'datepicker' || dataType === 'datetime') {
|
14271
14476
|
return /*#__PURE__*/React__default.createElement(Datepicker, Object.assign({}, attributes, {
|
@@ -14308,6 +14513,7 @@ function Filter$1(props) {
|
|
14308
14513
|
texts
|
14309
14514
|
} = useLocalization();
|
14310
14515
|
const column = allColumns.find(c => c.id === filter.id);
|
14516
|
+
const ref = React__default.useRef(null);
|
14311
14517
|
const {
|
14312
14518
|
id,
|
14313
14519
|
value: {
|
@@ -14326,7 +14532,7 @@ function Filter$1(props) {
|
|
14326
14532
|
comparator: TableFilterComparator.Contains,
|
14327
14533
|
value: undefined
|
14328
14534
|
};
|
14329
|
-
handleChange(
|
14535
|
+
handleChange(position, {
|
14330
14536
|
id: columnId,
|
14331
14537
|
value
|
14332
14538
|
});
|
@@ -14336,7 +14542,7 @@ function Filter$1(props) {
|
|
14336
14542
|
if (comparator === TableFilterComparator.IsEmpty || comparator === TableFilterComparator.IsNotEmpty) {
|
14337
14543
|
nextValue = undefined;
|
14338
14544
|
}
|
14339
|
-
handleChange(
|
14545
|
+
handleChange(position, {
|
14340
14546
|
id,
|
14341
14547
|
value: {
|
14342
14548
|
comparator,
|
@@ -14345,7 +14551,7 @@ function Filter$1(props) {
|
|
14345
14551
|
});
|
14346
14552
|
};
|
14347
14553
|
const handleChangeValue = value => {
|
14348
|
-
handleChange(
|
14554
|
+
handleChange(position, {
|
14349
14555
|
id,
|
14350
14556
|
value: {
|
14351
14557
|
...filter.value,
|
@@ -14353,7 +14559,12 @@ function Filter$1(props) {
|
|
14353
14559
|
}
|
14354
14560
|
});
|
14355
14561
|
};
|
14356
|
-
const handleRemove = () => onRemove(
|
14562
|
+
const handleRemove = () => onRemove === null || onRemove === void 0 ? void 0 : onRemove(position);
|
14563
|
+
React__default.useEffect(() => {
|
14564
|
+
if (ref.current && !id) {
|
14565
|
+
ref.current.focus(); // after adding a new filter placeholder, we want to focus it right way.
|
14566
|
+
}
|
14567
|
+
}, [id]);
|
14357
14568
|
return /*#__PURE__*/React__default.createElement("div", {
|
14358
14569
|
className: "flex items-start gap-2"
|
14359
14570
|
}, /*#__PURE__*/React__default.createElement("div", {
|
@@ -14362,7 +14573,8 @@ function Filter$1(props) {
|
|
14362
14573
|
allColumns: allColumns,
|
14363
14574
|
filters: filters,
|
14364
14575
|
onChange: handleChangeColumn,
|
14365
|
-
value: id
|
14576
|
+
value: id,
|
14577
|
+
ref: ref
|
14366
14578
|
}), /*#__PURE__*/React__default.createElement(FilterComparator, {
|
14367
14579
|
column: column,
|
14368
14580
|
onChange: handleChangeComparator,
|
@@ -14372,46 +14584,21 @@ function Filter$1(props) {
|
|
14372
14584
|
comparator: comparator,
|
14373
14585
|
onChange: handleChangeValue,
|
14374
14586
|
value: value
|
14375
|
-
}), /*#__PURE__*/React__default.createElement(IconButton, {
|
14587
|
+
}), onRemove ? /*#__PURE__*/React__default.createElement(IconButton, {
|
14376
14588
|
appearance: "discrete",
|
14377
14589
|
className: "ml-auto",
|
14378
14590
|
icon: "close",
|
14379
14591
|
onClick: handleRemove
|
14380
|
-
}));
|
14381
|
-
}
|
14382
|
-
|
14383
|
-
function Placeholder(props) {
|
14384
|
-
const {
|
14385
|
-
allColumns,
|
14386
|
-
filters,
|
14387
|
-
onCreate: handleCreate,
|
14388
|
-
onRemove: handleRemove,
|
14389
|
-
position
|
14390
|
-
} = props;
|
14391
|
-
const {
|
14392
|
-
texts
|
14393
|
-
} = useLocalization();
|
14394
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
14395
|
-
className: "flex items-start gap-2"
|
14396
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
14397
|
-
className: "flex min-h-[theme(spacing.8)] w-14 flex-shrink-0 items-center justify-end pr-2 text-right"
|
14398
|
-
}, position > 0 ? texts.table3.filters.conditions.and : texts.table3.filters.conditions.where), /*#__PURE__*/React__default.createElement(FilterColumn, {
|
14399
|
-
allColumns: allColumns,
|
14400
|
-
filters: filters,
|
14401
|
-
onChange: handleCreate,
|
14402
|
-
value: null
|
14403
|
-
}), /*#__PURE__*/React__default.createElement(FilterComparator, null), /*#__PURE__*/React__default.createElement(Input, {
|
14404
|
-
"aria-label": texts.table3.filters.emptyFilter.value,
|
14405
|
-
className: "flex-grow",
|
14406
|
-
disabled: true,
|
14407
|
-
value: texts.table3.filters.emptyFilter.value
|
14408
|
-
}), handleRemove ? /*#__PURE__*/React__default.createElement(IconButton, {
|
14409
|
-
appearance: "discrete",
|
14410
|
-
icon: "close",
|
14411
|
-
onClick: handleRemove
|
14412
14592
|
}) : null);
|
14413
14593
|
}
|
14414
14594
|
|
14595
|
+
const placeholderFilter = {
|
14596
|
+
id: '',
|
14597
|
+
value: {
|
14598
|
+
comparator: TableFilterComparator.Contains,
|
14599
|
+
value: undefined
|
14600
|
+
}
|
14601
|
+
};
|
14415
14602
|
function ManageFiltersPopover(props) {
|
14416
14603
|
const {
|
14417
14604
|
length,
|
@@ -14423,54 +14610,46 @@ function ManageFiltersPopover(props) {
|
|
14423
14610
|
texts
|
14424
14611
|
} = useLocalization();
|
14425
14612
|
const allColumns = table.getAllLeafColumns().filter(column => !isInternalColumn(column.id)).sort(sortByHeader);
|
14426
|
-
const
|
14613
|
+
const columnFilters = table.getState().columnFilters;
|
14427
14614
|
// state, since we "apply" filters - our filter values have a special shape, so we force to our type
|
14428
|
-
const [filters, setFilters] = React__default.useState(
|
14429
|
-
|
14430
|
-
// filters might reset from the outside
|
14615
|
+
const [filters, setFilters] = React__default.useState(columnFilters.length ? columnFilters : [placeholderFilter]);
|
14616
|
+
// this runs if filters are set outside (e.g. through column header)
|
14431
14617
|
React__default.useEffect(() => {
|
14432
|
-
|
14433
|
-
|
14434
|
-
|
14435
|
-
|
14436
|
-
|
14618
|
+
setFilters(columnFilters.length === 0 ? [placeholderFilter] : columnFilters);
|
14619
|
+
// focus the filter value, as we preset the column/comparator.
|
14620
|
+
requestAnimationFrame(() => {
|
14621
|
+
const filterValues = document.querySelectorAll('[data-query-selector="filter-value"]');
|
14622
|
+
const lastFilter = filterValues.length ? filterValues[filterValues.length - 1] : undefined;
|
14623
|
+
lastFilter === null || lastFilter === void 0 ? void 0 : lastFilter.focus();
|
14624
|
+
});
|
14625
|
+
}, [columnFilters]);
|
14437
14626
|
// filters
|
14438
|
-
const handleChangeFilter = (
|
14627
|
+
const handleChangeFilter = (position, filter) => {
|
14439
14628
|
setFilters(currentFilters => {
|
14440
|
-
|
14441
|
-
|
14442
|
-
|
14629
|
+
return currentFilters.map((current, index) => {
|
14630
|
+
if (index === position) {
|
14631
|
+
return filter;
|
14632
|
+
}
|
14633
|
+
return current;
|
14634
|
+
});
|
14443
14635
|
});
|
14444
14636
|
};
|
14445
|
-
const handleRemoveFilter =
|
14446
|
-
if (filters.length === 1
|
14447
|
-
|
14637
|
+
const handleRemoveFilter = position => {
|
14638
|
+
if (filters.length === 1) {
|
14639
|
+
setFilters([placeholderFilter]);
|
14640
|
+
return;
|
14448
14641
|
}
|
14449
|
-
setFilters(currentFilters => currentFilters.filter(
|
14642
|
+
setFilters(currentFilters => currentFilters.filter((_, index) => index !== position));
|
14450
14643
|
};
|
14451
|
-
|
14452
|
-
|
14453
|
-
setFilters(currentFilters => [...currentFilters, {
|
14454
|
-
id: columnId,
|
14455
|
-
value: {
|
14456
|
-
comparator: TableFilterComparator.Contains,
|
14457
|
-
value: undefined
|
14458
|
-
}
|
14459
|
-
}]);
|
14460
|
-
handleRemovePlaceholder();
|
14461
|
-
};
|
14462
|
-
const handleCreatePlaceholder = () => {
|
14463
|
-
setPlaceholderCount(count => count + 1);
|
14464
|
-
};
|
14465
|
-
const handleRemovePlaceholder = () => {
|
14466
|
-
setPlaceholderCount(count => count - 1);
|
14644
|
+
const handleCreate = () => {
|
14645
|
+
setFilters(filters.concat(placeholderFilter));
|
14467
14646
|
};
|
14468
14647
|
//
|
14469
14648
|
const handleApply = () => {
|
14470
14649
|
table.setColumnFilters(() => {
|
14471
14650
|
const newFilters = filters.filter(f => {
|
14472
14651
|
var _allColumns$find, _allColumns$find$colu;
|
14473
|
-
if (f.id === null) {
|
14652
|
+
if (f.id === null || f.id === '') {
|
14474
14653
|
return false;
|
14475
14654
|
}
|
14476
14655
|
const controlRenderer = (_allColumns$find = allColumns.find(c => c.id === f.id)) === null || _allColumns$find === void 0 ? void 0 : (_allColumns$find$colu = _allColumns$find.columnDef.meta) === null || _allColumns$find$colu === void 0 ? void 0 : _allColumns$find$colu.control;
|
@@ -14484,12 +14663,14 @@ function ManageFiltersPopover(props) {
|
|
14484
14663
|
};
|
14485
14664
|
const handleClear = () => {
|
14486
14665
|
table.resetColumnFilters();
|
14487
|
-
setFilters([]);
|
14488
|
-
setPlaceholderCount(1);
|
14666
|
+
setFilters([placeholderFilter]);
|
14489
14667
|
};
|
14490
|
-
const handleClose =
|
14491
|
-
|
14492
|
-
|
14668
|
+
const handleClose = open => {
|
14669
|
+
if (!open) {
|
14670
|
+
const nonEmptyFilters = columnFilters.filter(f => !isEmptyFilter(f));
|
14671
|
+
table.setColumnFilters(nonEmptyFilters);
|
14672
|
+
setFilters(nonEmptyFilters.length === 0 ? [placeholderFilter] : nonEmptyFilters);
|
14673
|
+
}
|
14493
14674
|
};
|
14494
14675
|
return /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps, {
|
14495
14676
|
onChange: handleClose
|
@@ -14512,19 +14693,12 @@ function ManageFiltersPopover(props) {
|
|
14512
14693
|
filters: filters,
|
14513
14694
|
position: index,
|
14514
14695
|
onChange: handleChangeFilter,
|
14515
|
-
onRemove: handleRemoveFilter
|
14516
|
-
}))), [...Array(placeholderCount)].map((_, index) => ( /*#__PURE__*/React__default.createElement(Placeholder, {
|
14517
|
-
key: `placeholder_${index}`,
|
14518
|
-
allColumns: allColumns,
|
14519
|
-
filters: filters,
|
14520
|
-
position: filters.length + index,
|
14521
|
-
onCreate: handleCreateFilterFromPlaceholder,
|
14522
|
-
onRemove: placeholderCount > 1 || filters.length > 0 ? handleRemovePlaceholder : undefined
|
14696
|
+
onRemove: filters.length > 0 && filters.some(f => f.id) || filters.length > 1 ? handleRemoveFilter : undefined
|
14523
14697
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
14524
14698
|
className: "justify-start"
|
14525
14699
|
}, /*#__PURE__*/React__default.createElement(Button$1, {
|
14526
14700
|
appearance: "discrete",
|
14527
|
-
onClick:
|
14701
|
+
onClick: handleCreate
|
14528
14702
|
}, "+ ", texts.table3.filters.buttons.addFilter))), /*#__PURE__*/React__default.createElement(Group, {
|
14529
14703
|
className: "ml-auto"
|
14530
14704
|
}, /*#__PURE__*/React__default.createElement(Popover.Close, null, /*#__PURE__*/React__default.createElement(Button$1, null, "Cancel")), /*#__PURE__*/React__default.createElement(Button$1, {
|
@@ -14544,7 +14718,9 @@ function Filters(props) {
|
|
14544
14718
|
texts
|
14545
14719
|
} = useLocalization();
|
14546
14720
|
const isLargeScreen = useIsLargeScreen();
|
14547
|
-
const
|
14721
|
+
const columnFilters = table.getState().columnFilters;
|
14722
|
+
const appliedFilters = columnFilters.filter(f => !isEmptyFilter(f));
|
14723
|
+
const ref = React__default.useRef(null);
|
14548
14724
|
const shortcut = {
|
14549
14725
|
key: 'f',
|
14550
14726
|
meta: true,
|
@@ -14558,11 +14734,20 @@ function Filters(props) {
|
|
14558
14734
|
table: table
|
14559
14735
|
})),
|
14560
14736
|
shortcut,
|
14737
|
+
ref,
|
14561
14738
|
tooltip: ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.table3.filters.tooltip, /*#__PURE__*/React__default.createElement(Shortcut, {
|
14562
14739
|
className: "ml-2",
|
14563
14740
|
keys: shortcut
|
14564
14741
|
})))
|
14565
14742
|
};
|
14743
|
+
React__default.useEffect(() => {
|
14744
|
+
const emptyFilter = columnFilters.find(isEmptyFilter);
|
14745
|
+
// we set an empty filter when adding a filter through a column header.
|
14746
|
+
if (emptyFilter) {
|
14747
|
+
var _ref$current;
|
14748
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.click();
|
14749
|
+
}
|
14750
|
+
}, [columnFilters]);
|
14566
14751
|
if (!isLargeScreen && !appliedFilters.length) {
|
14567
14752
|
return /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, buttonProps, {
|
14568
14753
|
icon: "filter"
|
@@ -14652,12 +14837,15 @@ function useCssGridStylesheet(tableId, table, fontSize) {
|
|
14652
14837
|
size = `minmax(${minWidth}px, auto)`;
|
14653
14838
|
} else if (width !== undefined) {
|
14654
14839
|
const isLastColumn = index === allVisibleColumns.length - 1;
|
14655
|
-
if (isLastColumn) {
|
14656
|
-
size = `minmax(${minSize}px, auto)`;
|
14657
|
-
} else if (width === 'grow' || Number.isNaN(width)) {
|
14840
|
+
if (width === 'grow' || Number.isNaN(width) && !isLastColumn) {
|
14658
14841
|
size = `minmax(${minSize}px, 1fr)`;
|
14659
14842
|
} else {
|
14660
|
-
|
14843
|
+
const minWidth = width < minSize ? minSize : width;
|
14844
|
+
if (isLastColumn) {
|
14845
|
+
size = `minmax(${minWidth}px, auto)`;
|
14846
|
+
} else {
|
14847
|
+
size = `${minWidth}px`;
|
14848
|
+
}
|
14661
14849
|
}
|
14662
14850
|
} else {
|
14663
14851
|
size = `minmax(${minSize}px, auto)`;
|
@@ -15284,16 +15472,8 @@ function useTableGlobalShortcuts(table, tableRef, scrollToIndex) {
|
|
15284
15472
|
const rows = table.getRowModel().rows;
|
15285
15473
|
React__default.useEffect(() => {
|
15286
15474
|
const handleKeyDown = event => {
|
15287
|
-
const
|
15288
|
-
|
15289
|
-
//const eventOriginatedFromCombobox = !!target.closest('[role="combobox"]');
|
15290
|
-
// Don't trigger global shortcuts on the table if event originated from a combobox or if table is
|
15291
|
-
// outside the dialog
|
15292
|
-
if (
|
15293
|
-
//eventOriginatedFromCombobox ||
|
15294
|
-
dialog && !(dialog !== null && dialog !== void 0 && dialog.contains(tableRef.current))
|
15295
|
-
// || tableMeta.shortcutsState.isPaused
|
15296
|
-
) {
|
15475
|
+
const trigger = event.target;
|
15476
|
+
if (isElementInsideOverlay(trigger) && !isSiblingElementInsideSameParentOverlay(trigger, tableRef.current) || isElementInteractive(trigger) && !isElementInsideOrTriggeredFromContainer(trigger, tableRef.current)) {
|
15297
15477
|
return;
|
15298
15478
|
}
|
15299
15479
|
tableMeta.rowActive.handleKeyDown(event, rows.length, scrollToIndex, tableRef);
|
@@ -15342,12 +15522,12 @@ const Report$1 = /*#__PURE__*/fixedForwardRef(function Report(props, ref) {
|
|
15342
15522
|
const stylesheet = useStylesheet(report.id, report.instance);
|
15343
15523
|
useTableGlobalShortcuts(report.instance, tableRef, renderer.scrollToIndex);
|
15344
15524
|
const handleFocus = report.meta.rowActive.rowActiveIndex === undefined ? event => {
|
15345
|
-
report.meta.rowActive.handleFocus(event, report.length, renderer.scrollToIndex);
|
15525
|
+
report.meta.rowActive.handleFocus(event, report.meta.length, renderer.scrollToIndex);
|
15346
15526
|
} : undefined;
|
15347
15527
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, stylesheet, /*#__PURE__*/React__default.createElement(Toolbar, {
|
15348
15528
|
customSettings: props.customSettings,
|
15349
15529
|
left: props.toolbarLeft,
|
15350
|
-
length: report.length,
|
15530
|
+
length: report.meta.length,
|
15351
15531
|
right: props.toolbarRight,
|
15352
15532
|
scrollToIndex: renderer.scrollToIndex,
|
15353
15533
|
table: report.instance,
|
@@ -15371,15 +15551,11 @@ const Report$1 = /*#__PURE__*/fixedForwardRef(function Report(props, ref) {
|
|
15371
15551
|
}, /*#__PURE__*/React__default.createElement("thead", null, report.instance.getHeaderGroups().map(headerGroup => ( /*#__PURE__*/React__default.createElement("tr", {
|
15372
15552
|
key: headerGroup.id
|
15373
15553
|
}, headerGroup.headers.map(Header$4))))), (_renderer$rows = renderer.rows) !== null && _renderer$rows !== void 0 && _renderer$rows.length ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Body, {
|
15374
|
-
length: report.length,
|
15375
15554
|
table: report.instance,
|
15376
15555
|
style: renderer.style
|
15377
15556
|
}, renderer.rows), report.meta.footer.isEnabled ? ( /*#__PURE__*/React__default.createElement("tfoot", null, /*#__PURE__*/React__default.createElement("tr", null, report.instance.getFooterGroups()[0].headers.map(Footer$3)))) : null)) : ( /*#__PURE__*/React__default.createElement(EmptyStateBody, {
|
15378
15557
|
emptyState: props.emptyState
|
15379
|
-
})))
|
15380
|
-
length: report.length,
|
15381
|
-
table: report.instance
|
15382
|
-
}) : null));
|
15558
|
+
})))));
|
15383
15559
|
});
|
15384
15560
|
Report$1.Column = Column$1;
|
15385
15561
|
Report$1.Group = Group$3;
|
@@ -16200,7 +16376,7 @@ const useTableSortingListener$1 = (data, sortedRows, onSort, manualSorting, stat
|
|
16200
16376
|
}, [onSort && JSON.stringify(state.sortBy), manualSorting]);
|
16201
16377
|
};
|
16202
16378
|
const DEFAULT_PAGE_SIZE$1 = 10;
|
16203
|
-
const useTable
|
16379
|
+
const useTable = (props, ref) => {
|
16204
16380
|
var _otherProps$tabIndex;
|
16205
16381
|
const {
|
16206
16382
|
children,
|
@@ -16523,7 +16699,7 @@ const Table = /*#__PURE__*/React__default.forwardRef(function Table(props, ref)
|
|
16523
16699
|
prepareRow,
|
16524
16700
|
pagination,
|
16525
16701
|
instance
|
16526
|
-
} = useTable
|
16702
|
+
} = useTable(otherProps, tableRef);
|
16527
16703
|
let paginationElement;
|
16528
16704
|
if (pagination) {
|
16529
16705
|
paginationElement = /*#__PURE__*/React__default.createElement(Pagination, {
|
@@ -16631,7 +16807,7 @@ const WindowedTable = /*#__PURE__*/React__default.forwardRef(function WindowedTa
|
|
16631
16807
|
prepareRow,
|
16632
16808
|
instance,
|
16633
16809
|
state
|
16634
|
-
} = useTable
|
16810
|
+
} = useTable({
|
16635
16811
|
...otherProps,
|
16636
16812
|
windowed: true
|
16637
16813
|
}, tableRef);
|
@@ -17990,7 +18166,9 @@ function useSettingsStateListener(table, onChangeSettings) {
|
|
17990
18166
|
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
17991
18167
|
meta.columnFreezing.frozenColumnIndex, state.columnOrder, state.columnSizing, state.columnVisibility,
|
17992
18168
|
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
17993
|
-
meta.search.excludeUnmatchedResults, meta.fontSize.size, meta.rowHeight.height,
|
18169
|
+
meta.search.excludeUnmatchedResults, meta.fontSize.size, meta.rowHeight.height,
|
18170
|
+
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
18171
|
+
meta.printing.isWarningVisibleForLargeDatasets, state.sorting]);
|
17994
18172
|
}
|
17995
18173
|
|
17996
18174
|
var Table3FilterComparator;
|
@@ -19669,6 +19847,25 @@ function Header$6(context) {
|
|
19669
19847
|
const isAllRowsSelected = context.table.getIsAllRowsSelected();
|
19670
19848
|
const isSomeRowsSelected = context.table.getIsSomeRowsSelected();
|
19671
19849
|
const title = isAllRowsSelected ? texts.table3.columns.select.deselectAll : texts.table3.columns.select.selectAll;
|
19850
|
+
const tableMeta = context.table.options.meta;
|
19851
|
+
const isServerloading = tableMeta.server.loadAllStatus === TableServerLoadAllState.Loading;
|
19852
|
+
const isLoadingAll = isAllRowsSelected && isServerloading;
|
19853
|
+
const isLoadingPreviousRows = tableMeta.rowSelection.lastSelectedRowIndex !== undefined && isServerloading;
|
19854
|
+
const toggleSelectAll = function () {
|
19855
|
+
try {
|
19856
|
+
const _temp = function () {
|
19857
|
+
if (!isServerloading) {
|
19858
|
+
var _tableMeta$server, _tableMeta$server$loa;
|
19859
|
+
return Promise.resolve((_tableMeta$server = tableMeta.server) === null || _tableMeta$server === void 0 ? void 0 : (_tableMeta$server$loa = _tableMeta$server.loadAllIfNeeded) === null || _tableMeta$server$loa === void 0 ? void 0 : _tableMeta$server$loa.call(_tableMeta$server, context.table.getState().sorting, context.table.getState().columnFilters, undefined)).then(function () {
|
19860
|
+
context.table.toggleAllRowsSelected(!isAllRowsSelected);
|
19861
|
+
});
|
19862
|
+
}
|
19863
|
+
}();
|
19864
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
19865
|
+
} catch (e) {
|
19866
|
+
return Promise.reject(e);
|
19867
|
+
}
|
19868
|
+
};
|
19672
19869
|
return /*#__PURE__*/React__default.createElement(Header$5, Object.assign({}, context), /*#__PURE__*/React__default.createElement(Tooltip, {
|
19673
19870
|
title: title
|
19674
19871
|
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
@@ -19677,8 +19874,9 @@ function Header$6(context) {
|
|
19677
19874
|
key: String(`${isAllRowsSelected}_${isSomeRowsSelected}`),
|
19678
19875
|
checked: isAllRowsSelected,
|
19679
19876
|
indeterminate: isSomeRowsSelected,
|
19680
|
-
onChange:
|
19681
|
-
tabIndex: -1
|
19877
|
+
onChange: toggleSelectAll,
|
19878
|
+
tabIndex: -1,
|
19879
|
+
loading: isLoadingAll || isLoadingPreviousRows
|
19682
19880
|
})));
|
19683
19881
|
} else {
|
19684
19882
|
return /*#__PURE__*/React__default.createElement(Header$5, Object.assign({}, context));
|
@@ -19700,18 +19898,49 @@ const Cell$7 = /*#__PURE__*/React__default.memo(function MemoedCell(context) {
|
|
19700
19898
|
const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;
|
19701
19899
|
const isSelected = context.row.getIsSelected();
|
19702
19900
|
const title = isSelected ? texts.table3.columns.select.deselect : texts.table3.columns.select.select;
|
19703
|
-
|
19704
|
-
|
19705
|
-
|
19706
|
-
|
19707
|
-
var _tableMeta$rowSelecti;
|
19708
|
-
const [fromIndex, toIndex] = toggleBetween$2((_tableMeta$rowSelecti = tableMeta.rowSelection.lastSelectedRowIndex.current) !== null && _tableMeta$rowSelecti !== void 0 ? _tableMeta$rowSelecti : 0, rowIndex);
|
19709
|
-
context.table.getRowModel().rows.slice(fromIndex, toIndex + 1).forEach(row => row.toggleSelected(true));
|
19710
|
-
} else {
|
19711
|
-
context.row.toggleSelected();
|
19901
|
+
const handleCheckboxClick = function (event) {
|
19902
|
+
try {
|
19903
|
+
function _temp5() {
|
19904
|
+
tableMeta.rowSelection.lastSelectedRowIndex.current = rowIndex;
|
19712
19905
|
}
|
19713
|
-
|
19714
|
-
|
19906
|
+
event.stopPropagation();
|
19907
|
+
const _temp4 = function () {
|
19908
|
+
if (event.shiftKey) {
|
19909
|
+
var _tableMeta$rowSelecti;
|
19910
|
+
function _temp3() {
|
19911
|
+
const currentlySelected = context.table.getSelectedRowModel().rows;
|
19912
|
+
// concat currently selected with selection range and get rid of duplicates using "Set".
|
19913
|
+
// converting allSelected array into updater object: {[row.id]: true}
|
19914
|
+
const allSelected = [...new Set(currentlySelected.concat(selectionRangeRows))];
|
19915
|
+
const updater = allSelected.reduce((obj, row) => Object.assign(obj, {
|
19916
|
+
[row.id]: true
|
19917
|
+
}), {});
|
19918
|
+
context.table.setRowSelection(updater);
|
19919
|
+
}
|
19920
|
+
const [fromIndex, toIndex] = toggleBetween$2((_tableMeta$rowSelecti = tableMeta.rowSelection.lastSelectedRowIndex.current) !== null && _tableMeta$rowSelecti !== void 0 ? _tableMeta$rowSelecti : 0, rowIndex);
|
19921
|
+
const selectionRangeRows = context.table.getRowModel().rows.slice(fromIndex, toIndex + 1);
|
19922
|
+
// Table data loader filling-in all the rest of unloaded items with the undefined values,
|
19923
|
+
// so we can easily check if at least one of the rows in the selection range is undefined,
|
19924
|
+
// then it means that we need to call load all.
|
19925
|
+
const hasUndefinedRows = selectionRangeRows.some(row => row.original === undefined);
|
19926
|
+
const _temp2 = function () {
|
19927
|
+
if (hasUndefinedRows) {
|
19928
|
+
var _tableMeta$server2, _tableMeta$server2$lo;
|
19929
|
+
// We don't need to await and freeze UI
|
19930
|
+
return Promise.resolve((_tableMeta$server2 = tableMeta.server) === null || _tableMeta$server2 === void 0 ? void 0 : (_tableMeta$server2$lo = _tableMeta$server2.loadAllIfNeeded) === null || _tableMeta$server2$lo === void 0 ? void 0 : _tableMeta$server2$lo.call(_tableMeta$server2, context.table.getState().sorting, context.table.getState().columnFilters, undefined)).then(function () {});
|
19931
|
+
}
|
19932
|
+
}();
|
19933
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
19934
|
+
} else {
|
19935
|
+
context.row.toggleSelected();
|
19936
|
+
}
|
19937
|
+
}();
|
19938
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
|
19939
|
+
} catch (e) {
|
19940
|
+
return Promise.reject(e);
|
19941
|
+
}
|
19942
|
+
};
|
19943
|
+
if (context.table.options.enableMultiRowSelection) {
|
19715
19944
|
return /*#__PURE__*/React__default.createElement(DisplayCell$1, Object.assign({}, context), /*#__PURE__*/React__default.createElement(Tooltip, {
|
19716
19945
|
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, title, /*#__PURE__*/React__default.createElement(Shortcut, {
|
19717
19946
|
className: "ml-2",
|
@@ -19721,7 +19950,7 @@ const Cell$7 = /*#__PURE__*/React__default.memo(function MemoedCell(context) {
|
|
19721
19950
|
"aria-label": title,
|
19722
19951
|
className: "!mt-0",
|
19723
19952
|
checked: isSelected,
|
19724
|
-
onClick:
|
19953
|
+
onClick: handleCheckboxClick,
|
19725
19954
|
// this is necessary to remove console spam from eslint
|
19726
19955
|
onChange: () => false,
|
19727
19956
|
tabIndex: isActiveRow ? 0 : -1
|
@@ -20412,8 +20641,8 @@ function usePauseShortcuts() {
|
|
20412
20641
|
};
|
20413
20642
|
}
|
20414
20643
|
|
20415
|
-
function useTable$
|
20416
|
-
var _settings$columnFreez, _props$length;
|
20644
|
+
function useTable$1(props, ref) {
|
20645
|
+
var _settings$columnFreez, _props$data, _ref, _props$length, _props$data2;
|
20417
20646
|
// load any persisted table settings and merge them with any defaults
|
20418
20647
|
const [settings, setSettings] = useSettings(props.id, props.defaultSettings, props.onChangeSettings);
|
20419
20648
|
// configure table3 options
|
@@ -20437,6 +20666,12 @@ function useTable$2(props, ref) {
|
|
20437
20666
|
// haven't migrated load all/server loading yet
|
20438
20667
|
const search = useSearch(options.enableSearch, settings.excludeUnmatchedRecordsInSearch);
|
20439
20668
|
const shortcutsState = usePauseShortcuts();
|
20669
|
+
React__default.useEffect(() => {
|
20670
|
+
// Needed for DataDog
|
20671
|
+
if (!Array.isArray(props.data)) {
|
20672
|
+
console.error('Table3 data value is not an array');
|
20673
|
+
}
|
20674
|
+
}, []);
|
20440
20675
|
// custom features - shared/migrated
|
20441
20676
|
const columnOrdering = useTableColumnOrdering(options.enableColumnOrdering);
|
20442
20677
|
const fontSize = useTableFontSize(options.enableFontSize, settings.fontSize);
|
@@ -20489,7 +20724,8 @@ function useTable$2(props, ref) {
|
|
20489
20724
|
};
|
20490
20725
|
};
|
20491
20726
|
const table = reactTable.useReactTable({
|
20492
|
-
|
20727
|
+
// We need to fallback to an empty array, to avoid table crash in the client
|
20728
|
+
data: (_props$data = props.data) !== null && _props$data !== void 0 ? _props$data : [],
|
20493
20729
|
columns,
|
20494
20730
|
getCoreRowModel: reactTable.getCoreRowModel(),
|
20495
20731
|
initialState,
|
@@ -20533,7 +20769,7 @@ function useTable$2(props, ref) {
|
|
20533
20769
|
useTableSortingListener(table, props.onSort);
|
20534
20770
|
return {
|
20535
20771
|
table,
|
20536
|
-
length: (_props$length = props.length) !== null && _props$length !== void 0 ? _props$length : props.data.length
|
20772
|
+
length: (_ref = (_props$length = props.length) !== null && _props$length !== void 0 ? _props$length : (_props$data2 = props.data) === null || _props$data2 === void 0 ? void 0 : _props$data2.length) !== null && _ref !== void 0 ? _ref : 0
|
20537
20773
|
};
|
20538
20774
|
}
|
20539
20775
|
function configureReactTableOptions$1(props, options) {
|
@@ -21017,7 +21253,7 @@ function resetHighlightedColumnIndexes$1(enabled, value, table) {
|
|
21017
21253
|
return firstRowIndex;
|
21018
21254
|
}
|
21019
21255
|
|
21020
|
-
|
21256
|
+
const FilterColumn$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
21021
21257
|
const {
|
21022
21258
|
allColumns,
|
21023
21259
|
filters,
|
@@ -21037,7 +21273,8 @@ function FilterColumn$1(props) {
|
|
21037
21273
|
warning: warning,
|
21038
21274
|
className: "min-h-[theme(spacing.8)]"
|
21039
21275
|
}, /*#__PURE__*/React__default.createElement(Select2, Object.assign({}, attributes, {
|
21040
|
-
|
21276
|
+
ref: ref,
|
21277
|
+
className: "focus:yt-focus !w-32 flex-shrink-0",
|
21041
21278
|
emptyValue: null,
|
21042
21279
|
onChange: handleChange,
|
21043
21280
|
value: value
|
@@ -21055,7 +21292,7 @@ function FilterColumn$1(props) {
|
|
21055
21292
|
disabled: column.id !== value && (!column.getCanFilter() || !!filters.find(f => f.id === column.id))
|
21056
21293
|
}, ((_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.header) + (column.parent ? ` (${(_column$parent = column.parent) === null || _column$parent === void 0 ? void 0 : (_column$parent$column = _column$parent.columnDef.meta) === null || _column$parent$column === void 0 ? void 0 : _column$parent$column.header})` : ''));
|
21057
21294
|
}))));
|
21058
|
-
}
|
21295
|
+
});
|
21059
21296
|
|
21060
21297
|
function FilterComparator$1(props) {
|
21061
21298
|
const {
|
@@ -21074,7 +21311,7 @@ function FilterComparator$1(props) {
|
|
21074
21311
|
}
|
21075
21312
|
}, [validComparators]);
|
21076
21313
|
return /*#__PURE__*/React__default.createElement(Select2, Object.assign({}, attributes, {
|
21077
|
-
className: "!w-32 flex-shrink-0",
|
21314
|
+
className: "focus:yt-focus !w-32 flex-shrink-0",
|
21078
21315
|
disabled: !column,
|
21079
21316
|
onChange: handleChange,
|
21080
21317
|
value: value
|
@@ -21161,38 +21398,6 @@ function getComparatorText$1(comparator, texts, column) {
|
|
21161
21398
|
}
|
21162
21399
|
}
|
21163
21400
|
|
21164
|
-
function Placeholder$1(props) {
|
21165
|
-
const {
|
21166
|
-
allColumns,
|
21167
|
-
filters,
|
21168
|
-
onCreate: handleCreate,
|
21169
|
-
onRemove: handleRemove,
|
21170
|
-
position
|
21171
|
-
} = props;
|
21172
|
-
const {
|
21173
|
-
texts
|
21174
|
-
} = useLocalization();
|
21175
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
21176
|
-
className: "flex items-start gap-2"
|
21177
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
21178
|
-
className: "flex min-h-[theme(spacing.8)] w-14 flex-shrink-0 items-center justify-end pr-2 text-right"
|
21179
|
-
}, position > 0 ? texts.table3.filters.conditions.and : texts.table3.filters.conditions.where), /*#__PURE__*/React__default.createElement(FilterColumn$1, {
|
21180
|
-
allColumns: allColumns,
|
21181
|
-
filters: filters,
|
21182
|
-
onChange: handleCreate,
|
21183
|
-
value: null
|
21184
|
-
}), /*#__PURE__*/React__default.createElement(FilterComparator$1, null), /*#__PURE__*/React__default.createElement(Input, {
|
21185
|
-
"aria-label": texts.table3.filters.emptyFilter.value,
|
21186
|
-
className: "flex-grow",
|
21187
|
-
disabled: true,
|
21188
|
-
value: texts.table3.filters.emptyFilter.value
|
21189
|
-
}), handleRemove ? /*#__PURE__*/React__default.createElement(IconButton, {
|
21190
|
-
appearance: "discrete",
|
21191
|
-
icon: "close",
|
21192
|
-
onClick: handleRemove
|
21193
|
-
}) : null);
|
21194
|
-
}
|
21195
|
-
|
21196
21401
|
function FilterValue$1(props) {
|
21197
21402
|
const {
|
21198
21403
|
column,
|
@@ -21313,6 +21518,7 @@ function Filter$2(props) {
|
|
21313
21518
|
texts
|
21314
21519
|
} = useLocalization();
|
21315
21520
|
const column = allColumns.find(c => c.id === filter.id);
|
21521
|
+
const ref = React__default.useRef(null);
|
21316
21522
|
const {
|
21317
21523
|
id,
|
21318
21524
|
value: {
|
@@ -21331,7 +21537,7 @@ function Filter$2(props) {
|
|
21331
21537
|
comparator: null,
|
21332
21538
|
value: null
|
21333
21539
|
};
|
21334
|
-
handleChange(
|
21540
|
+
handleChange(position, {
|
21335
21541
|
id: columnId,
|
21336
21542
|
value
|
21337
21543
|
});
|
@@ -21341,7 +21547,7 @@ function Filter$2(props) {
|
|
21341
21547
|
if (comparator === Table3FilterComparator.IsEmpty || comparator === Table3FilterComparator.IsNotEmpty) {
|
21342
21548
|
nextValue = undefined;
|
21343
21549
|
}
|
21344
|
-
handleChange(
|
21550
|
+
handleChange(position, {
|
21345
21551
|
id,
|
21346
21552
|
value: {
|
21347
21553
|
comparator,
|
@@ -21350,7 +21556,7 @@ function Filter$2(props) {
|
|
21350
21556
|
});
|
21351
21557
|
};
|
21352
21558
|
const handleChangeValue = value => {
|
21353
|
-
handleChange(
|
21559
|
+
handleChange(position, {
|
21354
21560
|
id,
|
21355
21561
|
value: {
|
21356
21562
|
...filter.value,
|
@@ -21358,7 +21564,12 @@ function Filter$2(props) {
|
|
21358
21564
|
}
|
21359
21565
|
});
|
21360
21566
|
};
|
21361
|
-
const handleRemove = () => onRemove(
|
21567
|
+
const handleRemove = () => onRemove === null || onRemove === void 0 ? void 0 : onRemove(position);
|
21568
|
+
React__default.useEffect(() => {
|
21569
|
+
if (ref.current && !id) {
|
21570
|
+
ref.current.focus(); // after adding a new filter placeholder, we want to focus it right way.
|
21571
|
+
}
|
21572
|
+
}, [id]);
|
21362
21573
|
return /*#__PURE__*/React__default.createElement("div", {
|
21363
21574
|
className: "flex items-start gap-2"
|
21364
21575
|
}, /*#__PURE__*/React__default.createElement("div", {
|
@@ -21367,7 +21578,8 @@ function Filter$2(props) {
|
|
21367
21578
|
allColumns: allColumns,
|
21368
21579
|
filters: filters,
|
21369
21580
|
onChange: handleChangeColumn,
|
21370
|
-
value: id
|
21581
|
+
value: id,
|
21582
|
+
ref: ref
|
21371
21583
|
}), /*#__PURE__*/React__default.createElement(FilterComparator$1, {
|
21372
21584
|
column: column,
|
21373
21585
|
onChange: handleChangeComparator,
|
@@ -21377,18 +21589,25 @@ function Filter$2(props) {
|
|
21377
21589
|
comparator: comparator,
|
21378
21590
|
onChange: handleChangeValue,
|
21379
21591
|
value: value
|
21380
|
-
}), /*#__PURE__*/React__default.createElement(IconButton, {
|
21592
|
+
}), onRemove ? /*#__PURE__*/React__default.createElement(IconButton, {
|
21381
21593
|
appearance: "discrete",
|
21382
21594
|
className: "ml-auto",
|
21383
21595
|
icon: "close",
|
21384
21596
|
onClick: handleRemove
|
21385
|
-
}));
|
21597
|
+
}) : null);
|
21386
21598
|
}
|
21387
21599
|
|
21388
21600
|
function sortByHeader$1(a, b) {
|
21389
21601
|
var _a$columnDef$meta, _a$columnDef$meta$hea, _a$columnDef$meta$hea2, _b$columnDef$meta;
|
21390
21602
|
return (_a$columnDef$meta = a.columnDef.meta) === null || _a$columnDef$meta === void 0 ? void 0 : (_a$columnDef$meta$hea = _a$columnDef$meta.header) === null || _a$columnDef$meta$hea === void 0 ? void 0 : (_a$columnDef$meta$hea2 = _a$columnDef$meta$hea.localeCompare) === null || _a$columnDef$meta$hea2 === void 0 ? void 0 : _a$columnDef$meta$hea2.call(_a$columnDef$meta$hea, (_b$columnDef$meta = b.columnDef.meta) === null || _b$columnDef$meta === void 0 ? void 0 : _b$columnDef$meta.header);
|
21391
21603
|
}
|
21604
|
+
const placeholderFilter$1 = {
|
21605
|
+
id: null,
|
21606
|
+
value: {
|
21607
|
+
comparator: Table3FilterComparator.Contains,
|
21608
|
+
value: undefined
|
21609
|
+
}
|
21610
|
+
};
|
21392
21611
|
function FiltersButton(props) {
|
21393
21612
|
const {
|
21394
21613
|
total,
|
@@ -21408,41 +21627,28 @@ function FiltersButton(props) {
|
|
21408
21627
|
shift: true
|
21409
21628
|
};
|
21410
21629
|
// state, since we "apply" filters
|
21411
|
-
const [filters, setFilters] = React__default.useState(appliedFilters);
|
21412
|
-
const [placeholderCount, setPlaceholderCount] = React__default.useState(1);
|
21630
|
+
const [filters, setFilters] = React__default.useState(appliedFilters.length ? appliedFilters : [placeholderFilter$1]);
|
21413
21631
|
// filters
|
21414
|
-
const handleChangeFilter = (
|
21632
|
+
const handleChangeFilter = (position, filter) => {
|
21415
21633
|
setFilters(currentFilters => {
|
21416
|
-
|
21417
|
-
|
21418
|
-
|
21419
|
-
|
21634
|
+
return currentFilters.map((current, index) => {
|
21635
|
+
if (index === position) {
|
21636
|
+
return filter;
|
21637
|
+
}
|
21638
|
+
return current;
|
21639
|
+
});
|
21420
21640
|
});
|
21421
21641
|
};
|
21422
|
-
const handleRemoveFilter =
|
21423
|
-
if (filters.length === 1
|
21424
|
-
|
21642
|
+
const handleRemoveFilter = position => {
|
21643
|
+
if (filters.length === 1) {
|
21644
|
+
setFilters([placeholderFilter$1]);
|
21645
|
+
return;
|
21425
21646
|
}
|
21426
|
-
setFilters(currentFilters => currentFilters.filter(
|
21427
|
-
};
|
21428
|
-
// placeholders
|
21429
|
-
const handleCreateFilterFromPlaceholder = columnId => {
|
21430
|
-
setFilters(currentFilters => [...currentFilters, {
|
21431
|
-
id: columnId,
|
21432
|
-
value: {
|
21433
|
-
comparator: Table3FilterComparator.Contains,
|
21434
|
-
value: undefined
|
21435
|
-
}
|
21436
|
-
}]);
|
21437
|
-
handleRemovePlaceholder();
|
21647
|
+
setFilters(currentFilters => currentFilters.filter((_, index) => index !== position));
|
21438
21648
|
};
|
21439
|
-
const
|
21440
|
-
|
21649
|
+
const handleCreateNew = () => {
|
21650
|
+
setFilters(filters.concat(placeholderFilter$1));
|
21441
21651
|
};
|
21442
|
-
const handleRemovePlaceholder = () => {
|
21443
|
-
setPlaceholderCount(count => count - 1);
|
21444
|
-
};
|
21445
|
-
//
|
21446
21652
|
const handleApply = () => {
|
21447
21653
|
table.setColumnFilters(() => {
|
21448
21654
|
const newFilters = filters.filter(f => {
|
@@ -21462,20 +21668,17 @@ function FiltersButton(props) {
|
|
21462
21668
|
};
|
21463
21669
|
const handleClear = () => {
|
21464
21670
|
table.resetColumnFilters();
|
21465
|
-
setFilters([]);
|
21466
|
-
setPlaceholderCount(1);
|
21671
|
+
setFilters([placeholderFilter$1]);
|
21467
21672
|
};
|
21468
21673
|
const handleClose = React__default.useCallback(open => {
|
21469
21674
|
if (!open) {
|
21470
|
-
setFilters(appliedFilters);
|
21471
|
-
setPlaceholderCount(appliedFilters.length === 0 ? 1 : 0);
|
21675
|
+
setFilters(appliedFilters.length === 0 ? [placeholderFilter$1] : appliedFilters);
|
21472
21676
|
}
|
21473
21677
|
}, [appliedFilters]);
|
21474
21678
|
// Because filters can be reset from outside
|
21475
21679
|
React__default.useEffect(() => {
|
21476
21680
|
if (appliedFilters.length === 0) {
|
21477
|
-
setFilters([]);
|
21478
|
-
setPlaceholderCount(1);
|
21681
|
+
setFilters([placeholderFilter$1]);
|
21479
21682
|
}
|
21480
21683
|
}, [appliedFilters]);
|
21481
21684
|
const buttonProps = {
|
@@ -21505,19 +21708,12 @@ function FiltersButton(props) {
|
|
21505
21708
|
filters: filters,
|
21506
21709
|
position: index,
|
21507
21710
|
onChange: handleChangeFilter,
|
21508
|
-
onRemove: handleRemoveFilter
|
21509
|
-
}))), [...Array(placeholderCount)].map((_, index) => ( /*#__PURE__*/React__default.createElement(Placeholder$1, {
|
21510
|
-
key: `placeholder_${index}`,
|
21511
|
-
allColumns: allColumns,
|
21512
|
-
filters: filters,
|
21513
|
-
position: filters.length + index,
|
21514
|
-
onCreate: handleCreateFilterFromPlaceholder,
|
21515
|
-
onRemove: placeholderCount > 1 || filters.length > 0 ? handleRemovePlaceholder : undefined
|
21711
|
+
onRemove: filters.length > 0 && filters.some(f => f.id) || filters.length > 1 ? handleRemoveFilter : undefined
|
21516
21712
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
21517
21713
|
className: "justify-start"
|
21518
21714
|
}, /*#__PURE__*/React__default.createElement(Button$1, {
|
21519
21715
|
appearance: "discrete",
|
21520
|
-
onClick:
|
21716
|
+
onClick: handleCreateNew
|
21521
21717
|
}, "+ ", texts.table3.filters.buttons.addFilter))), /*#__PURE__*/React__default.createElement(Group, {
|
21522
21718
|
className: "ml-auto"
|
21523
21719
|
}, /*#__PURE__*/React__default.createElement(Popover.Close, null, /*#__PURE__*/React__default.createElement(Button$1, null, "Cancel")), /*#__PURE__*/React__default.createElement(Button$1, {
|
@@ -21867,6 +22063,7 @@ function PrintButton(props) {
|
|
21867
22063
|
const buttonRef = React__default.useRef(null);
|
21868
22064
|
const tableMeta = table.options.meta;
|
21869
22065
|
const state = table.getState();
|
22066
|
+
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
21870
22067
|
const {
|
21871
22068
|
isWarningVisibleForLargeDatasets
|
21872
22069
|
} = tableMeta.printing;
|
@@ -22045,6 +22242,7 @@ function PrintButton(props) {
|
|
22045
22242
|
onAccept: handleWarningDialogAccept,
|
22046
22243
|
onClose: handleWarningDialogClose,
|
22047
22244
|
onCancel: handleWarningDialogCancel,
|
22245
|
+
// @ts-expect-error: fixing type issue while report and table3 TableMeta definitions live in parallel
|
22048
22246
|
onVisibilityChange: tableMeta.printing.setIsWarningVisibleForLargeDatasets
|
22049
22247
|
}));
|
22050
22248
|
}
|
@@ -22324,7 +22522,7 @@ function Summary$1(props) {
|
|
22324
22522
|
let label;
|
22325
22523
|
let count;
|
22326
22524
|
// row selection
|
22327
|
-
const rowsSelectedLength = table.
|
22525
|
+
const rowsSelectedLength = table.getSelectedRowModel().rows.length;
|
22328
22526
|
if (rowsSelectedLength > 0) {
|
22329
22527
|
label = texts.table3.footer.summary.selected;
|
22330
22528
|
count = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(rowsSelectedLength)), "\u00A0", texts.table3.footer.summary.count, "\u00A0", /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(length)));
|
@@ -22723,7 +22921,7 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
22723
22921
|
const {
|
22724
22922
|
table,
|
22725
22923
|
length
|
22726
|
-
} = useTable$
|
22924
|
+
} = useTable$1(props, internalRef);
|
22727
22925
|
useTableRefInstanceSetup(table, internalRef);
|
22728
22926
|
React__default.useEffect(() => {
|
22729
22927
|
if (props.autoFocus) {
|
@@ -22754,13 +22952,10 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
22754
22952
|
}, []);
|
22755
22953
|
React__default.useEffect(() => {
|
22756
22954
|
const handleKeyDown = event => {
|
22757
|
-
const
|
22758
|
-
const dialog = target.closest('[role="dialog"]');
|
22955
|
+
const trigger = event.target;
|
22759
22956
|
// Select2 also have combobox role to align with W3C guidelines
|
22760
|
-
const eventOriginatedFromCombobox = !!
|
22761
|
-
|
22762
|
-
// outside the dialog
|
22763
|
-
if (eventOriginatedFromCombobox || dialog && !(dialog !== null && dialog !== void 0 && dialog.contains(internalRef.current)) || tableMeta.shortcutsState.isPaused) {
|
22957
|
+
const eventOriginatedFromCombobox = !!trigger.closest('[role="combobox"]:not([data-taco="Select2"])');
|
22958
|
+
if (tableMeta.shortcutsState.isPaused || isElementInsideOverlay(trigger) && !isSiblingElementInsideSameParentOverlay(trigger, internalRef.current) || isElementInteractive(trigger) && !isElementInsideOrTriggeredFromContainer(trigger, internalRef.current) || eventOriginatedFromCombobox) {
|
22764
22959
|
return;
|
22765
22960
|
}
|
22766
22961
|
const rows = table.getRowModel().rows;
|