@economic/taco 1.20.0 → 1.21.1
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/Provider/Localization.d.ts +21 -5
- package/dist/components/Table2/Table2.d.ts +21 -5
- package/dist/components/Table2/components/row/Context.d.ts +3 -2
- package/dist/components/Table2/hooks/useTable.d.ts +2 -1
- package/dist/components/Table2/types.d.ts +2 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +21 -5
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/Table2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/ShortcutsGuideButton.js +20 -14
- package/dist/esm/packages/taco/src/components/Table2/components/ShortcutsGuideButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js +60 -42
- 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/Header.js +3 -3
- package/dist/esm/packages/taco/src/components/Table2/components/column/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js +7 -7
- 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 +2 -2
- 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 +3 -3
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js +4 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js +5 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useSeparatedChildren.js +2 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useSeparatedChildren.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js +4 -2
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/types.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js +15 -13
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js.map +1 -1
- package/dist/taco.cjs.development.js +145 -94
- 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 +99 -22
@@ -37,7 +37,7 @@ const Cell = function Cell(props) {
|
|
37
37
|
} = meta;
|
38
38
|
const {
|
39
39
|
validationErrors,
|
40
|
-
|
40
|
+
rowMoveReason
|
41
41
|
} = useRowContext();
|
42
42
|
const hasValidationErrorsInRow = !!validationErrors;
|
43
43
|
const internalRef = React__default.useRef(null);
|
@@ -58,19 +58,10 @@ const Cell = function Cell(props) {
|
|
58
58
|
const canEditThisCell = isEditingThisRow && isDataColumn;
|
59
59
|
const isEditingThisCell = canEditThisCell && meta.editMode.columnIndex === index;
|
60
60
|
const isHoveringThisRowWhileEditing = meta.editMode.isEditing && isHoveredRow;
|
61
|
-
|
62
|
-
React__default.useEffect(() => {
|
63
|
-
if (isActiveRow && internalRef.current) {
|
64
|
-
internalRef.current.scrollIntoView({
|
65
|
-
behavior: 'smooth',
|
66
|
-
block: 'nearest',
|
67
|
-
inline: 'nearest'
|
68
|
-
});
|
69
|
-
}
|
70
|
-
}, [isActiveRow, hasValidationErrorsInRow]);
|
61
|
+
const isIndicatorVisible = Object.keys(rowMoveReason).length > 0;
|
71
62
|
React__default.useEffect(() => {
|
72
63
|
// Adds padding to the table so that indicator doesn't get cropped
|
73
|
-
if (
|
64
|
+
if (isIndicatorVisible && isLastRow) {
|
74
65
|
var _tableRef$current;
|
75
66
|
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.classList.add('pb-4');
|
76
67
|
}
|
@@ -78,10 +69,10 @@ const Cell = function Cell(props) {
|
|
78
69
|
var _tableRef$current2;
|
79
70
|
return (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.classList.remove('pb-4');
|
80
71
|
};
|
81
|
-
}, [
|
72
|
+
}, [isIndicatorVisible, isLastRow]);
|
82
73
|
const className = cn({
|
83
74
|
'border-b': !isLastRow,
|
84
|
-
'sticky z-
|
75
|
+
'sticky z-[1]': isPinned,
|
85
76
|
// use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating
|
86
77
|
'bg-white': !isActiveRow && !isSelected && !isHoveredRow,
|
87
78
|
'bg-grey-100': !isActiveRow && !isSelected && isHoveredRow,
|
@@ -90,11 +81,13 @@ const Cell = function Cell(props) {
|
|
90
81
|
'!wcag-blue-500': isDragging,
|
91
82
|
'[&>*]:!grayscale [&_.bg-white]:!bg-grey-100': !isEditingThisRow && isHoveringThisRowWhileEditing,
|
92
83
|
'!bg-red-100': hasValidationErrorsInRow,
|
93
|
-
'z-[
|
94
|
-
|
95
|
-
|
96
|
-
'
|
97
|
-
'border-
|
84
|
+
'z-[1]': isPinned && isActiveRow,
|
85
|
+
// First column should have higher z-index so that row indicator always show on top of the cell
|
86
|
+
// control components.
|
87
|
+
'z-[2]': isPinned && isActiveRow && index === 0,
|
88
|
+
'border-blue !border-y-2 border-x-0': isIndicatorVisible,
|
89
|
+
'border-l-2 rounded-l': isIndicatorVisible && index === 0,
|
90
|
+
'border-r-2 rounded-r': isIndicatorVisible && index === lastColumnIndex
|
98
91
|
}, getCellSizingClasses((_table$options$meta = table.options.meta) === null || _table$options$meta === void 0 ? void 0 : _table$options$meta.rowDensity, (isEditingThisRow || isHoveringThisRowWhileEditing) && hasCellControl), typeof cellClassName === 'function' ? cellClassName(cell.row) : cellClassName);
|
99
92
|
const handleMouseDown = event => {
|
100
93
|
// only detect left clicks
|
@@ -131,6 +124,9 @@ const Cell = function Cell(props) {
|
|
131
124
|
role: 'cell'
|
132
125
|
};
|
133
126
|
const [detailModeEditing, setDetailModeEditing] = React__default.useState(false);
|
127
|
+
const detailModeClassName = cn({
|
128
|
+
'!shadow-[0_0_0_4px_rgba(0,99,255,0.25)]': detailModeEditing
|
129
|
+
});
|
134
130
|
// reset the editing state when we move column
|
135
131
|
React__default.useEffect(() => {
|
136
132
|
if (meta.editMode.columnIndex !== index) {
|
@@ -185,11 +181,7 @@ const Cell = function Cell(props) {
|
|
185
181
|
if (event.key === 'Enter') {
|
186
182
|
event.preventDefault();
|
187
183
|
const input = control;
|
188
|
-
if (detailModeEditing) {
|
189
|
-
var _input$select;
|
190
|
-
input === null || input === void 0 ? void 0 : (_input$select = input.select) === null || _input$select === void 0 ? void 0 : _input$select.call(input);
|
191
|
-
setDetailModeEditing(false);
|
192
|
-
} else {
|
184
|
+
if (!detailModeEditing) {
|
193
185
|
var _input$setSelectionRa, _input$value, _input$value2;
|
194
186
|
(_input$setSelectionRa = input.setSelectionRange) === null || _input$setSelectionRa === void 0 ? void 0 : _input$setSelectionRa.call(input, (_input$value = input.value) === null || _input$value === void 0 ? void 0 : _input$value.length, (_input$value2 = input.value) === null || _input$value2 === void 0 ? void 0 : _input$value2.length);
|
195
187
|
setDetailModeEditing(true);
|
@@ -199,10 +191,17 @@ const Cell = function Cell(props) {
|
|
199
191
|
}
|
200
192
|
// Don't exit edit mode if the target of the escape isn't a child of the cell (e.g. if its a popover).
|
201
193
|
if (event.key === 'Escape' && event.currentTarget.contains(control)) {
|
202
|
-
var _tableRef$current3;
|
203
194
|
event.preventDefault();
|
204
|
-
|
205
|
-
(
|
195
|
+
const input = control;
|
196
|
+
if (detailModeEditing) {
|
197
|
+
var _input$select;
|
198
|
+
input === null || input === void 0 ? void 0 : (_input$select = input.select) === null || _input$select === void 0 ? void 0 : _input$select.call(input);
|
199
|
+
setDetailModeEditing(false);
|
200
|
+
} else {
|
201
|
+
var _tableRef$current3;
|
202
|
+
meta.editMode.toggleEditing(false);
|
203
|
+
(_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : _tableRef$current3.focus();
|
204
|
+
}
|
206
205
|
return;
|
207
206
|
}
|
208
207
|
if (!detailModeEditing && event.key === 'ArrowLeft' || event.key === 'Tab' && event.shiftKey) {
|
@@ -227,7 +226,6 @@ const Cell = function Cell(props) {
|
|
227
226
|
}
|
228
227
|
if (!detailModeEditing && event.key === 'ArrowRight' || event.key === 'Tab' && !event.shiftKey) {
|
229
228
|
event.preventDefault();
|
230
|
-
const isLastRow = rowIndex === rows.length - 1;
|
231
229
|
const isLastColumn = index === lastDataColumnIndex;
|
232
230
|
if (event.ctrlKey || event.metaKey) {
|
233
231
|
// If the current active column is the last column then we don't do any thing so that focus
|
@@ -280,6 +278,7 @@ const Cell = function Cell(props) {
|
|
280
278
|
};
|
281
279
|
}
|
282
280
|
return /*#__PURE__*/React__default.createElement(ColumnBase, Object.assign({}, attributes), /*#__PURE__*/React__default.createElement(EditingCell, {
|
281
|
+
detailModeClassName: detailModeClassName,
|
283
282
|
cell: cell,
|
284
283
|
cellRef: internalRef,
|
285
284
|
columnIndex: index,
|
@@ -304,11 +303,12 @@ const Cell = function Cell(props) {
|
|
304
303
|
}, flexRender(cell.column.columnDef.cell, cell.getContext())));
|
305
304
|
};
|
306
305
|
const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
307
|
-
var _cell$column$columnDe4, _cell$column$columnDe5, _cellRef$current, _cellRef$current$pare;
|
306
|
+
var _cell$column$columnDe4, _cell$column$columnDe5, _cellRef$current, _cellRef$current$pare, _rowMoveReason$cellId;
|
308
307
|
const {
|
309
308
|
cell,
|
310
309
|
cellRef,
|
311
310
|
columnIndex,
|
311
|
+
detailModeClassName,
|
312
312
|
isEditingThisCell = false,
|
313
313
|
onSave: handleSave,
|
314
314
|
rowIndex,
|
@@ -318,7 +318,8 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
318
318
|
const {
|
319
319
|
validationErrors,
|
320
320
|
setValidationErrors,
|
321
|
-
|
321
|
+
rowMoveReason,
|
322
|
+
setRowMoveReason
|
322
323
|
} = useRowContext();
|
323
324
|
const controlRef = useMergedRef(ref);
|
324
325
|
const cellId = cell.column.id;
|
@@ -330,7 +331,6 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
330
331
|
globalFilter
|
331
332
|
} = table.getState();
|
332
333
|
const [state, setState] = React__default.useState(value);
|
333
|
-
const [rowMoveReason, setRowMoveReason] = React__default.useState(null);
|
334
334
|
const isHoveringAnotherRowWhileEditing = meta.editMode.isEditing && meta.activeRowIndex !== rowIndex && meta.hoveredRowIndex === rowIndex;
|
335
335
|
const showValidationError = !isHoveringAnotherRowWhileEditing && !!cellValidationError;
|
336
336
|
// On each save, the initialValue will be set to the new value of the cell
|
@@ -353,6 +353,15 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
353
353
|
[cellId]: newValue
|
354
354
|
};
|
355
355
|
return Promise.resolve(handleSave(updatedRow, cellId)).then(function () {
|
356
|
+
// If sorting is paused then update the last sorted or filtered rows to store the newly updated row
|
357
|
+
if (meta.shouldPauseSortingAndFiltering) {
|
358
|
+
meta.lastSortedOrFilteredRows.current = meta.lastSortedOrFilteredRows.current.map(row => {
|
359
|
+
if (row.id === cell.row.id) {
|
360
|
+
row.original = updatedRow;
|
361
|
+
}
|
362
|
+
return row;
|
363
|
+
});
|
364
|
+
}
|
356
365
|
// Reset error if save was successful
|
357
366
|
setValidationErrors(null);
|
358
367
|
});
|
@@ -399,7 +408,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
399
408
|
}, [state]);
|
400
409
|
const showIndicator = () => {
|
401
410
|
var _table$getState$sorti;
|
402
|
-
let willRowMoveReason =
|
411
|
+
let willRowMoveReason = null;
|
403
412
|
const isFilteredByGlobalFilter = Object.values({
|
404
413
|
...rowValues,
|
405
414
|
[cellId]: state
|
@@ -414,15 +423,21 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
414
423
|
} else if (!willRowMoveReason && cell.column.getIsSorted() && willRowMoveAfterSorting(state, cell, rowIndex, table.getRowModel().rows, !!((_table$getState$sorti = table.getState().sorting.find(s => s.id === cell.column.id)) !== null && _table$getState$sorti !== void 0 && _table$getState$sorti.desc))) {
|
415
424
|
willRowMoveReason = IndicatorReason.SORTING;
|
416
425
|
}
|
417
|
-
if (willRowMoveReason !==
|
426
|
+
if (willRowMoveReason !== null) {
|
418
427
|
meta.setShouldPauseSortingAndFiltering(true);
|
419
|
-
setRowMoveReason(
|
420
|
-
|
428
|
+
setRowMoveReason({
|
429
|
+
[cellId]: willRowMoveReason
|
430
|
+
});
|
421
431
|
}
|
422
432
|
};
|
423
433
|
const hideIndicator = () => {
|
424
|
-
setRowMoveReason(
|
425
|
-
|
434
|
+
setRowMoveReason(prevState => {
|
435
|
+
const newState = {
|
436
|
+
...prevState
|
437
|
+
};
|
438
|
+
delete newState[cellId];
|
439
|
+
return newState;
|
440
|
+
});
|
426
441
|
};
|
427
442
|
const cellControl = (_cell$column$columnDe4 = cell.column.columnDef.meta) === null || _cell$column$columnDe4 === void 0 ? void 0 : _cell$column$columnDe4.control;
|
428
443
|
const attributes = {
|
@@ -447,12 +462,14 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
447
462
|
ref: controlRef,
|
448
463
|
setValue: setState,
|
449
464
|
value: state,
|
450
|
-
'data-inline-editing-component': 'true'
|
465
|
+
'data-inline-editing-component': 'true',
|
466
|
+
className: detailModeClassName
|
451
467
|
}, cell.row.original);
|
452
468
|
} else {
|
453
469
|
switch (cellControl) {
|
454
470
|
case 'datepicker':
|
455
471
|
controlComponent = /*#__PURE__*/React__default.createElement(Datepicker, Object.assign({}, attributes, {
|
472
|
+
className: detailModeClassName,
|
456
473
|
onBlur: event => {
|
457
474
|
const newDate = event.detail;
|
458
475
|
saveIfChanged(newDate);
|
@@ -466,7 +483,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
466
483
|
break;
|
467
484
|
case 'switch':
|
468
485
|
controlComponent = /*#__PURE__*/React__default.createElement(Switch, Object.assign({}, attributes, {
|
469
|
-
className:
|
486
|
+
className: cn('mx-2', detailModeClassName),
|
470
487
|
checked: Boolean(state),
|
471
488
|
onChange: setState,
|
472
489
|
ref: controlRef
|
@@ -474,7 +491,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
474
491
|
break;
|
475
492
|
default:
|
476
493
|
controlComponent = /*#__PURE__*/React__default.createElement(Input, Object.assign({}, attributes, {
|
477
|
-
className: className,
|
494
|
+
className: cn(className, detailModeClassName),
|
478
495
|
onChange: event => {
|
479
496
|
setState(event.target.value);
|
480
497
|
},
|
@@ -485,8 +502,9 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
|
|
485
502
|
}
|
486
503
|
}
|
487
504
|
}
|
488
|
-
|
489
|
-
|
505
|
+
const indicatorReason = (_rowMoveReason$cellId = rowMoveReason[cellId]) !== null && _rowMoveReason$cellId !== void 0 ? _rowMoveReason$cellId : null;
|
506
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, indicatorReason !== null && /*#__PURE__*/React__default.createElement(Indicator, {
|
507
|
+
reason: indicatorReason,
|
490
508
|
columnName: String(cell.column.columnDef.header),
|
491
509
|
mountNode: indicatorMountNode
|
492
510
|
}), /*#__PURE__*/React__default.createElement("span", {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Cell.js","sources":["../../../../../../../../../src/components/Table2/components/column/Cell.tsx"],"sourcesContent":["import React, { RefObject } from 'react';\nimport cn from 'classnames';\nimport { flexRender, Cell as RTCell, Row as RTRow, Table as RTTable, TableMeta } from '@tanstack/react-table';\n\nimport { Input } from '../../../Input/Input';\nimport { ColumnBase, ColumnBaseProps } from './Base';\nimport { getCellAlignmentClasses, getCellSizingClasses, isKeyboardFocusableElement } from '../../utilities/cell';\nimport { isInternalColumn } from '../../utilities/columns';\nimport { Datepicker } from '../../../Datepicker/Datepicker';\nimport { Switch } from '../../../Switch/Switch';\nimport { SaveHandler, SaveHandlerErrorResponse, Table2Filter } from '../../types';\nimport { columnFilterFn, globalFilterFn } from '../../utilities/filterFn';\nimport { MOVE_DIR } from '../../hooks/useEditMode';\nimport { useRowContext } from '../row/Context';\nimport { Indicator, IndicatorReason } from './Indicator';\nimport { ValidationError } from './ValidationError';\nimport { hasChanged, willRowMoveAfterSorting } from './utils';\nimport { useMergedRef } from '../../../../hooks/useMergedRef';\n\ntype CellProps<TType = unknown> = Omit<ColumnBaseProps<TType>, 'column' | 'isEditing'> & {\n cell: RTCell<TType, unknown>;\n index: number;\n isLastRow: boolean;\n rowIndex: number;\n rows: RTRow<TType>[];\n scrollToIndex: (index: number, options?: any) => void;\n scrollToOffset: (index: number, options?: any) => void;\n tableRef: React.RefObject<HTMLDivElement>;\n};\n\nexport const Cell = function Cell<TType = unknown>(props: CellProps<TType>) {\n const { cell, index, isLastRow, rowIndex, rows, scrollToIndex, scrollToOffset, table, tableRef, ...columnProps } = props;\n const meta = table.options.meta as TableMeta<any>;\n\n const { addFocussableColumnIndex, focussableColumnIndexes: allFocussableColumnIndexes } = meta;\n\n const { validationErrors, isRowIndicatorVisible } = useRowContext();\n const hasValidationErrorsInRow = !!validationErrors;\n\n const internalRef = React.useRef<HTMLDivElement>(null);\n const controlRef = React.useRef<HTMLElement>(null);\n const disableTruncation = cell.column.columnDef.meta?.disableTruncation;\n const cellClassName = cell.column.columnDef.meta?.className;\n\n const isActiveRow = meta.activeRowIndex === rowIndex;\n const isHoveredRow = meta.hoveredRowIndex === rowIndex;\n const isPinned = !!cell.column.getIsPinned();\n const isDragging = meta.dragging[cell.row.id];\n const isSelected = cell.row.getIsSelected();\n const isDataColumn = !isInternalColumn(cell.column.id);\n const hasCellControl = !!cell.column.columnDef.meta?.control;\n const allVisibleColumns = table.getVisibleLeafColumns();\n const lastColumnIndex = allVisibleColumns.length > 0 ? allVisibleColumns.length - 1 : 0;\n\n // editing\n const isEditingThisRow = meta.editMode.isEditing && isActiveRow;\n const canEditThisCell = isEditingThisRow && isDataColumn;\n const isEditingThisCell = canEditThisCell && meta.editMode.columnIndex === index;\n const isHoveringThisRowWhileEditing = meta.editMode.isEditing && isHoveredRow;\n\n // ensure the active row is always visible\n React.useEffect(() => {\n if (isActiveRow && internalRef.current) {\n internalRef.current.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });\n }\n }, [isActiveRow, hasValidationErrorsInRow]);\n\n React.useEffect(() => {\n // Adds padding to the table so that indicator doesn't get cropped\n if (isRowIndicatorVisible && meta.activeRowIndex === rows.length - 1) {\n tableRef.current?.classList.add('pb-4');\n }\n\n return () => tableRef.current?.classList.remove('pb-4');\n }, [isRowIndicatorVisible]);\n\n const className = cn(\n {\n 'border-b': !isLastRow,\n 'sticky z-10': isPinned,\n // use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating\n 'bg-white': !isActiveRow && !isSelected && !isHoveredRow,\n 'bg-grey-100': !isActiveRow && !isSelected && isHoveredRow,\n 'bg-grey-200 group-hover/row:bg-grey-200': isActiveRow && !isSelected,\n 'bg-blue-100': isSelected,\n '!wcag-blue-500': isDragging,\n '[&>*]:!grayscale [&_.bg-white]:!bg-grey-100': !isEditingThisRow && isHoveringThisRowWhileEditing,\n '!bg-red-100': hasValidationErrorsInRow,\n 'z-[11]': isPinned && isActiveRow,\n 'z-[12]': isPinned && isActiveRow && index === 0,\n 'border-blue !border-y-2 border-x-0': isRowIndicatorVisible,\n 'border-l-2 rounded-l': isRowIndicatorVisible && index === 0,\n 'border-r-2 rounded-r': isRowIndicatorVisible && index === lastColumnIndex,\n },\n getCellSizingClasses(\n table.options.meta?.rowDensity,\n (isEditingThisRow || isHoveringThisRowWhileEditing) && hasCellControl\n ),\n typeof cellClassName === 'function' ? cellClassName(cell.row) : cellClassName\n );\n\n const handleMouseDown = (event: React.MouseEvent<HTMLElement>) => {\n // only detect left clicks\n if (event.button === 0) {\n const activeElement = document.activeElement;\n const isActiveElementControl = activeElement?.closest('[role=\"cell\"]');\n const hasActiveRowChanged = meta.activeRowIndex !== rowIndex;\n\n // When user clicks on a cell that is not in the active row, for some reason blur event is not called on the cell\n // previous cell control element so we need to manually call it in order to save the changes in that cell\n if (isActiveElementControl && hasActiveRowChanged) {\n (activeElement as HTMLElement).blur();\n }\n\n meta.setActiveRowIndex(rowIndex);\n\n if (meta.editMode.isEditing) {\n if (allFocussableColumnIndexes.includes(index)) {\n meta.editMode.setColumn(index);\n } else {\n meta.editMode.setColumn(allFocussableColumnIndexes[0]);\n }\n }\n }\n };\n\n const attributes = {\n ...columnProps,\n // base props,\n column: cell.column,\n table,\n // dom attributes\n className,\n 'data-column-index': index,\n 'data-row-index': rowIndex,\n onMouseDown: handleMouseDown,\n ref: internalRef,\n role: 'cell',\n };\n\n const [detailModeEditing, setDetailModeEditing] = React.useState(false);\n\n // reset the editing state when we move column\n React.useEffect(() => {\n if (meta.editMode.columnIndex !== index) {\n setDetailModeEditing(false);\n }\n }, [meta.editMode.columnIndex]);\n\n React.useEffect(() => {\n if (isEditingThisRow && controlRef.current && isKeyboardFocusableElement(controlRef.current)) {\n addFocussableColumnIndex(index);\n }\n }, [isEditingThisRow, allFocussableColumnIndexes, addFocussableColumnIndex, index]);\n\n const moveRow = (moveDirection: MOVE_DIR) => {\n if (moveDirection === MOVE_DIR.PREV) {\n meta.moveToPreviousRow(rows, nextIndex => scrollToIndex(nextIndex - 1));\n } else if (moveDirection === MOVE_DIR.NEXT) {\n meta.moveToNextRow(rows, nextIndex => scrollToIndex(nextIndex + 2));\n }\n };\n\n if (meta.editMode.onSave && hasCellControl && (canEditThisCell || (isHoveringThisRowWhileEditing && isDataColumn))) {\n attributes.onMouseDown = event => {\n handleMouseDown(event);\n\n const target = event.target;\n const isTargetInput = target !== null && (target as HTMLElement).nodeName === 'INPUT';\n\n // event.target?.select is only truthy for input elements\n // if event.target is active element, then that means we should select the text\n if (isTargetInput && target !== document.activeElement) {\n event.preventDefault();\n\n setTimeout(() => {\n (target as HTMLInputElement).select();\n }, 1);\n } else if (isTargetInput && target === document.activeElement) {\n // if user left clicks on the input then we are into edit mode\n // only detect left clicks\n if (event.button === 0) {\n setDetailModeEditing(true);\n }\n }\n };\n\n if (canEditThisCell) {\n const firstDataColumnIndex = allFocussableColumnIndexes.at(0) ?? 0;\n const lastDataColumnIndex = allFocussableColumnIndexes.at(-1) ?? 0;\n\n attributes.onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const control = event.target as HTMLElement;\n const isControlInput =\n control.nodeName === 'INPUT' && control?.getAttribute('data-inline-editing-component') === 'true';\n\n // For some reason, Taco Input keyboard event always return true when \"event.isDefaultPrevented()\" is\n // called. So we need to check if the control is input or not so that we don't return early.\n if (!isControlInput && (event.isDefaultPrevented() || event.isPropagationStopped())) {\n return;\n }\n\n if (control.tagName === 'INPUT') {\n if (event.key === 'Enter') {\n event.preventDefault();\n const input = control as HTMLInputElement;\n\n if (detailModeEditing) {\n input?.select?.();\n setDetailModeEditing(false);\n } else {\n input.setSelectionRange?.(input.value?.length, input.value?.length);\n setDetailModeEditing(true);\n }\n\n return;\n }\n }\n\n // Don't exit edit mode if the target of the escape isn't a child of the cell (e.g. if its a popover).\n if (event.key === 'Escape' && event.currentTarget.contains(control)) {\n event.preventDefault();\n meta.editMode.toggleEditing(false);\n tableRef.current?.focus();\n return;\n }\n\n if ((!detailModeEditing && event.key === 'ArrowLeft') || (event.key === 'Tab' && event.shiftKey)) {\n event.preventDefault();\n\n const isFirstRow = rowIndex === 0;\n const isFirstColumn = index === firstDataColumnIndex;\n\n if (event.ctrlKey || event.metaKey) {\n // If the current active column is the first column then we don't do any thing so that focus\n // remains on the first column.\n if (!isFirstColumn) {\n control.blur();\n meta.editMode.moveToFirstColumn(allFocussableColumnIndexes);\n }\n } else {\n // If it is first row and first column, then don't move column.\n if (!isFirstRow || !isFirstColumn) {\n control.blur();\n meta.editMode.moveToPreviousColumn(allFocussableColumnIndexes, moveRow);\n }\n }\n\n return;\n }\n\n if ((!detailModeEditing && event.key === 'ArrowRight') || (event.key === 'Tab' && !event.shiftKey)) {\n event.preventDefault();\n\n const isLastRow = rowIndex === rows.length - 1;\n const isLastColumn = index === lastDataColumnIndex;\n\n if (event.ctrlKey || event.metaKey) {\n // If the current active column is the last column then we don't do any thing so that focus\n // remains on the last column.\n if (!isLastColumn) {\n control.blur();\n meta.editMode.moveToLastColumn(allFocussableColumnIndexes);\n }\n } else {\n // If it is last row and last column, then don't move column.\n if (!isLastRow || !isLastColumn) {\n control.blur();\n meta.editMode.moveToNextColumn(allFocussableColumnIndexes, moveRow);\n }\n }\n\n return;\n }\n\n if (!detailModeEditing && event.key === 'ArrowUp') {\n event.preventDefault();\n\n // if it is the first row then return early, so that focus on the cell is not lost\n if (rowIndex === 0) {\n return;\n }\n\n control.blur();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(0);\n\n scrollToOffset(0);\n } else {\n moveRow(MOVE_DIR.PREV);\n }\n\n meta.setHoveredRowIndex(undefined);\n return;\n }\n\n if (!detailModeEditing && event.key === 'ArrowDown') {\n event.preventDefault();\n\n // if it is the last row then return early, so that focus on the cell is not lost\n if (rowIndex === rows.length - 1) {\n return;\n }\n\n control.blur();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(rows.length - 1);\n scrollToIndex(rows.length + 20);\n } else {\n moveRow(MOVE_DIR.NEXT);\n }\n\n meta.setHoveredRowIndex(undefined);\n return;\n }\n };\n }\n\n return (\n <ColumnBase {...attributes}>\n <EditingCell\n cell={cell}\n cellRef={internalRef}\n columnIndex={index}\n isEditingThisCell={isEditingThisCell}\n onSave={meta.editMode.onSave}\n rowIndex={rowIndex}\n table={table}\n ref={controlRef}\n rowValues={rows[rowIndex].original}\n rowsLength={rows.length}\n />\n </ColumnBase>\n );\n } else {\n if (meta.onRowClick) {\n attributes.onClick = () => {\n meta.onRowClick?.(cell.row.original);\n };\n }\n }\n\n return (\n <ColumnBase {...attributes}>\n <div className={disableTruncation ? '-my-[0.45rem]' : 'truncate'}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </div>\n </ColumnBase>\n );\n};\n\ntype EditingCellProps = {\n cell: RTCell<any, unknown>;\n cellRef: React.RefObject<HTMLDivElement>;\n columnIndex: number;\n isEditingThisCell: boolean;\n onSave: SaveHandler<any>;\n rowIndex: number;\n table: RTTable<any>;\n rowValues: Record<string, any>;\n rowsLength: number;\n};\n\nconst EditingCell = React.memo(\n React.forwardRef<HTMLElement, EditingCellProps>((props, ref) => {\n const { cell, cellRef, columnIndex, isEditingThisCell = false, onSave: handleSave, rowIndex, rowValues, table } = props;\n const { validationErrors, setValidationErrors, setIsRowIndicatorVisible } = useRowContext();\n\n const controlRef = useMergedRef(ref);\n const cellId = cell.column.id;\n const cellValidationError = validationErrors?.[cellId];\n\n const value = cell.getValue();\n const ariaLabel = cell.column.columnDef.header as string | undefined;\n const meta = table.options.meta as TableMeta<any>;\n const { globalFilter } = table.getState();\n\n const [state, setState] = React.useState(value);\n const [rowMoveReason, setRowMoveReason] = React.useState<IndicatorReason | null>(null);\n\n const isHoveringAnotherRowWhileEditing =\n meta.editMode.isEditing && meta.activeRowIndex !== rowIndex && meta.hoveredRowIndex === rowIndex;\n const showValidationError = !isHoveringAnotherRowWhileEditing && !!cellValidationError;\n // On each save, the initialValue will be set to the new value of the cell\n const initialValue = React.useRef<any>(value);\n\n // It is important that we let consumers pass a newValue as an argument because when setState is called before\n // onBlur then saveIfChanged method gets the stale state value. This happens because the rerender hasn't happened\n // before the saveIfChanged method is called.\n const saveIfChanged = async (eventOrNewValue?: any) => {\n let newValue = state;\n\n // if eventOrNewValue is not an event object\n if (!eventOrNewValue.target) {\n newValue = eventOrNewValue;\n }\n\n if (hasChanged(value, newValue)) {\n try {\n const updatedRow = { ...cell.row.original, [cellId]: newValue };\n\n await handleSave(updatedRow, cellId);\n // Reset error if save was successful\n setValidationErrors(null);\n } catch (error) {\n setValidationErrors(error as SaveHandlerErrorResponse);\n }\n }\n };\n\n // Ensures we \"auto focus\" the field if the cell is being edited.\n React.useEffect(() => {\n const isFocusInsideTable = meta.tableRef.current?.contains(document.activeElement);\n // When control is blurred then body gets the focus that's why we have to make sure if activeElement\n // is body then we focus the cell if it is being edited.\n const isBodyFocussed = document.body === document.activeElement;\n\n // Don't focus cell if any table popup(filter popup, column settings popup) is open.\n if (isEditingThisCell && (isFocusInsideTable || isBodyFocussed)) {\n (controlRef.current as HTMLElement)?.focus?.();\n }\n }, [isEditingThisCell, controlRef.current]);\n\n // make sure the cell becomes active if the field is focused\n const handleFocus = event => {\n meta.editMode.setColumn(columnIndex);\n\n if (event.target?.select) {\n event.target?.select();\n }\n };\n\n React.useEffect(() => {\n if (hasChanged(initialValue.current, state)) {\n showIndicator();\n } else {\n hideIndicator();\n }\n\n return hideIndicator;\n }, [state]);\n\n const showIndicator = () => {\n let willRowMoveReason: IndicatorReason | undefined = undefined;\n\n const isFilteredByGlobalFilter = Object.values<unknown>({ ...rowValues, [cellId]: state }).some(cellValue =>\n // Global filter can be undefined when there is no text being searched so we pass an empty string to\n // globalFilterFn as query in that case.\n globalFilterFn(String(cellValue), globalFilter ? String(globalFilter) : '')\n );\n\n if (!isFilteredByGlobalFilter) {\n willRowMoveReason = IndicatorReason.SEARCH;\n } else if (cell.column.getIsFiltered() && !columnFilterFn(state, cell.column.getFilterValue() as Table2Filter)) {\n willRowMoveReason = IndicatorReason.FILTER;\n } else if (\n !willRowMoveReason &&\n cell.column.getIsSorted() &&\n willRowMoveAfterSorting(\n state,\n cell,\n rowIndex,\n table.getRowModel().rows,\n !!table.getState().sorting.find(s => s.id === cell.column.id)?.desc\n )\n ) {\n willRowMoveReason = IndicatorReason.SORTING;\n }\n\n if (willRowMoveReason !== undefined) {\n meta.setShouldPauseSortingAndFiltering(true);\n setRowMoveReason(willRowMoveReason);\n setIsRowIndicatorVisible(true);\n }\n };\n\n const hideIndicator = () => {\n setRowMoveReason(null);\n setIsRowIndicatorVisible(false);\n };\n\n const cellControl = cell.column.columnDef.meta?.control;\n\n const attributes = {\n 'aria-label': ariaLabel,\n onBlur: saveIfChanged,\n onFocus: handleFocus,\n ref,\n // This is a temporary fix to enable up/down arrow key shortcuts on input in quick mode. For some reason,\n // the preventDefault is true on Taco Input, so the keyboard shortcuts doesn't work. By adding this\n // data attribute we make sure the event is coming from a control component, and then we can make sure\n // keyboard shortcut works as expected.\n 'data-inline-editing-component': 'true',\n };\n\n const className = cn(getCellAlignmentClasses(cell.column.columnDef.meta?.align));\n const indicatorMountNode = cellRef.current?.parentElement?.querySelector(':first-child') as Element | null;\n\n let controlComponent;\n\n if (cellControl) {\n if (typeof cellControl === 'function') {\n controlComponent = cellControl(\n {\n onBlur: saveIfChanged,\n onFocus: handleFocus,\n ref: controlRef,\n setValue: setState,\n value: state,\n 'data-inline-editing-component': 'true',\n },\n cell.row.original\n );\n } else {\n switch (cellControl) {\n case 'datepicker':\n controlComponent = (\n <Datepicker\n {...attributes}\n onBlur={event => {\n const newDate = (event as any).detail;\n saveIfChanged(newDate);\n }}\n onChange={event => {\n setState((event as any).detail);\n }}\n ref={controlRef as RefObject<HTMLInputElement>}\n value={state as Date}\n />\n );\n break;\n\n case 'switch':\n controlComponent = (\n <Switch\n {...attributes}\n className=\"mx-2\"\n checked={Boolean(state)}\n onChange={setState}\n ref={controlRef as RefObject<HTMLButtonElement>}\n />\n );\n break;\n default:\n controlComponent = (\n <Input\n {...attributes}\n className={className}\n onChange={event => {\n setState(event.target.value);\n }}\n ref={controlRef as RefObject<HTMLInputElement>}\n value={String(state ?? '')}\n />\n );\n break;\n }\n }\n }\n\n return (\n <>\n {!!rowMoveReason && (\n <Indicator\n reason={rowMoveReason}\n columnName={String(cell.column.columnDef.header)}\n mountNode={indicatorMountNode}\n />\n )}\n <span className=\"relative flex-grow\">\n {controlComponent}\n {showValidationError && <ValidationError>{String(cellValidationError)}</ValidationError>}\n </span>\n </>\n );\n })\n);\n"],"names":["Cell","props","cell","index","isLastRow","rowIndex","rows","scrollToIndex","scrollToOffset","table","tableRef","columnProps","meta","options","addFocussableColumnIndex","focussableColumnIndexes","allFocussableColumnIndexes","validationErrors","isRowIndicatorVisible","useRowContext","hasValidationErrorsInRow","internalRef","React","useRef","controlRef","disableTruncation","column","columnDef","cellClassName","className","isActiveRow","activeRowIndex","isHoveredRow","hoveredRowIndex","isPinned","getIsPinned","isDragging","dragging","row","id","isSelected","getIsSelected","isDataColumn","isInternalColumn","hasCellControl","control","allVisibleColumns","getVisibleLeafColumns","lastColumnIndex","length","isEditingThisRow","editMode","isEditing","canEditThisCell","isEditingThisCell","columnIndex","isHoveringThisRowWhileEditing","useEffect","current","scrollIntoView","behavior","block","inline","classList","add","remove","cn","getCellSizingClasses","rowDensity","handleMouseDown","event","button","activeElement","document","isActiveElementControl","closest","hasActiveRowChanged","blur","setActiveRowIndex","includes","setColumn","attributes","onMouseDown","ref","role","detailModeEditing","setDetailModeEditing","useState","isKeyboardFocusableElement","moveRow","moveDirection","MOVE_DIR","PREV","moveToPreviousRow","nextIndex","NEXT","moveToNextRow","onSave","target","isTargetInput","nodeName","preventDefault","setTimeout","select","firstDataColumnIndex","at","lastDataColumnIndex","onKeyDown","isControlInput","getAttribute","isDefaultPrevented","isPropagationStopped","tagName","key","input","setSelectionRange","value","currentTarget","contains","toggleEditing","focus","shiftKey","isFirstRow","isFirstColumn","ctrlKey","metaKey","moveToFirstColumn","moveToPreviousColumn","isLastColumn","moveToLastColumn","moveToNextColumn","setHoveredRowIndex","undefined","ColumnBase","EditingCell","cellRef","rowValues","original","rowsLength","onRowClick","onClick","flexRender","getContext","memo","forwardRef","handleSave","setValidationErrors","setIsRowIndicatorVisible","useMergedRef","cellId","cellValidationError","getValue","ariaLabel","header","globalFilter","getState","state","setState","rowMoveReason","setRowMoveReason","isHoveringAnotherRowWhileEditing","showValidationError","initialValue","saveIfChanged","eventOrNewValue","newValue","hasChanged","updatedRow","error","isFocusInsideTable","isBodyFocussed","body","handleFocus","showIndicator","hideIndicator","willRowMoveReason","isFilteredByGlobalFilter","Object","values","some","cellValue","globalFilterFn","String","IndicatorReason","SEARCH","getIsFiltered","columnFilterFn","getFilterValue","FILTER","getIsSorted","willRowMoveAfterSorting","getRowModel","sorting","find","s","desc","SORTING","setShouldPauseSortingAndFiltering","cellControl","onBlur","onFocus","getCellAlignmentClasses","align","indicatorMountNode","parentElement","querySelector","controlComponent","setValue","Datepicker","newDate","detail","onChange","Switch","checked","Boolean","Input","Indicator","reason","columnName","mountNode","ValidationError"],"mappings":";;;;;;;;;;;;;;;;;;MA8BaA,IAAI,GAAG,SAASA,IAAI,CAAkBC,KAAuB;;EACtE,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC,SAAS;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,aAAa;IAAEC,cAAc;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;GAAa,GAAGV,KAAK;EACxH,MAAMW,IAAI,GAAGH,KAAK,CAACI,OAAO,CAACD,IAAsB;EAEjD,MAAM;IAAEE,wBAAwB;IAAEC,uBAAuB,EAAEC;GAA4B,GAAGJ,IAAI;EAE9F,MAAM;IAAEK,gBAAgB;IAAEC;GAAuB,GAAGC,aAAa,EAAE;EACnE,MAAMC,wBAAwB,GAAG,CAAC,CAACH,gBAAgB;EAEnD,MAAMI,WAAW,GAAGC,cAAK,CAACC,MAAM,CAAiB,IAAI,CAAC;EACtD,MAAMC,UAAU,GAAGF,cAAK,CAACC,MAAM,CAAc,IAAI,CAAC;EAClD,MAAME,iBAAiB,4BAAGvB,IAAI,CAACwB,MAAM,CAACC,SAAS,CAACf,IAA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AAmB,iBAAI3I,6BAACsM,eAAe,QAAEtC,MAAM,CAAChC,mBAAmB,CAAC,CAAmB,CACrF,CACR;AAEX,CAAC,CAAC,CACL;;;;"}
|
1
|
+
{"version":3,"file":"Cell.js","sources":["../../../../../../../../../src/components/Table2/components/column/Cell.tsx"],"sourcesContent":["import React, { RefObject } from 'react';\nimport cn from 'classnames';\nimport { flexRender, Cell as RTCell, Row as RTRow, Table as RTTable, TableMeta } from '@tanstack/react-table';\n\nimport { Input } from '../../../Input/Input';\nimport { ColumnBase, ColumnBaseProps } from './Base';\nimport { getCellAlignmentClasses, getCellSizingClasses, isKeyboardFocusableElement } from '../../utilities/cell';\nimport { isInternalColumn } from '../../utilities/columns';\nimport { Datepicker } from '../../../Datepicker/Datepicker';\nimport { Switch } from '../../../Switch/Switch';\nimport { SaveHandler, SaveHandlerErrorResponse, Table2Filter } from '../../types';\nimport { columnFilterFn, globalFilterFn } from '../../utilities/filterFn';\nimport { MOVE_DIR } from '../../hooks/useEditMode';\nimport { useRowContext } from '../row/Context';\nimport { Indicator, IndicatorReason } from './Indicator';\nimport { ValidationError } from './ValidationError';\nimport { hasChanged, willRowMoveAfterSorting } from './utils';\nimport { useMergedRef } from '../../../../hooks/useMergedRef';\n\ntype CellProps<TType = unknown> = Omit<ColumnBaseProps<TType>, 'column' | 'isEditing'> & {\n cell: RTCell<TType, unknown>;\n index: number;\n isLastRow: boolean;\n rowIndex: number;\n rows: RTRow<TType>[];\n scrollToIndex: (index: number, options?: any) => void;\n scrollToOffset: (index: number, options?: any) => void;\n tableRef: React.RefObject<HTMLDivElement>;\n};\n\nexport const Cell = function Cell<TType = unknown>(props: CellProps<TType>) {\n const { cell, index, isLastRow, rowIndex, rows, scrollToIndex, scrollToOffset, table, tableRef, ...columnProps } = props;\n const meta = table.options.meta as TableMeta<any>;\n\n const { addFocussableColumnIndex, focussableColumnIndexes: allFocussableColumnIndexes } = meta;\n\n const { validationErrors, rowMoveReason } = useRowContext();\n const hasValidationErrorsInRow = !!validationErrors;\n\n const internalRef = React.useRef<HTMLDivElement>(null);\n const controlRef = React.useRef<HTMLElement>(null);\n const disableTruncation = cell.column.columnDef.meta?.disableTruncation;\n const cellClassName = cell.column.columnDef.meta?.className;\n\n const isActiveRow = meta.activeRowIndex === rowIndex;\n const isHoveredRow = meta.hoveredRowIndex === rowIndex;\n const isPinned = !!cell.column.getIsPinned();\n const isDragging = meta.dragging[cell.row.id];\n const isSelected = cell.row.getIsSelected();\n const isDataColumn = !isInternalColumn(cell.column.id);\n const hasCellControl = !!cell.column.columnDef.meta?.control;\n const allVisibleColumns = table.getVisibleLeafColumns();\n const lastColumnIndex = allVisibleColumns.length > 0 ? allVisibleColumns.length - 1 : 0;\n\n // editing\n const isEditingThisRow = meta.editMode.isEditing && isActiveRow;\n const canEditThisCell = isEditingThisRow && isDataColumn;\n const isEditingThisCell = canEditThisCell && meta.editMode.columnIndex === index;\n const isHoveringThisRowWhileEditing = meta.editMode.isEditing && isHoveredRow;\n\n const isIndicatorVisible = Object.keys(rowMoveReason).length > 0;\n\n React.useEffect(() => {\n // Adds padding to the table so that indicator doesn't get cropped\n if (isIndicatorVisible && isLastRow) {\n tableRef.current?.classList.add('pb-4');\n }\n\n return () => tableRef.current?.classList.remove('pb-4');\n }, [isIndicatorVisible, isLastRow]);\n\n const className = cn(\n {\n 'border-b': !isLastRow,\n 'sticky z-[1]': isPinned,\n // use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating\n 'bg-white': !isActiveRow && !isSelected && !isHoveredRow,\n 'bg-grey-100': !isActiveRow && !isSelected && isHoveredRow,\n 'bg-grey-200 group-hover/row:bg-grey-200': isActiveRow && !isSelected,\n 'bg-blue-100': isSelected,\n '!wcag-blue-500': isDragging,\n '[&>*]:!grayscale [&_.bg-white]:!bg-grey-100': !isEditingThisRow && isHoveringThisRowWhileEditing,\n '!bg-red-100': hasValidationErrorsInRow,\n 'z-[1]': isPinned && isActiveRow,\n // First column should have higher z-index so that row indicator always show on top of the cell\n // control components.\n 'z-[2]': isPinned && isActiveRow && index === 0,\n 'border-blue !border-y-2 border-x-0': isIndicatorVisible,\n 'border-l-2 rounded-l': isIndicatorVisible && index === 0,\n 'border-r-2 rounded-r': isIndicatorVisible && index === lastColumnIndex,\n },\n getCellSizingClasses(\n table.options.meta?.rowDensity,\n (isEditingThisRow || isHoveringThisRowWhileEditing) && hasCellControl\n ),\n typeof cellClassName === 'function' ? cellClassName(cell.row) : cellClassName\n );\n\n const handleMouseDown = (event: React.MouseEvent<HTMLElement>) => {\n // only detect left clicks\n if (event.button === 0) {\n const activeElement = document.activeElement;\n const isActiveElementControl = activeElement?.closest('[role=\"cell\"]');\n const hasActiveRowChanged = meta.activeRowIndex !== rowIndex;\n\n // When user clicks on a cell that is not in the active row, for some reason blur event is not called on the cell\n // previous cell control element so we need to manually call it in order to save the changes in that cell\n if (isActiveElementControl && hasActiveRowChanged) {\n (activeElement as HTMLElement).blur();\n }\n\n meta.setActiveRowIndex(rowIndex);\n\n if (meta.editMode.isEditing) {\n if (allFocussableColumnIndexes.includes(index)) {\n meta.editMode.setColumn(index);\n } else {\n meta.editMode.setColumn(allFocussableColumnIndexes[0]);\n }\n }\n }\n };\n\n const attributes = {\n ...columnProps,\n // base props,\n column: cell.column,\n table,\n // dom attributes\n className,\n 'data-column-index': index,\n 'data-row-index': rowIndex,\n onMouseDown: handleMouseDown,\n ref: internalRef,\n role: 'cell',\n };\n\n const [detailModeEditing, setDetailModeEditing] = React.useState(false);\n\n const detailModeClassName = cn({\n '!shadow-[0_0_0_4px_rgba(0,99,255,0.25)]': detailModeEditing,\n });\n\n // reset the editing state when we move column\n React.useEffect(() => {\n if (meta.editMode.columnIndex !== index) {\n setDetailModeEditing(false);\n }\n }, [meta.editMode.columnIndex]);\n\n React.useEffect(() => {\n if (isEditingThisRow && controlRef.current && isKeyboardFocusableElement(controlRef.current)) {\n addFocussableColumnIndex(index);\n }\n }, [isEditingThisRow, allFocussableColumnIndexes, addFocussableColumnIndex, index]);\n\n const moveRow = (moveDirection: MOVE_DIR) => {\n if (moveDirection === MOVE_DIR.PREV) {\n meta.moveToPreviousRow(rows, nextIndex => scrollToIndex(nextIndex - 1));\n } else if (moveDirection === MOVE_DIR.NEXT) {\n meta.moveToNextRow(rows, nextIndex => scrollToIndex(nextIndex + 2));\n }\n };\n\n if (meta.editMode.onSave && hasCellControl && (canEditThisCell || (isHoveringThisRowWhileEditing && isDataColumn))) {\n attributes.onMouseDown = event => {\n handleMouseDown(event);\n\n const target = event.target;\n const isTargetInput = target !== null && (target as HTMLElement).nodeName === 'INPUT';\n\n // event.target?.select is only truthy for input elements\n // if event.target is active element, then that means we should select the text\n if (isTargetInput && target !== document.activeElement) {\n event.preventDefault();\n\n setTimeout(() => {\n (target as HTMLInputElement).select();\n }, 1);\n } else if (isTargetInput && target === document.activeElement) {\n // if user left clicks on the input then we are into edit mode\n // only detect left clicks\n if (event.button === 0) {\n setDetailModeEditing(true);\n }\n }\n };\n\n if (canEditThisCell) {\n const firstDataColumnIndex = allFocussableColumnIndexes.at(0) ?? 0;\n const lastDataColumnIndex = allFocussableColumnIndexes.at(-1) ?? 0;\n\n attributes.onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const control = event.target as HTMLElement;\n const isControlInput =\n control.nodeName === 'INPUT' && control?.getAttribute('data-inline-editing-component') === 'true';\n\n // For some reason, Taco Input keyboard event always return true when \"event.isDefaultPrevented()\" is\n // called. So we need to check if the control is input or not so that we don't return early.\n if (!isControlInput && (event.isDefaultPrevented() || event.isPropagationStopped())) {\n return;\n }\n\n if (control.tagName === 'INPUT') {\n if (event.key === 'Enter') {\n event.preventDefault();\n const input = control as HTMLInputElement;\n\n if (!detailModeEditing) {\n input.setSelectionRange?.(input.value?.length, input.value?.length);\n setDetailModeEditing(true);\n }\n\n return;\n }\n }\n\n // Don't exit edit mode if the target of the escape isn't a child of the cell (e.g. if its a popover).\n if (event.key === 'Escape' && event.currentTarget.contains(control)) {\n event.preventDefault();\n const input = control as HTMLInputElement;\n\n if (detailModeEditing) {\n input?.select?.();\n setDetailModeEditing(false);\n } else {\n meta.editMode.toggleEditing(false);\n tableRef.current?.focus();\n }\n\n return;\n }\n\n if ((!detailModeEditing && event.key === 'ArrowLeft') || (event.key === 'Tab' && event.shiftKey)) {\n event.preventDefault();\n\n const isFirstRow = rowIndex === 0;\n const isFirstColumn = index === firstDataColumnIndex;\n\n if (event.ctrlKey || event.metaKey) {\n // If the current active column is the first column then we don't do any thing so that focus\n // remains on the first column.\n if (!isFirstColumn) {\n control.blur();\n meta.editMode.moveToFirstColumn(allFocussableColumnIndexes);\n }\n } else {\n // If it is first row and first column, then don't move column.\n if (!isFirstRow || !isFirstColumn) {\n control.blur();\n meta.editMode.moveToPreviousColumn(allFocussableColumnIndexes, moveRow);\n }\n }\n\n return;\n }\n\n if ((!detailModeEditing && event.key === 'ArrowRight') || (event.key === 'Tab' && !event.shiftKey)) {\n event.preventDefault();\n\n const isLastColumn = index === lastDataColumnIndex;\n\n if (event.ctrlKey || event.metaKey) {\n // If the current active column is the last column then we don't do any thing so that focus\n // remains on the last column.\n if (!isLastColumn) {\n control.blur();\n meta.editMode.moveToLastColumn(allFocussableColumnIndexes);\n }\n } else {\n // If it is last row and last column, then don't move column.\n if (!isLastRow || !isLastColumn) {\n control.blur();\n meta.editMode.moveToNextColumn(allFocussableColumnIndexes, moveRow);\n }\n }\n\n return;\n }\n\n if (!detailModeEditing && event.key === 'ArrowUp') {\n event.preventDefault();\n\n // if it is the first row then return early, so that focus on the cell is not lost\n if (rowIndex === 0) {\n return;\n }\n\n control.blur();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(0);\n\n scrollToOffset(0);\n } else {\n moveRow(MOVE_DIR.PREV);\n }\n\n meta.setHoveredRowIndex(undefined);\n return;\n }\n\n if (!detailModeEditing && event.key === 'ArrowDown') {\n event.preventDefault();\n\n // if it is the last row then return early, so that focus on the cell is not lost\n if (rowIndex === rows.length - 1) {\n return;\n }\n\n control.blur();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(rows.length - 1);\n scrollToIndex(rows.length + 20);\n } else {\n moveRow(MOVE_DIR.NEXT);\n }\n\n meta.setHoveredRowIndex(undefined);\n return;\n }\n };\n }\n\n return (\n <ColumnBase {...attributes}>\n <EditingCell\n detailModeClassName={detailModeClassName}\n cell={cell}\n cellRef={internalRef}\n columnIndex={index}\n isEditingThisCell={isEditingThisCell}\n onSave={meta.editMode.onSave}\n rowIndex={rowIndex}\n table={table}\n ref={controlRef}\n rowValues={rows[rowIndex].original}\n rowsLength={rows.length}\n />\n </ColumnBase>\n );\n } else {\n if (meta.onRowClick) {\n attributes.onClick = () => {\n meta.onRowClick?.(cell.row.original);\n };\n }\n }\n\n return (\n <ColumnBase {...attributes}>\n <div className={disableTruncation ? '-my-[0.45rem]' : 'truncate'}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </div>\n </ColumnBase>\n );\n};\n\ntype EditingCellProps = {\n cell: RTCell<any, unknown>;\n cellRef: React.RefObject<HTMLDivElement>;\n columnIndex: number;\n isEditingThisCell: boolean;\n onSave: SaveHandler<any>;\n rowIndex: number;\n table: RTTable<any>;\n rowValues: Record<string, any>;\n rowsLength: number;\n detailModeClassName?: string;\n};\n\nconst EditingCell = React.memo(\n React.forwardRef<HTMLElement, EditingCellProps>((props, ref) => {\n const {\n cell,\n cellRef,\n columnIndex,\n detailModeClassName,\n isEditingThisCell = false,\n onSave: handleSave,\n rowIndex,\n rowValues,\n table,\n } = props;\n const { validationErrors, setValidationErrors, rowMoveReason, setRowMoveReason } = useRowContext();\n\n const controlRef = useMergedRef(ref);\n const cellId = cell.column.id;\n const cellValidationError = validationErrors?.[cellId];\n\n const value = cell.getValue();\n const ariaLabel = cell.column.columnDef.header as string | undefined;\n const meta = table.options.meta as TableMeta<any>;\n const { globalFilter } = table.getState();\n\n const [state, setState] = React.useState(value);\n\n const isHoveringAnotherRowWhileEditing =\n meta.editMode.isEditing && meta.activeRowIndex !== rowIndex && meta.hoveredRowIndex === rowIndex;\n const showValidationError = !isHoveringAnotherRowWhileEditing && !!cellValidationError;\n // On each save, the initialValue will be set to the new value of the cell\n const initialValue = React.useRef<any>(value);\n\n // It is important that we let consumers pass a newValue as an argument because when setState is called before\n // onBlur then saveIfChanged method gets the stale state value. This happens because the rerender hasn't happened\n // before the saveIfChanged method is called.\n const saveIfChanged = async (eventOrNewValue?: any) => {\n let newValue = state;\n\n // if eventOrNewValue is not an event object\n if (!eventOrNewValue.target) {\n newValue = eventOrNewValue;\n }\n\n if (hasChanged(value, newValue)) {\n try {\n const updatedRow = { ...cell.row.original, [cellId]: newValue };\n\n await handleSave(updatedRow, cellId);\n\n // If sorting is paused then update the last sorted or filtered rows to store the newly updated row\n if (meta.shouldPauseSortingAndFiltering) {\n meta.lastSortedOrFilteredRows.current = meta.lastSortedOrFilteredRows.current.map(row => {\n if (row.id === cell.row.id) {\n row.original = updatedRow;\n }\n\n return row;\n });\n }\n\n // Reset error if save was successful\n setValidationErrors(null);\n } catch (error) {\n setValidationErrors(error as SaveHandlerErrorResponse);\n }\n }\n };\n\n // Ensures we \"auto focus\" the field if the cell is being edited.\n React.useEffect(() => {\n const isFocusInsideTable = meta.tableRef.current?.contains(document.activeElement);\n // When control is blurred then body gets the focus that's why we have to make sure if activeElement\n // is body then we focus the cell if it is being edited.\n const isBodyFocussed = document.body === document.activeElement;\n\n // Don't focus cell if any table popup(filter popup, column settings popup) is open.\n if (isEditingThisCell && (isFocusInsideTable || isBodyFocussed)) {\n (controlRef.current as HTMLElement)?.focus?.();\n }\n }, [isEditingThisCell, controlRef.current]);\n\n // make sure the cell becomes active if the field is focused\n const handleFocus = event => {\n meta.editMode.setColumn(columnIndex);\n\n if (event.target?.select) {\n event.target?.select();\n }\n };\n\n React.useEffect(() => {\n if (hasChanged(initialValue.current, state)) {\n showIndicator();\n } else {\n hideIndicator();\n }\n\n return hideIndicator;\n }, [state]);\n\n const showIndicator = () => {\n let willRowMoveReason: IndicatorReason | null = null;\n\n const isFilteredByGlobalFilter = Object.values<unknown>({ ...rowValues, [cellId]: state }).some(cellValue =>\n // Global filter can be undefined when there is no text being searched so we pass an empty string to\n // globalFilterFn as query in that case.\n globalFilterFn(String(cellValue), globalFilter ? String(globalFilter) : '')\n );\n\n if (!isFilteredByGlobalFilter) {\n willRowMoveReason = IndicatorReason.SEARCH;\n } else if (cell.column.getIsFiltered() && !columnFilterFn(state, cell.column.getFilterValue() as Table2Filter)) {\n willRowMoveReason = IndicatorReason.FILTER;\n } else if (\n !willRowMoveReason &&\n cell.column.getIsSorted() &&\n willRowMoveAfterSorting(\n state,\n cell,\n rowIndex,\n table.getRowModel().rows,\n !!table.getState().sorting.find(s => s.id === cell.column.id)?.desc\n )\n ) {\n willRowMoveReason = IndicatorReason.SORTING;\n }\n\n if (willRowMoveReason !== null) {\n meta.setShouldPauseSortingAndFiltering(true);\n setRowMoveReason({ [cellId]: willRowMoveReason });\n }\n };\n\n const hideIndicator = () => {\n setRowMoveReason(prevState => {\n const newState = { ...prevState };\n delete newState[cellId];\n\n return newState;\n });\n };\n\n const cellControl = cell.column.columnDef.meta?.control;\n\n const attributes = {\n 'aria-label': ariaLabel,\n onBlur: saveIfChanged,\n onFocus: handleFocus,\n ref,\n // This is a temporary fix to enable up/down arrow key shortcuts on input in quick mode. For some reason,\n // the preventDefault is true on Taco Input, so the keyboard shortcuts doesn't work. By adding this\n // data attribute we make sure the event is coming from a control component, and then we can make sure\n // keyboard shortcut works as expected.\n 'data-inline-editing-component': 'true',\n };\n\n const className = cn(getCellAlignmentClasses(cell.column.columnDef.meta?.align));\n const indicatorMountNode = cellRef.current?.parentElement?.querySelector(':first-child') as Element | null;\n\n let controlComponent;\n\n if (cellControl) {\n if (typeof cellControl === 'function') {\n controlComponent = cellControl(\n {\n onBlur: saveIfChanged,\n onFocus: handleFocus,\n ref: controlRef,\n setValue: setState,\n value: state,\n 'data-inline-editing-component': 'true',\n className: detailModeClassName,\n },\n cell.row.original\n );\n } else {\n switch (cellControl) {\n case 'datepicker':\n controlComponent = (\n <Datepicker\n {...attributes}\n className={detailModeClassName}\n onBlur={event => {\n const newDate = (event as any).detail;\n saveIfChanged(newDate);\n }}\n onChange={event => {\n setState((event as any).detail);\n }}\n ref={controlRef as RefObject<HTMLInputElement>}\n value={state as Date}\n />\n );\n break;\n\n case 'switch':\n controlComponent = (\n <Switch\n {...attributes}\n className={cn('mx-2', detailModeClassName)}\n checked={Boolean(state)}\n onChange={setState}\n ref={controlRef as RefObject<HTMLButtonElement>}\n />\n );\n break;\n default:\n controlComponent = (\n <Input\n {...attributes}\n className={cn(className, detailModeClassName)}\n onChange={event => {\n setState(event.target.value);\n }}\n ref={controlRef as RefObject<HTMLInputElement>}\n value={String(state ?? '')}\n />\n );\n break;\n }\n }\n }\n\n const indicatorReason = rowMoveReason[cellId] ?? null;\n\n return (\n <>\n {indicatorReason !== null && (\n <Indicator\n reason={indicatorReason}\n columnName={String(cell.column.columnDef.header)}\n mountNode={indicatorMountNode}\n />\n )}\n <span className=\"relative flex-grow\">\n {controlComponent}\n {showValidationError && <ValidationError>{String(cellValidationError)}</ValidationError>}\n </span>\n </>\n );\n })\n);\n"],"names":["Cell","props","cell","index","isLastRow","rowIndex","rows","scrollToIndex","scrollToOffset","table","tableRef","columnProps","meta","options","addFocussableColumnIndex","focussableColumnIndexes","allFocussableColumnIndexes","validationErrors","rowMoveReason","useRowContext","hasValidationErrorsInRow","internalRef","React","useRef","controlRef","disableTruncation","column","columnDef","cellClassName","className","isActiveRow","activeRowIndex","isHoveredRow","hoveredRowIndex","isPinned","getIsPinned","isDragging","dragging","row","id","isSelected","getIsSelected","isDataColumn","isInternalColumn","hasCellControl","control","allVisibleColumns","getVisibleLeafColumns","lastColumnIndex","length","isEditingThisRow","editMode","isEditing","canEditThisCell","isEditingThisCell","columnIndex","isHoveringThisRowWhileEditing","isIndicatorVisible","Object","keys","useEffect","current","classList","add","remove","cn","getCellSizingClasses","rowDensity","handleMouseDown","event","button","activeElement","document","isActiveElementControl","closest","hasActiveRowChanged","blur","setActiveRowIndex","includes","setColumn","attributes","onMouseDown","ref","role","detailModeEditing","setDetailModeEditing","useState","detailModeClassName","isKeyboardFocusableElement","moveRow","moveDirection","MOVE_DIR","PREV","moveToPreviousRow","nextIndex","NEXT","moveToNextRow","onSave","target","isTargetInput","nodeName","preventDefault","setTimeout","select","firstDataColumnIndex","at","lastDataColumnIndex","onKeyDown","isControlInput","getAttribute","isDefaultPrevented","isPropagationStopped","tagName","key","input","setSelectionRange","value","currentTarget","contains","toggleEditing","focus","shiftKey","isFirstRow","isFirstColumn","ctrlKey","metaKey","moveToFirstColumn","moveToPreviousColumn","isLastColumn","moveToLastColumn","moveToNextColumn","setHoveredRowIndex","undefined","ColumnBase","EditingCell","cellRef","rowValues","original","rowsLength","onRowClick","onClick","flexRender","getContext","memo","forwardRef","handleSave","setValidationErrors","setRowMoveReason","useMergedRef","cellId","cellValidationError","getValue","ariaLabel","header","globalFilter","getState","state","setState","isHoveringAnotherRowWhileEditing","showValidationError","initialValue","saveIfChanged","eventOrNewValue","newValue","hasChanged","updatedRow","shouldPauseSortingAndFiltering","lastSortedOrFilteredRows","map","error","isFocusInsideTable","isBodyFocussed","body","handleFocus","showIndicator","hideIndicator","willRowMoveReason","isFilteredByGlobalFilter","values","some","cellValue","globalFilterFn","String","IndicatorReason","SEARCH","getIsFiltered","columnFilterFn","getFilterValue","FILTER","getIsSorted","willRowMoveAfterSorting","getRowModel","sorting","find","s","desc","SORTING","setShouldPauseSortingAndFiltering","prevState","newState","cellControl","onBlur","onFocus","getCellAlignmentClasses","align","indicatorMountNode","parentElement","querySelector","controlComponent","setValue","Datepicker","newDate","detail","onChange","Switch","checked","Boolean","Input","indicatorReason","Indicator","reason","columnName","mountNode","ValidationError"],"mappings":";;;;;;;;;;;;;;;;;;MA8BaA,IAAI,GAAG,SAASA,IAAI,CAAkBC,KAAuB;;EACtE,MAAM;IAAEC,IAAI;IAAEC,K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,UAAyC;YAC9C4F,KAAK,EAAEwC;aAEd;UACD;QAEJ,KAAK,QAAQ;UACToD,gBAAgB,gBACZ1L,6BAACgM,MAAM,oBACCtI,UAAU;YACdnD,SAAS,EAAEoC,EAAE,CAAC,MAAM,EAAEsB,mBAAmB,CAAC;YAC1CgI,OAAO,EAAEC,OAAO,CAAC5D,KAAK,CAAC;YACvByD,QAAQ,EAAExD,QAAQ;YAClB3E,GAAG,EAAE1D;aAEZ;UACD;QACJ;UACIwL,gBAAgB,gBACZ1L,6BAACmM,KAAK,oBACEzI,UAAU;YACdnD,SAAS,EAAEoC,EAAE,CAACpC,SAAS,EAAE0D,mBAAmB,CAAC;YAC7C8H,QAAQ,EAAEhJ,KAAK;cACXwF,QAAQ,CAACxF,KAAK,CAAC6B,MAAM,CAACkB,KAAK,CAAC;aAC/B;YACDlC,GAAG,EAAE1D,UAAyC;YAC9C4F,KAAK,EAAEkE,MAAM,CAAC1B,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE;aAEhC;UACD;;;;EAKhB,MAAM8D,eAAe,4BAAGxM,aAAa,CAACmI,MAAM,CAAC,yEAAI,IAAI;EAErD,oBACI/H,4DACKoM,eAAe,KAAK,IAAI,iBACrBpM,6BAACqM,SAAS;IACNC,MAAM,EAAEF,eAAe;IACvBG,UAAU,EAAEvC,MAAM,CAACpL,IAAI,CAACwB,MAAM,CAACC,SAAS,CAAC8H,MAAM,CAAC;IAChDqE,SAAS,EAAEjB;IAElB,eACDvL;IAAMO,SAAS,EAAC;KACXmL,gBAAgB,EAChBjD,mBAAmB,iBAAIzI,6BAACyM,eAAe,QAAEzC,MAAM,CAAChC,mBAAmB,CAAC,CAAmB,CACrF,CACR;AAEX,CAAC,CAAC,CACL;;;;"}
|
@@ -22,9 +22,9 @@ const Header = function Header(props) {
|
|
22
22
|
const textRef = React__default.useRef(null);
|
23
23
|
const pinned = !!header.column.getIsPinned();
|
24
24
|
const isOtherColumnBeingResized = table.getState().columnSizingInfo.isResizingColumn && table.getState().columnSizingInfo.isResizingColumn !== header.id;
|
25
|
-
const className = cn('group/header sticky top-0 bg-white border-b-2 relative font-bold z-[
|
26
|
-
'z-[
|
27
|
-
'z-[
|
25
|
+
const className = cn('group/header sticky top-0 bg-white border-b-2 relative font-bold z-[5] hover:z-[6]', {
|
26
|
+
'z-[6]': header.column.getIsResizing(),
|
27
|
+
'z-[7]': pinned,
|
28
28
|
'cursor-pointer select-none': header.column.getCanSort(),
|
29
29
|
'hover:bg-grey-100': header.column.getCanSort() || header.column.getCanResize() || ((_header$column$column = header.column.columnDef.meta) === null || _header$column$column === void 0 ? void 0 : _header$column$column.menu),
|
30
30
|
'pointer-events-none': isOtherColumnBeingResized
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Header.js","sources":["../../../../../../../../../src/components/Table2/components/column/Header.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { flexRender, Header as RTHeader } from '@tanstack/react-table';\nimport { Icon } from '../../../Icon/Icon';\nimport { ColumnBase, ColumnBaseProps } from './Base';\nimport { Tooltip } from '../../../Tooltip/Tooltip';\nimport { isInternalColumn, MIN_COLUMN_SIZE } from '../../utilities/columns';\nimport { isOverflowing } from '../../../../utils/dom';\nimport { getCellAlignmentClasses, getCellSizingClasses } from '../../utilities/cell';\nimport { IconButton } from '../../../IconButton/IconButton';\n\ntype HeaderProps<TType = unknown> = Omit<ColumnBaseProps<TType>, 'column' | 'isEditing'> & {\n header: RTHeader<TType, unknown>;\n index: number;\n isLastColumn: boolean;\n tableRef: React.RefObject<HTMLDivElement>;\n};\n\nexport const Header = function Header<TType = unknown>(props: HeaderProps<TType>) {\n const { header, index, isLastColumn, table, tableRef, ...columnProps } = props;\n const textRef = React.useRef<HTMLDivElement>(null);\n const pinned = !!header.column.getIsPinned();\n const isOtherColumnBeingResized =\n table.getState().columnSizingInfo.isResizingColumn && table.getState().columnSizingInfo.isResizingColumn !== header.id;\n\n const className = cn(\n 'group/header sticky top-0 bg-white border-b-2 relative font-bold z-[15] hover:z-[16]',\n {\n 'z-[16]': header.column.getIsResizing(),\n 'z-[17]': pinned, // pinned headers should show above cells and other headers, so we add z-index\n 'cursor-pointer select-none': header.column.getCanSort(),\n 'hover:bg-grey-100': header.column.getCanSort() || header.column.getCanResize() || header.column.columnDef.meta?.menu,\n 'pointer-events-none': isOtherColumnBeingResized,\n },\n getCellSizingClasses('normal'),\n header.column.columnDef.meta?.headerClassName,\n props.className\n );\n\n // set the column size after the first render (after auto layout with 'max-content') has run\n // this way columns default to fit their content, then we save that size for resizing\n const refCallback = (node: HTMLDivElement) => {\n if (node && !table.getState().columnSizing[header.id]) {\n const size = Math.ceil(node.getBoundingClientRect().width);\n table.setColumnSizing(sizes => ({\n ...sizes,\n [header.id]: !isInternalColumn(header.id) && size < MIN_COLUMN_SIZE ? MIN_COLUMN_SIZE : size,\n }));\n }\n };\n\n // we use mousedown because clicking and dragging resize and then letting go over the\n // column, results in sorting being applied\n const handleMouseDown = header.column.getCanSort()\n ? (event: React.MouseEvent) => {\n // only detect left clicks\n if (event.button === 0) {\n event.preventDefault();\n table.resetRowSelection();\n header.column.toggleSorting();\n tableRef.current?.focus();\n }\n }\n : undefined;\n\n const handleResizerDoubleClick = () => {\n const size = header.column.columnDef.meta?.defaultWidth;\n table.setColumnSizing(sizes => {\n const nextSizes = { ...sizes };\n\n if (size) {\n nextSizes[header.id] = !isInternalColumn(header.id) && size < MIN_COLUMN_SIZE ? MIN_COLUMN_SIZE : size;\n } else {\n delete nextSizes[header.id];\n }\n\n return nextSizes;\n });\n };\n\n const handleResizerClick = event => {\n event.stopPropagation();\n event.preventDefault();\n };\n\n const handleResize = event => {\n // prevent the parent onMouseDown propagating\n event.stopPropagation();\n header.getResizeHandler()(event);\n };\n\n const content = (\n <div className=\"truncate\" ref={textRef}>\n {flexRender(header.column.columnDef.header, header.getContext())}\n </div>\n );\n\n return (\n <ColumnBase\n {...columnProps}\n // base props\n column={header.column}\n table={table}\n // other props\n aria-sort={\n {\n asc: 'ascending',\n desc: 'descending',\n }[header.column.getIsSorted() as any] ?? 'none'\n }\n className={className}\n onMouseDown={handleMouseDown}\n ref={refCallback}\n role=\"columnheader\"\n // helper props\n data-column-index={index}>\n {isInternalColumn(header.id) ? (\n flexRender(header.column.columnDef.header, header.getContext())\n ) : (\n <div\n className={cn(\n 'flex flex-grow overflow-hidden',\n {\n 'group-hover/header:-ml-2': !!header.column.getIsSorted() && !!header.column.columnDef.meta?.menu,\n },\n getCellAlignmentClasses(header.column.columnDef.meta?.align)\n )}>\n {isOverflowing(textRef.current) ? (\n <Tooltip title={header.column.columnDef.meta?.tooltip ?? content} placement=\"top\">\n {content}\n </Tooltip>\n ) : (\n content\n )}\n {{\n asc: <Icon name=\"chevron-up-solid\" className=\"pointer-events-none -my-0.5\" />,\n desc: <Icon name=\"chevron-down-solid\" className=\"pointer-events-none -my-0.5\" />,\n }[header.column.getIsSorted() as string] ?? null}\n </div>\n )}\n {header.column.columnDef.meta?.menu ? <HeaderMenu header={header} /> : null}\n {header.column.getCanResize() ? (\n <Tooltip placement=\"top\" title=\"Resize column\">\n <div\n className={cn(\n 'invisible absolute right-0 top-0 flex h-full cursor-col-resize touch-none select-none rounded py-0.5 group-hover/header:visible',\n {\n '-mr-2.5 w-5 justify-center': !isLastColumn,\n 'w-2': isLastColumn,\n '!visible': header.column.getIsResizing(),\n }\n )}\n onDoubleClick={handleResizerDoubleClick}\n onMouseDown={handleResize}\n onTouchStart={handleResize}\n // this prevents sort handlers being activated\n onClick={handleResizerClick}>\n <div\n className={cn('h-full w-1 rounded', {\n '!bg-blue-500': header.column.getIsResizing(),\n 'bg-grey-500 hover:bg-grey-700': !header.column.getIsResizing(),\n })}\n />\n </div>\n </Tooltip>\n ) : null}\n </ColumnBase>\n );\n};\n\nconst HeaderMenu = ({ header }) => {\n const [open, setOpen] = React.useState(false);\n\n const className = cn(\n '-my-0.5 -mr-1 -ml-0.5 hidden !h-6 !min-h-[theme(spacing.6)] !w-6 !min-w-[theme(spacing.6)] flex-shrink-0 justify-end group-hover/header:flex',\n {\n '!flex': open,\n }\n );\n return header.column.columnDef.meta ? (\n // This div catches the mousedown events from menu item and menu trigger and prevents\n // mousedown event from bubbling up to the Header component to prevent toggling sorting\n <div onMouseDown={event => event.stopPropagation()}>\n {header.column.columnDef.meta.menu({\n trigger: <IconButton className={className} icon=\"more\" />,\n open: open,\n onChange: setOpen,\n })}\n </div>\n ) : null;\n};\n"],"names":["Header","props","header","index","isLastColumn","table","tableRef","columnProps","textRef","React","useRef","pinned","column","getIsPinned","isOtherColumnBeingResized","getState","columnSizingInfo","isResizingColumn","id","className","cn","getIsResizing","getCanSort","getCanResize","columnDef","meta","menu","getCellSizingClasses","headerClassName","refCallback","node","columnSizing","size","Math","ceil","getBoundingClientRect","width","setColumnSizing","sizes","isInternalColumn","MIN_COLUMN_SIZE","handleMouseDown","event","button","preventDefault","resetRowSelection","toggleSorting","current","focus","undefined","handleResizerDoubleClick","defaultWidth","nextSizes","handleResizerClick","stopPropagation","handleResize","getResizeHandler","content","ref","flexRender","getContext","ColumnBase","asc","desc","getIsSorted","onMouseDown","role","getCellAlignmentClasses","align","isOverflowing","Tooltip","title","tooltip","placement","Icon","name","HeaderMenu","onDoubleClick","onTouchStart","onClick","open","setOpen","useState","trigger","IconButton","icon","onChange"],"mappings":";;;;;;;;;;;MAkBaA,MAAM,GAAG,SAASA,MAAM,CAAkBC,KAAyB;;EAC5E,MAAM;IAAEC,MAAM;IAAEC,KAAK;IAAEC,YAAY;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;GAAa,GAAGN,KAAK;EAC9E,MAAMO,OAAO,GAAGC,cAAK,CAACC,MAAM,CAAiB,IAAI,CAAC;EAClD,MAAMC,MAAM,GAAG,CAAC,CAACT,MAAM,CAACU,MAAM,CAACC,WAAW,EAAE;EAC5C,MAAMC,yBAAyB,GAC3BT,KAAK,CAACU,QAAQ,EAAE,CAACC,gBAAgB,CAACC,gBAAgB,IAAIZ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IAAI,EAAEA,IAAI;IACVM,QAAQ,EAAEL;GACb,CAAC,CACA,GACN,IAAI;AACZ,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../../../../../../../../src/components/Table2/components/column/Header.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { flexRender, Header as RTHeader } from '@tanstack/react-table';\nimport { Icon } from '../../../Icon/Icon';\nimport { ColumnBase, ColumnBaseProps } from './Base';\nimport { Tooltip } from '../../../Tooltip/Tooltip';\nimport { isInternalColumn, MIN_COLUMN_SIZE } from '../../utilities/columns';\nimport { isOverflowing } from '../../../../utils/dom';\nimport { getCellAlignmentClasses, getCellSizingClasses } from '../../utilities/cell';\nimport { IconButton } from '../../../IconButton/IconButton';\n\ntype HeaderProps<TType = unknown> = Omit<ColumnBaseProps<TType>, 'column' | 'isEditing'> & {\n header: RTHeader<TType, unknown>;\n index: number;\n isLastColumn: boolean;\n tableRef: React.RefObject<HTMLDivElement>;\n};\n\nexport const Header = function Header<TType = unknown>(props: HeaderProps<TType>) {\n const { header, index, isLastColumn, table, tableRef, ...columnProps } = props;\n const textRef = React.useRef<HTMLDivElement>(null);\n const pinned = !!header.column.getIsPinned();\n const isOtherColumnBeingResized =\n table.getState().columnSizingInfo.isResizingColumn && table.getState().columnSizingInfo.isResizingColumn !== header.id;\n\n const className = cn(\n 'group/header sticky top-0 bg-white border-b-2 relative font-bold z-[5] hover:z-[6]',\n {\n 'z-[6]': header.column.getIsResizing(),\n 'z-[7]': pinned, // pinned headers should show above cells and other headers, so we assign a higher z-index\n 'cursor-pointer select-none': header.column.getCanSort(),\n 'hover:bg-grey-100': header.column.getCanSort() || header.column.getCanResize() || header.column.columnDef.meta?.menu,\n 'pointer-events-none': isOtherColumnBeingResized,\n },\n getCellSizingClasses('normal'),\n header.column.columnDef.meta?.headerClassName,\n props.className\n );\n\n // set the column size after the first render (after auto layout with 'max-content') has run\n // this way columns default to fit their content, then we save that size for resizing\n const refCallback = (node: HTMLDivElement) => {\n if (node && !table.getState().columnSizing[header.id]) {\n const size = Math.ceil(node.getBoundingClientRect().width);\n table.setColumnSizing(sizes => ({\n ...sizes,\n [header.id]: !isInternalColumn(header.id) && size < MIN_COLUMN_SIZE ? MIN_COLUMN_SIZE : size,\n }));\n }\n };\n\n // we use mousedown because clicking and dragging resize and then letting go over the\n // column, results in sorting being applied\n const handleMouseDown = header.column.getCanSort()\n ? (event: React.MouseEvent) => {\n // only detect left clicks\n if (event.button === 0) {\n event.preventDefault();\n table.resetRowSelection();\n header.column.toggleSorting();\n tableRef.current?.focus();\n }\n }\n : undefined;\n\n const handleResizerDoubleClick = () => {\n const size = header.column.columnDef.meta?.defaultWidth;\n table.setColumnSizing(sizes => {\n const nextSizes = { ...sizes };\n\n if (size) {\n nextSizes[header.id] = !isInternalColumn(header.id) && size < MIN_COLUMN_SIZE ? MIN_COLUMN_SIZE : size;\n } else {\n delete nextSizes[header.id];\n }\n\n return nextSizes;\n });\n };\n\n const handleResizerClick = event => {\n event.stopPropagation();\n event.preventDefault();\n };\n\n const handleResize = event => {\n // prevent the parent onMouseDown propagating\n event.stopPropagation();\n header.getResizeHandler()(event);\n };\n\n const content = (\n <div className=\"truncate\" ref={textRef}>\n {flexRender(header.column.columnDef.header, header.getContext())}\n </div>\n );\n\n return (\n <ColumnBase\n {...columnProps}\n // base props\n column={header.column}\n table={table}\n // other props\n aria-sort={\n {\n asc: 'ascending',\n desc: 'descending',\n }[header.column.getIsSorted() as any] ?? 'none'\n }\n className={className}\n onMouseDown={handleMouseDown}\n ref={refCallback}\n role=\"columnheader\"\n // helper props\n data-column-index={index}>\n {isInternalColumn(header.id) ? (\n flexRender(header.column.columnDef.header, header.getContext())\n ) : (\n <div\n className={cn(\n 'flex flex-grow overflow-hidden',\n {\n 'group-hover/header:-ml-2': !!header.column.getIsSorted() && !!header.column.columnDef.meta?.menu,\n },\n getCellAlignmentClasses(header.column.columnDef.meta?.align)\n )}>\n {isOverflowing(textRef.current) ? (\n <Tooltip title={header.column.columnDef.meta?.tooltip ?? content} placement=\"top\">\n {content}\n </Tooltip>\n ) : (\n content\n )}\n {{\n asc: <Icon name=\"chevron-up-solid\" className=\"pointer-events-none -my-0.5\" />,\n desc: <Icon name=\"chevron-down-solid\" className=\"pointer-events-none -my-0.5\" />,\n }[header.column.getIsSorted() as string] ?? null}\n </div>\n )}\n {header.column.columnDef.meta?.menu ? <HeaderMenu header={header} /> : null}\n {header.column.getCanResize() ? (\n <Tooltip placement=\"top\" title=\"Resize column\">\n <div\n className={cn(\n 'invisible absolute right-0 top-0 flex h-full cursor-col-resize touch-none select-none rounded py-0.5 group-hover/header:visible',\n {\n '-mr-2.5 w-5 justify-center': !isLastColumn,\n 'w-2': isLastColumn,\n '!visible': header.column.getIsResizing(),\n }\n )}\n onDoubleClick={handleResizerDoubleClick}\n onMouseDown={handleResize}\n onTouchStart={handleResize}\n // this prevents sort handlers being activated\n onClick={handleResizerClick}>\n <div\n className={cn('h-full w-1 rounded', {\n '!bg-blue-500': header.column.getIsResizing(),\n 'bg-grey-500 hover:bg-grey-700': !header.column.getIsResizing(),\n })}\n />\n </div>\n </Tooltip>\n ) : null}\n </ColumnBase>\n );\n};\n\nconst HeaderMenu = ({ header }) => {\n const [open, setOpen] = React.useState(false);\n\n const className = cn(\n '-my-0.5 -mr-1 -ml-0.5 hidden !h-6 !min-h-[theme(spacing.6)] !w-6 !min-w-[theme(spacing.6)] flex-shrink-0 justify-end group-hover/header:flex',\n {\n '!flex': open,\n }\n );\n return header.column.columnDef.meta ? (\n // This div catches the mousedown events from menu item and menu trigger and prevents\n // mousedown event from bubbling up to the Header component to prevent toggling sorting\n <div onMouseDown={event => event.stopPropagation()}>\n {header.column.columnDef.meta.menu({\n trigger: <IconButton className={className} icon=\"more\" />,\n open: open,\n onChange: setOpen,\n })}\n </div>\n ) : null;\n};\n"],"names":["Header","props","header","index","isLastColumn","table","tableRef","columnProps","textRef","React","useRef","pinned","column","getIsPinned","isOtherColumnBeingResized","getState","columnSizingInfo","isResizingColumn","id","className","cn","getIsResizing","getCanSort","getCanResize","columnDef","meta","menu","getCellSizingClasses","headerClassName","refCallback","node","columnSizing","size","Math","ceil","getBoundingClientRect","width","setColumnSizing","sizes","isInternalColumn","MIN_COLUMN_SIZE","handleMouseDown","event","button","preventDefault","resetRowSelection","toggleSorting","current","focus","undefined","handleResizerDoubleClick","defaultWidth","nextSizes","handleResizerClick","stopPropagation","handleResize","getResizeHandler","content","ref","flexRender","getContext","ColumnBase","asc","desc","getIsSorted","onMouseDown","role","getCellAlignmentClasses","align","isOverflowing","Tooltip","title","tooltip","placement","Icon","name","HeaderMenu","onDoubleClick","onTouchStart","onClick","open","setOpen","useState","trigger","IconButton","icon","onChange"],"mappings":";;;;;;;;;;;MAkBaA,MAAM,GAAG,SAASA,MAAM,CAAkBC,KAAyB;;EAC5E,MAAM;IAAEC,MAAM;IAAEC,KAAK;IAAEC,YAAY;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;GAAa,GAAGN,KAAK;EAC9E,MAAMO,OAAO,GAAGC,cAAK,CAACC,MAAM,CAAiB,IAAI,CAAC;EAClD,MAAMC,MAAM,GAAG,CAAC,CAACT,MAAM,CAACU,MAAM,CAACC,WAAW,EAAE;EAC5C,MAAMC,yBAAyB,GAC3BT,KAAK,CAACU,QAAQ,EAAE,CAACC,gBAAgB,CAACC,gBAAgB,IAAIZ,KAAK,CAACU,QAAQ,EAAE,CAACC,gBAAgB,CAACC,gBAAgB,KAAKf,MAAM,CAACgB,EAAE;EAE1H,MAAMC,SAAS,GAAGC,EAAE,CAChB,oFAAoF,EACpF;IACI,OAAO,EAAElB,MAAM,CAACU,MAAM,CAACS,aAAa,EAAE;IACtC,OAAO,EAAEV,MAAM;IACf,4BAA4B,EAAET,MAAM,CAACU,MAAM,CAACU,UAAU,EAAE;IACxD,mBAAmB,EAAEpB,MAAM,CAACU,MAAM,CAACU,UAAU,EAAE,IAAIpB,MAAM,CAACU,MAAM,CAACW,YAAY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AAa;KAC1C,CACJ;IACDwD,aAAa,EAAE3B,wBAAwB;IACvCe,WAAW,EAAEV,YAAY;IACzBuB,YAAY,EAAEvB,YAAY;;IAE1BwB,OAAO,EAAE1B;kBACT5C;IACIU,SAAS,EAAEC,EAAE,CAAC,oBAAoB,EAAE;MAChC,cAAc,EAAElB,MAAM,CAACU,MAAM,CAACS,aAAa,EAAE;MAC7C,+BAA+B,EAAE,CAACnB,MAAM,CAACU,MAAM,CAACS,aAAa;KAChE;IACH,CACA,CACA,GACV,IAAI,CACC;AAErB;AAEA,MAAMuD,UAAU,GAAG,CAAC;EAAE1E;CAAQ;EAC1B,MAAM,CAAC8E,IAAI,EAAEC,OAAO,CAAC,GAAGxE,cAAK,CAACyE,QAAQ,CAAC,KAAK,CAAC;EAE7C,MAAM/D,SAAS,GAAGC,EAAE,CAChB,8IAA8I,EAC9I;IACI,OAAO,EAAE4D;GACZ,CACJ;EACD,OAAO9E,MAAM,CAACU,MAAM,CAACY,SAAS,CAACC,IAAI;;;;EAG/BhB;IAAKwD,WAAW,EAAEvB,KAAK,IAAIA,KAAK,CAACY,eAAe;KAC3CpD,MAAM,CAACU,MAAM,CAACY,SAAS,CAACC,IAAI,CAACC,IAAI,CAAC;IAC/ByD,OAAO,eAAE1E,6BAAC2E,UAAU;MAACjE,SAAS,EAAEA,SAAS;MAAEkE,IAAI,EAAC;MAAS;IACzDL,IAAI,EAAEA,IAAI;IACVM,QAAQ,EAAEL;GACb,CAAC,CACA,GACN,IAAI;AACZ,CAAC;;;;"}
|
@@ -21,16 +21,16 @@ const useIndicatorText = reason => {
|
|
21
21
|
} = useLocalization();
|
22
22
|
switch (reason) {
|
23
23
|
case IndicatorReason.SEARCH:
|
24
|
-
title = tableTexts.rowWillBeFiltered;
|
25
|
-
description = tableTexts.searchFilterMovementReason;
|
24
|
+
title = tableTexts.rowIndicator.rowWillBeFiltered;
|
25
|
+
description = tableTexts.rowIndicator.searchFilterMovementReason;
|
26
26
|
break;
|
27
27
|
case IndicatorReason.SORTING:
|
28
|
-
title = tableTexts.rowWillMove;
|
29
|
-
description = tableTexts.sortingMovementReason;
|
28
|
+
title = tableTexts.rowIndicator.rowWillMove;
|
29
|
+
description = tableTexts.rowIndicator.sortingMovementReason;
|
30
30
|
break;
|
31
31
|
case IndicatorReason.FILTER:
|
32
|
-
title = tableTexts.rowWillBeFiltered;
|
33
|
-
description = tableTexts.tableFilterMovementReason;
|
32
|
+
title = tableTexts.rowIndicator.rowWillBeFiltered;
|
33
|
+
description = tableTexts.rowIndicator.tableFilterMovementReason;
|
34
34
|
break;
|
35
35
|
}
|
36
36
|
return {
|
@@ -45,7 +45,7 @@ const Indicator = ({
|
|
45
45
|
}) => {
|
46
46
|
const container = React__default.useMemo(() => {
|
47
47
|
const element = document.createElement('div');
|
48
|
-
element.className += '-translate-y-1/2 z-[
|
48
|
+
element.className += '-translate-y-1/2 z-[3] rounded-full items-center wcag-blue-500 absolute left-0 top-full ml-1 whitespace-nowrap px-1 py-0.5 text-xs font-bold shadow-sm';
|
49
49
|
return element;
|
50
50
|
}, []);
|
51
51
|
const indicatorText = useIndicatorText(reason);
|