@economic/taco 2.16.0 → 2.17.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Table3/Table3.d.ts +0 -2
- package/dist/components/Table3/components/columns/cell/EditingControl.d.ts +1 -1
- package/dist/components/Table3/components/columns/header/Header.d.ts +1 -1
- package/dist/components/Table3/components/columns/styles.d.ts +2 -2
- package/dist/components/Table3/components/rows/Row.d.ts +3 -1
- package/dist/components/Table3/hooks/features/useSearch.d.ts +1 -3
- package/dist/components/Table3/hooks/useTable.d.ts +21 -20
- package/dist/components/Table3/types.d.ts +15 -18
- package/dist/components/Table3/util/scrolling.d.ts +2 -0
- package/dist/esm/packages/taco/src/components/Banner/Banner.js +2 -2
- package/dist/esm/packages/taco/src/components/Banner/Banner.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js +4 -4
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js +3 -3
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +2 -1
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +6 -6
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +3 -3
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +7 -7
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Field/Field.js +2 -2
- package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +4 -4
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Link.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/Icon.js +2 -2
- package/dist/esm/packages/taco/src/components/Icon/Icon.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +2 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +6 -6
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js +4 -4
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js +2 -2
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +3 -3
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +2 -2
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +1 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js +2 -2
- package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js +5 -5
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Popover.js +2 -2
- package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +2 -2
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +8 -8
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/useSelect.js +2 -2
- package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +7 -7
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +8 -8
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +5 -5
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +10 -10
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js +2 -2
- package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js +3 -3
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js +2 -2
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js +10 -10
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js +2 -2
- package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +30 -29
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js +3 -3
- package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js +6 -6
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +13 -14
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +27 -3
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +9 -9
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +37 -6
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +12 -12
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Drag.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Drag.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +7 -7
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Expansion.js +3 -3
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Expansion.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js +3 -3
- 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 +2 -13
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js +32 -30
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/SkeletonRow.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/rows/SkeletonRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +8 -6
- 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 +15 -7
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js +2 -2
- 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 +2 -2
- 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 +16 -16
- 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 -0
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js +10 -8
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +8 -8
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSearch.js +1 -2
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSearch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useEditingStateListener.js +3 -3
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useEditingStateListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js +1 -49
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +0 -2
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +127 -109
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/strategies/virtualised.js +3 -3
- package/dist/esm/packages/taco/src/components/Table3/strategies/virtualised.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/util/scrolling.js +53 -0
- package/dist/esm/packages/taco/src/components/Table3/util/scrolling.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Tag/Tag.js +4 -4
- package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/Toaster.js +2 -2
- package/dist/esm/packages/taco/src/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tour/Tour.js +4 -4
- package/dist/esm/packages/taco/src/components/Tour/Tour.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Treeview/Treeview.js +2 -2
- package/dist/esm/packages/taco/src/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +2 -1
- package/dist/esm/packages/taco/src/index.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js +10 -0
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js +8 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Table3/hooks/features/useFontSize.js → primitives/Table/useTable/features/useTableFontSize.js} +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFontSize.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js +14 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js +100 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowClick.js +30 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowClick.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js +9 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowHeight.js +13 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowHeight.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js +32 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js +11 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableDataListener.js +15 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableDataListener.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Table3/hooks/listeners/useFilteringStateListener.js → primitives/Table/useTable/listeners/useTableFilterListener.js} +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFilterListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js +40 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Table3/hooks/listeners/useRowSelectionListener.js → primitives/Table/useTable/listeners/useTableRowSelectionListener.js} +5 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableRowSelectionListener.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Table3/hooks/listeners/useServerLoadingListener.js → primitives/Table/useTable/listeners/useTableServerLoadingListener.js} +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableServerLoadingListener.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Table3/hooks/listeners/useShortcutsListener.js → primitives/Table/useTable/listeners/useTableShortcutsListener.js} +7 -7
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableShortcutsListener.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Table3/hooks/listeners/useSortingStateListener.js → primitives/Table/useTable/listeners/useTableSortingListener.js} +6 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSortingListener.js.map +1 -0
- package/dist/esm/packages/taco/src/{components/Table3/hooks/features/useColumnOrdering.js → primitives/Table/useTable/util/columns.js} +24 -15
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +1 -0
- package/dist/esm/packages/taco/src/types.js +6 -0
- package/dist/esm/packages/taco/src/types.js.map +1 -0
- package/dist/esm/packages/taco/src/utils/date.js +0 -1
- package/dist/esm/packages/taco/src/utils/date.js.map +1 -1
- package/dist/primitives/Table/types.d.ts +35 -0
- package/dist/primitives/Table/useTable/features/useTableColumnOrdering.d.ts +3 -0
- package/dist/primitives/Table/useTable/features/useTableFontSize.d.ts +7 -0
- package/dist/primitives/Table/useTable/features/useTablePrinting.d.ts +7 -0
- package/dist/primitives/Table/useTable/features/useTableRowActive.d.ts +12 -0
- package/dist/primitives/Table/useTable/features/useTableRowClick.d.ts +7 -0
- package/dist/primitives/Table/useTable/features/useTableRowGoto.d.ts +5 -0
- package/dist/primitives/Table/useTable/features/useTableRowHeight.d.ts +7 -0
- package/dist/primitives/Table/useTable/features/useTableRowSelection.d.ts +6 -0
- package/dist/primitives/Table/useTable/features/useTableServerLoading.d.ts +6 -0
- package/dist/primitives/Table/useTable/listeners/useTableDataListener.d.ts +2 -0
- package/dist/primitives/Table/useTable/listeners/useTableFilterListener.d.ts +3 -0
- package/dist/primitives/Table/useTable/listeners/useTableFontSizeListener.d.ts +2 -0
- package/dist/primitives/Table/useTable/listeners/useTableRowSelectionListener.d.ts +3 -0
- package/dist/primitives/Table/useTable/listeners/useTableServerLoadingListener.d.ts +3 -0
- package/dist/primitives/Table/useTable/listeners/useTableShortcutsListener.d.ts +3 -0
- package/dist/primitives/Table/useTable/listeners/useTableSortingListener.d.ts +3 -0
- package/dist/primitives/Table/useTable/util/columns.d.ts +4 -0
- package/dist/taco.cjs.development.js +827 -711
- 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/types.d.ts +5 -0
- package/package.json +3 -3
- package/types.json +11267 -13766
- package/dist/components/Table3/hooks/features/useColumnOrdering.d.ts +0 -6
- package/dist/components/Table3/hooks/features/useCurrentRow.d.ts +0 -11
- package/dist/components/Table3/hooks/features/useFontSize.d.ts +0 -7
- package/dist/components/Table3/hooks/features/usePauseHoverState.d.ts +0 -6
- package/dist/components/Table3/hooks/features/usePrinting.d.ts +0 -8
- package/dist/components/Table3/hooks/features/useRowClick.d.ts +0 -6
- package/dist/components/Table3/hooks/features/useRowGoto.d.ts +0 -5
- package/dist/components/Table3/hooks/features/useRowHeight.d.ts +0 -7
- package/dist/components/Table3/hooks/features/useRowSelection.d.ts +0 -6
- package/dist/components/Table3/hooks/listeners/useCurrentRowListener.d.ts +0 -2
- package/dist/components/Table3/hooks/listeners/useFilteringStateListener.d.ts +0 -3
- package/dist/components/Table3/hooks/listeners/useRowSelectionListener.d.ts +0 -3
- package/dist/components/Table3/hooks/listeners/useServerLoadingListener.d.ts +0 -3
- package/dist/components/Table3/hooks/listeners/useShortcutsListener.d.ts +0 -3
- package/dist/components/Table3/hooks/listeners/useSortingStateListener.d.ts +0 -3
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnOrdering.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useCurrentRow.js +0 -93
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useCurrentRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useFontSize.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePauseHoverState.js +0 -22
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePauseHoverState.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePrinting.js +0 -14
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePrinting.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowClick.js +0 -25
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowClick.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowGoto.js +0 -9
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowGoto.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowHeight.js +0 -27
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowHeight.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowSelection.js +0 -32
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowSelection.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useCurrentRowListener.js +0 -15
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useCurrentRowListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useFilteringStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useRowSelectionListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useServerLoadingListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useShortcutsListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSortingStateListener.js.map +0 -1
@@ -36,8 +36,8 @@ var get = _interopDefault(require('lodash/get'));
|
|
36
36
|
var compact = _interopDefault(require('lodash/compact'));
|
37
37
|
var pullAt = _interopDefault(require('lodash/pullAt'));
|
38
38
|
var reactTable$1 = require('@tanstack/react-table');
|
39
|
-
var _ = _interopDefault(require('lodash'));
|
40
39
|
var ReactDOM = _interopDefault(require('react-dom'));
|
40
|
+
var _ = _interopDefault(require('lodash'));
|
41
41
|
var reactVirtual = require('react-virtual');
|
42
42
|
var core = require('@dnd-kit/core');
|
43
43
|
var SortablePrimitive = require('@dnd-kit/sortable');
|
@@ -3627,14 +3627,14 @@ const Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
|
3627
3627
|
const className = cn('inline-flex h-[1.715em] w-[1.715em] flex-shrink-0', props.className, {
|
3628
3628
|
'p-[3px]': (_props$className = props.className) === null || _props$className === void 0 ? void 0 : _props$className.includes('rounded-full')
|
3629
3629
|
});
|
3630
|
-
return Component ? /*#__PURE__*/React__default.createElement(Component, Object.assign({}, otherProps, {
|
3630
|
+
return Component ? ( /*#__PURE__*/React__default.createElement(Component, Object.assign({}, otherProps, {
|
3631
3631
|
className: className,
|
3632
3632
|
"data-taco": "icon",
|
3633
3633
|
"data-icon-name": name,
|
3634
3634
|
focusable: "false",
|
3635
3635
|
ref: ref,
|
3636
3636
|
role: "img"
|
3637
|
-
})) : null;
|
3637
|
+
}))) : null;
|
3638
3638
|
});
|
3639
3639
|
|
3640
3640
|
const BadgeIcon = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
@@ -4571,13 +4571,13 @@ const Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
|
4571
4571
|
className: className,
|
4572
4572
|
"data-taco": "banner",
|
4573
4573
|
ref: ref
|
4574
|
-
}, getBannerIcon(state), children, onClose ? /*#__PURE__*/React.createElement(IconButton, {
|
4574
|
+
}, getBannerIcon(state), children, onClose ? ( /*#__PURE__*/React.createElement(IconButton, {
|
4575
4575
|
"aria-label": texts.banner.close,
|
4576
4576
|
className: "ml-auto -mr-2 self-start",
|
4577
4577
|
icon: "close",
|
4578
4578
|
appearance: "discrete",
|
4579
4579
|
onClick: onClose
|
4580
|
-
}) : null);
|
4580
|
+
})) : null);
|
4581
4581
|
});
|
4582
4582
|
|
4583
4583
|
const Base$1 = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
@@ -4661,18 +4661,18 @@ const Navbar = /*#__PURE__*/React.memo(({
|
|
4661
4661
|
name: "month",
|
4662
4662
|
onChange: handleChange,
|
4663
4663
|
value: value.getMonth()
|
4664
|
-
}, months.map((month, i) => /*#__PURE__*/React.createElement("option", {
|
4664
|
+
}, months.map((month, i) => ( /*#__PURE__*/React.createElement("option", {
|
4665
4665
|
key: month,
|
4666
4666
|
value: i
|
4667
|
-
}, month))), /*#__PURE__*/React.createElement("select", {
|
4667
|
+
}, month)))), /*#__PURE__*/React.createElement("select", {
|
4668
4668
|
className: "h-8 px-2",
|
4669
4669
|
name: "year",
|
4670
4670
|
onChange: handleChange,
|
4671
4671
|
value: value.getFullYear()
|
4672
|
-
}, years.map(year => /*#__PURE__*/React.createElement("option", {
|
4672
|
+
}, years.map(year => ( /*#__PURE__*/React.createElement("option", {
|
4673
4673
|
key: year,
|
4674
4674
|
value: year
|
4675
|
-
}, String(year))))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tooltip, {
|
4675
|
+
}, String(year)))))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tooltip, {
|
4676
4676
|
title: actions.previousMonth
|
4677
4677
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
4678
4678
|
appearance: "discrete",
|
@@ -5278,17 +5278,17 @@ const ScrollableList = /*#__PURE__*/React.forwardRef(function ScrollableList(pro
|
|
5278
5278
|
};
|
5279
5279
|
return /*#__PURE__*/React.createElement("ul", Object.assign({}, list, {
|
5280
5280
|
"data-taco": "scrollable-list"
|
5281
|
-
}), loading ? /*#__PURE__*/React.createElement("li", {
|
5281
|
+
}), loading ? ( /*#__PURE__*/React.createElement("li", {
|
5282
5282
|
className: "yt-list__empty"
|
5283
5283
|
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Spinner, {
|
5284
5284
|
delay: 0
|
5285
|
-
})), /*#__PURE__*/React.createElement("span", null, texts.listbox.loading)) : options.length ? options.map(({
|
5285
|
+
})), /*#__PURE__*/React.createElement("span", null, texts.listbox.loading))) : options.length ? options.map(({
|
5286
5286
|
children,
|
5287
5287
|
icon,
|
5288
5288
|
...optionProps
|
5289
|
-
}) => /*#__PURE__*/React.createElement("li", Object.assign({}, optionProps), icon, /*#__PURE__*/React.createElement("span", {
|
5289
|
+
}) => ( /*#__PURE__*/React.createElement("li", Object.assign({}, optionProps), icon, /*#__PURE__*/React.createElement("span", {
|
5290
5290
|
className: "flex-grow truncate text-left"
|
5291
|
-
}, children), multiselect && /*#__PURE__*/React.createElement(Checkbox
|
5291
|
+
}, children), multiselect && ( /*#__PURE__*/React.createElement(Checkbox
|
5292
5292
|
// In multiselect variant, this checkbox only acts as visual representation of item being selected,
|
5293
5293
|
// so need to be taken out of screen reader scope.
|
5294
5294
|
, {
|
@@ -5297,9 +5297,9 @@ const ScrollableList = /*#__PURE__*/React.forwardRef(function ScrollableList(pro
|
|
5297
5297
|
checked: optionProps['aria-selected'],
|
5298
5298
|
onChange: () => null,
|
5299
5299
|
className: "pointer-events-none ml-2 self-center p-px"
|
5300
|
-
}))) : /*#__PURE__*/React.createElement("li", {
|
5300
|
+
}))))) : ( /*#__PURE__*/React.createElement("li", {
|
5301
5301
|
className: "yt-list__empty"
|
5302
|
-
}, /*#__PURE__*/React.createElement("span", null, texts.listbox.empty)));
|
5302
|
+
}, /*#__PURE__*/React.createElement("span", null, texts.listbox.empty))));
|
5303
5303
|
});
|
5304
5304
|
|
5305
5305
|
// returns a custom event compatible with all browsers
|
@@ -5577,7 +5577,8 @@ const useCombobox = ({
|
|
5577
5577
|
event.preventDefault();
|
5578
5578
|
return;
|
5579
5579
|
}
|
5580
|
-
|
5580
|
+
// event.target.value is always a string so it is important to cast value to a string before checking the equality
|
5581
|
+
if (onChange && event.target.value !== String(value)) {
|
5581
5582
|
const item = findByValue(flattenedData, event.target.value);
|
5582
5583
|
event.detail = sanitizeItem(item);
|
5583
5584
|
const parents = getOptionParents(flattenedData, item === null || item === void 0 ? void 0 : item.path);
|
@@ -5756,7 +5757,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5756
5757
|
ref: ref
|
5757
5758
|
}), /*#__PURE__*/React.createElement(Input, Object.assign({}, input, {
|
5758
5759
|
autoComplete: "off",
|
5759
|
-
button: props.inline ? /*#__PURE__*/React.createElement(IconButton
|
5760
|
+
button: props.inline ? ( /*#__PURE__*/React.createElement(IconButton
|
5760
5761
|
// In case of inline combobox, this icon button acts only as visual chevron representation,
|
5761
5762
|
// so should be taken out of screen reader scope.
|
5762
5763
|
, {
|
@@ -5770,7 +5771,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5770
5771
|
(_input$ref$current = input.ref.current) === null || _input$ref$current === void 0 ? void 0 : _input$ref$current.focus();
|
5771
5772
|
},
|
5772
5773
|
tabIndex: -1
|
5773
|
-
}) : dialog ? /*#__PURE__*/React.createElement(IconButton, {
|
5774
|
+
})) : dialog ? ( /*#__PURE__*/React.createElement(IconButton, {
|
5774
5775
|
"aria-label": texts.combobox.tooltip,
|
5775
5776
|
icon: "list-search",
|
5776
5777
|
disabled: props.readOnly || props.disabled,
|
@@ -5784,7 +5785,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5784
5785
|
ref: button.ref,
|
5785
5786
|
tabIndex: -1,
|
5786
5787
|
tooltip: texts.combobox.tooltip
|
5787
|
-
}) : undefined
|
5788
|
+
})) : undefined
|
5788
5789
|
})))), /*#__PURE__*/React.createElement(PopoverPrimitive.Portal, null, /*#__PURE__*/React.createElement(PopoverPrimitive.Content, {
|
5789
5790
|
align: "start",
|
5790
5791
|
onOpenAutoFocus: event => {
|
@@ -5854,7 +5855,6 @@ const parseFromCustomString = (date = '', mask = 'dd.mm.yy') => {
|
|
5854
5855
|
Object.is(day, NaN) ? currentDate.getDate() : day, /* hours */12, /* minutes */0 // set to midday to avoid UTC offset causing dates to be mismatched server side
|
5855
5856
|
);
|
5856
5857
|
};
|
5857
|
-
|
5858
5858
|
const parseFromISOString = date => {
|
5859
5859
|
const tempDate = new Date(date);
|
5860
5860
|
return dateFns.isValid(tempDate) ? parseFromCustomString(format(new Date(date))) : undefined;
|
@@ -6025,10 +6025,10 @@ const Content$3 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, r
|
|
6025
6025
|
className: "text-white"
|
6026
6026
|
})));
|
6027
6027
|
});
|
6028
|
-
const Close$1 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(PopoverPrimitive.Close, Object.assign({}, props, {
|
6028
|
+
const Close$1 = /*#__PURE__*/React.forwardRef((props, ref) => ( /*#__PURE__*/React.createElement(PopoverPrimitive.Close, Object.assign({}, props, {
|
6029
6029
|
ref: ref,
|
6030
6030
|
asChild: true
|
6031
|
-
})));
|
6031
|
+
}))));
|
6032
6032
|
const Popover = /*#__PURE__*/React.forwardRef(function Popover(props, ref) {
|
6033
6033
|
const {
|
6034
6034
|
anchor,
|
@@ -6086,20 +6086,20 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
6086
6086
|
disabled: input.disabled || input.readOnly,
|
6087
6087
|
icon: "calendar",
|
6088
6088
|
tabIndex: -1,
|
6089
|
-
popover: props => /*#__PURE__*/React.createElement(Popover, Object.assign({}, props), /*#__PURE__*/React.createElement(Popover.Content, null, ({
|
6089
|
+
popover: props => ( /*#__PURE__*/React.createElement(Popover, Object.assign({}, props), /*#__PURE__*/React.createElement(Popover.Content, null, ({
|
6090
6090
|
close
|
6091
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
6091
|
+
}) => ( /*#__PURE__*/React.createElement("div", {
|
6092
6092
|
className: "-m-3 flex"
|
6093
6093
|
}, /*#__PURE__*/React.createElement(Calendar$1, Object.assign({}, calendar, {
|
6094
6094
|
onChange: (date, event) => {
|
6095
6095
|
calendar.onChange(date, event);
|
6096
6096
|
close();
|
6097
6097
|
}
|
6098
|
-
})), shortcuts && /*#__PURE__*/React.createElement("div", {
|
6098
|
+
})), shortcuts && ( /*#__PURE__*/React.createElement("div", {
|
6099
6099
|
className: "border-grey-300 flex flex-col border-l"
|
6100
6100
|
}, /*#__PURE__*/React.createElement("span", {
|
6101
6101
|
className: "m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold"
|
6102
|
-
}, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), /*#__PURE__*/React.createElement("ul", null, shortcuts.map(shortcut => /*#__PURE__*/React.createElement("li", {
|
6102
|
+
}, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), /*#__PURE__*/React.createElement("ul", null, shortcuts.map(shortcut => ( /*#__PURE__*/React.createElement("li", {
|
6103
6103
|
key: shortcut.text
|
6104
6104
|
}, /*#__PURE__*/React.createElement("button", {
|
6105
6105
|
type: "button",
|
@@ -6109,7 +6109,7 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
6109
6109
|
shortcut.onClick(event);
|
6110
6110
|
close();
|
6111
6111
|
}
|
6112
|
-
}, shortcut.text)))), handleReset && /*#__PURE__*/React.createElement("button", {
|
6112
|
+
}, shortcut.text))))), handleReset && ( /*#__PURE__*/React.createElement("button", {
|
6113
6113
|
type: "button",
|
6114
6114
|
className: "mx-auto my-4 mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs text-blue-500 hover:text-blue-300",
|
6115
6115
|
onClick: event => {
|
@@ -6117,7 +6117,7 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
6117
6117
|
handleReset(event);
|
6118
6118
|
close();
|
6119
6119
|
}
|
6120
|
-
}, texts.datepicker.clear))))),
|
6120
|
+
}, texts.datepicker.clear))))))))),
|
6121
6121
|
tooltip: texts.datepicker.calendar
|
6122
6122
|
})
|
6123
6123
|
})));
|
@@ -6293,13 +6293,13 @@ const Content$4 = /*#__PURE__*/React.forwardRef(function DialogContent(props, re
|
|
6293
6293
|
}), /*#__PURE__*/React.createElement("div", {
|
6294
6294
|
className: containerClassName,
|
6295
6295
|
"data-taco": "dialog"
|
6296
|
-
}, output, dialog.draggable && /*#__PURE__*/React.createElement("div", Object.assign({}, dragHandleProps, {
|
6296
|
+
}, output, dialog.draggable && ( /*#__PURE__*/React.createElement("div", Object.assign({}, dragHandleProps, {
|
6297
6297
|
role: "button",
|
6298
6298
|
draggable: true,
|
6299
6299
|
"aria-grabbed": dragging,
|
6300
6300
|
"aria-label": texts.dialog.drag,
|
6301
6301
|
className: "yt-dialog__drag absolute-center-x bg-grey-100 top-1.5 h-3 w-24 cursor-move rounded text-center"
|
6302
|
-
})), dialog.showCloseButton ? /*#__PURE__*/React.createElement(DialogPrimitive.Close, {
|
6302
|
+
}))), dialog.showCloseButton ? ( /*#__PURE__*/React.createElement(DialogPrimitive.Close, {
|
6303
6303
|
onClick: dialog.onClose,
|
6304
6304
|
asChild: true
|
6305
6305
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
@@ -6307,7 +6307,7 @@ const Content$4 = /*#__PURE__*/React.forwardRef(function DialogContent(props, re
|
|
6307
6307
|
"aria-label": texts.dialog.close,
|
6308
6308
|
className: "absolute top-0 right-0 mt-2 mr-2",
|
6309
6309
|
icon: "close"
|
6310
|
-
})) : null), dialog.elements.drawer, dialog.elements.extra))));
|
6310
|
+
}))) : null), dialog.elements.drawer, dialog.elements.extra))));
|
6311
6311
|
});
|
6312
6312
|
|
6313
6313
|
const DialogDrawer = /*#__PURE__*/React.forwardRef(function DialogDrawer(props, ref) {
|
@@ -6633,11 +6633,11 @@ const Portal = props => {
|
|
6633
6633
|
}
|
6634
6634
|
return /*#__PURE__*/React__default.createElement(DialogPrimitive.Portal, Object.assign({}, otherProps, {
|
6635
6635
|
container: outlet !== null && outlet !== void 0 ? outlet : undefined
|
6636
|
-
}), variant === 'overlay' ? /*#__PURE__*/React__default.createElement(DialogPrimitive.Overlay, {
|
6636
|
+
}), variant === 'overlay' ? ( /*#__PURE__*/React__default.createElement(DialogPrimitive.Overlay, {
|
6637
6637
|
forceMount: true
|
6638
6638
|
}, /*#__PURE__*/React__default.createElement(Backdrop, {
|
6639
6639
|
className: backdropClassNames
|
6640
|
-
})) : null, children);
|
6640
|
+
}))) : null, children);
|
6641
6641
|
};
|
6642
6642
|
const UntrappedFocusDrawerContent = /*#__PURE__*/React__default.forwardRef(function EmbeddedDrawerContent(props, ref) {
|
6643
6643
|
const {
|
@@ -6758,19 +6758,19 @@ const DrawerContent = /*#__PURE__*/React__default.forwardRef(function Content(pr
|
|
6758
6758
|
}), dragging ? /*#__PURE__*/React__default.createElement("div", {
|
6759
6759
|
"data-testid": "resize-hit-area",
|
6760
6760
|
className: "fixed bottom-0 left-0 right-0 top-0"
|
6761
|
-
}) : null), showCloseButton ? /*#__PURE__*/React__default.createElement(Close$3, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
6761
|
+
}) : null), showCloseButton ? ( /*#__PURE__*/React__default.createElement(Close$3, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
6762
6762
|
appearance: "discrete",
|
6763
6763
|
"aria-label": texts.drawer.close,
|
6764
6764
|
className: "absolute right-0 top-0 mr-2 mt-4",
|
6765
6765
|
icon: "close"
|
6766
|
-
})) : null);
|
6766
|
+
}))) : null);
|
6767
6767
|
const styleProp = {
|
6768
6768
|
...style,
|
6769
6769
|
...{
|
6770
6770
|
width: resizedWidth
|
6771
6771
|
}
|
6772
6772
|
};
|
6773
|
-
return focusTrap ? /*#__PURE__*/React__default.createElement(DialogPrimitive.Content, Object.assign({
|
6773
|
+
return focusTrap ? ( /*#__PURE__*/React__default.createElement(DialogPrimitive.Content, Object.assign({
|
6774
6774
|
forceMount: true
|
6775
6775
|
}, otherProps, {
|
6776
6776
|
className: contentClassName,
|
@@ -6779,12 +6779,12 @@ const DrawerContent = /*#__PURE__*/React__default.forwardRef(function Content(pr
|
|
6779
6779
|
onCloseAutoFocus: handleCloseAutoFocus,
|
6780
6780
|
ref: ref,
|
6781
6781
|
style: styleProp
|
6782
|
-
}), content) : /*#__PURE__*/React__default.createElement(UntrappedFocusDrawerContent, {
|
6782
|
+
}), content)) : ( /*#__PURE__*/React__default.createElement(UntrappedFocusDrawerContent, {
|
6783
6783
|
onEscape: handleEscapeKeyDown,
|
6784
6784
|
className: contentClassName,
|
6785
6785
|
style: styleProp,
|
6786
6786
|
ref: ref
|
6787
|
-
}, content);
|
6787
|
+
}, content));
|
6788
6788
|
});
|
6789
6789
|
const Content$5 = /*#__PURE__*/React__default.forwardRef(function Content(props, externalRef) {
|
6790
6790
|
const {
|
@@ -6947,14 +6947,14 @@ const Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
|
6947
6947
|
className: className,
|
6948
6948
|
"data-taco": "label",
|
6949
6949
|
ref: ref
|
6950
|
-
}), children, message && /*#__PURE__*/React.createElement(Tooltip, {
|
6950
|
+
}), children, message && ( /*#__PURE__*/React.createElement(Tooltip, {
|
6951
6951
|
title: message,
|
6952
6952
|
hide: !isMessageTrucated
|
6953
6953
|
}, /*#__PURE__*/React.createElement("span", {
|
6954
6954
|
className: messageClassName,
|
6955
6955
|
ref: messageRef,
|
6956
6956
|
role: invalid ? 'alert' : undefined
|
6957
|
-
}, message)));
|
6957
|
+
}, message))));
|
6958
6958
|
});
|
6959
6959
|
|
6960
6960
|
const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
@@ -7614,20 +7614,20 @@ const Shortcut = ({
|
|
7614
7614
|
const texts = getShortcutText(keys);
|
7615
7615
|
return /*#__PURE__*/React__default.createElement("span", Object.assign({}, props, {
|
7616
7616
|
className: className
|
7617
|
-
}), texts.map(key => /*#__PURE__*/React__default.createElement("kbd", {
|
7617
|
+
}), texts.map(key => ( /*#__PURE__*/React__default.createElement("kbd", {
|
7618
7618
|
key: key,
|
7619
7619
|
className: "font-display text-grey-700 [[data-taco=tooltip]_&]:bg-grey-300/[0.25] rounded-sm bg-black/[0.09] px-1 text-center font-bold [[data-taco=tooltip]_&]:text-white"
|
7620
|
-
}, key)));
|
7620
|
+
}, key))));
|
7621
7621
|
};
|
7622
7622
|
|
7623
7623
|
const Icon$1 = ({
|
7624
7624
|
name
|
7625
|
-
}) => /*#__PURE__*/React.createElement("span", {
|
7625
|
+
}) => ( /*#__PURE__*/React.createElement("span", {
|
7626
7626
|
className: "absolute left-0 ml-1"
|
7627
7627
|
}, /*#__PURE__*/React.createElement(Icon, {
|
7628
7628
|
className: "-ml-px -mt-px !h-5 !w-5",
|
7629
7629
|
name: name
|
7630
|
-
}));
|
7630
|
+
})));
|
7631
7631
|
const useItemStyling = ({
|
7632
7632
|
disabled,
|
7633
7633
|
indented,
|
@@ -7699,12 +7699,12 @@ const Item$1 = /*#__PURE__*/React.forwardRef(function MenuItem(props, ref) {
|
|
7699
7699
|
ref: ref
|
7700
7700
|
}), icon ? /*#__PURE__*/React.createElement(Icon$1, {
|
7701
7701
|
name: icon
|
7702
|
-
}) : null, props.children, shortcut ? /*#__PURE__*/React.createElement("span", {
|
7702
|
+
}) : null, props.children, shortcut ? ( /*#__PURE__*/React.createElement("span", {
|
7703
7703
|
className: "ml-auto pl-5"
|
7704
7704
|
}, /*#__PURE__*/React.createElement(Shortcut, {
|
7705
7705
|
keys: shortcut,
|
7706
7706
|
className: "text-grey-700"
|
7707
|
-
})) : null);
|
7707
|
+
}))) : null);
|
7708
7708
|
if (typeof dialog === 'function') {
|
7709
7709
|
button = dialog({
|
7710
7710
|
trigger: button,
|
@@ -8085,12 +8085,12 @@ const TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGr
|
|
8085
8085
|
}, typeof title === 'function' ? title(expanded) : title), /*#__PURE__*/React__default.createElement("ul", {
|
8086
8086
|
role: "group",
|
8087
8087
|
className: listClassName
|
8088
|
-
}, React__default.Children.toArray(children).filter(item => !!item).map((item, i) => /*#__PURE__*/React__default.createElement("li", {
|
8088
|
+
}, React__default.Children.toArray(children).filter(item => !!item).map((item, i) => ( /*#__PURE__*/React__default.createElement("li", {
|
8089
8089
|
key: i,
|
8090
8090
|
role: "none"
|
8091
8091
|
}, /*#__PURE__*/React__default.cloneElement(item, {
|
8092
8092
|
role: 'treeitem'
|
8093
|
-
})))));
|
8093
|
+
}))))));
|
8094
8094
|
});
|
8095
8095
|
const Treeview = /*#__PURE__*/React__default.forwardRef(function Treeview(props, ref) {
|
8096
8096
|
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, props, {
|
@@ -8222,10 +8222,10 @@ const Menu$2 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref)
|
|
8222
8222
|
return /*#__PURE__*/React__default.createElement(Treeview, Object.assign({}, props, {
|
8223
8223
|
className: cn('divide-grey-100 flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className),
|
8224
8224
|
ref: ref
|
8225
|
-
}), scrollableAreas.map((area, i) => Array.isArray(area) ? /*#__PURE__*/React__default.createElement("div", {
|
8225
|
+
}), scrollableAreas.map((area, i) => Array.isArray(area) ? ( /*#__PURE__*/React__default.createElement("div", {
|
8226
8226
|
className: "divide-grey-100 flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto",
|
8227
8227
|
key: i
|
8228
|
-
}, area) : area));
|
8228
|
+
}, area)) : area));
|
8229
8229
|
});
|
8230
8230
|
Menu$2.Group = MenuGroup;
|
8231
8231
|
const Navigation = /*#__PURE__*/React__default.forwardRef(function Navigation(props, ref) {
|
@@ -8349,7 +8349,7 @@ const OverflowGroup = /*#__PURE__*/React__default.forwardRef(function OverflowGr
|
|
8349
8349
|
})), hiddenChildren.length ? /*#__PURE__*/React__default.cloneElement(button, {
|
8350
8350
|
className: cn('sticky right-0 order-[99]', button.props.className),
|
8351
8351
|
'data-observer-ignore': true,
|
8352
|
-
menu: menuProps => /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, hiddenChildren.map(sanitizeButtonPropsForMenuItem))),
|
8352
|
+
menu: menuProps => ( /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, hiddenChildren.map(sanitizeButtonPropsForMenuItem)))),
|
8353
8353
|
ref: buttonRefCallback
|
8354
8354
|
}) : null);
|
8355
8355
|
});
|
@@ -8382,14 +8382,14 @@ const PageNumbers = ({
|
|
8382
8382
|
const {
|
8383
8383
|
texts
|
8384
8384
|
} = useLocalization();
|
8385
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, range.map(pageNumber => /*#__PURE__*/React.createElement(Button$1, {
|
8385
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, range.map(pageNumber => ( /*#__PURE__*/React.createElement(Button$1, {
|
8386
8386
|
appearance: pageNumber === currentPageIndex + 1 ? 'primary' : 'default',
|
8387
8387
|
"aria-current": pageNumber === currentPageIndex + 1 ? 'page' : undefined,
|
8388
8388
|
key: pageNumber,
|
8389
8389
|
onClick: () => handleClick(pageNumber - 1),
|
8390
8390
|
"aria-label": texts.pagination.actions.pageX.replace('[X]', String(pageNumber)),
|
8391
8391
|
tooltip: texts.pagination.actions.pageX.replace('[X]', String(pageNumber))
|
8392
|
-
}, pageNumber)));
|
8392
|
+
}, pageNumber))));
|
8393
8393
|
};
|
8394
8394
|
|
8395
8395
|
const useSelect = ({
|
@@ -8500,9 +8500,9 @@ const useSelect = ({
|
|
8500
8500
|
} else {
|
8501
8501
|
const item = findByValue(flattenedData, value);
|
8502
8502
|
if (item) {
|
8503
|
-
text = item.icon ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.cloneElement(item.icon, {
|
8503
|
+
text = item.icon ? ( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.cloneElement(item.icon, {
|
8504
8504
|
className: cn(item.icon.props.className, 'mr-1 -mt-px')
|
8505
|
-
}), item.text) : item.text;
|
8505
|
+
}), item.text)) : item.text;
|
8506
8506
|
}
|
8507
8507
|
}
|
8508
8508
|
}
|
@@ -8748,7 +8748,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
8748
8748
|
className: className,
|
8749
8749
|
"data-taco": "pagination",
|
8750
8750
|
ref: ref
|
8751
|
-
}), showPageSize && /*#__PURE__*/React.createElement("span", {
|
8751
|
+
}), showPageSize && ( /*#__PURE__*/React.createElement("span", {
|
8752
8752
|
className: "mr-4"
|
8753
8753
|
}, getShowingLabel(length, pageIndex, pageSize, texts), /*#__PURE__*/React.createElement(Select, {
|
8754
8754
|
"aria-label": texts.pagination.pageSize,
|
@@ -8762,7 +8762,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
8762
8762
|
setPageSize(Number(event.target.value));
|
8763
8763
|
},
|
8764
8764
|
value: pageSize
|
8765
|
-
})), showPageControls && /*#__PURE__*/React.createElement(Group, {
|
8765
|
+
}))), showPageControls && ( /*#__PURE__*/React.createElement(Group, {
|
8766
8766
|
as: "nav",
|
8767
8767
|
"aria-label": texts.pagination.label
|
8768
8768
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
@@ -8779,11 +8779,11 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
8779
8779
|
onClick: () => setPageIndex(pageIndex - 1),
|
8780
8780
|
"aria-label": showShortcutTexts ? texts.pagination.actions.previousPageWithShortcut : texts.pagination.actions.previousPage,
|
8781
8781
|
tooltip: showShortcutTexts ? texts.pagination.actions.previousPageWithShortcut : texts.pagination.actions.previousPage
|
8782
|
-
}), showPageNumbers && pageCount > 0 && /*#__PURE__*/React.createElement(PageNumbers, {
|
8782
|
+
}), showPageNumbers && pageCount > 0 && ( /*#__PURE__*/React.createElement(PageNumbers, {
|
8783
8783
|
pageCount: pageCount,
|
8784
8784
|
currentPageIndex: pageIndex,
|
8785
8785
|
onClick: setPageIndex
|
8786
|
-
}), /*#__PURE__*/React.createElement(IconButton, {
|
8786
|
+
})), /*#__PURE__*/React.createElement(IconButton, {
|
8787
8787
|
appearance: "default",
|
8788
8788
|
disabled: !canNextPage,
|
8789
8789
|
icon: "arrow-right",
|
@@ -8797,7 +8797,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
8797
8797
|
onClick: () => setPageIndex(pageCount - 1),
|
8798
8798
|
"aria-label": showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage,
|
8799
8799
|
tooltip: showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage
|
8800
|
-
})));
|
8800
|
+
}))));
|
8801
8801
|
});
|
8802
8802
|
|
8803
8803
|
const Progress = ({
|
@@ -9045,7 +9045,7 @@ const ToastProvider = ({
|
|
9045
9045
|
role: "log"
|
9046
9046
|
}, /*#__PURE__*/React.createElement(framerMotion.AnimatePresence, {
|
9047
9047
|
initial: false
|
9048
|
-
}, toasts.map(toast => /*#__PURE__*/React.createElement(framerMotion.motion.div, {
|
9048
|
+
}, toasts.map(toast => ( /*#__PURE__*/React.createElement(framerMotion.motion.div, {
|
9049
9049
|
key: toast.id,
|
9050
9050
|
transition: {
|
9051
9051
|
type: 'spring',
|
@@ -9071,7 +9071,7 @@ const ToastProvider = ({
|
|
9071
9071
|
}
|
9072
9072
|
}, /*#__PURE__*/React.createElement(Toast, Object.assign({}, toast, {
|
9073
9073
|
onClose: () => handleClose(toast.id)
|
9074
|
-
})))))));
|
9074
|
+
}))))))));
|
9075
9075
|
};
|
9076
9076
|
const useToast = () => React.useContext(ToastContext);
|
9077
9077
|
|
@@ -9128,7 +9128,7 @@ const SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput({
|
|
9128
9128
|
placeholder: texts.searchInput.placeholder
|
9129
9129
|
}, props, {
|
9130
9130
|
onKeyDown: handleKeyDown,
|
9131
|
-
postfix: /*#__PURE__*/React.createElement(React.Fragment, null, props.disabled || props.readOnly || !props.value ? null : /*#__PURE__*/React.createElement(IconButton, {
|
9131
|
+
postfix: /*#__PURE__*/React.createElement(React.Fragment, null, props.disabled || props.readOnly || !props.value ? null : ( /*#__PURE__*/React.createElement(IconButton, {
|
9132
9132
|
"aria-hidden": true,
|
9133
9133
|
"aria-label": texts.searchInput.clear,
|
9134
9134
|
className: "group-peer-focus:visible group-peer-hover:visible !text-grey-700 invisible mr-0.5 !h-5 !min-h-[theme(spacing.4)] !w-5 !min-w-[theme(spacing.4)] text-xs hover:visible group-hover:visible",
|
@@ -9137,7 +9137,7 @@ const SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput({
|
|
9137
9137
|
rounded: true,
|
9138
9138
|
tabIndex: -1,
|
9139
9139
|
tooltip: texts.searchInput.clear
|
9140
|
-
}), /*#__PURE__*/React.createElement(IconButton, {
|
9140
|
+
})), /*#__PURE__*/React.createElement(IconButton, {
|
9141
9141
|
"aria-label": texts.searchInput.button,
|
9142
9142
|
icon: "search",
|
9143
9143
|
className: "group-peer-focus:!border-transparent group-peer-focus:group-peer-active:!border-transparent -mr-2 !border-transparent !bg-transparent focus:!border-transparent",
|
@@ -9233,9 +9233,9 @@ const SearchInput2 = /*#__PURE__*/React__default.forwardRef(function SearchInput
|
|
9233
9233
|
icon: "close",
|
9234
9234
|
onMouseDown: handleClear,
|
9235
9235
|
tabIndex: -1,
|
9236
|
-
tooltip: focused ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.searchInput.clear, " ", /*#__PURE__*/React__default.createElement(Shortcut, {
|
9236
|
+
tooltip: focused ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.searchInput.clear, " ", /*#__PURE__*/React__default.createElement(Shortcut, {
|
9237
9237
|
keys: "Escape"
|
9238
|
-
})) : texts.searchInput.clear
|
9238
|
+
}))) : texts.searchInput.clear
|
9239
9239
|
});
|
9240
9240
|
}
|
9241
9241
|
if (hasFind && isActive) {
|
@@ -9243,28 +9243,28 @@ const SearchInput2 = /*#__PURE__*/React__default.forwardRef(function SearchInput
|
|
9243
9243
|
className: "text-grey-700 flex h-4 items-center border-r border-black/[0.25] pr-2"
|
9244
9244
|
}, loading ? /*#__PURE__*/React__default.createElement(Spinner, {
|
9245
9245
|
className: "h-4 w-4"
|
9246
|
-
}) : `${findCurrent !== null && findCurrent !== void 0 ? findCurrent : 0}/${findTotal !== null && findTotal !== void 0 ? findTotal : 0}`), findCurrent ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
9246
|
+
}) : `${findCurrent !== null && findCurrent !== void 0 ? findCurrent : 0}/${findTotal !== null && findTotal !== void 0 ? findTotal : 0}`), findCurrent ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
9247
9247
|
"aria-label": texts.searchInput.findPrevious,
|
9248
9248
|
className: "scale-75 !bg-transparent hover:!bg-black/[0.08] [&>svg]:scale-125",
|
9249
9249
|
icon: "chevron-up",
|
9250
9250
|
onMouseDown: handleClickFindPrevious,
|
9251
9251
|
tabIndex: -1,
|
9252
|
-
tooltip: focused ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.searchInput.findPrevious, " ", /*#__PURE__*/React__default.createElement(Shortcut, {
|
9252
|
+
tooltip: focused ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.searchInput.findPrevious, " ", /*#__PURE__*/React__default.createElement(Shortcut, {
|
9253
9253
|
keys: {
|
9254
9254
|
shift: true,
|
9255
9255
|
key: 'Enter'
|
9256
9256
|
}
|
9257
|
-
})) : texts.searchInput.findPrevious
|
9257
|
+
}))) : texts.searchInput.findPrevious
|
9258
9258
|
}), /*#__PURE__*/React__default.createElement(IconButton, {
|
9259
9259
|
"aria-label": texts.searchInput.findNext,
|
9260
9260
|
className: "scale-75 !bg-transparent hover:!bg-black/[0.08] [&>svg]:scale-125",
|
9261
9261
|
icon: "chevron-down",
|
9262
9262
|
onMouseDown: handleClickFindNext,
|
9263
9263
|
tabIndex: -1,
|
9264
|
-
tooltip: focused ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.searchInput.findNext, " ", /*#__PURE__*/React__default.createElement(Shortcut, {
|
9264
|
+
tooltip: focused ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.searchInput.findNext, " ", /*#__PURE__*/React__default.createElement(Shortcut, {
|
9265
9265
|
keys: "Enter"
|
9266
|
-
})) : texts.searchInput.findNext
|
9267
|
-
})) : null, postfix);
|
9266
|
+
}))) : texts.searchInput.findNext
|
9267
|
+
}))) : null, postfix);
|
9268
9268
|
}
|
9269
9269
|
} else if (shortcut && !focused && !value) {
|
9270
9270
|
postfix = /*#__PURE__*/React__default.createElement(Shortcut, {
|
@@ -9670,16 +9670,16 @@ const Tag$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
9670
9670
|
}), /*#__PURE__*/React__default.createElement("span", {
|
9671
9671
|
className: "truncate px-2",
|
9672
9672
|
ref: textRef
|
9673
|
-
}, icon ? typeof icon === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
9673
|
+
}, icon ? typeof icon === 'string' ? ( /*#__PURE__*/React__default.createElement(Icon, {
|
9674
9674
|
name: icon,
|
9675
9675
|
className: "mr-1 -ml-1 -mt-0.5 !h-5 !w-5"
|
9676
|
-
}) : /*#__PURE__*/React__default.cloneElement(icon, {
|
9676
|
+
})) : ( /*#__PURE__*/React__default.cloneElement(icon, {
|
9677
9677
|
className: 'mr-1 -ml-1 -mt-0.5 !h-5 !w-5'
|
9678
|
-
}) : null, children), onDelete ? /*#__PURE__*/React__default.createElement(Icon, {
|
9678
|
+
})) : null, children), onDelete ? ( /*#__PURE__*/React__default.createElement(Icon, {
|
9679
9679
|
name: "close",
|
9680
9680
|
onClick: onDelete,
|
9681
9681
|
className: "-ml-1.5 !h-6 !w-5 flex-shrink-0 cursor-pointer rounded-r p-0.5 hover:bg-black/5"
|
9682
|
-
}) : null);
|
9682
|
+
})) : null);
|
9683
9683
|
});
|
9684
9684
|
|
9685
9685
|
const createOptionClassName = (shouldPauseHoverState = false) => cn('group mb-px flex w-full text-sm flex-shrink-0 font-normal cursor-pointer items-center rounded bg-white px-2 leading-8 text-black aria-hidden:hidden gap-1.5 bg-white aria-current:wcag-grey-200 aria-disabled:text-black/25 aria-disabled:pointer-events-none', {
|
@@ -9838,9 +9838,9 @@ const EditPopover = props => {
|
|
9838
9838
|
className: "focus:!shadow-none"
|
9839
9839
|
}, ({
|
9840
9840
|
close
|
9841
|
-
}) => /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
9841
|
+
}) => ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
9842
9842
|
className: "flex w-32 flex-col space-y-2"
|
9843
|
-
}, onEdit ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Field, {
|
9843
|
+
}, onEdit ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Field, {
|
9844
9844
|
className: cn('!min-h-fit', {
|
9845
9845
|
'!pb-0': !validationError
|
9846
9846
|
}),
|
@@ -9852,23 +9852,23 @@ const EditPopover = props => {
|
|
9852
9852
|
onKeyDown: handleInputKeyDown(close),
|
9853
9853
|
ref: ref,
|
9854
9854
|
value: name
|
9855
|
-
})), initialColor ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("h5", null, "Colours"), /*#__PURE__*/React__default.createElement(Colours, {
|
9855
|
+
})), initialColor ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("h5", null, "Colours"), /*#__PURE__*/React__default.createElement(Colours, {
|
9856
9856
|
color: color,
|
9857
9857
|
onChangeColor: setColor,
|
9858
9858
|
onKeyDown: preventKeyDownPropagation
|
9859
|
-
})) : null, /*#__PURE__*/React__default.createElement(Group, null, /*#__PURE__*/React__default.createElement(Button$1, {
|
9859
|
+
}))) : null, /*#__PURE__*/React__default.createElement(Group, null, /*#__PURE__*/React__default.createElement(Button$1, {
|
9860
9860
|
onClick: close
|
9861
9861
|
}, texts.select2.cancel), /*#__PURE__*/React__default.createElement(Button$1, {
|
9862
9862
|
appearance: "primary",
|
9863
9863
|
onClick: handleSave(close)
|
9864
|
-
}, texts.select2.save))) : null, onEdit && onDelete ? /*#__PURE__*/React__default.createElement("hr", null) : null, onDelete ? /*#__PURE__*/React__default.createElement("button", {
|
9864
|
+
}, texts.select2.save)))) : null, onEdit && onDelete ? /*#__PURE__*/React__default.createElement("hr", null) : null, onDelete ? ( /*#__PURE__*/React__default.createElement("button", {
|
9865
9865
|
className: "hover:text-grey-700 flex items-center justify-start gap-1",
|
9866
9866
|
onClick: handleDelete(close),
|
9867
9867
|
onKeyDown: preventKeyDownPropagation
|
9868
9868
|
}, /*#__PURE__*/React__default.createElement(Icon, {
|
9869
9869
|
className: "!h-5 !w-5",
|
9870
9870
|
name: "delete-permanently"
|
9871
|
-
}), " ", texts.select2.delete) : null))));
|
9871
|
+
}), " ", texts.select2.delete)) : null)))));
|
9872
9872
|
};
|
9873
9873
|
const Colours = props => {
|
9874
9874
|
const {
|
@@ -9887,7 +9887,7 @@ const Colours = props => {
|
|
9887
9887
|
onKeyDown: onKeyDown,
|
9888
9888
|
onValueChange: color => onChangeColor(color),
|
9889
9889
|
value: color
|
9890
|
-
}, AVAILABLE_COLORS.map(availableColor => /*#__PURE__*/React__default.createElement(RadioGroupPrimitive.Item, {
|
9890
|
+
}, AVAILABLE_COLORS.map(availableColor => ( /*#__PURE__*/React__default.createElement(RadioGroupPrimitive.Item, {
|
9891
9891
|
"aria-label": color,
|
9892
9892
|
className: cn('flex h-6 w-6 cursor-pointer items-center justify-center rounded', getSubtleColorShadeClasses(availableColor)),
|
9893
9893
|
key: availableColor,
|
@@ -9898,7 +9898,7 @@ const Colours = props => {
|
|
9898
9898
|
}, /*#__PURE__*/React__default.createElement(Icon, {
|
9899
9899
|
name: "tick",
|
9900
9900
|
className: "!h-5 !w-5"
|
9901
|
-
})))));
|
9901
|
+
}))))));
|
9902
9902
|
};
|
9903
9903
|
|
9904
9904
|
const mobiles = /iPhone|iPad|iPod|Android/i;
|
@@ -9959,14 +9959,14 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
9959
9959
|
onClick: handleClick,
|
9960
9960
|
onKeyDown: handleKeyDown,
|
9961
9961
|
ref: ref
|
9962
|
-
}), hasValue ? /*#__PURE__*/React__default.createElement(Icon, {
|
9962
|
+
}), hasValue ? ( /*#__PURE__*/React__default.createElement(Icon, {
|
9963
9963
|
name: "tick",
|
9964
9964
|
className: "pointer-events-none invisible -mx-0.5 !h-4 !w-4 group-aria-selected:visible"
|
9965
|
-
}) : null, isTag ? /*#__PURE__*/React__default.createElement(Tag$1, {
|
9965
|
+
})) : null, isTag ? ( /*#__PURE__*/React__default.createElement(Tag$1, {
|
9966
9966
|
className: "pointer-events-none my-1",
|
9967
9967
|
color: color,
|
9968
9968
|
icon: prefix
|
9969
|
-
}, children) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, prefix ? typeof prefix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
9969
|
+
}, children)) : ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, prefix ? typeof prefix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
9970
9970
|
name: prefix
|
9971
9971
|
}) : prefix : null, /*#__PURE__*/React__default.createElement("span", {
|
9972
9972
|
className: "flex w-full justify-between"
|
@@ -9978,7 +9978,7 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
9978
9978
|
className: "flex flex-col self-center"
|
9979
9979
|
}, postfix ? typeof postfix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
9980
9980
|
name: postfix
|
9981
|
-
}) : postfix : null))), popover ? /*#__PURE__*/React__default.createElement(IconButton, {
|
9981
|
+
}) : postfix : null)))), popover ? ( /*#__PURE__*/React__default.createElement(IconButton, {
|
9982
9982
|
icon: "ellipsis-vertical",
|
9983
9983
|
appearance: "discrete",
|
9984
9984
|
className: cn('group-aria-current:visible invisible -mr-1 ml-auto !h-5 min-h-[theme(spacing.6)] !w-5 min-w-[theme(spacing.6)] hover:!bg-black/[.08] focus:!shadow-none group-hover:visible', {
|
@@ -9991,7 +9991,7 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
9991
9991
|
},
|
9992
9992
|
popover: popover,
|
9993
9993
|
tabIndex: -1
|
9994
|
-
}) : null);
|
9994
|
+
})) : null);
|
9995
9995
|
});
|
9996
9996
|
|
9997
9997
|
const Group$2 = /*#__PURE__*/React__default.forwardRef(function Select2Group(props, ref) {
|
@@ -10090,7 +10090,7 @@ const Button$2 = /*#__PURE__*/React__default.forwardRef(function Select2TriggerB
|
|
10090
10090
|
disabled: disabled,
|
10091
10091
|
onClick: handleClick,
|
10092
10092
|
ref: ref,
|
10093
|
-
role: "
|
10093
|
+
role: "button",
|
10094
10094
|
tabIndex: disabled || readOnly ? -1 : tabIndex,
|
10095
10095
|
type: "button"
|
10096
10096
|
}), children, /*#__PURE__*/React__default.createElement(Icon, {
|
@@ -10131,10 +10131,10 @@ const Single = /*#__PURE__*/React__default.forwardRef(function Select2TriggerSin
|
|
10131
10131
|
readOnly: readOnly
|
10132
10132
|
}, currentValue.props.children);
|
10133
10133
|
} else {
|
10134
|
-
output = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, currentValue.props.prefix ? typeof currentValue.props.prefix === 'string' ? /*#__PURE__*/React__default.createElement(Icon, {
|
10134
|
+
output = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, currentValue.props.prefix ? typeof currentValue.props.prefix === 'string' ? ( /*#__PURE__*/React__default.createElement(Icon, {
|
10135
10135
|
name: currentValue.props.prefix,
|
10136
10136
|
className: "mr-1 !h-5 !w-5"
|
10137
|
-
}) : currentValue.props.prefix : null, currentValue.props.children);
|
10137
|
+
})) : currentValue.props.prefix : null, currentValue.props.children);
|
10138
10138
|
}
|
10139
10139
|
}
|
10140
10140
|
return /*#__PURE__*/React__default.createElement(Button$2, Object.assign({}, buttonProps, {
|
@@ -10171,12 +10171,12 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
10171
10171
|
className: "my-1 flex max-h-[5.5rem] flex-col"
|
10172
10172
|
}, /*#__PURE__*/React__default.createElement("div", {
|
10173
10173
|
className: "flex flex-wrap gap-1"
|
10174
|
-
}, valuesAsChildren.length === 0 ? /*#__PURE__*/React__default.createElement("div", {
|
10174
|
+
}, valuesAsChildren.length === 0 ? ( /*#__PURE__*/React__default.createElement("div", {
|
10175
10175
|
className: cn({
|
10176
10176
|
'text-grey-700': disabled,
|
10177
10177
|
'text-grey-500': !disabled
|
10178
10178
|
})
|
10179
|
-
}, placeholder) : valuesAsChildren.map(child => /*#__PURE__*/React__default.createElement(Tag$1, {
|
10179
|
+
}, placeholder)) : valuesAsChildren.map(child => ( /*#__PURE__*/React__default.createElement(Tag$1, {
|
10180
10180
|
key: String(child.props.value),
|
10181
10181
|
className: "truncate",
|
10182
10182
|
color: tags ? child.props.color : undefined,
|
@@ -10190,7 +10190,7 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
|
|
10190
10190
|
}
|
10191
10191
|
},
|
10192
10192
|
readOnly: readOnly
|
10193
|
-
}, child.props.children))));
|
10193
|
+
}, child.props.children)))));
|
10194
10194
|
} else {
|
10195
10195
|
content = /*#__PURE__*/React__default.createElement(MultipleValue, {
|
10196
10196
|
key: String(open),
|
@@ -10235,12 +10235,12 @@ const MultipleValue = ({
|
|
10235
10235
|
}, /*#__PURE__*/React__default.createElement("div", {
|
10236
10236
|
className: "flex gap-1 truncate",
|
10237
10237
|
ref: el => setContentRef(el)
|
10238
|
-
}, valuesAsChildren.length === 0 ? /*#__PURE__*/React__default.createElement("div", {
|
10238
|
+
}, valuesAsChildren.length === 0 ? ( /*#__PURE__*/React__default.createElement("div", {
|
10239
10239
|
className: cn({
|
10240
10240
|
'text-grey-700': disabled,
|
10241
10241
|
'text-grey-500': !disabled
|
10242
10242
|
})
|
10243
|
-
}, placeholder) : valuesAsChildren.map((child, index) => {
|
10243
|
+
}, placeholder)) : valuesAsChildren.map((child, index) => {
|
10244
10244
|
const tag = /*#__PURE__*/React__default.createElement(Tag$1, {
|
10245
10245
|
key: String(child.props.value),
|
10246
10246
|
className: cn('cursor-pointer', {
|
@@ -10260,11 +10260,11 @@ const MultipleValue = ({
|
|
10260
10260
|
}, tag);
|
10261
10261
|
}
|
10262
10262
|
return tag;
|
10263
|
-
})), boundaryIndex !== undefined && boundaryIndex !== null && boundaryIndex < valuesAsChildren.length - 1 ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
10263
|
+
})), boundaryIndex !== undefined && boundaryIndex !== null && boundaryIndex < valuesAsChildren.length - 1 ? ( /*#__PURE__*/React__default.createElement(Tooltip, {
|
10264
10264
|
title: valuesAsChildren.slice(boundaryIndex + 1).map(child => child ? String(child.props.children) : '').join(', ')
|
10265
10265
|
}, /*#__PURE__*/React__default.createElement(Badge, {
|
10266
10266
|
className: "flex-shrink-0"
|
10267
|
-
}, "+", valuesAsChildren.length - (boundaryIndex + 1))) : null);
|
10267
|
+
}, "+", valuesAsChildren.length - (boundaryIndex + 1)))) : null);
|
10268
10268
|
};
|
10269
10269
|
const matchesValue = value => child => {
|
10270
10270
|
if (Array.isArray(value)) {
|
@@ -10750,13 +10750,13 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
10750
10750
|
style: {
|
10751
10751
|
minWidth: dimensions !== null && dimensions !== void 0 && dimensions.width ? `${dimensions.width}px` : undefined
|
10752
10752
|
}
|
10753
|
-
}, flattenedChildren.length > 0 || onCreate ? /*#__PURE__*/React__default.createElement(Search$1, {
|
10753
|
+
}, flattenedChildren.length > 0 || onCreate ? ( /*#__PURE__*/React__default.createElement(Search$1, {
|
10754
10754
|
placeholder: onCreate ? texts.select2.searchOrCreate : texts.select2.search,
|
10755
10755
|
ref: searchRef
|
10756
|
-
}) : null, flattenedChildren.length <= 0 ? /*#__PURE__*/React__default.createElement("div", {
|
10756
|
+
})) : null, flattenedChildren.length <= 0 ? ( /*#__PURE__*/React__default.createElement("div", {
|
10757
10757
|
className: "text-grey-700 -mt-0.5 flex h-8 items-center px-2",
|
10758
10758
|
role: "presentation"
|
10759
|
-
}, "No results found...") : /*#__PURE__*/React__default.createElement(Root$1, {
|
10759
|
+
}, "No results found...")) : ( /*#__PURE__*/React__default.createElement(Root$1, {
|
10760
10760
|
className: "flex flex-col gap-0.5",
|
10761
10761
|
customSelector: ":scope > button",
|
10762
10762
|
disabled: disabled,
|
@@ -10767,10 +10767,10 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
10767
10767
|
setValue: setValue,
|
10768
10768
|
tabIndex: -1,
|
10769
10769
|
value: value
|
10770
|
-
}, searchQuery === '' ? /*#__PURE__*/React__default.createElement(Collection$1, null, initialChildren) : /*#__PURE__*/React__default.createElement(Collection$1, null, filteredChildren), onCreate ? /*#__PURE__*/React__default.createElement(Create, {
|
10770
|
+
}, searchQuery === '' ? ( /*#__PURE__*/React__default.createElement(Collection$1, null, initialChildren)) : ( /*#__PURE__*/React__default.createElement(Collection$1, null, filteredChildren)), onCreate ? /*#__PURE__*/React__default.createElement(Create, {
|
10771
10771
|
onCreate: onCreate,
|
10772
10772
|
options: flattenedChildren
|
10773
|
-
}) : null))))));
|
10773
|
+
}) : null)))))));
|
10774
10774
|
});
|
10775
10775
|
Select2.Option = Option$1;
|
10776
10776
|
Select2.Group = Group$2;
|
@@ -10803,10 +10803,10 @@ const ControlledHiddenField = props => {
|
|
10803
10803
|
value: bubbleValue
|
10804
10804
|
}, emptyValue !== undefined ? /*#__PURE__*/React__default.createElement("option", {
|
10805
10805
|
value: emptyValue
|
10806
|
-
}) : null, options.map(option => /*#__PURE__*/React__default.createElement("option", {
|
10806
|
+
}) : null, options.map(option => ( /*#__PURE__*/React__default.createElement("option", {
|
10807
10807
|
key: String(option),
|
10808
10808
|
value: String(option)
|
10809
|
-
})));
|
10809
|
+
}))));
|
10810
10810
|
}
|
10811
10811
|
return null;
|
10812
10812
|
};
|
@@ -11213,7 +11213,7 @@ const useRowActions = (inlineEditingUniqueId, handlers, actions, rowExpansionRen
|
|
11213
11213
|
}
|
11214
11214
|
const sanitizedRow = sanitizeRowProps(row, rowExpansionRenderer);
|
11215
11215
|
const [primaryActions, secondaryActions] = getActions(actions, sanitizedRow);
|
11216
|
-
const output = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, handlers.onRowCreate && /*#__PURE__*/React__default.createElement(IconButton, {
|
11216
|
+
const output = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, handlers.onRowCreate && ( /*#__PURE__*/React__default.createElement(IconButton, {
|
11217
11217
|
appearance: "discrete",
|
11218
11218
|
icon: "circle-plus",
|
11219
11219
|
"aria-label": texts.table.newSubRow,
|
@@ -11228,7 +11228,7 @@ const useRowActions = (inlineEditingUniqueId, handlers, actions, rowExpansionRen
|
|
11228
11228
|
}
|
11229
11229
|
handlers.onRowCreate(sanitizedRow, event);
|
11230
11230
|
}
|
11231
|
-
}), (inlineEditing || handlers.onRowEdit) && /*#__PURE__*/React__default.createElement(IconButton, {
|
11231
|
+
})), (inlineEditing || handlers.onRowEdit) && ( /*#__PURE__*/React__default.createElement(IconButton, {
|
11232
11232
|
appearance: "discrete",
|
11233
11233
|
icon: "edit",
|
11234
11234
|
"aria-label": texts.table.edit,
|
@@ -11244,7 +11244,7 @@ const useRowActions = (inlineEditingUniqueId, handlers, actions, rowExpansionRen
|
|
11244
11244
|
handlers.onRowEdit(sanitizedRow, event);
|
11245
11245
|
}
|
11246
11246
|
}
|
11247
|
-
}), handlers.onRowCopy && /*#__PURE__*/React__default.createElement(IconButton, {
|
11247
|
+
})), handlers.onRowCopy && ( /*#__PURE__*/React__default.createElement(IconButton, {
|
11248
11248
|
appearance: "discrete",
|
11249
11249
|
icon: "copy",
|
11250
11250
|
"aria-label": texts.table.copy,
|
@@ -11256,7 +11256,7 @@ const useRowActions = (inlineEditingUniqueId, handlers, actions, rowExpansionRen
|
|
11256
11256
|
row.setActive();
|
11257
11257
|
handlers.onRowCopy(sanitizedRow, event);
|
11258
11258
|
}
|
11259
|
-
}), handlers.onRowDelete && /*#__PURE__*/React__default.createElement(IconButton, {
|
11259
|
+
})), handlers.onRowDelete && ( /*#__PURE__*/React__default.createElement(IconButton, {
|
11260
11260
|
appearance: "discrete",
|
11261
11261
|
icon: "delete",
|
11262
11262
|
"aria-label": texts.table.del,
|
@@ -11268,12 +11268,12 @@ const useRowActions = (inlineEditingUniqueId, handlers, actions, rowExpansionRen
|
|
11268
11268
|
row.setActive();
|
11269
11269
|
handlers.onRowDelete(sanitizedRow, event);
|
11270
11270
|
}
|
11271
|
-
}), primaryActions.map((action, index) => /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, getActionProps(action, sanitizedRow), {
|
11271
|
+
})), primaryActions.map((action, index) => ( /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, getActionProps(action, sanitizedRow), {
|
11272
11272
|
key: index,
|
11273
11273
|
appearance: "discrete",
|
11274
11274
|
icon: typeof action.icon === 'function' ? action.icon(sanitizedRow) : action.icon,
|
11275
11275
|
tooltip: typeof action.tooltip === 'function' ? action.tooltip(sanitizedRow) : action.tooltip
|
11276
|
-
}))), secondaryActions.length ? /*#__PURE__*/React__default.createElement(Menu$1, null, /*#__PURE__*/React__default.createElement(Menu$1.Trigger, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
11276
|
+
})))), secondaryActions.length ? ( /*#__PURE__*/React__default.createElement(Menu$1, null, /*#__PURE__*/React__default.createElement(Menu$1.Trigger, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
11277
11277
|
appearance: "discrete",
|
11278
11278
|
icon: "ellipsis-vertical",
|
11279
11279
|
"aria-label": texts.table.actions,
|
@@ -11283,10 +11283,10 @@ const useRowActions = (inlineEditingUniqueId, handlers, actions, rowExpansionRen
|
|
11283
11283
|
event.stopPropagation();
|
11284
11284
|
row.setActive();
|
11285
11285
|
}
|
11286
|
-
})), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, secondaryActions.map((action, index) => /*#__PURE__*/React__default.createElement(Menu$1.Item, Object.assign({
|
11286
|
+
})), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, secondaryActions.map((action, index) => ( /*#__PURE__*/React__default.createElement(Menu$1.Item, Object.assign({
|
11287
11287
|
key: index,
|
11288
11288
|
icon: typeof action.icon === 'function' ? action.icon(sanitizedRow) : action.icon
|
11289
|
-
}, getActionProps(action, sanitizedRow)), typeof action.text === 'function' ? action.text(sanitizedRow) : action.text)))) : null);
|
11289
|
+
}, getActionProps(action, sanitizedRow)), typeof action.text === 'function' ? action.text(sanitizedRow) : action.text)))))) : null);
|
11290
11290
|
if (windowed) {
|
11291
11291
|
return /*#__PURE__*/React__default.createElement("div", {
|
11292
11292
|
className: actionGroupClassName
|
@@ -11297,10 +11297,10 @@ const useRowActions = (inlineEditingUniqueId, handlers, actions, rowExpansionRen
|
|
11297
11297
|
}, ({
|
11298
11298
|
inView,
|
11299
11299
|
ref
|
11300
|
-
}) => /*#__PURE__*/React__default.createElement("div", {
|
11300
|
+
}) => ( /*#__PURE__*/React__default.createElement("div", {
|
11301
11301
|
className: actionGroupClassName,
|
11302
11302
|
ref: ref
|
11303
|
-
}, inView ? output : null));
|
11303
|
+
}, inView ? output : null)));
|
11304
11304
|
}
|
11305
11305
|
}]);
|
11306
11306
|
}
|
@@ -11934,10 +11934,10 @@ const Column = ({
|
|
11934
11934
|
"data-taco": "table-column"
|
11935
11935
|
}), /*#__PURE__*/React__default.createElement("span", {
|
11936
11936
|
className: "truncate"
|
11937
|
-
}, cell.render('Header')), cell.isSorted ? /*#__PURE__*/React__default.createElement(Icon, {
|
11937
|
+
}, cell.render('Header')), cell.isSorted ? ( /*#__PURE__*/React__default.createElement(Icon, {
|
11938
11938
|
name: cell.isSortedDesc ? 'chevron-down-solid' : 'chevron-up-solid',
|
11939
11939
|
className: "-mt-0.5"
|
11940
|
-
}) : null);
|
11940
|
+
})) : null);
|
11941
11941
|
};
|
11942
11942
|
|
11943
11943
|
const DefaultEmptyState = () => null;
|
@@ -11966,15 +11966,15 @@ const BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(prop
|
|
11966
11966
|
role: "rowgroup",
|
11967
11967
|
className: "yt-table__head",
|
11968
11968
|
ref: headerRef
|
11969
|
-
}, headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map((headerGroup, index) => /*#__PURE__*/React__default.createElement("div", {
|
11969
|
+
}, headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map((headerGroup, index) => ( /*#__PURE__*/React__default.createElement("div", {
|
11970
11970
|
key: index,
|
11971
11971
|
role: "row",
|
11972
11972
|
className: "border-grey-300 flex h-auto min-h-[2.5rem] w-full select-none border-t-0 border-b-2 font-bold"
|
11973
|
-
}, headerGroup.headers.map((cell, index) => /*#__PURE__*/React__default.createElement(Column, {
|
11973
|
+
}, headerGroup.headers.map((cell, index) => ( /*#__PURE__*/React__default.createElement(Column, {
|
11974
11974
|
key: index,
|
11975
11975
|
index: index,
|
11976
11976
|
cell: cell
|
11977
|
-
}))))), /*#__PURE__*/React__default.createElement("div", {
|
11977
|
+
}))))))), /*#__PURE__*/React__default.createElement("div", {
|
11978
11978
|
role: "rowgroup",
|
11979
11979
|
className: "yt-table__body",
|
11980
11980
|
ref: bodyRef
|
@@ -12172,14 +12172,14 @@ const WindowedTable = /*#__PURE__*/React__default.forwardRef(function WindowedTa
|
|
12172
12172
|
}, ({
|
12173
12173
|
onItemsRendered,
|
12174
12174
|
ref
|
12175
|
-
}) => /*#__PURE__*/React__default.createElement(reactWindow.VariableSizeList, Object.assign({}, listProps, {
|
12175
|
+
}) => ( /*#__PURE__*/React__default.createElement(reactWindow.VariableSizeList, Object.assign({}, listProps, {
|
12176
12176
|
itemCount: length,
|
12177
12177
|
onItemsRendered: onItemsRendered,
|
12178
12178
|
ref: list => {
|
12179
12179
|
ref(list);
|
12180
12180
|
setRowsRef(list);
|
12181
12181
|
}
|
12182
|
-
}), VariableRow));
|
12182
|
+
}), VariableRow)));
|
12183
12183
|
} else {
|
12184
12184
|
list = /*#__PURE__*/React__default.createElement(reactWindow.VariableSizeList, Object.assign({}, listProps, {
|
12185
12185
|
itemCount: rows.length,
|
@@ -12346,6 +12346,57 @@ function GotoPopover(props) {
|
|
12346
12346
|
})));
|
12347
12347
|
}
|
12348
12348
|
|
12349
|
+
// Determines the scroll distance required to display a specific cell in the table.
|
12350
|
+
// Returns the scroll distance if scrolling is necessary; otherwise, returns null.
|
12351
|
+
function getTableLeftScrollDistance(tableElement, cell, frozenColumnIndex, isEditing = false) {
|
12352
|
+
var _Array$from;
|
12353
|
+
const row = cell === null || cell === void 0 ? void 0 : cell.closest('[role="row"]');
|
12354
|
+
// When editing is enabled, the action column overlays other columns.
|
12355
|
+
// To account for it, incorporate a 'rightOffset' during table scrolling towards the right.
|
12356
|
+
// 60px is the width of the action column and 10px is added to account for the shadow that it has.
|
12357
|
+
const rightOffset = isEditing ? 70 : 0;
|
12358
|
+
if (!row) {
|
12359
|
+
return null;
|
12360
|
+
}
|
12361
|
+
const rowChildren = (_Array$from = Array.from(row.children)) !== null && _Array$from !== void 0 ? _Array$from : [];
|
12362
|
+
const cellIndex = rowChildren.indexOf(cell);
|
12363
|
+
if (cellIndex === -1) {
|
12364
|
+
return null;
|
12365
|
+
}
|
12366
|
+
let scrollDistance = 0;
|
12367
|
+
const EXTRA_SPACING = 0;
|
12368
|
+
const tableRect = tableElement.getBoundingClientRect();
|
12369
|
+
const cellRect = cell.getBoundingClientRect();
|
12370
|
+
const tableShouldScrollRight = cellRect.right > tableRect.right - rightOffset;
|
12371
|
+
const tableShouldScrollLeft = cellRect.left < tableRect.left;
|
12372
|
+
// If column header is behind the frozen columns then scroll the parentHeader into view
|
12373
|
+
if (frozenColumnIndex !== -1 && cellIndex > frozenColumnIndex) {
|
12374
|
+
var _rowChildren$frozenCo;
|
12375
|
+
const lastFrozenColumnRect = (_rowChildren$frozenCo = rowChildren[frozenColumnIndex]) === null || _rowChildren$frozenCo === void 0 ? void 0 : _rowChildren$frozenCo.getBoundingClientRect();
|
12376
|
+
const isColumnBehindFrozenColumn = lastFrozenColumnRect.right > cellRect.left;
|
12377
|
+
if (isColumnBehindFrozenColumn) {
|
12378
|
+
scrollDistance = tableElement.scrollLeft - (lastFrozenColumnRect.right - cellRect.left);
|
12379
|
+
return scrollDistance;
|
12380
|
+
} else if (tableShouldScrollRight) {
|
12381
|
+
scrollDistance = tableElement.scrollLeft + (cellRect.right - tableRect.right + EXTRA_SPACING) + rightOffset;
|
12382
|
+
return scrollDistance;
|
12383
|
+
}
|
12384
|
+
// If column is not behind frozen columns and table doesn't have to be scrolled right to show
|
12385
|
+
// the column then that means that the column is visible on the screen
|
12386
|
+
} else {
|
12387
|
+
if (tableShouldScrollLeft) {
|
12388
|
+
scrollDistance = tableElement.scrollLeft - (tableRect.left - cellRect.left);
|
12389
|
+
return scrollDistance;
|
12390
|
+
} else if (tableShouldScrollRight) {
|
12391
|
+
scrollDistance = tableElement.scrollLeft + (cellRect.right - tableRect.right + EXTRA_SPACING) + rightOffset;
|
12392
|
+
return scrollDistance;
|
12393
|
+
}
|
12394
|
+
// If table doesn't have to be scrolled right or left to show the column then that means that
|
12395
|
+
// the column is visible on the screen
|
12396
|
+
}
|
12397
|
+
return null;
|
12398
|
+
}
|
12399
|
+
|
12349
12400
|
function isGotoAvailable(table, header) {
|
12350
12401
|
if (isInternalColumn(header.id)) {
|
12351
12402
|
return false;
|
@@ -12381,6 +12432,34 @@ function Menu$3(props) {
|
|
12381
12432
|
} = useLocalization();
|
12382
12433
|
const [popover, setPopover] = React__default.useState(undefined);
|
12383
12434
|
const [sortDirectionState, setSortDirectionState] = React__default.useState(sortDirection);
|
12435
|
+
const ref = React__default.useRef(null);
|
12436
|
+
const gotoShortcut = 'g';
|
12437
|
+
React__default.useEffect(() => {
|
12438
|
+
const {
|
12439
|
+
frozenColumnIndex: externalFrozenColumnIndex = -1,
|
12440
|
+
frozenInternalColumnCount = 0
|
12441
|
+
} = tableMeta.columnFreezing;
|
12442
|
+
const handler = createShortcutKeyDownHandler(gotoShortcut, () => {
|
12443
|
+
// Only execute the below code if the header menu has goto menu item
|
12444
|
+
if (handleGoto) {
|
12445
|
+
var _ref$current;
|
12446
|
+
const tableElement = tableMeta.tableRef.current;
|
12447
|
+
const frozenColumnIndex = externalFrozenColumnIndex > -1 ? externalFrozenColumnIndex + frozenInternalColumnCount : frozenInternalColumnCount - 1;
|
12448
|
+
const parentHeader = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.closest('[role="columnheader"]');
|
12449
|
+
if (!tableElement || !parentHeader) {
|
12450
|
+
return;
|
12451
|
+
}
|
12452
|
+
const leftScrollDistance = getTableLeftScrollDistance(tableElement, parentHeader, frozenColumnIndex);
|
12453
|
+
if (leftScrollDistance !== null) {
|
12454
|
+
tableElement.scrollLeft = leftScrollDistance;
|
12455
|
+
}
|
12456
|
+
}
|
12457
|
+
},
|
12458
|
+
// Prevents the stopping of event propagation
|
12459
|
+
false);
|
12460
|
+
document.addEventListener('keydown', handler);
|
12461
|
+
return () => document.removeEventListener('keydown', handler);
|
12462
|
+
}, [tableMeta.columnFreezing.frozenColumnIndex, handleGoto]);
|
12384
12463
|
const handleSortMenuRadioGroupChange = newSortDirection => {
|
12385
12464
|
setSortDirectionState(newSortDirection);
|
12386
12465
|
handleSortToggle(newSortDirection);
|
@@ -12397,7 +12476,7 @@ function Menu$3(props) {
|
|
12397
12476
|
const _temp = _finallyRethrows(function () {
|
12398
12477
|
return _catch(function () {
|
12399
12478
|
return Promise.resolve(handleGoto(query)).then(function (index) {
|
12400
|
-
tableMeta.
|
12479
|
+
tableMeta.rowActive.setRowActiveIndex(index);
|
12401
12480
|
scrollToIndex(index + 2, {
|
12402
12481
|
align: 'center'
|
12403
12482
|
});
|
@@ -12440,7 +12519,7 @@ function Menu$3(props) {
|
|
12440
12519
|
if (canSort) {
|
12441
12520
|
menuItems.push( /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
12442
12521
|
icon: "sort-by",
|
12443
|
-
subMenu: () => /*#__PURE__*/React__default.createElement(Menu$1.SubMenu, null, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup, {
|
12522
|
+
subMenu: () => ( /*#__PURE__*/React__default.createElement(Menu$1.SubMenu, null, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup, {
|
12444
12523
|
onChange: handleSortMenuRadioGroupChange,
|
12445
12524
|
value: sortDirectionState
|
12446
12525
|
}, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
|
@@ -12449,14 +12528,14 @@ function Menu$3(props) {
|
|
12449
12528
|
value: SORT_DIRECTION.DESC
|
12450
12529
|
}, texts.table3.columns.menu.sortingOrder.descending), /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
|
12451
12530
|
value: false
|
12452
|
-
}, texts.table3.columns.menu.sortingOrder.unsorted)))
|
12531
|
+
}, texts.table3.columns.menu.sortingOrder.unsorted))))
|
12453
12532
|
}, texts.table3.columns.menu.sorting));
|
12454
12533
|
}
|
12455
12534
|
if (handleGoto) {
|
12456
12535
|
menuItems.push( /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
12457
12536
|
icon: "move",
|
12458
12537
|
onClick: () => setPopover('goto'),
|
12459
|
-
shortcut:
|
12538
|
+
shortcut: gotoShortcut
|
12460
12539
|
}, texts.table3.columns.menu.gotoRow, "..."));
|
12461
12540
|
}
|
12462
12541
|
if (canFreeze) {
|
@@ -12495,9 +12574,10 @@ function Menu$3(props) {
|
|
12495
12574
|
return /*#__PURE__*/React__default.createElement(IconButton, {
|
12496
12575
|
className: className,
|
12497
12576
|
icon: "more",
|
12498
|
-
menu: popoverElement ? undefined : menuProps => /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, memoedMenuItems)),
|
12577
|
+
menu: popoverElement ? undefined : menuProps => ( /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, memoedMenuItems))),
|
12499
12578
|
popover: popoverElement,
|
12500
|
-
onClickCapture: event => event.preventDefault()
|
12579
|
+
onClickCapture: event => event.preventDefault(),
|
12580
|
+
ref: ref
|
12501
12581
|
});
|
12502
12582
|
}
|
12503
12583
|
|
@@ -12607,7 +12687,7 @@ function Header$1(props) {
|
|
12607
12687
|
}
|
12608
12688
|
return undefined;
|
12609
12689
|
}, [hasGoto, JSON.stringify(sorting), JSON.stringify(filters), search]);
|
12610
|
-
const
|
12690
|
+
const headerContentProps = {
|
12611
12691
|
align: columnMeta.align,
|
12612
12692
|
canFreeze: tableMeta.columnFreezing.isEnabled,
|
12613
12693
|
canHide: column.getCanHide(),
|
@@ -12621,7 +12701,7 @@ function Header$1(props) {
|
|
12621
12701
|
index: header.index,
|
12622
12702
|
isFrozen: isFrozenColumn(header, table),
|
12623
12703
|
isPlaceholder: header.isPlaceholder,
|
12624
|
-
isPrinting: tableMeta.isPrinting,
|
12704
|
+
isPrinting: tableMeta.printing.isPrinting,
|
12625
12705
|
isResizing: column.getIsResizing(),
|
12626
12706
|
length: table.getRowModel().rows.length,
|
12627
12707
|
meta: columnMeta,
|
@@ -12634,9 +12714,9 @@ function Header$1(props) {
|
|
12634
12714
|
sortDirection: column.getIsSorted(),
|
12635
12715
|
table
|
12636
12716
|
};
|
12637
|
-
return /*#__PURE__*/React__default.createElement(
|
12717
|
+
return /*#__PURE__*/React__default.createElement(HeaderContent, Object.assign({}, headerContentProps));
|
12638
12718
|
}
|
12639
|
-
|
12719
|
+
function HeaderContent(props) {
|
12640
12720
|
var _meta$tooltip;
|
12641
12721
|
const {
|
12642
12722
|
align,
|
@@ -12703,16 +12783,16 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
12703
12783
|
"data-column-index": index,
|
12704
12784
|
role: "columnheader",
|
12705
12785
|
ref: setInternalRef
|
12706
|
-
}), isPlaceholder ? null : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, isInternalColumn(id) ? children : /*#__PURE__*/React__default.createElement(Tooltip, {
|
12786
|
+
}), isPlaceholder ? null : ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, isInternalColumn(id) ? children : ( /*#__PURE__*/React__default.createElement(Tooltip, {
|
12707
12787
|
title: String((_meta$tooltip = meta === null || meta === void 0 ? void 0 : meta.tooltip) !== null && _meta$tooltip !== void 0 ? _meta$tooltip : children),
|
12708
12788
|
placement: "top"
|
12709
12789
|
}, /*#__PURE__*/React__default.createElement("span", {
|
12710
12790
|
className: cn({
|
12711
12791
|
truncate: !isPrinting
|
12712
12792
|
})
|
12713
|
-
}, children)), canSort ? /*#__PURE__*/React__default.createElement(SortIndicator, {
|
12793
|
+
}, children))), canSort ? /*#__PURE__*/React__default.createElement(SortIndicator, {
|
12714
12794
|
direction: sortDirection
|
12715
|
-
}) : null, hasMenu ? /*#__PURE__*/React__default.createElement(Menu$3, {
|
12795
|
+
}) : null, hasMenu ? ( /*#__PURE__*/React__default.createElement(Menu$3, {
|
12716
12796
|
canFreeze: canFreeze,
|
12717
12797
|
canHide: canHide,
|
12718
12798
|
canSort: canSort,
|
@@ -12728,11 +12808,11 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
|
|
12728
12808
|
scrollToIndex: scrollToIndex,
|
12729
12809
|
sortDirection: sortDirection,
|
12730
12810
|
table: table
|
12731
|
-
}) : null), hasSeparator ? /*#__PURE__*/React__default.createElement(HeaderSeparator, null) : null, !isPlaceholder && canResize ? /*#__PURE__*/React__default.createElement(Resizer, {
|
12811
|
+
})) : null)), hasSeparator ? /*#__PURE__*/React__default.createElement(HeaderSeparator, null) : null, !isPlaceholder && canResize ? /*#__PURE__*/React__default.createElement(Resizer, {
|
12732
12812
|
isResizing: isResizing,
|
12733
12813
|
onResize: handleResize
|
12734
12814
|
}) : null);
|
12735
|
-
}
|
12815
|
+
}
|
12736
12816
|
function HeaderSeparator() {
|
12737
12817
|
return /*#__PURE__*/React__default.createElement("div", {
|
12738
12818
|
"data-taco": "header-separator",
|
@@ -12853,13 +12933,13 @@ const MemoedDisplayCell = /*#__PURE__*/React__default.memo(function MemoedDispla
|
|
12853
12933
|
role: "cell",
|
12854
12934
|
// cells must be focusable (but not included in tabbing - hence -1)
|
12855
12935
|
tabIndex: -1
|
12856
|
-
}, highlighted ? /*#__PURE__*/React__default.createElement(Highlight, {
|
12936
|
+
}, highlighted ? ( /*#__PURE__*/React__default.createElement(Highlight, {
|
12857
12937
|
className: layoutClassName,
|
12858
12938
|
current: highlightedAsCurrent,
|
12859
12939
|
frozenColumnIndex: frozenColumnIndex,
|
12860
12940
|
index: index,
|
12861
12941
|
tableRef: tableRef
|
12862
|
-
}, content) : content);
|
12942
|
+
}, content)) : content);
|
12863
12943
|
});
|
12864
12944
|
|
12865
12945
|
function Footer$3(props) {
|
@@ -12901,9 +12981,9 @@ const MemoedFooter = /*#__PURE__*/React__default.memo(function MemoedFooter(prop
|
|
12901
12981
|
"data-align": align,
|
12902
12982
|
"data-column-index": index,
|
12903
12983
|
role: "columnheader"
|
12904
|
-
}, typeof meta.footer === 'function' ? /*#__PURE__*/React__default.createElement("span", {
|
12984
|
+
}, typeof meta.footer === 'function' ? ( /*#__PURE__*/React__default.createElement("span", {
|
12905
12985
|
className: "flex-grow truncate"
|
12906
|
-
}, meta.footer(table.getRowModel().rows.map(row => row.original[id]))) : null);
|
12986
|
+
}, meta.footer(table.getRowModel().rows.map(row => row.original[id])))) : null);
|
12907
12987
|
});
|
12908
12988
|
|
12909
12989
|
const FONT_SIZE = {
|
@@ -12936,7 +13016,7 @@ const MemoedCell = /*#__PURE__*/React__default.memo(function MemoedCell(props) {
|
|
12936
13016
|
actions,
|
12937
13017
|
actionsLength,
|
12938
13018
|
fontSize,
|
12939
|
-
|
13019
|
+
isActiveRow,
|
12940
13020
|
isEditing,
|
12941
13021
|
isResizingColumn,
|
12942
13022
|
isHoverStatePaused,
|
@@ -12966,7 +13046,7 @@ const MemoedCell = /*#__PURE__*/React__default.memo(function MemoedCell(props) {
|
|
12966
13046
|
let content;
|
12967
13047
|
// We don't want to show actions in edit mode, since we have editing actions,
|
12968
13048
|
// which is shown in edit mode instead.
|
12969
|
-
if (actions !== null && actions !== void 0 && actions.length && !isEditing && (
|
13049
|
+
if (actions !== null && actions !== void 0 && actions.length && !isEditing && (isActiveRow || isHovered && !isHoverStatePaused && !isResizingColumn)) {
|
12970
13050
|
const visibleActions = actions.map(action => action(row.original)).filter(action => !!action);
|
12971
13051
|
const actionsOnRow = visibleActions.length === actionsLength ? visibleActions : visibleActions.slice(0, actionsLength - 1);
|
12972
13052
|
const actionsInMenu = visibleActions.slice(visibleActions.length === actionsLength ? actionsLength : actionsLength - 1);
|
@@ -12984,23 +13064,23 @@ const MemoedCell = /*#__PURE__*/React__default.memo(function MemoedCell(props) {
|
|
12984
13064
|
return /*#__PURE__*/React__default.cloneElement(button, {
|
12985
13065
|
appearance: 'transparent',
|
12986
13066
|
key: index,
|
12987
|
-
tabIndex:
|
12988
|
-
tooltip: button.props.shortcut ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, tooltip, /*#__PURE__*/React__default.createElement(Shortcut, {
|
13067
|
+
tabIndex: isActiveRow ? 0 : -1,
|
13068
|
+
tooltip: button.props.shortcut ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, tooltip, /*#__PURE__*/React__default.createElement(Shortcut, {
|
12989
13069
|
className: "ml-2",
|
12990
13070
|
keys: button.props.shortcut
|
12991
|
-
})) : tooltip
|
13071
|
+
}))) : tooltip
|
12992
13072
|
});
|
12993
|
-
}), actionsInMenu.length ? /*#__PURE__*/React__default.createElement(IconButton, {
|
13073
|
+
}), actionsInMenu.length ? ( /*#__PURE__*/React__default.createElement(IconButton, {
|
12994
13074
|
appearance: "transparent",
|
12995
13075
|
"aria-label": texts.table3.columns.actions.tooltip,
|
12996
13076
|
icon: "more",
|
12997
|
-
tabIndex:
|
12998
|
-
menu: menuProps => /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, actionsInMenu.map((action, i) => /*#__PURE__*/React__default.createElement(Menu$1.Item, Object.assign({
|
13077
|
+
tabIndex: isActiveRow ? 0 : -1,
|
13078
|
+
menu: menuProps => ( /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, actionsInMenu.map((action, i) => ( /*#__PURE__*/React__default.createElement(Menu$1.Item, Object.assign({
|
12999
13079
|
key: i
|
13000
13080
|
}, action.props, {
|
13001
13081
|
shortcut: action.props.shortcut
|
13002
|
-
}), action.props['aria-label']))))
|
13003
|
-
}) : null);
|
13082
|
+
}), action.props['aria-label']))))))
|
13083
|
+
})) : null);
|
13004
13084
|
}
|
13005
13085
|
return /*#__PURE__*/React__default.createElement(DisplayCell, Object.assign({}, props), content);
|
13006
13086
|
});
|
@@ -13013,10 +13093,10 @@ function Cell(context) {
|
|
13013
13093
|
actions: tableMeta.rowActions.actionsForRow,
|
13014
13094
|
actionsLength: tableMeta.rowActions.actionsForRowLength,
|
13015
13095
|
fontSize: tableMeta.fontSize.size,
|
13016
|
-
|
13096
|
+
isActiveRow: tableMeta.rowActive.rowActiveIndex === rowIndex,
|
13017
13097
|
isEditing: tableMeta.editing.isEditing,
|
13018
13098
|
isResizingColumn: !!context.table.getState().columnSizingInfo.isResizingColumn,
|
13019
|
-
isHoverStatePaused: !!tableMeta.
|
13099
|
+
isHoverStatePaused: !!tableMeta.rowActive.isHoverStatePaused
|
13020
13100
|
}));
|
13021
13101
|
}
|
13022
13102
|
function createRowActionsColumn() {
|
@@ -13091,6 +13171,64 @@ function getCellValueAsString(value, dataType) {
|
|
13091
13171
|
return String(value);
|
13092
13172
|
}
|
13093
13173
|
|
13174
|
+
// settings
|
13175
|
+
var TableFontSizes;
|
13176
|
+
(function (TableFontSizes) {
|
13177
|
+
TableFontSizes["small"] = "small";
|
13178
|
+
TableFontSizes["medium"] = "medium";
|
13179
|
+
TableFontSizes["large"] = "large";
|
13180
|
+
})(TableFontSizes || (TableFontSizes = {}));
|
13181
|
+
|
13182
|
+
// column widths
|
13183
|
+
const getCellMinWidth = (fontSize = 'medium') => {
|
13184
|
+
switch (fontSize) {
|
13185
|
+
case TableFontSizes.small:
|
13186
|
+
return 57;
|
13187
|
+
case TableFontSizes.large:
|
13188
|
+
return 83;
|
13189
|
+
default:
|
13190
|
+
case TableFontSizes.medium:
|
13191
|
+
return 72;
|
13192
|
+
}
|
13193
|
+
};
|
13194
|
+
// ordering
|
13195
|
+
function ensureOrdering(columns, internalColumnsPinnedToTheRight, settingsOrder) {
|
13196
|
+
// internal columns come with a defined order
|
13197
|
+
const internalColumns = columns.filter(column => {
|
13198
|
+
var _column$id;
|
13199
|
+
return ((_column$id = column.id) === null || _column$id === void 0 ? void 0 : _column$id.startsWith('__')) && !internalColumnsPinnedToTheRight.includes(column.id);
|
13200
|
+
}).map(column => column.id);
|
13201
|
+
// columns with ordering disabled should be moved to the front
|
13202
|
+
const orderingDisabled = [];
|
13203
|
+
const orderingEnabled = [];
|
13204
|
+
let orderedColumns = columns;
|
13205
|
+
// if settings is defined, make sure the columns that are actual children are sorted by it
|
13206
|
+
if (Array.isArray(settingsOrder)) {
|
13207
|
+
orderedColumns = columns.slice().sort(
|
13208
|
+
// the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end
|
13209
|
+
(a, b) => (settingsOrder.indexOf(a.id) >>> 0) - (settingsOrder.indexOf(b.id) >>> 0));
|
13210
|
+
}
|
13211
|
+
orderedColumns.forEach(column => {
|
13212
|
+
var _column$id2, _column$meta;
|
13213
|
+
if ((_column$id2 = column.id) !== null && _column$id2 !== void 0 && _column$id2.startsWith('__')) {
|
13214
|
+
return;
|
13215
|
+
}
|
13216
|
+
if ((_column$meta = column.meta) !== null && _column$meta !== void 0 && _column$meta.enableOrdering) {
|
13217
|
+
orderingEnabled.push(column.id);
|
13218
|
+
} else {
|
13219
|
+
orderingDisabled.push(column.id);
|
13220
|
+
}
|
13221
|
+
});
|
13222
|
+
const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];
|
13223
|
+
// actions should always be last, enforce that
|
13224
|
+
internalColumnsPinnedToTheRight.forEach(id => {
|
13225
|
+
if (columns.findIndex(column => column.id === id) > -1) {
|
13226
|
+
order.push(id);
|
13227
|
+
}
|
13228
|
+
});
|
13229
|
+
return order;
|
13230
|
+
}
|
13231
|
+
|
13094
13232
|
const PRINT_MIN_COLUMN_SIZE = 20; // while printing, it accounts for minimum width each column can take
|
13095
13233
|
const getCellAlignmentClasses = (alignment = 'left') => {
|
13096
13234
|
return cn({
|
@@ -13099,18 +13237,7 @@ const getCellAlignmentClasses = (alignment = 'left') => {
|
|
13099
13237
|
'justify-center text-center': alignment === 'center'
|
13100
13238
|
});
|
13101
13239
|
};
|
13102
|
-
const getFontBasedMinColumnSize =
|
13103
|
-
// The minimum column size are based on the minimum usuable width of Datepicker
|
13104
|
-
switch (fontSize) {
|
13105
|
-
case FONT_SIZE.small:
|
13106
|
-
return 57;
|
13107
|
-
case FONT_SIZE.large:
|
13108
|
-
return 83;
|
13109
|
-
default:
|
13110
|
-
case FONT_SIZE.medium:
|
13111
|
-
return 72;
|
13112
|
-
}
|
13113
|
-
};
|
13240
|
+
const getFontBasedMinColumnSize = getCellMinWidth;
|
13114
13241
|
// Hiding input number spin buttons
|
13115
13242
|
const getInputAppearanceClassnames = () => {
|
13116
13243
|
return cn('[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none');
|
@@ -13175,62 +13302,65 @@ const useCssGrid = (table, isPrintTable = false, actionsForRowLength = 0, fontSi
|
|
13175
13302
|
};
|
13176
13303
|
};
|
13177
13304
|
|
13178
|
-
function
|
13179
|
-
const [
|
13180
|
-
|
13305
|
+
function focusFirstElementInActiveRow(tableRef) {
|
13306
|
+
const selector = '[data-taco="table2-body"] [role="row"] [role="cell"]:first-child';
|
13307
|
+
setTimeout(() => {
|
13308
|
+
var _tableRef$current, _tableRef$current$que;
|
13309
|
+
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$que = _tableRef$current.querySelector(selector)) === null || _tableRef$current$que === void 0 ? void 0 : _tableRef$current$que.focus();
|
13310
|
+
}, 1);
|
13311
|
+
}
|
13312
|
+
function useTableRowActive$1(isEnabled = false, initialRowActiveIndex) {
|
13313
|
+
const [rowActiveIndex, setRowActiveIndex] = React__default.useState(initialRowActiveIndex);
|
13314
|
+
const [isHoverStatePaused, setHoverStatePaused] = useIsHoverStatePaused();
|
13315
|
+
const move = (direction, length, scrollToIndex) => setRowActiveIndex(currentIndex => {
|
13181
13316
|
const nextIndex = currentIndex !== undefined ? getNextIndex(direction, currentIndex, length) : 0;
|
13182
13317
|
scrollToIndex(direction === -1 ? nextIndex : nextIndex + 3);
|
13183
13318
|
return nextIndex;
|
13184
13319
|
});
|
13185
|
-
const
|
13186
|
-
|
13187
|
-
const focusFirstElementInCurrentRow = tableRef => {
|
13188
|
-
setTimeout(() => {
|
13189
|
-
var _tableRef$current, _tableRef$current$que;
|
13190
|
-
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$que = _tableRef$current.querySelector('[data-taco="table2-body"] [role="row"] [role="cell"]:first-child')) === null || _tableRef$current$que === void 0 ? void 0 : _tableRef$current$que.focus();
|
13191
|
-
}, 1);
|
13192
|
-
};
|
13193
|
-
const onKeyDown = React__default.useCallback((event, length, scrollToIndex, isEditing, tableRef) => {
|
13194
|
-
if (event.defaultPrevented) {
|
13320
|
+
const onKeyDown = React__default.useCallback((event, length, scrollToIndex, tableRef) => {
|
13321
|
+
if (!isEnabled || event.defaultPrevented) {
|
13195
13322
|
return;
|
13196
13323
|
}
|
13324
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
13325
|
+
setHoverStatePaused(true);
|
13326
|
+
}
|
13197
13327
|
if (event.key === 'ArrowUp') {
|
13198
13328
|
event.preventDefault();
|
13199
13329
|
if (event.ctrlKey || event.metaKey) {
|
13200
13330
|
const newIndex = 0;
|
13201
|
-
|
13331
|
+
setRowActiveIndex(newIndex);
|
13202
13332
|
scrollToIndex(newIndex);
|
13203
13333
|
} else {
|
13204
|
-
|
13334
|
+
move(-1, length, scrollToIndex);
|
13205
13335
|
}
|
13206
|
-
if (
|
13207
|
-
|
13336
|
+
if (tableRef) {
|
13337
|
+
focusFirstElementInActiveRow(tableRef);
|
13208
13338
|
}
|
13209
13339
|
return;
|
13210
13340
|
} else if (event.key === 'ArrowDown') {
|
13211
13341
|
event.preventDefault();
|
13212
13342
|
if (event.ctrlKey || event.metaKey) {
|
13213
13343
|
const newIndex = length - 1;
|
13214
|
-
|
13344
|
+
setRowActiveIndex(newIndex);
|
13215
13345
|
scrollToIndex(newIndex);
|
13216
13346
|
} else {
|
13217
|
-
|
13347
|
+
move(+1, length, scrollToIndex);
|
13218
13348
|
}
|
13219
|
-
if (
|
13220
|
-
|
13349
|
+
if (tableRef) {
|
13350
|
+
focusFirstElementInActiveRow(tableRef);
|
13221
13351
|
}
|
13222
13352
|
return;
|
13223
13353
|
}
|
13224
|
-
}, []);
|
13354
|
+
}, [isEnabled]);
|
13225
13355
|
const onFocus = React__default.useCallback((event, length, scrollToIndex) => {
|
13226
|
-
if (event.isDefaultPrevented()) {
|
13356
|
+
if (!isEnabled || event.isDefaultPrevented()) {
|
13227
13357
|
return;
|
13228
13358
|
}
|
13229
|
-
if (
|
13359
|
+
if (rowActiveIndex === undefined && length > 0) {
|
13230
13360
|
// do it in the next tick, otherwise it prevents internal focus from working
|
13231
13361
|
// meaning you have to tab twice to get to the first focusable element
|
13232
13362
|
setTimeout(() => {
|
13233
|
-
|
13363
|
+
setRowActiveIndex(index => {
|
13234
13364
|
if (index === undefined) {
|
13235
13365
|
scrollToIndex(0);
|
13236
13366
|
return 0;
|
@@ -13239,46 +13369,32 @@ function useCurrentRow(defaultCurrentRowIndex) {
|
|
13239
13369
|
});
|
13240
13370
|
}, 1);
|
13241
13371
|
}
|
13242
|
-
}, [
|
13372
|
+
}, [rowActiveIndex, length, isEnabled]);
|
13243
13373
|
const onMouseCapture = React__default.useCallback((event, length) => {
|
13244
|
-
if (event.isDefaultPrevented()) {
|
13374
|
+
if (!isEnabled || event.isDefaultPrevented()) {
|
13245
13375
|
return;
|
13246
13376
|
}
|
13247
|
-
if (
|
13377
|
+
if (rowActiveIndex === undefined && length > 0) {
|
13248
13378
|
event.preventDefault();
|
13249
13379
|
event.stopPropagation();
|
13250
13380
|
}
|
13251
|
-
}, [
|
13381
|
+
}, [rowActiveIndex, length, isEnabled]);
|
13252
13382
|
return {
|
13253
|
-
|
13254
|
-
|
13255
|
-
|
13256
|
-
|
13257
|
-
|
13383
|
+
isEnabled,
|
13384
|
+
rowActiveIndex,
|
13385
|
+
setRowActiveIndex: isEnabled ? setRowActiveIndex : () => undefined,
|
13386
|
+
isHoverStatePaused,
|
13387
|
+
setHoverStatePaused: isEnabled ? setHoverStatePaused : () => undefined,
|
13388
|
+
handleFocus: isEnabled ? onFocus : () => undefined,
|
13389
|
+
handleKeyDown: isEnabled ? onKeyDown : () => undefined,
|
13390
|
+
handleMouseCapture: isEnabled ? onMouseCapture : () => undefined
|
13258
13391
|
};
|
13259
13392
|
}
|
13260
|
-
|
13393
|
+
function getNextIndex(direction, currentIndex, length) {
|
13261
13394
|
if (direction === -1) {
|
13262
13395
|
return currentIndex - 1 > 0 ? currentIndex - 1 : 0;
|
13263
13396
|
}
|
13264
13397
|
return currentIndex + 1 < length ? currentIndex + 1 : currentIndex;
|
13265
|
-
};
|
13266
|
-
|
13267
|
-
function usePauseHoverState() {
|
13268
|
-
const [isHoverStatePaused, setHoverStatePaused] = useIsHoverStatePaused();
|
13269
|
-
const onKeyDown = React__default.useCallback(event => {
|
13270
|
-
if (event.defaultPrevented) {
|
13271
|
-
return;
|
13272
|
-
}
|
13273
|
-
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
13274
|
-
setHoverStatePaused(true);
|
13275
|
-
}
|
13276
|
-
}, []);
|
13277
|
-
return {
|
13278
|
-
isPaused: isHoverStatePaused,
|
13279
|
-
pause: setHoverStatePaused,
|
13280
|
-
handleKeyDown: onKeyDown
|
13281
|
-
};
|
13282
13398
|
}
|
13283
13399
|
|
13284
13400
|
const DEFAULT_ALL_DISABLED = {
|
@@ -13379,22 +13495,8 @@ function useTablePreset(props) {
|
|
13379
13495
|
};
|
13380
13496
|
}
|
13381
13497
|
|
13382
|
-
function
|
13383
|
-
|
13384
|
-
case 'compact':
|
13385
|
-
return 'short';
|
13386
|
-
case 'normal':
|
13387
|
-
return 'medium';
|
13388
|
-
case 'comfortable':
|
13389
|
-
return 'tall';
|
13390
|
-
case 'spacious':
|
13391
|
-
return 'extra-tall';
|
13392
|
-
default:
|
13393
|
-
return rowHeight;
|
13394
|
-
}
|
13395
|
-
}
|
13396
|
-
function useRowHeight(isEnabled, defaultRowHeight = 'medium') {
|
13397
|
-
const [height, setHeight] = React__default.useState(convertDeprecatedRowDensityToRowHeight(defaultRowHeight));
|
13498
|
+
function useTableRowHeight(isEnabled = false, defaultRowHeight = 'medium') {
|
13499
|
+
const [height, setHeight] = React__default.useState(defaultRowHeight);
|
13398
13500
|
return {
|
13399
13501
|
isEnabled,
|
13400
13502
|
height,
|
@@ -13402,7 +13504,7 @@ function useRowHeight(isEnabled, defaultRowHeight = 'medium') {
|
|
13402
13504
|
};
|
13403
13505
|
}
|
13404
13506
|
|
13405
|
-
function
|
13507
|
+
function useTableFontSize(isEnabled = false, defaultFontSize = 'medium') {
|
13406
13508
|
const [size, setSize] = React__default.useState(defaultFontSize);
|
13407
13509
|
return {
|
13408
13510
|
isEnabled,
|
@@ -13423,11 +13525,10 @@ function useLazyEffect(effect, deps) {
|
|
13423
13525
|
}, deps);
|
13424
13526
|
}
|
13425
13527
|
|
13426
|
-
function
|
13427
|
-
const
|
13528
|
+
function useTableRowSelectionListener(table, onRowSelect) {
|
13529
|
+
const selectedRows = table.getSelectedRowModel().rows;
|
13428
13530
|
useLazyEffect(() => {
|
13429
13531
|
if (table.options.enableRowSelection && typeof onRowSelect === 'function') {
|
13430
|
-
const selectedRows = table.getSelectedRowModel().rows;
|
13431
13532
|
if (table.options.enableMultiRowSelection) {
|
13432
13533
|
onRowSelect(selectedRows.map(row => row.original));
|
13433
13534
|
} else {
|
@@ -13435,7 +13536,7 @@ function useRowSelectionListener(table, onRowSelect) {
|
|
13435
13536
|
onRowSelect((_ref = [(_selectedRows$ = selectedRows[0]) === null || _selectedRows$ === void 0 ? void 0 : _selectedRows$.original]) !== null && _ref !== void 0 ? _ref : []);
|
13436
13537
|
}
|
13437
13538
|
}
|
13438
|
-
}, [table.options.enableRowSelection,
|
13539
|
+
}, [table.options.enableRowSelection, table.options.enableMultiRowSelection, selectedRows]);
|
13439
13540
|
}
|
13440
13541
|
|
13441
13542
|
function useRowDrag(isEnabled) {
|
@@ -13450,52 +13551,6 @@ function useRowDrag(isEnabled) {
|
|
13450
13551
|
function useSettingsStateListener(table, onChangeSettings) {
|
13451
13552
|
const meta = table.options.meta;
|
13452
13553
|
const state = table.getState();
|
13453
|
-
const prevFontSize = React__default.useRef(meta.fontSize.size);
|
13454
|
-
React__default.useEffect(() => {
|
13455
|
-
const newFontSize = meta.fontSize.size;
|
13456
|
-
const oldFontSize = prevFontSize.current;
|
13457
|
-
const {
|
13458
|
-
small,
|
13459
|
-
medium,
|
13460
|
-
large
|
13461
|
-
} = FONT_SIZE;
|
13462
|
-
let columnSizeChange = 0;
|
13463
|
-
switch (`${oldFontSize}-${newFontSize}`) {
|
13464
|
-
case `${small}-${medium}`:
|
13465
|
-
columnSizeChange = 8;
|
13466
|
-
break;
|
13467
|
-
case `${small}-${large}`:
|
13468
|
-
columnSizeChange = 16;
|
13469
|
-
break;
|
13470
|
-
case `${medium}-${small}`:
|
13471
|
-
columnSizeChange = -8;
|
13472
|
-
break;
|
13473
|
-
case `${medium}-${large}`:
|
13474
|
-
columnSizeChange = 8;
|
13475
|
-
break;
|
13476
|
-
case `${large}-${small}`:
|
13477
|
-
columnSizeChange = -16;
|
13478
|
-
break;
|
13479
|
-
case `${large}-${medium}`:
|
13480
|
-
columnSizeChange = -8;
|
13481
|
-
break;
|
13482
|
-
default:
|
13483
|
-
columnSizeChange = 0;
|
13484
|
-
break;
|
13485
|
-
}
|
13486
|
-
prevFontSize.current = newFontSize;
|
13487
|
-
if (columnSizeChange === 0) {
|
13488
|
-
return;
|
13489
|
-
}
|
13490
|
-
table.setColumnSizing(sizes => {
|
13491
|
-
const minColumnSize = getFontBasedMinColumnSize(newFontSize);
|
13492
|
-
return Object.fromEntries(Object.entries(sizes).map(([columnName, prevColumnSize]) => {
|
13493
|
-
// Prevents width value in the setting to go below the minColumnSize
|
13494
|
-
const newSize = Math.max(minColumnSize, prevColumnSize + columnSizeChange);
|
13495
|
-
return [columnName, newSize];
|
13496
|
-
}));
|
13497
|
-
});
|
13498
|
-
}, [meta.fontSize.size]);
|
13499
13554
|
React__default.useEffect(() => {
|
13500
13555
|
let handler;
|
13501
13556
|
if (typeof onChangeSettings === 'function') {
|
@@ -13504,7 +13559,7 @@ function useSettingsStateListener(table, onChangeSettings) {
|
|
13504
13559
|
}, 250);
|
13505
13560
|
}
|
13506
13561
|
return () => clearTimeout(handler);
|
13507
|
-
}, [meta.columnFreezing.frozenColumnIndex, state.columnOrder, state.columnSizing, state.columnVisibility, meta.search.excludeUnmatchedResults, meta.fontSize.size, meta.rowHeight.height, meta.printing.
|
13562
|
+
}, [meta.columnFreezing.frozenColumnIndex, state.columnOrder, state.columnSizing, state.columnVisibility, meta.search.excludeUnmatchedResults, meta.fontSize.size, meta.rowHeight.height, meta.printing.isWarningVisibleForLargeDatasets, state.sorting]);
|
13508
13563
|
}
|
13509
13564
|
|
13510
13565
|
var Table3FilterComparator;
|
@@ -13642,12 +13697,14 @@ function columnFilterFn(value, filter) {
|
|
13642
13697
|
// we use a listener, and not the internal "controlled" change handlers because we don't actually want consumers
|
13643
13698
|
// to control the state outside the table. this listener is really here to let the consumer make a server request
|
13644
13699
|
// and provide the server with the sorting state, so that it can sort server side
|
13645
|
-
function
|
13700
|
+
function useTableSortingListener$1(table, onSort) {
|
13646
13701
|
const sorting = table.getState().sorting;
|
13647
13702
|
useLazyEffect(() => {
|
13648
|
-
table.resetRowSelection();
|
13649
13703
|
if (table.options.enableSorting && typeof onSort === 'function') {
|
13650
13704
|
onSort(sorting);
|
13705
|
+
if (table.options.enableRowSelection) {
|
13706
|
+
table.resetRowSelection();
|
13707
|
+
}
|
13651
13708
|
}
|
13652
13709
|
}, [table.options.enableSorting, sorting]);
|
13653
13710
|
}
|
@@ -13655,7 +13712,7 @@ function useSortingStateListener(table, onSort) {
|
|
13655
13712
|
// we use a listener, and not the internal "controlled" change handlers because we don't actually want consumers
|
13656
13713
|
// to control the state outside the table. this listener is really here to let the consumer make a server request
|
13657
13714
|
// and provide the server with the filtering state, so that it can filter server side
|
13658
|
-
function
|
13715
|
+
function useTableFilterListener(table, onFilter) {
|
13659
13716
|
const columnFilters = table.getState().columnFilters;
|
13660
13717
|
useLazyEffect(() => {
|
13661
13718
|
if (table.options.enableColumnFilters && typeof onFilter === 'function') {
|
@@ -13667,13 +13724,13 @@ function useFilteringStateListener(table, onFilter) {
|
|
13667
13724
|
}, [table.options.enableColumnFilters, columnFilters]);
|
13668
13725
|
}
|
13669
13726
|
|
13670
|
-
function
|
13727
|
+
function useTableDataListener(table) {
|
13671
13728
|
const meta = table.options.meta;
|
13672
13729
|
const rows = table.getRowModel().rows;
|
13673
|
-
|
13674
|
-
const
|
13675
|
-
if (
|
13676
|
-
meta.
|
13730
|
+
useLazyEffect(() => {
|
13731
|
+
const rowActiveIndex = meta.rowActive.rowActiveIndex;
|
13732
|
+
if (rowActiveIndex !== undefined && rowActiveIndex > rows.length) {
|
13733
|
+
meta.rowActive.setRowActiveIndex(0);
|
13677
13734
|
}
|
13678
13735
|
}, [rows.length]);
|
13679
13736
|
}
|
@@ -13774,20 +13831,20 @@ function useColumnFreezingStyle(tableId, table) {
|
|
13774
13831
|
return style;
|
13775
13832
|
}
|
13776
13833
|
|
13777
|
-
function
|
13834
|
+
function useTableRowSelection(isEnabled = false) {
|
13778
13835
|
const lastSelectedRowIndex = React__default.useRef();
|
13779
13836
|
const onKeyDown = React__default.useCallback((event, table) => {
|
13780
|
-
if (!table.options.enableRowSelection || event.defaultPrevented) {
|
13837
|
+
if (!isEnabled || !table.options.enableRowSelection || event.defaultPrevented) {
|
13781
13838
|
return;
|
13782
13839
|
}
|
13783
13840
|
const rows = table.getRowModel().rows;
|
13784
13841
|
const tableMeta = table.options.meta;
|
13785
13842
|
if (event.key === ' ') {
|
13786
13843
|
event.preventDefault();
|
13787
|
-
const
|
13788
|
-
if (
|
13789
|
-
var _rows$
|
13790
|
-
(_rows$
|
13844
|
+
const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;
|
13845
|
+
if (rowActiveIndex !== undefined) {
|
13846
|
+
var _rows$rowActiveIndex;
|
13847
|
+
(_rows$rowActiveIndex = rows[rowActiveIndex]) === null || _rows$rowActiveIndex === void 0 ? void 0 : _rows$rowActiveIndex.toggleSelected();
|
13791
13848
|
}
|
13792
13849
|
return;
|
13793
13850
|
} else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {
|
@@ -13795,34 +13852,127 @@ function useRowSelection() {
|
|
13795
13852
|
table.toggleAllRowsSelected();
|
13796
13853
|
return;
|
13797
13854
|
}
|
13798
|
-
}, []);
|
13855
|
+
}, [isEnabled]);
|
13799
13856
|
return {
|
13800
|
-
handleKeyDown: onKeyDown,
|
13857
|
+
handleKeyDown: isEnabled ? onKeyDown : () => undefined,
|
13801
13858
|
lastSelectedRowIndex
|
13802
13859
|
};
|
13803
13860
|
}
|
13804
13861
|
|
13805
|
-
function
|
13806
|
-
const
|
13807
|
-
|
13862
|
+
function useTableServerLoading(loadPage, loadAll) {
|
13863
|
+
const isEnabled = !!loadPage && !!loadAll;
|
13864
|
+
return {
|
13865
|
+
isEnabled,
|
13866
|
+
loadPage,
|
13867
|
+
loadAll
|
13868
|
+
};
|
13869
|
+
}
|
13870
|
+
|
13871
|
+
function useTableRowClick(isEnabled = false, onRowClick) {
|
13872
|
+
const handleKeyDown = React__default.useCallback(function (event, data) {
|
13873
|
+
if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {
|
13808
13874
|
return;
|
13809
13875
|
}
|
13810
|
-
|
13811
|
-
const tableMeta = table.options.meta;
|
13812
|
-
if (event.key === 'Enter') {
|
13876
|
+
if (data && event.key === 'Enter') {
|
13813
13877
|
event.preventDefault();
|
13814
|
-
|
13815
|
-
|
13816
|
-
|
13878
|
+
onRowClick(data);
|
13879
|
+
return;
|
13880
|
+
}
|
13881
|
+
}, [isEnabled, onRowClick]);
|
13882
|
+
const handleClick = React__default.useCallback(function (event, data) {
|
13883
|
+
if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {
|
13817
13884
|
return;
|
13818
13885
|
}
|
13819
|
-
|
13886
|
+
event.preventDefault();
|
13887
|
+
onRowClick(data);
|
13888
|
+
return;
|
13889
|
+
}, [isEnabled, onRowClick]);
|
13890
|
+
return {
|
13891
|
+
isEnabled,
|
13892
|
+
handleClick,
|
13893
|
+
handleKeyDown
|
13894
|
+
};
|
13895
|
+
}
|
13896
|
+
|
13897
|
+
function useTableColumnOrdering(isEnabled = true) {
|
13898
|
+
return {
|
13899
|
+
isEnabled
|
13900
|
+
};
|
13901
|
+
}
|
13902
|
+
|
13903
|
+
function useRowDrop(isEnabled, handler) {
|
13820
13904
|
return {
|
13821
|
-
|
13822
|
-
|
13905
|
+
isEnabled,
|
13906
|
+
handleDrop: isEnabled && handler ? handler : () => undefined
|
13823
13907
|
};
|
13824
13908
|
}
|
13825
13909
|
|
13910
|
+
var IndicatorReason;
|
13911
|
+
(function (IndicatorReason) {
|
13912
|
+
IndicatorReason["SEARCH"] = "SEARCH";
|
13913
|
+
IndicatorReason["SORTING"] = "SORTING";
|
13914
|
+
IndicatorReason["FILTER"] = "FILTER";
|
13915
|
+
})(IndicatorReason || (IndicatorReason = {}));
|
13916
|
+
const useIndicatorText = reason => {
|
13917
|
+
let title = '';
|
13918
|
+
let description = '';
|
13919
|
+
const {
|
13920
|
+
texts
|
13921
|
+
} = useLocalization();
|
13922
|
+
switch (reason) {
|
13923
|
+
case IndicatorReason.FILTER:
|
13924
|
+
title = texts.table3.editing.rowIndicator.rowWillBeHidden;
|
13925
|
+
description = texts.table3.editing.rowIndicator.rowWillMoveReasonFilter;
|
13926
|
+
break;
|
13927
|
+
case IndicatorReason.SEARCH:
|
13928
|
+
title = texts.table3.editing.rowIndicator.rowWillBeHidden;
|
13929
|
+
description = texts.table3.editing.rowIndicator.rowWillMoveReasonSearch;
|
13930
|
+
break;
|
13931
|
+
case IndicatorReason.SORTING:
|
13932
|
+
title = texts.table3.editing.rowIndicator.rowWillMove;
|
13933
|
+
description = texts.table3.editing.rowIndicator.rowWillMoveReasonSorting;
|
13934
|
+
break;
|
13935
|
+
}
|
13936
|
+
return {
|
13937
|
+
title,
|
13938
|
+
description
|
13939
|
+
};
|
13940
|
+
};
|
13941
|
+
const Indicator = ({
|
13942
|
+
reason,
|
13943
|
+
columnName,
|
13944
|
+
mountNode,
|
13945
|
+
validationErrors
|
13946
|
+
}) => {
|
13947
|
+
const container = React__default.useMemo(() => {
|
13948
|
+
const element = document.createElement('div');
|
13949
|
+
element.className += 'rounded-b-md items-center wcag-blue-500 absolute left-0 top-full ml-1 whitespace-nowrap px-1 py-0.5 text-xs font-bold shadow-sm';
|
13950
|
+
return element;
|
13951
|
+
}, []);
|
13952
|
+
const indicatorText = useIndicatorText(reason);
|
13953
|
+
const hasValidationErrorsInRow = !!validationErrors;
|
13954
|
+
React__default.useEffect(() => {
|
13955
|
+
// mountNode could be null when rows are filtered
|
13956
|
+
// Pinned columns has z-20 class assigned, which overlaps indicator element, need to add z-21 to overlap pinned columns.
|
13957
|
+
mountNode === null || mountNode === void 0 ? void 0 : mountNode.classList.add('!z-[21]', 'relative');
|
13958
|
+
mountNode === null || mountNode === void 0 ? void 0 : mountNode.appendChild(container);
|
13959
|
+
return () => {
|
13960
|
+
mountNode === null || mountNode === void 0 ? void 0 : mountNode.classList.remove('!z-[21]', 'relative');
|
13961
|
+
mountNode === null || mountNode === void 0 ? void 0 : mountNode.removeChild(container);
|
13962
|
+
};
|
13963
|
+
}, [hasValidationErrorsInRow, mountNode]);
|
13964
|
+
// Using react portal inside a react tree component is an unorthodox way, but in order to avoid much code refactoring
|
13965
|
+
// and being able to use Taco Tooltip component in side the visual indicator, portal is used.
|
13966
|
+
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(Tooltip, {
|
13967
|
+
title: indicatorText.description.replace('[COLUMN]', columnName)
|
13968
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
13969
|
+
className: "flex gap-1 hover:cursor-pointer"
|
13970
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
13971
|
+
name: "info",
|
13972
|
+
className: "!h-4 !w-4 rounded-full bg-white !p-0 text-blue-500"
|
13973
|
+
}), indicatorText.title)), container);
|
13974
|
+
};
|
13975
|
+
|
13826
13976
|
const focussableNodeNames = ['A', 'BUTTON', 'INPUT', 'TEXTAREA', 'SELECT', 'DETAILS'];
|
13827
13977
|
const focusableSelector = /*#__PURE__*/focussableNodeNames.join(', ');
|
13828
13978
|
const hasChanged = (value, newValue) => {
|
@@ -13888,7 +14038,7 @@ function Row$1(props) {
|
|
13888
14038
|
var _tableMeta$validation, _tableMeta$validation2;
|
13889
14039
|
const focusManager = focus.useFocusManager();
|
13890
14040
|
const tableMeta = props.table.options.meta;
|
13891
|
-
const
|
14041
|
+
const isActiveRow = tableMeta.rowActive.rowActiveIndex === props.index;
|
13892
14042
|
const isDraggingRow = tableMeta.rowDrag.dragging[props.row.id];
|
13893
14043
|
const isFirstRow = props.index === 0;
|
13894
14044
|
// we use non-css hovered state to determine whether to render actions or not, for performance
|
@@ -13899,7 +14049,7 @@ function Row$1(props) {
|
|
13899
14049
|
return;
|
13900
14050
|
}
|
13901
14051
|
if (event.key === 'Tab') {
|
13902
|
-
tableMeta.
|
14052
|
+
tableMeta.rowActive.setHoverStatePaused(true);
|
13903
14053
|
let focusedElement;
|
13904
14054
|
if (event.shiftKey) {
|
13905
14055
|
// looping backwards
|
@@ -13911,7 +14061,7 @@ function Row$1(props) {
|
|
13911
14061
|
// there are no previous elements to focus, go up a row or go outside the table
|
13912
14062
|
if (!isFirstRow) {
|
13913
14063
|
event.preventDefault();
|
13914
|
-
tableMeta.
|
14064
|
+
tableMeta.rowActive.setRowActiveIndex(props.index - 1);
|
13915
14065
|
setTimeout(() => focusManager.focusLast(FOCUS_MANAGER_OPTIONS), 1);
|
13916
14066
|
}
|
13917
14067
|
}
|
@@ -13925,7 +14075,7 @@ function Row$1(props) {
|
|
13925
14075
|
// there are no next elements to focus, go down a row or go outside the table
|
13926
14076
|
if (!props.isLastRow) {
|
13927
14077
|
event.preventDefault();
|
13928
|
-
tableMeta.
|
14078
|
+
tableMeta.rowActive.setRowActiveIndex(props.index + 1);
|
13929
14079
|
setTimeout(() => focusManager.focusFirst(FOCUS_MANAGER_OPTIONS), 1);
|
13930
14080
|
}
|
13931
14081
|
}
|
@@ -13936,22 +14086,24 @@ function Row$1(props) {
|
|
13936
14086
|
// rows are heavily memoized because performance in our table is critical
|
13937
14087
|
// be careful and selective about props that you pass to the row
|
13938
14088
|
const memoedProps = {
|
14089
|
+
data: props.row.original,
|
13939
14090
|
// aria-grabbed is being deprecated but there is no current alternative api, we use it until there is
|
13940
14091
|
'aria-grabbed': isDraggingRow ? true : tableMeta.rowDrag.isEnabled ? false : undefined,
|
13941
|
-
'data-current':
|
14092
|
+
'data-current': isActiveRow,
|
13942
14093
|
'data-selected': props.row.getIsSelected(),
|
13943
14094
|
'data-invalid': hasError,
|
13944
14095
|
draggable: tableMeta.rowDrag.isEnabled,
|
13945
14096
|
index: props.index,
|
13946
14097
|
onClick: tableMeta.rowClick.handleClick,
|
13947
|
-
onDrop: tableMeta.rowDrop.isEnabled ? tableMeta.rowDrop.handleDrop : undefined
|
13948
|
-
onKeyDown: handleKeyDown
|
14098
|
+
onDrop: tableMeta.rowDrop.isEnabled ? tableMeta.rowDrop.handleDrop : undefined
|
13949
14099
|
};
|
13950
|
-
let output = /*#__PURE__*/React__default.createElement(MemoedRow, Object.assign({}, props, memoedProps
|
13951
|
-
|
14100
|
+
let output = /*#__PURE__*/React__default.createElement(MemoedRow, Object.assign({}, props, memoedProps, {
|
14101
|
+
onKeyDown: handleKeyDown
|
14102
|
+
}));
|
14103
|
+
if (tableMeta.editing.isEditing && (isActiveRow || isHovered && !tableMeta.rowActive.isHoverStatePaused)) {
|
13952
14104
|
output = /*#__PURE__*/React__default.createElement(EditingRow, Object.assign({}, props, memoedProps, {
|
13953
14105
|
isFirstRow: isFirstRow,
|
13954
|
-
|
14106
|
+
setActiveRowIndex: tableMeta.rowActive.setRowActiveIndex
|
13955
14107
|
}));
|
13956
14108
|
}
|
13957
14109
|
// we store the row index in context because in a virtualised table the row index and the
|
@@ -13987,7 +14139,7 @@ function EditingRow(props) {
|
|
13987
14139
|
isFirstRow,
|
13988
14140
|
isLastRow,
|
13989
14141
|
onKeyDown,
|
13990
|
-
|
14142
|
+
setActiveRowIndex,
|
13991
14143
|
virtualiser,
|
13992
14144
|
...attributes
|
13993
14145
|
} = props;
|
@@ -13996,14 +14148,14 @@ function EditingRow(props) {
|
|
13996
14148
|
const handleClickCapture = event => {
|
13997
14149
|
lastCellIndex.value = getColumnIndex(event.target);
|
13998
14150
|
};
|
13999
|
-
const
|
14151
|
+
const handleNavigationBackwards = event => {
|
14000
14152
|
let focusedElement;
|
14001
|
-
if (event.key === 'ArrowLeft') {
|
14153
|
+
if (event.key === 'ArrowLeft' || event.key === 'Tab' && event.shiftKey) {
|
14002
14154
|
// We need to perform special behaviour when focus reaches the end of the row,
|
14003
14155
|
// so we don't need default browser behaviour.
|
14004
14156
|
event.stopPropagation();
|
14005
14157
|
event.preventDefault();
|
14006
|
-
tableMeta.
|
14158
|
+
tableMeta.rowActive.setHoverStatePaused(true);
|
14007
14159
|
// "CTRL + ArrowLeft" or "META + ArrowLeft" should focus first focusable element of the row
|
14008
14160
|
if (event.ctrlKey || event.metaKey) {
|
14009
14161
|
event.target.blur();
|
@@ -14018,8 +14170,8 @@ function EditingRow(props) {
|
|
14018
14170
|
// there are no previous elements to focus, go up a row (if there are rows above)
|
14019
14171
|
if (!isFirstRow || !event.currentTarget.contains(focusedElement)) {
|
14020
14172
|
event.preventDefault();
|
14021
|
-
tableMeta.
|
14022
|
-
tableMeta.
|
14173
|
+
tableMeta.rowActive.setHoverStatePaused(true);
|
14174
|
+
tableMeta.rowActive.setRowActiveIndex(props.index - 1);
|
14023
14175
|
setTimeout(() => {
|
14024
14176
|
focusedElement = focusManager.focusLast(FOCUS_MANAGER_OPTIONS);
|
14025
14177
|
// Need to update lastIndex when row got changed and last element got selected.
|
@@ -14030,14 +14182,14 @@ function EditingRow(props) {
|
|
14030
14182
|
}
|
14031
14183
|
}
|
14032
14184
|
};
|
14033
|
-
const
|
14185
|
+
const handleNavigationForward = event => {
|
14034
14186
|
let focusedElement;
|
14035
|
-
if (event.key === 'ArrowRight') {
|
14187
|
+
if (event.key === 'ArrowRight' || event.key === 'Tab' && !event.shiftKey) {
|
14036
14188
|
// We need to perform special behaviour when focus reaches the end of the row,
|
14037
14189
|
// so we don't need default browser behaviour.
|
14038
14190
|
event.stopPropagation();
|
14039
14191
|
event.preventDefault();
|
14040
|
-
tableMeta.
|
14192
|
+
tableMeta.rowActive.setHoverStatePaused(true);
|
14041
14193
|
// "CTRL + ArrowRight" or "META + ArrowRight" should focus last focusable element of the row
|
14042
14194
|
if (event.ctrlKey || event.metaKey) {
|
14043
14195
|
event.target.blur();
|
@@ -14052,8 +14204,8 @@ function EditingRow(props) {
|
|
14052
14204
|
// there are no next elements to focus, go down a row or go outside the table
|
14053
14205
|
if (!props.isLastRow && !event.currentTarget.contains(focusedElement)) {
|
14054
14206
|
event.preventDefault();
|
14055
|
-
tableMeta.
|
14056
|
-
tableMeta.
|
14207
|
+
tableMeta.rowActive.setHoverStatePaused(true);
|
14208
|
+
tableMeta.rowActive.setRowActiveIndex(props.index + 1);
|
14057
14209
|
setTimeout(() => {
|
14058
14210
|
focusedElement = focusManager.focusFirst(FOCUS_MANAGER_OPTIONS);
|
14059
14211
|
// Need to update lastIndex when row got changed and last element got selected.
|
@@ -14066,22 +14218,21 @@ function EditingRow(props) {
|
|
14066
14218
|
};
|
14067
14219
|
React__default.useEffect(() => {
|
14068
14220
|
// if some row stuck in hovered state, we heed to unhover it when hover state is paused
|
14069
|
-
if (tableMeta.
|
14221
|
+
if (tableMeta.rowActive.isHoverStatePaused) {
|
14070
14222
|
unhoverPreviousRow(props.tableRef);
|
14071
14223
|
}
|
14072
|
-
}, [tableMeta.
|
14224
|
+
}, [tableMeta.rowActive.isHoverStatePaused]);
|
14073
14225
|
const handleKeyDown = event => {
|
14074
14226
|
if (event.isDefaultPrevented() || event.isPropagationStopped() || tableMeta.editing.detailModeEditing || tableMeta.shortcutsState.isPaused) {
|
14075
14227
|
return;
|
14076
14228
|
}
|
14077
|
-
|
14078
|
-
|
14079
|
-
handleArrowRightKey(event);
|
14229
|
+
handleNavigationBackwards(event);
|
14230
|
+
handleNavigationForward(event);
|
14080
14231
|
};
|
14081
14232
|
// this ensures we focus either on a field or on the same column when keyboard navigating up/down
|
14082
14233
|
React__default.useEffect(() => {
|
14083
14234
|
// When table in searching state, whe should prevent editing control to be focused, because it will cause search field to loose focus.
|
14084
|
-
if (tableMeta.
|
14235
|
+
if (tableMeta.rowActive.rowActiveIndex === props.index && !tableMeta.search.isSearching) {
|
14085
14236
|
if (lastCellIndex.value !== null) {
|
14086
14237
|
var _props$tableRef$curre;
|
14087
14238
|
const lastCellElement = (_props$tableRef$curre = props.tableRef.current) === null || _props$tableRef$curre === void 0 ? void 0 : _props$tableRef$curre.querySelector(`[role="row"][data-current="true"] [data-column-index="${lastCellIndex.value}"]`);
|
@@ -14101,7 +14252,7 @@ function EditingRow(props) {
|
|
14101
14252
|
// Need to subscribe to current row index and check is it a current row,
|
14102
14253
|
// for a situation where hovered row is the next row after current row...
|
14103
14254
|
// In this case row will not be re-rendered if user switch to next row, because hovered row also renders EditingRow.
|
14104
|
-
}, [tableMeta.
|
14255
|
+
}, [tableMeta.rowActive.rowActiveIndex, tableMeta.search.isSearching]);
|
14105
14256
|
return /*#__PURE__*/React__default.createElement(MemoedRow, Object.assign({}, attributes, {
|
14106
14257
|
onClickCapture: handleClickCapture,
|
14107
14258
|
onKeyDown: handleKeyDown
|
@@ -14110,6 +14261,7 @@ function EditingRow(props) {
|
|
14110
14261
|
const clickableElements = ['input', 'button', 'a', 'select', 'option', 'label', 'textarea'];
|
14111
14262
|
const MemoedRow = /*#__PURE__*/React__default.memo(function MemoedRow(props) {
|
14112
14263
|
const {
|
14264
|
+
data,
|
14113
14265
|
index,
|
14114
14266
|
isLastRow: _1,
|
14115
14267
|
measureRef,
|
@@ -14140,7 +14292,7 @@ const MemoedRow = /*#__PURE__*/React__default.memo(function MemoedRow(props) {
|
|
14140
14292
|
onClickCapture(event);
|
14141
14293
|
}
|
14142
14294
|
// do this in the next frame, otherwise it remounts the row and prevents row actions on hover from being clickable
|
14143
|
-
requestAnimationFrame(() => tableMeta.
|
14295
|
+
requestAnimationFrame(() => tableMeta.rowActive.setRowActiveIndex(index));
|
14144
14296
|
};
|
14145
14297
|
const handleClick = event => {
|
14146
14298
|
if (typeof onClick === 'function') {
|
@@ -14149,7 +14301,7 @@ const MemoedRow = /*#__PURE__*/React__default.memo(function MemoedRow(props) {
|
|
14149
14301
|
if (!((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.contains(event.target)) || clickableElements.includes(clickedElement.tagName.toLowerCase()) || clickedElement.closest(clickableElements.map(tag => `[role=row] ${tag}`).join(','))) {
|
14150
14302
|
return;
|
14151
14303
|
}
|
14152
|
-
onClick(
|
14304
|
+
onClick(event, data);
|
14153
14305
|
}
|
14154
14306
|
};
|
14155
14307
|
const handleMouseEnter = () => {
|
@@ -14476,7 +14628,7 @@ const MemoedCell$1 = /*#__PURE__*/React__default.memo(function MemoedCell(props)
|
|
14476
14628
|
var _column$columnDef$met;
|
14477
14629
|
const {
|
14478
14630
|
hasChanges,
|
14479
|
-
|
14631
|
+
isActiveRow,
|
14480
14632
|
row,
|
14481
14633
|
editing,
|
14482
14634
|
rowIdentifier,
|
@@ -14525,13 +14677,13 @@ const MemoedCell$1 = /*#__PURE__*/React__default.memo(function MemoedCell(props)
|
|
14525
14677
|
}));
|
14526
14678
|
}
|
14527
14679
|
}
|
14528
|
-
if (editing.isEditing &&
|
14680
|
+
if (editing.isEditing && isActiveRow) {
|
14529
14681
|
content = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, content, /*#__PURE__*/React__default.createElement(IconButton, {
|
14530
14682
|
ref: edititngActionsRef,
|
14531
14683
|
appearance: "transparent",
|
14532
14684
|
"aria-label": texts.table3.editing.actions.tooltip,
|
14533
14685
|
icon: "more",
|
14534
|
-
menu: menuProps => /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
14686
|
+
menu: menuProps => ( /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
14535
14687
|
icon: "tick",
|
14536
14688
|
disabled: !hasChanges,
|
14537
14689
|
onClick: () => editing.saveChangesIfNeeded()
|
@@ -14542,8 +14694,8 @@ const MemoedCell$1 = /*#__PURE__*/React__default.memo(function MemoedCell(props)
|
|
14542
14694
|
}, texts.table3.editing.actions.clear), /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
14543
14695
|
icon: "undo",
|
14544
14696
|
onClick: () => editing.toggleEditing(false)
|
14545
|
-
}, texts.table3.editing.actions.exit))),
|
14546
|
-
tabIndex:
|
14697
|
+
}, texts.table3.editing.actions.exit)))),
|
14698
|
+
tabIndex: isActiveRow ? 0 : -1
|
14547
14699
|
}), /*#__PURE__*/React__default.createElement(Dialog, {
|
14548
14700
|
size: "xs",
|
14549
14701
|
open: clearConfirmationOpen,
|
@@ -14569,7 +14721,7 @@ const MemoedCell$1 = /*#__PURE__*/React__default.memo(function MemoedCell(props)
|
|
14569
14721
|
}, texts.table3.editing.clearChangesConfirmationDialog.confirm)))))));
|
14570
14722
|
}
|
14571
14723
|
const contentClassName = cn('flex items-center justify-end text-right', {
|
14572
|
-
'-mb-2 -mt-2':
|
14724
|
+
'-mb-2 -mt-2': isActiveRow
|
14573
14725
|
});
|
14574
14726
|
return /*#__PURE__*/React__default.createElement(DisplayCell, Object.assign({}, props, {
|
14575
14727
|
className: cn({
|
@@ -14587,7 +14739,7 @@ function Cell$1(props) {
|
|
14587
14739
|
const changeset = tableMeta.editing.changes ? Object.keys(tableMeta.editing.changes) : [];
|
14588
14740
|
return /*#__PURE__*/React__default.createElement(MemoedCell$1, Object.assign({}, props, {
|
14589
14741
|
hasChanges: changeset.indexOf(props.row.id) >= 0,
|
14590
|
-
|
14742
|
+
isActiveRow: tableMeta.rowActive.rowActiveIndex === rowIndex,
|
14591
14743
|
editing: tableMeta.editing
|
14592
14744
|
}));
|
14593
14745
|
}
|
@@ -14616,119 +14768,6 @@ function createRowEditingActionsColumn(rowIdentifier) {
|
|
14616
14768
|
};
|
14617
14769
|
}
|
14618
14770
|
|
14619
|
-
function useColumnOrdering(options) {
|
14620
|
-
return {
|
14621
|
-
isEnabled: options.enableColumnOrdering
|
14622
|
-
};
|
14623
|
-
}
|
14624
|
-
function ensureOrdering(columns, settingsOrder) {
|
14625
|
-
// internal column come with a defined order
|
14626
|
-
const internalColumns = columns.filter(column => {
|
14627
|
-
var _column$id;
|
14628
|
-
return ((_column$id = column.id) === null || _column$id === void 0 ? void 0 : _column$id.startsWith('__')) && column.id !== COLUMN_ID && column.id !== COLUMN_ID$1;
|
14629
|
-
}).map(column => column.id);
|
14630
|
-
// columns with ordering disabled should be moved to the front
|
14631
|
-
const orderingDisabled = [];
|
14632
|
-
const orderingEnabled = [];
|
14633
|
-
let orderedColumns = columns;
|
14634
|
-
// if settings is defined, make sure the columns that are actual children are sorted by it
|
14635
|
-
if (Array.isArray(settingsOrder)) {
|
14636
|
-
orderedColumns = columns.slice().sort(
|
14637
|
-
// the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end
|
14638
|
-
(a, b) => (settingsOrder.indexOf(a.id) >>> 0) - (settingsOrder.indexOf(b.id) >>> 0));
|
14639
|
-
}
|
14640
|
-
orderedColumns.forEach(column => {
|
14641
|
-
var _column$id2, _column$meta;
|
14642
|
-
if ((_column$id2 = column.id) !== null && _column$id2 !== void 0 && _column$id2.startsWith('__')) {
|
14643
|
-
return;
|
14644
|
-
}
|
14645
|
-
if ((_column$meta = column.meta) !== null && _column$meta !== void 0 && _column$meta.enableOrdering) {
|
14646
|
-
orderingEnabled.push(column.id);
|
14647
|
-
} else {
|
14648
|
-
orderingDisabled.push(column.id);
|
14649
|
-
}
|
14650
|
-
});
|
14651
|
-
const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];
|
14652
|
-
// actions should always be last, enforce that
|
14653
|
-
if (columns.findIndex(column => column.id === COLUMN_ID || column.id === COLUMN_ID$1) > -1) {
|
14654
|
-
order.push(COLUMN_ID);
|
14655
|
-
}
|
14656
|
-
return order;
|
14657
|
-
}
|
14658
|
-
|
14659
|
-
function useRowDrop(isEnabled, handler) {
|
14660
|
-
return {
|
14661
|
-
isEnabled,
|
14662
|
-
handleDrop: isEnabled && handler ? handler : () => undefined
|
14663
|
-
};
|
14664
|
-
}
|
14665
|
-
|
14666
|
-
var IndicatorReason;
|
14667
|
-
(function (IndicatorReason) {
|
14668
|
-
IndicatorReason["SEARCH"] = "SEARCH";
|
14669
|
-
IndicatorReason["SORTING"] = "SORTING";
|
14670
|
-
IndicatorReason["FILTER"] = "FILTER";
|
14671
|
-
})(IndicatorReason || (IndicatorReason = {}));
|
14672
|
-
const useIndicatorText = reason => {
|
14673
|
-
let title = '';
|
14674
|
-
let description = '';
|
14675
|
-
const {
|
14676
|
-
texts
|
14677
|
-
} = useLocalization();
|
14678
|
-
switch (reason) {
|
14679
|
-
case IndicatorReason.FILTER:
|
14680
|
-
title = texts.table3.editing.rowIndicator.rowWillBeHidden;
|
14681
|
-
description = texts.table3.editing.rowIndicator.rowWillMoveReasonFilter;
|
14682
|
-
break;
|
14683
|
-
case IndicatorReason.SEARCH:
|
14684
|
-
title = texts.table3.editing.rowIndicator.rowWillBeHidden;
|
14685
|
-
description = texts.table3.editing.rowIndicator.rowWillMoveReasonSearch;
|
14686
|
-
break;
|
14687
|
-
case IndicatorReason.SORTING:
|
14688
|
-
title = texts.table3.editing.rowIndicator.rowWillMove;
|
14689
|
-
description = texts.table3.editing.rowIndicator.rowWillMoveReasonSorting;
|
14690
|
-
break;
|
14691
|
-
}
|
14692
|
-
return {
|
14693
|
-
title,
|
14694
|
-
description
|
14695
|
-
};
|
14696
|
-
};
|
14697
|
-
const Indicator = ({
|
14698
|
-
reason,
|
14699
|
-
columnName,
|
14700
|
-
mountNode,
|
14701
|
-
validationErrors
|
14702
|
-
}) => {
|
14703
|
-
const container = React__default.useMemo(() => {
|
14704
|
-
const element = document.createElement('div');
|
14705
|
-
element.className += 'rounded-b-md items-center wcag-blue-500 absolute left-0 top-full ml-1 whitespace-nowrap px-1 py-0.5 text-xs font-bold shadow-sm';
|
14706
|
-
return element;
|
14707
|
-
}, []);
|
14708
|
-
const indicatorText = useIndicatorText(reason);
|
14709
|
-
const hasValidationErrorsInRow = !!validationErrors;
|
14710
|
-
React__default.useEffect(() => {
|
14711
|
-
// mountNode could be null when rows are filtered
|
14712
|
-
// Pinned columns has z-20 class assigned, which overlaps indicator element, need to add z-21 to overlap pinned columns.
|
14713
|
-
mountNode === null || mountNode === void 0 ? void 0 : mountNode.classList.add('!z-[21]', 'relative');
|
14714
|
-
mountNode === null || mountNode === void 0 ? void 0 : mountNode.appendChild(container);
|
14715
|
-
return () => {
|
14716
|
-
mountNode === null || mountNode === void 0 ? void 0 : mountNode.classList.remove('!z-[21]', 'relative');
|
14717
|
-
mountNode === null || mountNode === void 0 ? void 0 : mountNode.removeChild(container);
|
14718
|
-
};
|
14719
|
-
}, [hasValidationErrorsInRow, mountNode]);
|
14720
|
-
// Using react portal inside a react tree component is an unorthodox way, but in order to avoid much code refactoring
|
14721
|
-
// and being able to use Taco Tooltip component in side the visual indicator, portal is used.
|
14722
|
-
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(Tooltip, {
|
14723
|
-
title: indicatorText.description.replace('[COLUMN]', columnName)
|
14724
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
14725
|
-
className: "flex gap-1 hover:cursor-pointer"
|
14726
|
-
}, /*#__PURE__*/React__default.createElement(Icon, {
|
14727
|
-
name: "info",
|
14728
|
-
className: "!h-4 !w-4 rounded-full bg-white !p-0 text-blue-500"
|
14729
|
-
}), indicatorText.title)), container);
|
14730
|
-
};
|
14731
|
-
|
14732
14771
|
const Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
14733
14772
|
const {
|
14734
14773
|
defaultValue: _,
|
@@ -14788,7 +14827,7 @@ const TextareaControl = /*#__PURE__*/React__default.forwardRef(function Textarea
|
|
14788
14827
|
column,
|
14789
14828
|
isCellInDetailMode,
|
14790
14829
|
align,
|
14791
|
-
|
14830
|
+
isActiveRow,
|
14792
14831
|
value,
|
14793
14832
|
fontSize,
|
14794
14833
|
...attributes
|
@@ -14882,7 +14921,7 @@ const TextareaControl = /*#__PURE__*/React__default.forwardRef(function Textarea
|
|
14882
14921
|
'!yt-focus-dark': isCellInDetailMode,
|
14883
14922
|
[`h-[${minMaxHeight.min}px]`]: !isCellInDetailMode && (columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.enableTruncate),
|
14884
14923
|
// Only allow resizing when focused and truncation enabled
|
14885
|
-
'focus:resize-y':
|
14924
|
+
'focus:resize-y': isActiveRow && (columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.enableTruncate)
|
14886
14925
|
}),
|
14887
14926
|
ref: ref,
|
14888
14927
|
value: String(value !== null && value !== void 0 ? value : '')
|
@@ -14902,7 +14941,7 @@ const EditingControl = /*#__PURE__*/React__default.forwardRef(function Control(p
|
|
14902
14941
|
value,
|
14903
14942
|
cell,
|
14904
14943
|
error,
|
14905
|
-
|
14944
|
+
isActiveRow,
|
14906
14945
|
...attributes
|
14907
14946
|
} = props;
|
14908
14947
|
const tableMeta = table.options.meta;
|
@@ -14980,11 +15019,30 @@ const EditingControl = /*#__PURE__*/React__default.forwardRef(function Control(p
|
|
14980
15019
|
tableMeta.editing.setDetailModeEditing(true);
|
14981
15020
|
}
|
14982
15021
|
};
|
15022
|
+
const handleFocus = event => {
|
15023
|
+
var _event$target;
|
15024
|
+
const {
|
15025
|
+
frozenColumnIndex: externalFrozenColumnIndex = -1,
|
15026
|
+
frozenInternalColumnCount = 0
|
15027
|
+
} = tableMeta.columnFreezing;
|
15028
|
+
const tableElement = tableMeta.tableRef.current;
|
15029
|
+
const frozenColumnIndex = externalFrozenColumnIndex > -1 ? externalFrozenColumnIndex + frozenInternalColumnCount : frozenInternalColumnCount - 1;
|
15030
|
+
const cell = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.closest('[role="cell"]');
|
15031
|
+
if (!tableElement || !cell) {
|
15032
|
+
return;
|
15033
|
+
}
|
15034
|
+
const isEditing = true;
|
15035
|
+
const leftScrollDistance = getTableLeftScrollDistance(tableElement, cell, frozenColumnIndex, isEditing);
|
15036
|
+
if (leftScrollDistance !== null) {
|
15037
|
+
tableElement.scrollLeft = leftScrollDistance;
|
15038
|
+
}
|
15039
|
+
};
|
14983
15040
|
if (typeof controlRenderer === 'function') {
|
14984
15041
|
return controlRenderer({
|
14985
15042
|
...attributes,
|
14986
|
-
ref: refCallback,
|
14987
15043
|
invalid: !!error,
|
15044
|
+
onFocus: handleFocus,
|
15045
|
+
ref: refCallback,
|
14988
15046
|
setValue: nextValue => {
|
14989
15047
|
if (nextValue !== value) {
|
14990
15048
|
handleChange(nextValue);
|
@@ -15008,6 +15066,7 @@ const EditingControl = /*#__PURE__*/React__default.forwardRef(function Control(p
|
|
15008
15066
|
'[&_input]:!yt-focus-dark': isCellInDetailMode
|
15009
15067
|
}),
|
15010
15068
|
onChange: handleDatepickerChange,
|
15069
|
+
onFocus: handleFocus,
|
15011
15070
|
onKeyDown: handleInputKeyDown,
|
15012
15071
|
ref: refCallback,
|
15013
15072
|
value: value
|
@@ -15016,12 +15075,14 @@ const EditingControl = /*#__PURE__*/React__default.forwardRef(function Control(p
|
|
15016
15075
|
return /*#__PURE__*/React__default.createElement(Switch, Object.assign({}, attributes, {
|
15017
15076
|
checked: Boolean(value),
|
15018
15077
|
onChange: handleChange,
|
15078
|
+
onFocus: handleFocus,
|
15019
15079
|
ref: refCallback
|
15020
15080
|
}));
|
15021
15081
|
} else if (controlRenderer === 'textarea') {
|
15022
15082
|
return /*#__PURE__*/React__default.createElement(TextareaControl, Object.assign({}, props, {
|
15023
15083
|
invalid: !!error,
|
15024
15084
|
isCellInDetailMode: isCellInDetailMode,
|
15085
|
+
onFocus: handleFocus,
|
15025
15086
|
onKeyDown: handleInputKeyDown,
|
15026
15087
|
ref: refCallback,
|
15027
15088
|
fontSize: tableMeta.fontSize.size
|
@@ -15035,6 +15096,7 @@ const EditingControl = /*#__PURE__*/React__default.forwardRef(function Control(p
|
|
15035
15096
|
onChange: event => {
|
15036
15097
|
handleChange(event.target.value);
|
15037
15098
|
},
|
15099
|
+
onFocus: handleFocus,
|
15038
15100
|
onKeyDown: handleInputKeyDown,
|
15039
15101
|
ref: refCallback,
|
15040
15102
|
type: isNumber ? 'number' : undefined,
|
@@ -15060,7 +15122,7 @@ function EditingCell(props) {
|
|
15060
15122
|
}));
|
15061
15123
|
}
|
15062
15124
|
const MemoedEditingCell = /*#__PURE__*/React__default.memo(function MemoedEditingCell(props) {
|
15063
|
-
var _tableMeta$editing$ge, _tableMeta$editing$ro, _rows$
|
15125
|
+
var _tableMeta$editing$ge, _tableMeta$editing$ro, _rows$tableMeta$rowAc, _column$columnDef$met;
|
15064
15126
|
const {
|
15065
15127
|
cell,
|
15066
15128
|
column,
|
@@ -15118,22 +15180,21 @@ const MemoedEditingCell = /*#__PURE__*/React__default.memo(function MemoedEditin
|
|
15118
15180
|
// row move indicator
|
15119
15181
|
const moveReason = ((_tableMeta$editing$ro = tableMeta.editing.rowMoveReason) === null || _tableMeta$editing$ro === void 0 ? void 0 : _tableMeta$editing$ro[cell.column.id]) || null;
|
15120
15182
|
const rows = table.getRowModel().rows;
|
15121
|
-
const
|
15122
|
-
const isCurrentRow = currentRowIndex !== undefined && ((_rows$currentRowIndex = rows[currentRowIndex]) === null || _rows$currentRowIndex === void 0 ? void 0 : _rows$currentRowIndex.id) === row.id;
|
15183
|
+
const isActiveRow = tableMeta.rowActive.rowActiveIndex !== undefined && ((_rows$tableMeta$rowAc = rows[tableMeta.rowActive.rowActiveIndex]) === null || _rows$tableMeta$rowAc === void 0 ? void 0 : _rows$tableMeta$rowAc.id) === row.id;
|
15123
15184
|
const mountNode = React__default.useMemo(() => {
|
15124
|
-
if (moveReason !== null &&
|
15185
|
+
if (moveReason !== null && isActiveRow && !error) {
|
15125
15186
|
var _cellRef$current2, _cellRef$current2$par;
|
15126
15187
|
return (_cellRef$current2 = cellRef.current) === null || _cellRef$current2 === void 0 ? void 0 : (_cellRef$current2$par = _cellRef$current2.parentElement) === null || _cellRef$current2$par === void 0 ? void 0 : _cellRef$current2$par.firstChild;
|
15127
15188
|
}
|
15128
15189
|
return null;
|
15129
|
-
}, [moveReason,
|
15190
|
+
}, [moveReason, isActiveRow, error, cellRef]);
|
15130
15191
|
const removeMoveReason = () => {
|
15131
15192
|
tableMeta.editing.removeRowMoveReason();
|
15132
15193
|
};
|
15133
15194
|
React__default.useEffect(() => {
|
15134
15195
|
// To avoid reseting move reason on another row hover,
|
15135
15196
|
// we need to check for changes only if value got changed in the current row.
|
15136
|
-
if (!
|
15197
|
+
if (!isActiveRow || error) {
|
15137
15198
|
if (tableMeta.editing.rowMoveReason) {
|
15138
15199
|
removeMoveReason();
|
15139
15200
|
}
|
@@ -15148,7 +15209,7 @@ const MemoedEditingCell = /*#__PURE__*/React__default.memo(function MemoedEditin
|
|
15148
15209
|
removeMoveReason();
|
15149
15210
|
}
|
15150
15211
|
return removeMoveReason;
|
15151
|
-
}, [value, tableMeta.
|
15212
|
+
}, [value, tableMeta.rowActive.rowActiveIndex, tableMeta.search.excludeUnmatchedResults, error]);
|
15152
15213
|
const controlRenderer = (_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.control;
|
15153
15214
|
const className = cn('py-[calc(var(--table3-cell-padding-y)_-_0.06rem)]', {
|
15154
15215
|
// Textarea control is positioned absolute, when column is in enableTruncate mode, so the cell need to be positioned relative
|
@@ -15175,15 +15236,15 @@ const MemoedEditingCell = /*#__PURE__*/React__default.memo(function MemoedEditin
|
|
15175
15236
|
value: value,
|
15176
15237
|
cell: cell,
|
15177
15238
|
error: error,
|
15178
|
-
tabIndex:
|
15179
|
-
|
15239
|
+
tabIndex: isActiveRow ? 0 : -1,
|
15240
|
+
isActiveRow: isActiveRow
|
15180
15241
|
}));
|
15181
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, moveReason !== null && mountNode && !error ? /*#__PURE__*/React__default.createElement(Indicator, {
|
15242
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, moveReason !== null && mountNode && !error ? ( /*#__PURE__*/React__default.createElement(Indicator, {
|
15182
15243
|
reason: moveReason,
|
15183
15244
|
columnName: String(cell.column.columnDef.header),
|
15184
15245
|
mountNode: mountNode,
|
15185
15246
|
validationErrors: []
|
15186
|
-
}) : null, /*#__PURE__*/React__default.createElement("div", {
|
15247
|
+
})) : null, /*#__PURE__*/React__default.createElement("div", {
|
15187
15248
|
className: !highlighted ? className : undefined,
|
15188
15249
|
"data-align": columnMeta.align,
|
15189
15250
|
"data-column-index": index,
|
@@ -15192,13 +15253,13 @@ const MemoedEditingCell = /*#__PURE__*/React__default.memo(function MemoedEditin
|
|
15192
15253
|
ref: cellRef,
|
15193
15254
|
"data-invalid": !!error,
|
15194
15255
|
"data-highlighted": highlighted
|
15195
|
-
}, highlighted ? /*#__PURE__*/React__default.createElement(Highlight, {
|
15256
|
+
}, highlighted ? ( /*#__PURE__*/React__default.createElement(Highlight, {
|
15196
15257
|
current: highlightedAsCurrent,
|
15197
15258
|
className: className,
|
15198
15259
|
frozenColumnIndex: tableMeta.columnFreezing.frozenColumnIndex,
|
15199
15260
|
index: index,
|
15200
15261
|
tableRef: tableRef
|
15201
|
-
}, content) : content));
|
15262
|
+
}, content)) : content));
|
15202
15263
|
});
|
15203
15264
|
function getRowMoveReason(table, rowIndex, rowValues, cell, newValue, excludeUnmatchedResults) {
|
15204
15265
|
var _table$getState$sorti;
|
@@ -15225,7 +15286,7 @@ function getRowMoveReason(table, rowIndex, rowValues, cell, newValue, excludeUnm
|
|
15225
15286
|
}
|
15226
15287
|
|
15227
15288
|
function Cell$2(props) {
|
15228
|
-
var _rows$
|
15289
|
+
var _rows$rowActiveIndex;
|
15229
15290
|
const {
|
15230
15291
|
column,
|
15231
15292
|
row,
|
@@ -15243,8 +15304,8 @@ function Cell$2(props) {
|
|
15243
15304
|
const columnMeta = column.columnDef.meta;
|
15244
15305
|
const rowErrors = tableMeta.validation.errors ? tableMeta.validation.errors[row.id] : null;
|
15245
15306
|
const isColumnError = hasError && rowErrors && !!rowErrors[column.id];
|
15246
|
-
const
|
15247
|
-
const
|
15307
|
+
const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;
|
15308
|
+
const isActiveRow = rowActiveIndex !== undefined && ((_rows$rowActiveIndex = rows[rowActiveIndex]) === null || _rows$rowActiveIndex === void 0 ? void 0 : _rows$rowActiveIndex.id) === row.id;
|
15248
15309
|
let value = getValue();
|
15249
15310
|
// When row has changes we always need to show the editing state value, end revert it to original value only when row got saved successfully.
|
15250
15311
|
// Otherwise it might confuse user because it will look like display value is getting reverted everytime user leaves the row.
|
@@ -15269,8 +15330,8 @@ function Cell$2(props) {
|
|
15269
15330
|
if (!tableMeta.search.isHighlightingEnabled || !memoedHighlight || tableMeta.search.currentHighlightColumnIndex === undefined) {
|
15270
15331
|
return false;
|
15271
15332
|
}
|
15272
|
-
const [
|
15273
|
-
if (
|
15333
|
+
const [rowActiveIndex, currentColumnIndex] = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex];
|
15334
|
+
if (rowActiveIndex === rowIndex && currentColumnIndex === index) {
|
15274
15335
|
return true;
|
15275
15336
|
}
|
15276
15337
|
return false;
|
@@ -15279,7 +15340,7 @@ function Cell$2(props) {
|
|
15279
15340
|
highlighted: memoedHighlight,
|
15280
15341
|
highlightedAsCurrent: memoedHighlightCurrent
|
15281
15342
|
};
|
15282
|
-
if (tableMeta.editing.isEditing && columnMeta.control && (
|
15343
|
+
if (tableMeta.editing.isEditing && columnMeta.control && (isActiveRow || isHoveredRow && !tableMeta.rowActive.isHoverStatePaused ||
|
15283
15344
|
// When cell has error, we renderimg it in edit mode (UX reqirement)
|
15284
15345
|
isColumnError)) {
|
15285
15346
|
return /*#__PURE__*/React__default.createElement(EditingCell, Object.assign({}, props, highlightProps));
|
@@ -15326,7 +15387,7 @@ const Cell$3 = /*#__PURE__*/React__default.memo(function MemoedCell(context) {
|
|
15326
15387
|
rowIndex
|
15327
15388
|
} = React__default.useContext(RowContext);
|
15328
15389
|
const tableMeta = context.table.options.meta;
|
15329
|
-
const
|
15390
|
+
const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;
|
15330
15391
|
const isSelected = context.row.getIsSelected();
|
15331
15392
|
const title = isSelected ? texts.table3.columns.select.deselect : texts.table3.columns.select.select;
|
15332
15393
|
if (context.table.options.enableMultiRowSelection) {
|
@@ -15353,7 +15414,7 @@ const Cell$3 = /*#__PURE__*/React__default.memo(function MemoedCell(context) {
|
|
15353
15414
|
onClick: handleClick,
|
15354
15415
|
// this is necessary to remove console spam from eslint
|
15355
15416
|
onChange: () => false,
|
15356
|
-
tabIndex:
|
15417
|
+
tabIndex: isActiveRow ? 0 : -1
|
15357
15418
|
})));
|
15358
15419
|
} else {
|
15359
15420
|
const className = cn('!mt-0', getRadioClassnames());
|
@@ -15379,7 +15440,7 @@ const Cell$3 = /*#__PURE__*/React__default.memo(function MemoedCell(context) {
|
|
15379
15440
|
// we memo because we don't want the row re-rendering and removing focus from the checkbox
|
15380
15441
|
// we can't default to the standard comparison because we need currentRow off the table meta
|
15381
15442
|
// and we don't really care about re-rendering in any other scenario
|
15382
|
-
return newTableMeta.
|
15443
|
+
return newTableMeta.rowActive.rowActiveIndex === oldTableMeta.rowActive.rowActiveIndex && newProps.row.getIsSelected() !== oldProps.row.getIsSelected();
|
15383
15444
|
});
|
15384
15445
|
function createRowSelectionColumn(hasDrag, hasExpansion) {
|
15385
15446
|
const size = hasDrag && hasExpansion ? 22 : 40;
|
@@ -15434,7 +15495,7 @@ function Header$3(context) {
|
|
15434
15495
|
const MemoedCell$2 = /*#__PURE__*/React__default.memo(function MemoedCell(props) {
|
15435
15496
|
const {
|
15436
15497
|
expandedRowRenderer,
|
15437
|
-
|
15498
|
+
isActiveRow,
|
15438
15499
|
isExpanded,
|
15439
15500
|
row,
|
15440
15501
|
table
|
@@ -15451,7 +15512,7 @@ const MemoedCell$2 = /*#__PURE__*/React__default.memo(function MemoedCell(props)
|
|
15451
15512
|
row.toggleExpanded();
|
15452
15513
|
};
|
15453
15514
|
const title = isExpanded ? texts.table3.columns.expansion.collapse : texts.table3.columns.expansion.expand;
|
15454
|
-
const tabIndex =
|
15515
|
+
const tabIndex = isActiveRow && !tableMeta.editing.isEditing ? 0 : -1;
|
15455
15516
|
content = /*#__PURE__*/React__default.createElement(Tooltip, {
|
15456
15517
|
title: title
|
15457
15518
|
}, /*#__PURE__*/React__default.createElement(IconButton, {
|
@@ -15476,7 +15537,7 @@ function Cell$4(props) {
|
|
15476
15537
|
const tableMeta = context.table.options.meta;
|
15477
15538
|
return /*#__PURE__*/React__default.createElement(MemoedCell$2, Object.assign({}, context, {
|
15478
15539
|
expandedRowRenderer: expandedRowRenderer,
|
15479
|
-
|
15540
|
+
isActiveRow: tableMeta.rowActive.rowActiveIndex === rowIndex,
|
15480
15541
|
isExpanded: context.row.getIsExpanded()
|
15481
15542
|
}));
|
15482
15543
|
}
|
@@ -15559,10 +15620,10 @@ function createRowDragColumn(onRowDrag) {
|
|
15559
15620
|
return {
|
15560
15621
|
id: COLUMN_ID$4,
|
15561
15622
|
header: Header$1,
|
15562
|
-
cell: context => /*#__PURE__*/React__default.createElement(Cell$5, Object.assign({}, context, {
|
15623
|
+
cell: context => ( /*#__PURE__*/React__default.createElement(Cell$5, Object.assign({}, context, {
|
15563
15624
|
isSelected: context.row.getIsSelected(),
|
15564
15625
|
onRowDrag: onRowDrag
|
15565
|
-
})),
|
15626
|
+
}))),
|
15566
15627
|
footer: Footer$3,
|
15567
15628
|
meta: {
|
15568
15629
|
align: 'center',
|
@@ -15597,7 +15658,7 @@ function Group$3(props) {
|
|
15597
15658
|
hasSeparator,
|
15598
15659
|
id: header.id,
|
15599
15660
|
index: header.index,
|
15600
|
-
isPrinting: tableMeta.isPrinting,
|
15661
|
+
isPrinting: tableMeta.printing.isPrinting,
|
15601
15662
|
length: table.getRowModel().rows.length,
|
15602
15663
|
meta: columnMeta,
|
15603
15664
|
table
|
@@ -15747,7 +15808,6 @@ function useConvertChildrenToColumns(props, options, editing) {
|
|
15747
15808
|
// compiler cannot get filtering out undefined items, so using the type casting here
|
15748
15809
|
.filter(child => !!child); // need to remove undefined array items after processing the children
|
15749
15810
|
}
|
15750
|
-
|
15751
15811
|
const columns = processChildren(props.children);
|
15752
15812
|
if (options.enableRowExpansion && props.expandedRowRenderer) {
|
15753
15813
|
columns.unshift(columnHelper.display(createRowExpansionColumn(props.expandedRowRenderer)));
|
@@ -15773,25 +15833,25 @@ function useConvertChildrenToColumns(props, options, editing) {
|
|
15773
15833
|
}, [editing.isEditing]);
|
15774
15834
|
}
|
15775
15835
|
|
15776
|
-
function
|
15777
|
-
const [
|
15836
|
+
function useTablePrinting(isEnabled = false, defaultIsWarningVisible = true, id) {
|
15837
|
+
const [isWarningVisibleForLargeDatasets, setIsWarningVisibleForLargeDatasets] = React__default.useState(defaultIsWarningVisible);
|
15778
15838
|
return {
|
15779
15839
|
isEnabled,
|
15780
|
-
|
15781
|
-
|
15782
|
-
|
15840
|
+
isPrinting: id.endsWith('_print'),
|
15841
|
+
isWarningVisibleForLargeDatasets,
|
15842
|
+
setIsWarningVisibleForLargeDatasets: isEnabled ? setIsWarningVisibleForLargeDatasets : () => undefined
|
15783
15843
|
};
|
15784
15844
|
}
|
15785
15845
|
|
15786
|
-
function
|
15846
|
+
function useTableShortcutsListener(table, shortcuts) {
|
15787
15847
|
const meta = table.options.meta;
|
15788
15848
|
const rows = table.getRowModel().rows;
|
15789
15849
|
React__default.useEffect(() => {
|
15790
15850
|
const shortcutKeys = Object.keys(shortcuts !== null && shortcuts !== void 0 ? shortcuts : {});
|
15791
15851
|
const globalHandlers = [];
|
15792
15852
|
// convert the shortcut into the correct format to register it
|
15793
|
-
if (shortcuts && shortcutKeys.length && meta.
|
15794
|
-
const
|
15853
|
+
if (shortcuts && shortcutKeys.length && meta.rowActive.rowActiveIndex !== undefined) {
|
15854
|
+
const rowActive = rows[meta.rowActive.rowActiveIndex];
|
15795
15855
|
shortcutKeys.forEach(key => {
|
15796
15856
|
const handler = shortcuts[key];
|
15797
15857
|
let keyDownHandler;
|
@@ -15812,7 +15872,7 @@ function useShortcutsListener(table, shortcuts) {
|
|
15812
15872
|
}
|
15813
15873
|
globalHandlers.push(createShortcutKeyDownHandler(keyDownHandlerOptions, event => {
|
15814
15874
|
event.preventDefault();
|
15815
|
-
keyDownHandler(
|
15875
|
+
keyDownHandler(rowActive === null || rowActive === void 0 ? void 0 : rowActive.original);
|
15816
15876
|
}));
|
15817
15877
|
});
|
15818
15878
|
}
|
@@ -15824,17 +15884,17 @@ function useShortcutsListener(table, shortcuts) {
|
|
15824
15884
|
document.removeEventListener('keydown', handler);
|
15825
15885
|
});
|
15826
15886
|
};
|
15827
|
-
}, [shortcuts, meta.
|
15887
|
+
}, [shortcuts, meta.rowActive.rowActiveIndex, rows.length]);
|
15828
15888
|
}
|
15829
15889
|
|
15830
|
-
function
|
15890
|
+
function useTableRowGoto(isEnabled = false, handler) {
|
15831
15891
|
return {
|
15832
15892
|
isEnabled,
|
15833
15893
|
handleGoto: isEnabled && handler ? handler : () => undefined
|
15834
15894
|
};
|
15835
15895
|
}
|
15836
15896
|
|
15837
|
-
function
|
15897
|
+
function useTableServerLoadingListener(table, loadPage) {
|
15838
15898
|
const sorting = table.getState().sorting;
|
15839
15899
|
const columnFilters = table.getState().columnFilters;
|
15840
15900
|
const search = table.getState().globalFilter;
|
@@ -15855,7 +15915,7 @@ function useEditingStateListener(table) {
|
|
15855
15915
|
meta.editing.saveChangesIfNeeded();
|
15856
15916
|
});
|
15857
15917
|
}
|
15858
|
-
}, [meta.
|
15918
|
+
}, [meta.rowActive.rowActiveIndex]);
|
15859
15919
|
// save if editing gets toggled off
|
15860
15920
|
React__default.useEffect(() => {
|
15861
15921
|
if (meta.editing.isEnabled) {
|
@@ -15863,14 +15923,14 @@ function useEditingStateListener(table) {
|
|
15863
15923
|
requestAnimationFrame(() => {
|
15864
15924
|
meta.editing.saveChangesIfNeeded();
|
15865
15925
|
});
|
15866
|
-
} else if (meta.
|
15867
|
-
meta.
|
15926
|
+
} else if (meta.rowActive.rowActiveIndex === undefined) {
|
15927
|
+
meta.rowActive.setRowActiveIndex(0);
|
15868
15928
|
}
|
15869
15929
|
}
|
15870
15930
|
}, [meta.editing.isEditing]);
|
15871
15931
|
}
|
15872
15932
|
|
15873
|
-
function useSearch(isEnabled, excludeUnmatchedResultsInSearch = false
|
15933
|
+
function useSearch(isEnabled, excludeUnmatchedResultsInSearch = false) {
|
15874
15934
|
const [isSearching, setIsSearching] = React__default.useState(false);
|
15875
15935
|
const [query, setQuery] = React__default.useState();
|
15876
15936
|
const [enableHighlighting, setEnableHighlighting] = React__default.useState(true);
|
@@ -15890,7 +15950,6 @@ function useSearch(isEnabled, excludeUnmatchedResultsInSearch = false, loadAll)
|
|
15890
15950
|
setHighlightedColumnIndexes,
|
15891
15951
|
currentHighlightColumnIndex,
|
15892
15952
|
setCurrentHighlightColumnIndex,
|
15893
|
-
loadAll,
|
15894
15953
|
isSearching,
|
15895
15954
|
setIsSearching
|
15896
15955
|
};
|
@@ -16147,91 +16206,72 @@ function usePauseShortcuts() {
|
|
16147
16206
|
};
|
16148
16207
|
}
|
16149
16208
|
|
16150
|
-
function
|
16151
|
-
|
16152
|
-
|
16153
|
-
|
16154
|
-
|
16155
|
-
|
16156
|
-
|
16157
|
-
|
16158
|
-
|
16159
|
-
|
16160
|
-
|
16161
|
-
|
16162
|
-
|
16163
|
-
|
16164
|
-
|
16165
|
-
|
16166
|
-
|
16167
|
-
|
16168
|
-
|
16169
|
-
|
16170
|
-
|
16171
|
-
|
16172
|
-
|
16173
|
-
|
16174
|
-
|
16175
|
-
|
16176
|
-
|
16177
|
-
|
16178
|
-
|
16179
|
-
|
16180
|
-
// search is always client side, since we call loadAll when searching
|
16181
|
-
tableOptions.globalFilterFn = (row, columnId, searchQuery) => {
|
16182
|
-
try {
|
16183
|
-
if (row.original) {
|
16184
|
-
const cell = row.getAllCells().find(cell => cell.column.id === columnId);
|
16185
|
-
const columnMeta = cell === null || cell === void 0 ? void 0 : cell.column.columnDef.meta;
|
16186
|
-
if (cell && cell.column.getIsVisible() && columnMeta !== null && columnMeta !== void 0 && columnMeta.enableSearch) {
|
16187
|
-
const cellValue = getCellValueAsString(row.original[columnId], columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.dataType);
|
16188
|
-
if (cellValue !== undefined) {
|
16189
|
-
return globalFilterFn(cellValue, searchQuery);
|
16190
|
-
}
|
16191
|
-
}
|
16192
|
-
return false;
|
16193
|
-
}
|
16194
|
-
} catch {
|
16195
|
-
//
|
16196
|
-
}
|
16197
|
-
return false;
|
16198
|
-
};
|
16199
|
-
tableOptions.getFilteredRowModel = reactTable$1.getFilteredRowModel();
|
16200
|
-
tableOptions.getColumnCanGlobalFilter = column => {
|
16201
|
-
var _column$columnDef$met;
|
16202
|
-
return (_column$columnDef$met = column.columnDef.meta.enableSearch) !== null && _column$columnDef$met !== void 0 ? _column$columnDef$met : true;
|
16203
|
-
};
|
16204
|
-
}
|
16205
|
-
// sorting
|
16206
|
-
if (options.enableSorting) {
|
16207
|
-
if (props.onSort) {
|
16208
|
-
tableOptions.manualSorting = true;
|
16209
|
-
// onSort is called as a listener to let the consumer update their data, so we don't use onSortingChange
|
16210
|
-
} else {
|
16211
|
-
tableOptions.getSortedRowModel = reactTable$1.getSortedRowModel();
|
16212
|
-
}
|
16209
|
+
function useTableFontSizeListener(table) {
|
16210
|
+
const meta = table.options.meta;
|
16211
|
+
const previousFontSizeRef = React__default.useRef(meta.fontSize.size);
|
16212
|
+
useLazyEffect(() => {
|
16213
|
+
const cellWidthDifference = getCellWidthDifference(`${previousFontSizeRef.current}-${meta.fontSize.size}`);
|
16214
|
+
table.setColumnSizing(sizes => {
|
16215
|
+
const minColumnSize = getCellMinWidth(meta.fontSize.size);
|
16216
|
+
return Object.fromEntries(Object.entries(sizes).map(([columnName, prevColumnSize]) => {
|
16217
|
+
// Prevents width value in the setting to go below the minColumnSize
|
16218
|
+
const newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);
|
16219
|
+
return [columnName, newSize];
|
16220
|
+
}));
|
16221
|
+
});
|
16222
|
+
previousFontSizeRef.current = meta.fontSize.size;
|
16223
|
+
}, [meta.fontSize.size]);
|
16224
|
+
}
|
16225
|
+
function getCellWidthDifference(fontSizeKey) {
|
16226
|
+
switch (fontSizeKey) {
|
16227
|
+
case `${TableFontSizes.small}-${TableFontSizes.medium}`:
|
16228
|
+
case `${TableFontSizes.medium}-${TableFontSizes.large}`:
|
16229
|
+
return 8;
|
16230
|
+
case `${TableFontSizes.medium}-${TableFontSizes.small}`:
|
16231
|
+
case `${TableFontSizes.large}-${TableFontSizes.medium}`:
|
16232
|
+
return -8;
|
16233
|
+
case `${TableFontSizes.small}-${TableFontSizes.large}`:
|
16234
|
+
return 16;
|
16235
|
+
case `${TableFontSizes.large}-${TableFontSizes.small}`:
|
16236
|
+
return -16;
|
16237
|
+
default:
|
16238
|
+
return 0;
|
16213
16239
|
}
|
16214
|
-
|
16215
|
-
|
16216
|
-
|
16217
|
-
|
16218
|
-
|
16219
|
-
const
|
16240
|
+
}
|
16241
|
+
|
16242
|
+
function useTable$1(props, ref) {
|
16243
|
+
var _settings$columnFreez, _props$length;
|
16244
|
+
// load any persisted table settings and merge them with any defaults
|
16245
|
+
const [settings, setSettings] = useSettings(props.id, props.defaultSettings, props.onChangeSettings);
|
16246
|
+
// configure table3 options
|
16247
|
+
const options = useTablePreset(props);
|
16248
|
+
// configure react-table built-in features
|
16249
|
+
const tableOptions = configureReactTableOptions(props, options);
|
16250
|
+
// configure custom features
|
16251
|
+
const columnFreezing = useColumnFreezing((_settings$columnFreez = settings.columnFreezingIndex) !== null && _settings$columnFreez !== void 0 ? _settings$columnFreez : props.defaultColumnFreezingIndex, options);
|
16252
|
+
// can't change due to rename to "active row"
|
16220
16253
|
const validation = useValidation(props.onCellValidate, props.onRowValidate);
|
16254
|
+
// not relevant to common table
|
16221
16255
|
const editing = useEditing(options.enableEditing, validation, props.onSave);
|
16222
|
-
|
16223
|
-
const hoverState = usePauseHoverState();
|
16224
|
-
const printing = usePrinting(options.enablePrinting, props.loadAll, defaultSettings.showWarningWhenPrintingLargeDataset);
|
16256
|
+
// needs to be moved
|
16225
16257
|
const rowActions = useRowActions$1(props.actionsForRow, props.actionsForRowLength);
|
16226
|
-
|
16258
|
+
// not relevant to common table
|
16227
16259
|
const rowDrag = useRowDrag(options.enableRowDrag);
|
16260
|
+
// not relevant to common table
|
16228
16261
|
const rowDrop = useRowDrop(options.enableRowDrop, props.onRowDrop);
|
16229
|
-
|
16230
|
-
const
|
16231
|
-
(_defaultSettings$rowH = defaultSettings.rowHeight) !== null && _defaultSettings$rowH !== void 0 ? _defaultSettings$rowH : defaultSettings === null || defaultSettings === void 0 ? void 0 : defaultSettings.rowDensity);
|
16232
|
-
const rowSelection = useRowSelection();
|
16233
|
-
const search = useSearch(options.enableSearch, defaultSettings.excludeUnmatchedRecordsInSearch, props.loadAll);
|
16262
|
+
// haven't migrated load all/server loading yet
|
16263
|
+
const search = useSearch(options.enableSearch, settings.excludeUnmatchedRecordsInSearch);
|
16234
16264
|
const shortcutsState = usePauseShortcuts();
|
16265
|
+
// custom features - shared/migrated
|
16266
|
+
const columnOrdering = useTableColumnOrdering(options.enableColumnOrdering);
|
16267
|
+
const fontSize = useTableFontSize(options.enableFontSize, settings.fontSize);
|
16268
|
+
const printing = useTablePrinting(options.enablePrinting, settings.showWarningWhenPrintingLargeDataset, props.id);
|
16269
|
+
const rowActive = useTableRowActive$1(true, props.defaultCurrentRowIndex);
|
16270
|
+
const rowClick = useTableRowClick(true, props.onRowClick);
|
16271
|
+
const rowGoto = useTableRowGoto(options.enableRowGoto, props.onRowGoto);
|
16272
|
+
const rowHeight = useTableRowHeight(options.enableRowHeight, settings.rowHeight);
|
16273
|
+
const rowSelection = useTableRowSelection(options.enableRowSelection);
|
16274
|
+
const server = useTableServerLoading(props.loadPage, props.loadAll);
|
16235
16275
|
// columns
|
16236
16276
|
const {
|
16237
16277
|
columns,
|
@@ -16241,13 +16281,13 @@ function useTable$1(props) {
|
|
16241
16281
|
} = useConvertChildrenToColumns(props, options, editing);
|
16242
16282
|
// built-in features
|
16243
16283
|
const initialState = React__default.useMemo(() => {
|
16244
|
-
var
|
16284
|
+
var _settings$columnSizin, _settings$columnVisib, _props$defaultSetting, _props$defaultSetting3;
|
16245
16285
|
const sanitizeSortedColumns = column => columns.find(definedColumn => definedColumn.id === column.id);
|
16246
16286
|
const state = {
|
16247
|
-
columnOrder: ensureOrdering(columns,
|
16248
|
-
columnSizing: (
|
16249
|
-
columnVisibility: (
|
16250
|
-
sorting:
|
16287
|
+
columnOrder: ensureOrdering(columns, [COLUMN_ID, COLUMN_ID$1], settings.columnOrder),
|
16288
|
+
columnSizing: (_settings$columnSizin = settings.columnSizing) !== null && _settings$columnSizin !== void 0 ? _settings$columnSizin : defaultColumnSizing,
|
16289
|
+
columnVisibility: (_settings$columnVisib = settings.columnVisibility) !== null && _settings$columnVisib !== void 0 ? _settings$columnVisib : defaultColumnVisibility,
|
16290
|
+
sorting: settings.sorting ? settings.sorting.filter(sanitizeSortedColumns) : defaultSorting
|
16251
16291
|
};
|
16252
16292
|
// we don't save these outside the table, but they need to be here for print to inherit them - see PrintButton.tsx
|
16253
16293
|
if ((_props$defaultSetting = props.defaultSettings) !== null && _props$defaultSetting !== void 0 && _props$defaultSetting.columnFilters) {
|
@@ -16270,7 +16310,7 @@ function useTable$1(props) {
|
|
16270
16310
|
excludeUnmatchedRecordsInSearch: search.excludeUnmatchedResults,
|
16271
16311
|
fontSize: fontSize.isEnabled ? fontSize.size : undefined,
|
16272
16312
|
rowHeight: rowHeight.isEnabled ? rowHeight.height : undefined,
|
16273
|
-
showWarningWhenPrintingLargeDataset: printing.
|
16313
|
+
showWarningWhenPrintingLargeDataset: printing.isWarningVisibleForLargeDatasets,
|
16274
16314
|
sorting: state.sorting
|
16275
16315
|
};
|
16276
16316
|
};
|
@@ -16284,16 +16324,15 @@ function useTable$1(props) {
|
|
16284
16324
|
meta: {
|
16285
16325
|
columnFreezing,
|
16286
16326
|
columnOrdering,
|
16287
|
-
currentRow,
|
16288
16327
|
editing,
|
16289
16328
|
enableFooter: options.enableFooter,
|
16290
16329
|
fontSize,
|
16291
16330
|
getSettings,
|
16292
|
-
hoverState,
|
16293
16331
|
isPrinting: props.id.endsWith('_print'),
|
16294
16332
|
isUsingServer: !!props.loadPage,
|
16295
16333
|
printing,
|
16296
16334
|
rowActions: rowActions,
|
16335
|
+
rowActive,
|
16297
16336
|
rowClick: rowClick,
|
16298
16337
|
rowDrag,
|
16299
16338
|
rowDrop,
|
@@ -16301,24 +16340,91 @@ function useTable$1(props) {
|
|
16301
16340
|
rowHeight,
|
16302
16341
|
rowSelection,
|
16303
16342
|
search,
|
16343
|
+
server,
|
16304
16344
|
shortcutsState,
|
16345
|
+
tableRef: ref,
|
16305
16346
|
validation
|
16306
16347
|
}
|
16307
16348
|
});
|
16308
16349
|
// listeners
|
16309
|
-
useCurrentRowListener(table);
|
16310
16350
|
useEditingStateListener(table);
|
16311
|
-
useFilteringStateListener(table, props.onFilter);
|
16312
|
-
useRowSelectionListener(table, props.onRowSelect);
|
16313
16351
|
useSettingsStateListener(table, setSettings);
|
16314
|
-
|
16315
|
-
|
16316
|
-
|
16352
|
+
// listeners - shared/migrated
|
16353
|
+
useTableDataListener(table);
|
16354
|
+
useTableFilterListener(table, props.onFilter);
|
16355
|
+
useTableFontSizeListener(table);
|
16356
|
+
useTableRowSelectionListener(table, props.onRowSelect);
|
16357
|
+
useTableServerLoadingListener(table, props.loadPage);
|
16358
|
+
useTableShortcutsListener(table, props.shortcuts);
|
16359
|
+
useTableSortingListener$1(table, props.onSort);
|
16317
16360
|
return {
|
16318
16361
|
table,
|
16319
16362
|
length: (_props$length = props.length) !== null && _props$length !== void 0 ? _props$length : props.data.length
|
16320
16363
|
};
|
16321
16364
|
}
|
16365
|
+
function configureReactTableOptions(props, options) {
|
16366
|
+
const tableOptions = {
|
16367
|
+
enableColumnFilters: options.enableFiltering,
|
16368
|
+
enableColumnResizing: options.enableColumnResizing,
|
16369
|
+
enableExpanding: options.enableRowExpansion,
|
16370
|
+
enableGlobalFilter: options.enableSearch,
|
16371
|
+
enableHiding: options.enableColumnHiding,
|
16372
|
+
enableRowSelection: options.enableRowSelection,
|
16373
|
+
enableMultiRowSelection: !options.enableRowSelectionSingle,
|
16374
|
+
enableSorting: options.enableSorting
|
16375
|
+
};
|
16376
|
+
// resizing
|
16377
|
+
if (tableOptions.enableColumnResizing) {
|
16378
|
+
tableOptions.columnResizeMode = 'onChange';
|
16379
|
+
}
|
16380
|
+
// filtering
|
16381
|
+
if (tableOptions.enableColumnFilters) {
|
16382
|
+
if (!props.onFilter) {
|
16383
|
+
tableOptions.filterFns = {
|
16384
|
+
tacoFilter: (row, columnId, filter) => columnFilterFn(row.getValue(columnId), filter)
|
16385
|
+
};
|
16386
|
+
tableOptions.getFilteredRowModel = reactTable$1.getFilteredRowModel();
|
16387
|
+
}
|
16388
|
+
// we don't tableOptions.manualFiltering = true; because it breaks global filtering, server filtering still works :shrug:
|
16389
|
+
}
|
16390
|
+
// search
|
16391
|
+
if (tableOptions.enableGlobalFilter) {
|
16392
|
+
// search is always client side, since we call loadAll when searching
|
16393
|
+
tableOptions.globalFilterFn = (row, columnId, searchQuery) => {
|
16394
|
+
try {
|
16395
|
+
if (row.original) {
|
16396
|
+
const cell = row.getAllCells().find(cell => cell.column.id === columnId);
|
16397
|
+
const columnMeta = cell === null || cell === void 0 ? void 0 : cell.column.columnDef.meta;
|
16398
|
+
if (cell && cell.column.getIsVisible() && columnMeta !== null && columnMeta !== void 0 && columnMeta.enableSearch) {
|
16399
|
+
const cellValue = getCellValueAsString(row.original[columnId], columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.dataType);
|
16400
|
+
if (cellValue !== undefined) {
|
16401
|
+
return globalFilterFn(cellValue, searchQuery);
|
16402
|
+
}
|
16403
|
+
}
|
16404
|
+
return false;
|
16405
|
+
}
|
16406
|
+
} catch {
|
16407
|
+
//
|
16408
|
+
}
|
16409
|
+
return false;
|
16410
|
+
};
|
16411
|
+
tableOptions.getFilteredRowModel = reactTable$1.getFilteredRowModel();
|
16412
|
+
tableOptions.getColumnCanGlobalFilter = column => {
|
16413
|
+
var _column$columnDef$met;
|
16414
|
+
return (_column$columnDef$met = column.columnDef.meta.enableSearch) !== null && _column$columnDef$met !== void 0 ? _column$columnDef$met : true;
|
16415
|
+
};
|
16416
|
+
}
|
16417
|
+
// sorting
|
16418
|
+
if (options.enableSorting) {
|
16419
|
+
if (props.onSort) {
|
16420
|
+
tableOptions.manualSorting = true;
|
16421
|
+
// onSort is called as a listener to let the consumer update their data, so we don't use onSortingChange
|
16422
|
+
} else {
|
16423
|
+
tableOptions.getSortedRowModel = reactTable$1.getSortedRowModel();
|
16424
|
+
}
|
16425
|
+
}
|
16426
|
+
return tableOptions;
|
16427
|
+
}
|
16322
16428
|
|
16323
16429
|
const ExpandedRow = /*#__PURE__*/React__default.memo(function ExpandedRow(props) {
|
16324
16430
|
var _renderer;
|
@@ -16383,9 +16489,9 @@ function SkeletonRow(props) {
|
|
16383
16489
|
} = props;
|
16384
16490
|
return /*#__PURE__*/React__default.createElement("div", {
|
16385
16491
|
className: "contents"
|
16386
|
-
}, columns.map(column => /*#__PURE__*/React__default.createElement(SkeletonCell, Object.assign({
|
16492
|
+
}, columns.map(column => ( /*#__PURE__*/React__default.createElement(SkeletonCell, Object.assign({
|
16387
16493
|
key: column.id
|
16388
|
-
}, otherProps))));
|
16494
|
+
}, otherProps)))));
|
16389
16495
|
}
|
16390
16496
|
|
16391
16497
|
// Note - latest react-virtual requires an inner container, and that doesn't work with css grid,
|
@@ -16434,17 +16540,17 @@ function createBodyRenderer(props, rows, table, tableRef, virtualiser, setExpand
|
|
16434
16540
|
row: row,
|
16435
16541
|
table: table,
|
16436
16542
|
tableRef: tableRef
|
16437
|
-
}, row.getVisibleCells().map((cell, index) => /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
16543
|
+
}, row.getVisibleCells().map((cell, index) => ( /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
16438
16544
|
key: cell.id
|
16439
16545
|
}, reactTable$1.flexRender(cell.column.columnDef.cell, {
|
16440
16546
|
...cell.getContext(),
|
16441
16547
|
index,
|
16442
16548
|
tableRef
|
16443
|
-
})))), row.getIsExpanded() ? /*#__PURE__*/React__default.createElement(ExpandedRow, {
|
16549
|
+
}))))), row.getIsExpanded() ? ( /*#__PURE__*/React__default.createElement(ExpandedRow, {
|
16444
16550
|
data: row.original,
|
16445
16551
|
renderer: props.expandedRowRenderer,
|
16446
16552
|
registerSize: createSetSizeHandler(virtualRow.index)
|
16447
|
-
}) : null);
|
16553
|
+
})) : null);
|
16448
16554
|
}), paddingBottom ? /*#__PURE__*/React__default.createElement("div", {
|
16449
16555
|
style: {
|
16450
16556
|
height: paddingBottom
|
@@ -16563,10 +16669,10 @@ function Search$2(props) {
|
|
16563
16669
|
tableMeta.search.setIsSearching(true);
|
16564
16670
|
// load all data if that is possible
|
16565
16671
|
const _temp = function () {
|
16566
|
-
if (tableMeta.
|
16672
|
+
if (tableMeta.server.loadAll && loading === LoadingState.Incomplete) {
|
16567
16673
|
setLoading(LoadingState.Loading);
|
16568
16674
|
// don't pass the search query because we need all data - not filtered data
|
16569
|
-
return Promise.resolve(tableMeta.
|
16675
|
+
return Promise.resolve(tableMeta.server.loadAll(table.getState().sorting, table.getState().columnFilters, undefined)).then(function () {
|
16570
16676
|
setLoading(LoadingState.Completed);
|
16571
16677
|
});
|
16572
16678
|
}
|
@@ -16584,14 +16690,16 @@ function Search$2(props) {
|
|
16584
16690
|
setQuery(String(query !== null && query !== void 0 ? query : ''));
|
16585
16691
|
};
|
16586
16692
|
const handleClear = () => {
|
16587
|
-
|
16588
|
-
const [rowIndex, cellIndex] = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex || 0];
|
16693
|
+
const [rowIndex = null, cellIndex = null] = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex || 0];
|
16589
16694
|
const rows = table.getRowModel().rows;
|
16590
|
-
const rowId = ((_rows$rowIndex = rows[rowIndex]) === null || _rows$rowIndex === void 0 ? void 0 : _rows$rowIndex.id) || null;
|
16591
16695
|
tableMeta.search.setQuery('');
|
16592
16696
|
// Need to save row id and cell index, to be able to find the row in the table with updated indexes, after global filter will be reset.
|
16593
16697
|
lastCellIndex.value = String(cellIndex);
|
16594
|
-
|
16698
|
+
if (rowIndex !== null) {
|
16699
|
+
var _rows$rowIndex;
|
16700
|
+
const rowId = ((_rows$rowIndex = rows[rowIndex]) === null || _rows$rowIndex === void 0 ? void 0 : _rows$rowIndex.id) || null;
|
16701
|
+
setRowIdToNavigate(rowId);
|
16702
|
+
}
|
16595
16703
|
};
|
16596
16704
|
const handleKeyDown = event => {
|
16597
16705
|
if (event.key === 'Escape') {
|
@@ -16608,7 +16716,7 @@ function Search$2(props) {
|
|
16608
16716
|
const rows = table.getRowModel().rows;
|
16609
16717
|
const rowIndex = rows.findIndex(row => row.id === rowIdToNavigate);
|
16610
16718
|
tableMeta.search.setIsSearching(false);
|
16611
|
-
tableMeta.
|
16719
|
+
tableMeta.rowActive.setRowActiveIndex(rowIndex);
|
16612
16720
|
scrollTo(rowIndex);
|
16613
16721
|
setRowIdToNavigate(null);
|
16614
16722
|
}
|
@@ -16710,7 +16818,7 @@ function resetHighlightedColumnIndexes(enabled, value, table) {
|
|
16710
16818
|
tableMeta.search.setCurrentHighlightColumnIndex(undefined);
|
16711
16819
|
}
|
16712
16820
|
if (firstRowIndex !== undefined) {
|
16713
|
-
tableMeta.
|
16821
|
+
tableMeta.rowActive.setRowActiveIndex(firstRowIndex);
|
16714
16822
|
}
|
16715
16823
|
return firstRowIndex;
|
16716
16824
|
}
|
@@ -16744,12 +16852,12 @@ function FilterColumn(props) {
|
|
16744
16852
|
return /*#__PURE__*/React__default.createElement(Select2.Option, {
|
16745
16853
|
key: column.id,
|
16746
16854
|
value: column.id,
|
16747
|
-
postfix: !column.getIsVisible() ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
16855
|
+
postfix: !column.getIsVisible() ? ( /*#__PURE__*/React__default.createElement(Tooltip, {
|
16748
16856
|
title: texts.table3.filters.hiddenColumn
|
16749
16857
|
}, /*#__PURE__*/React__default.createElement(Icon, {
|
16750
16858
|
name: "eye-off",
|
16751
16859
|
className: "text-grey-500 !h-5 !w-5"
|
16752
|
-
})) : undefined,
|
16860
|
+
}))) : undefined,
|
16753
16861
|
disabled: column.id !== value && (!column.getCanFilter() || !!filters.find(f => f.id === column.id))
|
16754
16862
|
}, ((_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})` : ''));
|
16755
16863
|
}))));
|
@@ -16776,10 +16884,10 @@ function FilterComparator(props) {
|
|
16776
16884
|
disabled: !column,
|
16777
16885
|
onChange: handleChange,
|
16778
16886
|
value: value
|
16779
|
-
}), validComparators.map(comparator => /*#__PURE__*/React__default.createElement(Select2.Option, {
|
16887
|
+
}), validComparators.map(comparator => ( /*#__PURE__*/React__default.createElement(Select2.Option, {
|
16780
16888
|
key: comparator,
|
16781
16889
|
value: comparator
|
16782
|
-
}, getComparatorText(comparator, texts, column))));
|
16890
|
+
}, getComparatorText(comparator, texts, column)))));
|
16783
16891
|
}
|
16784
16892
|
function guessComparatorsBasedOnControl(column) {
|
16785
16893
|
var _column$columnDef$met;
|
@@ -17174,6 +17282,12 @@ function FiltersButton(props) {
|
|
17174
17282
|
setFilters([]);
|
17175
17283
|
setPlaceholderCount(1);
|
17176
17284
|
};
|
17285
|
+
const handleClose = React__default.useCallback(open => {
|
17286
|
+
if (!open) {
|
17287
|
+
setFilters(appliedFilters);
|
17288
|
+
setPlaceholderCount(appliedFilters.length === 0 ? 1 : 0);
|
17289
|
+
}
|
17290
|
+
}, [appliedFilters]);
|
17177
17291
|
// Because filters can be reset from outside
|
17178
17292
|
React__default.useEffect(() => {
|
17179
17293
|
if (appliedFilters.length === 0) {
|
@@ -17186,7 +17300,9 @@ function FiltersButton(props) {
|
|
17186
17300
|
className: cn({
|
17187
17301
|
'!wcag-blue-100': appliedFilters.length
|
17188
17302
|
}),
|
17189
|
-
popover: popoverProps => /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps
|
17303
|
+
popover: popoverProps => ( /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps, {
|
17304
|
+
onChange: handleClose
|
17305
|
+
}), /*#__PURE__*/React__default.createElement(Popover.Content, null, /*#__PURE__*/React__default.createElement("div", {
|
17190
17306
|
className: "flex w-[40rem] flex-col gap-4"
|
17191
17307
|
}, /*#__PURE__*/React__default.createElement("div", {
|
17192
17308
|
className: "flex h-8"
|
@@ -17198,7 +17314,7 @@ function FiltersButton(props) {
|
|
17198
17314
|
className: "text-grey-700 mb-0 mr-auto mt-px inline-flex"
|
17199
17315
|
}, texts.table3.filters.total.replace('[CURRENT]', new Intl.NumberFormat(locale).format(table.getFilteredRowModel().rows.length)).replace('[TOTAL]', new Intl.NumberFormat(locale).format(total))))), /*#__PURE__*/React__default.createElement("div", {
|
17200
17316
|
className: "flex flex-col gap-2"
|
17201
|
-
}, filters.map((filter, index) => /*#__PURE__*/React__default.createElement(Filter$1, {
|
17317
|
+
}, filters.map((filter, index) => ( /*#__PURE__*/React__default.createElement(Filter$1, {
|
17202
17318
|
key: `filter_${index}`,
|
17203
17319
|
allColumns: allColumns,
|
17204
17320
|
filter: filter,
|
@@ -17206,14 +17322,14 @@ function FiltersButton(props) {
|
|
17206
17322
|
position: index,
|
17207
17323
|
onChange: handleChangeFilter,
|
17208
17324
|
onRemove: handleRemoveFilter
|
17209
|
-
})), [...Array(placeholderCount)].map((_, index) => /*#__PURE__*/React__default.createElement(Placeholder, {
|
17325
|
+
}))), [...Array(placeholderCount)].map((_, index) => ( /*#__PURE__*/React__default.createElement(Placeholder, {
|
17210
17326
|
key: `placeholder_${index}`,
|
17211
17327
|
allColumns: allColumns,
|
17212
17328
|
filters: filters,
|
17213
17329
|
position: filters.length + index,
|
17214
17330
|
onCreate: handleCreateFilterFromPlaceholder,
|
17215
17331
|
onRemove: placeholderCount > 1 || filters.length > 0 ? handleRemovePlaceholder : undefined
|
17216
|
-
})), /*#__PURE__*/React__default.createElement("div", {
|
17332
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
17217
17333
|
className: "justify-start"
|
17218
17334
|
}, /*#__PURE__*/React__default.createElement(Button$1, {
|
17219
17335
|
appearance: "discrete",
|
@@ -17225,16 +17341,16 @@ function FiltersButton(props) {
|
|
17225
17341
|
}, "Clear"), /*#__PURE__*/React__default.createElement(Button$1, {
|
17226
17342
|
appearance: "primary",
|
17227
17343
|
onClick: handleApply
|
17228
|
-
}, "Apply"))))),
|
17344
|
+
}, "Apply")))))),
|
17229
17345
|
ref,
|
17230
|
-
tooltip: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.table3.filters.tooltip, /*#__PURE__*/React__default.createElement(Shortcut, {
|
17346
|
+
tooltip: ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.table3.filters.tooltip, /*#__PURE__*/React__default.createElement(Shortcut, {
|
17231
17347
|
className: "ml-2",
|
17232
17348
|
keys: {
|
17233
17349
|
key: 'f',
|
17234
17350
|
meta: true,
|
17235
17351
|
shift: true
|
17236
17352
|
}
|
17237
|
-
}))
|
17353
|
+
})))
|
17238
17354
|
};
|
17239
17355
|
if (!isLargeScreen && !appliedFilters.length) {
|
17240
17356
|
return /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, buttonProps, {
|
@@ -17561,14 +17677,14 @@ function PrintButton(props) {
|
|
17561
17677
|
texts
|
17562
17678
|
} = useLocalization();
|
17563
17679
|
const toast = useToast();
|
17564
|
-
const [
|
17680
|
+
const [isCurrentlyPrinting, setIsCurrentlyPrinting] = React__default.useState(false);
|
17565
17681
|
const [showWarningDialog, setShowWarningDialog] = React__default.useState(false);
|
17566
17682
|
const loadingToastRef = React__default.useRef(null);
|
17567
17683
|
const buttonRef = React__default.useRef(null);
|
17568
17684
|
const tableMeta = table.options.meta;
|
17569
17685
|
const state = table.getState();
|
17570
17686
|
const {
|
17571
|
-
|
17687
|
+
isWarningVisibleForLargeDatasets
|
17572
17688
|
} = tableMeta.printing;
|
17573
17689
|
// When changing printTableId, update packages/taco/src/components/Table3/Table3.tsx file and other usages where
|
17574
17690
|
// printTableId is used to figure out whether the table is a print table or not.
|
@@ -17621,8 +17737,8 @@ function PrintButton(props) {
|
|
17621
17737
|
const restoreTableDataWithoutSearch = function () {
|
17622
17738
|
try {
|
17623
17739
|
const _temp = _catch(function () {
|
17624
|
-
var _tableMeta$
|
17625
|
-
return Promise.resolve((_tableMeta$
|
17740
|
+
var _tableMeta$server$loa, _tableMeta$server;
|
17741
|
+
return Promise.resolve((_tableMeta$server$loa = (_tableMeta$server = tableMeta.server).loadAll) === null || _tableMeta$server$loa === void 0 ? void 0 : _tableMeta$server$loa.call(_tableMeta$server, table.getState().sorting, table.getState().columnFilters, undefined)).then(function () {});
|
17626
17742
|
}, function (error) {
|
17627
17743
|
handleLoadingError(error);
|
17628
17744
|
});
|
@@ -17635,11 +17751,11 @@ function PrintButton(props) {
|
|
17635
17751
|
try {
|
17636
17752
|
function _temp3() {
|
17637
17753
|
var _loadingToastRef$curr2;
|
17638
|
-
|
17754
|
+
setIsCurrentlyPrinting(false);
|
17639
17755
|
(_loadingToastRef$curr2 = loadingToastRef.current) === null || _loadingToastRef$curr2 === void 0 ? void 0 : _loadingToastRef$curr2.close();
|
17640
17756
|
}
|
17641
17757
|
const _temp2 = function () {
|
17642
|
-
if (tableMeta.
|
17758
|
+
if (tableMeta.server.loadAll && excludeUnmatchedResults) {
|
17643
17759
|
return Promise.resolve(restoreTableDataWithoutSearch()).then(function () {});
|
17644
17760
|
}
|
17645
17761
|
}();
|
@@ -17657,11 +17773,11 @@ function PrintButton(props) {
|
|
17657
17773
|
let _exit = false;
|
17658
17774
|
function _temp6(_result3) {
|
17659
17775
|
if (_exit) return _result3;
|
17660
|
-
if (hasNonSafeCellCount &&
|
17776
|
+
if (hasNonSafeCellCount && isWarningVisibleForLargeDatasets) {
|
17661
17777
|
setShowWarningDialog(true);
|
17662
17778
|
} else {
|
17663
17779
|
// only set printing (mount the iframe) when the data has loaded, it prevents repaint performance slow downs
|
17664
|
-
|
17780
|
+
setIsCurrentlyPrinting(true);
|
17665
17781
|
}
|
17666
17782
|
}
|
17667
17783
|
loadingToastRef.current = toast.loading(texts.table3.print.loading);
|
@@ -17670,7 +17786,7 @@ function PrintButton(props) {
|
|
17670
17786
|
// if loadAll is not defined, just print with what we've got
|
17671
17787
|
// don't compare length to data.length because the api might be choosing not to return all for performance
|
17672
17788
|
const _temp5 = function () {
|
17673
|
-
if (!tableMeta.
|
17789
|
+
if (!tableMeta.server.loadAll) {
|
17674
17790
|
const {
|
17675
17791
|
data
|
17676
17792
|
} = tableProps;
|
@@ -17678,7 +17794,7 @@ function PrintButton(props) {
|
|
17678
17794
|
hasNonSafeCellCount = cellCount > SAFE_PRINT_CELL_COUNT;
|
17679
17795
|
} else {
|
17680
17796
|
const _temp4 = _catch(function () {
|
17681
|
-
return Promise.resolve(tableMeta.
|
17797
|
+
return Promise.resolve(tableMeta.server.loadAll(table.getState().sorting, table.getState().columnFilters,
|
17682
17798
|
// We need to pass search query to the server when printing, to be able to render correct data set in iFrame,
|
17683
17799
|
// But in "display" table, search is performed only on client side, so we'll need to request data again without search query,
|
17684
17800
|
// when printing will be finished.
|
@@ -17705,12 +17821,12 @@ function PrintButton(props) {
|
|
17705
17821
|
}
|
17706
17822
|
};
|
17707
17823
|
const handleWarningDialogAccept = () => {
|
17708
|
-
|
17824
|
+
setIsCurrentlyPrinting(true);
|
17709
17825
|
};
|
17710
17826
|
const handleWarningDialogCancel = function () {
|
17711
17827
|
try {
|
17712
17828
|
const _temp7 = function () {
|
17713
|
-
if (tableMeta.
|
17829
|
+
if (tableMeta.server.loadAll && excludeUnmatchedResults) {
|
17714
17830
|
return Promise.resolve(restoreTableDataWithoutSearch()).then(function () {});
|
17715
17831
|
}
|
17716
17832
|
}();
|
@@ -17725,22 +17841,22 @@ function PrintButton(props) {
|
|
17725
17841
|
setShowWarningDialog(false);
|
17726
17842
|
};
|
17727
17843
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
17728
|
-
disabled:
|
17844
|
+
disabled: isCurrentlyPrinting,
|
17729
17845
|
icon: "print",
|
17730
17846
|
onClick: handlePrint,
|
17731
17847
|
"aria-label": texts.table3.print.tooltip,
|
17732
17848
|
tooltip: texts.table3.print.tooltip,
|
17733
17849
|
ref: buttonRef
|
17734
|
-
}),
|
17850
|
+
}), isCurrentlyPrinting && iframeTableProps.data !== null && ( /*#__PURE__*/React__default.createElement(PrintIFrame, {
|
17735
17851
|
onAfterPrint: handleAfterPrint,
|
17736
17852
|
onBeforePrint: handleBeforePrint,
|
17737
17853
|
tableProps: iframeTableProps
|
17738
|
-
}), /*#__PURE__*/React__default.createElement(WarningDialog, {
|
17854
|
+
})), /*#__PURE__*/React__default.createElement(WarningDialog, {
|
17739
17855
|
open: showWarningDialog,
|
17740
17856
|
onAccept: handleWarningDialogAccept,
|
17741
17857
|
onClose: handleWarningDialogClose,
|
17742
17858
|
onCancel: handleWarningDialogCancel,
|
17743
|
-
onVisibilityChange: tableMeta.printing.
|
17859
|
+
onVisibilityChange: tableMeta.printing.setIsWarningVisibleForLargeDatasets
|
17744
17860
|
}));
|
17745
17861
|
}
|
17746
17862
|
|
@@ -17948,17 +18064,17 @@ function ColumnSettingsPopover(props) {
|
|
17948
18064
|
})) {
|
17949
18065
|
return;
|
17950
18066
|
}
|
17951
|
-
table.setColumnOrder(currentOrder => ensureOrdering(allColumns, SortablePrimitive.arrayMove(currentOrder, currentOrder.findIndex(c => c === activeId), currentOrder.findIndex(c => c === overId))));
|
18067
|
+
table.setColumnOrder(currentOrder => ensureOrdering(allColumns, [COLUMN_ID, COLUMN_ID$1], SortablePrimitive.arrayMove(currentOrder, currentOrder.findIndex(c => c === activeId), currentOrder.findIndex(c => c === overId))));
|
17952
18068
|
};
|
17953
18069
|
return /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps, {
|
17954
18070
|
anchor: trigger
|
17955
18071
|
}), /*#__PURE__*/React__default.createElement(Popover.Content, null, /*#__PURE__*/React__default.createElement("div", {
|
17956
18072
|
className: "flex max-w-sm flex-col gap-2"
|
17957
|
-
}, table.options.enableHiding ? /*#__PURE__*/React__default.createElement(Input, {
|
18073
|
+
}, table.options.enableHiding ? ( /*#__PURE__*/React__default.createElement(Input, {
|
17958
18074
|
onChange: event => setQuery(event.target.value),
|
17959
18075
|
placeholder: texts.table3.columnSettings.search,
|
17960
18076
|
value: query
|
17961
|
-
}) : null, tableMeta.columnOrdering.isEnabled && columns.length && !(query !== null && query !== void 0 && query.length) ? /*#__PURE__*/React__default.createElement(Container, {
|
18077
|
+
})) : null, tableMeta.columnOrdering.isEnabled && columns.length && !(query !== null && query !== void 0 && query.length) ? ( /*#__PURE__*/React__default.createElement(Container, {
|
17962
18078
|
reorder: handleReorder
|
17963
18079
|
}, /*#__PURE__*/React__default.createElement(List$1, {
|
17964
18080
|
id: "columns",
|
@@ -17974,12 +18090,12 @@ function ColumnSettingsPopover(props) {
|
|
17974
18090
|
column: column,
|
17975
18091
|
draggable: (_column$columnDef$met5 = column.columnDef.meta) === null || _column$columnDef$met5 === void 0 ? void 0 : _column$columnDef$met5.enableOrdering
|
17976
18092
|
}));
|
17977
|
-
}))) : /*#__PURE__*/React__default.createElement("div", {
|
18093
|
+
})))) : ( /*#__PURE__*/React__default.createElement("div", {
|
17978
18094
|
className: listClassName
|
17979
18095
|
}, columns.length ? columns.map(column => /*#__PURE__*/React__default.createElement(Column$1, {
|
17980
18096
|
column: column,
|
17981
18097
|
key: column.id
|
17982
|
-
})) : texts.table3.columnSettings.noResults))));
|
18098
|
+
})) : texts.table3.columnSettings.noResults)))));
|
17983
18099
|
}
|
17984
18100
|
|
17985
18101
|
function SettingsButton(props) {
|
@@ -18000,11 +18116,11 @@ function SettingsButton(props) {
|
|
18000
18116
|
case 'columnSettings':
|
18001
18117
|
{
|
18002
18118
|
if (hasColumnSettings) {
|
18003
|
-
popoverElement = props => /*#__PURE__*/React__default.createElement(ColumnSettingsPopover, Object.assign({}, props, {
|
18119
|
+
popoverElement = props => ( /*#__PURE__*/React__default.createElement(ColumnSettingsPopover, Object.assign({}, props, {
|
18004
18120
|
open: true,
|
18005
18121
|
onChange: handleClosePopover,
|
18006
18122
|
table: table
|
18007
|
-
}));
|
18123
|
+
})));
|
18008
18124
|
}
|
18009
18125
|
}
|
18010
18126
|
}
|
@@ -18012,25 +18128,25 @@ function SettingsButton(props) {
|
|
18012
18128
|
return /*#__PURE__*/React__default.createElement(IconButton, {
|
18013
18129
|
"aria-label": texts.table3.otherOptions.tooltip,
|
18014
18130
|
icon: "sliders",
|
18015
|
-
menu: popoverElement ? undefined : menuProps => /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, {
|
18131
|
+
menu: popoverElement ? undefined : menuProps => ( /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, {
|
18016
18132
|
align: "end"
|
18017
|
-
}, table.options.enableHiding || tableMeta.columnOrdering.isEnabled ? /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
18133
|
+
}, table.options.enableHiding || tableMeta.columnOrdering.isEnabled ? ( /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
18018
18134
|
icon: "columns",
|
18019
18135
|
onClick: () => setPopover('columnSettings')
|
18020
|
-
}, texts.table3.columnSettings.button) : null, tableMeta.rowHeight.isEnabled || tableMeta.fontSize.isEnabled ? /*#__PURE__*/React__default.createElement(Menu$1.Separator, null) : null, tableMeta.rowHeight.isEnabled ? /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
18136
|
+
}, texts.table3.columnSettings.button)) : null, tableMeta.rowHeight.isEnabled || tableMeta.fontSize.isEnabled ? /*#__PURE__*/React__default.createElement(Menu$1.Separator, null) : null, tableMeta.rowHeight.isEnabled ? ( /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
18021
18137
|
icon: `height-${tableMeta.rowHeight.height}`,
|
18022
18138
|
subMenu: () => /*#__PURE__*/React__default.createElement(RowHeight, {
|
18023
18139
|
table: table
|
18024
18140
|
})
|
18025
|
-
}, texts.table3.rowHeight.tooltip) : null, tableMeta.fontSize.isEnabled ? /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
18141
|
+
}, texts.table3.rowHeight.tooltip)) : null, tableMeta.fontSize.isEnabled ? ( /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
18026
18142
|
icon: "font-size",
|
18027
18143
|
subMenu: () => /*#__PURE__*/React__default.createElement(FontSize$1, {
|
18028
18144
|
table: table
|
18029
18145
|
})
|
18030
|
-
}, texts.table3.fontSize.tooltip) : null, customSettings ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Menu$1.Separator, null), customSettings.map(customSetting => {
|
18146
|
+
}, texts.table3.fontSize.tooltip)) : null, customSettings ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Menu$1.Separator, null), customSettings.map(customSetting => {
|
18031
18147
|
const props = tableMeta.getSettings();
|
18032
18148
|
return customSetting(props);
|
18033
|
-
})) : null)),
|
18149
|
+
}))) : null))),
|
18034
18150
|
popover: popoverElement,
|
18035
18151
|
onClickCapture: event => event.preventDefault(),
|
18036
18152
|
tooltip: texts.table3.otherOptions.tooltip
|
@@ -18155,7 +18271,6 @@ const getCellHeightPadding = (height, fontSize) => {
|
|
18155
18271
|
// py-1.5
|
18156
18272
|
}
|
18157
18273
|
}
|
18158
|
-
|
18159
18274
|
case 'tall':
|
18160
18275
|
{
|
18161
18276
|
switch (fontSize) {
|
@@ -18202,7 +18317,6 @@ const getCellWidthPadding = fontSize => {
|
|
18202
18317
|
// py-1.5
|
18203
18318
|
}
|
18204
18319
|
};
|
18205
|
-
|
18206
18320
|
const useCssVars = (height, fontSize) => {
|
18207
18321
|
const style = {
|
18208
18322
|
'--table3-cell-padding-x': getCellWidthPadding(fontSize),
|
@@ -18268,7 +18382,7 @@ function ErrorAlert(props) {
|
|
18268
18382
|
};
|
18269
18383
|
// Navigate to row and focus first invalid cell
|
18270
18384
|
const navigateToRow = rowIndex => {
|
18271
|
-
tableMeta.
|
18385
|
+
tableMeta.rowActive.setRowActiveIndex(rowIndex);
|
18272
18386
|
scrollToIndex(rowIndex, {
|
18273
18387
|
align: 'center'
|
18274
18388
|
});
|
@@ -18319,7 +18433,7 @@ function ErrorAlert(props) {
|
|
18319
18433
|
const getCoreRow = React__default.useCallback(rowId => coreRows.find(coreRow => coreRow.id === rowId), [coreRows]);
|
18320
18434
|
return /*#__PURE__*/React__default.createElement("div", {
|
18321
18435
|
className: "mb-4"
|
18322
|
-
}, errorsRowIds.length ? /*#__PURE__*/React__default.createElement(Alert, {
|
18436
|
+
}, errorsRowIds.length ? ( /*#__PURE__*/React__default.createElement(Alert, {
|
18323
18437
|
state: "error",
|
18324
18438
|
className: "mb-1"
|
18325
18439
|
}, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("b", null, errorsRowIds.length, " ", texts.table3.validation.alert.unsavedEntries(errorsRowIds.length)), ' '), rowIdentifierHeader || texts.table3.validation.index, ' ', errorsRowIds.map((rowId, index) => {
|
@@ -18334,7 +18448,7 @@ function ErrorAlert(props) {
|
|
18334
18448
|
}, rowIdentifier ? coreRow === null || coreRow === void 0 ? void 0 : coreRow.original[rowIdentifier] : coreRow === null || coreRow === void 0 ? void 0 : coreRow.index), /*#__PURE__*/React__default.createElement("span", {
|
18335
18449
|
key: `${rowId}_comma`
|
18336
18450
|
}, index < errorsRowIds.length - 1 ? ',' : ''));
|
18337
|
-
}), texts.table3.validation.alert.incompleteAndHavntBeenSaved(errorsRowIds.length)) : null, /*#__PURE__*/React__default.createElement(FilterResetDialog, {
|
18451
|
+
}), texts.table3.validation.alert.incompleteAndHavntBeenSaved(errorsRowIds.length))) : null, /*#__PURE__*/React__default.createElement(FilterResetDialog, {
|
18338
18452
|
open: resetFiltersConfirmationOpen,
|
18339
18453
|
onClose: () => {
|
18340
18454
|
setResetFiltersConfirmationOpen(false);
|
@@ -18376,6 +18490,8 @@ function FilterResetDialog(props) {
|
|
18376
18490
|
}, texts.table3.validation.resetFiltersDialog.confirm)))));
|
18377
18491
|
}
|
18378
18492
|
|
18493
|
+
const fixedForwardRef = React__default.forwardRef;
|
18494
|
+
|
18379
18495
|
function useTable3DataLoader(fetch, fetchAll, options = {
|
18380
18496
|
pageSize: 100
|
18381
18497
|
}) {
|
@@ -18509,21 +18625,19 @@ function Group$4(_) {
|
|
18509
18625
|
return null;
|
18510
18626
|
}
|
18511
18627
|
Group$4.displayName = 'Table3Group';
|
18512
|
-
// Cast the old forwardRef to the new one
|
18513
|
-
const fixedForwardRef = React__default.forwardRef;
|
18514
18628
|
const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
18515
18629
|
const {
|
18516
18630
|
emptyState: EmptyState,
|
18517
18631
|
customSettings,
|
18518
18632
|
toolbarLeft,
|
18519
18633
|
toolbarRight,
|
18520
|
-
defaultCurrentRowIndex
|
18634
|
+
defaultCurrentRowIndex: defaultRowActiveIndex
|
18521
18635
|
} = props;
|
18522
18636
|
const internalRef = useMergedRef(ref);
|
18523
18637
|
const {
|
18524
18638
|
table,
|
18525
18639
|
length
|
18526
|
-
} = useTable$1(props);
|
18640
|
+
} = useTable$1(props, internalRef);
|
18527
18641
|
useTableRefInstanceSetup(table, internalRef);
|
18528
18642
|
React__default.useEffect(() => {
|
18529
18643
|
if (props.autoFocus) {
|
@@ -18542,8 +18656,8 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
18542
18656
|
// On a very first render, the tanstack table rendered without any rows,
|
18543
18657
|
// so we delaying default row scrolling logic with using of requestAnimation frame
|
18544
18658
|
const animationFrameId = requestAnimationFrame(() => {
|
18545
|
-
if (
|
18546
|
-
scrollToIndex(
|
18659
|
+
if (defaultRowActiveIndex) {
|
18660
|
+
scrollToIndex(defaultRowActiveIndex, {
|
18547
18661
|
align: 'center'
|
18548
18662
|
});
|
18549
18663
|
}
|
@@ -18562,9 +18676,12 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
18562
18676
|
if (eventOriginatedFromCombobox || dialog && !(dialog !== null && dialog !== void 0 && dialog.contains(internalRef.current)) || tableMeta.shortcutsState.isPaused) {
|
18563
18677
|
return;
|
18564
18678
|
}
|
18565
|
-
|
18566
|
-
tableMeta.
|
18567
|
-
tableMeta.
|
18679
|
+
const rows = table.getRowModel().rows;
|
18680
|
+
tableMeta.rowActive.handleKeyDown(event, rows.length, scrollToIndex, tableMeta.editing.isEditing ? undefined : internalRef);
|
18681
|
+
if (tableMeta.rowActive.rowActiveIndex !== undefined) {
|
18682
|
+
var _rows$tableMeta$rowAc;
|
18683
|
+
tableMeta.rowClick.handleKeyDown(event, (_rows$tableMeta$rowAc = rows[tableMeta.rowActive.rowActiveIndex]) === null || _rows$tableMeta$rowAc === void 0 ? void 0 : _rows$tableMeta$rowAc.original);
|
18684
|
+
}
|
18568
18685
|
tableMeta.rowSelection.handleKeyDown(event, table);
|
18569
18686
|
tableMeta.editing.handleKeyDown(event);
|
18570
18687
|
};
|
@@ -18576,16 +18693,16 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
18576
18693
|
// See https://github.com/e-conomic/taco/blob/dev/packages/taco/src/components/Table3/strategies/virtualised.tsx#L143
|
18577
18694
|
// scrollToIndex function changes when row count changes, so it is important to update handlers with new
|
18578
18695
|
// scrollToIndex function.
|
18579
|
-
[scrollToIndex, tableMeta.editing.isEditing, internalRef.current]);
|
18696
|
+
[scrollToIndex, tableMeta.editing.isEditing, internalRef.current, tableMeta.rowActive.rowActiveIndex]);
|
18580
18697
|
const handleBlur = tableMeta.editing.isEnabled ? event => {
|
18581
18698
|
tableMeta.editing.handleBlur(event);
|
18582
18699
|
} : undefined;
|
18583
|
-
const handleFocus = tableMeta.
|
18584
|
-
tableMeta.
|
18700
|
+
const handleFocus = tableMeta.rowActive.rowActiveIndex === undefined ? event => {
|
18701
|
+
tableMeta.rowActive.handleFocus(event, table.getRowModel().rows.length, scrollToIndex);
|
18585
18702
|
} : undefined;
|
18586
18703
|
// mouse capture fires before focus, so we can prevent propagation and stop double setting of the active row
|
18587
|
-
const handleMouseCapture = tableMeta.
|
18588
|
-
tableMeta.
|
18704
|
+
const handleMouseCapture = tableMeta.rowActive.rowActiveIndex === undefined ? event => {
|
18705
|
+
tableMeta.rowActive.handleMouseCapture(event, table.getRowModel().rows.length);
|
18589
18706
|
} : undefined;
|
18590
18707
|
const handleScroll = function (event) {
|
18591
18708
|
try {
|
@@ -18604,7 +18721,7 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
18604
18721
|
// if the table is a print table or not.
|
18605
18722
|
const {
|
18606
18723
|
style: cssGridStyle
|
18607
|
-
} = useCssGrid(table, tableMeta.isPrinting, tableMeta.rowActions.actionsForRowLength, tableMeta.fontSize.size);
|
18724
|
+
} = useCssGrid(table, tableMeta.printing.isPrinting, tableMeta.rowActions.actionsForRowLength, tableMeta.fontSize.size);
|
18608
18725
|
const {
|
18609
18726
|
style: cssVars
|
18610
18727
|
} = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);
|
@@ -18618,12 +18735,11 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
18618
18735
|
const columnFreezingStyle = useColumnFreezingStyle(props.id, table);
|
18619
18736
|
const headerOffsetStyle = useHeaderOffsetStyle(props.id, table);
|
18620
18737
|
const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;
|
18621
|
-
const isPrinting = tableMeta.isPrinting;
|
18622
18738
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, columnFreezingStyle ? /*#__PURE__*/React__default.createElement("style", {
|
18623
18739
|
"data-taco": "table3-column-freezing-styles"
|
18624
|
-
}, columnFreezingStyle) : null, headerOffsetStyle && !isPrinting ? /*#__PURE__*/React__default.createElement("style", {
|
18740
|
+
}, columnFreezingStyle) : null, headerOffsetStyle && !tableMeta.printing.isPrinting ? ( /*#__PURE__*/React__default.createElement("style", {
|
18625
18741
|
"data-taco": "table3-column-header-offset-styles"
|
18626
|
-
}, headerOffsetStyle) : null, /*#__PURE__*/React__default.createElement(Toolbar, {
|
18742
|
+
}, headerOffsetStyle)) : null, /*#__PURE__*/React__default.createElement(Toolbar, {
|
18627
18743
|
table: table,
|
18628
18744
|
tableProps: props,
|
18629
18745
|
total: length,
|
@@ -18642,7 +18758,7 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
18642
18758
|
"data-font-size": tableMeta.fontSize.size,
|
18643
18759
|
"data-editing": tableMeta.editing.isEditing,
|
18644
18760
|
"data-horizontally-scrolled": tableMeta.columnFreezing.horizontallyScrolled,
|
18645
|
-
"data-pause-hover": tableMeta === null || tableMeta === void 0 ? void 0 : tableMeta.
|
18761
|
+
"data-pause-hover": tableMeta === null || tableMeta === void 0 ? void 0 : tableMeta.rowActive.isHoverStatePaused,
|
18646
18762
|
"data-resizing": !!state.columnSizingInfo.isResizingColumn,
|
18647
18763
|
"data-taco": "table2",
|
18648
18764
|
onBlur: handleBlur,
|
@@ -18652,11 +18768,11 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
18652
18768
|
role: "table",
|
18653
18769
|
style: style,
|
18654
18770
|
tabIndex: -1
|
18655
|
-
}, isServerLoadingAndNotReady ? null : /*#__PURE__*/React__default.createElement("div", {
|
18771
|
+
}, isServerLoadingAndNotReady ? null : ( /*#__PURE__*/React__default.createElement("div", {
|
18656
18772
|
className: "group/header contents",
|
18657
18773
|
"data-taco": "table2-header",
|
18658
18774
|
role: "rowgroup"
|
18659
|
-
}, table.getHeaderGroups().map(headerGroup => /*#__PURE__*/React__default.createElement("div", {
|
18775
|
+
}, table.getHeaderGroups().map(headerGroup => ( /*#__PURE__*/React__default.createElement("div", {
|
18660
18776
|
className: "contents",
|
18661
18777
|
key: headerGroup.id,
|
18662
18778
|
role: "row"
|
@@ -18672,7 +18788,7 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
18672
18788
|
scrollToIndex,
|
18673
18789
|
hasSeparator
|
18674
18790
|
}));
|
18675
|
-
})))), table.getRowModel().rows.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(focus.FocusScope, {
|
18791
|
+
})))))), table.getRowModel().rows.length ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(focus.FocusScope, {
|
18676
18792
|
autoFocus: tableMeta.editing.isEditing
|
18677
18793
|
}, /*#__PURE__*/React__default.createElement("div", {
|
18678
18794
|
onMouseDownCapture: handleMouseCapture,
|
@@ -18682,25 +18798,25 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
18682
18798
|
ref: bodyRef
|
18683
18799
|
}, renderBody())), /*#__PURE__*/React__default.createElement("div", {
|
18684
18800
|
className: "border-grey-300 col-span-full translate-y-px border-t"
|
18685
|
-
}), tableMeta.enableFooter ? /*#__PURE__*/React__default.createElement("div", {
|
18801
|
+
}), tableMeta.enableFooter ? ( /*#__PURE__*/React__default.createElement("div", {
|
18686
18802
|
className: "group/footer contents",
|
18687
18803
|
"data-taco": "table2-footer",
|
18688
18804
|
role: "rowgroup"
|
18689
18805
|
},
|
18690
18806
|
// Render the footer cell only for individual columns, excluding column groups.
|
18691
|
-
table.getFooterGroups().slice(0, 1).map(footerGroup => /*#__PURE__*/React__default.createElement("div", {
|
18807
|
+
table.getFooterGroups().slice(0, 1).map(footerGroup => ( /*#__PURE__*/React__default.createElement("div", {
|
18692
18808
|
className: "contents",
|
18693
18809
|
key: footerGroup.id,
|
18694
18810
|
role: "row"
|
18695
|
-
}, footerGroup.headers.map(footer => /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
18811
|
+
}, footerGroup.headers.map(footer => ( /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
18696
18812
|
key: footer.id
|
18697
|
-
}, reactTable$1.flexRender(footer.column.columnDef.footer, footer.getContext()))))), length ? /*#__PURE__*/React__default.createElement(Summary, {
|
18813
|
+
}, reactTable$1.flexRender(footer.column.columnDef.footer, footer.getContext()))))))), length ? ( /*#__PURE__*/React__default.createElement(Summary, {
|
18698
18814
|
currentLength: table.getRowModel().rows.length,
|
18699
18815
|
length: length,
|
18700
18816
|
table: table
|
18701
|
-
}) : null) : null) : /*#__PURE__*/React__default.createElement("div", {
|
18817
|
+
})) : null)) : null)) : ( /*#__PURE__*/React__default.createElement("div", {
|
18702
18818
|
className: "col-span-full min-h-[theme(spacing.8)]"
|
18703
|
-
}, EmptyState ? /*#__PURE__*/React__default.createElement(EmptyState, null) : null)));
|
18819
|
+
}, EmptyState ? /*#__PURE__*/React__default.createElement(EmptyState, null) : null))));
|
18704
18820
|
});
|
18705
18821
|
const Table3 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
18706
18822
|
const stringifiedChildren = String(props.children);
|
@@ -18837,9 +18953,9 @@ const Tooltip$1 = ({
|
|
18837
18953
|
className: "absolute top-0 right-0 mt-1 mr-1"
|
18838
18954
|
})), step.title && /*#__PURE__*/React.createElement("h5", null, step.title), step.content, /*#__PURE__*/React.createElement(Group, {
|
18839
18955
|
className: "mt-4 justify-end"
|
18840
|
-
}, index > 0 && /*#__PURE__*/React.createElement(Button$1, Object.assign({}, backProps, {
|
18956
|
+
}, index > 0 && ( /*#__PURE__*/React.createElement(Button$1, Object.assign({}, backProps, {
|
18841
18957
|
appearance: "discrete"
|
18842
|
-
}), locale.back), /*#__PURE__*/React.createElement(Button$1, Object.assign({}, primaryProps, {
|
18958
|
+
}), locale.back)), /*#__PURE__*/React.createElement(Button$1, Object.assign({}, primaryProps, {
|
18843
18959
|
appearance: "primary"
|
18844
18960
|
}), continuous ? isLastStep ? `${locale.last} (${index + 1}/${size})` : `${locale.next} (${index + 1}/${size})` : locale.close)));
|
18845
18961
|
};
|
@@ -18902,10 +19018,10 @@ const Tour = props => {
|
|
18902
19018
|
floaterProps: {
|
18903
19019
|
disableAnimation: true
|
18904
19020
|
},
|
18905
|
-
tooltipComponent: tooltipProps => /*#__PURE__*/React.createElement(Tooltip$1, Object.assign({}, tooltipProps, {
|
19021
|
+
tooltipComponent: tooltipProps => ( /*#__PURE__*/React.createElement(Tooltip$1, Object.assign({}, tooltipProps, {
|
18906
19022
|
locale: tour,
|
18907
19023
|
disableTourSkipOnEsc: disableTourSkipOnEsc
|
18908
|
-
})),
|
19024
|
+
}))),
|
18909
19025
|
locale: tour,
|
18910
19026
|
spotlightPadding: 8,
|
18911
19027
|
spotlightClicks: spotlightClicks,
|
@@ -18959,11 +19075,11 @@ const Link$1 = /*#__PURE__*/React__default.forwardRef(function Link(props, ref)
|
|
18959
19075
|
tabIndex: 0
|
18960
19076
|
}), icon ? /*#__PURE__*/React__default.createElement(Icon, {
|
18961
19077
|
name: icon
|
18962
|
-
}) : null, children, isNew ? /*#__PURE__*/React__default.createElement(Badge, {
|
19078
|
+
}) : null, children, isNew ? ( /*#__PURE__*/React__default.createElement(Badge, {
|
18963
19079
|
color: "blue",
|
18964
19080
|
small: true,
|
18965
19081
|
className: "absolute right-0 top-0 -mr-2.5 -mt-1.5 !h-3 !px-0.5 text-[0.55rem] font-normal"
|
18966
|
-
}, texts.header.new) : null);
|
19082
|
+
}, texts.header.new)) : null);
|
18967
19083
|
if (tooltip) {
|
18968
19084
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
18969
19085
|
title: tooltip
|
@@ -19159,10 +19275,10 @@ const AgreementItem = props => {
|
|
19159
19275
|
title: agreement.name
|
19160
19276
|
}, /*#__PURE__*/React__default.createElement("span", {
|
19161
19277
|
className: "truncate"
|
19162
|
-
}, agreement.name), ' ', agreement.secure ? /*#__PURE__*/React__default.createElement(Icon, {
|
19278
|
+
}, agreement.name), ' ', agreement.secure ? ( /*#__PURE__*/React__default.createElement(Icon, {
|
19163
19279
|
name: "secure-tick",
|
19164
19280
|
className: "ml-1 mt-0.5 mb-0.5 !h-4 !w-4 flex-shrink-0 flex-grow-0"
|
19165
|
-
}) : null), /*#__PURE__*/React__default.createElement("span", {
|
19281
|
+
})) : null), /*#__PURE__*/React__default.createElement("span", {
|
19166
19282
|
className: "text-grey-100 whitespace-nowrap text-xs"
|
19167
19283
|
}, agreement.number, " ", agreement.userId, " ", /*#__PURE__*/React__default.createElement(AgreementBadge, {
|
19168
19284
|
agreement: agreement
|
@@ -19248,10 +19364,10 @@ function AgreementSelector(props) {
|
|
19248
19364
|
}, /*#__PURE__*/React__default.createElement(AgreementDisplay, {
|
19249
19365
|
currentAgreement: currentAgreement,
|
19250
19366
|
fallbackImageSrc: fallbackImageSrc
|
19251
|
-
}, agreements ? /*#__PURE__*/React__default.createElement(Icon, {
|
19367
|
+
}, agreements ? ( /*#__PURE__*/React__default.createElement(Icon, {
|
19252
19368
|
className: "ml-auto hidden flex-shrink-0 flex-grow-0 text-white xl:flex",
|
19253
19369
|
name: open ? 'chevron-up' : 'chevron-down'
|
19254
|
-
}) : null)), /*#__PURE__*/React__default.createElement(PopoverPrimitive.Content, {
|
19370
|
+
})) : null)), /*#__PURE__*/React__default.createElement(PopoverPrimitive.Content, {
|
19255
19371
|
className: "z-[996] mt-2 flex h-[calc(100vh_-_theme(spacing.16))] w-64 flex-col gap-1 bg-blue-900"
|
19256
19372
|
}, /*#__PURE__*/React__default.createElement(SearchInput, {
|
19257
19373
|
autoFocus: true,
|
@@ -19273,10 +19389,10 @@ function AgreementSelector(props) {
|
|
19273
19389
|
}, filterBySearchValue(search)(agreement) ? button : null, agreement.clients.filter(agreement => filterClientAgreement(agreement, search, filterBySearchValue(search))).map(clientAgreement => createAgreementButton(clientAgreement, fallbackImageSrc, handleChangeAgreement, isCurrentAgreement(clientAgreement, currentAgreement))));
|
19274
19390
|
}
|
19275
19391
|
return button;
|
19276
|
-
})), handleAddAgreement ? /*#__PURE__*/React__default.createElement(Button$1, {
|
19392
|
+
})), handleAddAgreement ? ( /*#__PURE__*/React__default.createElement(Button$1, {
|
19277
19393
|
className: "focus-visible:!yt-focus-dark my-1 mx-2 !h-9 shrink-0 !bg-white/[0.08] !text-white hover:!bg-white/[0.16]",
|
19278
19394
|
onClick: handleAddAgreement
|
19279
|
-
}, texts.header.addAgreement) : null, /*#__PURE__*/React__default.createElement("hr", {
|
19395
|
+
}, texts.header.addAgreement)) : null, /*#__PURE__*/React__default.createElement("hr", {
|
19280
19396
|
className: "my-0 h-px w-full bg-white/[0.08]"
|
19281
19397
|
}), /*#__PURE__*/React__default.createElement("a", {
|
19282
19398
|
className: "focus-visible:yt-focus-dark mx-2 mb-2 flex h-8 shrink-0 items-center justify-center rounded text-white hover:cursor-pointer hover:text-white hover:underline focus-visible:outline-none",
|
@@ -19420,7 +19536,7 @@ const Sidebar = /*#__PURE__*/React__default.forwardRef(function LayoutSidebar(pr
|
|
19420
19536
|
"aria-hidden": !isVisible,
|
19421
19537
|
className: className,
|
19422
19538
|
ref: ref
|
19423
|
-
}), content), /*#__PURE__*/React__default.createElement(framerMotion.AnimatePresence, null, showBackdrop && /*#__PURE__*/React__default.createElement(SidebarBackdrop, {
|
19539
|
+
}), content), /*#__PURE__*/React__default.createElement(framerMotion.AnimatePresence, null, showBackdrop && ( /*#__PURE__*/React__default.createElement(SidebarBackdrop, {
|
19424
19540
|
initial: {
|
19425
19541
|
opacity: 0
|
19426
19542
|
},
|
@@ -19432,7 +19548,7 @@ const Sidebar = /*#__PURE__*/React__default.forwardRef(function LayoutSidebar(pr
|
|
19432
19548
|
},
|
19433
19549
|
className: "z-[1]",
|
19434
19550
|
onClick: () => setSidebarOpen(false)
|
19435
|
-
})));
|
19551
|
+
}))));
|
19436
19552
|
});
|
19437
19553
|
|
19438
19554
|
const Top = props => {
|
@@ -19560,7 +19676,7 @@ const Link$2 = /*#__PURE__*/React__default.forwardRef(function Link(props, ref)
|
|
19560
19676
|
name: icon
|
19561
19677
|
}) : null, /*#__PURE__*/React__default.createElement("span", {
|
19562
19678
|
className: "flex flex-grow items-center truncate"
|
19563
|
-
}, children), menu ? /*#__PURE__*/React__default.createElement(IconButton, {
|
19679
|
+
}, children), menu ? ( /*#__PURE__*/React__default.createElement(IconButton, {
|
19564
19680
|
appearance: "discrete",
|
19565
19681
|
icon: "more",
|
19566
19682
|
"aria-label": "More",
|
@@ -19573,12 +19689,12 @@ const Link$2 = /*#__PURE__*/React__default.forwardRef(function Link(props, ref)
|
|
19573
19689
|
event.preventDefault();
|
19574
19690
|
event.stopPropagation();
|
19575
19691
|
}
|
19576
|
-
}) : null, total !== undefined ? /*#__PURE__*/React__default.createElement(Badge, {
|
19692
|
+
})) : null, total !== undefined ? ( /*#__PURE__*/React__default.createElement(Badge, {
|
19577
19693
|
className: cn('flex-shrink-0 flex-grow-0 !font-normal', {
|
19578
19694
|
'group-hover:hidden [[aria-expanded="true"]+&]:hidden ': menu
|
19579
19695
|
}),
|
19580
19696
|
color: "transparent"
|
19581
|
-
}, total) : null));
|
19697
|
+
}, total)) : null));
|
19582
19698
|
});
|
19583
19699
|
|
19584
19700
|
const Section = /*#__PURE__*/React__default.forwardRef(function Navigation2(props, ref) {
|
@@ -19593,9 +19709,9 @@ const Section = /*#__PURE__*/React__default.forwardRef(function Navigation2(prop
|
|
19593
19709
|
"data-taco": "navigation2-section",
|
19594
19710
|
ref: ref,
|
19595
19711
|
role: "none"
|
19596
|
-
}), heading ? /*#__PURE__*/React__default.createElement("span", {
|
19712
|
+
}), heading ? ( /*#__PURE__*/React__default.createElement("span", {
|
19597
19713
|
className: "text-grey-500 mb-px truncate pl-5 text-xs font-bold uppercase leading-8 lg:hidden"
|
19598
|
-
}, heading) : null, /*#__PURE__*/React__default.createElement("ul", {
|
19714
|
+
}, heading)) : null, /*#__PURE__*/React__default.createElement("ul", {
|
19599
19715
|
className: "mb-0 flex flex-col gap-y-px"
|
19600
19716
|
}, children));
|
19601
19717
|
});
|