@sheetxl/grid-react 0.8.0-beta.5 → 0.8.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -3
- package/browser/cjs/index.cjs +3 -2
- package/browser/esm/index.mjs +356 -341
- package/node/esm/index.mjs +361 -346
- package/package.json +3 -3
- package/types/src/editor/EditorLayer.d.ts +9 -4
- package/types/src/editor/EditorStartLayer.d.ts +32 -0
- package/types/src/editor/index.d.ts +1 -0
- package/types/src/layer/RangeFloatLayer.d.ts +5 -0
package/node/esm/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/grid-react - Grid React - Advanced grid component for React - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/grid-react - Grid React - Advanced grid component for React - v0.8.0-beta.7
|
|
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
|
|
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,
|
|
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
|
-
},
|
|
134
|
+
}, $ = e.gapColor;
|
|
135
135
|
}
|
|
136
|
-
const
|
|
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:
|
|
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: [
|
|
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:
|
|
176
|
-
stroke:
|
|
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:
|
|
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 =
|
|
379
|
+
const R = $((e) => {
|
|
380
380
|
C("pointerdown", e, d.current);
|
|
381
|
-
}, []), M =
|
|
381
|
+
}, []), M = $((e) => {
|
|
382
382
|
C("pointermove", e, d.current);
|
|
383
|
-
}, []), P =
|
|
383
|
+
}, []), P = $((e) => {
|
|
384
384
|
C("pointerup", e, d.current);
|
|
385
|
-
}, []), k =
|
|
385
|
+
}, []), k = $((e) => {
|
|
386
386
|
C("pointerleave", e, d.current);
|
|
387
|
-
}, []), D =
|
|
387
|
+
}, []), D = $((e) => {
|
|
388
388
|
C("mousedown", e, d.current);
|
|
389
|
-
}, []), T =
|
|
389
|
+
}, []), T = $((e) => {
|
|
390
390
|
C("mouseenter", e, d.current);
|
|
391
|
-
}, []),
|
|
391
|
+
}, []), O = $((e) => {
|
|
392
392
|
C("mouseleave", e, d.current);
|
|
393
|
-
}, []),
|
|
393
|
+
}, []), z = $((e) => {
|
|
394
394
|
C("mousemove", e, d.current);
|
|
395
|
-
}, []), L =
|
|
395
|
+
}, []), L = $((e) => {
|
|
396
396
|
C("mouseout", e, d.current);
|
|
397
|
-
}, []),
|
|
397
|
+
}, []), F = $((e) => {
|
|
398
398
|
C("mouseover", e, d.current);
|
|
399
|
-
}, []),
|
|
399
|
+
}, []), B = $((e) => {
|
|
400
400
|
C("mouseup", e, d.current);
|
|
401
|
-
}, []), A =
|
|
401
|
+
}, []), A = $((e) => {
|
|
402
402
|
C("dblclick", e, d.current);
|
|
403
|
-
}, []), V =
|
|
403
|
+
}, []), V = $((e) => {
|
|
404
404
|
C("keydown", e, d.current);
|
|
405
|
-
}, []), K =
|
|
405
|
+
}, []), K = $((e) => {
|
|
406
406
|
C("keypress", e, d.current);
|
|
407
|
-
}, []), _ =
|
|
407
|
+
}, []), _ = $((e) => {
|
|
408
408
|
C("keyup", e, d.current);
|
|
409
|
-
}, []), W =
|
|
409
|
+
}, []), W = $((e) => {
|
|
410
410
|
o?.(e), C("focus", e, d.current);
|
|
411
|
-
}, [o]), U =
|
|
411
|
+
}, [o]), U = $((e) => {
|
|
412
412
|
r?.(e), C("blur", e, d.current);
|
|
413
|
-
}, [r]), j =
|
|
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:
|
|
432
|
+
onMouseLeave: O,
|
|
433
|
+
onMouseMove: z,
|
|
434
434
|
onMouseOut: L,
|
|
435
|
-
onMouseOver:
|
|
436
|
-
onMouseUp:
|
|
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
|
-
},
|
|
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) =>
|
|
633
|
-
getVisibleRows: (e, 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 <
|
|
657
|
-
const t = o[
|
|
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
|
-
},
|
|
683
|
+
}, Oe = [
|
|
684
684
|
_.TopLeft,
|
|
685
685
|
_.Top,
|
|
686
686
|
_.Left,
|
|
687
687
|
_.Center
|
|
688
|
-
],
|
|
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
|
-
},
|
|
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,
|
|
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
|
-
},
|
|
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
|
-
},
|
|
738
|
-
const n = a(
|
|
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 =
|
|
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:
|
|
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 =
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
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) =>
|
|
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 =
|
|
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
|
|
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 =
|
|
989
|
+
}, []), Le = $((e, t) => {
|
|
990
990
|
if (1 === Object.keys(Se).length) return Se[_.Center];
|
|
991
|
-
const n =
|
|
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
|
|
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
|
-
}, []),
|
|
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 =
|
|
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 =
|
|
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:
|
|
1099
|
+
scrollBy: Fe,
|
|
1100
1100
|
scrollCellCoordsIntoView: Je,
|
|
1101
1101
|
getPaneFromClient: Le,
|
|
1102
1102
|
getPaneFromCell: He,
|
|
1103
|
-
getPane:
|
|
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,
|
|
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
|
-
...
|
|
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(
|
|
1264
|
-
o.current || (o.current =
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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),
|
|
1631
|
-
dx:
|
|
1632
|
-
dy:
|
|
1633
|
-
distance: Math.hypot(z
|
|
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 =
|
|
1809
|
-
|
|
1810
|
-
|
|
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:
|
|
1813
|
-
attrs:
|
|
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
|
|
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
|
-
},
|
|
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 =
|
|
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,
|
|
1897
|
+
I(e), C(e, $t), R(), M();
|
|
1890
1898
|
return;
|
|
1891
1899
|
}
|
|
1892
1900
|
P(), k();
|
|
1893
1901
|
}, [t]);
|
|
1894
|
-
const D =
|
|
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:
|
|
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
|
-
|
|
1929
|
+
zt.displayName = "GridFloatPanel";
|
|
1922
1930
|
var Lt = ({ outOfView: e, close: t }) => (c(() => {
|
|
1923
1931
|
e && t();
|
|
1924
|
-
}, [e]), null), Nt = (e) => x(
|
|
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:
|
|
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 } =
|
|
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 } =
|
|
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),
|
|
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]),
|
|
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 =
|
|
2024
|
-
let
|
|
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 && (
|
|
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 :
|
|
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 ?
|
|
2033
|
-
onPointerLeave: E ?
|
|
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
|
-
}),
|
|
2494
|
-
if (
|
|
2495
|
-
const
|
|
2496
|
-
let L = bn(
|
|
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
|
|
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
|
-
},
|
|
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
|
-
...
|
|
2534
|
-
style:
|
|
2542
|
+
...B,
|
|
2543
|
+
style: F
|
|
2535
2544
|
}
|
|
2536
2545
|
}) }) : x("div", {
|
|
2537
|
-
...
|
|
2546
|
+
...B,
|
|
2538
2547
|
style: {
|
|
2539
|
-
...
|
|
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(),
|
|
2685
|
-
x:
|
|
2686
|
-
y:
|
|
2687
|
-
width:
|
|
2688
|
-
height:
|
|
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
|
-
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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,
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
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 =
|
|
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
|
-
}) :
|
|
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
|
|
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)}`,
|
|
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
|
-
]),
|
|
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 &&
|
|
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(
|
|
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:
|
|
3860
|
-
q.current =
|
|
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);
|
|
@@ -4087,20 +4096,20 @@ var Mo = (e, t) => void 0 === t ? e : null === t ? null : {
|
|
|
4087
4096
|
getRegionBounds: (e) => oe.current?.(e) ?? null
|
|
4088
4097
|
}), []);
|
|
4089
4098
|
e.useImperativeHandle(n, () => le, [le]);
|
|
4090
|
-
const ie = !!j.ranges && j.ranges.length > 0, se = ie ? [...j.ranges] : [U.cellToRange(j.cell)], ae = se.length > 1, ce = j.rangeIndex ?? -1, de = ie ? ce >= 0 ? ce : se.length - 1 : 0, ue = Q.getRangeFromCell(j.cell), ge =
|
|
4099
|
+
const ie = !!j.ranges && j.ranges.length > 0, se = ie ? [...j.ranges] : [U.cellToRange(j.cell)], ae = se.length > 1, ce = j.rangeIndex ?? -1, de = ie ? ce >= 0 ? ce : se.length - 1 : 0, ue = Q.getRangeFromCell(j.cell), ge = se[de] ?? U.cellToRange(j.cell), he = ue && U.isRangeWithinRange(ge, ue) ? ue : ge, fe = U.intersectRanges(ue, he) ?? U.cellToRange(j.cell), pe = se.filter((e, t) => t !== de), me = ae ? Po(fo, a) : Po(ho, s), we = {
|
|
4091
4100
|
...po,
|
|
4092
4101
|
...c
|
|
4093
|
-
},
|
|
4102
|
+
}, xe = Po(mo, u), { refusedColor: ve, ...ye } = {
|
|
4094
4103
|
...wo,
|
|
4095
4104
|
...g
|
|
4096
|
-
},
|
|
4105
|
+
}, be = null === f ? null : Po(xo, f), Se = (e, t) => {
|
|
4097
4106
|
const n = t.mods.shiftKey ? t.insert : null, o = t.mods.ctrlKey || t.mods.metaKey, r = n ? Cn(e, n, Q.getTotalRange()) : e, l = {
|
|
4098
4107
|
to: r,
|
|
4099
4108
|
copy: o,
|
|
4100
4109
|
insert: n?.axis
|
|
4101
4110
|
};
|
|
4102
|
-
return l.refused = !!n && !o && (h ? h(
|
|
4103
|
-
},
|
|
4111
|
+
return l.refused = !!n && !o && (h ? h(he, l) : U.isRefusedInsertCut(U.classifyInsertCut(he, r, n.axis))), l;
|
|
4112
|
+
}, Ee = (e) => {
|
|
4104
4113
|
const t = o.getSelection(), n = t.ranges, r = !!n && n.length > 0, l = r ? void 0 !== t.rangeIndex && t.rangeIndex >= 0 && t.rangeIndex < n.length ? t.rangeIndex : n.length - 1 : 0, i = r ? n.map((t, n) => n === l ? e : t) : [e], s = U.isCellWithinRange(t.cell, e) ? t.cell : {
|
|
4105
4114
|
rowIndex: e.rowStart,
|
|
4106
4115
|
colIndex: e.colStart
|
|
@@ -4110,16 +4119,16 @@ var Mo = (e, t) => void 0 === t ? e : null === t ? null : {
|
|
|
4110
4119
|
ranges: i,
|
|
4111
4120
|
rangeIndex: l
|
|
4112
4121
|
});
|
|
4113
|
-
},
|
|
4122
|
+
}, Ie = Z ?? ("extend" === Y.dragMode ? {
|
|
4114
4123
|
kind: "select",
|
|
4115
|
-
range:
|
|
4116
|
-
} : null),
|
|
4124
|
+
range: he
|
|
4125
|
+
} : null), Ce = Ie && A ? A(Ie) : null, Re = e.Children.map(ae ? m : p, (t) => {
|
|
4117
4126
|
if (!e.isValidElement(t)) return t;
|
|
4118
4127
|
const n = t.props;
|
|
4119
4128
|
return e.cloneElement(t, {
|
|
4120
|
-
range:
|
|
4129
|
+
range: he,
|
|
4121
4130
|
onDragEnd: (e, t) => {
|
|
4122
|
-
n.onDragEnd?.(e, t),
|
|
4131
|
+
n.onDragEnd?.(e, t), Ee(e);
|
|
4123
4132
|
}
|
|
4124
4133
|
});
|
|
4125
4134
|
});
|
|
@@ -4132,43 +4141,43 @@ var Mo = (e, t) => void 0 === t ? e : null === t ? null : {
|
|
|
4132
4141
|
le.handleKey(e) && (e.preventDefault(), e.stopPropagation());
|
|
4133
4142
|
},
|
|
4134
4143
|
children: [
|
|
4135
|
-
"move" === Z?.kind && !Z.drop.copy &&
|
|
4144
|
+
"move" === Z?.kind && !Z.drop.copy && be && !U.isEqualRanges(Z.to, Z.from) && To(be, Z.from, void 0, !1, "move-source"),
|
|
4136
4145
|
v(w, ae ? { children: [
|
|
4137
|
-
|
|
4138
|
-
To(
|
|
4146
|
+
pe.map((t, n) => x(e.Fragment, { children: To(me, t) }, `other-${n}`)),
|
|
4147
|
+
To(me, he, K ? fe : void 0),
|
|
4139
4148
|
x(tn, {
|
|
4140
4149
|
className: "anchor",
|
|
4141
|
-
range:
|
|
4142
|
-
...
|
|
4150
|
+
range: fe,
|
|
4151
|
+
...we
|
|
4143
4152
|
})
|
|
4144
|
-
] } : { children: [To(
|
|
4153
|
+
] } : { children: [To(me, he, K ? fe : void 0), d && x(tn, {
|
|
4145
4154
|
className: "anchor",
|
|
4146
|
-
range:
|
|
4155
|
+
range: fe,
|
|
4147
4156
|
...d
|
|
4148
4157
|
})] }),
|
|
4149
4158
|
!ae && y && x(Rn, {
|
|
4150
4159
|
className: "move-grip",
|
|
4151
|
-
range:
|
|
4160
|
+
range: he,
|
|
4152
4161
|
grip: "edges",
|
|
4153
4162
|
dragCursor: R,
|
|
4154
4163
|
renderMove: (e, t) => {
|
|
4155
|
-
const n =
|
|
4164
|
+
const n = Se(e, t);
|
|
4156
4165
|
return n.insert ? x(nn, {
|
|
4157
4166
|
range: n.to,
|
|
4158
4167
|
axis: n.insert,
|
|
4159
|
-
...
|
|
4160
|
-
color: (n.refused ?
|
|
4161
|
-
}) :
|
|
4168
|
+
...ye,
|
|
4169
|
+
color: (n.refused ? ve : void 0) ?? ye.color
|
|
4170
|
+
}) : me.border && x(tn, {
|
|
4162
4171
|
className: "move-ghost",
|
|
4163
4172
|
range: n.to,
|
|
4164
|
-
...
|
|
4173
|
+
...me.border,
|
|
4165
4174
|
animatedTransition: !0,
|
|
4166
4175
|
style: { opacity: .6 }
|
|
4167
4176
|
});
|
|
4168
4177
|
},
|
|
4169
4178
|
onEdgeDoubleClick: N,
|
|
4170
4179
|
onDragStart: (e, t, n) => {
|
|
4171
|
-
const o =
|
|
4180
|
+
const o = Se(e, n);
|
|
4172
4181
|
E?.(e, t, o), J({
|
|
4173
4182
|
kind: "move",
|
|
4174
4183
|
from: e,
|
|
@@ -4177,10 +4186,10 @@ var Mo = (e, t) => void 0 === t ? e : null === t ? null : {
|
|
|
4177
4186
|
});
|
|
4178
4187
|
},
|
|
4179
4188
|
onDragMove: (e, t, n) => {
|
|
4180
|
-
const o =
|
|
4181
|
-
I?.(
|
|
4189
|
+
const o = Se(e, n);
|
|
4190
|
+
I?.(he, o.to, t, o), J({
|
|
4182
4191
|
kind: "move",
|
|
4183
|
-
from:
|
|
4192
|
+
from: he,
|
|
4184
4193
|
to: o.to,
|
|
4185
4194
|
drop: o
|
|
4186
4195
|
});
|
|
@@ -4189,8 +4198,8 @@ var Mo = (e, t) => void 0 === t ? e : null === t ? null : {
|
|
|
4189
4198
|
e || (C?.(), J(null));
|
|
4190
4199
|
},
|
|
4191
4200
|
onDragEnd: (e, t, n) => {
|
|
4192
|
-
const r =
|
|
4193
|
-
r.refused || (b?.(
|
|
4201
|
+
const r = Se(e, n);
|
|
4202
|
+
r.refused || (b?.(he, r.to, t, r), o.modify({
|
|
4194
4203
|
rowIndex: r.to.rowEnd,
|
|
4195
4204
|
colIndex: r.to.colEnd
|
|
4196
4205
|
}, {
|
|
@@ -4199,10 +4208,10 @@ var Mo = (e, t) => void 0 === t ? e : null === t ? null : {
|
|
|
4199
4208
|
}));
|
|
4200
4209
|
}
|
|
4201
4210
|
}),
|
|
4202
|
-
!ae && M && x(
|
|
4203
|
-
range:
|
|
4211
|
+
!ae && M && x(zn, {
|
|
4212
|
+
range: he,
|
|
4204
4213
|
snapDestination: P,
|
|
4205
|
-
...
|
|
4214
|
+
...me.border,
|
|
4206
4215
|
onDragStart: (e, t) => {
|
|
4207
4216
|
D?.(e, t), J({
|
|
4208
4217
|
kind: "fill",
|
|
@@ -4211,41 +4220,41 @@ var Mo = (e, t) => void 0 === t ? e : null === t ? null : {
|
|
|
4211
4220
|
});
|
|
4212
4221
|
},
|
|
4213
4222
|
onDragMove: (e, t) => {
|
|
4214
|
-
T?.(
|
|
4223
|
+
T?.(he, e, t), J({
|
|
4215
4224
|
kind: "fill",
|
|
4216
|
-
template:
|
|
4225
|
+
template: he,
|
|
4217
4226
|
destination: e
|
|
4218
4227
|
});
|
|
4219
4228
|
},
|
|
4220
4229
|
onDragEnd: (e, t) => {
|
|
4221
|
-
k?.(
|
|
4230
|
+
k?.(he, e, t), Ee(e);
|
|
4222
4231
|
},
|
|
4223
|
-
onMenu:
|
|
4224
|
-
|
|
4232
|
+
onMenu: z ? (e, t, n) => {
|
|
4233
|
+
z(he, e, t, n);
|
|
4225
4234
|
} : void 0,
|
|
4226
4235
|
onDragDone: () => {
|
|
4227
|
-
|
|
4236
|
+
$?.(), J(null);
|
|
4228
4237
|
},
|
|
4229
4238
|
onDoubleClick: L ? (e, t) => {
|
|
4230
4239
|
const n = L(e);
|
|
4231
|
-
n && !U.isEqualRanges(n, e) && (k?.(e, n, t),
|
|
4240
|
+
n && !U.isEqualRanges(n, e) && (k?.(e, n, t), Ee(n));
|
|
4232
4241
|
} : void 0
|
|
4233
4242
|
}),
|
|
4234
|
-
Y.removePreview && To(
|
|
4235
|
-
|
|
4236
|
-
null !=
|
|
4243
|
+
Y.removePreview && To(xe, Y.removePreview, void 0, !1, "remove-preview"),
|
|
4244
|
+
Re,
|
|
4245
|
+
null != Ce && Ie && x(Tt, {
|
|
4237
4246
|
className: "gesture-tip",
|
|
4238
|
-
anchor: { range: (
|
|
4247
|
+
anchor: { range: (Me = Ie, "move" === Me.kind ? Me.to : "fill" === Me.kind ? Me.destination : Me.range) },
|
|
4239
4248
|
placement: V ?? ko,
|
|
4240
4249
|
offset: 8,
|
|
4241
4250
|
whenOff: "clamp",
|
|
4242
4251
|
open: !0,
|
|
4243
4252
|
style: { pointerEvents: "none" },
|
|
4244
|
-
children:
|
|
4253
|
+
children: Ce
|
|
4245
4254
|
})
|
|
4246
4255
|
]
|
|
4247
4256
|
});
|
|
4248
|
-
var
|
|
4257
|
+
var Me;
|
|
4249
4258
|
});
|
|
4250
4259
|
Do.displayName = "SelectionLayer";
|
|
4251
4260
|
var To = (e, t, n, o = !1, r = "range") => v(w, { children: [
|
|
@@ -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
|
-
] }),
|
|
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
|
-
],
|
|
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:
|
|
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 =
|
|
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
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
4332
|
-
for (let e = 0; 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(),
|
|
4349
|
+
e.stopPropagation(), u && e.preventDefault(), F.onPointerDown(e);
|
|
4341
4350
|
},
|
|
4342
|
-
onPointerMove:
|
|
4351
|
+
onPointerMove: F.onPointerMove,
|
|
4343
4352
|
onPointerUp: (e) => {
|
|
4344
|
-
e.stopPropagation(),
|
|
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) =>
|
|
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 ===
|
|
4360
|
-
const o = e.stroke ?? h.stroke ??
|
|
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
|
-
})(
|
|
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) =>
|
|
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
|
-
|
|
4391
|
-
var
|
|
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: ++
|
|
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]),
|
|
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
|
|
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,91 +4729,97 @@ 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 =
|
|
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 =
|
|
4726
|
-
if (t.getSession()) return;
|
|
4727
|
-
const n = t.getAnchor().getCoords();
|
|
4728
|
-
if (!n) return;
|
|
4729
|
-
const o = Vo(e.nativeEvent);
|
|
4730
|
-
o && ("Process" !== e.nativeEvent.key && 229 !== e.nativeEvent.keyCode && e.preventDefault(), e.stopPropagation(), t.startEdit(n, o));
|
|
4731
|
-
}, [t]), b = z((e) => {
|
|
4732
|
-
if (t.getSession()) return;
|
|
4733
|
-
const n = g?.getCellFromPointer(e.clientX, e.clientY) ?? t.getAnchor().getCoords();
|
|
4734
|
-
n && t.startEdit(n, { mode: "edit" });
|
|
4735
|
-
}, [g, t]), S = z((e) => {
|
|
4734
|
+
}, []), y = $((e) => {
|
|
4736
4735
|
const n = t.commit(e);
|
|
4737
4736
|
return n && g?.focus(), n;
|
|
4738
|
-
}, [t, g]),
|
|
4737
|
+
}, [t, g]), b = $(() => {
|
|
4739
4738
|
t.cancel(), g?.focus();
|
|
4740
4739
|
}, [t, g]);
|
|
4741
4740
|
c(() => {
|
|
4742
4741
|
f && g && g.scrollCellCoordsIntoView(f.coords);
|
|
4743
4742
|
}, [f?.token]);
|
|
4744
|
-
const
|
|
4745
|
-
let
|
|
4746
|
-
if (g &&
|
|
4747
|
-
const e = g.getRangeFromCell(
|
|
4748
|
-
if (
|
|
4743
|
+
const S = f ? f.coords : t.getAnchor().getCoords();
|
|
4744
|
+
let E = null, I = !1, C = !1;
|
|
4745
|
+
if (g && S) {
|
|
4746
|
+
const e = g.getRangeFromCell(S);
|
|
4747
|
+
if (C = null !== g.toClipBounds(g.getBoundsFromRange({
|
|
4749
4748
|
rowStart: e.rowStart,
|
|
4750
4749
|
colStart: e.colStart,
|
|
4751
4750
|
rowEnd: e.rowStart,
|
|
4752
4751
|
colEnd: e.colStart
|
|
4753
4752
|
})), f) {
|
|
4754
|
-
const e = Uo(g,
|
|
4755
|
-
|
|
4756
|
-
} else
|
|
4753
|
+
const e = Uo(g, S, m, o, i);
|
|
4754
|
+
E = e?.bounds ?? null, I = e?.inView ?? !1;
|
|
4755
|
+
} else E = g.getBoundsFromRange(e);
|
|
4757
4756
|
}
|
|
4758
|
-
let
|
|
4759
|
-
if (g &&
|
|
4760
|
-
const e = g.getBoundsFromRange(g.getRangeFromCell(
|
|
4761
|
-
e && (
|
|
4757
|
+
let R = null;
|
|
4758
|
+
if (g && S) {
|
|
4759
|
+
const e = g.getBoundsFromRange(g.getRangeFromCell(S)), t = g.getZoom() || 1;
|
|
4760
|
+
e && (R = {
|
|
4762
4761
|
width: e.width / t,
|
|
4763
4762
|
height: e.height / t
|
|
4764
4763
|
});
|
|
4765
4764
|
}
|
|
4766
|
-
const
|
|
4765
|
+
const M = !!f && !!E && I, P = {
|
|
4767
4766
|
open: !!f,
|
|
4768
4767
|
mode: f?.mode ?? "enter",
|
|
4769
4768
|
coords: f?.coords ?? null,
|
|
4770
4769
|
clean: f?.clean ?? null,
|
|
4771
4770
|
dirty: f?.dirty,
|
|
4772
4771
|
token: f?.token ?? 0,
|
|
4773
|
-
autoFocus: (f?.autoFocus ?? !0) &&
|
|
4772
|
+
autoFocus: (f?.autoFocus ?? !0) && M && C,
|
|
4774
4773
|
initialSelection: f?.initialSelection,
|
|
4775
4774
|
zoom: g?.getZoom() ?? 1,
|
|
4776
|
-
cellSize:
|
|
4775
|
+
cellSize: R,
|
|
4777
4776
|
onDirtyChange: (e) => h?.setDirty(e),
|
|
4778
4777
|
onModeChange: (e) => h?.setMode(e),
|
|
4779
|
-
onCommit:
|
|
4780
|
-
onCancel:
|
|
4778
|
+
onCommit: y,
|
|
4779
|
+
onCancel: b,
|
|
4781
4780
|
onNaturalSize: v
|
|
4782
|
-
},
|
|
4781
|
+
}, k = "function" == typeof r ? (S ? r(S) : void 0) ?? "transparent" : r;
|
|
4782
|
+
return x(nt, { children: E ? x(st, {
|
|
4783
|
+
...u,
|
|
4784
|
+
className: H(a, "editor"),
|
|
4785
|
+
bounds: E,
|
|
4786
|
+
alignWidth: i,
|
|
4787
|
+
keepMounted: !0,
|
|
4788
|
+
style: {
|
|
4789
|
+
...d,
|
|
4790
|
+
display: "flex",
|
|
4791
|
+
overflow: "hidden",
|
|
4792
|
+
background: k,
|
|
4793
|
+
borderColor: l,
|
|
4794
|
+
boxShadow: M ? "rgba(60,64,67,.35) 2px 2px 6px 3px" : "none",
|
|
4795
|
+
opacity: M ? 1 : 0,
|
|
4796
|
+
pointerEvents: M ? "auto" : "none"
|
|
4797
|
+
},
|
|
4798
|
+
children: n ? n(P) : x(Xo, { ...P })
|
|
4799
|
+
}) : null });
|
|
4800
|
+
}
|
|
4801
|
+
function qo(e) {
|
|
4802
|
+
const { editable: t } = e, n = Qe();
|
|
4783
4803
|
return x(nt, {
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
opacity: k ? 1 : 0,
|
|
4800
|
-
pointerEvents: k ? "auto" : "none"
|
|
4801
|
-
},
|
|
4802
|
-
children: n ? n(D) : x(Xo, { ...D })
|
|
4803
|
-
}) : null
|
|
4804
|
+
className: "editor-start",
|
|
4805
|
+
onKeyDown: $((e) => {
|
|
4806
|
+
if (t.getSession()) return;
|
|
4807
|
+
const o = n?.getElement();
|
|
4808
|
+
if (o && e.target !== o) return;
|
|
4809
|
+
const r = t.getAnchor().getCoords();
|
|
4810
|
+
if (!r) return;
|
|
4811
|
+
const l = Vo(e.nativeEvent);
|
|
4812
|
+
l && ("Process" !== e.nativeEvent.key && 229 !== e.nativeEvent.keyCode && e.preventDefault(), e.stopPropagation(), t.startEdit(r, l));
|
|
4813
|
+
}, [t, n]),
|
|
4814
|
+
onDoubleClick: $((e) => {
|
|
4815
|
+
if (t.getSession()) return;
|
|
4816
|
+
const o = n?.getCellFromPointer(e.clientX, e.clientY) ?? t.getAnchor().getCoords();
|
|
4817
|
+
o && t.startEdit(o, { mode: "edit" });
|
|
4818
|
+
}, [n, t])
|
|
4804
4819
|
});
|
|
4805
4820
|
}
|
|
4806
|
-
function
|
|
4807
|
-
const { editable: t, renderEditor: n, idleClean: o = null, mapClean: r, editorId: l, readOnly: i, className: s, style: a } = e, c =
|
|
4821
|
+
function Zo(e) {
|
|
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 = $(() => {
|
|
4808
4823
|
i || (t.getSession() || t.startEdit(t.getAnchor().getCoords(), {
|
|
4809
4824
|
mode: "edit",
|
|
4810
4825
|
autoFocus: !1
|
|
@@ -4836,8 +4851,8 @@ function qo(e) {
|
|
|
4836
4851
|
children: n ? n(m) : x(Xo, { ...m })
|
|
4837
4852
|
});
|
|
4838
4853
|
}
|
|
4839
|
-
Xo.displayName = "DefaultEditorInput",
|
|
4840
|
-
var
|
|
4854
|
+
Xo.displayName = "DefaultEditorInput", Zo.displayName = "EditorDiv";
|
|
4855
|
+
var Jo = "ew-resize", Qo = "ns-resize", er = i(r((e, t) => {
|
|
4841
4856
|
const { axis: n, index: o, className: r, style: l, disabled: i = !1, disabledResize: s = !1, isNextHidden: a, isHidden: c, isSelected: d, isSelectedAll: u, showTouchDivider: g, bounds: h, onPointerDown: f, onAutoFit: p, ...m } = e, w = Je(), y = n === X.Column, b = 1 / E.getDevicePixelRatio(), S = d || u, I = S ? "color-mix(in srgb, var(--sxl-color-primary, rgb(33, 115, 70)) 35%, var(--sxl-color-base-300, rgb(171, 171, 171)))" : "var(--sxl-color-base-300, rgb(171, 171, 171))", C = "var(--sxl-color-base-100, #f5f5f5)", R = "touch" === E.detectIt().primaryInput;
|
|
4842
4857
|
let M = y ? 14 : 8;
|
|
4843
4858
|
const P = w.getZoom();
|
|
@@ -4858,7 +4873,7 @@ var Zo = "ew-resize", Jo = "ns-resize", Qo = i(r((e, t) => {
|
|
|
4858
4873
|
position: "absolute",
|
|
4859
4874
|
overflow: "visible",
|
|
4860
4875
|
pointerEvents: "auto",
|
|
4861
|
-
cursor: i || s || R ? void 0 : y ?
|
|
4876
|
+
cursor: i || s || R ? void 0 : y ? Jo : Qo,
|
|
4862
4877
|
...l
|
|
4863
4878
|
},
|
|
4864
4879
|
...m,
|
|
@@ -4902,8 +4917,8 @@ var Zo = "ew-resize", Jo = "ns-resize", Qo = i(r((e, t) => {
|
|
|
4902
4917
|
} })
|
|
4903
4918
|
}) : null]
|
|
4904
4919
|
});
|
|
4905
|
-
})),
|
|
4906
|
-
const { axis: n, index: o, disabled: r = !1, disabledResize: l = !1, resizeThreshold: i = 1, renderDivider: s =
|
|
4920
|
+
})), tr = (e) => x(er, { ...e }), nr = i(r((e, t) => {
|
|
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;
|
|
4907
4922
|
let R = C ? b.getVisibleColumns() : b.getVisibleRows(), M = null;
|
|
4908
4923
|
R.length > 0 && (M = C ? b.getBoundsFromRange({
|
|
4909
4924
|
rowStart: 0,
|
|
@@ -4916,11 +4931,11 @@ var Zo = "ew-resize", Jo = "ns-resize", Qo = i(r((e, t) => {
|
|
|
4916
4931
|
colStart: 0,
|
|
4917
4932
|
colEnd: 0
|
|
4918
4933
|
}), M = b.toClipBounds(M, -10));
|
|
4919
|
-
const P = f(null), [k, D] = p(null), T = (e, t) => C ? e.clientX - t.clientX : e.clientY - t.clientY,
|
|
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({
|
|
4920
4935
|
processTouch: !0,
|
|
4921
4936
|
onPointerDown: (e) => {
|
|
4922
4937
|
if (S?.(e), !r && !l) {
|
|
4923
|
-
const e = C ?
|
|
4938
|
+
const e = C ? O.getColOffset(o) : O.getRowOffset(o), t = z - e;
|
|
4924
4939
|
P.current = {
|
|
4925
4940
|
isResizing: !1,
|
|
4926
4941
|
startSize: t,
|
|
@@ -4950,7 +4965,7 @@ var Zo = "ew-resize", Jo = "ns-resize", Qo = i(r((e, t) => {
|
|
|
4950
4965
|
isResizing: !0
|
|
4951
4966
|
}, D(P.current), P.current.onDividerResizeStart?.(P.current.index, Math.max(0, P.current.startSize + o))), e.stopPropagation(), e.preventDefault();
|
|
4952
4967
|
}
|
|
4953
|
-
}), K =
|
|
4968
|
+
}), K = $(() => {
|
|
4954
4969
|
I?.(o);
|
|
4955
4970
|
}, [o]), { getPortalContainer: _ } = L();
|
|
4956
4971
|
if (!M) return;
|
|
@@ -4969,7 +4984,7 @@ var Zo = "ew-resize", Jo = "ns-resize", Qo = i(r((e, t) => {
|
|
|
4969
4984
|
let U = null;
|
|
4970
4985
|
return k && k.isResizing && k.index === o && (U = q(x("div", { style: {
|
|
4971
4986
|
position: "absolute",
|
|
4972
|
-
cursor: C ?
|
|
4987
|
+
cursor: C ? Jo : Qo,
|
|
4973
4988
|
left: 0,
|
|
4974
4989
|
top: 0,
|
|
4975
4990
|
width: "100%",
|
|
@@ -4989,26 +5004,26 @@ var Zo = "ew-resize", Jo = "ns-resize", Qo = i(r((e, t) => {
|
|
|
4989
5004
|
children: W
|
|
4990
5005
|
})] });
|
|
4991
5006
|
}));
|
|
4992
|
-
|
|
4993
|
-
var
|
|
5007
|
+
nr.displayName = "HeaderDividerAnchor";
|
|
5008
|
+
var or = (e, t, n) => t === X.Column ? {
|
|
4994
5009
|
rowIndex: n.rowStart,
|
|
4995
5010
|
colIndex: e.colIndex
|
|
4996
5011
|
} : {
|
|
4997
5012
|
rowIndex: e.rowIndex,
|
|
4998
5013
|
colIndex: n.colStart
|
|
4999
|
-
},
|
|
5014
|
+
}, rr = (e, t, n) => t === X.Column ? {
|
|
5000
5015
|
rowIndex: n.rowEnd,
|
|
5001
5016
|
colIndex: e.colIndex
|
|
5002
5017
|
} : {
|
|
5003
5018
|
rowIndex: e.rowIndex,
|
|
5004
5019
|
colIndex: n.colEnd
|
|
5005
|
-
},
|
|
5020
|
+
}, lr = (e, t, n) => t === X.Column ? {
|
|
5006
5021
|
rowIndex: n.rowStart,
|
|
5007
5022
|
colIndex: e.colIndex
|
|
5008
5023
|
} : {
|
|
5009
5024
|
rowIndex: e.rowIndex,
|
|
5010
5025
|
colIndex: n.colStart
|
|
5011
|
-
},
|
|
5026
|
+
}, ir = (e, t, n, o) => n === X.Column ? {
|
|
5012
5027
|
rowStart: o.rowStart,
|
|
5013
5028
|
rowEnd: o.rowEnd,
|
|
5014
5029
|
colStart: Math.min(e.colIndex, t.colIndex),
|
|
@@ -5018,7 +5033,7 @@ var nr = (e, t, n) => t === X.Column ? {
|
|
|
5018
5033
|
colEnd: o.colEnd,
|
|
5019
5034
|
rowStart: Math.min(e.rowIndex, t.rowIndex),
|
|
5020
5035
|
rowEnd: Math.max(e.rowIndex, t.rowIndex)
|
|
5021
|
-
},
|
|
5036
|
+
}, sr = (e, t, n) => {
|
|
5022
5037
|
let o = null, r = null, l = 0;
|
|
5023
5038
|
const i = () => t.getAllPanes()[_.Center] ?? t, s = (t, n, o) => {
|
|
5024
5039
|
if (!e) return;
|
|
@@ -5061,7 +5076,7 @@ var nr = (e, t, n) => t === X.Column ? {
|
|
|
5061
5076
|
let s = null;
|
|
5062
5077
|
return t === X.Column ? e.x >= r.right - 24 && l.colEnd < o.colEnd ? s = { colIndex: l.colEnd + 1 } : e.x <= r.left + 24 && l.colStart > o.colStart && (s = { colIndex: l.colStart - 1 }) : e.y >= r.bottom - 24 && l.rowEnd < o.rowEnd ? s = { rowIndex: l.rowEnd + 1 } : e.y <= r.top + 24 && l.rowStart > o.rowStart && (s = { rowIndex: l.rowStart - 1 }), !!s && (c(s), !0);
|
|
5063
5078
|
}, u = (e) => {
|
|
5064
|
-
const { axis: t, entireRange: c, replaceActive: d = !1 } = n(), u =
|
|
5079
|
+
const { axis: t, entireRange: c, replaceActive: d = !1 } = n(), u = ir(o ?? e, e, t, c), g = r ?? lr(e, t, i().getVisibleRange());
|
|
5065
5080
|
d ? a(l, u, g) : s(u, g, "replace");
|
|
5066
5081
|
};
|
|
5067
5082
|
return gn(t, (t, g) => {
|
|
@@ -5071,11 +5086,11 @@ var nr = (e, t, n) => t === X.Column ? {
|
|
|
5071
5086
|
const { axis: p, entireRange: m, allowMulti: w = !0, replaceActive: x = !1, preserveFocus: v = !1, onPointerDownInterceptor: y, onDragStart: b, onDragEnd: S, onPointerUp: E } = n();
|
|
5072
5087
|
if (!1 === y?.(g, t)) return null;
|
|
5073
5088
|
x && g.stopPropagation(), v && h && g.preventDefault(), b?.();
|
|
5074
|
-
const I =
|
|
5089
|
+
const I = lr(t, p, i().getVisibleRange()), C = g.shiftKey, R = (g.ctrlKey || g.metaKey) && w;
|
|
5075
5090
|
if (x) {
|
|
5076
5091
|
const n = e.getSelection(), i = n.ranges ?? [], s = n.rangeIndex ?? -1;
|
|
5077
|
-
C && o ? (l = s >= 0 ? s : Math.max(0, i.length - 1), a(l,
|
|
5078
|
-
} else C && o ? s(
|
|
5092
|
+
C && o ? (l = s >= 0 ? s : Math.max(0, i.length - 1), a(l, ir(o, t, p, m), r ?? I)) : (o = t, r = I, l = R || s < 0 ? i.length : s, a(l, ir(t, t, p, m), I));
|
|
5093
|
+
} else C && o ? s(ir(o, t, p, m), r ?? I, "replace") : R ? (o = t, r = I, s(ir(t, t, p, m), I, "append")) : (o = t, r = I, s(ir(t, t, p, m), I, "clear"));
|
|
5079
5094
|
return ((e) => {
|
|
5080
5095
|
c(n().axis === X.Column ? { colIndex: e.colIndex } : { rowIndex: e.rowIndex });
|
|
5081
5096
|
})(t), {
|
|
@@ -5091,16 +5106,16 @@ var nr = (e, t, n) => t === X.Column ? {
|
|
|
5091
5106
|
captureEvents: x
|
|
5092
5107
|
};
|
|
5093
5108
|
});
|
|
5094
|
-
},
|
|
5109
|
+
}, ar = (e, t) => {
|
|
5095
5110
|
const n = Je(), o = f(t);
|
|
5096
5111
|
o.current = t;
|
|
5097
|
-
const r = g(() =>
|
|
5112
|
+
const r = g(() => sr(e, n, () => o.current), [e, n]);
|
|
5098
5113
|
return c(() => () => r.dispose(), [r]), {
|
|
5099
5114
|
onPointerDown: r.onPointerDown,
|
|
5100
5115
|
onPointerMove: r.onPointerMove,
|
|
5101
5116
|
onPointerUp: r.onPointerUp
|
|
5102
5117
|
};
|
|
5103
|
-
},
|
|
5118
|
+
}, cr = (e) => null == e ? [] : Array.isArray(e) ? e : [e], dr = i(r((e, t) => {
|
|
5104
5119
|
const { rowCount: n = 1, columnCount: o = 1, getRowHeight: r, getColumnWidth: l, metrics: i, renderCells: a, renderBorders: c, showGridLines: d = !0, gridLineColor: u, propsGridLineRows: f, propsGridLineColumns: p, getVisibleCells: m, hiddenCellAt: w, renderBelow: v, children: y, ...b } = e, S = le({
|
|
5105
5120
|
rowCount: n,
|
|
5106
5121
|
columnCount: o,
|
|
@@ -5117,12 +5132,12 @@ var nr = (e, t, n) => t === X.Column ? {
|
|
|
5117
5132
|
propsColumns: p,
|
|
5118
5133
|
getVisibleCells: m,
|
|
5119
5134
|
hiddenCellAt: w
|
|
5120
|
-
}, "__gridlines")), e.push(...
|
|
5135
|
+
}, "__gridlines")), e.push(...cr(v)), e.push(...cr(c)), a && e.push(x(jn, {
|
|
5121
5136
|
renderCell: a,
|
|
5122
5137
|
getVisibleCells: m,
|
|
5123
5138
|
hiddenCellAt: w,
|
|
5124
5139
|
cacheToken: R
|
|
5125
|
-
}, "__cells")), e.push(...
|
|
5140
|
+
}, "__cells")), e.push(...cr(y)), e;
|
|
5126
5141
|
}, [
|
|
5127
5142
|
d,
|
|
5128
5143
|
u,
|
|
@@ -5145,17 +5160,17 @@ var nr = (e, t, n) => t === X.Column ? {
|
|
|
5145
5160
|
children: k
|
|
5146
5161
|
});
|
|
5147
5162
|
}));
|
|
5148
|
-
|
|
5149
|
-
var
|
|
5163
|
+
dr.displayName = "Grid";
|
|
5164
|
+
var ur, gr = {
|
|
5150
5165
|
fill: { fill: "color-mix(in srgb, var(--sxl-color-primary, rgb(0, 120, 215)) 14%, transparent)" },
|
|
5151
5166
|
border: null,
|
|
5152
5167
|
inner: null
|
|
5153
|
-
},
|
|
5168
|
+
}, hr = {
|
|
5154
5169
|
stroke: "var(--sxl-color-primary, rgb(0, 120, 215))",
|
|
5155
5170
|
alignWidth: 1,
|
|
5156
5171
|
inset: 1
|
|
5157
|
-
},
|
|
5158
|
-
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 =
|
|
5172
|
+
}, fr = r(function(e, t) {
|
|
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);
|
|
5159
5174
|
c(() => {
|
|
5160
5175
|
d && k.current?.focus();
|
|
5161
5176
|
}, [d]), c(() => {
|
|
@@ -5177,14 +5192,14 @@ var dr, ur = {
|
|
|
5177
5192
|
colStart: 0,
|
|
5178
5193
|
rowEnd: Math.max(0, n - 1),
|
|
5179
5194
|
colEnd: 0
|
|
5180
|
-
}) }), [n]), T = s ?? D, [
|
|
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({
|
|
5181
5196
|
rowCount: n,
|
|
5182
5197
|
columnCount: 1,
|
|
5183
5198
|
getRowHeight: l,
|
|
5184
|
-
getColumnWidth:
|
|
5199
|
+
getColumnWidth: z || i || R.width || 0
|
|
5185
5200
|
});
|
|
5186
5201
|
return x("div", {
|
|
5187
|
-
ref:
|
|
5202
|
+
ref: B,
|
|
5188
5203
|
className: H("list-surface", w),
|
|
5189
5204
|
style: {
|
|
5190
5205
|
position: "relative",
|
|
@@ -5193,7 +5208,7 @@ var dr, ur = {
|
|
|
5193
5208
|
maxWidth: "100%",
|
|
5194
5209
|
maxHeight: "100%",
|
|
5195
5210
|
...y,
|
|
5196
|
-
...null != i ? { width: i +
|
|
5211
|
+
...null != i ? { width: i + F } : null
|
|
5197
5212
|
},
|
|
5198
5213
|
...S,
|
|
5199
5214
|
children: x(C, {
|
|
@@ -5205,7 +5220,7 @@ var dr, ur = {
|
|
|
5205
5220
|
height: "100%"
|
|
5206
5221
|
},
|
|
5207
5222
|
children: x("div", {
|
|
5208
|
-
ref:
|
|
5223
|
+
ref: $,
|
|
5209
5224
|
style: {
|
|
5210
5225
|
width: "100%",
|
|
5211
5226
|
height: "100%"
|
|
@@ -5224,9 +5239,9 @@ var dr, ur = {
|
|
|
5224
5239
|
x(Do, {
|
|
5225
5240
|
selection: T,
|
|
5226
5241
|
anchorHole: !1,
|
|
5227
|
-
singleStyle:
|
|
5228
|
-
singleAnchorStyle:
|
|
5229
|
-
multiAnchorStyle:
|
|
5242
|
+
singleStyle: gr,
|
|
5243
|
+
singleAnchorStyle: hr,
|
|
5244
|
+
multiAnchorStyle: hr
|
|
5230
5245
|
}, "__selection"),
|
|
5231
5246
|
x(jn, {
|
|
5232
5247
|
renderCell: o,
|
|
@@ -5239,7 +5254,7 @@ var dr, ur = {
|
|
|
5239
5254
|
})
|
|
5240
5255
|
})
|
|
5241
5256
|
});
|
|
5242
|
-
}),
|
|
5257
|
+
}), pr = r(function(e, t) {
|
|
5243
5258
|
const { itemCount: n, renderItem: o, itemHeight: r, selection: l, onKeyDown: i, cacheToken: a, scrollTo: c, autoFocus: d, viewport: u, className: h, style: f, children: p, ...m } = e, w = N(t, () => ({ isList: () => !0 }), []), v = s((e) => {
|
|
5244
5259
|
const { key: t, style: n, range: r, cell: l } = e, i = r?.rowStart ?? l.rowIndex;
|
|
5245
5260
|
return x("div", {
|
|
@@ -5259,7 +5274,7 @@ var dr, ur = {
|
|
|
5259
5274
|
children: o(i)
|
|
5260
5275
|
}, t);
|
|
5261
5276
|
}, [o]), y = g(() => i ? { onKeyDown: i } : void 0, [i]);
|
|
5262
|
-
return x(
|
|
5277
|
+
return x(fr, {
|
|
5263
5278
|
ref: w,
|
|
5264
5279
|
className: H("list", h),
|
|
5265
5280
|
style: f,
|
|
@@ -5274,7 +5289,7 @@ var dr, ur = {
|
|
|
5274
5289
|
viewport: u,
|
|
5275
5290
|
...m
|
|
5276
5291
|
});
|
|
5277
|
-
}),
|
|
5292
|
+
}), mr = (e, t) => x("input", {
|
|
5278
5293
|
type: "checkbox",
|
|
5279
5294
|
checked: e,
|
|
5280
5295
|
ref: (e) => {
|
|
@@ -5283,13 +5298,13 @@ var dr, ur = {
|
|
|
5283
5298
|
readOnly: !0,
|
|
5284
5299
|
tabIndex: -1,
|
|
5285
5300
|
style: { margin: 0 }
|
|
5286
|
-
}),
|
|
5287
|
-
const { itemCount: n, isChecked: o, onCheckedChange: r, renderValue: l, renderCheckbox: i =
|
|
5301
|
+
}), wr = r(function(e, t) {
|
|
5302
|
+
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: () => ({
|
|
5288
5303
|
rowStart: 0,
|
|
5289
5304
|
colStart: 0,
|
|
5290
5305
|
rowEnd: Math.max(0, n - 1),
|
|
5291
5306
|
colEnd: 0
|
|
5292
|
-
}) }), [n]), R = u ?? C, M =
|
|
5307
|
+
}) }), [n]), R = u ?? C, M = $(() => {
|
|
5293
5308
|
if (0 === n) return;
|
|
5294
5309
|
const e = !o(R.getSelection().cell.rowIndex);
|
|
5295
5310
|
r(((e) => {
|
|
@@ -5301,14 +5316,14 @@ var dr, ur = {
|
|
|
5301
5316
|
n,
|
|
5302
5317
|
o,
|
|
5303
5318
|
r
|
|
5304
|
-
]), P = f(null), [, k] = h((e) => e + 1, 0), D =
|
|
5319
|
+
]), P = f(null), [, k] = h((e) => e + 1, 0), D = $(() => 0 === n ? -1 : R.getSelection().cell.rowIndex, [R, n]), T = $((e) => {
|
|
5305
5320
|
if (0 === n) return;
|
|
5306
5321
|
const t = Math.min(Math.max(0, R.getSelection().cell.rowIndex + e), n - 1);
|
|
5307
5322
|
R.setSelection({ cell: {
|
|
5308
5323
|
rowIndex: t,
|
|
5309
5324
|
colIndex: 0
|
|
5310
5325
|
} }), P.current = { row: t }, k();
|
|
5311
|
-
}, [R, n]),
|
|
5326
|
+
}, [R, n]), O = N(t, () => ({
|
|
5312
5327
|
isCheckboxList: () => !0,
|
|
5313
5328
|
getHighlightIndex: D,
|
|
5314
5329
|
moveHighlight: T,
|
|
@@ -5317,7 +5332,7 @@ var dr, ur = {
|
|
|
5317
5332
|
D,
|
|
5318
5333
|
T,
|
|
5319
5334
|
M
|
|
5320
|
-
]),
|
|
5335
|
+
]), z = s((e) => v("div", {
|
|
5321
5336
|
style: {
|
|
5322
5337
|
display: "flex",
|
|
5323
5338
|
alignItems: "center",
|
|
@@ -5350,7 +5365,7 @@ var dr, ur = {
|
|
|
5350
5365
|
i
|
|
5351
5366
|
]), L = s((e) => {
|
|
5352
5367
|
" " !== e.key && "Enter" !== e.key || (e.preventDefault(), e.stopPropagation(), M());
|
|
5353
|
-
}, [M]), { allChecked:
|
|
5368
|
+
}, [M]), { allChecked: F, someChecked: B } = g(() => {
|
|
5354
5369
|
if (null == c || 0 === n) return {
|
|
5355
5370
|
allChecked: !1,
|
|
5356
5371
|
someChecked: !1
|
|
@@ -5368,7 +5383,7 @@ var dr, ur = {
|
|
|
5368
5383
|
p
|
|
5369
5384
|
]);
|
|
5370
5385
|
return v("div", {
|
|
5371
|
-
ref:
|
|
5386
|
+
ref: O,
|
|
5372
5387
|
className: H("checkbox-list", b),
|
|
5373
5388
|
style: {
|
|
5374
5389
|
display: "flex",
|
|
@@ -5387,20 +5402,20 @@ var dr, ur = {
|
|
|
5387
5402
|
cursor: "pointer"
|
|
5388
5403
|
},
|
|
5389
5404
|
onMouseDown: (e) => {
|
|
5390
|
-
e.preventDefault(), r(Array.from({ length: n }, (e, t) => t), !
|
|
5405
|
+
e.preventDefault(), r(Array.from({ length: n }, (e, t) => t), !F);
|
|
5391
5406
|
},
|
|
5392
5407
|
children: [x("div", {
|
|
5393
5408
|
style: {
|
|
5394
5409
|
display: "inline-flex",
|
|
5395
5410
|
pointerEvents: "none"
|
|
5396
5411
|
},
|
|
5397
|
-
children: i(
|
|
5412
|
+
children: i(F, B)
|
|
5398
5413
|
}), c]
|
|
5399
|
-
}), a?.()] }), x(
|
|
5414
|
+
}), a?.()] }), x(pr, {
|
|
5400
5415
|
itemCount: n,
|
|
5401
5416
|
itemHeight: d,
|
|
5402
5417
|
selection: R,
|
|
5403
|
-
renderItem:
|
|
5418
|
+
renderItem: z,
|
|
5404
5419
|
onKeyDown: L,
|
|
5405
5420
|
cacheToken: p,
|
|
5406
5421
|
scrollTo: P.current,
|
|
@@ -5412,21 +5427,21 @@ var dr, ur = {
|
|
|
5412
5427
|
}
|
|
5413
5428
|
})]
|
|
5414
5429
|
});
|
|
5415
|
-
}),
|
|
5430
|
+
}), xr = (e, t) => {
|
|
5416
5431
|
const n = (() => {
|
|
5417
|
-
if (void 0 !==
|
|
5432
|
+
if (void 0 !== ur) return ur;
|
|
5418
5433
|
try {
|
|
5419
|
-
|
|
5434
|
+
ur = ("undefined" != typeof document ? document.createElement("canvas").getContext("2d") : null) ?? null;
|
|
5420
5435
|
} catch {
|
|
5421
|
-
|
|
5436
|
+
ur = null;
|
|
5422
5437
|
}
|
|
5423
|
-
return
|
|
5438
|
+
return ur;
|
|
5424
5439
|
})();
|
|
5425
5440
|
if (n) return n.font = t, n.measureText(e).width;
|
|
5426
5441
|
const o = Number.parseFloat((/(\d+(?:\.\d+)?)px/.exec(t) ?? [])[1] ?? "16") || 16;
|
|
5427
5442
|
return e.length * o * .55;
|
|
5428
|
-
},
|
|
5429
|
-
const { items: n, onChoose: o, highlightIndex: r, itemHeight: l = 24, visibleRows: i = 8, contentWidth: a, measureText: c, renderItem: d, autoFocus: u, viewport: p, className: m, style: w, children: v, ...y } = e, S = n.length, E =
|
|
5443
|
+
}, vr = (e, t) => t <= 0 ? -1 : Math.min(Math.max(0, e), t - 1), yr = r(function(e, t) {
|
|
5444
|
+
const { items: n, onChoose: o, highlightIndex: r, itemHeight: l = 24, visibleRows: i = 8, contentWidth: a, measureText: c, renderItem: d, autoFocus: u, viewport: p, className: m, style: w, children: v, ...y } = e, S = n.length, E = vr(r ?? 0, S), I = g(() => new ro({
|
|
5430
5445
|
initial: { cell: {
|
|
5431
5446
|
rowIndex: Math.max(0, E),
|
|
5432
5447
|
colIndex: 0
|
|
@@ -5441,18 +5456,18 @@ var dr, ur = {
|
|
|
5441
5456
|
n,
|
|
5442
5457
|
E,
|
|
5443
5458
|
S
|
|
5444
|
-
]), 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 =
|
|
5459
|
+
]), 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), [
|
|
5445
5460
|
o,
|
|
5446
5461
|
n,
|
|
5447
5462
|
S
|
|
5448
|
-
]), D =
|
|
5463
|
+
]), D = $(() => 0 === S ? -1 : I.getSelection().cell.rowIndex, [I, S]), T = $((e) => {
|
|
5449
5464
|
if (0 === S) return;
|
|
5450
|
-
const t =
|
|
5465
|
+
const t = vr(I.getSelection().cell.rowIndex + e, S);
|
|
5451
5466
|
I.setSelection({ cell: {
|
|
5452
5467
|
rowIndex: t,
|
|
5453
5468
|
colIndex: 0
|
|
5454
5469
|
} }), C.current = { row: t }, R();
|
|
5455
|
-
}, [I, S]),
|
|
5470
|
+
}, [I, S]), O = N(t, () => ({
|
|
5456
5471
|
isPickList: () => !0,
|
|
5457
5472
|
getHighlightIndex: D,
|
|
5458
5473
|
moveHighlight: T,
|
|
@@ -5461,24 +5476,24 @@ var dr, ur = {
|
|
|
5461
5476
|
D,
|
|
5462
5477
|
T,
|
|
5463
5478
|
k
|
|
5464
|
-
]),
|
|
5479
|
+
]), z = g(() => {
|
|
5465
5480
|
if (c) return c;
|
|
5466
5481
|
const e = ((e) => {
|
|
5467
5482
|
const t = e?.fontSize, n = e?.fontFamily, o = "number" == typeof t ? `${t}px` : t ?? "16px", r = [];
|
|
5468
5483
|
return e?.fontStyle && "normal" !== e.fontStyle && r.push(String(e.fontStyle)), e?.fontWeight && "normal" !== e.fontWeight && r.push(String(e.fontWeight)), r.push(o, n ? String(n) : "sans-serif"), r.join(" ");
|
|
5469
5484
|
})(w);
|
|
5470
|
-
return (t) =>
|
|
5485
|
+
return (t) => xr(t, e);
|
|
5471
5486
|
}, [c, w]), L = g(() => {
|
|
5472
5487
|
if (null != a) return a;
|
|
5473
5488
|
let e = 0;
|
|
5474
|
-
for (let t = 0; t < S; t++) e = Math.max(e,
|
|
5489
|
+
for (let t = 0; t < S; t++) e = Math.max(e, z(n[t].text));
|
|
5475
5490
|
return Math.ceil(e) + 16;
|
|
5476
5491
|
}, [
|
|
5477
5492
|
a,
|
|
5478
5493
|
n,
|
|
5479
5494
|
S,
|
|
5480
|
-
|
|
5481
|
-
]),
|
|
5495
|
+
z
|
|
5496
|
+
]), F = s((e) => {
|
|
5482
5497
|
const { key: t, style: o, range: r, cell: l } = e, i = r?.rowStart ?? l.rowIndex, s = n[i];
|
|
5483
5498
|
return s ? x("div", {
|
|
5484
5499
|
role: "option",
|
|
@@ -5503,7 +5518,7 @@ var dr, ur = {
|
|
|
5503
5518
|
children: s.text || "\xA0"
|
|
5504
5519
|
})
|
|
5505
5520
|
}, t) : null;
|
|
5506
|
-
}, [n, d]),
|
|
5521
|
+
}, [n, d]), B = g(() => ({
|
|
5507
5522
|
onPointerUp: (e) => {
|
|
5508
5523
|
0 === e.button && k(D());
|
|
5509
5524
|
},
|
|
@@ -5511,8 +5526,8 @@ var dr, ur = {
|
|
|
5511
5526
|
e.which !== b.Enter && e.which !== b.Space || (e.preventDefault(), e.stopPropagation(), k(D()));
|
|
5512
5527
|
}
|
|
5513
5528
|
}), [k, D]);
|
|
5514
|
-
return x(
|
|
5515
|
-
ref:
|
|
5529
|
+
return x(fr, {
|
|
5530
|
+
ref: O,
|
|
5516
5531
|
className: H("pick-list", m),
|
|
5517
5532
|
role: "listbox",
|
|
5518
5533
|
style: {
|
|
@@ -5523,18 +5538,18 @@ var dr, ur = {
|
|
|
5523
5538
|
itemHeight: l,
|
|
5524
5539
|
contentWidth: L,
|
|
5525
5540
|
selection: I,
|
|
5526
|
-
renderCell:
|
|
5527
|
-
propsLayer:
|
|
5541
|
+
renderCell: F,
|
|
5542
|
+
propsLayer: B,
|
|
5528
5543
|
scrollTo: P,
|
|
5529
5544
|
viewport: p,
|
|
5530
5545
|
autoFocus: u,
|
|
5531
5546
|
cacheToken: n,
|
|
5532
5547
|
...y
|
|
5533
5548
|
});
|
|
5534
|
-
}),
|
|
5549
|
+
}), br = "_search_b1nag_5", Sr = (e, t) => {
|
|
5535
5550
|
const n = t.trim().toLowerCase();
|
|
5536
5551
|
return n ? e.filter((e) => e.text.toLowerCase().includes(n)) : e;
|
|
5537
|
-
},
|
|
5552
|
+
}, Er = r(function(e, t) {
|
|
5538
5553
|
const { value: n, onChange: o, onClose: r, onKeyDown: l, className: i, ...a } = e, c = s((e) => {
|
|
5539
5554
|
if (e.which === b.Escape) return e.preventDefault(), e.stopPropagation(), void (n ? o("") : r?.());
|
|
5540
5555
|
l?.(e);
|
|
@@ -5550,19 +5565,19 @@ var dr, ur = {
|
|
|
5550
5565
|
role: "searchbox",
|
|
5551
5566
|
autoComplete: "off",
|
|
5552
5567
|
spellCheck: !1,
|
|
5553
|
-
className: H(
|
|
5568
|
+
className: H(br, "list-search", i),
|
|
5554
5569
|
value: n,
|
|
5555
5570
|
onChange: (e) => o(e.target.value),
|
|
5556
5571
|
onKeyDown: c,
|
|
5557
5572
|
...a
|
|
5558
5573
|
});
|
|
5559
|
-
}),
|
|
5574
|
+
}), Ir = {
|
|
5560
5575
|
light: {},
|
|
5561
5576
|
dark: {
|
|
5562
5577
|
"color-base-100": "#1e1e1e",
|
|
5563
5578
|
"color-base-300": "#3a3a3a"
|
|
5564
5579
|
}
|
|
5565
|
-
},
|
|
5580
|
+
}, Cr = {
|
|
5566
5581
|
light: {
|
|
5567
5582
|
"color-base-100": "#f2f2f2",
|
|
5568
5583
|
"color-base-hover": "#ececec",
|
|
@@ -5573,7 +5588,7 @@ var dr, ur = {
|
|
|
5573
5588
|
"color-base-hover": "#2e2e2e",
|
|
5574
5589
|
"color-base-300": "#4a4a4a"
|
|
5575
5590
|
}
|
|
5576
|
-
},
|
|
5591
|
+
}, Rr = (e, ...t) => T(e, Ir[e], ...t), Mr = (e, ...t) => T(e, Cr[e], ...t), Pr = ({ app: e, grid: t = Ir, header: n = Cr, layer: o = "sxl-defaults", scope: r } = {}) => {
|
|
5577
5592
|
const l = e ?? D, i = Object.fromEntries(Object.keys(n).map((e) => [e, {
|
|
5578
5593
|
"color-base-100": l[e]?.["color-base-200"],
|
|
5579
5594
|
...n[e]
|
|
@@ -5588,4 +5603,4 @@ var dr, ur = {
|
|
|
5588
5603
|
scope: r
|
|
5589
5604
|
});
|
|
5590
5605
|
};
|
|
5591
|
-
export { rn as AUTO_SCROLL_INTERVAL_MS, jn as CellLayer, Un as CellTileDiv,
|
|
5606
|
+
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 };
|