@economic/taco 2.4.3 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Table3/hooks/features/useSettings.d.ts +1 -0
- package/dist/components/Table3/hooks/useTable.d.ts +1 -0
- package/dist/components/Table3/types.d.ts +1 -0
- package/dist/esm/index.css +5 -0
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js +2 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +3 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js +2 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js +7 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js +6 -3
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js +5 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTablePreset.js +5 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTablePreset.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js.map +1 -1
- package/dist/index.css +5 -0
- package/dist/taco.cjs.development.js +31 -10
- 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 +5126 -5032
@@ -1,2 +1,3 @@
|
|
1
1
|
import { Table3Settings, Table3SettingsHandler } from '../../types';
|
2
|
+
export declare function useUniqueTableId(tableId: string): string;
|
2
3
|
export declare function useSettings(id: string, defaultSettings: Table3Settings | undefined, onChangeSettings: Table3SettingsHandler | undefined): [Table3Settings, Table3SettingsHandler];
|
@@ -22,6 +22,7 @@ declare module '@tanstack/table-core' {
|
|
22
22
|
columnOrdering: ReturnType<typeof useColumnOrdering>;
|
23
23
|
currentRow: ReturnType<typeof useCurrentRow>;
|
24
24
|
editing: ReturnType<typeof useEditing>;
|
25
|
+
enableFooter: boolean;
|
25
26
|
fontSize: ReturnType<typeof useFontSize>;
|
26
27
|
hoverState: ReturnType<typeof usePauseHoverState>;
|
27
28
|
isUsingServer: boolean;
|
package/dist/esm/index.css
CHANGED
@@ -673,6 +673,11 @@
|
|
673
673
|
@apply bg-grey-100;
|
674
674
|
}
|
675
675
|
|
676
|
+
/* dragged over row */
|
677
|
+
[data-pause-hover='false'] [data-taco='table2-body'] [role='row'][data-dragged-over='true'] [role='cell'] {
|
678
|
+
@apply bg-grey-100;
|
679
|
+
}
|
680
|
+
|
676
681
|
/* current row */
|
677
682
|
[data-taco='table2-body'] [role='row'][data-current='true'] [role='cell'] {
|
678
683
|
@apply bg-grey-200;
|
@@ -71,7 +71,7 @@ const Cell = function Cell(props) {
|
|
71
71
|
return (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.classList.remove('pb-4');
|
72
72
|
};
|
73
73
|
}, [isIndicatorVisible, isLastRow]);
|
74
|
-
const className = cn('[&>[data-taco="tag"]]:-my-0.5', {
|
74
|
+
const className = cn('[&>[data-taco="tag"]]:-my-0.5', '[[data-dragged-over="true"]_&]:bg-grey-100', {
|
75
75
|
'border-b': !isLastRow,
|
76
76
|
'sticky z-[1]': isFrozen,
|
77
77
|
// use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating
|
@@ -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';\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 { clickableNodeNames, 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 {\n editMode: { validationErrors, rowMoveReason },\n isHovered: isHoveredRow,\n } = useRowContext();\n const hasValidationErrorsInRow = !!validationErrors;\n\n const internalRef = React.useRef<HTMLDivElement>(null);\n const controlRef = React.useRef<HTMLElement>(null);\n const cellClassName = cell.column.columnDef.meta?.className;\n\n const isActiveRow = meta.activeRowIndex === rowIndex;\n const isFrozen = !!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 && !meta.shouldPauseHoverState;\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 '[&>[data-taco=\"tag\"]]:-my-0.5',\n {\n 'border-b': !isLastRow,\n 'sticky z-[1]': isFrozen,\n // use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating\n 'bg-white': !isActiveRow && !isSelected,\n 'group-hover/row:bg-grey-100': !isActiveRow && !isSelected && !meta.shouldPauseHoverState,\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]': isFrozen && isActiveRow,\n // First column should have higher z-index so that row indicator always show on top of the cell\n // control components. A z-index of 3, will show the indicator when columns are pinned.\n 'z-[3]': isFrozen && 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, table) : 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 as HTMLElement;\n const isTargetInput = target !== null && target.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 attributes.onBlur = () => {\n setDetailModeEditing(false);\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 } else {\n input?.select?.();\n }\n\n setDetailModeEditing(!detailModeEditing);\n\n return;\n }\n\n // Datepicker doesn't have keydown event handler its value doesn't change when user types inside\n // datepicker input, so we need to explicitly enable detail editing mode on typing any alphanumeric\n // character\n if (control?.closest('[data-taco=\"datepicker\"]') && /^[a-z0-9]$/i.test(event.key)) {\n setDetailModeEditing(true);\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\n if (detailModeEditing) {\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.setShouldPauseHoverState(true);\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.setShouldPauseHoverState(true);\n return;\n }\n };\n }\n\n return (\n <ColumnBase {...attributes}>\n <EditingCell\n detailModeEditing={detailModeEditing}\n cell={cell}\n cellRef={internalRef}\n columnIndex={index}\n isEditingThisCell={isEditingThisCell}\n onSave={meta.editMode.onSave}\n rowIndex={rowIndex}\n table={table}\n tableRef={tableRef}\n ref={controlRef}\n rowValues={rows[rowIndex].original}\n rowsLength={rows.length}\n enableDetailModeEditing={() => {\n if (!detailModeEditing) {\n setDetailModeEditing(true);\n }\n }}\n />\n </ColumnBase>\n );\n } else {\n if (meta.onRowClick) {\n attributes.onClick = (event: React.MouseEvent<HTMLElement>) => {\n const { target } = event;\n // This check prevents triggering row click, when a click is performed in the dropdown (e.g. Select option or DayPicker date selection)\n if (internalRef.current && target instanceof HTMLElement && internalRef.current.contains(target)) {\n // Checking that target is clickable element or it is a child of clickable element\n if (\n clickableNodeNames.includes(target.tagName) ||\n target.closest(clickableNodeNames.map(tag => `[role=row] ${tag}`).join(','))\n ) {\n return;\n }\n\n meta.onRowClick?.(cell.row.original);\n }\n };\n }\n }\n\n return <ColumnBase {...attributes}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</ColumnBase>;\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 tableRef: React.RefObject<HTMLDivElement>;\n rowValues: Record<string, any>;\n rowsLength: number;\n detailModeEditing: boolean;\n enableDetailModeEditing: () => void;\n};\n\nconst EditingCell = React.memo(\n React.forwardRef<HTMLElement, EditingCellProps>((props, ref) => {\n const {\n cell,\n cellRef,\n columnIndex,\n detailModeEditing,\n isEditingThisCell = false,\n onSave: handleSave,\n rowIndex,\n rowValues,\n table,\n tableRef,\n enableDetailModeEditing,\n } = props;\n const {\n editMode: { validationErrors, setValidationErrors, rowMoveReason, setRowMoveReason },\n isHovered,\n } = 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 = meta.editMode.isEditing && meta.activeRowIndex !== rowIndex && isHovered;\n const hasValidationError = !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 const stateReset = React.useRef(false);\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 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({ ...validationErrors, ...(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 const pinnedColumnsWidth = React.useMemo(() => {\n const pinnedColumns = table.getState().columnPinning.left;\n\n if (Array.isArray(pinnedColumns) && pinnedColumns.length > 0) {\n const lastFrozenColumn = pinnedColumns[pinnedColumns.length - 1];\n const lastFrozenColumnOffset = meta.columnOffsets[lastFrozenColumn];\n\n if (lastFrozenColumnOffset !== undefined) {\n return lastFrozenColumnOffset + (table.getState().columnSizing[lastFrozenColumn] ?? 0);\n }\n }\n\n return 0;\n }, [meta.columnOffsets, table.getState().columnSizing]);\n\n React.useEffect(() => {\n if (hasChanged(initialValue.current, state)) {\n // For an input we want to make sure that if the value is changed then we go into detail mode, so that\n // arrow keys doesn't trigger the quick mode shortcuts.\n if (controlRef.current?.nodeName === 'INPUT') {\n enableDetailModeEditing();\n }\n\n showIndicator();\n } else {\n hideIndicator();\n }\n\n return hideIndicator;\n }, [state]);\n\n // This effect makes sure we select the input control value when escape key is pressed\n React.useEffect(() => {\n const isControlInput =\n controlRef.current?.nodeName === 'INPUT' &&\n controlRef.current?.getAttribute('data-inline-editing-component') === 'true';\n\n if (stateReset.current && isControlInput) {\n (controlRef.current as HTMLInputElement)?.select();\n }\n\n stateReset.current = false;\n }, [stateReset.current]);\n\n const handleFocus = event => {\n meta.editMode.setColumn(columnIndex);\n\n if (event.target?.select) {\n event.target?.select();\n }\n\n // ensure the field is always visible (e.g. not hidden behind the pinned columns)\n const rect = cellRef.current?.getBoundingClientRect();\n const leftOffset = meta.columnOffsets[cellId];\n\n if (rect && leftOffset && rect.left < pinnedColumnsWidth) {\n tableRef.current?.scrollTo(leftOffset - pinnedColumnsWidth, tableRef.current.scrollTop);\n }\n };\n\n // In order to reset the value of an input when escape key is pressed this keydown handler is required.\n // Instead of adding this event handler in parent component, this handler is added here because we have access\n // to the state handler of the control component.\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const control = event.target as HTMLInputElement;\n const isControlInput =\n control.nodeName === 'INPUT' && control?.getAttribute('data-inline-editing-component') === 'true';\n\n if (isControlInput && event.key === 'Escape') {\n setState(initialValue.current);\n stateReset.current = true;\n }\n };\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 const detailModeClassName = cn({ '!yt-focus-dark': detailModeEditing });\n\n if (cellControl) {\n if (typeof cellControl === 'function') {\n controlComponent = cellControl(\n {\n invalid: hasValidationError,\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 className={cn({ '[&_input]:!shadow-[0_0_0_4px_rgba(0,99,255,0.25)]': detailModeEditing })}\n invalid={hasValidationError}\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 mt-1.5', 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 invalid={hasValidationError}\n onChange={event => {\n setState(event.target.value);\n }}\n ref={controlRef as RefObject<HTMLInputElement>}\n value={String(state ?? '')}\n onKeyDown={handleKeyDown}\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 validationErrors={validationErrors}\n />\n )}\n <span className=\"relative flex-grow\">\n {controlComponent}\n {hasValidationError && <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","editMode","validationErrors","rowMoveReason","isHovered","isHoveredRow","useRowContext","hasValidationErrorsInRow","internalRef","React","useRef","controlRef","cellClassName","_cell$column$columnDe","column","columnDef","className","isActiveRow","activeRowIndex","isFrozen","getIsPinned","isDragging","dragging","row","id","isSelected","getIsSelected","isDataColumn","isInternalColumn","hasCellControl","_cell$column$columnDe2","control","allVisibleColumns","getVisibleLeafColumns","lastColumnIndex","length","isEditingThisRow","isEditing","canEditThisCell","isEditingThisCell","columnIndex","isHoveringThisRowWhileEditing","shouldPauseHoverState","isIndicatorVisible","Object","keys","useEffect","_tableRef$current","current","classList","add","_tableRef$current2","remove","cn","getCellSizingClasses","_table$options$meta","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","onBlur","_allFocussableColumnI","_allFocussableColumnI2","firstDataColumnIndex","at","lastDataColumnIndex","onKeyDown","isControlInput","getAttribute","isDefaultPrevented","isPropagationStopped","tagName","key","input","_input$setSelectionRa","_input$value","_input$value2","setSelectionRange","call","value","_input$select","test","currentTarget","contains","_tableRef$current3","toggleEditing","focus","shiftKey","isFirstRow","isFirstColumn","ctrlKey","metaKey","moveToFirstColumn","moveToPreviousColumn","isLastColumn","moveToLastColumn","moveToNextColumn","setShouldPauseHoverState","ColumnBase","EditingCell","cellRef","rowValues","original","rowsLength","enableDetailModeEditing","onRowClick","onClick","HTMLElement","_meta$onRowClick","clickableNodeNames","map","tag","join","flexRender","getContext","memo","forwardRef","handleSave","setValidationErrors","setRowMoveReason","useMergedRef","cellId","cellValidationError","getValue","ariaLabel","header","globalFilter","getState","state","setState","isHoveringAnotherRowWhileEditing","hasValidationError","initialValue","stateReset","saveIfChanged","eventOrNewValue","newValue","_temp2","hasChanged","_temp","_catch","updatedRow","Promise","resolve","then","shouldPauseSortingAndFiltering","lastSortedOrFilteredRows","error","e","reject","isFocusInsideTable","_meta$tableRef$curren","isBodyFocussed","body","_controlRef$current","_controlRef$current$f","pinnedColumnsWidth","useMemo","pinnedColumns","columnPinning","left","Array","isArray","lastFrozenColumn","lastFrozenColumnOffset","columnOffsets","undefined","_table$getState$colum","columnSizing","_controlRef$current2","showIndicator","hideIndicator","_controlRef$current3","_controlRef$current4","_controlRef$current5","handleFocus","_event$target","_event$target2","rect","_cellRef$current","getBoundingClientRect","leftOffset","_tableRef$current4","scrollTo","scrollTop","handleKeyDown","willRowMoveReason","isFilteredByGlobalFilter","values","some","cellValue","globalFilterFn","String","IndicatorReason","SEARCH","getIsFiltered","columnFilterFn","getFilterValue","FILTER","getIsSorted","willRowMoveAfterSorting","getRowModel","_table$getState$sorti","sorting","find","s","desc","SORTING","setShouldPauseSortingAndFiltering","prevState","newState","cellControl","_cell$column$columnDe3","onFocus","getCellAlignmentClasses","_cell$column$columnDe4","align","indicatorMountNode","_cellRef$current2","_cellRef$current2$par","parentElement","querySelector","controlComponent","detailModeClassName","invalid","setValue","Datepicker","newDate","detail","onChange","Switch","checked","Boolean","Input","indicatorReason","_rowMoveReason$cellId","Indicator","reason","columnName","mountNode","ValidationError"],"mappings":";;;;;;;;;;;;;;;;;;MA6BaA,IAAI,GAAG,SAASA,IAAIA,CAAkBC,KAAuB;;EACtE,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC,SAAS;IAAEC,QAAQ;IAAEC,IAAI;IA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BACZrP,6BAACgQ,KAAK,oBACEpM,UAAU;YACdrD,SAAS,EAAEqC,EAAE,CAACrC,SAAS,EAAE+O,mBAAmB,CAAC;YAC7CC,OAAO,EAAE7F,kBAAkB;YAC3BkG,QAAQ,EAAE3M,KAAK;cACXuG,QAAQ,CAACvG,KAAK,CAAC4B,MAAM,CAACyB,KAAK,CAAC;aAC/B;YACDxC,GAAG,EAAE5D,UAAyC;YAC9CoG,KAAK,EAAEiH,MAAM,CAAChE,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC;YAC1B9D,SAAS,EAAEuH;aAElB;UACD;;;;EAKhB,MAAMiD,eAAe,IAAAC,qBAAA,GAAGxQ,aAAa,CAACsJ,MAAM,CAAC,cAAAkH,qBAAA,cAAAA,qBAAA,GAAI,IAAI;EAErD,oBACIlQ,4DACKiQ,eAAe,KAAK,IAAI,iBACrBjQ,6BAACmQ,SAAS;IACNC,MAAM,EAAEH,eAAe;IACvBI,UAAU,EAAE9C,MAAM,CAAC9O,IAAI,CAAC4B,MAAM,CAACC,SAAS,CAAC8I,MAAM,CAAC;IAChDkH,SAAS,EAAEtB,kBAAkB;IAC7BvP,gBAAgB,EAAEA;IAEzB,eACDO;IAAMO,SAAS,EAAC;KACX8O,gBAAgB,EAChB3F,kBAAkB,iBAAI1J,6BAACuQ,eAAe,QAAEhD,MAAM,CAACtE,mBAAmB,CAAC,CAAmB,CACpF,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';\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 { clickableNodeNames, 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 {\n editMode: { validationErrors, rowMoveReason },\n isHovered: isHoveredRow,\n } = useRowContext();\n const hasValidationErrorsInRow = !!validationErrors;\n\n const internalRef = React.useRef<HTMLDivElement>(null);\n const controlRef = React.useRef<HTMLElement>(null);\n const cellClassName = cell.column.columnDef.meta?.className;\n\n const isActiveRow = meta.activeRowIndex === rowIndex;\n const isFrozen = !!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 && !meta.shouldPauseHoverState;\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 '[&>[data-taco=\"tag\"]]:-my-0.5',\n '[[data-dragged-over=\"true\"]_&]:bg-grey-100',\n {\n 'border-b': !isLastRow,\n 'sticky z-[1]': isFrozen,\n // use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating\n 'bg-white': !isActiveRow && !isSelected,\n 'group-hover/row:bg-grey-100': !isActiveRow && !isSelected && !meta.shouldPauseHoverState,\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]': isFrozen && isActiveRow,\n // First column should have higher z-index so that row indicator always show on top of the cell\n // control components. A z-index of 3, will show the indicator when columns are pinned.\n 'z-[3]': isFrozen && 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, table) : 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 as HTMLElement;\n const isTargetInput = target !== null && target.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 attributes.onBlur = () => {\n setDetailModeEditing(false);\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 } else {\n input?.select?.();\n }\n\n setDetailModeEditing(!detailModeEditing);\n\n return;\n }\n\n // Datepicker doesn't have keydown event handler its value doesn't change when user types inside\n // datepicker input, so we need to explicitly enable detail editing mode on typing any alphanumeric\n // character\n if (control?.closest('[data-taco=\"datepicker\"]') && /^[a-z0-9]$/i.test(event.key)) {\n setDetailModeEditing(true);\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\n if (detailModeEditing) {\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.setShouldPauseHoverState(true);\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.setShouldPauseHoverState(true);\n return;\n }\n };\n }\n\n return (\n <ColumnBase {...attributes}>\n <EditingCell\n detailModeEditing={detailModeEditing}\n cell={cell}\n cellRef={internalRef}\n columnIndex={index}\n isEditingThisCell={isEditingThisCell}\n onSave={meta.editMode.onSave}\n rowIndex={rowIndex}\n table={table}\n tableRef={tableRef}\n ref={controlRef}\n rowValues={rows[rowIndex].original}\n rowsLength={rows.length}\n enableDetailModeEditing={() => {\n if (!detailModeEditing) {\n setDetailModeEditing(true);\n }\n }}\n />\n </ColumnBase>\n );\n } else {\n if (meta.onRowClick) {\n attributes.onClick = (event: React.MouseEvent<HTMLElement>) => {\n const { target } = event;\n // This check prevents triggering row click, when a click is performed in the dropdown (e.g. Select option or DayPicker date selection)\n if (internalRef.current && target instanceof HTMLElement && internalRef.current.contains(target)) {\n // Checking that target is clickable element or it is a child of clickable element\n if (\n clickableNodeNames.includes(target.tagName) ||\n target.closest(clickableNodeNames.map(tag => `[role=row] ${tag}`).join(','))\n ) {\n return;\n }\n\n meta.onRowClick?.(cell.row.original);\n }\n };\n }\n }\n\n return <ColumnBase {...attributes}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</ColumnBase>;\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 tableRef: React.RefObject<HTMLDivElement>;\n rowValues: Record<string, any>;\n rowsLength: number;\n detailModeEditing: boolean;\n enableDetailModeEditing: () => void;\n};\n\nconst EditingCell = React.memo(\n React.forwardRef<HTMLElement, EditingCellProps>((props, ref) => {\n const {\n cell,\n cellRef,\n columnIndex,\n detailModeEditing,\n isEditingThisCell = false,\n onSave: handleSave,\n rowIndex,\n rowValues,\n table,\n tableRef,\n enableDetailModeEditing,\n } = props;\n const {\n editMode: { validationErrors, setValidationErrors, rowMoveReason, setRowMoveReason },\n isHovered,\n } = 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 = meta.editMode.isEditing && meta.activeRowIndex !== rowIndex && isHovered;\n const hasValidationError = !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 const stateReset = React.useRef(false);\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 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({ ...validationErrors, ...(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 const pinnedColumnsWidth = React.useMemo(() => {\n const pinnedColumns = table.getState().columnPinning.left;\n\n if (Array.isArray(pinnedColumns) && pinnedColumns.length > 0) {\n const lastFrozenColumn = pinnedColumns[pinnedColumns.length - 1];\n const lastFrozenColumnOffset = meta.columnOffsets[lastFrozenColumn];\n\n if (lastFrozenColumnOffset !== undefined) {\n return lastFrozenColumnOffset + (table.getState().columnSizing[lastFrozenColumn] ?? 0);\n }\n }\n\n return 0;\n }, [meta.columnOffsets, table.getState().columnSizing]);\n\n React.useEffect(() => {\n if (hasChanged(initialValue.current, state)) {\n // For an input we want to make sure that if the value is changed then we go into detail mode, so that\n // arrow keys doesn't trigger the quick mode shortcuts.\n if (controlRef.current?.nodeName === 'INPUT') {\n enableDetailModeEditing();\n }\n\n showIndicator();\n } else {\n hideIndicator();\n }\n\n return hideIndicator;\n }, [state]);\n\n // This effect makes sure we select the input control value when escape key is pressed\n React.useEffect(() => {\n const isControlInput =\n controlRef.current?.nodeName === 'INPUT' &&\n controlRef.current?.getAttribute('data-inline-editing-component') === 'true';\n\n if (stateReset.current && isControlInput) {\n (controlRef.current as HTMLInputElement)?.select();\n }\n\n stateReset.current = false;\n }, [stateReset.current]);\n\n const handleFocus = event => {\n meta.editMode.setColumn(columnIndex);\n\n if (event.target?.select) {\n event.target?.select();\n }\n\n // ensure the field is always visible (e.g. not hidden behind the pinned columns)\n const rect = cellRef.current?.getBoundingClientRect();\n const leftOffset = meta.columnOffsets[cellId];\n\n if (rect && leftOffset && rect.left < pinnedColumnsWidth) {\n tableRef.current?.scrollTo(leftOffset - pinnedColumnsWidth, tableRef.current.scrollTop);\n }\n };\n\n // In order to reset the value of an input when escape key is pressed this keydown handler is required.\n // Instead of adding this event handler in parent component, this handler is added here because we have access\n // to the state handler of the control component.\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const control = event.target as HTMLInputElement;\n const isControlInput =\n control.nodeName === 'INPUT' && control?.getAttribute('data-inline-editing-component') === 'true';\n\n if (isControlInput && event.key === 'Escape') {\n setState(initialValue.current);\n stateReset.current = true;\n }\n };\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 const detailModeClassName = cn({ '!yt-focus-dark': detailModeEditing });\n\n if (cellControl) {\n if (typeof cellControl === 'function') {\n controlComponent = cellControl(\n {\n invalid: hasValidationError,\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 className={cn({ '[&_input]:!shadow-[0_0_0_4px_rgba(0,99,255,0.25)]': detailModeEditing })}\n invalid={hasValidationError}\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 mt-1.5', 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 invalid={hasValidationError}\n onChange={event => {\n setState(event.target.value);\n }}\n ref={controlRef as RefObject<HTMLInputElement>}\n value={String(state ?? '')}\n onKeyDown={handleKeyDown}\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 validationErrors={validationErrors}\n />\n )}\n <span className=\"relative flex-grow\">\n {controlComponent}\n {hasValidationError && <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","editMode","validationErrors","rowMoveReason","isHovered","isHoveredRow","useRowContext","hasValidationErrorsInRow","internalRef","React","useRef","controlRef","cellClassName","_cell$column$columnDe","column","columnDef","className","isActiveRow","activeRowIndex","isFrozen","getIsPinned","isDragging","dragging","row","id","isSelected","getIsSelected","isDataColumn","isInternalColumn","hasCellControl","_cell$column$columnDe2","control","allVisibleColumns","getVisibleLeafColumns","lastColumnIndex","length","isEditingThisRow","isEditing","canEditThisCell","isEditingThisCell","columnIndex","isHoveringThisRowWhileEditing","shouldPauseHoverState","isIndicatorVisible","Object","keys","useEffect","_tableRef$current","current","classList","add","_tableRef$current2","remove","cn","getCellSizingClasses","_table$options$meta","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","onBlur","_allFocussableColumnI","_allFocussableColumnI2","firstDataColumnIndex","at","lastDataColumnIndex","onKeyDown","isControlInput","getAttribute","isDefaultPrevented","isPropagationStopped","tagName","key","input","_input$setSelectionRa","_input$value","_input$value2","setSelectionRange","call","value","_input$select","test","currentTarget","contains","_tableRef$current3","toggleEditing","focus","shiftKey","isFirstRow","isFirstColumn","ctrlKey","metaKey","moveToFirstColumn","moveToPreviousColumn","isLastColumn","moveToLastColumn","moveToNextColumn","setShouldPauseHoverState","ColumnBase","EditingCell","cellRef","rowValues","original","rowsLength","enableDetailModeEditing","onRowClick","onClick","HTMLElement","_meta$onRowClick","clickableNodeNames","map","tag","join","flexRender","getContext","memo","forwardRef","handleSave","setValidationErrors","setRowMoveReason","useMergedRef","cellId","cellValidationError","getValue","ariaLabel","header","globalFilter","getState","state","setState","isHoveringAnotherRowWhileEditing","hasValidationError","initialValue","stateReset","saveIfChanged","eventOrNewValue","newValue","_temp2","hasChanged","_temp","_catch","updatedRow","Promise","resolve","then","shouldPauseSortingAndFiltering","lastSortedOrFilteredRows","error","e","reject","isFocusInsideTable","_meta$tableRef$curren","isBodyFocussed","body","_controlRef$current","_controlRef$current$f","pinnedColumnsWidth","useMemo","pinnedColumns","columnPinning","left","Array","isArray","lastFrozenColumn","lastFrozenColumnOffset","columnOffsets","undefined","_table$getState$colum","columnSizing","_controlRef$current2","showIndicator","hideIndicator","_controlRef$current3","_controlRef$current4","_controlRef$current5","handleFocus","_event$target","_event$target2","rect","_cellRef$current","getBoundingClientRect","leftOffset","_tableRef$current4","scrollTo","scrollTop","handleKeyDown","willRowMoveReason","isFilteredByGlobalFilter","values","some","cellValue","globalFilterFn","String","IndicatorReason","SEARCH","getIsFiltered","columnFilterFn","getFilterValue","FILTER","getIsSorted","willRowMoveAfterSorting","getRowModel","_table$getState$sorti","sorting","find","s","desc","SORTING","setShouldPauseSortingAndFiltering","prevState","newState","cellControl","_cell$column$columnDe3","onFocus","getCellAlignmentClasses","_cell$column$columnDe4","align","indicatorMountNode","_cellRef$current2","_cellRef$current2$par","parentElement","querySelector","controlComponent","detailModeClassName","invalid","setValue","Datepicker","newDate","detail","onChange","Switch","checked","Boolean","Input","indicatorReason","_rowMoveReason$cellId","Indicator","reason","columnName","mountNode","ValidationError"],"mappings":";;;;;;;;;;;;;;;;;;MA6BaA,IAAI,GAAG,SAASA,IAAIA,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;IACFK,QAAQ,EAAE;MAAEC,gBAAgB;MAAEC;KAAe;IAC7CC,SAAS,EAAEC;GACd,GAAGC,aAAa,EAAE;EACnB,MAAMC,wBAAwB,GAAG,CAAC,CAACL,gBAAgB;EAEnD,MAAMM,WAAW,GAAGC,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;;EAKhB,MAAMiD,eAAe,IAAAC,qBAAA,GAAGxQ,aAAa,CAACsJ,MAAM,CAAC,cAAAkH,qBAAA,cAAAA,qBAAA,GAAI,IAAI;EAErD,oBACIlQ,4DACKiQ,eAAe,KAAK,IAAI,iBACrBjQ,6BAACmQ,SAAS;IACNC,MAAM,EAAEH,eAAe;IACvBI,UAAU,EAAE9C,MAAM,CAAC9O,IAAI,CAAC4B,MAAM,CAACC,SAAS,CAAC8I,MAAM,CAAC;IAChDkH,SAAS,EAAEtB,kBAAkB;IAC7BvP,gBAAgB,EAAEA;IAEzB,eACDO;IAAMO,SAAS,EAAC;KACX8O,gBAAgB,EAChB3F,kBAAkB,iBAAI1J,6BAACuQ,eAAe,QAAEhD,MAAM,CAACtE,mBAAmB,CAAC,CAAmB,CACpF,CACR;AAEX,CAAC,CAAC,CACL;;;;"}
|
@@ -15,13 +15,14 @@ const InternalRow = ({
|
|
15
15
|
const meta = table.options.meta;
|
16
16
|
const isActiveRow = meta.activeRowIndex === rowIndex;
|
17
17
|
const isDragging = meta.dragging[row.id];
|
18
|
-
const [, dropTargetProps] = useDropTarget(event => onRowDrop(event, row.original));
|
18
|
+
const [isDraggedOver, dropTargetProps] = useDropTarget(event => onRowDrop(event, row.original));
|
19
19
|
const attributes = {
|
20
20
|
...props,
|
21
21
|
...(typeof onRowDrop === 'function' ? dropTargetProps : undefined),
|
22
22
|
'aria-current': isActiveRow ? true : undefined,
|
23
23
|
'aria-grabbed': isDragging ? true : undefined,
|
24
24
|
'data-row-index': rowIndex,
|
25
|
+
'data-dragged-over': isDraggedOver,
|
25
26
|
draggable: meta.enableRowDragging ? true : undefined,
|
26
27
|
onMouseEnter: () => setIsHovered(true),
|
27
28
|
onMouseLeave: () => setIsHovered(false),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Row.js","sources":["../../../../../../../../../src/components/Table2/components/row/Row.tsx"],"sourcesContent":["import React from 'react';\nimport { TableMeta } from '@tanstack/react-table';\nimport { RowContextProvider, useRowContext } from './Context';\nimport { useDropTarget } from '../../../../utils/hooks/useDropTarget';\n\nconst InternalRow = ({ onRowDrop, row, rowIndex, table, ...props }) => {\n const { setIsHovered } = useRowContext();\n\n const meta = table.options.meta as TableMeta<any>;\n const isActiveRow = meta.activeRowIndex === rowIndex;\n const isDragging = meta.dragging[row.id];\n\n const [, dropTargetProps] = useDropTarget(event => onRowDrop(event, row.original));\n\n const attributes = {\n ...props,\n ...(typeof onRowDrop === 'function' ? dropTargetProps : undefined),\n 'aria-current': isActiveRow ? true : undefined,\n 'aria-grabbed': isDragging ? true : undefined,\n 'data-row-index': rowIndex,\n draggable: meta.enableRowDragging ? true : undefined,\n onMouseEnter: () => setIsHovered(true),\n onMouseLeave: () => setIsHovered(false),\n role: 'row',\n };\n\n return <div {...attributes} />;\n};\n\nexport const Row = props => {\n const meta = props.table.options.meta as TableMeta<any>;\n const isActiveRow = meta.activeRowIndex === props.rowIndex;\n\n return (\n <RowContextProvider isActiveRow={isActiveRow} meta={props.table.options.meta} rowIndex={props.rowIndex}>\n <InternalRow {...props} />\n </RowContextProvider>\n );\n};\n"],"names":["InternalRow","onRowDrop","row","rowIndex","table","props","setIsHovered","useRowContext","meta","options","isActiveRow","activeRowIndex","isDragging","dragging","id","dropTargetProps","useDropTarget","event","original","attributes","undefined","draggable","enableRowDragging","onMouseEnter","onMouseLeave","role","React","Row","RowContextProvider"],"mappings":";;;;AAKA,MAAMA,WAAW,GAAGA,CAAC;EAAEC,SAAS;EAAEC,GAAG;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;CAAO;EAC9D,MAAM;IAAEC;GAAc,GAAGC,aAAa,EAAE;EAExC,MAAMC,IAAI,GAAGJ,KAAK,CAACK,OAAO,CAACD,IAAsB;EACjD,MAAME,WAAW,GAAGF,IAAI,CAACG,cAAc,KAAKR,QAAQ;EACpD,MAAMS,UAAU,GAAGJ,IAAI,CAACK,QAAQ,CAACX,GAAG,CAACY,EAAE,CAAC;EAExC,MAAM,
|
1
|
+
{"version":3,"file":"Row.js","sources":["../../../../../../../../../src/components/Table2/components/row/Row.tsx"],"sourcesContent":["import React from 'react';\nimport { TableMeta } from '@tanstack/react-table';\nimport { RowContextProvider, useRowContext } from './Context';\nimport { useDropTarget } from '../../../../utils/hooks/useDropTarget';\n\nconst InternalRow = ({ onRowDrop, row, rowIndex, table, ...props }) => {\n const { setIsHovered } = useRowContext();\n\n const meta = table.options.meta as TableMeta<any>;\n const isActiveRow = meta.activeRowIndex === rowIndex;\n const isDragging = meta.dragging[row.id];\n\n const [isDraggedOver, dropTargetProps] = useDropTarget(event => onRowDrop(event, row.original));\n\n const attributes = {\n ...props,\n ...(typeof onRowDrop === 'function' ? dropTargetProps : undefined),\n 'aria-current': isActiveRow ? true : undefined,\n 'aria-grabbed': isDragging ? true : undefined,\n 'data-row-index': rowIndex,\n 'data-dragged-over': isDraggedOver,\n draggable: meta.enableRowDragging ? true : undefined,\n onMouseEnter: () => setIsHovered(true),\n onMouseLeave: () => setIsHovered(false),\n role: 'row',\n };\n\n return <div {...attributes} />;\n};\n\nexport const Row = props => {\n const meta = props.table.options.meta as TableMeta<any>;\n const isActiveRow = meta.activeRowIndex === props.rowIndex;\n\n return (\n <RowContextProvider isActiveRow={isActiveRow} meta={props.table.options.meta} rowIndex={props.rowIndex}>\n <InternalRow {...props} />\n </RowContextProvider>\n );\n};\n"],"names":["InternalRow","onRowDrop","row","rowIndex","table","props","setIsHovered","useRowContext","meta","options","isActiveRow","activeRowIndex","isDragging","dragging","id","isDraggedOver","dropTargetProps","useDropTarget","event","original","attributes","undefined","draggable","enableRowDragging","onMouseEnter","onMouseLeave","role","React","Row","RowContextProvider"],"mappings":";;;;AAKA,MAAMA,WAAW,GAAGA,CAAC;EAAEC,SAAS;EAAEC,GAAG;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;CAAO;EAC9D,MAAM;IAAEC;GAAc,GAAGC,aAAa,EAAE;EAExC,MAAMC,IAAI,GAAGJ,KAA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/*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
132
132
|
"data-taco": "table2-body",
|
133
133
|
role: "rowgroup"
|
134
134
|
}, renderBody())), /*#__PURE__*/React__default.createElement("div", {
|
135
|
+
className: "border-grey-300 col-span-full -mt-px border-t"
|
136
|
+
}), tableMeta.enableFooter ? /*#__PURE__*/React__default.createElement("div", {
|
135
137
|
className: "group/footer contents",
|
136
138
|
"data-taco": "table2-footer",
|
137
139
|
role: "rowgroup"
|
@@ -144,7 +146,7 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
144
146
|
}, flexRender(footer.column.columnDef.footer, footer.getContext()))))), length ? /*#__PURE__*/React__default.createElement(Summary, {
|
145
147
|
length: length,
|
146
148
|
table: table
|
147
|
-
}) : null)) : /*#__PURE__*/React__default.createElement("div", {
|
149
|
+
}) : null) : null) : /*#__PURE__*/React__default.createElement("div", {
|
148
150
|
className: "col-span-full min-h-[theme(spacing.8)]"
|
149
151
|
}, EmptyState ? /*#__PURE__*/React__default.createElement(EmptyState, null) : null)));
|
150
152
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Table3.js","sources":["../../../../../../../src/components/Table3/Table3.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { flexRender, TableMeta } from '@tanstack/react-table';\nimport { FocusScope } from '@react-aria/focus';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { useCssGrid } from './hooks/useCssGrid';\nimport { useTable } from './hooks/useTable';\nimport { useTableRenderStrategy } from './strategies';\nimport { Table3ColumnProps, Table3Props, Table3Ref } from './types';\nimport { Toolbar } from './components/toolbar/Toolbar';\nimport { useColumnFreezingStyle } from './hooks/features/useColumnFreezing';\nimport { useTableRefInstanceSetup } from './hooks/useTableRefInstanceSetup';\nimport { Summary } from './components/columns/footer/Summary';\nimport { isEventTriggeredOnInteractiveElement } from '../../utils/keyboard';\nimport { useCssVars } from './hooks/useCssVars';\nimport './style.css';\n\nfunction Column<TType = unknown>(_: Table3ColumnProps<TType>) {\n return null;\n}\n\ntype FixedForwardRef = <T, P = {}>(\n render: (props: P, ref: React.Ref<T>) => JSX.Element\n) => (props: P & React.RefAttributes<T>) => JSX.Element;\n\n// Cast the old forwardRef to the new one\nexport const fixedForwardRef = React.forwardRef as FixedForwardRef;\n\nconst Table = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const { emptyState: EmptyState, toolbarLeft, toolbarRight } = props;\n const internalRef = useMergedRef<Table3Ref>(ref);\n\n const { table, length } = useTable<TType>(props);\n useTableRefInstanceSetup(table, internalRef);\n\n React.useEffect(() => {\n if (props.autoFocus) {\n internalRef.current?.focus();\n }\n }, []);\n\n const { renderBody, scrollToIndex } = useTableRenderStrategy<TType>(props, table, internalRef);\n const tableMeta = table.options.meta as TableMeta<TType>;\n const state = table.getState();\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n // prevent global shortcuts activating while active in other elements, like inputs or buttons\n if (isEventTriggeredOnInteractiveElement(event.target)) {\n return;\n }\n\n tableMeta.hoverState.handleKeyDown(event);\n tableMeta.currentRow.handleKeyDown(event, table.getRowModel().rows.length, scrollToIndex);\n tableMeta.rowClick.handleKeyDown(event, table);\n tableMeta.rowSelection.handleKeyDown(event, table);\n tableMeta.editing.handleKeyDown(event);\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n const handleBlur = (event: React.FocusEvent) => {\n tableMeta.editing.handleBlur(event);\n };\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n tableMeta.columnFreezing.handleScroll(event);\n };\n\n const className = cn(\n 'border-grey-300 relative grid h-full w-full flex-grow overflow-auto rounded border bg-white scroll-mt-[41px]',\n '[&[data-resizing=\"true\"]]:select-none',\n {\n 'text-xs': tableMeta.fontSize.size === 'small',\n 'text-sm': tableMeta.fontSize.size === 'medium',\n 'text-base': tableMeta.fontSize.size === 'large',\n }\n );\n\n const { style: cssGridStyle } = useCssGrid<TType>(table);\n const { style: cssVars } = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);\n\n const style = {\n ...cssVars,\n ...cssGridStyle,\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\n const columnFreezingStyle = useColumnFreezingStyle(props.id, table);\n const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;\n\n return (\n <>\n {columnFreezingStyle ? <style data-taco=\"table3-column-freezing-styles\">{columnFreezingStyle}</style> : null}\n <Toolbar\n table={table}\n tableProps={props}\n total={length}\n left={toolbarLeft}\n right={toolbarRight}\n scrollToIndex={scrollToIndex}\n />\n <div\n className={className}\n id={props.id}\n data-font-size={tableMeta.fontSize.size}\n data-editing={tableMeta.editing.isEditing}\n data-horizontally-scrolled={tableMeta.columnFreezing.horizontallyScrolled}\n data-pause-hover={tableMeta?.hoverState.isPaused}\n data-resizing={!!state.columnSizingInfo.isResizingColumn}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onScroll={handleScroll}\n ref={internalRef}\n role=\"table\"\n style={style}>\n {isServerLoadingAndNotReady ? null : (\n <div className=\"group/header 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 => (\n <React.Fragment key={header.id}>\n {flexRender(header.column.columnDef.header, { ...header.getContext(), scrollToIndex })}\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n )}\n {table.getRowModel().rows.length ? (\n <>\n <FocusScope>\n <div className=\"group/body contents\" data-taco=\"table2-body\" role=\"rowgroup\">\n {renderBody()}\n </div>\n </FocusScope>\n <div className=\"group/footer contents\" data-taco=\"table2-footer\" role=\"rowgroup\">\n {table.getFooterGroups().map(footerGroup => (\n <div className=\"contents\" key={footerGroup.id} role=\"row\">\n {footerGroup.headers.map(footer => (\n <React.Fragment key={footer.id}>\n {flexRender(footer.column.columnDef.footer, footer.getContext())}\n </React.Fragment>\n ))}\n </div>\n ))}\n {length ? <Summary length={length} table={table} /> : null}\n </div>\n </>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n </div>\n </>\n );\n});\n\ntype Table3WithStatics = (<TType = unknown>(props: Table3Props<TType> & React.RefAttributes<Table3Ref>) => JSX.Element) & {\n Column: typeof Column;\n};\n\nexport const Table3 = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const stringifiedChildren = String(props.children);\n // we force a remount (using key) when the child columns change because there are too many places to add children as an effect\n // this is cheaper from a complexity perspective, and probably performance wise as well\n const key = React.useMemo(() => String('tableKey_' + stringifiedChildren), [stringifiedChildren]);\n return <Table<TType> {...props} key={key} ref={ref} />;\n}) as Table3WithStatics;\nTable3.Column = Column;\n\n// hooks\nexport { useTable3DataLoader } from './hooks/useTableDataLoader';\n\n// types\nexport type {\n useTable3DataFetcher,\n useTable3DataOptions,\n useTable3DataFetcherValues as useTableDataValues,\n} from './hooks/useTableDataLoader';\n\nexport type {\n Table3Ref,\n Table3Props,\n Table3Preset,\n Table3Settings,\n Table3SettingsHandler,\n Table3RowHeight,\n Table3FilterComparator,\n Table3FilterHandler,\n Table3LoadPageHandler,\n Table3LoadAllHandler,\n Table3RowGotoHandler,\n Table3SortHandler,\n Table3Shortcuts,\n Table3ShortcutHandlerFn,\n Table3ShortcutHandlerObject,\n Table3FontSize,\n Table3SortDirection,\n Table3SortFn,\n Table3RowActionRenderer,\n Table3RowSelectionHandler,\n Table3RowExpansionRenderer,\n Table3RowDropHandler,\n Table3RowDragHandler,\n Table3RowClickHandler,\n Table3ColumnProps,\n Table3ColumnAlignment,\n Table3ColumnDataType,\n Table3ColumnHeaderMenu,\n Table3ColumnClassNameHandler,\n Table3ColumnFooterRenderer,\n Table3ColumnRenderer,\n Table3ColumnControlRenderer,\n Table3ColumnControlProps,\n} from './types';\n"],"names":["Column","_","fixedForwardRef","React","forwardRef","Table","Table3","props","ref","emptyState","EmptyState","toolbarLeft","toolbarRight","internalRef","useMergedRef","table","length","useTable","useTableRefInstanceSetup","useEffect","autoFocus","_internalRef$current","current","focus","renderBody","scrollToIndex","useTableRenderStrategy","tableMeta","options","meta","state","getState","handleKeyDown","event","isEventTriggeredOnInteractiveElement","target","hoverState","currentRow","getRowModel","rows","rowClick","rowSelection","editing","document","addEventListener","removeEventListener","handleBlur","handleScroll","columnFreezing","Promise","resolve","e","reject","className","cn","fontSize","size","style","cssGridStyle","useCssGrid","cssVars","useCssVars","rowHeight","height","opacity","columnFreezingStyle","useColumnFreezingStyle","id","isServerLoadingAndNotReady","isUsingServer","undefined","Toolbar","tableProps","total","left","right","isEditing","horizontallyScrolled","isPaused","columnSizingInfo","isResizingColumn","onBlur","onScroll","role","getHeaderGroups","map","headerGroup","key","headers","header","Fragment","flexRender","column","columnDef","getContext","FocusScope","getFooterGroups","footerGroup","footer","Summary","stringifiedChildren","String","children","useMemo"],"mappings":";;;;;;;;;;;;;;;;AAiBA,SAASA,MAAMA,CAAkBC,CAA2B;EACxD,OAAO,IAAI;AACf;AAMA;MACaC,eAAe,GAAGC,cAAK,CAACC;AAErC,MAAMC,KAAK,gBAAGH,eAAe,CAAC,SAASI,MAAMA,CAAkBC,KAAyB,EAAEC,GAAyB;EAC/G,MAAM;IAAEC,UAAU,EAAEC,UAAU;IAAEC,WAAW;IAAEC;GAAc,GAAGL,KAAK;EACnE,MAAMM,WAAW,GAAGC,YAAY,CAAYN,GAAG,CAAC;EAEhD,MAAM;IAAEO,KAAK;IAAEC;GAAQ,GAAGC,QAAQ,CAAQV,KAAK,CAAC;EAChDW,wBAAwB,CAACH,KAAK,EAAEF,WAAW,CAAC;EAE5CV,cAAK,CAACgB,SAAS,CAAC;IACZ,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E,CAACX,GAAG,CAACY,WAAW,iBACpC9F;IAAKkD,SAAS,EAAC,UAAU;IAACkC,GAAG,EAAEU,WAAW,CAAC9B,EAAE;IAAEgB,IAAI,EAAC;KAC/Cc,WAAW,CAACT,OAAO,CAACH,GAAG,CAACa,MAAM,iBAC3B/F,6BAACA,cAAK,CAACuF,QAAQ;IAACH,GAAG,EAAEW,MAAM,CAAC/B;KACvBwB,UAAU,CAACO,MAAM,CAACN,MAAM,CAACC,SAAS,CAACK,MAAM,EAAEA,MAAM,CAACJ,UAAU,EAAE,CAAC,CAEvE,CAAC,CAET,CAAC,EACD9E,MAAM,gBAAGb,6BAACgG,OAAO;IAACnF,MAAM,EAAEA,MAAM;IAAED,KAAK,EAAEA;IAAS,GAAG,IAAI,CACxD,CACP,gBAEHZ;IAAKkD,SAAS,EAAC;KAA0C3C,UAAU,gBAAGP,6BAACO,UAAU,OAAG,GAAG,IAAI,CAC9F,CACC,CACP;AAEX,CAAC,CAAC;MAMWJ,MAAM,gBAAGJ,eAAe,CAAC,SAASI,MAAMA,CAAkBC,KAAyB,EAAEC,GAAyB;EACvH,MAAM4F,mBAAmB,GAAGC,MAAM,CAAC9F,KAAK,CAAC+F,QAAQ,CAAC;;;EAGlD,MAAMf,GAAG,GAAGpF,cAAK,CAACoG,OAAO,CAAC,MAAMF,MAAM,CAAC,WAAW,GAAGD,mBAAmB,CAAC,EAAE,CAACA,mBAAmB,CAAC,CAAC;EACjG,oBAAOjG,6BAACE,KAAK,oBAAYE,KAAK;IAAEgF,GAAG,EAAEA,GAAG;IAAE/E,GAAG,EAAEA;KAAO;AAC1D,CAAC;AACDF,MAAM,CAACN,MAAM,GAAGA,MAAM;;;;"}
|
1
|
+
{"version":3,"file":"Table3.js","sources":["../../../../../../../src/components/Table3/Table3.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { flexRender, TableMeta } from '@tanstack/react-table';\nimport { FocusScope } from '@react-aria/focus';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { useCssGrid } from './hooks/useCssGrid';\nimport { useTable } from './hooks/useTable';\nimport { useTableRenderStrategy } from './strategies';\nimport { Table3ColumnProps, Table3Props, Table3Ref } from './types';\nimport { Toolbar } from './components/toolbar/Toolbar';\nimport { useColumnFreezingStyle } from './hooks/features/useColumnFreezing';\nimport { useTableRefInstanceSetup } from './hooks/useTableRefInstanceSetup';\nimport { Summary } from './components/columns/footer/Summary';\nimport { isEventTriggeredOnInteractiveElement } from '../../utils/keyboard';\nimport { useCssVars } from './hooks/useCssVars';\nimport './style.css';\n\nfunction Column<TType = unknown>(_: Table3ColumnProps<TType>) {\n return null;\n}\n\ntype FixedForwardRef = <T, P = {}>(\n render: (props: P, ref: React.Ref<T>) => JSX.Element\n) => (props: P & React.RefAttributes<T>) => JSX.Element;\n\n// Cast the old forwardRef to the new one\nexport const fixedForwardRef = React.forwardRef as FixedForwardRef;\n\nconst Table = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const { emptyState: EmptyState, toolbarLeft, toolbarRight } = props;\n const internalRef = useMergedRef<Table3Ref>(ref);\n\n const { table, length } = useTable<TType>(props);\n useTableRefInstanceSetup(table, internalRef);\n\n React.useEffect(() => {\n if (props.autoFocus) {\n internalRef.current?.focus();\n }\n }, []);\n\n const { renderBody, scrollToIndex } = useTableRenderStrategy<TType>(props, table, internalRef);\n const tableMeta = table.options.meta as TableMeta<TType>;\n const state = table.getState();\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n // prevent global shortcuts activating while active in other elements, like inputs or buttons\n if (isEventTriggeredOnInteractiveElement(event.target)) {\n return;\n }\n\n tableMeta.hoverState.handleKeyDown(event);\n tableMeta.currentRow.handleKeyDown(event, table.getRowModel().rows.length, scrollToIndex);\n tableMeta.rowClick.handleKeyDown(event, table);\n tableMeta.rowSelection.handleKeyDown(event, table);\n tableMeta.editing.handleKeyDown(event);\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n const handleBlur = (event: React.FocusEvent) => {\n tableMeta.editing.handleBlur(event);\n };\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n tableMeta.columnFreezing.handleScroll(event);\n };\n\n const className = cn(\n 'border-grey-300 relative grid h-full w-full flex-grow overflow-auto rounded border bg-white scroll-mt-[41px]',\n '[&[data-resizing=\"true\"]]:select-none',\n {\n 'text-xs': tableMeta.fontSize.size === 'small',\n 'text-sm': tableMeta.fontSize.size === 'medium',\n 'text-base': tableMeta.fontSize.size === 'large',\n }\n );\n\n const { style: cssGridStyle } = useCssGrid<TType>(table);\n const { style: cssVars } = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);\n\n const style = {\n ...cssVars,\n ...cssGridStyle,\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\n const columnFreezingStyle = useColumnFreezingStyle(props.id, table);\n const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;\n\n return (\n <>\n {columnFreezingStyle ? <style data-taco=\"table3-column-freezing-styles\">{columnFreezingStyle}</style> : null}\n <Toolbar\n table={table}\n tableProps={props}\n total={length}\n left={toolbarLeft}\n right={toolbarRight}\n scrollToIndex={scrollToIndex}\n />\n <div\n className={className}\n id={props.id}\n data-font-size={tableMeta.fontSize.size}\n data-editing={tableMeta.editing.isEditing}\n data-horizontally-scrolled={tableMeta.columnFreezing.horizontallyScrolled}\n data-pause-hover={tableMeta?.hoverState.isPaused}\n data-resizing={!!state.columnSizingInfo.isResizingColumn}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onScroll={handleScroll}\n ref={internalRef}\n role=\"table\"\n style={style}>\n {isServerLoadingAndNotReady ? null : (\n <div className=\"group/header 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 => (\n <React.Fragment key={header.id}>\n {flexRender(header.column.columnDef.header, { ...header.getContext(), scrollToIndex })}\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n )}\n {table.getRowModel().rows.length ? (\n <>\n <FocusScope>\n <div className=\"group/body contents\" data-taco=\"table2-body\" role=\"rowgroup\">\n {renderBody()}\n </div>\n </FocusScope>\n {/* This div makes sure that there is always a free space between the rows and footer when \n table height exceeds the cumulative height of all rows. See useCSSGrid.ts */}\n <div className=\"border-grey-300 col-span-full -mt-px border-t\" />\n {tableMeta.enableFooter ? (\n <div className=\"group/footer contents\" data-taco=\"table2-footer\" role=\"rowgroup\">\n {table.getFooterGroups().map(footerGroup => (\n <div className=\"contents\" key={footerGroup.id} role=\"row\">\n {footerGroup.headers.map(footer => (\n <React.Fragment key={footer.id}>\n {flexRender(footer.column.columnDef.footer, footer.getContext())}\n </React.Fragment>\n ))}\n </div>\n ))}\n {length ? <Summary length={length} table={table} /> : null}\n </div>\n ) : null}\n </>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n </div>\n </>\n );\n});\n\ntype Table3WithStatics = (<TType = unknown>(props: Table3Props<TType> & React.RefAttributes<Table3Ref>) => JSX.Element) & {\n Column: typeof Column;\n};\n\nexport const Table3 = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const stringifiedChildren = String(props.children);\n // we force a remount (using key) when the child columns change because there are too many places to add children as an effect\n // this is cheaper from a complexity perspective, and probably performance wise as well\n const key = React.useMemo(() => String('tableKey_' + stringifiedChildren), [stringifiedChildren]);\n return <Table<TType> {...props} key={key} ref={ref} />;\n}) as Table3WithStatics;\nTable3.Column = Column;\n\n// hooks\nexport { useTable3DataLoader } from './hooks/useTableDataLoader';\n\n// types\nexport type {\n useTable3DataFetcher,\n useTable3DataOptions,\n useTable3DataFetcherValues as useTableDataValues,\n} from './hooks/useTableDataLoader';\n\nexport type {\n Table3Ref,\n Table3Props,\n Table3Preset,\n Table3Settings,\n Table3SettingsHandler,\n Table3RowHeight,\n Table3FilterComparator,\n Table3FilterHandler,\n Table3LoadPageHandler,\n Table3LoadAllHandler,\n Table3RowGotoHandler,\n Table3SortHandler,\n Table3Shortcuts,\n Table3ShortcutHandlerFn,\n Table3ShortcutHandlerObject,\n Table3FontSize,\n Table3SortDirection,\n Table3SortFn,\n Table3RowActionRenderer,\n Table3RowSelectionHandler,\n Table3RowExpansionRenderer,\n Table3RowDropHandler,\n Table3RowDragHandler,\n Table3RowClickHandler,\n Table3ColumnProps,\n Table3ColumnAlignment,\n Table3ColumnDataType,\n Table3ColumnHeaderMenu,\n Table3ColumnClassNameHandler,\n Table3ColumnFooterRenderer,\n Table3ColumnRenderer,\n Table3ColumnControlRenderer,\n Table3ColumnControlProps,\n} from './types';\n"],"names":["Column","_","fixedForwardRef","React","forwardRef","Table","Table3","props","ref","emptyState","EmptyState","toolbarLeft","toolbarRight","internalRef","useMergedRef","table","length","useTable","useTableRefInstanceSetup","useEffect","autoFocus","_internalRef$current","current","focus","renderBody","scrollToIndex","useTableRenderStrategy","tableMeta","options","meta","state","getState","handleKeyDown","event","isEventTriggeredOnInteractiveElement","target","hoverState","currentRow","getRowModel","rows","rowClick","rowSelection","editing","document","addEventListener","removeEventListener","handleBlur","handleScroll","columnFreezing","Promise","resolve","e","reject","className","cn","fontSize","size","style","cssGridStyle","useCssGrid","cssVars","useCssVars","rowHeight","height","opacity","columnFreezingStyle","useColumnFreezingStyle","id","isServerLoadingAndNotReady","isUsingServer","undefined","Toolbar","tableProps","total","left","right","isEditing","horizontallyScrolled","isPaused","columnSizingInfo","isResizingColumn","onBlur","onScroll","role","getHeaderGroups","map","headerGroup","key","headers","header","Fragment","flexRender","column","columnDef","getContext","FocusScope","enableFooter","getFooterGroups","footerGroup","footer","Summary","stringifiedChildren","String","children","useMemo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AkBC,KAAyB,EAAEC,GAAyB;EACvH,MAAM6F,mBAAmB,GAAGC,MAAM,CAAC/F,KAAK,CAACgG,QAAQ,CAAC;;;EAGlD,MAAMhB,GAAG,GAAGpF,cAAK,CAACqG,OAAO,CAAC,MAAMF,MAAM,CAAC,WAAW,GAAGD,mBAAmB,CAAC,EAAE,CAACA,mBAAmB,CAAC,CAAC;EACjG,oBAAOlG,6BAACE,KAAK,oBAAYE,KAAK;IAAEgF,GAAG,EAAEA,GAAG;IAAE/E,GAAG,EAAEA;KAAO;AAC1D,CAAC;AACDF,MAAM,CAACN,MAAM,GAAGA,MAAM;;;;"}
|
@@ -242,7 +242,7 @@ const MemoedRow = /*#__PURE__*/React__default.memo(function MemoedRow(props) {
|
|
242
242
|
}
|
243
243
|
setIsHovered(false);
|
244
244
|
};
|
245
|
-
const [, dropTargetProps] = useDropTarget(event => onDrop === null || onDrop === void 0 ? void 0 : onDrop(event, row.original));
|
245
|
+
const [isDraggedOver, dropTargetProps] = useDropTarget(event => onDrop === null || onDrop === void 0 ? void 0 : onDrop(event, row.original));
|
246
246
|
const className = cn('group/row contents',
|
247
247
|
// resizing column requires dragging, which means the mouse might (on rare occasions) move over rows and trigger hover state
|
248
248
|
// that in turn triggers rendering of e.g. row actions, which could cause janky ui - so don't allow mouse interaction when resizing
|
@@ -252,6 +252,7 @@ const MemoedRow = /*#__PURE__*/React__default.memo(function MemoedRow(props) {
|
|
252
252
|
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, attributes, onDrop ? dropTargetProps : undefined, {
|
253
253
|
className: className,
|
254
254
|
"data-row-index": index,
|
255
|
+
"data-dragged-over": isDraggedOver,
|
255
256
|
onClick: handleClick,
|
256
257
|
onClickCapture: handleClickCapture,
|
257
258
|
onMouseEnter: handleMouseEnter,
|