@sheetxl/react 0.1.98
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/LICENSE.md +11 -0
- package/README.md +6 -0
- package/build/browser/cjs/BbW7R67lKuFENLYE.cjs +16 -0
- package/build/browser/cjs/PgoMlU9LxLwI9gDW.cjs +7 -0
- package/build/browser/cjs/S9Er99xLeF97M2S4.cjs +200 -0
- package/build/browser/cjs/index.cjs +130 -0
- package/build/browser/esm/BBpfL2zIxnH67sEN.mjs +394 -0
- package/build/browser/esm/BXt09x2LnEsVrTbc.mjs +3964 -0
- package/build/browser/esm/DwtYZ8jjcI5bNIGX.mjs +1377 -0
- package/build/browser/esm/index.mjs +5001 -0
- package/build/licenses/dependencies.txt +1163 -0
- package/build/node/assets/style.css +1 -0
- package/build/node/esm/CE0w-7gilZUYdTqb.mjs +11 -0
- package/build/node/esm/index.mjs +3422 -0
- package/build/package.json +60 -0
- package/build/types/index.d.ts +1437 -0
- package/package.json +76 -0
|
@@ -0,0 +1,3422 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - Sheet React - React components needed to build advanced grid and spreadsheet UIs. - v0.0.0
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { FormulaError as e, NumberFormat as t, ICell as o, IBorder as n, ITextFrame as l, GeomUtils as r, ScalarType as i, IFont as a, IRange as s, LicenseManager as d, IColor as c, AutoFill as g, ISheetView as u, Color as h, IFill as m, RangeClipboardItem as p, ExternalRangeClipboardItem as f, TextUtils as w, IAnchored as q, CoordUtils as v, ThemeCollection as y } from "@sheetxl/sdk";
|
|
8
|
+
import { LicenseManager } from "@sheetxl/sdk";
|
|
9
|
+
import { ReactUtils as C, useImperativeElement as b, useCallbackRef as S, KeyCodes as x, SimpleCommand as k, Command as R, KeyModifiers as M, CommandGroup as T, useCopyPaste as A, useEditMode as z, useGlobalClipboard as F, NotificationType as E, useCommands as D, ScrollbarOrientation as I, VirtualScrollbar as V, MouseButtonCodes as N, ToolTipPlacement as L, DefaultNotifier as H, HorizontalAlignment as B, ScrollPane as O, useFullscreenPortal as P, defaultCreateScrollStartButton as $, defaultCreateScrollEndButton as W, defaultCreateScrollEdgeButton as U, ScrollUtils as _ } from "@sheetxl/utils-react";
|
|
10
|
+
export * from "@sheetxl/utils-react";
|
|
11
|
+
import { jsx as G, jsxs as Z, Fragment as j } from "react/jsx-runtime";
|
|
12
|
+
import { CommonUtils as K, AnchorLocation as X, TypesUtils as Y, CoordUtils as Q } from "@sheetxl/utils";
|
|
13
|
+
import J, { memo as ee, useMemo as te, useState as oe, forwardRef as ne, useRef as le, useEffect as re, useLayoutEffect as ie, useCallback as ae, useReducer as se, Suspense as de, createElement as ce, useImperativeHandle as ge, createContext as ue, useContext as he } from "react";
|
|
14
|
+
import { STANDARD_KEY_CHARS as me, useSelection as pe, useHeaderSelection as fe, HeaderRenderer as we, Grid as qe, HeaderDivider as ve, SELECTION_CLIP_INSETS as ye, defaultSelectionRenderer as Ce, useKeyboardEditorOverlay as be, Selection as Se, SVGLine as xe } from "@sheetxl/grid-react";
|
|
15
|
+
import { mergeRefs as ke } from "react-merge-refs";
|
|
16
|
+
import { useMeasure as Re } from "react-use";
|
|
17
|
+
import Me from "clsx";
|
|
18
|
+
import { unstable_batchedUpdates as Te, createPortal as Ae } from "react-dom";
|
|
19
|
+
import { useForkRef as ze } from "rooks";
|
|
20
|
+
import { sortableKeyboardCoordinates as Fe, arrayMove as Ee, rectSortingStrategy as De, SortableContext as Ie, useSortable as Ve, horizontalListSortingStrategy as Ne } from "@dnd-kit/sortable";
|
|
21
|
+
import { restrictToHorizontalAxis as Le } from "@dnd-kit/modifiers";
|
|
22
|
+
import { closestCenter as He, defaultDropAnimation as Be, useSensors as Oe, useSensor as Pe, MouseSensor as $e, TouchSensor as We, KeyboardSensor as Ue, DndContext as _e, DragOverlay as Ge } from "@dnd-kit/core";
|
|
23
|
+
const Ze = (e2 = 6e4) => new Date(Math.floor(Date.now() / e2) * e2), je = Object.freeze(Object.defineProperty({ __proto__: null, nowWithPrecision: Ze }, Symbol.toStringTag, { value: "Module" })), Ke = Object.freeze([8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 36, 48, 72]), Xe = (e2, t2 = true, o2 = Ke) => {
|
|
24
|
+
if (!o2 || 0 === o2.length) return e2;
|
|
25
|
+
if (void 0 === e2) return o2[0];
|
|
26
|
+
if (t2 && e2 >= o2[o2.length - 1]) return e2;
|
|
27
|
+
if (!t2 && e2 <= o2[0]) return e2;
|
|
28
|
+
let n2 = K.findEqualOrGreater(o2, e2);
|
|
29
|
+
return t2 ? (o2[n2] === e2 && (n2 += 1), o2[n2] || (n2 -= 1), o2[n2]) : (n2 -= 1, o2[n2]);
|
|
30
|
+
}, Ye = Object.freeze(Object.defineProperty({ __proto__: null, DefaultFontSizes: Ke, findNextFontSize: Xe }, Symbol.toStringTag, { value: "Module" })), Qe = ee((e2) => {
|
|
31
|
+
const { anchorLocation: t2 = X.TopLeft, cellWidth: o2, cellHeight: n2, size: l2 = 7, inset: r2 = 1, darkMode: i2, fill: a2, pathProps: s2, style: d2, ...c2 } = e2, g2 = l2, u2 = r2;
|
|
32
|
+
let h2 = "red", m2 = [], p2 = [];
|
|
33
|
+
return t2 === X.TopLeft ? (h2 = i2 ? "rgb(255, 198, 246)" : "green", m2.push(u2), p2.push(u2), m2.push(u2 + g2), p2.push(u2), m2.push(u2), p2.push(u2 + g2)) : t2 === X.TopRight ? (h2 = i2 ? "rgb(0, 255, 255)" : "red", m2.push(o2 - u2), p2.push(u2), m2.push(o2 - (u2 + g2)), p2.push(u2), m2.push(o2 - u2), p2.push(u2 + g2)) : t2 === X.BottomRight ? (h2 = i2 ? "rgb(236, 252, 211)" : "purple", m2.push(o2 - u2), p2.push(n2 - u2), m2.push(o2 - (u2 + g2)), p2.push(n2 - u2), m2.push(o2 - u2), p2.push(n2 - (u2 + g2))) : t2 === X.BottomLeft && (h2 = i2 ? "rgb(255, 236, 183)" : "blue", m2.push(u2), p2.push(n2 - u2), m2.push(u2 + g2), p2.push(n2 - u2), m2.push(u2), p2.push(n2 - (u2 + g2))), G("svg", { width: `${o2}`, height: `${n2}`, viewBox: `0 0 ${o2} ${n2}`, style: { position: "absolute", width: `${o2}px`, height: `${n2}px`, pointerEvents: "none", ...d2 }, ...c2, children: G("path", { d: `M ${m2[0]} ${p2[0]} L ${m2[1]} ${p2[1]} L ${m2[2]} ${p2[2]} L ${m2[0]} ${p2[0]} Z`, fill: a2 ?? h2, ...s2 }) });
|
|
34
|
+
}), Je = (e2) => {
|
|
35
|
+
const { renderBounds: t2, darkMode: o2, zoom: n2, disabled: l2, filter: r2, onFilterButtonMouseDown: i2, style: a2, ...s2 } = e2, d2 = te(() => {
|
|
36
|
+
let e3 = null;
|
|
37
|
+
const t3 = r2.getSortField();
|
|
38
|
+
t3 && (e3 = t3.reverse);
|
|
39
|
+
const o3 = r2.getField(), n3 = o3 && o3.criteria && o3.criteria.length > 0;
|
|
40
|
+
return true === e3 ? n3 ? "m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z" : "m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z" : false === e3 ? n3 ? "m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z" : "m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z" : n3 ? "m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z" : "m 3,5.025 4.5,5 4.5,-5 z";
|
|
41
|
+
}, [r2]), [c2, g2] = oe(false);
|
|
42
|
+
const u2 = Math.min(Math.min(18, t2.height - 8), t2.width);
|
|
43
|
+
return G("div", { style: { width: `${u2}px`, height: `${u2}px`, right: "0px", boxShadow: `0px 0px 0px 0.5px var(${c2 && !l2 ? "--sxl-app-color-primary-light, rgba(0,0,0,.55)" : "--sxl-app-color-border-button, grey"})`, backgroundColor: "var(--sxl-app-color-button-fill, white)", backgroundImage: "var(--sxl-app-image-background)", borderRadius: (u2 > 12 ? 1 : 0) + "px", marginRight: "2px", display: "flex", alignItems: "center", justifyContent: "center", cursor: l2 ? void 0 : "pointer", ...a2 }, onMouseEnter: () => g2(true), onMouseLeave: () => g2(false), onMouseDown: (e3) => {
|
|
44
|
+
i2?.(e3, r2);
|
|
45
|
+
}, ...s2, children: G("svg", { width: "" + 15 * n2, height: "" + 15 * n2, viewBox: "0 0 15 15", style: { fill: `var(${c2 && !l2 ? "--sxl-app-color-primary-dark" : "--sxl-app-color-button-text"}, grey)`, opacity: l2 ? 0.6 : 1 }, children: G("path", { d: d2 }) }) });
|
|
46
|
+
}, et = (s2) => {
|
|
47
|
+
const { value: d2, coords: c2, bounds: g2, children: u2, style: h2, range: m2, zoom: p2 = 1, view: f2, bodyStyle: w2, normalStyle: q2, showFormulas: v2, showZeros: y2, docTheme: b2, onLinkMouseDown: S2, onFilterButtonMouseDown: x2, filterButtonProps: k2, createFilterButton: R2 = Je, ...M2 } = s2, T2 = g2.height / p2, A2 = g2.width / p2, z2 = d2, F2 = z2.getValue(), E2 = d2.getStyle(), D2 = w2?.darkMode ?? false;
|
|
48
|
+
let I2, V2;
|
|
49
|
+
const N2 = F2 && F2.isFormulaError, L2 = N2 && F2 instanceof e.Parse;
|
|
50
|
+
let H2, B2 = v2 || L2;
|
|
51
|
+
if (B2) if (z2.isSpillOverflow()) V2 = "";
|
|
52
|
+
else {
|
|
53
|
+
const e2 = z2.getFormulaText();
|
|
54
|
+
e2 ? V2 = e2 : I2 = z2.getNumberFormat(t.Type.General);
|
|
55
|
+
}
|
|
56
|
+
else I2 = z2.getNumberFormat();
|
|
57
|
+
B2 || (H2 = z2.getTextOverflow());
|
|
58
|
+
const O2 = H2 ? H2.colBounds.width + H2.leftOffset + H2.rightOffset : A2, P2 = H2 ? H2.anchorBounds.x - H2.leftOffset : 0, $2 = H2 ? H2.anchorBounds.width : A2, W2 = H2 ? H2.anchorBounds.x : 0;
|
|
59
|
+
let U2, _2 = z2.getRenderHorizontalAlignment();
|
|
60
|
+
I2 && (U2 = I2?.formattedRuns, V2 = U2?.runs[0]?.text ?? I2.displayText);
|
|
61
|
+
const j2 = z2.getCalcStatus() === o.CalcStatus.Pending;
|
|
62
|
+
let Y2 = null, Q2 = E2.getFill().toCSS(D2, g2), J2 = 0, ee2 = 0;
|
|
63
|
+
if (!E2.getBorder().isEmpty()) {
|
|
64
|
+
const e2 = E2.getBorder().getRight();
|
|
65
|
+
!e2.isNone() && n.BuiltInDefinitions.get(e2.getStyle()).width > 1 && (J2 = 1);
|
|
66
|
+
const t2 = E2.getBorder().getBottom();
|
|
67
|
+
!t2.isNone() && n.BuiltInDefinitions.get(t2.getStyle()).width > 1 && (ee2 = 1);
|
|
68
|
+
}
|
|
69
|
+
let te2 = null;
|
|
70
|
+
if (A2 !== $2 || J2 || ee2 || "number" == typeof Q2?.backgroundPosition) {
|
|
71
|
+
const { backgroundPosition: e2, ...t2 } = Q2, o2 = e2 ?? 0, n2 = f2?.getScrollTopLeft(), l2 = o2 ? -(g2.x + (n2.left ?? 0)) % o2 : 0, r2 = o2 ? -(g2.y + (n2.top ?? 0)) % o2 : 0;
|
|
72
|
+
(void 0 !== e2 || J2 || ee2 || A2 !== $2) && (1 === Object.keys(t2).length && "none" === t2.background || (Q2 = null, te2 = G("div", { className: "fill", style: { marginLeft: `${l2}px`, marginTop: `${r2}px`, left: W2 * p2, width: C.boundPixel($2 * p2 - l2 + 1 + J2), height: C.boundPixel(g2.height - r2 + 1 + ee2), ...t2 } }, "background")));
|
|
73
|
+
}
|
|
74
|
+
let oe2 = null;
|
|
75
|
+
const ne2 = z2.getComments(), le2 = z2.getWarnings(), re2 = z2.getErrors();
|
|
76
|
+
if (ne2 || N2 || re2.length > 0 || le2.length > 0) {
|
|
77
|
+
const e2 = { size: 7 * p2, darkMode: D2, cellWidth: $2 * p2 + 2, cellHeight: T2 * p2 + 2, style: { top: -1, left: W2 * p2 - 1 } };
|
|
78
|
+
oe2 = oe2 ?? [], (le2.length > 0 || re2.length > 0 || N2) && oe2.push(G(Qe, { anchorLocation: X.TopLeft, ...e2 }, `indicator-${oe2.length}`)), ne2 && oe2.push(G(Qe, { anchorLocation: X.TopRight, ...e2 }, `indicator-${oe2.length}`));
|
|
79
|
+
}
|
|
80
|
+
const ie2 = E2.getFont();
|
|
81
|
+
let ae2 = I2?.conditionalColor;
|
|
82
|
+
const se2 = E2.getAlignment(), de2 = se2.getHorizontal() === l.HorizontalAlignment.Fill, ce2 = se2.getHorizontal() === l.HorizontalAlignment.CenterContinuous || de2, ge2 = ce2 || B2 ? 0 : se2.getRotation(), ue2 = z2.getInsets(), he2 = ue2.top + ue2.bottom;
|
|
83
|
+
let me2 = ue2.left, pe2 = ue2.right;
|
|
84
|
+
const fe2 = { ...h2, left: h2.left - 1, top: h2.top - 1, width: h2.width + 1 + J2, height: h2.height + 1 + ee2 }, we2 = z2.getColumnFilter(), qe2 = we2 && !we2?.hasHiddenButton();
|
|
85
|
+
let ve2 = null;
|
|
86
|
+
j2 && (ve2 = Z("div", { className: "slider", children: [G("div", { className: "line" }), G("div", { className: "subline inc" })] }, "pending"));
|
|
87
|
+
const ye2 = !(j2 || qe2 || te2 || u2 || oe2 || U2?.runs.length > 1 || H2 || ge2 % 360 != 0);
|
|
88
|
+
"none" === Q2?.background && (Q2 = null);
|
|
89
|
+
let Ce2 = ce2 || !(!H2 || !(H2.rightIndex > 0 || H2.leftIndex > 0 || H2.colSpan > 1));
|
|
90
|
+
if (!Ce2) {
|
|
91
|
+
const e2 = z2.getSpans();
|
|
92
|
+
(e2.width > 1 || e2.height > 1) && (Ce2 = true);
|
|
93
|
+
}
|
|
94
|
+
const be2 = { ...Q2, ...fe2, pointerEvents: S2 ? "auto" : void 0 };
|
|
95
|
+
if (!K.isEmpty(V2) || !K.isEmpty(I2?.repeatPlaceholder)) {
|
|
96
|
+
const e2 = I2?.canWrap ?? false;
|
|
97
|
+
let o2 = null, n2 = null, s3 = null, d3 = [], c3 = true;
|
|
98
|
+
y2 || B2 || 0 !== F2 || (c3 = false);
|
|
99
|
+
const g3 = z2.getTextFrame(B2);
|
|
100
|
+
if (c3 && g3) {
|
|
101
|
+
let c4 = O2 - 1 - (me2 + pe2);
|
|
102
|
+
if (ge2) {
|
|
103
|
+
const e3 = g3.layout();
|
|
104
|
+
o2 = e3.bounds;
|
|
105
|
+
const t2 = { x: 0, y: 0, width: O2 - 1, height: T2 };
|
|
106
|
+
if (U2) {
|
|
107
|
+
let e4 = U2.width;
|
|
108
|
+
if (I2.repeatPlaceholder || I2.repeatChars.length > 0) {
|
|
109
|
+
const o3 = r.boundsToPoints(t2), n3 = r.rotatePoints(o3, -ge2);
|
|
110
|
+
e4 = r.minBoundingRect(n3).width;
|
|
111
|
+
}
|
|
112
|
+
o2 = { ...o2, width: e4 };
|
|
113
|
+
}
|
|
114
|
+
s3 = r.clipToOuterRect({ ...o2, width: o2.width + 1 + me2 + pe2 }, t2, ge2), c4 = s3.width - 1 - (me2 + pe2) + 0.01;
|
|
115
|
+
}
|
|
116
|
+
let u3 = null;
|
|
117
|
+
e2 && (u3 = { width: c4 });
|
|
118
|
+
let m3 = null, f3 = I2?.repeatPlaceholder;
|
|
119
|
+
const w3 = g3.layout(u3);
|
|
120
|
+
if (o2 = w3.bounds, B2 ? o2 = { ...o2, width: 0 } : U2 && (o2 = { ...o2, width: I2.repeatPlaceholder || I2.repeatChars.length > 0 ? c4 : U2.width }), ge2 && e2) {
|
|
121
|
+
let e3 = null;
|
|
122
|
+
w3.visitLines({ visitTextLine: (t2, o3) => {
|
|
123
|
+
let n3 = t2.bounds;
|
|
124
|
+
const l2 = r.boundsToPoints(n3), i2 = r.rotatePoints(l2, ge2), a2 = r.minBoundingRect(i2);
|
|
125
|
+
n3 = { ...n3, x: (a2.width - n3.width) / 2, y: (a2.height - n3.height) / 2 }, e3 = e3 ? r.unionBounds(e3, n3) : n3;
|
|
126
|
+
} }), o2 = { ...e3, width: e3.width + me2 + pe2 };
|
|
127
|
+
}
|
|
128
|
+
if (!f3 && z2.getType() !== i.String && Math.floor(o2.width) > c4) {
|
|
129
|
+
if ("General" === E2.getNumberFormat() && z2.getType() === i.Number) {
|
|
130
|
+
const e3 = E2.measureText("0"), t2 = Math.floor(c4 / e3.width), o3 = F2, n3 = K.splitNumber(o3), l2 = Math.min(10, t2 - (Math.max(1, n3.ipLength) + 1) - (o3 < 0 ? 1 : 0));
|
|
131
|
+
if (l2 >= -1) {
|
|
132
|
+
const e4 = `0${l2 > 0 ? "." : ""}${"#".repeat(Math.max(0, l2))}`;
|
|
133
|
+
m3 = z2.getNumberFormat(e4).displayText, "0" === m3 && o3 < 0 && (m3 = "-0");
|
|
134
|
+
} else if (Math.abs(o3) >= Math.pow(10, 5) || Math.abs(o3) <= Math.pow(10, -5)) {
|
|
135
|
+
const e4 = t2 - 5 - (o3 < 0 ? 1 : 0);
|
|
136
|
+
if (e4 >= 0) {
|
|
137
|
+
const t3 = `0.${"0".repeat(Math.max(0, e4 - 1))}E+00`;
|
|
138
|
+
m3 = z2.getNumberFormat(t3).displayText;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
m3 || (f3 = "#");
|
|
143
|
+
}
|
|
144
|
+
if (!f3 && U2?.lastRepeatIndex >= 0 && U2?.width > c4 && (f3 = "#"), f3 && c4 > 0) {
|
|
145
|
+
const e3 = E2.measureText(f3), t2 = Math.floor((c4 || 1) / (e3?.width || 1));
|
|
146
|
+
m3 = t2 > 0 ? f3.repeat(t2) : "";
|
|
147
|
+
}
|
|
148
|
+
if (B2 && (_2 = l.HorizontalAlignment.Left), m3) {
|
|
149
|
+
const e3 = E2.measureText(m3).width;
|
|
150
|
+
e3 && (o2 = { ...o2, width: e3 });
|
|
151
|
+
}
|
|
152
|
+
if (n2 = { ...o2, width: o2.width + me2 + pe2, height: o2.height }, ge2 && !e2) {
|
|
153
|
+
const e3 = r.boundsToPoints(n2), t2 = r.rotatePoints(e3, ge2), o3 = r.minBoundingRect(t2);
|
|
154
|
+
n2.width = o3.width, n2.height = o3.height;
|
|
155
|
+
}
|
|
156
|
+
_2 === l.HorizontalAlignment.Center || _2 === l.HorizontalAlignment.CenterContinuous ? n2.x = (O2 - n2.width) / 2 : _2 === l.HorizontalAlignment.Right ? n2.x = O2 - n2.width - 0.5 : n2.x = 0.5, se2.getVertical() === l.VerticalAlignment.Center ? n2.y = (T2 - n2.height) / 2 : se2.getVertical() === l.VerticalAlignment.Bottom ? n2.y = T2 - n2.height - he2 : n2.y = he2;
|
|
157
|
+
const q3 = ye2 ? { ...M2 } : void 0, v3 = { style: { left: h2.left - 1, top: h2.top - 1, width: h2.width + 1, height: h2.height + 1, transform: ge2 ? `rotate(${ge2}deg)` : void 0, cursor: S2 ? "pointer" : void 0, pointerEvents: S2 ? "auto" : void 0, zIndex: Ce2 ? 1 : void 0, ...Q2 }, onMouseDown: S2, onDoubleClick: S2 ? (e3) => {
|
|
158
|
+
e3.stopPropagation(), e3.preventDefault();
|
|
159
|
+
} : null, ...q3 };
|
|
160
|
+
L2 && (v3.style.textDecorationStyle = "wavy", v3.style.textDecorationColor = D2 ? "rgb(0, 255, 255)" : "red", v3.style.textDecorationLine = "underline");
|
|
161
|
+
const y3 = ie2.getSize(), C2 = (i2, s4, g4, u4, h3, m4, f4, w4 = null) => {
|
|
162
|
+
let q4 = y3 * p2, v4 = g4, C3 = f4?.runs ? f4.runs : [{ type: t.ParseRunType.Text, text: i2, width: E2.measureText(i2, q4).width }];
|
|
163
|
+
f4 && f4?.width !== o2.width && (o2 = { ...o2, width: f4?.width });
|
|
164
|
+
let b3 = me2;
|
|
165
|
+
if (f4?.lastRepeatIndex >= 0 && c4 > f4?.width) {
|
|
166
|
+
const e3 = f4.runs[f4.lastRepeatIndex];
|
|
167
|
+
if (e3) {
|
|
168
|
+
const n3 = [...C3], l2 = Math.max(0, c4 - 1 - f4.width);
|
|
169
|
+
let r2 = 0, i3 = "";
|
|
170
|
+
if (l2 > 0) {
|
|
171
|
+
const t2 = Math.floor(l2 / e3.width);
|
|
172
|
+
i3 = t2 > 0 ? e3.text.repeat(t2) : "", r2 = l2;
|
|
173
|
+
}
|
|
174
|
+
n3[f4.lastRepeatIndex] = { type: t.ParseRunType.Repeat, text: i3, width: r2 }, C3 = n3, o2 = { ...o2, width: f4.width + r2 };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const S3 = (t2, o3, n3, i3, s5, c5, g5, u5, f5, w5 = null) => {
|
|
178
|
+
let y4, C4 = v4.width;
|
|
179
|
+
h3 === l.HorizontalAlignment.Justify ? (C4 = s5, m4 || (y4 = "justify")) : h3 === l.HorizontalAlignment.Distributed && (C4 = s5, y4 = m4 || t2.text.split(" ").length - 1 == 0 ? "center" : "justify");
|
|
180
|
+
const { style: S4, className: x4, ...k4 } = w5;
|
|
181
|
+
let R3 = t2.text;
|
|
182
|
+
if (h3 === l.HorizontalAlignment.Fill && 0 === I2?.repeatChars.length) {
|
|
183
|
+
const e3 = Math.max(1, Math.floor((v4?.width ?? 0) / (g5?.width ?? 1)));
|
|
184
|
+
R3 = R3.repeat(e3);
|
|
185
|
+
}
|
|
186
|
+
let M3 = v4.height;
|
|
187
|
+
const T3 = ie2.getVerticalAlignment(), A3 = T3 === a.VerticalAlignment.Sub, z3 = T3 === a.VerticalAlignment.Super;
|
|
188
|
+
if (A3 || z3) {
|
|
189
|
+
const e3 = ie2.getSuperSubScale();
|
|
190
|
+
q4 *= e3, M3 *= e3;
|
|
191
|
+
}
|
|
192
|
+
const F3 = { textAlign: y4, textAlignLast: y4, background: void 0, ...S4, ...ie2.toCSS(D2, p2, true), fontSize: q4 * a.getDeviceScale() };
|
|
193
|
+
ae2 && (F3.color = ae2.toCSS(D2));
|
|
194
|
+
const E3 = b3 + o3;
|
|
195
|
+
let V3 = ue2.top + v4.y + 0;
|
|
196
|
+
if (A3 && (V3 += f5 - q4), c5) {
|
|
197
|
+
const e3 = (g5.x + E3) * p2 + 1, t3 = (g5.y + V3) * p2 + 1;
|
|
198
|
+
t3 < 0 ? F3.marginTop = t3 : F3.paddingTop = t3, e3 < 0 ? (F3.width = (S4?.width ?? 0) - e3, F3.left = (S4?.left ?? 0) + e3) : F3.paddingLeft = e3, F3.paddingRight = Math.max(0, (S4?.width ?? 0) - C4 * p2 - e3), F3.paddingBottom = Math.max(0, (S4?.height ?? 0) - v4.height * p2 - t3), F3.height = (S4?.height ?? 0) + (t3 < 0 ? -t3 : 0), (t3 < 0 || e3 < 0) && (F3.clipPath = `inset(${t3 < 0 ? -t3 : 0}px 0px 0px ${e3 < 0 ? 1 - e3 : 0}px)`);
|
|
199
|
+
} else if (F3.left = (g5.x + E3) * p2 + 1, F3.top = (g5.y + V3) * p2 + 1, F3.width = g5.width * p2, F3.height = g5.height * p2, ge2 && !e2) {
|
|
200
|
+
F3.left = (g5.x + o3) * p2 + 1, F3.top = (g5.y + (v4.y + 0)) * p2 + 1;
|
|
201
|
+
const e3 = r.centerPoint({ x: b3 + o3, y: 0, width: t2.width, height: v4.height }), n4 = r.centerPoint({ x: b3, y: 0, width: s5, height: v4.height }), l2 = r.rotatePoints([e3], ge2, n4), i4 = { x: l2[0].x - e3.x, y: l2[0].y - e3.y };
|
|
202
|
+
F3.left = F3.left + i4.x * p2, F3.top = F3.top + i4.y * p2;
|
|
203
|
+
const a2 = { ...v4, x: b3, y: ue2.top, width: v4.width + (me2 + pe2) }, d4 = r.boundsToPoints(a2), c6 = r.rotatePoints(d4, ge2), u6 = r.minBoundingRect(c6);
|
|
204
|
+
a2.width = u6.width, a2.height = u6.height;
|
|
205
|
+
const h4 = r.centerPoint(a2), m5 = { x: h4.x - n4.x, y: h4.y - n4.y };
|
|
206
|
+
F3.left = F3.left + m5.x * p2, F3.top = F3.top + m5.y * p2;
|
|
207
|
+
}
|
|
208
|
+
F3.lineHeight = M3 * p2 + "px";
|
|
209
|
+
const N3 = ye2 ? void 0 : "text-line";
|
|
210
|
+
d3.push(G("div", { className: x4 ? `${x4} ${N3}` : N3, style: F3, ...k4, children: R3 }, `text-${v4.y}-${i3}-${n3}`));
|
|
211
|
+
};
|
|
212
|
+
if (se2.getOverflow() === l.Overflow.Shrink && c4 > 0) {
|
|
213
|
+
let e3 = o2?.width ?? 0, t2 = 0;
|
|
214
|
+
for (; e3 > 1 && e3 > c4 && q4 > 2 && t2 < 100; ) {
|
|
215
|
+
q4 *= c4 / e3;
|
|
216
|
+
e3 = E2.measureText(i2, q4).width, t2++;
|
|
217
|
+
}
|
|
218
|
+
o2 = { ...o2, width: e3 };
|
|
219
|
+
}
|
|
220
|
+
let x3 = v4.x;
|
|
221
|
+
h3 === l.HorizontalAlignment.Right ? x3 += o2.width - v4.width : h3 !== l.HorizontalAlignment.Center && h3 !== l.HorizontalAlignment.CenterContinuous || (x3 += (o2.width - v4.width) / 2), f4?.lastRepeatIndex >= 0 && (x3 = v4.x);
|
|
222
|
+
const k3 = C3.length;
|
|
223
|
+
for (let e3 = 0; e3 < k3; e3++) {
|
|
224
|
+
const r2 = C3[e3];
|
|
225
|
+
if (r2.type === t.ParseRunType.Text || r2.type === t.ParseRunType.Repeat) {
|
|
226
|
+
r2.type, t.ParseRunType.Repeat;
|
|
227
|
+
S3(r2, x3, e3, s4, h3 === l.HorizontalAlignment.Justify || h3 === l.HorizontalAlignment.Distributed || f4?.lastRepeatIndex >= 0 ? c4 : v4.width, ye2, { x: n2.x + P2, y: n2.y, width: r2.width, height: o2.height }, 0, u4, w4);
|
|
228
|
+
}
|
|
229
|
+
x3 += r2.width;
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
m3 ? C2(m3, 0, { x: 0, y: 0, ...o2 }, w3.lines[0].baseline, _2, true, null, v3) : w3.visitLines({ visitTextLine: (e3, t2, n3) => {
|
|
233
|
+
const r2 = e3.runs[0].text.replace(/\s+$/, ""), i2 = t2 === n3 - 1;
|
|
234
|
+
let a2 = _2 === l.HorizontalAlignment.Justify && (i2 || e3.runs[0].text.endsWith("\n")) ? l.HorizontalAlignment.Left : _2, s4 = 0;
|
|
235
|
+
t2 > 0 && (se2.getVertical() === l.VerticalAlignment.Distributed || se2.getVertical() === l.VerticalAlignment.Justify) && (s4 = Math.max(0, (T2 - (he2 + 3) - e3.bounds.height * n3) / (n3 - 1) * t2)), se2.getVertical() === l.VerticalAlignment.Distributed && ge2 && ge2 % 90 == 0 && ge2 % 180 != 0 && (a2 = l.HorizontalAlignment.Distributed), a2 !== l.HorizontalAlignment.Justify && a2 !== l.HorizontalAlignment.Distributed && a2 !== l.HorizontalAlignment.Fill || (o2 = { ...o2, width: c4 });
|
|
236
|
+
const d4 = { ...e3.bounds, y: e3.bounds.y + s4 + 0, width: de2 || I2 && (I2.repeatChars.length > 0 || I2.spacingChars.length > 0) ? o2.width : e3.bounds.width };
|
|
237
|
+
C2(r2, t2, d4, g3.lines[0].baseline, a2, i2, 1 === n3 ? U2 : null, ye2 && t2 > 0 ? { ...v3, style: { ...v3.style, background: void 0 } } : v3);
|
|
238
|
+
} });
|
|
239
|
+
}
|
|
240
|
+
d3.length > 0 && (Y2 = d3);
|
|
241
|
+
}
|
|
242
|
+
if (ye2) return Y2 && Y2.length > 0 ? Y2 : G("div", { style: be2, ...M2 });
|
|
243
|
+
let Se2 = S2 ? "auto" : fe2.pointerEvents, xe2 = null;
|
|
244
|
+
if (qe2) {
|
|
245
|
+
const e2 = { x: W2 * p2 - 1, y: -1, width: $2 * p2 + 1, height: T2 * p2 + 1 };
|
|
246
|
+
Se2 = "auto", xe2 = R2({ renderBounds: e2, darkMode: D2, className: "filter-button", disabled: !z2.isEditAllowed(), zoom: p2, filter: z2.getColumnFilter(), onFilterButtonMouseDown: x2, ...k2 }), xe2 && (xe2 = G("div", { style: { ...e2, position: "absolute", zIndex: 2, display: "flex", alignItems: "end" }, onDoubleClick: (e3) => {
|
|
247
|
+
e3.stopPropagation(), e3.preventDefault();
|
|
248
|
+
}, children: xe2 }, "filterButton"));
|
|
249
|
+
}
|
|
250
|
+
j2 && !Y2 && (Y2 = G("div", { style: { position: "absolute", left: 0, right: 0, top: 0, bottom: 0, display: "flex", alignItems: "center", justifyContent: "center", pointerEvents: "none" }, children: "..." }, "pending-ellipsis"));
|
|
251
|
+
const ke2 = [te2, Y2, u2, oe2, ve2, xe2];
|
|
252
|
+
return G("div", { style: { ...Q2, ...fe2, pointerEvents: Se2 }, ...M2, children: ke2 });
|
|
253
|
+
}, tt = { text: "", placeholder: "" }, ot = (e2, t2) => {
|
|
254
|
+
if (!e2.clean().getStyle().getNumberFormat().endsWith("%")) return false;
|
|
255
|
+
const o2 = t2 ?? e2.dirty ?? "";
|
|
256
|
+
return 0 === o2.length || o2.endsWith("%") && !isNaN(parseFloat(o2.substring(0, o2.length - 1)));
|
|
257
|
+
}, nt = Object.freeze([x.Delete, x.Home, x.End]), lt = ee(ne((e2, t2) => {
|
|
258
|
+
const { editState: o2, onStartEdit: n2, onChangeEdit: r2, onSubmitEdit: d2, onCancelEdit: c2, onDoneEdit: g2, defaultTextStyle: u2, useRichStyling: h2 = true, bodyStyle: m2, activeCoords: p2, sheet: f2, commands: w2, containerBounds: q2, setNaturalDimensions: v2, onFocus: y2, disabled: C2, style: z2, zoom: F2 = 1, linesVisible: E2, autoFocus: D2 = false, ...I2 } = e2, { height: V2 = 0, width: N2 = 0 } = q2 ?? {}, L2 = m2?.darkMode ?? false, H2 = le(null), [B2, O2] = oe(false), [P2, $2] = oe(null), [W2, U2] = oe(() => o2);
|
|
259
|
+
re(() => {
|
|
260
|
+
ne2.current = false, U2(o2);
|
|
261
|
+
}, [o2]);
|
|
262
|
+
const _2 = te(() => {
|
|
263
|
+
const e3 = W2.clean();
|
|
264
|
+
let t3 = e3.getStyle();
|
|
265
|
+
h2 || (t3 = t3.createTemporaryStyle({ font: { size: u2?.fontSize } }));
|
|
266
|
+
const o3 = e3.getFormula(), n3 = t3.getAlignment(), r3 = o3 ? l.HorizontalAlignment.Left : n3.getHorizontal(), a2 = n3.getVertical(), s2 = n3.getOverflow() === l.Overflow.Wrap || e3.getType() === i.String && (r3 === l.HorizontalAlignment.Justify || r3 === l.HorizontalAlignment.Distributed || a2 === l.VerticalAlignment.Justify || a2 === l.VerticalAlignment.Distributed), d3 = ((e4) => {
|
|
267
|
+
if (!e4) return tt;
|
|
268
|
+
const t4 = e4.clean();
|
|
269
|
+
if (!t4) return tt;
|
|
270
|
+
let o4 = t4.getStyle()?.getQuotePrefix();
|
|
271
|
+
if (void 0 === e4.dirty || null === e4.dirty) {
|
|
272
|
+
let n4 = "", l2 = t4.getFormulaText();
|
|
273
|
+
l2 && (n4 = l2, o4 = false), n4 || (n4 = t4.toTextUnformatted(true) ?? "");
|
|
274
|
+
let r4 = "";
|
|
275
|
+
if (!e4.editMode && t4.isSpillOverflow()) {
|
|
276
|
+
const e5 = t4.getSpill();
|
|
277
|
+
if (e5) {
|
|
278
|
+
const o5 = e5.getCell(), n5 = o5.getFormulaText();
|
|
279
|
+
o5.isEqual(t4) || (r4 = n5);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return o4 && (n4 = "'" + n4), { text: n4, placeholder: r4 };
|
|
283
|
+
}
|
|
284
|
+
return { text: e4.dirty ?? "", placeholder: "" };
|
|
285
|
+
})(W2), c3 = d3.text, g3 = l.toCSSHorizontalTextAlign(h2 && !o3 ? W2.clean()?.getRenderHorizontalAlignment() : l.HorizontalAlignment.Left);
|
|
286
|
+
return { style: t3, isWrapped: s2, textValue: c3, formula: o3, frameVertAlign: a2, placeholder: d3.placeholder, insets: h2 ? e3.getInsets() : Y.EmptyRect, textAlign: g3 };
|
|
287
|
+
}, [W2, u2, L2, F2, h2]), Z2 = le(null), j2 = b(t2, () => ({ startEdit: (e3) => {
|
|
288
|
+
H2.current = e3?.initialSelection;
|
|
289
|
+
const t3 = { ...o2, editMode: e3?.editMode ?? false };
|
|
290
|
+
void 0 !== e3?.text && (t3.dirty = e3.text), t3.editMode === o2.editMode && t3.dirty === o2.dirty || (U2(t3), Q2?.(t3));
|
|
291
|
+
}, submitEdit: () => se2(), cancelEdit() {
|
|
292
|
+
de2();
|
|
293
|
+
}, autoFocus() {
|
|
294
|
+
Z2.current.focus();
|
|
295
|
+
}, dispatchEvent: (e3) => Z2.current.dispatchEvent(e3), focus() {
|
|
296
|
+
Z2.current.focus();
|
|
297
|
+
}, getLineHeight: X2 }), [n2, o2]);
|
|
298
|
+
ie(() => {
|
|
299
|
+
if (!P2 || !B2) return;
|
|
300
|
+
const e3 = Z2.current;
|
|
301
|
+
_2.textValue, e3 && e3.setSelectionRange(P2.start, P2.end, P2.direction);
|
|
302
|
+
}, [Z2.current, P2, _2.textValue]);
|
|
303
|
+
const K2 = te(() => {
|
|
304
|
+
const e3 = W2?.clean(), t3 = _2.style.createTemporaryTextFrame(_2.textValue, e3?.getType() === i.String), o3 = h2 ? e3.getInsets().right + e3.getInsets().left : 0;
|
|
305
|
+
let n3 = null;
|
|
306
|
+
_2.isWrapped && (n3 = { width: N2 - o3 });
|
|
307
|
+
return t3.layout(n3);
|
|
308
|
+
}, [_2, N2, W2, h2]), X2 = S(() => Math.ceil(K2?.lines[0]?.bounds.height), [K2]);
|
|
309
|
+
ie(() => {
|
|
310
|
+
if (!K2) return;
|
|
311
|
+
const e3 = _2.style, t3 = e3.getInsets() ?? Y.EmptyRect, o3 = h2 ? t3.left + t3.right : 0, n3 = h2 ? 0.04 * e3.getFont().getSize() : 1, l2 = Math.round(_2.isWrapped ? void 0 : K2.bounds.width + o3 + n3), r3 = Math.round(K2.bounds.height);
|
|
312
|
+
v2?.({ width: l2, height: r3 });
|
|
313
|
+
}, [K2, v2, _2, h2, W2]);
|
|
314
|
+
const Q2 = S(r2, [r2]), J2 = S((e3) => {
|
|
315
|
+
if (W2.dirty === e3) return;
|
|
316
|
+
const t3 = { ...W2 };
|
|
317
|
+
t3.dirty = e3, Z2.current, U2(t3), Q2?.(t3);
|
|
318
|
+
}, [W2]), ee2 = S((e3) => {
|
|
319
|
+
if (W2.editMode === e3) return;
|
|
320
|
+
const t3 = { ...W2 };
|
|
321
|
+
t3.editMode = e3, U2(t3), Q2?.(t3);
|
|
322
|
+
}, [W2]), ne2 = le(false), se2 = S(() => {
|
|
323
|
+
if (ne2.current) return false;
|
|
324
|
+
try {
|
|
325
|
+
d2?.(W2), g2?.(), ne2.current = true;
|
|
326
|
+
} catch (e3) {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
return true;
|
|
330
|
+
}, [d2, W2]), de2 = S(() => {
|
|
331
|
+
ne2.current = true, U2(o2), c2?.(), g2?.();
|
|
332
|
+
}, [c2, o2]), ce2 = S((e3) => {
|
|
333
|
+
if (!Z2.current) return;
|
|
334
|
+
if (e3.key, e3.isDefaultPrevented(), !(e3.isTrusted || e3.nativeEvent.ctrlKey || e3.nativeEvent.metaKey || e3.nativeEvent.altKey || e3.nativeEvent.isComposing || -1 === me.indexOf(e3.nativeEvent.key) && "Backspace" !== e3.nativeEvent.key)) {
|
|
335
|
+
const t4 = { ...W2 };
|
|
336
|
+
let o4 = 0;
|
|
337
|
+
return ot(t4, t4.dirty) && !isNaN(parseFloat(e3.key)) ? (t4.dirty?.endsWith("%") ? t4.dirty = (t4.dirty.substring(0, t4.dirty.length - 1) ?? "") + e3.key + "%" : t4.dirty = (t4.dirty ?? "") + e3.key + "%", o4 = t4.dirty.length - 1) : "Backspace" === e3.nativeEvent.key ? (t4.dirty = "", o4 = t4.dirty.length) : (t4.dirty = (t4.dirty ?? "") + e3.key, o4 = t4.dirty.length), Z2.current.value = t4?.dirty, H2.current = { start: o4, end: o4, direction: "forward" }, Z2.current?.setSelectionRange(o4, o4, "forward"), U2(t4), Q2?.(t4), void e3.preventDefault();
|
|
338
|
+
}
|
|
339
|
+
const t3 = e3.nativeEvent.ctrlKey, o3 = e3.nativeEvent.shiftKey, n3 = e3.nativeEvent.altKey, l2 = e3.nativeEvent.metaKey;
|
|
340
|
+
if (t3 && "z" === e3.key && e3.stopPropagation(), e3.which === x.Escape) return e3.preventDefault(), void de2();
|
|
341
|
+
if (e3.which === x.F2) return ee2(true), void e3.preventDefault();
|
|
342
|
+
const r3 = e3.target;
|
|
343
|
+
if ("%" === e3.key && r3.selectionStart === r3.selectionEnd && "%" === r3.value[r3.selectionStart] && W2?.clean().getStyle().numberFormat.includes("%")) return $2({ start: r3.selectionStart + 1, end: r3.selectionEnd + 1, direction: r3.selectionDirection }), void e3.preventDefault();
|
|
344
|
+
if (e3.which === x.Enter) {
|
|
345
|
+
if (e3.preventDefault(), l2 || n3) {
|
|
346
|
+
const e4 = _2.textValue.substring(0, r3.selectionStart) + "\n" + _2.textValue.substring(r3.selectionEnd);
|
|
347
|
+
return J2(e4), void $2({ start: r3.selectionStart + 1, end: r3.selectionStart + 1, direction: r3.selectionDirection });
|
|
348
|
+
}
|
|
349
|
+
return void (se2() && f2.getSelection().traverse(s.Orientation.Column, o3));
|
|
350
|
+
}
|
|
351
|
+
if (e3.which === x.Tab) return e3.preventDefault(), void (se2() && f2.getSelection().traverse(s.Orientation.Row, o3));
|
|
352
|
+
let i2 = null;
|
|
353
|
+
switch (e3.which) {
|
|
354
|
+
case x.Left:
|
|
355
|
+
i2 = s.Direction.Left;
|
|
356
|
+
break;
|
|
357
|
+
case x.Right:
|
|
358
|
+
i2 = s.Direction.Right;
|
|
359
|
+
break;
|
|
360
|
+
case x.Up:
|
|
361
|
+
i2 = s.Direction.Up;
|
|
362
|
+
break;
|
|
363
|
+
case x.Down:
|
|
364
|
+
i2 = s.Direction.Down;
|
|
365
|
+
}
|
|
366
|
+
if (i2) {
|
|
367
|
+
if (!(t3 || o3 || n3 || l2) && !W2.editMode) return void se2();
|
|
368
|
+
}
|
|
369
|
+
W2.editMode && (i2 || nt.includes(e3.which)) && e3.stopPropagation();
|
|
370
|
+
}, [W2, f2, _2]), ge2 = ae(() => {
|
|
371
|
+
Z2.current?.focus(), setTimeout(() => {
|
|
372
|
+
Z2.current?.select();
|
|
373
|
+
}, 0);
|
|
374
|
+
}, []), ue2 = ae(() => {
|
|
375
|
+
Z2.current?.focus(), console.log("implement toggleRelativeReferences");
|
|
376
|
+
}, []), he2 = S(() => {
|
|
377
|
+
const e3 = Z2.current?.value;
|
|
378
|
+
let t3 = "";
|
|
379
|
+
if (p2.rowIndex > 0) {
|
|
380
|
+
const e4 = f2.getRange({ rowIndex: p2.rowIndex - 1, colIndex: p2.colIndex }).getCell();
|
|
381
|
+
e4 && (t3 = e4.toTextUnformatted(true));
|
|
382
|
+
}
|
|
383
|
+
J2(e3 + t3);
|
|
384
|
+
}, [p2, f2]);
|
|
385
|
+
re(() => f2.getRange(p2).addListener(() => {
|
|
386
|
+
const e3 = { ...W2, clean: () => f2.getRange(p2).getCell() };
|
|
387
|
+
U2(e3), Q2?.(e3);
|
|
388
|
+
}), [p2, f2]);
|
|
389
|
+
const pe2 = ae(() => {
|
|
390
|
+
const e3 = W2.clean().createTemporaryCell({ value: Ze(), style: { numberFormat: "Medium Time" } }).toText();
|
|
391
|
+
J2((Z2.current?.value ?? "") + e3);
|
|
392
|
+
}, [f2]), fe2 = ae(() => {
|
|
393
|
+
const e3 = W2.clean().createTemporaryCell({ value: Ze(), style: { numberFormat: "Short Date" } }).toText();
|
|
394
|
+
J2((Z2.current?.value ?? "") + e3);
|
|
395
|
+
}, [f2]), we2 = te(() => ({ element: () => Z2.current, doCopy: (e3) => {
|
|
396
|
+
const t3 = Z2.current.value.substring(Z2.current.selectionStart, Z2.current.selectionEnd);
|
|
397
|
+
if (e3?.isCut) {
|
|
398
|
+
const e4 = Z2.current.value.substring(0, Z2.current.selectionStart) + Z2.current.value.substring(Z2.current.selectionEnd, Z2.current.value.length);
|
|
399
|
+
J2(e4);
|
|
400
|
+
}
|
|
401
|
+
return t3;
|
|
402
|
+
} }), [Z2.current]), qe2 = te(() => ({ element: () => Z2.current, doPaste: async (e3, t3) => {
|
|
403
|
+
const o3 = await e3.toText?.();
|
|
404
|
+
if (!o3) return true;
|
|
405
|
+
const n3 = Z2.current.value.substring(0, Z2.current.selectionStart) + o3 + Z2.current.value.substring(Z2.current.selectionEnd, Z2.current.value.length);
|
|
406
|
+
return J2(n3), $2({ start: Z2.current.selectionStart + o3.length, end: Z2.current.selectionStart + o3.length, direction: "forward" }), true;
|
|
407
|
+
} }), [Z2.current]), ve2 = te(() => ({ contains: (e3) => Z2.current?.contains(e3) || false, focus() {
|
|
408
|
+
Z2.current.focus();
|
|
409
|
+
} }), []), ye2 = te(() => [new k("selectAll", ve2, { label: "Select All", description: "Select all of the text in cell.", shortcut: { key: "a", modifiers: [M.Ctrl] } }, ge2), new k("startEditValueAbove", ve2, { label: "Copy From Above", description: "Copy the value from the cell above the active cell into the cell or the formula bar.", shortcut: [{ key: '"', modifiers: [M.Ctrl] }, { key: '"', modifiers: [M.Ctrl, M.Shift] }] }, he2), new k("startEditCurrentTime", ve2, { label: "Current Time", description: "Insert the current time.", shortcut: { key: "Semicolon", modifiers: [M.Ctrl, M.Shift] } }, pe2), new k("startEditCurrentDate", ve2, { label: "Current Date", description: "Insert the current date.", shortcut: { key: "Semicolon", modifiers: [M.Ctrl] } }, fe2), new R("relativeReferencesToggle", ve2, { label: "Toggle References", description: "Toggles cell references from relative to absolute, to partially absolute, back to relative again.", shortcut: { key: "F4" } }, ue2), new R("toggleEditorFocus", ve2, { label: "Toggle Editor Focus", description: "Moves focus between editors such as formula editor and inline editor.", shortcut: { key: "F2", modifiers: [M.Ctrl] } })], []), Ce2 = te(() => {
|
|
410
|
+
let e3 = null;
|
|
411
|
+
const t3 = () => ({ contains: (e4) => Z2.current?.contains(e4) || false, focus() {
|
|
412
|
+
Z2.current.focus();
|
|
413
|
+
} });
|
|
414
|
+
return e3 = w2 ? w2.createChildGroup(t3, "editor", false) : new T(t3, "editor"), e3.addCommands(ye2, true), e3;
|
|
415
|
+
}, [w2, ye2]), be2 = te(() => ({ notifier: null, source: we2, target: qe2, commands: Ce2 }), [we2, qe2, Ce2]);
|
|
416
|
+
A(be2);
|
|
417
|
+
const [Se2, xe2] = oe(!D2);
|
|
418
|
+
re(() => {
|
|
419
|
+
xe2(false);
|
|
420
|
+
}, []);
|
|
421
|
+
const ke2 = S((e3) => {
|
|
422
|
+
O2(true), Ce2?.activate();
|
|
423
|
+
const t3 = H2.current;
|
|
424
|
+
if (false !== t3) {
|
|
425
|
+
let e4, o3;
|
|
426
|
+
const n3 = Z2.current.value;
|
|
427
|
+
ot(W2, n3) && (e4 = n3.length - 1, o3 = n3.length - 1), e4 = t3?.start ?? e4 ?? n3.length, o3 = t3?.end ?? o3 ?? n3.length, H2.current = false, $2({ start: e4, end: o3, direction: "forward" });
|
|
428
|
+
}
|
|
429
|
+
y2?.(e3);
|
|
430
|
+
}, [y2, W2]), Re2 = _2.insets;
|
|
431
|
+
let Me2 = Re2.left + 1;
|
|
432
|
+
const Te2 = Re2.left + Re2.right + 2 - 1, Ae2 = K2?.bounds.height ?? 0;
|
|
433
|
+
let ze2, Fe2 = Re2.top;
|
|
434
|
+
_2.frameVertAlign === l.VerticalAlignment.Center ? Fe2 = Math.max(0, (V2 - (Re2.top + Re2.bottom) - Ae2) / 2) : _2.frameVertAlign === l.VerticalAlignment.Bottom && (Fe2 = Math.max(0, V2 - (Re2.top + Re2.bottom) - Ae2)), void 0 !== E2 && K2?.lines[0]?.bounds && (ze2 = K2?.lines[0]?.bounds.height * E2);
|
|
435
|
+
const Ee2 = _2.style.getFont();
|
|
436
|
+
let De2 = Ee2.getSize();
|
|
437
|
+
Ee2.isSuperSub() && (De2 *= Ee2.getSuperSubScale()), De2 *= a.getDeviceScale() * F2;
|
|
438
|
+
const Ie2 = h2 ? Ee2.toCSS(L2, F2) : null;
|
|
439
|
+
return G("div", { className: "sheet-cell-editor", onMouseDown: (e3) => {
|
|
440
|
+
Z2.current && document.activeElement !== Z2.current && requestAnimationFrame(() => {
|
|
441
|
+
Z2.current.focus();
|
|
442
|
+
});
|
|
443
|
+
}, ref: j2, ...I2, style: { display: "flex", flexGrow: 1, alignSelf: "stretch", height: "100%", width: "100%", maxWidth: "100%", maxHeight: "100%", cursor: "initial", ...z2 }, children: G("div", { className: "editor-placement", style: { display: "flex", flexGrow: 1, position: "relative", top: Fe2 * F2 + 1, left: Me2 * F2, width: `calc(100% - ${Te2 * F2}px)`, maxWidth: `calc(100% - ${Te2 * F2}px)`, height: (ze2 ?? Ae2) * F2, maxHeight: (ze2 ?? Ae2) * F2 }, children: G("textarea", { spellCheck: "false", placeholder: _2.placeholder, ref: Z2, value: _2.textValue, disabled: Se2, readOnly: C2, name: "sheet-cell-editor", autoComplete: "off", autoCapitalize: "off", style: { flex: "1 1 100%", font: "inherit", ...Ie2, fontSize: De2 ? `${De2}px` : "inherit", textAlign: _2.textAlign, lineHeight: (K2?.lines[0]?.bounds.height ?? 0) * F2 + "px", height: (K2?.bounds.height ?? 0) * F2, boxSizing: "border-box", padding: "0px", margin: "0px", borderWidth: 0, outline: "none", resize: "none", overflow: "hidden", background: "transparent", maxHeight: "100%", maxWidth: "100%", width: "100%", userSelect: "text", position: "absolute", whiteSpace: _2.isWrapped ? "normal" : "pre", wordWrap: "break-word" }, onFocus: ke2, onBlur: () => {
|
|
444
|
+
O2(false);
|
|
445
|
+
}, onSelect: (e3) => {
|
|
446
|
+
}, onChange: (e3) => {
|
|
447
|
+
Z2.current && !ne2.current && (H2.current = false, J2(e3.target.value), _2.textValue, e3.target.value, e3.target.selectionStart, e3.target.selectionEnd, e3.target.selectionDirection, $2({ start: e3.target.selectionStart, end: e3.target.selectionEnd, direction: e3.target.selectionDirection }));
|
|
448
|
+
}, onMouseDown: (e3) => {
|
|
449
|
+
B2 && ee2(true);
|
|
450
|
+
}, onKeyDown: ce2 }) }) });
|
|
451
|
+
})), rt = (e2, t2) => ({ clean: e2, dirty: t2, editMode: false }), it = (e2) => {
|
|
452
|
+
const { length: t2 = 0, width: o2 = 1, dashArray: n2 = null, dashArrayAdditional: l2 = null, isDouble: r2 = false, isAngled: i2 = false, offsetX: a2 = 0, offsetY: s2 = 0, isVertical: d2 = false, ...c2 } = e2, g2 = (e3) => {
|
|
453
|
+
let t3 = null;
|
|
454
|
+
if (e3 && o2 > 0) {
|
|
455
|
+
t3 = "";
|
|
456
|
+
for (let o3 = 0; o3 < e3.length; o3++) t3 += e3[o3], o3 < e3.length - 1 && (t3 += ",");
|
|
457
|
+
}
|
|
458
|
+
return t3;
|
|
459
|
+
}, u2 = g2(n2);
|
|
460
|
+
let h2 = u2;
|
|
461
|
+
l2 && (h2 = g2(l2));
|
|
462
|
+
let m2 = o2, p2 = t2, f2 = null;
|
|
463
|
+
if (r2) {
|
|
464
|
+
m2 = Math.floor(o2 / 2);
|
|
465
|
+
const e3 = m2 + m2 / 2 + 1;
|
|
466
|
+
let t3 = null;
|
|
467
|
+
t3 = d2 ? `M ${C.boundPixel(a2 + e3)} ${C.boundPixel(s2)} L ${C.boundPixel(a2 + e3)} ${C.boundPixel(s2 + p2)}` : `M ${C.boundPixel(a2)} ${C.boundPixel(s2 + e3)} L ${C.boundPixel(a2 + p2)} ${C.boundPixel(s2 + e3)}`, f2 = G("path", { strokeWidth: m2, strokeDasharray: h2, d: t3, ...c2 });
|
|
468
|
+
}
|
|
469
|
+
if (i2) {
|
|
470
|
+
m2 = o2 / 2;
|
|
471
|
+
const e3 = m2 + m2 / 2;
|
|
472
|
+
let t3 = h2, n3 = null;
|
|
473
|
+
n3 = d2 ? `M ${C.boundPixel(a2 + e3)} ${C.boundPixel(s2)} L ${C.boundPixel(a2 + e3)} ${C.boundPixel(s2 + p2)}` : `M ${C.boundPixel(a2)} ${C.boundPixel(s2 + e3)} L ${C.boundPixel(a2 + p2)} ${C.boundPixel(s2 + e3)}`, f2 = G("path", { strokeWidth: m2, strokeDasharray: t3, strokeDashoffset: "1", shapeRendering: "crispEdges", d: n3, ...c2 });
|
|
474
|
+
}
|
|
475
|
+
let w2 = null;
|
|
476
|
+
return w2 = d2 ? `M ${C.boundPixel(a2 + m2 / 2)} ${C.boundPixel(s2)} L ${C.boundPixel(a2 + m2 / 2)} ${C.boundPixel(s2 + p2)}` : `M ${C.boundPixel(a2)} ${C.boundPixel(s2 + m2 / 2)} L ${C.boundPixel(a2 + p2)} ${C.boundPixel(s2 + m2 / 2)}`, Z(j, { children: [G("path", { strokeWidth: m2, strokeDasharray: u2, d: w2, ...c2 }), f2] });
|
|
477
|
+
}, at = (e2, t2) => e2.colStart === t2.colStart ? e2.rowStart - t2.rowStart : e2.colStart - t2.colStart, st = (e2, t2) => e2.rowStart === t2.rowStart ? e2.colStart - t2.colStart : e2.rowStart - t2.rowStart, dt = (e2) => {
|
|
478
|
+
const { key: t2, points: o2, range: l2, stroke: r2, darkMode: i2, forceThinBorder: a2 = false, shiftIfWide: s2 = false, isVertical: d2 = false, intersections: c2, layout: g2 } = e2, u2 = n.BuiltInDefinitions.get(a2 ? n.StrokeStyle.Thin : r2.getStyle());
|
|
479
|
+
if (!u2) return null;
|
|
480
|
+
const h2 = o2[0], m2 = o2[1], p2 = o2[2], f2 = o2[3];
|
|
481
|
+
let w2 = 1 + (d2 ? f2 - m2 : p2 - h2), q2 = 0;
|
|
482
|
+
const v2 = r2.getColor().toRGBA(i2).toString(), y2 = u2.description.toLowerCase().includes("double");
|
|
483
|
+
let C2, b2;
|
|
484
|
+
const S2 = d2 ? "rowStart" : "colStart", x2 = d2 ? "rowEnd" : "colEnd", k2 = d2 ? m2 : h2;
|
|
485
|
+
if (c2?.length > 0) {
|
|
486
|
+
const e3 = c2[0];
|
|
487
|
+
if (e3?.range[S2] === l2[S2]) {
|
|
488
|
+
const t4 = n.BuiltInDefinitions.get(e3.stroke.getStyle());
|
|
489
|
+
q2 = Math.floor(t4.width / 2);
|
|
490
|
+
}
|
|
491
|
+
const t3 = c2[c2.length - 1];
|
|
492
|
+
if (t3?.range[x2] === l2[x2]) {
|
|
493
|
+
const e4 = n.BuiltInDefinitions.get(c2[c2.length - 1].stroke.getStyle());
|
|
494
|
+
w2 = Math.floor(w2 + (2 === e4.width ? 0 : e4.width / 2));
|
|
495
|
+
}
|
|
496
|
+
if (y2) {
|
|
497
|
+
const e4 = d2 ? "colStart" : "rowStart", t4 = d2 ? "colEnd" : "rowEnd", o3 = d2 ? g2?.getRowOffset : g2?.getColOffset;
|
|
498
|
+
let r3 = 0, i3 = 0;
|
|
499
|
+
C2 = [], b2 = [];
|
|
500
|
+
for (let a3 = 0; a3 < c2.length; a3++) {
|
|
501
|
+
const s3 = c2[a3];
|
|
502
|
+
if (s3.stroke.getStyle() === n.StrokeStyle.Double && o3) {
|
|
503
|
+
const n2 = o3(s3.range[S2]) - (k2 - q2);
|
|
504
|
+
s3.range[e4] < l2[e4] && (C2.push(n2 - r3), r3 = n2, C2.push(1), r3++), s3.range[t4] > l2[t4] && (b2.push(n2 - i3), i3 = n2, b2.push(1), i3++);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
C2.length > 0 && r3 < w2 && C2.push(w2 - r3), b2.length > 0 && i3 < w2 && b2.push(w2 - i3);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
let R2 = d2 ? -Math.floor(u2.width / 2) : -q2, M2 = d2 ? -q2 : -Math.floor(u2.width / 2);
|
|
511
|
+
const T2 = s2 && u2.width > 2 ? -1 : 0;
|
|
512
|
+
return G(it, { offsetX: h2 + R2 + T2, offsetY: m2 + M2 + T2, length: w2 + q2, isVertical: d2, stroke: v2, width: u2.width, dashArray: C2 ?? u2.pattern, dashArrayAdditional: b2, isDouble: y2, isAngled: u2.description.toLowerCase().includes("slant") }, t2);
|
|
513
|
+
}, ct = ({ getBorderAt: e2, borderRenderer: t2 = dt, getVisibleCells: o2, darkMode: l2, forceThinBorder: r2 = false, defaultColor: i2 = "black", shiftIfWide: a2 = false }) => {
|
|
514
|
+
const s2 = S(o2, [o2]);
|
|
515
|
+
return { overlay: te(() => (o3) => {
|
|
516
|
+
const d2 = o3.toClipBounds(o3.getRangeCoordsBounds(), -3);
|
|
517
|
+
if (!d2) return;
|
|
518
|
+
const c2 = s2(o3);
|
|
519
|
+
if (0 === c2.length) return;
|
|
520
|
+
const g2 = o3.getVisibleColumnOffsets(), u2 = o3.getVisibleRowOffsets();
|
|
521
|
+
let h2 = [], m2 = [];
|
|
522
|
+
const p2 = o3.getVisibleColumns(), f2 = o3.getVisibleRows(), w2 = [], q2 = [], v2 = [], y2 = (e3, t3, o4, n2, l3, r3, i3) => {
|
|
523
|
+
const a3 = { index: n2, stroke: l3, visibleIndex: o4, edge: r3, length: i3 };
|
|
524
|
+
e3[t3] || (e3[t3] = []), e3[t3].length > 0 && e3[t3][e3[t3].length - 1]?.index === n2 ? e3[t3][e3[t3].length - 1] = a3 : e3[t3].push(a3);
|
|
525
|
+
};
|
|
526
|
+
for (let t3 = 0; t3 < c2.length; t3++) {
|
|
527
|
+
const l3 = c2[t3], r3 = l3.coords;
|
|
528
|
+
if (!r3) continue;
|
|
529
|
+
const i3 = l3?.range ?? { rowStart: r3.rowIndex, colStart: r3.colIndex, rowEnd: r3.rowIndex, colEnd: r3.colIndex }, a3 = o3.getVisibleRangeCoords();
|
|
530
|
+
if (!Q.isRangesIntersect(i3, a3) && !Q.isRangeWithinRange(i3, a3)) continue;
|
|
531
|
+
const s3 = r3.colIndex, d3 = r3.rowIndex, v3 = g2[s3], C3 = u2[d3];
|
|
532
|
+
if (i3.rowEnd !== i3.rowStart) {
|
|
533
|
+
const e3 = u2[i3.rowStart]?.spanIndex ?? -1, t4 = u2[i3.rowEnd]?.spanIndex ?? u2[f2[f2.length - 1]].spanIndex + 1;
|
|
534
|
+
h2.push({ ...i3, rowStart: e3, rowEnd: t4 });
|
|
535
|
+
}
|
|
536
|
+
if (i3.colEnd !== i3.colStart) {
|
|
537
|
+
const e3 = g2[i3.colStart]?.spanIndex ?? -1, t4 = g2[i3.colEnd]?.spanIndex ?? g2[p2[p2.length - 1]].spanIndex + 1;
|
|
538
|
+
m2.push({ ...i3, colStart: e3, colEnd: t4 });
|
|
539
|
+
}
|
|
540
|
+
const b3 = l3.value, S3 = e2(b3, t3);
|
|
541
|
+
if (!S3 || S3.isEmpty()) continue;
|
|
542
|
+
const x2 = S3.getLeft(), k2 = S3.getTop(), R2 = S3.getRight(), M2 = S3.getBottom();
|
|
543
|
+
let T2 = 1, A2 = 1;
|
|
544
|
+
if (!v3 || !C3) continue;
|
|
545
|
+
const z2 = v3.spanIndex, F2 = C3.spanIndex;
|
|
546
|
+
x2.isNone() || y2(w2, z2, F2, d3, x2, n.Edge.Left, T2), k2.isNone() || y2(q2, F2, z2, s3, k2, n.Edge.Top, A2), R2.isNone() || y2(w2, z2 + A2, F2, d3, R2, n.Edge.Right, T2), M2.isNone() || y2(q2, F2 + T2, z2, s3, M2, n.Edge.Bottom, A2);
|
|
547
|
+
}
|
|
548
|
+
const C2 = (e3, t3, o4) => {
|
|
549
|
+
const n2 = [];
|
|
550
|
+
return e3.forEach((e4, l3) => {
|
|
551
|
+
let r3 = null;
|
|
552
|
+
e4.sort((e5, t4) => e5.visibleIndex - t4.visibleIndex);
|
|
553
|
+
for (let a3 = 0; a3 < e4.length; a3++) {
|
|
554
|
+
const s3 = e4[a3];
|
|
555
|
+
if (!s3?.stroke) continue;
|
|
556
|
+
if (void 0 === t3[l3] && void 0 === t3[l3 - 1]) continue;
|
|
557
|
+
let d3 = false;
|
|
558
|
+
if (o4) for (let e5 = 0; !d3 && e5 < h2.length; e5++) {
|
|
559
|
+
let t4 = h2[e5];
|
|
560
|
+
t4.colStart <= s3.index && t4.colEnd >= s3.index && t4.rowStart < l3 && t4.rowEnd >= l3 && (d3 = true);
|
|
561
|
+
}
|
|
562
|
+
else for (let e5 = 0; !d3 && e5 < m2.length; e5++) {
|
|
563
|
+
let t4 = m2[e5];
|
|
564
|
+
t4.rowStart <= s3.index && t4.rowEnd >= s3.index && t4.colStart < l3 && t4.colEnd >= l3 && (d3 = true);
|
|
565
|
+
}
|
|
566
|
+
if (d3) continue;
|
|
567
|
+
const c3 = s3.stroke?.getColor(), g3 = c3 ? c3.toRGBA().toString() : i2, u3 = s3.stroke.getStyle() + ":" + g3;
|
|
568
|
+
(u3 !== r3?.key || r3 && r3.visibleIndex + 1 < s3.visibleIndex) && (r3 && n2.push(r3), r3 = { key: u3, index: t3[l3] ?? t3[l3 - 1] + 1, visibleIndex: s3.visibleIndex, edge: s3.edge, stroke: s3.stroke, from: s3.index, to: s3.index + s3.length - 1, intersections: [], length: 1 }), r3.to = s3.index + s3.length - 1, r3.visibleIndex = s3.visibleIndex;
|
|
569
|
+
}
|
|
570
|
+
r3 && n2.push(r3);
|
|
571
|
+
}), n2;
|
|
572
|
+
};
|
|
573
|
+
h2 = h2.sort(st), m2 = m2.sort(at);
|
|
574
|
+
const b2 = C2(w2, p2, false), S2 = C2(q2, f2, true);
|
|
575
|
+
if (0 === b2.length && 0 === S2.length) return null;
|
|
576
|
+
for (let e3 = 0; e3 < S2.length; e3++) {
|
|
577
|
+
const t3 = S2[e3];
|
|
578
|
+
let o4 = K.findEqualOrGreater(b2, t3.from, (e4) => e4.index), n2 = false;
|
|
579
|
+
for (; !n2; ) {
|
|
580
|
+
const e4 = b2[o4++];
|
|
581
|
+
e4 && e4.index >= t3.from && e4.index <= t3.to + 1 && e4.from <= t3.index && e4.to + 1 >= t3.index && (t3.intersections.push({ stroke: e4.stroke, range: { rowStart: e4.from, rowEnd: e4.to + 1, colStart: e4.index, colEnd: e4.index } }), e4.intersections.push({ stroke: t3.stroke, range: { rowStart: t3.index, rowEnd: t3.index, colStart: t3.from, colEnd: t3.to + 1 } })), n2 = !e4 || e4.index > t3.to + 1;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
for (let e3 = 0; e3 < S2.length; e3++) {
|
|
585
|
+
const n2 = S2[e3];
|
|
586
|
+
let i3 = n2.stroke;
|
|
587
|
+
const s3 = `rBorder:${n2.index}:${n2.from}:${n2.to}:${n2.edge}`, d3 = { rowStart: n2.index, rowEnd: n2.index, colStart: n2.from, colEnd: n2.to + 1 }, c3 = o3.getLayout(), g3 = false, u3 = c3.getColOffset(d3.colStart), h3 = c3.getRowOffset(d3.rowStart), m3 = [u3, h3, c3.getColOffset(d3.colEnd), h3];
|
|
588
|
+
v2.push(t2({ key: s3, points: m3, stroke: i3, darkMode: l2, forceThinBorder: r2, shiftIfWide: a2, range: d3, intersections: n2.intersections, layout: c3, isVertical: g3 }));
|
|
589
|
+
}
|
|
590
|
+
for (let e3 = 0; e3 < b2.length; e3++) {
|
|
591
|
+
const n2 = b2[e3];
|
|
592
|
+
let i3 = n2.stroke;
|
|
593
|
+
const s3 = `cBorder:${n2.index}:${n2.from}:${n2.to}:${n2.edge}`, d3 = { rowStart: n2.from, rowEnd: n2.to + 1, colStart: n2.index, colEnd: n2.index }, c3 = o3.getLayout(), g3 = true, u3 = c3.getColOffset(d3.colStart), h3 = [u3, c3.getRowOffset(d3.rowStart), u3, c3.getRowOffset(d3.rowEnd)];
|
|
594
|
+
v2.push(t2({ key: s3, stroke: i3, points: h3, darkMode: l2, forceThinBorder: r2, shiftIfWide: a2, range: d3, intersections: n2.intersections, layout: c3, isVertical: g3 }));
|
|
595
|
+
}
|
|
596
|
+
return G("svg", { width: `${d2.width}`, height: `${d2.height}`, viewBox: `0 0 ${d2.width} ${d2.height}`, preserveAspectRatio: "none", shapeRendering: "crispEdges", style: { position: "absolute", left: "0px", top: "0px", width: `${d2.width}px`, height: `${d2.height}px`, pointerEvents: "none", transitionTimingFunction: "linear", transitionDelay: "0", transitionProperty: "left, top, width, height", willChange: "left, top, width, height, stroke-dashoffset", overflow: "visible" }, children: v2 }, "borders");
|
|
597
|
+
}, [e2, l2]) };
|
|
598
|
+
}, gt = X.Center, ut = Object.freeze({ horizontal: false, vertical: false }), ht = Y.EmptyTopLeft, mt = (e2, t2) => Q.EmptyCell, pt = (e2, t2) => new Promise((e3, t3) => {
|
|
599
|
+
t3("StaticBorderRenderer does not support scrolling");
|
|
600
|
+
}), ft = ee((e2) => {
|
|
601
|
+
const { getBorderAt: t2, width: o2, height: n2, style: l2, rowCount: r2 = 2, columnCount: i2 = 2, darkMode: a2, forceThinBorder: s2, children: d2, ...c2 } = e2, g2 = le(null), [u2, { width: h2, height: m2 }] = Re(), p2 = o2 ?? h2, f2 = n2 ?? m2, w2 = te(() => {
|
|
602
|
+
const e3 = [];
|
|
603
|
+
for (let t3 = 0; t3 < r2; t3++) for (let o3 = 0; o3 < i2; o3++) {
|
|
604
|
+
const n3 = { colIndex: o3, rowIndex: t3 };
|
|
605
|
+
e3.push({ coords: n3, value: n3 });
|
|
606
|
+
}
|
|
607
|
+
return e3;
|
|
608
|
+
}, []), q2 = ae((e3) => w2, [w2]), { overlay: v2 } = ct({ getVisibleCells: q2, getBorderAt: t2, darkMode: a2, forceThinBorder: s2 }), y2 = Math.floor(p2 / i2), C2 = Math.floor(f2 / r2), b2 = { getColOffset: (e3) => Math.ceil(e3 * y2) + 0, getRowOffset: (e3) => Math.ceil(e3 * C2) + 0, getColIndex: (e3) => Math.floor((e3 - 0) / y2) - 1, getRowIndex: (e3) => Math.floor((e3 - 0) / C2) - 1 }, S2 = { rowStart: 0, colStart: 0, rowEnd: r2, colEnd: i2 }, x2 = { x: 0, y: 0, width: Math.max(0, p2) + 0, height: Math.max(0, f2) + 0 }, k2 = te(() => {
|
|
609
|
+
const e3 = {}, t3 = Math.floor(p2 / i2);
|
|
610
|
+
for (let o3 = 0; o3 < i2; o3++) e3[o3] = { offset: o3 * t3, size: t3, spanIndex: o3 };
|
|
611
|
+
return e3;
|
|
612
|
+
}, [p2, f2]), R2 = te(() => {
|
|
613
|
+
const e3 = {}, t3 = Math.floor(f2 / r2);
|
|
614
|
+
for (let o3 = 0; o3 < r2; o3++) e3[o3] = { offset: o3 * t3, size: t3, spanIndex: o3 };
|
|
615
|
+
return e3;
|
|
616
|
+
}, [p2, f2]);
|
|
617
|
+
if (!v2) return null;
|
|
618
|
+
const M2 = { width: p2, height: f2 }, T2 = { width: p2, height: f2 }, A2 = { getStage: () => g2.current, getTotalSize: () => M2, getViewportSize: () => T2, getLayout: () => b2, getCellCoordsAsRangeCoords: Q.cellToRange, getVisibleRangeCoords: () => S2, getVisibleRows: () => {
|
|
619
|
+
const e3 = [];
|
|
620
|
+
for (let t3 = 0; t3 < r2; t3++) e3.push(t3);
|
|
621
|
+
return e3;
|
|
622
|
+
}, getTotalRangeCoords: () => S2, getRelativePointFromClient: (e3, t3) => ({ x: e3, y: t3 }), getVisibleColumns: () => {
|
|
623
|
+
const e3 = [];
|
|
624
|
+
for (let t3 = 0; t3 < i2; t3++) e3.push(t3);
|
|
625
|
+
return e3;
|
|
626
|
+
}, toClipBounds: (e3, t3) => x2, toViewBounds: (e3) => e3, toAbsoluteBounds: (e3) => e3, getBounds: () => x2, getInsets: () => null, getRangeCoordsBounds: (e3, t3) => null, getVisibleColumnOffsets: () => k2, getVisibleRowOffsets: () => R2, allViews: () => ({ [gt]: A2 }), getAnchor: () => gt, getZoom: () => 1, scrollCellCoordsIntoView: pt, getCellCoordsFromClient: mt, getScrollOrientation: () => ut, getScrollTopLeft: () => ht, getFreezeTopLeft: () => ht }, z2 = v2(A2);
|
|
627
|
+
return Z("div", { style: { ...l2, position: "relative", display: "flex" }, ...c2, children: [G("div", { ref: ke([g2, u2]), style: { flex: "1 1 100%", display: "flex", maxWidth: "100%", maxHeight: "100%" }, children: d2 }), z2] });
|
|
628
|
+
}), wt = "_sheetxl-sheet_1tnw9_9", qt = "_viewport-overlay_1tnw9_11", vt = (e2) => {
|
|
629
|
+
const { style: t2, ...o2 } = e2 ?? {};
|
|
630
|
+
return Z("svg", { style: { width: "135px", height: "37px", ...t2 }, viewBox: "0 0 135 37", ...o2, children: [G("path", { d: "M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z", fill: "#547dbe", fillRule: "evenodd" }), G("path", { d: "M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z", fill: "#ffffff", fillRule: "evenodd" }), G("path", { d: "m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z", fill: "#547dbe", fillRule: "evenodd", strokeWidth: "0.4" }), G("path", { d: "M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z", fill: "#eb594d" }), G("path", { d: "m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z", stroke: "#eb594d", strokeWidth: "2", fill: "#f9cecb" })] });
|
|
631
|
+
}, yt = ee((e2) => {
|
|
632
|
+
const { colorLicensee: t2 = "blue", colorError: o2 = "red", colorCredits: n2 = "grey", credits: l2 = "All rights reserved - Michael Ford", feature: r2, style: i2, ...a2 } = e2 ?? {}, [s2, c2] = oe(null);
|
|
633
|
+
J.useEffect(() => {
|
|
634
|
+
(async () => {
|
|
635
|
+
const e3 = await d.getDetails();
|
|
636
|
+
c2(e3);
|
|
637
|
+
})();
|
|
638
|
+
}, []);
|
|
639
|
+
const [g2, u2] = J.useState(false), h2 = { opacity: 0.65 }, m2 = J.useMemo(() => {
|
|
640
|
+
if (!(s2?.exceptions().length > 0)) return null;
|
|
641
|
+
const e3 = [];
|
|
642
|
+
for (let t3 = 0; t3 < s2.exceptions().length; t3++) {
|
|
643
|
+
const n3 = s2.exceptions()[t3];
|
|
644
|
+
e3.push(G("div", { style: { opacity: 0.8, fontSize: "16px", textAlign: "left", color: o2 }, children: n3 }, t3));
|
|
645
|
+
}
|
|
646
|
+
return e3;
|
|
647
|
+
}, [s2, o2]);
|
|
648
|
+
if (null == s2) return null;
|
|
649
|
+
if (s2.isValidFor(r2)) return null;
|
|
650
|
+
const p2 = s2.type(), f2 = !m2 && p2.endsWith("ity"), w2 = s2.licensee(), q2 = f2 ? 1.6 : 1, v2 = 135 / q2, y2 = 37 / q2;
|
|
651
|
+
let C2 = null;
|
|
652
|
+
return !p2 && w2?.length > 0 && (C2 = G("div", { style: { opacity: 0.7, fontWeight: "500", fontSize: "16px", textAlign: "left", color: t2 }, children: w2 })), G("div", { style: { pointerEvents: "none", display: "flex", flexDirection: "column", overflow: "hidden", ...i2 }, ...a2, children: Z("div", { style: { position: "relative", display: "flex", flexDirection: "column" }, children: [g2 ? G(vt, { style: h2 }) : G("svg", { width: v2, height: y2, style: h2, children: G("image", { style: { width: v2, height: y2 }, href: "https://www.sheetxl.com/watermark.svg", onError: () => u2(true) }) }), Z("div", { children: [C2, m2, G("div", { style: { height: "0px", fontSize: "16px", textAlign: "left", width: "0px", opacity: 0.8, color: n2 }, children: l2 })] })] }) });
|
|
653
|
+
}), Ct = (e2, t2, o2) => {
|
|
654
|
+
const n2 = le(t2);
|
|
655
|
+
n2.current = t2;
|
|
656
|
+
const l2 = o2?.fireOnModelChange ?? true;
|
|
657
|
+
re(() => {
|
|
658
|
+
if (!e2 || !n2.current) return;
|
|
659
|
+
const t3 = Object.keys(n2.current), r2 = {};
|
|
660
|
+
for (let e3 = 0; e3 < t3.length; e3++) {
|
|
661
|
+
const o3 = t3[e3];
|
|
662
|
+
r2[o3] = (e4, t4) => {
|
|
663
|
+
n2.current[o3]?.(e4, t4);
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
const i2 = e2.addListeners(r2, o2);
|
|
667
|
+
if (l2) for (let o3 = 0; o3 < t3.length; o3++) {
|
|
668
|
+
r2[t3[o3]](e2);
|
|
669
|
+
}
|
|
670
|
+
return () => {
|
|
671
|
+
i2?.();
|
|
672
|
+
};
|
|
673
|
+
}, [e2]);
|
|
674
|
+
}, bt = (e2, t2, o2, n2) => {
|
|
675
|
+
const l2 = le(o2);
|
|
676
|
+
l2.current = o2;
|
|
677
|
+
const r2 = n2?.fireOnAddressChange ?? true;
|
|
678
|
+
re(() => {
|
|
679
|
+
if (!e2 || !t2 || !l2.current) {
|
|
680
|
+
const e3 = { getSource: () => null, trigger: "delete", isDataChange: false, isTransactional: false, isUndo: false, timeStamp: Date.now() };
|
|
681
|
+
return void l2.current?.(e3);
|
|
682
|
+
}
|
|
683
|
+
const o3 = (e3) => {
|
|
684
|
+
l2.current?.(e3);
|
|
685
|
+
}, i2 = e2.getRange(t2).addListener(o3, n2);
|
|
686
|
+
if (r2) {
|
|
687
|
+
const n3 = e2.getRange(t2);
|
|
688
|
+
o3({ getSource: () => n3, trigger: "modelChange", isDataChange: false, isTransactional: false, isUndo: false, timeStamp: Date.now() });
|
|
689
|
+
}
|
|
690
|
+
return () => {
|
|
691
|
+
i2?.();
|
|
692
|
+
};
|
|
693
|
+
}, [e2, t2]);
|
|
694
|
+
}, St = new h("transparent");
|
|
695
|
+
function xt(e2) {
|
|
696
|
+
const { sheet: r2, onRepeatCommandChange: i2, bodyStyle: d2, commands: h2, target: p2, notifier: f2, onStartEdit: w2, getViewport: q2 } = e2, [v2, y2] = oe(null), [C2, b2] = oe(null), x2 = le(null), A2 = S(w2, [w2]), I2 = S(q2, [q2]), [V2, N2] = oe(), [L2, H2] = oe(() => r2?.getStyles().parseColor(c.Scheme.Bg2)), [B2, O2] = oe(() => r2?.getStyles().getNormal().getFont().getFill()), P2 = z();
|
|
697
|
+
le(P2.getMode()).current = P2.getMode();
|
|
698
|
+
const $2 = F(), [W2, U2] = oe(K.EmptyArray), _2 = ae(() => {
|
|
699
|
+
if (x2.current !== r2) return;
|
|
700
|
+
const e3 = r2.getSelectedRanges();
|
|
701
|
+
let t2 = null;
|
|
702
|
+
W2.length > 0 && Q.isCellWithinRange(v2, W2[0].getRange().getCoords()) && (t2 = W2[0]);
|
|
703
|
+
const o2 = r2?.getSelectedCell(), n2 = o2?.getCoords() ?? null;
|
|
704
|
+
Te(() => {
|
|
705
|
+
ge2(t2), y2(n2), b2(e3);
|
|
706
|
+
});
|
|
707
|
+
}, [r2, W2, C2, v2]), j2 = ae(K.debounce(_2, 210), [_2]);
|
|
708
|
+
re(() => {
|
|
709
|
+
x2.current = r2, _2();
|
|
710
|
+
}, [r2]);
|
|
711
|
+
const X2 = S(() => r2.getRange(v2).getCell(), [r2, v2]), Y2 = S(async (e3, t2, o2 = null, n2 = false, l2 = true) => {
|
|
712
|
+
const a2 = e3?.label?.(), s2 = async () => {
|
|
713
|
+
const e4 = await Promise.resolve(l2 && f2?.showBusy?.(a2 ?? "Busy..."));
|
|
714
|
+
try {
|
|
715
|
+
await r2.doBatch(async () => t2(r2), a2), n2 && P2.setMode(null), e4 && e4();
|
|
716
|
+
} catch (t3) {
|
|
717
|
+
if (e4 && e4(), !t3) return;
|
|
718
|
+
f2?.showError?.(t3);
|
|
719
|
+
}
|
|
720
|
+
}, d3 = [];
|
|
721
|
+
let c2 = false;
|
|
722
|
+
const g2 = async () => (d3.push(s2), (async () => {
|
|
723
|
+
if (!c2) {
|
|
724
|
+
for (c2 = true; d3.length > 0; ) {
|
|
725
|
+
const e4 = d3.shift();
|
|
726
|
+
e4 && await e4();
|
|
727
|
+
}
|
|
728
|
+
c2 = false;
|
|
729
|
+
}
|
|
730
|
+
})());
|
|
731
|
+
if (i2) {
|
|
732
|
+
let t3 = null;
|
|
733
|
+
if (false !== o2 && e3) {
|
|
734
|
+
const n3 = o2 ?? a2;
|
|
735
|
+
t3 = new k(e3.key(), p2, { label: n3, description: n3 }, g2);
|
|
736
|
+
}
|
|
737
|
+
i2(t3);
|
|
738
|
+
}
|
|
739
|
+
return g2();
|
|
740
|
+
}, [r2, i2, f2]), J2 = S((e3, t2, o2 = false, n2) => Y2(e3, (e4) => {
|
|
741
|
+
const l2 = e4.getSelectedRanges();
|
|
742
|
+
o2 && l2.updateStyle(null, n2), l2.updateStyle(t2, n2), l2.autoFit({ expandOnly: s.Orientation.Column, minContent: true, skipCustomSize: true });
|
|
743
|
+
}), [r2]), ee2 = S((e3, t2, o2) => {
|
|
744
|
+
Y2(e3, (e4) => {
|
|
745
|
+
let n2 = t2;
|
|
746
|
+
(o2 || t2?.address) && (n2 = n2 ?? {}, !o2 && t2?.address?.startsWith("#") ? o2 = t2?.address.substring(1) : o2 && (n2.displayText = o2)), e4.getSelectedRange().setHyperlink(n2);
|
|
747
|
+
});
|
|
748
|
+
}, [r2]), ne2 = S((e3, t2) => {
|
|
749
|
+
Y2(e3, (e4) => {
|
|
750
|
+
e4.getSelectedRange().setComments(t2);
|
|
751
|
+
});
|
|
752
|
+
}, [r2]), ie2 = S((e3, t2) => {
|
|
753
|
+
Y2(e3, (e4) => {
|
|
754
|
+
e4.getSelectedRanges().clear(t2);
|
|
755
|
+
});
|
|
756
|
+
}, [r2]), de2 = S(async (e3, t2, o2 = false, n2 = false) => Y2(e3, async (e4) => {
|
|
757
|
+
let l2 = e4.getSelectedRanges();
|
|
758
|
+
o2 && (t2 === s.Orientation.Row ? l2 = l2.getEntireRows(n2) : t2 === s.Orientation.Column && (l2 = l2.getEntireColumns(n2)));
|
|
759
|
+
let r3 = null;
|
|
760
|
+
const i3 = P2.getMode()?.key;
|
|
761
|
+
if ("copy" === i3 || "cut" === i3) {
|
|
762
|
+
const e5 = await $2.getClipboard().readReference();
|
|
763
|
+
e5 && "range" === e5.getItemType() && (r3 = e5.getItem(), r3.getCoords() || (r3 = null));
|
|
764
|
+
}
|
|
765
|
+
if (r3) {
|
|
766
|
+
const e5 = await l2.insertFrom(r3, { ...r3.getMarkOptions(), orientation: t2, autoSelect: true });
|
|
767
|
+
!e5 || e5.isEntireRows() || e5.isEntireColumns() || e5.autoFit({ orientations: s.Orientations.Row, minContent: true }), P2.setMode(null);
|
|
768
|
+
} else l2.insert(t2, { autoSelect: true });
|
|
769
|
+
}, "Insert Cells", false), [P2]), [ce2, ge2] = oe(null), ue2 = S((e3) => r2.getStyles().setDefaultTableStyle(e3), [r2]), he2 = S((e3) => {
|
|
770
|
+
r2.getStyles().getTableStyle(e3)?.delete();
|
|
771
|
+
}, [r2]), me2 = S((e3, t2) => {
|
|
772
|
+
Y2(e3, async (e4) => {
|
|
773
|
+
const o2 = e4.getSelectedRange(), n2 = e4.getSelectedCell().getCoords();
|
|
774
|
+
let l2 = null, r3 = 0;
|
|
775
|
+
const i3 = n2.rowIndex > 0 ? e4.getRange({ rowIndex: n2.rowIndex, colIndex: n2.colIndex }).getExtended(s.Direction.Up) : null;
|
|
776
|
+
i3 && e4.getRange({ colStart: n2.colIndex, rowStart: i3.getCoords().rowStart, colEnd: n2.colIndex, rowEnd: i3.getCoords().rowStart }).isContentful() && (l2 = s.Direction.Up, r3 = n2.rowIndex - i3.getCoords().rowEnd);
|
|
777
|
+
const a2 = n2.colIndex > 0 ? e4.getRange({ rowIndex: n2.rowIndex, colIndex: n2.colIndex - 1 }).getExtended(s.Direction.Left) : null;
|
|
778
|
+
if (a2 && e4.getRange({ colStart: a2.getCoords().colStart, rowStart: n2.rowIndex, colEnd: a2.getCoords().colStart, rowEnd: n2.rowIndex }).isContentful()) {
|
|
779
|
+
const e5 = n2.colIndex - a2.getCoords().colEnd;
|
|
780
|
+
(e5 < r3 || !l2) && (l2 = s.Direction.Left, r3 = e5);
|
|
781
|
+
}
|
|
782
|
+
let d3 = null;
|
|
783
|
+
if (l2 === s.Direction.Up) {
|
|
784
|
+
if (d3 = { ...i3.getCoords() }, (d3.rowEnd === n2.rowIndex || !e4.getRange({ colIndex: n2.colIndex, rowIndex: n2.rowIndex - 1 }).isContentful()) && d3.rowStart > 0 && e4.getRange({ colIndex: n2.colIndex, rowIndex: d3.rowStart - 1 }).isContentful()) {
|
|
785
|
+
const e5 = i3.getExtended(s.Direction.Up);
|
|
786
|
+
d3 = { colStart: n2.colIndex, rowStart: e5.getCoords().rowStart, colEnd: n2.colIndex, rowEnd: i3.getCoords().rowEnd };
|
|
787
|
+
}
|
|
788
|
+
d3.rowEnd = n2.rowIndex - 1;
|
|
789
|
+
} else if (l2 === s.Direction.Left) {
|
|
790
|
+
if (d3 = { ...a2.getCoords() }, (d3.colEnd === n2.colIndex || !e4.getRange({ colIndex: n2.colIndex - 1, rowIndex: n2.rowIndex }).isContentful()) && d3.colStart > 0 && e4.getRange({ colIndex: d3.colStart - 1, rowIndex: n2.rowIndex }).isContentful()) {
|
|
791
|
+
const e5 = a2.getExtended(s.Direction.Left);
|
|
792
|
+
d3 = { colStart: e5.getCoords().colStart, rowStart: n2.rowIndex, colEnd: e5.getCoords().colEnd, rowEnd: n2.rowIndex };
|
|
793
|
+
}
|
|
794
|
+
d3.colEnd = n2.colIndex - 1;
|
|
795
|
+
}
|
|
796
|
+
if (1 !== o2.size && l2) {
|
|
797
|
+
const n3 = o2.getCoords(), r4 = o2.startIncrementalUpdates({ orientation: s.Orientation.Column }), i4 = { ...d3 }, a3 = n3.rowStart, c2 = n3.rowEnd, g2 = n3.colStart, u2 = n3.colEnd, h3 = l2 === s.Direction.Up;
|
|
798
|
+
for (let o3 = g2; o3 <= u2; o3++) {
|
|
799
|
+
i4.colStart = h3 ? o3 : d3.colStart + (o3 - g2), i4.colEnd = h3 ? o3 : d3.colEnd + (o3 - g2);
|
|
800
|
+
for (let n4 = a3; n4 <= c2; n4++) {
|
|
801
|
+
i4.rowStart = h3 ? d3.rowStart + (n4 - a3) : n4, i4.rowEnd = h3 ? d3.rowEnd + (n4 - a3) : n4;
|
|
802
|
+
const l3 = e4.getRange(i4).toString();
|
|
803
|
+
r4.pushAt(n4, o3, `=${t2}(${l3})`);
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
r4.apply();
|
|
807
|
+
} else {
|
|
808
|
+
const o3 = d3 ? e4.getRange(d3).toString() : "", n3 = `=${t2}(`;
|
|
809
|
+
A2?.({ text: `${n3}${o3})`, editMode: true, initialSelection: { start: n3.length, end: n3.length + o3.length } });
|
|
810
|
+
}
|
|
811
|
+
}, false);
|
|
812
|
+
}, [r2]), pe2 = S((e3, t2, o2 = false, n2 = true) => {
|
|
813
|
+
Y2(e3, async (l2) => {
|
|
814
|
+
let r3 = null;
|
|
815
|
+
if (ce2) return void ce2.updateStyleOptions(t2);
|
|
816
|
+
{
|
|
817
|
+
const e4 = l2.getSelectedRanges().getFixed(true), t3 = l2.getSelectedRange().getDefaultSortCriteria();
|
|
818
|
+
let o3 = { ranges: e4, hasHeader: t3?.options?.hasHeader ?? false };
|
|
819
|
+
r3 = n2 ? new Promise((e5, t4) => {
|
|
820
|
+
const n3 = { tableOptions: o3, onCancel: () => {
|
|
821
|
+
t4();
|
|
822
|
+
}, onDone: (t5) => {
|
|
823
|
+
e5(t5);
|
|
824
|
+
}, context: { getNames: () => l2.getNames() } };
|
|
825
|
+
f2.showWindow?.("tableNew", n3);
|
|
826
|
+
}) : { option: "Ok", tableOptions: o3 };
|
|
827
|
+
}
|
|
828
|
+
const i3 = await Promise.resolve(r3);
|
|
829
|
+
if ("Ok" !== i3?.option) throw null;
|
|
830
|
+
const a2 = await Promise.resolve(f2?.showBusy?.(e3.label()));
|
|
831
|
+
try {
|
|
832
|
+
const e4 = l2.getTables().add(i3.tableOptions.ranges.at(0), { styleName: t2?.name, clearFormatting: o2, hasHeader: i3.tableOptions.hasHeader });
|
|
833
|
+
await e4.getRange().select();
|
|
834
|
+
} catch (e4) {
|
|
835
|
+
a2(), f2?.showError?.(e4);
|
|
836
|
+
}
|
|
837
|
+
a2();
|
|
838
|
+
}, false, true, false);
|
|
839
|
+
}, [ce2]), fe2 = S(() => d2, [d2]), we2 = S((e3) => ({ styles: () => r2.getStyles(), table: () => e3, bodyStyle: fe2, getNames: () => r2.getNames() }), [r2]), qe2 = S(async (e3, t2, o2, n2 = true) => {
|
|
840
|
+
let l2 = null;
|
|
841
|
+
if (!t2) {
|
|
842
|
+
let e4 = r2.getSelectedRange();
|
|
843
|
+
1 === e4.size && (e4 = e4.getSurrounding());
|
|
844
|
+
let o3 = r2.getTables().search({ address: r2.getSelectedRange() });
|
|
845
|
+
o3.length > 0 && (t2 = o3[0]), await e4.select();
|
|
846
|
+
}
|
|
847
|
+
if (t2) {
|
|
848
|
+
if (n2) {
|
|
849
|
+
try {
|
|
850
|
+
o2 && await t2.select();
|
|
851
|
+
} catch (e4) {
|
|
852
|
+
}
|
|
853
|
+
l2 = new Promise(async (o3, n3) => {
|
|
854
|
+
e3.update({ context: we2(t2) });
|
|
855
|
+
const l3 = { command: e3, commands: Ie2, notifier: f2, onDone: (e4) => {
|
|
856
|
+
o3(e4);
|
|
857
|
+
} }, r3 = await f2.showWindow?.("tableDetails", l3, { disableAutoDestroy: true });
|
|
858
|
+
setTimeout(() => {
|
|
859
|
+
r3.focus();
|
|
860
|
+
}, 180);
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
Promise.resolve(l2).then((e4) => {
|
|
864
|
+
}, (e4) => {
|
|
865
|
+
f2?.showError?.(e4);
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
}, [f2]), ve2 = S(async (e3, t2, o2 = false) => {
|
|
869
|
+
let n2 = null;
|
|
870
|
+
if (t2) t2.isITable ? n2 = t2 : t2.getValue() && (n2 = t2.getValue());
|
|
871
|
+
else {
|
|
872
|
+
const e4 = r2.getTables().search({ address: r2.getSelectedRange() });
|
|
873
|
+
e4.length > 0 && (n2 = e4[0]);
|
|
874
|
+
}
|
|
875
|
+
if (n2) {
|
|
876
|
+
if (!o2) {
|
|
877
|
+
const e4 = n2.getRange().getCoords(), t3 = (e4.colEnd - e4.colStart + 1) * (e4.rowEnd - e4.rowStart + 1);
|
|
878
|
+
if (t3 > 1e4) {
|
|
879
|
+
if ("Convert" !== await f2?.showOptions({ title: "Confirm", description: `Converting a table to range with '${t3}' cells will set a large number of cell styles and may affect performance.
|
|
880
|
+
Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" })) return;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
Y2(e3, async () => {
|
|
884
|
+
o2 ? n2.delete() : n2.convertToRange();
|
|
885
|
+
}, false, true);
|
|
886
|
+
}
|
|
887
|
+
}, [f2]), ye2 = S((e3, t2, o2) => {
|
|
888
|
+
Y2(e3, async (n2) => {
|
|
889
|
+
let l2 = n2.getSelectedRanges();
|
|
890
|
+
if (l2.getCount() > 1) throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");
|
|
891
|
+
let r3 = l2.at(0);
|
|
892
|
+
1 === r3.size && (r3 = r3.getSurrounding());
|
|
893
|
+
const i3 = n2.getSelection().getCoords().cell;
|
|
894
|
+
let a2 = r3.getDefaultSortCriteria(s.Orientation.Row, i3);
|
|
895
|
+
if (!a2) {
|
|
896
|
+
if (o2) throw new Error("Invalid sort selection. Sort requires a single range with data.");
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
let d3 = a2.options;
|
|
900
|
+
if (o2 && (d3 = new Promise((e4, t3) => {
|
|
901
|
+
const o3 = { range: r3, options: a2.options, cell: i3, onCancel: () => {
|
|
902
|
+
t3();
|
|
903
|
+
}, onDone: (o4) => {
|
|
904
|
+
o4 ? e4(o4.options) : t3();
|
|
905
|
+
} };
|
|
906
|
+
f2.showWindow?.("sort", o3);
|
|
907
|
+
})), d3 = await Promise.resolve(d3), !d3) return;
|
|
908
|
+
const c2 = await Promise.resolve(f2?.showBusy?.(e3.label()));
|
|
909
|
+
try {
|
|
910
|
+
r3.doBatch(() => {
|
|
911
|
+
const e4 = { ...d3, ...t2 };
|
|
912
|
+
r3.sort(e4), r3.autoFit({ orientations: e4?.orientation === s.Orientation.Column ? s.Orientations.Column : s.Orientations.Row, skipCustomSize: true, minContent: true });
|
|
913
|
+
}, e3?.label?.());
|
|
914
|
+
} catch (e4) {
|
|
915
|
+
c2(), f2?.showError?.(e4);
|
|
916
|
+
}
|
|
917
|
+
c2();
|
|
918
|
+
}, false, false, false);
|
|
919
|
+
}, [f2]), Ce2 = S(() => {
|
|
920
|
+
console.log("compactedSelection");
|
|
921
|
+
const e3 = r2.getSelection().getCoords(), t2 = r2.getSelectedRanges().getFlattened().getCoords(), o2 = ((e4) => {
|
|
922
|
+
const t3 = new Blob([e4], { type: "application/javascript" }), o3 = URL.createObjectURL(t3), n3 = new Worker(o3);
|
|
923
|
+
return URL.revokeObjectURL(o3), n3;
|
|
924
|
+
})("console.log('hello from worker');");
|
|
925
|
+
setTimeout(() => {
|
|
926
|
+
o2.terminate(), console.log("Worker terminated");
|
|
927
|
+
}, 5e3);
|
|
928
|
+
let n2 = -1;
|
|
929
|
+
for (let o3 = 0; -1 === n2 && o3 < t2.length; o3++) Q.isCellWithinRange(e3.cell, t2[o3]) && (n2 = o3);
|
|
930
|
+
if (Q.isEqualRangesArrays(e3.ranges, t2)) return;
|
|
931
|
+
const l2 = { cell: e3.cell, ranges: t2, rangeIndex: n2 };
|
|
932
|
+
r2.getSelection().updateCoords(l2);
|
|
933
|
+
}, [r2]), be2 = S(() => {
|
|
934
|
+
console.log("selectComments");
|
|
935
|
+
}, [r2]), Se2 = S(async (e3 = false, t2 = false) => {
|
|
936
|
+
let o2 = null;
|
|
937
|
+
if (t2) o2 = r2.getEntireRange();
|
|
938
|
+
else {
|
|
939
|
+
const t3 = r2.getSelectedRange();
|
|
940
|
+
if (t3.isEntireRange()) {
|
|
941
|
+
const e4 = r2.getSelection().getCoords().cell, t4 = r2.getRange(e4);
|
|
942
|
+
o2 = t4.getSurrounding(), o2.isEntireRange() && (o2 = t4);
|
|
943
|
+
} else o2 = t3.getSurrounding({ contentOnly: e3 });
|
|
944
|
+
}
|
|
945
|
+
o2 && await o2.select();
|
|
946
|
+
}, [r2]), xe2 = S((e3, t2, o2) => {
|
|
947
|
+
Y2(e3, async (e4) => {
|
|
948
|
+
let n2 = e4.getSelectedRanges();
|
|
949
|
+
o2 && (t2 === s.Orientation.Row ? n2 = n2.getEntireRows() : t2 === s.Orientation.Column && (n2 = n2.getEntireColumns())), n2.delete(t2);
|
|
950
|
+
}, "Delete Cells");
|
|
951
|
+
}, [r2]);
|
|
952
|
+
S(async (e3) => {
|
|
953
|
+
let t2 = null;
|
|
954
|
+
const o2 = I2(), n2 = Math.min(o2.width - 8, 480), l2 = Math.min(o2.height - 8, 288);
|
|
955
|
+
try {
|
|
956
|
+
r2.getSelectedRanges();
|
|
957
|
+
t2 = await r2.getMovables().add({ bounds: { x: o2.left + (o2.width - n2) / 2, y: o2.top + (o2.height - l2) / 2, width: n2, height: l2 }, type: "chart", json: e3.template }), t2.select(), P2.setMode(null);
|
|
958
|
+
} catch (e4) {
|
|
959
|
+
f2?.showError?.(e4);
|
|
960
|
+
}
|
|
961
|
+
return t2;
|
|
962
|
+
}, [r2, f2]);
|
|
963
|
+
const ke2 = S(async (e3, t2, o2) => {
|
|
964
|
+
const n2 = await f2?.showBusy?.(e3.label());
|
|
965
|
+
try {
|
|
966
|
+
const e4 = await r2.getMovables().addImage(t2, { autoSelect: true, ...o2 });
|
|
967
|
+
return n2(), P2.setMode(null), e4;
|
|
968
|
+
} catch (e4) {
|
|
969
|
+
n2();
|
|
970
|
+
let t3 = e4;
|
|
971
|
+
"string" != typeof t3 && (console.warn(e4), t3 = "Unable to resolve image."), f2?.showMessage?.(t3, { type: E.Error });
|
|
972
|
+
}
|
|
973
|
+
}, [r2, f2]), Re2 = S((e3, t2) => {
|
|
974
|
+
Y2(e3, async (o2) => {
|
|
975
|
+
const n2 = o2.getSelectedRanges();
|
|
976
|
+
n2.doBatch(() => {
|
|
977
|
+
const e4 = t2 === s.Direction.Up || t2 === s.Direction.Down, l2 = n2.getCoords().slice().sort(Q.createRangeComparator(e4 ? s.Orientation.Row : s.Orientation.Column));
|
|
978
|
+
for (let e5 = 0; e5 < l2.length; e5++) {
|
|
979
|
+
const n3 = l2[e5];
|
|
980
|
+
let r3 = n3;
|
|
981
|
+
const i3 = o2.getRange(r3).getMerges();
|
|
982
|
+
let a2 = 0, d3 = 0;
|
|
983
|
+
if (i3.length > 0) {
|
|
984
|
+
const e6 = i3[0];
|
|
985
|
+
a2 = e6.rowEnd - e6.rowStart, d3 = e6.colEnd - e6.colStart;
|
|
986
|
+
}
|
|
987
|
+
t2 === s.Direction.Left ? r3 = { ...n3, colStart: n3.colEnd + d3 } : t2 === s.Direction.Right ? r3 = { ...n3, colEnd: n3.colStart + d3 } : t2 === s.Direction.Up ? r3 = { ...n3, rowStart: n3.rowEnd + a2 } : t2 === s.Direction.Down && (r3 = { ...n3, rowEnd: n3.rowStart + a2 }), o2.getRange(r3).autoFill(n3, { filler: g.Types.Copy }), o2.getRange(n3).autoFit({ orientations: s.Orientations.Row, skipCustomSize: true, minContent: true });
|
|
988
|
+
}
|
|
989
|
+
}, { autoSelect: true, description: e3.label() });
|
|
990
|
+
});
|
|
991
|
+
}, [f2]), Me2 = S(() => {
|
|
992
|
+
let e3 = null;
|
|
993
|
+
const t2 = r2.getSelectedCell().getCoords();
|
|
994
|
+
if (t2?.rowIndex > 0) {
|
|
995
|
+
const o2 = r2.getRange({ rowIndex: t2.rowIndex - 1, colIndex: t2.colIndex }).getCell();
|
|
996
|
+
o2 && (e3 = o2.toTextUnformatted(true));
|
|
997
|
+
}
|
|
998
|
+
A2?.({ text: e3 });
|
|
999
|
+
}, [r2]), [Ae2, ze2] = se((e3) => e3 + 1, 0), [Fe2, Ee2] = se((e3) => e3 + 1, 0), De2 = te(() => [new R("gridlinesToggle", p2, { label: "Gridlines", scopedLabels: { view: "Gridlines" }, description: "Toggle whether the lines between rows and columns in the sheet are displayed." }), new R("sheetViewToggleGridlinesRows", p2, { label: "Row Gridlines", scopedLabels: { view: "Row Gridlines", gridlines: "Rows" }, description: "Toggle whether the lines between rows in the sheet are displayed." }), new R("sheetViewToggleGridlinesColumns", p2, { label: "Column Gridlines", scopedLabels: { view: "Columns Gridlines", gridlines: "Columns" }, description: "Toggle whether the lines between columns in the sheet are displayed." }), new R("sheetViewFormatGridlinesColor", p2, { label: "Gridlines Color", description: "Color the rows and column gridlines." }), new R("sheetViewToggleShowHeadings", p2, { label: "Headings", scopedLabels: { view: "Headings" }, description: "Toggle whether the row and column headings are displayed." }), new R("sheetViewToggleShowHeadingRows", p2, { label: "Row Headings", scopedLabels: { view: "Row Headings", headings: "Rows" }, description: "Toggle whether the row headings are displayed." }), new R("sheetViewToggleShowHeadingColumns", p2, { label: "Column Headings", scopedLabels: { view: "Columns Headings", headings: "Columns" }, description: "Toggle whether the column headings are displayed." }), new R("sheetViewToggleShowHeadingsNumeric", p2, { label: "Numeric Headers", description: "Toggle whether cell headings show numbers or A1 conventions.", shortcut: { key: "h", modifiers: [M.Ctrl, M.Shift] } }), new R("sheetViewToggleFormulaView", p2, { label: "Show Formulas", description: "Toggle whether cells show formula or values.", shortcut: [{ key: "`", modifiers: [M.Ctrl] }, { key: "`", modifiers: [M.Ctrl, M.Shift] }] }), new R("sheetViewToggleShowZeros", p2, { label: "Show Zeros", description: "Toggle whether cell with zero value shows '0' or blank." }), new k("selectComments", p2, { label: "Select Comments", description: "Select the cells with comments.", shortcut: { key: "O", modifiers: [M.Ctrl, M.Shift] } }, () => be2()), new R("selectAll", p2, { label: "Select All", description: "Select the closest data or the entire sheet if no data is nearby.", shortcut: [{ key: "A", modifiers: [M.Ctrl] }, { key: "Space", modifiers: [M.Ctrl, M.Shift] }] }, (e3 = false) => Se2(false, e3)), new k("selectRegion", p2, { label: "Select Region", description: "Select the closest data.", shortcut: { key: "*", modifiers: [M.Ctrl, M.Shift] } }, () => Se2(true, false)), new k("breakSelection", p2, { label: "Select Visible", description: "Break the selection based on hidden rows and columns.", shortcut: { key: "Semicolon", modifiers: [M.Ctrl, M.Alt] } }, () => Ce2()), new k("formatTextRotate0", p2, { label: "No Text Rotation", description: "Remove all text rotation." }), new k("formatTextRotate45", p2, { label: "Angle Clockwise", description: "Angle text 45 degrees downward." }), new k("formatTextRotate90", p2, { label: "Rotate Text Down", description: "Angle your text so that it aligns with the left." }), new k("formatTextRotate270", p2, { label: "Rotate Text Up", description: "Angle your text so that it aligns with the right." }), new k("formatTextRotate315", p2, { label: "Angle Counterclockwise", description: "Angle text 45 degrees upward." }), new R("formatTextRotateCustom", p2, { label: "Custom Text Rotation", description: "Angle your text using a custom angle." }), new k("formatTextRotateVertical", p2, { label: "Vertical Text", description: "Stack text vertically." }), new k("sortAscending", p2, { label: "Sort Ascending", scopedLabels: { sort: "Ascending" }, description: "Lowest to Highest." }, function() {
|
|
1000
|
+
ye2(this, { reverse: false }, false);
|
|
1001
|
+
}), new k("sortDescending", p2, { label: "Sort Descending", scopedLabels: { sort: "Descending" }, description: "Highest to Lowest." }, function() {
|
|
1002
|
+
ye2(this, { reverse: true }, false);
|
|
1003
|
+
}), new k("sortCustom", p2, { label: "Custom Sort…", scopedLabels: { sort: "Custom…" }, description: "Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts." }, function() {
|
|
1004
|
+
ye2(this, {}, true);
|
|
1005
|
+
}), new R("protectionSheetToggle", p2, { label: "Protect Sheet", scopedLabels: { sheet: "Protected" }, description: "Prevent unwanted changes from others by limiting their ability to edit.\nFor example, you can prevent people from editing locked cells or making formatting changes." }), new R("formatSheetTabColor", p2, { label: "Tab Color", description: "Color the tab to help differentiate for other sheets." }), new R("formatCellStyle", p2, { label: "Cell Styles", scopedLabels: { cellStyle: "Apply" }, description: "A colorful style is a great way to make important data stand out on the sheet." }, function(e3) {
|
|
1006
|
+
J2(this, { named: e3.getName() }, true);
|
|
1007
|
+
}), new R("formatTableStyle", p2, { label: "Format as Table", scopedLabels: { table: "Apply (Keep Styles)" }, description: "Create a table or apply style to the current table." }, function(e3) {
|
|
1008
|
+
pe2(this, e3);
|
|
1009
|
+
}), new R("formatTableStyleClearCellStyles", p2, { label: "Format as Table (Clear Styles)", scopedLabels: { table: "Apply (Clear Styles)" }, description: "Create a table or apply style to the current table and clears all cell styles." }, function(e3) {
|
|
1010
|
+
pe2(this, e3, true);
|
|
1011
|
+
}), new R("formatTableStyleClearTableStyle", p2, { label: "Clear Table Style", scopedLabels: { table: "Clear Style" }, description: "Remove all the styling that is specific for the table." }, function() {
|
|
1012
|
+
pe2(this, { name: null }, true);
|
|
1013
|
+
}), new R("setDefaultTableStyle", p2, { label: "Set Default Table Style", scopedLabels: { table: "Set As Default" }, description: "Sets the default table style used when a table is inserted." }, ue2), new R("deleteTableStyle", p2, { label: "Delete Table Style", scopedLabels: { table: "Delete" }, description: "Remove the current table style." }, he2), new R("formatBorder", p2, { label: "Border", description: "Create an outline border." }, function(e3) {
|
|
1014
|
+
J2(this, { border: e3 });
|
|
1015
|
+
}), new R("formatFillColor", p2, { label: "Fill Color", description: "Color the background of the cells to make them stand out." }, function(e3) {
|
|
1016
|
+
J2(this, { fill: e3 });
|
|
1017
|
+
}), new R("formatFontColor", p2, { label: "Font Color", description: "Change the color of your text." }, function(e3) {
|
|
1018
|
+
J2(this, { font: { fill: e3 } });
|
|
1019
|
+
}), new R("formatBoldToggle", p2, { label: "Bold", description: "Toggle bold formatting of text.", shortcut: [{ key: "B", modifiers: [M.Ctrl] }, { key: "2", modifiers: [M.Ctrl] }] }), new R("formatItalicToggle", p2, { label: "Italic", description: "Toggle italic formatting of text.", shortcut: [{ key: "I", modifiers: [M.Ctrl] }, { key: "3", modifiers: [M.Ctrl] }] }), new R("formatUnderlinedToggle", p2, { label: "Underline", scopedLabels: { underline: "Single" }, description: "Underline the text.", shortcut: [{ key: "u", modifiers: [M.Ctrl] }, { key: "4", modifiers: [M.Ctrl] }] }), new R("formatUnderlinedDoubleToggle", p2, { label: "Double Underline", scopedLabels: { underline: "Double" }, description: "Double underline the text." }), new R("formatUnderlinedAccountingToggle", p2, { label: "Accounting Underline", scopedLabels: { underline: "Accounting" }, description: "Use accounting underline for the text." }), new R("formatUnderlinedAccountingDoubleToggle", p2, { label: "Double Accounting Underline", scopedLabels: { underline: "Double Accounting" }, description: "Use accounting double underline the text." }), new R("formatStrikeThroughToggle", p2, { label: "Strikethrough", description: "Toggle strike-through formatting of text.", shortcut: { key: "5", modifiers: [M.Ctrl] } }), new R("formatSuperscriptToggle", p2, { label: "Superscript", description: "Format your text to be smaller and sit at the top of the line." }), new R("formatSubscriptToggle", p2, { label: "Subscript", description: "Format your text to be smaller and sit at the bottom of the line." }), new R("formatAlignTopToggle", p2, { label: "Align Top", description: "Align text to the top." }), new R("formatTextOverflowVisibleToggle", p2, { label: "Overflow Text", description: "Overflow text to the next cells." }), new R("formatTextOverflowWrapToggle", p2, { label: "Wrap Text", description: "Wrap text with the existing cell and increase the height as required." }), new R("formatTextOverflowClipToggle", p2, { label: "Clip Text", description: "Clip text that falls outside of the existing cell." }), new R("formatTextOverflowShrinkToggle", p2, { label: "Shrink Text", description: "Shrink the text font to fit within existing cell." }), new R("formatTextOverflowEllipsisToggle", p2, { label: "Ellipsis Text", description: "Add a trailing '…' to the text to indicate text is partially hidden." }), new R("formatAlignMiddleToggle", p2, { label: "Align Middle", description: "Align text so that it is centered between the top and bottom of the cell." }), new R("formatAlignBottomToggle", p2, { label: "Align Bottom", description: "Align text to the bottom." }), new R("formatAlignJustifyVerticalToggle", p2, { label: "Justify Vertically", description: "Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell." }), new R("formatAlignDistributedVerticalToggle", p2, { label: "Distribute Vertically", description: "Justify your content vertically." }), new R("formatAlignLeftToggle", p2, { label: "Align Left", description: "Align your content to the left." }), new R("formatAlignCenterToggle", p2, { label: "Align Center", description: "Center your content." }), new R("formatAlignRightToggle", p2, { label: "Align Right", description: "Align your content to the right." }), new R("formatAlignJustifyToggle", p2, { label: "Align Justify", description: "Justify your content." }), new R("formatAlignCenterContinuousToggle", p2, { label: "Center Across", description: "Center your content across multiple cells." }), new R("formatAlignFillToggle", p2, { label: "Fill Across", description: "Repeat the value to fill the entire cell." }), new R("formatAlignDistributedHorizontalToggle", p2, { label: "Distribute Horizontally", description: "Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell." }), new k("formatFontSizeIncrease", p2, { label: "Increase Font Size", description: "Make your text a bit bigger.", shortcut: { key: ">", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1020
|
+
J2(this, (e3) => ({ font: { size: Xe(e3.getFont().getSize(), true) } }));
|
|
1021
|
+
}), new k("formatFontSizeDecrease", p2, { label: "Decrease Font Size", description: "Make your text a bit smaller.", shortcut: { key: "<", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1022
|
+
J2(this, (e3) => ({ font: { size: Xe(e3.getFont().getSize(), false) } }));
|
|
1023
|
+
}), new R("formatFontFamily", p2, { label: "Font", description: "Select the font your text." }, function(e3) {
|
|
1024
|
+
J2(this, { font: { family: e3 } });
|
|
1025
|
+
}), new R("formatFontSize", p2, { label: "Font Size", description: "Change the size of your text." }, function(e3) {
|
|
1026
|
+
J2(this, { font: { size: e3 } });
|
|
1027
|
+
}), new R("formatNumberDialog", p2, { label: "Custom Number Format", scopedLabels: { numberFormat: "Custom" }, description: "Create a custom number format.", shortcut: [{ key: "1", modifiers: [M.Ctrl] }, { key: "1", modifiers: [M.Ctrl, M.Alt] }] }, function(e3, t2) {
|
|
1028
|
+
const o2 = this, n2 = { initialValue: e3 ?? t2.state(), context: t2.context(), onInputOption: (e4, t3) => {
|
|
1029
|
+
J2(o2, { numberFormat: e4 });
|
|
1030
|
+
} };
|
|
1031
|
+
f2.showWindow?.("numberFormat", n2);
|
|
1032
|
+
}), new R("formatNumberFormat", p2, { label: "Number Format", description: "Choose the format for your cells, such as percentage, currency, date or time." }, function(e3) {
|
|
1033
|
+
J2(this, { numberFormat: e3 });
|
|
1034
|
+
}), new R("formatNumberFormatGeneralStyle", p2, { label: "General Style", description: "Remove all specific formatting.", shortcut: { key: "Backquote", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1035
|
+
J2(this, { numberFormat: t.Type.General });
|
|
1036
|
+
}), new R("formatNumberFormatNumberStyle", p2, { label: "Number Style", description: "Format as number with two decimals and comma.", shortcut: { key: "1", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1037
|
+
J2(this, { numberFormat: "#,##0.00" });
|
|
1038
|
+
}), new R("formatNumberFormatTimeStyle", p2, { label: "Time Style", description: "Format as time with hour and minute, and AM or PM.", shortcut: { key: "2", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1039
|
+
J2(this, { numberFormat: "h:mm AM/PM" });
|
|
1040
|
+
}), new R("formatNumberFormatDateStyle", p2, { label: "Date Style", description: "Format as date with day, month, and year.", shortcut: { key: "3", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1041
|
+
J2(this, { numberFormat: "d-mmm-yy" });
|
|
1042
|
+
}), new R("formatNumberFormatAccountingStyle", p2, { label: "Accounting Style", description: "Format as Dollars, Euros, or other currency.", shortcut: { key: "4", modifiers: [M.Ctrl, M.Shift] } }, function(e3) {
|
|
1043
|
+
J2(this, { numberFormat: e3 ?? '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)' });
|
|
1044
|
+
}), new R("formatNumberFormatPercentStyle", p2, { label: "Percent Style", description: "Format as a percent with no decimal places.", shortcut: { key: "5", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1045
|
+
J2(this, { numberFormat: "0%" });
|
|
1046
|
+
}), new R("formatNumberFormatScientificStyle", p2, { label: "Scientific Style", description: "Format as a scientific number with two decimal places .", shortcut: { key: "6", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1047
|
+
J2(this, { numberFormat: "0.00E+00" });
|
|
1048
|
+
}), new R("formatNumberFormatCommaStyle", p2, { label: "Comma Style", description: "Format with a thousands separator.", shortcut: { key: ",", modifiers: [M.Ctrl] } }, function() {
|
|
1049
|
+
J2(this, { numberFormat: '_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)' });
|
|
1050
|
+
}), new R("formatNumberFormatIncreaseDecimal", p2, { label: "Increase Decimal", description: "Show more decimal places for a more precise value." }, function() {
|
|
1051
|
+
J2(this, (e3) => ({ numberFormat: t.Parser.adjustDecimalPlaces(e3.getNumberFormat(), 1) }));
|
|
1052
|
+
}), new R("formatNumberFormatDecreaseDecimal", p2, { label: "Decrease Decimal", description: "Show few decimal places." }, function() {
|
|
1053
|
+
J2(this, (e3) => ({ numberFormat: t.Parser.adjustDecimalPlaces(e3.getNumberFormat(), -1) }));
|
|
1054
|
+
}), new R("displayPlaceholdersToggle", p2, { label: "Display Placeholders", description: "Switch between hiding objects, displaying objects, and displaying placeholders for objects.", shortcut: { key: "6", modifiers: [M.Ctrl] } }), new k("noOp", p2, { label: "Do nothing", description: "Do Nothing.", shortcut: { key: "7", modifiers: [M.Ctrl] } }, function() {
|
|
1055
|
+
}), new R("displayOutlineSymbolsToggle", p2, { label: "Display Outline Symbols", description: "Display or hide the outline symbols.", shortcut: { key: "8", modifiers: [M.Ctrl] } }), new R("hideRows", p2, { label: "Hide Rows", description: "Hide the rows.", shortcut: { key: "9", modifiers: [M.Ctrl] } }), new R("unhideRows", p2, { label: "Unhide Rows", description: "Unhide the rows.", shortcut: { key: "(", modifiers: [M.Ctrl, M.Shift] } }), new R("hideColumns", p2, { label: "Hide Columns", description: "Hide the columns.", shortcut: [{ key: "0", modifiers: [M.Ctrl] }, { key: "0", modifiers: [M.Ctrl, M.Alt] }] }), new R("unhideColumns", p2, { label: "Unhide Columns", description: "Unhide the columns.", shortcut: { key: ")", modifiers: [M.Ctrl, M.Shift] } }), new R("quickFormulaSum", p2, { label: "Quick Sum", scopedLabels: { quickFormula: "Sum" }, description: "Quick sum of the cells.", shortcut: { key: "=", modifiers: [M.Alt] } }, function() {
|
|
1056
|
+
me2(this, "SUM");
|
|
1057
|
+
}), new R("quickFormulaAverage", p2, { label: "Quick Average", scopedLabels: { quickFormula: "Average" }, description: "Quick average of the cells." }, function() {
|
|
1058
|
+
me2(this, "AVERAGE");
|
|
1059
|
+
}), new R("quickFormulaCount", p2, { label: "Quick Count", scopedLabels: { quickFormula: "Count Numbers" }, description: "Quick count of the cells." }, function() {
|
|
1060
|
+
me2(this, "COUNT");
|
|
1061
|
+
}), new R("quickFormulaMax", p2, { label: "Quick Max", scopedLabels: { quickFormula: "Max" }, description: "Quick maximum of the cells." }, function() {
|
|
1062
|
+
me2(this, "MAX");
|
|
1063
|
+
}), new R("quickFormulaMin", p2, { label: "Quick Min", scopedLabels: { quickFormula: "Min" }, description: "Quick minimum of the cells." }, function() {
|
|
1064
|
+
me2(this, "MIN");
|
|
1065
|
+
}), new R("startEditCurrentTime", p2, { label: "Current Time", description: "Insert the current time.", shortcut: { key: "Semicolon", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1066
|
+
A2?.({ text: r2.createTemporaryCell({ value: Ze(), style: { numberFormat: "Medium Time" } }).toText() });
|
|
1067
|
+
}), new R("startEditCurrentDate", p2, { label: "Current Date", description: "Insert the current date.", shortcut: { key: "Semicolon", modifiers: [M.Ctrl] } }, function() {
|
|
1068
|
+
A2?.({ text: r2.createTemporaryCell({ value: Ze(), style: { numberFormat: "Short Date" } }).toText() });
|
|
1069
|
+
}), new k("sheetZoomOut", p2, { label: "Zoom Out", description: "Zoom out to see less detail but more area.", shortcut: [{ key: "-", modifiers: [M.Ctrl, M.Alt] }, { key: "NumpadSubtract", modifiers: [M.Ctrl, M.Alt] }] }), new k("sheetZoomIn", p2, { label: "Zoom In", description: "Zoom in to see more detail but less area.", shortcut: [{ key: "=", modifiers: [M.Ctrl, M.Alt] }, { key: "NumpadAdd", modifiers: [M.Ctrl, M.Alt] }] }), new k("sheetZoom100", p2, { label: "Zoom 100%", description: "Zoom document to 100%.", shortcut: { key: "o", modifiers: [M.Ctrl, M.Alt] } }), new R("insertFunction", p2, { label: "Insert Function", disabled: true, scopedLabels: { insert: "Function", quickFormula: "More Functions..." }, description: "Work with the formula in the current cell.", shortcut: { key: "F3", modifiers: [M.Shift] } }, function(e3, t2) {
|
|
1070
|
+
console.log("insertFunction");
|
|
1071
|
+
}), new R("updateHyperlink", p2, { label: "Link", scopedLabels: { contextMenu: "Insert Link…", insert: "Link…", hyperlink: "Edit" }, description: "Create a hyperlink to either another webpage or another location within this document.", context: () => X2, shortcut: [{ key: "K", modifiers: [M.Ctrl] }, { key: "K", modifiers: [M.Ctrl, M.Alt] }] }, async function(e3, t2) {
|
|
1072
|
+
const o2 = this, n2 = { context: t2.context(), onUpdateHyperlink: (e4, t3) => {
|
|
1073
|
+
ee2(o2, e4, t3);
|
|
1074
|
+
} };
|
|
1075
|
+
f2.showWindow?.("hyperlink", n2);
|
|
1076
|
+
}), new R("openHyperlink", p2, { label: "Open Link", scopedLabels: { hyperlink: "Open" }, shortcut: { key: "Enter", modifiers: [M.Ctrl] }, description: "Open the hyperlink or goto another location within this document.", context: () => X2 }, async (e3, t2) => {
|
|
1077
|
+
const o2 = t2.context()();
|
|
1078
|
+
if (!o2) return;
|
|
1079
|
+
const n2 = o2.getHyperlink();
|
|
1080
|
+
if (n2) try {
|
|
1081
|
+
await n2.open();
|
|
1082
|
+
} catch (e4) {
|
|
1083
|
+
f2?.showError?.(e4);
|
|
1084
|
+
}
|
|
1085
|
+
}), new R("deleteHyperlink", p2, { label: "Delete Link", scopedLabels: { hyperlink: "Delete" }, description: "Remove the hyperlink.", context: () => X2 }, function(e3, t2) {
|
|
1086
|
+
ee2(this, null, null);
|
|
1087
|
+
}), new k("insertNote", p2, { label: "Insert Note", scopedLabels: { contextMenu: "Insert Note…", insert: "Note" }, shortcut: { key: "F2", modifiers: [M.Shift] }, description: "Add a note to the cell." }, (e3, t2) => {
|
|
1088
|
+
((e4, t3) => {
|
|
1089
|
+
e4?.showMessage?.(Z("p", { style: { marginTop: "0px", marginBottom: "0px" }, children: [t3, " is not yet implemented.", G("br", {}), G("br", {}), "Please see the ", G("a", { style: { whiteSpace: "nowrap" }, href: "https://www.sheetxl.com/docs/introduction/roadmap", target: "_blank", rel: "noopener", children: "SheetXL Roadmap" }), "."] }));
|
|
1090
|
+
})(f2, t2.label());
|
|
1091
|
+
}), new R("updateComments", p2, { label: "Comments", scopedLabels: { contextMenu: "Insert Comments…", insert: "Comments…" }, shortcut: { key: "M", modifiers: [M.Ctrl, M.Alt] }, description: "Add a comment to the current cell.", context: () => X2 }, async function(e3, t2) {
|
|
1092
|
+
const o2 = this, n2 = { context: t2.context(), onUpdateComments: (e4) => {
|
|
1093
|
+
ne2(o2, e4);
|
|
1094
|
+
} };
|
|
1095
|
+
f2.showWindow?.("comments", n2);
|
|
1096
|
+
}), new R("deleteComments", p2, { label: "Delete Comments", description: "Remove any comments.", context: () => X2 }, function(e3, t2) {
|
|
1097
|
+
ne2(this, null);
|
|
1098
|
+
}), new R("insertImageFromFile", p2, { label: "Insert Image", scopedLabels: { contextMenu: "Insert Image…", insert: "Image…", insertImage: "From Device…" }, description: "Insert a picture from your device." }, async function(e3 = null) {
|
|
1099
|
+
let t2 = null, o2 = null;
|
|
1100
|
+
"string" == typeof e3 ? o2 = e3 : t2 = e3?.file ? e3.file : e3, (t2 || (t2 = await K.openFileDialog(o2 ?? "image/*"), t2)) && await ke2(this, { file: t2 }, e3?.options);
|
|
1101
|
+
}), new R("insertImageFromURL", p2, { label: "Insert Image From Web", scopedLabels: { insert: "Image From Web", insertImage: "From the Web…" }, description: "Insert a picture from the web." }, async function(e3) {
|
|
1102
|
+
if (!e3) {
|
|
1103
|
+
const t2 = await f2?.showInputOptions?.({ title: "Insert Image from Web", description: "Enter the web address for the image to insert.", inputLabel: "Address", initialValue: "https://picsum.photos/360", inputProps: { style: { minWidth: "440px" } }, options: ["Insert"] });
|
|
1104
|
+
if ("Insert" !== t2.option) return;
|
|
1105
|
+
e3 = t2.input;
|
|
1106
|
+
}
|
|
1107
|
+
e3 && ke2(this, { fetch: e3 });
|
|
1108
|
+
}), new k("insertTable", p2, { label: "Insert Table", scopedLabels: { contextMenu: "Insert Table…", insert: "Table" }, description: "Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.", shortcut: [{ key: "L", modifiers: [M.Ctrl] }, { key: "T", modifiers: [M.Alt, M.Ctrl] }] }, function() {
|
|
1109
|
+
pe2(this);
|
|
1110
|
+
}), new R("editTable", p2, { label: "Edit Table…", scopedLabels: { table: "Edit…", namedItem: "Edit…" }, description: "Edit the table to adjust formatting, sorting, filtering, or other advanced features." }, function(e3) {
|
|
1111
|
+
let t2 = null, o2 = false;
|
|
1112
|
+
e3.isITable ? t2 = e3 : e3.getValue() && (t2 = e3.getValue(), o2 = true), qe2(this, t2, o2);
|
|
1113
|
+
}), new R("deleteTable", p2, { label: "Delete Table", scopedLabels: { delete: "Table", table: "Delete", namedItem: "Delete" }, description: "Remove the table.\n\nThe table and table specific styling will be removed but the values will be preserved." }, function(e3) {
|
|
1114
|
+
ve2(this, e3, true);
|
|
1115
|
+
}), new R("convertTableToRange", p2, { label: "Convert To Range", description: "Convert the table into a normal range of cells.\n\nThe values and the formatting are preserved." }, function(e3) {
|
|
1116
|
+
ve2(this, e3, false);
|
|
1117
|
+
}), new R("tableTotalRowToggle", p2, { label: "Toggle Table Total Row", description: "Toggle Total Row on/off.", scopedLabels: { table: "Total Row" }, shortcut: { key: "T", modifiers: [M.Ctrl, M.Alt] } }, function() {
|
|
1118
|
+
const e3 = this.context().table();
|
|
1119
|
+
e3 && e3.setShowTotals(!e3.getShowTotals());
|
|
1120
|
+
}), new R("tableHeaderRowToggle", p2, { label: "Toggle Table Header Row", description: "Toggle Header Row on/off.", scopedLabels: { table: "Header Row" } }, function() {
|
|
1121
|
+
const e3 = this.context().table();
|
|
1122
|
+
e3 && e3.setShowHeaders(!e3.getShowHeaders());
|
|
1123
|
+
}), new R("autoFilterToggle", p2, { label: "Toggle Filter", scopedLabels: { filter: "Filter" }, description: "Toggle Auto Filter on/off.", shortcut: { key: "L", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1124
|
+
const e3 = this.context().table();
|
|
1125
|
+
e3 && e3.setShowFilterButton(!e3.getShowFilterButton());
|
|
1126
|
+
}), new R("autoFilterReapply", p2, { label: "Reapply Filter", scopedLabels: { filter: "Reapply" }, description: "Reapply the filter and sort with the latest changes.", shortcut: { key: "L", modifiers: [M.Ctrl, M.Alt] } }), new R("autoFilterClear", p2, { label: "Clear Filter", scopedLabels: { filter: "Clear" }, description: "Clear the filters criteria from the current filter.." }), new k("startEditValueAbove", p2, { label: "Copy From Above", description: "Copy the value from the cell above the active cell into the cell or the formula bar.", shortcut: [{ key: "Quote", modifiers: [M.Ctrl] }, { key: '"', modifiers: [M.Ctrl, M.Shift] }] }, Me2), new R("formatPainterToggle", p2, { label: "Format Painter", description: "Apply style to another part of your workbook." }), new k("insertCells", p2, { label: "Insert Cells", scopedLabels: { insertCells: "At Selection" }, description: "Inserts cells at the current selection.", shortcut: { key: "=", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1127
|
+
de2(this);
|
|
1128
|
+
}), new k("insertCellsShiftRight", p2, { label: "Insert Cells (Shift Right)", scopedLabels: { insertCells: "Shift Right" }, description: "Insert cells to the left and shift the current cells to the right." }, function() {
|
|
1129
|
+
de2(this, s.Orientation.Column);
|
|
1130
|
+
}), new k("insertCellsShiftDown", p2, { label: "Insert Cells (Shift Down)", scopedLabels: { insertCells: "Shift Down" }, description: "Insert cells above and shift the current cells downward." }, function() {
|
|
1131
|
+
return de2(this, s.Orientation.Row);
|
|
1132
|
+
}), new k("insertRows", p2, { label: "Insert Row(s)", scopedLabels: { insertCells: "Row(s)" }, description: "Insert a row above the current position." }, function() {
|
|
1133
|
+
return de2(this, s.Orientation.Row, true);
|
|
1134
|
+
}), new k("insertColumns", p2, { label: "Insert Column(s)", scopedLabels: { insertCells: "Column(s)" }, description: "Insert a column before the current position." }, function() {
|
|
1135
|
+
return de2(this, s.Orientation.Column, true);
|
|
1136
|
+
}), new k("insertRowsAfter", p2, { label: "Insert Row Below", scopedLabels: { insertCells: "Row Below" }, description: "Insert a row below the current position." }, function() {
|
|
1137
|
+
return de2(this, s.Orientation.Row, true, true);
|
|
1138
|
+
}), new k("insertColumnsAfter", p2, { label: "Insert Column After", scopedLabels: { insertCells: "Column After" }, description: "Insert a column after the current position." }, function() {
|
|
1139
|
+
return de2(this, s.Orientation.Column, true, true);
|
|
1140
|
+
}), new k("deleteCells", p2, { label: "Delete Cells", scopedLabels: { deleteCells: "At Selection" }, description: "Delete the cells.", shortcut: { key: "-", modifiers: [M.Ctrl] } }, function() {
|
|
1141
|
+
return xe2(this);
|
|
1142
|
+
}), new k("deleteCellsShiftUp", p2, { label: "Delete Cells (Shift Up)", scopedLabels: { deleteCells: "Shift up" }, description: "Delete cells the current current downward." }, function() {
|
|
1143
|
+
return xe2(this, s.Orientation.Row);
|
|
1144
|
+
}), new k("deleteCellsShiftLeft", p2, { label: "Delete Cells (Shift Left)", scopedLabels: { deleteCells: "Shift Left" }, description: "Delete cells the current cells to the right." }, function() {
|
|
1145
|
+
return xe2(this, s.Orientation.Column);
|
|
1146
|
+
}), new k("deleteRows", p2, { label: "Delete Rows", scopedLabels: { deleteCells: "Rows" }, description: "Delete the rows at the current selection." }, function() {
|
|
1147
|
+
return xe2(this, s.Orientation.Row, true);
|
|
1148
|
+
}), new k("deleteColumns", p2, { label: "Delete Columns", scopedLabels: { deleteCells: "Columns" }, description: "Delete the columns at the current selection." }, function() {
|
|
1149
|
+
return xe2(this, s.Orientation.Column, true);
|
|
1150
|
+
}), new k("flashFill", p2, { label: "Flash Fill", description: "Do a flash fill.", shortcut: [{ key: "e", modifiers: [M.Ctrl] }, { key: "e", modifiers: [M.Ctrl, M.Alt] }] }), new k("fillDown", p2, { label: "Fill Down", description: "Copy the top-most value from the selection to the bottom of the selection.", shortcut: { key: "d", modifiers: [M.Ctrl] } }, function() {
|
|
1151
|
+
return Re2(this, s.Direction.Down);
|
|
1152
|
+
}), new k("fillRight", p2, { label: "Fill Right", description: "Copy the left-most value from the selection to the right of the selection.", shortcut: [{ key: "r", modifiers: [M.Ctrl] }] }, function() {
|
|
1153
|
+
return Re2(this, s.Direction.Right);
|
|
1154
|
+
}), new k("fillUp", p2, { label: "Fill Up", description: "Copy the bottom-most value from the selection to the top of the selection." }, function() {
|
|
1155
|
+
return Re2(this, s.Direction.Up);
|
|
1156
|
+
}), new k("fillLeft", p2, { label: "Fill Left", description: "Copy the right-most value from the selection to the left of the selection." }, function() {
|
|
1157
|
+
return Re2(this, s.Direction.Left);
|
|
1158
|
+
}), new k("formatBorderAddOutline", p2, { label: "Add Outline Border", description: "Apply an outline border.", shortcut: { key: "7", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1159
|
+
return J2(this, { border: { left: { style: n.StrokeStyle.Thin, color: null }, top: { style: n.StrokeStyle.Thin, color: null }, right: { style: n.StrokeStyle.Thin, color: null }, bottom: { style: n.StrokeStyle.Thin, color: null } } });
|
|
1160
|
+
}), new k("formatBorderClearOutline", p2, { label: "Remove Outline Border", description: "Remove the outline border.", shortcut: { key: "_", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1161
|
+
return J2(this, { border: null });
|
|
1162
|
+
}), new k("formatIndentDecrease", p2, { label: "Decrease Indent", description: "Move your content closer to the border." }, function() {
|
|
1163
|
+
return J2(this, (e3) => {
|
|
1164
|
+
const t2 = e3.getAlignment().getIndent() - 1;
|
|
1165
|
+
return { alignment: { indent: t2 > 0 ? t2 : 0 } };
|
|
1166
|
+
});
|
|
1167
|
+
}), new k("formatIndentIncrease", p2, { label: "Increase Indent", description: "Move your content further from the border." }, function() {
|
|
1168
|
+
return J2(this, (e3) => {
|
|
1169
|
+
const t2 = { alignment: { indent: e3.getAlignment().getIndent() + 1 } };
|
|
1170
|
+
return e3.getAlignment().getHorizontal() === l.HorizontalAlignment.General && (t2.alignment.horizontal = l.HorizontalAlignment.Left), t2;
|
|
1171
|
+
});
|
|
1172
|
+
}), new R("mergeToggle", p2, { label: "Merge", description: "Combine and center the contents into a single cell.", shortcut: { key: "m", modifiers: [M.Ctrl] } }), new k("mergeHorizontal", p2, { label: "Merge Horizontally", description: "Combine the contents into horizontal rows." }), new k("mergeVertical", p2, { label: "Merge Vertically", description: "Combine the contents into vertical columns." }), new k("unmerge", p2, { label: "Unmerge", description: "Split merged cells into multiple cells." }), new k("clearContents", p2, { label: "Clear Contents", scopedLabels: { clear: "Contents" }, description: "Clear only the contents in the cells.\n\nThe formatting is not cleared.", shortcut: { key: "Delete" } }, function() {
|
|
1173
|
+
ie2(this, o.Content.Values);
|
|
1174
|
+
}), new k("clearFormats", p2, { label: "Clear Formats", scopedLabels: { clear: "Formats" }, description: "Clear only the formatting that is applied to the cells." }, function() {
|
|
1175
|
+
ie2(this, o.Content.Formats);
|
|
1176
|
+
}), new k("clearHyperlinks", p2, { label: "Clear Hyperlinks", scopedLabels: { clear: "Hyperlinks" }, description: "Clear only the hyperlinks in the cells." }, function() {
|
|
1177
|
+
ie2(this, o.Content.Hyperlinks);
|
|
1178
|
+
}), new k("clearComments", p2, { label: "Clear Comments", scopedLabels: { clear: "Comments" }, description: "Clear the comments from the cells." }, function() {
|
|
1179
|
+
ie2(this, o.Content.Comments);
|
|
1180
|
+
}), new k("clearAll", p2, { label: "Clear All", scopedLabels: { clear: "All" }, description: "Clears everything from the cells.\n\nAll contents and formatting are removed.", shortcut: { key: "Delete", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
1181
|
+
ie2(this);
|
|
1182
|
+
}), new R("freezeToggle", p2, { label: "Freeze Panes", description: "Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)." }), new R("freezeToggleHorizontal", p2, { label: "Freeze Top Rows", description: "Keep the top rows visible while scrolling through the rest of the sheet." }), new R("freezeToggleVertical", p2, { label: "Freeze Left Columns", description: "Keep the left columns visible while scrolling through the rest of the sheet." }), new k("unfreeze", p2, { label: "Unfreeze Panes", description: "Unfreeze both the rows and columns." }), new k("autoFitRows", p2, { label: "Autofit Rows", description: "Adjust the rows to the best height." }), new k("autoFitColumns", p2, { label: "Autofit Columns", description: "Adjust the columns to the best width." })], []), Ie2 = te(() => {
|
|
1183
|
+
let e3 = null;
|
|
1184
|
+
return e3 = h2 ? h2.createChildGroup(p2, "sheet", false) : new T(p2, "sheet"), e3.addCommands(De2, true), e3;
|
|
1185
|
+
}, [h2, De2]), [Ve2, Ne2] = oe(false), [Le2, He2] = oe(false);
|
|
1186
|
+
re(() => {
|
|
1187
|
+
if (x2.current !== r2 || !C2) return;
|
|
1188
|
+
const e3 = C2.getCoords(), t2 = r2.getTables().search({ address: e3[0] });
|
|
1189
|
+
U2((e4) => K.isEqualArrays(e4, t2) ? e4 : t2), v2 && t2[0] && Q.isCellWithinRange(v2, t2[0].getRange().getCoords()) ? ge2(t2[0] ?? null) : ge2(null);
|
|
1190
|
+
const o2 = r2.getSelectedRanges(), n2 = o2.getMerges().length > 0, l2 = o2.isOverlapping();
|
|
1191
|
+
let i3 = true;
|
|
1192
|
+
for (let t3 = 0; i3 && t3 < e3.length; t3++) i3 = Q.isSingleCell(e3[t3]);
|
|
1193
|
+
He2(l2), Ne2(0 === t2.length && !l2 && (n2 || !i3));
|
|
1194
|
+
}, [Fe2, C2, r2]), D(h2, null, { onChange: () => {
|
|
1195
|
+
const e3 = "formatPainter" === P2.getMode()?.key;
|
|
1196
|
+
Ie2.getCommand("formatPainterToggle").update({ disabled: !h2?.getCommand("copy"), state: () => e3 }).updateCallback(() => {
|
|
1197
|
+
if (e3) return void P2.setMode(null);
|
|
1198
|
+
return Ie2.getCommand("copy").execute({ editMode: { key: "formatPainter", description: "Use the mouse to apply the copied format to another selection.", cursor: `url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer` } });
|
|
1199
|
+
});
|
|
1200
|
+
} }, [P2, Ae2, h2]), Ct(r2.getView(), { onFreezeSplitChange: () => {
|
|
1201
|
+
Ee2();
|
|
1202
|
+
} }), Ct(r2.getSelection(), { onChange: () => {
|
|
1203
|
+
j2();
|
|
1204
|
+
} });
|
|
1205
|
+
const Be2 = () => {
|
|
1206
|
+
Ie2.getCommand("sheetViewFormatGridlinesColor").update({ state: () => r2.getView().getGridLineColor(), context: () => ({ onColorSelect: (e3) => {
|
|
1207
|
+
}, darkMode: d2.darkMode, autoColor: r2.getStyles().parseColor(d2.strokeFill), schemeLookup: r2.getStyles().schemeLookup(), recentColors: () => r2.getStyles().recentColors(), addRecentColor: (e3) => r2.getStyles().addRecentColor(e3), clearRecentColors: () => r2.getStyles().clearRecentColors() }) }), Ie2.getCommand("formatSheetTabColor").updateCallback((e3) => {
|
|
1208
|
+
r2.setTabColor(e3);
|
|
1209
|
+
}).update({ state: () => r2?.getTabColor() ?? St, context: () => ({ onColorSelect: (e3) => {
|
|
1210
|
+
}, darkMode: d2.darkMode, autoColor: St, schemeLookup: r2.getStyles().schemeLookup(), recentColors: () => r2.getStyles().recentColors(), addRecentColor: (e3) => r2.getStyles().addRecentColor(e3), clearRecentColors: () => r2.getStyles().clearRecentColors() }) });
|
|
1211
|
+
}, Oe2 = () => {
|
|
1212
|
+
Ie2.getCommand("formatBorder").update({ context: () => ({ onBorderSelect: (e3) => {
|
|
1213
|
+
N2(e3);
|
|
1214
|
+
}, darkMode: d2.darkMode, quickBorder: V2, autoColor: r2.getStyles().getNormal().getFont().getFill(), autoStyle: n.StrokeStyle.Thin, createTemporaryBorder: (e3) => r2.getStyles().getNormal().createTemporaryStyle({ border: e3 }).getBorder(), schemeLookup: r2.getStyles().schemeLookup() }) });
|
|
1215
|
+
};
|
|
1216
|
+
re(() => {
|
|
1217
|
+
Oe2();
|
|
1218
|
+
}, [V2]), re(() => {
|
|
1219
|
+
const e3 = !r2.getProtection().isInsertHyperlinksAllowed();
|
|
1220
|
+
Ie2.getCommand("openHyperlink").update({ disabled: !X2().getHyperlink() }), Ie2.getCommand("deleteHyperlink").update({ disabled: e3 || !X2().getHyperlink() });
|
|
1221
|
+
const t2 = X2().getHyperlink() ? "Edit" : "Insert", o2 = "Link";
|
|
1222
|
+
Ie2.getCommand("updateHyperlink").update({ label: () => (X2().getHyperlink(), `${t2} ${o2}`), scopedLabels: { contextMenu: `${t2} ${o2}…`, insert: `${o2}…`, hyperlink: `${t2}…` }, disabled: e3 });
|
|
1223
|
+
}, [X2()?.getHyperlink(), Ae2]), re(() => {
|
|
1224
|
+
const e3 = X2().getComments(), t2 = () => e3 ? "Edit" : "Insert", o2 = () => e3 ? "Comments" : "Comment";
|
|
1225
|
+
Ie2.getCommand("updateComments").update({ label: () => `${t2()} ${o2()}`, scopedLabels: { contextMenu: `${t2()} ${o2()}…`, insert: `${o2()}…` } });
|
|
1226
|
+
}, [X2()?.getComments(), Ae2]), Ct(r2, { onViewChange: () => {
|
|
1227
|
+
const e3 = r2.getView();
|
|
1228
|
+
Ie2.getCommand("sheetViewToggleFormulaView").update({ state: e3.isShowFormulas() }), Ie2.getCommand("sheetViewToggleShowZeros").update({ state: e3.isShowZeros() }), Ie2.getCommand("gridlinesToggle").update({ state: e3.isShowColumnGridlines() || e3.isShowRowGridlines() }), Ie2.getCommand("sheetViewToggleGridlinesColumns").update({ state: e3.isShowColumnGridlines() }), Ie2.getCommand("sheetViewToggleGridlinesRows").update({ state: e3.isShowRowGridlines() }), Ie2.getCommand("sheetViewToggleShowHeadings").update({ state: e3.isShowColumnHeaders() || e3.isShowRowHeaders() }), Ie2.getCommand("sheetViewToggleShowHeadingColumns").update({ state: e3.isShowColumnHeaders() }), Ie2.getCommand("sheetViewToggleShowHeadingRows").update({ state: e3.isShowRowHeaders() }), Ie2.getCommand("sheetViewToggleShowHeadingsNumeric").update({ state: () => r2.getView().getColumnHeaderStyle() === u.HeaderTextStyle.Zero && r2.getView().getRowHeaderStyle() === u.HeaderTextStyle.Zero }), Be2();
|
|
1229
|
+
}, onTabColorChange: () => {
|
|
1230
|
+
Be2();
|
|
1231
|
+
}, onMergesChange: () => {
|
|
1232
|
+
Ee2();
|
|
1233
|
+
}, onMovablesChange: () => {
|
|
1234
|
+
Ee2();
|
|
1235
|
+
}, onTablesChange: () => {
|
|
1236
|
+
Ee2();
|
|
1237
|
+
}, onProtectionChange: () => {
|
|
1238
|
+
Ee2(), ze2();
|
|
1239
|
+
}, onStyleChange: () => {
|
|
1240
|
+
Be2(), Oe2(), Ee2();
|
|
1241
|
+
} }), re(() => {
|
|
1242
|
+
Be2(), Oe2();
|
|
1243
|
+
}, [d2]), re(() => {
|
|
1244
|
+
const e3 = !r2.getProtection().isFormatCellsAllowed(), t2 = W2.length > 0 && !ce2 || e3, o2 = we2(ce2), n2 = { context: o2 };
|
|
1245
|
+
Ie2.getCommand("editTable").update(n2), Ie2.getCommand("deleteTable").update(n2), Ie2.getCommand("convertTableToRange").update(n2);
|
|
1246
|
+
const l2 = { context: o2, disabled: t2 };
|
|
1247
|
+
Ie2.getCommand("formatTableStyle").update({ label: ce2 ? "Apply Table Style" : "Format As Table", ...l2 }), Ie2.getCommand("formatTableStyleClearCellStyles").update(l2), Ie2.getCommand("deleteTableStyle").update(l2), Ie2.getCommand("convertTableToRange").update(l2), Ie2.getCommand("insertTable").update({ disabled: t2 || W2.length > 0 });
|
|
1248
|
+
const i3 = { context: o2, disabled: t2 || 0 === W2.length };
|
|
1249
|
+
Ie2.getCommand("tableHeaderRowToggle").update(i3), Ie2.getCommand("tableTotalRowToggle").update(i3), Ie2.getCommand("autoFilterToggle").update(i3), Ie2.getCommand("formatTableStyleClearTableStyle").update({ ...i3, disabled: i3.disabled || !ce2 || null === ce2.getStyleOptions().name });
|
|
1250
|
+
}, [ce2, W2, Ae2]), re(() => {
|
|
1251
|
+
Ie2.getCommand("sheetZoomOut").updateCallback(() => {
|
|
1252
|
+
r2.getView().update({ zoomScale: K.findNextStep(r2.getView().getZoomScale(), false) });
|
|
1253
|
+
}), Ie2.getCommand("sheetZoomIn").updateCallback(() => {
|
|
1254
|
+
r2.getView().update({ zoomScale: K.findNextStep(r2.getView().getZoomScale()) });
|
|
1255
|
+
}), Ie2.getCommand("sheetZoom100").updateCallback(() => {
|
|
1256
|
+
r2.getView().update({ zoomScale: 100 });
|
|
1257
|
+
}), Ie2.getCommand("gridlinesToggle").updateCallback(() => {
|
|
1258
|
+
const e3 = r2.getView().isShowColumnGridlines() && r2.getView().isShowRowGridlines();
|
|
1259
|
+
r2.getView().update({ showColumnGridlines: !e3, showRowGridlines: !e3 });
|
|
1260
|
+
}), Ie2.getCommand("sheetViewToggleGridlinesRows").updateCallback(() => {
|
|
1261
|
+
r2.getView().update({ showRowGridlines: !r2.getView().isShowRowGridlines() });
|
|
1262
|
+
}), Ie2.getCommand("sheetViewToggleGridlinesColumns").updateCallback(() => {
|
|
1263
|
+
r2.getView().update({ showColumnGridlines: !r2.getView().isShowColumnGridlines() });
|
|
1264
|
+
}), Ie2.getCommand("sheetViewFormatGridlinesColor").updateCallback((e3) => {
|
|
1265
|
+
r2.getView().update({ gridLineColor: e3 });
|
|
1266
|
+
}), Ie2.getCommand("sheetViewToggleShowHeadings").updateCallback(() => {
|
|
1267
|
+
const e3 = r2.getView().isShowColumnHeaders() && r2.getView().isShowRowHeaders();
|
|
1268
|
+
r2.getView().update({ showColumnHeaders: !e3, showRowHeaders: !e3 });
|
|
1269
|
+
}), Ie2.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(() => {
|
|
1270
|
+
r2.getView().update({ showColumnHeaders: !r2.getView().isShowColumnHeaders() });
|
|
1271
|
+
}), Ie2.getCommand("sheetViewToggleShowHeadingRows").updateCallback(() => {
|
|
1272
|
+
r2.getView().update({ showRowHeaders: !r2.getView().isShowRowHeaders() });
|
|
1273
|
+
}), Ie2.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(() => {
|
|
1274
|
+
const e3 = r2.getView().getColumnHeaderStyle() === u.HeaderTextStyle.Zero && r2.getView().getRowHeaderStyle() === u.HeaderTextStyle.Zero;
|
|
1275
|
+
r2.getView().update({ columnHeaderStyle: e3 ? u.HeaderTextStyle.A1 : u.HeaderTextStyle.Zero, rowHeaderStyle: e3 ? u.HeaderTextStyle.One : u.HeaderTextStyle.Zero });
|
|
1276
|
+
}), Ie2.getCommand("sheetViewToggleFormulaView").updateCallback(() => {
|
|
1277
|
+
r2.getView().update({ showFormulas: !r2.getView().isShowFormulas() });
|
|
1278
|
+
}), Ie2.getCommand("sheetViewToggleShowZeros").updateCallback(() => {
|
|
1279
|
+
r2.getView().update({ showZeros: !r2.getView().isShowZeros() });
|
|
1280
|
+
});
|
|
1281
|
+
}, [r2]), re(() => {
|
|
1282
|
+
const e3 = r2.getView().getFreezePanes(), t2 = () => 0 !== e3.coords.rowIndex, o2 = () => 0 !== e3.coords.colIndex, n2 = () => 0 !== e3.coords.rowIndex || 0 !== e3.coords.colIndex;
|
|
1283
|
+
Ie2.getCommand("freezeToggle").updateCallback(() => {
|
|
1284
|
+
n2() ? r2.getView().setFreezePanes(null) : n2() ? o2() ? r2.getView().setFreezePanes({ coords: { rowIndex: v2.rowIndex } }) : t2() && r2.getView().setFreezePanes({ coords: { colIndex: v2.colIndex } }) : r2.getView().setFreezePanes({ coords: v2 });
|
|
1285
|
+
}).update({ state: n2, disabled: () => !v2 || !n2() && 0 === v2.rowIndex && 0 === v2.colIndex }), Ie2.getCommand("freezeToggleHorizontal").updateCallback(() => {
|
|
1286
|
+
r2.getView().setFreezePanes({ coords: { rowIndex: t2() ? 0 : v2.rowIndex } });
|
|
1287
|
+
}).update({ state: t2, disabled: () => !v2 || !t2() && 0 === v2.rowIndex }), Ie2.getCommand("freezeToggleVertical").updateCallback(() => {
|
|
1288
|
+
r2.getView().setFreezePanes({ coords: { colIndex: o2() ? 0 : v2.colIndex } });
|
|
1289
|
+
}).update({ state: o2, disabled: () => !v2 || !o2() && 0 === v2.colIndex }), Ie2.getCommand("unfreeze").updateCallback(() => {
|
|
1290
|
+
r2.getView().setFreezePanes(null);
|
|
1291
|
+
}).update({ disabled: () => !n2() });
|
|
1292
|
+
}, [Fe2, v2, r2, d2]);
|
|
1293
|
+
const Pe2 = X2().getStyle(), $e2 = Pe2.getFont(), We2 = Pe2.getAlignment(), Ue2 = We2.getHorizontal(), _e2 = We2.getVertical(), Ge2 = We2.getOverflow(), je2 = We2.getRotation();
|
|
1294
|
+
return re(() => {
|
|
1295
|
+
Ie2.getCommand("formatCellStyle").update({ context: () => ({ styles: () => r2.getStyles(), named: () => X2().getStyle(true).getNamed(), bodyStyle: fe2, createTemporaryCell: (e4) => r2.createTemporaryCell(e4) }) }), Ie2.getCommand("formatFillColor").update({ state: () => {
|
|
1296
|
+
let e4 = null;
|
|
1297
|
+
const t3 = Pe2.getFill();
|
|
1298
|
+
return t3?.getType() === m.Type.Solid ? e4 = t3.getColor() : t3?.getType() === m.Type.Gradient ? e4 = t3.getStops()?.[0]?.getColor() : t3?.getType() === m.Type.Pattern && (e4 = t3.getBackground()), e4;
|
|
1299
|
+
}, context: () => {
|
|
1300
|
+
const e4 = r2.getStyles();
|
|
1301
|
+
return { onColorSelect: (e5) => {
|
|
1302
|
+
H2(e5 ?? St);
|
|
1303
|
+
}, darkMode: d2.darkMode, quickColor: L2, autoColor: St, schemeLookup: e4.schemeLookup(), recentColors: e4.recentColors(), addRecentColor: (t3) => e4.addRecentColor(t3), clearRecentColors: () => e4.clearRecentColors() };
|
|
1304
|
+
} }), Ie2.getCommand("formatFontColor").update({ state: () => $e2.toJSON()?.fill ? $e2.getFill() : null, context: () => {
|
|
1305
|
+
const e4 = r2.getStyles();
|
|
1306
|
+
return { onColorSelect: (e5) => {
|
|
1307
|
+
O2(e5);
|
|
1308
|
+
}, darkMode: d2.darkMode, quickColor: B2, autoColor: e4.getNormal().getFont().getFill(), schemeLookup: e4.schemeLookup(), recentColors: e4.recentColors(), addRecentColor: (t3) => e4.addRecentColor(t3), clearRecentColors: () => e4.clearRecentColors() };
|
|
1309
|
+
} }), Ie2.getCommand("formatNumberFormat").update({ state: () => Pe2.getNumberFormat(), context: () => X2 }), Ie2.getCommand("formatNumberDialog").update({ state: () => Pe2.getNumberFormat(), context: () => X2 }), Ie2.getCommand("formatFontFamily").update({ state: () => $e2.getFamily() }), Ie2.getCommand("formatFontSize").update({ state: () => $e2.getSize() });
|
|
1310
|
+
const e3 = function() {
|
|
1311
|
+
const e4 = $e2.getWeight() || 0;
|
|
1312
|
+
return !isNaN(e4) && e4 > 500;
|
|
1313
|
+
};
|
|
1314
|
+
Ie2.getCommand("formatBoldToggle").updateCallback(function() {
|
|
1315
|
+
J2(this, { font: { weight: e3() ? 400 : 700 } });
|
|
1316
|
+
}).update({ state: e3 });
|
|
1317
|
+
const t2 = function() {
|
|
1318
|
+
return $e2.getStyle() === a.Style.Italic;
|
|
1319
|
+
};
|
|
1320
|
+
Ie2.getCommand("formatItalicToggle").updateCallback(function() {
|
|
1321
|
+
J2(this, { font: { style: t2() ? a.Style.Normal : a.Style.Italic } });
|
|
1322
|
+
}).update({ state: t2 }), Ie2.getCommand("formatStrikeThroughToggle").updateCallback(function() {
|
|
1323
|
+
J2(this, { font: { strike: !$e2.getStrike() } });
|
|
1324
|
+
}).update({ state: $e2.getStrike() }), Ie2.getCommand("formatUnderlinedToggle").updateCallback(function() {
|
|
1325
|
+
J2(this, { font: { underline: $e2.getUnderline() !== a.UnderlineStyle.Single ? a.UnderlineStyle.Single : a.UnderlineStyle.None } });
|
|
1326
|
+
}).update({ state: $e2.getUnderline() === a.UnderlineStyle.Single }), Ie2.getCommand("formatUnderlinedDoubleToggle").updateCallback(function() {
|
|
1327
|
+
J2(this, { font: { underline: $e2.getUnderline() !== a.UnderlineStyle.Double ? a.UnderlineStyle.Double : a.UnderlineStyle.None } });
|
|
1328
|
+
}).update({ state: $e2.getUnderline() === a.UnderlineStyle.Double }), Ie2.getCommand("formatUnderlinedAccountingToggle").updateCallback(function() {
|
|
1329
|
+
J2(this, { font: { underline: $e2.getUnderline() !== a.UnderlineStyle.SingleAccounting ? a.UnderlineStyle.SingleAccounting : a.UnderlineStyle.None } });
|
|
1330
|
+
}).update({ state: $e2.getUnderline() === a.UnderlineStyle.SingleAccounting }), Ie2.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function() {
|
|
1331
|
+
J2(this, { font: { underline: $e2.getUnderline() !== a.UnderlineStyle.DoubleAccounting ? a.UnderlineStyle.DoubleAccounting : a.UnderlineStyle.None } });
|
|
1332
|
+
}).update({ state: $e2.getUnderline() === a.UnderlineStyle.DoubleAccounting }), Ie2.getCommand("formatSuperscriptToggle").updateCallback(function() {
|
|
1333
|
+
J2(this, { font: { verticalAlign: $e2.getVerticalAlignment() !== a.VerticalAlignment.Super ? a.VerticalAlignment.Super : a.VerticalAlignment.Baseline } });
|
|
1334
|
+
}).update({ state: $e2.getVerticalAlignment() === a.VerticalAlignment.Super }), Ie2.getCommand("formatSubscriptToggle").updateCallback(function() {
|
|
1335
|
+
J2(this, { font: { verticalAlign: $e2.getVerticalAlignment() !== a.VerticalAlignment.Sub ? a.VerticalAlignment.Sub : a.VerticalAlignment.Baseline } });
|
|
1336
|
+
}).update({ state: $e2.getVerticalAlignment() === a.VerticalAlignment.Sub });
|
|
1337
|
+
const o2 = () => Ge2 === l.Overflow.Visible;
|
|
1338
|
+
Ie2.getCommand("formatTextOverflowVisibleToggle").updateCallback(function() {
|
|
1339
|
+
J2(this, { alignment: { overflow: (o2(), l.Overflow.Visible) } });
|
|
1340
|
+
}).update({ state: o2 });
|
|
1341
|
+
const n2 = () => Ge2 === l.Overflow.Wrap;
|
|
1342
|
+
Ie2.getCommand("formatTextOverflowWrapToggle").updateCallback(function() {
|
|
1343
|
+
J2(this, { alignment: { overflow: n2() ? l.Overflow.Visible : l.Overflow.Wrap } });
|
|
1344
|
+
}).update({ state: n2 });
|
|
1345
|
+
const i3 = function() {
|
|
1346
|
+
return Ge2 === l.Overflow.Clip;
|
|
1347
|
+
};
|
|
1348
|
+
Ie2.getCommand("formatTextOverflowClipToggle").updateCallback(function() {
|
|
1349
|
+
J2(this, { alignment: { overflow: i3() ? l.Overflow.Visible : l.Overflow.Clip } });
|
|
1350
|
+
}).update({ state: i3 });
|
|
1351
|
+
const s2 = function() {
|
|
1352
|
+
return Ge2 === l.Overflow.Shrink;
|
|
1353
|
+
};
|
|
1354
|
+
Ie2.getCommand("formatTextOverflowShrinkToggle").updateCallback(function() {
|
|
1355
|
+
J2(this, { alignment: { overflow: s2() ? l.Overflow.Visible : l.Overflow.Shrink } });
|
|
1356
|
+
}).update({ state: s2 });
|
|
1357
|
+
const c2 = function() {
|
|
1358
|
+
return Ge2 === l.Overflow.Shrink;
|
|
1359
|
+
};
|
|
1360
|
+
Ie2.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function() {
|
|
1361
|
+
J2(this, { alignment: { overflow: c2() ? l.Overflow.Visible : l.Overflow.Ellipsis } });
|
|
1362
|
+
}).update({ state: c2, disabled: true });
|
|
1363
|
+
const g2 = function() {
|
|
1364
|
+
return _e2 === l.VerticalAlignment.Top;
|
|
1365
|
+
};
|
|
1366
|
+
Ie2.getCommand("formatAlignTopToggle").updateCallback(function() {
|
|
1367
|
+
J2(this, { alignment: { vertical: g2() ? l.VerticalAlignment.Bottom : l.VerticalAlignment.Top } });
|
|
1368
|
+
}).update({ state: g2 });
|
|
1369
|
+
const u2 = function() {
|
|
1370
|
+
return _e2 === l.VerticalAlignment.Center;
|
|
1371
|
+
};
|
|
1372
|
+
Ie2.getCommand("formatAlignMiddleToggle").updateCallback(function() {
|
|
1373
|
+
J2(this, { alignment: { vertical: u2() ? l.VerticalAlignment.Bottom : l.VerticalAlignment.Center } });
|
|
1374
|
+
}).update({ state: u2 });
|
|
1375
|
+
const h3 = function() {
|
|
1376
|
+
return _e2 === l.VerticalAlignment.Bottom;
|
|
1377
|
+
};
|
|
1378
|
+
Ie2.getCommand("formatAlignBottomToggle").updateCallback(function() {
|
|
1379
|
+
J2(this, { alignment: { vertical: (h3(), l.VerticalAlignment.Bottom) } });
|
|
1380
|
+
}).update({ state: h3 });
|
|
1381
|
+
const p3 = function() {
|
|
1382
|
+
return _e2 === l.VerticalAlignment.Justify;
|
|
1383
|
+
};
|
|
1384
|
+
Ie2.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function() {
|
|
1385
|
+
J2(this, { alignment: { vertical: p3() ? l.VerticalAlignment.Bottom : l.VerticalAlignment.Justify } });
|
|
1386
|
+
}).update({ state: p3 });
|
|
1387
|
+
const f3 = function() {
|
|
1388
|
+
return _e2 === l.VerticalAlignment.Distributed;
|
|
1389
|
+
};
|
|
1390
|
+
Ie2.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function() {
|
|
1391
|
+
J2(this, { alignment: { vertical: f3() ? l.VerticalAlignment.Bottom : l.VerticalAlignment.Distributed } });
|
|
1392
|
+
}).update({ state: f3 });
|
|
1393
|
+
const w3 = function() {
|
|
1394
|
+
return Ue2 === l.HorizontalAlignment.Left;
|
|
1395
|
+
};
|
|
1396
|
+
Ie2.getCommand("formatAlignLeftToggle").updateCallback(function() {
|
|
1397
|
+
J2(this, { alignment: { horizontal: w3() ? l.HorizontalAlignment.General : l.HorizontalAlignment.Left } });
|
|
1398
|
+
}).update({ state: w3 });
|
|
1399
|
+
const q3 = function() {
|
|
1400
|
+
return Ue2 === l.HorizontalAlignment.Center;
|
|
1401
|
+
};
|
|
1402
|
+
Ie2.getCommand("formatAlignCenterToggle").updateCallback(function() {
|
|
1403
|
+
J2(this, { alignment: { horizontal: q3() ? l.HorizontalAlignment.General : l.HorizontalAlignment.Center } });
|
|
1404
|
+
}).update({ state: q3 });
|
|
1405
|
+
const v3 = function() {
|
|
1406
|
+
return Ue2 === l.HorizontalAlignment.CenterContinuous;
|
|
1407
|
+
};
|
|
1408
|
+
Ie2.getCommand("formatAlignCenterContinuousToggle").updateCallback(function() {
|
|
1409
|
+
const e4 = { alignment: { horizontal: v3() ? l.HorizontalAlignment.General : l.HorizontalAlignment.CenterContinuous, rotation: null } };
|
|
1410
|
+
J2(this, e4);
|
|
1411
|
+
}).update({ state: v3 });
|
|
1412
|
+
const y3 = function() {
|
|
1413
|
+
return Ue2 === l.HorizontalAlignment.Fill;
|
|
1414
|
+
};
|
|
1415
|
+
Ie2.getCommand("formatAlignFillToggle").updateCallback(function() {
|
|
1416
|
+
const e4 = { alignment: { horizontal: y3() ? l.HorizontalAlignment.General : l.HorizontalAlignment.Fill, rotation: null } };
|
|
1417
|
+
J2(this, e4);
|
|
1418
|
+
}).update({ state: y3 });
|
|
1419
|
+
const C3 = function() {
|
|
1420
|
+
return Ue2 === l.HorizontalAlignment.Distributed;
|
|
1421
|
+
};
|
|
1422
|
+
Ie2.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function() {
|
|
1423
|
+
J2(this, { alignment: { horizontal: C3() ? l.HorizontalAlignment.General : l.HorizontalAlignment.Distributed } });
|
|
1424
|
+
}).update({ state: C3 });
|
|
1425
|
+
const b3 = function() {
|
|
1426
|
+
return Ue2 === l.HorizontalAlignment.Right;
|
|
1427
|
+
};
|
|
1428
|
+
Ie2.getCommand("formatAlignRightToggle").updateCallback(function() {
|
|
1429
|
+
J2(this, { alignment: { horizontal: b3() ? l.HorizontalAlignment.General : l.HorizontalAlignment.Right } });
|
|
1430
|
+
}).update({ state: b3 });
|
|
1431
|
+
const S2 = function() {
|
|
1432
|
+
return Ue2 === l.HorizontalAlignment.Justify;
|
|
1433
|
+
};
|
|
1434
|
+
Ie2.getCommand("formatAlignJustifyToggle").updateCallback(function() {
|
|
1435
|
+
J2(this, { alignment: { horizontal: S2() ? l.HorizontalAlignment.General : l.HorizontalAlignment.Justify } });
|
|
1436
|
+
}).update({ state: S2 });
|
|
1437
|
+
const x3 = Ue2 === l.HorizontalAlignment.CenterContinuous || Ue2 === l.HorizontalAlignment.Fill;
|
|
1438
|
+
Ie2.getCommand("formatTextRotate0").updateCallback(function(e4) {
|
|
1439
|
+
J2(this, { alignment: { rotation: 0 } });
|
|
1440
|
+
}).update({ disabled: x3, state: 0 === je2 }), Ie2.getCommand("formatTextRotate45").updateCallback(function(e4) {
|
|
1441
|
+
J2(this, { alignment: { rotation: e4 ?? 1 ? 45 : 0 } });
|
|
1442
|
+
}).update({ disabled: x3, state: 45 === je2 }), Ie2.getCommand("formatTextRotate90").updateCallback(function(e4) {
|
|
1443
|
+
J2(this, { alignment: { rotation: e4 ?? 1 ? 90 : 0 } });
|
|
1444
|
+
}).update({ disabled: x3, state: 90 === je2 }), Ie2.getCommand("formatTextRotate270").updateCallback(function(e4) {
|
|
1445
|
+
J2(this, { alignment: { rotation: e4 ?? 1 ? 270 : 0 } });
|
|
1446
|
+
}).update({ disabled: x3, state: 270 === je2 }), Ie2.getCommand("formatTextRotate315").updateCallback(function(e4) {
|
|
1447
|
+
J2(this, { alignment: { rotation: e4 ?? 1 ? 315 : 0 } });
|
|
1448
|
+
}).update({ disabled: x3, state: 315 === je2 }), Ie2.getCommand("formatTextRotateCustom").updateCallback(function(e4) {
|
|
1449
|
+
J2(this, { alignment: { rotation: e4 } });
|
|
1450
|
+
}).update({ disabled: x3, state: je2 ?? 0 });
|
|
1451
|
+
}, [Pe2, r2, d2, L2, B2]), re(() => {
|
|
1452
|
+
const e3 = !r2.getProtection().isFormatCellsAllowed(), t2 = r2.getSelectedRanges().getMerges().length > 0, o2 = async (e4, t3) => {
|
|
1453
|
+
Y2(t3, async (o3) => {
|
|
1454
|
+
const n3 = async (n4 = false) => {
|
|
1455
|
+
const r4 = await Promise.resolve(f2?.showBusy?.(t3.label()));
|
|
1456
|
+
try {
|
|
1457
|
+
const t4 = o3.getSelectedRanges();
|
|
1458
|
+
if (t4.merge({ orientations: e4, discardMultipleValues: n4 }), e4 === s.Orientations.Both) {
|
|
1459
|
+
const e5 = { alignment: { horizontal: l.HorizontalAlignment.Center } };
|
|
1460
|
+
t4.updateStyle(e5);
|
|
1461
|
+
}
|
|
1462
|
+
} catch (e5) {
|
|
1463
|
+
throw e5;
|
|
1464
|
+
} finally {
|
|
1465
|
+
r4?.();
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
let r3;
|
|
1469
|
+
try {
|
|
1470
|
+
await n3();
|
|
1471
|
+
} catch (e5) {
|
|
1472
|
+
if ("discardMultipleValues" !== e5.type) throw e5;
|
|
1473
|
+
r3 = true;
|
|
1474
|
+
}
|
|
1475
|
+
if (r3 && f2?.showOptions) {
|
|
1476
|
+
if ("Merge" !== await f2?.showOptions({ title: "Confirm", description: "Merging cells will only keep the upper-left value. Some data will be discarded. Continue?", options: ["Merge", "Cancel"], defaultOption: "Merge" })) return;
|
|
1477
|
+
await n3(true);
|
|
1478
|
+
}
|
|
1479
|
+
}, void 0, void 0, false);
|
|
1480
|
+
}, n2 = (e4) => {
|
|
1481
|
+
Y2(e4, async (e5) => {
|
|
1482
|
+
try {
|
|
1483
|
+
const t3 = e5.getSelectedRanges();
|
|
1484
|
+
t3.unmerge();
|
|
1485
|
+
const o3 = { alignment: { horizontal: null } };
|
|
1486
|
+
t3.updateStyle(o3);
|
|
1487
|
+
} catch (e6) {
|
|
1488
|
+
throw e6;
|
|
1489
|
+
}
|
|
1490
|
+
});
|
|
1491
|
+
};
|
|
1492
|
+
Ie2.getCommand("mergeToggle").updateCallback(function() {
|
|
1493
|
+
Q.isSingleCell(r2.getSelectedRange().getCoords()) || (t2 ? n2(this) : o2(s.Orientations.Both, this));
|
|
1494
|
+
}).update({ state: t2, disabled: !Ve2 || e3 }), Ie2.getCommand("mergeHorizontal").updateCallback(function() {
|
|
1495
|
+
o2(s.Orientations.Column, this);
|
|
1496
|
+
}).update({ disabled: !Ve2 || e3 }), Ie2.getCommand("mergeVertical").updateCallback(function() {
|
|
1497
|
+
o2(s.Orientations.Row, this);
|
|
1498
|
+
}).update({ disabled: !Ve2 }), Ie2.getCommand("unmerge").updateCallback(function() {
|
|
1499
|
+
n2(this);
|
|
1500
|
+
}).update({ disabled: !t2 || !Ve2 || e3 });
|
|
1501
|
+
const i3 = { disabled: e3 };
|
|
1502
|
+
Ie2.getCommand("hideRows").updateCallback(function() {
|
|
1503
|
+
Y2(this, (e4) => {
|
|
1504
|
+
e4.getRowHeaders().setHidden(e4.getSelectedRanges().getCoords(), true);
|
|
1505
|
+
});
|
|
1506
|
+
}).update(i3), Ie2.getCommand("hideColumns").updateCallback(function() {
|
|
1507
|
+
Y2(this, (e4) => {
|
|
1508
|
+
e4.getColumnHeaders().setHidden(e4.getSelectedRanges().getCoords(), true);
|
|
1509
|
+
});
|
|
1510
|
+
}).update(i3), Ie2.getCommand("unhideRows").updateCallback(function() {
|
|
1511
|
+
Y2(this, (e4) => {
|
|
1512
|
+
e4.getRowHeaders().setHidden(e4.getSelectedRanges().getCoords(), false);
|
|
1513
|
+
});
|
|
1514
|
+
}).update(i3), Ie2.getCommand("unhideColumns").updateCallback(function() {
|
|
1515
|
+
Y2(this, (e4) => {
|
|
1516
|
+
e4.getColumnHeaders().setHidden(e4.getSelectedRanges().getCoords(), false);
|
|
1517
|
+
});
|
|
1518
|
+
}).update(i3), Ie2.getCommand("autoFitRows").updateCallback(function() {
|
|
1519
|
+
Y2(this, (e4) => {
|
|
1520
|
+
e4.getSelectedRanges().autoFit({ orientations: s.Orientations.Row });
|
|
1521
|
+
});
|
|
1522
|
+
}).update(i3), Ie2.getCommand("autoFitColumns").updateCallback(function() {
|
|
1523
|
+
Y2(this, (e4) => {
|
|
1524
|
+
e4.getSelectedRanges().autoFit({ orientations: s.Orientations.Column });
|
|
1525
|
+
});
|
|
1526
|
+
}).update(i3);
|
|
1527
|
+
let a2 = false, d3 = 0, c2 = false, g2 = false, u2 = 0, h3 = false;
|
|
1528
|
+
!C2 || e3 || Le2 || (a2 = C2.isEntireColumnsAny(), a2 && !C2.isEntireColumns() ? c2 = true : d3 = C2.getColumnCount(), g2 = C2.isEntireRowsAny(), g2 && !C2.isEntireRows() ? h3 = true : u2 = C2.getRowCount());
|
|
1529
|
+
const m2 = { disabled: e3 || C2 && 1 !== C2.getCount() };
|
|
1530
|
+
Ie2.getCommand("sortAscending").update(m2), Ie2.getCommand("sortDescending").update(m2);
|
|
1531
|
+
const p3 = { disabled: a2 || g2 || e3 || Le2 }, w3 = a2 || e3 || Le2 || h3;
|
|
1532
|
+
w3 && (d3 = 1);
|
|
1533
|
+
const q3 = g2 || e3 || Le2 || c2;
|
|
1534
|
+
q3 && (u2 = 1);
|
|
1535
|
+
let v3 = "", y3 = "", b3 = "", S2 = "", x3 = "", k2 = "", R2 = "", M2 = "", T2 = "";
|
|
1536
|
+
d3 > 1 && (k2 = y3 = d3 + " ", R2 = b3 = "s"), u2 > 1 && (M2 = S2 = u2 + " ", T2 = x3 = "s"), "copy" === P2.getMode()?.key ? (v3 = S2 = y3 = "Copied ", b3 = x3 = "s") : "cut" === P2.getMode()?.key && (v3 = S2 = y3 = "Cut ", b3 = x3 = "s");
|
|
1537
|
+
let A3 = "", z2 = "";
|
|
1538
|
+
if (C2) {
|
|
1539
|
+
const e4 = C2.getDefaultShiftOrientation() === s.Orientation.Column;
|
|
1540
|
+
A3 = ` (${e4 ? "Shift Right" : "Shift Down"})`, z2 = ` (${e4 ? "Shift Left" : "Shift up"})`, Ie2.getCommand("deleteCells").update({ label: `Delete Cells${z2}` });
|
|
1541
|
+
}
|
|
1542
|
+
Ie2.getCommand("insertCells").update({ label: `Insert ${v3}Cells${A3}`, scopedLabels: { insertCells: `${v3}At Selection` } }), Ie2.getCommand("insertCellsShiftRight").update(p3), Ie2.getCommand("insertCellsShiftDown").update(p3), Ie2.getCommand("deleteCellsShiftUp").update(p3), Ie2.getCommand("deleteCellsShiftLeft").update(p3), Ie2.getCommand("insertRows").update({ label: `Insert ${S2}Row${x3}`, scopedLabels: { insertCells: `${S2}Row${x3}` }, disabled: q3 }), Ie2.getCommand("insertRowsAfter").update({ label: `Insert ${S2}Row${x3} Below`, disabled: q3 }), Ie2.getCommand("insertColumns").update({ label: `Insert ${y3}Column${b3}`, scopedLabels: { insertCells: `${y3}Column${b3}` }, disabled: w3 }), Ie2.getCommand("insertColumnsAfter").update({ label: `Insert ${y3}Column${b3} After`, disabled: w3 }), Ie2.getCommand("deleteRows").update({ label: `Delete ${M2}Row${T2}`, scopedLabels: { deleteCells: `${M2}Row${T2}` }, disabled: q3 }), Ie2.getCommand("deleteColumns").update({ label: `Delete ${k2}Column${R2}`, scopedLabels: { deleteCells: `${k2}Column${R2}` }, disabled: w3 });
|
|
1543
|
+
}, [Fe2, Ve2, Le2, C2, P2, f2, Ae2]), re(() => {
|
|
1544
|
+
const e3 = r2.getProtection(), t2 = r2.getProtection().isLocked(), o2 = !e3.isFormatCellsAllowed(), n2 = { disabled: o2 };
|
|
1545
|
+
Ie2.getCommand("protectionSheetToggle").updateCallback(async (o3, n3) => {
|
|
1546
|
+
let l2 = null;
|
|
1547
|
+
try {
|
|
1548
|
+
if (t2) {
|
|
1549
|
+
let t3 = null;
|
|
1550
|
+
if (e3.hasPassword()) {
|
|
1551
|
+
const e4 = await f2?.showInputOptions({ title: "Password Required", description: "Enter a password to unprotected", options: ["Unprotect", "Cancel"], defaultOption: "Unprotect", inputType: "password" });
|
|
1552
|
+
if ("Unprotect" !== e4.option) return;
|
|
1553
|
+
t3 = e4.input;
|
|
1554
|
+
}
|
|
1555
|
+
l2 = await Promise.resolve(f2?.showBusy?.(n3.label())), await e3.unlock(t3);
|
|
1556
|
+
} else l2 = await Promise.resolve(f2?.showBusy?.(n3.label())), await e3.lock();
|
|
1557
|
+
l2?.();
|
|
1558
|
+
} catch (e4) {
|
|
1559
|
+
l2?.(), f2?.showError?.(e4);
|
|
1560
|
+
}
|
|
1561
|
+
}).update({ state: t2, label: () => t2 ? "Unprotect Sheet" : "Protect Sheet", scopedLabels: { sheet: t2 ? "Unprotect" : "Protect" } }), Ie2.getCommand("deleteTable").update(n2), Ie2.getCommand("sortAscending").update(n2), Ie2.getCommand("sortDescending").update(n2), Ie2.getCommand("sortCustom")?.update(n2), Ie2.getCommand("updateComments").update(n2), Ie2.getCommand("deleteComments").update(n2), Ie2.getCommand("insertChart")?.update(n2), Ie2.getCommand("insertImageFromFile").update(n2), Ie2.getCommand("insertImageFromURL").update(n2), Ie2.getCommand("formatBorder").update(n2), Ie2.getCommand("formatFillColor").update(n2), Ie2.getCommand("formatFontColor").update(n2), Ie2.getCommand("formatBoldToggle").update(n2), Ie2.getCommand("formatItalicToggle").update(n2), Ie2.getCommand("formatUnderlinedToggle").update(n2), Ie2.getCommand("formatStrikeThroughToggle").update(n2), Ie2.getCommand("formatSuperscriptToggle").update(n2), Ie2.getCommand("formatSubscriptToggle").update(n2), Ie2.getCommand("formatAlignTopToggle").update(n2), Ie2.getCommand("formatTextOverflowVisibleToggle").update(n2), Ie2.getCommand("formatTextOverflowWrapToggle").update(n2), Ie2.getCommand("formatTextOverflowClipToggle").update(n2), Ie2.getCommand("formatTextOverflowShrinkToggle").update(n2), Ie2.getCommand("formatAlignMiddleToggle").update(n2), Ie2.getCommand("formatAlignBottomToggle").update(n2), Ie2.getCommand("formatAlignDistributedVerticalToggle").update(n2), Ie2.getCommand("formatAlignJustifyVerticalToggle").update(n2), Ie2.getCommand("formatAlignLeftToggle").update(n2), Ie2.getCommand("formatAlignCenterToggle").update(n2), Ie2.getCommand("formatAlignRightToggle").update(n2), Ie2.getCommand("formatAlignJustifyToggle").update(n2), Ie2.getCommand("formatAlignCenterContinuousToggle").update(n2), Ie2.getCommand("formatAlignDistributedHorizontalToggle").update(n2), Ie2.getCommand("formatAlignFillToggle").update(n2), Ie2.getCommand("formatFontSizeIncrease").update(n2), Ie2.getCommand("formatFontSizeDecrease").update(n2), Ie2.getCommand("formatFontFamily").update(n2), Ie2.getCommand("formatFontSize").update(n2), Ie2.getCommand("formatNumberFormat").update(n2), Ie2.getCommand("formatNumberFormatGeneralStyle").update(n2), Ie2.getCommand("formatNumberFormatNumberStyle").update(n2), Ie2.getCommand("formatNumberFormatTimeStyle").update(n2), Ie2.getCommand("formatNumberFormatDateStyle").update(n2), Ie2.getCommand("formatNumberFormatAccountingStyle").update(n2), Ie2.getCommand("formatNumberFormatPercentStyle").update(n2), Ie2.getCommand("formatNumberFormatScientificStyle").update(n2), Ie2.getCommand("formatNumberFormatCommaStyle").update(n2), Ie2.getCommand("formatNumberFormatIncreaseDecimal").update(n2), Ie2.getCommand("formatNumberFormatDecreaseDecimal").update(n2), Ie2.getCommand("hideColumns").update(n2), Ie2.getCommand("unhideColumns").update(n2), Ie2.getCommand("hideRows").update(n2), Ie2.getCommand("unhideRows").update(n2), Ie2.getCommand("quickFormulaSum").update(n2), Ie2.getCommand("quickFormulaAverage").update(n2), Ie2.getCommand("quickFormulaCount").update(n2), Ie2.getCommand("quickFormulaMax").update(n2), Ie2.getCommand("quickFormulaMin").update(n2), Ie2.getCommand("startEditCurrentTime").update(n2), Ie2.getCommand("startEditCurrentDate").update(n2), Ie2.getCommand("startEditValueAbove").update(n2), Ie2.getCommand("fillDown").update(n2), Ie2.getCommand("fillRight").update(n2), Ie2.getCommand("fillUp").update(n2), Ie2.getCommand("fillLeft").update(n2), Ie2.getCommand("formatCellStyle").update(n2), Ie2.getCommand("formatTableStyle").update(n2), Ie2.getCommand("formatBorderAddOutline").update(n2), Ie2.getCommand("formatBorderClearOutline").update(n2), Ie2.getCommand("formatIndentDecrease").update(n2), Ie2.getCommand("formatIndentIncrease").update(n2), Ie2.getCommand("clearContents").update(n2), Ie2.getCommand("clearFormats").update(n2), Ie2.getCommand("clearAll").update(n2);
|
|
1562
|
+
const i3 = Ue2 === l.HorizontalAlignment.CenterContinuous || Ue2 === l.HorizontalAlignment.Fill, a2 = { disabled: o2 || i3 };
|
|
1563
|
+
Ie2.getCommand("formatTextRotate0").update(a2), Ie2.getCommand("formatTextRotate45").update(a2), Ie2.getCommand("formatTextRotate90").update(a2), Ie2.getCommand("formatTextRotate270").update(a2), Ie2.getCommand("formatTextRotate315").update(a2), Ie2.getCommand("formatTextRotateCustom").update(a2), Ie2.getCommand("formatTextRotateVertical").update(a2);
|
|
1564
|
+
}, [Fe2]), Ie2;
|
|
1565
|
+
}
|
|
1566
|
+
const kt = ee(ne((e2, t2) => {
|
|
1567
|
+
const { style: o2 = C.EmptyCssProperties, orientation: n2, sheet: l2, onShowTooltip: r2, onCloseTooltip: i2, onScrollOffset: a2, showCustomScrollButtons: s2 = false, offset: d2 = 0, totalSize: c2 = 0, viewportSize: g2 = 0, ...u2 } = e2;
|
|
1568
|
+
if (!l2) throw new Error("SheetScrollBar needs a sheet model");
|
|
1569
|
+
const [h2] = Re(), m2 = S(r2, [r2]), p2 = S(i2, [i2]), f2 = ze(h2, t2), [w2, q2] = oe(() => {
|
|
1570
|
+
const e3 = l2.getView().getTopLeft();
|
|
1571
|
+
return n2 === I.Vertical ? e3.top : e3.left;
|
|
1572
|
+
}), v2 = () => {
|
|
1573
|
+
const e3 = l2.getView().getFreezePanes();
|
|
1574
|
+
if (n2 === I.Vertical) {
|
|
1575
|
+
if (0 === e3.coords.rowIndex) return { shift: 0, scroll: 0 };
|
|
1576
|
+
return { shift: l2.getRowHeaders().findOffset(e3.coords.rowIndex) - e3.topLeft.top, scroll: e3.topLeft.top };
|
|
1577
|
+
}
|
|
1578
|
+
if (0 === e3.coords.colIndex) return { shift: 0, scroll: 0 };
|
|
1579
|
+
return { shift: l2.getColumnHeaders().findOffset(e3.coords.colIndex) - e3.topLeft.left, scroll: e3.topLeft.left };
|
|
1580
|
+
}, [y2, b2] = oe(v2), [x2, k2] = oe(null), [R2, M2] = oe(false), T2 = n2 === I.Vertical ? l2.getRowHeaders() : l2.getColumnHeaders(), A2 = () => {
|
|
1581
|
+
const e3 = l2.getUsedRange()?.getCoords() ?? Q.EmptyRange, t3 = l2.getSelection().getCoords().cell;
|
|
1582
|
+
return { colIndex: Math.max(e3.colEnd, t3.colIndex), rowIndex: Math.max(e3.rowEnd, t3.rowIndex) };
|
|
1583
|
+
}, [z2, F2] = oe(A2), E2 = z2 ? (n2 === I.Vertical ? z2.rowIndex : z2.colIndex) + 1 : 0, D2 = () => {
|
|
1584
|
+
const e3 = A2();
|
|
1585
|
+
Q.isEqualCells(z2, e3) || F2(e3);
|
|
1586
|
+
};
|
|
1587
|
+
Ct(l2.getView(), { onFreezeSplitChange: () => {
|
|
1588
|
+
b2(v2);
|
|
1589
|
+
} }), Ct(l2.getSelection(), { onChange: D2 }), Ct(l2, { onUsedRangeChange: D2 }), re(() => {
|
|
1590
|
+
F2(A2());
|
|
1591
|
+
}, [l2]), re(() => {
|
|
1592
|
+
if (!x2) return R2 && p2?.(), void M2(false);
|
|
1593
|
+
const e3 = T2.getTextAt(T2.findIndex(w2 / (l2.getView().getZoomScale() / 100) + y2.scroll + y2.shift));
|
|
1594
|
+
M2(true), m2?.({ ...x2, display: (n2 === I.Vertical ? "Row" : "Column") + ": " + e3 });
|
|
1595
|
+
}, [d2, w2, y2, n2, x2, T2, R2, l2]);
|
|
1596
|
+
const N2 = S((e3, t3, o3) => {
|
|
1597
|
+
q2(e3);
|
|
1598
|
+
const n3 = e3 + y2.scroll, l3 = t3 + y2.shift, r3 = o3 + y2.shift + y2.scroll;
|
|
1599
|
+
a2?.(n3, l3, r3);
|
|
1600
|
+
}, [a2, y2]), L2 = d2 - y2.scroll, H2 = g2 - y2.shift, B2 = c2 - (y2.shift + y2.scroll), O2 = T2.findOffset(E2) * (l2.getView().getZoomScale() / 100) - (y2.scroll + y2.shift);
|
|
1601
|
+
return G(V, { ref: f2, style: o2, offset: L2, viewportSize: H2, totalSize: B2, orientation: n2, showCustomScrollButtons: s2, onMouseDown: (e3) => {
|
|
1602
|
+
k2({ anchor: { x: e3.clientX, y: e3.clientY } }), e3.preventDefault();
|
|
1603
|
+
}, onScrollOffset: N2, onMouseOut: () => {
|
|
1604
|
+
k2(null);
|
|
1605
|
+
}, onMouseUp: () => {
|
|
1606
|
+
k2(null);
|
|
1607
|
+
}, minSize: O2, ...u2 });
|
|
1608
|
+
}));
|
|
1609
|
+
kt.displayName = "SheetScrollbar";
|
|
1610
|
+
const Rt = (e2, t2, o2 = null) => {
|
|
1611
|
+
const n2 = [];
|
|
1612
|
+
for (let l2 = 0; l2 < e2.length; l2++) if (e2[l2].value.isSelectedAll) {
|
|
1613
|
+
if (e2[l2].min === e2[l2].max && e2[l2].min === o2) continue;
|
|
1614
|
+
n2.push({ address: { min: e2[l2].min, max: e2[l2].max }, update: t2 });
|
|
1615
|
+
}
|
|
1616
|
+
return n2;
|
|
1617
|
+
}, Mt = ee(ne((e2, t2) => {
|
|
1618
|
+
const { sheetHeader: o2, gridRef: n2, sheetElement: l2, commands: r2, oppositeSize: i2 = 30, containerWidth: a2, containerHeight: d2, headerText: c2, freezeStart: g2, gridStyle: u2, verticalPadding: h2, horizontalPadding: m2, onSheetContextMenu: p2, onResizeHeadersStart: f2, onResizeHeaders: w2, onResizeHeadersEnd: q2, onResizeHeadersDown: v2, onResizeHeadersUp: y2, scrollPoint: x2, onSelectionStart: k2, onSelectionEnd: R2 } = e2, M2 = te(() => o2.getOrientation(), [o2]), T2 = le(null), [A2, F2] = se((e3) => e3 + 1, 0), [E2, D2] = se((e3) => e3 + 1, 0), I2 = o2?.getSheet(), V2 = le(false);
|
|
1619
|
+
ie(() => {
|
|
1620
|
+
V2.current = true;
|
|
1621
|
+
}, [o2]);
|
|
1622
|
+
const L2 = te(() => o2.getEntireRange().getCoords().max + 1, [o2]), H2 = te(() => {
|
|
1623
|
+
const e3 = M2 === s.Orientation.Column;
|
|
1624
|
+
return { left: e3 ? x2.left : 0, top: e3 ? 0 : x2.top };
|
|
1625
|
+
}, [x2]), [B2, O2] = oe(I2?.getView().getZoomScale() / 100), [P2, $2] = oe(null);
|
|
1626
|
+
Ct(o2, { onSizesChange: (e3) => {
|
|
1627
|
+
O2(I2?.getView().getZoomScale() / 100), me2(ue2());
|
|
1628
|
+
} });
|
|
1629
|
+
const W2 = ae(() => {
|
|
1630
|
+
T2.current?.invalidate(), D2();
|
|
1631
|
+
}, []), U2 = ae(K.debounce(() => {
|
|
1632
|
+
W2();
|
|
1633
|
+
}, 10), []), [_2, Z2] = oe(null);
|
|
1634
|
+
Ct(o2.getSheet(), { onSelectionChange() {
|
|
1635
|
+
Z2(I2?.getSelection().getCoords()), U2();
|
|
1636
|
+
}, onProtectionChange() {
|
|
1637
|
+
W2();
|
|
1638
|
+
}, onViewChange() {
|
|
1639
|
+
U2();
|
|
1640
|
+
} }), ie(() => {
|
|
1641
|
+
me2(ue2());
|
|
1642
|
+
}, [M2, B2, i2]), ie(() => {
|
|
1643
|
+
$2(null), O2(o2?.getSheet().getView().getZoomScale() / 100), me2(ue2());
|
|
1644
|
+
}, [o2]);
|
|
1645
|
+
const j2 = ae((e3) => o2.at(e3)?.isHidden() || 0 === o2.at(e3)?.getSize(), [o2]), X2 = ae((e3, t3) => o2.hiddenHeadersAt(e3, t3), [j2]), Y2 = S((e3) => o2.isSelected(e3), [o2]), Q2 = S((e3) => o2.isSelectedAll(e3), [o2]), J2 = ae(() => o2.getMinSize(), [o2]), ee2 = ae(() => o2.getMaxSize(), [o2]), ne2 = S((e3, t3, n3) => {
|
|
1646
|
+
t3 /= B2;
|
|
1647
|
+
const l3 = { size: t3 = Math.max(J2(), Math.min(K.roundAccurately(t3, J2()), ee2())), hidden: false }, r3 = [];
|
|
1648
|
+
if (t3 <= 0 && (l3.hidden = true, l3.size = n3), r3.push({ address: { min: e3, max: e3 }, update: l3 }), t3 < 0) {
|
|
1649
|
+
const o3 = M2 === s.Orientation.Column, n4 = o3 ? he2.getColOffset : he2.getRowOffset, l4 = o3 ? he2.getColIndex : he2.getRowIndex, i3 = n4(e3);
|
|
1650
|
+
let a3 = l4(i3 + t3);
|
|
1651
|
+
const d3 = n4(a3);
|
|
1652
|
+
d3 === i3 + t3 ? a3-- : r3.push({ address: { min: a3, max: a3 }, update: { size: i3 - d3 + t3 } }), e3 - a3 > 1 && r3.push({ address: { min: a3 + 1, max: e3 - 1 }, update: { hidden: true } });
|
|
1653
|
+
}
|
|
1654
|
+
o2.updateHeaderPairs(r3), w2?.(e3, t3, n3);
|
|
1655
|
+
}, [A2, o2, B2, w2]), de2 = S((e3, t3, n3) => {
|
|
1656
|
+
const l3 = M2 === s.Orientation.Column;
|
|
1657
|
+
let r3 = null, i3 = { min: e3, max: e3 };
|
|
1658
|
+
if (o2.isSelectedAll(e3)) {
|
|
1659
|
+
const a3 = o2.getSelectedRuns();
|
|
1660
|
+
a3.length > 1 ? r3 = "Resize " + (l3 ? "Columns" : "Rows") : i3 = a3[0];
|
|
1661
|
+
const s2 = { hidden: t3 <= 0, size: (t3 <= 0 ? n3 : t3) / B2 };
|
|
1662
|
+
o2.updateHeaderPairs(Rt(a3, s2, e3));
|
|
1663
|
+
}
|
|
1664
|
+
if (i3) {
|
|
1665
|
+
const e4 = i3.max - i3.min + 1;
|
|
1666
|
+
let t4;
|
|
1667
|
+
t4 = 1 === e4 ? o2.getRange(i3).at(0).getDisplayText() : o2.getRange(i3).toString(), r3 = `Resize ${l3 ? "Column" : "Row"}${e4 > 1 ? "s" : ""} '${t4}'`;
|
|
1668
|
+
}
|
|
1669
|
+
q2?.(e3, t3, r3);
|
|
1670
|
+
}, [A2, o2, q2]), ce2 = S((e3, t3) => {
|
|
1671
|
+
const o3 = M2 === s.Orientation.Column;
|
|
1672
|
+
f2(e3, t3, `Resize ${o3 ? "Column" : "Row"}(s)`);
|
|
1673
|
+
}, [f2]), ge2 = S((e3) => {
|
|
1674
|
+
let t3 = false;
|
|
1675
|
+
const n3 = M2 === s.Orientation.Column, l3 = o2.getSheet().getEntireRange().getCoords(), r3 = [], i3 = o2.getSelectedRuns(), a3 = (e4) => {
|
|
1676
|
+
let t4;
|
|
1677
|
+
t4 = n3 ? { colStart: e4.min, rowStart: l3.rowStart, colEnd: e4.max, rowEnd: l3.rowEnd } : { colStart: l3.colStart, rowStart: e4.min, colEnd: l3.colEnd, rowEnd: e4.max }, r3.push(t4);
|
|
1678
|
+
};
|
|
1679
|
+
for (let o3 = 0; o3 < i3.length; o3++) {
|
|
1680
|
+
const n4 = i3[o3];
|
|
1681
|
+
n4.value.isSelectedAll && (n4.min <= e3 && n4.max >= e3 && (t3 = true), a3(n4));
|
|
1682
|
+
}
|
|
1683
|
+
t3 || a3({ min: e3, max: e3 }), o2.getSheet().getRanges(r3).autoFit({ orientations: n3 ? s.Orientations.Column : s.Orientations.Row });
|
|
1684
|
+
if (j2(e3)) {
|
|
1685
|
+
const n4 = { hidden: null }, l4 = Rt(i3, n4);
|
|
1686
|
+
t3 || l4.push({ address: e3, update: n4 }), o2.updateHeaderPairs(l4);
|
|
1687
|
+
}
|
|
1688
|
+
q2?.(e3, null, "Resize Column(s)");
|
|
1689
|
+
}, [A2, o2, q2, j2]), ue2 = () => {
|
|
1690
|
+
const e3 = M2 === s.Orientation.Column;
|
|
1691
|
+
return { getColOffset: (t3) => e3 ? o2.findOffset(t3) : 0 === t3 ? 0 : i2 / B2, getColIndex: (t3) => e3 ? o2.findIndex(t3) : 0, getRowOffset: (t3) => e3 ? 0 === t3 ? 0 : i2 / B2 : o2.findOffset(t3), getRowIndex: (t3) => e3 ? 0 : o2.findIndex(t3) };
|
|
1692
|
+
}, [he2, me2] = oe(() => ue2()), Ce2 = ae((e3, t3) => !(e3.nativeEvent.which === N.Right) || !Q2(M2 === s.Orientation.Column ? t3.colIndex : t3.rowIndex), [M2, Q2]), be2 = S((e3) => {
|
|
1693
|
+
l2.focusSheet();
|
|
1694
|
+
}, [l2]), Se2 = S((e3) => {
|
|
1695
|
+
I2?.getSelection().updateCoords(e3);
|
|
1696
|
+
}, [I2]), { ...xe2 } = pe({ gridRef: n2, commands: null, layout: he2, selection: _2, fillHandleBorderColor: u2.body.fill, selectionBackgroundColor: u2.selection.fill, selectionBorderColor: u2.selection.strokeFill, selectionRemoveBackgroundColor: u2.selectionRemove.fill, selectionRemoveBorderColor: u2.selectionRemove.strokeFill, disableTouchSelection: true, onSelectionChange: Se2, canSelectionSpanMergedCells: (e3) => {
|
|
1697
|
+
const t3 = I2.getRange(e3);
|
|
1698
|
+
return t3.isEntireColumns() || t3.isEntireRows();
|
|
1699
|
+
} }), ke2 = S(() => {
|
|
1700
|
+
k2?.();
|
|
1701
|
+
const e3 = I2?.getSelection();
|
|
1702
|
+
e3 && e3.setAdjusting(e3.getCoords());
|
|
1703
|
+
}, [I2, k2]), Re2 = S(async () => {
|
|
1704
|
+
I2?.getSelection().setAdjusting(null), R2?.();
|
|
1705
|
+
}, [I2, R2]), { ...Me2 } = fe({ orientation: M2, headerCount: L2, gridRef: T2, gridMainRef: n2, newSelection: xe2?.newSelection, modifySelection: xe2?.modifySelection, appendSelection: xe2?.appendSelection, clearSelections: xe2?.clearSelections, pointerDownInterceptor: Ce2, onPointerUp: be2, onDragStart: ke2, onDragEnd: Re2 }), Te2 = u2.selection?.strokeFill;
|
|
1706
|
+
re(() => {
|
|
1707
|
+
if (!T2.current) return void $2(null);
|
|
1708
|
+
const e3 = M2 === s.Orientation.Column, t3 = o2.getSelectedRuns(), n3 = o2.isProtected() ? null : ne2, l3 = (t4, o3, n4) => {
|
|
1709
|
+
if (n4) return G("div", e3 ? { style: { position: "absolute", borderBottom: `${u2.headerSelection.strokeWidth}px solid ${Te2}`, pointerEvents: "none", top: `${C.boundPixel(-u2.headerSelection.strokeWidth / 2)}px`, left: `${C.boundPixel(n4.x - u2.headerSelection.strokeWidth)}px`, width: `${C.boundPixel(n4.width + u2.headerSelection.strokeWidth + 1, true)}px`, height: i2 + u2.headerSelection.strokeWidth - 0.5 + "px" } } : { style: { position: "absolute", borderRight: `${u2.headerSelection.strokeWidth}px solid ${Te2}`, pointerEvents: "none", top: `${C.boundPixel(n4.y - u2.headerSelection.strokeWidth)}px`, left: `${C.boundPixel(-u2.headerSelection.strokeWidth / 2)}px`, width: i2 + u2.headerSelection.strokeWidth - 0.5 + "px", height: `${C.boundPixel(n4.height + u2.headerSelection.strokeWidth + 1, true)}px` } }, t4);
|
|
1710
|
+
}, r3 = (t4, o3, n4) => {
|
|
1711
|
+
const l4 = { x: 0, y: 0, width: 0, height: 0 };
|
|
1712
|
+
if (e3) {
|
|
1713
|
+
const e4 = n4.toClipBounds(n4.getRangeCoordsBounds({ rowStart: 0, rowEnd: 0, colStart: t4, colEnd: Math.min(L2, o3) }), ye);
|
|
1714
|
+
if (!e4) return;
|
|
1715
|
+
l4.x = e4.x, l4.width = e4.width;
|
|
1716
|
+
} else {
|
|
1717
|
+
const e4 = n4.toClipBounds(n4.getRangeCoordsBounds({ rowStart: t4, rowEnd: Math.min(L2, o3), colStart: 0, colEnd: 0 }), ye);
|
|
1718
|
+
if (!e4) return;
|
|
1719
|
+
l4.y = e4.y, l4.height = e4.height;
|
|
1720
|
+
}
|
|
1721
|
+
return { x: l4.x, y: l4.y, width: l4.width, height: l4.height };
|
|
1722
|
+
};
|
|
1723
|
+
$2([(l4) => {
|
|
1724
|
+
const r4 = [];
|
|
1725
|
+
let i3 = null, a3 = e3 ? l4.getVisibleColumns() : l4.getVisibleRows();
|
|
1726
|
+
const s2 = e3 ? l4.getTotalRangeCoords().colStart : l4.getTotalRangeCoords().rowStart;
|
|
1727
|
+
a3.length > 0 && a3[0] > s2 && (a3 = [a3[0] - 1, ...a3]);
|
|
1728
|
+
let d3 = [];
|
|
1729
|
+
const c3 = [];
|
|
1730
|
+
for (let e4 = 0; e4 < a3.length; e4++) {
|
|
1731
|
+
const o3 = a3[e4], l5 = e4 < a3.length - 1 ? a3[e4 + 1] : o3 + X2(o3 + 1, false) + 1, r5 = o3 + 1 !== l5;
|
|
1732
|
+
if (!i3 || i3.max < o3) if (t3.length > 0 && t3[t3.length - 1].max >= o3) {
|
|
1733
|
+
const e5 = K.findEqualOrGreater(t3, o3, (e6) => e6.max);
|
|
1734
|
+
i3 = t3[e5];
|
|
1735
|
+
} else i3 = null;
|
|
1736
|
+
let g4 = false, u3 = false;
|
|
1737
|
+
if (i3?.value && (i3.min <= o3 || i3.min <= l5 && !r5) && (g4 = true, u3 = i3.value.isSelectedAll), o3 === s2) {
|
|
1738
|
+
let e5 = false, t4 = false;
|
|
1739
|
+
i3?.value && i3.min <= o3 && (e5 = true, t4 = i3.value.isSelectedAll), o3 > 0 && c3.push({ index: o3 - 1, isNextHidden: r5, isSelected: e5, isSelectedAll: t4, disabledResize: true });
|
|
1740
|
+
}
|
|
1741
|
+
if (u3 && d3.push(c3.length), c3.push({ index: o3, isHidden: 0 === e4 && X2(o3, false) > 0, isNextHidden: r5, isSelected: g4, isSelectedAll: u3, onDividerMouseDown: v2, onDividerResizeStart: ce2, onDividerResize: n3, onDividerMouseUp: y2, onDividerResizeEnd: de2, onDividerAutoFit: ge2 }), r5) {
|
|
1742
|
+
let e5 = false, r6 = false;
|
|
1743
|
+
if (i3 && i3.min >= o3 && i3.max <= l5 - 1 && i3.value.isSelectedAll && d3.push(c3.length), i3?.value && i3.max >= l5) ;
|
|
1744
|
+
else if (t3.length > 0 && t3[t3.length - 1].max >= l5) {
|
|
1745
|
+
const e6 = K.findEqualOrGreater(t3, l5, (e7) => e7.max);
|
|
1746
|
+
i3 = t3[e6];
|
|
1747
|
+
} else i3 = null;
|
|
1748
|
+
i3?.value && i3.min <= l5 && (e5 = i3.value.isSelected, r6 = i3.value.isSelectedAll), l5 > 0 && c3.push({ index: l5 - 1, isHidden: true, isSelected: e5, isSelectedAll: r6, onDividerMouseDown: v2, onDividerResizeStart: ce2, onDividerResize: n3, onDividerMouseUp: y2, onDividerResizeEnd: de2, onDividerAutoFit: ge2 });
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
if (d3.length > 0) {
|
|
1752
|
+
let o3 = d3.length - 1;
|
|
1753
|
+
if (d3.length > 0) {
|
|
1754
|
+
const t4 = c3[d3[o3]].index;
|
|
1755
|
+
let n5 = null;
|
|
1756
|
+
e3 ? (n5 = l4.getRangeCoordsBounds({ rowStart: 0, rowEnd: 0, colStart: t4, colEnd: t4 }), n5.x + n5.width > l4.getBounds().width && (o3 -= 1, 0 === o3 && (o3 = -1))) : (n5 = l4.getRangeCoordsBounds({ rowStart: t4, rowEnd: t4, colStart: 0, colEnd: 0 }), n5.y + n5.height > l4.getBounds().height && (o3 -= 1, 0 === o3 && (o3 = -1)));
|
|
1757
|
+
}
|
|
1758
|
+
const n4 = t3?.[t3.length - 1], r5 = l4.getAnchor();
|
|
1759
|
+
if ("t" === r5 || "l" === r5) {
|
|
1760
|
+
const e4 = c3[d3[Math.max(0, d3.length - 1)]];
|
|
1761
|
+
e4.showTouchDivider = n4 && n4.max <= e4.index;
|
|
1762
|
+
} else o3 >= 0 && (c3[d3[o3]].showTouchDivider = true);
|
|
1763
|
+
}
|
|
1764
|
+
const { header: g3, headerSelect: h3, headerSelectAll: m3, headerHover: p3 } = u2 ?? {};
|
|
1765
|
+
for (let e4 = 0; e4 < c3.length; e4++) r4.push(G(ve, { orientation: M2, view: l4, headerStyle: g3, headerStyleSelect: h3, headerStyleSelectAll: m3, headerStyleHover: p3, disabled: o2.isProtected(), ...c3[e4] }, `divider${e4}`));
|
|
1766
|
+
return r4;
|
|
1767
|
+
}, (e4) => {
|
|
1768
|
+
const o3 = [];
|
|
1769
|
+
for (let n4 = 0; t3 && n4 < t3.length; n4++) o3.push(l3(`selection:${e4.getAnchor()}:${n4}`, 0, r3(t3[n4].min, t3[n4].max, e4)));
|
|
1770
|
+
return o3;
|
|
1771
|
+
}]);
|
|
1772
|
+
}, [E2, true, Te2, u2, he2, L2, g2, A2, B2]), re(() => {
|
|
1773
|
+
T2.current?.invalidate();
|
|
1774
|
+
}, [A2]);
|
|
1775
|
+
const Ae2 = S((e3) => c2 ? c2(e3) : o2.getTextAt(e3), [c2, o2]), ze2 = S((e3) => {
|
|
1776
|
+
const { header: t3, headerSelect: o3, headerSelectAll: n3, headerHover: l3 } = u2 ?? {}, { range: r3, key: i3, ...a3 } = e3;
|
|
1777
|
+
return G(we, { orientation: M2, index: M2 === s.Orientation.Column ? r3.colStart : r3.rowStart, isSelected: Y2, isSelectedAll: Q2, zoomScale: 100 * B2, headerText: Ae2, headerStyle: t3, headerStyleSelect: o3, headerStyleSelectAll: n3, headerStyleHover: l3, verticalPadding: h2, horizontalPadding: m2, ...a3 }, i3);
|
|
1778
|
+
}, [A2, L2, u2, B2, o2]), Fe2 = z(), Ee2 = te(() => {
|
|
1779
|
+
const e3 = "white", t3 = "black", o3 = {};
|
|
1780
|
+
if ("touch" !== C.detectIt().primaryInput) {
|
|
1781
|
+
let n3 = M2 === s.Orientation.Column ? `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${t3}' fill='${e3}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer` : `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${t3}' fill='${e3}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;
|
|
1782
|
+
const l3 = Fe2.getMode();
|
|
1783
|
+
if ("formatPainter" === l3?.key) {
|
|
1784
|
+
const o4 = 30, l4 = 22;
|
|
1785
|
+
n3 = `url("data:image/svg+xml,%3Csvg width='${o4}' height='${l4}' viewBox='0 0 ${o4} ${l4}' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='${"M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z"}' stroke='${t3}' fill='${e3}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`;
|
|
1786
|
+
}
|
|
1787
|
+
o3.cursor = n3;
|
|
1788
|
+
}
|
|
1789
|
+
return o3.backgroundColor = u2?.header?.fill || "transparent", o3;
|
|
1790
|
+
}, [M2, A2, Fe2, u2]), De2 = b(t2, () => ({ scrollTo: (e3) => {
|
|
1791
|
+
T2.current?.scrollTo(e3);
|
|
1792
|
+
}, forceRender: () => {
|
|
1793
|
+
F2();
|
|
1794
|
+
}, getGridElement: () => T2.current }), []), Ie2 = ae((e3) => {
|
|
1795
|
+
Me2.onPointerDown(e3);
|
|
1796
|
+
}, [Me2]), Ve2 = ae((e3) => {
|
|
1797
|
+
const t3 = Me2.getCellCoordsFromClient(e3.clientX, e3.clientY);
|
|
1798
|
+
if (!t3) return;
|
|
1799
|
+
if (!p2) return;
|
|
1800
|
+
const o3 = M2 === s.Orientation.Column;
|
|
1801
|
+
p2({ originalEvent: e3, clientX: e3.clientX, clientY: e3.clientY, rowIndex: o3 ? -1 : t3.rowIndex, colIndex: o3 ? t3.colIndex : -1 }), e3.stopPropagation(), e3.preventDefault();
|
|
1802
|
+
}, [Me2, p2]), Ne2 = te(() => {
|
|
1803
|
+
const e3 = M2 === s.Orientation.Column;
|
|
1804
|
+
return G("div", { ref: De2, children: G(qe, { className: "sheet-header", style: Ee2, ref: T2, scrollPoint: H2, columnCount: e3 ? L2 : 1, rowCount: e3 ? 1 : L2, width: e3 ? a2 : i2, height: e3 ? i2 : d2, freezeLeft: e3 ? g2 : void 0, freezeTop: e3 ? void 0 : g2, hiddenColumnsAt: e3 ? X2 : void 0, hiddenRowsAt: e3 ? void 0 : X2, showGridLines: false, layout: he2, clipCells: false, allowOverlaysOverflow: true, enableMouseWheel: false, onContextMenu: Ve2, onPointerDown: Ie2, zoom: B2, cellRenderer: ze2, overlays: P2 }) });
|
|
1805
|
+
}, [P2, he2, a2, d2, H2, Ee2, E2]);
|
|
1806
|
+
return re(() => {
|
|
1807
|
+
V2.current = false, T2.current?.invalidate(), D2();
|
|
1808
|
+
}, [o2, u2]), Ne2;
|
|
1809
|
+
})), Tt = ee(ne((e2, t2) => {
|
|
1810
|
+
const { view: o2, sheet: n2, getVisibleCells: l2, gridStyle: r2 } = e2, i2 = S((e3, t3) => e3.getStyle().getBorder(), []), { overlay: a2 } = ct({ getVisibleCells: l2, getBorderAt: i2, darkMode: r2.body.darkMode, shiftIfWide: true }), s2 = a2(o2);
|
|
1811
|
+
return s2 && o2 ? s2 : null;
|
|
1812
|
+
})), At = { key: "copy", description: "'Copy' Select destination and press ENTER or choose Paste." }, zt = { key: "cut", description: "'Cut' Select destination and press ENTER or choose Paste." }, Ft = { type: o.Content.Values }, Et = { fitDestination: true, type: o.Content.Formats }, Dt = { fitDestination: true, type: o.Content.Formulas }, It = { transpose: true }, Vt = { fitDestination: true, adjustCells: (e2, t2, o2) => ({ value: `=${t2.getA1({ $colIndex: true, $rowIndex: true })}` }) }, Nt = ({ element: e2, sheet: t2, sheetView: n2, commands: l2, onClipboardUpdate: r2, onPaste: i2, selectionRenderer: a2 = Ce, copyForegroundColor: d2 = "rgb(33, 115, 70)", cutForegroundColor: c2 = "rgb(33, 115, 70)", copyBackgroundColor: g2 = "white", cutBackgroundColor: u2 = "white", notifier: h2, ...m2 }) => {
|
|
1813
|
+
const w2 = S(a2, [a2]), q2 = le(null), v2 = z(), y2 = v2.getMode(), C2 = te(() => ({ element: e2, doCopy: (e3) => {
|
|
1814
|
+
const o2 = t2.getSelectedRanges().getSnapshot(e3);
|
|
1815
|
+
return new p(o2);
|
|
1816
|
+
} }), [t2, n2, e2]), b2 = te(() => ({ element: e2, importFromExternal: async (e3, o2) => {
|
|
1817
|
+
const n3 = new f(e3, o2, t2.getStyles(), t2.isDate1904());
|
|
1818
|
+
return await n3.parse() ? n3 : null;
|
|
1819
|
+
}, doPaste: async (e3, n3) => {
|
|
1820
|
+
if ("range" !== e3?.getItemType()) return;
|
|
1821
|
+
n3?.contentsOnly && delete (n3 = { ...n3, type: o.Content.Values }).contentsOnly;
|
|
1822
|
+
const l3 = t2.getSelectedRange(), r3 = e3.getItem(), i3 = r3.getName();
|
|
1823
|
+
return await l3.doBatch(async () => {
|
|
1824
|
+
const e4 = await l3.copyFrom(r3, n3);
|
|
1825
|
+
!e4 || e4.isEntireRows() || e4.isEntireColumns() || e4.autoFit({ orientations: s.Orientations.Row, minContent: true });
|
|
1826
|
+
}, { description: "Paste" + (i3 ? ` ${i3}` : ""), autoSelect: true }), true;
|
|
1827
|
+
} }), [t2, n2, h2, e2]), { clipboard: x2, ...k2 } = A({ ...m2, source: C2, commands: l2, target: b2, notifier: h2, onClipboardUpdate: (e3) => {
|
|
1828
|
+
const t3 = "range" === e3?.getItemType() ? e3 : null;
|
|
1829
|
+
if (t3) {
|
|
1830
|
+
const t4 = e3.editMode?.(), o2 = { ...e3?.isCut?.() ? zt : At, ...t4, args: { isClipboard: true, ...t4?.args }, onModeChange: (e4) => {
|
|
1831
|
+
e4?.args?.isClipboard || x2.clear(true), t4?.onModeChange?.(e4);
|
|
1832
|
+
} };
|
|
1833
|
+
v2.setMode(o2);
|
|
1834
|
+
}
|
|
1835
|
+
q2.current = t3, r2?.(t3);
|
|
1836
|
+
}, onPaste: (o2, n3) => {
|
|
1837
|
+
if ("range" !== o2?.getItemType()) return;
|
|
1838
|
+
let l3 = "cut" === v2.getMode()?.key || o2.isCut?.();
|
|
1839
|
+
if (!l3 && "copy" === v2.getMode()?.key) {
|
|
1840
|
+
const e3 = o2.getItem().getCoords(), n4 = t2.getSelectedRanges().getCoords();
|
|
1841
|
+
let r3 = false;
|
|
1842
|
+
if (!r3 && e3 && n4 && o2.getItem().getSource?.() === t2) for (let t3 = 0; !r3 && t3 < n4.length; t3++) r3 = Q.isRangesIntersect(e3, n4[t3]);
|
|
1843
|
+
l3 = r3;
|
|
1844
|
+
}
|
|
1845
|
+
l3 && v2.setMode(null), e2?.()?.focus(), i2?.(o2, n3);
|
|
1846
|
+
} });
|
|
1847
|
+
te(() => {
|
|
1848
|
+
const t3 = e2;
|
|
1849
|
+
if (!l2) return;
|
|
1850
|
+
const o2 = [new R("pasteValues", t3, { label: "Paste Values", scopedLabels: { paste: "Values" }, description: "Paste only the values of the selected cells.\n\nThe formatting is not applied.", shortcut: { key: "V", modifiers: [M.Ctrl, M.Shift] } }), new R("pasteFormats", t3, { label: "Paste Formatting", scopedLabels: { paste: "Formatting" }, description: "Paste only the formats of the selected cells.\n\nThe content is not applied." }), new R("pasteFormulas", t3, { label: "Paste Formulas", scopedLabels: { paste: "Formulas" }, description: "Paste only the formulas of the selected cells. The values and formatting is not applied." }), new R("pasteTranspose", t3, { label: "Paste Transpose", scopedLabels: { paste: "Transpose" }, description: "Paste with the rows and columns flipped." }), new R("pasteLinks", t3, { label: "Paste Links", scopedLabels: { paste: "Links" }, description: "Paste as formula references to the original cells." })];
|
|
1851
|
+
l2.addCommands(o2, true);
|
|
1852
|
+
}, [l2, e2]), re(() => {
|
|
1853
|
+
if (!l2) return;
|
|
1854
|
+
const e3 = { disabled: !t2.getProtection().isFormatCellsAllowed() };
|
|
1855
|
+
l2.getCommand("pasteValues").updateCallback((e4) => k2.paste({ ...Ft, ...e4 })).update(e3), l2.getCommand("pasteFormats").updateCallback((e4, t3) => k2.paste({ ...Et, description: t3.label(), ...e4 })).update(e3), l2.getCommand("pasteFormulas").updateCallback((e4, t3) => k2.paste({ ...Dt, description: t3.label(), ...e4 })).update(e3), l2.getCommand("pasteTranspose").updateCallback((e4, t3) => k2.paste({ ...It, description: t3.label(), ...e4 })).update(e3), l2.getCommand("pasteLinks").updateCallback((e4, t3) => k2.paste({ ...Vt, description: t3.label(), ...e4 })).update(e3), l2.getCommand("cut").update(e3), l2.getCommand("paste").update(e3);
|
|
1856
|
+
}, [t2, l2]);
|
|
1857
|
+
const T2 = te(() => {
|
|
1858
|
+
if (!y2 || !q2.current) return;
|
|
1859
|
+
const e3 = y2.key;
|
|
1860
|
+
if ("copy" !== e3 && "cut" !== e3 && "formatPainter" !== e3) return;
|
|
1861
|
+
const o2 = q2.current.getItem();
|
|
1862
|
+
if (o2.getSource() !== t2) return;
|
|
1863
|
+
const n3 = q2.current.isCut?.(), l3 = n3 ? u2 : g2, r3 = n3 ? c2 : d2, i3 = o2.getCoords(), a3 = i3 ? [i3] : null;
|
|
1864
|
+
return a3 && 0 !== a3.length ? (e4) => {
|
|
1865
|
+
const t3 = [];
|
|
1866
|
+
for (let o3 = 0; o3 < a3.length; o3++) {
|
|
1867
|
+
const n4 = a3[o3], i4 = e4.toClipBounds(e4.getRangeCoordsBounds(n4, { top: 0, left: 0, right: 1, bottom: 1 }), ye);
|
|
1868
|
+
i4 && (t3.push(w2({ range: n4, key: `copy-selection-background-${o3}`, x: i4.x, y: i4.y, width: Math.max(i4.width, 0), height: Math.max(i4.height, 0), stroke: l3, strokeWidth: 2 })), t3.push(w2({ range: n4, key: `copy-selection-foreground-${o3}`, x: i4.x + (i4.width <= 2 ? -1 : 0), y: i4.y, width: Math.max(i4.width, 3), height: Math.max(i4.height, 3), stroke: r3, strokeWidth: 2, isAnimatedStroke: true })));
|
|
1869
|
+
}
|
|
1870
|
+
return t3;
|
|
1871
|
+
} : null;
|
|
1872
|
+
}, [y2, t2, n2, d2, g2, c2, u2]);
|
|
1873
|
+
return { ...k2, clipboard: x2, overlays: T2 };
|
|
1874
|
+
}, Lt = ee(ne((e2, t2) => {
|
|
1875
|
+
const { view: o2, element: n2, sheet: l2, gridStyle: r2, commands: i2, notifier: a2 } = e2, s2 = r2.body ?? {}, d2 = l2.getView(), { overlays: c2 } = Nt({ element: n2, sheet: l2, sheetView: d2, commands: i2, copyForegroundColor: r2.selection.strokeFill, copyBackgroundColor: s2.fill, cutForegroundColor: r2.selectionRemove.strokeFill, cutBackgroundColor: s2.fill, notifier: a2 });
|
|
1876
|
+
return Ct(l2?.getSelection(), { onChange(e3) {
|
|
1877
|
+
} }), re(() => {
|
|
1878
|
+
o2?.getStage();
|
|
1879
|
+
}, [o2?.getStage()]), c2 && o2 ? c2(o2) : null;
|
|
1880
|
+
})), Ht = "_sheet-selection_1tbzy_9", Bt = { key: "dragCut", description: "Drag selection to move cell contents.", cursor: "move" }, Ot = { key: "dragCutInsert", description: "Drag selection to insert cell contents.", cursor: "copy" }, Pt = { key: "dragCopy", description: "Drag selection to copy cell contents." }, $t = { key: "dragCopyInsert", description: "Drag selection to insert copied cell contents.", cursor: "move" }, Wt = (e2, t2) => t2.ctrlKey && t2.shiftKey ? $t : t2.ctrlKey ? Pt : t2.shiftKey ? Ot : Bt, Ut = { key: "fill", description: "Drag selection to extend series or fill.", cursor: "crosshair" }, _t = ee(ne((e2, t2) => {
|
|
1881
|
+
const { view: o2, commands: n2, className: l2, onFirstRender: r2, notifier: i2, onShowTooltip: a2, onCloseTooltip: d2, sheet: c2, gridRef: g2, gridStyle: u2, isActive: h2, editingCoords: m2, ...p2 } = e2, f2 = o2?.getBounds(), w2 = S(a2, [a2]), q2 = S(d2, [d2]), [v2, y2] = oe(() => c2?.getSelection().getCoords()), x2 = S((e3) => {
|
|
1882
|
+
Q.isEqualSelectionCoords(e3, v2) || c2 && c2.getSelection().updateCoords(e3);
|
|
1883
|
+
}, [c2, v2]), k2 = z(), R2 = le(null), [M2, T2] = oe(c2?.getProtection().isLocked()), [A2, F2] = oe(c2?.getView().getMovableSelection().length > 0), E2 = "touch" === C.detectIt().primaryInput, D2 = !E2 && h2, I2 = null !== m2 || A2, V2 = S((e3) => {
|
|
1884
|
+
const t3 = Q.cellToRange(e3);
|
|
1885
|
+
if (c2.isClosed()) return t3;
|
|
1886
|
+
const o3 = c2.getRange(t3, { excludeHidden: true }).getMerges();
|
|
1887
|
+
return 0 === o3.length ? t3 : o3[0];
|
|
1888
|
+
}, [c2]), N2 = S((e3, t3, o3, n3, l3, r3) => {
|
|
1889
|
+
const i3 = c2.getSelectedRange().getExtended(n3, e3).getCoords();
|
|
1890
|
+
switch (n3) {
|
|
1891
|
+
case s.Direction.Up:
|
|
1892
|
+
return i3.rowStart;
|
|
1893
|
+
case s.Direction.Down:
|
|
1894
|
+
return i3.rowEnd;
|
|
1895
|
+
case s.Direction.Left:
|
|
1896
|
+
return i3.colStart;
|
|
1897
|
+
case s.Direction.Right:
|
|
1898
|
+
return i3.colEnd;
|
|
1899
|
+
}
|
|
1900
|
+
}, [c2]), H2 = S(() => {
|
|
1901
|
+
const e3 = c2.getUsedRange()?.getCoords(), t3 = c2.getRowHeaders().getUsedRange()?.getCoords(), o3 = c2.getColumnHeaders().getUsedRange()?.getCoords();
|
|
1902
|
+
return { ...e3, colEnd: Math.max(e3?.colEnd ?? 0, o3?.max ?? 0), rowEnd: Math.max(e3?.rowEnd ?? 0, t3?.max ?? 0) };
|
|
1903
|
+
}, [c2]), B2 = S((e3, t3) => c2.getRowHeaders().hiddenHeadersAt(e3, t3), [c2]), O2 = S((e3, t3) => c2.getColumnHeaders().hiddenHeadersAt(e3, t3), [c2]), P2 = S((e3) => c2.getRange(e3, { excludeHidden: true }).getMerges(), [c2]), $2 = S((e3) => {
|
|
1904
|
+
c2?.getSelection().setAdjusting(e3);
|
|
1905
|
+
}, [c2]), W2 = S(async () => {
|
|
1906
|
+
c2?.getSelection().setAdjusting(null);
|
|
1907
|
+
const e3 = k2.getMode();
|
|
1908
|
+
"formatPainter" === e3?.key && (await n2?.getCommand("pasteFormats")?.execute({}), k2.setMode(null));
|
|
1909
|
+
}, [k2, v2, c2, n2]), U2 = te(() => {
|
|
1910
|
+
const e3 = k2.getMode();
|
|
1911
|
+
return "cut" === e3?.key || "copy" === e3?.key;
|
|
1912
|
+
}, [k2]);
|
|
1913
|
+
Ct(c2?.getView(), { onMovableSelectionChange: () => {
|
|
1914
|
+
F2(c2.getView().getMovableSelection().length > 0);
|
|
1915
|
+
} }), Ct(c2?.getSelection(), { onChange(e3) {
|
|
1916
|
+
const t3 = c2.getSelection().getCoords();
|
|
1917
|
+
y2(t3);
|
|
1918
|
+
} }), Ct(c2, { onProtectionChange: () => {
|
|
1919
|
+
T2(c2.getProtection().isLocked());
|
|
1920
|
+
} });
|
|
1921
|
+
const { body: _2 = {} } = u2 || {}, Z2 = o2.getLayout(), j2 = !(D2 && v2.ranges.length <= 1 && null === m2 && !M2 && (!k2.getMode() || U2)), { cursor: K2, overlay: X2, onPointerDown: Y2 } = pe({ gridRef: g2, commands: n2, layout: Z2, getCellCoordsAsRangeCoords: V2, selection: v2, fillHandleBorderColor: _2.fill, selectionBackgroundColor: h2 ? u2.selection.fill : u2.selectionInactive.fill, selectionBorderColor: h2 ? u2.selection.strokeFill : u2.selectionInactive.strokeFill, selectionRemoveBackgroundColor: h2 ? u2.selectionRemove.fill : u2.selectionInactive.fill, selectionRemoveBorderColor: h2 ? u2.selectionRemove.strokeFill : u2.selectionInactive.strokeFill, disableFillDrag: j2, disableMoveDrag: E2 || !(h2 && v2.ranges.length <= 1 && null === m2 && !M2), disableTouchSelection: I2, onSelectionChange: x2, onSelectionDragStart: $2, onSelectionDragEnd: W2, onMoveDragStart: (e3, t3, o3) => {
|
|
1922
|
+
k2.setMode(Wt(0, o3));
|
|
1923
|
+
}, onMoveDragUpdate: (e3, t3, o3) => {
|
|
1924
|
+
k2.setMode(Wt(0, o3));
|
|
1925
|
+
}, onMoveDragEnd: (e3, t3) => {
|
|
1926
|
+
k2.setMode(null);
|
|
1927
|
+
}, onMoveDragDone: async (e3, t3, o3) => {
|
|
1928
|
+
if (Q.isEqualRanges(e3, t3)) return;
|
|
1929
|
+
const n3 = c2.getRange(t3);
|
|
1930
|
+
if (i2?.showOptions) {
|
|
1931
|
+
const t4 = n3.getDifferences(e3);
|
|
1932
|
+
let o4 = false;
|
|
1933
|
+
for (let e4 = 0; !o4 && e4 < t4.getCount(); e4++) o4 = t4.at(e4).isContentful();
|
|
1934
|
+
if (o4) {
|
|
1935
|
+
if ("Replace" !== await i2?.showOptions({ title: "Confirm", description: "There is already data here. Do you want to replace it?", options: ["Replace", "Cancel"], defaultOption: "Replace" })) return;
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
const l3 = !o3.ctrlKey, r3 = o3.shiftKey, a3 = r3 ? l3 ? "Insert Moved Cells" : "Insert Copied Cells" : l3 ? "Move Cells" : "Copy Cells", d3 = await i2?.showBusy?.(a3);
|
|
1939
|
+
try {
|
|
1940
|
+
const t4 = c2.getRange(e3);
|
|
1941
|
+
await n3.doBatch(async () => {
|
|
1942
|
+
r3 ? await n3.insertFrom(e3, { isCut: l3, undoRange: t4 }) : await n3.copyFrom(e3, { isCut: l3, undoRange: t4 }), t4.autoFit({ skipCustomSize: true, orientations: s.Orientations.Row, minContent: true }), n3.autoFit({ skipCustomSize: true, orientations: s.Orientations.Row, minContent: true });
|
|
1943
|
+
}, { description: a3, autoSelect: true });
|
|
1944
|
+
} catch (e4) {
|
|
1945
|
+
i2?.showError?.(e4);
|
|
1946
|
+
} finally {
|
|
1947
|
+
d3?.();
|
|
1948
|
+
}
|
|
1949
|
+
}, contentfulCellFinder: N2, hiddenRowsAt: B2, hiddenColumnsAt: O2, mergedRanges: P2, getDataCoords: H2, canSelectionSpanMergedCells: (e3) => {
|
|
1950
|
+
const t3 = c2.getRange(e3);
|
|
1951
|
+
return t3.isEntireColumns() || t3.isEntireRows();
|
|
1952
|
+
}, onFill: async (e3, t3) => {
|
|
1953
|
+
const o3 = "Auto Fill", n3 = await i2?.showBusy?.(o3);
|
|
1954
|
+
try {
|
|
1955
|
+
await c2.doBatch(() => {
|
|
1956
|
+
c2.getRange(e3).autoFill(t3), c2.getRange(t3).autoFit({ orientations: s.Orientations.Row, skipCustomSize: true, minContent: true });
|
|
1957
|
+
}, { description: o3, autoSelect: true });
|
|
1958
|
+
} catch (e4) {
|
|
1959
|
+
i2?.showError?.(e4);
|
|
1960
|
+
} finally {
|
|
1961
|
+
R2.current = null, n3?.();
|
|
1962
|
+
}
|
|
1963
|
+
}, onFillPreview: (e3, t3, n3) => {
|
|
1964
|
+
if (g2.current && w2) {
|
|
1965
|
+
k2.setMode(Ut);
|
|
1966
|
+
try {
|
|
1967
|
+
R2.current?.direction !== n3 && (R2.current = null, c2.getRange(e3).autoFill(t3, { previewOnly: (e4) => {
|
|
1968
|
+
R2.current = { callback: e4, direction: n3 };
|
|
1969
|
+
} }));
|
|
1970
|
+
const l3 = R2.current?.callback?.(t3);
|
|
1971
|
+
if (!l3 || l3.isEmpty()) return;
|
|
1972
|
+
const r3 = l3.toText();
|
|
1973
|
+
if (!r3) return;
|
|
1974
|
+
const i3 = Q.cellToRange(l3.getCoords()), a3 = o2.getRelativePointFromClient(0, 0);
|
|
1975
|
+
let d3 = 0, g3 = 0, u3 = L.Bottom;
|
|
1976
|
+
if (n3 === s.Direction.Down) {
|
|
1977
|
+
d3 = Z2.getColOffset(i3.colEnd + 1) - a3.x;
|
|
1978
|
+
const e4 = Z2.getRowOffset(i3.rowEnd), t4 = Z2.getRowOffset(i3.rowEnd + 1);
|
|
1979
|
+
g3 = t4 - (t4 - e4) / 2 - a3.y, u3 = L.Right;
|
|
1980
|
+
} else if (n3 === s.Direction.Right) {
|
|
1981
|
+
g3 = Z2.getRowOffset(i3.rowEnd + 1) - a3.y;
|
|
1982
|
+
const e4 = Z2.getColOffset(i3.colEnd), t4 = Z2.getColOffset(i3.colEnd + 1);
|
|
1983
|
+
d3 = t4 - (t4 - e4) / 2 - a3.x, u3 = L.Bottom;
|
|
1984
|
+
} else if (n3 === s.Direction.Up) {
|
|
1985
|
+
d3 = Z2.getColOffset(i3.colEnd + 1) - a3.x;
|
|
1986
|
+
const e4 = Z2.getRowOffset(i3.rowStart), t4 = Z2.getRowOffset(i3.rowStart + 1);
|
|
1987
|
+
g3 = t4 - (t4 - e4) / 2 - a3.y, u3 = L.Right;
|
|
1988
|
+
} else if (n3 === s.Direction.Left) {
|
|
1989
|
+
g3 = Z2.getRowOffset(i3.rowEnd + 1) - a3.y;
|
|
1990
|
+
const e4 = Z2.getColOffset(i3.colStart), t4 = Z2.getColOffset(i3.colStart + 1);
|
|
1991
|
+
d3 = t4 - (t4 - e4) / 2 - a3.x, u3 = L.Bottom;
|
|
1992
|
+
}
|
|
1993
|
+
w2({ anchor: { x: d3, y: g3 }, display: r3, placement: u3 });
|
|
1994
|
+
} catch (e4) {
|
|
1995
|
+
i2?.showError?.(e4);
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
}, onFillDone: () => {
|
|
1999
|
+
R2.current = null, k2.setMode(null), q2?.();
|
|
2000
|
+
} }), J2 = S((e3) => {
|
|
2001
|
+
Y2(C.createSyntheticEvent(e3));
|
|
2002
|
+
}, [Y2, m2]);
|
|
2003
|
+
re(() => {
|
|
2004
|
+
const e3 = o2?.getStage();
|
|
2005
|
+
if (e3) return e3.addEventListener("pointerdown", J2), () => {
|
|
2006
|
+
e3.removeEventListener("pointerdown", J2);
|
|
2007
|
+
};
|
|
2008
|
+
}, [o2?.getStage()]);
|
|
2009
|
+
const ee2 = b(t2, () => ({}), []), ne2 = le(null);
|
|
2010
|
+
return G("div", { className: Me(l2, "sheet-selection", Ht), style: { position: "absolute", width: f2?.width, height: f2?.height, overflow: "hidden", pointerEvents: "none", willChange: "none" }, ref: ke([ee2, ne2]), ...p2, children: X2(o2) });
|
|
2011
|
+
})), Gt = Object.freeze({ x: 0, y: 0, width: 0, height: 0 }), Zt = { fireOnModelChange: false }, jt = ee(ne((e2, t2) => {
|
|
2012
|
+
const { children: o2, view: n2, movable: l2, onRefLoad: r2, onRefUnload: i2, onHide: a2, onShow: s2, onUnFocus: d2, isDragging: c2, updateFrameBounds: g2, dragStart: u2, style: h2, disabled: m2, renderMovable: p2, ...f2 } = e2, [w2, q2] = oe(Gt), [v2, y2] = oe(null), [C2, b2] = oe(false), S2 = le(null);
|
|
2013
|
+
ie(() => {
|
|
2014
|
+
if (l2.isClosed()) return;
|
|
2015
|
+
const e3 = l2.getBounds();
|
|
2016
|
+
if (!e3) return;
|
|
2017
|
+
const t3 = n2.toViewBounds(e3);
|
|
2018
|
+
q2(t3 ?? Gt), g2(t3 ?? Gt);
|
|
2019
|
+
}, [n2?.getBounds()]), Ct(l2, { onBoundsChange: (e3) => {
|
|
2020
|
+
const t3 = e3.getBounds();
|
|
2021
|
+
if (!t3) return;
|
|
2022
|
+
const o3 = n2.toViewBounds(t3);
|
|
2023
|
+
q2(o3 ?? Gt), g2(o3);
|
|
2024
|
+
}, onSelectionChange: () => {
|
|
2025
|
+
const e3 = K.hasFocus(S2.current, true);
|
|
2026
|
+
!C2 && !e3 || l2.isSelected() || d2();
|
|
2027
|
+
} }), Ct(l2, { onRequestFocus: () => K.whenFocus(S2.current, true) }, Zt), re(() => {
|
|
2028
|
+
const e3 = S2.current;
|
|
2029
|
+
return r2(e3), () => {
|
|
2030
|
+
i2(e3);
|
|
2031
|
+
};
|
|
2032
|
+
}, []);
|
|
2033
|
+
const x2 = te(() => {
|
|
2034
|
+
if (!w2) return null;
|
|
2035
|
+
let { width: e3, height: t3 } = w2;
|
|
2036
|
+
return p2({ view: n2, movable: l2, disabled: m2, isDragging: c2, style: { position: "relative", left: 0, top: 0, width: e3, height: t3 }, onHide: a2, onShow: s2 });
|
|
2037
|
+
}, [n2, l2, w2.width, w2.height, m2, c2]);
|
|
2038
|
+
return G("div", { className: "movable", tabIndex: 0, ref: ke([S2, t2]), style: { display: "flex", alignItems: "stretch", justifyContent: "stretch", position: "absolute", maxWidth: "auto", maxHeight: "auto", minWidth: "auto", minHeight: "auto", left: w2.x, top: w2.y, width: w2.width, height: w2.height, ...h2 }, onMouseDown: async (e3) => {
|
|
2039
|
+
const t3 = e3.shiftKey || e3.ctrlKey, o3 = l2.isSelected(), n3 = e3.currentTarget;
|
|
2040
|
+
t3 && o3 ? l2.unselect() : (o3 && !t3 || await l2.select({ addToSelection: t3 }), u2(e3.nativeEvent, n3), n3.focus());
|
|
2041
|
+
}, onFocus: (e3) => {
|
|
2042
|
+
e3.relatedTarget && !v2 && y2(e3.relatedTarget), b2(true);
|
|
2043
|
+
}, onBlur: (e3) => {
|
|
2044
|
+
v2 && !S2?.current?.contains(e3.relatedTarget) && y2(null), e3.relatedTarget && b2(false);
|
|
2045
|
+
}, ...f2, children: x2 });
|
|
2046
|
+
})), Kt = "_movable-area_1xcl8_9", Xt = ee(ne((e2, t2) => {
|
|
2047
|
+
const { view: o2, movables: n2, movablesView: l2, renderMovable: r2, transactional: i2, onUnFocus: a2, onFocus: s2, disabled: d2 = false, disableDrag: c2 = false, disableResize: g2 = false, className: u2, style: h2, renderDirections: m2 = ["nw", "n", "ne", "w", "e", "sw", "s", "se"], onFirstRender: p2, ...f2 } = e2, q2 = o2.getBounds(), v2 = S(p2, [p2]), y2 = S(a2, [a2]), C2 = S(s2, [s2]), [k2, R2] = oe([]), [M2, T2] = oe(false), [A2, z2] = oe(false), F2 = le(true), E2 = le(/* @__PURE__ */ new Map()), D2 = le(/* @__PURE__ */ new Map()), I2 = le(/* @__PURE__ */ new Map()), V2 = le(/* @__PURE__ */ new Map()), N2 = le(/* @__PURE__ */ new Map()), L2 = le({ onRequestFocus: (e3) => (ge2(e3), null) }), H2 = le(null), B2 = le(null), O2 = le(null), [P2, $2] = se((e3) => e3 + 1, 0);
|
|
2048
|
+
ie(() => {
|
|
2049
|
+
$2();
|
|
2050
|
+
}, [o2, n2]), Ct(n2, { onCollectionChange: () => {
|
|
2051
|
+
const e3 = n2.search({ address: o2.getVisibleRangeCoords(), excludeHidden: true }), t3 = N2.current;
|
|
2052
|
+
t3.forEach((e4) => {
|
|
2053
|
+
e4();
|
|
2054
|
+
}), t3.clear();
|
|
2055
|
+
const l3 = L2.current;
|
|
2056
|
+
for (let o3 = 0; o3 < e3.length; o3++) {
|
|
2057
|
+
const n3 = e3[o3];
|
|
2058
|
+
if (n3.isClosed()) continue;
|
|
2059
|
+
const r3 = n3.addListeners(l3);
|
|
2060
|
+
t3.set(n3, r3);
|
|
2061
|
+
}
|
|
2062
|
+
$2();
|
|
2063
|
+
}, onInvalidated: () => {
|
|
2064
|
+
$2();
|
|
2065
|
+
} }), Ct(l2, { onMovableSelectionChange(e3) {
|
|
2066
|
+
U2(), $2();
|
|
2067
|
+
} });
|
|
2068
|
+
const W2 = ae((e3, t3) => {
|
|
2069
|
+
const o3 = I2.current.get(e3);
|
|
2070
|
+
O2.current && (O2.current.getTargets().forEach((e4) => {
|
|
2071
|
+
if (e4 === o3) return e4.style.left = t3.x + "px", e4.style.top = t3.y + "px", e4.style.width = t3.width + "px", void (e4.style.height = t3.height + "px");
|
|
2072
|
+
}), O2.current.updateRect());
|
|
2073
|
+
}, []), U2 = () => {
|
|
2074
|
+
const e3 = [], t3 = l2.getMovableSelection();
|
|
2075
|
+
t3.forEach((o3) => {
|
|
2076
|
+
const n3 = I2.current.get(o3);
|
|
2077
|
+
if (!n3) return;
|
|
2078
|
+
-1 !== t3.indexOf(o3) && e3.push(n3);
|
|
2079
|
+
}), R2((t4) => K.isEqualArrays(t4, e3) ? t4 : e3);
|
|
2080
|
+
}, _2 = le(null), j2 = te(() => new Promise((e3) => {
|
|
2081
|
+
_2.current = e3;
|
|
2082
|
+
}), []), X2 = le(null), Y2 = S(async (e3, t3) => {
|
|
2083
|
+
X2.current = t3;
|
|
2084
|
+
await (async () => !(!await j2.then() || !O2.current))() && X2.current === t3 && O2.current.dragStart(e3, t3);
|
|
2085
|
+
}, [k2]), [Q2, ee2] = oe(false), ne2 = le(null), ce2 = le(null), ge2 = S(async (e3 = null) => {
|
|
2086
|
+
if (e3 || (e3 = l2.getMovableSelection()[0]), !e3) return y2?.(), false;
|
|
2087
|
+
const t3 = I2.current.get(e3);
|
|
2088
|
+
t3 ? (await K.whenFocus(t3), t3.focus(), ce2.current = t3, ne2.current = null) : ne2.current = e3;
|
|
2089
|
+
}, [l2]);
|
|
2090
|
+
re(() => {
|
|
2091
|
+
Q2 && k2.length > 0 && ce2.current !== k2[0] && ge2(), F2.current && (v2?.(), F2.current = false);
|
|
2092
|
+
}, [k2]);
|
|
2093
|
+
const ue2 = te(() => {
|
|
2094
|
+
const e3 = n2.search({ address: o2.getVisibleRangeCoords(), excludeHidden: true });
|
|
2095
|
+
if (0 === e3.length && 0 === E2.current.size) return null;
|
|
2096
|
+
const t3 = (t4, n3, l3, i4 = true) => {
|
|
2097
|
+
const a4 = t4.isSelected(), s4 = { tabIndex: l3, view: o2, movable: t4, onRefLoad: (e4) => {
|
|
2098
|
+
ne2.current === t4 && (e4.focus(), ce2.current = e4, ne2.current = null), I2.current.set(t4, e4), D2.current.set(e4, t4), n3.rendered = true, U2();
|
|
2099
|
+
}, onRefUnload: (e4) => {
|
|
2100
|
+
I2.current.delete(t4), D2.current.delete(e4), n3.rendered = false, U2();
|
|
2101
|
+
}, onUnFocus: y2, onHide: (e4) => {
|
|
2102
|
+
n3.onHide = e4;
|
|
2103
|
+
}, onShow: (e4) => {
|
|
2104
|
+
n3.onShow = e4;
|
|
2105
|
+
}, isDragging: a4 && (A2 || M2), disabled: d2, renderMovable: r2, updateFrameBounds: (e4) => {
|
|
2106
|
+
W2(t4, e4);
|
|
2107
|
+
}, dragStart: Y2, onMouseUp: () => {
|
|
2108
|
+
if (X2.current = null, B2.current) {
|
|
2109
|
+
T2(false), z2(false);
|
|
2110
|
+
let e4 = false;
|
|
2111
|
+
V2.current?.forEach((t5) => {
|
|
2112
|
+
K.isEqualBounds(t5.movable.getBounds(), t5.startBounds) || (e4 = true);
|
|
2113
|
+
}), e4 ? me2() : pe2();
|
|
2114
|
+
}
|
|
2115
|
+
}, style: { opacity: i4 ? M2 && a4 ? 0.7 : void 0 : 0, zIndex: M2 && a4 ? t4.getZIndex() + e3.length : void 0, pointerEvents: i4 ? void 0 : "none", cursor: A2 && a4 ? "grabbing" : d2 || c2 ? "initial" : "move", boxShadow: !a4 || A2 && !M2 ? void 0 : "1px 1px 2px 2px rgba(0,0,0,.15)" } };
|
|
2116
|
+
return G(jt, { ...s4 }, `movable-${t4.getUUID()}`);
|
|
2117
|
+
}, i3 = E2.current, a3 = /* @__PURE__ */ new Map(), s3 = [];
|
|
2118
|
+
for (let o3 = 0; o3 < e3.length; o3++) {
|
|
2119
|
+
const n3 = e3[o3];
|
|
2120
|
+
if (n3.isClosed()) continue;
|
|
2121
|
+
let l3 = i3.get(n3);
|
|
2122
|
+
l3 || (l3 = { frame: null, shown: null, onShow: null, onHide: null, rendered: false, doShow: (e4, t4) => {
|
|
2123
|
+
if (!t4 || true === t4.shown) return;
|
|
2124
|
+
t4.shown = true;
|
|
2125
|
+
const o4 = ++t4.visibilityRequestId;
|
|
2126
|
+
requestAnimationFrame(() => {
|
|
2127
|
+
const n4 = E2.current.get(e4);
|
|
2128
|
+
n4 && o4 === t4.visibilityRequestId && (t4.onShow?.(e4), n4.shown = true);
|
|
2129
|
+
});
|
|
2130
|
+
}, doHide: async (e4, t4) => {
|
|
2131
|
+
if (!t4 || false === t4?.shown) return;
|
|
2132
|
+
t4.shown = false;
|
|
2133
|
+
const o4 = ++t4.visibilityRequestId, n4 = await Promise.resolve(t4.onHide?.(e4));
|
|
2134
|
+
o4 === t4.visibilityRequestId && false !== n4 && (t4.shown = false, E2.current.delete(e4), $2());
|
|
2135
|
+
}, visibilityRequestId: 0 }), l3.frame = t3(n3, l3, o3, true), s3.push(l3.frame), l3.doShow(n3, l3), i3.delete(n3), a3.set(n3, l3);
|
|
2136
|
+
}
|
|
2137
|
+
const g3 = [];
|
|
2138
|
+
return l2.getMovableSelection().forEach((e4) => {
|
|
2139
|
+
const o3 = i3.get(e4);
|
|
2140
|
+
o3 && (o3.frame = t3(e4, o3, -1, false), g3.push(o3.frame), i3.delete(e4), a3.set(e4, o3));
|
|
2141
|
+
}), i3.forEach((e4, o3) => {
|
|
2142
|
+
e4.frame = t3(o3, e4, -1, false), g3.push(e4.frame), e4.doHide(o3, e4), i3.delete(o3), a3.set(o3, e4);
|
|
2143
|
+
}), E2.current = a3, U2(), [...g3, ...s3];
|
|
2144
|
+
}, [P2, o2, r2, d2, c2, g2, M2, A2]), he2 = S((e3, t3) => {
|
|
2145
|
+
const n3 = `${t3} ${1 === k2.length ? w.capitalize(D2.current?.get(k2[0]).getContent().getType()) : "Drawings"}`;
|
|
2146
|
+
B2.current && (console.warn(`Transaction ${B2.current.getDescription()} is being replaced by ${n3}`), B2.current.rollback(), B2.current = null), B2.current = i2.beginCommit({ description: n3 }), V2.current.clear();
|
|
2147
|
+
for (let e4 = 0; e4 < k2.length; e4++) {
|
|
2148
|
+
const t4 = k2[e4], n4 = D2.current?.get(t4);
|
|
2149
|
+
n4 ? V2.current.set(t4, { movable: n4, startBounds: o2.toViewBounds(n4.getBounds()) }) : console.warn("invalid element", n4);
|
|
2150
|
+
}
|
|
2151
|
+
}, [i2, o2, k2]), me2 = ae(() => {
|
|
2152
|
+
if (!B2.current) return;
|
|
2153
|
+
const e3 = [];
|
|
2154
|
+
V2.current?.forEach((t3) => {
|
|
2155
|
+
e3.push(t3.movable);
|
|
2156
|
+
}), B2.current.commit({ viewAfter: { view: l2, movableSelection: e3 } }), V2.current.clear(), B2.current = null;
|
|
2157
|
+
}, []), pe2 = ae(() => {
|
|
2158
|
+
B2.current && (B2.current.rollback(), B2.current = null);
|
|
2159
|
+
}, []), fe2 = le(null);
|
|
2160
|
+
re(() => {
|
|
2161
|
+
fe2.current && (fe2.current.onscroll = (e3) => {
|
|
2162
|
+
e3.preventDefault(), e3.srcElement.scrollTop = 0, e3.srcElement.scrollLeft = 0;
|
|
2163
|
+
});
|
|
2164
|
+
}, [fe2.current]);
|
|
2165
|
+
const we2 = b(t2, () => ({ isMovableArea: () => true, focusMovable: ge2, focus: () => {
|
|
2166
|
+
ge2();
|
|
2167
|
+
} }), [l2]), [qe2, ve2] = oe(null), ye2 = le(false), Ce2 = le(false), be2 = le(false);
|
|
2168
|
+
re(() => {
|
|
2169
|
+
if (d2 || 0 === k2.length) return;
|
|
2170
|
+
if (be2.current) return;
|
|
2171
|
+
if (ye2.current) return;
|
|
2172
|
+
if (Ce2.current) return void requestAnimationFrame(() => {
|
|
2173
|
+
O2.current && H2.current && O2.current.refTargets.length > 0 && (be2.current = true, _2.current?.(true)), R2([...k2]);
|
|
2174
|
+
});
|
|
2175
|
+
ye2.current = true;
|
|
2176
|
+
const e3 = J.lazy(async () => {
|
|
2177
|
+
try {
|
|
2178
|
+
const e4 = await import("./CE0w-7gilZUYdTqb.mjs");
|
|
2179
|
+
return ye2.current = false, Ce2.current = true, R2([...k2]), e4;
|
|
2180
|
+
} catch (e4) {
|
|
2181
|
+
return console.warn(e4), _2.current?.(false), null;
|
|
2182
|
+
}
|
|
2183
|
+
});
|
|
2184
|
+
ve2(e3);
|
|
2185
|
+
}, [k2, d2, c2, g2]);
|
|
2186
|
+
const Se2 = te(() => !qe2 || d2 ? null : G(de, { children: G(qe2, { className: Me({ dragging: M2 || A2, resizing: M2, moving: A2 }), container: null, ref: O2, target: O2.current ? k2 : [], draggable: !d2 && !c2, resizable: !d2 && !g2, individualGroupable: true, edgeDraggable: false, throttleDrag: 2, throttleResize: 2, origin: false, keepRatio: false, renderDirections: m2, onResizeStart: (e3) => {
|
|
2187
|
+
he2(e3.target, "Resize");
|
|
2188
|
+
}, onResize: (e3) => {
|
|
2189
|
+
if (!B2.current) return e3.stopDrag(), void $2();
|
|
2190
|
+
T2(true);
|
|
2191
|
+
const t3 = 0 !== e3.direction[0] && 0 !== e3.direction[1];
|
|
2192
|
+
let n3 = 0, l3 = 0;
|
|
2193
|
+
for (let r3 = 0; r3 < k2.length; r3++) {
|
|
2194
|
+
const i3 = k2[r3], a3 = V2.current.get(i3), s3 = D2.current.get(i3);
|
|
2195
|
+
if (!a3 || !s3) {
|
|
2196
|
+
console.warn("invalid element");
|
|
2197
|
+
continue;
|
|
2198
|
+
}
|
|
2199
|
+
let d3 = e3.dist[0], c3 = e3.dist[1], g3 = e3.drag.dist[0], u3 = e3.drag.dist[1], h3 = a3.startBounds.width, m3 = a3.startBounds.height;
|
|
2200
|
+
0 === r3 ? (n3 = h3, l3 = m3) : (d3 *= h3 / n3, g3 *= h3 / n3, c3 *= m3 / l3, u3 *= m3 / l3);
|
|
2201
|
+
const p3 = { ...a3.startBounds };
|
|
2202
|
+
if (p3.width = Math.max(0, h3 + d3), p3.height = Math.max(0, m3 + c3), -1 === e3.direction[0] && (p3.width = Math.max(0, Math.min(a3.startBounds.x + h3, h3 - g3))), -1 === e3.direction[1] && (p3.height = Math.max(0, Math.min(a3.startBounds.y + m3, m3 - u3))), t3 && (s3.isLockAspectRatio() || e3.inputEvent?.shiftKey)) {
|
|
2203
|
+
const e4 = h3 / m3, t4 = p3.width / p3.height;
|
|
2204
|
+
t4 > e4 ? p3.height = p3.width / e4 : t4 < e4 && (p3.width = p3.height * e4);
|
|
2205
|
+
}
|
|
2206
|
+
-1 === e3.direction[0] && (p3.x = Math.max(0, Math.min(a3.startBounds.x + h3, a3.startBounds.x + h3 - p3.width))), -1 === e3.direction[1] && (p3.y = Math.min(a3.startBounds.y + m3, a3.startBounds.y + m3 - p3.height)), a3.movable.setBounds(o2.toAbsoluteBounds(p3));
|
|
2207
|
+
}
|
|
2208
|
+
}, onResizeEnd: (e3) => {
|
|
2209
|
+
T2(false), me2();
|
|
2210
|
+
}, onDragStart: (e3) => {
|
|
2211
|
+
he2(e3.target, "Move");
|
|
2212
|
+
}, onDrag: (e3) => {
|
|
2213
|
+
if (!B2.current) return e3.stopDrag(), void $2();
|
|
2214
|
+
z2(true);
|
|
2215
|
+
for (let t3 = 0; t3 < k2.length; t3++) {
|
|
2216
|
+
const n3 = k2[t3], l3 = V2.current.get(n3);
|
|
2217
|
+
l3 ? l3.movable.setBounds(o2.toAbsoluteBounds({ ...l3.startBounds, x: l3.startBounds.x + e3.translate[0], y: l3.startBounds.y + e3.translate[1] })) : console.warn("invalid element");
|
|
2218
|
+
}
|
|
2219
|
+
}, onDragEnd: (e3) => {
|
|
2220
|
+
}, onMouseUp: (e3) => {
|
|
2221
|
+
} }) }), [P2, qe2, k2, o2, d2, c2, g2, M2, A2]);
|
|
2222
|
+
return G("div", { className: Me(u2, "movable-area", Kt), style: { width: q2.width, height: q2.height, ...h2, position: "absolute", overflow: "hidden", willChange: "transform" }, ref: ke([we2, fe2]), ...f2, children: G("div", { className: "movable-scroll", style: { position: "absolute", cursor: "initial", left: 0, top: 0, width: q2.width, height: q2.height }, ...f2, children: Z("div", { ref: H2, style: { position: "absolute", pointerEvents: "auto" }, onFocus: (e3) => {
|
|
2223
|
+
C2?.(), ee2(true);
|
|
2224
|
+
}, onBlur: (e3) => {
|
|
2225
|
+
ee2(false);
|
|
2226
|
+
}, onKeyDownCapture: (e3) => {
|
|
2227
|
+
if (e3.isDefaultPrevented()) return;
|
|
2228
|
+
const t3 = e3.nativeEvent.ctrlKey, o3 = e3.nativeEvent.altKey, r3 = e3.nativeEvent.shiftKey;
|
|
2229
|
+
if (e3.which === x.Escape) {
|
|
2230
|
+
const t4 = l2.getMovableSelection();
|
|
2231
|
+
let o4 = [...t4];
|
|
2232
|
+
return k2.forEach((e4) => {
|
|
2233
|
+
if (0 === o4.length) return;
|
|
2234
|
+
const t5 = D2.current.get(e4);
|
|
2235
|
+
let n3 = o4.indexOf(t5);
|
|
2236
|
+
o4.splice(n3, 1);
|
|
2237
|
+
}), o4.length !== t4.length && l2.selectMovables(o4), 0 === o4.length && y2?.(), void e3.preventDefault();
|
|
2238
|
+
}
|
|
2239
|
+
const i3 = 0.1, a3 = (e4) => {
|
|
2240
|
+
n2.updateSelected((t4) => {
|
|
2241
|
+
t4.setRotation(t4.getRotation() + e4);
|
|
2242
|
+
}, "Rotate");
|
|
2243
|
+
}, s3 = (e4, t4 = true) => {
|
|
2244
|
+
n2.updateSelected((o4) => {
|
|
2245
|
+
const n3 = o4.getBounds();
|
|
2246
|
+
let l3 = 1 + e4;
|
|
2247
|
+
t4 || (l3 = 1 / l3);
|
|
2248
|
+
const r4 = Math.sqrt(Math.pow(n3.width, 2) + Math.pow(n3.height, 2)), i4 = Math.atan2(n3.height, n3.width), a4 = l3 * r4;
|
|
2249
|
+
if (a4 < 10) return;
|
|
2250
|
+
const s4 = a4 * Math.cos(i4), d4 = a4 * Math.sin(i4), c3 = { x: n3.x + (n3.width - s4) / 2, y: n3.y + (n3.height - d4) / 2, width: s4, height: d4 };
|
|
2251
|
+
o4.setBounds(c3);
|
|
2252
|
+
}, "Resize");
|
|
2253
|
+
}, d3 = (e4) => {
|
|
2254
|
+
n2.updateSelected((t4) => {
|
|
2255
|
+
const o4 = t4.getBounds(), n3 = { x: o4.x + (e4.x ?? 0), y: o4.y + (e4.y ?? 0), width: o4.width + (e4.width ?? 0), height: o4.height + (e4.height ?? 0) };
|
|
2256
|
+
t4.setBounds(n3);
|
|
2257
|
+
}, "Nudge");
|
|
2258
|
+
};
|
|
2259
|
+
if (e3.which === x.Delete) n2.updateSelected((e4) => {
|
|
2260
|
+
e4.delete();
|
|
2261
|
+
}, "Delete"), e3.preventDefault();
|
|
2262
|
+
else if ("a" === e3.key && t3) {
|
|
2263
|
+
const t4 = l2.getMovableSelection();
|
|
2264
|
+
l2.selectMovables(n2.search(), true), l2.selectMovables(t4, true), e3.preventDefault();
|
|
2265
|
+
} else "ArrowLeft" === e3.key ? (r3 ? s3(i3, false) : o3 ? a3(-10) : d3({ x: t3 ? -10 : -1 }), e3.preventDefault()) : "ArrowRight" === e3.key ? (r3 ? s3(i3, true) : o3 ? a3(10) : d3({ x: t3 ? 10 : 1 }), e3.preventDefault()) : "ArrowUp" === e3.key ? (r3 ? s3(i3, true) : d3({ y: t3 ? -10 : -1 }), e3.preventDefault()) : "ArrowDown" === e3.key && (r3 ? s3(i3, false) : d3({ y: t3 ? 10 : 1 }), e3.preventDefault());
|
|
2266
|
+
}, children: [ue2, Se2] }) }) });
|
|
2267
|
+
})), Yt = (e2) => {
|
|
2268
|
+
let t2 = Number.MAX_SAFE_INTEGER, o2 = Number.MAX_SAFE_INTEGER, n2 = 0, l2 = 0;
|
|
2269
|
+
for (let r2 = 0; r2 < e2.length; r2++) {
|
|
2270
|
+
const i2 = e2[r2].getBounds();
|
|
2271
|
+
t2 = Math.min(i2.x, t2), o2 = Math.min(i2.y, o2), n2 = Math.max(i2.x + i2.width, n2), l2 = Math.max(i2.y + i2.height, l2);
|
|
2272
|
+
}
|
|
2273
|
+
return { x: t2, y: o2, width: n2 - t2, height: l2 - o2 };
|
|
2274
|
+
}, Qt = (e2, t2 = true) => {
|
|
2275
|
+
const o2 = [], n2 = t2 ? "x" : "y", l2 = t2 ? "y" : "x", r2 = t2 ? "width" : "height";
|
|
2276
|
+
let i2 = 0, a2 = Number.MAX_SAFE_INTEGER, s2 = 0;
|
|
2277
|
+
for (let t3 = 0; t3 < e2.length; t3++) {
|
|
2278
|
+
const l3 = e2[t3], d3 = l3.getBounds();
|
|
2279
|
+
i2 += d3[r2], a2 = Math.min(d3[n2], a2), s2 = Math.max(d3[n2] + d3[r2], s2), o2.push({ bounds: d3, movable: l3 });
|
|
2280
|
+
}
|
|
2281
|
+
const d2 = (s2 - a2 - i2) / (e2.length - 1);
|
|
2282
|
+
o2.sort((e3, t3) => {
|
|
2283
|
+
const o3 = e3.bounds[n2], r3 = t3.bounds[n2];
|
|
2284
|
+
return o3 !== r3 ? o3 - r3 : e3.bounds[l2] - t3.bounds[l2];
|
|
2285
|
+
});
|
|
2286
|
+
const c2 = /* @__PURE__ */ new Map();
|
|
2287
|
+
c2.set(o2[0].movable, o2[0].bounds);
|
|
2288
|
+
for (let e3 = 1; e3 < o2.length - 1; e3++) {
|
|
2289
|
+
const t3 = o2[e3 - 1].bounds, l3 = { ...o2[e3].bounds };
|
|
2290
|
+
l3[n2] = t3[n2] + t3[r2] + d2, o2[e3].bounds = l3, c2.set(o2[e3].movable, l3);
|
|
2291
|
+
}
|
|
2292
|
+
return c2.set(o2[o2.length - 1].movable, o2[o2.length - 1].bounds), c2;
|
|
2293
|
+
};
|
|
2294
|
+
function Jt(e2) {
|
|
2295
|
+
const { movables: t2, movablesView: o2, transactional: n2, commands: l2, target: r2, onRepeatCommandChange: i2, notifier: a2 } = e2, s2 = z();
|
|
2296
|
+
le(s2.getMode()).current = s2.getMode();
|
|
2297
|
+
const d2 = S(async (e3, t3, o3 = null, n3 = true) => {
|
|
2298
|
+
const l3 = async () => {
|
|
2299
|
+
const d3 = await Promise.resolve(a2?.showBusy?.(e3.label()));
|
|
2300
|
+
try {
|
|
2301
|
+
await t3();
|
|
2302
|
+
const a3 = o3 ?? e3?.label?.();
|
|
2303
|
+
if (i2) {
|
|
2304
|
+
let t4 = null;
|
|
2305
|
+
e3 && false !== a3 && (t4 = new k(e3.key(), r2, { label: a3, description: a3 }, l3)), i2(t4);
|
|
2306
|
+
}
|
|
2307
|
+
d3?.(), n3 && s2.setMode(null);
|
|
2308
|
+
} catch (e4) {
|
|
2309
|
+
d3?.(), a2?.showError?.(e4);
|
|
2310
|
+
}
|
|
2311
|
+
};
|
|
2312
|
+
await l3();
|
|
2313
|
+
}, [i2, a2]), [c2, g2] = se((e3) => e3 + 1, 0), u2 = S((e3, t3, l3) => {
|
|
2314
|
+
if (!o2) return;
|
|
2315
|
+
const r3 = o2.getMovableSelection();
|
|
2316
|
+
if (0 === r3.length) return;
|
|
2317
|
+
let i3 = "Drawings";
|
|
2318
|
+
if (1 === r3.length) {
|
|
2319
|
+
const e4 = r3[0];
|
|
2320
|
+
i3 = w.capitalize(e4.getContent().getType()) ?? "Drawing";
|
|
2321
|
+
}
|
|
2322
|
+
const a3 = `${e3.label()} ${i3}`;
|
|
2323
|
+
d2(e3, () => {
|
|
2324
|
+
let e4 = null;
|
|
2325
|
+
n2 && (e4 = n2.beginCommit(a3));
|
|
2326
|
+
const r4 = o2.getMovableSelection();
|
|
2327
|
+
if (0 === r4.length) return;
|
|
2328
|
+
const i4 = l3?.(r4);
|
|
2329
|
+
for (let e5 = 0; e5 < r4.length; e5++) {
|
|
2330
|
+
const o3 = r4[e5];
|
|
2331
|
+
t3(o3, i4);
|
|
2332
|
+
}
|
|
2333
|
+
e4?.commit();
|
|
2334
|
+
});
|
|
2335
|
+
}, [o2, n2]), [h2, m2] = oe(o2.getMovableSelection()[0] ?? null), [p2, f2] = oe(!h2 || h2?.isProtected()), v2 = te(() => [new R("moveToFront", r2, { label: "Bring to Front", description: "Move to the front of all of the other drawings.", shortcut: { key: "BracketRight", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
2336
|
+
u2(this, (e3) => {
|
|
2337
|
+
e3.moveToFront();
|
|
2338
|
+
});
|
|
2339
|
+
}), new R("moveForward", r2, { label: "Bring Forward", description: "Move forward one layer in the z order.", shortcut: { key: "BracketRight", modifiers: [M.Ctrl] } }, function() {
|
|
2340
|
+
u2(this, (e3) => {
|
|
2341
|
+
e3.moveForward();
|
|
2342
|
+
});
|
|
2343
|
+
}), new R("moveToBack", r2, { label: "Send to Back", description: "Move to the back of all of the other drawings.", shortcut: { key: "BracketLeft", modifiers: [M.Ctrl, M.Shift] } }, function() {
|
|
2344
|
+
u2(this, (e3) => {
|
|
2345
|
+
e3.moveToBack();
|
|
2346
|
+
});
|
|
2347
|
+
}), new R("moveBackward", r2, { label: "Send Backward", description: "Move backwards one layer in the z order.", shortcut: { key: "BracketLeft", modifiers: [M.Ctrl] } }, function() {
|
|
2348
|
+
u2(this, (e3) => {
|
|
2349
|
+
e3.moveBackward();
|
|
2350
|
+
});
|
|
2351
|
+
}), new R("toggleLockAspectRatio", r2, { label: "Lock Aspect Ratio", description: "Toggle whether the aspect ratio should be maintained when resizing from corners." }, function() {
|
|
2352
|
+
u2(this, (e3) => {
|
|
2353
|
+
e3.setLockAspectRatio(!e3.isLockAspectRatio());
|
|
2354
|
+
});
|
|
2355
|
+
}), new R("formatAnchorTypeTwoCell", r2, { label: "Move and size with cells", description: "Set your drawing to move and resize when underling sheet resizes." }, function() {
|
|
2356
|
+
u2(this, (e3) => {
|
|
2357
|
+
e3.setAnchorType(q.Type.TwoCell);
|
|
2358
|
+
});
|
|
2359
|
+
}), new R("formatAnchorTypeOneCell", r2, { label: "Move but don't size with cells", description: "Set your drawing to only move when underling sheet resizes." }, function() {
|
|
2360
|
+
u2(this, (e3) => {
|
|
2361
|
+
e3.setAnchorType(q.Type.OneCell);
|
|
2362
|
+
});
|
|
2363
|
+
}), new R("formatAnchorTypeAbsolute", r2, { label: "Don't move or size with cells", description: "Set your drawing to never move or resize when underling sheet resizes." }, function() {
|
|
2364
|
+
u2(this, (e3) => {
|
|
2365
|
+
e3.setAnchorType(q.Type.Absolute);
|
|
2366
|
+
});
|
|
2367
|
+
}), new R("formatDrawAlignLeft", r2, { label: "Align Left", description: "Align the selected drawings to the left." }, function() {
|
|
2368
|
+
u2(this, (e3, t3) => {
|
|
2369
|
+
e3.setBounds({ x: t3.x });
|
|
2370
|
+
}, Yt);
|
|
2371
|
+
}), new R("formatDrawAlignCenter", r2, { label: "Align Center", description: "Align the selected drawings vertically relative to each other." }, function() {
|
|
2372
|
+
u2(this, (e3, t3) => {
|
|
2373
|
+
e3.setBounds({ x: (t3.width - e3.getBounds().width) / 2 + t3.x });
|
|
2374
|
+
}, Yt);
|
|
2375
|
+
}), new R("formatDrawAlignRight", r2, { label: "Align Right", description: "Align the selected drawings to the right." }, function() {
|
|
2376
|
+
u2(this, (e3, t3) => {
|
|
2377
|
+
e3.setBounds({ x: t3.width - e3.getBounds().width + t3.x });
|
|
2378
|
+
}, Yt);
|
|
2379
|
+
}), new R("formatDrawAlignTop", r2, { label: "Align Top", description: "Align the selected drawings to the top." }, function() {
|
|
2380
|
+
u2(this, (e3, t3) => {
|
|
2381
|
+
e3.setBounds({ y: t3.y });
|
|
2382
|
+
}, Yt);
|
|
2383
|
+
}), new R("formatDrawAlignMiddle", r2, { label: "Align Middle", description: "Align the selected drawings horizontally relative to each other." }, function() {
|
|
2384
|
+
u2(this, (e3, t3) => {
|
|
2385
|
+
e3.setBounds({ y: (t3.height - e3.getBounds().height) / 2 + t3.y });
|
|
2386
|
+
}, Yt);
|
|
2387
|
+
}), new R("formatDrawAlignBottom", r2, { label: "Align Bottom", description: "Align the selected drawings to the bottom." }, function() {
|
|
2388
|
+
u2(this, (e3, t3) => {
|
|
2389
|
+
e3.setBounds({ y: t3.height - e3.getBounds().height + t3.y });
|
|
2390
|
+
}, Yt);
|
|
2391
|
+
}), new R("formatDrawDistributeHorz", r2, { label: "Distribute Horizontally", description: "Distribute the selected drawings horizontally with equal spacing between each." }, function() {
|
|
2392
|
+
u2(this, (e3, t3) => {
|
|
2393
|
+
e3.setBounds(t3.get(e3));
|
|
2394
|
+
}, (e3) => Qt(e3));
|
|
2395
|
+
}), new R("formatDrawDistributeVert", r2, { label: "Distribute Vertically", description: "Distribute the selected drawings vertically with equal spacing between each." }, function() {
|
|
2396
|
+
u2(this, (e3, t3) => {
|
|
2397
|
+
e3.setBounds(t3.get(e3));
|
|
2398
|
+
}, (e3) => Qt(e3, false));
|
|
2399
|
+
}), new R("formatDrawFlipHorz", r2, { label: "Flip Horizontally", description: "Flip the selected drawings horizontally." }), new R("formatDrawFlipVert", r2, { label: "Flip Vertically", description: "Flip the selected drawings vertically." }), new R("formatDrawGroup", r2, { label: "Group", description: "Group the selected drawings into a single drawing." }), new R("formatDrawUngroup", r2, { label: "Ungroup", description: "Break the group of a drawing into individual drawings." }), new R("formatDrawSwapShapes", r2, { label: "Swap Shapes", description: "Swap the positions of the swap." }), new R("formatDrawSwapShapesHorz", r2, { label: "Swap Shapes Horizontally", description: "Swap the positions of the swap horizontally." }), new R("formatDrawSwapShapesVert", r2, { label: "Swap Shapes Vertically", description: "Swap the positions of the swap vertically." })], [o2, h2]);
|
|
2400
|
+
re(() => {
|
|
2401
|
+
}, [s2]);
|
|
2402
|
+
const y2 = te(() => {
|
|
2403
|
+
let e3 = null;
|
|
2404
|
+
return e3 = l2 ? l2.createChildGroup(r2, "movable", false) : new T(r2, "movable"), e3.addCommands(v2, true), e3;
|
|
2405
|
+
}, [l2, v2]);
|
|
2406
|
+
return Ct(h2, { onAnyChange: () => {
|
|
2407
|
+
y2.getCommand("formatAnchorTypeTwoCell").update({ state: h2?.getAnchorType() === q.Type.TwoCell }), y2.getCommand("formatAnchorTypeOneCell").update({ state: h2?.getAnchorType() === q.Type.OneCell }), y2.getCommand("formatAnchorTypeAbsolute").update({ state: h2?.getAnchorType() === q.Type.Absolute }), y2.getCommand("formatAnchorTypeAbsolute").update({ state: h2?.getAnchorType() === q.Type.Absolute }), y2.getCommand("toggleLockAspectRatio").update({ state: h2?.isLockAspectRatio() });
|
|
2408
|
+
}, onProtectedChange: (e3) => {
|
|
2409
|
+
f2(e3.isProtected());
|
|
2410
|
+
}, onDelete: () => {
|
|
2411
|
+
} }), Ct(o2, { onMovableSelectionChange: () => {
|
|
2412
|
+
const e3 = o2.getMovableSelection()[0] ?? null;
|
|
2413
|
+
m2(e3), f2(!e3 || e3.isProtected()), g2();
|
|
2414
|
+
} }), Ct(t2, { onCollectionChange: () => {
|
|
2415
|
+
g2();
|
|
2416
|
+
} }), re(() => {
|
|
2417
|
+
const e3 = { disabled: p2 };
|
|
2418
|
+
y2.getCommand("formatAnchorTypeTwoCell").update(e3), y2.getCommand("formatAnchorTypeOneCell").update(e3), y2.getCommand("formatAnchorTypeAbsolute").update(e3), y2.getCommand("toggleLockAspectRatio").update(e3);
|
|
2419
|
+
const n3 = t2.getCount(), l3 = o2.getMovableSelection(), r3 = p2 || n3 <= 1 || 0 === l3.length;
|
|
2420
|
+
let i3 = { disabled: r3 }, a3 = i3;
|
|
2421
|
+
if (!r3 && 1 === l3.length) {
|
|
2422
|
+
const e4 = l3[0];
|
|
2423
|
+
0 === e4.getZIndex() && (i3 = { disabled: true }), e4.getZIndex() === n3 - 1 && (a3 = { disabled: true });
|
|
2424
|
+
}
|
|
2425
|
+
y2.getCommand("moveToFront").update(a3), y2.getCommand("moveForward").update(a3), y2.getCommand("moveToBack").update(i3), y2.getCommand("moveBackward").update(i3);
|
|
2426
|
+
const s3 = { disabled: p2 || l3.length <= 1 };
|
|
2427
|
+
y2.getCommand("formatDrawAlignLeft").update(s3), y2.getCommand("formatDrawAlignCenter").update(s3), y2.getCommand("formatDrawAlignRight").update(s3), y2.getCommand("formatDrawAlignTop").update(s3), y2.getCommand("formatDrawAlignMiddle").update(s3), y2.getCommand("formatDrawAlignBottom").update(s3), y2.getCommand("formatDrawFlipHorz").update(s3), y2.getCommand("formatDrawFlipVert").update(s3), y2.getCommand("formatDrawGroup").update(s3), y2.getCommand("formatDrawUngroup").update(s3), y2.getCommand("formatDrawSwapShapes").update(s3), y2.getCommand("formatDrawSwapShapesHorz").update(s3), y2.getCommand("formatDrawSwapShapesVert").update(s3);
|
|
2428
|
+
const d3 = { disabled: p2 || l3.length <= 2 };
|
|
2429
|
+
y2.getCommand("formatDrawDistributeHorz").update(d3), y2.getCommand("formatDrawDistributeVert").update(d3);
|
|
2430
|
+
}, [c2, p2, c2]), y2;
|
|
2431
|
+
}
|
|
2432
|
+
const eo = ee(ne((e2, t2) => {
|
|
2433
|
+
const { children: o2, disabled: n2, description: l2, view: r2, isDragging: i2, onHide: a2, onShow: s2, ...d2 } = e2;
|
|
2434
|
+
re(() => {
|
|
2435
|
+
}, [l2]);
|
|
2436
|
+
const c2 = b(t2, () => ({ isEmptyFrame: () => true }), []), [g2, { height: u2, width: h2 }] = Re();
|
|
2437
|
+
return G("div", { ...d2, ref: ke([c2, g2]), children: G("div", { className: "chart-editor", style: { width: "100%", height: "100%", border: "var(--sxl-app-color-grey, grey) solid 1px", backgroundColor: "var(--sxl-app-color-background, white)", backgroundImage: "var(--sxl-app-image-background)", alignItems: "center", justifyContent: "center", zoom: r2.getZoom(), display: "flex", position: "relative", filter: n2 ? "blur(1px)" : void 0, boxShadow: i2 ? "1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))" : void 0 }, children: G("div", { style: { textAlign: "center" }, children: l2 }) }) });
|
|
2438
|
+
})), to = ee(ne((e2, t2) => {
|
|
2439
|
+
const { view: o2, sheet: n2, movableProps: l2, renderMovable: r2, commands: i2, target: a2, notifier: s2, onRepeatCommandChange: d2 } = e2, c2 = Jt({ movables: n2.getMovables(), movablesView: n2?.getView(), transactional: n2, onRepeatCommandChange: d2, commands: i2, target: a2, notifier: s2 });
|
|
2440
|
+
re(() => {
|
|
2441
|
+
o2?.getStage();
|
|
2442
|
+
}, [o2?.getStage()]);
|
|
2443
|
+
const g2 = te(() => G(Xt, { ref: t2, view: o2, movables: n2.getMovables(), disableResize: !n2.getProtection().isObjectsAllowed(), disableDrag: !n2.getProtection().isObjectsAllowed(), movablesView: n2.getView(), transactional: n2, renderMovable: r2, ...l2, onFocus: () => {
|
|
2444
|
+
c2.activate(), l2?.onFocus?.();
|
|
2445
|
+
} }, "movable-area"), [n2, l2, i2, c2]);
|
|
2446
|
+
return g2 && o2 ? g2 : null;
|
|
2447
|
+
})), oo = ee(ne((e2, t2) => {
|
|
2448
|
+
const { view: o2, sheet: n2, gridStyle: l2, getCellEditor: r2, showProtectedError: i2, setEditingCoords: a2, commands: d2, notifier: c2 = H } = e2, g2 = z(), [u2, h2] = oe(null), [m2, p2] = oe(null), [f2, q2] = oe(null), [v2, y2] = oe(null), [C2, b2] = oe(null);
|
|
2449
|
+
ie(() => {
|
|
2450
|
+
if (null === f2) return y2(null), void b2(null);
|
|
2451
|
+
const e3 = () => {
|
|
2452
|
+
const e4 = n2.getRange(f2).getCell(), t3 = e4.getStyle();
|
|
2453
|
+
let o3, r3 = t3.getFill()?.toCSS(l2.body.darkMode);
|
|
2454
|
+
"none" !== r3.background && "transparent" !== r3.background || (r3 = n2.getStyles().getNormal().getFill().toCSS(l2.body.darkMode)), "none" !== r3.background && "transparent" !== r3.background || (r3 = { background: l2.body.fill }), y2({ style: r3 }), e4 && !e4.getFormula() && (o3 = e4?.getRenderHorizontalAlignment()), b2(o3 ?? B.Left);
|
|
2455
|
+
};
|
|
2456
|
+
return e3(), n2.getRange(f2).addListener(() => {
|
|
2457
|
+
e3();
|
|
2458
|
+
});
|
|
2459
|
+
}, [n2, f2, l2?.body]);
|
|
2460
|
+
const x2 = S(() => {
|
|
2461
|
+
let e3 = m2.editState.dirty ?? "";
|
|
2462
|
+
if (void 0 !== m2.editState.dirty) {
|
|
2463
|
+
const t3 = w.clampString(e3);
|
|
2464
|
+
try {
|
|
2465
|
+
const o3 = m2.sheet.getRange(m2.coords), n3 = `Typing '${t3}' into ${o3.toString()}`;
|
|
2466
|
+
return o3.setValue(e3, { description: n3, autoFit: true }), q2(null), p2(null), g2.setMode(null), a2(null), true;
|
|
2467
|
+
} catch (e4) {
|
|
2468
|
+
throw c2.showError(new Error(`Unable to enter '${t3}'.`, { cause: e4 })), e4;
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
}, [n2, m2, c2]), k2 = S((e3) => n2.getRange(e3).getCell().getExtrusions() ?? Q.cellToRange(e3), [n2]), R2 = S((e3) => {
|
|
2472
|
+
let t3 = s.Orientation.Row, o3 = false;
|
|
2473
|
+
e3 !== s.Direction.Up && e3 !== s.Direction.Down || (t3 = s.Orientation.Column), e3 !== s.Direction.Left && e3 !== s.Direction.Up || (o3 = true), n2.getSelection().traverse(t3, o3);
|
|
2474
|
+
}, [n2]), M2 = ae((e3, t3) => {
|
|
2475
|
+
if (r2) return r2(e3, t3);
|
|
2476
|
+
if (!n2) return null;
|
|
2477
|
+
const { ref: o3, ...i3 } = e3;
|
|
2478
|
+
return G(lt, { ref: o3, ...i3, sheet: n2, bodyStyle: l2?.body, activeCoords: t3, commands: d2, onChangeEdit: (e4) => {
|
|
2479
|
+
const o4 = { sheet: n2, coords: t3, editState: e4 };
|
|
2480
|
+
g2.setMode((e5) => ({ ...e5, description: o4.editState.editMode ? "Edit" : "Enter", args: { ...e5?.args, stateAndCoords: o4 } }));
|
|
2481
|
+
}, editState: m2.editState });
|
|
2482
|
+
}, [n2, v2, r2, m2, f2]), { overlay: T2, startEdit: A2, submitEdit: F2, cancelEdit: E2, onKeyboardEventNative: D2, onPointerEventNative: I2 } = be({ view: o2, activeCoords: u2, getCellEditor: M2, canEdit: () => {
|
|
2483
|
+
const e3 = !n2.getProtection().isLocked();
|
|
2484
|
+
return e3 || i2(), e3;
|
|
2485
|
+
}, onBeforeStartEdit: (e3) => {
|
|
2486
|
+
const t3 = rt(() => n2.getRange(e3).getCell()), o3 = { sheet: n2, coords: e3, editState: Object.freeze(t3) };
|
|
2487
|
+
g2.setMode({ key: "edit", args: { stateAndCoords: o3 } }), p2(o3);
|
|
2488
|
+
}, onStartEdit: (e3) => {
|
|
2489
|
+
q2(e3), a2(e3);
|
|
2490
|
+
}, onSubmitEdit: x2, onCancelEdit: (e3) => {
|
|
2491
|
+
q2(null), p2(null), g2.setMode(null), a2(null);
|
|
2492
|
+
}, onDoneEdit: (e3) => {
|
|
2493
|
+
g2.setMode(null);
|
|
2494
|
+
}, onNavigate: R2, containerProps: v2, borderStrokeFill: l2.selection?.strokeFill, borderStrokeWidth: n2?.getSelection().getCoords().ranges?.length > 1 ? 1 : 2, alignment: C2, getRangeCoords: k2 });
|
|
2495
|
+
Ct(n2.getSelection(), { onChange(e3) {
|
|
2496
|
+
h2(n2.getSelection().getCoords().cell);
|
|
2497
|
+
} });
|
|
2498
|
+
const V2 = S((e3) => {
|
|
2499
|
+
I2(e3), f2 && F2();
|
|
2500
|
+
}, [I2, E2, f2]), N2 = ae((e3) => {
|
|
2501
|
+
I2(e3);
|
|
2502
|
+
}, [I2]), L2 = ae((e3) => {
|
|
2503
|
+
D2(e3);
|
|
2504
|
+
}, [D2]);
|
|
2505
|
+
return re(() => {
|
|
2506
|
+
const e3 = o2?.getStage();
|
|
2507
|
+
if (e3) return e3.addEventListener("pointerdown", V2), e3.addEventListener("dblclick", N2), e3.addEventListener("keydown", L2), () => {
|
|
2508
|
+
e3.removeEventListener("pointerdown", V2), e3.removeEventListener("dblclick", N2), e3.removeEventListener("keydown", L2);
|
|
2509
|
+
};
|
|
2510
|
+
}, [o2?.getStage()]), re(() => {
|
|
2511
|
+
const e3 = g2.getMode(), t3 = e3?.key;
|
|
2512
|
+
"edit" === t3 || "enter" === t3 ? m2 ? e3.args?.cancel ? E2() : e3.args?.submit ? F2() : p2(e3.args?.stateAndCoords) : A2(e3.args?.start) : f2 && E2();
|
|
2513
|
+
}, [g2]), T2(o2, t2);
|
|
2514
|
+
})), no = "white", lo = "black", ro = `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${lo}' fill='${no}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`, io = `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${lo}' fill='${no}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`, ao = ee(ne((e2, t2) => {
|
|
2515
|
+
const { view: o2, sheet: n2 } = e2, [l2, r2] = J.useState(n2.getTables().getCount() > 0), [i2, a2] = J.useState(null), [s2, d2] = J.useState(null), [c2, g2] = J.useState(null), [u2, h2] = J.useState(null), m2 = S(() => {
|
|
2516
|
+
if (n2.getTables().getCount() > 0) {
|
|
2517
|
+
r2(true);
|
|
2518
|
+
const e3 = n2.getTables().search({ address: o2.getVisibleRangeCoords() });
|
|
2519
|
+
a2(e3.length > 0 ? e3 : null);
|
|
2520
|
+
} else r2(false), a2(null);
|
|
2521
|
+
}, [n2, o2]), p2 = S((e3) => {
|
|
2522
|
+
e3.preventDefault(), e3.stopPropagation();
|
|
2523
|
+
const t3 = o2.getCellCoordsFromClient(e3.clientX, e3.clientY), l3 = n2.getTables().search({ address: t3 });
|
|
2524
|
+
if (1 === l3.length) {
|
|
2525
|
+
l3[0].select();
|
|
2526
|
+
}
|
|
2527
|
+
}, [o2, n2]), f2 = S((e3) => {
|
|
2528
|
+
e3.preventDefault(), e3.stopPropagation();
|
|
2529
|
+
const t3 = o2.getCellCoordsFromClient(e3.clientX, e3.clientY), l3 = n2.getTables().search({ address: t3 });
|
|
2530
|
+
if (1 === l3.length) {
|
|
2531
|
+
const e4 = l3[0].getRange().getCoords(), o3 = { colStart: e4.colStart, rowStart: t3.rowIndex, colEnd: e4.colEnd, rowEnd: t3.rowIndex };
|
|
2532
|
+
n2.getRange(o3).select();
|
|
2533
|
+
}
|
|
2534
|
+
}, [o2, n2]), w2 = S(() => {
|
|
2535
|
+
if (!l2) return;
|
|
2536
|
+
const e3 = n2.getTables().search({ address: o2.getVisibleRangeCoords() });
|
|
2537
|
+
a2(e3.length > 0 ? e3 : null);
|
|
2538
|
+
}, [n2, l2, o2]);
|
|
2539
|
+
Ct(n2?.getSelection(), { onChange(e3) {
|
|
2540
|
+
d2(n2.getSelection().getCoords().cell);
|
|
2541
|
+
} }), Ct(c2, { onAnyChange(e3) {
|
|
2542
|
+
m2(), w2();
|
|
2543
|
+
} }), Ct(u2, { onAnyChange(e3) {
|
|
2544
|
+
w2();
|
|
2545
|
+
} }), Ct(n2, { onTablesChange(e3) {
|
|
2546
|
+
m2(), w2();
|
|
2547
|
+
}, onInvalidated(e3) {
|
|
2548
|
+
m2(), w2();
|
|
2549
|
+
} });
|
|
2550
|
+
const q2 = J.useMemo(() => K.debounce(K.throttle(w2, 300), 300), []);
|
|
2551
|
+
re(() => {
|
|
2552
|
+
q2();
|
|
2553
|
+
}, [o2]), re(() => {
|
|
2554
|
+
let e3 = null;
|
|
2555
|
+
if (i2) for (let t3 = 0; t3 < i2.length && !e3; t3++) {
|
|
2556
|
+
const o3 = i2[t3], n3 = o3.getRange().getCoords();
|
|
2557
|
+
v.isCellWithinRange(s2, n3) && (e3 = o3);
|
|
2558
|
+
}
|
|
2559
|
+
g2(e3);
|
|
2560
|
+
}, [s2, i2]);
|
|
2561
|
+
const y2 = S((e3) => {
|
|
2562
|
+
let t3 = null;
|
|
2563
|
+
if (i2) for (let n3 = 0; n3 < i2.length; n3++) {
|
|
2564
|
+
const l3 = i2[n3], r3 = l3.getRange().getCoords();
|
|
2565
|
+
let a3 = o2.getRangeCoordsBounds(r3);
|
|
2566
|
+
const s3 = o2.getRelativePointFromClient(e3.clientX, e3.clientY), d3 = s3.x, c3 = s3.y;
|
|
2567
|
+
if (d3 >= a3.x && d3 <= a3.x + a3.width && c3 >= a3.y && c3 <= a3.y + a3.height) {
|
|
2568
|
+
const e4 = o2.getViewportSize();
|
|
2569
|
+
d3 <= 0 || c3 <= 0 || d3 >= e4.width || c3 >= e4.height || (t3 = l3);
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
h2(t3);
|
|
2573
|
+
}, [o2, i2]);
|
|
2574
|
+
if (re(() => {
|
|
2575
|
+
const e3 = o2?.getStage();
|
|
2576
|
+
if (e3 && i2) return e3.addEventListener("mousemove", y2), e3.addEventListener("mouseleave", y2), () => {
|
|
2577
|
+
e3.removeEventListener("mousemove", y2), e3.removeEventListener("mouseleave", y2);
|
|
2578
|
+
};
|
|
2579
|
+
}, [i2, o2?.getStage()]), !o2) return null;
|
|
2580
|
+
if (!i2 || 0 === i2.length) return null;
|
|
2581
|
+
const C2 = [];
|
|
2582
|
+
for (let e3 = 0; e3 < i2.length; e3++) {
|
|
2583
|
+
const t3 = i2[e3];
|
|
2584
|
+
if (t3.isClosed()) continue;
|
|
2585
|
+
const l3 = t3 === u2, r3 = t3 === c2, a3 = t3.getRange().getCoords(), s3 = o2.getRangeCoordsBounds(a3);
|
|
2586
|
+
let d3;
|
|
2587
|
+
if (l3 || r3) {
|
|
2588
|
+
const e4 = t3.getStyle().getProperties(), o3 = e4.headerRow?.fill?.background ?? e4.wholeTable?.border?.top?.color?.toString();
|
|
2589
|
+
if (o3 && n2) {
|
|
2590
|
+
const e5 = n2.getStyles().parseColor(o3);
|
|
2591
|
+
e5 && (d3 = e5.toCSS());
|
|
2592
|
+
}
|
|
2593
|
+
d3 || (d3 = "var(--sxl-app-color-shadow, rgba(0,0,0,.15))");
|
|
2594
|
+
}
|
|
2595
|
+
C2.push(G("div", { style: { position: "absolute", left: s3.x, top: s3.y, width: Math.min(16, s3.width), height: s3.height, pointerEvents: "all", cursor: ro }, onMouseDown: f2 }, `table-select-row-${t3.getName()}`)), C2.push(G("div", { style: { position: "absolute", left: s3.x, top: s3.y, width: Math.min(16, s3.width), height: Math.min(16, s3.height), pointerEvents: "all", cursor: io }, onMouseDown: p2 }, `table-select-${t3.getName()}`)), C2.push(G(Se, { x: s3.x, y: s3.y, width: s3.width, height: s3.height, range: a3, strokeWidth: r3 ? 0.5 : 0, stroke: d3 ?? "var(--sxl-app-color-grey, grey)", style: { willChange: "box-shadow", transition: "box-shadow 80ms ease-in-out", boxShadow: l3 ? `${d3} 0px 0px 1px 1px` : void 0 } }, `table-outline-${t3.getName()}`));
|
|
2596
|
+
}
|
|
2597
|
+
return C2;
|
|
2598
|
+
})), so = ee(ne((t2, o2) => {
|
|
2599
|
+
const { view: n2, sheet: l2, animationTime: r2 = 60 } = t2, [i2, a2] = J.useState(null), [s2, d2] = J.useState(null), c2 = J.useRef(null), g2 = S(() => {
|
|
2600
|
+
const e2 = l2.getSelectedCell(), t3 = e2.getSpill()?.getCoords() ?? null;
|
|
2601
|
+
Q.isEqualRanges(t3, i2) || (d2(t3 ? { transition: i2 ? "move" : "in", bounds: n2.getRangeCoordsBounds(t3), coords: t3 } : { transition: "out", bounds: n2.getRangeCoordsBounds(i2), coords: i2 }), a2(t3));
|
|
2602
|
+
}, [l2, n2, i2]);
|
|
2603
|
+
J.useEffect(() => (c2.current && (clearTimeout(c2.current), c2.current = null), s2 && (c2.current = setTimeout(() => {
|
|
2604
|
+
d2(null), c2.current = null;
|
|
2605
|
+
}, r2)), () => {
|
|
2606
|
+
c2.current && (clearTimeout(c2.current), c2.current = null);
|
|
2607
|
+
}), [s2, r2]);
|
|
2608
|
+
const u2 = J.useMemo(() => K.debounce(K.throttle(g2, 80), 80), []);
|
|
2609
|
+
if (Ct(l2?.getSelection(), { onChange(e2) {
|
|
2610
|
+
u2();
|
|
2611
|
+
} }), Ct(l2, { onSpillsChange(e2) {
|
|
2612
|
+
g2();
|
|
2613
|
+
}, onInvalidated(e2) {
|
|
2614
|
+
g2();
|
|
2615
|
+
} }), !n2) return null;
|
|
2616
|
+
if (!i2 && !s2) return null;
|
|
2617
|
+
const h2 = l2.getRange(i2).getValue() instanceof e.Spill, m2 = [];
|
|
2618
|
+
let p2 = s2?.bounds ?? n2.getRangeCoordsBounds(i2);
|
|
2619
|
+
if (s2 && !K.isEqualBounds(s2.bounds, n2.getRangeCoordsBounds(s2.coords)) && d2(null), p2 = n2.toClipBounds(p2, -10), !p2) return;
|
|
2620
|
+
const f2 = "var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";
|
|
2621
|
+
return m2.push(G(Se, { x: p2.x, y: p2.y, width: p2.width, height: p2.height, range: i2, strokeWidth: 1, stroke: f2, style: { willChange: "transform, opacity, width, height, opacity, left, top", strokeDasharray: h2 ? "6 3" : void 0, opacity: "out" === s2?.transition ? 0 : 1, transition: s2?.transition ? "in" === s2.transition || "out" === s2.transition ? `opacity ${1.5 * r2}ms ease-in-out` : `left ${r2}ms ease-out, top ${r2}ms ease-out, width ${r2}ms ease-out, height ${r2}ms ease-out` : "none", boxShadow: `${f2} 0px 0px 4px 0px` } }, "spill-outline}")), m2;
|
|
2622
|
+
})), co = { position: "absolute", top: 0, left: 0, bottom: 0, right: 0 }, go = (e2, t2) => {
|
|
2623
|
+
const o2 = { ...e2 }, n2 = t2?.getNormal().getFont(), l2 = n2?.toCSS(), r2 = { text: { fontFamily: l2?.fontFamily, fontSize: n2?.getSize() } }, i2 = o2.body = K.mergeContentful(e2.body, r2);
|
|
2624
|
+
return o2.body = K.mergeContentful({ fill: "#fff", strokeFill: "#dad8d6", strokeWidth: 0.5, text: { fontWeight: "400", fontStyle: "normal", fill: "#040404" } }, i2), o2.buttonSurface = K.mergeContentful({ fill: "#fff", text: { fill: "black" }, edgeStrokeFill: "black" }, o2.buttonSurface), o2.selection = { fill: "rgba(16, 124, 65, 0.1)", strokeFill: "#217346", strokeWidth: 2, ...e2.selection }, o2.selectionInactive = { ...o2.selection, fill: "rgba(16, 124, 65, 0.1)", strokeFill: "#dad8d6", ...e2.selectionInactive }, o2.selectionRemove = { ...o2.selection, fill: "rgba(200, 0, 0, 0.1)", strokeFill: "rgba(200, 0, 0, 1)", ...e2.selectionRemove }, o2.headerSelection = { ...o2.selection, ...e2.headerSelection }, o2.headerSelectionInactive = { ...o2.selectionInactive, ...e2.headerSelectionInactive }, o2.header = K.mergeContentful(o2.body, { edgeStrokeFill: "rgb(171, 171, 171)", fill: "#f0f0f0", strokeShadow: void 0, edgeStrokeWidth: 1 }, e2.header), o2.header = K.mergeContentful(o2.header, r2), o2.headerSelect = K.mergeContentful(o2.header, { fill: "rgba(16, 124, 65, 0.1)", text: { fill: o2.headerSelection.strokeFill, fontWeight: "700" } }, e2.headerSelect), o2.headerSelect = K.mergeContentful(o2.headerSelect, r2), o2.headerSelectAll = K.mergeContentful(o2.headerSelect, {}, e2.headerSelectAll), o2.headerSelectAll = K.mergeContentful(o2.headerSelectAll, r2), o2;
|
|
2625
|
+
}, uo = { fireOnModelChange: false }, ho = {}, mo = ee(ne((e2, t2) => {
|
|
2626
|
+
const { sheet: o2, gridStyle: n2 = ho, headersStyle: l2 = ho, onSheetContextMenu: r2, showColumnHeaders: s2, columnHeaderProps: c2, showRowHeaders: g2, rowHeaderProps: u2, showScrollbars: h2 = true, scrollPaneProps: p2, onViewportChange: f2, commands: w2, onRepeatCommandChange: q2, onMoveCell: v2, overlays: y2, renderMovable: k2, viewportComponent: R2, onElementLoad: M2, getCellEditor: T2, onFocus: A2, onBlur: F2, style: D2 = C.EmptyCssProperties, notifier: I2, onShowTooltip: V2, onShowColumnTooltip: L2, onShowRowTooltip: H2, onCloseTooltip: B2, gridProps: P2, cellRenderProps: $2, ...W2 } = e2;
|
|
2627
|
+
if (J.useEffect(() => {
|
|
2628
|
+
d._validate(true);
|
|
2629
|
+
}, []), !o2) throw new Error("ISheet must be provided.");
|
|
2630
|
+
const [U2, _2] = J.useReducer((e3) => e3 + 1, 0), [ee2, { width: ne2, height: se2 }] = Re(), de2 = S(V2, [V2]), ge2 = S(L2, [L2]), ue2 = S(H2, [H2]), he2 = S(B2, [B2]), me2 = le(false);
|
|
2631
|
+
ie(() => {
|
|
2632
|
+
me2.current = true;
|
|
2633
|
+
}, [o2]);
|
|
2634
|
+
const pe2 = o2?.getStyles(), fe2 = te(() => go(n2, pe2), [n2, pe2]), we2 = te(() => go(l2, pe2), [l2, pe2]), { body: ve2 = {}, buttonSurface: ye2 = {} } = fe2, { header: Ce2 = {}, headerSelect: be2 = {}, headerSelectAll: Se2 = {} } = we2, ke2 = le(null), [Te2, Ae2] = oe(() => o2?.getView()), ze2 = (Te2?.getZoomScale() ?? 100) / 100, Fe2 = te(() => ({ vertical: Te2.isShowColumnGridlines() && ze2 >= 0.4, horizontal: Te2.isShowRowGridlines() && ze2 >= 0.4 }), [Te2?.isShowColumnGridlines(), Te2?.isShowRowGridlines(), ze2]), Ee2 = te(() => {
|
|
2635
|
+
if (Te2?.getGridLineColor()) return { strokeDasharray: "1,1" };
|
|
2636
|
+
}, [Te2?.getGridLineColor(), fe2]), De2 = s2 ?? Te2?.isShowColumnHeaders(), Ie2 = g2 ?? Te2?.isShowRowHeaders(), [Ve2, Ne2] = oe({ width: 0, height: 0 }), Le2 = te(() => {
|
|
2637
|
+
let e3 = 40, t3 = 20;
|
|
2638
|
+
const n3 = o2?.getStyles().getNormal().getFont();
|
|
2639
|
+
if (Ve2.width > 0 && Ve2.height > 0) {
|
|
2640
|
+
const o3 = n3?.toCSS()?.fontFamily ?? fe2.header.text.fontFamily, l3 = n3?.getSize() ?? fe2.header.text.fontSize, r3 = a.getSharedMeasurer()("" + Ve2.height, Math.ceil(l3 * a.getDeviceScale()), o3);
|
|
2641
|
+
e3 = r3.width, t3 = r3.lineHeight;
|
|
2642
|
+
}
|
|
2643
|
+
return { width: Math.round(e3 + 5), height: Math.round(t3 + 3) };
|
|
2644
|
+
}, [Ve2, fe2?.header.text, o2]), He2 = Ie2 ? ze2 * Le2.width : Ce2.edgeStrokeWidth, Be2 = De2 ? ze2 * Le2.height : Ce2.edgeStrokeWidth, Oe2 = Math.max(ne2, (o2?.getColumnHeaders().getDefaultSize() ?? Le2.width) + He2 + 1), Pe2 = Math.max(se2, (o2?.getRowHeaders().getDefaultSize() ?? Le2.height) + Be2 + 1), $e2 = le(/* @__PURE__ */ new Map()), We2 = le(null), Ue2 = () => ({ getColOffset: (e3) => o2.getColumnHeaders().findOffset(e3), getColIndex: (e3) => o2.getColumnHeaders().findIndex(e3), getRowOffset: (e3) => o2.getRowHeaders().findOffset(e3), getRowIndex: (e3) => o2.getRowHeaders().findIndex(e3) }), [_e2, Ge2] = oe(() => Ue2()), [Ze2, je2] = oe(false), [Ke2, Xe2] = oe(null), Ye2 = true, Qe2 = fe2.selection?.strokeFill, Je2 = ae(() => jt2.current, []), [tt2, ot2] = oe(), nt2 = S((e3) => {
|
|
2645
|
+
ot2(e3), o2 && o2.getView() && o2.getView().setTopLeft(e3 ? { left: e3.left, top: e3.top } : null), f2?.(e3);
|
|
2646
|
+
}, [o2, f2]), lt2 = le(null);
|
|
2647
|
+
re(() => {
|
|
2648
|
+
if (!tt2 || !o2) return;
|
|
2649
|
+
const e3 = o2.getRangeAtBounds({ x: tt2.left, y: tt2.top, width: tt2.width, height: tt2.height });
|
|
2650
|
+
lt2.current?.(), lt2.current = e3.addListener(() => {
|
|
2651
|
+
const t3 = e3.getCoords();
|
|
2652
|
+
ke2?.current?.invalidate(t3);
|
|
2653
|
+
});
|
|
2654
|
+
}, [tt2, o2]);
|
|
2655
|
+
const [rt2, it2] = oe(() => o2?.getView().getTopLeft()), at2 = S((e3) => {
|
|
2656
|
+
const t3 = Q.cellToRange(e3);
|
|
2657
|
+
if (o2.isClosed()) return t3;
|
|
2658
|
+
const n3 = o2.getRange(t3, { excludeHidden: true }).getMerges();
|
|
2659
|
+
return 0 === n3.length ? t3 : n3[0];
|
|
2660
|
+
}, [o2]), st2 = (e3) => {
|
|
2661
|
+
if (!e3 || 0 === e3.coords.colIndex && 0 === e3.coords.rowIndex) return null;
|
|
2662
|
+
const t3 = {};
|
|
2663
|
+
return e3.coords.colIndex > 0 && (t3[X.Left] = { index: e3.coords.colIndex, scrollOffset: e3.topLeft.left }), e3.coords.rowIndex > 0 && (t3[X.Top] = { index: e3.coords.rowIndex, scrollOffset: e3.topLeft.top }), t3;
|
|
2664
|
+
}, [dt2, ct2] = oe(() => st2(o2.getView().getFreezePanes())), gt2 = z(), ut2 = ae(() => ke2.current, []), ht2 = S((e3) => {
|
|
2665
|
+
gt2.setMode((t3) => "edit" === t3?.key ? { ...t3, args: { ...t3.args } } : { key: "edit", args: { stateAndCoords: null, start: e3 } });
|
|
2666
|
+
}, []), mt2 = S(() => tt2, [tt2]), pt2 = xt({ sheet: o2, commands: w2, target: ut2, onRepeatCommandChange: q2, bodyStyle: ve2, notifier: I2, onStartEdit: ht2, getViewport: mt2 }), [ft2, vt2] = oe(o2.getSelection().isEntire()), [bt2, St2] = oe(Te2?.getMovableSelection().length > 0), Rt2 = null !== Ke2 || bt2, At2 = null, [zt2, Ft2] = oe(false);
|
|
2667
|
+
re(() => {
|
|
2668
|
+
Ft2(false);
|
|
2669
|
+
}, [o2.getProtection()]);
|
|
2670
|
+
const Et2 = S(() => {
|
|
2671
|
+
zt2 || (Ft2(true), I2.showMessage?.(Z("span", { children: ["This sheet is protected.", G("br", {}), "To make a change, unprotect the sheet. You might be requested to enter a password."] }), { type: E.Error }));
|
|
2672
|
+
}, [I2, zt2]), Dt2 = te(() => {
|
|
2673
|
+
const e3 = gt2.getMode();
|
|
2674
|
+
return e3?.cursor ? e3.cursor : null;
|
|
2675
|
+
}, [At2, gt2]), [It2, Vt2] = oe(null), Nt2 = le(false), [Ht2, Bt2] = oe([]), Ot2 = le(null), [Pt2, $t2] = oe(Y.EmptyTopLeft), [Wt2, Ut2] = oe(Y.EmptyTopLeft);
|
|
2676
|
+
re(() => {
|
|
2677
|
+
$t2({ left: rt2?.left, top: 0 });
|
|
2678
|
+
}, [rt2?.left]), re(() => {
|
|
2679
|
+
Ut2({ left: 0, top: rt2?.top });
|
|
2680
|
+
}, [rt2?.top]), Ct(o2?.getView(), { onFreezeSplitChange: () => {
|
|
2681
|
+
ct2(st2(o2.getView().getFreezePanes()));
|
|
2682
|
+
}, onTopLeftChange: () => {
|
|
2683
|
+
it2(o2.getView().getTopLeft());
|
|
2684
|
+
}, onMovableSelectionChange: () => {
|
|
2685
|
+
St2(o2.getView().getMovableSelection().length > 0);
|
|
2686
|
+
} }), Ct(o2?.getSelection(), { onChange: () => {
|
|
2687
|
+
vt2(o2.getSelection().isEntire());
|
|
2688
|
+
} }), Ct(o2, { onViewChange() {
|
|
2689
|
+
Ae2(o2.getView()), Ge2(Ue2());
|
|
2690
|
+
}, onLayoutChange: () => {
|
|
2691
|
+
const e3 = o2.getEntireRange();
|
|
2692
|
+
Ne2({ height: e3.getRowCount(), width: e3.getColumnCount() }), Ge2(Ue2());
|
|
2693
|
+
}, onStyleChange: () => {
|
|
2694
|
+
Kt2();
|
|
2695
|
+
}, onMovablesChange: () => {
|
|
2696
|
+
}, onInvalidated: () => {
|
|
2697
|
+
Kt2();
|
|
2698
|
+
} }), Ct(o2, { onRequestScrollIntoView: async (e3, t3) => {
|
|
2699
|
+
if (!t3) return;
|
|
2700
|
+
const o3 = { colIndex: t3?.coords.colStart, rowIndex: t3?.coords.rowStart };
|
|
2701
|
+
return await ke2.current?.scrollCellCoordsIntoView(o3, t3?.scroll), true;
|
|
2702
|
+
}, onRequestFocus: () => K.whenFocus(jt2.current) }, uo);
|
|
2703
|
+
const Gt2 = te(() => {
|
|
2704
|
+
const e3 = (e4, t4) => {
|
|
2705
|
+
Nt2.current = true, Vt2([(l3) => {
|
|
2706
|
+
if (!l3.toClipBounds(l3.getRangeCoordsBounds({ rowStart: 0, rowEnd: Ve2.height, colStart: e4, colEnd: e4 }))) return;
|
|
2707
|
+
const r3 = l3.getLayout(), i2 = Math.max(0, r3.getColOffset(e4)), a2 = l3.getBounds(), s3 = Math.min(a2.x + a2.width, r3.getColOffset(e4 + 1)), d2 = l3.getAnchor();
|
|
2708
|
+
if (null !== t4 && (d2 === X.Left || d2 === X.Center || d2 === X.Right)) {
|
|
2709
|
+
const e5 = K.roundAccurately(t4 * K.getDPI(), 0), n3 = K.roundAccurately(o2?.getColumnWidthAsFontUnit(t4 / ze2), 2).toFixed(2), l4 = "Width: " + (t4 ? n3 + " (" + e5 + " pixels)" : "Hidden"), r4 = vo2.current.getGridElement().getRelativePointFromClient(0, 0), d3 = 0 - r4.y, c4 = 0 - r4.y + Be2, g4 = { x: i2 - (r4.x - a2.x), y: d3, width: s3 - i2, height: c4 - d3 };
|
|
2710
|
+
requestAnimationFrame(() => {
|
|
2711
|
+
Nt2.current && ge2?.({ anchor: g4, display: l4 });
|
|
2712
|
+
});
|
|
2713
|
+
}
|
|
2714
|
+
const c3 = [0, 0, 0, a2.height], g3 = { style: { boxShadow: `0.5px 0px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Qe2 } }, u3 = { x: i2 - 1, y: 0, width: 1, height: a2.height }, h3 = { style: { boxShadow: `-0.5px 0px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Qe2 } }, m2 = { x: s3 - 1, y: 0, width: 1, height: a2.height };
|
|
2715
|
+
return Z(J.Fragment, { children: [G(xe, { linePoints: c3, bounds: u3, ...g3 }), G(xe, { linePoints: c3, bounds: m2, ...h3 })] }, "resize-dividers");
|
|
2716
|
+
}]);
|
|
2717
|
+
};
|
|
2718
|
+
let t3 = null;
|
|
2719
|
+
return { onResizeHeadersStart: (n3, l3, r3) => {
|
|
2720
|
+
t3 = o2.beginCommit(r3), e3(n3, l3);
|
|
2721
|
+
}, onResizeHeaders: (t4, o3, n3) => {
|
|
2722
|
+
e3(t4, o3);
|
|
2723
|
+
}, onResizeHeadersDown: (t4, o3) => {
|
|
2724
|
+
e3(t4, o3);
|
|
2725
|
+
}, onResizeHeadersEnd: (e4, o3, n3) => {
|
|
2726
|
+
t3?.commit({ description: n3 }), t3 = null, requestAnimationFrame(() => he2?.()), Nt2.current = false, Vt2(null);
|
|
2727
|
+
}, onResizeHeadersUp: (e4) => {
|
|
2728
|
+
requestAnimationFrame(() => he2?.()), Nt2.current = false, Vt2(null);
|
|
2729
|
+
}, ...c2 };
|
|
2730
|
+
}, [o2, c2, Be2, It2]), Zt2 = te(() => {
|
|
2731
|
+
const e3 = (e4, t4) => {
|
|
2732
|
+
Nt2.current = true, Vt2([(l3) => {
|
|
2733
|
+
if (!l3.toClipBounds(l3.getRangeCoordsBounds({ rowStart: e4, rowEnd: e4, colStart: 0, colEnd: Ve2.width }))) return;
|
|
2734
|
+
const r3 = l3.getLayout(), i2 = Math.max(0, r3.getRowOffset(e4)), a2 = l3.getBounds(), s3 = Math.min(a2.y + a2.height, r3.getRowOffset(e4 + 1)), d2 = l3.getAnchor();
|
|
2735
|
+
if (null !== t4 && (d2 === X.Top || d2 === X.Center || d2 === X.Bottom)) {
|
|
2736
|
+
const e5 = Math.floor(10 * K.getDPI()) / 10, n3 = K.roundAccurately(t4 * e5, 0), l4 = K.roundAccurately(n3 / ze2 / (o2?.getRowHeaders().getScaleFactor() * K.getDPI()), 2).toFixed(2), r4 = "Height: " + (t4 ? l4 + " (" + n3 + " pixels)" : "Hidden"), d3 = wo2.current.getGridElement().getRelativePointFromClient(0, 0), c4 = 0 - d3.x, g4 = 0 - d3.x + He2, u4 = { x: c4, y: i2 - (d3.y - a2.y), width: g4 - c4, height: s3 - i2 };
|
|
2737
|
+
requestAnimationFrame(() => {
|
|
2738
|
+
Nt2.current && ue2?.({ anchor: u4, display: r4 });
|
|
2739
|
+
});
|
|
2740
|
+
}
|
|
2741
|
+
const c3 = [0, 0, a2.width, 0], g3 = { style: { boxShadow: `0px 0.5px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Qe2 } }, u3 = { x: 0, y: i2 - 1, width: a2.width, height: 1 }, h3 = { style: { boxShadow: `0px -0.5px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Qe2 } }, m2 = { x: 0, y: s3 - 1, width: a2.width, height: 1 };
|
|
2742
|
+
return Z(J.Fragment, { children: [G(xe, { linePoints: c3, bounds: u3, ...g3 }), G(xe, { linePoints: c3, bounds: m2, ...h3 })] }, "resize-dividers");
|
|
2743
|
+
}]);
|
|
2744
|
+
};
|
|
2745
|
+
let t3 = null;
|
|
2746
|
+
return { onResizeHeadersStart: (n3, l3, r3) => {
|
|
2747
|
+
t3 = o2.beginCommit(r3), e3(n3, l3);
|
|
2748
|
+
}, onResizeHeaders: (t4, o3, n3) => {
|
|
2749
|
+
e3(t4, o3);
|
|
2750
|
+
}, onResizeHeadersDown: (t4, o3) => {
|
|
2751
|
+
e3(t4, o3);
|
|
2752
|
+
}, onResizeHeadersEnd: (e4, o3, n3) => {
|
|
2753
|
+
t3?.commit({ description: n3 }), t3 = null, requestAnimationFrame(() => he2?.()), Nt2.current = false, Vt2(null);
|
|
2754
|
+
}, onResizeHeadersUp: (e4) => {
|
|
2755
|
+
requestAnimationFrame(() => he2?.()), Nt2.current = false, Vt2(null);
|
|
2756
|
+
}, ...u2 };
|
|
2757
|
+
}, [o2, u2, He2]), jt2 = b(t2, () => {
|
|
2758
|
+
const e3 = (e4) => {
|
|
2759
|
+
o2?.getView() && o2.getView().selectMovables([]), We2.current = null, ke2?.current?.focus(e4);
|
|
2760
|
+
}, t3 = async (e4 = null) => {
|
|
2761
|
+
if (e4 || (e4 = o2?.getView().getMovableSelection()[0]), !e4) return false;
|
|
2762
|
+
const t4 = e4.getAnchorCoords();
|
|
2763
|
+
if (!t4) return false;
|
|
2764
|
+
const n3 = ke2.current?.getViewFromCellCoords({ colIndex: t4.colStart, rowIndex: t4.rowStart });
|
|
2765
|
+
if (!n3) return false;
|
|
2766
|
+
const l3 = n3.getAnchor();
|
|
2767
|
+
-1 === o2?.getView().getMovableSelection().indexOf(e4) && o2?.getView().selectMovables([e4]);
|
|
2768
|
+
let r3 = $e2.current?.get(l3);
|
|
2769
|
+
return r3?.current ? (await r3.current.focusMovable(e4), true) : (We2.current = { movable: e4, anchor: l3 }, true);
|
|
2770
|
+
};
|
|
2771
|
+
return { getGridElement: () => ke2.current, getRowHeaderElement: () => wo2.current, getColumnHeaderElement: () => vo2.current, rowHeaderHeight: () => Be2, colHeaderWidth: () => He2, startEdit: ht2, submitEdit: () => {
|
|
2772
|
+
gt2.setMode((e4) => "edit" !== e4?.key ? e4 : { key: "edit", args: { stateAndCoords: null, submit: true } });
|
|
2773
|
+
}, cancelEdit: () => {
|
|
2774
|
+
gt2.setMode((e4) => "edit" !== e4?.key ? e4 : { key: "edit", args: { stateAndCoords: null, cancel: true } });
|
|
2775
|
+
}, isEditing: null !== Ke2, focus: (n3) => {
|
|
2776
|
+
o2?.getView().getMovableSelection().length > 0 && t3() || e3(n3);
|
|
2777
|
+
}, focusSheet: e3, focusMovable: t3, contains: (e4) => ke2?.current?.contains?.(e4), invalidate: Kt2, isSheetElement: () => true, getSheet: () => o2 };
|
|
2778
|
+
}, [o2]), Kt2 = ae((e3) => {
|
|
2779
|
+
me2.current || (ke2?.current?.invalidate(e3), _2?.());
|
|
2780
|
+
}, []);
|
|
2781
|
+
re(() => {
|
|
2782
|
+
Kt2();
|
|
2783
|
+
}, [fe2]);
|
|
2784
|
+
const Xt2 = ft2 ? Se2.edgeStrokeFill : Ce2.fill, Yt2 = ft2 ? be2.fill : "function" == typeof fe2.headerHover ? fe2.headerHover(Ce2)?.fill : Ce2.fill, Qt2 = te(() => R2 ? G("div", { className: Me("sheetxl-viewport-overlay", qt), style: { width: "100%", height: "100%", boxSizing: "border-box", position: "absolute" }, children: R2 }) : G(j, {}), [R2]);
|
|
2785
|
+
let Jt2 = null;
|
|
2786
|
+
De2 && Ie2 && (Jt2 = Z("div", { tabIndex: -1, className: "top-left-corner", style: { padding: "2 2", position: "absolute", height: `${Be2}px`, width: `${He2}px`, zIndex: 1, boxSizing: "border-box", cursor: "cell" }, onMouseDown: (e3) => {
|
|
2787
|
+
let t3 = !e3.ctrlKey;
|
|
2788
|
+
pt2?.getCommand("selectAll")?.execute(!t3 || 0 !== e3.button), e3.nativeEvent.which === N.Right ? r2?.({ originalEvent: e3, clientX: e3.clientX, clientY: e3.clientY, rowIndex: -1, colIndex: -1 }) : ke2.current?.focus();
|
|
2789
|
+
}, children: [G("div", { style: { height: Be2 - 5 + "px", width: Be2 - 5 + "px", clipPath: `path('M${Be2 - 5} 0 L0 ${Be2 - 5} L${Be2 - 5} ${Be2 - 5} L${Be2 - 5} 0 Z')`, borderRight: `2px solid ${Xt2}`, borderBottom: `2px solid ${Xt2}`, background: `${Yt2}`, boxSizing: "border-box", position: "absolute", right: "2px", bottom: "2px" } }), G("div", { style: { position: "absolute", height: `${Be2}px`, width: `${He2}px`, boxSizing: "border-box", borderRight: `solid 1px ${Ce2.strokeFill}`, borderBottom: `solid 1px ${Ce2.strokeFill}`, right: "-1px", bottom: "-1px" } })] }));
|
|
2790
|
+
const eo2 = S(({ _left: e3, _top: t3 }) => {
|
|
2791
|
+
}, []), no2 = S((e3) => {
|
|
2792
|
+
if (!r2) return;
|
|
2793
|
+
const t3 = ke2.current.getViewFromClient(e3.clientX, e3.clientY)?.getCellCoordsFromClient(e3.clientX, e3.clientY);
|
|
2794
|
+
t3 && (r2({ originalEvent: e3, clientX: e3.clientX, clientY: e3.clientY, rowIndex: t3.rowIndex, colIndex: t3.colIndex }), e3.stopPropagation(), e3.preventDefault());
|
|
2795
|
+
}, [r2]), lo2 = S((e3) => {
|
|
2796
|
+
if (!(!e3.shiftKey && (e3.ctrlKey || e3.metaKey))) return;
|
|
2797
|
+
const { deltaY: t3 } = e3;
|
|
2798
|
+
return t3 > 0 ? pt2.getCommand("sheetZoomOut")?.execute() : t3 < 0 && pt2.getCommand("sheetZoomIn")?.execute(), 0 === t3;
|
|
2799
|
+
}, [pt2]);
|
|
2800
|
+
re(() => {
|
|
2801
|
+
Bt2(null), Ot2.current = null, Nt2.current = false, Vt2(null);
|
|
2802
|
+
const e3 = o2?.getView().getTopLeft();
|
|
2803
|
+
eo2(e3), ke2.current?.scrollTo(e3), it2(e3), Ae2(o2.getView()), ct2(st2(o2.getView().getFreezePanes())), Ge2(Ue2()), _2();
|
|
2804
|
+
}, [o2?.getView()]);
|
|
2805
|
+
const ro2 = S((e3) => {
|
|
2806
|
+
const t3 = e3.getVisibleRangeCoords();
|
|
2807
|
+
if (!t3) return null;
|
|
2808
|
+
const n3 = [];
|
|
2809
|
+
return o2.getRange(t3).forEach((e4, t4) => {
|
|
2810
|
+
const o3 = t4.getCoords(), l3 = t4.getCell();
|
|
2811
|
+
((e5) => {
|
|
2812
|
+
if (e5.isEmpty()) return false;
|
|
2813
|
+
const t5 = e5.getSpans();
|
|
2814
|
+
if (t5.width > 1 || t5.height > 1) return true;
|
|
2815
|
+
if (e5.getStyle().hasVisibleStyling()) return true;
|
|
2816
|
+
if (Te2.isShowFormulas() && null !== e5.getFormula()) return true;
|
|
2817
|
+
const o4 = e5.getValue();
|
|
2818
|
+
return null !== o4 && !(!Te2.isShowZeros() && 0 === o4 && e5.getType() === i.Number);
|
|
2819
|
+
})(l3) && n3.push({ coords: o3, value: l3, range: Te2.isShowFormulas() ? null : l3.getExtrusions() });
|
|
2820
|
+
}, { excludeHidden: true, includeMergeOverflow: true }), n3;
|
|
2821
|
+
}, [o2, Te2.isShowZeros(), Te2.isShowFormulas(), Ke2]);
|
|
2822
|
+
re(() => {
|
|
2823
|
+
const e3 = [];
|
|
2824
|
+
y2 && e3.push(...y2), It2 && e3.push(...It2), K.isEqualArrays(e3, Ot2.current) || (Ot2.current = e3, Bt2(e3));
|
|
2825
|
+
}, [y2, It2, fe2]);
|
|
2826
|
+
const io2 = te(() => ({ style: { boxShadow: `0.5px 0.5px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: n2?.body?.text?.fill ?? "black" } }), [fe2?.header?.edgeStrokeFill]), mo2 = S((e3) => {
|
|
2827
|
+
e3.isDefaultPrevented() || e3.isPropagationStopped() || (We2.current = null, o2?.getView().getMovableSelection().length > 0 && o2.getView().selectMovables([]));
|
|
2828
|
+
}, [o2]), po2 = te(() => {
|
|
2829
|
+
const e3 = gt2.getMode();
|
|
2830
|
+
return "cut" === e3?.key || "copy" === e3?.key;
|
|
2831
|
+
}, [gt2]), fo2 = S(async (e3) => {
|
|
2832
|
+
const t3 = gt2.getMode();
|
|
2833
|
+
return e3.keyCode === x.Escape && t3 ? (e3.preventDefault(), void gt2.setMode(null)) : e3.keyCode === x.Enter && po2 ? (e3.preventDefault(), await pt2?.getCommand("paste")?.execute(), void gt2.setMode(null)) : void pt2?.dispatchToFocusedCommand(e3);
|
|
2834
|
+
}, [pt2, gt2]), wo2 = le(null), qo2 = te(() => G("div", { tabIndex: -1, style: { position: "relative", flex: "0", top: `${Be2 + 1}px`, width: `${He2 + Ce2.edgeStrokeWidth}px`, minWidth: `${He2 + Ce2.edgeStrokeWidth}px`, borderRight: `solid ${Ce2.edgeStrokeWidth}px ${Ce2.edgeStrokeFill}`, height: `calc(100% - ${Be2}px)`, boxSizing: "border-box", zIndex: "2" }, children: G(Mt, { ref: wo2, sheetElement: jt2.current, gridRef: ke2, freezeStart: dt2?.[X.Top], oppositeSize: He2, containerWidth: He2, containerHeight: Pe2, sheetHeader: o2.getRowHeaders(), gridStyle: we2, verticalPadding: Math.max(0, Math.floor(o2.getStyles().getNormal().getFont().getSize() / 10)), scrollPoint: Wt2, onSheetContextMenu: r2, tabIndex: -1, style: { position: "relative", flex: "0", top: `${Be2 + 1}px`, width: `${He2 + Ce2.edgeStrokeWidth}px`, minWidth: `${He2 + Ce2.edgeStrokeWidth}px`, borderRight: `solid ${Ce2.edgeStrokeWidth}px ${Ce2.edgeStrokeFill}`, height: `calc(100% - ${Be2}px)`, boxSizing: "border-box", zIndex: "2", ...Zt2?.style }, ...Zt2 }) }), [He2, Be2, Pe2, o2, Wt2, dt2?.[X.Top], fe2, Ye2, r2, Ce2.fill, u2]), vo2 = le(null), yo2 = te(() => G("div", { tabIndex: -1, style: { position: "relative", left: "0px", width: "100%", height: `${Be2 + Ce2.edgeStrokeWidth}px`, minHeight: `${Be2 + Ce2.edgeStrokeWidth}px`, borderBottom: `solid ${Ce2.edgeStrokeWidth}px ${Ce2.edgeStrokeFill}`, boxSizing: "border-box", zIndex: "1" }, children: G(Mt, { ref: vo2, sheetElement: jt2.current, gridRef: ke2, freezeStart: dt2?.[X.Left], oppositeSize: Be2, containerWidth: Oe2, containerHeight: Be2, sheetHeader: o2.getColumnHeaders(), gridStyle: we2, scrollPoint: Pt2, onSheetContextMenu: r2, ...Gt2, style: { ...Gt2?.style, position: "relative", left: "0px", width: "100%", height: `${Be2 + Ce2.edgeStrokeWidth}px`, minHeight: `${Be2 + Ce2.edgeStrokeWidth}px`, borderBottom: `solid ${Ce2.edgeStrokeWidth}px ${Ce2.edgeStrokeFill}`, boxSizing: "border-box", zIndex: "1" } }) }), [Be2, Oe2, o2, Pt2, dt2?.[X.Left], fe2, Ce2.fill, Ye2, r2, c2]), Co2 = S((e3) => {
|
|
2835
|
+
const { value: t3, key: n3, ...l3 } = e3;
|
|
2836
|
+
let r3 = t3, i2 = Ke2;
|
|
2837
|
+
if (!i2 || i2.colIndex === e3.coords.colIndex && i2.rowIndex === e3.coords.rowIndex || (i2 = null), !r3) {
|
|
2838
|
+
const t4 = e3.range;
|
|
2839
|
+
if (r3 = o2.getRange({ rowIndex: t4.rowStart, colIndex: t4.colStart }).getCell(), r3.isEmpty()) return null;
|
|
2840
|
+
}
|
|
2841
|
+
let a2 = null;
|
|
2842
|
+
r3.getHyperlink() && (a2 = async (e4) => {
|
|
2843
|
+
if ($2?.onLinkMouseDown?.(e4), 0 === e4.button && !e4.isDefaultPrevented()) {
|
|
2844
|
+
e4.stopPropagation(), e4.preventDefault();
|
|
2845
|
+
try {
|
|
2846
|
+
await r3.getHyperlink()?.open();
|
|
2847
|
+
} catch (e5) {
|
|
2848
|
+
I2?.showError?.(e5);
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
}), i2 && i2.colIndex === e3.range.colStart && i2.rowIndex === e3.range.rowStart && (r3 = r3.createTemporaryCell({ value: null }));
|
|
2852
|
+
const s3 = o2.getStyles();
|
|
2853
|
+
return ce(et, { ...l3, key: n3, bodyStyle: ve2, docTheme: s3.getTheme(), normalStyle: s3.getNormal(), showFormulas: Te2.isShowFormulas(), showZeros: Te2.isShowZeros(), onLinkMouseDown: a2, ...$2, value: r3 });
|
|
2854
|
+
}, [o2, _e2, ve2, Ke2, Te2?.isShowFormulas(), Te2.isShowZeros()]), bo2 = ae((e3, t3) => {
|
|
2855
|
+
const { key: n3, ...l3 } = e3;
|
|
2856
|
+
return [G(Tt, { ref: t3, getVisibleCells: ro2, sheet: o2, gridStyle: fe2, ...l3 }, `border-${n3}`), G(ao, { ref: t3, sheet: o2, commands: pt2, ...l3 }, `table-${n3}`), G(so, { ref: t3, sheet: o2, ...l3 }, `spill-${n3}`), G(_t, { ref: t3, sheet: o2, commands: pt2, notifier: I2, onShowTooltip: de2, onCloseTooltip: he2, gridStyle: fe2, gridRef: ke2, editingCoords: Ke2, isActive: Ye2, ...l3 }, `selection-${n3}`), G(Lt, { ref: t3, sheet: o2, commands: pt2, gridStyle: fe2, element: Je2, notifier: I2, ...l3 }, `copy-paste-${n3}`), G(to, { ref: t3, sheet: o2, commands: pt2, target: ut2, notifier: I2, renderMovable: k2, movableProps: { onUnFocus: () => {
|
|
2857
|
+
jt2.current.focus();
|
|
2858
|
+
} }, ...l3 }, `movable-${n3}`), G(oo, { ref: t3, sheet: o2, commands: pt2, notifier: I2, gridStyle: fe2, getCellEditor: T2, showProtectedError: Et2, setEditingCoords: Xe2, ...l3 }, `editor-${n3}`)];
|
|
2859
|
+
}, [o2, ke2.current, fe2, T2, pt2, I2]), [So2, xo2] = oe(false), ko2 = te(() => {
|
|
2860
|
+
if (0 === Oe2 || 0 === Pe2) return null;
|
|
2861
|
+
const e3 = o2.getStyles().getNormal(), t3 = e3.getFont(), n3 = e3.getFill(), l3 = e3.getBorder(), r3 = e3.getFill().getType() === m.Type.None;
|
|
2862
|
+
let i2 = Ee2, a2 = Ee2;
|
|
2863
|
+
const s3 = (e4, t4, o3) => o3 ? { stroke: l3.getBottom().isNone() ? "none" : e4.getColor().toRGBA(ve2.darkMode).toString(), ...t4 } : t4;
|
|
2864
|
+
a2 = s3(l3.getBottom(), a2, !l3.getBottom().isNone()), a2 = s3(l3.getTop(), a2, !l3.getTop().isNone()), i2 = s3(l3.getRight(), i2, !l3.getRight().isNone()), i2 = s3(l3.getLeft(), i2, !l3.getLeft().isNone());
|
|
2865
|
+
let d2 = Te2?.getGridLineColor()?.toRGBA(ve2.darkMode).toString() ?? ve2.strokeFill;
|
|
2866
|
+
return r3 || (a2 = s3(l3.getBottom(), a2, true), a2 = s3(l3.getTop(), a2, true), i2 = s3(l3.getRight(), i2, true), i2 = s3(l3.getLeft(), i2, true)), G(qe, { className: "sheetxl-sheet-primary", style: { ...co, ...n3.toCSS(ve2.darkMode), ...t3.toCSS(ve2.darkMode, ze2), "--sxl-app-color-background": ve2.fill, "--sxl-app-color-shadow": fe2.colorShadow, "--sxl-app-color-grey": fe2.colorGrey, "--sxl-app-color-button-fill": ye2.fill, "--sxl-app-color-button-text": ye2.text?.fill, "--sxl-app-color-button-border": ye2.edgeStrokeFill, "--sxl-app-color-primary-dark": fe2.selection.strokeFill }, ref: ke2, zoom: ze2, ...P2, onFirstRender: (e4) => {
|
|
2867
|
+
xo2(true), P2?.onFirstRender?.(e4), pt2?.activate();
|
|
2868
|
+
}, showGridLines: Fe2, gridLineColor: d2, gridLineColumnsProps: i2, gridLineRowsProps: a2, freezeLeft: dt2?.[X.Left], freezeLeftProps: io2, freezeTop: dt2?.[X.Top], freezeTopProps: io2, width: Oe2, height: Pe2, columnCount: Ve2.width, rowCount: Ve2.height, cursor: Dt2 ?? At2 ?? "cell", clipCells: true, layout: _e2, cellRenderer: Co2, overlayRenderer: bo2, getCellCoordsAsRangeCoords: at2, getVisibleCells: ro2, onWheelScroll: lo2, onPointerDown: mo2, onKeyDown: fo2, onViewportChange: nt2, onImmediateScroll: eo2, scrollPoint: rt2, stageProps: { onFocus: () => {
|
|
2869
|
+
pt2?.activate();
|
|
2870
|
+
} }, overlays: Ht2 });
|
|
2871
|
+
}, [U2]);
|
|
2872
|
+
re(() => {
|
|
2873
|
+
me2.current || _2();
|
|
2874
|
+
}, [_e2, dt2, ze2, pt2, rt2?.left, rt2?.top, ve2, P2, Oe2, Pe2, Dt2, Ht2, Ye2, At2]);
|
|
2875
|
+
let Ro2 = { flex: "1 1 100%", display: "flex", alignContent: "stretch", position: "relative" };
|
|
2876
|
+
h2 || (Ro2 = { ...Ro2, ...D2 });
|
|
2877
|
+
const Mo2 = te(() => {
|
|
2878
|
+
const e3 = o2.getStyles().getTheme(), t3 = e3.getColorScheme(), n3 = e3.getFontScheme();
|
|
2879
|
+
return { "--sxl-doc-color-dk1": t3.getDk1().toCSS(ve2.darkMode), "--sxl-doc-color-dk2": t3.getDk2().toCSS(ve2.darkMode), "--sxl-doc-color-lt1": t3.getLt1().toCSS(ve2.darkMode), "--sxl-doc-color-lt2": t3.getLt2().toCSS(ve2.darkMode), "--sxl-doc-color-accent1": t3.getAccent1().toCSS(ve2.darkMode), "--sxl-doc-color-accent2": t3.getAccent2().toCSS(ve2.darkMode), "--sxl-doc-color-accent3": t3.getAccent3().toCSS(ve2.darkMode), "--sxl-doc-color-accent4": t3.getAccent4().toCSS(ve2.darkMode), "--sxl-doc-color-accent5": t3.getAccent5().toCSS(ve2.darkMode), "--sxl-doc-color-accent6": t3.getAccent6().toCSS(ve2.darkMode), "--sxl-doc-color-hlink": t3.getHlink().toCSS(ve2.darkMode), "--sxl-doc-color-fol-hlink": t3.getFolHlink().toCSS(ve2.darkMode), "--sxl-doc-font-major": n3.getMajorFont(), "--sxl-doc-font-minor": n3.getMinorFont() };
|
|
2880
|
+
}, [o2.getStyles().getTheme()]);
|
|
2881
|
+
let To2 = G("div", { style: Ro2, onTouchStart: () => {
|
|
2882
|
+
Fo2();
|
|
2883
|
+
}, onFocus: (e3) => {
|
|
2884
|
+
je2(true), A2?.(e3);
|
|
2885
|
+
}, onBlur: (e3) => {
|
|
2886
|
+
je2(false), F2?.(e3);
|
|
2887
|
+
}, ref: jt2, ...W2, children: G("div", { className: Me("sheetxl-sheet", wt), style: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", display: "flex", flexDirection: "column", flex: "1 1 100%", zIndex: "0", ...Mo2 }, children: Z("div", { style: { display: "flex", flexDirection: "row", flex: "1 1 100%" }, children: [Jt2, qo2, Z("div", { style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden", position: "relative" }, children: [yo2, Z("div", { style: { display: "flex", flexDirection: "column", flex: "1 1 100%", position: "relative", borderRight: `solid ${Ce2.edgeStrokeWidth}px ${Ce2.edgeStrokeFill}`, backgroundColor: ve2.fill }, ref: ee2, onContextMenu: no2, children: [ko2, Qt2, G(yt, { style: { position: "absolute", right: 24, bottom: 4 }, colorLicensee: fe2?.selection?.strokeFill, colorCredits: fe2?.body?.text?.fill })] })] })] }) }) });
|
|
2888
|
+
if (h2) {
|
|
2889
|
+
const e3 = (e4) => G(kt, { ...e4, sheet: o2 });
|
|
2890
|
+
To2 = G(O, { style: { flex: "1 1 100%", overflow: "hidden", background: `${Ce2.fill}`, minHeight: 2 * Le2.height, minWidth: 2 * Le2.width, ...D2 }, viewport: tt2, touchElement: ke2.current?.stage, disableTouch: Rt2, onScrollViewport: (e4) => {
|
|
2891
|
+
ke2.current?.scrollTo(e4);
|
|
2892
|
+
}, createHorizontalScrollbar: e3, createVerticalScrollbar: e3, ...p2, children: To2 });
|
|
2893
|
+
}
|
|
2894
|
+
re(() => {
|
|
2895
|
+
me2.current = false, _2?.(), Ze2 && jt2.current?.focus();
|
|
2896
|
+
}, [o2]);
|
|
2897
|
+
const [Ao2, zo2] = oe(false), Fo2 = S(() => {
|
|
2898
|
+
Ao2 || zo2(true);
|
|
2899
|
+
}, [Ao2]);
|
|
2900
|
+
return re(() => {
|
|
2901
|
+
if (So2) return "function" == typeof M2 && M2(), "touch" === C.detectIt().primaryInput && Fo2(), () => {
|
|
2902
|
+
};
|
|
2903
|
+
}, [M2, So2, Ao2]), To2;
|
|
2904
|
+
}));
|
|
2905
|
+
mo.displayName = "SheetElement";
|
|
2906
|
+
const po = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStringTag, { value: "Module" })), fo = "data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=", wo = ee(ne((e2, t2) => {
|
|
2907
|
+
const { children: o2, disabled: n2, style: l2, picture: r2, description: i2, isDragging: a2, view: s2, onHide: d2, onShow: c2, onKeyDownCapture: g2, onFocus: u2, onBlur: h2, loadingPanel: m2, ...p2 } = e2, [f2, w2] = oe(false), [q2, v2] = oe(null), [y2, C2] = oe(null), [S2, x2] = oe(null);
|
|
2908
|
+
re(() => {
|
|
2909
|
+
C2(null), r2.getDetails().then((e3) => {
|
|
2910
|
+
w2(false), C2(e3.asUrl()), e3.asSVGText?.() && x2(e3.asSVGText());
|
|
2911
|
+
}).catch((e3) => {
|
|
2912
|
+
console.warn(e3), w2(true), C2(fo), x2(null);
|
|
2913
|
+
});
|
|
2914
|
+
}, [r2]);
|
|
2915
|
+
const k2 = b(t2, () => ({ isPictureEditor: () => true }), []), R2 = te(() => {
|
|
2916
|
+
if (y2 || S2) return G("img", { style: { flex: "1", width: "100%", height: "100%", border: f2 ? "var(--sxl-app-color-grey, grey) solid 1px" : void 0, backgroundColor: f2 ? "var(--sxl-app-color-background, white)" : void 0, boxShadow: f2 ? "0px 0px 3px var(--sxl-app-color-error, red)" : void 0, objectFit: f2 ? "contain" : void 0, opacity: q2 ? 1 : 0, filter: "var(--sxl-app-filter-dark-invert)" }, draggable: false, src: y2, onLoad: () => {
|
|
2917
|
+
v2(true);
|
|
2918
|
+
}, onError: ({ currentTarget: e3 }) => {
|
|
2919
|
+
console.log("error"), e3.onerror = null, C2(fo), w2(true);
|
|
2920
|
+
}, alt: i2 ?? `${r2.getType()}` });
|
|
2921
|
+
}, [q2, r2, y2, S2, a2]);
|
|
2922
|
+
if (!r2.isClosed()) return Z("div", { className: "picture-editor", style: { position: "relative", display: "flex", flex: "1 1 100%", filter: a2 ? "drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))" : void 0, ...l2, width: "100%", height: "100%" }, tabIndex: 0, ...p2, onKeyDownCapture: (e3) => {
|
|
2923
|
+
g2?.(e3);
|
|
2924
|
+
}, ref: k2, children: [q2 || f2 ? void 0 : m2, R2] });
|
|
2925
|
+
}));
|
|
2926
|
+
wo.displayName = "PictureEditor";
|
|
2927
|
+
const qo = ee(ne((e2, t2) => {
|
|
2928
|
+
const { children: o2, disabled: n2, chart: l2, view: r2, isDragging: i2, onHide: a2, onShow: s2, ...d2 } = e2;
|
|
2929
|
+
re(() => {
|
|
2930
|
+
}, [l2]);
|
|
2931
|
+
const c2 = b(t2, () => ({ isChartEditor: () => true }), []), [g2, { height: u2, width: h2 }] = Re();
|
|
2932
|
+
if (!l2.isClosed()) return G("div", { ...d2, ref: ke([c2, g2]), children: G("div", { className: "chart-editor", style: { width: "100%", height: "100%", backgroundColor: "var(--sxl-app-color-background, white)", backgroundImage: "var(--sxl-app-image-background)", alignItems: "center", justifyContent: "center", zoom: r2.getZoom(), display: "flex", position: "relative", border: "var(--sxl-app-color-grey, grey) solid 1px", filter: n2 ? "blur(1px)" : void 0, boxShadow: i2 ? "1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))" : void 0 }, children: G("div", { style: { textAlign: "center" }, children: l2.getDescription() }) }) });
|
|
2933
|
+
})), vo = "_editable-input_w34rk_11", yo = (e2) => G("input", { ...e2 }), Co = ee(ne((e2, t2) => {
|
|
2934
|
+
const { style: o2 = {}, className: n2, value: l2 = "", onSubmit: r2, onChange: i2, onCancel: a2, createInput: s2 = yo, notifier: d2, styleHover: c2 = {}, dragging: g2, maxLength: u2, disabled: h2 = false, readOnly: m2 = false, ...p2 } = e2, [f2, w2] = oe(false), [q2, v2] = oe(false), [y2, C2] = oe(l2);
|
|
2935
|
+
re(() => {
|
|
2936
|
+
C2(l2);
|
|
2937
|
+
}, [l2]);
|
|
2938
|
+
const x2 = le(null), [k2, R2] = oe(null), M2 = ae(function(e3) {
|
|
2939
|
+
const t3 = e3.message;
|
|
2940
|
+
k2 !== t3 && (d2?.showMessage?.(t3, { type: E.Error }), R2(t3));
|
|
2941
|
+
}, [d2, k2]), T2 = ae((e3) => {
|
|
2942
|
+
let t3 = false;
|
|
2943
|
+
try {
|
|
2944
|
+
t3 = r2?.(e3) ?? true;
|
|
2945
|
+
} catch (e4) {
|
|
2946
|
+
M2(e4);
|
|
2947
|
+
}
|
|
2948
|
+
return t3 ? (x2.current = null, v2(false), C2(e3), t3) : (setTimeout(() => {
|
|
2949
|
+
x2.current?.focus();
|
|
2950
|
+
}, 0), t3);
|
|
2951
|
+
}, [r2]), A2 = S(() => {
|
|
2952
|
+
C2(l2), x2.current = null, v2(false), a2?.();
|
|
2953
|
+
}, [a2, l2]), z2 = te(() => {
|
|
2954
|
+
if (!q2) return null;
|
|
2955
|
+
const e3 = { className: Me(vo), autoFocus: true, spellCheck: false, name: "editable-label", autoComplete: "off", maxLength: u2, type: "text", value: y2, onFocus: (e4) => {
|
|
2956
|
+
x2.current || (x2.current = e4.target, setTimeout(() => {
|
|
2957
|
+
e4.target?.select();
|
|
2958
|
+
}, 0));
|
|
2959
|
+
}, onBlur: (e4) => {
|
|
2960
|
+
x2.current && T2(y2);
|
|
2961
|
+
}, onChange: (e4) => {
|
|
2962
|
+
q2 && C2(e4.target.value);
|
|
2963
|
+
}, onMouseDown: (e4) => e4.stopPropagation(), onKeyDown: (e4) => "Escape" === e4.code ? (e4.preventDefault(), void A2()) : "Enter" === e4.code ? (e4.preventDefault(), void T2(e4.target.value)) : void ("Tab" !== e4.code ? e4.stopPropagation() : T2(e4.target.value)) };
|
|
2964
|
+
return G(j, { children: s2(e3) });
|
|
2965
|
+
}, [q2, y2, T2, A2, s2, h2]), [F2, D2] = oe();
|
|
2966
|
+
ie(() => {
|
|
2967
|
+
let e3 = Object.assign({}, o2);
|
|
2968
|
+
(g2 || f2) && (e3 = Object.assign(e3, c2)), D2(e3);
|
|
2969
|
+
}, [g2, f2, c2, o2]), re(() => {
|
|
2970
|
+
z2 && i2?.(y2);
|
|
2971
|
+
}, [z2, i2, y2]);
|
|
2972
|
+
const I2 = b(t2, () => ({ startEdit() {
|
|
2973
|
+
h2 || m2 || v2(true);
|
|
2974
|
+
}, cancel() {
|
|
2975
|
+
A2();
|
|
2976
|
+
} }), []);
|
|
2977
|
+
return Z("div", { ...p2, ref: I2, style: { flexDirection: "column", display: "flex", ...F2 }, className: Me(n2), children: [Z("div", { style: { position: "relative", boxSizing: "content-box", whiteSpace: "pre", userSelect: "none", display: "flex", justifyContent: "center" }, onDoubleClick: () => {
|
|
2978
|
+
h2 || m2 || v2(true);
|
|
2979
|
+
}, onMouseEnter: () => w2(true), onMouseLeave: () => w2(false), children: [G("div", { className: "editable-label-container", style: { textAlign: "center", display: "flex", minHeight: "1em", marginTop: "2px", opacity: q2 ? 0 : 1 }, children: y2 }), z2] }), G("div", { style: { whiteSpace: "pre", position: "relative", maxHeight: "0px", height: "0px", visibility: "hidden", marginLeft: "1px", marginRight: "1px", overflow: "hidden", ...c2 }, children: y2 })] });
|
|
2980
|
+
})), bo = ee(ne((e2, t2) => {
|
|
2981
|
+
const { children: o2, style: n2, className: l2, index: r2, editing: i2, editable: a2, selectedIndex: s2, background: d2, activeColor: c2, borderColor: g2, borderWidth: u2, dragging: h2, ...m2 } = e2;
|
|
2982
|
+
return Z("div", { ref: t2, className: Me(l2), style: { ...n2, display: "flex", flexDirection: "column", background: s2 === r2 ? "white" : d2, minHeight: "0px", fontFamily: "inherit", fontSize: "16px", fontWeight: s2 === r2 ? "700" : "400", lineHeight: "1", letterSpacing: "0px", textTransform: "none", minWidth: "unset" }, ...m2, children: [Z("div", { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, children: [G("div", { style: { marginLeft: s2 === r2 ? "0px" : "-1px", marginTop: s2 === r2 ? "0px" : "4px", marginBottom: "0px", background: "grey", minWidth: "1px" } }), o2, s2 === r2 ? G("div", { style: { marginLeft: "0px", marginTop: "0px", marginBottom: "0px", background: "grey", minWidth: "1px" } }) : G(j, {})] }), G("div", { style: { flex: "1 1 100%", background: s2 === r2 && c2 ? c2?.toCSS() : "none", minHeight: "2px" } })] });
|
|
2983
|
+
})), So = { Wrapper: "_Wrapper_6tyma_49", fadeIn: "_fadeIn_6tyma_65", dragOverlay: "_dragOverlay_6tyma_73", Item: "_Item_6tyma_93", withHandle: "_withHandle_6tyma_121", dragging: "_dragging_6tyma_131", disabled: "_disabled_6tyma_147" }, xo = J.memo(J.forwardRef(({ color: e2, dragOverlay: t2, dragging: o2, disabled: n2, fadeIn: l2, handle: r2, height: i2, index: a2, listeners: s2, onRemove: d2, renderItem: c2, sorting: g2, style: u2, transition: h2, transform: m2, value: p2, wrapperStyle: f2, ...w2 }, q2) => {
|
|
2984
|
+
re(() => {
|
|
2985
|
+
if (t2) return document.body.style.cursor = "grabbing", () => {
|
|
2986
|
+
document.body.style.cursor = "";
|
|
2987
|
+
};
|
|
2988
|
+
}, [t2]);
|
|
2989
|
+
const v2 = c2 ? c2({ dragOverlay: Boolean(t2), dragging: Boolean(o2), sorting: Boolean(g2), index: a2, fadeIn: Boolean(l2), listeners: s2, ref: q2, style: u2, transform: m2, transition: h2, value: p2 }) : G(j, { children: p2 });
|
|
2990
|
+
return G("div", { className: Me("tab-item", So.Wrapper, l2 && So.fadeIn, g2 && So.sorting, t2 && So.dragOverlay), style: { ...f2, transition: [h2, f2?.transition].filter(Boolean).join(", "), "--translate-x": m2 ? `${Math.round(m2.x)}px` : void 0, "--translate-y": m2 ? `${Math.round(m2.y)}px` : void 0, "--scale-x": m2?.scaleX ? `${m2.scaleX}` : void 0, "--scale-y": m2?.scaleY ? `${m2.scaleY}` : void 0, "--index": a2 }, ref: q2, children: G("div", { className: Me(So.Item, o2 && So.dragging, r2 && So.withHandle, t2 && So.dragOverlay, n2 && So.disabled, e2 && So.color, "dragging"), style: u2, "data-cypress": "draggable-item", ...r2 ? void 0 : s2, ...w2, tabIndex: r2 ? void 0 : -1, children: v2 }) });
|
|
2991
|
+
})), ko = { Row: "_Row_11qr0_1" }, Ro = ee(ne(({ children: e2, horizontal: t2, style: o2 }, n2) => G("div", { ref: n2, style: { ...o2 }, className: Me(ko.Row, t2 && ko.horizontal), children: e2 }))), Mo = { ...Be }, To = ee(ne((e2, t2) => {
|
|
2992
|
+
const { className: o2, activationConstraint: n2, animateLayoutChanges: l2, adjustScale: r2 = false, collisionDetection: i2 = He, coordinateGetter: a2 = Fe, dropAnimation: s2 = Mo, getItemStyles: d2 = () => ({}), getNewIndex: c2, handle: g2 = false, items: u2, onMove: h2, isDisabled: m2 = () => false, measuring: p2, modifiers: f2, renderItem: w2, renderDivider: q2, reorderItems: v2 = Ee, strategy: y2 = De, style: C2, useDragOverlay: b2 = true, onDragStart: S2, wrapperStyle: x2 = () => ({}) } = e2, [k2, R2] = oe(() => u2);
|
|
2993
|
+
re(() => {
|
|
2994
|
+
R2(u2);
|
|
2995
|
+
}, [u2]);
|
|
2996
|
+
const [M2, T2] = oe(null), A2 = Oe(Pe($e, { activationConstraint: n2 }), Pe(We, { activationConstraint: n2 }), Pe(Ue, { scrollBehavior: "Cypress" in window ? "auto" : void 0, coordinateGetter: a2 })), z2 = k2.indexOf.bind(k2), F2 = M2 ? z2(M2) : -1, E2 = [];
|
|
2997
|
+
k2.map((e3, t3) => {
|
|
2998
|
+
E2.push(G(Ao, { id: e3, handle: g2, index: t3, style: d2, wrapperStyle: x2, disabled: m2(e3), renderItem: w2, animateLayoutChanges: l2, useDragOverlay: b2, getNewIndex: c2 }, e3 + "-" + t3));
|
|
2999
|
+
const o3 = q2?.({ key: "divider-" + t3 });
|
|
3000
|
+
o3 && E2.push(o3);
|
|
3001
|
+
});
|
|
3002
|
+
const { getPortalContainer: D2 } = P();
|
|
3003
|
+
return Z(_e, { sensors: A2, collisionDetection: i2, onDragStart: (e3) => {
|
|
3004
|
+
const { active: t3 } = e3;
|
|
3005
|
+
t3 && (S2?.(e3), T2(t3.id));
|
|
3006
|
+
}, autoScroll: { canScroll: (e3) => true }, onDragEnd: (e3) => {
|
|
3007
|
+
if (T2(null), e3.over) {
|
|
3008
|
+
const t3 = z2(e3.over.id);
|
|
3009
|
+
F2 !== t3 && (R2((e4) => v2(e4, F2, t3)), h2?.(F2, t3));
|
|
3010
|
+
}
|
|
3011
|
+
}, onDragCancel: () => {
|
|
3012
|
+
T2(null);
|
|
3013
|
+
}, measuring: p2, modifiers: f2, children: [G("div", { style: { display: "flex", justifyContent: "flex-start", boxSizing: "border-box", ...C2 }, className: Me(o2, So.Wrapper), children: G(Ie, { items: k2, strategy: y2, children: G(Ro, { ref: t2, children: E2 }) }) }), b2 ? Ae(G(Ge, { adjustScale: r2, dropAnimation: s2, children: M2 ? G(xo, { value: k2[F2], handle: g2, renderItem: w2, wrapperStyle: x2({ index: F2, isDragging: true, id: k2[F2] }), index: F2, dragging: true, style: d2({ id: k2[F2], index: F2, isSorting: null !== M2, isDragging: true, overIndex: -1, isDragOverlay: true }), dragOverlay: true }) : null }), D2()) : null] });
|
|
3014
|
+
}));
|
|
3015
|
+
function Ao({ disabled: e2, animateLayoutChanges: t2, getNewIndex: o2, handle: n2, id: l2, index: r2, onRemove: i2, style: a2, renderItem: s2, useDragOverlay: d2, wrapperStyle: c2 }) {
|
|
3016
|
+
const { attributes: g2, isDragging: u2, isSorting: h2, listeners: m2, overIndex: p2, setNodeRef: f2, transform: w2, transition: q2 } = Ve({ id: l2, animateLayoutChanges: t2, disabled: e2, getNewIndex: o2 });
|
|
3017
|
+
return G(xo, { ref: f2, value: l2, disabled: e2, dragging: u2, sorting: h2, handle: n2, renderItem: s2, index: r2, style: a2({ index: r2, id: l2, isDragging: u2, isSorting: h2, overIndex: p2 }), onRemove: i2 ? () => i2(l2) : void 0, transform: w2, transition: q2, wrapperStyle: c2({ index: r2, isDragging: u2, id: l2 }), listeners: m2, "data-index": r2, "data-id": l2, dragOverlay: !d2 && u2, ...g2 });
|
|
3018
|
+
}
|
|
3019
|
+
const zo = "_TabStrip_nciwy_1", Fo = new h("rgb(33, 115, 70)"), Eo = "#eee", Do = (e2) => G(bo, { ...e2 }), Io = ee(ne((e2, t2) => {
|
|
3020
|
+
const { children: o2, style: n2, className: l2, selectedTabIndex: r2 = 0, tabNames: i2 = [], onSelectedTabIndexChange: a2, onTabNameChange: s2, onTabMove: d2, createScrollStartButton: c2 = $, createScrollEndButton: g2 = W, createScrollEdgeButton: u2 = U, createTabButton: h2 = Do, createTabDivider: m2, editLabelProps: p2, disabled: f2 = false, disableDrag: w2 = false, background: q2 = "white", activeColor: v2 = Fo, borderColor: y2 = Eo, borderWidth: C2 = 1 } = e2, [b2, S2] = oe(r2), [x2, k2] = oe(i2), R2 = ae((e3) => {
|
|
3021
|
+
const t3 = D2.current?.[e3]?.closest(".tab-item") ?? D2.current?.[e3];
|
|
3022
|
+
t3 && P2.current?.scrollTo({ top: t3.offsetTop, left: t3.offsetLeft, behavior: "smooth" });
|
|
3023
|
+
}, []);
|
|
3024
|
+
re(() => {
|
|
3025
|
+
R2(r2);
|
|
3026
|
+
}, [r2]);
|
|
3027
|
+
const M2 = ae((e3, t3) => {
|
|
3028
|
+
t3 !== b2 && (S2(t3), a2?.(t3)), R2(t3);
|
|
3029
|
+
}, [a2, b2]), T2 = ae((e3, t3) => {
|
|
3030
|
+
d2?.(e3, t3);
|
|
3031
|
+
}, [d2]), A2 = le(null), [z2, F2] = oe(-1), E2 = ae((e3, t3) => {
|
|
3032
|
+
s2?.(e3, t3);
|
|
3033
|
+
}, [s2]);
|
|
3034
|
+
ie(() => {
|
|
3035
|
+
S2(r2);
|
|
3036
|
+
}, [r2]), ie(() => {
|
|
3037
|
+
k2(i2);
|
|
3038
|
+
}, [i2]);
|
|
3039
|
+
const D2 = le([]), V2 = le(null);
|
|
3040
|
+
ge(t2, () => Object.assign({ startEdit(e3) {
|
|
3041
|
+
D2.current?.[e3]?.startEdit();
|
|
3042
|
+
}, cancel(e3) {
|
|
3043
|
+
D2.current?.[e3]?.cancel();
|
|
3044
|
+
} }, V2.current), [b2, z2]);
|
|
3045
|
+
const N2 = ae(({ value: e3, index: t3, dragging: o3 }) => {
|
|
3046
|
+
const { style: n3, maxLength: l3, ...r3 } = p2 || {}, i3 = G(Co, { ref: (e4) => {
|
|
3047
|
+
D2.current[t3] = e4;
|
|
3048
|
+
}, value: e3, disabled: f2, maxLength: l3, style: { color: b2 === t3 && v2 ? v2?.toRGBA().toString() : "inherit", flex: "1 1 100%", paddingTop: "1px", paddingBottom: "1px", ...n3 }, styleHover: {}, onSubmit: (e4) => (A2.current = false, F2(-1), E2(t3, e4)), onCancel: () => {
|
|
3049
|
+
A2.current = false, F2(-1);
|
|
3050
|
+
}, onChange: (e4) => {
|
|
3051
|
+
A2.current = true, F2(t3);
|
|
3052
|
+
}, ...r3 });
|
|
3053
|
+
return h2({ onClick: (e4) => M2(e4, t3), value: e3, index: t3, editing: z2 === t3 && A2.current, editable: true, disabled: f2, selectedIndex: b2, background: q2, activeColor: v2, borderColor: y2, borderWidth: C2, dragging: o3, children: i3 });
|
|
3054
|
+
}, [b2, E2, M2, p2, f2, z2, h2]), [L2, { width: H2 }] = Re(), [B2, { width: O2 }] = Re(), P2 = le(null), [K2, X2] = oe({ left: 0, top: 0, width: 0, height: 0 }), [Y2, Q2] = oe(null);
|
|
3055
|
+
re(() => {
|
|
3056
|
+
null !== Y2 && P2.current && P2.current.scrollTo({ left: Y2, behavior: "smooth" });
|
|
3057
|
+
}, [Y2]);
|
|
3058
|
+
const J2 = ae((e3, t3 = false) => {
|
|
3059
|
+
if (!P2.current) return 0;
|
|
3060
|
+
let o3 = P2.current.firstChild.getBoundingClientRect(), n3 = P2.current.firstChild.firstChild.children, l3 = 0;
|
|
3061
|
+
return l3 = t3 ? 0 : _.getScrollTo(e3, o3.left, n3, true, Math.max(0, e3 - 200)), Q2(l3), Math.max(0, l3);
|
|
3062
|
+
}, []), ee2 = ae((e3, t3 = false) => {
|
|
3063
|
+
if (!P2.current) return 0;
|
|
3064
|
+
let o3 = P2.current.firstChild.getBoundingClientRect(), n3 = P2.current.firstChild.firstChild.children, l3 = 0;
|
|
3065
|
+
const r3 = Math.ceil(O2 - H2);
|
|
3066
|
+
return l3 = t3 ? r3 : _.getScrollTo(e3, o3.left, n3, false, Math.max(0, e3 + 200)), Q2(l3), Math.min(r3, l3);
|
|
3067
|
+
}, [O2, H2]), ne2 = le(null), se2 = le(null), de2 = ae(() => {
|
|
3068
|
+
se2.current && (clearTimeout(se2.current), se2.current = null, ne2.current = null);
|
|
3069
|
+
}, []), ce2 = ae((e3, t3, o3 = 260) => {
|
|
3070
|
+
ne2.current = e3, se2.current = setTimeout(() => {
|
|
3071
|
+
const o4 = t3 ? J2(ne2.current || e3) : ee2(ne2.current || e3);
|
|
3072
|
+
o4 !== ne2.current ? ce2(o4, t3, 120) : de2();
|
|
3073
|
+
}, o3);
|
|
3074
|
+
}, [J2, ee2, de2]);
|
|
3075
|
+
re(() => () => de2(), [de2]);
|
|
3076
|
+
const ue2 = te(() => ({ style: { marginLeft: "4px", marginRight: "6px" }, disabled: Math.floor(K2.left) <= 0 || 0 === Math.floor(O2 - H2), orientation: I.Horizontal, onMouseUp: de2, onMouseLeave: de2, onMouseDown: () => ce2(P2.current.scrollLeft, true), onClick: (e3) => J2(Math.min(P2.current.scrollLeft, Y2 ?? Number.MAX_SAFE_INTEGER), e3.ctrlKey) }), [K2, Y2, O2, H2]), he2 = te(() => ({ style: { marginLeft: "6px", marginRight: "4px" }, disabled: Math.floor(O2 - H2) <= Math.ceil(K2.left), orientation: I.Horizontal, onMouseUp: de2, onMouseLeave: de2, onMouseDown: () => ce2(P2.current.scrollLeft, false), onClick: (e3) => ee2(Math.max(P2.current.scrollLeft, Y2 ?? 0), e3.ctrlKey) }), [K2, Y2, O2, H2]), me2 = te(() => Z(j, { children: [G("div", { style: { minWidth: "16px" } }), o2, u2?.(ue2)] }), [ue2, he2, c2, g2, o2, u2]);
|
|
3077
|
+
return Z("div", { style: { ...n2, display: "flex", alignItems: "stretch" }, className: Me(zo, l2), ref: V2, children: [G("div", { style: { borderTop: `solid ${y2} ${C2}px`, position: "absolute", width: "100%" } }), G("div", { style: { flex: "none", display: "flex", alignItems: "center" }, children: me2 }), G("div", { className: "Tabs", ref: L2, style: { flex: "1 1 100%", display: "flex", position: "relative", overflow: "hidden" }, children: G("div", { style: { position: "relative", overflowY: "hidden", overflowX: "hidden", marginBottom: "3px" }, ref: P2, onScroll: (e3) => {
|
|
3078
|
+
X2({ left: e3.target.scrollLeft, top: e3.target.scrollTop, width: e3.target.scrollWidth, height: e3.target.scrollHeight });
|
|
3079
|
+
}, children: G(To, { isDisabled: (e3) => f2 || w2, items: x2, strategy: Ne, modifiers: [Le], ref: B2, renderItem: N2, renderDivider: m2, onMove: T2, activationConstraint: { distance: 15 } }) }) }), G("div", { style: { flex: "none", display: "flex", alignItems: "center" }, children: u2(he2) })] });
|
|
3080
|
+
}));
|
|
3081
|
+
Io.displayName = "TabStrip";
|
|
3082
|
+
const Vo = (e2) => Z("svg", { ...e2, viewBox: "0 0 48 48", children: [G("path", { d: "M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z", fill: "#547DBE" }), G("path", { d: "m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z", fill: "#FFFFFF" }), G("path", { d: "m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z", fill: "#547DBE", fillOpacity: "0.4" }), G("path", { d: "m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z", strokeWidth: "2.5", stroke: "#EB594D", fill: "#f9CECB" })] }), No = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z" }), G("path", { className: "styled background", d: "M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z" }), G("path", { className: "styled info_light", d: "M 619 1941 h -299 v -1322 h 299 z" }), G("path", { className: "styled info_dark", d: "M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z" }), G("path", { className: "styled secondary_light", d: "M 1429 1941 h -298 v -1066 h 298 z" }), G("path", { className: "styled secondary_dark", d: "M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z" })] }), Lo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z" }), G("path", { className: "styled background", d: "M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z" }), G("path", { className: "styled info_light", d: "M 832 1387 h -469 v -640 h 469 z" }), G("path", { className: "styled info_dark", d: "M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z" }), G("path", { className: "styled secondary_light", d: "M 1600 1131 h -469 v -811 h 469 z" }), G("path", { className: "styled secondary_dark", d: "M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z" })] }), Ho = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z" }), G("path", { className: "styled background", d: "M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z" }), G("path", { className: "styled info_light", d: "M 832 1515 h -469 v -1195 h 469 z" }), G("path", { className: "styled info_dark", d: "M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z" }), G("path", { className: "styled secondary_light", d: "M 1600 875 h -469 v -555 h 469 z" }), G("path", { className: "styled secondary_dark", d: "M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z" })] }), Bo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z" }), G("path", { className: "styled info", d: "M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z" })] }), Oo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z" }), G("path", { className: "styled info", d: "M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z" })] }), Po = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z" }), G("path", { className: "styled info", d: "M 1877 299 h -1770 v -43 h 1770 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z" })] }), $o = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z" }), G("path", { className: "styled current_color", d: "M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z" }), G("path", { className: "styled info", d: "M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z" })] }), Wo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z" }), G("path", { className: "styled info", d: "M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z" })] }), Uo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z" }), G("path", { className: "styled info", d: "M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z" })] }), _o = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z" }), G("path", { className: "styled background", d: "M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z" }), G("path", { className: "styled current_color", d: "M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z" }), G("path", { className: "styled info_light", d: "M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z" }), G("path", { className: "styled info_dark", d: "M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z" })] }), Go = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z" }), G("path", { className: "styled background", d: "M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z" }), G("path", { className: "styled current_color", d: "M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z" }), G("path", { className: "styled info_light", d: "M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z" }), G("path", { className: "styled info_dark", d: "M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z" })] }), Zo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z" }), G("path", { className: "styled background", d: "M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z" }), G("path", { className: "styled info_light", d: "M 1813 277 v 299 h -1706 v -299 z" }), G("path", { className: "styled info_dark", d: "M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z" }), G("path", { className: "styled secondary_light", d: "M 917 1088 v 299 h -810 v -299 z" }), G("path", { className: "styled secondary_dark", d: "M 896 1109 h -795 v -42 h 838 v 322 h -43 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z" })] }), jo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z" }), G("path", { className: "styled background", d: "M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z" }), G("path", { className: "styled info_light", d: "M 704 832 v -469 h 640 v 469 z" }), G("path", { className: "styled info_dark", d: "M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z" }), G("path", { className: "styled secondary_light", d: "M 917 1600 v -469 h 811 v 469 z" }), G("path", { className: "styled secondary_dark", d: "M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z" })] }), Ko = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z" }), G("path", { className: "styled background", d: "M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z" }), G("path", { className: "styled info_light", d: "M 533 832 v -469 h 1195 v 469 z" }), G("path", { className: "styled info_dark", d: "M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z" }), G("path", { className: "styled secondary_light", d: "M 1173 1600 v -469 h 555 v 469 z" }), G("path", { className: "styled secondary_dark", d: "M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z" })] }), Xo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z" }), G("path", { className: "styled background", d: "M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z" }), G("path", { className: "styled info_light", d: "M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z" }), G("path", { className: "styled info_dark", d: "M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z" }), G("path", { className: "styled current_color", d: "M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z" })] }), Yo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z" }), G("path", { className: "styled background", d: "M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z" }), G("path", { className: "styled info_light", d: "M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z" }), G("path", { className: "styled info_dark", d: "M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z" })] }), Qo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z" }), G("path", { className: "styled background", d: "M 1941 1941 h -1834 v -1834 h 1834 z" }), G("path", { className: "styled current_color", d: "M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z" }), G("path", { className: "styled info_light", d: "M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z" }), G("path", { className: "styled info_dark", d: "M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z" })] }), Jo = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z" }), G("path", { className: "styled background", d: "M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z" }), G("path", { className: "styled info", d: "M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z" })] }), en = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z" }), G("path", { className: "styled background", d: "M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z" }), G("path", { className: "styled info", d: "M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z" }), G("path", { className: "styled current_color", d: "M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z" })] }), tn = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z" }), G("path", { className: "styled info", d: "M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z" })] }), on = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z" }), G("path", { className: "styled background", d: "M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z" }), G("path", { className: "styled info", d: "M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z" }), G("path", { className: "styled current_color", d: "M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z" })] }), nn = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z" }), G("path", { className: "styled info", d: "M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z" }), G("path", { className: "styled current_color", d: "M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z" })] }), ln = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z" }), G("path", { className: "styled background", d: "M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z" }), G("path", { className: "styled info_light", d: "M 619 1941 h -299 v -1322 h 299 z" }), G("path", { className: "styled info_dark", d: "M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z" }), G("path", { className: "styled secondary_light", d: "M 1429 1941 h -298 v -1066 h 298 z" }), G("path", { className: "styled secondary_dark", d: "M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z" })] }), rn = (e2) => Z("svg", { viewBox: "0,0,2048,2048", ...e2, children: [G("path", { className: "styled high_contrast", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z" }), G("path", { className: "styled background", d: "M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z" }), G("path", { className: "styled info_light", d: "M 619 1941 h -299 v -1322 h 299 z" }), G("path", { className: "styled info_dark", d: "M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z" }), G("path", { className: "styled secondary_light", d: "M 1429 1941 h -298 v -1066 h 298 z" }), G("path", { className: "styled secondary_dark", d: "M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z" }), G("path", { className: "styled current_color", d: "M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z" })] }), an = ue(null), sn = (e2) => {
|
|
3083
|
+
const { themes: t2, children: o2 } = e2;
|
|
3084
|
+
return G(an.Provider, { value: t2, children: o2 });
|
|
3085
|
+
}, dn = () => {
|
|
3086
|
+
const e2 = he(an), [t2] = oe(() => new y());
|
|
3087
|
+
return te(() => e2 || t2, [e2]);
|
|
3088
|
+
}, cn = "_script-editor_faoxm_9", gn = J.lazy(() => import("@monaco-editor/react")), un = { lightbulb: { enabled: false }, tabSize: 2, acceptSuggestionOnCommitCharacter: true, acceptSuggestionOnEnter: "on", accessibilitySupport: "auto", automaticLayout: true, autoIndent: false, codeLens: true, colorDecorators: true, contextmenu: true, cursorBlinking: "blink", cursorSmoothCaretAnimation: false, cursorStyle: "line", disableLayerHinting: false, disableMonospaceOptimizations: false, dragAndDrop: true, glyphMargin: true, fixedOverflowWidgets: false, folding: true, foldingStrategy: "auto", fontLigatures: false, formatOnPaste: true, formatOnType: false, hideCursorInOverviewRuler: false, highlightActiveIndentGuide: true, links: true, lineDecorationsWidth: 8, lineNumbersMinChars: 3, mouseWheelZoom: false, multiCursorMergeOverlapping: true, multiCursorModifier: "alt", overviewRulerBorder: true, overviewRulerLanes: 2, quickSuggestions: true, quickSuggestionsDelay: 100, readOnly: false, renderControlCharacters: false, renderFinalNewline: true, renderIndentGuides: true, renderLineHighlight: "all", renderWhitespace: "none", revealHorizontalRightPadding: 30, roundedSelection: true, rulers: [], scrollBeyondLastColumn: 5, scrollBeyondLastLine: true, selectOnLineNumbers: true, selectionClipboard: true, selectionHighlight: true, showLightbulbIconMode: false, showFoldingControls: "mouseover", smoothScrolling: true, suggestOnTriggerCharacters: true, wordBasedSuggestions: true, wordSeparators: `~!@#$%^&*()-=+[{]}|;:'",.<>/?`, wordWrap: "off", wordWrapBreakAfterCharacters: " })]?|&,;", wordWrapBreakBeforeCharacters: "{([+", wordWrapBreakObtrusiveCharacters: ".", wordWrapColumn: 80, wordWrapMinified: true, wrappingIndent: "none" }, hn = '\n/**\n * Placeholder for SheetXL scripting types.\n */\ndeclare module "index" {\n global {\n /**\n * SheetXL namespace. For full documentation see\n * {@link https://api.sheetxl.com | API Documentation}\n */\n namespace SheetXL {\n type ISheet = any;\n /**\n * Main interface. - Copy from interface.\n */\n namespace ISheet {\n }\n\n type IWorkbook = any;\n /**\n * Copy from interface.\n */\n namespace IWorkbook {\n }\n type ICellRanges = any;\n /**\n * Copy from interface.\n */\n namespace ICellRanges {\n }\n type ICellRange = any;\n /**\n * Copy from interface.\n */\n namespace ICellRange {\n }\n type ICell = any;\n /**\n * Copy from interface.\n */\n namespace ICell {\n }\n }\n export const SheetXL: any;\n }\n}\n', mn = async (e2, t2, o2) => {
|
|
3089
|
+
const n2 = e2.getModel();
|
|
3090
|
+
if (!n2) return;
|
|
3091
|
+
const l2 = await t2.languages.typescript.getTypeScriptWorker(), r2 = await l2(n2.uri), i2 = await r2.getNavigationTree(n2.uri.toString()), a2 = e2.getPosition();
|
|
3092
|
+
let s2 = { ...a2 };
|
|
3093
|
+
s2.lineNumber = 1, s2.column = 1;
|
|
3094
|
+
let d2 = false;
|
|
3095
|
+
for (let e3 = a2.lineNumber; e3 >= 1; e3--) {
|
|
3096
|
+
if ("" === n2.getLineContent(e3).trim()) {
|
|
3097
|
+
const t3 = wn(i2, n2.getOffsetAt({ lineNumber: e3, column: 1 }), "function");
|
|
3098
|
+
if (!t3 || qn(t3)) {
|
|
3099
|
+
d2 = true, s2.lineNumber = e3 + 1;
|
|
3100
|
+
break;
|
|
3101
|
+
}
|
|
3102
|
+
{
|
|
3103
|
+
const o3 = t3.spans[0].start;
|
|
3104
|
+
e3 = n2.getPositionAt(o3).lineNumber, s2.lineNumber = e3;
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
let c2 = o2, g2 = false;
|
|
3109
|
+
!d2 && !c2.startsWith("\n") && s2.lineNumber > 1 && (c2 = "\n" + c2, g2 = true);
|
|
3110
|
+
let u2 = false;
|
|
3111
|
+
n2.getLineCount() > 1 && (c2.endsWith("\n\n") || (c2 += "\n\n", u2 = true));
|
|
3112
|
+
const h2 = [{ range: new t2.Range(s2.lineNumber, s2.column, s2.lineNumber, s2.column), text: `${c2}` }];
|
|
3113
|
+
let m2 = null;
|
|
3114
|
+
n2.pushEditOperations([], h2, (e3) => (m2 = e3[0].range, g2 && m2.startLineNumber++, u2 && m2.endLineNumber--, [new t2.Selection(m2.startLineNumber, m2.startColumn, m2.endLineNumber, m2.endColumn)])), e2.setSelection({ startLineNumber: m2.endLineNumber, startColumn: m2.endColumn, endLineNumber: m2.startLineNumber, endColumn: m2.startColumn });
|
|
3115
|
+
};
|
|
3116
|
+
function pn(e2, t2) {
|
|
3117
|
+
let o2 = null;
|
|
3118
|
+
for (let n2 = 0; !o2 && n2 < e2.length; n2++) {
|
|
3119
|
+
const l2 = e2[n2];
|
|
3120
|
+
l2.getName() === t2.text && (o2 = l2);
|
|
3121
|
+
}
|
|
3122
|
+
return o2 ? o2.getContext() : "formula";
|
|
3123
|
+
}
|
|
3124
|
+
function fn(e2, t2, o2, n2, l2 = []) {
|
|
3125
|
+
if ("function" === n2.kind && "export" === n2.kindModifiers) {
|
|
3126
|
+
const t3 = n2.spans[0].start, r2 = e2.getPositionAt(t3);
|
|
3127
|
+
l2.push({ name: n2.text, type: pn(o2, n2), lineNumber: r2.lineNumber });
|
|
3128
|
+
}
|
|
3129
|
+
if (n2.childItems) for (const r2 of n2.childItems) fn(e2, t2, o2, r2, l2);
|
|
3130
|
+
return l2;
|
|
3131
|
+
}
|
|
3132
|
+
function wn(e2, t2, o2 = "function", n2) {
|
|
3133
|
+
const l2 = e2.spans;
|
|
3134
|
+
for (let r2 = 0; r2 < l2.length; r2++) {
|
|
3135
|
+
const i2 = l2[r2];
|
|
3136
|
+
if (i2.start <= t2 && t2 < i2.start + i2.length) {
|
|
3137
|
+
if (e2.kind === o2 && (!n2 || e2.kindModifiers === n2)) return e2;
|
|
3138
|
+
for (const l3 of e2.childItems || []) {
|
|
3139
|
+
const e3 = wn(l3, t2, o2, n2);
|
|
3140
|
+
if (e3) return e3;
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
return null;
|
|
3144
|
+
}
|
|
3145
|
+
}
|
|
3146
|
+
function qn(e2) {
|
|
3147
|
+
return "comment" === e2.kind;
|
|
3148
|
+
}
|
|
3149
|
+
const vn = ee(ne((e2, t2) => {
|
|
3150
|
+
const { className: o2, style: n2, commands: l2, readOnly: r2 = false, onClose: i2, darkMode: a2, loadingPanel: s2, autoFocus: d2 = true, onStatusChange: c2, ...g2 } = e2, u2 = le(null), h2 = S(i2, [i2]), m2 = le(false), p2 = te(() => ({ contains(e3) {
|
|
3151
|
+
if (!u2.current) return;
|
|
3152
|
+
const t3 = u2.current.editor;
|
|
3153
|
+
return t3 && t3.getDomNode()?.contains(e3);
|
|
3154
|
+
}, focus() {
|
|
3155
|
+
if (!u2.current) return;
|
|
3156
|
+
const e3 = u2.current.editor;
|
|
3157
|
+
return e3 && e3.getDomNode()?.focus();
|
|
3158
|
+
} }), []), f2 = te(() => [new R("help", p2, { label: "Script Commands", description: "Open Editor Commands", shortcut: { key: "F1" } }, () => {
|
|
3159
|
+
})], []), w2 = te(() => {
|
|
3160
|
+
let e3 = null;
|
|
3161
|
+
const t3 = () => p2;
|
|
3162
|
+
return e3 = l2 ? l2.createChildGroup(t3, "scriptEditor", false) : new T(t3, "scriptEditor"), e3.addCommands(f2, true), e3;
|
|
3163
|
+
}, [l2, f2]), q2 = D(w2, ["executeSelectedScript"])[0], v2 = q2?.context(), y2 = S((e3) => {
|
|
3164
|
+
q2?.execute(e3);
|
|
3165
|
+
}, [q2]), C2 = le(""), [x2, k2] = oe(false), M2 = S(async () => {
|
|
3166
|
+
if (!u2.current) return null;
|
|
3167
|
+
const e3 = u2.current, t3 = e3.editor;
|
|
3168
|
+
if (!t3) return null;
|
|
3169
|
+
const o3 = e3.monaco, n3 = await (async (e4, t4, o4 = "export") => {
|
|
3170
|
+
const n4 = e4.getModel();
|
|
3171
|
+
if (!n4) return null;
|
|
3172
|
+
const l3 = await t4.languages.typescript.getTypeScriptWorker(), r3 = await l3(n4.uri), i3 = await r3.getNavigationTree(n4.uri.toString());
|
|
3173
|
+
let a3 = null, s3 = e4.getSelection();
|
|
3174
|
+
const d3 = s3.startLineNumber === s3.endLineNumber && s3.startColumn === s3.endColumn ? n4.getLineCount() : Math.min(s3.endLineNumber, n4.getLineCount());
|
|
3175
|
+
for (let e5 = s3.startLineNumber; !a3 && e5 <= d3; e5++) {
|
|
3176
|
+
const t5 = wn(i3, n4.getOffsetAt({ lineNumber: e5, column: 1 }), "function", o4);
|
|
3177
|
+
t5 && (a3 = t5.text);
|
|
3178
|
+
}
|
|
3179
|
+
return a3;
|
|
3180
|
+
})(t3, o3);
|
|
3181
|
+
return c2?.({ message: (n3 ?? "").toUpperCase() }), n3 ? { source: t3.getValue(), name: n3 } : null;
|
|
3182
|
+
}, [c2]);
|
|
3183
|
+
const A2 = S(async (e3, t3, o3) => {
|
|
3184
|
+
const n3 = await v2.getScripts().createModule({ source: o3?.getValue(), declarationsOnly: true }), l3 = n3 ? n3.getFunctions().search() : K.EmptyArray;
|
|
3185
|
+
n3 && (async function(e4, t4) {
|
|
3186
|
+
const o4 = [];
|
|
3187
|
+
for (let n4 = 1; n4 < e4.getLineCount() + 1; n4++) {
|
|
3188
|
+
const l4 = { startLineNumber: n4, startColumn: 1, endLineNumber: n4, endColumn: e4.getLineLength(n4) + 1 }, r3 = e4.getValueInRange(l4).indexOf("modelt");
|
|
3189
|
+
-1 !== r3 && o4.push({ message: "found 'modelt'", resource: "https://www.sheetxl.com", severity: t4.MarkerSeverity.Hint, startLineNumber: l4.startLineNumber, startColumn: r3 + 1, endLineNumber: l4.startLineNumber, endColumn: r3 + 5 });
|
|
3190
|
+
}
|
|
3191
|
+
t4.editor.setModelMarkers(e4, "owner", o4);
|
|
3192
|
+
}(e3, t3), async function(e4, t4, o4, n4) {
|
|
3193
|
+
const l4 = await t4.languages.typescript.getTypeScriptWorker(), r3 = await l4(e4.uri), i3 = await r3.getNavigationTree(e4.uri.toString()), a3 = fn(e4, t4, n4, i3).map((e5) => {
|
|
3194
|
+
let o5 = null, n5 = null;
|
|
3195
|
+
return "formula" === e5.type ? (o5 = "formula.margin-icon", n5 = "Formula") : "macro" === e5.type ? (o5 = "macro.margin-icon", n5 = "Macro") : "autoRun" === e5.type && (o5 = "autorun.margin-icon", n5 = "Auto Run"), { range: new t4.Range(e5.lineNumber, 1, e5.lineNumber, 1), options: { isWholeLine: false, glyphMarginClassName: o5, glyphMarginHoverMessage: n5, stickiness: t4.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges } };
|
|
3196
|
+
});
|
|
3197
|
+
I2.current && I2.current.clear(), I2.current = o4.createDecorationsCollection(a3);
|
|
3198
|
+
}(e3, t3, o3, l3));
|
|
3199
|
+
}, [v2]), z2 = S(K.debounce(A2, 580), []), F2 = S(async (e3 = void 0) => {
|
|
3200
|
+
if (!u2.current || !v2) return;
|
|
3201
|
+
const t3 = u2.current.editor.getPosition(), o3 = { cursor: t3 ? t3.toString() : "" };
|
|
3202
|
+
void 0 !== e3 && (o3.message = e3), c2?.(o3);
|
|
3203
|
+
const n3 = M2();
|
|
3204
|
+
v2.setSelectedFunction(n3);
|
|
3205
|
+
}, [v2, c2]);
|
|
3206
|
+
re(() => {
|
|
3207
|
+
if (!v2) return;
|
|
3208
|
+
const e3 = { insertSnippet: (e4) => {
|
|
3209
|
+
u2.current?.editor && (x2 ? mn(u2.current.editor, u2.current.monaco, e4) : C2.current = e4);
|
|
3210
|
+
} };
|
|
3211
|
+
v2.setEditor(e3), v2.setSelectedFunction(M2());
|
|
3212
|
+
const t3 = v2.addContainerListener({ onBeforeSave: async () => {
|
|
3213
|
+
if (!u2.current?.editor || !v2) return;
|
|
3214
|
+
const e4 = u2.current.editor, t4 = v2?.getScripts().getModules().getByName("scripting"), o3 = t4?.getSource(), n3 = e4.getValue();
|
|
3215
|
+
if (!((o3?.length ?? 0) !== n3.length || o3 !== n3)) return;
|
|
3216
|
+
await v2.saveSource(e4.getValue());
|
|
3217
|
+
const l3 = (o3?.length ?? 0) !== n3.length || o3 !== n3;
|
|
3218
|
+
c2?.({ dirty: l3 });
|
|
3219
|
+
}, onReadonlyChange() {
|
|
3220
|
+
}, onScriptChange: async () => {
|
|
3221
|
+
if (!u2.current?.editor || !v2) return;
|
|
3222
|
+
const e4 = u2.current.editor, t4 = v2.getScripts().getModules().search()[0]?.getSource() ?? "";
|
|
3223
|
+
e4.setValue(t4);
|
|
3224
|
+
} });
|
|
3225
|
+
return () => {
|
|
3226
|
+
t3(), v2.setSelectedFunction(null), v2.setEditor(null);
|
|
3227
|
+
};
|
|
3228
|
+
}, [v2, x2]), re(() => () => {
|
|
3229
|
+
if (!u2.current?.editor) return;
|
|
3230
|
+
const e3 = u2.current.editor;
|
|
3231
|
+
v2?.saveSource(e3.getValue());
|
|
3232
|
+
}, []);
|
|
3233
|
+
const E2 = S((e3) => {
|
|
3234
|
+
const t3 = u2.current;
|
|
3235
|
+
if (!t3) return false;
|
|
3236
|
+
const o3 = t3.editor;
|
|
3237
|
+
return !!o3 && (o3.focus(), true);
|
|
3238
|
+
}, []), I2 = le(null), V2 = S((e3, t3) => {
|
|
3239
|
+
u2.current = { monaco: t3, editor: e3 }, k2(true), F2("Loading Types");
|
|
3240
|
+
const o3 = v2.getScripts().getModules().search()[0]?.getSource() ?? "";
|
|
3241
|
+
e3.setValue(o3), import("monaco-editor-auto-typings/custom-editor.js").then((o4) => {
|
|
3242
|
+
F2("");
|
|
3243
|
+
o4.AutoTypings.create(e3, { shareCache: true, monaco: t3, onError: (e4) => {
|
|
3244
|
+
"Not implemented yet" === e4 && (e4 = "Compile Errors"), console.warn("Error compiling types", e4);
|
|
3245
|
+
} }).then(async (o5) => {
|
|
3246
|
+
const n4 = e3.getModel();
|
|
3247
|
+
z2(n4, t3, e3);
|
|
3248
|
+
});
|
|
3249
|
+
}), e3.addCommand("executeScript", function(e4, ...t4) {
|
|
3250
|
+
t4?.[0] && y2({ functionName: t4?.[0] });
|
|
3251
|
+
}, ""), e3.addAction({ id: "executeScript", label: "Execute", keybindings: [t3.KeyCode.F8], run: async (e4) => {
|
|
3252
|
+
const t4 = M2();
|
|
3253
|
+
v2.setSelectedFunction(t4);
|
|
3254
|
+
const o4 = await t4;
|
|
3255
|
+
y2(o4);
|
|
3256
|
+
} }), e3.addAction({ id: "saveScript", label: "Save Script", keybindings: [t3.KeyMod.CtrlCmd | t3.KeyCode.KeyS], run: (t4) => {
|
|
3257
|
+
v2?.saveSource(e3.getValue()).then(() => {
|
|
3258
|
+
const t5 = v2?.getScripts().getModules().getByName("scripting"), o4 = t5?.getSource(), n4 = e3.getValue(), l3 = (o4?.length ?? 0) !== n4.length || o4 !== n4;
|
|
3259
|
+
c2?.({ dirty: l3 });
|
|
3260
|
+
});
|
|
3261
|
+
} }), e3.onMouseDown(async (o4) => {
|
|
3262
|
+
if (o4.target.type === t3.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
|
|
3263
|
+
const l3 = o4.target.position.lineNumber, r3 = await t3.languages.typescript.getTypeScriptWorker(), i3 = await r3(n3.uri), a3 = await i3.getNavigationTree(n3.uri.toString()), s3 = e3?.getValue(), d3 = (await v2?.saveSource(s3)).getFunctions().search(), c3 = fn(n3, t3, d3, a3).find((e4) => e4.lineNumber === l3);
|
|
3264
|
+
if (c3) {
|
|
3265
|
+
const e4 = o4.event.browserEvent.button;
|
|
3266
|
+
0 === e4 ? "macro" === c3.type || "autoRun" === c3.type ? y2({ functionName: c3.name }) : "formula" === c3.type && v2.quickInsertFunction?.(c3.name) : 2 === e4 && (console.log("Context menu for function:", c3.name), o4.event.browserEvent.preventDefault());
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
}), e3.onDidChangeModelContent(() => {
|
|
3270
|
+
const o4 = e3.getModel();
|
|
3271
|
+
z2(o4, t3, e3);
|
|
3272
|
+
});
|
|
3273
|
+
const n3 = e3.getModel();
|
|
3274
|
+
!function(e4, t4) {
|
|
3275
|
+
t4.languages.registerInlayHintsProvider("typescript", { provideInlayHints(e5, o4, n4) {
|
|
3276
|
+
const l3 = [];
|
|
3277
|
+
for (let o5 = 1; o5 < e5.getLineCount() + 1; o5++) {
|
|
3278
|
+
const n5 = { startLineNumber: o5, startColumn: 1, endLineNumber: o5, endColumn: e5.getLineLength(o5) + 1 }, r3 = "hint", i3 = e5.getValueInRange(n5).indexOf("hint");
|
|
3279
|
+
-1 !== i3 && l3.push({ kind: t4.languages.InlayHintKind.Type, position: { lineNumber: n5.startLineNumber, column: i3 + r3.length + 1 }, label: "[hint]" });
|
|
3280
|
+
}
|
|
3281
|
+
return { hints: l3, dispose: () => {
|
|
3282
|
+
} };
|
|
3283
|
+
} });
|
|
3284
|
+
}(0, t3), n3.onDidChangeContent((t4) => {
|
|
3285
|
+
const o4 = v2?.getScripts().getModules().getByName("scripting"), n4 = o4?.getSource(), l3 = e3.getValue(), r3 = (n4?.length ?? 0) !== l3.length || n4 !== l3;
|
|
3286
|
+
c2?.({ dirty: r3 });
|
|
3287
|
+
}), e3.onDidChangeCursorPosition((e4) => {
|
|
3288
|
+
F2();
|
|
3289
|
+
});
|
|
3290
|
+
}, [v2, c2]), N2 = te(() => x2 ? null : s2 || G("div", { style: { position: "absolute", width: "100%", height: "100%" }, children: "Loading..." }), [x2, s2]), L2 = te(() => {
|
|
3291
|
+
const e3 = v2?.getScripts().getModules().getByName("scripting")?.getSource() ?? "";
|
|
3292
|
+
return Z("div", { style: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "row", position: "relative", boxSizing: "border-box" }, children: [G(de, { children: G(gn, { theme: a2 ? "extended-dark" : "extended", options: { ...un, fixedOverflowWidgets: true, readOnly: r2 }, language: "typescript", value: e3, onValidate: (e4) => {
|
|
3293
|
+
let t3 = false;
|
|
3294
|
+
for (let o3 = 0; !t3 && o3 < e4?.length; o3++) 8 === e4[o3].severity && (t3 = true);
|
|
3295
|
+
}, beforeMount: (e4) => {
|
|
3296
|
+
e4.languages.typescript.typescriptDefaults.setDiagnosticsOptions({ noSemanticValidation: true, noSyntaxValidation: true }), e4.languages.json.jsonDefaults.setDiagnosticsOptions({ validate: true }), e4.editor.defineTheme("extended", { base: "vs", inherit: true, rules: [], colors: {} }), e4.editor.defineTheme("extended-dark", { base: "vs-dark", inherit: true, rules: [], colors: {} });
|
|
3297
|
+
(async () => {
|
|
3298
|
+
let t3 = false;
|
|
3299
|
+
try {
|
|
3300
|
+
const o4 = await (async () => {
|
|
3301
|
+
try {
|
|
3302
|
+
const e5 = await fetch("http://localhost:8088/types-scripting.d.ts");
|
|
3303
|
+
return await e5.text();
|
|
3304
|
+
} catch (e5) {
|
|
3305
|
+
return console.warn("Fallback to global types"), hn;
|
|
3306
|
+
}
|
|
3307
|
+
})(), n3 = e4.Uri.parse('inmemory://model/"sheetxl-models".d.ts'), l3 = e4.editor.createModel(o4, "typescript", n3);
|
|
3308
|
+
e4.editor.setModelMarkers(l3, "default", []), t3 = true;
|
|
3309
|
+
} catch (e5) {
|
|
3310
|
+
console.warn("cant load types", e5);
|
|
3311
|
+
}
|
|
3312
|
+
t3 && (e4.languages.typescript.typescriptDefaults.addExtraLib(hn, "global.d.ts"), e4.languages.typescript.typescriptDefaults.addExtraLib("\ndeclare module '@sheetxl/primitives' {\n /** Interface defining the methods available on the formula context. */\n\n export interface IFormulaContext {\n /** Gets the cell address where the formula is being evaluated. */\n getPosition(): { readonly row: number; readonly col: number };\n\n /** Marks the formula result as volatile (recalculated on every sheet change). */\n markVolatile(): void;\n\n /** Format the return value. */\n formatResults(numFmt: string): void;\n\n /** Gets a reference to a range relative to the current cell. */\n getReferenceRange(a1Coords: string): IRange | null;\n\n // ... other methods users can call on the context ...\n }\n\n export type Observable<T = any> = any;\n export const Observable: any;\n export type Subscriber<T = any> = any\n\n export type FormulaError = any;\n\n export type Scalar = any;\n export type ScalarType = any;\n export const ScalarType: any;\n // Additional iterator support\n export interface IRange {\n values(options?: any): IterableIterator<any>;\n values<T>(options?: any): IterableIterator<T>; // Add explicit generic overload\n\n entries(): IterableIterator<{coords: any, value: any}>;\n entries<T>(): IterableIterator<{coords: any, value: T}>;\n }\n export const IRange: any;\n\n // --- Exported Values (like your context singleton) ---\n\n /**\n * Provides access to the current formula execution context.\n * Use its methods like getPosition(), markVolatile(), etc.\n * @summary Access the current formula context instance.\n */\n export const FormulaContext: IFormulaContext;\n\n export type FormulaError = any;\n\n} // End declare module\n", "primitives.d.ts")), e4.languages.registerLinkProvider("*", { provideLinks: (t4, o4) => {
|
|
3313
|
+
const n3 = [], l3 = { links: n3 }, r3 = t4.getLinesContent();
|
|
3314
|
+
for (let o5 = 1; o5 <= r3.length; o5++) {
|
|
3315
|
+
const l4 = r3[o5 - 1], i3 = e4.editor.tokenize(l4, "typescript");
|
|
3316
|
+
for (let r4 = 0; r4 < i3[0].length; r4++) {
|
|
3317
|
+
const a3 = i3[0]?.[r4];
|
|
3318
|
+
if (a3 && a3.type.startsWith("string")) {
|
|
3319
|
+
let s3 = a3.offset, d3 = i3[0]?.[r4 + 1]?.offset ?? l4.length, c3 = new e4.Range(o5, s3 + 1, o5, d3 + 1), g3 = t4.getValueInRange(c3);
|
|
3320
|
+
const u3 = g3[0];
|
|
3321
|
+
"`" !== u3 && "'" !== u3 && '"' !== u3 || (s3++, g3 = g3.substring(1));
|
|
3322
|
+
const h3 = g3[g3.length - 1];
|
|
3323
|
+
"`" !== h3 && "'" !== h3 && '"' !== h3 || (s3++, g3 = g3.substring(0, g3.length - 1));
|
|
3324
|
+
try {
|
|
3325
|
+
v2.getRanges(g3) && n3.push({ range: { endColumn: d3, endLineNumber: o5, startColumn: s3, startLineNumber: o5 }, tooltip: `Goto range '${g3}'`, url: `/range/${g3}` });
|
|
3326
|
+
} catch (e5) {
|
|
3327
|
+
console.warn(e5);
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
return l3;
|
|
3333
|
+
} }), e4.editor.registerLinkOpener({ open(e5) {
|
|
3334
|
+
if (e5?.path?.startsWith("/range/")) {
|
|
3335
|
+
try {
|
|
3336
|
+
v2.getRanges(e5.path.substring(7))?.select();
|
|
3337
|
+
} catch (e6) {
|
|
3338
|
+
console.warn("invalid range", e6);
|
|
3339
|
+
}
|
|
3340
|
+
return true;
|
|
3341
|
+
}
|
|
3342
|
+
return false;
|
|
3343
|
+
} });
|
|
3344
|
+
const o3 = e4.languages.typescript.typescriptDefaults.getCompilerOptions();
|
|
3345
|
+
e4.languages.typescript.typescriptDefaults.setCompilerOptions({ ...o3, target: e4.languages.typescript.ScriptTarget.ES2020, lib: ["webworker", "es2020", "esnext.asynciterable"], downlevelIteration: true, moduleResolution: e4.languages.typescript.ModuleResolutionKind.Classic, baseUrl: "inmemory://model/", allowNonTsExtensions: true }), C2.current && (await mn(u2.current.editor, u2.current.monaco, C2.current), C2.current = null), m2.current && requestAnimationFrame(async () => {
|
|
3346
|
+
m2.current && e4.editor.focus();
|
|
3347
|
+
}), e4.languages.typescript.typescriptDefaults.setDiagnosticsOptions({ noSemanticValidation: false, noSyntaxValidation: false }), k2(true);
|
|
3348
|
+
})();
|
|
3349
|
+
}, onMount: V2 }) }), N2] });
|
|
3350
|
+
}, [v2, w2, r2, N2, a2]), H2 = b(t2, () => ({ isScriptEditorElement: () => true, focus: (e3) => {
|
|
3351
|
+
E2(e3);
|
|
3352
|
+
}, close: () => {
|
|
3353
|
+
h2?.();
|
|
3354
|
+
}, getEditor: () => v2?.getEditor() }), [v2]);
|
|
3355
|
+
return re(() => (d2 && requestAnimationFrame(() => {
|
|
3356
|
+
E2();
|
|
3357
|
+
}), () => {
|
|
3358
|
+
u2.current?.editor && requestAnimationFrame(() => {
|
|
3359
|
+
H2.current?.contains(document.activeElement) && E2();
|
|
3360
|
+
});
|
|
3361
|
+
}), []), G("div", { className: Me("script-editor", cn, o2), style: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", ...n2 }, ref: H2, ...g2, children: L2 });
|
|
3362
|
+
}));
|
|
3363
|
+
export {
|
|
3364
|
+
Xo as ChartAreaIcon,
|
|
3365
|
+
Yo as ChartAreaStackedIcon,
|
|
3366
|
+
Qo as ChartAreaStackedPercentIcon,
|
|
3367
|
+
Zo as ChartBarIcon,
|
|
3368
|
+
jo as ChartBarStackedIcon,
|
|
3369
|
+
Ko as ChartBarStackedPercentIcon,
|
|
3370
|
+
rn as ChartBubble3DIcon,
|
|
3371
|
+
ln as ChartBubbleIcon,
|
|
3372
|
+
No as ChartColumnIcon,
|
|
3373
|
+
Lo as ChartColumnStackedIcon,
|
|
3374
|
+
Ho as ChartColumnStackedPercentIcon,
|
|
3375
|
+
qo as ChartEditor,
|
|
3376
|
+
Bo as ChartLineIcon,
|
|
3377
|
+
$o as ChartLineMarkersIcon,
|
|
3378
|
+
Oo as ChartLineStackedIcon,
|
|
3379
|
+
Wo as ChartLineStackedMarkersIcon,
|
|
3380
|
+
Po as ChartLineStackedPercentIcon,
|
|
3381
|
+
Uo as ChartLineStackedPercentMarkersIcon,
|
|
3382
|
+
Go as ChartPieDoughnutIcon,
|
|
3383
|
+
_o as ChartPieIcon,
|
|
3384
|
+
nn as ChartScatterLinesIcon,
|
|
3385
|
+
on as ChartScatterLinesMarkersIcon,
|
|
3386
|
+
en as ChartScatterLinesMarkersSmoothIcon,
|
|
3387
|
+
tn as ChartScatterLinesSmoothIcon,
|
|
3388
|
+
Jo as ChartScatterMarkersIcon,
|
|
3389
|
+
po as CommandContext,
|
|
3390
|
+
Qe as CornerTriangle,
|
|
3391
|
+
je as DateUtils,
|
|
3392
|
+
an as DocThemesContext,
|
|
3393
|
+
sn as DocThemesProvider,
|
|
3394
|
+
Co as EditableLabel,
|
|
3395
|
+
eo as EmptyFrame,
|
|
3396
|
+
Je as FilterButton,
|
|
3397
|
+
Ye as FontUtils,
|
|
3398
|
+
xo as Item,
|
|
3399
|
+
LicenseManager,
|
|
3400
|
+
Vo as LogoNoPaddingIcon,
|
|
3401
|
+
vt as LogoTextNoPaddingIcon,
|
|
3402
|
+
Xt as MovableArea,
|
|
3403
|
+
wo as PictureEditor,
|
|
3404
|
+
Ro as Row,
|
|
3405
|
+
vn as ScriptEditor,
|
|
3406
|
+
lt as SheetCellEditor,
|
|
3407
|
+
et as SheetCellRenderer,
|
|
3408
|
+
mo as SheetElement,
|
|
3409
|
+
kt as SheetScrollbar,
|
|
3410
|
+
ft as StaticBorderRenderer,
|
|
3411
|
+
it as StyledStrokePath,
|
|
3412
|
+
bo as Tab,
|
|
3413
|
+
Io as TabStrip,
|
|
3414
|
+
rt as createCellEditStateFromCell,
|
|
3415
|
+
ct as useBordersOverlay,
|
|
3416
|
+
dn as useDocThemes,
|
|
3417
|
+
Ct as useModelListener,
|
|
3418
|
+
Jt as useMovableCommands,
|
|
3419
|
+
bt as useRangeListener,
|
|
3420
|
+
xt as useSheetCommands,
|
|
3421
|
+
Nt as useSheetCopyPaste
|
|
3422
|
+
};
|