@sheetxl/grid-react 0.7.5 → 0.7.6

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/grid-react - Grid React - Advanced grid component for React - v0.7.5
2
+ * @license @sheetxl/grid-react - Grid React - Advanced grid component for React - v0.7.6
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -9,7 +9,7 @@ import { useCallbackRef as o, HorizontalAlignment as r, KeyCodes as l, ReactUtil
9
9
  import { useRef as w, useReducer as x, useState as p, useEffect as m, useCallback as v, useLayoutEffect as S, useMemo as y, memo as b, forwardRef as C, createElement as I, useImperativeHandle as E } from "react";
10
10
  import R from "tiny-invariant";
11
11
  import M from "clsx";
12
- import { CoordUtils as k, CommonUtils as P, RangeOrientation as D, Direction as T, AnchorLocation as O } from "@sheetxl/utils";
12
+ import { CoordUtils as k, CommonUtils as P, RangeOrientation as T, Direction as D, AnchorLocation as O } from "@sheetxl/utils";
13
13
  import { useMeasure as z } from "react-use";
14
14
  import { createPortal as L } from "react-dom";
15
15
  import { mergeRefs as $ } from "react-merge-refs";
@@ -89,10 +89,10 @@ const B = ({ itemType: e2, index: t2, itemSize: n2, instanceProps: o2, scale: r2
89
89
  }, []);
90
90
  const M2 = v(() => l2(n2), []), P2 = v(() => {
91
91
  c2(n2);
92
- }, []), D2 = o2.current && k.isEqualCells(o2.current, E2), T2 = a2 && D2 && C2, O2 = d2({ autoFocus: !!n2.startEvent?.autoFocus, ...u2, onSubmitEdit: M2, onCancelEdit: P2, ref: b2 }, E2), z2 = s2.x + i.boundPixel(-g2 / 2), L2 = i.boundPixel(s2.width + g2 / 2, true);
93
- return e("div", { tabIndex: 0, ref: y2, style: { background: void 0, ...x2, opacity: T2 ? x2?.opacity ?? 1 : 0, pointerEvents: "auto", position: "absolute", boxSizing: "border-box", top: `${s2.y + i.boundPixel(-g2 / 2)}px`, height: i.boundPixel(s2.height + g2 / 2, true), left: `${z2}px`, width: L2 }, ...S2, children: e("div", { className: "editor-container", style: { position: "absolute", boxSizing: "border-box", left: `${i.boundPixel(1)}px`, top: `${i.boundPixel(1)}px`, width: i.boundPixel(s2.width - 2, true), height: i.boundPixel(s2.height - 2, true), outline: `${g2}px ${h2} solid`, boxShadow: "rgba(60,64,67,.35) 2px 2px 6px 3px", maxHeight: "100%", overflow: "hidden", display: "flex" }, children: O2 }) });
92
+ }, []), T2 = o2.current && k.isEqualCells(o2.current, E2), D2 = a2 && T2 && C2, O2 = d2({ autoFocus: !!n2.startEvent?.autoFocus, ...u2, onSubmitEdit: M2, onCancelEdit: P2, ref: b2 }, E2), z2 = s2.x + i.boundPixel(-g2 / 2), L2 = i.boundPixel(s2.width + g2 / 2, true);
93
+ return e("div", { tabIndex: 0, ref: y2, style: { background: void 0, ...x2, opacity: D2 ? x2?.opacity ?? 1 : 0, pointerEvents: "auto", position: "absolute", boxSizing: "border-box", top: `${s2.y + i.boundPixel(-g2 / 2)}px`, height: i.boundPixel(s2.height + g2 / 2, true), left: `${z2}px`, width: L2 }, ...S2, children: e("div", { className: "editor-container", style: { position: "absolute", boxSizing: "border-box", left: `${i.boundPixel(1)}px`, top: `${i.boundPixel(1)}px`, width: i.boundPixel(s2.width - 2, true), height: i.boundPixel(s2.height - 2, true), outline: `${g2}px ${h2} solid`, boxShadow: "rgba(60,64,67,.35) 2px 2px 6px 3px", maxHeight: "100%", overflow: "hidden", display: "flex" }, children: O2 }) });
94
94
  }, X = (t2) => {
95
- const { view: n2, canEdit: i2 = K, getCellEditor: c2, onBeforeStartEdit: s2, onStartEdit: a2, onSubmitEdit: d2, onCancelEdit: u2, onDoneEdit: h2, isEditorStartKeyEvent: g2 = N, isEditorStartPointerEvent: f2 = q, containerProps: y2, borderStrokeFill: b2, borderStrokeWidth: C2 = 2, getRangeCoords: I2 = null, activeCoords: E2, alignment: R2 = r.Left } = t2, [M2, D2] = p(false), [T2, O2] = p(void 0), z2 = o((e2, t3, n3, o2, l2, i3) => {
95
+ const { view: n2, canEdit: i2 = K, getCellEditor: c2, onBeforeStartEdit: s2, onStartEdit: a2, onSubmitEdit: d2, onCancelEdit: u2, onDoneEdit: h2, isEditorStartKeyEvent: g2 = N, isEditorStartPointerEvent: f2 = q, containerProps: y2, borderStrokeFill: b2, borderStrokeWidth: C2 = 2, getRangeCoords: I2 = null, activeCoords: E2, alignment: R2 = r.Left } = t2, [M2, T2] = p(false), [D2, O2] = p(void 0), z2 = o((e2, t3, n3, o2, l2, i3) => {
96
96
  if (!t3) return null;
97
97
  const c3 = l2?.(t3, e2), s3 = e2.getRangeCoordsBounds(c3), a3 = e2.toClipBounds(s3), d3 = s3, u3 = e2.getZoom();
98
98
  if (!a3) return null;
@@ -112,7 +112,7 @@ const B = ({ itemType: e2, index: t2, itemSize: n2, instanceProps: o2, scale: r2
112
112
  }, [R2]), L2 = o(i2, [i2]), $2 = v(() => {
113
113
  n2?.getStage()?.focus();
114
114
  }, [n2]), B2 = w(null), F2 = o((e2) => {
115
- s2?.(e2), Q2(), D2(true), B2.current = null;
115
+ s2?.(e2), Q2(), T2(true), B2.current = null;
116
116
  }, [s2]), A2 = o((e2) => {
117
117
  a2?.(e2.coords);
118
118
  }, [a2]), W2 = o((e2) => {
@@ -125,7 +125,7 @@ const B = ({ itemType: e2, index: t2, itemSize: n2, instanceProps: o2, scale: r2
125
125
  throw e2.isEditorClosing = false, e2.isSubmitted = false, t3;
126
126
  }
127
127
  }, [d2]), U2 = o((e2) => {
128
- D2(false), h2?.(e2.coords), Q2();
128
+ T2(false), h2?.(e2.coords), Q2();
129
129
  }, [h2]), X2 = w(null), Y2 = w(null), G2 = w(null), Z2 = w([]), [_2, J2] = x((e2) => e2 + 1, 0), Q2 = v((e2) => {
130
130
  e2 && Z2.current.push(e2), J2();
131
131
  }, []), ee2 = o((e2) => {
@@ -266,13 +266,13 @@ const B = ({ itemType: e2, index: t2, itemSize: n2, instanceProps: o2, scale: r2
266
266
  }, [E2]);
267
267
  const oe2 = v((e2) => {
268
268
  ne2(e2.nativeEvent);
269
- }, []), { width: re2 = 0, height: le2 = 0 } = T2 ?? { width: 0, height: 0 }, ie2 = o(c2, [c2]);
269
+ }, []), { width: re2 = 0, height: le2 = 0 } = D2 ?? { width: 0, height: 0 }, ie2 = o(c2, [c2]);
270
270
  return { overlay: o((t3) => {
271
271
  if (!X2.current || X2.current.isEditorClosed) return X2.current, null;
272
272
  X2.current.coords;
273
273
  let n3 = z2(t3, X2.current.coords, re2, le2, I2, R2), o2 = true;
274
274
  n3 && 0 !== n3.width && 0 !== n3.height || (n3 = { x: 0, y: 0, width: re2, height: re2 }, o2 = false);
275
- const r2 = t3.getZoom(), l2 = { containerBounds: { x: 0, y: 0, width: n3.width / r2, height: n3.height / r2 }, setNaturalDimensions: O2, zoom: r2 };
275
+ const r2 = t3.getZoom(), l2 = { containerBounds: { x: 0, y: 0, width: n3.width / r2, height: n3.height / r2 }, setNaturalSize: O2, zoom: r2 };
276
276
  return e(j, { session: X2.current, refLatestCoords: G2, handleSubmitEdit: V2, handleCancelEdit: W2, cellBounds: n3, borderStrokeWidth: C2, borderStrokeFill: b2, isInBounds: o2, getCellEditor: ie2, propsEditor: l2, alignment: R2, ...y2 }, "editor:" + X2.current.uuid);
277
277
  }, [c2, I2, _2, re2, le2, R2, C2, b2]), startEdit: v((e2) => {
278
278
  Q2({ eventType: "start", startEvent: e2 });
@@ -313,16 +313,16 @@ function J(e2 = {}) {
313
313
  };
314
314
  }, [c2, l2, t2, n2, o2]), [u2, h2];
315
315
  }
316
- const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = D.Row, headerCount: r2, selectionPolicy: l2 = "multiple", newSelectionMode: i2 = "clear", alwaysScrollToActiveCoords: a2 = true, onDragStart: d2, onDragEnd: u2, pointerDownInterceptor: h2, pointerMoveInterceptor: g2, onPointerUp: f2, newSelection: x2, modifySelection: p2, appendSelection: m2, clearSelections: S2 }) => {
317
- const b2 = r2 ?? ((n2 === D.Row ? e2.current?.rowCount : e2.current?.columnCount) || 0), C2 = w(null), I2 = w(null), E2 = w(false), R2 = w(null), M2 = v((e3) => n2 === D.Column ? { rowIndex: 0, colIndex: e3.colIndex } : { rowIndex: e3.rowIndex, colIndex: 0 }, [n2]), T2 = v((e3) => n2 === D.Column ? { rowIndex: t2.current ? t2.current.rowCount - 1 : 0, colIndex: e3.colIndex } : { rowIndex: e3.rowIndex, colIndex: t2.current ? t2.current.columnCount - 1 : 0 }, [n2]), O2 = (e3) => {
318
- I2.current = T2(e3), p2(I2.current, C2.current);
316
+ const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = T.Row, headerCount: r2, selectionPolicy: l2 = "multiple", newSelectionMode: i2 = "clear", alwaysScrollToActiveCoords: a2 = true, onDragStart: d2, onDragEnd: u2, pointerDownInterceptor: h2, pointerMoveInterceptor: g2, onPointerUp: f2, newSelection: x2, modifySelection: p2, appendSelection: m2, clearSelections: S2 }) => {
317
+ const b2 = r2 ?? ((n2 === T.Row ? e2.current?.rowCount : e2.current?.columnCount) || 0), C2 = w(null), I2 = w(null), E2 = w(false), R2 = w(null), M2 = v((e3) => n2 === T.Column ? { rowIndex: 0, colIndex: e3.colIndex } : { rowIndex: e3.rowIndex, colIndex: 0 }, [n2]), D2 = v((e3) => n2 === T.Column ? { rowIndex: t2.current ? t2.current.rowCount - 1 : 0, colIndex: e3.colIndex } : { rowIndex: e3.rowIndex, colIndex: t2.current ? t2.current.columnCount - 1 : 0 }, [n2]), O2 = (e3) => {
318
+ I2.current = D2(e3), p2(I2.current, C2.current);
319
319
  }, z2 = v((o2, r3) => {
320
320
  if (!e2.current) return;
321
321
  const l3 = e2.current.getViewFromClient(o2, r3)?.getCellCoordsFromClient(o2, r3);
322
- return l3 ? (n2 === D.Column ? l3.rowIndex = t2.current.getViewport().rowStart : l3.colIndex = t2.current.getViewport().colStart, l3) : void 0;
322
+ return l3 ? (n2 === T.Column ? l3.rowIndex = t2.current.getViewport().rowStart : l3.colIndex = t2.current.getViewport().colStart, l3) : void 0;
323
323
  }, []), L2 = v((e3, o2 = false) => {
324
324
  let r3 = e3;
325
- return o2 || (r3 = { ...e3 }, n2 === D.Row ? delete r3.colIndex : delete r3.rowIndex), t2.current?.scrollCellCoordsIntoView(r3);
325
+ return o2 || (r3 = { ...e3 }, n2 === T.Row ? delete r3.colIndex : delete r3.rowIndex), t2.current?.scrollCellCoordsIntoView(r3);
326
326
  }, [n2]), $2 = o(u2, [u2]), B2 = o(d2, [d2]), F2 = y(() => ({ onPointerDown: (o2) => {
327
327
  if (!e2 || !e2.current) return;
328
328
  if (o2.nativeEvent.defaultPrevented) return;
@@ -332,14 +332,14 @@ const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = D.Row, headerCount:
332
332
  const l3 = o2.nativeEvent.shiftKey, i3 = o2.nativeEvent.ctrlKey || o2.nativeEvent.metaKey;
333
333
  if (false === h2?.(o2, r3)) return;
334
334
  B2?.(), E2.current = true;
335
- const s2 = t2.current?.getViewFromClient(o2.nativeEvent.clientX, o2.nativeEvent.clientY), d3 = ((e3, t3) => n2 === D.Column ? { ...e3, rowIndex: t3.rowStart } : { ...e3, colIndex: t3.colStart })(r3, s2.getVisibleRangeCoords());
335
+ const s2 = t2.current?.getViewFromClient(o2.nativeEvent.clientX, o2.nativeEvent.clientY), d3 = ((e3, t3) => n2 === T.Column ? { ...e3, rowIndex: t3.rowStart } : { ...e3, colIndex: t3.colStart })(r3, s2.getVisibleRangeCoords());
336
336
  if (l3) O2(r3);
337
337
  else {
338
338
  if (i3) return ((e3, t3 = e3, n3) => {
339
- C2.current = M2(e3), I2.current = T2(t3), m2(C2.current, I2.current, n3);
339
+ C2.current = M2(e3), I2.current = D2(t3), m2(C2.current, I2.current, n3);
340
340
  })(r3, r3, d3), void (a2 && L2(d3, true));
341
341
  ((e3, t3 = e3, n3) => {
342
- C2.current = M2(e3), I2.current = T2(t3), x2(C2.current, I2.current, n3);
342
+ C2.current = M2(e3), I2.current = D2(t3), x2(C2.current, I2.current, n3);
343
343
  })(r3, r3, d3), O2(r3), a2 && L2(d3, true);
344
344
  }
345
345
  }, onPointerMoveOrWait: P.throttle((t3) => {
@@ -356,7 +356,7 @@ const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = D.Row, headerCount:
356
356
  }, ee = (e2, t2, n2) => {
357
357
  if (!e2) return t2;
358
358
  let o2 = t2;
359
- const r2 = n2 === T.Right || n2 === T.Down;
359
+ const r2 = n2 === D.Right || n2 === D.Down;
360
360
  for (; ; ) {
361
361
  const t3 = e2(o2, !r2);
362
362
  if (0 === t3) return o2;
@@ -374,25 +374,25 @@ const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = D.Row, headerCount:
374
374
  if (!t2) return l2;
375
375
  let { rowIndex: i2, colIndex: c2 } = e2;
376
376
  switch (o2) {
377
- case T.Down: {
377
+ case D.Down: {
378
378
  i2 = ee(n2, Math.min(i2 + 1, l2), o2);
379
379
  let e3 = t2({ rowIndex: i2, colIndex: c2 });
380
380
  for (; !e3 && i2 < l2; ) i2 = ee(n2, Math.min(++i2, l2), o2), e3 = t2({ rowIndex: i2, colIndex: c2 });
381
381
  return i2;
382
382
  }
383
- case T.Up: {
383
+ case D.Up: {
384
384
  i2 = ee(n2, Math.max(i2 - 1, l2), o2);
385
385
  let e3 = t2({ rowIndex: i2, colIndex: c2 });
386
386
  for (; !e3 && i2 > l2; ) i2 = ee(n2, Math.max(--i2, l2), o2), e3 = t2({ rowIndex: i2, colIndex: c2 });
387
387
  return i2;
388
388
  }
389
- case T.Right: {
389
+ case D.Right: {
390
390
  c2 = ee(n2, Math.min(c2 + 1, l2), o2);
391
391
  let e3 = t2({ rowIndex: i2, colIndex: c2 });
392
392
  for (; !e3 && c2 < l2; ) c2 = ee(n2, Math.min(++c2, l2), o2), e3 = t2({ rowIndex: i2, colIndex: c2 });
393
393
  return c2;
394
394
  }
395
- case T.Left: {
395
+ case D.Left: {
396
396
  c2 = ee(n2, Math.max(c2 - 1, l2), o2);
397
397
  let e3 = t2({ rowIndex: i2, colIndex: c2 });
398
398
  for (; !e3 && c2 > l2; ) c2 = ee(n2, Math.max(--c2, l2), o2), e3 = t2({ rowIndex: i2, colIndex: c2 });
@@ -404,25 +404,25 @@ const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = D.Row, headerCount:
404
404
  }, oe = (e2, t2 = () => true, n2, o2, r2, l2) => {
405
405
  let { rowIndex: i2, colIndex: c2 } = e2;
406
406
  switch (o2) {
407
- case T.Down: {
407
+ case D.Down: {
408
408
  i2 = ee(n2, Math.min(i2 + 1, l2), o2);
409
409
  let e3 = t2?.({ rowIndex: i2, colIndex: c2 });
410
410
  for (; e3 && i2 < l2; ) i2 = ee(n2, Math.min(++i2, l2), o2), e3 = t2?.({ rowIndex: i2, colIndex: c2 });
411
411
  return t2?.({ rowIndex: i2, colIndex: c2 }) ? i2 : i2 - 1;
412
412
  }
413
- case T.Up: {
413
+ case D.Up: {
414
414
  i2 = ee(n2, Math.max(i2 - 1, l2), o2);
415
415
  let e3 = t2?.({ rowIndex: i2, colIndex: c2 });
416
416
  for (; e3 && i2 > l2; ) i2 = ee(n2, Math.max(--i2, l2), o2), e3 = t2?.({ rowIndex: i2, colIndex: c2 });
417
417
  return t2?.({ rowIndex: i2, colIndex: c2 }) ? i2 : i2 + 1;
418
418
  }
419
- case T.Right: {
419
+ case D.Right: {
420
420
  c2 = ee(n2, Math.min(c2 + 1, l2), o2);
421
421
  let e3 = t2?.({ rowIndex: i2, colIndex: c2 });
422
422
  for (; e3 && c2 < l2; ) c2 = ee(n2, Math.min(++c2, l2), o2), e3 = t2?.({ rowIndex: i2, colIndex: c2 });
423
423
  return t2?.({ rowIndex: i2, colIndex: c2 }) ? c2 : c2 - 1;
424
424
  }
425
- case T.Left: {
425
+ case D.Left: {
426
426
  c2 = ee(n2, Math.max(c2 - 1, l2), o2);
427
427
  let e3 = t2?.({ rowIndex: i2, colIndex: c2 });
428
428
  for (; e3 && c2 > l2; ) c2 = ee(n2, Math.max(--c2, l2), o2), e3 = t2?.({ rowIndex: i2, colIndex: c2 });
@@ -434,7 +434,7 @@ const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = D.Row, headerCount:
434
434
  }, re = (e2, t2, n2, o2, r2, l2) => {
435
435
  if (!t2) return l2;
436
436
  let i2, { rowIndex: c2, colIndex: s2 } = e2;
437
- o2 === T.Down ? i2 = { rowIndex: c2 + 1, colIndex: s2 } : o2 === T.Up ? i2 = { rowIndex: c2 - 1, colIndex: s2 } : o2 === T.Right ? i2 = { rowIndex: c2, colIndex: s2 + 1 } : o2 === T.Left && (i2 = { rowIndex: c2, colIndex: s2 - 1 });
437
+ o2 === D.Down ? i2 = { rowIndex: c2 + 1, colIndex: s2 } : o2 === D.Up ? i2 = { rowIndex: c2 - 1, colIndex: s2 } : o2 === D.Right ? i2 = { rowIndex: c2, colIndex: s2 + 1 } : o2 === D.Left && (i2 = { rowIndex: c2, colIndex: s2 - 1 });
438
438
  const a2 = t2(e2), d2 = t2(i2);
439
439
  var u2, h2;
440
440
  return (h2 = d2, !(u2 = a2) && !h2 || !u2 && h2 || u2 && !h2 ? ne : oe)(e2, t2, n2, o2, false, l2) ?? l2;
@@ -447,22 +447,22 @@ const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = D.Row, headerCount:
447
447
  i2 = t2 + (n2 - t2) / 2 - (r2 - o2) / 2;
448
448
  }
449
449
  return Math.max(0, Math.min(i2, l2 - (r2 - o2)));
450
- }, ce = (e2, t2, n2, o2) => (console.log("todo: implement convertToVisibleRanges"), e2), se = (e2, t2 = T.Right, n2, o2, r2, l2 = null) => {
450
+ }, ce = (e2, t2, n2, o2) => (console.log("todo: implement convertToVisibleRanges"), e2), se = (e2, t2 = D.Right, n2, o2, r2, l2 = null) => {
451
451
  if (l2 && k.isEqualSelectionCoords(l2, e2)) return e2;
452
452
  const i2 = e2.ranges[e2.rangeIndex];
453
453
  if (!k.isRangesIntersect({ rowStart: e2.cell.rowIndex, colStart: e2.cell.colIndex, rowEnd: e2.cell.rowIndex, colEnd: e2.cell.colIndex }, i2)) return e2;
454
454
  let c2 = { ...e2.cell }, s2 = e2.rangeIndex;
455
455
  switch (t2) {
456
- case T.Right:
456
+ case D.Right:
457
457
  c2.colIndex = ee(r2, c2.colIndex + 1, t2);
458
458
  break;
459
- case T.Left:
459
+ case D.Left:
460
460
  c2.colIndex = ee(r2, c2.colIndex - 1, t2);
461
461
  break;
462
- case T.Down:
462
+ case D.Down:
463
463
  c2.rowIndex = ee(o2, c2.rowIndex + 1, t2);
464
464
  break;
465
- case T.Up:
465
+ case D.Up:
466
466
  c2.rowIndex = ee(o2, c2.rowIndex - 1, t2);
467
467
  }
468
468
  const a2 = (t3) => {
@@ -476,23 +476,23 @@ const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = D.Row, headerCount:
476
476
  c2 = { colIndex: t4.colEnd, rowIndex: t4.rowEnd };
477
477
  }
478
478
  };
479
- if (t2 === T.Right && c2.colIndex > i2.colEnd && c2.rowIndex === i2.rowEnd) a2(true);
480
- else if (t2 === T.Left && c2.colIndex < i2.colStart && c2.rowIndex === i2.rowStart) a2(false);
481
- else if (t2 === T.Down && c2.colIndex === i2.colEnd && c2.rowIndex > i2.rowEnd) a2(true);
482
- else if (t2 === T.Up && c2.colIndex === i2.colStart && c2.rowIndex < i2.rowStart) a2(false);
479
+ if (t2 === D.Right && c2.colIndex > i2.colEnd && c2.rowIndex === i2.rowEnd) a2(true);
480
+ else if (t2 === D.Left && c2.colIndex < i2.colStart && c2.rowIndex === i2.rowStart) a2(false);
481
+ else if (t2 === D.Down && c2.colIndex === i2.colEnd && c2.rowIndex > i2.rowEnd) a2(true);
482
+ else if (t2 === D.Up && c2.colIndex === i2.colStart && c2.rowIndex < i2.rowStart) a2(false);
483
483
  else {
484
484
  let e3 = c2.rowIndex, n3 = c2.colIndex;
485
485
  switch (t2) {
486
- case T.Right:
486
+ case D.Right:
487
487
  n3 > i2.colEnd && (e3 = ee(o2, e3 + 1, t2), n3 = i2.colStart, e3 > i2.rowEnd && (e3 = i2.rowStart));
488
488
  break;
489
- case T.Left:
489
+ case D.Left:
490
490
  n3 < i2.colStart && (e3 = ee(o2, e3 - 1, t2), n3 = i2.colEnd, e3 < i2.rowStart && (e3 = i2.rowEnd));
491
491
  break;
492
- case T.Down:
492
+ case D.Down:
493
493
  e3 > i2.rowEnd && (n3 = ee(r2, n3 + 1, t2), e3 = i2.rowStart, n3 > i2.colEnd && (n3 = i2.colStart));
494
494
  break;
495
- case T.Up:
495
+ case D.Up:
496
496
  e3 < i2.rowStart && (n3 = ee(r2, n3 - 1, t2), e3 = i2.rowEnd, n3 < i2.colStart && (n3 = i2.colEnd));
497
497
  }
498
498
  c2 = { rowIndex: e3, colIndex: n3 };
@@ -502,19 +502,19 @@ const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = D.Row, headerCount:
502
502
  const e3 = k.intersectRanges(d2, i2);
503
503
  e3 && (d2 = e3);
504
504
  }
505
- let u2 = { rowStart: ee(o2, d2.rowStart, T.Down), colStart: ee(r2, d2.colStart, T.Right), rowEnd: ee(o2, d2.rowEnd, T.Up), colEnd: ee(r2, d2.colEnd, T.Left) };
505
+ let u2 = { rowStart: ee(o2, d2.rowStart, D.Down), colStart: ee(r2, d2.colStart, D.Right), rowEnd: ee(o2, d2.rowEnd, D.Up), colEnd: ee(r2, d2.colEnd, D.Left) };
506
506
  if (u2.rowStart !== c2.rowIndex || u2.colStart !== c2.colIndex) {
507
507
  switch (t2) {
508
- case T.Right:
508
+ case D.Right:
509
509
  e2.ranges[s2].colStart === u2.colStart && e2.ranges[s2].colEnd === u2.colEnd && (c2.rowIndex = u2.rowEnd), c2.colIndex = u2.colEnd;
510
510
  break;
511
- case T.Left:
511
+ case D.Left:
512
512
  e2.ranges[s2].colStart === u2.colStart && e2.ranges[s2].colEnd === u2.colEnd && (c2.rowIndex = u2.rowStart), c2.rowIndex === u2.rowStart ? c2.colIndex = u2.colStart + 1 : c2.colIndex = u2.colStart;
513
513
  break;
514
- case T.Down:
514
+ case D.Down:
515
515
  e2.ranges[s2].rowStart === u2.rowStart && e2.ranges[s2].rowEnd === u2.rowEnd && (c2.colIndex = u2.colEnd), c2.rowIndex = u2.rowEnd;
516
516
  break;
517
- case T.Up:
517
+ case D.Up:
518
518
  e2.ranges[s2].rowStart === u2.rowStart && e2.ranges[s2].rowEnd === u2.rowEnd && (c2.colIndex = u2.colStart), c2.colIndex === u2.colStart ? c2.rowIndex = u2.rowStart + 1 : c2.rowIndex = u2.rowStart;
519
519
  }
520
520
  return se({ cell: c2, ranges: e2.ranges, rangeIndex: s2 }, t2, n2, o2, r2, l2 ?? e2);
@@ -522,7 +522,7 @@ const Q = ({ gridRef: e2, gridMainRef: t2, orientation: n2 = D.Row, headerCount:
522
522
  return { ranges: e2.ranges, cell: c2, rangeIndex: s2 };
523
523
  }, ae = (e2, t2) => {
524
524
  let n2, o2 = 0, r2 = 0;
525
- return t2.colStart < e2.colStart ? (n2 = T.Left, o2 = e2.colStart - t2.colStart, r2 = t2.colStart) : t2.colEnd > e2.colEnd ? (n2 = T.Right, o2 = t2.colEnd - e2.colEnd, r2 = t2.colEnd) : t2.rowStart < e2.rowStart ? (n2 = T.Up, o2 = e2.rowStart - t2.rowStart, r2 = t2.rowStart) : t2.rowEnd > e2.rowEnd && (n2 = T.Down, o2 = t2.rowEnd - e2.rowEnd, r2 = t2.rowEnd), { direction: n2, amount: o2, index: r2 };
525
+ return t2.colStart < e2.colStart ? (n2 = D.Left, o2 = e2.colStart - t2.colStart, r2 = t2.colStart) : t2.colEnd > e2.colEnd ? (n2 = D.Right, o2 = t2.colEnd - e2.colEnd, r2 = t2.colEnd) : t2.rowStart < e2.rowStart ? (n2 = D.Up, o2 = e2.rowStart - t2.rowStart, r2 = t2.rowStart) : t2.rowEnd > e2.rowEnd && (n2 = D.Down, o2 = t2.rowEnd - e2.rowEnd, r2 = t2.rowEnd), { direction: n2, amount: o2, index: r2 };
526
526
  }, de = (e2, t2 = false, n2, o2) => {
527
527
  if (!n2) return 0;
528
528
  const r2 = !t2, l2 = r2 ? 1 : -1;
@@ -601,7 +601,7 @@ ve.displayName = "FillHandle";
601
601
  const Se = i.detectIt().supportsTouchEvents, ye = b(C((r2, l2) => {
602
602
  const { range: i2, view: c2, anchor: a2, borderStroke: u2 = "rgb(33, 115, 70)", background: h2 = "white", borderWidth: g2 = 1.5, size: f2 = 22, style: x2, className: v2, selectionTouchPointerHandler: S2, onTouchSelectStart: b2, onTouchSelectEnd: C2, currentTouchAnchor: I2, scrollableElement: E2, scrollableRoot: R2, ...k2 } = r2;
603
603
  if (!Se) return null;
604
- const P2 = o(b2, [b2]), D2 = o(C2, [C2]), { bounds: T2, coordsPivot: O2, key: z2 } = y(() => {
604
+ const P2 = o(b2, [b2]), T2 = o(C2, [C2]), { bounds: D2, coordsPivot: O2, key: z2 } = y(() => {
605
605
  if (!i2 || !c2) return null;
606
606
  let e2 = null, t2 = null;
607
607
  switch (a2) {
@@ -651,15 +651,15 @@ const Se = i.detectIt().supportsTouchEvents, ye = b(C((r2, l2) => {
651
651
  }, onPointerMoveOrWait: (t2, n2, o2) => {
652
652
  const r3 = e2(c2.getCellCoordsFromClient(t2.clientX, t2.clientY));
653
653
  return S2.onSelectionPointerMoveOrWait(t2, n2, o2, c2, r3, B2.current?.coordsPivot, true, true);
654
- }, onPointerUp: (e3, t2, n2) => (B2.current = null, D2?.(a2), S2.onPointerUp(e3, t2, n2)) };
654
+ }, onPointerUp: (e3, t2, n2) => (B2.current = null, T2?.(a2), S2.onPointerUp(e3, t2, n2)) };
655
655
  }, [S2, i2, c2, a2]), A2 = s(F2), [W2, { y: V2, x: U2 }] = J(), H2 = w(null), { getPortalContainer: K2, isFullscreen: N2 } = d(), [q2, j2] = p(null);
656
656
  return m(() => {
657
657
  const t2 = H2.current?.getBoundingClientRect();
658
- if (!t2 || !T2) return void j2(null);
658
+ if (!t2 || !D2) return void j2(null);
659
659
  let n2 = 0, o2 = 0, r3 = E2;
660
660
  for (; r3; ) n2 += r3.scrollLeft, o2 += r3.scrollTop, r3 = R2 && r3 === R2.parentElement ? null : r3.parentElement;
661
661
  j2(L(e("div", { className: M("touch-select-handle", v2), ref: l2, style: { position: "absolute", left: n2 + (t2?.x ?? 0) - (f2 + g2) / 2, top: o2 + (t2?.y ?? 0) - (f2 + g2) / 2, width: f2, height: f2, borderWidth: `${g2}px`, border: u2, borderRadius: "50%", background: h2, boxShadow: `0 0 0 1.5px ${h2}`, cursor: "grab", pointerEvents: "all", opacity: I2 ? 0 : 1, transitionDuration: "160ms", transitionProperty: "opacity", ...x2 }, tabIndex: -1, onPointerDown: A2, ...k2 }), R2 ?? K2(), z2));
662
- }, [V2, U2, T2?.x, T2?.y, T2?.width, T2?.height, v2, I2, h2, f2, g2, u2, E2, N2]), T2 ? t(n, { children: [e("div", { ref: $([W2, H2]), style: { position: "absolute", left: T2.x, top: T2.y, opacity: 0 } }), q2] }) : null;
662
+ }, [V2, U2, D2?.x, D2?.y, D2?.width, D2?.height, v2, I2, h2, f2, g2, u2, E2, N2]), D2 ? t(n, { children: [e("div", { ref: $([W2, H2]), style: { position: "absolute", left: D2.x, top: D2.y, opacity: 0 } }), q2] }) : null;
663
663
  }));
664
664
  ye.displayName = "TouchSelectHandle";
665
665
  const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd: 0 }), Ie = Object.freeze({ colIndex: 0, rowIndex: 0 }), Ee = Object.freeze([]), Re = (e2) => {
@@ -669,8 +669,8 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
669
669
  }, Me = (e2, t2, n2) => {
670
670
  const o2 = e2.getVisibleRangeCoords(), r2 = e2.getScrollOrientation();
671
671
  !r2.horizontal && (t2.colIndex > o2.colEnd || t2.colIndex < o2.colStart) && (t2 = { ...t2, colIndex: t2.colIndex > o2.colEnd ? o2.colEnd + 1 : o2.colEnd - 1 }, e2 = n2.current.getViewFromLocation(O.Center)), !r2.vertical && (t2.rowIndex > o2.rowEnd || t2.rowIndex < o2.rowStart) && (t2 = { ...t2, rowIndex: t2.rowIndex > o2.rowEnd ? o2.rowEnd + 1 : o2.rowEnd - 1 }, e2 = n2.current.getViewFromLocation(O.Center)), e2.scrollCellCoordsIntoView(t2);
672
- }, ke = () => false, Pe = ({ gridRef: t2, commands: n2, layout: r2, selection: l2, onSelectionChange: a2, onSelectionDragStart: d2, onSelectionDragEnd: g2, selectionPolicy: f2 = "multiple", newSelectionMode: x2 = "clear", allowDeselectSelection: b2 = true, onFillPreview: C2, onFillCancel: E2, onFillDone: R2, onFill: M2, disableFillDrag: D2 = !M2, fillHandleBorderColor: z2 = "white", hiddenRowsAt: L2, hiddenColumnsAt: $2, isContentfulCell: B2, contentfulCellFinder: F2 = re, getDataCoords: A2, alwaysScrollToActiveCoords: W2 = false, selectionBounds: V2, pointerDownInterceptor: U2, pointerMoveInterceptor: H2, mergedRanges: K2, canSelectionSpanMergedCells: N2 = ke, onMoveDragStart: q2, onMoveDragUpdate: j2, onMoveDragEnd: X2, onMoveDragDone: Y2, selectionRenderer: G2 = pe, disableMoveDrag: Z2 = !X2, getCellCoordsAsRangeCoords: _2 = k.cellToRange, moveDragHitSize: J2 = 6, moveDragOutlineSize: Q2 = 4, selectionBackgroundColor: te2 = "rgba(16, 124, 65, 0.1)", selectionBorderColor: ne2 = "rgb(33, 115, 70)", selectionRemoveBorderColor: oe2 = "rgb(255, 0, 0)", selectionRemoveBackgroundColor: le2 = "rgba(250, 10, 10, 0.1)", disableTouchSelection: ie2 = false, touchSelectHandleProps: ue2 }) => {
673
- const he2 = v(() => ({ top: V2?.top ?? 0, left: V2?.left ?? 0, bottom: t2.current?.rowCount - 1 || 0, right: t2.current?.columnCount - 1 || 0 }), []), ge2 = o(M2, [M2]), fe2 = o(C2, [C2]), we2 = o(E2, [E2]), xe2 = o(R2, [R2]), me2 = o(B2, [B2]), Se2 = o(G2, [G2]), Pe2 = o((e2, t3 = false) => de(e2, t3, r2.getRowOffset, t3 ? he2().bottom : he2().top), [r2?.getRowOffset]), De2 = o(L2 ?? Pe2, [L2]), Te2 = o((e2, t3 = false) => de(e2, t3, r2.getColOffset, t3 ? he2().right : he2().left), [r2?.getColOffset]), Oe2 = o($2 ?? Te2, [$2]), [ze2, Le2] = p(() => Re(l2)), $e2 = y(() => Re(ze2), [ze2]), Be2 = w($e2), Fe2 = w(true);
672
+ }, ke = () => false, Pe = ({ gridRef: t2, commands: n2, layout: r2, selection: l2, onSelectionChange: a2, onSelectionDragStart: d2, onSelectionDragEnd: g2, selectionPolicy: f2 = "multiple", newSelectionMode: x2 = "clear", allowDeselectSelection: b2 = true, onFillPreview: C2, onFillCancel: E2, onFillDone: R2, onFill: M2, disableFillDrag: T2 = !M2, fillHandleBorderColor: z2 = "white", hiddenRowsAt: L2, hiddenColumnsAt: $2, isContentfulCell: B2, contentfulCellFinder: F2 = re, getDataCoords: A2, alwaysScrollToActiveCoords: W2 = false, selectionBounds: V2, pointerDownInterceptor: U2, pointerMoveInterceptor: H2, mergedRanges: K2, canSelectionSpanMergedCells: N2 = ke, onMoveDragStart: q2, onMoveDragUpdate: j2, onMoveDragEnd: X2, onMoveDragDone: Y2, selectionRenderer: G2 = pe, disableMoveDrag: Z2 = !X2, getCellCoordsAsRangeCoords: _2 = k.cellToRange, moveDragHitSize: J2 = 6, moveDragOutlineSize: Q2 = 4, selectionBackgroundColor: te2 = "rgba(16, 124, 65, 0.1)", selectionBorderColor: ne2 = "rgb(33, 115, 70)", selectionRemoveBorderColor: oe2 = "rgb(255, 0, 0)", selectionRemoveBackgroundColor: le2 = "rgba(250, 10, 10, 0.1)", disableTouchSelection: ie2 = false, touchSelectHandleProps: ue2 }) => {
673
+ const he2 = v(() => ({ top: V2?.top ?? 0, left: V2?.left ?? 0, bottom: t2.current?.rowCount - 1 || 0, right: t2.current?.columnCount - 1 || 0 }), []), ge2 = o(M2, [M2]), fe2 = o(C2, [C2]), we2 = o(E2, [E2]), xe2 = o(R2, [R2]), me2 = o(B2, [B2]), Se2 = o(G2, [G2]), Pe2 = o((e2, t3 = false) => de(e2, t3, r2.getRowOffset, t3 ? he2().bottom : he2().top), [r2?.getRowOffset]), Te2 = o(L2 ?? Pe2, [L2]), De2 = o((e2, t3 = false) => de(e2, t3, r2.getColOffset, t3 ? he2().right : he2().left), [r2?.getColOffset]), Oe2 = o($2 ?? De2, [$2]), [ze2, Le2] = p(() => Re(l2)), $e2 = y(() => Re(ze2), [ze2]), Be2 = w($e2), Fe2 = w(true);
674
674
  S(P.throttle(() => {
675
675
  Le2((e2) => {
676
676
  Fe2.current = true;
@@ -903,16 +903,16 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
903
903
  if (n3 && $e2.ranges.length > 0) {
904
904
  const t3 = $e2.ranges[$e2.rangeIndex], n4 = $e2.cell;
905
905
  switch (e2) {
906
- case T.Up:
906
+ case D.Up:
907
907
  c2 = { rowIndex: n4.rowIndex === t3.rowStart ? t3.rowEnd : t3.rowStart, colIndex: t3.colEnd }, i2 = { rowIndex: n4.rowIndex === t3.rowStart ? t3.rowStart : t3.rowEnd, colIndex: t3.colStart };
908
908
  break;
909
- case T.Down:
909
+ case D.Down:
910
910
  c2 = { rowIndex: n4.rowIndex === t3.rowEnd ? t3.rowStart : t3.rowEnd, colIndex: t3.colEnd }, i2 = { rowIndex: n4.rowIndex === t3.rowEnd ? t3.rowEnd : t3.rowStart, colIndex: t3.colStart };
911
911
  break;
912
- case T.Left:
912
+ case D.Left:
913
913
  c2 = { rowIndex: t3.rowEnd, colIndex: n4.colIndex === t3.colStart ? t3.colEnd : t3.colStart }, i2 = { rowIndex: t3.rowStart, colIndex: n4.colIndex === t3.colStart ? t3.colStart : t3.colEnd };
914
914
  break;
915
- case T.Right:
915
+ case D.Right:
916
916
  c2 = { rowIndex: t3.rowEnd, colIndex: n4.colIndex === t3.colEnd ? t3.colStart : t3.colEnd }, i2 = { rowIndex: t3.rowStart, colIndex: n4.colIndex === t3.colEnd ? t3.colEnd : t3.colStart };
917
917
  }
918
918
  }
@@ -920,39 +920,39 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
920
920
  let { rowStart: a3, colStart: d3 } = s2;
921
921
  const u2 = he2();
922
922
  if (Je2.current) switch (e2) {
923
- case T.Up:
924
- case T.Down:
923
+ case D.Up:
924
+ case D.Down:
925
925
  Je2.current.colIndex >= s2.colStart && Je2.current.colIndex <= s2.colEnd && (d3 = Je2.current.colIndex);
926
926
  break;
927
- case T.Left:
928
- case T.Right:
927
+ case D.Left:
928
+ case D.Right:
929
929
  Je2.current.rowIndex >= s2.rowStart && Je2.current.rowIndex <= s2.rowEnd && (a3 = Je2.current.rowIndex);
930
930
  }
931
931
  if (!l3) {
932
932
  switch (e2) {
933
- case T.Up:
934
- a3 = ee(De2, Math.max(s2.rowStart - 1, u2.top), e2);
933
+ case D.Up:
934
+ a3 = ee(Te2, Math.max(s2.rowStart - 1, u2.top), e2);
935
935
  break;
936
- case T.Down:
937
- a3 = ee(De2, Math.min(s2.rowEnd + 1, u2.bottom), e2);
936
+ case D.Down:
937
+ a3 = ee(Te2, Math.min(s2.rowEnd + 1, u2.bottom), e2);
938
938
  break;
939
- case T.Left:
939
+ case D.Left:
940
940
  d3 = ee(Oe2, Math.max(s2.colStart - 1, u2.left), e2);
941
941
  break;
942
- case T.Right:
942
+ case D.Right:
943
943
  d3 = ee(Oe2, Math.min(s2.colEnd + 1, u2.right), e2);
944
944
  }
945
945
  if (o2) switch (e2) {
946
- case T.Up:
947
- a3 = F2({ ...c2, colIndex: $e2.cell.colIndex }, me2, De2, e2, false, Math.max(u2.top, De2(u2.top, false)));
946
+ case D.Up:
947
+ a3 = F2({ ...c2, colIndex: $e2.cell.colIndex }, me2, Te2, e2, false, Math.max(u2.top, Te2(u2.top, false)));
948
948
  break;
949
- case T.Down:
950
- a3 = F2({ ...c2, colIndex: $e2.cell.colIndex }, me2, De2, e2, false, Math.min(u2.bottom, u2.bottom - De2(u2.bottom, true)));
949
+ case D.Down:
950
+ a3 = F2({ ...c2, colIndex: $e2.cell.colIndex }, me2, Te2, e2, false, Math.min(u2.bottom, u2.bottom - Te2(u2.bottom, true)));
951
951
  break;
952
- case T.Left:
952
+ case D.Left:
953
953
  d3 = F2({ ...c2, rowIndex: $e2.cell.rowIndex }, me2, Oe2, e2, false, Math.max(u2.left, Oe2(u2.left, false)));
954
954
  break;
955
- case T.Right:
955
+ case D.Right:
956
956
  d3 = F2({ ...c2, rowIndex: $e2.cell.rowIndex }, me2, Oe2, e2, false, Math.min(u2.right, u2.right - Oe2(u2.right, true)));
957
957
  }
958
958
  }
@@ -960,16 +960,16 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
960
960
  if (l3) {
961
961
  let n4 = 0;
962
962
  switch (e2) {
963
- case T.Up:
963
+ case D.Up:
964
964
  n4 = r2.getRowOffset(a3 + 1), a3 = Math.max(u2.top, r2.getRowIndex(n4 - l3)), h2 = { top: r2.getRowOffset(a3 + 1) - (n4 - t2.current.getScrollPosition().top) };
965
965
  break;
966
- case T.Down:
966
+ case D.Down:
967
967
  n4 = r2.getRowOffset(a3), a3 = Math.min(u2.bottom, r2.getRowIndex(n4 + l3)), h2 = { top: r2.getRowOffset(a3) - (n4 - t2.current.getScrollPosition().top) };
968
968
  break;
969
- case T.Left:
969
+ case D.Left:
970
970
  n4 = r2.getColOffset(d3 + 1), d3 = Math.max(u2.left, r2.getColIndex(n4 - l3)), h2 = { left: r2.getColOffset(d3 + 1) - (n4 - t2.current.getScrollPosition().left) };
971
971
  break;
972
- case T.Right:
972
+ case D.Right:
973
973
  n4 = r2.getColOffset(d3), d3 = Math.min(u2.right, r2.getColIndex(n4 + l3)), h2 = { left: r2.getColOffset(d3) - (n4 - t2.current.getScrollPosition().left) };
974
974
  }
975
975
  }
@@ -980,16 +980,16 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
980
980
  else {
981
981
  if (n3 && _e2.current) {
982
982
  const t3 = he2();
983
- if (e2 === T.Right && _e2.current.colIndex === t3.left || e2 === T.Left && _e2.current.colIndex === t3.right || e2 === T.Up && _e2.current.rowIndex === t3.bottom || e2 === T.Down && _e2.current.rowIndex === t3.top) return;
983
+ if (e2 === D.Right && _e2.current.colIndex === t3.left || e2 === D.Left && _e2.current.colIndex === t3.right || e2 === D.Up && _e2.current.rowIndex === t3.bottom || e2 === D.Down && _e2.current.rowIndex === t3.top) return;
984
984
  }
985
- e2 === T.Left || e2 === T.Right ? et({ colIndex: g3.colIndex }) : e2 !== T.Up && e2 !== T.Down || et({ rowIndex: g3.rowIndex });
985
+ e2 === D.Left || e2 === D.Right ? et({ colIndex: g3.colIndex }) : e2 !== D.Up && e2 !== D.Down || et({ rowIndex: g3.rowIndex });
986
986
  }
987
987
  }, [$e2, _2]), xt = o((e2) => {
988
988
  if (!t2.current) return;
989
989
  if (0 === $e2.ranges.length) return void wt(e2);
990
990
  const n3 = _2($e2.cell);
991
991
  if (k.isEqualRangesArrays([n3], $e2.ranges)) return void wt(e2);
992
- const o2 = se($e2, e2, _2, De2, Oe2);
992
+ const o2 = se($e2, e2, _2, Te2, Oe2);
993
993
  Le2((e3) => {
994
994
  Fe2.current = false, e3 = Re(e3);
995
995
  const t3 = { ...e3, cell: o2.cell, rangeIndex: o2.rangeIndex };
@@ -1024,10 +1024,10 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1024
1024
  }, [A2]), Rt = o((e2) => {
1025
1025
  if (!t2.current) return;
1026
1026
  if ($e2.ranges.length <= 1) return;
1027
- const n3 = e2 === T.Left || e2 === T.Up;
1027
+ const n3 = e2 === D.Left || e2 === D.Up;
1028
1028
  let o2 = $e2.rangeIndex + (n3 ? -1 : 1);
1029
1029
  o2 < 0 ? o2 = $e2.ranges.length - 1 : o2 > $e2.ranges.length - 1 && (o2 = 0);
1030
- const r3 = $e2.ranges[o2], l3 = se({ cell: { rowIndex: r3.rowEnd, colIndex: r3.colEnd }, rangeIndex: 0, ranges: [r3] }, T.Right, _2, De2, Oe2);
1030
+ const r3 = $e2.ranges[o2], l3 = se({ cell: { rowIndex: r3.rowEnd, colIndex: r3.colEnd }, rangeIndex: 0, ranges: [r3] }, D.Right, _2, Te2, Oe2);
1031
1031
  Le2((e3) => {
1032
1032
  Fe2.current = false, e3 = Re(e3);
1033
1033
  const t3 = { ...e3, cell: l3.cell, rangeIndex: o2 };
@@ -1051,59 +1051,59 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1051
1051
  return k.isEqualSelectionCoords(t3, e3) ? e3 : t3;
1052
1052
  }), l3 && et(l3);
1053
1053
  }, [$e2, _2]), Pt = v((e2 = false) => {
1054
- wt(T.Down, e2, false, t2.current.getDimensions().containerHeight);
1055
- }, []), Dt = v((e2 = false) => {
1056
- wt(T.Up, e2, false, t2.current.getDimensions().containerHeight);
1054
+ wt(D.Down, e2, false, t2.current.getDimensions().containerHeight);
1057
1055
  }, []), Tt = v((e2 = false) => {
1058
- wt(T.Right, e2, false, t2.current.getDimensions().containerWidth);
1056
+ wt(D.Up, e2, false, t2.current.getDimensions().containerHeight);
1057
+ }, []), Dt = v((e2 = false) => {
1058
+ wt(D.Right, e2, false, t2.current.getDimensions().containerWidth);
1059
1059
  }, []), Ot = v((e2 = false) => {
1060
- wt(T.Left, e2, false, t2.current.getDimensions().containerWidth);
1060
+ wt(D.Left, e2, false, t2.current.getDimensions().containerWidth);
1061
1061
  }, []), zt = v(() => {
1062
- xt(T.Left);
1062
+ xt(D.Left);
1063
1063
  }, []), Lt = v(() => {
1064
- xt(T.Right);
1064
+ xt(D.Right);
1065
1065
  }, []), $t = v(() => {
1066
- xt(T.Up);
1066
+ xt(D.Up);
1067
1067
  }, []), Bt = v(() => {
1068
- xt(T.Down);
1068
+ xt(D.Down);
1069
1069
  }, []), Ft = v(() => {
1070
- Rt(T.Left);
1070
+ Rt(D.Left);
1071
1071
  }, []), At = v(() => {
1072
- Rt(T.Right);
1072
+ Rt(D.Right);
1073
1073
  }, []), Wt = v(() => {
1074
1074
  kt();
1075
1075
  }, []), Vt = v(() => {
1076
- wt(T.Left, false, false);
1076
+ wt(D.Left, false, false);
1077
1077
  }, []), Ut = v(() => {
1078
- wt(T.Left, true, false);
1078
+ wt(D.Left, true, false);
1079
1079
  }, []), Ht = v(() => {
1080
- wt(T.Left, false, true);
1080
+ wt(D.Left, false, true);
1081
1081
  }, []), Kt = v(() => {
1082
- wt(T.Left, true, true);
1082
+ wt(D.Left, true, true);
1083
1083
  }, []), Nt = v(() => {
1084
- wt(T.Right, false, false);
1084
+ wt(D.Right, false, false);
1085
1085
  }, []), qt = v(() => {
1086
- wt(T.Right, true, false);
1086
+ wt(D.Right, true, false);
1087
1087
  }, []), jt = v(() => {
1088
- wt(T.Right, false, true);
1088
+ wt(D.Right, false, true);
1089
1089
  }, []), Xt = v(() => {
1090
- wt(T.Right, true, true);
1090
+ wt(D.Right, true, true);
1091
1091
  }, []), Yt = v(() => {
1092
- wt(T.Up, false, false);
1092
+ wt(D.Up, false, false);
1093
1093
  }, []), Gt = v(() => {
1094
- wt(T.Up, true, false);
1094
+ wt(D.Up, true, false);
1095
1095
  }, []), Zt = v(() => {
1096
- wt(T.Up, false, true);
1096
+ wt(D.Up, false, true);
1097
1097
  }, []), _t = v(() => {
1098
- wt(T.Up, true, true);
1098
+ wt(D.Up, true, true);
1099
1099
  }, []), Jt = v(() => {
1100
- wt(T.Down, false, false);
1100
+ wt(D.Down, false, false);
1101
1101
  }, []), Qt = v(() => {
1102
- wt(T.Down, true, false);
1102
+ wt(D.Down, true, false);
1103
1103
  }, []), en = v(() => {
1104
- wt(T.Down, false, true);
1104
+ wt(D.Down, false, true);
1105
1105
  }, []), tn = v(() => {
1106
- wt(T.Down, true, true);
1106
+ wt(D.Down, true, true);
1107
1107
  }, []), nn = v(() => {
1108
1108
  Ae2((e2) => e2.slice(0, -1));
1109
1109
  }, []), on = y(() => {
@@ -1140,7 +1140,7 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1140
1140
  const o2 = t2.current.getViewFromClient(e2.nativeEvent.clientX, e2.nativeEvent.clientY), r3 = o2?.getCellCoordsFromClient(e2.nativeEvent.clientX, e2.nativeEvent.clientY);
1141
1141
  r3 && (e2.stopPropagation(), Ue2("crosshair"), cn.current = { anchor: o2.getAnchor(), coords: r3 });
1142
1142
  }, onPointerMoveOrWait: (e2, n3) => {
1143
- if (D2 || !t2?.current || !Be2.current || !cn.current) return;
1143
+ if (T2 || !t2?.current || !Be2.current || !cn.current) return;
1144
1144
  const o2 = cn.current.anchor;
1145
1145
  let r3 = t2.current.getViewFromLocation(o2), l3 = r3.getCellCoordsFromClient(e2.clientX, e2.clientY);
1146
1146
  if (!l3) return;
@@ -1150,24 +1150,24 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1150
1150
  if (!c2) return;
1151
1151
  const s2 = i2.length > 0, a3 = s2 ? i2[i2.length - 1] : _2(Be2.current.cell);
1152
1152
  if (!c2) return;
1153
- const d3 = c2.rowStart < a3.rowStart ? T.Up : c2.rowEnd > a3.rowEnd ? T.Down : c2.colEnd > a3.colEnd ? T.Right : T.Left, u2 = he2();
1154
- d3 === T.Left && (c2 = { ...a3, colStart: Math.max(u2.left, c2.colStart) }), d3 === T.Up && (c2 = { ...a3, rowStart: Math.max(u2.top, c2.rowStart) }), d3 === T.Right && (c2 = { ...a3, colEnd: Math.min(u2.right, c2.colEnd) }), d3 === T.Down && (c2 = { ...a3, rowEnd: Math.min(u2.bottom, c2.rowEnd) });
1153
+ const d3 = c2.rowStart < a3.rowStart ? D.Up : c2.rowEnd > a3.rowEnd ? D.Down : c2.colEnd > a3.colEnd ? D.Right : D.Left, u2 = he2();
1154
+ d3 === D.Left && (c2 = { ...a3, colStart: Math.max(u2.left, c2.colStart) }), d3 === D.Up && (c2 = { ...a3, rowStart: Math.max(u2.top, c2.rowStart) }), d3 === D.Right && (c2 = { ...a3, colEnd: Math.min(u2.right, c2.colEnd) }), d3 === D.Down && (c2 = { ...a3, rowEnd: Math.min(u2.bottom, c2.rowEnd) });
1155
1155
  const h2 = ae(a3, c2);
1156
1156
  if (!N2?.(a3)) {
1157
1157
  let e3;
1158
1158
  "function" == typeof Qe.current ? e3 = Qe.current(a3) : K2 && (e3 = K2), c2 = ((e4, t3, n4, o3, r4, l4) => {
1159
1159
  const i3 = { ...t3 };
1160
1160
  if (0 === n4.length) return i3;
1161
- if (r4 === T.Left) {
1161
+ if (r4 === D.Left) {
1162
1162
  const t4 = e4.colEnd + 1 - e4.colStart;
1163
1163
  i3.colStart = e4.colStart - Math.ceil(l4 / t4) * t4, i3.colStart < o3.left && (i3.colStart = i3.colStart + Math.ceil((o3.left - i3.colStart) / t4) * t4);
1164
- } else if (r4 === T.Right) {
1164
+ } else if (r4 === D.Right) {
1165
1165
  const t4 = e4.colEnd + 1 - e4.colStart;
1166
1166
  i3.colEnd = e4.colEnd + Math.ceil(l4 / t4) * t4, i3.colEnd > o3.right && (i3.colEnd = i3.colEnd - Math.ceil((o3.right - i3.colEnd) / t4) * t4);
1167
- } else if (r4 === T.Up) {
1167
+ } else if (r4 === D.Up) {
1168
1168
  const t4 = e4.rowEnd + 1 - e4.rowStart;
1169
1169
  i3.rowStart = e4.rowStart - Math.ceil(l4 / t4) * t4, i3.rowStart < o3.top && (i3.rowStart = i3.rowStart + Math.ceil((o3.top - i3.rowStart) / t4) * t4);
1170
- } else if (r4 === T.Down) {
1170
+ } else if (r4 === D.Down) {
1171
1171
  const t4 = e4.rowEnd + 1 - e4.rowStart;
1172
1172
  i3.rowEnd = e4.rowEnd + Math.ceil(l4 / t4) * t4, i3.rowEnd > o3.bottom && (i3.rowEnd = i3.rowEnd - Math.ceil((o3.bottom - i3.rowEnd) / t4) * t4);
1173
1173
  }
@@ -1289,7 +1289,7 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1289
1289
  }
1290
1290
  }
1291
1291
  let h2 = null;
1292
- !D2 && o2 && !un && (h2 = I(ve, { ...o2, corner: r3, size: 7.5, borderStroke: `${z2} solid`, style: { borderRadius: 1 }, background: ne2, ...dn, key: "fillHandle" }));
1292
+ !T2 && o2 && !un && (h2 = I(ve, { ...o2, corner: r3, size: 7.5, borderStroke: `${z2} solid`, style: { borderRadius: 1 }, background: ne2, ...dn, key: "fillHandle" }));
1293
1293
  const g3 = [...l3];
1294
1294
  if (d3 && g3.push(d3), u2 && g3.push(u2), h2 && g3.push(h2), !ie2 && st && 1 === s2?.ranges.length && s2.ranges[s2.ranges.length - 1]) {
1295
1295
  const o3 = s2.ranges[s2.ranges.length - 1], r4 = o3.rowStart === he2().top && o3.rowEnd === he2().bottom, l4 = o3.colStart === he2().left && o3.colEnd === he2().right, i3 = { view: n3, range: o3, borderStroke: `${ne2} solid`, background: z2, selectionTouchPointerHandler: ft, ...ue2, onTouchSelectStart: (e2) => Ze2(e2), onTouchSelectEnd: () => Ze2(null), currentTouchAnchor: Ge2 };
@@ -1300,19 +1300,19 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1300
1300
  e2 && g3.push(Se2({ range: un, key: "selection-move-outline", x: e2.x - Q2 / 2, y: e2.y - Q2 / 2, width: Math.max(e2.width + Q2 / 2, 1), height: Math.max(e2.height + Q2 / 2, 1), stroke: ne2, style: { boxShadow: "none", transitionDuration: "70ms", transitionTimingFunction: "ease-in", transitionProperty: "left, top, width, height", willChange: "left, top, width, height" }, strokeWidth: Q2 }));
1301
1301
  }
1302
1302
  return e("div", { children: g3 }, "selection");
1303
- }, [mn, qe2, D2, He2, Z2, un, he2, z2, ne2, te2, oe2, le2, ie2, ue2, Ge2]), Sn = y(() => {
1303
+ }, [mn, qe2, T2, He2, Z2, un, he2, z2, ne2, te2, oe2, le2, ie2, ue2, Ge2]), Sn = y(() => {
1304
1304
  const e2 = () => t2.current;
1305
- return [new u("moveToPageDown", e2, { label: "Page Down", description: "Shift viewport down one page.", shortcut: [{ key: "PageDown" }] }, () => Pt(false)), new u("selectToPageDown", e2, { label: "Select To Page Down", description: "Shift viewport and select down one page.", shortcut: [{ key: "PageDown", modifiers: [h.Shift] }] }, () => Pt(true)), new u("moveToPageRight", e2, { label: "Page Right", description: "Shift viewport right one page.", shortcut: [{ key: "PageDown", modifiers: [h.Alt] }] }, () => Tt(false)), new u("selectToPageRight", e2, { label: "Page Right", description: "Shift viewport right one page.", shortcut: [{ key: "PageDown", modifiers: [h.Alt, h.Shift] }] }, () => Tt(true)), new u("moveToPageUp", e2, { label: "Page Up", description: "Shift viewport up one page.", shortcut: [{ key: "PageUp" }] }, () => Dt(false)), new u("selectToPageUp", e2, { label: "Page Up", description: "Shift viewport up one page.", shortcut: [{ key: "PageUp", modifiers: [h.Shift] }] }, () => Dt(true)), new u("moveToPageLeft", e2, { label: "Page Left", description: "Shift viewport left one page.", shortcut: [{ key: "PageUp", modifiers: [h.Alt] }] }, () => Ot(false)), new u("selectToPageLeft", e2, { label: "Page Left", description: "Shift viewport left one page.", shortcut: [{ key: "PageUp", modifiers: [h.Alt, h.Shift] }] }, () => Ot(true)), new u("selectColumn", e2, { label: "Select Column", description: "Select the columns for the selected cells.", shortcut: { key: "Space", modifiers: [h.Ctrl] } }, pt), new u("selectRow", e2, { label: "Select Row", description: "Select the rows for the selected cells.", shortcut: { key: "Space", modifiers: [h.Shift] } }, mt), new u("selectToColumnStart", e2, { label: "Select To Column Start", description: "Select the columns to the beginning of the sheet." }, () => St(true)), new u("selectToColumnEnd", e2, { label: "Select To Column End", description: "Select the columns to the end of the sheet." }, () => yt(true)), new u("moveToRowStart", e2, { label: "Move to Row Home", description: "Move to the beginning of the row.", shortcut: [{ key: "Home" }] }, () => bt(false)), new u("selectToRowStart", e2, { label: "Select to Row Home", description: "Select to the beginning of the row.", shortcut: [{ key: "Home", modifiers: [h.Shift] }] }, () => bt(true)), new u("moveToSheetStart", e2, { label: "Move to Sheet Home", description: "Move to the beginning of the sheet.", shortcut: [{ key: "Home", modifiers: [h.Ctrl] }] }, () => Ct(false)), new u("selectToSheetStart", e2, { label: "Select to Sheet Home", description: "Select to the beginning of the sheet.", shortcut: [{ key: "Home", modifiers: [h.Ctrl, h.Shift] }] }, () => Ct(true)), new u("moveToRowEnd", e2, { label: "Move to Row End", description: "Move to the end of the row.", shortcut: [{ key: "End" }] }, () => It(false)), new u("selectToRowEnd", e2, { label: "Select to Row End", description: "Select to the end of the row.", shortcut: [{ key: "End", modifiers: [h.Shift] }] }, () => It(true)), new u("moveToSheetEnd", e2, { label: "Move to Sheet End", description: "Move to the end of the sheet.", shortcut: [{ key: "End", modifiers: [h.Ctrl] }] }, () => Et(false)), new u("selectToSheetEnd", e2, { label: "Select to Sheet End", description: "Select to the end of the sheet.", shortcut: [{ key: "End", modifiers: [h.Ctrl, h.Shift] }] }, () => Et(true)), new u("scrollToActiveCoords", e2, { label: "Scroll to Active Cell", description: "Scroll to the Active Cell.", shortcut: { key: "Backspace", modifiers: [h.Ctrl] } }, vt), new u("scrollToActiveCoordsClearSelection", e2, { label: "Scroll to Active Cell", description: "Scroll to the Active Cell and clear selection.", shortcut: { key: "Backspace", modifiers: [h.Shift] } }, () => {
1305
+ return [new u("moveToPageDown", e2, { label: "Page Down", description: "Shift viewport down one page.", shortcut: [{ key: "PageDown" }] }, () => Pt(false)), new u("selectToPageDown", e2, { label: "Select To Page Down", description: "Shift viewport and select down one page.", shortcut: [{ key: "PageDown", modifiers: [h.Shift] }] }, () => Pt(true)), new u("moveToPageRight", e2, { label: "Page Right", description: "Shift viewport right one page.", shortcut: [{ key: "PageDown", modifiers: [h.Alt] }] }, () => Dt(false)), new u("selectToPageRight", e2, { label: "Page Right", description: "Shift viewport right one page.", shortcut: [{ key: "PageDown", modifiers: [h.Alt, h.Shift] }] }, () => Dt(true)), new u("moveToPageUp", e2, { label: "Page Up", description: "Shift viewport up one page.", shortcut: [{ key: "PageUp" }] }, () => Tt(false)), new u("selectToPageUp", e2, { label: "Page Up", description: "Shift viewport up one page.", shortcut: [{ key: "PageUp", modifiers: [h.Shift] }] }, () => Tt(true)), new u("moveToPageLeft", e2, { label: "Page Left", description: "Shift viewport left one page.", shortcut: [{ key: "PageUp", modifiers: [h.Alt] }] }, () => Ot(false)), new u("selectToPageLeft", e2, { label: "Page Left", description: "Shift viewport left one page.", shortcut: [{ key: "PageUp", modifiers: [h.Alt, h.Shift] }] }, () => Ot(true)), new u("selectColumn", e2, { label: "Select Column", description: "Select the columns for the selected cells.", shortcut: { key: "Space", modifiers: [h.Ctrl] } }, pt), new u("selectRow", e2, { label: "Select Row", description: "Select the rows for the selected cells.", shortcut: { key: "Space", modifiers: [h.Shift] } }, mt), new u("selectToColumnStart", e2, { label: "Select To Column Start", description: "Select the columns to the beginning of the sheet." }, () => St(true)), new u("selectToColumnEnd", e2, { label: "Select To Column End", description: "Select the columns to the end of the sheet." }, () => yt(true)), new u("moveToRowStart", e2, { label: "Move to Row Home", description: "Move to the beginning of the row.", shortcut: [{ key: "Home" }] }, () => bt(false)), new u("selectToRowStart", e2, { label: "Select to Row Home", description: "Select to the beginning of the row.", shortcut: [{ key: "Home", modifiers: [h.Shift] }] }, () => bt(true)), new u("moveToSheetStart", e2, { label: "Move to Sheet Home", description: "Move to the beginning of the sheet.", shortcut: [{ key: "Home", modifiers: [h.Ctrl] }] }, () => Ct(false)), new u("selectToSheetStart", e2, { label: "Select to Sheet Home", description: "Select to the beginning of the sheet.", shortcut: [{ key: "Home", modifiers: [h.Ctrl, h.Shift] }] }, () => Ct(true)), new u("moveToRowEnd", e2, { label: "Move to Row End", description: "Move to the end of the row.", shortcut: [{ key: "End" }] }, () => It(false)), new u("selectToRowEnd", e2, { label: "Select to Row End", description: "Select to the end of the row.", shortcut: [{ key: "End", modifiers: [h.Shift] }] }, () => It(true)), new u("moveToSheetEnd", e2, { label: "Move to Sheet End", description: "Move to the end of the sheet.", shortcut: [{ key: "End", modifiers: [h.Ctrl] }] }, () => Et(false)), new u("selectToSheetEnd", e2, { label: "Select to Sheet End", description: "Select to the end of the sheet.", shortcut: [{ key: "End", modifiers: [h.Ctrl, h.Shift] }] }, () => Et(true)), new u("scrollToActiveCoords", e2, { label: "Scroll to Active Cell", description: "Scroll to the Active Cell.", shortcut: { key: "Backspace", modifiers: [h.Ctrl] } }, vt), new u("scrollToActiveCoordsClearSelection", e2, { label: "Scroll to Active Cell", description: "Scroll to the Active Cell and clear selection.", shortcut: { key: "Backspace", modifiers: [h.Shift] } }, () => {
1306
1306
  ct(), rn($e2.cell, true);
1307
1307
  }), new u("traverseSelectionRight", e2, { label: "Traverse Right", description: "Traverse the selection moving rightward.", shortcut: { key: "Tab" } }, Lt), new u("traverseSelectionLeft", e2, { label: "Traverse Left", description: "Traverse the selection moving leftward.", shortcut: { key: "Tab", modifiers: [h.Shift] } }, zt), new u("traverseSelectionDown", e2, { label: "Traverse Down", description: "Traverse the selection moving downward.", shortcut: [{ key: "Enter" }, { key: "NumpadEnter" }] }, Bt), new u("traverseSelectionUp", e2, { label: "Traverse Up", description: "Traverse the selection moving upward.", shortcut: [{ key: "Enter", modifiers: [h.Shift] }, { key: "NumpadEnter", modifiers: [h.Shift] }] }, $t), new u("moveLeft", e2, { label: "Move Left", description: "Move active cell to the left.", shortcut: [{ key: "ArrowLeft" }] }, Vt), new u("selectLeft", e2, { label: "Select Left", description: "Extend selection left.", shortcut: [{ key: "ArrowLeft", modifiers: [h.Shift] }] }, Ut), new u("moveContentfulLeft", e2, { label: "Move Left Contentful", description: "Move left to the next cell with content.", shortcut: [{ key: "ArrowLeft", modifiers: [h.Ctrl] }] }, Ht), new u("selectContentfulLeft", e2, { label: "Select Left Contentful", description: "Extend selection left to the next cell with content.", shortcut: [{ key: "ArrowLeft", modifiers: [h.Ctrl, h.Shift] }] }, Kt), new u("moveRight", e2, { label: "Move Right", description: "Move active cell to the right.", shortcut: [{ key: "ArrowRight" }] }, Nt), new u("selectRight", e2, { label: "Select Right", description: "Extend selection right.", shortcut: [{ key: "ArrowRight", modifiers: [h.Shift] }] }, qt), new u("moveContentfulRight", e2, { label: "Move Right Contentful", description: "Move right to the next cell with content.", shortcut: [{ key: "ArrowRight", modifiers: [h.Ctrl] }] }, jt), new u("selectContentfulRight", e2, { label: "Select Right Contentful", description: "Extend selection right to the next cell with content.", shortcut: [{ key: "ArrowRight", modifiers: [h.Ctrl, h.Shift] }] }, Xt), new u("moveUp", e2, { label: "Move Up", description: "Move active cell to the up.", shortcut: [{ key: "ArrowUp" }] }, Yt), new u("selectUp", e2, { label: "Select Up", description: "Extend selection up.", shortcut: [{ key: "ArrowUp", modifiers: [h.Shift] }] }, Gt), new u("moveContentfulUp", e2, { label: "Move Up Contentful", description: "Move up to the next cell with content.", shortcut: [{ key: "ArrowUp", modifiers: [h.Ctrl] }] }, Zt), new u("selectContentfulUp", e2, { label: "Select Up Contentful", description: "Extend selection up to the next cell with content.", shortcut: [{ key: "ArrowUp", modifiers: [h.Ctrl, h.Shift] }] }, _t), new u("moveDown", e2, { label: "Move Down", description: "Move active cell to the down.", shortcut: [{ key: "ArrowDown" }] }, Jt), new u("selectDown", e2, { label: "Select Down", description: "Extend selection down.", shortcut: [{ key: "ArrowDown", modifiers: [h.Shift] }] }, Qt), new u("moveContentfulDown", e2, { label: "Move Down Contentful", description: "Move down to the next cell with content.", shortcut: [{ key: "ArrowDown", modifiers: [h.Ctrl] }] }, en), new u("selectContentfulDown", e2, { label: "Select Down Contentful", description: "Extend selection down to the next cell with content.", shortcut: [{ key: "ArrowDown", modifiers: [h.Ctrl, h.Shift] }] }, tn), new u("selectVisible", e2, { label: "Select Visible", description: "Select visible cells only.", shortcut: { key: ";", modifiers: [h.Alt] } }, Mt), new u("traverseSelectionPreviousRange", e2, { label: "Traverse Previous Range", description: "Traverse the selection to the previous range.", shortcut: { key: "ArrowLeft", modifiers: [h.Ctrl, h.Alt] } }, Ft), new u("traverseSelectionNextRange", e2, { label: "Traverse Next Range", description: "Traverse the selection to the next range.", shortcut: { key: "ArrowRight", modifiers: [h.Ctrl, h.Alt] } }, At), new u("traverseSelectionCorners", e2, { label: "Traverse Corners", description: "Traverse the selection through the corners of the selected range.", shortcut: { key: ".", modifiers: [h.Ctrl] } }, Wt)];
1308
1308
  }, []);
1309
1309
  return y(() => {
1310
1310
  n2?.addCommands(Sn, true);
1311
1311
  }, [n2]), { selection: mn, setSelectionCell: rn, setSelectionRanges: Ae2, overlay: vn, cursor: Ve2, onPointerDown: gt, clearLastSelection: nn, newSelection: lt, modifySelection: rt, appendSelection: it, clearSelections: ct, isEntire: on, navigate: wt, navigateSelection: xt };
1312
- }, De = { "sheetxl-grid": "_sheetxl-grid_h9wwa_7" }, Te = Object.freeze({ top: 0, left: 0 }), Oe = Object.freeze({ bottom: -4, right: -4 }), ze = Object.freeze({ horizontal: true, vertical: true }), Le = [O.TopLeft, O.Top, O.Left, O.Center], $e = 150, Be = 3e3, Fe = {}, Ae = b(C((r2, l2) => {
1313
- const { width: c2, height: s2, rowCount: a2 = 1, columnCount: d2 = 1, defaultRowHeight: u2, defaultColumnWidth: h2, getRowHeight: f2, getColumnWidth: b2, layout: C2, onViewportScroll: E2, onImmediateScroll: D2, showGridLines: z2 = true, gridLineColor: L2 = "rgb(224, 224, 224)", gridLineRowsProps: $2, gridLineColumnsProps: B2, clipCells: F2 = true, cursor: A2, freezeLeft: W2 = 0, freezeTop: U2 = 0, freezeLeftProps: H2, freezeTopProps: K2, cellRenderer: N2, onViewportChange: q2, onFirstRender: j2, overlayRenderer: X2, overlayProps: Y2, overlays: G2, overlaysProps: Z2, allowOverlaysOverflow: _2 = false, stageProps: J2, stageWrapper: Q2 = null, hiddenRowsAt: ee2, hiddenColumnsAt: ne2, hiddenCellAt: oe2, getVisibleCells: re2, zoom: ce2 = 1, enableMouseWheel: se2 = true, onWheelScroll: ae2, getCellCoordsAsRangeCoords: fe2 = k.cellToRange, scrollPoint: xe2 = Te, style: pe2 = {}, ...me2 } = r2;
1312
+ }, Te = { "sheetxl-grid": "_sheetxl-grid_h9wwa_7" }, De = Object.freeze({ top: 0, left: 0 }), Oe = Object.freeze({ bottom: -4, right: -4 }), ze = Object.freeze({ horizontal: true, vertical: true }), Le = [O.TopLeft, O.Top, O.Left, O.Center], $e = 150, Be = 3e3, Fe = {}, Ae = b(C((r2, l2) => {
1313
+ const { width: c2, height: s2, rowCount: a2 = 1, columnCount: d2 = 1, defaultRowHeight: u2, defaultColumnWidth: h2, getRowHeight: f2, getColumnWidth: b2, layout: C2, onViewportScroll: E2, onImmediateScroll: T2, showGridLines: z2 = true, gridLineColor: L2 = "rgb(224, 224, 224)", gridLineRowsProps: $2, gridLineColumnsProps: B2, clipCells: F2 = true, cursor: A2, freezeLeft: W2 = 0, freezeTop: U2 = 0, freezeLeftProps: H2, freezeTopProps: K2, cellRenderer: N2, onViewportChange: q2, onFirstRender: j2, overlayRenderer: X2, overlayProps: Y2, overlays: G2, overlaysProps: Z2, allowOverlaysOverflow: _2 = false, stageProps: J2, stageWrapper: Q2 = null, hiddenRowsAt: ee2, hiddenColumnsAt: ne2, hiddenCellAt: oe2, getVisibleCells: re2, zoom: ce2 = 1, enableMouseWheel: se2 = true, onWheelScroll: ae2, getCellCoordsAsRangeCoords: fe2 = k.cellToRange, scrollPoint: xe2 = De, style: pe2 = {}, ...me2 } = r2;
1314
1314
  R(N2, "No cellRenderer specified. This is probably not what you wanted"), R(!r2?.children, "Grid does not support children elements");
1315
- const ve2 = o(D2, [D2]), Se2 = o(q2, [q2]), ye2 = o(E2, [E2]), be2 = o(ae2, [ae2]), Ce2 = o(j2, [j2]), Ie2 = w(null), Ee2 = w(null), Re2 = w(null), [Me2, ke2] = x((e2) => e2 + 1, 0), [Pe2, $e2] = p({ left: xe2?.left ?? 0, top: xe2?.top ?? 0, horizontalScrollDirection: null, verticalScrollDirection: null }), Ae2 = w(null), We2 = w(Pe2), { top: Ve2, left: Ue2, verticalScrollDirection: He2, horizontalScrollDirection: Ke2 } = Pe2, Ne2 = w(false), qe2 = V({ rowCount: a2, columnCount: d2, defaultRowHeight: u2, defaultColumnWidth: h2, getRowHeight: f2, getColumnWidth: b2 }), je2 = w(null), Xe2 = y(() => {
1315
+ const ve2 = o(T2, [T2]), Se2 = o(q2, [q2]), ye2 = o(E2, [E2]), be2 = o(ae2, [ae2]), Ce2 = o(j2, [j2]), Ie2 = w(null), Ee2 = w(null), Re2 = w(null), [Me2, ke2] = x((e2) => e2 + 1, 0), [Pe2, $e2] = p({ left: xe2?.left ?? 0, top: xe2?.top ?? 0, horizontalScrollDirection: null, verticalScrollDirection: null }), Ae2 = w(null), We2 = w(Pe2), { top: Ve2, left: Ue2, verticalScrollDirection: He2, horizontalScrollDirection: Ke2 } = Pe2, Ne2 = w(false), qe2 = V({ rowCount: a2, columnCount: d2, defaultRowHeight: u2, defaultColumnWidth: h2, getRowHeight: f2, getColumnWidth: b2 }), je2 = w(null), Xe2 = y(() => {
1316
1316
  const e2 = C2 || qe2;
1317
1317
  return je2.current = null, { getColOffset: (t2) => e2.getColOffset(t2) * ce2, getColIndex: (t2) => e2.getColIndex(t2 / ce2), getRowOffset: (t2) => e2.getRowOffset(t2) * ce2, getRowIndex: (t2) => e2.getRowIndex(t2 / ce2) };
1318
1318
  }, [qe2, C2, ce2]), Ye2 = (e2, t2, n2) => {
@@ -1423,7 +1423,7 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1423
1423
  const t2 = e2?.left ?? e2?.[0], n2 = e2?.top ?? e2?.[1], o2 = void 0 !== t2 ? Math.min(dt - Qe, Math.max(lt?.[1]?.scrollOffset ?? 0, t2)) : We2.current.left, r3 = void 0 !== n2 ? Math.min(ut - et, Math.max(rt?.[1]?.scrollOffset ?? 0, n2)) : We2.current.top;
1424
1424
  if (We2.current.left === o2 && We2.current.top === r3) return;
1425
1425
  let l3 = null, i2 = null;
1426
- We2.current.left > o2 ? l3 = T.Left : We2.current.left < o2 && (l3 = T.Right), We2.current.top > r3 ? i2 = T.Up : We2.current.top < r3 && (i2 = T.Down), P.throttle(() => {
1426
+ We2.current.left > o2 ? l3 = D.Left : We2.current.left < o2 && (l3 = D.Right), We2.current.top > r3 ? i2 = D.Up : We2.current.top < r3 && (i2 = D.Down), P.throttle(() => {
1427
1427
  $e2((e3) => {
1428
1428
  const t3 = { ...e3, left: o2, top: r3, horizontalScrollDirection: l3, verticalScrollDirection: i2 };
1429
1429
  return We2.current = t3, t3;
@@ -1499,14 +1499,14 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1499
1499
  const i2 = t3.getBounds();
1500
1500
  return e("div", { style: { position: "absolute", left: "0px", top: "0px", width: `${i2.width}px`, height: `${i2.height}px`, overflow: "hidden" }, children: l3 }, `overlay-${t3.getAnchor()}-${o2}`);
1501
1501
  })(t2, 0));
1502
- }, Dt = y(() => {
1502
+ }, Tt = y(() => {
1503
1503
  const e2 = {}, t2 = Object.keys(st), n2 = t2.length;
1504
1504
  for (let o2 = 0; o2 < n2; o2++) {
1505
1505
  const n3 = t2[o2], r3 = [];
1506
1506
  Pt(st[n3], r3), e2[n3] = { overlays: r3 };
1507
1507
  }
1508
1508
  return e2;
1509
- }, [Me2, X2, a2, d2, rt, lt]), Tt = (t2, n2, o2, r3, l3, c3, s3) => {
1509
+ }, [Me2, X2, a2, d2, rt, lt]), Dt = (t2, n2, o2, r3, l3, c3, s3) => {
1510
1510
  if (!t2) return;
1511
1511
  const a3 = t2.getVisibleColumns(), d3 = t2.getVisibleRows();
1512
1512
  if (0 === a3.length || 0 === d3.length) return;
@@ -1575,7 +1575,7 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1575
1575
  const e2 = je2.current, t2 = /* @__PURE__ */ new Map(), n2 = {}, o2 = Object.keys(st), r3 = o2.length;
1576
1576
  for (let l3 = 0; l3 < r3; l3++) {
1577
1577
  const r4 = o2[l3], i2 = [], c3 = [], s3 = [];
1578
- Tt(st[r4], s3, i2, c3, /* @__PURE__ */ new Set(), e2, t2), n2[r4] = { cells: s3, rangesH: i2, rangesV: c3 };
1578
+ Dt(st[r4], s3, i2, c3, /* @__PURE__ */ new Set(), e2, t2), n2[r4] = { cells: s3, rangesH: i2, rangesV: c3 };
1579
1579
  }
1580
1580
  return je2.current = t2, n2;
1581
1581
  }, [Me2, a2, d2, rt, lt, z2, pe2, F2, oe2, re2, fe2]), zt = (t2, n2, o2, r3, l3) => {
@@ -1664,7 +1664,7 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1664
1664
  }, n2 = (n3, o3, r4) => {
1665
1665
  if (!r4) return;
1666
1666
  const l3 = r4.getBounds(), i3 = r4.getInsets(), c4 = r4.getAnchor();
1667
- return t("div", { className: M("view", `view-${c4}`, De.view), style: { position: "absolute", pointerEvents: "none", left: l3.x - i3.left, top: l3.y - i3.top, width: l3.width - (i3.left + i3.right), height: l3.height - (i3.top + i3.bottom), clipPath: _2 ? "inset(-2px)" : "inset(0px)" }, children: [e2(n3, o3, r4, G2), Dt?.[c4].overlays] }, `view:${c4}`);
1667
+ return t("div", { className: M("view", `view-${c4}`, Te.view), style: { position: "absolute", pointerEvents: "none", left: l3.x - i3.left, top: l3.y - i3.top, width: l3.width - (i3.left + i3.right), height: l3.height - (i3.top + i3.bottom), clipPath: _2 ? "inset(-2px)" : "inset(0px)" }, children: [e2(n3, o3, r4, G2), Tt?.[c4].overlays] }, `view:${c4}`);
1668
1668
  }, o2 = it.current, r3 = {}, i2 = [], c3 = Object.keys(st), s3 = c3.length;
1669
1669
  for (let e3 = 0; e3 < s3; e3++) {
1670
1670
  const t2 = c3[e3], l3 = o2?.[t2], s4 = r3[t2] = /* @__PURE__ */ new Map();
@@ -1677,7 +1677,7 @@ const be = -10, Ce = Object.freeze({ rowStart: 0, colStart: 0, rowEnd: 0, colEnd
1677
1677
  }, [Qe, et, Wt, J2, Q2]), Ht = w(false);
1678
1678
  return m(() => {
1679
1679
  !Ht.current && Ot && (Ht.current = true, Ce2?.(Mt.current));
1680
- }, [Ot]), t("div", { className: M("sheetxl-grid", De["sheetxl-grid"]), style: { overflow: "visible", cursor: A2, maxWidth: Qe, maxHeight: et, width: Qe, height: et, ...pe2 }, ref: Mt, children: [Ut, t("div", { className: M("sheetxl-overlays"), ref: Ee2, ...Z2, children: [Vt, Ft, At] })] });
1680
+ }, [Ot]), t("div", { className: M("sheetxl-grid", Te["sheetxl-grid"]), style: { overflow: "visible", cursor: A2, maxWidth: Qe, maxHeight: et, width: Qe, height: et, ...pe2 }, ref: Mt, children: [Ut, t("div", { className: M("sheetxl-overlays"), ref: Ee2, ...Z2, children: [Vt, Ft, At] })] });
1681
1681
  }));
1682
1682
  Ae.displayName = "BaseGrid";
1683
1683
  const We = b(C((t2, n2) => {
@@ -1695,13 +1695,13 @@ const Ve = b(C((t2, n2) => {
1695
1695
  }));
1696
1696
  Ve.displayName = "ScrollableGrid";
1697
1697
  const Ue = () => false, He = b((t2) => {
1698
- const { index: n2, value: o2, zoom: r2, zoomScale: l2 = 100, headerText: c2 = (e2) => `${e2}`, headerStyle: s2, headerStyleSelect: a2 = s2, headerStyleSelectAll: d2 = a2, headerStyleHover: u2 = d2, verticalPadding: h2 = 0, horizontalPadding: g2 = 0, isSelected: f2 = Ue, isSelectedAll: x2 = Ue, coords: m2, bounds: v2, range: S2, orientation: y2, view: b2, style: C2, ...I2 } = t2, E2 = l2 / 100, R2 = w(null), [M2, k2] = p(false), T2 = f2?.(n2) || false, O2 = x2?.(n2) || false ? d2 : T2 ? a2 : s2;
1698
+ const { index: n2, value: o2, zoom: r2, zoomScale: l2 = 100, headerText: c2 = (e2) => `${e2}`, headerStyle: s2, headerStyleSelect: a2 = s2, headerStyleSelectAll: d2 = a2, headerStyleHover: u2 = d2, verticalPadding: h2 = 0, horizontalPadding: g2 = 0, isSelected: f2 = Ue, isSelectedAll: x2 = Ue, coords: m2, bounds: v2, range: S2, orientation: y2, view: b2, style: C2, ...I2 } = t2, E2 = l2 / 100, R2 = w(null), [M2, k2] = p(false), D2 = f2?.(n2) || false, O2 = x2?.(n2) || false ? d2 : D2 ? a2 : s2;
1699
1699
  let z2 = O2;
1700
1700
  if (M2) {
1701
1701
  let e2 = u2;
1702
1702
  "function" == typeof u2 && (e2 = u2(O2)), z2 = P.mergeContentful(O2, e2);
1703
1703
  }
1704
- return e("div", { ref: R2, style: { background: z2.fill, color: z2.text?.fill, fontFamily: z2.text?.fontFamily ?? s2.text?.fontFamily, fontSize: 96 * (z2.text?.fontSize ?? 11) / 72 * E2, fontStyle: z2.text?.fontStyle, fontWeight: z2.text?.fontWeight, lineHeight: 1.2, display: "flex", justifyContent: "center", alignItems: "end", pointerEvents: "auto", paddingBottom: `${E2}px`, ...C2, left: C2.left - (y2 === D.Column ? 1 : 0), top: C2.top - (y2 === D.Row ? 1 : 0), width: C2.width + 1, height: C2.height + 1, overflow: "hidden" }, ...I2, onMouseMove: (e2) => {
1704
+ return e("div", { ref: R2, style: { background: z2.fill, color: z2.text?.fill, fontFamily: z2.text?.fontFamily ?? s2.text?.fontFamily, fontSize: 96 * (z2.text?.fontSize ?? 11) / 72 * E2, fontStyle: z2.text?.fontStyle, fontWeight: z2.text?.fontWeight, lineHeight: 1.2, display: "flex", justifyContent: "center", alignItems: "end", pointerEvents: "auto", paddingBottom: `${E2}px`, ...C2, left: C2.left - (y2 === T.Column ? 1 : 0), top: C2.top - (y2 === T.Row ? 1 : 0), width: C2.width + 1, height: C2.height + 1, overflow: "hidden" }, ...I2, onMouseMove: (e2) => {
1705
1705
  "touch" !== i.detectIt().primaryInput && 0 === e2.buttons && k2(true);
1706
1706
  }, onMouseOut: (e2) => {
1707
1707
  k2(false);
@@ -1709,18 +1709,18 @@ const Ue = () => false, He = b((t2) => {
1709
1709
  });
1710
1710
  He.displayName = "HeaderRenderer";
1711
1711
  const Ke = "ew-resize", Ne = "ns-resize", qe = b(C((n2, o2) => {
1712
- const { orientation: r2, view: l2, index: c2, className: s2, style: a2, disabled: d2 = false, disabledResize: u2 = false, isNextHidden: h2, isHidden: g2, isSelected: f2, isSelectedAll: w2, showTouchDivider: x2, headerStyle: p2, headerStyleSelect: m2, headerStyleSelectAll: v2, headerStyleHover: S2, bounds: y2, onPointerDown: b2, onAutoFit: C2, ...I2 } = n2, E2 = r2 === D.Column;
1712
+ const { orientation: r2, view: l2, index: c2, className: s2, style: a2, disabled: d2 = false, disabledResize: u2 = false, isNextHidden: h2, isHidden: g2, isSelected: f2, isSelectedAll: w2, showTouchDivider: x2, headerStyle: p2, headerStyleSelect: m2, headerStyleSelectAll: v2, headerStyleHover: S2, bounds: y2, onPointerDown: b2, onAutoFit: C2, ...I2 } = n2, E2 = r2 === T.Column;
1713
1713
  let R2 = p2;
1714
1714
  f2 && m2 && (R2 = m2), w2 && v2 && (R2 = v2);
1715
1715
  const k2 = "touch" === i.detectIt().primaryInput;
1716
- let P2 = E2 ? 14 : 8, T2 = P2 / 2, O2 = 0;
1717
- h2 && (O2 = -2), g2 && (O2 = 2), g2 && (P2 = P2 / 2 + O2, T2 = 2 * O2);
1716
+ let P2 = E2 ? 14 : 8, D2 = P2 / 2, O2 = 0;
1717
+ h2 && (O2 = -2), g2 && (O2 = 2), g2 && (P2 = P2 / 2 + O2, D2 = 2 * O2);
1718
1718
  let z2 = R2.dividerStrokeFill ?? R2.strokeFill;
1719
- return !(f2 || w2) && 0 === O2 && (z2 = `linear-gradient(${E2 ? 180 : 90}deg, ${R2.fill}, ${z2} 55%, ${z2} 100%)`), t("div", { className: M("header-divider", { disabled: d2 }, s2, `index-${c2}`), ref: o2, onPointerDown: k2 ? void 0 : b2, onDoubleClick: k2 ? void 0 : () => C2?.(), style: { top: (E2 ? 0 : -P2 / 2 + (O2 - 1)) + "px", left: (E2 ? -P2 / 2 + (O2 - 1) : 0) + "px", width: E2 ? P2 : "calc(100% + 1px)", height: E2 ? "calc(100% + 1px)" : P2, position: "absolute", overflow: "visible", pointerEvents: "all", cursor: d2 || u2 || k2 ? void 0 : E2 ? Ke : Ne, ...a2 }, ...I2, children: [e("div", { style: { position: "relative", top: `${E2 ? 0 : T2}px`, left: `${E2 ? T2 : 0}px`, width: E2 ? 1 : "100%", height: E2 ? "100%" : 1, background: z2 }, onDoubleClick: () => C2?.() }), x2 && k2 ? e("div", { style: { position: "absolute", cursor: "grab", zIndex: 1, borderRadius: "4px", right: E2 ? "-6px" : "2px", bottom: E2 ? "2px" : "-9px", height: "24px", width: E2 ? "24px" : "18px", maxHeight: E2 ? "calc(100% - 4px)" : void 0, maxWidth: E2 ? void 0 : "calc(100% - 4px)", background: R2.fill, border: `${v2.edgeStrokeFill} solid 1px`, boxShadow: `0.5px 0.5px 0px 0px ${p2.text.fill}`, display: "flex", alignItems: "center", justifyContent: "center" }, onPointerDown: b2, children: e("div", { style: { width: "6.4px", height: "12px", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${encodeURIComponent(m2.text.fill)}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center", transform: E2 ? void 0 : "rotate(90deg)" } }) }) : null] });
1719
+ return !(f2 || w2) && 0 === O2 && (z2 = `linear-gradient(${E2 ? 180 : 90}deg, ${R2.fill}, ${z2} 55%, ${z2} 100%)`), t("div", { className: M("header-divider", { disabled: d2 }, s2, `index-${c2}`), ref: o2, onPointerDown: k2 ? void 0 : b2, onDoubleClick: k2 ? void 0 : () => C2?.(), style: { top: (E2 ? 0 : -P2 / 2 + (O2 - 1)) + "px", left: (E2 ? -P2 / 2 + (O2 - 1) : 0) + "px", width: E2 ? P2 : "calc(100% + 1px)", height: E2 ? "calc(100% + 1px)" : P2, position: "absolute", overflow: "visible", pointerEvents: "all", cursor: d2 || u2 || k2 ? void 0 : E2 ? Ke : Ne, ...a2 }, ...I2, children: [e("div", { style: { position: "relative", top: `${E2 ? 0 : D2}px`, left: `${E2 ? D2 : 0}px`, width: E2 ? 1 : "100%", height: E2 ? "100%" : 1, background: z2 }, onDoubleClick: () => C2?.() }), x2 && k2 ? e("div", { style: { position: "absolute", cursor: "grab", zIndex: 1, borderRadius: "4px", right: E2 ? "-6px" : "2px", bottom: E2 ? "2px" : "-9px", height: "24px", width: E2 ? "24px" : "18px", maxHeight: E2 ? "calc(100% - 4px)" : void 0, maxWidth: E2 ? void 0 : "calc(100% - 4px)", background: R2.fill, border: `${v2.edgeStrokeFill} solid 1px`, boxShadow: `0.5px 0.5px 0px 0px ${p2.text.fill}`, display: "flex", alignItems: "center", justifyContent: "center" }, onPointerDown: b2, children: e("div", { style: { width: "6.4px", height: "12px", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${encodeURIComponent(m2.text.fill)}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center", transform: E2 ? void 0 : "rotate(90deg)" } }) }) : null] });
1720
1720
  })), je = (t2, n2) => e(qe, { ...t2, ref: n2 }), Xe = b(C((r2, l2) => {
1721
- const { orientation: i2, view: c2, index: a2, disabled: u2 = false, disabledResize: h2 = false, resizeThreshold: g2 = 1, dividerRenderer: f2 = je, onDividerMouseDown: x2, onDividerResizeStart: m2, onDividerResize: v2, onDividerResizeEnd: S2, onDividerMouseUp: y2, onDividerAutoFit: b2, onPointerDown: C2, ...I2 } = r2, E2 = o(C2, [C2]), R2 = o(b2, [b2]), k2 = i2 === D.Column;
1722
- let P2 = k2 ? c2.getVisibleColumns() : c2.getVisibleRows(), T2 = null;
1723
- P2.length > 0 && (k2 ? T2 = c2.getRangeCoordsBounds({ rowStart: 0, rowEnd: 0, colStart: P2[0], colEnd: P2[P2.length - 1] }) : c2.getRangeCoordsBounds({ rowStart: P2[0], rowEnd: P2[P2.length - 1], colStart: 0, colEnd: 0 }), T2 = c2.toClipBounds(T2, be));
1721
+ const { orientation: i2, view: c2, index: a2, disabled: u2 = false, disabledResize: h2 = false, resizeThreshold: g2 = 1, dividerRenderer: f2 = je, onDividerMouseDown: x2, onDividerResizeStart: m2, onDividerResize: v2, onDividerResizeEnd: S2, onDividerMouseUp: y2, onDividerAutoFit: b2, onPointerDown: C2, ...I2 } = r2, E2 = o(C2, [C2]), R2 = o(b2, [b2]), k2 = i2 === T.Column;
1722
+ let P2 = k2 ? c2.getVisibleColumns() : c2.getVisibleRows(), D2 = null;
1723
+ P2.length > 0 && (k2 ? D2 = c2.getRangeCoordsBounds({ rowStart: 0, rowEnd: 0, colStart: P2[0], colEnd: P2[P2.length - 1] }) : c2.getRangeCoordsBounds({ rowStart: P2[0], rowEnd: P2[P2.length - 1], colStart: 0, colEnd: 0 }), D2 = c2.toClipBounds(D2, be));
1724
1724
  const O2 = w(null), [z2, $2] = p(null), B2 = (e2, t2) => k2 ? e2.clientX - t2.clientX : e2.clientY - t2.clientY, F2 = c2.getLayout(), A2 = k2 ? F2.getColOffset(a2 + 1) : F2.getRowOffset(a2 + 1), W2 = s({ processTouch: true, onPointerDown: (e2) => {
1725
1725
  if (E2?.(e2), !u2 && !h2) {
1726
1726
  const e3 = k2 ? F2.getColOffset(a2) : F2.getRowOffset(a2), t2 = A2 - e3;
@@ -1739,12 +1739,12 @@ const Ke = "ew-resize", Ne = "ns-resize", qe = b(C((n2, o2) => {
1739
1739
  } }), V2 = o(() => {
1740
1740
  R2?.(a2);
1741
1741
  }, [a2]);
1742
- if (!T2) return;
1743
- const U2 = f2({ bounds: T2, orientation: i2, view: c2, index: a2, disabled: u2, disabledResize: h2, onAutoFit: V2, onPointerDown: W2, ...I2 }, l2);
1742
+ if (!D2) return;
1743
+ const U2 = f2({ bounds: D2, orientation: i2, view: c2, index: a2, disabled: u2, disabledResize: h2, onAutoFit: V2, onPointerDown: W2, ...I2 }, l2);
1744
1744
  if (!U2) return;
1745
1745
  const { getPortalContainer: H2 } = d();
1746
1746
  let K2 = null;
1747
- return z2 && z2.isResizing && z2.index === a2 && (K2 = L(e("div", { style: { position: "absolute", cursor: k2 ? Ke : Ne, left: 0, top: 0, width: "100%", height: "100%" } }), H2(), "divider:" + a2)), t(n, { children: [K2, e("div", { className: M("header-divider-anchor"), style: { position: "absolute", pointerEvents: "auto", top: `${k2 ? T2.y : A2}px`, left: `${k2 ? A2 : T2.x}px`, width: (k2 ? 0 : T2.width - 1) + "px", height: (k2 ? T2.height - 1 : 0) + "px", display: "flex" }, tabIndex: -1, children: U2 })] });
1747
+ return z2 && z2.isResizing && z2.index === a2 && (K2 = L(e("div", { style: { position: "absolute", cursor: k2 ? Ke : Ne, left: 0, top: 0, width: "100%", height: "100%" } }), H2(), "divider:" + a2)), t(n, { children: [K2, e("div", { className: M("header-divider-anchor"), style: { position: "absolute", pointerEvents: "auto", top: `${k2 ? D2.y : A2}px`, left: `${k2 ? A2 : D2.x}px`, width: (k2 ? 0 : D2.width - 1) + "px", height: (k2 ? D2.height - 1 : 0) + "px", display: "flex" }, tabIndex: -1, children: U2 })] });
1748
1748
  }));
1749
1749
  class Ye {
1750
1750
  naturalDimensions(e2, t2 = {}) {
@@ -1764,11 +1764,11 @@ class Ye {
1764
1764
  }
1765
1765
  }
1766
1766
  const Ge = (e2 = void 0) => Object.freeze({ clean: e2, dirty: void 0, editMode: false }), Ze = Ge(), _e = b(C((t2, n2) => {
1767
- const { editState: r2 = Ze, defaultTextStyle: i2, onStartEdit: c2, onChangeEdit: s2, onSubmitEdit: a2, onCancelEdit: d2, onDoneEdit: u2, containerBounds: h2, setNaturalDimensions: f2, onNavigate: x2, textProperties: b2, style: C2, autoFocus: I2, ...E2 } = t2, R2 = w(null), { width: M2 = 0 } = h2 ?? {}, [k2, P2] = p(() => r2);
1767
+ const { editState: r2 = Ze, defaultTextStyle: i2, onStartEdit: c2, onChangeEdit: s2, onSubmitEdit: a2, onCancelEdit: d2, onDoneEdit: u2, containerBounds: h2, setNaturalSize: f2, onNavigate: x2, textProperties: b2, style: C2, autoFocus: I2, ...E2 } = t2, R2 = w(null), { width: M2 = 0 } = h2 ?? {}, [k2, P2] = p(() => r2);
1768
1768
  m(() => {
1769
1769
  P2(r2);
1770
1770
  }, [r2]);
1771
- const D2 = b2?.align || "left", O2 = b2?.vAlign || "middle", z2 = b2?.fill || "#040404", L2 = b2?.wrap || "wrap", $2 = b2?.fontFamily || "Calibri", B2 = b2?.fontSize || 11, F2 = b2?.fontWeight || 400, A2 = b2?.fontStyle || "normal", W2 = k2.dirty ?? k2.clean ?? "";
1771
+ const T2 = b2?.align || "left", O2 = b2?.vAlign || "middle", z2 = b2?.fill || "#040404", L2 = b2?.wrap || "wrap", $2 = b2?.fontFamily || "Calibri", B2 = b2?.fontSize || 11, F2 = b2?.fontWeight || 400, A2 = b2?.fontStyle || "normal", W2 = k2.dirty ?? k2.clean ?? "";
1772
1772
  let V2 = 2;
1773
1773
  const H2 = 96 * B2 / 72, K2 = 1.2 * H2;
1774
1774
  "right" === O2 && (V2 += 1);
@@ -1803,21 +1803,21 @@ const Ge = (e2 = void 0) => Object.freeze({ clean: e2, dirty: void 0, editMode:
1803
1803
  const t3 = e2.nativeEvent.shiftKey;
1804
1804
  if (e2.which === l.Escape) return e2.preventDefault(), void J2();
1805
1805
  if (e2.which === l.F2) return Z2(true), void e2.preventDefault();
1806
- if (e2.which === l.Enter && (e2.preventDefault(), _2() && x2?.(t3 ? T.Up : T.Down)), e2.which === l.Tab) return e2.preventDefault(), void (_2() && x2?.(t3 ? T.Left : T.Right));
1806
+ if (e2.which === l.Enter && (e2.preventDefault(), _2() && x2?.(t3 ? D.Up : D.Down)), e2.which === l.Tab) return e2.preventDefault(), void (_2() && x2?.(t3 ? D.Left : D.Right));
1807
1807
  if (!k2.editMode) {
1808
1808
  let t4 = null;
1809
1809
  switch (e2.which) {
1810
1810
  case l.Left:
1811
- t4 = T.Left;
1811
+ t4 = D.Left;
1812
1812
  break;
1813
1813
  case l.Right:
1814
- t4 = T.Right;
1814
+ t4 = D.Right;
1815
1815
  break;
1816
1816
  case l.Up:
1817
- t4 = T.Up;
1817
+ t4 = D.Up;
1818
1818
  break;
1819
1819
  case l.Down:
1820
- t4 = T.Down;
1820
+ t4 = D.Down;
1821
1821
  }
1822
1822
  if (t4) return void _2();
1823
1823
  }
@@ -1839,7 +1839,7 @@ const Ge = (e2 = void 0) => Object.freeze({ clean: e2, dirty: void 0, editMode:
1839
1839
  }, autoFocus() {
1840
1840
  R2.current?.focus();
1841
1841
  }, getLineHeight: () => N2?.maxLineHeight ?? K2, dispatchEvent: (e2) => R2.current.dispatchEvent(e2) }), [r2, c2]);
1842
- return e("div", { ref: ne2, ...E2, style: { background: "transparent", display: "flex", flexGrow: 1, alignSelf: "center", height: N2.height, maxWidth: "100%", maxHeight: "100%", ...C2 }, children: e("textarea", { spellCheck: "false", ref: R2, value: W2, autoFocus: false, disabled: ee2, name: "cell-editor", autoComplete: "off", autoCapitalize: "off", style: { flex: "1 1 100%", position: "relative", fontSize: `${H2}px`, fontFamily: `${$2}`, fontWeight: `${F2}`, fontStyle: `${A2}`, padding: "0px", marginRight: "right" === D2 ? "3px" : "0px", marginLeft: "left" === D2 ? "2px" : "0px", lineHeight: j2, height: N2.height, textRendering: "geometricPrecision", letterSpacing: "-0.25px", boxSizing: "border-box", borderWidth: 0, outline: "none", resize: "none", overflow: "hidden", verticalAlign: "baseline", textAlign: D2, background: "transparent", color: z2, marginBottom: "0px", userSelect: "text", maxHeight: "100%", whiteSpace: "wrap" === L2 ? "break-spaces" : "pre", wordWrap: "break-word" }, onChange: (e2) => {
1842
+ return e("div", { ref: ne2, ...E2, style: { background: "transparent", display: "flex", flexGrow: 1, alignSelf: "center", height: N2.height, maxWidth: "100%", maxHeight: "100%", ...C2 }, children: e("textarea", { spellCheck: "false", ref: R2, value: W2, autoFocus: false, disabled: ee2, name: "cell-editor", autoComplete: "off", autoCapitalize: "off", style: { flex: "1 1 100%", position: "relative", fontSize: `${H2}px`, fontFamily: `${$2}`, fontWeight: `${F2}`, fontStyle: `${A2}`, padding: "0px", marginRight: "right" === T2 ? "3px" : "0px", marginLeft: "left" === T2 ? "2px" : "0px", lineHeight: j2, height: N2.height, textRendering: "geometricPrecision", letterSpacing: "-0.25px", boxSizing: "border-box", borderWidth: 0, outline: "none", resize: "none", overflow: "hidden", verticalAlign: "baseline", textAlign: T2, background: "transparent", color: z2, marginBottom: "0px", userSelect: "text", maxHeight: "100%", whiteSpace: "wrap" === L2 ? "break-spaces" : "pre", wordWrap: "break-word" }, onChange: (e2) => {
1843
1843
  G2(e2.target.value);
1844
1844
  }, onDoubleClick: (e2) => {
1845
1845
  e2.isTrusted;