@sheetxl/studio-mui 0.7.8 → 0.7.9
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/{UoOVKSpyeYQ3Z04Y.cjs → 1SqZN5MQ5PzAcIvC.cjs} +3 -3
- package/browser/cjs/{DPenF_1mYgI8WaQf.cjs → BBYVAwo4ouiMmtKC.cjs} +1 -1
- package/browser/cjs/{Q234HX63V75h22HJ.cjs → Bm-7dNP3FmSD8RKB.cjs} +1 -1
- package/browser/cjs/C_USiuvDG2dfWtXj.cjs +20 -0
- package/browser/cjs/{D36j1nR6-lEwM7Ht.cjs → Cf-kkPm1FigHKB2n.cjs} +2 -2
- package/browser/cjs/{zFlqPWNVl7CHv7Iw.cjs → D1OaqRgNJbMQkAd5.cjs} +1 -1
- package/browser/cjs/{DQ1bXdi-D0uVKGFA.cjs → DA9XIw3uWopubSOm.cjs} +2 -2
- package/browser/cjs/{CJW4-NCdaLzNEwgK.cjs → DQupeVKF6A0l_r2_.cjs} +1 -1
- package/browser/cjs/{D9RcTPcL8Gcds6uC.cjs → DWCZwMHAmHr_6pOv.cjs} +2 -2
- package/browser/cjs/{rrppjlxhsrfwBStx.cjs → T7VT7LHcSGCG0nHe.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{WN5FOSGC22Jy3dxz.cjs → pLwzHJC2rMpMNlmN.cjs} +1 -1
- package/browser/esm/{Cp-QoTwVeQkQClpI.mjs → 8ySqzQ-18kdZCc_T.mjs} +1 -1
- package/browser/esm/{BD3NSZsAOvF6yczu.mjs → BkLdZhD76b4clcIe.mjs} +3 -3
- package/browser/esm/{D7PjwOCMi075qK5G.mjs → Bx_qMvcXcJ9rsRW0.mjs} +2 -2
- package/browser/esm/{Ci4cqU4bR1IUSqrT.mjs → CrxCbPC8OsPYiu18.mjs} +1 -1
- package/browser/esm/{CagpAQXgCxrJrdGJ.mjs → CusJChXpaPfoicnm.mjs} +2 -2
- package/browser/esm/{CUiplQS9rUodJwPi.mjs → DLRGvvkeHamosHqQ.mjs} +1073 -1064
- package/browser/esm/{wenu-h35nL2_uEZp.mjs → DTxgrQXbG3N9lW1K.mjs} +2 -2
- package/browser/esm/{BiazW77hCkbuJPiW.mjs → DV6MYPn_wgUytG9p.mjs} +1 -1
- package/browser/esm/{Dx4t6SbPV2HSf_ub.mjs → DeBXIHYAvBBDeuyl.mjs} +1 -1
- package/browser/esm/{5Fbp4sZTl6CHhmHk.mjs → YpJtXAhMACxtW1Rk.mjs} +2 -2
- package/browser/esm/index.mjs +71 -70
- package/browser/esm/{CoIXNZVIp9Q12qM2.mjs → vrN0FWxqEeg1-vWU.mjs} +1 -1
- package/licenses/dependencies.txt +139 -139
- package/node/esm/{B21Usvp_sTqMHAZ4.mjs → 4Woq8PA_nHBBWJE_.mjs} +1 -1
- package/node/esm/{D1n7HgHfLVQZ0KhP.mjs → BVjsplqVie80wjNf.mjs} +1 -1
- package/node/esm/{BAgtosqQwtrUsOYl.mjs → BxpSw5aPIr7UXKbB.mjs} +1 -1
- package/node/esm/{Cfzjf7vBs29sO_g3.mjs → CN31EL9Soh-9w3jF.mjs} +1 -1
- package/node/esm/{DWhJA7EI9CmoBPDY.mjs → Cglez5pr5a5RTdHS.mjs} +1 -1
- package/node/esm/{CYU-oRRhaNiOTVNa.mjs → CrfdSYnd6drqE5fB.mjs} +1 -1
- package/node/esm/{GzNLdpzukdCxYbbC.mjs → DAMa-CbdXO0XKKam.mjs} +1 -1
- package/node/esm/{DmdldJQanZCNdfA5.mjs → DIXy8ZVj_kaaOwIJ.mjs} +1 -1
- package/node/esm/index.mjs +583 -574
- package/node/esm/{D60xUWK_BS-7PMLM.mjs → jsycByMMbwMZibUQ.mjs} +1 -1
- package/package.json +8 -8
- package/types/index.d.ts +40 -30
- package/browser/cjs/Bt0-HMKtnBRB6IpI.cjs +0 -20
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Color as
|
|
2
|
-
import { StyledStrokePath as
|
|
1
|
+
import { Color as ft, IColor as yr, ITheme as Pl, CommonUtils as gt, IBorder as we, IFont as Ht, NumberFormat as mt, IFontCollection as Rl, IStyle as ce, ITextFrame as Ml, Table as Vn, IFill as xn, CoordUtils as Nl, ISheet as Ft, LicenseManager as Eo, Workbook as On, TypesUtils as Fl } from "@sheetxl/sdk";
|
|
2
|
+
import { StyledStrokePath as Ol, StaticBorderRenderer as _n, FontUtils as Bl, useModelListener as We, createCellEditStateFromCell as Al, SheetCellEditor as Il, ScriptEditor as Ll, useTaskPaneArea as wa, DefaultTaskPaneRegistry as Un, useDocThemes as Gn, TabStrip as zl, SheetElement as Hl, SheetScrollbar as wr, PictureEditor as Wl, ChartEditor as jl, EmptyFrame as $l, LogoNoPaddingIcon as Vl, TaskPaneArea as _l, TaskPaneProvider as Ul } from "@sheetxl/react";
|
|
3
3
|
import { jsxs as H, Fragment as le, jsx as o } from "react/jsx-runtime";
|
|
4
|
-
import
|
|
5
|
-
import { Box as B, Typography as
|
|
6
|
-
import { CommandButton as
|
|
7
|
-
import { useCommands as Ie, CommandButtonType as
|
|
8
|
-
import { useTheme as
|
|
4
|
+
import ae, { memo as q, forwardRef as X, useMemo as W, useCallback as U, isValidElement as qn, useState as _, useEffect as de, Suspense as Sa, useRef as xe, createElement as ke, useReducer as tn, version as Gl, useLayoutEffect as St, useImperativeHandle as ql, useContext as Kl, cloneElement as Xl, Component as Yl } from "react";
|
|
5
|
+
import { Box as B, Typography as Pe, IconButton as st, MenuItem as va, Divider as mo, Button as Jo, SvgIcon as ka, Input as Kn, FormControlLabel as Rt, Checkbox as Mt, FormControl as Xn, TextField as Ca, InputAdornment as Zl, Slider as Ql, Paper as no, CircularProgress as Jl, Select as es, Tabs as Ta, Tab as Ea, useMediaQuery as Da, Card as ts, CardActions as os, Collapse as ns, DialogTitle as rs, CssBaseline as as } from "@mui/material";
|
|
6
|
+
import { CommandButton as N, ExhibitDivider as Q, defaultCreatePopupPanel as ge, CommandPopupButton as Se, InputCommandButton as is, SimpleTooltip as vt, LoadingPanel as Wt, PopupButtonType as ot, ExhibitPopupIconButton as kt, ExhibitPopupMenuItem as Yn, ExhibitMenuItem as ct, createStrokeShadowFilter as Sr, strokeShadowFilter as ls, ExhibitTooltip as nt, ExhibitIconButton as bt, CommandTooltip as Zn, SelectedIcon as on, SimpleCommandPopupButton as tt, LabelIcon as nn, ExhibitMenuHeader as ro, ContextMenu as Pa, ExhibitOptionButton as ss, hexToRGB as vr, useFloatStack as ao, elevateColor as at, CommandToolbar as rn, createScrollEdgeButton as cs, createScrollEndButton as ds, createScrollStartButton as ps, scrollbarTheming as us, StackTrace as ms, useResolvedThemeMode as Ra, ThemeMode as Bn, useModal as hs, useLazyWindow as gs, useOptionsDialog as fs, useInputDialog as bs, AnimatedTraversingEllipsisIcon as xs, ErrorPanel as ys, createExhibitTheme as kr, ModalProvider as ws } from "@sheetxl/utils-mui";
|
|
7
|
+
import { useCommands as Ie, CommandButtonType as re, useCallbackRef as Y, ReactUtils as an, KeyCodes as me, DynamicIcon as he, useCommand as jt, useMouseDownAndHoldListener as Cr, useEditMode as ln, useNotifier as sn, NotifierType as wt, useImperativeElement as Ct, SplitPane as Qn, RoundedTab as Ss, SimpleCommand as He, Command as be, KeyModifiers as fe, CommandGroup as Jn, ToolTipPlacement as ho, ScrollPane as vs, useUndoManager as ks, DefaultReactNotifier as Cs, NotifierProvider as Ts, DefaultDynamicIconService as Ma, UncaughtErrorBoundary as Es, ReactErrorBoundary as Ds } from "@sheetxl/utils-react";
|
|
8
|
+
import { useTheme as Ke, alpha as ye, getOverlayAlpha as Oe, ThemeProvider as Na } from "@mui/material/styles";
|
|
9
9
|
import { alpha as Qe } from "@mui/system";
|
|
10
|
-
import Qt, { createPortal as
|
|
11
|
-
import { CommonUtils as to, ChainedError as An, ErrorUtils as
|
|
10
|
+
import Qt, { createPortal as Ps } from "react-dom";
|
|
11
|
+
import { CommonUtils as to, ChainedError as An, ErrorUtils as Rs, ExpectedError as Ms, PartialError as Ns, UndoManager as Fs } from "@sheetxl/utils";
|
|
12
12
|
import { IOUtils as Jt } 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.9
|
|
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.
|
|
@@ -25,11 +25,11 @@ function Fa(n) {
|
|
|
25
25
|
} else for (t in n) n[t] && (e && (e += " "), e += t);
|
|
26
26
|
return e;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Te() {
|
|
29
29
|
for (var n, a, t = 0, e = "", r = arguments.length; t < r; t++) (n = arguments[t]) && (a = Fa(n)) && (e && (e += " "), e += a);
|
|
30
30
|
return e;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const Os = q(X((n, a) => {
|
|
33
33
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, parentFloat: c, ...p } = n, i = Ie(t, ["formatAlignLeftToggle", "formatAlignCenterToggle", "formatAlignRightToggle", "formatAlignJustifyToggle", "formatAlignCenterContinuousToggle", "formatAlignFillToggle", "formatAlignDistributedHorizontalToggle"]), s = W(() => {
|
|
34
34
|
for (let g = 0; g < i.length; g++) if (i[g]?.state()) return i[g];
|
|
35
35
|
return i[0];
|
|
@@ -38,29 +38,29 @@ const Fs = q(X((n, a) => {
|
|
|
38
38
|
const g = { ...e };
|
|
39
39
|
return delete g.beforeExecute, g;
|
|
40
40
|
}, [e]), x = U((g, m) => {
|
|
41
|
-
const u = { variant:
|
|
41
|
+
const u = { variant: re.Menuitem, commandHook: e, scope: r, disabled: l }, b = H(le, { children: [o(N, { ...u, command: m.getCommand("formatAlignLeftToggle") }), o(N, { ...u, command: m.getCommand("formatAlignCenterToggle") }), o(N, { ...u, command: m.getCommand("formatAlignRightToggle") }), o(N, { ...u, command: m.getCommand("formatAlignJustifyToggle") }), o(Q, { orientation: "horizontal" }), o(N, { ...u, command: m.getCommand("formatAlignCenterContinuousToggle") }), o(N, { ...u, command: m.getCommand("formatAlignFillToggle") }), o(N, { ...u, command: m.getCommand("formatAlignDistributedHorizontalToggle") })] }), y = H(B, { sx: { className: Te("quick-buttons"), display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (h) => h.stopPropagation(), children: [o(N, { command: m.getCommand("formatIndentDecrease"), commandHook: d, scope: r, disabled: l }), o(N, { command: m.getCommand("formatIndentIncrease"), commandHook: d, scope: r, disabled: l })] }), f = H(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...p, children: [y, o(Q, { orientation: "horizontal" }), o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: b })] });
|
|
42
42
|
return ge({ ...g, children: f });
|
|
43
43
|
}, [l, e]);
|
|
44
|
-
return o(
|
|
45
|
-
})),
|
|
44
|
+
return o(Se, { ref: a, parentFloat: c, commands: t, commandHook: e, scope: r, createPopupPanel: x, label: "Horizontal Alignment", tooltip: "Configure how text is placed in the horizontal direction of the cell.", quickCommand: s?.key(), icon: s?.icon() ?? "FormatAlignLeft", ...p });
|
|
45
|
+
})), Bs = q(X((n, a) => {
|
|
46
46
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = Ie(t, ["formatAlignTopToggle", "formatAlignMiddleToggle", "formatAlignBottomToggle", "formatAlignJustifyVerticalToggle", "formatAlignDistributedVerticalToggle"]), i = W(() => {
|
|
47
47
|
for (let d = 0; d < p.length; d++) if (p[d]?.state()) return p[d];
|
|
48
48
|
return p[0];
|
|
49
49
|
}, [p]), s = U((d, x) => {
|
|
50
|
-
const g = { variant:
|
|
50
|
+
const g = { variant: re.Menuitem, commandHook: e, scope: r, disabled: l }, m = H(le, { children: [o(N, { ...g, command: x.getCommand("formatAlignTopToggle") }), o(N, { ...g, command: x.getCommand("formatAlignMiddleToggle") }), o(N, { ...g, command: x.getCommand("formatAlignBottomToggle") }), o(Q, { orientation: "horizontal" }), o(N, { ...g, command: x.getCommand("formatAlignJustifyVerticalToggle") }), o(N, { ...g, command: x.getCommand("formatAlignDistributedVerticalToggle") })] });
|
|
51
51
|
return ge({ ...d, children: m });
|
|
52
52
|
}, [l, e]);
|
|
53
|
-
return o(
|
|
54
|
-
})),
|
|
53
|
+
return o(Se, { ref: a, commands: t, commandHook: e, createPopupPanel: s, label: "Vertical Alignment", tooltip: "Configure how text is placed in the vertical direction of the cell.", icon: i?.icon() ?? "TextVerticalBottom", ...c });
|
|
54
|
+
})), As = q(X((n, a) => {
|
|
55
55
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = Ie(t, ["formatTextOverflowVisibleToggle", "formatTextOverflowWrapToggle", "formatTextOverflowClipToggle", "formatTextOverflowShrinkToggle"]), i = W(() => {
|
|
56
56
|
for (let d = 0; d < p.length; d++) if (p[d]?.state()) return p[d];
|
|
57
57
|
return p[0];
|
|
58
58
|
}, [p]), s = Y((d, x) => {
|
|
59
|
-
const g = { variant:
|
|
59
|
+
const g = { variant: re.Menuitem, commandHook: e, scope: r, disabled: l }, m = H(le, { children: [o(N, { ...g, command: x.getCommand("formatTextOverflowVisibleToggle") }), o(N, { ...g, command: x.getCommand("formatTextOverflowWrapToggle") }), o(N, { ...g, command: x.getCommand("formatTextOverflowClipToggle") }), o(Q, { orientation: "horizontal" }), o(N, { ...g, command: x.getCommand("formatTextOverflowShrinkToggle") })] });
|
|
60
60
|
return ge({ ...d, children: m });
|
|
61
61
|
}, [l, e, r]);
|
|
62
|
-
return o(
|
|
63
|
-
})),
|
|
62
|
+
return o(Se, { ref: a, commands: t, commandHook: e, scope: r, label: "Text Overflow", tooltip: "Configure how text behaves when it doesn't fit within a cell.", createPopupPanel: s, icon: i?.icon() ?? "TextHorizontalOverflow", ...c });
|
|
63
|
+
})), Is = q(X((n, a) => {
|
|
64
64
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = Ie(t, ["formatTextRotate0", "formatTextRotate315", "formatTextRotate45", "formatTextRotate90", "formatTextRotate270", "formatSubscriptToggle", "formatTextRotateCustom"]), i = W(() => {
|
|
65
65
|
const x = p.length;
|
|
66
66
|
for (let g = 0; g < x; g++) {
|
|
@@ -69,11 +69,11 @@ const Fs = q(X((n, a) => {
|
|
|
69
69
|
}
|
|
70
70
|
return p[1];
|
|
71
71
|
}, [p]), s = U((x, g) => {
|
|
72
|
-
const m = { variant:
|
|
72
|
+
const m = { variant: re.Menuitem, commandHook: e, scope: r, disabled: l }, u = H(le, { children: [o(N, { ...m, command: g.getCommand("formatTextRotate0") }), o(Q, { orientation: "horizontal" }), o(N, { ...m, command: g.getCommand("formatTextRotate315") }), o(N, { ...m, command: g.getCommand("formatTextRotate45") }), o(N, { ...m, command: g.getCommand("formatTextRotate90") }), o(N, { ...m, command: g.getCommand("formatTextRotate270") }), o(Q, { orientation: "horizontal" }), o(is, { ...m, command: g.getCommand("formatTextRotateCustom"), label: "Custom" })] });
|
|
73
73
|
return ge({ ...x, children: u });
|
|
74
74
|
}, [l, e, r, t]), d = W(() => (t.getCommand("formatTextRotateCustom")?.state() ?? 0) !== 0, [p]);
|
|
75
|
-
return o(
|
|
76
|
-
})),
|
|
75
|
+
return o(Se, { ref: a, commands: t, commandHook: e, scope: r, selected: d, label: "Text Orientation", tooltip: "Rotate your text diagonally or vertically. This is a great way to label narrow columns.", createPopupPanel: s, quickCommand: d ? "formatTextRotate0" : "formatTextRotate315", icon: i?.icon() ?? "TextRotation315", ...c });
|
|
76
|
+
})), Ls = { Preset: "preset", Custom: "custom" }, Ro = { Start: "start", End: "end" }, yn = {}, zs = (n, a, t, e) => {
|
|
77
77
|
const r = n + "-" + a + "-" + t + (e ? "-server" : "");
|
|
78
78
|
if (yn[r]) return yn[r];
|
|
79
79
|
const l = ((c, p, i, s) => {
|
|
@@ -84,10 +84,10 @@ const Fs = q(X((n, a) => {
|
|
|
84
84
|
return x ? (x.fillStyle = c, x.fillRect(0, 0, d.width, d.height), x.fillStyle = p, x.fillRect(0, 0, i, i), x.translate(i, i), x.fillRect(0, 0, i, i), d.toDataURL()) : null;
|
|
85
85
|
})(n, a, t, e);
|
|
86
86
|
return yn[r] = l, l;
|
|
87
|
-
},
|
|
88
|
-
const { className: a, style: t = an.EmptyCssProperties, white: e = "transparent", grey: r = "grey", size: l = 8, borderRadius: c, boxShadow: p, renderers: i =
|
|
89
|
-
return qn(s) ?
|
|
90
|
-
}),
|
|
87
|
+
}, Hs = {}, Ws = q((n) => {
|
|
88
|
+
const { className: a, style: t = an.EmptyCssProperties, white: e = "transparent", grey: r = "grey", size: l = 8, borderRadius: c, boxShadow: p, renderers: i = Hs, children: s, ...d } = n, x = s, g = W(() => Object.assign({ borderRadius: c, boxShadow: p, position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", background: `url(${zs(e, r, l, i?.canvas)}) center left` }, t), [e, r, l, i]);
|
|
89
|
+
return qn(s) ? ae.cloneElement(s, { ...x.props }) : o("div", { style: g, ...d });
|
|
90
|
+
}), js = q((n) => {
|
|
91
91
|
const { selectedColor: a, onSelectColor: t, onPreviewColor: e, onClick: r, onKeyDown: l, onMouseOver: c, onMouseLeave: p, onFocus: i, style: s = an.EmptyCssProperties, children: d, alphaWhite: x, alphaGrey: g, darkMode: m, alphaCheckSize: u = 7, ...b } = n;
|
|
92
92
|
if (!a) throw new Error("a selectedColor is required");
|
|
93
93
|
const y = U((C) => {
|
|
@@ -100,17 +100,17 @@ const Fs = q(X((n, a) => {
|
|
|
100
100
|
i?.(C), C.isDefaultPrevented() || e?.(a.toRGBA());
|
|
101
101
|
}, [e, i, a]), v = U((C) => {
|
|
102
102
|
l?.(C), C.isDefaultPrevented() || C.keyCode === me.Enter && t?.(a.toRGBA());
|
|
103
|
-
}, [t, l, a]), S = W(() => a.toRGBA().alpha === 1 ? null : o(
|
|
103
|
+
}, [t, l, a]), S = W(() => a.toRGBA().alpha === 1 ? null : o(Ws, { size: u, white: x, grey: g, style: { position: "absolute", width: "calc(100% - 1.5px)", height: "calc(100% - 1.5px)", top: "0.75px", left: "0.75px" } }), [x, g, a]);
|
|
104
104
|
return H("div", { style: { position: "absolute", height: "100%", width: "100%", top: "0px", left: "0px", cursor: "pointer", outline: "none", ...s }, tabIndex: 0, ...b, onClick: y, onKeyDown: v, onMouseOver: f, onMouseLeave: h, onFocus: w, children: [S, o("div", { style: { position: "absolute", top: "0px", left: "0px", height: "100%", width: "100%", background: a.toCSS(m) }, children: d })] });
|
|
105
105
|
}), er = q((n) => {
|
|
106
|
-
const { schemeColorLookup: a, selectedColor: t, previewColor: e, colorDef: r, onSelectColorDef: l, onPreviewColorDef: c, swatchProps: p, defaultButtonSize: i = 24, isLarge: s = !1, compareRGB: d = !1, darkMode: x = !1, ...g } = n, m = new
|
|
106
|
+
const { schemeColorLookup: a, selectedColor: t, previewColor: e, colorDef: r, onSelectColorDef: l, onPreviewColorDef: c, swatchProps: p, defaultButtonSize: i = 24, isLarge: s = !1, compareRGB: d = !1, darkMode: x = !1, ...g } = n, m = new ft({ val: r.definition.val, adjs: r.definition.adjs }, (S) => a(S)), u = d ? m.toRGBA().toString() : m.toString(), b = t && (d ? t.toRGBA().toString() : t.toString()) === u, y = e && (d ? e.toRGBA().toString() : e.toString()) === u, f = [];
|
|
107
107
|
f.push({ [yr.AdjustmentType.Inv]: !0 }), f.push({ [yr.AdjustmentType.Alpha]: 100 });
|
|
108
108
|
const h = m.adjust(f), w = U(() => {
|
|
109
109
|
l?.(r);
|
|
110
110
|
}, [l, r]), v = U((S) => {
|
|
111
111
|
c?.(S ? r : null);
|
|
112
112
|
}, [c, r]);
|
|
113
|
-
return o(vt, { disableInteractive: !0, PopperProps: { style: { pointerEvents: "none" }, disablePortal: !0, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: !0, options: { boundariesElement: "viewport" } }] } }, title: r.description, placement: "bottom-start", children: o("div", { style: { width: i * (s ? 1.2 : 1) + "px", height: i * (s ? 1.2 : 1) + "px", position: "relative", boxSizing: "border-box", cursor: "pointer", outline: "none" }, ...g, children: H(
|
|
113
|
+
return o(vt, { disableInteractive: !0, PopperProps: { style: { pointerEvents: "none" }, disablePortal: !0, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: !0, options: { boundariesElement: "viewport" } }] } }, title: r.description, placement: "bottom-start", children: o("div", { style: { width: i * (s ? 1.2 : 1) + "px", height: i * (s ? 1.2 : 1) + "px", position: "relative", boxSizing: "border-box", cursor: "pointer", outline: "none" }, ...g, children: H(js, { selectedColor: m, title: null, onSelectColor: w, onPreviewColor: v, alphaCheckSize: s ? 9 : void 0, darkMode: x, ...p, children: [o("div", { style: { position: "absolute", width: "100%", height: "100%", top: "0px", left: "0px", pointerEvents: "none", borderColor: h.toRGBA(x).toString(), borderWidth: "2px", borderStyle: "solid", boxSizing: "border-box", opacity: b ? "1" : "0" } }), o("div", { style: { position: "absolute", width: 0.33 * i * (s ? 1.2 : 1) + "px", height: 0.33 * i * (s ? 1.2 : 1) + "px", left: "calc(50% - 0.5px)", top: "calc(50% - 0.5px)", transform: "translate(-50%,-50%)", pointerEvents: "none", background: h.toRGBA(x).toString(), borderRadius: "50%", opacity: y ? "1" : "0" } })] }) }) });
|
|
114
114
|
}), Lo = q((n) => {
|
|
115
115
|
const { title: a, schemeColorLookup: t, colorDefs: e, selectedColor: r, previewColor: l, onSelectColorDef: c, onPreviewColorDef: p, style: i = an.EmptyCssProperties, compareRGB: s = !1, darkMode: d, swatchProps: x, ...g } = n;
|
|
116
116
|
let m;
|
|
@@ -135,47 +135,47 @@ const Fs = q(X((n, a) => {
|
|
|
135
135
|
h.push(C);
|
|
136
136
|
}
|
|
137
137
|
return h;
|
|
138
|
-
}, [m, r, l, u, b]), f = W(() => a ? o(
|
|
138
|
+
}, [m, r, l, u, b]), f = W(() => a ? o(Pe, { noWrap: !0, component: "div", sx: { display: "flex", flexShrink: "0", paddingLeft: "6px", paddingBottom: "4px", paddingTop: "0px", userSelect: "none", color: (h) => h.palette.text.secondary }, children: a }) : null, [a]);
|
|
139
139
|
return H(B, { style: { ...i }, children: [f, o(B, { sx: { display: "flex", flexDirection: "row", gap: "6px", marginBottom: "14px", flexWrap: "wrap", justifyContent: "flex-start" }, ...g, children: y })] });
|
|
140
140
|
}), et = (n, a) => ({ description: n, definition: { val: a, adjs: [] } }), Le = (n, a, t, e, r, l) => {
|
|
141
141
|
const c = et(n, a);
|
|
142
142
|
e?.push(c);
|
|
143
|
-
const p = new
|
|
143
|
+
const p = new ft({ val: c.definition.val, adjs: c.definition.adjs }, t), i = p.toString();
|
|
144
144
|
r?.set(i, p);
|
|
145
145
|
const s = p.toRGBA().toString();
|
|
146
146
|
l?.set(s, p);
|
|
147
|
-
},
|
|
148
|
-
const { selectedColor: t = null, previewColor: e = n.selectedColor ?? null, recentColors: r, schemeLookup: l, disableAlpha: c = !1, previewDebounceTime: p = 100, initialPanelType: i, defaultButtonSize: s = 24, width: d, onElementLoad: x, onDone: g, onEyeDropStart: m, onEyeDropStop: u, onPreviewColor: b, onPreviewColorImmediate: y, onSelectColor: f, autoColor: h, autoColorLabel: w = "Automatic", autoColorPosition: v = Ro.Start, compareRGB: S = !1, darkMode: C = !1, ...D } = n, T = e || t, P = Y(b, [b]), R = Y(y, [y]), k = Y(f, [f]), E = Y(m, [m]), M = Y(u, [u]), [I,
|
|
149
|
-
const G = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Map(),
|
|
150
|
-
Le("Primary Background", "bg1",
|
|
151
|
-
const qe =
|
|
152
|
-
if (Le("Dark Red", "C00000",
|
|
153
|
-
const
|
|
154
|
-
G.set(
|
|
147
|
+
}, $s = ae.lazy(() => import("./DTxgrQXbG3N9lW1K.mjs")), Vs = q(X((n, a) => {
|
|
148
|
+
const { selectedColor: t = null, previewColor: e = n.selectedColor ?? null, recentColors: r, schemeLookup: l, disableAlpha: c = !1, previewDebounceTime: p = 100, initialPanelType: i, defaultButtonSize: s = 24, width: d, onElementLoad: x, onDone: g, onEyeDropStart: m, onEyeDropStop: u, onPreviewColor: b, onPreviewColorImmediate: y, onSelectColor: f, autoColor: h, autoColorLabel: w = "Automatic", autoColorPosition: v = Ro.Start, compareRGB: S = !1, darkMode: C = !1, ...D } = n, T = e || t, P = Y(b, [b]), R = Y(y, [y]), k = Y(f, [f]), E = Y(m, [m]), M = Y(u, [u]), [I, F] = _(!1), L = Ke(), O = W(() => l || ft.getDefaultSchemeLookup(), [l]), z = W(() => {
|
|
149
|
+
const G = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Map(), Re = [];
|
|
150
|
+
Le("Primary Background", "bg1", O, Re, G, se), Le("Primary Text", "tx1", O, Re, G, se), Le("Secondary Background", "bg2", O, Re, G, se), Le("Secondary Text", "tx2", O, Re, G, se), Le("Accent 1", "accent1", O, Re, G, se), Le("Accent 2", "accent2", O, Re, G, se), Le("Accent 3", "accent3", O, Re, G, se), Le("Accent 4", "accent4", O, Re, G, se), Le("Accent 5", "accent5", O, Re, G, se), Le("Accent 6", "accent6", O, Re, G, se);
|
|
151
|
+
const qe = Pl.buildPalette(Re, O, G, se), Ee = [];
|
|
152
|
+
if (Le("Dark Red", "C00000", O, Ee, G, se), Le("Red", "FF0000", O, Ee, G, se), Le("Orange", "FFC000", O, Ee, G, se), Le("Yellow", "FFFF00", O, Ee, G, se), Le("Light Green", "92D050", O, Ee, G, se), Le("Green", "00B050", O, Ee, G, se), Le("Light Blue", "00B0F0", O, Ee, G, se), Le("Blue", "0070C0", O, Ee, G, se), Le("Dark Blue", "002060", O, Ee, G, se), c ? Le("Purple Is A Fruit", "7030A0", O, Ee, G, se) : Le("Transparent", "00000000", O, Ee, G, se), h) {
|
|
153
|
+
const Me = h.toString();
|
|
154
|
+
G.set(Me, h);
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
for (let
|
|
158
|
-
const te =
|
|
159
|
-
|
|
156
|
+
const rt = /* @__PURE__ */ new Map(), Xe = typeof r == "function" ? r() : r, dt = [];
|
|
157
|
+
for (let Me = 0; Xe && Me < Xe.length; Me++) {
|
|
158
|
+
const te = Xe[Me].toString();
|
|
159
|
+
rt.set(te, Xe[Me]), dt.push({ description: "Recent " + (Me + 1), definition: { val: Xe[Me].toString() } });
|
|
160
160
|
}
|
|
161
|
-
return { primaryColors:
|
|
162
|
-
}, [
|
|
161
|
+
return { primaryColors: Re, modifiedPresets: qe, standardColors: Ee, recentColorsLimited: dt, mapAllPresets: G, mapAllPresetsRGB: se, mapRecent: rt };
|
|
162
|
+
}, [O, r, c, h]);
|
|
163
163
|
de(() => {
|
|
164
164
|
x?.();
|
|
165
165
|
}, []);
|
|
166
|
-
const [
|
|
167
|
-
|
|
166
|
+
const [ie, J] = _(!1), pe = U(() => {
|
|
167
|
+
J((G) => !G);
|
|
168
168
|
}, []);
|
|
169
169
|
de(() => {
|
|
170
|
-
if (i)
|
|
170
|
+
if (i) J(i === Ls.Custom);
|
|
171
171
|
else if (t) {
|
|
172
172
|
let G = t.toString(), se = z.mapAllPresets.get(G);
|
|
173
173
|
se || (G = t.toRGBA().toString(), se = z.mapAllPresetsRGB.get(G));
|
|
174
|
-
const
|
|
175
|
-
|
|
174
|
+
const Re = z.mapRecent.get(G);
|
|
175
|
+
J(!se && !Re);
|
|
176
176
|
}
|
|
177
177
|
}, [t, i]);
|
|
178
|
-
const j = U(
|
|
178
|
+
const j = U(gt.debounce((G) => {
|
|
179
179
|
P?.(G);
|
|
180
180
|
}, p), [P, p]), [K, ee] = _();
|
|
181
181
|
de(() => {
|
|
@@ -184,61 +184,61 @@ const Fs = q(X((n, a) => {
|
|
|
184
184
|
const V = Y((G) => {
|
|
185
185
|
R && (R(G), j(G));
|
|
186
186
|
}, [R]), A = Y((G) => {
|
|
187
|
-
V(G ? new
|
|
188
|
-
}, [
|
|
189
|
-
G.ctrlKey &&
|
|
187
|
+
V(G ? new ft({ val: G.definition.val, adjs: G.definition.adjs }, O) : null);
|
|
188
|
+
}, [O]), Z = U((G) => {
|
|
189
|
+
G.ctrlKey && J(!0);
|
|
190
190
|
}, []), oe = Y((G) => {
|
|
191
191
|
let se = !1;
|
|
192
192
|
if (G) {
|
|
193
|
-
const
|
|
194
|
-
se = !z.mapAllPresets.has(
|
|
193
|
+
const Re = G.toString();
|
|
194
|
+
se = !z.mapAllPresets.has(Re);
|
|
195
195
|
}
|
|
196
196
|
k?.(G, se);
|
|
197
|
-
}, [k, z]),
|
|
198
|
-
const se = G ? new
|
|
197
|
+
}, [k, z]), Be = Y((G) => {
|
|
198
|
+
const se = G ? new ft({ val: G.definition.val, adjs: G.definition.adjs }, O) : null;
|
|
199
199
|
Promise.resolve(g?.()).then(() => {
|
|
200
200
|
oe(se);
|
|
201
201
|
});
|
|
202
|
-
}, [
|
|
203
|
-
V(G ? new
|
|
204
|
-
}, [
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
let se = new
|
|
208
|
-
if (qe || (
|
|
209
|
-
const
|
|
210
|
-
let
|
|
211
|
-
z.mapAllPresetsRGB.forEach((dt,
|
|
212
|
-
const te = dt.toRGBA(),
|
|
213
|
-
|
|
202
|
+
}, [O, g]), ve = Y((G) => {
|
|
203
|
+
V(G ? new ft(G, O) : null);
|
|
204
|
+
}, [O]), Ne = W(() => window.EyeDropper === void 0 ? o(le, {}) : o(st, { "aria-label": "eye dropper", size: "small", sx: { color: (G) => G.palette.text.icon ?? G.palette.action.active }, onClick: async () => {
|
|
205
|
+
F(!0), E?.(), await new EyeDropper().open().then((G) => {
|
|
206
|
+
F(!1), M?.();
|
|
207
|
+
let se = new ft(G.sRGBHex), Re = se.toString(), qe = z.mapAllPresets.get(Re);
|
|
208
|
+
if (qe || (Re = se.toRGBA().toString(), qe = z.mapAllPresetsRGB.get(Re)), !qe) {
|
|
209
|
+
const Ee = se.toRGBA(), rt = 3;
|
|
210
|
+
let Xe = 255;
|
|
211
|
+
z.mapAllPresetsRGB.forEach((dt, Me) => {
|
|
212
|
+
const te = dt.toRGBA(), Ce = Math.abs(te.red - Ee.red) + Math.abs(te.blue - Ee.blue) + Math.abs(te.green - Ee.green);
|
|
213
|
+
Ce < rt && Ce < Xe && (qe = dt);
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
|
|
216
|
+
J(!qe), V(qe || se);
|
|
217
217
|
}).catch((G) => {
|
|
218
|
-
|
|
218
|
+
F(!1), G?.name !== "AbortError" && console.error(G);
|
|
219
219
|
});
|
|
220
|
-
}, children: o(he, { iconKey: "Colorize" }) }), [z, C]),
|
|
221
|
-
if (!
|
|
222
|
-
const G = { opacity:
|
|
223
|
-
return o(Sa, { fallback: o("div", { style: G, children: o(Wt, {}) }), children: o(
|
|
224
|
-
}, [
|
|
220
|
+
}, children: o(he, { iconKey: "Colorize" }) }), [z, C]), _e = W(() => {
|
|
221
|
+
if (!ie) return;
|
|
222
|
+
const G = { opacity: ie ? 1 : "0", position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", boxSizing: "border-box" };
|
|
223
|
+
return o(Sa, { fallback: o("div", { style: G, children: o(Wt, {}) }), children: o($s, { style: G, selectedColor: T ? T.toRGBA().toString() : "transparent", onColorChange: ve, disableAlpha: c }) });
|
|
224
|
+
}, [ie, T]), Ve = W(() => ({ onClick: Z, alphaGrey: L.palette.text.icon ?? L.palette.action.active }), [Z, L]), ne = W(() => {
|
|
225
225
|
if (!h) return null;
|
|
226
226
|
const G = { description: w, definition: { val: h.getVal(), adjs: h.getAdjustments() } };
|
|
227
227
|
return o(le, { children: H(va, { sx: { display: "flex", color: (se) => se.palette.text.secondary }, onMouseOver: () => {
|
|
228
228
|
A(null);
|
|
229
229
|
}, onClick: () => {
|
|
230
|
-
|
|
231
|
-
}, children: [o(B, { sx: { flex: "none", boxShadow: (se) => se.shadows[2], borderRadius: (se) => se.spacing(0.5), overflow: "hidden" }, children: o(er, { schemeColorLookup:
|
|
232
|
-
}, [h, w,
|
|
233
|
-
return H(B, { ref: a, sx: { width: d, outline: "none", padding: "10px 10px", overflow: "hidden", boxSizing: "content-box" }, ...D, children: [H("div", { style: { position: "relative", display: "flex" }, children: [H("div", { style: { opacity:
|
|
234
|
-
|
|
235
|
-
}, children: o("div",
|
|
230
|
+
Be(null);
|
|
231
|
+
}, children: [o(B, { sx: { flex: "none", boxShadow: (se) => se.shadows[2], borderRadius: (se) => se.spacing(0.5), overflow: "hidden" }, children: o(er, { schemeColorLookup: O, colorDef: G, selectedColor: t === null ? h : t, previewColor: e === null ? h : e, defaultButtonSize: s, isLarge: !0, darkMode: C, compareRGB: S, swatchProps: Ve }) }), o(Pe, { noWrap: !0, component: "div", style: { display: "flex", flex: "1 1 100%", marginLeft: "8px", userSelect: "none" }, children: w })] }) });
|
|
232
|
+
}, [h, w, O, t, e]);
|
|
233
|
+
return H(B, { ref: a, sx: { width: d, outline: "none", padding: "10px 10px", overflow: "hidden", boxSizing: "content-box" }, ...D, children: [H("div", { style: { position: "relative", display: "flex" }, children: [H("div", { style: { opacity: ie ? "0" : 1 }, children: [ne && v === Ro.Start ? H(le, { children: [ne, o(mo, { light: !0, style: { marginTop: "2px", marginBottom: "10px" } })] }) : null, o(Lo, { title: "Theme Colors", schemeColorLookup: O, colorDefs: z.primaryColors, selectedColor: t, previewColor: e === void 0 ? t : e, swatchProps: Ve, onPreviewColorDef: A, onSelectColorDef: Be, compareRGB: S, darkMode: C }), o(Lo, { schemeColorLookup: O, colorDefs: z.modifiedPresets, selectedColor: t, previewColor: e === void 0 ? t : e, swatchProps: Ve, onPreviewColorDef: A, onSelectColorDef: Be, compareRGB: S, darkMode: C }), o(mo, { light: !0, style: { marginBottom: "10px" } }), o(Lo, { title: "Standard Colors", schemeColorLookup: O, colorDefs: z.standardColors, selectedColor: t, previewColor: e === void 0 ? t : e, swatchProps: Ve, onPreviewColorDef: A, onSelectColorDef: Be, compareRGB: S, darkMode: C }), H("div", { style: { opacity: z.recentColorsLimited.length === 0 ? "0" : void 0, display: z.recentColorsLimited.length === 0 ? "none" : void 0 }, children: [o(mo, { light: !0, style: { marginBottom: "10px" } }), o(Lo, { title: "Recent Colors", schemeColorLookup: O, colorDefs: z.recentColorsLimited, selectedColor: t, previewColor: e === void 0 ? t : e, swatchProps: Ve, onPreviewColorDef: A, onSelectColorDef: Be, compareRGB: S, darkMode: C })] }), ne && v === Ro.End ? H(le, { children: [o(mo, { light: !0, sx: { marginTop: "2px", marginBottom: "2px" } }), ne, o("div", { style: { marginBottom: "2px" } })] }) : null] }), _e] }), o(mo, { light: !0, style: { marginBottom: "10px" } }), H("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-around", gap: "8px", paddingLeft: "2px", paddingRight: "2px" }, children: [Ne, o("div", { style: { flex: "1 1 100%", background: "pink" } }), o(Jo, { style: { minWidth: "75px", maxWidth: "75px" }, value: "check", variant: "outlined", size: "small", onClick: () => {
|
|
234
|
+
pe();
|
|
235
|
+
}, children: o("div", ie ? { children: "Preset" } : { children: "Custom" }) }), o(Jo, { variant: "contained", size: "small", style: { minWidth: "75px" }, onClick: () => {
|
|
236
236
|
Promise.resolve(g?.()).then(() => {
|
|
237
237
|
oe(K);
|
|
238
238
|
});
|
|
239
239
|
}, children: "Done" })] })] });
|
|
240
|
-
})),
|
|
241
|
-
const { selectedColor: t, quickColor: e, icon: r =
|
|
240
|
+
})), _s = o(he, { iconKey: "circle.colored" }), Oa = q(X((n, a) => {
|
|
241
|
+
const { selectedColor: t, quickColor: e, icon: r = _s, tooltip: l, label: c, onPreviewColor: p, onPreviewColorImmediate: i, onSelectColor: s, variant: d = ot.Toolbar, panelProps: x, shouldCloseFloatAll: g = !0, compareRGB: m = !1, darkMode: u = !1, ...b } = n, y = Y(p, [p]), f = Y(i, [i]), h = Y(s, [s]), [w, v] = _(() => {
|
|
242
242
|
}), S = e || w || t || x?.autoColor, C = xe(!1), D = U(() => {
|
|
243
243
|
}, []), T = Y(() => {
|
|
244
244
|
v(t);
|
|
@@ -246,21 +246,21 @@ const Fs = q(X((n, a) => {
|
|
|
246
246
|
C.current || (v(z), y?.(z));
|
|
247
247
|
}, [y]), R = Y((z) => {
|
|
248
248
|
C.current || (v(z), f?.(z));
|
|
249
|
-
}, [f]), k = Y((z,
|
|
250
|
-
C.current || (v(void 0), h?.(z,
|
|
249
|
+
}, [f]), k = Y((z, ie) => {
|
|
250
|
+
C.current || (v(void 0), h?.(z, ie));
|
|
251
251
|
}, [h]), E = W(() => o(B, { className: "color-wrapper", sx: { lineHeight: "0", color: "inherit", "--sxl-color-active": `${S?.toCSS(u) ?? "transparent"}`, "& .activeColor": { fill: `${S?.toCSS(u) ?? "transparent"}` }, "& .style_grey": { fill: (z) => z.palette.text.icon ?? z.palette.action.active } }, children: typeof r == "function" ? r() : r }), [S, r, u]), M = Y((z) => {
|
|
252
252
|
h?.(e, !1);
|
|
253
|
-
}, [h, e]), [I,
|
|
254
|
-
const { closeFloat:
|
|
255
|
-
return o(
|
|
256
|
-
|
|
257
|
-
}, onPreviewColorImmediate: R, onPreviewColor: P, onSelectColor: k, onEyeDropStart: () =>
|
|
258
|
-
}, [t, w, g, S, x?.autoColor, u]),
|
|
259
|
-
return d ===
|
|
253
|
+
}, [h, e]), [I, F] = _(!1), L = U((z) => {
|
|
254
|
+
const { closeFloat: ie, closeFloatAll: J } = z;
|
|
255
|
+
return o(Vs, { ...x, selectedColor: t, previewColor: w, onDone: g ? J : ie, onKeyDown: (pe) => {
|
|
256
|
+
pe.which === me.Enter && (g ? J() : ie());
|
|
257
|
+
}, onPreviewColorImmediate: R, onPreviewColor: P, onSelectColor: k, onEyeDropStart: () => F(!0), onEyeDropStop: () => F(!1), compareRGB: m, darkMode: u });
|
|
258
|
+
}, [t, w, g, S, x?.autoColor, u]), O = { onQuickClick: e ? M : void 0, createPopupPanel: L, popupProps: { popperProps: { resizeOnOverflow: !1 } }, onPopupOpen: T, onPopupClose: D, tooltip: l || c || "Color", label: c, icon: E, ...b };
|
|
259
|
+
return d === ot.Toolbar ? o(kt, { ref: a, ...O }) : o(Yn, { ref: a, ...O });
|
|
260
260
|
})), Zo = 82, Tr = (n) => {
|
|
261
261
|
const { styleColor: a, length: t = Zo, width: e = 1, dashArray: r = null, sx: l, isDouble: c = !1, isAngled: p = !1, darkMode: i = !1, ...s } = n;
|
|
262
|
-
return o(ka, { sx: { width: `${t}px`, height: `${e}px`, color: "inherit", overflow: "visible", "& .activeColor": { stroke: (d) => `${a ? a.toRGBA(i).toString() : d.palette.text.icon ?? d.palette.action.active}` }, "& .style_grey": { stroke: (d) => d.palette.text.icon ?? d.palette.action.active }, ...l }, height: e, width: t, viewBox: `0 0 ${t} ${e}`, ...s, children: o(
|
|
263
|
-
},
|
|
262
|
+
return o(ka, { sx: { width: `${t}px`, height: `${e}px`, color: "inherit", overflow: "visible", "& .activeColor": { stroke: (d) => `${a ? a.toRGBA(i).toString() : d.palette.text.icon ?? d.palette.action.active}` }, "& .style_grey": { stroke: (d) => d.palette.text.icon ?? d.palette.action.active }, ...l }, height: e, width: t, viewBox: `0 0 ${t} ${e}`, ...s, children: o(Ol, { length: t, width: e, dashArray: r, isDouble: c, isAngled: p, className: "activeColor" }) });
|
|
263
|
+
}, Us = q(X((n, a) => {
|
|
264
264
|
const { variant: t, showLabels: e = !1, disabled: r = !1, createPopupPanel: l, styleColor: c, selectedStyle: p, onSelectStyle: i, showNone: s = !0, darkMode: d, sx: x, ...g } = n, m = Y(i, []), u = U((h) => {
|
|
265
265
|
const { popupContainer: w, floatReference: v, closeFloat: S, ...C } = h, D = [], T = we.BuiltInDefinitionsArray;
|
|
266
266
|
for (let P = 0; P < T.length; P++) {
|
|
@@ -268,7 +268,7 @@ const Fs = q(X((n, a) => {
|
|
|
268
268
|
if (R.description === "None" && !s) continue;
|
|
269
269
|
const k = o(Tr, { styleColor: c, length: Zo, width: R.width, darkMode: d, dashArray: R.pattern, isDouble: R.description.toLowerCase().includes("double"), isAngled: R.description.toLowerCase().includes("slant") });
|
|
270
270
|
let E = null;
|
|
271
|
-
E = e ? H(le, { children: [o(B, { sx: { marginRight: "6px" }, children: R.description }), H(B, { sx: { marginLeft: "6px", marginRight: "6px", display: "flex", alignItems: "center", flex: "1 1 100%" }, children: [o("div", { style: { flex: "1 1 100%" } }), k] })] }) : R.description === "None" ? "None" : k, D.push(o(ct, { className: "border-stroke", tabIndex: 0, sx: { height: "28px", "& svg path.activeColor": { filter: Sr(4) }, paddingLeft: "16px", background: `linear-gradient(${ye("#fff",
|
|
271
|
+
E = e ? H(le, { children: [o(B, { sx: { marginRight: "6px" }, children: R.description }), H(B, { sx: { marginLeft: "6px", marginRight: "6px", display: "flex", alignItems: "center", flex: "1 1 100%" }, children: [o("div", { style: { flex: "1 1 100%" } }), k] })] }) : R.description === "None" ? "None" : k, D.push(o(ct, { className: "border-stroke", tabIndex: 0, sx: { height: "28px", "& svg path.activeColor": { filter: Sr(4) }, paddingLeft: "16px", background: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})` }, tooltipProps: { description: e ? "" : R.description }, icon: null, disabled: r, onMouseDown: (M) => M.preventDefault(), onMouseUp: () => {
|
|
272
272
|
S(), m(R.style);
|
|
273
273
|
}, onKeyDown: (M) => {
|
|
274
274
|
M.which === me.Enter && S();
|
|
@@ -279,83 +279,83 @@ const Fs = q(X((n, a) => {
|
|
|
279
279
|
const h = we.BuiltInDefinitions.get(p);
|
|
280
280
|
let w;
|
|
281
281
|
return w = h.description === "None" ? o(B, { sx: { minWidth: `${Zo}px` }, children: "None" }) : o(Tr, { styleColor: c, length: Zo, width: h.width, dashArray: h.pattern, darkMode: d, isDouble: h.description.toLowerCase().includes("double"), isAngled: h.description.toLowerCase().includes("slant") }), o(B, { className: "border-stroke", sx: { paddingLeft: "12px", marginLeft: "4px", marginRight: "4px", height: "24px", display: "flex", alignItems: "center", "& svg path.activeColor": { filter: Sr() } }, children: w });
|
|
282
|
-
}, [p, c]), y = W(() => we.BuiltInDefinitions.get(p), [p]), f = { disabled: r, icon: b, tooltip: "Border Style: " + y.description, sx: { background: `linear-gradient(${ye("#fff",
|
|
283
|
-
return t ===
|
|
284
|
-
})),
|
|
282
|
+
}, [p, c]), y = W(() => we.BuiltInDefinitions.get(p), [p]), f = { disabled: r, icon: b, tooltip: "Border Style: " + y.description, sx: { background: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})`, ...x }, createPopupPanel: u, ...g };
|
|
283
|
+
return t === ot.Toolbar ? o(kt, { ...f }) : o(Yn, { ...f });
|
|
284
|
+
})), Gs = q(X((n, a) => {
|
|
285
285
|
const { autoColor: t = null, schemeLookup: e, autoStrokeStyle: r = we.StrokeStyle.Thin, disabled: l = !1, darkMode: c = !1, showStylingBefore: p = !0, onSelectBorder: i, onPreviewBorder: s, selectedBorder: d, createTemporaryBorder: x, ...g } = n, m = Y(i, [i]), u = Y(s, [s]), [b, y] = _(), [f, h] = _(), w = b ?? r, v = f ?? t, S = d || { bottom: { style: r, color: t?.toString() } }, C = Y((E) => {
|
|
286
286
|
const M = {}, I = E ? Object.keys(E) : [];
|
|
287
|
-
let
|
|
287
|
+
let F = !1;
|
|
288
288
|
const L = I.length;
|
|
289
289
|
for (let ee = 0; ee < L; ee++) {
|
|
290
290
|
const V = I[ee];
|
|
291
|
-
E[V]?.style && (M[V] = { style: E[V].style, color: E[V].color },
|
|
291
|
+
E[V]?.style && (M[V] = { style: E[V].style, color: E[V].color }, F || M[V].style === we.StrokeStyle.None || (F = !0));
|
|
292
292
|
}
|
|
293
|
-
I.length < 6 && (
|
|
294
|
-
const
|
|
293
|
+
I.length < 6 && (F = !0);
|
|
294
|
+
const O = F ? M.left : null, z = F ? M.top : null, ie = F ? M.right : null, J = F ? M.bottom : null, pe = F ? M.vertical : null, j = F ? M.horizontal : null;
|
|
295
295
|
let K = "";
|
|
296
|
-
return z ||
|
|
296
|
+
return z || O || (K += "M 3,5 H 5 V 3 H 3 "), z || (K += "M 7,5 H 9 V 3 H 7 "), z || pe || (K += "M 11,5 h 2 V 3 h -2 "), z || (K += "M 15,5 h 2 V 3 h -2 "), z || ie || (K += "M 19,5 h 2 V 3 h -2 "), O || (K += "M 3,9 H 5 V 7 H 3 "), pe || (K += "M 11,9 h 2 V 7 h -2 "), ie || (K += "M 19,9 h 2 V 7 h -2 "), j || O || (K += "M 3,13 H 5 V 11 H 3 "), j || (K += "M 7,13 H 9 V 11 H 7 "), j || pe || (K += "M 11,13 h 2 v -2 h -2 "), j || ie || (K += "M 19,13 h 2 v -2 h -2 "), j || (K += "M 15,13 h 2 v -2 h -2 "), O || (K += "M 3,17 H 5 V 15 H 3 "), pe || (K += "M 11,17 h 2 v -2 h -2 "), ie || (K += "M 19,17 h 2 v -2 h -2 "), J || O || (K += "M 3,21 H 5 V 19 H 3 "), J || (K += "M 7,21 H 9 V 19 H 7 "), J || pe || (K += "M 11,21 h 2 v -2 h -2 "), J || (K += "M 15,21 h 2 v -2 h -2 "), J || ie || (K += "M 19,21 h 2 v -2 h -2 "), H(he, { children: [" ", H(B, { 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: K }) }), o(B, { 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: ls } }, children: o(_n, { getBorderAt: (ee, V) => {
|
|
297
297
|
if (!x || I.length === 0) return null;
|
|
298
298
|
const A = ee.rowIndex, Z = ee.colIndex, oe = {};
|
|
299
299
|
return A === 0 ? (oe.top = M.top, oe.bottom = M.horizontal) : (oe.top = M.horizontal, oe.bottom = M.bottom), Z === 0 ? (oe.left = M.left, oe.right = M.vertical) : (oe.left = M.vertical, oe.right = M.right), x?.(oe);
|
|
300
300
|
}, darkMode: c, style: { top: "2px", left: "2px", width: "calc(100% - 5px)", height: "calc(100% - 5px)", position: "absolute" } }) })] })] });
|
|
301
301
|
}, [v, w, c]), D = U((E, M, I) => {
|
|
302
|
-
let
|
|
302
|
+
let F = null;
|
|
303
303
|
if (E && E.length > 0) {
|
|
304
304
|
let L = null;
|
|
305
|
-
(M || I) && (L = { style: I, color: M?.toString() ?? null }),
|
|
306
|
-
const
|
|
307
|
-
for (let z = 0; z <
|
|
305
|
+
(M || I) && (L = { style: I, color: M?.toString() ?? null }), F = {};
|
|
306
|
+
const O = E.length;
|
|
307
|
+
for (let z = 0; z < O; z++) F[E[z]] = L;
|
|
308
308
|
}
|
|
309
|
-
return
|
|
309
|
+
return F;
|
|
310
310
|
}, []), T = U((E) => {
|
|
311
311
|
m?.(E);
|
|
312
312
|
}, []), P = U((E) => {
|
|
313
313
|
u?.(E);
|
|
314
314
|
}, []), R = U((E) => {
|
|
315
|
-
const { closeFloatAll: M, floatReference: I } = E,
|
|
316
|
-
const j = D(z, v ?? null,
|
|
317
|
-
return o(
|
|
315
|
+
const { closeFloatAll: M, floatReference: I } = E, F = (z, ie, J = "bottom", pe = !1) => {
|
|
316
|
+
const j = D(z, v ?? null, pe ? we.StrokeStyle.None : w ?? null), K = pe ? D([], v ?? null, w ?? null) : j;
|
|
317
|
+
return o(bt, { icon: C(K), sx: { background: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})` }, tooltipProps: { label: ie, simple: !0, placement: J }, onClick: () => {
|
|
318
318
|
M(), P(j), T(j);
|
|
319
319
|
} });
|
|
320
|
-
}, L = H(le, { children: [H(B, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [
|
|
320
|
+
}, L = H(le, { children: [H(B, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [F([we.Edge.Left, we.Edge.Top, we.Edge.Right, we.Edge.Bottom, we.Edge.Horizontal, we.Edge.Vertical], "All Borders", "top"), F([we.Edge.Horizontal, we.Edge.Vertical], "Inner Borders", "top"), F([we.Edge.Horizontal], "Inside Horizontal Borders", "top"), F([we.Edge.Vertical], "Inside Vertical Borders", "top"), F([we.Edge.Left, we.Edge.Top, we.Edge.Right, we.Edge.Bottom], "Outside Borders", "top")] }), H(B, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [F([we.Edge.Left], "Left Borders"), F([we.Edge.Top], "Top Borders"), F([we.Edge.Right], "Right Borders"), F([we.Edge.Bottom], "Bottom Borders"), F([we.Edge.Left, we.Edge.Top, we.Edge.Right, we.Edge.Bottom, we.Edge.Horizontal, we.Edge.Vertical, we.Edge.DiagonalUp, we.Edge.DiagonalDown], "No Borders", "bottom", !0)] })] }), O = o(le, { children: H(B, { sx: { display: "flex", padding: "6px 16px", flexDirection: "row", gap: "6px" }, children: [o(Oa, { variant: ot.Toolbar, icon: o(he, { iconKey: "stroke.colored" }), selectedColor: w === we.StrokeStyle.None ? new ft("transparent") : v, onPreviewColor: (z) => {
|
|
321
321
|
h(z);
|
|
322
|
-
}, onSelectColor: (z,
|
|
322
|
+
}, onSelectColor: (z, ie) => {
|
|
323
323
|
h(z);
|
|
324
|
-
}, darkMode: c, tooltip: "Border Color", panelProps: { disableAlpha: !0, autoColor: t, schemeLookup: e }, disabled: l || w === we.StrokeStyle.None, parentFloat: I, shouldCloseFloatAll: !1 }), o(
|
|
325
|
-
return H(B, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, onClick: (z) => z.stopPropagation(), children: [p ?
|
|
324
|
+
}, darkMode: c, tooltip: "Border Color", panelProps: { disableAlpha: !0, autoColor: t, schemeLookup: e }, disabled: l || w === we.StrokeStyle.None, parentFloat: I, shouldCloseFloatAll: !1 }), o(Us, { selectedStyle: w, onSelectStyle: y, styleColor: v, darkMode: c, variant: ot.Toolbar, parentFloat: I })] }) });
|
|
325
|
+
return H(B, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, onClick: (z) => z.stopPropagation(), children: [p ? O : L, o(Q, { orientation: "horizontal" }), p ? L : O] });
|
|
326
326
|
}, [w, v, t, e, c]), k = W(() => C(S), [S, c]);
|
|
327
|
-
return o(kt, { ref: a, createPopupPanel: R, popupProps: { popperProps: { resizeOnOverflow: !1 } }, createTooltip: ({ children: E }, M) => o(
|
|
327
|
+
return o(kt, { ref: a, createPopupPanel: R, popupProps: { popperProps: { resizeOnOverflow: !1 } }, createTooltip: ({ children: E }, M) => o(nt, { label: "Borders", description: "Set the borders.", disabled: M, children: E }), onQuickClick: () => {
|
|
328
328
|
m?.(S);
|
|
329
329
|
}, quickButtonProps: { sx: {} }, disabled: l, icon: k, ...g });
|
|
330
|
-
})),
|
|
331
|
-
const { commands: t, command: e, commandHook: r, variant: l =
|
|
330
|
+
})), qs = q(X((n, a) => {
|
|
331
|
+
const { commands: t, command: e, commandHook: r, variant: l = re.Toolbar, disabled: c = !1, autoColor: p, autoStrokeStyle: i, schemeLookup: s, createTemporaryBorder: d, selectedBorder: x, onSelectBorder: g, darkMode: m, icon: u, label: b, ...y } = n, f = Ie(t, ["formatBorder"]), h = e ?? f[0], w = h?.context() ?? null, v = w?.autoColor ?? p, S = w?.autoStyle ?? i, C = x ?? w?.quickBorder, D = m ?? w?.darkMode, T = d ?? w?.createTemporaryBorder, P = s ?? w?.schemeLookup, R = Y((E) => {
|
|
332
332
|
w?.onBorderSelect && w.onBorderSelect(E), g?.(E), h?.execute(E, r);
|
|
333
333
|
}, [h, g, r]), k = U((E, M) => {
|
|
334
|
-
const { children: I, title:
|
|
335
|
-
let
|
|
336
|
-
return (h?.disabled() || c) && (
|
|
334
|
+
const { children: I, title: F, ...L } = E;
|
|
335
|
+
let O = E.children;
|
|
336
|
+
return (h?.disabled() || c) && (O = o("div", { children: O })), o(Zn, { command: h, placement: l === re.Toolbar ? "bottom-start" : "right-start", disabled: M, ...L, children: O });
|
|
337
337
|
}, [h, c]);
|
|
338
|
-
return o(
|
|
339
|
-
})), qs = q(X((n, a) => {
|
|
340
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = U((i, s) => {
|
|
341
|
-
const d = { variant: ie.Menuitem, commandHook: e, scope: r, disabled: l }, x = H(le, { children: [o(O, { ...d, command: s.getCommand("mergeToggle") }), o(O, { ...d, command: s.getCommand("mergeHorizontal") }), o(O, { ...d, command: s.getCommand("mergeVertical") }), o(J, { orientation: "horizontal" }), o(O, { ...d, command: s.getCommand("unmerge") })] });
|
|
342
|
-
return ge({ ...i, children: x });
|
|
343
|
-
}, [l, e, r]);
|
|
344
|
-
return o(ve, { ref: a, commands: t, quickCommand: "mergeToggle", commandHook: e, scope: r, tooltip: "Combine or split cells.", createPopupPanel: p, icon: "MergeAll", ...c });
|
|
338
|
+
return o(Gs, { ref: a, autoColor: v, darkMode: D, autoStrokeStyle: S, createTemporaryBorder: T, schemeLookup: P, selectedBorder: C, onSelectBorder: R, createTooltip: k, disabled: c || !h || h.disabled(), ...y });
|
|
345
339
|
})), Ks = q(X((n, a) => {
|
|
346
340
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = U((i, s) => {
|
|
347
|
-
const d = { variant:
|
|
341
|
+
const d = { variant: re.Menuitem, commandHook: e, scope: r, disabled: l }, x = H(le, { children: [o(N, { ...d, command: s.getCommand("mergeToggle") }), o(N, { ...d, command: s.getCommand("mergeHorizontal") }), o(N, { ...d, command: s.getCommand("mergeVertical") }), o(Q, { orientation: "horizontal" }), o(N, { ...d, command: s.getCommand("unmerge") })] });
|
|
348
342
|
return ge({ ...i, children: x });
|
|
349
343
|
}, [l, e, r]);
|
|
350
|
-
return o(
|
|
344
|
+
return o(Se, { ref: a, commands: t, quickCommand: "mergeToggle", commandHook: e, scope: r, tooltip: "Combine or split cells.", createPopupPanel: p, icon: "MergeAll", ...c });
|
|
351
345
|
})), Xs = q(X((n, a) => {
|
|
352
346
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = U((i, s) => {
|
|
353
|
-
const d = { variant:
|
|
347
|
+
const d = { variant: re.Menuitem, commandHook: e, scope: r, disabled: l }, x = H(le, { children: [o(N, { ...d, command: s.getCommand("freezeToggle") }), o(N, { ...d, command: s.getCommand("freezeToggleHorizontal") }), o(N, { ...d, command: s.getCommand("freezeToggleVertical") }), o(Q, { orientation: "horizontal" }), o(N, { ...d, command: s.getCommand("unfreeze") })] });
|
|
354
348
|
return ge({ ...i, children: x });
|
|
355
349
|
}, [l, e, r]);
|
|
356
|
-
return o(
|
|
350
|
+
return o(Se, { ref: a, commands: t, commandHook: e, createPopupPanel: p, quickCommand: "freezeToggle", label: "Freeze Panes", tooltip: "Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.", icon: "Freeze", ...c });
|
|
357
351
|
})), Ys = q(X((n, a) => {
|
|
358
|
-
const {
|
|
352
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = U((i, s) => {
|
|
353
|
+
const d = { variant: re.Menuitem, commandHook: e, scope: r, disabled: l }, x = H(le, { children: [o(N, { ...d, command: s.getCommand("find") }), o(N, { ...d, command: s.getCommand("findReplace") }), o(N, { ...d, command: s.getCommand("goto") })] });
|
|
354
|
+
return ge({ ...i, children: x });
|
|
355
|
+
}, [l, e, r]);
|
|
356
|
+
return o(Se, { ref: a, commands: t, commandHook: e, createPopupPanel: p, label: "Find & Select", tooltip: "Find and replace cells or go to a specific location.", quickCommand: "find", icon: "Find", ...c });
|
|
357
|
+
})), Zs = q(X((n, a) => {
|
|
358
|
+
const { command: t, commandHook: e, showQuickButtons: r = !!n.commands, commands: l, fontSizes: c = Bl.DefaultFontSizes, disabled: p = !1, parentFloat: i, icon: s, label: d, sx: x, ...g } = n;
|
|
359
359
|
jt(t);
|
|
360
360
|
const m = () => t?.state()?.toString() || "11", [u, b] = _(m), y = Y(() => {
|
|
361
361
|
const T = parseFloat(u);
|
|
@@ -368,7 +368,7 @@ const Fs = q(X((n, a) => {
|
|
|
368
368
|
if (!e) return null;
|
|
369
369
|
const T = { ...e };
|
|
370
370
|
return delete T.beforeExecute, T;
|
|
371
|
-
}, [e]), h = Ie(l, ["formatFontSizeIncrease", "formatFontSizeDecrease"]), w = W(() => h ? H(B, { className:
|
|
371
|
+
}, [e]), h = Ie(l, ["formatFontSizeIncrease", "formatFontSizeDecrease"]), w = W(() => h ? H(B, { className: Te("quick-buttons", {}), sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (T) => T.stopPropagation(), children: [o(N, { command: h[0], commandHook: f }), o(N, { command: h[1], commandHook: f })] }) : null, [h]), v = Ke(), S = W(() => `${Ht.getSharedMeasurer()("12.3", Math.round(v.typography.fontSize), v.typography.fontFamily).width}px`, [v]), C = U((T) => {
|
|
372
372
|
const { onMouseDown: P, onMouseUp: R, ...k } = T;
|
|
373
373
|
return o(st, { component: "div", ...k, disableRipple: !0, children: o(Kn, { inputMode: "numeric", disabled: p || !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: (E) => `1px solid ${E.palette.text.icon ?? E.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (E) => `1px solid ${E.palette.error.main}` }, "::after": { borderBottom: (E) => `1px solid ${E.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", paddingLeft: "0px", paddingRight: "0px", fontSize: (E) => `${Math.round(E.typography.fontSize)}px`, width: S, color: (E) => E.palette.text.secondary, input: { padding: "0 0", textAlign: "center", height: "1rem", MozAppearance: "textfield", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (E) => E.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (E) => E.palette.text.primary } }, "input::-webkit-inner-spin-button": { WebkitAppearance: "none", margin: "0" } }, value: u, onFocus: (E) => {
|
|
374
374
|
E.target?.select();
|
|
@@ -393,18 +393,18 @@ const Fs = q(X((n, a) => {
|
|
|
393
393
|
}, R = t?.state(), k = [];
|
|
394
394
|
for (let M = 0; M < c.length; M++) {
|
|
395
395
|
const I = c[M] === R;
|
|
396
|
-
k.push(o(ct, { selected: I, icon: I ? o(on, {}) : void 0, disabled: p || !t || t.disabled(), onMouseDown: (
|
|
397
|
-
|
|
398
|
-
}, onMouseUp: (
|
|
399
|
-
|
|
400
|
-
}, onKeyDown: (
|
|
401
|
-
|
|
396
|
+
k.push(o(ct, { selected: I, icon: I ? o(on, {}) : void 0, disabled: p || !t || t.disabled(), onMouseDown: (F) => {
|
|
397
|
+
F.button === 0 && F.preventDefault();
|
|
398
|
+
}, onMouseUp: (F) => {
|
|
399
|
+
F.button === 0 && P(c[M]);
|
|
400
|
+
}, onKeyDown: (F) => {
|
|
401
|
+
F.keyCode !== me.Enter && F.keyCode !== me.Space || P(c[M]);
|
|
402
402
|
}, sx: { paddingTop: "4px", paddingBottom: "4px" }, children: o(B, { sx: { display: "flex", flex: "1 1 100%", justifyContent: "end" }, children: c[M] }) }, "fontSize-" + M));
|
|
403
403
|
}
|
|
404
|
-
const E = H(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...g, children: [w, o(
|
|
404
|
+
const E = H(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...g, children: [w, o(Q, { orientation: "horizontal" }), o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: k })] });
|
|
405
405
|
return ge({ ...T, children: E });
|
|
406
406
|
}, [p, t?.state(), e]);
|
|
407
|
-
return o(kt, { ref: a, sx: { ...x }, tabIndex: -1, outlined: !0, disabled: p, parentFloat: i, createPopupPanel: D, createTooltip: ({ children: T }, P) => o(
|
|
407
|
+
return o(kt, { ref: a, sx: { ...x }, tabIndex: -1, outlined: !0, disabled: p, parentFloat: i, createPopupPanel: D, createTooltip: ({ children: T }, P) => o(nt, { label: t?.label(), description: t?.description(), disabled: P || t?.disabled(), children: T }), createQuickButton: C, ...g });
|
|
408
408
|
})), Er = q((n) => {
|
|
409
409
|
const { selected: a, disabled: t, formattedValue: e, handleSetFormat: r, format: l, sx: c, ...p } = n;
|
|
410
410
|
return o(ct, { sx: { maxWidth: "360px", display: "flex", "*": { lineHeight: "1.2" }, ...c }, disabled: t, selected: a, icon: a ? o(on, {}) : void 0, onMouseDown: (i) => {
|
|
@@ -413,8 +413,8 @@ const Fs = q(X((n, a) => {
|
|
|
413
413
|
i.button === 0 && r(l.numberFormat);
|
|
414
414
|
}, onKeyDown: (i) => {
|
|
415
415
|
i.keyCode !== me.Enter && i.keyCode !== me.Space || r(l.numberFormat);
|
|
416
|
-
}, ...p, children: H(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [H(
|
|
417
|
-
}),
|
|
416
|
+
}, ...p, children: H(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [H(Pe, { component: "div", children: [l.formatType, l.formatType === mt.Type.Custom ? "…" : ""] }), o(Pe, { variant: "caption", component: "div", sx: { color: (i) => Qe(i.palette.text.primary, 0.6), paddingTop: e && e.length > 0 ? "1px" : void 0, overflow: "hidden", textOverflow: "ellipsis" }, children: e && e.length > 0 ? e : " " })] }) });
|
|
417
|
+
}), Qs = q(X((n, a) => {
|
|
418
418
|
const { commands: t, commandHook: e, scope: r, sx: l, disabled: c = !1, parentFloat: p, ...i } = n, s = Ie(t, ["formatNumberFormat"])[0], d = s?.state() ? mt.Styles.lookupStyle(s?.state()).formatType : mt.Type.General, x = W(() => {
|
|
419
419
|
if (!e) return null;
|
|
420
420
|
const b = { ...e };
|
|
@@ -436,87 +436,95 @@ const Fs = q(X((n, a) => {
|
|
|
436
436
|
}
|
|
437
437
|
const S = { numberFormat: "", formatType: mt.Type.Custom }, C = d === mt.Type.Custom, D = o(Er, { selected: C, disabled: c || !s || s.disabled(), formattedValue: C ? h.getNumberFormat().displayText : "", handleSetFormat: () => {
|
|
438
438
|
e?.beforeExecute?.(s, s?.state()), y.getCommand("formatNumberDialog")?.execute(s?.state()), e?.onExecute?.(s, s?.state());
|
|
439
|
-
}, format: S, sx: { flex: "0", width: "100%" } }, mt.Type.Custom), T = H(B, { className: "quick-buttons", sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (R) => R.stopPropagation(), children: [o(
|
|
439
|
+
}, format: S, sx: { flex: "0", width: "100%" } }, mt.Type.Custom), T = H(B, { className: "quick-buttons", sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (R) => R.stopPropagation(), children: [o(N, { command: y.getCommand("formatNumberFormatAccountingStyle"), commandHook: x, scope: r }), o(N, { command: y.getCommand("formatNumberFormatPercentStyle"), commandHook: x, scope: r }), o(N, { command: y.getCommand("formatNumberFormatCommaStyle"), commandHook: x, scope: r }), o(N, { command: y.getCommand("formatNumberFormatIncreaseDecimal"), commandHook: x, scope: r }), o(N, { command: y.getCommand("formatNumberFormatDecreaseDecimal"), commandHook: x, scope: r })] }), P = H(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...i, children: [T, o(Q, { orientation: "horizontal" }), o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: v }), o(Q, { orientation: "horizontal" }), D] });
|
|
440
440
|
return ge({ ...b, children: P });
|
|
441
|
-
}, [s?.context(), s?.state(), e, r]), m =
|
|
441
|
+
}, [s?.context(), s?.state(), e, r]), m = Ke(), u = W(() => {
|
|
442
442
|
const b = mt.Type.MediumTime;
|
|
443
443
|
return `${Ht.getSharedMeasurer()(b, Math.round(m.typography.fontSize), m.typography.fontFamily).width}px`;
|
|
444
444
|
}, [m]);
|
|
445
|
-
return o(
|
|
445
|
+
return o(Se, { ref: a, commands: t, sx: l, outlined: !0, disabled: c, parentFloat: p, createPopupPanel: g, createTooltip: ({ children: b }, y) => o(nt, { label: s?.label(), description: s?.description(), disabled: y, children: b }), icon: o(B, { sx: { display: "flex", paddingLeft: "4px", paddingRight: "4px", fontSize: (b) => `${Math.round(b.typography.fontSize)}px`, color: (b) => b.palette.text.secondary, fontFamily: (b) => b.typography.fontFamily, width: u }, children: o(B, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: d }) }), ...i });
|
|
446
446
|
})), Ba = q(X((n, a) => {
|
|
447
447
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = U((i, s) => {
|
|
448
|
-
const d = { variant:
|
|
448
|
+
const d = { variant: re.Menuitem, commandHook: e, scope: "clear", disabled: l }, x = H(le, { children: [o(N, { ...d, command: s.getCommand("clearAll") }), o(N, { ...d, command: s.getCommand("clearFormats") }), o(N, { ...d, command: s.getCommand("clearContents") }), o(N, { ...d, command: s.getCommand("clearComments") }), o(N, { ...d, command: s.getCommand("clearHyperlinks") })] });
|
|
449
449
|
return ge({ ...i, children: x });
|
|
450
450
|
}, [l, e, r]);
|
|
451
|
-
return o(
|
|
452
|
-
})),
|
|
451
|
+
return o(Se, { ref: a, commands: t, disabled: l, commandHook: e, scope: r, label: "Clear", tooltip: "Clear everything in the cell, or remove just the formatting or contents.", createPopupPanel: p, icon: "ClearAll", ...c });
|
|
452
|
+
})), Js = q(X((n, a) => {
|
|
453
453
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = U((i, s) => {
|
|
454
|
-
const d = { variant:
|
|
454
|
+
const d = { variant: re.Menuitem, commandHook: e, scope: "fill", disabled: l }, x = H(le, { children: [o(N, { ...d, command: s.getCommand("fillDown") }), o(N, { ...d, command: s.getCommand("fillRight") }), o(N, { ...d, command: s.getCommand("fillUp") }), o(N, { ...d, command: s.getCommand("fillLeft") })] });
|
|
455
455
|
return ge({ ...i, children: x });
|
|
456
456
|
}, [l, e, r]);
|
|
457
|
-
return o(
|
|
457
|
+
return o(Se, { ref: a, commands: t, disabled: l, commandHook: e, label: "Fill", tooltip: "Fill the selected cells with the value from one of the corners.", createPopupPanel: p, icon: "FillDown", ...c });
|
|
458
458
|
})), Aa = q(X((n, a) => {
|
|
459
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, disableSheet: c = !1, preferSingleMenu: p = !0, showQuickButton: i = !0, variant: s =
|
|
459
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, disableSheet: c = !1, preferSingleMenu: p = !0, showQuickButton: i = !0, variant: s = re.Toolbar, ...d } = n, x = Ie(t, ["insertCellsShiftDown", "insertCellsShiftRight", "insertRows", "insertColumns"]), { singleCommand: g, allDisabled: m } = W(() => {
|
|
460
460
|
let b = null, y = 0;
|
|
461
|
-
for (let f = 0; f < x.length; f++) x[f] && !x[f]?.disabled() && (p && s ===
|
|
461
|
+
for (let f = 0; f < x.length; f++) x[f] && !x[f]?.disabled() && (p && s === re.Menuitem && (b = y === 0 ? x[f] : null), y++);
|
|
462
462
|
return { singleCommand: b, allDisabled: y === 0 };
|
|
463
463
|
}, [x]), u = U((b, y) => {
|
|
464
464
|
let f = null;
|
|
465
|
-
const h = { variant:
|
|
466
|
-
c || (f = H(le, { children: [o(
|
|
467
|
-
const w = H(le, { children: [o(
|
|
465
|
+
const h = { variant: re.Menuitem, commandHook: e, scope: "insertCells", disabled: l };
|
|
466
|
+
c || (f = H(le, { children: [o(Q, { orientation: "horizontal" }), o(N, { ...h, command: y.getCommand("addSheet") })] }));
|
|
467
|
+
const w = H(le, { children: [o(N, { ...h, command: x[0] }), o(N, { ...h, command: x[1] }), o(Q, { orientation: "horizontal" }), o(N, { ...h, command: x[2] }), o(N, { ...h, command: x[3] }), f] });
|
|
468
468
|
return ge({ ...b, children: w });
|
|
469
469
|
}, [l, x, e, r]);
|
|
470
|
-
return g ? o(
|
|
470
|
+
return g ? o(N, { ref: a, variant: s, commandHook: e, disabled: l, command: g, ...d }) : o(Se, { ref: a, variant: s, quickCommand: "insertCells", commands: t, commandHook: e, scope: r, disabled: l || m, tooltip: H(le, { children: [o("span", { children: "Insert new cells, rows or columns to your workbook." }), o("br", {}), o("span", { children: "To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert." })] }), createPopupPanel: u, ...d });
|
|
471
471
|
})), Ia = q(X((n, a) => {
|
|
472
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, disableSheet: c = !1, preferSingleMenu: p = !0, showQuickButton: i = !0, variant: s =
|
|
472
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, disableSheet: c = !1, preferSingleMenu: p = !0, showQuickButton: i = !0, variant: s = re.Toolbar, ...d } = n, x = Ie(t, ["deleteCellsShiftUp", "deleteCellsShiftLeft", "deleteRows", "deleteColumns"]), { singleCommand: g, allDisabled: m } = W(() => {
|
|
473
473
|
let b = null, y = 0;
|
|
474
|
-
for (let f = 0; f < x.length; f++) x[f] && !x[f]?.disabled() && (p && s ===
|
|
474
|
+
for (let f = 0; f < x.length; f++) x[f] && !x[f]?.disabled() && (p && s === re.Menuitem && (b = y === 0 ? x[f] : null), y++);
|
|
475
475
|
return { singleCommand: b, allDisabled: y === 0 };
|
|
476
476
|
}, [x]), u = U((b, y) => {
|
|
477
|
-
const f = { variant:
|
|
477
|
+
const f = { variant: re.Menuitem, commandHook: e, scope: "deleteCells", disabled: l };
|
|
478
478
|
let h = null;
|
|
479
|
-
c || (h = H(le, { children: [o(
|
|
480
|
-
const w = H(le, { children: [o(
|
|
479
|
+
c || (h = H(le, { children: [o(Q, { orientation: "horizontal" }), o(N, { ...f, command: y.getCommand("deleteSheet") })] }));
|
|
480
|
+
const w = H(le, { children: [o(N, { ...f, command: y.getCommand("deleteCellsShiftUp") }), o(N, { ...f, command: y.getCommand("deleteCellsShiftLeft") }), o(Q, { orientation: "horizontal" }), o(N, { ...f, command: y.getCommand("deleteRows") }), o(N, { ...f, command: y.getCommand("deleteColumns") }), h] });
|
|
481
481
|
return ge({ ...b, children: w });
|
|
482
482
|
}, [l, e, r]);
|
|
483
|
-
return g ? o(
|
|
484
|
-
})),
|
|
485
|
-
const {
|
|
483
|
+
return g ? o(N, { ref: a, variant: s, commandHook: e, disabled: l, command: g, ...d }) : o(Se, { ref: a, variant: s, quickCommand: "deleteCells", commands: t, commandHook: e, scope: r, disabled: l || m, tooltip: H(le, { 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: u, ...d });
|
|
484
|
+
})), La = q(X((n, a) => {
|
|
485
|
+
const { commands: t, commandHook: e, scope: r, ...l } = n, c = U((p, i) => {
|
|
486
|
+
const s = { variant: re.Menuitem, commandHook: e, scope: "formatCells" }, d = { commands: i, parentFloat: p.floatReference, ...s }, x = H(le, { children: [o(N, { ...s, command: i.getCommand("resizeRows") }), o(N, { ...s, command: i.getCommand("autoFitRows") }), o(Q, { orientation: "horizontal" }), o(N, { ...s, command: i.getCommand("resizeColumns") }), o(N, { ...s, command: i.getCommand("autoFitColumns") }), o(Q, { orientation: "horizontal" }), o(tt, { ref: a, ...d, popupCommandKeys: ["hideColumns", "hideRows", null, "unhideColumns", "unhideRows"], popupScope: "hideUnhide", label: "Hide & Unhide" })] });
|
|
487
|
+
return ge({ ...p, children: x });
|
|
488
|
+
}, [e, r]);
|
|
489
|
+
return o(Se, { ref: a, commands: t, commandHook: e, scope: r, createPopupPanel: c, icon: "CellsFormat", label: "Format Cells", tooltip: "Change row and column sizes or visibility.", ...l });
|
|
490
|
+
}));
|
|
491
|
+
La.displayName = "CellsFormatCommandButton";
|
|
492
|
+
const No = q(X((n, a) => {
|
|
493
|
+
const { command: t, commandHook: e, onSelectColor: r, disabled: l = !1, variant: c = re.Toolbar, quickColor: p, panelProps: i, isSplit: s = !1, darkMode: d, icon: x, ...g } = n, { autoColor: m, schemeLookup: u, recentColors: b, ...y } = i;
|
|
486
494
|
if (g.selectedColor) throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");
|
|
487
495
|
jt(t);
|
|
488
496
|
const f = t?.context();
|
|
489
497
|
let h = p ?? f?.quickColor;
|
|
490
|
-
s && !h && (h = new
|
|
498
|
+
s && !h && (h = new ft("transparent"));
|
|
491
499
|
const w = m ?? f?.autoColor, v = u ?? f?.schemeLookup, S = b ?? f?.recentColors, C = d ?? f?.darkMode, D = W(() => ({ autoColor: w, schemeLookup: v, recentColors: S, darkMode: C, ...y }), [w, v, S, C]), T = Y((R, k) => {
|
|
492
500
|
R && k && f?.addRecentColor && f.addRecentColor(R), f?.onColorSelect && f.onColorSelect(R), r?.(R, k), t?.execute(R, e);
|
|
493
501
|
}, [t, r, e, f]), P = U((R, k) => {
|
|
494
502
|
const { children: E, title: M, ...I } = R;
|
|
495
|
-
let
|
|
496
|
-
return (t?.disabled() || l) && (
|
|
503
|
+
let F = R.children;
|
|
504
|
+
return (t?.disabled() || l) && (F = o("div", { children: F })), o(Zn, { command: t, placement: c === re.Toolbar ? "bottom-start" : "right-start", disabled: k, ...I, children: F });
|
|
497
505
|
}, [t, l]);
|
|
498
|
-
return o(Oa, { ref: a, panelProps: D, icon: x, quickColor: h, selectedColor: t?.state(), onSelectColor: T, variant: c ===
|
|
506
|
+
return o(Oa, { ref: a, panelProps: D, icon: x, quickColor: h, selectedColor: t?.state(), onSelectColor: T, variant: c === re.Menuitem ? ot.Menuitem : ot.Toolbar, createTooltip: P, label: t?.label(), disabled: l || !t || t.disabled(), compareRGB: !0, darkMode: C, ...g });
|
|
499
507
|
}));
|
|
500
508
|
No.displayName = "ColorCommandButton";
|
|
501
|
-
const
|
|
509
|
+
const ec = q(X((n, a) => {
|
|
502
510
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, parentFloat: c, ...p } = n, i = Ie(t, ["gridlinesToggle", "sheetViewToggleGridlinesColumns", "sheetViewToggleGridlinesRows"]), s = U((d, x) => {
|
|
503
|
-
const g = { variant:
|
|
511
|
+
const g = { variant: re.Menuitem, parentFloat: d.floatReference, commandHook: e, scope: r, disabled: l }, m = H(le, { children: [o(N, { ...g, command: x.getCommand("gridlinesToggle") }), o(No, { ...g, command: x.getCommand("sheetViewFormatGridlinesColor"), icon: o(he, { iconKey: "stroke.colored" }), panelProps: { disableAlpha: !0 } }), o(Q, { orientation: "horizontal" }), o(N, { ...g, command: x.getCommand("sheetViewToggleGridlinesColumns") }), o(N, { ...g, command: x.getCommand("sheetViewToggleGridlinesRows") })] });
|
|
504
512
|
return ge({ ...d, children: m });
|
|
505
513
|
}, [l, e]);
|
|
506
|
-
return o(
|
|
507
|
-
})),
|
|
514
|
+
return o(Se, { ref: a, parentFloat: c, quickCommand: i[0]?.key(), commands: t, commandHook: e, createPopupPanel: s, label: "Gridlines", tooltip: "Configure how the lines between rows and columns in the sheet are displayed.", icon: o(nn, { command: i[0], scope: "view" }), ...p });
|
|
515
|
+
})), za = q(X((n, a) => {
|
|
508
516
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = U((i, s) => {
|
|
509
|
-
const d = { variant:
|
|
517
|
+
const d = { variant: re.Menuitem, commandHook: e, scope: "sort", disabled: l }, x = s.getCommand("sortCustom"), g = H(le, { children: [o(N, { ...d, command: s.getCommand("sortAscending") }), o(N, { ...d, command: s.getCommand("sortDescending") }), x ? o(N, { ...d, command: x }) : null, o(Q, { orientation: "horizontal" }), o(N, { ...d, scope: "filter", command: s.getCommand("autoFilterToggle") }), o(N, { ...d, scope: "filter", command: s.getCommand("autoFilterClear") }), o(N, { ...d, scope: "filter", command: s.getCommand("autoFilterReapply") })] });
|
|
510
518
|
return ge({ ...i, children: g });
|
|
511
519
|
}, [l, e, r]);
|
|
512
|
-
return o(
|
|
513
|
-
})),
|
|
520
|
+
return o(Se, { ref: a, commands: t, commandHook: e, scope: r, disabled: l, label: "Sort", tooltip: H(le, { children: [o("span", { children: "Organize your data so it's easier to analyze." }), o("br", {}), o("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), createPopupPanel: p, icon: "SortIncrease", ...c });
|
|
521
|
+
})), op = q(X((n, a) => {
|
|
514
522
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = U((i, s) => {
|
|
515
|
-
const d = { variant:
|
|
523
|
+
const d = { variant: re.Menuitem, commandHook: e, scope: "sort", disabled: l }, x = H(le, { children: [o(N, { ...d, scope: "filter", command: s.getCommand("autoFilterToggle") }), o(N, { ...d, scope: "filter", command: s.getCommand("autoFilterClear") }), o(N, { ...d, scope: "filter", command: s.getCommand("autoFilterReapply") })] });
|
|
516
524
|
return ge({ ...i, children: x });
|
|
517
525
|
}, [l, e, r]);
|
|
518
|
-
return o(
|
|
519
|
-
})),
|
|
526
|
+
return o(Se, { ref: a, commands: t, commandHook: e, scope: r, disabled: l, label: "Filter", tooltip: H(le, { children: [o("span", { children: "Organize your data so it's easier to analyze." }), o("br", {}), o("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), createPopupPanel: p, icon: "FilterToggle", ...c });
|
|
527
|
+
})), Ha = q(X((n, a) => {
|
|
520
528
|
const { quickCommand: t, icon: e, isRedo: r = !1, nestRedo: l = !0, undoManager: c, scope: p, sx: i, disabled: s, commands: d, ...x } = n, g = [t];
|
|
521
529
|
!r && l && g.push("redo");
|
|
522
530
|
const m = Ie(d, g), u = m[0], b = m[1], y = c ?? u?.context?.()?.undoManager;
|
|
@@ -525,55 +533,55 @@ const Js = q(X((n, a) => {
|
|
|
525
533
|
const [h, w] = _(0), v = U((S, C) => {
|
|
526
534
|
let D = h === 0 ? "Cancel" : `${u.label()} ${h} Action${h === 1 ? "" : "s"}`, T = !1;
|
|
527
535
|
y || (T = !0), T || (T = l ? !y.hasRedo() && !y.hasUndo() : !y.hasRedo());
|
|
528
|
-
const P = (
|
|
529
|
-
u.execute(
|
|
536
|
+
const P = (F) => {
|
|
537
|
+
u.execute(F);
|
|
530
538
|
}, R = o(ct, { sx: { display: "flex", flex: "none", alignItems: "center", justifyContent: "center", padding: T ? void 0 : "0 0", minWidth: "180px" }, icon: o(he, {}), onMouseEnter: () => {
|
|
531
539
|
w(0);
|
|
532
|
-
}, onMouseDown: (
|
|
533
|
-
|
|
534
|
-
}, onMouseUp: (
|
|
535
|
-
|
|
536
|
-
}, onKeyDown: (
|
|
537
|
-
|
|
538
|
-
}, children: o(
|
|
540
|
+
}, onMouseDown: (F) => {
|
|
541
|
+
F.button === 0 && F.preventDefault();
|
|
542
|
+
}, onMouseUp: (F) => {
|
|
543
|
+
F.button === 0 && P(h);
|
|
544
|
+
}, onKeyDown: (F) => {
|
|
545
|
+
F.isDefaultPrevented() || F.keyCode !== me.Enter && F.keyCode !== me.Space || P(h);
|
|
546
|
+
}, children: o(Pe, { component: "div", variant: "caption", sx: { fontSize: "0.875rem", letterSpacing: "0.01071em" }, children: D }) });
|
|
539
547
|
if (T) return R;
|
|
540
548
|
const k = r ? y?.getRedoDescriptions() : y?.getUndoDescriptions(), E = [];
|
|
541
|
-
for (let
|
|
542
|
-
const L = k[
|
|
543
|
-
E.push(o(ct, { sx: { maxWidth: "360px", display: "flex" }, disabled: f, selected:
|
|
544
|
-
w(
|
|
545
|
-
}, onMouseDown: (
|
|
546
|
-
|
|
547
|
-
}, onMouseUp: (
|
|
548
|
-
|
|
549
|
-
}, onKeyDown: (
|
|
550
|
-
|
|
551
|
-
}, children: H(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", alignItems: "center", overflow: "hidden" }, children: [o(
|
|
549
|
+
for (let F = 0; F < k.length; F++) {
|
|
550
|
+
const L = k[F];
|
|
551
|
+
E.push(o(ct, { sx: { maxWidth: "360px", display: "flex" }, disabled: f, selected: F < h, icon: o(he, {}), onMouseEnter: () => {
|
|
552
|
+
w(F + 1);
|
|
553
|
+
}, onMouseDown: (O) => {
|
|
554
|
+
O.button === 0 && O.preventDefault();
|
|
555
|
+
}, onMouseUp: (O) => {
|
|
556
|
+
O.button === 0 && P(F + 1);
|
|
557
|
+
}, onKeyDown: (O) => {
|
|
558
|
+
O.isDefaultPrevented() || O.keyCode !== me.Enter && O.keyCode !== me.Space || P(F + 1);
|
|
559
|
+
}, children: H(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", alignItems: "center", overflow: "hidden" }, children: [o(Pe, { component: "div", children: L }), o(he, {})] }) }, `action:${F}`));
|
|
552
560
|
}
|
|
553
561
|
let M = null;
|
|
554
562
|
if (!r && l) {
|
|
555
|
-
const
|
|
556
|
-
M = [], M.push(o(
|
|
563
|
+
const F = { scope: "undo", commands: C, variant: re.Menuitem, parentFloat: S.floatReference };
|
|
564
|
+
M = [], M.push(o(Ha, { ...F, quickCommand: "redo", isRedo: !0 }, "nested:redo")), y.hasRedo() && y.hasUndo() && M.push(o(Q, { orientation: "horizontal" }, "action:redo-div"));
|
|
557
565
|
}
|
|
558
566
|
const I = H(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, onClick: () => {
|
|
559
567
|
S.closeFloatAll();
|
|
560
568
|
}, onMouseLeave: () => {
|
|
561
569
|
w(0);
|
|
562
|
-
}, children: [M, o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: E }), o(
|
|
570
|
+
}, children: [M, o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: E }), o(Q, { orientation: "horizontal" }), R] });
|
|
563
571
|
return ge({ ...S, children: I });
|
|
564
572
|
}, [u?.context(), u?.state(), p, y, h, f]);
|
|
565
|
-
return o(
|
|
566
|
-
})), oo =
|
|
567
|
-
for (let n = 0; n < oo.length; n++)
|
|
568
|
-
const
|
|
573
|
+
return o(Se, { ref: a, commands: d, quickCommand: t, scope: p, disabled: f, label: u?.label() ?? (r ? "Redo" : "Undo"), tooltip: o(le, { children: o("span", { children: `${u?.label() ?? "No"} last actions.` }) }), createPopupPanel: v, icon: e ?? (r ? "Redo" : "Undo"), selected: !1, ...x });
|
|
574
|
+
})), oo = Rl.getFontList(), Wa = /* @__PURE__ */ new Map();
|
|
575
|
+
for (let n = 0; n < oo.length; n++) Wa.set(oo[n].fontRef.getFamily(), oo[n]);
|
|
576
|
+
const tc = q(X((n, a) => {
|
|
569
577
|
const { command: t, commandHook: e, sx: r, disabled: l = !1, parentFloat: c, icon: p, label: i, ...s } = n;
|
|
570
578
|
jt(t);
|
|
571
|
-
const d = t?.state(), x =
|
|
579
|
+
const d = t?.state(), x = Ke(), g = W(() => `${Ht.getSharedMeasurer()("Times New Roman", Math.round(x.typography.fontSize), x.typography.fontFamily).width}px`, [x]), m = U((u) => {
|
|
572
580
|
const b = (w) => {
|
|
573
581
|
t?.execute(w, e);
|
|
574
582
|
}, y = [];
|
|
575
583
|
for (let w = 0; w < oo.length; w++) y.push({ key: oo[w].fontRef.getFamily(), description: oo[w].fontRef.getFamily() });
|
|
576
|
-
|
|
584
|
+
Wa.get(d) || y.unshift({ key: d, description: d });
|
|
577
585
|
const f = [];
|
|
578
586
|
for (let w = 0; w < y.length; w++) {
|
|
579
587
|
const v = y[w].key === d;
|
|
@@ -583,98 +591,98 @@ const ec = q(X((n, a) => {
|
|
|
583
591
|
S.button === 0 && S.preventDefault();
|
|
584
592
|
}, onKeyDown: (S) => {
|
|
585
593
|
S.keyCode !== me.Enter && S.keyCode !== me.Space || b(y[w].key);
|
|
586
|
-
}, children: o(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: o(
|
|
594
|
+
}, children: o(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: o(Pe, { component: "div", sx: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", fontFamily: () => y[w]?.key }, children: y[w].description }) }) }, w + "" + y[w].key));
|
|
587
595
|
}
|
|
588
596
|
const h = o(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%" }, ...s, children: o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: f }) });
|
|
589
597
|
return ge({ ...u, children: h });
|
|
590
598
|
}, [l, t?.state()]);
|
|
591
|
-
return o(kt, { ref: a, sx: { ...r }, outlined: !0, disabled: l, parentFloat: c, createPopupPanel: m, createTooltip: ({ children: u }, b) => o(
|
|
592
|
-
})),
|
|
599
|
+
return o(kt, { ref: a, sx: { ...r }, outlined: !0, disabled: l, parentFloat: c, createPopupPanel: m, createTooltip: ({ children: u }, b) => o(nt, { label: t?.label(), description: t?.description(), disabled: b, children: u }), icon: o(B, { 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: g }, children: o(B, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: d }) }), ...s });
|
|
600
|
+
})), oc = q(X((n, a) => {
|
|
593
601
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = Ie(t, ["formatStrikeThroughToggle", "formatSuperscriptToggle", "formatSubscriptToggle"]), i = W(() => {
|
|
594
602
|
for (let d = 0; d < p.length; d++) if (p[d]?.state()) return p[d];
|
|
595
603
|
return p[0];
|
|
596
604
|
}, [p]), s = U((d, x) => {
|
|
597
|
-
const g = { variant:
|
|
605
|
+
const g = { variant: re.Menuitem, commandHook: e, scope: "textEffects", disabled: l }, m = H(le, { children: [o(N, { ...g, command: x.getCommand("formatStrikeThroughToggle") }), o(N, { ...g, command: x.getCommand("formatSuperscriptToggle") }), o(N, { ...g, command: x.getCommand("formatSubscriptToggle") })] });
|
|
598
606
|
return ge({ ...d, children: m });
|
|
599
607
|
}, [l, e, r]);
|
|
600
|
-
return o(
|
|
601
|
-
})),
|
|
608
|
+
return o(Se, { ref: a, quickCommand: i?.key(), commands: t, commandHook: e, createPopupPanel: s, label: "Text Effects", tooltip: "Style your text to differentiate it.", icon: i?.icon() ?? "TextStrike", ...c });
|
|
609
|
+
})), nc = q(X((n, a) => {
|
|
602
610
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = Ie(t, ["formatUnderlinedToggle", "formatUnderlinedDoubleToggle", "formatUnderlinedAccountingToggle", "formatUnderlinedAccountingDoubleToggle"]), i = W(() => {
|
|
603
611
|
for (let d = 0; d < p.length; d++) if (p[d]?.state()) return p[d];
|
|
604
612
|
return p[0];
|
|
605
613
|
}, [p]), s = U((d, x) => {
|
|
606
|
-
const g = { variant:
|
|
614
|
+
const g = { variant: re.Menuitem, commandHook: e, scope: "underline", disabled: l }, m = H(le, { children: [o(N, { ...g, command: x.getCommand("formatUnderlinedToggle") }), o(N, { ...g, command: x.getCommand("formatUnderlinedDoubleToggle") }), o(N, { ...g, command: x.getCommand("formatUnderlinedAccountingToggle"), commandHook: e }), o(N, { ...g, command: x.getCommand("formatUnderlinedAccountingDoubleToggle") })] });
|
|
607
615
|
return ge({ ...d, children: m });
|
|
608
616
|
}, [l, e, r]);
|
|
609
|
-
return o(
|
|
610
|
-
})),
|
|
617
|
+
return o(Se, { ref: a, quickCommand: i?.key(), commands: t, commandHook: e, label: "Underline", tooltip: "All underline stylings.", createPopupPanel: s, icon: i?.icon() ?? "TextUnderline", ...c });
|
|
618
|
+
})), ja = q(X((n, a) => {
|
|
611
619
|
const { command: t, commands: e, commandHook: r, scope: l, includePasteAllInPopup: c = !0, disabled: p = !1, ...i } = n, s = Y((d, x) => {
|
|
612
|
-
const g = { variant:
|
|
613
|
-
return c && (m.push(
|
|
620
|
+
const g = { variant: re.Menuitem, commandHook: r, scope: "paste", disabled: p }, m = [];
|
|
621
|
+
return c && (m.push(ke(N, { ...g, command: x.getCommand("paste"), key: "paste" })), m.push(o(Q, { orientation: "horizontal" }, "paste-div"))), m.push(ke(N, { ...g, command: x.getCommand("pasteValues"), key: "pasteValues" })), m.push(ke(N, { ...g, command: x.getCommand("pasteFormats"), key: "pasteFormats" })), m.push(ke(N, { ...g, command: x.getCommand("pasteFormulas"), key: "pasteFormulas" })), m.push(ke(N, { ...g, command: x.getCommand("pasteTranspose"), key: "pasteTranspose" })), m.push(ke(N, { ...g, command: x.getCommand("pasteLinks"), key: "pasteLinks" })), ge({ ...d, children: m });
|
|
614
622
|
}, [p, r, l, c]);
|
|
615
|
-
return o(
|
|
616
|
-
})),
|
|
623
|
+
return o(Se, { ref: a, commands: e, commandHook: r, scope: l, createPopupPanel: s, label: "Paste", tooltip: "Add content to the clipboard to your document.", quickCommand: "paste", icon: "paste", ...i });
|
|
624
|
+
})), rc = q(X((n, a) => {
|
|
617
625
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, parentFloat: c, ...p } = n, i = Ie(t, ["sheetViewToggleShowHeadings", "sheetViewToggleShowHeadingColumns", "sheetViewToggleShowHeadingRows"]), s = U((d, x) => {
|
|
618
|
-
const g = { variant:
|
|
626
|
+
const g = { variant: re.Menuitem, parentFloat: d.floatReference, commandHook: e, scope: r, disabled: l }, m = H(le, { children: [o(N, { ...g, command: x.getCommand("sheetViewToggleShowHeadings") }), o(N, { ...g, command: x.getCommand("sheetViewToggleShowHeadingsNumeric") }), o(Q, { orientation: "horizontal" }), o(N, { ...g, command: x.getCommand("sheetViewToggleShowHeadingColumns") }), o(N, { ...g, command: x.getCommand("sheetViewToggleShowHeadingRows") })] });
|
|
619
627
|
return ge({ ...d, children: m });
|
|
620
628
|
}, [l, e, r]);
|
|
621
|
-
return o(
|
|
622
|
-
})),
|
|
629
|
+
return o(Se, { ref: a, parentFloat: c, quickCommand: i[0]?.key(), commands: t, commandHook: e, createPopupPanel: s, label: "Headings", tooltip: "Configure how the column and rows headings in the sheet are displayed.", icon: o(nn, { command: i[0], scope: "view" }), ...p });
|
|
630
|
+
})), ac = q(X((n, a) => {
|
|
623
631
|
const { commands: t, commandHook: e, scope: r = "view", disabled: l = !1, ...c } = n, p = U((i) => {
|
|
624
|
-
const s = { variant:
|
|
632
|
+
const s = { variant: re.Menuitem, parentFloat: i.floatReference, commandHook: e, scope: r, disabled: l }, d = H(le, { children: [o(N, { ...s, command: t.getCommand("workbookViewToggleShowFormulaBar") }), o(N, { ...s, command: t.getCommand("workbookViewToggleShowTabs") }), o(N, { ...s, command: t.getCommand("workbookViewToggleShowStatusBar") }), o(Q, { orientation: "horizontal" }), o(N, { ...s, command: t.getCommand("workbookViewToggleShowHorizontalScrollBar") }), o(N, { ...s, command: t.getCommand("workbookViewToggleShowVerticalScrollBar") })] });
|
|
625
633
|
return ge({ ...i, children: d });
|
|
626
634
|
}, [l, t, e, r]);
|
|
627
|
-
return o(
|
|
628
|
-
})),
|
|
635
|
+
return o(Se, { ref: a, commands: t, disabled: l, commandHook: e, scope: r, label: "Workbook View", tooltip: "Options to configure how the workbook is displayed.", createPopupPanel: p, icon: o(nn, { icon: null, label: "Workbook View" }), ...c });
|
|
636
|
+
})), $a = q(X((n, a) => {
|
|
629
637
|
const { value: t, cellStyle: e, styles: r, createTemporaryCell: l, bodyStyle: c, sx: p, borderProps: i, disabled: s, ...d } = n, x = W(() => l({ value: t, style: e }), [t, e, l]), g = W(() => x.getStyle(), [x, c]), m = W(() => g.getFill().toCSS(c?.darkMode ?? !1), [g]), u = g.getInsets(), b = g.getFont(), y = U(() => g.getBorder(), [g]);
|
|
630
|
-
return o(B, { ref: a, sx: { width: "100px", height: "100%", textOverflow: "ellipsis", display: "flex", alignItems: "stretch", background: c?.fill, filter: s ? "grayscale(0.4) opacity(0.8);" : "none", "& .fill": { flex: "1 1 100%", overflow: "hidden", ...m }, "& .text": { flex: "1 1 100%", ...b.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: b.toCSS().textDecoration, textAlign:
|
|
631
|
-
})),
|
|
638
|
+
return o(B, { ref: a, sx: { width: "100px", height: "100%", textOverflow: "ellipsis", display: "flex", alignItems: "stretch", background: c?.fill, filter: s ? "grayscale(0.4) opacity(0.8);" : "none", "& .fill": { flex: "1 1 100%", overflow: "hidden", ...m }, "& .text": { flex: "1 1 100%", ...b.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: b.toCSS().textDecoration, textAlign: Ml.toCSSHorizontalTextAlign(x.getRenderHorizontalAlignment()), background: "transparent", maxHeight: "100%", whiteSpace: "pre", wordWrap: "break-word" }, ...p }, ...d, children: o(_n, { getBorderAt: y, darkMode: c?.darkMode ?? !1, rowCount: 1, columnCount: 1, style: { height: "100%", width: "100%", ...i?.style }, ...i, children: o(B, { className: "fill", sx: { paddingLeft: "4px", paddingRight: "4px", marginLeft: "-1px", marginTop: "-1px", marginRight: "-2px", marginBottom: "-2px", display: "flex", alignItems: "center" }, children: o(B, { className: "text", children: t }) }) }) });
|
|
639
|
+
})), ic = q((n) => {
|
|
632
640
|
const { styles: a, namedStyle: t, selectedNamed: e, hasContextMenu: r = !0, bodyStyle: l, onSelectNamed: c, createTemporaryCell: p, parentFloat: i, commands: s, disabled: d, commandHook: x, ...g } = n, m = U((y) => {
|
|
633
|
-
const f = { variant:
|
|
641
|
+
const f = { variant: re.Menuitem, commandHook: x, context: "cellStyle" }, h = H(le, { children: [o(N, { ...f, style: { fontWeight: 550 }, command: s.getCommand("formatCellStyle"), commandState: t, disabled: d }), o(Q, { orientation: "horizontal" }), o(N, { ...f, command: s.getCommand("modifyCellStyle"), commandState: { named: t } }), o(N, { ...f, command: s.getCommand("deleteCellStyle"), commandState: t, disabled: d || t?.getName() === ce.BuiltInName.Normal })] });
|
|
634
642
|
return ge({ ...y, children: o(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: h }) }) });
|
|
635
643
|
}, []), u = t?.getName() === e?.getName();
|
|
636
|
-
let b = o(
|
|
644
|
+
let b = o(bt, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (y) => `solid ${u ? y.palette.primary.dark : "transparent"} 1px` }, tooltipProps: { label: t.getName(), placement: "bottom-start" }, disabled: d, icon: null, onClick: () => {
|
|
637
645
|
c?.(t);
|
|
638
|
-
}, ...g, children: o(
|
|
646
|
+
}, ...g, children: o($a, { value: t.getName(), cellStyle: { named: t.getName() }, styles: a, createTemporaryCell: p, bodyStyle: l }) }, t.getName());
|
|
639
647
|
return r && (b = o(Pa, { label: t.getName(), parentFloat: i, createPopupPanel: m, children: b })), b;
|
|
640
|
-
}),
|
|
648
|
+
}), lc = q(X((n, a) => {
|
|
641
649
|
const { commands: t, command: e, commandHook: r, selectedNamed: l, onSelectNamed: c, disabled: p = !1, bodyStyle: i, usePreviewIcon: s = !0, ...d } = n;
|
|
642
650
|
jt(e);
|
|
643
651
|
const x = e?.context(), g = x?.styles, m = l ?? x?.named(), u = i ?? x?.bodyStyle(), b = Y((v) => {
|
|
644
652
|
c?.(v), e?.execute(v, r);
|
|
645
653
|
}, [e, c, r]), y = U((v, S) => {
|
|
646
654
|
const C = { onSelectNamed: b, styles: g(), parentFloat: v.floatReference }, D = g().getCustomNamed(), T = /* @__PURE__ */ new Map(), P = [];
|
|
647
|
-
for (let
|
|
648
|
-
const R = (
|
|
649
|
-
let z = T.get(
|
|
650
|
-
return z || (z = g().getNamed(
|
|
651
|
-
}, k = (
|
|
652
|
-
const
|
|
653
|
-
for (let
|
|
654
|
-
const j = R(z[
|
|
655
|
-
j &&
|
|
655
|
+
for (let O = 0; O < D.length; O++) T.set(D[O].getName(), D[O]), g().getNamed(D[O].getName()).getBuiltInID() === null && P.push(D[O].getName());
|
|
656
|
+
const R = (O) => {
|
|
657
|
+
let z = T.get(O);
|
|
658
|
+
return z || (z = g().getNamed(O)), !z || z.isHidden() ? null : o(ic, { namedStyle: z, selectedNamed: m, bodyStyle: x.bodyStyle(), createTemporaryCell: x.createTemporaryCell, commands: t, commandHook: r, ...C }, O);
|
|
659
|
+
}, k = (O, z, ie = !0) => {
|
|
660
|
+
const J = [];
|
|
661
|
+
for (let pe = 0; pe < z.length; pe++) {
|
|
662
|
+
const j = R(z[pe]);
|
|
663
|
+
j && J.push(j);
|
|
656
664
|
}
|
|
657
|
-
return
|
|
658
|
-
}, E = (
|
|
659
|
-
const
|
|
660
|
-
for (let
|
|
661
|
-
const
|
|
662
|
-
|
|
665
|
+
return J.length === 0 ? null : H(B, { children: [ie ? o(Q, { orientation: "horizontal" }) : null, o(ro, { children: O }, O + "-header"), o(B, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", width: "646px", maxWidth: "100%" }, children: J }, O + "-presets")] }, O);
|
|
666
|
+
}, E = (O, z) => {
|
|
667
|
+
const ie = [];
|
|
668
|
+
for (let J = 0; J < z.length; J++) {
|
|
669
|
+
const pe = R(z[J]);
|
|
670
|
+
pe && ie.push(pe);
|
|
663
671
|
}
|
|
664
|
-
return
|
|
672
|
+
return ie.length === 0 ? null : o(B, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", flexDirection: "column", flex: "0 0 0%" }, children: ie }, O + "-presets");
|
|
665
673
|
}, M = [];
|
|
666
674
|
M.push(k("Custom", P, !1)), M.push(k("Good, Bad and Neutral", [ce.BuiltInName.Normal, ce.BuiltInName.Bad, ce.BuiltInName.Good, ce.BuiltInName.Neutral], P.length > 0)), M.push(k("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])), M.push(k("Titles and Headings", [ce.BuiltInName.Heading1, ce.BuiltInName.Heading2, ce.BuiltInName.Heading3, ce.BuiltInName.Heading4, ce.BuiltInName.Title, ce.BuiltInName.Total]));
|
|
667
675
|
let I = [];
|
|
668
|
-
var
|
|
669
|
-
return I.push(E("Accent 1", [ce.BuiltInName.Accent1_20, ce.BuiltInName.Accent1_40, ce.BuiltInName.Accent1_60, ce.BuiltInName.Accent1])), I.push(E("Accent 2", [ce.BuiltInName.Accent2_20, ce.BuiltInName.Accent2_40, ce.BuiltInName.Accent2_60, ce.BuiltInName.Accent2])), I.push(E("Accent 3", [ce.BuiltInName.Accent3_20, ce.BuiltInName.Accent3_40, ce.BuiltInName.Accent3_60, ce.BuiltInName.Accent3])), I.push(E("Accent 4", [ce.BuiltInName.Accent4_20, ce.BuiltInName.Accent4_40, ce.BuiltInName.Accent4_60, ce.BuiltInName.Accent4])), I.push(E("Accent 5", [ce.BuiltInName.Accent5_20, ce.BuiltInName.Accent5_40, ce.BuiltInName.Accent5_60, ce.BuiltInName.Accent5])), I.push(E("Accent 6", [ce.BuiltInName.Accent6_20, ce.BuiltInName.Accent6_40, ce.BuiltInName.Accent6_60, ce.BuiltInName.Accent6])), M.push((
|
|
670
|
-
}, sx: { display: "flex", flexDirection: "column", paddingTop: "6px", paddingBottom: "0px", paddingLeft: "16px", paddingRight: "16px" }, children: M }), o(
|
|
676
|
+
var F, L;
|
|
677
|
+
return I.push(E("Accent 1", [ce.BuiltInName.Accent1_20, ce.BuiltInName.Accent1_40, ce.BuiltInName.Accent1_60, ce.BuiltInName.Accent1])), I.push(E("Accent 2", [ce.BuiltInName.Accent2_20, ce.BuiltInName.Accent2_40, ce.BuiltInName.Accent2_60, ce.BuiltInName.Accent2])), I.push(E("Accent 3", [ce.BuiltInName.Accent3_20, ce.BuiltInName.Accent3_40, ce.BuiltInName.Accent3_60, ce.BuiltInName.Accent3])), I.push(E("Accent 4", [ce.BuiltInName.Accent4_20, ce.BuiltInName.Accent4_40, ce.BuiltInName.Accent4_60, ce.BuiltInName.Accent4])), I.push(E("Accent 5", [ce.BuiltInName.Accent5_20, ce.BuiltInName.Accent5_40, ce.BuiltInName.Accent5_60, ce.BuiltInName.Accent5])), I.push(E("Accent 6", [ce.BuiltInName.Accent6_20, ce.BuiltInName.Accent6_40, ce.BuiltInName.Accent6_60, ce.BuiltInName.Accent6])), M.push((F = "Themed Cell Styles", L = I, H(B, { children: [o(Q, { orientation: "horizontal" }), o(ro, { children: F }, F + "-header"), o(B, { sx: { display: "flex", gap: "2px", flexWrap: "wrap", alignItems: "start", flexDirection: "row" }, children: L }, F + "-presets")] }, F))), M.push(k("Number Format", [ce.BuiltInName.Comma, ce.BuiltInName.Comma0, ce.BuiltInName.Currency, ce.BuiltInName.Currency0, ce.BuiltInName.Percent])), H(B, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", paddingTop: (O) => `${O.shape.borderRadius}px`, paddingBottom: (O) => `${O.shape.borderRadius}px` }, children: [o(B, { onContextMenu: () => {
|
|
678
|
+
}, sx: { display: "flex", flexDirection: "column", paddingTop: "6px", paddingBottom: "0px", paddingLeft: "16px", paddingRight: "16px" }, children: M }), o(Q, { orientation: "horizontal" }), o(N, { variant: re.Menuitem, commandState: m, command: S.getCommand("newCellStyle"), context: "styles", commandHook: r, disabled: p })] });
|
|
671
679
|
}, [m, g?.().getTheme(), u]), f = Y((v) => {
|
|
672
680
|
const S = 18 / Ht.getDeviceScale(), C = x?.createTemporaryCell(v);
|
|
673
681
|
return C.getStyle().getFont().getSize() <= S ? C : C.createTemporaryCell({ style: { font: { size: S } } });
|
|
674
|
-
}, [x?.createTemporaryCell]), h = p || !e || e.disabled(), w = W(() => x && s ? o(
|
|
675
|
-
return o(
|
|
676
|
-
})),
|
|
677
|
-
const { styles: t, table: e, tableStyle: r = e?.getStyle() ?? t.getDefaultTableStyle(), bodyStyle: l, sx: c, disabled: p, className: i, forceThinBorder: s, cellHeight: d =
|
|
682
|
+
}, [x?.createTemporaryCell]), h = p || !e || e.disabled(), w = W(() => x && s ? o($a, { value: m?.getName() ?? "Custom", cellStyle: m ? { named: m.getName() } : void 0, styles: x.styles(), createTemporaryCell: f, bodyStyle: x.bodyStyle(), className: "outline-hover", disabled: h, sx: { marginRight: "4px", borderRadius: "2px", minHeight: "calc(100% - 2px)", overflow: "hidden", outline: (v) => `1px solid ${v.palette.action.hover}` }, borderProps: { style: { height: "calc(100% - 2px)", width: "calc(100% - 1px)" } } }) : e?.icon(), [m, u, h, e]);
|
|
683
|
+
return o(Se, { ref: a, createPopupPanel: y, outlined: s, commands: t, createTooltip: ({ children: v }, S) => o(nt, { label: e?.label(), description: e?.description(), disabled: S, children: v }), selected: !1, disabled: h, label: e?.label(), icon: w, ...d });
|
|
684
|
+
})), Va = "_sheetxl-reset_11z3j_1", sc = 10, _a = q(X((n, a) => {
|
|
685
|
+
const { styles: t, table: e, tableStyle: r = e?.getStyle() ?? t.getDefaultTableStyle(), bodyStyle: l, sx: c, disabled: p, className: i, forceThinBorder: s, cellHeight: d = sc, isLive: x = !1, ...g } = n, m = Math.ceil(1.3 * d), [u, b] = tn((v) => v + 1, 0);
|
|
678
686
|
de(() => {
|
|
679
687
|
if (x && e) return e.addListeners({ onAnyChange: () => {
|
|
680
688
|
b();
|
|
@@ -707,10 +715,10 @@ const ec = q(X((n, a) => {
|
|
|
707
715
|
}
|
|
708
716
|
return S;
|
|
709
717
|
}, [y, r, l]), w = U((v, S) => f[S].getBorder() ?? null, [f]);
|
|
710
|
-
return o(B, { ref: a, className: "table-format-preview", sx: { background: l?.fill, filter: p ? "grayscale(0.4) opacity(0.8);" : "none", "& .styled-element": { position: "absolute" }, ...c }, ...g, children: o(_n, { getBorderAt: w, rowCount: 5, columnCount: 5, forceThinBorder: s, width: 5 * (m - 1) + 1, height: 5 * (d - 1) + 1, darkMode: l?.darkMode ?? !1, style: { pointerEvents: "none" }, children: o("table", { className:
|
|
718
|
+
return o(B, { ref: a, className: "table-format-preview", sx: { background: l?.fill, filter: p ? "grayscale(0.4) opacity(0.8);" : "none", "& .styled-element": { position: "absolute" }, ...c }, ...g, children: o(_n, { getBorderAt: w, rowCount: 5, columnCount: 5, forceThinBorder: s, width: 5 * (m - 1) + 1, height: 5 * (d - 1) + 1, darkMode: l?.darkMode ?? !1, style: { pointerEvents: "none" }, children: o("table", { className: Te(i, "sheetxl-table-preview", Va), style: { borderCollapse: "collapse", width: 5 * (m - 1) + 1, height: 5 * (d - 1) + 1 }, children: o("tbody", { children: h }) }) }) });
|
|
711
719
|
})), go = (n, a, t, e, r) => {
|
|
712
720
|
n.beginPath(), n.moveTo(a + 0.5, t + 0.5), n.lineTo(e + 0.5, r + 0.5), n.stroke();
|
|
713
|
-
},
|
|
721
|
+
}, cc = q(X((n, a) => {
|
|
714
722
|
const { table: t, tableStyle: e, styles: r, bodyStyle: l, disabled: c, style: p, className: i, canvas: s, ...d } = n, x = W(() => {
|
|
715
723
|
const u = t.toJSON(), b = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
716
724
|
return u.styleOptions = { ...u.styleOptions, name: e.getName() }, u.ref = b, new Vn({ initialAnchor: b, json: u, styles: r });
|
|
@@ -754,10 +762,10 @@ const ec = q(X((n, a) => {
|
|
|
754
762
|
}
|
|
755
763
|
return `url(${u.toDataURL()})`;
|
|
756
764
|
}, [s, x, e, l]);
|
|
757
|
-
return o("div", { ref: a, className:
|
|
758
|
-
})),
|
|
765
|
+
return o("div", { ref: a, className: Te("table-style-preview", i), style: { backgroundImage: m, width: 61, height: 46, ...p }, ...d });
|
|
766
|
+
})), dc = "_table-style-options-container_1kfn2_1", pc = "_table-style-options_1kfn2_1", uc = q(X((n, a) => {
|
|
759
767
|
const { styleOptions: t, onStyleOptionsChange: e, showHeaderRow: r, onShowHeaderRowChange: l, showTotalRow: c, onShowTotalRowChange: p, showFilterButton: i, onShowFilterButtonChange: s, sx: d, className: x, disabled: g, ...m } = n;
|
|
760
|
-
return o("div", { className:
|
|
768
|
+
return o("div", { className: dc, children: H(B, { sx: { pt: 1, pb: 1, "& .MuiFormControlLabel-root": { marginLeft: (u) => `${u.spacing(2)}`, marginRight: (u) => `${u.spacing(2)}` }, "& .MuiCheckbox-root": { padding: (u) => `${u.spacing(0.5)}` }, ...d }, ...m, ref: a, className: Te(x, pc), children: [l && o(Rt, { control: o(Mt, { checked: r ?? !1, indeterminate: r == null, onChange: () => l(!r), disabled: g || r == null }), label: "Header Row", labelPlacement: "end" }), p && o(Rt, { control: o(Mt, { checked: c ?? !1, indeterminate: c == null, onChange: () => p(!c), disabled: g || c == null }), label: "Total Row", labelPlacement: "end" }), o(Rt, { control: o(Mt, { checked: t?.showRowStripes ?? !1, indeterminate: !t, disabled: g || !t, onChange: () => {
|
|
761
769
|
e?.({ ...t, showRowStripes: !t?.showRowStripes });
|
|
762
770
|
} }), label: "Banded Rows", labelPlacement: "end" }), o(Rt, { control: o(Mt, { checked: t?.showFirstColumn ?? !1, indeterminate: !t, disabled: g || !t, onChange: () => {
|
|
763
771
|
e?.({ ...t, showFirstColumn: !t?.showFirstColumn });
|
|
@@ -771,7 +779,7 @@ function wn(n, a) {
|
|
|
771
779
|
if (typeof n == "function") return n(a);
|
|
772
780
|
n && (n.current = a);
|
|
773
781
|
}
|
|
774
|
-
var $t = parseInt(
|
|
782
|
+
var $t = parseInt(Gl.split(".")[0], 10) >= 19 ? function(n) {
|
|
775
783
|
return (a) => {
|
|
776
784
|
const t = [];
|
|
777
785
|
for (const e of n) {
|
|
@@ -786,13 +794,13 @@ var $t = parseInt(Ul.split(".")[0], 10) >= 19 ? function(n) {
|
|
|
786
794
|
return (a) => {
|
|
787
795
|
for (const t of n) wn(t, a);
|
|
788
796
|
};
|
|
789
|
-
},
|
|
790
|
-
},
|
|
791
|
-
function
|
|
797
|
+
}, mc = function() {
|
|
798
|
+
}, Ua = typeof window < "u", Do = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
799
|
+
function np(n) {
|
|
792
800
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
793
801
|
}
|
|
794
|
-
var
|
|
795
|
-
const zt =
|
|
802
|
+
var hc = Ua ? St : de, Dr = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
803
|
+
const zt = Ua && window.ResizeObserver !== void 0 ? function() {
|
|
796
804
|
var n = _(null), a = n[0], t = n[1], e = _(Dr), r = e[0], l = e[1], c = W(function() {
|
|
797
805
|
return new window.ResizeObserver(function(p) {
|
|
798
806
|
if (p[0]) {
|
|
@@ -801,19 +809,19 @@ const zt = _a && window.ResizeObserver !== void 0 ? function() {
|
|
|
801
809
|
}
|
|
802
810
|
});
|
|
803
811
|
}, []);
|
|
804
|
-
return
|
|
812
|
+
return hc(function() {
|
|
805
813
|
if (a) return c.observe(a), function() {
|
|
806
814
|
c.disconnect();
|
|
807
815
|
};
|
|
808
816
|
}, [a]), [t, r];
|
|
809
817
|
} : function() {
|
|
810
|
-
return [
|
|
811
|
-
},
|
|
812
|
-
|
|
813
|
-
const
|
|
814
|
-
typeof window < "u" ?
|
|
815
|
-
const
|
|
816
|
-
const { disabled: t, style: e, className: r, sx: l, defaultInput: c, value: p, formName: i, formOptions: s, onChangeInput: d, onValidate: x, onKeyDown: g, ...m } = n, u =
|
|
818
|
+
return [mc, Dr];
|
|
819
|
+
}, gc = "_range-row_akhf4_1", fc = "_action-row_akhf4_15", Ga = ae.createContext(null);
|
|
820
|
+
Ga.displayName = "HookFormContext";
|
|
821
|
+
const qa = () => ae.useContext(Ga);
|
|
822
|
+
typeof window < "u" ? ae.useLayoutEffect : ae.useEffect;
|
|
823
|
+
const Ka = q(X((n, a) => {
|
|
824
|
+
const { disabled: t, style: e, className: r, sx: l, defaultInput: c, value: p, formName: i, formOptions: s, onChangeInput: d, onValidate: x, onKeyDown: g, ...m } = n, u = qa(), b = i && u ? u.register(i, s) : null, [y, f] = _(""), [h, w] = _(""), [v, S] = _(p);
|
|
817
825
|
de(() => {
|
|
818
826
|
S(p), w("");
|
|
819
827
|
}, [p]);
|
|
@@ -834,13 +842,13 @@ const qa = q(X((n, a) => {
|
|
|
834
842
|
}, []), R = U((k) => {
|
|
835
843
|
C(k.target.value), b?.onChange(k);
|
|
836
844
|
}, [b]);
|
|
837
|
-
return o(Xn, { sx: { paddingTop: (k) => k.spacing(1.5), minWidth: 135, width: "100%", ...l }, size: "small", ref: a, className:
|
|
845
|
+
return o(Xn, { sx: { paddingTop: (k) => k.spacing(1.5), minWidth: 135, width: "100%", ...l }, size: "small", ref: a, className: Te("named-input", r), ...m, children: o(Ca, { label: "Name", placeholder: c, onFocus: T, onBlur: P, inputRef: b?.ref, disabled: t, error: !!h, helperText: h || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (k) => k.spacing(0.5) } }, slotProps: { inputLabel: { shrink: !0 }, htmlInput: { className: "autoFocus", name: i, spellCheck: !1, autoComplete: "off", readOnly: t, sx: { paddingTop: (k) => k.spacing(1.25), paddingBottom: (k) => k.spacing(0.75), backgroundImage: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})` } } }, value: v ?? "", onChange: R, onKeyDownCapture: D, onContextMenu: (k) => {
|
|
838
846
|
k.stopPropagation();
|
|
839
847
|
} }) });
|
|
840
848
|
}));
|
|
841
|
-
|
|
842
|
-
const zo = (n) => n === null ? "" : n.toString(),
|
|
843
|
-
const { formName: t, formOptions: e, disabled: r, style: l, className: c, sx: p, onKeyDown: i, value: s, onChangeInput: d, resolvedAddress: x, ...g } = n, m =
|
|
849
|
+
Ka.displayName = "NamedInput";
|
|
850
|
+
const zo = (n) => n === null ? "" : n.toString(), Xa = q(X((n, a) => {
|
|
851
|
+
const { formName: t, formOptions: e, disabled: r, style: l, className: c, sx: p, onKeyDown: i, value: s, onChangeInput: d, resolvedAddress: x, ...g } = n, m = qa(), u = t && m ? m.register(t, e) : null, [b, y] = _(""), [f, h] = _(!1), [w, v] = _(() => zo(s));
|
|
844
852
|
de(() => {
|
|
845
853
|
v(zo(s)), y(""), t && m && m.clearErrors(t), h(!1);
|
|
846
854
|
}, [s]);
|
|
@@ -848,8 +856,8 @@ const zo = (n) => n === null ? "" : n.toString(), Ka = q(X((n, a) => {
|
|
|
848
856
|
let M = "";
|
|
849
857
|
try {
|
|
850
858
|
v(E);
|
|
851
|
-
const I = zo(s),
|
|
852
|
-
|
|
859
|
+
const I = zo(s), F = x(E);
|
|
860
|
+
F.toString() !== I && d?.(F);
|
|
853
861
|
} catch {
|
|
854
862
|
M = "Invalid Range";
|
|
855
863
|
}
|
|
@@ -864,18 +872,18 @@ const zo = (n) => n === null ? "" : n.toString(), Ka = q(X((n, a) => {
|
|
|
864
872
|
u?.onBlur(E);
|
|
865
873
|
}, [u]), T = U((E) => {
|
|
866
874
|
S(E.target.value), u?.onChange(E);
|
|
867
|
-
}, [u]), [P, R] = _(!1), k = W(() => o(
|
|
875
|
+
}, [u]), [P, R] = _(!1), k = W(() => o(Zl, { tabIndex: -1, sx: { display: "flex", position: "relative", flex: "0" }, position: "end", children: o(ss, { disabled: !0, selected: P, onSelectToggle: (E) => {
|
|
868
876
|
R(E);
|
|
869
877
|
}, label: "Select Range", icon: o(he, { iconKey: "SelectRangeMode" }) }) }), [P]);
|
|
870
|
-
return o(Xn, { sx: { paddingTop: (E) => E.spacing(1.5), minWidth: 135, width: "100%", ...p }, size: "small", ref: a, className:
|
|
878
|
+
return o(Xn, { sx: { paddingTop: (E) => E.spacing(1.5), minWidth: 135, width: "100%", ...p }, size: "small", ref: a, className: Te("range-input", c), ...g, children: o(Ca, { label: "Range", placeholder: "Enter Range", onBlur: D, disabled: r, error: !!b, inputRef: u?.ref, helperText: b || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (E) => E.spacing(0.5) } }, slotProps: { input: { endAdornment: k }, inputLabel: { shrink: !0 }, htmlInput: { spellCheck: !1, autoComplete: "off", readOnly: r, name: t, sx: { paddingTop: (E) => E.spacing(1.25), paddingBottom: (E) => E.spacing(0.75) } } }, value: w ?? "", onChange: T, onKeyDownCapture: C, onContextMenu: (E) => {
|
|
871
879
|
E.stopPropagation();
|
|
872
880
|
} }) });
|
|
873
881
|
}));
|
|
874
|
-
|
|
882
|
+
Xa.displayName = "RangeInput";
|
|
875
883
|
const Ze = [];
|
|
876
884
|
Ze.push(et("Primary Background", "bg1")), Ze.push(et("Primary Text", "tx1")), Ze.push(et("Secondary Background", "bg2")), Ze.push(et("Secondary Text", "tx2")), Ze.push(et("Accent 1", "accent1")), Ze.push(et("Accent 2", "accent2")), Ze.push(et("Accent 3", "accent3")), Ze.push(et("Accent 4", "accent4")), Ze.push(et("Accent 5", "accent5")), Ze.push(et("Accent 6", "accent6"));
|
|
877
|
-
const
|
|
878
|
-
const { docTheme: a, onSelectTheme: t, darkMode: e, isSelected: r, outlined: l, sx: c, ...p } = n, i =
|
|
885
|
+
const bc = (n) => {
|
|
886
|
+
const { docTheme: a, onSelectTheme: t, darkMode: e, isSelected: r, outlined: l, sx: c, ...p } = n, i = Ke(), s = W(() => {
|
|
879
887
|
let d = [];
|
|
880
888
|
for (let x = 0; x < Ze.length; x++) {
|
|
881
889
|
const g = Ze[x];
|
|
@@ -883,16 +891,16 @@ const fc = (n) => {
|
|
|
883
891
|
}
|
|
884
892
|
return o(B, { sx: { display: "flex", flexDirection: "row", flex: "none" }, children: o(B, { sx: { display: "flex", boxShadow: (x) => x.shadows[2] }, children: d }) });
|
|
885
893
|
}, [a, i]);
|
|
886
|
-
return o(
|
|
894
|
+
return o(bt, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (d) => `solid ${r ? d.palette.text.primary : "transparent"} 1px`, "&:hover:not([disabled])": { border: (d) => `solid ${d.palette.text.primary} 1px !important` } }, icon: null, ...p, children: H(B, { sx: { border: (d) => `solid ${d.palette.divider} 1px`, minWidth: "200px", borderRadius: "2px", padding: "4px 4px", textAlign: "left", display: "flex", gap: "4px", flexDirection: "column", alignItems: "stretch", color: (d) => r ? d.palette.text.primary : void 0, "&:hover:not([disabled])": { color: (d) => d.palette.text.primary } }, children: [o(B, { sx: {}, children: a.getName() }), H(B, { sx: { paddingTop: "6px", paddingLeft: "12px", paddingRight: "12px", display: "flex", flexDirection: "column", alignItems: "stretch" }, children: [s, o(B, { sx: { flex: "1 1 100%", textOverflow: "ellipsis", overflow: "hidden", marginTop: "2px", whiteSpace: "pre", fontFamily: () => a.getFontScheme().getMajorFont() }, children: o(vt, { 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.
|
|
887
895
|
The heading font is '${a.getFontScheme().getMajorFont()}'.` }), placement: "bottom-start", children: o("div", { children: a.getFontScheme().getMinorFont() }) }) })] })] }) });
|
|
888
|
-
},
|
|
896
|
+
}, xc = q(X((n, a) => {
|
|
889
897
|
const { themes: t, selectedTheme: e, onSelectTheme: r, sx: l, disabled: c = !1, darkMode: p, ...i } = n, s = W(() => {
|
|
890
898
|
const d = t?.getItems({ selected: e }) ?? [], x = [];
|
|
891
899
|
if (d.length === 0) return o(ro, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "6px", paddingBottom: "6px" }, children: "No themes" });
|
|
892
900
|
const g = d.length;
|
|
893
901
|
for (let m = 0; m < g; m++) {
|
|
894
902
|
const u = d[m], b = e && u?.getName() === e.getName(), y = d[m + 1];
|
|
895
|
-
y && y.isCustom() !== u.isCustom() && x.push(o(
|
|
903
|
+
y && y.isCustom() !== u.isCustom() && x.push(o(Q, { orientation: "horizontal", sx: { marginBottom: "4px" } }, `divider-${m}`)), x.push(o(bc, { docTheme: u, onSelectTheme: () => r(u), isSelected: b, disabled: c, darkMode: p, onMouseDown: (f) => {
|
|
896
904
|
f.button === 0 && f.preventDefault();
|
|
897
905
|
}, onMouseUp: (f) => {
|
|
898
906
|
f.button === 0 && r(u);
|
|
@@ -902,23 +910,23 @@ The heading font is '${a.getFontScheme().getMajorFont()}'.` }), placement: "bott
|
|
|
902
910
|
}
|
|
903
911
|
return x;
|
|
904
912
|
}, [e, r, p]);
|
|
905
|
-
return o(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%" }, ref: a, ...i, children: H(B, { sx: { display: "flex", flexDirection: "column", overflow: "hidden" }, children: [o(ro, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "4px", paddingBottom: "2px" }, children: "Themes" }), o(
|
|
906
|
-
})),
|
|
907
|
-
const { themes: t, selectedTheme: e, onSelectTheme: r, icon: l, tooltip: c, label: p, variant: i =
|
|
913
|
+
return o(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%" }, ref: a, ...i, children: H(B, { sx: { display: "flex", flexDirection: "column", overflow: "hidden" }, children: [o(ro, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "4px", paddingBottom: "2px" }, children: "Themes" }), o(Q, {}), o(B, { sx: { flex: "1 1 100%", overflow: "auto", padding: "6px 16px" }, children: s })] }) });
|
|
914
|
+
})), yc = q(X((n, a) => {
|
|
915
|
+
const { themes: t, selectedTheme: e, onSelectTheme: r, icon: l, tooltip: c, label: p, variant: i = ot.Toolbar, darkMode: s, panelProps: d, ...x } = n, g = l || o(he, { iconKey: "Theme2" }), m = U((b) => {
|
|
908
916
|
const { closeFloatAll: y } = b;
|
|
909
|
-
return o(
|
|
917
|
+
return o(xc, { ...d, themes: t, selectedTheme: e, onSelectTheme: r, darkMode: s, onKeyDown: (f) => {
|
|
910
918
|
f.which === me.Enter && y();
|
|
911
919
|
} });
|
|
912
920
|
}, [t, e, r, d, s]), u = { createPopupPanel: m, tooltip: c || p || "Theme", label: p, icon: g, ...x };
|
|
913
|
-
return i ===
|
|
914
|
-
})),
|
|
921
|
+
return i === ot.Toolbar ? o(kt, { ref: a, ...u }) : o(Yn, { ref: a, ...u });
|
|
922
|
+
})), Ya = q(X((n, a) => {
|
|
915
923
|
const { sheet: t, className: e, debounceDelay: r = 220, sx: l, ...c } = n, [p, i] = _(() => t.getView().getZoomScale()), [s, d] = _(null), x = xe(0);
|
|
916
924
|
We(t, { onViewChange: () => {
|
|
917
925
|
d(!0), x.current === 0 && i(t.getView().getZoomScale());
|
|
918
926
|
} }), de(() => {
|
|
919
927
|
x.current = 0, d(!1), i(t.getView().getZoomScale());
|
|
920
928
|
}, [t]), de(() => {
|
|
921
|
-
x.current !== 0 &&
|
|
929
|
+
x.current !== 0 && gt.debounce(() => {
|
|
922
930
|
p === x.current && (x.current = 0, t.getView().update({ zoomScale: p }));
|
|
923
931
|
}, r)();
|
|
924
932
|
}, [p, r]);
|
|
@@ -934,9 +942,9 @@ The heading font is '${a.getFontScheme().getMajorFont()}'.` }), placement: "bott
|
|
|
934
942
|
f.current?.contains(document.activeElement) && D.focus();
|
|
935
943
|
});
|
|
936
944
|
}, []), w = Cr(() => {
|
|
937
|
-
g(m(
|
|
938
|
-
}), v = Cr(() => g(m(
|
|
939
|
-
return H(B, { ref: a, className:
|
|
945
|
+
g(m(gt.findNextStep(t.getView().getZoomScale(), !1, 10)));
|
|
946
|
+
}), v = Cr(() => g(m(gt.findNextStep(t.getView().getZoomScale(), !0, 10)))), S = Ke(), C = W(() => `${Ht.getSharedMeasurer()("100%", Math.round(S.typography.fontSize), S.typography.fontFamily).width}px`, [S]);
|
|
947
|
+
return H(B, { ref: a, className: Te(e), sx: { padding: "0px 0px", display: "flex", alignItems: "center", color: (D) => D.palette.text.secondary, ...l }, onFocus: (D) => {
|
|
940
948
|
D.relatedTarget && !b && y(D.relatedTarget);
|
|
941
949
|
}, onBlur: (D) => {
|
|
942
950
|
b && !f?.current?.contains(D.relatedTarget) && y(null);
|
|
@@ -946,22 +954,22 @@ The heading font is '${a.getFontScheme().getMajorFont()}'.` }), placement: "bott
|
|
|
946
954
|
D.button === 0 && h();
|
|
947
955
|
}, ...c, children: [o(vt, { disableInteractive: !0, title: "Zoom Out", children: o(st, { sx: { padding: "0", "&:hover:not([disabled])": { color: (D) => D.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (D) => {
|
|
948
956
|
D.button !== 0 ? D.preventDefault() : w(D);
|
|
949
|
-
}, children: o(he, { iconKey: "Remove" }) }) }), o(
|
|
950
|
-
g(m(
|
|
957
|
+
}, children: o(he, { iconKey: "Remove" }) }) }), o(Ql, { ref: f, sx: { flex: "1 1 100%", padding: "6px 0px !important", marginRight: "2px", marginLeft: "2px", "& .MuiSlider-thumb": { height: 14, width: 6, borderRadius: 0.75, "&.Mui-focusVisible": { boxShadow: (D) => `0px 0px 0px 3px ${vr(D.palette.primary.main, 0.16)}` }, "&:focus, &:hover, &.Mui-active": { boxShadow: (D) => `0px 0px 0px 2px ${vr(D.palette.primary.main, 0.16)}` } }, "& .MuiSlider-mark": { width: "1px", height: "8px" }, "& .MuiSlider-markActive": { backgroundColor: "currentColor" }, "& .MuiSlider-thumb:not(.MuiSlider-active)": { transition: s ? "left 260ms ease-in" : "none" } }, valueLabelDisplay: "auto", size: "small", track: !1, min: 0, step: 1, value: u, max: 200, marks: [{ value: 100 }], onAnimationEnd: () => d(!1), onWheel: (D) => {
|
|
958
|
+
g(m(gt.findNextStep(t.getView().getZoomScale(), D.deltaY < 0, 10)));
|
|
951
959
|
}, onKeyDown: (D) => {
|
|
952
|
-
D.which === me.Down || D.which === me.Right ? (g(m(
|
|
960
|
+
D.which === me.Down || D.which === me.Right ? (g(m(gt.findNextStep(t.getView().getZoomScale(), !0, 10))), D.preventDefault()) : D.which === me.Up || D.which === me.Left ? (g(m(gt.findNextStep(t.getView().getZoomScale(), !1, 10))), D.preventDefault()) : D.which !== me.Enter && D.which !== me.Escape || h();
|
|
953
961
|
}, onChange: (D, T) => {
|
|
954
962
|
Math.abs(T - 100) < 3 ? g(100) : g(T);
|
|
955
963
|
}, valueLabelFormat: (D, T) => `Zoom: ${Math.round(p)}%` }), o(vt, { disableInteractive: !0, title: "Zoom In", children: o(st, { sx: { padding: "0", "&:hover:not([disabled])": { color: (D) => D.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (D) => {
|
|
956
964
|
D.button !== 0 ? D.preventDefault() : v(D);
|
|
957
|
-
}, children: o(he, { iconKey: "Add" }) }) }), H(B, { sx: { display: "flex", flexDirection: "row" }, children: [o(B, { sx: { minWidth: "8px" } }), o(
|
|
965
|
+
}, children: o(he, { iconKey: "Add" }) }) }), H(B, { sx: { display: "flex", flexDirection: "row" }, children: [o(B, { sx: { minWidth: "8px" } }), o(Pe, { noWrap: !0, component: "div", onClick: () => {
|
|
958
966
|
g(100);
|
|
959
967
|
}, sx: { cursor: "pointer", display: "flex", flex: "1 1 100%", fontSize: "0.70rem", marginLeft: "2px", marginRight: "2px", userSelect: "none", justifyContent: "center", width: C }, children: o("div", { children: Math.round(p) + "%" }) })] })] });
|
|
960
968
|
}));
|
|
961
|
-
|
|
962
|
-
const
|
|
969
|
+
Ya.displayName = "SheetZoomScale";
|
|
970
|
+
const Za = q(X((n, a) => {
|
|
963
971
|
const { sx: t, sheet: e, gridStyle: r, children: l, childrenEnd: c, ...p } = n;
|
|
964
|
-
|
|
972
|
+
ql(a, () => ({}));
|
|
965
973
|
const i = xe(null);
|
|
966
974
|
de(() => {
|
|
967
975
|
const m = (u) => u.preventDefault();
|
|
@@ -973,17 +981,17 @@ const Ya = q(X((n, a) => {
|
|
|
973
981
|
const m = s.getMode();
|
|
974
982
|
return m?.description ? m.description : "Ready";
|
|
975
983
|
}, [s]), [x, g] = _(!1);
|
|
976
|
-
return H(B, { ref: i, sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", overflow: x ? "visible" : "hidden", boxShadow: `0px -1px 0px ${r.header.edgeStrokeFill}`, ...t }, onMouseOver: () => g(!0), onMouseLeave: () => g(!1), ...p, children: [l, o("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "end", overflow: "hidden" }, children: o(
|
|
984
|
+
return H(B, { ref: i, sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", overflow: x ? "visible" : "hidden", boxShadow: `0px -1px 0px ${r.header.edgeStrokeFill}`, ...t }, onMouseOver: () => g(!0), onMouseLeave: () => g(!1), ...p, children: [l, o("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "end", overflow: "hidden" }, children: o(Pe, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", color: (m) => m.palette.text.secondary }, variant: "caption", children: d }) }), c ? o(B, { sx: { display: "flex", alignItems: "center" }, children: c }) : null, o(Q, { style: { marginTop: "6px", marginBottom: "6px" } }), o(Ya, { sx: { paddingLeft: "4px", minWidth: "175px" }, sheet: e })] });
|
|
977
985
|
}));
|
|
978
|
-
|
|
986
|
+
Za.displayName = "StatusBar";
|
|
979
987
|
var Pr, Rr, Sn, Mr, Nr, Ho = { exports: {} }, fo = {}, bo = { exports: {} }, Fr = {}, Or = { exports: {} };
|
|
980
|
-
function
|
|
988
|
+
function wc() {
|
|
981
989
|
return Rr ? Pr : (Rr = 1, Pr = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
982
990
|
}
|
|
983
|
-
function
|
|
991
|
+
function Sc() {
|
|
984
992
|
if (Mr) return Sn;
|
|
985
993
|
Mr = 1;
|
|
986
|
-
var n =
|
|
994
|
+
var n = wc();
|
|
987
995
|
function a() {
|
|
988
996
|
}
|
|
989
997
|
function t() {
|
|
@@ -1004,7 +1012,7 @@ function wc() {
|
|
|
1004
1012
|
}, Sn;
|
|
1005
1013
|
}
|
|
1006
1014
|
function cn() {
|
|
1007
|
-
return Nr || (Nr = 1, Or.exports =
|
|
1015
|
+
return Nr || (Nr = 1, Or.exports = Sc()()), Or.exports;
|
|
1008
1016
|
}
|
|
1009
1017
|
var Br, Wo = { exports: {} }, Ar, ze = {}, xt = {};
|
|
1010
1018
|
function dn() {
|
|
@@ -1143,20 +1151,20 @@ function tr() {
|
|
|
1143
1151
|
}
|
|
1144
1152
|
return ze;
|
|
1145
1153
|
}
|
|
1146
|
-
var zr,
|
|
1147
|
-
function
|
|
1148
|
-
if (zr) return
|
|
1149
|
-
zr = 1, Object.defineProperty(
|
|
1154
|
+
var zr, it = {};
|
|
1155
|
+
function Qa() {
|
|
1156
|
+
if (zr) return it;
|
|
1157
|
+
zr = 1, Object.defineProperty(it, "__esModule", { value: !0 }), it.canDragX = function(e) {
|
|
1150
1158
|
return e.props.axis === "both" || e.props.axis === "x";
|
|
1151
|
-
},
|
|
1159
|
+
}, it.canDragY = function(e) {
|
|
1152
1160
|
return e.props.axis === "both" || e.props.axis === "y";
|
|
1153
|
-
},
|
|
1161
|
+
}, it.createCoreData = function(e, r, l) {
|
|
1154
1162
|
const c = !(0, n.isNum)(e.lastX), p = t(e);
|
|
1155
1163
|
return c ? { node: p, deltaX: 0, deltaY: 0, lastX: r, lastY: l, x: r, y: l } : { node: p, deltaX: r - e.lastX, deltaY: l - e.lastY, lastX: e.lastX, lastY: e.lastY, x: r, y: l };
|
|
1156
|
-
},
|
|
1164
|
+
}, it.createDraggableData = function(e, r) {
|
|
1157
1165
|
const l = e.props.scale;
|
|
1158
1166
|
return { node: r.node, x: e.state.x + r.deltaX / l, y: e.state.y + r.deltaY / l, deltaX: r.deltaX / l, deltaY: r.deltaY / l, lastX: e.state.x, lastY: e.state.y };
|
|
1159
|
-
},
|
|
1167
|
+
}, it.getBoundPosition = function(e, r, l) {
|
|
1160
1168
|
if (!e.props.bounds) return [r, l];
|
|
1161
1169
|
let { bounds: c } = e.props;
|
|
1162
1170
|
c = typeof c == "string" ? c : (function(i) {
|
|
@@ -1171,12 +1179,12 @@ function Za() {
|
|
|
1171
1179
|
c = { left: -p.offsetLeft + (0, n.int)(m.paddingLeft) + (0, n.int)(g.marginLeft), top: -p.offsetTop + (0, n.int)(m.paddingTop) + (0, n.int)(g.marginTop), right: (0, a.innerWidth)(x) - (0, a.outerWidth)(p) - p.offsetLeft + (0, n.int)(m.paddingRight) - (0, n.int)(g.marginRight), bottom: (0, a.innerHeight)(x) - (0, a.outerHeight)(p) - p.offsetTop + (0, n.int)(m.paddingBottom) - (0, n.int)(g.marginBottom) };
|
|
1172
1180
|
}
|
|
1173
1181
|
return (0, n.isNum)(c.right) && (r = Math.min(r, c.right)), (0, n.isNum)(c.bottom) && (l = Math.min(l, c.bottom)), (0, n.isNum)(c.left) && (r = Math.max(r, c.left)), (0, n.isNum)(c.top) && (l = Math.max(l, c.top)), [r, l];
|
|
1174
|
-
},
|
|
1182
|
+
}, it.getControlPosition = function(e, r, l) {
|
|
1175
1183
|
const c = typeof r == "number" ? (0, a.getTouch)(e, r) : null;
|
|
1176
1184
|
if (typeof r == "number" && !c) return null;
|
|
1177
1185
|
const p = t(l), i = l.props.offsetParent || p.offsetParent || p.ownerDocument.body;
|
|
1178
1186
|
return (0, a.offsetXYFromParent)(c || e, i, l.props.scale);
|
|
1179
|
-
},
|
|
1187
|
+
}, it.snapToGrid = function(e, r, l) {
|
|
1180
1188
|
const c = Math.round(r / e[0]) * e[0], p = Math.round(l / e[1]) * e[1];
|
|
1181
1189
|
return [c, p];
|
|
1182
1190
|
};
|
|
@@ -1186,14 +1194,14 @@ function Za() {
|
|
|
1186
1194
|
if (!r) throw new Error("<DraggableCore>: Unmounted during event!");
|
|
1187
1195
|
return r;
|
|
1188
1196
|
}
|
|
1189
|
-
return
|
|
1197
|
+
return it;
|
|
1190
1198
|
}
|
|
1191
1199
|
var Hr, Wr, jr, $r, xo = {}, jo = {};
|
|
1192
|
-
function
|
|
1200
|
+
function Ja() {
|
|
1193
1201
|
return Hr || (Hr = 1, Object.defineProperty(jo, "__esModule", { value: !0 }), jo.default = function() {
|
|
1194
1202
|
}), jo;
|
|
1195
1203
|
}
|
|
1196
|
-
function
|
|
1204
|
+
function vc() {
|
|
1197
1205
|
if (Wr) return xo;
|
|
1198
1206
|
Wr = 1, Object.defineProperty(xo, "__esModule", { value: !0 }), xo.default = void 0;
|
|
1199
1207
|
var n = (function(m, u) {
|
|
@@ -1209,7 +1217,7 @@ function Sc() {
|
|
|
1209
1217
|
for (const C in f) C !== "default" && {}.hasOwnProperty.call(f, C) && ((v = (w = Object.defineProperty) && Object.getOwnPropertyDescriptor(f, C)) && (v.get || v.set) ? w(S, C, v) : S[C] = f[C]);
|
|
1210
1218
|
return S;
|
|
1211
1219
|
})(m, u);
|
|
1212
|
-
})(
|
|
1220
|
+
})(ae), a = p(cn()), t = p(Qt), e = tr(), r = Qa(), l = dn(), c = p(Ja());
|
|
1213
1221
|
function p(m) {
|
|
1214
1222
|
return m && m.__esModule ? m : { default: m };
|
|
1215
1223
|
}
|
|
@@ -1304,7 +1312,7 @@ function Sc() {
|
|
|
1304
1312
|
}, onMouseDown: function() {
|
|
1305
1313
|
}, scale: 1 }), xo;
|
|
1306
1314
|
}
|
|
1307
|
-
function
|
|
1315
|
+
function kc() {
|
|
1308
1316
|
return jr || (jr = 1, (function(n) {
|
|
1309
1317
|
Object.defineProperty(n, "__esModule", { value: !0 }), Object.defineProperty(n, "DraggableCore", { enumerable: !0, get: function() {
|
|
1310
1318
|
return i.default;
|
|
@@ -1322,7 +1330,7 @@ function vc() {
|
|
|
1322
1330
|
for (const D in h) D !== "default" && {}.hasOwnProperty.call(h, D) && ((S = (v = Object.defineProperty) && Object.getOwnPropertyDescriptor(h, D)) && (S.get || S.set) ? v(C, D, S) : C[D] = h[D]);
|
|
1323
1331
|
return C;
|
|
1324
1332
|
})(u, b);
|
|
1325
|
-
})(
|
|
1333
|
+
})(ae), t = d(cn()), e = d(Qt), r = (function() {
|
|
1326
1334
|
if (Br) return Wo.exports;
|
|
1327
1335
|
function u(y) {
|
|
1328
1336
|
var f, h, w = "";
|
|
@@ -1338,7 +1346,7 @@ function vc() {
|
|
|
1338
1346
|
return w;
|
|
1339
1347
|
}
|
|
1340
1348
|
return Br = 1, Wo.exports = b, Wo.exports.clsx = b, Wo.exports;
|
|
1341
|
-
})(), l = tr(), c =
|
|
1349
|
+
})(), l = tr(), c = Qa(), p = dn(), i = d(vc()), s = d(Ja());
|
|
1342
1350
|
function d(u) {
|
|
1343
1351
|
return u && u.__esModule ? u : { default: u };
|
|
1344
1352
|
}
|
|
@@ -1412,26 +1420,26 @@ function vc() {
|
|
|
1412
1420
|
let R = {}, k = null;
|
|
1413
1421
|
const E = !C || this.state.dragging, M = C || h, I = { x: (0, c.canDragX)(this) && E ? this.state.x : M.x, y: (0, c.canDragY)(this) && E ? this.state.y : M.y };
|
|
1414
1422
|
this.state.isElementSVG ? k = (0, l.createSVGTransform)(I, D) : R = (0, l.createCSSTransform)(I, D);
|
|
1415
|
-
const
|
|
1416
|
-
return a.createElement(i.default, x({}, P, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }), a.cloneElement(a.Children.only(f), { className:
|
|
1423
|
+
const F = (0, r.clsx)(f.props.className || "", w, { [v]: this.state.dragging, [S]: this.state.dragged });
|
|
1424
|
+
return a.createElement(i.default, x({}, P, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }), a.cloneElement(a.Children.only(f), { className: F, style: { ...f.props.style, ...R }, transform: k }));
|
|
1417
1425
|
}
|
|
1418
1426
|
}
|
|
1419
1427
|
n.default = m, g(m, "displayName", "Draggable"), g(m, "propTypes", { ...i.default.propTypes, axis: t.default.oneOf(["both", "x", "y", "none"]), bounds: t.default.oneOfType([t.default.shape({ left: t.default.number, right: t.default.number, top: t.default.number, bottom: t.default.number }), t.default.string, t.default.oneOf([!1])]), defaultClassName: t.default.string, defaultClassNameDragging: t.default.string, defaultClassNameDragged: t.default.string, defaultPosition: t.default.shape({ x: t.default.number, y: t.default.number }), positionOffset: t.default.shape({ x: t.default.oneOfType([t.default.number, t.default.string]), y: t.default.oneOfType([t.default.number, t.default.string]) }), position: t.default.shape({ x: t.default.number, y: t.default.number }), className: p.dontSetMe, style: p.dontSetMe, transform: p.dontSetMe }), g(m, "defaultProps", { ...i.default.defaultProps, axis: "both", bounds: !1, defaultClassName: "react-draggable", defaultClassNameDragging: "react-draggable-dragging", defaultClassNameDragged: "react-draggable-dragged", defaultPosition: { x: 0, y: 0 }, scale: 1 });
|
|
1420
1428
|
})(Fr)), Fr;
|
|
1421
1429
|
}
|
|
1422
|
-
function
|
|
1430
|
+
function ei() {
|
|
1423
1431
|
if ($r) return bo.exports;
|
|
1424
1432
|
$r = 1;
|
|
1425
|
-
const { default: n, DraggableCore: a } =
|
|
1433
|
+
const { default: n, DraggableCore: a } = kc();
|
|
1426
1434
|
return bo.exports = n, bo.exports.default = n, bo.exports.DraggableCore = a, bo.exports;
|
|
1427
1435
|
}
|
|
1428
1436
|
var Vr, $o = {};
|
|
1429
|
-
function
|
|
1437
|
+
function Cc() {
|
|
1430
1438
|
if (Vr) return $o;
|
|
1431
1439
|
Vr = 1, $o.__esModule = !0, $o.cloneElement = function(l, c) {
|
|
1432
1440
|
return c.style && l.props.style && (c.style = e(e({}, l.props.style), c.style)), c.className && l.props.className && (c.className = l.props.className + " " + c.className), a.default.cloneElement(l, c);
|
|
1433
1441
|
};
|
|
1434
|
-
var n, a = (n =
|
|
1442
|
+
var n, a = (n = ae) && n.__esModule ? n : { default: n };
|
|
1435
1443
|
function t(l, c) {
|
|
1436
1444
|
var p = Object.keys(l);
|
|
1437
1445
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -1471,11 +1479,11 @@ function kc() {
|
|
|
1471
1479
|
return $o;
|
|
1472
1480
|
}
|
|
1473
1481
|
var _r, Ur, yo = {};
|
|
1474
|
-
function
|
|
1482
|
+
function ti() {
|
|
1475
1483
|
if (_r) return yo;
|
|
1476
1484
|
_r = 1, yo.__esModule = !0, yo.resizableProps = void 0;
|
|
1477
1485
|
var n, a = (n = cn()) && n.__esModule ? n : { default: n };
|
|
1478
|
-
|
|
1486
|
+
ei();
|
|
1479
1487
|
var t = { axis: a.default.oneOf(["both", "x", "y", "none"]), className: a.default.string, children: a.default.element.isRequired, draggableOpts: a.default.shape({ allowAnyClick: a.default.bool, cancel: a.default.string, children: a.default.node, disabled: a.default.bool, enableUserSelectHack: a.default.bool, offsetParent: a.default.node, grid: a.default.arrayOf(a.default.number), handle: a.default.string, nodeRef: a.default.object, onStart: a.default.func, onDrag: a.default.func, onStop: a.default.func, onMouseDown: a.default.func, scale: a.default.number }), height: function() {
|
|
1480
1488
|
for (var e = arguments.length, r = new Array(e), l = 0; l < e; l++) r[l] = arguments[l];
|
|
1481
1489
|
var c, p = r[0];
|
|
@@ -1487,7 +1495,7 @@ function ei() {
|
|
|
1487
1495
|
} };
|
|
1488
1496
|
return yo.resizableProps = t, yo;
|
|
1489
1497
|
}
|
|
1490
|
-
function
|
|
1498
|
+
function oi() {
|
|
1491
1499
|
if (Ur) return fo;
|
|
1492
1500
|
Ur = 1, fo.__esModule = !0, fo.default = void 0;
|
|
1493
1501
|
var n = (function(g, m) {
|
|
@@ -1501,7 +1509,7 @@ function ti() {
|
|
|
1501
1509
|
h && (h.get || h.set) ? Object.defineProperty(b, f, h) : b[f] = g[f];
|
|
1502
1510
|
}
|
|
1503
1511
|
return b.default = g, u && u.set(g, b), b;
|
|
1504
|
-
})(
|
|
1512
|
+
})(ae), a = ei(), t = Cc(), e = ti(), r = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
|
|
1505
1513
|
function l(g) {
|
|
1506
1514
|
if (typeof WeakMap != "function") return null;
|
|
1507
1515
|
var m = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap();
|
|
@@ -1589,10 +1597,10 @@ function ti() {
|
|
|
1589
1597
|
if (P || R) {
|
|
1590
1598
|
var k = h[0], E = h[h.length - 1], M = C.getBoundingClientRect();
|
|
1591
1599
|
w.lastHandleRect != null && (E === "w" && (D += M.left - w.lastHandleRect.left), k === "n" && (T += M.top - w.lastHandleRect.top)), w.lastHandleRect = M, E === "w" && (D = -D), k === "n" && (T = -T);
|
|
1592
|
-
var I = w.props.width + (P ? D / w.props.transformScale : 0),
|
|
1593
|
-
I = L[0],
|
|
1594
|
-
var
|
|
1595
|
-
z && !(f === "onResize" && !
|
|
1600
|
+
var I = w.props.width + (P ? D / w.props.transformScale : 0), F = w.props.height + (R ? T / w.props.transformScale : 0), L = w.runConstraints(I, F);
|
|
1601
|
+
I = L[0], F = L[1];
|
|
1602
|
+
var O = I !== w.props.width || F !== w.props.height, z = typeof w.props[f] == "function" ? w.props[f] : null;
|
|
1603
|
+
z && !(f === "onResize" && !O) && (v.persist == null || v.persist(), z(v, { node: C, size: { width: I, height: F }, handle: h })), f === "onResizeStop" && w.resetData();
|
|
1596
1604
|
}
|
|
1597
1605
|
};
|
|
1598
1606
|
}, y.renderResizeHandle = function(f, h) {
|
|
@@ -1621,7 +1629,7 @@ function ti() {
|
|
|
1621
1629
|
return fo.default = x, x.propTypes = e.resizableProps, x.defaultProps = { axis: "both", handleSize: [20, 20], lockAspectRatio: !1, minConstraints: [20, 20], maxConstraints: [1 / 0, 1 / 0], resizeHandles: ["se"], transformScale: 1 }, fo;
|
|
1622
1630
|
}
|
|
1623
1631
|
var Gr, qr, wo = {};
|
|
1624
|
-
function
|
|
1632
|
+
function Tc() {
|
|
1625
1633
|
if (Gr) return wo;
|
|
1626
1634
|
Gr = 1, wo.__esModule = !0, wo.default = void 0;
|
|
1627
1635
|
var n = (function(m, u) {
|
|
@@ -1635,7 +1643,7 @@ function Cc() {
|
|
|
1635
1643
|
w && (w.get || w.set) ? Object.defineProperty(y, h, w) : y[h] = m[h];
|
|
1636
1644
|
}
|
|
1637
1645
|
return y.default = m, b && b.set(m, y), y;
|
|
1638
|
-
})(
|
|
1646
|
+
})(ae), a = l(cn()), t = l(oi()), e = ti(), r = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
|
|
1639
1647
|
function l(m) {
|
|
1640
1648
|
return m && m.__esModule ? m : { default: m };
|
|
1641
1649
|
}
|
|
@@ -1714,21 +1722,21 @@ function Cc() {
|
|
|
1714
1722
|
f.onResize;
|
|
1715
1723
|
var v = f.onResizeStart, S = f.onResizeStop, C = f.draggableOpts, D = f.minConstraints, T = f.maxConstraints, P = f.lockAspectRatio, R = f.axis;
|
|
1716
1724
|
f.width, f.height;
|
|
1717
|
-
var k = f.resizeHandles, E = f.style, M = f.transformScale, I = (function(
|
|
1718
|
-
if (
|
|
1719
|
-
var
|
|
1720
|
-
for (z = 0; z <
|
|
1721
|
-
return
|
|
1725
|
+
var k = f.resizeHandles, E = f.style, M = f.transformScale, I = (function(F, L) {
|
|
1726
|
+
if (F == null) return {};
|
|
1727
|
+
var O, z, ie = {}, J = Object.keys(F);
|
|
1728
|
+
for (z = 0; z < J.length; z++) O = J[z], L.indexOf(O) >= 0 || (ie[O] = F[O]);
|
|
1729
|
+
return ie;
|
|
1722
1730
|
})(f, r);
|
|
1723
1731
|
return n.createElement(t.default, { axis: R, draggableOpts: C, handle: h, handleSize: w, height: this.state.height, lockAspectRatio: P, maxConstraints: T, minConstraints: D, onResizeStart: v, onResize: this.onResize, onResizeStop: S, resizeHandles: k, transformScale: M, width: this.state.width }, n.createElement("div", p({}, I, { style: s(s({}, E), {}, { width: this.state.width + "px", height: this.state.height + "px" }) })));
|
|
1724
1732
|
}, y;
|
|
1725
1733
|
})(n.Component);
|
|
1726
1734
|
return wo.default = g, g.propTypes = s(s({}, e.resizableProps), {}, { children: a.default.element }), wo;
|
|
1727
1735
|
}
|
|
1728
|
-
var
|
|
1736
|
+
var Ec = (qr || (qr = 1, Ho.exports = function() {
|
|
1729
1737
|
throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
|
|
1730
|
-
}, Ho.exports.Resizable =
|
|
1731
|
-
const
|
|
1738
|
+
}, Ho.exports.Resizable = oi().default, Ho.exports.ResizableBox = Tc().default), Ho.exports);
|
|
1739
|
+
const ni = q(X((n, a) => {
|
|
1732
1740
|
const { disabled: t, names: e, workbook: r, restoreFocus: l, readonly: c = !1, disabled: p = !1, commandPopupButtonProps: i, sx: s, ...d } = n, x = sn(), [g, m] = _(null), [u, b] = _(() => r.getSelectedRanges().getCoords()), [y, f] = _(!1), { reference: h } = ao({ parentFloat: i?.parentFloat }), [w, v] = _(() => c || !r.getProtection().isStructureAllowed()), S = () => g?.text ?? "", [C, D] = _(S), T = Y(() => {
|
|
1733
1741
|
if (h?.closeAll(), !C) {
|
|
1734
1742
|
const V = S();
|
|
@@ -1791,14 +1799,14 @@ const oi = q(X((n, a) => {
|
|
|
1791
1799
|
}, onViewChange(j) {
|
|
1792
1800
|
M(j?.getSelectedSheet());
|
|
1793
1801
|
} });
|
|
1794
|
-
const [I,
|
|
1802
|
+
const [I, F] = _(null), L = Y(gt.debounce(P, I ? 320 : 0), []);
|
|
1795
1803
|
We(E.getSelection(), { onChange: () => {
|
|
1796
1804
|
b((j) => {
|
|
1797
1805
|
const K = r.getSelectedRanges().getCoords();
|
|
1798
|
-
return
|
|
1806
|
+
return Nl.isEqualRangesArrays(K, j) ? j : K;
|
|
1799
1807
|
});
|
|
1800
1808
|
}, onAdjustingChange: (j) => {
|
|
1801
|
-
|
|
1809
|
+
F(j.getAdjusting());
|
|
1802
1810
|
} }), de(() => {
|
|
1803
1811
|
if (I) {
|
|
1804
1812
|
const j = r.getSelectedRange(), K = j.getRowCount(), ee = j.getColumnCount();
|
|
@@ -1807,14 +1815,14 @@ const oi = q(X((n, a) => {
|
|
|
1807
1815
|
}
|
|
1808
1816
|
m({ text: r.getSelectedSheet().getSelectedRange().toString() }), L();
|
|
1809
1817
|
}, [u, r, I]);
|
|
1810
|
-
const
|
|
1818
|
+
const O = xe(null), z = U((j) => {
|
|
1811
1819
|
const { onMouseDown: K, onMouseUp: ee, ...V } = j;
|
|
1812
|
-
return o(st, { ...V, sx: { ...V?.sx, display: "flex", flex: "1 1 100%" }, disableRipple: !0, children: o(Kn, { inputMode: "text", inputProps: { tabIndex: 0, name: "input-named-range", maxLength: 255, className: "input", autoFocus: !1, spellCheck: !1, autoComplete: "off", ref:
|
|
1820
|
+
return o(st, { ...V, sx: { ...V?.sx, display: "flex", flex: "1 1 100%" }, disableRipple: !0, children: o(Kn, { inputMode: "text", inputProps: { tabIndex: 0, name: "input-named-range", maxLength: 255, className: "input", autoFocus: !1, spellCheck: !1, autoComplete: "off", ref: O }, sx: { "&::before": { borderBottom: "1px solid transparent" }, "&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before": { borderBottom: (A) => `1px solid ${A.palette.text.icon ?? A.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (A) => `1px solid ${A.palette.primary.main}` }, "::after": { borderBottom: (A) => `1px solid ${A.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", height: "1rem", fontSize: 11 * Ht.getDeviceScale(), fontStyle: g?.fontStyle, paddingLeft: (A) => A.spacing(0.75), paddingRight: (A) => A.spacing(0.75), boxShadow: "none", flex: "1", color: (A) => A.palette.text.secondary, input: { padding: "0", height: "1rem", textAlign: "left", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (A) => A.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (A) => A.palette.text.primary } } }, value: C, onFocus: (A) => {
|
|
1813
1821
|
A.target?.select();
|
|
1814
1822
|
}, onKeyDown: (A) => {
|
|
1815
1823
|
if (A.which === me.Enter || A.which === me.Tab) {
|
|
1816
1824
|
let Z = C;
|
|
1817
|
-
S() !== C && (A.stopPropagation(), A.preventDefault(), Z = T()), Z ?
|
|
1825
|
+
S() !== C && (A.stopPropagation(), A.preventDefault(), Z = T()), Z ? ie(Z) : l?.();
|
|
1818
1826
|
} else if (A.which === me.Escape) S() !== C ? (D(S()), setTimeout(() => {
|
|
1819
1827
|
A.target?.select();
|
|
1820
1828
|
}, 0), A.stopPropagation(), A.preventDefault()) : l?.();
|
|
@@ -1824,7 +1832,7 @@ const oi = q(X((n, a) => {
|
|
|
1824
1832
|
}, onChange: (A) => {
|
|
1825
1833
|
D(A.target.value);
|
|
1826
1834
|
} }) });
|
|
1827
|
-
}, [C, g]),
|
|
1835
|
+
}, [C, g]), ie = Y(async (j) => {
|
|
1828
1836
|
try {
|
|
1829
1837
|
h?.closeAll();
|
|
1830
1838
|
const K = e.lookupByRanges(j)?.[0];
|
|
@@ -1832,30 +1840,30 @@ const oi = q(X((n, a) => {
|
|
|
1832
1840
|
} catch (K) {
|
|
1833
1841
|
x.showMessage?.(K.message, { type: wt.Error });
|
|
1834
1842
|
}
|
|
1835
|
-
}, [e, x, r]),
|
|
1843
|
+
}, [e, x, r]), J = U((j) => {
|
|
1836
1844
|
setTimeout(() => {
|
|
1837
1845
|
f(!0);
|
|
1838
1846
|
}, 0);
|
|
1839
|
-
const K = { variant:
|
|
1847
|
+
const K = { variant: re.Menuitem, parentFloat: j.floatReference, commandHook: { ...i?.commandHook, beforeExecute: (ve, Ne) => (h?.closeAll(), i?.commandHook?.beforeExecute?.(ve, Ne)) }, scope: i?.scope, commands: i?.commands };
|
|
1840
1848
|
let ee = e.getItems({ scope: r?.getSelectedSheet().getName() });
|
|
1841
|
-
ee = ee.sort((
|
|
1849
|
+
ee = ee.sort((ve, Ne) => ve.getType() === Ne.getType() ? ve.getName().localeCompare(Ne.getName()) : ve.getType() === "range" ? -1 : 1);
|
|
1842
1850
|
const V = w ? null : ["editNamedReference", "deleteNamedReference"], A = w ? null : ["editTable", null, "convertTableToRange", "deleteTable"], Z = [], oe = ee.length;
|
|
1843
|
-
for (let
|
|
1844
|
-
const
|
|
1845
|
-
if (!
|
|
1846
|
-
const
|
|
1847
|
-
|
|
1851
|
+
for (let ve = 0; ve < oe; ve++) {
|
|
1852
|
+
const Ne = ee[ve], _e = Ne.getRanges();
|
|
1853
|
+
if (!_e || Ne.isHidden()) continue;
|
|
1854
|
+
const Ve = Ne.getType();
|
|
1855
|
+
Ve !== ee[ve - 1]?.getType() && (ve > 0 && Z.push(o(Q, { orientation: "horizontal" }, `type-divider-${Z.length}`)), Z.push(o(ro, { variant: "subtitle2", sx: { paddingLeft: "16px" }, children: Ne.getType() === "reference" ? "Ranges" : "Tables" }, `type-header-${Z.length}`))), Ve === "reference" ? Z.push(ke(tt, { ...K, key: "named-" + Z.length, popupCommandKeys: V, popupScope: "namedItem", scope: "namedItem", commandState: Ne, commands: i?.commands, label: Ne.getName(), quickCommand: "selectNamed", disabled: !Ne.getRanges() || p, icon: "NamedRange" })) : Ve === "table" && Z.push(ke(tt, { ...K, key: "namedItem-" + Z.length, popupCommandKeys: A, popupScope: "namedItem", scope: "namedItem", commands: i?.commands, commandState: Ne, label: Ne.getName(), quickCommand: "selectNamed", disabled: !_e || p, icon: "InsertTable" }));
|
|
1848
1856
|
}
|
|
1849
|
-
const
|
|
1850
|
-
return ge({ ...j, children:
|
|
1851
|
-
}, [r, R, e, g, w]),
|
|
1852
|
-
|
|
1857
|
+
const Be = H(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...d, children: [w ? null : o(N, { ...K, scope: "namedItem", command: i?.commands.getCommand("addNamedReference") }), Z && Z.length > 0 ? H(le, { children: [w ? null : o(Q, { orientation: "horizontal" }), o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: Z })] }) : null] });
|
|
1858
|
+
return ge({ ...j, children: Be });
|
|
1859
|
+
}, [r, R, e, g, w]), pe = Ct(a, () => ({ focus(j) {
|
|
1860
|
+
O.current?.focus(j);
|
|
1853
1861
|
} }), []);
|
|
1854
|
-
return o(B, { className: "outer", sx: { minWidth: 120, flex: "1 1 100%", display: "flex", alignItems: "center", justifyContent: "start", ...s }, ref: $t([
|
|
1862
|
+
return o(B, { className: "outer", sx: { minWidth: 120, flex: "1 1 100%", display: "flex", alignItems: "center", justifyContent: "start", ...s }, ref: $t([pe, a]), ...d, children: o(kt, { className: "outer-button", sx: { display: "flex", flex: "1 1 100%", "& .tooltip-wrapper": { display: "flex", flex: "1 1 100%", width: "100%" }, ...s }, buttonProps: { sx: { backgroundColor: (j) => j.palette.background.paper, backgroundImage: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})` } }, tabIndex: -1, outlined: { color: (j) => t ? j.palette.action.disabled : ye(j.palette.divider, 0.2) }, parentFloat: h, createPopupPanel: J, onPopupOpen: () => f(!0), onPopupClose: () => f(!1), createTooltip: ({ children: j }, K) => o(nt, { title: K || y ? "" : "Name Box", disabled: K, leaveDelay: 0, sx: { opacity: K || y ? 0 : 1 }, children: j }), createQuickButton: z }) });
|
|
1855
1863
|
}));
|
|
1856
|
-
|
|
1857
|
-
const
|
|
1858
|
-
const { sx: t, workbook: e, sheetElement: r, gridStyle: l, showNamedCollectionEditor: c = !0, NamedCollectionEditorProps: p, renderNamedCollectionEditor: i =
|
|
1864
|
+
ni.displayName = "NamedCollectionEditor";
|
|
1865
|
+
const Dc = (n, a) => o(ni, { ref: a, ...n }), ri = q(X((n, a) => {
|
|
1866
|
+
const { sx: t, workbook: e, sheetElement: r, gridStyle: l, showNamedCollectionEditor: c = !0, NamedCollectionEditorProps: p, renderNamedCollectionEditor: i = Dc, disabled: s, commands: d, ...x } = n, [g, m] = _(e?.getSelectedSheet());
|
|
1859
1867
|
We(e, { onSheetsChange: (A) => {
|
|
1860
1868
|
m(A?.getSelectedSheet());
|
|
1861
1869
|
}, onViewChange(A) {
|
|
@@ -1875,57 +1883,57 @@ const Ec = (n, a) => o(oi, { ref: a, ...n }), ni = q(X((n, a) => {
|
|
|
1875
1883
|
const oe = Math.floor(Z.height / v);
|
|
1876
1884
|
R(oe);
|
|
1877
1885
|
}, [v]), M = ln(), I = M.getMode();
|
|
1878
|
-
let
|
|
1879
|
-
I?.key === "edit" && (
|
|
1886
|
+
let F = null;
|
|
1887
|
+
I?.key === "edit" && (F = I.args?.stateAndCoords);
|
|
1880
1888
|
const L = W(() => {
|
|
1881
|
-
let A =
|
|
1882
|
-
return A || (A =
|
|
1889
|
+
let A = F?.editState;
|
|
1890
|
+
return A || (A = Al(() => g.getRange(u).getCell())), o(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", gap: 4 }, children: o(Il, { ref: h, activeCoords: u, sheet: g, onFocus: () => {
|
|
1883
1891
|
r?.startEdit({ autoFocus: !1, editMode: !0, cell: u });
|
|
1884
1892
|
}, defaultTextStyle: w, useRichStyling: !1, disabled: f, onChangeEdit: (Z) => {
|
|
1885
1893
|
if (Z.dirty !== void 0) {
|
|
1886
1894
|
const oe = { sheet: g, coords: u, editState: Z };
|
|
1887
|
-
M.setMode((
|
|
1895
|
+
M.setMode((Be) => ({ ...Be, args: { ...Be?.args, stateAndCoords: oe } }));
|
|
1888
1896
|
}
|
|
1889
1897
|
}, editState: A, commands: d, onCancelEdit: () => {
|
|
1890
1898
|
r?.cancelEdit(), r?.focus();
|
|
1891
1899
|
}, onSubmitEdit: () => {
|
|
1892
1900
|
r?.submitEdit(), r?.focus();
|
|
1893
1901
|
}, linesVisible: P }) });
|
|
1894
|
-
}, [g,
|
|
1902
|
+
}, [g, F, u, P, r]), O = xe(null), z = W(() => c ? i({ names: e.getNames(), workbook: e, ...p }, O) : null, [i, p, c, g, e, f]), ie = W(() => H(no, { elevation: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 0, backgroundImage: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})`, border: (A) => `solid ${f ? A.palette.action.disabled : ye(A.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(he, { iconKey: "CloseError" }), tooltipProps: { label: "Cancel", simple: !0 }, disabled: f || F === null, onMouseDown: (A) => {
|
|
1895
1903
|
A.button === 0 && A.preventDefault();
|
|
1896
1904
|
}, onClick: () => {
|
|
1897
1905
|
r.cancelEdit();
|
|
1898
|
-
} }), o(
|
|
1906
|
+
} }), 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(he, { iconKey: "CheckSuccess" }), tooltipProps: { label: "Enter", simple: !0 }, disabled: f || F === null, onMouseDown: (A) => {
|
|
1899
1907
|
A.button === 0 && A.preventDefault();
|
|
1900
1908
|
}, onClick: () => {
|
|
1901
1909
|
r.submitEdit();
|
|
1902
|
-
} }), o(
|
|
1910
|
+
} }), 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(he, { iconKey: "Function", style: { transform: "scale(0.85)" } }), tooltipProps: { label: "Insert Function", simple: !0 }, onMouseDown: (A) => {
|
|
1903
1911
|
A.button === 0 && A.preventDefault();
|
|
1904
|
-
} })] }), [f,
|
|
1912
|
+
} })] }), [f, F]), J = Ke(), [pe, j] = _(!1), K = W(() => H(B, { className: "formula-bar", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", gap: (A) => A.spacing(0.5), alignItems: "start" }, children: [ie, H(no, { elevation: 0, sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", fontFamily: (A) => A.typography.fontFamily, fontSize: 11 * Ht.getDeviceScale(), alignItems: "stretch", paddingTop: "2px", paddingBottom: "2px", boxShadow: "none", borderRadius: (A) => `${A.shape.borderRadius}px`, backgroundImage: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})`, border: (A) => `solid ${f ? A.palette.action.disabled : ye(A.palette.divider, 0.2)} 1px`, "& textarea": { color: (A) => f ? `${A.palette.text.disabled} !important` : A.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: () => j(!0), onBlur: () => j(!1), onMouseDown: (A) => {
|
|
1905
1913
|
A.target?.classList.contains("react-resizable-handle") && A.preventDefault();
|
|
1906
|
-
}, children: [o(B, { className: "formula-editor", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", alignItems: "center", marginTop: "-1px", paddingLeft: (A) => A.spacing(1), paddingRight: (A) => A.spacing(1) }, children: o(
|
|
1914
|
+
}, children: [o(B, { className: "formula-editor", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", alignItems: "center", marginTop: "-1px", paddingLeft: (A) => A.spacing(1), paddingRight: (A) => A.spacing(1) }, children: o(Ec.ResizableBox, { height: S, draggableOpts: { grid: [v, v] }, minConstraints: [v, v], maxConstraints: [15 * v, 15 * v], onResize: E, onResizeStop: k, resizeHandles: ["s"], axis: "y", style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: L }) }), 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(he, { iconKey: P > 1 ? "ExpandLess" : "ExpandMore" }), tooltipProps: { label: (P > 1 ? "Collapse" : "Expand") + " Formula Bar", simple: !0 }, onMouseDown: (A) => {
|
|
1907
1915
|
A.button === 0 && A.preventDefault();
|
|
1908
1916
|
}, onClick: () => {
|
|
1909
1917
|
const A = P > 1 ? 1 : D;
|
|
1910
1918
|
C(A * v + 1), R(A);
|
|
1911
|
-
} }), o(B, { sx: { position: "absolute", width: "100%", height: "2px", bottom: "0", willChange: "opacity", transition: "opacity 60ms ease-in", opacity:
|
|
1919
|
+
} }), o(B, { sx: { position: "absolute", width: "100%", height: "2px", bottom: "0", willChange: "opacity", transition: "opacity 60ms ease-in", opacity: pe ? 1 : 0, borderBottomWidth: "2px", borderBottomStyle: "solid", borderBottomColor: (A) => A.palette.primary.main, borderRadius: (A) => `${A.shape.borderRadius}px` } })] })] }), [ie, L, pe, P, v]), ee = W(() => z || K ? !z && K ? K : z && !K ? z : o(le, { children: o(Qn, { fixedPane: "before", minBefore: "165px", minAfter: "200px", paneBeforeProps: { style: { alignItems: "flex-start" } }, paneAfterProps: { style: { overflow: "visible" } }, resizerProps: { style: { backgroundImage: `url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${J.palette.text.icon ?? J.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 6.5px", minWidth: "18px" } }, elementBefore: z, elementAfter: K }) }) : null, [z, K]), V = Ct(a, () => ({ isFormulaBarElement: () => !0, getNamedCollectionEditorElement: () => O.current }), []);
|
|
1912
1920
|
return o(B, { sx: { display: "flex", flexDirection: "row", gap: (A) => A.spacing(0.5), ...t }, ref: V, ...x, children: ee });
|
|
1913
1921
|
}));
|
|
1914
|
-
|
|
1915
|
-
const
|
|
1922
|
+
ri.displayName = "FormulaBar";
|
|
1923
|
+
const ai = q(X((n, a) => {
|
|
1916
1924
|
const { filter: t, commands: e, disabled: r, sx: l, floatReference: c, ...p } = n, i = W(() => ({}), []), s = W(() => ({ commandHook: { beforeExecute: (g, m) => c.closeAll(), onExecute() {
|
|
1917
1925
|
}, onError() {
|
|
1918
1926
|
console.log("onError");
|
|
1919
|
-
} }, disabled: r, parentFloat: c }), [r, c]), d = W(() => ({ ...i, ...s, variant:
|
|
1927
|
+
} }, disabled: r, parentFloat: c }), [r, c]), d = W(() => ({ ...i, ...s, variant: re.Menuitem }), [i, s]), x = H(le, { children: [o(N, { ...d, command: e.getCommand("sortAscending") }), o(N, { ...d, command: e.getCommand("sortDescending") }), o(Q, { orientation: "horizontal" }), o(N, { ...d, command: e.getCommand("autoFilterClear") }), []] });
|
|
1920
1928
|
return o(B, { ref: a, sx: { paddingTop: "4px", paddingBottom: "4px", display: "flex", flexDirection: "column", ...l }, ...p, children: x });
|
|
1921
1929
|
}));
|
|
1922
|
-
|
|
1923
|
-
const
|
|
1930
|
+
ai.displayName = "FilterColumnMenu";
|
|
1931
|
+
const Pc = q(X((n, a) => {
|
|
1924
1932
|
const { children: t, className: e, disabled: r, style: l, filter: c, ...p } = n, i = Ct(a, () => ({ isFilters: () => !0 }), []);
|
|
1925
|
-
return o("div", { ref: i, className:
|
|
1933
|
+
return o("div", { ref: i, className: Te("filters", e), style: { position: "relative", display: "flex", flexDirection: "column", alignItems: "center", gap: "8px", ...l }, ...p, children: H("div", { style: { flex: "1 1 100%", display: "flex", minHeight: "100px", minWidth: "220px", alignItems: "center", border: "grey solid 1px", padding: "4px 4px", overflow: "hidden", flexDirection: "column", justifyContent: "space-evenly", marginTop: "4px", marginBottom: "4px", marginLeft: "16px", marginRight: "16px" }, children: [o("div", { children: c.getName() }), o("div", { children: "Filter Widget" })] }) });
|
|
1926
1934
|
}));
|
|
1927
|
-
|
|
1928
|
-
const
|
|
1935
|
+
Pc.displayName = "Filters";
|
|
1936
|
+
const ii = q(X((n, a) => {
|
|
1929
1937
|
const { children: t, sheet: e, style: r, className: l, value: c, index: p, editing: i, editable: s, disabled: d, selectedIndex: x, dragging: g, borderColor: m, borderWidth: u, activeColor: b, background: y = "white", tabRadius: f = 4, gridTheme: h, ...w } = n, [v, S] = _(() => !!e && e.getProtection().isLocked()), [C, D] = _(() => e ? e.getTabColor() : null);
|
|
1930
1938
|
We(e, { onProtectionChange: () => {
|
|
1931
1939
|
S(e.getProtection().isLocked());
|
|
@@ -1934,19 +1942,19 @@ const ai = q(X((n, a) => {
|
|
|
1934
1942
|
}, onStyleChange: () => {
|
|
1935
1943
|
D(e.getTabColor());
|
|
1936
1944
|
} });
|
|
1937
|
-
const T =
|
|
1945
|
+
const T = Ke(), P = x === p;
|
|
1938
1946
|
let R = null, k = null;
|
|
1939
1947
|
if (C || g) {
|
|
1940
1948
|
let I = y;
|
|
1941
|
-
C ? (k = C.toBlackOrWhite().toCSS(), I = C?.toCSS()) : P || (I = T.palette.background.paper), R = o(B, { sx: { position: "absolute", boxSizing: "border-box", top: "3px", left: "4px", right: "4.5px", bottom: "1.5px", opacity: P ? "50%" : "100%", borderRadius: "4px", border: (
|
|
1949
|
+
C ? (k = C.toBlackOrWhite().toCSS(), I = C?.toCSS()) : P || (I = T.palette.background.paper), R = o(B, { sx: { position: "absolute", boxSizing: "border-box", top: "3px", left: "4px", right: "4.5px", bottom: "1.5px", opacity: P ? "50%" : "100%", borderRadius: "4px", border: (F) => P ? `${y} solid 1px` : `${F.palette.divider} solid 1px`, background: P && C ? `linear-gradient(0deg, ${I} 0%, transparent)` : I } });
|
|
1942
1950
|
}
|
|
1943
1951
|
let E = null;
|
|
1944
1952
|
typeof m == "string" ? E = m : m?.toCSS && (E = m.toCSS());
|
|
1945
1953
|
const M = P ? o(B, { sx: { width: "100%", borderRadius: "4px", minWidth: "4px", height: "2px", backgroundColor: (I) => I.palette.primary.main } }) : null;
|
|
1946
|
-
return o(Na, { theme: P ? h ?? T : T, children: o(B, { ref: a, className:
|
|
1954
|
+
return o(Na, { theme: P ? h ?? T : T, children: o(B, { ref: a, className: Te(l), sx: { ...r, display: "flex", flexDirection: "column", minHeight: "0px", fontWeight: P ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", lineHeight: "1", textTransform: "none", minWidth: "unset", cursor: g ? "grabbing" : void 0 }, ...w, children: o(Ss, { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, radius: f, strokeColor: P ? E : "transparent", children: o(Jo, { sx: { textTransform: "none", borderRadius: "0px", minHeight: "0px", paddingLeft: "11px", paddingRight: "12px", paddingTop: "3px", flex: "1 1 100%", paddingBottom: "3px", fontWeight: P ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", transition: "none", cursor: g ? "grabbing" : void 0, color: P ? "primary" : k || "text.secondary", backgroundColor: P ? y : "transparent", "&:hover:not([disabled])": { backgroundColor: P ? y : "transparent" }, "& input": { color: (I) => `${I.palette.text.primary}`, textAlign: "center", fontWeight: "500" }, marginTop: "0px", minWidth: "unset" }, disabled: d, disableRipple: i, component: "div", children: H(le, { children: [R, H(B, { sx: { zIndex: "1", display: "flex", flexDirection: "row", alignItems: "center" }, children: [H(B, { sx: { display: "flex", flexDirection: "column", alignItems: "center", rowGap: "1px", lineHeight: "1", marginTop: P ? void 0 : "1px" }, children: [t, M] }), v ? o(he, { iconKey: "Lock", style: { scale: "0.80", marginLeft: "2px", width: "22px", height: "22px" }, color: "secondary" }) : o(B, { sx: { minHeight: "22px" } })] })] }) }, c + ":" + p) }) }) });
|
|
1947
1955
|
}));
|
|
1948
|
-
|
|
1949
|
-
const
|
|
1956
|
+
ii.displayName = "SheetTab";
|
|
1957
|
+
const li = q(X((n, a) => {
|
|
1950
1958
|
const { workbook: t, index: e, commands: r, scope: l = "sheet", disabled: c, floatReference: p, sx: i, className: s, tabStripRef: d, ...x } = n, [g, m] = _(t?.getProtection());
|
|
1951
1959
|
We(t, { onProtectionChange: (h) => {
|
|
1952
1960
|
m(h?.getProtection());
|
|
@@ -1954,17 +1962,17 @@ const ii = q(X((n, a) => {
|
|
|
1954
1962
|
const u = W(() => ({}), []), b = W(() => ({ commandHook: { beforeExecute: (h, w) => p.closeAll(), onExecute() {
|
|
1955
1963
|
}, onError() {
|
|
1956
1964
|
console.log("onError");
|
|
1957
|
-
} }, scope: l, commandState: e, disabled: c || e === void 0, parentFloat: p }), [c, p]), y = W(() => ({ ...u, ...b }), [u, b]), f = H(le, { children: [o(
|
|
1965
|
+
} }, scope: l, commandState: e, disabled: c || e === void 0, parentFloat: p }), [c, p]), y = W(() => ({ ...u, ...b }), [u, b]), f = H(le, { children: [o(N, { command: r.getCommand("addSheet"), commandState: e, ...y, variant: re.Menuitem }), o(N, { command: r.getCommand("deleteSheet"), ...y, variant: re.Menuitem }), H(ct, { onMouseDown: (h) => {
|
|
1958
1966
|
h.button === 0 && h.preventDefault();
|
|
1959
1967
|
}, onMouseUp: () => {
|
|
1960
1968
|
Promise.resolve(p.closeAll()).then(() => {
|
|
1961
1969
|
d?.startEdit(e);
|
|
1962
1970
|
});
|
|
1963
|
-
}, disabled: c || !g.isStructureAllowed(), parentFloat: p, children: ["Rename", l !== "sheet" ? " Sheet" : ""] }), o(
|
|
1964
|
-
return o(B, { ref: a, className:
|
|
1971
|
+
}, disabled: c || !g.isStructureAllowed(), parentFloat: p, children: ["Rename", l !== "sheet" ? " Sheet" : ""] }), o(N, { command: r.getCommand("duplicateSheet"), ...y, variant: re.Menuitem }), o(N, { command: r?.getCommand("protectionSheetToggle"), ...y, variant: re.Menuitem }), o(No, { variant: re.Menuitem, command: r.getCommand("formatSheetTabColor"), icon: o(he, { iconKey: "stroke.colored" }), panelProps: { disableAlpha: !0, autoColorLabel: "No Tab Color", autoColorPosition: Ro.End }, parentFloat: p }), o(Q, { orientation: "horizontal" }), o(N, { command: r.getCommand("hideSheet"), ...y, variant: re.Menuitem })] });
|
|
1972
|
+
return o(B, { ref: a, className: Te("menu", s), sx: { ...i }, ...x, children: f });
|
|
1965
1973
|
}));
|
|
1966
|
-
|
|
1967
|
-
const
|
|
1974
|
+
li.displayName = "SheetTabMenu";
|
|
1975
|
+
const si = q(X((n, a) => {
|
|
1968
1976
|
const { workbook: t, gridStyle: e, floatReference: r, closeFloatAll: l, className: c, ...p } = n, [i, s] = _(t?.getSheets().getItems()), [d, x] = _(t?.getProtection());
|
|
1969
1977
|
We(t, { onSheetsChange: (m) => {
|
|
1970
1978
|
s(m.getSheets().getItems());
|
|
@@ -1995,13 +2003,13 @@ const li = q(X((n, a) => {
|
|
|
1995
2003
|
}
|
|
1996
2004
|
return m;
|
|
1997
2005
|
}, [t, d, i, r, e]);
|
|
1998
|
-
return o(B, { ref: a, className:
|
|
2006
|
+
return o(B, { ref: a, className: Te("menu", c), ...p, children: g });
|
|
1999
2007
|
}));
|
|
2000
|
-
|
|
2001
|
-
let Vo = !1,
|
|
2008
|
+
si.displayName = "SheetsAllMenu";
|
|
2009
|
+
let Vo = !1, ci = !1, Nt = null;
|
|
2002
2010
|
const Kr = async (n) => {
|
|
2003
2011
|
const a = await Eo.getDetails();
|
|
2004
|
-
if (
|
|
2012
|
+
if (ci || a.isEval()) {
|
|
2005
2013
|
try {
|
|
2006
2014
|
const t = top ?? window;
|
|
2007
2015
|
t.SheetXL || (t.SheetXL = Object.freeze({ getSelectedWorkbook: () => Nt?.getWorkbook(), getSelectedSheet: () => Nt?.getWorkbook().getSelectedSheet(), getSelectedRange: () => Nt?.getWorkbook().getSelectedRange(), getRange: (e) => Nt?.getWorkbook().getRange(e), getSelectedWorkbookElement: () => Nt, getLicenseManager: () => Eo, moreExamples: () => {
|
|
@@ -2025,8 +2033,8 @@ Try
|
|
|
2025
2033
|
t instanceof DOMException || console.error(t);
|
|
2026
2034
|
}
|
|
2027
2035
|
}
|
|
2028
|
-
},
|
|
2029
|
-
|
|
2036
|
+
}, rp = (n) => {
|
|
2037
|
+
ci = n;
|
|
2030
2038
|
};
|
|
2031
2039
|
function In() {
|
|
2032
2040
|
return In = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -2037,7 +2045,7 @@ function In() {
|
|
|
2037
2045
|
return n;
|
|
2038
2046
|
}, In.apply(null, arguments);
|
|
2039
2047
|
}
|
|
2040
|
-
function
|
|
2048
|
+
function di(n, a) {
|
|
2041
2049
|
if (n == null) return {};
|
|
2042
2050
|
var t = {};
|
|
2043
2051
|
for (var e in n) if ({}.hasOwnProperty.call(n, e)) {
|
|
@@ -2051,14 +2059,14 @@ function Ln(n, a) {
|
|
|
2051
2059
|
return t.__proto__ = e, t;
|
|
2052
2060
|
}, Ln(n, a);
|
|
2053
2061
|
}
|
|
2054
|
-
function
|
|
2062
|
+
function pi(n, a) {
|
|
2055
2063
|
n.prototype = Object.create(a.prototype), n.prototype.constructor = n, Ln(n, a);
|
|
2056
2064
|
}
|
|
2057
2065
|
function Xr(n, a) {
|
|
2058
2066
|
return n.replace(new RegExp("(^|\\s)" + a + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
2059
2067
|
}
|
|
2060
|
-
const Yr = !1,
|
|
2061
|
-
var
|
|
2068
|
+
const Yr = !1, ui = ae.createContext(null);
|
|
2069
|
+
var mi = function(n) {
|
|
2062
2070
|
return n.scrollTop;
|
|
2063
2071
|
}, Po = "unmounted", Ot = "exited", Bt = "entering", Yt = "entered", zn = "exiting", ht = (function(n) {
|
|
2064
2072
|
function a(e, r) {
|
|
@@ -2067,7 +2075,7 @@ var ui = function(n) {
|
|
|
2067
2075
|
var c, p = r && !r.isMounting ? e.enter : e.appear;
|
|
2068
2076
|
return l.appearStatus = null, e.in ? p ? (c = Ot, l.appearStatus = Bt) : c = Yt : c = e.unmountOnExit || e.mountOnEnter ? Po : Ot, l.state = { status: c }, l.nextCallback = null, l;
|
|
2069
2077
|
}
|
|
2070
|
-
|
|
2078
|
+
pi(a, n), a.getDerivedStateFromProps = function(e, r) {
|
|
2071
2079
|
return e.in && r.status === Po ? { status: Ot } : null;
|
|
2072
2080
|
};
|
|
2073
2081
|
var t = a.prototype;
|
|
@@ -2089,7 +2097,7 @@ var ui = function(n) {
|
|
|
2089
2097
|
if (e === void 0 && (e = !1), r !== null) if (this.cancelNextCallback(), r === Bt) {
|
|
2090
2098
|
if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
|
2091
2099
|
var l = this.props.nodeRef ? this.props.nodeRef.current : Qt.findDOMNode(this);
|
|
2092
|
-
l &&
|
|
2100
|
+
l && mi(l);
|
|
2093
2101
|
}
|
|
2094
2102
|
this.performEnter(e);
|
|
2095
2103
|
} else this.performExit();
|
|
@@ -2142,13 +2150,13 @@ var ui = function(n) {
|
|
|
2142
2150
|
if (e === Po) return null;
|
|
2143
2151
|
var r = this.props, l = r.children;
|
|
2144
2152
|
r.in, r.mountOnEnter, r.unmountOnExit, r.appear, r.enter, r.exit, r.timeout, r.addEndListener, r.onEnter, r.onEntering, r.onEntered, r.onExit, r.onExiting, r.onExited, r.nodeRef;
|
|
2145
|
-
var c =
|
|
2146
|
-
return
|
|
2153
|
+
var c = di(r, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
|
|
2154
|
+
return ae.createElement(ui.Provider, { value: null }, typeof l == "function" ? l(e, c) : ae.cloneElement(ae.Children.only(l), c));
|
|
2147
2155
|
}, a;
|
|
2148
|
-
})(
|
|
2156
|
+
})(ae.Component);
|
|
2149
2157
|
function Gt() {
|
|
2150
2158
|
}
|
|
2151
|
-
ht.contextType =
|
|
2159
|
+
ht.contextType = ui, ht.propTypes = {}, ht.defaultProps = { in: !1, mountOnEnter: !1, unmountOnExit: !1, appear: !1, enter: !0, exit: !0, onEnter: Gt, onEntering: Gt, onEntered: Gt, onExit: Gt, onExiting: Gt, onExited: Gt }, ht.UNMOUNTED = Po, ht.EXITED = Ot, ht.ENTERING = Bt, ht.ENTERED = Yt, ht.EXITING = zn;
|
|
2152
2160
|
var vn = function(n, a) {
|
|
2153
2161
|
return n && a && a.split(" ").forEach(function(t) {
|
|
2154
2162
|
return r = t, void ((e = n).classList ? e.classList.remove(r) : typeof e.className == "string" ? e.className = Xr(e.className, r) : e.setAttribute("class", Xr(e.className && e.className.baseVal || "", r)));
|
|
@@ -2182,11 +2190,11 @@ var vn = function(n, a) {
|
|
|
2182
2190
|
return { baseClassName: d, activeClassName: s ? d + "-active" : i[p + "Active"], doneClassName: s ? d + "-done" : i[p + "Done"] };
|
|
2183
2191
|
}, e;
|
|
2184
2192
|
}
|
|
2185
|
-
|
|
2193
|
+
pi(a, n);
|
|
2186
2194
|
var t = a.prototype;
|
|
2187
2195
|
return t.addClass = function(e, r, l) {
|
|
2188
2196
|
var c = this.getClassNames(r)[l + "ClassName"], p = this.getClassNames("enter").doneClassName;
|
|
2189
|
-
r === "appear" && l === "done" && p && (c += " " + p), l === "active" && e &&
|
|
2197
|
+
r === "appear" && l === "done" && p && (c += " " + p), l === "active" && e && mi(e), c && (this.appliedClasses[r][l] = c, (function(i, s) {
|
|
2190
2198
|
i && s && s.split(" ").forEach(function(d) {
|
|
2191
2199
|
return g = d, void ((x = i).classList ? x.classList.add(g) : (function(m, u) {
|
|
2192
2200
|
return m.classList ? !!u && m.classList.contains(u) : (" " + (m.className.baseVal || m.className) + " ").indexOf(" " + u + " ") !== -1;
|
|
@@ -2200,26 +2208,26 @@ var vn = function(n, a) {
|
|
|
2200
2208
|
}, t.render = function() {
|
|
2201
2209
|
var e = this.props;
|
|
2202
2210
|
e.classNames;
|
|
2203
|
-
var r =
|
|
2204
|
-
return
|
|
2211
|
+
var r = di(e, ["classNames"]);
|
|
2212
|
+
return ae.createElement(ht, In({}, r, { onEnter: this.onEnter, onEntered: this.onEntered, onEntering: this.onEntering, onExit: this.onExit, onExiting: this.onExiting, onExited: this.onExited }));
|
|
2205
2213
|
}, a;
|
|
2206
|
-
})(
|
|
2214
|
+
})(ae.Component);
|
|
2207
2215
|
Hn.defaultProps = { classNames: "" }, Hn.propTypes = {};
|
|
2208
2216
|
const kn = 0.12, Zr = (n, a) => {
|
|
2209
2217
|
const t = {}, e = (i) => {
|
|
2210
2218
|
const s = i.palette?.background.default ?? "rgba(255,255,255,1)";
|
|
2211
|
-
return { text: { fontFamily: i.typography?.fontFamily ?? "Calibri", fontSize: i.typography?.fontSize ?? 8.25, fontWeight: i.typography?.fontWeightRegular ?? "400", fill: i.palette.mode === "dark" ? i.palette?.text?.secondary : i.palette?.text?.primary }, fill: s, strokeFill:
|
|
2219
|
+
return { text: { fontFamily: i.typography?.fontFamily ?? "Calibri", fontSize: i.typography?.fontSize ?? 8.25, fontWeight: i.typography?.fontWeightRegular ?? "400", fill: i.palette.mode === "dark" ? i.palette?.text?.secondary : i.palette?.text?.primary }, fill: s, strokeFill: at(s, kn, i.palette?.mode), darkMode: i.palette.mode === "dark" };
|
|
2212
2220
|
}, r = e(a);
|
|
2213
|
-
t.body = e(n), t.header = { ...t.body, strokeFill:
|
|
2214
|
-
const l =
|
|
2215
|
-
t.headerSelect = { ...t.header, strokeFill: n.palette.primary.main, fill: Qe(l, 0.2), text: { ...t.header.text, fill: n.palette.primary.main }, dividerStrokeFill: Qe(l, 0.7) }, t.headerSelectAll = { ...t.headerSelect, fill: Qe(l, 0.9), text: { ...t.headerSelect.text, fill: n.palette.primary.contrastText }, edgeStrokeFill: t.headerSelect.strokeFill }, t.buttonSurface = { ...r, strokeFill:
|
|
2221
|
+
t.body = e(n), t.header = { ...t.body, strokeFill: at(t.body.fill, kn, n.palette?.mode), fill: a && n.palette.mode === "dark" && a.palette.mode !== n.palette.mode ? t.body.fill : at(t.body.fill, 0.055, n.palette?.mode), edgeStrokeFill: n.palette.mode === "dark" ? t.body.strokeFill : at(t.body.fill, 0.328, n.palette?.mode) }, t.headerHover = (i) => ({ ...t.header, strokeFill: at(i?.fill ?? t.body.fill, 0.22, n.palette?.mode), fill: at(i?.fill ?? t.header.fill, 0.065, n.palette?.mode), text: { ...i?.text, fontWeight: n.typography?.fontWeightBold } });
|
|
2222
|
+
const l = at(n.palette.mode !== "dark" ? n.palette.primary.light : n.palette.primary.main, 0.055, n.palette?.mode);
|
|
2223
|
+
t.headerSelect = { ...t.header, strokeFill: n.palette.primary.main, fill: Qe(l, 0.2), text: { ...t.header.text, fill: n.palette.primary.main }, dividerStrokeFill: Qe(l, 0.7) }, t.headerSelectAll = { ...t.headerSelect, fill: Qe(l, 0.9), text: { ...t.headerSelect.text, fill: n.palette.primary.contrastText }, edgeStrokeFill: t.headerSelect.strokeFill }, t.buttonSurface = { ...r, strokeFill: at(r.fill, kn, a.palette?.mode), fill: a && a.palette.mode === "dark" && a.palette.mode !== n.palette.mode ? r.fill : at(r.fill, 0.055, a.palette?.mode), edgeStrokeFill: a.palette.mode === "dark" ? r.strokeFill : at(r.fill, 0.328, a.palette?.mode) }, t.headerSelection = { fill: n.palette?.primary?.main ? Qe(n.palette?.primary?.main, 0.1) : void 0, strokeFill: n.palette?.primary?.main }, t.headerSelectionInactive = { ...t.headerSelection, fill: n.palette?.divider ? Qe(n.palette?.divider, 0.05) : void 0, strokeFill: "transparent" };
|
|
2216
2224
|
const c = a ?? n, p = c.palette.mode === "dark";
|
|
2217
2225
|
return t.selection = { fill: c.palette?.primary?.main ? Qe(c.palette?.primary?.main, 0.1) : void 0, strokeFill: c.palette?.primary?.main }, t.selectionInactive = { ...t.selection, fill: c.palette?.divider ? Qe(c.palette?.divider, 0.05) : void 0, strokeFill: "transparent" }, t.selectionRemove = { ...t.selection, fill: Qe(c.palette.warning.light, 0.05), strokeFill: c.palette.warning.dark }, a && (t.body = e(a)), t.colorShadow = Qe(c.palette.action.active, 0.5), t.colorGrey = c.palette.action.active, t.filterDarkInvert = p ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", t;
|
|
2218
2226
|
}, Fo = q(X((n, a) => {
|
|
2219
|
-
const { children: t, sx: e, parentFloat: r, ...l } = n, c = Ct(a, () => ({}), []), [p, i] = zt(), s = xe(null), d = xe(null), [x, g] =
|
|
2227
|
+
const { children: t, sx: e, parentFloat: r, ...l } = n, c = Ct(a, () => ({}), []), [p, i] = zt(), s = xe(null), d = xe(null), [x, g] = ae.useReducer((S) => S + 1, 0), [m, u] = _(null), [b, y] = _(null), [f, h] = _(null), { reference: w } = ao({ parentFloat: r, label: "overflow" });
|
|
2220
2228
|
St(() => {
|
|
2221
2229
|
d.current = { refs: [] };
|
|
2222
|
-
const S = [], C =
|
|
2230
|
+
const S = [], C = ae.Children.toArray(t);
|
|
2223
2231
|
let D = 0;
|
|
2224
2232
|
C.forEach((T, P) => {
|
|
2225
2233
|
S.push(o(B, { sx: { display: "flex" }, ref: (R) => {
|
|
@@ -2241,43 +2249,43 @@ const kn = 0.12, Zr = (n, a) => {
|
|
|
2241
2249
|
k = !0;
|
|
2242
2250
|
continue;
|
|
2243
2251
|
}
|
|
2244
|
-
const
|
|
2245
|
-
R +=
|
|
2252
|
+
const F = I.current.getBoundingClientRect();
|
|
2253
|
+
R += F?.width, R > D.width && (k = !0);
|
|
2246
2254
|
}
|
|
2247
2255
|
if (!k) return y(null), void h([]);
|
|
2248
2256
|
const E = s.current?.getBoundingClientRect();
|
|
2249
2257
|
R = 0;
|
|
2250
2258
|
for (let M = 0; M < C; M++) {
|
|
2251
2259
|
const I = S[M];
|
|
2252
|
-
let
|
|
2260
|
+
let F = !1;
|
|
2253
2261
|
if (I.current) {
|
|
2254
2262
|
const L = I.current.getBoundingClientRect();
|
|
2255
|
-
R += L?.width, R < D.width - E.width && (
|
|
2263
|
+
R += L?.width, R < D.width - E.width && (F = !0);
|
|
2256
2264
|
}
|
|
2257
|
-
|
|
2265
|
+
F ? T.push(m[M]) : P.push(m[M]);
|
|
2258
2266
|
}
|
|
2259
2267
|
y(T.length > 0 ? T : null), h(P.length > 0 ? P : null);
|
|
2260
2268
|
}, [t, m, i, w, x]);
|
|
2261
2269
|
const v = Y((S) => {
|
|
2262
2270
|
const C = [], D = f.length;
|
|
2263
2271
|
for (let P = 0; P < D; P++) {
|
|
2264
|
-
const R =
|
|
2265
|
-
|
|
2272
|
+
const R = ae.Children.toArray(f[P])[0];
|
|
2273
|
+
ae.Children.toArray(R.props.children?.props?.children ?? R.props.children).forEach((k, E) => {
|
|
2266
2274
|
const M = k, I = { ...M.props, key: `overflow-${P}-${E}${M.key ?? ""}` };
|
|
2267
2275
|
I.parentFloat && S && (I.parentFloat = S.floatReference);
|
|
2268
|
-
const
|
|
2269
|
-
C.push(
|
|
2276
|
+
const F = ae.cloneElement(M, I);
|
|
2277
|
+
C.push(F);
|
|
2270
2278
|
});
|
|
2271
2279
|
}
|
|
2272
2280
|
const T = o(B, { className: "overflow-palette-popup-panel", sx: { display: "flex", flexDirection: "row", flexWrap: "wrap", rowGap: (P) => P.spacing(0.25), paddingTop: (P) => P.spacing(0.5), paddingBottom: (P) => P.spacing(0.5), paddingLeft: (P) => P.spacing(1), paddingRight: (P) => P.spacing(1), overflow: "hidden" }, children: C });
|
|
2273
2281
|
return ge({ ...S, children: T });
|
|
2274
2282
|
}, [f]);
|
|
2275
|
-
return H(B, { className: "overflow-palette", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", width: "100%", maxWidth: "100%", ...e }, ref: $t([c, p, a]), ...l, children: [o(B, { sx: { flexDirection: "row", display: "flex", maxWidth: "100%", flex: "1 1 100%", alignItems: "center" }, children: b ?? m }), o(B, { className: "overflow-palette-popup-button", sx: { display: f !== null && f.length === 0 ? "none" : "flex", flex: "1 1 0" }, children: o(kt, { createPopupPanel: v, ref: s, parentFloat: w, createTooltip: ({ children: S }, C) => o(
|
|
2276
|
-
})),
|
|
2283
|
+
return H(B, { className: "overflow-palette", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", width: "100%", maxWidth: "100%", ...e }, ref: $t([c, p, a]), ...l, children: [o(B, { sx: { flexDirection: "row", display: "flex", maxWidth: "100%", flex: "1 1 100%", alignItems: "center" }, children: b ?? m }), o(B, { className: "overflow-palette-popup-button", sx: { display: f !== null && f.length === 0 ? "none" : "flex", flex: "1 1 0" }, children: o(kt, { createPopupPanel: v, ref: s, parentFloat: w, createTooltip: ({ children: S }, C) => o(nt, { label: "More", description: "More toolbar options…", disabled: C, children: S }), icon: o(he, { iconKey: "MoreHorizontal" }) }) })] });
|
|
2284
|
+
})), hi = "https://unpkg.com/@sheetxl/scripting-templates/dist", Rc = (n) => {
|
|
2277
2285
|
if (n.metadata?.name) return n.metadata.name;
|
|
2278
2286
|
let a = (n.path.split("/").pop() || "").replace(/\.[^/.]+$/, "");
|
|
2279
2287
|
return n.metadata?.icon === "formula" ? a.toUpperCase() : (a = a.replace(/([a-z])([A-Z])/g, "$1 $2"), a.replace(/[-_]/g, " ").trim().split(/\s+/).map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" "));
|
|
2280
|
-
},
|
|
2288
|
+
}, gi = async (n) => {
|
|
2281
2289
|
const a = Jt.relativePath(n, "./manifest.json"), t = await fetch(a);
|
|
2282
2290
|
if (!t.ok) throw new An(`Failed to retrieve directory at '${n}': ${t.statusText}`);
|
|
2283
2291
|
const e = await t.text();
|
|
@@ -2294,14 +2302,14 @@ const kn = 0.12, Zr = (n, a) => {
|
|
|
2294
2302
|
if (!i.ok) throw new Error(`Failed to fetch file at '${c.path}': ${i.statusText}`);
|
|
2295
2303
|
const s = await i.text();
|
|
2296
2304
|
let d = c.metadata;
|
|
2297
|
-
return d?.title || (d = { title:
|
|
2305
|
+
return d?.title || (d = { title: Rc(c), ...d }), { path: c.path, content: s, metadata: d };
|
|
2298
2306
|
} catch (p) {
|
|
2299
2307
|
console.error(p.message);
|
|
2300
2308
|
}
|
|
2301
2309
|
return null;
|
|
2302
2310
|
});
|
|
2303
2311
|
return (await Promise.all(l)).filter((c) => c !== null);
|
|
2304
|
-
}, Cn = { marginRight: "4px" }, Tn = "1em",
|
|
2312
|
+
}, Cn = { marginRight: "4px" }, Tn = "1em", Mc = q((n) => {
|
|
2305
2313
|
const { disabled: a, snippet: t, description: e, handleInsert: r, sx: l, ...c } = n;
|
|
2306
2314
|
let p;
|
|
2307
2315
|
const i = t.metadata?.icon;
|
|
@@ -2311,13 +2319,13 @@ const kn = 0.12, Zr = (n, a) => {
|
|
|
2311
2319
|
s.button === 0 && r(t);
|
|
2312
2320
|
}, onKeyDown: (s) => {
|
|
2313
2321
|
s.keyCode !== me.Enter && s.keyCode !== me.Space || r(t);
|
|
2314
|
-
}, ...c, children: H(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [o(
|
|
2315
|
-
}),
|
|
2316
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, scriptPath: c =
|
|
2322
|
+
}, ...c, children: H(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [o(Pe, { component: "div", children: t.metadata?.title ?? t.path }), o(Pe, { variant: "caption", component: "div", sx: { color: (s) => Qe(s.palette.text.secondary ?? s.palette.text.primary, 0.6), overflow: "hidden", textOverflow: "ellipsis" }, children: t.metadata?.summary })] }) });
|
|
2323
|
+
}), Nc = q(X((n, a) => {
|
|
2324
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, scriptPath: c = hi, ...p } = n, [i, s] = _([]), [d, x] = _(!0), g = Ie(t, ["executeSelectedScript"]), m = g[0]?.context?.();
|
|
2317
2325
|
de(() => {
|
|
2318
2326
|
(async () => {
|
|
2319
2327
|
try {
|
|
2320
|
-
const b = await
|
|
2328
|
+
const b = await gi(c);
|
|
2321
2329
|
s(b);
|
|
2322
2330
|
} catch {
|
|
2323
2331
|
} finally {
|
|
@@ -2327,33 +2335,33 @@ const kn = 0.12, Zr = (n, a) => {
|
|
|
2327
2335
|
}, [c]);
|
|
2328
2336
|
const u = U((b, y) => {
|
|
2329
2337
|
if (d) return o("div", { children: "Loading..." });
|
|
2330
|
-
const f = { variant:
|
|
2338
|
+
const f = { variant: re.Menuitem, commandHook: e, scope: "scripts", disabled: l }, h = (S) => {
|
|
2331
2339
|
m.getEditor()?.insertSnippet(S.content), b.closeFloat();
|
|
2332
2340
|
}, w = [];
|
|
2333
2341
|
for (let S = 0; S < i.length; S++) {
|
|
2334
2342
|
const C = i[S];
|
|
2335
|
-
C && w.push(o(
|
|
2343
|
+
C && w.push(o(Mc, { handleInsert: h, snippet: C }, C.path));
|
|
2336
2344
|
}
|
|
2337
|
-
const v = H(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [w.length > 0 ? H(le, { children: [o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: w }), o(
|
|
2345
|
+
const v = H(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [w.length > 0 ? H(le, { children: [o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: w }), o(Q, { orientation: "horizontal" })] }) : null, ke(N, { ...f, key: "help", command: t.getCommand("help") })] });
|
|
2338
2346
|
return ge({ ...b, children: v });
|
|
2339
2347
|
}, [l, e, r, d, m]);
|
|
2340
|
-
return o(
|
|
2341
|
-
})),
|
|
2348
|
+
return o(Se, { ref: a, commands: t, disabled: l, commandHook: e, scope: r, label: "Insert Script", tooltip: "Inserts a script from a set of templates.", createPopupPanel: u, icon: "ScriptNew", ...p });
|
|
2349
|
+
})), fi = q(X((n, a) => {
|
|
2342
2350
|
const { commands: t, parentFloat: e, commandButtonProps: r, ...l } = n, c = Y((p) => {
|
|
2343
2351
|
const { commandButtonProps: i, commandPopupProps: s } = p;
|
|
2344
|
-
return o(le, { children: H("div", { style: { display: "flex", flex: "1 1 100%" }, children: [o("div", { children: o(Fo, { parentFloat: e, style: {}, children: o(
|
|
2352
|
+
return o(le, { children: H("div", { style: { display: "flex", flex: "1 1 100%" }, children: [o("div", { children: o(Fo, { parentFloat: e, style: {}, children: o(N, { ...i, command: t?.getCommand("saveScripts") }) }) }), o("div", { style: { flex: "1 1 100%" } }), o("div", { children: o(Fo, { parentFloat: e, style: {}, children: o(Nc, { ...i, commands: t }) }) })] }) });
|
|
2345
2353
|
}, [t]);
|
|
2346
2354
|
return o(rn, { ref: a, commands: t, parentFloat: e, commandButtonProps: r, createToolbarPalette: c, ...l });
|
|
2347
2355
|
}));
|
|
2348
|
-
|
|
2349
|
-
const
|
|
2350
|
-
const { scriptPath: t =
|
|
2356
|
+
fi.displayName = "ScriptEditorToolbar";
|
|
2357
|
+
const bi = q(X((n, a) => {
|
|
2358
|
+
const { scriptPath: t = hi, onScriptSelect: e, sx: r = an.EmptyCssProperties, className: l, buttonMinWidth: c = 210, buttonMinHeight: p = 80, gap: i = 12, ...s } = n, [d, x] = _([]), [g, m] = _(!0), [u, b] = _(null);
|
|
2351
2359
|
if (de(() => {
|
|
2352
2360
|
(async () => {
|
|
2353
2361
|
const h = [{ path: null, metadata: { title: "Blank Template...", summary: "Start with an empty script." }, content: "" }];
|
|
2354
2362
|
try {
|
|
2355
2363
|
m(!0), b(null);
|
|
2356
|
-
const w = await
|
|
2364
|
+
const w = await gi(t);
|
|
2357
2365
|
for (let v = 0; v < w.length; v++) {
|
|
2358
2366
|
const S = w[v];
|
|
2359
2367
|
S && h.push(S);
|
|
@@ -2364,59 +2372,59 @@ const fi = q(X((n, a) => {
|
|
|
2364
2372
|
x(h), m(!1);
|
|
2365
2373
|
}
|
|
2366
2374
|
})();
|
|
2367
|
-
}, [t]), g) return o(B, { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", className:
|
|
2375
|
+
}, [t]), g) return o(B, { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", className: Te(l, "script-select"), sx: { background: (h) => h.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})`, ...r }, ...s, children: o(Jl, {}) });
|
|
2368
2376
|
let y = null;
|
|
2369
|
-
u && (y = H(B, { display: "flex", justifyContent: "center", alignItems: "center", className:
|
|
2377
|
+
u && (y = H(B, { display: "flex", justifyContent: "center", alignItems: "center", className: Te(l, "script-select", "error-results"), sx: { background: (h) => h.palette.error.light, flex: "0", zIndex: 1e3, flexDirection: "column", padding: (h) => h.spacing(1), border: (h) => `1px solid ${h.palette.error.main}`, borderBottomLeftRadius: 1, borderBottomRightRadius: 1, backgroundImage: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})` }, ...s, children: [o(Pe, { color: "error", variant: "h6", component: "div", gutterBottom: !0, children: "Error loading Templates" }), o(Pe, { color: "error", component: "div", children: u })] }));
|
|
2370
2378
|
const f = (h) => {
|
|
2371
2379
|
const w = h.metadata?.icon;
|
|
2372
2380
|
return w === "macro" ? o(he, { iconKey: "ScriptMacro", size: "1em" }) : w === "formula" ? o(he, { iconKey: "ScriptFormula", size: "1em" }) : w === "autostart" ? o(he, { iconKey: "ScriptAutoStart", size: "1em" }) : null;
|
|
2373
2381
|
};
|
|
2374
|
-
return H(B, { ref: a, className:
|
|
2382
|
+
return H(B, { ref: a, className: Te(l, "script-select"), sx: { background: (h) => h.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})`, ...r }, ...s, children: [H(B, { p: 3, className: "script-select-content", sx: { overflow: "auto", flex: "1 1 auto" }, children: [o(Pe, { variant: "h6", gutterBottom: !0, children: "Script Template" }), o(Pe, { variant: "body2", component: "div", color: "text.secondary", gutterBottom: !0, children: "Choose from a template to provide a starting point to automate tasks or create user defined functions." }), o(Pe, { variant: "body2", component: "div", color: "text.secondary", gutterBottom: !0, children: "Templates provide a foundation to customize and meet your specific needs." }), o(B, { sx: { display: "grid", gridTemplateColumns: `repeat(auto-fill, minmax(${c}px, 1fr))`, gap: `${i}px`, padding: 2, paddingLeft: "0px", paddingRight: "0px" }, children: d.map((h, w) => H(Jo, { variant: "outlined", sx: { minWidth: c, minHeight: p, display: "flex", flexDirection: "column", justifyContent: "flex-start", alignItems: "flex-start", textAlign: "left", padding: 2, textTransform: "none", overflow: "hidden", ...w === 0 && { borderStyle: "dashed", marginBottom: "8px" }, ...w === 1 && { gridColumn: "1" } }, onClick: () => e?.(h), children: [H(B, { sx: { display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%", marginBottom: 0.5 }, children: [o(Pe, { variant: "subtitle2", component: "div", children: h.metadata?.title || h.path.split("/").pop()?.replace(/\.\w+$/, "") || "Untitled" }), f(h)] }), h.metadata?.summary && o(Pe, { variant: "body2", component: "div", color: "text.secondary", sx: { overflow: "hidden", display: "flex", flexDirection: "column", textOverflow: "ellipsis", alignItems: "flex-start" }, children: h.metadata.summary })] }, `${h.path}-${w}`)) })] }), y] });
|
|
2375
2383
|
}));
|
|
2376
|
-
|
|
2377
|
-
const
|
|
2378
|
-
const { className: t, sx: e, editorProps: r, commands: l, readOnly: c = !1, frame: p, autoFocusSel: i, autoFocus: s = !0, scripts: d, ...x } = n, g =
|
|
2384
|
+
bi.displayName = "TemplateSelectPanel";
|
|
2385
|
+
const xi = q(X((n, a) => {
|
|
2386
|
+
const { className: t, sx: e, editorProps: r, commands: l, readOnly: c = !1, frame: p, autoFocusSel: i, autoFocus: s = !0, scripts: d, ...x } = n, g = Ke(), [m, u] = _(!1), b = xe(!1), [y, f] = _({ message: "Loading", cursor: "", dirty: !1 }), [h, w] = _(null);
|
|
2379
2387
|
de(() => {
|
|
2380
2388
|
let L = !1;
|
|
2381
2389
|
return w(null), (async function() {
|
|
2382
2390
|
if (d && (await d.start(), !L)) {
|
|
2383
|
-
const
|
|
2384
|
-
w({ source:
|
|
2391
|
+
const O = d.getModules().getItems()[0]?.getSource();
|
|
2392
|
+
w({ source: O || null });
|
|
2385
2393
|
}
|
|
2386
2394
|
})(), () => {
|
|
2387
2395
|
L = !0;
|
|
2388
2396
|
};
|
|
2389
2397
|
}, [d]);
|
|
2390
2398
|
const v = U((L) => {
|
|
2391
|
-
f((
|
|
2399
|
+
f((O) => ({ ...O, ...L }));
|
|
2392
2400
|
}, []), S = xe(null), [C, D] = _(null), T = xe(null), P = Y((L) => {
|
|
2393
2401
|
if (C) return C.focus(L), !0;
|
|
2394
2402
|
if (i) {
|
|
2395
|
-
const
|
|
2396
|
-
if (
|
|
2403
|
+
const O = S.current?.querySelectorAll?.(i);
|
|
2404
|
+
if (O && O.length > 0) return O[0]?.focus?.(L), !0;
|
|
2397
2405
|
}
|
|
2398
2406
|
return S.current?.focus?.(L), !1;
|
|
2399
|
-
}, [C, i, s]), R = W(() => o(Wt, { transitionDelay: "160ms", style: { position: "absolute", width: "100%", height: "100%" }, transparentBackground: !1 }), []), k = W(() => o(no, { 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(
|
|
2407
|
+
}, [C, i, s]), R = W(() => o(Wt, { transitionDelay: "160ms", style: { position: "absolute", width: "100%", height: "100%" }, transparentBackground: !1 }), []), k = W(() => o(no, { 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(fi, { commands: l }) }), [g, l]), E = W(() => o(B, { className: Te("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 ${g.palette.divider}` }, children: H("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "center", flexDirection: "row", justifyContent: "center" }, children: [o(Pe, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "1 1 100%", color: (L) => L.palette.text.secondary }, variant: "caption", children: y.message }), o(Pe, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", color: (L) => L.palette.text.secondary }, variant: "caption", children: y.dirty ? "Unsaved" : "" }), o(Pe, { 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: y.cursor })] }) }), [y]), M = W(() => H(B, { className: Te("script-editor-content"), sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "column", boxSizing: "border-box" }, children: [k, o(B, { sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "row", position: "relative", boxSizing: "border-box" }, children: o(Ll, { ref: S, loadingPanel: R, readOnly: c, frame: p, autoFocus: s, commands: l, onStatusChange: v, darkMode: g.palette.mode === "dark", ...r }) }), E] }), [g, l, k, E, m, R, c, r, s, i, p, v]), I = W(() => {
|
|
2400
2408
|
let L;
|
|
2401
|
-
return h === null ? null : (h.source === null && (L = o(
|
|
2402
|
-
S.current?.getEditor()?.insertSnippet(
|
|
2403
|
-
} })), o(B, { tabIndex: 0, className:
|
|
2404
|
-
|
|
2409
|
+
return h === null ? null : (h.source === null && (L = o(bi, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", position: "absolute", boxSizing: "border-box", width: "100%", height: "100%" }, onScriptSelect: (O) => {
|
|
2410
|
+
S.current?.getEditor()?.insertSnippet(O.content), w({ source: O.content ?? "" });
|
|
2411
|
+
} })), o(B, { tabIndex: 0, className: Te("script-workspace", t), sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", alignItems: "stretch", userSelect: "none", flexGrow: 0, outline: "none" }, onPointerDown: (O) => {
|
|
2412
|
+
O.isDefaultPrevented() || S.current?.focus();
|
|
2405
2413
|
}, children: H(B, { sx: { flex: "1 1 100%", position: "relative", display: "flex" }, children: [M, L] }) }));
|
|
2406
|
-
}, [k, M, t, h]),
|
|
2414
|
+
}, [k, M, t, h]), F = Ct(a, () => ({ isScriptWorkspaceElement: () => !0, focus: (L) => {
|
|
2407
2415
|
P(L);
|
|
2408
2416
|
} }), []);
|
|
2409
|
-
return o(B, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", ...e }, ref:
|
|
2410
|
-
u(!0), b.current = !0,
|
|
2417
|
+
return o(B, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", ...e }, ref: F, ...x, onFocus: (L) => {
|
|
2418
|
+
u(!0), b.current = !0, F.current?.contains(L.target) && L.target !== F.current && D(L.target), L.relatedTarget && !T.current && (T.current = L.relatedTarget), x?.onFocus?.(L);
|
|
2411
2419
|
}, onBlur: (L) => {
|
|
2412
|
-
|
|
2420
|
+
F?.current?.contains(L.relatedTarget) || F?.current === L.relatedTarget || (T.current = null, b.current = !1, u(!1)), x?.onBlur?.(L);
|
|
2413
2421
|
}, children: I });
|
|
2414
2422
|
}));
|
|
2415
|
-
|
|
2416
|
-
const
|
|
2423
|
+
xi.displayName = "ScriptWorkspace";
|
|
2424
|
+
const Fc = (n, a) => {
|
|
2417
2425
|
const { model: t, commands: e, entryKey: r, frame: l, ...c } = n;
|
|
2418
|
-
return o(
|
|
2419
|
-
},
|
|
2426
|
+
return o(xi, { ref: a, readOnly: !1, commands: e, frame: l, scripts: t?.getScripts(), ...c });
|
|
2427
|
+
}, yi = q(X((n, a) => {
|
|
2420
2428
|
const { commands: t, ...e } = n, r = Ie(t, ["executeScript", "showScriptEditor"]), [l, c] = _([]), [p, i] = _(!1), s = r[0]?.context?.();
|
|
2421
2429
|
de(() => {
|
|
2422
2430
|
const u = s?.getScripts();
|
|
@@ -2426,22 +2434,22 @@ const Nc = (n, a) => {
|
|
|
2426
2434
|
c(b), i(!1);
|
|
2427
2435
|
})();
|
|
2428
2436
|
}, []);
|
|
2429
|
-
const d = { variant:
|
|
2437
|
+
const d = { variant: re.Menuitem, parentFloat: n.floatReference, scope: "scripts", shortcut: null }, x = [], g = l.length;
|
|
2430
2438
|
for (let u = 0; u < g; u++) {
|
|
2431
2439
|
const b = l[u];
|
|
2432
|
-
x.push(o(
|
|
2440
|
+
x.push(o(N, { ...d, command: t.getCommand("executeScript"), commandState: { declaration: b }, tooltipProps: { description: `Execute ${b.getName() ?? "macro"}` }, icon: o(he, { iconKey: "ScriptMacro" }), label: b.getName() ?? `Script '${b.getName()}'` }, `macro-${b.getName()}-${u}`));
|
|
2433
2441
|
}
|
|
2434
|
-
const m = H(B, { ref: a, sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [x.length > 0 ? H(le, { children: [o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: x }), o(
|
|
2442
|
+
const m = H(B, { ref: a, sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [x.length > 0 ? H(le, { children: [o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: x }), o(Q, { orientation: "horizontal" })] }) : null, ke(N, { ...d, key: "show-editor", command: t.getCommand("showScriptEditor") })] });
|
|
2435
2443
|
return ge({ ...e, children: m });
|
|
2436
2444
|
}));
|
|
2437
|
-
|
|
2438
|
-
const
|
|
2445
|
+
yi.displayName = "RunScriptPopupPanel";
|
|
2446
|
+
const wi = q(X((n, a) => {
|
|
2439
2447
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = "showScriptEditor", i = Ie(t, ["executeScript", "showScriptEditor"])[0].context(), s = U((d, x) => {
|
|
2440
|
-
const g = o(
|
|
2448
|
+
const g = o(yi, { ...d, commands: x });
|
|
2441
2449
|
return ge({ ...d, children: g });
|
|
2442
2450
|
}, [l, i, e, r]);
|
|
2443
|
-
return o(
|
|
2444
|
-
})),
|
|
2451
|
+
return o(Se, { ref: a, commands: t, commandHook: e, createPopupPanel: s, selected: t.getCommand(p).state(), label: "Macros", tooltip: "Run or manage macros.", quickCommand: p, ...c });
|
|
2452
|
+
})), Oc = (n) => o(N, { ...n }), Si = q(X((n, a) => {
|
|
2445
2453
|
const { commands: t, parentFloat: e, commandButtonProps: r, ...l } = n, [c, p] = _(!1), i = Ie(t, ["executeScript", "showScriptEditor"]), s = i[0]?.context?.();
|
|
2446
2454
|
de(() => {
|
|
2447
2455
|
const g = s?.getScripts();
|
|
@@ -2474,58 +2482,58 @@ const yi = q(X((n, a) => {
|
|
|
2474
2482
|
for (let D = 0; D < f; D++) {
|
|
2475
2483
|
const T = b[D], P = T.createCommand?.(d);
|
|
2476
2484
|
if (!P) continue;
|
|
2477
|
-
const R = { command: P, ...u }, k = (T.createCommandButton ??
|
|
2485
|
+
const R = { command: P, ...u }, k = (T.createCommandButton ?? Oc)(R);
|
|
2478
2486
|
y.push(k);
|
|
2479
2487
|
}
|
|
2480
2488
|
}
|
|
2481
|
-
const h = o(No, { ...u, command: t.getCommand("formatFontColor"), icon: o(he, { iconKey: "text.colored" }), isSplit: !0, panelProps: { disableAlpha: !0 } }), w = o(No, { ...u, command: t.getCommand("formatFillColor"), icon: o(he, { iconKey: "fill.colored" }), isSplit: !0, panelProps: { disableAlpha: !0, autoColorLabel: "No Fill", autoColorPosition: Ro.End } }), v = t.getCommand("undo") ? o(le, { children: o(
|
|
2489
|
+
const h = o(No, { ...u, command: t.getCommand("formatFontColor"), icon: o(he, { iconKey: "text.colored" }), isSplit: !0, panelProps: { disableAlpha: !0 } }), w = o(No, { ...u, command: t.getCommand("formatFillColor"), icon: o(he, { iconKey: "fill.colored" }), isSplit: !0, panelProps: { disableAlpha: !0, autoColorLabel: "No Fill", autoColorPosition: Ro.End } }), v = t.getCommand("undo") ? o(le, { children: o(Ha, { ...u, quickCommand: "undo" }) }) : null, S = t.getCommand("find") ? o(le, { children: o(Ys, { ...u }) }) : null;
|
|
2482
2490
|
let C = null;
|
|
2483
|
-
return c && (C = H(le, { children: [o(
|
|
2491
|
+
return c && (C = H(le, { children: [o(Q, {}), o(wi, { ...u })] })), H(Fo, { parentFloat: e, children: [v, null, v ? o(Q, {}) : null, o(ja, { ...u, command: t.getCommand("paste") }), o(N, { ...m, command: t.getCommand("formatPainterToggle") }), o(or, { ...m, command: t.getCommand("copy") }), o(Q, {}), o(tc, { ...u, command: t.getCommand("formatFontFamily") }), o(Zs, { ...u, command: t.getCommand("formatFontSize") }), o(N, { ...m, command: t.getCommand("formatBoldToggle") }), o(N, { ...m, command: t.getCommand("formatItalicToggle") }), o(nc, { ...u }), o(oc, { ...u }), o(qs, { ...u }), w, h, o(Q, {}), o(Os, { ...u }), o(Bs, { ...u }), o(Is, { ...u }), o(As, { ...u }), o(Ks, { ...u }), o(Q, {}), o(Qs, { ...u }), o(lc, { command: t.getCommand("formatCellStyle"), ...u }), o(Fi, { command: t.getCommand("formatTableStyle"), ...u }), o(Q, {}), o(Aa, { ...u }), o(Ia, { ...u }), o(La, { ...u }), o(Q, {}), o(Oi, { ...u }), o(Js, { ...u }), o(Ba, { ...u }), o(za, { ...u }), S, C, y] });
|
|
2484
2492
|
}, [t, i, c, d]);
|
|
2485
2493
|
return o(rn, { ref: a, commands: t, parentFloat: e, commandButtonProps: r, createToolbarPalette: x, ...l });
|
|
2486
2494
|
}));
|
|
2487
|
-
|
|
2488
|
-
const
|
|
2489
|
-
const { commands: t, commandHook: e, scope: r, disabled: l = !1, preferSingleMenu: c = !0, showQuickButton: p = !0, variant: i =
|
|
2495
|
+
Si.displayName = "HomeToolbar";
|
|
2496
|
+
const vi = q(X((n, a) => {
|
|
2497
|
+
const { commands: t, commandHook: e, scope: r, disabled: l = !1, preferSingleMenu: c = !0, showQuickButton: p = !0, variant: i = re.Toolbar, ...s } = n, d = Ie(t, ["insertImageFromFile", "insertImageFromURL"]), { singleMenuCommand: x, allDisabled: g } = W(() => {
|
|
2490
2498
|
let u = null, b = 0;
|
|
2491
|
-
for (let y = 0; y < d.length; y++) d[y] && !d[y]?.disabled() && (c && i ===
|
|
2499
|
+
for (let y = 0; y < d.length; y++) d[y] && !d[y]?.disabled() && (c && i === re.Menuitem && (u = b === 0 ? d[y] : null), b++);
|
|
2492
2500
|
return { singleMenuCommand: u, allDisabled: b === 0 };
|
|
2493
2501
|
}, [d]), m = U((u, b) => {
|
|
2494
|
-
const y = { variant:
|
|
2502
|
+
const y = { variant: re.Menuitem, commandHook: e, scope: "insertImage", disabled: l }, f = H(le, { children: [o(N, { ...y, command: b.getCommand("insertImageFromFile") }), o(N, { ...y, command: b.getCommand("insertImageFromURL") })] });
|
|
2495
2503
|
return ge({ ...u, children: f });
|
|
2496
2504
|
}, [l, e, r]);
|
|
2497
|
-
return x ? o(
|
|
2498
|
-
})),
|
|
2505
|
+
return x ? o(N, { ref: a, variant: i, commandHook: e, disabled: l, command: x, ...s }) : o(Se, { ref: a, variant: i, quickCommand: "insertImageFromFile", commands: t, commandHook: e, scope: r, disabled: l || g, tooltip: "Insert a picture from the web to complement your data.", createPopupPanel: m, icon: "InsertImage", ...s });
|
|
2506
|
+
})), ki = q(X((n, a) => {
|
|
2499
2507
|
const { commands: t, parentFloat: e, commandButtonProps: r, ...l } = n, c = Y((p) => {
|
|
2500
2508
|
const { commandButtonProps: i, commandPopupProps: s } = p;
|
|
2501
|
-
return H(Fo, { parentFloat: e, children: [o(
|
|
2509
|
+
return H(Fo, { parentFloat: e, children: [o(N, { ...i, command: t.getCommand("insertTable") }), o(vi, { ...s }), null, o(N, { ...i, command: t.getCommand("updateHyperlink") }), o(N, { ...i, command: t.getCommand("updateComments") })] });
|
|
2502
2510
|
}, [t]);
|
|
2503
2511
|
return o(rn, { ref: a, commands: t, parentFloat: e, commandButtonProps: r, createToolbarPalette: c, ...l });
|
|
2504
2512
|
}));
|
|
2505
|
-
|
|
2506
|
-
const
|
|
2513
|
+
ki.displayName = "InsertToolbar";
|
|
2514
|
+
const Ci = q(X((n, a) => {
|
|
2507
2515
|
const { commands: t, parentFloat: e, commandButtonProps: r, ...l } = n, c = Y((p) => {
|
|
2508
2516
|
const { commandButtonProps: i, commandPopupProps: s } = p;
|
|
2509
|
-
return H(Fo, { parentFloat: e, children: [o(
|
|
2517
|
+
return H(Fo, { parentFloat: e, children: [o(Xs, { ...s }), o(N, { ...i, command: t.getCommand("protectionSheetToggle") }), o(Q, {}), o(ec, { ...s }), o(rc, { ...s }), o(Q, {}), o(N, { ...i, command: t.getCommand("sheetViewToggleFormulaView"), scope: "view" }), o(N, { ...i, command: t.getCommand("sheetViewToggleShowZeros"), scope: "view" }), o(Q, {}), o(ac, { ...s }), o(od, { command: t.getCommand("selectTheme"), ...s }), o(Q, {}), o(wi, { ...s, scope: "view" }), o(Q, {}), o(N, { ...i, command: t.getCommand("fullScreenToggle"), scope: "view" })] });
|
|
2510
2518
|
}, [t]);
|
|
2511
2519
|
return o(rn, { ref: a, commands: t, parentFloat: e, commandButtonProps: r, createToolbarPalette: c, ...l });
|
|
2512
2520
|
}));
|
|
2513
|
-
|
|
2514
|
-
const
|
|
2521
|
+
Ci.displayName = "ViewToolbar";
|
|
2522
|
+
const Ti = (n) => o(Ei, { ...n }), Bc = q((n) => {
|
|
2515
2523
|
const { sx: a, ...t } = n;
|
|
2516
2524
|
return H(B, { sx: { display: "flex", flexDirection: "column", position: "relative", "&:hover:not([disabled]) .indicator": { borderBottom: (e) => `${ye(e.palette.primary.main, 0.35)} solid 2px` } }, children: [o(Ea, { disableRipple: !0, onMouseDown: (e) => {
|
|
2517
2525
|
e.button === 0 && e.preventDefault();
|
|
2518
2526
|
}, 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(B, { className: "indicator", sx: { width: "90%", borderRadius: "4px", minWidth: "4px", position: "absolute", bottom: "0", alignSelf: "center", display: "flex" } })] });
|
|
2519
|
-
}),
|
|
2527
|
+
}), Ac = q((n) => {
|
|
2520
2528
|
const { toolbars: a, value: t, onToolbarChange: e, sx: r, ...l } = n, c = W(() => {
|
|
2521
2529
|
const p = [];
|
|
2522
|
-
for (let i = 0; i < a.length; i++) p.push(o(
|
|
2530
|
+
for (let i = 0; i < a.length; i++) p.push(o(Bc, { label: a[i].label }, a[i].label));
|
|
2523
2531
|
return p;
|
|
2524
2532
|
}, [a]);
|
|
2525
2533
|
return o(Ta, { value: t, onChange: (p, i) => {
|
|
2526
2534
|
e?.(i);
|
|
2527
2535
|
}, variant: "scrollable", scrollButtons: !1, sx: { paddingLeft: (p) => p.spacing(1.5), paddingRight: (p) => p.spacing(1.5), paddingTop: (p) => p.spacing(0), paddingBottom: (p) => p.spacing(0), minHeight: "26px", alignItems: "center", "& .MuiTabs-indicator": { display: "flex", justifyContent: "center", backgroundColor: "transparent" }, "& .MuiTabs-indicatorSpan": { width: "90%", borderRadius: "4px", minWidth: "4px", backgroundColor: (p) => p.palette.primary.main }, "& .MuiTab-root": { marginRight: "0px" }, ...r }, slotProps: { indicator: { children: o("span", { className: "MuiTabs-indicatorSpan" }) } }, ...l, children: c });
|
|
2528
|
-
}),
|
|
2536
|
+
}), Ic = q((n) => {
|
|
2529
2537
|
const { toolbars: a, value: t, onToolbarChange: e, selectProps: r, ...l } = n, c = U((i) => {
|
|
2530
2538
|
e?.(i.target.value);
|
|
2531
2539
|
}, [e]), p = W(() => {
|
|
@@ -2538,26 +2546,26 @@ const Ci = (n) => o(Ti, { ...n }), Oc = q((n) => {
|
|
|
2538
2546
|
}
|
|
2539
2547
|
return i;
|
|
2540
2548
|
}, [a, t]);
|
|
2541
|
-
return o(Xn, { 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(
|
|
2542
|
-
}),
|
|
2549
|
+
return o(Xn, { 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(es, { value: t, onChange: c, variant: "outlined", sx: { backgroundImage: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})` }, ...l, children: p }) });
|
|
2550
|
+
}), Ei = q(X((n, a) => {
|
|
2543
2551
|
const { commands: t, selectWrapper: e, selectProps: r = {}, renderCompact: l = !1, paletteWrapper: c, toolbarsProps: p, paletteProps: i = {}, workbook: s, sx: d, ...x } = n, g = W(() => {
|
|
2544
2552
|
const S = [], { ref: C, ...D } = p?.Home || {};
|
|
2545
|
-
S.push({ label: "Home", component: o(
|
|
2553
|
+
S.push({ label: "Home", component: o(Si, { commands: t, ...D }) });
|
|
2546
2554
|
const { ref: T, ...P } = p?.Insert || {};
|
|
2547
|
-
S.push({ label: "Insert", component: o(
|
|
2555
|
+
S.push({ label: "Insert", component: o(ki, { commands: t, ...P }) });
|
|
2548
2556
|
const { ref: R, ...k } = p?.View || {};
|
|
2549
|
-
return S.push({ label: "View", component: o(
|
|
2557
|
+
return S.push({ label: "View", component: o(Ci, { commands: t, ...k }) }), S;
|
|
2550
2558
|
}, [t, s]), m = W(() => {
|
|
2551
2559
|
const S = [];
|
|
2552
|
-
for (let C = 0; C < g.length; C++) S.push(
|
|
2560
|
+
for (let C = 0; C < g.length; C++) S.push(ae.cloneElement(g[C].component, { ...g[C].component.props, key: g[C].key ?? g[C].label }));
|
|
2553
2561
|
return S;
|
|
2554
2562
|
}, [g]), [u, b] = _(0), y = (S) => {
|
|
2555
2563
|
b(S);
|
|
2556
|
-
}, f = W(() => o(l ?
|
|
2564
|
+
}, f = W(() => o(l ? Ic : Ac, { toolbars: g, value: u, onToolbarChange: y, sx: r }), [g, u, r, l]), { sx: h, ...w } = i, v = o(no, { elevation: 2, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, borderRadius: "8px", backgroundImage: `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})`, marginLeft: (S) => S.spacing(1), marginRight: (S) => S.spacing(1), marginTop: (S) => S.spacing(0.5), marginBottom: (S) => S.spacing(0.5), ...h }, ...w, children: m[u] });
|
|
2557
2565
|
return H(B, { ref: a, className: "toolbarWrappers", sx: { display: "flex", flexDirection: "column", paddingTop: (S) => S.spacing(0.5), "*": { userSelect: "none" }, ...d }, ...x, children: [e ? e(f) : f, c ? c(v) : v] });
|
|
2558
2566
|
}));
|
|
2559
2567
|
var Qr, Jr;
|
|
2560
|
-
|
|
2568
|
+
Ei.displayName = "WorkbookToolbars", (function() {
|
|
2561
2569
|
if (Jr) return Qr;
|
|
2562
2570
|
Jr = 1;
|
|
2563
2571
|
var n = /^\s+|\s+$/g, a = /^[-+]0x[0-9a-f]+$/i, t = /^0b[01]+$/i, e = /^0o[0-7]+$/i, r = parseInt, l = typeof Do == "object" && Do && Do.Object === Object && Do, c = typeof self == "object" && self && self.Object === Object && self, p = l || c || Function("return this")(), i = Object.prototype.toString, s = Math.max, d = Math.min, x = function() {
|
|
@@ -2587,27 +2595,27 @@ Ti.displayName = "WorkbookToolbars", (function() {
|
|
|
2587
2595
|
var f, h, w, v, S, C, D = 0, T = !1, P = !1, R = !0;
|
|
2588
2596
|
if (typeof u != "function") throw new TypeError("Expected a function");
|
|
2589
2597
|
function k(L) {
|
|
2590
|
-
var
|
|
2591
|
-
return f = h = void 0, D = L, v = u.apply(z,
|
|
2598
|
+
var O = f, z = h;
|
|
2599
|
+
return f = h = void 0, D = L, v = u.apply(z, O);
|
|
2592
2600
|
}
|
|
2593
2601
|
function E(L) {
|
|
2594
|
-
var
|
|
2595
|
-
return C === void 0 ||
|
|
2602
|
+
var O = L - C;
|
|
2603
|
+
return C === void 0 || O >= b || O < 0 || P && L - D >= w;
|
|
2596
2604
|
}
|
|
2597
2605
|
function M() {
|
|
2598
2606
|
var L = x();
|
|
2599
2607
|
if (E(L)) return I(L);
|
|
2600
|
-
S = setTimeout(M, (function(
|
|
2601
|
-
var z = b - (
|
|
2602
|
-
return P ? d(z, w - (
|
|
2608
|
+
S = setTimeout(M, (function(O) {
|
|
2609
|
+
var z = b - (O - C);
|
|
2610
|
+
return P ? d(z, w - (O - D)) : z;
|
|
2603
2611
|
})(L));
|
|
2604
2612
|
}
|
|
2605
2613
|
function I(L) {
|
|
2606
2614
|
return S = void 0, R && f ? k(L) : (f = h = void 0, v);
|
|
2607
2615
|
}
|
|
2608
|
-
function
|
|
2609
|
-
var L = x(),
|
|
2610
|
-
if (f = arguments, h = this, C = L,
|
|
2616
|
+
function F() {
|
|
2617
|
+
var L = x(), O = E(L);
|
|
2618
|
+
if (f = arguments, h = this, C = L, O) {
|
|
2611
2619
|
if (S === void 0) return (function(z) {
|
|
2612
2620
|
return D = z, S = setTimeout(M, b), T ? k(z) : v;
|
|
2613
2621
|
})(C);
|
|
@@ -2615,18 +2623,18 @@ Ti.displayName = "WorkbookToolbars", (function() {
|
|
|
2615
2623
|
}
|
|
2616
2624
|
return S === void 0 && (S = setTimeout(M, b)), v;
|
|
2617
2625
|
}
|
|
2618
|
-
return b = m(b) || 0, g(y) && (T = !!y.leading, w = (P = "maxWait" in y) ? s(m(y.maxWait) || 0, b) : w, R = "trailing" in y ? !!y.trailing : R),
|
|
2626
|
+
return b = m(b) || 0, g(y) && (T = !!y.leading, w = (P = "maxWait" in y) ? s(m(y.maxWait) || 0, b) : w, R = "trailing" in y ? !!y.trailing : R), F.cancel = function() {
|
|
2619
2627
|
S !== void 0 && clearTimeout(S), D = 0, f = C = h = S = void 0;
|
|
2620
|
-
},
|
|
2628
|
+
}, F.flush = function() {
|
|
2621
2629
|
return S === void 0 ? v : I(x());
|
|
2622
|
-
},
|
|
2630
|
+
}, F;
|
|
2623
2631
|
};
|
|
2624
2632
|
})();
|
|
2625
2633
|
var ea, ta, oa = { exports: {} }, En = {};
|
|
2626
2634
|
ta || (ta = 1, oa.exports = (function() {
|
|
2627
2635
|
if (ea) return En;
|
|
2628
2636
|
ea = 1;
|
|
2629
|
-
var n =
|
|
2637
|
+
var n = ae, a = typeof Object.is == "function" ? Object.is : function(i, s) {
|
|
2630
2638
|
return i === s && (i !== 0 || 1 / i == 1 / s) || i != i && s != s;
|
|
2631
2639
|
}, t = n.useState, e = n.useEffect, r = n.useLayoutEffect, l = n.useDebugValue;
|
|
2632
2640
|
function c(i) {
|
|
@@ -2653,7 +2661,7 @@ ta || (ta = 1, oa.exports = (function() {
|
|
|
2653
2661
|
};
|
|
2654
2662
|
return En.useSyncExternalStore = n.useSyncExternalStore !== void 0 ? n.useSyncExternalStore : p, En;
|
|
2655
2663
|
})()), oa.exports;
|
|
2656
|
-
var na, ra, So = { exports: {} }, Zt = { exports: {} },
|
|
2664
|
+
var na, ra, So = { exports: {} }, Zt = { exports: {} }, Lc = Zt.exports;
|
|
2657
2665
|
(function() {
|
|
2658
2666
|
if (ra) return So.exports;
|
|
2659
2667
|
ra = 1;
|
|
@@ -2671,7 +2679,7 @@ var na, ra, So = { exports: {} }, Zt = { exports: {} }, Ic = Zt.exports;
|
|
|
2671
2679
|
}, m = Date.now()) : (Zt.exports = function() {
|
|
2672
2680
|
return (/* @__PURE__ */ new Date()).getTime() - m;
|
|
2673
2681
|
}, m = (/* @__PURE__ */ new Date()).getTime());
|
|
2674
|
-
}.call(
|
|
2682
|
+
}.call(Lc)), Zt.exports), a = typeof window > "u" ? Do : window, t = ["moz", "webkit"], e = "AnimationFrame", r = a["request" + e], l = a["cancel" + e] || a["cancelRequest" + e], c = 0; !r && c < t.length; c++) r = a[t[c] + "Request" + e], l = a[t[c] + "Cancel" + e] || a[t[c] + "CancelRequest" + e];
|
|
2675
2683
|
if (!r || !l) {
|
|
2676
2684
|
var p = 0, i = 0, s = [], d = 1e3 / 60;
|
|
2677
2685
|
r = function(x) {
|
|
@@ -2702,7 +2710,7 @@ var na, ra, So = { exports: {} }, Zt = { exports: {} }, Ic = Zt.exports;
|
|
|
2702
2710
|
x || (x = a), x.requestAnimationFrame = r, x.cancelAnimationFrame = l;
|
|
2703
2711
|
}, So.exports;
|
|
2704
2712
|
})();
|
|
2705
|
-
var
|
|
2713
|
+
var lt = { DOM_UNAVAILABLE_ERROR: "DOM is unavailable server-side. Please use this method client-side only.", FULLSCREEN_UNSUPPORTED_ERROR: "Your browser does not support Fullscreen API.", getEventsNames() {
|
|
2706
2714
|
if (typeof document > "u") return null;
|
|
2707
2715
|
const n = document;
|
|
2708
2716
|
return "exitFullscreen" in n ? ["fullscreenchange", "fullscreenerror"] : "webkitExitFullscreen" in n || "webkitCancelFullScreen" in n ? ["webkitfullscreenchange", "webkitfullscreenerror"] : "mozCancelFullScreen" in n ? ["mozfullscreenchange", "mozfullscreenerror"] : "msExitFullscreen" in n ? ["MSFullscreenChange", "MSFullscreenError"] : null;
|
|
@@ -2734,51 +2742,51 @@ var it = { DOM_UNAVAILABLE_ERROR: "DOM is unavailable server-side. Please use th
|
|
|
2734
2742
|
const t = this.getEventName(n);
|
|
2735
2743
|
t && document.removeEventListener(t, a);
|
|
2736
2744
|
} };
|
|
2737
|
-
const
|
|
2738
|
-
const { workbook: a, workbookElement: t, target: e, commands: r, darkMode: l, onNewWorkbook: c =
|
|
2745
|
+
const zc = (n) => {
|
|
2746
|
+
const { workbook: a, workbookElement: t, target: e, commands: r, darkMode: l, onNewWorkbook: c = Hc } = n, p = sn(), [i, s] = _(a?.getSelectedSheet()), [d, x] = _(a?.getSheets().getItems()), g = Y(c, [c]), m = wa(), u = W(() => [new He("activateTask", e, { label: "Activate Task", description: "Activate Task Pane.", shortcut: { key: "F6" } }), new He("workbookStatistics", e, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [fe.Ctrl, fe.Shift] } }), new He("workbookStatistics", e, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [fe.Ctrl, fe.Shift] } }), new He("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 He("find", e, { label: "Find", description: "Open the Find window.", icon: "Find", shortcut: [{ key: "F", modifiers: [fe.Ctrl] }, { key: "F5", modifiers: [fe.Shift] }] }), new He("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 He("goto", e, { label: "Go To", description: "Open the 'Go To' window.", icon: "Goto", shortcut: [{ key: "G", modifiers: [fe.Ctrl] }] }), new He("workbookViewToggleExpandFormulaBar", e, { label: "Toggle Expand Formula bar", description: "Expand or collapse the formula bar.", shortcut: { key: "U", modifiers: [fe.Ctrl, fe.Shift] } }), new He("workbookViewToggleShowFormulaBar", e, { label: "View Formula bar", scopedLabels: { view: "Formula Bar" }, description: "Show or hide the formula bar." }), new He("workbookViewToggleShowTabs", e, { label: "View Sheet Tabs", description: "Show or hide the sheet tabs.", scopedLabels: { view: "Sheet Tabs" } }), new He("workbookViewToggleShowStatusBar", e, { label: "View Status Bar", description: "Show or hide the status bar.", scopedLabels: { view: "Status Bar" } }), new He("workbookViewToggleShowHorizontalScrollBar", e, { label: "View Horizontal Scrollbar", description: "Show or hide the horizontal scrollbar.", scopedLabels: { view: "Horizontal Scrollbar" } }), new He("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: (k) => k?.getName() ?? "Select Named Item", scopedLabels: { namedItem: (k) => k?.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 He("activeNameBox", e, { label: "Activate Name Box", description: "Move the focus to the name box.", shortcut: { key: "F3", modifiers: [fe.Alt] } }), new He("createNamedReferenceFromSelection", e, { label: "Create from Selection", description: "Automatically generate names from the selected cells.", shortcut: { key: "F3", modifiers: [fe.Ctrl, fe.Shift] } }), new He("activeNameManager", e, { label: "Activate Name Manager", description: `Create, edit, delete, and find all the names used in the workbook.
|
|
2739
2747
|
|
|
2740
2748
|
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" } }), new He("closeWorkbook", e, { label: "Close Workbook", description: "Close the workbook.", shortcut: { key: "W", modifiers: [fe.Ctrl] } }), new He("newWorkbook", e, { label: "New Workbook", description: "Create a new workbook in another tab.", icon: "FileNew" })], []), b = W(() => {
|
|
2741
2749
|
let k = null;
|
|
2742
2750
|
return k = r ? r.createChildGroup(e, "workbook", !1) : new Jn(e, "workbook"), k.addCommands(u, !0), k;
|
|
2743
|
-
}, [r, u]), y = ln(), f =
|
|
2751
|
+
}, [r, u]), y = ln(), f = ae.useRef(null), h = Y(() => {
|
|
2744
2752
|
let k, E = null;
|
|
2745
2753
|
const M = b.getCommand("executeScript");
|
|
2746
2754
|
if (M.update({ disabled: !1, context: { getScripts: () => a.getScripts() } }), !M) return;
|
|
2747
2755
|
const I = b.getCommand("showScriptEditor");
|
|
2748
|
-
I.updateCallback(function(
|
|
2756
|
+
I.updateCallback(function(O = !0) {
|
|
2749
2757
|
E ? E.close() : m.activateTaskPane("scriptEditor", {});
|
|
2750
2758
|
});
|
|
2751
|
-
const
|
|
2752
|
-
if (!
|
|
2753
|
-
const L = { saveSource: async (
|
|
2754
|
-
let z = null,
|
|
2755
|
-
const
|
|
2759
|
+
const F = b.getCommand("executeSelectedScript");
|
|
2760
|
+
if (!F) return;
|
|
2761
|
+
const L = { saveSource: async (O) => {
|
|
2762
|
+
let z = null, ie = null;
|
|
2763
|
+
const J = a.getScripts();
|
|
2756
2764
|
try {
|
|
2757
|
-
|
|
2758
|
-
} catch (
|
|
2759
|
-
|
|
2765
|
+
O && (ie = await p.showBusy("Saving Scripts..."), z = await J.createModule({ source: O })), J.addModule("scripts", z, { replace: !0 }), ie?.();
|
|
2766
|
+
} catch (pe) {
|
|
2767
|
+
ie?.(), console.warn("Unable to compile", pe), p.showError(pe);
|
|
2760
2768
|
}
|
|
2761
2769
|
return z;
|
|
2762
|
-
}, addContainerListener: (
|
|
2770
|
+
}, addContainerListener: (O) => (w.current = O, () => {
|
|
2763
2771
|
w.current = null;
|
|
2764
|
-
}), setSelectedFunction: (
|
|
2765
|
-
k =
|
|
2766
|
-
|
|
2772
|
+
}), setSelectedFunction: (O) => {
|
|
2773
|
+
k = O ?? f.current ?? null, Promise.resolve(k).then((z) => {
|
|
2774
|
+
F.update({ disabled: z === null });
|
|
2767
2775
|
});
|
|
2768
|
-
}, quickInsertFunction: (
|
|
2769
|
-
const z = `=${
|
|
2770
|
-
y.setMode((
|
|
2771
|
-
}, getSelectedFunction: () => k, setEditor: (
|
|
2772
|
-
E =
|
|
2773
|
-
}, getEditor: () => E, getRanges: (
|
|
2776
|
+
}, quickInsertFunction: (O) => {
|
|
2777
|
+
const z = `=${O.toUpperCase()}(`, ie = { text: z + ")", editMode: !0, initialSelection: { start: z.length, end: z.length + 0 } };
|
|
2778
|
+
y.setMode((J) => J?.key === "edit" ? { ...J, args: { ...J.args } } : { key: "edit", args: { stateAndCoords: null, start: ie } });
|
|
2779
|
+
}, getSelectedFunction: () => k, setEditor: (O) => {
|
|
2780
|
+
E = O ?? null, I.update({ state: E !== null });
|
|
2781
|
+
}, getEditor: () => E, getRanges: (O) => {
|
|
2774
2782
|
try {
|
|
2775
|
-
return a.getRanges(
|
|
2783
|
+
return a.getRanges(O);
|
|
2776
2784
|
} catch {
|
|
2777
2785
|
}
|
|
2778
2786
|
return null;
|
|
2779
2787
|
}, getScripts: () => a.getScripts() };
|
|
2780
|
-
|
|
2781
|
-
}, [b, a, t, p]), w =
|
|
2788
|
+
F.update({ context: L });
|
|
2789
|
+
}, [b, a, t, p]), w = ae.useRef(null);
|
|
2782
2790
|
We(a, { onBeforeSave: async () => {
|
|
2783
2791
|
await w.current?.onBeforeSave();
|
|
2784
2792
|
}, onProtectionChange: () => {
|
|
@@ -2796,18 +2804,18 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2796
2804
|
h();
|
|
2797
2805
|
} });
|
|
2798
2806
|
const { isFullscreenAvailable: v, isFullscreenEnabled: S, toggleFullscreen: C } = (function(k = {}) {
|
|
2799
|
-
const { target: E, onChange: M, onError: I, requestFullScreenOptions:
|
|
2800
|
-
const oe =
|
|
2801
|
-
|
|
2807
|
+
const { target: E, onChange: M, onError: I, requestFullScreenOptions: F } = k, [L, O] = _(!1), [z, ie] = _(null), [J, pe] = _(!1), j = U(() => lt.requestFullscreen(E?.current || null, F), [E, F]), K = U(() => lt.exitFullscreen(), []), ee = U(() => lt.fullscreenElement ? K() : j(), [j, K]), V = U((Z) => {
|
|
2808
|
+
const oe = lt.fullscreenElement;
|
|
2809
|
+
ie(oe), pe(!!oe), M?.(Z);
|
|
2802
2810
|
}, [M]), A = U((Z) => {
|
|
2803
|
-
const oe =
|
|
2804
|
-
|
|
2811
|
+
const oe = lt.fullscreenElement;
|
|
2812
|
+
ie(oe), pe(!!oe), I?.(Z);
|
|
2805
2813
|
}, [I]);
|
|
2806
2814
|
return de(() => {
|
|
2807
|
-
|
|
2808
|
-
}, []), de(() => (
|
|
2809
|
-
|
|
2810
|
-
}), [V, A]), { isFullscreenAvailable: L, fullscreenElement: z, isFullscreenEnabled:
|
|
2815
|
+
O(lt.fullscreenEnabled);
|
|
2816
|
+
}, []), de(() => (lt.on("change", V), lt.on("error", A), () => {
|
|
2817
|
+
lt.off("change", V), lt.off("error", A);
|
|
2818
|
+
}), [V, A]), { isFullscreenAvailable: L, fullscreenElement: z, isFullscreenEnabled: J, enableFullscreen: j, disableFullscreen: K, toggleFullscreen: ee };
|
|
2811
2819
|
})({ target: { current: t ?? document.body } }), D = Gn();
|
|
2812
2820
|
de(() => {
|
|
2813
2821
|
b.getCommand("selectTheme").update({ state: () => a.getTheme(), context: () => ({ theme: a.getTheme(), themes: D, darkMode: l }) });
|
|
@@ -2816,13 +2824,13 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2816
2824
|
let M = null;
|
|
2817
2825
|
const I = a.getScripts();
|
|
2818
2826
|
if (k?.declaration || k?.functionName) {
|
|
2819
|
-
const
|
|
2820
|
-
(await I.searchFunctions({ name:
|
|
2827
|
+
const F = k.declaration ? k.declaration.getName() : k.functionName;
|
|
2828
|
+
(await I.searchFunctions({ name: F })).length > 0 && (M = F);
|
|
2821
2829
|
}
|
|
2822
2830
|
if (M) try {
|
|
2823
2831
|
await I.executeMacro(M), f.current = Promise.resolve({ source: null, name: M });
|
|
2824
|
-
} catch (
|
|
2825
|
-
return void p.showError(
|
|
2832
|
+
} catch (F) {
|
|
2833
|
+
return void p.showError(F);
|
|
2826
2834
|
}
|
|
2827
2835
|
}, [a, p]);
|
|
2828
2836
|
de(() => {
|
|
@@ -2841,16 +2849,16 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2841
2849
|
let I = null;
|
|
2842
2850
|
try {
|
|
2843
2851
|
a.getStyles().validateStyleName(E, !1);
|
|
2844
|
-
} catch (
|
|
2845
|
-
I =
|
|
2852
|
+
} catch (O) {
|
|
2853
|
+
I = O.message;
|
|
2846
2854
|
}
|
|
2847
|
-
let
|
|
2848
|
-
return !L &&
|
|
2855
|
+
let F = a.getStyles().getNamed(E), L = I;
|
|
2856
|
+
return !L && F && (L = `Update style '${F.getName()}'.`), { valid: I === null, message: L };
|
|
2849
2857
|
} }).then(({ input: E, option: M }) => {
|
|
2850
2858
|
const I = a.getSelectedSheet().getSelectedRange();
|
|
2851
2859
|
if (M !== "Ok") return;
|
|
2852
|
-
const
|
|
2853
|
-
I.getStyle().update({ named:
|
|
2860
|
+
const F = a.getStyles().setNamed({ name: E, style: I.getCell().getStyle() });
|
|
2861
|
+
I.getStyle().update({ named: F.getName() });
|
|
2854
2862
|
});
|
|
2855
2863
|
}), b.getCommand("deleteCellStyle").updateCallback((k) => {
|
|
2856
2864
|
k.delete();
|
|
@@ -2886,28 +2894,28 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2886
2894
|
const P = Y(async (k) => {
|
|
2887
2895
|
let E = 0, M = null, I = "Find & Replace";
|
|
2888
2896
|
k?.replace && !k?.replaceOptions?.maxCount && (I = "Replace All");
|
|
2889
|
-
const
|
|
2897
|
+
const F = await p.showBusy(I);
|
|
2890
2898
|
try {
|
|
2891
2899
|
const L = k?.scope ?? "sheet";
|
|
2892
|
-
let
|
|
2893
|
-
const z = a.getSelectedSheet(),
|
|
2894
|
-
if (
|
|
2895
|
-
const
|
|
2896
|
-
E =
|
|
2900
|
+
let O = null;
|
|
2901
|
+
const z = a.getSelectedSheet(), ie = { from: z.getSelectedCell(), ...k.findOptions };
|
|
2902
|
+
if (O = L === "sheet" ? a.getSelectedSheet().find(ie) : a.find(ie), k.replace) {
|
|
2903
|
+
const J = a.replace(O, k.replaceText, k.replaceOptions);
|
|
2904
|
+
E = J.count, k.replaceOptions.maxCount && (M = J.last);
|
|
2897
2905
|
} else {
|
|
2898
|
-
let
|
|
2899
|
-
|
|
2906
|
+
let J = O.next();
|
|
2907
|
+
J.done || (E++, M = J.value);
|
|
2900
2908
|
}
|
|
2901
|
-
M?.select({ autoFocus: !1 }),
|
|
2909
|
+
M?.select({ autoFocus: !1 }), F?.(), !k.replaceOptions.maxCount && E > 1 && p.showMessage(`We replaced ${E} cells.`);
|
|
2902
2910
|
} catch (L) {
|
|
2903
|
-
|
|
2911
|
+
F?.(), p.showError(L);
|
|
2904
2912
|
}
|
|
2905
2913
|
return E;
|
|
2906
2914
|
}, [a, t]), R = Y((k) => {
|
|
2907
2915
|
const E = { value: k, context: { selection: () => {
|
|
2908
2916
|
const M = a.getSelectedRanges(), I = [];
|
|
2909
|
-
for (let
|
|
2910
|
-
const L = M.at(
|
|
2917
|
+
for (let F = 0; F < M.getCount(); F++) {
|
|
2918
|
+
const L = M.at(F).getFixed(!0).getCoords();
|
|
2911
2919
|
I.push(L);
|
|
2912
2920
|
}
|
|
2913
2921
|
return a.getRanges(I);
|
|
@@ -2922,8 +2930,8 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2922
2930
|
}, [p, a, t]);
|
|
2923
2931
|
return de(() => {
|
|
2924
2932
|
const k = (E = !1) => {
|
|
2925
|
-
const M = a.getSelectedCell(), I = { onFindOrReplace: P, onKeyDown: (
|
|
2926
|
-
b.findCommandByEvent(
|
|
2933
|
+
const M = a.getSelectedCell(), I = { onFindOrReplace: P, onKeyDown: (F) => {
|
|
2934
|
+
b.findCommandByEvent(F) !== b.getCommand("find") && b.findCommandByEvent(F) !== b.getCommand("findReplace") || F.preventDefault();
|
|
2927
2935
|
}, findOptions: { text: "" }, findText: M.toTextUnformatted(!0) };
|
|
2928
2936
|
I.replace = E, p.showWindow?.("find", I, { disableAutoDestroy: !0 });
|
|
2929
2937
|
};
|
|
@@ -2986,10 +2994,10 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
2986
2994
|
const k = a.getProtection().isStructureAllowed();
|
|
2987
2995
|
b.getCommand("hideSheet").update({ disabled: d.length <= 1 || !k }), b.getCommand("deleteSheet").update({ disabled: d.length <= 1 || !k });
|
|
2988
2996
|
}, [d, i]), b;
|
|
2989
|
-
},
|
|
2990
|
-
window.open(window.origin.toString(), "sheetxl-" +
|
|
2991
|
-
},
|
|
2992
|
-
const { workbook: t, commands: e, onBeforeUserChange: r, onUserChange: l, disabled: c = !1, readOnly: p = !1, contextMenuProps: i, renderContextMenu: s =
|
|
2997
|
+
}, Hc = () => {
|
|
2998
|
+
window.open(window.origin.toString(), "sheetxl-" + gt.uuidV4(), "popup=true");
|
|
2999
|
+
}, Wc = "_sheetxl-theme_4opcr_2", jc = "_sheetxl-workbook_g5t6x_5", $c = (n) => o(li, { ...n }), Vc = (n) => o(si, { ...n }), _c = (n) => o(ii, { ...n }), Di = q(X((n, a) => {
|
|
3000
|
+
const { workbook: t, commands: e, onBeforeUserChange: r, onUserChange: l, disabled: c = !1, readOnly: p = !1, contextMenuProps: i, renderContextMenu: s = $c, sheetsAllProps: d, renderSheetsAll: x = Vc, sheetTabProps: g, renderSheetTab: m, background: u = "transparent", className: b, sx: y, borderWidth: f, borderColor: h, gridTheme: w, gridStyle: v, ...S } = n, [C, D] = _(t?.getSelectedSheetIndex()), [T, P] = _(t?.getSheets().getItems()), [R, k] = _(t?.getProtection());
|
|
2993
3001
|
We(t, { onViewChange(ne) {
|
|
2994
3002
|
D(ne?.getSelectedSheetIndex());
|
|
2995
3003
|
}, onSheetsChange: (ne) => {
|
|
@@ -3003,53 +3011,53 @@ Names can be used as a substitute for cell references.`, shortcut: { key: "F3",
|
|
|
3003
3011
|
return ne;
|
|
3004
3012
|
}, [T]), I = U((ne) => {
|
|
3005
3013
|
r?.(ne) !== !1 && (t.getSheetAt(ne).select(), l?.(ne));
|
|
3006
|
-
}, [t, r, l]),
|
|
3014
|
+
}, [t, r, l]), F = U((ne, G) => {
|
|
3007
3015
|
t.getSheetAt(ne).setName(G), l?.(ne);
|
|
3008
3016
|
}, [t, l]), L = U((ne, G) => {
|
|
3009
3017
|
t.getSheetAt(ne).setPosition(G), l?.(G);
|
|
3010
|
-
}, [t, l]),
|
|
3018
|
+
}, [t, l]), O = Y(() => {
|
|
3011
3019
|
if (r?.(C) === !1) return;
|
|
3012
3020
|
const ne = C + 1;
|
|
3013
3021
|
t.getSheets().add({ name: void 0, autoSelect: !0 }), l?.(ne);
|
|
3014
|
-
}, [t, r, l, C]), z = W(() => ({ placement: "top-start" }), []),
|
|
3022
|
+
}, [t, r, l, C]), z = W(() => ({ placement: "top-start" }), []), ie = xe(null), [J, pe] = _(!1), j = U((ne) => {
|
|
3015
3023
|
const { closeFloatAll: G, floatReference: se } = ne;
|
|
3016
3024
|
return x({ workbook: t, gridStyle: v, floatReference: se, closeFloatAll: G, ...d });
|
|
3017
|
-
}, [x, d, c, t, v]), { reference: K, component: ee } = ao({ label: "allSheet", popperProps: z, anchor:
|
|
3025
|
+
}, [x, d, c, t, v]), { reference: K, component: ee } = ao({ label: "allSheet", popperProps: z, anchor: ie.current, onOpen: () => pe(!0), onClose: () => pe(!1), createPopupPanel: j }), V = xe(null), [A, Z] = _(null), oe = U((ne) => {
|
|
3018
3026
|
const { floatReference: G } = ne;
|
|
3019
3027
|
return s?.({ workbook: t, index: A?.index, tabStripRef: V.current, commands: e, disabled: c, floatReference: G, ...i });
|
|
3020
|
-
}, [s, i, c, t, e, A]), { reference:
|
|
3028
|
+
}, [s, i, c, t, e, A]), { reference: Be, component: ve } = ao({ label: "sheetTab", popperProps: z, anchor: { getBoundingClientRect: () => new DOMRect(A?.left || 0, A?.top || 0, 0, 0) }, onClose: () => Z(null), createPopupPanel: oe });
|
|
3021
3029
|
de(() => {
|
|
3022
|
-
A ?
|
|
3030
|
+
A ? Be.open(0) : Be.close(0);
|
|
3023
3031
|
}, [A]);
|
|
3024
|
-
const
|
|
3032
|
+
const Ne = U((ne, G) => {
|
|
3025
3033
|
ne.preventDefault(), Z({ left: ne.clientX - 2, top: ne.clientY - 4, index: G });
|
|
3026
|
-
}, []),
|
|
3034
|
+
}, []), _e = Y((ne) => {
|
|
3027
3035
|
let G;
|
|
3028
3036
|
try {
|
|
3029
3037
|
G = t?.getSheetAt(ne.index);
|
|
3030
3038
|
} catch {
|
|
3031
3039
|
}
|
|
3032
|
-
return G ? (m ??
|
|
3033
|
-
I(ne.index),
|
|
3040
|
+
return G ? (m ?? _c)({ sheet: G, gridTheme: w, onContextMenu: (se) => {
|
|
3041
|
+
I(ne.index), Ne(se, ne.index);
|
|
3034
3042
|
}, ...ne, ...g }) : null;
|
|
3035
|
-
}, [m, g, t, w]),
|
|
3043
|
+
}, [m, g, t, w]), Ve = W(() => E ? null : o(vt, { disableInteractive: !0, title: "New sheet", children: o(st, { disabled: c, component: "div", sx: { padding: "0", "&:hover:not([disabled])": { color: (ne) => ne.palette.primary.main }, color: (ne) => ne.palette.text.icon ?? ne.palette.action.active, "& svg": { width: "18px", height: "18px" } }, "aria-label": "addTab", size: "small", onMouseDown: (ne) => {
|
|
3036
3044
|
ne.button === 0 && ne.preventDefault();
|
|
3037
|
-
}, onClick: () =>
|
|
3038
|
-
return H(B, { ref: a, className:
|
|
3045
|
+
}, onClick: () => O(), children: o(he, { iconKey: "AddCircle" }) }) }), [c, E, O]);
|
|
3046
|
+
return H(B, { ref: a, className: Te(b), sx: { position: "relative", display: "flex", alignItems: "stretch", flex: "1 1 100%", maxWidth: "100%", ...y }, ...S, children: [o(zl, { ref: V, selectedTabIndex: C, tabNames: M, onSelectedTabIndexChange: I, onTabNameChange: F, onTabMove: L, background: u, borderColor: h, borderWidth: f, activeColor: null, disabled: c, disableDrag: E, createScrollStartButton: ps, createScrollEndButton: ds, createScrollEdgeButton: cs, createTabButton: _e, createTabDivider: (ne) => {
|
|
3039
3047
|
const { key: G, ...se } = ne;
|
|
3040
|
-
return o(
|
|
3048
|
+
return o(Q, { sx: { marginLeft: "-1px", marginRight: "0px", marginTop: "6px", marginBottom: "6px", background: (Re) => ye(Re.palette.divider, 0.25) }, ...se }, G);
|
|
3041
3049
|
}, editLabelProps: { readOnly: E, maxLength: 31, styleHover: { fontWeight: "700" }, onKeyPress: (ne) => {
|
|
3042
3050
|
t.isValidSheetNameCharacter(ne.key) || ne.preventDefault();
|
|
3043
3051
|
}, onCancel: () => {
|
|
3044
3052
|
l?.(C);
|
|
3045
|
-
} }, children: o(vt, { disableInteractive: !0, title:
|
|
3053
|
+
} }, children: o(vt, { disableInteractive: !0, title: J ? "" : "List all sheets", children: o(bt, { sx: { padding: "0px", ml: 0.5, mr: 0, mt: 0, mb: 0, "& svg": { transform: "scale(0.8, 1)" }, color: (ne) => ne.palette.text.icon ?? ne.palette.action.active }, ref: ie, dense: !0, outlined: !1, selected: J, color: "primary", "aria-label": "menu", onMouseDown: (ne) => {
|
|
3046
3054
|
ne.button === 0 && ne.preventDefault();
|
|
3047
3055
|
}, onClick: () => {
|
|
3048
|
-
|
|
3049
|
-
}, icon: o(he, { iconKey: "Menu" }) }) }) }), o("div", { style: { borderTop: `solid ${h} ${f}px`, minWidth: "4px" } }), o("div", { style: { borderTop: `solid ${h} ${f}px`, flex: "none", display: "flex", alignItems: "center" }, children:
|
|
3056
|
+
J ? K.close(0) : K.open(0);
|
|
3057
|
+
}, icon: o(he, { iconKey: "Menu" }) }) }) }), o("div", { style: { borderTop: `solid ${h} ${f}px`, minWidth: "4px" } }), o("div", { style: { borderTop: `solid ${h} ${f}px`, flex: "none", display: "flex", alignItems: "center" }, children: Ve }), o("div", { style: { borderTop: `solid ${h} ${f}px`, flex: 1, minWidth: "24px" } }), ve, ee] });
|
|
3050
3058
|
}));
|
|
3051
|
-
|
|
3052
|
-
const
|
|
3059
|
+
Di.displayName = "WorkbookStrip";
|
|
3060
|
+
const Pi = q(X((n, a) => {
|
|
3053
3061
|
const { workbook: t, commands: e, disabled: r, sx: l, floatReference: c, className: p, ...i } = n, [s, d] = tn((E) => E + 1, 0), [x, g] = _(t.getSelectedSheet()), [m, u] = _(x.getSelectedRanges()), [b, y] = _(x.getSelectedCell());
|
|
3054
3062
|
We(t, { onSheetsChange() {
|
|
3055
3063
|
g(t.getSelectedSheet());
|
|
@@ -3061,218 +3069,218 @@ const Di = q(X((n, a) => {
|
|
|
3061
3069
|
const f = W(() => ({}), []), h = W(() => ({ commandHook: { beforeExecute: (E, M) => c.closeAll(), onExecute() {
|
|
3062
3070
|
}, onError() {
|
|
3063
3071
|
console.log("onError");
|
|
3064
|
-
} }, disabled: r, scope: "contextMenu", parentFloat: c }), [r, c]), w = W(() => ({ ...f, ...h, variant:
|
|
3072
|
+
} }, disabled: r, scope: "contextMenu", parentFloat: c }), [r, c]), w = W(() => ({ ...f, ...h, variant: re.Menuitem }), [f, h]), v = W(() => ({ commands: e, variant: re.Menuitem, parentFloat: c, ...h }), [e, h, c]), S = [];
|
|
3065
3073
|
let C = m.isEntireRows(), D = m.isEntireColumns();
|
|
3066
|
-
m && (C && (S.push(o(
|
|
3074
|
+
m && (C && (S.push(o(Q, { orientation: "horizontal" }, "context:" + S.length)), S.push(ke(N, { command: e.getCommand("hideColumns"), ...w, key: "context:" + S.length })), S.push(ke(N, { command: e.getCommand("unhideColumns"), ...w, key: "context:" + S.length }))), D && (S.push(o(Q, { orientation: "horizontal" }, "context:" + S.length)), S.push(ke(N, { command: e.getCommand("hideRows"), ...w, key: "context:" + S.length })), S.push(ke(N, { command: e.getCommand("unhideRows"), ...w, key: "context:" + S.length }))), (C || D) && S.push(o(Q, { orientation: "horizontal" }, "context:" + S.length)), C && (S.push(ke(N, { command: e.getCommand("autoFitColumns"), ...w, key: "context:" + S.length })), S.push(ke(N, { ...w, command: e.getCommand("resizeColumns"), key: "context:" + S.length }))), D && (S.push(ke(N, { command: e.getCommand("autoFitRows"), ...w, key: "context:" + S.length })), S.push(ke(N, { ...w, command: e.getCommand("resizeRows"), key: "context:" + S.length }))));
|
|
3067
3075
|
const T = [], P = e.getCommand("formatTableStyle"), R = P?.context()?.table();
|
|
3068
3076
|
if (jt(P), !C && !D) {
|
|
3069
|
-
if (T.push(o(
|
|
3077
|
+
if (T.push(o(Q, { orientation: "horizontal" }, "contextBefore:" + T.length)), b?.getHyperlink()) T.push(ke(tt, { ...v, popupCommandKeys: ["updateHyperlink", "deleteHyperlink"], popupScope: "hyperlink", key: "contextBefore:action" + T.length, quickCommand: "openHyperlink" }));
|
|
3070
3078
|
else {
|
|
3071
3079
|
const E = e.getCommand("updateHyperlink");
|
|
3072
|
-
T.push(
|
|
3080
|
+
T.push(ke(N, { command: E, ...w, key: "contextBefore:" + T.length }));
|
|
3073
3081
|
}
|
|
3074
|
-
if (b?.getComments()) T.push(
|
|
3082
|
+
if (b?.getComments()) T.push(ke(tt, { ...v, popupCommandKeys: ["deleteComments"], key: "contextBefore:action" + T.length, quickCommand: "updateComments" }));
|
|
3075
3083
|
else {
|
|
3076
3084
|
const E = e.getCommand("updateComments");
|
|
3077
|
-
T.push(
|
|
3085
|
+
T.push(ke(N, { command: E, ...w, key: "contextBefore:" + T.length }));
|
|
3078
3086
|
}
|
|
3079
|
-
R ? T.push(
|
|
3087
|
+
R ? T.push(ke(tt, { ...v, variant: re.Menuitem, key: "contextBefore:" + T.length, popupCommandKeys: ["convertTableToRange", "deleteTable"], popupScope: "table", scope: "context", commandState: R, quickCommand: "editTable" })) : T.push(ke(N, { command: e.getCommand("insertTable"), ...w, key: "context:" + S.length })), T.push(ke(vi, { ...v, key: "contextBefore:" + T.length }));
|
|
3080
3088
|
}
|
|
3081
|
-
const k = H(le, { children: [o(
|
|
3082
|
-
return o(B, { ref: a, className:
|
|
3089
|
+
const k = H(le, { children: [o(N, { command: e.getCommand("cut"), ...w }), o(or, { command: e.getCommand("copy"), ...w }), o(ja, { command: e.getCommand("paste"), ...v, includePasteAllInPopup: !1 }), o(Q, { orientation: "horizontal" }), o(za, { ...v }), o(Q, { orientation: "horizontal" }), o(Aa, { commands: e, ...v, disableSheet: !0 }), o(Ia, { commands: e, ...v, disableSheet: !0 }), o(Ba, { ...v }), T, S] });
|
|
3090
|
+
return o(B, { ref: a, className: Te("menu", p), sx: { ...l }, ...i, children: k });
|
|
3083
3091
|
}));
|
|
3084
|
-
|
|
3092
|
+
Pi.displayName = "WorkbookContextMenu";
|
|
3085
3093
|
const or = q(X((n, a) => {
|
|
3086
3094
|
const { command: t, ...e } = n, r = ln(), [l, c] = _(!1), [p, i] = _("info");
|
|
3087
3095
|
return de(() => {
|
|
3088
3096
|
const s = r.getMode();
|
|
3089
3097
|
c(s?.key === "copy" || s?.key === "cut"), i(s?.key === "cut" ? "warn" : "accent");
|
|
3090
|
-
}, [r]), o(
|
|
3091
|
-
})),
|
|
3098
|
+
}, [r]), o(N, { ref: a, command: t, icon: o(he, { iconKey: "copy.walking", sourceProps: { isWalking: l, themedType: p } }), ...e });
|
|
3099
|
+
})), Ri = q(X((n, a) => {
|
|
3092
3100
|
const { movable: t, commands: e, disabled: r, sx: l, floatReference: c, ...p } = n;
|
|
3093
3101
|
We(t, { onAnyChange(m) {
|
|
3094
3102
|
} });
|
|
3095
3103
|
const i = W(() => ({}), []), s = W(() => ({ commandHook: { beforeExecute: (m, u) => c.closeAll(), onExecute() {
|
|
3096
3104
|
}, onError() {
|
|
3097
3105
|
console.log("onError");
|
|
3098
|
-
} }, disabled: r, parentFloat: c }), [r, c]), d = W(() => ({ variant:
|
|
3106
|
+
} }, disabled: r, parentFloat: c }), [r, c]), d = W(() => ({ variant: re.Menuitem, ...i, ...s }), [i, s]), x = W(() => ({ commands: e, variant: re.Menuitem, parentFloat: c, ...s }), [e, s, c]), g = H(le, { children: [o(or, { command: e.getCommand("copy"), ...d, variant: re.Menuitem }), [], o(Q, { orientation: "horizontal" }), o(tt, { ...x, popupCommandKeys: ["moveToFront", "moveForward"], quickCommand: "moveToFront" }), o(tt, { ...x, popupCommandKeys: ["moveToBack", "moveBackward"], quickCommand: "moveToBack" }), o(Q, { orientation: "horizontal" }), o(N, { ...d, command: e.getCommand("toggleLockAspectRatio") }), o(Q, { orientation: "horizontal" }), o(tt, { ...x, 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(tt, { ...x, popupCommandKeys: ["formatAnchorTypeTwoCell", "formatAnchorTypeOneCell", "formatAnchorTypeAbsolute"], label: "Sizing", icon: "DrawResize", tooltip: "Determine how the drawing size will adjust as the cell sizes adjust." }), []] });
|
|
3099
3107
|
return o(B, { ref: a, sx: { paddingTop: "4px", paddingBottom: "4px", ...l }, ...p, children: g });
|
|
3100
3108
|
}));
|
|
3101
|
-
|
|
3102
|
-
const
|
|
3103
|
-
const { workbook: t, createWorkbookOptions: e, onNewWorkbook: r, onElementLoad: l, autoFocus: c = !1, sx: p, style: i, className: s, onFocus: d, onBlur: x, onKeyDown: g, onRepeatCommandChange: m, commands: u, showFormulaBar: b, formulaBarProps: y, renderFormulaBar: f =
|
|
3109
|
+
Ri.displayName = "MovableContextMenu";
|
|
3110
|
+
const Uc = (n) => o(Ri, { ...n }), Gc = (n) => o(Pi, { ...n }), qc = (n) => o(ai, { ...n }), Kc = (n, a) => o(ri, { ref: a, ...n }), Xc = (n) => o(Wt, { ...n }), Yc = (n, a) => o(Hl, { ref: a, ...n }), Zc = (n) => o(Za, { ...n }), Qc = (n) => o(Di, { ...n }), Jc = { fireOnModelChange: !1 }, aa = { flex: "1 1 100%", display: "flex", boxSizing: "border-box" }, Mi = q(X((n, a) => {
|
|
3111
|
+
const { workbook: t, createWorkbookOptions: e, onNewWorkbook: r, onElementLoad: l, autoFocus: c = !1, sx: p, style: i, className: s, onFocus: d, onBlur: x, onKeyDown: g, onRepeatCommandChange: m, commands: u, showFormulaBar: b, formulaBarProps: y, renderFormulaBar: f = Kc, showTabs: h, tabsProps: w, renderTabs: v = Qc, showStatusBar: S, statusBarProps: C, renderStatusBar: D = Zc, toolbarProps: T, renderToolbar: P = Ti, contextMenuSx: R, renderContextMenu: k = Gc, renderFilterMenu: E = qc, renderMovableMenu: M = Uc, renderLoadingPanel: I = Xc, loadingPanelProps: F, sheetProps: L, renderSheet: O = Yc, mainWrapper: z, showHorizontalScrollbar: ie, showVerticalScrollbar: J, gridTheme: pe, headersTheme: j, enableDarkImages: K, ...ee } = n, V = Ke(), A = Gn(), Z = W(() => {
|
|
3104
3112
|
const $ = { theme: A.getDefaultTheme(), ...e };
|
|
3105
3113
|
return t ?? new On($);
|
|
3106
|
-
}, [t]), oe = xe(null), [
|
|
3114
|
+
}, [t]), oe = xe(null), [Be, ve] = _(!1), Ne = xe(null), _e = W(() => o(B, { className: "sheetxl-viewport", sx: { width: "100%", height: "100%", boxSizing: "border-box", position: "absolute", pointerEvents: "none !important", "& > :first-of-type": { position: "relative" } }, ref: Ne }), []), [Ve, ne] = _(!1), [G, se] = _(!1), Re = U(() => {
|
|
3107
3115
|
ne(!0);
|
|
3108
|
-
}, []), qe = xe(null),
|
|
3116
|
+
}, []), qe = xe(null), Ee = Ct(a, () => ({ isWorkbookElement: () => !0, getWorkbook: () => Z, getSheetElement: () => oe.current, getViewportElement: () => Ne.current, getFormulaBarElement: () => qe.current, focus() {
|
|
3109
3117
|
oe && oe.current && oe.current.focus();
|
|
3110
|
-
} }), [Z]),
|
|
3118
|
+
} }), [Z]), rt = xe(null);
|
|
3111
3119
|
St(() => {
|
|
3112
|
-
!
|
|
3113
|
-
}, [
|
|
3114
|
-
const
|
|
3120
|
+
!Ve || !Ee.current || (async () => (rt.current !== l && (await l?.({ source: Ee.current }), rt.current = l), se(!0)))();
|
|
3121
|
+
}, [Ve, Ee.current]), Kr(Ee.current);
|
|
3122
|
+
const Xe = U(($) => (oe.current?.submitEdit(), !0), []), dt = U(() => {
|
|
3115
3123
|
requestAnimationFrame(() => {
|
|
3116
3124
|
oe?.current?.focus();
|
|
3117
3125
|
});
|
|
3118
|
-
}, []), [
|
|
3126
|
+
}, []), [Me, te] = _(Z?.getSelectedSheet()), [Ce, Tt] = _(Z?.getProtection());
|
|
3119
3127
|
We(Z, { onSheetsChange: ($) => {
|
|
3120
3128
|
te($?.getSelectedSheet());
|
|
3121
3129
|
}, onViewChange($) {
|
|
3122
3130
|
te($?.getSelectedSheet());
|
|
3123
3131
|
}, onProtectionChange: ($) => {
|
|
3124
3132
|
Tt($?.getProtection());
|
|
3125
|
-
} }), We(Z, { onRequestSelect: async ($,
|
|
3126
|
-
oe.current.getSheet() !==
|
|
3127
|
-
oe.current.getSheet() !==
|
|
3128
|
-
}) :
|
|
3129
|
-
}) },
|
|
3130
|
-
const [
|
|
3133
|
+
} }), We(Z, { onRequestSelect: async ($, ue) => new Promise((Ae) => {
|
|
3134
|
+
oe.current.getSheet() !== ue ? oe.current.getGridElement()?.onViewChangeOnce(() => {
|
|
3135
|
+
oe.current.getSheet() !== ue && Ae(!1), Ae(!0);
|
|
3136
|
+
}) : Ae(!0);
|
|
3137
|
+
}) }, Jc);
|
|
3138
|
+
const [Ji, io] = tn(($) => $ + 1, 0), _t = Z?.getView();
|
|
3131
3139
|
We(_t, { onViewChange: ($) => {
|
|
3132
3140
|
io();
|
|
3133
3141
|
} });
|
|
3134
|
-
const lo =
|
|
3142
|
+
const lo = pe ?? V, Ue = W(() => Zr(V, lo), [V, lo]), ir = j ?? V, el = W(() => Zr(V, ir), [V, ir]), [lr, tl] = _(null);
|
|
3135
3143
|
U(() => {
|
|
3136
3144
|
oe.current.focus();
|
|
3137
3145
|
}, []);
|
|
3138
|
-
const
|
|
3146
|
+
const Fe = zc({ workbook: Z, workbookElement: Ee.current, target: () => oe.current, commands: u, darkMode: Ue.body.darkMode, onNewWorkbook: r }), so = xe(null), [un, sr] = _(!1), [cr, dr] = _(null), [pr, ol] = _(ho.Top), [co, nl] = _(Fl.EmptyBounds), mn = U(() => {
|
|
3139
3147
|
sr(!1), dr(null);
|
|
3140
|
-
}, []), po = U(($,
|
|
3141
|
-
|
|
3148
|
+
}, []), po = U(($, ue, Ae = ho.Top) => {
|
|
3149
|
+
nl($), ol(Ae), dr(ue), so.current !== null && setTimeout(() => {
|
|
3142
3150
|
so.current !== null && so.current.update();
|
|
3143
3151
|
}, 160), sr(!0);
|
|
3144
|
-
}, []), [
|
|
3152
|
+
}, []), [Vd, ur] = _("sheet"), Et = h ?? _t?.isShowTabs(), Dt = ie ?? _t?.isShowHorizontalScrollbar(), rl = b ?? _t?.isShowFormulaBar(), Ao = S ?? _t?.isShowStatusBar(), mr = J ?? _t?.isShowVerticalScrollbar(), Ut = Ue?.header?.edgeStrokeFill || "rgb(171,171,171)", al = W(() => Ao ? D({ sheet: Me, gridStyle: Ue, ...C }) : null, [D, C, Ao, Ue, Me]), il = W(() => P({ commands: Fe, workbook: Ee.current, ...T }), [Fe, P, T, V]), [ll, { width: hn }] = zt(), Pt = hn === 0 || hn > 560, gn = W(() => {
|
|
3145
3153
|
if (!Et) return null;
|
|
3146
|
-
let $ = v({ background:
|
|
3147
|
-
return
|
|
3148
|
-
}, [v, w, V, Z, lo,
|
|
3149
|
-
const
|
|
3150
|
-
let
|
|
3151
|
-
if (Dt && (
|
|
3152
|
-
po({ x:
|
|
3153
|
-
}, onCloseTooltip: () => mn() }) })), Et &&
|
|
3154
|
-
Z.getView().setTabRatio(Math.round(10 *
|
|
3155
|
-
}, minBefore: "200px", minAfter: "180px", resizerProps: { style: { minWidth: "11px", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${V.palette.text.icon ?? V.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center", borderTop: `solid ${Ut} 1px`, borderBottom: "solid 3px transparent" } }, elementBefore:
|
|
3156
|
-
else if (Dt)
|
|
3154
|
+
let $ = v({ background: Ue.body.fill, borderWidth: 1, borderColor: Ut, gridTheme: lo, gridStyle: Ue, onBeforeUserChange: Xe, onUserChange: dt, workbook: Z, commands: Fe, sheetTabProps: {}, ...w });
|
|
3155
|
+
return Pt || ($ = o("div", { style: { flex: "none", display: "flex" }, children: $ })), $;
|
|
3156
|
+
}, [v, w, V, Z, lo, Pt, Fe, Et]), hr = U(($) => {
|
|
3157
|
+
const { style: ue, ...Ae } = $;
|
|
3158
|
+
let je = null, Ye = null, $e = null;
|
|
3159
|
+
if (Dt && (Ye = o("div", { style: { display: "flex", flex: "1 1 100%", borderTop: `solid ${Ut} 1px`, flexDirection: "column", justifyContent: "center" }, children: o(wr, { ...Ae, style: { paddingLeft: "4px", paddingRight: "4px", ...ue }, endGap: 700, sheet: Me, onShowTooltip: (Ge) => {
|
|
3160
|
+
po({ x: Ge.anchor.x, y: Ge.anchor.y, width: 0, height: 0 }, Ge.display, Ge.placement);
|
|
3161
|
+
}, onCloseTooltip: () => mn() }) })), Et && Pt && ($e = gn), Et && Pt && !Dt && ($e = H(B, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: [$e, o(B, { sx: { borderTop: `solid ${Ut} 1px`, flex: "1" } })] })), $e && Dt) je = o(Qn, { position: Z.getView().getTabRatio() / 10 + "%", onPositionChange: ({ percent: Ge }) => {
|
|
3162
|
+
Z.getView().setTabRatio(Math.round(10 * Ge));
|
|
3163
|
+
}, minBefore: "200px", minAfter: "180px", resizerProps: { style: { minWidth: "11px", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${V.palette.text.icon ?? V.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center", borderTop: `solid ${Ut} 1px`, borderBottom: "solid 3px transparent" } }, elementBefore: $e, elementAfter: Ye });
|
|
3164
|
+
else if (Dt) je = Ye;
|
|
3157
3165
|
else {
|
|
3158
|
-
if (
|
|
3159
|
-
|
|
3166
|
+
if (!$e) return o(B, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center", height: "1px", borderTop: Ao ? null : `solid ${Ut} 1px` } });
|
|
3167
|
+
je = $e;
|
|
3160
3168
|
}
|
|
3161
|
-
return o(B, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children:
|
|
3162
|
-
}, [
|
|
3169
|
+
return o(B, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: je });
|
|
3170
|
+
}, [Me, Xe, Z, Ue, lo, Fe, Et, Dt, Ao, Pt]), [Je, uo] = ae.useState(null), sl = W(() => ({ placement: "right-start", ...Je?.popperProps }), [Je?.popperProps]), { reference: gr, component: cl } = ao({ label: "contextMenu", popperProps: sl, anchor: Je?.anchor ?? { getBoundingClientRect: () => new DOMRect(Je?.clientX || 0, Je?.clientY || 0) }, onClose: () => uo(null), createPopupPanel: Je?.createPopupPanel });
|
|
3163
3171
|
de(() => {
|
|
3164
3172
|
Je ? gr.open(0) : gr.close(0);
|
|
3165
3173
|
}, [Je]);
|
|
3166
|
-
const
|
|
3174
|
+
const dl = Y(($, ue) => {
|
|
3167
3175
|
if ($?.isDefaultPrevented()) return !0;
|
|
3168
|
-
$.preventDefault(), Je && Je.anchor === $.currentTarget ? uo(null) : uo({ anchor: $.currentTarget, popperProps: { offsets: [-4, 2] }, createPopupPanel: (
|
|
3169
|
-
const { floatReference:
|
|
3170
|
-
return E({ filter:
|
|
3176
|
+
$.preventDefault(), Je && Je.anchor === $.currentTarget ? uo(null) : uo({ anchor: $.currentTarget, popperProps: { offsets: [-4, 2] }, createPopupPanel: (Ae) => {
|
|
3177
|
+
const { floatReference: je } = Ae;
|
|
3178
|
+
return E({ filter: ue, commands: Fe, floatReference: je, sx: { ...R } });
|
|
3171
3179
|
} });
|
|
3172
|
-
}, [E, R,
|
|
3180
|
+
}, [E, R, Fe, Z, Je]), fr = Y(($) => {
|
|
3173
3181
|
if ($.originalEvent?.isDefaultPrevented()) return !0;
|
|
3174
|
-
$.originalEvent?.preventDefault(), uo({ clientX: $.clientX, clientY: $.clientY, createPopupPanel: (
|
|
3175
|
-
const { floatReference:
|
|
3176
|
-
return k({ commands:
|
|
3182
|
+
$.originalEvent?.preventDefault(), uo({ clientX: $.clientX, clientY: $.clientY, createPopupPanel: (ue) => {
|
|
3183
|
+
const { floatReference: Ae } = ue;
|
|
3184
|
+
return k({ commands: Fe, workbook: Z, floatReference: Ae, sx: { ...R } });
|
|
3177
3185
|
} });
|
|
3178
|
-
}, [k, R,
|
|
3186
|
+
}, [k, R, Fe, Z]), pl = Y(($, ue) => {
|
|
3179
3187
|
if ($?.isDefaultPrevented()) return !0;
|
|
3180
|
-
$.preventDefault(), uo({ clientX: $.clientX, clientY: $.clientY, createPopupPanel: (
|
|
3181
|
-
const { floatReference:
|
|
3182
|
-
return M({ movable:
|
|
3188
|
+
$.preventDefault(), uo({ clientX: $.clientX, clientY: $.clientY, createPopupPanel: (Ae) => {
|
|
3189
|
+
const { floatReference: je } = Ae;
|
|
3190
|
+
return M({ movable: ue, commands: Fe, floatReference: je, sx: { ...R } });
|
|
3183
3191
|
} });
|
|
3184
|
-
}, [M, R,
|
|
3192
|
+
}, [M, R, Fe]);
|
|
3185
3193
|
W(() => {
|
|
3186
3194
|
const $ = [new He("openContextMenu", () => oe.current, { label: "Context Menu", description: "Open the context menu.", shortcut: [{ key: "F10", modifiers: [fe.Shift] }, { key: "ContextMenu" }] })];
|
|
3187
|
-
|
|
3188
|
-
}, [
|
|
3189
|
-
|
|
3190
|
-
const $ =
|
|
3191
|
-
oe.current?.getGridElement()?.scrollCellCoordsIntoView($).then((
|
|
3195
|
+
Fe.addCommands($, !0);
|
|
3196
|
+
}, [Fe]), de(() => {
|
|
3197
|
+
Fe.getCommand("openContextMenu").updateCallback(() => {
|
|
3198
|
+
const $ = Me.getSelection().getCoords().cell;
|
|
3199
|
+
oe.current?.getGridElement()?.scrollCellCoordsIntoView($).then((ue) => {
|
|
3192
3200
|
requestAnimationFrame(() => {
|
|
3193
|
-
const
|
|
3194
|
-
fr({ clientX:
|
|
3201
|
+
const Ae = Me.getView().getZoomScale() / 100, je = Me.getColumnHeaders().findOffset($.colIndex + 1) * Ae, Ye = Me.getRowHeaders().findOffset($.rowIndex + 1) * Ae, $e = oe.current?.getGridElement()?.getRelativePointFromClient(0, 0) || { x: 0, y: 0 };
|
|
3202
|
+
fr({ clientX: je - $e.x - ue.left + 6, clientY: Ye - $e.y - ue.top + 6 });
|
|
3195
3203
|
});
|
|
3196
3204
|
});
|
|
3197
3205
|
});
|
|
3198
|
-
}, [
|
|
3199
|
-
const
|
|
3200
|
-
|
|
3201
|
-
}, [
|
|
3202
|
-
Kr(
|
|
3203
|
-
}, [Z,
|
|
3206
|
+
}, [Me]);
|
|
3207
|
+
const ul = Y(($) => {
|
|
3208
|
+
Fe?.dispatchToFocusedCommand($);
|
|
3209
|
+
}, [Fe]), ml = Y(() => {
|
|
3210
|
+
Kr(Ee.current);
|
|
3211
|
+
}, [Z, Ee.current]), hl = U(() => {
|
|
3204
3212
|
ur("sheet");
|
|
3205
|
-
}, []),
|
|
3213
|
+
}, []), gl = U(() => {
|
|
3206
3214
|
ur("formulaBar");
|
|
3207
|
-
}, []),
|
|
3208
|
-
const
|
|
3209
|
-
return o(wr, { style: {
|
|
3210
|
-
po(
|
|
3215
|
+
}, []), fl = Y(($) => {
|
|
3216
|
+
const { style: ue, ...Ae } = $;
|
|
3217
|
+
return o(wr, { style: { ...ue, paddingTop: "4px", paddingBottom: "4px" }, ...Ae, sheet: Me, endGap: 700, onShowTooltip: (je) => {
|
|
3218
|
+
po(je.anchor, je.display, ho.Left);
|
|
3211
3219
|
}, onCloseTooltip: () => mn() });
|
|
3212
|
-
}, [
|
|
3220
|
+
}, [Me]);
|
|
3213
3221
|
de(() => {
|
|
3214
3222
|
c && oe && oe.current && oe.current.focus();
|
|
3215
3223
|
}, []);
|
|
3216
|
-
const [Io, fn] =
|
|
3217
|
-
|
|
3218
|
-
}, [
|
|
3219
|
-
if (
|
|
3220
|
-
const
|
|
3221
|
-
if (!
|
|
3222
|
-
if (
|
|
3223
|
-
const
|
|
3224
|
-
if (!
|
|
3225
|
-
const
|
|
3224
|
+
const [Io, fn] = ae.useState(null), bn = U(($) => {
|
|
3225
|
+
Fe?.getCommand("openWorkbook") && ($.type === "dragenter" || $.type === "dragover" ? $.dataTransfer?.types.includes("Files") ? $.dataTransfer.files[0]?.type?.startsWith("image/") || $.dataTransfer.items[0]?.type?.startsWith("image/") || $.dataTransfer.types.length === 1 && fn("Drop to open") : ($.dataTransfer?.types.includes("text/html") || $.dataTransfer?.types.includes("text/plain"), $.dataTransfer.effectAllowed = "none", $.dataTransfer.dropEffect = "none") : $.type === "dragleave" && fn(null), $.preventDefault());
|
|
3226
|
+
}, [Fe]), bl = Y(($) => {
|
|
3227
|
+
if (Fe?.getCommand("openWorkbook") && ($.preventDefault(), $.stopPropagation(), fn(null), $.dataTransfer.files && $.dataTransfer.files.length > 0)) {
|
|
3228
|
+
const ue = $.dataTransfer.files[0];
|
|
3229
|
+
if (!ue) return;
|
|
3230
|
+
if (ue?.type?.startsWith("image/")) {
|
|
3231
|
+
const Ae = oe.current?.getGridElement().getViewFromClient($.clientX, $.clientY);
|
|
3232
|
+
if (!Ae) return;
|
|
3233
|
+
const je = Ae.getRelativePointFromClient($.clientX, $.clientY), Ye = Ae.toAbsoluteBounds({ ...je, width: 0, height: 0 }), $e = Ae.getCellCoordsFromClient($.clientX, $.clientY);
|
|
3226
3234
|
if (!$e) return;
|
|
3227
|
-
|
|
3228
|
-
} else
|
|
3235
|
+
Fe?.getCommand("insertImageFromFile")?.execute({ file: ue, options: { bounds: { x: Ye.x, y: Ye.y } }, goto: { range: { ...$e } } });
|
|
3236
|
+
} else Fe?.getCommand("openWorkbook")?.execute(ue);
|
|
3229
3237
|
}
|
|
3230
|
-
}, [
|
|
3231
|
-
const { movable:
|
|
3232
|
-
|
|
3233
|
-
}, ...
|
|
3238
|
+
}, [Fe, Io]), xl = W(() => Io ? o(B, { sx: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", pointerEvents: "none", display: "flex", justifyContent: "center", alignItems: "center", background: ($) => $.palette.divider, color: ($) => $.palette.primary.dark }, children: o(Pe, { variant: "h4", children: Io }) }) : null, [Io]), br = xe(null), yl = W(() => o(Hn, { in: !G, nodeRef: br, timeout: 500, classNames: "animating", unmountOnExit: !0, children: o(B, { style: { display: "flex", alignItems: "center", justifyContent: "center", left: "0px", top: "0px", width: "100%", height: "100%", pointerEvents: G ? "none" : p?.pointerEvents, position: "absolute", boxSizing: "border-box" }, children: I({ ref: br, transitionDelay: "0", transparentBackground: !1, sx: { opacity: G ? 0 : p?.opacity, pointerEvents: G ? "none" : p?.pointerEvents, position: "absolute", left: "0px", top: "0px", width: "100%", height: "100%", ...F } }) }) }), [G, I, F]), wl = W(() => f({ sx: { marginTop: ($) => $.spacing(0.25), marginLeft: ($) => $.spacing(1), marginRight: ($) => $.spacing(1) }, workbook: Z, sheetElement: oe.current, gridStyle: Ue, onFocus: gl, ...y, NamedCollectionEditorProps: { restoreFocus: ($) => oe.current.focus($), ...y?.NamedCollectionEditorProps, commandPopupButtonProps: { commands: Fe, ...y?.NamedCollectionEditorProps?.commandPopupButtonProps } } }, qe), [f, y, Z, Ue, Fe, G]), Sl = U(($) => {
|
|
3239
|
+
const { movable: ue, ...Ae } = $, je = { movable: ue, onContextMenuCapture: (Ge) => {
|
|
3240
|
+
pl(Ge, ue);
|
|
3241
|
+
}, ...Ae }, Ye = ue.getContent().getType();
|
|
3234
3242
|
let $e = null;
|
|
3235
|
-
if (
|
|
3236
|
-
if (
|
|
3237
|
-
const
|
|
3238
|
-
return o(
|
|
3243
|
+
if (Ye === "picture") return o(Wl, { loadingPanel: o(Wt, { transitionDelay: "100", style: { position: "absolute" }, sx: { border: (Ge) => `solid 1px ${Ge.palette.action.active}` } }), picture: ue.getContent(), description: ue.getDescription() ?? ue?.getName(), ...je });
|
|
3244
|
+
if (Ye === "chart") {
|
|
3245
|
+
const Ge = { ...je, chart: ue.getContent() };
|
|
3246
|
+
return o(jl, { ...Ge });
|
|
3239
3247
|
}
|
|
3240
|
-
if ($e = `Float of type '${
|
|
3241
|
-
const
|
|
3242
|
-
$e = o(
|
|
3248
|
+
if ($e = `Float of type '${Ye}'.`, typeof $e == "string") {
|
|
3249
|
+
const Ge = { ...je, description: $e };
|
|
3250
|
+
$e = o($l, { ...Ge });
|
|
3243
3251
|
}
|
|
3244
|
-
return o("div", { style: { position: "absolute", clipPath: "inset(0px)", display: "flex", alignItems: "stretch", justifyContent: "stretch", pointerEvents: "all" }, children: $e },
|
|
3245
|
-
}, []), xr = W(() =>
|
|
3246
|
-
|
|
3247
|
-
}, showScrollbars: !1, viewportComponent:
|
|
3252
|
+
return o("div", { style: { position: "absolute", clipPath: "inset(0px)", display: "flex", alignItems: "stretch", justifyContent: "stretch", pointerEvents: "all" }, children: $e }, ue.getUUID());
|
|
3253
|
+
}, []), xr = W(() => O({ style: aa, onFocus: hl, gridStyle: Ue, headersStyle: el, sheet: Me, commands: Fe, onSheetContextMenu: fr, onViewportChange: ($) => {
|
|
3254
|
+
tl($);
|
|
3255
|
+
}, showScrollbars: !1, viewportComponent: _e, onRepeatCommandChange: m, onElementLoad: Re, onShowColumnTooltip: ($) => {
|
|
3248
3256
|
po($.anchor, $.display, ho.Top);
|
|
3249
3257
|
}, onShowRowTooltip: ($) => {
|
|
3250
3258
|
po($.anchor, $.display, ho.Right);
|
|
3251
3259
|
}, onShowTooltip: ($) => {
|
|
3252
3260
|
po({ x: $.anchor.x, y: $.anchor.y, width: 0, height: 0 }, $.display, $.placement);
|
|
3253
|
-
}, onCloseTooltip: () => mn(), renderMovable:
|
|
3254
|
-
L?.cellRenderProps?.onFilterButtonMouseDown($,
|
|
3255
|
-
}, ...L?.cellRenderProps } }, oe), [
|
|
3256
|
-
let $ = o(
|
|
3257
|
-
oe.current?.getGridElement()?.scrollTo(
|
|
3258
|
-
}, showHorizontalScrollbar: Dt || Et, showVerticalScrollbar: mr, createHorizontalScrollbar: hr, createVerticalScrollbar:
|
|
3259
|
-
return
|
|
3260
|
-
}, [Dt, Et, hr, mr, lr,
|
|
3261
|
-
return H(no, { className:
|
|
3262
|
-
|
|
3261
|
+
}, onCloseTooltip: () => mn(), renderMovable: Sl, ...L, cellRenderProps: { onFilterButtonMouseDown: ($, ue) => {
|
|
3262
|
+
L?.cellRenderProps?.onFilterButtonMouseDown($, ue), dl($, ue);
|
|
3263
|
+
}, ...L?.cellRenderProps } }, oe), [Fe, L, Me, Ue, m]), vl = W(() => {
|
|
3264
|
+
let $ = o(vs, { ref: ll, style: aa, viewport: lr, touchElement: oe.current?.getGridElement()?.stage, onScrollViewport: (ue) => {
|
|
3265
|
+
oe.current?.getGridElement()?.scrollTo(ue);
|
|
3266
|
+
}, showHorizontalScrollbar: Dt || Et, showVerticalScrollbar: mr, createHorizontalScrollbar: hr, createVerticalScrollbar: fl, children: xr });
|
|
3267
|
+
return Pt || hn === 0 || ($ = H(le, { children: [$, gn] })), z ? z($) : $;
|
|
3268
|
+
}, [Dt, Et, hr, mr, lr, Pt, xr, gn, V, z]), kl = W(() => o(vt, { arrow: !0, disableInteractive: !0, open: un, title: o(Pe, { variant: "subtitle2", component: "div", children: cr }), placement: pr, slotProps: { transition: { timeout: { exit: 0 } }, popper: { popperRef: so, sx: { "& .MuiTooltip-tooltip": { padding: "2px 6px", "& .MuiTooltip-arrow": { display: un ? "visible" : "none" } } }, anchorEl: { getBoundingClientRect: () => new DOMRect(co.x, co.y, co.width, co.height) }, modifiers: [{ name: "offset", options: { offset: [0, 0] } }] } }, children: o(B, {}) }), [un, cr, pr, co, so]), Cl = W(() => ({ boxSizing: "border-box", background: ($) => $.palette.mode !== "dark" ? Ue.header.fill : $.palette.background.paper, "& *": { ...us(V), fontWeight: 400 }, "&.Mui-focusVisible": {}, "& .viewport-overlay": { borderRight: `solid ${Ut} 1px` }, ...p }), [p, Ue]), Tl = W(() => o(B, { sx: { marginBottom: ($) => $.spacing(0.75) } }), []), El = W(() => ({ flex: "1 1 100%", width: "100%", display: "flex", flexDirection: "column", opacity: G ? void 0 : 0, "--sxl-app-color-high-contrast": V.palette.primary.main, "--sxl-app-color-primary": V.palette.primary.main, "--sxl-app-color-primary-dark": V.palette.primary.dark, "--sxl-app-color-primary-light": V.palette.primary.light, "--sxl-app-color-info": V.palette.info.main, "--sxl-app-color-info-dark": V.palette.info.dark, "--sxl-app-color-info-light": V.palette.info.light, "--sxl-app-color-secondary": V.palette.secondary.main, "--sxl-app-color-secondary-dark": V.palette.secondary.dark, "--sxl-app-color-secondary-light": V.palette.secondary.light, "--sxl-app-color-success": V.palette.success.main, "--sxl-app-color-success-dark": V.palette.success.dark, "--sxl-app-color-success-light": V.palette.success.light, "--sxl-app-color-warning": V.palette.warning.main, "--sxl-app-color-warning-dark": V.palette.warning.dark, "--sxl-app-color-warning-light": V.palette.warning.light, "--sxl-app-color-error": V.palette.error.main, "--sxl-app-color-error-dark": V.palette.error.dark, "--sxl-app-color-error-light": V.palette.error.light, "--sxl-app-color-text": V.palette.text.primary, "--sxl-app-color-text-secondary": V.palette.text.secondary, "--sxl-app-color-text-disabled": V.palette.text.disabled, "--sxl-app-color-background": V.palette.background.paper, "--sxl-app-color-button-surface": V.palette.grey[600], "--sxl-app-color-shadow": V.palette.action.focus, "--sxl-app-color-grey": V.palette.grey[500], "--sxl-app-filter-dark-invert": Ue.body.darkMode && K ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", "--sxl-app-image-background": Ue.body.darkMode ? `linear-gradient(${ye("#fff", Oe(5))}, ${ye("#fff", Oe(5))})` : void 0 }), [Ue, V, G]), Dl = W(() => Te(Va), []);
|
|
3269
|
+
return H(no, { className: Te("sheetxl-workbook", jc, { "Mui-focusVisible": Be }, Wc, s), sx: Cl, style: i, square: !1, ...ee, ref: Ee, onFocus: ($) => {
|
|
3270
|
+
ve(!0), ml(), d?.($);
|
|
3263
3271
|
}, onBlur: ($) => {
|
|
3264
|
-
|
|
3272
|
+
ve(!1), x?.($);
|
|
3265
3273
|
}, onKeyDown: ($) => {
|
|
3266
|
-
|
|
3274
|
+
ul($), g?.($);
|
|
3267
3275
|
}, onDragStart: ($) => {
|
|
3268
3276
|
if ($.target.src) {
|
|
3269
|
-
const
|
|
3270
|
-
|
|
3277
|
+
const ue = new Image();
|
|
3278
|
+
ue.src = $.target.src, $.dataTransfer.setDragImage(ue, 1, 1);
|
|
3271
3279
|
}
|
|
3272
|
-
}, onDragEnter: bn, onDragLeave: bn, onDragOver: bn, onDrop:
|
|
3280
|
+
}, onDragEnter: bn, onDragLeave: bn, onDragOver: bn, onDrop: bl, children: [H("div", { className: Dl, style: El, children: [il, rl ? wl : null, Tl, vl, al, kl, cl, xl] }), yl] });
|
|
3273
3281
|
}));
|
|
3274
|
-
|
|
3275
|
-
const
|
|
3282
|
+
Mi.displayName = "WorkbookElement";
|
|
3283
|
+
const ed = (n = !1, a = !1) => a ? null : { "& input:not(:focus):not(:hover)": { color: (t) => t.palette.text.secondary }, backgroundColor: (t) => ye(t.palette.background.paper, 0.6), borderRadius: (t) => `${t.shape.borderRadius}px`, border: (t) => `solid ${n ? t.palette.divider : "transparent"} 1px`, "&.Mui-disabled": { border: (t) => `solid ${n ? t.palette.divider : "transparent"} 1px` }, "&:focus-within:not([disabled])": { backgroundColor: (t) => t.palette.background.paper }, "&:hover:not([disabled])": { border: (t) => `solid ${n ? t.palette.text?.primary : t.palette.divider} 1px`, backgroundColor: null }, "&.Mui-focusVisible": { outline: (t) => `solid ${t.palette.primary.main} 1px !important`, border: (t) => `1px solid ${t.palette?.primary?.main} !important` } }, Ni = q(X((n, a) => {
|
|
3276
3284
|
const { sx: t, workbook: e, title: r = "", placeHolder: l = "Untitled", onTitleChange: c, readOnly: p = !1, hidden: i, ...s } = n, [d, x] = _(!1), [g, m] = _(!1), [u, b] = _(r ?? ""), [y, f] = _(""), [h, { width: w }] = zt(), [v, { width: S }] = zt(), [C, D] = _(!1), T = xe(null), P = xe(null), R = Ct(a, () => ({ requestWorkbookTitle: (k = null, E) => {
|
|
3277
3285
|
P.current = { onAccept: k, requestReason: E?.requestReason }, E?.selectAll && T.current?.select(), T.current?.focus(E);
|
|
3278
3286
|
}, focus: (k) => {
|
|
@@ -3286,7 +3294,7 @@ const Jc = (n = !1, a = !1) => a ? null : { "& input:not(:focus):not(:hover)": {
|
|
|
3286
3294
|
}, 300)();
|
|
3287
3295
|
}, [C, w]), de(() => {
|
|
3288
3296
|
m(u && !Jt.isValidWindowsFilename(u));
|
|
3289
|
-
}, [u]), i ? null : o(B, { sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", opacity: C ? "0" : "1", transition: C ? void 0 : "opacity .25s ease-in", "& .tooltip-wrapper": { maxWidth: "100%" } }, ref: $t([R, v, a]), ...s, children: o(
|
|
3297
|
+
}, [u]), i ? null : o(B, { sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", opacity: C ? "0" : "1", transition: C ? void 0 : "opacity .25s ease-in", "& .tooltip-wrapper": { maxWidth: "100%" } }, ref: $t([R, v, a]), ...s, children: o(nt, { label: P.current?.requestReason ?? "Workbook Name", children: H(B, { className: Te({ "Mui-focusVisible": d }), sx: { visibility: w === 0 ? "hidden" : "visible", display: "block", maxWidth: "100%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", paddingLeft: "12px", paddingRight: "12px", marginLeft: "2px", marginRight: "2px", paddingTop: "2px", paddingBottom: "1px", ...ed(!0, p), ...t }, children: [p ? o(Pe, { variant: "subtitle1", component: "div", sx: { whiteSpace: "nowrap", fontStyle: u !== y ? "italic" : void 0, userSelect: "none", textOverflow: "ellipsis", lineHeight: "1.4375em", border: "transparent 1px solid", color: (k) => g ? k.palette.error.dark : void 0 }, children: r ?? l }) : o(Kn, { sx: { width: `${Math.min(w + 3, Math.max(S, R.current?.getBoundingClientRect()?.width))}px`, overflow: "hidden", whiteSpace: "nowrap", fontWeight: "600", maxWidth: "100%", border: "none", padding: "0px", margin: "0px", color: (k) => g ? k.palette.error.dark : void 0, fontStyle: u !== y ? "italic" : void 0, "& input": { paddingTop: "0px", paddingBottom: "0px", textOverflow: "ellipsis" } }, disableUnderline: !0, fullWidth: !1, multiline: !1, readOnly: p, spellCheck: !1, placeholder: l, onFocus: (k) => {
|
|
3290
3298
|
x(!0), k.target?.select();
|
|
3291
3299
|
}, inputProps: { name: "input-workbook-title", autoComplete: "off", ref: T }, onBlur: () => {
|
|
3292
3300
|
x(!1), g ? b(y) : (u !== y && (c?.(u), u && P.current?.onAccept?.(u, "blur")), P.current = null);
|
|
@@ -3299,8 +3307,8 @@ const Jc = (n = !1, a = !1) => a ? null : { "& input:not(:focus):not(:hover)": {
|
|
|
3299
3307
|
}, 0)), P.current = null, k.stopPropagation(), k.preventDefault());
|
|
3300
3308
|
}, value: u }), o(B, { ref: h, sx: { position: "absolute", visibility: "hidden", top: "-9999px", fontWeight: "600 !important", whiteSpace: "pre", fontStyle: u !== y ? "italic" : void 0, fontFamily: (k) => k.typography.fontFamily, letterSpacing: "0.00938em" }, children: u || l })] }) }) });
|
|
3301
3309
|
}));
|
|
3302
|
-
|
|
3303
|
-
const
|
|
3310
|
+
Ni.displayName = "WorkbookTitle";
|
|
3311
|
+
const ap = q(X((n, a) => {
|
|
3304
3312
|
const { title: t, commands: e, className: r, ...l } = n, c = sn(), [p, i] = _(!1), [s, d] = _(!1), x = xe(null), [g, m] = tn((T) => T + 1, 0), [u, { width: b }] = zt(), y = Ie(e, ["editTable"])[0].context(), f = y.table(), [h, w] = _(() => f ? y.getNames().getRanges(f.getRange()) : null), v = W(() => f?.getName() ?? "", [f]);
|
|
3305
3313
|
We(y.table(), { onAnchorCoordsChange(T) {
|
|
3306
3314
|
w(y.getNames().getRanges(T.getRange()));
|
|
@@ -3313,15 +3321,15 @@ const rp = q(X((n, a) => {
|
|
|
3313
3321
|
y?.table().resize(T.at(0));
|
|
3314
3322
|
}, [y]);
|
|
3315
3323
|
let D = null;
|
|
3316
|
-
return y.table() || (D = o(
|
|
3324
|
+
return y.table() || (D = o(Pe, { component: "div", style: { top: "0", left: "0", width: "100%", height: "100%", display: "flex", alignItems: "center", justifyItems: "center", justifyContent: "center" }, children: "No table selected" })), o(no, { square: !0, onFocus: () => i(!0), onBlur: (T) => {
|
|
3317
3325
|
x?.current?.contains(T.relatedTarget) || i(!1);
|
|
3318
|
-
}, ref: $t([x, u, a]), sx: { display: "flex", flexDirection: "column", flex: "1 1 auto", width: "100%", height: "100%", overflow: "auto", paddingLeft: (T) => T.spacing(1.5), paddingRight: (T) => T.spacing(1.5), paddingTop: (T) => T.spacing(1.5), paddingBottom: (T) => T.spacing(1.5), boxSizing: "border-box" }, className:
|
|
3326
|
+
}, ref: $t([x, u, a]), sx: { display: "flex", flexDirection: "column", flex: "1 1 auto", width: "100%", height: "100%", overflow: "auto", paddingLeft: (T) => T.spacing(1.5), paddingRight: (T) => T.spacing(1.5), paddingTop: (T) => T.spacing(1.5), paddingBottom: (T) => T.spacing(1.5), boxSizing: "border-box" }, className: Te("sxl-table-details-panel", r, { "sxl-has-focus": p }), ...l, children: D || H(B, { sx: { display: "flex", flex: "1 1 auto", flexDirection: "column", transition: "opacity 60ms", opacity: y.table() ? 1 : 0 }, children: [o(B, { sx: { containerType: "inline-size", display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box", paddingTop: (T) => T.spacing(2), paddingLeft: (T) => T.spacing(2), paddingRight: (T) => T.spacing(2) }, children: H(B, { className: gc, children: [o(Ka, { formName: "name", defaultInput: v, value: f?.getName() ?? "No table", onChangeInput: S, onValidate: (T) => {
|
|
3319
3327
|
f && f.getName().toLowerCase() === T.toLowerCase() || y?.getNames().validateName(T);
|
|
3320
3328
|
}, disabled: f?.isProtected() ?? !0, onFocus: (T) => {
|
|
3321
3329
|
s || T.target?.select(), d(!0);
|
|
3322
|
-
} }), o(
|
|
3330
|
+
} }), o(Xa, { formName: "range", value: h, onChangeInput: C, resolvedAddress: y.getNames().getRanges.bind(y.getNames()), disabled: f?.isProtected() ?? !0, onFocus: (T) => {
|
|
3323
3331
|
s || T.target?.select(), d(!0);
|
|
3324
|
-
} })] }) }), H(B, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", containerType: "inline-size", gap: (T) => T.spacing(0.5), marginTop: (T) => T.spacing(1) }, children: [o(
|
|
3332
|
+
} })] }) }), H(B, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", containerType: "inline-size", gap: (T) => T.spacing(0.5), marginTop: (T) => T.spacing(1) }, children: [o(Q, { orientation: "horizontal", sx: { marginTop: (T) => T.spacing(1.5), marginBottom: (T) => T.spacing(0.75) } }), o(uc, { disabled: f?.isProtected(), styleOptions: f?.getStyleOptions() ?? null, onStyleOptionsChange: (T) => {
|
|
3325
3333
|
f.updateStyleOptions(T);
|
|
3326
3334
|
}, showHeaderRow: f?.getShowHeaders(), onShowHeaderRowChange: (T) => {
|
|
3327
3335
|
try {
|
|
@@ -3341,20 +3349,20 @@ const rp = q(X((n, a) => {
|
|
|
3341
3349
|
} catch (P) {
|
|
3342
3350
|
c.showError(P);
|
|
3343
3351
|
}
|
|
3344
|
-
} }), o(
|
|
3345
|
-
})),
|
|
3352
|
+
} }), o(Q, { orientation: "horizontal", sx: { marginTop: (T) => T.spacing(1.5), marginBottom: (T) => T.spacing(0.75) } }), o(B, { sx: { display: "flex", flex: "1 1 100%", alignItems: "center", justifyContent: "start", flexDirection: "column", marginTop: (T) => T.spacing(2), marginBottom: (T) => T.spacing(1) }, children: H("div", { style: { display: "flex", alignItems: "start", gap: "2px" }, children: [o(_a, { table: f, styles: y.styles(), bodyStyle: y.bodyStyle(), cellHeight: 30, isLive: !0 }), o(Fi, { command: e.getCommand("formatTableStyle"), commands: e, disabledQuickKey: !0 })] }) }), o(Q, { orientation: "horizontal" }), H(B, { className: fc, children: [o(N, { variant: re.Menuitem, command: e.getCommand("convertTableToRange"), commandState: f }), o(N, { variant: re.Menuitem, commandState: f, command: e.getCommand("deleteTable") })] })] })] }) });
|
|
3353
|
+
})), td = q((n) => {
|
|
3346
3354
|
const { table: a, tableStyle: t, selectedTableStyleName: e, onSelectTableStyleName: r, styles: l, hasContextMenu: c = !0, bodyStyle: p, parentFloat: i, commands: s, disabled: d, commandHook: x, useCanvasPreview: g = !0, canvas: m, ...u } = n, b = U((w) => {
|
|
3347
|
-
const v = { variant:
|
|
3355
|
+
const v = { variant: re.Menuitem, commandHook: x, context: "table" }, S = H(le, { children: [o(N, { ...v, command: s.getCommand("formatTableStyleClearCellStyles"), commandState: t, disabled: d }), o(N, { ...v, style: { fontWeight: 550 }, command: s.getCommand("formatTableStyle"), commandState: { name: t.getName() }, disabled: d }), o(Q, { orientation: "horizontal" }), o(N, { ...v, command: s.getCommand("setDefaultTableStyle"), commandState: t.getName(), disabled: d }), o(Q, { orientation: "horizontal" }), o(N, { ...v, command: s.getCommand("deleteTableStyle"), commandState: t?.getName(), disabled: d || !t || t.isBuiltIn() })] });
|
|
3348
3356
|
return ge({ ...w, children: o(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: S }) }) });
|
|
3349
3357
|
}, [s]), y = t?.getName() === e, f = W(() => {
|
|
3350
3358
|
const w = { table: a, tableStyle: t, styles: l, bodyStyle: p };
|
|
3351
|
-
return g ? o(
|
|
3359
|
+
return g ? o(cc, { canvas: m, ...w }) : o(_a, { ...w });
|
|
3352
3360
|
}, [a, t, l, p]);
|
|
3353
|
-
let h = o(
|
|
3361
|
+
let h = o(bt, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (w) => `solid ${y ? w.palette.primary.dark : "transparent"} 1px` }, tooltipProps: { label: t.getName() ?? "None", placement: "bottom-start" }, disabled: d, icon: null, onClick: () => {
|
|
3354
3362
|
r?.(t?.getName());
|
|
3355
3363
|
}, ...u, children: f }, t.getName());
|
|
3356
3364
|
return c && (h = o(Pa, { label: a.getStyleOptions().name, parentFloat: i, createPopupPanel: b, children: h })), h;
|
|
3357
|
-
}),
|
|
3365
|
+
}), Fi = q(X((n, a) => {
|
|
3358
3366
|
const { commands: t, command: e, commandHook: r, selectedTable: l, onSelectTableStyleName: c, disabled: p = !1, bodyStyle: i, disabledQuickKey: s = !1, usePreviewIcon: d = !1, ...x } = n;
|
|
3359
3367
|
jt(e);
|
|
3360
3368
|
const g = e?.context(), m = g?.styles, u = l ?? g?.table?.();
|
|
@@ -3374,37 +3382,37 @@ const rp = q(X((n, a) => {
|
|
|
3374
3382
|
C.current || (C.current = document.createElement("canvas"));
|
|
3375
3383
|
const M = (j) => {
|
|
3376
3384
|
const K = m().getTableStyle(j);
|
|
3377
|
-
return K ? o(
|
|
3385
|
+
return K ? o(td, { table: h, tableStyle: K, selectedTableStyleName: h.getStyleOptions().name, bodyStyle: g.bodyStyle(), commands: k, commandHook: r, canvas: C.current, ...E }, j) : null;
|
|
3378
3386
|
}, I = (j, K, ee = !0) => {
|
|
3379
3387
|
const V = [];
|
|
3380
3388
|
for (let A = 0; A < K.length; A++) {
|
|
3381
3389
|
const Z = M(K[A]);
|
|
3382
3390
|
Z && V.push(Z);
|
|
3383
3391
|
}
|
|
3384
|
-
return V.length === 0 ? null : H(B, { children: [ee ? o(
|
|
3385
|
-
},
|
|
3392
|
+
return V.length === 0 ? null : H(B, { children: [ee ? o(Q, { orientation: "horizontal" }) : null, o(ro, { children: j }, j + "-header"), o(B, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", width: "481px", maxWidth: "100%" }, children: V }, j + "-presets")] }, j);
|
|
3393
|
+
}, F = [], L = m().getCustomTableStyles(), O = [];
|
|
3386
3394
|
if (L.length > 0) {
|
|
3387
|
-
for (let j = 0; j < L.length; j++) L[j].isShownInTableStyles() &&
|
|
3388
|
-
|
|
3395
|
+
for (let j = 0; j < L.length; j++) L[j].isShownInTableStyles() && O.push(L[j].getName());
|
|
3396
|
+
F.push(I("Custom", O, !1));
|
|
3389
3397
|
}
|
|
3390
3398
|
const z = [];
|
|
3391
3399
|
u && !u.getStyleOptions().name && z.push(null);
|
|
3392
3400
|
for (let j = 0; j < 21; j++) z.push("TableStyleLight" + (j + 1));
|
|
3393
|
-
|
|
3394
|
-
const
|
|
3395
|
-
for (let j = 0; j < 28; j++)
|
|
3396
|
-
|
|
3397
|
-
const
|
|
3398
|
-
for (let j = 0; j < 11; j++)
|
|
3399
|
-
|
|
3400
|
-
let
|
|
3401
|
-
return u && (
|
|
3402
|
-
}, sx: { display: "flex", flexDirection: "column", padding: "6px 16px" }, children:
|
|
3401
|
+
F.push(I("Light", z, O.length > 0));
|
|
3402
|
+
const ie = [];
|
|
3403
|
+
for (let j = 0; j < 28; j++) ie.push("TableStyleMedium" + (j + 1));
|
|
3404
|
+
F.push(I("Medium", ie));
|
|
3405
|
+
const J = [];
|
|
3406
|
+
for (let j = 0; j < 11; j++) J.push("TableStyleDark" + (j + 1));
|
|
3407
|
+
F.push(I("Dark", J));
|
|
3408
|
+
let pe = null;
|
|
3409
|
+
return u && (pe = H(le, { children: [o(Q, { orientation: "horizontal" }), o(N, { variant: re.Menuitem, command: k.getCommand("formatTableStyleClearTableStyle"), commandHook: r, disabled: p })] })), H(B, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", paddingTop: (j) => `${j.shape.borderRadius}px`, paddingBottom: (j) => `${j.shape.borderRadius}px` }, children: [o(B, { onContextMenu: () => {
|
|
3410
|
+
}, sx: { display: "flex", flexDirection: "column", padding: "6px 16px" }, children: F }), pe] });
|
|
3403
3411
|
}, [m, m?.().getTheme(), v, h]), T = p || !e || e.disabled(), P = W(() => {
|
|
3404
3412
|
if (!g || !d) return e?.icon();
|
|
3405
3413
|
}, [h, v, T, e]);
|
|
3406
|
-
return o(
|
|
3407
|
-
})),
|
|
3414
|
+
return o(Se, { ref: a, quickCommand: s ? void 0 : b, createPopupPanel: D, commands: t, label: e?.label(), commandState: u, commandHook: r, selected: u !== null, createTooltip: ({ children: R }, k) => o(nt, { label: e?.label(), description: e?.description(), disabled: k, children: R }), disabled: T, icon: P, ...x });
|
|
3415
|
+
})), od = q(X((n, a) => {
|
|
3408
3416
|
const { command: t, commandHook: e, selectedTheme: r, onSelectTheme: l, disabled: c = !1, darkMode: p, label: i, icon: s, variant: d, ...x } = n;
|
|
3409
3417
|
jt(t);
|
|
3410
3418
|
const g = t?.context()?.themes, m = r || t?.context()?.theme, u = p ?? t?.context()?.darkMode, b = c || t?.disabled(), y = Y((h) => {
|
|
@@ -3412,29 +3420,29 @@ const rp = q(X((n, a) => {
|
|
|
3412
3420
|
}, [l, e]), f = U((h, w) => {
|
|
3413
3421
|
const { children: v, title: S, ...C } = h;
|
|
3414
3422
|
let D = h.children;
|
|
3415
|
-
return (b || w) && (D = o("div", { children: D })), o(Zn, { command: t, placement: d ===
|
|
3423
|
+
return (b || w) && (D = o("div", { children: D })), o(Zn, { command: t, placement: d === re.Toolbar ? "bottom-start" : "right-start", disabled: b || w, ...C, children: D });
|
|
3416
3424
|
}, [t, b]);
|
|
3417
|
-
return o(
|
|
3418
|
-
})),
|
|
3425
|
+
return o(yc, { ref: a, themes: g, selectedTheme: m, onSelectTheme: y, variant: d === re.Menuitem ? ot.Menuitem : ot.Toolbar, createTooltip: f, disabled: b, darkMode: u, ...x });
|
|
3426
|
+
})), nd = q(X((n, a) => {
|
|
3419
3427
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, ...c } = n, p = Ie(t, ["themeMode"])[0], i = Y((m, u) => {
|
|
3420
|
-
const b = { variant:
|
|
3428
|
+
const b = { variant: re.Menuitem, commandHook: e, scope: "appearance", disabled: l }, y = H(le, { children: [o(N, { ...b, command: p }), o(N, { ...b, command: u.getCommand("defaultThemeMode") }), o(Q, { orientation: "horizontal" }), o(N, { ...b, command: u.getCommand("enableDarkGrid") }), o(N, { ...b, command: u.getCommand("enableDarkImages") })] });
|
|
3421
3429
|
return ge({ ...m, children: y });
|
|
3422
3430
|
}, [l, p, e, r]), s = p?.state(), d = Da("(prefers-color-scheme: dark)"), x = s === "dark" || s === null && d, g = p?.state() !== null;
|
|
3423
|
-
return o(
|
|
3431
|
+
return o(Se, { ref: a, quickCommand: "themeMode", commands: t, commandHook: e, createPopupPanel: i, label: "Appearance", tooltip: "Change the light/dark mode to match your viewing preference. This does not affect the view for others.", onQuickClick: () => {
|
|
3424
3432
|
p?.execute(x ? "light" : "dark", e);
|
|
3425
3433
|
}, selected: g, ...c });
|
|
3426
|
-
})),
|
|
3434
|
+
})), rd = q(X((n, a) => {
|
|
3427
3435
|
const { commands: t, commandHook: e, scope: r, disabled: l = !1, sx: c, ...p } = n, i = U((s, d) => {
|
|
3428
|
-
const x = { variant:
|
|
3436
|
+
const x = { variant: re.Menuitem, scope: "help", commandHook: { ...e, beforeExecute: (m, u) => e?.beforeExecute?.(m, u) !== !1 && s.floatReference.closeAll() }, disabled: l }, g = H(le, { children: [o(N, { ...x, command: d.getCommand("showKeyboardShortcuts") }), o(Q, { orientation: "horizontal" }), o(N, { ...x, command: d.getCommand("gotoUrlGithub") }), o(N, { ...x, command: d.getCommand("gotoUrlDiscord") }), o(N, { ...x, command: d.getCommand("gotoUrlDocumentation") }), o(N, { ...x, command: d.getCommand("gotoUrlIssue") })] });
|
|
3429
3437
|
return ge({ ...s, children: g });
|
|
3430
3438
|
}, [l, e]);
|
|
3431
|
-
return o(
|
|
3432
|
-
})),
|
|
3439
|
+
return o(Se, { ref: a, sx: c, commands: t, disabled: l, commandHook: e, scope: r, label: "Help", tooltip: "Help, feedback, and keyboard shortcuts.", createPopupPanel: i, icon: o(he, { iconKey: "Help", style: { transform: "scale(0.75)" } }), ...p });
|
|
3440
|
+
})), Oi = q(X((n, a) => {
|
|
3433
3441
|
const { ...t } = n;
|
|
3434
|
-
return o(
|
|
3442
|
+
return o(tt, { ref: a, ...t, popupCommandKeys: ["insertFunctionSum", "insertFunctionAverage", "insertFunctionCount", "insertFunctionMax", "insertFunctionMin", null, "insertFunction"], quickCommand: "insertFunctionSum", popupScope: "insertFunction", label: "Quick Function", tooltip: "More functions." });
|
|
3435
3443
|
}));
|
|
3436
|
-
|
|
3437
|
-
const Dn = new Map([{ key: "financial", label: "Financial", icon: "FormulaFinancial" }, { key: "logical", label: "Logical", icon: "FormulaLogical" }, { key: "text", label: "Text", icon: "FormulaText" }, { key: "dateTime", label: "Date & Time", icon: "FormulaDateTime" }, { key: "lookupReference", label: "Lookup & Reference", icon: "FormulaLookupReference" }, { key: "mathTrig", label: "Math & Trig", icon: "FormulaMathTrig" }, { key: "statDist", label: "Statistical", icon: "FormulaStatistical" }, { key: "engineering", label: "Engineering", icon: "FormulaEngineering" }, { key: "information", label: "Information", icon: "FormulaInformation" }, { key: "cube", label: "Cube", icon: "FormulaCube" }, { key: "database", label: "Database", icon: "FormulaDatabase" }, { key: "web", label: "Web", icon: "FormulaWeb" }, { key: "custom", label: "Custom", icon: "FormulaCustom" }].map((n) => [n.key, n])),
|
|
3444
|
+
Oi.displayName = "InsertFunctionSumCommandPopupButton";
|
|
3445
|
+
const Dn = new Map([{ key: "financial", label: "Financial", icon: "FormulaFinancial" }, { key: "logical", label: "Logical", icon: "FormulaLogical" }, { key: "text", label: "Text", icon: "FormulaText" }, { key: "dateTime", label: "Date & Time", icon: "FormulaDateTime" }, { key: "lookupReference", label: "Lookup & Reference", icon: "FormulaLookupReference" }, { key: "mathTrig", label: "Math & Trig", icon: "FormulaMathTrig" }, { key: "statDist", label: "Statistical", icon: "FormulaStatistical" }, { key: "engineering", label: "Engineering", icon: "FormulaEngineering" }, { key: "information", label: "Information", icon: "FormulaInformation" }, { key: "cube", label: "Cube", icon: "FormulaCube" }, { key: "database", label: "Database", icon: "FormulaDatabase" }, { key: "web", label: "Web", icon: "FormulaWeb" }, { key: "custom", label: "Custom", icon: "FormulaCustom" }].map((n) => [n.key, n])), ad = q((n) => {
|
|
3438
3446
|
const { command: a, formulaFunction: t, commandHook: e, disabled: r = !1, parentFloat: l, handleInsert: c, icon: p, label: i, sx: s, ...d } = n, x = new Promise((g) => {
|
|
3439
3447
|
t.getDescriptor().then((m) => {
|
|
3440
3448
|
g(m.getSummary());
|
|
@@ -3446,18 +3454,18 @@ const Dn = new Map([{ key: "financial", label: "Financial", icon: "FormulaFinanc
|
|
|
3446
3454
|
g.button === 0 && c(t);
|
|
3447
3455
|
}, onKeyDown: (g) => {
|
|
3448
3456
|
g.keyCode === me.Enter || (g.keyCode, me.Space);
|
|
3449
|
-
}, ...d, children: o(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: o(
|
|
3450
|
-
}),
|
|
3457
|
+
}, ...d, children: o(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: o(Pe, { component: "div", children: t.getName() }) }) });
|
|
3458
|
+
}), id = q(X((n, a) => {
|
|
3451
3459
|
const { category: t, commands: e, commandHook: r, scope: l, sx: c, disabled: p = !1, parentFloat: i, ...s } = n, d = Ie(e, ["insertFunction"])[0], x = U((m, u) => {
|
|
3452
3460
|
const b = Dn.get(t);
|
|
3453
3461
|
if (!b) return console.warn("invalidate category", t), null;
|
|
3454
|
-
const y = { commandHook: r, ...m }, f = o(
|
|
3462
|
+
const y = { commandHook: r, ...m }, f = o(ld, { category: b.label, ...y, commands: u });
|
|
3455
3463
|
return ge({ ...m, children: f });
|
|
3456
3464
|
}, [t, d, r, l]), g = Dn.get(t);
|
|
3457
|
-
return o(
|
|
3465
|
+
return o(Se, { ref: a, commands: e, commandHook: r, createPopupPanel: x, label: g.label, tooltip: "Insert Function", icon: Dn.get(t)?.icon ?? "FormulaGroup", ...s });
|
|
3458
3466
|
}));
|
|
3459
|
-
|
|
3460
|
-
const
|
|
3467
|
+
id.displayName = "InsertFunctionCommandPopupButton";
|
|
3468
|
+
const ld = q(X((n, a) => {
|
|
3461
3469
|
const { commands: t, category: e, commandHook: r, ...l } = n, c = Ie(t, ["insertFunction"]), [p, i] = _([]), [s, d] = _(!1);
|
|
3462
3470
|
de(() => {
|
|
3463
3471
|
(async () => {
|
|
@@ -3471,46 +3479,46 @@ const id = q(X((n, a) => {
|
|
|
3471
3479
|
};
|
|
3472
3480
|
for (let b = 0; b < x; b++) {
|
|
3473
3481
|
const y = p[b];
|
|
3474
|
-
g[b] = o(
|
|
3482
|
+
g[b] = o(ad, { command: m, formulaFunction: y, handleInsert: u }, `formula-${y.getName()}-${b}`);
|
|
3475
3483
|
}
|
|
3476
3484
|
return ge({ ...l, children: o(B, { ref: a, sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: x > 0 ? o(le, { children: o(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: g }) }) : null }) });
|
|
3477
|
-
})),
|
|
3485
|
+
})), sd = q(X((n, a) => {
|
|
3478
3486
|
const { sx: t, style: e, className: r, licenseKey: l, renderLoadingPanel: c, ...p } = n;
|
|
3479
3487
|
l && Eo.setLicenseKey(l);
|
|
3480
3488
|
const i = W(() => {
|
|
3481
3489
|
const d = { transitionDelay: "160ms", transparentBackground: !0 };
|
|
3482
3490
|
return o(B, { sx: t, style: { width: "100%", height: "100%", position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", ...e }, children: c?.(d) ?? o(Wt, { ...d }) });
|
|
3483
|
-
}, [t, e, c]), s = W(() =>
|
|
3491
|
+
}, [t, e, c]), s = W(() => ae.lazy(async () => await Promise.resolve().then(() => $d)), []);
|
|
3484
3492
|
return o(le, { children: o(Sa, { fallback: i, children: o(s, { ...p, className: r, renderLoadingPanel: c, sx: t, style: e, ref: a }) }) });
|
|
3485
3493
|
}));
|
|
3486
|
-
function
|
|
3494
|
+
function Bi(n) {
|
|
3487
3495
|
var a, t, e = "";
|
|
3488
3496
|
if (typeof n == "string" || typeof n == "number") e += n;
|
|
3489
|
-
else if (typeof n == "object") if (Array.isArray(n)) for (a = 0; a < n.length; a++) n[a] && (t =
|
|
3497
|
+
else if (typeof n == "object") if (Array.isArray(n)) for (a = 0; a < n.length; a++) n[a] && (t = Bi(n[a])) && (e && (e += " "), e += t);
|
|
3490
3498
|
else for (a in n) n[a] && (e && (e += " "), e += a);
|
|
3491
3499
|
return e;
|
|
3492
3500
|
}
|
|
3493
3501
|
function Vt() {
|
|
3494
|
-
for (var n, a, t = 0, e = ""; t < arguments.length; ) (n = arguments[t++]) && (a =
|
|
3502
|
+
for (var n, a, t = 0, e = ""; t < arguments.length; ) (n = arguments[t++]) && (a = Bi(n)) && (e && (e += " "), e += a);
|
|
3495
3503
|
return e;
|
|
3496
3504
|
}
|
|
3497
|
-
|
|
3498
|
-
let
|
|
3505
|
+
sd.displayName = "Studio";
|
|
3506
|
+
let cd = { data: "" }, dd = (n) => typeof window == "object" ? ((n ? n.querySelector("#_goober") : window._goober) || Object.assign((n || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : n || cd, pd = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, ud = /\/\*[^]*?\*\/| +/g, ia = /\n+/g, It = (n, a) => {
|
|
3499
3507
|
let t = "", e = "", r = "";
|
|
3500
3508
|
for (let l in n) {
|
|
3501
3509
|
let c = n[l];
|
|
3502
3510
|
l[0] == "@" ? l[1] == "i" ? t = l + " " + c + ";" : e += l[1] == "f" ? It(c, l) : l + "{" + It(c, l[1] == "k" ? "" : a) + "}" : typeof c == "object" ? e += It(c, a ? a.replace(/([^,])+/g, (p) => l.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (i) => /&/.test(i) ? i.replace(/&/g, p) : p ? p + " " + i : i)) : l) : c != null && (l = /^--/.test(l) ? l : l.replace(/[A-Z]/g, "-$&").toLowerCase(), r += It.p ? It.p(l, c) : l + ":" + c + ";");
|
|
3503
3511
|
}
|
|
3504
3512
|
return t + (a && r ? a + "{" + r + "}" : r) + e;
|
|
3505
|
-
}, pt = {},
|
|
3513
|
+
}, pt = {}, Ai = (n) => {
|
|
3506
3514
|
if (typeof n == "object") {
|
|
3507
3515
|
let a = "";
|
|
3508
|
-
for (let t in n) a += t +
|
|
3516
|
+
for (let t in n) a += t + Ai(n[t]);
|
|
3509
3517
|
return a;
|
|
3510
3518
|
}
|
|
3511
3519
|
return n;
|
|
3512
|
-
},
|
|
3513
|
-
let l =
|
|
3520
|
+
}, md = (n, a, t, e, r) => {
|
|
3521
|
+
let l = Ai(n), c = pt[l] || (pt[l] = ((i) => {
|
|
3514
3522
|
let s = 0, d = 11;
|
|
3515
3523
|
for (; s < i.length; ) d = 101 * d + i.charCodeAt(s++) >>> 0;
|
|
3516
3524
|
return "go" + d;
|
|
@@ -3518,7 +3526,7 @@ let sd = { data: "" }, cd = (n) => typeof window == "object" ? ((n ? n.querySele
|
|
|
3518
3526
|
if (!pt[c]) {
|
|
3519
3527
|
let i = l !== n ? n : ((s) => {
|
|
3520
3528
|
let d, x, g = [{}];
|
|
3521
|
-
for (; d =
|
|
3529
|
+
for (; d = pd.exec(s.replace(ud, "")); ) d[4] ? g.shift() : d[3] ? (x = d[3].replace(ia, " ").trim(), g.unshift(g[0][x] = g[0][x] || {})) : g[0][d[1]] = d[2].replace(ia, " ").trim();
|
|
3522
3530
|
return g[0];
|
|
3523
3531
|
})(n);
|
|
3524
3532
|
pt[c] = It(r ? { ["@keyframes " + c]: i } : i, t ? "" : "." + c);
|
|
@@ -3530,16 +3538,16 @@ let sd = { data: "" }, cd = (n) => typeof window == "object" ? ((n ? n.querySele
|
|
|
3530
3538
|
};
|
|
3531
3539
|
function Wn(n) {
|
|
3532
3540
|
let a = this || {}, t = n.call ? n(a.p) : n;
|
|
3533
|
-
return
|
|
3541
|
+
return md(t.unshift ? t.raw ? ((e, r, l) => e.reduce((c, p, i) => {
|
|
3534
3542
|
let s = r[i];
|
|
3535
3543
|
if (s && s.call) {
|
|
3536
3544
|
let d = s(l), x = d && d.props && d.props.className || /^go/.test(d) && d;
|
|
3537
3545
|
s = x ? "." + x : d && typeof d == "object" ? d.props ? "" : It(d, "") : d === !1 ? "" : d;
|
|
3538
3546
|
}
|
|
3539
3547
|
return c + p + (s ?? "");
|
|
3540
|
-
}, ""))(t, [].slice.call(arguments, 1), a.p) : t.reduce((e, r) => Object.assign(e, r && r.call ? r(a.p) : r), {}) : t,
|
|
3548
|
+
}, ""))(t, [].slice.call(arguments, 1), a.p) : t.reduce((e, r) => Object.assign(e, r && r.call ? r(a.p) : r), {}) : t, dd(a.target), a.g, a.o, a.k);
|
|
3541
3549
|
}
|
|
3542
|
-
function
|
|
3550
|
+
function Ii(n, a, t) {
|
|
3543
3551
|
return a && (function(e, r) {
|
|
3544
3552
|
for (var l = 0; l < r.length; l++) {
|
|
3545
3553
|
var c = r[l];
|
|
@@ -3547,16 +3555,16 @@ function Ai(n, a, t) {
|
|
|
3547
3555
|
}
|
|
3548
3556
|
})(n.prototype, a), n;
|
|
3549
3557
|
}
|
|
3550
|
-
function
|
|
3551
|
-
return
|
|
3558
|
+
function De() {
|
|
3559
|
+
return De = Object.assign || function(n) {
|
|
3552
3560
|
for (var a = 1; a < arguments.length; a++) {
|
|
3553
3561
|
var t = arguments[a];
|
|
3554
3562
|
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && (n[e] = t[e]);
|
|
3555
3563
|
}
|
|
3556
3564
|
return n;
|
|
3557
|
-
},
|
|
3565
|
+
}, De.apply(this, arguments);
|
|
3558
3566
|
}
|
|
3559
|
-
function
|
|
3567
|
+
function Li(n, a) {
|
|
3560
3568
|
n.prototype = Object.create(a.prototype), n.prototype.constructor = n, n.__proto__ = a;
|
|
3561
3569
|
}
|
|
3562
3570
|
function Oo(n, a) {
|
|
@@ -3572,7 +3580,7 @@ function la(n) {
|
|
|
3572
3580
|
Wn.bind({ g: 1 }), Wn.bind({ k: 1 });
|
|
3573
3581
|
var sa = function() {
|
|
3574
3582
|
return "";
|
|
3575
|
-
},
|
|
3583
|
+
}, zi = ae.createContext({ enqueueSnackbar: sa, closeSnackbar: sa }), Pn = "@media (max-width:599.95px)", Qo = "@media (min-width:600px)", ca = function(n) {
|
|
3576
3584
|
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
3577
3585
|
}, nr = function(n) {
|
|
3578
3586
|
return "" + ca(n.vertical) + ca(n.horizontal);
|
|
@@ -3585,7 +3593,7 @@ var sa = function() {
|
|
|
3585
3593
|
var l, c = e.appear;
|
|
3586
3594
|
return r.appearStatus = null, e.in ? c ? (l = qt, r.appearStatus = Kt) : l = vo : l = e.unmountOnExit || e.mountOnEnter ? Uo : qt, r.state = { status: l }, r.nextCallback = null, r;
|
|
3587
3595
|
}
|
|
3588
|
-
|
|
3596
|
+
Li(a, n), a.getDerivedStateFromProps = function(e, r) {
|
|
3589
3597
|
return e.in && r.status === Uo ? { status: qt } : null;
|
|
3590
3598
|
};
|
|
3591
3599
|
var t = a.prototype;
|
|
@@ -3647,12 +3655,12 @@ var sa = function() {
|
|
|
3647
3655
|
if (e === Uo) return null;
|
|
3648
3656
|
var r = this.props;
|
|
3649
3657
|
return (0, r.children)(e, Oo(r, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]));
|
|
3650
|
-
},
|
|
3658
|
+
}, Ii(a, [{ key: "node", get: function() {
|
|
3651
3659
|
var e, r = (e = this.props.nodeRef) === null || e === void 0 ? void 0 : e.current;
|
|
3652
3660
|
if (!r) throw new Error("notistack - Custom snackbar is not refForwarding");
|
|
3653
3661
|
return r;
|
|
3654
3662
|
} }]), a;
|
|
3655
|
-
})(
|
|
3663
|
+
})(ae.Component);
|
|
3656
3664
|
function Xt() {
|
|
3657
3665
|
}
|
|
3658
3666
|
function pa(n, a) {
|
|
@@ -3670,20 +3678,20 @@ function en(n) {
|
|
|
3670
3678
|
return { duration: typeof a == "object" ? a[r] || 0 : a, easing: e.transitionTimingFunction, delay: e.transitionDelay };
|
|
3671
3679
|
}
|
|
3672
3680
|
rr.defaultProps = { in: !1, mountOnEnter: !1, unmountOnExit: !1, appear: !1, enter: !0, exit: !0, onEnter: Xt, onEntering: Xt, onEntered: Xt, onExit: Xt, onExiting: Xt, onExited: Xt };
|
|
3673
|
-
var
|
|
3681
|
+
var hd = "cubic-bezier(0.4, 0, 0.2, 1)", gd = "cubic-bezier(0.0, 0, 0.2, 1)", fd = "cubic-bezier(0.4, 0, 0.6, 1)", Hi = function(n) {
|
|
3674
3682
|
n.scrollTop = n.scrollTop;
|
|
3675
3683
|
}, ua = function(n) {
|
|
3676
3684
|
return Math.round(n) + "ms";
|
|
3677
3685
|
};
|
|
3678
3686
|
function eo(n, a) {
|
|
3679
3687
|
n === void 0 && (n = ["all"]);
|
|
3680
|
-
var t = a || {}, e = t.duration, r = e === void 0 ? 300 : e, l = t.easing, c = l === void 0 ?
|
|
3688
|
+
var t = a || {}, e = t.duration, r = e === void 0 ? 300 : e, l = t.easing, c = l === void 0 ? hd : l, p = t.delay, i = p === void 0 ? 0 : p;
|
|
3681
3689
|
return (Array.isArray(n) ? n : [n]).map(function(s) {
|
|
3682
3690
|
var d = typeof r == "string" ? r : ua(r), x = typeof i == "string" ? i : ua(i);
|
|
3683
3691
|
return s + " " + d + " " + c + " " + x;
|
|
3684
3692
|
}).join(",");
|
|
3685
3693
|
}
|
|
3686
|
-
function
|
|
3694
|
+
function Wi(n) {
|
|
3687
3695
|
var a = (function(t) {
|
|
3688
3696
|
return t && t.ownerDocument || document;
|
|
3689
3697
|
})(n);
|
|
@@ -3692,7 +3700,7 @@ function Hi(n) {
|
|
|
3692
3700
|
function Go(n, a) {
|
|
3693
3701
|
if (a) {
|
|
3694
3702
|
var t = (function(e, r) {
|
|
3695
|
-
var l, c = r.getBoundingClientRect(), p =
|
|
3703
|
+
var l, c = r.getBoundingClientRect(), p = Wi(r);
|
|
3696
3704
|
if (r.fakeTransform) l = r.fakeTransform;
|
|
3697
3705
|
else {
|
|
3698
3706
|
var i = p.getComputedStyle(r);
|
|
@@ -3717,7 +3725,7 @@ function Go(n, a) {
|
|
|
3717
3725
|
t && (a.style.webkitTransform = t, a.style.transform = t);
|
|
3718
3726
|
}
|
|
3719
3727
|
}
|
|
3720
|
-
var
|
|
3728
|
+
var ji = X(function(n, a) {
|
|
3721
3729
|
var t = n.children, e = n.direction, r = e === void 0 ? "down" : e, l = n.in, c = n.style, p = n.timeout, i = p === void 0 ? 0 : p, s = n.onEnter, d = n.onEntered, x = n.onExit, g = n.onExited, m = Oo(n, ["children", "direction", "in", "style", "timeout", "onEnter", "onEntered", "onExit", "onExited"]), u = xe(null), b = jn(t.ref, u), y = jn(b, a), f = U(function() {
|
|
3722
3730
|
u.current && Go(r, u.current);
|
|
3723
3731
|
}, [r]);
|
|
@@ -3736,45 +3744,45 @@ var Wi = X(function(n, a) {
|
|
|
3736
3744
|
}, D;
|
|
3737
3745
|
})(function() {
|
|
3738
3746
|
u.current && Go(r, u.current);
|
|
3739
|
-
}), w =
|
|
3747
|
+
}), w = Wi(u.current);
|
|
3740
3748
|
return w.addEventListener("resize", h), function() {
|
|
3741
3749
|
h.clear(), w.removeEventListener("resize", h);
|
|
3742
3750
|
};
|
|
3743
3751
|
}
|
|
3744
3752
|
}, [r, l]), de(function() {
|
|
3745
3753
|
l || f();
|
|
3746
|
-
}, [l, f]),
|
|
3747
|
-
Go(r, h),
|
|
3754
|
+
}, [l, f]), ke(rr, Object.assign({ appear: !0, nodeRef: u, onEnter: function(h, w) {
|
|
3755
|
+
Go(r, h), Hi(h), s && s(h, w);
|
|
3748
3756
|
}, onEntered: d, onEntering: function(h) {
|
|
3749
|
-
var w = c?.transitionTimingFunction ||
|
|
3757
|
+
var w = c?.transitionTimingFunction || gd, v = en({ timeout: i, mode: "enter", style: De({}, c, { transitionTimingFunction: w }) });
|
|
3750
3758
|
h.style.webkitTransition = eo("-webkit-transform", v), h.style.transition = eo("transform", v), h.style.webkitTransform = "none", h.style.transform = "none";
|
|
3751
3759
|
}, onExit: function(h) {
|
|
3752
|
-
var w = c?.transitionTimingFunction ||
|
|
3760
|
+
var w = c?.transitionTimingFunction || fd, v = en({ timeout: i, mode: "exit", style: De({}, c, { transitionTimingFunction: w }) });
|
|
3753
3761
|
h.style.webkitTransition = eo("-webkit-transform", v), h.style.transition = eo("transform", v), Go(r, h), x && x(h);
|
|
3754
3762
|
}, onExited: function(h) {
|
|
3755
3763
|
h.style.webkitTransition = "", h.style.transition = "", g && g(h);
|
|
3756
3764
|
}, in: l, timeout: i }, m), function(h, w) {
|
|
3757
|
-
return
|
|
3765
|
+
return Xl(t, De({ ref: y, style: De({ visibility: h !== "exited" || l ? void 0 : "hidden" }, c, {}, t.props.style) }, w));
|
|
3758
3766
|
});
|
|
3759
3767
|
});
|
|
3760
|
-
|
|
3768
|
+
ji.displayName = "Slide";
|
|
3761
3769
|
var pn = function(n) {
|
|
3762
|
-
return
|
|
3763
|
-
}, fd = function() {
|
|
3764
|
-
return re.createElement(pn, null, re.createElement("path", { d: `M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
3765
|
-
10.59L10 14.17L17.59 6.58L19 8L10 17Z` }));
|
|
3770
|
+
return ae.createElement("svg", Object.assign({ viewBox: "0 0 24 24", focusable: "false", style: { fontSize: 20, marginInlineEnd: 8, userSelect: "none", width: "1em", height: "1em", display: "inline-block", fill: "currentColor", flexShrink: 0 } }, n));
|
|
3766
3771
|
}, bd = function() {
|
|
3767
|
-
return
|
|
3772
|
+
return ae.createElement(pn, null, ae.createElement("path", { d: `M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
3773
|
+
10.59L10 14.17L17.59 6.58L19 8L10 17Z` }));
|
|
3768
3774
|
}, xd = function() {
|
|
3769
|
-
return
|
|
3775
|
+
return ae.createElement(pn, null, ae.createElement("path", { d: "M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z" }));
|
|
3776
|
+
}, yd = function() {
|
|
3777
|
+
return ae.createElement(pn, null, ae.createElement("path", { d: `M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
|
|
3770
3778
|
6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
|
|
3771
3779
|
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z` }));
|
|
3772
|
-
},
|
|
3773
|
-
return
|
|
3780
|
+
}, wd = function() {
|
|
3781
|
+
return ae.createElement(pn, null, ae.createElement("path", { d: `M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
|
|
3774
3782
|
0 22,12A10,10 0 0,0 12,2Z` }));
|
|
3775
|
-
}, At = { maxSnack: 3, persist: !1, hideIconVariant: !1, disableWindowBlurListener: !1, variant: "default", autoHideDuration: 5e3, iconVariant: { default: void 0, success:
|
|
3783
|
+
}, At = { maxSnack: 3, persist: !1, hideIconVariant: !1, disableWindowBlurListener: !1, variant: "default", autoHideDuration: 5e3, iconVariant: { default: void 0, success: ae.createElement(bd, null), warning: ae.createElement(xd, null), error: ae.createElement(yd, null), info: ae.createElement(wd, null) }, anchorOrigin: { vertical: "bottom", horizontal: "left" }, TransitionComponent: ji, transitionDuration: { enter: 225, exit: 195 } }, Sd = function(n, a) {
|
|
3776
3784
|
return function(t, e) {
|
|
3777
|
-
return e === void 0 && (e = !1), e ?
|
|
3785
|
+
return e === void 0 && (e = !1), e ? De({}, At[t], {}, a[t], {}, n[t]) : t === "autoHideDuration" ? (r = n.autoHideDuration, l = a.autoHideDuration, (c = function(p) {
|
|
3778
3786
|
return typeof p == "number" || p === null;
|
|
3779
3787
|
})(r) ? r : c(l) ? l : At.autoHideDuration) : t === "transitionDuration" ? (function(p, i) {
|
|
3780
3788
|
var s = function(d, x) {
|
|
@@ -3782,7 +3790,7 @@ var pn = function(n) {
|
|
|
3782
3790
|
return typeof d === g;
|
|
3783
3791
|
});
|
|
3784
3792
|
};
|
|
3785
|
-
return s(p, ["string", "number"]) ? p : s(p, ["object"]) ?
|
|
3793
|
+
return s(p, ["string", "number"]) ? p : s(p, ["object"]) ? De({}, At.transitionDuration, {}, s(i, ["object"]) && i, {}, p) : s(i, ["string", "number"]) ? i : s(i, ["object"]) ? De({}, At.transitionDuration, {}, i) : At.transitionDuration;
|
|
3786
3794
|
})(n.transitionDuration, a.transitionDuration) : n[t] || a[t] || At[t];
|
|
3787
3795
|
var r, l, c;
|
|
3788
3796
|
};
|
|
@@ -3790,16 +3798,16 @@ var pn = function(n) {
|
|
|
3790
3798
|
function Bo(n) {
|
|
3791
3799
|
return Object.entries(n).reduce(function(a, t) {
|
|
3792
3800
|
var e, r = t[0], l = t[1];
|
|
3793
|
-
return
|
|
3801
|
+
return De({}, a, ((e = {})[r] = Wn(l), e));
|
|
3794
3802
|
}, {});
|
|
3795
3803
|
}
|
|
3796
|
-
var
|
|
3804
|
+
var vd = "notistack-SnackbarContainer", kd = "notistack-Snackbar", $i = "notistack-CollapseWrapper", Cd = "notistack-MuiContent", Td = function(n) {
|
|
3797
3805
|
return "notistack-MuiContent-" + n;
|
|
3798
|
-
}, ma = Bo({ root: { height: 0 }, entered: { height: "auto" } }), Rn = "0px",
|
|
3806
|
+
}, ma = Bo({ root: { height: 0 }, entered: { height: "auto" } }), Rn = "0px", Vi = X(function(n, a) {
|
|
3799
3807
|
var t = n.children, e = n.in, r = n.onExited, l = xe(null), c = xe(null), p = jn(a, c), i = function() {
|
|
3800
3808
|
return l.current ? l.current.clientHeight : 0;
|
|
3801
3809
|
};
|
|
3802
|
-
return
|
|
3810
|
+
return ke(rr, { in: e, unmountOnExit: !0, onEnter: function(s) {
|
|
3803
3811
|
s.style.height = Rn;
|
|
3804
3812
|
}, onEntered: function(s) {
|
|
3805
3813
|
s.style.height = "auto";
|
|
@@ -3809,17 +3817,17 @@ var Sd = "notistack-SnackbarContainer", vd = "notistack-Snackbar", ji = "notista
|
|
|
3809
3817
|
}, onExit: function(s) {
|
|
3810
3818
|
s.style.height = i() + "px";
|
|
3811
3819
|
}, onExited: r, onExiting: function(s) {
|
|
3812
|
-
|
|
3820
|
+
Hi(s);
|
|
3813
3821
|
var d = en({ timeout: 175, mode: "exit" }), x = d.duration, g = d.easing;
|
|
3814
3822
|
s.style.transitionDuration = typeof x == "string" ? x : x + "ms", s.style.height = Rn, s.style.transitionTimingFunction = g || "";
|
|
3815
3823
|
}, nodeRef: c, timeout: 175 }, function(s, d) {
|
|
3816
|
-
return
|
|
3824
|
+
return ke("div", Object.assign({ ref: p, className: Vt(ma.root, s === "entered" && ma.entered), style: De({ pointerEvents: "all", overflow: "hidden", minHeight: Rn, transition: eo("height") }, s === "entered" && { overflow: "visible" }, {}, s === "exited" && !e && { visibility: "hidden" }) }, d), ke("div", { ref: l, className: $i, style: { display: "flex", width: "100%" } }, t));
|
|
3817
3825
|
});
|
|
3818
3826
|
});
|
|
3819
|
-
|
|
3820
|
-
var ha = { right: "left", left: "right", bottom: "up", top: "down" },
|
|
3827
|
+
Vi.displayName = "Collapse";
|
|
3828
|
+
var ha = { right: "left", left: "right", bottom: "up", top: "down" }, Ed = function(n) {
|
|
3821
3829
|
return "anchorOrigin" + nr(n);
|
|
3822
|
-
},
|
|
3830
|
+
}, Dd = function() {
|
|
3823
3831
|
};
|
|
3824
3832
|
function Mo(n, a) {
|
|
3825
3833
|
return n.reduce(function(t, e) {
|
|
@@ -3828,18 +3836,18 @@ function Mo(n, a) {
|
|
|
3828
3836
|
var p = [].concat(l);
|
|
3829
3837
|
a && p.indexOf(a) === -1 && p.push(a), t.apply(this, p), e.apply(this, p);
|
|
3830
3838
|
};
|
|
3831
|
-
},
|
|
3839
|
+
}, Dd);
|
|
3832
3840
|
}
|
|
3833
|
-
var
|
|
3841
|
+
var Pd = typeof window < "u" ? St : de;
|
|
3834
3842
|
function ga(n) {
|
|
3835
3843
|
var a = xe(n);
|
|
3836
|
-
return
|
|
3844
|
+
return Pd(function() {
|
|
3837
3845
|
a.current = n;
|
|
3838
3846
|
}), U(function() {
|
|
3839
3847
|
return a.current.apply(void 0, arguments);
|
|
3840
3848
|
}, []);
|
|
3841
3849
|
}
|
|
3842
|
-
var Mn,
|
|
3850
|
+
var Mn, _i = X(function(n, a) {
|
|
3843
3851
|
var t = n.children, e = n.className, r = n.autoHideDuration, l = n.disableWindowBlurListener, c = l !== void 0 && l, p = n.onClose, i = n.id, s = n.open, d = n.SnackbarProps, x = d === void 0 ? {} : d, g = xe(), m = ga(function() {
|
|
3844
3852
|
p && p.apply(void 0, arguments);
|
|
3845
3853
|
}), u = ga(function(f) {
|
|
@@ -3861,24 +3869,24 @@ var Mn, Vi = X(function(n, a) {
|
|
|
3861
3869
|
if (!c && s) return window.addEventListener("focus", y), window.addEventListener("blur", b), function() {
|
|
3862
3870
|
window.removeEventListener("focus", y), window.removeEventListener("blur", b);
|
|
3863
3871
|
};
|
|
3864
|
-
}, [c, y, s]),
|
|
3872
|
+
}, [c, y, s]), ke("div", Object.assign({ ref: a }, x, { className: Vt(kd, e), onMouseEnter: function(f) {
|
|
3865
3873
|
x.onMouseEnter && x.onMouseEnter(f), b();
|
|
3866
3874
|
}, onMouseLeave: function(f) {
|
|
3867
3875
|
x.onMouseLeave && x.onMouseLeave(f), y();
|
|
3868
3876
|
} }), t);
|
|
3869
3877
|
});
|
|
3870
|
-
|
|
3871
|
-
var
|
|
3878
|
+
_i.displayName = "Snackbar";
|
|
3879
|
+
var Rd = Bo({ root: (Mn = { display: "flex", flexWrap: "wrap", flexGrow: 1 }, Mn[Qo] = { flexGrow: "initial", minWidth: "288px" }, Mn) }), ar = X(function(n, a) {
|
|
3872
3880
|
var t = n.className, e = Oo(n, ["className"]);
|
|
3873
|
-
return
|
|
3881
|
+
return ae.createElement("div", Object.assign({ ref: a, className: Vt(Rd.root, t) }, e));
|
|
3874
3882
|
});
|
|
3875
3883
|
ar.displayName = "SnackbarContent";
|
|
3876
|
-
var ko = Bo({ root: { backgroundColor: "#313131", fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em", color: "#fff", alignItems: "center", padding: "6px 16px", borderRadius: "4px", boxShadow: "0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)" }, lessPadding: { paddingLeft: "20px" }, default: { backgroundColor: "#313131" }, success: { backgroundColor: "#43a047" }, error: { backgroundColor: "#d32f2f" }, warning: { backgroundColor: "#ff9800" }, info: { backgroundColor: "#2196f3" }, message: { display: "flex", alignItems: "center", padding: "8px 0" }, action: { display: "flex", alignItems: "center", marginLeft: "auto", paddingLeft: "16px", marginRight: "-8px" } }), fa = "notistack-snackbar",
|
|
3884
|
+
var ko = Bo({ root: { backgroundColor: "#313131", fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em", color: "#fff", alignItems: "center", padding: "6px 16px", borderRadius: "4px", boxShadow: "0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)" }, lessPadding: { paddingLeft: "20px" }, default: { backgroundColor: "#313131" }, success: { backgroundColor: "#43a047" }, error: { backgroundColor: "#d32f2f" }, warning: { backgroundColor: "#ff9800" }, info: { backgroundColor: "#2196f3" }, message: { display: "flex", alignItems: "center", padding: "8px 0" }, action: { display: "flex", alignItems: "center", marginLeft: "auto", paddingLeft: "16px", marginRight: "-8px" } }), fa = "notistack-snackbar", Ui = X(function(n, a) {
|
|
3877
3885
|
var t = n.id, e = n.message, r = n.action, l = n.iconVariant, c = n.variant, p = n.hideIconVariant, i = n.style, s = n.className, d = l[c], x = r;
|
|
3878
|
-
return typeof x == "function" && (x = x(t)),
|
|
3886
|
+
return typeof x == "function" && (x = x(t)), ae.createElement(ar, { ref: a, role: "alert", "aria-describedby": fa, style: i, className: Vt(Cd, Td(c), ko.root, ko[c], s, !p && d && ko.lessPadding) }, ae.createElement("div", { id: fa, className: ko.message }, p ? null : d, e), x && ae.createElement("div", { className: ko.action }, x));
|
|
3879
3887
|
});
|
|
3880
|
-
|
|
3881
|
-
var Co, Nn, qo, Ko, Fn,
|
|
3888
|
+
Ui.displayName = "MaterialDesignContent";
|
|
3889
|
+
var Co, Nn, qo, Ko, Fn, Md = q(Ui), Nd = Bo({ wrappedRoot: { width: "100%", position: "relative", transform: "translateX(0)", top: 0, right: 0, bottom: 0, left: 0, minWidth: "288px" } }), Fd = function(n) {
|
|
3882
3890
|
var a = xe(), t = _(!0), e = t[0], r = t[1], l = Mo([n.snack.onClose, n.onClose]), c = U(function() {
|
|
3883
3891
|
a.current = setTimeout(function() {
|
|
3884
3892
|
r(function(T) {
|
|
@@ -3891,7 +3899,7 @@ var Co, Nn, qo, Ko, Fn, Rd = q(_i), Md = Bo({ wrappedRoot: { width: "100%", posi
|
|
|
3891
3899
|
a.current && clearTimeout(a.current);
|
|
3892
3900
|
};
|
|
3893
3901
|
}, []);
|
|
3894
|
-
var p, i = n.snack, s = n.classes, d = n.Component, x = d === void 0 ?
|
|
3902
|
+
var p, i = n.snack, s = n.classes, d = n.Component, x = d === void 0 ? Md : d, g = W(function() {
|
|
3895
3903
|
return (function(T) {
|
|
3896
3904
|
T === void 0 && (T = {});
|
|
3897
3905
|
var P = { containerRoot: !0, containerAnchorOriginTopCenter: !0, containerAnchorOriginBottomCenter: !0, containerAnchorOriginTopRight: !0, containerAnchorOriginBottomRight: !0, containerAnchorOriginTopLeft: !0, containerAnchorOriginBottomLeft: !0 };
|
|
@@ -3899,29 +3907,29 @@ var Co, Nn, qo, Ko, Fn, Rd = q(_i), Md = Bo({ wrappedRoot: { width: "100%", posi
|
|
|
3899
3907
|
return !P[R];
|
|
3900
3908
|
}).reduce(function(R, k) {
|
|
3901
3909
|
var E;
|
|
3902
|
-
return
|
|
3910
|
+
return De({}, R, ((E = {})[k] = T[k], E));
|
|
3903
3911
|
}, {});
|
|
3904
3912
|
})(s);
|
|
3905
|
-
}, [s]), m = i.open, u = i.SnackbarProps, b = i.TransitionComponent, y = i.TransitionProps, f = i.transitionDuration, h = i.disableWindowBlurListener, w = i.content, v = Oo(i, ["open", "SnackbarProps", "TransitionComponent", "TransitionProps", "transitionDuration", "disableWindowBlurListener", "content", "entered", "requestClose", "onEnter", "onEntered", "onExit", "onExited"]), S =
|
|
3913
|
+
}, [s]), m = i.open, u = i.SnackbarProps, b = i.TransitionComponent, y = i.TransitionProps, f = i.transitionDuration, h = i.disableWindowBlurListener, w = i.content, v = Oo(i, ["open", "SnackbarProps", "TransitionComponent", "TransitionProps", "transitionDuration", "disableWindowBlurListener", "content", "entered", "requestClose", "onEnter", "onEntered", "onExit", "onExited"]), S = De({ direction: (p = v.anchorOrigin, p.horizontal !== "center" ? ha[p.horizontal] : ha[p.vertical]), timeout: f }, y), C = w;
|
|
3906
3914
|
typeof C == "function" && (C = C(v.id, v.message));
|
|
3907
3915
|
var D = ["onEnter", "onEntered", "onExit", "onExited"].reduce(function(T, P) {
|
|
3908
3916
|
var R;
|
|
3909
|
-
return
|
|
3917
|
+
return De({}, T, ((R = {})[P] = Mo([n.snack[P], n[P]], v.id), R));
|
|
3910
3918
|
}, {});
|
|
3911
|
-
return
|
|
3919
|
+
return ae.createElement(Vi, { in: e, onExited: D.onExited }, ae.createElement(_i, { open: m, id: v.id, disableWindowBlurListener: h, autoHideDuration: v.autoHideDuration, className: Vt(Nd.wrappedRoot, g.root, g[Ed(v.anchorOrigin)]), SnackbarProps: u, onClose: l }, ae.createElement(b, Object.assign({}, S, { appear: !0, in: m, onExit: D.onExit, onExited: c, onEnter: D.onEnter, onEntered: Mo([D.onEntered, function() {
|
|
3912
3920
|
n.snack.requestClose && l(null, "instructed", n.snack.id);
|
|
3913
|
-
}], v.id) }), C ||
|
|
3914
|
-
}, To = { default: 20 }, Xo = { default: 6, dense: 2 }, ba = "." +
|
|
3915
|
-
var a = n.classes, t = a === void 0 ? {} : a, e = n.anchorOrigin, r = n.dense, l = n.children, c = Vt(
|
|
3916
|
-
return
|
|
3921
|
+
}], v.id) }), C || ae.createElement(x, Object.assign({}, v)))));
|
|
3922
|
+
}, To = { default: 20 }, Xo = { default: 6, dense: 2 }, ba = "." + $i, Yo = Bo({ root: (Co = { boxSizing: "border-box", display: "flex", maxHeight: "100%", position: "fixed", zIndex: 1400, height: "auto", width: "auto", transition: eo(["top", "right", "bottom", "left", "max-width"], { duration: 300, easing: "ease" }), pointerEvents: "none" }, Co[ba] = { padding: Xo.default + "px 0px", transition: "padding 300ms ease 0ms" }, Co.maxWidth = "calc(100% - " + 2 * To.default + "px)", Co[Pn] = { width: "100%", maxWidth: "calc(100% - 32px)" }, Co), rootDense: (Nn = {}, Nn[ba] = { padding: Xo.dense + "px 0px" }, Nn), top: { top: To.default - Xo.default + "px", flexDirection: "column" }, bottom: { bottom: To.default - Xo.default + "px", flexDirection: "column-reverse" }, left: (qo = { left: To.default + "px" }, qo[Qo] = { alignItems: "flex-start" }, qo[Pn] = { left: "16px" }, qo), right: (Ko = { right: To.default + "px" }, Ko[Qo] = { alignItems: "flex-end" }, Ko[Pn] = { right: "16px" }, Ko), center: (Fn = { left: "50%", transform: "translateX(-50%)" }, Fn[Qo] = { alignItems: "center" }, Fn) }), Od = q(function(n) {
|
|
3923
|
+
var a = n.classes, t = a === void 0 ? {} : a, e = n.anchorOrigin, r = n.dense, l = n.children, c = Vt(vd, Yo[e.vertical], Yo[e.horizontal], Yo.root, t.containerRoot, t["containerAnchorOrigin" + nr(e)], r && Yo.rootDense);
|
|
3924
|
+
return ae.createElement("div", { className: c }, l);
|
|
3917
3925
|
}), xa = function(n) {
|
|
3918
3926
|
return !(typeof n == "string" || qn(n));
|
|
3919
|
-
},
|
|
3927
|
+
}, Bd = (function(n) {
|
|
3920
3928
|
function a(t) {
|
|
3921
3929
|
var e;
|
|
3922
3930
|
return (e = n.call(this, t) || this).enqueueSnackbar = function(r, l) {
|
|
3923
3931
|
if (l === void 0 && (l = {}), r == null) throw new Error("enqueueSnackbar called with invalid argument");
|
|
3924
|
-
var c = xa(r) ? r : l, p = xa(r) ? r.message : r, i = c.key, s = c.preventDuplicate, d = Oo(c, ["key", "preventDuplicate"]), x = _o(i), g = x ? i : (/* @__PURE__ */ new Date()).getTime() + Math.random(), m =
|
|
3932
|
+
var c = xa(r) ? r : l, p = xa(r) ? r.message : r, i = c.key, s = c.preventDuplicate, d = Oo(c, ["key", "preventDuplicate"]), x = _o(i), g = x ? i : (/* @__PURE__ */ new Date()).getTime() + Math.random(), m = Sd(d, e.props), u = De({ id: g }, d, { message: p, open: !0, entered: !1, requestClose: !1, persist: m("persist"), action: m("action"), content: m("content"), variant: m("variant"), anchorOrigin: m("anchorOrigin"), disableWindowBlurListener: m("disableWindowBlurListener"), autoHideDuration: m("autoHideDuration"), hideIconVariant: m("hideIconVariant"), TransitionComponent: m("TransitionComponent"), transitionDuration: m("transitionDuration"), TransitionProps: m("TransitionProps", !0), iconVariant: m("iconVariant", !0), style: m("style", !0), SnackbarProps: m("SnackbarProps", !0), className: Vt(e.props.className, d.className) });
|
|
3925
3933
|
return u.persist && (u.autoHideDuration = void 0), e.setState(function(b) {
|
|
3926
3934
|
if (s === void 0 && e.props.preventDuplicate || s) {
|
|
3927
3935
|
var y = function(w) {
|
|
@@ -3929,13 +3937,13 @@ var Co, Nn, qo, Ko, Fn, Rd = q(_i), Md = Bo({ wrappedRoot: { width: "100%", posi
|
|
|
3929
3937
|
}, f = b.queue.findIndex(y) > -1, h = b.snacks.findIndex(y) > -1;
|
|
3930
3938
|
if (f || h) return b;
|
|
3931
3939
|
}
|
|
3932
|
-
return e.handleDisplaySnack(
|
|
3940
|
+
return e.handleDisplaySnack(De({}, b, { queue: [].concat(b.queue, [u]) }));
|
|
3933
3941
|
}), g;
|
|
3934
3942
|
}, e.handleDisplaySnack = function(r) {
|
|
3935
3943
|
return r.snacks.length >= e.maxSnack ? e.handleDismissOldest(r) : e.processQueue(r);
|
|
3936
3944
|
}, e.processQueue = function(r) {
|
|
3937
3945
|
var l = r.queue, c = r.snacks;
|
|
3938
|
-
return l.length > 0 ?
|
|
3946
|
+
return l.length > 0 ? De({}, r, { snacks: [].concat(c, [l[0]]), queue: l.slice(1, l.length) }) : r;
|
|
3939
3947
|
}, e.handleDismissOldest = function(r) {
|
|
3940
3948
|
if (r.snacks.some(function(i) {
|
|
3941
3949
|
return !i.open || i.requestClose;
|
|
@@ -3945,14 +3953,14 @@ var Co, Nn, qo, Ko, Fn, Rd = q(_i), Md = Bo({ wrappedRoot: { width: "100%", posi
|
|
|
3945
3953
|
return i + (s.open && s.persist ? 1 : 0);
|
|
3946
3954
|
}, 0) === e.maxSnack && (c = !0);
|
|
3947
3955
|
var p = r.snacks.map(function(i) {
|
|
3948
|
-
return l || i.persist && !c ?
|
|
3956
|
+
return l || i.persist && !c ? De({}, i) : (l = !0, i.entered ? (i.onClose && i.onClose(null, "maxsnack", i.id), e.props.onClose && e.props.onClose(null, "maxsnack", i.id), De({}, i, { open: !1 })) : De({}, i, { requestClose: !0 }));
|
|
3949
3957
|
});
|
|
3950
|
-
return
|
|
3958
|
+
return De({}, r, { snacks: p });
|
|
3951
3959
|
}, e.handleEnteredSnack = function(r, l, c) {
|
|
3952
3960
|
if (!_o(c)) throw new Error("handleEnteredSnack Cannot be called with undefined key");
|
|
3953
3961
|
e.setState(function(p) {
|
|
3954
3962
|
return { snacks: p.snacks.map(function(i) {
|
|
3955
|
-
return i.id === c ?
|
|
3963
|
+
return i.id === c ? De({}, i, { entered: !0 }) : De({}, i);
|
|
3956
3964
|
}) };
|
|
3957
3965
|
});
|
|
3958
3966
|
}, e.handleCloseSnack = function(r, l, c) {
|
|
@@ -3961,7 +3969,7 @@ var Co, Nn, qo, Ko, Fn, Rd = q(_i), Md = Bo({ wrappedRoot: { width: "100%", posi
|
|
|
3961
3969
|
e.setState(function(i) {
|
|
3962
3970
|
var s = i.snacks, d = i.queue;
|
|
3963
3971
|
return { snacks: s.map(function(x) {
|
|
3964
|
-
return p || x.id === c ? x.entered ?
|
|
3972
|
+
return p || x.id === c ? x.entered ? De({}, x, { open: !1 }) : De({}, x, { requestClose: !0 }) : De({}, x);
|
|
3965
3973
|
}), queue: d.filter(function(x) {
|
|
3966
3974
|
return x.id !== c;
|
|
3967
3975
|
}) };
|
|
@@ -3974,33 +3982,33 @@ var Co, Nn, qo, Ko, Fn, Rd = q(_i), Md = Bo({ wrappedRoot: { width: "100%", posi
|
|
|
3974
3982
|
}, e.handleExitedSnack = function(r, l) {
|
|
3975
3983
|
if (!_o(l)) throw new Error("handleExitedSnack Cannot be called with undefined key");
|
|
3976
3984
|
e.setState(function(c) {
|
|
3977
|
-
var p = e.processQueue(
|
|
3985
|
+
var p = e.processQueue(De({}, c, { snacks: c.snacks.filter(function(i) {
|
|
3978
3986
|
return i.id !== l;
|
|
3979
3987
|
}) }));
|
|
3980
3988
|
return p.queue.length === 0 ? p : e.handleDismissOldest(p);
|
|
3981
3989
|
});
|
|
3982
3990
|
}, e.enqueueSnackbar, e.closeSnackbar, e.state = { snacks: [], queue: [], contextValue: { enqueueSnackbar: e.enqueueSnackbar.bind(la(e)), closeSnackbar: e.closeSnackbar.bind(la(e)) } }, e;
|
|
3983
3991
|
}
|
|
3984
|
-
return
|
|
3992
|
+
return Li(a, n), a.prototype.render = function() {
|
|
3985
3993
|
var t = this, e = this.state.contextValue, r = this.props, l = r.domRoot, c = r.children, p = r.dense, i = p !== void 0 && p, s = r.Components, d = s === void 0 ? {} : s, x = r.classes, g = this.state.snacks.reduce(function(u, b) {
|
|
3986
3994
|
var y, f = nr(b.anchorOrigin), h = u[f] || [];
|
|
3987
|
-
return
|
|
3995
|
+
return De({}, u, ((y = {})[f] = [].concat(h, [b]), y));
|
|
3988
3996
|
}, {}), m = Object.keys(g).map(function(u) {
|
|
3989
3997
|
var b = g[u], y = b[0];
|
|
3990
|
-
return
|
|
3991
|
-
return
|
|
3998
|
+
return ae.createElement(Od, { key: u, dense: i, anchorOrigin: y.anchorOrigin, classes: x }, b.map(function(f) {
|
|
3999
|
+
return ae.createElement(Fd, { key: f.id, snack: f, classes: x, Component: d[f.variant], onClose: t.handleCloseSnack, onEnter: t.props.onEnter, onExit: t.props.onExit, onExited: Mo([t.handleExitedSnack, t.props.onExited], f.id), onEntered: Mo([t.handleEnteredSnack, t.props.onEntered], f.id) });
|
|
3992
4000
|
}));
|
|
3993
4001
|
});
|
|
3994
|
-
return
|
|
3995
|
-
},
|
|
4002
|
+
return ae.createElement(zi.Provider, { value: e }, c, l ? Ps(m, l) : m);
|
|
4003
|
+
}, Ii(a, [{ key: "maxSnack", get: function() {
|
|
3996
4004
|
return this.props.maxSnack || At.maxSnack;
|
|
3997
4005
|
} }]), a;
|
|
3998
|
-
})(
|
|
3999
|
-
return
|
|
4006
|
+
})(Yl), Gi = function() {
|
|
4007
|
+
return Kl(zi);
|
|
4000
4008
|
};
|
|
4001
|
-
const
|
|
4002
|
-
class
|
|
4003
|
-
constructor(a =
|
|
4009
|
+
const Ad = [{ key: "SheetXL", description: "SheetXL", mimeType: ".sxl", exts: ["sxl"], handler: null, isDefault: !0 }, { key: "CSV", description: "Comma Delimited", mimeType: "text/csv", exts: ["csv"], handler: null }, { key: "Excel", description: "Excel Workbook", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", exts: ["xlsx", "xls", "xlsm"], handler: null }], Id = [{ key: "SheetXL", mimeType: "application/vnd.sheetxl.sheet", description: "SheetXL", ext: "sxl", handler: null, isDefault: !0 }, { key: "CSV", mimeType: "text/csv", description: "Comma Delimited", ext: "csv", handler: null }, { key: "Excel", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", description: "Excel Workbook", ext: "xlsx", tags: ["SheetJS Pro"], handler: null }];
|
|
4010
|
+
class Ld {
|
|
4011
|
+
constructor(a = Ad, t = Id) {
|
|
4004
4012
|
this._readFormatType = [], this._writeFormatType = [], this._readFormatType = Object.freeze([...a]), this._writeFormatType = Object.freeze([...t]);
|
|
4005
4013
|
}
|
|
4006
4014
|
getReadFormats() {
|
|
@@ -4041,24 +4049,24 @@ class Id {
|
|
|
4041
4049
|
}
|
|
4042
4050
|
}
|
|
4043
4051
|
}
|
|
4044
|
-
const Lt = new
|
|
4045
|
-
const { id: t, message: e, iconVariant: r, error: l, hideIconVariant: c, ...p } = n, { closeSnackbar: i } =
|
|
4052
|
+
const Lt = new Ld(), ut = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, qi = q(X((n, a) => {
|
|
4053
|
+
const { id: t, message: e, iconVariant: r, error: l, hideIconVariant: c, ...p } = n, { closeSnackbar: i } = Gi(), s = Ke(), [d, x] = _(!1), g = Rs.collectErrorChain(l, !0)?.[0]?.error, m = g && !(g instanceof Ms), u = U(() => {
|
|
4046
4054
|
x((f) => !f);
|
|
4047
4055
|
}, []), b = U(() => {
|
|
4048
4056
|
i(t);
|
|
4049
4057
|
}, [t, i]);
|
|
4050
4058
|
let y = g?.message;
|
|
4051
|
-
return !y && qn(e) && (y = e), y || typeof e != "string" || (y = e), y || (y = `Unknown Error: ${e}`), o(ar, { ref: a, className:
|
|
4059
|
+
return !y && qn(e) && (y = e), y || typeof e != "string" || (y = e), y || (y = `Unknown Error: ${e}`), o(ar, { ref: a, className: Te(ut.root, "error-snackbar"), children: H(ts, { className: ut.card, style: { backgroundColor: s.palette.error.dark, border: `1px solid ${s.palette.error.dark}` }, children: [H(os, { className: ut.actionRoot, children: [c ? null : r?.error, o(Pe, { variant: "body2", component: "div", className: ut.typography, children: y }), o("div", { style: { flex: "1 1 auto" } }), H("div", { className: ut.icons, children: [m ? o(st, { "aria-label": "Show more", size: "small", className: Te(ut.expand, { [ut.expandOpen]: d }), onClick: u, children: o(he, { iconKey: "ExpandMore" }) }) : null, o(st, { size: "small", className: ut.expand, onClick: b, children: o(he, { iconKey: "Close", style: { transform: "scale(0.8)" } }) })] })] }), m ? o(ns, { in: d, timeout: "auto", children: o("div", { className: ut.stackTraceContainer, style: { backgroundColor: s.palette.error.light, borderTop: `1px solid ${s.palette.error.main}` }, children: o(ms, { error: l, hideLineNumbers: !0 }) }) }) : null] }) });
|
|
4052
4060
|
}));
|
|
4053
|
-
|
|
4054
|
-
const
|
|
4061
|
+
qi.displayName = "ToastError";
|
|
4062
|
+
const Ki = q(X((n, a) => {
|
|
4055
4063
|
const { commands: t, commandHook: e, scope: r = "workbook", disabled: l = !1, ...c } = n, p = Y((s) => {
|
|
4056
|
-
const d = { variant:
|
|
4064
|
+
const d = { variant: re.Menuitem, parentFloat: s.floatReference, commandHook: e, scope: r, disabled: l }, x = H(le, { children: [o(N, { ...d, command: t.getCommand("newWorkbook") }), o(Q, { orientation: "horizontal" }), o(N, { ...d, command: t.getCommand("openWorkbook") }), o(Se, { ...d, commands: t, quickCommand: "saveWorkbook", createPopupPanel: (g) => {
|
|
4057
4065
|
const m = { ...d, parentFloat: g.floatReference, scope: "saveWorkbook" }, u = [];
|
|
4058
4066
|
return Lt.getWriteFormats().forEach((b) => {
|
|
4059
4067
|
if (b.isDefault) return;
|
|
4060
4068
|
const y = b.key, f = t.getCommand(`saveWorkbookAs${y}`);
|
|
4061
|
-
f ? u.push(
|
|
4069
|
+
f ? u.push(ke(N, { ...m, key: y, command: f })) : console.warn(`Unable to resolve command: 'saveWorkbookAs${y}'`);
|
|
4062
4070
|
}), ge({ ...g, children: u, onClick: () => {
|
|
4063
4071
|
g.closeFloatAll();
|
|
4064
4072
|
} });
|
|
@@ -4067,54 +4075,54 @@ const qi = q(X((n, a) => {
|
|
|
4067
4075
|
g.isDefaultPrevented || s.closeFloatAll();
|
|
4068
4076
|
} });
|
|
4069
4077
|
}, [l, t, e, r]), i = "File";
|
|
4070
|
-
return o(
|
|
4078
|
+
return o(Se, { commands: t, disabled: l, commandHook: e, scope: r, label: i, tooltip: "Options for saving and loading the workbook.", sx: { paddingBottom: "0px", "& button": { paddingTop: "0px", paddingBottom: "0px", height: (s) => `calc(1.25rem + ${s.spacing(2)}px)` } }, ...c, createPopupPanel: p, icon: o(nn, { className: "label", icon: null, label: i }) });
|
|
4071
4079
|
}));
|
|
4072
|
-
|
|
4073
|
-
const
|
|
4080
|
+
Ki.displayName = "StandaloneFileCommandButton";
|
|
4081
|
+
const zd = o(nt, { label: "SheetXL", description: "Visit me at sheetxl.com.", children: o(B, { sx: { width: "24px", height: "24px", marginBottom: "4px", marginLeft: "6px" }, children: o(Vl, { onClick: () => {
|
|
4074
4082
|
window?.open("https://www.sheetxl.com", "_blank");
|
|
4075
|
-
}, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }),
|
|
4076
|
-
const { commands: t, workbook: e, logo: r =
|
|
4083
|
+
}, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), Xi = q(X((n, a) => {
|
|
4084
|
+
const { commands: t, workbook: e, logo: r = zd, mainElement: l, showFileMenu: c = !0, showAppearanceMenu: p = !0, ...i } = n, { reference: s } = ao(), [d, { width: x }] = zt(), g = x < 530, m = c ? o(Ki, { commands: t, commandHook: { beforeExecute() {
|
|
4077
4085
|
s?.closeAll();
|
|
4078
4086
|
}, onError(f, h, w) {
|
|
4079
|
-
} } }) : null, u = p ? o(
|
|
4087
|
+
} } }) : null, u = p ? o(nd, { commands: t, commandHook: { beforeExecute() {
|
|
4080
4088
|
s?.closeAll();
|
|
4081
4089
|
}, onError(f, h, w) {
|
|
4082
4090
|
} } }) : null, b = W(() => ({ paddingLeft: (f) => f.spacing(1), paddingRight: (f) => f.spacing(1) }), []), y = xe(null);
|
|
4083
|
-
return o(B, { ref: $t([y, d, a]), ...i, children:
|
|
4091
|
+
return o(B, { ref: $t([y, d, a]), ...i, children: Ti({ commands: t, renderCompact: g, workbook: e, selectWrapper: (f) => H(B, { sx: { display: "flex", flex: "1", flexDirection: "row", alignItems: "stretch", gap: (h) => h.spacing(1), paddingLeft: (h) => h.spacing(1), paddingRight: (h) => h.spacing(1) }, children: [H(B, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (h) => h.spacing(0.5) }, children: [r, H(B, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (h) => h.spacing(0.25) }, children: [m, f] })] }), o(B, { sx: { display: "flex", flexDirection: "row", flex: "1 1 300%", overflow: "hidden", alignItems: "center", justifyContent: "center" }, children: l }), o(B, { sx: { display: "flex", alignItems: "center", justifyContent: "end", flex: g && !u ? "0 0 auto" : "1 1 100%" }, children: u })] }), selectProps: b, toolbarsProps: { Home: { sx: {} } } }) });
|
|
4084
4092
|
}));
|
|
4085
|
-
|
|
4086
|
-
const
|
|
4093
|
+
Xi.displayName = "StudioToolbar";
|
|
4094
|
+
const Yi = q((n) => {
|
|
4087
4095
|
const { workbook: a, setWorkbook: t, refWorkbookTitle: e, titleWorkbook: r, setWorkbookTitle: l, titlePlaceHolder: c, children: p, undoManager: i, commands: s, importExportDisabled: d, themeOptions: x } = n, g = ((b) => {
|
|
4088
4096
|
const { workbook: y, setWorkbook: f, importExportDisabled: h, workbookTitle: w = "export", setWorkbookTitle: v, requestWorkbookTitle: S, themeOptions: C, undoManager: D, commands: T, onExecute: P } = b, R = sn(), k = Y(C?.onModeChange, [C?.onModeChange]), E = Y(C?.onEnabledDarkGridChange, [C?.onEnabledDarkGridChange]), M = Y(C?.onEnabledDarkImagesChange, [C?.onEnabledDarkImagesChange]), I = Y(async (j = null, K = null) => {
|
|
4089
4097
|
const ee = [];
|
|
4090
4098
|
let V, A = null, Z = null;
|
|
4091
4099
|
if (typeof j == "string" ? Z = j : A = j, V = A ? j : await to.openFileDialog(Z ?? Lt.getAllReadFormatTypeAsString().join(",")), !V) return null;
|
|
4092
|
-
const oe = { source: V, createWorkbookOptions: K, onWarning: (
|
|
4093
|
-
ee.push(
|
|
4094
|
-
} },
|
|
4100
|
+
const oe = { source: V, createWorkbookOptions: K, onWarning: (ve) => {
|
|
4101
|
+
ee.push(ve);
|
|
4102
|
+
} }, Be = await Lt.read(oe, R);
|
|
4095
4103
|
return ee.length > 0 && (R.showMessage("Some elements were not able to be imported. See console for details."), console.warn(`Import warnings:
|
|
4096
4104
|
` + ee.join(`
|
|
4097
|
-
`))),
|
|
4098
|
-
}, [P, R, y]),
|
|
4105
|
+
`))), Be;
|
|
4106
|
+
}, [P, R, y]), F = Y(async (j, K, ee) => {
|
|
4099
4107
|
if (!K && S) {
|
|
4100
4108
|
const V = await S("Enter Workbook name to " + (ee.isDefault ? "Save." : `Export as ${ee.description}.`));
|
|
4101
4109
|
return V !== null && Lt.writeFile(V, j, { formatType: ee.key });
|
|
4102
4110
|
}
|
|
4103
4111
|
return Lt.writeFile(K, j, { formatType: ee.key });
|
|
4104
4112
|
}, [R, y, S]), L = U(() => ({ contains: (j) => !0, focus() {
|
|
4105
|
-
} }), []),
|
|
4113
|
+
} }), []), O = W(() => {
|
|
4106
4114
|
const j = [];
|
|
4107
4115
|
h || (Lt.getWriteFormats().forEach((ee) => {
|
|
4108
4116
|
const V = ee.isDefault, A = { label: V ? "Save Workbook" : `Save Workbook as ${ee.description}`, scopedLabels: { workbook: "Save", saveWorkbook: `as ${ee.description}` }, tags: ee.tags, description: `Save the workbook to the desktop${V ? "" : ` as ${ee.description}`}.`, icon: "FileDownloadAsSheet" };
|
|
4109
4117
|
V && (A.shortcut = { key: "S", modifiers: [fe.Ctrl] }, j.push(new be("saveWorkbookAs", L, { label: "Save Workbook As…", scopedLabels: { workbook: "Save as…", saveWorkbook: "as…" }, shortcut: [{ key: "S", modifiers: [fe.Shift, fe.Ctrl] }, { key: "F12" }], description: "Save the workbook to the desktop with the provided name." }, () => {
|
|
4110
|
-
|
|
4111
|
-
R.showError(
|
|
4118
|
+
F(y, null, ee).catch((Be) => {
|
|
4119
|
+
R.showError(Be);
|
|
4112
4120
|
});
|
|
4113
4121
|
})));
|
|
4114
4122
|
const Z = ee.key, oe = V ? "saveWorkbook" : `saveWorkbookAs${Z}`;
|
|
4115
|
-
Z === "CSV" ? A.icon = "FileDownloadAsCSV" : Z === "Excel" && (A.icon = "FileDownloadAsExcel"), j.push(new be(oe, L, A, (
|
|
4116
|
-
|
|
4117
|
-
R.showError(
|
|
4123
|
+
Z === "CSV" ? A.icon = "FileDownloadAsCSV" : Z === "Excel" && (A.icon = "FileDownloadAsExcel"), j.push(new be(oe, L, A, (Be) => {
|
|
4124
|
+
F(y, Be ?? w, ee).catch((ve) => {
|
|
4125
|
+
R.showError(ve);
|
|
4118
4126
|
});
|
|
4119
4127
|
}));
|
|
4120
4128
|
}), j.push(new be("openWorkbook", L, { label: "Open Workbook…", scopedLabels: { workbook: "Open…" }, description: "Open a workbook from the desktop.", icon: "FileOpen", shortcut: { key: "O", modifiers: [fe.Ctrl] } }, async (ee = null) => {
|
|
@@ -4122,14 +4130,14 @@ const Xi = q((n) => {
|
|
|
4122
4130
|
try {
|
|
4123
4131
|
const A = await I(ee, V);
|
|
4124
4132
|
if (!A) return;
|
|
4125
|
-
const Z = A.title, oe = A.workbook,
|
|
4133
|
+
const Z = A.title, oe = A.workbook, Be = oe.getSelectedSheet();
|
|
4126
4134
|
if (A.formatType.mimeType === "text/csv") {
|
|
4127
|
-
const
|
|
4135
|
+
const ve = y.findValidSheetName(Z);
|
|
4128
4136
|
await y.doBatch(async () => {
|
|
4129
|
-
const
|
|
4130
|
-
let
|
|
4131
|
-
if (!
|
|
4132
|
-
|
|
4137
|
+
const Ne = { colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 };
|
|
4138
|
+
let _e = Be.getUsedRange();
|
|
4139
|
+
if (!_e) return void R.showMessage("The file appears to be blank.");
|
|
4140
|
+
_e = _e.getUnion(Ne), await y.getSheets().add({ name: ve, autoSelect: !0 }).getRange(Ne).copyFrom(_e);
|
|
4133
4141
|
}, `Import CSV '${Z}'`);
|
|
4134
4142
|
} else y?.close(), v?.(Z), f(oe);
|
|
4135
4143
|
} catch (A) {
|
|
@@ -4157,51 +4165,51 @@ const Xi = q((n) => {
|
|
|
4157
4165
|
})];
|
|
4158
4166
|
}, [y, w, R, h, C, T, D]), z = W(() => {
|
|
4159
4167
|
let j = null;
|
|
4160
|
-
return j = T ? T.createChildGroup(L, "standaloneWorkbook", !1) : new Jn(L, "standaloneWorkbook"), j.addCommands(
|
|
4161
|
-
}, [T,
|
|
4162
|
-
|
|
4163
|
-
const
|
|
4168
|
+
return j = T ? T.createChildGroup(L, "standaloneWorkbook", !1) : new Jn(L, "standaloneWorkbook"), j.addCommands(O, !0), j;
|
|
4169
|
+
}, [T, O]);
|
|
4170
|
+
ks({ manager: D, commands: z });
|
|
4171
|
+
const ie = Da("(prefers-color-scheme: dark)"), { themeMode: J } = Ra();
|
|
4164
4172
|
de(() => {
|
|
4165
4173
|
if (!C || !z) return;
|
|
4166
|
-
const j = C.mode === "dark" || !C.mode &&
|
|
4174
|
+
const j = C.mode === "dark" || !C.mode && J === "dark";
|
|
4167
4175
|
z.getCommand("themeMode").update({ state: C.mode ?? null, label: j ? "Dark Mode" : "Light Mode", scopedLabels: { appearance: j ? "Dark Mode" : "Light Mode" }, icon: j ? "DarkMode" : "LightMode" }).updateCallback(() => {
|
|
4168
4176
|
k(j ? Bn.Light : Bn.Dark);
|
|
4169
|
-
}), z.getCommand("defaultThemeMode").update({ state: !C.mode, icon:
|
|
4177
|
+
}), z.getCommand("defaultThemeMode").update({ state: !C.mode, icon: ie ? "SystemDefaultDarkMode" : "SystemDefaultLightMode" }).updateCallback(() => {
|
|
4170
4178
|
k(null);
|
|
4171
4179
|
}), z.getCommand("enableDarkGrid").update({ state: C.enableDarkGrid }).updateCallback(() => {
|
|
4172
4180
|
E(!C.enableDarkGrid);
|
|
4173
4181
|
}), z.getCommand("enableDarkImages").update({ state: C.enableDarkImages }).updateCallback(() => {
|
|
4174
4182
|
M(!C.enableDarkImages);
|
|
4175
4183
|
});
|
|
4176
|
-
}, [
|
|
4177
|
-
const { showModal:
|
|
4184
|
+
}, [J, C, O]);
|
|
4185
|
+
const { showModal: pe } = hs();
|
|
4178
4186
|
return de(() => {
|
|
4179
4187
|
const j = () => new Promise((K, ee) => {
|
|
4180
|
-
const V =
|
|
4188
|
+
const V = ae.lazy(() => import("./BkLdZhD76b4clcIe.mjs")), A = pe(V, { title: "Shortcut Keys Reference", commands: z, onDone: () => {
|
|
4181
4189
|
A.hide();
|
|
4182
4190
|
}, slotProps: { transition: { onExited: () => {
|
|
4183
4191
|
K(!0);
|
|
4184
4192
|
} } } });
|
|
4185
4193
|
});
|
|
4186
4194
|
z.getCommand("showKeyboardShortcuts").updateCallback(() => j()), z.getCommand("help").updateCallback(() => j());
|
|
4187
|
-
}, [
|
|
4195
|
+
}, [O, z]), z;
|
|
4188
4196
|
})({ workbook: a, setWorkbook: t, importExportDisabled: d, workbookTitle: r, setWorkbookTitle: l, commands: s, requestWorkbookTitle: (b) => new Promise((y) => {
|
|
4189
4197
|
e.current ? e.current.requestWorkbookTitle((f, h) => {
|
|
4190
4198
|
y(f);
|
|
4191
4199
|
}, { selectAll: !0, requestReason: b }) : y(c);
|
|
4192
4200
|
}), themeOptions: x, undoManager: i, onExecute: U(() => {
|
|
4193
|
-
}, []) }), m = W(() => o(
|
|
4194
|
-
return a && (u.statusBarProps = { childrenEnd: m }), p ?
|
|
4201
|
+
}, []) }), m = W(() => o(rd, { commands: g, disableHover: !0, sx: { padding: "0" }, buttonProps: { sx: { maxHeight: "22px" } } }), [g]), u = { commands: g };
|
|
4202
|
+
return a && (u.statusBarProps = { childrenEnd: m }), p ? ae.cloneElement(p, u) : null;
|
|
4195
4203
|
});
|
|
4196
|
-
|
|
4197
|
-
const
|
|
4198
|
-
const { children: a } = n, t =
|
|
4204
|
+
Yi.displayName = "CommandsWrapper";
|
|
4205
|
+
const Zi = q((n) => {
|
|
4206
|
+
const { children: a } = n, t = Gi(), e = t ? t.enqueueSnackbar : () => {
|
|
4199
4207
|
}, r = t ? t.closeSnackbar : () => {
|
|
4200
4208
|
}, [l, c] = _({ isMounted: !1, label: null, starting: /* @__PURE__ */ new Map(), running: /* @__PURE__ */ new Map() }), p = U(() => {
|
|
4201
4209
|
c((f) => ({ ...f, isMounted: !0 }));
|
|
4202
4210
|
}, []), i = U(() => {
|
|
4203
4211
|
c((f) => ({ ...f, isMounted: !1 }));
|
|
4204
|
-
}, []), s = {}, d =
|
|
4212
|
+
}, []), s = {}, d = gs(s), x = fs(s), g = bs(s), m = xe(/* @__PURE__ */ new Set()), u = W(() => {
|
|
4205
4213
|
const f = (v, S) => {
|
|
4206
4214
|
if (S?.onceKey) {
|
|
4207
4215
|
if (m.current.has(S.onceKey)) return;
|
|
@@ -4223,11 +4231,11 @@ const Yi = q((n) => {
|
|
|
4223
4231
|
const D = { ...S, onKeyDown: (T) => {
|
|
4224
4232
|
T.isDefaultPrevented() || T.isPropagationStopped() || S?.onKeyDown?.(T);
|
|
4225
4233
|
} };
|
|
4226
|
-
return d(v, { sort: () => import("./
|
|
4234
|
+
return d(v, { sort: () => import("./8ySqzQ-18kdZCc_T.mjs"), numberFormat: () => import("./DeBXIHYAvBBDeuyl.mjs"), hyperlink: () => import("./CrxCbPC8OsPYiu18.mjs"), comments: () => import("./vrN0FWxqEeg1-vWU.mjs"), find: () => import("./CusJChXpaPfoicnm.mjs"), tableNew: () => import("./YpJtXAhMACxtW1Rk.mjs"), namedDetails: () => import("./Bx_qMvcXcJ9rsRW0.mjs") }[v], D, C);
|
|
4227
4235
|
}, showOptions: x, showInputOptions: g, showError: (v) => {
|
|
4228
4236
|
let S, C = wt.Error, D = "Unknown Error";
|
|
4229
|
-
typeof v == "string" ? D = v : v instanceof Error && (S = v, v.message && (D = v.message)), v instanceof
|
|
4230
|
-
} }, w = new
|
|
4237
|
+
typeof v == "string" ? D = v : v instanceof Error && (S = v, v.message && (D = v.message)), v instanceof Ns && (C = wt.Info), f(D, { type: C, enqueueProps: { error: S } });
|
|
4238
|
+
} }, w = new Cs();
|
|
4231
4239
|
return w.setOverrides(h), w;
|
|
4232
4240
|
}, []);
|
|
4233
4241
|
de(() => {
|
|
@@ -4246,77 +4254,77 @@ const Yi = q((n) => {
|
|
|
4246
4254
|
}, [l]);
|
|
4247
4255
|
const [b, y] = _(null);
|
|
4248
4256
|
return de(() => {
|
|
4249
|
-
l.starting.size !== 0 || l.running.size !== 0 ? y(o(Wt, { icon: o(
|
|
4250
|
-
}, [l.starting, l.running]), H(
|
|
4257
|
+
l.starting.size !== 0 || l.running.size !== 0 ? y(o(Wt, { icon: o(xs, { sx: { transform: "scale(0.7)", marginLeft: "-6px" } }), panel: !0, label: l.label, onMount: p, onUnmount: i, sx: { position: "absolute", left: "0", top: "0", width: "100%", height: "100%", zIndex: "9999" } })) : y(null);
|
|
4258
|
+
}, [l.starting, l.running]), H(Ts, { notifier: u, children: [b, a] });
|
|
4251
4259
|
});
|
|
4252
|
-
|
|
4253
|
-
const
|
|
4260
|
+
Zi.displayName = "SnackbarWrapper";
|
|
4261
|
+
const Hd = q(X((n, a) => {
|
|
4254
4262
|
const { children: t, title: e, taskPanes: r, onSelect: l, selected: c, registry: p = Un, style: i, iconsOnly: s, className: d, ...x } = n, g = W(() => r.map((b) => {
|
|
4255
4263
|
const y = p.getRegisteredTaskPane(b);
|
|
4256
4264
|
if (!y) return null;
|
|
4257
4265
|
let f = y.getIcon?.();
|
|
4258
4266
|
f && (typeof f == "string" && (f = o(he, { iconKey: f })), f = o("span", { style: { display: "inline-block", transform: "rotate(90deg)", transformOrigin: "center" }, children: f }));
|
|
4259
4267
|
const h = b === c;
|
|
4260
|
-
return o(Ea, { value: b, label: o(vt, { disableInteractive: !0, title: y.getTitle() ?? "", placement: "left-start", children: H(B, { sx: { padding: "0px 0px", writingMode: "vertical-rl", textOrientation: "mixed", display: "flex", alignItems: "center", justifyContent: "space-between", minWidth: "0px", color: (w) => w.palette.text.secondary }, children: [f && o(B, { sx: { display: "inline-block", transformOrigin: "center", color: (w) => w.palette.text.secondary }, children: f }), s && f ? null : o(
|
|
4261
|
-
}), [r, c, l, p]), m = Ct(a, () => ({ isTaskPaneStrip: () => !0 }), []), u = W(() =>
|
|
4268
|
+
return o(Ea, { value: b, label: o(vt, { disableInteractive: !0, title: y.getTitle() ?? "", placement: "left-start", children: H(B, { sx: { padding: "0px 0px", writingMode: "vertical-rl", textOrientation: "mixed", display: "flex", alignItems: "center", justifyContent: "space-between", minWidth: "0px", color: (w) => w.palette.text.secondary }, children: [f && o(B, { sx: { display: "inline-block", transformOrigin: "center", color: (w) => w.palette.text.secondary }, children: f }), s && f ? null : o(Pe, { component: "div", textTransform: "none", sx: { padding: "4px 0px", color: (w) => h ? w.palette.primary.main : w.palette.text.secondary }, children: y.getTitle() })] }) }), sx: { padding: "4px 4px", minWidth: "0px", minHeight: "0px", borderRadius: "4px" }, className: Te("taskpane-strip-item", { "Mui-selected": h }), onClick: () => n.onSelect(b) }, b);
|
|
4269
|
+
}), [r, c, l, p]), m = Ct(a, () => ({ isTaskPaneStrip: () => !0 }), []), u = W(() => Te("taskpane-strip", d), [d]);
|
|
4262
4270
|
return o(B, { ref: m, className: u, sx: { paddingLeft: "2px", paddingTop: "4px", ...i }, ...x, children: o(Ta, { orientation: "vertical", variant: "scrollable", value: c, onChange: (b, y) => {
|
|
4263
4271
|
l(y);
|
|
4264
4272
|
}, slotProps: { list: { sx: { gap: "2px" } }, indicator: { sx: { left: "0px", right: "unset" } } }, children: g }) });
|
|
4265
|
-
})),
|
|
4266
|
-
const { commands: t, model: e, ...r } = n, l =
|
|
4267
|
-
return o(
|
|
4273
|
+
})), Wd = (n, a) => o(Hd, { ref: a, ...n }), jd = ae.forwardRef((n, a) => {
|
|
4274
|
+
const { commands: t, model: e, ...r } = n, l = Ke(), c = `solid ${ye(l.palette.divider, 0.2)} 1px`, p = `${l.shape.borderRadius ?? 4}px`, i = `${l.spacing?.(0.5) ?? 4}px`, s = xe(null);
|
|
4275
|
+
return o(_l, { model: e, ref: a, frameProps: { style: { border: c, borderRadius: p, marginBottom: i } }, alwaysShowStrip: !0, renderTaskPanelTitle: (d, x) => {
|
|
4268
4276
|
const { title: g, icon: m, onClose: u, readOnly: b, focused: y, ...f } = d;
|
|
4269
|
-
return o(
|
|
4277
|
+
return o(rs, { className: Te({ "Mui-selected": y }), sx: { display: "flex", flex: "1 1 %0", color: (h) => h.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: (h) => `${h.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: (h) => h.transitions.duration.shortest / 2 + "ms" }, backgroundColor: (h) => ye(h.palette.action.hover, 0.03), borderBottom: (h) => `solid ${ye(h.palette.divider, 0.2)} 1px` }, ...f, children: H(B, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: (h) => h.spacing(0.25), marginBottom: (h) => h.spacing(0.25), marginLeft: (h) => h.spacing(1), marginRight: (h) => h.spacing(1) }, children: [o(B, { sx: { flex: "1 1 100%", paddingLeft: (h) => h.spacing(1) }, children: g }), o(nt, { label: "Close", children: o(st, { "aria-label": "close", sx: { color: (h) => h.palette.text.icon ?? h.palette.action.active }, touchRippleRef: s, onPointerDown: (h) => {
|
|
4270
4278
|
s.current?.start(h, { center: !1 }), h.stopPropagation(), h.preventDefault();
|
|
4271
4279
|
}, onPointerUp: () => {
|
|
4272
4280
|
u();
|
|
4273
4281
|
}, children: o(he, { iconKey: "Close" }) }) })] }) });
|
|
4274
|
-
}, renderTaskPaneStrip:
|
|
4282
|
+
}, renderTaskPaneStrip: Wd, ...n, onOpen: () => {
|
|
4275
4283
|
n?.onOpen?.();
|
|
4276
4284
|
}, onClose: () => {
|
|
4277
4285
|
n?.onClose?.();
|
|
4278
4286
|
}, commands: t, ...r });
|
|
4279
|
-
}), ya = { flex: "1 1 100%", display: "flex", boxSizing: "border-box" },
|
|
4280
|
-
const { mainElement: t, sidebarElement: e, className: r, style: l, ...c } = n, p =
|
|
4287
|
+
}), ya = { flex: "1 1 100%", display: "flex", boxSizing: "border-box" }, Qi = q(X((n, a) => {
|
|
4288
|
+
const { mainElement: t, sidebarElement: e, className: r, style: l, ...c } = n, p = Ke(), [i, { width: s }] = zt(), d = s > 530 || s === 0, x = xe(null);
|
|
4281
4289
|
let g = null, m = 4, u = 13;
|
|
4282
4290
|
return d ? g = "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" : (g = "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", m = 13, u = 4), o(Qn, { ref: $t([x, i, a]), className: r, style: l ? { ...ya, ...l } : ya, ...c, fixedPane: "after", position: "40%", minAfter: d ? "280px" : "120px", splitDirection: d ? "row" : "column", resizerProps: { className: "styled-resizer", style: { minWidth: d ? "6px" : void 0, minHeight: d ? void 0 : "6px", maskImage: `url("data:image/svg+xml,%3Csvg width='${m}' height='${u}' viewBox='0 0 ${m} ${u}' version='1.1' fill='${p.palette.text.icon ?? p.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${g}' /%3E%3C/svg%3E%0A")`, maskRepeat: "no-repeat", maskPosition: d ? "left center" : "top center" } }, elementBefore: t, paneBeforeProps: { style: { flexDirection: "column", marginRight: e ? void 0 : "6px" } }, elementAfter: e, paneAfterProps: { style: { marginLeft: d ? "0px" : "4px", marginRight: d ? "8px" : "4px" } } });
|
|
4283
4291
|
}));
|
|
4284
|
-
|
|
4285
|
-
Ma.register("plugin-scripts", { icons: {} }), Un.registerTaskPane({ key: "scriptEditor", getTitle: () => "Script (Typescript)", getIcon: () => "ScriptRun", renderTaskPane:
|
|
4292
|
+
Qi.displayName = "StudioSplitPane";
|
|
4293
|
+
Ma.register("plugin-scripts", { icons: {} }), Un.registerTaskPane({ key: "scriptEditor", getTitle: () => "Script (Typescript)", getIcon: () => "ScriptRun", renderTaskPane: Fc }, !0);
|
|
4286
4294
|
const $n = q(X((n, a) => {
|
|
4287
|
-
const { className: t, sx: e, style: r, onElementLoad: l, onError: c, undoManager: p, errorPanel: i =
|
|
4295
|
+
const { className: t, sx: e, style: r, onElementLoad: l, onError: c, undoManager: p, errorPanel: i = ys, onKeyDown: s, workbook: d, createWorkbookOptions: x, onWorkbookChange: g, logo: m, importExportDisabled: u = !1, themeOptions: b, autoFocus: y = !1, commands: f, title: h, onTitleChange: w, titleProps: v, renderLoadingPanel: S, ...C } = n, D = xe(null), T = Y(g, [g]), P = Y(w ?? v?.onTitleChange, [w ?? v?.onTitleChange]), R = v?.placeHolder ?? "Untitled", k = b?.mode, { themeMode: E, source: M } = Ra({ mode: k }), I = W(() => ({ ...b, light: kr(!1, to.deepMerge(b?.theme ?? {}, b?.light ?? {})), dark: kr(!0, to.deepMerge(b?.theme ?? {}, b?.dark ?? {})) }), [b]), F = E === Bn.Dark, [L, O] = _(null);
|
|
4288
4296
|
de(() => {
|
|
4289
|
-
|
|
4297
|
+
O(p ?? new Fs());
|
|
4290
4298
|
}, [p]);
|
|
4291
|
-
const [z,
|
|
4299
|
+
const [z, ie] = _(null), [J, pe] = _(null), j = Gn();
|
|
4292
4300
|
St(() => {
|
|
4293
4301
|
if (!d || Object.keys(d).length === 0 && !to.isPromiseLike(d)) {
|
|
4294
4302
|
const te = { theme: j.getDefaultTheme(), ...x };
|
|
4295
|
-
|
|
4296
|
-
} else
|
|
4303
|
+
pe(new On(te));
|
|
4304
|
+
} else pe(d);
|
|
4297
4305
|
}, [d]), St(() => {
|
|
4298
|
-
if (
|
|
4299
|
-
if (
|
|
4306
|
+
if (J) {
|
|
4307
|
+
if (J instanceof On) return ie({ workbook: J }), void (d !== J && T?.(J));
|
|
4300
4308
|
(async () => {
|
|
4301
4309
|
try {
|
|
4302
|
-
let te,
|
|
4303
|
-
|
|
4310
|
+
let te, Ce = await Promise.resolve(J);
|
|
4311
|
+
Ce && Ce.source && (Ce = await Lt.read(Ce)), Ce.workbook ? (Z(Ce.title), te = Ce.workbook) : te = Ce, T?.(te), ie({ workbook: te });
|
|
4304
4312
|
} catch (te) {
|
|
4305
|
-
T?.(null),
|
|
4313
|
+
T?.(null), ie({ error: te });
|
|
4306
4314
|
}
|
|
4307
4315
|
})();
|
|
4308
4316
|
}
|
|
4309
|
-
}, [
|
|
4317
|
+
}, [J]);
|
|
4310
4318
|
const [K, ee] = _(null);
|
|
4311
4319
|
de(() => {
|
|
4312
4320
|
if (!L || !z) return;
|
|
4313
4321
|
L.clear();
|
|
4314
4322
|
const te = z?.workbook?.getTransactions();
|
|
4315
4323
|
if (te)
|
|
4316
|
-
return te.addListener({ onCommitEnd: (
|
|
4317
|
-
|
|
4318
|
-
te.restore(
|
|
4319
|
-
}) }) : console.warn("commit has no description",
|
|
4324
|
+
return te.addListener({ onCommitEnd: (Ce) => {
|
|
4325
|
+
Ce.getDescription() ? L.addUndoOperation({ description: Ce.getDescription(), undo: () => (te.revert(Ce.getId()), K.source?.focus(), () => {
|
|
4326
|
+
te.restore(Ce.getId()), K.source?.focus();
|
|
4327
|
+
}) }) : console.warn("commit has no description", Ce);
|
|
4320
4328
|
} });
|
|
4321
4329
|
}, [L, z, K]);
|
|
4322
4330
|
const V = Y((te) => {
|
|
@@ -4327,24 +4335,24 @@ const $n = q(X((n, a) => {
|
|
|
4327
4335
|
}, [h ?? v?.title]), de(() => {
|
|
4328
4336
|
P?.(A);
|
|
4329
4337
|
}, [A]);
|
|
4330
|
-
const [oe,
|
|
4331
|
-
const te = () => ({ contains: (
|
|
4338
|
+
const [oe, Be] = _(null), ve = W(() => {
|
|
4339
|
+
const te = () => ({ contains: (Ce) => !0, focus() {
|
|
4332
4340
|
} });
|
|
4333
4341
|
return f ? f.createChildGroup(te, "application", !1) : new Jn(te, "application");
|
|
4334
|
-
}, [f]),
|
|
4335
|
-
|
|
4336
|
-
}, [
|
|
4342
|
+
}, [f]), Ne = Y(async (te) => {
|
|
4343
|
+
Be(te.source.getViewportElement()), ee(te), ve.activate("sheet"), await Ma.prefetch(), l?.(te);
|
|
4344
|
+
}, [ve]);
|
|
4337
4345
|
de(() => {
|
|
4338
4346
|
K && y && K.source?.focus(typeof y == "object" ? y : void 0);
|
|
4339
4347
|
}, [K]);
|
|
4340
|
-
const
|
|
4341
|
-
let
|
|
4342
|
-
return v?.hidden || (
|
|
4348
|
+
const _e = xe(null), Ve = U((te) => {
|
|
4349
|
+
let Ce = null;
|
|
4350
|
+
return v?.hidden || (Ce = o(Ni, { ...v, style: { maxWidth: "100%", ...v?.style }, workbook: D.current, ref: _e, title: A, placeHolder: R, onTitleChange: (Tt) => {
|
|
4343
4351
|
Z(Tt);
|
|
4344
|
-
} })), o(
|
|
4345
|
-
}, [m, A, v, I, u,
|
|
4352
|
+
} })), o(Xi, { ...te, logo: m, mainElement: Ce, showFileMenu: !u, showAppearanceMenu: !!(I?.onEnabledDarkGridChange || I?.onEnabledDarkImagesChange || I?.onModeChange) });
|
|
4353
|
+
}, [m, A, v, I, u, ve]);
|
|
4346
4354
|
de(() => {
|
|
4347
|
-
const te = (
|
|
4355
|
+
const te = (Ce) => Ce.preventDefault();
|
|
4348
4356
|
return D.current?.addEventListener("wheel", te, { passive: !1 }), () => {
|
|
4349
4357
|
D.current?.removeEventListener("wheel", te);
|
|
4350
4358
|
};
|
|
@@ -4352,104 +4360,105 @@ const $n = q(X((n, a) => {
|
|
|
4352
4360
|
const ne = W(() => {
|
|
4353
4361
|
const te = { transparentBackground: !0 };
|
|
4354
4362
|
return o(B, { sx: e, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, display: "flex", alignItems: "center", justifyContent: "center", ...r }, children: S?.(te) ?? o(Wt, { ...te }) });
|
|
4355
|
-
}, [e, r, S]), G = U(({ error: te }) => (c?.(te), o(i, { sx: e, style: r, error: te ?? "Unable to display empty workbook." })), [e, r, c]), se = W(() => ({ ...e, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-SnackbarContainer > div": { maxWidth: "100%" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (te) => te.palette.getContrastText(te.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (te) => te.palette.getContrastText(te.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (te) => te.palette.getContrastText(te.palette.error.main) }, "& .notistack-MuiContent *": { fontFamily: (te) => te.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [e]), [
|
|
4363
|
+
}, [e, r, S]), G = U(({ error: te }) => (c?.(te), o(i, { sx: e, style: r, error: te ?? "Unable to display empty workbook." })), [e, r, c]), se = W(() => ({ ...e, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-SnackbarContainer > div": { maxWidth: "100%" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (te) => te.palette.getContrastText(te.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (te) => te.palette.getContrastText(te.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (te) => te.palette.getContrastText(te.palette.error.main) }, "& .notistack-MuiContent *": { fontFamily: (te) => te.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [e]), [Re, qe] = _(null), Ee = U((te, Ce) => o(jd, { ref: Ce, model: J, commands: ve, ...te }), [ve, J]), rt = U((te) => o(Qi, { mainElement: te, sidebarElement: Re }), [Re]), Xe = $t([D, a]), dt = W(() => {
|
|
4356
4364
|
if (!z) return ne;
|
|
4357
4365
|
if (z.error || !z.workbook) return G({ error: z.error });
|
|
4358
|
-
let te = null,
|
|
4359
|
-
return I && (te =
|
|
4366
|
+
let te = null, Ce = null, Tt = !1;
|
|
4367
|
+
return I && (te = F ? I.dark : I.light, Ce = F && I.enableDarkGrid ? I.dark : I.light, Tt = I.enableDarkImages), o(Mi, { sx: se, style: r, tabIndex: 0, autoFocus: !0, workbook: z.workbook, ref: Xe, renderToolbar: Ve, onElementLoad: Ne, onRepeatCommandChange: V, onKeyDown: (io) => {
|
|
4360
4368
|
s?.(io);
|
|
4361
|
-
}, renderLoadingPanel: S, gridTheme:
|
|
4362
|
-
}, [z, A, L, ne, S, I, C,
|
|
4363
|
-
let
|
|
4369
|
+
}, renderLoadingPanel: S, gridTheme: Ce, headersTheme: te, enableDarkImages: Tt, mainWrapper: rt, className: Te(t), onContextMenu: (io) => io.preventDefault(), ...C }, "WorkbookElement");
|
|
4370
|
+
}, [z, A, L, ne, S, I, C, Ve, se, rt]);
|
|
4371
|
+
let Me = o(Bd, { maxSnack: 3, domRoot: oe, anchorOrigin: { vertical: "bottom", horizontal: "right" }, autoHideDuration: 3500, onClose: (te, Ce, Tt) => {
|
|
4364
4372
|
D.current?.focus();
|
|
4365
|
-
}, Components: { error:
|
|
4373
|
+
}, Components: { error: qi }, iconVariant: { success: o(ka, { 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(he, { iconKey: "ErrorAlert", style: { marginRight: "8px" } }) }, children: o(Ul, { createArea: Ee, onUpdateArea: (te) => {
|
|
4366
4374
|
qe(te);
|
|
4367
|
-
}, children: o(
|
|
4368
|
-
return I && (
|
|
4375
|
+
}, children: o(ws, { children: o(Zi, { children: o(Es, { children: o(Ds, { children: o(Yi, { workbook: z?.workbook, setWorkbook: pe, importExportDisabled: u, titlePlaceHolder: R, titleWorkbook: A, setWorkbookTitle: Z, refWorkbookTitle: _e, commands: ve, undoManager: L, themeOptions: I, children: dt }) }) }) }) }) }) });
|
|
4376
|
+
return I && (Me = H(Na, { theme: F ? I.dark : I.light, children: [I.cssBaseline ? o(as, {}) : null, Me] })), Me;
|
|
4369
4377
|
}));
|
|
4370
4378
|
$n.displayName = "EagerStudio";
|
|
4371
|
-
const
|
|
4379
|
+
const $d = Object.freeze(Object.defineProperty({ __proto__: null, EagerStudio: $n, default: $n }, Symbol.toStringTag, { value: "Module" }));
|
|
4372
4380
|
export {
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4381
|
+
Vs as $,
|
|
4382
|
+
Fi as A,
|
|
4383
|
+
qs as B,
|
|
4384
|
+
Ws as C,
|
|
4385
|
+
od as D,
|
|
4386
|
+
nd as E,
|
|
4387
|
+
Xs as F,
|
|
4388
|
+
rd as G,
|
|
4389
|
+
Os as H,
|
|
4390
|
+
vi as I,
|
|
4391
|
+
or as J,
|
|
4392
|
+
Oi as K,
|
|
4393
|
+
id as L,
|
|
4394
|
+
Ks as M,
|
|
4395
|
+
Ka as N,
|
|
4396
|
+
Gs as O,
|
|
4397
|
+
ja as P,
|
|
4398
|
+
Tr as Q,
|
|
4399
|
+
Xa as R,
|
|
4400
|
+
sd as S,
|
|
4401
|
+
As as T,
|
|
4402
|
+
Ha as U,
|
|
4403
|
+
Bs as V,
|
|
4404
|
+
ac as W,
|
|
4405
|
+
Us as X,
|
|
4406
|
+
Ls as Y,
|
|
4407
|
+
Ro as Z,
|
|
4400
4408
|
Ln as _,
|
|
4401
4409
|
Vt as a,
|
|
4402
|
-
|
|
4403
|
-
|
|
4410
|
+
er as a0,
|
|
4411
|
+
Oa as a1,
|
|
4404
4412
|
bc as a2,
|
|
4405
4413
|
xc as a3,
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4414
|
+
yc as a4,
|
|
4415
|
+
Za as a5,
|
|
4416
|
+
Ya as a6,
|
|
4417
|
+
ri as a7,
|
|
4418
|
+
ni as a8,
|
|
4419
|
+
ai as a9,
|
|
4420
|
+
Pc as aa,
|
|
4421
|
+
_a as ab,
|
|
4422
|
+
cc as ac,
|
|
4423
|
+
uc as ad,
|
|
4424
|
+
ap as ae,
|
|
4417
4425
|
ii as af,
|
|
4418
4426
|
li as ag,
|
|
4419
|
-
|
|
4420
|
-
|
|
4427
|
+
si as ah,
|
|
4428
|
+
rp as ai,
|
|
4421
4429
|
Mi as aj,
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4430
|
+
Ni as ak,
|
|
4431
|
+
Pi as al,
|
|
4432
|
+
Di as am,
|
|
4425
4433
|
zc as an,
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4434
|
+
Hc as ao,
|
|
4435
|
+
Zr as ap,
|
|
4436
|
+
$n as aq,
|
|
4437
|
+
Ld as ar,
|
|
4438
|
+
Lt as as,
|
|
4430
4439
|
In as b,
|
|
4431
4440
|
Do as c,
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4441
|
+
di as d,
|
|
4442
|
+
Te as e,
|
|
4443
|
+
Is as f,
|
|
4444
|
+
np as g,
|
|
4445
|
+
Ys as h,
|
|
4446
|
+
Zs as i,
|
|
4447
|
+
Qs as j,
|
|
4439
4448
|
Ba as k,
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4449
|
+
Js as l,
|
|
4450
|
+
Aa as m,
|
|
4451
|
+
Ia as n,
|
|
4452
|
+
La as o,
|
|
4453
|
+
ec as p,
|
|
4454
|
+
za as q,
|
|
4446
4455
|
cn as r,
|
|
4447
|
-
|
|
4448
|
-
|
|
4456
|
+
op as s,
|
|
4457
|
+
No as t,
|
|
4449
4458
|
zt as u,
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4459
|
+
tc as v,
|
|
4460
|
+
oc as w,
|
|
4461
|
+
nc as x,
|
|
4462
|
+
rc as y,
|
|
4463
|
+
lc as z
|
|
4455
4464
|
};
|