@economic/taco 2.12.1 → 2.14.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Field/Field.d.ts +4 -2
- package/dist/components/Icon/components/Location.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Navigation2/components/Link.d.ts +1 -1
- package/dist/components/Provider/Localization.d.ts +1 -113
- package/dist/components/Select2/components/Option.d.ts +7 -5
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Table3/Table3.d.ts +9 -1
- package/dist/components/Table3/components/columns/header/Group.d.ts +15 -0
- package/dist/components/Table3/components/columns/header/Header.d.ts +5 -0
- package/dist/components/Table3/components/columns/internal/EditingActions.d.ts +1 -1
- package/dist/components/Table3/components/columns/styles.d.ts +2 -2
- package/dist/components/Table3/components/toolbar/Filter/filters/components/Filter.d.ts +4 -4
- package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.d.ts +3 -2
- package/dist/components/Table3/components/toolbar/Filter/filters/components/Placeholder.d.ts +3 -2
- package/dist/components/Table3/components/toolbar/FontSize.d.ts +4 -0
- package/dist/components/Table3/hooks/features/useHeaderOffsetStyle.d.ts +3 -0
- package/dist/components/Table3/hooks/useCssGrid.d.ts +2 -1
- package/dist/components/Table3/hooks/useTable.d.ts +1 -1
- package/dist/components/Table3/types.d.ts +8 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/index.css +24 -6
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Field/Field.js +6 -4
- package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Location.js +17 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Location.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +2 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +1 -110
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +13 -6
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +7 -6
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +29 -11
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +2 -5
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +1 -4
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +70 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +26 -8
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +6 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +3 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +13 -9
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +14 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +10 -7
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +15 -8
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js +25 -4
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js +5 -3
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js +9 -4
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +2 -3
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js +3 -2
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js +24 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js +6 -7
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js +48 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js +34 -9
- package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js +6 -5
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +11 -9
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +1 -2
- package/dist/esm/packages/taco/src/index.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/dom.js +1 -2
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/index.css +24 -6
- package/dist/index.d.ts +0 -1
- package/dist/taco.cjs.development.js +697 -4100
- 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/tailwind.config.js +3 -0
- package/types.json +14334 -32345
- package/dist/components/Table2/Table2.d.ts +0 -130
- package/dist/components/Table2/components/BatchActionsMenu.d.ts +0 -10
- package/dist/components/Table2/components/ColumnSettingsButton.d.ts +0 -6
- package/dist/components/Table2/components/EditModeButton.d.ts +0 -8
- package/dist/components/Table2/components/RowDensityButton.d.ts +0 -7
- package/dist/components/Table2/components/Search.d.ts +0 -3
- package/dist/components/Table2/components/ShortcutsGuideButton.d.ts +0 -7
- package/dist/components/Table2/components/column/Base.d.ts +0 -14
- package/dist/components/Table2/components/column/Cell.d.ts +0 -15
- package/dist/components/Table2/components/column/Footer.d.ts +0 -9
- package/dist/components/Table2/components/column/Header.d.ts +0 -11
- package/dist/components/Table2/components/column/Indicator.d.ts +0 -17
- package/dist/components/Table2/components/column/ValidationError.d.ts +0 -5
- package/dist/components/Table2/components/column/utils.d.ts +0 -3
- package/dist/components/Table2/components/filters/FiltersButton.d.ts +0 -7
- package/dist/components/Table2/components/filters/components/Column.d.ts +0 -11
- package/dist/components/Table2/components/filters/components/ColumnFilter.d.ts +0 -10
- package/dist/components/Table2/components/filters/components/Comparator.d.ts +0 -11
- package/dist/components/Table2/components/filters/components/EmptyFilter.d.ts +0 -13
- package/dist/components/Table2/components/filters/components/InferredControl.d.ts +0 -10
- package/dist/components/Table2/components/row/Context.d.ts +0 -24
- package/dist/components/Table2/components/row/ExpandedRow.d.ts +0 -6
- package/dist/components/Table2/components/row/Row.d.ts +0 -2
- package/dist/components/Table2/hooks/listeners/useActiveCellStateListener.d.ts +0 -3
- package/dist/components/Table2/hooks/listeners/useActiveRowStateListener.d.ts +0 -3
- package/dist/components/Table2/hooks/listeners/useColumnOffsetStateListener.d.ts +0 -3
- package/dist/components/Table2/hooks/listeners/useFilterStateListener.d.ts +0 -3
- package/dist/components/Table2/hooks/listeners/useRowSelectionListener.d.ts +0 -3
- package/dist/components/Table2/hooks/listeners/useSettingsStateListener.d.ts +0 -3
- package/dist/components/Table2/hooks/useActiveCell.d.ts +0 -26
- package/dist/components/Table2/hooks/useActiveRow.d.ts +0 -10
- package/dist/components/Table2/hooks/useColumnDefinitions.d.ts +0 -37
- package/dist/components/Table2/hooks/useEditMode.d.ts +0 -28
- package/dist/components/Table2/hooks/useGridTemplate.d.ts +0 -2
- package/dist/components/Table2/hooks/useTable.d.ts +0 -46
- package/dist/components/Table2/hooks/useTableShortcuts.d.ts +0 -2
- package/dist/components/Table2/hooks/useVirtualiser.d.ts +0 -23
- package/dist/components/Table2/types.d.ts +0 -148
- package/dist/components/Table2/utilities/cell.d.ts +0 -14
- package/dist/components/Table2/utilities/columns.d.ts +0 -16
- package/dist/components/Table2/utilities/filterFn.d.ts +0 -3
- package/dist/esm/packages/taco/src/components/Table2/Table2.js +0 -422
- package/dist/esm/packages/taco/src/components/Table2/Table2.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/BatchActionsMenu.js +0 -83
- package/dist/esm/packages/taco/src/components/Table2/components/BatchActionsMenu.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js +0 -116
- package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js +0 -81
- package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/RowDensityButton.js +0 -47
- package/dist/esm/packages/taco/src/components/Table2/components/RowDensityButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/Search.js +0 -62
- package/dist/esm/packages/taco/src/components/Table2/components/Search.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Base.js +0 -32
- package/dist/esm/packages/taco/src/components/Table2/components/column/Base.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js +0 -605
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Footer.js +0 -32
- package/dist/esm/packages/taco/src/components/Table2/components/column/Footer.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Header.js +0 -243
- package/dist/esm/packages/taco/src/components/Table2/components/column/Header.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js +0 -73
- package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/ValidationError.js +0 -30
- package/dist/esm/packages/taco/src/components/Table2/components/column/ValidationError.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/utils.js +0 -39
- package/dist/esm/packages/taco/src/components/Table2/components/column/utils.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js +0 -155
- package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Column.js +0 -31
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Column.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js +0 -129
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Comparator.js +0 -68
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Comparator.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/EmptyFilter.js +0 -63
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/EmptyFilter.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/InferredControl.js +0 -99
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/InferredControl.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js +0 -58
- package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/ExpandedRow.js +0 -36
- package/dist/esm/packages/taco/src/components/Table2/components/row/ExpandedRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js +0 -44
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useActiveRowStateListener.js +0 -19
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useActiveRowStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useColumnOffsetStateListener.js +0 -28
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useColumnOffsetStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useFilterStateListener.js +0 -12
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useFilterStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useRowSelectionListener.js +0 -18
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useRowSelectionListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useSettingsStateListener.js +0 -25
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useSettingsStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useActiveRow.js +0 -33
- package/dist/esm/packages/taco/src/components/Table2/hooks/useActiveRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js +0 -122
- package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useEditMode.js +0 -112
- package/dist/esm/packages/taco/src/components/Table2/hooks/useEditMode.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js +0 -34
- package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js +0 -222
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTableShortcuts.js +0 -46
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTableShortcuts.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useVirtualiser.js +0 -48
- package/dist/esm/packages/taco/src/components/Table2/hooks/useVirtualiser.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/types.js +0 -18
- package/dist/esm/packages/taco/src/components/Table2/types.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js +0 -41
- package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js +0 -387
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/filterFn.js +0 -100
- package/dist/esm/packages/taco/src/components/Table2/utilities/filterFn.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Truncate/Truncate.js +0 -32
- package/dist/esm/packages/taco/src/components/Truncate/Truncate.js.map +0 -1
- package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js +0 -20
- package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js.map +0 -1
@@ -1 +0,0 @@
|
|
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 const target = event.target as HTMLElement;\n const isTargetInput = target !== null && target.nodeName === 'INPUT';\n\n // In Edit mode, If mouse click is happening outside of cell (in case of any dropdowns like date picker or select),\n // then it should not be processed as a click on a cell.\n if (!event.currentTarget.contains(target)) {\n return;\n }\n\n handleMouseDown(event);\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","currentTarget","contains","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","_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,gB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AK,EAAE+G,MAAM,CAAChE,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC;YAC1B5D,SAAS,EAAEqH;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,32 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import cn from 'classnames';
|
3
|
-
import { isInternalColumn } from '../../utilities/columns.js';
|
4
|
-
import { ColumnBase } from './Base.js';
|
5
|
-
|
6
|
-
const Footer = function Footer(props) {
|
7
|
-
const {
|
8
|
-
children,
|
9
|
-
footer,
|
10
|
-
index,
|
11
|
-
table,
|
12
|
-
...columnProps
|
13
|
-
} = props;
|
14
|
-
const isFrozen = !!footer.column.getIsPinned();
|
15
|
-
const className = cn('group/header sticky bottom-0 bg-white border-t-2 relative z-[1]', 'flex items-center px-4 h-[calc(theme(spacing.10)+2px)]', {
|
16
|
-
'!z-[2]': isFrozen,
|
17
|
-
'!shadow-none': isInternalColumn(footer.id)
|
18
|
-
}, props.className);
|
19
|
-
return /*#__PURE__*/React__default.createElement(ColumnBase, Object.assign({}, columnProps, {
|
20
|
-
// base props
|
21
|
-
column: footer.column,
|
22
|
-
table: table,
|
23
|
-
className: className,
|
24
|
-
role: "cell",
|
25
|
-
"data-column-index": index
|
26
|
-
}), /*#__PURE__*/React__default.createElement("span", {
|
27
|
-
className: "truncate"
|
28
|
-
}, children));
|
29
|
-
};
|
30
|
-
|
31
|
-
export { Footer };
|
32
|
-
//# sourceMappingURL=Footer.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Footer.js","sources":["../../../../../../../../../src/components/Table2/components/column/Footer.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Header as RTHeader } from '@tanstack/react-table';\nimport { ColumnBase, ColumnBaseProps } from './Base';\nimport { isInternalColumn } from '../../utilities/columns';\n\ntype FooterProps<TType = unknown> = Omit<ColumnBaseProps<TType>, 'column' | 'isEditing'> & {\n footer: RTHeader<TType, unknown>;\n index: number;\n};\n\nexport const Footer = function Footer<TType = unknown>(props: FooterProps<TType>) {\n const { children, footer, index, table, ...columnProps } = props;\n const isFrozen = !!footer.column.getIsPinned();\n\n const className = cn(\n 'group/header sticky bottom-0 bg-white border-t-2 relative z-[1]',\n 'flex items-center px-4 h-[calc(theme(spacing.10)+2px)]',\n {\n '!z-[2]': isFrozen, // frozen headers should show above cells and other headers, so we add z-index\n '!shadow-none': isInternalColumn(footer.id),\n },\n props.className\n );\n\n return (\n <ColumnBase\n {...columnProps}\n // base props\n column={footer.column}\n table={table}\n className={className}\n role=\"cell\"\n // helper props\n data-column-index={index}>\n <span className=\"truncate\">{children}</span>\n </ColumnBase>\n );\n};\n"],"names":["Footer","props","children","footer","index","table","columnProps","isFrozen","column","getIsPinned","className","cn","isInternalColumn","id","React","ColumnBase","role"],"mappings":";;;;;MAWaA,MAAM,GAAG,SAASA,MAAMA,CAAkBC,KAAyB;EAC5E,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAE,GAAGC;GAAa,GAAGL,KAAK;EAChE,MAAMM,QAAQ,GAAG,CAAC,CAACJ,MAAM,CAACK,MAAM,CAACC,WAAW,EAAE;EAE9C,MAAMC,SAAS,GAAGC,EAAE,CAChB,iEAAiE,EACjE,wDAAwD,EACxD;IACI,QAAQ,EAAEJ,QAAQ;IAClB,cAAc,EAAEK,gBAAgB,CAACT,MAAM,CAACU,EAAE;GAC7C,EACDZ,KAAK,CAACS,SAAS,CAClB;EAED,oBACII,6BAACC,UAAU,oBACHT,WAAW;;IAEfE,MAAM,EAAEL,MAAM,CAACK,MAAM;IACrBH,KAAK,EAAEA,KAAK;IACZK,SAAS,EAAEA,SAAS;IACpBM,IAAI,EAAC,MAAM;yBAEQZ;mBACnBU;IAAMJ,SAAS,EAAC;KAAYR,QAAQ,CAAQ,CACnC;AAErB;;;;"}
|
@@ -1,243 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import cn from 'classnames';
|
3
|
-
import { Icon } from '../../../Icon/Icon.js';
|
4
|
-
import { Tooltip } from '../../../Tooltip/Tooltip.js';
|
5
|
-
import { IconButton } from '../../../IconButton/IconButton.js';
|
6
|
-
import { useLocalization } from '../../../Provider/Localization.js';
|
7
|
-
import { Menu } from '../../../Menu/Menu.js';
|
8
|
-
import { isOverflowing } from '../../../../utils/dom.js';
|
9
|
-
import { flexRender } from '@tanstack/react-table';
|
10
|
-
import { isInternalFrozenColumn, isInternalColumn, MIN_COLUMN_SIZE } from '../../utilities/columns.js';
|
11
|
-
import { getCellSizingClasses, getCellAlignmentClasses } from '../../utilities/cell.js';
|
12
|
-
import { ColumnBase } from './Base.js';
|
13
|
-
|
14
|
-
const Header = function Header(props) {
|
15
|
-
var _header$column$column, _header$column$column2, _asc$desc$header$colu, _header$column$column4, _header$column$column5, _header$column$column6, _header$column$column7, _asc$desc$header$colu2, _header$column$column8;
|
16
|
-
const {
|
17
|
-
header,
|
18
|
-
index,
|
19
|
-
isLastColumn,
|
20
|
-
table,
|
21
|
-
tableRef,
|
22
|
-
...columnProps
|
23
|
-
} = props;
|
24
|
-
const textRef = React__default.useRef(null);
|
25
|
-
const frozen = !!header.column.getIsPinned();
|
26
|
-
const isOtherColumnBeingResized = table.getState().columnSizingInfo.isResizingColumn && table.getState().columnSizingInfo.isResizingColumn !== header.id;
|
27
|
-
const {
|
28
|
-
enableColumnFreezing
|
29
|
-
} = table.options.meta;
|
30
|
-
const className = cn('group/header sticky top-0 bg-white border-b-2 relative font-bold z-[5] hover:z-[6]', {
|
31
|
-
'z-[6]': header.column.getIsResizing(),
|
32
|
-
'z-[7]': frozen,
|
33
|
-
'cursor-pointer select-none': header.column.getCanSort(),
|
34
|
-
'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),
|
35
|
-
'pointer-events-none': isOtherColumnBeingResized
|
36
|
-
}, getCellSizingClasses('normal'), (_header$column$column2 = header.column.columnDef.meta) === null || _header$column$column2 === void 0 ? void 0 : _header$column$column2.headerClassName, props.className);
|
37
|
-
// set the column size after the first render (after auto layout with 'max-content') has run
|
38
|
-
// this way columns default to fit their content, then we save that size for resizing
|
39
|
-
const refCallback = node => {
|
40
|
-
if (node && !table.getState().columnSizing[header.id]) {
|
41
|
-
const size = Math.ceil(node.getBoundingClientRect().width);
|
42
|
-
table.setColumnSizing(sizes => ({
|
43
|
-
...sizes,
|
44
|
-
[header.id]: !isInternalFrozenColumn(header.id) && size < MIN_COLUMN_SIZE ? MIN_COLUMN_SIZE : size
|
45
|
-
}));
|
46
|
-
}
|
47
|
-
};
|
48
|
-
// we use mousedown because clicking and dragging resize and then letting go over the
|
49
|
-
// column, results in sorting being applied
|
50
|
-
const handleMouseDown = header.column.getCanSort() ? event => {
|
51
|
-
// only detect left clicks
|
52
|
-
if (event.button === 0) {
|
53
|
-
var _tableRef$current;
|
54
|
-
event.preventDefault();
|
55
|
-
table.resetRowSelection();
|
56
|
-
header.column.toggleSorting();
|
57
|
-
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.focus();
|
58
|
-
}
|
59
|
-
} : undefined;
|
60
|
-
const handleResizerDoubleClick = () => {
|
61
|
-
var _header$column$column3;
|
62
|
-
const size = (_header$column$column3 = header.column.columnDef.meta) === null || _header$column$column3 === void 0 ? void 0 : _header$column$column3.defaultWidth;
|
63
|
-
table.setColumnSizing(sizes => {
|
64
|
-
const nextSizes = {
|
65
|
-
...sizes
|
66
|
-
};
|
67
|
-
if (size === 'grow') {
|
68
|
-
nextSizes[header.id] = '1fr';
|
69
|
-
} else if (typeof size === 'number') {
|
70
|
-
nextSizes[header.id] = !isInternalFrozenColumn(header.id) && size < MIN_COLUMN_SIZE ? MIN_COLUMN_SIZE : size;
|
71
|
-
} else {
|
72
|
-
delete nextSizes[header.id];
|
73
|
-
}
|
74
|
-
return nextSizes;
|
75
|
-
});
|
76
|
-
};
|
77
|
-
const handleResizerClick = event => {
|
78
|
-
event.stopPropagation();
|
79
|
-
event.preventDefault();
|
80
|
-
};
|
81
|
-
const handleResize = event => {
|
82
|
-
// prevent the parent onMouseDown propagating
|
83
|
-
event.stopPropagation();
|
84
|
-
header.getResizeHandler()(event);
|
85
|
-
};
|
86
|
-
const content = /*#__PURE__*/React__default.createElement("div", {
|
87
|
-
className: "truncate",
|
88
|
-
ref: textRef
|
89
|
-
}, flexRender(header.column.columnDef.header, header.getContext()));
|
90
|
-
const {
|
91
|
-
texts
|
92
|
-
} = useLocalization();
|
93
|
-
return /*#__PURE__*/React__default.createElement(ColumnBase, Object.assign({}, columnProps, {
|
94
|
-
// base props
|
95
|
-
column: header.column,
|
96
|
-
table: table,
|
97
|
-
"aria-sort": (_asc$desc$header$colu = {
|
98
|
-
asc: 'ascending',
|
99
|
-
desc: 'descending'
|
100
|
-
}[header.column.getIsSorted()]) !== null && _asc$desc$header$colu !== void 0 ? _asc$desc$header$colu : 'none',
|
101
|
-
className: className,
|
102
|
-
onMouseDown: handleMouseDown,
|
103
|
-
ref: refCallback,
|
104
|
-
role: "columnheader",
|
105
|
-
"data-column-index": index
|
106
|
-
}), isInternalFrozenColumn(header.id) ? flexRender(header.column.columnDef.header, header.getContext()) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
107
|
-
className: cn('flex flex-grow overflow-hidden', {
|
108
|
-
'group-hover/header:-ml-2': !!header.column.getIsSorted() && !!((_header$column$column4 = header.column.columnDef.meta) !== null && _header$column$column4 !== void 0 && _header$column$column4.menu)
|
109
|
-
}, getCellAlignmentClasses((_header$column$column5 = header.column.columnDef.meta) === null || _header$column$column5 === void 0 ? void 0 : _header$column$column5.align))
|
110
|
-
}, isOverflowing(textRef.current) ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
111
|
-
title: (_header$column$column6 = (_header$column$column7 = header.column.columnDef.meta) === null || _header$column$column7 === void 0 ? void 0 : _header$column$column7.tooltip) !== null && _header$column$column6 !== void 0 ? _header$column$column6 : content,
|
112
|
-
placement: "top"
|
113
|
-
}, content) : content, (_asc$desc$header$colu2 = {
|
114
|
-
asc: /*#__PURE__*/React__default.createElement(Icon, {
|
115
|
-
name: "chevron-up-solid",
|
116
|
-
className: "pointer-events-none -my-0.5"
|
117
|
-
}),
|
118
|
-
desc: /*#__PURE__*/React__default.createElement(Icon, {
|
119
|
-
name: "chevron-down-solid",
|
120
|
-
className: "pointer-events-none -my-0.5"
|
121
|
-
})
|
122
|
-
}[header.column.getIsSorted()]) !== null && _asc$desc$header$colu2 !== void 0 ? _asc$desc$header$colu2 : null), !isInternalColumn(header.column.id) && ((_header$column$column8 = header.column.columnDef.meta) !== null && _header$column$column8 !== void 0 && _header$column$column8.menu || enableColumnFreezing) ? /*#__PURE__*/React__default.createElement(HeaderMenu, {
|
123
|
-
header: header,
|
124
|
-
table: table,
|
125
|
-
columnIndex: index
|
126
|
-
}) : null), header.column.getCanResize() ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
127
|
-
placement: "top",
|
128
|
-
title: texts.table2.columns.resize.tooltip
|
129
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
130
|
-
className: cn('invisible absolute right-0 top-0 flex h-full cursor-col-resize touch-none select-none rounded py-0.5 group-hover/header:visible', {
|
131
|
-
'-mr-2.5 w-5 justify-center': !isLastColumn,
|
132
|
-
'w-2': isLastColumn,
|
133
|
-
'!visible': header.column.getIsResizing()
|
134
|
-
}),
|
135
|
-
onDoubleClick: handleResizerDoubleClick,
|
136
|
-
onMouseDown: handleResize,
|
137
|
-
onTouchStart: handleResize,
|
138
|
-
// this prevents sort handlers being activated
|
139
|
-
onClick: handleResizerClick
|
140
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
141
|
-
className: cn('h-full w-1 rounded', {
|
142
|
-
'!bg-blue-500': header.column.getIsResizing(),
|
143
|
-
'bg-grey-500 hover:bg-grey-700': !header.column.getIsResizing()
|
144
|
-
})
|
145
|
-
}))) : null);
|
146
|
-
};
|
147
|
-
const HeaderMenu = ({
|
148
|
-
header,
|
149
|
-
table,
|
150
|
-
columnIndex
|
151
|
-
}) => {
|
152
|
-
var _header$column$column9;
|
153
|
-
const [open, setOpen] = React__default.useState(false);
|
154
|
-
const {
|
155
|
-
texts
|
156
|
-
} = useLocalization();
|
157
|
-
const menu = (_header$column$column9 = header.column.columnDef.meta) === null || _header$column$column9 === void 0 ? void 0 : _header$column$column9.menu;
|
158
|
-
const meta = table.options.meta;
|
159
|
-
const {
|
160
|
-
frozenColumnsCount,
|
161
|
-
setFrozenColumnsCount
|
162
|
-
} = meta;
|
163
|
-
const columns = table.getVisibleLeafColumns();
|
164
|
-
const {
|
165
|
-
columnVisibility,
|
166
|
-
columnOrder
|
167
|
-
} = table.getState();
|
168
|
-
const visibleInternalColumnsCount = React__default.useMemo(() => columns.filter(column => isInternalFrozenColumn(column.id)).length, [columns]);
|
169
|
-
const className = cn('-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', {
|
170
|
-
'!flex': open
|
171
|
-
});
|
172
|
-
const menuItems = [];
|
173
|
-
if (table.options.enableHiding && header.column.getCanHide()) {
|
174
|
-
// we do this in the next tick, otherwise the menu closes and react throws a "state update on unmounted component" error
|
175
|
-
const handleClick = () => setTimeout(() => header.column.toggleVisibility(), 1);
|
176
|
-
menuItems.push( /*#__PURE__*/React__default.createElement(Menu.Item, {
|
177
|
-
icon: "eye-off",
|
178
|
-
onClick: handleClick
|
179
|
-
}, texts.table2.columns.menu.hideColumn));
|
180
|
-
}
|
181
|
-
if (meta.enableColumnFreezing) {
|
182
|
-
const columnPosition = columnIndex + 1;
|
183
|
-
const externalFrozenColumnsCount = columnPosition - visibleInternalColumnsCount;
|
184
|
-
const isSomeExternalColumnFrozen = frozenColumnsCount !== 0;
|
185
|
-
const freeAllColumns = () => {
|
186
|
-
setFrozenColumnsCount(0);
|
187
|
-
};
|
188
|
-
const freezeColumns = () => {
|
189
|
-
setFrozenColumnsCount(externalFrozenColumnsCount);
|
190
|
-
};
|
191
|
-
menuItems.push( /*#__PURE__*/React__default.createElement(Menu.Item, {
|
192
|
-
icon: "column-freeze",
|
193
|
-
onClick: freezeColumns,
|
194
|
-
key: "_freeze-columns_"
|
195
|
-
}, texts.table2.columns.menu.freezeColumns(externalFrozenColumnsCount)));
|
196
|
-
if (isSomeExternalColumnFrozen) {
|
197
|
-
menuItems.push( /*#__PURE__*/React__default.createElement(Menu.Item, {
|
198
|
-
icon: "column-unfreeze",
|
199
|
-
onClick: freeAllColumns,
|
200
|
-
key: "_unfreeze-columns_"
|
201
|
-
}, texts.table2.columns.menu.unfreezeColumns));
|
202
|
-
}
|
203
|
-
}
|
204
|
-
React__default.useEffect(() => {
|
205
|
-
// Update column pinning/freezing whenever frozen columns count changes, or column order or visiblity changes
|
206
|
-
const totalFrozenColumnsCount = visibleInternalColumnsCount + frozenColumnsCount;
|
207
|
-
table.setColumnPinning({
|
208
|
-
left: columns.slice(0, totalFrozenColumnsCount).map(column => column.id),
|
209
|
-
right: []
|
210
|
-
});
|
211
|
-
}, [frozenColumnsCount, columnVisibility, columnOrder, visibleInternalColumnsCount]);
|
212
|
-
const menuProps = {
|
213
|
-
trigger: /*#__PURE__*/React__default.createElement(IconButton, {
|
214
|
-
className: className,
|
215
|
-
icon: "more"
|
216
|
-
}),
|
217
|
-
open: open,
|
218
|
-
onChange: setOpen
|
219
|
-
};
|
220
|
-
if (menu) {
|
221
|
-
const customMenu = menu({
|
222
|
-
trigger: undefined
|
223
|
-
});
|
224
|
-
const customItems = React__default.Children.toArray(customMenu.props.children.props.children);
|
225
|
-
if (customItems.length) {
|
226
|
-
if (menuItems.length) {
|
227
|
-
menuItems.push( /*#__PURE__*/React__default.createElement(Menu.Separator, null));
|
228
|
-
}
|
229
|
-
menuItems.push(...customItems);
|
230
|
-
}
|
231
|
-
}
|
232
|
-
const menuComponent = /*#__PURE__*/React__default.createElement(Menu, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu.Content, null, menuItems.map((item, key) => /*#__PURE__*/React__default.cloneElement(item, {
|
233
|
-
key
|
234
|
-
}))));
|
235
|
-
// This div catches the mousedown events from menu item and menu trigger and prevents
|
236
|
-
// mousedown event from bubbling up to the Header component to prevent toggling sorting
|
237
|
-
return menuComponent ? /*#__PURE__*/React__default.createElement("div", {
|
238
|
-
onMouseDown: event => event.stopPropagation()
|
239
|
-
}, menuComponent) : null;
|
240
|
-
};
|
241
|
-
|
242
|
-
export { Header };
|
243
|
-
//# sourceMappingURL=Header.js.map
|
@@ -1 +0,0 @@
|
|
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, TableMeta, Table as RTTable } from '@tanstack/react-table';\nimport { Icon } from '../../../Icon/Icon';\nimport { ColumnBase, ColumnBaseProps } from './Base';\nimport { Tooltip } from '../../../Tooltip/Tooltip';\nimport { isInternalColumn, isInternalFrozenColumn, MIN_COLUMN_SIZE } from '../../utilities/columns';\nimport { isOverflowing } from '../../../../utils/dom';\nimport { getCellAlignmentClasses, getCellSizingClasses } from '../../utilities/cell';\nimport { IconButton } from '../../../IconButton/IconButton';\nimport { Menu } from '../../../Menu/Menu';\nimport { useLocalization } from '../../../Provider/Localization';\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 frozen = !!header.column.getIsPinned();\n const isOtherColumnBeingResized =\n table.getState().columnSizingInfo.isResizingColumn && table.getState().columnSizingInfo.isResizingColumn !== header.id;\n\n const { enableColumnFreezing } = table.options.meta as TableMeta<TType>;\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]': frozen, // frozen 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]: !isInternalFrozenColumn(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\n table.setColumnSizing(sizes => {\n const nextSizes = { ...sizes };\n\n if (size === 'grow') {\n nextSizes[header.id] = '1fr' as any;\n } else if (typeof size === 'number') {\n nextSizes[header.id] = !isInternalFrozenColumn(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 const { texts } = useLocalization();\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 {isInternalFrozenColumn(header.id) ? (\n flexRender(header.column.columnDef.header, header.getContext())\n ) : (\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 {!isInternalColumn(header.column.id) && (header.column.columnDef.meta?.menu || enableColumnFreezing) ? (\n <HeaderMenu header={header} table={table} columnIndex={index} />\n ) : null}\n </>\n )}\n {header.column.getCanResize() ? (\n <Tooltip placement=\"top\" title={texts.table2.columns.resize.tooltip}>\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\ntype HeaderMenuProps = {\n header: RTHeader<any, unknown>;\n table: RTTable<any>;\n columnIndex: number;\n};\n\nconst HeaderMenu = ({ header, table, columnIndex }: HeaderMenuProps) => {\n const [open, setOpen] = React.useState(false);\n const { texts } = useLocalization();\n const menu = header.column.columnDef.meta?.menu;\n const meta = table.options.meta as TableMeta<any>;\n const { frozenColumnsCount, setFrozenColumnsCount } = meta;\n\n const columns = table.getVisibleLeafColumns();\n const { columnVisibility, columnOrder } = table.getState();\n const visibleInternalColumnsCount = React.useMemo(\n () => columns.filter(column => isInternalFrozenColumn(column.id)).length,\n [columns]\n );\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\n const menuItems: JSX.Element[] = [];\n\n if (table.options.enableHiding && header.column.getCanHide()) {\n // we do this in the next tick, otherwise the menu closes and react throws a \"state update on unmounted component\" error\n const handleClick = () => setTimeout(() => header.column.toggleVisibility(), 1);\n\n menuItems.push(\n <Menu.Item icon=\"eye-off\" onClick={handleClick}>\n {texts.table2.columns.menu.hideColumn}\n </Menu.Item>\n );\n }\n\n if (meta.enableColumnFreezing) {\n const columnPosition = columnIndex + 1;\n const externalFrozenColumnsCount = columnPosition - visibleInternalColumnsCount;\n const isSomeExternalColumnFrozen = frozenColumnsCount !== 0;\n const freeAllColumns = () => {\n setFrozenColumnsCount(0);\n };\n const freezeColumns = () => {\n setFrozenColumnsCount(externalFrozenColumnsCount);\n };\n\n menuItems.push(\n <Menu.Item icon=\"column-freeze\" onClick={freezeColumns} key=\"_freeze-columns_\">\n {texts.table2.columns.menu.freezeColumns(externalFrozenColumnsCount)}\n </Menu.Item>\n );\n\n if (isSomeExternalColumnFrozen) {\n menuItems.push(\n <Menu.Item icon=\"column-unfreeze\" onClick={freeAllColumns} key=\"_unfreeze-columns_\">\n {texts.table2.columns.menu.unfreezeColumns}\n </Menu.Item>\n );\n }\n }\n\n React.useEffect(() => {\n // Update column pinning/freezing whenever frozen columns count changes, or column order or visiblity changes\n const totalFrozenColumnsCount = visibleInternalColumnsCount + frozenColumnsCount;\n\n table.setColumnPinning({ left: columns.slice(0, totalFrozenColumnsCount).map(column => column.id), right: [] });\n }, [frozenColumnsCount, columnVisibility, columnOrder, visibleInternalColumnsCount]);\n\n const menuProps = {\n trigger: <IconButton className={className} icon=\"more\" />,\n open: open,\n onChange: setOpen,\n };\n\n if (menu) {\n const customMenu = menu({ trigger: undefined });\n const customItems = React.Children.toArray(customMenu.props.children.props.children) as JSX.Element[];\n\n if (customItems.length) {\n if (menuItems.length) {\n menuItems.push(<Menu.Separator />);\n }\n\n menuItems.push(...customItems);\n }\n }\n\n const menuComponent = (\n <Menu {...menuProps}>\n <Menu.Content>{menuItems.map((item, key) => React.cloneElement(item, { key }))}</Menu.Content>\n </Menu>\n );\n\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 return menuComponent ? <div onMouseDown={event => event.stopPropagation()}>{menuComponent}</div> : null;\n};\n"],"names":["Header","props","header","index","isLastColumn","table","tableRef","columnProps","textRef","React","useRef","frozen","column","getIsPinned","isOtherColumnBeingResized","getState","columnSizingInfo","isResizingColumn","id","enableColumnFreezing","options","meta","className","cn","getIsResizing","getCanSort","getCanResize","_header$column$column","columnDef","menu","getCellSizingClasses","_header$column$column2","headerClassName","refCallback","node","columnSizing","size","Math","ceil","getBoundingClientRect","width","setColumnSizing","sizes","isInternalFrozenColumn","MIN_COLUMN_SIZE","handleMouseDown","event","button","_tableRef$current","preventDefault","resetRowSelection","toggleSorting","current","focus","undefined","handleResizerDoubleClick","_header$column$column3","defaultWidth","nextSizes","handleResizerClick","stopPropagation","handleResize","getResizeHandler","content","ref","flexRender","getContext","texts","useLocalization","ColumnBase","asc","desc","getIsSorted","_asc$desc$header$colu","onMouseDown","role","_header$column$column4","getCellAlignmentClasses","_header$column$column5","align","isOverflowing","Tooltip","title","_header$column$column6","_header$column$column7","tooltip","placement","_asc$desc$header$colu2","Icon","name","isInternalColumn","_header$column$column8","HeaderMenu","columnIndex","table2","columns","resize","onDoubleClick","onTouchStart","onClick","open","setOpen","useState","_header$column$column9","frozenColumnsCount","setFrozenColumnsCount","getVisibleLeafColumns","columnVisibility","columnOrder","visibleInternalColumnsCount","useMemo","filter","length","menuItems","enableHiding","getCanHide","handleClick","setTimeout","toggleVisibility","push","Menu","Item","icon","hideColumn","columnPosition","externalFrozenColumnsCount","isSomeExternalColumnFrozen","freeAllColumns","freezeColumns","key","unfreezeColumns","useEffect","totalFrozenColumnsCount","setColumnPinning","left","slice","map","right","menuProps","trigger","IconButton","onChange","customMenu","customItems","Children","toArray","children","Separator","menuComponent","Content","item","cloneElement"],"mappings":";;;;;;;;;;;;;MAoBaA,MAAM,GAAG,SAASA,MAAMA,CAAkBC,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AAS,CAACD,MAAM,EAAE;QAClBC,SAAS,CAACM,IAAI,eAAC9G,6BAAC+G,IAAI,CAAC2B,SAAS,OAAG,CAAC;;MAGtClC,SAAS,CAACM,IAAI,CAAC,GAAGwB,WAAW,CAAC;;;EAItC,MAAMK,aAAa,gBACf3I,6BAAC+G,IAAI,oBAAKkB,SAAS,gBACfjI,6BAAC+G,IAAI,CAAC6B,OAAO,QAAEpC,SAAS,CAACuB,GAAG,CAAC,CAACc,IAAI,EAAErB,GAAG,kBAAKxH,cAAK,CAAC8I,YAAY,CAACD,IAAI,EAAE;IAAErB;GAAK,CAAC,CAAC,CAAgB,CAErG;;;EAID,OAAOmB,aAAa,gBAAG3I;IAAKiE,WAAW,EAAE5B,KAAK,IAAIA,KAAK,CAACc,eAAe;KAAKwF,aAAa,CAAO,GAAG,IAAI;AAC3G,CAAC;;;;"}
|
@@ -1,73 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import { Icon } from '../../../Icon/Icon.js';
|
3
|
-
import { Tooltip } from '../../../Tooltip/Tooltip.js';
|
4
|
-
import { useLocalization } from '../../../Provider/Localization.js';
|
5
|
-
import ReactDOM from 'react-dom';
|
6
|
-
|
7
|
-
var IndicatorReason;
|
8
|
-
(function (IndicatorReason) {
|
9
|
-
IndicatorReason["SEARCH"] = "SEARCH";
|
10
|
-
IndicatorReason["SORTING"] = "SORTING";
|
11
|
-
IndicatorReason["FILTER"] = "FILTER";
|
12
|
-
})(IndicatorReason || (IndicatorReason = {}));
|
13
|
-
const useIndicatorText = reason => {
|
14
|
-
let title = '';
|
15
|
-
let description = '';
|
16
|
-
const {
|
17
|
-
texts
|
18
|
-
} = useLocalization();
|
19
|
-
switch (reason) {
|
20
|
-
case IndicatorReason.FILTER:
|
21
|
-
title = texts.table2.editing.rowIndicator.rowWillBeHidden;
|
22
|
-
description = texts.table2.editing.rowIndicator.rowWillMoveReasonFilter;
|
23
|
-
break;
|
24
|
-
case IndicatorReason.SEARCH:
|
25
|
-
title = texts.table2.editing.rowIndicator.rowWillBeHidden;
|
26
|
-
description = texts.table2.editing.rowIndicator.rowWillMoveReasonSearch;
|
27
|
-
break;
|
28
|
-
case IndicatorReason.SORTING:
|
29
|
-
title = texts.table2.editing.rowIndicator.rowWillMove;
|
30
|
-
description = texts.table2.editing.rowIndicator.rowWillMoveReasonSorting;
|
31
|
-
break;
|
32
|
-
}
|
33
|
-
return {
|
34
|
-
title,
|
35
|
-
description
|
36
|
-
};
|
37
|
-
};
|
38
|
-
const Indicator = ({
|
39
|
-
reason,
|
40
|
-
columnName,
|
41
|
-
mountNode,
|
42
|
-
validationErrors
|
43
|
-
}) => {
|
44
|
-
const container = React__default.useMemo(() => {
|
45
|
-
const element = document.createElement('div');
|
46
|
-
element.className += 'z-[3] rounded-b-md items-center wcag-blue-500 absolute left-0 top-full ml-1 whitespace-nowrap px-1 py-0.5 text-xs font-bold shadow-sm';
|
47
|
-
return element;
|
48
|
-
}, []);
|
49
|
-
const indicatorText = useIndicatorText(reason);
|
50
|
-
const hasValidationErrorsInRow = !!validationErrors;
|
51
|
-
React__default.useEffect(() => {
|
52
|
-
// mountNode could be null when rows are filtered
|
53
|
-
mountNode === null || mountNode === void 0 ? void 0 : mountNode.classList.add('relative');
|
54
|
-
mountNode === null || mountNode === void 0 ? void 0 : mountNode.appendChild(container);
|
55
|
-
return () => {
|
56
|
-
mountNode === null || mountNode === void 0 ? void 0 : mountNode.classList.remove('relative');
|
57
|
-
mountNode === null || mountNode === void 0 ? void 0 : mountNode.removeChild(container);
|
58
|
-
};
|
59
|
-
}, [hasValidationErrorsInRow]);
|
60
|
-
// Using react portal inside a react tree component is an unorthodox way, but in order to avoid much code refactoring
|
61
|
-
// and being able to use Taco Tooltip component in side the visual indicator, portal is used.
|
62
|
-
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(Tooltip, {
|
63
|
-
title: indicatorText.description.replace('[COLUMN]', columnName)
|
64
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
65
|
-
className: "flex gap-1 hover:cursor-pointer"
|
66
|
-
}, /*#__PURE__*/React__default.createElement(Icon, {
|
67
|
-
name: "info",
|
68
|
-
className: "!h-4 !w-4 rounded-full bg-white !p-0 text-blue-500"
|
69
|
-
}), indicatorText.title)), container);
|
70
|
-
};
|
71
|
-
|
72
|
-
export { Indicator, IndicatorReason, useIndicatorText };
|
73
|
-
//# sourceMappingURL=Indicator.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Indicator.js","sources":["../../../../../../../../../src/components/Table2/components/column/Indicator.tsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { Icon } from '../../../Icon/Icon';\nimport { useLocalization } from '../../../Provider/Localization';\nimport { Tooltip } from '../../../Tooltip/Tooltip';\n\nexport enum IndicatorReason {\n SEARCH = 'SEARCH',\n SORTING = 'SORTING',\n FILTER = 'FILTER',\n}\n\nexport const useIndicatorText = reason => {\n let title = '';\n let description = '';\n\n const { texts } = useLocalization();\n\n switch (reason) {\n case IndicatorReason.FILTER:\n title = texts.table2.editing.rowIndicator.rowWillBeHidden;\n description = texts.table2.editing.rowIndicator.rowWillMoveReasonFilter;\n break;\n case IndicatorReason.SEARCH:\n title = texts.table2.editing.rowIndicator.rowWillBeHidden;\n description = texts.table2.editing.rowIndicator.rowWillMoveReasonSearch;\n break;\n case IndicatorReason.SORTING:\n title = texts.table2.editing.rowIndicator.rowWillMove;\n description = texts.table2.editing.rowIndicator.rowWillMoveReasonSorting;\n break;\n }\n\n return { title, description };\n};\n\nexport type IndicatorProps = {\n reason: IndicatorReason;\n columnName: string;\n mountNode: Element | null;\n validationErrors: any;\n};\nexport const Indicator = ({ reason, columnName, mountNode, validationErrors }: IndicatorProps) => {\n const container = React.useMemo(() => {\n const element = document.createElement('div');\n element.className +=\n 'z-[3] rounded-b-md items-center wcag-blue-500 absolute left-0 top-full ml-1 whitespace-nowrap px-1 py-0.5 text-xs font-bold shadow-sm';\n\n return element;\n }, []);\n\n const indicatorText = useIndicatorText(reason);\n\n const hasValidationErrorsInRow = !!validationErrors;\n\n React.useEffect(() => {\n // mountNode could be null when rows are filtered\n mountNode?.classList.add('relative');\n mountNode?.appendChild(container);\n\n return () => {\n mountNode?.classList.remove('relative');\n mountNode?.removeChild(container);\n };\n }, [hasValidationErrorsInRow]);\n\n // Using react portal inside a react tree component is an unorthodox way, but in order to avoid much code refactoring\n // and being able to use Taco Tooltip component in side the visual indicator, portal is used.\n return ReactDOM.createPortal(\n <Tooltip title={indicatorText.description.replace('[COLUMN]', columnName)}>\n <span className=\"flex gap-1 hover:cursor-pointer\">\n <Icon name=\"info\" className=\"!h-4 !w-4 rounded-full bg-white !p-0 text-blue-500\" />\n {indicatorText.title}\n </span>\n </Tooltip>,\n container\n );\n};\n"],"names":["IndicatorReason","useIndicatorText","reason","title","description","texts","useLocalization","FILTER","table2","editing","rowIndicator","rowWillBeHidden","rowWillMoveReasonFilter","SEARCH","rowWillMoveReasonSearch","SORTING","rowWillMove","rowWillMoveReasonSorting","Indicator","columnName","mountNode","validationErrors","container","React","useMemo","element","document","createElement","className","indicatorText","hasValidationErrorsInRow","useEffect","classList","add","appendChild","remove","removeChild","ReactDOM","createPortal","Tooltip","replace","Icon","name"],"mappings":";;;;;;IAOYA;AAAZ,WAAYA,eAAe;EACvBA,oCAAiB;EACjBA,sCAAmB;EACnBA,oCAAiB;AACrB,CAAC,EAJWA,eAAe,KAAfA,eAAe;MAMdC,gBAAgB,GAAGC,MAAM;EAClC,IAAIC,KAAK,GAAG,EAAE;EACd,IAAIC,WAAW,GAAG,EAAE;EAEpB,MAAM;IAAEC;GAAO,GAAGC,eAAe,EAAE;EAEnC,QAAQJ,MAAM;IACV,KAAKF,eAAe,CAACO,MAAM;MACvBJ,KAAK,GAAGE,KAAK,CAACG,MAAM,CAACC,OAAO,CAACC,YAAY,CAACC,eAAe;MACzDP,WAAW,GAAGC,KAAK,CAACG,MAAM,CAACC,OAAO,CAACC,YAAY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;;;EAI9B,oBAAOO,QAAQ,CAACC,YAAY,eACxBf,6BAACgB,OAAO;IAACpC,KAAK,EAAE0B,aAAa,CAACzB,WAAW,CAACoC,OAAO,CAAC,UAAU,EAAErB,UAAU;kBACpEI;IAAMK,SAAS,EAAC;kBACZL,6BAACkB,IAAI;IAACC,IAAI,EAAC,MAAM;IAACd,SAAS,EAAC;IAAuD,EAClFC,aAAa,CAAC1B,KAAK,CACjB,CACD,EACVmB,SAAS,CACZ;AACL;;;;"}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import cn from 'classnames';
|
3
|
-
import { Tooltip } from '../../../Tooltip/Tooltip.js';
|
4
|
-
import { useTruncated } from '../../../../utils/hooks/useTruncated.js';
|
5
|
-
|
6
|
-
const ValidationError = ({
|
7
|
-
className,
|
8
|
-
...props
|
9
|
-
}) => {
|
10
|
-
const ref = React__default.useRef(null);
|
11
|
-
const {
|
12
|
-
truncated
|
13
|
-
} = useTruncated(ref.current);
|
14
|
-
const error = /*#__PURE__*/React__default.createElement("span", Object.assign({
|
15
|
-
className: cn('truncate px-px text-xs font-normal leading-normal text-red-500', {
|
16
|
-
'hover:cursor-pointer': truncated
|
17
|
-
}, className),
|
18
|
-
ref: ref,
|
19
|
-
role: "alert"
|
20
|
-
}, props));
|
21
|
-
if (truncated) {
|
22
|
-
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
23
|
-
title: props.children
|
24
|
-
}, error);
|
25
|
-
}
|
26
|
-
return error;
|
27
|
-
};
|
28
|
-
|
29
|
-
export { ValidationError };
|
30
|
-
//# sourceMappingURL=ValidationError.js.map
|
package/dist/esm/packages/taco/src/components/Table2/components/column/ValidationError.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ValidationError.js","sources":["../../../../../../../../../src/components/Table2/components/column/ValidationError.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { useTruncated } from '../../../../utils/hooks/useTruncated';\nimport { Tooltip } from '../../../Tooltip/Tooltip';\n\nexport const ValidationError = ({ className, ...props }: { className?: string; children: string }) => {\n const ref = React.useRef<HTMLSpanElement>(null);\n const { truncated } = useTruncated(ref.current);\n\n const error = (\n <span\n className={cn(\n 'truncate px-px text-xs font-normal leading-normal text-red-500',\n {\n 'hover:cursor-pointer': truncated,\n },\n className\n )}\n ref={ref}\n role=\"alert\"\n {...props}\n />\n );\n\n if (truncated) {\n return <Tooltip title={props.children}>{error}</Tooltip>;\n }\n\n return error;\n};\n"],"names":["ValidationError","className","props","ref","React","useRef","truncated","useTruncated","current","error","cn","role","Tooltip","title","children"],"mappings":";;;;;MAKaA,eAAe,GAAGA,CAAC;EAAEC,SAAS;EAAE,GAAGC;CAAiD;EAC7F,MAAMC,GAAG,GAAGC,cAAK,CAACC,MAAM,CAAkB,IAAI,CAAC;EAC/C,MAAM;IAAEC;GAAW,GAAGC,YAAY,CAACJ,GAAG,CAACK,OAAO,CAAC;EAE/C,MAAMC,KAAK,gBACPL;IACIH,SAAS,EAAES,EAAE,CACT,gEAAgE,EAChE;MACI,sBAAsB,EAAEJ;KAC3B,EACDL,SAAS,CACZ;IACDE,GAAG,EAAEA,GAAG;IACRQ,IAAI,EAAC;KACDT,KAAK,EAEhB;EAED,IAAII,SAAS,EAAE;IACX,oBAAOF,6BAACQ,OAAO;MAACC,KAAK,EAAEX,KAAK,CAACY;OAAWL,KAAK,CAAW;;EAG5D,OAAOA,KAAK;AAChB;;;;"}
|