@gridsheet/react-core 3.0.1 → 3.0.3
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/dist/components/HeaderCellLeft.d.ts.map +1 -1
- package/dist/components/HeaderCellTop.d.ts.map +1 -1
- package/dist/components/Tabular.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +155 -157
- package/dist/index.js.map +1 -1
- package/package.json +8 -4
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { calcSideStyle as Vn, clampPopup as Jt, clampLeft as qn, zoneToArea as de, focus as H, Lexer as qe, getFunctionHelps as $t, expandInput as Gn, y2r as ve, x2c as me, resetInput as Qn, handleFormulaQuoteAutoClose as en, areaToZone as Ge, insertTextAtCursor as tn, operations as O, isRefInsertable as nn, COLOR_PALETTE as De, DEFAULT_WIDTH as yt, DEFAULT_HEIGHT as vt, between as Te, makeSequence as Pt, p2a as Ne, MIN_HEIGHT as Xt, MIN_WIDTH as Ot, zoneShape as te, getLabel as bt, FormulaError as Jn, Pending as es, insertRef as Me, areaToRange as sn, calcBelowPosition as ts, hAlignTransform as ns, among as ss, getAreaInTabular as Ht, isFocus as rs, Autofill as os, getCellRectPositions as Ie, a2p as wt, virtualize as Lt, stripAddressAbsolute as is, stripSheetName as ls, preventSafariBounce as as, smartScroll as cs, isZoneNotSelected as us, Sheet as ds, embedStyle as gs, getMaxSizesFromCells as rn, HEADER_HEIGHT as hs, DEFAULT_ROW_KEY as fs, SHEET_HEIGHT as Bt, HEADER_WIDTH as ms, DEFAULT_COL_KEY as ps, SHEET_WIDTH as Kt } from "@gridsheet/core";
|
|
2
|
-
import { BaseFunction as Ir, BaseFunctionAsync as Fr, DEFAULT_HISTORY_LIMIT as Yr, FormulaError as $r, FormulaParser as Pr, Lexer as Xr, Pending as Or,
|
|
2
|
+
import { BaseFunction as Ir, BaseFunctionAsync as Fr, DEFAULT_HISTORY_LIMIT as Yr, FormulaError as $r, FormulaParser as Pr, Lexer as Xr, Pending as Or, PercentagePolicyMixin as Hr, Policy as Lr, RangeEntity as Br, RefEntity as Kr, Registry as Zr, Sheet as Ur, Spilling as zr, ThousandSeparatorPolicyMixin as Wr, Time as _r, ValueEntity as jr, a2p as Vr, aa2oa as qr, addressesToAreas as Gr, addressesToCols as Qr, addressesToRows as Jr, areaToRange as eo, areaToZone as to, buildInitialCells as no, buildInitialCellsFromOrigin as so, c2x as ro, ch as oo, check as io, conditionArg as lo, createBook as ao, createBooleanMask as co, createRegistry as uo, eachMatrix as go, ensureBoolean as ho, ensureDate as fo, ensureNumber as mo, ensureString as po, matrixShape as yo, oa2aa as vo, operations as bo, p2a as wo, r2y as Ro, rh as Co, stripMatrix as So, toCellCols as No, toCellMatrix as Eo, toCellObject as xo, toCellRows as ko, toValueCols as To, toValueMatrix as Ao, toValueObject as Mo, toValueRows as Do, x2c as Io, y2r as Fo, zoneToArea as Yo } from "@gridsheet/core";
|
|
3
3
|
import { jsxs as F, jsx as c, Fragment as we } from "react/jsx-runtime";
|
|
4
|
-
import
|
|
5
|
-
import { u as vs, s as ue, w as Ze, a as re, b as Ue, r as ct, c as an, d as cn, e as $e, f as un, g as dn, h as be, i as _e, j as bs, k as Zt, l as ut, p as dt, m as
|
|
6
|
-
import { W as
|
|
4
|
+
import lt, { createContext as on, useRef as oe, useContext as ie, useLayoutEffect as at, useState as J, useMemo as Ye, useCallback as M, memo as tt, useEffect as Z, createRef as ln, useReducer as ys } from "react";
|
|
5
|
+
import { u as vs, s as ue, w as Ze, a as re, b as Ue, r as ct, c as an, d as cn, e as $e, f as un, g as dn, h as be, i as _e, j as bs, k as Zt, l as ut, p as dt, m as Qe, n as Se, o as gt, q as ht, t as Fe, v as Rt, x as gn, y as hn, z as fn, A as mn, B as pn, C as yn, D as ze, E as Je, F as ft, G as nt, H as ws, I as Pe, J as fe, K as xe, L as vn, M as Ke, N as Ut, O as bn, P as zt, Q as Wt, R as Rs, S as Cs, T as _t, U as Ss, V as Ns } from "./hooks-Y7BI_RNj.mjs";
|
|
6
|
+
import { W as Po } from "./hooks-Y7BI_RNj.mjs";
|
|
7
7
|
import { createPortal as Ct } from "react-dom";
|
|
8
8
|
const le = on(
|
|
9
9
|
{}
|
|
@@ -15,10 +15,10 @@ const le = on(
|
|
|
15
15
|
left: r
|
|
16
16
|
}) => {
|
|
17
17
|
const o = oe(null), i = oe(null), { store: h } = ie(le), f = !h.editorHovering;
|
|
18
|
-
return
|
|
18
|
+
return at(() => {
|
|
19
19
|
const a = i.current;
|
|
20
20
|
a && Vn(a);
|
|
21
|
-
}),
|
|
21
|
+
}), at(() => {
|
|
22
22
|
const a = o.current;
|
|
23
23
|
!a || r === void 0 || Jt(a);
|
|
24
24
|
}), e ? /* @__PURE__ */ F(
|
|
@@ -31,7 +31,7 @@ const le = on(
|
|
|
31
31
|
},
|
|
32
32
|
children: [
|
|
33
33
|
e.category && e.isFunction && /* @__PURE__ */ c("span", { className: `gs-fn-guide-category gs-fn-guide-category-${e.category}`, children: e.category }),
|
|
34
|
-
e.tooltip && /* @__PURE__ */ c("div", { className: "gs-fn-guide1-tooltip", children: typeof e.tooltip == "function" ?
|
|
34
|
+
e.tooltip && /* @__PURE__ */ c("div", { className: "gs-fn-guide1-tooltip", children: typeof e.tooltip == "function" ? lt.createElement(e.tooltip, { value: e.value }) : e.tooltip }),
|
|
35
35
|
e.isFunction && /* @__PURE__ */ F(we, { children: [
|
|
36
36
|
/* @__PURE__ */ c("div", { className: "gs-fn-guide1-example", children: e.example }),
|
|
37
37
|
e.description && /* @__PURE__ */ c("div", { className: "gs-fn-guide1-desc", style: { whiteSpace: "pre-line" }, children: e.description }),
|
|
@@ -71,7 +71,7 @@ const le = on(
|
|
|
71
71
|
m = d === w + y;
|
|
72
72
|
} else
|
|
73
73
|
m = !1;
|
|
74
|
-
return /* @__PURE__ */ F(
|
|
74
|
+
return /* @__PURE__ */ F(lt.Fragment, { children: [
|
|
75
75
|
d > 0 ? ", " : "",
|
|
76
76
|
/* @__PURE__ */ F("span", { className: m ? "gs-active-arg" : "", children: [
|
|
77
77
|
b.optional ? "[" : "",
|
|
@@ -115,7 +115,7 @@ const le = on(
|
|
|
115
115
|
onOptionMouseDown: r
|
|
116
116
|
}) => {
|
|
117
117
|
const o = oe(null), [i, h] = J(t);
|
|
118
|
-
return
|
|
118
|
+
return at(() => {
|
|
119
119
|
if (!o.current)
|
|
120
120
|
return;
|
|
121
121
|
const f = o.current.getBoundingClientRect().width;
|
|
@@ -135,7 +135,7 @@ const le = on(
|
|
|
135
135
|
},
|
|
136
136
|
a
|
|
137
137
|
)) });
|
|
138
|
-
},
|
|
138
|
+
}, et = (e) => {
|
|
139
139
|
const { selectingZone: n, choosing: t, editorRef: s, sheetReactive: r } = e, o = r.current;
|
|
140
140
|
if (!o)
|
|
141
141
|
return { top: 0, left: 0, bottom: 0, right: 0 };
|
|
@@ -320,7 +320,7 @@ const le = on(
|
|
|
320
320
|
activeFunctionHelp: f,
|
|
321
321
|
activeArgIndex: a
|
|
322
322
|
};
|
|
323
|
-
},
|
|
323
|
+
}, st = ({ children: e, style: n, className: t = "", ...s }) => {
|
|
324
324
|
const { document: r } = vs();
|
|
325
325
|
return r == null ? null : Ct(
|
|
326
326
|
/* @__PURE__ */ c("div", { ...s, className: `gs-fixed ${t}`, style: n, children: e }),
|
|
@@ -427,11 +427,11 @@ const Sn = (e, n = " ") => {
|
|
|
427
427
|
const h = e[i];
|
|
428
428
|
if (h === `
|
|
429
429
|
` && !r) {
|
|
430
|
-
s.push({ value:
|
|
430
|
+
s.push({ value: rt(o) }), o = "", s = [], t.push(s);
|
|
431
431
|
continue;
|
|
432
432
|
}
|
|
433
433
|
if (h === n) {
|
|
434
|
-
s.push({ value:
|
|
434
|
+
s.push({ value: rt(o) }), o = "";
|
|
435
435
|
continue;
|
|
436
436
|
}
|
|
437
437
|
if (h === '"' && !r && o === "") {
|
|
@@ -444,8 +444,8 @@ const Sn = (e, n = " ") => {
|
|
|
444
444
|
}
|
|
445
445
|
o += h;
|
|
446
446
|
}
|
|
447
|
-
return o && s.push({ value:
|
|
448
|
-
},
|
|
447
|
+
return o && s.push({ value: rt(o) }), t;
|
|
448
|
+
}, rt = (e) => e.replace(/\x00/g, '"'), ks = /* @__PURE__ */ new Set([
|
|
449
449
|
"ADDRESS",
|
|
450
450
|
"ARTICLE",
|
|
451
451
|
"ASIDE",
|
|
@@ -546,16 +546,16 @@ const Sn = (e, n = " ") => {
|
|
|
546
546
|
optionsAll: v,
|
|
547
547
|
functions: p == null ? void 0 : p.registry.functions
|
|
548
548
|
});
|
|
549
|
-
|
|
549
|
+
Z(() => {
|
|
550
550
|
H(N == null ? void 0 : N.current);
|
|
551
|
-
}, [N]),
|
|
551
|
+
}, [N]), Z(() => {
|
|
552
552
|
p && p.registry.lastFocused != null && p.registry.lastFocused === N.current && p.registry.lastFocused === Y.current && t(ue(""));
|
|
553
|
-
}, [p == null ? void 0 : p.registry.lastFocused, p, N, Y, t]),
|
|
553
|
+
}, [p == null ? void 0 : p.registry.lastFocused, p, N, Y, t]), Z(() => {
|
|
554
554
|
p && (p.registry.editingSheetId = P, p.registry.editingAddress = d);
|
|
555
|
-
}, [d, p, P]),
|
|
555
|
+
}, [d, p, P]), Z(() => {
|
|
556
556
|
Gn(N.current);
|
|
557
557
|
}, [u, d, N]);
|
|
558
|
-
const { y: z, x: K } = a, G = `${ve(z)}`,
|
|
558
|
+
const { y: z, x: K } = a, G = `${ve(z)}`, U = `${me(K)}${G}`, X = d === U, Q = p == null ? void 0 : p.getCell({ y: z, x: K }, { resolution: "RAW" }), R = p ? p.getSerializedValue({ point: a, cell: Q, resolution: "RAW" }) : "", [_, ge] = J(R), ee = M(
|
|
559
559
|
(k) => {
|
|
560
560
|
_ !== k && t(Ze({ value: k })), ge(k);
|
|
561
561
|
},
|
|
@@ -573,7 +573,7 @@ const Sn = (e, n = " ") => {
|
|
|
573
573
|
}, 0);
|
|
574
574
|
} else {
|
|
575
575
|
const se = p.update({
|
|
576
|
-
diff: { [
|
|
576
|
+
diff: { [U]: { value: j.value } },
|
|
577
577
|
partial: !0
|
|
578
578
|
});
|
|
579
579
|
t(Ue(se.clone())), t(ue("")), t(re(""));
|
|
@@ -581,9 +581,9 @@ const Sn = (e, n = " ") => {
|
|
|
581
581
|
L(0);
|
|
582
582
|
}
|
|
583
583
|
},
|
|
584
|
-
[A, p,
|
|
584
|
+
[A, p, U, u, ee, t, N]
|
|
585
585
|
);
|
|
586
|
-
|
|
586
|
+
Z(() => {
|
|
587
587
|
p && (ge(R), t(re(R)), Qn(N.current, p, a));
|
|
588
588
|
}, [a, R, t, N, p]);
|
|
589
589
|
const { y: Ee, x: We, height: Tt, width: At } = b, Ln = R.split(`
|
|
@@ -729,7 +729,7 @@ const Sn = (e, n = " ") => {
|
|
|
729
729
|
if (k.ctrlKey || k.metaKey) {
|
|
730
730
|
if (!X) {
|
|
731
731
|
k.preventDefault();
|
|
732
|
-
const ye =
|
|
732
|
+
const ye = et(n);
|
|
733
733
|
return t(dn(Ge(ye))), H(j), !1;
|
|
734
734
|
}
|
|
735
735
|
return !0;
|
|
@@ -769,7 +769,7 @@ const Sn = (e, n = " ") => {
|
|
|
769
769
|
case "x":
|
|
770
770
|
if ((k.ctrlKey || k.metaKey) && !X) {
|
|
771
771
|
k.preventDefault();
|
|
772
|
-
const ye =
|
|
772
|
+
const ye = et(n);
|
|
773
773
|
return t(cn(Ge(ye))), H(j), !1;
|
|
774
774
|
}
|
|
775
775
|
break;
|
|
@@ -781,7 +781,7 @@ const Sn = (e, n = " ") => {
|
|
|
781
781
|
(k.ctrlKey || k.metaKey) && (X || (k.preventDefault(), ee((/* @__PURE__ */ new Date()).toDateString())));
|
|
782
782
|
break;
|
|
783
783
|
}
|
|
784
|
-
return k.ctrlKey || k.metaKey ? !1 : O.hasOperation(Q == null ? void 0 : Q.prevention, O.Write) ? (console.warn("This cell is protected from writing."), !1) : (t(ue(
|
|
784
|
+
return k.ctrlKey || k.metaKey ? !1 : O.hasOperation(Q == null ? void 0 : Q.prevention, O.Write) ? (console.warn("This cell is protected from writing."), !1) : (t(ue(U)), X || t(re("")), L(0), !1);
|
|
785
785
|
},
|
|
786
786
|
[
|
|
787
787
|
Mt,
|
|
@@ -795,7 +795,7 @@ const Sn = (e, n = " ") => {
|
|
|
795
795
|
a,
|
|
796
796
|
n,
|
|
797
797
|
Q,
|
|
798
|
-
|
|
798
|
+
U,
|
|
799
799
|
ee,
|
|
800
800
|
T,
|
|
801
801
|
u
|
|
@@ -812,13 +812,13 @@ const Sn = (e, n = " ") => {
|
|
|
812
812
|
return;
|
|
813
813
|
}
|
|
814
814
|
const j = k.currentTarget;
|
|
815
|
-
X || (t(re(R)), t(ue(
|
|
815
|
+
X || (t(re(R)), t(ue(U)), requestAnimationFrame(() => {
|
|
816
816
|
j.style.width = `${j.scrollWidth}px`, j.style.height = `${j.scrollHeight}px`;
|
|
817
817
|
const se = new String(R).length;
|
|
818
818
|
j.setSelectionRange(se, se);
|
|
819
819
|
}));
|
|
820
820
|
},
|
|
821
|
-
[Q, X, R,
|
|
821
|
+
[Q, X, R, U]
|
|
822
822
|
), Un = M(
|
|
823
823
|
(k) => {
|
|
824
824
|
if (f(!1), nn(k.currentTarget))
|
|
@@ -866,14 +866,14 @@ const Sn = (e, n = " ") => {
|
|
|
866
866
|
[pe]
|
|
867
867
|
);
|
|
868
868
|
return p ? /* @__PURE__ */ F(
|
|
869
|
-
|
|
869
|
+
st,
|
|
870
870
|
{
|
|
871
871
|
className: `gs-editor ${X ? "gs-editing" : ""}`,
|
|
872
872
|
style: X ? { top: Ee, left: We, height: Tt } : {},
|
|
873
873
|
"data-mode": e,
|
|
874
874
|
"data-sheet-id": P,
|
|
875
875
|
children: [
|
|
876
|
-
/* @__PURE__ */ c("div", { className: `gs-cell-label ${X ? " gs-hidden" : ""}`, children:
|
|
876
|
+
/* @__PURE__ */ c("div", { className: `gs-cell-label ${X ? " gs-hidden" : ""}`, children: U }),
|
|
877
877
|
/* @__PURE__ */ F("div", { className: "gs-editor-inner", style: { width: At }, children: [
|
|
878
878
|
/* @__PURE__ */ c(
|
|
879
879
|
"pre",
|
|
@@ -909,10 +909,10 @@ const Sn = (e, n = " ") => {
|
|
|
909
909
|
onKeyDown: Bn,
|
|
910
910
|
onKeyUp: _n,
|
|
911
911
|
onMouseEnter: () => {
|
|
912
|
-
t(
|
|
912
|
+
t(Qe(!0));
|
|
913
913
|
},
|
|
914
914
|
onMouseLeave: () => {
|
|
915
|
-
t(
|
|
915
|
+
t(Qe(!1));
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
918
|
)
|
|
@@ -921,7 +921,7 @@ const Sn = (e, n = " ") => {
|
|
|
921
921
|
]
|
|
922
922
|
}
|
|
923
923
|
) : null;
|
|
924
|
-
},
|
|
924
|
+
}, ot = tt(
|
|
925
925
|
({ token: e, tokenKey: n, color: t, className: s }) => /* @__PURE__ */ c("span", { style: t ? { color: t } : void 0, className: s, children: e.stringify() }, n),
|
|
926
926
|
(e, n) => e.tokenKey === n.tokenKey && e.color === n.color && e.className === n.className && e.token.stringify() === n.token.stringify()
|
|
927
927
|
), Nn = (e) => {
|
|
@@ -935,13 +935,13 @@ const Sn = (e, n = " ") => {
|
|
|
935
935
|
"=",
|
|
936
936
|
n.tokens.map((o, i) => {
|
|
937
937
|
if (o.type === "SPACE")
|
|
938
|
-
return /* @__PURE__ */ c(
|
|
938
|
+
return /* @__PURE__ */ c(lt.Fragment, { children: o.stringify() }, `${r}-SPACE-${i}`);
|
|
939
939
|
const h = `${r}-${o.type}-${o.stringify()}-${i}`;
|
|
940
940
|
if (o.type === "REF" || o.type === "RANGE") {
|
|
941
941
|
const f = o.stringify(), a = s[f];
|
|
942
942
|
if (a !== void 0)
|
|
943
943
|
return /* @__PURE__ */ c(
|
|
944
|
-
|
|
944
|
+
ot,
|
|
945
945
|
{
|
|
946
946
|
token: o,
|
|
947
947
|
tokenKey: h,
|
|
@@ -951,7 +951,7 @@ const Sn = (e, n = " ") => {
|
|
|
951
951
|
);
|
|
952
952
|
const u = De[t % De.length];
|
|
953
953
|
return s[f] = t++, /* @__PURE__ */ c(
|
|
954
|
-
|
|
954
|
+
ot,
|
|
955
955
|
{
|
|
956
956
|
token: o,
|
|
957
957
|
tokenKey: h,
|
|
@@ -962,7 +962,7 @@ const Sn = (e, n = " ") => {
|
|
|
962
962
|
);
|
|
963
963
|
}
|
|
964
964
|
return /* @__PURE__ */ c(
|
|
965
|
-
|
|
965
|
+
ot,
|
|
966
966
|
{
|
|
967
967
|
token: o,
|
|
968
968
|
tokenKey: h,
|
|
@@ -1001,9 +1001,9 @@ const As = ({
|
|
|
1001
1001
|
mode: i
|
|
1002
1002
|
}) => {
|
|
1003
1003
|
const { store: h, dispatch: f } = ie(le), { sheetReactive: a } = h, u = a.current;
|
|
1004
|
-
|
|
1004
|
+
Z(() => {
|
|
1005
1005
|
u && e && e !== u.name && (u.name = e, u.registry.sheetIdsByName[e] = u.id, delete u.registry.sheetIdsByName[u.prevName], u.prevName = e);
|
|
1006
|
-
}, [e]),
|
|
1006
|
+
}, [e]), Z(() => {
|
|
1007
1007
|
if (!u)
|
|
1008
1008
|
return;
|
|
1009
1009
|
const { registry: d } = u;
|
|
@@ -1019,17 +1019,17 @@ const As = ({
|
|
|
1019
1019
|
},
|
|
1020
1020
|
dispatch: f
|
|
1021
1021
|
});
|
|
1022
|
-
}, [h, u, s, r]),
|
|
1022
|
+
}, [h, u, s, r]), Z(() => {
|
|
1023
1023
|
n && f(Se({ sheetHeight: n }));
|
|
1024
|
-
}, [n, f]),
|
|
1024
|
+
}, [n, f]), Z(() => {
|
|
1025
1025
|
t && f(Se({ sheetWidth: t }));
|
|
1026
|
-
}, [t]),
|
|
1026
|
+
}, [t]), Z(() => {
|
|
1027
1027
|
typeof o < "u" && f(Se({ editingOnEnter: o }));
|
|
1028
|
-
}, [o]),
|
|
1028
|
+
}, [o]), Z(() => {
|
|
1029
1029
|
i && f(Se({ mode: i }));
|
|
1030
1030
|
}, [i]);
|
|
1031
1031
|
const [w, b] = xn();
|
|
1032
|
-
return
|
|
1032
|
+
return Z(() => {
|
|
1033
1033
|
w && (b.setStore(h), b.setApply(() => f));
|
|
1034
1034
|
}, [h, w, b]), /* @__PURE__ */ c(we, {});
|
|
1035
1035
|
}, Ms = () => {
|
|
@@ -1100,7 +1100,7 @@ const As = ({
|
|
|
1100
1100
|
);
|
|
1101
1101
|
}, Ds = () => {
|
|
1102
1102
|
const { store: e } = ie(le), { choosing: n, selectingZone: t, sheetReactive: s } = e, r = s.current;
|
|
1103
|
-
return
|
|
1103
|
+
return Z(() => {
|
|
1104
1104
|
r != null && r.isInitialized && r.currentVersion > 0 && r.registry.onChange && r.registry.onChange({
|
|
1105
1105
|
sheet: r,
|
|
1106
1106
|
points: {
|
|
@@ -1109,7 +1109,7 @@ const As = ({
|
|
|
1109
1109
|
selectingTo: { y: t.endY, x: t.endX }
|
|
1110
1110
|
}
|
|
1111
1111
|
});
|
|
1112
|
-
}, [s]),
|
|
1112
|
+
}, [s]), Z(() => {
|
|
1113
1113
|
r && r.registry.onSelect && r.registry.onSelect({
|
|
1114
1114
|
sheet: r,
|
|
1115
1115
|
points: {
|
|
@@ -1120,10 +1120,10 @@ const As = ({
|
|
|
1120
1120
|
});
|
|
1121
1121
|
}, [n, t]), null;
|
|
1122
1122
|
}, kn = async ({ store: e, dispatch: n }) => {
|
|
1123
|
-
const { editorRef: t } = e, s =
|
|
1123
|
+
const { editorRef: t } = e, s = et(e);
|
|
1124
1124
|
n(dn(Ge(s))), H(t.current);
|
|
1125
1125
|
}, Tn = async ({ store: e, dispatch: n }) => {
|
|
1126
|
-
const { editorRef: t } = e, s =
|
|
1126
|
+
const { editorRef: t } = e, s = et(e);
|
|
1127
1127
|
n(cn(Ge(s))), H(t.current);
|
|
1128
1128
|
}, An = async ({ store: e, dispatch: n }, t = !1) => {
|
|
1129
1129
|
const { editorRef: s } = e, r = await navigator.clipboard.read();
|
|
@@ -1614,13 +1614,13 @@ const xt = ({
|
|
|
1614
1614
|
);
|
|
1615
1615
|
}, kt = () => /* @__PURE__ */ c("li", { className: "gs-menu-divider" }), Ks = () => {
|
|
1616
1616
|
const { store: e, dispatch: n } = ie(le), { contextMenuPosition: t, contextMenu: s } = e, { y: r, x: o } = t, i = oe(null);
|
|
1617
|
-
if (
|
|
1617
|
+
if (Z(() => {
|
|
1618
1618
|
i.current && Jt(i.current);
|
|
1619
1619
|
}), r === -1)
|
|
1620
1620
|
return null;
|
|
1621
1621
|
const h = () => n(ze({ y: -1, x: -1 })), f = Nt(e, n, h);
|
|
1622
1622
|
return /* @__PURE__ */ c(
|
|
1623
|
-
|
|
1623
|
+
st,
|
|
1624
1624
|
{
|
|
1625
1625
|
className: "gs-menu-modal gs-context-menu-modal",
|
|
1626
1626
|
onClick: (a) => (a.preventDefault(), h(), !1),
|
|
@@ -1665,7 +1665,7 @@ const xt = ({
|
|
|
1665
1665
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1666
1666
|
[e]
|
|
1667
1667
|
);
|
|
1668
|
-
|
|
1668
|
+
Z(() => {
|
|
1669
1669
|
if (i) {
|
|
1670
1670
|
const S = i.getCell({ y: 0, x: e }, { resolution: "SYSTEM" }), p = S == null ? void 0 : S.filter;
|
|
1671
1671
|
p && p.conditions.length > 0 ? (f(p.conditions.map((l) => ({ ...l, value: [...l.value] }))), u(p.mode || "or")) : (f([{ ...je, value: [""] }]), u("or"));
|
|
@@ -1674,9 +1674,9 @@ const xt = ({
|
|
|
1674
1674
|
const m = M(() => {
|
|
1675
1675
|
b(null), t == null || t(null), n();
|
|
1676
1676
|
}, [n, t]);
|
|
1677
|
-
|
|
1677
|
+
Z(() => {
|
|
1678
1678
|
w && (t == null || t("Filtering…", m));
|
|
1679
|
-
}, [w]),
|
|
1679
|
+
}, [w]), Z(() => {
|
|
1680
1680
|
if (!w)
|
|
1681
1681
|
return;
|
|
1682
1682
|
let S = !1;
|
|
@@ -1796,9 +1796,9 @@ const Us = ({ x: e, close: n, onWaiting: t }) => {
|
|
|
1796
1796
|
const { store: s, dispatch: r } = ie(le), { sheetReactive: o } = s, i = o.current, [h, f] = J(null), a = M(() => {
|
|
1797
1797
|
f(null), t == null || t(null), n();
|
|
1798
1798
|
}, [n, t]);
|
|
1799
|
-
if (
|
|
1799
|
+
if (Z(() => {
|
|
1800
1800
|
h && (t == null || t("Sorting…", a));
|
|
1801
|
-
}, [h]),
|
|
1801
|
+
}, [h]), Z(() => {
|
|
1802
1802
|
if (!h)
|
|
1803
1803
|
return;
|
|
1804
1804
|
let b = !1;
|
|
@@ -1842,7 +1842,7 @@ const Us = ({ x: e, close: n, onWaiting: t }) => {
|
|
|
1842
1842
|
Et("col-sort", Us);
|
|
1843
1843
|
const zs = ({ x: e, close: n }) => {
|
|
1844
1844
|
const { store: t, dispatch: s } = ie(le), { sheetReactive: r } = t, o = r.current, i = oe(null), [h, f] = J("");
|
|
1845
|
-
|
|
1845
|
+
Z(() => {
|
|
1846
1846
|
if (o) {
|
|
1847
1847
|
const d = o.getCell({ y: 0, x: e }, { resolution: "SYSTEM" });
|
|
1848
1848
|
f((d == null ? void 0 : d.label) ?? "");
|
|
@@ -1894,7 +1894,7 @@ const zs = ({ x: e, close: n }) => {
|
|
|
1894
1894
|
Et("col-label", zs);
|
|
1895
1895
|
const Ws = () => {
|
|
1896
1896
|
const { store: e, dispatch: n } = ie(le), { columnMenuState: t, editorRef: s, colMenu: r } = e, o = e.sheetReactive.current, i = t == null ? void 0 : t.x, h = t == null ? void 0 : t.position, [f, a] = J(null), u = M(() => {
|
|
1897
|
-
n(
|
|
1897
|
+
n(Je(null)), H(s.current);
|
|
1898
1898
|
}, [n, s]), w = M(
|
|
1899
1899
|
(d, m) => {
|
|
1900
1900
|
a(d ? { message: d, cancel: m ?? u } : null);
|
|
@@ -1905,7 +1905,7 @@ const Ws = () => {
|
|
|
1905
1905
|
return null;
|
|
1906
1906
|
const b = Nt(e, n, u);
|
|
1907
1907
|
return /* @__PURE__ */ F(
|
|
1908
|
-
|
|
1908
|
+
st,
|
|
1909
1909
|
{
|
|
1910
1910
|
className: "gs-menu-modal gs-column-menu-modal",
|
|
1911
1911
|
onClick: (d) => (d.preventDefault(), f || u(), !1),
|
|
@@ -1937,7 +1937,7 @@ const Ws = () => {
|
|
|
1937
1937
|
disabled: D,
|
|
1938
1938
|
testId: d.id ? `${d.id}-item` : void 0,
|
|
1939
1939
|
onClick: () => {
|
|
1940
|
-
d.onClick(b, i), n(
|
|
1940
|
+
d.onClick(b, i), n(Je(null));
|
|
1941
1941
|
}
|
|
1942
1942
|
},
|
|
1943
1943
|
m
|
|
@@ -1992,7 +1992,7 @@ const js = () => {
|
|
|
1992
1992
|
return null;
|
|
1993
1993
|
const u = Nt(e, n, a);
|
|
1994
1994
|
return /* @__PURE__ */ c(
|
|
1995
|
-
|
|
1995
|
+
st,
|
|
1996
1996
|
{
|
|
1997
1997
|
className: "gs-menu-modal gs-row-menu-modal",
|
|
1998
1998
|
onClick: (w) => (w.preventDefault(), a(), !1),
|
|
@@ -2009,7 +2009,7 @@ const js = () => {
|
|
|
2009
2009
|
return !1;
|
|
2010
2010
|
}, he = (e) => {
|
|
2011
2011
|
e.type.startsWith("touch") || e.preventDefault();
|
|
2012
|
-
}, Vs =
|
|
2012
|
+
}, Vs = tt(({ y: e, x: n }) => {
|
|
2013
2013
|
const t = ve(e), r = `${me(n)}${t}`, { store: o, dispatch: i } = ie(le), h = oe(!0), f = oe(null), [a, u] = J(null), {
|
|
2014
2014
|
sheetReactive: w,
|
|
2015
2015
|
editingAddress: b,
|
|
@@ -2020,7 +2020,7 @@ const js = () => {
|
|
|
2020
2020
|
editorRef: T,
|
|
2021
2021
|
autofillDraggingTo: N,
|
|
2022
2022
|
contextMenu: Y
|
|
2023
|
-
} = o, E = w.current, I =
|
|
2023
|
+
} = o, E = w.current, I = nt(o), $ = E == null ? void 0 : E.registry.lastFocused, P = de(m), S = b === r, p = d.y === e && d.x === n, l = M(() => {
|
|
2024
2024
|
var _;
|
|
2025
2025
|
const R = (_ = f.current) == null ? void 0 : _.getBoundingClientRect();
|
|
2026
2026
|
if (R == null)
|
|
@@ -2034,7 +2034,7 @@ const js = () => {
|
|
|
2034
2034
|
})
|
|
2035
2035
|
);
|
|
2036
2036
|
}, [i]);
|
|
2037
|
-
|
|
2037
|
+
Z(() => {
|
|
2038
2038
|
if (p && !h.current) {
|
|
2039
2039
|
l();
|
|
2040
2040
|
return;
|
|
@@ -2117,7 +2117,7 @@ const js = () => {
|
|
|
2117
2117
|
R && u(ts(R));
|
|
2118
2118
|
}, []), V = M(() => {
|
|
2119
2119
|
u(null);
|
|
2120
|
-
}, []),
|
|
2120
|
+
}, []), U = M(
|
|
2121
2121
|
(R) => Y.length > 0 ? (R.stopPropagation(), he(R), i(ze({ y: R.clientY, x: R.clientX })), !1) : !0,
|
|
2122
2122
|
[Y.length]
|
|
2123
2123
|
), X = M(
|
|
@@ -2139,7 +2139,7 @@ const js = () => {
|
|
|
2139
2139
|
style: {
|
|
2140
2140
|
...g == null ? void 0 : g.style
|
|
2141
2141
|
},
|
|
2142
|
-
onContextMenu:
|
|
2142
|
+
onContextMenu: U,
|
|
2143
2143
|
onDoubleClick: X,
|
|
2144
2144
|
children: /* @__PURE__ */ F(
|
|
2145
2145
|
"div",
|
|
@@ -2208,7 +2208,7 @@ function ke({ style: e, horizontal: n = 0, vertical: t = 0, className: s = "" })
|
|
|
2208
2208
|
editingAddress: m
|
|
2209
2209
|
} = o, y = b.current;
|
|
2210
2210
|
let D = !1;
|
|
2211
|
-
const T =
|
|
2211
|
+
const T = nt(o), N = !!(y != null && y.registry.editingAddress || m), Y = M(
|
|
2212
2212
|
(l) => {
|
|
2213
2213
|
if (!y)
|
|
2214
2214
|
return { x: -1, y: -1 };
|
|
@@ -2289,7 +2289,7 @@ function ke({ style: e, horizontal: n = 0, vertical: t = 0, className: s = "" })
|
|
|
2289
2289
|
), p = M(() => {
|
|
2290
2290
|
$();
|
|
2291
2291
|
}, [$]);
|
|
2292
|
-
return
|
|
2292
|
+
return Z(() => $, [$]), !w.current || !a && !f ? /* @__PURE__ */ c("div", { className: `gs-scroll-handle gs-hidden ${s}` }) : /* @__PURE__ */ c(
|
|
2293
2293
|
"div",
|
|
2294
2294
|
{
|
|
2295
2295
|
style: e,
|
|
@@ -2302,7 +2302,7 @@ function ke({ style: e, horizontal: n = 0, vertical: t = 0, className: s = "" })
|
|
|
2302
2302
|
}
|
|
2303
2303
|
);
|
|
2304
2304
|
}
|
|
2305
|
-
const Qs =
|
|
2305
|
+
const Qs = tt(({ x: e }) => {
|
|
2306
2306
|
const n = me(e), { store: t, dispatch: s } = ie(le), {
|
|
2307
2307
|
sheetReactive: r,
|
|
2308
2308
|
editingAddress: o,
|
|
@@ -2314,7 +2314,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
2314
2314
|
dragging: w,
|
|
2315
2315
|
contextMenu: b,
|
|
2316
2316
|
columnMenuState: d
|
|
2317
|
-
} = t, m = r.current, y = m == null ? void 0 : m.getCell({ y: 0, x: e }, { resolution: "SYSTEM" }), D = (y == null ? void 0 : y.width) || yt, T = !!(y != null && y.filter && y.filter.conditions.length > 0), N =
|
|
2317
|
+
} = t, m = r.current, y = m == null ? void 0 : m.getCell({ y: 0, x: e }, { resolution: "SYSTEM" }), D = (y == null ? void 0 : y.width) || yt, T = !!(y != null && y.filter && y.filter.conditions.length > 0), N = nt(t), Y = m == null ? void 0 : m.registry.lastFocused, E = !!(m != null && m.registry.editingAddress || o), I = M(
|
|
2318
2318
|
(l) => {
|
|
2319
2319
|
s(Ze({ value: l, point: i }));
|
|
2320
2320
|
},
|
|
@@ -2417,9 +2417,8 @@ const Qs = nt(({ x: e }) => {
|
|
|
2417
2417
|
if (Math.abs(l.clientX - v) > 4 || Math.abs(l.clientY - x) > 4)
|
|
2418
2418
|
return;
|
|
2419
2419
|
const C = g.getBoundingClientRect();
|
|
2420
|
-
(d == null ? void 0 : d.x) === e ? s(
|
|
2420
|
+
(d == null ? void 0 : d.x) === e ? s(Je(null)) : (Te({ start: h.startX, end: h.endX }, e) && h.startY === 1 && h.endY === m.numRows || s(Ut({ range: { start: e, end: e }, numRows: m.numRows })), s(Je({ x: e, position: { y: C.bottom, x: C.left } })));
|
|
2421
2421
|
},
|
|
2422
|
-
title: "Sort & Filter",
|
|
2423
2422
|
children: "⋮"
|
|
2424
2423
|
}
|
|
2425
2424
|
),
|
|
@@ -2443,7 +2442,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
2443
2442
|
/* @__PURE__ */ c(ke, { style: { position: "absolute" }, vertical: -1 }),
|
|
2444
2443
|
/* @__PURE__ */ c("div", { className: "gs-resizer" })
|
|
2445
2444
|
] }) }) });
|
|
2446
|
-
}), Js =
|
|
2445
|
+
}), Js = tt(({ y: e }) => {
|
|
2447
2446
|
const n = `${ve(e)}`, { store: t, dispatch: s } = ie(le), {
|
|
2448
2447
|
choosing: r,
|
|
2449
2448
|
editingAddress: o,
|
|
@@ -2455,7 +2454,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
2455
2454
|
dragging: w,
|
|
2456
2455
|
contextMenu: b,
|
|
2457
2456
|
rowMenuState: d
|
|
2458
|
-
} = t, m = a.current, y = m == null ? void 0 : m.getCell({ y: e, x: 0 }, { resolution: "SYSTEM" }), D = (y == null ? void 0 : y.height) || vt, T =
|
|
2457
|
+
} = t, m = a.current, y = m == null ? void 0 : m.getCell({ y: e, x: 0 }, { resolution: "SYSTEM" }), D = (y == null ? void 0 : y.height) || vt, T = nt(t), N = m == null ? void 0 : m.registry.lastFocused, Y = !!(m != null && m.registry.editingAddress || o), E = M(
|
|
2459
2458
|
(l) => {
|
|
2460
2459
|
s(Ze({ value: l, point: r }));
|
|
2461
2460
|
},
|
|
@@ -2557,7 +2556,6 @@ const Qs = nt(({ x: e }) => {
|
|
|
2557
2556
|
const C = g.getBoundingClientRect();
|
|
2558
2557
|
(d == null ? void 0 : d.y) === e ? s(ft(null)) : (Te({ start: i.startY, end: i.endY }, e) && i.startX === 1 && i.endX === m.numCols || s(zt({ range: { start: e, end: e }, numCols: m.numCols })), s(ft({ y: e, position: { y: C.bottom, x: C.right } })));
|
|
2559
2558
|
},
|
|
2560
|
-
title: "Row menu",
|
|
2561
2559
|
children: "⋮"
|
|
2562
2560
|
}
|
|
2563
2561
|
),
|
|
@@ -2577,7 +2575,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
2577
2575
|
)
|
|
2578
2576
|
}
|
|
2579
2577
|
) : null;
|
|
2580
|
-
}),
|
|
2578
|
+
}), it = "rgba(0, 119, 255, 1)", er = "rgba(0, 119, 255, 0.6)", tr = "rgba(0, 128, 255, 0.2)", nr = "#0077ff", sr = "#0077ff", rr = "rgba(0, 200, 100, 0.2)", or = "#00aa78", ir = "#0077aa", Qt = (e, n, t, s, r, o) => {
|
|
2581
2579
|
e.fillStyle = o, e.fillRect(n, t, s, r);
|
|
2582
2580
|
}, pt = (e, n, t, s, r, o, i = 2, h = [], f) => {
|
|
2583
2581
|
f && (e.fillStyle = f, e.fillRect(n, t, s, r)), e.strokeStyle = o, e.lineWidth = i, e.setLineDash(h), e.strokeRect(n + i / 2, t + i / 2, s - i, r - i), e.setLineDash([]);
|
|
@@ -2621,7 +2619,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
2621
2619
|
const { y: B, x: z } = r;
|
|
2622
2620
|
if (B !== -1 && z !== -1) {
|
|
2623
2621
|
const K = Ie(d, { y: B, x: z }), G = K.left - v, V = K.top - g;
|
|
2624
|
-
pt(I, G, V, K.width, K.height,
|
|
2622
|
+
pt(I, G, V, K.width, K.height, it, 2, []);
|
|
2625
2623
|
}
|
|
2626
2624
|
}
|
|
2627
2625
|
const { copyingSheetId: L, copyingZone: q, cutting: W } = l;
|
|
@@ -2637,13 +2635,13 @@ const Qs = nt(({ x: e }) => {
|
|
|
2637
2635
|
} catch {
|
|
2638
2636
|
}
|
|
2639
2637
|
}), i.forEach((B, z) => {
|
|
2640
|
-
const { y: K, x: G } = wt(B), V = Ie(d, { y: K, x: G }),
|
|
2641
|
-
if (
|
|
2638
|
+
const { y: K, x: G } = wt(B), V = Ie(d, { y: K, x: G }), U = V.left - v, X = V.top - g;
|
|
2639
|
+
if (U + V.width < 0 || U > S || X + V.height < 0 || X > p)
|
|
2642
2640
|
return;
|
|
2643
2641
|
const Q = z === h;
|
|
2644
2642
|
pt(
|
|
2645
2643
|
I,
|
|
2646
|
-
|
|
2644
|
+
U,
|
|
2647
2645
|
X,
|
|
2648
2646
|
V.width,
|
|
2649
2647
|
V.height,
|
|
@@ -2656,25 +2654,25 @@ const Qs = nt(({ x: e }) => {
|
|
|
2656
2654
|
const ne = d.numCols, ae = d.numRows;
|
|
2657
2655
|
for (let B = 1; B <= ne; B++) {
|
|
2658
2656
|
let z = null, K = null;
|
|
2659
|
-
if (Te({ start: o.startX, end: o.endX }, B) && (z = "rgba(80, 180, 255, 1)", K = a ? "rgba(128, 128, 128, 0.25)" : "rgba(0, 119, 255, 0.05)"), r.x === B && (z =
|
|
2657
|
+
if (Te({ start: o.startX, end: o.endX }, B) && (z = "rgba(80, 180, 255, 1)", K = a ? "rgba(128, 128, 128, 0.25)" : "rgba(0, 119, 255, 0.05)"), r.x === B && (z = it, K = a ? "rgba(128, 128, 128, 0.45)" : "rgba(0, 119, 255, 0.15)"), !z)
|
|
2660
2658
|
continue;
|
|
2661
2659
|
const G = Ie(d, { y: 1, x: B }), V = G.left - v;
|
|
2662
2660
|
if (V + G.width < x || V > S)
|
|
2663
2661
|
continue;
|
|
2664
|
-
const
|
|
2665
|
-
X > 0 && (K && Qt(I,
|
|
2662
|
+
const U = Math.max(V, x), X = Math.min(V + G.width, S) - U;
|
|
2663
|
+
X > 0 && (K && Qt(I, U, 0, X, A, K), I.strokeStyle = z, I.lineWidth = 2, I.beginPath(), I.moveTo(U, A + 1), I.lineTo(U + X, A + 1), I.stroke());
|
|
2666
2664
|
}
|
|
2667
2665
|
for (let B = 1; B <= ae; B++) {
|
|
2668
2666
|
if (d.isRowFiltered(B))
|
|
2669
2667
|
continue;
|
|
2670
2668
|
let z = null, K = null;
|
|
2671
|
-
if (Te({ start: o.startY, end: o.endY }, B) && (z = "rgba(80, 180, 255, 1)", K = u ? "rgba(128, 128, 128, 0.25)" : "rgba(0, 119, 255, 0.05)"), r.y === B && (z =
|
|
2669
|
+
if (Te({ start: o.startY, end: o.endY }, B) && (z = "rgba(80, 180, 255, 1)", K = u ? "rgba(128, 128, 128, 0.25)" : "rgba(0, 119, 255, 0.05)"), r.y === B && (z = it, K = u ? "rgba(128, 128, 128, 0.45)" : "rgba(0, 119, 255, 0.15)"), !z)
|
|
2672
2670
|
continue;
|
|
2673
2671
|
const G = Ie(d, { y: B, x: 1 }), V = G.top - g;
|
|
2674
2672
|
if (V + G.height < A || V > p)
|
|
2675
2673
|
continue;
|
|
2676
|
-
const
|
|
2677
|
-
X > 0 && (K && Qt(I, 0,
|
|
2674
|
+
const U = Math.max(V, A), X = Math.min(V + G.height, p) - U;
|
|
2675
|
+
X > 0 && (K && Qt(I, 0, U, x, X, K), I.strokeStyle = z, I.lineWidth = 2, I.beginPath(), I.moveTo(x + 1, U), I.lineTo(x + 1, U + X), I.stroke());
|
|
2678
2676
|
}
|
|
2679
2677
|
}, [
|
|
2680
2678
|
d,
|
|
@@ -2694,7 +2692,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
2694
2692
|
}, [T]), Y = M(() => {
|
|
2695
2693
|
T();
|
|
2696
2694
|
}, [T]);
|
|
2697
|
-
return
|
|
2695
|
+
return Z(() => (N(), () => cancelAnimationFrame(y.current)), [N]), Z(() => {
|
|
2698
2696
|
const E = s.current;
|
|
2699
2697
|
if (E)
|
|
2700
2698
|
return E.addEventListener("scroll", Y), () => {
|
|
@@ -2759,7 +2757,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
2759
2757
|
);
|
|
2760
2758
|
}));
|
|
2761
2759
|
}, [r]);
|
|
2762
|
-
|
|
2760
|
+
Z(() => {
|
|
2763
2761
|
if (!y)
|
|
2764
2762
|
return;
|
|
2765
2763
|
if (!(i && w.startsWith("="))) {
|
|
@@ -2773,19 +2771,19 @@ const Qs = nt(({ x: e }) => {
|
|
|
2773
2771
|
if (ae.type === "REF" || ae.type === "RANGE") {
|
|
2774
2772
|
const B = is(ae.stringify()), z = B.indexOf("!");
|
|
2775
2773
|
if (z !== -1) {
|
|
2776
|
-
const K = B.substring(0, z), G = B.substring(z + 1), V = ls(K),
|
|
2777
|
-
q[V] == null && (q[V] = {}), q[V][
|
|
2774
|
+
const K = B.substring(0, z), G = B.substring(z + 1), V = ls(K), U = G.toUpperCase();
|
|
2775
|
+
q[V] == null && (q[V] = {}), q[V][U] == null && (q[V][U] = ne++);
|
|
2778
2776
|
} else {
|
|
2779
2777
|
const K = B.toUpperCase();
|
|
2780
2778
|
L[K] == null && (L[K] = ne++);
|
|
2781
2779
|
}
|
|
2782
2780
|
}
|
|
2783
2781
|
n(L), y.registry.paletteBySheetName = q;
|
|
2784
|
-
}, [t.inputting, t.editingAddress, r]),
|
|
2782
|
+
}, [t.inputting, t.editingAddress, r]), Z(() => {
|
|
2785
2783
|
y && (y.registry.choosingAddress = Ne(o), y.registry.choosingSheetId = y.id);
|
|
2786
|
-
}, [o]),
|
|
2784
|
+
}, [o]), Z(() => {
|
|
2787
2785
|
y && T(Lt(y, h.current));
|
|
2788
|
-
}, [h.current, r, ($ = f.current) == null ? void 0 : $.clientHeight, (P = f.current) == null ? void 0 : P.clientWidth]),
|
|
2786
|
+
}, [h.current, r, ($ = f.current) == null ? void 0 : $.clientHeight, (P = f.current) == null ? void 0 : P.clientWidth]), Z(() => {
|
|
2789
2787
|
const C = h.current;
|
|
2790
2788
|
if (C)
|
|
2791
2789
|
return as(C);
|
|
@@ -2837,7 +2835,6 @@ const Qs = nt(({ x: e }) => {
|
|
|
2837
2835
|
"button",
|
|
2838
2836
|
{
|
|
2839
2837
|
className: "gs-menu-btn gs-corner-menu-btn",
|
|
2840
|
-
title: "Menu",
|
|
2841
2838
|
onClick: (C) => C.stopPropagation(),
|
|
2842
2839
|
onMouseDown: (C) => {
|
|
2843
2840
|
C.preventDefault(), C.currentTarget.dataset.pressX = String(C.clientX), C.currentTarget.dataset.pressY = String(C.clientY);
|
|
@@ -2911,7 +2908,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
2911
2908
|
editingAddress: y,
|
|
2912
2909
|
dragging: D
|
|
2913
2910
|
} = n, T = d.current, N = oe(null), Y = a.x === -1 ? "" : Ne(a), E = T == null ? void 0 : T.getCell(a, { resolution: "SYSTEM" }), I = (X = T == null ? void 0 : T.getSystem(a)) == null ? void 0 : X.spilledFrom, $ = I ? wt(I) : void 0, P = $ != null ? Ne($) : void 0;
|
|
2914
|
-
|
|
2911
|
+
Z(() => {
|
|
2915
2912
|
var _;
|
|
2916
2913
|
if (!T)
|
|
2917
2914
|
return;
|
|
@@ -2924,7 +2921,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
2924
2921
|
},
|
|
2925
2922
|
[s]
|
|
2926
2923
|
);
|
|
2927
|
-
|
|
2924
|
+
Z(() => {
|
|
2928
2925
|
const R = new ResizeObserver((_) => {
|
|
2929
2926
|
_.forEach(B);
|
|
2930
2927
|
});
|
|
@@ -3071,7 +3068,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
3071
3068
|
/* @__PURE__ */ c("div", { className: "gs-fx", children: "Fx" }),
|
|
3072
3069
|
/* @__PURE__ */ c("div", { className: "gs-formula-bar-editor-inner", children: /* @__PURE__ */ c("textarea", {}) })
|
|
3073
3070
|
] });
|
|
3074
|
-
const
|
|
3071
|
+
const U = () => {
|
|
3075
3072
|
var ee;
|
|
3076
3073
|
if (!h || typeof document > "u" || b.current !== document.activeElement)
|
|
3077
3074
|
return null;
|
|
@@ -3149,14 +3146,14 @@ const Qs = nt(({ x: e }) => {
|
|
|
3149
3146
|
onKeyUp: B,
|
|
3150
3147
|
onScroll: B,
|
|
3151
3148
|
onMouseEnter: (R) => {
|
|
3152
|
-
t(
|
|
3149
|
+
t(Qe(!0));
|
|
3153
3150
|
},
|
|
3154
3151
|
onMouseLeave: (R) => {
|
|
3155
|
-
t(
|
|
3152
|
+
t(Qe(!1));
|
|
3156
3153
|
}
|
|
3157
3154
|
}
|
|
3158
3155
|
),
|
|
3159
|
-
|
|
3156
|
+
U()
|
|
3160
3157
|
] })
|
|
3161
3158
|
]
|
|
3162
3159
|
}
|
|
@@ -3200,7 +3197,7 @@ const Qs = nt(({ x: e }) => {
|
|
|
3200
3197
|
matchingCells: b,
|
|
3201
3198
|
sheetReactive: d
|
|
3202
3199
|
} = e, m = d.current, y = b[w];
|
|
3203
|
-
|
|
3200
|
+
Z(() => {
|
|
3204
3201
|
if (!y || !m)
|
|
3205
3202
|
return;
|
|
3206
3203
|
const g = wt(y);
|
|
@@ -3335,12 +3332,12 @@ function kr({
|
|
|
3335
3332
|
const { sheetResize: f, showFormulaBar: a = !0, mode: u = "light" } = r, w = oe(null), b = oe(null), d = oe(null), m = oe(null), y = oe(null), D = oe(null), T = oe(null), N = hr(), Y = t ?? N, E = fr(), I = s ?? E, $ = Ss({}), P = h ?? $, { registry: S } = P, [p] = J(() => n ? (S._componentSheetIds.has(n) || S._componentSheetIds.set(n, ++S.sheetHead), S._componentSheetIds.get(n)) : ++S.sheetHead), l = oe(null), [g] = J(() => {
|
|
3336
3333
|
var Q;
|
|
3337
3334
|
n || (n = `Sheet${p}`, console.debug("GridSheet: sheetName is not provided, using default name:", n));
|
|
3338
|
-
const { limits: z, contextMenu: K, rowMenu: G, colMenu: V } = r,
|
|
3335
|
+
const { limits: z, contextMenu: K, rowMenu: G, colMenu: V } = r, U = new ds({
|
|
3339
3336
|
limits: z,
|
|
3340
3337
|
name: n,
|
|
3341
3338
|
registry: S
|
|
3342
3339
|
});
|
|
3343
|
-
return
|
|
3340
|
+
return U.id = p, S.sheetIdsByName[n] = p, U.initialize(e), (Q = S.onInit) == null || Q.call(S, { sheet: U }), U.setTotalSize(), l.current = U, {
|
|
3344
3341
|
sheetId: p,
|
|
3345
3342
|
sheetReactive: l,
|
|
3346
3343
|
rootRef: w,
|
|
@@ -3383,19 +3380,19 @@ function kr({
|
|
|
3383
3380
|
g,
|
|
3384
3381
|
() => g
|
|
3385
3382
|
);
|
|
3386
|
-
|
|
3383
|
+
Z(() => {
|
|
3387
3384
|
gs();
|
|
3388
3385
|
}, []);
|
|
3389
3386
|
const [A, C] = J((r == null ? void 0 : r.sheetHeight) || mr(e)), [L, q] = J((r == null ? void 0 : r.sheetWidth) || pr(e));
|
|
3390
|
-
return
|
|
3387
|
+
return Z(() => {
|
|
3391
3388
|
const z = window.setInterval(() => {
|
|
3392
3389
|
var K, G;
|
|
3393
3390
|
C(((K = d.current) == null ? void 0 : K.clientHeight) || 0), q(((G = d.current) == null ? void 0 : G.clientWidth) || 0);
|
|
3394
3391
|
}, 1e3);
|
|
3395
3392
|
return () => window.clearInterval(z);
|
|
3396
|
-
}, []),
|
|
3393
|
+
}, []), Z(() => {
|
|
3397
3394
|
r.sheetHeight && C(r.sheetHeight);
|
|
3398
|
-
}, [r.sheetHeight]),
|
|
3395
|
+
}, [r.sheetHeight]), Z(() => {
|
|
3399
3396
|
r.sheetWidth && q(r.sheetWidth);
|
|
3400
3397
|
}, [r.sheetWidth]), /* @__PURE__ */ c(le.Provider, { value: { store: v, dispatch: x }, children: /* @__PURE__ */ F(
|
|
3401
3398
|
"div",
|
|
@@ -3493,71 +3490,72 @@ export {
|
|
|
3493
3490
|
kt as MenuDivider,
|
|
3494
3491
|
xt as MenuItem,
|
|
3495
3492
|
Or as Pending,
|
|
3493
|
+
Hr as PercentagePolicyMixin,
|
|
3496
3494
|
Sr as PluginBase,
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3495
|
+
Lr as Policy,
|
|
3496
|
+
Br as RangeEntity,
|
|
3497
|
+
Kr as RefEntity,
|
|
3498
|
+
Zr as Registry,
|
|
3499
|
+
Ur as Sheet,
|
|
3500
|
+
zr as Spilling,
|
|
3501
|
+
Wr as ThousandSeparatorPolicyMixin,
|
|
3502
|
+
_r as Time,
|
|
3503
|
+
jr as ValueEntity,
|
|
3504
|
+
Vr as a2p,
|
|
3505
|
+
qr as aa2oa,
|
|
3506
|
+
Gr as addressesToAreas,
|
|
3507
|
+
Qr as addressesToCols,
|
|
3508
|
+
Jr as addressesToRows,
|
|
3511
3509
|
Nr as applyers,
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3510
|
+
eo as areaToRange,
|
|
3511
|
+
to as areaToZone,
|
|
3512
|
+
no as buildInitialCells,
|
|
3513
|
+
so as buildInitialCellsFromOrigin,
|
|
3514
|
+
ro as c2x,
|
|
3515
|
+
oo as ch,
|
|
3516
|
+
io as check,
|
|
3517
|
+
et as clip,
|
|
3518
|
+
lo as conditionArg,
|
|
3519
|
+
ao as createBook,
|
|
3520
|
+
co as createBooleanMask,
|
|
3521
|
+
uo as createRegistry,
|
|
3524
3522
|
Er as createSheetRef,
|
|
3525
3523
|
xr as createStoreRef,
|
|
3526
3524
|
Ls as defaultColMenuDescriptors,
|
|
3527
3525
|
Os as defaultContextMenuDescriptors,
|
|
3528
3526
|
Hs as defaultRowMenuDescriptors,
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3527
|
+
go as eachMatrix,
|
|
3528
|
+
ho as ensureBoolean,
|
|
3529
|
+
fo as ensureDate,
|
|
3530
|
+
mo as ensureNumber,
|
|
3531
|
+
po as ensureString,
|
|
3534
3532
|
Ar as makeBorder,
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3533
|
+
yo as matrixShape,
|
|
3534
|
+
vo as oa2aa,
|
|
3535
|
+
bo as operations,
|
|
3536
|
+
wo as p2a,
|
|
3537
|
+
Ro as r2y,
|
|
3540
3538
|
Et as registerMenuComponent,
|
|
3541
|
-
|
|
3539
|
+
Co as rh,
|
|
3542
3540
|
Es as sheet2csv,
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3541
|
+
So as stripMatrix,
|
|
3542
|
+
No as toCellCols,
|
|
3543
|
+
Eo as toCellMatrix,
|
|
3544
|
+
xo as toCellObject,
|
|
3545
|
+
ko as toCellRows,
|
|
3546
|
+
To as toValueCols,
|
|
3547
|
+
Ao as toValueMatrix,
|
|
3548
|
+
Mo as toValueObject,
|
|
3549
|
+
Do as toValueRows,
|
|
3552
3550
|
Ue as updateSheet,
|
|
3553
3551
|
Ss as useBook,
|
|
3554
3552
|
Cr as useInitialPluginContext,
|
|
3555
3553
|
xn as usePluginContext,
|
|
3556
3554
|
hr as useSheetRef,
|
|
3557
3555
|
fr as useStoreRef,
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3556
|
+
Po as userActions,
|
|
3557
|
+
Io as x2c,
|
|
3558
|
+
Fo as y2r,
|
|
3559
|
+
Yo as zoneToArea
|
|
3562
3560
|
};
|
|
3563
3561
|
//# sourceMappingURL=index.js.map
|