@vuu-ui/vuu-table 0.13.112 → 0.13.113-alpha.2

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.
Files changed (108) hide show
  1. package/cjs/Row.js +2 -31
  2. package/cjs/Row.js.map +1 -1
  3. package/cjs/Table.css.js +1 -1
  4. package/cjs/Table.js +25 -9
  5. package/cjs/Table.js.map +1 -1
  6. package/cjs/bulk-edit/BulkEditPanel.css.js +1 -1
  7. package/cjs/bulk-edit/BulkEditPanel.js +2 -1
  8. package/cjs/bulk-edit/BulkEditPanel.js.map +1 -1
  9. package/cjs/bulk-edit/useBulkEditPanel.js +15 -12
  10. package/cjs/bulk-edit/useBulkEditPanel.js.map +1 -1
  11. package/cjs/cell-block/cellblock-utils.js +3 -3
  12. package/cjs/cell-block/cellblock-utils.js.map +1 -1
  13. package/cjs/cell-block/useCellBlockSelection.js +3 -0
  14. package/cjs/cell-block/useCellBlockSelection.js.map +1 -1
  15. package/cjs/cell-renderers/checkbox-cell/CheckboxCell.js +2 -2
  16. package/cjs/cell-renderers/checkbox-cell/CheckboxCell.js.map +1 -1
  17. package/cjs/cell-renderers/checkbox-row-selector/CheckboxRowSelectorCell.js +11 -1
  18. package/cjs/cell-renderers/checkbox-row-selector/CheckboxRowSelectorCell.js.map +1 -1
  19. package/cjs/cell-renderers/input-cell/InputCell.css.js +1 -1
  20. package/cjs/cell-renderers/input-cell/InputCell.js +3 -2
  21. package/cjs/cell-renderers/input-cell/InputCell.js.map +1 -1
  22. package/cjs/cell-renderers/toggle-cell/ToggleCell.js +1 -1
  23. package/cjs/cell-renderers/toggle-cell/ToggleCell.js.map +1 -1
  24. package/cjs/column-resizing/ColumnResizer.css.js +1 -1
  25. package/cjs/header-cell/GroupHeaderCell.css.js +1 -1
  26. package/cjs/header-cell/HeaderCell.css.js +1 -1
  27. package/cjs/table-cell/TableCell.css.js +1 -1
  28. package/cjs/table-cell/TableCell.js +19 -19
  29. package/cjs/table-cell/TableCell.js.map +1 -1
  30. package/cjs/table-dom-utils.js +4 -24
  31. package/cjs/table-dom-utils.js.map +1 -1
  32. package/cjs/table-header/TableHeader.js +89 -91
  33. package/cjs/table-header/TableHeader.js.map +1 -1
  34. package/cjs/useCell.js +1 -2
  35. package/cjs/useCell.js.map +1 -1
  36. package/cjs/useCellEditing.js +28 -3
  37. package/cjs/useCellEditing.js.map +1 -1
  38. package/cjs/useCellFocus.js +8 -4
  39. package/cjs/useCellFocus.js.map +1 -1
  40. package/cjs/useKeyboardNavigation.js +11 -25
  41. package/cjs/useKeyboardNavigation.js.map +1 -1
  42. package/cjs/useTable.js +85 -55
  43. package/cjs/useTable.js.map +1 -1
  44. package/cjs/useTableContextMenu.js +19 -18
  45. package/cjs/useTableContextMenu.js.map +1 -1
  46. package/cjs/useTableModel.js +50 -27
  47. package/cjs/useTableModel.js.map +1 -1
  48. package/esm/Row.js +5 -33
  49. package/esm/Row.js.map +1 -1
  50. package/esm/Table.css.js +1 -1
  51. package/esm/Table.js +23 -7
  52. package/esm/Table.js.map +1 -1
  53. package/esm/bulk-edit/BulkEditPanel.css.js +1 -1
  54. package/esm/bulk-edit/BulkEditPanel.js +2 -1
  55. package/esm/bulk-edit/BulkEditPanel.js.map +1 -1
  56. package/esm/bulk-edit/useBulkEditPanel.js +15 -12
  57. package/esm/bulk-edit/useBulkEditPanel.js.map +1 -1
  58. package/esm/cell-block/cellblock-utils.js +2 -2
  59. package/esm/cell-block/cellblock-utils.js.map +1 -1
  60. package/esm/cell-block/useCellBlockSelection.js +3 -0
  61. package/esm/cell-block/useCellBlockSelection.js.map +1 -1
  62. package/esm/cell-renderers/checkbox-cell/CheckboxCell.js +3 -3
  63. package/esm/cell-renderers/checkbox-cell/CheckboxCell.js.map +1 -1
  64. package/esm/cell-renderers/checkbox-row-selector/CheckboxRowSelectorCell.js +11 -1
  65. package/esm/cell-renderers/checkbox-row-selector/CheckboxRowSelectorCell.js.map +1 -1
  66. package/esm/cell-renderers/input-cell/InputCell.css.js +1 -1
  67. package/esm/cell-renderers/input-cell/InputCell.js +3 -2
  68. package/esm/cell-renderers/input-cell/InputCell.js.map +1 -1
  69. package/esm/cell-renderers/toggle-cell/ToggleCell.js +2 -2
  70. package/esm/cell-renderers/toggle-cell/ToggleCell.js.map +1 -1
  71. package/esm/column-resizing/ColumnResizer.css.js +1 -1
  72. package/esm/header-cell/GroupHeaderCell.css.js +1 -1
  73. package/esm/header-cell/HeaderCell.css.js +1 -1
  74. package/esm/table-cell/TableCell.css.js +1 -1
  75. package/esm/table-cell/TableCell.js +19 -19
  76. package/esm/table-cell/TableCell.js.map +1 -1
  77. package/esm/table-dom-utils.js +3 -21
  78. package/esm/table-dom-utils.js.map +1 -1
  79. package/esm/table-header/TableHeader.js +89 -91
  80. package/esm/table-header/TableHeader.js.map +1 -1
  81. package/esm/useCell.js +1 -2
  82. package/esm/useCell.js.map +1 -1
  83. package/esm/useCellEditing.js +30 -5
  84. package/esm/useCellEditing.js.map +1 -1
  85. package/esm/useCellFocus.js +8 -4
  86. package/esm/useCellFocus.js.map +1 -1
  87. package/esm/useKeyboardNavigation.js +11 -25
  88. package/esm/useKeyboardNavigation.js.map +1 -1
  89. package/esm/useTable.js +86 -56
  90. package/esm/useTable.js.map +1 -1
  91. package/esm/useTableContextMenu.js +18 -17
  92. package/esm/useTableContextMenu.js.map +1 -1
  93. package/esm/useTableModel.js +50 -27
  94. package/esm/useTableModel.js.map +1 -1
  95. package/package.json +11 -11
  96. package/types/Row.d.ts +0 -3
  97. package/types/Table.d.ts +9 -6
  98. package/types/bulk-edit/BulkEditPanel.d.ts +3 -2
  99. package/types/table-dom-utils.d.ts +1 -3
  100. package/types/table-header/TableHeader.d.ts +2 -2
  101. package/types/useCellEditing.d.ts +3 -1
  102. package/types/useKeyboardNavigation.d.ts +2 -2
  103. package/types/useTable.d.ts +6 -4
  104. package/types/useTableModel.d.ts +4 -7
  105. package/cjs/Row.css.js +0 -6
  106. package/cjs/Row.css.js.map +0 -1
  107. package/esm/Row.css.js +0 -4
  108. package/esm/Row.css.js.map +0 -1
package/cjs/Row.js CHANGED
@@ -2,36 +2,14 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var vuuUtils = require('@vuu-ui/vuu-utils');
5
- var styles = require('@salt-ds/styles');
6
- var window = require('@salt-ds/window');
7
5
  var cx = require('clsx');
8
6
  var react = require('react');
9
7
  var TableCell = require('./table-cell/TableCell.js');
10
8
  var TableGroupCell = require('./table-cell/TableGroupCell.js');
11
- var Row$1 = require('./Row.css.js');
12
9
  var VirtualColSpan = require('./VirtualColSpan.js');
13
10
 
14
11
  const { COUNT, DEPTH, IDX, IS_EXPANDED, IS_LEAF, SELECTED } = vuuUtils.metadataKeys;
15
12
  const classBase = "vuuTableRow";
16
- const RowProxy = react.forwardRef(
17
- function RowProxy2({ height }, forwardedRef) {
18
- const targetWindow = window.useWindow();
19
- styles.useComponentCssInjection({
20
- testId: "vuu-table-row",
21
- css: Row$1,
22
- window: targetWindow
23
- });
24
- return /* @__PURE__ */ jsxRuntime.jsx(
25
- "div",
26
- {
27
- "aria-hidden": true,
28
- className: cx(classBase, `${classBase}-proxy`),
29
- ref: forwardedRef,
30
- style: { height }
31
- }
32
- );
33
- }
34
- );
35
13
  const Row = react.memo(
36
14
  ({
37
15
  className: classNameProp,
@@ -52,12 +30,6 @@ const Row = react.memo(
52
30
  zebraStripes = false,
53
31
  ...htmlAttributes
54
32
  }) => {
55
- const targetWindow = window.useWindow();
56
- styles.useComponentCssInjection({
57
- testId: "vuu-table-row",
58
- css: Row$1,
59
- window: targetWindow
60
- });
61
33
  const {
62
34
  [COUNT]: childRowCount,
63
35
  [DEPTH]: depth,
@@ -116,7 +88,7 @@ const Row = react.memo(
116
88
  onClick: handleRowClick,
117
89
  style,
118
90
  children: [
119
- showBookends ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${classBase}-selectionDecorator vuuStickyLeft` }) : null,
91
+ showBookends ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "vuuSelectionDecorator vuuStickyLeft", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "vuuTableRowBookend" }) }) : null,
120
92
  /* @__PURE__ */ jsxRuntime.jsx(VirtualColSpan.VirtualColSpan, { width: virtualColSpan }),
121
93
  columns.filter(vuuUtils.isNotHidden).map((column) => {
122
94
  const isGroup = vuuUtils.isGroupColumn(column);
@@ -135,7 +107,7 @@ const Row = react.memo(
135
107
  column.name
136
108
  );
137
109
  }),
138
- showBookends ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${classBase}-selectionDecorator vuuStickyRight` }) : null
110
+ showBookends ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "vuuSelectionDecorator vuuStickyRight", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "vuuTableRowBookend" }) }) : null
139
111
  ]
140
112
  }
141
113
  );
@@ -144,5 +116,4 @@ const Row = react.memo(
144
116
  Row.displayName = "Row";
145
117
 
146
118
  exports.Row = Row;
147
- exports.RowProxy = RowProxy;
148
119
  //# sourceMappingURL=Row.js.map
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 <span className={`${classBase}-selectionDecorator vuuStickyLeft`} />\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 <span className={`${classBase}-selectionDecorator vuuStickyRight`} />\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,QAAW,G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,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,+BACEA,cAAA,CAAA,MAAA,EAAA,EAAK,WAAW,CAAG,EAAA,SAAS,sCAAsC,CACjE,GAAA;AAAA;AAAA;AAAA,KACN;AAAA;AAGN;AACA,GAAA,CAAI,WAAc,GAAA,KAAA;;;;;"}
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 cx from \"clsx\";\nimport { MouseEvent, memo, useCallback } from \"react\";\nimport { TableCell, TableGroupCell } from \"./table-cell\";\n\nimport { VirtualColSpan } from \"./VirtualColSpan\";\n\nconst { COUNT, DEPTH, IDX, IS_EXPANDED, IS_LEAF, SELECTED } = metadataKeys;\nconst classBase = \"vuuTableRow\";\n\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 {\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","memo","useCallback","isGroupColumn","isJsonGroup","queryClosest","jsxs","jsx","VirtualColSpan","isNotHidden","isJsonColumn","TableGroupCell","TableCell"],"mappings":";;;;;;;;;;AAeA,MAAM,EAAE,KAAO,EAAA,KAAA,EAAO,KAAK,WAAa,EAAA,OAAA,EAAS,UAAa,GAAAA,qBAAA;AAC9D,MAAM,SAAY,GAAA,aAAA;AAEX,MAAM,GAAM,GAAAC,UAAA;AAAA,EACjB,CAAC;AAAA,IACC,SAAW,EAAA,aAAA;AAAA,IACX,kBAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA,iBAAoB,GAAA,cAAA;AAAA,IACpB,WAAA;AAAA,IACA,GAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,IACA,OAAA;AAAA,IACA,YAAA;AAAA,IACA,aAAA;AAAA,IACA,aAAA;AAAA,IACA,YAAe,GAAA,IAAA;AAAA,IACf,cAAiB,GAAA,CAAA;AAAA,IACjB,YAAe,GAAA,KAAA;AAAA,IACf,GAAG;AAAA,GACW,KAAA;AACd,IAAM,MAAA;AAAA,MACJ,CAAC,KAAK,GAAG,aAAA;AAAA,MACT,CAAC,KAAK,GAAG,KAAA;AAAA,MACT,CAAC,GAAG,GAAG,QAAA;AAAA,MACP,CAAC,WAAW,GAAG,UAAA;AAAA,MACf,CAAC,OAAO,GAAG,MAAA;AAAA,MACX,CAAC,QAAQ,GAAG;AAAA,KACV,GAAA,GAAA;AAEJ,IAAA,MAAM,cAAiB,GAAAC,iBAAA;AAAA,MACrB,CAAC,GAAoC,KAAA;AACnC,QAAA,MAAM,cAAc,GAAI,CAAA,QAAA;AACxB,QAAM,MAAA,qBAAA,GAAwB,GAAI,CAAA,OAAA,IAAW,GAAI,CAAA,OAAA;AACjD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A,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 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: calc(var(--table-width) - var(--vertical-scrollbar-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.vuuTable-col-headings {\n background-color: var(\n --vuuTableColHeadings-background,\n var(--table-background)\n );\n padding: 0 var(--vuuTableRow-selectionDecorator-width, 0);\n position: sticky;\n top: 0;\n /* ensure header row sits atop everything else when scrolling down */\n z-index: 1;\n}\n\n.vuuTable-col-headings: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.vuuTable-col-headers {\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 .vuuTable-col-headings {\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}";
3
+ var tableCss = ".vuuTable {\n --vuu-table-cell-outlineWidth: 1px;\n --vuu-table-col-header-row-height: var(--salt-size-base, 32px);\n --vuu-table-col-heading-height: 25px;\n --vuu-table-footer-height: 0px;\n --vuu-table-row-background-selected: var(--vuuTableRow-background-selected, var(--salt-selectable-background-selected));\n --vuu-table-row-borderColor-selected: var(--vuuTableRow-borderColor-selected, var(--salt-selectable-borderColor-selected));\n --vuu-table-row-bookend-background-selected: var(--vuuTableRow-bookend-background-selected, var(--salt-selectable-background-selected));\n --vuu-table-row-height: var(--salt-size-base, 32px);\n --vuu-table-row-selection-borderRadius: var(--vuuTable-row-selection-borderRadius, 5px); \n\n --table-background: var(--vuuTable-background, var(--salt-container-primary-background));\n --table-height: var(--measured-px-height);\n --table-width: var(--measured-px-width);\n\n --columnResizer-color: transparent;\n --row-height: var(\n --row-height-prop,\n var(--vuu-table-row-height, var(--salt-size-base))\n );\n --col-header-row-height: var(\n --col-header-row-height-prop,\n var(--vuu-table-col-header-row-height, var(--salt-size-base))\n );\n\n --cell-borderColor: transparent;\n --row-borderColor: var(--row-background);\n --vuu-table-embedded-control-height: calc(var(--row-height) - 3px);\n\n background: var(--table-background);\n font-family: var(\n --vuuTable-fontFamily,\n var(--salt-typography-fontFamily, sans-serif)\n );\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 --table-zebraColor: var(--vuuTable-zebraColor, var(--salt-container-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-row-height);\n background-color: var(\n --vuuTableHeader-background,\n var(--table-background)\n );\n border-bottom: solid 1px\n var(\n --vuuTableHeader-borderColor,\n var(--salt-separable-tertiary-borderColor)\n );\n color: var(--salt-content-secondary-foreground);\n font-size: var(--VuuTableHeader-fontSize, vasr(--salt-text-label-fontSize));\n position: sticky;\n top: 0;\n white-space: nowrap;\n\n /* ensure header row sits atop everything else when scrolling down */\n z-index: 1;\n\n .vuuDraggable-spacer {\n border-bottom: solid 1px #ccc;\n display: var(--vuuDraggable-display, inline-block);\n height: var(--vuu-table-col-header-row-height);\n }\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-row-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.sizer-cell {\n border: none !important;\n height: 0px;\n}\n\n.vuuDraggable-vuuTable {\n --cell-borderColor: transparent;\n --vuu-table-col-header-row-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.vuuRowProxy {\n position: absolute !important;\n visibility: hidden;\n}\n\n.vuuTableColHeaderRow {\n height: var(--col-header-row-height);\n}\n\n.vuuTableRow {\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-primary-foreground);\n contain: layout;\n font-size: var(--VuuTableRow-fontSize, vasr(--salt-text-fontSize));\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\n.vuuTableRow-even {\n --row-background: var(--table-zebraColor);\n}\n\n.vuuTableRow-highlighted {\n background: var(--salt-selectable-background-hover);\n}\n\n\n.vuuTableRow[aria-selected=\"true\"] {\n background-color: var(--vuu-table-row-background-selected);\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(--vuu-table-row-bookend-background-selected);\n border-color: var(--vuu-table-row-borderColor-selected);\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 selected 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 .vuuTableRow[aria-selected=\"true\"][data-first-row=\"true\"]\n {\n border-radius: 0;\n\n &:after {\n background: var(--vuu-table-row-borderColor-selected);\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: var(--vuu-table-row-selection-borderRadius);\n border-top-style: solid;\n margin-top: 1px;\n }\n\n .vuuStickyRight .vuuTableRowBookend {\n border-top-right-radius: var(--vuu-table-row-selection-borderRadius);\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(--vuu-table-row-borderColor-selected);\n\n .vuuStickyLeft .vuuTableRowBookend {\n border-bottom-left-radius: var(--vuu-table-row-selection-borderRadius);\n border-bottom-style: solid;\n }\n .vuuStickyRight .vuuTableRowBookend {\n border-bottom-right-radius: var(--vuu-table-row-selection-borderRadius);\n border-bottom-style: solid;\n }\n }\n\n}";
4
4
 
5
5
  module.exports = tableCss;
6
6
  //# sourceMappingURL=Table.css.js.map
package/cjs/Table.js CHANGED
@@ -19,6 +19,17 @@ var Table$1 = require('./Table.css.js');
19
19
 
20
20
  const classBase = "vuuTable";
21
21
  const { IDX, RENDER_IDX } = vuuUtils.metadataKeys;
22
+ const RowProxy = react.forwardRef(function RowProxy2({ className = "vuuTableRow", height }, forwardedRef) {
23
+ return /* @__PURE__ */ jsxRuntime.jsx(
24
+ "div",
25
+ {
26
+ "aria-hidden": true,
27
+ className: cx(className, `vuuRowProxy`),
28
+ ref: forwardedRef,
29
+ style: { height }
30
+ }
31
+ );
32
+ });
22
33
  const TableCore = ({
23
34
  EmptyDisplay,
24
35
  Row: Row$1 = Row.Row,
@@ -30,6 +41,7 @@ const TableCore = ({
30
41
  autoSelectFirstRow,
31
42
  autoSelectRowKey,
32
43
  availableColumns,
44
+ // colHeaderRowHeight,
33
45
  config,
34
46
  containerRef,
35
47
  customHeader,
@@ -56,7 +68,6 @@ const TableCore = ({
56
68
  rowHeight,
57
69
  rowToObject,
58
70
  scrollingApiRef,
59
- selectionBookendWidth = 0,
60
71
  selectionModel = "extended",
61
72
  showColumnHeaders = true,
62
73
  showColumnHeaderMenus = true,
@@ -124,13 +135,13 @@ const TableCore = ({
124
135
  rowHeight,
125
136
  rowToObject,
126
137
  scrollingApiRef,
127
- selectionBookendWidth,
128
138
  selectionModel,
129
139
  showColumnHeaders,
130
140
  showColumnHeaderMenus,
131
141
  showPaginationControls,
132
142
  size
133
143
  });
144
+ const { selectionBookendWidth = 4 } = config;
134
145
  const contentContainerClassName = cx(`${classBase}-contentContainer`, {
135
146
  [`${classBase}-colLines`]: tableAttributes.columnSeparators,
136
147
  [`${classBase}-rowLines`]: tableAttributes.rowSeparators,
@@ -147,7 +158,8 @@ const TableCore = ({
147
158
  "--pinned-width-left": `${viewportMeasurements.pinnedWidthLeft}px`,
148
159
  "--pinned-width-right": `${viewportMeasurements.pinnedWidthRight}px`,
149
160
  "--total-header-height": `${headerHeight}px`,
150
- "--viewport-body-height": `${viewportMeasurements.viewportBodyHeight}px`
161
+ "--viewport-body-height": `${viewportMeasurements.viewportBodyHeight}px`,
162
+ "--table-selection-bookend-width": `${selectionBookendWidth}px`
151
163
  };
152
164
  const headersReady = showColumnHeaders === false || headerHeight > 0;
153
165
  const readyToRenderTableBody = headersReady && data.length > 0;
@@ -202,6 +214,7 @@ const TableCore = ({
202
214
  onRemoveGroupColumn,
203
215
  onResizeColumn,
204
216
  onSortColumn,
217
+ showBookends: selectionBookendWidth > 0,
205
218
  showColumnHeaderMenus,
206
219
  tableConfig,
207
220
  tableId: id,
@@ -218,6 +231,7 @@ const TableCore = ({
218
231
  classNameGenerator: rowClassNameGenerator,
219
232
  columnMap,
220
233
  columns: scrollProps.columnsWithinViewport,
234
+ "data-first-row": data2[IDX] === 0 ? "true" : void 0,
221
235
  groupToggleTarget,
222
236
  highlighted: highlightedIndex === ariaRowIndex,
223
237
  onClick: onRowClick,
@@ -264,7 +278,7 @@ const TableCore = ({
264
278
  };
265
279
  const Table = react.forwardRef(function Table2({
266
280
  EmptyDisplay,
267
- Row: Row$1,
281
+ Row,
268
282
  allowCellBlockSelection,
269
283
  allowDragColumnHeader,
270
284
  allowDragDrop,
@@ -279,6 +293,7 @@ const Table = react.forwardRef(function Table2({
279
293
  dataSource,
280
294
  disableFocus,
281
295
  groupToggleTarget,
296
+ colHeaderRowHeight: colHeaderRowHeightProp,
282
297
  height,
283
298
  highlightedIndex,
284
299
  id,
@@ -299,10 +314,10 @@ const Table = react.forwardRef(function Table2({
299
314
  resizeStrategy,
300
315
  rowActionHandlers,
301
316
  rowHeight: rowHeightProp,
317
+ rowSelectionBorder,
302
318
  rowToObject,
303
319
  scrollingApiRef,
304
320
  searchPattern = "",
305
- selectionBookendWidth = 4,
306
321
  selectionModel,
307
322
  showColumnHeaders,
308
323
  showColumnHeaderMenus,
@@ -375,6 +390,7 @@ const Table = react.forwardRef(function Table2({
375
390
  ...htmlAttributes,
376
391
  className: cx(classBase, classNameProp, {
377
392
  [`${classBase}-pagination`]: showPaginationControls,
393
+ [`${classBase}-rowSelection-bordered`]: rowSelectionBorder,
378
394
  [`${classBase}-maxViewportRowLimit`]: maxViewportRowLimit,
379
395
  [`${classBase}-viewportRowLimit`]: viewportRowLimit
380
396
  }),
@@ -385,16 +401,17 @@ const Table = react.forwardRef(function Table2({
385
401
  resizeStrategy,
386
402
  style: {
387
403
  ...styleProp,
388
- "--row-height-prop": rowHeight > 0 ? `${rowHeight}px` : void 0
404
+ "--col-header-row-height-prop": typeof colHeaderRowHeightProp === "number" ? `${colHeaderRowHeightProp}px` : void 0,
405
+ "--row-height-prop": typeof rowHeightProp === "number" ? `${rowHeightProp}px` : void 0
389
406
  },
390
407
  width,
391
408
  children: [
392
- /* @__PURE__ */ jsxRuntime.jsx(Row.RowProxy, { ref: rowRef, height: rowHeightProp }),
409
+ /* @__PURE__ */ jsxRuntime.jsx(RowProxy, { ref: rowRef, height: rowHeightProp }),
393
410
  size && rowHeight && (footerHeight || showPaginationControls !== true) ? /* @__PURE__ */ jsxRuntime.jsx(
394
411
  TableCore,
395
412
  {
396
413
  EmptyDisplay,
397
- Row: Row$1,
414
+ Row,
398
415
  allowCellBlockSelection,
399
416
  allowDragColumnHeader,
400
417
  allowDragDrop,
@@ -429,7 +446,6 @@ const Table = react.forwardRef(function Table2({
429
446
  rowToObject,
430
447
  scrollingApiRef,
431
448
  lowerCaseSearchPattern: vuuUtils.lowerCase(searchPattern),
432
- selectionBookendWidth,
433
449
  selectionModel,
434
450
  showColumnHeaders,
435
451
  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,GAA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B,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 } 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\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.\nconst RowProxy = forwardRef<\n HTMLDivElement,\n { className?: string; height?: number }\n>(function RowProxy({ className = \"vuuTableRow\", height }, forwardedRef) {\n return (\n <div\n aria-hidden\n className={cx(className, `vuuRowProxy`)}\n ref={forwardedRef}\n style={{ height }}\n />\n );\n});\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 * Pixel height of header cells. If specified here, this will take precedence over CSS\n * values and Table will not respond to density changes.\n */\n colHeaderRowHeight?: number;\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 /**\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 // colHeaderRowHeight,\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 | \"colHeaderRowHeight\"\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 // This is used for styling selection only.\n data-first-row={data[IDX] === 0 ? \"true\" : undefined}\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 colHeaderRowHeight: colHeaderRowHeightProp,\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\n const { measuredHeight: rowHeight, measuredRef: rowRef } = useMeasuredHeight({\n height: rowHeightProp,\n });\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}-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 \"--col-header-row-height-prop\":\n typeof colHeaderRowHeightProp === \"number\"\n ? `${colHeaderRowHeightProp}px`\n : undefined,\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","forwardRef","RowProxy","jsx","Row","DefaultRow","useId","useTable","jsxs","TableProvider","TableHeader","data","Table","useWindow","useComponentCssInjection","tableCss","useRef","useState","useMeasuredHeight","useCallback","size","useMemo","ContextPanelProvider","MeasuredContainer","useForkRef","lowerCase","reduceSizeHeight","PaginationControl"],"mappings":";;;;;;;;;;;;;;;;;;;AA0DA,MAAM,SAAY,GAAA,UAAA;AAElB,MAAM,EAAE,GAAK,EAAA,UAAA,EAAe,GAAAA,qBAAA;AAQ5B,MAAM,QAAA,GAAWC,iBAGf,SAASC,SAA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 -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var bulkEditPanelCss = ".vuuBulkEditPanel {\n background-color: var(--salt-container-secondary-background);\n display: flex;\n flex-direction: column;\n\n .vuuTable {\n --table-background: var(--salt-container-secondary-background);\n }\n\n .vuuTableCell-editable {\n --vuuTableCell-padding: 0;\n }\n}\n\n.vuuBulkEditPanel-toolbar {\n background: var(--salt-container-primary-background);\n border: solid 1px var(--salt-separable-tertiary-borderColor);\n border-radius: 2px;\n display: flex;\n height: 42px;\n}\n\n.vuuBulkEditPanel-table {\n align-items: center;\n flex: 1 1 auto;\n}\n";
3
+ var bulkEditPanelCss = ".vuuBulkEditPanel {\n background-color: var(--salt-container-secondary-background);\n display: flex;\n flex-direction: column;\n\n .vuuTable {\n --table-background: var(--salt-container-secondary-background);\n }\n\n}\n\n.vuuBulkEditPanel-toolbar {\n background: var(--salt-container-primary-background);\n border: solid 1px var(--salt-separable-tertiary-borderColor);\n border-radius: 2px;\n display: flex;\n height: 42px;\n}\n\n.vuuBulkEditPanel-table {\n align-items: center;\n flex: 1 1 auto;\n}\n";
4
4
 
5
5
  module.exports = bulkEditPanelCss;
6
6
  //# sourceMappingURL=BulkEditPanel.css.js.map
@@ -18,6 +18,7 @@ const BulkEditPanel = ({
18
18
  parentDs,
19
19
  onValidationStatusChange,
20
20
  style,
21
+ width = 600,
21
22
  ...htmlAttributes
22
23
  }) => {
23
24
  const targetWindow = window.useWindow();
@@ -57,7 +58,7 @@ const BulkEditPanel = ({
57
58
  customHeader: bulkEditRow,
58
59
  dataSource: sessionDs,
59
60
  height: 380,
60
- width: 600,
61
+ width,
61
62
  showColumnHeaderMenus: false,
62
63
  selectionModel: "none",
63
64
  onDataEdited,
@@ -1 +1 @@
1
- {"version":3,"file":"BulkEditPanel.js","sources":["../../../../packages/vuu-table/src/bulk-edit/BulkEditPanel.tsx"],"sourcesContent":["import { DataSource, RpcResponse } from \"@vuu-ui/vuu-data-types\";\nimport type { ColumnDescriptor } from \"@vuu-ui/vuu-table-types\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport { HTMLAttributes, ReactElement, useMemo } from \"react\";\nimport { Table } from \"../Table\";\nimport { BulkEditRow } from \"./BulkEditRow\";\nimport { useBulkEditPanel } from \"./useBulkEditPanel\";\n\nimport bulkEditPanelCss from \"./BulkEditPanel.css\";\n\nconst classBase = \"vuuBulkEditPanel\";\n\nexport interface BulkEditPanelProps extends HTMLAttributes<HTMLDivElement> {\n columns?: ColumnDescriptor[];\n /**\n * The session dataSource. This is where the edits will be processed until final\n * confirmation, at which point edits will be applied to parent dataSource and\n * the session table torm down.\n */\n sessionDs: DataSource;\n response?: RpcResponse;\n mainTableName?: string;\n /**\n * The parent dataSource. This is where the edits will be applied once confirmed\n */\n parentDs: DataSource;\n onValidationStatusChange: (isValid: boolean) => void;\n}\n\nexport const BulkEditPanel = ({\n className,\n columns,\n sessionDs,\n parentDs,\n onValidationStatusChange,\n style,\n ...htmlAttributes\n}: BulkEditPanelProps): ReactElement => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-checkbox-cell\",\n css: bulkEditPanelCss,\n window: targetWindow,\n });\n\n const { onBulkChange, onDataEdited, onRowChange, tableConfig } =\n useBulkEditPanel({\n columns,\n sessionDs,\n onValidationStatusChange,\n });\n\n const bulkEditRow = useMemo(() => {\n return (\n <BulkEditRow\n dataSource={parentDs}\n onBulkChange={onBulkChange}\n onRowChange={onRowChange}\n />\n );\n }, [onBulkChange, onRowChange, parentDs]);\n\n return (\n <div\n {...htmlAttributes}\n className={cx(classBase, className)}\n style={{ ...style, display: \"flex\", flexDirection: \"column\" }}\n >\n <div className={`${classBase}-toolbar`} />\n <div className={`${classBase}-table`}>\n <Table\n allowDragColumnHeader={false}\n config={tableConfig}\n customHeader={bulkEditRow}\n dataSource={sessionDs}\n height={380}\n width={600}\n showColumnHeaderMenus={false}\n selectionModel=\"none\"\n onDataEdited={onDataEdited}\n maxViewportRowLimit={10}\n />\n </div>\n </div>\n );\n};\n"],"names":["useWindow","useComponentCssInjection","bulkEditPanelCss","useBulkEditPanel","useMemo","jsx","BulkEditRow","jsxs","Table"],"mappings":";;;;;;;;;;;;AAYA,MAAM,SAAY,GAAA,kBAAA;AAmBX,MAAM,gBAAgB,CAAC;AAAA,EAC5B,SAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,wBAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAG;AACL,CAAwC,KAAA;AACtC,EAAA,MAAM,eAAeA,gBAAU,EAAA;AAC/B,EAAyBC,+BAAA,CAAA;AAAA,IACvB,MAAQ,EAAA,mBAAA;AAAA,IACR,GAAK,EAAAC,eAAA;AAAA,IACL,MAAQ,EAAA;AAAA,GACT,CAAA;AAED,EAAA,MAAM,EAAE,YAAc,EAAA,YAAA,EAAc,WAAa,EAAA,WAAA,KAC/CC,iCAAiB,CAAA;AAAA,IACf,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACD,CAAA;AAEH,EAAM,MAAA,WAAA,GAAcC,cAAQ,MAAM;AAChC,IACE,uBAAAC,cAAA;AAAA,MAACC,uBAAA;AAAA,MAAA;AAAA,QACC,UAAY,EAAA,QAAA;AAAA,QACZ,YAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,GAED,EAAA,CAAC,YAAc,EAAA,WAAA,EAAa,QAAQ,CAAC,CAAA;AAExC,EACE,uBAAAC,eAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,cAAA;AAAA,MACJ,SAAA,EAAW,EAAG,CAAA,SAAA,EAAW,SAAS,CAAA;AAAA,MAClC,OAAO,EAAE,GAAG,OAAO,OAAS,EAAA,MAAA,EAAQ,eAAe,QAAS,EAAA;AAAA,MAE5D,QAAA,EAAA;AAAA,wBAAAF,cAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,CAAG,EAAA,SAAS,CAAY,QAAA,CAAA,EAAA,CAAA;AAAA,wBACvCA,cAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,CAAA,EAAG,SAAS,CAC1B,MAAA,CAAA,EAAA,QAAA,kBAAAA,cAAA;AAAA,UAACG,WAAA;AAAA,UAAA;AAAA,YACC,qBAAuB,EAAA,KAAA;AAAA,YACvB,MAAQ,EAAA,WAAA;AAAA,YACR,YAAc,EAAA,WAAA;AAAA,YACd,UAAY,EAAA,SAAA;AAAA,YACZ,MAAQ,EAAA,GAAA;AAAA,YACR,KAAO,EAAA,GAAA;AAAA,YACP,qBAAuB,EAAA,KAAA;AAAA,YACvB,cAAe,EAAA,MAAA;AAAA,YACf,YAAA;AAAA,YACA,mBAAqB,EAAA;AAAA;AAAA,SAEzB,EAAA;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"BulkEditPanel.js","sources":["../../../../packages/vuu-table/src/bulk-edit/BulkEditPanel.tsx"],"sourcesContent":["import { DataSource, RpcResponse } from \"@vuu-ui/vuu-data-types\";\nimport type { ColumnDescriptor } from \"@vuu-ui/vuu-table-types\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport { HTMLAttributes, ReactElement, useMemo } from \"react\";\nimport { Table } from \"../Table\";\nimport { BulkEditRow } from \"./BulkEditRow\";\nimport { useBulkEditPanel } from \"./useBulkEditPanel\";\n\nimport bulkEditPanelCss from \"./BulkEditPanel.css\";\n\nconst classBase = \"vuuBulkEditPanel\";\n\nexport interface BulkEditPanelProps extends HTMLAttributes<HTMLDivElement> {\n columns?: ColumnDescriptor[];\n /**\n * The session dataSource. This is where the edits will be processed until final\n * confirmation, at which point edits will be applied to parent dataSource and\n * the session table torn down.\n */\n sessionDs: DataSource;\n response?: RpcResponse;\n mainTableName?: string;\n /**\n * The parent dataSource. This is where the edits will be applied once confirmed\n */\n parentDs: DataSource;\n onValidationStatusChange: (isValid: boolean) => void;\n width?: number;\n}\n\nexport const BulkEditPanel = ({\n className,\n columns,\n sessionDs,\n parentDs,\n onValidationStatusChange,\n style,\n width = 600,\n ...htmlAttributes\n}: BulkEditPanelProps): ReactElement => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-checkbox-cell\",\n css: bulkEditPanelCss,\n window: targetWindow,\n });\n\n const { onBulkChange, onDataEdited, onRowChange, tableConfig } =\n useBulkEditPanel({\n columns,\n sessionDs,\n onValidationStatusChange,\n });\n\n const bulkEditRow = useMemo(() => {\n return (\n <BulkEditRow\n dataSource={parentDs}\n onBulkChange={onBulkChange}\n onRowChange={onRowChange}\n />\n );\n }, [onBulkChange, onRowChange, parentDs]);\n\n return (\n <div\n {...htmlAttributes}\n className={cx(classBase, className)}\n style={{ ...style, display: \"flex\", flexDirection: \"column\" }}\n >\n <div className={`${classBase}-toolbar`} />\n <div className={`${classBase}-table`}>\n <Table\n allowDragColumnHeader={false}\n config={tableConfig}\n customHeader={bulkEditRow}\n dataSource={sessionDs}\n height={380}\n width={width}\n showColumnHeaderMenus={false}\n selectionModel=\"none\"\n onDataEdited={onDataEdited}\n maxViewportRowLimit={10}\n />\n </div>\n </div>\n );\n};\n"],"names":["useWindow","useComponentCssInjection","bulkEditPanelCss","useBulkEditPanel","useMemo","jsx","BulkEditRow","jsxs","Table"],"mappings":";;;;;;;;;;;;AAYA,MAAM,SAAY,GAAA,kBAAA;AAoBX,MAAM,gBAAgB,CAAC;AAAA,EAC5B,SAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,wBAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAQ,GAAA,GAAA;AAAA,EACR,GAAG;AACL,CAAwC,KAAA;AACtC,EAAA,MAAM,eAAeA,gBAAU,EAAA;AAC/B,EAAyBC,+BAAA,CAAA;AAAA,IACvB,MAAQ,EAAA,mBAAA;AAAA,IACR,GAAK,EAAAC,eAAA;AAAA,IACL,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A,GACF;AAEJ;;;;"}
@@ -40,7 +40,8 @@ const useBulkEditPanel = ({
40
40
  name: col.name,
41
41
  serverDataType: col.serverDataType ?? "string",
42
42
  type: vuuUtils.isTypeDescriptor(col.type) ? addRenderer(col.type, "input-cell") : "string",
43
- clientSideEditValidationCheck: vuuUtils.hasValidationRules(col.type) ? vuuDataReact.buildValidationChecker(col.type.rules) : void 0
43
+ clientSideEditValidationCheck: vuuUtils.hasValidationRules(col.type) ? vuuDataReact.buildValidationChecker(col.type.rules) : void 0,
44
+ width: 120
44
45
  };
45
46
  }) : dataSource.columns.map((name) => ({
46
47
  editable: true,
@@ -54,17 +55,19 @@ const useBulkEditPanel = ({
54
55
  }, [columns, dataSource.columns]);
55
56
  const handleDataEdited = react.useCallback(
56
57
  ({ isValid = true, row, columnName }) => {
57
- if (!isValid && !isRecorded([row[IDX], columnName], errorsRef.current)) {
58
- errorsRef.current.push([row[IDX], columnName]);
59
- } else if (isValid && isRecorded([row[IDX], columnName], errorsRef.current)) {
60
- errorsRef.current = errorsRef.current.filter(
61
- (error) => !isSameArray(error, [row[IDX], columnName])
62
- );
63
- }
64
- if (rowState === true && errorsRef.current.length === 0) {
65
- onValidationStatusChange(true);
66
- } else {
67
- onValidationStatusChange(false);
58
+ if (columnName && row) {
59
+ if (!isValid && !isRecorded([row[IDX], columnName], errorsRef.current)) {
60
+ errorsRef.current.push([row[IDX], columnName]);
61
+ } else if (isValid && isRecorded([row[IDX], columnName], errorsRef.current)) {
62
+ errorsRef.current = errorsRef.current.filter(
63
+ (error) => !isSameArray(error, [row[IDX], columnName])
64
+ );
65
+ }
66
+ if (rowState === true && errorsRef.current.length === 0) {
67
+ onValidationStatusChange(true);
68
+ } else {
69
+ onValidationStatusChange(false);
70
+ }
68
71
  }
69
72
  },
70
73
  [onValidationStatusChange, rowState]