@sheetxl/grid-react 0.8.0-beta.5 → 0.8.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -3
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/index.mjs +340 -334
- package/node/esm/index.mjs +150 -144
- 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/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.6
|
|
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
|
});
|
|
@@ -2696,7 +2696,7 @@ var Kn = (e, t) => {
|
|
|
2696
2696
|
y();
|
|
2697
2697
|
}, [t, y]), !i) return null;
|
|
2698
2698
|
let x = typeof l == "function" ? l(t) : l;
|
|
2699
|
-
return
|
|
2699
|
+
return ie(b("div", {
|
|
2700
2700
|
ref: _.setFloating,
|
|
2701
2701
|
className: [o, d].filter(Boolean).join(" ") || void 0,
|
|
2702
2702
|
...m,
|
|
@@ -2882,7 +2882,7 @@ var nr = ({ outOfView: e, close: t }) => (u(() => {
|
|
|
2882
2882
|
}
|
|
2883
2883
|
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
2884
|
return b($e, {
|
|
2885
|
-
className:
|
|
2885
|
+
className: q(v, "range-float"),
|
|
2886
2886
|
onPointerMove: C ? N : void 0,
|
|
2887
2887
|
onPointerLeave: C ? M : void 0,
|
|
2888
2888
|
children: B && b(Qn, {
|
|
@@ -2910,7 +2910,7 @@ var fr = (e) => {
|
|
|
2910
2910
|
return b(dr, {
|
|
2911
2911
|
...r,
|
|
2912
2912
|
activateOn: "hover",
|
|
2913
|
-
className:
|
|
2913
|
+
className: q(n, "hover-tip"),
|
|
2914
2914
|
children: ({ range: e, data: n, floatProps: r, state: i }) => t({
|
|
2915
2915
|
range: e,
|
|
2916
2916
|
data: n,
|
|
@@ -3062,11 +3062,11 @@ var xr = {
|
|
|
3062
3062
|
height: y.height
|
|
3063
3063
|
} : void 0;
|
|
3064
3064
|
return b(rt, {
|
|
3065
|
-
className:
|
|
3065
|
+
className: q(o),
|
|
3066
3066
|
bounds: h ?? void 0,
|
|
3067
3067
|
clipInsets: u,
|
|
3068
3068
|
style: { pointerEvents: "none" },
|
|
3069
|
-
children: b(
|
|
3069
|
+
children: b(le, {
|
|
3070
3070
|
bounds: v,
|
|
3071
3071
|
alignWidth: i,
|
|
3072
3072
|
hole: x,
|
|
@@ -3124,7 +3124,7 @@ var Cr = s((e) => {
|
|
|
3124
3124
|
["insert-bar-cap-end", h(r.end) ? r.end : null]
|
|
3125
3125
|
];
|
|
3126
3126
|
})(e).map(([t, i]) => i && b(rt, {
|
|
3127
|
-
className:
|
|
3127
|
+
className: q(t, e ? "row" : "column"),
|
|
3128
3128
|
bounds: i,
|
|
3129
3129
|
style: {
|
|
3130
3130
|
pointerEvents: "none",
|
|
@@ -3354,7 +3354,7 @@ var Pr = (e) => {
|
|
|
3354
3354
|
willChange: "transform"
|
|
3355
3355
|
} : void 0
|
|
3356
3356
|
}, R = {
|
|
3357
|
-
className:
|
|
3357
|
+
className: q("drag-handle", v),
|
|
3358
3358
|
onPointerDown: (e) => {
|
|
3359
3359
|
k(e) ? d(e) : A(e);
|
|
3360
3360
|
},
|
|
@@ -3445,7 +3445,7 @@ var Rr = () => {
|
|
|
3445
3445
|
}
|
|
3446
3446
|
};
|
|
3447
3447
|
}, 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 =
|
|
3448
|
+
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
3449
|
return {
|
|
3450
3450
|
...e,
|
|
3451
3451
|
rowStart: a,
|
|
@@ -3527,14 +3527,14 @@ var Rr = () => {
|
|
|
3527
3527
|
return x(y, { children: [
|
|
3528
3528
|
b(rt, r === "entire" ? {
|
|
3529
3529
|
ref: v,
|
|
3530
|
-
className:
|
|
3530
|
+
className: q("drag-grip", m),
|
|
3531
3531
|
...N ? { bounds: N } : { range: t },
|
|
3532
3532
|
style: { cursor: O },
|
|
3533
3533
|
...k,
|
|
3534
3534
|
...A
|
|
3535
3535
|
} : {
|
|
3536
3536
|
ref: v,
|
|
3537
|
-
className:
|
|
3537
|
+
className: q("drag-grip", m),
|
|
3538
3538
|
range: t,
|
|
3539
3539
|
clipInsets: -j / 2,
|
|
3540
3540
|
style: {
|
|
@@ -3542,7 +3542,7 @@ var Rr = () => {
|
|
|
3542
3542
|
cursor: O
|
|
3543
3543
|
},
|
|
3544
3544
|
...k,
|
|
3545
|
-
children: b(
|
|
3545
|
+
children: b(le, {
|
|
3546
3546
|
stroke: "transparent",
|
|
3547
3547
|
alignWidth: i,
|
|
3548
3548
|
propsStrokePath: {
|
|
@@ -3558,7 +3558,7 @@ var Rr = () => {
|
|
|
3558
3558
|
};
|
|
3559
3559
|
Kr.displayName = "Draggable";
|
|
3560
3560
|
var qr = (e, t, n, r) => {
|
|
3561
|
-
let i = e.rowEnd - e.rowStart, a = e.colEnd - e.colStart, o =
|
|
3561
|
+
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
3562
|
return {
|
|
3563
3563
|
rowStart: o,
|
|
3564
3564
|
colStart: s,
|
|
@@ -3625,7 +3625,7 @@ var qr = (e, t, n, r) => {
|
|
|
3625
3625
|
Xr.displayName = "RangeResizer";
|
|
3626
3626
|
var Zr = (e, t, n, r) => {
|
|
3627
3627
|
let { rowStart: i, colStart: a, rowEnd: o, colEnd: s } = e;
|
|
3628
|
-
return t.includes("t") && (i =
|
|
3628
|
+
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
3629
|
rowStart: Math.min(i, o),
|
|
3630
3630
|
colStart: Math.min(a, s),
|
|
3631
3631
|
rowEnd: Math.max(i, o),
|
|
@@ -3737,7 +3737,7 @@ ei.displayName = "FillHandle";
|
|
|
3737
3737
|
var ti = s((e) => {
|
|
3738
3738
|
let { value: t, zoom: n, bounds: r, cell: i, range: a, children: o, className: s, ...c } = e;
|
|
3739
3739
|
return b("div", {
|
|
3740
|
-
className:
|
|
3740
|
+
className: q(s, "cell"),
|
|
3741
3741
|
...c,
|
|
3742
3742
|
children: t
|
|
3743
3743
|
});
|
|
@@ -3986,7 +3986,7 @@ var ti = s((e) => {
|
|
|
3986
3986
|
]);
|
|
3987
3987
|
return x(y, { children: [b(rt, {
|
|
3988
3988
|
fill: !0,
|
|
3989
|
-
className:
|
|
3989
|
+
className: q("tiles", ui.tiles, f, o),
|
|
3990
3990
|
style: {
|
|
3991
3991
|
pointerEvents: "none",
|
|
3992
3992
|
...s,
|
|
@@ -4000,7 +4000,7 @@ di.displayName = "CellTileDiv";
|
|
|
4000
4000
|
var fi = s((e) => {
|
|
4001
4001
|
let { renderCell: t, cacheToken: n, getVisibleCells: r, hiddenCellAt: i, suppressCell: a, className: o, style: s, ...c } = e;
|
|
4002
4002
|
return b($e, {
|
|
4003
|
-
className:
|
|
4003
|
+
className: q(o, "cells"),
|
|
4004
4004
|
...c,
|
|
4005
4005
|
children: b(di, {
|
|
4006
4006
|
renderCell: t,
|
|
@@ -4092,7 +4092,7 @@ var $ = 8, pi = 1 << 19, mi = 1, hi = 512, gi = !1, _i = (e, t, n) => {
|
|
|
4092
4092
|
if (!n) return null;
|
|
4093
4093
|
let a = e.getPaneBounds(), o = Math.ceil(a.width), s = Math.ceil(a.height), c = String(xi / T.getDevicePixelRatio());
|
|
4094
4094
|
return b("svg", {
|
|
4095
|
-
className:
|
|
4095
|
+
className: q(t ? "horizontal" : "vertical"),
|
|
4096
4096
|
width: `${o}`,
|
|
4097
4097
|
height: `${s}`,
|
|
4098
4098
|
viewBox: `0 0 ${o} ${s}`,
|
|
@@ -4121,10 +4121,10 @@ var $ = 8, pi = 1 << 19, mi = 1, hi = 512, gi = !1, _i = (e, t, n) => {
|
|
|
4121
4121
|
]);
|
|
4122
4122
|
return h || g ? b($e, {
|
|
4123
4123
|
...d,
|
|
4124
|
-
className:
|
|
4124
|
+
className: q(l, "gridlines"),
|
|
4125
4125
|
children: x(rt, {
|
|
4126
4126
|
fill: !0,
|
|
4127
|
-
className:
|
|
4127
|
+
className: q("gridlines-box", ui.gridlines),
|
|
4128
4128
|
style: {
|
|
4129
4129
|
pointerEvents: "none",
|
|
4130
4130
|
...u
|
|
@@ -4152,7 +4152,7 @@ var xi = 1, Si = -10, Ci = class {
|
|
|
4152
4152
|
H.isEqualSelectionCoords(this._coords, e) || (this._coords = e, this.listeners.forEach((e) => e()));
|
|
4153
4153
|
}
|
|
4154
4154
|
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 =
|
|
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 = J(u + c(o), i.rowStart, i.rowEnd), p = J(d + c(s), i.colStart, i.colEnd);
|
|
4156
4156
|
if (!t) return void this.setSelection({
|
|
4157
4157
|
cell: {
|
|
4158
4158
|
rowIndex: f,
|
|
@@ -4177,7 +4177,7 @@ var xi = 1, Si = -10, Ci = class {
|
|
|
4177
4177
|
let r = e === W.Row ? t ? U.Left : U.Right : t ? U.Up : U.Down, i = this._coords;
|
|
4178
4178
|
if (!(i.ranges && i.ranges.length > 0) || H.isEqualRangesArrays([H.cellToRange(i.cell)], i.ranges)) {
|
|
4179
4179
|
if (n && !H.isSingleCell(n)) {
|
|
4180
|
-
let e =
|
|
4180
|
+
let e = G.findNextCellWithinSelection({
|
|
4181
4181
|
ranges: [n],
|
|
4182
4182
|
cell: i.cell,
|
|
4183
4183
|
rangeIndex: 0
|
|
@@ -4192,7 +4192,7 @@ var xi = 1, Si = -10, Ci = class {
|
|
|
4192
4192
|
this.navigate(r);
|
|
4193
4193
|
return;
|
|
4194
4194
|
}
|
|
4195
|
-
let a =
|
|
4195
|
+
let a = G.findNextCellWithinSelection(i, r, (e) => H.cellToRange(e));
|
|
4196
4196
|
this.setSelection(a);
|
|
4197
4197
|
}
|
|
4198
4198
|
_activeIndex() {
|
|
@@ -4293,13 +4293,13 @@ var xi = 1, Si = -10, Ci = class {
|
|
|
4293
4293
|
};
|
|
4294
4294
|
}
|
|
4295
4295
|
}, wi = (e, t) => ({
|
|
4296
|
-
rowStart:
|
|
4297
|
-
colStart:
|
|
4298
|
-
rowEnd:
|
|
4299
|
-
colEnd:
|
|
4296
|
+
rowStart: J(e.rowStart, t.rowStart, t.rowEnd),
|
|
4297
|
+
colStart: J(e.colStart, t.colStart, t.colEnd),
|
|
4298
|
+
rowEnd: J(e.rowEnd, t.rowStart, t.rowEnd),
|
|
4299
|
+
colEnd: J(e.colEnd, t.colStart, t.colEnd)
|
|
4300
4300
|
}), Ti = (e, t) => ({
|
|
4301
|
-
rowIndex:
|
|
4302
|
-
colIndex:
|
|
4301
|
+
rowIndex: J(e.rowIndex, t.rowStart, t.rowEnd),
|
|
4302
|
+
colIndex: J(e.colIndex, t.colStart, t.colEnd)
|
|
4303
4303
|
}), Ei = {
|
|
4304
4304
|
rowStart: 0,
|
|
4305
4305
|
colStart: 0,
|
|
@@ -4623,7 +4623,7 @@ var zi = (e) => {
|
|
|
4623
4623
|
});
|
|
4624
4624
|
return f(() => {
|
|
4625
4625
|
v();
|
|
4626
|
-
}, [t, v]),
|
|
4626
|
+
}, [t, v]), ie(b("div", {
|
|
4627
4627
|
ref: g.setFloating,
|
|
4628
4628
|
className: ["touch-select-grip", c].filter(Boolean).join(" "),
|
|
4629
4629
|
...l,
|
|
@@ -4679,21 +4679,21 @@ var zi = (e) => {
|
|
|
4679
4679
|
side: "b",
|
|
4680
4680
|
align: "end"
|
|
4681
4681
|
}, 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
|
|
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, G = P(r, (e) => e.getSelection()), re = Li(r, { onSelectionEnd: L }), ie = t.useRef(R);
|
|
4683
|
+
ie.current = R, t.useEffect(() => {
|
|
4684
|
+
ie.current?.(re.dragMode);
|
|
4685
|
+
}, [re.dragMode]);
|
|
4686
|
+
let [K, ae] = t.useState(null), oe = Z(), se = t.useRef(r);
|
|
4687
|
+
se.current = r;
|
|
4688
|
+
let ce = t.useRef(oe);
|
|
4689
|
+
ce.current = oe;
|
|
4690
|
+
let le = t.useRef(i);
|
|
4691
|
+
le.current = i;
|
|
4692
|
+
let ue = t.useRef(a);
|
|
4693
|
+
ue.current = a;
|
|
4694
|
+
let de = t.useRef(o);
|
|
4695
|
+
de.current = o;
|
|
4696
|
+
let fe = t.useMemo(() => function(e) {
|
|
4697
4697
|
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
4698
|
let t = i();
|
|
4699
4699
|
t ? t(e) : s().scrollCellCoordsIntoView(e);
|
|
@@ -4902,27 +4902,27 @@ var zi = (e) => {
|
|
|
4902
4902
|
}
|
|
4903
4903
|
};
|
|
4904
4904
|
}({
|
|
4905
|
-
getSelection: () =>
|
|
4906
|
-
getPane: () =>
|
|
4907
|
-
getContentBounds: () =>
|
|
4908
|
-
getScrollIntoView: () =>
|
|
4909
|
-
getRegionBounds: (e) =>
|
|
4905
|
+
getSelection: () => se.current,
|
|
4906
|
+
getPane: () => ce.current,
|
|
4907
|
+
getContentBounds: () => le.current?.() ?? ce.current.getTotalRange(),
|
|
4908
|
+
getScrollIntoView: () => de.current,
|
|
4909
|
+
getRegionBounds: (e) => ue.current?.(e) ?? null
|
|
4910
4910
|
}), []);
|
|
4911
|
-
t.useImperativeHandle(n, () =>
|
|
4912
|
-
let
|
|
4911
|
+
t.useImperativeHandle(n, () => fe, [fe]);
|
|
4912
|
+
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
4913
|
...Ni,
|
|
4914
4914
|
...l
|
|
4915
|
-
},
|
|
4915
|
+
}, Se = Ki(Pi, d), { refusedColor: Ce, ...we } = {
|
|
4916
4916
|
...Fi,
|
|
4917
4917
|
...f
|
|
4918
|
-
},
|
|
4919
|
-
let n = t.mods.shiftKey ? t.insert : null, r = t.mods.ctrlKey || t.mods.metaKey, i = n ? Gr(e, n,
|
|
4918
|
+
}, Te = m === null ? null : Ki(Ii, m), X = (e, t) => {
|
|
4919
|
+
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
4920
|
to: i,
|
|
4921
4921
|
copy: r,
|
|
4922
4922
|
insert: n?.axis
|
|
4923
4923
|
};
|
|
4924
|
-
return a.refused = !!n && !r && (p ? p(
|
|
4925
|
-
},
|
|
4924
|
+
return a.refused = !!n && !r && (p ? p(Y, a) : H.isRefusedInsertCut(H.classifyInsertCut(Y, i, n.axis))), a;
|
|
4925
|
+
}, Ee = (e) => {
|
|
4926
4926
|
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
4927
|
rowIndex: e.rowStart,
|
|
4928
4928
|
colIndex: e.colStart
|
|
@@ -4932,66 +4932,66 @@ var zi = (e) => {
|
|
|
4932
4932
|
ranges: o,
|
|
4933
4933
|
rangeIndex: a
|
|
4934
4934
|
});
|
|
4935
|
-
},
|
|
4935
|
+
}, De = K ?? (re.dragMode === "extend" ? {
|
|
4936
4936
|
kind: "select",
|
|
4937
|
-
range:
|
|
4938
|
-
} : null),
|
|
4937
|
+
range: Y
|
|
4938
|
+
} : null), Oe = De && z ? z(De) : null, ke = t.Children.map(q ? g : h, (e) => {
|
|
4939
4939
|
if (!t.isValidElement(e)) return e;
|
|
4940
4940
|
let n = e.props;
|
|
4941
4941
|
return t.cloneElement(e, {
|
|
4942
|
-
range:
|
|
4942
|
+
range: Y,
|
|
4943
4943
|
onDragEnd: (e, t) => {
|
|
4944
|
-
n.onDragEnd?.(e, t),
|
|
4944
|
+
n.onDragEnd?.(e, t), Ee(e);
|
|
4945
4945
|
}
|
|
4946
4946
|
});
|
|
4947
4947
|
});
|
|
4948
4948
|
return x($e, {
|
|
4949
4949
|
...ne,
|
|
4950
|
-
onPointerDown:
|
|
4951
|
-
onPointerMove:
|
|
4952
|
-
onPointerUp:
|
|
4950
|
+
onPointerDown: re.onPointerDown,
|
|
4951
|
+
onPointerMove: re.onPointerMove,
|
|
4952
|
+
onPointerUp: re.onPointerUp,
|
|
4953
4953
|
onKeyDown: B ? void 0 : (e) => {
|
|
4954
|
-
|
|
4954
|
+
fe.handleKey(e) && (e.preventDefault(), e.stopPropagation());
|
|
4955
4955
|
},
|
|
4956
4956
|
children: [
|
|
4957
|
-
|
|
4958
|
-
x(y,
|
|
4959
|
-
|
|
4960
|
-
Yi(
|
|
4957
|
+
K?.kind === "move" && !K.drop.copy && Te && !H.isEqualRanges(K.to, K.from) && Yi(Te, K.from, void 0, !1, "move-source"),
|
|
4958
|
+
x(y, q ? { children: [
|
|
4959
|
+
ye.map((e, n) => b(t.Fragment, { children: Yi(be, e) }, `other-${n}`)),
|
|
4960
|
+
Yi(be, Y, V ? ve : void 0),
|
|
4961
4961
|
b(Sr, {
|
|
4962
4962
|
className: "anchor",
|
|
4963
|
-
range:
|
|
4964
|
-
...
|
|
4963
|
+
range: ve,
|
|
4964
|
+
...xe
|
|
4965
4965
|
})
|
|
4966
|
-
] } : { children: [Yi(
|
|
4966
|
+
] } : { children: [Yi(be, Y, V ? ve : void 0), u && b(Sr, {
|
|
4967
4967
|
className: "anchor",
|
|
4968
|
-
range:
|
|
4968
|
+
range: ve,
|
|
4969
4969
|
...u
|
|
4970
4970
|
})] }),
|
|
4971
|
-
!
|
|
4971
|
+
!q && _ && b(Kr, {
|
|
4972
4972
|
className: "move-grip",
|
|
4973
|
-
range:
|
|
4973
|
+
range: Y,
|
|
4974
4974
|
grip: "edges",
|
|
4975
4975
|
dragCursor: E,
|
|
4976
4976
|
renderMove: (e, t) => {
|
|
4977
|
-
let n =
|
|
4977
|
+
let n = X(e, t);
|
|
4978
4978
|
return n.insert ? b(Cr, {
|
|
4979
4979
|
range: n.to,
|
|
4980
4980
|
axis: n.insert,
|
|
4981
|
-
...
|
|
4982
|
-
color: (n.refused ?
|
|
4983
|
-
}) :
|
|
4981
|
+
...we,
|
|
4982
|
+
color: (n.refused ? Ce : void 0) ?? we.color
|
|
4983
|
+
}) : be.border && b(Sr, {
|
|
4984
4984
|
className: "move-ghost",
|
|
4985
4985
|
range: n.to,
|
|
4986
|
-
...
|
|
4986
|
+
...be.border,
|
|
4987
4987
|
animatedTransition: !0,
|
|
4988
4988
|
style: { opacity: .6 }
|
|
4989
4989
|
});
|
|
4990
4990
|
},
|
|
4991
4991
|
onEdgeDoubleClick: I,
|
|
4992
4992
|
onDragStart: (e, t, n) => {
|
|
4993
|
-
let r =
|
|
4994
|
-
S?.(e, t, r),
|
|
4993
|
+
let r = X(e, n);
|
|
4994
|
+
S?.(e, t, r), ae({
|
|
4995
4995
|
kind: "move",
|
|
4996
4996
|
from: e,
|
|
4997
4997
|
to: r.to,
|
|
@@ -4999,20 +4999,20 @@ var zi = (e) => {
|
|
|
4999
4999
|
});
|
|
5000
5000
|
},
|
|
5001
5001
|
onDragMove: (e, t, n) => {
|
|
5002
|
-
let r =
|
|
5003
|
-
C?.(
|
|
5002
|
+
let r = X(e, n);
|
|
5003
|
+
C?.(Y, r.to, t, r), ae({
|
|
5004
5004
|
kind: "move",
|
|
5005
|
-
from:
|
|
5005
|
+
from: Y,
|
|
5006
5006
|
to: r.to,
|
|
5007
5007
|
drop: r
|
|
5008
5008
|
});
|
|
5009
5009
|
},
|
|
5010
5010
|
onDragStateChange: (e) => {
|
|
5011
|
-
e || (T?.(),
|
|
5011
|
+
e || (T?.(), ae(null));
|
|
5012
5012
|
},
|
|
5013
5013
|
onDragEnd: (e, t, n) => {
|
|
5014
|
-
let i =
|
|
5015
|
-
i.refused || (v?.(
|
|
5014
|
+
let i = X(e, n);
|
|
5015
|
+
i.refused || (v?.(Y, i.to, t, i), r.modify({
|
|
5016
5016
|
rowIndex: i.to.rowEnd,
|
|
5017
5017
|
colIndex: i.to.colEnd
|
|
5018
5018
|
}, {
|
|
@@ -5021,53 +5021,53 @@ var zi = (e) => {
|
|
|
5021
5021
|
}));
|
|
5022
5022
|
}
|
|
5023
5023
|
}),
|
|
5024
|
-
!
|
|
5025
|
-
range:
|
|
5024
|
+
!q && D && b(ei, {
|
|
5025
|
+
range: Y,
|
|
5026
5026
|
snapDestination: O,
|
|
5027
|
-
...
|
|
5027
|
+
...be.border,
|
|
5028
5028
|
onDragStart: (e, t) => {
|
|
5029
|
-
A?.(e, t),
|
|
5029
|
+
A?.(e, t), ae({
|
|
5030
5030
|
kind: "fill",
|
|
5031
5031
|
template: e,
|
|
5032
5032
|
destination: e
|
|
5033
5033
|
});
|
|
5034
5034
|
},
|
|
5035
5035
|
onDragMove: (e, t) => {
|
|
5036
|
-
j?.(
|
|
5036
|
+
j?.(Y, e, t), ae({
|
|
5037
5037
|
kind: "fill",
|
|
5038
|
-
template:
|
|
5038
|
+
template: Y,
|
|
5039
5039
|
destination: e
|
|
5040
5040
|
});
|
|
5041
5041
|
},
|
|
5042
5042
|
onDragEnd: (e, t) => {
|
|
5043
|
-
k?.(
|
|
5043
|
+
k?.(Y, e, t), Ee(e);
|
|
5044
5044
|
},
|
|
5045
5045
|
onMenu: N ? (e, t, n) => {
|
|
5046
|
-
N(
|
|
5046
|
+
N(Y, e, t, n);
|
|
5047
5047
|
} : void 0,
|
|
5048
5048
|
onDragDone: () => {
|
|
5049
|
-
M?.(),
|
|
5049
|
+
M?.(), ae(null);
|
|
5050
5050
|
},
|
|
5051
5051
|
onDoubleClick: F ? (e, t) => {
|
|
5052
5052
|
let n = F(e);
|
|
5053
|
-
n && !H.isEqualRanges(n, e) && (k?.(e, n, t),
|
|
5053
|
+
n && !H.isEqualRanges(n, e) && (k?.(e, n, t), Ee(n));
|
|
5054
5054
|
} : void 0
|
|
5055
5055
|
}),
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5056
|
+
re.removePreview && Yi(Se, re.removePreview, void 0, !1, "remove-preview"),
|
|
5057
|
+
ke,
|
|
5058
|
+
Oe != null && De && b(Qn, {
|
|
5059
5059
|
className: "gesture-tip",
|
|
5060
|
-
anchor: { range: (
|
|
5060
|
+
anchor: { range: (Ae = De, Ae.kind === "move" ? Ae.to : Ae.kind === "fill" ? Ae.destination : Ae.range) },
|
|
5061
5061
|
placement: ee ?? qi,
|
|
5062
5062
|
offset: 8,
|
|
5063
5063
|
whenOff: "clamp",
|
|
5064
5064
|
open: !0,
|
|
5065
5065
|
style: { pointerEvents: "none" },
|
|
5066
|
-
children:
|
|
5066
|
+
children: Oe
|
|
5067
5067
|
})
|
|
5068
5068
|
]
|
|
5069
5069
|
});
|
|
5070
|
-
var
|
|
5070
|
+
var Ae;
|
|
5071
5071
|
});
|
|
5072
5072
|
Ji.displayName = "SelectionLayer";
|
|
5073
5073
|
var Yi = (e, t, n, r = !1, i = "range") => x(y, { children: [
|
|
@@ -5157,7 +5157,7 @@ var Yi = (e, t, n, r = !1, i = "range") => x(y, { children: [
|
|
|
5157
5157
|
children: [
|
|
5158
5158
|
(!a || O) && b(rt, {
|
|
5159
5159
|
fill: !0,
|
|
5160
|
-
className:
|
|
5160
|
+
className: q(m, "ranges-picker-draw"),
|
|
5161
5161
|
onPointerDown: (e) => {
|
|
5162
5162
|
e.stopPropagation(), d && e.preventDefault(), L.onPointerDown(e);
|
|
5163
5163
|
},
|
|
@@ -5538,86 +5538,92 @@ function pa(e) {
|
|
|
5538
5538
|
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
5539
|
_((t) => t && t.width === e.width && t.height === e.height ? t : e);
|
|
5540
5540
|
}, []), 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
5541
|
let n = t.commit(e);
|
|
5552
5542
|
return n && f?.focus(), n;
|
|
5553
|
-
}, [t, f]),
|
|
5543
|
+
}, [t, f]), x = F(() => {
|
|
5554
5544
|
t.cancel(), f?.focus();
|
|
5555
5545
|
}, [t, f]);
|
|
5556
5546
|
u(() => {
|
|
5557
5547
|
m && f && f.scrollCellCoordsIntoView(m.coords);
|
|
5558
5548
|
}, [m?.token]);
|
|
5559
|
-
let
|
|
5560
|
-
if (f &&
|
|
5561
|
-
let e = f.getRangeFromCell(
|
|
5562
|
-
if (
|
|
5549
|
+
let S = m ? m.coords : t.getAnchor().getCoords(), C = null, w = !1, T = !1;
|
|
5550
|
+
if (f && S) {
|
|
5551
|
+
let e = f.getRangeFromCell(S);
|
|
5552
|
+
if (T = f.toClipBounds(f.getBoundsFromRange({
|
|
5563
5553
|
rowStart: e.rowStart,
|
|
5564
5554
|
colStart: e.colStart,
|
|
5565
5555
|
rowEnd: e.rowStart,
|
|
5566
5556
|
colEnd: e.colStart
|
|
5567
5557
|
})) !== null, m) {
|
|
5568
|
-
let e = la(f,
|
|
5569
|
-
|
|
5570
|
-
} else
|
|
5558
|
+
let e = la(f, S, h, r, o);
|
|
5559
|
+
C = e?.bounds ?? null, w = e?.inView ?? !1;
|
|
5560
|
+
} else C = f.getBoundsFromRange(e);
|
|
5571
5561
|
}
|
|
5572
|
-
let
|
|
5573
|
-
if (f &&
|
|
5574
|
-
let e = f.getBoundsFromRange(f.getRangeFromCell(
|
|
5575
|
-
e && (
|
|
5562
|
+
let E = null;
|
|
5563
|
+
if (f && S) {
|
|
5564
|
+
let e = f.getBoundsFromRange(f.getRangeFromCell(S)), t = f.getZoom() || 1;
|
|
5565
|
+
e && (E = {
|
|
5576
5566
|
width: e.width / t,
|
|
5577
5567
|
height: e.height / t
|
|
5578
5568
|
});
|
|
5579
5569
|
}
|
|
5580
|
-
let
|
|
5570
|
+
let D = !!m && !!C && w, O = {
|
|
5581
5571
|
open: !!m,
|
|
5582
5572
|
mode: m?.mode ?? "enter",
|
|
5583
5573
|
coords: m?.coords ?? null,
|
|
5584
5574
|
clean: m?.clean ?? null,
|
|
5585
5575
|
dirty: m?.dirty,
|
|
5586
5576
|
token: m?.token ?? 0,
|
|
5587
|
-
autoFocus: (m?.autoFocus ?? !0) &&
|
|
5577
|
+
autoFocus: (m?.autoFocus ?? !0) && D && T,
|
|
5588
5578
|
initialSelection: m?.initialSelection,
|
|
5589
5579
|
zoom: f?.getZoom() ?? 1,
|
|
5590
|
-
cellSize:
|
|
5580
|
+
cellSize: E,
|
|
5591
5581
|
onDirtyChange: (e) => p?.setDirty(e),
|
|
5592
5582
|
onModeChange: (e) => p?.setMode(e),
|
|
5593
|
-
onCommit:
|
|
5594
|
-
onCancel:
|
|
5583
|
+
onCommit: y,
|
|
5584
|
+
onCancel: x,
|
|
5595
5585
|
onNaturalSize: v
|
|
5596
|
-
},
|
|
5586
|
+
}, k = typeof i == "function" ? (S ? i(S) : void 0) ?? "transparent" : i;
|
|
5587
|
+
return b($e, { children: C ? b(rt, {
|
|
5588
|
+
...d,
|
|
5589
|
+
className: q(c, "editor"),
|
|
5590
|
+
bounds: C,
|
|
5591
|
+
alignWidth: o,
|
|
5592
|
+
keepMounted: !0,
|
|
5593
|
+
style: {
|
|
5594
|
+
...l,
|
|
5595
|
+
display: "flex",
|
|
5596
|
+
overflow: "hidden",
|
|
5597
|
+
background: k,
|
|
5598
|
+
borderColor: a,
|
|
5599
|
+
boxShadow: D ? "rgba(60,64,67,.35) 2px 2px 6px 3px" : "none",
|
|
5600
|
+
opacity: +!!D,
|
|
5601
|
+
pointerEvents: D ? "auto" : "none"
|
|
5602
|
+
},
|
|
5603
|
+
children: n ? n(O) : b(fa, { ...O })
|
|
5604
|
+
}) : null });
|
|
5605
|
+
}
|
|
5606
|
+
function ma(e) {
|
|
5607
|
+
let { editable: t } = e, n = Xe();
|
|
5597
5608
|
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
|
|
5609
|
+
className: "editor-start",
|
|
5610
|
+
onKeyDown: F((e) => {
|
|
5611
|
+
if (t.getSession()) return;
|
|
5612
|
+
let r = n?.getElement();
|
|
5613
|
+
if (r && e.target !== r) return;
|
|
5614
|
+
let i = t.getAnchor().getCoords();
|
|
5615
|
+
if (!i) return;
|
|
5616
|
+
let a = ia(e.nativeEvent);
|
|
5617
|
+
a && (e.nativeEvent.key !== "Process" && e.nativeEvent.keyCode !== 229 && e.preventDefault(), e.stopPropagation(), t.startEdit(i, a));
|
|
5618
|
+
}, [t, n]),
|
|
5619
|
+
onDoubleClick: F((e) => {
|
|
5620
|
+
if (t.getSession()) return;
|
|
5621
|
+
let r = n?.getCellFromPointer(e.clientX, e.clientY) ?? t.getAnchor().getCoords();
|
|
5622
|
+
r && t.startEdit(r, { mode: "edit" });
|
|
5623
|
+
}, [n, t])
|
|
5618
5624
|
});
|
|
5619
5625
|
}
|
|
5620
|
-
function
|
|
5626
|
+
function ha(e) {
|
|
5621
5627
|
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
5628
|
o || (t.getSession() || t.startEdit(t.getAnchor().getCoords(), {
|
|
5623
5629
|
mode: "edit",
|
|
@@ -5650,15 +5656,15 @@ function ma(e) {
|
|
|
5650
5656
|
children: n ? n(g) : b(fa, { ...g })
|
|
5651
5657
|
});
|
|
5652
5658
|
}
|
|
5653
|
-
fa.displayName = "DefaultEditorInput",
|
|
5654
|
-
var
|
|
5659
|
+
fa.displayName = "DefaultEditorInput", ha.displayName = "EditorDiv";
|
|
5660
|
+
var ga = "ew-resize", _a = "ns-resize", va = s(a((e, t) => {
|
|
5655
5661
|
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
5662
|
O < 1 && (D = Math.max(2, D * O * .8));
|
|
5657
5663
|
let k = D / 2, A = 0;
|
|
5658
5664
|
c && (A = -2), l && (A = 2), l && (D = D / 2 + A, k = 2 * A);
|
|
5659
5665
|
let j = C;
|
|
5660
5666
|
return S || A !== 0 || (j = `linear-gradient(${v ? 180 : 90}deg, ${w}, ${C} 55%, ${C} 100%)`), x("div", {
|
|
5661
|
-
className:
|
|
5667
|
+
className: q("header-divider", { disabled: o }, i, `index-${r}`),
|
|
5662
5668
|
ref: t,
|
|
5663
5669
|
onPointerDown: E ? void 0 : m,
|
|
5664
5670
|
onDoubleClick: E ? void 0 : () => h?.(),
|
|
@@ -5670,7 +5676,7 @@ var ha = "ew-resize", ga = "ns-resize", _a = s(a((e, t) => {
|
|
|
5670
5676
|
position: "absolute",
|
|
5671
5677
|
overflow: "visible",
|
|
5672
5678
|
pointerEvents: "auto",
|
|
5673
|
-
cursor: o || s || E ? void 0 : v ?
|
|
5679
|
+
cursor: o || s || E ? void 0 : v ? ga : _a,
|
|
5674
5680
|
...a
|
|
5675
5681
|
},
|
|
5676
5682
|
...g,
|
|
@@ -5714,8 +5720,8 @@ var ha = "ew-resize", ga = "ns-resize", _a = s(a((e, t) => {
|
|
|
5714
5720
|
} })
|
|
5715
5721
|
}) : null]
|
|
5716
5722
|
});
|
|
5717
|
-
})),
|
|
5718
|
-
let { axis: n, index: r, disabled: i = !1, disabledResize: a = !1, resizeThreshold: o = 1, renderDivider: s =
|
|
5723
|
+
})), ya = (e) => b(va, { ...e }), ba = s(a((e, t) => {
|
|
5724
|
+
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
5725
|
E.length > 0 && (D = w ? v.getBoundsFromRange({
|
|
5720
5726
|
rowStart: 0,
|
|
5721
5727
|
rowEnd: 0,
|
|
@@ -5778,15 +5784,15 @@ var ha = "ew-resize", ga = "ns-resize", _a = s(a((e, t) => {
|
|
|
5778
5784
|
}, v);
|
|
5779
5785
|
if (!te) return;
|
|
5780
5786
|
let H = null;
|
|
5781
|
-
return k && k.isResizing && k.index === r && (H =
|
|
5787
|
+
return k && k.isResizing && k.index === r && (H = ie(b("div", { style: {
|
|
5782
5788
|
position: "absolute",
|
|
5783
|
-
cursor: w ?
|
|
5789
|
+
cursor: w ? ga : _a,
|
|
5784
5790
|
left: 0,
|
|
5785
5791
|
top: 0,
|
|
5786
5792
|
width: "100%",
|
|
5787
5793
|
height: "100%"
|
|
5788
5794
|
} }), V(), "divider:" + r)), x(y, { children: [H, b("div", {
|
|
5789
|
-
className:
|
|
5795
|
+
className: q("header-divider-anchor"),
|
|
5790
5796
|
style: {
|
|
5791
5797
|
position: "absolute",
|
|
5792
5798
|
pointerEvents: "auto",
|
|
@@ -5800,26 +5806,26 @@ var ha = "ew-resize", ga = "ns-resize", _a = s(a((e, t) => {
|
|
|
5800
5806
|
children: te
|
|
5801
5807
|
})] });
|
|
5802
5808
|
}));
|
|
5803
|
-
|
|
5804
|
-
var
|
|
5809
|
+
ba.displayName = "HeaderDividerAnchor";
|
|
5810
|
+
var xa = (e, t, n) => t === W.Column ? {
|
|
5805
5811
|
rowIndex: n.rowStart,
|
|
5806
5812
|
colIndex: e.colIndex
|
|
5807
5813
|
} : {
|
|
5808
5814
|
rowIndex: e.rowIndex,
|
|
5809
5815
|
colIndex: n.colStart
|
|
5810
|
-
},
|
|
5816
|
+
}, Sa = (e, t, n) => t === W.Column ? {
|
|
5811
5817
|
rowIndex: n.rowEnd,
|
|
5812
5818
|
colIndex: e.colIndex
|
|
5813
5819
|
} : {
|
|
5814
5820
|
rowIndex: e.rowIndex,
|
|
5815
5821
|
colIndex: n.colEnd
|
|
5816
|
-
},
|
|
5822
|
+
}, Ca = (e, t, n) => t === W.Column ? {
|
|
5817
5823
|
rowIndex: n.rowStart,
|
|
5818
5824
|
colIndex: e.colIndex
|
|
5819
5825
|
} : {
|
|
5820
5826
|
rowIndex: e.rowIndex,
|
|
5821
5827
|
colIndex: n.colStart
|
|
5822
|
-
},
|
|
5828
|
+
}, wa = (e, t, n, r) => n === W.Column ? {
|
|
5823
5829
|
rowStart: r.rowStart,
|
|
5824
5830
|
rowEnd: r.rowEnd,
|
|
5825
5831
|
colStart: Math.min(e.colIndex, t.colIndex),
|
|
@@ -5829,7 +5835,7 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5829
5835
|
colEnd: r.colEnd,
|
|
5830
5836
|
rowStart: Math.min(e.rowIndex, t.rowIndex),
|
|
5831
5837
|
rowEnd: Math.max(e.rowIndex, t.rowIndex)
|
|
5832
|
-
},
|
|
5838
|
+
}, Ta = (e, t, n) => {
|
|
5833
5839
|
let r = null, i = null, a = 0, o = () => t.getAllPanes()[V.Center] ?? t, s = (t, n, r) => {
|
|
5834
5840
|
if (!e) return;
|
|
5835
5841
|
let i = e.getSelection(), a = !!i.ranges && i.ranges.length > 0;
|
|
@@ -5870,7 +5876,7 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5870
5876
|
let a = o().getVisibleRange(), s = null;
|
|
5871
5877
|
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
5878
|
}, d = (e) => {
|
|
5873
|
-
let { axis: t, entireRange: l, replaceActive: u = !1 } = n(), d =
|
|
5879
|
+
let { axis: t, entireRange: l, replaceActive: u = !1 } = n(), d = wa(r ?? e, e, t, l), f = i ?? Ca(e, t, o().getVisibleRange());
|
|
5874
5880
|
u ? c(a, d, f) : s(d, f, "replace");
|
|
5875
5881
|
};
|
|
5876
5882
|
return Mr(t, (t, f) => {
|
|
@@ -5880,11 +5886,11 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5880
5886
|
let { axis: h, entireRange: g, allowMulti: _ = !0, replaceActive: v = !1, preserveFocus: y = !1, onPointerDownInterceptor: b, onDragStart: x, onDragEnd: S, onPointerUp: C } = n();
|
|
5881
5887
|
if (!1 === b?.(f, t)) return null;
|
|
5882
5888
|
v && f.stopPropagation(), y && p && f.preventDefault(), x?.();
|
|
5883
|
-
let w =
|
|
5889
|
+
let w = Ca(t, h, o().getVisibleRange()), T = f.shiftKey, E = (f.ctrlKey || f.metaKey) && _;
|
|
5884
5890
|
if (v) {
|
|
5885
5891
|
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(
|
|
5892
|
+
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));
|
|
5893
|
+
} 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
5894
|
return ((e) => {
|
|
5889
5895
|
l(n().axis === W.Column ? { colIndex: e.colIndex } : { rowIndex: e.rowIndex });
|
|
5890
5896
|
})(t), {
|
|
@@ -5900,17 +5906,17 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5900
5906
|
captureEvents: v
|
|
5901
5907
|
};
|
|
5902
5908
|
});
|
|
5903
|
-
},
|
|
5909
|
+
}, Ea = (e, t) => {
|
|
5904
5910
|
let n = Z(), r = h(t);
|
|
5905
5911
|
r.current = t;
|
|
5906
|
-
let i = p(() =>
|
|
5912
|
+
let i = p(() => Ta(e, n, () => r.current), [e, n]);
|
|
5907
5913
|
return u(() => () => i.dispose(), [i]), {
|
|
5908
5914
|
onPointerDown: i.onPointerDown,
|
|
5909
5915
|
onPointerMove: i.onPointerMove,
|
|
5910
5916
|
onPointerUp: i.onPointerUp
|
|
5911
5917
|
};
|
|
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 =
|
|
5918
|
+
}, Da = (e) => e == null ? [] : Array.isArray(e) ? e : [e], Oa = s(a((e, t) => {
|
|
5919
|
+
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
5920
|
rowCount: n,
|
|
5915
5921
|
columnCount: r,
|
|
5916
5922
|
getRowHeight: i,
|
|
@@ -5926,12 +5932,12 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5926
5932
|
propsColumns: h,
|
|
5927
5933
|
getVisibleCells: g,
|
|
5928
5934
|
hiddenCellAt: _
|
|
5929
|
-
}, "__gridlines")), e.push(...
|
|
5935
|
+
}, "__gridlines")), e.push(...Da(v)), e.push(...Da(l)), s && e.push(b(fi, {
|
|
5930
5936
|
renderCell: s,
|
|
5931
5937
|
getVisibleCells: g,
|
|
5932
5938
|
hiddenCellAt: _,
|
|
5933
5939
|
cacheToken: E
|
|
5934
|
-
}, "__cells")), e.push(...
|
|
5940
|
+
}, "__cells")), e.push(...Da(y)), e;
|
|
5935
5941
|
}, [
|
|
5936
5942
|
u,
|
|
5937
5943
|
d,
|
|
@@ -5954,8 +5960,8 @@ var ba = (e, t, n) => t === W.Column ? {
|
|
|
5954
5960
|
children: k
|
|
5955
5961
|
});
|
|
5956
5962
|
}));
|
|
5957
|
-
|
|
5958
|
-
var
|
|
5963
|
+
Oa.displayName = "Grid";
|
|
5964
|
+
var ka = function() {}, Aa = typeof window < "u", ja = Aa ? f : u, Ma = {
|
|
5959
5965
|
x: 0,
|
|
5960
5966
|
y: 0,
|
|
5961
5967
|
width: 0,
|
|
@@ -5964,8 +5970,8 @@ var Oa = function() {}, ka = typeof window < "u", Aa = ka ? f : u, ja = {
|
|
|
5964
5970
|
left: 0,
|
|
5965
5971
|
bottom: 0,
|
|
5966
5972
|
right: 0
|
|
5967
|
-
},
|
|
5968
|
-
var e = g(null), t = e[0], n = e[1], r = g(
|
|
5973
|
+
}, Na = Aa && window.ResizeObserver !== void 0 ? function() {
|
|
5974
|
+
var e = g(null), t = e[0], n = e[1], r = g(Ma), i = r[0], a = r[1], o = p(function() {
|
|
5969
5975
|
return new window.ResizeObserver(function(e) {
|
|
5970
5976
|
if (e[0]) {
|
|
5971
5977
|
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 +5988,24 @@ var Oa = function() {}, ka = typeof window < "u", Aa = ka ? f : u, ja = {
|
|
|
5982
5988
|
}
|
|
5983
5989
|
});
|
|
5984
5990
|
}, []);
|
|
5985
|
-
return
|
|
5991
|
+
return ja(function() {
|
|
5986
5992
|
if (t) return o.observe(t), function() {
|
|
5987
5993
|
o.disconnect();
|
|
5988
5994
|
};
|
|
5989
5995
|
}, [t]), [n, i];
|
|
5990
5996
|
} : function() {
|
|
5991
|
-
return [
|
|
5997
|
+
return [ka, Ma];
|
|
5992
5998
|
};
|
|
5993
|
-
function
|
|
5999
|
+
function Pa(e, t) {
|
|
5994
6000
|
if (typeof e == "function") return e(t);
|
|
5995
6001
|
e && (e.current = t);
|
|
5996
6002
|
}
|
|
5997
|
-
var
|
|
6003
|
+
var Fa, Ia = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
5998
6004
|
return (t) => {
|
|
5999
6005
|
let n = [];
|
|
6000
6006
|
for (let r of e) {
|
|
6001
|
-
let e =
|
|
6002
|
-
n.push(i ? e : () =>
|
|
6007
|
+
let e = Pa(r, t), i = typeof e == "function";
|
|
6008
|
+
n.push(i ? e : () => Pa(r, null));
|
|
6003
6009
|
}
|
|
6004
6010
|
return () => {
|
|
6005
6011
|
for (let e of n) e();
|
|
@@ -6007,17 +6013,17 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6007
6013
|
};
|
|
6008
6014
|
} : function(e) {
|
|
6009
6015
|
return (t) => {
|
|
6010
|
-
for (let n of e)
|
|
6016
|
+
for (let n of e) Pa(n, t);
|
|
6011
6017
|
};
|
|
6012
|
-
},
|
|
6018
|
+
}, La = {
|
|
6013
6019
|
fill: { fill: "color-mix(in srgb, var(--sxl-color-primary, rgb(0, 120, 215)) 14%, transparent)" },
|
|
6014
6020
|
border: null,
|
|
6015
6021
|
inner: null
|
|
6016
|
-
},
|
|
6022
|
+
}, Ra = {
|
|
6017
6023
|
stroke: "var(--sxl-color-primary, rgb(0, 120, 215))",
|
|
6018
6024
|
alignWidth: 1,
|
|
6019
6025
|
inset: 1
|
|
6020
|
-
},
|
|
6026
|
+
}, za = a(function(e, t) {
|
|
6021
6027
|
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
6028
|
u(() => {
|
|
6023
6029
|
l && O.current?.focus();
|
|
@@ -6039,7 +6045,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6039
6045
|
colStart: 0,
|
|
6040
6046
|
rowEnd: Math.max(0, n - 1),
|
|
6041
6047
|
colEnd: 0
|
|
6042
|
-
}) }), [n]), j = s ?? k, [M, { width: N }] =
|
|
6048
|
+
}) }), [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
6049
|
rowCount: n,
|
|
6044
6050
|
columnCount: 1,
|
|
6045
6051
|
getRowHeight: a,
|
|
@@ -6047,7 +6053,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6047
6053
|
});
|
|
6048
6054
|
return b("div", {
|
|
6049
6055
|
ref: R,
|
|
6050
|
-
className:
|
|
6056
|
+
className: q("list-surface", _),
|
|
6051
6057
|
style: {
|
|
6052
6058
|
position: "relative",
|
|
6053
6059
|
overflow: "hidden",
|
|
@@ -6086,9 +6092,9 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6086
6092
|
b(Ji, {
|
|
6087
6093
|
selection: j,
|
|
6088
6094
|
anchorHole: !1,
|
|
6089
|
-
singleStyle:
|
|
6090
|
-
singleAnchorStyle:
|
|
6091
|
-
multiAnchorStyle:
|
|
6095
|
+
singleStyle: La,
|
|
6096
|
+
singleAnchorStyle: Ra,
|
|
6097
|
+
multiAnchorStyle: Ra
|
|
6092
6098
|
}, "__selection"),
|
|
6093
6099
|
b(fi, {
|
|
6094
6100
|
renderCell: r,
|
|
@@ -6101,7 +6107,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6101
6107
|
})
|
|
6102
6108
|
})
|
|
6103
6109
|
});
|
|
6104
|
-
}),
|
|
6110
|
+
}), Ba = a(function(e, t) {
|
|
6105
6111
|
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
6112
|
let { key: t, style: n, range: i, cell: a } = e, o = i?.rowStart ?? a.rowIndex;
|
|
6107
6113
|
return b("div", {
|
|
@@ -6121,9 +6127,9 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6121
6127
|
children: r(o)
|
|
6122
6128
|
}, t);
|
|
6123
6129
|
}, [r]), y = p(() => o ? { onKeyDown: o } : void 0, [o]);
|
|
6124
|
-
return b(
|
|
6130
|
+
return b(za, {
|
|
6125
6131
|
ref: _,
|
|
6126
|
-
className:
|
|
6132
|
+
className: q("list", f),
|
|
6127
6133
|
style: m,
|
|
6128
6134
|
itemCount: n,
|
|
6129
6135
|
itemHeight: i,
|
|
@@ -6136,7 +6142,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6136
6142
|
viewport: d,
|
|
6137
6143
|
...g
|
|
6138
6144
|
});
|
|
6139
|
-
}),
|
|
6145
|
+
}), Va = (e, t) => b("input", {
|
|
6140
6146
|
type: "checkbox",
|
|
6141
6147
|
checked: e,
|
|
6142
6148
|
ref: (e) => {
|
|
@@ -6145,8 +6151,8 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6145
6151
|
readOnly: !0,
|
|
6146
6152
|
tabIndex: -1,
|
|
6147
6153
|
style: { margin: 0 }
|
|
6148
|
-
}),
|
|
6149
|
-
let { itemCount: n, isChecked: r, onCheckedChange: i, renderValue: a, renderCheckbox: o =
|
|
6154
|
+
}), Ha = a(function(e, t) {
|
|
6155
|
+
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
6156
|
rowStart: 0,
|
|
6151
6157
|
colStart: 0,
|
|
6152
6158
|
rowEnd: Math.max(0, n - 1),
|
|
@@ -6231,7 +6237,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6231
6237
|
]);
|
|
6232
6238
|
return x("div", {
|
|
6233
6239
|
ref: M,
|
|
6234
|
-
className:
|
|
6240
|
+
className: q("checkbox-list", v),
|
|
6235
6241
|
style: {
|
|
6236
6242
|
display: "flex",
|
|
6237
6243
|
flexDirection: "column",
|
|
@@ -6258,7 +6264,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6258
6264
|
},
|
|
6259
6265
|
children: o(I, L)
|
|
6260
6266
|
}), l]
|
|
6261
|
-
}), s?.()] }), b(
|
|
6267
|
+
}), s?.()] }), b(Ba, {
|
|
6262
6268
|
itemCount: n,
|
|
6263
6269
|
itemHeight: u,
|
|
6264
6270
|
selection: E,
|
|
@@ -6274,21 +6280,21 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6274
6280
|
}
|
|
6275
6281
|
})]
|
|
6276
6282
|
});
|
|
6277
|
-
}),
|
|
6283
|
+
}), Ua = (e, t) => {
|
|
6278
6284
|
let n = (() => {
|
|
6279
|
-
if (
|
|
6285
|
+
if (Fa !== void 0) return Fa;
|
|
6280
6286
|
try {
|
|
6281
|
-
|
|
6287
|
+
Fa = (typeof document < "u" ? document.createElement("canvas").getContext("2d") : null) ?? null;
|
|
6282
6288
|
} catch {
|
|
6283
|
-
|
|
6289
|
+
Fa = null;
|
|
6284
6290
|
}
|
|
6285
|
-
return
|
|
6291
|
+
return Fa;
|
|
6286
6292
|
})();
|
|
6287
6293
|
if (n) return n.font = t, n.measureText(e).width;
|
|
6288
6294
|
let r = Number.parseFloat((/(\d+(?:\.\d+)?)px/.exec(t) ?? [])[1] ?? "16") || 16;
|
|
6289
6295
|
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 =
|
|
6296
|
+
}, Wa = (e, t) => t <= 0 ? -1 : Math.min(Math.max(0, e), t - 1), Ga = a(function(e, t) {
|
|
6297
|
+
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
6298
|
initial: { cell: {
|
|
6293
6299
|
rowIndex: Math.max(0, S),
|
|
6294
6300
|
colIndex: 0
|
|
@@ -6309,7 +6315,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6309
6315
|
x
|
|
6310
6316
|
]), A = F(() => x === 0 ? -1 : w.getSelection().cell.rowIndex, [w, x]), j = F((e) => {
|
|
6311
6317
|
if (x === 0) return;
|
|
6312
|
-
let t =
|
|
6318
|
+
let t = Wa(w.getSelection().cell.rowIndex + e, x);
|
|
6313
6319
|
w.setSelection({ cell: {
|
|
6314
6320
|
rowIndex: t,
|
|
6315
6321
|
colIndex: 0
|
|
@@ -6329,7 +6335,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6329
6335
|
let t = e?.fontSize, n = e?.fontFamily, r = typeof t == "number" ? `${t}px` : t ?? "16px", i = [];
|
|
6330
6336
|
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
6337
|
})(_);
|
|
6332
|
-
return (t) =>
|
|
6338
|
+
return (t) => Ua(t, e);
|
|
6333
6339
|
}, [l, _]), P = p(() => {
|
|
6334
6340
|
if (s != null) return s;
|
|
6335
6341
|
let e = 0;
|
|
@@ -6373,9 +6379,9 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6373
6379
|
e.which !== C.Enter && e.which !== C.Space || (e.preventDefault(), e.stopPropagation(), k(A()));
|
|
6374
6380
|
}
|
|
6375
6381
|
}), [k, A]);
|
|
6376
|
-
return b(
|
|
6382
|
+
return b(za, {
|
|
6377
6383
|
ref: M,
|
|
6378
|
-
className:
|
|
6384
|
+
className: q("pick-list", g),
|
|
6379
6385
|
role: "listbox",
|
|
6380
6386
|
style: {
|
|
6381
6387
|
maxHeight: o * a,
|
|
@@ -6393,10 +6399,10 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6393
6399
|
cacheToken: n,
|
|
6394
6400
|
...y
|
|
6395
6401
|
});
|
|
6396
|
-
}),
|
|
6402
|
+
}), Ka = "_search_b1nag_5", qa = (e, t) => {
|
|
6397
6403
|
let n = t.trim().toLowerCase();
|
|
6398
6404
|
return n ? e.filter((e) => e.text.toLowerCase().includes(n)) : e;
|
|
6399
|
-
},
|
|
6405
|
+
}, Ja = a(function(e, t) {
|
|
6400
6406
|
let { value: n, onChange: r, onClose: i, onKeyDown: a, className: o, ...s } = e, l = c((e) => {
|
|
6401
6407
|
if (e.which === C.Escape) return e.preventDefault(), e.stopPropagation(), void (n ? r("") : i?.());
|
|
6402
6408
|
a?.(e);
|
|
@@ -6412,19 +6418,19 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6412
6418
|
role: "searchbox",
|
|
6413
6419
|
autoComplete: "off",
|
|
6414
6420
|
spellCheck: !1,
|
|
6415
|
-
className:
|
|
6421
|
+
className: q(Ka, "list-search", o),
|
|
6416
6422
|
value: n,
|
|
6417
6423
|
onChange: (e) => r(e.target.value),
|
|
6418
6424
|
onKeyDown: l,
|
|
6419
6425
|
...s
|
|
6420
6426
|
});
|
|
6421
|
-
}),
|
|
6427
|
+
}), Ya = {
|
|
6422
6428
|
light: {},
|
|
6423
6429
|
dark: {
|
|
6424
6430
|
"color-base-100": "#1e1e1e",
|
|
6425
6431
|
"color-base-300": "#3a3a3a"
|
|
6426
6432
|
}
|
|
6427
|
-
},
|
|
6433
|
+
}, Xa = {
|
|
6428
6434
|
light: {
|
|
6429
6435
|
"color-base-100": "#f2f2f2",
|
|
6430
6436
|
"color-base-hover": "#ececec",
|
|
@@ -6435,7 +6441,7 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6435
6441
|
"color-base-hover": "#2e2e2e",
|
|
6436
6442
|
"color-base-300": "#4a4a4a"
|
|
6437
6443
|
}
|
|
6438
|
-
},
|
|
6444
|
+
}, 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
6445
|
let a = e ?? M, o = Object.fromEntries(Object.keys(n).map((e) => [e, {
|
|
6440
6446
|
"color-base-100": a[e]?.["color-base-200"],
|
|
6441
6447
|
...n[e]
|
|
@@ -6450,4 +6456,4 @@ var Pa, Fa = parseInt(v.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
6450
6456
|
scope: i
|
|
6451
6457
|
});
|
|
6452
6458
|
};
|
|
6453
|
-
export { Tr as AUTO_SCROLL_INTERVAL_MS, fi as CellLayer, di as CellTileDiv,
|
|
6459
|
+
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 };
|