@sheetxl/studio-mui 0.7.25 → 0.7.27
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/browser/cjs/{Dm4NlGHUR5cHJb_-.cjs → 0DtrpXkQQehBmvSv.cjs} +2 -2
- package/browser/cjs/{08TjDEveDHwp71Hr.cjs → 6C3ia2nz4Zm-AdMZ.cjs} +1 -1
- package/browser/cjs/{CIQB6aINXrmLgtud.cjs → BR_EGEaHisRrXAtK.cjs} +1 -1
- package/browser/cjs/{hArm5WSeJHOUh1Hy.cjs → B_v_M4TiavtofChs.cjs} +2 -2
- package/browser/cjs/{DqMjJ1_UxQP64PN9.cjs → C17p-h_nw582H7WD.cjs} +8 -8
- package/browser/cjs/{DNMWlNQ4P30Zna8n.cjs → CInmVysdoHEvvW9h.cjs} +1 -1
- package/browser/cjs/{DJ4pc2nkEOuweJ9d.cjs → CMvQZPQsE7MuTMy_.cjs} +1 -1
- package/browser/cjs/{CZSrd1bFDKrxqCXT.cjs → CkNt54AXVfJjIWja.cjs} +2 -2
- package/browser/cjs/{BdgmdOwl8Ihu_SWa.cjs → CtRvyhDzQxsk7dkI.cjs} +1 -1
- package/browser/cjs/{DSgoEngZpgNfqEOc.cjs → DN9cQ4_4ERQvzKn6.cjs} +2 -2
- package/browser/cjs/{BUoUA3qB8o1-hKDc.cjs → DUTuBWUNF-w3Fxtb.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{BxzzX4l9MTZBs-ei.cjs → pTzEs1wlZj5Bb6xc.cjs} +3 -3
- package/browser/esm/{CBBT_Ag-2mHY_Vcz.mjs → 8ZnwcsRrGO3Nlw9Y.mjs} +1 -1
- package/browser/esm/{D9s3T4zSA_T28_2Z.mjs → BFZ4oCbQukelEVLI.mjs} +1 -1
- package/browser/esm/{BqX7HP_KHTu6BG-z.mjs → BP3nTf4-SLftsj61.mjs} +1 -1
- package/browser/esm/{B4qul2IBvnPq-bfz.mjs → BSMkBkXBQgZhX1xk.mjs} +3 -3
- package/browser/esm/{CHKrj6EkGlcWRLsa.mjs → CPLIJbynjEkwF2T0.mjs} +335 -335
- package/browser/esm/{QnO2TYkI0YlyxaTn.mjs → CuC13VFjBYFE7kub.mjs} +2 -2
- package/browser/esm/{BUNkRzOmFcM6qKlk.mjs → Cw3i8T1tVnm8o6eB.mjs} +2 -2
- package/browser/esm/{D8aCgdw7gqiLlqQZ.mjs → D6E8W2KK4dGVRQO_.mjs} +2 -2
- package/browser/esm/{CS7m0yjVr6mz6Hnq.mjs → D8xc3AM9QHEqmpb9.mjs} +1 -1
- package/browser/esm/{BuOLHymVQ0-Hu2Hs.mjs → DA_bEpA5kkn89fmW.mjs} +2 -2
- package/browser/esm/{D1yHouRiMrgCZgpt.mjs → DVqOr-7nEXA7IjKJ.mjs} +1 -1
- package/browser/esm/{DRw96ha8H8IXThOg.mjs → VAUOzclLs-dR9nt_.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/node/esm/{C-0U7EB5YHc-SVUj.mjs → B9dvpdCD_p2q8aNP.mjs} +1 -1
- package/node/esm/{Qiiv-7jzC3Um0fXi.mjs → BBxZemzbmUkoOYdq.mjs} +1 -1
- package/node/esm/{rXjJTigQpGrjv1Dg.mjs → BDdkV45Cf7BLs5jE.mjs} +1 -1
- package/node/esm/{t8rP-eAF6DOVbIWy.mjs → BoX8OuVRgUNgw0Wb.mjs} +1 -1
- package/node/esm/{D93wg8ccbpGI-ebG.mjs → CPbwVoL6mq66TtTR.mjs} +1 -1
- package/node/esm/{DnpwH9URtEVSAq3X.mjs → DMd6h1vz-USluank.mjs} +1 -1
- package/node/esm/{DXAbXUXvts3U0rta.mjs → DYgtaT_soTbSP8M9.mjs} +1 -1
- package/node/esm/{CXAye26G1KSmMIk7.mjs → DxDGSRoOYlWydiwL.mjs} +1 -1
- package/node/esm/{CQTS85tM3YRQq9ty.mjs → OMgXBbHk-VRNKAop.mjs} +1 -1
- package/node/esm/{D2bqxAkASKXBgRdy.mjs → bGXLfLFngllNb8U1.mjs} +1 -1
- package/node/esm/index.mjs +13 -12
- package/package.json +8 -8
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Color as ft, IColor as hr, ITheme as yl, CommonUtils as vt, IBorder as ve, FontUtils as wl, IFont as _t, NumberFormat as ht, CoordUtils as Sl, Table as Wn, IFill as fn, ISheet as Lt, LicenseManager as ko, TypesUtils as Cl, IFontCollection as vl, IStyle as ce, ITextFrame as kl, Workbook as gr } from "@sheetxl/sdk";
|
|
2
2
|
import { StyledStrokePath as Tl, StaticBorderRenderer as jn, useModelListener as je, createCellEditStateFromCell as El, SheetCellEditor as Dl, DefaultTaskPaneRegistry as en, ScriptEditor as Rl, useTaskPaneArea as fa, useDocThemes as ba, TabStrip as Ml, SheetElement as Nl, SheetScrollbar as fr, PictureEditor as Pl, ChartEditor as Fl, EmptyFrame as Ol, LogoNoPaddingIcon as Bl, TaskPaneArea as Al, TaskPaneProvider as Il } from "@sheetxl/react";
|
|
3
3
|
import { jsxs as I, Fragment as ae, jsx as o } from "react/jsx-runtime";
|
|
4
|
-
import ne, { memo as U, forwardRef as X, useMemo as
|
|
4
|
+
import ne, { memo as U, forwardRef as X, useMemo as z, useCallback as _, isValidElement as $n, useState as V, useEffect as le, Suspense as xa, useRef as xe, version as Ll, createElement as De, useReducer as tn, useLayoutEffect as Tt, useContext as zl, cloneElement as Hl, Component as Wl } from "react";
|
|
5
5
|
import { Box as O, Typography as Fe, IconButton as ct, MenuItem as ya, Divider as po, Button as Qo, SvgIcon as wa, Input as Vn, FormControl as _n, TextField as Sa, InputAdornment as jl, Slider as $l, Paper as xt, FormControlLabel as At, Checkbox as It, CircularProgress as Vl, Select as _l, Tabs as Ca, Tab as va, useMediaQuery as ka, Card as Ul, CardActions as Kl, Collapse as Gl, DialogTitle as ql, CssBaseline as Xl } from "@mui/material";
|
|
6
6
|
import { CommandButton as B, ExhibitDivider as Q, defaultCreatePopupPanel as ke, CommandPopupButton as Oe, InputCommandButton as Yl, SimpleTooltip as Et, AnimatedLoadingPanel as Po, PopupButtonType as rt, ExhibitPopupIconButton as Dt, ExhibitPopupMenuItem as Un, ExhibitMenuItem as dt, createStrokeShadowFilter as br, strokeShadowFilter as Zl, ExhibitTooltip as at, ExhibitIconButton as bt, CommandTooltip as Kn, SimpleCommandPopupButton as qe, SelectedIcon as on, ExhibitOptionButton as Ql, ExhibitMenuHeader as ro, hexToRGB as xr, useFloatStack as ao, elevateColor as it, CommandToolbar as nn, renderScrollButtonEdge as Jl, renderScrollButtonEnd as es, renderScrollButtonStart as ts, StackTraceErrorPanel as os, scrollbarTheming as ns, LabelIcon as rn, ContextMenu as Ta, StackTrace as rs, useResolvedThemeMode as Ea, ThemeMode as Pn, useModal as as, useLazyWindow as is, useOptionsDialog as ls, useInputDialog as ss, AnimatedTraversingEllipsisIcon as cs, createExhibitTheme as yr, ModalProvider as ds } from "@sheetxl/utils-mui";
|
|
7
|
-
import { useTheme as
|
|
7
|
+
import { useTheme as et, alpha as Se, getOverlayAlpha as Be, ThemeProvider as Da } from "@mui/material/styles";
|
|
8
8
|
import { useCommands as Ae, CommandButtonType as re, useCallbackRef as Z, ReactUtils as an, KeyCodes as he, DynamicIcon as ye, useCommand as Ut, useMouseDownAndHoldListener as wr, useEditMode as ln, useNotifier as sn, NotifierType as kt, useImperativeElement as Rt, SplitPane as Gn, DefaultDynamicIconService as qn, RoundedTab as ps, SimpleCommand as We, Command as be, KeyModifiers as fe, CommandGroup as Xn, ToolTipPlacement as uo, ScrollPane as us, useUndoManager as ms, DefaultReactNotifier as hs, NotifierProvider as gs, UncaughtErrorBoundary as fs, ReactErrorBoundary as bs } from "@sheetxl/utils-react";
|
|
9
9
|
import eo, { createPortal as xs } from "react-dom";
|
|
10
|
-
import { alpha as
|
|
11
|
-
import { CommonUtils as
|
|
10
|
+
import { alpha as Ze } from "@mui/system";
|
|
11
|
+
import { CommonUtils as Je, ChainedError as Fn, ErrorUtils as ys, ExpectedError as ws, PartialError as Ss, UndoManager as Cs } from "@sheetxl/utils";
|
|
12
12
|
import { IOUtils as to } from "@sheetxl/io";
|
|
13
13
|
/**
|
|
14
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.
|
|
14
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.27
|
|
15
15
|
*
|
|
16
16
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
17
17
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -30,10 +30,10 @@ function Re() {
|
|
|
30
30
|
return e;
|
|
31
31
|
}
|
|
32
32
|
const vs = U(X((n, a) => {
|
|
33
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, parentFloat: c, ...h } = n, i = Ae(t, ["formatAlignLeftToggle", "formatAlignCenterToggle", "formatAlignRightToggle", "formatAlignJustifyToggle", "formatAlignCenterContinuousToggle", "formatAlignFillToggle", "formatAlignDistributedHorizontalToggle"]), d =
|
|
33
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, parentFloat: c, ...h } = n, i = Ae(t, ["formatAlignLeftToggle", "formatAlignCenterToggle", "formatAlignRightToggle", "formatAlignJustifyToggle", "formatAlignCenterContinuousToggle", "formatAlignFillToggle", "formatAlignDistributedHorizontalToggle"]), d = z(() => {
|
|
34
34
|
for (let p = 0; p < i.length; p++) if (i[p]?.getState()) return i[p];
|
|
35
35
|
return i[0];
|
|
36
|
-
}, [i]), g =
|
|
36
|
+
}, [i]), g = z(() => {
|
|
37
37
|
if (!e) return null;
|
|
38
38
|
const p = { ...e };
|
|
39
39
|
return delete p.beforeExecute, p;
|
|
@@ -43,7 +43,7 @@ const vs = U(X((n, a) => {
|
|
|
43
43
|
}, [l, e]);
|
|
44
44
|
return o(Oe, { ref: a, parentFloat: c, commands: t, commandHook: e, scope: r, createPopupPanel: b, label: "Horizontal Alignment", tooltip: "Configure how text is placed in the horizontal direction of the cell.", quickCommand: d?.getKey(), icon: d?.getIcon() ?? "FormatAlignLeft", ...h });
|
|
45
45
|
})), ks = U(X((n, a) => {
|
|
46
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["formatAlignTopToggle", "formatAlignMiddleToggle", "formatAlignBottomToggle", "formatAlignJustifyVerticalToggle", "formatAlignDistributedVerticalToggle"]), { activeCommand: i, allDisabled: d } =
|
|
46
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["formatAlignTopToggle", "formatAlignMiddleToggle", "formatAlignBottomToggle", "formatAlignJustifyVerticalToggle", "formatAlignDistributedVerticalToggle"]), { activeCommand: i, allDisabled: d } = z(() => {
|
|
47
47
|
const b = h.length;
|
|
48
48
|
let p, s = 0;
|
|
49
49
|
for (let u = 0; u < b; u++) {
|
|
@@ -57,7 +57,7 @@ const vs = U(X((n, a) => {
|
|
|
57
57
|
}, [l, e]);
|
|
58
58
|
return o(Oe, { ref: a, commands: t, commandHook: e, createPopupPanel: g, disabled: l || d, label: "Vertical Alignment", tooltip: "Configure how text is placed in the vertical direction of the cell.", icon: i?.getIcon() ?? "TextVerticalBottom", ...c });
|
|
59
59
|
})), Ts = U(X((n, a) => {
|
|
60
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["formatTextOverflowVisibleToggle", "formatTextOverflowWrapToggle", "formatTextOverflowClipToggle", "formatTextOverflowShrinkToggle"]), { activeCommand: i, allDisabled: d } =
|
|
60
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["formatTextOverflowVisibleToggle", "formatTextOverflowWrapToggle", "formatTextOverflowClipToggle", "formatTextOverflowShrinkToggle"]), { activeCommand: i, allDisabled: d } = z(() => {
|
|
61
61
|
const b = h.length;
|
|
62
62
|
let p, s = 0;
|
|
63
63
|
for (let u = 0; u < b; u++) {
|
|
@@ -71,7 +71,7 @@ const vs = U(X((n, a) => {
|
|
|
71
71
|
}, [l, e, r]);
|
|
72
72
|
return o(Oe, { ref: a, commands: t, commandHook: e, disabled: l || d, scope: r, label: "Text Overflow", tooltip: "Configure how text behaves when it doesn't fit within a cell.", createPopupPanel: g, icon: i?.getIcon() ?? "TextHorizontalOverflow", ...c });
|
|
73
73
|
})), Es = U(X((n, a) => {
|
|
74
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["formatTextRotate0", "formatTextRotate315", "formatTextRotate45", "formatTextRotate90", "formatTextRotate270", "formatSubscriptToggle", "formatTextRotateCustom"]), i =
|
|
74
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["formatTextRotate0", "formatTextRotate315", "formatTextRotate45", "formatTextRotate90", "formatTextRotate270", "formatSubscriptToggle", "formatTextRotateCustom"]), i = z(() => {
|
|
75
75
|
const b = h.length;
|
|
76
76
|
for (let p = 0; p < b; p++) {
|
|
77
77
|
const s = h[p];
|
|
@@ -81,7 +81,7 @@ const vs = U(X((n, a) => {
|
|
|
81
81
|
}, [h]), d = _((b, p) => {
|
|
82
82
|
const s = { variant: re.Menuitem, commandHook: e, scope: r, disabled: l }, u = I(ae, { children: [o(B, { ...s, command: p.getCommand("formatTextRotate0") }), o(Q, { orientation: "horizontal" }), o(B, { ...s, command: p.getCommand("formatTextRotate315") }), o(B, { ...s, command: p.getCommand("formatTextRotate45") }), o(B, { ...s, command: p.getCommand("formatTextRotate90") }), o(B, { ...s, command: p.getCommand("formatTextRotate270") }), o(Q, { orientation: "horizontal" }), o(Yl, { ...s, command: p.getCommand("formatTextRotateCustom"), label: "Custom" })] });
|
|
83
83
|
return ke({ ...b, children: u });
|
|
84
|
-
}, [l, e, r, t]), g =
|
|
84
|
+
}, [l, e, r, t]), g = z(() => (t.getCommand("formatTextRotateCustom")?.getState() ?? 0) !== 0, [h]);
|
|
85
85
|
return o(Oe, { ref: a, commands: t, commandHook: e, scope: r, selected: g, label: "Text Orientation", tooltip: "Rotate your text diagonally or vertically. This is a great way to label narrow columns.", createPopupPanel: d, quickCommand: g ? "formatTextRotate0" : "formatTextRotate315", icon: i?.getIcon() ?? "TextRotation315", ...c });
|
|
86
86
|
})), Ds = { Preset: "preset", Custom: "custom" }, Do = { Start: "start", End: "end" }, bn = {}, Rs = (n, a, t, e) => {
|
|
87
87
|
const r = n + "-" + a + "-" + t + (e ? "-server" : "");
|
|
@@ -95,7 +95,7 @@ const vs = U(X((n, a) => {
|
|
|
95
95
|
})(n, a, t, e);
|
|
96
96
|
return bn[r] = l, l;
|
|
97
97
|
}, Ms = {}, Ns = U((n) => {
|
|
98
|
-
const { className: a, style: t = an.EmptyCssProperties, white: e = "transparent", grey: r = "grey", size: l = 8, borderRadius: c, boxShadow: h, renderers: i = Ms, children: d, ...g } = n, b = d, p =
|
|
98
|
+
const { className: a, style: t = an.EmptyCssProperties, white: e = "transparent", grey: r = "grey", size: l = 8, borderRadius: c, boxShadow: h, renderers: i = Ms, children: d, ...g } = n, b = d, p = z(() => Object.assign({ borderRadius: c, boxShadow: h, position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", background: `url(${Rs(e, r, l, i?.canvas)}) center left` }, t), [e, r, l, i]);
|
|
99
99
|
return $n(d) ? ne.cloneElement(d, { ...b.props }) : o("div", { style: p, ...g });
|
|
100
100
|
}), Ps = U((n) => {
|
|
101
101
|
const { selectedColor: a, onSelectColor: t, onPreviewColor: e, onClick: r, onKeyDown: l, onMouseOver: c, onMouseLeave: h, onFocus: i, style: d = an.EmptyCssProperties, children: g, alphaWhite: b, alphaGrey: p, darkMode: s, alphaCheckSize: u = 7, ...x } = n;
|
|
@@ -110,7 +110,7 @@ const vs = U(X((n, a) => {
|
|
|
110
110
|
i?.(C), C.isDefaultPrevented() || e?.(a.toRGBA());
|
|
111
111
|
}, [e, i, a]), v = _((C) => {
|
|
112
112
|
l?.(C), C.isDefaultPrevented() || C.keyCode === he.Enter && t?.(a.toRGBA());
|
|
113
|
-
}, [t, l, a]), S =
|
|
113
|
+
}, [t, l, a]), S = z(() => a.toRGBA().alpha === 1 ? null : o(Ns, { size: u, white: b, grey: p, style: { position: "absolute", width: "calc(100% - 1.5px)", height: "calc(100% - 1.5px)", top: "0.75px", left: "0.75px" } }), [b, p, a]);
|
|
114
114
|
return I("div", { style: { position: "absolute", height: "100%", width: "100%", top: "0px", left: "0px", cursor: "pointer", outline: "none", ...d }, tabIndex: 0, ...x, onClick: w, onKeyDown: v, onMouseOver: m, onMouseLeave: f, onFocus: y, children: [S, o("div", { style: { position: "absolute", top: "0px", left: "0px", height: "100%", width: "100%", background: a.toCSS(s) }, children: g })] });
|
|
115
115
|
}), Yn = U((n) => {
|
|
116
116
|
const { schemeColorLookup: a, selectedColor: t, previewColor: e, colorDef: r, onSelectColorDef: l, onPreviewColorDef: c, propsSwatch: h, defaultButtonSize: i = 24, isLarge: d = !1, compareRGB: g = !1, darkMode: b = !1, ...p } = n, s = new ft({ val: r.definition.val, adjs: r.definition.adjs }, (S) => a(S)), u = g ? s.toRGBA().toString() : s.toString(), x = t && (g ? t.toRGBA().toString() : t.toString()) === u, w = e && (g ? e.toRGBA().toString() : e.toString()) === u, m = [];
|
|
@@ -133,7 +133,7 @@ const vs = U(X((n, a) => {
|
|
|
133
133
|
c?.(f);
|
|
134
134
|
}, [c]), x = _((f) => {
|
|
135
135
|
h?.(f);
|
|
136
|
-
}, [h]), w =
|
|
136
|
+
}, [h]), w = z(() => {
|
|
137
137
|
let f = [];
|
|
138
138
|
for (let y = 0; y < s.length; y++) {
|
|
139
139
|
let v = [], S = s[y];
|
|
@@ -145,7 +145,7 @@ const vs = U(X((n, a) => {
|
|
|
145
145
|
f.push(C);
|
|
146
146
|
}
|
|
147
147
|
return f;
|
|
148
|
-
}, [s, r, l, u, x]), m =
|
|
148
|
+
}, [s, r, l, u, x]), m = z(() => a ? o(Fe, { noWrap: !0, component: "div", sx: { display: "flex", flexShrink: "0", paddingLeft: "6px", paddingBottom: "4px", paddingTop: "0px", userSelect: "none", color: (f) => f.palette.text.secondary }, children: a }) : null, [a]);
|
|
149
149
|
return I(O, { style: { ...i }, children: [m, o(O, { sx: { display: "flex", flexDirection: "row", gap: "6px", marginBottom: "14px", flexWrap: "wrap", justifyContent: "flex-start" }, ...p, children: w })] });
|
|
150
150
|
}), nt = (n, a) => ({ description: n, definition: { val: a, adjs: [] } }), ze = (n, a, t, e, r, l) => {
|
|
151
151
|
const c = nt(n, a);
|
|
@@ -154,8 +154,8 @@ const vs = U(X((n, a) => {
|
|
|
154
154
|
r?.set(i, h);
|
|
155
155
|
const d = h.toRGBA().toString();
|
|
156
156
|
l?.set(d, h);
|
|
157
|
-
}, Fs = ne.lazy(() => import("./
|
|
158
|
-
const { selectedColor: t = null, previewColor: e = n.selectedColor ?? null, recentColors: r, schemeLookup: l, disableAlpha: c = !1, previewDebounceTime: h = 100, initialPanelType: i, defaultButtonSize: d = 24, width: g, onElementLoad: b, onDone: p, onEyeDropStart: s, onEyeDropStop: u, onPreviewColor: x, onPreviewColorImmediate: w, onSelectColor: m, autoColor: f, autoColorLabel: y = "Automatic", autoColorPosition: v = Do.Start, compareRGB: S = !1, darkMode: C = !1, ...k } = n, E = e || t, T = Z(x, [x]), M = Z(w, [w]), R = Z(m, [m]), D = Z(s, [s]), N = Z(u, [u]), [
|
|
157
|
+
}, Fs = ne.lazy(() => import("./DA_bEpA5kkn89fmW.mjs")), Os = U(X((n, a) => {
|
|
158
|
+
const { selectedColor: t = null, previewColor: e = n.selectedColor ?? null, recentColors: r, schemeLookup: l, disableAlpha: c = !1, previewDebounceTime: h = 100, initialPanelType: i, defaultButtonSize: d = 24, width: g, onElementLoad: b, onDone: p, onEyeDropStart: s, onEyeDropStop: u, onPreviewColor: x, onPreviewColorImmediate: w, onSelectColor: m, autoColor: f, autoColorLabel: y = "Automatic", autoColorPosition: v = Do.Start, compareRGB: S = !1, darkMode: C = !1, ...k } = n, E = e || t, T = Z(x, [x]), M = Z(w, [w]), R = Z(m, [m]), D = Z(s, [s]), N = Z(u, [u]), [j, F] = V(!1), L = et(), P = z(() => l || ft.getDefaultSchemeLookup(), [l]), $ = z(() => {
|
|
159
159
|
const W = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), Ce = [];
|
|
160
160
|
ze("Primary Background", "bg1", P, Ce, W, J), ze("Primary Text", "tx1", P, Ce, W, J), ze("Secondary Background", "bg2", P, Ce, W, J), ze("Secondary Text", "tx2", P, Ce, W, J), ze("Accent 1", "accent1", P, Ce, W, J), ze("Accent 2", "accent2", P, Ce, W, J), ze("Accent 3", "accent3", P, Ce, W, J), ze("Accent 4", "accent4", P, Ce, W, J), ze("Accent 5", "accent5", P, Ce, W, J), ze("Accent 6", "accent6", P, Ce, W, J);
|
|
161
161
|
const ge = yl.buildPalette(Ce, P, W, J), Ne = [];
|
|
@@ -163,12 +163,12 @@ const vs = U(X((n, a) => {
|
|
|
163
163
|
const Xe = f.toString();
|
|
164
164
|
W.set(Xe, f);
|
|
165
165
|
}
|
|
166
|
-
const Ge = /* @__PURE__ */ new Map(), Ve = typeof r == "function" ? r() : r,
|
|
166
|
+
const Ge = /* @__PURE__ */ new Map(), Ve = typeof r == "function" ? r() : r, Qe = [];
|
|
167
167
|
for (let Xe = 0; Ve && Xe < Ve.length; Xe++) {
|
|
168
168
|
const Ue = Ve[Xe].toString();
|
|
169
|
-
Ge.set(Ue, Ve[Xe]),
|
|
169
|
+
Ge.set(Ue, Ve[Xe]), Qe.push({ description: "Recent " + (Xe + 1), definition: { val: Ve[Xe].toString() } });
|
|
170
170
|
}
|
|
171
|
-
return { primaryColors: Ce, modifiedPresets: ge, standardColors: Ne, recentColorsLimited:
|
|
171
|
+
return { primaryColors: Ce, modifiedPresets: ge, standardColors: Ne, recentColorsLimited: Qe, mapAllPresets: W, mapAllPresetsRGB: J, mapRecent: Ge };
|
|
172
172
|
}, [P, r, c, f]);
|
|
173
173
|
le(() => {
|
|
174
174
|
b?.();
|
|
@@ -179,9 +179,9 @@ const vs = U(X((n, a) => {
|
|
|
179
179
|
le(() => {
|
|
180
180
|
if (i) de(i === Ds.Custom);
|
|
181
181
|
else if (t) {
|
|
182
|
-
let W = t.toString(), J =
|
|
183
|
-
J || (W = t.toRGBA().toString(), J =
|
|
184
|
-
const Ce =
|
|
182
|
+
let W = t.toString(), J = $.mapAllPresets.get(W);
|
|
183
|
+
J || (W = t.toRGBA().toString(), J = $.mapAllPresetsRGB.get(W));
|
|
184
|
+
const Ce = $.mapRecent.get(W);
|
|
185
185
|
de(!J && !Ce);
|
|
186
186
|
}
|
|
187
187
|
}, [t, i]);
|
|
@@ -201,37 +201,37 @@ const vs = U(X((n, a) => {
|
|
|
201
201
|
let J = !1;
|
|
202
202
|
if (W) {
|
|
203
203
|
const Ce = W.toString();
|
|
204
|
-
J =
|
|
204
|
+
J = !$.mapAllPresets.has(Ce);
|
|
205
205
|
}
|
|
206
206
|
R?.(W, J);
|
|
207
|
-
}, [R,
|
|
207
|
+
}, [R, $]), Me = Z((W) => {
|
|
208
208
|
const J = W ? new ft({ val: W.definition.val, adjs: W.definition.adjs }, P) : null;
|
|
209
209
|
Promise.resolve(p?.()).then(() => {
|
|
210
210
|
pe(J);
|
|
211
211
|
});
|
|
212
212
|
}, [P, p]), Te = Z((W) => {
|
|
213
213
|
oe(W ? new ft(W, P) : null);
|
|
214
|
-
}, [P]), Ie =
|
|
214
|
+
}, [P]), Ie = z(() => window.EyeDropper === void 0 ? o(ae, {}) : o(ct, { "aria-label": "eye dropper", size: "small", sx: { color: (W) => W.palette.text.icon ?? W.palette.action.active }, onClick: async () => {
|
|
215
215
|
F(!0), D?.(), await new EyeDropper().open().then((W) => {
|
|
216
216
|
F(!1), N?.();
|
|
217
|
-
let J = new ft(W.sRGBHex), Ce = J.toString(), ge =
|
|
218
|
-
if (ge || (Ce = J.toRGBA().toString(), ge =
|
|
217
|
+
let J = new ft(W.sRGBHex), Ce = J.toString(), ge = $.mapAllPresets.get(Ce);
|
|
218
|
+
if (ge || (Ce = J.toRGBA().toString(), ge = $.mapAllPresetsRGB.get(Ce)), !ge) {
|
|
219
219
|
const Ne = J.toRGBA(), Ge = 3;
|
|
220
220
|
let Ve = 255;
|
|
221
|
-
|
|
222
|
-
const Ue =
|
|
223
|
-
ee < Ge && ee < Ve && (ge =
|
|
221
|
+
$.mapAllPresetsRGB.forEach((Qe, Xe) => {
|
|
222
|
+
const Ue = Qe.toRGBA(), ee = Math.abs(Ue.red - Ne.red) + Math.abs(Ue.blue - Ne.blue) + Math.abs(Ue.green - Ne.green);
|
|
223
|
+
ee < Ge && ee < Ve && (ge = Qe);
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
de(!ge), oe(ge || J);
|
|
227
227
|
}).catch((W) => {
|
|
228
228
|
F(!1), W?.name !== "AbortError" && console.error(W);
|
|
229
229
|
});
|
|
230
|
-
}, children: o(ye, { iconKey: "Colorize" }) }), [
|
|
230
|
+
}, children: o(ye, { iconKey: "Colorize" }) }), [$, C]), me = z(() => {
|
|
231
231
|
if (!te) return;
|
|
232
232
|
const W = { opacity: te ? 1 : "0", position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", boxSizing: "border-box" };
|
|
233
233
|
return o(xa, { fallback: o("div", { style: W, children: o(Po, {}) }), children: o(Fs, { style: W, selectedColor: E ? E.toRGBA().toString() : "transparent", onColorChange: Te, disableAlpha: c }) });
|
|
234
|
-
}, [te, E]), ue =
|
|
234
|
+
}, [te, E]), ue = z(() => ({ onClick: K, alphaGrey: L.palette.text.icon ?? L.palette.action.active }), [K, L]), G = z(() => {
|
|
235
235
|
if (!f) return null;
|
|
236
236
|
const W = { description: y, definition: { val: f.getVal(), adjs: f.getAdjustments() } };
|
|
237
237
|
return o(ae, { children: I(ya, { sx: { display: "flex", color: (J) => J.palette.text.secondary }, onMouseOver: () => {
|
|
@@ -240,7 +240,7 @@ const vs = U(X((n, a) => {
|
|
|
240
240
|
Me(null);
|
|
241
241
|
}, children: [o(O, { sx: { flex: "none", boxShadow: (J) => J.shadows[2], borderRadius: (J) => J.spacing(0.5), overflow: "hidden" }, children: o(Yn, { schemeColorLookup: P, colorDef: W, selectedColor: t === null ? f : t, previewColor: e === null ? f : e, defaultButtonSize: d, isLarge: !0, darkMode: C, compareRGB: S, propsSwatch: ue }) }), o(Fe, { noWrap: !0, component: "div", style: { display: "flex", flex: "1 1 100%", marginLeft: "8px", userSelect: "none" }, children: y })] }) });
|
|
242
242
|
}, [f, y, P, t, e]);
|
|
243
|
-
return I(O, { ref: a, sx: { width: g, outline: "none", padding: "10px 10px", overflow: "hidden", boxSizing: "content-box" }, ...k, children: [I("div", { style: { position: "relative", display: "flex" }, children: [I("div", { style: { opacity: te ? "0" : 1 }, children: [G && v === Do.Start ? I(ae, { children: [G, o(po, { light: !0, style: { marginTop: "2px", marginBottom: "10px" } })] }) : null, o(Io, { title: "Theme Colors", schemeColorLookup: P, colorDefs:
|
|
243
|
+
return I(O, { ref: a, sx: { width: g, outline: "none", padding: "10px 10px", overflow: "hidden", boxSizing: "content-box" }, ...k, children: [I("div", { style: { position: "relative", display: "flex" }, children: [I("div", { style: { opacity: te ? "0" : 1 }, children: [G && v === Do.Start ? I(ae, { children: [G, o(po, { light: !0, style: { marginTop: "2px", marginBottom: "10px" } })] }) : null, o(Io, { title: "Theme Colors", schemeColorLookup: P, colorDefs: $.primaryColors, selectedColor: t, previewColor: e === void 0 ? t : e, propsSwatch: ue, onPreviewColorDef: Y, onSelectColorDef: Me, compareRGB: S, darkMode: C }), o(Io, { schemeColorLookup: P, colorDefs: $.modifiedPresets, selectedColor: t, previewColor: e === void 0 ? t : e, propsSwatch: ue, onPreviewColorDef: Y, onSelectColorDef: Me, compareRGB: S, darkMode: C }), o(po, { light: !0, style: { marginBottom: "10px" } }), o(Io, { title: "Standard Colors", schemeColorLookup: P, colorDefs: $.standardColors, selectedColor: t, previewColor: e === void 0 ? t : e, propsSwatch: ue, onPreviewColorDef: Y, onSelectColorDef: Me, compareRGB: S, darkMode: C }), I("div", { style: { opacity: $.recentColorsLimited.length === 0 ? "0" : void 0, display: $.recentColorsLimited.length === 0 ? "none" : void 0 }, children: [o(po, { light: !0, style: { marginBottom: "10px" } }), o(Io, { title: "Recent Colors", schemeColorLookup: P, colorDefs: $.recentColorsLimited, selectedColor: t, previewColor: e === void 0 ? t : e, propsSwatch: ue, onPreviewColorDef: Y, onSelectColorDef: Me, compareRGB: S, darkMode: C })] }), G && v === Do.End ? I(ae, { children: [o(po, { light: !0, sx: { marginTop: "2px", marginBottom: "2px" } }), G, o("div", { style: { marginBottom: "2px" } })] }) : null] }), me] }), o(po, { light: !0, style: { marginBottom: "10px" } }), I("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-around", gap: "8px", paddingLeft: "2px", paddingRight: "2px" }, children: [Ie, o("div", { style: { flex: "1 1 100%", background: "pink" } }), o(Qo, { style: { minWidth: "75px", maxWidth: "75px" }, value: "check", variant: "outlined", size: "small", onClick: () => {
|
|
244
244
|
se();
|
|
245
245
|
}, children: o("div", te ? { children: "Preset" } : { children: "Custom" }) }), o(Qo, { variant: "contained", size: "small", style: { minWidth: "75px" }, onClick: () => {
|
|
246
246
|
Promise.resolve(p?.()).then(() => {
|
|
@@ -252,20 +252,20 @@ const vs = U(X((n, a) => {
|
|
|
252
252
|
}), S = e || y || t || b?.autoColor, C = xe(!1), k = _(() => {
|
|
253
253
|
}, []), E = Z(() => {
|
|
254
254
|
v(t);
|
|
255
|
-
}, [t]), T = Z((
|
|
256
|
-
C.current || (v(
|
|
257
|
-
}, [w]), M = Z((
|
|
258
|
-
C.current || (v(
|
|
259
|
-
}, [m]), R = Z((
|
|
260
|
-
C.current || (v(void 0), f?.(
|
|
261
|
-
}, [f]), D =
|
|
255
|
+
}, [t]), T = Z(($) => {
|
|
256
|
+
C.current || (v($), w?.($));
|
|
257
|
+
}, [w]), M = Z(($) => {
|
|
258
|
+
C.current || (v($), m?.($));
|
|
259
|
+
}, [m]), R = Z(($, te) => {
|
|
260
|
+
C.current || (v(void 0), f?.($, te));
|
|
261
|
+
}, [f]), D = z(() => o(O, { className: "color-wrapper", sx: { lineHeight: "0", color: "inherit", "--sxl-color-active": `${S?.toCSS(u) ?? "transparent"}`, "& .activeColor": { fill: `${S?.toCSS(u) ?? "transparent"}` }, "& .style_grey": { fill: ($) => $.palette.text.icon ?? $.palette.action.active } }, children: typeof r == "function" ? r() : r }), [S, r, u]), N = Z(($) => {
|
|
262
262
|
f?.(e, !1);
|
|
263
|
-
}, [f, e]), [
|
|
264
|
-
const { closeFloat: te, closeFloatAll: de } =
|
|
263
|
+
}, [f, e]), [j, F] = V(!1), L = _(($) => {
|
|
264
|
+
const { closeFloat: te, closeFloatAll: de } = $;
|
|
265
265
|
return o(Os, { ...b, selectedColor: t, previewColor: y, onDone: p ? de : te, onKeyDown: (se) => {
|
|
266
266
|
se.which === he.Enter && (p ? de() : te());
|
|
267
267
|
}, onPreviewColorImmediate: M, onPreviewColor: T, onSelectColor: R, onEyeDropStart: () => F(!0), onEyeDropStop: () => F(!1), compareRGB: s, darkMode: u });
|
|
268
|
-
}, [t, y, p, S, b?.autoColor, u]), P = { onQuickClick: e ? N : void 0, createPopupPanel:
|
|
268
|
+
}, [t, y, p, S, b?.autoColor, u]), P = { onQuickClick: e ? N : void 0, createPopupPanel: L, propsPopup: { propsPopper: { resizeOnOverflow: !1 } }, onPopupOpen: E, onPopupClose: k, tooltip: l || c || "Color", label: c, icon: D, ...x };
|
|
269
269
|
return g === rt.Toolbar ? o(Dt, { ref: a, ...P }) : o(Un, { ref: a, ...P });
|
|
270
270
|
})), Yo = 82, Sr = (n) => {
|
|
271
271
|
const { styleColor: a, length: t = Yo, width: e = 1, dashArray: r = null, sx: l, isDouble: c = !1, isAngled: h = !1, darkMode: i = !1, ...d } = n;
|
|
@@ -285,36 +285,36 @@ const vs = U(X((n, a) => {
|
|
|
285
285
|
}, selected: M.style === h, parentFloat: v, children: D }, T));
|
|
286
286
|
}
|
|
287
287
|
return o(O, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, children: k });
|
|
288
|
-
}, [r, d, c, h, g]), x =
|
|
288
|
+
}, [r, d, c, h, g]), x = z(() => {
|
|
289
289
|
const f = ve.BuiltInDefinitions.get(h);
|
|
290
290
|
let y;
|
|
291
291
|
return y = f.description === "None" ? o(O, { sx: { minWidth: `${Yo}px` }, children: "None" }) : o(Sr, { styleColor: c, length: Yo, width: f.width, dashArray: f.pattern, darkMode: g, isDouble: f.description.toLowerCase().includes("double"), isAngled: f.description.toLowerCase().includes("slant") }), o(O, { className: "border-stroke", sx: { paddingLeft: "12px", marginLeft: "4px", marginRight: "4px", height: "24px", display: "flex", alignItems: "center", "& svg path.activeColor": { filter: br() } }, children: y });
|
|
292
|
-
}, [h, c]), w =
|
|
292
|
+
}, [h, c]), w = z(() => ve.BuiltInDefinitions.get(h), [h]), m = { disabled: r, icon: x, tooltip: "Border Style: " + w.description, sx: { background: `linear-gradient(${Se("#fff", Be(5))}, ${Se("#fff", Be(5))})`, ...b }, createPopupPanel: u, ...p };
|
|
293
293
|
return t === rt.Toolbar ? o(Dt, { ...m }) : o(Un, { ...m });
|
|
294
294
|
})), Is = U(X((n, a) => {
|
|
295
295
|
const { autoColor: t = null, schemeLookup: e, autoStrokeStyle: r = ve.StrokeStyle.Thin, disabled: l = !1, darkMode: c = !1, showStylingBefore: h = !0, onSelectBorder: i, onPreviewBorder: d, selectedBorder: g, createTemporaryBorder: b, ...p } = n, s = Z(i, [i]), u = Z(d, [d]), [x, w] = V(), [m, f] = V(), y = x ?? r, v = m ?? t, S = g || { bottom: { style: r, color: t?.toString() } }, C = Z((D) => {
|
|
296
|
-
const N = {},
|
|
296
|
+
const N = {}, j = D ? Object.keys(D) : [];
|
|
297
297
|
let F = !1;
|
|
298
|
-
const
|
|
299
|
-
for (let ie = 0; ie <
|
|
300
|
-
const oe =
|
|
298
|
+
const L = j.length;
|
|
299
|
+
for (let ie = 0; ie < L; ie++) {
|
|
300
|
+
const oe = j[ie];
|
|
301
301
|
D[oe]?.style && (N[oe] = { style: D[oe].style, color: D[oe].color }, F || N[oe].style === ve.StrokeStyle.None || (F = !0));
|
|
302
302
|
}
|
|
303
|
-
|
|
304
|
-
const P = F ? N.left : null,
|
|
303
|
+
j.length < 6 && (F = !0);
|
|
304
|
+
const P = F ? N.left : null, $ = F ? N.top : null, te = F ? N.right : null, de = F ? N.bottom : null, se = F ? N.vertical : null, A = F ? N.horizontal : null;
|
|
305
305
|
let H = "";
|
|
306
|
-
return
|
|
307
|
-
if (!b ||
|
|
306
|
+
return $ || P || (H += "M 3,5 H 5 V 3 H 3 "), $ || (H += "M 7,5 H 9 V 3 H 7 "), $ || se || (H += "M 11,5 h 2 V 3 h -2 "), $ || (H += "M 15,5 h 2 V 3 h -2 "), $ || te || (H += "M 19,5 h 2 V 3 h -2 "), P || (H += "M 3,9 H 5 V 7 H 3 "), se || (H += "M 11,9 h 2 V 7 h -2 "), te || (H += "M 19,9 h 2 V 7 h -2 "), A || P || (H += "M 3,13 H 5 V 11 H 3 "), A || (H += "M 7,13 H 9 V 11 H 7 "), A || se || (H += "M 11,13 h 2 v -2 h -2 "), A || te || (H += "M 19,13 h 2 v -2 h -2 "), A || (H += "M 15,13 h 2 v -2 h -2 "), P || (H += "M 3,17 H 5 V 15 H 3 "), se || (H += "M 11,17 h 2 v -2 h -2 "), te || (H += "M 19,17 h 2 v -2 h -2 "), de || P || (H += "M 3,21 H 5 V 19 H 3 "), de || (H += "M 7,21 H 9 V 19 H 7 "), de || se || (H += "M 11,21 h 2 v -2 h -2 "), de || (H += "M 15,21 h 2 v -2 h -2 "), de || te || (H += "M 19,21 h 2 v -2 h -2 "), I(ye, { children: [" ", I(O, { className: "border-icon", sx: { width: "var(--icon-size, var(--icon-size-md))", height: "var(--icon-size, var(--icon-size-md))", position: "relative", "& .grid > path": { opacity: "0.8" } }, children: [o("svg", { viewBox: "0 0 24 24", className: "grid", style: { top: "0px", left: "0px", width: "calc(var(--icon-size, var(--icon-size-md)) + 1px)", height: "calc(var(--icon-size, var(--icon-size-md)) + 1px)", position: "absolute" }, children: o("path", { className: "fill", d: H }) }), o(O, { className: "border-container", sx: { position: "absolute", display: "flex", justifyContent: "stretch", alignItems: "stretch", top: "0px", left: "0px", width: "var(--icon-size, var(--icon-size-md))", height: "var(--icon-size, var(--icon-size-md))", padding: "1px 1px", "& svg path": { filter: Zl } }, children: o(jn, { getBorderAt: (ie, oe) => {
|
|
307
|
+
if (!b || j.length === 0) return null;
|
|
308
308
|
const Y = ie.rowIndex, K = ie.colIndex, pe = {};
|
|
309
309
|
return Y === 0 ? (pe.top = N.top, pe.bottom = N.horizontal) : (pe.top = N.horizontal, pe.bottom = N.bottom), K === 0 ? (pe.left = N.left, pe.right = N.vertical) : (pe.left = N.vertical, pe.right = N.right), b?.(pe);
|
|
310
310
|
}, darkMode: c, style: { top: "2px", left: "2px", width: "calc(100% - 5px)", height: "calc(100% - 5px)", position: "absolute" } }) })] })] });
|
|
311
|
-
}, [v, y, c]), k = _((D, N,
|
|
311
|
+
}, [v, y, c]), k = _((D, N, j) => {
|
|
312
312
|
let F = null;
|
|
313
313
|
if (D && D.length > 0) {
|
|
314
|
-
let
|
|
315
|
-
(N ||
|
|
314
|
+
let L = null;
|
|
315
|
+
(N || j) && (L = { style: j, color: N?.toString() ?? null }), F = {};
|
|
316
316
|
const P = D.length;
|
|
317
|
-
for (let
|
|
317
|
+
for (let $ = 0; $ < P; $++) F[D[$]] = L;
|
|
318
318
|
}
|
|
319
319
|
return F;
|
|
320
320
|
}, []), E = _((D) => {
|
|
@@ -322,18 +322,18 @@ const vs = U(X((n, a) => {
|
|
|
322
322
|
}, []), T = _((D) => {
|
|
323
323
|
u?.(D);
|
|
324
324
|
}, []), M = _((D) => {
|
|
325
|
-
const { closeFloatAll: N, floatReference:
|
|
326
|
-
const A = k(
|
|
325
|
+
const { closeFloatAll: N, floatReference: j } = D, F = ($, te, de = "bottom", se = !1) => {
|
|
326
|
+
const A = k($, v ?? null, se ? ve.StrokeStyle.None : y ?? null), H = se ? k([], v ?? null, y ?? null) : A;
|
|
327
327
|
return o(bt, { icon: C(H), sx: { background: `linear-gradient(${Se("#fff", Be(5))}, ${Se("#fff", Be(5))})` }, propsTooltip: { label: te, simple: !0, placement: de }, onClick: () => {
|
|
328
328
|
N(), T(A), E(A);
|
|
329
329
|
} });
|
|
330
|
-
},
|
|
331
|
-
f(
|
|
332
|
-
}, onSelectColor: (
|
|
333
|
-
f(
|
|
334
|
-
}, darkMode: c, tooltip: "Border Color", propsPanel: { disableAlpha: !0, autoColor: t, schemeLookup: e }, disabled: l || y === ve.StrokeStyle.None, parentFloat:
|
|
335
|
-
return I(O, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, onClick: (
|
|
336
|
-
}, [y, v, t, e, c]), R =
|
|
330
|
+
}, L = I(ae, { children: [I(O, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [F([ve.Edge.Left, ve.Edge.Top, ve.Edge.Right, ve.Edge.Bottom, ve.Edge.Horizontal, ve.Edge.Vertical], "All Borders", "top"), F([ve.Edge.Horizontal, ve.Edge.Vertical], "Inner Borders", "top"), F([ve.Edge.Horizontal], "Inside Horizontal Borders", "top"), F([ve.Edge.Vertical], "Inside Vertical Borders", "top"), F([ve.Edge.Left, ve.Edge.Top, ve.Edge.Right, ve.Edge.Bottom], "Outside Borders", "top")] }), I(O, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [F([ve.Edge.Left], "Left Borders"), F([ve.Edge.Top], "Top Borders"), F([ve.Edge.Right], "Right Borders"), F([ve.Edge.Bottom], "Bottom Borders"), F([ve.Edge.Left, ve.Edge.Top, ve.Edge.Right, ve.Edge.Bottom, ve.Edge.Horizontal, ve.Edge.Vertical, ve.Edge.DiagonalUp, ve.Edge.DiagonalDown], "No Borders", "bottom", !0)] })] }), P = o(ae, { children: I(O, { sx: { display: "flex", padding: "6px 16px", flexDirection: "row", gap: "6px" }, children: [o(Ma, { variant: rt.Toolbar, icon: o(ye, { iconKey: "stroke.colored" }), selectedColor: y === ve.StrokeStyle.None ? new ft("transparent") : v, onPreviewColor: ($) => {
|
|
331
|
+
f($);
|
|
332
|
+
}, onSelectColor: ($, te) => {
|
|
333
|
+
f($);
|
|
334
|
+
}, darkMode: c, tooltip: "Border Color", propsPanel: { disableAlpha: !0, autoColor: t, schemeLookup: e }, disabled: l || y === ve.StrokeStyle.None, parentFloat: j, shouldCloseFloatAll: !1 }), o(As, { selectedStyle: y, onSelectStyle: w, styleColor: v, darkMode: c, variant: rt.Toolbar, parentFloat: j })] }) });
|
|
335
|
+
return I(O, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, onClick: ($) => $.stopPropagation(), children: [h ? P : L, o(Q, { orientation: "horizontal" }), h ? L : P] });
|
|
336
|
+
}, [y, v, t, e, c]), R = z(() => C(S), [S, c]);
|
|
337
337
|
return o(Dt, { ref: a, createPopupPanel: M, propsPopup: { propsPopper: { resizeOnOverflow: !1 } }, createTooltip: ({ children: D }, N) => o(at, { label: "Borders", description: "Set the borders.", disabled: N, children: D }), onQuickClick: () => {
|
|
338
338
|
s?.(S);
|
|
339
339
|
}, disabled: l, icon: R, ...p });
|
|
@@ -341,9 +341,9 @@ const vs = U(X((n, a) => {
|
|
|
341
341
|
const { commands: t, command: e, commandHook: r, variant: l = re.Toolbar, disabled: c = !1, autoColor: h, autoStrokeStyle: i, schemeLookup: d, createTemporaryBorder: g, selectedBorder: b, onSelectBorder: p, darkMode: s, icon: u, label: x, ...w } = n, m = Ae(t, ["formatBorder"]), f = e ?? m[0], y = f?.getContext() ?? null, v = y?.autoColor ?? h, S = y?.autoStyle ?? i, C = b ?? y?.quickBorder, k = s ?? y?.darkMode, E = g ?? y?.createTemporaryBorder, T = d ?? y?.schemeLookup, M = Z((D) => {
|
|
342
342
|
y?.onBorderSelect && y.onBorderSelect(D), p?.(D), f?.execute(D, r);
|
|
343
343
|
}, [f, p, r]), R = _((D, N) => {
|
|
344
|
-
const { children:
|
|
344
|
+
const { children: j, title: F, ...L } = D;
|
|
345
345
|
let P = D.children;
|
|
346
|
-
return (f?.disabled() || c) && (P = o("div", { children: P })), o(Kn, { command: f, placement: l === re.Toolbar ? "bottom-start" : "right-start", disabled: N, ...
|
|
346
|
+
return (f?.disabled() || c) && (P = o("div", { children: P })), o(Kn, { command: f, placement: l === re.Toolbar ? "bottom-start" : "right-start", disabled: N, ...L, children: P });
|
|
347
347
|
}, [f, c]);
|
|
348
348
|
return o(Is, { ref: a, autoColor: v, darkMode: k, autoStrokeStyle: S, createTemporaryBorder: E, schemeLookup: T, selectedBorder: C, onSelectBorder: M, createTooltip: R, disabled: c || !f || f.disabled(), ...w });
|
|
349
349
|
})), zs = U(X((n, a) => {
|
|
@@ -368,11 +368,11 @@ const vs = U(X((n, a) => {
|
|
|
368
368
|
le(() => {
|
|
369
369
|
x(s());
|
|
370
370
|
}, [t?.getState()]);
|
|
371
|
-
const m =
|
|
371
|
+
const m = z(() => {
|
|
372
372
|
if (!e) return null;
|
|
373
373
|
const E = { ...e };
|
|
374
374
|
return delete E.beforeExecute, E;
|
|
375
|
-
}, [e]), f = Ae(l, ["formatFontSizeIncrease", "formatFontSizeDecrease"]), y =
|
|
375
|
+
}, [e]), f = Ae(l, ["formatFontSizeIncrease", "formatFontSizeDecrease"]), y = z(() => f ? I(O, { className: Re("quick-buttons", {}), sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (E) => E.stopPropagation(), children: [o(B, { command: f[0], commandHook: m }), o(B, { command: f[1], commandHook: m })] }) : null, [f]), v = et(), S = z(() => `${_t.getSharedMeasurer()("12.3", Math.round(v.typography.fontSize), v.typography.fontFamily).width}px`, [v]), C = _((E) => {
|
|
376
376
|
const { onMouseDown: T, onMouseUp: M, ...R } = E;
|
|
377
377
|
return o(ct, { component: "div", ...R, disableRipple: !0, children: o(Vn, { inputMode: "numeric", disabled: h || !t || t.disabled(), inputProps: { name: "font-input", autoComplete: "off", tabIndex: 0, type: "number", maxLength: 4, max: 409, min: 2 }, sx: { "&::before": { borderBottom: "1px solid transparent" }, "&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before": { borderBottom: (D) => `1px solid ${D.palette.text.icon ?? D.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (D) => `1px solid ${D.palette.error.main}` }, "::after": { borderBottom: (D) => `1px solid ${D.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", paddingLeft: "0px", paddingRight: "0px", fontSize: (D) => `${Math.round(D.typography.fontSize)}px`, width: S, color: (D) => D.palette.text.secondary, input: { padding: "0 0", textAlign: "center", height: "1rem", MozAppearance: "textfield", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (D) => D.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (D) => D.palette.text.primary } }, "input::-webkit-inner-spin-button": { WebkitAppearance: "none", margin: "0" } }, value: u, onFocus: (D) => {
|
|
378
378
|
D.target?.select();
|
|
@@ -396,8 +396,8 @@ const vs = U(X((n, a) => {
|
|
|
396
396
|
t?.execute(N, e);
|
|
397
397
|
}, M = t?.getState(), R = [];
|
|
398
398
|
for (let N = 0; N < c.length; N++) {
|
|
399
|
-
const
|
|
400
|
-
R.push(o(dt, { selected:
|
|
399
|
+
const j = c[N] === M;
|
|
400
|
+
R.push(o(dt, { selected: j, icon: j ? o(on, {}) : void 0, disabled: h || !t || t.disabled(), onMouseDown: (F) => {
|
|
401
401
|
F.button === 0 && F.preventDefault();
|
|
402
402
|
}, onMouseUp: (F) => {
|
|
403
403
|
F.button === 0 && T(c[N]);
|
|
@@ -417,9 +417,9 @@ const vs = U(X((n, a) => {
|
|
|
417
417
|
i.button === 0 && r(l.numberFormat);
|
|
418
418
|
}, onKeyDown: (i) => {
|
|
419
419
|
i.keyCode !== he.Enter && i.keyCode !== he.Space || r(l.numberFormat);
|
|
420
|
-
}, ...h, children: I(O, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [I(Fe, { component: "div", children: [l.formatType, l.formatType === ht.Type.Custom ? "…" : ""] }), o(Fe, { variant: "caption", component: "div", sx: { color: (i) =>
|
|
420
|
+
}, ...h, children: I(O, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [I(Fe, { component: "div", children: [l.formatType, l.formatType === ht.Type.Custom ? "…" : ""] }), o(Fe, { variant: "caption", component: "div", sx: { color: (i) => Ze(i.palette.text.primary, 0.6), paddingTop: e && e.length > 0 ? "1px" : void 0, overflow: "hidden", textOverflow: "ellipsis" }, children: e && e.length > 0 ? e : " " })] }) });
|
|
421
421
|
}), $s = U(X((n, a) => {
|
|
422
|
-
const { commands: t, commandHook: e, scope: r, sx: l, disabled: c = !1, parentFloat: h, ...i } = n, d = Ae(t, ["formatNumberFormat"])[0], g = d?.getState() ? ht.Styles.lookupStyle(d?.getState()).formatType : ht.Type.General, b =
|
|
422
|
+
const { commands: t, commandHook: e, scope: r, sx: l, disabled: c = !1, parentFloat: h, ...i } = n, d = Ae(t, ["formatNumberFormat"])[0], g = d?.getState() ? ht.Styles.lookupStyle(d?.getState()).formatType : ht.Type.General, b = z(() => {
|
|
423
423
|
if (!e) return null;
|
|
424
424
|
const x = { ...e };
|
|
425
425
|
return delete x.beforeExecute, x;
|
|
@@ -442,7 +442,7 @@ const vs = U(X((n, a) => {
|
|
|
442
442
|
e?.beforeExecute?.(d, d?.getState()), w.getCommand("formatNumberDialog")?.execute(d?.getState()), e?.onExecute?.(d, d?.getState());
|
|
443
443
|
}, format: S, sx: { flex: "0", width: "100%" } }, ht.Type.Custom), E = I(O, { className: "quick-buttons", sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (M) => M.stopPropagation(), children: [o(B, { command: w.getCommand("formatNumberFormatAccountingStyle"), commandHook: b, scope: r }), o(B, { command: w.getCommand("formatNumberFormatPercentStyle"), commandHook: b, scope: r }), o(B, { command: w.getCommand("formatNumberFormatCommaStyle"), commandHook: b, scope: r }), o(B, { command: w.getCommand("formatNumberFormatIncreaseDecimal"), commandHook: b, scope: r }), o(B, { command: w.getCommand("formatNumberFormatDecreaseDecimal"), commandHook: b, scope: r })] }), T = I(O, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...i, children: [E, o(Q, { orientation: "horizontal" }), o(O, { sx: { overflow: "auto", flex: "1 1 100%" }, children: v }), o(Q, { orientation: "horizontal" }), k] });
|
|
444
444
|
return ke({ ...x, children: T });
|
|
445
|
-
}, [d?.getContext(), d?.getState(), e, r]), s =
|
|
445
|
+
}, [d?.getContext(), d?.getState(), e, r]), s = et(), u = z(() => {
|
|
446
446
|
const x = ht.Type.MediumTime;
|
|
447
447
|
return `${_t.getSharedMeasurer()(x, Math.round(s.typography.fontSize), s.typography.fontFamily).width}px`;
|
|
448
448
|
}, [s]);
|
|
@@ -450,7 +450,7 @@ const vs = U(X((n, a) => {
|
|
|
450
450
|
})), Na = U(X((n, a) => o(qe, { ref: a, ...n, popupCommandKeys: ["clearAll", "clearFormats", "clearContents", "clearComments", "clearHyperlinks"], scope: "clear", label: "Clear", tooltip: "Clear everything in the cell, or remove just the formatting or contents.", icon: "ClearAll" }))), Vs = U(X((n, a) => o(qe, { ref: a, ...n, popupCommandKeys: ["fillDown", "fillRight", "fillUp", "fillLeft"], scope: "fill", label: "Fill", tooltip: "Fill the selected cells with the value from one of the corners.", icon: "FillDown" }))), Pa = U(X((n, a) => {
|
|
451
451
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, disableSheet: c = !1, preferSingleMenu: h = !0, showQuickButton: i = !0, variant: d = re.Toolbar, ...g } = n, b = ["insertCellsShiftDown", "insertCellsShiftRight", "insertRows", "insertColumns", "addSheet"];
|
|
452
452
|
c || b.push("addSheet");
|
|
453
|
-
const p = Ae(t, b), { singleCommand: s, allDisabled: u } =
|
|
453
|
+
const p = Ae(t, b), { singleCommand: s, allDisabled: u } = z(() => {
|
|
454
454
|
let w = null, m = 0;
|
|
455
455
|
const f = p.length;
|
|
456
456
|
for (let y = 0; y < f; y++) {
|
|
@@ -469,7 +469,7 @@ const vs = U(X((n, a) => {
|
|
|
469
469
|
})), Fa = U(X((n, a) => {
|
|
470
470
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, disableSheet: c = !1, preferSingleMenu: h = !0, showQuickButton: i = !0, variant: d = re.Toolbar, ...g } = n, b = ["deleteCellsShiftUp", "deleteCellsShiftLeft", "deleteRows", "deleteColumns"];
|
|
471
471
|
c || b.push("deleteSheet");
|
|
472
|
-
const p = Ae(t, b), { singleCommand: s, allDisabled: u } =
|
|
472
|
+
const p = Ae(t, b), { singleCommand: s, allDisabled: u } = z(() => {
|
|
473
473
|
let w = null, m = 0;
|
|
474
474
|
const f = p.length;
|
|
475
475
|
for (let y = 0; y < f; y++) {
|
|
@@ -486,7 +486,7 @@ const vs = U(X((n, a) => {
|
|
|
486
486
|
}, [l, e, r]);
|
|
487
487
|
return s ? o(B, { ref: a, variant: d, commandHook: e, disabled: l, command: s, ...g }) : o(Oe, { ref: a, variant: d, quickCommand: "deleteCells", commands: t, commandHook: e, scope: r, disabled: l || u, tooltip: I(ae, { children: [o("span", { children: "Delete cells, rows, columns or sheets from your workbook." }), o("br", {}), o("span", { children: "To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete." })] }), createPopupPanel: x, ...g });
|
|
488
488
|
})), Oa = U(X((n, a) => {
|
|
489
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["resizeRows", "autoFitRows", "resizeColumns", "autoFitColumns", "hideColumns", "hideRows", "unhideColumns", "unhideRows"]), { allDisabled: i } =
|
|
489
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["resizeRows", "autoFitRows", "resizeColumns", "autoFitColumns", "hideColumns", "hideRows", "unhideColumns", "unhideRows"]), { allDisabled: i } = z(() => {
|
|
490
490
|
let g = 0;
|
|
491
491
|
const b = h.length;
|
|
492
492
|
for (let p = 0; p < b; p++) {
|
|
@@ -541,8 +541,8 @@ const Lo = (n) => n === null ? "" : n.toString(), La = U(X((n, a) => {
|
|
|
541
541
|
let N = "";
|
|
542
542
|
try {
|
|
543
543
|
v(D);
|
|
544
|
-
const
|
|
545
|
-
F.toString() !==
|
|
544
|
+
const j = Lo(d), F = b(D);
|
|
545
|
+
F.toString() !== j && g?.(F);
|
|
546
546
|
} catch {
|
|
547
547
|
N = "Invalid Range";
|
|
548
548
|
}
|
|
@@ -557,7 +557,7 @@ const Lo = (n) => n === null ? "" : n.toString(), La = U(X((n, a) => {
|
|
|
557
557
|
u?.onBlur(D);
|
|
558
558
|
}, [u]), E = _((D) => {
|
|
559
559
|
S(D.target.value), u?.onChange(D);
|
|
560
|
-
}, [u]), [T, M] = V(!1), R =
|
|
560
|
+
}, [u]), [T, M] = V(!1), R = z(() => o(jl, { tabIndex: -1, sx: { display: "flex", position: "relative", flex: "0" }, position: "end", children: o(Ql, { disabled: !0, selected: T, onSelectToggle: (D) => {
|
|
561
561
|
M(D);
|
|
562
562
|
}, label: "Select Range", icon: o(ye, { iconKey: "SelectRangeMode" }) }) }), [T]);
|
|
563
563
|
return o(_n, { sx: { paddingTop: (D) => D.spacing(1.5), minWidth: 135, width: "100%", ...h }, size: "small", ref: a, className: Re("range-input", c), ...p, children: o(Sa, { label: "Range", placeholder: "Enter Range", onBlur: k, disabled: r, error: !!x, inputRef: u?.ref, helperText: x || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (D) => D.spacing(0.5) } }, slotProps: { input: { endAdornment: R }, inputLabel: { shrink: !0 }, htmlInput: { spellCheck: !1, autoComplete: "off", readOnly: r, name: t, sx: { paddingTop: (D) => D.spacing(1.25), paddingBottom: (D) => D.spacing(0.75) } } }, value: y ?? "", onChange: E, onKeyDownCapture: C, onContextMenu: (D) => {
|
|
@@ -565,13 +565,13 @@ const Lo = (n) => n === null ? "" : n.toString(), La = U(X((n, a) => {
|
|
|
565
565
|
} }) });
|
|
566
566
|
}));
|
|
567
567
|
La.displayName = "RangeInput";
|
|
568
|
-
const
|
|
569
|
-
|
|
568
|
+
const tt = [];
|
|
569
|
+
tt.push(nt("Primary Background", "bg1")), tt.push(nt("Primary Text", "tx1")), tt.push(nt("Secondary Background", "bg2")), tt.push(nt("Secondary Text", "tx2")), tt.push(nt("Accent 1", "accent1")), tt.push(nt("Accent 2", "accent2")), tt.push(nt("Accent 3", "accent3")), tt.push(nt("Accent 4", "accent4")), tt.push(nt("Accent 5", "accent5")), tt.push(nt("Accent 6", "accent6"));
|
|
570
570
|
const _s = (n) => {
|
|
571
|
-
const { docTheme: a, onSelectTheme: t, darkMode: e, isSelected: r, outlined: l, sx: c, ...h } = n, i =
|
|
571
|
+
const { docTheme: a, onSelectTheme: t, darkMode: e, isSelected: r, outlined: l, sx: c, ...h } = n, i = et(), d = z(() => {
|
|
572
572
|
let g = [];
|
|
573
|
-
for (let b = 0; b <
|
|
574
|
-
const p =
|
|
573
|
+
for (let b = 0; b < tt.length; b++) {
|
|
574
|
+
const p = tt[b];
|
|
575
575
|
g.push(o(Yn, { schemeColorLookup: a.schemeLookup(), colorDef: p, darkMode: e, selectedColor: null }, b + "-colorDef"));
|
|
576
576
|
}
|
|
577
577
|
return o(O, { sx: { display: "flex", flexDirection: "row", flex: "none" }, children: o(O, { sx: { display: "flex", boxShadow: (b) => b.shadows[2] }, children: g }) });
|
|
@@ -579,7 +579,7 @@ const _s = (n) => {
|
|
|
579
579
|
return o(bt, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (g) => `solid ${r ? g.palette.text.primary : "transparent"} 1px`, "&:hover:not([disabled])": { border: (g) => `solid ${g.palette.text.primary} 1px !important` } }, icon: null, ...h, children: I(O, { sx: { border: (g) => `solid ${g.palette.divider} 1px`, minWidth: "200px", borderRadius: "2px", padding: "4px 4px", textAlign: "left", display: "flex", gap: "4px", flexDirection: "column", alignItems: "stretch", color: (g) => r ? g.palette.text.primary : void 0, "&:hover:not([disabled])": { color: (g) => g.palette.text.primary } }, children: [o(O, { sx: {}, children: a.getName() }), I(O, { sx: { paddingTop: "6px", paddingLeft: "12px", paddingRight: "12px", display: "flex", flexDirection: "column", alignItems: "stretch" }, children: [d, o(O, { sx: { flex: "1 1 100%", textOverflow: "ellipsis", overflow: "hidden", marginTop: "2px", whiteSpace: "pre", fontFamily: () => a.getFontScheme().getMajorFont() }, children: o(Et, { disableInteractive: !0, slotProps: { popper: { style: { pointerEvents: "none" }, disablePortal: !0, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: !0, options: { boundariesElement: "viewport" } }] } } }, title: o("div", { style: { textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "pre" }, children: `The font used for the body.
|
|
580
580
|
The heading font is '${a.getFontScheme().getMajorFont()}'.` }), placement: "bottom-start", children: o("div", { children: a.getFontScheme().getMinorFont() }) }) })] })] }) });
|
|
581
581
|
}, Us = U(X((n, a) => {
|
|
582
|
-
const { themes: t, selectedTheme: e, onSelectTheme: r, sx: l, disabled: c = !1, darkMode: h, ...i } = n, d =
|
|
582
|
+
const { themes: t, selectedTheme: e, onSelectTheme: r, sx: l, disabled: c = !1, darkMode: h, ...i } = n, d = z(() => {
|
|
583
583
|
const g = t?.getItems({ selected: e }) ?? [], b = [];
|
|
584
584
|
if (g.length === 0) return o(ro, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "6px", paddingBottom: "6px" }, children: "No themes" });
|
|
585
585
|
const p = g.length;
|
|
@@ -649,7 +649,7 @@ const za = U(X((n, a) => {
|
|
|
649
649
|
});
|
|
650
650
|
}, []), y = wr(() => {
|
|
651
651
|
p(s(vt.findNextStep(t.getView().getZoomScale(), !1, 10)));
|
|
652
|
-
}), v = wr(() => p(s(vt.findNextStep(t.getView().getZoomScale(), !0, 10)))), S =
|
|
652
|
+
}), v = wr(() => p(s(vt.findNextStep(t.getView().getZoomScale(), !0, 10)))), S = et(), C = z(() => `${_t.getSharedMeasurer()("100%", Math.round(S.typography.fontSize), S.typography.fontFamily).width}px`, [S]);
|
|
653
653
|
return I(O, { ref: a, className: Re(e), sx: { padding: "0px 0px", display: "flex", alignItems: "center", color: (k) => k.palette.text.secondary, ...l }, onFocus: (k) => {
|
|
654
654
|
k.relatedTarget && !x && w(k.relatedTarget);
|
|
655
655
|
}, onBlur: (k) => {
|
|
@@ -681,7 +681,7 @@ const Ha = U(X((n, a) => {
|
|
|
681
681
|
i.current?.removeEventListener("wheel", s);
|
|
682
682
|
};
|
|
683
683
|
}, []);
|
|
684
|
-
const d = ln(), g =
|
|
684
|
+
const d = ln(), g = z(() => {
|
|
685
685
|
const s = d.getMode();
|
|
686
686
|
return s?.description ? s.description : "Ready";
|
|
687
687
|
}, [d]), [b, p] = V(!1);
|
|
@@ -1126,8 +1126,8 @@ function Ys() {
|
|
|
1126
1126
|
render() {
|
|
1127
1127
|
const { axis: x, bounds: w, children: m, defaultPosition: f, defaultClassName: y, defaultClassNameDragging: v, defaultClassNameDragged: S, position: C, positionOffset: k, scale: E, ...T } = this.props;
|
|
1128
1128
|
let M = {}, R = null;
|
|
1129
|
-
const D = !C || this.state.dragging, N = C || f,
|
|
1130
|
-
this.state.isElementSVG ? R = (0, l.createSVGTransform)(
|
|
1129
|
+
const D = !C || this.state.dragging, N = C || f, j = { x: (0, c.canDragX)(this) && D ? this.state.x : N.x, y: (0, c.canDragY)(this) && D ? this.state.y : N.y };
|
|
1130
|
+
this.state.isElementSVG ? R = (0, l.createSVGTransform)(j, k) : M = (0, l.createCSSTransform)(j, k);
|
|
1131
1131
|
const F = (0, r.clsx)(m.props.className || "", y, { [v]: this.state.dragging, [S]: this.state.dragged });
|
|
1132
1132
|
return a.createElement(i.default, b({}, T, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }), a.cloneElement(a.Children.only(m), { className: F, style: { ...m.props.style, ...M }, transform: R }));
|
|
1133
1133
|
}
|
|
@@ -1294,8 +1294,8 @@ function _a() {
|
|
|
1294
1294
|
var k = this.props.width / this.props.height, E = m - this.props.width, T = f - this.props.height;
|
|
1295
1295
|
Math.abs(E) > Math.abs(T * k) ? f = m / k : m = f * k;
|
|
1296
1296
|
}
|
|
1297
|
-
var M = m, R = f, D = this.slack || [0, 0], N = D[0],
|
|
1298
|
-
return m += N, f +=
|
|
1297
|
+
var M = m, R = f, D = this.slack || [0, 0], N = D[0], j = D[1];
|
|
1298
|
+
return m += N, f += j, v && (m = Math.max(v[0], m), f = Math.max(v[1], f)), S && (m = Math.min(S[0], m), f = Math.min(S[1], f)), this.slack = [N + (M - m), j + (R - f)], [m, f];
|
|
1299
1299
|
}, w.resizeHandler = function(m, f) {
|
|
1300
1300
|
var y = this;
|
|
1301
1301
|
return function(v, S) {
|
|
@@ -1305,10 +1305,10 @@ function _a() {
|
|
|
1305
1305
|
if (T || M) {
|
|
1306
1306
|
var R = f[0], D = f[f.length - 1], N = C.getBoundingClientRect();
|
|
1307
1307
|
y.lastHandleRect != null && (D === "w" && (k += N.left - y.lastHandleRect.left), R === "n" && (E += N.top - y.lastHandleRect.top)), y.lastHandleRect = N, D === "w" && (k = -k), R === "n" && (E = -E);
|
|
1308
|
-
var
|
|
1309
|
-
|
|
1310
|
-
var P =
|
|
1311
|
-
|
|
1308
|
+
var j = y.props.width + (T ? k / y.props.transformScale : 0), F = y.props.height + (M ? E / y.props.transformScale : 0), L = y.runConstraints(j, F);
|
|
1309
|
+
j = L[0], F = L[1];
|
|
1310
|
+
var P = j !== y.props.width || F !== y.props.height, $ = typeof y.props[m] == "function" ? y.props[m] : null;
|
|
1311
|
+
$ && !(m === "onResize" && !P) && (v.persist == null || v.persist(), $(v, { node: C, size: { width: j, height: F }, handle: f })), m === "onResizeStop" && y.resetData();
|
|
1312
1312
|
}
|
|
1313
1313
|
};
|
|
1314
1314
|
}, w.renderResizeHandle = function(m, f) {
|
|
@@ -1430,13 +1430,13 @@ function Qs() {
|
|
|
1430
1430
|
m.onResize;
|
|
1431
1431
|
var v = m.onResizeStart, S = m.onResizeStop, C = m.draggableOpts, k = m.minConstraints, E = m.maxConstraints, T = m.lockAspectRatio, M = m.axis;
|
|
1432
1432
|
m.width, m.height;
|
|
1433
|
-
var R = m.resizeHandles, D = m.style, N = m.transformScale,
|
|
1433
|
+
var R = m.resizeHandles, D = m.style, N = m.transformScale, j = (function(F, L) {
|
|
1434
1434
|
if (F == null) return {};
|
|
1435
|
-
var P,
|
|
1436
|
-
for (
|
|
1435
|
+
var P, $, te = {}, de = Object.keys(F);
|
|
1436
|
+
for ($ = 0; $ < de.length; $++) P = de[$], L.indexOf(P) >= 0 || (te[P] = F[P]);
|
|
1437
1437
|
return te;
|
|
1438
1438
|
})(m, r);
|
|
1439
|
-
return n.createElement(t.default, { axis: M, draggableOpts: C, handle: f, handleSize: y, height: this.state.height, lockAspectRatio: T, maxConstraints: E, minConstraints: k, onResizeStart: v, onResize: this.onResize, onResizeStop: S, resizeHandles: R, transformScale: N, width: this.state.width }, n.createElement("div", h({},
|
|
1439
|
+
return n.createElement(t.default, { axis: M, draggableOpts: C, handle: f, handleSize: y, height: this.state.height, lockAspectRatio: T, maxConstraints: E, minConstraints: k, onResizeStart: v, onResize: this.onResize, onResizeStop: S, resizeHandles: R, transformScale: N, width: this.state.width }, n.createElement("div", h({}, j, { style: d(d({}, D), {}, { width: this.state.width + "px", height: this.state.height + "px" }) })));
|
|
1440
1440
|
}, w;
|
|
1441
1441
|
})(n.Component);
|
|
1442
1442
|
return bo.default = p, p.propTypes = d(d({}, e.resizableProps), {}, { children: a.default.element }), bo;
|
|
@@ -1507,7 +1507,7 @@ const Ua = U(X((n, a) => {
|
|
|
1507
1507
|
}, onViewChange(A) {
|
|
1508
1508
|
N(A?.getSelectedSheet());
|
|
1509
1509
|
} });
|
|
1510
|
-
const [
|
|
1510
|
+
const [j, F] = V(null), L = Z(vt.debounce(T, j ? 320 : 0), []);
|
|
1511
1511
|
je(D.getSelection(), { onChange: () => {
|
|
1512
1512
|
x((A) => {
|
|
1513
1513
|
const H = r.getSelectedRanges().getCoords();
|
|
@@ -1516,14 +1516,14 @@ const Ua = U(X((n, a) => {
|
|
|
1516
1516
|
}, onAdjustingChange: (A) => {
|
|
1517
1517
|
F(A.getAdjusting());
|
|
1518
1518
|
} }), le(() => {
|
|
1519
|
-
if (
|
|
1519
|
+
if (j) {
|
|
1520
1520
|
const A = r.getSelectedRange(), H = A.getRowCount(), ie = A.getColumnCount();
|
|
1521
1521
|
let oe = `${H}R x ${ie}C`;
|
|
1522
1522
|
if (oe.length > 17 && (oe = `${H}x${ie}`), H > 1 || ie > 1) return void s({ text: oe, fontStyle: "italic", justifyContent: "center" });
|
|
1523
1523
|
}
|
|
1524
|
-
s({ text: r.getSelectedSheet().getSelectedRange().toString() }),
|
|
1525
|
-
}, [u, r,
|
|
1526
|
-
const P = xe(null),
|
|
1524
|
+
s({ text: r.getSelectedSheet().getSelectedRange().toString() }), L();
|
|
1525
|
+
}, [u, r, j]);
|
|
1526
|
+
const P = xe(null), $ = _((A) => {
|
|
1527
1527
|
const { onMouseDown: H, onMouseUp: ie, ...oe } = A;
|
|
1528
1528
|
return o(ct, { ...oe, sx: { ...oe?.sx, display: "flex", flex: "1 1 100%" }, disableRipple: !0, children: o(Vn, { inputMode: "text", inputProps: { tabIndex: 0, name: "input-named-range", maxLength: 255, className: "input", autoFocus: !1, spellCheck: !1, autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", enterKeyHint: "done", ref: P }, sx: { "&::before": { borderBottom: "1px solid transparent" }, "&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before": { borderBottom: (Y) => `1px solid ${Y.palette.text.icon ?? Y.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (Y) => `1px solid ${Y.palette.primary.main}` }, "::after": { borderBottom: (Y) => `1px solid ${Y.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", height: "1rem", fontSize: 11 * _t.getDeviceScale(), fontStyle: p?.fontStyle, paddingLeft: (Y) => Y.spacing(0.75), paddingRight: (Y) => Y.spacing(0.75), boxShadow: "none", flex: "1", color: (Y) => Y.palette.text.secondary, input: { padding: "0", height: "1rem", textAlign: "left", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (Y) => Y.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (Y) => Y.palette.text.primary } } }, value: C, onFocus: (Y) => {
|
|
1529
1529
|
Y.target?.select();
|
|
@@ -1567,7 +1567,7 @@ const Ua = U(X((n, a) => {
|
|
|
1567
1567
|
}, [r, M, e, p, y]), se = Rt(a, () => ({ focus(A) {
|
|
1568
1568
|
P.current?.focus(A);
|
|
1569
1569
|
} }), []);
|
|
1570
|
-
return o(O, { className: "outer", sx: { minWidth: 120, flex: "1 1 100%", display: "flex", alignItems: "center", justifyContent: "start", ...d }, ref: yt([se, a]), ...g, children: o(Dt, { className: "outer-button", sx: { display: "flex", flex: "1 1 100%", "& .tooltip-wrapper": { display: "flex", flex: "1 1 100%", width: "100%" }, ...d }, propsButton: { sx: { backgroundColor: (A) => A.palette.background.paper, backgroundImage: `linear-gradient(${Se("#fff", Be(5))}, ${Se("#fff", Be(5))})` } }, tabIndex: -1, outlined: { color: (A) => t ? A.palette.action.disabled : Se(A.palette.divider, 0.2) }, parentFloat: f, createPopupPanel: de, onPopupOpen: () => m(!0), onPopupClose: () => m(!1), createTooltip: ({ children: A }, H) => o(at, { title: H || w ? "" : "Name Box", disabled: H, leaveDelay: 0, sx: { opacity: H || w ? 0 : 1 }, children: A }), renderQuickButton:
|
|
1570
|
+
return o(O, { className: "outer", sx: { minWidth: 120, flex: "1 1 100%", display: "flex", alignItems: "center", justifyContent: "start", ...d }, ref: yt([se, a]), ...g, children: o(Dt, { className: "outer-button", sx: { display: "flex", flex: "1 1 100%", "& .tooltip-wrapper": { display: "flex", flex: "1 1 100%", width: "100%" }, ...d }, propsButton: { sx: { backgroundColor: (A) => A.palette.background.paper, backgroundImage: `linear-gradient(${Se("#fff", Be(5))}, ${Se("#fff", Be(5))})` } }, tabIndex: -1, outlined: { color: (A) => t ? A.palette.action.disabled : Se(A.palette.divider, 0.2) }, parentFloat: f, createPopupPanel: de, onPopupOpen: () => m(!0), onPopupClose: () => m(!1), createTooltip: ({ children: A }, H) => o(at, { title: H || w ? "" : "Name Box", disabled: H, leaveDelay: 0, sx: { opacity: H || w ? 0 : 1 }, children: A }), renderQuickButton: $ }) });
|
|
1571
1571
|
}));
|
|
1572
1572
|
Ua.displayName = "NamedCollectionEditor";
|
|
1573
1573
|
const ec = (n, a) => o(Ua, { ref: a, ...n }), Ka = U(X((n, a) => {
|
|
@@ -1579,7 +1579,7 @@ const ec = (n, a) => o(Ua, { ref: a, ...n }), Ka = U(X((n, a) => {
|
|
|
1579
1579
|
const pe = K?.getSelectedSheet();
|
|
1580
1580
|
x(pe.getSelectedCell().getCoords()), s(pe);
|
|
1581
1581
|
} });
|
|
1582
|
-
const y = xe(null), v =
|
|
1582
|
+
const y = xe(null), v = z(() => ({ fontSize: 11 }), []);
|
|
1583
1583
|
je(p.getSelection(), { onChange: () => {
|
|
1584
1584
|
const K = p.getSelectedCell();
|
|
1585
1585
|
m(!K.isEditAllowed()), x(K.getCoords());
|
|
@@ -1593,49 +1593,49 @@ const ec = (n, a) => o(Ua, { ref: a, ...n }), Ka = U(X((n, a) => {
|
|
|
1593
1593
|
}, [S]), N = Z((K, { size: pe }) => {
|
|
1594
1594
|
const Me = Math.floor(pe.height / S);
|
|
1595
1595
|
R(Me);
|
|
1596
|
-
}, [S]),
|
|
1597
|
-
let
|
|
1598
|
-
F?.key === "edit" && (
|
|
1599
|
-
const P =
|
|
1600
|
-
let K =
|
|
1596
|
+
}, [S]), j = ln(), F = j.getMode();
|
|
1597
|
+
let L = null;
|
|
1598
|
+
F?.key === "edit" && (L = F.args?.stateAndCoords);
|
|
1599
|
+
const P = z(() => {
|
|
1600
|
+
let K = L?.editState;
|
|
1601
1601
|
return K || (K = El(() => p.getRange(u).getCell())), o(O, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", gap: 4 }, children: o(Dl, { ref: y, activeCoords: u, sheet: p, onFocus: () => {
|
|
1602
1602
|
r?.startEdit({ autoFocus: !1, editMode: !0, cell: u });
|
|
1603
1603
|
}, defaultTextStyle: v, useRichStyling: !1, disabled: f, onChangeEdit: (pe) => {
|
|
1604
1604
|
if (pe.dirty !== void 0) {
|
|
1605
1605
|
const Me = { sheet: p, coords: u, editState: pe };
|
|
1606
|
-
|
|
1606
|
+
j.setMode((Te) => ({ ...Te, args: { ...Te?.args, stateAndCoords: Me } }));
|
|
1607
1607
|
}
|
|
1608
1608
|
}, editState: K, commands: g, onCancelEdit: () => {
|
|
1609
1609
|
r?.cancelEdit(), r?.focus();
|
|
1610
1610
|
}, onSubmitEdit: () => {
|
|
1611
1611
|
r?.submitEdit(), r?.focus();
|
|
1612
1612
|
}, linesVisible: M }) });
|
|
1613
|
-
}, [p,
|
|
1613
|
+
}, [p, L, u, M, r]), $ = xe(null), te = z(() => c ? i({ names: e.getNames(), workbook: e, ...h }, $) : null, [i, h, c, p, e, f]), de = z(() => I(xt, { elevation: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 0, backgroundImage: `linear-gradient(${Se("#fff", Be(5))}, ${Se("#fff", Be(5))})`, border: (K) => `solid ${f ? K.palette.action.disabled : Se(K.palette.divider, 0.2)} 1px` }, children: [o(bt, { sx: { border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: !0, outlined: !1, color: "warning", "aria-label": "cancel-formula-edit", icon: o(ye, { iconKey: "CloseError" }), propsTooltip: { label: "Cancel", simple: !0 }, disabled: f || L === null, onMouseDown: (K) => {
|
|
1614
1614
|
K.button === 0 && K.preventDefault();
|
|
1615
1615
|
}, onClick: () => {
|
|
1616
1616
|
r.cancelEdit();
|
|
1617
|
-
} }), o(bt, { sx: { border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: !0, outlined: !1, color: "primary", "aria-label": "commit-formula-edit", icon: o(ye, { iconKey: "CheckSuccess" }), propsTooltip: { label: "Enter", simple: !0 }, disabled: f ||
|
|
1617
|
+
} }), o(bt, { sx: { border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: !0, outlined: !1, color: "primary", "aria-label": "commit-formula-edit", icon: o(ye, { iconKey: "CheckSuccess" }), propsTooltip: { label: "Enter", simple: !0 }, disabled: f || L === null, onMouseDown: (K) => {
|
|
1618
1618
|
K.button === 0 && K.preventDefault();
|
|
1619
1619
|
}, onClick: () => {
|
|
1620
1620
|
r.submitEdit();
|
|
1621
1621
|
} }), o(bt, { sx: { border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: !0, outlined: !1, disabled: !0, "aria-label": "commit-formula-function", icon: o(ye, { iconKey: "Function", style: { transform: "scale(0.85)" } }), propsTooltip: { label: "Insert Function", simple: !0 }, onMouseDown: (K) => {
|
|
1622
1622
|
K.button === 0 && K.preventDefault();
|
|
1623
|
-
} })] }), [f,
|
|
1623
|
+
} })] }), [f, L]), se = et(), [A, H] = V(!1), ie = z(() => I(O, { className: "formula-bar", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", gap: (K) => K.spacing(0.5), alignItems: "start" }, children: [de, I(xt, { elevation: 0, sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", fontFamily: (K) => K.typography.fontFamily, fontSize: 11 * _t.getDeviceScale(), alignItems: "stretch", paddingTop: "2px", paddingBottom: "2px", boxShadow: "none", borderRadius: (K) => `${K.shape.borderRadius}px`, backgroundImage: `linear-gradient(${Se("#fff", Be(5))}, ${Se("#fff", Be(5))})`, border: (K) => `solid ${f ? K.palette.action.disabled : Se(K.palette.divider, 0.2)} 1px`, "& textarea": { color: (K) => f ? `${K.palette.text.disabled} !important` : K.palette.text.primary }, "& .react-resizable-handle": { width: "100%", height: "8px", backgroundColor: "transparent", boxSizing: "content-box", zIndex: 1e3 }, "& .react-resizable-handle-s": { position: "absolute", bottom: "-10px", cursor: "s-resize" } }, onFocus: () => H(!0), onBlur: () => H(!1), onMouseDown: (K) => {
|
|
1624
1624
|
K.target?.classList.contains("react-resizable-handle") && K.preventDefault();
|
|
1625
1625
|
}, children: [o(O, { className: "formula-editor", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", alignItems: "center", marginTop: "0px", paddingLeft: (K) => K.spacing(1), paddingRight: (K) => K.spacing(1) }, children: o(Js.ResizableBox, { height: C, draggableOpts: { grid: [S, S] }, minConstraints: [S, S], maxConstraints: [15 * S, 15 * S], onResize: N, onResizeStop: D, resizeHandles: ["s"], axis: "y", style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: P }) }), o(bt, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: !0, outlined: !1, "aria-label": "toggle-expand-formula-edit", icon: o(ye, { iconKey: M > 1 ? "ExpandLess" : "ExpandMore" }), propsTooltip: { label: (M > 1 ? "Collapse" : "Expand") + " Formula Bar", simple: !0 }, onMouseDown: (K) => {
|
|
1626
1626
|
K.button === 0 && K.preventDefault();
|
|
1627
1627
|
}, onClick: () => {
|
|
1628
1628
|
const K = M > 1 ? 1 : E;
|
|
1629
1629
|
k(K * S + 1), R(K);
|
|
1630
|
-
} }), o(O, { sx: { position: "absolute", width: "100%", height: "2px", bottom: "0", willChange: "opacity", transition: "opacity 60ms ease-in", opacity: A ? 1 : 0, borderBottomWidth: "2px", borderBottomStyle: "solid", borderBottomColor: (K) => K.palette.primary.main, borderRadius: (K) => `${K.shape.borderRadius}px` } })] })] }), [de, P, A, M, S]), oe =
|
|
1630
|
+
} }), o(O, { sx: { position: "absolute", width: "100%", height: "2px", bottom: "0", willChange: "opacity", transition: "opacity 60ms ease-in", opacity: A ? 1 : 0, borderBottomWidth: "2px", borderBottomStyle: "solid", borderBottomColor: (K) => K.palette.primary.main, borderRadius: (K) => `${K.shape.borderRadius}px` } })] })] }), [de, P, A, M, S]), oe = z(() => te || ie ? !te && ie ? ie : te && !ie ? te : o(ae, { children: o(Gn, { fixedPane: "before", minBefore: "165px", minAfter: "200px", propsPaneBefore: { style: { alignItems: "flex-start" } }, propsPaneAfter: { style: { overflow: "visible" } }, propsResizer: { style: { backgroundImage: `url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${se.palette.text.icon ?? se.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center calc(((var(--icon-size, 24) - 13px + 5px) / 2))", minWidth: "18px", marginRight: "1px" } }, elementBefore: te, elementAfter: ie }) }) : null, [te, ie]), Y = Rt(a, () => ({ isFormulaBarElement: () => !0, getNamedCollectionEditorElement: () => $.current }), []);
|
|
1631
1631
|
return o(O, { sx: { display: "flex", flexDirection: "row", gap: (K) => K.spacing(0.5), ...t }, ref: Y, ...b, children: oe });
|
|
1632
1632
|
}));
|
|
1633
1633
|
Ka.displayName = "FormulaBar";
|
|
1634
1634
|
const Ga = U(X((n, a) => {
|
|
1635
|
-
const { filter: t, commands: e, disabled: r, style: l, floatReference: c, ...h } = n, i =
|
|
1635
|
+
const { filter: t, commands: e, disabled: r, style: l, floatReference: c, ...h } = n, i = z(() => ({}), []), d = z(() => ({ commandHook: { beforeExecute: (p, s) => c.closeAll(), onExecute() {
|
|
1636
1636
|
}, onError() {
|
|
1637
1637
|
console.log("onError");
|
|
1638
|
-
} }, disabled: r, parentFloat: c }), [r, c]), g =
|
|
1638
|
+
} }, disabled: r, parentFloat: c }), [r, c]), g = z(() => ({ ...i, ...d, variant: re.Menuitem }), [i, d]), b = I(ae, { children: [o(B, { ...g, command: e.getCommand("sortAscending") }), o(B, { ...g, command: e.getCommand("sortDescending") }), o(Q, { orientation: "horizontal" }), o(B, { ...g, command: e.getCommand("autoFilterClear") }), []] });
|
|
1639
1639
|
return o(O, { ref: a, style: { paddingTop: "4px", paddingBottom: "4px", display: "flex", flexDirection: "column", ...l }, ...h, children: b });
|
|
1640
1640
|
}));
|
|
1641
1641
|
Ga.displayName = "FilterColumnMenu";
|
|
@@ -1651,18 +1651,18 @@ const qa = "_sheetxl-reset_11z3j_1", oc = 10, Xa = U(X((n, a) => {
|
|
|
1651
1651
|
x();
|
|
1652
1652
|
} });
|
|
1653
1653
|
}, [e, b]);
|
|
1654
|
-
const w =
|
|
1654
|
+
const w = z(() => {
|
|
1655
1655
|
let v = e?.toJSON() ?? {};
|
|
1656
1656
|
const S = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
1657
1657
|
return v && (v.styleOptions = { ...v.styleOptions, name: r.getName() }), v.ref = S, new Wn({ initialAnchor: S, json: v, styles: t });
|
|
1658
|
-
}, [u, e, r, t]), m =
|
|
1658
|
+
}, [u, e, r, t]), m = z(() => {
|
|
1659
1659
|
const v = [];
|
|
1660
1660
|
for (let S = 0; S < 5; S++) for (let C = 0; C < 5; C++) {
|
|
1661
1661
|
const k = w.getStyleAt({ colIndex: C, rowIndex: S });
|
|
1662
1662
|
v.push(k);
|
|
1663
1663
|
}
|
|
1664
1664
|
return v;
|
|
1665
|
-
}, [w]), f =
|
|
1665
|
+
}, [w]), f = z(() => {
|
|
1666
1666
|
const v = (C, k, E) => {
|
|
1667
1667
|
let T = E.getFill().toCSS(l?.darkMode ?? !1);
|
|
1668
1668
|
const M = s - (k < 4 ? 1 : 0), R = g - (C < 4 ? 1 : 0), D = E.getFont().getFill().toCSS(l?.darkMode ?? !1);
|
|
@@ -1682,17 +1682,17 @@ const qa = "_sheetxl-reset_11z3j_1", oc = 10, Xa = U(X((n, a) => {
|
|
|
1682
1682
|
})), xo = (n, a, t, e, r) => {
|
|
1683
1683
|
n.beginPath(), n.moveTo(a + 0.5, t + 0.5), n.lineTo(e + 0.5, r + 0.5), n.stroke();
|
|
1684
1684
|
}, nc = U(X((n, a) => {
|
|
1685
|
-
const { table: t, tableStyle: e, styles: r, bodyStyle: l, disabled: c, style: h, className: i, canvas: d, ...g } = n, b =
|
|
1685
|
+
const { table: t, tableStyle: e, styles: r, bodyStyle: l, disabled: c, style: h, className: i, canvas: d, ...g } = n, b = z(() => {
|
|
1686
1686
|
const u = t.toJSON(), x = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
1687
1687
|
return u.styleOptions = { ...u.styleOptions, name: e.getName() }, u.ref = x, new Wn({ initialAnchor: x, json: u, styles: r });
|
|
1688
|
-
}, [t, e, r]), p =
|
|
1688
|
+
}, [t, e, r]), p = z(() => {
|
|
1689
1689
|
const u = [];
|
|
1690
1690
|
for (let x = 0; x < 5; x++) for (let w = 0; w < 5; w++) {
|
|
1691
1691
|
const m = b.getStyleAt({ colIndex: w, rowIndex: x });
|
|
1692
1692
|
u.push(m);
|
|
1693
1693
|
}
|
|
1694
1694
|
return u;
|
|
1695
|
-
}, [b]), s =
|
|
1695
|
+
}, [b]), s = z(() => {
|
|
1696
1696
|
let u = d;
|
|
1697
1697
|
if (d || (u = document.createElement("canvas")), !u) return null;
|
|
1698
1698
|
u.width !== 61 && (u.width = 61), u.height !== 46 && (u.height = 46);
|
|
@@ -1702,7 +1702,7 @@ const qa = "_sheetxl-reset_11z3j_1", oc = 10, Xa = U(X((n, a) => {
|
|
|
1702
1702
|
for (let f = 0; f < 5; f++) for (let y = 0; y < 5; y++) {
|
|
1703
1703
|
const v = p[5 * f + y].getFill();
|
|
1704
1704
|
let S = l?.fill;
|
|
1705
|
-
v.getType() === fn.Type.Solid ? S = v.getColor().toCSS(m
|
|
1705
|
+
v.getType() === fn.Type.Solid ? S = v.getColor().toCSS(m) : v.getType() === fn.Type.Gradient ? S = v.getStops[0]?.color.toCSS(m) : v.getType() === fn.Type.Pattern && (S = v.getForeground().toCSS(m)), x.fillStyle = S;
|
|
1706
1706
|
const C = y * w, k = 9 * f;
|
|
1707
1707
|
x.fillRect(C, k, 13, 10);
|
|
1708
1708
|
}
|
|
@@ -1711,15 +1711,15 @@ const qa = "_sheetxl-reset_11z3j_1", oc = 10, Xa = U(X((n, a) => {
|
|
|
1711
1711
|
const v = p[5 * f + y], S = y * w, C = 9 * f, k = v.getBorder();
|
|
1712
1712
|
if (!k.isEmpty()) {
|
|
1713
1713
|
const M = k.getLeft();
|
|
1714
|
-
M.isNone() || (x.strokeStyle = M.getColor().toCSS(m
|
|
1714
|
+
M.isNone() || (x.strokeStyle = M.getColor().toCSS(m), xo(x, S, C, S, C + 9));
|
|
1715
1715
|
const R = k.getTop();
|
|
1716
|
-
R.isNone() || (x.strokeStyle = R.getColor().toCSS(m
|
|
1716
|
+
R.isNone() || (x.strokeStyle = R.getColor().toCSS(m), xo(x, S, C, S + w, 9 * f));
|
|
1717
1717
|
const D = k.getRight();
|
|
1718
|
-
D.isNone() || (x.strokeStyle = D.getColor().toCSS(m
|
|
1718
|
+
D.isNone() || (x.strokeStyle = D.getColor().toCSS(m), xo(x, S + w, C, S + w, C + 9));
|
|
1719
1719
|
const N = k.getBottom();
|
|
1720
|
-
N.isNone() || (x.strokeStyle = N.getColor().toCSS(m
|
|
1720
|
+
N.isNone() || (x.strokeStyle = N.getColor().toCSS(m), xo(x, S, C + 9, S + w, C + 9));
|
|
1721
1721
|
}
|
|
1722
|
-
x.strokeStyle = v.getFont().getFill().toCSS(m
|
|
1722
|
+
x.strokeStyle = v.getFont().getFill().toCSS(m);
|
|
1723
1723
|
const E = 4, T = 2.5;
|
|
1724
1724
|
xo(x, y * w + T, 9 * f + E, y * w + T + 7, 9 * f + E);
|
|
1725
1725
|
}
|
|
@@ -1741,7 +1741,7 @@ const qa = "_sheetxl-reset_11z3j_1", oc = 10, Xa = U(X((n, a) => {
|
|
|
1741
1741
|
var lc = function() {
|
|
1742
1742
|
}, Ya = typeof window < "u", sc = Ya ? Tt : le, Vr = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
1743
1743
|
const Vt = Ya && window.ResizeObserver !== void 0 ? function() {
|
|
1744
|
-
var n = V(null), a = n[0], t = n[1], e = V(Vr), r = e[0], l = e[1], c =
|
|
1744
|
+
var n = V(null), a = n[0], t = n[1], e = V(Vr), r = e[0], l = e[1], c = z(function() {
|
|
1745
1745
|
return new window.ResizeObserver(function(h) {
|
|
1746
1746
|
if (h[0]) {
|
|
1747
1747
|
var i = h[0].contentRect, d = i.x, g = i.y, b = i.width, p = i.height, s = i.top, u = i.left, x = i.bottom, w = i.right;
|
|
@@ -1757,7 +1757,7 @@ const Vt = Ya && window.ResizeObserver !== void 0 ? function() {
|
|
|
1757
1757
|
} : function() {
|
|
1758
1758
|
return [lc, Vr];
|
|
1759
1759
|
}, cc = "_range-row_akhf4_1", dc = "_action-row_akhf4_15", pc = U(X((n, a) => {
|
|
1760
|
-
const { title: t, commands: e, className: r, ...l } = n, c = sn(), [h, i] = V(!1), [d, g] = V(!1), b = xe(null), [p, s] = tn((E) => E + 1, 0), [u, { width: x }] = Vt(), w = Ae(e, ["editTable"])[0].getContext(), m = w.table(), [f, y] = V(() => m ? w.getNames().getRanges(m.getRange()) : null), v =
|
|
1760
|
+
const { title: t, commands: e, className: r, ...l } = n, c = sn(), [h, i] = V(!1), [d, g] = V(!1), b = xe(null), [p, s] = tn((E) => E + 1, 0), [u, { width: x }] = Vt(), w = Ae(e, ["editTable"])[0].getContext(), m = w.table(), [f, y] = V(() => m ? w.getNames().getRanges(m.getRange()) : null), v = z(() => m?.getName() ?? "", [m]);
|
|
1761
1761
|
je(w.table(), { onAnchorCoordsChange(E) {
|
|
1762
1762
|
y(w.getNames().getRanges(E.getRange()));
|
|
1763
1763
|
}, onProtectedChange(E) {
|
|
@@ -1812,16 +1812,16 @@ const Vt = Ya && window.ResizeObserver !== void 0 ? function() {
|
|
|
1812
1812
|
}, onStyleChange: () => {
|
|
1813
1813
|
k(e.getTabColor());
|
|
1814
1814
|
} });
|
|
1815
|
-
const E =
|
|
1815
|
+
const E = et(), T = b === h;
|
|
1816
1816
|
let M = null, R = null;
|
|
1817
1817
|
if (C || p) {
|
|
1818
|
-
let
|
|
1819
|
-
C ? (R = C.toBlackOrWhite().toCSS(),
|
|
1818
|
+
let j = w, F = j, L = j;
|
|
1819
|
+
C ? (R = C.toBlackOrWhite().toCSS(), j = C?.toCSS(), F = Ze(j, 0.75), L = Ze(j, 0.1)) : T || (j = E.palette.background.paper), M = o(O, { sx: { position: "absolute", boxSizing: "border-box", top: "3px", left: "4px", right: "4.5px", bottom: "1.5px", opacity: T ? "50%" : "100%", borderRadius: "4px", border: (P) => T ? `${w} solid 1px` : `${P.palette.divider} solid 1px`, background: T && C ? `linear-gradient(0deg, ${j} 0%, ${F} 60%, ${L} 90%, transparent 100%)` : j } });
|
|
1820
1820
|
}
|
|
1821
1821
|
let D = null;
|
|
1822
1822
|
typeof s == "string" ? D = s : s?.toCSS && (D = s.toCSS());
|
|
1823
|
-
const N = T ? o(O, { sx: { width: "100%", borderRadius: "4px", minWidth: "4px", height: "2px", backgroundColor: (
|
|
1824
|
-
return o(Da, { theme: T ? f ?? E : E, children: o(O, { ref: a, className: Re(l), sx: { ...r, display: "flex", flexDirection: "column", minHeight: "0px", fontWeight: T ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", lineHeight: "1", textTransform: "none", minWidth: "unset", cursor: p ? "grabbing" : void 0 }, ...y, children: o(ps, { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, radius: m, strokeColor: T ? D : "transparent", children: o(Qo, { sx: { textTransform: "none", borderRadius: "0px", minHeight: "0px", paddingLeft: "11px", paddingRight: "12px", paddingTop: "3px", flex: "1 1 100%", paddingBottom: "3px", fontWeight: T ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", transition: "none", cursor: p ? "grabbing" : void 0, color: T ? "primary" : R || "text.secondary", backgroundColor: T ? w : "transparent", "&:hover:not([disabled])": { backgroundColor: T ? w : "transparent" }, "& input": { color: (
|
|
1823
|
+
const N = T ? o(O, { sx: { width: "100%", borderRadius: "4px", minWidth: "4px", height: "2px", backgroundColor: (j) => j.palette.primary.main } }) : null;
|
|
1824
|
+
return o(Da, { theme: T ? f ?? E : E, children: o(O, { ref: a, className: Re(l), sx: { ...r, display: "flex", flexDirection: "column", minHeight: "0px", fontWeight: T ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", lineHeight: "1", textTransform: "none", minWidth: "unset", cursor: p ? "grabbing" : void 0 }, ...y, children: o(ps, { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, radius: m, strokeColor: T ? D : "transparent", children: o(Qo, { sx: { textTransform: "none", borderRadius: "0px", minHeight: "0px", paddingLeft: "11px", paddingRight: "12px", paddingTop: "3px", flex: "1 1 100%", paddingBottom: "3px", fontWeight: T ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", transition: "none", cursor: p ? "grabbing" : void 0, color: T ? "primary" : R || "text.secondary", backgroundColor: T ? w : "transparent", "&:hover:not([disabled])": { backgroundColor: T ? w : "transparent" }, "& input": { color: (j) => `${j.palette.text.primary}`, textAlign: "center", fontWeight: "500" }, marginTop: "0px", minWidth: "unset" }, disabled: g, disableRipple: i, component: "div", children: I(ae, { children: [M, I(O, { sx: { zIndex: "1", display: "flex", flexDirection: "row", alignItems: "center" }, children: [I(O, { sx: { display: "flex", flexDirection: "column", alignItems: "center", rowGap: "1px", lineHeight: "1", marginTop: T ? void 0 : "1px" }, children: [t, N] }), v ? o(ye, { iconKey: "Lock", style: { scale: "0.80", marginLeft: "2px", width: "22px", height: "22px" }, color: "secondary" }) : o(O, { sx: { minHeight: "22px" } })] })] }) }, c + ":" + h) }) }) });
|
|
1825
1825
|
}));
|
|
1826
1826
|
Za.displayName = "SheetTab";
|
|
1827
1827
|
const Qa = U(X((n, a) => {
|
|
@@ -1829,10 +1829,10 @@ const Qa = U(X((n, a) => {
|
|
|
1829
1829
|
je(t, { onProtectionChange: (f) => {
|
|
1830
1830
|
s(f?.getProtection());
|
|
1831
1831
|
} });
|
|
1832
|
-
const u =
|
|
1832
|
+
const u = z(() => ({}), []), x = z(() => ({ commandHook: { beforeExecute: (f, y) => h.closeAll(), onExecute() {
|
|
1833
1833
|
}, onError() {
|
|
1834
1834
|
console.log("onError");
|
|
1835
|
-
} }, scope: l, commandState: e, disabled: c || e === void 0, parentFloat: h }), [c, h]), w =
|
|
1835
|
+
} }, scope: l, commandState: e, disabled: c || e === void 0, parentFloat: h }), [c, h]), w = z(() => ({ ...u, ...x }), [u, x]), m = I(ae, { children: [o(B, { command: r.getCommand("addSheet"), commandState: e, ...w, variant: re.Menuitem }), o(B, { command: r.getCommand("deleteSheet"), ...w, variant: re.Menuitem }), I(dt, { onMouseDown: (f) => {
|
|
1836
1836
|
f.button === 0 && f.preventDefault();
|
|
1837
1837
|
}, onMouseUp: () => {
|
|
1838
1838
|
Promise.resolve(h.closeAll()).then(() => {
|
|
@@ -1849,7 +1849,7 @@ const Ja = U(X((n, a) => {
|
|
|
1849
1849
|
}, onProtectionChange: (s) => {
|
|
1850
1850
|
b(s?.getProtection());
|
|
1851
1851
|
} });
|
|
1852
|
-
const p =
|
|
1852
|
+
const p = z(() => {
|
|
1853
1853
|
const s = [], u = t.getSheets().getItems({ visibility: Lt.Visibility.Hidden }), x = t.getSelectedSheet();
|
|
1854
1854
|
for (let w = 0; w < u.length; w++) {
|
|
1855
1855
|
const m = u[w], f = m.getVisibility();
|
|
@@ -1860,7 +1860,7 @@ const Ja = U(X((n, a) => {
|
|
|
1860
1860
|
let M = null;
|
|
1861
1861
|
v && (M = o(ye, { iconKey: "Lock" })), f !== Lt.Visibility.Visible && (M = o(ye, { iconKey: "VisibilityOff", style: { opacity: g.isStructureAllowed() ? 1 : 0.7 }, color: "secondary" })), M && (M = o(O, { sx: { display: "flex", flex: "1 1 100%", alignItems: "center", ml: "16px", "& *": { lineHeight: "1em", fontSize: "1.3em" } }, children: M })), s.push(o(dt, { disabled: !g.isStructureAllowed() && f === Lt.Visibility.Hidden, sx: { color: (R) => {
|
|
1862
1862
|
let D = y ? R.palette.primary.main : R.palette.text.secondary;
|
|
1863
|
-
return E && (D = E), f === Lt.Visibility.Hidden && (D =
|
|
1863
|
+
return E && (D = E), f === Lt.Visibility.Hidden && (D = Ze(D, R.palette.action.disabledOpacity)), D;
|
|
1864
1864
|
}, borderLeft: (R) => `${y ? R.palette.primary.main : "transparent"} solid 2px`, paddingLeft: "4px", paddingTop: "4px", paddingBottom: "4px", fontWeight: y ? "700" : "400", "&:hover": { fontWeight: "700" } }, icon: y ? o(on, {}) : void 0, onMouseDown: (R) => R.preventDefault(), onMouseUp: () => {
|
|
1865
1865
|
Promise.resolve(r.closeAll()).then(() => {
|
|
1866
1866
|
try {
|
|
@@ -1890,7 +1890,7 @@ const _r = async (n) => {
|
|
|
1890
1890
|
}
|
|
1891
1891
|
if (Ct !== n && (Ct = n, !$o)) try {
|
|
1892
1892
|
$o = !0, (top ?? window).SheetXL && (await ko._validate(!0), ko.wasPrinted() && (() => {
|
|
1893
|
-
|
|
1893
|
+
Je.consoleWithNoSource(`%cTip: You can access the API directly in the console.
|
|
1894
1894
|
Try
|
|
1895
1895
|
%c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c
|
|
1896
1896
|
>%c SheetXL.moreExamples()`, "color:#ffa726;", "font-family:monospace;color:#1976d2;font-size:12px;", "font-family:monospace;", "font-family:monospace;color:#1976d2;font-size:12px;", "font-family:monospace;"), $o = !0;
|
|
@@ -2090,9 +2090,9 @@ const Sn = 0.12, Gr = (n, a) => {
|
|
|
2090
2090
|
}, r = e(a);
|
|
2091
2091
|
t.body = e(n), t.header = { ...t.body, strokeFill: it(t.body.fill, Sn, n.palette?.mode), fill: a && n.palette.mode === "dark" && a.palette.mode !== n.palette.mode ? t.body.fill : it(t.body.fill, 0.055, n.palette?.mode), edgeStrokeFill: n.palette.mode === "dark" ? t.body.strokeFill : it(t.body.fill, 0.328, n.palette?.mode) }, t.headerHover = (i) => ({ ...t.header, strokeFill: it(i?.fill ?? t.body.fill, 0.22, n.palette?.mode), fill: it(i?.fill ?? t.header.fill, 0.065, n.palette?.mode), text: { ...i?.text, fontWeight: n.typography?.fontWeightBold } });
|
|
2092
2092
|
const l = it(n.palette.mode !== "dark" ? n.palette.primary.light : n.palette.primary.main, 0.055, n.palette?.mode);
|
|
2093
|
-
t.headerSelect = { ...t.header, strokeFill: n.palette.primary.main, fill:
|
|
2093
|
+
t.headerSelect = { ...t.header, strokeFill: n.palette.primary.main, fill: Ze(l, 0.2), text: { ...t.header.text, fill: n.palette.primary.main }, dividerStrokeFill: Ze(l, 0.7) }, t.headerSelectAll = { ...t.headerSelect, fill: Ze(l, 0.9), text: { ...t.headerSelect.text, fill: n.palette.primary.contrastText }, edgeStrokeFill: t.headerSelect.strokeFill }, t.buttonSurface = { ...r, strokeFill: it(r.fill, Sn, a.palette?.mode), fill: a && a.palette.mode === "dark" && a.palette.mode !== n.palette.mode ? r.fill : it(r.fill, 0.055, a.palette?.mode), edgeStrokeFill: a.palette.mode === "dark" ? r.strokeFill : it(r.fill, 0.328, a.palette?.mode) }, t.headerSelection = { fill: n.palette?.primary?.main ? Ze(n.palette?.primary?.main, 0.1) : void 0, strokeFill: n.palette?.primary?.main }, t.headerSelectionInactive = { ...t.headerSelection, fill: n.palette?.divider ? Ze(n.palette?.divider, 0.05) : void 0, strokeFill: "transparent" };
|
|
2094
2094
|
const c = a ?? n, h = c.palette.mode === "dark";
|
|
2095
|
-
return t.selection = { fill: c.palette?.primary?.main ?
|
|
2095
|
+
return t.selection = { fill: c.palette?.primary?.main ? Ze(c.palette?.primary?.main, 0.1) : void 0, strokeFill: c.palette?.primary?.main }, t.selectionInactive = { ...t.selection, fill: c.palette?.divider ? Ze(c.palette?.divider, 0.05) : void 0, strokeFill: "transparent" }, t.selectionRemove = { ...t.selection, fill: Ze(c.palette.warning.light, 0.05), strokeFill: c.palette.warning.dark }, a && (t.body = e(a)), t.colorShadow = Ze(c.palette.action.active, 0.5), t.colorGrey = c.palette.action.active, t.filterDarkInvert = h ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", t;
|
|
2096
2096
|
}, hc = "_sheetxl-theme_4opcr_2", Mo = U(X((n, a) => {
|
|
2097
2097
|
const { children: t, sx: e, parentFloat: r, ...l } = n, c = Rt(a, () => ({}), []), [h, i] = Vt(), d = xe(null), g = xe(null), [b, p] = ne.useReducer((S) => S + 1, 0), [s, u] = V(null), [x, w] = V(null), [m, f] = V(null), { reference: y } = ao({ parentFloat: r, label: "overflow" });
|
|
2098
2098
|
Tt(() => {
|
|
@@ -2113,24 +2113,24 @@ const Sn = 0.12, Gr = (n, a) => {
|
|
|
2113
2113
|
const k = c.current?.getBoundingClientRect(), E = [], T = [];
|
|
2114
2114
|
let M = 0, R = !1;
|
|
2115
2115
|
for (let N = 0; !R && N < C; N++) {
|
|
2116
|
-
const
|
|
2117
|
-
if (
|
|
2118
|
-
if (
|
|
2116
|
+
const j = S[N];
|
|
2117
|
+
if (!j) continue;
|
|
2118
|
+
if (!j.current) {
|
|
2119
2119
|
R = !0;
|
|
2120
2120
|
continue;
|
|
2121
2121
|
}
|
|
2122
|
-
const F =
|
|
2122
|
+
const F = j.current.getBoundingClientRect();
|
|
2123
2123
|
M += F?.width, M > k.width && (R = !0);
|
|
2124
2124
|
}
|
|
2125
2125
|
if (!R) return w(null), void f([]);
|
|
2126
2126
|
const D = d.current?.getBoundingClientRect();
|
|
2127
2127
|
M = 0;
|
|
2128
2128
|
for (let N = 0; N < C; N++) {
|
|
2129
|
-
const
|
|
2129
|
+
const j = S[N];
|
|
2130
2130
|
let F = !1;
|
|
2131
|
-
if (
|
|
2132
|
-
const
|
|
2133
|
-
M +=
|
|
2131
|
+
if (j.current) {
|
|
2132
|
+
const L = j.current.getBoundingClientRect();
|
|
2133
|
+
M += L?.width, M < k.width - D.width && (F = !0);
|
|
2134
2134
|
}
|
|
2135
2135
|
F ? E.push(s[N]) : T.push(s[N]);
|
|
2136
2136
|
}
|
|
@@ -2141,9 +2141,9 @@ const Sn = 0.12, Gr = (n, a) => {
|
|
|
2141
2141
|
for (let T = 0; T < k; T++) {
|
|
2142
2142
|
const M = ne.Children.toArray(m[T])[0];
|
|
2143
2143
|
ne.Children.toArray(M.props.children?.props?.children ?? M.props.children).forEach((R, D) => {
|
|
2144
|
-
const N = R,
|
|
2145
|
-
|
|
2146
|
-
const F = ne.cloneElement(N,
|
|
2144
|
+
const N = R, j = { ...N.props, key: `overflow-${T}-${D}${N.key ?? ""}` };
|
|
2145
|
+
j.parentFloat && S && (j.parentFloat = S.floatReference);
|
|
2146
|
+
const F = ne.cloneElement(N, j);
|
|
2147
2147
|
C.push(F);
|
|
2148
2148
|
});
|
|
2149
2149
|
}
|
|
@@ -2189,7 +2189,7 @@ const Sn = 0.12, Gr = (n, a) => {
|
|
|
2189
2189
|
d.button === 0 && r(t);
|
|
2190
2190
|
}, onKeyDown: (d) => {
|
|
2191
2191
|
d.keyCode !== he.Enter && d.keyCode !== he.Space || r(t);
|
|
2192
|
-
}, ...c, children: I(O, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [o(Fe, { component: "div", children: t.metadata?.title ?? t.path }), o(Fe, { variant: "caption", component: "div", sx: { color: (d) =>
|
|
2192
|
+
}, ...c, children: I(O, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [o(Fe, { component: "div", children: t.metadata?.title ?? t.path }), o(Fe, { variant: "caption", component: "div", sx: { color: (d) => Ze(d.palette.text.secondary ?? d.palette.text.primary, 0.6), overflow: "hidden", textOverflow: "ellipsis" }, children: t.metadata?.summary })] }) });
|
|
2193
2193
|
}), bc = U(X((n, a) => {
|
|
2194
2194
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, scriptPath: c = ai, ...h } = n, [i, d] = V([]), [g, b] = V(!0), p = Ae(t, ["executeSelectedScript"]), s = p[0]?.getContext();
|
|
2195
2195
|
le(() => {
|
|
@@ -2253,42 +2253,42 @@ const si = U(X((n, a) => {
|
|
|
2253
2253
|
}));
|
|
2254
2254
|
si.displayName = "TemplateSelectPanel";
|
|
2255
2255
|
const ci = U(X((n, a) => {
|
|
2256
|
-
const { className: t, sx: e, propsScriptEditor: r, commands: l, readOnly: c = !1, frame: h, autoFocusSel: i, autoFocus: d = !0, scripts: g, ...b } = n, p =
|
|
2256
|
+
const { className: t, sx: e, propsScriptEditor: r, commands: l, readOnly: c = !1, frame: h, autoFocusSel: i, autoFocus: d = !0, scripts: g, ...b } = n, p = et(), [s, u] = V(!1), x = xe(!1), [w, m] = V({ message: "Loading", cursor: "", dirty: !1 }), [f, y] = V(null);
|
|
2257
2257
|
le(() => {
|
|
2258
|
-
let
|
|
2258
|
+
let L = !1;
|
|
2259
2259
|
return y(null), (async function() {
|
|
2260
|
-
if (g && (await g.start(), !
|
|
2260
|
+
if (g && (await g.start(), !L)) {
|
|
2261
2261
|
const P = g.getModules().getItems()[0]?.getSource();
|
|
2262
2262
|
y({ source: P || null });
|
|
2263
2263
|
}
|
|
2264
2264
|
})(), () => {
|
|
2265
|
-
|
|
2265
|
+
L = !0;
|
|
2266
2266
|
};
|
|
2267
2267
|
}, [g]);
|
|
2268
|
-
const v = _((
|
|
2269
|
-
m((P) => ({ ...P, ...
|
|
2270
|
-
}, []), S = xe(null), [C, k] = V(null), E = xe(null), T = Z((
|
|
2271
|
-
if (C) return C.focus(
|
|
2268
|
+
const v = _((L) => {
|
|
2269
|
+
m((P) => ({ ...P, ...L }));
|
|
2270
|
+
}, []), S = xe(null), [C, k] = V(null), E = xe(null), T = Z((L) => {
|
|
2271
|
+
if (C) return C.focus(L), !0;
|
|
2272
2272
|
if (i) {
|
|
2273
2273
|
const P = S.current?.querySelectorAll?.(i);
|
|
2274
|
-
if (P && P.length > 0) return P[0]?.focus?.(
|
|
2274
|
+
if (P && P.length > 0) return P[0]?.focus?.(L), !0;
|
|
2275
2275
|
}
|
|
2276
|
-
return S.current?.focus?.(
|
|
2277
|
-
}, [C, i, d]), M =
|
|
2278
|
-
let
|
|
2279
|
-
return f === null ? null : (f.source === null && (
|
|
2276
|
+
return S.current?.focus?.(L), !1;
|
|
2277
|
+
}, [C, i, d]), M = z(() => o(Po, { transitionDelay: "160ms", style: { position: "absolute", width: "100%", height: "100%" }, transparentBackground: !1 }), []), R = z(() => o(xt, { elevation: 1, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, marginLeft: (L) => L.spacing(0.5), marginRight: (L) => L.spacing(0.5), marginTop: (L) => L.spacing(1), marginBottom: (L) => L.spacing(1) }, children: o(li, { commands: l }) }), [p, l]), D = z(() => o(O, { className: Re("script-status-panel", "status-panel"), sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", margin: 0, borderTop: `solid 1px ${p.palette.divider}` }, children: I("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "center", flexDirection: "row", justifyContent: "center" }, children: [o(Fe, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "1 1 100%", color: (L) => L.palette.text.secondary }, variant: "caption", children: w.message }), o(Fe, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", color: (L) => L.palette.text.secondary }, variant: "caption", children: w.dirty ? "Unsaved" : "" }), o(Fe, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", marginLeft: "8px", minWidth: "90px", display: "flex", justifyContent: "end", color: (L) => L.palette.text.secondary }, variant: "caption", children: w.cursor })] }) }), [w]), N = z(() => I(O, { className: Re("script-editor-content"), sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "column", boxSizing: "border-box" }, children: [R, o(O, { sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "row", position: "relative", boxSizing: "border-box" }, children: o(Rl, { ref: S, loadingPanel: M, readOnly: c, frame: h, autoFocus: d, commands: l, onStatusChange: v, darkMode: p.palette.mode === "dark", ...r }) }), D] }), [p, l, R, D, s, M, c, r, d, i, h, v]), j = z(() => {
|
|
2278
|
+
let L;
|
|
2279
|
+
return f === null ? null : (f.source === null && (L = o(si, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", position: "absolute", boxSizing: "border-box", width: "100%", height: "100%" }, onScriptSelect: (P) => {
|
|
2280
2280
|
S.current?.getEditor()?.insertSnippet(P.content), y({ source: P.content ?? "" });
|
|
2281
2281
|
} })), o(O, { tabIndex: 0, className: Re("script-workspace", t), sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", alignItems: "stretch", userSelect: "none", flexGrow: 0, outline: "none" }, onPointerDown: (P) => {
|
|
2282
2282
|
P.isDefaultPrevented() || S.current?.focus();
|
|
2283
|
-
}, children: I(O, { sx: { flex: "1 1 100%", position: "relative", display: "flex" }, children: [N,
|
|
2284
|
-
}, [R, N, t, f]), F = Rt(a, () => ({ isScriptWorkspaceElement: () => !0, focus: (
|
|
2285
|
-
T(
|
|
2283
|
+
}, children: I(O, { sx: { flex: "1 1 100%", position: "relative", display: "flex" }, children: [N, L] }) }));
|
|
2284
|
+
}, [R, N, t, f]), F = Rt(a, () => ({ isScriptWorkspaceElement: () => !0, focus: (L) => {
|
|
2285
|
+
T(L);
|
|
2286
2286
|
} }), []);
|
|
2287
|
-
return o(O, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", ...e }, ref: F, ...b, onFocus: (
|
|
2288
|
-
u(!0), x.current = !0, F.current?.contains(
|
|
2289
|
-
}, onBlur: (
|
|
2290
|
-
F?.current?.contains(
|
|
2291
|
-
}, children:
|
|
2287
|
+
return o(O, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", ...e }, ref: F, ...b, onFocus: (L) => {
|
|
2288
|
+
u(!0), x.current = !0, F.current?.contains(L.target) && L.target !== F.current && k(L.target), L.relatedTarget && !E.current && (E.current = L.relatedTarget), b?.onFocus?.(L);
|
|
2289
|
+
}, onBlur: (L) => {
|
|
2290
|
+
F?.current?.contains(L.relatedTarget) || F?.current === L.relatedTarget || (E.current = null, x.current = !1, u(!1)), b?.onBlur?.(L);
|
|
2291
|
+
}, children: j });
|
|
2292
2292
|
}));
|
|
2293
2293
|
ci.displayName = "ScriptWorkspace";
|
|
2294
2294
|
const xc = (n, a) => {
|
|
@@ -2385,7 +2385,7 @@ const gi = (n) => o(fi, { ...n }), wc = U((n) => {
|
|
|
2385
2385
|
e.button === 0 && e.preventDefault();
|
|
2386
2386
|
}, sx: { textTransform: "none", flex: "1 1 100%", fontWeight: (e) => e.typography.fontWeightRegular, padding: "2px 6px", minHeight: "0px", minWidth: "0px", marginRight: (e) => e.spacing(0.5), "&.Mui-selected": {}, "&.Mui-focusVisible": {}, ...a }, ...t }), o(O, { className: "indicator", sx: { width: "90%", borderRadius: "4px", minWidth: "4px", position: "absolute", bottom: "0", alignSelf: "center", display: "flex" } })] });
|
|
2387
2387
|
}), Sc = U((n) => {
|
|
2388
|
-
const { toolbars: a, value: t, onToolbarChange: e, sx: r, ...l } = n, c =
|
|
2388
|
+
const { toolbars: a, value: t, onToolbarChange: e, sx: r, ...l } = n, c = z(() => {
|
|
2389
2389
|
const h = [];
|
|
2390
2390
|
for (let i = 0; i < a.length; i++) h.push(o(wc, { label: a[i].label }, a[i].label));
|
|
2391
2391
|
return h;
|
|
@@ -2396,7 +2396,7 @@ const gi = (n) => o(fi, { ...n }), wc = U((n) => {
|
|
|
2396
2396
|
}), Cc = U((n) => {
|
|
2397
2397
|
const { toolbars: a, value: t, onToolbarChange: e, propsSelect: r, ...l } = n, c = _((i) => {
|
|
2398
2398
|
e?.(i.target.value);
|
|
2399
|
-
}, [e]), h =
|
|
2399
|
+
}, [e]), h = z(() => {
|
|
2400
2400
|
const i = [];
|
|
2401
2401
|
for (let d = 0; d < a.length; d++) {
|
|
2402
2402
|
const g = a[d].label;
|
|
@@ -2408,20 +2408,20 @@ const gi = (n) => o(fi, { ...n }), wc = U((n) => {
|
|
|
2408
2408
|
}, [a, t]);
|
|
2409
2409
|
return o(_n, { sx: { minWidth: "125px", maxWidth: "125px", "& .MuiInputBase-root": { paddingLeft: "0px", paddingRight: "0px" }, "& .MuiSelect-select": { paddingTop: (i) => i.spacing(0.5), paddingBottom: (i) => i.spacing(0.5), paddingLeft: (i) => i.spacing(2), color: (i) => i.palette.primary.main }, "& .MuiSelect-icon": { fill: (i) => i.palette.text.icon ?? i.palette.action.active, "&:hover:not(.Mui-disabled)": { color: (i) => i.palette.text.icon ?? i.palette.action.active } }, ...r }, size: "small", children: o(_l, { value: t, onChange: c, variant: "outlined", sx: { backgroundImage: `linear-gradient(${Se("#fff", Be(5))}, ${Se("#fff", Be(5))})` }, ...l, children: h }) });
|
|
2410
2410
|
}), fi = U(X((n, a) => {
|
|
2411
|
-
const { commands: t, wrapperSelect: e, propsSelect: r =
|
|
2412
|
-
const S = [], { ref: C, ...k } = h?.Home ||
|
|
2411
|
+
const { commands: t, wrapperSelect: e, propsSelect: r = Je.EmptyObject, isCompact: l = !1, wrapperPalette: c, propsToolbars: h = Je.EmptyObject, propsPalette: i = Je.EmptyObject, workbook: d, sx: g, ...b } = n, p = z(() => {
|
|
2412
|
+
const S = [], { ref: C, ...k } = h?.Home || Je.EmptyObject;
|
|
2413
2413
|
S.push({ label: "Home", component: o(ui, { commands: t, ...k }) });
|
|
2414
|
-
const { ref: E, ...T } = h?.Insert ||
|
|
2414
|
+
const { ref: E, ...T } = h?.Insert || Je.EmptyObject;
|
|
2415
2415
|
S.push({ label: "Insert", component: o(mi, { commands: t, ...T }) });
|
|
2416
|
-
const { ref: M, ...R } = h?.View ||
|
|
2416
|
+
const { ref: M, ...R } = h?.View || Je.EmptyObject;
|
|
2417
2417
|
return S.push({ label: "View", component: o(hi, { commands: t, ...R }) }), S;
|
|
2418
|
-
}, [t, d]), s =
|
|
2418
|
+
}, [t, d]), s = z(() => {
|
|
2419
2419
|
const S = [];
|
|
2420
2420
|
for (let C = 0; C < p.length; C++) S.push(ne.cloneElement(p[C].component, { ...p[C].component.props, key: p[C].key ?? p[C].label }));
|
|
2421
2421
|
return S;
|
|
2422
2422
|
}, [p]), [u, x] = V(0), w = (S) => {
|
|
2423
2423
|
x(S);
|
|
2424
|
-
}, m =
|
|
2424
|
+
}, m = z(() => o(l ? Cc : Sc, { toolbars: p, value: u, onToolbarChange: w, sx: r }), [p, u, r, l]), { sx: f, ...y } = i, v = o(xt, { elevation: 2, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, borderRadius: "8px", backgroundImage: `linear-gradient(${Se("#fff", Be(5))}, ${Se("#fff", Be(5))})`, marginLeft: (S) => S.spacing(1), marginRight: (S) => S.spacing(1), marginTop: (S) => S.spacing(0.5), marginBottom: (S) => S.spacing(0.5), ...f }, ...y, children: s[u] });
|
|
2425
2425
|
return I(O, { ref: a, className: "toolbarWrappers", sx: { display: "flex", flexDirection: "column", paddingTop: (S) => S.spacing(0.5), "*": { userSelect: "none" }, ...g }, ...b, children: [e ? e(m) : m, c ? c(v) : v] });
|
|
2426
2426
|
}));
|
|
2427
2427
|
var qr, Xr;
|
|
@@ -2454,30 +2454,30 @@ fi.displayName = "WorkbookToolbars", (function() {
|
|
|
2454
2454
|
qr = function(u, x, w) {
|
|
2455
2455
|
var m, f, y, v, S, C, k = 0, E = !1, T = !1, M = !0;
|
|
2456
2456
|
if (typeof u != "function") throw new TypeError("Expected a function");
|
|
2457
|
-
function R(
|
|
2458
|
-
var P = m,
|
|
2459
|
-
return m = f = void 0, k =
|
|
2457
|
+
function R(L) {
|
|
2458
|
+
var P = m, $ = f;
|
|
2459
|
+
return m = f = void 0, k = L, v = u.apply($, P);
|
|
2460
2460
|
}
|
|
2461
|
-
function D(
|
|
2462
|
-
var P =
|
|
2463
|
-
return C === void 0 || P >= x || P < 0 || T &&
|
|
2461
|
+
function D(L) {
|
|
2462
|
+
var P = L - C;
|
|
2463
|
+
return C === void 0 || P >= x || P < 0 || T && L - k >= y;
|
|
2464
2464
|
}
|
|
2465
2465
|
function N() {
|
|
2466
|
-
var
|
|
2467
|
-
if (D(
|
|
2466
|
+
var L = b();
|
|
2467
|
+
if (D(L)) return j(L);
|
|
2468
2468
|
S = setTimeout(N, (function(P) {
|
|
2469
|
-
var
|
|
2470
|
-
return T ? g(
|
|
2471
|
-
})(
|
|
2469
|
+
var $ = x - (P - C);
|
|
2470
|
+
return T ? g($, y - (P - k)) : $;
|
|
2471
|
+
})(L));
|
|
2472
2472
|
}
|
|
2473
|
-
function
|
|
2474
|
-
return S = void 0, M && m ? R(
|
|
2473
|
+
function j(L) {
|
|
2474
|
+
return S = void 0, M && m ? R(L) : (m = f = void 0, v);
|
|
2475
2475
|
}
|
|
2476
2476
|
function F() {
|
|
2477
|
-
var
|
|
2478
|
-
if (m = arguments, f = this, C =
|
|
2479
|
-
if (S === void 0) return (function(
|
|
2480
|
-
return k =
|
|
2477
|
+
var L = b(), P = D(L);
|
|
2478
|
+
if (m = arguments, f = this, C = L, P) {
|
|
2479
|
+
if (S === void 0) return (function($) {
|
|
2480
|
+
return k = $, S = setTimeout(N, x), E ? R($) : v;
|
|
2481
2481
|
})(C);
|
|
2482
2482
|
if (T) return S = setTimeout(N, x), R(C);
|
|
2483
2483
|
}
|
|
@@ -2486,7 +2486,7 @@ fi.displayName = "WorkbookToolbars", (function() {
|
|
|
2486
2486
|
return x = s(x) || 0, p(w) && (E = !!w.leading, y = (T = "maxWait" in w) ? d(s(w.maxWait) || 0, x) : y, M = "trailing" in w ? !!w.trailing : M), F.cancel = function() {
|
|
2487
2487
|
S !== void 0 && clearTimeout(S), k = 0, m = C = f = S = void 0;
|
|
2488
2488
|
}, F.flush = function() {
|
|
2489
|
-
return S === void 0 ? v :
|
|
2489
|
+
return S === void 0 ? v : j(b());
|
|
2490
2490
|
}, F;
|
|
2491
2491
|
};
|
|
2492
2492
|
})();
|
|
@@ -2603,9 +2603,9 @@ var st = { DOM_UNAVAILABLE_ERROR: "DOM is unavailable server-side. Please use th
|
|
|
2603
2603
|
t && document.removeEventListener(t, a);
|
|
2604
2604
|
} };
|
|
2605
2605
|
const kc = (n) => {
|
|
2606
|
-
const { workbook: a, workbookElement: t, target: e, commands: r, darkMode: l } = n, c = sn(), [h, i] = V(a?.getSelectedSheet()), [d, g] = V(a?.getSheets().getItems()), b = fa(), p =
|
|
2606
|
+
const { workbook: a, workbookElement: t, target: e, commands: r, darkMode: l } = n, c = sn(), [h, i] = V(a?.getSelectedSheet()), [d, g] = V(a?.getSheets().getItems()), b = fa(), p = z(() => [new We("activateTask", e, { label: "Activate Task", description: "Activate Task Pane.", shortcut: { key: "F6" } }), new We("workbookStatistics", e, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [fe.Ctrl, fe.Shift] } }), new We("workbookStatistics", e, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [fe.Ctrl, fe.Shift] } }), new We("showFormat", e, { label: "Show Format", description: "Open the format pane.", shortcut: { key: "F", modifiers: [fe.Ctrl, fe.Shift] } }), new be("newCellStyle", e, { label: "New Cell Style…", scopedLabels: { cellStyle: "New Cell Style" }, description: "Create a new named style can can be quickly used later.", icon: "NewPresetStyles" }), new be("deleteCellStyle", e, { label: "Delete Cell Style", scopedLabels: { cellStyle: "Delete" }, description: "Remove a named style that is no longer needed." }), new be("modifyCellStyle", e, { label: "Modify Cell Style", scopedLabels: { cellStyle: "Modify" }, description: "Update a style with the currently style." }), new We("find", e, { label: "Find", description: "Open the Find window.", icon: "Find", shortcut: [{ key: "F", modifiers: [fe.Ctrl] }, { key: "F5", modifiers: [fe.Shift] }] }), new We("findReplace", e, { label: "Find & Replace", description: "Open the Find & Replace window.", icon: "FindReplace", shortcut: [{ key: "H", modifiers: [fe.Ctrl] }, { key: "H", modifiers: [fe.Ctrl, fe.Alt] }] }), new We("goto", e, { label: "Go To", description: "Open the 'Go To' window.", icon: "GoTo", shortcut: [{ key: "G", modifiers: [fe.Ctrl] }] }), new We("workbookViewToggleExpandFormulaBar", e, { label: "Toggle Expand Formula bar", description: "Expand or collapse the formula bar.", shortcut: { key: "U", modifiers: [fe.Ctrl, fe.Shift] } }), new We("workbookViewToggleShowFormulaBar", e, { label: "View Formula bar", scopedLabels: { view: "Formula Bar" }, description: "Show or hide the formula bar." }), new We("workbookViewToggleShowTabs", e, { label: "View Sheet Tabs", description: "Show or hide the sheet tabs.", scopedLabels: { view: "Sheet Tabs" } }), new We("workbookViewToggleShowStatusBar", e, { label: "View Status Bar", description: "Show or hide the status bar.", scopedLabels: { view: "Status Bar" } }), new We("workbookViewToggleShowHorizontalScrollBar", e, { label: "View Horizontal Scrollbar", description: "Show or hide the horizontal scrollbar.", scopedLabels: { view: "Horizontal Scrollbar" } }), new We("workbookViewToggleShowVerticalScrollBar", e, { label: "View Vertical Scrollbar", description: "Show or hide the vertical scrollbar.", scopedLabels: { view: "Vertical Scrollbar" } }), new be("hideSheet", e, { label: "Hide Sheet", scopedLabels: { sheet: "Hide" }, description: "Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs.", icon: "VisibilityOff" }), new be("deleteSheet", e, { label: "Delete Sheet", scopedLabels: { sheet: "Delete" }, description: "Delete the sheet and all the data." }), new be("addSheet", e, { label: "Insert Sheet", scopedLabels: { sheet: "Insert" }, description: "Insert sheet before the current sheet.", shortcut: [{ key: "F11", modifiers: [fe.Shift] }, { key: "F1", modifiers: [fe.Alt, fe.Shift] }] }), new be("duplicateSheet", e, { label: "Duplicate Sheet", description: "Duplicate the current sheet.", scopedLabels: { sheet: "Duplicate" } }), new be("nextSheet", e, { label: "Next Sheet", scopedLabels: { sheet: "Next" }, description: "Activate the next sheet.", shortcut: [{ key: "PageDown", modifiers: [fe.Ctrl] }] }), new be("previousSheet", e, { label: "Previous Sheet", scopedLabels: { sheet: "Previous" }, description: "Activate the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [fe.Ctrl] }] }), new be("selectNextSheet", e, { label: "Select Next Sheet", scopedLabels: { sheet: "Select Next" }, description: "Select the next sheet.", shortcut: [{ key: "PageDown", modifiers: [fe.Ctrl, fe.Shift] }] }), new be("selectPreviousSheet", e, { label: "Select Previous Sheet", scopedLabels: { sheet: "Select Previous" }, description: "Select the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [fe.Ctrl, fe.Shift] }] }), new be("selectTheme", e, { label: "Theme", description: "Select a theme that coveys a style suitable for your data." }), new be("selectNamed", e, { label: (T) => T?.getName() ?? "Select Named Item", scopedLabels: { namedItem: (T) => T?.getName() ?? "Select" }, description: "Select the item." }), new be("addNamedReference", e, { label: "Define Named Reference", scopedLabels: { namedItem: "Define Name…" }, description: "Add a new named reference. Names can be used as a substitute for cell references.", icon: "InsertNamedRange" }), new be("editNamedReference", e, { label: "Edit Named Reference…", scopedLabels: { namedItem: "Edit…" }, description: "Add a new named reference. Names can be used as a substitute for cell references.", icon: "NamedRangeEdit" }), new be("deleteNamedReference", e, { label: "Delete Named Reference", scopedLabels: { namedItem: "Delete" }, description: "Remove the named reference.", icon: "DeleteNamedRange" }), new We("activeNameBox", e, { label: "Activate Name Box", description: "Move the focus to the name box.", shortcut: { key: "F3", modifiers: [fe.Alt] } }), new We("createNamedReferenceFromSelection", e, { label: "Create from Selection", description: "Automatically generate names from the selected cells.", shortcut: { key: "F3", modifiers: [fe.Ctrl, fe.Shift] } }), new We("activeNameManager", e, { label: "Activate Name Manager", description: `Create, edit, delete, and find all the names used in the workbook.
|
|
2607
2607
|
|
|
2608
|
-
Names can be used as a substitute for cell references.`, shortcut: { key: "F3", modifiers: [fe.Ctrl] } }), new be("fullScreenToggle", e, { label: "FullScreen", description: "Toggle showing the workbook using the full screen.", shortcut: { key: "F11" }, icon: "FullScreen" }), new be("showScriptEditor", e, { label: "Scripts", scopedLabels: { scripts: "Script Editor…" }, description: "Show the script editor.", icon: "ScriptRun", shortcut: [{ key: "F11", modifiers: [fe.Alt] }] }), new be("executeScript", e, { label: "Run Script", description: "Run the selected or last executed script.", icon: "ScriptRun", shortcut: { key: "F8" } }), new be("executeSelectedScript", e, { label: "Run Script", description: "Run the selected script.", icon: "ScriptRun", shortcut: { key: "F8" } }), new be("saveScripts", e, { label: "Save Script", description: "Save the current scripts.", icon: "ScriptSave" }), new be("maximumWorkbookToggle", e, { label: "Maximize", description: "Toggle showing the workbook maximized.", shortcut: { key: "F10", modifiers: [fe.Ctrl] } }), new be("spellCheck", e, { label: "Spell Check", description: "Check the workbook for spelling mistakes.", shortcut: { key: "F7" } }), new be("calculateAll", e, { label: "Calculate Now", description: "Recalculate all formulas.", icon: "Calculate", shortcut: { key: "F9" } })], []), s =
|
|
2608
|
+
Names can be used as a substitute for cell references.`, shortcut: { key: "F3", modifiers: [fe.Ctrl] } }), new be("fullScreenToggle", e, { label: "FullScreen", description: "Toggle showing the workbook using the full screen.", shortcut: { key: "F11" }, icon: "FullScreen" }), new be("showScriptEditor", e, { label: "Scripts", scopedLabels: { scripts: "Script Editor…" }, description: "Show the script editor.", icon: "ScriptRun", shortcut: [{ key: "F11", modifiers: [fe.Alt] }] }), new be("executeScript", e, { label: "Run Script", description: "Run the selected or last executed script.", icon: "ScriptRun", shortcut: { key: "F8" } }), new be("executeSelectedScript", e, { label: "Run Script", description: "Run the selected script.", icon: "ScriptRun", shortcut: { key: "F8" } }), new be("saveScripts", e, { label: "Save Script", description: "Save the current scripts.", icon: "ScriptSave" }), new be("maximumWorkbookToggle", e, { label: "Maximize", description: "Toggle showing the workbook maximized.", shortcut: { key: "F10", modifiers: [fe.Ctrl] } }), new be("spellCheck", e, { label: "Spell Check", description: "Check the workbook for spelling mistakes.", shortcut: { key: "F7" } }), new be("calculateAll", e, { label: "Calculate Now", description: "Recalculate all formulas.", icon: "Calculate", shortcut: { key: "F9" } })], []), s = z(() => {
|
|
2609
2609
|
let T = null;
|
|
2610
2610
|
return T = r ? r.createChildGroup(e, "workbook", !1) : new Xn(e, "workbook"), T.addCommands(p, !0), T;
|
|
2611
2611
|
}, [r, p]), u = ln(), x = ne.useRef(null), w = Z(() => {
|
|
@@ -2618,24 +2618,24 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2618
2618
|
});
|
|
2619
2619
|
const N = s.getCommand("executeSelectedScript");
|
|
2620
2620
|
if (!N) return;
|
|
2621
|
-
const
|
|
2622
|
-
let
|
|
2623
|
-
const
|
|
2621
|
+
const j = { saveSource: async (F) => {
|
|
2622
|
+
let L = null, P = null;
|
|
2623
|
+
const $ = a.getScripts();
|
|
2624
2624
|
try {
|
|
2625
|
-
F && (P = await c.showBusy("Saving Scripts..."),
|
|
2625
|
+
F && (P = await c.showBusy("Saving Scripts..."), L = await $.createModule({ source: F })), $.addModule("scripts", L, { replace: !0 }), P?.();
|
|
2626
2626
|
} catch (te) {
|
|
2627
2627
|
P?.(), console.warn("Unable to compile", te), c.showError(te);
|
|
2628
2628
|
}
|
|
2629
|
-
return
|
|
2629
|
+
return L;
|
|
2630
2630
|
}, addContainerListener: (F) => (m.current = F, () => {
|
|
2631
2631
|
m.current = null;
|
|
2632
2632
|
}), setSelectedFunction: (F) => {
|
|
2633
|
-
T = F ?? x.current ?? null, Promise.resolve(T).then((
|
|
2634
|
-
N.update({ disabled:
|
|
2633
|
+
T = F ?? x.current ?? null, Promise.resolve(T).then((L) => {
|
|
2634
|
+
N.update({ disabled: L === null });
|
|
2635
2635
|
});
|
|
2636
2636
|
}, quickInsertFunction: (F) => {
|
|
2637
|
-
const
|
|
2638
|
-
u.setMode((
|
|
2637
|
+
const L = `=${F.toUpperCase()}(`, P = { text: L + ")", editMode: !0, initialSelection: { start: L.length, end: L.length + 0 } };
|
|
2638
|
+
u.setMode(($) => $?.key === "edit" ? { ...$, args: { ...$.args } } : { key: "edit", args: { stateAndCoords: null, start: P } });
|
|
2639
2639
|
}, getSelectedFunction: () => T, setEditor: (F) => {
|
|
2640
2640
|
M = F ?? null, D.update({ state: M !== null });
|
|
2641
2641
|
}, getEditor: () => M, getRanges: (F) => {
|
|
@@ -2645,7 +2645,7 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2645
2645
|
}
|
|
2646
2646
|
return null;
|
|
2647
2647
|
}, getScripts: () => a.getScripts() };
|
|
2648
|
-
N.update({ context:
|
|
2648
|
+
N.update({ context: j });
|
|
2649
2649
|
}, [s, a, t, c]), m = ne.useRef(null);
|
|
2650
2650
|
je(a, { onBeforeSave: async () => {
|
|
2651
2651
|
await m.current?.onBeforeSave();
|
|
@@ -2664,7 +2664,7 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2664
2664
|
w();
|
|
2665
2665
|
} });
|
|
2666
2666
|
const { isFullscreenAvailable: f, isFullscreenEnabled: y, toggleFullscreen: v } = (function(T = {}) {
|
|
2667
|
-
const { target: M, onChange: R, onError: D, requestFullScreenOptions: N } = T, [
|
|
2667
|
+
const { target: M, onChange: R, onError: D, requestFullScreenOptions: N } = T, [j, F] = V(!1), [L, P] = V(null), [$, te] = V(!1), de = _(() => st.requestFullscreen(M?.current || null, N), [M, N]), se = _(() => st.exitFullscreen(), []), A = _(() => st.fullscreenElement ? se() : de(), [de, se]), H = _((oe) => {
|
|
2668
2668
|
const Y = st.fullscreenElement;
|
|
2669
2669
|
P(Y), te(!!Y), R?.(oe);
|
|
2670
2670
|
}, [R]), ie = _((oe) => {
|
|
@@ -2675,7 +2675,7 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2675
2675
|
F(st.fullscreenEnabled);
|
|
2676
2676
|
}, []), le(() => (st.on("change", H), st.on("error", ie), () => {
|
|
2677
2677
|
st.off("change", H), st.off("error", ie);
|
|
2678
|
-
}), [H, ie]), { isFullscreenAvailable:
|
|
2678
|
+
}), [H, ie]), { isFullscreenAvailable: j, fullscreenElement: L, isFullscreenEnabled: $, enableFullscreen: de, disableFullscreen: se, toggleFullscreen: A };
|
|
2679
2679
|
})({ target: { current: t ?? document.body } }), S = ba();
|
|
2680
2680
|
le(() => {
|
|
2681
2681
|
s.getCommand("selectTheme").update({ state: () => a.getTheme(), context: () => ({ theme: a.getTheme(), themes: S, darkMode: l }) });
|
|
@@ -2712,8 +2712,8 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2712
2712
|
} catch (F) {
|
|
2713
2713
|
D = F.message;
|
|
2714
2714
|
}
|
|
2715
|
-
let N = a.getStyles().getNamed(M),
|
|
2716
|
-
return
|
|
2715
|
+
let N = a.getStyles().getNamed(M), j = D;
|
|
2716
|
+
return !j && N && (j = `Update style '${N.getName()}'.`), { valid: D === null, message: j };
|
|
2717
2717
|
} }).then(({ input: M, option: R }) => {
|
|
2718
2718
|
const D = a.getSelectedSheet().getSelectedRange();
|
|
2719
2719
|
if (R !== "Ok") return;
|
|
@@ -2752,29 +2752,29 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2752
2752
|
T?.replace && !T?.replaceOptions?.maxCount && (D = "Replace All");
|
|
2753
2753
|
const N = await c.showBusy(D);
|
|
2754
2754
|
try {
|
|
2755
|
-
const
|
|
2755
|
+
const j = T?.scope ?? "sheet";
|
|
2756
2756
|
let F = null;
|
|
2757
|
-
const
|
|
2758
|
-
if (F =
|
|
2759
|
-
const
|
|
2760
|
-
M =
|
|
2757
|
+
const L = a.getSelectedSheet(), P = { from: L.getSelectedCell(), ...T.findOptions };
|
|
2758
|
+
if (F = j === "sheet" ? a.getSelectedSheet().find(P) : a.find(P), T.replace) {
|
|
2759
|
+
const $ = a.replace(F, T.replaceText, T.replaceOptions);
|
|
2760
|
+
M = $.count, T.replaceOptions.maxCount && (R = $.last);
|
|
2761
2761
|
} else {
|
|
2762
|
-
let
|
|
2763
|
-
|
|
2762
|
+
let $ = F.next();
|
|
2763
|
+
$.done || (M++, R = $.value);
|
|
2764
2764
|
}
|
|
2765
2765
|
R?.select({ autoFocus: !1 }), N?.(), !T.replaceOptions.maxCount && M > 1 && c.showMessage(`We replaced ${M} cells.`);
|
|
2766
|
-
} catch (
|
|
2767
|
-
N?.(), c.showError(
|
|
2766
|
+
} catch (j) {
|
|
2767
|
+
N?.(), c.showError(j);
|
|
2768
2768
|
}
|
|
2769
2769
|
return M;
|
|
2770
2770
|
}, [a, t]), E = Z((T) => {
|
|
2771
2771
|
const M = { selection: () => {
|
|
2772
|
-
const D = a.getSelectedRanges(), N = D.getCount(),
|
|
2772
|
+
const D = a.getSelectedRanges(), N = D.getCount(), j = new Array(N);
|
|
2773
2773
|
for (let F = 0; F < N; F++) {
|
|
2774
|
-
const
|
|
2775
|
-
|
|
2774
|
+
const L = D.at(F).getFixed(!0).getCoords();
|
|
2775
|
+
j[F] = L;
|
|
2776
2776
|
}
|
|
2777
|
-
return a.getRanges(
|
|
2777
|
+
return a.getRanges(j);
|
|
2778
2778
|
}, getNames: () => a.getNames() }, R = { initialValue: T, context: () => M, onInput: async (D) => {
|
|
2779
2779
|
try {
|
|
2780
2780
|
await D.select();
|
|
@@ -2858,10 +2858,10 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2858
2858
|
const { movable: t, commands: e, disabled: r, sx: l, floatReference: c, ...h } = n;
|
|
2859
2859
|
je(t, { onAnyChange(s) {
|
|
2860
2860
|
} });
|
|
2861
|
-
const i =
|
|
2861
|
+
const i = z(() => ({}), []), d = z(() => ({ commandHook: { beforeExecute: (s, u) => c.closeAll(), onExecute() {
|
|
2862
2862
|
}, onError() {
|
|
2863
2863
|
console.log("onError");
|
|
2864
|
-
} }, disabled: r, parentFloat: c }), [r, c]), g =
|
|
2864
|
+
} }, disabled: r, parentFloat: c }), [r, c]), g = z(() => ({ variant: re.Menuitem, ...i, ...d }), [i, d]), b = z(() => ({ commands: e, variant: re.Menuitem, parentFloat: c, ...d }), [e, d, c]), p = I(ae, { children: [o(Qn, { command: e.getCommand("copy"), ...g, variant: re.Menuitem }), [], o(Q, { orientation: "horizontal" }), o(qe, { ...b, popupCommandKeys: ["moveToFront", "moveForward"], quickCommand: "moveToFront" }), o(qe, { ...b, popupCommandKeys: ["moveToBack", "moveBackward"], quickCommand: "moveToBack" }), o(Q, { orientation: "horizontal" }), o(B, { ...g, command: e.getCommand("toggleLockAspectRatio") }), o(Q, { orientation: "horizontal" }), o(qe, { ...b, popupCommandKeys: ["formatDrawAlignLeft", "formatDrawAlignCenter", "formatDrawAlignRight", null, "formatDrawAlignTop", "formatDrawAlignMiddle", "formatDrawAlignBottom", null, "formatDrawDistributeHorz", "formatDrawDistributeVert"], label: "Align", icon: "DrawAlignLeft", tooltip: "Quickly change the placement of your drawings." }), o(Q, { orientation: "horizontal" }), o(qe, { ...b, popupCommandKeys: ["formatAnchorTypeTwoCell", "formatAnchorTypeOneCell", "formatAnchorTypeAbsolute"], label: "Sizing", icon: "DrawResize", tooltip: "Determine how the drawing size will adjust as the cell sizes adjust." }), []] });
|
|
2865
2865
|
return o(O, { ref: a, sx: { paddingTop: "4px", paddingBottom: "4px", ...l }, ...h, children: p });
|
|
2866
2866
|
}));
|
|
2867
2867
|
bi.displayName = "MovableContextMenu";
|
|
@@ -2874,27 +2874,27 @@ const xi = U(X((n, a) => {
|
|
|
2874
2874
|
}, onProtectionChange: (G) => {
|
|
2875
2875
|
R(G?.getProtection());
|
|
2876
2876
|
} });
|
|
2877
|
-
const D = h || !M.isStructureAllowed(), N =
|
|
2877
|
+
const D = h || !M.isStructureAllowed(), N = z(() => {
|
|
2878
2878
|
const G = [];
|
|
2879
2879
|
for (let W = 0; W < E.length; W++) G.push(E[W].getName());
|
|
2880
2880
|
return G;
|
|
2881
|
-
}, [E]),
|
|
2881
|
+
}, [E]), j = _((G) => {
|
|
2882
2882
|
r?.(G) !== !1 && (t.getSheetAt(G).select(), l?.(G));
|
|
2883
2883
|
}, [t, r, l]), F = _((G, W) => {
|
|
2884
2884
|
t.getSheetAt(G).setName(W), l?.(G);
|
|
2885
|
-
}, [t, l]),
|
|
2885
|
+
}, [t, l]), L = _((G, W) => {
|
|
2886
2886
|
t.getSheetAt(G).setPosition(W), l?.(W);
|
|
2887
2887
|
}, [t, l]), P = Z(() => {
|
|
2888
2888
|
if (r?.(C) === !1) return;
|
|
2889
2889
|
const G = C + 1;
|
|
2890
2890
|
t.getSheets().add({ name: void 0, autoSelect: !0 }), l?.(G);
|
|
2891
|
-
}, [t, r, l, C]),
|
|
2891
|
+
}, [t, r, l, C]), $ = z(() => ({ placement: "top-start" }), []), te = xe(null), [de, se] = V(!1), A = _((G) => {
|
|
2892
2892
|
const { closeFloatAll: W, floatReference: J } = G;
|
|
2893
2893
|
return b({ workbook: t, gridStyle: v, floatReference: J, closeFloatAll: W, ...g });
|
|
2894
|
-
}, [b, g, c, t, v]), { reference: H, component: ie } = ao({ label: "allSheet", propsPopper:
|
|
2894
|
+
}, [b, g, c, t, v]), { reference: H, component: ie } = ao({ label: "allSheet", propsPopper: $, anchor: te.current, onOpen: () => se(!0), onClose: () => se(!1), createPopupPanel: A }), oe = xe(null), [Y, K] = V(null), pe = _((G) => {
|
|
2895
2895
|
const { floatReference: W } = G;
|
|
2896
2896
|
return d?.({ workbook: t, index: Y?.index, tabStripRef: oe.current, commands: e, disabled: c, floatReference: W, ...i });
|
|
2897
|
-
}, [d, i, c, t, e, Y]), { reference: Me, component: Te } = ao({ label: "sheetTab", propsPopper:
|
|
2897
|
+
}, [d, i, c, t, e, Y]), { reference: Me, component: Te } = ao({ label: "sheetTab", propsPopper: $, anchor: { getBoundingClientRect: () => new DOMRect(Y?.left || 0, Y?.top || 0, 0, 0) }, onClose: () => K(null), createPopupPanel: pe });
|
|
2898
2898
|
le(() => {
|
|
2899
2899
|
Y ? Me.open(0) : Me.close(0);
|
|
2900
2900
|
}, [Y]);
|
|
@@ -2907,12 +2907,12 @@ const xi = U(X((n, a) => {
|
|
|
2907
2907
|
} catch {
|
|
2908
2908
|
}
|
|
2909
2909
|
return W ? (s ?? Ic)({ sheet: W, gridTheme: y, onContextMenu: (J) => {
|
|
2910
|
-
|
|
2910
|
+
j(G.index), Ie(J, G.index);
|
|
2911
2911
|
}, ...G, ...p }) : null;
|
|
2912
|
-
}, [s, p, t, y]), ue =
|
|
2912
|
+
}, [s, p, t, y]), ue = z(() => D ? null : o(Et, { disableInteractive: !0, title: "New sheet", children: o(ct, { disabled: c, component: "div", sx: { padding: "0", "&:hover:not([disabled])": { color: (G) => G.palette.primary.main }, color: (G) => G.palette.text.icon ?? G.palette.action.active, "& svg": { width: "18px", height: "18px" } }, "aria-label": "addTab", size: "small", onMouseDown: (G) => {
|
|
2913
2913
|
G.button === 0 && G.preventDefault();
|
|
2914
2914
|
}, onClick: () => P(), children: o(ye, { iconKey: "AddCircle" }) }) }), [c, D, P]);
|
|
2915
|
-
return I(O, { ref: a, className: Re(x), sx: { position: "relative", display: "flex", alignItems: "stretch", flex: "1 1 100%", maxWidth: "100%", ...w }, ...S, children: [o(Ml, { ref: oe, selectedTabIndex: C, tabNames: N, onSelectedTabIndexChange:
|
|
2915
|
+
return I(O, { ref: a, className: Re(x), sx: { position: "relative", display: "flex", alignItems: "stretch", flex: "1 1 100%", maxWidth: "100%", ...w }, ...S, children: [o(Ml, { ref: oe, selectedTabIndex: C, tabNames: N, onSelectedTabIndexChange: j, onTabNameChange: F, onTabMove: L, background: u, borderColor: f, borderWidth: m, activeColor: null, disabled: c, disableDrag: D, renderScrollButtonStart: ts, renderScrollButtonEnd: es, renderScrollButtonEdge: Jl, renderTabButton: me, renderTabDivider: (G) => {
|
|
2916
2916
|
const { key: W, ...J } = G;
|
|
2917
2917
|
return o(Q, { sx: { marginLeft: "-1px", marginRight: "0px", marginTop: "6px", marginBottom: "6px", background: (Ce) => Se(Ce.palette.divider, 0.25) }, ...J }, W);
|
|
2918
2918
|
}, propsEditLabel: { readOnly: D, maxLength: 31, styleHover: { fontWeight: "700" }, onKeyPress: (G) => {
|
|
@@ -2935,10 +2935,10 @@ const yi = U(X((n, a) => {
|
|
|
2935
2935
|
} }), Ae(e, [], { onChange: () => {
|
|
2936
2936
|
g();
|
|
2937
2937
|
} });
|
|
2938
|
-
const m =
|
|
2938
|
+
const m = z(() => ({}), []), f = z(() => ({ commandHook: { beforeExecute: (D, N) => c.closeAll(), onExecute() {
|
|
2939
2939
|
}, onError() {
|
|
2940
2940
|
console.log("onError");
|
|
2941
|
-
} }, disabled: r, scope: "contextMenu", parentFloat: c }), [r, c]), y =
|
|
2941
|
+
} }, disabled: r, scope: "contextMenu", parentFloat: c }), [r, c]), y = z(() => ({ ...m, ...f, variant: re.Menuitem }), [m, f]), v = z(() => ({ commands: e, variant: re.Menuitem, parentFloat: c, ...f }), [e, f, c]), S = [];
|
|
2942
2942
|
let C = s.isEntireRows(), k = s.isEntireColumns();
|
|
2943
2943
|
s && (C && (S.push(o(Q, { orientation: "horizontal" }, "context:" + S.length)), S.push(De(B, { command: e.getCommand("hideColumns"), ...y, key: "context:" + S.length })), S.push(De(B, { command: e.getCommand("unhideColumns"), ...y, key: "context:" + S.length }))), k && (S.push(o(Q, { orientation: "horizontal" }, "context:" + S.length)), S.push(De(B, { command: e.getCommand("hideRows"), ...y, key: "context:" + S.length })), S.push(De(B, { command: e.getCommand("unhideRows"), ...y, key: "context:" + S.length }))), (C || k) && S.push(o(Q, { orientation: "horizontal" }, "context:" + S.length)), C && (S.push(De(B, { command: e.getCommand("autoFitColumns"), ...y, key: "context:" + S.length })), S.push(De(B, { ...y, command: e.getCommand("resizeColumns"), key: "context:" + S.length }))), k && (S.push(De(B, { command: e.getCommand("autoFitRows"), ...y, key: "context:" + S.length })), S.push(De(B, { ...y, command: e.getCommand("resizeRows"), key: "context:" + S.length }))));
|
|
2944
2944
|
const E = [], T = e.getCommand("formatTableStyle"), M = T?.getContext()?.table();
|
|
@@ -2960,9 +2960,9 @@ const yi = U(X((n, a) => {
|
|
|
2960
2960
|
}));
|
|
2961
2961
|
yi.displayName = "WorkbookContextMenu";
|
|
2962
2962
|
const Ec = (n) => o(bi, { ...n }), Dc = (n) => o(yi, { ...n }), Rc = (n) => o(Ga, { ...n }), Mc = (n) => o(Ka, { ...n }), Jn = (n) => o(Po, { transitionDelay: "160ms", transparentBackground: !0, ...n }), Nc = (n) => o(os, { fullscreen: !0, ...n }), Pc = (n) => o(Nl, { ...n }), Fc = (n) => o(Ha, { ...n }), Oc = (n) => o(xi, { ...n }), Bc = (n) => o(Qa, { ...n }), Ac = (n) => o(Ja, { ...n }), Ic = (n) => o(Za, { ...n }), Lc = { fireOnModelChange: !1 }, ta = { flex: "1 1 100%", display: "flex", boxSizing: "border-box" }, wi = U(X((n, a) => {
|
|
2963
|
-
const { workbook: t, onElementLoad: e, autoFocus: r = !1, style: l, className: c, onFocus: h, onBlur: i, onKeyDown: d, onRepeatCommandChange: g, commands: b, showFormulaBar: p, propsFormulaBar: s, renderFormulaBar: u = Mc, showTabs: x, propsTabs: w, renderTabs: m = Oc, showStatusBar: f, propsStatusBar: y, renderStatusBar: v = Fc, propsToolbar: S, renderToolbar: C = gi, propsContextMenu: k, renderContextMenu: E = Dc, renderFilterMenu: T = Rc, renderMovableMenu: M = Ec, renderLoading: R = Jn, propsLoading: D, propsSheet: N, renderSheet:
|
|
2963
|
+
const { workbook: t, onElementLoad: e, autoFocus: r = !1, style: l, className: c, onFocus: h, onBlur: i, onKeyDown: d, onRepeatCommandChange: g, commands: b, showFormulaBar: p, propsFormulaBar: s, renderFormulaBar: u = Mc, showTabs: x, propsTabs: w, renderTabs: m = Oc, showStatusBar: f, propsStatusBar: y, renderStatusBar: v = Fc, propsToolbar: S, renderToolbar: C = gi, propsContextMenu: k, renderContextMenu: E = Dc, renderFilterMenu: T = Rc, renderMovableMenu: M = Ec, renderLoading: R = Jn, propsLoading: D, propsSheet: N, renderSheet: j = Pc, wrapperMain: F, showHorizontalScrollbar: L, showVerticalScrollbar: P, gridTheme: $, headersTheme: te, enableDarkImages: de, ...se } = n;
|
|
2964
2964
|
if (!t) throw new Error("IWorkbook must be provided.");
|
|
2965
|
-
const A =
|
|
2965
|
+
const A = et(), H = xe(null), [ie, oe] = V(!1), Y = xe(null), K = z(() => o(O, { className: "sheetxl-viewport", sx: { width: "100%", height: "100%", boxSizing: "border-box", position: "absolute", pointerEvents: "none !important", "& > :first-of-type": { position: "relative" } }, ref: Y }), []), [pe, Me] = V(!1), [Te, Ie] = V(!1), me = _(() => {
|
|
2966
2966
|
Me(!0);
|
|
2967
2967
|
}, []), ue = xe(null), G = Rt(a, () => ({ isWorkbookElement: () => !0, getWorkbook: () => t, getSheetElement: () => H.current, getViewportElement: () => Y.current, getFormulaBarElement: () => ue.current, focus() {
|
|
2968
2968
|
H && H.current && H.current.focus();
|
|
@@ -2986,11 +2986,11 @@ const Ec = (n) => o(bi, { ...n }), Dc = (n) => o(yi, { ...n }), Rc = (n) => o(Ga
|
|
|
2986
2986
|
H.current.getSheet() !== Ee && $e(!1), $e(!0);
|
|
2987
2987
|
}) : $e(!0);
|
|
2988
2988
|
}) }, Lc);
|
|
2989
|
-
const [
|
|
2989
|
+
const [Qe, Xe] = tn((q) => q + 1, 0), Ue = t.getView();
|
|
2990
2990
|
je(Ue, { onViewChange: (q) => {
|
|
2991
2991
|
Xe();
|
|
2992
2992
|
} });
|
|
2993
|
-
const ee =
|
|
2993
|
+
const ee = $ ?? A, we = z(() => Gr(A, ee), [A, ee]), Mt = te ?? A, un = z(() => Gr(A, Mt), [A, Mt]), [io, Bo] = V(null);
|
|
2994
2994
|
_(() => {
|
|
2995
2995
|
H.current.focus();
|
|
2996
2996
|
}, []);
|
|
@@ -3000,7 +3000,7 @@ const Ec = (n) => o(bi, { ...n }), Dc = (n) => o(yi, { ...n }), Rc = (n) => o(Ga
|
|
|
3000
3000
|
Yi(q), Xi($e), ar(Ee), Nt.current !== null && setTimeout(() => {
|
|
3001
3001
|
Nt.current !== null && Nt.current.update();
|
|
3002
3002
|
}, 160), nr(!0);
|
|
3003
|
-
}, []), [Bd, lr] = V("sheet"), Ft = x ?? Ue?.isShowTabs(), Ot =
|
|
3003
|
+
}, []), [Bd, lr] = V("sheet"), Ft = x ?? Ue?.isShowTabs(), Ot = L ?? Ue?.isShowHorizontalScrollbar(), Zi = p ?? Ue?.isShowFormulaBar(), Ao = f ?? Ue?.isShowStatusBar(), sr = P ?? Ue?.isShowVerticalScrollbar(), Gt = we?.header?.edgeStrokeFill || "rgb(171,171,171)", Qi = z(() => Ao ? v({ sheet: ge, gridStyle: we, ...y }) : null, [v, y, Ao, we, ge]), Ji = z(() => C({ commands: Le, workbook: G.current, ...S }), [Le, C, S, A]), [el, { width: hn }] = Vt(), Bt = hn === 0 || hn > 560, gn = z(() => {
|
|
3004
3004
|
if (!Ft) return null;
|
|
3005
3005
|
let q = m({ background: we.body.fill, borderWidth: 1, borderColor: Gt, gridTheme: ee, gridStyle: we, onBeforeUserChange: J, onUserChange: Ce, workbook: t, commands: Le, propsSheetTab: {}, ...w });
|
|
3006
3006
|
return Bt || (q = o("div", { style: { flex: "none", display: "flex" }, children: q })), q;
|
|
@@ -3018,7 +3018,7 @@ const Ec = (n) => o(bi, { ...n }), Dc = (n) => o(yi, { ...n }), Rc = (n) => o(Ga
|
|
|
3018
3018
|
_e = Ke;
|
|
3019
3019
|
}
|
|
3020
3020
|
return o(O, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: _e });
|
|
3021
|
-
}, [ge, J, t, we, ee, Le, Ft, Ot, Ao, Bt]), [ot, co] = ne.useState(null), tl =
|
|
3021
|
+
}, [ge, J, t, we, ee, Le, Ft, Ot, Ao, Bt]), [ot, co] = ne.useState(null), tl = z(() => ({ placement: "right-start", ...ot?.propsPopper }), [ot?.propsPopper]), { reference: dr, component: ol } = ao({ label: "contextMenu", propsPopper: tl, anchor: ot?.anchor ?? { getBoundingClientRect: () => new DOMRect(ot?.clientX || 0, ot?.clientY || 0) }, onClose: () => co(null), createPopupPanel: ot?.createPopupPanel });
|
|
3022
3022
|
le(() => {
|
|
3023
3023
|
ot ? dr.open(0) : dr.close(0);
|
|
3024
3024
|
}, [ot]);
|
|
@@ -3041,7 +3041,7 @@ const Ec = (n) => o(bi, { ...n }), Dc = (n) => o(yi, { ...n }), Rc = (n) => o(Ga
|
|
|
3041
3041
|
return M({ movable: Ee, commands: Le, floatReference: _e, ...k });
|
|
3042
3042
|
} });
|
|
3043
3043
|
}, [M, k, Le]);
|
|
3044
|
-
|
|
3044
|
+
z(() => {
|
|
3045
3045
|
const q = [new We("openContextMenu", () => H.current, { label: "Context Menu", description: "Open the context menu.", shortcut: [{ key: "F10", modifiers: [fe.Shift] }, { key: "ContextMenu" }] })];
|
|
3046
3046
|
Le.addCommands(q, !0);
|
|
3047
3047
|
}, [Le]), le(() => {
|
|
@@ -3072,7 +3072,7 @@ const Ec = (n) => o(bi, { ...n }), Dc = (n) => o(yi, { ...n }), Rc = (n) => o(Ga
|
|
|
3072
3072
|
le(() => {
|
|
3073
3073
|
r && H && H.current && H.current.focus();
|
|
3074
3074
|
}, []);
|
|
3075
|
-
const ur = xe(null), dl =
|
|
3075
|
+
const ur = xe(null), dl = z(() => o(In, { in: !Te, nodeRef: ur, timeout: 500, classNames: "animating", unmountOnExit: !0, children: o(O, { style: { display: "flex", alignItems: "center", justifyContent: "center", left: "0px", top: "0px", width: "100%", height: "100%", position: "absolute", boxSizing: "border-box", pointerEvents: Te ? "none" : l?.pointerEvents }, children: R?.({ ref: ur, ...D }) }) }), [Te, R, D]), pl = z(() => u({ ref: ue, sx: { marginTop: (q) => q.spacing(0.25), marginLeft: (q) => q.spacing(1), marginRight: (q) => q.spacing(1) }, workbook: t, sheetElement: H.current, gridStyle: we, onFocus: sl, ...s, propsNamedCollectionEditor: { restoreFocus: (q) => H.current.focus(q), ...s?.propsNamedCollectionEditor, propsCommandPopupButton: { commands: Le, ...s?.propsNamedCollectionEditor?.propsCommandPopupButton } } }), [u, s, t, we, Le, Te]), ul = _((q) => {
|
|
3076
3076
|
const { movable: Ee, ...$e } = q, _e = { movable: Ee, onContextMenuCapture: (Ye) => {
|
|
3077
3077
|
rl(Ye, Ee);
|
|
3078
3078
|
}, ...$e }, pt = Ee.getContent().getType();
|
|
@@ -3087,7 +3087,7 @@ const Ec = (n) => o(bi, { ...n }), Dc = (n) => o(yi, { ...n }), Rc = (n) => o(Ga
|
|
|
3087
3087
|
Ke = o(Ol, { ...Ye });
|
|
3088
3088
|
}
|
|
3089
3089
|
return o("div", { style: { position: "absolute", clipPath: "inset(0px)", display: "flex", alignItems: "stretch", justifyContent: "stretch", pointerEvents: "all" }, children: Ke }, Ee.getUUID());
|
|
3090
|
-
}, []), mr =
|
|
3090
|
+
}, []), mr = z(() => j({ ref: H, style: ta, onFocus: ll, gridStyle: we, headersStyle: un, sheet: ge, commands: Le, onSheetContextMenu: pr, onViewportChange: (q) => {
|
|
3091
3091
|
Bo(q);
|
|
3092
3092
|
}, showScrollbars: !1, viewportComponent: K, onRepeatCommandChange: g, onElementLoad: me, onShowColumnTooltip: (q) => {
|
|
3093
3093
|
so(q.anchor, q.display, uo.Top);
|
|
@@ -3097,12 +3097,12 @@ const Ec = (n) => o(bi, { ...n }), Dc = (n) => o(yi, { ...n }), Rc = (n) => o(Ga
|
|
|
3097
3097
|
so({ x: q.anchor.x, y: q.anchor.y, width: 0, height: 0 }, q.display, q.placement);
|
|
3098
3098
|
}, onCloseTooltip: () => mn(), renderMovable: ul, ...N, propsCellRender: { onFilterButtonMouseDown: (q, Ee) => {
|
|
3099
3099
|
N?.propsCellRender?.onFilterButtonMouseDown(q, Ee), nl(q, Ee);
|
|
3100
|
-
}, ...N?.propsCellRender } }), [Le, N, ge, we, g]), ml =
|
|
3100
|
+
}, ...N?.propsCellRender } }), [Le, N, ge, we, g]), ml = z(() => {
|
|
3101
3101
|
let q = o(us, { ref: el, style: ta, viewport: io, touchElement: H.current?.getGridElement()?.stage, onScrollViewport: (Ee) => {
|
|
3102
3102
|
H.current?.getGridElement()?.scrollTo(Ee);
|
|
3103
3103
|
}, showHorizontalScrollbar: Ot || Ft, showVerticalScrollbar: sr, renderScrollbarHorizontal: cr, renderScrollbarVertical: cl, children: mr });
|
|
3104
3104
|
return Bt || hn === 0 || (q = I(ae, { children: [q, gn] })), F ? F(q) : q;
|
|
3105
|
-
}, [Ot, Ft, cr, sr, io, Bt, mr, gn, A, F, ee]), hl =
|
|
3105
|
+
}, [Ot, Ft, cr, sr, io, Bt, mr, gn, A, F, ee]), hl = z(() => o(Et, { arrow: !0, disableInteractive: !0, open: Pt, title: o(Fe, { variant: "subtitle2", component: "div", children: rr }), placement: ir, slotProps: { transition: { timeout: { exit: 0 } }, popper: { popperRef: Nt, sx: { "& .MuiTooltip-tooltip": { padding: "2px 6px", "& .MuiTooltip-arrow": { display: Pt ? "visible" : "none" } } }, anchorEl: { getBoundingClientRect: () => new DOMRect(lo.x, lo.y, lo.width, lo.height) }, modifiers: [{ name: "offset", options: { offset: [0, 0] } }] } }, children: o(O, {}) }), [Pt, rr, ir, lo, Nt]), gl = z(() => ({ boxSizing: "border-box", background: (q) => q.palette.mode !== "dark" ? we.header.fill : q.palette.background.paper, "& *": { ...ns(A), fontWeight: 400 }, "& .viewport-overlay": { borderRight: `solid ${Gt} 1px` }, ...l }), [l, we]), fl = z(() => o(O, { sx: { marginBottom: (q) => q.spacing(0.75) } }), []), bl = z(() => ({ flex: "1 1 100%", width: "100%", display: "flex", flexDirection: "column", opacity: Te ? void 0 : 0, "--sxl-app-color-high-contrast": A.palette.primary.main, "--sxl-app-color-primary": A.palette.primary.main, "--sxl-app-color-primary-dark": A.palette.primary.dark, "--sxl-app-color-primary-light": A.palette.primary.light, "--sxl-app-color-info": A.palette.info.main, "--sxl-app-color-info-dark": A.palette.info.dark, "--sxl-app-color-info-light": A.palette.info.light, "--sxl-app-color-secondary": A.palette.secondary.main, "--sxl-app-color-secondary-dark": A.palette.secondary.dark, "--sxl-app-color-secondary-light": A.palette.secondary.light, "--sxl-app-color-success": A.palette.success.main, "--sxl-app-color-success-dark": A.palette.success.dark, "--sxl-app-color-success-light": A.palette.success.light, "--sxl-app-color-warning": A.palette.warning.main, "--sxl-app-color-warning-dark": A.palette.warning.dark, "--sxl-app-color-warning-light": A.palette.warning.light, "--sxl-app-color-error": A.palette.error.main, "--sxl-app-color-error-dark": A.palette.error.dark, "--sxl-app-color-error-light": A.palette.error.light, "--sxl-app-color-text": A.palette.text.primary, "--sxl-app-color-text-secondary": A.palette.text.secondary, "--sxl-app-color-text-disabled": A.palette.text.disabled, "--sxl-app-color-background": A.palette.background.paper, "--sxl-app-color-button-surface": A.palette.grey[600], "--sxl-app-color-shadow": A.palette.action.focus, "--sxl-app-color-grey": A.palette.grey[500], "--sxl-app-filter-dark-invert": we.body.darkMode && de ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", "--sxl-app-image-background": we.body.darkMode ? `linear-gradient(${Se("#fff", Be(5))}, ${Se("#fff", Be(5))})` : void 0 }), [we, A, Te]), xl = z(() => Re(qa), []);
|
|
3106
3106
|
return I(O, { className: Re("sheetxl-workbook", Tc, { "Mui-focusVisible": ie }, hc, c), sx: gl, style: l, ...se, ref: G, onFocus: (q) => {
|
|
3107
3107
|
oe(!0), il(), h?.(q);
|
|
3108
3108
|
}, onBlur: (q) => {
|
|
@@ -3121,7 +3121,7 @@ const zc = (n = !1, a = !1) => a ? null : { "& input:not(:focus):not(:hover)": {
|
|
|
3121
3121
|
return Tt(() => {
|
|
3122
3122
|
k(r !== u), m(r), x(r);
|
|
3123
3123
|
}, [r]), le(() => {
|
|
3124
|
-
C && y !== 0 &&
|
|
3124
|
+
C && y !== 0 && Je.debounce(() => {
|
|
3125
3125
|
k(!1);
|
|
3126
3126
|
}, 300)();
|
|
3127
3127
|
}, [C, y]), le(() => {
|
|
@@ -3147,12 +3147,12 @@ const No = U(X((n, a) => {
|
|
|
3147
3147
|
const m = t?.getContext();
|
|
3148
3148
|
let f = h ?? m?.quickColor;
|
|
3149
3149
|
d && !f && (f = new ft("transparent"));
|
|
3150
|
-
const y = s ?? m?.autoColor, v = u ?? m?.schemeLookup, S = x ?? m?.recentColors, C = g ?? m?.darkMode, k =
|
|
3150
|
+
const y = s ?? m?.autoColor, v = u ?? m?.schemeLookup, S = x ?? m?.recentColors, C = g ?? m?.darkMode, k = z(() => ({ autoColor: y, schemeLookup: v, recentColors: S, darkMode: C, ...w }), [y, v, S, C]), E = Z((M, R) => {
|
|
3151
3151
|
M && R && m?.addRecentColor && m.addRecentColor(M), m?.onColorSelect && m.onColorSelect(M), r?.(M, R), t?.execute(M, e);
|
|
3152
3152
|
}, [t, r, e, m]), T = _((M, R) => {
|
|
3153
|
-
const { children: D, title: N,
|
|
3153
|
+
const { children: D, title: N, ...j } = M;
|
|
3154
3154
|
let F = M.children;
|
|
3155
|
-
return (t?.disabled() || l) && (F = o("div", { children: F })), o(Kn, { command: t, placement: c === re.Toolbar ? "bottom-start" : "right-start", disabled: R,
|
|
3155
|
+
return (t?.disabled() || l) && (F = o("div", { children: F })), o(Kn, { command: t, placement: c === re.Toolbar ? "bottom-start" : "right-start", disabled: R, ...j, children: F });
|
|
3156
3156
|
}, [t, l]);
|
|
3157
3157
|
return o(Ma, { ref: a, propsPanel: k, icon: b ?? t?.getIcon(m), quickColor: f, selectedColor: t?.getState(), onSelectColor: E, variant: c === re.Menuitem ? rt.Menuitem : rt.Toolbar, createTooltip: T, label: t?.getLabel(), disabled: l || !t || t.disabled(), compareRGB: !0, darkMode: C, ...p });
|
|
3158
3158
|
}));
|
|
@@ -3192,7 +3192,7 @@ const Hc = U(X((n, a) => {
|
|
|
3192
3192
|
if (E) return M;
|
|
3193
3193
|
const R = r ? w?.getRedoDescriptions() : w?.getUndoDescriptions(), D = [];
|
|
3194
3194
|
for (let F = 0; F < R.length; F++) {
|
|
3195
|
-
const
|
|
3195
|
+
const L = R[F];
|
|
3196
3196
|
D.push(o(dt, { sx: { maxWidth: "360px", display: "flex" }, disabled: m, selected: F < f, icon: o(ye, {}), onMouseEnter: () => {
|
|
3197
3197
|
y(F + 1);
|
|
3198
3198
|
}, onMouseDown: (P) => {
|
|
@@ -3201,19 +3201,19 @@ const Hc = U(X((n, a) => {
|
|
|
3201
3201
|
P.button === 0 && T(F + 1);
|
|
3202
3202
|
}, onKeyDown: (P) => {
|
|
3203
3203
|
P.isDefaultPrevented() || P.keyCode !== he.Enter && P.keyCode !== he.Space || T(F + 1);
|
|
3204
|
-
}, children: I(O, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", alignItems: "center", overflow: "hidden" }, children: [o(Fe, { component: "div", children:
|
|
3204
|
+
}, children: I(O, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", alignItems: "center", overflow: "hidden" }, children: [o(Fe, { component: "div", children: L }), o(ye, {})] }) }, `action:${F}`));
|
|
3205
3205
|
}
|
|
3206
3206
|
let N = null;
|
|
3207
3207
|
if (!r && l) {
|
|
3208
3208
|
const F = { scope: "undo", commands: C, variant: re.Menuitem, parentFloat: S.floatReference };
|
|
3209
3209
|
N = [], N.push(o(vi, { ...F, quickCommand: "redo", isRedo: !0 }, "nested:redo")), w.hasRedo() && w.hasUndo() && N.push(o(Q, { orientation: "horizontal" }, "action:redo-div"));
|
|
3210
3210
|
}
|
|
3211
|
-
const
|
|
3211
|
+
const j = I(O, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, onClick: () => {
|
|
3212
3212
|
S.closeFloatAll();
|
|
3213
3213
|
}, onMouseLeave: () => {
|
|
3214
3214
|
y(0);
|
|
3215
3215
|
}, children: [N, o(O, { sx: { overflow: "auto", flex: "1 1 100%" }, children: D }), o(Q, { orientation: "horizontal" }), M] });
|
|
3216
|
-
return ke({ ...S, children:
|
|
3216
|
+
return ke({ ...S, children: j });
|
|
3217
3217
|
}, [u?.getContext(), u?.getState(), h, w, f, m]);
|
|
3218
3218
|
return o(Oe, { ref: a, commands: g, quickCommand: t, scope: h, disabled: m, label: u?.getLabel() ?? (r ? "Redo" : "Undo"), tooltip: o(ae, { children: o("span", { children: `${u?.getLabel() ?? "No"} last actions.` }) }), createPopupPanel: v, icon: e ?? (r ? "Redo" : "Undo"), selected: !1, ...b });
|
|
3219
3219
|
})), no = vl.getFontList(), ki = /* @__PURE__ */ new Map();
|
|
@@ -3221,7 +3221,7 @@ for (let n = 0; n < no.length; n++) ki.set(no[n].fontRef.getFamily(), no[n]);
|
|
|
3221
3221
|
const Wc = U(X((n, a) => {
|
|
3222
3222
|
const { command: t, commandHook: e, sx: r, disabled: l = !1, parentFloat: c, icon: h, label: i, ...d } = n;
|
|
3223
3223
|
Ut(t);
|
|
3224
|
-
const g = t?.getState(), b =
|
|
3224
|
+
const g = t?.getState(), b = et(), p = z(() => `${_t.getSharedMeasurer()("Times New Roman", Math.round(b.typography.fontSize), b.typography.fontFamily).width}px`, [b]), s = _((u) => {
|
|
3225
3225
|
const x = (y) => {
|
|
3226
3226
|
t?.execute(y, e);
|
|
3227
3227
|
}, w = [];
|
|
@@ -3243,7 +3243,7 @@ const Wc = U(X((n, a) => {
|
|
|
3243
3243
|
}, [l, t?.getState()]);
|
|
3244
3244
|
return o(Dt, { ref: a, sx: { ...r }, outlined: !0, disabled: l, parentFloat: c, createPopupPanel: s, createTooltip: ({ children: u }, x) => o(at, { label: t?.getLabel(), description: t?.getDescription(), disabled: x, children: u }), icon: o(O, { sx: { display: "flex", paddingLeft: "4px", paddingRight: "4px", fontSize: (u) => `${Math.round(u.typography.fontSize)}px`, fontFamily: (u) => u.typography.fontFamily, color: (u) => u.palette.text.secondary, width: p }, children: o(O, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: g }) }), ...d });
|
|
3245
3245
|
})), jc = U(X((n, a) => {
|
|
3246
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["formatStrikeThroughToggle", "formatSuperscriptToggle", "formatSubscriptToggle"]), i =
|
|
3246
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["formatStrikeThroughToggle", "formatSuperscriptToggle", "formatSubscriptToggle"]), i = z(() => {
|
|
3247
3247
|
const g = h.length;
|
|
3248
3248
|
for (let b = 0; b < g; b++) {
|
|
3249
3249
|
const p = h[b];
|
|
@@ -3256,7 +3256,7 @@ const Wc = U(X((n, a) => {
|
|
|
3256
3256
|
}, [l, e, r]);
|
|
3257
3257
|
return o(Oe, { ref: a, quickCommand: i?.getKey(), commands: t, commandHook: e, createPopupPanel: d, label: "Text Effects", tooltip: "Style your text to differentiate it.", icon: i?.getIcon() ?? "TextStrike", ...c });
|
|
3258
3258
|
})), $c = U(X((n, a) => {
|
|
3259
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["formatUnderlinedToggle", "formatUnderlinedDoubleToggle", "formatUnderlinedAccountingToggle", "formatUnderlinedAccountingDoubleToggle"]), i =
|
|
3259
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, h = Ae(t, ["formatUnderlinedToggle", "formatUnderlinedDoubleToggle", "formatUnderlinedAccountingToggle", "formatUnderlinedAccountingDoubleToggle"]), i = z(() => {
|
|
3260
3260
|
const g = h.length;
|
|
3261
3261
|
for (let b = 0; b < g; b++) if (h[b]?.getState()) return h[b];
|
|
3262
3262
|
return h[0];
|
|
@@ -3284,7 +3284,7 @@ const Wc = U(X((n, a) => {
|
|
|
3284
3284
|
}, [l, t, e, r]);
|
|
3285
3285
|
return o(Oe, { ref: a, commands: t, disabled: l, commandHook: e, scope: r, label: "Workbook View", tooltip: "Options to configure how the workbook is displayed.", createPopupPanel: h, icon: o(rn, { icon: null, label: "Workbook View" }), ...c });
|
|
3286
3286
|
})), Ei = U(X((n, a) => {
|
|
3287
|
-
const { value: t, cellStyle: e, styles: r, createTemporaryCell: l, bodyStyle: c, sx: h, propsBorder: i, disabled: d, ...g } = n, b =
|
|
3287
|
+
const { value: t, cellStyle: e, styles: r, createTemporaryCell: l, bodyStyle: c, sx: h, propsBorder: i, disabled: d, ...g } = n, b = z(() => l({ value: t, style: e }), [t, e, l]), p = z(() => b.getStyle(), [b, c]), s = z(() => p.getFill().toCSS(c?.darkMode ?? !1), [p]), u = p.getInsets(), x = p.getFont(), w = _(() => p.getBorder(), [p]);
|
|
3288
3288
|
return o(O, { ref: a, sx: { width: "100px", height: "100%", textOverflow: "ellipsis", display: "flex", alignItems: "stretch", background: c?.fill, filter: d ? "grayscale(0.4) opacity(0.8);" : "none", "& .fill": { flex: "1 1 100%", overflow: "hidden", ...s }, "& .text": { flex: "1 1 100%", ...x.toCSS(c?.darkMode ?? !1, 1), boxSizing: "border-box", padding: `${u.top}px ${u.right}px ${u.bottom}px ${u.left}px`, margin: "0px", outline: "none", resize: "none", overflow: "hidden", textOverflow: "ellipsis", verticalAlign: "baseline", textDecoration: x.toCSS().textDecoration, textAlign: kl.toCSSHorizontalTextAlign(b.getRenderHorizontalAlignment()), background: "transparent", maxHeight: "100%", whiteSpace: "pre", wordWrap: "break-word" }, ...h }, ...g, children: o(jn, { getBorderAt: w, darkMode: c?.darkMode ?? !1, rowCount: 1, columnCount: 1, style: { height: "100%", width: "100%", ...i?.style }, ...i, children: o(O, { className: "fill", sx: { paddingLeft: "4px", paddingRight: "4px", marginLeft: "-1px", marginTop: "-1px", marginRight: "-2px", marginBottom: "-2px", display: "flex", alignItems: "center" }, children: o(O, { className: "text", children: t }) }) }) });
|
|
3289
3289
|
})), Uc = U((n) => {
|
|
3290
3290
|
const { styles: a, namedStyle: t, selectedNamed: e, hasContextMenu: r = !0, bodyStyle: l, onSelectNamed: c, createTemporaryCell: h, parentFloat: i, commands: d, disabled: g, commandHook: b, ...p } = n, s = _((w) => {
|
|
@@ -3304,38 +3304,38 @@ const Wc = U(X((n, a) => {
|
|
|
3304
3304
|
const C = { onSelectNamed: x, styles: p(), parentFloat: v.floatReference }, k = p().getCustomNamed(), E = /* @__PURE__ */ new Map(), T = [];
|
|
3305
3305
|
for (let P = 0; P < k.length; P++) E.set(k[P].getName(), k[P]), p().getNamed(k[P].getName()).getBuiltInID() === null && T.push(k[P].getName());
|
|
3306
3306
|
const M = (P) => {
|
|
3307
|
-
let
|
|
3308
|
-
return
|
|
3309
|
-
}, R = (P,
|
|
3307
|
+
let $ = E.get(P);
|
|
3308
|
+
return $ || ($ = p().getNamed(P)), !$ || $.isHidden() ? null : o(Uc, { namedStyle: $, selectedNamed: s, bodyStyle: b.bodyStyle(), createTemporaryCell: b.createTemporaryCell, commands: t, commandHook: r, ...C }, P);
|
|
3309
|
+
}, R = (P, $, te = !0) => {
|
|
3310
3310
|
const de = [];
|
|
3311
|
-
for (let se = 0; se <
|
|
3312
|
-
const A = M(
|
|
3311
|
+
for (let se = 0; se < $.length; se++) {
|
|
3312
|
+
const A = M($[se]);
|
|
3313
3313
|
A && de.push(A);
|
|
3314
3314
|
}
|
|
3315
3315
|
return de.length === 0 ? null : I(O, { children: [te ? o(Q, { orientation: "horizontal" }) : null, o(ro, { children: P }, P + "-header"), o(O, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", width: "646px", maxWidth: "100%" }, children: de }, P + "-presets")] }, P);
|
|
3316
|
-
}, D = (P,
|
|
3316
|
+
}, D = (P, $) => {
|
|
3317
3317
|
const te = [];
|
|
3318
|
-
for (let de = 0; de <
|
|
3319
|
-
const se = M(
|
|
3318
|
+
for (let de = 0; de < $.length; de++) {
|
|
3319
|
+
const se = M($[de]);
|
|
3320
3320
|
se && te.push(se);
|
|
3321
3321
|
}
|
|
3322
3322
|
return te.length === 0 ? null : o(O, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", flexDirection: "column", flex: "0 0 0%" }, children: te }, P + "-presets");
|
|
3323
3323
|
}, N = [];
|
|
3324
3324
|
N.push(R("Custom", T, !1)), N.push(R("Good, Bad and Neutral", [ce.BuiltInName.Normal, ce.BuiltInName.Bad, ce.BuiltInName.Good, ce.BuiltInName.Neutral], T.length > 0)), N.push(R("Data and Model", [ce.BuiltInName.Calculation, ce.BuiltInName.CheckCell, ce.BuiltInName.ExplanatoryText, ce.BuiltInName.FollowedHyperlink, ce.BuiltInName.Hyperlink, ce.BuiltInName.Input, ce.BuiltInName.LinkedCell, ce.BuiltInName.Note, ce.BuiltInName.Output, ce.BuiltInName.WarningText])), N.push(R("Titles and Headings", [ce.BuiltInName.Heading1, ce.BuiltInName.Heading2, ce.BuiltInName.Heading3, ce.BuiltInName.Heading4, ce.BuiltInName.Title, ce.BuiltInName.Total]));
|
|
3325
|
-
let
|
|
3326
|
-
var F,
|
|
3327
|
-
return
|
|
3325
|
+
let j = [];
|
|
3326
|
+
var F, L;
|
|
3327
|
+
return j.push(D("Accent 1", [ce.BuiltInName.Accent1_20, ce.BuiltInName.Accent1_40, ce.BuiltInName.Accent1_60, ce.BuiltInName.Accent1])), j.push(D("Accent 2", [ce.BuiltInName.Accent2_20, ce.BuiltInName.Accent2_40, ce.BuiltInName.Accent2_60, ce.BuiltInName.Accent2])), j.push(D("Accent 3", [ce.BuiltInName.Accent3_20, ce.BuiltInName.Accent3_40, ce.BuiltInName.Accent3_60, ce.BuiltInName.Accent3])), j.push(D("Accent 4", [ce.BuiltInName.Accent4_20, ce.BuiltInName.Accent4_40, ce.BuiltInName.Accent4_60, ce.BuiltInName.Accent4])), j.push(D("Accent 5", [ce.BuiltInName.Accent5_20, ce.BuiltInName.Accent5_40, ce.BuiltInName.Accent5_60, ce.BuiltInName.Accent5])), j.push(D("Accent 6", [ce.BuiltInName.Accent6_20, ce.BuiltInName.Accent6_40, ce.BuiltInName.Accent6_60, ce.BuiltInName.Accent6])), N.push((F = "Themed Cell Styles", L = j, I(O, { children: [o(Q, { orientation: "horizontal" }), o(ro, { children: F }, F + "-header"), o(O, { sx: { display: "flex", gap: "2px", flexWrap: "wrap", alignItems: "start", flexDirection: "row" }, children: L }, F + "-presets")] }, F))), N.push(R("Number Format", [ce.BuiltInName.Comma, ce.BuiltInName.Comma0, ce.BuiltInName.Currency, ce.BuiltInName.Currency0, ce.BuiltInName.Percent])), I(O, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", paddingTop: (P) => `${P.shape.borderRadius}px`, paddingBottom: (P) => `${P.shape.borderRadius}px` }, children: [o(O, { onContextMenu: () => {
|
|
3328
3328
|
}, sx: { display: "flex", flexDirection: "column", paddingTop: "6px", paddingBottom: "0px", paddingLeft: "16px", paddingRight: "16px" }, children: N }), o(Q, { orientation: "horizontal" }), o(B, { variant: re.Menuitem, commandState: s, command: S.getCommand("newCellStyle"), context: "styles", commandHook: r, disabled: h })] });
|
|
3329
3329
|
}, [s, p?.().getTheme(), u]), m = Z((v) => {
|
|
3330
3330
|
const S = 18 / _t.getDeviceScale(), C = b?.createTemporaryCell(v);
|
|
3331
3331
|
return C.getStyle().getFont().getSize() <= S ? C : C.createTemporaryCell({ style: { font: { size: S } } });
|
|
3332
|
-
}, [b?.createTemporaryCell]), f = h || !e || e.disabled(), y =
|
|
3332
|
+
}, [b?.createTemporaryCell]), f = h || !e || e.disabled(), y = z(() => b && d ? o(Ei, { value: s?.getName() ?? "Custom", cellStyle: s ? { named: s.getName() } : void 0, styles: b.styles(), createTemporaryCell: m, bodyStyle: b.bodyStyle(), className: "outline-hover", disabled: f, sx: { marginRight: "4px", borderRadius: "2px", minHeight: "calc(100% - 2px)", overflow: "hidden", outline: (v) => `1px solid ${v.palette.action.hover}` }, propsBorder: { style: { height: "calc(100% - 2px)", width: "calc(100% - 1px)" } } }) : e?.getIcon(), [s, u, f, e]);
|
|
3333
3333
|
return o(Oe, { ref: a, createPopupPanel: w, outlined: d, commands: t, createTooltip: ({ children: v }, S) => o(at, { label: e?.getLabel(), description: e?.getDescription(), disabled: S, children: v }), selected: !1, disabled: f, label: e?.getLabel(), icon: y, ...g });
|
|
3334
3334
|
})), Gc = U((n) => {
|
|
3335
3335
|
const { table: a, tableStyle: t, selectedTableStyleName: e, onSelectTableStyleName: r, styles: l, hasContextMenu: c = !0, bodyStyle: h, parentFloat: i, commands: d, disabled: g, commandHook: b, useCanvasPreview: p = !0, canvas: s, ...u } = n, x = _((y) => {
|
|
3336
3336
|
const v = { variant: re.Menuitem, commandHook: b, context: "table" }, S = I(ae, { children: [o(B, { ...v, command: d.getCommand("formatTableStyleClearCellStyles"), commandState: t, disabled: g }), o(B, { ...v, style: { fontWeight: 550 }, command: d.getCommand("formatTableStyle"), commandState: { name: t.getName() }, disabled: g }), o(Q, { orientation: "horizontal" }), o(B, { ...v, command: d.getCommand("setDefaultTableStyle"), commandState: t.getName(), disabled: g }), o(Q, { orientation: "horizontal" }), o(B, { ...v, command: d.getCommand("deleteTableStyle"), commandState: t?.getName(), disabled: g || !t || t.isBuiltIn() })] });
|
|
3337
3337
|
return ke({ ...y, children: o(O, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: o(O, { sx: { overflow: "auto", flex: "1 1 100%" }, children: S }) }) });
|
|
3338
|
-
}, [d]), w = t?.getName() === e, m =
|
|
3338
|
+
}, [d]), w = t?.getName() === e, m = z(() => {
|
|
3339
3339
|
const y = { table: a, tableStyle: t, styles: l, bodyStyle: h };
|
|
3340
3340
|
return p ? o(nc, { canvas: s, ...y }) : o(Xa, { ...y });
|
|
3341
3341
|
}, [a, t, l, h]);
|
|
@@ -3349,7 +3349,7 @@ const Wc = U(X((n, a) => {
|
|
|
3349
3349
|
const p = e?.getContext(), s = p?.styles, u = l ?? p?.table?.();
|
|
3350
3350
|
let x = "insertTable";
|
|
3351
3351
|
u && (x = "editTable");
|
|
3352
|
-
const w =
|
|
3352
|
+
const w = z(() => ((M, R) => {
|
|
3353
3353
|
const D = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
3354
3354
|
return new Wn({ initialAnchor: D, styles: R, json: { name: "PreviewTable", ref: D, description: "PreviewTable", headerRowCount: 1, totalsRowCount: 0, styleOptions: M } });
|
|
3355
3355
|
})(u?.getStyleOptions(), s?.()), [s?.().getDefaultTableStyle(), u?.getStyleOptions()]), m = u ?? w, [f, y] = V(m);
|
|
@@ -3364,32 +3364,32 @@ const Wc = U(X((n, a) => {
|
|
|
3364
3364
|
const N = (A) => {
|
|
3365
3365
|
const H = s().getTableStyle(A);
|
|
3366
3366
|
return H ? o(Gc, { table: f, tableStyle: H, selectedTableStyleName: f.getStyleOptions().name, bodyStyle: p.bodyStyle(), commands: R, commandHook: r, canvas: C.current, ...D }, A) : null;
|
|
3367
|
-
},
|
|
3367
|
+
}, j = (A, H, ie = !0) => {
|
|
3368
3368
|
const oe = [];
|
|
3369
3369
|
for (let Y = 0; Y < H.length; Y++) {
|
|
3370
3370
|
const K = N(H[Y]);
|
|
3371
3371
|
K && oe.push(K);
|
|
3372
3372
|
}
|
|
3373
3373
|
return oe.length === 0 ? null : I(O, { children: [ie ? o(Q, { orientation: "horizontal" }) : null, o(ro, { children: A }, A + "-header"), o(O, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", width: "481px", maxWidth: "100%" }, children: oe }, A + "-presets")] }, A);
|
|
3374
|
-
}, F = [],
|
|
3375
|
-
if (
|
|
3376
|
-
for (let A = 0; A <
|
|
3377
|
-
F.push(
|
|
3374
|
+
}, F = [], L = s().getCustomTableStyles(), P = [];
|
|
3375
|
+
if (L.length > 0) {
|
|
3376
|
+
for (let A = 0; A < L.length; A++) L[A].isShownInTableStyles() && P.push(L[A].getName());
|
|
3377
|
+
F.push(j("Custom", P, !1));
|
|
3378
3378
|
}
|
|
3379
|
-
const
|
|
3380
|
-
u && !u.getStyleOptions().name &&
|
|
3381
|
-
for (let A = 0; A < 21; A++)
|
|
3382
|
-
F.push(
|
|
3379
|
+
const $ = [];
|
|
3380
|
+
u && !u.getStyleOptions().name && $.push(null);
|
|
3381
|
+
for (let A = 0; A < 21; A++) $.push("TableStyleLight" + (A + 1));
|
|
3382
|
+
F.push(j("Light", $, P.length > 0));
|
|
3383
3383
|
const te = [];
|
|
3384
3384
|
for (let A = 0; A < 28; A++) te.push("TableStyleMedium" + (A + 1));
|
|
3385
|
-
F.push(
|
|
3385
|
+
F.push(j("Medium", te));
|
|
3386
3386
|
const de = [];
|
|
3387
3387
|
for (let A = 0; A < 11; A++) de.push("TableStyleDark" + (A + 1));
|
|
3388
|
-
F.push(
|
|
3388
|
+
F.push(j("Dark", de));
|
|
3389
3389
|
let se = null;
|
|
3390
3390
|
return u && (se = I(ae, { children: [o(Q, { orientation: "horizontal" }), o(B, { variant: re.Menuitem, command: R.getCommand("formatTableStyleClearTableStyle"), commandHook: r, disabled: h })] })), I(O, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", paddingTop: (A) => `${A.shape.borderRadius}px`, paddingBottom: (A) => `${A.shape.borderRadius}px` }, children: [o(O, { onContextMenu: () => {
|
|
3391
3391
|
}, sx: { display: "flex", flexDirection: "column", padding: "6px 16px" }, children: F }), se] });
|
|
3392
|
-
}, [s, s?.().getTheme(), v, f]), E = h || !e || e.disabled(), T =
|
|
3392
|
+
}, [s, s?.().getTheme(), v, f]), E = h || !e || e.disabled(), T = z(() => {
|
|
3393
3393
|
if (!p || !g) return e?.getIcon();
|
|
3394
3394
|
}, [f, v, E, e]);
|
|
3395
3395
|
return o(Oe, { ref: a, quickCommand: d ? void 0 : x, createPopupPanel: k, commands: t, label: e?.getLabel(), commandState: u, commandHook: r, selected: u !== null, createTooltip: ({ children: M }, R) => o(at, { label: e?.getLabel(), description: e?.getDescription(), disabled: R, children: M }), disabled: E, icon: T, ...b });
|
|
@@ -3419,7 +3419,7 @@ const Wc = U(X((n, a) => {
|
|
|
3419
3419
|
}, [l, e]);
|
|
3420
3420
|
return o(Oe, { ref: a, sx: c, commands: t, disabled: l, commandHook: e, scope: r, label: "Help", tooltip: "Help, feedback, and keyboard shortcuts.", createPopupPanel: i, icon: o(ye, { iconKey: "Help", style: { transform: "scale(0.75)" } }), ...h });
|
|
3421
3421
|
})), Ri = U(X((n, a) => {
|
|
3422
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, preferSingleMenu: c = !0, showQuickButton: h = !0, variant: i = re.Toolbar, ...d } = n, g = Ae(t, ["insertImageFromFile", "insertImageFromURL"]), { singleMenuCommand: b, allDisabled: p } =
|
|
3422
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, preferSingleMenu: c = !0, showQuickButton: h = !0, variant: i = re.Toolbar, ...d } = n, g = Ae(t, ["insertImageFromFile", "insertImageFromURL"]), { singleMenuCommand: b, allDisabled: p } = z(() => {
|
|
3423
3423
|
let u = null, x = 0;
|
|
3424
3424
|
for (let w = 0; w < g.length; w++) g[w] && !g[w]?.disabled() && (c && i === re.Menuitem && (u = x === 0 ? g[w] : null), x++);
|
|
3425
3425
|
return { singleMenuCommand: u, allDisabled: x === 0 };
|
|
@@ -3476,7 +3476,7 @@ const Jc = U(X((n, a) => {
|
|
|
3476
3476
|
})), ed = U(X((n, a) => {
|
|
3477
3477
|
const { sx: t, style: e, className: r, licenseKey: l, renderLoading: c = Jn, propsLoading: h, ...i } = n;
|
|
3478
3478
|
l && ko.setLicenseKey(l);
|
|
3479
|
-
const d =
|
|
3479
|
+
const d = z(() => c ? o(xt, { sx: t, style: { width: "100%", height: "100%", position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", ...e }, children: c({ ...h }) }) : null, [t, e, c, h]), g = z(() => ne.lazy(async () => await Promise.resolve().then(() => Od)), []);
|
|
3480
3480
|
return o(ae, { children: o(xa, { fallback: d, children: o(g, { ...i, className: r, renderLoading: c, propsLoading: { ...h, transitionDelay: "0ms" }, sx: t, style: e, ref: a }) }) });
|
|
3481
3481
|
}));
|
|
3482
3482
|
function Ni(n) {
|
|
@@ -3661,7 +3661,7 @@ function la(n, a) {
|
|
|
3661
3661
|
typeof n == "function" ? n(a) : n && (n.current = a);
|
|
3662
3662
|
}
|
|
3663
3663
|
function zn(n, a) {
|
|
3664
|
-
return
|
|
3664
|
+
return z(function() {
|
|
3665
3665
|
return n == null && a == null ? null : function(t) {
|
|
3666
3666
|
la(n, t), la(a, t);
|
|
3667
3667
|
};
|
|
@@ -3893,7 +3893,7 @@ var Co, Mn, Ko, Go, Nn, Cd = U(ji), vd = Oo({ wrappedRoot: { width: "100%", posi
|
|
|
3893
3893
|
a.current && clearTimeout(a.current);
|
|
3894
3894
|
};
|
|
3895
3895
|
}, []);
|
|
3896
|
-
var h, i = n.snack, d = n.classes, g = n.Component, b = g === void 0 ? Cd : g, p =
|
|
3896
|
+
var h, i = n.snack, d = n.classes, g = n.Component, b = g === void 0 ? Cd : g, p = z(function() {
|
|
3897
3897
|
return (function(E) {
|
|
3898
3898
|
E === void 0 && (E = {});
|
|
3899
3899
|
var T = { containerRoot: !0, containerAnchorOriginTopCenter: !0, containerAnchorOriginBottomCenter: !0, containerAnchorOriginTopRight: !0, containerAnchorOriginBottomRight: !0, containerAnchorOriginTopLeft: !0, containerAnchorOriginBottomLeft: !0 };
|
|
@@ -4054,7 +4054,7 @@ class Dd {
|
|
|
4054
4054
|
}
|
|
4055
4055
|
}
|
|
4056
4056
|
const $t = new Dd(), mt = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, Vi = U(X((n, a) => {
|
|
4057
|
-
const { id: t, message: e, iconVariant: r, error: l, hideIconVariant: c, ...h } = n, { closeSnackbar: i } = $i(), d =
|
|
4057
|
+
const { id: t, message: e, iconVariant: r, error: l, hideIconVariant: c, ...h } = n, { closeSnackbar: i } = $i(), d = et(), [g, b] = V(!1), p = ys.collectErrorChain(l, !0)?.[0]?.error, s = p && !(p instanceof ws), u = _(() => {
|
|
4058
4058
|
b((m) => !m);
|
|
4059
4059
|
}, []), x = _(() => {
|
|
4060
4060
|
i(t);
|
|
@@ -4100,18 +4100,18 @@ const Rd = o(at, { label: "SheetXL", description: "Visit me at sheetxl.com.", ch
|
|
|
4100
4100
|
} } }) : null, u = h ? o(Xc, { commands: t, commandHook: { beforeExecute() {
|
|
4101
4101
|
d?.closeAll();
|
|
4102
4102
|
}, onError(m, f, y) {
|
|
4103
|
-
} } }) : null, x =
|
|
4103
|
+
} } }) : null, x = z(() => ({ paddingLeft: (m) => m.spacing(1), paddingRight: (m) => m.spacing(1) }), []), w = xe(null);
|
|
4104
4104
|
return o(O, { ref: yt([w, g, a]), ...i, children: gi({ commands: t, isCompact: p, workbook: e, wrapperSelect: (m) => I(O, { sx: { display: "flex", flex: "1", flexDirection: "row", alignItems: "stretch", gap: (f) => f.spacing(1), paddingLeft: (f) => f.spacing(1), paddingRight: (f) => f.spacing(1) }, children: [I(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (f) => f.spacing(0.5) }, children: [r, I(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (f) => f.spacing(0.25) }, children: [s, m] })] }), o(O, { sx: { display: "flex", flexDirection: "row", flex: "1 1 300%", overflow: "hidden", alignItems: "center", justifyContent: "center" }, children: l }), o(O, { sx: { display: "flex", alignItems: "center", justifyContent: "end", flex: p && !u ? "0 0 auto" : "1 1 100%" }, children: u })] }), propsSelect: x, propsToolbars: { Home: { sx: {} } } }) });
|
|
4105
4105
|
}));
|
|
4106
4106
|
Ui.displayName = "StudioToolbar";
|
|
4107
4107
|
const Md = () => {
|
|
4108
|
-
window.open(window.origin.toString(), "sheetxl-" +
|
|
4108
|
+
window.open(window.origin.toString(), "sheetxl-" + Je.uuidV4(), "popup=true");
|
|
4109
4109
|
}, Ki = U((n) => {
|
|
4110
4110
|
const { workbook: a, setWorkbook: t, refWorkbookTitle: e, titleWorkbook: r, setWorkbookTitle: l, titlePlaceHolder: c, undoManager: h, commands: i, importExportDisabled: d, themeOptions: g, renderWorkbook: b } = n, p = ((C) => {
|
|
4111
|
-
const { workbook: k, setWorkbook: E, importExportDisabled: T, workbookTitle: M = "export", setWorkbookTitle: R, requestWorkbookTitle: D, themeOptions: N, undoManager:
|
|
4111
|
+
const { workbook: k, setWorkbook: E, importExportDisabled: T, workbookTitle: M = "export", setWorkbookTitle: R, requestWorkbookTitle: D, themeOptions: N, undoManager: j, commands: F, onExecute: L } = C, P = sn(), $ = Z(N?.onModeChange, [N?.onModeChange]), te = Z(N?.onEnabledDarkGridChange, [N?.onEnabledDarkGridChange]), de = Z(N?.onEnabledDarkImagesChange, [N?.onEnabledDarkImagesChange]), se = Z(async (me = null, ue = null, G = null) => {
|
|
4112
4112
|
const W = [];
|
|
4113
4113
|
let J, Ce = null, ge = null;
|
|
4114
|
-
if (typeof me == "string" ? ge = me : Ce = me, J = Ce ? me : await
|
|
4114
|
+
if (typeof me == "string" ? ge = me : Ce = me, J = Ce ? me : await Je.openFileDialog(ge ?? await $t.getAllReadFormatsAsString()), !J) return null;
|
|
4115
4115
|
const Ne = { source: J, typedCreateWorkbookOptions: ue, progress: { onWarning: (Ve) => {
|
|
4116
4116
|
W.push(Ve);
|
|
4117
4117
|
} } };
|
|
@@ -4120,7 +4120,7 @@ const Md = () => {
|
|
|
4120
4120
|
return W.length > 0 && (P.showMessage("Some elements were not able to be imported. See console for details."), console.warn(`Import warnings:
|
|
4121
4121
|
` + W.join(`
|
|
4122
4122
|
`))), Ge;
|
|
4123
|
-
}, [
|
|
4123
|
+
}, [L, P, k]), A = Z(async (me, ue, G) => {
|
|
4124
4124
|
if (!ue && D) {
|
|
4125
4125
|
const W = await D("Enter Workbook name to " + (G?.isDefault ? "Save." : `Export as ${G?.description}.`));
|
|
4126
4126
|
return W !== null && $t.writeFile(W, me, { format: G.key });
|
|
@@ -4157,9 +4157,9 @@ const Md = () => {
|
|
|
4157
4157
|
const Ge = k.findValidSheetName(W);
|
|
4158
4158
|
await k.doBatch(async () => {
|
|
4159
4159
|
const Ve = { colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 };
|
|
4160
|
-
let
|
|
4161
|
-
if (!
|
|
4162
|
-
|
|
4160
|
+
let Qe = Ne.getUsedRange();
|
|
4161
|
+
if (!Qe) return void P.showMessage("The file appears to be blank.");
|
|
4162
|
+
Qe = Qe.getUnion(Ve), await k.getSheets().add({ name: Ge, autoSelect: !0 }).getRange(Ve).copyFrom(Qe);
|
|
4163
4163
|
}, `Import CSV '${Ge}'`);
|
|
4164
4164
|
} else k?.close(), R?.(ge.getName() ?? ""), E(ge);
|
|
4165
4165
|
} catch (W) {
|
|
@@ -4179,7 +4179,7 @@ const Md = () => {
|
|
|
4179
4179
|
})), oe(me);
|
|
4180
4180
|
})();
|
|
4181
4181
|
}, [T, P, k, M]);
|
|
4182
|
-
const Y =
|
|
4182
|
+
const Y = z(() => {
|
|
4183
4183
|
let me = [];
|
|
4184
4184
|
return N && (me = [new be("themeMode", H, { label: "Light/Dark Mode", scopedLabels: { appearance: "Light/Dark Mode" }, description: "Toggle the application styling between light and dark mode." }), new be("defaultThemeMode", H, { label: "Use System Light/Dark Mode", scopedLabels: { appearance: "Use System Default" }, description: "Use the system settings to determine styling for light and dark mode." }), new be("enableDarkGrid", H, { label: "Enable Dark Grid", description: "Allow the grid to render in dark mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)." }), new be("enableDarkImages", H, { label: "Enable Dark Images", description: "Allow the images to render in dark mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode." })]), [...me, new We("help", H, { label: "Show Help", description: "Provide Help.", icon: "Documentation", shortcut: { key: "F1" } }, () => {
|
|
4185
4185
|
}), new We("showKeyboardShortcuts", H, { label: "Keyboard Shortcuts", description: "Show keyboard shortcuts.", icon: "Keyboard", shortcut: { key: "/", modifiers: [fe.Ctrl] } }, () => {
|
|
@@ -4192,19 +4192,19 @@ const Md = () => {
|
|
|
4192
4192
|
}), new be("gotoUrlIssue", H, { label: "Create Issue", description: "Create an issue to identify a bug or a feature request.", icon: "Ticket" }, () => {
|
|
4193
4193
|
window?.open("https://github.com/sheetxl/sheetxl/issues");
|
|
4194
4194
|
})];
|
|
4195
|
-
}, [k, M, P, T, N]), K =
|
|
4195
|
+
}, [k, M, P, T, N]), K = z(() => [...Y, ...ie], [Y, ie]), pe = z(() => {
|
|
4196
4196
|
let me = null;
|
|
4197
4197
|
return me = F ? F.createChildGroup(H, "standaloneWorkbook", !1) : new Xn(H, "standaloneWorkbook"), me.addCommands(K, !0), me;
|
|
4198
4198
|
}, [F, Y, ie]);
|
|
4199
|
-
ms({ manager:
|
|
4199
|
+
ms({ manager: j, commands: pe });
|
|
4200
4200
|
const Me = ka("(prefers-color-scheme: dark)"), { themeMode: Te } = Ea();
|
|
4201
4201
|
le(() => {
|
|
4202
4202
|
if (!N || !pe) return;
|
|
4203
4203
|
const me = N.mode === "dark" || !N.mode && Te === "dark";
|
|
4204
4204
|
pe.getCommand("themeMode").update({ state: N.mode ?? null, label: me ? "Dark Mode" : "Light Mode", scopedLabels: { appearance: me ? "Dark Mode" : "Light Mode" }, icon: me ? "DarkMode" : "LightMode" }).updateCallback(() => {
|
|
4205
|
-
|
|
4205
|
+
$(me ? Pn.Light : Pn.Dark);
|
|
4206
4206
|
}), pe.getCommand("defaultThemeMode").update({ state: !N.mode, icon: Me ? "SystemDefaultDarkMode" : "SystemDefaultLightMode" }).updateCallback(() => {
|
|
4207
|
-
|
|
4207
|
+
$(null);
|
|
4208
4208
|
}), pe.getCommand("enableDarkGrid").update({ state: N.enableDarkGrid }).updateCallback(() => {
|
|
4209
4209
|
te(!N.enableDarkGrid);
|
|
4210
4210
|
}), pe.getCommand("enableDarkImages").update({ state: N.enableDarkImages }).updateCallback(() => {
|
|
@@ -4214,7 +4214,7 @@ const Md = () => {
|
|
|
4214
4214
|
const { showModal: Ie } = as();
|
|
4215
4215
|
return le(() => {
|
|
4216
4216
|
const me = () => new Promise((ue, G) => {
|
|
4217
|
-
const W = ne.lazy(() => import("./
|
|
4217
|
+
const W = ne.lazy(() => import("./BSMkBkXBQgZhX1xk.mjs")), J = Ie(W, { title: "Shortcut Keys Reference", commands: pe, onDone: () => {
|
|
4218
4218
|
J.hide();
|
|
4219
4219
|
}, slotProps: { transition: { onExited: () => {
|
|
4220
4220
|
ue(!0);
|
|
@@ -4227,15 +4227,15 @@ const Md = () => {
|
|
|
4227
4227
|
k(E);
|
|
4228
4228
|
}, { selectAll: !0, requestReason: C }) : k(c);
|
|
4229
4229
|
}), themeOptions: g, undoManager: h, onExecute: _(() => {
|
|
4230
|
-
}, []) }), s =
|
|
4230
|
+
}, []) }), s = z(() => o(Yc, { commands: p, disableHover: !0, sx: { padding: "0" }, propsButton: { sx: { maxHeight: "22px" } } }), [p]), [u, x] = ne.useState(null), w = _((C) => {
|
|
4231
4231
|
const k = C.dataTransfer;
|
|
4232
4232
|
if (p?.getCommand("openWorkbook") && k) {
|
|
4233
4233
|
if (C.type === "dragenter" || C.type === "dragover") {
|
|
4234
4234
|
const E = (D) => {
|
|
4235
|
-
const N = k.items,
|
|
4236
|
-
for (let F = 0; F <
|
|
4237
|
-
const
|
|
4238
|
-
if (
|
|
4235
|
+
const N = k.items, j = N.length;
|
|
4236
|
+
for (let F = 0; F < j; F++) {
|
|
4237
|
+
const L = N[F];
|
|
4238
|
+
if (L.type.startsWith(D)) return L;
|
|
4239
4239
|
}
|
|
4240
4240
|
return null;
|
|
4241
4241
|
};
|
|
@@ -4257,7 +4257,7 @@ const Md = () => {
|
|
|
4257
4257
|
p.getCommand("insertImageFromFile")?.execute({ file: k, options: { bounds: { x: M.x, y: M.y } }, goto: { range: { ...R } } });
|
|
4258
4258
|
} else p.getCommand("openWorkbook")?.execute(k);
|
|
4259
4259
|
}
|
|
4260
|
-
}, [p, u]), y =
|
|
4260
|
+
}, [p, u]), y = z(() => u && u.text ? o(O, { sx: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", pointerEvents: "none", display: "flex", justifyContent: "center", alignItems: "center", background: (C) => C.palette.divider, color: (C) => C.palette.primary.dark }, children: o(Fe, { variant: "h4", children: u.text }) }) : null, [u]), v = { ref: m, commands: p, onDragStart: (C) => {
|
|
4261
4261
|
if (C.target.src) {
|
|
4262
4262
|
const k = new Image();
|
|
4263
4263
|
k.src = C.target.src, C.dataTransfer.setDragImage(k, 1, 1);
|
|
@@ -4275,7 +4275,7 @@ const Gi = U((n) => {
|
|
|
4275
4275
|
c((m) => ({ ...m, isMounted: !0 }));
|
|
4276
4276
|
}, []), i = _(() => {
|
|
4277
4277
|
c((m) => ({ ...m, isMounted: !1 }));
|
|
4278
|
-
}, []), d = {}, g = is(d), b = ls(d), p = ss(d), s = xe(/* @__PURE__ */ new Set()), u =
|
|
4278
|
+
}, []), d = {}, g = is(d), b = ls(d), p = ss(d), s = xe(/* @__PURE__ */ new Set()), u = z(() => {
|
|
4279
4279
|
const m = (v, S) => {
|
|
4280
4280
|
if (S?.onceKey) {
|
|
4281
4281
|
if (s.current.has(S.onceKey)) return;
|
|
@@ -4297,7 +4297,7 @@ const Gi = U((n) => {
|
|
|
4297
4297
|
const C = S;
|
|
4298
4298
|
return S = { ...S, onKeyDown: (k) => {
|
|
4299
4299
|
k.isDefaultPrevented() || k.isPropagationStopped() || C?.onKeyDown?.(k);
|
|
4300
|
-
} }, g(v, { sort: () => import("./
|
|
4300
|
+
} }, g(v, { sort: () => import("./DVqOr-7nEXA7IjKJ.mjs"), numberFormat: () => import("./8ZnwcsRrGO3Nlw9Y.mjs"), hyperlink: () => import("./D8xc3AM9QHEqmpb9.mjs"), comments: () => import("./BFZ4oCbQukelEVLI.mjs"), find: () => import("./CuC13VFjBYFE7kub.mjs"), tableNew: () => import("./D6E8W2KK4dGVRQO_.mjs"), namedDetails: () => import("./Cw3i8T1tVnm8o6eB.mjs"), resizeHeader: () => import("./VAUOzclLs-dR9nt_.mjs") }[v], S);
|
|
4301
4301
|
}, showOptions: b, showInput: p, showError: (v) => {
|
|
4302
4302
|
let S, C = kt.Error, k = "Unknown Error";
|
|
4303
4303
|
typeof v == "string" ? k = v : v instanceof Error && (S = v, v.message && (k = v.message)), v instanceof Ss && (C = kt.Info), m(k, { type: C, enqueueProps: { error: S } });
|
|
@@ -4325,19 +4325,19 @@ const Gi = U((n) => {
|
|
|
4325
4325
|
});
|
|
4326
4326
|
Gi.displayName = "SnackbarWrapper";
|
|
4327
4327
|
const Nd = U(X((n, a) => {
|
|
4328
|
-
const { children: t, title: e, taskPanes: r, onSelect: l, selected: c, registry: h = en, style: i, iconsOnly: d, className: g, ...b } = n, p =
|
|
4328
|
+
const { children: t, title: e, taskPanes: r, onSelect: l, selected: c, registry: h = en, style: i, iconsOnly: d, className: g, ...b } = n, p = z(() => r.map((x) => {
|
|
4329
4329
|
const w = h.getRegisteredTaskPane(x);
|
|
4330
4330
|
if (!w) return null;
|
|
4331
4331
|
let m = w.getIcon?.();
|
|
4332
4332
|
m && (typeof m == "string" && (m = o(ye, { iconKey: m })), m = o("span", { style: { display: "inline-block", transform: "rotate(90deg)", transformOrigin: "center" }, children: m }));
|
|
4333
4333
|
const f = x === c;
|
|
4334
4334
|
return o(va, { value: x, label: o(Et, { disableInteractive: !0, title: w.getTitle() ?? "", placement: "left-start", children: I(O, { sx: { padding: "0px 0px", writingMode: "vertical-rl", textOrientation: "mixed", display: "flex", alignItems: "center", justifyContent: "space-between", minWidth: "0px", color: (y) => y.palette.text.secondary }, children: [m && o(O, { sx: { display: "inline-block", transformOrigin: "center", color: (y) => y.palette.text.secondary }, children: m }), d && m ? null : o(Fe, { component: "div", textTransform: "none", sx: { padding: "4px 0px", color: (y) => f ? y.palette.primary.main : y.palette.text.secondary }, children: w.getTitle() })] }) }), sx: { padding: "4px 4px", minWidth: "0px", minHeight: "0px", borderRadius: "4px" }, className: Re("taskpane-strip-item", { "Mui-selected": f }), onClick: () => n.onSelect(x) }, x);
|
|
4335
|
-
}), [r, c, l, h]), s = Rt(a, () => ({ isTaskPaneStrip: () => !0 }), []), u =
|
|
4335
|
+
}), [r, c, l, h]), s = Rt(a, () => ({ isTaskPaneStrip: () => !0 }), []), u = z(() => Re("taskpane-strip", g), [g]);
|
|
4336
4336
|
return o(O, { ref: s, className: u, sx: { paddingLeft: "2px", paddingTop: "4px", ...i }, ...b, children: o(Ca, { orientation: "vertical", variant: "scrollable", value: c, onChange: (x, w) => {
|
|
4337
4337
|
l(w);
|
|
4338
4338
|
}, slotProps: { list: { sx: { gap: "2px" } }, indicator: { sx: { left: "0px", right: "unset" } } }, children: p }) });
|
|
4339
4339
|
})), Pd = (n) => o(Nd, { ...n }), Fd = ne.forwardRef((n, a) => {
|
|
4340
|
-
const { commands: t, model: e, ...r } = n, l =
|
|
4340
|
+
const { commands: t, model: e, ...r } = n, l = et(), c = `solid ${Se(l.palette.divider, 0.2)} 1px`, h = `${l.shape.borderRadius ?? 4}px`, i = `${l.spacing?.(0.5) ?? 4}px`, d = xe(null);
|
|
4341
4341
|
return o(Al, { model: e, ref: a, propsFrame: { style: { border: c, borderRadius: h, marginBottom: i } }, alwaysShowStrip: !0, renderTaskPanelTitle: (g) => {
|
|
4342
4342
|
const { title: b, icon: p, onClose: s, readOnly: u, focused: x, ...w } = g;
|
|
4343
4343
|
return o(ql, { className: Re({ "Mui-selected": x }), sx: { display: "flex", flex: "1 1 %0", color: (m) => m.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: (m) => `${m.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: (m) => m.transitions.duration.shortest / 2 + "ms" }, backgroundColor: (m) => Se(m.palette.action.hover, 0.03), borderBottom: (m) => `solid ${Se(m.palette.divider, 0.2)} 1px` }, ...w, children: I(O, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: (m) => m.spacing(0.25), marginBottom: (m) => m.spacing(0.25), marginLeft: (m) => m.spacing(1), marginRight: (m) => m.spacing(1) }, children: [o(O, { sx: { flex: "1 1 100%", paddingLeft: (m) => m.spacing(1) }, children: b }), o(at, { label: "Close", children: o(ct, { "aria-label": "close", sx: { color: (m) => m.palette.text.icon ?? m.palette.action.active }, touchRippleRef: d, onPointerDown: (m) => {
|
|
@@ -4351,19 +4351,19 @@ const Nd = U(X((n, a) => {
|
|
|
4351
4351
|
n?.onClose?.();
|
|
4352
4352
|
}, commands: t, ...r });
|
|
4353
4353
|
}), ga = { flex: "1 1 100%", display: "flex", boxSizing: "border-box" }, qi = U(X((n, a) => {
|
|
4354
|
-
const { mainElement: t, sidebarElement: e, className: r, style: l, ...c } = n, h =
|
|
4354
|
+
const { mainElement: t, sidebarElement: e, className: r, style: l, ...c } = n, h = et(), [i, { width: d }] = Vt(), g = d > 530 || d === 0, b = xe(null);
|
|
4355
4355
|
let p = null, s = 4, u = 13;
|
|
4356
4356
|
return g ? p = "m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991" : (p = "M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991", s = 13, u = 4), o(Gn, { ref: yt([b, i, a]), className: r, style: l ? { ...ga, ...l } : ga, ...c, fixedPane: "after", position: "40%", minAfter: g ? "280px" : "120px", splitDirection: g ? "row" : "column", propsResizer: { className: "styled-resizer", style: { minWidth: g ? "6px" : void 0, minHeight: g ? void 0 : "6px", maskImage: `url("data:image/svg+xml,%3Csvg width='${s}' height='${u}' viewBox='0 0 ${s} ${u}' version='1.1' fill='${h.palette.text.icon ?? h.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${p}' /%3E%3C/svg%3E%0A")`, maskRepeat: "no-repeat", maskPosition: g ? "left center" : "top center" } }, elementBefore: t, propsPaneBefore: { style: { flexDirection: "column", marginRight: e ? void 0 : "6px" } }, elementAfter: e, propsPaneAfter: { style: { marginLeft: g ? "0px" : "4px", marginRight: g ? "8px" : "4px" } } });
|
|
4357
4357
|
}));
|
|
4358
4358
|
qi.displayName = "StudioSplitPane", mc(), qn.register("plugin-scripts", { icons: {} }), en.registerTaskPane({ key: "scriptEditor", getTitle: () => "Script (Typescript)", getIcon: () => "ScriptRun", renderTaskPane: xc }, !0);
|
|
4359
4359
|
const Hn = U(X((n, a) => {
|
|
4360
|
-
const { className: t, sx: e, square: r, elevation: l, variant: c, style: h, onElementLoad: i, onError: d, undoManager: g, renderWorkbookError: b = Nc, onKeyDown: p, workbook: s, onWorkbookChange: u, logo: x, importExportDisabled: w = !1, themeOptions: m, autoFocus: f = !1, commands: y, title: v, onWorkbookTitleChange: S, propsWorkbookTitle: C, renderLoading: k = Jn, propsLoading: E, ...T } = n, M = xe(null), R = Z(u, [u]), D = Z(S ?? C?.onTitleChange, [S ?? C?.onTitleChange]), N = C?.placeHolder ?? "Untitled",
|
|
4360
|
+
const { className: t, sx: e, square: r, elevation: l, variant: c, style: h, onElementLoad: i, onError: d, undoManager: g, renderWorkbookError: b = Nc, onKeyDown: p, workbook: s, onWorkbookChange: u, logo: x, importExportDisabled: w = !1, themeOptions: m, autoFocus: f = !1, commands: y, title: v, onWorkbookTitleChange: S, propsWorkbookTitle: C, renderLoading: k = Jn, propsLoading: E, ...T } = n, M = xe(null), R = Z(u, [u]), D = Z(S ?? C?.onTitleChange, [S ?? C?.onTitleChange]), N = C?.placeHolder ?? "Untitled", j = m?.mode, { themeMode: F, source: L } = Ea({ mode: j }), P = z(() => ({ ...m, light: yr(!1, Je.deepMerge(m?.theme ?? {}, m?.light ?? {})), dark: yr(!0, Je.deepMerge(m?.theme ?? {}, m?.dark ?? {})) }), [m]), $ = F === Pn.Dark, [te, de] = V(null);
|
|
4361
4361
|
le(() => {
|
|
4362
4362
|
de(g ?? new Cs());
|
|
4363
4363
|
}, [g]);
|
|
4364
4364
|
const [se, A] = V(null), [H, ie] = V(null), oe = ba();
|
|
4365
4365
|
Tt(() => {
|
|
4366
|
-
if (!s || Object.keys(s).length === 0 && !
|
|
4366
|
+
if (!s || Object.keys(s).length === 0 && !Je.isPromiseLike(s)) {
|
|
4367
4367
|
const ee = { theme: oe.getDefaultTheme() };
|
|
4368
4368
|
ie(new gr(ee));
|
|
4369
4369
|
} else ie(s);
|
|
@@ -4402,7 +4402,7 @@ const Hn = U(X((n, a) => {
|
|
|
4402
4402
|
}, [v ?? C?.title]), le(() => {
|
|
4403
4403
|
D?.(Me);
|
|
4404
4404
|
}, [Me]);
|
|
4405
|
-
const [Ie, me] = V(null), ue =
|
|
4405
|
+
const [Ie, me] = V(null), ue = z(() => {
|
|
4406
4406
|
const ee = () => ({ contains: (we) => !0, focus() {
|
|
4407
4407
|
} });
|
|
4408
4408
|
return y ? y.createChildGroup(ee, "application", !1) : new Xn(ee, "application");
|
|
@@ -4424,13 +4424,13 @@ const Hn = U(X((n, a) => {
|
|
|
4424
4424
|
M.current?.removeEventListener("wheel", ee);
|
|
4425
4425
|
};
|
|
4426
4426
|
}, []);
|
|
4427
|
-
const Ce =
|
|
4427
|
+
const Ce = z(() => ({ "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-SnackbarContainer > div": { maxWidth: "100%" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (ee) => ee.palette.getContrastText(ee.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (ee) => ee.palette.getContrastText(ee.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (ee) => ee.palette.getContrastText(ee.palette.error.main) }, "& .notistack-MuiContent *": { fontFamily: (ee) => ee.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" }, ...e }), [e]), [ge, Ne] = V(null), Ge = _((ee) => o(Fd, { model: se?.workbook, commands: ue, ...ee }), [ue, se]), Ve = _((ee) => o(qi, { mainElement: ee, sidebarElement: ge }), [ge]), Qe = yt([M, a]), Xe = _((ee) => {
|
|
4428
4428
|
const { commands: we, ref: Mt, ...un } = ee;
|
|
4429
4429
|
if (!se) return o(xt, { sx: e, style: { width: "100%", height: "100%", position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", ...h }, children: k({ ...E }) });
|
|
4430
4430
|
if (se.error) return o(xt, { sx: e, style: { width: "100%", height: "100%", position: "absolute", display: "flex", alignItems: "stretch", justifyContent: "stretch", ...h }, children: b({ style: { width: "100%", height: "100%", ...h }, error: se.error }) });
|
|
4431
4431
|
let io = null, Bo = null, Le = !1;
|
|
4432
|
-
P && (io =
|
|
4433
|
-
const Nt = o(wi, { tabIndex: 0, autoFocus: !1, workbook: se.workbook, ref: yt([Mt,
|
|
4432
|
+
P && (io = $ ? P.dark : P.light, Bo = $ && P.enableDarkGrid ? P.dark : P.light, Le = P.enableDarkImages);
|
|
4433
|
+
const Nt = o(wi, { tabIndex: 0, autoFocus: !1, workbook: se.workbook, ref: yt([Mt, Qe]), renderToolbar: J, onElementLoad: G, onRepeatCommandChange: pe, onKeyDown: (Pt) => {
|
|
4434
4434
|
p?.(Pt);
|
|
4435
4435
|
}, propsLoading: E, renderLoading: k, gridTheme: Bo, headersTheme: io, enableDarkImages: Le, wrapperMain: Ve, className: Re(t), onContextMenu: (Pt) => Pt.preventDefault(), commands: we, ...T, ...un }, "WorkbookElement");
|
|
4436
4436
|
return o(xt, { sx: Ce, style: { width: "100%", height: "100%", position: "absolute", display: "flex", alignItems: "stretch", justifyContent: "stretch", ...h }, square: r, elevation: l, variant: c, children: Nt });
|
|
@@ -4440,7 +4440,7 @@ const Hn = U(X((n, a) => {
|
|
|
4440
4440
|
}, Components: { error: Vi }, iconVariant: { success: o(wa, { style: { marginRight: "8px" }, children: o("path", { d: "M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z" }) }), error: o(ye, { iconKey: "ErrorAlert", style: { marginRight: "8px" } }) }, children: o(Il, { renderArea: Ge, onUpdateArea: (ee) => {
|
|
4441
4441
|
Ne(ee);
|
|
4442
4442
|
}, children: o(ds, { children: o(Gi, { children: o(fs, { children: o(bs, { children: o(Ki, { workbook: se?.workbook, renderWorkbook: Xe, setWorkbook: ie, importExportDisabled: w, titlePlaceHolder: N, titleWorkbook: Me, setWorkbookTitle: Te, refWorkbookTitle: W, commands: ue, undoManager: te, themeOptions: P }) }) }) }) }) }) });
|
|
4443
|
-
return P && (Ue = I(Da, { theme:
|
|
4443
|
+
return P && (Ue = I(Da, { theme: $ ? P.dark : P.light, children: [P.cssBaseline ? o(Xl, {}) : null, Ue] })), Ue;
|
|
4444
4444
|
}));
|
|
4445
4445
|
Hn.displayName = "EagerStudio";
|
|
4446
4446
|
const Od = Object.freeze(Object.defineProperty({ __proto__: null, EagerStudio: Hn, default: Hn }, Symbol.toStringTag, { value: "Module" }));
|