@economic/taco 1.21.3 → 1.21.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -260,7 +260,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
260
260
  return summaryIds.length && summaryIds.some(v => !visibleIds.includes(v));
261
261
  }, [footers, columnVisibility]);
262
262
  return /*#__PURE__*/React__default.createElement("div", {
263
- className: "flex h-full w-full flex-col gap-4"
263
+ className: "flex h-full w-full flex-col gap-4 overflow-hidden"
264
264
  }, hasToolbar ? /*#__PURE__*/React__default.createElement("div", {
265
265
  className: "flex flex-wrap gap-2"
266
266
  }, toolbar, hasInternalToolbar ? /*#__PURE__*/React__default.createElement(Group, {
@@ -1 +1 @@
1
- {"version":3,"file":"Table2.js","sources":["../../../../../../../src/components/Table2/Table2.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Row as TRow, TableMeta } from '@tanstack/react-table';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { Cell } from './components/column/Cell';\nimport { Header } from './components/column/Header';\nimport { Footer } from './components/column/Footer';\nimport { Table2Props, Table2ColumnProps, Table2ToolbarProps } from './types';\nimport { useTable } from './hooks/useTable';\nimport { useVirtualiser } from './hooks/useVirtualiser';\nimport { Group } from '../Group/Group';\nimport { useGridTemplate } from './hooks/useGridTemplate';\nimport { RowDensityButton } from './components/RowDensityButton';\nimport { ColumnSettingsButton } from './components/ColumnSettingsButton';\nimport { ExpandedRow } from './components/row/ExpandedRow';\nimport { useSeparatedChildren } from './hooks/useSeparatedChildren';\nimport { BatchActionsMenu } from './components/BatchActionsMenu';\nimport { Row } from './components/row/Row';\nimport { FiltersButton } from './components/filters/FiltersButton';\nimport { Search } from './components/Search';\nimport { ShortcutsGuideButton } from './components/ShortcutsGuideButton';\nimport { EditModeButton } from './components/EditModeButton';\n\nexport type Table2Texts = {\n columns: {\n actions: {\n tooltip: string;\n };\n drag: {\n tooltip: string;\n };\n expansion: {\n collapse: string;\n collapseAll: string;\n expand: string;\n expandAll: string;\n };\n select: {\n deselect: string;\n deselectAll: string;\n select: string;\n selectAll: string;\n };\n };\n columnSettings: {\n columnsOther: string;\n columnsOtherDrop: string;\n columnsPinned: string;\n columnsPinnedDrop: string;\n search: string;\n tooltip: string;\n };\n editing: {\n button: string;\n tooltip: string;\n tooltipDisabled: string;\n rowIndicator: {\n rowWillMove: string;\n rowWillBeHidden: string;\n rowWillMoveReasonSearch: string;\n rowWillMoveReasonFilter: string;\n rowWillMoveReasonSorting: string;\n };\n };\n filters: {\n button: string;\n buttons: {\n addFilter: string;\n clearFilters: string;\n };\n comparators: {\n contains: string;\n doesNotContain: string;\n isEqualTo: string;\n isNotEqualTo: string;\n isGreaterThan: string;\n isLessThan: string;\n isBetween: string;\n isOneOf: string;\n isNoneOf: string;\n isAllOf: string;\n isEmpty: string;\n isNotEmpty: string;\n };\n tooltip: string;\n total: string;\n };\n rowDensity: {\n tooltip: string;\n };\n search: {\n placeholder: string;\n };\n shortcuts: {\n tooltip: string;\n search: string;\n filter: string;\n previousRow: string;\n nextRow: string;\n editCell: string;\n previousColumn: string;\n nextColumn: string;\n rowClick: string;\n selectRow: string;\n selectAllRows: string;\n expandRow: string;\n collapseRow: string;\n };\n};\n\nfunction Column<TType = any>(_: Table2ColumnProps<TType>) {\n return null;\n}\nColumn.displayName = 'Table2Column';\n\nfunction Toolbar(props: Table2ToolbarProps) {\n const className = cn('flex-grow', props.className);\n return <div {...props} className={className} />;\n}\nToolbar.displayName = 'Table2Toolbar';\n\nexport type ForwardedTable2WithStatics = React.ForwardRefExoticComponent<Table2Props<any>> & {\n Column: <TType>(props: Table2ColumnProps<TType>) => JSX.Element | null;\n Toolbar: React.FunctionComponent<Table2ToolbarProps>;\n} & (<TType>(props: Table2Props<TType> & { ref?: React.Ref<HTMLDivElement> }) => JSX.Element);\n\nconst Table2 = React.forwardRef(function Table2<TType = any>(props: Table2Props<TType>, ref: React.Ref<HTMLDivElement>) {\n // dom\n const {\n emptyState: EmptyState,\n expandedRowRenderer,\n length = props.data.length,\n loadMore,\n onRowClick,\n _experimentalActionsForTable,\n _experimentalActionsForTableSummary,\n } = props;\n const tableRef = useMergedRef<HTMLDivElement>(ref);\n const timeoutIdRef = React.useRef<NodeJS.Timeout>();\n\n // react-table\n const [columns, toolbar] = useSeparatedChildren(props.children);\n const { rows, table, footers } = useTable(columns, props, tableRef);\n const meta = table.options.meta as TableMeta<TType>;\n\n const { columnVisibility, columnOrder, globalFilter } = table.getState();\n\n // If column visibility or order changes then we turn off the edit mode so that control indexes gets computed\n // when user turns on the editing mode again. This is a temporary solution to make sure the keyboard navigation\n // still keeps working on changes in column visibility, order, or both\n React.useEffect(() => {\n meta.resetFocussableColumnIndexes();\n }, [columnVisibility, columnOrder]);\n\n React.useEffect(() => {\n // Whenever edit mode is turned off we reset the focussableColumnIndexes ref to an empty array so that\n // we don't have stale values, in case column visibility or ordering changes\n if (!meta.editMode.isEditing) {\n meta.resetFocussableColumnIndexes();\n }\n }, [meta.editMode.isEditing]);\n\n React.useEffect(() => {\n return () => clearTimeout(timeoutIdRef.current);\n }, []);\n\n // virtualiser\n const { virtualiser, virtualiserOffsets, setExpandedRowSizes } = useVirtualiser({ rows, table }, tableRef);\n\n // css grid\n const gridTemplateColumns = useGridTemplate(table);\n\n // handlers\n const editButtonRef = React.useRef(null);\n\n // support grid like keyboard navigation between cells\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (document.activeElement === tableRef.current) {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(0);\n virtualiser.scrollToOffset(0);\n } else {\n meta.moveToPreviousRow(rows, nextIndex => virtualiser.scrollToIndex(nextIndex - 1));\n }\n\n return;\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(rows.length - 1);\n virtualiser.scrollToOffset(virtualiser.totalSize + 1);\n } else {\n meta.moveToNextRow(rows, nextIndex => {\n // the virtualiser doesn't always scroll right to the bottom for the last row\n if (nextIndex === rows.length - 1) {\n tableRef.current?.scrollTo(0, tableRef.current.scrollHeight);\n } else {\n virtualiser.scrollToIndex(nextIndex + 2);\n }\n });\n }\n\n return;\n }\n\n const canToggleRowExpansion = table.options.enableExpanding;\n\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta.activeRowIndex]?.toggleExpanded(false);\n }\n }\n return;\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta?.activeRowIndex]?.toggleExpanded(true);\n }\n }\n\n return;\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (onRowClick) {\n onRowClick(rows[meta?.activeRowIndex].original);\n }\n\n return;\n }\n\n if (event.key === ' ') {\n event.preventDefault();\n\n if (table.options.enableRowSelection) {\n rows[meta.activeRowIndex]?.toggleSelected();\n }\n\n return;\n }\n\n if (event.ctrlKey || event.metaKey) {\n event.preventDefault();\n\n if (event.key === 'a') {\n if (table.options.enableRowSelection) {\n table.toggleAllRowsSelected();\n }\n }\n\n return;\n }\n }\n };\n\n let handleBlur;\n\n if (meta.editMode.isEditing) {\n handleBlur = (event: React.FocusEvent) => {\n let elementGainingFocus = event.relatedTarget;\n\n if (elementGainingFocus === undefined) {\n return;\n }\n\n // we might be focusing on a select or a popover that was triggered from inside the table\n // so see if the element gaining focus is inside a portal and look up its controller\n const portalId = elementGainingFocus?.closest('[data-radix-popper-content-wrapper] > :first-child')?.id;\n\n if (portalId) {\n elementGainingFocus = event.currentTarget.querySelector(`[aria-controls=\"${portalId}\"]`) ?? event.relatedTarget;\n }\n\n if (!event.currentTarget?.contains(elementGainingFocus) && elementGainingFocus !== editButtonRef.current) {\n // When we call manually blur on control component while navigating to the next cell, then when this\n // handler is run, the related target is not the next control component and active element is null,\n // that's why we explictly need to check what's the next focussed element in order to figure out whether\n // we should disabled the sorting or not.\n timeoutIdRef.current = setTimeout(() => {\n const parentRow = event.target.closest('[role=\"row\"]');\n const isNewFocussedElementInSameRow = parentRow?.contains(document.activeElement);\n\n // When we manually call blur on control component and focus another component then\n // we have to make sure we\n if (meta.shouldPauseSortingAndFiltering && !isNewFocussedElementInSameRow) {\n // if client side - unpause sorting\n meta.setShouldPauseSortingAndFiltering(false);\n }\n });\n }\n };\n }\n\n // TODO: this can probably be extracted into a hook\n // we only show the pinned shadow on display columns when scrolling is active\n const [scrolled, setScrolled] = React.useState(false);\n\n // extract - infinite loading\n const loadingRef = React.useRef(false);\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !scrolled) {\n setScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && scrolled) {\n setScrolled(false);\n } else if (typeof loadMore === 'function') {\n if (\n event.currentTarget.scrollHeight - event.currentTarget.scrollTop - event.currentTarget.clientHeight < 600 &&\n !loadingRef.current\n ) {\n try {\n const isAllRowsSelected = table.getIsAllRowsSelected();\n loadingRef.current = true;\n await loadMore();\n\n if (isAllRowsSelected) {\n table.toggleAllRowsSelected(true);\n }\n } finally {\n loadingRef.current = false;\n }\n }\n }\n };\n\n let handleMouseLeave;\n\n if (meta.hoveredRowIndex !== undefined) {\n // sometimes the row's onMouseLeave doesn't trigger, this adds some extra redundancy\n handleMouseLeave = () => meta.setHoveredRowIndex(undefined);\n }\n\n const className = cn(\n 'bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid auto-rows-max overflow-auto relative rounded group',\n props.className\n );\n\n const enableSettingsButton = table.options.enablePinning || table.options.enableHiding || meta.enableColumnReordering;\n const hasInternalToolbar =\n enableSettingsButton ||\n meta.editMode.enableEditMode ||\n table.options.enableColumnFilters ||\n meta.enableRowDensity ||\n table.options.enableGlobalFilter;\n const hasToolbar = !!toolbar || hasInternalToolbar;\n\n const hasFooters = React.useMemo(() => {\n const summaryIds = Object.keys(footers);\n const visibleIds = Object.keys(columnVisibility).filter(c => !columnVisibility[c]);\n return summaryIds.length && summaryIds.some(v => !visibleIds.includes(v));\n }, [footers, columnVisibility]);\n\n return (\n <div className=\"flex h-full w-full flex-col gap-4\">\n {hasToolbar ? (\n <div className=\"flex flex-wrap gap-2\">\n {toolbar}\n {hasInternalToolbar ? (\n <Group className=\"ml-auto flex-shrink-0 print:hidden\">\n {meta.editMode.enableEditMode ? (\n <EditModeButton\n ref={editButtonRef}\n table={table}\n tableRef={tableRef}\n scrollToIndex={virtualiser.scrollToIndex}\n />\n ) : null}\n {table.options.enableColumnFilters ? <FiltersButton length={length} table={table} /> : null}\n {meta.enableRowDensity ? <RowDensityButton table={table} /> : null}\n {enableSettingsButton ? <ColumnSettingsButton table={table} /> : null}\n {table.options.enableGlobalFilter ? (\n <Search\n disabled={meta.shouldDisableTableActions}\n onSearch={table.setGlobalFilter}\n value={globalFilter}\n />\n ) : null}\n </Group>\n ) : null}\n <ShortcutsGuideButton table={table} />\n </div>\n ) : null}\n <div\n className={className}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onMouseLeave={handleMouseLeave}\n onScroll={handleScroll}\n ref={tableRef}\n role=\"table\"\n style={{\n gridTemplateColumns,\n gridTemplateRows: rows.length ? undefined : '40px',\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n opacity: 0.999,\n }}\n tabIndex={0}>\n <div className=\"contents\" data-taco=\"table2-header\" role=\"rowgroup\">\n {table.getHeaderGroups().map(headerGroup => (\n <div className=\"contents\" key={headerGroup.id} role=\"row\">\n {headerGroup.headers.map((header, columnIndex) => (\n <Header\n key={header.id}\n header={header}\n index={columnIndex}\n isLastColumn={columnIndex === headerGroup.headers.length - 1}\n scrolled={scrolled}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </div>\n ))}\n </div>\n {rows.length ? (\n <div className=\"contents\" data-taco=\"table2-body\" role=\"rowgroup\">\n {virtualiserOffsets.top ? (\n <div style={{ height: virtualiserOffsets.top }} className=\"col-span-full\" />\n ) : null}\n {virtualiser.virtualItems.map(virtualRow => {\n const row = rows[virtualRow.index];\n\n return (\n <React.Fragment key={row.id}>\n <Row className=\"group/row contents\" row={row} rowIndex={virtualRow.index} table={table}>\n {row.getVisibleCells().map((cell, columnIndex) => (\n <Cell\n cell={cell}\n key={`${cell.id}_${cell.getValue()}`}\n index={columnIndex}\n isLastRow={virtualRow.index === rows.length - 1}\n rows={rows}\n rowIndex={virtualRow.index}\n scrolled={scrolled}\n scrollToIndex={virtualiser.scrollToIndex}\n scrollToOffset={virtualiser.scrollToOffset}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </Row>\n {row.getIsExpanded() && expandedRowRenderer ? (\n <ExpandedRow index={virtualRow.index} setSize={setExpandedRowSizes}>\n {expandedRowRenderer(row.original)}\n </ExpandedRow>\n ) : null}\n </React.Fragment>\n );\n })}\n {virtualiserOffsets.bottom ? (\n <div style={{ height: virtualiserOffsets.bottom }} className=\"col-span-full\" />\n ) : null}\n </div>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n {hasFooters ? (\n <div role=\"rowgroup\" className=\"contents\" data-taco=\"table2-footer\">\n {table.getFooterGroups().map(footerGroup => (\n <div key={footerGroup.id} role=\"row\" className=\"contents\">\n {footerGroup.headers.map((footer, cellIndex) => (\n <Footer key={footer.id} footer={footer} index={cellIndex} scrolled={scrolled} table={table}>\n {footers[footer.id]\n ? footers[footer.id](rows.map((row: TRow<TType>) => row.original[footer.id]))\n : null}\n </Footer>\n ))}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n {!!_experimentalActionsForTable &&\n table.options.enableRowSelection &&\n (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) ? (\n <BatchActionsMenu<TType>\n className=\"fixed-center-x bottom-0 z-50 mb-4 print:hidden\"\n actionsForTable={_experimentalActionsForTable}\n summary={_experimentalActionsForTableSummary}\n table={table}\n />\n ) : null}\n </div>\n );\n}) as ForwardedTable2WithStatics;\n\nTable2.Column = Column;\nTable2.Toolbar = Toolbar;\n\nexport { Table2 };\nexport type { Table2Props };\nexport type { Table2ColumnProps, Table2ActionProps, Table2RowActionProps, Table2Settings, Table2ToolbarProps } from './types';\n"],"names":["Column","_","displayName","Toolbar","props","className","cn","React","Table2","forwardRef","ref","emptyState","EmptyState","expandedRowRenderer","length","data","loadMore","onRowClick","_experimentalActionsForTable","_experimentalActionsForTableSummary","tableRef","useMergedRef","timeoutIdRef","useRef","columns","toolbar","useSeparatedChildren","children","rows","table","footers","useTable","meta","options","columnVisibility","columnOrder","globalFilter","getState","useEffect","resetFocussableColumnIndexes","editMode","isEditing","clearTimeout","current","virtualiser","virtualiserOffsets","setExpandedRowSizes","useVirtualiser","gridTemplateColumns","useGridTemplate","editButtonRef","handleKeyDown","event","document","activeElement","key","preventDefault","ctrlKey","metaKey","setActiveRowIndex","scrollToOffset","moveToPreviousRow","nextIndex","scrollToIndex","totalSize","moveToNextRow","scrollTo","scrollHeight","canToggleRowExpansion","enableExpanding","activeRowIndex","toggleExpanded","original","enableRowSelection","toggleSelected","toggleAllRowsSelected","handleBlur","elementGainingFocus","relatedTarget","undefined","portalId","closest","id","currentTarget","querySelector","contains","setTimeout","parentRow","target","isNewFocussedElementInSameRow","shouldPauseSortingAndFiltering","setShouldPauseSortingAndFiltering","scrolled","setScrolled","useState","loadingRef","handleScroll","scrollLeft","scrollTop","clientHeight","isAllRowsSelected","getIsAllRowsSelected","handleMouseLeave","hoveredRowIndex","setHoveredRowIndex","enableSettingsButton","enablePinning","enableHiding","enableColumnReordering","hasInternalToolbar","enableEditMode","enableColumnFilters","enableRowDensity","enableGlobalFilter","hasToolbar","hasFooters","useMemo","summaryIds","Object","keys","visibleIds","filter","c","some","v","includes","Group","EditModeButton","FiltersButton","RowDensityButton","ColumnSettingsButton","Search","disabled","shouldDisableTableActions","onSearch","setGlobalFilter","value","ShortcutsGuideButton","onBlur","onKeyDown","onMouseLeave","onScroll","role","style","gridTemplateRows","opacity","tabIndex","getHeaderGroups","map","headerGroup","headers","header","columnIndex","Header","index","isLastColumn","top","height","virtualItems","virtualRow","row","Fragment","Row","rowIndex","getVisibleCells","cell","Cell","getValue","isLastRow","getIsExpanded","ExpandedRow","setSize","bottom","getFooterGroups","footerGroup","footer","cellIndex","Footer","getIsSomeRowsSelected","BatchActionsMenu","actionsForTable","summary"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8GA,SAASA,MAAM,CAAcC,CAA2B;EACpD,OAAO,IAAI;AACf;AACAD,MAAM,CAACE,WAAW,GAAG,cAAc;AAEnC,SAASC,OAAO,CAACC,KAAyB;EACtC,MAAMC,SAAS,GAAGC,EAAE,CAAC,WAAW,EAAEF,KAAK,CAACC,SAAS,CAAC;EAClD,oBAAOE,sDAASH,KAAK;IAAEC,SAAS,EAAEA;KAAa;AACnD;AACAF,OAAO,CAACD,WAAW,GAAG,eAAe;MAO/BM,MAAM,gBAAGD,cAAK,CAACE,UAAU,CAAC,SAASD,MAAM,CAAcJ,KAAyB,EAAEM,GAA8B;;EAElH,MAAM;IACFC,UAAU,EAAEC,UAAU;IACtBC,mBAAmB;IACnBC,MAAM,GAAGV,KAAK,CAACW,IAAI,CAACD,MAAM;IAC1BE,QAAQ;IACRC,UAAU;IACVC,4BAA4B;IAC5BC;GACH,GAAGf,KAAK;EACT,MAAMgB,QAAQ,GAAGC,YAAY,CAAiBX,GAAG,CAAC;EAClD,MAAMY,YAAY,GAAGf,cAAK,CAACgB,MAAM,EAAkB;;EAGnD,MAAM,CAACC,OAAO,EAAEC,OAAO,CAAC,GAAGC,oBAAoB,CAACtB,KAAK,CAACuB,QAAQ,CAAC;EAC/D,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC;GAAS,GAAGC,QAAQ,CAACP,OAAO,EAAEpB,KAAK,EAAEgB,QAAQ,CAAC;EAC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../../../../../src/components/Table2/Table2.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Row as TRow, TableMeta } from '@tanstack/react-table';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { Cell } from './components/column/Cell';\nimport { Header } from './components/column/Header';\nimport { Footer } from './components/column/Footer';\nimport { Table2Props, Table2ColumnProps, Table2ToolbarProps } from './types';\nimport { useTable } from './hooks/useTable';\nimport { useVirtualiser } from './hooks/useVirtualiser';\nimport { Group } from '../Group/Group';\nimport { useGridTemplate } from './hooks/useGridTemplate';\nimport { RowDensityButton } from './components/RowDensityButton';\nimport { ColumnSettingsButton } from './components/ColumnSettingsButton';\nimport { ExpandedRow } from './components/row/ExpandedRow';\nimport { useSeparatedChildren } from './hooks/useSeparatedChildren';\nimport { BatchActionsMenu } from './components/BatchActionsMenu';\nimport { Row } from './components/row/Row';\nimport { FiltersButton } from './components/filters/FiltersButton';\nimport { Search } from './components/Search';\nimport { ShortcutsGuideButton } from './components/ShortcutsGuideButton';\nimport { EditModeButton } from './components/EditModeButton';\n\nexport type Table2Texts = {\n columns: {\n actions: {\n tooltip: string;\n };\n drag: {\n tooltip: string;\n };\n expansion: {\n collapse: string;\n collapseAll: string;\n expand: string;\n expandAll: string;\n };\n select: {\n deselect: string;\n deselectAll: string;\n select: string;\n selectAll: string;\n };\n };\n columnSettings: {\n columnsOther: string;\n columnsOtherDrop: string;\n columnsPinned: string;\n columnsPinnedDrop: string;\n search: string;\n tooltip: string;\n };\n editing: {\n button: string;\n tooltip: string;\n tooltipDisabled: string;\n rowIndicator: {\n rowWillMove: string;\n rowWillBeHidden: string;\n rowWillMoveReasonSearch: string;\n rowWillMoveReasonFilter: string;\n rowWillMoveReasonSorting: string;\n };\n };\n filters: {\n button: string;\n buttons: {\n addFilter: string;\n clearFilters: string;\n };\n comparators: {\n contains: string;\n doesNotContain: string;\n isEqualTo: string;\n isNotEqualTo: string;\n isGreaterThan: string;\n isLessThan: string;\n isBetween: string;\n isOneOf: string;\n isNoneOf: string;\n isAllOf: string;\n isEmpty: string;\n isNotEmpty: string;\n };\n tooltip: string;\n total: string;\n };\n rowDensity: {\n tooltip: string;\n };\n search: {\n placeholder: string;\n };\n shortcuts: {\n tooltip: string;\n search: string;\n filter: string;\n previousRow: string;\n nextRow: string;\n editCell: string;\n previousColumn: string;\n nextColumn: string;\n rowClick: string;\n selectRow: string;\n selectAllRows: string;\n expandRow: string;\n collapseRow: string;\n };\n};\n\nfunction Column<TType = any>(_: Table2ColumnProps<TType>) {\n return null;\n}\nColumn.displayName = 'Table2Column';\n\nfunction Toolbar(props: Table2ToolbarProps) {\n const className = cn('flex-grow', props.className);\n return <div {...props} className={className} />;\n}\nToolbar.displayName = 'Table2Toolbar';\n\nexport type ForwardedTable2WithStatics = React.ForwardRefExoticComponent<Table2Props<any>> & {\n Column: <TType>(props: Table2ColumnProps<TType>) => JSX.Element | null;\n Toolbar: React.FunctionComponent<Table2ToolbarProps>;\n} & (<TType>(props: Table2Props<TType> & { ref?: React.Ref<HTMLDivElement> }) => JSX.Element);\n\nconst Table2 = React.forwardRef(function Table2<TType = any>(props: Table2Props<TType>, ref: React.Ref<HTMLDivElement>) {\n // dom\n const {\n emptyState: EmptyState,\n expandedRowRenderer,\n length = props.data.length,\n loadMore,\n onRowClick,\n _experimentalActionsForTable,\n _experimentalActionsForTableSummary,\n } = props;\n const tableRef = useMergedRef<HTMLDivElement>(ref);\n const timeoutIdRef = React.useRef<NodeJS.Timeout>();\n\n // react-table\n const [columns, toolbar] = useSeparatedChildren(props.children);\n const { rows, table, footers } = useTable(columns, props, tableRef);\n const meta = table.options.meta as TableMeta<TType>;\n\n const { columnVisibility, columnOrder, globalFilter } = table.getState();\n\n // If column visibility or order changes then we turn off the edit mode so that control indexes gets computed\n // when user turns on the editing mode again. This is a temporary solution to make sure the keyboard navigation\n // still keeps working on changes in column visibility, order, or both\n React.useEffect(() => {\n meta.resetFocussableColumnIndexes();\n }, [columnVisibility, columnOrder]);\n\n React.useEffect(() => {\n // Whenever edit mode is turned off we reset the focussableColumnIndexes ref to an empty array so that\n // we don't have stale values, in case column visibility or ordering changes\n if (!meta.editMode.isEditing) {\n meta.resetFocussableColumnIndexes();\n }\n }, [meta.editMode.isEditing]);\n\n React.useEffect(() => {\n return () => clearTimeout(timeoutIdRef.current);\n }, []);\n\n // virtualiser\n const { virtualiser, virtualiserOffsets, setExpandedRowSizes } = useVirtualiser({ rows, table }, tableRef);\n\n // css grid\n const gridTemplateColumns = useGridTemplate(table);\n\n // handlers\n const editButtonRef = React.useRef(null);\n\n // support grid like keyboard navigation between cells\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (document.activeElement === tableRef.current) {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(0);\n virtualiser.scrollToOffset(0);\n } else {\n meta.moveToPreviousRow(rows, nextIndex => virtualiser.scrollToIndex(nextIndex - 1));\n }\n\n return;\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(rows.length - 1);\n virtualiser.scrollToOffset(virtualiser.totalSize + 1);\n } else {\n meta.moveToNextRow(rows, nextIndex => {\n // the virtualiser doesn't always scroll right to the bottom for the last row\n if (nextIndex === rows.length - 1) {\n tableRef.current?.scrollTo(0, tableRef.current.scrollHeight);\n } else {\n virtualiser.scrollToIndex(nextIndex + 2);\n }\n });\n }\n\n return;\n }\n\n const canToggleRowExpansion = table.options.enableExpanding;\n\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta.activeRowIndex]?.toggleExpanded(false);\n }\n }\n return;\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta?.activeRowIndex]?.toggleExpanded(true);\n }\n }\n\n return;\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (onRowClick) {\n onRowClick(rows[meta?.activeRowIndex].original);\n }\n\n return;\n }\n\n if (event.key === ' ') {\n event.preventDefault();\n\n if (table.options.enableRowSelection) {\n rows[meta.activeRowIndex]?.toggleSelected();\n }\n\n return;\n }\n\n if (event.ctrlKey || event.metaKey) {\n event.preventDefault();\n\n if (event.key === 'a') {\n if (table.options.enableRowSelection) {\n table.toggleAllRowsSelected();\n }\n }\n\n return;\n }\n }\n };\n\n let handleBlur;\n\n if (meta.editMode.isEditing) {\n handleBlur = (event: React.FocusEvent) => {\n let elementGainingFocus = event.relatedTarget;\n\n if (elementGainingFocus === undefined) {\n return;\n }\n\n // we might be focusing on a select or a popover that was triggered from inside the table\n // so see if the element gaining focus is inside a portal and look up its controller\n const portalId = elementGainingFocus?.closest('[data-radix-popper-content-wrapper] > :first-child')?.id;\n\n if (portalId) {\n elementGainingFocus = event.currentTarget.querySelector(`[aria-controls=\"${portalId}\"]`) ?? event.relatedTarget;\n }\n\n if (!event.currentTarget?.contains(elementGainingFocus) && elementGainingFocus !== editButtonRef.current) {\n // When we call manually blur on control component while navigating to the next cell, then when this\n // handler is run, the related target is not the next control component and active element is null,\n // that's why we explictly need to check what's the next focussed element in order to figure out whether\n // we should disabled the sorting or not.\n timeoutIdRef.current = setTimeout(() => {\n const parentRow = event.target.closest('[role=\"row\"]');\n const isNewFocussedElementInSameRow = parentRow?.contains(document.activeElement);\n\n // When we manually call blur on control component and focus another component then\n // we have to make sure we\n if (meta.shouldPauseSortingAndFiltering && !isNewFocussedElementInSameRow) {\n // if client side - unpause sorting\n meta.setShouldPauseSortingAndFiltering(false);\n }\n });\n }\n };\n }\n\n // TODO: this can probably be extracted into a hook\n // we only show the pinned shadow on display columns when scrolling is active\n const [scrolled, setScrolled] = React.useState(false);\n\n // extract - infinite loading\n const loadingRef = React.useRef(false);\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !scrolled) {\n setScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && scrolled) {\n setScrolled(false);\n } else if (typeof loadMore === 'function') {\n if (\n event.currentTarget.scrollHeight - event.currentTarget.scrollTop - event.currentTarget.clientHeight < 600 &&\n !loadingRef.current\n ) {\n try {\n const isAllRowsSelected = table.getIsAllRowsSelected();\n loadingRef.current = true;\n await loadMore();\n\n if (isAllRowsSelected) {\n table.toggleAllRowsSelected(true);\n }\n } finally {\n loadingRef.current = false;\n }\n }\n }\n };\n\n let handleMouseLeave;\n\n if (meta.hoveredRowIndex !== undefined) {\n // sometimes the row's onMouseLeave doesn't trigger, this adds some extra redundancy\n handleMouseLeave = () => meta.setHoveredRowIndex(undefined);\n }\n\n const className = cn(\n 'bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid auto-rows-max overflow-auto relative rounded group',\n props.className\n );\n\n const enableSettingsButton = table.options.enablePinning || table.options.enableHiding || meta.enableColumnReordering;\n const hasInternalToolbar =\n enableSettingsButton ||\n meta.editMode.enableEditMode ||\n table.options.enableColumnFilters ||\n meta.enableRowDensity ||\n table.options.enableGlobalFilter;\n const hasToolbar = !!toolbar || hasInternalToolbar;\n\n const hasFooters = React.useMemo(() => {\n const summaryIds = Object.keys(footers);\n const visibleIds = Object.keys(columnVisibility).filter(c => !columnVisibility[c]);\n return summaryIds.length && summaryIds.some(v => !visibleIds.includes(v));\n }, [footers, columnVisibility]);\n\n return (\n <div className=\"flex h-full w-full flex-col gap-4 overflow-hidden\">\n {hasToolbar ? (\n <div className=\"flex flex-wrap gap-2\">\n {toolbar}\n {hasInternalToolbar ? (\n <Group className=\"ml-auto flex-shrink-0 print:hidden\">\n {meta.editMode.enableEditMode ? (\n <EditModeButton\n ref={editButtonRef}\n table={table}\n tableRef={tableRef}\n scrollToIndex={virtualiser.scrollToIndex}\n />\n ) : null}\n {table.options.enableColumnFilters ? <FiltersButton length={length} table={table} /> : null}\n {meta.enableRowDensity ? <RowDensityButton table={table} /> : null}\n {enableSettingsButton ? <ColumnSettingsButton table={table} /> : null}\n {table.options.enableGlobalFilter ? (\n <Search\n disabled={meta.shouldDisableTableActions}\n onSearch={table.setGlobalFilter}\n value={globalFilter}\n />\n ) : null}\n </Group>\n ) : null}\n <ShortcutsGuideButton table={table} />\n </div>\n ) : null}\n <div\n className={className}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onMouseLeave={handleMouseLeave}\n onScroll={handleScroll}\n ref={tableRef}\n role=\"table\"\n style={{\n gridTemplateColumns,\n gridTemplateRows: rows.length ? undefined : '40px',\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n opacity: 0.999,\n }}\n tabIndex={0}>\n <div className=\"contents\" data-taco=\"table2-header\" role=\"rowgroup\">\n {table.getHeaderGroups().map(headerGroup => (\n <div className=\"contents\" key={headerGroup.id} role=\"row\">\n {headerGroup.headers.map((header, columnIndex) => (\n <Header\n key={header.id}\n header={header}\n index={columnIndex}\n isLastColumn={columnIndex === headerGroup.headers.length - 1}\n scrolled={scrolled}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </div>\n ))}\n </div>\n {rows.length ? (\n <div className=\"contents\" data-taco=\"table2-body\" role=\"rowgroup\">\n {virtualiserOffsets.top ? (\n <div style={{ height: virtualiserOffsets.top }} className=\"col-span-full\" />\n ) : null}\n {virtualiser.virtualItems.map(virtualRow => {\n const row = rows[virtualRow.index];\n\n return (\n <React.Fragment key={row.id}>\n <Row className=\"group/row contents\" row={row} rowIndex={virtualRow.index} table={table}>\n {row.getVisibleCells().map((cell, columnIndex) => (\n <Cell\n cell={cell}\n key={`${cell.id}_${cell.getValue()}`}\n index={columnIndex}\n isLastRow={virtualRow.index === rows.length - 1}\n rows={rows}\n rowIndex={virtualRow.index}\n scrolled={scrolled}\n scrollToIndex={virtualiser.scrollToIndex}\n scrollToOffset={virtualiser.scrollToOffset}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </Row>\n {row.getIsExpanded() && expandedRowRenderer ? (\n <ExpandedRow index={virtualRow.index} setSize={setExpandedRowSizes}>\n {expandedRowRenderer(row.original)}\n </ExpandedRow>\n ) : null}\n </React.Fragment>\n );\n })}\n {virtualiserOffsets.bottom ? (\n <div style={{ height: virtualiserOffsets.bottom }} className=\"col-span-full\" />\n ) : null}\n </div>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n {hasFooters ? (\n <div role=\"rowgroup\" className=\"contents\" data-taco=\"table2-footer\">\n {table.getFooterGroups().map(footerGroup => (\n <div key={footerGroup.id} role=\"row\" className=\"contents\">\n {footerGroup.headers.map((footer, cellIndex) => (\n <Footer key={footer.id} footer={footer} index={cellIndex} scrolled={scrolled} table={table}>\n {footers[footer.id]\n ? footers[footer.id](rows.map((row: TRow<TType>) => row.original[footer.id]))\n : null}\n </Footer>\n ))}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n {!!_experimentalActionsForTable &&\n table.options.enableRowSelection &&\n (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) ? (\n <BatchActionsMenu<TType>\n className=\"fixed-center-x bottom-0 z-50 mb-4 print:hidden\"\n actionsForTable={_experimentalActionsForTable}\n summary={_experimentalActionsForTableSummary}\n table={table}\n />\n ) : null}\n </div>\n );\n}) as ForwardedTable2WithStatics;\n\nTable2.Column = Column;\nTable2.Toolbar = Toolbar;\n\nexport { Table2 };\nexport type { Table2Props };\nexport type { Table2ColumnProps, Table2ActionProps, Table2RowActionProps, Table2Settings, Table2ToolbarProps } from './types';\n"],"names":["Column","_","displayName","Toolbar","props","className","cn","React","Table2","forwardRef","ref","emptyState","EmptyState","expandedRowRenderer","length","data","loadMore","onRowClick","_experimentalActionsForTable","_experimentalActionsForTableSummary","tableRef","useMergedRef","timeoutIdRef","useRef","columns","toolbar","useSeparatedChildren","children","rows","table","footers","useTable","meta","options","columnVisibility","columnOrder","globalFilter","getState","useEffect","resetFocussableColumnIndexes","editMode","isEditing","clearTimeout","current","virtualiser","virtualiserOffsets","setExpandedRowSizes","useVirtualiser","gridTemplateColumns","useGridTemplate","editButtonRef","handleKeyDown","event","document","activeElement","key","preventDefault","ctrlKey","metaKey","setActiveRowIndex","scrollToOffset","moveToPreviousRow","nextIndex","scrollToIndex","totalSize","moveToNextRow","scrollTo","scrollHeight","canToggleRowExpansion","enableExpanding","activeRowIndex","toggleExpanded","original","enableRowSelection","toggleSelected","toggleAllRowsSelected","handleBlur","elementGainingFocus","relatedTarget","undefined","portalId","closest","id","currentTarget","querySelector","contains","setTimeout","parentRow","target","isNewFocussedElementInSameRow","shouldPauseSortingAndFiltering","setShouldPauseSortingAndFiltering","scrolled","setScrolled","useState","loadingRef","handleScroll","scrollLeft","scrollTop","clientHeight","isAllRowsSelected","getIsAllRowsSelected","handleMouseLeave","hoveredRowIndex","setHoveredRowIndex","enableSettingsButton","enablePinning","enableHiding","enableColumnReordering","hasInternalToolbar","enableEditMode","enableColumnFilters","enableRowDensity","enableGlobalFilter","hasToolbar","hasFooters","useMemo","summaryIds","Object","keys","visibleIds","filter","c","some","v","includes","Group","EditModeButton","FiltersButton","RowDensityButton","ColumnSettingsButton","Search","disabled","shouldDisableTableActions","onSearch","setGlobalFilter","value","ShortcutsGuideButton","onBlur","onKeyDown","onMouseLeave","onScroll","role","style","gridTemplateRows","opacity","tabIndex","getHeaderGroups","map","headerGroup","headers","header","columnIndex","Header","index","isLastColumn","top","height","virtualItems","virtualRow","row","Fragment","Row","rowIndex","getVisibleCells","cell","Cell","getValue","isLastRow","getIsExpanded","ExpandedRow","setSize","bottom","getFooterGroups","footerGroup","footer","cellIndex","Footer","getIsSomeRowsSelected","BatchActionsMenu","actionsForTable","summary"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8GA,SAASA,MAAM,CAAcC,CAA2B;EACpD,OAAO,IAAI;AACf;AACAD,MAAM,CAACE,WAAW,GAAG,cAAc;AA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B,KAAK,EAAEsB,SAAS;IAAEpF,QAAQ,EAAEA,QAAQ;IAAE/D,KAAK,EAAEA;KAChFC,OAAO,CAACiJ,MAAM,CAAC7F,EAAE,CAAC,GACbpD,OAAO,CAACiJ,MAAM,CAAC7F,EAAE,CAAC,CAACtD,IAAI,CAACwH,GAAG,CAAEY,GAAgB,IAAKA,GAAG,CAACxF,QAAQ,CAACuG,MAAM,CAAC7F,EAAE,CAAC,CAAC,CAAC,GAC3E,IAAI,CAEjB,CAAC,CAET,CAAC,CACA,GACN,IAAI,CACN,EACL,CAAC,CAAChE,4BAA4B,IAC/BW,KAAK,CAACI,OAAO,CAACwC,kBAAkB,KAC/B5C,KAAK,CAACqJ,qBAAqB,EAAE,IAAIrJ,KAAK,CAACwE,oBAAoB,EAAE,CAAC,gBAC3D9F,6BAAC4K,gBAAgB;IACb9K,SAAS,EAAC,gDAAgD;IAC1D+K,eAAe,EAAElK,4BAA4B;IAC7CmK,OAAO,EAAElK,mCAAmC;IAC5CU,KAAK,EAAEA;IACT,GACF,IAAI,CACN;AAEd,CAAC;AAEDrB,MAAM,CAACR,MAAM,GAAGA,MAAM;AACtBQ,MAAM,CAACL,OAAO,GAAGA,OAAO;;;;"}
@@ -70,7 +70,8 @@ const Cell = function Cell(props) {
70
70
  return (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.classList.remove('pb-4');
71
71
  };
72
72
  }, [isIndicatorVisible, isLastRow]);
73
- const className = cn('border-b', {
73
+ const className = cn({
74
+ 'border-b': !isLastRow,
74
75
  'sticky z-[1]': isPinned,
75
76
  // use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating
76
77
  'bg-white': !isActiveRow && !isSelected && !isHoveredRow,
@@ -1 +1 @@
1
- {"version":3,"file":"Cell.js","sources":["../../../../../../../../../src/components/Table2/components/column/Cell.tsx"],"sourcesContent":["import React, { RefObject } from 'react';\nimport cn from 'classnames';\nimport { flexRender, Cell as RTCell, Row as RTRow, Table as RTTable, TableMeta } from '@tanstack/react-table';\n\nimport { Input } from '../../../Input/Input';\nimport { ColumnBase, ColumnBaseProps } from './Base';\nimport { getCellAlignmentClasses, getCellSizingClasses, isKeyboardFocusableElement } from '../../utilities/cell';\nimport { isInternalColumn } from '../../utilities/columns';\nimport { Datepicker } from '../../../Datepicker/Datepicker';\nimport { Switch } from '../../../Switch/Switch';\nimport { SaveHandler, SaveHandlerErrorResponse, Table2Filter } from '../../types';\nimport { columnFilterFn, globalFilterFn } from '../../utilities/filterFn';\nimport { MOVE_DIR } from '../../hooks/useEditMode';\nimport { useRowContext } from '../row/Context';\nimport { Indicator, IndicatorReason } from './Indicator';\nimport { ValidationError } from './ValidationError';\nimport { hasChanged, willRowMoveAfterSorting } from './utils';\nimport { useMergedRef } from '../../../../hooks/useMergedRef';\n\ntype CellProps<TType = unknown> = Omit<ColumnBaseProps<TType>, 'column' | 'isEditing'> & {\n cell: RTCell<TType, unknown>;\n index: number;\n isLastRow: boolean;\n rowIndex: number;\n rows: RTRow<TType>[];\n scrollToIndex: (index: number, options?: any) => void;\n scrollToOffset: (index: number, options?: any) => void;\n tableRef: React.RefObject<HTMLDivElement>;\n};\n\nexport const Cell = function Cell<TType = unknown>(props: CellProps<TType>) {\n const { cell, index, isLastRow, rowIndex, rows, scrollToIndex, scrollToOffset, table, tableRef, ...columnProps } = props;\n const meta = table.options.meta as TableMeta<any>;\n\n const { addFocussableColumnIndex, focussableColumnIndexes: allFocussableColumnIndexes } = meta;\n\n const { validationErrors, rowMoveReason } = useRowContext();\n const hasValidationErrorsInRow = !!validationErrors;\n\n const internalRef = React.useRef<HTMLDivElement>(null);\n const controlRef = React.useRef<HTMLElement>(null);\n const disableTruncation = cell.column.columnDef.meta?.disableTruncation;\n const cellClassName = cell.column.columnDef.meta?.className;\n\n const isActiveRow = meta.activeRowIndex === rowIndex;\n const isHoveredRow = meta.hoveredRowIndex === rowIndex;\n const isPinned = !!cell.column.getIsPinned();\n const isDragging = meta.dragging[cell.row.id];\n const isSelected = cell.row.getIsSelected();\n const isDataColumn = !isInternalColumn(cell.column.id);\n const hasCellControl = !!cell.column.columnDef.meta?.control;\n const allVisibleColumns = table.getVisibleLeafColumns();\n const lastColumnIndex = allVisibleColumns.length > 0 ? allVisibleColumns.length - 1 : 0;\n\n // editing\n const isEditingThisRow = meta.editMode.isEditing && isActiveRow;\n const canEditThisCell = isEditingThisRow && isDataColumn;\n const isEditingThisCell = canEditThisCell && meta.editMode.columnIndex === index;\n const isHoveringThisRowWhileEditing = meta.editMode.isEditing && isHoveredRow;\n\n const isIndicatorVisible = Object.keys(rowMoveReason).length > 0;\n\n React.useEffect(() => {\n // Adds padding to the table so that indicator doesn't get cropped\n if (isIndicatorVisible && isLastRow) {\n tableRef.current?.classList.add('pb-4');\n }\n\n return () => tableRef.current?.classList.remove('pb-4');\n }, [isIndicatorVisible, isLastRow]);\n\n const className = cn(\n 'border-b',\n {\n 'sticky z-[1]': isPinned,\n // use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating\n 'bg-white': !isActiveRow && !isSelected && !isHoveredRow,\n 'bg-grey-100': !isActiveRow && !isSelected && isHoveredRow,\n 'bg-grey-200 group-hover/row:bg-grey-200': isActiveRow && !isSelected,\n 'bg-blue-100': isSelected,\n '!wcag-blue-500': isDragging,\n '[&>*]:!grayscale [&_.bg-white]:!bg-grey-100': !isEditingThisRow && isHoveringThisRowWhileEditing,\n '!bg-red-100': hasValidationErrorsInRow,\n 'z-[1]': isPinned && isActiveRow,\n // First column should have higher z-index so that row indicator always show on top of the cell\n // control components.\n 'z-[2]': isPinned && isActiveRow && index === 0,\n 'border-blue !border-y-2 border-x-0': isIndicatorVisible,\n 'border-l-2 rounded-l': isIndicatorVisible && index === 0,\n 'border-r-2 rounded-r': isIndicatorVisible && index === lastColumnIndex,\n },\n getCellSizingClasses(\n table.options.meta?.rowDensity,\n (isEditingThisRow || isHoveringThisRowWhileEditing) && hasCellControl\n ),\n typeof cellClassName === 'function' ? cellClassName(cell.row) : cellClassName\n );\n\n const handleMouseDown = (event: React.MouseEvent<HTMLElement>) => {\n // only detect left clicks\n if (event.button === 0) {\n const activeElement = document.activeElement;\n const isActiveElementControl = activeElement?.closest('[role=\"cell\"]');\n const hasActiveRowChanged = meta.activeRowIndex !== rowIndex;\n\n // When user clicks on a cell that is not in the active row, for some reason blur event is not called on the cell\n // previous cell control element so we need to manually call it in order to save the changes in that cell\n if (isActiveElementControl && hasActiveRowChanged) {\n (activeElement as HTMLElement).blur();\n }\n\n meta.setActiveRowIndex(rowIndex);\n\n if (meta.editMode.isEditing) {\n if (allFocussableColumnIndexes.includes(index)) {\n meta.editMode.setColumn(index);\n } else {\n meta.editMode.setColumn(allFocussableColumnIndexes[0]);\n }\n }\n }\n };\n\n const attributes = {\n ...columnProps,\n // base props,\n column: cell.column,\n table,\n // dom attributes\n className,\n 'data-column-index': index,\n 'data-row-index': rowIndex,\n onMouseDown: handleMouseDown,\n ref: internalRef,\n role: 'cell',\n };\n\n const [detailModeEditing, setDetailModeEditing] = React.useState(false);\n\n const detailModeClassName = cn({\n '!shadow-[0_0_0_4px_rgba(0,99,255,0.25)]': detailModeEditing,\n });\n\n // reset the editing state when we move column\n React.useEffect(() => {\n if (meta.editMode.columnIndex !== index) {\n setDetailModeEditing(false);\n }\n }, [meta.editMode.columnIndex]);\n\n React.useEffect(() => {\n if (isEditingThisRow && controlRef.current && isKeyboardFocusableElement(controlRef.current)) {\n addFocussableColumnIndex(index);\n }\n }, [isEditingThisRow, allFocussableColumnIndexes, addFocussableColumnIndex, index]);\n\n const moveRow = (moveDirection: MOVE_DIR) => {\n if (moveDirection === MOVE_DIR.PREV) {\n meta.moveToPreviousRow(rows, nextIndex => scrollToIndex(nextIndex - 1));\n } else if (moveDirection === MOVE_DIR.NEXT) {\n meta.moveToNextRow(rows, nextIndex => scrollToIndex(nextIndex + 2));\n }\n };\n\n if (meta.editMode.onSave && hasCellControl && (canEditThisCell || (isHoveringThisRowWhileEditing && isDataColumn))) {\n attributes.onMouseDown = event => {\n handleMouseDown(event);\n\n const target = event.target;\n const isTargetInput = target !== null && (target as HTMLElement).nodeName === 'INPUT';\n\n // event.target?.select is only truthy for input elements\n // if event.target is active element, then that means we should select the text\n if (isTargetInput && target !== document.activeElement) {\n event.preventDefault();\n\n setTimeout(() => {\n (target as HTMLInputElement).select();\n }, 1);\n } else if (isTargetInput && target === document.activeElement) {\n // if user left clicks on the input then we are into edit mode\n // only detect left clicks\n if (event.button === 0) {\n setDetailModeEditing(true);\n }\n }\n };\n\n if (canEditThisCell) {\n const firstDataColumnIndex = allFocussableColumnIndexes.at(0) ?? 0;\n const lastDataColumnIndex = allFocussableColumnIndexes.at(-1) ?? 0;\n\n attributes.onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const control = event.target as HTMLElement;\n const isControlInput =\n control.nodeName === 'INPUT' && control?.getAttribute('data-inline-editing-component') === 'true';\n\n // For some reason, Taco Input keyboard event always return true when \"event.isDefaultPrevented()\" is\n // called. So we need to check if the control is input or not so that we don't return early.\n if (!isControlInput && (event.isDefaultPrevented() || event.isPropagationStopped())) {\n return;\n }\n\n if (control.tagName === 'INPUT') {\n if (event.key === 'Enter') {\n event.preventDefault();\n const input = control as HTMLInputElement;\n\n if (!detailModeEditing) {\n input.setSelectionRange?.(input.value?.length, input.value?.length);\n setDetailModeEditing(true);\n }\n\n return;\n }\n }\n\n // Don't exit edit mode if the target of the escape isn't a child of the cell (e.g. if its a popover).\n if (event.key === 'Escape' && event.currentTarget.contains(control)) {\n event.preventDefault();\n const input = control as HTMLInputElement;\n\n if (detailModeEditing) {\n input?.select?.();\n setDetailModeEditing(false);\n } else {\n meta.editMode.toggleEditing(false);\n tableRef.current?.focus();\n }\n\n return;\n }\n\n if ((!detailModeEditing && event.key === 'ArrowLeft') || (event.key === 'Tab' && event.shiftKey)) {\n event.preventDefault();\n\n const isFirstRow = rowIndex === 0;\n const isFirstColumn = index === firstDataColumnIndex;\n\n if (event.ctrlKey || event.metaKey) {\n // If the current active column is the first column then we don't do any thing so that focus\n // remains on the first column.\n if (!isFirstColumn) {\n control.blur();\n meta.editMode.moveToFirstColumn(allFocussableColumnIndexes);\n }\n } else {\n // If it is first row and first column, then don't move column.\n if (!isFirstRow || !isFirstColumn) {\n control.blur();\n meta.editMode.moveToPreviousColumn(allFocussableColumnIndexes, moveRow);\n }\n }\n\n return;\n }\n\n if ((!detailModeEditing && event.key === 'ArrowRight') || (event.key === 'Tab' && !event.shiftKey)) {\n event.preventDefault();\n\n const isLastColumn = index === lastDataColumnIndex;\n\n if (event.ctrlKey || event.metaKey) {\n // If the current active column is the last column then we don't do any thing so that focus\n // remains on the last column.\n if (!isLastColumn) {\n control.blur();\n meta.editMode.moveToLastColumn(allFocussableColumnIndexes);\n }\n } else {\n // If it is last row and last column, then don't move column.\n if (!isLastRow || !isLastColumn) {\n control.blur();\n meta.editMode.moveToNextColumn(allFocussableColumnIndexes, moveRow);\n }\n }\n\n return;\n }\n\n if (!detailModeEditing && event.key === 'ArrowUp') {\n event.preventDefault();\n\n // if it is the first row then return early, so that focus on the cell is not lost\n if (rowIndex === 0) {\n return;\n }\n\n control.blur();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(0);\n\n scrollToOffset(0);\n } else {\n moveRow(MOVE_DIR.PREV);\n }\n\n meta.setHoveredRowIndex(undefined);\n return;\n }\n\n if (!detailModeEditing && event.key === 'ArrowDown') {\n event.preventDefault();\n\n // if it is the last row then return early, so that focus on the cell is not lost\n if (rowIndex === rows.length - 1) {\n return;\n }\n\n control.blur();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(rows.length - 1);\n scrollToIndex(rows.length + 20);\n } else {\n moveRow(MOVE_DIR.NEXT);\n }\n\n meta.setHoveredRowIndex(undefined);\n return;\n }\n };\n }\n\n return (\n <ColumnBase {...attributes}>\n <EditingCell\n detailModeClassName={detailModeClassName}\n cell={cell}\n cellRef={internalRef}\n columnIndex={index}\n isEditingThisCell={isEditingThisCell}\n onSave={meta.editMode.onSave}\n rowIndex={rowIndex}\n table={table}\n ref={controlRef}\n rowValues={rows[rowIndex].original}\n rowsLength={rows.length}\n />\n </ColumnBase>\n );\n } else {\n if (meta.onRowClick) {\n attributes.onClick = event => {\n if (event.target !== internalRef.current) {\n return;\n }\n\n meta.onRowClick?.(cell.row.original);\n };\n }\n }\n\n return (\n <ColumnBase {...attributes}>\n <div className={disableTruncation ? '-my-[0.45rem]' : 'truncate'}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </div>\n </ColumnBase>\n );\n};\n\ntype EditingCellProps = {\n cell: RTCell<any, unknown>;\n cellRef: React.RefObject<HTMLDivElement>;\n columnIndex: number;\n isEditingThisCell: boolean;\n onSave: SaveHandler<any>;\n rowIndex: number;\n table: RTTable<any>;\n rowValues: Record<string, any>;\n rowsLength: number;\n detailModeClassName?: string;\n};\n\nconst EditingCell = React.memo(\n React.forwardRef<HTMLElement, EditingCellProps>((props, ref) => {\n const {\n cell,\n cellRef,\n columnIndex,\n detailModeClassName,\n isEditingThisCell = false,\n onSave: handleSave,\n rowIndex,\n rowValues,\n table,\n } = props;\n const { validationErrors, setValidationErrors, rowMoveReason, setRowMoveReason } = useRowContext();\n\n const controlRef = useMergedRef(ref);\n const cellId = cell.column.id;\n const cellValidationError = validationErrors?.[cellId];\n\n const value = cell.getValue();\n const ariaLabel = cell.column.columnDef.header as string | undefined;\n const meta = table.options.meta as TableMeta<any>;\n const { globalFilter } = table.getState();\n\n const [state, setState] = React.useState(value);\n\n const isHoveringAnotherRowWhileEditing =\n meta.editMode.isEditing && meta.activeRowIndex !== rowIndex && meta.hoveredRowIndex === rowIndex;\n const 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\n // It is important that we let consumers pass a newValue as an argument because when setState is called before\n // onBlur then saveIfChanged method gets the stale state value. This happens because the rerender hasn't happened\n // before the saveIfChanged method is called.\n const saveIfChanged = async (eventOrNewValue?: any) => {\n let newValue = state;\n\n // if eventOrNewValue is not an event object\n if (!eventOrNewValue.target) {\n newValue = eventOrNewValue;\n }\n\n if (hasChanged(value, newValue)) {\n try {\n const updatedRow = { ...cell.row.original, [cellId]: newValue };\n\n await handleSave(updatedRow, cellId);\n\n // If sorting is paused then update the last sorted or filtered rows to store the newly updated row\n if (meta.shouldPauseSortingAndFiltering) {\n meta.lastSortedOrFilteredRows.current = meta.lastSortedOrFilteredRows.current.map(row => {\n if (row.id === cell.row.id) {\n row.original = updatedRow;\n }\n\n return row;\n });\n }\n\n // Reset error if save was successful\n setValidationErrors(null);\n } catch (error) {\n setValidationErrors({ ...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 // make sure the cell becomes active if the field is focused\n const handleFocus = event => {\n meta.editMode.setColumn(columnIndex);\n\n if (event.target?.select) {\n event.target?.select();\n }\n };\n\n React.useEffect(() => {\n if (hasChanged(initialValue.current, state)) {\n showIndicator();\n } else {\n hideIndicator();\n }\n\n return hideIndicator;\n }, [state]);\n\n const showIndicator = () => {\n let willRowMoveReason: IndicatorReason | null = null;\n\n const isFilteredByGlobalFilter = Object.values<unknown>({ ...rowValues, [cellId]: state }).some(cellValue =>\n // Global filter can be undefined when there is no text being searched so we pass an empty string to\n // globalFilterFn as query in that case.\n globalFilterFn(String(cellValue), globalFilter ? String(globalFilter) : '')\n );\n\n if (!isFilteredByGlobalFilter) {\n willRowMoveReason = IndicatorReason.SEARCH;\n } else if (cell.column.getIsFiltered() && !columnFilterFn(state, cell.column.getFilterValue() as Table2Filter)) {\n willRowMoveReason = IndicatorReason.FILTER;\n } else if (\n !willRowMoveReason &&\n cell.column.getIsSorted() &&\n willRowMoveAfterSorting(\n state,\n cell,\n rowIndex,\n table.getRowModel().rows,\n !!table.getState().sorting.find(s => s.id === cell.column.id)?.desc\n )\n ) {\n willRowMoveReason = IndicatorReason.SORTING;\n }\n\n if (willRowMoveReason !== null) {\n meta.setShouldPauseSortingAndFiltering(true);\n setRowMoveReason({ [cellId]: willRowMoveReason });\n }\n };\n\n const hideIndicator = () => {\n setRowMoveReason(prevState => {\n const newState = { ...prevState };\n delete newState[cellId];\n\n return newState;\n });\n };\n\n const cellControl = cell.column.columnDef.meta?.control;\n\n const attributes = {\n 'aria-label': ariaLabel,\n onBlur: saveIfChanged,\n onFocus: handleFocus,\n ref,\n // This is a temporary fix to enable up/down arrow key shortcuts on input in quick mode. For some reason,\n // the preventDefault is true on Taco Input, so the keyboard shortcuts doesn't work. By adding this\n // data attribute we make sure the event is coming from a control component, and then we can make sure\n // keyboard shortcut works as expected.\n 'data-inline-editing-component': 'true',\n };\n\n const className = cn(getCellAlignmentClasses(cell.column.columnDef.meta?.align));\n const indicatorMountNode = cellRef.current?.parentElement?.querySelector(':first-child') as Element | null;\n\n let controlComponent;\n\n if (cellControl) {\n if (typeof cellControl === 'function') {\n controlComponent = cellControl(\n {\n invalid: hasValidationError,\n onBlur: saveIfChanged,\n onFocus: handleFocus,\n ref: controlRef,\n setValue: setState,\n value: state,\n 'data-inline-editing-component': 'true',\n className: detailModeClassName,\n },\n cell.row.original\n );\n } else {\n switch (cellControl) {\n case 'datepicker':\n controlComponent = (\n <Datepicker\n {...attributes}\n className={detailModeClassName}\n 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', 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 />\n );\n break;\n }\n }\n }\n\n const indicatorReason = rowMoveReason[cellId] ?? null;\n\n return (\n <>\n {indicatorReason !== null && (\n <Indicator\n reason={indicatorReason}\n columnName={String(cell.column.columnDef.header)}\n mountNode={indicatorMountNode}\n />\n )}\n <span className=\"relative flex-grow\">\n {controlComponent}\n {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","validationErrors","rowMoveReason","useRowContext","hasValidationErrorsInRow","internalRef","React","useRef","controlRef","disableTruncation","column","columnDef","cellClassName","className","isActiveRow","activeRowIndex","isHoveredRow","hoveredRowIndex","isPinned","getIsPinned","isDragging","dragging","row","id","isSelected","getIsSelected","isDataColumn","isInternalColumn","hasCellControl","control","allVisibleColumns","getVisibleLeafColumns","lastColumnIndex","length","isEditingThisRow","editMode","isEditing","canEditThisCell","isEditingThisCell","columnIndex","isHoveringThisRowWhileEditing","isIndicatorVisible","Object","keys","useEffect","current","classList","add","remove","cn","getCellSizingClasses","rowDensity","handleMouseDown","event","button","activeElement","document","isActiveElementControl","closest","hasActiveRowChanged","blur","setActiveRowIndex","includes","setColumn","attributes","onMouseDown","ref","role","detailModeEditing","setDetailModeEditing","useState","detailModeClassName","isKeyboardFocusableElement","moveRow","moveDirection","MOVE_DIR","PREV","moveToPreviousRow","nextIndex","NEXT","moveToNextRow","onSave","target","isTargetInput","nodeName","preventDefault","setTimeout","select","firstDataColumnIndex","at","lastDataColumnIndex","onKeyDown","isControlInput","getAttribute","isDefaultPrevented","isPropagationStopped","tagName","key","input","setSelectionRange","value","currentTarget","contains","toggleEditing","focus","shiftKey","isFirstRow","isFirstColumn","ctrlKey","metaKey","moveToFirstColumn","moveToPreviousColumn","isLastColumn","moveToLastColumn","moveToNextColumn","setHoveredRowIndex","undefined","ColumnBase","EditingCell","cellRef","rowValues","original","rowsLength","onRowClick","onClick","flexRender","getContext","memo","forwardRef","handleSave","setValidationErrors","setRowMoveReason","useMergedRef","cellId","cellValidationError","getValue","ariaLabel","header","globalFilter","getState","state","setState","isHoveringAnotherRowWhileEditing","hasValidationError","initialValue","saveIfChanged","eventOrNewValue","newValue","hasChanged","updatedRow","shouldPauseSortingAndFiltering","lastSortedOrFilteredRows","map","error","isFocusInsideTable","isBodyFocussed","body","handleFocus","showIndicator","hideIndicator","willRowMoveReason","isFilteredByGlobalFilter","values","some","cellValue","globalFilterFn","String","IndicatorReason","SEARCH","getIsFiltered","columnFilterFn","getFilterValue","FILTER","getIsSorted","willRowMoveAfterSorting","getRowModel","sorting","find","s","desc","SORTING","setShouldPauseSortingAndFiltering","prevState","newState","cellControl","onBlur","onFocus","getCellAlignmentClasses","align","indicatorMountNode","parentElement","querySelector","controlComponent","invalid","setValue","Datepicker","newDate","detail","onChange","Switch","checked","Boolean","Input","indicatorReason","Indicator","reason","columnName","mountNode","ValidationError"],"mappings":";;;;;;;;;;;;;;;;;;MA8BaA,IAAI,GAAG,SAASA,IAAI,CAAkBC,KAAuB;;EACtE,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC,SAAS;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,aAAa;IAAEC,cAAc;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;GAAa,GAAGV,KAAK;EACxH,MAAMW,IAAI,GAAGH,KA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UAAyC;YAC9C4F,KAAK,EAAEwC;aAEd;UACD;QAEJ,KAAK,QAAQ;UACToD,gBAAgB,gBACZ1L,6BAACiM,MAAM,oBACCvI,UAAU;YACdnD,SAAS,EAAEoC,EAAE,CAAC,MAAM,EAAEsB,mBAAmB,CAAC;YAC1CiI,OAAO,EAAEC,OAAO,CAAC7D,KAAK,CAAC;YACvB0D,QAAQ,EAAEzD,QAAQ;YAClB3E,GAAG,EAAE1D;aAEZ;UACD;QACJ;UACIwL,gBAAgB,gBACZ1L,6BAACoM,KAAK,oBACE1I,UAAU;YACdnD,SAAS,EAAEoC,EAAE,CAACpC,SAAS,EAAE0D,mBAAmB,CAAC;YAC7C0H,OAAO,EAAElD,kBAAkB;YAC3BuD,QAAQ,EAAEjJ,KAAK;cACXwF,QAAQ,CAACxF,KAAK,CAAC6B,MAAM,CAACkB,KAAK,CAAC;aAC/B;YACDlC,GAAG,EAAE1D,UAAyC;YAC9C4F,KAAK,EAAEkE,MAAM,CAAC1B,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE;aAEhC;UACD;;;;EAKhB,MAAM+D,eAAe,4BAAGzM,aAAa,CAACmI,MAAM,CAAC,yEAAI,IAAI;EAErD,oBACI/H,4DACKqM,eAAe,KAAK,IAAI,iBACrBrM,6BAACsM,SAAS;IACNC,MAAM,EAAEF,eAAe;IACvBG,UAAU,EAAExC,MAAM,CAACpL,IAAI,CAACwB,MAAM,CAACC,SAAS,CAAC8H,MAAM,CAAC;IAChDsE,SAAS,EAAElB;IAElB,eACDvL;IAAMO,SAAS,EAAC;KACXmL,gBAAgB,EAChBjD,kBAAkB,iBAAIzI,6BAAC0M,eAAe,QAAE1C,MAAM,CAAChC,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';\n\nimport { Input } from '../../../Input/Input';\nimport { ColumnBase, ColumnBaseProps } from './Base';\nimport { getCellAlignmentClasses, getCellSizingClasses, isKeyboardFocusableElement } from '../../utilities/cell';\nimport { isInternalColumn } from '../../utilities/columns';\nimport { Datepicker } from '../../../Datepicker/Datepicker';\nimport { Switch } from '../../../Switch/Switch';\nimport { SaveHandler, SaveHandlerErrorResponse, Table2Filter } from '../../types';\nimport { columnFilterFn, globalFilterFn } from '../../utilities/filterFn';\nimport { MOVE_DIR } from '../../hooks/useEditMode';\nimport { useRowContext } from '../row/Context';\nimport { Indicator, IndicatorReason } from './Indicator';\nimport { ValidationError } from './ValidationError';\nimport { hasChanged, willRowMoveAfterSorting } from './utils';\nimport { useMergedRef } from '../../../../hooks/useMergedRef';\n\ntype CellProps<TType = unknown> = Omit<ColumnBaseProps<TType>, 'column' | 'isEditing'> & {\n cell: RTCell<TType, unknown>;\n index: number;\n isLastRow: boolean;\n rowIndex: number;\n rows: RTRow<TType>[];\n scrollToIndex: (index: number, options?: any) => void;\n scrollToOffset: (index: number, options?: any) => void;\n tableRef: React.RefObject<HTMLDivElement>;\n};\n\nexport const Cell = function Cell<TType = unknown>(props: CellProps<TType>) {\n const { cell, index, isLastRow, rowIndex, rows, scrollToIndex, scrollToOffset, table, tableRef, ...columnProps } = props;\n const meta = table.options.meta as TableMeta<any>;\n\n const { addFocussableColumnIndex, focussableColumnIndexes: allFocussableColumnIndexes } = meta;\n\n const { validationErrors, rowMoveReason } = useRowContext();\n const hasValidationErrorsInRow = !!validationErrors;\n\n const internalRef = React.useRef<HTMLDivElement>(null);\n const controlRef = React.useRef<HTMLElement>(null);\n const disableTruncation = cell.column.columnDef.meta?.disableTruncation;\n const cellClassName = cell.column.columnDef.meta?.className;\n\n const isActiveRow = meta.activeRowIndex === rowIndex;\n const isHoveredRow = meta.hoveredRowIndex === rowIndex;\n const isPinned = !!cell.column.getIsPinned();\n const isDragging = meta.dragging[cell.row.id];\n const isSelected = cell.row.getIsSelected();\n const isDataColumn = !isInternalColumn(cell.column.id);\n const hasCellControl = !!cell.column.columnDef.meta?.control;\n const allVisibleColumns = table.getVisibleLeafColumns();\n const lastColumnIndex = allVisibleColumns.length > 0 ? allVisibleColumns.length - 1 : 0;\n\n // editing\n const isEditingThisRow = meta.editMode.isEditing && isActiveRow;\n const canEditThisCell = isEditingThisRow && isDataColumn;\n const isEditingThisCell = canEditThisCell && meta.editMode.columnIndex === index;\n const isHoveringThisRowWhileEditing = meta.editMode.isEditing && isHoveredRow;\n\n const isIndicatorVisible = Object.keys(rowMoveReason).length > 0;\n\n React.useEffect(() => {\n // Adds padding to the table so that indicator doesn't get cropped\n if (isIndicatorVisible && isLastRow) {\n tableRef.current?.classList.add('pb-4');\n }\n\n return () => tableRef.current?.classList.remove('pb-4');\n }, [isIndicatorVisible, isLastRow]);\n\n const className = cn(\n {\n 'border-b': !isLastRow,\n 'sticky z-[1]': isPinned,\n // use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating\n 'bg-white': !isActiveRow && !isSelected && !isHoveredRow,\n 'bg-grey-100': !isActiveRow && !isSelected && isHoveredRow,\n 'bg-grey-200 group-hover/row:bg-grey-200': isActiveRow && !isSelected,\n 'bg-blue-100': isSelected,\n '!wcag-blue-500': isDragging,\n '[&>*]:!grayscale [&_.bg-white]:!bg-grey-100': !isEditingThisRow && isHoveringThisRowWhileEditing,\n '!bg-red-100': hasValidationErrorsInRow,\n 'z-[1]': isPinned && isActiveRow,\n // First column should have higher z-index so that row indicator always show on top of the cell\n // control components.\n 'z-[2]': isPinned && isActiveRow && index === 0,\n 'border-blue !border-y-2 border-x-0': isIndicatorVisible,\n 'border-l-2 rounded-l': isIndicatorVisible && index === 0,\n 'border-r-2 rounded-r': isIndicatorVisible && index === lastColumnIndex,\n },\n getCellSizingClasses(\n table.options.meta?.rowDensity,\n (isEditingThisRow || isHoveringThisRowWhileEditing) && hasCellControl\n ),\n typeof cellClassName === 'function' ? cellClassName(cell.row) : cellClassName\n );\n\n const handleMouseDown = (event: React.MouseEvent<HTMLElement>) => {\n // only detect left clicks\n if (event.button === 0) {\n const activeElement = document.activeElement;\n const isActiveElementControl = activeElement?.closest('[role=\"cell\"]');\n const hasActiveRowChanged = meta.activeRowIndex !== rowIndex;\n\n // When user clicks on a cell that is not in the active row, for some reason blur event is not called on the cell\n // previous cell control element so we need to manually call it in order to save the changes in that cell\n if (isActiveElementControl && hasActiveRowChanged) {\n (activeElement as HTMLElement).blur();\n }\n\n meta.setActiveRowIndex(rowIndex);\n\n if (meta.editMode.isEditing) {\n if (allFocussableColumnIndexes.includes(index)) {\n meta.editMode.setColumn(index);\n } else {\n meta.editMode.setColumn(allFocussableColumnIndexes[0]);\n }\n }\n }\n };\n\n const attributes = {\n ...columnProps,\n // base props,\n column: cell.column,\n table,\n // dom attributes\n className,\n 'data-column-index': index,\n 'data-row-index': rowIndex,\n onMouseDown: handleMouseDown,\n ref: internalRef,\n role: 'cell',\n };\n\n const [detailModeEditing, setDetailModeEditing] = React.useState(false);\n\n const detailModeClassName = cn({\n '!shadow-[0_0_0_4px_rgba(0,99,255,0.25)]': detailModeEditing,\n });\n\n // reset the editing state when we move column\n React.useEffect(() => {\n if (meta.editMode.columnIndex !== index) {\n setDetailModeEditing(false);\n }\n }, [meta.editMode.columnIndex]);\n\n React.useEffect(() => {\n if (isEditingThisRow && controlRef.current && isKeyboardFocusableElement(controlRef.current)) {\n addFocussableColumnIndex(index);\n }\n }, [isEditingThisRow, allFocussableColumnIndexes, addFocussableColumnIndex, index]);\n\n const moveRow = (moveDirection: MOVE_DIR) => {\n if (moveDirection === MOVE_DIR.PREV) {\n meta.moveToPreviousRow(rows, nextIndex => scrollToIndex(nextIndex - 1));\n } else if (moveDirection === MOVE_DIR.NEXT) {\n meta.moveToNextRow(rows, nextIndex => scrollToIndex(nextIndex + 2));\n }\n };\n\n if (meta.editMode.onSave && hasCellControl && (canEditThisCell || (isHoveringThisRowWhileEditing && isDataColumn))) {\n attributes.onMouseDown = event => {\n handleMouseDown(event);\n\n const target = event.target;\n const isTargetInput = target !== null && (target as HTMLElement).nodeName === 'INPUT';\n\n // event.target?.select is only truthy for input elements\n // if event.target is active element, then that means we should select the text\n if (isTargetInput && target !== document.activeElement) {\n event.preventDefault();\n\n setTimeout(() => {\n (target as HTMLInputElement).select();\n }, 1);\n } else if (isTargetInput && target === document.activeElement) {\n // if user left clicks on the input then we are into edit mode\n // only detect left clicks\n if (event.button === 0) {\n setDetailModeEditing(true);\n }\n }\n };\n\n if (canEditThisCell) {\n const firstDataColumnIndex = allFocussableColumnIndexes.at(0) ?? 0;\n const lastDataColumnIndex = allFocussableColumnIndexes.at(-1) ?? 0;\n\n attributes.onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const control = event.target as HTMLElement;\n const isControlInput =\n control.nodeName === 'INPUT' && control?.getAttribute('data-inline-editing-component') === 'true';\n\n // For some reason, Taco Input keyboard event always return true when \"event.isDefaultPrevented()\" is\n // called. So we need to check if the control is input or not so that we don't return early.\n if (!isControlInput && (event.isDefaultPrevented() || event.isPropagationStopped())) {\n return;\n }\n\n if (control.tagName === 'INPUT') {\n if (event.key === 'Enter') {\n event.preventDefault();\n const input = control as HTMLInputElement;\n\n if (!detailModeEditing) {\n input.setSelectionRange?.(input.value?.length, input.value?.length);\n setDetailModeEditing(true);\n }\n\n return;\n }\n }\n\n // Don't exit edit mode if the target of the escape isn't a child of the cell (e.g. if its a popover).\n if (event.key === 'Escape' && event.currentTarget.contains(control)) {\n event.preventDefault();\n const input = control as HTMLInputElement;\n\n if (detailModeEditing) {\n input?.select?.();\n setDetailModeEditing(false);\n } else {\n meta.editMode.toggleEditing(false);\n tableRef.current?.focus();\n }\n\n return;\n }\n\n if ((!detailModeEditing && event.key === 'ArrowLeft') || (event.key === 'Tab' && event.shiftKey)) {\n event.preventDefault();\n\n const isFirstRow = rowIndex === 0;\n const isFirstColumn = index === firstDataColumnIndex;\n\n if (event.ctrlKey || event.metaKey) {\n // If the current active column is the first column then we don't do any thing so that focus\n // remains on the first column.\n if (!isFirstColumn) {\n control.blur();\n meta.editMode.moveToFirstColumn(allFocussableColumnIndexes);\n }\n } else {\n // If it is first row and first column, then don't move column.\n if (!isFirstRow || !isFirstColumn) {\n control.blur();\n meta.editMode.moveToPreviousColumn(allFocussableColumnIndexes, moveRow);\n }\n }\n\n return;\n }\n\n if ((!detailModeEditing && event.key === 'ArrowRight') || (event.key === 'Tab' && !event.shiftKey)) {\n event.preventDefault();\n\n const isLastColumn = index === lastDataColumnIndex;\n\n if (event.ctrlKey || event.metaKey) {\n // If the current active column is the last column then we don't do any thing so that focus\n // remains on the last column.\n if (!isLastColumn) {\n control.blur();\n meta.editMode.moveToLastColumn(allFocussableColumnIndexes);\n }\n } else {\n // If it is last row and last column, then don't move column.\n if (!isLastRow || !isLastColumn) {\n control.blur();\n meta.editMode.moveToNextColumn(allFocussableColumnIndexes, moveRow);\n }\n }\n\n return;\n }\n\n if (!detailModeEditing && event.key === 'ArrowUp') {\n event.preventDefault();\n\n // if it is the first row then return early, so that focus on the cell is not lost\n if (rowIndex === 0) {\n return;\n }\n\n control.blur();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(0);\n\n scrollToOffset(0);\n } else {\n moveRow(MOVE_DIR.PREV);\n }\n\n meta.setHoveredRowIndex(undefined);\n return;\n }\n\n if (!detailModeEditing && event.key === 'ArrowDown') {\n event.preventDefault();\n\n // if it is the last row then return early, so that focus on the cell is not lost\n if (rowIndex === rows.length - 1) {\n return;\n }\n\n control.blur();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(rows.length - 1);\n scrollToIndex(rows.length + 20);\n } else {\n moveRow(MOVE_DIR.NEXT);\n }\n\n meta.setHoveredRowIndex(undefined);\n return;\n }\n };\n }\n\n return (\n <ColumnBase {...attributes}>\n <EditingCell\n detailModeClassName={detailModeClassName}\n cell={cell}\n cellRef={internalRef}\n columnIndex={index}\n isEditingThisCell={isEditingThisCell}\n onSave={meta.editMode.onSave}\n rowIndex={rowIndex}\n table={table}\n ref={controlRef}\n rowValues={rows[rowIndex].original}\n rowsLength={rows.length}\n />\n </ColumnBase>\n );\n } else {\n if (meta.onRowClick) {\n attributes.onClick = event => {\n if (event.target !== internalRef.current) {\n return;\n }\n\n meta.onRowClick?.(cell.row.original);\n };\n }\n }\n\n return (\n <ColumnBase {...attributes}>\n <div className={disableTruncation ? '-my-[0.45rem]' : 'truncate'}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </div>\n </ColumnBase>\n );\n};\n\ntype EditingCellProps = {\n cell: RTCell<any, unknown>;\n cellRef: React.RefObject<HTMLDivElement>;\n columnIndex: number;\n isEditingThisCell: boolean;\n onSave: SaveHandler<any>;\n rowIndex: number;\n table: RTTable<any>;\n rowValues: Record<string, any>;\n rowsLength: number;\n detailModeClassName?: string;\n};\n\nconst EditingCell = React.memo(\n React.forwardRef<HTMLElement, EditingCellProps>((props, ref) => {\n const {\n cell,\n cellRef,\n columnIndex,\n detailModeClassName,\n isEditingThisCell = false,\n onSave: handleSave,\n rowIndex,\n rowValues,\n table,\n } = props;\n const { validationErrors, setValidationErrors, rowMoveReason, setRowMoveReason } = useRowContext();\n\n const controlRef = useMergedRef(ref);\n const cellId = cell.column.id;\n const cellValidationError = validationErrors?.[cellId];\n\n const value = cell.getValue();\n const ariaLabel = cell.column.columnDef.header as string | undefined;\n const meta = table.options.meta as TableMeta<any>;\n const { globalFilter } = table.getState();\n\n const [state, setState] = React.useState(value);\n\n const isHoveringAnotherRowWhileEditing =\n meta.editMode.isEditing && meta.activeRowIndex !== rowIndex && meta.hoveredRowIndex === rowIndex;\n const 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\n // It is important that we let consumers pass a newValue as an argument because when setState is called before\n // onBlur then saveIfChanged method gets the stale state value. This happens because the rerender hasn't happened\n // before the saveIfChanged method is called.\n const saveIfChanged = async (eventOrNewValue?: any) => {\n let newValue = state;\n\n // if eventOrNewValue is not an event object\n if (!eventOrNewValue.target) {\n newValue = eventOrNewValue;\n }\n\n if (hasChanged(value, newValue)) {\n try {\n const updatedRow = { ...cell.row.original, [cellId]: newValue };\n\n await handleSave(updatedRow, cellId);\n\n // If sorting is paused then update the last sorted or filtered rows to store the newly updated row\n if (meta.shouldPauseSortingAndFiltering) {\n meta.lastSortedOrFilteredRows.current = meta.lastSortedOrFilteredRows.current.map(row => {\n if (row.id === cell.row.id) {\n row.original = updatedRow;\n }\n\n return row;\n });\n }\n\n // Reset error if save was successful\n setValidationErrors(null);\n } catch (error) {\n setValidationErrors({ ...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 // make sure the cell becomes active if the field is focused\n const handleFocus = event => {\n meta.editMode.setColumn(columnIndex);\n\n if (event.target?.select) {\n event.target?.select();\n }\n };\n\n React.useEffect(() => {\n if (hasChanged(initialValue.current, state)) {\n showIndicator();\n } else {\n hideIndicator();\n }\n\n return hideIndicator;\n }, [state]);\n\n const showIndicator = () => {\n let willRowMoveReason: IndicatorReason | null = null;\n\n const isFilteredByGlobalFilter = Object.values<unknown>({ ...rowValues, [cellId]: state }).some(cellValue =>\n // Global filter can be undefined when there is no text being searched so we pass an empty string to\n // globalFilterFn as query in that case.\n globalFilterFn(String(cellValue), globalFilter ? String(globalFilter) : '')\n );\n\n if (!isFilteredByGlobalFilter) {\n willRowMoveReason = IndicatorReason.SEARCH;\n } else if (cell.column.getIsFiltered() && !columnFilterFn(state, cell.column.getFilterValue() as Table2Filter)) {\n willRowMoveReason = IndicatorReason.FILTER;\n } else if (\n !willRowMoveReason &&\n cell.column.getIsSorted() &&\n willRowMoveAfterSorting(\n state,\n cell,\n rowIndex,\n table.getRowModel().rows,\n !!table.getState().sorting.find(s => s.id === cell.column.id)?.desc\n )\n ) {\n willRowMoveReason = IndicatorReason.SORTING;\n }\n\n if (willRowMoveReason !== null) {\n meta.setShouldPauseSortingAndFiltering(true);\n setRowMoveReason({ [cellId]: willRowMoveReason });\n }\n };\n\n const hideIndicator = () => {\n setRowMoveReason(prevState => {\n const newState = { ...prevState };\n delete newState[cellId];\n\n return newState;\n });\n };\n\n const cellControl = cell.column.columnDef.meta?.control;\n\n const attributes = {\n 'aria-label': ariaLabel,\n onBlur: saveIfChanged,\n onFocus: handleFocus,\n ref,\n // This is a temporary fix to enable up/down arrow key shortcuts on input in quick mode. For some reason,\n // the preventDefault is true on Taco Input, so the keyboard shortcuts doesn't work. By adding this\n // data attribute we make sure the event is coming from a control component, and then we can make sure\n // keyboard shortcut works as expected.\n 'data-inline-editing-component': 'true',\n };\n\n const className = cn(getCellAlignmentClasses(cell.column.columnDef.meta?.align));\n const indicatorMountNode = cellRef.current?.parentElement?.querySelector(':first-child') as Element | null;\n\n let controlComponent;\n\n if (cellControl) {\n if (typeof cellControl === 'function') {\n controlComponent = cellControl(\n {\n invalid: hasValidationError,\n onBlur: saveIfChanged,\n onFocus: handleFocus,\n ref: controlRef,\n setValue: setState,\n value: state,\n 'data-inline-editing-component': 'true',\n className: detailModeClassName,\n },\n cell.row.original\n );\n } else {\n switch (cellControl) {\n case 'datepicker':\n controlComponent = (\n <Datepicker\n {...attributes}\n className={detailModeClassName}\n 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', 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 />\n );\n break;\n }\n }\n }\n\n const indicatorReason = rowMoveReason[cellId] ?? null;\n\n return (\n <>\n {indicatorReason !== null && (\n <Indicator\n reason={indicatorReason}\n columnName={String(cell.column.columnDef.header)}\n mountNode={indicatorMountNode}\n />\n )}\n <span className=\"relative flex-grow\">\n {controlComponent}\n {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","validationErrors","rowMoveReason","useRowContext","hasValidationErrorsInRow","internalRef","React","useRef","controlRef","disableTruncation","column","columnDef","cellClassName","className","isActiveRow","activeRowIndex","isHoveredRow","hoveredRowIndex","isPinned","getIsPinned","isDragging","dragging","row","id","isSelected","getIsSelected","isDataColumn","isInternalColumn","hasCellControl","control","allVisibleColumns","getVisibleLeafColumns","lastColumnIndex","length","isEditingThisRow","editMode","isEditing","canEditThisCell","isEditingThisCell","columnIndex","isHoveringThisRowWhileEditing","isIndicatorVisible","Object","keys","useEffect","current","classList","add","remove","cn","getCellSizingClasses","rowDensity","handleMouseDown","event","button","activeElement","document","isActiveElementControl","closest","hasActiveRowChanged","blur","setActiveRowIndex","includes","setColumn","attributes","onMouseDown","ref","role","detailModeEditing","setDetailModeEditing","useState","detailModeClassName","isKeyboardFocusableElement","moveRow","moveDirection","MOVE_DIR","PREV","moveToPreviousRow","nextIndex","NEXT","moveToNextRow","onSave","target","isTargetInput","nodeName","preventDefault","setTimeout","select","firstDataColumnIndex","at","lastDataColumnIndex","onKeyDown","isControlInput","getAttribute","isDefaultPrevented","isPropagationStopped","tagName","key","input","setSelectionRange","value","currentTarget","contains","toggleEditing","focus","shiftKey","isFirstRow","isFirstColumn","ctrlKey","metaKey","moveToFirstColumn","moveToPreviousColumn","isLastColumn","moveToLastColumn","moveToNextColumn","setHoveredRowIndex","undefined","ColumnBase","EditingCell","cellRef","rowValues","original","rowsLength","onRowClick","onClick","flexRender","getContext","memo","forwardRef","handleSave","setValidationErrors","setRowMoveReason","useMergedRef","cellId","cellValidationError","getValue","ariaLabel","header","globalFilter","getState","state","setState","isHoveringAnotherRowWhileEditing","hasValidationError","initialValue","saveIfChanged","eventOrNewValue","newValue","hasChanged","updatedRow","shouldPauseSortingAndFiltering","lastSortedOrFilteredRows","map","error","isFocusInsideTable","isBodyFocussed","body","handleFocus","showIndicator","hideIndicator","willRowMoveReason","isFilteredByGlobalFilter","values","some","cellValue","globalFilterFn","String","IndicatorReason","SEARCH","getIsFiltered","columnFilterFn","getFilterValue","FILTER","getIsSorted","willRowMoveAfterSorting","getRowModel","sorting","find","s","desc","SORTING","setShouldPauseSortingAndFiltering","prevState","newState","cellControl","onBlur","onFocus","getCellAlignmentClasses","align","indicatorMountNode","parentElement","querySelector","controlComponent","invalid","setValue","Datepicker","newDate","detail","onChange","Switch","checked","Boolean","Input","indicatorReason","Indicator","reason","columnName","mountNode","ValidationError"],"mappings":";;;;;;;;;;;;;;;;;;MA8BaA,IAAI,GAAG,SAASA,IAAI,CAAkBC,KAAuB;;EACtE,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC,SAAS;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,aAAa;IAAEC,cAAc;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;GAAa,GAAGV,KAAK;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ef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.classList.remove('pb-4');
11262
11262
  };
11263
11263
  }, [isIndicatorVisible, isLastRow]);
11264
- const className = cn('border-b', {
11264
+ const className = cn({
11265
+ 'border-b': !isLastRow,
11265
11266
  'sticky z-[1]': isPinned,
11266
11267
  // use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating
11267
11268
  'bg-white': !isActiveRow && !isSelected && !isHoveredRow,
@@ -13738,7 +13739,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
13738
13739
  return summaryIds.length && summaryIds.some(v => !visibleIds.includes(v));
13739
13740
  }, [footers, columnVisibility]);
13740
13741
  return /*#__PURE__*/React__default.createElement("div", {
13741
- className: "flex h-full w-full flex-col gap-4"
13742
+ className: "flex h-full w-full flex-col gap-4 overflow-hidden"
13742
13743
  }, hasToolbar ? /*#__PURE__*/React__default.createElement("div", {
13743
13744
  className: "flex flex-wrap gap-2"
13744
13745
  }, toolbar, hasInternalToolbar ? /*#__PURE__*/React__default.createElement(Group, {