@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/browser/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._grid-stage_rzp9d_1{width:100%;height:100%;position:absolute;top:0;left:0}._grid-stage_rzp9d_1>*{pointer-events:none;position:absolute;inset:0}._grid-stage_rzp9d_1>*>*{pointer-events:auto}._sheetxl-grid_5yo0n_7{box-sizing:border-box;user-select:none;contain:strict;width:100%;height:100%;position:relative}._sheetxl-grid_5yo0n_7 *{box-sizing:border-box!important}._sheetxl-grid_5yo0n_7 :focus{outline:none}._sheetxl-grid_5yo0n_7>*{contain:size layout style}._virtual-div_16eab_1{position:absolute}._tiles_ikr1b_7{will-change:transform}._tiles_ikr1b_7 .tile{white-space:pre;position:absolute}._tiles_ikr1b_7 .tile>*{contain:strict;position:absolute}._gridlines_ikr1b_26,._gridlines_ikr1b_26 *{pointer-events:none;position:absolute;overflow:visible}.cell{letter-spacing:-.25px;padding:2px 4px;font-family:Calibri;line-height:1.2}._search_b1nag_5{box-sizing:border-box;width:100%;min-width:0;font:inherit;color:inherit;background:light-dark(#fff,#2b2b2b);border:1px solid light-dark(#c4c4c4,#5a5a5a);border-radius:2px;outline:none;margin:0;padding:3px 8px}._search_b1nag_5:focus{border-color:var(--sxl-color-primary,#0078d7)}._search_b1nag_5::placeholder{opacity:.6}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/grid-react - Grid React - Advanced grid component for React - v0.8.0-beta.
|
|
3
|
+
* @license @sheetxl/grid-react - Grid React - Advanced grid component for React - v0.8.0-beta.7
|
|
4
4
|
*
|
|
5
5
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -9,10 +9,10 @@ import * as e from "react";
|
|
|
9
9
|
import t, { cloneElement as n, createContext as r, createElement as i, forwardRef as a, isValidElement as o, memo as s, useCallback as c, useContext as l, useEffect as u, useId as d, useLayoutEffect as f, useMemo as p, useReducer as m, useRef as h, useState as g, useSyncExternalStore as _, version as v } from "react";
|
|
10
10
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
11
|
import { FloatPanelSurface as S, KeyCodes as C, KeyModifiers as w, ReactUtils as T, SERIES_COUNT as E, ScrollPane as D, THEME_MODE_ATTR as O, THEME_SURFACE_ATTR as k, Viewport as A, buildThemeCSS as j, defaultTheme as M, themeVars as N, useBoundSyncExternalStore as P, useCallbackRef as F, useFloatSurface as I, useFullscreenPortal as L, useImperativeElement as R, useOptionalBoundSyncExternalStore as z, useSynchronizedPointerHandler as ee, useTokenThemeContext as B } from "@sheetxl/utils-react";
|
|
12
|
-
import { AnchorLocation as V, CommonUtils as te, CoordUtils as H, DOMUtils as ne, Direction as U, RangeAxis as W, SelectionTraversalUtils as
|
|
13
|
-
import * as
|
|
14
|
-
import { createPortal as
|
|
15
|
-
var
|
|
12
|
+
import { AnchorLocation as V, CommonUtils as te, CoordUtils as H, DOMUtils as ne, Direction as U, RangeAxis as W, SelectionTraversalUtils as G } from "@sheetxl/utils";
|
|
13
|
+
import * as re from "react-dom";
|
|
14
|
+
import { createPortal as ie } from "react-dom";
|
|
15
|
+
var K = (e, t) => {
|
|
16
16
|
if (typeof t == "number") {
|
|
17
17
|
let n = t;
|
|
18
18
|
return {
|
|
@@ -46,11 +46,11 @@ var G = (e, t) => {
|
|
|
46
46
|
return o(Math.floor(s / 2), Math.min(s, e - 1), t);
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
},
|
|
49
|
+
}, ae = (e) => {
|
|
50
50
|
let t = e != null, n = e?.rowCount ?? 0, r = e?.columnCount ?? 0, i = e?.getRowHeight, a = e?.getColumnWidth;
|
|
51
51
|
return p(() => {
|
|
52
52
|
if (!t) return null;
|
|
53
|
-
let e =
|
|
53
|
+
let e = K(n, i ?? 20), o = K(r, a ?? 75);
|
|
54
54
|
return {
|
|
55
55
|
getColOffset: o.getOffset,
|
|
56
56
|
getColIndex: o.getIndex,
|
|
@@ -64,7 +64,7 @@ var G = (e, t) => {
|
|
|
64
64
|
i,
|
|
65
65
|
a
|
|
66
66
|
]);
|
|
67
|
-
},
|
|
67
|
+
}, oe = r(null), se = () => l(oe), ce = (e) => {
|
|
68
68
|
let { linePoints: t, bounds: n, propsPath: r, style: i, ...a } = e;
|
|
69
69
|
return n ? b("svg", {
|
|
70
70
|
width: `${n.width}`,
|
|
@@ -92,10 +92,10 @@ var G = (e, t) => {
|
|
|
92
92
|
...r
|
|
93
93
|
})
|
|
94
94
|
}) : null;
|
|
95
|
-
},
|
|
96
|
-
let { bounds: t, fill: n, stroke: r, alignWidth: i = 1, disableAlign: a = !1, disableEdgeAware: o = !1, inset: s = 0, hole: c, animatedStroke: l, animatedTransition: d, strokeDasharray: f, strokeDashoffset: p, propsFillPath: m, propsStrokePath: h, className: g, style: _, propsRoot: v } = e, S =
|
|
95
|
+
}, le = s((e) => {
|
|
96
|
+
let { bounds: t, fill: n, stroke: r, alignWidth: i = 1, disableAlign: a = !1, disableEdgeAware: o = !1, inset: s = 0, hole: c, animatedStroke: l, animatedTransition: d, strokeDasharray: f, strokeDashoffset: p, propsFillPath: m, propsStrokePath: h, className: g, style: _, propsRoot: v } = e, S = se(), C = t ?? S;
|
|
97
97
|
if (u(() => {
|
|
98
|
-
l &&
|
|
98
|
+
l && pe();
|
|
99
99
|
}, [l]), !C) return null;
|
|
100
100
|
let w = T.getDevicePixelRatio(), E = a ? i : i / w, D, O, k, A, j, M, N;
|
|
101
101
|
if (a) D = C.x, O = C.y, k = C.x + C.width, A = C.y + C.height;
|
|
@@ -124,19 +124,19 @@ var G = (e, t) => {
|
|
|
124
124
|
M = {
|
|
125
125
|
strokeDasharray: `${e.dashLength}px ${e.dashGap}px`,
|
|
126
126
|
strokeDashoffset: `${t}px`,
|
|
127
|
-
animation: `${
|
|
127
|
+
animation: `${de} ${e.speed * t}ms linear infinite`,
|
|
128
128
|
willChange: "stroke-dashoffset"
|
|
129
129
|
}, N = e.gapColor;
|
|
130
130
|
}
|
|
131
131
|
let P = d ? "d 60ms ease-in-out" : "none", F = null;
|
|
132
132
|
if (n) {
|
|
133
|
-
let e =
|
|
133
|
+
let e = ue({
|
|
134
134
|
top: O,
|
|
135
135
|
left: D,
|
|
136
136
|
bottom: A,
|
|
137
137
|
right: k
|
|
138
138
|
});
|
|
139
|
-
j && (e += " " +
|
|
139
|
+
j && (e += " " + ue({
|
|
140
140
|
top: j.y,
|
|
141
141
|
left: j.x,
|
|
142
142
|
bottom: j.y + j.height,
|
|
@@ -154,7 +154,7 @@ var G = (e, t) => {
|
|
|
154
154
|
}
|
|
155
155
|
let I = null;
|
|
156
156
|
if (r && i) {
|
|
157
|
-
let e =
|
|
157
|
+
let e = ue({
|
|
158
158
|
top: O,
|
|
159
159
|
left: D,
|
|
160
160
|
right: k,
|
|
@@ -202,38 +202,38 @@ var G = (e, t) => {
|
|
|
202
202
|
children: [F, I]
|
|
203
203
|
});
|
|
204
204
|
});
|
|
205
|
-
|
|
206
|
-
var
|
|
207
|
-
if (
|
|
208
|
-
|
|
205
|
+
le.displayName = "RectangleSVG";
|
|
206
|
+
var ue = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right} ${e.bottom} L ${e.left} ${e.bottom} L ${e.left} ${e.top} ${t ? "Z" : ""}`, de = "sxl-marching-ants", fe = !1, pe = () => {
|
|
207
|
+
if (fe || typeof document > "u") return;
|
|
208
|
+
fe = !0;
|
|
209
209
|
let e = document.createElement("style");
|
|
210
|
-
e.appendChild(document.createTextNode(`@keyframes ${
|
|
210
|
+
e.appendChild(document.createTextNode(`@keyframes ${de} { to { stroke-dashoffset: 0; } }`)), document.head.appendChild(e);
|
|
211
211
|
};
|
|
212
|
-
function
|
|
212
|
+
function me(e) {
|
|
213
213
|
var t, n, r = "";
|
|
214
214
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
215
215
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
216
216
|
var i = e.length;
|
|
217
|
-
for (t = 0; t < i; t++) e[t] && (n =
|
|
217
|
+
for (t = 0; t < i; t++) e[t] && (n = me(e[t])) && (r && (r += " "), r += n);
|
|
218
218
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
219
219
|
return r;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t =
|
|
221
|
+
function q() {
|
|
222
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = me(e)) && (r && (r += " "), r += t);
|
|
223
223
|
return r;
|
|
224
224
|
}
|
|
225
|
-
var
|
|
225
|
+
var J = (e, t, n) => Math.min(n, Math.max(t, e)), he = (e, t, n) => {
|
|
226
226
|
let r = [], i = t;
|
|
227
227
|
for (; i <= n;) {
|
|
228
228
|
let t = e ? Math.max(0, e(i)) : 0;
|
|
229
229
|
t === 0 ? (r.push(i), i++) : i += t;
|
|
230
230
|
}
|
|
231
231
|
return r;
|
|
232
|
-
},
|
|
232
|
+
}, ge = (e, t, n, r, i, a) => {
|
|
233
233
|
if (n - t >= i - r) return r;
|
|
234
234
|
let o = r;
|
|
235
235
|
return e === "nearest" && (r - t > 0 ? e = "start" : n - i > 0 && (e = "end")), e === "start" ? o = t : e === "end" ? o = n - (i - r) : e === "center" && (o = t + (n - t) / 2 - (i - r) / 2), o < r ? Math.max(0, o) : o > r ? Math.min(o, a - (i - r)) : void 0;
|
|
236
|
-
},
|
|
236
|
+
}, _e = (e, t = !1, n, r) => {
|
|
237
237
|
if (!n) return 0;
|
|
238
238
|
let i = !t, a = i ? 1 : -1, o = n(i ? e : e + 1), s = n(i ? e + 1 : e), c = e + (i ? 2 : -1), l = 0;
|
|
239
239
|
for (; (s - o) * a <= 0;) {
|
|
@@ -241,13 +241,13 @@ var q = (e, t, n) => Math.min(n, Math.max(t, e)), ge = (e, t, n) => {
|
|
|
241
241
|
o = s, s = n(c), c += a, l++;
|
|
242
242
|
}
|
|
243
243
|
return l;
|
|
244
|
-
},
|
|
244
|
+
}, Y = (e, t, n) => {
|
|
245
245
|
if (!n) return !1;
|
|
246
246
|
let r = n.x;
|
|
247
247
|
if (e < r || e > r + n.width) return !1;
|
|
248
248
|
let i = n.y;
|
|
249
249
|
return !(t < i || t > i + n.height);
|
|
250
|
-
},
|
|
250
|
+
}, ve = "_grid-stage_rzp9d_1", ye = {
|
|
251
251
|
pointerdown: "onPointerDown",
|
|
252
252
|
pointermove: "onPointerMove",
|
|
253
253
|
pointerup: "onPointerUp",
|
|
@@ -423,7 +423,7 @@ var q = (e, t, n) => Math.min(n, Math.max(t, e)), ge = (e, t, n) => {
|
|
|
423
423
|
registerLayer: _
|
|
424
424
|
}), []);
|
|
425
425
|
return u(() => _({ getElement: () => U.current }), [_]), b("div", {
|
|
426
|
-
className:
|
|
426
|
+
className: q(n, "stage", ve),
|
|
427
427
|
ref: U,
|
|
428
428
|
tabIndex: 0,
|
|
429
429
|
...o,
|
|
@@ -657,7 +657,7 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
657
657
|
let r = g();
|
|
658
658
|
for (let e = 0; e < Ae.length; e++) {
|
|
659
659
|
let t = r[Ae[e]];
|
|
660
|
-
if (t &&
|
|
660
|
+
if (t && Y(n.x, n.y, t.getPaneBounds())) return t;
|
|
661
661
|
}
|
|
662
662
|
return null;
|
|
663
663
|
},
|
|
@@ -743,7 +743,7 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
743
743
|
children: t
|
|
744
744
|
});
|
|
745
745
|
}, Re = { "sheetxl-grid": "_sheetxl-grid_5yo0n_7" }, ze = s(a((e, t) => {
|
|
746
|
-
let { rowCount: r = 1, columnCount: a = 1, viewport: s, metrics: l, getRangeFromCell: d = H.cellToRange, hiddenRowsAt: f, hiddenColumnsAt: _, freezeLeft: v = 0, freezeTop: S = 0, propsFreezeLeft: C, propsFreezeTop: w, onFirstRender: T, children: E, wrapPane: D, onFocus: O, onBlur: k, className: j, style: M, ...N } = e, P = F(O, [O]), I = F(k, [k]), L = F(T, [T]), [z, ee] = g(V.Center), [B, te] = m((e) => e + 1, 0), U = p(() => new A({}), []), W = s ?? U, [
|
|
746
|
+
let { rowCount: r = 1, columnCount: a = 1, viewport: s, metrics: l, getRangeFromCell: d = H.cellToRange, hiddenRowsAt: f, hiddenColumnsAt: _, freezeLeft: v = 0, freezeTop: S = 0, propsFreezeLeft: C, propsFreezeTop: w, onFirstRender: T, children: E, wrapPane: D, onFocus: O, onBlur: k, className: j, style: M, ...N } = e, P = F(O, [O]), I = F(k, [k]), L = F(T, [T]), [z, ee] = g(V.Center), [B, te] = m((e) => e + 1, 0), U = p(() => new A({}), []), W = s ?? U, [G, re] = g(() => {
|
|
747
747
|
let e = W.getClient();
|
|
748
748
|
return {
|
|
749
749
|
zoom: W.getZoom(),
|
|
@@ -753,7 +753,7 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
753
753
|
};
|
|
754
754
|
});
|
|
755
755
|
u(() => {
|
|
756
|
-
let e = () =>
|
|
756
|
+
let e = () => re((e) => {
|
|
757
757
|
let t = W.getClient(), n = {
|
|
758
758
|
zoom: W.getZoom(),
|
|
759
759
|
w: t.width,
|
|
@@ -764,35 +764,35 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
764
764
|
});
|
|
765
765
|
return e(), W.subscribe(e);
|
|
766
766
|
}, [W]);
|
|
767
|
-
let
|
|
767
|
+
let ie = G.zoom, K = p(() => {
|
|
768
768
|
let e = l ?? Be;
|
|
769
769
|
return {
|
|
770
|
-
getColOffset: (t) => e.getColOffset(t) *
|
|
771
|
-
getColIndex: (t) => e.getColIndex(t /
|
|
772
|
-
getRowOffset: (t) => e.getRowOffset(t) *
|
|
773
|
-
getRowIndex: (t) => e.getRowIndex(t /
|
|
770
|
+
getColOffset: (t) => e.getColOffset(t) * ie,
|
|
771
|
+
getColIndex: (t) => e.getColIndex(t / ie),
|
|
772
|
+
getRowOffset: (t) => e.getRowOffset(t) * ie,
|
|
773
|
+
getRowIndex: (t) => e.getRowIndex(t / ie)
|
|
774
774
|
};
|
|
775
|
-
}, [l,
|
|
775
|
+
}, [l, ie]), ae = F((e, t = !1) => _e(e, t, K.getRowOffset, t ? 0 : r), [r, K?.getRowOffset]), oe = F(f ?? ae, [f]), se = F((e, t = !1) => _e(e, t, K.getColOffset, t ? a : 0), [a, K?.getColOffset]), le = F(_ ?? se, [_]), ue = c(() => {
|
|
776
776
|
te();
|
|
777
|
-
}, []),
|
|
777
|
+
}, []), de = p(() => Math.min(G.w, K.getColOffset(a)), [
|
|
778
778
|
B,
|
|
779
|
-
|
|
779
|
+
K.getColOffset,
|
|
780
780
|
a,
|
|
781
|
-
|
|
782
|
-
]),
|
|
781
|
+
G.w
|
|
782
|
+
]), fe = p(() => Math.min(G.h, K.getRowOffset(r)), [
|
|
783
783
|
B,
|
|
784
|
-
|
|
784
|
+
K.getRowOffset,
|
|
785
785
|
r,
|
|
786
|
-
|
|
787
|
-
]),
|
|
786
|
+
G.h
|
|
787
|
+
]), pe = p(() => {
|
|
788
788
|
let e = NaN, t = null;
|
|
789
789
|
return (n) => (n === e && t || (e = n, t = ((e) => {
|
|
790
|
-
if (
|
|
790
|
+
if (fe === 0) return Me;
|
|
791
791
|
let t = [], n = 0, i = 0;
|
|
792
|
-
typeof S == "number" ? n = S : (n = S.index ?? 0, i = (S.offset ?? 0) *
|
|
793
|
-
let a = i, o =
|
|
792
|
+
typeof S == "number" ? n = S : (n = S.index ?? 0, i = (S.offset ?? 0) * ie);
|
|
793
|
+
let a = i, o = K.getRowOffset(n), s = o - a;
|
|
794
794
|
if (n > 0) {
|
|
795
|
-
let e = je(
|
|
795
|
+
let e = je(K, { top: i + K.getRowOffset(0) }), r = K.getRowIndex(a), c = K.getRowIndex(o - 1), l;
|
|
796
796
|
t[1] = {
|
|
797
797
|
minIndex: r,
|
|
798
798
|
maxIndex: c,
|
|
@@ -800,14 +800,14 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
800
800
|
maxCoord: n - 1,
|
|
801
801
|
minBounds: 0,
|
|
802
802
|
maxBounds: s,
|
|
803
|
-
visibleIndices: (e, t) => e !== void 0 && t !== void 0 ?
|
|
803
|
+
visibleIndices: (e, t) => e !== void 0 && t !== void 0 ? he(oe, e, t) : l || (l = Object.freeze(he(oe, r, c)), l),
|
|
804
804
|
metrics: e,
|
|
805
805
|
maxVirtualBounds: o,
|
|
806
806
|
scrollOffset: i,
|
|
807
807
|
freezeOffset: i
|
|
808
808
|
};
|
|
809
809
|
}
|
|
810
|
-
let c = Math.max(0,
|
|
810
|
+
let c = Math.max(0, fe - s), l = je(K, { top: e + s }), u = l.getRowIndex(0), d = l.getRowIndex(c - 1), f;
|
|
811
811
|
return t[0] = {
|
|
812
812
|
minIndex: u,
|
|
813
813
|
maxIndex: d,
|
|
@@ -815,31 +815,31 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
815
815
|
maxCoord: r - 1,
|
|
816
816
|
minBounds: s,
|
|
817
817
|
maxBounds: c,
|
|
818
|
-
visibleIndices: (e, t) => e !== void 0 && t !== void 0 ?
|
|
818
|
+
visibleIndices: (e, t) => e !== void 0 && t !== void 0 ? he(oe, e, t) : f || (f = Object.freeze(he(oe, u, d)), f),
|
|
819
819
|
metrics: l,
|
|
820
|
-
maxVirtualBounds:
|
|
820
|
+
maxVirtualBounds: K.getRowOffset(r),
|
|
821
821
|
scrollOffset: e,
|
|
822
|
-
freezeOffset: (n > 0 ?
|
|
822
|
+
freezeOffset: (n > 0 ? K.getRowOffset(n) : 0) - i
|
|
823
823
|
}, t;
|
|
824
824
|
})(n)), t);
|
|
825
825
|
}, [
|
|
826
826
|
B,
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
827
|
+
K.getRowIndex,
|
|
828
|
+
K.getRowOffset,
|
|
829
|
+
oe,
|
|
830
|
+
fe,
|
|
831
831
|
r,
|
|
832
832
|
S,
|
|
833
|
-
|
|
834
|
-
]),
|
|
833
|
+
ie
|
|
834
|
+
]), me = p(() => pe(0), [pe]), J = p(() => {
|
|
835
835
|
let e = NaN, t = null;
|
|
836
836
|
return (n) => (n === e && t || (e = n, t = ((e) => {
|
|
837
|
-
if (
|
|
837
|
+
if (de === 0) return Me;
|
|
838
838
|
let t = [], n = 0, r = 0;
|
|
839
|
-
typeof v == "number" ? n = v : (n = v.index ?? 0, r = (v.offset ?? 0) *
|
|
840
|
-
let i = r, o =
|
|
839
|
+
typeof v == "number" ? n = v : (n = v.index ?? 0, r = (v.offset ?? 0) * ie);
|
|
840
|
+
let i = r, o = K.getColOffset(n), s = o - i;
|
|
841
841
|
if (n > 0) {
|
|
842
|
-
let e = je(
|
|
842
|
+
let e = je(K, { left: r + K.getColOffset(0) }), a = K.getColIndex(i), c = K.getColIndex(o - 1), l;
|
|
843
843
|
t[1] = {
|
|
844
844
|
minIndex: a,
|
|
845
845
|
maxIndex: c,
|
|
@@ -847,14 +847,14 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
847
847
|
maxCoord: n - 1,
|
|
848
848
|
minBounds: 0,
|
|
849
849
|
maxBounds: s,
|
|
850
|
-
visibleIndices: (e, t) => e !== void 0 && t !== void 0 ?
|
|
850
|
+
visibleIndices: (e, t) => e !== void 0 && t !== void 0 ? he(le, e, t) : l || (l = Object.freeze(he(le, a, c)), l),
|
|
851
851
|
metrics: e,
|
|
852
852
|
maxVirtualBounds: o,
|
|
853
853
|
scrollOffset: r,
|
|
854
854
|
freezeOffset: r
|
|
855
855
|
};
|
|
856
856
|
}
|
|
857
|
-
let c = Math.max(0,
|
|
857
|
+
let c = Math.max(0, de - s), l = je(K, { left: e + s }), u = l.getColIndex(0), d = l.getColIndex(c - 1), f;
|
|
858
858
|
return t[0] = {
|
|
859
859
|
minIndex: u,
|
|
860
860
|
maxIndex: d,
|
|
@@ -862,23 +862,23 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
862
862
|
maxCoord: a - 1,
|
|
863
863
|
minBounds: s,
|
|
864
864
|
maxBounds: c,
|
|
865
|
-
visibleIndices: (e, t) => e !== void 0 && t !== void 0 ?
|
|
865
|
+
visibleIndices: (e, t) => e !== void 0 && t !== void 0 ? he(le, e, t) : f || (f = Object.freeze(he(le, u, d)), f),
|
|
866
866
|
metrics: l,
|
|
867
|
-
maxVirtualBounds:
|
|
867
|
+
maxVirtualBounds: K.getColOffset(a),
|
|
868
868
|
scrollOffset: e,
|
|
869
|
-
freezeOffset: (n > 0 ?
|
|
869
|
+
freezeOffset: (n > 0 ? K.getColOffset(n) : 0) - r
|
|
870
870
|
}, t;
|
|
871
871
|
})(n)), t);
|
|
872
872
|
}, [
|
|
873
873
|
B,
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
874
|
+
K.getColIndex,
|
|
875
|
+
K.getColOffset,
|
|
876
|
+
le,
|
|
877
|
+
de,
|
|
878
878
|
a,
|
|
879
879
|
v,
|
|
880
|
-
|
|
881
|
-
]),
|
|
880
|
+
ie
|
|
881
|
+
]), ve = p(() => J(0), [J]), ye = h([]), [be, xe] = m((e) => e + 1, 0), Se = me.length, Ce = ve.length, Te = p(() => {
|
|
882
882
|
let e = [], t = (t, n, r, i, a) => {
|
|
883
883
|
if (t >= Ce || n >= Se) return null;
|
|
884
884
|
let o = {
|
|
@@ -919,16 +919,16 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
919
919
|
colEnd: a - 1,
|
|
920
920
|
rowEnd: r - 1
|
|
921
921
|
}, n = (n) => ke(n, {
|
|
922
|
-
rowDims:
|
|
923
|
-
columnDims:
|
|
924
|
-
computeRowDims:
|
|
925
|
-
computeColumnDims:
|
|
922
|
+
rowDims: me,
|
|
923
|
+
columnDims: ve,
|
|
924
|
+
computeRowDims: pe,
|
|
925
|
+
computeColumnDims: J,
|
|
926
926
|
viewport: W,
|
|
927
|
-
zoom:
|
|
928
|
-
containerWidth:
|
|
929
|
-
containerHeight:
|
|
927
|
+
zoom: ie,
|
|
928
|
+
containerWidth: de,
|
|
929
|
+
containerHeight: fe,
|
|
930
930
|
getRangeFromCell: d,
|
|
931
|
-
invalidate:
|
|
931
|
+
invalidate: ue,
|
|
932
932
|
totalRange: t,
|
|
933
933
|
getSurfacePointFromPointer: (e, t) => ze(e, t),
|
|
934
934
|
scrollTo: (e) => Q(e),
|
|
@@ -942,20 +942,20 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
942
942
|
return e = Object.freeze(e), e;
|
|
943
943
|
}, [
|
|
944
944
|
Te,
|
|
945
|
-
he,
|
|
946
|
-
Y,
|
|
947
945
|
me,
|
|
948
|
-
|
|
946
|
+
ve,
|
|
947
|
+
pe,
|
|
948
|
+
J,
|
|
949
949
|
W,
|
|
950
950
|
d,
|
|
951
951
|
be
|
|
952
|
-
]), Ee =
|
|
953
|
-
let e =
|
|
952
|
+
]), Ee = ve[0]?.maxVirtualBounds ?? 0, Ae = me[0]?.maxVirtualBounds ?? 0, Ne = G.ready, Fe = p(() => {
|
|
953
|
+
let e = ve[1], t = me[1];
|
|
954
954
|
return {
|
|
955
955
|
left: e ? e.metrics.getColOffset(e.maxIndex + 1) : 0,
|
|
956
956
|
top: t ? t.metrics.getRowOffset(t.maxIndex + 1) : 0
|
|
957
957
|
};
|
|
958
|
-
}, [
|
|
958
|
+
}, [me, ve]), Ie = F((e) => {
|
|
959
959
|
ne.canUseDOM && setTimeout(() => {
|
|
960
960
|
(X[z]?.getElement() ?? X[V.Center]?.getElement())?.focus({
|
|
961
961
|
preventScroll: !0,
|
|
@@ -989,19 +989,19 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
989
989
|
let { x: r, y: i } = n, a = null, o = Ye, s = o.length;
|
|
990
990
|
for (let e = 0; !a && e < s; e++) {
|
|
991
991
|
let t = X[o[e]];
|
|
992
|
-
t &&
|
|
992
|
+
t && Y(r, i, t.getPaneBounds()) && (a = t);
|
|
993
993
|
}
|
|
994
994
|
return a ||= X[V.Center], a;
|
|
995
995
|
}, [X, d]);
|
|
996
996
|
u(() => {
|
|
997
|
-
let e =
|
|
997
|
+
let e = ve?.[1]?.scrollOffset ?? 0, t = me?.[1]?.scrollOffset ?? 0;
|
|
998
998
|
W.setContent(Ee, Ae, e, t);
|
|
999
999
|
}, [
|
|
1000
1000
|
W,
|
|
1001
1001
|
Ee,
|
|
1002
1002
|
Ae,
|
|
1003
|
-
|
|
1004
|
-
|
|
1003
|
+
ve,
|
|
1004
|
+
me
|
|
1005
1005
|
]);
|
|
1006
1006
|
let Xe = F((e) => {
|
|
1007
1007
|
let t = e?.left ?? e?.[0], n = e?.top ?? e?.[1];
|
|
@@ -1016,7 +1016,7 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
1016
1016
|
let t = X[z];
|
|
1017
1017
|
if (!t) return X[V.Center];
|
|
1018
1018
|
let n = t.getScrollOrientation(), r = { ...t.getVisibleRange() };
|
|
1019
|
-
return n.vertical && (r.rowStart =
|
|
1019
|
+
return n.vertical && (r.rowStart = me[0].minCoord, r.rowEnd = me[0].maxCoord), n.horizontal && (r.colStart = ve[0].minCoord, r.colEnd = ve[0].maxCoord), n && H.isCellWithinRange(e, r) ? t : X[V.Center];
|
|
1020
1020
|
}, [X, z]), $e = F((e, t = {
|
|
1021
1021
|
inline: "nearest",
|
|
1022
1022
|
block: "nearest"
|
|
@@ -1043,7 +1043,7 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
1043
1043
|
inline: "end",
|
|
1044
1044
|
...n
|
|
1045
1045
|
};
|
|
1046
|
-
let r =
|
|
1046
|
+
let r = ge(n.inline ?? "end", e.x, e.x + e.width, t.left, t.left + t.width, t.totalWidth), i = ge(n.block ?? "end", e.y, e.y + e.height, t.top, t.top + t.height, t.totalHeight);
|
|
1047
1047
|
if (r !== void 0 || i !== void 0) return {
|
|
1048
1048
|
left: r ?? t.left,
|
|
1049
1049
|
top: i ?? t.top
|
|
@@ -1087,7 +1087,7 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
1087
1087
|
W.setTarget(i, a, o);
|
|
1088
1088
|
}, []), et = R(t, () => ({
|
|
1089
1089
|
focus: Ie,
|
|
1090
|
-
invalidate:
|
|
1090
|
+
invalidate: ue,
|
|
1091
1091
|
scrollTo: Q,
|
|
1092
1092
|
scrollBy: Xe,
|
|
1093
1093
|
scrollCellCoordsIntoView: $e,
|
|
@@ -1131,43 +1131,43 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
1131
1131
|
D,
|
|
1132
1132
|
r,
|
|
1133
1133
|
a
|
|
1134
|
-
]), rt = p(() => Fe.left === 0 ? null : b(
|
|
1134
|
+
]), rt = p(() => Fe.left === 0 ? null : b(ce, {
|
|
1135
1135
|
linePoints: [
|
|
1136
1136
|
0,
|
|
1137
1137
|
0,
|
|
1138
1138
|
0,
|
|
1139
|
-
|
|
1139
|
+
fe + 1
|
|
1140
1140
|
],
|
|
1141
1141
|
bounds: {
|
|
1142
1142
|
x: Fe.left,
|
|
1143
1143
|
y: 0,
|
|
1144
1144
|
width: 1,
|
|
1145
|
-
height:
|
|
1145
|
+
height: fe + 1
|
|
1146
1146
|
},
|
|
1147
1147
|
...C
|
|
1148
1148
|
}), [
|
|
1149
1149
|
B,
|
|
1150
1150
|
Fe.left,
|
|
1151
|
-
|
|
1151
|
+
fe,
|
|
1152
1152
|
C
|
|
1153
|
-
]), it = p(() => Fe.top === 0 ? null : b(
|
|
1153
|
+
]), it = p(() => Fe.top === 0 ? null : b(ce, {
|
|
1154
1154
|
linePoints: [
|
|
1155
1155
|
0,
|
|
1156
1156
|
0,
|
|
1157
|
-
|
|
1157
|
+
de + 1,
|
|
1158
1158
|
0
|
|
1159
1159
|
],
|
|
1160
1160
|
bounds: {
|
|
1161
1161
|
x: 0,
|
|
1162
1162
|
y: Fe.top,
|
|
1163
|
-
width:
|
|
1163
|
+
width: de + 1,
|
|
1164
1164
|
height: 1
|
|
1165
1165
|
},
|
|
1166
1166
|
...w
|
|
1167
1167
|
}), [
|
|
1168
1168
|
B,
|
|
1169
1169
|
Fe.top,
|
|
1170
|
-
|
|
1170
|
+
de,
|
|
1171
1171
|
w
|
|
1172
1172
|
]), at = h(!1), ot = p(() => {
|
|
1173
1173
|
if (!Ne) return null;
|
|
@@ -1199,8 +1199,8 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
1199
1199
|
X,
|
|
1200
1200
|
Te,
|
|
1201
1201
|
nt,
|
|
1202
|
+
de,
|
|
1202
1203
|
fe,
|
|
1203
|
-
pe,
|
|
1204
1204
|
Ne,
|
|
1205
1205
|
Fe
|
|
1206
1206
|
]);
|
|
@@ -1208,7 +1208,7 @@ var Te = Object.freeze([]), X = (e, t) => {
|
|
|
1208
1208
|
!at.current && ot && Ne && (at.current = !0, L?.(et.current));
|
|
1209
1209
|
}, [ot, Ne]), b("div", {
|
|
1210
1210
|
ref: et,
|
|
1211
|
-
className:
|
|
1211
|
+
className: q(j, "grid-surface", Re["sheetxl-grid"]),
|
|
1212
1212
|
style: {
|
|
1213
1213
|
overflow: "hidden",
|
|
1214
1214
|
...M
|
|
@@ -1412,7 +1412,7 @@ var Q = (e) => e ? (t) => e(t) : void 0, et = !1, tt = !1, nt = "_virtual-div_16
|
|
|
1412
1412
|
height: S.height
|
|
1413
1413
|
};
|
|
1414
1414
|
return b("div", {
|
|
1415
|
-
className:
|
|
1415
|
+
className: q(p, nt),
|
|
1416
1416
|
style: {
|
|
1417
1417
|
width: `${A}px`,
|
|
1418
1418
|
height: `${j}px`,
|
|
@@ -1426,7 +1426,7 @@ var Q = (e) => e ? (t) => e(t) : void 0, et = !1, tt = !1, nt = "_virtual-div_16
|
|
|
1426
1426
|
},
|
|
1427
1427
|
..._,
|
|
1428
1428
|
ref: y,
|
|
1429
|
-
children: g == null ? null : b(
|
|
1429
|
+
children: g == null ? null : b(oe.Provider, {
|
|
1430
1430
|
value: P,
|
|
1431
1431
|
children: g
|
|
1432
1432
|
})
|
|
@@ -2560,7 +2560,7 @@ function Gn(t) {
|
|
|
2560
2560
|
...e,
|
|
2561
2561
|
isPositioned: !1 !== k.current
|
|
2562
2562
|
};
|
|
2563
|
-
j.current && !Vn(T.current, t) && (T.current = t,
|
|
2563
|
+
j.current && !Vn(T.current, t) && (T.current = t, re.flushSync(() => {
|
|
2564
2564
|
f(t);
|
|
2565
2565
|
}));
|
|
2566
2566
|
});
|
|
@@ -2660,12 +2660,20 @@ var Kn = (e, t) => {
|
|
|
2660
2660
|
options: [e, t]
|
|
2661
2661
|
};
|
|
2662
2662
|
}, Yn = (e) => {
|
|
2663
|
-
let t = I(), n = B(), r = e?.getElement(), i =
|
|
2664
|
-
|
|
2665
|
-
|
|
2663
|
+
let t = I(), n = B(), r = e?.getElement(), i = r?.ownerDocument, a = c((e) => {
|
|
2664
|
+
if (!i || typeof MutationObserver > "u") return () => {};
|
|
2665
|
+
let t = new MutationObserver(e);
|
|
2666
|
+
return t.observe(i.documentElement, {
|
|
2667
|
+
attributes: !0,
|
|
2668
|
+
subtree: !0,
|
|
2669
|
+
attributeFilter: [O, k]
|
|
2670
|
+
}), () => t.disconnect();
|
|
2671
|
+
}, [i]), o = () => `${r?.closest(`[${O}]`)?.getAttribute(O) ?? ""}\n${r?.closest(`[${k}]`)?.getAttribute(k) ?? ""}`, [s, l] = _(a, o, o).split("\n"), u = {};
|
|
2672
|
+
s && (u[O] = s), l && (u[k] = l);
|
|
2673
|
+
let d = [...t?.themeScope?.classes ?? [], n?.scopeClass].filter(Boolean);
|
|
2666
2674
|
return {
|
|
2667
|
-
className:
|
|
2668
|
-
attrs:
|
|
2675
|
+
className: d.length ? d.join(" ") : void 0,
|
|
2676
|
+
attrs: u
|
|
2669
2677
|
};
|
|
2670
2678
|
}, Xn = (e) => {
|
|
2671
2679
|
let { side: t, align: n = "center" } = e;
|
|
@@ -2696,7 +2704,7 @@ var Kn = (e, t) => {
|
|
|
2696
2704
|
y();
|
|
2697
2705
|
}, [t, y]), !i) return null;
|
|
2698
2706
|
let x = typeof l == "function" ? l(t) : l;
|
|
2699
|
-
return
|
|
2707
|
+
return ie(b("div", {
|
|
2700
2708
|
ref: _.setFloating,
|
|
2701
2709
|
className: [o, d].filter(Boolean).join(" ") || void 0,
|
|
2702
2710
|
...m,
|
|
@@ -2839,7 +2847,8 @@ var nr = ({ outOfView: e, close: t }) => (u(() => {
|
|
|
2839
2847
|
key: e.key ?? Ee(e.range),
|
|
2840
2848
|
range: e.range,
|
|
2841
2849
|
data: e.data,
|
|
2842
|
-
placement: e.placement
|
|
2850
|
+
placement: e.placement,
|
|
2851
|
+
alignOffset: e.alignOffset
|
|
2843
2852
|
}), lr = (e, t) => Array.isArray(e) ? e.includes(t) : e === t, ur = (e) => {
|
|
2844
2853
|
let t = e.getCoords();
|
|
2845
2854
|
return t ? `${t.rowIndex},${t.colIndex}` : null;
|
|
@@ -2882,14 +2891,14 @@ var nr = ({ outOfView: e, close: t }) => (u(() => {
|
|
|
2882
2891
|
}
|
|
2883
2892
|
let R = C ? A.target : null, ee = E && R !== null, B = T ? a === null ? null : cr(a) : ee ? R : L ?? R, V = T ? B !== null : ee || L !== null;
|
|
2884
2893
|
return b($e, {
|
|
2885
|
-
className:
|
|
2894
|
+
className: q(v, "range-float"),
|
|
2886
2895
|
onPointerMove: C ? N : void 0,
|
|
2887
2896
|
onPointerLeave: C ? M : void 0,
|
|
2888
2897
|
children: B && b(Qn, {
|
|
2889
2898
|
anchor: { range: B.range },
|
|
2890
2899
|
placement: B.placement ?? s,
|
|
2891
2900
|
offset: c,
|
|
2892
|
-
alignOffset: d,
|
|
2901
|
+
alignOffset: B.alignOffset ?? d,
|
|
2893
2902
|
boundary: h,
|
|
2894
2903
|
zIndex: g,
|
|
2895
2904
|
open: V,
|
|
@@ -2910,7 +2919,7 @@ var fr = (e) => {
|
|
|
2910
2919
|
return b(dr, {
|
|
2911
2920
|
...r,
|
|
2912
2921
|
activateOn: "hover",
|
|
2913
|
-
className:
|
|
2922
|
+
className: q(n, "hover-tip"),
|
|
2914
2923
|
children: ({ range: e, data: n, floatProps: r, state: i }) => t({
|
|
2915
2924
|
range: e,
|
|
2916
2925
|
data: n,
|
|
@@ -3062,11 +3071,11 @@ var xr = {
|
|
|
3062
3071
|
height: y.height
|
|
3063
3072
|
} : void 0;
|
|
3064
3073
|
return b(rt, {
|
|
3065
|
-
className:
|
|
3074
|
+
className: q(o),
|
|
3066
3075
|
bounds: h ?? void 0,
|
|
3067
3076
|
clipInsets: u,
|
|
3068
3077
|
style: { pointerEvents: "none" },
|
|
3069
|
-
children: b(
|
|
3078
|
+
children: b(le, {
|
|
3070
3079
|
bounds: v,
|
|
3071
3080
|
alignWidth: i,
|
|
3072
3081
|
hole: x,
|
|
@@ -3124,7 +3133,7 @@ var Cr = s((e) => {
|
|
|
3124
3133
|
["insert-bar-cap-end", h(r.end) ? r.end : null]
|
|
3125
3134
|
];
|
|
3126
3135
|
})(e).map(([t, i]) => i && b(rt, {
|
|
3127
|
-
className:
|
|
3136
|
+
className: q(t, e ? "row" : "column"),
|
|
3128
3137
|
bounds: i,
|
|
3129
3138
|
style: {
|
|
3130
3139
|
pointerEvents: "none",
|
|
@@ -3354,7 +3363,7 @@ var Pr = (e) => {
|
|
|
3354
3363
|
willChange: "transform"
|
|
3355
3364
|
} : void 0
|
|
3356
3365
|
}, R = {
|
|
3357
|
-
className:
|
|
3366
|
+
className: q("drag-handle", v),
|
|
3358
3367
|
onPointerDown: (e) => {
|
|
3359
3368
|
k(e) ? d(e) : A(e);
|
|
3360
3369
|
},
|
|
@@ -3445,7 +3454,7 @@ var Rr = () => {
|
|
|
3445
3454
|
}
|
|
3446
3455
|
};
|
|
3447
3456
|
}, Wr = (e, t) => e === t || !!e && !!t && e.axis === t.axis && H.isEqualCells(e.origin, t.origin), Gr = (e, t, n) => {
|
|
3448
|
-
let r = e.rowEnd - e.rowStart, i = e.colEnd - e.colStart, a =
|
|
3457
|
+
let r = e.rowEnd - e.rowStart, i = e.colEnd - e.colStart, a = J(t.origin.rowIndex, n.rowStart, n.rowEnd - r), o = J(t.origin.colIndex, n.colStart, n.colEnd - i);
|
|
3449
3458
|
return {
|
|
3450
3459
|
...e,
|
|
3451
3460
|
rowStart: a,
|
|
@@ -3527,14 +3536,14 @@ var Rr = () => {
|
|
|
3527
3536
|
return x(y, { children: [
|
|
3528
3537
|
b(rt, r === "entire" ? {
|
|
3529
3538
|
ref: v,
|
|
3530
|
-
className:
|
|
3539
|
+
className: q("drag-grip", m),
|
|
3531
3540
|
...N ? { bounds: N } : { range: t },
|
|
3532
3541
|
style: { cursor: O },
|
|
3533
3542
|
...k,
|
|
3534
3543
|
...A
|
|
3535
3544
|
} : {
|
|
3536
3545
|
ref: v,
|
|
3537
|
-
className:
|
|
3546
|
+
className: q("drag-grip", m),
|
|
3538
3547
|
range: t,
|
|
3539
3548
|
clipInsets: -j / 2,
|
|
3540
3549
|
style: {
|
|
@@ -3542,7 +3551,7 @@ var Rr = () => {
|
|
|
3542
3551
|
cursor: O
|
|
3543
3552
|
},
|
|
3544
3553
|
...k,
|
|
3545
|
-
children: b(
|
|
3554
|
+
children: b(le, {
|
|
3546
3555
|
stroke: "transparent",
|
|
3547
3556
|
alignWidth: i,
|
|
3548
3557
|
propsStrokePath: {
|
|
@@ -3558,7 +3567,7 @@ var Rr = () => {
|
|
|
3558
3567
|
};
|
|
3559
3568
|
Kr.displayName = "Draggable";
|
|
3560
3569
|
var qr = (e, t, n, r) => {
|
|
3561
|
-
let i = e.rowEnd - e.rowStart, a = e.colEnd - e.colStart, o =
|
|
3570
|
+
let i = e.rowEnd - e.rowStart, a = e.colEnd - e.colStart, o = J(e.rowStart + t, r.rowStart, r.rowEnd - i), s = J(e.colStart + n, r.colStart, r.colEnd - a);
|
|
3562
3571
|
return {
|
|
3563
3572
|
rowStart: o,
|
|
3564
3573
|
colStart: s,
|
|
@@ -3625,7 +3634,7 @@ var qr = (e, t, n, r) => {
|
|
|
3625
3634
|
Xr.displayName = "RangeResizer";
|
|
3626
3635
|
var Zr = (e, t, n, r) => {
|
|
3627
3636
|
let { rowStart: i, colStart: a, rowEnd: o, colEnd: s } = e;
|
|
3628
|
-
return t.includes("t") && (i =
|
|
3637
|
+
return t.includes("t") && (i = J(n.rowIndex, r.rowStart, r.rowEnd)), t.includes("b") && (o = J(n.rowIndex, r.rowStart, r.rowEnd)), t.includes("l") && (a = J(n.colIndex, r.colStart, r.colEnd)), t.includes("r") && (s = J(n.colIndex, r.colStart, r.colEnd)), {
|
|
3629
3638
|
rowStart: Math.min(i, o),
|
|
3630
3639
|
colStart: Math.min(a, s),
|
|
3631
3640
|
rowEnd: Math.max(i, o),
|
|
@@ -3737,7 +3746,7 @@ ei.displayName = "FillHandle";
|
|
|
3737
3746
|
var ti = s((e) => {
|
|
3738
3747
|
let { value: t, zoom: n, bounds: r, cell: i, range: a, children: o, className: s, ...c } = e;
|
|
3739
3748
|
return b("div", {
|
|
3740
|
-
className:
|
|
3749
|
+
className: q(s, "cell"),
|
|
3741
3750
|
...c,
|
|
3742
3751
|
children: t
|
|
3743
3752
|
});
|
|
@@ -3986,7 +3995,7 @@ var ti = s((e) => {
|
|
|
3986
3995
|
]);
|
|
3987
3996
|
return x(y, { children: [b(rt, {
|
|
3988
3997
|
fill: !0,
|
|
3989
|
-
className:
|
|
3998
|
+
className: q("tiles", ui.tiles, f, o),
|
|
3990
3999
|
style: {
|
|
3991
4000
|
pointerEvents: "none",
|
|
3992
4001
|
...s,
|
|
@@ -4000,7 +4009,7 @@ di.displayName = "CellTileDiv";
|
|
|
4000
4009
|
var fi = s((e) => {
|
|
4001
4010
|
let { renderCell: t, cacheToken: n, getVisibleCells: r, hiddenCellAt: i, suppressCell: a, className: o, style: s, ...c } = e;
|
|
4002
4011
|
return b($e, {
|
|
4003
|
-
className:
|
|
4012
|
+
className: q(o, "cells"),
|
|
4004
4013
|
...c,
|
|
4005
4014
|
children: b(di, {
|
|
4006
4015
|
renderCell: t,
|
|
@@ -4092,7 +4101,7 @@ var $ = 8, pi = 1 << 19, mi = 1, hi = 512, gi = !1, _i = (e, t, n) => {
|
|
|
4092
4101
|
if (!n) return null;
|
|
4093
4102
|
let a = e.getPaneBounds(), o = Math.ceil(a.width), s = Math.ceil(a.height), c = String(xi / T.getDevicePixelRatio());
|
|
4094
4103
|
return b("svg", {
|
|
4095
|
-
className:
|
|
4104
|
+
className: q(t ? "horizontal" : "vertical"),
|
|
4096
4105
|
width: `${o}`,
|
|
4097
4106
|
height: `${s}`,
|
|
4098
4107
|
viewBox: `0 0 ${o} ${s}`,
|
|
@@ -4121,10 +4130,10 @@ var $ = 8, pi = 1 << 19, mi = 1, hi = 512, gi = !1, _i = (e, t, n) => {
|
|
|
4121
4130
|
]);
|
|
4122
4131
|
return h || g ? b($e, {
|
|
4123
4132
|
...d,
|
|
4124
|
-
className:
|
|
4133
|
+
className: q(l, "gridlines"),
|
|
4125
4134
|
children: x(rt, {
|
|
4126
4135
|
fill: !0,
|
|
4127
|
-
className:
|
|
4136
|
+
className: q("gridlines-box", ui.gridlines),
|
|
4128
4137
|
style: {
|
|
4129
4138
|
pointerEvents: "none",
|
|
4130
4139
|
...u
|
|
@@ -4152,7 +4161,7 @@ var xi = 1, Si = -10, Ci = class {
|
|
|
4152
4161
|
H.isEqualSelectionCoords(this._coords, e) || (this._coords = e, this.listeners.forEach((e) => e()));
|
|
4153
4162
|
}
|
|
4154
4163
|
navigate(e, t = !1, n = !1, r = 1) {
|
|
4155
|
-
let i = this._getBounds(), { cell: a } = this._coords, o = e === U.Down ? 1 : e === U.Up ? -1 : 0, s = e === U.Right ? 1 : e === U.Left ? -1 : 0, c = (e) => e === 0 ? 0 : n ? e > 0 ? Infinity : -Infinity : e * Math.max(1, r), l = this._activeRange(), u = t ? a.rowIndex === l.rowStart ? l.rowEnd : l.rowStart : a.rowIndex, d = t ? a.colIndex === l.colStart ? l.colEnd : l.colStart : a.colIndex, f =
|
|
4164
|
+
let i = this._getBounds(), { cell: a } = this._coords, o = e === U.Down ? 1 : e === U.Up ? -1 : 0, s = e === U.Right ? 1 : e === U.Left ? -1 : 0, c = (e) => e === 0 ? 0 : n ? e > 0 ? Infinity : -Infinity : e * Math.max(1, r), l = this._activeRange(), u = t ? a.rowIndex === l.rowStart ? l.rowEnd : l.rowStart : a.rowIndex, d = t ? a.colIndex === l.colStart ? l.colEnd : l.colStart : a.colIndex, f = J(u + c(o), i.rowStart, i.rowEnd), p = J(d + c(s), i.colStart, i.colEnd);
|
|
4156
4165
|
if (!t) return void this.setSelection({
|
|
4157
4166
|
cell: {
|
|
4158
4167
|
rowIndex: f,
|
|
@@ -4177,7 +4186,7 @@ var xi = 1, Si = -10, Ci = class {
|
|
|
4177
4186
|
let r = e === W.Row ? t ? U.Left : U.Right : t ? U.Up : U.Down, i = this._coords;
|
|
4178
4187
|
if (!(i.ranges && i.ranges.length > 0) || H.isEqualRangesArrays([H.cellToRange(i.cell)], i.ranges)) {
|
|
4179
4188
|
if (n && !H.isSingleCell(n)) {
|
|
4180
|
-
let e =
|
|
4189
|
+
let e = G.findNextCellWithinSelection({
|
|
4181
4190
|
ranges: [n],
|
|
4182
4191
|
cell: i.cell,
|
|
4183
4192
|
rangeIndex: 0
|
|
@@ -4192,7 +4201,7 @@ var xi = 1, Si = -10, Ci = class {
|
|
|
4192
4201
|
this.navigate(r);
|
|
4193
4202
|
return;
|
|
4194
4203
|
}
|
|
4195
|
-
let a =
|
|
4204
|
+
let a = G.findNextCellWithinSelection(i, r, (e) => H.cellToRange(e));
|
|
4196
4205
|
this.setSelection(a);
|
|
4197
4206
|
}
|
|
4198
4207
|
_activeIndex() {
|
|
@@ -4293,13 +4302,13 @@ var xi = 1, Si = -10, Ci = class {
|
|
|
4293
4302
|
};
|
|
4294
4303
|
}
|
|
4295
4304
|
}, wi = (e, t) => ({
|
|
4296
|
-
rowStart:
|
|
4297
|
-
colStart:
|
|
4298
|
-
rowEnd:
|
|
4299
|
-
colEnd:
|
|
4305
|
+
rowStart: J(e.rowStart, t.rowStart, t.rowEnd),
|
|
4306
|
+
colStart: J(e.colStart, t.colStart, t.colEnd),
|
|
4307
|
+
rowEnd: J(e.rowEnd, t.rowStart, t.rowEnd),
|
|
4308
|
+
colEnd: J(e.colEnd, t.colStart, t.colEnd)
|
|
4300
4309
|
}), Ti = (e, t) => ({
|
|
4301
|
-
rowIndex:
|
|
4302
|
-
colIndex:
|
|
4310
|
+
rowIndex: J(e.rowIndex, t.rowStart, t.rowEnd),
|
|
4311
|
+
colIndex: J(e.colIndex, t.colStart, t.colEnd)
|
|
4303
4312
|
}), Ei = {
|
|
4304
4313
|
rowStart: 0,
|
|
4305
4314
|
colStart: 0,
|
|
@@ -4623,7 +4632,7 @@ var zi = (e) => {
|
|
|
4623
4632
|
});
|
|
4624
4633
|
return f(() => {
|
|
4625
4634
|
v();
|
|
4626
|
-
}, [t, v]),
|
|
4635
|
+
}, [t, v]), ie(b("div", {
|
|
4627
4636
|
ref: g.setFloating,
|
|
4628
4637
|
className: ["touch-select-grip", c].filter(Boolean).join(" "),
|
|
4629
4638
|
...l,
|
|
@@ -4679,21 +4688,21 @@ var zi = (e) => {
|
|
|
4679
4688
|
side: "b",
|
|
4680
4689
|
align: "end"
|
|
4681
4690
|
}, Ji = t.forwardRef((e, n) => {
|
|
4682
|
-
let { selection: r, getContentBounds: i, getRegionBounds: a, scrollIntoView: o, singleStyle: s, multiStyle: c, multiAnchorStyle: l, singleAnchorStyle: u, removePreviewStyle: d, insertBarStyle: f, isDropRefused: p, moveSourceStyle: m, singleLayer: h, multiLayer: g, enabledMove: _, onMove: v, onMoveStart: S, onMoveUpdate: C, onMoveEnd: T, moveCursor: E, enableFill: D, snapFillDestination: O, onFill: k, onFillStart: A, onFillPreview: j, onFillEnd: M, onFillMenu: N, resolveFillExtent: F, onEdgeDoubleClick: I, onSelectionEnd: L, onDragModeChange: R, renderTip: z, tipPlacement: ee, disableKeyboard: B, anchorHole: V = !0, ...ne } = e,
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
}, [
|
|
4686
|
-
let [
|
|
4687
|
-
|
|
4688
|
-
let
|
|
4689
|
-
|
|
4690
|
-
let
|
|
4691
|
-
|
|
4692
|
-
let
|
|
4693
|
-
|
|
4694
|
-
let
|
|
4695
|
-
|
|
4696
|
-
let
|
|
4691
|
+
let { selection: r, getContentBounds: i, getRegionBounds: a, scrollIntoView: o, singleStyle: s, multiStyle: c, multiAnchorStyle: l, singleAnchorStyle: u, removePreviewStyle: d, insertBarStyle: f, isDropRefused: p, moveSourceStyle: m, singleLayer: h, multiLayer: g, enabledMove: _, onMove: v, onMoveStart: S, onMoveUpdate: C, onMoveEnd: T, moveCursor: E, enableFill: D, snapFillDestination: O, onFill: k, onFillStart: A, onFillPreview: j, onFillEnd: M, onFillMenu: N, resolveFillExtent: F, onEdgeDoubleClick: I, onSelectionEnd: L, onDragModeChange: R, renderTip: z, tipPlacement: ee, disableKeyboard: B, anchorHole: V = !0, ...ne } = e, G = P(r, (e) => e.getSelection()), re = Li(r, { onSelectionEnd: L }), ie = t.useRef(R);
|
|
4692
|
+
ie.current = R, t.useEffect(() => {
|
|
4693
|
+
ie.current?.(re.dragMode);
|
|
4694
|
+
}, [re.dragMode]);
|
|
4695
|
+
let [K, ae] = t.useState(null), oe = Z(), se = t.useRef(r);
|
|
4696
|
+
se.current = r;
|
|
4697
|
+
let ce = t.useRef(oe);
|
|
4698
|
+
ce.current = oe;
|
|
4699
|
+
let le = t.useRef(i);
|
|
4700
|
+
le.current = i;
|
|
4701
|
+
let ue = t.useRef(a);
|
|
4702
|
+
ue.current = a;
|
|
4703
|
+
let de = t.useRef(o);
|
|
4704
|
+
de.current = o;
|
|
4705
|
+
let fe = t.useMemo(() => function(e) {
|
|
4697
4706
|
let { getSelection: t, getPane: n, getContentBounds: r, getScrollIntoView: i = () => {}, getRegionBounds: a = () => null } = e, o = () => t(), s = () => n(), c = () => s().getTotalRange(), l = r ?? c, u = (e) => a(e), d = (e) => {
|
|
4698
4707
|
let t = i();
|
|
4699
4708
|
t ? t(e) : s().scrollCellCoordsIntoView(e);
|
|
@@ -4902,27 +4911,27 @@ var zi = (e) => {
|
|
|
4902
4911
|
}
|
|
4903
4912
|
};
|
|
4904
4913
|
}({
|
|
4905
|
-
getSelection: () =>
|
|
4906
|
-
getPane: () =>
|
|
4907
|
-
getContentBounds: () =>
|
|
4908
|
-
getScrollIntoView: () =>
|
|
4909
|
-
getRegionBounds: (e) =>
|
|
4914
|
+
getSelection: () => se.current,
|
|
4915
|
+
getPane: () => ce.current,
|
|
4916
|
+
getContentBounds: () => le.current?.() ?? ce.current.getTotalRange(),
|
|
4917
|
+
getScrollIntoView: () => de.current,
|
|
4918
|
+
getRegionBounds: (e) => ue.current?.(e) ?? null
|
|
4910
4919
|
}), []);
|
|
4911
|
-
t.useImperativeHandle(n, () =>
|
|
4912
|
-
let
|
|
4920
|
+
t.useImperativeHandle(n, () => fe, [fe]);
|
|
4921
|
+
let pe = !!G.ranges && G.ranges.length > 0, me = pe ? [...G.ranges] : [H.cellToRange(G.cell)], q = me.length > 1, J = G.rangeIndex ?? -1, he = pe ? J >= 0 ? J : me.length - 1 : 0, ge = oe.getRangeFromCell(G.cell), _e = me[he] ?? H.cellToRange(G.cell), Y = ge && H.isRangeWithinRange(_e, ge) ? ge : _e, ve = H.intersectRanges(ge, Y) ?? H.cellToRange(G.cell), ye = me.filter((e, t) => t !== he), be = q ? Ki(Mi, c) : Ki(ji, s), xe = {
|
|
4913
4922
|
...Ni,
|
|
4914
4923
|
...l
|
|
4915
|
-
},
|
|
4924
|
+
}, Se = Ki(Pi, d), { refusedColor: Ce, ...we } = {
|
|
4916
4925
|
...Fi,
|
|
4917
4926
|
...f
|
|
4918
|
-
},
|
|
4919
|
-
let n = t.mods.shiftKey ? t.insert : null, r = t.mods.ctrlKey || t.mods.metaKey, i = n ? Gr(e, n,
|
|
4927
|
+
}, Te = m === null ? null : Ki(Ii, m), X = (e, t) => {
|
|
4928
|
+
let n = t.mods.shiftKey ? t.insert : null, r = t.mods.ctrlKey || t.mods.metaKey, i = n ? Gr(e, n, oe.getTotalRange()) : e, a = {
|
|
4920
4929
|
to: i,
|
|
4921
4930
|
copy: r,
|
|
4922
4931
|
insert: n?.axis
|
|
4923
4932
|
};
|
|
4924
|
-
return a.refused = !!n && !r && (p ? p(
|
|
4925
|
-
},
|
|
4933
|
+
return a.refused = !!n && !r && (p ? p(Y, a) : H.isRefusedInsertCut(H.classifyInsertCut(Y, i, n.axis))), a;
|
|
4934
|
+
}, Ee = (e) => {
|
|
4926
4935
|
let t = r.getSelection(), n = t.ranges, i = !!n && n.length > 0, a = i ? t.rangeIndex !== void 0 && t.rangeIndex >= 0 && t.rangeIndex < n.length ? t.rangeIndex : n.length - 1 : 0, o = i ? n.map((t, n) => n === a ? e : t) : [e], s = H.isCellWithinRange(t.cell, e) ? t.cell : {
|
|
4927
4936
|
rowIndex: e.rowStart,
|
|
4928
4937
|
colIndex: e.colStart
|
|
@@ -4932,66 +4941,66 @@ var zi = (e) => {
|
|
|
4932
4941
|
ranges: o,
|
|
4933
4942
|
rangeIndex: a
|
|
4934
4943
|
});
|
|
4935
|
-
},
|
|
4944
|
+
}, De = K ?? (re.dragMode === "extend" ? {
|
|
4936
4945
|
kind: "select",
|
|
4937
|
-
range:
|
|
4938
|
-
} : null),
|
|
4946
|
+
range: Y
|
|
4947
|
+
} : null), Oe = De && z ? z(De) : null, ke = t.Children.map(q ? g : h, (e) => {
|
|
4939
4948
|
if (!t.isValidElement(e)) return e;
|
|
4940
4949
|
let n = e.props;
|
|
4941
4950
|
return t.cloneElement(e, {
|
|
4942
|
-
range:
|
|
4951
|
+
range: Y,
|
|
4943
4952
|
onDragEnd: (e, t) => {
|
|
4944
|
-
n.onDragEnd?.(e, t),
|
|
4953
|
+
n.onDragEnd?.(e, t), Ee(e);
|
|
4945
4954
|
}
|
|
4946
4955
|
});
|
|
4947
4956
|
});
|
|
4948
4957
|
return x($e, {
|
|
4949
4958
|
...ne,
|
|
4950
|
-
onPointerDown:
|
|
4951
|
-
onPointerMove:
|
|
4952
|
-
onPointerUp:
|
|
4959
|
+
onPointerDown: re.onPointerDown,
|
|
4960
|
+
onPointerMove: re.onPointerMove,
|
|
4961
|
+
onPointerUp: re.onPointerUp,
|
|
4953
4962
|
onKeyDown: B ? void 0 : (e) => {
|
|
4954
|
-
|
|
4963
|
+
fe.handleKey(e) && (e.preventDefault(), e.stopPropagation());
|
|
4955
4964
|
},
|
|
4956
4965
|
children: [
|
|
4957
|
-
|
|
4958
|
-
x(y,
|
|
4959
|
-
|
|
4960
|
-
Yi(
|
|
4966
|
+
K?.kind === "move" && !K.drop.copy && Te && !H.isEqualRanges(K.to, K.from) && Yi(Te, K.from, void 0, !1, "move-source"),
|
|
4967
|
+
x(y, q ? { children: [
|
|
4968
|
+
ye.map((e, n) => b(t.Fragment, { children: Yi(be, e) }, `other-${n}`)),
|
|
4969
|
+
Yi(be, Y, V ? ve : void 0),
|
|
4961
4970
|
b(Sr, {
|
|
4962
4971
|
className: "anchor",
|
|
4963
|
-
range:
|
|
4964
|
-
...
|
|
4972
|
+
range: ve,
|
|
4973
|
+
...xe
|
|
4965
4974
|
})
|
|
4966
|
-
] } : { children: [Yi(
|
|
4975
|
+
] } : { children: [Yi(be, Y, V ? ve : void 0), u && b(Sr, {
|
|
4967
4976
|
className: "anchor",
|
|
4968
|
-
range:
|
|
4977
|
+
range: ve,
|
|
4969
4978
|
...u
|
|
4970
4979
|
})] }),
|
|
4971
|
-
!
|
|
4980
|
+
!q && _ && b(Kr, {
|
|
4972
4981
|
className: "move-grip",
|
|
4973
|
-
range:
|
|
4982
|
+
range: Y,
|
|
4974
4983
|
grip: "edges",
|
|
4975
4984
|
dragCursor: E,
|
|
4976
4985
|
renderMove: (e, t) => {
|
|
4977
|
-
let n =
|
|
4986
|
+
let n = X(e, t);
|
|
4978
4987
|
return n.insert ? b(Cr, {
|
|
4979
4988
|
range: n.to,
|
|
4980
4989
|
axis: n.insert,
|
|
4981
|
-
...
|
|
4982
|
-
color: (n.refused ?
|
|
4983
|
-
}) :
|
|
4990
|
+
...we,
|
|
4991
|
+
color: (n.refused ? Ce : void 0) ?? we.color
|
|
4992
|
+
}) : be.border && b(Sr, {
|
|
4984
4993
|
className: "move-ghost",
|
|
4985
4994
|
range: n.to,
|
|
4986
|
-
...
|
|
4995
|
+
...be.border,
|
|
4987
4996
|
animatedTransition: !0,
|
|
4988
4997
|
style: { opacity: .6 }
|
|
4989
4998
|
});
|
|
4990
4999
|
},
|
|
4991
5000
|
onEdgeDoubleClick: I,
|
|
4992
5001
|
onDragStart: (e, t, n) => {
|
|
4993
|
-
let r =
|
|
4994
|
-
S?.(e, t, r),
|
|
5002
|
+
let r = X(e, n);
|
|
5003
|
+
S?.(e, t, r), ae({
|
|
4995
5004
|
kind: "move",
|
|
4996
5005
|
from: e,
|
|
4997
5006
|
to: r.to,
|
|
@@ -4999,20 +5008,20 @@ var zi = (e) => {
|
|
|
4999
5008
|
});
|
|
5000
5009
|
},
|
|
5001
5010
|
onDragMove: (e, t, n) => {
|
|
5002
|
-
let r =
|
|
5003
|
-
C?.(
|
|
5011
|
+
let r = X(e, n);
|
|
5012
|
+
C?.(Y, r.to, t, r), ae({
|
|
5004
5013
|
kind: "move",
|
|
5005
|
-
from:
|
|
5014
|
+
from: Y,
|
|
5006
5015
|
to: r.to,
|
|
5007
5016
|
drop: r
|
|
5008
5017
|
});
|
|
5009
5018
|
},
|
|
5010
5019
|
onDragStateChange: (e) => {
|
|
5011
|
-
e || (T?.(),
|
|
5020
|
+
e || (T?.(), ae(null));
|
|
5012
5021
|
},
|
|
5013
5022
|
onDragEnd: (e, t, n) => {
|
|
5014
|
-
let i =
|
|
5015
|
-
i.refused || (v?.(
|
|
5023
|
+
let i = X(e, n);
|
|
5024
|
+
i.refused || (v?.(Y, i.to, t, i), r.modify({
|
|
5016
5025
|
rowIndex: i.to.rowEnd,
|
|
5017
5026
|
colIndex: i.to.colEnd
|
|
5018
5027
|
}, {
|
|
@@ -5021,53 +5030,53 @@ var zi = (e) => {
|
|
|
5021
5030
|
}));
|
|
5022
5031
|
}
|
|
5023
5032
|
}),
|
|
5024
|
-
!
|
|
5025
|
-
range:
|
|
5033
|
+
!q && D && b(ei, {
|
|
5034
|
+
range: Y,
|
|
5026
5035
|
snapDestination: O,
|
|
5027
|
-
...
|
|
5036
|
+
...be.border,
|
|
5028
5037
|
onDragStart: (e, t) => {
|
|
5029
|
-
A?.(e, t),
|
|
5038
|
+
A?.(e, t), ae({
|
|
5030
5039
|
kind: "fill",
|
|
5031
5040
|
template: e,
|
|
5032
5041
|
destination: e
|
|
5033
5042
|
});
|
|
5034
5043
|
},
|
|
5035
5044
|
onDragMove: (e, t) => {
|
|
5036
|
-
j?.(
|
|
5045
|
+
j?.(Y, e, t), ae({
|
|
5037
5046
|
kind: "fill",
|
|
5038
|
-
template:
|
|
5047
|
+
template: Y,
|
|
5039
5048
|
destination: e
|
|
5040
5049
|
});
|
|
5041
5050
|
},
|
|
5042
5051
|
onDragEnd: (e, t) => {
|
|
5043
|
-
k?.(
|
|
5052
|
+
k?.(Y, e, t), Ee(e);
|
|
5044
5053
|
},
|
|
5045
5054
|
onMenu: N ? (e, t, n) => {
|
|
5046
|
-
N(
|
|
5055
|
+
N(Y, e, t, n);
|
|
5047
5056
|
} : void 0,
|
|
5048
5057
|
onDragDone: () => {
|
|
5049
|
-
M?.(),
|
|
5058
|
+
M?.(), ae(null);
|
|
5050
5059
|
},
|
|
5051
5060
|
onDoubleClick: F ? (e, t) => {
|
|
5052
5061
|
let n = F(e);
|
|
5053
|
-
n && !H.isEqualRanges(n, e) && (k?.(e, n, t),
|
|
5062
|
+
n && !H.isEqualRanges(n, e) && (k?.(e, n, t), Ee(n));
|
|
5054
5063
|
} : void 0
|
|
5055
5064
|
}),
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5065
|
+
re.removePreview && Yi(Se, re.removePreview, void 0, !1, "remove-preview"),
|
|
5066
|
+
ke,
|
|
5067
|
+
Oe != null && De && b(Qn, {
|
|
5059
5068
|
className: "gesture-tip",
|
|
5060
|
-
anchor: { range: (
|
|
5069
|
+
anchor: { range: (Ae = De, Ae.kind === "move" ? Ae.to : Ae.kind === "fill" ? Ae.destination : Ae.range) },
|
|
5061
5070
|
placement: ee ?? qi,
|
|
5062
5071
|
offset: 8,
|
|
5063
5072
|
whenOff: "clamp",
|
|
5064
5073
|
open: !0,
|
|
5065
5074
|
style: { pointerEvents: "none" },
|
|
5066
|
-
children:
|
|
5075
|
+
children: Oe
|
|
5067
5076
|
})
|
|
5068
5077
|
]
|
|
5069
5078
|
});
|
|
5070
|
-
var
|
|
5079
|
+
var Ae;
|
|
5071
5080
|
});
|
|
5072
5081
|
Ji.displayName = "SelectionLayer";
|
|
5073
5082
|
var Yi = (e, t, n, r = !1, i = "range") => x(y, { children: [
|
|
@@ -5157,7 +5166,7 @@ var Yi = (e, t, n, r = !1, i = "range") => x(y, { children: [
|
|
|
5157
5166
|
children: [
|
|
5158
5167
|
(!a || O) && b(rt, {
|
|
5159
5168
|
fill: !0,
|
|
5160
|
-
className:
|
|
5169
|
+
className: q(m, "ranges-picker-draw"),
|
|
5161
5170
|
onPointerDown: (e) => {
|
|
5162
5171
|
e.stopPropagation(), d && e.preventDefault(), L.onPointerDown(e);
|
|
5163
5172
|
},
|
|
@@ -5538,86 +5547,92 @@ function pa(e) {
|
|
|
5538
5547
|
let { editable: t, renderEditor: n, alignment: r = "left", background: i = "var(--sxl-color-base-100, rgb(255, 255, 255))", borderColor: a = "var(--sxl-color-primary, rgb(33, 115, 70))", borderWidth: o = 2, zIndex: s, className: c, style: l, ...d } = e, f = Xe(), p = P(t, (e) => e.getSession()), m = z(p, (e) => e.getState()), [h, _] = g(null), v = F((e) => {
|
|
5539
5548
|
_((t) => t && t.width === e.width && t.height === e.height ? t : e);
|
|
5540
5549
|
}, []), y = F((e) => {
|
|
5541
|
-
if (t.getSession()) return;
|
|
5542
|
-
let n = t.getAnchor().getCoords();
|
|
5543
|
-
if (!n) return;
|
|
5544
|
-
let r = ia(e.nativeEvent);
|
|
5545
|
-
r && (e.nativeEvent.key !== "Process" && e.nativeEvent.keyCode !== 229 && e.preventDefault(), e.stopPropagation(), t.startEdit(n, r));
|
|
5546
|
-
}, [t]), x = F((e) => {
|
|
5547
|
-
if (t.getSession()) return;
|
|
5548
|
-
let n = f?.getCellFromPointer(e.clientX, e.clientY) ?? t.getAnchor().getCoords();
|
|
5549
|
-
n && t.startEdit(n, { mode: "edit" });
|
|
5550
|
-
}, [f, t]), S = F((e) => {
|
|
5551
5550
|
let n = t.commit(e);
|
|
5552
5551
|
return n && f?.focus(), n;
|
|
5553
|
-
}, [t, f]),
|
|
5552
|
+
}, [t, f]), x = F(() => {
|
|
5554
5553
|
t.cancel(), f?.focus();
|
|
5555
5554
|
}, [t, f]);
|
|
5556
5555
|
u(() => {
|
|
5557
5556
|
m && f && f.scrollCellCoordsIntoView(m.coords);
|
|
5558
5557
|
}, [m?.token]);
|
|
5559
|
-
let
|
|
5560
|
-
if (f &&
|
|
5561
|
-
let e = f.getRangeFromCell(
|
|
5562
|
-
if (
|
|
5558
|
+
let S = m ? m.coords : t.getAnchor().getCoords(), C = null, w = !1, T = !1;
|
|
5559
|
+
if (f && S) {
|
|
5560
|
+
let e = f.getRangeFromCell(S);
|
|
5561
|
+
if (T = f.toClipBounds(f.getBoundsFromRange({
|
|
5563
5562
|
rowStart: e.rowStart,
|
|
5564
5563
|
colStart: e.colStart,
|
|
5565
5564
|
rowEnd: e.rowStart,
|
|
5566
5565
|
colEnd: e.colStart
|
|
5567
5566
|
})) !== null, m) {
|
|
5568
|
-
let e = la(f,
|
|
5569
|
-
|
|
5570
|
-
} else
|
|
5567
|
+
let e = la(f, S, h, r, o);
|
|
5568
|
+
C = e?.bounds ?? null, w = e?.inView ?? !1;
|
|
5569
|
+
} else C = f.getBoundsFromRange(e);
|
|
5571
5570
|
}
|
|
5572
|
-
let
|
|
5573
|
-
if (f &&
|
|
5574
|
-
let e = f.getBoundsFromRange(f.getRangeFromCell(
|
|
5575
|
-
e && (
|
|
5571
|
+
let E = null;
|
|
5572
|
+
if (f && S) {
|
|
5573
|
+
let e = f.getBoundsFromRange(f.getRangeFromCell(S)), t = f.getZoom() || 1;
|
|
5574
|
+
e && (E = {
|
|
5576
5575
|
width: e.width / t,
|
|
5577
5576
|
height: e.height / t
|
|
5578
5577
|
});
|
|
5579
5578
|
}
|
|
5580
|
-
let
|
|
5579
|
+
let D = !!m && !!C && w, O = {
|
|
5581
5580
|
open: !!m,
|
|
5582
5581
|
mode: m?.mode ?? "enter",
|
|
5583
5582
|
coords: m?.coords ?? null,
|
|
5584
5583
|
clean: m?.clean ?? null,
|
|
5585
5584
|
dirty: m?.dirty,
|
|
5586
5585
|
token: m?.token ?? 0,
|
|
5587
|
-
autoFocus: (m?.autoFocus ?? !0) &&
|
|
5586
|
+
autoFocus: (m?.autoFocus ?? !0) && D && T,
|
|
5588
5587
|
initialSelection: m?.initialSelection,
|
|
5589
5588
|
zoom: f?.getZoom() ?? 1,
|
|
5590
|
-
cellSize:
|
|
5589
|
+
cellSize: E,
|
|
5591
5590
|
onDirtyChange: (e) => p?.setDirty(e),
|
|
5592
5591
|
onModeChange: (e) => p?.setMode(e),
|
|
5593
|
-
onCommit:
|
|
5594
|
-
onCancel:
|
|
5592
|
+
onCommit: y,
|
|
5593
|
+
onCancel: x,
|
|
5595
5594
|
onNaturalSize: v
|
|
5596
|
-
},
|
|
5595
|
+
}, k = typeof i == "function" ? (S ? i(S) : void 0) ?? "transparent" : i;
|
|
5596
|
+
return b($e, { children: C ? b(rt, {
|
|
5597
|
+
...d,
|
|
5598
|
+
className: q(c, "editor"),
|
|
5599
|
+
bounds: C,
|
|
5600
|
+
alignWidth: o,
|
|
5601
|
+
keepMounted: !0,
|
|
5602
|
+
style: {
|
|
5603
|
+
...l,
|
|
5604
|
+
display: "flex",
|
|
5605
|
+
overflow: "hidden",
|
|
5606
|
+
background: k,
|
|
5607
|
+
borderColor: a,
|
|
5608
|
+
boxShadow: D ? "rgba(60,64,67,.35) 2px 2px 6px 3px" : "none",
|
|
5609
|
+
opacity: +!!D,
|
|
5610
|
+
pointerEvents: D ? "auto" : "none"
|
|
5611
|
+
},
|
|
5612
|
+
children: n ? n(O) : b(fa, { ...O })
|
|
5613
|
+
}) : null });
|
|
5614
|
+
}
|
|
5615
|
+
function ma(e) {
|
|
5616
|
+
let { editable: t } = e, n = Xe();
|
|
5597
5617
|
return b($e, {
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
opacity: +!!k,
|
|
5614
|
-
pointerEvents: k ? "auto" : "none"
|
|
5615
|
-
},
|
|
5616
|
-
children: n ? n(A) : b(fa, { ...A })
|
|
5617
|
-
}) : null
|
|
5618
|
+
className: "editor-start",
|
|
5619
|
+
onKeyDown: F((e) => {
|
|
5620
|
+
if (t.getSession()) return;
|
|
5621
|
+
let r = n?.getElement();
|
|
5622
|
+
if (r && e.target !== r) return;
|
|
5623
|
+
let i = t.getAnchor().getCoords();
|
|
5624
|
+
if (!i) return;
|
|
5625
|
+
let a = ia(e.nativeEvent);
|
|
5626
|
+
a && (e.nativeEvent.key !== "Process" && e.nativeEvent.keyCode !== 229 && e.preventDefault(), e.stopPropagation(), t.startEdit(i, a));
|
|
5627
|
+
}, [t, n]),
|
|
5628
|
+
onDoubleClick: F((e) => {
|
|
5629
|
+
if (t.getSession()) return;
|
|
5630
|
+
let r = n?.getCellFromPointer(e.clientX, e.clientY) ?? t.getAnchor().getCoords();
|
|
5631
|
+
r && t.startEdit(r, { mode: "edit" });
|
|
5632
|
+
}, [n, t])
|
|
5618
5633
|
});
|
|
5619
5634
|
}
|
|
5620
|
-
function
|
|
5635
|
+
function ha(e) {
|
|
5621
5636
|
let { editable: t, renderEditor: n, idleClean: r = null, mapClean: i, editorId: a, readOnly: o, className: s, style: c } = e, l = P(t, (e) => e.getSession()), u = z(l, (e) => e.getState()), d = u?.clean ?? r, f = i ? i(d) : d, p = F((e) => t.commit(e), [t]), m = F(() => t.cancel(), [t]), h = F(() => {
|
|
5622
5637
|
o || (t.getSession() || t.startEdit(t.getAnchor().getCoords(), {
|
|
5623
5638
|
mode: "edit",
|
|
@@ -5650,15 +5665,15 @@ function ma(e) {
|
|
|
5650
5665
|
children: n ? n(g) : b(fa, { ...g })
|
|
5651
5666
|
});
|
|
5652
5667
|
}
|
|
5653
|
-
fa.displayName = "DefaultEditorInput",
|
|
5654
|
-
var
|
|
5668
|
+
fa.displayName = "DefaultEditorInput", ha.displayName = "EditorDiv";
|
|
5669
|
+
var ga = "ew-resize", _a = "ns-resize", va = s(a((e, t) => {
|
|
5655
5670
|
let { axis: n, index: r, className: i, style: a, disabled: o = !1, disabledResize: s = !1, isNextHidden: c, isHidden: l, isSelected: u, isSelectedAll: d, showTouchDivider: f, bounds: p, onPointerDown: m, onAutoFit: h, ...g } = e, _ = Z(), v = n === W.Column, y = 1 / T.getDevicePixelRatio(), S = u || d, C = 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))", w = "var(--sxl-color-base-100, #f5f5f5)", E = T.detectIt().primaryInput === "touch", D = v ? 14 : 8, O = _.getZoom();
|
|
5656
5671
|
O < 1 && (D = Math.max(2, D * O * .8));
|
|
5657
5672
|
let k = D / 2, A = 0;
|
|
5658
5673
|
c && (A = -2), l && (A = 2), l && (D = D / 2 + A, k = 2 * A);
|
|
5659
5674
|
let j = C;
|
|
5660
5675
|
return S || A !== 0 || (j = `linear-gradient(${v ? 180 : 90}deg, ${w}, ${C} 55%, ${C} 100%)`), x("div", {
|
|
5661
|
-
className:
|
|
5676
|
+
className: q("header-divider", { disabled: o }, i, `index-${r}`),
|
|
5662
5677
|
ref: t,
|
|
5663
5678
|
onPointerDown: E ? void 0 : m,
|
|
5664
5679
|
onDoubleClick: E ? void 0 : () => h?.(),
|
|
@@ -5670,7 +5685,7 @@ var ha = "ew-resize", ga = "ns-resize", _a = s(a((e, t) => {
|
|
|
5670
5685
|
position: "absolute",
|
|
5671
5686
|
overflow: "visible",
|
|
5672
5687
|
pointerEvents: "auto",
|
|
5673
|
-
cursor: o || s || E ? void 0 : v ?
|
|
5688
|
+
cursor: o || s || E ? void 0 : v ? ga : _a,
|
|
5674
5689
|
...a
|
|
5675
5690
|
},
|
|
5676
5691
|
...g,
|
|
@@ -5714,8 +5729,8 @@ var ha = "ew-resize", ga = "ns-resize", _a = s(a((e, t) => {
|
|
|
5714
5729
|
} })
|
|
5715
5730
|
}) : null]
|
|
5716
5731
|
});
|
|
5717
|
-
})),
|
|
5718
|
-
let { axis: n, index: r, disabled: i = !1, disabledResize: a = !1, resizeThreshold: o = 1, renderDivider: s =
|
|
5732
|
+
})), ya = (e) => b(va, { ...e }), ba = s(a((e, t) => {
|
|
5733
|
+
let { axis: n, index: r, disabled: i = !1, disabledResize: a = !1, resizeThreshold: o = 1, renderDivider: s = ya, onDividerMouseDown: c, onDividerResizeStart: l, onDividerResize: u, onDividerResizeEnd: d, onDividerMouseUp: f, onDividerAutoFit: p, onPointerDown: m, ..._ } = e, v = Z(), S = F(m, [m]), C = F(p, [p]), w = n === W.Column, E = w ? v.getVisibleColumns() : v.getVisibleRows(), D = null;
|
|
5719
5734
|
E.length > 0 && (D = w ? v.getBoundsFromRange({
|
|
5720
5735
|
rowStart: 0,
|
|
5721
5736
|
rowEnd: 0,
|
|
@@ -5778,15 +5793,15 @@ var ha = "ew-resize", ga = "ns-resize", _a = s(a((e, t) => {
|
|
|
5778
5793
|
}, v);
|
|
5779
5794
|
if (!te) return;
|
|
5780
5795
|
let H = null;
|
|
5781
|
-
return k && k.isResizing && k.index === r && (H =
|
|
5796
|
+
return k && k.isResizing && k.index === r && (H = ie(b("div", { style: {
|
|
5782
5797
|
position: "absolute",
|
|
5783
|
-
cursor: w ?
|
|
5798
|
+
cursor: w ? ga : _a,
|
|
5784
5799
|
left: 0,
|
|
5785
5800
|
top: 0,
|
|
5786
5801
|
width: "100%",
|
|
5787
5802
|
height: "100%"
|
|
5788
5803
|
} }), V(), "divider:" + r)), x(y, { children: [H, b("div", {
|
|
5789
|
-
className:
|
|
5804
|
+
className: q("header-divider-anchor"),
|
|
5790
5805
|
style: {
|
|
5791
5806
|
position: "absolute",
|
|
5792
5807
|
pointerEvents: "auto",
|
|
@@ -5800,26 +5815,26 @@ var ha = "ew-resize", ga = "ns-resize", _a = s(a((e, t) => {
|
|
|
5800
5815
|
children: te
|
|
5801
5816
|
})] });
|
|
5802
5817
|
}));
|
|
5803
|
-
|
|
5804
|
-
var
|
|
5818
|
+
ba.displayName = "HeaderDividerAnchor";
|
|
5819
|
+
var xa = (e, t, n) => t === W.Column ? {
|
|
5805
5820
|
rowIndex: n.rowStart,
|
|
5806
5821
|
colIndex: e.colIndex
|
|
5807
5822
|
} : {
|
|
5808
5823
|
rowIndex: e.rowIndex,
|
|
5809
5824
|
colIndex: n.colStart
|
|
5810
|
-
},
|
|
5825
|
+
}, Sa = (e, t, n) => t === W.Column ? {
|
|
5811
5826
|
rowIndex: n.rowEnd,
|
|
5812
5827
|
colIndex: e.colIndex
|
|
5813
5828
|
} : {
|
|
5814
5829
|
rowIndex: e.rowIndex,
|
|
5815
5830
|
colIndex: n.colEnd
|
|
5816
|
-
},
|
|
5831
|
+
}, Ca = (e, t, n) => t === W.Column ? {
|
|
5817
5832
|
rowIndex: n.rowStart,
|
|
5818
5833
|
colIndex: e.colIndex
|
|
5819
5834
|
} : {
|
|
5820
5835
|
rowIndex: e.rowIndex,
|
|
5821
5836
|
colIndex: n.colStart
|
|
5822
|
-
},
|
|
5837
|
+
}, wa = (e, t, n, r) => n === W.Column ? {
|
|
5823
5838
|
rowStart: r.rowStart,
|
|
5824
5839
|
rowEnd: r.rowEnd,
|
|
5825
5840
|
colStart: Math.min(e.colIndex, t.colIndex),
|
|
@@ -5829,7 +5844,7 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5829
5844
|
colEnd: r.colEnd,
|
|
5830
5845
|
rowStart: Math.min(e.rowIndex, t.rowIndex),
|
|
5831
5846
|
rowEnd: Math.max(e.rowIndex, t.rowIndex)
|
|
5832
|
-
},
|
|
5847
|
+
}, Ta = (e, t, n) => {
|
|
5833
5848
|
let r = null, i = null, a = 0, o = () => t.getAllPanes()[V.Center] ?? t, s = (t, n, r) => {
|
|
5834
5849
|
if (!e) return;
|
|
5835
5850
|
let i = e.getSelection(), a = !!i.ranges && i.ranges.length > 0;
|
|
@@ -5870,7 +5885,7 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5870
5885
|
let a = o().getVisibleRange(), s = null;
|
|
5871
5886
|
return t === W.Column ? e.x >= i.right - 24 && a.colEnd < r.colEnd ? s = { colIndex: a.colEnd + 1 } : e.x <= i.left + 24 && a.colStart > r.colStart && (s = { colIndex: a.colStart - 1 }) : e.y >= i.bottom - 24 && a.rowEnd < r.rowEnd ? s = { rowIndex: a.rowEnd + 1 } : e.y <= i.top + 24 && a.rowStart > r.rowStart && (s = { rowIndex: a.rowStart - 1 }), !!s && (l(s), !0);
|
|
5872
5887
|
}, d = (e) => {
|
|
5873
|
-
let { axis: t, entireRange: l, replaceActive: u = !1 } = n(), d =
|
|
5888
|
+
let { axis: t, entireRange: l, replaceActive: u = !1 } = n(), d = wa(r ?? e, e, t, l), f = i ?? Ca(e, t, o().getVisibleRange());
|
|
5874
5889
|
u ? c(a, d, f) : s(d, f, "replace");
|
|
5875
5890
|
};
|
|
5876
5891
|
return Mr(t, (t, f) => {
|
|
@@ -5880,11 +5895,11 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5880
5895
|
let { axis: h, entireRange: g, allowMulti: _ = !0, replaceActive: v = !1, preserveFocus: y = !1, onPointerDownInterceptor: b, onDragStart: x, onDragEnd: S, onPointerUp: C } = n();
|
|
5881
5896
|
if (!1 === b?.(f, t)) return null;
|
|
5882
5897
|
v && f.stopPropagation(), y && p && f.preventDefault(), x?.();
|
|
5883
|
-
let w =
|
|
5898
|
+
let w = Ca(t, h, o().getVisibleRange()), T = f.shiftKey, E = (f.ctrlKey || f.metaKey) && _;
|
|
5884
5899
|
if (v) {
|
|
5885
5900
|
let n = e.getSelection(), o = n.ranges ?? [], s = n.rangeIndex ?? -1;
|
|
5886
|
-
T && r ? (a = s >= 0 ? s : Math.max(0, o.length - 1), c(a,
|
|
5887
|
-
} else T && r ? s(
|
|
5901
|
+
T && r ? (a = s >= 0 ? s : Math.max(0, o.length - 1), c(a, wa(r, t, h, g), i ?? w)) : (r = t, i = w, a = E || s < 0 ? o.length : s, c(a, wa(t, t, h, g), w));
|
|
5902
|
+
} else T && r ? s(wa(r, t, h, g), i ?? w, "replace") : E ? (r = t, i = w, s(wa(t, t, h, g), w, "append")) : (r = t, i = w, s(wa(t, t, h, g), w, "clear"));
|
|
5888
5903
|
return ((e) => {
|
|
5889
5904
|
l(n().axis === W.Column ? { colIndex: e.colIndex } : { rowIndex: e.rowIndex });
|
|
5890
5905
|
})(t), {
|
|
@@ -5900,17 +5915,17 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5900
5915
|
captureEvents: v
|
|
5901
5916
|
};
|
|
5902
5917
|
});
|
|
5903
|
-
},
|
|
5918
|
+
}, Ea = (e, t) => {
|
|
5904
5919
|
let n = Z(), r = h(t);
|
|
5905
5920
|
r.current = t;
|
|
5906
|
-
let i = p(() =>
|
|
5921
|
+
let i = p(() => Ta(e, n, () => r.current), [e, n]);
|
|
5907
5922
|
return u(() => () => i.dispose(), [i]), {
|
|
5908
5923
|
onPointerDown: i.onPointerDown,
|
|
5909
5924
|
onPointerMove: i.onPointerMove,
|
|
5910
5925
|
onPointerUp: i.onPointerUp
|
|
5911
5926
|
};
|
|
5912
|
-
},
|
|
5913
|
-
let { rowCount: n = 1, columnCount: r = 1, getRowHeight: i, getColumnWidth: a, metrics: o, renderCells: s, renderBorders: l, showGridLines: u = !0, gridLineColor: d, propsGridLineRows: f, propsGridLineColumns: h, getVisibleCells: g, hiddenCellAt: _, renderBelow: v, children: y, ...x } = e, S =
|
|
5927
|
+
}, Da = (e) => e == null ? [] : Array.isArray(e) ? e : [e], Oa = s(a((e, t) => {
|
|
5928
|
+
let { rowCount: n = 1, columnCount: r = 1, getRowHeight: i, getColumnWidth: a, metrics: o, renderCells: s, renderBorders: l, showGridLines: u = !0, gridLineColor: d, propsGridLineRows: f, propsGridLineColumns: h, getVisibleCells: g, hiddenCellAt: _, renderBelow: v, children: y, ...x } = e, S = ae({
|
|
5914
5929
|
rowCount: n,
|
|
5915
5930
|
columnCount: r,
|
|
5916
5931
|
getRowHeight: i,
|
|
@@ -5926,12 +5941,12 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5926
5941
|
propsColumns: h,
|
|
5927
5942
|
getVisibleCells: g,
|
|
5928
5943
|
hiddenCellAt: _
|
|
5929
|
-
}, "__gridlines")), e.push(...
|
|
5944
|
+
}, "__gridlines")), e.push(...Da(v)), e.push(...Da(l)), s && e.push(b(fi, {
|
|
5930
5945
|
renderCell: s,
|
|
5931
5946
|
getVisibleCells: g,
|
|
5932
5947
|
hiddenCellAt: _,
|
|
5933
5948
|
cacheToken: E
|
|
5934
|
-
}, "__cells")), e.push(...
|
|
5949
|
+
}, "__cells")), e.push(...Da(y)), e;
|
|
5935
5950
|
}, [
|
|
5936
5951
|
u,
|
|
5937
5952
|
d,
|
|
@@ -5954,8 +5969,8 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5954
5969
|
children: k
|
|
5955
5970
|
});
|
|
5956
5971
|
}));
|
|
5957
|
-
|
|
5958
|
-
var
|
|
5972
|
+
Oa.displayName = "Grid";
|
|
5973
|
+
var ka = function() {}, Aa = typeof window < "u", ja = Aa ? f : u, Ma = {
|
|
5959
5974
|
x: 0,
|
|
5960
5975
|
y: 0,
|
|
5961
5976
|
width: 0,
|
|
@@ -5964,8 +5979,8 @@ var Oa = function() {}, ka = typeof window < "u", Aa = ka ? f : u, ja = {
|
|
|
5964
5979
|
left: 0,
|
|
5965
5980
|
bottom: 0,
|
|
5966
5981
|
right: 0
|
|
5967
|
-
},
|
|
5968
|
-
var e = g(null), t = e[0], n = e[1], r = g(
|
|
5982
|
+
}, Na = Aa && window.ResizeObserver !== void 0 ? function() {
|
|
5983
|
+
var e = g(null), t = e[0], n = e[1], r = g(Ma), i = r[0], a = r[1], o = p(function() {
|
|
5969
5984
|
return new window.ResizeObserver(function(e) {
|
|
5970
5985
|
if (e[0]) {
|
|
5971
5986
|
var t = e[0].contentRect, n = t.x, r = t.y, i = t.width, o = t.height, s = t.top, c = t.left, l = t.bottom, u = t.right;
|
|
@@ -5982,24 +5997,24 @@ var Oa = function() {}, ka = typeof window < "u", Aa = ka ? f : u, ja = {
|
|
|
5982
5997
|
}
|
|
5983
5998
|
});
|
|
5984
5999
|
}, []);
|
|
5985
|
-
return
|
|
6000
|
+
return ja(function() {
|
|
5986
6001
|
if (t) return o.observe(t), function() {
|
|
5987
6002
|
o.disconnect();
|
|
5988
6003
|
};
|
|
5989
6004
|
}, [t]), [n, i];
|
|
5990
6005
|
} : function() {
|
|
5991
|
-
return [
|
|
6006
|
+
return [ka, Ma];
|
|
5992
6007
|
};
|
|
5993
|
-
function
|
|
6008
|
+
function Pa(e, t) {
|
|
5994
6009
|
if (typeof e == "function") return e(t);
|
|
5995
6010
|
e && (e.current = t);
|
|
5996
6011
|
}
|
|
5997
|
-
var
|
|
6012
|
+
var Fa, Ia = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
5998
6013
|
return (t) => {
|
|
5999
6014
|
let n = [];
|
|
6000
6015
|
for (let r of e) {
|
|
6001
|
-
let e =
|
|
6002
|
-
n.push(i ? e : () =>
|
|
6016
|
+
let e = Pa(r, t), i = typeof e == "function";
|
|
6017
|
+
n.push(i ? e : () => Pa(r, null));
|
|
6003
6018
|
}
|
|
6004
6019
|
return () => {
|
|
6005
6020
|
for (let e of n) e();
|
|
@@ -6007,17 +6022,17 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6007
6022
|
};
|
|
6008
6023
|
} : function(e) {
|
|
6009
6024
|
return (t) => {
|
|
6010
|
-
for (let n of e)
|
|
6025
|
+
for (let n of e) Pa(n, t);
|
|
6011
6026
|
};
|
|
6012
|
-
},
|
|
6027
|
+
}, La = {
|
|
6013
6028
|
fill: { fill: "color-mix(in srgb, var(--sxl-color-primary, rgb(0, 120, 215)) 14%, transparent)" },
|
|
6014
6029
|
border: null,
|
|
6015
6030
|
inner: null
|
|
6016
|
-
},
|
|
6031
|
+
}, Ra = {
|
|
6017
6032
|
stroke: "var(--sxl-color-primary, rgb(0, 120, 215))",
|
|
6018
6033
|
alignWidth: 1,
|
|
6019
6034
|
inset: 1
|
|
6020
|
-
},
|
|
6035
|
+
}, za = a(function(e, t) {
|
|
6021
6036
|
let { itemCount: n, renderCell: r, getVisibleCells: i, itemHeight: a = 24, contentWidth: o, selection: s, propsLayer: c, autoFocus: l, showScrollbar: d = "auto", scrollTo: f, viewport: m, cacheToken: g, className: _, style: v, children: y, ...S } = e, C = p(() => new A(), []), w = m ?? C, T = P(w, (e) => e.getMetrics()), E = d === "auto" ? T.totalHeight > T.height : d, O = h(null);
|
|
6022
6037
|
u(() => {
|
|
6023
6038
|
l && O.current?.focus();
|
|
@@ -6039,7 +6054,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6039
6054
|
colStart: 0,
|
|
6040
6055
|
rowEnd: Math.max(0, n - 1),
|
|
6041
6056
|
colEnd: 0
|
|
6042
|
-
}) }), [n]), j = s ?? k, [M, { width: N }] =
|
|
6057
|
+
}) }), [n]), j = s ?? k, [M, { width: N }] = Na(), [F, { width: I }] = Na(), L = I > 0 && N > 0 ? Math.max(0, I - N) : 0, R = p(() => Ia([F, t]), [F, t]), z = ae({
|
|
6043
6058
|
rowCount: n,
|
|
6044
6059
|
columnCount: 1,
|
|
6045
6060
|
getRowHeight: a,
|
|
@@ -6047,7 +6062,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6047
6062
|
});
|
|
6048
6063
|
return b("div", {
|
|
6049
6064
|
ref: R,
|
|
6050
|
-
className:
|
|
6065
|
+
className: q("list-surface", _),
|
|
6051
6066
|
style: {
|
|
6052
6067
|
position: "relative",
|
|
6053
6068
|
overflow: "hidden",
|
|
@@ -6086,9 +6101,9 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6086
6101
|
b(Ji, {
|
|
6087
6102
|
selection: j,
|
|
6088
6103
|
anchorHole: !1,
|
|
6089
|
-
singleStyle:
|
|
6090
|
-
singleAnchorStyle:
|
|
6091
|
-
multiAnchorStyle:
|
|
6104
|
+
singleStyle: La,
|
|
6105
|
+
singleAnchorStyle: Ra,
|
|
6106
|
+
multiAnchorStyle: Ra
|
|
6092
6107
|
}, "__selection"),
|
|
6093
6108
|
b(fi, {
|
|
6094
6109
|
renderCell: r,
|
|
@@ -6101,7 +6116,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6101
6116
|
})
|
|
6102
6117
|
})
|
|
6103
6118
|
});
|
|
6104
|
-
}),
|
|
6119
|
+
}), Ba = a(function(e, t) {
|
|
6105
6120
|
let { itemCount: n, renderItem: r, itemHeight: i, selection: a, onKeyDown: o, cacheToken: s, scrollTo: l, autoFocus: u, viewport: d, className: f, style: m, children: h, ...g } = e, _ = R(t, () => ({ isList: () => !0 }), []), v = c((e) => {
|
|
6106
6121
|
let { key: t, style: n, range: i, cell: a } = e, o = i?.rowStart ?? a.rowIndex;
|
|
6107
6122
|
return b("div", {
|
|
@@ -6121,9 +6136,9 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6121
6136
|
children: r(o)
|
|
6122
6137
|
}, t);
|
|
6123
6138
|
}, [r]), y = p(() => o ? { onKeyDown: o } : void 0, [o]);
|
|
6124
|
-
return b(
|
|
6139
|
+
return b(za, {
|
|
6125
6140
|
ref: _,
|
|
6126
|
-
className:
|
|
6141
|
+
className: q("list", f),
|
|
6127
6142
|
style: m,
|
|
6128
6143
|
itemCount: n,
|
|
6129
6144
|
itemHeight: i,
|
|
@@ -6136,7 +6151,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6136
6151
|
viewport: d,
|
|
6137
6152
|
...g
|
|
6138
6153
|
});
|
|
6139
|
-
}),
|
|
6154
|
+
}), Va = (e, t) => b("input", {
|
|
6140
6155
|
type: "checkbox",
|
|
6141
6156
|
checked: e,
|
|
6142
6157
|
ref: (e) => {
|
|
@@ -6145,8 +6160,8 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6145
6160
|
readOnly: !0,
|
|
6146
6161
|
tabIndex: -1,
|
|
6147
6162
|
style: { margin: 0 }
|
|
6148
|
-
}),
|
|
6149
|
-
let { itemCount: n, isChecked: r, onCheckedChange: i, renderValue: a, renderCheckbox: o =
|
|
6163
|
+
}), Ha = a(function(e, t) {
|
|
6164
|
+
let { itemCount: n, isChecked: r, onCheckedChange: i, renderValue: a, renderCheckbox: o = Va, renderDivider: s, selectAllLabel: l, itemHeight: u, selection: d, cacheToken: f, autoFocus: g, viewport: _, className: v, style: S, children: C, ...w } = e, T = p(() => new Ci({ getBounds: () => ({
|
|
6150
6165
|
rowStart: 0,
|
|
6151
6166
|
colStart: 0,
|
|
6152
6167
|
rowEnd: Math.max(0, n - 1),
|
|
@@ -6231,7 +6246,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6231
6246
|
]);
|
|
6232
6247
|
return x("div", {
|
|
6233
6248
|
ref: M,
|
|
6234
|
-
className:
|
|
6249
|
+
className: q("checkbox-list", v),
|
|
6235
6250
|
style: {
|
|
6236
6251
|
display: "flex",
|
|
6237
6252
|
flexDirection: "column",
|
|
@@ -6258,7 +6273,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6258
6273
|
},
|
|
6259
6274
|
children: o(I, L)
|
|
6260
6275
|
}), l]
|
|
6261
|
-
}), s?.()] }), b(
|
|
6276
|
+
}), s?.()] }), b(Ba, {
|
|
6262
6277
|
itemCount: n,
|
|
6263
6278
|
itemHeight: u,
|
|
6264
6279
|
selection: E,
|
|
@@ -6274,21 +6289,21 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6274
6289
|
}
|
|
6275
6290
|
})]
|
|
6276
6291
|
});
|
|
6277
|
-
}),
|
|
6292
|
+
}), Ua = (e, t) => {
|
|
6278
6293
|
let n = (() => {
|
|
6279
|
-
if (
|
|
6294
|
+
if (Fa !== void 0) return Fa;
|
|
6280
6295
|
try {
|
|
6281
|
-
|
|
6296
|
+
Fa = (typeof document < "u" ? document.createElement("canvas").getContext("2d") : null) ?? null;
|
|
6282
6297
|
} catch {
|
|
6283
|
-
|
|
6298
|
+
Fa = null;
|
|
6284
6299
|
}
|
|
6285
|
-
return
|
|
6300
|
+
return Fa;
|
|
6286
6301
|
})();
|
|
6287
6302
|
if (n) return n.font = t, n.measureText(e).width;
|
|
6288
6303
|
let r = Number.parseFloat((/(\d+(?:\.\d+)?)px/.exec(t) ?? [])[1] ?? "16") || 16;
|
|
6289
6304
|
return e.length * r * .55;
|
|
6290
|
-
},
|
|
6291
|
-
let { items: n, onChoose: r, highlightIndex: i, itemHeight: a = 24, visibleRows: o = 8, contentWidth: s, measureText: l, renderItem: u, autoFocus: d, viewport: f, className: g, style: _, children: v, ...y } = e, x = n.length, S =
|
|
6305
|
+
}, Wa = (e, t) => t <= 0 ? -1 : Math.min(Math.max(0, e), t - 1), Ga = a(function(e, t) {
|
|
6306
|
+
let { items: n, onChoose: r, highlightIndex: i, itemHeight: a = 24, visibleRows: o = 8, contentWidth: s, measureText: l, renderItem: u, autoFocus: d, viewport: f, className: g, style: _, children: v, ...y } = e, x = n.length, S = Wa(i ?? 0, x), w = p(() => new Ci({
|
|
6292
6307
|
initial: { cell: {
|
|
6293
6308
|
rowIndex: Math.max(0, S),
|
|
6294
6309
|
colIndex: 0
|
|
@@ -6309,7 +6324,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6309
6324
|
x
|
|
6310
6325
|
]), A = F(() => x === 0 ? -1 : w.getSelection().cell.rowIndex, [w, x]), j = F((e) => {
|
|
6311
6326
|
if (x === 0) return;
|
|
6312
|
-
let t =
|
|
6327
|
+
let t = Wa(w.getSelection().cell.rowIndex + e, x);
|
|
6313
6328
|
w.setSelection({ cell: {
|
|
6314
6329
|
rowIndex: t,
|
|
6315
6330
|
colIndex: 0
|
|
@@ -6329,7 +6344,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6329
6344
|
let t = e?.fontSize, n = e?.fontFamily, r = typeof t == "number" ? `${t}px` : t ?? "16px", i = [];
|
|
6330
6345
|
return e?.fontStyle && e.fontStyle !== "normal" && i.push(String(e.fontStyle)), e?.fontWeight && e.fontWeight !== "normal" && i.push(String(e.fontWeight)), i.push(r, n ? String(n) : "sans-serif"), i.join(" ");
|
|
6331
6346
|
})(_);
|
|
6332
|
-
return (t) =>
|
|
6347
|
+
return (t) => Ua(t, e);
|
|
6333
6348
|
}, [l, _]), P = p(() => {
|
|
6334
6349
|
if (s != null) return s;
|
|
6335
6350
|
let e = 0;
|
|
@@ -6373,9 +6388,9 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6373
6388
|
e.which !== C.Enter && e.which !== C.Space || (e.preventDefault(), e.stopPropagation(), k(A()));
|
|
6374
6389
|
}
|
|
6375
6390
|
}), [k, A]);
|
|
6376
|
-
return b(
|
|
6391
|
+
return b(za, {
|
|
6377
6392
|
ref: M,
|
|
6378
|
-
className:
|
|
6393
|
+
className: q("pick-list", g),
|
|
6379
6394
|
role: "listbox",
|
|
6380
6395
|
style: {
|
|
6381
6396
|
maxHeight: o * a,
|
|
@@ -6393,10 +6408,10 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6393
6408
|
cacheToken: n,
|
|
6394
6409
|
...y
|
|
6395
6410
|
});
|
|
6396
|
-
}),
|
|
6411
|
+
}), Ka = "_search_b1nag_5", qa = (e, t) => {
|
|
6397
6412
|
let n = t.trim().toLowerCase();
|
|
6398
6413
|
return n ? e.filter((e) => e.text.toLowerCase().includes(n)) : e;
|
|
6399
|
-
},
|
|
6414
|
+
}, Ja = a(function(e, t) {
|
|
6400
6415
|
let { value: n, onChange: r, onClose: i, onKeyDown: a, className: o, ...s } = e, l = c((e) => {
|
|
6401
6416
|
if (e.which === C.Escape) return e.preventDefault(), e.stopPropagation(), void (n ? r("") : i?.());
|
|
6402
6417
|
a?.(e);
|
|
@@ -6412,19 +6427,19 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6412
6427
|
role: "searchbox",
|
|
6413
6428
|
autoComplete: "off",
|
|
6414
6429
|
spellCheck: !1,
|
|
6415
|
-
className:
|
|
6430
|
+
className: q(Ka, "list-search", o),
|
|
6416
6431
|
value: n,
|
|
6417
6432
|
onChange: (e) => r(e.target.value),
|
|
6418
6433
|
onKeyDown: l,
|
|
6419
6434
|
...s
|
|
6420
6435
|
});
|
|
6421
|
-
}),
|
|
6436
|
+
}), Ya = {
|
|
6422
6437
|
light: {},
|
|
6423
6438
|
dark: {
|
|
6424
6439
|
"color-base-100": "#1e1e1e",
|
|
6425
6440
|
"color-base-300": "#3a3a3a"
|
|
6426
6441
|
}
|
|
6427
|
-
},
|
|
6442
|
+
}, Xa = {
|
|
6428
6443
|
light: {
|
|
6429
6444
|
"color-base-100": "#f2f2f2",
|
|
6430
6445
|
"color-base-hover": "#ececec",
|
|
@@ -6435,7 +6450,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6435
6450
|
"color-base-hover": "#2e2e2e",
|
|
6436
6451
|
"color-base-300": "#4a4a4a"
|
|
6437
6452
|
}
|
|
6438
|
-
},
|
|
6453
|
+
}, Za = (e, ...t) => N(e, Ya[e], ...t), Qa = (e, ...t) => N(e, Xa[e], ...t), $a = ({ app: e, grid: t = Ya, header: n = Xa, layer: r = "sxl-defaults", scope: i } = {}) => {
|
|
6439
6454
|
let a = e ?? M, o = Object.fromEntries(Object.keys(n).map((e) => [e, {
|
|
6440
6455
|
"color-base-100": a[e]?.["color-base-200"],
|
|
6441
6456
|
...n[e]
|
|
@@ -6450,4 +6465,4 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6450
6465
|
scope: i
|
|
6451
6466
|
});
|
|
6452
6467
|
};
|
|
6453
|
-
export { Tr as AUTO_SCROLL_INTERVAL_MS, fi as CellLayer, di as CellTileDiv,
|
|
6468
|
+
export { Tr as AUTO_SCROLL_INTERVAL_MS, fi as CellLayer, di as CellTileDiv, Ha as CheckboxList, Ni as DEFAULT_ANCHOR_STYLE, xr as DEFAULT_HANDLE_STYLE, Fi as DEFAULT_INSERT_BAR_STYLE, Ii as DEFAULT_MOVE_SOURCE_STYLE, Mi as DEFAULT_MULTI_STYLE, Pi as DEFAULT_REMOVE_PREVIEW_STYLE, ji as DEFAULT_SINGLE_STYLE, ti as DefaultCellRenderer, ca as DefaultEditable, fa as DefaultEditorInput, va as DefaultHeaderDivider, Ci as DefaultSelection, Lr as DragHandle, Kr as Draggable, Er as EDGE_AUTO_SCROLL_MARGIN_PX, ra as EditSession, ha as EditorDiv, pa as EditorLayer, ma as EditorStartLayer, ei as FillHandle, Ya as GRID_SURFACE, Oa as Grid, tr as GridFloatPanel, ze as GridSurface, bi as GridlineLayer, Xa as HEADER_SURFACE, ba as HeaderDividerAnchor, fr as HoverTipLayer, $e as Layer, ce as LineSVG, Ba as List, Ja as ListSearch, za as ListSurface, Or as NO_DRAG_MODIFIERS, Zi as PICKER_COLORS, Ga as PickList, Jr as RESIZE_ANCHORS_4, Yr as RESIZE_ANCHORS_8, dr as RangeFloatLayer, Cr as RangeInsertBar, br as RangePrompt, Sr as RangeRect, Xr as RangeResizer, ta as RangesPickerLayer, le as RectangleSVG, Si as SELECTION_CLIP_INSETS, Ji as SelectionLayer, Ri as SelectionTouchGrips, oe as ShapeBoundsContext, xt as StickyAnchor, Qn as StickyFloat, Ie as SurfaceStateContext, Le as SurfaceStateProvider, rt as VirtualDiv, $a as buildGridThemeCSS, oa as commitArgsFromKey, K as createAxis, Mr as createDragCells, Ta as createHeaderSelectionPointer, Fe as createSurfaceStateStore, Nr as createWindowDragCells, ea as defaultRangeStyle, Dr as edgeScrollPane, la as expandEditorBounds, qa as filterByText, Za as gridThemeVars, Ca as headerAnchorCell, Sa as headerEntireEnd, xa as headerEntireStart, wa as headerRange, Qa as headerThemeVars, Ur as insertAt, Gr as insertRange, Ar as isSameDragModifiers, kr as readDragModifiers, rr as renderGridFloatPanel, Qr as resolveFillDestination, ia as startEventFromKey, Ir as useDoubleClick, Pr as useDragCells, sa as useEditorKeymap, Yn as useGridFloatTheme, ae as useGridMetrics, Z as useGridPane, Xe as useGridPaneOptional, Ea as useHeaderSelectionPointer, ar as useHoverIntent, Qe as useLayer, aa as usePendingCaret, or as useRangeHover, Li as useSelectionPointer, se as useShapeBounds, yt as useSticky, bt as useStickyOptional, Ze as useSurfaceState, Fr as useWindowDragCells, $r as vacatedByFill };
|