@economic/taco 1.21.6 → 1.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Table2/components/column/Indicator.d.ts +2 -1
- package/dist/components/Table2/components/row/Context.d.ts +17 -11
- package/dist/components/Table2/components/row/Row.d.ts +1 -6
- package/dist/components/Table2/hooks/useShouldPauseHoverState.d.ts +2 -0
- package/dist/components/Table2/hooks/useTable.d.ts +3 -2
- package/dist/esm/packages/taco/src/components/Table2/Table2.js +7 -3
- package/dist/esm/packages/taco/src/components/Table2/Table2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js +21 -15
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js +2 -5
- package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js +44 -15
- package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js +23 -44
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useShouldPauseHoverState.js +19 -0
- package/dist/esm/packages/taco/src/components/Table2/hooks/useShouldPauseHoverState.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js +5 -3
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js +8 -0
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js.map +1 -1
- package/dist/taco.cjs.development.js +129 -90
- 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/package.json +2 -2
- package/types.json +7 -2
@@ -12,5 +12,6 @@ export declare type IndicatorProps = {
|
|
12
12
|
reason: IndicatorReason;
|
13
13
|
columnName: string;
|
14
14
|
mountNode: Element | null;
|
15
|
+
validationErrors: any;
|
15
16
|
};
|
16
|
-
export declare const Indicator: ({ reason, columnName, mountNode }: IndicatorProps) => React.ReactPortal;
|
17
|
+
export declare const Indicator: ({ reason, columnName, mountNode, validationErrors }: IndicatorProps) => React.ReactPortal;
|
@@ -1,16 +1,22 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { SaveHandlerErrorResponse } from '../../types';
|
3
3
|
import { IndicatorReason } from '../column/Indicator';
|
4
|
-
declare type
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
declare type RowContextValue = {
|
5
|
+
isActive: boolean;
|
6
|
+
editMode: {
|
7
|
+
validationErrors: SaveHandlerErrorResponse;
|
8
|
+
setValidationErrors: React.Dispatch<React.SetStateAction<SaveHandlerErrorResponse>>;
|
9
|
+
rowMoveReason: Record<string, IndicatorReason | null>;
|
10
|
+
setRowMoveReason: React.Dispatch<React.SetStateAction<Record<string, IndicatorReason | null>>>;
|
11
|
+
};
|
12
|
+
isHovered: boolean;
|
13
|
+
setIsHovered: React.Dispatch<React.SetStateAction<boolean>>;
|
9
14
|
};
|
10
|
-
declare const RowContext: React.Context<
|
11
|
-
export declare const
|
12
|
-
|
13
|
-
children:
|
14
|
-
|
15
|
-
|
15
|
+
export declare const RowContext: React.Context<RowContextValue>;
|
16
|
+
export declare const RowContextProvider: ({ isActiveRow, children, meta }: {
|
17
|
+
isActiveRow: any;
|
18
|
+
children: any;
|
19
|
+
meta: any;
|
20
|
+
}) => JSX.Element;
|
21
|
+
export declare const useRowContext: () => RowContextValue;
|
16
22
|
export {};
|
@@ -14,14 +14,15 @@ declare module '@tanstack/table-core' {
|
|
14
14
|
enableRowDensity: boolean;
|
15
15
|
rowDensity: RowDensity;
|
16
16
|
setRowDensity: OnChangeFn<RowDensity>;
|
17
|
+
enableRowDragging: boolean;
|
17
18
|
dragging: Record<string, boolean>;
|
18
19
|
setDragging: OnChangeFn<Record<string, boolean>>;
|
19
20
|
enableColumnReordering: boolean;
|
20
21
|
shouldPauseSortingAndFiltering: boolean;
|
21
22
|
setShouldPauseSortingAndFiltering: OnChangeFn<boolean>;
|
23
|
+
shouldPauseHoverState: boolean;
|
24
|
+
setShouldPauseHoverState: OnChangeFn<boolean>;
|
22
25
|
onRowClick?: RowClickHandler<TData>;
|
23
|
-
hoveredRowIndex: number | undefined;
|
24
|
-
setHoveredRowIndex: OnChangeFn<number | undefined>;
|
25
26
|
editMode: useEditMode;
|
26
27
|
dataColumnStartOffset: number;
|
27
28
|
dataColumnEndOffset: number;
|
@@ -95,7 +95,10 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
95
95
|
meta.setActiveRowIndex(0);
|
96
96
|
virtualiser.scrollToOffset(0);
|
97
97
|
} else {
|
98
|
-
meta.moveToPreviousRow(rows, nextIndex =>
|
98
|
+
meta.moveToPreviousRow(rows, nextIndex => {
|
99
|
+
meta.setShouldPauseHoverState(true);
|
100
|
+
virtualiser.scrollToIndex(nextIndex - 1);
|
101
|
+
});
|
99
102
|
}
|
100
103
|
return;
|
101
104
|
} else if (event.key === 'ArrowDown') {
|
@@ -105,6 +108,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
105
108
|
virtualiser.scrollToOffset(virtualiser.totalSize + 1);
|
106
109
|
} else {
|
107
110
|
meta.moveToNextRow(rows, nextIndex => {
|
111
|
+
meta.setShouldPauseHoverState(true);
|
108
112
|
// the virtualiser doesn't always scroll right to the bottom for the last row
|
109
113
|
if (nextIndex === rows.length - 1) {
|
110
114
|
var _tableRef$current;
|
@@ -246,9 +250,9 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
246
250
|
}
|
247
251
|
};
|
248
252
|
let handleMouseLeave;
|
249
|
-
if (meta.
|
253
|
+
if (meta.shouldPauseHoverState) {
|
250
254
|
// sometimes the row's onMouseLeave doesn't trigger, this adds some extra redundancy
|
251
|
-
handleMouseLeave = () => meta.
|
255
|
+
handleMouseLeave = () => meta.setShouldPauseHoverState(false);
|
252
256
|
}
|
253
257
|
const className = cn('bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid auto-rows-max overflow-auto relative rounded group', props.className);
|
254
258
|
const enableSettingsButton = table.options.enablePinning || table.options.enableHiding || meta.enableColumnReordering;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Table2.js","sources":["../../../../../../../src/components/Table2/Table2.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Row as TRow, TableMeta } from '@tanstack/react-table';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { Cell } from './components/column/Cell';\nimport { Header } from './components/column/Header';\nimport { Footer } from './components/column/Footer';\nimport { Table2Props, Table2ColumnProps, Table2ToolbarProps } from './types';\nimport { useTable } from './hooks/useTable';\nimport { useVirtualiser } from './hooks/useVirtualiser';\nimport { Group } from '../Group/Group';\nimport { useGridTemplate } from './hooks/useGridTemplate';\nimport { RowDensityButton } from './components/RowDensityButton';\nimport { ColumnSettingsButton } from './components/ColumnSettingsButton';\nimport { ExpandedRow } from './components/row/ExpandedRow';\nimport { useSeparatedChildren } from './hooks/useSeparatedChildren';\nimport { BatchActionsMenu } from './components/BatchActionsMenu';\nimport { Row } from './components/row/Row';\nimport { FiltersButton } from './components/filters/FiltersButton';\nimport { Search } from './components/Search';\nimport { ShortcutsGuideButton } from './components/ShortcutsGuideButton';\nimport { EditModeButton } from './components/EditModeButton';\n\nexport type Table2Texts = {\n columns: {\n actions: {\n tooltip: string;\n };\n drag: {\n tooltip: string;\n };\n expansion: {\n collapse: string;\n collapseAll: string;\n expand: string;\n expandAll: string;\n };\n select: {\n deselect: string;\n deselectAll: string;\n select: string;\n selectAll: string;\n };\n };\n columnSettings: {\n columnsOther: string;\n columnsOtherDrop: string;\n columnsPinned: string;\n columnsPinnedDrop: string;\n search: string;\n tooltip: string;\n };\n editing: {\n button: string;\n tooltip: string;\n tooltipDisabled: string;\n rowIndicator: {\n rowWillMove: string;\n rowWillBeHidden: string;\n rowWillMoveReasonSearch: string;\n rowWillMoveReasonFilter: string;\n rowWillMoveReasonSorting: string;\n };\n };\n filters: {\n button: string;\n buttons: {\n addFilter: string;\n clearFilters: string;\n };\n comparators: {\n contains: string;\n doesNotContain: string;\n isEqualTo: string;\n isNotEqualTo: string;\n isGreaterThan: string;\n isLessThan: string;\n isBetween: string;\n isOneOf: string;\n isNoneOf: string;\n isAllOf: string;\n isEmpty: string;\n isNotEmpty: string;\n };\n tooltip: string;\n total: string;\n };\n rowDensity: {\n tooltip: string;\n };\n search: {\n placeholder: string;\n };\n shortcuts: {\n tooltip: string;\n search: string;\n filter: string;\n previousRow: string;\n nextRow: string;\n editCell: string;\n previousColumn: string;\n nextColumn: string;\n rowClick: string;\n selectRow: string;\n selectAllRows: string;\n expandRow: string;\n collapseRow: string;\n };\n};\n\nfunction Column<TType = any>(_: Table2ColumnProps<TType>) {\n return null;\n}\nColumn.displayName = 'Table2Column';\n\nfunction Toolbar(props: Table2ToolbarProps) {\n const className = cn('flex-grow', props.className);\n return <div {...props} className={className} />;\n}\nToolbar.displayName = 'Table2Toolbar';\n\nexport type ForwardedTable2WithStatics = React.ForwardRefExoticComponent<Table2Props<any>> & {\n Column: <TType>(props: Table2ColumnProps<TType>) => JSX.Element | null;\n Toolbar: React.FunctionComponent<Table2ToolbarProps>;\n} & (<TType>(props: Table2Props<TType> & { ref?: React.Ref<HTMLDivElement> }) => JSX.Element);\n\nconst Table2 = React.forwardRef(function Table2<TType = any>(props: Table2Props<TType>, ref: React.Ref<HTMLDivElement>) {\n // dom\n const {\n emptyState: EmptyState,\n expandedRowRenderer,\n length = props.data.length,\n loadMore,\n onRowClick,\n _experimentalActionsForTable,\n _experimentalActionsForTableSummary,\n } = props;\n const tableRef = useMergedRef<HTMLDivElement>(ref);\n const timeoutIdRef = React.useRef<NodeJS.Timeout>();\n\n // react-table\n const [columns, toolbar] = useSeparatedChildren(props.children);\n const { rows, table, footers } = useTable(columns, props, tableRef);\n const meta = table.options.meta as TableMeta<TType>;\n\n const { columnVisibility, columnOrder, globalFilter } = table.getState();\n\n // If column visibility or order changes then we turn off the edit mode so that control indexes gets computed\n // when user turns on the editing mode again. This is a temporary solution to make sure the keyboard navigation\n // still keeps working on changes in column visibility, order, or both\n React.useEffect(() => {\n meta.resetFocussableColumnIndexes();\n }, [columnVisibility, columnOrder]);\n\n React.useEffect(() => {\n // Whenever edit mode is turned off we reset the focussableColumnIndexes ref to an empty array so that\n // we don't have stale values, in case column visibility or ordering changes\n if (!meta.editMode.isEditing) {\n meta.resetFocussableColumnIndexes();\n }\n }, [meta.editMode.isEditing]);\n\n React.useEffect(() => {\n return () => clearTimeout(timeoutIdRef.current);\n }, []);\n\n // virtualiser\n const { virtualiser, virtualiserOffsets, setExpandedRowSizes } = useVirtualiser({ rows, table }, tableRef);\n\n // css grid\n const gridTemplateColumns = useGridTemplate(table);\n\n // handlers\n const editButtonRef = React.useRef(null);\n\n // support grid like keyboard navigation between cells\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (document.activeElement === tableRef.current) {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(0);\n virtualiser.scrollToOffset(0);\n } else {\n meta.moveToPreviousRow(rows, nextIndex => virtualiser.scrollToIndex(nextIndex - 1));\n }\n\n return;\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(rows.length - 1);\n virtualiser.scrollToOffset(virtualiser.totalSize + 1);\n } else {\n meta.moveToNextRow(rows, nextIndex => {\n // the virtualiser doesn't always scroll right to the bottom for the last row\n if (nextIndex === rows.length - 1) {\n tableRef.current?.scrollTo(0, tableRef.current.scrollHeight);\n } else {\n virtualiser.scrollToIndex(nextIndex + 2);\n }\n });\n }\n\n return;\n }\n\n const canToggleRowExpansion = table.options.enableExpanding;\n\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta.activeRowIndex]?.toggleExpanded(false);\n }\n }\n return;\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta?.activeRowIndex]?.toggleExpanded(true);\n }\n }\n\n return;\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (onRowClick) {\n onRowClick(rows[meta?.activeRowIndex].original);\n }\n\n return;\n }\n\n if (event.key === ' ') {\n event.preventDefault();\n\n if (table.options.enableRowSelection) {\n rows[meta.activeRowIndex]?.toggleSelected();\n }\n\n return;\n }\n\n if (event.ctrlKey || event.metaKey) {\n event.preventDefault();\n\n if (event.key === 'a') {\n if (table.options.enableRowSelection) {\n table.toggleAllRowsSelected();\n }\n }\n\n return;\n }\n }\n };\n\n let handleBlur;\n\n if (meta.editMode.isEditing) {\n handleBlur = (event: React.FocusEvent) => {\n let elementGainingFocus = event.relatedTarget;\n\n if (elementGainingFocus === undefined) {\n return;\n }\n\n // we might be focusing on a select or a popover that was triggered from inside the table\n // so see if the element gaining focus is inside a portal and look up its controller\n const portalId = elementGainingFocus?.closest('[data-radix-popper-content-wrapper] > :first-child')?.id;\n\n if (portalId) {\n elementGainingFocus = event.currentTarget.querySelector(`[aria-controls=\"${portalId}\"]`) ?? event.relatedTarget;\n }\n\n if (!event.currentTarget?.contains(elementGainingFocus) && elementGainingFocus !== editButtonRef.current) {\n // When we call manually blur on control component while navigating to the next cell, then when this\n // handler is run, the related target is not the next control component and active element is null,\n // that's why we explictly need to check what's the next focussed element in order to figure out whether\n // we should disabled the sorting or not.\n timeoutIdRef.current = setTimeout(() => {\n const parentRow = event.target.closest('[role=\"row\"]');\n const isNewFocussedElementInSameRow = parentRow?.contains(document.activeElement);\n\n // When we manually call blur on control component and focus another component then\n // we have to make sure we\n if (meta.shouldPauseSortingAndFiltering && !isNewFocussedElementInSameRow) {\n // if client side - unpause sorting\n meta.setShouldPauseSortingAndFiltering(false);\n }\n });\n }\n };\n }\n\n // TODO: this can probably be extracted into a hook\n // we only show the pinned shadow on display columns when scrolling is active\n const [scrolled, setScrolled] = React.useState(false);\n\n // extract - infinite loading\n const loadingRef = React.useRef(false);\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !scrolled) {\n setScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && scrolled) {\n setScrolled(false);\n } else if (typeof loadMore === 'function') {\n if (\n event.currentTarget.scrollHeight - event.currentTarget.scrollTop - event.currentTarget.clientHeight < 600 &&\n !loadingRef.current\n ) {\n try {\n const isAllRowsSelected = table.getIsAllRowsSelected();\n loadingRef.current = true;\n await loadMore();\n\n if (isAllRowsSelected) {\n table.toggleAllRowsSelected(true);\n }\n } finally {\n loadingRef.current = false;\n }\n }\n }\n };\n\n let handleMouseLeave;\n\n if (meta.hoveredRowIndex !== undefined) {\n // sometimes the row's onMouseLeave doesn't trigger, this adds some extra redundancy\n handleMouseLeave = () => meta.setHoveredRowIndex(undefined);\n }\n\n const className = cn(\n 'bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid auto-rows-max overflow-auto relative rounded group',\n props.className\n );\n\n const enableSettingsButton = table.options.enablePinning || table.options.enableHiding || meta.enableColumnReordering;\n const hasInternalToolbar =\n enableSettingsButton ||\n meta.editMode.enableEditMode ||\n table.options.enableColumnFilters ||\n meta.enableRowDensity ||\n table.options.enableGlobalFilter;\n const hasToolbar = !!toolbar || hasInternalToolbar;\n\n const hasFooters = React.useMemo(() => {\n const summaryIds = Object.keys(footers);\n const visibleIds = Object.keys(columnVisibility).filter(c => !columnVisibility[c]);\n return summaryIds.length && summaryIds.some(v => !visibleIds.includes(v));\n }, [footers, columnVisibility]);\n\n return (\n <div className=\"-m-0.5 flex h-full w-[calc(100%_+_0.25rem)] flex-col gap-4 overflow-hidden p-0.5\">\n {hasToolbar ? (\n <div className=\"flex flex-wrap gap-2\">\n {toolbar}\n {hasInternalToolbar ? (\n <Group className=\"ml-auto flex-shrink-0 print:hidden\">\n {meta.editMode.enableEditMode ? (\n <EditModeButton\n ref={editButtonRef}\n table={table}\n tableRef={tableRef}\n scrollToIndex={virtualiser.scrollToIndex}\n />\n ) : null}\n {table.options.enableColumnFilters ? <FiltersButton length={length} table={table} /> : null}\n {meta.enableRowDensity ? <RowDensityButton table={table} /> : null}\n {enableSettingsButton ? <ColumnSettingsButton table={table} /> : null}\n {table.options.enableGlobalFilter ? (\n <Search\n disabled={meta.shouldDisableTableActions}\n onSearch={table.setGlobalFilter}\n value={globalFilter}\n />\n ) : null}\n </Group>\n ) : null}\n <ShortcutsGuideButton table={table} />\n </div>\n ) : null}\n <div\n className={className}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onMouseLeave={handleMouseLeave}\n onScroll={handleScroll}\n ref={tableRef}\n role=\"table\"\n style={{\n gridTemplateColumns,\n gridTemplateRows: rows.length ? undefined : '40px',\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n opacity: 0.999,\n }}\n tabIndex={0}>\n <div className=\"contents\" data-taco=\"table2-header\" role=\"rowgroup\">\n {table.getHeaderGroups().map(headerGroup => (\n <div className=\"contents\" key={headerGroup.id} role=\"row\">\n {headerGroup.headers.map((header, columnIndex) => (\n <Header\n key={header.id}\n header={header}\n index={columnIndex}\n isLastColumn={columnIndex === headerGroup.headers.length - 1}\n scrolled={scrolled}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </div>\n ))}\n </div>\n {rows.length ? (\n <div className=\"contents\" data-taco=\"table2-body\" role=\"rowgroup\">\n {virtualiserOffsets.top ? (\n <div style={{ height: virtualiserOffsets.top }} className=\"col-span-full\" />\n ) : null}\n {virtualiser.virtualItems.map(virtualRow => {\n const row = rows[virtualRow.index];\n\n return (\n <React.Fragment key={row.id}>\n <Row className=\"group/row contents\" row={row} rowIndex={virtualRow.index} table={table}>\n {row.getVisibleCells().map((cell, columnIndex) => (\n <Cell\n cell={cell}\n key={`${cell.id}_${cell.getValue()}`}\n index={columnIndex}\n isLastRow={virtualRow.index === rows.length - 1}\n rows={rows}\n rowIndex={virtualRow.index}\n scrolled={scrolled}\n scrollToIndex={virtualiser.scrollToIndex}\n scrollToOffset={virtualiser.scrollToOffset}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </Row>\n {row.getIsExpanded() && expandedRowRenderer ? (\n <ExpandedRow index={virtualRow.index} setSize={setExpandedRowSizes}>\n {expandedRowRenderer(row.original)}\n </ExpandedRow>\n ) : null}\n </React.Fragment>\n );\n })}\n {virtualiserOffsets.bottom ? (\n <div style={{ height: virtualiserOffsets.bottom }} className=\"col-span-full\" />\n ) : null}\n </div>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n {hasFooters ? (\n <div role=\"rowgroup\" className=\"contents\" data-taco=\"table2-footer\">\n {table.getFooterGroups().map(footerGroup => (\n <div key={footerGroup.id} role=\"row\" className=\"contents\">\n {footerGroup.headers.map((footer, cellIndex) => (\n <Footer key={footer.id} footer={footer} index={cellIndex} scrolled={scrolled} table={table}>\n {footers[footer.id]\n ? footers[footer.id](rows.map((row: TRow<TType>) => row.original[footer.id]))\n : null}\n </Footer>\n ))}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n {!!_experimentalActionsForTable &&\n table.options.enableRowSelection &&\n (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) ? (\n <BatchActionsMenu<TType>\n className=\"fixed-center-x bottom-0 z-50 mb-4 print:hidden\"\n actionsForTable={_experimentalActionsForTable}\n summary={_experimentalActionsForTableSummary}\n table={table}\n />\n ) : null}\n </div>\n );\n}) as ForwardedTable2WithStatics;\n\nTable2.Column = Column;\nTable2.Toolbar = Toolbar;\n\nexport { Table2 };\nexport type { Table2Props };\nexport type { Table2ColumnProps, Table2ActionProps, Table2RowActionProps, Table2Settings, Table2ToolbarProps } from './types';\n"],"names":["Column","_","displayName","Toolbar","props","className","cn","React","Table2","forwardRef","ref","emptyState","EmptyState","expandedRowRenderer","length","data","loadMore","onRowClick","_experimentalActionsForTable","_experimentalActionsForTableSummary","tableRef","useMergedRef","timeoutIdRef","useRef","columns","toolbar","useSeparatedChildren","children","rows","table","footers","useTable","meta","options","columnVisibility","columnOrder","globalFilter","getState","useEffect","resetFocussableColumnIndexes","editMode","isEditing","clearTimeout","current","virtualiser","virtualiserOffsets","setExpandedRowSizes","useVirtualiser","gridTemplateColumns","useGridTemplate","editButtonRef","handleKeyDown","event","document","activeElement","key","preventDefault","ctrlKey","metaKey","setActiveRowIndex","scrollToOffset","moveToPreviousRow","nextIndex","scrollToIndex","totalSize","moveToNextRow","scrollTo","scrollHeight","canToggleRowExpansion","enableExpanding","activeRowIndex","toggleExpanded","original","enableRowSelection","toggleSelected","toggleAllRowsSelected","handleBlur","elementGainingFocus","relatedTarget","undefined","portalId","closest","id","currentTarget","querySelector","contains","setTimeout","parentRow","target","isNewFocussedElementInSameRow","shouldPauseSortingAndFiltering","setShouldPauseSortingAndFiltering","scrolled","setScrolled","useState","loadingRef","handleScroll","scrollLeft","scrollTop","clientHeight","isAllRowsSelected","getIsAllRowsSelected","handleMouseLeave","hoveredRowIndex","setHoveredRowIndex","enableSettingsButton","enablePinning","enableHiding","enableColumnReordering","hasInternalToolbar","enableEditMode","enableColumnFilters","enableRowDensity","enableGlobalFilter","hasToolbar","hasFooters","useMemo","summaryIds","Object","keys","visibleIds","filter","c","some","v","includes","Group","EditModeButton","FiltersButton","RowDensityButton","ColumnSettingsButton","Search","disabled","shouldDisableTableActions","onSearch","setGlobalFilter","value","ShortcutsGuideButton","onBlur","onKeyDown","onMouseLeave","onScroll","role","style","gridTemplateRows","opacity","tabIndex","getHeaderGroups","map","headerGroup","headers","header","columnIndex","Header","index","isLastColumn","top","height","virtualItems","virtualRow","row","Fragment","Row","rowIndex","getVisibleCells","cell","Cell","getValue","isLastRow","getIsExpanded","ExpandedRow","setSize","bottom","getFooterGroups","footerGroup","footer","cellIndex","Footer","getIsSomeRowsSelected","BatchActionsMenu","actionsForTable","summary"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8GA,SAASA,MAAM,CAAcC,CAA2B;EACpD,OAAO,IAAI;AACf;AACAD,MAAM,CAACE,WAAW,GAAG,cAAc;AAEnC,SAASC,OAAO,CAACC,KAAyB;EACtC,MAAMC,SAAS,GAAGC,EAAE,CAAC,WAAW,EAAEF,KAAK,CAACC,SAAS,CAAC;EAClD,oBAAOE,sDAASH,KAAK;IAAEC,SAAS,EAAEA;KAAa;AACnD;AACAF,OAAO,CAACD,WAAW,GAAG,eAAe;MAO/BM,MAAM,gBAAGD,cAAK,CAACE,UAAU,CAAC,SAASD,MAAM,CAAcJ,KAAyB,EAAEM,GAA8B;;EAElH,MAAM;IACFC,UAAU,EAAEC,UAAU;IACtBC,mBAAmB;IACnBC,MAAM,GAAGV,KAAK,CAACW,IAAI,CAACD,MAAM;IAC1BE,QAAQ;IACRC,UAAU;IACVC,4BAA4B;IAC5BC;GACH,GAAGf,KAAK;EACT,MAAMgB,QAAQ,GAAGC,YAAY,CAAiBX,GAAG,CAAC;EAClD,MAAMY,YAAY,GAAGf,cAAK,CAACgB,MAAM,EAAkB;;EAGnD,MAAM,CAACC,OAAO,EAAEC,OAAO,CAAC,GAAGC,oBAAoB,CAACtB,KAAK,CAACuB,QAAQ,CAAC;EAC/D,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC;GAAS,GAAGC,QAAQ,CAACP,OAAO,EAAEpB,KAAK,EAAEgB,QAAQ,CAAC;EACnE,MAAMY,IAAI,GAAGH,KAAK,CAACI,OAAO,CAACD,IAAwB;EAEnD,MAAM;IAAEE,gBAAgB;IAAEC,WAAW;IAAEC;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AAW;KAC/CwB,KAAK,CAACgJ,eAAe,EAAE,CAACzB,GAAG,CAAC0B,WAAW,iBACpCvK;IAAKgD,GAAG,EAAEuH,WAAW,CAAC5F,EAAE;IAAE4D,IAAI,EAAC,KAAK;IAACzI,SAAS,EAAC;KAC1CyK,WAAW,CAACxB,OAAO,CAACF,GAAG,CAAC,CAAC2B,MAAM,EAAEC,SAAS,kBACvCzK,6BAAC0K,MAAM;IAAC1H,GAAG,EAAEwH,MAAM,CAAC7F,EAAE;IAAE6F,MAAM,EAAEA,MAAM;IAAErB,KAAK,EAAEsB,SAAS;IAAEpF,QAAQ,EAAEA,QAAQ;IAAE/D,KAAK,EAAEA;KAChFC,OAAO,CAACiJ,MAAM,CAAC7F,EAAE,CAAC,GACbpD,OAAO,CAACiJ,MAAM,CAAC7F,EAAE,CAAC,CAACtD,IAAI,CAACwH,GAAG,CAAEY,GAAgB,IAAKA,GAAG,CAACxF,QAAQ,CAACuG,MAAM,CAAC7F,EAAE,CAAC,CAAC,CAAC,GAC3E,IAAI,CAEjB,CAAC,CAET,CAAC,CACA,GACN,IAAI,CACN,EACL,CAAC,CAAChE,4BAA4B,IAC/BW,KAAK,CAACI,OAAO,CAACwC,kBAAkB,KAC/B5C,KAAK,CAACqJ,qBAAqB,EAAE,IAAIrJ,KAAK,CAACwE,oBAAoB,EAAE,CAAC,gBAC3D9F,6BAAC4K,gBAAgB;IACb9K,SAAS,EAAC,gDAAgD;IAC1D+K,eAAe,EAAElK,4BAA4B;IAC7CmK,OAAO,EAAElK,mCAAmC;IAC5CU,KAAK,EAAEA;IACT,GACF,IAAI,CACN;AAEd,CAAC;AAEDrB,MAAM,CAACR,MAAM,GAAGA,MAAM;AACtBQ,MAAM,CAACL,OAAO,GAAGA,OAAO;;;;"}
|
1
|
+
{"version":3,"file":"Table2.js","sources":["../../../../../../../src/components/Table2/Table2.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Row as TRow, TableMeta } from '@tanstack/react-table';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { Cell } from './components/column/Cell';\nimport { Header } from './components/column/Header';\nimport { Footer } from './components/column/Footer';\nimport { Table2Props, Table2ColumnProps, Table2ToolbarProps } from './types';\nimport { useTable } from './hooks/useTable';\nimport { useVirtualiser } from './hooks/useVirtualiser';\nimport { Group } from '../Group/Group';\nimport { useGridTemplate } from './hooks/useGridTemplate';\nimport { RowDensityButton } from './components/RowDensityButton';\nimport { ColumnSettingsButton } from './components/ColumnSettingsButton';\nimport { ExpandedRow } from './components/row/ExpandedRow';\nimport { useSeparatedChildren } from './hooks/useSeparatedChildren';\nimport { BatchActionsMenu } from './components/BatchActionsMenu';\nimport { Row } from './components/row/Row';\nimport { FiltersButton } from './components/filters/FiltersButton';\nimport { Search } from './components/Search';\nimport { ShortcutsGuideButton } from './components/ShortcutsGuideButton';\nimport { EditModeButton } from './components/EditModeButton';\n\nexport type Table2Texts = {\n columns: {\n actions: {\n tooltip: string;\n };\n drag: {\n tooltip: string;\n };\n expansion: {\n collapse: string;\n collapseAll: string;\n expand: string;\n expandAll: string;\n };\n select: {\n deselect: string;\n deselectAll: string;\n select: string;\n selectAll: string;\n };\n };\n columnSettings: {\n columnsOther: string;\n columnsOtherDrop: string;\n columnsPinned: string;\n columnsPinnedDrop: string;\n search: string;\n tooltip: string;\n };\n editing: {\n button: string;\n tooltip: string;\n tooltipDisabled: string;\n rowIndicator: {\n rowWillMove: string;\n rowWillBeHidden: string;\n rowWillMoveReasonSearch: string;\n rowWillMoveReasonFilter: string;\n rowWillMoveReasonSorting: string;\n };\n };\n filters: {\n button: string;\n buttons: {\n addFilter: string;\n clearFilters: string;\n };\n comparators: {\n contains: string;\n doesNotContain: string;\n isEqualTo: string;\n isNotEqualTo: string;\n isGreaterThan: string;\n isLessThan: string;\n isBetween: string;\n isOneOf: string;\n isNoneOf: string;\n isAllOf: string;\n isEmpty: string;\n isNotEmpty: string;\n };\n tooltip: string;\n total: string;\n };\n rowDensity: {\n tooltip: string;\n };\n search: {\n placeholder: string;\n };\n shortcuts: {\n tooltip: string;\n search: string;\n filter: string;\n previousRow: string;\n nextRow: string;\n editCell: string;\n previousColumn: string;\n nextColumn: string;\n rowClick: string;\n selectRow: string;\n selectAllRows: string;\n expandRow: string;\n collapseRow: string;\n };\n};\n\nfunction Column<TType = any>(_: Table2ColumnProps<TType>) {\n return null;\n}\nColumn.displayName = 'Table2Column';\n\nfunction Toolbar(props: Table2ToolbarProps) {\n const className = cn('flex-grow', props.className);\n return <div {...props} className={className} />;\n}\nToolbar.displayName = 'Table2Toolbar';\n\nexport type ForwardedTable2WithStatics = React.ForwardRefExoticComponent<Table2Props<any>> & {\n Column: <TType>(props: Table2ColumnProps<TType>) => JSX.Element | null;\n Toolbar: React.FunctionComponent<Table2ToolbarProps>;\n} & (<TType>(props: Table2Props<TType> & { ref?: React.Ref<HTMLDivElement> }) => JSX.Element);\n\nconst Table2 = React.forwardRef(function Table2<TType = any>(props: Table2Props<TType>, ref: React.Ref<HTMLDivElement>) {\n // dom\n const {\n emptyState: EmptyState,\n expandedRowRenderer,\n length = props.data.length,\n loadMore,\n onRowClick,\n _experimentalActionsForTable,\n _experimentalActionsForTableSummary,\n } = props;\n const tableRef = useMergedRef<HTMLDivElement>(ref);\n const timeoutIdRef = React.useRef<NodeJS.Timeout>();\n\n // react-table\n const [columns, toolbar] = useSeparatedChildren(props.children);\n const { rows, table, footers } = useTable(columns, props, tableRef);\n const meta = table.options.meta as TableMeta<TType>;\n\n const { columnVisibility, columnOrder, globalFilter } = table.getState();\n\n // If column visibility or order changes then we turn off the edit mode so that control indexes gets computed\n // when user turns on the editing mode again. This is a temporary solution to make sure the keyboard navigation\n // still keeps working on changes in column visibility, order, or both\n React.useEffect(() => {\n meta.resetFocussableColumnIndexes();\n }, [columnVisibility, columnOrder]);\n\n React.useEffect(() => {\n // Whenever edit mode is turned off we reset the focussableColumnIndexes ref to an empty array so that\n // we don't have stale values, in case column visibility or ordering changes\n if (!meta.editMode.isEditing) {\n meta.resetFocussableColumnIndexes();\n }\n }, [meta.editMode.isEditing]);\n\n React.useEffect(() => {\n return () => clearTimeout(timeoutIdRef.current);\n }, []);\n\n // virtualiser\n const { virtualiser, virtualiserOffsets, setExpandedRowSizes } = useVirtualiser({ rows, table }, tableRef);\n\n // css grid\n const gridTemplateColumns = useGridTemplate(table);\n\n // handlers\n const editButtonRef = React.useRef(null);\n\n // support grid like keyboard navigation between cells\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (document.activeElement === tableRef.current) {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(0);\n virtualiser.scrollToOffset(0);\n } else {\n meta.moveToPreviousRow(rows, nextIndex => {\n meta.setShouldPauseHoverState(true);\n virtualiser.scrollToIndex(nextIndex - 1);\n });\n }\n\n return;\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(rows.length - 1);\n virtualiser.scrollToOffset(virtualiser.totalSize + 1);\n } else {\n meta.moveToNextRow(rows, nextIndex => {\n meta.setShouldPauseHoverState(true);\n\n // the virtualiser doesn't always scroll right to the bottom for the last row\n if (nextIndex === rows.length - 1) {\n tableRef.current?.scrollTo(0, tableRef.current.scrollHeight);\n } else {\n virtualiser.scrollToIndex(nextIndex + 2);\n }\n });\n }\n\n return;\n }\n\n const canToggleRowExpansion = table.options.enableExpanding;\n\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta.activeRowIndex]?.toggleExpanded(false);\n }\n }\n return;\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta?.activeRowIndex]?.toggleExpanded(true);\n }\n }\n\n return;\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (onRowClick) {\n onRowClick(rows[meta?.activeRowIndex].original);\n }\n\n return;\n }\n\n if (event.key === ' ') {\n event.preventDefault();\n\n if (table.options.enableRowSelection) {\n rows[meta.activeRowIndex]?.toggleSelected();\n }\n\n return;\n }\n\n if (event.ctrlKey || event.metaKey) {\n event.preventDefault();\n\n if (event.key === 'a') {\n if (table.options.enableRowSelection) {\n table.toggleAllRowsSelected();\n }\n }\n\n return;\n }\n }\n };\n\n let handleBlur;\n\n if (meta.editMode.isEditing) {\n handleBlur = (event: React.FocusEvent) => {\n let elementGainingFocus = event.relatedTarget;\n\n if (elementGainingFocus === undefined) {\n return;\n }\n\n // we might be focusing on a select or a popover that was triggered from inside the table\n // so see if the element gaining focus is inside a portal and look up its controller\n const portalId = elementGainingFocus?.closest('[data-radix-popper-content-wrapper] > :first-child')?.id;\n\n if (portalId) {\n elementGainingFocus = event.currentTarget.querySelector(`[aria-controls=\"${portalId}\"]`) ?? event.relatedTarget;\n }\n\n if (!event.currentTarget?.contains(elementGainingFocus) && elementGainingFocus !== editButtonRef.current) {\n // When we call manually blur on control component while navigating to the next cell, then when this\n // handler is run, the related target is not the next control component and active element is null,\n // that's why we explictly need to check what's the next focussed element in order to figure out whether\n // we should disabled the sorting or not.\n timeoutIdRef.current = setTimeout(() => {\n const parentRow = event.target.closest('[role=\"row\"]');\n const isNewFocussedElementInSameRow = parentRow?.contains(document.activeElement);\n\n // When we manually call blur on control component and focus another component then\n // we have to make sure we\n if (meta.shouldPauseSortingAndFiltering && !isNewFocussedElementInSameRow) {\n // if client side - unpause sorting\n meta.setShouldPauseSortingAndFiltering(false);\n }\n });\n }\n };\n }\n\n // TODO: this can probably be extracted into a hook\n // we only show the pinned shadow on display columns when scrolling is active\n const [scrolled, setScrolled] = React.useState(false);\n\n // extract - infinite loading\n const loadingRef = React.useRef(false);\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !scrolled) {\n setScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && scrolled) {\n setScrolled(false);\n } else if (typeof loadMore === 'function') {\n if (\n event.currentTarget.scrollHeight - event.currentTarget.scrollTop - event.currentTarget.clientHeight < 600 &&\n !loadingRef.current\n ) {\n try {\n const isAllRowsSelected = table.getIsAllRowsSelected();\n loadingRef.current = true;\n await loadMore();\n\n if (isAllRowsSelected) {\n table.toggleAllRowsSelected(true);\n }\n } finally {\n loadingRef.current = false;\n }\n }\n }\n };\n\n let handleMouseLeave;\n\n if (meta.shouldPauseHoverState) {\n // sometimes the row's onMouseLeave doesn't trigger, this adds some extra redundancy\n handleMouseLeave = () => meta.setShouldPauseHoverState(false);\n }\n\n const className = cn(\n 'bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid auto-rows-max overflow-auto relative rounded group',\n props.className\n );\n\n const enableSettingsButton = table.options.enablePinning || table.options.enableHiding || meta.enableColumnReordering;\n const hasInternalToolbar =\n enableSettingsButton ||\n meta.editMode.enableEditMode ||\n table.options.enableColumnFilters ||\n meta.enableRowDensity ||\n table.options.enableGlobalFilter;\n const hasToolbar = !!toolbar || hasInternalToolbar;\n\n const hasFooters = React.useMemo(() => {\n const summaryIds = Object.keys(footers);\n const visibleIds = Object.keys(columnVisibility).filter(c => !columnVisibility[c]);\n return summaryIds.length && summaryIds.some(v => !visibleIds.includes(v));\n }, [footers, columnVisibility]);\n\n return (\n <div className=\"-m-0.5 flex h-full w-[calc(100%_+_0.25rem)] flex-col gap-4 overflow-hidden p-0.5\">\n {hasToolbar ? (\n <div className=\"flex flex-wrap gap-2\">\n {toolbar}\n {hasInternalToolbar ? (\n <Group className=\"ml-auto flex-shrink-0 print:hidden\">\n {meta.editMode.enableEditMode ? (\n <EditModeButton\n ref={editButtonRef}\n table={table}\n tableRef={tableRef}\n scrollToIndex={virtualiser.scrollToIndex}\n />\n ) : null}\n {table.options.enableColumnFilters ? <FiltersButton length={length} table={table} /> : null}\n {meta.enableRowDensity ? <RowDensityButton table={table} /> : null}\n {enableSettingsButton ? <ColumnSettingsButton table={table} /> : null}\n {table.options.enableGlobalFilter ? (\n <Search\n disabled={meta.shouldDisableTableActions}\n onSearch={table.setGlobalFilter}\n value={globalFilter}\n />\n ) : null}\n </Group>\n ) : null}\n <ShortcutsGuideButton table={table} />\n </div>\n ) : null}\n <div\n className={className}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onMouseLeave={handleMouseLeave}\n onScroll={handleScroll}\n ref={tableRef}\n role=\"table\"\n style={{\n gridTemplateColumns,\n gridTemplateRows: rows.length ? undefined : '40px',\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n opacity: 0.999,\n }}\n tabIndex={0}>\n <div className=\"contents\" data-taco=\"table2-header\" role=\"rowgroup\">\n {table.getHeaderGroups().map(headerGroup => (\n <div className=\"contents\" key={headerGroup.id} role=\"row\">\n {headerGroup.headers.map((header, columnIndex) => (\n <Header\n key={header.id}\n header={header}\n index={columnIndex}\n isLastColumn={columnIndex === headerGroup.headers.length - 1}\n scrolled={scrolled}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </div>\n ))}\n </div>\n {rows.length ? (\n <div className=\"contents\" data-taco=\"table2-body\" role=\"rowgroup\">\n {virtualiserOffsets.top ? (\n <div style={{ height: virtualiserOffsets.top }} className=\"col-span-full\" />\n ) : null}\n {virtualiser.virtualItems.map(virtualRow => {\n const row = rows[virtualRow.index];\n\n return (\n <React.Fragment key={row.id}>\n <Row className=\"group/row contents\" row={row} rowIndex={virtualRow.index} table={table}>\n {row.getVisibleCells().map((cell, columnIndex) => (\n <Cell\n cell={cell}\n key={`${cell.id}_${cell.getValue()}`}\n index={columnIndex}\n isLastRow={virtualRow.index === rows.length - 1}\n rows={rows}\n rowIndex={virtualRow.index}\n scrolled={scrolled}\n scrollToIndex={virtualiser.scrollToIndex}\n scrollToOffset={virtualiser.scrollToOffset}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </Row>\n {row.getIsExpanded() && expandedRowRenderer ? (\n <ExpandedRow index={virtualRow.index} setSize={setExpandedRowSizes}>\n {expandedRowRenderer(row.original)}\n </ExpandedRow>\n ) : null}\n </React.Fragment>\n );\n })}\n {virtualiserOffsets.bottom ? (\n <div style={{ height: virtualiserOffsets.bottom }} className=\"col-span-full\" />\n ) : null}\n </div>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n {hasFooters ? (\n <div role=\"rowgroup\" className=\"contents\" data-taco=\"table2-footer\">\n {table.getFooterGroups().map(footerGroup => (\n <div key={footerGroup.id} role=\"row\" className=\"contents\">\n {footerGroup.headers.map((footer, cellIndex) => (\n <Footer key={footer.id} footer={footer} index={cellIndex} scrolled={scrolled} table={table}>\n {footers[footer.id]\n ? footers[footer.id](rows.map((row: TRow<TType>) => row.original[footer.id]))\n : null}\n </Footer>\n ))}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n {!!_experimentalActionsForTable &&\n table.options.enableRowSelection &&\n (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) ? (\n <BatchActionsMenu<TType>\n className=\"fixed-center-x bottom-0 z-50 mb-4 print:hidden\"\n actionsForTable={_experimentalActionsForTable}\n summary={_experimentalActionsForTableSummary}\n table={table}\n />\n ) : null}\n </div>\n );\n}) as ForwardedTable2WithStatics;\n\nTable2.Column = Column;\nTable2.Toolbar = Toolbar;\n\nexport { Table2 };\nexport type { Table2Props };\nexport type { Table2ColumnProps, Table2ActionProps, Table2RowActionProps, Table2Settings, Table2ToolbarProps } from './types';\n"],"names":["Column","_","displayName","Toolbar","props","className","cn","React","Table2","forwardRef","ref","emptyState","EmptyState","expandedRowRenderer","length","data","loadMore","onRowClick","_experimentalActionsForTable","_experimentalActionsForTableSummary","tableRef","useMergedRef","timeoutIdRef","useRef","columns","toolbar","useSeparatedChildren","children","rows","table","footers","useTable","meta","options","columnVisibility","columnOrder","globalFilter","getState","useEffect","resetFocussableColumnIndexes","editMode","isEditing","clearTimeout","current","virtualiser","virtualiserOffsets","setExpandedRowSizes","useVirtualiser","gridTemplateColumns","useGridTemplate","editButtonRef","handleKeyDown","event","document","activeElement","key","preventDefault","ctrlKey","metaKey","setActiveRowIndex","scrollToOffset","moveToPreviousRow","nextIndex","setShouldPauseHoverState","scrollToIndex","totalSize","moveToNextRow","scrollTo","scrollHeight","canToggleRowExpansion","enableExpanding","activeRowIndex","toggleExpanded","original","enableRowSelection","toggleSelected","toggleAllRowsSelected","handleBlur","elementGainingFocus","relatedTarget","undefined","portalId","closest","id","currentTarget","querySelector","contains","setTimeout","parentRow","target","isNewFocussedElementInSameRow","shouldPauseSortingAndFiltering","setShouldPauseSortingAndFiltering","scrolled","setScrolled","useState","loadingRef","handleScroll","scrollLeft","scrollTop","clientHeight","isAllRowsSelected","getIsAllRowsSelected","handleMouseLeave","shouldPauseHoverState","enableSettingsButton","enablePinning","enableHiding","enableColumnReordering","hasInternalToolbar","enableEditMode","enableColumnFilters","enableRowDensity","enableGlobalFilter","hasToolbar","hasFooters","useMemo","summaryIds","Object","keys","visibleIds","filter","c","some","v","includes","Group","EditModeButton","FiltersButton","RowDensityButton","ColumnSettingsButton","Search","disabled","shouldDisableTableActions","onSearch","setGlobalFilter","value","ShortcutsGuideButton","onBlur","onKeyDown","onMouseLeave","onScroll","role","style","gridTemplateRows","opacity","tabIndex","getHeaderGroups","map","headerGroup","headers","header","columnIndex","Header","index","isLastColumn","top","height","virtualItems","virtualRow","row","Fragment","Row","rowIndex","getVisibleCells","cell","Cell","getValue","isLastRow","getIsExpanded","ExpandedRow","setSize","bottom","getFooterGroups","footerGroup","footer","cellIndex","Footer","getIsSomeRowsSelected","BatchActionsMenu","actionsForTable","summary"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8GA,SAASA,MAAM,CAAcC,CAA2B;EACpD,OAAO,IAAI;AACf;AACAD,MAAM,CAACE,WAAW,GAAG,cAAc;AAEnC,SAASC,OAAO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AC1H,GAAG,EAAEwH,MAAM,CAAC5F,EAAE;IAAE4F,MAAM,EAAEA,MAAM;IAAErB,KAAK,EAAEsB,SAAS;IAAEnF,QAAQ,EAAEA,QAAQ;IAAEhE,KAAK,EAAEA;KAChFC,OAAO,CAACiJ,MAAM,CAAC5F,EAAE,CAAC,GACbrD,OAAO,CAACiJ,MAAM,CAAC5F,EAAE,CAAC,CAACvD,IAAI,CAACwH,GAAG,CAAEY,GAAgB,IAAKA,GAAG,CAACvF,QAAQ,CAACsG,MAAM,CAAC5F,EAAE,CAAC,CAAC,CAAC,GAC3E,IAAI,CAEjB,CAAC,CAET,CAAC,CACA,GACN,IAAI,CACN,EACL,CAAC,CAACjE,4BAA4B,IAC/BW,KAAK,CAACI,OAAO,CAACyC,kBAAkB,KAC/B7C,KAAK,CAACqJ,qBAAqB,EAAE,IAAIrJ,KAAK,CAACyE,oBAAoB,EAAE,CAAC,gBAC3D/F,6BAAC4K,gBAAgB;IACb9K,SAAS,EAAC,gDAAgD;IAC1D+K,eAAe,EAAElK,4BAA4B;IAC7CmK,OAAO,EAAElK,mCAAmC;IAC5CU,KAAK,EAAEA;IACT,GACF,IAAI,CACN;AAEd,CAAC;AAEDrB,MAAM,CAACR,MAAM,GAAGA,MAAM;AACtBQ,MAAM,CAACL,OAAO,GAAGA,OAAO;;;;"}
|
@@ -5,13 +5,13 @@ import { Input } from '../../../Input/Input.js';
|
|
5
5
|
import { Datepicker } from '../../../Datepicker/Datepicker.js';
|
6
6
|
import { _catch } from '../../../../../../../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js';
|
7
7
|
import { flexRender } from '@tanstack/react-table';
|
8
|
+
import { useRowContext } from '../row/Context.js';
|
8
9
|
import { isInternalColumn } from '../../utilities/columns.js';
|
9
10
|
import { getCellSizingClasses, isKeyboardFocusableElement, getCellAlignmentClasses } from '../../utilities/cell.js';
|
10
11
|
import { ColumnBase } from './Base.js';
|
11
12
|
import { Switch } from '../../../Switch/Switch.js';
|
12
13
|
import { globalFilterFn, columnFilterFn } from '../../utilities/filterFn.js';
|
13
14
|
import { MOVE_DIR } from '../../hooks/useEditMode.js';
|
14
|
-
import { useRowContext } from '../row/Context.js';
|
15
15
|
import { IndicatorReason, Indicator } from './Indicator.js';
|
16
16
|
import { ValidationError } from './ValidationError.js';
|
17
17
|
import { hasChanged, willRowMoveAfterSorting } from './utils.js';
|
@@ -36,8 +36,11 @@ const Cell = function Cell(props) {
|
|
36
36
|
focussableColumnIndexes: allFocussableColumnIndexes
|
37
37
|
} = meta;
|
38
38
|
const {
|
39
|
-
|
40
|
-
|
39
|
+
editMode: {
|
40
|
+
validationErrors,
|
41
|
+
rowMoveReason
|
42
|
+
},
|
43
|
+
isHovered: isHoveredRow
|
41
44
|
} = useRowContext();
|
42
45
|
const hasValidationErrorsInRow = !!validationErrors;
|
43
46
|
const internalRef = React__default.useRef(null);
|
@@ -45,7 +48,6 @@ const Cell = function Cell(props) {
|
|
45
48
|
const disableTruncation = (_cell$column$columnDe = cell.column.columnDef.meta) === null || _cell$column$columnDe === void 0 ? void 0 : _cell$column$columnDe.disableTruncation;
|
46
49
|
const cellClassName = (_cell$column$columnDe2 = cell.column.columnDef.meta) === null || _cell$column$columnDe2 === void 0 ? void 0 : _cell$column$columnDe2.className;
|
47
50
|
const isActiveRow = meta.activeRowIndex === rowIndex;
|
48
|
-
const isHoveredRow = meta.hoveredRowIndex === rowIndex;
|
49
51
|
const isPinned = !!cell.column.getIsPinned();
|
50
52
|
const isDragging = meta.dragging[cell.row.id];
|
51
53
|
const isSelected = cell.row.getIsSelected();
|
@@ -57,7 +59,7 @@ const Cell = function Cell(props) {
|
|
57
59
|
const isEditingThisRow = meta.editMode.isEditing && isActiveRow;
|
58
60
|
const canEditThisCell = isEditingThisRow && isDataColumn;
|
59
61
|
const isEditingThisCell = canEditThisCell && meta.editMode.columnIndex === index;
|
60
|
-
const isHoveringThisRowWhileEditing = meta.editMode.isEditing && isHoveredRow;
|
62
|
+
const isHoveringThisRowWhileEditing = meta.editMode.isEditing && isHoveredRow && !meta.shouldPauseHoverState;
|
61
63
|
const isIndicatorVisible = Object.keys(rowMoveReason).length > 0;
|
62
64
|
React__default.useEffect(() => {
|
63
65
|
// Adds padding to the table so that indicator doesn't get cropped
|
@@ -74,8 +76,8 @@ const Cell = function Cell(props) {
|
|
74
76
|
'border-b': !isLastRow,
|
75
77
|
'sticky z-[1]': isPinned,
|
76
78
|
// use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating
|
77
|
-
'bg-white': !isActiveRow && !isSelected
|
78
|
-
'bg-grey-100': !isActiveRow && !isSelected &&
|
79
|
+
'bg-white': !isActiveRow && !isSelected,
|
80
|
+
'group-hover/row:bg-grey-100': !isActiveRow && !isSelected && !meta.shouldPauseHoverState,
|
79
81
|
'bg-grey-200 group-hover/row:bg-grey-200': isActiveRow && !isSelected,
|
80
82
|
'bg-blue-100': isSelected,
|
81
83
|
'!wcag-blue-500': isDragging,
|
@@ -256,7 +258,7 @@ const Cell = function Cell(props) {
|
|
256
258
|
} else {
|
257
259
|
moveRow(MOVE_DIR.PREV);
|
258
260
|
}
|
259
|
-
meta.
|
261
|
+
meta.setShouldPauseHoverState(true);
|
260
262
|
return;
|
261
263
|
}
|
262
264
|
if (!detailModeEditing && event.key === 'ArrowDown') {
|
@@ -272,7 +274,7 @@ const Cell = function Cell(props) {
|
|
272
274
|
} else {
|
273
275
|
moveRow(MOVE_DIR.NEXT);
|
274
276
|
}
|
275
|
-
meta.
|
277
|
+
meta.setShouldPauseHoverState(true);
|
276
278
|
return;
|
277
279
|
}
|
278
280
|
};
|
@@ -319,10 +321,13 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
319
321
|
table
|
320
322
|
} = props;
|
321
323
|
const {
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
324
|
+
editMode: {
|
325
|
+
validationErrors,
|
326
|
+
setValidationErrors,
|
327
|
+
rowMoveReason,
|
328
|
+
setRowMoveReason
|
329
|
+
},
|
330
|
+
isHovered
|
326
331
|
} = useRowContext();
|
327
332
|
const controlRef = useMergedRef(ref);
|
328
333
|
const cellId = cell.column.id;
|
@@ -334,7 +339,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
334
339
|
globalFilter
|
335
340
|
} = table.getState();
|
336
341
|
const [state, setState] = React__default.useState(value);
|
337
|
-
const isHoveringAnotherRowWhileEditing = meta.editMode.isEditing && meta.activeRowIndex !== rowIndex &&
|
342
|
+
const isHoveringAnotherRowWhileEditing = meta.editMode.isEditing && meta.activeRowIndex !== rowIndex && isHovered;
|
338
343
|
const hasValidationError = !isHoveringAnotherRowWhileEditing && !!cellValidationError;
|
339
344
|
// On each save, the initialValue will be set to the new value of the cell
|
340
345
|
const initialValue = React__default.useRef(value);
|
@@ -515,7 +520,8 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
515
520
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, indicatorReason !== null && /*#__PURE__*/React__default.createElement(Indicator, {
|
516
521
|
reason: indicatorReason,
|
517
522
|
columnName: String(cell.column.columnDef.header),
|
518
|
-
mountNode: indicatorMountNode
|
523
|
+
mountNode: indicatorMountNode,
|
524
|
+
validationErrors: validationErrors
|
519
525
|
}), /*#__PURE__*/React__default.createElement("span", {
|
520
526
|
className: "relative flex-grow"
|
521
527
|
}, controlComponent, hasValidationError && /*#__PURE__*/React__default.createElement(ValidationError, null, String(cellValidationError))));
|