@economic/taco 2.21.2 → 2.22.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Report/Report.d.ts +21 -0
- package/dist/components/Report/components/Cell/Cell.d.ts +0 -1
- package/dist/components/Report/components/Cell/DisplayCell.d.ts +1 -1
- package/dist/components/Report/components/Cell/util.d.ts +1 -1
- package/dist/components/Report/components/Row/DisplayRow.d.ts +2 -9
- package/dist/components/Report/components/Toolbar/components/Filters/components/Placeholder.d.ts +5 -5
- package/dist/components/Report/listeners/useTableRowActiveListener.d.ts +3 -0
- package/dist/components/Report/styles/util.d.ts +2 -2
- package/dist/components/Report/types.d.ts +1 -3
- package/dist/components/Report/useReport.d.ts +2 -7
- package/dist/components/Table3/types.d.ts +1 -1
- package/dist/esm/index.css +501 -9
- package/dist/esm/packages/taco/src/components/Card/Card.js +1 -1
- package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Group/Group.js +1 -1
- package/dist/esm/packages/taco/src/components/Group/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/Input.js +37 -7
- package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/util.js +3 -1
- package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/Report.js +70 -0
- package/dist/esm/packages/taco/src/components/Report/Report.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Body/Body.js +61 -0
- package/dist/esm/packages/taco/src/components/Report/components/Body/Body.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Body/util.js +22 -0
- package/dist/esm/packages/taco/src/components/Report/components/Body/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/Cell.js +32 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/Cell.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/DisplayCell.js +23 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/DisplayCell.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/GroupedCell.js +58 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/GroupedCell.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/util.js +69 -0
- package/dist/esm/packages/taco/src/components/Report/components/Cell/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Footer.js +34 -0
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Footer.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Summary.js +39 -0
- package/dist/esm/packages/taco/src/components/Report/components/Footer/Summary.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/Header.js +194 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/Header.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Goto.js +28 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Goto.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Menu.js +150 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Menu.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Resizer.js +60 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/Resizer.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/SortIndicator.js +41 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/components/SortIndicator.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/util.js +24 -0
- package/dist/esm/packages/taco/src/components/Report/components/Header/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Actions.js +90 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Actions.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Expansion.js +59 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Expansion.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Selection.js +118 -0
- package/dist/esm/packages/taco/src/components/Report/components/Internal/Selection.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/DisplayRow.js +102 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/DisplayRow.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/Row.js +24 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/Row.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/RowContext.js +10 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/RowContext.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/SkeletonRow.js +62 -0
- package/dist/esm/packages/taco/src/components/Report/components/Row/SkeletonRow.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/Toolbar.js +63 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/Toolbar.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/Filters.js +50 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/Filters.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/ManageFiltersPopover.js +136 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Filter.js +95 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Filter.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterColumn.js +49 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterColumn.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterComparator.js +110 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterComparator.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterValue.js +118 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Placeholder.js +41 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/components/Placeholder.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/util.js +7 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Filters/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/Print.js +123 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/Print.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/PrintDialog.js +88 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Print/PrintDialog.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Search/Search.js +95 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Search/Search.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.js +105 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/Settings.js +103 -0
- package/dist/esm/packages/taco/src/components/Report/components/Toolbar/components/Settings/Settings.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/listeners/useTableRowActiveListener.js +24 -0
- package/dist/esm/packages/taco/src/components/Report/listeners/useTableRowActiveListener.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useColumnPinningStylesheet.js +44 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useColumnPinningStylesheet.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useCssGridStylesheet.js +54 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useCssGridStylesheet.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useStylesheet.js +20 -0
- package/dist/esm/packages/taco/src/components/Report/styles/useStylesheet.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/styles/util.js +61 -0
- package/dist/esm/packages/taco/src/components/Report/styles/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/useReport.js +51 -0
- package/dist/esm/packages/taco/src/components/Report/useReport.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/util/rows.js +10 -0
- package/dist/esm/packages/taco/src/components/Report/util/rows.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/util/useTableGlobalShortcuts.js +39 -0
- package/dist/esm/packages/taco/src/components/Report/util/useTableGlobalShortcuts.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Report/util/useTableRenderer.js +162 -0
- package/dist/esm/packages/taco/src/components/Report/util/useTableRenderer.js.map +1 -0
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +2 -1
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +2 -2
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +6 -7
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +7 -2
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js +6 -6
- package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js +7 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +2 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +6 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +3 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Summary.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Summary.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +9 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js +2 -0
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +3 -3
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +4 -8
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js +19 -14
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +6 -5
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js +18 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnFreezing.js +8 -14
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnFreezing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useEditing.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js +5 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +15 -15
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTablePreset.js +20 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTablePreset.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/util/columns.js +2 -0
- package/dist/esm/packages/taco/src/components/Table3/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js +1 -1
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js +1 -1
- package/dist/esm/packages/taco/src/index.js +7 -6
- package/dist/esm/packages/taco/src/index.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Button.js +2 -1
- package/dist/esm/packages/taco/src/primitives/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnFreezing.js +21 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnFreezing.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFooter.js +8 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFooter.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js +16 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRef.js +17 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRef.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActions.js +11 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActions.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowExpansion.js +9 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowExpansion.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGroups.js +9 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGroups.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSearch.js +38 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSearch.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSettings.js +28 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableSettings.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableRowHeightListener.js +14 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableRowHeightListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSearchListener.js +15 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSearchListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSettingsListener.js +26 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSettingsListener.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/useTable.js +117 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/useTable.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js +30 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/filtering.js +131 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/filtering.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/presets.js +131 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/presets.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/search.js +43 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/search.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/settings.js +22 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/settings.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/setup.js +270 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/setup.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/sorting.js +18 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/sorting.js.map +1 -0
- package/dist/esm/packages/taco/src/utils/dom.js +5 -1
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/keyboard.js +3 -5
- package/dist/esm/packages/taco/src/utils/keyboard.js.map +1 -1
- package/dist/index.css +501 -9
- package/dist/index.d.ts +1 -0
- package/dist/primitives/Table/types.d.ts +2 -2
- package/dist/primitives/Table/useTable/features/useTablePrinting.d.ts +1 -1
- package/dist/primitives/Table/useTable/util/settings.d.ts +1 -1
- package/dist/primitives/Table/useTable/util/sorting.d.ts +1 -1
- package/dist/taco.cjs.development.js +6380 -2731
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/utils/dom.d.ts +1 -0
- package/dist/utils/keyboard.d.ts +0 -1
- package/package.json +2 -2
- package/types.json +4682 -4776
- package/dist/components/Report/features/useReportExport.d.ts +0 -3
@@ -1,4 +1,4 @@
|
|
1
|
-
import { forwardRef, createElement, useRef, memo, cloneElement } from 'react';
|
1
|
+
import { forwardRef, createElement, useLayoutEffect, useRef, memo, cloneElement } from 'react';
|
2
2
|
import cn from 'clsx';
|
3
3
|
import { Icon } from '../Icon/Icon.js';
|
4
4
|
import { useMergedRef } from '../../hooks/useMergedRef.js';
|
@@ -18,6 +18,22 @@ const InputWithoutDeprecatedFeatures = /*#__PURE__*/forwardRef(function InputWit
|
|
18
18
|
...attributes
|
19
19
|
} = props;
|
20
20
|
const internalRef = useMergedRef(ref);
|
21
|
+
// input[type=number] does not support setSelectionRange by default, this adds support
|
22
|
+
useLayoutEffect(() => {
|
23
|
+
if (internalRef.current && type === 'number') {
|
24
|
+
(function (fn) {
|
25
|
+
internalRef.current.setSelectionRange = function (...args) {
|
26
|
+
if (this.type === 'number') {
|
27
|
+
this.type = 'text';
|
28
|
+
fn.apply(this, args);
|
29
|
+
this.type = 'number';
|
30
|
+
} else {
|
31
|
+
fn.apply(this, args);
|
32
|
+
}
|
33
|
+
};
|
34
|
+
})(internalRef.current.setSelectionRange);
|
35
|
+
}
|
36
|
+
}, []);
|
21
37
|
const handleKeyDown = event => {
|
22
38
|
// prevent any external keyboard shortcuts from executing while typing single characters in input
|
23
39
|
if (event.key.length === 1 && !isPressingMetaKey(event)) {
|
@@ -46,24 +62,38 @@ const InputWithoutDeprecatedFeatures = /*#__PURE__*/forwardRef(function InputWit
|
|
46
62
|
'pl-8': !!prefix,
|
47
63
|
'pr-8': !!postfix
|
48
64
|
}, attributes.className);
|
65
|
+
const typeAttributes = {
|
66
|
+
type
|
67
|
+
};
|
68
|
+
if (type === 'number') {
|
69
|
+
typeAttributes.onWheelCapture = event => {
|
70
|
+
// blur is the only way to prevent scroll, so restore focus if it had it
|
71
|
+
if (document.activeElement === event.currentTarget) {
|
72
|
+
requestAnimationFrame(() => {
|
73
|
+
event.target.focus();
|
74
|
+
});
|
75
|
+
}
|
76
|
+
// blur the field on scroll - only way to prevent scroll
|
77
|
+
event.currentTarget.blur();
|
78
|
+
};
|
79
|
+
}
|
49
80
|
return /*#__PURE__*/createElement("div", {
|
50
|
-
className: "relative inline-flex w-full",
|
81
|
+
className: "relative inline-flex h-fit w-full",
|
51
82
|
"data-taco": "input-container",
|
52
83
|
style: {
|
53
84
|
opacity: 0.999
|
54
85
|
}
|
55
|
-
}, /*#__PURE__*/createElement("input", Object.assign({}, attributes, {
|
86
|
+
}, /*#__PURE__*/createElement("input", Object.assign({}, attributes, typeAttributes, {
|
87
|
+
"aria-invalid": invalid,
|
56
88
|
className: className,
|
89
|
+
"data-highlighted": highlighted,
|
57
90
|
"data-taco": "input",
|
58
91
|
onKeyDown: handleKeyDown,
|
59
|
-
"aria-invalid": invalid,
|
60
|
-
"data-highlighted": highlighted,
|
61
92
|
ref: internalRef,
|
62
93
|
style: {
|
63
94
|
paddingLeft: prefixRect ? `${prefixRect.width - 1}px` : undefined,
|
64
95
|
paddingRight: postfixRect ? `${postfixRect.width - 1}px` : undefined
|
65
|
-
}
|
66
|
-
type: type
|
96
|
+
}
|
67
97
|
})), prefix ? /*#__PURE__*/createElement(Affix, {
|
68
98
|
type: "prefix",
|
69
99
|
children: prefix,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../../../../../src/components/Input/Input.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { Icon, IconName } from '../Icon/Icon';\nimport { getButtonStateClasses, getInputClasses } from './util';\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { isPressingMetaKey } from '../../utils/keyboard';\n\nexport type InputWithoutDeprecatedFeaturesProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix'> & {\n /** Draws attention to the input by changing its style and making it visually prominent */\n highlighted?: boolean;\n /* Whether the input is in an invalid state */\n invalid?: boolean;\n postfix?: string | JSX.Element;\n prefix?: string | JSX.Element;\n};\n\nconst validSetSelectionRangeTypes = ['text', 'search', 'url', 'tel', 'password'];\n\nconst InputWithoutDeprecatedFeatures = React.forwardRef(function InputWithoutDeprecatedFeatures(\n props: InputWithoutDeprecatedFeaturesProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const { highlighted, invalid, onKeyDown, postfix, prefix, type = 'text', ...attributes } = props;\n const internalRef = useMergedRef<HTMLInputElement>(ref);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n // prevent any external keyboard shortcuts from executing while typing single characters in input\n if (event.key.length === 1 && !isPressingMetaKey(event)) {\n event.stopPropagation();\n }\n\n // home and end keys only navigate to the start/end of input value if the input container does not scroll\n // if it has scroll height then the browser reverts to native scrolling behaviour only\n // so we manually override it to ensure _our_ desired behaviour remains intact\n // only the 'text', 'search', 'url', 'tel', 'password' input types support setSelectionRange\n if (validSetSelectionRangeTypes.includes(type)) {\n if (!event.shiftKey && (event.key === 'Home' || event.key === 'End')) {\n event.preventDefault();\n const position = event.key === 'End' ? event.currentTarget.value.length : 0;\n event.currentTarget.setSelectionRange(position, position);\n }\n }\n\n if (typeof onKeyDown === 'function') {\n onKeyDown(event);\n }\n };\n\n const prefixRef = React.useRef<HTMLDivElement>(null);\n const prefixRect = useBoundingClientRectListener(prefixRef);\n const postfixRef = React.useRef<HTMLDivElement>(null);\n const postfixRect = useBoundingClientRectListener(postfixRef, [postfix]);\n\n const className = cn(\n getInputClasses(props),\n {\n 'pl-8': !!prefix,\n 'pr-8': !!postfix,\n },\n attributes.className\n );\n\n return (\n <div className=\"relative inline-flex w-full\" data-taco=\"input-container\" style={{ opacity: 0.999 }}>\n <input\n {...attributes}\n className={className}\n data-taco=\"input\"\n onKeyDown={handleKeyDown}\n aria-invalid={invalid}\n data-highlighted={highlighted}\n ref={internalRef}\n style={{\n paddingLeft: prefixRect ? `${prefixRect.width - 1}px` : undefined,\n paddingRight: postfixRect ? `${postfixRect.width - 1}px` : undefined,\n }}\n type={type}\n />\n {prefix ? <Affix type=\"prefix\" children={prefix} disabled={attributes.disabled} ref={prefixRef} /> : null}\n {postfix ? <Affix type=\"postfix\" children={postfix} disabled={attributes.disabled} ref={postfixRef} /> : null}\n </div>\n );\n});\n\ntype AffixProps = {\n children: string | JSX.Element;\n disabled?: boolean;\n type: 'prefix' | 'postfix';\n};\nconst Affix = React.memo(\n React.forwardRef(function Affix(props: AffixProps, ref: React.Ref<HTMLDivElement>) {\n const { children, disabled, type } = props;\n\n return (\n <div\n className={cn(\n 'group absolute top-0 flex h-full items-center justify-center px-2',\n // icon\n '[&_[data-taco=\"icon\"]]:!h-5 [&_[data-taco=\"icon\"]]:!w-5',\n {\n 'text-grey-300': disabled,\n 'text-grey-700': !disabled,\n 'left-0 [&>button]:!-ml-2': type === 'prefix',\n 'right-0 [&>button]:!-mr-2': type === 'postfix',\n }\n )}\n data-affix-type={type}\n ref={ref}>\n {children}\n </div>\n );\n })\n);\n\nexport type InputProps = InputWithoutDeprecatedFeaturesProps & {\n /** Shows a button within the input field */\n button?: React.ReactElement;\n /** Shows an icon within the input field */\n icon?: IconName | JSX.Element;\n};\n\nexport const Input = React.forwardRef(function LegacyInput(props: InputProps, ref: React.Ref<HTMLInputElement>) {\n const { button, icon, ...attributes } = props;\n\n let postfix;\n\n if (button) {\n const disabled = button.props.disabled || attributes.disabled;\n const buttonClassName = cn(\n 'items-center focus:z-10 flex justify-center rounded-l-none rounded-r h-full focus:rounded focus:outline-none',\n getButtonStateClasses(attributes.invalid, disabled),\n button.props.className\n );\n postfix = React.cloneElement(button, {\n className: buttonClassName,\n disabled,\n });\n } else if (icon) {\n postfix = typeof icon === 'string' ? <Icon name={icon} /> : icon;\n }\n\n return <InputWithoutDeprecatedFeatures {...attributes} postfix={attributes.postfix ?? postfix} ref={ref} />;\n});\n"],"names":["validSetSelectionRangeTypes","InputWithoutDeprecatedFeatures","React","props","ref","highlighted","invalid","onKeyDown","postfix","prefix","type","attributes","internalRef","useMergedRef","handleKeyDown","event","key","length","isPressingMetaKey","stopPropagation","includes","shiftKey","preventDefault","position","currentTarget","value","setSelectionRange","prefixRef","prefixRect","useBoundingClientRectListener","postfixRef","postfixRect","className","cn","getInputClasses","style","opacity","paddingLeft","width","undefined","paddingRight","Affix","children","disabled","Input","LegacyInput","button","icon","buttonClassName","getButtonStateClasses","Icon","name","_attributes$postfix"],"mappings":";;;;;;;;AAiBA,MAAMA,2BAA2B,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC;AAEhF,MAAMC,8BAA8B,gBAAGC,UAAgB,CAAC,SAASD,8BAA8BA,CAC3FE,KAA0C,EAC1CC,GAAgC;EAEhC,MAAM;IAAEC,WAAW;IAAEC,OAAO;IAAEC,SAAS;IAAEC,OAAO;IAAEC,MAAM;IAAEC,IAAI,GAAG,MAAM;IAAE,GAAGC;GAAY,GAAGR,KAAK;EAChG,MAAMS,WAAW,GAAGC,YAAY,CAAmBT,GAAG,CAAC;EAEvD,MAAMU,aAAa,GAAIC,KAA4C;;IAE/D,IAAIA,KAAK,CAACC,GAAG,CAACC,MAAM,KAAK,CAAC,IAAI,CAACC,iBAAiB,CAACH,KAAK,CAAC,EAAE;MACrDA,KAAK,CAACI,eAAe,EAAE;;;;;;IAO3B,IAAInB,2BAA2B,CAACoB,QAAQ,CAACV,IAAI,CAAC,EAAE;MAC5C,IAAI,CAACK,KAAK,CAACM,QAAQ,KAAKN,KAAK,CAACC,GAAG,KAAK,MAAM,IAAID,KAAK,CAACC,GAAG,KAAK,KAAK,CA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AAS,CACzB;IACDxB,OAAO,gBAAGN,YAAkB,CAAC4C,MAAM,EAAE;MACjCd,SAAS,EAAEgB,eAAe;MAC1BL;KACH,CAAC;GACL,MAAM,IAAII,IAAI,EAAE;IACbvC,OAAO,GAAG,OAAOuC,IAAI,KAAK,QAAQ,gBAAG7C,cAACgD,IAAI;MAACC,IAAI,EAAEJ;MAAQ,GAAGA,IAAI;;EAGpE,oBAAO7C,cAACD,8BAA8B,oBAAKU,UAAU;IAAEH,OAAO,GAAA4C,mBAAA,GAAEzC,UAAU,CAACH,OAAO,cAAA4C,mBAAA,cAAAA,mBAAA,GAAI5C,OAAO;IAAEJ,GAAG,EAAEA;KAAO;AAC/G,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../../../../../src/components/Input/Input.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { Icon, IconName } from '../Icon/Icon';\nimport { getButtonStateClasses, getInputClasses } from './util';\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { isPressingMetaKey } from '../../utils/keyboard';\n\nexport type InputWithoutDeprecatedFeaturesProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix'> & {\n /** Draws attention to the input by changing its style and making it visually prominent */\n highlighted?: boolean;\n /* Whether the input is in an invalid state */\n invalid?: boolean;\n postfix?: string | JSX.Element;\n prefix?: string | JSX.Element;\n};\n\nconst validSetSelectionRangeTypes = ['text', 'search', 'url', 'tel', 'password'];\n\nconst InputWithoutDeprecatedFeatures = React.forwardRef(function InputWithoutDeprecatedFeatures(\n props: InputWithoutDeprecatedFeaturesProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const { highlighted, invalid, onKeyDown, postfix, prefix, type = 'text', ...attributes } = props;\n const internalRef = useMergedRef<HTMLInputElement>(ref);\n\n // input[type=number] does not support setSelectionRange by default, this adds support\n React.useLayoutEffect(() => {\n if (internalRef.current && type === 'number') {\n (function (fn) {\n internalRef.current.setSelectionRange = function (...args) {\n if (this.type === 'number') {\n this.type = 'text';\n fn.apply(this, args);\n this.type = 'number';\n } else {\n fn.apply(this, args);\n }\n };\n })(internalRef.current.setSelectionRange);\n }\n }, []);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n // prevent any external keyboard shortcuts from executing while typing single characters in input\n if (event.key.length === 1 && !isPressingMetaKey(event)) {\n event.stopPropagation();\n }\n\n // home and end keys only navigate to the start/end of input value if the input container does not scroll\n // if it has scroll height then the browser reverts to native scrolling behaviour only\n // so we manually override it to ensure _our_ desired behaviour remains intact\n // only the 'text', 'search', 'url', 'tel', 'password' input types support setSelectionRange\n if (validSetSelectionRangeTypes.includes(type)) {\n if (!event.shiftKey && (event.key === 'Home' || event.key === 'End')) {\n event.preventDefault();\n const position = event.key === 'End' ? event.currentTarget.value.length : 0;\n event.currentTarget.setSelectionRange(position, position);\n }\n }\n\n if (typeof onKeyDown === 'function') {\n onKeyDown(event);\n }\n };\n\n const prefixRef = React.useRef<HTMLDivElement>(null);\n const prefixRect = useBoundingClientRectListener(prefixRef);\n const postfixRef = React.useRef<HTMLDivElement>(null);\n const postfixRect = useBoundingClientRectListener(postfixRef, [postfix]);\n\n const className = cn(\n getInputClasses(props),\n {\n 'pl-8': !!prefix,\n 'pr-8': !!postfix,\n },\n attributes.className\n );\n\n const typeAttributes: Partial<React.InputHTMLAttributes<HTMLInputElement>> = {\n type,\n };\n\n if (type === 'number') {\n typeAttributes.onWheelCapture = (event: React.WheelEvent<HTMLInputElement>) => {\n // blur is the only way to prevent scroll, so restore focus if it had it\n if (document.activeElement === event.currentTarget) {\n requestAnimationFrame(() => {\n (event.target as HTMLInputElement).focus();\n });\n }\n // blur the field on scroll - only way to prevent scroll\n event.currentTarget.blur();\n };\n }\n\n return (\n <div className=\"relative inline-flex h-fit w-full\" data-taco=\"input-container\" style={{ opacity: 0.999 }}>\n <input\n {...attributes}\n {...typeAttributes}\n aria-invalid={invalid}\n className={className}\n data-highlighted={highlighted}\n data-taco=\"input\"\n onKeyDown={handleKeyDown}\n ref={internalRef}\n style={{\n paddingLeft: prefixRect ? `${prefixRect.width - 1}px` : undefined,\n paddingRight: postfixRect ? `${postfixRect.width - 1}px` : undefined,\n }}\n />\n {prefix ? <Affix type=\"prefix\" children={prefix} disabled={attributes.disabled} ref={prefixRef} /> : null}\n {postfix ? <Affix type=\"postfix\" children={postfix} disabled={attributes.disabled} ref={postfixRef} /> : null}\n </div>\n );\n});\n\ntype AffixProps = {\n children: string | JSX.Element;\n disabled?: boolean;\n type: 'prefix' | 'postfix';\n};\nconst Affix = React.memo(\n React.forwardRef(function Affix(props: AffixProps, ref: React.Ref<HTMLDivElement>) {\n const { children, disabled, type } = props;\n\n return (\n <div\n className={cn(\n 'group absolute top-0 flex h-full items-center justify-center px-2',\n // icon\n '[&_[data-taco=\"icon\"]]:!h-5 [&_[data-taco=\"icon\"]]:!w-5',\n {\n 'text-grey-300': disabled,\n 'text-grey-700': !disabled,\n 'left-0 [&>button]:!-ml-2': type === 'prefix',\n 'right-0 [&>button]:!-mr-2': type === 'postfix',\n }\n )}\n data-affix-type={type}\n ref={ref}>\n {children}\n </div>\n );\n })\n);\n\nexport type InputProps = InputWithoutDeprecatedFeaturesProps & {\n /** Shows a button within the input field */\n button?: React.ReactElement;\n /** Shows an icon within the input field */\n icon?: IconName | JSX.Element;\n};\n\nexport const Input = React.forwardRef(function LegacyInput(props: InputProps, ref: React.Ref<HTMLInputElement>) {\n const { button, icon, ...attributes } = props;\n\n let postfix;\n\n if (button) {\n const disabled = button.props.disabled || attributes.disabled;\n const buttonClassName = cn(\n 'items-center focus:z-10 flex justify-center rounded-l-none rounded-r h-full focus:rounded focus:outline-none',\n getButtonStateClasses(attributes.invalid, disabled),\n button.props.className\n );\n postfix = React.cloneElement(button, {\n className: buttonClassName,\n disabled,\n });\n } else if (icon) {\n postfix = typeof icon === 'string' ? <Icon name={icon} /> : icon;\n }\n\n return <InputWithoutDeprecatedFeatures {...attributes} postfix={attributes.postfix ?? postfix} ref={ref} />;\n});\n"],"names":["validSetSelectionRangeTypes","InputWithoutDeprecatedFeatures","React","props","ref","highlighted","invalid","onKeyDown","postfix","prefix","type","attributes","internalRef","useMergedRef","current","fn","setSelectionRange","args","apply","handleKeyDown","event","key","length","isPressingMetaKey","stopPropagation","includes","shiftKey","preventDefault","position","currentTarget","value","prefixRef","prefixRect","useBoundingClientRectListener","postfixRef","postfixRect","className","cn","getInputClasses","typeAttributes","onWheelCapture","document","activeElement","requestAnimationFrame","target","focus","blur","style","opacity","paddingLeft","width","undefined","paddingRight","Affix","children","disabled","Input","LegacyInput","button","icon","buttonClassName","getButtonStateClasses","Icon","name","_attributes$postfix"],"mappings":";;;;;;;;AAiBA,MAAMA,2BAA2B,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC;AAEhF,MAAMC,8BAA8B,gBAAGC,UAAgB,CAAC,SAASD,8BAA8BA,CAC3FE,KAA0C,EAC1CC,GAAgC;EAEhC,MAAM;IAAEC,WAAW;IAAEC,OAAO;IAAEC,SAAS;IAAEC,OAAO;IAAEC,MAAM;IAAEC,IAAI,GAAG,MAAM;IAAE,GAAGC;GAAY,GAAGR,KAAK;EAChG,MAAMS,WAAW,GAAGC,YAAY,CAAmBT,GAAG,CAAC;;EAGvDF,eAAqB,CAAC;IAClB,IAAIU,WAAW,CAACE,OAAO,IAAIJ,IAAI,KAAK,QAAQ,EAAE;MAC1C,CAAC,UAAUK,EAAE;QACTH,WAAW,CAACE,OAAO,CAACE,iBAAiB,GAAG,UAAU,GAAGC,IAAI;UACrD,IAAI,IAAI,CAACP,IAAI,KAAK,QAAQ,EAAE;YACxB,IAAI,CAACA,IAAI,GAAG,MAAM;YAClBK,EAAE,CAACG,KAAK,CAAC,IAAI,EAAED,IAAI,CAAC;YACpB,IAAI,CAACP,IAAI,GAAG,QAAQ;WACvB,MAAM;YACHK,EAAE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AC/G,CAAC;;;;"}
|
@@ -4,7 +4,9 @@ const getInputClasses = props => {
|
|
4
4
|
const disabled = props.disabled || !!props['aria-disabled'];
|
5
5
|
const readOnly = props.readOnly || !!props['aria-readonly'];
|
6
6
|
const invalid = props.invalid || !!props['aria-invalid'];
|
7
|
-
return cn('peer text-black text-sm border font-normal not-italic no-underline rounded flex items-center leading-6 px-2 relative w-full
|
7
|
+
return cn('peer text-black text-sm border font-normal not-italic no-underline rounded flex items-center leading-6 px-2 relative w-full text-ellipsis transition-colors transition-opacity ease-in min-h-[theme(spacing.8)] focus-visible:yt-focus',
|
8
|
+
// hide the arrow controls on input[type=number]
|
9
|
+
'[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none', {
|
8
10
|
'bg-white': !props.highlighted && !readOnly,
|
9
11
|
// default
|
10
12
|
'border-grey-300 enabled:hover:border-grey-500 disabled:border-grey-200': !invalid,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/Input/util.ts"],"sourcesContent":["import cn from 'clsx';\n\nexport const getInputClasses = props => {\n const disabled = props.disabled || !!props['aria-disabled'];\n const readOnly = props.readOnly || !!props['aria-readonly'];\n const invalid = props.invalid || !!props['aria-invalid'];\n\n return cn(\n 'peer text-black text-sm border font-normal not-italic no-underline rounded flex items-center leading-6 px-2 relative w-full
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/Input/util.ts"],"sourcesContent":["import cn from 'clsx';\n\nexport const getInputClasses = props => {\n const disabled = props.disabled || !!props['aria-disabled'];\n const readOnly = props.readOnly || !!props['aria-readonly'];\n const invalid = props.invalid || !!props['aria-invalid'];\n\n return cn(\n 'peer text-black text-sm border font-normal not-italic no-underline rounded flex items-center leading-6 px-2 relative w-full text-ellipsis transition-colors transition-opacity ease-in min-h-[theme(spacing.8)] focus-visible:yt-focus',\n // hide the arrow controls on input[type=number]\n '[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none',\n {\n 'bg-white': !props.highlighted && !readOnly,\n // default\n 'border-grey-300 enabled:hover:border-grey-500 disabled:border-grey-200': !invalid,\n // disabled\n 'text-opacity-25 cursor-not-allowed placeholder:text-grey-700': disabled,\n // highlighted\n 'bg-yellow-100/50': props.highlighted && disabled,\n 'bg-yellow-100': props.highlighted && !disabled,\n // invalid\n 'border-red-500 enabled:hover:border-red-700 disabled:border-red-500/50': invalid,\n // readOnly\n 'cursor-not-allowed text-black bg-grey-200': readOnly,\n }\n );\n};\n\nexport const getButtonStateClasses = (invalid: boolean | undefined, disabled = false): string => {\n if (invalid) {\n return cn('border border-red-500 group-peer-hover:enabled:border-red-700 transition-colors ease-in', {\n 'border-red-500/30': disabled,\n });\n }\n\n return 'border border-grey-300 group-peer-hover:enabled:border-grey-500 transition-colors transition-opacity ease-in';\n};\n"],"names":["getInputClasses","props","disabled","readOnly","invalid","cn","highlighted","getButtonStateClasses"],"mappings":";;MAEaA,eAAe,GAAGC,KAAK;EAChC,MAAMC,QAAQ,GAAGD,KAAK,CAACC,QAAQ,IAAI,CAAC,CAACD,KAAK,CAAC,eAAe,CAAC;EAC3D,MAAME,QAAQ,GAAGF,KAAK,CAACE,QAAQ,IAAI,CAAC,CAACF,KAAK,CAAC,eAAe,CAAC;EAC3D,MAAMG,OAAO,GAAGH,KAAK,CAACG,OAAO,IAAI,CAAC,CAACH,KAAK,CAAC,cAAc,CAAC;EAExD,OAAOI,EAAE,CACL,wOAAwO;;EAExO,sHAAsH,EACtH;IACI,UAAU,EAAE,CAACJ,KAAK,CAACK,WAAW,IAAI,CAACH,QAAQ;;IAE3C,wEAAwE,EAAE,CAACC,OAAO;;IAElF,8DAA8D,EAAEF,QAAQ;;IAExE,kBAAkB,EAAED,KAAK,CAACK,WAAW,IAAIJ,QAAQ;IACjD,eAAe,EAAED,KAAK,CAACK,WAAW,IAAI,CAACJ,QAAQ;;IAE/C,wEAAwE,EAAEE,OAAO;;IAEjF,2CAA2C,EAAED;GAChD,CACJ;AACL;MAEaI,qBAAqB,GAAGA,CAACH,OAA4B,EAAEF,QAAQ,GAAG,KAAK;EAChF,IAAIE,OAAO,EAAE;IACT,OAAOC,EAAE,CAAC,yFAAyF,EAAE;MACjG,mBAAmB,EAAEH;KACxB,CAAC;;EAGN,OAAO,8GAA8G;AACzH;;;;"}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import { useMergedRef } from '../../hooks/useMergedRef.js';
|
3
|
+
import { FocusScope } from '@react-aria/focus';
|
4
|
+
import { fixedForwardRef } from '../../types.js';
|
5
|
+
import { useReport } from './useReport.js';
|
6
|
+
import { Header } from './components/Header/Header.js';
|
7
|
+
import { Body } from './components/Body/Body.js';
|
8
|
+
import { Footer } from './components/Footer/Footer.js';
|
9
|
+
import { Summary } from './components/Footer/Summary.js';
|
10
|
+
import { Toolbar } from './components/Toolbar/Toolbar.js';
|
11
|
+
import { useStylesheet } from './styles/useStylesheet.js';
|
12
|
+
import { useTableRenderer } from './util/useTableRenderer.js';
|
13
|
+
import { useTableGlobalShortcuts } from './util/useTableGlobalShortcuts.js';
|
14
|
+
|
15
|
+
function Column(_) {
|
16
|
+
return null;
|
17
|
+
}
|
18
|
+
function Group(_) {
|
19
|
+
return null;
|
20
|
+
}
|
21
|
+
const Report = /*#__PURE__*/fixedForwardRef(function Report(props, ref) {
|
22
|
+
var _report$state$groupin;
|
23
|
+
const tableRef = useMergedRef(ref);
|
24
|
+
const report = useReport(props, tableRef);
|
25
|
+
const renderer = useTableRenderer(report.instance, tableRef, props.defaultRowActiveIndex);
|
26
|
+
const stylesheet = useStylesheet(props.id, report.instance);
|
27
|
+
useTableGlobalShortcuts(report.instance, tableRef, renderer.scrollToIndex);
|
28
|
+
const handleFocus = report.meta.rowActive.rowActiveIndex === undefined ? event => {
|
29
|
+
report.meta.rowActive.handleFocus(event, report.length, renderer.scrollToIndex);
|
30
|
+
} : undefined;
|
31
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, stylesheet, /*#__PURE__*/React__default.createElement(Toolbar, {
|
32
|
+
customSettings: props.customSettings,
|
33
|
+
left: props.toolbarLeft,
|
34
|
+
length: report.length,
|
35
|
+
right: props.toolbarRight,
|
36
|
+
scrollToIndex: renderer.scrollToIndex,
|
37
|
+
table: report.instance,
|
38
|
+
tableId: props.id,
|
39
|
+
tableRef: tableRef
|
40
|
+
}), props.toolbarPanel ? /*#__PURE__*/React__default.createElement("div", {
|
41
|
+
className: "mb-4"
|
42
|
+
}, props.toolbarPanel) : undefined, /*#__PURE__*/React__default.createElement(FocusScope, null, /*#__PURE__*/React__default.createElement("table", {
|
43
|
+
id: props.id,
|
44
|
+
"data-taco": "report",
|
45
|
+
"data-table-font-size": report.meta.fontSize.size,
|
46
|
+
"data-table-horizontally-scrolled": report.meta.columnFreezing.isHorizontallyScrolled ? true : undefined,
|
47
|
+
"data-table-pause-hover": report.meta.rowActive.isHoverStatePaused ? true : undefined,
|
48
|
+
"data-table-resizing": report.state.columnSizingInfo.isResizingColumn ? true : undefined,
|
49
|
+
"data-table-row-height": report.meta.rowHeight.height,
|
50
|
+
"data-table-grouped": !!((_report$state$groupin = report.state.grouping) !== null && _report$state$groupin !== void 0 && _report$state$groupin.length),
|
51
|
+
onFocus: handleFocus,
|
52
|
+
onScroll: report.meta.columnFreezing.handleScroll,
|
53
|
+
ref: tableRef,
|
54
|
+
tabIndex: -1
|
55
|
+
}, /*#__PURE__*/React__default.createElement("thead", null, report.instance.getHeaderGroups().map(headerGroup => ( /*#__PURE__*/React__default.createElement("tr", {
|
56
|
+
key: headerGroup.id
|
57
|
+
}, headerGroup.headers.map(Header))))), /*#__PURE__*/React__default.createElement(Body, {
|
58
|
+
length: report.length,
|
59
|
+
table: report.instance,
|
60
|
+
style: renderer.style
|
61
|
+
}, renderer.rows), report.meta.footer.isEnabled ? ( /*#__PURE__*/React__default.createElement("tfoot", null, /*#__PURE__*/React__default.createElement("tr", null, report.instance.getFooterGroups()[0].headers.map(Footer)))) : null), report.meta.footer.isEnabled ? /*#__PURE__*/React__default.createElement(Summary, {
|
62
|
+
length: report.length,
|
63
|
+
table: report.instance
|
64
|
+
}) : null));
|
65
|
+
});
|
66
|
+
Report.Column = Column;
|
67
|
+
Report.Group = Group;
|
68
|
+
|
69
|
+
export { Report };
|
70
|
+
//# sourceMappingURL=Report.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Report.js","sources":["../../../../../../../src/components/Report/Report.tsx"],"sourcesContent":["import React from 'react';\nimport { FocusScope } from '@react-aria/focus';\nimport { fixedForwardRef } from '../../types';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { useReport } from './useReport';\nimport { ReportColumnProps, ReportGroupProps, ReportProps } from './types';\nimport { Header } from './components/Header/Header';\nimport { Body } from './components/Body/Body';\nimport { Footer } from './components/Footer/Footer';\nimport { Summary } from './components/Footer/Summary';\nimport { Toolbar } from './components/Toolbar/Toolbar';\nimport { TableRef } from '../../primitives/Table/types';\nimport { useStylesheet } from './styles/useStylesheet';\nimport { useTableRenderer } from './util/useTableRenderer';\nimport { useTableGlobalShortcuts } from './util/useTableGlobalShortcuts';\nimport './style.css';\n\nfunction Column<TType = unknown>(_: ReportColumnProps<TType>) {\n return null;\n}\n\nfunction Group(_: ReportGroupProps) {\n return null;\n}\n\nexport const Report = fixedForwardRef<TableRef, ReportProps>(function Report<TType = unknown>(\n props: ReportProps<TType>,\n ref: React.Ref<TableRef>\n) {\n const tableRef = useMergedRef<TableRef>(ref);\n const report = useReport<TType>(props, tableRef);\n const renderer = useTableRenderer(report.instance, tableRef, props.defaultRowActiveIndex);\n const stylesheet = useStylesheet(props.id, report.instance);\n useTableGlobalShortcuts(report.instance, tableRef, renderer.scrollToIndex);\n\n const handleFocus =\n report.meta.rowActive.rowActiveIndex === undefined\n ? (event: React.FocusEvent) => {\n report.meta.rowActive.handleFocus(event, report.length, renderer.scrollToIndex);\n }\n : undefined;\n\n return (\n <>\n {stylesheet}\n <Toolbar\n customSettings={props.customSettings}\n left={props.toolbarLeft}\n length={report.length}\n right={props.toolbarRight}\n scrollToIndex={renderer.scrollToIndex}\n table={report.instance}\n tableId={props.id}\n tableRef={tableRef}\n />\n {props.toolbarPanel ? <div className=\"mb-4\">{props.toolbarPanel}</div> : undefined}\n <FocusScope>\n <table\n id={props.id}\n data-taco=\"report\"\n data-table-font-size={report.meta.fontSize.size}\n data-table-horizontally-scrolled={report.meta.columnFreezing.isHorizontallyScrolled ? true : undefined}\n data-table-pause-hover={report.meta.rowActive.isHoverStatePaused ? true : undefined}\n data-table-resizing={report.state.columnSizingInfo.isResizingColumn ? true : undefined}\n data-table-row-height={report.meta.rowHeight.height}\n data-table-grouped={!!report.state.grouping?.length}\n onFocus={handleFocus}\n onScroll={report.meta.columnFreezing.handleScroll}\n ref={tableRef}\n tabIndex={-1}>\n <thead>\n {report.instance.getHeaderGroups().map(headerGroup => (\n <tr key={headerGroup.id}>{headerGroup.headers.map(Header)}</tr>\n ))}\n </thead>\n <Body length={report.length} table={report.instance} style={renderer.style}>\n {renderer.rows}\n </Body>\n {report.meta.footer.isEnabled ? (\n <tfoot>\n <tr>{report.instance.getFooterGroups()[0].headers.map(Footer)}</tr>\n </tfoot>\n ) : null}\n </table>\n {report.meta.footer.isEnabled ? <Summary length={report.length} table={report.instance} /> : null}\n </FocusScope>\n </>\n );\n}) as (<TType = unknown>(props: ReportProps<TType> & React.RefAttributes<TableRef>) => JSX.Element) & {\n Column: typeof Column;\n Group: typeof Group;\n};\nReport.Column = Column;\nReport.Group = Group;\n\nexport * from './types';\n"],"names":["Column","_","Group","Report","fixedForwardRef","props","ref","tableRef","useMergedRef","report","useReport","renderer","useTableRenderer","instance","defaultRowActiveIndex","stylesheet","useStylesheet","id","useTableGlobalShortcuts","scrollToIndex","handleFocus","meta","rowActive","rowActiveIndex","undefined","event","length","React","Toolbar","customSettings","left","toolbarLeft","right","toolbarRight","table","tableId","toolbarPanel","className","FocusScope","fontSize","size","columnFreezing","isHorizontallyScrolled","isHoverStatePaused","state","columnSizingInfo","isResizingColumn","rowHeight","height","_report$state$groupin","grouping","onFocus","onScroll","handleScroll","tabIndex","getHeaderGroups","map","headerGroup","key","headers","Header","Body","style","rows","footer","isEnabled","getFooterGroups","Footer","Summary"],"mappings":";;;;;;;;;;;;;;AAiBA,SAASA,MAAMA,CAAkBC,CAA2B;EACxD,OAAO,IAAI;AACf;AAEA,SAASC,KAAKA,CAACD,CAAmB;EAC9B,OAAO,IAAI;AACf;MAEaE,MAAM,gBAAGC,eAAe,CAAwB,SAASD,MAAMA,CACxEE,KAAyB,EACzBC,GAAwB;;EAExB,MAAMC,QAAQ,GAAGC,YAAY,CAAWF,GAAG,CAAC;EAC5C,MAAMG,MAAM,GAAGC,SAAS,CAAQL,KAAK,EAAEE,QAAQ,CAAC;EAChD,MAAMI,QAAQ,GAAGC,gBAAgB,CAACH,MAAM,CAACI,QAAQ,EAAEN,QAAQ,EAAEF,KAAK,CAACS,qBAAqB,CAAC;EACzF,MAAMC,UAAU,GAAGC,aAAa,CAACX,KAAK,CAACY,EAAE,EAAER,MAAM,CAACI,QAAQ,CAAC;EAC3DK,uBAAuB,CAACT,MAAM,CAACI,QAAQ,EAAEN,QAAQ,EAAEI,QAAQ,CAACQ,aAAa,CAAC;EAE1E,MAAMC,WAAW,GACbX,MAAM,CAACY,IAAI,CAACC,SAAS,CAACC,cAAc,KAAKC,SAAS,GAC3CC,KAAuB;IACpBhB,MAAM,CAACY,IAAI,CAACC,SAAS,CAACF,WAAW,CAACK,KAAK,EAAEhB,MAAM,CAACiB,MAAM,EAAEf,QAAQ,CAACQ,aAAa,CAAC;GAClF,GACDK,SAAS;EAEnB,oBACIG,4DACKZ,UAAU,eACXY,6BAACC,OAAO;IACJC,cAAc,EAAExB,KAAK,CAACwB,cAAc;IACpCC,IAAI,EAAEzB,KAAK,CAAC0B,WAAW;IACvBL,MAAM,EAAEjB,MAAM,CAACiB,MAAM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,EAAEjB,MAAM,CAACiB,MAAM;IAAEQ,KAAK,EAAEzB,MAAM,CAACI,QAAQ;IAAEiD,KAAK,EAAEnD,QAAQ,CAACmD;KAChEnD,QAAQ,CAACoD,IAAI,CACX,EACNtD,MAAM,CAACY,IAAI,CAAC2C,MAAM,CAACC,SAAS,kBACzBtC,yDACIA,yCAAKlB,MAAM,CAACI,QAAQ,CAACqD,eAAe,EAAE,CAAC,CAAC,CAAC,CAACP,OAAO,CAACH,GAAG,CAACW,MAAM,CAAC,CAAM,CAC/D,IACR,IAAI,CACJ,EACP1D,MAAM,CAACY,IAAI,CAAC2C,MAAM,CAACC,SAAS,gBAAGtC,6BAACyC,OAAO;IAAC1C,MAAM,EAAEjB,MAAM,CAACiB,MAAM;IAAEQ,KAAK,EAAEzB,MAAM,CAACI;IAAY,GAAG,IAAI,CACxF,CACd;AAEX,CAAC;AAIDV,MAAM,CAACH,MAAM,GAAGA,MAAM;AACtBG,MAAM,CAACD,KAAK,GAAGA,KAAK;;;;"}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import { useAugmentedFocusManager } from './util.js';
|
3
|
+
|
4
|
+
function Body(props) {
|
5
|
+
const {
|
6
|
+
enableArrowKeyFocusing = false,
|
7
|
+
length,
|
8
|
+
table,
|
9
|
+
...attributes
|
10
|
+
} = props;
|
11
|
+
const ref = React__default.useRef(null);
|
12
|
+
const focusManager = useAugmentedFocusManager();
|
13
|
+
const tableMeta = table.options.meta;
|
14
|
+
// some rows won't have anything focusable in, and we don't want tab to move between rows in that case
|
15
|
+
const focusableElementsInRowCountRef = React__default.useRef(0);
|
16
|
+
const handleKeyDown = event => {
|
17
|
+
if (event.isDefaultPrevented() || event.isPropagationStopped()) {
|
18
|
+
return;
|
19
|
+
}
|
20
|
+
if (tableMeta.rowActive.rowActiveIndex !== undefined) {
|
21
|
+
const isFirstRow = tableMeta.rowActive.rowActiveIndex === 0;
|
22
|
+
const isLastRow = tableMeta.rowActive.rowActiveIndex === length - 1;
|
23
|
+
if (event.key === 'Tab' || enableArrowKeyFocusing && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {
|
24
|
+
tableMeta.rowActive.setHoverStatePaused(true);
|
25
|
+
const focusedElement = event.shiftKey || event.key === 'ArrowLeft' ? focusManager.focusPrevious() : focusManager.focusNext();
|
26
|
+
if (focusedElement) {
|
27
|
+
// override default behaviour, since we're handling focus internally now
|
28
|
+
event.preventDefault();
|
29
|
+
focusableElementsInRowCountRef.current = focusableElementsInRowCountRef.current + 1;
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
if (event.shiftKey || event.key === 'ArrowLeft') {
|
33
|
+
if (!isFirstRow && focusableElementsInRowCountRef.current !== 0) {
|
34
|
+
// there are no previous elements to focus, go up a row or go outside the table
|
35
|
+
// but only if there are actually any focusable elements in the row
|
36
|
+
event.preventDefault();
|
37
|
+
tableMeta.rowActive.setRowActiveIndex(tableMeta.rowActive.rowActiveIndex - 1);
|
38
|
+
focusableElementsInRowCountRef.current = 0;
|
39
|
+
requestAnimationFrame(() => focusManager.focusLast());
|
40
|
+
}
|
41
|
+
} else {
|
42
|
+
if (!isLastRow && focusableElementsInRowCountRef.current !== 0) {
|
43
|
+
// there are no next elements to focus, go down a row or go outside the table
|
44
|
+
// but only if there are actually any focusable elements in the row
|
45
|
+
event.preventDefault();
|
46
|
+
tableMeta.rowActive.setRowActiveIndex(tableMeta.rowActive.rowActiveIndex + 1);
|
47
|
+
focusableElementsInRowCountRef.current = 0;
|
48
|
+
requestAnimationFrame(() => focusManager.focusFirst());
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
};
|
54
|
+
return /*#__PURE__*/React__default.createElement("tbody", Object.assign({}, attributes, {
|
55
|
+
onKeyDown: handleKeyDown,
|
56
|
+
ref: ref
|
57
|
+
}));
|
58
|
+
}
|
59
|
+
|
60
|
+
export { Body };
|
61
|
+
//# sourceMappingURL=Body.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Body.js","sources":["../../../../../../../../../src/components/Report/components/Body/Body.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useAugmentedFocusManager } from './util';\n\ntype BodyProps<TType = unknown> = React.HTMLAttributes<HTMLTableSectionElement> & {\n enableArrowKeyFocusing?: boolean;\n length: number;\n table: ReactTable<TType>;\n};\n\nexport function Body<TType = unknown>(props: BodyProps<TType>) {\n const { enableArrowKeyFocusing = false, length, table, ...attributes } = props;\n const ref = React.useRef<HTMLTableSectionElement>(null);\n const focusManager = useAugmentedFocusManager();\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n\n // some rows won't have anything focusable in, and we don't want tab to move between rows in that case\n const focusableElementsInRowCountRef = React.useRef(0);\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.isDefaultPrevented() || event.isPropagationStopped()) {\n return;\n }\n\n if (tableMeta.rowActive.rowActiveIndex !== undefined) {\n const isFirstRow = tableMeta.rowActive.rowActiveIndex === 0;\n const isLastRow = tableMeta.rowActive.rowActiveIndex === length - 1;\n\n if (event.key === 'Tab' || (enableArrowKeyFocusing && (event.key === 'ArrowLeft' || event.key === 'ArrowRight'))) {\n tableMeta.rowActive.setHoverStatePaused(true);\n\n const focusedElement =\n event.shiftKey || event.key === 'ArrowLeft' ? focusManager.focusPrevious() : focusManager.focusNext();\n\n if (focusedElement) {\n // override default behaviour, since we're handling focus internally now\n event.preventDefault();\n focusableElementsInRowCountRef.current = focusableElementsInRowCountRef.current + 1;\n return;\n }\n\n if (event.shiftKey || event.key === 'ArrowLeft') {\n if (!isFirstRow && focusableElementsInRowCountRef.current !== 0) {\n // there are no previous elements to focus, go up a row or go outside the table\n // but only if there are actually any focusable elements in the row\n event.preventDefault();\n tableMeta.rowActive.setRowActiveIndex(tableMeta.rowActive.rowActiveIndex - 1);\n focusableElementsInRowCountRef.current = 0;\n requestAnimationFrame(() => focusManager.focusLast());\n }\n } else {\n if (!isLastRow && focusableElementsInRowCountRef.current !== 0) {\n // there are no next elements to focus, go down a row or go outside the table\n // but only if there are actually any focusable elements in the row\n event.preventDefault();\n tableMeta.rowActive.setRowActiveIndex(tableMeta.rowActive.rowActiveIndex + 1);\n focusableElementsInRowCountRef.current = 0;\n requestAnimationFrame(() => focusManager.focusFirst());\n }\n }\n }\n }\n };\n\n return <tbody {...attributes} onKeyDown={handleKeyDown} ref={ref} />;\n}\n"],"names":["Body","props","enableArrowKeyFocusing","length","table","attributes","ref","React","useRef","focusManager","useAugmentedFocusManager","tableMeta","options","meta","focusableElementsInRowCountRef","handleKeyDown","event","isDefaultPrevented","isPropagationStopped","rowActive","rowActiveIndex","undefined","isFirstRow","isLastRow","key","setHoverStatePaused","focusedElement","shiftKey","focusPrevious","focusNext","preventDefault","current","setRowActiveIndex","requestAnimationFrame","focusLast","focusFirst","onKeyDown"],"mappings":";;;SAUgBA,IAAIA,CAAkBC,KAAuB;EACzD,MAAM;IAAEC,sBAAsB,GAAG,KAAK;IAAEC,MAAM;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGJ,KAAK;EAC9E,MAAMK,GAAG,GAAGC,cAAK,CAACC,MAAM,CAA0B,IAAI,CAAC;EACvD,MAAMC,YAAY,GAAGC,wBAAwB,EAAE;EAC/C,MAAMC,SAAS,GAAGP,KAAK,CAACQ,OAAO,CAACC,IAA6B;;EAG7D,MAAMC,8BAA8B,GAAGP,cAAK,CAACC,MAAM,CAAC,CAAC,CAAC;EAEtD,MAAMO,aAAa,GAAIC,KAA0B;IAC7C,IAAIA,KAAK,CAACC,kBAAkB,EAAE,IAAID,KAAK,CAACE,oBAAoB,EAAE,EAAE;MAC5D;;IAGJ,IAAIP,SAAS,CAACQ,SAAS,CAACC,cAAc,KAAKC,SAAS,EAAE;MAClD,MAAMC,UAAU,GAAGX,SAAS,CAACQ,SAAS,CAACC,cAAc,KAAK,CAAC;MAC3D,MAAMG,SAAS,GAAGZ,SA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AAMxB,YAAY,CAAC0B,UAAU,EAAE,CAAC;;;;;GAKzE;EAED,oBAAO5B,wDAAWF,UAAU;IAAE+B,SAAS,EAAErB,aAAa;IAAET,GAAG,EAAEA;KAAO;AACxE;;;;"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { useFocusManager } from '@react-aria/focus';
|
2
|
+
|
3
|
+
const FOCUS_MANAGER_OPTIONS = {
|
4
|
+
accept: element => !!element.closest('tr[data-row-active="true"]'),
|
5
|
+
tabbable: true
|
6
|
+
};
|
7
|
+
function useAugmentedFocusManager() {
|
8
|
+
const focusManager = useFocusManager();
|
9
|
+
const focusPrevious = () => focusManager.focusPrevious(FOCUS_MANAGER_OPTIONS);
|
10
|
+
const focusNext = () => focusManager.focusNext(FOCUS_MANAGER_OPTIONS);
|
11
|
+
const focusFirst = () => focusManager.focusFirst(FOCUS_MANAGER_OPTIONS);
|
12
|
+
const focusLast = () => focusManager.focusLast(FOCUS_MANAGER_OPTIONS);
|
13
|
+
return {
|
14
|
+
focusPrevious,
|
15
|
+
focusNext,
|
16
|
+
focusFirst,
|
17
|
+
focusLast
|
18
|
+
};
|
19
|
+
}
|
20
|
+
|
21
|
+
export { useAugmentedFocusManager };
|
22
|
+
//# sourceMappingURL=util.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../../../../../../src/components/Report/components/Body/util.ts"],"sourcesContent":["import { useFocusManager } from '@react-aria/focus';\n\nconst FOCUS_MANAGER_OPTIONS = {\n accept: (element: Element) => !!element.closest('tr[data-row-active=\"true\"]'),\n tabbable: true,\n};\n\nexport function useAugmentedFocusManager() {\n const focusManager = useFocusManager();\n\n const focusPrevious = () => focusManager.focusPrevious(FOCUS_MANAGER_OPTIONS);\n const focusNext = () => focusManager.focusNext(FOCUS_MANAGER_OPTIONS);\n const focusFirst = () => focusManager.focusFirst(FOCUS_MANAGER_OPTIONS);\n const focusLast = () => focusManager.focusLast(FOCUS_MANAGER_OPTIONS);\n\n return {\n focusPrevious,\n focusNext,\n focusFirst,\n focusLast,\n };\n}\n"],"names":["FOCUS_MANAGER_OPTIONS","accept","element","closest","tabbable","useAugmentedFocusManager","focusManager","useFocusManager","focusPrevious","focusNext","focusFirst","focusLast"],"mappings":";;AAEA,MAAMA,qBAAqB,GAAG;EAC1BC,MAAM,EAAGC,OAAgB,IAAK,CAAC,CAACA,OAAO,CAACC,OAAO,CAAC,4BAA4B,CAAC;EAC7EC,QAAQ,EAAE;CACb;SAEeC,wBAAwBA;EACpC,MAAMC,YAAY,GAAGC,eAAe,EAAE;EAEtC,MAAMC,aAAa,GAAGA,MAAMF,YAAY,CAACE,aAAa,CAACR,qBAAqB,CAAC;EAC7E,MAAMS,SAAS,GAAGA,MAAMH,YAAY,CAACG,SAAS,CAACT,qBAAqB,CAAC;EACrE,MAAMU,UAAU,GAAGA,MAAMJ,YAAY,CAACI,UAAU,CAACV,qBAAqB,CAAC;EACvE,MAAMW,SAAS,GAAGA,MAAML,YAAY,CAACK,SAAS,CAACX,qBAAqB,CAAC;EAErE,OAAO;IACHQ,aAAa;IACbC,SAAS;IACTC,UAAU;IACVC;GACH;AACL;;;;"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import { isInternalColumn } from '../../../../primitives/Table/useTable/util/columns.js';
|
3
|
+
import { useSearchHighlighting } from './util.js';
|
4
|
+
import { GroupedCell } from './GroupedCell.js';
|
5
|
+
import { DisplayCell } from './DisplayCell.js';
|
6
|
+
|
7
|
+
function Cell(props) {
|
8
|
+
const {
|
9
|
+
cell,
|
10
|
+
index
|
11
|
+
} = props;
|
12
|
+
const cellRef = React__default.useRef(null);
|
13
|
+
const isHighlighted = useSearchHighlighting(cell, index, cellRef);
|
14
|
+
if ((cell.getIsAggregated() || cell.getIsPlaceholder()) && !isInternalColumn(cell.column.id)) {
|
15
|
+
// we choose not to show aggregated cells in group rows and we don't show
|
16
|
+
// placeholder cells in normal rows (because we don't show the grouped column)
|
17
|
+
// so just straight up abort and return nothing at all - no <td>
|
18
|
+
return null;
|
19
|
+
}
|
20
|
+
const cellProps = {
|
21
|
+
cell,
|
22
|
+
cellRef,
|
23
|
+
isHighlighted
|
24
|
+
};
|
25
|
+
if (cell.getIsGrouped()) {
|
26
|
+
return /*#__PURE__*/React__default.createElement(GroupedCell, Object.assign({}, cellProps));
|
27
|
+
}
|
28
|
+
return /*#__PURE__*/React__default.createElement(DisplayCell, Object.assign({}, cellProps));
|
29
|
+
}
|
30
|
+
|
31
|
+
export { Cell };
|
32
|
+
//# sourceMappingURL=Cell.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Cell.js","sources":["../../../../../../../../../src/components/Report/components/Cell/Cell.tsx"],"sourcesContent":["import React from 'react';\nimport { Cell as ReactTableCell } from '@tanstack/react-table';\nimport { isInternalColumn } from '../../../../primitives/Table/useTable/util/columns';\nimport { GroupedCell } from './GroupedCell';\nimport { DisplayCell } from './DisplayCell';\nimport { useSearchHighlighting } from './util';\n\ntype CellProps<TType = unknown> = {\n cell: ReactTableCell<TType, unknown>;\n index: number;\n};\n\nexport function Cell<TType = unknown>(props: CellProps<TType>) {\n const { cell, index } = props;\n const cellRef = React.useRef<HTMLTableCellElement>(null);\n const isHighlighted = useSearchHighlighting(cell, index, cellRef);\n\n if ((cell.getIsAggregated() || cell.getIsPlaceholder()) && !isInternalColumn(cell.column.id)) {\n // we choose not to show aggregated cells in group rows and we don't show\n // placeholder cells in normal rows (because we don't show the grouped column)\n // so just straight up abort and return nothing at all - no <td>\n return null;\n }\n\n const cellProps = {\n cell,\n cellRef,\n isHighlighted,\n };\n\n if (cell.getIsGrouped()) {\n return <GroupedCell<TType> {...cellProps} />;\n }\n\n return <DisplayCell<TType> {...cellProps} />;\n}\n"],"names":["Cell","props","cell","index","cellRef","React","useRef","isHighlighted","useSearchHighlighting","getIsAggregated","getIsPlaceholder","isInternalColumn","column","id","cellProps","getIsGrouped","GroupedCell","DisplayCell"],"mappings":";;;;;;SAYgBA,IAAIA,CAAkBC,KAAuB;EACzD,MAAM;IAAEC,IAAI;IAAEC;GAAO,GAAGF,KAAK;EAC7B,MAAMG,OAAO,GAAGC,cAAK,CAACC,MAAM,CAAuB,IAAI,CAAC;EACxD,MAAMC,aAAa,GAAGC,qBAAqB,CAACN,IAAI,EAAEC,KAAK,EAAEC,OAAO,CAAC;EAEjE,IAAI,CAACF,IAAI,CAACO,eAAe,EAAE,IAAIP,IAAI,CAACQ,gBAAgB,EAAE,KAAK,CAACC,gBAAgB,CAACT,IAAI,CAACU,MAAM,CAACC,EAAE,CAAC,EAAE;;;;IAI1F,OAAO,IAAI;;EAGf,MAAMC,SAAS,GAAG;IACdZ,IAAI;IACJE,OAAO;IACPG;GACH;EAED,IAAIL,IAAI,CAACa,YAAY,EAAE,EAAE;IACrB,oBAAOV,6BAACW,WAAW,oBAAYF,SAAS,EAAI;;EAGhD,oBAAOT,6BAACY,WAAW,oBAAYH,SAAS,EAAI;AAChD;;;;"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import { flexRender } from '@tanstack/react-table';
|
3
|
+
import { getCellAttributes } from './util.js';
|
4
|
+
|
5
|
+
const DisplayCell = /*#__PURE__*/React__default.memo(function DisplayCell(props) {
|
6
|
+
const {
|
7
|
+
cell,
|
8
|
+
cellRef,
|
9
|
+
isHighlighted
|
10
|
+
} = props;
|
11
|
+
const columnMeta = cell.column.columnDef.meta;
|
12
|
+
const attributes = getCellAttributes(cell, isHighlighted);
|
13
|
+
const isTruncated = !!columnMeta.enableTruncate;
|
14
|
+
const content = flexRender(cell.column.columnDef.cell, cell.getContext());
|
15
|
+
return /*#__PURE__*/React__default.createElement("td", Object.assign({}, attributes, {
|
16
|
+
ref: cellRef
|
17
|
+
}), isTruncated ? /*#__PURE__*/React__default.createElement("span", {
|
18
|
+
className: "truncate print:overflow-visible print:whitespace-normal"
|
19
|
+
}, content) : content);
|
20
|
+
});
|
21
|
+
|
22
|
+
export { DisplayCell };
|
23
|
+
//# sourceMappingURL=DisplayCell.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DisplayCell.js","sources":["../../../../../../../../../src/components/Report/components/Cell/DisplayCell.tsx"],"sourcesContent":["import React from 'react';\nimport { Cell as ReactTableCell, ColumnMeta as ReactTableColumnMeta, flexRender } from '@tanstack/react-table';\nimport { getCellAttributes } from './util';\n\nexport type DisplayCellProps<TType = unknown> = {\n cell: ReactTableCell<TType, unknown>;\n cellRef: React.RefObject<HTMLTableCellElement>;\n isHighlighted?: true | 'current';\n};\n\nexport const DisplayCell = React.memo(function DisplayCell<TType = unknown>(props: DisplayCellProps<TType>) {\n const { cell, cellRef, isHighlighted } = props;\n const columnMeta = cell.column.columnDef.meta as ReactTableColumnMeta<TType, unknown>;\n const attributes = getCellAttributes(cell, isHighlighted);\n const isTruncated = !!columnMeta.enableTruncate;\n const content = flexRender(cell.column.columnDef.cell, cell.getContext());\n\n return (\n <td {...attributes} ref={cellRef}>\n {isTruncated ? <span className=\"truncate print:overflow-visible print:whitespace-normal\">{content}</span> : content}\n </td>\n );\n}) as <TType = unknown>(props: DisplayCellProps<TType>) => JSX.Element;\n"],"names":["DisplayCell","React","memo","props","cell","cellRef","isHighlighted","columnMeta","column","columnDef","meta","attributes","getCellAttributes","isTruncated","enableTruncate","content","flexRender","getContext","ref","className"],"mappings":";;;;MAUaA,WAAW,gBAAGC,cAAK,CAACC,IAAI,CAAC,SAASF,WAAWA,CAAkBG,KAA8B;EACtG,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAEC;GAAe,GAAGH,KAAK;EAC9C,MAAMI,UAAU,GAAGH,IAAI,CAACI,MAAM,CAACC,SAAS,CAACC,IAA4C;EACrF,MAAMC,UAAU,GAAGC,iBAAiB,CAACR,IAAI,EAAEE,aAAa,CAAC;EACzD,MAAMO,WAAW,GAAG,CAAC,CAACN,UAAU,CAACO,cAAc;EAC/C,MAAMC,OAAO,GAAGC,UAAU,CAACZ,IAAI,CAACI,MAAM,CAACC,SAAS,CAACL,IAAI,EAAEA,IAAI,CAACa,UAAU,EAAE,CAAC;EAEzE,oBACIhB,qDAAQU,UAAU;IAAEO,GAAG,EAAEb;MACpBQ,WAAW,gBAAGZ;IAAMkB,SAAS,EAAC;KAA2DJ,OAAO,CAAQ,GAAGA,OAAO,CAClH;AAEb,CAAC;;;;"}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import { flexRender } from '@tanstack/react-table';
|
3
|
+
import { isInternalColumn } from '../../../../primitives/Table/useTable/util/columns.js';
|
4
|
+
import { RowContext } from '../Row/RowContext.js';
|
5
|
+
import { Actions } from '../Internal/Actions.js';
|
6
|
+
import { getCellAttributes } from './util.js';
|
7
|
+
|
8
|
+
function GroupedCell(props) {
|
9
|
+
const {
|
10
|
+
cell,
|
11
|
+
cellRef,
|
12
|
+
isHighlighted
|
13
|
+
} = props;
|
14
|
+
const tableMeta = cell.getContext().table.options.meta;
|
15
|
+
const attributes = getCellAttributes(cell, isHighlighted);
|
16
|
+
const {
|
17
|
+
isHovered,
|
18
|
+
rowIndex
|
19
|
+
} = React__default.useContext(RowContext);
|
20
|
+
const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;
|
21
|
+
const canShowActions = isActiveRow || isHovered && !tableMeta.rowActive.isHoverStatePaused;
|
22
|
+
return /*#__PURE__*/React__default.createElement(MemoedGroupedCell, Object.assign({}, attributes, {
|
23
|
+
cell: cell,
|
24
|
+
cellRef: cellRef,
|
25
|
+
canShowActions: canShowActions,
|
26
|
+
fontSize: tableMeta.fontSize.size,
|
27
|
+
rowActions: tableMeta.rowGroups.rowActionsForGroup
|
28
|
+
}));
|
29
|
+
}
|
30
|
+
const MemoedGroupedCell = /*#__PURE__*/React__default.memo(function MemoedGroupedCell(props) {
|
31
|
+
const {
|
32
|
+
canShowActions,
|
33
|
+
cell,
|
34
|
+
cellRef,
|
35
|
+
fontSize,
|
36
|
+
rowActions,
|
37
|
+
...attributes
|
38
|
+
} = props;
|
39
|
+
const colSpan = cell.row.getVisibleCells().filter(c => !isInternalColumn(c.column.id)).length - 1;
|
40
|
+
const subRows = cell.getContext().row.subRows.map(row => row.original);
|
41
|
+
return /*#__PURE__*/React__default.createElement("td", Object.assign({}, attributes, {
|
42
|
+
ref: cellRef,
|
43
|
+
style: {
|
44
|
+
gridColumn: `span ${colSpan} / span ${colSpan}`
|
45
|
+
}
|
46
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
47
|
+
className: "grow"
|
48
|
+
}, flexRender(cell.column.columnDef.cell, cell.getContext())), rowActions !== null && rowActions !== void 0 && rowActions.length && canShowActions ? ( /*#__PURE__*/React__default.createElement(Actions, {
|
49
|
+
actions: rowActions,
|
50
|
+
actionsLength: 4,
|
51
|
+
data: subRows,
|
52
|
+
fontSize: fontSize,
|
53
|
+
isActiveRow: true
|
54
|
+
})) : null);
|
55
|
+
});
|
56
|
+
|
57
|
+
export { GroupedCell };
|
58
|
+
//# sourceMappingURL=GroupedCell.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GroupedCell.js","sources":["../../../../../../../../../src/components/Report/components/Cell/GroupedCell.tsx"],"sourcesContent":["import React from 'react';\nimport { Cell as ReactTableCell, TableMeta as ReactTableMeta, flexRender } from '@tanstack/react-table';\nimport { RowContext } from '../Row/RowContext';\nimport { getCellAttributes } from './util';\nimport { TableFontSize, TableRowActionGroupRenderer } from '../../../../primitives/Table/types';\nimport { Actions as RowGroupActions } from '../Internal/Actions';\nimport { isInternalColumn } from '../../../../primitives/Table/useTable/util/columns';\n\nexport type GroupedCellProps<TType = unknown> = {\n cell: ReactTableCell<TType, unknown>;\n cellRef: React.RefObject<HTMLTableCellElement>;\n isHighlighted?: true | 'current';\n};\n\nexport function GroupedCell<TType = unknown>(props: GroupedCellProps<TType>) {\n const { cell, cellRef, isHighlighted } = props;\n const tableMeta = cell.getContext().table.options.meta as ReactTableMeta<TType>;\n const attributes = getCellAttributes(cell, isHighlighted);\n\n const { isHovered, rowIndex } = React.useContext(RowContext);\n const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;\n const canShowActions = isActiveRow || (isHovered && !tableMeta.rowActive.isHoverStatePaused);\n\n return (\n <MemoedGroupedCell<TType>\n {...attributes}\n cell={cell}\n cellRef={cellRef}\n canShowActions={canShowActions}\n fontSize={tableMeta.fontSize.size}\n rowActions={tableMeta.rowGroups.rowActionsForGroup}\n />\n );\n}\n\ntype MemoedGroupedCellProps<TType = unknown> = React.TdHTMLAttributes<HTMLTableCellElement> & {\n cell: ReactTableCell<TType, unknown>;\n cellRef: React.RefObject<HTMLTableCellElement>;\n canShowActions: boolean;\n fontSize: TableFontSize;\n rowActions?: TableRowActionGroupRenderer<TType>[];\n};\n\nconst MemoedGroupedCell = React.memo(function MemoedGroupedCell<TType = unknown>(props: MemoedGroupedCellProps<TType>) {\n const { canShowActions, cell, cellRef, fontSize, rowActions, ...attributes } = props;\n\n const colSpan = cell.row.getVisibleCells().filter(c => !isInternalColumn(c.column.id)).length - 1;\n const subRows = cell.getContext().row.subRows.map(row => row.original);\n\n return (\n <td {...attributes} ref={cellRef} style={{ gridColumn: `span ${colSpan} / span ${colSpan}` }}>\n <span className=\"grow\">{flexRender(cell.column.columnDef.cell, cell.getContext())}</span>\n {rowActions?.length && canShowActions ? (\n <RowGroupActions actions={rowActions} actionsLength={4} data={subRows} fontSize={fontSize} isActiveRow />\n ) : null}\n </td>\n );\n}) as <TType = unknown>(props: MemoedGroupedCellProps<TType>) => JSX.Element;\n"],"names":["GroupedCell","props","cell","cellRef","isHighlighted","tableMeta","getContext","table","options","meta","attributes","getCellAttributes","isHovered","rowIndex","React","useContext","RowContext","isActiveRow","rowActive","rowActiveIndex","canShowActions","isHoverStatePaused","MemoedGroupedCell","fontSize","size","rowActions","rowGroups","rowActionsForGroup","memo","colSpan","row","getVisibleCells","filter","c","isInternalColumn","column","id","length","subRows","map","original","ref","style","gridColumn","className","flexR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AG,CAACQ,OAAO,CAACC,GAAG,CAACT,GAAG,IAAIA,GAAG,CAACU,QAAQ,CAAC;EAEtE,oBACI1B,qDAAQJ,UAAU;IAAE+B,GAAG,EAAEtC,OAAO;IAAEuC,KAAK,EAAE;MAAEC,UAAU,UAAUd,kBAAkBA;;mBAC7Ef;IAAM8B,SAAS,EAAC;KAAQC,UAAU,CAAC3C,IAAI,CAACiC,MAAM,CAACW,SAAS,CAAC5C,IAAI,EAAEA,IAAI,CAACI,UAAU,EAAE,CAAC,CAAQ,EACxFmB,UAAU,aAAVA,UAAU,eAAVA,UAAU,CAAEY,MAAM,IAAIjB,cAAc,kBACjCN,6BAACiC,OAAe;IAACC,OAAO,EAAEvB,UAAU;IAAEwB,aAAa,EAAE,CAAC;IAAEC,IAAI,EAAEZ,OAAO;IAAEf,QAAQ,EAAEA,QAAQ;IAAEN,WAAW;IAAG,IACzG,IAAI,CACP;AAEb,CAAC,CAA2E;;;;"}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import { isInternalColumn, isCellHighlighted } from '../../../../primitives/Table/useTable/util/columns.js';
|
3
|
+
|
4
|
+
function getCellAttributes(cell, isHighlighted) {
|
5
|
+
const columnMeta = cell.column.columnDef.meta;
|
6
|
+
const isPinned = cell.column.getIsPinned();
|
7
|
+
const attributes = {
|
8
|
+
'data-cell-align': columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.align,
|
9
|
+
'data-cell-highlighted': isHighlighted,
|
10
|
+
'data-cell-id': cell.column.id,
|
11
|
+
'data-cell-pinned': isPinned ? true : undefined,
|
12
|
+
'data-cell-truncate': columnMeta.enableTruncate ? true : undefined,
|
13
|
+
className: typeof columnMeta.className === 'function' ? columnMeta.className(cell.row.original) : columnMeta.className,
|
14
|
+
style: {}
|
15
|
+
};
|
16
|
+
if (isPinned) {
|
17
|
+
attributes.style[isPinned] = `${cell.column.getStart(isPinned)}px`;
|
18
|
+
}
|
19
|
+
return attributes;
|
20
|
+
}
|
21
|
+
function useSearchHighlighting(cell, index, ref) {
|
22
|
+
const context = cell.getContext();
|
23
|
+
const tableMeta = context.table.options.meta;
|
24
|
+
const columnMeta = cell.column.columnDef.meta;
|
25
|
+
const isHighlighted = React__default.useMemo(() => {
|
26
|
+
if (!cell.column.columnDef.enableGlobalFilter || isInternalColumn(cell.column.id) || cell.getIsAggregated() || cell.getIsPlaceholder()) {
|
27
|
+
return undefined;
|
28
|
+
}
|
29
|
+
let isHighlighted = false;
|
30
|
+
if (context.table.getState().globalFilter) {
|
31
|
+
isHighlighted = isCellHighlighted(context.table.getState().globalFilter, cell.getValue(), columnMeta.dataType);
|
32
|
+
}
|
33
|
+
if (!isHighlighted || tableMeta.search.currentHighlightColumnIndex === undefined) {
|
34
|
+
return undefined;
|
35
|
+
}
|
36
|
+
const [rowActiveIndex, currentColumnIndex] = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex];
|
37
|
+
if (rowActiveIndex === cell.row.index && currentColumnIndex === index) {
|
38
|
+
return 'current';
|
39
|
+
}
|
40
|
+
return true;
|
41
|
+
}, [cell.getValue(), context.table.getState().globalFilter, tableMeta.search.highlightedColumnIndexes.length, tableMeta.search.currentHighlightColumnIndex]);
|
42
|
+
React__default.useEffect(() => {
|
43
|
+
if (ref.current && isHighlighted === 'current') {
|
44
|
+
ref.current.scrollIntoView({
|
45
|
+
block: 'nearest',
|
46
|
+
inline: 'nearest'
|
47
|
+
});
|
48
|
+
setTimeout(() => {
|
49
|
+
if (ref.current) {
|
50
|
+
const tableEl = ref.current.closest('table[data-taco="report"]');
|
51
|
+
setTimeout(() => {
|
52
|
+
const pinnedColumns = tableEl === null || tableEl === void 0 ? void 0 : tableEl.querySelectorAll('thead tr:last-child th[data-cell-pinned="left"]');
|
53
|
+
if (pinnedColumns !== null && pinnedColumns !== void 0 && pinnedColumns.length) {
|
54
|
+
var _pinnedColumns$item;
|
55
|
+
const lastFrozenRect = (_pinnedColumns$item = pinnedColumns.item(pinnedColumns.length - 1)) === null || _pinnedColumns$item === void 0 ? void 0 : _pinnedColumns$item.getBoundingClientRect();
|
56
|
+
if (lastFrozenRect && cell.column.getStart() < lastFrozenRect.right) {
|
57
|
+
tableEl === null || tableEl === void 0 ? void 0 : tableEl.scrollTo(cell.column.getStart() - lastFrozenRect.right, tableEl.scrollTop);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}, 1);
|
61
|
+
}
|
62
|
+
}, 1);
|
63
|
+
}
|
64
|
+
}, [isHighlighted]);
|
65
|
+
return isHighlighted;
|
66
|
+
}
|
67
|
+
|
68
|
+
export { getCellAttributes, useSearchHighlighting };
|
69
|
+
//# sourceMappingURL=util.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../../../../../../src/components/Report/components/Cell/util.ts"],"sourcesContent":["import React from 'react';\nimport { Cell as ReactTableCell, ColumnMeta as ReactTableColumnMeta, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { isCellHighlighted, isInternalColumn } from '../../../../primitives/Table/useTable/util/columns';\n\nexport type DisplayCellProps<TType = unknown> = {\n index: number;\n cell: ReactTableCell<TType, unknown>;\n};\n\nexport function getCellAttributes<TType = unknown>(\n cell: ReactTableCell<TType, unknown>,\n isHighlighted: true | 'current' | undefined\n) {\n const columnMeta = cell.column.columnDef.meta as ReactTableColumnMeta<TType, unknown>;\n\n const isPinned = cell.column.getIsPinned();\n const attributes = {\n 'data-cell-align': columnMeta?.align,\n 'data-cell-highlighted': isHighlighted,\n 'data-cell-id': cell.column.id,\n 'data-cell-pinned': isPinned ? true : undefined,\n 'data-cell-truncate': columnMeta.enableTruncate ? true : undefined,\n className: typeof columnMeta.className === 'function' ? columnMeta.className(cell.row.original) : columnMeta.className,\n style: {},\n };\n\n if (isPinned) {\n attributes.style[isPinned] = `${cell.column.getStart(isPinned)}px`;\n }\n\n return attributes;\n}\n\nexport function useSearchHighlighting<TType = unknown>(\n cell: ReactTableCell<TType, unknown>,\n index: number,\n ref: React.RefObject<HTMLTableCellElement>\n) {\n const context = cell.getContext();\n const tableMeta = context.table.options.meta as ReactTableMeta<TType>;\n const columnMeta = cell.column.columnDef.meta as ReactTableColumnMeta<TType, unknown>;\n\n const isHighlighted: 'current' | boolean | undefined = React.useMemo(() => {\n if (\n !cell.column.columnDef.enableGlobalFilter ||\n isInternalColumn(cell.column.id) ||\n cell.getIsAggregated() ||\n cell.getIsPlaceholder()\n ) {\n return undefined;\n }\n\n let isHighlighted = false;\n\n if (context.table.getState().globalFilter) {\n isHighlighted = isCellHighlighted(context.table.getState().globalFilter, cell.getValue(), columnMeta.dataType);\n }\n\n if (!isHighlighted || tableMeta.search.currentHighlightColumnIndex === undefined) {\n return undefined;\n }\n\n const [rowActiveIndex, currentColumnIndex] =\n tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex];\n\n if (rowActiveIndex === cell.row.index && currentColumnIndex === index) {\n return 'current';\n }\n\n return true;\n }, [\n cell.getValue(),\n context.table.getState().globalFilter,\n tableMeta.search.highlightedColumnIndexes.length,\n tableMeta.search.currentHighlightColumnIndex,\n ]);\n\n React.useEffect(() => {\n if (ref.current && isHighlighted === 'current') {\n ref.current.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n\n setTimeout(() => {\n if (ref.current) {\n const tableEl = ref.current.closest('table[data-taco=\"report\"]');\n\n setTimeout(() => {\n const pinnedColumns = tableEl?.querySelectorAll('thead tr:last-child th[data-cell-pinned=\"left\"]');\n\n if (pinnedColumns?.length) {\n const lastFrozenRect = pinnedColumns.item(pinnedColumns.length - 1)?.getBoundingClientRect();\n\n if (lastFrozenRect && cell.column.getStart() < lastFrozenRect.right) {\n tableEl?.scrollTo(cell.column.getStart() - lastFrozenRect.right, tableEl.scrollTop);\n }\n }\n }, 1);\n }\n }, 1);\n }\n }, [isHighlighted]);\n\n return isHighlighted;\n}\n\nexport function getCurrentRowCellElement(index: number, tableEl: HTMLElement) {\n const cellSelector = `[data-current=\"true\"] [data-column-index=\"${index}\"`;\n return tableEl.querySelector(cellSelector);\n}\n\nexport function scrollColumnIntoView(columnIndex: number, frozenColumnIndex: number, column: HTMLElement, tableEl: HTMLElement) {\n if (frozenColumnIndex !== undefined && columnIndex > frozenColumnIndex) {\n const lastFrozenColumnElement = getCurrentRowCellElement(frozenColumnIndex, tableEl);\n const highlightRef = column?.getBoundingClientRect();\n const lastFrozenRect = lastFrozenColumnElement?.getBoundingClientRect();\n\n // offset the width of frozen columns so that the column being scrolled to is not hidden behind them\n if (highlightRef && lastFrozenRect && highlightRef.left < lastFrozenRect.left + lastFrozenRect.width) {\n const pinnedColumnsWidth = lastFrozenRect.left + lastFrozenRect.width;\n tableEl?.scrollTo(highlightRef.left - pinnedColumnsWidth, tableEl.scrollTop);\n }\n } else {\n column.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n}\n"],"names":["getCellAttributes","cell","isHighlighted","columnMeta","column","columnDef","meta","isPinned","getIsPinned","attributes","align","id","undefined","enableTruncate","className","row","original","style","getStart","useSearchHighlighting","index","ref","context","getContext","tableMeta","table","options","React","useMemo","enableGlobalFilter","isInternalColumn","getIsAggregated","getIsPlaceholder","getState","globalFilter","isCellHighlighted","getValue","dataType","search","currentHighlightColumnIndex","rowActiveIndex","currentColumnIndex","highlightedColumnIndexes","length","useEffect","current","scrollIntoView","block","inline","setTimeout","tableEl","closest","pinnedColumns","querySelectorAll","_pinnedColumns$item","lastFrozenRect","item","getBoundingClientRect","right","scrollTo","scrollTop"],"mappings":";;;SASgBA,iBAAiBA,CAC7BC,IAAoC,EACpCC,aAA2C;EAE3C,MAAMC,UAAU,GAAGF,IAAI,CAACG,MAAM,CAACC,SAAS,CAACC,IAA4C;EAErF,MAAMC,QAAQ,GAAGN,IAAI,CAACG,MAAM,CAACI,WAAW,EAAE;EAC1C,MAAMC,UAAU,GAAG;IACf,iBAAiB,EAAEN,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEO,KAAK;IACpC,uBAAuB,E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