@sheetxl/grid-react 0.8.0-beta.6 → 0.8.0-beta.9

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,12 +1,12 @@
1
1
  /**
2
- * @license @sheetxl/grid-react - Grid React - Advanced grid component for React - v0.8.0-beta.6
2
+ * @license @sheetxl/grid-react - Grid React - Advanced grid component for React - v0.8.0-beta.9
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
7
  import e, { cloneElement as t, createContext as n, createElement as o, forwardRef as r, isValidElement as l, memo as i, useCallback as s, useContext as a, useEffect as c, useId as d, useLayoutEffect as u, useMemo as g, useReducer as h, useRef as f, useState as p, useSyncExternalStore as m } from "react";
8
8
  import { Fragment as w, jsx as x, jsxs as v } from "react/jsx-runtime";
9
- import { FloatPanelSurface as y, KeyCodes as b, KeyModifiers as S, ReactUtils as E, SERIES_COUNT as I, ScrollPane as C, THEME_MODE_ATTR as R, THEME_SURFACE_ATTR as M, Viewport as P, buildThemeCSS as k, defaultTheme as D, themeVars as T, useBoundSyncExternalStore as $, useCallbackRef as z, useFloatSurface as O, useFullscreenPortal as L, useImperativeElement as N, useOptionalBoundSyncExternalStore as B, useSynchronizedPointerHandler as F, useTokenThemeContext as A } from "@sheetxl/utils-react";
9
+ import { FloatPanelSurface as y, KeyCodes as b, KeyModifiers as S, ReactUtils as E, SERIES_COUNT as I, ScrollPane as C, THEME_MODE_ATTR as R, THEME_SURFACE_ATTR as M, Viewport as P, buildThemeCSS as k, defaultTheme as D, themeVars as T, useBoundSyncExternalStore as O, useCallbackRef as $, useFloatSurface as z, useFullscreenPortal as L, useImperativeElement as N, useOptionalBoundSyncExternalStore as F, useSynchronizedPointerHandler as B, useTokenThemeContext as A } from "@sheetxl/utils-react";
10
10
  import V from "tiny-invariant";
11
11
  import H, { clsx as K } from "clsx";
12
12
  import { AnchorLocation as _, CommonUtils as W, CoordUtils as U, DOMUtils as j, Direction as G, RangeAxis as X, SelectionTraversalUtils as Y } from "@sheetxl/utils";
@@ -102,7 +102,7 @@ var re = (e, t) => {
102
102
  d && he();
103
103
  }, [d]), !I) return null;
104
104
  const C = E.getDevicePixelRatio(), R = l ? r : r / C;
105
- let M, P, k, D, T, $, z;
105
+ let M, P, k, D, T, O, $;
106
106
  if (l) M = I.x, P = I.y, k = I.x + I.width, D = I.y + I.height;
107
107
  else {
108
108
  const e = (e) => i ? E.snapLineCenter(e, R, C) : E.edgeCenter(e, "leading", r, C), t = (e) => i ? E.snapLineCenter(e, R, C) : E.edgeCenter(e, "trailing", r, C), n = s / C;
@@ -126,14 +126,14 @@ var re = (e, t) => {
126
126
  gapColor: "var(--sxl-color-base-100, #fff)",
127
127
  ..."object" == typeof d ? d : void 0
128
128
  }, t = e.dashGap + e.dashLength;
129
- $ = {
129
+ O = {
130
130
  strokeDasharray: `${e.dashLength}px ${e.dashGap}px`,
131
131
  strokeDashoffset: `${t}px`,
132
132
  animation: `${ue} ${e.speed * t}ms linear infinite`,
133
133
  willChange: "stroke-dashoffset"
134
- }, z = e.gapColor;
134
+ }, $ = e.gapColor;
135
135
  }
136
- const O = u ? "d 60ms ease-in-out" : "none";
136
+ const z = u ? "d 60ms ease-in-out" : "none";
137
137
  let L = null;
138
138
  if (n) {
139
139
  let e = de({
@@ -150,7 +150,7 @@ var re = (e, t) => {
150
150
  })), L = x("path", {
151
151
  style: {
152
152
  d: `path("${e}")`,
153
- transition: O,
153
+ transition: z,
154
154
  fill: n,
155
155
  ...f?.style
156
156
  },
@@ -166,14 +166,14 @@ var re = (e, t) => {
166
166
  right: k,
167
167
  bottom: D
168
168
  });
169
- N = v(w, { children: [z && x("path", {
169
+ N = v(w, { children: [$ && x("path", {
170
170
  fill: "none",
171
171
  vectorEffect: "non-scaling-stroke",
172
172
  strokeWidth: R,
173
173
  style: {
174
174
  d: `path("${e}")`,
175
- transition: O,
176
- stroke: z
175
+ transition: z,
176
+ stroke: $
177
177
  }
178
178
  }, "stroke-under"), x("path", {
179
179
  fill: "none",
@@ -184,9 +184,9 @@ var re = (e, t) => {
184
184
  ...p,
185
185
  style: {
186
186
  d: `path("${e}")`,
187
- transition: O,
187
+ transition: z,
188
188
  stroke: o,
189
- ...$,
189
+ ...O,
190
190
  ...p?.style
191
191
  }
192
192
  }, "stroke")] });
@@ -376,41 +376,41 @@ var de = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
376
376
  for (let n = 0; n < Se.length; n++) e.removeEventListener(Se[n], t, !0);
377
377
  };
378
378
  }, [E]);
379
- const R = z((e) => {
379
+ const R = $((e) => {
380
380
  C("pointerdown", e, d.current);
381
- }, []), M = z((e) => {
381
+ }, []), M = $((e) => {
382
382
  C("pointermove", e, d.current);
383
- }, []), P = z((e) => {
383
+ }, []), P = $((e) => {
384
384
  C("pointerup", e, d.current);
385
- }, []), k = z((e) => {
385
+ }, []), k = $((e) => {
386
386
  C("pointerleave", e, d.current);
387
- }, []), D = z((e) => {
387
+ }, []), D = $((e) => {
388
388
  C("mousedown", e, d.current);
389
- }, []), T = z((e) => {
389
+ }, []), T = $((e) => {
390
390
  C("mouseenter", e, d.current);
391
- }, []), $ = z((e) => {
391
+ }, []), O = $((e) => {
392
392
  C("mouseleave", e, d.current);
393
- }, []), O = z((e) => {
393
+ }, []), z = $((e) => {
394
394
  C("mousemove", e, d.current);
395
- }, []), L = z((e) => {
395
+ }, []), L = $((e) => {
396
396
  C("mouseout", e, d.current);
397
- }, []), B = z((e) => {
397
+ }, []), F = $((e) => {
398
398
  C("mouseover", e, d.current);
399
- }, []), F = z((e) => {
399
+ }, []), B = $((e) => {
400
400
  C("mouseup", e, d.current);
401
- }, []), A = z((e) => {
401
+ }, []), A = $((e) => {
402
402
  C("dblclick", e, d.current);
403
- }, []), V = z((e) => {
403
+ }, []), V = $((e) => {
404
404
  C("keydown", e, d.current);
405
- }, []), K = z((e) => {
405
+ }, []), K = $((e) => {
406
406
  C("keypress", e, d.current);
407
- }, []), _ = z((e) => {
407
+ }, []), _ = $((e) => {
408
408
  C("keyup", e, d.current);
409
- }, []), W = z((e) => {
409
+ }, []), W = $((e) => {
410
410
  o?.(e), C("focus", e, d.current);
411
- }, [o]), U = z((e) => {
411
+ }, [o]), U = $((e) => {
412
412
  r?.(e), C("blur", e, d.current);
413
- }, [r]), j = z((e) => {
413
+ }, [r]), j = $((e) => {
414
414
  C("contextmenu", e, d.current);
415
415
  }, []), G = N(t, () => ({
416
416
  isStage: () => !0,
@@ -429,11 +429,11 @@ var de = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
429
429
  onPointerLeave: k,
430
430
  onMouseDown: D,
431
431
  onMouseEnter: T,
432
- onMouseLeave: $,
433
- onMouseMove: O,
432
+ onMouseLeave: O,
433
+ onMouseMove: z,
434
434
  onMouseOut: L,
435
- onMouseOver: B,
436
- onMouseUp: F,
435
+ onMouseOver: F,
436
+ onMouseUp: B,
437
437
  onDoubleClick: A,
438
438
  onKeyDown: V,
439
439
  onKeyUp: _,
@@ -543,7 +543,7 @@ var Re = Object.freeze([]), Me = (e, t) => {
543
543
  offset: n,
544
544
  size: t.getRowOffset(e + 1) - n
545
545
  };
546
- }, $ = (e, t) => {
546
+ }, O = (e, t) => {
547
547
  const n = new Array(e.length);
548
548
  for (let o = 0; o < e.length; o++) n[o] = t(e[o]);
549
549
  return n;
@@ -629,8 +629,8 @@ var Re = Object.freeze([]), Me = (e, t) => {
629
629
  },
630
630
  getMetrics: () => P().metrics,
631
631
  getRangeFromCell: d,
632
- getVisibleColumns: (e, t) => $(P().colDims.visibleIndices(e, t), D),
633
- getVisibleRows: (e, t) => $(P().rowDims.visibleIndices(e, t), T),
632
+ getVisibleColumns: (e, t) => O(P().colDims.visibleIndices(e, t), D),
633
+ getVisibleRows: (e, t) => O(P().rowDims.visibleIndices(e, t), T),
634
634
  getColumnSize: D,
635
635
  getRowSize: T,
636
636
  getTotalRange: () => g,
@@ -653,8 +653,8 @@ var Re = Object.freeze([]), Me = (e, t) => {
653
653
  const n = h(e, t);
654
654
  if (!n) return null;
655
655
  const o = m();
656
- for (let e = 0; e < $e.length; e++) {
657
- const t = o[$e[e]];
656
+ for (let e = 0; e < Oe.length; e++) {
657
+ const t = o[Oe[e]];
658
658
  if (t && xe(n.x, n.y, t.getPaneBounds())) return t;
659
659
  }
660
660
  return null;
@@ -680,12 +680,12 @@ var Re = Object.freeze([]), Me = (e, t) => {
680
680
  scrollTo: (e) => f(e),
681
681
  getAllPanes: m
682
682
  };
683
- }, $e = [
683
+ }, Oe = [
684
684
  _.TopLeft,
685
685
  _.Top,
686
686
  _.Left,
687
687
  _.Center
688
- ], ze = (e, t, n) => {
688
+ ], $e = (e, t, n) => {
689
689
  const o = (t?.left ?? 0) + (n?.x ?? 0), r = (t?.top ?? 0) + (n?.y ?? 0);
690
690
  return {
691
691
  getColOffset: (t) => e.getColOffset(t) - o,
@@ -693,7 +693,7 @@ var Re = Object.freeze([]), Me = (e, t) => {
693
693
  getRowOffset: (t) => e.getRowOffset(t) - r,
694
694
  getRowIndex: (t) => e.getRowIndex(t + r)
695
695
  };
696
- }, Oe = Object.freeze([{
696
+ }, ze = Object.freeze([{
697
697
  minIndex: 0,
698
698
  maxIndex: 0,
699
699
  minCoord: 0,
@@ -711,12 +711,12 @@ var Re = Object.freeze([]), Me = (e, t) => {
711
711
  scrollOffset: 0,
712
712
  freezeOffset: 0
713
713
  }]), Le = n(null), Ne = ({ pane: e, viewport: t, children: n }) => {
714
- const o = g(() => ({ pane: e }), [e, B(t, (e) => e.getSnapshot())]);
714
+ const o = g(() => ({ pane: e }), [e, F(t, (e) => e.getSnapshot())]);
715
715
  return x(Le.Provider, {
716
716
  value: o,
717
717
  children: n
718
718
  });
719
- }, Be = () => {
719
+ }, Fe = () => {
720
720
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
721
721
  return {
722
722
  has: (t) => e.has(t),
@@ -734,15 +734,15 @@ var Re = Object.freeze([]), Me = (e, t) => {
734
734
  };
735
735
  }
736
736
  };
737
- }, Fe = n(null), Ae = ({ store: e, children: t }) => {
738
- const n = a(Fe), o = f(null);
737
+ }, Be = n(null), Ae = ({ store: e, children: t }) => {
738
+ const n = a(Be), o = f(null);
739
739
  let r = e ?? n;
740
- return r || (o.current || (o.current = Be()), r = o.current), x(Fe.Provider, {
740
+ return r || (o.current || (o.current = Fe()), r = o.current), x(Be.Provider, {
741
741
  value: r,
742
742
  children: t
743
743
  });
744
744
  }, Ve = { "sheetxl-grid": "_sheetxl-grid_5yo0n_7" }, He = i(r((e, n) => {
745
- const { rowCount: r = 1, columnCount: i = 1, viewport: a, metrics: d, getRangeFromCell: u = U.cellToRange, hiddenRowsAt: m, hiddenColumnsAt: y, freezeLeft: b = 0, freezeTop: S = 0, propsFreezeLeft: E, propsFreezeTop: I, onFirstRender: C, children: R, wrapPane: M, onFocus: k, onBlur: D, className: T, style: $, ...O } = e, L = z(k, [k]), B = z(D, [D]), F = z(C, [C]), [A, K] = p(_.Center), [W, G] = h((e) => e + 1, 0), X = g(() => new P({}), []), Y = a ?? X, [q, Z] = p(() => {
745
+ const { rowCount: r = 1, columnCount: i = 1, viewport: a, metrics: d, getRangeFromCell: u = U.cellToRange, hiddenRowsAt: m, hiddenColumnsAt: y, freezeLeft: b = 0, freezeTop: S = 0, propsFreezeLeft: E, propsFreezeTop: I, onFirstRender: C, children: R, wrapPane: M, onFocus: k, onBlur: D, className: T, style: O, ...z } = e, L = $(k, [k]), F = $(D, [D]), B = $(C, [C]), [A, K] = p(_.Center), [W, G] = h((e) => e + 1, 0), X = g(() => new P({}), []), Y = a ?? X, [q, Z] = p(() => {
746
746
  const e = Y.getClient();
747
747
  return {
748
748
  zoom: Y.getZoom(),
@@ -771,7 +771,7 @@ var Re = Object.freeze([]), Me = (e, t) => {
771
771
  getRowOffset: (t) => e.getRowOffset(t) * J,
772
772
  getRowIndex: (t) => e.getRowIndex(t / J)
773
773
  };
774
- }, [d, J]), ee = z((e, t = !1) => we(e, t, Q.getRowOffset, t ? 0 : r), [r, Q?.getRowOffset]), te = z(m ?? ee, [m]), ne = z((e, t = !1) => we(e, t, Q.getColOffset, t ? i : 0), [i, Q?.getColOffset]), oe = z(y ?? ne, [y]), re = s(() => {
774
+ }, [d, J]), ee = $((e, t = !1) => we(e, t, Q.getRowOffset, t ? 0 : r), [r, Q?.getRowOffset]), te = $(m ?? ee, [m]), ne = $((e, t = !1) => we(e, t, Q.getColOffset, t ? i : 0), [i, Q?.getColOffset]), oe = $(y ?? ne, [y]), re = s(() => {
775
775
  G();
776
776
  }, []), le = g(() => Math.min(q.w, Q.getColOffset(i)), [
777
777
  W,
@@ -786,13 +786,13 @@ var Re = Object.freeze([]), Me = (e, t) => {
786
786
  ]), se = g(() => {
787
787
  let e = NaN, t = null;
788
788
  return (n) => (n === e && t || (e = n, t = ((e) => {
789
- if (0 === ie) return Oe;
789
+ if (0 === ie) return ze;
790
790
  const t = [];
791
791
  let n = 0, o = 0;
792
792
  "number" == typeof S ? n = S : (n = S.index ?? 0, o = (S.offset ?? 0) * J);
793
793
  const l = o, i = Q.getRowOffset(n), s = i - l;
794
794
  if (n > 0) {
795
- const e = ze(Q, { top: o + Q.getRowOffset(0) }), r = Q.getRowIndex(l), a = Q.getRowIndex(i - 1);
795
+ const e = $e(Q, { top: o + Q.getRowOffset(0) }), r = Q.getRowIndex(l), a = Q.getRowIndex(i - 1);
796
796
  let c;
797
797
  t[1] = {
798
798
  minIndex: r,
@@ -808,7 +808,7 @@ var Re = Object.freeze([]), Me = (e, t) => {
808
808
  freezeOffset: o
809
809
  };
810
810
  }
811
- const a = Math.max(0, ie - s), c = ze(Q, { top: e + s }), d = c.getRowIndex(0), u = c.getRowIndex(a - 1);
811
+ const a = Math.max(0, ie - s), c = $e(Q, { top: e + s }), d = c.getRowIndex(0), u = c.getRowIndex(a - 1);
812
812
  let g;
813
813
  return t[0] = {
814
814
  minIndex: d,
@@ -836,13 +836,13 @@ var Re = Object.freeze([]), Me = (e, t) => {
836
836
  ]), ce = g(() => se(0), [se]), de = g(() => {
837
837
  let e = NaN, t = null;
838
838
  return (n) => (n === e && t || (e = n, t = ((e) => {
839
- if (0 === le) return Oe;
839
+ if (0 === le) return ze;
840
840
  const t = [];
841
841
  let n = 0, o = 0;
842
842
  "number" == typeof b ? n = b : (n = b.index ?? 0, o = (b.offset ?? 0) * J);
843
843
  const r = o, l = Q.getColOffset(n), s = l - r;
844
844
  if (n > 0) {
845
- const e = ze(Q, { left: o + Q.getColOffset(0) }), i = Q.getColIndex(r), a = Q.getColIndex(l - 1);
845
+ const e = $e(Q, { left: o + Q.getColOffset(0) }), i = Q.getColIndex(r), a = Q.getColIndex(l - 1);
846
846
  let c;
847
847
  t[1] = {
848
848
  minIndex: i,
@@ -858,7 +858,7 @@ var Re = Object.freeze([]), Me = (e, t) => {
858
858
  freezeOffset: o
859
859
  };
860
860
  }
861
- const a = Math.max(0, le - s), c = ze(Q, { left: e + s }), d = c.getColIndex(0), u = c.getColIndex(a - 1);
861
+ const a = Math.max(0, le - s), c = $e(Q, { left: e + s }), d = c.getColIndex(0), u = c.getColIndex(a - 1);
862
862
  let g;
863
863
  return t[0] = {
864
864
  minIndex: d,
@@ -912,7 +912,7 @@ var Re = Object.freeze([]), Me = (e, t) => {
912
912
  K(o), L(e);
913
913
  },
914
914
  onBlur: (e) => {
915
- B(e);
915
+ F(e);
916
916
  }
917
917
  }), e.push(i);
918
918
  };
@@ -936,7 +936,7 @@ var Re = Object.freeze([]), Me = (e, t) => {
936
936
  getRangeFromCell: u,
937
937
  invalidate: re,
938
938
  totalRange: t,
939
- getSurfacePointFromPointer: (e, t) => $e(e, t),
939
+ getSurfacePointFromPointer: (e, t) => Oe(e, t),
940
940
  scrollTo: (e) => Qe(e),
941
941
  scrollCellCoordsIntoView: (e, t, n) => Je(e, t, n),
942
942
  getAllPanes: () => e
@@ -961,7 +961,7 @@ var Re = Object.freeze([]), Me = (e, t) => {
961
961
  left: e ? e.metrics.getColOffset(e.maxIndex + 1) : 0,
962
962
  top: t ? t.metrics.getRowOffset(t.maxIndex + 1) : 0
963
963
  };
964
- }, [ce, ue]), Pe = z((e) => {
964
+ }, [ce, ue]), Pe = $((e) => {
965
965
  j.canUseDOM && setTimeout(() => {
966
966
  (Se[A]?.getElement() ?? Se[_.Center]?.getElement())?.focus({
967
967
  preventScroll: !0,
@@ -976,7 +976,7 @@ var Re = Object.freeze([]), Me = (e, t) => {
976
976
  ge.current = [];
977
977
  }
978
978
  }, [Se]);
979
- const $e = s((e, t) => {
979
+ const Oe = s((e, t) => {
980
980
  V("number" == typeof e && "number" == typeof t, "Top and left should be a number.");
981
981
  const n = et.current?.getBoundingClientRect();
982
982
  return n ? {
@@ -986,9 +986,9 @@ var Re = Object.freeze([]), Me = (e, t) => {
986
986
  x: e,
987
987
  y: t
988
988
  };
989
- }, []), Le = z((e, t) => {
989
+ }, []), Le = $((e, t) => {
990
990
  if (1 === Object.keys(Se).length) return Se[_.Center];
991
- const n = $e(e, t);
991
+ const n = Oe(e, t);
992
992
  if (!n) return Se[_.Center];
993
993
  const { x: o, y: r } = n;
994
994
  let l = null;
@@ -1009,7 +1009,7 @@ var Re = Object.freeze([]), Me = (e, t) => {
1009
1009
  ue,
1010
1010
  ce
1011
1011
  ]);
1012
- const Be = z((e) => {
1012
+ const Fe = $((e) => {
1013
1013
  let t = e?.left ?? e?.[0], n = e?.top ?? e?.[1];
1014
1014
  if (void 0 === t && void 0 === n) return;
1015
1015
  const o = e?.behavior ?? "auto", r = Y.getTarget();
@@ -1018,12 +1018,12 @@ var Re = Object.freeze([]), Me = (e, t) => {
1018
1018
  top: n,
1019
1019
  behavior: o
1020
1020
  });
1021
- }, []), Fe = z((e) => void 0 !== e ? Se[e] ?? null : Se[A] ?? Se[_.Center] ?? null, [Se, A]), He = z((e) => {
1021
+ }, []), Be = $((e) => void 0 !== e ? Se[e] ?? null : Se[A] ?? Se[_.Center] ?? null, [Se, A]), He = $((e) => {
1022
1022
  const t = Se[A];
1023
1023
  if (!t) return Se[_.Center];
1024
1024
  const n = t.getScrollOrientation(), o = { ...t.getVisibleRange() };
1025
1025
  return n.vertical && (o.rowStart = ce[0].minCoord, o.rowEnd = ce[0].maxCoord), n.horizontal && (o.colStart = ue[0].minCoord, o.colEnd = ue[0].maxCoord), n && U.isCellWithinRange(e, o) ? t : Se[_.Center];
1026
- }, [Se, A]), Je = z((e, t = {
1026
+ }, [Se, A]), Je = $((e, t = {
1027
1027
  inline: "nearest",
1028
1028
  block: "nearest"
1029
1029
  }, n = null) => {
@@ -1089,18 +1089,18 @@ var Re = Object.freeze([]), Me = (e, t) => {
1089
1089
  Ie,
1090
1090
  Se,
1091
1091
  u
1092
- ]), Qe = z((e) => {
1092
+ ]), Qe = $((e) => {
1093
1093
  const t = e?.left ?? e?.[0], n = e?.top ?? e?.[1], o = Y.getTarget(), r = t ?? o.left, l = n ?? o.top, i = "smooth" === e?.behavior;
1094
1094
  Y.setTarget(r, l, i);
1095
1095
  }, []), et = N(n, () => ({
1096
1096
  focus: Pe,
1097
1097
  invalidate: re,
1098
1098
  scrollTo: Qe,
1099
- scrollBy: Be,
1099
+ scrollBy: Fe,
1100
1100
  scrollCellCoordsIntoView: Je,
1101
1101
  getPaneFromClient: Le,
1102
1102
  getPaneFromCell: He,
1103
- getPane: Fe,
1103
+ getPane: Be,
1104
1104
  onPaneChangeOnce: (e) => {
1105
1105
  ge.current.push(e);
1106
1106
  }
@@ -1212,15 +1212,15 @@ var Re = Object.freeze([]), Me = (e, t) => {
1212
1212
  Me
1213
1213
  ]);
1214
1214
  return c(() => {
1215
- !lt.current && it && Re && (lt.current = !0, F?.(et.current));
1215
+ !lt.current && it && Re && (lt.current = !0, B?.(et.current));
1216
1216
  }, [it, Re]), x("div", {
1217
1217
  ref: et,
1218
1218
  className: H(T, "grid-surface", Ve["sheetxl-grid"]),
1219
1219
  style: {
1220
1220
  overflow: "hidden",
1221
- ...$
1221
+ ...O
1222
1222
  },
1223
- ...O,
1223
+ ...z,
1224
1224
  children: x(Ae, { children: it })
1225
1225
  });
1226
1226
  }));
@@ -1260,8 +1260,8 @@ function Qe() {
1260
1260
  return a(Le)?.pane ?? null;
1261
1261
  }
1262
1262
  function et(e, t) {
1263
- const n = a(Fe), o = f(null);
1264
- o.current || (o.current = Be());
1263
+ const n = a(Be), o = f(null);
1264
+ o.current || (o.current = Fe());
1265
1265
  const r = n ?? o.current, l = `k:${e}`, i = f(null);
1266
1266
  null === i.current && (i.current = { v: "function" == typeof t ? t() : t });
1267
1267
  const c = s(() => r.has(l) ? r.get(l) : i.current.v, [r, l]);
@@ -1414,7 +1414,7 @@ var ot = (e) => e ? (t) => e(t) : void 0, rt = !1, lt = !1, it = "_virtual-div_1
1414
1414
  const e = d ? 1 / C : 0;
1415
1415
  P = E.snapDeviceEdge(S.x, C), k = E.snapDeviceEdge(S.y, C), D = E.snapDeviceEdge(S.x + S.width, C) + e - P, T = E.snapDeviceEdge(S.y + S.height, C) + e - k;
1416
1416
  }
1417
- const { transform: $, ...z } = p ?? {}, O = {
1417
+ const { transform: O, ...$ } = p ?? {}, z = {
1418
1418
  x: S.x - P,
1419
1419
  y: S.y - k,
1420
1420
  width: S.width,
@@ -1430,13 +1430,13 @@ var ot = (e) => e ? (t) => e(t) : void 0, rt = !1, lt = !1, it = "_virtual-div_1
1430
1430
  borderWidth: `${M}px`,
1431
1431
  borderStyle: "solid"
1432
1432
  } : void 0,
1433
- ...z,
1434
- transform: `translate(${P}px, ${k}px)${$ ? ` ${$}` : ""}`
1433
+ ...$,
1434
+ transform: `translate(${P}px, ${k}px)${O ? ` ${O}` : ""}`
1435
1435
  },
1436
1436
  ...w,
1437
1437
  ref: y,
1438
1438
  children: null == m ? null : x(ie.Provider, {
1439
- value: O,
1439
+ value: z,
1440
1440
  children: m
1441
1441
  })
1442
1442
  });
@@ -1627,14 +1627,14 @@ var at = !1, ct = (e, t, n, o) => ({
1627
1627
  const E = gt(m), I = gt(p), C = (e) => Math.max(E.left, Math.min(E.right, e)), R = (e) => Math.max(I.top, Math.min(I.bottom, e)), M = C(b), P = R(S), k = {
1628
1628
  x: M,
1629
1629
  y: P
1630
- }, D = C(x.left), T = R(w.top), $ = ct(D, T, C(x.right) - D, R(w.bottom) - T), z = M - b, O = P - S, L = Math.abs(O) >= Math.abs(z) ? O < 0 ? "b" : O > 0 ? "t" : z < 0 ? "r" : z > 0 ? "l" : null : z < 0 ? "r" : z > 0 ? "l" : O < 0 ? "b" : O > 0 ? "t" : null, N = z || O ? {
1631
- dx: z,
1632
- dy: O,
1633
- distance: Math.hypot(z, O),
1630
+ }, D = C(x.left), T = R(w.top), O = ct(D, T, C(x.right) - D, R(w.bottom) - T), $ = M - b, z = P - S, L = Math.abs(z) >= Math.abs($) ? z < 0 ? "b" : z > 0 ? "t" : $ < 0 ? "r" : $ > 0 ? "l" : null : $ < 0 ? "r" : $ > 0 ? "l" : z < 0 ? "b" : z > 0 ? "t" : null, N = $ || z ? {
1631
+ dx: $,
1632
+ dy: z,
1633
+ distance: Math.hypot($, z),
1634
1634
  direction: L ?? "t"
1635
1635
  } : null;
1636
1636
  return f || "hide" !== l ? {
1637
- rect: $,
1637
+ rect: O,
1638
1638
  clipped: !1,
1639
1639
  boundaryRect: i,
1640
1640
  clampedTo: L,
@@ -1643,7 +1643,7 @@ var at = !1, ct = (e, t, n, o) => ({
1643
1643
  slid: N,
1644
1644
  outOfView: !f
1645
1645
  } : {
1646
- rect: $,
1646
+ rect: O,
1647
1647
  clipped: !0,
1648
1648
  boundaryRect: i,
1649
1649
  clampedTo: L,
@@ -1805,12 +1805,20 @@ var at = !1, ct = (e, t, n, o) => ({
1805
1805
  };
1806
1806
  Ct.displayName = "StickyAnchor";
1807
1807
  var Pt = (e) => {
1808
- const t = O(), n = A(), o = e?.getElement(), r = {}, l = o?.closest(`[${R}]`)?.getAttribute(R), i = o?.closest(`[${M}]`)?.getAttribute(M);
1809
- l && (r[R] = l), i && (r[M] = i);
1810
- const s = [...t?.themeScope?.classes ?? [], n?.scopeClass].filter(Boolean);
1808
+ const t = z(), n = A(), o = e?.getElement(), r = o?.ownerDocument, l = s((e) => {
1809
+ if (!r || "undefined" == typeof MutationObserver) return () => {};
1810
+ const t = new MutationObserver(e);
1811
+ return t.observe(r.documentElement, {
1812
+ attributes: !0,
1813
+ subtree: !0,
1814
+ attributeFilter: [R, M]
1815
+ }), () => t.disconnect();
1816
+ }, [r]), i = () => `${o?.closest(`[${R}]`)?.getAttribute(R) ?? ""}\n${o?.closest(`[${M}]`)?.getAttribute(M) ?? ""}`, [a, c] = m(l, i, i).split("\n"), d = {};
1817
+ a && (d[R] = a), c && (d[M] = c);
1818
+ const u = [...t?.themeScope?.classes ?? [], n?.scopeClass].filter(Boolean);
1811
1819
  return {
1812
- className: s.length ? s.join(" ") : void 0,
1813
- attrs: r
1820
+ className: u.length ? u.join(" ") : void 0,
1821
+ attrs: d
1814
1822
  };
1815
1823
  }, kt = (e) => {
1816
1824
  const { side: t, align: n = "center" } = e;
@@ -1874,29 +1882,29 @@ var Pt = (e) => {
1874
1882
  });
1875
1883
  };
1876
1884
  Tt.displayName = "StickyFloat";
1877
- var $t = (e) => {
1885
+ var Ot = (e) => {
1878
1886
  const [t, n] = (e ?? "bottom-start").split("-");
1879
1887
  return {
1880
1888
  side: "top" === t ? "t" : "left" === t ? "l" : "right" === t ? "r" : "b",
1881
1889
  align: "start" === n ? "start" : "end" === n ? "end" : "center"
1882
1890
  };
1883
- }, zt = { update: () => {} }, Ot = (e) => {
1884
- const { open: t, anchorEl: n, floatReference: o, createPopupPanel: r, propsPopper: l, onMount: i, onOpening: s, onOpen: a, onClosing: d, onClose: u, children: g, className: h, label: m, anchorPosition: w, ...b } = e, S = f(null), [E, I] = p(), C = z(i ?? (() => {}), [i]), R = z(s ?? (() => {}), [s]), M = z(a ?? (() => {}), [a]), P = z(d ?? (() => {}), [d]), k = z(u ?? (() => {}), [u]);
1891
+ }, $t = { update: () => {} }, zt = (e) => {
1892
+ const { open: t, anchorEl: n, floatReference: o, createPopupPanel: r, propsPopper: l, onMount: i, onOpening: s, onOpen: a, onClosing: d, onClose: u, children: g, className: h, label: m, anchorPosition: w, ...b } = e, S = f(null), [E, I] = p(), C = $(i ?? (() => {}), [i]), R = $(s ?? (() => {}), [s]), M = $(a ?? (() => {}), [a]), P = $(d ?? (() => {}), [d]), k = $(u ?? (() => {}), [u]);
1885
1893
  c(() => {
1886
1894
  if (t) {
1887
1895
  const e = S.current;
1888
1896
  if (!e) return;
1889
- I(e), C(e, zt), R(), M();
1897
+ I(e), C(e, $t), R(), M();
1890
1898
  return;
1891
1899
  }
1892
1900
  P(), k();
1893
1901
  }, [t]);
1894
- const D = z(() => {
1902
+ const D = $(() => {
1895
1903
  o?.close(0);
1896
1904
  }, [o]), T = l?.offsets;
1897
1905
  return x(Tt, {
1898
1906
  anchor: n,
1899
- placement: $t(l?.placement),
1907
+ placement: Ot(l?.placement),
1900
1908
  offset: T?.[1] ?? 2,
1901
1909
  alignOffset: T?.[0] ?? 0,
1902
1910
  zIndex: 1300,
@@ -1918,10 +1926,10 @@ var $t = (e) => {
1918
1926
  })
1919
1927
  });
1920
1928
  };
1921
- Ot.displayName = "GridFloatPanel";
1929
+ zt.displayName = "GridFloatPanel";
1922
1930
  var Lt = ({ outOfView: e, close: t }) => (c(() => {
1923
1931
  e && t();
1924
- }, [e]), null), Nt = (e) => x(Ot, { ...e }), Bt = { pointerEvents: "auto" }, Ft = (e = {}) => {
1932
+ }, [e]), null), Nt = (e) => x(zt, { ...e }), Ft = { pointerEvents: "auto" }, Bt = (e = {}) => {
1925
1933
  const { openDelay: t = 300, closeDelay: n = 150 } = e, [o, r] = p(!1), l = f(!1), i = f(null), a = f(!1), d = f(null), u = f(null), h = (e) => {
1926
1934
  l.current = e, r(e);
1927
1935
  }, m = () => {
@@ -1948,7 +1956,7 @@ var Lt = ({ outOfView: e, close: t }) => (c(() => {
1948
1956
  onPointerLeave: () => {
1949
1957
  a.current = !1, x();
1950
1958
  },
1951
- style: Bt
1959
+ style: Ft
1952
1960
  }), [x]);
1953
1961
  return c(() => () => {
1954
1962
  m(), w();
@@ -1959,7 +1967,7 @@ var Lt = ({ outOfView: e, close: t }) => (c(() => {
1959
1967
  close: y
1960
1968
  };
1961
1969
  }, At = (e, t = {}) => {
1962
- const { open: n, setTarget: o, tipProps: r } = Ft(t), l = Qe(), i = Ie(l), s = a(ke), d = Pe(e), [u, g] = et(`range-hover:${s}:${d}`, null), h = f({});
1970
+ const { open: n, setTarget: o, tipProps: r } = Bt(t), l = Qe(), i = Ie(l), s = a(ke), d = Pe(e), [u, g] = et(`range-hover:${s}:${d}`, null), h = f({});
1963
1971
  return h.current = {
1964
1972
  pointermove: (t, n) => {
1965
1973
  const o = t, r = (n ?? l)?.getCellFromPointer(o.clientX, o.clientY);
@@ -1984,22 +1992,23 @@ var Lt = ({ outOfView: e, close: t }) => (c(() => {
1984
1992
  key: e.key ?? Pe(e.range),
1985
1993
  range: e.range,
1986
1994
  data: e.data,
1987
- placement: e.placement
1995
+ placement: e.placement,
1996
+ alignOffset: e.alignOffset
1988
1997
  }), Kt = (e, t) => Array.isArray(e) ? e.includes(t) : e === t, _t = (e) => {
1989
1998
  const t = e.getCoords();
1990
1999
  return t ? `${t.rowIndex},${t.colIndex}` : null;
1991
2000
  }, Wt = (e) => {
1992
- const { activateOn: t, name: n, probe: o, selection: r, target: l, dismiss: i, placement: s, offset: d = 6, alignOffset: u = 0, openDelay: g = 300, closeDelay: h = 150, whenOff: f = "hide", boundary: p, zIndex: m, children: w, className: v, style: y } = e, b = Je(), S = a(ke), E = Kt(t, "hover"), I = Kt(t, "selection"), C = void 0 !== l, { open: R, setTarget: M, tipProps: P, close: k } = Ft({
2001
+ const { activateOn: t, name: n, probe: o, selection: r, target: l, dismiss: i, placement: s, offset: d = 6, alignOffset: u = 0, openDelay: g = 300, closeDelay: h = 150, whenOff: f = "hide", boundary: p, zIndex: m, children: w, className: v, style: y } = e, b = Je(), S = a(ke), E = Kt(t, "hover"), I = Kt(t, "selection"), C = void 0 !== l, { open: R, setTarget: M, tipProps: P, close: k } = Bt({
1993
2002
  openDelay: g,
1994
2003
  closeDelay: h
1995
- }), [D, T] = et(`range-float:${n ?? S}`, Vt), $ = z(() => {
2004
+ }), [D, T] = et(`range-float:${n ?? S}`, Vt), O = $(() => {
1996
2005
  T((e) => null === e.aimed ? e : {
1997
2006
  target: e.target,
1998
2007
  aimed: null
1999
2008
  });
2000
- }, [T]), O = z((e) => {
2009
+ }, [T]), z = $((e) => {
2001
2010
  const t = b.getCellFromPointer(e.clientX, e.clientY), n = t ? o?.(t, b) : null;
2002
- if (!n?.range) return void $();
2011
+ if (!n?.range) return void O();
2003
2012
  const r = Ht(n);
2004
2013
  T((e) => e.aimed === r.key && e.target?.key === r.key ? e : {
2005
2014
  target: r,
@@ -2009,7 +2018,7 @@ var Lt = ({ outOfView: e, close: t }) => (c(() => {
2009
2018
  b,
2010
2019
  o,
2011
2020
  T,
2012
- $
2021
+ O
2013
2022
  ]), L = E ? D.aimed : null;
2014
2023
  c(() => {
2015
2024
  M(L);
@@ -2020,22 +2029,22 @@ var Lt = ({ outOfView: e, close: t }) => (c(() => {
2020
2029
  k,
2021
2030
  T
2022
2031
  ]);
2023
- const N = B(I ? r : void 0, _t);
2024
- let F = null;
2032
+ const N = F(I ? r : void 0, _t);
2033
+ let B = null;
2025
2034
  if (I && !i && r && null !== N) {
2026
2035
  const e = o?.(r.getCoords(), b);
2027
- e && e.range && (F = Ht(e));
2036
+ e && e.range && (B = Ht(e));
2028
2037
  }
2029
- const A = E ? D.target : null, V = R && null !== A, K = C ? null === l ? null : Ht(l) : V ? A : F ?? A, _ = C ? null !== K : V || null !== F;
2038
+ const A = E ? D.target : null, V = R && null !== A, K = C ? null === l ? null : Ht(l) : V ? A : B ?? A, _ = C ? null !== K : V || null !== B;
2030
2039
  return x(nt, {
2031
2040
  className: H(v, "range-float"),
2032
- onPointerMove: E ? O : void 0,
2033
- onPointerLeave: E ? $ : void 0,
2041
+ onPointerMove: E ? z : void 0,
2042
+ onPointerLeave: E ? O : void 0,
2034
2043
  children: K && x(Tt, {
2035
2044
  anchor: { range: K.range },
2036
2045
  placement: K.placement ?? s,
2037
2046
  offset: d,
2038
- alignOffset: u,
2047
+ alignOffset: K.alignOffset ?? u,
2039
2048
  boundary: p,
2040
2049
  zIndex: m,
2041
2050
  open: _,
@@ -2490,18 +2499,18 @@ var fn = (e) => {
2490
2499
  o?.(), d?.();
2491
2500
  }
2492
2501
  };
2493
- }), $ = null !== T && l ? l : r ?? Sn[n], z = R.getBoundsFromRange(t);
2494
- if (!z) return null;
2495
- const O = E.getDevicePixelRatio();
2496
- let L = bn(z.x, z.x + z.width, vn[n], O), N = bn(z.y, z.y + z.height, yn[n], O);
2502
+ }), O = null !== T && l ? l : r ?? Sn[n], $ = R.getBoundsFromRange(t);
2503
+ if (!$) return null;
2504
+ const z = E.getDevicePixelRatio();
2505
+ let L = bn($.x, $.x + $.width, vn[n], z), N = bn($.y, $.y + $.height, yn[n], z);
2497
2506
  if (I) {
2498
2507
  if (!R.toClipBounds(R.getBoundsFromRange(t))) return null;
2499
2508
  const e = R.getPaneBounds(), n = o / 2 + 1;
2500
2509
  !0 !== I && "x" !== I || (L = Math.max(n, Math.min(e.width - n, L))), !0 !== I && "y" !== I || (N = Math.max(n, Math.min(e.height - n, N)));
2501
2510
  }
2502
- const B = {
2511
+ const F = {
2503
2512
  position: "absolute",
2504
- cursor: $,
2513
+ cursor: O,
2505
2514
  pointerEvents: "all",
2506
2515
  left: 0,
2507
2516
  top: 0,
@@ -2510,7 +2519,7 @@ var fn = (e) => {
2510
2519
  transition: "transform 60ms ease-in-out",
2511
2520
  willChange: "transform"
2512
2521
  } : void 0
2513
- }, F = {
2522
+ }, B = {
2514
2523
  className: H("drag-handle", y),
2515
2524
  onPointerDown: (e) => {
2516
2525
  k(e) ? u(e) : D(e);
@@ -2526,17 +2535,17 @@ var fn = (e) => {
2526
2535
  return m ? x(w, { children: m({
2527
2536
  anchor: n,
2528
2537
  size: o,
2529
- cursor: $,
2538
+ cursor: O,
2530
2539
  background: i,
2531
2540
  hovered: M,
2532
2541
  handleProps: {
2533
- ...F,
2534
- style: B
2542
+ ...B,
2543
+ style: F
2535
2544
  }
2536
2545
  }) }) : x("div", {
2537
- ...F,
2546
+ ...B,
2538
2547
  style: {
2539
- ...B,
2548
+ ...F,
2540
2549
  width: o,
2541
2550
  height: o,
2542
2551
  background: null == v ? i : void 0,
@@ -2681,17 +2690,17 @@ var xn = () => {
2681
2690
  } }, D = l ? {
2682
2691
  onPointerEnter: () => l(!0),
2683
2692
  onPointerLeave: () => l(!1)
2684
- } : void 0, T = r / E.getDevicePixelRatio(), $ = m?.getBoundsFromRange(t), z = $ ? {
2685
- x: $.x - T,
2686
- y: $.y - T,
2687
- width: $.width + 2 * T,
2688
- height: $.height + 2 * T
2693
+ } : void 0, T = r / E.getDevicePixelRatio(), O = m?.getBoundsFromRange(t), $ = O ? {
2694
+ x: O.x - T,
2695
+ y: O.y - T,
2696
+ width: O.width + 2 * T,
2697
+ height: O.height + 2 * T
2689
2698
  } : void 0;
2690
2699
  return v(w, { children: [
2691
2700
  x(st, "entire" === o ? {
2692
2701
  ref: b,
2693
2702
  className: H("drag-grip", p),
2694
- ...z ? { bounds: z } : { range: t },
2703
+ ...$ ? { bounds: $ } : { range: t },
2695
2704
  style: { cursor: P },
2696
2705
  ...k,
2697
2706
  ...D
@@ -2794,7 +2803,7 @@ var Tn = (e, t, n, o) => {
2794
2803
  rowEnd: Math.max(r, i),
2795
2804
  colEnd: Math.max(l, s)
2796
2805
  };
2797
- }, $n = (e, t, n) => {
2806
+ }, On = (e, t, n) => {
2798
2807
  const o = t.rowIndex - e.rowEnd, r = e.rowStart - t.rowIndex, l = t.colIndex - e.colEnd, i = e.colStart - t.colIndex, s = Math.max(o, r, 0), a = Math.max(l, i, 0);
2799
2808
  if (s > 0 || a > 0) return s >= a ? o > 0 ? {
2800
2809
  ...e,
@@ -2817,13 +2826,13 @@ var Tn = (e, t, n, o) => {
2817
2826
  ...e,
2818
2827
  colEnd: t.colIndex
2819
2828
  };
2820
- }, zn = (e, t) => t.rowEnd < e.rowEnd ? {
2829
+ }, $n = (e, t) => t.rowEnd < e.rowEnd ? {
2821
2830
  ...e,
2822
2831
  rowStart: t.rowEnd + 1
2823
2832
  } : t.colEnd < e.colEnd ? {
2824
2833
  ...e,
2825
2834
  colStart: t.colEnd + 1
2826
- } : null, On = (e) => {
2835
+ } : null, zn = (e) => {
2827
2836
  const { range: t, snapDestination: n, onDragStart: o, onDragMove: r, onDragEnd: l, onMenu: i, onDragDone: s, onDoubleClick: a, renderHandle: c, ...d } = e, u = {
2828
2837
  ...en,
2829
2838
  fill: void 0,
@@ -2857,7 +2866,7 @@ var Tn = (e, t, n, o) => {
2857
2866
  }, c))) return !1;
2858
2867
  return !0;
2859
2868
  })(p, t, E, I)) return null;
2860
- const $ = y ? zn(t, y) : null;
2869
+ const O = y ? $n(t, y) : null;
2861
2870
  return v(w, { children: [
2862
2871
  x(wn, {
2863
2872
  className: "fill-handle",
@@ -2873,7 +2882,7 @@ var Tn = (e, t, n, o) => {
2873
2882
  m.current = null, b(null), o?.(t, n);
2874
2883
  },
2875
2884
  onDragMove: (e, o, l) => {
2876
- let i = $n(t, o, p.getTotalRange());
2885
+ let i = On(t, o, p.getTotalRange());
2877
2886
  i && n && (i = n(t, i)), m.current = i, b(i), i && r?.(i, l);
2878
2887
  },
2879
2888
  onDragEnd: (e, t, n) => {
@@ -2889,14 +2898,14 @@ var Tn = (e, t, n, o) => {
2889
2898
  range: y,
2890
2899
  ...h
2891
2900
  }),
2892
- $ && x(tn, {
2901
+ O && x(tn, {
2893
2902
  className: "fill-vacated",
2894
- range: $,
2903
+ range: O,
2895
2904
  fill: "rgba(128, 128, 128, 0.28)"
2896
2905
  })
2897
2906
  ] });
2898
2907
  };
2899
- On.displayName = "FillHandle";
2908
+ zn.displayName = "FillHandle";
2900
2909
  var Ln = i((e) => {
2901
2910
  const { value: t, zoom: n, bounds: o, cell: r, range: l, children: i, className: s, ...a } = e;
2902
2911
  return x("div", {
@@ -2908,8 +2917,8 @@ var Ln = i((e) => {
2908
2917
  cells: [],
2909
2918
  rangesH: [],
2910
2919
  rangesV: []
2911
- }), Bn = !1, Fn = /* @__PURE__ */ new WeakMap(), An = (e, t = {}) => {
2912
- const n = e.getVisibleRange(), o = e.getScrollTopLeft(), r = t.bufferRange, l = !!r, i = r ? r.rowStart : 0, s = r ? r.colStart : 0, a = r ? r.rowEnd : 0, c = r ? r.colEnd : 0, d = Fn.get(e);
2920
+ }), Fn = !1, Bn = /* @__PURE__ */ new WeakMap(), An = (e, t = {}) => {
2921
+ const n = e.getVisibleRange(), o = e.getScrollTopLeft(), r = t.bufferRange, l = !!r, i = r ? r.rowStart : 0, s = r ? r.colStart : 0, a = r ? r.rowEnd : 0, c = r ? r.colEnd : 0, d = Bn.get(e);
2913
2922
  if (d && d.rowStart === n.rowStart && d.colStart === n.colStart && d.rowEnd === n.rowEnd && d.colEnd === n.colEnd && d.scrollLeft === o.left && d.scrollTop === o.top && d.hasBuffer === l && d.bRowStart === i && d.bColStart === s && d.bRowEnd === a && d.bColEnd === c && d.options.cacheToken === t.cacheToken && d.options.getVisibleCells === t.getVisibleCells && d.options.hiddenCellAt === t.hiddenCellAt) return d.model;
2914
2923
  const u = ((e, t = {}) => {
2915
2924
  const { getVisibleCells: n, hiddenCellAt: o, bufferRange: r } = t, l = e.getTotalRange(), i = r ? {
@@ -2979,7 +2988,7 @@ var Ln = i((e) => {
2979
2988
  range: l,
2980
2989
  bounds: s,
2981
2990
  value: n?.value
2982
- }) : Bn || (Bn = !0, console.warn("grid-react: no bounds for cell", _n(l.rowStart, l.colStart)));
2991
+ }) : Fn || (Fn = !0, console.warn("grid-react: no bounds for cell", _n(l.rowStart, l.colStart)));
2983
2992
  }
2984
2993
  return {
2985
2994
  cells: f,
@@ -2987,7 +2996,7 @@ var Ln = i((e) => {
2987
2996
  rangesV: m
2988
2997
  };
2989
2998
  })(e, t);
2990
- return Fn.set(e, {
2999
+ return Bn.set(e, {
2991
3000
  rowStart: n.rowStart,
2992
3001
  colStart: n.colStart,
2993
3002
  rowEnd: n.rowEnd,
@@ -3284,14 +3293,14 @@ var Gn = 8, Xn = 1 << 19, Yn = 1, qn = 512, Zn = !1, Jn = (e, t, n) => {
3284
3293
  const { showGridLines: t = !0, gridLineColor: n = "var(--sxl-color-base-300, rgb(224, 224, 224))", propsRows: o, propsColumns: r, getVisibleCells: l, hiddenCellAt: i, cacheToken: s, bufferRange: a, className: c, style: d, ...u } = e, h = Je(), f = t, p = !0 === t || !0 === f?.horizontal, m = !0 === t || !0 === f?.vertical, { rangesH: w, rangesV: y } = Kn(h, {
3285
3294
  getVisibleCells: l,
3286
3295
  cacheToken: s
3287
- }), b = E.getDevicePixelRatio(), { top: S, left: I } = h.getScrollTopLeft(), C = h.getPaneBounds(), R = h.getVisibleRange(), M = h.getColumnSize(R.colEnd), P = h.getRowSize(R.rowEnd), k = Math.min(C.width, M ? M.offset + M.size : C.width), D = Math.min(C.height, P ? P.offset + P.size : C.height), T = 0 === w.length ? `${S}|${k}|${b}` : `${S}|${I}|${k}|${b}|${Qn(w)}`, $ = 0 === y.length ? `${I}|${D}|${b}` : `${I}|${S}|${D}|${b}|${Qn(y)}`, z = g(() => p ? Jn(h, !0, w) : null, [
3296
+ }), b = E.getDevicePixelRatio(), { top: S, left: I } = h.getScrollTopLeft(), C = h.getPaneBounds(), R = h.getVisibleRange(), M = h.getColumnSize(R.colEnd), P = h.getRowSize(R.rowEnd), k = Math.min(C.width, M ? M.offset + M.size : C.width), D = Math.min(C.height, P ? P.offset + P.size : C.height), T = 0 === w.length ? `${S}|${k}|${b}` : `${S}|${I}|${k}|${b}|${Qn(w)}`, O = 0 === y.length ? `${I}|${D}|${b}` : `${I}|${S}|${D}|${b}|${Qn(y)}`, $ = g(() => p ? Jn(h, !0, w) : null, [
3288
3297
  h,
3289
3298
  p,
3290
3299
  T
3291
- ]), O = g(() => m ? Jn(h, !1, y) : null, [
3300
+ ]), z = g(() => m ? Jn(h, !1, y) : null, [
3292
3301
  h,
3293
3302
  m,
3294
- $
3303
+ O
3295
3304
  ]);
3296
3305
  return p || m ? x(nt, {
3297
3306
  ...u,
@@ -3303,7 +3312,7 @@ var Gn = 8, Xn = 1 << 19, Yn = 1, qn = 512, Zn = !1, Jn = (e, t, n) => {
3303
3312
  pointerEvents: "none",
3304
3313
  ...d
3305
3314
  },
3306
- children: [p && z ? eo(h, !0, z, n, o) : null, m && O ? eo(h, !1, O, n, r) : null]
3315
+ children: [p && $ ? eo(h, !0, $, n, o) : null, m && z ? eo(h, !1, z, n, r) : null]
3307
3316
  })
3308
3317
  }) : null;
3309
3318
  });
@@ -3612,7 +3621,7 @@ var no = 1, oo = -10, ro = class {
3612
3621
  dragMode: c.dragMode
3613
3622
  };
3614
3623
  }, yo = (e) => {
3615
- const { selection: t, color: n = "var(--sxl-color-primary, rgb(33, 115, 70))", size: o = 22 } = e, r = Qe(), i = Eo($(t, (e) => e.getSelection())), s = r ? r.getAllPanes()[_.Center] ?? r : void 0, a = ((e, t, n) => {
3624
+ const { selection: t, color: n = "var(--sxl-color-primary, rgb(33, 115, 70))", size: o = 22 } = e, r = Qe(), i = Eo(O(t, (e) => e.getSelection())), s = r ? r.getAllPanes()[_.Center] ?? r : void 0, a = ((e, t, n) => {
3616
3625
  const o = !!t && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd, r = !!t && e.colStart === t.colStart && e.colEnd === t.colEnd;
3617
3626
  if (o && r) return [];
3618
3627
  if (o) {
@@ -3856,8 +3865,8 @@ var Mo = (e, t) => void 0 === t ? e : null === t ? null : {
3856
3865
  side: "b",
3857
3866
  align: "end"
3858
3867
  }, Do = e.forwardRef((t, n) => {
3859
- const { selection: o, getContentBounds: r, getRegionBounds: l, scrollIntoView: i, singleStyle: s, multiStyle: a, multiAnchorStyle: c, singleAnchorStyle: d, removePreviewStyle: u, insertBarStyle: g, isDropRefused: h, moveSourceStyle: f, singleLayer: p, multiLayer: m, enabledMove: y, onMove: b, onMoveStart: E, onMoveUpdate: I, onMoveEnd: C, moveCursor: R, enableFill: M, snapFillDestination: P, onFill: k, onFillStart: D, onFillPreview: T, onFillEnd: z, onFillMenu: O, resolveFillExtent: L, onEdgeDoubleClick: N, onSelectionEnd: B, onDragModeChange: F, renderTip: A, tipPlacement: V, disableKeyboard: H, anchorHole: K = !0, ..._ } = t, j = $(o, (e) => e.getSelection()), Y = vo(o, { onSelectionEnd: B }), q = e.useRef(F);
3860
- q.current = F, e.useEffect(() => {
3868
+ const { selection: o, getContentBounds: r, getRegionBounds: l, scrollIntoView: i, singleStyle: s, multiStyle: a, multiAnchorStyle: c, singleAnchorStyle: d, removePreviewStyle: u, insertBarStyle: g, isDropRefused: h, moveSourceStyle: f, singleLayer: p, multiLayer: m, enabledMove: y, onMove: b, onMoveStart: E, onMoveUpdate: I, onMoveEnd: C, moveCursor: R, enableFill: M, snapFillDestination: P, onFill: k, onFillStart: D, onFillPreview: T, onFillEnd: $, onFillMenu: z, resolveFillExtent: L, onEdgeDoubleClick: N, onSelectionEnd: F, onDragModeChange: B, renderTip: A, tipPlacement: V, disableKeyboard: H, anchorHole: K = !0, ..._ } = t, j = O(o, (e) => e.getSelection()), Y = vo(o, { onSelectionEnd: F }), q = e.useRef(B);
3869
+ q.current = B, e.useEffect(() => {
3861
3870
  q.current?.(Y.dragMode);
3862
3871
  }, [Y.dragMode]);
3863
3872
  const [Z, J] = e.useState(null), Q = Je(), ee = e.useRef(o);
@@ -4199,7 +4208,7 @@ var Mo = (e, t) => void 0 === t ? e : null === t ? null : {
4199
4208
  }));
4200
4209
  }
4201
4210
  }),
4202
- !ae && M && x(On, {
4211
+ !ae && M && x(zn, {
4203
4212
  range: he,
4204
4213
  snapDestination: P,
4205
4214
  ...me.border,
@@ -4220,11 +4229,11 @@ var Mo = (e, t) => void 0 === t ? e : null === t ? null : {
4220
4229
  onDragEnd: (e, t) => {
4221
4230
  k?.(he, e, t), Ee(e);
4222
4231
  },
4223
- onMenu: O ? (e, t, n) => {
4224
- O(he, e, t, n);
4232
+ onMenu: z ? (e, t, n) => {
4233
+ z(he, e, t, n);
4225
4234
  } : void 0,
4226
4235
  onDragDone: () => {
4227
- z?.(), J(null);
4236
+ $?.(), J(null);
4228
4237
  },
4229
4238
  onDoubleClick: L ? (e, t) => {
4230
4239
  const n = L(e);
@@ -4268,7 +4277,7 @@ var To = (e, t, n, o = !1, r = "range") => v(w, { children: [
4268
4277
  range: t,
4269
4278
  ...e.border
4270
4279
  })
4271
- ] }), $o = [
4280
+ ] }), Oo = [
4272
4281
  "#1a73e8",
4273
4282
  "#d93025",
4274
4283
  "#1e8e3e",
@@ -4276,19 +4285,19 @@ var To = (e, t, n, o = !1, r = "range") => v(w, { children: [
4276
4285
  "#e37400",
4277
4286
  "#12a4af",
4278
4287
  "#d01884"
4279
- ], zo = Array.from({ length: I }, (e, t) => `var(--sxl-color-series-${t + 1}, ${$o[t]})`), Oo = "var(--sxl-color-primary, rgb(0, 120, 215))", Lo = (e, t, n) => ({
4288
+ ], $o = Array.from({ length: I }, (e, t) => `var(--sxl-color-series-${t + 1}, ${Oo[t]})`), zo = "var(--sxl-color-primary, rgb(0, 120, 215))", Lo = (e, t, n) => ({
4280
4289
  rowStart: Math.max(n.rowStart, Math.min(e.rowIndex, t.rowIndex)),
4281
4290
  colStart: Math.max(n.colStart, Math.min(e.colIndex, t.colIndex)),
4282
4291
  rowEnd: Math.min(n.rowEnd, Math.max(e.rowIndex, t.rowIndex)),
4283
4292
  colEnd: Math.min(n.colEnd, Math.max(e.colIndex, t.colIndex))
4284
- }), No = (e) => ({ stroke: zo.length ? zo[e % zo.length] : Oo }), Bo = (e) => {
4285
- const { selection: t, getRangeStyle: n = No, anchors: o = Pn, enabledMove: r, disableDraw: l, allowMulti: i = !0, size: s, animated: a, renderHandle: d, preserveFocus: u = !0, onDragActiveChange: g, rangeStyle: h = W.EmptyObject, className: m, ...w } = e, y = Je(), b = $(t, (e) => e.getSelection()), S = b.ranges ?? U.EmptyRanges, E = Math.min(Math.max(0, b.rangeIndex ?? S.length - 1), Math.max(0, S.length - 1)), [I, C] = p(null), [R, M] = p(null), [P, k] = p(!1), D = null !== R || P, T = f(g);
4293
+ }), No = (e) => ({ stroke: $o.length ? $o[e % $o.length] : zo }), Fo = (e) => {
4294
+ const { selection: t, getRangeStyle: n = No, anchors: o = Pn, enabledMove: r, disableDraw: l, allowMulti: i = !0, size: s, animated: a, renderHandle: d, preserveFocus: u = !0, onDragActiveChange: g, rangeStyle: h = W.EmptyObject, className: m, ...w } = e, y = Je(), b = O(t, (e) => e.getSelection()), S = b.ranges ?? U.EmptyRanges, E = Math.min(Math.max(0, b.rangeIndex ?? S.length - 1), Math.max(0, S.length - 1)), [I, C] = p(null), [R, M] = p(null), [P, k] = p(!1), D = null !== R || P, T = f(g);
4286
4295
  T.current = g, c(() => {
4287
4296
  T.current?.(D, R);
4288
4297
  }, [D, R]), c(() => () => {
4289
4298
  T.current?.(!1, null);
4290
4299
  }, []);
4291
- const z = R ?? I, O = (e, t) => C((n) => t ? e : n === e ? null : n), L = (e, n) => {
4300
+ const $ = R ?? I, z = (e, t) => C((n) => t ? e : n === e ? null : n), L = (e, n) => {
4292
4301
  const o = t.getSelection(), r = o.ranges ?? U.EmptyRanges, l = e < r.length ? r.map((t, o) => o === e ? {
4293
4302
  ...t,
4294
4303
  ...n
@@ -4308,7 +4317,7 @@ var To = (e, t, n, o = !1, r = "range") => v(w, { children: [
4308
4317
  ...n,
4309
4318
  rangeIndex: e
4310
4319
  });
4311
- }, B = fn((e, t) => {
4320
+ }, F = fn((e, t) => {
4312
4321
  if (0 !== t.button) return null;
4313
4322
  const n = (b.rangeIndex ?? -1) >= 0 ? b.rangeIndex : -1;
4314
4323
  if (t.shiftKey && n >= 0 && S[n]) {
@@ -4328,8 +4337,8 @@ var To = (e, t, n, o = !1, r = "range") => v(w, { children: [
4328
4337
  end: () => k(!1),
4329
4338
  captureEvents: !1
4330
4339
  };
4331
- }), F = S.map((e, t) => n(t, t === E)), A = [];
4332
- for (let e = 0; e < F.length; e++) F[e] && A.push(e);
4340
+ }), B = S.map((e, t) => n(t, t === E)), A = [];
4341
+ for (let e = 0; e < B.length; e++) B[e] && A.push(e);
4333
4342
  return v(nt, {
4334
4343
  ...w,
4335
4344
  children: [
@@ -4337,18 +4346,18 @@ var To = (e, t, n, o = !1, r = "range") => v(w, { children: [
4337
4346
  fill: !0,
4338
4347
  className: H(m, "ranges-picker-draw"),
4339
4348
  onPointerDown: (e) => {
4340
- e.stopPropagation(), u && e.preventDefault(), B.onPointerDown(e);
4349
+ e.stopPropagation(), u && e.preventDefault(), F.onPointerDown(e);
4341
4350
  },
4342
- onPointerMove: B.onPointerMove,
4351
+ onPointerMove: F.onPointerMove,
4343
4352
  onPointerUp: (e) => {
4344
- e.stopPropagation(), B.onPointerUp(e);
4353
+ e.stopPropagation(), F.onPointerUp(e);
4345
4354
  }
4346
4355
  }),
4347
4356
  r && A.map((e) => x(Rn, {
4348
4357
  range: S[e],
4349
4358
  grip: "edges",
4350
4359
  preserveFocus: u,
4351
- onHoverChange: (t) => O(e, t),
4360
+ onHoverChange: (t) => z(e, t),
4352
4361
  onDragStateChange: (t) => {
4353
4362
  t && N(e), M(t ? e : null);
4354
4363
  },
@@ -4356,8 +4365,8 @@ var To = (e, t, n, o = !1, r = "range") => v(w, { children: [
4356
4365
  onDragEnd: (t) => L(e, t)
4357
4366
  }, `move-${e}`)),
4358
4367
  A.map((e) => {
4359
- const t = e === E, n = e === z, r = ((e, t, n) => {
4360
- const o = e.stroke ?? h.stroke ?? Oo;
4368
+ const t = e === E, n = e === $, r = ((e, t, n) => {
4369
+ const o = e.stroke ?? h.stroke ?? zo;
4361
4370
  return {
4362
4371
  ...h,
4363
4372
  ...e,
@@ -4366,7 +4375,7 @@ var To = (e, t, n, o = !1, r = "range") => v(w, { children: [
4366
4375
  alignWidth: n ? 3 : e.alignWidth ?? h.alignWidth ?? 2,
4367
4376
  ...a && t ? { animatedStroke: !0 } : void 0
4368
4377
  };
4369
- })(F[e], t, n);
4378
+ })(B[e], t, n);
4370
4379
  return x(Dn, {
4371
4380
  range: S[e],
4372
4381
  anchors: o,
@@ -4374,7 +4383,7 @@ var To = (e, t, n, o = !1, r = "range") => v(w, { children: [
4374
4383
  ...r,
4375
4384
  renderHandle: d,
4376
4385
  preserveFocus: u,
4377
- onHandleHoverChange: (t) => O(e, t),
4386
+ onHandleHoverChange: (t) => z(e, t),
4378
4387
  onDragMove: (t) => L(e, t),
4379
4388
  onDragStart: () => {
4380
4389
  N(e), M(e);
@@ -4387,8 +4396,8 @@ var To = (e, t, n, o = !1, r = "range") => v(w, { children: [
4387
4396
  ]
4388
4397
  });
4389
4398
  };
4390
- Bo.displayName = "RangesPickerLayer";
4391
- var Fo = 0, Ao = class {
4399
+ Fo.displayName = "RangesPickerLayer";
4400
+ var Bo = 0, Ao = class {
4392
4401
  constructor(e, t = {}) {
4393
4402
  this.listeners = /* @__PURE__ */ new Set(), this.commitListeners = /* @__PURE__ */ new Set(), this.cancelListeners = /* @__PURE__ */ new Set(), this.editors = /* @__PURE__ */ new Set(), this.activeEditor = null, this.activeEditorId = null, this.auxState = null, this.commitFn = e.commit, this.onCommitError = e.onCommitError, this.state = {
4394
4403
  mode: t.mode ?? "enter",
@@ -4397,7 +4406,7 @@ var Fo = 0, Ao = class {
4397
4406
  dirty: t.dirty,
4398
4407
  initialSelection: t.initialSelection ?? null,
4399
4408
  autoFocus: t.autoFocus ?? !0,
4400
- token: ++Fo
4409
+ token: ++Bo
4401
4410
  };
4402
4411
  }
4403
4412
  getState() {
@@ -4516,14 +4525,14 @@ var Fo = 0, Ao = class {
4516
4525
  return u(() => {
4517
4526
  const t = n.current;
4518
4527
  null !== t && (n.current = null, e.current?.setSelectionRange(t, t));
4519
- }, [t]), z((e) => {
4528
+ }, [t]), $((e) => {
4520
4529
  n.current = e;
4521
4530
  }, []);
4522
4531
  }, Ko = (e, t) => {
4523
4532
  if (e.which === b.Enter && t.ctrlKey) return t.shiftKey ? { arrayFixed: !0 } : { broadcast: !0 };
4524
4533
  }, _o = (e) => {
4525
4534
  const { mode: t, value: n, onDirtyChange: o, onModeChange: r, onCommit: l, onCancel: i, onNavigate: s, onTraverse: a, setCaret: c } = e;
4526
- return z((e) => {
4535
+ return $((e) => {
4527
4536
  const d = e.nativeEvent;
4528
4537
  if (d.isComposing) return void e.stopPropagation();
4529
4538
  if (e.which === b.Escape) return e.preventDefault(), e.stopPropagation(), void i();
@@ -4720,12 +4729,12 @@ var Fo = 0, Ao = class {
4720
4729
  })] });
4721
4730
  };
4722
4731
  function Yo(e) {
4723
- const { editable: t, renderEditor: n, alignment: o = "left", background: r = "var(--sxl-color-base-100, rgb(255, 255, 255))", borderColor: l = "var(--sxl-color-primary, rgb(33, 115, 70))", borderWidth: i = 2, zIndex: s, className: a, style: d, ...u } = e, g = Qe(), h = $(t, (e) => e.getSession()), f = B(h, (e) => e.getState()), [m, w] = p(null), v = z((e) => {
4732
+ const { editable: t, renderEditor: n, alignment: o = "left", background: r = "var(--sxl-color-base-100, rgb(255, 255, 255))", borderColor: l = "var(--sxl-color-primary, rgb(33, 115, 70))", borderWidth: i = 2, zIndex: s, className: a, style: d, ...u } = e, g = Qe(), h = O(t, (e) => e.getSession()), f = F(h, (e) => e.getState()), [m, w] = p(null), v = $((e) => {
4724
4733
  w((t) => t && t.width === e.width && t.height === e.height ? t : e);
4725
- }, []), y = z((e) => {
4734
+ }, []), y = $((e) => {
4726
4735
  const n = t.commit(e);
4727
4736
  return n && g?.focus(), n;
4728
- }, [t, g]), b = z(() => {
4737
+ }, [t, g]), b = $(() => {
4729
4738
  t.cancel(), g?.focus();
4730
4739
  }, [t, g]);
4731
4740
  c(() => {
@@ -4793,7 +4802,7 @@ function qo(e) {
4793
4802
  const { editable: t } = e, n = Qe();
4794
4803
  return x(nt, {
4795
4804
  className: "editor-start",
4796
- onKeyDown: z((e) => {
4805
+ onKeyDown: $((e) => {
4797
4806
  if (t.getSession()) return;
4798
4807
  const o = n?.getElement();
4799
4808
  if (o && e.target !== o) return;
@@ -4802,7 +4811,7 @@ function qo(e) {
4802
4811
  const l = Vo(e.nativeEvent);
4803
4812
  l && ("Process" !== e.nativeEvent.key && 229 !== e.nativeEvent.keyCode && e.preventDefault(), e.stopPropagation(), t.startEdit(r, l));
4804
4813
  }, [t, n]),
4805
- onDoubleClick: z((e) => {
4814
+ onDoubleClick: $((e) => {
4806
4815
  if (t.getSession()) return;
4807
4816
  const o = n?.getCellFromPointer(e.clientX, e.clientY) ?? t.getAnchor().getCoords();
4808
4817
  o && t.startEdit(o, { mode: "edit" });
@@ -4810,7 +4819,7 @@ function qo(e) {
4810
4819
  });
4811
4820
  }
4812
4821
  function Zo(e) {
4813
- const { editable: t, renderEditor: n, idleClean: o = null, mapClean: r, editorId: l, readOnly: i, className: s, style: a } = e, c = $(t, (e) => e.getSession()), d = B(c, (e) => e.getState()), u = d?.clean ?? o, g = r ? r(u) : u, h = z((e) => t.commit(e), [t]), f = z(() => t.cancel(), [t]), p = z(() => {
4822
+ const { editable: t, renderEditor: n, idleClean: o = null, mapClean: r, editorId: l, readOnly: i, className: s, style: a } = e, c = O(t, (e) => e.getSession()), d = F(c, (e) => e.getState()), u = d?.clean ?? o, g = r ? r(u) : u, h = $((e) => t.commit(e), [t]), f = $(() => t.cancel(), [t]), p = $(() => {
4814
4823
  i || (t.getSession() || t.startEdit(t.getAnchor().getCoords(), {
4815
4824
  mode: "edit",
4816
4825
  autoFocus: !1
@@ -4909,7 +4918,7 @@ var Jo = "ew-resize", Qo = "ns-resize", er = i(r((e, t) => {
4909
4918
  }) : null]
4910
4919
  });
4911
4920
  })), tr = (e) => x(er, { ...e }), nr = i(r((e, t) => {
4912
- const { axis: n, index: o, disabled: r = !1, disabledResize: l = !1, resizeThreshold: i = 1, renderDivider: s = tr, onDividerMouseDown: a, onDividerResizeStart: c, onDividerResize: d, onDividerResizeEnd: u, onDividerMouseUp: g, onDividerAutoFit: h, onPointerDown: m, ...y } = e, b = Je(), S = z(m, [m]), I = z(h, [h]), C = n === X.Column;
4921
+ const { axis: n, index: o, disabled: r = !1, disabledResize: l = !1, resizeThreshold: i = 1, renderDivider: s = tr, onDividerMouseDown: a, onDividerResizeStart: c, onDividerResize: d, onDividerResizeEnd: u, onDividerMouseUp: g, onDividerAutoFit: h, onPointerDown: m, ...y } = e, b = Je(), S = $(m, [m]), I = $(h, [h]), C = n === X.Column;
4913
4922
  let R = C ? b.getVisibleColumns() : b.getVisibleRows(), M = null;
4914
4923
  R.length > 0 && (M = C ? b.getBoundsFromRange({
4915
4924
  rowStart: 0,
@@ -4922,11 +4931,11 @@ var Jo = "ew-resize", Qo = "ns-resize", er = i(r((e, t) => {
4922
4931
  colStart: 0,
4923
4932
  colEnd: 0
4924
4933
  }), M = b.toClipBounds(M, -10));
4925
- const P = f(null), [k, D] = p(null), T = (e, t) => C ? e.clientX - t.clientX : e.clientY - t.clientY, $ = b.getMetrics(), O = C ? $.getColOffset(o + 1) : $.getRowOffset(o + 1), N = E.getDevicePixelRatio(), B = 1 / N, A = E.snapLineCenter(O, B, N) - B / 2, V = F({
4934
+ const P = f(null), [k, D] = p(null), T = (e, t) => C ? e.clientX - t.clientX : e.clientY - t.clientY, O = b.getMetrics(), z = C ? O.getColOffset(o + 1) : O.getRowOffset(o + 1), N = E.getDevicePixelRatio(), F = 1 / N, A = E.snapLineCenter(z, F, N) - F / 2, V = B({
4926
4935
  processTouch: !0,
4927
4936
  onPointerDown: (e) => {
4928
4937
  if (S?.(e), !r && !l) {
4929
- const e = C ? $.getColOffset(o) : $.getRowOffset(o), t = O - e;
4938
+ const e = C ? O.getColOffset(o) : O.getRowOffset(o), t = z - e;
4930
4939
  P.current = {
4931
4940
  isResizing: !1,
4932
4941
  startSize: t,
@@ -4956,7 +4965,7 @@ var Jo = "ew-resize", Qo = "ns-resize", er = i(r((e, t) => {
4956
4965
  isResizing: !0
4957
4966
  }, D(P.current), P.current.onDividerResizeStart?.(P.current.index, Math.max(0, P.current.startSize + o))), e.stopPropagation(), e.preventDefault();
4958
4967
  }
4959
- }), K = z(() => {
4968
+ }), K = $(() => {
4960
4969
  I?.(o);
4961
4970
  }, [o]), { getPortalContainer: _ } = L();
4962
4971
  if (!M) return;
@@ -5161,7 +5170,7 @@ var ur, gr = {
5161
5170
  alignWidth: 1,
5162
5171
  inset: 1
5163
5172
  }, fr = r(function(e, t) {
5164
- const { itemCount: n, renderCell: o, getVisibleCells: r, itemHeight: l = 24, contentWidth: i, selection: s, propsLayer: a, autoFocus: d, showScrollbar: u = "auto", scrollTo: h, viewport: p, cacheToken: m, className: w, style: y, children: b, ...S } = e, E = g(() => new P(), []), I = p ?? E, R = $(I, (e) => e.getMetrics()), M = "auto" === u ? R.totalHeight > R.height : u, k = f(null);
5173
+ const { itemCount: n, renderCell: o, getVisibleCells: r, itemHeight: l = 24, contentWidth: i, selection: s, propsLayer: a, autoFocus: d, showScrollbar: u = "auto", scrollTo: h, viewport: p, cacheToken: m, className: w, style: y, children: b, ...S } = e, E = g(() => new P(), []), I = p ?? E, R = O(I, (e) => e.getMetrics()), M = "auto" === u ? R.totalHeight > R.height : u, k = f(null);
5165
5174
  c(() => {
5166
5175
  d && k.current?.focus();
5167
5176
  }, [d]), c(() => {
@@ -5183,14 +5192,14 @@ var ur, gr = {
5183
5192
  colStart: 0,
5184
5193
  rowEnd: Math.max(0, n - 1),
5185
5194
  colEnd: 0
5186
- }) }), [n]), T = s ?? D, [z, { width: O }] = ne(), [L, { width: N }] = ne(), B = N > 0 && O > 0 ? Math.max(0, N - O) : 0, F = g(() => oe([L, t]), [L, t]), A = le({
5195
+ }) }), [n]), T = s ?? D, [$, { width: z }] = ne(), [L, { width: N }] = ne(), F = N > 0 && z > 0 ? Math.max(0, N - z) : 0, B = g(() => oe([L, t]), [L, t]), A = le({
5187
5196
  rowCount: n,
5188
5197
  columnCount: 1,
5189
5198
  getRowHeight: l,
5190
- getColumnWidth: O || i || R.width || 0
5199
+ getColumnWidth: z || i || R.width || 0
5191
5200
  });
5192
5201
  return x("div", {
5193
- ref: F,
5202
+ ref: B,
5194
5203
  className: H("list-surface", w),
5195
5204
  style: {
5196
5205
  position: "relative",
@@ -5199,7 +5208,7 @@ var ur, gr = {
5199
5208
  maxWidth: "100%",
5200
5209
  maxHeight: "100%",
5201
5210
  ...y,
5202
- ...null != i ? { width: i + B } : null
5211
+ ...null != i ? { width: i + F } : null
5203
5212
  },
5204
5213
  ...S,
5205
5214
  children: x(C, {
@@ -5211,7 +5220,7 @@ var ur, gr = {
5211
5220
  height: "100%"
5212
5221
  },
5213
5222
  children: x("div", {
5214
- ref: z,
5223
+ ref: $,
5215
5224
  style: {
5216
5225
  width: "100%",
5217
5226
  height: "100%"
@@ -5290,40 +5299,49 @@ var ur, gr = {
5290
5299
  tabIndex: -1,
5291
5300
  style: { margin: 0 }
5292
5301
  }), wr = r(function(e, t) {
5293
- const { itemCount: n, isChecked: o, onCheckedChange: r, renderValue: l, renderCheckbox: i = mr, renderDivider: a, selectAllLabel: c, itemHeight: d, selection: u, cacheToken: p, autoFocus: m, viewport: y, className: b, style: S, children: E, ...I } = e, C = g(() => new ro({ getBounds: () => ({
5302
+ const { itemCount: n, isChecked: o, isIndeterminate: r, onCheckedChange: l, renderValue: i, renderCheckbox: a = mr, renderDivider: d, selectAllLabel: u, itemHeight: p, selection: m, cacheToken: y, autoFocus: b, viewport: S, className: E, style: I, children: C, ...R } = e, M = f(n);
5303
+ M.current = n;
5304
+ const P = g(() => new ro({ getBounds: () => ({
5294
5305
  rowStart: 0,
5295
5306
  colStart: 0,
5296
- rowEnd: Math.max(0, n - 1),
5307
+ rowEnd: Math.max(0, M.current - 1),
5297
5308
  colEnd: 0
5298
- }) }), [n]), R = u ?? C, M = z(() => {
5309
+ }) }), []), k = m ?? P;
5310
+ c(() => {
5311
+ 0 !== n && k.getSelection().cell.rowIndex >= n && k.setSelection({ cell: {
5312
+ rowIndex: n - 1,
5313
+ colIndex: 0
5314
+ } });
5315
+ }, [k, n]);
5316
+ const D = $(() => {
5299
5317
  if (0 === n) return;
5300
- const e = !o(R.getSelection().cell.rowIndex);
5301
- r(((e) => {
5318
+ const e = !o(k.getSelection().cell.rowIndex);
5319
+ l(((e) => {
5302
5320
  const t = e.getSelection();
5303
5321
  return t.ranges && t.ranges.length ? t.ranges.flatMap((e) => Array.from({ length: e.rowEnd - e.rowStart + 1 }, (t, n) => e.rowStart + n)) : [t.cell.rowIndex];
5304
- })(R), e);
5322
+ })(k), e);
5305
5323
  }, [
5306
- R,
5324
+ k,
5307
5325
  n,
5308
5326
  o,
5309
- r
5310
- ]), P = f(null), [, k] = h((e) => e + 1, 0), D = z(() => 0 === n ? -1 : R.getSelection().cell.rowIndex, [R, n]), T = z((e) => {
5327
+ l
5328
+ ]), T = f(null), [, O] = h((e) => e + 1, 0), z = $(() => 0 === n ? -1 : k.getSelection().cell.rowIndex, [k, n]), L = $((e) => {
5311
5329
  if (0 === n) return;
5312
- const t = Math.min(Math.max(0, R.getSelection().cell.rowIndex + e), n - 1);
5313
- R.setSelection({ cell: {
5330
+ const t = Math.min(Math.max(0, k.getSelection().cell.rowIndex + e), n - 1);
5331
+ k.setSelection({ cell: {
5314
5332
  rowIndex: t,
5315
5333
  colIndex: 0
5316
- } }), P.current = { row: t }, k();
5317
- }, [R, n]), $ = N(t, () => ({
5334
+ } }), T.current = { row: t }, O();
5335
+ }, [k, n]), F = N(t, () => ({
5318
5336
  isCheckboxList: () => !0,
5319
- getHighlightIndex: D,
5320
- moveHighlight: T,
5321
- toggleHighlighted: M
5337
+ getHighlightIndex: z,
5338
+ moveHighlight: L,
5339
+ toggleHighlighted: D
5322
5340
  }), [
5323
- D,
5324
- T,
5325
- M
5326
- ]), O = s((e) => v("div", {
5341
+ z,
5342
+ L,
5343
+ D
5344
+ ]), B = s((e) => v("div", {
5327
5345
  style: {
5328
5346
  display: "flex",
5329
5347
  alignItems: "center",
@@ -5334,30 +5352,31 @@ var ur, gr = {
5334
5352
  cursor: "pointer"
5335
5353
  },
5336
5354
  onMouseDown: (t) => {
5337
- t.preventDefault(), r([e], !o(e));
5355
+ t.preventDefault(), l([e], !o(e));
5338
5356
  },
5339
5357
  children: [x("div", {
5340
5358
  style: {
5341
5359
  display: "inline-flex",
5342
5360
  pointerEvents: "none"
5343
5361
  },
5344
- children: i(o(e))
5362
+ children: a(o(e), r?.(e))
5345
5363
  }), x("div", {
5346
5364
  style: {
5347
5365
  overflow: "hidden",
5348
5366
  textOverflow: "ellipsis"
5349
5367
  },
5350
- children: l(e)
5368
+ children: i(e)
5351
5369
  })]
5352
5370
  }), [
5353
5371
  o,
5354
5372
  r,
5355
5373
  l,
5356
- i
5357
- ]), L = s((e) => {
5358
- " " !== e.key && "Enter" !== e.key || (e.preventDefault(), e.stopPropagation(), M());
5359
- }, [M]), { allChecked: B, someChecked: F } = g(() => {
5360
- if (null == c || 0 === n) return {
5374
+ i,
5375
+ a
5376
+ ]), A = s((e) => {
5377
+ " " !== e.key && "Enter" !== e.key || (e.preventDefault(), e.stopPropagation(), D());
5378
+ }, [D]), { allChecked: V, someChecked: K } = g(() => {
5379
+ if (null == u || 0 === n) return {
5361
5380
  allChecked: !1,
5362
5381
  someChecked: !1
5363
5382
  };
@@ -5368,22 +5387,22 @@ var ur, gr = {
5368
5387
  someChecked: t && !e
5369
5388
  };
5370
5389
  }, [
5371
- c,
5390
+ u,
5372
5391
  n,
5373
5392
  o,
5374
- p
5393
+ y
5375
5394
  ]);
5376
5395
  return v("div", {
5377
- ref: $,
5378
- className: H("checkbox-list", b),
5396
+ ref: F,
5397
+ className: H("checkbox-list", E),
5379
5398
  style: {
5380
5399
  display: "flex",
5381
5400
  flexDirection: "column",
5382
5401
  minHeight: 0,
5383
- ...S
5402
+ ...I
5384
5403
  },
5385
- ...I,
5386
- children: [null != c && v(w, { children: [v("div", {
5404
+ ...R,
5405
+ children: [null != u && v(w, { children: [v("div", {
5387
5406
  style: {
5388
5407
  display: "flex",
5389
5408
  alignItems: "center",
@@ -5393,25 +5412,25 @@ var ur, gr = {
5393
5412
  cursor: "pointer"
5394
5413
  },
5395
5414
  onMouseDown: (e) => {
5396
- e.preventDefault(), r(Array.from({ length: n }, (e, t) => t), !B);
5415
+ e.preventDefault(), l(Array.from({ length: n }, (e, t) => t), !V);
5397
5416
  },
5398
5417
  children: [x("div", {
5399
5418
  style: {
5400
5419
  display: "inline-flex",
5401
5420
  pointerEvents: "none"
5402
5421
  },
5403
- children: i(B, F)
5404
- }), c]
5405
- }), a?.()] }), x(pr, {
5422
+ children: a(V, K)
5423
+ }), u]
5424
+ }), d?.()] }), x(pr, {
5406
5425
  itemCount: n,
5407
- itemHeight: d,
5408
- selection: R,
5409
- renderItem: O,
5410
- onKeyDown: L,
5411
- cacheToken: p,
5412
- scrollTo: P.current,
5413
- autoFocus: m,
5414
- viewport: y,
5426
+ itemHeight: p,
5427
+ selection: k,
5428
+ renderItem: B,
5429
+ onKeyDown: A,
5430
+ cacheToken: y,
5431
+ scrollTo: T.current,
5432
+ autoFocus: b,
5433
+ viewport: S,
5415
5434
  style: {
5416
5435
  flex: "1 1 100%",
5417
5436
  minHeight: 0
@@ -5447,18 +5466,18 @@ var ur, gr = {
5447
5466
  n,
5448
5467
  E,
5449
5468
  S
5450
- ]), C = f(null), [, R] = h((e) => e + 1, 0), M = g(() => (C.current = null, E >= 0 ? { row: E } : null), [n, E]), P = C.current ?? M, k = z((e) => !(e < 0 || e >= S) && (o?.(e, n[e]), !0), [
5469
+ ]), C = f(null), [, R] = h((e) => e + 1, 0), M = g(() => (C.current = null, E >= 0 ? { row: E } : null), [n, E]), P = C.current ?? M, k = $((e) => !(e < 0 || e >= S) && (o?.(e, n[e]), !0), [
5451
5470
  o,
5452
5471
  n,
5453
5472
  S
5454
- ]), D = z(() => 0 === S ? -1 : I.getSelection().cell.rowIndex, [I, S]), T = z((e) => {
5473
+ ]), D = $(() => 0 === S ? -1 : I.getSelection().cell.rowIndex, [I, S]), T = $((e) => {
5455
5474
  if (0 === S) return;
5456
5475
  const t = vr(I.getSelection().cell.rowIndex + e, S);
5457
5476
  I.setSelection({ cell: {
5458
5477
  rowIndex: t,
5459
5478
  colIndex: 0
5460
5479
  } }), C.current = { row: t }, R();
5461
- }, [I, S]), $ = N(t, () => ({
5480
+ }, [I, S]), O = N(t, () => ({
5462
5481
  isPickList: () => !0,
5463
5482
  getHighlightIndex: D,
5464
5483
  moveHighlight: T,
@@ -5467,7 +5486,7 @@ var ur, gr = {
5467
5486
  D,
5468
5487
  T,
5469
5488
  k
5470
- ]), O = g(() => {
5489
+ ]), z = g(() => {
5471
5490
  if (c) return c;
5472
5491
  const e = ((e) => {
5473
5492
  const t = e?.fontSize, n = e?.fontFamily, o = "number" == typeof t ? `${t}px` : t ?? "16px", r = [];
@@ -5477,14 +5496,14 @@ var ur, gr = {
5477
5496
  }, [c, w]), L = g(() => {
5478
5497
  if (null != a) return a;
5479
5498
  let e = 0;
5480
- for (let t = 0; t < S; t++) e = Math.max(e, O(n[t].text));
5499
+ for (let t = 0; t < S; t++) e = Math.max(e, z(n[t].text));
5481
5500
  return Math.ceil(e) + 16;
5482
5501
  }, [
5483
5502
  a,
5484
5503
  n,
5485
5504
  S,
5486
- O
5487
- ]), B = s((e) => {
5505
+ z
5506
+ ]), F = s((e) => {
5488
5507
  const { key: t, style: o, range: r, cell: l } = e, i = r?.rowStart ?? l.rowIndex, s = n[i];
5489
5508
  return s ? x("div", {
5490
5509
  role: "option",
@@ -5509,7 +5528,7 @@ var ur, gr = {
5509
5528
  children: s.text || "\xA0"
5510
5529
  })
5511
5530
  }, t) : null;
5512
- }, [n, d]), F = g(() => ({
5531
+ }, [n, d]), B = g(() => ({
5513
5532
  onPointerUp: (e) => {
5514
5533
  0 === e.button && k(D());
5515
5534
  },
@@ -5518,7 +5537,7 @@ var ur, gr = {
5518
5537
  }
5519
5538
  }), [k, D]);
5520
5539
  return x(fr, {
5521
- ref: $,
5540
+ ref: O,
5522
5541
  className: H("pick-list", m),
5523
5542
  role: "listbox",
5524
5543
  style: {
@@ -5529,8 +5548,8 @@ var ur, gr = {
5529
5548
  itemHeight: l,
5530
5549
  contentWidth: L,
5531
5550
  selection: I,
5532
- renderCell: B,
5533
- propsLayer: F,
5551
+ renderCell: F,
5552
+ propsLayer: B,
5534
5553
  scrollTo: P,
5535
5554
  viewport: p,
5536
5555
  autoFocus: u,
@@ -5594,4 +5613,4 @@ var ur, gr = {
5594
5613
  scope: r
5595
5614
  });
5596
5615
  };
5597
- export { rn as AUTO_SCROLL_INTERVAL_MS, jn as CellLayer, Un as CellTileDiv, wr as CheckboxList, po as DEFAULT_ANCHOR_STYLE, en as DEFAULT_HANDLE_STYLE, wo as DEFAULT_INSERT_BAR_STYLE, xo as DEFAULT_MOVE_SOURCE_STYLE, fo as DEFAULT_MULTI_STYLE, mo as DEFAULT_REMOVE_PREVIEW_STYLE, ho as DEFAULT_SINGLE_STYLE, Ln as DefaultCellRenderer, Wo as DefaultEditable, Xo as DefaultEditorInput, er as DefaultHeaderDivider, ro as DefaultSelection, wn as DragHandle, Rn as Draggable, ln as EDGE_AUTO_SCROLL_MARGIN_PX, Ao as EditSession, Zo as EditorDiv, Yo as EditorLayer, qo as EditorStartLayer, On as FillHandle, Ir as GRID_SURFACE, dr as Grid, Ot as GridFloatPanel, He as GridSurface, to as GridlineLayer, Cr as HEADER_SURFACE, nr as HeaderDividerAnchor, Ut as HoverTipLayer, nt as Layer, ae as LineSVG, pr as List, Er as ListSearch, fr as ListSurface, an as NO_DRAG_MODIFIERS, zo as PICKER_COLORS, yr as PickList, Pn as RESIZE_ANCHORS_4, kn as RESIZE_ANCHORS_8, Wt as RangeFloatLayer, nn as RangeInsertBar, Qt as RangePrompt, tn as RangeRect, Dn as RangeResizer, Bo as RangesPickerLayer, ce as RectangleSVG, oo as SELECTION_CLIP_INSETS, Do as SelectionLayer, yo as SelectionTouchGrips, ie as ShapeBoundsContext, Ct as StickyAnchor, Tt as StickyFloat, Fe as SurfaceStateContext, Ae as SurfaceStateProvider, st as VirtualDiv, Pr as buildGridThemeCSS, Ko as commitArgsFromKey, re as createAxis, gn as createDragCells, sr as createHeaderSelectionPointer, Be as createSurfaceStateStore, hn as createWindowDragCells, No as defaultRangeStyle, sn as edgeScrollPane, Uo as expandEditorBounds, Sr as filterByText, Rr as gridThemeVars, lr as headerAnchorCell, rr as headerEntireEnd, or as headerEntireStart, ir as headerRange, Mr as headerThemeVars, En as insertAt, Cn as insertRange, dn as isSameDragModifiers, cn as readDragModifiers, Nt as renderGridFloatPanel, $n as resolveFillDestination, Vo as startEventFromKey, mn as useDoubleClick, fn as useDragCells, _o as useEditorKeymap, Pt as useGridFloatTheme, le as useGridMetrics, Je as useGridPane, Qe as useGridPaneOptional, ar as useHeaderSelectionPointer, Ft as useHoverIntent, tt as useLayer, Ho as usePendingCaret, At as useRangeHover, vo as useSelectionPointer, se as useShapeBounds, Et as useSticky, It as useStickyOptional, et as useSurfaceState, pn as useWindowDragCells, zn as vacatedByFill };
5616
+ export { rn as AUTO_SCROLL_INTERVAL_MS, jn as CellLayer, Un as CellTileDiv, wr as CheckboxList, po as DEFAULT_ANCHOR_STYLE, en as DEFAULT_HANDLE_STYLE, wo as DEFAULT_INSERT_BAR_STYLE, xo as DEFAULT_MOVE_SOURCE_STYLE, fo as DEFAULT_MULTI_STYLE, mo as DEFAULT_REMOVE_PREVIEW_STYLE, ho as DEFAULT_SINGLE_STYLE, Ln as DefaultCellRenderer, Wo as DefaultEditable, Xo as DefaultEditorInput, er as DefaultHeaderDivider, ro as DefaultSelection, wn as DragHandle, Rn as Draggable, ln as EDGE_AUTO_SCROLL_MARGIN_PX, Ao as EditSession, Zo as EditorDiv, Yo as EditorLayer, qo as EditorStartLayer, zn as FillHandle, Ir as GRID_SURFACE, dr as Grid, zt as GridFloatPanel, He as GridSurface, to as GridlineLayer, Cr as HEADER_SURFACE, nr as HeaderDividerAnchor, Ut as HoverTipLayer, nt as Layer, ae as LineSVG, pr as List, Er as ListSearch, fr as ListSurface, an as NO_DRAG_MODIFIERS, $o as PICKER_COLORS, yr as PickList, Pn as RESIZE_ANCHORS_4, kn as RESIZE_ANCHORS_8, Wt as RangeFloatLayer, nn as RangeInsertBar, Qt as RangePrompt, tn as RangeRect, Dn as RangeResizer, Fo as RangesPickerLayer, ce as RectangleSVG, oo as SELECTION_CLIP_INSETS, Do as SelectionLayer, yo as SelectionTouchGrips, ie as ShapeBoundsContext, Ct as StickyAnchor, Tt as StickyFloat, Be as SurfaceStateContext, Ae as SurfaceStateProvider, st as VirtualDiv, Pr as buildGridThemeCSS, Ko as commitArgsFromKey, re as createAxis, gn as createDragCells, sr as createHeaderSelectionPointer, Fe as createSurfaceStateStore, hn as createWindowDragCells, No as defaultRangeStyle, sn as edgeScrollPane, Uo as expandEditorBounds, Sr as filterByText, Rr as gridThemeVars, lr as headerAnchorCell, rr as headerEntireEnd, or as headerEntireStart, ir as headerRange, Mr as headerThemeVars, En as insertAt, Cn as insertRange, dn as isSameDragModifiers, cn as readDragModifiers, Nt as renderGridFloatPanel, On as resolveFillDestination, Vo as startEventFromKey, mn as useDoubleClick, fn as useDragCells, _o as useEditorKeymap, Pt as useGridFloatTheme, le as useGridMetrics, Je as useGridPane, Qe as useGridPaneOptional, ar as useHeaderSelectionPointer, Bt as useHoverIntent, tt as useLayer, Ho as usePendingCaret, At as useRangeHover, vo as useSelectionPointer, se as useShapeBounds, Et as useSticky, It as useStickyOptional, et as useSurfaceState, pn as useWindowDragCells, $n as vacatedByFill };