@vuu-ui/vuu-table 0.8.24-debug → 0.8.25-debug

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // src/header-cell/GroupHeaderCellNext.tsx
1
+ // src/header-cell/GroupHeaderCell.tsx
2
2
  import { OverflowContainer } from "@vuu-ui/vuu-ui-controls";
3
3
  import { useLayoutEffectSkipFirst } from "@vuu-ui/vuu-utils";
4
4
  import cx3 from "clsx";
@@ -186,27 +186,27 @@ var useTableColumnResize = ({
186
186
  import { getColumnStyle } from "@vuu-ui/vuu-utils";
187
187
  import cx2 from "clsx";
188
188
  import { useMemo } from "react";
189
- var useCell = (column, classBase10, isHeader) => (
189
+ var useCell = (column, classBase11, isHeader) => (
190
190
  // TODO measure perf without the memo, might not be worth the cost
191
191
  useMemo(() => {
192
- const className = cx2(classBase10, {
192
+ const className = cx2(classBase11, {
193
193
  vuuPinFloating: column.pin === "floating",
194
194
  vuuPinLeft: column.pin === "left",
195
195
  vuuPinRight: column.pin === "right",
196
196
  vuuEndPin: isHeader && column.endPin,
197
197
  // [`${classBase}-resizing`]: column.resizing,
198
- [`${classBase10}-editable`]: column.editable,
199
- [`${classBase10}-right`]: column.align === "right"
198
+ [`${classBase11}-editable`]: column.editable,
199
+ [`${classBase11}-right`]: column.align === "right"
200
200
  });
201
201
  const style = getColumnStyle(column);
202
202
  return {
203
203
  className,
204
204
  style
205
205
  };
206
- }, [column, classBase10, isHeader])
206
+ }, [column, classBase11, isHeader])
207
207
  );
208
208
 
209
- // src/header-cell/GroupHeaderCellNext.tsx
209
+ // src/header-cell/GroupHeaderCell.tsx
210
210
  import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
211
211
  import { createElement } from "react";
212
212
  var classBase2 = "vuuTableGroupHeaderCell";
@@ -217,7 +217,7 @@ var switchIfChanged = (columns, newColumns) => {
217
217
  return newColumns;
218
218
  }
219
219
  };
220
- var GroupHeaderCellNext = ({
220
+ var GroupHeaderCell = ({
221
221
  column: groupColumn,
222
222
  className: classNameProp,
223
223
  onMoveColumn,
@@ -274,7 +274,6 @@ var GroupHeaderCellNext = ({
274
274
  {
275
275
  allowDragDrop: true,
276
276
  className: `${classBase2}-inner`,
277
- height: 24,
278
277
  onMoveItem: handleMoveItem,
279
278
  overflowPosition: "start",
280
279
  children: columns.map((column) => {
@@ -305,64 +304,28 @@ var GroupHeaderCellNext = ({
305
304
 
306
305
  // src/header-cell/HeaderCell.tsx
307
306
  import cx5 from "clsx";
308
- import { useCallback as useCallback6, useRef as useRef5 } from "react";
307
+ import { useCallback as useCallback5, useRef as useRef4 } from "react";
309
308
 
310
309
  // src/column-menu/ColumnMenu.tsx
311
- import { useContextMenu } from "@vuu-ui/vuu-popups";
310
+ import { PopupMenu } from "@vuu-ui/vuu-popups";
312
311
  import cx4 from "clsx";
313
- import {
314
- useCallback as useCallback5,
315
- useRef as useRef4,
316
- useState as useState3
317
- } from "react";
318
312
  import { jsx as jsx6 } from "react/jsx-runtime";
319
- var getPosition = (element) => {
320
- if (element) {
321
- const { bottom, left } = element.getBoundingClientRect();
322
- return { x: left, y: bottom + 6 };
323
- }
324
- };
325
- var ColumnMenu = ({
326
- className,
327
- column,
328
- ...props
329
- }) => {
330
- const rootRef = useRef4(null);
331
- const [menuOpen, setMenuOpen] = useState3(false);
332
- const [showContextMenu] = useContextMenu();
333
- const handleMenuClose = useCallback5(() => {
334
- setMenuOpen(false);
335
- }, []);
336
- const showColumnMenu = useCallback5(
337
- (e) => {
338
- setMenuOpen(true);
339
- showContextMenu(e, "column-menu", {
340
- column,
341
- ContextMenuProps: {
342
- onClose: handleMenuClose,
343
- position: getPosition(rootRef.current)
344
- }
345
- });
346
- },
347
- [column, handleMenuClose, showContextMenu]
348
- );
313
+ var classBase3 = "vuuColumnMenu";
314
+ var ColumnMenu = ({ className, column }) => {
349
315
  return /* @__PURE__ */ jsx6(
350
- "span",
316
+ PopupMenu,
351
317
  {
352
- ...props,
353
- className: cx4("vuuTable-columnMenu", className, {
354
- "vuuTable-columnMenu-open": menuOpen
355
- }),
356
- "data-icon": "more-vert",
357
- onClick: showColumnMenu,
358
- ref: rootRef
318
+ className: cx4(classBase3, className),
319
+ "data-embedded": true,
320
+ menuLocation: "column-menu",
321
+ menuOptions: { column }
359
322
  }
360
323
  );
361
324
  };
362
325
 
363
326
  // src/header-cell/HeaderCell.tsx
364
327
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
365
- var classBase3 = "vuuTableHeaderCell";
328
+ var classBase4 = "vuuTableHeaderCell";
366
329
  var HeaderCell = ({
367
330
  className: classNameProp,
368
331
  column,
@@ -372,21 +335,21 @@ var HeaderCell = ({
372
335
  }) => {
373
336
  var _a;
374
337
  const { HeaderCellContentRenderer, HeaderCellLabelRenderer } = column;
375
- const rootRef = useRef5(null);
338
+ const rootRef = useRef4(null);
376
339
  const { isResizing, ...resizeProps } = useTableColumnResize({
377
340
  column,
378
341
  onResize,
379
342
  rootRef
380
343
  });
381
- const handleClick = useCallback6(
344
+ const handleClick = useCallback5(
382
345
  (evt) => {
383
346
  !isResizing && (onClick == null ? void 0 : onClick(evt));
384
347
  },
385
348
  [isResizing, onClick]
386
349
  );
387
- const { className, style } = useCell(column, classBase3, true);
350
+ const { className, style } = useCell(column, classBase4, true);
388
351
  const columnMenu = /* @__PURE__ */ jsx7(ColumnMenu, { column });
389
- const columnLabel = HeaderCellLabelRenderer ? /* @__PURE__ */ jsx7(HeaderCellLabelRenderer, { className: `${classBase3}-label`, column }) : /* @__PURE__ */ jsx7("div", { className: `${classBase3}-label`, children: (_a = column.label) != null ? _a : column.name });
352
+ const columnLabel = HeaderCellLabelRenderer ? /* @__PURE__ */ jsx7(HeaderCellLabelRenderer, { className: `${classBase4}-label`, column }) : /* @__PURE__ */ jsx7("div", { className: `${classBase4}-label`, children: (_a = column.label) != null ? _a : column.name });
390
353
  const columnContent = HeaderCellContentRenderer ? [/* @__PURE__ */ jsx7(HeaderCellContentRenderer, { column }, "content")] : [];
391
354
  const sortIndicator = /* @__PURE__ */ jsx7(SortIndicator, { column });
392
355
  const headerItems = column.align === "right" ? [sortIndicator, columnLabel].concat(columnContent).concat(columnMenu) : [columnMenu, columnLabel, sortIndicator].concat(columnContent);
@@ -395,7 +358,7 @@ var HeaderCell = ({
395
358
  {
396
359
  ...htmlAttributes,
397
360
  className: cx5(className, classNameProp, {
398
- [`${classBase3}-resizing`]: isResizing
361
+ [`${classBase4}-resizing`]: isResizing
399
362
  }),
400
363
  onClick: handleClick,
401
364
  ref: rootRef,
@@ -419,8 +382,8 @@ import { useForkRef } from "@salt-ds/core";
419
382
  import cx9 from "clsx";
420
383
  import {
421
384
  forwardRef as forwardRef2,
422
- useRef as useRef16,
423
- useState as useState9
385
+ useRef as useRef15,
386
+ useState as useState8
424
387
  } from "react";
425
388
 
426
389
  // src/Row.tsx
@@ -436,14 +399,14 @@ import cx7 from "clsx";
436
399
  import {
437
400
  forwardRef,
438
401
  memo,
439
- useCallback as useCallback9
402
+ useCallback as useCallback8
440
403
  } from "react";
441
404
 
442
405
  // src/table-cell/TableCell.tsx
443
406
  import { isNumericColumn } from "@vuu-ui/vuu-utils";
444
- import { useCallback as useCallback7 } from "react";
407
+ import { useCallback as useCallback6 } from "react";
445
408
  import { jsx as jsx8 } from "react/jsx-runtime";
446
- var classBase4 = "vuuTableCell";
409
+ var classBase5 = "vuuTableCell";
447
410
  var TableCell = ({
448
411
  column,
449
412
  columnMap,
@@ -451,10 +414,10 @@ var TableCell = ({
451
414
  onDataEdited,
452
415
  row
453
416
  }) => {
454
- const { className, style } = useCell(column, classBase4);
417
+ const { className, style } = useCell(column, classBase5);
455
418
  const { CellRenderer, index, name, valueFormatter } = column;
456
419
  const dataIdx = columnMap[name];
457
- const handleDataItemEdited = useCallback7(
420
+ const handleDataItemEdited = useCallback6(
458
421
  (value) => {
459
422
  if (onDataEdited) {
460
423
  let typedValue = value;
@@ -470,7 +433,7 @@ var TableCell = ({
470
433
  },
471
434
  [column, name, onDataEdited, row]
472
435
  );
473
- const handleClick = useCallback7(
436
+ const handleClick = useCallback6(
474
437
  (evt) => {
475
438
  onClick == null ? void 0 : onClick(evt, column);
476
439
  },
@@ -499,11 +462,11 @@ var TableCell = ({
499
462
 
500
463
  // src/table-cell/TableGroupCell.tsx
501
464
  import { getGroupValueAndOffset, metadataKeys } from "@vuu-ui/vuu-utils";
502
- import { useCallback as useCallback8 } from "react";
465
+ import { useCallback as useCallback7 } from "react";
503
466
  import cx6 from "clsx";
504
467
  import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
505
468
  var { IS_LEAF } = metadataKeys;
506
- var classBase5 = "vuuTableGroupCell";
469
+ var classBase6 = "vuuTableGroupCell";
507
470
  var TableGroupCell = ({
508
471
  column,
509
472
  columnMap,
@@ -512,15 +475,15 @@ var TableGroupCell = ({
512
475
  }) => {
513
476
  const { columns } = column;
514
477
  const [value, offset] = getGroupValueAndOffset(columns, row, columnMap);
515
- const { className, style } = useCell(column, classBase5);
516
- const handleClick = useCallback8(
478
+ const { className, style } = useCell(column, classBase6);
479
+ const handleClick = useCallback7(
517
480
  (evt) => {
518
481
  onClick == null ? void 0 : onClick(evt, column);
519
482
  },
520
483
  [column, onClick]
521
484
  );
522
485
  const isLeaf = row[IS_LEAF];
523
- const spacers = Array(offset).fill(0).map((n, i) => /* @__PURE__ */ jsx9("span", { className: `${classBase5}-spacer` }, i));
486
+ const spacers = Array(offset).fill(0).map((n, i) => /* @__PURE__ */ jsx9("span", { className: `${classBase6}-spacer` }, i));
524
487
  return /* @__PURE__ */ jsxs6(
525
488
  "div",
526
489
  {
@@ -530,7 +493,7 @@ var TableGroupCell = ({
530
493
  onClick: isLeaf ? void 0 : handleClick,
531
494
  children: [
532
495
  spacers,
533
- isLeaf ? null : /* @__PURE__ */ jsx9("span", { className: `${classBase5}-toggle`, "data-icon": "triangle-right" }),
496
+ isLeaf ? null : /* @__PURE__ */ jsx9("span", { className: `${classBase6}-toggle`, "data-icon": "triangle-right" }),
534
497
  /* @__PURE__ */ jsx9("span", { children: value })
535
498
  ]
536
499
  }
@@ -540,14 +503,14 @@ var TableGroupCell = ({
540
503
  // src/Row.tsx
541
504
  import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
542
505
  var { IDX, IS_EXPANDED, SELECTED } = metadataKeys2;
543
- var classBase6 = "vuuTableRow";
506
+ var classBase7 = "vuuTableRow";
544
507
  var RowProxy = forwardRef(
545
508
  function RowProxy2({ height }, forwardedRef) {
546
509
  return /* @__PURE__ */ jsx10(
547
510
  "div",
548
511
  {
549
512
  "aria-hidden": true,
550
- className: cx7(classBase6, `${classBase6}-proxy`),
513
+ className: cx7(classBase7, `${classBase7}-proxy`),
551
514
  ref: forwardedRef,
552
515
  style: { height }
553
516
  }
@@ -575,30 +538,30 @@ var Row = memo(
575
538
  [IS_EXPANDED]: isExpanded,
576
539
  [SELECTED]: selectionStatus
577
540
  } = row;
578
- const handleRowClick = useCallback9(
541
+ const handleRowClick = useCallback8(
579
542
  (evt) => {
580
543
  const rangeSelect = evt.shiftKey;
581
544
  const keepExistingSelection = evt.ctrlKey || evt.metaKey;
582
- onClick == null ? void 0 : onClick(row, rangeSelect, keepExistingSelection);
545
+ onClick == null ? void 0 : onClick(evt, row, rangeSelect, keepExistingSelection);
583
546
  },
584
547
  [onClick, row]
585
548
  );
586
549
  const { True, First, Last } = RowSelected;
587
550
  const className = cx7(
588
- classBase6,
551
+ classBase7,
589
552
  classNameProp,
590
553
  classNameGenerator == null ? void 0 : classNameGenerator(row, columnMap),
591
554
  {
592
- [`${classBase6}-even`]: zebraStripes && rowIndex % 2 === 0,
593
- [`${classBase6}-expanded`]: isExpanded,
594
- [`${classBase6}-highlighted`]: highlighted,
595
- [`${classBase6}-selected`]: selectionStatus & True,
596
- [`${classBase6}-selectedStart`]: selectionStatus & First,
597
- [`${classBase6}-selectedEnd`]: selectionStatus & Last
555
+ [`${classBase7}-even`]: zebraStripes && rowIndex % 2 === 0,
556
+ [`${classBase7}-expanded`]: isExpanded,
557
+ [`${classBase7}-highlighted`]: highlighted,
558
+ [`${classBase7}-selected`]: selectionStatus & True,
559
+ [`${classBase7}-selectedStart`]: selectionStatus & First,
560
+ [`${classBase7}-selectedEnd`]: selectionStatus & Last
598
561
  }
599
562
  );
600
563
  const style = { transform: `translate3d(0px, ${offset}px, 0px)` };
601
- const handleGroupCellClick = useCallback9(
564
+ const handleGroupCellClick = useCallback8(
602
565
  (evt, column) => {
603
566
  if (isGroupColumn(column) || isJsonGroup(column, row, columnMap)) {
604
567
  evt.stopPropagation();
@@ -616,7 +579,7 @@ var Row = memo(
616
579
  onClick: handleRowClick,
617
580
  style,
618
581
  children: [
619
- /* @__PURE__ */ jsx10("span", { className: `${classBase6}-selectionDecorator vuuStickyLeft` }),
582
+ /* @__PURE__ */ jsx10("span", { className: `${classBase7}-selectionDecorator vuuStickyLeft` }),
620
583
  virtualColSpan > 0 ? /* @__PURE__ */ jsx10("div", { className: "vuuTableCell", style: { width: virtualColSpan } }) : null,
621
584
  columns.filter(isNotHidden).map((column) => {
622
585
  const isGroup = isGroupColumn(column);
@@ -634,7 +597,7 @@ var Row = memo(
634
597
  column.name
635
598
  );
636
599
  }),
637
- /* @__PURE__ */ jsx10("span", { className: `${classBase6}-selectionDecorator vuuStickyRight` })
600
+ /* @__PURE__ */ jsx10("span", { className: `${classBase7}-selectionDecorator vuuStickyRight` })
638
601
  ]
639
602
  }
640
603
  );
@@ -652,16 +615,16 @@ import {
652
615
  useDragDrop
653
616
  } from "@vuu-ui/vuu-ui-controls";
654
617
  import { moveColumnTo, visibleColumnAtIndex } from "@vuu-ui/vuu-utils";
655
- import { useCallback as useCallback10, useRef as useRef6 } from "react";
618
+ import { useCallback as useCallback9, useRef as useRef5 } from "react";
656
619
  var useTableHeader = ({
657
620
  columns,
658
621
  onMoveColumn,
659
622
  onSortColumn,
660
623
  tableConfig
661
624
  }) => {
662
- const containerRef = useRef6(null);
663
- const scrollingContainerRef = useRef6(null);
664
- const setContainerRef = useCallback10((el) => {
625
+ const containerRef = useRef5(null);
626
+ const scrollingContainerRef = useRef5(null);
627
+ const setContainerRef = useCallback9((el) => {
665
628
  containerRef.current = el;
666
629
  if (el) {
667
630
  scrollingContainerRef.current = el.closest(".vuuTable-contentContainer");
@@ -669,7 +632,7 @@ var useTableHeader = ({
669
632
  scrollingContainerRef.current = null;
670
633
  }
671
634
  }, []);
672
- const handleDropColumnHeader = useCallback10(
635
+ const handleDropColumnHeader = useCallback9(
673
636
  ({ fromIndex: moveFrom, toIndex: moveTo }) => {
674
637
  const column = columns[moveFrom];
675
638
  const orderedColumns = moveColumnTo(columns, column, moveTo);
@@ -685,7 +648,7 @@ var useTableHeader = ({
685
648
  },
686
649
  [columns, onMoveColumn, tableConfig.columns]
687
650
  );
688
- const handleColumnHeaderClick = useCallback10(
651
+ const handleColumnHeaderClick = useCallback9(
689
652
  (evt) => {
690
653
  var _a;
691
654
  const targetElement = evt.target;
@@ -725,7 +688,7 @@ var useTableHeader = ({
725
688
  import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
726
689
  var TableHeader = memo2(
727
690
  ({
728
- classBase: classBase10 = "vuuTable",
691
+ classBase: classBase11 = "vuuTable",
729
692
  columns,
730
693
  headings,
731
694
  onMoveColumn,
@@ -749,9 +712,9 @@ var TableHeader = memo2(
749
712
  onSortColumn,
750
713
  tableConfig
751
714
  });
752
- return /* @__PURE__ */ jsxs8("div", { className: `${classBase10}-col-headings`, ref: setContainerRef, children: [
715
+ return /* @__PURE__ */ jsxs8("div", { className: `${classBase11}-col-headings`, ref: setContainerRef, children: [
753
716
  headings.map((colHeaders, i) => /* @__PURE__ */ jsx11("div", { className: "vuuTable-heading", children: colHeaders.map(({ label, width }, j) => /* @__PURE__ */ jsx11("div", { className: "vuuTable-headingCell", style: { width }, children: label }, j)) }, i)),
754
- /* @__PURE__ */ jsxs8("div", { className: `${classBase10}-col-headers`, role: "row", children: [
717
+ /* @__PURE__ */ jsxs8("div", { className: `${classBase11}-col-headers`, role: "row", children: [
755
718
  virtualColSpan > 0 ? /* @__PURE__ */ jsx11(
756
719
  "div",
757
720
  {
@@ -762,7 +725,7 @@ var TableHeader = memo2(
762
725
  ) : null,
763
726
  columns.filter(isNotHidden2).map(
764
727
  (col, i) => isGroupColumn2(col) ? /* @__PURE__ */ jsx11(
765
- GroupHeaderCellNext,
728
+ GroupHeaderCell,
766
729
  {
767
730
  "aria-colindex": col.index,
768
731
  column: col,
@@ -802,6 +765,7 @@ import {
802
765
  } from "@vuu-ui/vuu-ui-controls";
803
766
  import {
804
767
  applySort,
768
+ asDataSourceRowObject,
805
769
  buildColumnMap as buildColumnMap2,
806
770
  getIndexFromRowElement as getIndexFromRowElement3,
807
771
  isGroupColumn as isGroupColumn4,
@@ -812,11 +776,11 @@ import {
812
776
  useLayoutEffectSkipFirst as useLayoutEffectSkipFirst2
813
777
  } from "@vuu-ui/vuu-utils";
814
778
  import {
815
- useCallback as useCallback19,
779
+ useCallback as useCallback18,
816
780
  useEffect as useEffect4,
817
781
  useMemo as useMemo7,
818
- useRef as useRef14,
819
- useState as useState7
782
+ useRef as useRef13,
783
+ useState as useState6
820
784
  } from "react";
821
785
 
822
786
  // src/context-menu/buildContextMenuDescriptors.ts
@@ -1139,7 +1103,7 @@ var updateTableConfig = (config, action) => {
1139
1103
  // src/useCellEditing.ts
1140
1104
  import { isCharacterKey } from "@vuu-ui/vuu-utils";
1141
1105
  import {
1142
- useCallback as useCallback11
1106
+ useCallback as useCallback10
1143
1107
  } from "react";
1144
1108
 
1145
1109
  // src/table-dom-utils.ts
@@ -1195,10 +1159,10 @@ var howFarIsRowOutsideViewport = (rowEl, totalHeaderHeight, contentContainer = r
1195
1159
 
1196
1160
  // src/useCellEditing.ts
1197
1161
  var useCellEditing = ({ navigate }) => {
1198
- const commitHandler = useCallback11(() => {
1162
+ const commitHandler = useCallback10(() => {
1199
1163
  navigate();
1200
1164
  }, [navigate]);
1201
- const editInput = useCallback11(
1165
+ const editInput = useCallback10(
1202
1166
  (evt) => {
1203
1167
  const cellEl = evt.target;
1204
1168
  const input = cellEl.matches("input") ? cellEl : cellEl.querySelector("input");
@@ -1209,7 +1173,7 @@ var useCellEditing = ({ navigate }) => {
1209
1173
  },
1210
1174
  []
1211
1175
  );
1212
- const focusInput = useCallback11(
1176
+ const focusInput = useCallback10(
1213
1177
  (evt) => {
1214
1178
  const cellEl = evt.target;
1215
1179
  const input = cellEl.querySelector("input");
@@ -1220,7 +1184,7 @@ var useCellEditing = ({ navigate }) => {
1220
1184
  },
1221
1185
  []
1222
1186
  );
1223
- const handleKeyDown = useCallback11(
1187
+ const handleKeyDown = useCallback10(
1224
1188
  (e) => {
1225
1189
  const el = e.target;
1226
1190
  if (cellIsTextInput(el)) {
@@ -1233,7 +1197,7 @@ var useCellEditing = ({ navigate }) => {
1233
1197
  },
1234
1198
  [editInput, focusInput]
1235
1199
  );
1236
- const handleDoubleClick = useCallback11(
1200
+ const handleDoubleClick = useCallback10(
1237
1201
  (e) => {
1238
1202
  const el = e.target;
1239
1203
  if (el.matches("input") || el.querySelector("input")) {
@@ -1243,14 +1207,14 @@ var useCellEditing = ({ navigate }) => {
1243
1207
  },
1244
1208
  [editInput]
1245
1209
  );
1246
- const handleBlur = useCallback11(
1210
+ const handleBlur = useCallback10(
1247
1211
  (e) => {
1248
1212
  const el = e.target;
1249
1213
  el.removeEventListener("vuu-commit", commitHandler, true);
1250
1214
  },
1251
1215
  [commitHandler]
1252
1216
  );
1253
- const handleFocus = useCallback11(
1217
+ const handleFocus = useCallback10(
1254
1218
  (e) => {
1255
1219
  const el = e.target;
1256
1220
  el.addEventListener("vuu-commit", commitHandler, true);
@@ -1267,7 +1231,7 @@ var useCellEditing = ({ navigate }) => {
1267
1231
 
1268
1232
  // src/useDataSource.ts
1269
1233
  import { getFullRange, NULL_RANGE, rangesAreSame } from "@vuu-ui/vuu-utils";
1270
- import { useCallback as useCallback12, useEffect, useMemo as useMemo2, useRef as useRef7, useState as useState4 } from "react";
1234
+ import { useCallback as useCallback11, useEffect, useMemo as useMemo2, useRef as useRef6, useState as useState3 } from "react";
1271
1235
 
1272
1236
  // src/moving-window.ts
1273
1237
  import {
@@ -1340,17 +1304,17 @@ var useDataSource = ({
1340
1304
  range = NULL_RANGE,
1341
1305
  renderBufferSize = 0
1342
1306
  }) => {
1343
- const [, forceUpdate] = useState4(null);
1344
- const data = useRef7([]);
1345
- const isMounted = useRef7(true);
1346
- const hasUpdated = useRef7(false);
1347
- const rangeRef = useRef7(range);
1307
+ const [, forceUpdate] = useState3(null);
1308
+ const data = useRef6([]);
1309
+ const isMounted = useRef6(true);
1310
+ const hasUpdated = useRef6(false);
1311
+ const rangeRef = useRef6(range);
1348
1312
  const dataWindow = useMemo2(
1349
1313
  () => new MovingWindow(getFullRange(range, renderBufferSize)),
1350
1314
  // eslint-disable-next-line react-hooks/exhaustive-deps
1351
1315
  []
1352
1316
  );
1353
- const setData = useCallback12(
1317
+ const setData = useCallback11(
1354
1318
  (updates) => {
1355
1319
  for (const row of updates) {
1356
1320
  dataWindow.add(row);
@@ -1363,7 +1327,7 @@ var useDataSource = ({
1363
1327
  },
1364
1328
  [dataWindow]
1365
1329
  );
1366
- const datasourceMessageHandler = useCallback12(
1330
+ const datasourceMessageHandler = useCallback11(
1367
1331
  (message) => {
1368
1332
  if (message.type === "subscribed") {
1369
1333
  onSubscribed == null ? void 0 : onSubscribed(message);
@@ -1386,7 +1350,7 @@ var useDataSource = ({
1386
1350
  },
1387
1351
  [dataWindow, onFeatureInvocation, onSizeChange, onSubscribed, setData]
1388
1352
  );
1389
- const getSelectedRows = useCallback12(() => {
1353
+ const getSelectedRows = useCallback11(() => {
1390
1354
  return dataWindow.getSelectedRows();
1391
1355
  }, [dataWindow]);
1392
1356
  useEffect(() => {
@@ -1410,7 +1374,7 @@ var useDataSource = ({
1410
1374
  );
1411
1375
  }
1412
1376
  }, [dataSource, datasourceMessageHandler, range, renderBufferSize]);
1413
- const setRange = useCallback12(
1377
+ const setRange = useCallback11(
1414
1378
  (range2) => {
1415
1379
  if (!rangesAreSame(range2, rangeRef.current)) {
1416
1380
  const fullRange = getFullRange(range2, renderBufferSize);
@@ -1431,9 +1395,9 @@ var useDataSource = ({
1431
1395
  };
1432
1396
 
1433
1397
  // src/useInitialValue.ts
1434
- import { useMemo as useMemo3, useRef as useRef8 } from "react";
1398
+ import { useMemo as useMemo3, useRef as useRef7 } from "react";
1435
1399
  var useInitialValue = (value) => {
1436
- const ref = useRef8(value);
1400
+ const ref = useRef7(value);
1437
1401
  return useMemo3(() => ref.current, []);
1438
1402
  };
1439
1403
 
@@ -1441,9 +1405,9 @@ var useInitialValue = (value) => {
1441
1405
  import { getIndexFromRowElement } from "@vuu-ui/vuu-utils";
1442
1406
  import { useControlled } from "@salt-ds/core";
1443
1407
  import {
1444
- useCallback as useCallback13,
1408
+ useCallback as useCallback12,
1445
1409
  useEffect as useEffect2,
1446
- useRef as useRef9
1410
+ useRef as useRef8
1447
1411
  } from "react";
1448
1412
  var rowNavigationKeys = /* @__PURE__ */ new Set([
1449
1413
  "Home",
@@ -1513,17 +1477,17 @@ var useKeyboardNavigation = ({
1513
1477
  viewportRowCount
1514
1478
  }) => {
1515
1479
  var _a;
1516
- const focusedCellPos = useRef9([-1, -1]);
1517
- const focusableCell = useRef9();
1518
- const activeCellPos = useRef9([-1, 0]);
1519
- const highlightedIndexRef = useRef9();
1480
+ const focusedCellPos = useRef8([-1, -1]);
1481
+ const focusableCell = useRef8();
1482
+ const activeCellPos = useRef8([-1, 0]);
1483
+ const highlightedIndexRef = useRef8();
1520
1484
  const [highlightedIndex, setHighlightedIdx] = useControlled({
1521
1485
  controlled: highlightedIndexProp,
1522
1486
  default: defaultHighlightedIndex,
1523
1487
  name: "UseKeyboardNavigation"
1524
1488
  });
1525
1489
  highlightedIndexRef.current = highlightedIndex;
1526
- const setHighlightedIndex = useCallback13(
1490
+ const setHighlightedIndex = useCallback12(
1527
1491
  (idx, fromKeyboard = false) => {
1528
1492
  onHighlight == null ? void 0 : onHighlight(idx);
1529
1493
  setHighlightedIdx(idx);
@@ -1550,7 +1514,7 @@ var useKeyboardNavigation = ({
1550
1514
  }
1551
1515
  return NULL_CELL_POS;
1552
1516
  };
1553
- const focusCell = useCallback13(
1517
+ const focusCell = useCallback12(
1554
1518
  (cellPos) => {
1555
1519
  var _a2;
1556
1520
  if (containerRef.current) {
@@ -1570,7 +1534,7 @@ var useKeyboardNavigation = ({
1570
1534
  // be often whilst scrolling - store range in a a ref ?
1571
1535
  [containerRef, requestScroll]
1572
1536
  );
1573
- const setActiveCell = useCallback13(
1537
+ const setActiveCell = useCallback12(
1574
1538
  (rowIdx, colIdx, fromKeyboard = false) => {
1575
1539
  const pos = [rowIdx, colIdx];
1576
1540
  activeCellPos.current = pos;
@@ -1585,7 +1549,7 @@ var useKeyboardNavigation = ({
1585
1549
  },
1586
1550
  [focusCell, navigationStyle, setHighlightedIdx]
1587
1551
  );
1588
- const nextPageItemIdx = useCallback13(
1552
+ const nextPageItemIdx = useCallback12(
1589
1553
  (key, [rowIdx, colIdx]) => new Promise((resolve) => {
1590
1554
  let newRowIdx = rowIdx;
1591
1555
  switch (key) {
@@ -1624,7 +1588,7 @@ var useKeyboardNavigation = ({
1624
1588
  }),
1625
1589
  [requestScroll, rowCount, viewportRowCount]
1626
1590
  );
1627
- const handleFocus = useCallback13(() => {
1591
+ const handleFocus = useCallback12(() => {
1628
1592
  var _a2;
1629
1593
  if (disableHighlightOnFocus !== true) {
1630
1594
  if ((_a2 = containerRef.current) == null ? void 0 : _a2.contains(document.activeElement)) {
@@ -1643,7 +1607,7 @@ var useKeyboardNavigation = ({
1643
1607
  navigationStyle,
1644
1608
  setHighlightedIdx
1645
1609
  ]);
1646
- const navigateChildItems = useCallback13(
1610
+ const navigateChildItems = useCallback12(
1647
1611
  async (key) => {
1648
1612
  const [nextRowIdx, nextColIdx] = isPagingKey(key) ? await nextPageItemIdx(key, activeCellPos.current) : nextCellPos(key, activeCellPos.current, columnCount, rowCount);
1649
1613
  const [rowIdx, colIdx] = activeCellPos.current;
@@ -1653,13 +1617,13 @@ var useKeyboardNavigation = ({
1653
1617
  },
1654
1618
  [columnCount, nextPageItemIdx, rowCount, setActiveCell]
1655
1619
  );
1656
- const scrollRowIntoViewIfNecessary = useCallback13(
1620
+ const scrollRowIntoViewIfNecessary = useCallback12(
1657
1621
  (rowIndex) => {
1658
1622
  requestScroll == null ? void 0 : requestScroll({ type: "scroll-row", rowIndex });
1659
1623
  },
1660
1624
  [requestScroll]
1661
1625
  );
1662
- const moveHighlightedRow = useCallback13(
1626
+ const moveHighlightedRow = useCallback12(
1663
1627
  async (key) => {
1664
1628
  const { current: highlighted } = highlightedIndexRef;
1665
1629
  const [nextRowIdx] = isPagingKey(key) ? await nextPageItemIdx(key, [highlighted != null ? highlighted : -1, 0]) : nextCellPos(key, [highlighted != null ? highlighted : -1, 0], columnCount, rowCount);
@@ -1681,7 +1645,7 @@ var useKeyboardNavigation = ({
1681
1645
  scrollRowIntoViewIfNecessary(highlightedIndexProp);
1682
1646
  }
1683
1647
  }, [highlightedIndexProp, scrollRowIntoViewIfNecessary]);
1684
- const handleKeyDown = useCallback13(
1648
+ const handleKeyDown = useCallback12(
1685
1649
  (e) => {
1686
1650
  if (rowCount > 0 && isNavigationKey(e.key, navigationStyle)) {
1687
1651
  e.preventDefault();
@@ -1695,7 +1659,7 @@ var useKeyboardNavigation = ({
1695
1659
  },
1696
1660
  [rowCount, navigationStyle, moveHighlightedRow, navigateChildItems]
1697
1661
  );
1698
- const handleClick = useCallback13(
1662
+ const handleClick = useCallback12(
1699
1663
  // Might not be a cell e.g the Settings button
1700
1664
  (evt) => {
1701
1665
  const target = evt.target;
@@ -1707,10 +1671,10 @@ var useKeyboardNavigation = ({
1707
1671
  },
1708
1672
  [setActiveCell]
1709
1673
  );
1710
- const handleMouseLeave = useCallback13(() => {
1674
+ const handleMouseLeave = useCallback12(() => {
1711
1675
  setHighlightedIndex(-1);
1712
1676
  }, [setHighlightedIndex]);
1713
- const handleMouseMove = useCallback13(
1677
+ const handleMouseMove = useCallback12(
1714
1678
  (evt) => {
1715
1679
  const idx = closestRowIndex(evt.target);
1716
1680
  if (idx !== -1 && idx !== highlightedIndexRef.current) {
@@ -1719,7 +1683,7 @@ var useKeyboardNavigation = ({
1719
1683
  },
1720
1684
  [setHighlightedIndex]
1721
1685
  );
1722
- const navigate = useCallback13(() => {
1686
+ const navigate = useCallback12(() => {
1723
1687
  navigateChildItems("ArrowDown");
1724
1688
  }, [navigateChildItems]);
1725
1689
  const fullyRendered = ((_a = containerRef.current) == null ? void 0 : _a.firstChild) != null;
@@ -1753,8 +1717,8 @@ import {
1753
1717
  selectItem
1754
1718
  } from "@vuu-ui/vuu-utils";
1755
1719
  import {
1756
- useCallback as useCallback14,
1757
- useRef as useRef10
1720
+ useCallback as useCallback13,
1721
+ useRef as useRef9
1758
1722
  } from "react";
1759
1723
  var { IDX: IDX2 } = metadataKeys4;
1760
1724
  var NO_SELECTION = [];
@@ -1767,14 +1731,14 @@ var useSelection = ({
1767
1731
  onSelectionChange
1768
1732
  }) => {
1769
1733
  selectionModel === "extended" || selectionModel === "checkbox";
1770
- const lastActiveRef = useRef10(-1);
1771
- const selectedRef = useRef10(NO_SELECTION);
1772
- const isSelectionEvent = useCallback14(
1734
+ const lastActiveRef = useRef9(-1);
1735
+ const selectedRef = useRef9(NO_SELECTION);
1736
+ const isSelectionEvent = useCallback13(
1773
1737
  (evt) => selectionKeys.includes(evt.key),
1774
1738
  [selectionKeys]
1775
1739
  );
1776
- const handleRowClick = useCallback14(
1777
- (row, rangeSelect, keepExistingSelection) => {
1740
+ const handleRowClick = useCallback13(
1741
+ (evt, row, rangeSelect, keepExistingSelection) => {
1778
1742
  const { [IDX2]: idx } = row;
1779
1743
  const { current: active } = lastActiveRef;
1780
1744
  const { current: selected } = selectedRef;
@@ -1794,7 +1758,7 @@ var useSelection = ({
1794
1758
  },
1795
1759
  [onSelect, onSelectionChange, selectionModel]
1796
1760
  );
1797
- const handleKeyDown = useCallback14(
1761
+ const handleKeyDown = useCallback13(
1798
1762
  (e) => {
1799
1763
  if (isSelectionEvent(e)) {
1800
1764
  const { current: rowIndex } = highlightedIndexRef;
@@ -1819,7 +1783,7 @@ var useSelection = ({
1819
1783
  // src/useTableContextMenu.ts
1820
1784
  import { useContextMenu as usePopupContextMenu } from "@vuu-ui/vuu-popups";
1821
1785
  import { buildColumnMap, getIndexFromRowElement as getIndexFromRowElement2 } from "@vuu-ui/vuu-utils";
1822
- import { useCallback as useCallback15 } from "react";
1786
+ import { useCallback as useCallback14 } from "react";
1823
1787
  var NO_ROWS = [];
1824
1788
  var useTableContextMenu = ({
1825
1789
  columns,
@@ -1828,7 +1792,7 @@ var useTableContextMenu = ({
1828
1792
  getSelectedRows
1829
1793
  }) => {
1830
1794
  const [showContextMenu] = usePopupContextMenu();
1831
- const onContextMenu = useCallback15(
1795
+ const onContextMenu = useCallback14(
1832
1796
  (evt) => {
1833
1797
  const target = evt.target;
1834
1798
  const cellEl = target == null ? void 0 : target.closest("div[role='cell']");
@@ -2167,12 +2131,12 @@ import {
2167
2131
  itemsChanged
2168
2132
  } from "@vuu-ui/vuu-utils";
2169
2133
  import {
2170
- useCallback as useCallback16,
2134
+ useCallback as useCallback15,
2171
2135
  useEffect as useEffect3,
2172
2136
  useImperativeHandle,
2173
2137
  useMemo as useMemo4,
2174
- useRef as useRef11,
2175
- useState as useState5
2138
+ useRef as useRef10,
2139
+ useState as useState4
2176
2140
  } from "react";
2177
2141
  var SCROLL_MOVE_CHECK_THRESHOLD = 100;
2178
2142
  var HORIZONTAL_SCROLL_BUFFER = 200;
@@ -2224,8 +2188,8 @@ var useCallbackRef = ({
2224
2188
  onAttach,
2225
2189
  onDetach
2226
2190
  }) => {
2227
- const ref = useRef11(null);
2228
- const callbackRef = useCallback16(
2191
+ const ref = useRef10(null);
2192
+ const callbackRef = useCallback15(
2229
2193
  (el) => {
2230
2194
  if (el) {
2231
2195
  ref.current = el;
@@ -2251,21 +2215,21 @@ var useTableScroll = ({
2251
2215
  setRange,
2252
2216
  viewportMeasurements
2253
2217
  }) => {
2254
- const firstRowRef = useRef11(0);
2255
- const rowHeightRef = useRef11(rowHeight);
2256
- const contentContainerScrolledRef = useRef11(false);
2257
- const contentContainerPosRef = useRef11({
2218
+ const firstRowRef = useRef10(0);
2219
+ const rowHeightRef = useRef10(rowHeight);
2220
+ const contentContainerScrolledRef = useRef10(false);
2221
+ const contentContainerPosRef = useRef10({
2258
2222
  scrollTop: 0,
2259
2223
  scrollLeft: 0
2260
2224
  });
2261
- const scrollbarContainerScrolledRef = useRef11(false);
2262
- const scrollbarContainerPosRef = useRef11({
2225
+ const scrollbarContainerScrolledRef = useRef10(false);
2226
+ const scrollbarContainerPosRef = useRef10({
2263
2227
  scrollTop: 0,
2264
2228
  scrollLeft: 0
2265
2229
  });
2266
- const scrollbarContainerRef = useRef11(null);
2267
- const contentContainerRef = useRef11(null);
2268
- const lastHorizontalScrollCheckPoint = useRef11(0);
2230
+ const scrollbarContainerRef = useRef10(null);
2231
+ const contentContainerRef = useRef10(null);
2232
+ const lastHorizontalScrollCheckPoint = useRef10(0);
2269
2233
  const {
2270
2234
  appliedPageSize,
2271
2235
  isVirtualScroll,
@@ -2273,9 +2237,9 @@ var useTableScroll = ({
2273
2237
  totalHeaderHeight,
2274
2238
  viewportWidth
2275
2239
  } = viewportMeasurements;
2276
- const columnsWithinViewportRef = useRef11([]);
2277
- const [, forceRefresh] = useState5({});
2278
- const preSpanRef = useRef11(0);
2240
+ const columnsWithinViewportRef = useRef10([]);
2241
+ const [, forceRefresh] = useState4({});
2242
+ const preSpanRef = useRef10(0);
2279
2243
  useMemo4(() => {
2280
2244
  const [visibleColumns, offset] = getColumnsInViewport(
2281
2245
  columns,
@@ -2285,7 +2249,7 @@ var useTableScroll = ({
2285
2249
  preSpanRef.current = offset;
2286
2250
  columnsWithinViewportRef.current = visibleColumns;
2287
2251
  }, [viewportWidth, columns]);
2288
- const handleHorizontalScroll = useCallback16(
2252
+ const handleHorizontalScroll = useCallback15(
2289
2253
  (scrollLeft) => {
2290
2254
  contentContainerPosRef.current.scrollLeft = scrollLeft;
2291
2255
  onHorizontalScroll == null ? void 0 : onHorizontalScroll(scrollLeft);
@@ -2305,7 +2269,7 @@ var useTableScroll = ({
2305
2269
  },
2306
2270
  [columns, onHorizontalScroll, viewportWidth]
2307
2271
  );
2308
- const handleVerticalScroll = useCallback16(
2272
+ const handleVerticalScroll = useCallback15(
2309
2273
  (scrollTop, pctScrollTop) => {
2310
2274
  contentContainerPosRef.current.scrollTop = scrollTop;
2311
2275
  onVerticalScroll == null ? void 0 : onVerticalScroll(scrollTop, pctScrollTop);
@@ -2324,7 +2288,7 @@ var useTableScroll = ({
2324
2288
  viewportRowCount
2325
2289
  ]
2326
2290
  );
2327
- const handleScrollbarContainerScroll = useCallback16(() => {
2291
+ const handleScrollbarContainerScroll = useCallback15(() => {
2328
2292
  const { current: contentContainer } = contentContainerRef;
2329
2293
  const { current: scrollbarContainer } = scrollbarContainerRef;
2330
2294
  const { current: contentContainerScrolled } = contentContainerScrolledRef;
@@ -2347,7 +2311,7 @@ var useTableScroll = ({
2347
2311
  }
2348
2312
  onVerticalScrollInSitu == null ? void 0 : onVerticalScrollInSitu(0);
2349
2313
  }, [onVerticalScrollInSitu]);
2350
- const handleContentContainerScroll = useCallback16(() => {
2314
+ const handleContentContainerScroll = useCallback15(() => {
2351
2315
  const { current: scrollbarContainerScrolled } = scrollbarContainerScrolledRef;
2352
2316
  const { current: contentContainer } = contentContainerRef;
2353
2317
  const { current: scrollbarContainer } = scrollbarContainerRef;
@@ -2378,7 +2342,7 @@ var useTableScroll = ({
2378
2342
  }
2379
2343
  }
2380
2344
  }, [handleVerticalScroll, handleHorizontalScroll]);
2381
- const handleAttachScrollbarContainer = useCallback16(
2345
+ const handleAttachScrollbarContainer = useCallback15(
2382
2346
  (el) => {
2383
2347
  scrollbarContainerRef.current = el;
2384
2348
  el.addEventListener("scroll", handleScrollbarContainerScroll, {
@@ -2387,14 +2351,14 @@ var useTableScroll = ({
2387
2351
  },
2388
2352
  [handleScrollbarContainerScroll]
2389
2353
  );
2390
- const handleDetachScrollbarContainer = useCallback16(
2354
+ const handleDetachScrollbarContainer = useCallback15(
2391
2355
  (el) => {
2392
2356
  scrollbarContainerRef.current = null;
2393
2357
  el.removeEventListener("scroll", handleScrollbarContainerScroll);
2394
2358
  },
2395
2359
  [handleScrollbarContainerScroll]
2396
2360
  );
2397
- const handleAttachContentContainer = useCallback16(
2361
+ const handleAttachContentContainer = useCallback15(
2398
2362
  (el) => {
2399
2363
  contentContainerRef.current = el;
2400
2364
  el.addEventListener("scroll", handleContentContainerScroll, {
@@ -2403,7 +2367,7 @@ var useTableScroll = ({
2403
2367
  },
2404
2368
  [handleContentContainerScroll]
2405
2369
  );
2406
- const handleDetachContentContainer = useCallback16(
2370
+ const handleDetachContentContainer = useCallback15(
2407
2371
  (el) => {
2408
2372
  contentContainerRef.current = null;
2409
2373
  el.removeEventListener("scroll", handleContentContainerScroll);
@@ -2418,7 +2382,7 @@ var useTableScroll = ({
2418
2382
  onAttach: handleAttachScrollbarContainer,
2419
2383
  onDetach: handleDetachScrollbarContainer
2420
2384
  });
2421
- const requestScroll = useCallback16(
2385
+ const requestScroll = useCallback15(
2422
2386
  (scrollRequest) => {
2423
2387
  const { current: contentContainer } = contentContainerRef;
2424
2388
  if (contentContainer) {
@@ -2435,6 +2399,7 @@ var useTableScroll = ({
2435
2399
  activeRow,
2436
2400
  totalHeaderHeight
2437
2401
  );
2402
+ console.log(`outside viewport ? ${direction} ${distance}`);
2438
2403
  if (direction && distance) {
2439
2404
  if (isVirtualScroll) {
2440
2405
  const offset = direction === "down" ? 1 : -1;
@@ -2566,7 +2531,7 @@ import {
2566
2531
  measurePinnedColumns,
2567
2532
  virtualRowPositioning
2568
2533
  } from "@vuu-ui/vuu-utils";
2569
- import { useCallback as useCallback17, useMemo as useMemo5, useRef as useRef12 } from "react";
2534
+ import { useCallback as useCallback16, useMemo as useMemo5, useRef as useRef11 } from "react";
2570
2535
  var MAX_PIXEL_HEIGHT = 1e7;
2571
2536
  var UNMEASURED_VIEWPORT = {
2572
2537
  appliedPageSize: 0,
@@ -2595,8 +2560,8 @@ var useTableViewport = ({
2595
2560
  selectionEndSize = 4,
2596
2561
  size
2597
2562
  }) => {
2598
- const inSituRowOffsetRef = useRef12(0);
2599
- const pctScrollTopRef = useRef12(0);
2563
+ const inSituRowOffsetRef = useRef11(0);
2564
+ const pctScrollTopRef = useRef11(0);
2600
2565
  const pixelContentHeight = Math.min(rowHeight * rowCount, MAX_PIXEL_HEIGHT);
2601
2566
  const virtualContentHeight = rowCount * rowHeight;
2602
2567
  const virtualisedExtent = virtualContentHeight - pixelContentHeight;
@@ -2604,7 +2569,7 @@ var useTableViewport = ({
2604
2569
  () => measurePinnedColumns(columns, selectionEndSize),
2605
2570
  [columns, selectionEndSize]
2606
2571
  );
2607
- const totalHeaderHeightRef = useRef12(headerHeight);
2572
+ const totalHeaderHeightRef = useRef11(headerHeight);
2608
2573
  useMemo5(() => {
2609
2574
  totalHeaderHeightRef.current = headerHeight * (1 + headings.length);
2610
2575
  }, [headerHeight, headings.length]);
@@ -2619,10 +2584,10 @@ var useTableViewport = ({
2619
2584
  return actualRowPositioning(rowHeight);
2620
2585
  }
2621
2586
  }, [virtualisedExtent, rowHeight]);
2622
- const setScrollTop = useCallback17((_, scrollPct) => {
2587
+ const setScrollTop = useCallback16((_, scrollPct) => {
2623
2588
  pctScrollTopRef.current = scrollPct;
2624
2589
  }, []);
2625
- const setInSituRowOffset = useCallback17((rowIndexOffset) => {
2590
+ const setInSituRowOffset = useCallback16((rowIndexOffset) => {
2626
2591
  if (rowIndexOffset === 0) {
2627
2592
  inSituRowOffsetRef.current = 0;
2628
2593
  } else {
@@ -2685,7 +2650,7 @@ var useTableViewport = ({
2685
2650
  // src/useTableAndColumnSettings.ts
2686
2651
  import { useLayoutProviderDispatch } from "@vuu-ui/vuu-layout";
2687
2652
  import { getCalculatedColumnType } from "@vuu-ui/vuu-utils";
2688
- import { useCallback as useCallback18, useRef as useRef13, useState as useState6 } from "react";
2653
+ import { useCallback as useCallback17, useRef as useRef12, useState as useState5 } from "react";
2689
2654
  var useTableAndColumnSettings = ({
2690
2655
  availableColumns: availableColumnsProps,
2691
2656
  onAvailableColumnsChange,
@@ -2695,11 +2660,11 @@ var useTableAndColumnSettings = ({
2695
2660
  tableConfig
2696
2661
  }) => {
2697
2662
  const dispatchLayoutAction = useLayoutProviderDispatch();
2698
- const showTableSettingsRef = useRef13();
2699
- const [availableColumns, setAvailableColumns] = useState6(
2663
+ const showTableSettingsRef = useRef12();
2664
+ const [availableColumns, setAvailableColumns] = useState5(
2700
2665
  availableColumnsProps
2701
2666
  );
2702
- const showContextPanel = useCallback18(
2667
+ const showContextPanel = useCallback17(
2703
2668
  (componentType, title, props) => {
2704
2669
  dispatchLayoutAction({
2705
2670
  type: "set-props",
@@ -2716,13 +2681,13 @@ var useTableAndColumnSettings = ({
2716
2681
  },
2717
2682
  [dispatchLayoutAction]
2718
2683
  );
2719
- const handleCancelCreateColumn = useCallback18(() => {
2684
+ const handleCancelCreateColumn = useCallback17(() => {
2720
2685
  requestAnimationFrame(() => {
2721
2686
  var _a;
2722
2687
  (_a = showTableSettingsRef.current) == null ? void 0 : _a.call(showTableSettingsRef);
2723
2688
  });
2724
2689
  }, []);
2725
- const handleCreateCalculatedColumn = useCallback18(
2690
+ const handleCreateCalculatedColumn = useCallback17(
2726
2691
  (column) => {
2727
2692
  const newAvailableColumns = availableColumns.concat({
2728
2693
  name: column.name,
@@ -2738,7 +2703,7 @@ var useTableAndColumnSettings = ({
2738
2703
  },
2739
2704
  [availableColumns, onAvailableColumnsChange, onCreateCalculatedColumn]
2740
2705
  );
2741
- const showColumnSettingsPanel = useCallback18(
2706
+ const showColumnSettingsPanel = useCallback17(
2742
2707
  (action) => {
2743
2708
  showContextPanel("ColumnSettings", "Column Settings", {
2744
2709
  column: action.column,
@@ -2757,7 +2722,7 @@ var useTableAndColumnSettings = ({
2757
2722
  tableConfig
2758
2723
  ]
2759
2724
  );
2760
- const handleAddCalculatedColumn = useCallback18(() => {
2725
+ const handleAddCalculatedColumn = useCallback17(() => {
2761
2726
  showColumnSettingsPanel({
2762
2727
  column: {
2763
2728
  name: "::",
@@ -2767,7 +2732,7 @@ var useTableAndColumnSettings = ({
2767
2732
  vuuTable: { module: "SIMUL", table: "instruments" }
2768
2733
  });
2769
2734
  }, [showColumnSettingsPanel]);
2770
- const handleNavigateToColumn = useCallback18(
2735
+ const handleNavigateToColumn = useCallback17(
2771
2736
  (columnName) => {
2772
2737
  const column = tableConfig.columns.find((c) => c.name === columnName);
2773
2738
  if (column) {
@@ -2781,7 +2746,7 @@ var useTableAndColumnSettings = ({
2781
2746
  },
2782
2747
  [showColumnSettingsPanel, tableConfig.columns]
2783
2748
  );
2784
- showTableSettingsRef.current = useCallback18(() => {
2749
+ showTableSettingsRef.current = useCallback17(() => {
2785
2750
  showContextPanel("TableSettings", "DataGrid Settings", {
2786
2751
  availableColumns: availableColumns != null ? availableColumns : tableConfig.columns.map(({ name, serverDataType }) => ({
2787
2752
  name,
@@ -2880,7 +2845,7 @@ var useTable = ({
2880
2845
  selectionModel,
2881
2846
  size
2882
2847
  }) => {
2883
- const [rowCount, setRowCount] = useState7(dataSource.size);
2848
+ const [rowCount, setRowCount] = useState6(dataSource.size);
2884
2849
  if (dataSource === void 0) {
2885
2850
  throw Error("no data source provided to Vuu Table");
2886
2851
  }
@@ -2890,7 +2855,7 @@ var useTable = ({
2890
2855
  () => buildContextMenuDescriptors(dataSource),
2891
2856
  [dataSource]
2892
2857
  );
2893
- const onDataRowcountChange = useCallback19((size2) => {
2858
+ const onDataRowcountChange = useCallback18((size2) => {
2894
2859
  setRowCount(size2);
2895
2860
  }, []);
2896
2861
  const {
@@ -2907,7 +2872,7 @@ var useTable = ({
2907
2872
  dataSource
2908
2873
  });
2909
2874
  }, [config, dataSource, dispatchTableModelAction]);
2910
- const applyTableConfigChange = useCallback19(
2875
+ const applyTableConfigChange = useCallback18(
2911
2876
  (config2) => {
2912
2877
  dispatchTableModelAction({
2913
2878
  type: "init",
@@ -2922,7 +2887,7 @@ var useTable = ({
2922
2887
  () => buildColumnMap2(dataSource.columns),
2923
2888
  [dataSource.columns]
2924
2889
  );
2925
- const onSubscribed = useCallback19(
2890
+ const onSubscribed = useCallback18(
2926
2891
  ({ tableSchema }) => {
2927
2892
  if (tableSchema) {
2928
2893
  dispatchTableModelAction({
@@ -2972,7 +2937,7 @@ var useTable = ({
2972
2937
  onVerticalScrollInSitu: viewportHookSetInSituRowOffset,
2973
2938
  viewportMeasurements
2974
2939
  });
2975
- const handleConfigEditedInSettingsPanel = useCallback19(
2940
+ const handleConfigEditedInSettingsPanel = useCallback18(
2976
2941
  (tableConfig2) => {
2977
2942
  dispatchTableModelAction({
2978
2943
  type: "init",
@@ -2983,7 +2948,7 @@ var useTable = ({
2983
2948
  },
2984
2949
  [dataSource, dispatchTableModelAction, onConfigChange]
2985
2950
  );
2986
- const handleDataSourceConfigChanged = useCallback19(
2951
+ const handleDataSourceConfigChanged = useCallback18(
2987
2952
  (dataSourceConfig) => {
2988
2953
  dataSource.config = {
2989
2954
  ...dataSource.config,
@@ -3008,14 +2973,14 @@ var useTable = ({
3008
2973
  });
3009
2974
  });
3010
2975
  }, [dataSource, dispatchTableModelAction, requestScroll]);
3011
- const handleCreateCalculatedColumn = useCallback19(
2976
+ const handleCreateCalculatedColumn = useCallback18(
3012
2977
  (column) => {
3013
2978
  dataSource.columns = dataSource.columns.concat(column.name);
3014
2979
  applyTableConfigChange(addColumn(tableConfig, column));
3015
2980
  },
3016
2981
  [dataSource, tableConfig, applyTableConfigChange]
3017
2982
  );
3018
- const hideColumns2 = useCallback19(
2983
+ const hideColumns2 = useCallback18(
3019
2984
  (action) => {
3020
2985
  const { columns: columns2 } = action;
3021
2986
  const hiddenColumns = columns2.map((c) => c.name);
@@ -3029,7 +2994,7 @@ var useTable = ({
3029
2994
  },
3030
2995
  [tableConfig, applyTableConfigChange]
3031
2996
  );
3032
- const pinColumn3 = useCallback19(
2997
+ const pinColumn3 = useCallback18(
3033
2998
  (action) => {
3034
2999
  applyTableConfigChange({
3035
3000
  ...tableConfig,
@@ -3052,7 +3017,7 @@ var useTable = ({
3052
3017
  onDataSourceConfigChange: handleDataSourceConfigChanged,
3053
3018
  tableConfig
3054
3019
  });
3055
- const onPersistentColumnOperation = useCallback19(
3020
+ const onPersistentColumnOperation = useCallback18(
3056
3021
  (action) => {
3057
3022
  if (isShowColumnSettings(action)) {
3058
3023
  showColumnSettingsPanel(action);
@@ -3081,7 +3046,7 @@ var useTable = ({
3081
3046
  dataSource,
3082
3047
  onPersistentColumnOperation
3083
3048
  });
3084
- const handleSort = useCallback19(
3049
+ const handleSort = useCallback18(
3085
3050
  (column, extendSort = false, sortType) => {
3086
3051
  if (dataSource) {
3087
3052
  dataSource.sort = applySort(
@@ -3094,8 +3059,8 @@ var useTable = ({
3094
3059
  },
3095
3060
  [dataSource]
3096
3061
  );
3097
- const resizeCells = useRef14();
3098
- const onResizeColumn = useCallback19(
3062
+ const resizeCells = useRef13();
3063
+ const onResizeColumn = useCallback18(
3099
3064
  (phase, columnName, width) => {
3100
3065
  var _a, _b, _c;
3101
3066
  const column = columns.find((column2) => column2.name === columnName);
@@ -3151,7 +3116,7 @@ var useTable = ({
3151
3116
  containerRef
3152
3117
  ]
3153
3118
  );
3154
- const onToggleGroup = useCallback19(
3119
+ const onToggleGroup = useCallback18(
3155
3120
  (row, column) => {
3156
3121
  var _a, _b;
3157
3122
  const isJson = isJsonGroup2(column, row, columnMap);
@@ -3214,7 +3179,7 @@ var useTable = ({
3214
3179
  } = useCellEditing({
3215
3180
  navigate
3216
3181
  });
3217
- const handleFocus = useCallback19(
3182
+ const handleFocus = useCallback18(
3218
3183
  (e) => {
3219
3184
  navigationFocus();
3220
3185
  if (!e.defaultPrevented) {
@@ -3229,13 +3194,13 @@ var useTable = ({
3229
3194
  dataSource,
3230
3195
  getSelectedRows
3231
3196
  });
3232
- const onMoveGroupColumn = useCallback19(
3197
+ const onMoveGroupColumn = useCallback18(
3233
3198
  (columns2) => {
3234
3199
  dataSource.groupBy = columns2.map((col) => col.name);
3235
3200
  },
3236
3201
  [dataSource]
3237
3202
  );
3238
- const onRemoveGroupColumn = useCallback19(
3203
+ const onRemoveGroupColumn = useCallback18(
3239
3204
  (column) => {
3240
3205
  if (isGroupColumn4(column)) {
3241
3206
  dataSource.groupBy = [];
@@ -3249,23 +3214,38 @@ var useTable = ({
3249
3214
  },
3250
3215
  [dataSource]
3251
3216
  );
3252
- const handleSelectionChange = useCallback19(
3217
+ const handleSelectionChange = useCallback18(
3253
3218
  (selected) => {
3254
3219
  dataSource.select(selected);
3255
3220
  onSelectionChange == null ? void 0 : onSelectionChange(selected);
3256
3221
  },
3257
3222
  [dataSource, onSelectionChange]
3258
3223
  );
3224
+ const handleSelect = useCallback18(
3225
+ (row) => {
3226
+ if (onSelect) {
3227
+ onSelect(row === null ? null : asDataSourceRowObject(row, columnMap));
3228
+ }
3229
+ },
3230
+ [columnMap, onSelect]
3231
+ );
3259
3232
  const {
3260
3233
  onKeyDown: selectionHookKeyDown,
3261
3234
  onRowClick: selectionHookOnRowClick
3262
3235
  } = useSelection({
3263
3236
  highlightedIndexRef,
3264
- onSelect,
3237
+ onSelect: handleSelect,
3265
3238
  onSelectionChange: handleSelectionChange,
3266
3239
  selectionModel
3267
3240
  });
3268
- const handleKeyDown = useCallback19(
3241
+ const handleRowClick = useCallback18(
3242
+ (evt, row, rangeSelect, keepExistingSelection) => {
3243
+ selectionHookOnRowClick(evt, row, rangeSelect, keepExistingSelection);
3244
+ onRowClickProp == null ? void 0 : onRowClickProp(evt, asDataSourceRowObject(row, columnMap));
3245
+ },
3246
+ [columnMap, onRowClickProp, selectionHookOnRowClick]
3247
+ );
3248
+ const handleKeyDown = useCallback18(
3269
3249
  (e) => {
3270
3250
  navigationKeyDown(e);
3271
3251
  if (!e.defaultPrevented) {
@@ -3277,14 +3257,7 @@ var useTable = ({
3277
3257
  },
3278
3258
  [navigationKeyDown, editingKeyDown, selectionHookKeyDown]
3279
3259
  );
3280
- const handleRowClick = useCallback19(
3281
- (row, rangeSelect, keepExistingSelection) => {
3282
- selectionHookOnRowClick(row, rangeSelect, keepExistingSelection);
3283
- onRowClickProp == null ? void 0 : onRowClickProp(row);
3284
- },
3285
- [onRowClickProp, selectionHookOnRowClick]
3286
- );
3287
- const onMoveColumn = useCallback19(
3260
+ const onMoveColumn = useCallback18(
3288
3261
  (columns2) => {
3289
3262
  const newTableConfig = {
3290
3263
  ...tableConfig,
@@ -3299,17 +3272,17 @@ var useTable = ({
3299
3272
  },
3300
3273
  [dataSource, dispatchTableModelAction, onConfigChange, tableConfig]
3301
3274
  );
3302
- const handleDropRow = useCallback19(
3275
+ const handleDropRow = useCallback18(
3303
3276
  (dragDropState) => {
3304
3277
  onDrop == null ? void 0 : onDrop(dragDropState);
3305
3278
  },
3306
3279
  [onDrop]
3307
3280
  );
3308
- const handleDataEdited = useCallback19(
3281
+ const handleDataEdited = useCallback18(
3309
3282
  async (row, columnName, value) => dataSource.applyEdit(row, columnName, value),
3310
3283
  [dataSource]
3311
3284
  );
3312
- const handleDragStartRow = useCallback19(
3285
+ const handleDragStartRow = useCallback18(
3313
3286
  (dragDropState) => {
3314
3287
  const { initialDragElement } = dragDropState;
3315
3288
  const rowIndex = getIndexFromRowElement3(initialDragElement);
@@ -3369,17 +3342,17 @@ var useTable = ({
3369
3342
 
3370
3343
  // src/useRowHeight.ts
3371
3344
  import { isValidNumber as isValidNumber2 } from "@vuu-ui/vuu-utils";
3372
- import { useCallback as useCallback20, useMemo as useMemo8, useRef as useRef15, useState as useState8 } from "react";
3345
+ import { useCallback as useCallback19, useMemo as useMemo8, useRef as useRef14, useState as useState7 } from "react";
3373
3346
  var useRowHeight = ({
3374
3347
  rowHeight: rowHeightProp = 0
3375
3348
  }) => {
3376
- const [rowHeight, setRowHeight] = useState8(rowHeightProp);
3377
- const heightRef = useRef15(rowHeight);
3349
+ const [rowHeight, setRowHeight] = useState7(rowHeightProp);
3350
+ const heightRef = useRef14(rowHeight);
3378
3351
  const resizeObserver = useMemo8(() => {
3379
3352
  return new ResizeObserver((entries) => {
3380
3353
  for (const entry of entries) {
3381
- const { height: measuredHeight } = entry.contentRect;
3382
- const newHeight = Math.round(measuredHeight);
3354
+ const [{ blockSize: measuredSize }] = entry.borderBoxSize;
3355
+ const newHeight = Math.round(measuredSize);
3383
3356
  if (isValidNumber2(newHeight) && heightRef.current !== newHeight) {
3384
3357
  heightRef.current = newHeight;
3385
3358
  setRowHeight(newHeight);
@@ -3387,12 +3360,13 @@ var useRowHeight = ({
3387
3360
  }
3388
3361
  });
3389
3362
  }, []);
3390
- const rowRef = useCallback20(
3363
+ const rowRef = useCallback19(
3391
3364
  (el) => {
3392
3365
  if (el) {
3393
3366
  if (rowHeightProp === 0) {
3394
3367
  const { height } = el.getBoundingClientRect();
3395
- console.log(`measured rowHeight = ${height}`);
3368
+ console.log({ boundingClientHeight: height });
3369
+ console.log(`measured rowHeight = ${height} (${rowHeightProp})`);
3396
3370
  resizeObserver.observe(el);
3397
3371
  setRowHeight(height);
3398
3372
  }
@@ -3407,7 +3381,7 @@ var useRowHeight = ({
3407
3381
 
3408
3382
  // src/Table.tsx
3409
3383
  import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
3410
- var classBase7 = "vuuTable";
3384
+ var classBase8 = "vuuTable";
3411
3385
  var { IDX: IDX3, RENDER_IDX } = metadataKeys6;
3412
3386
  var TableCore = ({
3413
3387
  Row: Row2 = Row,
@@ -3482,16 +3456,16 @@ var TableCore = ({
3482
3456
  onRowClick: onRowClickProp,
3483
3457
  onSelect,
3484
3458
  onSelectionChange,
3485
- renderBufferSize,
3459
+ renderBufferSize: Math.max(5, renderBufferSize),
3486
3460
  rowHeight,
3487
3461
  scrollingApiRef,
3488
3462
  selectionModel,
3489
3463
  size
3490
3464
  });
3491
- const contentContainerClassName = cx9(`${classBase7}-contentContainer`, {
3492
- [`${classBase7}-colLines`]: tableAttributes.columnSeparators,
3493
- [`${classBase7}-rowLines`]: tableAttributes.rowSeparators,
3494
- [`${classBase7}-zebra`]: tableAttributes.zebraStripes
3465
+ const contentContainerClassName = cx9(`${classBase8}-contentContainer`, {
3466
+ [`${classBase8}-colLines`]: tableAttributes.columnSeparators,
3467
+ [`${classBase8}-rowLines`]: tableAttributes.rowSeparators,
3468
+ [`${classBase8}-zebra`]: tableAttributes.zebraStripes
3495
3469
  });
3496
3470
  const cssVariables = {
3497
3471
  "--content-height": `${viewportMeasurements.contentHeight}px`,
@@ -3514,10 +3488,10 @@ var TableCore = ({
3514
3488
  /* @__PURE__ */ jsx12(
3515
3489
  "div",
3516
3490
  {
3517
- className: `${classBase7}-scrollbarContainer`,
3491
+ className: `${classBase8}-scrollbarContainer`,
3518
3492
  ref: scrollProps.scrollbarContainerRef,
3519
3493
  style: cssVariables,
3520
- children: /* @__PURE__ */ jsx12("div", { className: `${classBase7}-scrollbarContent` })
3494
+ children: /* @__PURE__ */ jsx12("div", { className: `${classBase8}-scrollbarContent` })
3521
3495
  }
3522
3496
  ),
3523
3497
  /* @__PURE__ */ jsx12(
@@ -3530,7 +3504,7 @@ var TableCore = ({
3530
3504
  "div",
3531
3505
  {
3532
3506
  ...tableProps,
3533
- className: `${classBase7}-table`,
3507
+ className: `${classBase8}-table`,
3534
3508
  role: "table",
3535
3509
  tabIndex: disableFocus ? void 0 : -1,
3536
3510
  children: [
@@ -3549,7 +3523,7 @@ var TableCore = ({
3549
3523
  virtualColSpan: scrollProps.virtualColSpan
3550
3524
  }
3551
3525
  ) : null,
3552
- /* @__PURE__ */ jsx12("div", { className: `${classBase7}-body`, children: data.map((data2) => /* @__PURE__ */ jsx12(
3526
+ /* @__PURE__ */ jsx12("div", { className: `${classBase8}-body`, children: data.map((data2) => /* @__PURE__ */ jsx12(
3553
3527
  Row2,
3554
3528
  {
3555
3529
  "aria-rowindex": data2[0] + 1,
@@ -3606,8 +3580,8 @@ var Table = forwardRef2(function TableNext({
3606
3580
  style: styleProp,
3607
3581
  ...htmlAttributes
3608
3582
  }, forwardedRef) {
3609
- const containerRef = useRef16(null);
3610
- const [size, setSize] = useState9();
3583
+ const containerRef = useRef15(null);
3584
+ const [size, setSize] = useState8();
3611
3585
  const { rowHeight, rowRef } = useRowHeight({ rowHeight: rowHeightProp });
3612
3586
  if (config === void 0) {
3613
3587
  throw Error(
@@ -3617,11 +3591,12 @@ var Table = forwardRef2(function TableNext({
3617
3591
  if (dataSource === void 0) {
3618
3592
  throw Error("vuu Table requires dataSource prop");
3619
3593
  }
3594
+ console.log({ rowHeight });
3620
3595
  return /* @__PURE__ */ jsxs9(
3621
3596
  MeasuredContainer,
3622
3597
  {
3623
3598
  ...htmlAttributes,
3624
- className: cx9(classBase7, classNameProp),
3599
+ className: cx9(classBase8, classNameProp),
3625
3600
  id,
3626
3601
  onResize: setSize,
3627
3602
  ref: useForkRef(containerRef, forwardedRef),
@@ -3664,7 +3639,7 @@ var Table = forwardRef2(function TableNext({
3664
3639
  });
3665
3640
 
3666
3641
  // src/cell-renderers/checkbox-cell/CheckboxCell.tsx
3667
- import { memo as memo3, useCallback as useCallback21 } from "react";
3642
+ import { memo as memo3, useCallback as useCallback20 } from "react";
3668
3643
  import { CheckboxIcon, WarnCommit } from "@vuu-ui/vuu-ui-controls";
3669
3644
  import { Checkbox } from "@salt-ds/core";
3670
3645
  import {
@@ -3677,7 +3652,7 @@ var CheckboxCell = memo3(
3677
3652
  ({ column, columnMap, onCommit = WarnCommit, row }) => {
3678
3653
  const dataIdx = columnMap[column.name];
3679
3654
  const isChecked = !!row[dataIdx];
3680
- const handleCommit = useCallback21(
3655
+ const handleCommit = useCallback20(
3681
3656
  (value) => async (evt) => {
3682
3657
  const res = await onCommit(value);
3683
3658
  if (res === true) {
@@ -3702,7 +3677,7 @@ import { Input } from "@salt-ds/core";
3702
3677
  import { useEditableText } from "@vuu-ui/vuu-ui-controls";
3703
3678
  import cx10 from "clsx";
3704
3679
  import { jsx as jsx14 } from "react/jsx-runtime";
3705
- var classBase8 = "vuuTableInputCell";
3680
+ var classBase9 = "vuuTableInputCell";
3706
3681
  var WarnCommit2 = () => {
3707
3682
  console.warn(
3708
3683
  "onCommit handler has not been provided to InputCell cell renderer"
@@ -3723,14 +3698,14 @@ var InputCell = ({
3723
3698
  onCommit,
3724
3699
  clientSideEditValidationCheck
3725
3700
  });
3726
- const endAdornment = warningMessage && align === "left" ? /* @__PURE__ */ jsx14("span", { className: `${classBase8}-icon`, "data-icon": "error" }) : void 0;
3727
- const startAdornment = warningMessage && align === "right" ? /* @__PURE__ */ jsx14("span", { className: `${classBase8}-icon`, "data-icon": "error" }) : void 0;
3701
+ const endAdornment = warningMessage && align === "left" ? /* @__PURE__ */ jsx14("span", { className: `${classBase9}-icon`, "data-icon": "error" }) : void 0;
3702
+ const startAdornment = warningMessage && align === "right" ? /* @__PURE__ */ jsx14("span", { className: `${classBase9}-icon`, "data-icon": "error" }) : void 0;
3728
3703
  return /* @__PURE__ */ jsx14(
3729
3704
  Input,
3730
3705
  {
3731
3706
  ...editProps,
3732
- className: cx10(classBase8, {
3733
- [`${classBase8}-error`]: warningMessage !== void 0
3707
+ className: cx10(classBase9, {
3708
+ [`${classBase9}-error`]: warningMessage !== void 0
3734
3709
  }),
3735
3710
  endAdornment,
3736
3711
  startAdornment
@@ -3751,10 +3726,10 @@ import {
3751
3726
  registerComponent as registerComponent3
3752
3727
  } from "@vuu-ui/vuu-utils";
3753
3728
  import cx11 from "clsx";
3754
- import { memo as memo4, useCallback as useCallback22 } from "react";
3729
+ import { memo as memo4, useCallback as useCallback21 } from "react";
3755
3730
  import { CycleStateButton } from "@vuu-ui/vuu-ui-controls";
3756
3731
  import { jsx as jsx15 } from "react/jsx-runtime";
3757
- var classBase9 = "vuuTableToggleCell";
3732
+ var classBase10 = "vuuTableToggleCell";
3758
3733
  var getValueList = ({ name, type }) => {
3759
3734
  if (isTypeDescriptor(type) && isValueListRenderer(type.renderer)) {
3760
3735
  return type.renderer.values;
@@ -3774,7 +3749,7 @@ var ToggleCell = memo4(
3774
3749
  const values = getValueList(column);
3775
3750
  const dataIdx = columnMap[column.name];
3776
3751
  const value = row[dataIdx];
3777
- const handleCommit = useCallback22(
3752
+ const handleCommit = useCallback21(
3778
3753
  (evt, value2) => {
3779
3754
  return onCommit(value2).then((response) => {
3780
3755
  if (response === true) {
@@ -3788,7 +3763,7 @@ var ToggleCell = memo4(
3788
3763
  return /* @__PURE__ */ jsx15(
3789
3764
  CycleStateButton,
3790
3765
  {
3791
- className: cx11(classBase9, `${classBase9}-${column.name}`),
3766
+ className: cx11(classBase10, `${classBase10}-${column.name}`),
3792
3767
  onCommit: handleCommit,
3793
3768
  value,
3794
3769
  values,
@@ -3806,11 +3781,11 @@ registerComponent3("toggle-cell", ToggleCell, "cell-renderer", {
3806
3781
  // src/useControlledTableNavigation.ts
3807
3782
  import { useStateRef } from "@vuu-ui/vuu-ui-controls";
3808
3783
  import { dispatchMouseEvent as dispatchMouseEvent2 } from "@vuu-ui/vuu-utils";
3809
- import { useCallback as useCallback23, useRef as useRef17 } from "react";
3784
+ import { useCallback as useCallback22, useRef as useRef16 } from "react";
3810
3785
  var useControlledTableNavigation = (initialValue, rowCount) => {
3811
- const tableRef = useRef17(null);
3786
+ const tableRef = useRef16(null);
3812
3787
  const [highlightedIndexRef, setHighlightedIndex] = useStateRef(initialValue);
3813
- const handleKeyDown = useCallback23(
3788
+ const handleKeyDown = useCallback22(
3814
3789
  (e) => {
3815
3790
  var _a;
3816
3791
  if (e.key === "ArrowDown") {
@@ -3829,7 +3804,7 @@ var useControlledTableNavigation = (initialValue, rowCount) => {
3829
3804
  },
3830
3805
  [highlightedIndexRef, rowCount, setHighlightedIndex]
3831
3806
  );
3832
- const handleHighlight = useCallback23(
3807
+ const handleHighlight = useCallback22(
3833
3808
  (idx) => {
3834
3809
  setHighlightedIndex(idx);
3835
3810
  },
@@ -3844,7 +3819,8 @@ var useControlledTableNavigation = (initialValue, rowCount) => {
3844
3819
  };
3845
3820
  export {
3846
3821
  CheckboxCell,
3847
- GroupHeaderCellNext,
3822
+ GroupHeaderCell,
3823
+ GroupHeaderCell as GroupHeaderCellNext,
3848
3824
  HeaderCell,
3849
3825
  InputCell,
3850
3826
  Table,