@vuu-ui/vuu-table 0.13.110-alpha.1 → 0.13.110-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/Row.css.js +1 -1
- package/cjs/Row.js +2 -2
- package/cjs/Row.js.map +1 -1
- package/cjs/Table.css.js +1 -1
- package/cjs/Table.js +9 -6
- package/cjs/Table.js.map +1 -1
- package/cjs/cell-block/cellblock-utils.js +3 -3
- package/cjs/cell-block/cellblock-utils.js.map +1 -1
- package/cjs/table-dom-utils.js +4 -24
- package/cjs/table-dom-utils.js.map +1 -1
- package/cjs/table-header/TableHeader.js +89 -91
- package/cjs/table-header/TableHeader.js.map +1 -1
- package/cjs/useCell.js +1 -2
- package/cjs/useCell.js.map +1 -1
- package/cjs/useTable.js +60 -40
- package/cjs/useTable.js.map +1 -1
- package/cjs/useTableContextMenu.js +2 -3
- package/cjs/useTableContextMenu.js.map +1 -1
- package/cjs/useTableModel.js +48 -25
- package/cjs/useTableModel.js.map +1 -1
- package/esm/Row.css.js +1 -1
- package/esm/Row.js +2 -2
- package/esm/Row.js.map +1 -1
- package/esm/Table.css.js +1 -1
- package/esm/Table.js +9 -6
- package/esm/Table.js.map +1 -1
- package/esm/cell-block/cellblock-utils.js +2 -2
- package/esm/cell-block/cellblock-utils.js.map +1 -1
- package/esm/table-dom-utils.js +3 -21
- package/esm/table-dom-utils.js.map +1 -1
- package/esm/table-header/TableHeader.js +89 -91
- package/esm/table-header/TableHeader.js.map +1 -1
- package/esm/useCell.js +1 -2
- package/esm/useCell.js.map +1 -1
- package/esm/useTable.js +61 -41
- package/esm/useTable.js.map +1 -1
- package/esm/useTableContextMenu.js +1 -2
- package/esm/useTableContextMenu.js.map +1 -1
- package/esm/useTableModel.js +48 -25
- package/esm/useTableModel.js.map +1 -1
- package/package.json +10 -10
- package/types/Table.d.ts +4 -6
- package/types/table-dom-utils.d.ts +1 -3
- package/types/table-header/TableHeader.d.ts +2 -2
- package/types/useTable.d.ts +4 -2
- package/types/useTableModel.d.ts +4 -7
package/cjs/Row.css.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var rowCss = ".vuuTableRow {\n background: var(--row-background, var(--table-background));\n border-bottom: 1px solid var(--row-borderColor, var(--table-background));\n box-sizing: border-box;\n color: var(--salt-content-secondary-foreground);\n contain: layout;\n
|
|
3
|
+
var rowCss = ".vuuTableRow {\n --table-row-selected-background: var(--vuuTableRow-selected-background, var(--salt-selectable-background-selected));\n \n background: var(--row-background, var(--table-background));\n border-bottom: 1px solid var(--row-borderColor, var(--table-background));\n box-sizing: border-box;\n color: var(--salt-content-secondary-foreground);\n contain: layout;\n height: var(--row-height);\n line-height: var(--row-height);\n position: absolute;\n top: 0;\n white-space: nowrap;\n width: 100%;\n}\n\n.vuuTableRow-proxy {\n position: absolute !important;\n visibility: hidden;\n}\n\n.vuuTableRow-even {\n --row-background: var(--row-background-even);\n}\n\n.vuuTableRow-highlighted {\n background: var(--salt-selectable-background-hover);\n}\n\n\n.vuuTableRow[aria-selected=\"true\"] {\n background-color: var(--table-row-selected-background);\n}\n\n.vuuTableRow[aria-expanded=\"true\"] {\n --toggle-icon-transform: rotate(90deg);\n}\n\n.vuuDraggable .vuuTableRow {\n --cell-borderColor: transparent;\n --vuu-selection-decorator-bg: transparent;\n transform: none !important;\n z-index: 1;\n}\n\n\n.vuuSelectionDecorator {\n background: var(--table-background);\n display: inline-block;\n height: var(--row-height);\n position: relative;\n width: var(--table-selection-bookend-width,4px);\n z-index: 2;\n}\n\n.vuuTableRow:not([aria-selected=\"true\"]){\n .vuuTableRowBookend {\n display: none;\n }\n}\n\n.vuuSelectionDecorator.vuuStickyLeft {\n left: 0;\n position: sticky;\n}\n\n.vuuSelectionDecorator.vuuStickyRight {\n right: 0;\n position: sticky;\n}\n\n .vuuTableRowBookend {\n position: absolute;\n top: -1px;\n right:0;\n bottom:0;\n left:0;\n }\n\n.vuuTable-rowSelection-bordered {\n\n .vuuSelectionDecorator {\n\n .vuuTableRowBookend {\n background-color: var(--table-row-selected-background);\n border-color: var(--vuuTableRow-selectionBlock-borderColor);\n border-width: 1px;\n width: var(--table-selection-bookend-width,4px);\n\n &:before {\n content: none !important;\n }\n }\n\n &.vuuStickyLeft {\n .vuuTableRowBookend {\n border-left-style: solid;\n }\n }\n &.vuuStickyRight {\n .vuuTableRowBookend {\n border-right-style: solid;\n }\n }\n }\n\n .vuuTableRow[aria-selected=\"true\"]{\n .vuuSelectionDecorator {\n background-color: var(--table-background);\n border: none;\n }\n\n }\n\n /* non-selected row immediately followed by a sewlected row */\n .vuuTableRow:not([aria-selected=\"true\"]):has( + .vuuTableRow[aria-selected=\"true\"]) {\n border-bottom-color: transparent;\n }\n\n /* first row in a selection block, including a selection block of one row */\n .vuuTableRow:not([aria-selected=\"true\"]) + .vuuTableRow[aria-selected=\"true\"] {\n border-radius: none;\n\n &:after {\n background: var(--vuuTableRow-selectionBlock-borderColor);\n content: \"\";\n position: absolute;\n top: 0px;\n left: 4px;\n height: 1px;\n width: calc(var(--content-width) - 8px);\n z-index: 1;\n }\n\n .vuuStickyLeft .vuuTableRowBookend {\n border-top-left-radius: 5px;\n border-top-style: solid;\n margin-top: 1px;\n }\n\n .vuuStickyRight .vuuTableRowBookend {\n border-top-right-radius: 5px;\n border-top-style: solid;\n margin-top: 1px;\n }\n\n }\n\n /* Last row in a selection block, including a selection block of one row */\n .vuuTableRow[aria-selected=\"true\"]:has( + .vuuTableRow:not([aria-selected=\"true\"])) {\n border-bottom-color: var(--vuuTableRow-selectionBlock-borderColor);\n\n .vuuStickyLeft .vuuTableRowBookend {\n border-bottom-left-radius: 5px;\n border-bottom-style: solid;\n }\n .vuuStickyRight .vuuTableRowBookend {\n border-bottom-right-radius: 5px;\n border-bottom-style: solid;\n }\n }\n\n}";
|
|
4
4
|
|
|
5
5
|
module.exports = rowCss;
|
|
6
6
|
//# sourceMappingURL=Row.css.js.map
|
package/cjs/Row.js
CHANGED
|
@@ -116,7 +116,7 @@ const Row = react.memo(
|
|
|
116
116
|
onClick: handleRowClick,
|
|
117
117
|
style,
|
|
118
118
|
children: [
|
|
119
|
-
showBookends ? /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
119
|
+
showBookends ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "vuuSelectionDecorator vuuStickyLeft", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "vuuTableRowBookend" }) }) : null,
|
|
120
120
|
/* @__PURE__ */ jsxRuntime.jsx(VirtualColSpan.VirtualColSpan, { width: virtualColSpan }),
|
|
121
121
|
columns.filter(vuuUtils.isNotHidden).map((column) => {
|
|
122
122
|
const isGroup = vuuUtils.isGroupColumn(column);
|
|
@@ -135,7 +135,7 @@ const Row = react.memo(
|
|
|
135
135
|
column.name
|
|
136
136
|
);
|
|
137
137
|
}),
|
|
138
|
-
showBookends ? /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
138
|
+
showBookends ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "vuuSelectionDecorator vuuStickyRight", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "vuuTableRowBookend" }) }) : null
|
|
139
139
|
]
|
|
140
140
|
}
|
|
141
141
|
);
|
package/cjs/Row.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.js","sources":["../../../packages/vuu-table/src/Row.tsx"],"sourcesContent":["import { RowProps, RuntimeColumnDescriptor } from \"@vuu-ui/vuu-table-types\";\nimport {\n isGroupColumn,\n isJsonColumn,\n isJsonGroup,\n isNotHidden,\n metadataKeys,\n queryClosest,\n} from \"@vuu-ui/vuu-utils\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport { MouseEvent, forwardRef, memo, useCallback } from \"react\";\nimport { TableCell, TableGroupCell } from \"./table-cell\";\n\nimport rowCss from \"./Row.css\";\nimport { VirtualColSpan } from \"./VirtualColSpan\";\n\nconst { COUNT, DEPTH, IDX, IS_EXPANDED, IS_LEAF, SELECTED } = metadataKeys;\nconst classBase = \"vuuTableRow\";\n\n// A dummy Table Row rendered once and not visible. We measure this to\n// determine height of Row(s) and monitor it for size changes (in\n// case of runtime density switch). This allows ListItem height to\n// be controlled purely through CSS.\nexport const RowProxy = forwardRef<HTMLDivElement, { height?: number }>(\n function RowProxy({ height }, forwardedRef) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-table-row\",\n css: rowCss,\n window: targetWindow,\n });\n\n return (\n <div\n aria-hidden\n className={cx(classBase, `${classBase}-proxy`)}\n ref={forwardedRef}\n style={{ height }}\n />\n );\n },\n);\n\n// export const Row = memo(\nexport const Row = memo(\n ({\n className: classNameProp,\n classNameGenerator,\n columnMap,\n columns,\n groupToggleTarget = \"group-column\",\n highlighted,\n row,\n offset,\n onCellEdit,\n onClick,\n onDataEdited,\n onToggleGroup,\n searchPattern,\n showBookends = true,\n virtualColSpan = 0,\n zebraStripes = false,\n ...htmlAttributes\n }: RowProps) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-table-row\",\n css: rowCss,\n window: targetWindow,\n });\n\n const {\n [COUNT]: childRowCount,\n [DEPTH]: depth,\n [IDX]: rowIndex,\n [IS_EXPANDED]: isExpanded,\n [IS_LEAF]: isLeaf,\n [SELECTED]: isSelected,\n } = row;\n\n const handleRowClick = useCallback(\n (evt: MouseEvent<HTMLDivElement>) => {\n const rangeSelect = evt.shiftKey;\n const keepExistingSelection = evt.ctrlKey || evt.metaKey; /* mac only */\n onClick?.(evt, row, rangeSelect, keepExistingSelection);\n },\n [onClick, row],\n );\n\n const className = cx(\n classBase,\n classNameProp,\n classNameGenerator?.(row, columnMap),\n {\n [`${classBase}-even`]: zebraStripes && rowIndex % 2 === 0,\n [`${classBase}-highlighted`]: highlighted,\n },\n );\n\n const canExpand = isLeaf === false && childRowCount > 0;\n const ariaExpanded = isExpanded ? true : canExpand ? false : undefined;\n const ariaLevel = isLeaf && depth === 1 ? undefined : depth;\n\n // const style = { transform: `translate3d(0px, ${offset}px, 0px)` };\n const style = { top: offset };\n\n const handleGroupCellClick = useCallback(\n (evt: MouseEvent, column: RuntimeColumnDescriptor) => {\n if (isGroupColumn(column) || isJsonGroup(column, row, columnMap)) {\n const toggleIconClicked =\n queryClosest(evt.target, \".vuuToggleIconButton\") !== null;\n if (groupToggleTarget === \"toggle-icon\") {\n if (!toggleIconClicked) {\n return;\n }\n }\n if (toggleIconClicked) {\n // prevent evt bubbling, will suppress selection hook.\n // Clicking the toggle icon directly never triggers row selection\n evt.stopPropagation();\n }\n onToggleGroup?.(row, column);\n }\n },\n [columnMap, groupToggleTarget, onToggleGroup, row],\n );\n\n return (\n <div\n {...htmlAttributes}\n aria-expanded={ariaExpanded}\n aria-selected={isSelected ? \"true\" : undefined}\n aria-level={ariaLevel}\n role=\"row\"\n className={className}\n onClick={handleRowClick}\n style={style}\n >\n {showBookends ? (\n <div className
|
|
1
|
+
{"version":3,"file":"Row.js","sources":["../../../packages/vuu-table/src/Row.tsx"],"sourcesContent":["import { RowProps, RuntimeColumnDescriptor } from \"@vuu-ui/vuu-table-types\";\nimport {\n isGroupColumn,\n isJsonColumn,\n isJsonGroup,\n isNotHidden,\n metadataKeys,\n queryClosest,\n} from \"@vuu-ui/vuu-utils\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport { MouseEvent, forwardRef, memo, useCallback } from \"react\";\nimport { TableCell, TableGroupCell } from \"./table-cell\";\n\nimport rowCss from \"./Row.css\";\nimport { VirtualColSpan } from \"./VirtualColSpan\";\n\nconst { COUNT, DEPTH, IDX, IS_EXPANDED, IS_LEAF, SELECTED } = metadataKeys;\nconst classBase = \"vuuTableRow\";\n\n// A dummy Table Row rendered once and not visible. We measure this to\n// determine height of Row(s) and monitor it for size changes (in\n// case of runtime density switch). This allows ListItem height to\n// be controlled purely through CSS.\nexport const RowProxy = forwardRef<HTMLDivElement, { height?: number }>(\n function RowProxy({ height }, forwardedRef) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-table-row\",\n css: rowCss,\n window: targetWindow,\n });\n\n return (\n <div\n aria-hidden\n className={cx(classBase, `${classBase}-proxy`)}\n ref={forwardedRef}\n style={{ height }}\n />\n );\n },\n);\n\n// export const Row = memo(\nexport const Row = memo(\n ({\n className: classNameProp,\n classNameGenerator,\n columnMap,\n columns,\n groupToggleTarget = \"group-column\",\n highlighted,\n row,\n offset,\n onCellEdit,\n onClick,\n onDataEdited,\n onToggleGroup,\n searchPattern,\n showBookends = true,\n virtualColSpan = 0,\n zebraStripes = false,\n ...htmlAttributes\n }: RowProps) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-table-row\",\n css: rowCss,\n window: targetWindow,\n });\n\n const {\n [COUNT]: childRowCount,\n [DEPTH]: depth,\n [IDX]: rowIndex,\n [IS_EXPANDED]: isExpanded,\n [IS_LEAF]: isLeaf,\n [SELECTED]: isSelected,\n } = row;\n\n const handleRowClick = useCallback(\n (evt: MouseEvent<HTMLDivElement>) => {\n const rangeSelect = evt.shiftKey;\n const keepExistingSelection = evt.ctrlKey || evt.metaKey; /* mac only */\n onClick?.(evt, row, rangeSelect, keepExistingSelection);\n },\n [onClick, row],\n );\n\n const className = cx(\n classBase,\n classNameProp,\n classNameGenerator?.(row, columnMap),\n {\n [`${classBase}-even`]: zebraStripes && rowIndex % 2 === 0,\n [`${classBase}-highlighted`]: highlighted,\n },\n );\n\n const canExpand = isLeaf === false && childRowCount > 0;\n const ariaExpanded = isExpanded ? true : canExpand ? false : undefined;\n const ariaLevel = isLeaf && depth === 1 ? undefined : depth;\n\n // const style = { transform: `translate3d(0px, ${offset}px, 0px)` };\n const style = { top: offset };\n\n const handleGroupCellClick = useCallback(\n (evt: MouseEvent, column: RuntimeColumnDescriptor) => {\n if (isGroupColumn(column) || isJsonGroup(column, row, columnMap)) {\n const toggleIconClicked =\n queryClosest(evt.target, \".vuuToggleIconButton\") !== null;\n if (groupToggleTarget === \"toggle-icon\") {\n if (!toggleIconClicked) {\n return;\n }\n }\n if (toggleIconClicked) {\n // prevent evt bubbling, will suppress selection hook.\n // Clicking the toggle icon directly never triggers row selection\n evt.stopPropagation();\n }\n onToggleGroup?.(row, column);\n }\n },\n [columnMap, groupToggleTarget, onToggleGroup, row],\n );\n\n return (\n <div\n {...htmlAttributes}\n aria-expanded={ariaExpanded}\n aria-selected={isSelected ? \"true\" : undefined}\n aria-level={ariaLevel}\n role=\"row\"\n className={className}\n onClick={handleRowClick}\n style={style}\n >\n {showBookends ? (\n <div className=\"vuuSelectionDecorator vuuStickyLeft\">\n <div className=\"vuuTableRowBookend\" />\n </div>\n ) : null}\n <VirtualColSpan width={virtualColSpan} />\n {columns.filter(isNotHidden).map((column) => {\n const isGroup = isGroupColumn(column);\n const isJsonCell = isJsonColumn(column);\n const Cell = isGroup && !isJsonCell ? TableGroupCell : TableCell;\n\n return (\n <Cell\n column={column}\n columnMap={columnMap}\n key={column.name}\n onClick={isGroup || isJsonCell ? handleGroupCellClick : undefined}\n onDataEdited={onDataEdited}\n row={row}\n searchPattern={searchPattern}\n />\n );\n })}\n {showBookends ? (\n <div className=\"vuuSelectionDecorator vuuStickyRight\">\n <div className=\"vuuTableRowBookend\" />\n </div>\n ) : null}\n </div>\n );\n },\n);\nRow.displayName = \"Row\";\n"],"names":["metadataKeys","forwardRef","RowProxy","useWindow","useComponentCssInjection","rowCss","jsx","memo","useCallback","isGroupColumn","isJsonGroup","queryClosest","jsxs","VirtualColSpan","isNotHidden","isJsonColumn","TableGroupCell","TableCell"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,EAAE,KAAO,EAAA,KAAA,EAAO,KAAK,WAAa,EAAA,OAAA,EAAS,UAAa,GAAAA,qBAAA;AAC9D,MAAM,SAAY,GAAA,aAAA;AAMX,MAAM,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AA,cAAC,IAAA;AAAA,cAAA;AAAA,gBACC,MAAA;AAAA,gBACA,SAAA;AAAA,gBAEA,OAAA,EAAS,OAAW,IAAA,UAAA,GAAa,oBAAuB,GAAA,KAAA,CAAA;AAAA,gBACxD,YAAA;AAAA,gBACA,GAAA;AAAA,gBACA;AAAA,eAAA;AAAA,cAJK,MAAO,CAAA;AAAA,aAKd;AAAA,WAEH,CAAA;AAAA,UACA,YAAA,mBACEA,cAAA,CAAA,KAAA,EAAA,EAAI,SAAU,EAAA,sCAAA,EACb,yCAAC,KAAI,EAAA,EAAA,SAAA,EAAU,oBAAqB,EAAA,CAAA,EACtC,CACE,GAAA;AAAA;AAAA;AAAA,KACN;AAAA;AAGN;AACA,GAAA,CAAI,WAAc,GAAA,KAAA;;;;;"}
|
package/cjs/Table.css.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tableCss = ".vuuTable {\n --vuu-table-footer-height: 0px;\n --vuu-table-cell-outlineWidth: 1px;\n --table-height: var(--measured-px-height);\n --table-width: var(--measured-px-width);\n --vuu-table-embedded-control-height: calc(var(--row-height) - 3px);\n --vuu-table-col-header-height: var(--vuuTableHeaderCell-height, 25px);\n --vuu-table-col-heading-height: 25px;\n --columnResizer-color: transparent;\n --row-height: var(\n --row-height-prop,\n var(--vuu-table-row-height, var(--salt-size-base))\n );\n\n --cell-borderColor: transparent;\n --row-borderColor: var(--row-background);\n --table-background: var(--salt-container-primary-background);\n\n background: var(--table-background);\n font-family: var(\n --vuuTable-fontFamily,\n var(--salt-typography-fontFamily, sans-serif)\n );\n font-size: var(--vuuTable-fontSize, var(--salt-text-fontSize, 12px));\n position: relative;\n user-select: none;\n\n &.vuuTable-viewportRowLimit {\n height: fit-content;\n /* With a viewportRowLimit, table is content sized, not container sized. */\n .vuuTable-contentContainer {\n height: calc(var(--measured-px-height) + var(--total-header-height));\n }\n .vuuTable-scrollbarContainer {\n height: calc(\n var(--measured-px-height) + var(--horizontal-scrollbar-height)\n );\n }\n .vuuTable-scrollbarFiller {\n height: var(--horizontal-scrollbar-height);\n }\n }\n\n &.vuuTable-maxViewportRowLimit {\n /* With a maxVviewportRowLimit, table is content sized, not container sized. */\n height: fit-content;\n padding-bottom: var(--horizontal-scrollbar-height);\n\n .vuuTable-contentContainer {\n height: min(\n calc(var(--measured-px-height) + var(--total-header-height)),\n calc(var(--content-height) + var(--total-header-height))\n );\n }\n .vuuTable-scrollbarContainer {\n height: min(\n calc(var(--measured-px-height) + var(--horizontal-scrollbar-height)),\n calc(var(--content-height) + var(--horizontal-scrollbar-height))\n );\n }\n\n .vuuTable-scrollbarFiller {\n height: var(--horizontal-scrollbar-height);\n }\n }\n}\n\n.vuuTable-zebra {\n --row-background-even: var(--salt-palette-neutral-secondary-background);\n}\n\n.vuuTable-colLines {\n --cell-borderColor: var(--salt-separable-tertiary-borderColor);\n}\n\n.vuuTable-rowLines {\n --row-borderColor: var(--salt-separable-tertiary-borderColor);\n}\n\n.vuuTable-scrollbarContainer {\n border-bottom: none !important;\n border-top: none !important;\n height: var(--viewport-body-height);\n left: 0px;\n overflow: auto;\n position: absolute;\n top: var(--total-header-height);\n width: var(--table-width);\n}\n\n.vuuTable-scrollbarContainer::-webkit-scrollbar {\n width: 10px;\n}\n\n.vuuTable-scrollbarContainer::-webkit-scrollbar:horizontal {\n height: 10px;\n}\n\n.vuuTable-scrollbarContainer::-webkit-scrollbar-track {\n background-color: transparent;\n}\n.vuuTable-scrollbarContainer::-webkit-scrollbar-thumb {\n background-clip: padding-box;\n border-radius: 10px;\n border: 2px solid rgba(0, 0, 0, 0);\n background-color: var(--vuu-color-gray-30);\n}\n\n.vuuTable-scrollbarContent {\n height: calc(var(--content-height) + var(--horizontal-scrollbar-height));\n position: absolute;\n width: var(--content-width);\n}\n\n.vuuTable-contentContainer {\n --table-content-container-width: calc(var(--table-width) - var(--vertical-scrollbar-width));\n background: var(--table-background);\n height: calc(\n 100% - var(--horizontal-scrollbar-height) - var(--vuu-table-footer-height)\n );\n position: relative;\n overflow: auto;\n overscroll-behavior: none;\n width: var(--table-content-container-width);\n}\n\n.vuuTable-contentContainer::-webkit-scrollbar {\n display: none;\n}\n\n.vuuTable-table {\n border: none;\n border-collapse: separate;\n border-spacing: 0;\n left: 0;\n margin: 0;\n position: absolute;\n top: 0;\n table-layout: fixed;\n width: var(--content-width);\n}\n\n.vuuTable-body {\n height: var(--content-height);\n position: relative;\n}\n\n.vuuTable-focusCellPlaceholder {\n height: var(--row-height);\n position: absolute;\n width: 50px;\n z-index: -1;\n}\n\n.vuuPinLeft,\n.vuuPinRight {\n background-color: inherit;\n position: sticky;\n z-index: 1;\n}\n\n.
|
|
3
|
+
var tableCss = ".vuuTable {\n --vuu-table-footer-height: 0px;\n --vuu-table-cell-outlineWidth: 1px;\n --table-height: var(--measured-px-height);\n --table-width: var(--measured-px-width);\n --vuu-table-embedded-control-height: calc(var(--row-height) - 3px);\n --vuu-table-col-header-height: var(--vuuTableHeaderCell-height, 25px);\n --vuu-table-col-heading-height: 25px;\n --columnResizer-color: transparent;\n --row-height: var(\n --row-height-prop,\n var(--vuu-table-row-height, var(--salt-size-base))\n );\n\n --cell-borderColor: transparent;\n --row-borderColor: var(--row-background);\n --table-background: var(--salt-container-primary-background);\n\n background: var(--table-background);\n font-family: var(\n --vuuTable-fontFamily,\n var(--salt-typography-fontFamily, sans-serif)\n );\n font-size: var(--vuuTable-fontSize, var(--salt-text-fontSize, 12px));\n position: relative;\n user-select: none;\n\n &.vuuTable-viewportRowLimit {\n height: fit-content;\n /* With a viewportRowLimit, table is content sized, not container sized. */\n .vuuTable-contentContainer {\n height: calc(var(--measured-px-height) + var(--total-header-height));\n }\n .vuuTable-scrollbarContainer {\n height: calc(\n var(--measured-px-height) + var(--horizontal-scrollbar-height)\n );\n }\n .vuuTable-scrollbarFiller {\n height: var(--horizontal-scrollbar-height);\n }\n }\n\n &.vuuTable-maxViewportRowLimit {\n /* With a maxVviewportRowLimit, table is content sized, not container sized. */\n height: fit-content;\n padding-bottom: var(--horizontal-scrollbar-height);\n\n .vuuTable-contentContainer {\n height: min(\n calc(var(--measured-px-height) + var(--total-header-height)),\n calc(var(--content-height) + var(--total-header-height))\n );\n }\n .vuuTable-scrollbarContainer {\n height: min(\n calc(var(--measured-px-height) + var(--horizontal-scrollbar-height)),\n calc(var(--content-height) + var(--horizontal-scrollbar-height))\n );\n }\n\n .vuuTable-scrollbarFiller {\n height: var(--horizontal-scrollbar-height);\n }\n }\n}\n\n.vuuTable-zebra {\n --row-background-even: var(--salt-palette-neutral-secondary-background);\n}\n\n.vuuTable-colLines {\n --cell-borderColor: var(--salt-separable-tertiary-borderColor);\n}\n\n.vuuTable-rowLines {\n --row-borderColor: var(--salt-separable-tertiary-borderColor);\n}\n\n.vuuTable-scrollbarContainer {\n border-bottom: none !important;\n border-top: none !important;\n height: var(--viewport-body-height);\n left: 0px;\n overflow: auto;\n position: absolute;\n top: var(--total-header-height);\n width: var(--table-width);\n}\n\n.vuuTable-scrollbarContainer::-webkit-scrollbar {\n width: 10px;\n}\n\n.vuuTable-scrollbarContainer::-webkit-scrollbar:horizontal {\n height: 10px;\n}\n\n.vuuTable-scrollbarContainer::-webkit-scrollbar-track {\n background-color: transparent;\n}\n.vuuTable-scrollbarContainer::-webkit-scrollbar-thumb {\n background-clip: padding-box;\n border-radius: 10px;\n border: 2px solid rgba(0, 0, 0, 0);\n background-color: var(--vuu-color-gray-30);\n}\n\n.vuuTable-scrollbarContent {\n height: calc(var(--content-height) + var(--horizontal-scrollbar-height));\n position: absolute;\n width: var(--content-width);\n}\n\n.vuuTable-contentContainer {\n --table-content-container-width: calc(var(--table-width) - var(--vertical-scrollbar-width));\n background: var(--table-background);\n height: calc(\n 100% - var(--horizontal-scrollbar-height) - var(--vuu-table-footer-height)\n );\n position: relative;\n overflow: auto;\n overscroll-behavior: none;\n width: var(--table-content-container-width);\n}\n\n.vuuTable-contentContainer::-webkit-scrollbar {\n display: none;\n}\n\n.vuuTable-table {\n border: none;\n border-collapse: separate;\n border-spacing: 0;\n left: 0;\n margin: 0;\n position: absolute;\n top: 0;\n table-layout: fixed;\n width: var(--content-width);\n}\n\n.vuuTable-body {\n height: var(--content-height);\n position: relative;\n}\n\n.vuuTable-focusCellPlaceholder {\n height: var(--row-height);\n position: absolute;\n width: 50px;\n z-index: -1;\n}\n\n.vuuPinLeft,\n.vuuPinRight {\n background-color: inherit;\n position: sticky;\n z-index: 1;\n}\n\n.vuuPinRight {\n .vuuColumnResizer {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.vuuTableHeaderCell.vuuPinLeft,\n.vuuTableHeaderCell.vuuPinRight {\n z-index: 2;\n}\n\n.vuuTableHeader {\n --row-height: var(--vuu-table-col-header-height);\n background-color: var(\n --vuuTableColHeadings-background,\n var(--table-background)\n );\n position: sticky;\n top: 0;\n /* ensure header row sits atop everything else when scrolling down */\n z-index: 1;\n\n .vuuStickyLeft {\n z-index: 1;\n }\n .vuuStickyRight {\n z-index: 0;\n }\n}\n\n.vuuTableHeader:hover {\n --columnResizer-height: var(--vuu-table-col-header-height);\n --columnResizer-color: var(--salt-separable-tertiary-borderColor);\n}\n\n.vuuTable-heading {\n height: var(--vuu-table-col-heading-height);\n}\n\n.vuuTableHeader {\n background-color: var(\n --vuuTableColHeadings-background,\n var(--vuuTableColHeadings-background)\n );\n border-bottom: solid 1px\n var(\n --vuuTableColHeaders-borderColor,\n var(--salt-separable-secondary-borderColor)\n );\n color: var(--salt-content-secondary-foreground);\n height: var(--vuu-table-col-header-height);\n white-space: nowrap;\n\n .vuuDraggable-spacer {\n border-bottom: solid 1px #ccc;\n display: var(--vuuDraggable-display, inline-block);\n height: var(--vuu-table-col-header-height);\n }\n}\n\n.sizer-cell {\n border: none !important;\n height: 0px;\n}\n\n.vuuDraggable-vuuTable {\n --cell-borderColor: transparent;\n --vuu-table-col-header-height: var(--vuuTableHeaderCell-height, 25px);\n --vuuTableHeaderCell-background: var(--salt-container-secondary-background);\n}\n.vuuDraggable-vuuTable {\n --row-height: 25px;\n}\n\n.vuuTable-pagination {\n --vuu-table-footer-height: 32px;\n .vuuTableHeader {\n position: relative;\n }\n\n .vuuTable-body {\n height: calc(var(--content-height) - var(--total-header-height));\n position: relative;\n }\n\n .vuuTableRow {\n position: relative;\n top: auto;\n }\n}\n\n.vuuTable-footer {\n align-items: center;\n display: flex;\n height: var(--vuu-table-footer-height);\n justify-content: flex-end;\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.vuuHighlight {\n color: blue;\n}\n\n.DragColumn {\n box-shadow: var(--salt-overlayable-shadow-drag);\n}\n\n@keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 90% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n.vuuTable-emptyDisplay {\n animation: fadeIn .8s;\n align-items: center;\n display: flex;\n inset:0;\n justify-content: center;\n position: absolute\n}\n\n.vuuTable-emptyDisplay ~ .vuuTable-contentContainer {\n visibility: hidden;\n}\n\n";
|
|
4
4
|
|
|
5
5
|
module.exports = tableCss;
|
|
6
6
|
//# sourceMappingURL=Table.css.js.map
|
package/cjs/Table.js
CHANGED
|
@@ -56,7 +56,6 @@ const TableCore = ({
|
|
|
56
56
|
rowHeight,
|
|
57
57
|
rowToObject,
|
|
58
58
|
scrollingApiRef,
|
|
59
|
-
selectionBookendWidth = 0,
|
|
60
59
|
selectionModel = "extended",
|
|
61
60
|
showColumnHeaders = true,
|
|
62
61
|
showColumnHeaderMenus = true,
|
|
@@ -124,13 +123,13 @@ const TableCore = ({
|
|
|
124
123
|
rowHeight,
|
|
125
124
|
rowToObject,
|
|
126
125
|
scrollingApiRef,
|
|
127
|
-
selectionBookendWidth,
|
|
128
126
|
selectionModel,
|
|
129
127
|
showColumnHeaders,
|
|
130
128
|
showColumnHeaderMenus,
|
|
131
129
|
showPaginationControls,
|
|
132
130
|
size
|
|
133
131
|
});
|
|
132
|
+
const { selectionBookendWidth = 4 } = config;
|
|
134
133
|
const contentContainerClassName = cx(`${classBase}-contentContainer`, {
|
|
135
134
|
[`${classBase}-colLines`]: tableAttributes.columnSeparators,
|
|
136
135
|
[`${classBase}-rowLines`]: tableAttributes.rowSeparators,
|
|
@@ -147,7 +146,8 @@ const TableCore = ({
|
|
|
147
146
|
"--pinned-width-left": `${viewportMeasurements.pinnedWidthLeft}px`,
|
|
148
147
|
"--pinned-width-right": `${viewportMeasurements.pinnedWidthRight}px`,
|
|
149
148
|
"--total-header-height": `${headerHeight}px`,
|
|
150
|
-
"--viewport-body-height": `${viewportMeasurements.viewportBodyHeight}px
|
|
149
|
+
"--viewport-body-height": `${viewportMeasurements.viewportBodyHeight}px`,
|
|
150
|
+
"--table-selection-bookend-width": `${selectionBookendWidth}px`
|
|
151
151
|
};
|
|
152
152
|
const headersReady = showColumnHeaders === false || headerHeight > 0;
|
|
153
153
|
const readyToRenderTableBody = headersReady && data.length > 0;
|
|
@@ -202,6 +202,7 @@ const TableCore = ({
|
|
|
202
202
|
onRemoveGroupColumn,
|
|
203
203
|
onResizeColumn,
|
|
204
204
|
onSortColumn,
|
|
205
|
+
showBookends: selectionBookendWidth > 0,
|
|
205
206
|
showColumnHeaderMenus,
|
|
206
207
|
tableConfig,
|
|
207
208
|
tableId: id,
|
|
@@ -299,10 +300,10 @@ const Table = react.forwardRef(function Table2({
|
|
|
299
300
|
resizeStrategy,
|
|
300
301
|
rowActionHandlers,
|
|
301
302
|
rowHeight: rowHeightProp,
|
|
303
|
+
rowSelectionBorder,
|
|
302
304
|
rowToObject,
|
|
303
305
|
scrollingApiRef,
|
|
304
306
|
searchPattern = "",
|
|
305
|
-
selectionBookendWidth = 4,
|
|
306
307
|
selectionModel,
|
|
307
308
|
showColumnHeaders,
|
|
308
309
|
showColumnHeaderMenus,
|
|
@@ -323,6 +324,7 @@ const Table = react.forwardRef(function Table2({
|
|
|
323
324
|
const { measuredHeight: rowHeight, measuredRef: rowRef } = useMeasuredHeight.useMeasuredHeight({
|
|
324
325
|
height: rowHeightProp
|
|
325
326
|
});
|
|
327
|
+
console.log(`measured row height = ${rowHeight}`);
|
|
326
328
|
const { measuredHeight: footerHeight, measuredRef: footerRef } = useMeasuredHeight.useMeasuredHeight({});
|
|
327
329
|
const rowLimit = maxViewportRowLimit ?? viewportRowLimit;
|
|
328
330
|
if (config === void 0) {
|
|
@@ -369,12 +371,14 @@ const Table = react.forwardRef(function Table2({
|
|
|
369
371
|
_setSize(size2);
|
|
370
372
|
}
|
|
371
373
|
}, [rowHeight, viewportRowLimit]);
|
|
374
|
+
console.log(`[Table] rowHeightProp ${rowHeightProp} rowHeight: ${rowHeight}`);
|
|
372
375
|
return /* @__PURE__ */ jsxRuntime.jsx(vuuUiControls.ContextPanelProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
373
376
|
vuuUiControls.MeasuredContainer,
|
|
374
377
|
{
|
|
375
378
|
...htmlAttributes,
|
|
376
379
|
className: cx(classBase, classNameProp, {
|
|
377
380
|
[`${classBase}-pagination`]: showPaginationControls,
|
|
381
|
+
[`${classBase}-rowSelection-bordered`]: rowSelectionBorder,
|
|
378
382
|
[`${classBase}-maxViewportRowLimit`]: maxViewportRowLimit,
|
|
379
383
|
[`${classBase}-viewportRowLimit`]: viewportRowLimit
|
|
380
384
|
}),
|
|
@@ -385,7 +389,7 @@ const Table = react.forwardRef(function Table2({
|
|
|
385
389
|
resizeStrategy,
|
|
386
390
|
style: {
|
|
387
391
|
...styleProp,
|
|
388
|
-
"--row-height-prop":
|
|
392
|
+
"--row-height-prop": typeof rowHeightProp === "number" ? `${rowHeightProp}px` : void 0
|
|
389
393
|
},
|
|
390
394
|
width,
|
|
391
395
|
children: [
|
|
@@ -429,7 +433,6 @@ const Table = react.forwardRef(function Table2({
|
|
|
429
433
|
rowToObject,
|
|
430
434
|
scrollingApiRef,
|
|
431
435
|
lowerCaseSearchPattern: vuuUtils.lowerCase(searchPattern),
|
|
432
|
-
selectionBookendWidth,
|
|
433
436
|
selectionModel,
|
|
434
437
|
showColumnHeaders,
|
|
435
438
|
showColumnHeaderMenus,
|
package/cjs/Table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sources":["../../../packages/vuu-table/src/Table.tsx"],"sourcesContent":["import { useForkRef } from \"@salt-ds/core\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport type { DataSource, SchemaColumn } from \"@vuu-ui/vuu-data-types\";\nimport { TableProvider } from \"@vuu-ui/vuu-table-extras\";\nimport {\n CustomHeader,\n DataCellEditNotification,\n GroupToggleTarget,\n RowActionHandler,\n RowProps,\n SelectionChangeHandler,\n ShowColumnHeaderMenus,\n TableConfig,\n TableConfigChangeHandler,\n TableRowClickHandler,\n TableRowSelectHandler,\n TableSelectionModel,\n} from \"@vuu-ui/vuu-table-types\";\nimport type { DragDropState } from \"@vuu-ui/vuu-ui-controls\";\nimport {\n ContextPanelProvider,\n DragStartHandler,\n MeasuredContainer,\n MeasuredContainerProps,\n MeasuredSize,\n dragStrategy,\n reduceSizeHeight,\n} from \"@vuu-ui/vuu-ui-controls\";\nimport {\n RowToObjectMapper,\n lowerCase,\n metadataKeys,\n useId,\n} from \"@vuu-ui/vuu-utils\";\nimport cx from \"clsx\";\nimport {\n CSSProperties,\n ComponentType,\n FC,\n ForwardedRef,\n RefObject,\n forwardRef,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { Row as DefaultRow, RowProxy } from \"./Row\";\nimport { TableCellBlock } from \"./cell-block/cellblock-utils\";\nimport { PaginationControl } from \"./pagination\";\nimport { TableHeader } from \"./table-header\";\nimport { useMeasuredHeight } from \"./useMeasuredHeight\";\nimport { useTable } from \"./useTable\";\nimport { ScrollingAPI } from \"./useTableScroll\";\n\nimport tableCss from \"./Table.css\";\n\nconst classBase = \"vuuTable\";\n\nconst { IDX, RENDER_IDX } = metadataKeys;\n\nexport type TableNavigationStyle = \"none\" | \"cell\" | \"row\" | \"tree\";\n\nexport interface TableProps\n extends Omit<\n MeasuredContainerProps,\n \"onDragStart\" | \"onDrop\" | \"onSelect\" | \"searchPattern\"\n > {\n /**\n * A react function component that will be rendered if there are no rows to display\n */\n EmptyDisplay?: ComponentType;\n Row?: FC<RowProps>;\n /**\n * Allow a block of cells to be selected. Typically to be copied.\n */\n allowCellBlockSelection?: boolean;\n /**\n * Allow column headers to be dragged to re-arrange\n */\n allowDragColumnHeader?: boolean;\n /**\n * Allow rows to be draggable\n */\n allowDragDrop?: boolean | dragStrategy;\n\n /**\n * Allow all rows be selected, use with checkbox coliumn.\n */\n allowSelectAll?: boolean;\n\n /**\n * If checkbox selection is in effect, can user select row by clicking row. If\n * false, checkbox must be clicked explicitly.\n */\n allowSelectCheckboxRow?: boolean;\n /**\n * if provided, first row of table will be selected on initial render.\n */\n autoSelectFirstRow?: true;\n /**\n * if provided, row with matching key will be selected. If not present, will silently fail.\n */\n autoSelectRowKey?: string;\n /**\n * required if a fully featured column picker is to be available\n */\n availableColumns?: SchemaColumn[];\n /**\n * Provide configuration settings for Table. At minimun, column\n * descriptors must be provided.\n */\n config: TableConfig;\n dataSource: DataSource;\n\n disableFocus?: boolean;\n /**\n * Allows additional custom element(s) to be embedded immediately below column headers.\n * Could be used to present inline filters for example.\n * Accepts either a React Element or a Function Component or an array of these. If a React\n * Function Component is used, it will be passed the props described in BaseRowProps.\n */\n customHeader?: CustomHeader | CustomHeader[];\n /**\n * When rows are grouped, user can click group row(s) to expand/collapse display of child rows.\n * This allows precise configuration of where user may click to trigger toggle/collapse. When\n * row selection is also supported, clicking outside the region specified here will select or\n * deselect the row.\n * - toggle-icon - the small toggle icon must be clicked directly\n * - group-column (default) - user can click anywhere within the group column, i.e on the icon or the column text\n */\n groupToggleTarget?: GroupToggleTarget;\n /**\n * Defined how focus navigation within data cells will be handled by table.\n * Default is cell.\n */\n highlightedIndex?: number;\n\n /**\n * Behaves in most respects like viewportRowLimit except that, when there are fewer\n * rows available than the limit set here, the Table height will reduce. This can be\n * useful where a Table is used in a dropdown control.\n */\n maxViewportRowLimit?: number;\n\n /**\n * Determines bahaviour of keyboard navigation , either row focused or cell focused.\n * `tree` is a specialised navigation behaviour only useful where table is being\n * used to present purely grouped data (see TreeTable)\n */\n navigationStyle?: TableNavigationStyle;\n /**\n * required if a fully featured column picker is to be available.\n * Available columns can be changed by the addition or removal of\n * one or more calculated columns.\n */\n onAvailableColumnsChange?: (columns: SchemaColumn[]) => void;\n /**\n * This callback will be invoked any time a config attribute of TableConfig\n * is changed. By persisting this value and providing it to the Table as a\n * prop, table state can be persisted across sessions.\n */\n onConfigChange?: TableConfigChangeHandler;\n\n /**\n * In a Table with editable cells, this callback will be invoked every time\n * a user performs any edit operation on an editable field.\n */\n onDataEdited?: DataCellEditNotification;\n\n onDragStart?: DragStartHandler;\n onDrop?: (dragDropState: DragDropState) => void;\n\n onHighlight?: (idx: number) => void;\n /**\n * callback invoked when user 'clicks' a table row. CLick triggered either\n * via mouse click or keyboard (default ENTER);\n */\n onRowClick?: TableRowClickHandler;\n onSelect?: TableRowSelectHandler;\n /**\n * Triggered when a block of cells is selected. CellBlock selection can be\n * effected with either mouse or keyboard.\n * - mouse: hold down mouse and drag over selection area\n * - keyboard: press and hold shift key from start cell, then use arrow keys\n * to extend selection block.\n *\n * This callback is invoked when mouse is released or shift key released.\n */\n onSelectCellBlock?: (cellBlock: TableCellBlock) => void;\n\n onSelectionChange?: SelectionChangeHandler;\n renderBufferSize?: number;\n\n /**\n * Provide functionality for custom row actions. e.g. buttons embedded within row cells.\n * These will be available to any custom renderers via TableContext. e.g. a Row may\n * provide a 'Delete' or 'Cancel' button. Implement this functionality in a rowActionHandler.\n */\n rowActionHandlers?: Record<string, RowActionHandler>;\n /**\n * When a row is selected and onSelect provided, onSelect will be invoked with a\n * DataSourceRowObject, derived from the internal representation of a data row,\n * DataSourceRow. The data attribute of DataSourceRowObject is a simple map of\n * column.name : value.\n * This prop allows a custom function to be provided to make the conversion from\n * DataSourceRow to DataSourceRowObject. It will very rarely be needed. It is\n * used by the Treetable.\n */\n rowToObject?: RowToObjectMapper;\n\n /**\n * Only applicable to grouped data. If there are selected rows which are not top-level\n * items and group items above are not already expanded, expand all group items in\n * the hierarchy above selected item. Selected items will thus always be visible, initially.\n * This affects items set at load time via autoSelectRowKey as well as items\n * selected programatically (ie not directly by user).\n * Nodes can of course be collapsed by user at runtime which may hide selected rows.\n * Note: this is not supported by all DataSource implementations\n */\n revealSelected?: boolean;\n /**\n * Pixel height of rows. If specified here, this will take precedence over CSS\n * values and Table will not respond to density changes.\n */\n rowHeight?: number;\n /**\n * imperative API for scrolling table\n */\n scrollingApiRef?: ForwardedRef<ScrollingAPI>;\n\n /**\n * If a search has been applied against data, this is the search text used.\n * Will be used to highlight matching text.\n */\n searchPattern?: string;\n /**\n * Selection Bookends style the left and right edge of a selection block.\n * They are optional, value currently defaults to 4.\n * TODO this should just live in CSS\n */\n selectionBookendWidth?: number;\n /**\n * Selection behaviour for Table:\n * `none` selection disabled\n * `single` no more than one row may be selected\n * `single-no-deselect` no more than one row may be selected, one row is always selected, defaults to first visible\n * `extended` (default) multiple rows can be selected\n * `checkbox` same behaviour as extended, with checkbox column for selection\n */\n selectionModel?: TableSelectionModel;\n /**\n * if false, table rendered without headers. Useful when table is being included in a\n * composite component.\n */\n showColumnHeaders?: boolean;\n /**\n * if false, column headers will not display menu icon. If true, all available Column Menu\n * actions will be available via the menu. Alternatively, a map of specific column menu\n * permissions can be provided to allow control over which menu items are presented.\n */\n showColumnHeaderMenus?: ShowColumnHeaderMenus;\n /**\n * if true, pagination will be used to navigate data, scrollbars will not be rendered\n */\n showPaginationControls?: boolean;\n\n /**\n * As an alternative to sizing the Table height via CSS or via an explicit height value,\n * specify the number of rows to be displayed within the Viewport. The actual height\n * will then be the product of viewportRowLimit and rowHeight. Row Height will be\n * determined in the usual way, it can be specified explicitly in a prop or set via\n * CSS. If both explicit height and viewportRowLimit are provided by props, rowHeight\n * will be derived from these. Do not pass props for all three values - height,\n * rowHeight and viewportRowLimit. That will be rejected.\n * Use maxViewportRowLimit rather than viewportRowLimit if the height of the table\n * should be reduced when fewer rows are actually available than the limit specified.\n */\n viewportRowLimit?: number;\n}\n\nconst TableCore = ({\n EmptyDisplay,\n Row = DefaultRow,\n allowCellBlockSelection,\n allowDragColumnHeader = true,\n allowDragDrop,\n allowSelectAll,\n allowSelectCheckboxRow,\n autoSelectFirstRow,\n autoSelectRowKey,\n availableColumns,\n config,\n containerRef,\n customHeader,\n dataSource,\n disableFocus = false,\n groupToggleTarget,\n highlightedIndex: highlightedIndexProp,\n id: idProp,\n lowerCaseSearchPattern,\n navigationStyle = \"cell\",\n onAvailableColumnsChange,\n onConfigChange,\n onDataEdited: onDataEditedProp,\n onDragStart,\n onDrop,\n onHighlight,\n onRowClick: onRowClickProp,\n onSelect,\n onSelectCellBlock,\n onSelectionChange,\n renderBufferSize = 0,\n revealSelected,\n rowActionHandlers,\n rowHeight,\n rowToObject,\n scrollingApiRef,\n selectionBookendWidth = 0,\n selectionModel = \"extended\",\n showColumnHeaders = true,\n showColumnHeaderMenus = true,\n showPaginationControls,\n size,\n}: Omit<\n TableProps,\n | \"maxViewportRowLimit\"\n | \"resizeStrategy\"\n | \"rowHeight\"\n | \"searchPattern\"\n | \"viewportRowLimit\"\n> & {\n containerRef: RefObject<HTMLDivElement | null>;\n /**\n * We lowercase this once, on entry, which is the format in which it will be used.\n */\n lowerCaseSearchPattern: Lowercase<string>;\n rowHeight: number;\n size: MeasuredSize;\n}) => {\n const id = useId(idProp);\n const {\n allRowsSelected,\n cellBlock,\n columnMap,\n columns,\n data,\n draggableRow,\n focusCellPlaceholderKeyDown,\n focusCellPlaceholderRef,\n getRowOffset,\n handleColumnAction,\n headerState: { height: headerHeight, count: headerCount },\n headings,\n highlightedIndex,\n onCheckBoxColumnHeaderClick,\n onDataEdited,\n onHeaderHeightMeasured,\n onMoveColumn,\n onMoveGroupColumn,\n onRemoveGroupColumn,\n onResizeColumn,\n onRowClick,\n onSortColumn,\n onToggleGroup,\n rowClassNameGenerator,\n scrollProps,\n tableAttributes,\n tableBodyRef,\n tableConfig,\n viewportMeasurements,\n ...tableProps\n } = useTable({\n allowCellBlockSelection,\n allowDragDrop,\n allowSelectCheckboxRow,\n autoSelectFirstRow,\n autoSelectRowKey,\n availableColumns,\n config,\n containerRef,\n dataSource,\n disableFocus,\n highlightedIndex: highlightedIndexProp,\n id,\n navigationStyle,\n onAvailableColumnsChange,\n onConfigChange,\n onDataEdited: onDataEditedProp,\n onDragStart,\n onDrop,\n onHighlight,\n onRowClick: onRowClickProp,\n onSelect,\n onSelectCellBlock,\n onSelectionChange,\n renderBufferSize,\n revealSelected,\n rowHeight,\n rowToObject,\n scrollingApiRef,\n selectionBookendWidth,\n selectionModel,\n showColumnHeaders,\n showColumnHeaderMenus,\n showPaginationControls,\n size,\n });\n\n const contentContainerClassName = cx(`${classBase}-contentContainer`, {\n [`${classBase}-colLines`]: tableAttributes.columnSeparators,\n [`${classBase}-rowLines`]: tableAttributes.rowSeparators,\n [`${classBase}-zebra`]: tableAttributes.zebraStripes,\n });\n\n const cssScrollbarSize = {\n \"--horizontal-scrollbar-height\": `${viewportMeasurements.horizontalScrollbarHeight}px`,\n \"--vertical-scrollbar-width\": `${viewportMeasurements.verticalScrollbarWidth}px`,\n } as CSSProperties;\n\n const cssVariables = {\n ...cssScrollbarSize,\n \"--content-height\": `${viewportMeasurements.contentHeight}px`,\n \"--content-width\": `${viewportMeasurements.contentWidth}px`,\n \"--pinned-width-left\": `${viewportMeasurements.pinnedWidthLeft}px`,\n \"--pinned-width-right\": `${viewportMeasurements.pinnedWidthRight}px`,\n \"--total-header-height\": `${headerHeight}px`,\n \"--viewport-body-height\": `${viewportMeasurements.viewportBodyHeight}px`,\n } as CSSProperties;\n\n const headersReady = showColumnHeaders === false || headerHeight > 0;\n const readyToRenderTableBody = headersReady && data.length > 0;\n\n return (\n <TableProvider\n dataSource={dataSource}\n menuActionHandler={handleColumnAction}\n rowActionHandlers={rowActionHandlers}\n >\n {showPaginationControls !== true ? (\n <div\n className={`${classBase}-scrollbarContainer`}\n ref={scrollProps.scrollbarContainerRef}\n style={cssVariables}\n tabIndex={-1}\n >\n <div className={`${classBase}-scrollbarContent`} />\n </div>\n ) : null}\n\n {dataSource.size === 0 && EmptyDisplay ? (\n <div className={`${classBase}-emptyDisplay`}>\n <EmptyDisplay />{\" \"}\n </div>\n ) : null}\n\n <div\n className={contentContainerClassName}\n ref={scrollProps.contentContainerRef}\n style={cssVariables}\n >\n <div\n {...tableProps}\n className={`${classBase}-table`}\n role=\"table\"\n tabIndex={disableFocus ? undefined : -1}\n >\n {showColumnHeaders ? (\n <TableHeader\n allowDragColumnHeader={allowDragColumnHeader}\n allowSelectAll={allowSelectAll}\n allRowsSelected={allRowsSelected}\n // columns={scrollProps.columnsWithinViewport}\n columns={columns}\n customHeader={customHeader}\n headings={headings}\n onCheckBoxColumnHeaderClick={onCheckBoxColumnHeaderClick}\n onHeightMeasured={onHeaderHeightMeasured}\n onMoveColumn={onMoveColumn}\n onMoveGroupColumn={onMoveGroupColumn}\n onRemoveGroupColumn={onRemoveGroupColumn}\n onResizeColumn={onResizeColumn}\n onSortColumn={onSortColumn}\n showColumnHeaderMenus={showColumnHeaderMenus}\n tableConfig={tableConfig}\n tableId={id}\n virtualColSpan={scrollProps.virtualColSpan}\n />\n ) : null}\n {readyToRenderTableBody ? (\n <div className={`${classBase}-body`} ref={tableBodyRef}>\n {data.map((data) => {\n const ariaRowIndex = data[IDX] + headerCount + 1;\n return (\n <Row\n aria-rowindex={ariaRowIndex}\n classNameGenerator={rowClassNameGenerator}\n columnMap={columnMap}\n columns={scrollProps.columnsWithinViewport}\n groupToggleTarget={groupToggleTarget}\n highlighted={highlightedIndex === ariaRowIndex}\n key={data[RENDER_IDX]}\n onClick={onRowClick}\n onDataEdited={onDataEdited}\n row={data}\n offset={showPaginationControls ? 0 : getRowOffset(data)}\n onToggleGroup={onToggleGroup}\n showBookends={selectionBookendWidth > 0}\n searchPattern={lowerCaseSearchPattern}\n virtualColSpan={scrollProps.virtualColSpan}\n zebraStripes={tableAttributes.zebraStripes}\n />\n );\n })}\n {/* \n The focusCellPlaceholder allows us to deal with the situation where a cell \n that has focus is scrolled out of the viewport. That cell, along with the \n containing row, will be recycled to render another DataRow. The html table \n cell must not retain focus once it is re-used but we need to track the \n original focus, in case user uses arrow key to resume navigation. \n The placeholder is fixed in place at the location where the focused cell \n was last rendered. It assumes focus. If we get an arrowkey mousedown event \n on the placeholder, the user has resumed navigation whilst the focused cell \n is offscreen. We scroll back to the focus location and pass focus back to \n the correct target cell.\n */}\n <div\n aria-hidden={true}\n className={`${classBase}-focusCellPlaceholder`}\n onKeyDown={focusCellPlaceholderKeyDown}\n ref={focusCellPlaceholderRef}\n tabIndex={-1}\n />\n\n {cellBlock}\n </div>\n ) : null}\n </div>\n </div>\n {/* \n This keeps the heights of content container and scrollbar container aligned for\n cases where we rely on height: fit-content. (ScrollbarContainer isn't taken into \n account because its absolutely positioned).\n */}\n <div\n className={`${classBase}-scrollbarFiller`}\n style={cssScrollbarSize}\n />\n {draggableRow}\n </TableProvider>\n );\n};\n\nexport const Table = forwardRef(function Table(\n {\n EmptyDisplay,\n Row,\n allowCellBlockSelection,\n allowDragColumnHeader,\n allowDragDrop,\n availableColumns,\n allowSelectAll,\n allowSelectCheckboxRow,\n autoSelectFirstRow,\n autoSelectRowKey,\n className: classNameProp,\n config,\n customHeader,\n dataSource,\n disableFocus,\n groupToggleTarget,\n height,\n highlightedIndex,\n id,\n maxViewportRowLimit,\n navigationStyle,\n onAvailableColumnsChange,\n onConfigChange,\n onDataEdited,\n onDragStart,\n onDrop,\n onHighlight,\n onRowClick,\n onSelect,\n onSelectCellBlock,\n onSelectionChange,\n renderBufferSize,\n revealSelected,\n resizeStrategy,\n rowActionHandlers,\n rowHeight: rowHeightProp,\n rowToObject,\n scrollingApiRef,\n searchPattern = \"\",\n selectionBookendWidth = 4,\n selectionModel,\n showColumnHeaders,\n showColumnHeaderMenus,\n showPaginationControls,\n style: styleProp,\n viewportRowLimit,\n width,\n ...htmlAttributes\n }: TableProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-table\",\n css: tableCss,\n window: targetWindow,\n });\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n const [size, _setSize] = useState<MeasuredSize>();\n // TODO this will rerender entire table, move footer into seperate component\n const { measuredHeight: rowHeight, measuredRef: rowRef } = useMeasuredHeight({\n height: rowHeightProp,\n });\n const { measuredHeight: footerHeight, measuredRef: footerRef } =\n useMeasuredHeight({});\n\n const rowLimit = maxViewportRowLimit ?? viewportRowLimit;\n\n if (config === undefined) {\n throw Error(\n \"vuu Table requires config prop. Minimum config is list of Column Descriptors\",\n );\n }\n if (dataSource === undefined) {\n throw Error(\"vuu Table requires dataSource prop\");\n }\n\n if (showPaginationControls && renderBufferSize !== undefined) {\n console.warn(\n `Table: When pagination controls are used, renderBufferSize is ignored`,\n );\n }\n\n if (rowLimit && height && rowHeightProp) {\n console.warn(\n `Table: when viewportRowLimit, rowHeight and height are used in combination, height is ignored`,\n );\n height = rowLimit * rowHeightProp;\n } else if (rowLimit && rowHeightProp) {\n height = rowLimit * rowHeightProp;\n } else if (rowLimit) {\n height = rowLimit * rowHeight;\n }\n\n const sizeRef = useRef<MeasuredSize>(undefined);\n const setSize = useCallback(\n (size: MeasuredSize) => {\n if (viewportRowLimit && !rowHeight) {\n sizeRef.current = size;\n } else if (\n size.height !== sizeRef.current?.height ||\n size.width !== sizeRef.current?.width\n ) {\n _setSize(size);\n }\n },\n [rowHeight, viewportRowLimit],\n );\n useMemo(() => {\n if (sizeRef.current && rowHeight) {\n const size = {\n ...sizeRef.current,\n height: rowHeight * (viewportRowLimit as number),\n };\n sizeRef.current = size;\n _setSize(size);\n }\n }, [rowHeight, viewportRowLimit]);\n\n // TODO render TableHeader here and measure before row construction begins\n // TODO we could have MeasuredContainer render a Provider and make size available via a context hook ?\n return (\n <ContextPanelProvider>\n <MeasuredContainer\n {...htmlAttributes}\n className={cx(classBase, classNameProp, {\n [`${classBase}-pagination`]: showPaginationControls,\n [`${classBase}-maxViewportRowLimit`]: maxViewportRowLimit,\n [`${classBase}-viewportRowLimit`]: viewportRowLimit,\n })}\n height={height}\n id={id}\n onResize={setSize}\n ref={useForkRef(containerRef, forwardedRef)}\n resizeStrategy={resizeStrategy}\n style={\n {\n ...styleProp,\n \"--row-height-prop\": rowHeight > 0 ? `${rowHeight}px` : undefined,\n } as CSSProperties\n }\n width={width}\n >\n <RowProxy ref={rowRef} height={rowHeightProp} />\n {size &&\n rowHeight &&\n (footerHeight || showPaginationControls !== true) ? (\n <TableCore\n EmptyDisplay={EmptyDisplay}\n Row={Row}\n allowCellBlockSelection={allowCellBlockSelection}\n allowDragColumnHeader={allowDragColumnHeader}\n allowDragDrop={allowDragDrop}\n allowSelectAll={allowSelectAll}\n allowSelectCheckboxRow={allowSelectCheckboxRow}\n autoSelectFirstRow={autoSelectFirstRow}\n autoSelectRowKey={autoSelectRowKey}\n availableColumns={availableColumns}\n config={config}\n containerRef={containerRef}\n customHeader={customHeader}\n dataSource={dataSource}\n disableFocus={disableFocus}\n groupToggleTarget={groupToggleTarget}\n highlightedIndex={highlightedIndex}\n id={id}\n navigationStyle={navigationStyle}\n onAvailableColumnsChange={onAvailableColumnsChange}\n onConfigChange={onConfigChange}\n onDataEdited={onDataEdited}\n onDragStart={onDragStart}\n onDrop={onDrop}\n onHighlight={onHighlight}\n onRowClick={onRowClick}\n onSelect={onSelect}\n onSelectCellBlock={onSelectCellBlock}\n onSelectionChange={onSelectionChange}\n renderBufferSize={\n showPaginationControls ? 0 : Math.max(5, renderBufferSize ?? 0)\n }\n revealSelected={revealSelected}\n rowActionHandlers={rowActionHandlers}\n rowHeight={rowHeight}\n rowToObject={rowToObject}\n scrollingApiRef={scrollingApiRef}\n lowerCaseSearchPattern={lowerCase(searchPattern)}\n selectionBookendWidth={selectionBookendWidth}\n selectionModel={selectionModel}\n showColumnHeaders={showColumnHeaders}\n showColumnHeaderMenus={showColumnHeaderMenus}\n showPaginationControls={showPaginationControls}\n size={reduceSizeHeight(size, footerHeight)}\n />\n ) : null}\n {showPaginationControls ? (\n <div className={`${classBase}-footer`} ref={footerRef}>\n <PaginationControl dataSource={dataSource} />\n </div>\n ) : null}\n </MeasuredContainer>\n </ContextPanelProvider>\n );\n});\n"],"names":["metadataKeys","Row","DefaultRow","useId","useTable","jsxs","TableProvider","jsx","TableHeader","data","forwardRef","Table","useWindow","useComponentCssInjection","tableCss","useRef","useState","useMeasuredHeight","useCallback","size","useMemo","ContextPanelProvider","MeasuredContainer","useForkRef","RowProxy","lowerCase","reduceSizeHeight","PaginationControl"],"mappings":";;;;;;;;;;;;;;;;;;;AA0DA,MAAM,SAAY,GAAA,UAAA;AAElB,MAAM,EAAE,GAAK,EAAA,UAAA,EAAe,GAAAA,qBAAA;AA8N5B,MAAM,YAAY,CAAC;AAAA,EACjB,YAAA;AAAA,OACAC,KAAM,GAAAC,OAAA;AAAA,EACN,uBAAA;AAAA,EACA,qBAAwB,GAAA,IAAA;AAAA,EACxB,aAAA;AAAA,EACA,cAAA;AAAA,EACA,sBAAA;AAAA,EACA,kBAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAe,GAAA,KAAA;AAAA,EACf,iBAAA;AAAA,EACA,gBAAkB,EAAA,oBAAA;AAAA,EAClB,EAAI,EAAA,MAAA;AAAA,EACJ,sBAAA;AAAA,EACA,eAAkB,GAAA,MAAA;AAAA,EAClB,wBAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAc,EAAA,gBAAA;AAAA,EACd,WAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAY,EAAA,cAAA;AAAA,EACZ,QAAA;AAAA,EACA,iBAA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A,qBAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,sBAAA;AAAA,YACA,kBAAA;AAAA,YACA,gBAAA;AAAA,YACA,gBAAA;AAAA,YACA,MAAA;AAAA,YACA,YAAA;AAAA,YACA,YAAA;AAAA,YACA,UAAA;AAAA,YACA,YAAA;AAAA,YACA,iBAAA;AAAA,YACA,gBAAA;AAAA,YACA,EAAA;AAAA,YACA,eAAA;AAAA,YACA,wBAAA;AAAA,YACA,cAAA;AAAA,YACA,YAAA;AAAA,YACA,WAAA;AAAA,YACA,MAAA;AAAA,YACA,WAAA;AAAA,YACA,UAAA;AAAA,YACA,QAAA;AAAA,YACA,iBAAA;AAAA,YACA,iBAAA;AAAA,YACA,kBACE,sBAAyB,GAAA,CAAA,GAAI,KAAK,GAAI,CAAA,CAAA,EAAG,oBAAoB,CAAC,CAAA;AAAA,YAEhE,cAAA;AAAA,YACA,iBAAA;AAAA,YACA,SAAA;AAAA,YACA,WAAA;AAAA,YACA,eAAA;AAAA,YACA,sBAAA,EAAwBwB,mBAAU,aAAa,CAAA;AAAA,YAC/C,qBAAA;AAAA,YACA,cAAA;AAAA,YACA,iBAAA;AAAA,YACA,qBAAA;AAAA,YACA,sBAAA;AAAA,YACA,IAAA,EAAMC,8BAAiB,CAAA,IAAA,EAAM,YAAY;AAAA;AAAA,SAEzC,GAAA,IAAA;AAAA,QACH,sBACC,mBAAAnB,cAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,CAAG,EAAA,SAAS,CAAW,OAAA,CAAA,EAAA,GAAA,EAAK,SAC1C,EAAA,QAAA,kBAAAA,cAAA,CAACoB,mCAAkB,EAAA,EAAA,UAAA,EAAwB,GAC7C,CACE,GAAA;AAAA;AAAA;AAAA,GAER,EAAA,CAAA;AAEJ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Table.js","sources":["../../../packages/vuu-table/src/Table.tsx"],"sourcesContent":["import { useForkRef } from \"@salt-ds/core\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport type { DataSource, SchemaColumn } from \"@vuu-ui/vuu-data-types\";\nimport { TableProvider } from \"@vuu-ui/vuu-table-extras\";\nimport {\n CustomHeader,\n DataCellEditNotification,\n GroupToggleTarget,\n RowActionHandler,\n RowProps,\n SelectionChangeHandler,\n ShowColumnHeaderMenus,\n TableConfig,\n TableConfigChangeHandler,\n TableRowClickHandler,\n TableRowSelectHandler,\n TableSelectionModel,\n} from \"@vuu-ui/vuu-table-types\";\nimport type { DragDropState } from \"@vuu-ui/vuu-ui-controls\";\nimport {\n ContextPanelProvider,\n DragStartHandler,\n MeasuredContainer,\n MeasuredContainerProps,\n MeasuredSize,\n dragStrategy,\n reduceSizeHeight,\n} from \"@vuu-ui/vuu-ui-controls\";\nimport {\n RowToObjectMapper,\n lowerCase,\n metadataKeys,\n useId,\n} from \"@vuu-ui/vuu-utils\";\nimport cx from \"clsx\";\nimport {\n CSSProperties,\n ComponentType,\n FC,\n ForwardedRef,\n RefObject,\n forwardRef,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { Row as DefaultRow, RowProxy } from \"./Row\";\nimport { TableCellBlock } from \"./cell-block/cellblock-utils\";\nimport { PaginationControl } from \"./pagination\";\nimport { TableHeader } from \"./table-header\";\nimport { useMeasuredHeight } from \"./useMeasuredHeight\";\nimport { useTable } from \"./useTable\";\nimport { ScrollingAPI } from \"./useTableScroll\";\n\nimport tableCss from \"./Table.css\";\n\nconst classBase = \"vuuTable\";\n\nconst { IDX, RENDER_IDX } = metadataKeys;\n\nexport type TableNavigationStyle = \"none\" | \"cell\" | \"row\" | \"tree\";\n\nexport interface TableProps\n extends Omit<\n MeasuredContainerProps,\n \"onDragStart\" | \"onDrop\" | \"onSelect\" | \"searchPattern\"\n > {\n /**\n * A react function component that will be rendered if there are no rows to display\n */\n EmptyDisplay?: ComponentType;\n Row?: FC<RowProps>;\n /**\n * Allow a block of cells to be selected. Typically to be copied.\n */\n allowCellBlockSelection?: boolean;\n /**\n * Allow column headers to be dragged to re-arrange\n */\n allowDragColumnHeader?: boolean;\n /**\n * Allow rows to be draggable\n */\n allowDragDrop?: boolean | dragStrategy;\n\n /**\n * Allow all rows be selected, use with checkbox coliumn.\n */\n allowSelectAll?: boolean;\n\n /**\n * If checkbox selection is in effect, can user select row by clicking row. If\n * false, checkbox must be clicked explicitly.\n */\n allowSelectCheckboxRow?: boolean;\n /**\n * if provided, first row of table will be selected on initial render.\n */\n autoSelectFirstRow?: true;\n /**\n * if provided, row with matching key will be selected. If not present, will silently fail.\n */\n autoSelectRowKey?: string;\n /**\n * required if a fully featured column picker is to be available\n */\n availableColumns?: SchemaColumn[];\n\n /**\n * Provide configuration settings for Table. At minimun, column\n * descriptors must be provided.\n */\n config: TableConfig;\n dataSource: DataSource;\n\n disableFocus?: boolean;\n /**\n * Allows additional custom element(s) to be embedded immediately below column headers.\n * Could be used to present inline filters for example.\n * Accepts either a React Element or a Function Component or an array of these. If a React\n * Function Component is used, it will be passed the props described in BaseRowProps.\n */\n customHeader?: CustomHeader | CustomHeader[];\n /**\n * When rows are grouped, user can click group row(s) to expand/collapse display of child rows.\n * This allows precise configuration of where user may click to trigger toggle/collapse. When\n * row selection is also supported, clicking outside the region specified here will select or\n * deselect the row.\n * - toggle-icon - the small toggle icon must be clicked directly\n * - group-column (default) - user can click anywhere within the group column, i.e on the icon or the column text\n */\n groupToggleTarget?: GroupToggleTarget;\n /**\n * Defined how focus navigation within data cells will be handled by table.\n * Default is cell.\n */\n highlightedIndex?: number;\n\n /**\n * Behaves in most respects like viewportRowLimit except that, when there are fewer\n * rows available than the limit set here, the Table height will reduce. This can be\n * useful where a Table is used in a dropdown control.\n */\n maxViewportRowLimit?: number;\n\n /**\n * Determines bahaviour of keyboard navigation , either row focused or cell focused.\n * `tree` is a specialised navigation behaviour only useful where table is being\n * used to present purely grouped data (see TreeTable)\n */\n navigationStyle?: TableNavigationStyle;\n /**\n * required if a fully featured column picker is to be available.\n * Available columns can be changed by the addition or removal of\n * one or more calculated columns.\n */\n onAvailableColumnsChange?: (columns: SchemaColumn[]) => void;\n /**\n * This callback will be invoked any time a config attribute of TableConfig\n * is changed. By persisting this value and providing it to the Table as a\n * prop, table state can be persisted across sessions.\n */\n onConfigChange?: TableConfigChangeHandler;\n\n /**\n * In a Table with editable cells, this callback will be invoked every time\n * a user performs any edit operation on an editable field.\n */\n onDataEdited?: DataCellEditNotification;\n\n onDragStart?: DragStartHandler;\n onDrop?: (dragDropState: DragDropState) => void;\n\n onHighlight?: (idx: number) => void;\n /**\n * callback invoked when user 'clicks' a table row. CLick triggered either\n * via mouse click or keyboard (default ENTER);\n */\n onRowClick?: TableRowClickHandler;\n onSelect?: TableRowSelectHandler;\n /**\n * Triggered when a block of cells is selected. CellBlock selection can be\n * effected with either mouse or keyboard.\n * - mouse: hold down mouse and drag over selection area\n * - keyboard: press and hold shift key from start cell, then use arrow keys\n * to extend selection block.\n *\n * This callback is invoked when mouse is released or shift key released.\n */\n onSelectCellBlock?: (cellBlock: TableCellBlock) => void;\n\n onSelectionChange?: SelectionChangeHandler;\n renderBufferSize?: number;\n\n /**\n * Provide functionality for custom row actions. e.g. buttons embedded within row cells.\n * These will be available to any custom renderers via TableContext. e.g. a Row may\n * provide a 'Delete' or 'Cancel' button. Implement this functionality in a rowActionHandler.\n */\n rowActionHandlers?: Record<string, RowActionHandler>;\n\n /**\n * Allows opt-in to a predefined style pattern that renders a border around a row selection block.\n */\n rowSelectionBorder?: boolean;\n /**\n * When a row is selected and onSelect provided, onSelect will be invoked with a\n * DataSourceRowObject, derived from the internal representation of a data row,\n * DataSourceRow. The data attribute of DataSourceRowObject is a simple map of\n * column.name : value.\n * This prop allows a custom function to be provided to make the conversion from\n * DataSourceRow to DataSourceRowObject. It will very rarely be needed. It is\n * used by the Treetable.\n */\n rowToObject?: RowToObjectMapper;\n\n /**\n * Only applicable to grouped data. If there are selected rows which are not top-level\n * items and group items above are not already expanded, expand all group items in\n * the hierarchy above selected item. Selected items will thus always be visible, initially.\n * This affects items set at load time via autoSelectRowKey as well as items\n * selected programatically (ie not directly by user).\n * Nodes can of course be collapsed by user at runtime which may hide selected rows.\n * Note: this is not supported by all DataSource implementations\n */\n revealSelected?: boolean;\n /**\n * Pixel height of rows. If specified here, this will take precedence over CSS\n * values and Table will not respond to density changes.\n */\n rowHeight?: number;\n /**\n * imperative API for scrolling table\n */\n scrollingApiRef?: ForwardedRef<ScrollingAPI>;\n\n /**\n * If a search has been applied against data, this is the search text used.\n * Will be used to highlight matching text.\n */\n searchPattern?: string;\n /**\n * Selection behaviour for Table:\n * `none` selection disabled\n * `single` no more than one row may be selected\n * `single-no-deselect` no more than one row may be selected, one row is always selected, defaults to first visible\n * `extended` (default) multiple rows can be selected\n * `checkbox` same behaviour as extended, with checkbox column for selection\n */\n selectionModel?: TableSelectionModel;\n /**\n * if false, table rendered without headers. Useful when table is being included in a\n * composite component.\n */\n showColumnHeaders?: boolean;\n /**\n * if false, column headers will not display menu icon. If true, all available Column Menu\n * actions will be available via the menu. Alternatively, a map of specific column menu\n * permissions can be provided to allow control over which menu items are presented.\n */\n showColumnHeaderMenus?: ShowColumnHeaderMenus;\n /**\n * if true, pagination will be used to navigate data, scrollbars will not be rendered\n */\n showPaginationControls?: boolean;\n\n /**\n * As an alternative to sizing the Table height via CSS or via an explicit height value,\n * specify the number of rows to be displayed within the Viewport. The actual height\n * will then be the product of viewportRowLimit and rowHeight. Row Height will be\n * determined in the usual way, it can be specified explicitly in a prop or set via\n * CSS. If both explicit height and viewportRowLimit are provided by props, rowHeight\n * will be derived from these. Do not pass props for all three values - height,\n * rowHeight and viewportRowLimit. That will be rejected.\n * Use maxViewportRowLimit rather than viewportRowLimit if the height of the table\n * should be reduced when fewer rows are actually available than the limit specified.\n */\n viewportRowLimit?: number;\n}\n\nconst TableCore = ({\n EmptyDisplay,\n Row = DefaultRow,\n allowCellBlockSelection,\n allowDragColumnHeader = true,\n allowDragDrop,\n allowSelectAll,\n allowSelectCheckboxRow,\n autoSelectFirstRow,\n autoSelectRowKey,\n availableColumns,\n config,\n containerRef,\n customHeader,\n dataSource,\n disableFocus = false,\n groupToggleTarget,\n highlightedIndex: highlightedIndexProp,\n id: idProp,\n lowerCaseSearchPattern,\n navigationStyle = \"cell\",\n onAvailableColumnsChange,\n onConfigChange,\n onDataEdited: onDataEditedProp,\n onDragStart,\n onDrop,\n onHighlight,\n onRowClick: onRowClickProp,\n onSelect,\n onSelectCellBlock,\n onSelectionChange,\n renderBufferSize = 0,\n revealSelected,\n rowActionHandlers,\n rowHeight,\n rowToObject,\n scrollingApiRef,\n selectionModel = \"extended\",\n showColumnHeaders = true,\n showColumnHeaderMenus = true,\n showPaginationControls,\n size,\n}: Omit<\n TableProps,\n | \"maxViewportRowLimit\"\n | \"resizeStrategy\"\n | \"rowHeight\"\n | \"rowSelectionStyle\"\n | \"searchPattern\"\n | \"viewportRowLimit\"\n> & {\n containerRef: RefObject<HTMLDivElement | null>;\n /**\n * We lowercase this once, on entry, which is the format in which it will be used.\n */\n lowerCaseSearchPattern: Lowercase<string>;\n rowHeight: number;\n size: MeasuredSize;\n}) => {\n const id = useId(idProp);\n const {\n allRowsSelected,\n cellBlock,\n columnMap,\n columns,\n data,\n draggableRow,\n focusCellPlaceholderKeyDown,\n focusCellPlaceholderRef,\n getRowOffset,\n handleColumnAction,\n headerState: { height: headerHeight, count: headerCount },\n headings,\n highlightedIndex,\n onCheckBoxColumnHeaderClick,\n onDataEdited,\n onHeaderHeightMeasured,\n onMoveColumn,\n onMoveGroupColumn,\n onRemoveGroupColumn,\n onResizeColumn,\n onRowClick,\n onSortColumn,\n onToggleGroup,\n rowClassNameGenerator,\n scrollProps,\n tableAttributes,\n tableBodyRef,\n tableConfig,\n viewportMeasurements,\n ...tableProps\n } = useTable({\n allowCellBlockSelection,\n allowDragDrop,\n allowSelectCheckboxRow,\n autoSelectFirstRow,\n autoSelectRowKey,\n availableColumns,\n config,\n containerRef,\n dataSource,\n disableFocus,\n highlightedIndex: highlightedIndexProp,\n id,\n navigationStyle,\n onAvailableColumnsChange,\n onConfigChange,\n onDataEdited: onDataEditedProp,\n onDragStart,\n onDrop,\n onHighlight,\n onRowClick: onRowClickProp,\n onSelect,\n onSelectCellBlock,\n onSelectionChange,\n renderBufferSize,\n revealSelected,\n rowHeight,\n rowToObject,\n scrollingApiRef,\n selectionModel,\n showColumnHeaders,\n showColumnHeaderMenus,\n showPaginationControls,\n size,\n });\n\n const { selectionBookendWidth = 4 } = config;\n\n const contentContainerClassName = cx(`${classBase}-contentContainer`, {\n [`${classBase}-colLines`]: tableAttributes.columnSeparators,\n [`${classBase}-rowLines`]: tableAttributes.rowSeparators,\n [`${classBase}-zebra`]: tableAttributes.zebraStripes,\n });\n\n const cssScrollbarSize = {\n \"--horizontal-scrollbar-height\": `${viewportMeasurements.horizontalScrollbarHeight}px`,\n \"--vertical-scrollbar-width\": `${viewportMeasurements.verticalScrollbarWidth}px`,\n } as CSSProperties;\n\n const cssVariables = {\n ...cssScrollbarSize,\n \"--content-height\": `${viewportMeasurements.contentHeight}px`,\n \"--content-width\": `${viewportMeasurements.contentWidth}px`,\n \"--pinned-width-left\": `${viewportMeasurements.pinnedWidthLeft}px`,\n \"--pinned-width-right\": `${viewportMeasurements.pinnedWidthRight}px`,\n \"--total-header-height\": `${headerHeight}px`,\n \"--viewport-body-height\": `${viewportMeasurements.viewportBodyHeight}px`,\n \"--table-selection-bookend-width\": `${selectionBookendWidth}px`,\n } as CSSProperties;\n\n const headersReady = showColumnHeaders === false || headerHeight > 0;\n const readyToRenderTableBody = headersReady && data.length > 0;\n\n return (\n <TableProvider\n dataSource={dataSource}\n menuActionHandler={handleColumnAction}\n rowActionHandlers={rowActionHandlers}\n >\n {showPaginationControls !== true ? (\n <div\n className={`${classBase}-scrollbarContainer`}\n ref={scrollProps.scrollbarContainerRef}\n style={cssVariables}\n tabIndex={-1}\n >\n <div className={`${classBase}-scrollbarContent`} />\n </div>\n ) : null}\n\n {dataSource.size === 0 && EmptyDisplay ? (\n <div className={`${classBase}-emptyDisplay`}>\n <EmptyDisplay />{\" \"}\n </div>\n ) : null}\n\n <div\n className={contentContainerClassName}\n ref={scrollProps.contentContainerRef}\n style={cssVariables}\n >\n <div\n {...tableProps}\n className={`${classBase}-table`}\n role=\"table\"\n tabIndex={disableFocus ? undefined : -1}\n >\n {showColumnHeaders ? (\n <TableHeader\n allowDragColumnHeader={allowDragColumnHeader}\n allowSelectAll={allowSelectAll}\n allRowsSelected={allRowsSelected}\n // columns={scrollProps.columnsWithinViewport}\n columns={columns}\n customHeader={customHeader}\n headings={headings}\n onCheckBoxColumnHeaderClick={onCheckBoxColumnHeaderClick}\n onHeightMeasured={onHeaderHeightMeasured}\n onMoveColumn={onMoveColumn}\n onMoveGroupColumn={onMoveGroupColumn}\n onRemoveGroupColumn={onRemoveGroupColumn}\n onResizeColumn={onResizeColumn}\n onSortColumn={onSortColumn}\n showBookends={selectionBookendWidth > 0}\n showColumnHeaderMenus={showColumnHeaderMenus}\n tableConfig={tableConfig}\n tableId={id}\n virtualColSpan={scrollProps.virtualColSpan}\n />\n ) : null}\n {readyToRenderTableBody ? (\n <div className={`${classBase}-body`} ref={tableBodyRef}>\n {data.map((data) => {\n const ariaRowIndex = data[IDX] + headerCount + 1;\n return (\n <Row\n aria-rowindex={ariaRowIndex}\n classNameGenerator={rowClassNameGenerator}\n columnMap={columnMap}\n columns={scrollProps.columnsWithinViewport}\n groupToggleTarget={groupToggleTarget}\n highlighted={highlightedIndex === ariaRowIndex}\n key={data[RENDER_IDX]}\n onClick={onRowClick}\n onDataEdited={onDataEdited}\n row={data}\n offset={showPaginationControls ? 0 : getRowOffset(data)}\n onToggleGroup={onToggleGroup}\n showBookends={selectionBookendWidth > 0}\n searchPattern={lowerCaseSearchPattern}\n virtualColSpan={scrollProps.virtualColSpan}\n zebraStripes={tableAttributes.zebraStripes}\n />\n );\n })}\n {/* \n The focusCellPlaceholder allows us to deal with the situation where a cell \n that has focus is scrolled out of the viewport. That cell, along with the \n containing row, will be recycled to render another DataRow. The html table \n cell must not retain focus once it is re-used but we need to track the \n original focus, in case user uses arrow key to resume navigation. \n The placeholder is fixed in place at the location where the focused cell \n was last rendered. It assumes focus. If we get an arrowkey mousedown event \n on the placeholder, the user has resumed navigation whilst the focused cell \n is offscreen. We scroll back to the focus location and pass focus back to \n the correct target cell.\n */}\n <div\n aria-hidden={true}\n className={`${classBase}-focusCellPlaceholder`}\n onKeyDown={focusCellPlaceholderKeyDown}\n ref={focusCellPlaceholderRef}\n tabIndex={-1}\n />\n\n {cellBlock}\n </div>\n ) : null}\n </div>\n </div>\n {/* \n This keeps the heights of content container and scrollbar container aligned for\n cases where we rely on height: fit-content. (ScrollbarContainer isn't taken into \n account because its absolutely positioned).\n */}\n <div\n className={`${classBase}-scrollbarFiller`}\n style={cssScrollbarSize}\n />\n {draggableRow}\n </TableProvider>\n );\n};\n\nexport const Table = forwardRef(function Table(\n {\n EmptyDisplay,\n Row,\n allowCellBlockSelection,\n allowDragColumnHeader,\n allowDragDrop,\n availableColumns,\n allowSelectAll,\n allowSelectCheckboxRow,\n autoSelectFirstRow,\n autoSelectRowKey,\n className: classNameProp,\n config,\n customHeader,\n dataSource,\n disableFocus,\n groupToggleTarget,\n height,\n highlightedIndex,\n id,\n maxViewportRowLimit,\n navigationStyle,\n onAvailableColumnsChange,\n onConfigChange,\n onDataEdited,\n onDragStart,\n onDrop,\n onHighlight,\n onRowClick,\n onSelect,\n onSelectCellBlock,\n onSelectionChange,\n renderBufferSize,\n revealSelected,\n resizeStrategy,\n rowActionHandlers,\n rowHeight: rowHeightProp,\n rowSelectionBorder,\n rowToObject,\n scrollingApiRef,\n searchPattern = \"\",\n selectionModel,\n showColumnHeaders,\n showColumnHeaderMenus,\n showPaginationControls,\n style: styleProp,\n viewportRowLimit,\n width,\n ...htmlAttributes\n }: TableProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-table\",\n css: tableCss,\n window: targetWindow,\n });\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n const [size, _setSize] = useState<MeasuredSize>();\n // TODO this will rerender entire table, move footer into seperate component\n const { measuredHeight: rowHeight, measuredRef: rowRef } = useMeasuredHeight({\n height: rowHeightProp,\n });\n\n console.log(`measured row height = ${rowHeight}`);\n\n const { measuredHeight: footerHeight, measuredRef: footerRef } =\n useMeasuredHeight({});\n\n const rowLimit = maxViewportRowLimit ?? viewportRowLimit;\n\n if (config === undefined) {\n throw Error(\n \"vuu Table requires config prop. Minimum config is list of Column Descriptors\",\n );\n }\n if (dataSource === undefined) {\n throw Error(\"vuu Table requires dataSource prop\");\n }\n\n if (showPaginationControls && renderBufferSize !== undefined) {\n console.warn(\n `Table: When pagination controls are used, renderBufferSize is ignored`,\n );\n }\n\n if (rowLimit && height && rowHeightProp) {\n console.warn(\n `Table: when viewportRowLimit, rowHeight and height are used in combination, height is ignored`,\n );\n height = rowLimit * rowHeightProp;\n } else if (rowLimit && rowHeightProp) {\n height = rowLimit * rowHeightProp;\n } else if (rowLimit) {\n height = rowLimit * rowHeight;\n }\n\n const sizeRef = useRef<MeasuredSize>(undefined);\n const setSize = useCallback(\n (size: MeasuredSize) => {\n if (viewportRowLimit && !rowHeight) {\n sizeRef.current = size;\n } else if (\n size.height !== sizeRef.current?.height ||\n size.width !== sizeRef.current?.width\n ) {\n _setSize(size);\n }\n },\n [rowHeight, viewportRowLimit],\n );\n useMemo(() => {\n if (sizeRef.current && rowHeight) {\n const size = {\n ...sizeRef.current,\n height: rowHeight * (viewportRowLimit as number),\n };\n sizeRef.current = size;\n _setSize(size);\n }\n }, [rowHeight, viewportRowLimit]);\n\n console.log(`[Table] rowHeightProp ${rowHeightProp} rowHeight: ${rowHeight}`);\n\n // TODO render TableHeader here and measure before row construction begins\n // TODO we could have MeasuredContainer render a Provider and make size available via a context hook ?\n return (\n <ContextPanelProvider>\n <MeasuredContainer\n {...htmlAttributes}\n className={cx(classBase, classNameProp, {\n [`${classBase}-pagination`]: showPaginationControls,\n [`${classBase}-rowSelection-bordered`]: rowSelectionBorder,\n [`${classBase}-maxViewportRowLimit`]: maxViewportRowLimit,\n [`${classBase}-viewportRowLimit`]: viewportRowLimit,\n })}\n height={height}\n id={id}\n onResize={setSize}\n ref={useForkRef(containerRef, forwardedRef)}\n resizeStrategy={resizeStrategy}\n style={\n {\n ...styleProp,\n \"--row-height-prop\":\n typeof rowHeightProp === \"number\"\n ? `${rowHeightProp}px`\n : undefined,\n } as CSSProperties\n }\n width={width}\n >\n <RowProxy ref={rowRef} height={rowHeightProp} />\n {size &&\n rowHeight &&\n (footerHeight || showPaginationControls !== true) ? (\n <TableCore\n EmptyDisplay={EmptyDisplay}\n Row={Row}\n allowCellBlockSelection={allowCellBlockSelection}\n allowDragColumnHeader={allowDragColumnHeader}\n allowDragDrop={allowDragDrop}\n allowSelectAll={allowSelectAll}\n allowSelectCheckboxRow={allowSelectCheckboxRow}\n autoSelectFirstRow={autoSelectFirstRow}\n autoSelectRowKey={autoSelectRowKey}\n availableColumns={availableColumns}\n config={config}\n containerRef={containerRef}\n customHeader={customHeader}\n dataSource={dataSource}\n disableFocus={disableFocus}\n groupToggleTarget={groupToggleTarget}\n highlightedIndex={highlightedIndex}\n id={id}\n navigationStyle={navigationStyle}\n onAvailableColumnsChange={onAvailableColumnsChange}\n onConfigChange={onConfigChange}\n onDataEdited={onDataEdited}\n onDragStart={onDragStart}\n onDrop={onDrop}\n onHighlight={onHighlight}\n onRowClick={onRowClick}\n onSelect={onSelect}\n onSelectCellBlock={onSelectCellBlock}\n onSelectionChange={onSelectionChange}\n renderBufferSize={\n showPaginationControls ? 0 : Math.max(5, renderBufferSize ?? 0)\n }\n revealSelected={revealSelected}\n rowActionHandlers={rowActionHandlers}\n rowHeight={rowHeight}\n rowToObject={rowToObject}\n scrollingApiRef={scrollingApiRef}\n lowerCaseSearchPattern={lowerCase(searchPattern)}\n selectionModel={selectionModel}\n showColumnHeaders={showColumnHeaders}\n showColumnHeaderMenus={showColumnHeaderMenus}\n showPaginationControls={showPaginationControls}\n size={reduceSizeHeight(size, footerHeight)}\n />\n ) : null}\n {showPaginationControls ? (\n <div className={`${classBase}-footer`} ref={footerRef}>\n <PaginationControl dataSource={dataSource} />\n </div>\n ) : null}\n </MeasuredContainer>\n </ContextPanelProvider>\n );\n});\n"],"names":["metadataKeys","Row","DefaultRow","useId","useTable","jsxs","TableProvider","jsx","TableHeader","data","forwardRef","Table","useWindow","useComponentCssInjection","tableCss","useRef","useState","useMeasuredHeight","useCallback","size","useMemo","ContextPanelProvider","MeasuredContainer","useForkRef","RowProxy","lowerCase","reduceSizeHeight","PaginationControl"],"mappings":";;;;;;;;;;;;;;;;;;;AA0DA,MAAM,SAAY,GAAA,UAAA;AAElB,MAAM,EAAE,GAAK,EAAA,UAAA,EAAe,GAAAA,qBAAA;AA8N5B,MAAM,YAAY,CAAC;AAAA,EACjB,YAAA;AAAA,OACAC,KAAM,GAAAC,OAAA;AAAA,EACN,uBAAA;AAAA,EACA,qBAAwB,GAAA,IAAA;AAAA,EACxB,aAAA;AAAA,EACA,cAAA;AAAA,EACA,sBAAA;AAAA,EACA,kBAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAe,GAAA,KAAA;AAAA,EACf,iBAAA;AAAA,EACA,gBAAkB,EAAA,oBAAA;AAAA,EAClB,EAAI,EAAA,MAAA;AAAA,EACJ,sBAAA;AAAA,EACA,eAAkB,GAAA,MAAA;AAAA,EAClB,wBAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAc,EAAA,gBAAA;AAAA,EACd,WAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAY,EAAA,cAAA;AAAA,EACZ,QAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,g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AA,SAAS,CAAW,OAAA,CAAA,EAAA,GAAA,EAAK,SAC1C,EAAA,QAAA,kBAAAA,cAAA,CAACoB,mCAAkB,EAAA,EAAA,UAAA,EAAwB,GAC7C,CACE,GAAA;AAAA;AAAA;AAAA,GAER,EAAA,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -32,10 +32,10 @@ const setElementBox = (el, box) => {
|
|
|
32
32
|
box.top = top;
|
|
33
33
|
};
|
|
34
34
|
const outsideBox = ({ bottom, left, right, top }, x, y) => x < left || x > right || y < top || y > bottom;
|
|
35
|
-
const getRowIndex = (cell) =>
|
|
35
|
+
const getRowIndex = (cell) => vuuUtils.getAriaRowIndex(vuuUtils.queryClosest(cell, ".vuuTableRow"));
|
|
36
36
|
const getTableCellBlock = (startCell, endCell) => {
|
|
37
|
-
const colStart =
|
|
38
|
-
const colEnd =
|
|
37
|
+
const colStart = vuuUtils.getAriaColIndex(startCell);
|
|
38
|
+
const colEnd = vuuUtils.getAriaColIndex(endCell);
|
|
39
39
|
const rowStart = getRowIndex(startCell);
|
|
40
40
|
const rowEnd = getRowIndex(endCell);
|
|
41
41
|
const columnRange = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cellblock-utils.js","sources":["../../../../packages/vuu-table/src/cell-block/cellblock-utils.ts"],"sourcesContent":["import { VuuRange } from \"@vuu-ui/vuu-protocol-types\";\nimport {
|
|
1
|
+
{"version":3,"file":"cellblock-utils.js","sources":["../../../../packages/vuu-table/src/cell-block/cellblock-utils.ts"],"sourcesContent":["import { VuuRange } from \"@vuu-ui/vuu-protocol-types\";\nimport {\n queryClosest,\n getAriaColIndex,\n getAriaRowIndex,\n} from \"@vuu-ui/vuu-utils\";\nimport { getAriaCellPos } from \"../table-dom-utils\";\n\nexport type TableCellBlock = {\n columnRange: VuuRange;\n rowRange: VuuRange;\n};\n\nexport type CellBox = {\n bottom: number;\n left: number;\n right: number;\n top: number;\n};\n\nexport const isNullCellBox = ({ bottom, left, right, top }: CellBox) => {\n return bottom === -1 && left === -1 && right === -1 && top === -1;\n};\n\nconst Hi = Number.MAX_SAFE_INTEGER;\n\ntype EndCellDirection =\n | \"self\"\n | \"n\"\n | \"ne\"\n | \"e\"\n | \"se\"\n | \"s\"\n | \"sw\"\n | \"w\"\n | \"nw\";\n\nexport const getEndCellDirection = (\n startBox: CellBox,\n endBox: CellBox,\n): EndCellDirection => {\n const { bottom: sBottom, left: sLeft, right: sRight, top: sTop } = startBox;\n const { bottom: eBottom, left: eLeft, right: eRight, top: eTop } = endBox;\n const north = eTop < sTop;\n const east = eRight > sRight;\n const south = eBottom > sBottom;\n const west = eLeft < sLeft;\n\n if (north && east) return \"ne\";\n else if (south && east) return \"se\";\n else if (south && west) return \"sw\";\n else if (north && west) return \"nw\";\n else if (north) return \"n\";\n else if (east) return \"e\";\n else if (south) return \"s\";\n else if (west) return \"w\";\n else return \"self\";\n};\n\nexport const setElementBox = (el: HTMLElement, box: CellBox) => {\n const { bottom, left, right, top } = el.getBoundingClientRect();\n box.bottom = bottom;\n box.left = left;\n box.right = right;\n box.top = top;\n};\n\nexport const outsideBox = (\n { bottom, left, right, top }: CellBox,\n x: number,\n y: number,\n) => x < left || x > right || y < top || y > bottom;\n\nconst getRowIndex = (cell: HTMLDivElement) =>\n getAriaRowIndex(queryClosest<HTMLDivElement>(cell, \".vuuTableRow\"));\n\nexport const getTableCellBlock = (\n startCell: HTMLDivElement,\n endCell: HTMLDivElement,\n): TableCellBlock => {\n const colStart = getAriaColIndex(startCell);\n const colEnd = getAriaColIndex(endCell);\n const rowStart = getRowIndex(startCell);\n const rowEnd = getRowIndex(endCell);\n\n const columnRange = {\n from: Math.min(colStart, colEnd),\n to: Math.max(colStart, colEnd),\n };\n const rowRange = {\n from: Math.min(rowStart, rowEnd),\n to: Math.max(rowStart, rowEnd),\n };\n\n return {\n columnRange,\n rowRange,\n };\n};\n\nexport type RefState = {\n dragState: \"pending\" | \"active\";\n cellBlock: HTMLDivElement | null;\n cellBlockClassName: string;\n endBox: CellBox;\n endCell: HTMLDivElement | null;\n endPos: PosTuple; // used during keyboard operation\n mousePosX: number;\n mousePosY: number;\n mouseStartX: number;\n mouseStartY: number;\n startCell: HTMLDivElement | null;\n startBox: CellBox;\n startPos: PosTuple; // used during keyboard operation\n};\n\nexport type PosTuple = [number, number];\n\nexport const refState: RefState = {\n cellBlock: null,\n cellBlockClassName: \"\",\n dragState: \"pending\",\n endBox: { bottom: -1, left: Hi, right: -1, top: Hi },\n endCell: null,\n endPos: [-1, -1],\n mousePosX: -1,\n mousePosY: -1,\n mouseStartX: -1,\n mouseStartY: -1,\n startBox: { bottom: -1, left: -1, right: -1, top: -1 },\n startCell: null,\n startPos: [-1, -1],\n} as const;\n\nexport const updateCellBlockClassName = (state: RefState) => {\n const { cellBlock, cellBlockClassName, startBox, endBox } = state;\n const endBlockDirection = getEndCellDirection(startBox, endBox);\n const newCellBlockClassName = `cellblock-direction-${endBlockDirection}`;\n if (newCellBlockClassName !== cellBlockClassName) {\n if (cellBlockClassName) {\n cellBlock?.classList.replace(cellBlockClassName, newCellBlockClassName);\n } else {\n cellBlock?.classList.add(newCellBlockClassName);\n }\n state.cellBlockClassName = newCellBlockClassName;\n }\n};\n\nexport const getTextFromCells = (\n startCell: HTMLDivElement,\n endCell: HTMLDivElement,\n) => {\n const tableBody = queryClosest<HTMLDivElement>(\n startCell,\n \".vuuTable-body\",\n true,\n );\n const [startRow, startCol] = getAriaCellPos(startCell);\n const [endRow, endCol] = getAriaCellPos(endCell);\n\n const rowRange = {\n from: Math.min(startRow, endRow),\n to: Math.max(startRow, endRow),\n };\n\n const colRange = {\n from: Math.min(startCol, endCol),\n to: Math.max(startCol, endCol),\n };\n\n const results: string[][] = [];\n for (let rowIdx = rowRange.from; rowIdx <= rowRange.to; rowIdx++) {\n const row = tableBody.querySelector(\n `.vuuTableRow[aria-rowindex='${rowIdx}']`,\n );\n const rowData = [];\n for (let colIdx = colRange.from; colIdx <= colRange.to; colIdx++) {\n const cell = row?.querySelector(\n `.vuuTableCell[aria-colindex='${colIdx}']`,\n );\n if (cell) {\n rowData.push(cell.textContent ?? \"\");\n }\n }\n results.push(rowData);\n }\n return results.map((r) => r.join(\"\\t\")).join(\"\\n\");\n};\n"],"names":["getAriaRowIndex","queryClosest","getAriaColIndex","getAriaCellPos"],"mappings":";;;;;AAoBO,MAAM,gBAAgB,CAAC,EAAE,QAAQ,IAAM,EAAA,KAAA,EAAO,KAAmB,KAAA;AACtE,EAAA,OAAO,WAAW,CAAM,CAAA,IAAA,IAAA,KAAS,CAAM,CAAA,IAAA,KAAA,KAAU,MAAM,GAAQ,KAAA,CAAA,CAAA;AACjE;AAEA,MAAM,KAAK,MAAO,CAAA,gBAAA;AAaL,MAAA,mBAAA,GAAsB,CACjC,QAAA,EACA,MACqB,KAAA;AACrB,EAAM,MAAA,EAAE,QAAQ,OAAS,EAAA,IAAA,EAAM,OAAO,KAAO,EAAA,MAAA,EAAQ,GAAK,EAAA,IAAA,EAAS,GAAA,QAAA;AACnE,EAAM,MAAA,EAAE,QAAQ,OAAS,EAAA,IAAA,EAAM,OAAO,KAAO,EAAA,MAAA,EAAQ,GAAK,EAAA,IAAA,EAAS,GAAA,MAAA;AACnE,EAAA,MAAM,QAAQ,IAAO,GAAA,IAAA;AACrB,EAAA,MAAM,OAAO,MAAS,GAAA,MAAA;AACtB,EAAA,MAAM,QAAQ,OAAU,GAAA,OAAA;AACxB,EAAA,MAAM,OAAO,KAAQ,GAAA,KAAA;AAErB,EAAI,IAAA,KAAA,IAAS,MAAa,OAAA,IAAA;AAAA,OACjB,IAAA,KAAA,IAAS,MAAa,OAAA,IAAA;AAAA,OACtB,IAAA,KAAA,IAAS,MAAa,OAAA,IAAA;AAAA,OACtB,IAAA,KAAA,IAAS,MAAa,OAAA,IAAA;AAAA,OAAA,IACtB,OAAc,OAAA,GAAA;AAAA,OAAA,IACd,MAAa,OAAA,GAAA;AAAA,OAAA,IACb,OAAc,OAAA,GAAA;AAAA,OAAA,IAC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M,CAAA,EAAA;AAAA,OACxC;AACA,MAAA,IAAI,IAAM,EAAA;AACR,QAAQ,OAAA,CAAA,IAAA,CAAK,IAAK,CAAA,WAAA,IAAe,EAAE,CAAA;AAAA;AACrC;AAEF,IAAA,OAAA,CAAQ,KAAK,OAAO,CAAA;AAAA;AAEtB,EAAO,OAAA,OAAA,CAAQ,GAAI,CAAA,CAAC,CAAM,KAAA,CAAA,CAAE,KAAK,GAAI,CAAC,CAAE,CAAA,IAAA,CAAK,IAAI,CAAA;AACnD;;;;;;;;;;;"}
|
package/cjs/table-dom-utils.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var vuuUtils = require('@vuu-ui/vuu-utils');
|
|
4
|
+
|
|
3
5
|
const headerCellQuery = (colIdx) => `.vuuTable-col-headers .vuuTableHeaderCell[aria-colindex='${colIdx}']`;
|
|
4
6
|
const dataCellQuery = (ariaRowIdx, ariaColIdx) => `.vuuTable-table [aria-rowindex='${ariaRowIdx}'] > [aria-colindex='${ariaColIdx}']`;
|
|
5
7
|
const getLevelUp = (containerRef, cellPos) => {
|
|
@@ -63,26 +65,6 @@ const rowIsExpanded = (cell) => {
|
|
|
63
65
|
}
|
|
64
66
|
};
|
|
65
67
|
const cellIsTextInput = (cell) => cell.querySelector(".vuuTableInputCell") !== null;
|
|
66
|
-
const getAriaRowIndex = (rowElement) => {
|
|
67
|
-
const rowIndex = rowElement?.ariaRowIndex;
|
|
68
|
-
if (rowIndex != null) {
|
|
69
|
-
const index = parseInt(rowIndex);
|
|
70
|
-
if (!isNaN(index)) {
|
|
71
|
-
return index;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return -1;
|
|
75
|
-
};
|
|
76
|
-
const getAriaColIndex = (cellElement) => {
|
|
77
|
-
const colIndex = cellElement?.ariaColIndex;
|
|
78
|
-
if (colIndex != null) {
|
|
79
|
-
const index = parseInt(colIndex);
|
|
80
|
-
if (!isNaN(index)) {
|
|
81
|
-
return index;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return -1;
|
|
85
|
-
};
|
|
86
68
|
const getRowElementByAriaIndex = (container, rowIndex) => {
|
|
87
69
|
if (rowIndex === -1) {
|
|
88
70
|
return null;
|
|
@@ -101,10 +83,10 @@ const getRowElementByAriaIndex = (container, rowIndex) => {
|
|
|
101
83
|
};
|
|
102
84
|
const getAriaCellPos = (tableCell) => {
|
|
103
85
|
const focusedRow = tableCell.closest("[role='row']");
|
|
104
|
-
return [getAriaRowIndex(focusedRow), getAriaColIndex(tableCell)];
|
|
86
|
+
return [vuuUtils.getAriaRowIndex(focusedRow), vuuUtils.getAriaColIndex(tableCell)];
|
|
105
87
|
};
|
|
106
88
|
const closestRow = (el) => el.closest('[role="row"]');
|
|
107
|
-
const closestRowIndex = (el) => getAriaRowIndex(closestRow(el));
|
|
89
|
+
const closestRowIndex = (el) => vuuUtils.getAriaRowIndex(closestRow(el));
|
|
108
90
|
function getNextCellPos(key, [rowIdx, colIdx], columnCount, maxRowIndex) {
|
|
109
91
|
if (key === "ArrowUp") {
|
|
110
92
|
if (rowIdx > -1) {
|
|
@@ -188,8 +170,6 @@ exports.cellIsTextInput = cellIsTextInput;
|
|
|
188
170
|
exports.closestRowIndex = closestRowIndex;
|
|
189
171
|
exports.dataCellQuery = dataCellQuery;
|
|
190
172
|
exports.getAriaCellPos = getAriaCellPos;
|
|
191
|
-
exports.getAriaColIndex = getAriaColIndex;
|
|
192
|
-
exports.getAriaRowIndex = getAriaRowIndex;
|
|
193
173
|
exports.getFocusedCell = getFocusedCell;
|
|
194
174
|
exports.getHeaderCell = getHeaderCell;
|
|
195
175
|
exports.getLevelUp = getLevelUp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-dom-utils.js","sources":["../../../packages/vuu-table/src/table-dom-utils.ts"],"sourcesContent":["import { RefObject } from \"react\";\nimport { ScrollDirection } from \"./useTableScroll\";\nimport type { ArrowKey, PageKey } from \"@vuu-ui/vuu-utils\";\nimport type { CellPos } from \"@vuu-ui/vuu-table-types\";\n\nexport type NavigationKey = PageKey | ArrowKey;\n\nexport const headerCellQuery = (colIdx: number) =>\n `.vuuTable-col-headers .vuuTableHeaderCell[aria-colindex='${colIdx}']`;\n\nexport const dataCellQuery = (ariaRowIdx: number, ariaColIdx: number) =>\n `.vuuTable-table [aria-rowindex='${ariaRowIdx}'] > [aria-colindex='${ariaColIdx}']`;\n\nexport const getLevelUp = (\n containerRef: RefObject<HTMLElement | null>,\n cellPos: CellPos,\n): CellPos => {\n const cell = getTableCell(containerRef, cellPos);\n let row = cell?.parentElement;\n const level = parseInt(row?.ariaLevel ?? \"1\");\n if (level > 1) {\n const targetLevel = `${level - 1}`;\n while (row !== null && row.ariaLevel !== targetLevel) {\n row = row.previousElementSibling as HTMLElement;\n }\n if (row) {\n const nextRowIndex = parseInt(row.ariaRowIndex ?? \"- 1\");\n if (nextRowIndex !== -1) {\n return [nextRowIndex, 1];\n }\n }\n }\n return cellPos;\n};\nexport const getTableCell = (\n containerRef: RefObject<HTMLElement | null>,\n [rowIdx, colIdx]: CellPos,\n) => {\n const cssQuery = dataCellQuery(rowIdx, colIdx);\n const cell = containerRef.current?.querySelector(cssQuery) as HTMLDivElement;\n\n if (cellIsEditable(cell)) {\n // Dropdown gets focus, Input does not\n const focusableContent = cell.querySelector(\n `button,input[type=\"checkbox\"]`,\n ) as HTMLElement;\n return focusableContent || cell;\n } else {\n return cell;\n }\n};\n\nexport const getHeaderCell = (\n containerRef: RefObject<HTMLElement | null>,\n columnName: string,\n) =>\n containerRef.current?.querySelector(\n `.vuuTableHeaderCell[data-column-name=\"${columnName}\"]`,\n ) as HTMLDivElement | null;\n\nexport const getFocusedCell = (el: HTMLElement | Element | null) => {\n if (el?.role == \"cell\" || el?.role === \"columnheader\") {\n return el as HTMLDivElement;\n } else {\n return el?.closest(\n \"[role='columnHeader'],[role='cell']\",\n ) as HTMLDivElement | null;\n }\n};\n\nexport const cellIsEditable = (cell: HTMLDivElement | null) =>\n cell?.classList.contains(\"vuuTableCell-editable\");\n\nexport const cellDropdownShowing = (cell: HTMLDivElement | null) => {\n if (cellIsEditable(cell)) {\n return cell?.querySelector('.saltDropdown[aria-expanded=\"true\"]') !== null;\n }\n return false;\n};\n\nconst cellIsGroupCell = (cell: HTMLElement | null) =>\n cell?.classList.contains(\"vuuTableGroupCell\");\n\nconst rowIsExpanded = (cell: HTMLElement) => {\n switch (cell.parentElement?.ariaExpanded) {\n case \"true\":\n return true;\n case \"false\":\n return false;\n default:\n return undefined;\n }\n};\n\nexport const cellIsTextInput = (cell: HTMLElement) =>\n cell.querySelector(\".vuuTableInputCell\") !== null;\n\nexport const getAriaRowIndex = (rowElement: HTMLElement | null) => {\n const rowIndex = rowElement?.ariaRowIndex;\n if (rowIndex != null) {\n const index = parseInt(rowIndex);\n if (!isNaN(index)) {\n return index;\n }\n }\n return -1;\n};\n\nexport const getAriaColIndex = (cellElement: HTMLElement | null) => {\n const colIndex = cellElement?.ariaColIndex;\n if (colIndex != null) {\n const index = parseInt(colIndex);\n if (!isNaN(index)) {\n return index;\n }\n }\n return -1;\n};\n\nexport const getRowElementByAriaIndex = (\n container: HTMLDivElement | EventTarget,\n rowIndex: number,\n) => {\n if (rowIndex === -1) {\n return null;\n } else {\n const activeRow = (container as HTMLElement).querySelector(\n `[aria-rowindex=\"${rowIndex}\"]`,\n ) as HTMLElement;\n\n if (activeRow) {\n return activeRow;\n } else {\n throw Error(\n `getRowElementAtIndex no row found for index index ${rowIndex}`,\n );\n }\n }\n};\n\nexport const getIndexFromCellElement = (cellElement: HTMLElement | null) =>\n getAriaColIndex(cellElement);\n\nexport const getAriaCellPos = (tableCell: HTMLDivElement): CellPos => {\n const focusedRow = tableCell.closest(\"[role='row']\") as HTMLElement;\n return [getAriaRowIndex(focusedRow), getAriaColIndex(tableCell)];\n};\n\nconst closestRow = (el: HTMLElement) =>\n el.closest('[role=\"row\"]') as HTMLElement;\n\nexport const closestRowIndex = (el: HTMLElement) =>\n getAriaRowIndex(closestRow(el));\n\nexport function getNextCellPos(\n key: ArrowKey,\n [rowIdx, colIdx]: CellPos,\n columnCount: number,\n maxRowIndex: number,\n): CellPos {\n if (key === \"ArrowUp\") {\n if (rowIdx > -1) {\n return [rowIdx - 1, colIdx];\n } else {\n return [rowIdx, colIdx];\n }\n } else if (key === \"ArrowDown\") {\n if (rowIdx === -1) {\n return [1, colIdx];\n } else if (rowIdx === maxRowIndex) {\n return [rowIdx, colIdx];\n } else {\n return [rowIdx + 1, colIdx];\n }\n } else if (key === \"ArrowRight\") {\n if (colIdx < columnCount) {\n return [rowIdx, colIdx + 1];\n } else {\n return [rowIdx, colIdx];\n }\n } else if (key === \"ArrowLeft\") {\n if (colIdx > 1) {\n return [rowIdx, colIdx - 1];\n } else {\n return [rowIdx, colIdx];\n }\n }\n return [rowIdx, colIdx];\n}\n\nexport type TreeNodeOperation = \"expand\" | \"collapse\" | \"level-up\";\n\nexport const getTreeNodeOperation = (\n containerRef: RefObject<HTMLElement | null>,\n navigationStyle: \"cell\" | \"tree\",\n cellPos: CellPos,\n key: NavigationKey,\n shiftKey: boolean,\n): TreeNodeOperation | undefined => {\n const cell = getTableCell(containerRef, cellPos);\n if (navigationStyle === \"cell\" && !cellIsGroupCell(cell)) {\n return undefined;\n }\n if (navigationStyle == \"cell\" && !shiftKey) {\n return undefined;\n }\n if (cellIsGroupCell(cell)) {\n const isExpanded = rowIsExpanded(cell);\n if (isExpanded === true) {\n if (key === \"ArrowLeft\") {\n return \"collapse\";\n }\n } else if (isExpanded === false) {\n if (key === \"ArrowRight\") {\n return \"expand\";\n } else if (key === \"ArrowLeft\") {\n return \"level-up\";\n }\n } else if (key === \"ArrowLeft\") {\n return \"level-up\";\n }\n }\n};\n\nconst NO_SCROLL_NECESSARY = [undefined, undefined] as const;\n\nexport const howFarIsRowOutsideViewport = (\n rowEl: HTMLElement,\n totalHeaderHeight: number,\n contentContainer = rowEl.closest(\".vuuTable-contentContainer\"),\n): readonly [ScrollDirection | undefined, number | undefined] => {\n //TODO lots of scope for optimisation here\n if (contentContainer) {\n // TODO take totalHeaderHeight into consideration\n const viewport = contentContainer?.getBoundingClientRect();\n const upperBoundary = viewport.top + totalHeaderHeight;\n const row = rowEl.getBoundingClientRect();\n if (row) {\n if (row.bottom > viewport.bottom) {\n return [\"down\", row.bottom - viewport.bottom];\n } else if (row.top < upperBoundary) {\n return [\"up\", row.top - upperBoundary];\n } else {\n return NO_SCROLL_NECESSARY;\n }\n } else {\n throw Error(\"Whats going on, row not found\");\n }\n } else {\n throw Error(\"Whats going on, scrollbar container not found\");\n }\n};\n"],"names":[],"mappings":";;AAOO,MAAM,eAAkB,GAAA,CAAC,MAC9B,KAAA,CAAA,yDAAA,EAA4D,MAAM,CAAA,EAAA;AAE7D,MAAM,gBAAgB,CAAC,UAAA,EAAoB,eAChD,CAAmC,gCAAA,EAAA,UAAU,wBAAwB,UAAU,CAAA,EAAA;AAEpE,MAAA,UAAA,GAAa,CACxB,YAAA,EACA,OACY,KAAA;AACZ,EAAM,MAAA,IAAA,GAAO,YAAa,CAAA,YAAA,EAAc,OAAO,CAAA;AAC/C,EAAA,IAAI,MAAM,IAAM,EAAA,aAAA;AAChB,EAAA,MAAM,KAAQ,GAAA,QAAA,CAAS,GAAK,EAAA,SAAA,IAAa,GAAG,CAAA;AAC5C,EAAA,IAAI,QAAQ,CAAG,EAAA;AACb,IAAM,MAAA,WAAA,GAAc,CAAG,EAAA,KAAA,GAAQ,CAAC,CAAA,CAAA;AAChC,IAAA,OAAO,GAAQ,KAAA,IAAA,IAAQ,GAAI,CAAA,SAAA,KAAc,WAAa,EAAA;AACpD,MAAA,GAAA,GAAM,GAAI,CAAA,sBAAA;AAAA;AAEZ,IAAA,IAAI,GAAK,EAAA;AACP,MAAA,MAAM,YAAe,GAAA,QAAA,CAAS,GAAI,CAAA,YAAA,IAAgB,KAAK,CAAA;AACvD,MAAA,IAAI,iBAAiB,CAAI,CAAA,E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AAA,OAAA,CAAQ,4BAA4B,CACE,KAAA;AAE/D,EAAA,IAAI,gBAAkB,EAAA;AAEpB,IAAM,MAAA,QAAA,GAAW,kBAAkB,qBAAsB,EAAA;AACzD,IAAM,MAAA,aAAA,GAAgB,SAAS,GAAM,GAAA,iBAAA;AACrC,IAAM,MAAA,GAAA,GAAM,MAAM,qBAAsB,EAAA;AACxC,IAAA,IAAI,GAAK,EAAA;AACP,MAAI,IAAA,GAAA,CAAI,MAAS,GAAA,QAAA,CAAS,MAAQ,EAAA;AAChC,QAAA,OAAO,CAAC,MAAA,EAAQ,GAAI,CAAA,MAAA,GAAS,SAAS,MAAM,CAAA;AAAA,OAC9C,MAAA,IAAW,GAAI,CAAA,GAAA,GAAM,aAAe,EAAA;AAClC,QAAA,OAAO,CAAC,IAAA,EAAM,GAAI,CAAA,GAAA,GAAM,aAAa,CAAA;AAAA,OAChC,MAAA;AACL,QAAO,OAAA,mBAAA;AAAA;AACT,KACK,MAAA;AACL,MAAA,MAAM,MAAM,+BAA+B,CAAA;AAAA;AAC7C,GACK,MAAA;AACL,IAAA,MAAM,MAAM,+CAA+C,CAAA;AAAA;AAE/D;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"table-dom-utils.js","sources":["../../../packages/vuu-table/src/table-dom-utils.ts"],"sourcesContent":["import { RefObject } from \"react\";\nimport { ScrollDirection } from \"./useTableScroll\";\nimport {\n getAriaColIndex,\n getAriaRowIndex,\n type ArrowKey,\n type PageKey,\n} from \"@vuu-ui/vuu-utils\";\nimport type { CellPos } from \"@vuu-ui/vuu-table-types\";\n\nexport type NavigationKey = PageKey | ArrowKey;\n\nexport const headerCellQuery = (colIdx: number) =>\n `.vuuTable-col-headers .vuuTableHeaderCell[aria-colindex='${colIdx}']`;\n\nexport const dataCellQuery = (ariaRowIdx: number, ariaColIdx: number) =>\n `.vuuTable-table [aria-rowindex='${ariaRowIdx}'] > [aria-colindex='${ariaColIdx}']`;\n\nexport const getLevelUp = (\n containerRef: RefObject<HTMLElement | null>,\n cellPos: CellPos,\n): CellPos => {\n const cell = getTableCell(containerRef, cellPos);\n let row = cell?.parentElement;\n const level = parseInt(row?.ariaLevel ?? \"1\");\n if (level > 1) {\n const targetLevel = `${level - 1}`;\n while (row !== null && row.ariaLevel !== targetLevel) {\n row = row.previousElementSibling as HTMLElement;\n }\n if (row) {\n const nextRowIndex = parseInt(row.ariaRowIndex ?? \"- 1\");\n if (nextRowIndex !== -1) {\n return [nextRowIndex, 1];\n }\n }\n }\n return cellPos;\n};\nexport const getTableCell = (\n containerRef: RefObject<HTMLElement | null>,\n [rowIdx, colIdx]: CellPos,\n) => {\n const cssQuery = dataCellQuery(rowIdx, colIdx);\n const cell = containerRef.current?.querySelector(cssQuery) as HTMLDivElement;\n\n if (cellIsEditable(cell)) {\n // Dropdown gets focus, Input does not\n const focusableContent = cell.querySelector(\n `button,input[type=\"checkbox\"]`,\n ) as HTMLElement;\n return focusableContent || cell;\n } else {\n return cell;\n }\n};\n\nexport const getHeaderCell = (\n containerRef: RefObject<HTMLElement | null>,\n columnName: string,\n) =>\n containerRef.current?.querySelector(\n `.vuuTableHeaderCell[data-column-name=\"${columnName}\"]`,\n ) as HTMLDivElement | null;\n\nexport const getFocusedCell = (el: HTMLElement | Element | null) => {\n if (el?.role == \"cell\" || el?.role === \"columnheader\") {\n return el as HTMLDivElement;\n } else {\n return el?.closest(\n \"[role='columnHeader'],[role='cell']\",\n ) as HTMLDivElement | null;\n }\n};\n\nexport const cellIsEditable = (cell: HTMLDivElement | null) =>\n cell?.classList.contains(\"vuuTableCell-editable\");\n\nexport const cellDropdownShowing = (cell: HTMLDivElement | null) => {\n if (cellIsEditable(cell)) {\n return cell?.querySelector('.saltDropdown[aria-expanded=\"true\"]') !== null;\n }\n return false;\n};\n\nconst cellIsGroupCell = (cell: HTMLElement | null) =>\n cell?.classList.contains(\"vuuTableGroupCell\");\n\nconst rowIsExpanded = (cell: HTMLElement) => {\n switch (cell.parentElement?.ariaExpanded) {\n case \"true\":\n return true;\n case \"false\":\n return false;\n default:\n return undefined;\n }\n};\n\nexport const cellIsTextInput = (cell: HTMLElement) =>\n cell.querySelector(\".vuuTableInputCell\") !== null;\n\nexport const getRowElementByAriaIndex = (\n container: HTMLDivElement | EventTarget,\n rowIndex: number,\n) => {\n if (rowIndex === -1) {\n return null;\n } else {\n const activeRow = (container as HTMLElement).querySelector(\n `[aria-rowindex=\"${rowIndex}\"]`,\n ) as HTMLElement;\n\n if (activeRow) {\n return activeRow;\n } else {\n throw Error(\n `getRowElementAtIndex no row found for index index ${rowIndex}`,\n );\n }\n }\n};\n\nexport const getIndexFromCellElement = (cellElement: HTMLElement | null) =>\n getAriaColIndex(cellElement);\n\nexport const getAriaCellPos = (tableCell: HTMLDivElement): CellPos => {\n const focusedRow = tableCell.closest(\"[role='row']\") as HTMLElement;\n return [getAriaRowIndex(focusedRow), getAriaColIndex(tableCell)];\n};\n\nconst closestRow = (el: HTMLElement) =>\n el.closest('[role=\"row\"]') as HTMLElement;\n\nexport const closestRowIndex = (el: HTMLElement) =>\n getAriaRowIndex(closestRow(el));\n\nexport function getNextCellPos(\n key: ArrowKey,\n [rowIdx, colIdx]: CellPos,\n columnCount: number,\n maxRowIndex: number,\n): CellPos {\n if (key === \"ArrowUp\") {\n if (rowIdx > -1) {\n return [rowIdx - 1, colIdx];\n } else {\n return [rowIdx, colIdx];\n }\n } else if (key === \"ArrowDown\") {\n if (rowIdx === -1) {\n return [1, colIdx];\n } else if (rowIdx === maxRowIndex) {\n return [rowIdx, colIdx];\n } else {\n return [rowIdx + 1, colIdx];\n }\n } else if (key === \"ArrowRight\") {\n if (colIdx < columnCount) {\n return [rowIdx, colIdx + 1];\n } else {\n return [rowIdx, colIdx];\n }\n } else if (key === \"ArrowLeft\") {\n if (colIdx > 1) {\n return [rowIdx, colIdx - 1];\n } else {\n return [rowIdx, colIdx];\n }\n }\n return [rowIdx, colIdx];\n}\n\nexport type TreeNodeOperation = \"expand\" | \"collapse\" | \"level-up\";\n\nexport const getTreeNodeOperation = (\n containerRef: RefObject<HTMLElement | null>,\n navigationStyle: \"cell\" | \"tree\",\n cellPos: CellPos,\n key: NavigationKey,\n shiftKey: boolean,\n): TreeNodeOperation | undefined => {\n const cell = getTableCell(containerRef, cellPos);\n if (navigationStyle === \"cell\" && !cellIsGroupCell(cell)) {\n return undefined;\n }\n if (navigationStyle == \"cell\" && !shiftKey) {\n return undefined;\n }\n if (cellIsGroupCell(cell)) {\n const isExpanded = rowIsExpanded(cell);\n if (isExpanded === true) {\n if (key === \"ArrowLeft\") {\n return \"collapse\";\n }\n } else if (isExpanded === false) {\n if (key === \"ArrowRight\") {\n return \"expand\";\n } else if (key === \"ArrowLeft\") {\n return \"level-up\";\n }\n } else if (key === \"ArrowLeft\") {\n return \"level-up\";\n }\n }\n};\n\nconst NO_SCROLL_NECESSARY = [undefined, undefined] as const;\n\nexport const howFarIsRowOutsideViewport = (\n rowEl: HTMLElement,\n totalHeaderHeight: number,\n contentContainer = rowEl.closest(\".vuuTable-contentContainer\"),\n): readonly [ScrollDirection | undefined, number | undefined] => {\n //TODO lots of scope for optimisation here\n if (contentContainer) {\n // TODO take totalHeaderHeight into consideration\n const viewport = contentContainer?.getBoundingClientRect();\n const upperBoundary = viewport.top + totalHeaderHeight;\n const row = rowEl.getBoundingClientRect();\n if (row) {\n if (row.bottom > viewport.bottom) {\n return [\"down\", row.bottom - viewport.bottom];\n } else if (row.top < upperBoundary) {\n return [\"up\", row.top - upperBoundary];\n } else {\n return NO_SCROLL_NECESSARY;\n }\n } else {\n throw Error(\"Whats going on, row not found\");\n }\n } else {\n throw Error(\"Whats going on, scrollbar container not found\");\n }\n};\n"],"names":["getAriaRowIndex","getAriaColIndex"],"mappings":";;;;AAYO,MAAM,eAAkB,GAAA,CAAC,MAC9B,KAAA,CAAA,yDAAA,EAA4D,MAAM,CAAA,EAAA;AAE7D,MAAM,gBAAgB,CAAC,UAAA,EAAoB,eAChD,CAAmC,gCAAA,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