@sheetxl/studio-mui 0.7.3 → 0.7.4
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/{CZHpYokIrB9or1kO.cjs → B6o1iQp5wuulPhxo.cjs} +1 -1
- package/browser/cjs/BCNKSDS1DahImiBd.cjs +20 -0
- package/browser/cjs/{BDBuN2H9gI8rbqch.cjs → BY1UZBLCxYes25sM.cjs} +1 -1
- package/browser/cjs/{7yf1jDRYBQhJ0IgK.cjs → BY3gQcuJkcK9yhlk.cjs} +2 -2
- package/browser/cjs/BrJIDDxcCb7loSqZ.cjs +6 -0
- package/browser/cjs/{fI8eQSgm9DnQdoqc.cjs → CflDY3SthBCQg-9F.cjs} +2 -2
- package/browser/cjs/{CF7gN1Im2OZf0fyo.cjs → D5l5wPl8rDYzrVey.cjs} +3 -3
- package/browser/cjs/{Ba3EaCxs0-PYJOHF.cjs → DwzNkpi_T8XJi3Cd.cjs} +1 -1
- package/browser/cjs/{Dd1ymyZnhRrMyk8W.cjs → HfdfBnRHde6LrsMc.cjs} +1 -1
- package/browser/cjs/{CzhsFl-yeDRYp_Ya.cjs → hRcxITGib5rp_kTW.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{BNAv-1KD4Z-JBGmo.cjs → qd_yuub025U26HmN.cjs} +1 -1
- package/browser/cjs/{Ezgivppjg0YGYuvk.cjs → yETr27p_AmaFufvo.cjs} +2 -2
- package/browser/esm/{CxbwDisnGiU8Bvfq.mjs → BMrxZUxFZxs_TprK.mjs} +3 -3
- package/browser/esm/{B4c9bY5iEhIRTeFI.mjs → BXa5jJK06vkHLfz_.mjs} +8 -6
- package/browser/esm/{CbQfO8yuXsD7zfKt.mjs → BqypjhYAei9BoIkg.mjs} +2 -2
- package/browser/esm/{UJcz7qfMj06BWj1Q.mjs → C-TjWH0Ll_dg6TXG.mjs} +1 -1
- package/browser/esm/{BMhsxJPTT2oY70z6.mjs → C43cFXvNQttM0tuv.mjs} +1 -1
- package/browser/esm/{C0QRYjn9bQqR1KnO.mjs → CX5p76lvGB80Gn7j.mjs} +1 -1
- package/browser/esm/{D3NThHe3w_O4Ry0D.mjs → CwE4P36bJkqx4fG2.mjs} +1 -1
- package/browser/esm/{B3OGepFJek3nMUlQ.mjs → DDCO6hne0WaKAsyz.mjs} +2 -2
- package/browser/esm/{BXTb14FHzlnPLAEW.mjs → DUTXM-jsPX1poBAb.mjs} +2 -2
- package/browser/esm/{QHLyYFH_hFJn_CdF.mjs → DpeZ0TCk2XtCsW7D.mjs} +2 -2
- package/browser/esm/{C-WOTbexGZdqA0Cy.mjs → UKbQrJIwqIMUQ4dz.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/zTa4aYOOiAsmWpM1.mjs +4489 -0
- package/node/esm/{CcEBSVCCtyGC6XWd.mjs → C0x0sq_I7hdqCuBB.mjs} +1 -1
- package/node/esm/{GfnfhO-RSN3U1QDI.mjs → CdEdm8ItFMvEzr0O.mjs} +1 -1
- package/node/esm/{CE_wDNQHtTFRFwNO.mjs → DUoSsHJRuVxAeHW-.mjs} +1 -1
- package/node/esm/{KhHu7gqlchpl2exi.mjs → DhjwHPKOhF-WGawL.mjs} +1 -1
- package/node/esm/{B01n_q5SspvjsTcc.mjs → DmbC0_ocWCB60DUY.mjs} +1 -1
- package/node/esm/DuFKPKejduTq6L6F.mjs +65 -0
- package/node/esm/{e-hAbNYacz5nXfrX.mjs → VjNnErE5lO5hNix_.mjs} +1 -1
- package/node/esm/{MlWMmDWfx1ohpoCK.mjs → g5IsTuP_M7p1bN41.mjs} +1 -1
- package/node/esm/index.mjs +604 -604
- package/node/esm/{BsnCGCG5NtyDT_bI.mjs → nZVauB5xkNLVTaod.mjs} +1 -1
- package/node/esm/{D616RGpnOfCKxE7k.mjs → x7VDppl2hKDhIcfj.mjs} +1 -1
- package/package.json +8 -8
- package/types/index.d.ts +4 -11
- package/browser/cjs/HhHqaDWuILzt1AKC.cjs +0 -20
- package/browser/cjs/MdZLRo_iiKExSIs7.cjs +0 -6
- package/browser/esm/DoO4MKoQT5HuPymy.mjs +0 -4489
- package/node/esm/B_ltyNSEkQayBgVo.mjs +0 -63
package/node/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.4
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -14,20 +14,20 @@ import { Box as X, Typography as Z, IconButton as J, MenuItem as Y, Divider as Q
|
|
|
14
14
|
import { themeIcon as we, CommandButton as ke, ExhibitDivider as Se, FormatIndentDecreaseIcon as Ce, FormatIndentIncreaseIcon as ve, defaultCreatePopupPanel as Te, CommandPopupButton as De, TextVerticalTopIcon as Pe, TextVerticalCenterIcon as Re, TextVerticalBottomIcon as Me, TextHorizontalOverflowIcon as Fe, TextHorizontalWrapIcon as Be, TextHorizontalClipIcon as Ne, TextHorizontalShrinkIcon as Ee, TextRotation315Icon as Ae, TextRotation45Icon as Ie, TextRotation90Icon as Le, TextRotation2702Icon as He, TextRotationCustomIcon as We, TextRotation0Icon as ze, InputCommandButton as $e, SimpleTooltip as Oe, LoadingPanel as Ve, PopupButtonType as Ge, ExhibitPopupIconButton as Ue, ExhibitPopupMenuItem as je, ColorizedCircleIcon as _e, ExhibitMenuItem as qe, createStrokeShadowFilter as Ke, strokeShadowFilter as Xe, ColorizedStrokeIcon as Ze, ExhibitTooltip as Je, ExhibitIconButton as Ye, CommandTooltip as Qe, MergeAllIcon as et, MergeHorizontalIcon as tt, MergeVerticalIcon as ot, MergeUnMergeIcon as nt, FreezeBothIcon as at, FreezeRowsIcon as rt, FreezeColumnsIcon as lt, FreezeIcon as it, FindIcon as st, FindReplaceIcon as dt, GotoIcon as ct, TextSizeIncreaseIcon as mt, TextSizeDecreaseIcon as pt, SelectedIcon as ut, CurrencyDollarIcon as gt, PercentIcon as ht, CommaIcon as ft, IncreaseDecimalIcon2 as xt, DecreaseDecimalIcon2 as bt, ClearAllIcon as yt, ClearFormatsIcon as wt, ClearContentsIcon as kt, FillDownIcon as St, InsertCells as Ct, InsertRowIcon as vt, InsertColumn2Icon as Tt, BlankIcon as Dt, RemoveCellsIcon as Pt, RemoveRowIcon as Rt, RemoveColumn2Icon as Mt, LabelIcon as Ft, SortIncreaseIcon as Bt, SortDecreaseIcon as Nt, SortCustomIcon as Et, FilterToggleIcon as At, FilterClearIcon as It, FilterReapplyIcon as Lt, RedoIcon as Ht, UndoIcon as Wt, TextStrikeIcon as zt, TextSuperscriptIcon as $t, TextSubscriptIcon as Ot, TextUnderlineIcon as Vt, TextUnderlineDoubleIcon as Gt, TextUnderlineAccountingIcon as Ut, TextUnderlineAccountingDoubleIcon as jt, PasteIcon as _t, PasteValuesIcon as qt, PasteFormatsIcon as Kt, PasteFormulasIcon as Xt, PasteTransposeIcon as Zt, PasteLinksIcon as Jt, NewPresetStylesIcon as Yt, PresetStylesIcon as Qt, ExhibitMenuHeader as eo, ContextMenu as to, Theme2Icon as oo, SystemDefaultDarkMode as no, SystemDefaultLightMode as ao, GithubIcon as ro, DiscordIcon as lo, DocumentationIcon as io, TicketIcon as so, HelpIcon as co, InsertImageIcon as mo, WalkingCopyIcon as po, SimpleCommandPopupButton as uo, FunctionThinIcon as go, FunctionSumIcon as ho, FormulaGroupIcon as fo, FormulaFinancialIcon as xo, FormulaLogicalIcon as bo, FormulaTextIcon as yo, FormulaDateTimeIcon as wo, FormulaLookupReferenceIcon as ko, FormulaMathTrigIcon as So, FormulaStatisticalIcon as Co, FormulaEngineeringIcon as vo, FormulaInformationIcon as To, FormulaCubeIcon as Do, FormulaDatabaseIcon as Po, FormulaWebIcon as Ro, FormulaCustomIcon as Mo, ExhibitOptionButton as Fo, SelectRangeModeIcon as Bo, hexToRGB as No, useFloatStack as Eo, CellSelectionIcon as Ao, CellSelectionRemoveIcon as Io, CellSelectionEditIcon as Lo, InsertTableIcon as Ho, CellSelectionInsertIcon as Wo, CloseErrorIcon as zo, CheckSuccessIcon as $o, FunctionIcon as Oo, VisibilityOffIcon as Vo, elevateColor as Go, ThemedIcon as Uo, ScriptNewIcon as jo, ScriptFormulaIcon as _o, ScriptMacroIcon as qo, ScriptSaveIcon as Ko, CommandToolbar as Xo, CodeIcon as Zo, ScriptRunIcon as Jo, ColorizedTextIcon as Yo, ColorizedFillIcon as Qo, FormatPaintIcon as en, TextBoldIcon as tn, TextItalicIcon as on, InsertHyperlinkIcon as nn, InsertCommentIcon as an, FormulaViewIcon as rn, ViewZeroIcon as ln, FullScreenOffIcon as sn, FullScreenIcon as dn, createScrollEdgeButton as cn, createScrollEndButton as mn, createScrollStartButton as pn, HideColumnIcon as un, ShowColumnIcon as gn, HideRowIcon as hn, ShowRowIcon as fn, ColumnsResizeAutoIcon as xn, RowsResizeAutoIcon as bn, CutIcon as yn, DrawAspectIcon as wn, DrawAlignLeftIcon as kn, DrawResizeIcon as Sn, DrawAlignDistributeVertIcon as Cn, DrawAlignDistributeHorzIcon as vn, DrawAlignBottomIcon as Tn, DrawAlignMiddleIcon as Dn, DrawAlignTopIcon as Pn, DrawAlignRightIcon as Rn, DrawAlignCenterIcon as Mn, DrawMoveBackwardIcon as Fn, DrawToBackIcon as Bn, DrawMoveForwardIcon as Nn, DrawToFrontIcon as En, scrollbarTheming as An, StackTrace as In, FileNewIcon as Ln, FileOpenIcon as Hn, FileDownloadAsCSVIcon as Wn, FileDownloadAsExcelIcon as zn, FileDownloadAsSheetIcon as $n, useResolvedThemeMode as On, ThemeMode as Vn, useModal as Gn, useLazyWindow as Un, useOptionsDialog as jn, useInputDialog as _n, AnimatedTraversingEllipsisIcon as qn, ErrorPanel as Kn, createExhibitTheme as Xn, ModalProvider as Zn, ErrorAlertIcon as Jn } from "@sheetxl/utils-mui";
|
|
15
15
|
import Yn from "clsx";
|
|
16
16
|
import { FormatAlignLeft as Qn, FormatAlignCenter as ea, FormatAlignRight as ta, FormatAlignJustify as oa, Colorize as na, DarkMode as aa, LightMode as ra, Keyboard as la, Remove as ia, Add as sa, ExpandLess as da, ExpandMore as ca, Lock as ma, MoreHoriz as pa, WebhookOutlined as ua, Close as ga, AddCircleOutline as ha, Menu as fa, CancelOutlined as xa } from "@mui/icons-material";
|
|
17
|
-
import { useCommands as ba, CommandButtonType as ya, useCallbackRef as wa, ReactUtils as ka, KeyCodes as Sa, useCommand as Ca, useEditMode as va, useMouseDownAndHoldListener as Ta,
|
|
18
|
-
import { useTheme as
|
|
19
|
-
import { alpha as
|
|
20
|
-
import { useFormContext as
|
|
21
|
-
import { ResizableBox as
|
|
22
|
-
import { mergeRefs as
|
|
23
|
-
import { CommonUtils as
|
|
24
|
-
import { useMeasure as
|
|
25
|
-
import { CSSTransition as
|
|
26
|
-
import { useFullscreen as
|
|
27
|
-
import { IOUtils as
|
|
28
|
-
import { ErrorBoundary as
|
|
29
|
-
import { useSnackbar as
|
|
30
|
-
const
|
|
17
|
+
import { useCommands as ba, CommandButtonType as ya, useCallbackRef as wa, ReactUtils as ka, KeyCodes as Sa, useCommand as Ca, useEditMode as va, useMouseDownAndHoldListener as Ta, useNotifier as Da, NotifierType as Pa, useImperativeElement as Ra, SplitPane as Ma, RoundedTab as Fa, SimpleCommand as Ba, Command as Na, KeyModifiers as Ea, CommandGroup as Aa, ToolTipPlacement as Ia, ScrollPane as La, useUndoManager as Ha, DelegatingReactNotifier as Wa, NotifierProvider as za } from "@sheetxl/utils-react";
|
|
18
|
+
import { useTheme as $a, alpha as Oa, getOverlayAlpha as Va, ThemeProvider as Ga } from "@mui/material/styles";
|
|
19
|
+
import { alpha as Ua } from "@mui/system";
|
|
20
|
+
import { useFormContext as ja } from "react-hook-form";
|
|
21
|
+
import { ResizableBox as _a } from "react-resizable";
|
|
22
|
+
import { mergeRefs as qa } from "react-merge-refs";
|
|
23
|
+
import { CommonUtils as Ka, ChainedError as Xa, PartialError as Za, UndoManager as Ja } from "@sheetxl/utils";
|
|
24
|
+
import { useMeasure as Ya } from "react-use";
|
|
25
|
+
import { CSSTransition as Qa } from "react-transition-group";
|
|
26
|
+
import { useFullscreen as er } from "rooks";
|
|
27
|
+
import { IOUtils as tr } from "@sheetxl/io";
|
|
28
|
+
import { ErrorBoundary as or } from "react-error-boundary";
|
|
29
|
+
import { useSnackbar as nr, SnackbarContent as ar, SnackbarProvider as rr } from "notistack";
|
|
30
|
+
const lr = L(H((e2, t2) => {
|
|
31
31
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, parentFloat: l2, ...i2 } = e2, s2 = ba(o2, ["formatAlignLeftToggle", "formatAlignCenterToggle", "formatAlignRightToggle", "formatAlignJustifyToggle", "formatAlignCenterContinuousToggle", "formatAlignFillToggle", "formatAlignDistributedHorizontalToggle"]), d2 = W(() => {
|
|
32
32
|
for (let e3 = 0; e3 < s2.length; e3++) if (s2[e3]?.state()) return s2[e3].key();
|
|
33
33
|
return s2[0]?.key();
|
|
@@ -43,7 +43,7 @@ const nr = L(H((e2, t2) => {
|
|
|
43
43
|
return Te({ ...e3, children: d3 });
|
|
44
44
|
}, [r2, n2]);
|
|
45
45
|
return N(De, { ref: t2, parentFloat: l2, commands: o2, commandHook: n2, scope: a2, createPopupPanel: p2, label: "Horizontal Alignment", tooltip: "Configure how text is placed in the horizontal direction of the cell.", quickCommand: d2, icon: c2.get(d2) ?? N(Qn, {}), ...i2 });
|
|
46
|
-
})),
|
|
46
|
+
})), ir = L(H((e2, t2) => {
|
|
47
47
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["formatAlignTopToggle", "formatAlignMiddleToggle", "formatAlignBottomToggle", "formatAlignJustifyVerticalToggle", "formatAlignDistributedVerticalToggle"]), s2 = W(() => {
|
|
48
48
|
for (let e3 = 0; e3 < i2.length; e3++) if (i2[e3]?.state()) return i2[e3].key();
|
|
49
49
|
return i2[0]?.key();
|
|
@@ -55,7 +55,7 @@ const nr = L(H((e2, t2) => {
|
|
|
55
55
|
return Te({ ...e3, children: l3 });
|
|
56
56
|
}, [r2, n2, d2]);
|
|
57
57
|
return N(De, { ref: t2, commands: o2, commandHook: n2, createPopupPanel: c2, label: "Vertical Alignment", tooltip: "Configure how text is placed in the vertical direction of the cell.", icon: d2.get(s2) ?? we(N(Me, {})), ...l2 });
|
|
58
|
-
})),
|
|
58
|
+
})), sr = L(H((e2, t2) => {
|
|
59
59
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["formatTextOverflowVisibleToggle", "formatTextOverflowWrapToggle", "formatTextOverflowClipToggle", "formatTextOverflowShrinkToggle"]), s2 = W(() => {
|
|
60
60
|
for (let e3 = 0; e3 < i2.length; e3++) if (i2[e3]?.state()) return i2[e3].key();
|
|
61
61
|
return i2[0]?.key();
|
|
@@ -67,7 +67,7 @@ const nr = L(H((e2, t2) => {
|
|
|
67
67
|
return Te({ ...e3, children: l3 });
|
|
68
68
|
}, [r2, n2, a2]);
|
|
69
69
|
return N(De, { ref: t2, commands: o2, commandHook: n2, scope: a2, label: "Text Overflow", tooltip: "Configure how text behaves when it doesn't fit within a cell.", createPopupPanel: c2, icon: d2.get(s2) ?? we(N(Fe, {})), ...l2 });
|
|
70
|
-
})),
|
|
70
|
+
})), dr = L(H((e2, t2) => {
|
|
71
71
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["formatTextRotate0", "formatTextRotate315", "formatTextRotate45", "formatTextRotate90", "formatTextRotate270", "formatSubscriptToggle", "formatTextRotateCustom"]), s2 = W(() => {
|
|
72
72
|
const e3 = i2.length;
|
|
73
73
|
for (let t3 = 0; t3 < e3; t3++) {
|
|
@@ -83,9 +83,9 @@ const nr = L(H((e2, t2) => {
|
|
|
83
83
|
return Te({ ...e3, children: l3 });
|
|
84
84
|
}, [r2, n2, a2, o2]), m2 = W(() => 0 !== (o2.getCommand("formatTextRotateCustom")?.state() ?? 0), [i2]);
|
|
85
85
|
return N(De, { ref: t2, commands: o2, commandHook: n2, scope: a2, selected: m2, label: "Text Orientation", tooltip: "Rotate your text diagonally or vertically. This is a great way to label narrow columns.", createPopupPanel: c2, quickCommand: m2 ? "formatTextRotate0" : "formatTextRotate315", icon: we(d2.get(s2) ?? N(Ae, {})), ...l2 });
|
|
86
|
-
})),
|
|
86
|
+
})), cr = { Preset: "preset", Custom: "custom" }, mr = { Start: "start", End: "end" }, pr = {}, ur = (e2, t2, o2, n2) => {
|
|
87
87
|
const a2 = e2 + "-" + t2 + "-" + o2 + (n2 ? "-server" : "");
|
|
88
|
-
if (
|
|
88
|
+
if (pr[a2]) return pr[a2];
|
|
89
89
|
const r2 = ((e3, t3, o3, n3) => {
|
|
90
90
|
if ("undefined" == typeof document && !n3) return null;
|
|
91
91
|
const a3 = n3 ? new n3() : document.createElement("canvas");
|
|
@@ -93,11 +93,11 @@ const nr = L(H((e2, t2) => {
|
|
|
93
93
|
const r3 = a3.getContext("2d");
|
|
94
94
|
return r3 ? (r3.fillStyle = e3, r3.fillRect(0, 0, a3.width, a3.height), r3.fillStyle = t3, r3.fillRect(0, 0, o3, o3), r3.translate(o3, o3), r3.fillRect(0, 0, o3, o3), a3.toDataURL()) : null;
|
|
95
95
|
})(e2, t2, o2, n2);
|
|
96
|
-
return
|
|
97
|
-
},
|
|
98
|
-
const { className: t2, style: o2 = ka.EmptyCssProperties, white: n2 = "transparent", grey: a2 = "grey", size: r2 = 8, borderRadius: l2, boxShadow: i2, renderers: s2 =
|
|
96
|
+
return pr[a2] = r2, r2;
|
|
97
|
+
}, gr = {}, hr = L((e2) => {
|
|
98
|
+
const { className: t2, style: o2 = ka.EmptyCssProperties, white: n2 = "transparent", grey: a2 = "grey", size: r2 = 8, borderRadius: l2, boxShadow: i2, renderers: s2 = gr, children: d2, ...c2 } = e2, m2 = d2, p2 = W(() => Object.assign({ borderRadius: l2, boxShadow: i2, position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", background: `url(${ur(n2, a2, r2, s2?.canvas)}) center left` }, o2), [n2, a2, r2, s2]);
|
|
99
99
|
return $(d2) ? I.cloneElement(d2, { ...m2.props }) : N("div", { style: p2, ...c2 });
|
|
100
|
-
}),
|
|
100
|
+
}), fr = L((e2) => {
|
|
101
101
|
const { selectedColor: t2, onSelectColor: o2, onPreviewColor: n2, onClick: a2, onKeyDown: r2, onMouseOver: l2, onMouseLeave: i2, onFocus: s2, style: d2 = ka.EmptyCssProperties, children: c2, alphaWhite: m2, alphaGrey: p2, darkMode: u2, alphaCheckSize: g2 = 7, ...h2 } = e2;
|
|
102
102
|
if (!t2) throw new Error("a selectedColor is required");
|
|
103
103
|
const f2 = z((e3) => {
|
|
@@ -110,9 +110,9 @@ const nr = L(H((e2, t2) => {
|
|
|
110
110
|
s2?.(e3), e3.isDefaultPrevented() || n2?.(t2.toRGBA());
|
|
111
111
|
}, [n2, s2, t2]), w2 = z((e3) => {
|
|
112
112
|
r2?.(e3), e3.isDefaultPrevented() || e3.keyCode === Sa.Enter && o2?.(t2.toRGBA());
|
|
113
|
-
}, [o2, r2, t2]), k2 = W(() => 1 === t2.toRGBA().alpha ? null : N(
|
|
113
|
+
}, [o2, r2, t2]), k2 = W(() => 1 === t2.toRGBA().alpha ? null : N(hr, { size: g2, white: m2, grey: p2, style: { position: "absolute", width: "calc(100% - 1.5px)", height: "calc(100% - 1.5px)", top: "0.75px", left: "0.75px" } }), [m2, p2, t2]);
|
|
114
114
|
return E("div", { style: { position: "absolute", height: "100%", width: "100%", top: "0px", left: "0px", cursor: "pointer", outline: "none", ...d2 }, tabIndex: 0, ...h2, onClick: f2, onKeyDown: w2, onMouseOver: x2, onMouseLeave: b2, onFocus: y2, children: [k2, N("div", { style: { position: "absolute", top: "0px", left: "0px", height: "100%", width: "100%", background: t2.toCSS(u2) }, children: c2 })] });
|
|
115
|
-
}),
|
|
115
|
+
}), xr = L((o2) => {
|
|
116
116
|
const { schemeColorLookup: n2, selectedColor: a2, previewColor: r2, colorDef: l2, onSelectColorDef: i2, onPreviewColorDef: s2, swatchProps: d2, defaultButtonSize: c2 = 24, isLarge: m2 = false, compareRGB: p2 = false, darkMode: u2 = false, ...g2 } = o2, h2 = new e({ val: l2.definition.val, adjs: l2.definition.adjs }, (e2) => n2(e2)), f2 = p2 ? h2.toRGBA().toString() : h2.toString(), x2 = a2 && (p2 ? a2.toRGBA().toString() : a2.toString()) === f2, b2 = r2 && (p2 ? r2.toRGBA().toString() : r2.toString()) === f2, y2 = [];
|
|
117
117
|
y2.push({ [t.AdjustmentType.Inv]: true }), y2.push({ [t.AdjustmentType.Alpha]: 100 });
|
|
118
118
|
const w2 = h2.adjust(y2), k2 = z(() => {
|
|
@@ -120,8 +120,8 @@ const nr = L(H((e2, t2) => {
|
|
|
120
120
|
}, [i2, l2]), S2 = z((e2) => {
|
|
121
121
|
s2?.(e2 ? l2 : null);
|
|
122
122
|
}, [s2, l2]);
|
|
123
|
-
return N(Oe, { disableInteractive: true, PopperProps: { style: { pointerEvents: "none" }, disablePortal: true, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: true, options: { boundariesElement: "viewport" } }] } }, title: l2.description, placement: "bottom-start", children: N("div", { style: { width: c2 * (m2 ? 1.2 : 1) + "px", height: c2 * (m2 ? 1.2 : 1) + "px", position: "relative", boxSizing: "border-box", cursor: "pointer", outline: "none" }, ...g2, children: E(
|
|
124
|
-
}),
|
|
123
|
+
return N(Oe, { disableInteractive: true, PopperProps: { style: { pointerEvents: "none" }, disablePortal: true, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: true, options: { boundariesElement: "viewport" } }] } }, title: l2.description, placement: "bottom-start", children: N("div", { style: { width: c2 * (m2 ? 1.2 : 1) + "px", height: c2 * (m2 ? 1.2 : 1) + "px", position: "relative", boxSizing: "border-box", cursor: "pointer", outline: "none" }, ...g2, children: E(fr, { selectedColor: h2, title: null, onSelectColor: k2, onPreviewColor: S2, alphaCheckSize: m2 ? 9 : void 0, darkMode: u2, ...d2, children: [N("div", { style: { position: "absolute", width: "100%", height: "100%", top: "0px", left: "0px", pointerEvents: "none", borderColor: w2.toRGBA(u2).toString(), borderWidth: "2px", borderStyle: "solid", boxSizing: "border-box", opacity: x2 ? "1" : "0" } }), N("div", { style: { position: "absolute", width: 0.33 * c2 * (m2 ? 1.2 : 1) + "px", height: 0.33 * c2 * (m2 ? 1.2 : 1) + "px", left: "calc(50% - 0.5px)", top: "calc(50% - 0.5px)", transform: "translate(-50%,-50%)", pointerEvents: "none", background: w2.toRGBA(u2).toString(), borderRadius: "50%", opacity: b2 ? "1" : "0" } })] }) }) });
|
|
124
|
+
}), br = L((e2) => {
|
|
125
125
|
const { title: t2, schemeColorLookup: o2, colorDefs: n2, selectedColor: a2, previewColor: r2, onSelectColorDef: l2, onPreviewColorDef: i2, style: s2 = ka.EmptyCssProperties, compareRGB: d2 = false, darkMode: c2, swatchProps: m2, ...p2 } = e2;
|
|
126
126
|
let u2;
|
|
127
127
|
if (Array.isArray(n2[0])) u2 = n2;
|
|
@@ -139,7 +139,7 @@ const nr = L(H((e2, t2) => {
|
|
|
139
139
|
let n3 = [], l3 = u2[t3];
|
|
140
140
|
for (let e4 = 0; e4 < l3.length; e4++) {
|
|
141
141
|
let i4 = l3[e4];
|
|
142
|
-
n3.push(N(
|
|
142
|
+
n3.push(N(xr, { schemeColorLookup: o2, colorDef: i4, selectedColor: a2, previewColor: r2, onSelectColorDef: g2, onPreviewColorDef: h2, swatchProps: m2, compareRGB: d2, darkMode: c2 }, t3 + " " + e4));
|
|
143
143
|
}
|
|
144
144
|
let i3 = N(X, { className: "button-col", sx: { display: "flex", flexDirection: "column", justifyContent: "space-between", boxShadow: (e4) => e4.shadows[2], borderRadius: "2px", overflow: "hidden" }, children: n3 }, "" + t3);
|
|
145
145
|
e3.push(i3);
|
|
@@ -147,19 +147,19 @@ const nr = L(H((e2, t2) => {
|
|
|
147
147
|
return e3;
|
|
148
148
|
}, [u2, a2, r2, g2, h2]), x2 = W(() => t2 ? N(Z, { noWrap: true, component: "div", sx: { display: "flex", flexShrink: "0", paddingLeft: "6px", paddingBottom: "4px", paddingTop: "0px", userSelect: "none", color: (e3) => e3.palette.text.secondary }, children: t2 }) : null, [t2]);
|
|
149
149
|
return E(X, { style: { ...s2 }, children: [x2, N(X, { sx: { display: "flex", flexDirection: "row", gap: "6px", marginBottom: "14px", flexWrap: "wrap", justifyContent: "flex-start" }, ...p2, children: f2 })] });
|
|
150
|
-
}),
|
|
151
|
-
const i2 =
|
|
150
|
+
}), yr = (e2, t2) => ({ description: e2, definition: { val: t2, adjs: [] } }), wr = (t2, o2, n2, a2, r2, l2) => {
|
|
151
|
+
const i2 = yr(t2, o2);
|
|
152
152
|
a2?.push(i2);
|
|
153
153
|
const s2 = new e({ val: i2.definition.val, adjs: i2.definition.adjs }, n2), d2 = s2.toString();
|
|
154
154
|
r2?.set(d2, s2);
|
|
155
155
|
const c2 = s2.toRGBA().toString();
|
|
156
156
|
l2?.set(c2, s2);
|
|
157
|
-
},
|
|
158
|
-
const { selectedColor: r2 = null, previewColor: l2 = t2.selectedColor ?? null, recentColors: i2, schemeLookup: s2, disableAlpha: d2 = false, previewDebounceTime: c2 = 100, initialPanelType: m2, defaultButtonSize: p2 = 24, width: u2, onElementLoad: g2, onDone: h2, onEyeDropStart: f2, onEyeDropStop: x2, onPreviewColor: b2, onPreviewColorImmediate: y2, onSelectColor: w2, autoColor: k2, autoColorLabel: S2 = "Automatic", autoColorPosition: C2 =
|
|
157
|
+
}, kr = I.lazy(() => import("./CdEdm8ItFMvEzr0O.mjs")), Sr = L(H((t2, a2) => {
|
|
158
|
+
const { selectedColor: r2 = null, previewColor: l2 = t2.selectedColor ?? null, recentColors: i2, schemeLookup: s2, disableAlpha: d2 = false, previewDebounceTime: c2 = 100, initialPanelType: m2, defaultButtonSize: p2 = 24, width: u2, onElementLoad: g2, onDone: h2, onEyeDropStart: f2, onEyeDropStop: x2, onPreviewColor: b2, onPreviewColorImmediate: y2, onSelectColor: w2, autoColor: k2, autoColorLabel: S2 = "Automatic", autoColorPosition: C2 = mr.Start, compareRGB: v2 = false, darkMode: T2 = false, ...D2 } = t2, P2 = l2 || r2, R2 = wa(b2, [b2]), M2 = wa(y2, [y2]), F2 = wa(w2, [w2]), B2 = wa(f2, [f2]), I2 = wa(x2, [x2]), [L2, H2] = O(false), $2 = $a(), U2 = W(() => s2 || e.getDefaultSchemeLookup(), [s2]), j2 = W(() => {
|
|
159
159
|
const e2 = /* @__PURE__ */ new Map(), t3 = /* @__PURE__ */ new Map(), n2 = [];
|
|
160
|
-
|
|
160
|
+
wr("Primary Background", "bg1", U2, n2, e2, t3), wr("Primary Text", "tx1", U2, n2, e2, t3), wr("Secondary Background", "bg2", U2, n2, e2, t3), wr("Secondary Text", "tx2", U2, n2, e2, t3), wr("Accent 1", "accent1", U2, n2, e2, t3), wr("Accent 2", "accent2", U2, n2, e2, t3), wr("Accent 3", "accent3", U2, n2, e2, t3), wr("Accent 4", "accent4", U2, n2, e2, t3), wr("Accent 5", "accent5", U2, n2, e2, t3), wr("Accent 6", "accent6", U2, n2, e2, t3);
|
|
161
161
|
const a3 = o.buildPalette(n2, U2, e2, t3), r3 = [];
|
|
162
|
-
if (
|
|
162
|
+
if (wr("Dark Red", "C00000", U2, r3, e2, t3), wr("Red", "FF0000", U2, r3, e2, t3), wr("Orange", "FFC000", U2, r3, e2, t3), wr("Yellow", "FFFF00", U2, r3, e2, t3), wr("Light Green", "92D050", U2, r3, e2, t3), wr("Green", "00B050", U2, r3, e2, t3), wr("Light Blue", "00B0F0", U2, r3, e2, t3), wr("Blue", "0070C0", U2, r3, e2, t3), wr("Dark Blue", "002060", U2, r3, e2, t3), d2 ? wr("Purple Is A Fruit", "7030A0", U2, r3, e2, t3) : wr("Transparent", "00000000", U2, r3, e2, t3), k2) {
|
|
163
163
|
const t4 = k2.toString();
|
|
164
164
|
e2.set(t4, k2);
|
|
165
165
|
}
|
|
@@ -177,7 +177,7 @@ const nr = L(H((e2, t2) => {
|
|
|
177
177
|
q2((e2) => !e2);
|
|
178
178
|
}, []);
|
|
179
179
|
V(() => {
|
|
180
|
-
if (m2) q2(m2 ===
|
|
180
|
+
if (m2) q2(m2 === cr.Custom);
|
|
181
181
|
else if (r2) {
|
|
182
182
|
let e2 = r2.toString(), t3 = j2.mapAllPresets.get(e2);
|
|
183
183
|
t3 || (e2 = r2.toRGBA().toString(), t3 = j2.mapAllPresetsRGB.get(e2));
|
|
@@ -233,7 +233,7 @@ const nr = L(H((e2, t2) => {
|
|
|
233
233
|
}, [j2, T2]), me2 = W(() => {
|
|
234
234
|
if (!_2) return;
|
|
235
235
|
const e2 = { opacity: _2 ? 1 : "0", position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", boxSizing: "border-box" };
|
|
236
|
-
return N(G, { fallback: N("div", { style: e2, children: N(Ve, {}) }), children: N(
|
|
236
|
+
return N(G, { fallback: N("div", { style: e2, children: N(Ve, {}) }), children: N(kr, { style: e2, selectedColor: P2 ? P2.toRGBA().toString() : "transparent", onColorChange: de2, disableAlpha: d2 }) });
|
|
237
237
|
}, [_2, P2]), pe2 = W(() => ({ onClick: le2, alphaGrey: $2.palette.text.icon ?? $2.palette.action.active }), [le2, $2]), ue2 = W(() => {
|
|
238
238
|
if (!k2) return null;
|
|
239
239
|
const e2 = { description: S2, definition: { val: k2.getVal(), adjs: k2.getAdjustments() } };
|
|
@@ -241,17 +241,17 @@ const nr = L(H((e2, t2) => {
|
|
|
241
241
|
re2(null);
|
|
242
242
|
}, onClick: () => {
|
|
243
243
|
se2(null);
|
|
244
|
-
}, children: [N(X, { sx: { flex: "none", boxShadow: (e3) => e3.shadows[2], borderRadius: (e3) => e3.spacing(0.5), overflow: "hidden" }, children: N(
|
|
244
|
+
}, children: [N(X, { sx: { flex: "none", boxShadow: (e3) => e3.shadows[2], borderRadius: (e3) => e3.spacing(0.5), overflow: "hidden" }, children: N(xr, { schemeColorLookup: U2, colorDef: e2, selectedColor: null === r2 ? k2 : r2, previewColor: null === l2 ? k2 : l2, defaultButtonSize: p2, isLarge: true, darkMode: T2, compareRGB: v2, swatchProps: pe2 }) }), N(Z, { noWrap: true, component: "div", style: { display: "flex", flex: "1 1 100%", marginLeft: "8px", userSelect: "none" }, children: S2 })] }) });
|
|
245
245
|
}, [k2, S2, U2, r2, l2]);
|
|
246
|
-
return E(X, { ref: a2, sx: { width: u2, outline: "none", padding: "10px 10px", overflow: "hidden", boxSizing: "content-box" }, ...D2, children: [E("div", { style: { position: "relative", display: "flex" }, children: [E("div", { style: { opacity: _2 ? "0" : 1 }, children: [ue2 && C2 ===
|
|
246
|
+
return E(X, { ref: a2, sx: { width: u2, outline: "none", padding: "10px 10px", overflow: "hidden", boxSizing: "content-box" }, ...D2, children: [E("div", { style: { position: "relative", display: "flex" }, children: [E("div", { style: { opacity: _2 ? "0" : 1 }, children: [ue2 && C2 === mr.Start ? E(A, { children: [ue2, N(Q, { light: true, style: { marginTop: "2px", marginBottom: "10px" } })] }) : null, N(br, { title: "Theme Colors", schemeColorLookup: U2, colorDefs: j2.primaryColors, selectedColor: r2, previewColor: void 0 === l2 ? r2 : l2, swatchProps: pe2, onPreviewColorDef: re2, onSelectColorDef: se2, compareRGB: v2, darkMode: T2 }), N(br, { schemeColorLookup: U2, colorDefs: j2.modifiedPresets, selectedColor: r2, previewColor: void 0 === l2 ? r2 : l2, swatchProps: pe2, onPreviewColorDef: re2, onSelectColorDef: se2, compareRGB: v2, darkMode: T2 }), N(Q, { light: true, style: { marginBottom: "10px" } }), N(br, { title: "Standard Colors", schemeColorLookup: U2, colorDefs: j2.standardColors, selectedColor: r2, previewColor: void 0 === l2 ? r2 : l2, swatchProps: pe2, onPreviewColorDef: re2, onSelectColorDef: se2, compareRGB: v2, darkMode: T2 }), E("div", { style: { opacity: 0 === j2.recentColorsLimited.length ? "0" : void 0, display: 0 === j2.recentColorsLimited.length ? "none" : void 0 }, children: [N(Q, { light: true, style: { marginBottom: "10px" } }), N(br, { title: "Recent Colors", schemeColorLookup: U2, colorDefs: j2.recentColorsLimited, selectedColor: r2, previewColor: void 0 === l2 ? r2 : l2, swatchProps: pe2, onPreviewColorDef: re2, onSelectColorDef: se2, compareRGB: v2, darkMode: T2 })] }), ue2 && C2 === mr.End ? E(A, { children: [N(Q, { light: true, sx: { marginTop: "2px", marginBottom: "2px" } }), ue2, N("div", { style: { marginBottom: "2px" } })] }) : null] }), me2] }), N(Q, { light: true, style: { marginBottom: "10px" } }), E("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-around", gap: "8px", paddingLeft: "2px", paddingRight: "2px" }, children: [ce2, N("div", { style: { flex: "1 1 100%", background: "pink" } }), N(ee, { style: { minWidth: "75px", maxWidth: "75px" }, value: "check", variant: "outlined", size: "small", onClick: () => {
|
|
247
247
|
K2();
|
|
248
248
|
}, children: N("div", _2 ? { children: "Preset" } : { children: "Custom" }) }), N(ee, { variant: "contained", size: "small", style: { minWidth: "75px" }, onClick: () => {
|
|
249
249
|
Promise.resolve(h2?.()).then(() => {
|
|
250
250
|
ie2(oe2);
|
|
251
251
|
});
|
|
252
252
|
}, children: "Done" })] })] });
|
|
253
|
-
})),
|
|
254
|
-
const { selectedColor: o2, quickColor: n2, icon: a2 =
|
|
253
|
+
})), Cr = N(_e, {}), vr = L(H((e2, t2) => {
|
|
254
|
+
const { selectedColor: o2, quickColor: n2, icon: a2 = Cr, tooltip: r2, label: l2, onPreviewColor: i2, onPreviewColorImmediate: s2, onSelectColor: d2, variant: c2 = Ge.Toolbar, panelProps: m2, shouldCloseFloatAll: p2 = true, compareRGB: u2 = false, darkMode: g2 = false, ...h2 } = e2, f2 = wa(i2, [i2]), x2 = wa(s2, [s2]), b2 = wa(d2, [d2]), [y2, w2] = O(() => {
|
|
255
255
|
}), k2 = n2 || (y2 || o2) || m2?.autoColor, S2 = U(false), C2 = z(() => {
|
|
256
256
|
}, []), v2 = wa(() => {
|
|
257
257
|
w2(o2);
|
|
@@ -265,23 +265,23 @@ const nr = L(H((e2, t2) => {
|
|
|
265
265
|
b2?.(n2, false);
|
|
266
266
|
}, [b2, n2]), [F2, B2] = O(false), E2 = z((e3) => {
|
|
267
267
|
const { closeFloat: t3, closeFloatAll: n3 } = e3;
|
|
268
|
-
return N(
|
|
268
|
+
return N(Sr, { ...m2, selectedColor: o2, previewColor: y2, onDone: p2 ? n3 : t3, onKeyDown: (e4) => {
|
|
269
269
|
e4.which === Sa.Enter && (p2 ? n3() : t3());
|
|
270
270
|
}, onPreviewColorImmediate: D2, onPreviewColor: T2, onSelectColor: P2, onEyeDropStart: () => B2(true), onEyeDropStop: () => B2(false), compareRGB: u2, darkMode: g2 });
|
|
271
271
|
}, [o2, y2, p2, k2, m2?.autoColor, g2]), A2 = { onQuickClick: n2 ? M2 : void 0, createPopupPanel: E2, popupProps: { popperProps: { resizeOnOverflow: false } }, onPopupOpen: v2, onPopupClose: C2, tooltip: r2 || l2 || "Color", label: l2, icon: R2, ...h2 };
|
|
272
272
|
return c2 === Ge.Toolbar ? N(Ue, { ref: t2, ...A2 }) : N(je, { ref: t2, ...A2 });
|
|
273
|
-
})),
|
|
274
|
-
const { styleColor: t2, length: o2 =
|
|
273
|
+
})), Tr = 82, Dr = (e2) => {
|
|
274
|
+
const { styleColor: t2, length: o2 = Tr, width: n2 = 1, dashArray: a2 = null, sx: r2, isDouble: l2 = false, isAngled: i2 = false, darkMode: s2 = false, ...d2 } = e2;
|
|
275
275
|
return N(te, { sx: { width: `${o2}px`, height: `${n2}px`, color: "inherit", overflow: "visible", "& .activeColor": { stroke: (e3) => `${t2 ? t2.toRGBA(s2).toString() : e3.palette.text.icon ?? e3.palette.action.active}` }, "& .style_grey": { stroke: (e3) => e3.palette.text.icon ?? e3.palette.action.active }, ...r2 }, height: n2, width: o2, viewBox: `0 0 ${o2} ${n2}`, ...d2, children: N(x, { length: o2, width: n2, dashArray: a2, isDouble: l2, isAngled: i2, className: "activeColor" }) });
|
|
276
|
-
},
|
|
276
|
+
}, Pr = L(H((e2, t2) => {
|
|
277
277
|
const { variant: o2, showLabels: n2 = false, disabled: r2 = false, createPopupPanel: l2, styleColor: i2, selectedStyle: s2, onSelectStyle: d2, showNone: c2 = true, darkMode: m2, sx: p2, ...u2 } = e2, g2 = wa(d2, []), h2 = z((e3) => {
|
|
278
278
|
const { popupContainer: t3, floatReference: o3, closeFloat: l3, ...d3 } = e3, p3 = [], u3 = a.BuiltInDefinitionsArray;
|
|
279
279
|
for (let e4 = 0; e4 < u3.length; e4++) {
|
|
280
280
|
const t4 = u3[e4];
|
|
281
281
|
if ("None" === t4.description && !c2) continue;
|
|
282
|
-
const a2 = N(
|
|
282
|
+
const a2 = N(Dr, { styleColor: i2, length: Tr, width: t4.width, darkMode: m2, dashArray: t4.pattern, isDouble: t4.description.toLowerCase().includes("double"), isAngled: t4.description.toLowerCase().includes("slant") });
|
|
283
283
|
let d4 = null;
|
|
284
|
-
d4 = n2 ? E(A, { children: [N(X, { sx: { marginRight: "6px" }, children: t4.description }), E(X, { sx: { marginLeft: "6px", marginRight: "6px", display: "flex", alignItems: "center", flex: "1 1 100%" }, children: [N("div", { style: { flex: "1 1 100%" } }), a2] })] }) : "None" === t4.description ? "None" : a2, p3.push(N(qe, { className: "border-stroke", tabIndex: 0, sx: { height: "28px", "& svg path.activeColor": { filter: Ke(4) }, paddingLeft: "16px", background: `linear-gradient(${
|
|
284
|
+
d4 = n2 ? E(A, { children: [N(X, { sx: { marginRight: "6px" }, children: t4.description }), E(X, { sx: { marginLeft: "6px", marginRight: "6px", display: "flex", alignItems: "center", flex: "1 1 100%" }, children: [N("div", { style: { flex: "1 1 100%" } }), a2] })] }) : "None" === t4.description ? "None" : a2, p3.push(N(qe, { className: "border-stroke", tabIndex: 0, sx: { height: "28px", "& svg path.activeColor": { filter: Ke(4) }, paddingLeft: "16px", background: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})` }, tooltipProps: { description: n2 ? "" : t4.description }, icon: null, disabled: r2, onMouseDown: (e5) => e5.preventDefault(), onMouseUp: () => {
|
|
285
285
|
l3(), g2(t4.style);
|
|
286
286
|
}, onKeyDown: (e5) => {
|
|
287
287
|
e5.which === Sa.Enter && l3();
|
|
@@ -291,10 +291,10 @@ const nr = L(H((e2, t2) => {
|
|
|
291
291
|
}, [r2, c2, i2, s2, m2]), f2 = W(() => {
|
|
292
292
|
const e3 = a.BuiltInDefinitions.get(s2);
|
|
293
293
|
let t3;
|
|
294
|
-
return t3 = "None" === e3.description ? N(X, { sx: { minWidth: `${
|
|
295
|
-
}, [s2, i2]), x2 = W(() => a.BuiltInDefinitions.get(s2), [s2]), b2 = { disabled: r2, icon: f2, tooltip: "Border Style: " + x2.description, sx: { background: `linear-gradient(${
|
|
294
|
+
return t3 = "None" === e3.description ? N(X, { sx: { minWidth: `${Tr}px` }, children: "None" }) : N(Dr, { styleColor: i2, length: Tr, width: e3.width, dashArray: e3.pattern, darkMode: m2, isDouble: e3.description.toLowerCase().includes("double"), isAngled: e3.description.toLowerCase().includes("slant") }), N(X, { className: "border-stroke", sx: { paddingLeft: "12px", marginLeft: "4px", marginRight: "4px", height: "24px", display: "flex", alignItems: "center", "& svg path.activeColor": { filter: Ke() } }, children: t3 });
|
|
295
|
+
}, [s2, i2]), x2 = W(() => a.BuiltInDefinitions.get(s2), [s2]), b2 = { disabled: r2, icon: f2, tooltip: "Border Style: " + x2.description, sx: { background: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})`, ...p2 }, createPopupPanel: h2, ...u2 };
|
|
296
296
|
return o2 === Ge.Toolbar ? N(Ue, { ...b2 }) : N(je, { ...b2 });
|
|
297
|
-
})),
|
|
297
|
+
})), Rr = L(H((t2, o2) => {
|
|
298
298
|
const { autoColor: n2 = null, schemeLookup: r2, autoStrokeStyle: l2 = a.StrokeStyle.Thin, disabled: i2 = false, darkMode: s2 = false, showStylingBefore: d2 = true, onSelectBorder: c2, onPreviewBorder: m2, selectedBorder: p2, createTemporaryBorder: u2, ...g2 } = t2, h2 = wa(c2, [c2]), f2 = wa(m2, [m2]), [x2, y2] = O(), [w2, k2] = O(), S2 = x2 ?? l2, C2 = w2 ?? n2, v2 = p2 || { bottom: { style: l2, color: n2?.toString() } }, T2 = wa((e2) => {
|
|
299
299
|
const t3 = {}, o3 = e2 ? Object.keys(e2) : [];
|
|
300
300
|
let n3 = false;
|
|
@@ -322,20 +322,20 @@ const nr = L(H((e2, t2) => {
|
|
|
322
322
|
}, []), M2 = z((t3) => {
|
|
323
323
|
const { closeFloatAll: o3, floatReference: l3 } = t3, c3 = (e2, t4, n3 = "bottom", r3 = false) => {
|
|
324
324
|
const l4 = D2(e2, C2 ?? null, r3 ? a.StrokeStyle.None : S2 ?? null), i3 = r3 ? D2([], C2 ?? null, S2 ?? null) : l4;
|
|
325
|
-
return N(Ye, { icon: T2(i3), sx: { background: `linear-gradient(${
|
|
325
|
+
return N(Ye, { icon: T2(i3), sx: { background: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})` }, tooltipProps: { label: t4, simple: true, placement: n3 }, onClick: () => {
|
|
326
326
|
o3(), R2(l4), P2(l4);
|
|
327
327
|
} });
|
|
328
|
-
}, m3 = E(A, { children: [E(X, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [c3([a.Edge.Left, a.Edge.Top, a.Edge.Right, a.Edge.Bottom, a.Edge.Horizontal, a.Edge.Vertical], "All Borders", "top"), c3([a.Edge.Horizontal, a.Edge.Vertical], "Inner Borders", "top"), c3([a.Edge.Horizontal], "Inside Horizontal Borders", "top"), c3([a.Edge.Vertical], "Inside Vertical Borders", "top"), c3([a.Edge.Left, a.Edge.Top, a.Edge.Right, a.Edge.Bottom], "Outside Borders", "top")] }), E(X, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [c3([a.Edge.Left], "Left Borders"), c3([a.Edge.Top], "Top Borders"), c3([a.Edge.Right], "Right Borders"), c3([a.Edge.Bottom], "Bottom Borders"), c3([a.Edge.Left, a.Edge.Top, a.Edge.Right, a.Edge.Bottom, a.Edge.Horizontal, a.Edge.Vertical, a.Edge.DiagonalUp, a.Edge.DiagonalDown], "No Borders", "bottom", true)] })] }), p3 = N(A, { children: E(X, { sx: { display: "flex", padding: "6px 16px", flexDirection: "row", gap: "6px" }, children: [N(
|
|
328
|
+
}, m3 = E(A, { children: [E(X, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [c3([a.Edge.Left, a.Edge.Top, a.Edge.Right, a.Edge.Bottom, a.Edge.Horizontal, a.Edge.Vertical], "All Borders", "top"), c3([a.Edge.Horizontal, a.Edge.Vertical], "Inner Borders", "top"), c3([a.Edge.Horizontal], "Inside Horizontal Borders", "top"), c3([a.Edge.Vertical], "Inside Vertical Borders", "top"), c3([a.Edge.Left, a.Edge.Top, a.Edge.Right, a.Edge.Bottom], "Outside Borders", "top")] }), E(X, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [c3([a.Edge.Left], "Left Borders"), c3([a.Edge.Top], "Top Borders"), c3([a.Edge.Right], "Right Borders"), c3([a.Edge.Bottom], "Bottom Borders"), c3([a.Edge.Left, a.Edge.Top, a.Edge.Right, a.Edge.Bottom, a.Edge.Horizontal, a.Edge.Vertical, a.Edge.DiagonalUp, a.Edge.DiagonalDown], "No Borders", "bottom", true)] })] }), p3 = N(A, { children: E(X, { sx: { display: "flex", padding: "6px 16px", flexDirection: "row", gap: "6px" }, children: [N(vr, { variant: Ge.Toolbar, icon: N(Ze, {}), selectedColor: S2 === a.StrokeStyle.None ? new e("transparent") : C2, onPreviewColor: (e2) => {
|
|
329
329
|
k2(e2);
|
|
330
330
|
}, onSelectColor: (e2, t4) => {
|
|
331
331
|
k2(e2);
|
|
332
|
-
}, darkMode: s2, tooltip: "Border Color", panelProps: { disableAlpha: true, autoColor: n2, schemeLookup: r2 }, disabled: i2 || S2 === a.StrokeStyle.None, parentFloat: l3, shouldCloseFloatAll: false }), N(
|
|
332
|
+
}, darkMode: s2, tooltip: "Border Color", panelProps: { disableAlpha: true, autoColor: n2, schemeLookup: r2 }, disabled: i2 || S2 === a.StrokeStyle.None, parentFloat: l3, shouldCloseFloatAll: false }), N(Pr, { selectedStyle: S2, onSelectStyle: y2, styleColor: C2, darkMode: s2, variant: Ge.Toolbar, parentFloat: l3 })] }) });
|
|
333
333
|
return E(X, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, onClick: (e2) => e2.stopPropagation(), children: [d2 ? p3 : m3, N(Se, { orientation: "horizontal" }), d2 ? m3 : p3] });
|
|
334
334
|
}, [S2, C2, n2, r2, s2]), F2 = W(() => T2(v2), [v2, s2]);
|
|
335
335
|
return N(Ue, { ref: o2, createPopupPanel: M2, popupProps: { popperProps: { resizeOnOverflow: false } }, createTooltip: ({ children: e2 }, t3) => N(Je, { label: "Borders", description: "Set the borders.", disabled: t3, children: e2 }), onQuickClick: () => {
|
|
336
336
|
h2?.(v2);
|
|
337
337
|
}, quickButtonProps: { sx: {} }, disabled: i2, icon: F2, ...g2 });
|
|
338
|
-
})),
|
|
338
|
+
})), Mr = L(H((e2, t2) => {
|
|
339
339
|
const { commands: o2, command: n2, commandHook: a2, variant: r2 = ya.Toolbar, disabled: l2 = false, autoColor: i2, autoStrokeStyle: s2, schemeLookup: d2, createTemporaryBorder: c2, selectedBorder: m2, onSelectBorder: p2, darkMode: u2, icon: g2, label: h2, ...f2 } = e2, x2 = ba(o2, ["formatBorder"]), b2 = n2 ?? x2[0], y2 = b2?.context() ?? null, w2 = y2?.autoColor ?? i2, k2 = y2?.autoStyle ?? s2, S2 = m2 ?? y2?.quickBorder, C2 = u2 ?? y2?.darkMode, v2 = c2 ?? y2?.createTemporaryBorder, T2 = d2 ?? y2?.schemeLookup, D2 = wa((e3) => {
|
|
340
340
|
y2?.onBorderSelect && y2.onBorderSelect(e3), p2?.(e3), b2?.execute(e3, a2);
|
|
341
341
|
}, [b2, p2, a2]), P2 = z((e3, t3) => {
|
|
@@ -343,26 +343,26 @@ const nr = L(H((e2, t2) => {
|
|
|
343
343
|
let i3 = e3.children;
|
|
344
344
|
return (b2?.disabled() || l2) && (i3 = N("div", { children: i3 })), N(Qe, { command: b2, placement: r2 === ya.Toolbar ? "bottom-start" : "right-start", disabled: t3, ...a3, children: i3 });
|
|
345
345
|
}, [b2, l2]);
|
|
346
|
-
return N(
|
|
347
|
-
})),
|
|
346
|
+
return N(Rr, { ref: t2, autoColor: w2, darkMode: C2, autoStrokeStyle: k2, createTemporaryBorder: v2, schemeLookup: T2, selectedBorder: S2, onSelectBorder: D2, createTooltip: P2, disabled: l2 || !b2 || b2.disabled(), ...f2 });
|
|
347
|
+
})), Fr = L(H((e2, t2) => {
|
|
348
348
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
349
349
|
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("mergeToggle"), icon: we(N(et, {})) }), N(ke, { ...o3, command: t3.getCommand("mergeHorizontal"), icon: we(N(tt, {})) }), N(ke, { ...o3, command: t3.getCommand("mergeVertical"), icon: we(N(ot, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("unmerge"), icon: we(N(nt, {})) })] });
|
|
350
350
|
return Te({ ...e3, children: l3 });
|
|
351
351
|
}, [r2, n2, a2]);
|
|
352
352
|
return N(De, { ref: t2, commands: o2, quickCommand: "mergeToggle", commandHook: n2, scope: a2, tooltip: "Combine or split cells.", createPopupPanel: i2, icon: we(N(et, {})), ...l2 });
|
|
353
|
-
})),
|
|
353
|
+
})), Br = L(H((e2, t2) => {
|
|
354
354
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
355
355
|
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("freezeToggle"), icon: we(N(at, {})) }), N(ke, { ...o3, command: t3.getCommand("freezeToggleHorizontal"), icon: we(N(rt, {})) }), N(ke, { ...o3, command: t3.getCommand("freezeToggleVertical"), icon: we(N(lt, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("unfreeze"), icon: N(nt, {}) })] });
|
|
356
356
|
return Te({ ...e3, children: l3 });
|
|
357
357
|
}, [r2, n2, a2]);
|
|
358
358
|
return N(De, { ref: t2, commands: o2, commandHook: n2, createPopupPanel: i2, 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: N(it, {}), ...l2 });
|
|
359
|
-
})),
|
|
359
|
+
})), Nr = L(H((e2, t2) => {
|
|
360
360
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
361
361
|
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("find"), icon: we(N(st, {})) }), N(ke, { ...o3, command: t3.getCommand("findReplace"), icon: we(N(dt, {})) }), N(ke, { ...o3, command: t3.getCommand("goto"), icon: we(N(ct, {})) })] });
|
|
362
362
|
return Te({ ...e3, children: l3 });
|
|
363
363
|
}, [r2, n2, a2]);
|
|
364
364
|
return N(De, { ref: t2, commands: o2, commandHook: n2, createPopupPanel: i2, label: "Find & Select", tooltip: "Find and replace cells or go to a specific location.", quickCommand: "find", icon: we(N(st, {})), ...l2 });
|
|
365
|
-
})),
|
|
365
|
+
})), Er = L(H((e2, t2) => {
|
|
366
366
|
const { command: o2, commandHook: n2, showQuickButtons: a2 = !!e2.commands, commands: l2, fontSizes: i2 = y.DefaultFontSizes, disabled: s2 = false, parentFloat: d2, icon: c2, label: m2, sx: p2, ...u2 } = e2;
|
|
367
367
|
Ca(o2);
|
|
368
368
|
const g2 = () => o2?.state()?.toString() || "11", [h2, f2] = O(g2), x2 = wa(() => {
|
|
@@ -376,7 +376,7 @@ const nr = L(H((e2, t2) => {
|
|
|
376
376
|
if (!n2) return null;
|
|
377
377
|
const e3 = { ...n2 };
|
|
378
378
|
return delete e3.beforeExecute, e3;
|
|
379
|
-
}, [n2]), w2 = ba(l2, ["formatFontSizeIncrease", "formatFontSizeDecrease"]), k2 = W(() => w2 ? E(X, { className: Yn("quick-buttons", {}), sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (e3) => e3.stopPropagation(), children: [N(ke, { command: w2[0], commandHook: b2, icon: we(N(mt, {})) }), N(ke, { command: w2[1], icon: we(N(pt, {})) })] }) : null, [w2]), S2 =
|
|
379
|
+
}, [n2]), w2 = ba(l2, ["formatFontSizeIncrease", "formatFontSizeDecrease"]), k2 = W(() => w2 ? E(X, { className: Yn("quick-buttons", {}), sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (e3) => e3.stopPropagation(), children: [N(ke, { command: w2[0], commandHook: b2, icon: we(N(mt, {})) }), N(ke, { command: w2[1], icon: we(N(pt, {})) })] }) : null, [w2]), S2 = $a(), C2 = W(() => `${r.getSharedMeasurer()("12.3", Math.round(S2.typography.fontSize), S2.typography.fontFamily).width}px`, [S2]), v2 = z((e3) => {
|
|
380
380
|
const { onMouseDown: t3, onMouseUp: n3, ...a3 } = e3;
|
|
381
381
|
return N(J, { component: "div", ...a3, disableRipple: true, children: N(oe, { inputMode: "numeric", disabled: s2 || !o2 || o2.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: (e4) => `1px solid ${e4.palette.text.icon ?? e4.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (e4) => `1px solid ${e4.palette.error.main}` }, "::after": { borderBottom: (e4) => `1px solid ${e4.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", paddingLeft: "0px", paddingRight: "0px", fontSize: (e4) => `${Math.round(e4.typography.fontSize)}px`, width: C2, color: (e4) => e4.palette.text.secondary, input: { padding: "0 0", textAlign: "center", MozAppearance: "textfield", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (e4) => e4.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (e4) => e4.palette.text.primary } }, "input::-webkit-inner-spin-button": { WebkitAppearance: "none", margin: "0" }, minHeight: "24px" }, value: h2, onFocus: (e4) => {
|
|
382
382
|
e4.target?.select();
|
|
@@ -414,7 +414,7 @@ const nr = L(H((e2, t2) => {
|
|
|
414
414
|
return Te({ ...e3, children: l3 });
|
|
415
415
|
}, [s2, o2?.state(), n2]);
|
|
416
416
|
return N(Ue, { ref: t2, sx: { ...p2 }, tabIndex: -1, outlined: true, disabled: s2, parentFloat: d2, createPopupPanel: T2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: o2?.label(), description: o2?.description(), disabled: t3 || o2?.disabled(), children: e3 }), createQuickButton: v2, ...u2 });
|
|
417
|
-
})),
|
|
417
|
+
})), Ar = L((e2) => {
|
|
418
418
|
const { selected: t2, disabled: o2, formattedValue: n2, handleSetFormat: a2, format: r2, sx: i2, ...s2 } = e2;
|
|
419
419
|
return N(qe, { sx: { maxWidth: "360px", display: "flex", "*": { lineHeight: "1.2" }, ...i2 }, disabled: o2, selected: t2, icon: t2 ? N(ut, {}) : void 0, onMouseDown: (e3) => {
|
|
420
420
|
0 === e3.button && e3.preventDefault();
|
|
@@ -422,8 +422,8 @@ const nr = L(H((e2, t2) => {
|
|
|
422
422
|
0 === e3.button && a2(r2.numberFormat);
|
|
423
423
|
}, onKeyDown: (e3) => {
|
|
424
424
|
e3.keyCode !== Sa.Enter && e3.keyCode !== Sa.Space || a2(r2.numberFormat);
|
|
425
|
-
}, ...s2, children: E(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [E(Z, { component: "div", children: [r2.formatType, r2.formatType === l.Type.Custom ? "…" : ""] }), N(Z, { variant: "caption", component: "div", sx: { color: (e3) =>
|
|
426
|
-
}),
|
|
425
|
+
}, ...s2, children: E(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [E(Z, { component: "div", children: [r2.formatType, r2.formatType === l.Type.Custom ? "…" : ""] }), N(Z, { variant: "caption", component: "div", sx: { color: (e3) => Ua(e3.palette.text.primary, 0.6), paddingTop: n2 && n2.length > 0 ? "1px" : void 0, overflow: "hidden", textOverflow: "ellipsis" }, children: n2 && n2.length > 0 ? n2 : " " })] }) });
|
|
426
|
+
}), Ir = L(H((e2, t2) => {
|
|
427
427
|
const { commands: o2, commandHook: n2, scope: a2, sx: i2, disabled: s2 = false, parentFloat: d2, ...c2 } = e2, m2 = ba(o2, ["formatNumberFormat"])[0], p2 = m2?.state() ? l.Styles.lookupStyle(m2?.state()).formatType : l.Type.General, u2 = W(() => {
|
|
428
428
|
if (!n2) return null;
|
|
429
429
|
const e3 = { ...n2 };
|
|
@@ -441,30 +441,30 @@ const nr = L(H((e2, t2) => {
|
|
|
441
441
|
}
|
|
442
442
|
"" === t4 && i3[e4].formatType === l.Type.General && (t4 = "No specific format");
|
|
443
443
|
const n3 = i3[e4].formatType === p2;
|
|
444
|
-
d3.push(N(
|
|
444
|
+
d3.push(N(Ar, { selected: n3, disabled: s2 || !m2 || m2.disabled(), formattedValue: t4, handleSetFormat: o3, format: i3[e4] }, i3[e4].formatType));
|
|
445
445
|
}
|
|
446
|
-
const g3 = { numberFormat: "", formatType: l.Type.Custom }, h3 = p2 === l.Type.Custom, f3 = N(
|
|
446
|
+
const g3 = { numberFormat: "", formatType: l.Type.Custom }, h3 = p2 === l.Type.Custom, f3 = N(Ar, { selected: h3, disabled: s2 || !m2 || m2.disabled(), formattedValue: h3 ? r2.getNumberFormat().displayText : "", handleSetFormat: () => {
|
|
447
447
|
n2?.beforeExecute?.(m2, m2?.state()), t3.getCommand("formatNumberDialog")?.execute(m2?.state()), n2?.onExecute?.(m2, m2?.state());
|
|
448
448
|
}, format: g3, sx: { flex: "0", width: "100%" } }, l.Type.Custom), x2 = E(X, { className: "quick-buttons", sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (e4) => e4.stopPropagation(), children: [N(ke, { command: t3.getCommand("formatNumberFormatAccountingStyle"), commandHook: u2, scope: a2, icon: N(gt, {}) }), N(ke, { command: t3.getCommand("formatNumberFormatPercentStyle"), commandHook: u2, scope: a2, icon: N(ht, {}) }), N(ke, { command: t3.getCommand("formatNumberFormatCommaStyle"), commandHook: u2, scope: a2, icon: N(ft, {}) }), N(ke, { command: t3.getCommand("formatNumberFormatIncreaseDecimal"), commandHook: u2, scope: a2, icon: we(N(xt, {})) }), N(ke, { command: t3.getCommand("formatNumberFormatDecreaseDecimal"), commandHook: u2, scope: a2, icon: we(N(bt, {})) })] }), b2 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...c2, children: [x2, N(Se, { orientation: "horizontal" }), N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: d3 }), N(Se, { orientation: "horizontal" }), f3] });
|
|
449
449
|
return Te({ ...e3, children: b2 });
|
|
450
|
-
}, [m2?.context(), m2?.state(), n2, a2]), h2 =
|
|
450
|
+
}, [m2?.context(), m2?.state(), n2, a2]), h2 = $a(), f2 = W(() => {
|
|
451
451
|
const e3 = l.Type.MediumTime;
|
|
452
452
|
return `${r.getSharedMeasurer()(e3, Math.round(h2.typography.fontSize), h2.typography.fontFamily).width}px`;
|
|
453
453
|
}, [h2]);
|
|
454
454
|
return N(De, { ref: t2, commands: o2, sx: i2, outlined: true, disabled: s2, parentFloat: d2, createPopupPanel: g2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: m2?.label(), description: m2?.description(), disabled: t3, children: e3 }), icon: N(X, { sx: { display: "flex", paddingLeft: "4px", paddingRight: "4px", fontSize: (e3) => `${Math.round(e3.typography.fontSize)}px`, color: (e3) => e3.palette.text.secondary, fontFamily: (e3) => e3.typography.fontFamily, width: f2 }, children: N(X, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: p2 }) }), ...c2 });
|
|
455
|
-
})),
|
|
455
|
+
})), Lr = L(H((e2, t2) => {
|
|
456
456
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
457
457
|
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "clear", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("clearAll"), icon: N(yt, {}) }), N(ke, { ...o3, command: t3.getCommand("clearFormats"), icon: we(N(wt, {})) }), N(ke, { ...o3, command: t3.getCommand("clearContents"), icon: we(N(kt, {})) }), N(ke, { ...o3, command: t3.getCommand("clearComments") }), N(ke, { ...o3, command: t3.getCommand("clearHyperlinks") })] });
|
|
458
458
|
return Te({ ...e3, children: a3 });
|
|
459
459
|
}, [r2, n2, a2]);
|
|
460
460
|
return N(De, { ref: t2, commands: o2, disabled: r2, commandHook: n2, scope: a2, label: "Clear", tooltip: "Clear everything in the cell, or remove just the formatting or contents.", createPopupPanel: i2, icon: N(yt, {}), ...l2 });
|
|
461
|
-
})),
|
|
461
|
+
})), Hr = L(H((e2, t2) => {
|
|
462
462
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
463
463
|
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "fill", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("fillDown"), icon: we(N(St, {})) }), N(ke, { ...o3, command: t3.getCommand("fillRight"), icon: we(N(St, { sx: { transform: "rotate(270deg)" } })) }), N(ke, { ...o3, command: t3.getCommand("fillUp"), icon: we(N(St, { sx: { transform: "rotate(180deg)" } })) }), N(ke, { ...o3, command: t3.getCommand("fillLeft"), icon: we(N(St, { sx: { transform: "rotate(90deg)" } })) })] });
|
|
464
464
|
return Te({ ...e3, children: a3 });
|
|
465
465
|
}, [r2, n2, a2]);
|
|
466
466
|
return N(De, { ref: t2, commands: o2, disabled: r2, commandHook: n2, label: "Fill", tooltip: "Fill the selected cells with the value from one of the corners.", createPopupPanel: i2, icon: we(N(St, {})), ...l2 });
|
|
467
|
-
})),
|
|
467
|
+
})), Wr = L(H((e2, t2) => {
|
|
468
468
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, disableSheet: l2 = false, preferSingleMenu: i2 = true, showQuickButton: s2 = true, variant: d2 = ya.Toolbar, ...c2 } = e2, m2 = ["insertCellsShiftDown", "insertCellsShiftRight", "insertRows", "insertColumns"], p2 = ba(o2, m2), { singleCommand: u2, allDisabled: g2 } = W(() => {
|
|
469
469
|
let e3 = null, t3 = 0;
|
|
470
470
|
for (let o3 = 0; o3 < p2.length; o3++) p2[o3] && !p2[o3]?.disabled() && (i2 && d2 === ya.Menuitem && (e3 = 0 === t3 ? p2[o3] : null), t3++);
|
|
@@ -480,7 +480,7 @@ const nr = L(H((e2, t2) => {
|
|
|
480
480
|
return Te({ ...e3, children: i3 });
|
|
481
481
|
}, [r2, p2, n2, a2, h2]);
|
|
482
482
|
return u2 ? N(ke, { ref: t2, variant: d2, commandHook: n2, disabled: r2, command: u2, icon: h2.get(u2.key()), ...c2 }) : N(De, { ref: t2, variant: d2, quickCommand: "insertCells", commands: o2, commandHook: n2, scope: a2, disabled: r2 || g2, tooltip: E(A, { children: [N("span", { children: "Insert new cells, rows or columns to your workbook." }), N("br", {}), N("span", { children: "To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert." })] }), createPopupPanel: f2, icon: we(N(Tt, {})), ...c2 });
|
|
483
|
-
})),
|
|
483
|
+
})), zr = L(H((e2, t2) => {
|
|
484
484
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, disableSheet: l2 = false, preferSingleMenu: i2 = true, showQuickButton: s2 = true, variant: d2 = ya.Toolbar, ...c2 } = e2, m2 = ba(o2, ["deleteCellsShiftUp", "deleteCellsShiftLeft", "deleteRows", "deleteColumns"]), { singleCommand: p2, allDisabled: u2 } = W(() => {
|
|
485
485
|
let e3 = null, t3 = 0;
|
|
486
486
|
for (let o3 = 0; o3 < m2.length; o3++) m2[o3] && !m2[o3]?.disabled() && (i2 && d2 === ya.Menuitem && (e3 = 0 === t3 ? m2[o3] : null), t3++);
|
|
@@ -496,7 +496,7 @@ const nr = L(H((e2, t2) => {
|
|
|
496
496
|
return Te({ ...e3, children: i3 });
|
|
497
497
|
}, [r2, n2, a2, g2]);
|
|
498
498
|
return p2 ? N(ke, { ref: t2, variant: d2, commandHook: n2, disabled: r2, command: p2, icon: g2.get(p2.key()), ...c2 }) : N(De, { ref: t2, variant: d2, quickCommand: "deleteCells", commands: o2, commandHook: n2, scope: a2, disabled: r2 || u2, tooltip: E(A, { children: [N("span", { children: "Delete cells, rows, columns or sheets from your workbook." }), N("br", {}), N("span", { children: "To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete." })] }), createPopupPanel: h2, icon: we(N(Mt, {})), ...c2 });
|
|
499
|
-
})),
|
|
499
|
+
})), $r = L(H((t2, o2) => {
|
|
500
500
|
const { command: n2, commandHook: a2, onSelectColor: r2, disabled: l2 = false, variant: i2 = ya.Toolbar, quickColor: s2, panelProps: d2, isSplit: c2 = false, darkMode: m2, icon: p2, ...u2 } = t2, { autoColor: g2, schemeLookup: h2, recentColors: f2, ...x2 } = d2;
|
|
501
501
|
if (u2.selectedColor) throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");
|
|
502
502
|
Ca(n2);
|
|
@@ -510,28 +510,28 @@ const nr = L(H((e2, t2) => {
|
|
|
510
510
|
let s3 = e2.children;
|
|
511
511
|
return (n2?.disabled() || l2) && (s3 = N("div", { children: s3 })), N(Qe, { command: n2, placement: i2 === ya.Toolbar ? "bottom-start" : "right-start", disabled: t3, ...r3, children: s3 });
|
|
512
512
|
}, [n2, l2]);
|
|
513
|
-
return N(
|
|
513
|
+
return N(vr, { ref: o2, panelProps: v2, icon: p2, quickColor: y2, selectedColor: n2?.state(), onSelectColor: T2, variant: i2 === ya.Menuitem ? Ge.Menuitem : Ge.Toolbar, createTooltip: D2, label: n2?.label(), disabled: l2 || !n2 || n2.disabled(), compareRGB: true, darkMode: C2, ...u2 });
|
|
514
514
|
}));
|
|
515
|
-
|
|
516
|
-
const
|
|
515
|
+
$r.displayName = "ColorCommandButton";
|
|
516
|
+
const Or = L(H((e2, t2) => {
|
|
517
517
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, parentFloat: l2, ...i2 } = e2, s2 = ba(o2, ["gridlinesToggle", "sheetViewToggleGridlinesColumns", "sheetViewToggleGridlinesRows"]), d2 = z((e3, t3) => {
|
|
518
|
-
const o3 = { variant: ya.Menuitem, parentFloat: e3.floatReference, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("gridlinesToggle") }), N(
|
|
518
|
+
const o3 = { variant: ya.Menuitem, parentFloat: e3.floatReference, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("gridlinesToggle") }), N($r, { ...o3, command: t3.getCommand("sheetViewFormatGridlinesColor"), icon: N(Ze, {}), panelProps: { disableAlpha: true } }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("sheetViewToggleGridlinesColumns") }), N(ke, { ...o3, command: t3.getCommand("sheetViewToggleGridlinesRows") })] });
|
|
519
519
|
return Te({ ...e3, children: l3 });
|
|
520
520
|
}, [r2, n2]);
|
|
521
521
|
return N(De, { ref: t2, parentFloat: l2, quickCommand: s2[0]?.key(), commands: o2, commandHook: n2, createPopupPanel: d2, label: "Gridlines", tooltip: "Configure how the lines between rows and columns in the sheet are displayed.", icon: N(Ft, { command: s2[0], scope: "view" }), ...i2 });
|
|
522
|
-
})),
|
|
522
|
+
})), Vr = L(H((e2, t2) => {
|
|
523
523
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
524
524
|
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "sort", disabled: r2 }, a3 = t3.getCommand("sortCustom"), l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("sortAscending"), icon: we(N(Bt, {})) }), N(ke, { ...o3, command: t3.getCommand("sortDescending"), icon: we(N(Nt, {})) }), a3 ? N(ke, { ...o3, command: a3, icon: we(N(Et, {})) }) : null, N(Se, { orientation: "horizontal" }), N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterToggle"), icon: we(N(At, {})) }), N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterClear"), icon: we(N(It, {})) }), N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterReapply"), icon: we(N(Lt, {})) })] });
|
|
525
525
|
return Te({ ...e3, children: l3 });
|
|
526
526
|
}, [r2, n2, a2]);
|
|
527
527
|
return N(De, { ref: t2, commands: o2, commandHook: n2, scope: a2, disabled: r2, label: "Sort", tooltip: E(A, { children: [N("span", { children: "Organize your data so it's easier to analyze." }), N("br", {}), N("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), createPopupPanel: i2, icon: we(N(Bt, {})), ...l2 });
|
|
528
|
-
})),
|
|
528
|
+
})), Gr = L(H((e2, t2) => {
|
|
529
529
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
530
530
|
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "sort", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterToggle"), icon: we(N(At, {})) }), N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterClear"), icon: we(N(It, {})) }), N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterReapply"), icon: we(N(Lt, {})) })] });
|
|
531
531
|
return Te({ ...e3, children: a3 });
|
|
532
532
|
}, [r2, n2, a2]);
|
|
533
533
|
return N(De, { ref: t2, commands: o2, commandHook: n2, scope: a2, disabled: r2, label: "Filter", tooltip: E(A, { children: [N("span", { children: "Organize your data so it's easier to analyze." }), N("br", {}), N("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), createPopupPanel: i2, icon: we(N(At, {})), ...l2 });
|
|
534
|
-
})),
|
|
534
|
+
})), Ur = L(H((e2, t2) => {
|
|
535
535
|
const { quickCommand: o2, icon: n2, isRedo: a2 = false, nestRedo: r2 = true, undoManager: l2, scope: i2, sx: s2, disabled: d2, commands: c2, ...m2 } = e2, p2 = [o2];
|
|
536
536
|
!a2 && r2 && p2.push("redo");
|
|
537
537
|
const u2 = ba(c2, p2), g2 = u2[0], h2 = u2[1], f2 = l2 ?? g2?.context?.()?.undoManager;
|
|
@@ -568,7 +568,7 @@ const Wr = L(H((e2, t2) => {
|
|
|
568
568
|
let c3 = null;
|
|
569
569
|
if (!a2 && r2) {
|
|
570
570
|
const o4 = { scope: "undo", commands: t3, variant: ya.Menuitem, parentFloat: e3.floatReference };
|
|
571
|
-
c3 = [], c3.push(N(
|
|
571
|
+
c3 = [], c3.push(N(Ur, { ...o4, quickCommand: "redo", isRedo: true }, "nested:redo")), f2.hasRedo() && f2.hasUndo() && c3.push(N(Se, { orientation: "horizontal" }, "action:redo-div"));
|
|
572
572
|
}
|
|
573
573
|
const m3 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, onClick: () => {
|
|
574
574
|
e3.closeFloatAll();
|
|
@@ -578,17 +578,17 @@ const Wr = L(H((e2, t2) => {
|
|
|
578
578
|
return Te({ ...e3, children: m3 });
|
|
579
579
|
}, [g2?.context(), g2?.state(), i2, f2, b2, x2]);
|
|
580
580
|
return N(De, { ref: t2, commands: c2, quickCommand: o2, scope: i2, disabled: x2, label: g2?.label() ?? (a2 ? "Redo" : "Undo"), tooltip: N(A, { children: N("span", { children: `${g2?.label() ?? "No"} last actions.` }) }), createPopupPanel: w2, icon: n2 ?? we(N(a2 ? Ht : Wt, {})), selected: false, ...m2 });
|
|
581
|
-
})),
|
|
582
|
-
for (let e2 = 0; e2 <
|
|
583
|
-
const
|
|
581
|
+
})), jr = i.getFontList(), _r = /* @__PURE__ */ new Map();
|
|
582
|
+
for (let e2 = 0; e2 < jr.length; e2++) _r.set(jr[e2].fontRef.getFamily(), jr[e2]);
|
|
583
|
+
const qr = L(H((e2, t2) => {
|
|
584
584
|
const { command: o2, commandHook: n2, sx: a2, disabled: l2 = false, parentFloat: i2, icon: s2, label: d2, ...c2 } = e2;
|
|
585
585
|
Ca(o2);
|
|
586
|
-
const m2 = o2?.state(), p2 =
|
|
586
|
+
const m2 = o2?.state(), p2 = $a(), u2 = W(() => `${r.getSharedMeasurer()("Times New Roman", Math.round(p2.typography.fontSize), p2.typography.fontFamily).width}px`, [p2]), g2 = z((e3) => {
|
|
587
587
|
const t3 = (e4) => {
|
|
588
588
|
o2?.execute(e4, n2);
|
|
589
589
|
}, a3 = [];
|
|
590
|
-
for (let e4 = 0; e4 <
|
|
591
|
-
|
|
590
|
+
for (let e4 = 0; e4 < jr.length; e4++) a3.push({ key: jr[e4].fontRef.getFamily(), description: jr[e4].fontRef.getFamily() });
|
|
591
|
+
_r.get(m2) || a3.unshift({ key: m2, description: m2 });
|
|
592
592
|
const r2 = [];
|
|
593
593
|
for (let e4 = 0; e4 < a3.length; e4++) {
|
|
594
594
|
const n3 = a3[e4].key === m2;
|
|
@@ -604,7 +604,7 @@ const Ur = L(H((e2, t2) => {
|
|
|
604
604
|
return Te({ ...e3, children: i3 });
|
|
605
605
|
}, [l2, o2?.state()]);
|
|
606
606
|
return N(Ue, { ref: t2, sx: { ...a2 }, outlined: true, disabled: l2, parentFloat: i2, createPopupPanel: g2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: o2?.label(), description: o2?.description(), disabled: t3, children: e3 }), icon: N(X, { sx: { display: "flex", paddingLeft: "4px", paddingRight: "4px", fontSize: (e3) => `${Math.round(e3.typography.fontSize)}px`, fontFamily: (e3) => e3.typography.fontFamily, color: (e3) => e3.palette.text.secondary, width: u2 }, children: N(X, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: m2 }) }), ...c2 });
|
|
607
|
-
})),
|
|
607
|
+
})), Kr = L(H((e2, t2) => {
|
|
608
608
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["formatStrikeThroughToggle", "formatSuperscriptToggle", "formatSubscriptToggle"]), s2 = W(() => {
|
|
609
609
|
for (let e3 = 0; e3 < i2.length; e3++) if (i2[e3]?.state()) return i2[e3].key();
|
|
610
610
|
return i2[0]?.key();
|
|
@@ -616,7 +616,7 @@ const Ur = L(H((e2, t2) => {
|
|
|
616
616
|
return Te({ ...e3, children: a3 });
|
|
617
617
|
}, [r2, n2, a2]);
|
|
618
618
|
return N(De, { ref: t2, quickCommand: s2, commands: o2, commandHook: n2, createPopupPanel: c2, label: "Text Effects", tooltip: "Style your text to differentiate it.", icon: d2.get(s2) ?? we(N(zt, {})), ...l2 });
|
|
619
|
-
})),
|
|
619
|
+
})), Xr = L(H((e2, t2) => {
|
|
620
620
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["formatUnderlinedToggle", "formatUnderlinedDoubleToggle", "formatUnderlinedAccountingToggle", "formatUnderlinedAccountingDoubleToggle"]), s2 = W(() => {
|
|
621
621
|
for (let e3 = 0; e3 < i2.length; e3++) if (i2[e3]?.state()) return i2[e3].key();
|
|
622
622
|
return i2[0]?.key();
|
|
@@ -628,37 +628,37 @@ const Ur = L(H((e2, t2) => {
|
|
|
628
628
|
return Te({ ...e3, children: a3 });
|
|
629
629
|
}, [r2, n2, a2]);
|
|
630
630
|
return N(De, { ref: t2, quickCommand: s2, commands: o2, commandHook: n2, label: "Underline", tooltip: "All underline stylings.", createPopupPanel: c2, icon: d2.get(s2) ?? we(N(Vt, {})), ...l2 });
|
|
631
|
-
})),
|
|
631
|
+
})), Zr = L(H((e2, t2) => {
|
|
632
632
|
const { command: o2, commands: n2, commandHook: a2, scope: r2, includePasteAllInPopup: l2 = true, disabled: i2 = false, ...s2 } = e2, d2 = wa((e3, t3) => {
|
|
633
633
|
const o3 = { variant: ya.Menuitem, commandHook: a2, scope: "paste", disabled: i2 }, n3 = [];
|
|
634
634
|
return l2 && (n3.push(j(ke, { ...o3, command: t3.getCommand("paste"), key: "paste", icon: N(_t, {}) })), n3.push(N(Se, { orientation: "horizontal" }, "paste-div"))), n3.push(j(ke, { ...o3, command: t3.getCommand("pasteValues"), key: "pasteValues", icon: we(N(qt, {})) })), n3.push(j(ke, { ...o3, command: t3.getCommand("pasteFormats"), key: "pasteFormats", icon: we(N(Kt, {})) })), n3.push(j(ke, { ...o3, command: t3.getCommand("pasteFormulas"), key: "pasteFormulas", icon: we(N(Xt, {})) })), n3.push(j(ke, { ...o3, command: t3.getCommand("pasteTranspose"), key: "pasteTranspose", icon: we(N(Zt, {})) })), n3.push(j(ke, { ...o3, command: t3.getCommand("pasteLinks"), key: "pasteLinks", icon: we(N(Jt, {})) })), Te({ ...e3, children: n3 });
|
|
635
635
|
}, [i2, a2, r2, l2]);
|
|
636
636
|
return N(De, { ref: t2, commands: n2, commandHook: a2, scope: r2, createPopupPanel: d2, label: "Paste", tooltip: "Add content to the clipboard to your document.", quickCommand: "paste", icon: N(_t, {}), ...s2 });
|
|
637
|
-
})),
|
|
637
|
+
})), Jr = L(H((e2, t2) => {
|
|
638
638
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, parentFloat: l2, ...i2 } = e2, s2 = ba(o2, ["sheetViewToggleShowHeadings", "sheetViewToggleShowHeadingColumns", "sheetViewToggleShowHeadingRows"]), d2 = z((e3, t3) => {
|
|
639
639
|
const o3 = { variant: ya.Menuitem, parentFloat: e3.floatReference, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("sheetViewToggleShowHeadings") }), N(ke, { ...o3, command: t3.getCommand("sheetViewToggleShowHeadingsNumeric") }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("sheetViewToggleShowHeadingColumns") }), N(ke, { ...o3, command: t3.getCommand("sheetViewToggleShowHeadingRows") })] });
|
|
640
640
|
return Te({ ...e3, children: l3 });
|
|
641
641
|
}, [r2, n2, a2]);
|
|
642
642
|
return N(De, { ref: t2, parentFloat: l2, quickCommand: s2[0]?.key(), commands: o2, commandHook: n2, createPopupPanel: d2, label: "Headings", tooltip: "Configure how the column and rows headings in the sheet are displayed.", icon: N(Ft, { command: s2[0], scope: "view" }), ...i2 });
|
|
643
|
-
})),
|
|
643
|
+
})), Yr = L(H((e2, t2) => {
|
|
644
644
|
const { commands: o2, commandHook: n2, scope: a2 = "view", disabled: r2 = false, ...l2 } = e2, i2 = z((e3) => {
|
|
645
645
|
const t3 = { variant: ya.Menuitem, parentFloat: e3.floatReference, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...t3, command: o2.getCommand("workbookViewToggleShowFormulaBar") }), N(ke, { ...t3, command: o2.getCommand("workbookViewToggleShowTabs") }), N(ke, { ...t3, command: o2.getCommand("workbookViewToggleShowStatusBar") }), N(Se, { orientation: "horizontal" }), N(ke, { ...t3, command: o2.getCommand("workbookViewToggleShowHorizontalScrollBar") }), N(ke, { ...t3, command: o2.getCommand("workbookViewToggleShowVerticalScrollBar") })] });
|
|
646
646
|
return Te({ ...e3, children: l3 });
|
|
647
647
|
}, [r2, o2, n2, a2]);
|
|
648
648
|
return N(De, { ref: t2, commands: o2, disabled: r2, commandHook: n2, scope: a2, label: "Workbook View", tooltip: "Options to configure how the workbook is displayed.", createPopupPanel: i2, icon: N(Ft, { icon: null, label: "Workbook View" }), ...l2 });
|
|
649
|
-
})),
|
|
649
|
+
})), Qr = L(H((e2, t2) => {
|
|
650
650
|
const { value: o2, cellStyle: n2, styles: a2, createTemporaryCell: r2, bodyStyle: l2, sx: i2, borderProps: s2, disabled: c2, ...m2 } = e2, p2 = W(() => r2({ value: o2, style: n2 }), [o2, n2, r2]), u2 = W(() => p2.getStyle(), [p2, l2]), g2 = W(() => u2.getFill().toCSS(l2?.darkMode ?? false), [u2]), h2 = u2.getInsets(), f2 = u2.getFont(), x2 = z(() => u2.getBorder(), [u2]);
|
|
651
651
|
return N(X, { ref: t2, sx: { width: "100px", textOverflow: "ellipsis", display: "flex", alignItems: "stretch", background: l2?.fill, filter: c2 ? "grayscale(0.4) opacity(0.8);" : "none", "& .fill": { flex: "1 1 100%", overflow: "hidden", ...g2 }, "& .text": { flex: "1 1 100%", ...f2.toCSS(l2?.darkMode ?? false, 1), boxSizing: "border-box", padding: `${h2.top}px ${h2.right}px ${h2.bottom}px ${h2.left}px`, margin: "0px", outline: "none", resize: "none", overflow: "hidden", textOverflow: "ellipsis", verticalAlign: "baseline", textDecoration: f2.toCSS().textDecoration, textAlign: d.toCSSHorizontalTextAlign(p2.getRenderHorizontalAlignment()), background: "transparent", maxHeight: "100%", whiteSpace: "pre", wordWrap: "break-word" }, ...i2 }, ...m2, children: N(b, { getBorderAt: x2, darkMode: l2?.darkMode ?? false, rowCount: 1, columnCount: 1, style: { display: "flex", flex: "1 1 100%", width: "100%", maxWidth: "100%", justifyContent: "start", alignItems: "stretch", ...s2?.style }, ...s2, children: N(X, { className: "fill", sx: { paddingLeft: "4px", paddingRight: "4px", marginLeft: "-1px", marginTop: "-1px", marginRight: "-1px", marginBottom: "-1px", overflow: "hidden", display: "flex", alignItems: "center" }, children: N(X, { className: "text", children: o2 }) }) }) });
|
|
652
|
-
})),
|
|
652
|
+
})), el = L((e2) => {
|
|
653
653
|
const { styles: t2, namedStyle: o2, selectedNamed: n2, hasContextMenu: a2 = true, bodyStyle: r2, onSelectNamed: l2, createTemporaryCell: i2, parentFloat: d2, commands: c2, disabled: m2, commandHook: p2, ...u2 } = e2, g2 = z((e3) => {
|
|
654
654
|
const t3 = { variant: ya.Menuitem, commandHook: p2, context: "cellStyle" }, n3 = E(A, { children: [N(ke, { ...t3, sx: { fontWeight: 550 }, command: c2.getCommand("formatCellStyle"), commandState: o2, disabled: m2, icon: we(N(Qt, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...t3, command: c2.getCommand("modifyCellStyle"), commandState: { named: o2 } }), N(ke, { ...t3, command: c2.getCommand("deleteCellStyle"), commandState: o2, disabled: m2 || o2?.getName() === s.BuiltInName.Normal })] });
|
|
655
655
|
return Te({ ...e3, children: N(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: n3 }) }) });
|
|
656
656
|
}, []), h2 = o2?.getName() === n2?.getName();
|
|
657
657
|
let f2 = N(Ye, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (e3) => `solid ${h2 ? e3.palette.primary.dark : "transparent"} 1px` }, tooltipProps: { label: o2.getName(), placement: "bottom-start" }, disabled: m2, icon: null, onClick: () => {
|
|
658
658
|
l2?.(o2);
|
|
659
|
-
}, ...u2, children: N(
|
|
659
|
+
}, ...u2, children: N(Qr, { value: o2.getName(), cellStyle: { named: o2.getName() }, styles: t2, createTemporaryCell: i2, bodyStyle: r2 }) }, o2.getName());
|
|
660
660
|
return a2 && (f2 = N(to, { label: o2.getName(), parentFloat: d2, createPopupPanel: g2, children: f2 })), f2;
|
|
661
|
-
}),
|
|
661
|
+
}), tl = L(H((e2, t2) => {
|
|
662
662
|
const { commands: o2, command: n2, commandHook: a2, selectedNamed: l2, onSelectNamed: i2, disabled: d2 = false, bodyStyle: c2, usePreviewIcon: m2 = true, ...p2 } = e2;
|
|
663
663
|
Ca(n2);
|
|
664
664
|
const u2 = n2?.context(), g2 = u2?.styles, h2 = l2 ?? u2?.named(), f2 = c2 ?? u2?.bodyStyle(), x2 = wa((e3) => {
|
|
@@ -668,7 +668,7 @@ const Ur = L(H((e2, t2) => {
|
|
|
668
668
|
for (let e4 = 0; e4 < r2.length; e4++) l3.set(r2[e4].getName(), r2[e4]), null === g2().getNamed(r2[e4].getName()).getBuiltInID() && i3.push(r2[e4].getName());
|
|
669
669
|
const c3 = (e4) => {
|
|
670
670
|
let t4 = l3.get(e4);
|
|
671
|
-
return t4 || (t4 = g2().getNamed(e4)), !t4 || t4.isHidden() ? null : N(
|
|
671
|
+
return t4 || (t4 = g2().getNamed(e4)), !t4 || t4.isHidden() ? null : N(el, { namedStyle: t4, selectedNamed: h2, bodyStyle: u2.bodyStyle(), createTemporaryCell: u2.createTemporaryCell, commands: o2, commandHook: a2, ...n3 }, e4);
|
|
672
672
|
}, m3 = (e4, t4, o3 = true) => {
|
|
673
673
|
const n4 = [];
|
|
674
674
|
for (let e5 = 0; e5 < t4.length; e5++) {
|
|
@@ -692,10 +692,10 @@ const Ur = L(H((e2, t2) => {
|
|
|
692
692
|
}, [h2, g2?.().getTheme(), f2]), y2 = wa((e3) => {
|
|
693
693
|
const t3 = 18 / r.getDeviceScale(), o3 = u2?.createTemporaryCell(e3);
|
|
694
694
|
return o3.getStyle().getFont().getSize() <= t3 ? o3 : o3.createTemporaryCell({ style: { font: { size: t3 } } });
|
|
695
|
-
}, [u2?.createTemporaryCell]), w2 = d2 || !n2 || n2.disabled(), k2 = W(() => u2 && m2 ? N(
|
|
695
|
+
}, [u2?.createTemporaryCell]), w2 = d2 || !n2 || n2.disabled(), k2 = W(() => u2 && m2 ? N(Qr, { value: h2?.getName() ?? "Custom", cellStyle: h2 ? { named: h2.getName() } : void 0, styles: u2.styles(), createTemporaryCell: y2, bodyStyle: u2.bodyStyle(), className: "outline-hover", disabled: w2, sx: { maxHeight: "24px", height: "24px", marginRight: "2px", outline: (e3) => `1px solid ${e3.palette.action.hover}` }, borderProps: {} }) : we(N(Qt, {})), [h2, f2, w2]);
|
|
696
696
|
return N(De, { ref: t2, createPopupPanel: b2, outlined: m2, commands: o2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: n2?.label(), description: n2?.description(), disabled: t3, children: e3 }), selected: false, disabled: w2, label: n2?.label(), icon: k2, ...p2 });
|
|
697
|
-
})),
|
|
698
|
-
const { styles: o2, table: n2, tableStyle: a2 = n2?.getStyle() ?? o2.getDefaultTableStyle(), bodyStyle: r2, sx: l2, disabled: i2, className: s2, forceThinBorder: d2, cellHeight: m2 =
|
|
697
|
+
})), ol = "_sheetxl-reset_11z3j_1", nl = 10, al = L(H((e2, t2) => {
|
|
698
|
+
const { styles: o2, table: n2, tableStyle: a2 = n2?.getStyle() ?? o2.getDefaultTableStyle(), bodyStyle: r2, sx: l2, disabled: i2, className: s2, forceThinBorder: d2, cellHeight: m2 = nl, isLive: p2 = false, ...u2 } = e2, g2 = Math.ceil(1.3 * m2), [h2, f2] = _((e3) => e3 + 1, 0);
|
|
699
699
|
V(() => {
|
|
700
700
|
if (p2 && n2) return n2.addListeners({ onAnyChange: () => {
|
|
701
701
|
f2();
|
|
@@ -728,10 +728,10 @@ const Ur = L(H((e2, t2) => {
|
|
|
728
728
|
}
|
|
729
729
|
return t3;
|
|
730
730
|
}, [x2, a2, r2]), k2 = z((e3, t3) => y2[t3].getBorder() ?? null, [y2]);
|
|
731
|
-
return N(X, { ref: t2, className: "table-format-preview", sx: { background: r2?.fill, filter: i2 ? "grayscale(0.4) opacity(0.8);" : "none", "& .styled-element": { position: "absolute" }, ...l2 }, ...u2, children: N(b, { getBorderAt: k2, rowCount: 5, columnCount: 5, forceThinBorder: d2, width: 5 * (g2 - 1) + 1, height: 5 * (m2 - 1) + 1, darkMode: r2?.darkMode ?? false, style: { pointerEvents: "none" }, children: N("table", { className: Yn(s2, "sheetxl-table-preview",
|
|
732
|
-
})),
|
|
731
|
+
return N(X, { ref: t2, className: "table-format-preview", sx: { background: r2?.fill, filter: i2 ? "grayscale(0.4) opacity(0.8);" : "none", "& .styled-element": { position: "absolute" }, ...l2 }, ...u2, children: N(b, { getBorderAt: k2, rowCount: 5, columnCount: 5, forceThinBorder: d2, width: 5 * (g2 - 1) + 1, height: 5 * (m2 - 1) + 1, darkMode: r2?.darkMode ?? false, style: { pointerEvents: "none" }, children: N("table", { className: Yn(s2, "sheetxl-table-preview", ol), style: { borderCollapse: "collapse", width: 5 * (g2 - 1) + 1, height: 5 * (m2 - 1) + 1 }, children: N("tbody", { children: w2 }) }) }) });
|
|
732
|
+
})), rl = (e2, t2, o2, n2, a2) => {
|
|
733
733
|
e2.beginPath(), e2.moveTo(t2 + 0.5, o2 + 0.5), e2.lineTo(n2 + 0.5, a2 + 0.5), e2.stroke();
|
|
734
|
-
},
|
|
734
|
+
}, ll = L(H((e2, t2) => {
|
|
735
735
|
const { table: o2, tableStyle: n2, styles: a2, bodyStyle: r2, disabled: l2, style: i2, className: s2, canvas: d2, ...p2 } = e2, u2 = W(() => {
|
|
736
736
|
const e3 = o2.toJSON(), t3 = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
737
737
|
return e3.styleOptions = { ...e3.styleOptions, name: n2.getName() }, e3.ref = t3, new c({ initialAnchor: t3, json: e3, styles: a2 });
|
|
@@ -761,22 +761,22 @@ const Ur = L(H((e2, t2) => {
|
|
|
761
761
|
const r3 = g2[5 * e4 + a3], l3 = a3 * o3, i3 = 9 * e4, s3 = r3.getBorder();
|
|
762
762
|
if (!s3.isEmpty()) {
|
|
763
763
|
const a4 = s3.getLeft();
|
|
764
|
-
a4.isNone() || (t3.strokeStyle = a4.getColor().toCSS(n3, false),
|
|
764
|
+
a4.isNone() || (t3.strokeStyle = a4.getColor().toCSS(n3, false), rl(t3, l3, i3, l3, i3 + 9));
|
|
765
765
|
const r4 = s3.getTop();
|
|
766
|
-
r4.isNone() || (t3.strokeStyle = r4.getColor().toCSS(n3, false),
|
|
766
|
+
r4.isNone() || (t3.strokeStyle = r4.getColor().toCSS(n3, false), rl(t3, l3, i3, l3 + o3, 9 * e4));
|
|
767
767
|
const d4 = s3.getRight();
|
|
768
|
-
d4.isNone() || (t3.strokeStyle = d4.getColor().toCSS(n3, false),
|
|
768
|
+
d4.isNone() || (t3.strokeStyle = d4.getColor().toCSS(n3, false), rl(t3, l3 + o3, i3, l3 + o3, i3 + 9));
|
|
769
769
|
const c3 = s3.getBottom();
|
|
770
|
-
c3.isNone() || (t3.strokeStyle = c3.getColor().toCSS(n3, false),
|
|
770
|
+
c3.isNone() || (t3.strokeStyle = c3.getColor().toCSS(n3, false), rl(t3, l3, i3 + 9, l3 + o3, i3 + 9));
|
|
771
771
|
}
|
|
772
772
|
t3.strokeStyle = r3.getFont().getFill().toCSS(n3, false);
|
|
773
773
|
const d3 = 4, c2 = 2.5;
|
|
774
|
-
|
|
774
|
+
rl(t3, a3 * o3 + c2, 9 * e4 + d3, a3 * o3 + c2 + 7, 9 * e4 + d3);
|
|
775
775
|
}
|
|
776
776
|
return `url(${e3.toDataURL()})`;
|
|
777
777
|
}, [d2, u2, n2, r2]);
|
|
778
778
|
return N("div", { ref: t2, className: Yn("table-style-preview", s2), style: { backgroundImage: h2, width: 61, height: 46, ...i2 }, ...p2 });
|
|
779
|
-
})),
|
|
779
|
+
})), il = L(H((e2, t2) => {
|
|
780
780
|
const { styleOptions: o2, onStyleOptionsChange: n2, showHeaderRow: a2, onShowHeaderRowChange: r2, showTotalRow: l2, onShowTotalRowChange: i2, showFilterButton: s2, onShowFilterButtonChange: d2, sx: c2, disabled: m2, ...p2 } = e2;
|
|
781
781
|
return E(X, { sx: { display: "flex", flexDirection: "column", flexWrap: "wrap", userSelect: "none", pt: 1, pb: 1, "& .MuiFormControlLabel-root": { marginLeft: (e3) => `${e3.spacing(2)}`, marginRight: (e3) => `${e3.spacing(2)}` }, "& .MuiCheckbox-root": { padding: (e3) => `${e3.spacing(0.5)}` }, ...c2 }, ...p2, ref: t2, children: [r2 && N(ne, { control: N(ae, { checked: a2 ?? false, indeterminate: null == a2, onChange: () => r2(!a2), disabled: m2 || null == a2 }), label: "Header Row", labelPlacement: "end" }), i2 && N(ne, { control: N(ae, { checked: l2 ?? false, indeterminate: null == l2, onChange: () => i2(!l2), disabled: m2 || null == l2 }), label: "Total Row", labelPlacement: "end" }), N(ne, { control: N(ae, { checked: o2?.showRowStripes ?? false, indeterminate: !o2, disabled: m2 || !o2, onChange: () => {
|
|
782
782
|
n2?.({ ...o2, showRowStripes: !o2?.showRowStripes });
|
|
@@ -787,19 +787,19 @@ const Ur = L(H((e2, t2) => {
|
|
|
787
787
|
} }), label: "Last Column", labelPlacement: "end" }), N(ne, { control: N(ae, { checked: o2?.showColumnStripes ?? false, indeterminate: !o2, disabled: m2 || !o2, onChange: () => {
|
|
788
788
|
n2?.({ ...o2, showColumnStripes: !o2?.showColumnStripes });
|
|
789
789
|
} }), label: "Banded Columns", labelPlacement: "end" }), d2 && N(ne, { control: N(ae, { checked: s2 ?? false, indeterminate: null == s2, disabled: m2 || !o2 || null == s2, onChange: () => d2(!s2) }), label: "Filter Button", labelPlacement: "end" })] });
|
|
790
|
-
})),
|
|
790
|
+
})), sl = L((e2) => {
|
|
791
791
|
const { table: t2, tableStyle: o2, selectedTableStyleName: n2, onSelectTableStyleName: a2, styles: r2, hasContextMenu: l2 = true, bodyStyle: i2, parentFloat: s2, commands: d2, disabled: c2, commandHook: m2, useCanvasPreview: p2 = true, canvas: u2, ...g2 } = e2, h2 = z((e3) => {
|
|
792
792
|
const t3 = { variant: ya.Menuitem, commandHook: m2, context: "table" }, n3 = E(A, { children: [N(ke, { ...t3, command: d2.getCommand("formatTableStyleClearCellStyles"), commandState: o2, disabled: c2, icon: we(N(Qt, {})) }), N(ke, { ...t3, sx: { fontWeight: 550 }, command: d2.getCommand("formatTableStyle"), commandState: { name: o2.getName() }, disabled: c2, icon: we(N(Qt, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...t3, command: d2.getCommand("setDefaultTableStyle"), commandState: o2.getName(), disabled: c2 }), N(Se, { orientation: "horizontal" }), N(ke, { ...t3, command: d2.getCommand("deleteTableStyle"), commandState: o2?.getName(), disabled: c2 || !o2 || o2.isBuiltIn() })] });
|
|
793
793
|
return Te({ ...e3, children: N(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: n3 }) }) });
|
|
794
794
|
}, [d2]), f2 = o2?.getName() === n2, x2 = W(() => {
|
|
795
795
|
const e3 = { table: t2, tableStyle: o2, styles: r2, bodyStyle: i2 };
|
|
796
|
-
return p2 ? N(
|
|
796
|
+
return p2 ? N(ll, { canvas: u2, ...e3 }) : N(al, { ...e3 });
|
|
797
797
|
}, [t2, o2, r2, i2]);
|
|
798
798
|
let b2 = N(Ye, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (e3) => `solid ${f2 ? e3.palette.primary.dark : "transparent"} 1px` }, tooltipProps: { label: o2.getName() ?? "None", placement: "bottom-start" }, disabled: c2, icon: null, onClick: () => {
|
|
799
799
|
a2?.(o2?.getName());
|
|
800
800
|
}, ...g2, children: x2 }, o2.getName());
|
|
801
801
|
return l2 && (b2 = N(to, { label: t2.getStyleOptions().name, parentFloat: s2, createPopupPanel: h2, children: b2 })), b2;
|
|
802
|
-
}),
|
|
802
|
+
}), dl = L(H((e2, t2) => {
|
|
803
803
|
const { commands: o2, command: n2, commandHook: a2, selectedTable: r2, onSelectTableStyleName: l2, disabled: i2 = false, bodyStyle: s2, usePreviewIcon: d2 = false, ...m2 } = e2;
|
|
804
804
|
Ca(n2);
|
|
805
805
|
const p2 = n2?.context(), u2 = p2?.styles, g2 = r2 ?? p2?.table?.();
|
|
@@ -819,7 +819,7 @@ const Ur = L(H((e2, t2) => {
|
|
|
819
819
|
S2.current || (S2.current = document.createElement("canvas"));
|
|
820
820
|
const n3 = (e4) => {
|
|
821
821
|
const n4 = u2().getTableStyle(e4);
|
|
822
|
-
return n4 ? N(
|
|
822
|
+
return n4 ? N(sl, { table: b2, tableStyle: n4, selectedTableStyleName: b2.getStyleOptions().name, bodyStyle: p2.bodyStyle(), commands: t3, commandHook: a2, canvas: S2.current, ...o3 }, e4) : null;
|
|
823
823
|
}, r3 = (e4, t4, o4 = true) => {
|
|
824
824
|
const a3 = [];
|
|
825
825
|
for (let e5 = 0; e5 < t4.length; e5++) {
|
|
@@ -849,27 +849,27 @@ const Ur = L(H((e2, t2) => {
|
|
|
849
849
|
if (!p2 || !d2) return we(N(Qt, {}));
|
|
850
850
|
}, [b2, w2, v2]);
|
|
851
851
|
return N(De, { ref: t2, quickCommand: h2, createPopupPanel: C2, commands: o2, label: n2?.label(), commandState: g2, commandHook: a2, selected: null !== g2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: n2?.label(), description: n2?.description(), disabled: t3, children: e3 }), disabled: v2, icon: T2, ...m2 });
|
|
852
|
-
})),
|
|
853
|
-
|
|
854
|
-
const
|
|
855
|
-
const { docTheme: t2, onSelectTheme: o2, darkMode: n2, isSelected: a2, outlined: r2, sx: l2, ...i2 } = e2, s2 =
|
|
852
|
+
})), cl = [];
|
|
853
|
+
cl.push(yr("Primary Background", "bg1")), cl.push(yr("Primary Text", "tx1")), cl.push(yr("Secondary Background", "bg2")), cl.push(yr("Secondary Text", "tx2")), cl.push(yr("Accent 1", "accent1")), cl.push(yr("Accent 2", "accent2")), cl.push(yr("Accent 3", "accent3")), cl.push(yr("Accent 4", "accent4")), cl.push(yr("Accent 5", "accent5")), cl.push(yr("Accent 6", "accent6"));
|
|
854
|
+
const ml = (e2) => {
|
|
855
|
+
const { docTheme: t2, onSelectTheme: o2, darkMode: n2, isSelected: a2, outlined: r2, sx: l2, ...i2 } = e2, s2 = $a(), d2 = W(() => {
|
|
856
856
|
let e3 = [];
|
|
857
|
-
for (let o3 = 0; o3 <
|
|
858
|
-
const a3 =
|
|
859
|
-
e3.push(N(
|
|
857
|
+
for (let o3 = 0; o3 < cl.length; o3++) {
|
|
858
|
+
const a3 = cl[o3];
|
|
859
|
+
e3.push(N(xr, { schemeColorLookup: t2.schemeLookup(), colorDef: a3, darkMode: n2, selectedColor: null }, o3 + "-colorDef"));
|
|
860
860
|
}
|
|
861
861
|
return N(X, { sx: { display: "flex", flexDirection: "row", flex: "none" }, children: N(X, { sx: { display: "flex", boxShadow: (e4) => e4.shadows[2] }, children: e3 }) });
|
|
862
862
|
}, [t2, s2]);
|
|
863
863
|
return N(Ye, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (e3) => `solid ${a2 ? e3.palette.text.primary : "transparent"} 1px`, "&:hover:not([disabled])": { border: (e3) => `solid ${e3.palette.text.primary} 1px !important` } }, icon: null, ...i2, children: E(X, { sx: { border: (e3) => `solid ${e3.palette.divider} 1px`, minWidth: "200px", borderRadius: "2px", padding: "4px 4px", textAlign: "left", display: "flex", gap: "4px", flexDirection: "column", alignItems: "stretch", color: (e3) => a2 ? e3.palette.text.primary : void 0, "&:hover:not([disabled])": { color: (e3) => e3.palette.text.primary } }, children: [N(X, { sx: {}, children: t2.getName() }), E(X, { sx: { paddingTop: "6px", paddingLeft: "12px", paddingRight: "12px", display: "flex", flexDirection: "column", alignItems: "stretch" }, children: [d2, N(X, { sx: { flex: "1 1 100%", textOverflow: "ellipsis", overflow: "hidden", marginTop: "2px", whiteSpace: "pre", fontFamily: () => t2.getFontScheme().getMajorFont() }, children: N(Oe, { disableInteractive: true, PopperProps: { style: { pointerEvents: "none" }, disablePortal: true, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: true, options: { boundariesElement: "viewport" } }] } }, title: N("div", { style: { textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "pre" }, children: `The font used for the body.
|
|
864
864
|
The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bottom-start", children: N("div", { children: t2.getFontScheme().getMinorFont() }) }) })] })] }) });
|
|
865
|
-
},
|
|
865
|
+
}, pl = L(H((e2, t2) => {
|
|
866
866
|
const { themes: o2, selectedTheme: n2, onSelectTheme: a2, sx: r2, disabled: l2 = false, darkMode: i2, ...s2 } = e2, d2 = W(() => {
|
|
867
867
|
const e3 = o2?.getItems({ selected: n2 }) ?? [], t3 = [];
|
|
868
868
|
if (0 === e3.length) return N(eo, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "6px", paddingBottom: "6px" }, children: "No themes" });
|
|
869
869
|
const r3 = e3.length;
|
|
870
870
|
for (let o3 = 0; o3 < r3; o3++) {
|
|
871
871
|
const r4 = e3[o3], s3 = n2 && r4?.getName() === n2.getName(), d3 = e3[o3 + 1];
|
|
872
|
-
d3 && d3.isCustom() !== r4.isCustom() && t3.push(N(Se, { orientation: "horizontal", sx: { marginBottom: "4px" } }, `divider-${o3}`)), t3.push(N(
|
|
872
|
+
d3 && d3.isCustom() !== r4.isCustom() && t3.push(N(Se, { orientation: "horizontal", sx: { marginBottom: "4px" } }, `divider-${o3}`)), t3.push(N(ml, { docTheme: r4, onSelectTheme: () => a2(r4), isSelected: s3, disabled: l2, darkMode: i2, onMouseDown: (e4) => {
|
|
873
873
|
0 === e4.button && e4.preventDefault();
|
|
874
874
|
}, onMouseUp: (e4) => {
|
|
875
875
|
0 === e4.button && a2(r4);
|
|
@@ -880,15 +880,15 @@ The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bot
|
|
|
880
880
|
return t3;
|
|
881
881
|
}, [n2, a2, i2]);
|
|
882
882
|
return N(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%" }, ref: t2, ...s2, children: E(X, { sx: { display: "flex", flexDirection: "column", overflow: "hidden" }, children: [N(eo, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "4px", paddingBottom: "2px" }, children: "Themes" }), N(Se, {}), N(X, { sx: { flex: "1 1 100%", overflow: "auto", padding: "6px 16px" }, children: d2 })] }) });
|
|
883
|
-
})),
|
|
883
|
+
})), ul = L(H((e2, t2) => {
|
|
884
884
|
const { themes: o2, selectedTheme: n2, onSelectTheme: a2, icon: r2, tooltip: l2, label: i2, variant: s2 = Ge.Toolbar, darkMode: d2, panelProps: c2, ...m2 } = e2, p2 = r2 || we(N(oo, {})), u2 = { createPopupPanel: z((e3) => {
|
|
885
885
|
const { closeFloatAll: t3 } = e3;
|
|
886
|
-
return N(
|
|
886
|
+
return N(pl, { ...c2, themes: o2, selectedTheme: n2, onSelectTheme: a2, darkMode: d2, onKeyDown: (e4) => {
|
|
887
887
|
e4.which === Sa.Enter && t3();
|
|
888
888
|
} });
|
|
889
889
|
}, [o2, n2, a2, c2, d2]), tooltip: l2 || i2 || "Theme", label: i2, icon: p2, ...m2 };
|
|
890
890
|
return s2 === Ge.Toolbar ? N(Ue, { ref: t2, ...u2 }) : N(je, { ref: t2, ...u2 });
|
|
891
|
-
})),
|
|
891
|
+
})), gl = L(H((e2, t2) => {
|
|
892
892
|
const { command: o2, commandHook: n2, selectedTheme: a2, onSelectTheme: r2, disabled: l2 = false, darkMode: i2, label: s2, icon: d2, variant: c2, ...m2 } = e2;
|
|
893
893
|
Ca(o2);
|
|
894
894
|
const p2 = o2?.context()?.themes, u2 = a2 || o2?.context()?.theme, g2 = i2 ?? o2?.context()?.darkMode, h2 = l2 || o2?.disabled(), f2 = wa((e3) => {
|
|
@@ -898,8 +898,8 @@ The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bot
|
|
|
898
898
|
let l3 = e3.children;
|
|
899
899
|
return (h2 || t3) && (l3 = N("div", { children: l3 })), N(Qe, { command: o2, placement: c2 === ya.Toolbar ? "bottom-start" : "right-start", disabled: h2 || t3, ...r3, children: l3 });
|
|
900
900
|
}, [o2, h2]);
|
|
901
|
-
return N(
|
|
902
|
-
})),
|
|
901
|
+
return N(ul, { ref: t2, themes: p2, selectedTheme: u2, onSelectTheme: f2, variant: c2 === ya.Menuitem ? Ge.Menuitem : Ge.Toolbar, createTooltip: x2, disabled: h2, darkMode: g2, icon: we(N(oo, {})), ...m2 });
|
|
902
|
+
})), hl = L(H((e2, t2) => {
|
|
903
903
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["themeMode"])[0], s2 = i2?.state(), d2 = null !== i2?.state(), c2 = re("(prefers-color-scheme: dark)"), m2 = "dark" === s2 || null === s2 && c2, p2 = wa((e3, t3) => {
|
|
904
904
|
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "appearance", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, command: i2, icon: we(N(m2 ? aa : ra, {})) }), N(ke, { ...o3, command: t3.getCommand("defaultThemeMode"), icon: we(N(c2 ? no : ao, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("enableDarkGrid") }), N(ke, { ...o3, command: t3.getCommand("enableDarkImages") })] });
|
|
905
905
|
return Te({ ...e3, children: a3 });
|
|
@@ -907,7 +907,7 @@ The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bot
|
|
|
907
907
|
return N(De, { ref: t2, quickCommand: "themeMode", commands: o2, commandHook: n2, createPopupPanel: p2, label: "Appearance", tooltip: "Change the light/dark mode to match your viewing preference. This does not affect the view for others.", onQuickClick: () => {
|
|
908
908
|
i2?.execute(m2 ? "light" : "dark", n2);
|
|
909
909
|
}, selected: d2, icon: we(N(m2 ? aa : ra, {})), ...l2 });
|
|
910
|
-
})),
|
|
910
|
+
})), fl = L(H((e2, t2) => {
|
|
911
911
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, sx: l2, ...i2 } = e2, s2 = z((e3, t3) => {
|
|
912
912
|
const o3 = { variant: ya.Menuitem, scope: "help", commandHook: { ...n2, beforeExecute: (t4, o4) => {
|
|
913
913
|
const a4 = n2?.beforeExecute?.(t4, o4);
|
|
@@ -916,7 +916,7 @@ The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bot
|
|
|
916
916
|
return Te({ ...e3, children: a3 });
|
|
917
917
|
}, [r2, n2]);
|
|
918
918
|
return N(De, { ref: t2, sx: l2, commands: o2, disabled: r2, commandHook: n2, scope: a2, label: "Help", tooltip: "Help, feedback, and keyboard shortcuts.", createPopupPanel: s2, icon: we(N(co, { sx: { transform: "scale(0.75)" } })), ...i2 });
|
|
919
|
-
})),
|
|
919
|
+
})), xl = L(H((e2, t2) => {
|
|
920
920
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, preferSingleMenu: l2 = true, showQuickButton: i2 = true, variant: s2 = ya.Toolbar, ...d2 } = e2, c2 = ba(o2, ["insertImageFromFile", "insertImageFromURL"]), { singleMenuCommand: m2, allDisabled: p2 } = W(() => {
|
|
921
921
|
let e3 = null, t3 = 0;
|
|
922
922
|
for (let o3 = 0; o3 < c2.length; o3++) c2[o3] && !c2[o3]?.disabled() && (l2 && s2 === ya.Menuitem && (e3 = 0 === t3 ? c2[o3] : null), t3++);
|
|
@@ -926,13 +926,13 @@ The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bot
|
|
|
926
926
|
return Te({ ...e3, children: a3 });
|
|
927
927
|
}, [r2, n2, a2]);
|
|
928
928
|
return m2 ? N(ke, { ref: t2, variant: s2, commandHook: n2, disabled: r2, command: m2, icon: we(N(mo, {})), ...d2 }) : N(De, { ref: t2, variant: s2, quickCommand: "insertImageFromFile", commands: o2, commandHook: n2, scope: a2, disabled: r2 || p2, tooltip: "Insert a picture from the web to complement your data.", createPopupPanel: u2, icon: we(N(mo, {})), ...d2 });
|
|
929
|
-
})),
|
|
929
|
+
})), bl = L(H((e2, t2) => {
|
|
930
930
|
const { command: o2, ...n2 } = e2, a2 = va(), [r2, l2] = O(false), [i2, s2] = O("info");
|
|
931
931
|
return V(() => {
|
|
932
932
|
const e3 = a2.getMode();
|
|
933
933
|
l2("copy" === e3?.key || "cut" === e3?.key), s2("cut" === e3?.key ? "warning" : "info");
|
|
934
934
|
}, [a2]), N(ke, { ref: t2, command: o2, icon: we(N(po, { isWalking: r2, themedType: i2 })), ...n2 });
|
|
935
|
-
})),
|
|
935
|
+
})), yl = L(H((e2, t2) => {
|
|
936
936
|
const { ...o2 } = e2;
|
|
937
937
|
return N(uo, { ref: t2, ...o2, popupCommandKeys: ["insertFunctionSum", "insertFunctionAverage", "insertFunctionCount", "insertFunctionMax", "insertFunctionMin", null, "insertFunction"], quickCommand: "insertFunctionSum", popupScope: "insertFunction", label: "Quick Function", tooltip: "More functions.", icon: (e3) => {
|
|
938
938
|
const t3 = e3?.key();
|
|
@@ -946,8 +946,8 @@ The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bot
|
|
|
946
946
|
}
|
|
947
947
|
} });
|
|
948
948
|
}));
|
|
949
|
-
|
|
950
|
-
const
|
|
949
|
+
yl.displayName = "InsertFunctionSumCommandPopupButton";
|
|
950
|
+
const wl = new Map([{ key: "financial", label: "Financial", icon: N(xo, {}) }, { key: "logical", label: "Logical", icon: N(bo, {}) }, { key: "text", label: "Text", icon: N(yo, {}) }, { key: "dateTime", label: "Date & Time", icon: N(wo, {}) }, { key: "lookupReference", label: "Lookup & Reference", icon: N(ko, {}) }, { key: "mathTrig", label: "Math & Trig", icon: N(So, {}) }, { key: "statDist", label: "Statistical", icon: N(Co, {}) }, { key: "engineering", label: "Engineering", icon: N(vo, {}) }, { key: "information", label: "Information", icon: N(To, {}) }, { key: "cube", label: "Cube", icon: N(Do, {}) }, { key: "database", label: "Database", icon: N(Po, {}) }, { key: "web", label: "Web", icon: N(Ro, {}) }, { key: "custom", label: "Custom", icon: N(Mo, {}) }].map((e2) => [e2.key, e2])), kl = L((e2) => {
|
|
951
951
|
const { command: t2, formulaFunction: o2, commandHook: n2, disabled: a2 = false, parentFloat: r2, handleInsert: l2, icon: i2, label: s2, sx: d2, ...c2 } = e2, m2 = new Promise((e3) => {
|
|
952
952
|
o2.getDescriptor().then((t3) => {
|
|
953
953
|
e3(t3.getSummary());
|
|
@@ -960,17 +960,17 @@ const xl = new Map([{ key: "financial", label: "Financial", icon: N(xo, {}) }, {
|
|
|
960
960
|
}, onKeyDown: (e3) => {
|
|
961
961
|
e3.keyCode === Sa.Enter || (e3.keyCode, Sa.Space);
|
|
962
962
|
}, ...c2, children: N(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: N(Z, { component: "div", children: o2.getName() }) }) });
|
|
963
|
-
}),
|
|
963
|
+
}), Sl = L(H((e2, t2) => {
|
|
964
964
|
const { category: o2, commands: n2, commandHook: a2, scope: r2, sx: l2, disabled: i2 = false, parentFloat: s2, ...d2 } = e2, c2 = ba(n2, ["insertFunction"])[0], m2 = z((e3, t3) => {
|
|
965
|
-
const n3 =
|
|
965
|
+
const n3 = wl.get(o2);
|
|
966
966
|
if (!n3) return console.warn("invalidate category", o2), null;
|
|
967
|
-
const r3 = { commandHook: a2, ...e3 }, l3 = N(
|
|
967
|
+
const r3 = { commandHook: a2, ...e3 }, l3 = N(Cl, { category: n3.label, ...r3, commands: t3 });
|
|
968
968
|
return Te({ ...e3, children: l3 });
|
|
969
|
-
}, [o2, c2, a2, r2]), p2 =
|
|
970
|
-
return N(De, { ref: t2, commands: n2, commandHook: a2, createPopupPanel: m2, label: p2.label, tooltip: "Insert Function", icon: we(
|
|
969
|
+
}, [o2, c2, a2, r2]), p2 = wl.get(o2);
|
|
970
|
+
return N(De, { ref: t2, commands: n2, commandHook: a2, createPopupPanel: m2, label: p2.label, tooltip: "Insert Function", icon: we(wl.get(o2)?.icon ?? N(fo, {})), ...d2 });
|
|
971
971
|
}));
|
|
972
|
-
|
|
973
|
-
const
|
|
972
|
+
Sl.displayName = "InsertFunctionCommandPopupButton";
|
|
973
|
+
const Cl = L(H((e2, t2) => {
|
|
974
974
|
const { commands: o2, category: n2, commandHook: a2, ...r2 } = e2, l2 = ba(o2, ["insertFunction"]), [i2, s2] = O([]), [d2, c2] = O(false);
|
|
975
975
|
V(() => {
|
|
976
976
|
(async () => {
|
|
@@ -984,11 +984,11 @@ const wl = L(H((e2, t2) => {
|
|
|
984
984
|
};
|
|
985
985
|
for (let e3 = 0; e3 < m2; e3++) {
|
|
986
986
|
const t3 = i2[e3];
|
|
987
|
-
p2[e3] = N(
|
|
987
|
+
p2[e3] = N(kl, { command: u2, formulaFunction: t3, handleInsert: g2 }, `formula-${t3.getName()}-${e3}`);
|
|
988
988
|
}
|
|
989
989
|
return Te({ ...r2, children: N(X, { ref: t2, sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: m2 > 0 ? N(A, { children: N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: p2 }) }) : null }) });
|
|
990
|
-
})),
|
|
991
|
-
const { disabled: o2, style: n2, className: a2, sx: r2, defaultInput: l2, value: i2, formName: s2, formOptions: d2, onChangeInput: c2, onValidate: m2, onKeyDown: p2, ...u2 } = e2, g2 =
|
|
990
|
+
})), vl = L(H((e2, t2) => {
|
|
991
|
+
const { disabled: o2, style: n2, className: a2, sx: r2, defaultInput: l2, value: i2, formName: s2, formOptions: d2, onChangeInput: c2, onValidate: m2, onKeyDown: p2, ...u2 } = e2, g2 = ja(), h2 = s2 && g2 ? g2.register(s2, d2) : null, [f2, x2] = O(""), [b2, y2] = O(""), [w2, k2] = O(i2);
|
|
992
992
|
V(() => {
|
|
993
993
|
k2(i2), y2("");
|
|
994
994
|
}, [i2]);
|
|
@@ -1009,21 +1009,21 @@ const wl = L(H((e2, t2) => {
|
|
|
1009
1009
|
}, []), D2 = z((e3) => {
|
|
1010
1010
|
S2(e3.target.value), h2?.onChange(e3);
|
|
1011
1011
|
}, [h2]);
|
|
1012
|
-
return N(le, { sx: { paddingTop: (e3) => e3.spacing(1.5), minWidth: 135, width: "100%", ...r2 }, size: "small", ref: t2, className: Yn("named-input", a2), ...u2, children: N(ie, { label: "Name", placeholder: l2, onFocus: v2, onBlur: T2, inputRef: h2?.ref, disabled: o2, error: !!b2, helperText: b2 || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (e3) => e3.spacing(0.5) } }, InputLabelProps: { shrink: true }, InputProps: { inputProps: { className: "autoFocus", name: s2, spellCheck: false, autoComplete: "off", readOnly: o2, sx: { paddingTop: (e3) => e3.spacing(1.25), paddingBottom: (e3) => e3.spacing(0.75), backgroundImage: `linear-gradient(${
|
|
1012
|
+
return N(le, { sx: { paddingTop: (e3) => e3.spacing(1.5), minWidth: 135, width: "100%", ...r2 }, size: "small", ref: t2, className: Yn("named-input", a2), ...u2, children: N(ie, { label: "Name", placeholder: l2, onFocus: v2, onBlur: T2, inputRef: h2?.ref, disabled: o2, error: !!b2, helperText: b2 || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (e3) => e3.spacing(0.5) } }, InputLabelProps: { shrink: true }, InputProps: { inputProps: { className: "autoFocus", name: s2, spellCheck: false, autoComplete: "off", readOnly: o2, sx: { paddingTop: (e3) => e3.spacing(1.25), paddingBottom: (e3) => e3.spacing(0.75), backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})` } } }, value: w2 ?? "", onChange: D2, onKeyDownCapture: C2, onContextMenu: (e3) => {
|
|
1013
1013
|
e3.stopPropagation();
|
|
1014
1014
|
} }) });
|
|
1015
1015
|
}));
|
|
1016
|
-
|
|
1017
|
-
const
|
|
1018
|
-
const { formName: o2, formOptions: n2, disabled: a2, style: r2, className: l2, sx: i2, onKeyDown: s2, value: d2, onChangeInput: c2, resolvedAddress: m2, ...p2 } = e2, u2 =
|
|
1016
|
+
vl.displayName = "NamedInput";
|
|
1017
|
+
const Tl = (e2) => null === e2 ? "" : e2.toString(), Dl = L(H((e2, t2) => {
|
|
1018
|
+
const { formName: o2, formOptions: n2, disabled: a2, style: r2, className: l2, sx: i2, onKeyDown: s2, value: d2, onChangeInput: c2, resolvedAddress: m2, ...p2 } = e2, u2 = ja(), g2 = o2 && u2 ? u2.register(o2, n2) : null, [h2, f2] = O(""), [x2, b2] = O(false), [y2, w2] = O(() => Tl(d2));
|
|
1019
1019
|
V(() => {
|
|
1020
|
-
w2(
|
|
1020
|
+
w2(Tl(d2)), f2(""), o2 && u2 && u2.clearErrors(o2), b2(false);
|
|
1021
1021
|
}, [d2]);
|
|
1022
1022
|
const k2 = wa((e3) => {
|
|
1023
1023
|
let t3 = "";
|
|
1024
1024
|
try {
|
|
1025
1025
|
w2(e3);
|
|
1026
|
-
const t4 =
|
|
1026
|
+
const t4 = Tl(d2), o3 = m2(e3);
|
|
1027
1027
|
o3.toString() !== t4 && c2?.(o3);
|
|
1028
1028
|
} catch (e4) {
|
|
1029
1029
|
t3 = "Invalid Range";
|
|
@@ -1031,7 +1031,7 @@ const Sl = (e2) => null === e2 ? "" : e2.toString(), Cl = L(H((e2, t2) => {
|
|
|
1031
1031
|
o2 && u2 && (t3 ? u2.setError(o2, { message: t3 }) : u2.clearErrors(o2)), f2(t3), b2(true);
|
|
1032
1032
|
}, [y2, c2, o2, u2]), S2 = wa(async (e3) => {
|
|
1033
1033
|
if (x2 && e3.keyCode === Sa.Escape) {
|
|
1034
|
-
const t3 =
|
|
1034
|
+
const t3 = Tl(d2);
|
|
1035
1035
|
w2(t3), f2(""), b2(false), e3.stopPropagation();
|
|
1036
1036
|
}
|
|
1037
1037
|
s2?.(e3);
|
|
@@ -1042,12 +1042,12 @@ const Sl = (e2) => null === e2 ? "" : e2.toString(), Cl = L(H((e2, t2) => {
|
|
|
1042
1042
|
}, [g2]), [T2, D2] = O(false), P2 = W(() => N(se, { tabIndex: -1, sx: { display: "flex", position: "relative", flex: "0" }, position: "end", children: N(Fo, { disabled: true, selected: T2, onSelectToggle: (e3) => {
|
|
1043
1043
|
D2(e3);
|
|
1044
1044
|
}, label: "Select Range", icon: we(N(Bo, {})) }) }), [T2]);
|
|
1045
|
-
return N(le, { sx: { paddingTop: (e3) => e3.spacing(1.5), minWidth: 135, width: "100%", ...i2 }, size: "small", ref: t2, className: Yn("range-input", l2), ...p2, children: N(ie, { label: "Range", placeholder: "Enter Range", onBlur: C2, disabled: a2, error: !!h2, inputRef: g2?.ref, helperText: h2 || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (e3) => e3.spacing(0.5) } }, InputLabelProps: { shrink: true }, InputProps: { inputProps: { spellCheck: false, autoComplete: "off", readOnly: a2, name: o2, sx: { paddingTop: (e3) => e3.spacing(1.25), paddingBottom: (e3) => e3.spacing(0.75) } }, sx: { backgroundImage: `linear-gradient(${
|
|
1045
|
+
return N(le, { sx: { paddingTop: (e3) => e3.spacing(1.5), minWidth: 135, width: "100%", ...i2 }, size: "small", ref: t2, className: Yn("range-input", l2), ...p2, children: N(ie, { label: "Range", placeholder: "Enter Range", onBlur: C2, disabled: a2, error: !!h2, inputRef: g2?.ref, helperText: h2 || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (e3) => e3.spacing(0.5) } }, InputLabelProps: { shrink: true }, InputProps: { inputProps: { spellCheck: false, autoComplete: "off", readOnly: a2, name: o2, sx: { paddingTop: (e3) => e3.spacing(1.25), paddingBottom: (e3) => e3.spacing(0.75) } }, sx: { backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})` }, endAdornment: P2 }, value: y2 ?? "", onChange: v2, onKeyDownCapture: S2, onContextMenu: (e3) => {
|
|
1046
1046
|
e3.stopPropagation();
|
|
1047
1047
|
} }) });
|
|
1048
1048
|
}));
|
|
1049
|
-
|
|
1050
|
-
const
|
|
1049
|
+
Dl.displayName = "RangeInput";
|
|
1050
|
+
const Pl = L(H((e2, t2) => {
|
|
1051
1051
|
const { sheet: o2, className: a2, debounceDelay: l2 = 220, sx: i2, ...s2 } = e2, [d2, c2] = O(() => o2.getView().getZoomScale()), [m2, p2] = O(null), u2 = U(0);
|
|
1052
1052
|
w(o2, { onViewChange: () => {
|
|
1053
1053
|
p2(true), 0 === u2.current && c2(o2.getView().getZoomScale());
|
|
@@ -1071,7 +1071,7 @@ const vl = L(H((e2, t2) => {
|
|
|
1071
1071
|
});
|
|
1072
1072
|
}, []), S2 = Ta(() => {
|
|
1073
1073
|
g2(h2(n.findNextStep(o2.getView().getZoomScale(), false, 10)));
|
|
1074
|
-
}), C2 = Ta(() => g2(h2(n.findNextStep(o2.getView().getZoomScale(), true, 10)))), v2 =
|
|
1074
|
+
}), C2 = Ta(() => g2(h2(n.findNextStep(o2.getView().getZoomScale(), true, 10)))), v2 = $a(), T2 = W(() => `${r.getSharedMeasurer()("100%", Math.round(v2.typography.fontSize), v2.typography.fontFamily).width}px`, [v2]);
|
|
1075
1075
|
return E(X, { ref: t2, className: Yn(a2), sx: { padding: "0px 0px", display: "flex", alignItems: "center", color: (e3) => e3.palette.text.secondary, ...i2 }, onFocus: (e3) => {
|
|
1076
1076
|
e3.relatedTarget && !x2 && b2(e3.relatedTarget);
|
|
1077
1077
|
}, onBlur: (e3) => {
|
|
@@ -1094,8 +1094,8 @@ const vl = L(H((e2, t2) => {
|
|
|
1094
1094
|
g2(100);
|
|
1095
1095
|
}, sx: { cursor: "pointer", display: "flex", flex: "1 1 100%", fontSize: "0.70rem", marginLeft: "2px", marginRight: "2px", userSelect: "none", justifyContent: "center", width: T2 }, children: N("div", { children: Math.round(d2) + "%" }) })] })] });
|
|
1096
1096
|
}));
|
|
1097
|
-
|
|
1098
|
-
const
|
|
1097
|
+
Pl.displayName = "SheetZoomScale";
|
|
1098
|
+
const Rl = L(H((e2, t2) => {
|
|
1099
1099
|
const { sx: o2, sheet: n2, gridStyle: a2, children: r2, childrenEnd: l2, ...i2 } = e2;
|
|
1100
1100
|
q(t2, () => ({}));
|
|
1101
1101
|
const s2 = U(null);
|
|
@@ -1109,11 +1109,11 @@ const Tl = L(H((e2, t2) => {
|
|
|
1109
1109
|
const e3 = d2.getMode();
|
|
1110
1110
|
return e3?.description ? e3.description : "Ready";
|
|
1111
1111
|
}, [d2]), [m2, p2] = O(false);
|
|
1112
|
-
return E(X, { ref: s2, sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", overflow: m2 ? "visible" : "hidden", boxShadow: `0px -1px 0px ${a2.header.edgeStrokeFill}`, ...o2 }, onMouseOver: () => p2(true), onMouseLeave: () => p2(false), ...i2, children: [r2, N("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "end", overflow: "hidden" }, children: N(Z, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: c2 }) }), l2 ? N(X, { sx: { display: "flex", alignItems: "center" }, children: l2 }) : null, N(Se, { style: { marginTop: "6px", marginBottom: "6px" } }), N(
|
|
1112
|
+
return E(X, { ref: s2, sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", overflow: m2 ? "visible" : "hidden", boxShadow: `0px -1px 0px ${a2.header.edgeStrokeFill}`, ...o2 }, onMouseOver: () => p2(true), onMouseLeave: () => p2(false), ...i2, children: [r2, N("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "end", overflow: "hidden" }, children: N(Z, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: c2 }) }), l2 ? N(X, { sx: { display: "flex", alignItems: "center" }, children: l2 }) : null, N(Se, { style: { marginTop: "6px", marginBottom: "6px" } }), N(Pl, { sx: { paddingLeft: "4px", minWidth: "175px" }, sheet: n2 })] });
|
|
1113
1113
|
}));
|
|
1114
|
-
|
|
1115
|
-
const
|
|
1116
|
-
const { disabled: o2, names: a2, workbook: l2, restoreFocus: i2, readonly: s2 = false, disabled: d2 = false, commandPopupButtonProps: c2, sx: m2,
|
|
1114
|
+
Rl.displayName = "StatusBar";
|
|
1115
|
+
const Ml = L(H((e2, t2) => {
|
|
1116
|
+
const { disabled: o2, names: a2, workbook: l2, restoreFocus: i2, readonly: s2 = false, disabled: d2 = false, commandPopupButtonProps: c2, sx: m2, ...u2 } = e2, g2 = Da(), [h2, f2] = O(null), [x2, b2] = O(() => l2.getSelectedRanges().getCoords()), [y2, k2] = O(false), { reference: S2 } = Eo({ parentFloat: c2?.parentFloat }), [C2, v2] = O(() => s2 || !l2.getProtection().isStructureAllowed()), T2 = () => h2?.text ?? "", [D2, P2] = O(T2), R2 = wa(() => {
|
|
1117
1117
|
if (S2?.closeAll(), !D2) {
|
|
1118
1118
|
const e4 = T2();
|
|
1119
1119
|
return P2(T2()), e4;
|
|
@@ -1142,10 +1142,10 @@ const Dl = L(H((e2, t2) => {
|
|
|
1142
1142
|
let e4 = a2.getByName(D2);
|
|
1143
1143
|
C2 || e4 || (e4 = a2.addReference(D2, o3)), e4 && f2({ text: e4.getName() });
|
|
1144
1144
|
} catch (e4) {
|
|
1145
|
-
P2(T2()),
|
|
1145
|
+
P2(T2()), g2.showMessage?.(e4.message, { type: Pa.Error });
|
|
1146
1146
|
}
|
|
1147
1147
|
return null;
|
|
1148
|
-
}, [D2, a2, S2, C2]), M2 = wa(() => {
|
|
1148
|
+
}, [D2, a2, S2, C2, g2]), M2 = wa(() => {
|
|
1149
1149
|
if (l2.isClosed()) return;
|
|
1150
1150
|
const e3 = [];
|
|
1151
1151
|
for (let t4 = 0; t4 < x2.length; t4++) {
|
|
@@ -1214,9 +1214,9 @@ const Dl = L(H((e2, t2) => {
|
|
|
1214
1214
|
const t3 = a2.lookupByRanges(e3)?.[0];
|
|
1215
1215
|
t3 && await t3?.select(), await l2.getRanges(e3)?.select();
|
|
1216
1216
|
} catch (e4) {
|
|
1217
|
-
|
|
1217
|
+
g2.showMessage?.(e4.message, { type: Pa.Error });
|
|
1218
1218
|
}
|
|
1219
|
-
}, [a2,
|
|
1219
|
+
}, [a2, g2, l2]), K2 = z((e3) => {
|
|
1220
1220
|
setTimeout(() => {
|
|
1221
1221
|
k2(true);
|
|
1222
1222
|
}, 0);
|
|
@@ -1242,16 +1242,16 @@ const Dl = L(H((e2, t2) => {
|
|
|
1242
1242
|
return we(N(Ho, {}));
|
|
1243
1243
|
} }));
|
|
1244
1244
|
}
|
|
1245
|
-
const m3 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...
|
|
1245
|
+
const m3 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...u2, children: [C2 ? null : N(ke, { ...t3, scope: "namedItem", command: c2?.commands.getCommand("addNamedReference"), icon: we(N(Wo, {})) }), i3 && i3.length > 0 ? E(A, { children: [C2 ? null : N(Se, { orientation: "horizontal" }), N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: i3 })] }) : null] });
|
|
1246
1246
|
return Te({ ...e3, children: m3 });
|
|
1247
|
-
}, [l2, F2, a2, h2, C2]), Z2 =
|
|
1247
|
+
}, [l2, F2, a2, h2, C2]), Z2 = Ra(t2, () => ({ focus(e3) {
|
|
1248
1248
|
G2.current?.focus(e3);
|
|
1249
1249
|
} }), []);
|
|
1250
|
-
return N(X, { className: "outer", sx: { minWidth: 120, flex: "1 1 100%", display: "flex", alignItems: "center", justifyContent: "start", ...m2 }, ref:
|
|
1250
|
+
return N(X, { className: "outer", sx: { minWidth: 120, flex: "1 1 100%", display: "flex", alignItems: "center", justifyContent: "start", ...m2 }, ref: qa([Z2, t2]), ...u2, children: N(Ue, { className: "outer-button", sx: { display: "flex", flex: "1 1 100%", "& .tooltip-wrapper": { display: "flex", flex: "1 1 100%", width: "100%", height: "27px" }, ...m2 }, buttonProps: { sx: { backgroundColor: (e3) => e3.palette.background.paper, backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})` } }, tabIndex: -1, outlined: { color: (e3) => o2 ? e3.palette.action.disabled : Oa(e3.palette.divider, 0.2) }, parentFloat: S2, createPopupPanel: K2, onPopupOpen: () => k2(true), onPopupClose: () => k2(false), createTooltip: ({ children: e3 }, t3) => N(Je, { title: t3 || y2 ? "" : "Name Box", disabled: t3, leaveDelay: 0, sx: { opacity: t3 || y2 ? 0 : 1 }, children: e3 }), createQuickButton: _2 }) });
|
|
1251
1251
|
}));
|
|
1252
|
-
|
|
1253
|
-
const
|
|
1254
|
-
const { sx: o2, workbook: n2, sheetElement: a2, gridStyle: l2, showNamedCollectionEditor: i2 = true, NamedCollectionEditorProps: s2, renderNamedCollectionEditor: d2 =
|
|
1252
|
+
Ml.displayName = "NamedCollectionEditor";
|
|
1253
|
+
const Fl = (e2, t2) => N(Ml, { ref: t2, ...e2 }), Bl = L(H((e2, t2) => {
|
|
1254
|
+
const { sx: o2, workbook: n2, sheetElement: a2, gridStyle: l2, showNamedCollectionEditor: i2 = true, NamedCollectionEditorProps: s2, renderNamedCollectionEditor: d2 = Fl, disabled: c2, commands: m2, ...p2 } = e2, [u2, g2] = O(n2?.getSelectedSheet());
|
|
1255
1255
|
w(n2, { onSheetsChange: (e3) => {
|
|
1256
1256
|
g2(e3?.getSelectedSheet());
|
|
1257
1257
|
}, onViewChange(e3) {
|
|
@@ -1287,7 +1287,7 @@ const Pl = (e2, t2) => N(Dl, { ref: t2, ...e2 }), Rl = L(H((e2, t2) => {
|
|
|
1287
1287
|
}, onSubmitEdit: () => {
|
|
1288
1288
|
a2?.submitEdit(), a2?.focus();
|
|
1289
1289
|
}, linesVisible: M2 }) });
|
|
1290
|
-
}, [u2, z2, h2, M2, a2]), V2 = U(null), G2 = W(() => i2 ? d2({ names: n2.getNames(), workbook: n2, ...s2 }, V2) : null, [d2, s2, i2, u2, n2, b2]), j2 = W(() => E(ce, { elevation: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 0, backgroundImage: `linear-gradient(${
|
|
1290
|
+
}, [u2, z2, h2, M2, a2]), V2 = U(null), G2 = W(() => i2 ? d2({ names: n2.getNames(), workbook: n2, ...s2 }, V2) : null, [d2, s2, i2, u2, n2, b2]), j2 = W(() => E(ce, { elevation: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 0, backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})`, border: (e3) => `solid ${b2 ? e3.palette.action.disabled : Oa(e3.palette.divider, 0.2)} 1px` }, children: [N(Ye, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, color: "warning", "aria-label": "cancel-formula-edit", icon: we(N(zo, {})), tooltipProps: { label: "Cancel", simple: true }, disabled: b2 || null === z2, onMouseDown: (e3) => {
|
|
1291
1291
|
0 === e3.button && e3.preventDefault();
|
|
1292
1292
|
}, onClick: () => {
|
|
1293
1293
|
a2.cancelEdit();
|
|
@@ -1297,31 +1297,31 @@ const Pl = (e2, t2) => N(Dl, { ref: t2, ...e2 }), Rl = L(H((e2, t2) => {
|
|
|
1297
1297
|
a2.submitEdit();
|
|
1298
1298
|
} }), N(Ye, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, disabled: true, "aria-label": "commit-formula-function", icon: we(N(Oo, { sx: { transform: "scale(0.85)" } })), tooltipProps: { label: "Insert Function", simple: true }, onMouseDown: (e3) => {
|
|
1299
1299
|
0 === e3.button && e3.preventDefault();
|
|
1300
|
-
} })] }), [b2, z2]), _2 =
|
|
1300
|
+
} })] }), [b2, z2]), _2 = $a(), [q2, K2] = O(false), Z2 = W(() => E(X, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", gap: (e3) => e3.spacing(0.5), alignItems: "start" }, children: [j2, E(ce, { elevation: 0, sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", fontFamily: (e3) => e3.typography.fontFamily, fontSize: 11 * r.getDeviceScale(), "& .editor-placement": { top: "2px !important" }, boxShadow: "none", borderRadius: (e3) => `${e3.shape.borderRadius}px`, backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})`, border: (e3) => `solid ${b2 ? e3.palette.action.disabled : Oa(e3.palette.divider, 0.2)} 1px`, "& textarea": { color: (e3) => b2 ? `${e3.palette.text.disabled} !important` : e3.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: () => K2(true), onBlur: () => K2(false), onMouseDown: (e3) => {
|
|
1301
1301
|
e3.target?.classList.contains("react-resizable-handle") && e3.preventDefault();
|
|
1302
|
-
}, children: [N(X, { className: "formula-editor", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", alignSelf: "baseline", paddingLeft: (e3) => e3.spacing(1), paddingRight: (e3) => e3.spacing(1) }, children: N(
|
|
1302
|
+
}, children: [N(X, { className: "formula-editor", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", alignSelf: "baseline", paddingLeft: (e3) => e3.spacing(1), paddingRight: (e3) => e3.spacing(1) }, children: N(_a, { height: T2, draggableOpts: { grid: [v2, v2] }, minConstraints: [v2, v2], maxConstraints: [15 * v2, 15 * v2], onResize: I2, onResizeStop: B2, resizeHandles: ["s"], axis: "y", style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: $2 }) }), N(Ye, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, "aria-label": "toggle-expand-formula-edit", icon: we(N(M2 > 1 ? da : ca, {})), tooltipProps: { label: (M2 > 1 ? "Collapse" : "Expand") + " Formula Bar", simple: true }, onMouseDown: (e3) => {
|
|
1303
1303
|
0 === e3.button && e3.preventDefault();
|
|
1304
1304
|
}, onClick: () => {
|
|
1305
1305
|
const e3 = M2 > 1 ? 1 : P2;
|
|
1306
1306
|
D2(e3 * v2 + 1), F2(e3);
|
|
1307
|
-
} }), N(X, { sx: { position: "absolute", width: "100%", height: "2px", bottom: "0", willChange: "opacity", transition: "opacity 60ms ease-in", opacity: q2 ? 1 : 0, borderBottomWidth: "2px", borderBottomStyle: "solid", borderBottomColor: (e3) => e3.palette.primary.main, borderRadius: (e3) => `${e3.shape.borderRadius}px` } })] })] }), [j2, $2, q2, M2, v2]), J2 = W(() => G2 || Z2 ? !G2 && Z2 ? Z2 : G2 && !Z2 ? G2 : N(A, { children: N(
|
|
1307
|
+
} }), N(X, { sx: { position: "absolute", width: "100%", height: "2px", bottom: "0", willChange: "opacity", transition: "opacity 60ms ease-in", opacity: q2 ? 1 : 0, borderBottomWidth: "2px", borderBottomStyle: "solid", borderBottomColor: (e3) => e3.palette.primary.main, borderRadius: (e3) => `${e3.shape.borderRadius}px` } })] })] }), [j2, $2, q2, M2, v2]), J2 = W(() => G2 || Z2 ? !G2 && Z2 ? Z2 : G2 && !Z2 ? G2 : N(A, { children: N(Ma, { 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='${_2.palette.text.icon ?? _2.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: G2, elementAfter: Z2 }) }) : null, [G2, Z2]), Y2 = Ra(t2, () => ({ isFormulaBarElement: () => true, getNamedCollectionEditorElement: () => V2.current }), []);
|
|
1308
1308
|
return N(X, { sx: { display: "flex", flexDirection: "row", gap: (e3) => e3.spacing(0.5), ...o2 }, ref: Y2, ...p2, children: J2 });
|
|
1309
1309
|
}));
|
|
1310
|
-
|
|
1311
|
-
const
|
|
1310
|
+
Bl.displayName = "FormulaBar";
|
|
1311
|
+
const Nl = L(H((e2, t2) => {
|
|
1312
1312
|
const { filter: o2, commands: n2, disabled: a2, sx: r2, floatReference: l2, ...i2 } = e2, s2 = W(() => ({}), []), d2 = W(() => ({ commandHook: { beforeExecute: (e3, t3) => l2.closeAll(), onExecute() {
|
|
1313
1313
|
}, onError() {
|
|
1314
1314
|
console.log("onError");
|
|
1315
1315
|
} }, disabled: a2, parentFloat: l2 }), [a2, l2]), c2 = W(() => ({ ...s2, ...d2, variant: ya.Menuitem }), [s2, d2]), m2 = E(A, { children: [N(ke, { ...c2, command: n2.getCommand("sortAscending"), icon: we(N(Bt, {})) }), N(ke, { ...c2, command: n2.getCommand("sortDescending"), icon: we(N(Nt, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...c2, command: n2.getCommand("autoFilterClear"), icon: we(N(It, {})) }), []] });
|
|
1316
1316
|
return N(X, { ref: t2, sx: { paddingTop: "4px", paddingBottom: "4px", display: "flex", flexDirection: "column", ...r2 }, ...i2, children: m2 });
|
|
1317
1317
|
}));
|
|
1318
|
-
|
|
1319
|
-
const
|
|
1320
|
-
const { children: o2, className: n2, disabled: a2, style: r2, filter: l2, ...i2 } = e2, s2 =
|
|
1318
|
+
Nl.displayName = "FilterColumnMenu";
|
|
1319
|
+
const El = L(H((e2, t2) => {
|
|
1320
|
+
const { children: o2, className: n2, disabled: a2, style: r2, filter: l2, ...i2 } = e2, s2 = Ra(t2, () => ({ isFilters: () => true }), []);
|
|
1321
1321
|
return N("div", { ref: s2, className: Yn("filters", n2), style: { position: "relative", display: "flex", flexDirection: "column", alignItems: "center", gap: "8px", ...r2 }, ...i2, children: E("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: [N("div", { children: l2.getName() }), N("div", { children: "Filter Widget" })] }) });
|
|
1322
1322
|
}));
|
|
1323
|
-
|
|
1324
|
-
const
|
|
1323
|
+
El.displayName = "Filters";
|
|
1324
|
+
const Al = L(H((e2, t2) => {
|
|
1325
1325
|
const { children: o2, sheet: n2, style: a2, className: r2, value: l2, index: i2, editing: s2, editable: d2, disabled: c2, selectedIndex: m2, dragging: p2, borderColor: u2, borderWidth: g2, activeColor: h2, background: f2 = "white", tabRadius: x2 = 4, gridTheme: b2, ...y2 } = e2, [k2, S2] = O(() => !!n2 && n2.getProtection().isLocked()), [C2, v2] = O(() => n2 ? n2.getTabColor() : null);
|
|
1326
1326
|
w(n2, { onProtectionChange: () => {
|
|
1327
1327
|
S2(n2.getProtection().isLocked());
|
|
@@ -1330,7 +1330,7 @@ const Bl = L(H((e2, t2) => {
|
|
|
1330
1330
|
}, onStyleChange: () => {
|
|
1331
1331
|
v2(n2.getTabColor());
|
|
1332
1332
|
} });
|
|
1333
|
-
const T2 =
|
|
1333
|
+
const T2 = $a(), D2 = m2 === i2;
|
|
1334
1334
|
let P2 = null, R2 = null;
|
|
1335
1335
|
if (C2 || p2) {
|
|
1336
1336
|
let e3 = f2;
|
|
@@ -1339,10 +1339,10 @@ const Bl = L(H((e2, t2) => {
|
|
|
1339
1339
|
let M2 = null;
|
|
1340
1340
|
"string" == typeof u2 ? M2 = u2 : u2?.toCSS && (M2 = u2.toCSS());
|
|
1341
1341
|
const F2 = D2 ? N(X, { sx: { width: "100%", borderRadius: "4px", minWidth: "4px", height: "2px", backgroundColor: (e3) => e3.palette.primary.main } }) : null;
|
|
1342
|
-
return N(
|
|
1342
|
+
return N(Ga, { theme: D2 ? b2 ?? T2 : T2, children: N(X, { ref: t2, className: Yn(r2), sx: { ...a2, display: "flex", flexDirection: "column", minHeight: "0px", fontWeight: D2 ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", lineHeight: "1", textTransform: "none", minWidth: "unset", cursor: p2 ? "grabbing" : void 0 }, ...y2, children: N(Fa, { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, radius: x2, strokeColor: D2 ? M2 : "transparent", children: N(ee, { sx: { textTransform: "none", borderRadius: "0px", minHeight: "0px", paddingLeft: "11px", paddingRight: "12px", paddingTop: "3px", flex: "1 1 100%", paddingBottom: "3px", fontWeight: D2 ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", transition: "none", cursor: p2 ? "grabbing" : void 0, color: D2 ? "primary" : R2 || "text.secondary", backgroundColor: D2 ? f2 : "transparent", "&:hover:not([disabled])": { backgroundColor: D2 ? f2 : "transparent" }, "& input": { color: (e3) => `${e3.palette.text.primary}`, textAlign: "center", fontWeight: "500" }, marginTop: "0px", minWidth: "unset" }, disabled: c2, disableRipple: s2, component: "div", children: E(A, { children: [P2, E(X, { sx: { zIndex: "1", display: "flex", flexDirection: "row", alignItems: "center" }, children: [E(X, { sx: { display: "flex", flexDirection: "column", alignItems: "center", rowGap: "1px", lineHeight: "1", marginTop: D2 ? void 0 : "1px" }, children: [o2, F2] }), k2 ? N(ma, { sx: { scale: "0.80", marginLeft: "2px", width: "22px", height: "22px" }, color: "secondary" }) : N(X, { sx: { minHeight: "22px" } })] })] }) }, l2 + ":" + i2) }) }) });
|
|
1343
1343
|
}));
|
|
1344
|
-
|
|
1345
|
-
const
|
|
1344
|
+
Al.displayName = "SheetTab";
|
|
1345
|
+
const Il = L(H((e2, t2) => {
|
|
1346
1346
|
const { workbook: o2, index: n2, commands: a2, scope: r2 = "sheet", disabled: l2, floatReference: i2, sx: s2, className: d2, tabStripRef: c2, ...m2 } = e2, [p2, u2] = O(o2?.getProtection());
|
|
1347
1347
|
w(o2, { onProtectionChange: (e3) => {
|
|
1348
1348
|
u2(e3?.getProtection());
|
|
@@ -1356,11 +1356,11 @@ const Nl = L(H((e2, t2) => {
|
|
|
1356
1356
|
Promise.resolve(i2.closeAll()).then(() => {
|
|
1357
1357
|
c2?.startEdit(n2);
|
|
1358
1358
|
});
|
|
1359
|
-
}, disabled: l2 || !p2.isStructureAllowed(), parentFloat: i2, children: ["Rename", "sheet" !== r2 ? " Sheet" : ""] }), N(ke, { command: a2.getCommand("duplicateSheet"), ...f2, variant: ya.Menuitem }), N(ke, { command: a2?.getCommand("protectionSheetToggle"), ...f2, variant: ya.Menuitem, icon: N(ma, {}) }), N(
|
|
1359
|
+
}, disabled: l2 || !p2.isStructureAllowed(), parentFloat: i2, children: ["Rename", "sheet" !== r2 ? " Sheet" : ""] }), N(ke, { command: a2.getCommand("duplicateSheet"), ...f2, variant: ya.Menuitem }), N(ke, { command: a2?.getCommand("protectionSheetToggle"), ...f2, variant: ya.Menuitem, icon: N(ma, {}) }), N($r, { variant: ya.Menuitem, command: a2.getCommand("formatSheetTabColor"), icon: N(Ze, {}), panelProps: { disableAlpha: true, autoColorLabel: "No Tab Color", autoColorPosition: mr.End }, parentFloat: i2 }), N(Se, { orientation: "horizontal" }), N(ke, { command: a2.getCommand("hideSheet"), ...f2, variant: ya.Menuitem, icon: we(N(Vo, {})) })] });
|
|
1360
1360
|
return N(X, { ref: t2, className: Yn("menu", d2), sx: { ...s2 }, ...m2, children: x2 });
|
|
1361
1361
|
}));
|
|
1362
|
-
|
|
1363
|
-
const
|
|
1362
|
+
Il.displayName = "SheetTabMenu";
|
|
1363
|
+
const Ll = L(H((e2, t2) => {
|
|
1364
1364
|
const { workbook: o2, gridStyle: n2, floatReference: a2, closeFloatAll: r2, className: l2, ...i2 } = e2, [s2, d2] = O(o2?.getSheets().getItems()), [c2, m2] = O(o2?.getProtection());
|
|
1365
1365
|
w(o2, { onSheetsChange: (e3) => {
|
|
1366
1366
|
d2(e3.getSheets().getItems());
|
|
@@ -1378,7 +1378,7 @@ const El = L(H((e2, t2) => {
|
|
|
1378
1378
|
let x2 = null;
|
|
1379
1379
|
d3 && (x2 = N(ma, { color: "secondary" })), i3 !== u.Visibility.Visible && (x2 = we(N(Vo, { style: { opacity: c2.isStructureAllowed() ? 1 : 0.7 }, color: "secondary" }))), x2 && (x2 = N(X, { sx: { display: "flex", flex: "1 1 100%", alignItems: "center", ml: "16px", "& *": { lineHeight: "1em", fontSize: "1.3em" } }, children: x2 })), e3.push(N(qe, { disabled: !c2.isStructureAllowed() && i3 === u.Visibility.Hidden, sx: { color: (e4) => {
|
|
1380
1380
|
let t4 = s3 ? e4.palette.primary.main : e4.palette.text.secondary;
|
|
1381
|
-
return h2 && (t4 = h2), i3 === u.Visibility.Hidden && (t4 =
|
|
1381
|
+
return h2 && (t4 = h2), i3 === u.Visibility.Hidden && (t4 = Ua(t4, e4.palette.action.disabledOpacity)), t4;
|
|
1382
1382
|
}, borderLeft: (e4) => `${s3 ? e4.palette.primary.main : "transparent"} solid 2px`, paddingLeft: "4px", fontWeight: s3 ? "700" : "400", "&:hover": { fontWeight: "700" } }, icon: s3 ? N(ut, {}) : void 0, onMouseDown: (e4) => e4.preventDefault(), onMouseUp: () => {
|
|
1383
1383
|
Promise.resolve(a2.closeAll()).then(() => {
|
|
1384
1384
|
try {
|
|
@@ -1393,25 +1393,25 @@ const El = L(H((e2, t2) => {
|
|
|
1393
1393
|
}, [o2, c2, s2, a2, n2]);
|
|
1394
1394
|
return N(X, { ref: t2, className: Yn("menu", l2), ...i2, children: p2 });
|
|
1395
1395
|
}));
|
|
1396
|
-
|
|
1397
|
-
let
|
|
1398
|
-
let
|
|
1399
|
-
const
|
|
1396
|
+
Ll.displayName = "SheetsAllMenu";
|
|
1397
|
+
let Hl = false, Wl = false;
|
|
1398
|
+
let zl = null;
|
|
1399
|
+
const $l = async (e2) => {
|
|
1400
1400
|
const t2 = await g.getDetails();
|
|
1401
|
-
if (
|
|
1401
|
+
if (Wl || t2.isEval()) {
|
|
1402
1402
|
try {
|
|
1403
1403
|
const e3 = top ?? window;
|
|
1404
|
-
e3.SheetXL || (e3.SheetXL = Object.freeze({ getSelectedWorkbook: () =>
|
|
1404
|
+
e3.SheetXL || (e3.SheetXL = Object.freeze({ getSelectedWorkbook: () => zl?.getWorkbook(), getSelectedSheet: () => zl?.getWorkbook().getSelectedSheet(), getSelectedRange: () => zl?.getWorkbook().getSelectedRange(), getRange: (e4) => zl?.getWorkbook().getRange(e4), getSelectedWorkbookElement: () => zl, getLicenseManager: () => g, moreExamples: () => {
|
|
1405
1405
|
const e4 = { "SheetXL.getRange('Sheet1!e5:f6').setValues([[110, 220], [210, 220]])": { Summary: "Set an array of values." }, "SheetXL.getRange('a1:e5').setValue(100)": { Summary: "Set a single repeating value to a range." }, "SheetXL.getRange('Sheet1!e5:f6').getValues()": { Summary: "Get the values as a 2d array (see forEach)." }, "SheetXL.getSelectedRange().setValue(new Date())": { Summary: "Set current date/time using Javascript Date." }, "SheetXL.getSelectedRange().setValue('10/23/95')": { Summary: "Set current date/time using string." }, "SheetXL.getSelectedSheet().getUsedRange().getValues()": { Summary: "Get all of the values in a sheet." }, "SheetXL.getSelectedRange().getStyle().update({ fill: 'accent4' })": { Summary: "Set fill to theme color 4." }, "SheetXL.getRange('E:L').getStyle().update({ fill: 'accent1 lumMod 90 lumOff 40' })": { Summary: "Set some columns to a modified theme color." }, "SheetXL.getRange('e5:f10').getStyle().update({ style: { border: 'double blue' }})": { Summary: "Set border." }, "SheetXL.getCell().getStyle().fill.toCSS()": { Summary: "Get the fill style as css for the selected cell." }, "SheetXL.getRange('a1:a3').autoFill('a1:a7')": { Summary: "Autofill down." }, "SheetXL.getRange('e7:i9').merge({ orientation: 'rows' })": { Summary: "Merge cells horizontally." }, "SheetXL.getSelectedRange().sort({ ascending: false, hasHeader: false })": { Summary: "Sort selected cells ascending with a header." }, "SheetXL.getSelectedRange().clear('all')": { Summary: "Clear the current range a different way." }, "SheetXL.getSelectedSheet().getTables().add('b2:e9')": { Summary: "Create a 4x8 table at b2 for current sheet." }, "SheetXL.getRange('a1:c3').copyFrom('e1:g3')": { Summary: "Copy cells." }, "SheetXL.getRange('c:t').getColumnHeaders().setSize(30)": { Summary: "Set the size of columns to 30 pixels." }, "SheetXL.getRange('2:3').delete()": { Summary: "Remove rows 2 and 3 and shift up." }, "SheetXL.getSelectedSheet().getMovables().addImage('https://www.sheetxl.com/logo-text.svg')": { Summary: "Add an image." }, "SheetXL.getSelectedSheet().getMovables().addImage('https://www.sheetxl.com/logo-text.svg', { bounds: { height: 100 } })": { Summary: "Add an image of height 100." }, "SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue(1.50).getStyle().update({ numberFormat: '0%' }).autoFit(); }, 'Enter 150%')": { Summary: "Set value to 100 and numberformat to 0% as a single." }, "SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue('Remind Me Later').getStyle().update({ namedStyle: 'Note'}).autoFit(); }, 'Set Reminder')": { Summary: "Set a value and style to Note style and autofit text." }, "SheetXL.getSelectedWorkbook().getNames().addReference('Small_Range', 'A2:E5');": { Summary: "Add a named range." }, "SheetXL.getSelectedWorkbook().getRange('a1:e5').addListener((e) => { console.log('got an update for:', e.getSource().toString()) })": { Summary: "Listen for updates at a range." } };
|
|
1406
1406
|
console.table(e4);
|
|
1407
1407
|
} }));
|
|
1408
1408
|
} catch (e3) {
|
|
1409
|
-
e3 instanceof DOMException || console.error(e3),
|
|
1409
|
+
e3 instanceof DOMException || console.error(e3), Hl = true;
|
|
1410
1410
|
}
|
|
1411
|
-
if (
|
|
1412
|
-
|
|
1411
|
+
if (zl !== e2 && (zl = e2, !Hl)) try {
|
|
1412
|
+
Hl = true;
|
|
1413
1413
|
(top ?? window).SheetXL && (await g._validate(true), g.wasPrinted() && (() => {
|
|
1414
|
-
|
|
1414
|
+
Ka.consoleWithNoSource("%cTip: You can access the API directly in the console.\nTry\n%c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c\n>%c SheetXL.moreExamples()", "color:#ffa726;", "font-family:monospace;color:#1976d2;font-size:12px;", "font-family:monospace;", "font-family:monospace;color:#1976d2;font-size:12px;", "font-family:monospace;"), Hl = true;
|
|
1415
1415
|
const e3 = document.getElementById("openEditorLink");
|
|
1416
1416
|
e3 && e3.addEventListener("click", (e4) => {
|
|
1417
1417
|
e4.preventDefault(), console.log("openScriptEditor called from console");
|
|
@@ -1421,20 +1421,20 @@ const Hl = async (e2) => {
|
|
|
1421
1421
|
e3 instanceof DOMException || console.error(e3);
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
|
-
},
|
|
1425
|
-
|
|
1426
|
-
},
|
|
1424
|
+
}, Ol = (e2) => {
|
|
1425
|
+
Wl = e2;
|
|
1426
|
+
}, Vl = 0.12, Gl = (e2, t2) => {
|
|
1427
1427
|
const o2 = {}, n2 = (e3) => {
|
|
1428
1428
|
const t3 = e3.palette?.background.default ?? "rgba(255,255,255,1)";
|
|
1429
|
-
return { text: { fontFamily: e3.typography?.fontFamily ?? "Calibri", fontSize: e3.typography?.fontSize ?? 8.25, fontWeight: e3.typography?.fontWeightRegular ?? "400", fill: "dark" === e3.palette.mode ? e3.palette?.text?.secondary : e3.palette?.text?.primary }, fill: t3, strokeFill: Go(t3,
|
|
1429
|
+
return { text: { fontFamily: e3.typography?.fontFamily ?? "Calibri", fontSize: e3.typography?.fontSize ?? 8.25, fontWeight: e3.typography?.fontWeightRegular ?? "400", fill: "dark" === e3.palette.mode ? e3.palette?.text?.secondary : e3.palette?.text?.primary }, fill: t3, strokeFill: Go(t3, Vl, e3.palette?.mode), darkMode: "dark" === e3.palette.mode };
|
|
1430
1430
|
}, a2 = n2(t2);
|
|
1431
|
-
o2.body = n2(e2), o2.header = { ...o2.body, strokeFill: Go(o2.body.fill,
|
|
1431
|
+
o2.body = n2(e2), o2.header = { ...o2.body, strokeFill: Go(o2.body.fill, Vl, e2.palette?.mode), fill: t2 && "dark" === e2.palette.mode && t2.palette.mode !== e2.palette.mode ? o2.body.fill : Go(o2.body.fill, 0.055, e2.palette?.mode), edgeStrokeFill: "dark" === e2.palette.mode ? o2.body.strokeFill : Go(o2.body.fill, 0.328, e2.palette?.mode) }, o2.headerHover = (t3) => ({ ...o2.header, strokeFill: Go(t3?.fill ?? o2.body.fill, 0.22, e2.palette?.mode), fill: Go(t3?.fill ?? o2.header.fill, 0.065, e2.palette?.mode), text: { ...t3?.text, fontWeight: e2.typography?.fontWeightBold } });
|
|
1432
1432
|
const r2 = Go("dark" !== e2.palette.mode ? e2.palette.primary.light : e2.palette.primary.main, 0.055, e2.palette?.mode);
|
|
1433
|
-
o2.headerSelect = { ...o2.header, strokeFill: e2.palette.primary.main, fill:
|
|
1433
|
+
o2.headerSelect = { ...o2.header, strokeFill: e2.palette.primary.main, fill: Ua(r2, 0.2), text: { ...o2.header.text, fill: e2.palette.primary.main }, dividerStrokeFill: Ua(r2, 0.7) }, o2.headerSelectAll = { ...o2.headerSelect, fill: Ua(r2, 0.9), text: { ...o2.headerSelect.text, fill: e2.palette.primary.contrastText }, edgeStrokeFill: o2.headerSelect.strokeFill }, o2.buttonSurface = { ...a2, strokeFill: Go(a2.fill, Vl, t2.palette?.mode), fill: t2 && "dark" === t2.palette.mode && t2.palette.mode !== e2.palette.mode ? a2.fill : Go(a2.fill, 0.055, t2.palette?.mode), edgeStrokeFill: "dark" === t2.palette.mode ? a2.strokeFill : Go(a2.fill, 0.328, t2.palette?.mode) }, o2.headerSelection = { fill: e2.palette?.primary?.main ? Ua(e2.palette?.primary?.main, 0.1) : void 0, strokeFill: e2.palette?.primary?.main }, o2.headerSelectionInactive = { ...o2.headerSelection, fill: e2.palette?.divider ? Ua(e2.palette?.divider, 0.05) : void 0, strokeFill: "transparent" };
|
|
1434
1434
|
const l2 = t2 ?? e2, i2 = "dark" === l2.palette.mode;
|
|
1435
|
-
return o2.selection = { fill: l2.palette?.primary?.main ?
|
|
1436
|
-
},
|
|
1437
|
-
const { children: o2, sx: n2, parentFloat: a2, ...r2 } = e2, l2 =
|
|
1435
|
+
return o2.selection = { fill: l2.palette?.primary?.main ? Ua(l2.palette?.primary?.main, 0.1) : void 0, strokeFill: l2.palette?.primary?.main }, o2.selectionInactive = { ...o2.selection, fill: l2.palette?.divider ? Ua(l2.palette?.divider, 0.05) : void 0, strokeFill: "transparent" }, o2.selectionRemove = { ...o2.selection, fill: Ua(l2.palette.warning.light, 0.05), strokeFill: l2.palette.warning.dark }, t2 && (o2.body = n2(t2)), o2.colorShadow = Ua(l2.palette.action.active, 0.5), o2.colorGrey = l2.palette.action.active, o2.filterDarkInvert = i2 ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", o2;
|
|
1436
|
+
}, Ul = L(H((e2, t2) => {
|
|
1437
|
+
const { children: o2, sx: n2, parentFloat: a2, ...r2 } = e2, l2 = Ra(t2, () => ({}), []), [i2, s2] = Ya(), d2 = U(null), c2 = U(null), [m2, p2] = I.useReducer((e3) => e3 + 1, 0), [u2, g2] = O(null), [h2, f2] = O(null), [x2, b2] = O(null), { reference: y2 } = Eo({ parentFloat: a2, label: "overflow" });
|
|
1438
1438
|
K(() => {
|
|
1439
1439
|
c2.current = { refs: [] };
|
|
1440
1440
|
const e3 = [], t3 = I.Children.toArray(o2);
|
|
@@ -1490,18 +1490,18 @@ const Hl = async (e2) => {
|
|
|
1490
1490
|
const n3 = N(X, { className: "overflow-palette-popup-panel", sx: { display: "flex", flexDirection: "row", flexWrap: "wrap", rowGap: (e4) => e4.spacing(0.25), paddingTop: (e4) => e4.spacing(0.5), paddingBottom: (e4) => e4.spacing(0.5), paddingLeft: (e4) => e4.spacing(1), paddingRight: (e4) => e4.spacing(1), overflow: "hidden" }, children: t3 });
|
|
1491
1491
|
return Te({ ...e3, children: n3 });
|
|
1492
1492
|
}, [x2]);
|
|
1493
|
-
return E(X, { className: "overflow-palette", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", width: "100%", maxWidth: "100%", ...n2 }, ref:
|
|
1494
|
-
})),
|
|
1493
|
+
return E(X, { className: "overflow-palette", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", width: "100%", maxWidth: "100%", ...n2 }, ref: qa([l2, i2, t2]), ...r2, children: [N(X, { sx: { flexDirection: "row", display: "flex", maxWidth: "100%", flex: "1 1 100%" }, children: h2 ?? u2 }), N(X, { sx: { display: null !== x2 && 0 === x2.length ? "none" : "flex", flex: "1 1 0" }, children: N(Ue, { createPopupPanel: w2, ref: d2, parentFloat: y2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: "More", description: "More toolbar options…", disabled: t3, children: e3 }), icon: N(Uo, { children: N(pa, {}) }) }) })] });
|
|
1494
|
+
})), jl = "https://unpkg.com/@sheetxl/scripting-templates/dist", _l = (e2) => {
|
|
1495
1495
|
if (e2.metadata?.name) return e2.metadata.name;
|
|
1496
1496
|
let t2 = (e2.path.split("/").pop() || "").replace(/\.[^/.]+$/, "");
|
|
1497
1497
|
if ("formula" === e2.metadata?.icon) return t2.toUpperCase();
|
|
1498
1498
|
t2 = t2.replace(/([a-z])([A-Z])/g, "$1 $2");
|
|
1499
1499
|
return t2.replace(/[-_]/g, " ").trim().split(/\s+/).map((e3) => e3.charAt(0).toUpperCase() + e3.slice(1)).join(" ");
|
|
1500
|
-
},
|
|
1501
|
-
const t2 =
|
|
1502
|
-
if (!o2.ok) throw new
|
|
1500
|
+
}, ql = async (e2) => {
|
|
1501
|
+
const t2 = tr.relativePath(e2, "./manifest.json"), o2 = await fetch(t2);
|
|
1502
|
+
if (!o2.ok) throw new Xa(`Failed to retrieve directory at '${e2}': ${o2.statusText}`);
|
|
1503
1503
|
const n2 = await o2.text();
|
|
1504
|
-
if (n2.trim().toLowerCase().startsWith("<!doctype html") || n2.trim().toLowerCase().startsWith("<html")) throw new
|
|
1504
|
+
if (n2.trim().toLowerCase().startsWith("<!doctype html") || n2.trim().toLowerCase().startsWith("<html")) throw new Xa(`Failed to retrieve directory at '${e2}'`);
|
|
1505
1505
|
let a2;
|
|
1506
1506
|
try {
|
|
1507
1507
|
a2 = JSON.parse(n2);
|
|
@@ -1510,11 +1510,11 @@ const Hl = async (e2) => {
|
|
|
1510
1510
|
}
|
|
1511
1511
|
const r2 = a2.map(async (t3) => {
|
|
1512
1512
|
try {
|
|
1513
|
-
const o3 =
|
|
1513
|
+
const o3 = tr.relativePath(e2, t3.path), n3 = await fetch(o3);
|
|
1514
1514
|
if (!n3.ok) throw new Error(`Failed to fetch file at '${t3.path}': ${n3.statusText}`);
|
|
1515
1515
|
const a3 = await n3.text();
|
|
1516
1516
|
let r3 = t3.metadata;
|
|
1517
|
-
r3?.title || (r3 = { title:
|
|
1517
|
+
r3?.title || (r3 = { title: _l(t3), ...r3 });
|
|
1518
1518
|
return { path: t3.path, content: a3, metadata: r3 };
|
|
1519
1519
|
} catch (e3) {
|
|
1520
1520
|
console.error(e3.message);
|
|
@@ -1522,22 +1522,22 @@ const Hl = async (e2) => {
|
|
|
1522
1522
|
return null;
|
|
1523
1523
|
});
|
|
1524
1524
|
return (await Promise.all(r2)).filter((e3) => null !== e3);
|
|
1525
|
-
},
|
|
1525
|
+
}, Kl = { fontSize: "0.8rem", marginRight: "4px" }, Xl = L((e2) => {
|
|
1526
1526
|
const { disabled: t2, snippet: o2, description: n2, handleInsert: a2, sx: r2, ...l2 } = e2;
|
|
1527
1527
|
let i2;
|
|
1528
|
-
return i2 = "formula" === o2.metadata?.icon ? N(_o, { sx:
|
|
1528
|
+
return i2 = "formula" === o2.metadata?.icon ? N(_o, { sx: Kl }) : "macro" === o2.metadata?.icon ? N(qo, { sx: Kl }) : N(ua, { sx: Kl }), N(qe, { sx: { maxWidth: "460px", display: "flex", "*": { lineHeight: "1.2" }, ...r2 }, disabled: t2, icon: i2, onMouseDown: (e3) => {
|
|
1529
1529
|
0 === e3.button && e3.preventDefault();
|
|
1530
1530
|
}, onMouseUp: (e3) => {
|
|
1531
1531
|
0 === e3.button && a2(o2);
|
|
1532
1532
|
}, onKeyDown: (e3) => {
|
|
1533
1533
|
e3.keyCode !== Sa.Enter && e3.keyCode !== Sa.Space || a2(o2);
|
|
1534
|
-
}, ...l2, children: E(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [N(Z, { component: "div", children: o2.metadata?.title ?? o2.path }), N(Z, { variant: "caption", component: "div", sx: { color: (e3) =>
|
|
1535
|
-
}),
|
|
1536
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, scriptPath: l2 =
|
|
1534
|
+
}, ...l2, children: E(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [N(Z, { component: "div", children: o2.metadata?.title ?? o2.path }), N(Z, { variant: "caption", component: "div", sx: { color: (e3) => Ua(e3.palette.text.secondary ?? e3.palette.text.primary, 0.6), overflow: "hidden", textOverflow: "ellipsis" }, children: o2.metadata?.summary })] }) });
|
|
1535
|
+
}), Zl = L(H((e2, t2) => {
|
|
1536
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, scriptPath: l2 = jl, ...i2 } = e2, [s2, d2] = O([]), [c2, m2] = O(true), p2 = ba(o2, ["executeSelectedScript"]), u2 = p2[0]?.context?.();
|
|
1537
1537
|
V(() => {
|
|
1538
1538
|
(async () => {
|
|
1539
1539
|
try {
|
|
1540
|
-
const e3 = await
|
|
1540
|
+
const e3 = await ql(l2);
|
|
1541
1541
|
d2(e3);
|
|
1542
1542
|
} catch (e3) {
|
|
1543
1543
|
} finally {
|
|
@@ -1552,50 +1552,50 @@ const Hl = async (e2) => {
|
|
|
1552
1552
|
}, i3 = [];
|
|
1553
1553
|
for (let e4 = 0; e4 < s2.length; e4++) {
|
|
1554
1554
|
const t4 = s2[e4];
|
|
1555
|
-
t4 && i3.push(N(
|
|
1555
|
+
t4 && i3.push(N(Xl, { handleInsert: l3, snippet: t4 }, t4.path));
|
|
1556
1556
|
}
|
|
1557
1557
|
const d3 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [i3.length > 0 ? E(A, { children: [N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: i3 }), N(Se, { orientation: "horizontal" })] }) : null, j(ke, { ...a3, key: "help", command: o2.getCommand("help"), icon: we(N(io, {})) })] });
|
|
1558
1558
|
return Te({ ...e3, children: d3 });
|
|
1559
1559
|
}, [r2, n2, a2, c2, u2]);
|
|
1560
1560
|
return N(De, { ref: t2, commands: o2, disabled: r2, commandHook: n2, scope: a2, label: "Insert Script", tooltip: "Inserts a script from a set of templates.", createPopupPanel: g2, icon: we(N(jo, {})), ...i2 });
|
|
1561
|
-
})),
|
|
1561
|
+
})), Jl = L(H((e2, t2) => {
|
|
1562
1562
|
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, l2 = wa((e3) => {
|
|
1563
1563
|
const { commandButtonProps: t3, commandPopupProps: a3 } = e3;
|
|
1564
|
-
return N(A, { children: E("div", { style: { display: "flex", flex: "1 1 100%" }, children: [N("div", { children: N(
|
|
1564
|
+
return N(A, { children: E("div", { style: { display: "flex", flex: "1 1 100%" }, children: [N("div", { children: N(Ul, { parentFloat: n2, style: {}, children: N(ke, { ...t3, command: o2.getCommand("saveScripts"), icon: we(N(Ko, {})) }) }) }), N("div", { style: { flex: "1 1 100%" } }), N("div", { children: N(Ul, { parentFloat: n2, style: {}, children: N(Zl, { ...t3, commands: o2 }) }) })] }) });
|
|
1565
1565
|
}, [o2]);
|
|
1566
1566
|
return N(Xo, { ref: t2, commands: o2, parentFloat: n2, commandButtonProps: a2, createToolbarPalette: l2, ...r2 });
|
|
1567
1567
|
}));
|
|
1568
|
-
|
|
1569
|
-
const
|
|
1570
|
-
const { scriptPath: o2 =
|
|
1568
|
+
Jl.displayName = "ScriptEditorToolbar";
|
|
1569
|
+
const Yl = { fontSize: "1rem" }, Ql = L(H((e2, t2) => {
|
|
1570
|
+
const { scriptPath: o2 = jl, onScriptSelect: n2, sx: a2 = ka.EmptyCssProperties, className: r2, buttonMinWidth: l2 = 210, buttonMinHeight: i2 = 80, gap: s2 = 12, ...d2 } = e2, [c2, m2] = O([]), [p2, u2] = O(true), [g2, h2] = O(null);
|
|
1571
1571
|
if (V(() => {
|
|
1572
1572
|
(async () => {
|
|
1573
1573
|
const e3 = [{ path: null, metadata: { title: "Blank Template...", summary: "Start with an empty script." }, content: "" }];
|
|
1574
1574
|
try {
|
|
1575
1575
|
u2(true), h2(null);
|
|
1576
|
-
const t3 = await
|
|
1576
|
+
const t3 = await ql(o2);
|
|
1577
1577
|
for (let o3 = 0; o3 < t3.length; o3++) {
|
|
1578
1578
|
const n3 = t3[o3];
|
|
1579
1579
|
n3 && e3.push(n3);
|
|
1580
1580
|
}
|
|
1581
1581
|
} catch (e4) {
|
|
1582
|
-
h2(e4 instanceof Error ? e4.message : "Failed to load scripts"), e4 instanceof
|
|
1582
|
+
h2(e4 instanceof Error ? e4.message : "Failed to load scripts"), e4 instanceof Xa || console.error("Error loading scripts:", e4);
|
|
1583
1583
|
} finally {
|
|
1584
1584
|
m2(e3), u2(false);
|
|
1585
1585
|
}
|
|
1586
1586
|
})();
|
|
1587
|
-
}, [o2]), p2) return N(X, { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", className: Yn(r2, "script-select"), sx: { background: (e3) => e3.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${
|
|
1587
|
+
}, [o2]), p2) return N(X, { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", className: Yn(r2, "script-select"), sx: { background: (e3) => e3.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})`, ...a2 }, ...d2, children: N(me, {}) });
|
|
1588
1588
|
let f2 = null;
|
|
1589
|
-
g2 && (f2 = E(X, { display: "flex", justifyContent: "center", alignItems: "center", className: Yn(r2, "script-select", "error-results"), sx: { background: (e3) => e3.palette.error.light, flex: "0", zIndex: 1e3, flexDirection: "column", padding: (e3) => e3.spacing(1), border: (e3) => `1px solid ${e3.palette.error.main}`, borderBottomLeftRadius: 1, borderBottomRightRadius: 1, backgroundImage: `linear-gradient(${
|
|
1589
|
+
g2 && (f2 = E(X, { display: "flex", justifyContent: "center", alignItems: "center", className: Yn(r2, "script-select", "error-results"), sx: { background: (e3) => e3.palette.error.light, flex: "0", zIndex: 1e3, flexDirection: "column", padding: (e3) => e3.spacing(1), border: (e3) => `1px solid ${e3.palette.error.main}`, borderBottomLeftRadius: 1, borderBottomRightRadius: 1, backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})` }, ...d2, children: [N(Z, { color: "error", variant: "h6", component: "div", gutterBottom: true, children: "Error loading Templates" }), N(Z, { color: "error", component: "div", children: g2 })] }));
|
|
1590
1590
|
const x2 = (e3) => {
|
|
1591
1591
|
const t3 = e3.metadata?.icon;
|
|
1592
|
-
return "macro" === t3 ? N(qo, { sx:
|
|
1592
|
+
return "macro" === t3 ? N(qo, { sx: Yl }) : "formula" === t3 ? N(_o, { sx: Yl }) : "autostart" === t3 ? N(ua, { sx: Yl }) : null;
|
|
1593
1593
|
};
|
|
1594
|
-
return E(X, { ref: t2, className: Yn(r2, "script-select"), sx: { background: (e3) => e3.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${
|
|
1594
|
+
return E(X, { ref: t2, className: Yn(r2, "script-select"), sx: { background: (e3) => e3.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})`, ...a2 }, ...d2, children: [E(X, { p: 3, className: "script-select-content", sx: { overflow: "auto", flex: "1 1 auto" }, children: [N(Z, { variant: "h6", gutterBottom: true, children: "Script Template" }), N(Z, { variant: "body2", component: "div", color: "text.secondary", gutterBottom: true, children: "Choose from a template to provide a starting point to automate tasks or create user defined functions." }), N(Z, { variant: "body2", component: "div", color: "text.secondary", gutterBottom: true, children: "Templates provide a foundation to customize and meet your specific needs." }), N(X, { sx: { display: "grid", gridTemplateColumns: `repeat(auto-fill, minmax(${l2}px, 1fr))`, gap: `${s2}px`, padding: 2, paddingLeft: "0px", paddingRight: "0px" }, children: c2.map((e3, t3) => E(ee, { variant: "outlined", sx: { minWidth: l2, minHeight: i2, display: "flex", flexDirection: "column", justifyContent: "flex-start", alignItems: "flex-start", textAlign: "left", padding: 2, textTransform: "none", overflow: "hidden", ...0 === t3 && { borderStyle: "dashed", marginBottom: "8px" }, ...1 === t3 && { gridColumn: "1" } }, onClick: () => n2?.(e3), children: [E(X, { sx: { display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%", marginBottom: 0.5 }, children: [N(Z, { variant: "subtitle2", component: "div", children: e3.metadata?.title || e3.path.split("/").pop()?.replace(/\.\w+$/, "") || "Untitled" }), x2(e3)] }), e3.metadata?.summary && N(Z, { variant: "body2", component: "div", color: "text.secondary", sx: { overflow: "hidden", display: "flex", flexDirection: "column", textOverflow: "ellipsis", alignItems: "flex-start" }, children: e3.metadata.summary })] }, `${e3.path}-${t3}`)) })] }), f2] });
|
|
1595
1595
|
}));
|
|
1596
|
-
|
|
1597
|
-
const
|
|
1598
|
-
const { className: o2, sx: n2, editorProps: a2, commands: r2, readOnly: l2 = false, onClose: i2, autoFocusSel: s2, autoFocus: d2 = true, scripts: c2, ...m2 } = e2, p2 =
|
|
1596
|
+
Ql.displayName = "TemplateSelectPanel";
|
|
1597
|
+
const ei = L(H((e2, t2) => {
|
|
1598
|
+
const { className: o2, sx: n2, editorProps: a2, commands: r2, readOnly: l2 = false, onClose: i2, autoFocusSel: s2, autoFocus: d2 = true, scripts: c2, ...m2 } = e2, p2 = $a(), [u2, g2] = O(false), h2 = U(false), [f2, x2] = O({ message: "Loading", cursor: "", dirty: false }), [b2, y2] = O(null);
|
|
1599
1599
|
V(() => {
|
|
1600
1600
|
let e3 = false;
|
|
1601
1601
|
return y2(null), (async function() {
|
|
@@ -1616,7 +1616,7 @@ const Jl = L(H((e2, t2) => {
|
|
|
1616
1616
|
if (t3 && t3.length > 0) return t3[0]?.focus?.(e3), true;
|
|
1617
1617
|
}
|
|
1618
1618
|
return S2.current?.focus?.(e3), false;
|
|
1619
|
-
}, [v2, s2, d2]), R2 = W(() => N(Ve, { transitionDelay: "160ms", style: { position: "absolute", width: "100%", height: "100%" }, transparentBackground: false }), []), M2 = W(() => N(ce, { elevation: 1, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, backgroundImage: `linear-gradient(${
|
|
1619
|
+
}, [v2, s2, d2]), R2 = W(() => N(Ve, { transitionDelay: "160ms", style: { position: "absolute", width: "100%", height: "100%" }, transparentBackground: false }), []), M2 = W(() => N(ce, { elevation: 1, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})`, marginLeft: (e3) => e3.spacing(0.5), marginRight: (e3) => e3.spacing(0.5), marginTop: (e3) => e3.spacing(1), marginBottom: (e3) => e3.spacing(1) }, children: N(Jl, { commands: r2 }) }), [p2, r2]), F2 = W(() => N(X, { className: Yn("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 ${p2.palette.divider}` }, children: E("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "center", flexDirection: "row", justifyContent: "center" }, children: [N(Z, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "1 1 100%", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.message }), N(Z, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.dirty ? "Unsaved" : "" }), N(Z, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", marginLeft: "8px", minWidth: "90px", display: "flex", justifyContent: "end", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.cursor })] }) }), [f2]), B2 = W(() => E(X, { className: Yn("script-editor-content"), sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "column", boxSizing: "border-box" }, children: [M2, N(X, { sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "row", position: "relative", boxSizing: "border-box" }, children: N(C, { ref: S2, loadingPanel: R2, readOnly: l2, onClose: i2, autoFocus: d2, commands: r2, onStatusChange: w2, darkMode: "dark" === p2.palette.mode, ...a2 }) }), F2] }), [p2, r2, M2, F2, u2, R2, l2, a2, d2, s2, i2, w2]), A2 = W(() => N(pe, { className: Yn({ "Mui-selected": h2.current }), sx: { display: "flex", color: (e3) => e3.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: (e3) => `${e3.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: (e3) => e3.transitions.duration.shortest / 2 + "ms" }, backgroundColor: (e3) => Oa(e3.palette.action.hover, 0.03), borderBottom: (e3) => `solid ${Oa(e3.palette.divider, 0.2)} 1px` }, onPointerDown: (e3) => {
|
|
1620
1620
|
e3.isDefaultPrevented() || (e3.preventDefault(), P2());
|
|
1621
1621
|
}, children: E(X, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: (e3) => e3.spacing(0.25), marginBottom: (e3) => e3.spacing(0.25), marginLeft: (e3) => e3.spacing(1), marginRight: (e3) => e3.spacing(1) }, children: [N(X, { sx: { flex: "1 1 100%", paddingLeft: (e3) => e3.spacing(1) }, children: "Script (Typescript)" }), N(Je, { label: "Close", children: N(J, { "aria-label": "close", sx: { color: (e3) => e3.palette.text.icon ?? e3.palette.action.active }, touchRippleRef: k2, onPointerDown: (e3) => {
|
|
1622
1622
|
k2.current?.start(e3, { center: false }), e3.stopPropagation(), e3.preventDefault();
|
|
@@ -1624,12 +1624,12 @@ const Jl = L(H((e2, t2) => {
|
|
|
1624
1624
|
S2.current?.close();
|
|
1625
1625
|
}, children: N(ga, {}) }) })] }) }), [p2, u2]), I2 = W(() => {
|
|
1626
1626
|
let e3;
|
|
1627
|
-
return null === b2 ? null : (null === b2.source && (e3 = N(
|
|
1627
|
+
return null === b2 ? null : (null === b2.source && (e3 = N(Ql, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", position: "absolute", boxSizing: "border-box", width: "100%", height: "100%" }, onScriptSelect: (e4) => {
|
|
1628
1628
|
S2.current?.getEditor().insertSnippet(e4.content), y2({ source: e4.content ?? "" });
|
|
1629
|
-
} })), E(X, { tabIndex: 0, className: Yn("script-workspace", o2), sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", alignItems: "stretch", userSelect: "none", flexGrow: 0, outline: "none", backgroundImage: `linear-gradient(${
|
|
1629
|
+
} })), E(X, { tabIndex: 0, className: Yn("script-workspace", o2), sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", alignItems: "stretch", userSelect: "none", flexGrow: 0, outline: "none", backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})` }, onPointerDown: (e4) => {
|
|
1630
1630
|
e4.isDefaultPrevented() || S2.current?.focus();
|
|
1631
1631
|
}, children: [A2, E(X, { sx: { flex: "1 1 100%", position: "relative", display: "flex" }, children: [B2, e3] })] }));
|
|
1632
|
-
}, [M2, B2, o2, b2]), L2 =
|
|
1632
|
+
}, [M2, B2, o2, b2]), L2 = Ra(t2, () => ({ isScriptWorkspaceElement: () => true, focus: (e3) => {
|
|
1633
1633
|
P2(e3);
|
|
1634
1634
|
} }), []);
|
|
1635
1635
|
return N(X, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", ...n2 }, ref: L2, ...m2, onFocus: (e3) => {
|
|
@@ -1638,8 +1638,8 @@ const Jl = L(H((e2, t2) => {
|
|
|
1638
1638
|
L2?.current?.contains(e3.relatedTarget) || L2?.current === e3.relatedTarget || (D2.current = null, h2.current = false, g2(false)), m2?.onBlur?.(e3);
|
|
1639
1639
|
}, children: I2 });
|
|
1640
1640
|
}));
|
|
1641
|
-
|
|
1642
|
-
const
|
|
1641
|
+
ei.displayName = "ScriptWorkspace";
|
|
1642
|
+
const ti = L(H((e2, t2) => {
|
|
1643
1643
|
const { commands: o2, ...n2 } = e2, a2 = ba(o2, ["executeScript", "showScriptEditor"]), [r2, l2] = O([]), [i2, s2] = O(false), d2 = a2[0]?.context?.();
|
|
1644
1644
|
V(() => {
|
|
1645
1645
|
const e3 = d2?.getScripts();
|
|
@@ -1658,14 +1658,14 @@ const Yl = L(H((e2, t2) => {
|
|
|
1658
1658
|
const u2 = E(X, { ref: t2, sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [m2.length > 0 ? E(A, { children: [N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: m2 }), N(Se, { orientation: "horizontal" })] }) : null, j(ke, { ...c2, key: "show-editor", command: o2.getCommand("showScriptEditor"), icon: we(N(Zo, {})) })] });
|
|
1659
1659
|
return Te({ ...n2, children: u2 });
|
|
1660
1660
|
}));
|
|
1661
|
-
|
|
1662
|
-
const
|
|
1661
|
+
ti.displayName = "RunScriptPopupPanel";
|
|
1662
|
+
const oi = L(H((e2, t2) => {
|
|
1663
1663
|
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = "showScriptEditor", s2 = ba(o2, ["executeScript", "showScriptEditor"])[0].context(), d2 = z((e3, t3) => {
|
|
1664
|
-
const o3 = N(
|
|
1664
|
+
const o3 = N(ti, { ...e3, commands: t3 });
|
|
1665
1665
|
return Te({ ...e3, children: o3 });
|
|
1666
1666
|
}, [r2, s2, n2, a2]);
|
|
1667
1667
|
return N(De, { ref: t2, commands: o2, commandHook: n2, createPopupPanel: d2, selected: o2.getCommand(i2).state(), label: "Macros", tooltip: "Run or manage macros.", quickCommand: i2, icon: we(N(Jo, {})), ...l2 });
|
|
1668
|
-
})),
|
|
1668
|
+
})), ni = L(H((e2, t2) => {
|
|
1669
1669
|
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, [l2, i2] = O(false), s2 = ba(o2, ["executeScript", "showScriptEditor"]), d2 = s2[0]?.context?.();
|
|
1670
1670
|
V(() => {
|
|
1671
1671
|
const e3 = d2?.getScripts();
|
|
@@ -1690,45 +1690,45 @@ const Ql = L(H((e2, t2) => {
|
|
|
1690
1690
|
};
|
|
1691
1691
|
}, [d2]);
|
|
1692
1692
|
const c2 = z((e3) => {
|
|
1693
|
-
const { commandButtonProps: t3, commandPopupProps: a3 } = e3, r3 = N(
|
|
1693
|
+
const { commandButtonProps: t3, commandPopupProps: a3 } = e3, r3 = N($r, { ...a3, command: o2.getCommand("formatFontColor"), icon: N(Yo, {}), isSplit: true, panelProps: { disableAlpha: true } }), i3 = N($r, { ...a3, command: o2.getCommand("formatFillColor"), icon: N(Qo, {}), isSplit: true, panelProps: { disableAlpha: true, autoColorLabel: "No Fill", autoColorPosition: mr.End } }), s3 = o2.getCommand("undo") ? N(A, { children: N(Ur, { ...a3, quickCommand: "undo" }) }) : null, d3 = o2.getCommand("find") ? N(A, { children: N(Nr, { ...a3 }) }) : null;
|
|
1694
1694
|
let c3 = null;
|
|
1695
|
-
l2 && (c3 = E(A, { children: [N(Se, {}), N(
|
|
1696
|
-
return E(
|
|
1695
|
+
l2 && (c3 = E(A, { children: [N(Se, {}), N(oi, { ...a3 })] }));
|
|
1696
|
+
return E(Ul, { parentFloat: n2, children: [s3, null, s3 ? N(Se, {}) : null, N(Zr, { ...a3, command: o2.getCommand("paste") }), N(ke, { ...t3, command: o2.getCommand("formatPainterToggle"), icon: we(N(en, {})) }), N(bl, { ...t3, command: o2.getCommand("copy") }), N(Se, {}), N(qr, { ...a3, command: o2.getCommand("formatFontFamily") }), N(Er, { ...a3, command: o2.getCommand("formatFontSize") }), N(ke, { ...t3, command: o2.getCommand("formatBoldToggle"), icon: N(tn, {}) }), N(ke, { ...t3, command: o2.getCommand("formatItalicToggle"), icon: N(on, {}) }), N(Xr, { ...a3 }), N(Kr, { ...a3 }), r3, N(Se, {}), i3, N(Mr, { ...a3 }), N(Fr, { ...a3 }), N(Se, {}), N(lr, { ...a3 }), N(ir, { ...a3 }), N(sr, { ...a3 }), N(dr, { ...a3 }), N(Se, {}), N(Ir, { ...a3 }), N(tl, { command: o2.getCommand("formatCellStyle"), ...a3 }), N(dl, { command: o2.getCommand("formatTableStyle"), ...a3 }), N(Se, {}), N(Wr, { ...a3 }), N(zr, { ...a3 }), N(Se, {}), N(Hr, { ...a3 }), null, N(Lr, { ...a3 }), N(Vr, { ...a3 }), d3, c3] });
|
|
1697
1697
|
}, [o2, s2, l2]);
|
|
1698
1698
|
return N(Xo, { ref: t2, commands: o2, parentFloat: n2, commandButtonProps: a2, createToolbarPalette: c2, ...r2 });
|
|
1699
1699
|
}));
|
|
1700
|
-
|
|
1701
|
-
const
|
|
1700
|
+
ni.displayName = "HomeToolbar";
|
|
1701
|
+
const ai = L(H((e2, t2) => {
|
|
1702
1702
|
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, l2 = wa((e3) => {
|
|
1703
1703
|
const { commandButtonProps: t3, commandPopupProps: a3 } = e3;
|
|
1704
|
-
return E(
|
|
1704
|
+
return E(Ul, { parentFloat: n2, children: [null, N(ke, { ...t3, command: o2.getCommand("updateHyperlink"), icon: we(N(nn, {})) }), N(ke, { ...t3, command: o2.getCommand("updateComments"), icon: we(N(an, {})) }), N(xl, { ...a3 }), N(ke, { ...t3, command: o2.getCommand("insertTable"), icon: we(N(Ho, {})) })] });
|
|
1705
1705
|
}, [o2]);
|
|
1706
1706
|
return N(Xo, { ref: t2, commands: o2, parentFloat: n2, commandButtonProps: a2, createToolbarPalette: l2, ...r2 });
|
|
1707
1707
|
}));
|
|
1708
|
-
|
|
1709
|
-
const
|
|
1708
|
+
ai.displayName = "InsertToolbar";
|
|
1709
|
+
const ri = L(H((e2, t2) => {
|
|
1710
1710
|
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, l2 = wa((e3) => {
|
|
1711
1711
|
const { commandButtonProps: t3, commandPopupProps: a3 } = e3;
|
|
1712
|
-
return E(
|
|
1712
|
+
return E(Ul, { parentFloat: n2, children: [N(Br, { ...a3 }), N(ke, { ...t3, command: o2.getCommand("protectionSheetToggle"), icon: N(ma, { color: "secondary" }) }), N(Se, {}), N(Or, { ...a3 }), N(Jr, { ...a3 }), N(Se, {}), N(ke, { ...t3, command: o2.getCommand("sheetViewToggleFormulaView"), scope: "view", icon: we(N(rn, {})) }), N(ke, { ...t3, command: o2.getCommand("sheetViewToggleShowZeros"), scope: "view", icon: we(N(ln, {})) }), N(Se, {}), N(Yr, { ...a3 }), N(gl, { command: o2.getCommand("selectTheme"), ...a3 }), N(Se, {}), N(oi, { ...a3, scope: "view" }), N(Se, {}), N(ke, { ...t3, command: o2.getCommand("fullScreenToggle"), scope: "view", icon: () => we(o2.getCommand("fullScreenToggle").state() ? N(sn, {}) : N(dn, {})) })] });
|
|
1713
1713
|
}, [o2]);
|
|
1714
1714
|
return N(Xo, { ref: t2, commands: o2, parentFloat: n2, commandButtonProps: a2, createToolbarPalette: l2, ...r2 });
|
|
1715
1715
|
}));
|
|
1716
|
-
|
|
1717
|
-
const
|
|
1716
|
+
ri.displayName = "ViewToolbar";
|
|
1717
|
+
const li = (e2) => N(ci, { ...e2 }), ii = L((e2) => {
|
|
1718
1718
|
const { sx: t2, ...o2 } = e2;
|
|
1719
|
-
return E(X, { sx: { display: "flex", flexDirection: "column", position: "relative", "&:hover:not([disabled]) .indicator": { borderBottom: (e3) => `${
|
|
1719
|
+
return E(X, { sx: { display: "flex", flexDirection: "column", position: "relative", "&:hover:not([disabled]) .indicator": { borderBottom: (e3) => `${Oa(e3.palette.primary.main, 0.35)} solid 2px` } }, children: [N(he, { disableRipple: true, onMouseDown: (e3) => {
|
|
1720
1720
|
0 === e3.button && e3.preventDefault();
|
|
1721
1721
|
}, sx: { textTransform: "none", flex: "1 1 100%", fontWeight: (e3) => e3.typography.fontWeightRegular, padding: "2px 6px", minHeight: "0px", minWidth: "0px", marginRight: (e3) => e3.spacing(0.5), "&.Mui-selected": {}, "&.Mui-focusVisible": {}, ...t2 }, ...o2 }), N(X, { className: "indicator", sx: { width: "90%", borderRadius: "4px", minWidth: "4px", position: "absolute", bottom: "0", alignSelf: "center", display: "flex" } })] });
|
|
1722
|
-
}),
|
|
1722
|
+
}), si = L((e2) => {
|
|
1723
1723
|
const { toolbars: t2, value: o2, onToolbarChange: n2, sx: a2, ...r2 } = e2, l2 = W(() => {
|
|
1724
1724
|
const e3 = [];
|
|
1725
|
-
for (let o3 = 0; o3 < t2.length; o3++) e3.push(N(
|
|
1725
|
+
for (let o3 = 0; o3 < t2.length; o3++) e3.push(N(ii, { label: t2[o3].label }, t2[o3].label));
|
|
1726
1726
|
return e3;
|
|
1727
1727
|
}, [t2]);
|
|
1728
1728
|
return N(ge, { value: o2, onChange: (e3, t3) => {
|
|
1729
1729
|
n2?.(t3);
|
|
1730
1730
|
}, variant: "scrollable", scrollButtons: false, sx: { paddingLeft: (e3) => e3.spacing(1.5), paddingRight: (e3) => e3.spacing(1.5), paddingTop: (e3) => e3.spacing(0), paddingBottom: (e3) => e3.spacing(0), minHeight: "26px", alignItems: "center", "& .MuiTabs-indicator": { display: "flex", justifyContent: "center", backgroundColor: "transparent" }, "& .MuiTabs-indicatorSpan": { width: "90%", borderRadius: "4px", minWidth: "4px", backgroundColor: (e3) => e3.palette.primary.main }, "& .MuiTab-root": { marginRight: "0px" }, ...a2 }, TabIndicatorProps: { children: N("span", { className: "MuiTabs-indicatorSpan" }) }, ...r2, children: l2 });
|
|
1731
|
-
}),
|
|
1731
|
+
}), di = L((e2) => {
|
|
1732
1732
|
const { toolbars: t2, value: o2, onToolbarChange: n2, selectProps: a2, ...r2 } = e2, l2 = z((e3) => {
|
|
1733
1733
|
n2?.(e3.target.value);
|
|
1734
1734
|
}, [n2]), i2 = W(() => {
|
|
@@ -1741,63 +1741,63 @@ const ni = (e2) => N(ii, { ...e2 }), ai = L((e2) => {
|
|
|
1741
1741
|
}
|
|
1742
1742
|
return e3;
|
|
1743
1743
|
}, [t2, o2]);
|
|
1744
|
-
return N(le, { sx: { minWidth: "125px", maxWidth: "125px", "& .MuiInputBase-root": { paddingLeft: "0px", paddingRight: "0px" }, "& .MuiSelect-select": { paddingTop: (e3) => e3.spacing(0.5), paddingBottom: (e3) => e3.spacing(0.5), paddingLeft: (e3) => e3.spacing(2), color: (e3) => e3.palette.primary.main }, "& .MuiSelect-icon": { fill: (e3) => e3.palette.text.icon ?? e3.palette.action.active, "&:hover:not(.Mui-disabled)": { color: (e3) => e3.palette.text.icon ?? e3.palette.action.active } }, ...a2 }, size: "small", children: N(ue, { value: o2, onChange: l2, variant: "outlined", sx: { backgroundImage: `linear-gradient(${
|
|
1745
|
-
}),
|
|
1744
|
+
return N(le, { sx: { minWidth: "125px", maxWidth: "125px", "& .MuiInputBase-root": { paddingLeft: "0px", paddingRight: "0px" }, "& .MuiSelect-select": { paddingTop: (e3) => e3.spacing(0.5), paddingBottom: (e3) => e3.spacing(0.5), paddingLeft: (e3) => e3.spacing(2), color: (e3) => e3.palette.primary.main }, "& .MuiSelect-icon": { fill: (e3) => e3.palette.text.icon ?? e3.palette.action.active, "&:hover:not(.Mui-disabled)": { color: (e3) => e3.palette.text.icon ?? e3.palette.action.active } }, ...a2 }, size: "small", children: N(ue, { value: o2, onChange: l2, variant: "outlined", sx: { backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})` }, ...r2, children: i2 }) });
|
|
1745
|
+
}), ci = L(H((e2, t2) => {
|
|
1746
1746
|
const { commands: o2, selectWrapper: n2, selectProps: a2 = {}, renderCompact: r2 = false, paletteWrapper: l2, toolbarsProps: i2, paletteProps: s2 = {}, workbook: d2, sx: c2, ...m2 } = e2, p2 = W(() => {
|
|
1747
1747
|
const e3 = [], { ref: t3, ...n3 } = i2?.Home || {};
|
|
1748
|
-
e3.push({ label: "Home", component: N(
|
|
1748
|
+
e3.push({ label: "Home", component: N(ni, { commands: o2, ...n3 }) });
|
|
1749
1749
|
const { ref: a3, ...r3 } = i2?.Insert || {};
|
|
1750
|
-
e3.push({ label: "Insert", component: N(
|
|
1750
|
+
e3.push({ label: "Insert", component: N(ai, { commands: o2, ...r3 }) });
|
|
1751
1751
|
const { ref: l3, ...s3 } = i2?.View || {};
|
|
1752
|
-
return e3.push({ label: "View", component: N(
|
|
1752
|
+
return e3.push({ label: "View", component: N(ri, { commands: o2, ...s3 }) }), e3;
|
|
1753
1753
|
}, [o2, d2]), u2 = W(() => {
|
|
1754
1754
|
const e3 = [];
|
|
1755
1755
|
for (let t3 = 0; t3 < p2.length; t3++) e3.push(I.cloneElement(p2[t3].component, { ...p2[t3].component.props, key: p2[t3].key ?? p2[t3].label }));
|
|
1756
1756
|
return e3;
|
|
1757
1757
|
}, [p2]), [g2, h2] = O(0), f2 = (e3) => {
|
|
1758
1758
|
h2(e3);
|
|
1759
|
-
}, x2 = W(() => N(r2 ?
|
|
1759
|
+
}, x2 = W(() => N(r2 ? di : si, { toolbars: p2, value: g2, onToolbarChange: f2, sx: a2 }), [p2, g2, a2, r2]), { sx: b2, ...y2 } = s2, w2 = N(ce, { elevation: 2, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, borderRadius: "8px", backgroundImage: `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})`, marginLeft: (e3) => e3.spacing(1), marginRight: (e3) => e3.spacing(1), marginTop: (e3) => e3.spacing(0.5), marginBottom: (e3) => e3.spacing(0.5), ...b2 }, ...y2, children: u2[g2] });
|
|
1760
1760
|
return E(X, { ref: t2, className: "toolbarWrappers", sx: { display: "flex", flexDirection: "column", paddingTop: (e3) => e3.spacing(0.5), "*": { userSelect: "none" }, ...c2 }, ...m2, children: [n2 ? n2(x2) : x2, l2 ? l2(w2) : w2] });
|
|
1761
1761
|
}));
|
|
1762
|
-
|
|
1763
|
-
const
|
|
1764
|
-
const { workbook: t2, workbookElement: o2,
|
|
1762
|
+
ci.displayName = "WorkbookToolbars";
|
|
1763
|
+
const mi = (e2) => {
|
|
1764
|
+
const { workbook: t2, workbookElement: o2, target: n2, commands: a2, darkMode: r2, onShowSidebar: l2, onNewWorkbook: i2 = pi } = e2, s2 = Da(), [d2, c2] = O(t2?.getSelectedSheet()), [m2, p2] = O(t2?.getSheets().getItems()), g2 = wa(l2, [l2]), h2 = wa(i2, [i2]), f2 = W(() => [new Ba("workbookStatistics", n2, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [Ea.Ctrl, Ea.Shift] } }), new Ba("showFormat", n2, { label: "Show Format", description: "Open the format pane.", shortcut: { key: "F", modifiers: [Ea.Ctrl, Ea.Shift] } }), new Na("newCellStyle", n2, { label: "New Cell Style…", scopedLabels: { cellStyle: "New Cell Style" }, description: "Create a new named style can can be quickly used later." }), new Na("deleteCellStyle", n2, { label: "Delete Cell Style", scopedLabels: { cellStyle: "Delete" }, description: "Remove a named style that is no longer needed." }), new Na("modifyCellStyle", n2, { label: "Modify Cell Style", scopedLabels: { cellStyle: "Modify" }, description: "Update a style with the currently style." }), new Ba("find", n2, { label: "Find", description: "Open the Find window.", shortcut: [{ key: "F", modifiers: [Ea.Ctrl] }, { key: "F5", modifiers: [Ea.Shift] }] }), new Ba("findReplace", n2, { label: "Find & Replace", description: "Open the Find & Replace window.", shortcut: [{ key: "H", modifiers: [Ea.Ctrl] }, { key: "H", modifiers: [Ea.Ctrl, Ea.Alt] }] }), new Ba("goto", n2, { label: "Go To", description: "Open the 'Go To' window.", shortcut: [{ key: "G", modifiers: [Ea.Ctrl] }] }), new Ba("workbookViewToggleExpandFormulaBar", n2, { label: "Toggle Expand Formula bar", description: "Expand or collapse the formula bar.", shortcut: { key: "U", modifiers: [Ea.Ctrl, Ea.Shift] } }), new Ba("workbookViewToggleShowFormulaBar", n2, { label: "View Formula bar", scopedLabels: { view: "Formula Bar" }, description: "Show or hide the formula bar." }), new Ba("workbookViewToggleShowTabs", n2, { label: "View Sheet Tabs", description: "Show or hide the sheet tabs.", scopedLabels: { view: "Sheet Tabs" } }), new Ba("workbookViewToggleShowStatusBar", n2, { label: "View Status Bar", description: "Show or hide the status bar.", scopedLabels: { view: "Status Bar" } }), new Ba("workbookViewToggleShowHorizontalScrollBar", n2, { label: "View Horizontal Scrollbar", description: "Show or hide the horizontal scrollbar.", scopedLabels: { view: "Horizontal Scrollbar" } }), new Ba("workbookViewToggleShowVerticalScrollBar", n2, { label: "View Vertical Scrollbar", description: "Show or hide the vertical scrollbar.", scopedLabels: { view: "Vertical Scrollbar" } }), new Na("hideSheet", n2, { label: "Hide Sheet", scopedLabels: { sheet: "Hide" }, description: "Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs." }), new Na("deleteSheet", n2, { label: "Delete Sheet", scopedLabels: { sheet: "Delete" }, description: "Delete the sheet and all the data." }), new Na("addSheet", n2, { label: "Insert Sheet", scopedLabels: { sheet: "Insert" }, description: "Insert sheet before the current sheet.", shortcut: [{ key: "F11", modifiers: [Ea.Shift] }, { key: "F1", modifiers: [Ea.Alt, Ea.Shift] }] }), new Na("duplicateSheet", n2, { label: "Duplicate Sheet", description: "Duplicate the current sheet.", scopedLabels: { sheet: "Duplicate" } }), new Na("nextSheet", n2, { label: "Next Sheet", scopedLabels: { sheet: "Next" }, description: "Activate the next sheet.", shortcut: [{ key: "PageDown", modifiers: [Ea.Ctrl] }] }), new Na("previousSheet", n2, { label: "Previous Sheet", scopedLabels: { sheet: "Previous" }, description: "Activate the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [Ea.Ctrl] }] }), new Na("selectNextSheet", n2, { label: "Select Next Sheet", scopedLabels: { sheet: "Select Next" }, description: "Select the next sheet.", shortcut: [{ key: "PageDown", modifiers: [Ea.Ctrl, Ea.Shift] }] }), new Na("selectPreviousSheet", n2, { label: "Select Previous Sheet", scopedLabels: { sheet: "Select Previous" }, description: "Select the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [Ea.Ctrl, Ea.Shift] }] }), new Na("selectTheme", n2, { label: "Theme", description: "Select a theme that coveys a style suitable for your data." }), new Na("selectNamed", n2, { label: (e3) => e3?.getName() ?? "Select Named Item", scopedLabels: { namedItem: (e3) => e3?.getName() ?? "Select" }, description: "Select the item." }), new Na("addNamedReference", n2, { label: "Define Named Reference", scopedLabels: { namedItem: "Define Name…" }, description: "Add a new named reference. Names can be used as a substitute for cell references." }), new Na("editNamedReference", n2, { label: "Edit Named Reference…", scopedLabels: { namedItem: "Edit…" }, description: "Add a new named reference. Names can be used as a substitute for cell references." }), new Na("deleteNamedReference", n2, { label: "Delete Named Reference", scopedLabels: { namedItem: "Delete" }, description: "Remove the named reference." }), new Ba("activeNameBox", n2, { label: "Activate Name Box", description: "Move the focus to the name box.", shortcut: { key: "F3", modifiers: [Ea.Alt] } }), new Ba("createNamedReferenceFromSelection", n2, { label: "Create from Selection", description: "Automatically generate names from the selected cells.", shortcut: { key: "F3", modifiers: [Ea.Ctrl, Ea.Shift] } }), new Ba("activeNameManager", n2, { label: "Activate Name Manager", description: "Create, edit, delete, and find all the names used in the workbook.\n\nNames can be used as a substitute for cell references.", shortcut: { key: "F3", modifiers: [Ea.Ctrl] } }), new Na("fullScreenToggle", n2, { label: "FullScreen", description: "Toggle showing the workbook using the full screen.", shortcut: { key: "F11" } }), new Na("showScriptEditor", n2, { label: "Scripts", scopedLabels: { scripts: "Script Editor…" }, description: "Show the script editor.", shortcut: [{ key: "F11", modifiers: [Ea.Alt] }] }), new Na("executeScript", n2, { label: "Run Script", description: "Run the selected or last executed script.", shortcut: { key: "F8" } }), new Na("executeSelectedScript", n2, { label: "Run Script", description: "Run the selected script.", shortcut: { key: "F8" } }), new Na("saveScripts", n2, { label: "Save Script", description: "Save the current scripts." }), new Na("maximumWorkbookToggle", n2, { label: "Maximize", description: "Toggle showing the workbook maximized.", shortcut: { key: "F10", modifiers: [Ea.Ctrl] } }), new Na("spellCheck", n2, { label: "Spell Check", description: "Check the workbook for spelling mistakes.", shortcut: { key: "F7" } }), new Na("calculateAll", n2, { label: "Calculate Now", description: "Recalculate all formulas.", shortcut: { key: "F9" } }), new Ba("closeWorkbook", n2, { label: "Close Workbook", description: "Close the workbook.", shortcut: { key: "W", modifiers: [Ea.Ctrl] } }), new Ba("newWorkbook", n2, { label: "New Workbook", description: "Create a new workbook in another tab." })], []), x2 = W(() => {
|
|
1765
1765
|
let e3 = null;
|
|
1766
|
-
return e3 =
|
|
1767
|
-
}, [
|
|
1766
|
+
return e3 = a2 ? a2.createChildGroup(n2, "workbook", false) : new Aa(n2, "workbook"), e3.addCommands(f2, true), e3;
|
|
1767
|
+
}, [a2, f2]), b2 = va(), y2 = I.useRef(null), k2 = wa(() => {
|
|
1768
1768
|
let e3, o3 = null;
|
|
1769
|
-
const
|
|
1770
|
-
if (
|
|
1771
|
-
const
|
|
1772
|
-
|
|
1769
|
+
const n3 = x2.getCommand("executeScript");
|
|
1770
|
+
if (n3.update({ disabled: false, context: { getScripts: () => t2.getScripts() } }), !n3) return;
|
|
1771
|
+
const a3 = x2.getCommand("showScriptEditor");
|
|
1772
|
+
a3.updateCallback(function(e4 = true) {
|
|
1773
1773
|
o3 ? o3.close() : g2?.();
|
|
1774
1774
|
});
|
|
1775
|
-
const
|
|
1776
|
-
if (!
|
|
1777
|
-
const
|
|
1778
|
-
let o4 = null,
|
|
1779
|
-
const
|
|
1775
|
+
const r3 = x2.getCommand("executeSelectedScript");
|
|
1776
|
+
if (!r3) return;
|
|
1777
|
+
const l3 = { saveSource: async (e4) => {
|
|
1778
|
+
let o4 = null, n4 = null;
|
|
1779
|
+
const a4 = t2.getScripts();
|
|
1780
1780
|
try {
|
|
1781
1781
|
if (e4) {
|
|
1782
|
-
|
|
1783
|
-
o4 = await
|
|
1782
|
+
n4 = await s2?.showBusy?.("Saving Scripts...");
|
|
1783
|
+
o4 = await a4.createModule({ source: e4 });
|
|
1784
1784
|
}
|
|
1785
|
-
|
|
1785
|
+
a4.addModule("scripts", o4, { replace: true }), n4?.();
|
|
1786
1786
|
} catch (e5) {
|
|
1787
|
-
|
|
1787
|
+
n4?.(), console.warn("Unable to compile", e5), s2?.showError?.(e5);
|
|
1788
1788
|
}
|
|
1789
1789
|
return o4;
|
|
1790
1790
|
}, addContainerListener: (e4) => (S2.current = e4, () => {
|
|
1791
1791
|
S2.current = null;
|
|
1792
1792
|
}), setSelectedFunction: (t3) => {
|
|
1793
1793
|
e3 = t3 ?? y2.current ?? null, Promise.resolve(e3).then((e4) => {
|
|
1794
|
-
|
|
1794
|
+
r3.update({ disabled: null === e4 });
|
|
1795
1795
|
});
|
|
1796
1796
|
}, quickInsertFunction: (e4) => {
|
|
1797
1797
|
const t3 = `=${e4.toUpperCase()}(`, o4 = { text: t3 + ")", editMode: true, initialSelection: { start: t3.length, end: t3.length + 0 } };
|
|
1798
1798
|
b2.setMode((e5) => "edit" === e5?.key ? { ...e5, args: { ...e5.args } } : { key: "edit", args: { stateAndCoords: null, start: o4 } });
|
|
1799
1799
|
}, getSelectedFunction: () => e3, setEditor: (e4) => {
|
|
1800
|
-
o3 = e4 ?? null,
|
|
1800
|
+
o3 = e4 ?? null, a3.update({ state: null !== o3 });
|
|
1801
1801
|
}, getEditor: () => o3, getRanges: (e4) => {
|
|
1802
1802
|
try {
|
|
1803
1803
|
return t2.getRanges(e4);
|
|
@@ -1805,8 +1805,8 @@ const si = (e2) => {
|
|
|
1805
1805
|
}
|
|
1806
1806
|
return null;
|
|
1807
1807
|
}, getScripts: () => t2.getScripts() };
|
|
1808
|
-
|
|
1809
|
-
}, [x2, t2, o2,
|
|
1808
|
+
r3.update({ context: l3 });
|
|
1809
|
+
}, [x2, t2, o2, s2]), S2 = I.useRef(null);
|
|
1810
1810
|
w(t2, { onBeforeSave: async () => {
|
|
1811
1811
|
await S2.current?.onBeforeSave();
|
|
1812
1812
|
}, onProtectionChange: () => {
|
|
@@ -1825,27 +1825,27 @@ const si = (e2) => {
|
|
|
1825
1825
|
}, onScriptsChange: (e3) => {
|
|
1826
1826
|
k2();
|
|
1827
1827
|
} });
|
|
1828
|
-
const { isFullscreenAvailable: C2, isFullscreenEnabled: T2, toggleFullscreen: D2 } =
|
|
1828
|
+
const { isFullscreenAvailable: C2, isFullscreenEnabled: T2, toggleFullscreen: D2 } = er({ target: { current: o2 ?? document.body } }), P2 = v();
|
|
1829
1829
|
V(() => {
|
|
1830
|
-
x2.getCommand("selectTheme").update({ state: () => t2.getTheme(), context: () => ({ theme: t2.getTheme(), themes: P2, darkMode:
|
|
1831
|
-
}, [t2?.getTheme(),
|
|
1830
|
+
x2.getCommand("selectTheme").update({ state: () => t2.getTheme(), context: () => ({ theme: t2.getTheme(), themes: P2, darkMode: r2 }) });
|
|
1831
|
+
}, [t2?.getTheme(), r2]);
|
|
1832
1832
|
const R2 = wa(async function(e3, o3) {
|
|
1833
|
-
let
|
|
1834
|
-
const
|
|
1833
|
+
let n3 = null;
|
|
1834
|
+
const a3 = t2.getScripts();
|
|
1835
1835
|
if (e3?.declaration || e3?.functionName) {
|
|
1836
1836
|
const t3 = e3.declaration ? e3.declaration.getName() : e3.functionName;
|
|
1837
|
-
(await
|
|
1837
|
+
(await a3.searchFunctions({ name: t3 })).length > 0 && (n3 = t3);
|
|
1838
1838
|
}
|
|
1839
|
-
if (
|
|
1840
|
-
await
|
|
1841
|
-
y2.current = Promise.resolve({ source: null, name:
|
|
1839
|
+
if (n3) try {
|
|
1840
|
+
await a3.executeMacro(n3);
|
|
1841
|
+
y2.current = Promise.resolve({ source: null, name: n3 });
|
|
1842
1842
|
} catch (e4) {
|
|
1843
|
-
return void
|
|
1843
|
+
return void s2?.showError?.(e4);
|
|
1844
1844
|
}
|
|
1845
|
-
}, [t2,
|
|
1845
|
+
}, [t2, s2]);
|
|
1846
1846
|
V(() => {
|
|
1847
1847
|
x2.getCommand("newCellStyle").updateCallback((e3) => {
|
|
1848
|
-
|
|
1848
|
+
s2?.showInputOptions?.({ initialValue: (() => {
|
|
1849
1849
|
let e4 = 0;
|
|
1850
1850
|
for (; ; ) {
|
|
1851
1851
|
e4++;
|
|
@@ -1897,29 +1897,29 @@ const si = (e2) => {
|
|
|
1897
1897
|
}), x2.getCommand("calculateAll").updateCallback(() => {
|
|
1898
1898
|
t2.getSelectedSheet().getEntireRange().calculate(true);
|
|
1899
1899
|
}), x2.getCommand("closeWorkbook").updateCallback(async () => {
|
|
1900
|
-
"Close" === await
|
|
1900
|
+
"Close" === await s2?.showOptions({ title: "Confirm", description: "This will close the current workbook tab. Do you want to continue?", options: ["Close", "Cancel"], defaultOption: "Close" }) && window.close();
|
|
1901
1901
|
}), x2.getCommand("newWorkbook").updateCallback(() => {
|
|
1902
1902
|
h2?.();
|
|
1903
1903
|
}), x2.getCommand("executeScript").updateCallback(R2), x2.getCommand("executeSelectedScript").updateCallback(R2);
|
|
1904
|
-
}, [t2,
|
|
1904
|
+
}, [t2, s2]);
|
|
1905
1905
|
const M2 = wa(async (e3) => {
|
|
1906
|
-
let o3 = 0,
|
|
1907
|
-
e3?.replace && !e3?.replaceOptions?.maxCount && (
|
|
1908
|
-
const
|
|
1906
|
+
let o3 = 0, n3 = null, a3 = "Find & Replace";
|
|
1907
|
+
e3?.replace && !e3?.replaceOptions?.maxCount && (a3 = "Replace All");
|
|
1908
|
+
const r3 = await s2?.showBusy?.(a3);
|
|
1909
1909
|
try {
|
|
1910
|
-
const
|
|
1911
|
-
let
|
|
1912
|
-
const
|
|
1913
|
-
if (
|
|
1914
|
-
const
|
|
1915
|
-
o3 =
|
|
1910
|
+
const a4 = e3?.scope ?? "sheet";
|
|
1911
|
+
let l3 = null;
|
|
1912
|
+
const i3 = t2.getSelectedSheet(), d3 = { from: i3.getSelectedCell(), ...e3.findOptions };
|
|
1913
|
+
if (l3 = "sheet" === a4 ? t2.getSelectedSheet().find(e3.findText, d3) : t2.find(e3.findText, d3), e3.replace) {
|
|
1914
|
+
const a5 = t2.replace(l3, e3.replaceText, e3.replaceOptions);
|
|
1915
|
+
o3 = a5.count, e3.replaceOptions.maxCount && (n3 = a5.last);
|
|
1916
1916
|
} else {
|
|
1917
|
-
let e4 =
|
|
1918
|
-
e4.done || (o3++,
|
|
1917
|
+
let e4 = l3.next();
|
|
1918
|
+
e4.done || (o3++, n3 = e4.value);
|
|
1919
1919
|
}
|
|
1920
|
-
|
|
1920
|
+
n3?.select({ autoFocus: false }), r3?.(), !e3.replaceOptions.maxCount && o3 > 1 && s2?.showMessage?.(`We replaced ${o3} cells.`);
|
|
1921
1921
|
} catch (e4) {
|
|
1922
|
-
|
|
1922
|
+
r3?.(), s2?.showError?.(e4);
|
|
1923
1923
|
}
|
|
1924
1924
|
return o3;
|
|
1925
1925
|
}, [t2, o2]), F2 = wa((e3) => {
|
|
@@ -1934,38 +1934,38 @@ const si = (e2) => {
|
|
|
1934
1934
|
try {
|
|
1935
1935
|
await e4.select();
|
|
1936
1936
|
} catch (e5) {
|
|
1937
|
-
|
|
1937
|
+
s2?.showMessage?.(e5.message, { type: Pa.Error });
|
|
1938
1938
|
}
|
|
1939
1939
|
} };
|
|
1940
|
-
return
|
|
1941
|
-
}, [
|
|
1940
|
+
return s2.showWindow?.("namedDetails", o3);
|
|
1941
|
+
}, [s2, t2, o2]);
|
|
1942
1942
|
return V(() => {
|
|
1943
1943
|
const e3 = (e4 = false) => {
|
|
1944
|
-
const o3 = t2.getSelectedCell(),
|
|
1944
|
+
const o3 = t2.getSelectedCell(), n3 = { onFindOrReplace: M2, onKeyDown: (e5) => {
|
|
1945
1945
|
x2.findCommandByEvent(e5) !== x2.getCommand("find") && x2.findCommandByEvent(e5) !== x2.getCommand("findReplace") || e5.preventDefault();
|
|
1946
1946
|
}, findOptions: {}, findText: o3.toTextUnformatted(true) };
|
|
1947
|
-
|
|
1947
|
+
n3.replace = e4, s2.showWindow?.("find", n3, { disableAutoDestroy: true });
|
|
1948
1948
|
};
|
|
1949
|
-
x2.getCommand("find")?.update({ disabled: !
|
|
1949
|
+
x2.getCommand("find")?.update({ disabled: !s2?.showWindow }).updateCallback(() => {
|
|
1950
1950
|
e3();
|
|
1951
|
-
}), x2.getCommand("findReplace")?.update({ disabled: !
|
|
1951
|
+
}), x2.getCommand("findReplace")?.update({ disabled: !s2?.showWindow }).updateCallback(() => {
|
|
1952
1952
|
e3(true);
|
|
1953
|
-
}), x2.getCommand("goto")?.update({ disabled: !
|
|
1953
|
+
}), x2.getCommand("goto")?.update({ disabled: !s2 }).updateCallback(() => {
|
|
1954
1954
|
const e4 = { onInputOption: async (e5) => {
|
|
1955
1955
|
try {
|
|
1956
1956
|
await t2.getRanges(e5).select();
|
|
1957
1957
|
} catch (e6) {
|
|
1958
|
-
|
|
1958
|
+
s2?.showMessage?.(e6.message, { type: Pa.Error });
|
|
1959
1959
|
}
|
|
1960
1960
|
}, onKeyDown: (e5) => {
|
|
1961
1961
|
x2.findCommandByEvent(e5) === x2.getCommand("goto") && e5.preventDefault();
|
|
1962
1962
|
}, title: x2.getCommand("goto")?.label(), inputLabel: "Location", options: ["Go To"] };
|
|
1963
|
-
|
|
1964
|
-
}), x2.getCommand("selectNamed")?.update({ disabled: !
|
|
1963
|
+
s2?.showInputOptions?.(e4);
|
|
1964
|
+
}), x2.getCommand("selectNamed")?.update({ disabled: !s2 }).updateCallback(async (e4) => {
|
|
1965
1965
|
if (e4) try {
|
|
1966
1966
|
await e4.select();
|
|
1967
1967
|
} catch (e5) {
|
|
1968
|
-
|
|
1968
|
+
s2?.showError?.(e5);
|
|
1969
1969
|
}
|
|
1970
1970
|
}), x2.getCommand("addNamedReference")?.updateCallback(async function(e4) {
|
|
1971
1971
|
F2(null);
|
|
@@ -1976,7 +1976,7 @@ const si = (e2) => {
|
|
|
1976
1976
|
}), x2.getCommand("activeNameBox")?.updateCallback(async function() {
|
|
1977
1977
|
o2?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus();
|
|
1978
1978
|
});
|
|
1979
|
-
}, [o2, t2,
|
|
1979
|
+
}, [o2, t2, s2]), w(t2?.getView(), { onViewChange: (e3) => {
|
|
1980
1980
|
x2.getCommand("workbookViewToggleShowFormulaBar").update({ state: e3.isShowFormulaBar() }).updateCallback(() => {
|
|
1981
1981
|
e3.setShowFormulaBar(!e3.isShowFormulaBar());
|
|
1982
1982
|
}), x2.getCommand("workbookViewToggleShowTabs").update({ state: e3.isShowTabs() }).updateCallback(() => {
|
|
@@ -1996,71 +1996,71 @@ const si = (e2) => {
|
|
|
1996
1996
|
const e3 = t2.getProtection().isStructureAllowed();
|
|
1997
1997
|
x2.getCommand("hideSheet").update({ disabled: m2.length <= 1 || !e3 }), x2.getCommand("deleteSheet").update({ disabled: m2.length <= 1 || !e3 });
|
|
1998
1998
|
}, [m2, d2]), x2;
|
|
1999
|
-
},
|
|
1999
|
+
}, pi = () => {
|
|
2000
2000
|
window.open(window.origin.toString(), "sheetxl-" + n.uuidV4(), "popup=true");
|
|
2001
|
-
},
|
|
2002
|
-
const { workbook: o2, commands: n2, onBeforeUserChange: a2, onUserChange: r2, disabled: l2 = false, readOnly: i2 = false, contextMenuProps: s2, renderContextMenu: d2 =
|
|
2001
|
+
}, ui = "_sheetxl-theme_4opcr_2", gi = "_sheetxl-workbook_g5t6x_5", hi = (e2) => N(Il, { ...e2 }), fi = (e2) => N(Ll, { ...e2 }), xi = (e2) => N(Al, { ...e2 }), bi = L(H((e2, t2) => {
|
|
2002
|
+
const { workbook: o2, commands: n2, onBeforeUserChange: a2, onUserChange: r2, disabled: l2 = false, readOnly: i2 = false, contextMenuProps: s2, renderContextMenu: d2 = hi, sheetsAllProps: c2, renderSheetsAll: m2 = fi, sheetTabProps: p2, renderSheetTab: u2, background: g2 = "transparent", className: h2, sx: f2, borderWidth: x2, borderColor: b2, gridTheme: y2, gridStyle: k2, ...S2 } = e2, [C2, v2] = O(o2?.getSelectedSheetIndex()), [D2, P2] = O(o2?.getSheets().getItems()), [R2, M2] = O(o2?.getProtection());
|
|
2003
2003
|
w(o2, { onViewChange(e3) {
|
|
2004
|
-
|
|
2004
|
+
v2(e3?.getSelectedSheetIndex());
|
|
2005
2005
|
}, onSheetsChange: (e3) => {
|
|
2006
|
-
|
|
2006
|
+
P2(e3.getSheets().getItems());
|
|
2007
2007
|
}, onProtectionChange: (e3) => {
|
|
2008
|
-
|
|
2008
|
+
M2(e3?.getProtection());
|
|
2009
2009
|
} });
|
|
2010
|
-
const
|
|
2010
|
+
const F2 = i2 || !R2.isStructureAllowed(), B2 = W(() => {
|
|
2011
2011
|
const e3 = [];
|
|
2012
|
-
for (let t3 = 0; t3 <
|
|
2012
|
+
for (let t3 = 0; t3 < D2.length; t3++) e3.push(D2[t3].getName());
|
|
2013
2013
|
return e3;
|
|
2014
|
-
}, [
|
|
2014
|
+
}, [D2]), A2 = z((e3) => {
|
|
2015
2015
|
false !== a2?.(e3) && (o2.getSheetAt(e3).select(), r2?.(e3));
|
|
2016
|
-
}, [o2, a2, r2]),
|
|
2016
|
+
}, [o2, a2, r2]), I2 = z((e3, t3) => {
|
|
2017
2017
|
o2.getSheetAt(e3).setName(t3), r2?.(e3);
|
|
2018
|
-
}, [o2, r2]),
|
|
2018
|
+
}, [o2, r2]), L2 = z((e3, t3) => {
|
|
2019
2019
|
o2.getSheetAt(e3).setPosition(t3), r2?.(t3);
|
|
2020
|
-
}, [o2, r2]),
|
|
2021
|
-
if (false === a2?.(
|
|
2022
|
-
const e3 =
|
|
2020
|
+
}, [o2, r2]), H2 = wa(() => {
|
|
2021
|
+
if (false === a2?.(C2)) return;
|
|
2022
|
+
const e3 = C2 + 1;
|
|
2023
2023
|
o2.getSheets().add({ name: void 0, autoSelect: true }), r2?.(e3);
|
|
2024
|
-
}, [o2, a2, r2,
|
|
2024
|
+
}, [o2, a2, r2, C2]), $2 = W(() => ({ placement: "top-start" }), []), G2 = U(null), [j2, _2] = O(false), q2 = z((e3) => {
|
|
2025
2025
|
const { closeFloatAll: t3, floatReference: n3 } = e3;
|
|
2026
|
-
return m2({ workbook: o2, gridStyle:
|
|
2027
|
-
}, [m2, c2, l2, o2,
|
|
2026
|
+
return m2({ workbook: o2, gridStyle: k2, floatReference: n3, closeFloatAll: t3, ...c2 });
|
|
2027
|
+
}, [m2, c2, l2, o2, k2]), { reference: K2, component: Z2 } = Eo({ label: "allSheet", popperProps: $2, anchor: G2.current, onOpen: () => _2(true), onClose: () => _2(false), createPopupPanel: q2 }), Y2 = U(null), [Q2, ee2] = O(null), te2 = z((e3) => {
|
|
2028
2028
|
const { floatReference: t3 } = e3;
|
|
2029
|
-
return d2?.({ workbook: o2, index:
|
|
2030
|
-
}, [d2, s2, l2, o2, n2,
|
|
2029
|
+
return d2?.({ workbook: o2, index: Q2?.index, tabStripRef: Y2.current, commands: n2, disabled: l2, floatReference: t3, ...s2 });
|
|
2030
|
+
}, [d2, s2, l2, o2, n2, Q2]), { reference: oe2, component: ne2 } = Eo({ label: "sheetTab", popperProps: $2, anchor: { getBoundingClientRect: () => new DOMRect(Q2?.left || 0, Q2?.top || 0, 0, 0) }, onClose: () => ee2(null), createPopupPanel: te2 });
|
|
2031
2031
|
V(() => {
|
|
2032
|
-
|
|
2033
|
-
}, [
|
|
2034
|
-
const
|
|
2035
|
-
e3.preventDefault(),
|
|
2036
|
-
}, []),
|
|
2032
|
+
Q2 ? oe2.open(0) : oe2.close(0);
|
|
2033
|
+
}, [Q2]);
|
|
2034
|
+
const ae2 = z((e3, t3) => {
|
|
2035
|
+
e3.preventDefault(), ee2({ left: e3.clientX - 2, top: e3.clientY - 4, index: t3 });
|
|
2036
|
+
}, []), re2 = wa((e3) => {
|
|
2037
2037
|
let t3;
|
|
2038
2038
|
try {
|
|
2039
2039
|
t3 = o2?.getSheetAt(e3.index);
|
|
2040
2040
|
} catch (e4) {
|
|
2041
2041
|
}
|
|
2042
2042
|
if (!t3) return null;
|
|
2043
|
-
return (u2 ??
|
|
2044
|
-
|
|
2043
|
+
return (u2 ?? xi)({ sheet: t3, gridTheme: y2, onContextMenu: (t4) => {
|
|
2044
|
+
A2(e3.index), ae2(t4, e3.index);
|
|
2045
2045
|
}, ...e3, ...p2 });
|
|
2046
|
-
}, [u2, p2, o2,
|
|
2046
|
+
}, [u2, p2, o2, y2]), le2 = W(() => F2 ? null : N(Oe, { disableInteractive: true, title: "New sheet", children: N(J, { disabled: l2, component: "div", sx: { padding: "0", "&:hover:not([disabled])": { color: (e3) => e3.palette.primary.main }, color: (e3) => e3.palette.text.icon ?? e3.palette.action.active, "& svg": { width: "18px", height: "18px" } }, "aria-label": "addTab", size: "small", onMouseDown: (e3) => {
|
|
2047
2047
|
0 === e3.button && e3.preventDefault();
|
|
2048
|
-
}, onClick: () =>
|
|
2049
|
-
return E(X, { ref: t2, className: Yn(h2), sx: { position: "relative", display: "flex", alignItems: "stretch", flex: "1 1 100%", maxWidth: "100%", ...
|
|
2048
|
+
}, onClick: () => H2(), children: N(ha, {}) }) }), [l2, F2, H2]);
|
|
2049
|
+
return E(X, { ref: t2, className: Yn(h2), sx: { position: "relative", display: "flex", alignItems: "stretch", flex: "1 1 100%", maxWidth: "100%", ...f2 }, ...S2, children: [N(T, { ref: Y2, selectedTabIndex: C2, tabNames: B2, onSelectedTabIndexChange: A2, onTabNameChange: I2, onTabMove: L2, background: g2, borderColor: b2, borderWidth: x2, activeColor: null, disabled: l2, disableDrag: F2, createScrollStartButton: pn, createScrollEndButton: mn, createScrollEdgeButton: cn, createTabButton: re2, createTabDivider: (e3) => {
|
|
2050
2050
|
const { key: t3, ...o3 } = e3;
|
|
2051
|
-
return N(Se, { sx: { marginLeft: "-1px", marginRight: "0px", marginTop: "6px", marginBottom: "6px", background: (e4) =>
|
|
2052
|
-
}, editLabelProps: { readOnly:
|
|
2051
|
+
return N(Se, { sx: { marginLeft: "-1px", marginRight: "0px", marginTop: "6px", marginBottom: "6px", background: (e4) => Oa(e4.palette.divider, 0.25) }, ...o3 }, t3);
|
|
2052
|
+
}, editLabelProps: { readOnly: F2, maxLength: 31, styleHover: { fontWeight: "700" }, onKeyPress: (e3) => {
|
|
2053
2053
|
o2.isValidSheetNameCharacter(e3.key) || e3.preventDefault();
|
|
2054
2054
|
}, onCancel: () => {
|
|
2055
|
-
r2?.(
|
|
2056
|
-
}
|
|
2055
|
+
r2?.(C2);
|
|
2056
|
+
} }, children: N(Oe, { disableInteractive: true, title: j2 ? "" : "List all sheets", children: N(Ye, { sx: { padding: "0px", ml: 0.5, mr: 0, mt: 0, mb: 0, "& svg": { transform: "scale(0.8, 1)" }, color: (e3) => e3.palette.text.icon ?? e3.palette.action.active }, ref: G2, dense: true, outlined: false, selected: j2, color: "primary", "aria-label": "menu", onMouseDown: (e3) => {
|
|
2057
2057
|
0 === e3.button && e3.preventDefault();
|
|
2058
2058
|
}, onClick: () => {
|
|
2059
|
-
|
|
2060
|
-
}, icon: N(fa, {}) }) }) }), N("div", { style: { borderTop: `solid ${
|
|
2059
|
+
j2 ? K2.close(0) : K2.open(0);
|
|
2060
|
+
}, icon: N(fa, {}) }) }) }), N("div", { style: { borderTop: `solid ${b2} ${x2}px`, minWidth: "4px" } }), N("div", { style: { borderTop: `solid ${b2} ${x2}px`, flex: "none", display: "flex", alignItems: "center" }, children: le2 }), N("div", { style: { borderTop: `solid ${b2} ${x2}px`, flex: 1, minWidth: "24px" } }), ne2, Z2] });
|
|
2061
2061
|
}));
|
|
2062
|
-
|
|
2063
|
-
const
|
|
2062
|
+
bi.displayName = "WorkbookStrip";
|
|
2063
|
+
const yi = L(H((e2, t2) => {
|
|
2064
2064
|
const { workbook: o2, commands: n2, disabled: a2, sx: r2, floatReference: l2, className: i2, ...s2 } = e2, [d2, c2] = _((e3) => e3 + 1, 0), [m2, p2] = O(o2.getSelectedSheet()), [u2, g2] = O(m2.getSelectedRanges()), [h2, f2] = O(m2.getSelectedCell());
|
|
2065
2065
|
w(o2, { onSheetsChange() {
|
|
2066
2066
|
p2(o2.getSelectedSheet());
|
|
@@ -2090,13 +2090,13 @@ const fi = L(H((e2, t2) => {
|
|
|
2090
2090
|
P2 ? T2.push(j(uo, { ...k2, variant: ya.Menuitem, key: "contextBefore:" + T2.length, popupCommandKeys: ["convertTableToRange", "deleteTable"], popupScope: "table", scope: "context", commandState: P2, quickCommand: "editTable", icon: (e3) => {
|
|
2091
2091
|
e3.key();
|
|
2092
2092
|
return we(N(Ho, {}));
|
|
2093
|
-
} })) : T2.push(j(ke, { command: n2.getCommand("insertTable"), ...y2, icon: we(N(Ho, {})), key: "context:" + S2.length })), T2.push(j(
|
|
2093
|
+
} })) : T2.push(j(ke, { command: n2.getCommand("insertTable"), ...y2, icon: we(N(Ho, {})), key: "context:" + S2.length })), T2.push(j(xl, { ...k2, key: "contextBefore:" + T2.length }));
|
|
2094
2094
|
}
|
|
2095
|
-
const R2 = E(A, { children: [N(ke, { command: n2.getCommand("cut"), ...y2, icon: N(yn, {}) }), N(
|
|
2095
|
+
const R2 = E(A, { children: [N(ke, { command: n2.getCommand("cut"), ...y2, icon: N(yn, {}) }), N(bl, { command: n2.getCommand("copy"), ...y2 }), N(Zr, { command: n2.getCommand("paste"), ...k2, includePasteAllInPopup: false }), N(Se, { orientation: "horizontal" }), N(Vr, { ...k2 }), N(Se, { orientation: "horizontal" }), N(Wr, { commands: n2, ...k2, disableSheet: true }), N(zr, { commands: n2, ...k2, disableSheet: true }), N(Lr, { ...k2 }), T2, S2] });
|
|
2096
2096
|
return N(X, { ref: t2, className: Yn("menu", i2), sx: { ...r2 }, ...s2, children: R2 });
|
|
2097
2097
|
}));
|
|
2098
|
-
|
|
2099
|
-
const
|
|
2098
|
+
yi.displayName = "WorkbookContextMenu";
|
|
2099
|
+
const wi = L(H((e2, t2) => {
|
|
2100
2100
|
const { movable: o2, commands: n2, disabled: a2, sx: r2, floatReference: l2, ...i2 } = e2;
|
|
2101
2101
|
w(o2, { onAnyChange(e3) {
|
|
2102
2102
|
} });
|
|
@@ -2139,7 +2139,7 @@ const xi = L(H((e2, t2) => {
|
|
|
2139
2139
|
default:
|
|
2140
2140
|
return null;
|
|
2141
2141
|
}
|
|
2142
|
-
}, u2 = E(A, { children: [N(
|
|
2142
|
+
}, u2 = E(A, { children: [N(bl, { command: n2.getCommand("copy"), ...c2, variant: ya.Menuitem }), [], N(Se, { orientation: "horizontal" }), N(uo, { ...m2, popupCommandKeys: ["moveToFront", "moveForward"], quickCommand: "moveToFront", icon: p2 }), N(uo, { ...m2, popupCommandKeys: ["moveToBack", "moveBackward"], quickCommand: "moveToBack", icon: p2 }), N(Se, { orientation: "horizontal" }), N(ke, { ...c2, command: n2.getCommand("toggleLockAspectRatio"), icon: we(N(wn, {})) }), N(Se, { orientation: "horizontal" }), N(uo, { ...m2, popupCommandKeys: ["formatDrawAlignLeft", "formatDrawAlignCenter", "formatDrawAlignRight", null, "formatDrawAlignTop", "formatDrawAlignMiddle", "formatDrawAlignBottom", null, "formatDrawDistributeHorz", "formatDrawDistributeVert"], label: "Align", icon: (e3) => {
|
|
2143
2143
|
const t3 = p2(e3);
|
|
2144
2144
|
return t3 || we(N(kn, {}));
|
|
2145
2145
|
}, tooltip: "Quickly change the placement of your drawings." }), N(Se, { orientation: "horizontal" }), N(uo, { ...m2, popupCommandKeys: ["formatAnchorTypeTwoCell", "formatAnchorTypeOneCell", "formatAnchorTypeAbsolute"], label: "Sizing", icon: (e3) => {
|
|
@@ -2148,19 +2148,19 @@ const xi = L(H((e2, t2) => {
|
|
|
2148
2148
|
}, tooltip: "Determine how the drawing size will adjust as the cell sizes adjust." }), []] });
|
|
2149
2149
|
return N(X, { ref: t2, sx: { paddingTop: "4px", paddingBottom: "4px", ...r2 }, ...i2, children: u2 });
|
|
2150
2150
|
}));
|
|
2151
|
-
|
|
2152
|
-
const
|
|
2153
|
-
const { workbook: o2, createWorkbookOptions: a2, onNewWorkbook: r2, onElementLoad: l2,
|
|
2151
|
+
wi.displayName = "MovableContextMenu";
|
|
2152
|
+
const ki = (e2) => N(wi, { ...e2 }), Si = (e2) => N(yi, { ...e2 }), Ci = (e2) => N(Nl, { ...e2 }), vi = (e2, t2) => N(Bl, { ref: t2, ...e2 }), Ti = (e2) => N(Ve, { ...e2 }), Di = (e2, t2) => N(D, { ref: t2, ...e2 }), Pi = (e2) => N(Rl, { ...e2 }), Ri = (e2) => N(bi, { ...e2 }), Mi = { fireOnModelChange: false }, Fi = { flex: "1 1 100%", display: "flex" }, Bi = L(H((e2, t2) => {
|
|
2153
|
+
const { workbook: o2, createWorkbookOptions: a2, onNewWorkbook: r2, onElementLoad: l2, autoFocus: i2 = false, sx: s2, style: d2, className: c2, onFocus: m2, onBlur: p2, onKeyDown: u2, onRepeatCommandChange: g2, commands: x2, showFormulaBar: b2, formulaBarProps: y2, renderFormulaBar: k2 = vi, showTabs: S2, tabsProps: C2, renderTabs: T2 = Ri, showStatusBar: D2, statusBarProps: B2, renderStatusBar: L2 = Pi, toolbarProps: H2, renderToolbar: $2 = li, contextMenuSx: G2, renderContextMenu: j2 = Si, renderFilterMenu: q2 = Ci, renderMovableMenu: J2 = ki, renderLoadingPanel: Y2 = Ti, loadingPanelProps: Q2, sheetProps: ee2, renderSheet: te2 = Di, showHorizontalScrollbar: oe2, showVerticalScrollbar: ne2, gridTheme: ae2, headersTheme: re2, enableDarkImages: le2, ...ie2 } = e2, se2 = Da(), de2 = $a(), me2 = v(), pe2 = W(() => {
|
|
2154
2154
|
const e3 = { theme: me2.getDefaultTheme(), ...a2 };
|
|
2155
2155
|
return o2 ?? new h(e3);
|
|
2156
2156
|
}, [o2]), ue2 = U(null), [ge2, he2] = O(false), fe2 = U(null), xe2 = W(() => N(X, { className: "sheetxl-viewport", sx: { width: "100%", height: "100%", boxSizing: "border-box", position: "absolute", pointerEvents: "none !important", "& > :first-of-type": { position: "relative" } }, ref: fe2 }), []), [be2, ye2] = O(false), [we2, ke2] = O(false), Se2 = z(() => {
|
|
2157
2157
|
ye2(true);
|
|
2158
|
-
}, []), Ce2 = U(null), ve2 =
|
|
2158
|
+
}, []), Ce2 = U(null), ve2 = Ra(t2, () => ({ isWorkbookElement: () => true, getWorkbook: () => pe2, getSheetElement: () => ue2.current, getViewportElement: () => fe2.current, getFormulaBarElement: () => Ce2.current, focus() {
|
|
2159
2159
|
ue2 && ue2.current && ue2.current.focus();
|
|
2160
2160
|
} }), [pe2]), Te2 = U(null);
|
|
2161
2161
|
K(() => {
|
|
2162
2162
|
be2 && ve2.current && (ke2(true), Te2.current !== l2 && (l2?.({ source: ve2.current }), Te2.current = l2));
|
|
2163
|
-
}, [be2, ve2.current]),
|
|
2163
|
+
}, [be2, ve2.current]), $l(ve2.current);
|
|
2164
2164
|
const De2 = z((e3) => (ue2.current?.submitEdit(), true), []), Pe2 = z(() => {
|
|
2165
2165
|
requestAnimationFrame(() => {
|
|
2166
2166
|
ue2?.current?.focus();
|
|
@@ -2176,33 +2176,33 @@ const bi = (e2) => N(xi, { ...e2 }), yi = (e2) => N(fi, { ...e2 }), wi = (e2) =>
|
|
|
2176
2176
|
ue2.current.getSheet() !== t3 ? ue2.current.getGridElement()?.onViewChangeOnce(() => {
|
|
2177
2177
|
ue2.current.getSheet() !== t3 && e4(false), e4(true);
|
|
2178
2178
|
}) : e4(true);
|
|
2179
|
-
}) },
|
|
2179
|
+
}) }, Mi);
|
|
2180
2180
|
const [Ne2, Ee2] = _((e3) => e3 + 1, 0), Ae2 = pe2?.getView();
|
|
2181
2181
|
w(Ae2, { onViewChange: (e3) => {
|
|
2182
2182
|
Ee2();
|
|
2183
2183
|
} });
|
|
2184
|
-
const Ie2 =
|
|
2184
|
+
const Ie2 = ae2 ?? de2, Le2 = W(() => Gl(de2, Ie2), [de2, Ie2]), He2 = re2 ?? de2, We2 = W(() => Gl(de2, He2), [de2, He2]), [ze2, $e2] = O(null);
|
|
2185
2185
|
z(() => {
|
|
2186
2186
|
ue2.current.focus();
|
|
2187
2187
|
}, []);
|
|
2188
|
-
const [Ge2, Ue2] = O(false), je2 = U(null), _e2 =
|
|
2188
|
+
const [Ge2, Ue2] = O(false), je2 = U(null), _e2 = mi({ workbook: pe2, workbookElement: ve2.current, target: () => ue2.current, commands: x2, darkMode: Le2.body.darkMode, onNewWorkbook: r2, onShowSidebar: () => {
|
|
2189
2189
|
Ge2 ? je2.current?.focus() : Ue2(true);
|
|
2190
|
-
} }), qe2 = U(null), [Ke2, Xe2] = O(false), [Ze2, Je2] = O(null), [Ye2, Qe2] = O(
|
|
2190
|
+
} }), qe2 = U(null), [Ke2, Xe2] = O(false), [Ze2, Je2] = O(null), [Ye2, Qe2] = O(Ia.Top), [et2, tt2] = O(f.EmptyBounds), ot2 = z(() => {
|
|
2191
2191
|
Xe2(false), Je2(null);
|
|
2192
|
-
}, []), nt2 = z((e3, t3, o3 =
|
|
2192
|
+
}, []), nt2 = z((e3, t3, o3 = Ia.Top) => {
|
|
2193
2193
|
tt2(e3), Qe2(o3), Je2(t3), null !== qe2.current && setTimeout(() => {
|
|
2194
2194
|
null !== qe2.current && qe2.current.update();
|
|
2195
2195
|
}, 160), Xe2(true);
|
|
2196
|
-
}, []), [at2, rt2] = O("sheet"), lt2 =
|
|
2196
|
+
}, []), [at2, rt2] = O("sheet"), lt2 = S2 ?? Ae2?.isShowTabs(), it2 = oe2 ?? Ae2?.isShowHorizontalScrollbar(), st2 = b2 ?? Ae2?.isShowFormulaBar(), dt2 = D2 ?? Ae2?.isShowStatusBar(), ct2 = ne2 ?? Ae2?.isShowVerticalScrollbar(), mt2 = Le2?.header?.edgeStrokeFill || "rgb(171,171,171)", pt2 = W(() => dt2 ? L2({ sheet: Re2, gridStyle: Le2, ...B2 }) : null, [L2, B2, dt2, Le2, Re2]), ut2 = W(() => $2({ commands: _e2, workbook: ve2.current, ...H2 }), [_e2, $2, H2, de2]), [gt2, { width: ht2 }] = Ya(), ft2 = 0 === ht2 || ht2 > 560, xt2 = W(() => {
|
|
2197
2197
|
if (!lt2) return null;
|
|
2198
|
-
let e3 =
|
|
2198
|
+
let e3 = T2({ background: Le2.body.fill, borderWidth: 1, borderColor: mt2, gridTheme: Ie2, gridStyle: Le2, onBeforeUserChange: De2, onUserChange: Pe2, workbook: pe2, commands: _e2, sheetTabProps: {}, ...C2 });
|
|
2199
2199
|
return ft2 || (e3 = N("div", { style: { flex: "none", display: "flex" }, children: e3 })), e3;
|
|
2200
|
-
}, [
|
|
2200
|
+
}, [T2, C2, se2, de2, pe2, Ie2, ft2, _e2, lt2]), bt2 = z((e3) => {
|
|
2201
2201
|
const t3 = n.getOS() === n.OSType.Firefox;
|
|
2202
2202
|
let o3 = null, a3 = null, r3 = null;
|
|
2203
2203
|
if (it2 && (a3 = N("div", { style: { display: "flex", flex: "1 1 100%", borderTop: `solid ${mt2} 1px`, maxWidth: "100%" }, children: N(P, { style: { alignItems: "center", borderTop: (t3 ? 6 : 3) + "px solid transparent", borderBottom: (ft2 ? 6 : 3) + "px solid transparent", borderLeft: (t3 ? 3 : 0) + "px solid transparent", borderRight: (t3 ? 3 : 0) + "px solid transparent" }, ...e3, endGap: 700, sheet: Re2, showCustomScrollButtons: !t3, onShowTooltip: (e4) => {
|
|
2204
2204
|
nt2({ x: e4.anchor.x, y: e4.anchor.y, width: 0, height: 0 }, e4.display, e4.placement);
|
|
2205
|
-
}, onCloseTooltip: () => ot2() }) })), lt2 && ft2 && (r3 = xt2), lt2 && ft2 && !it2 && (r3 = E(X, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: [r3, N(X, { sx: { borderTop: `solid ${mt2} 1px`, flex: "1" } })] })), r3 && it2) o3 = N(
|
|
2205
|
+
}, onCloseTooltip: () => ot2() }) })), lt2 && ft2 && (r3 = xt2), lt2 && ft2 && !it2 && (r3 = E(X, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: [r3, N(X, { sx: { borderTop: `solid ${mt2} 1px`, flex: "1" } })] })), r3 && it2) o3 = N(Ma, { position: pe2.getView().getTabRatio() / 10 + "%", onPositionChange: ({ percent: e4 }) => {
|
|
2206
2206
|
pe2.getView().setTabRatio(Math.round(10 * e4));
|
|
2207
2207
|
}, 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='${de2.palette.text.icon ?? de2.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 ${mt2} 1px`, borderBottom: "solid 3px transparent" } }, elementBefore: r3, elementAfter: a3 });
|
|
2208
2208
|
else if (it2) o3 = a3;
|
|
@@ -2219,23 +2219,23 @@ const bi = (e2) => N(xi, { ...e2 }), yi = (e2) => N(fi, { ...e2 }), wi = (e2) =>
|
|
|
2219
2219
|
if (e3?.isDefaultPrevented()) return true;
|
|
2220
2220
|
e3.preventDefault(), yt2 && yt2.anchor === e3.currentTarget ? wt2(null) : wt2({ anchor: e3.currentTarget, popperProps: { offsets: [-4, 2] }, createPopupPanel: (e4) => {
|
|
2221
2221
|
const { floatReference: o3 } = e4;
|
|
2222
|
-
return
|
|
2222
|
+
return q2({ filter: t3, commands: _e2, floatReference: o3, sx: { ...G2 } });
|
|
2223
2223
|
} });
|
|
2224
|
-
}, [
|
|
2224
|
+
}, [q2, G2, _e2, pe2, yt2]), Tt2 = wa((e3) => {
|
|
2225
2225
|
if (e3.originalEvent?.isDefaultPrevented()) return true;
|
|
2226
2226
|
e3.originalEvent?.preventDefault(), wt2({ clientX: e3.clientX, clientY: e3.clientY, createPopupPanel: (e4) => {
|
|
2227
2227
|
const { floatReference: t3 } = e4;
|
|
2228
|
-
return
|
|
2228
|
+
return j2({ commands: _e2, workbook: pe2, floatReference: t3, sx: { ...G2 } });
|
|
2229
2229
|
} });
|
|
2230
|
-
}, [
|
|
2230
|
+
}, [j2, G2, _e2, pe2]), Dt2 = wa((e3, t3) => {
|
|
2231
2231
|
if (e3?.isDefaultPrevented()) return true;
|
|
2232
2232
|
e3.preventDefault(), wt2({ clientX: e3.clientX, clientY: e3.clientY, createPopupPanel: (e4) => {
|
|
2233
2233
|
const { floatReference: o3 } = e4;
|
|
2234
|
-
return
|
|
2234
|
+
return J2({ movable: t3, commands: _e2, floatReference: o3, sx: { ...G2 } });
|
|
2235
2235
|
} });
|
|
2236
|
-
}, [
|
|
2236
|
+
}, [J2, G2, _e2]);
|
|
2237
2237
|
W(() => {
|
|
2238
|
-
const e3 = [new
|
|
2238
|
+
const e3 = [new Ba("openContextMenu", () => ue2.current, { label: "Context Menu", description: "Open the context menu.", shortcut: [{ key: "F10", modifiers: [Ea.Shift] }, { key: "ContextMenu" }] })];
|
|
2239
2239
|
_e2.addCommands(e3, true);
|
|
2240
2240
|
}, [_e2]), V(() => {
|
|
2241
2241
|
_e2.getCommand("openContextMenu").updateCallback(() => {
|
|
@@ -2251,7 +2251,7 @@ const bi = (e2) => N(xi, { ...e2 }), yi = (e2) => N(fi, { ...e2 }), wi = (e2) =>
|
|
|
2251
2251
|
const Pt2 = wa((e3) => {
|
|
2252
2252
|
_e2?.dispatchToFocusedCommand(e3);
|
|
2253
2253
|
}, [_e2]), Rt2 = wa(() => {
|
|
2254
|
-
|
|
2254
|
+
$l(ve2.current);
|
|
2255
2255
|
}, [pe2, ve2.current]), Mt2 = z(() => {
|
|
2256
2256
|
rt2("sheet");
|
|
2257
2257
|
}, []), Ft2 = z(() => {
|
|
@@ -2259,11 +2259,11 @@ const bi = (e2) => N(xi, { ...e2 }), yi = (e2) => N(fi, { ...e2 }), wi = (e2) =>
|
|
|
2259
2259
|
}, []), Bt2 = wa((e3) => {
|
|
2260
2260
|
const t3 = n.getOS() === n.OSType.Firefox;
|
|
2261
2261
|
return N(P, { style: { borderLeft: "3px solid transparent", borderRight: "0px solid transparent", borderTop: (t3 ? 3 : 0) + "px solid transparent", borderBottom: (t3 ? 3 : 0) + "px solid transparent", width: t3 ? "13px" : void 0 }, ...e3, sheet: Re2, endGap: 700, showCustomScrollButtons: !t3, onShowTooltip: (e4) => {
|
|
2262
|
-
nt2(e4.anchor, e4.display,
|
|
2262
|
+
nt2(e4.anchor, e4.display, Ia.Left);
|
|
2263
2263
|
}, onCloseTooltip: () => ot2() });
|
|
2264
2264
|
}, [Re2]);
|
|
2265
2265
|
V(() => {
|
|
2266
|
-
|
|
2266
|
+
i2 && ue2 && ue2.current && ue2.current.focus();
|
|
2267
2267
|
}, []);
|
|
2268
2268
|
const [Nt2, Et2] = I.useState(null), At2 = z((e3) => {
|
|
2269
2269
|
_e2?.getCommand("openWorkbook") && ("dragenter" === e3.type || "dragover" === e3.type ? e3.dataTransfer?.types.includes("Files") ? e3.dataTransfer.files[0]?.type?.startsWith("image/") || e3.dataTransfer.items[0]?.type?.startsWith("image/") || 1 === e3.dataTransfer.types.length && Et2("Drop to open") : (e3.dataTransfer?.types.includes("text/html") || e3.dataTransfer?.types.includes("text/plain"), e3.dataTransfer.effectAllowed = "none", e3.dataTransfer.dropEffect = "none") : "dragleave" === e3.type && Et2(null), e3.preventDefault());
|
|
@@ -2279,7 +2279,7 @@ const bi = (e2) => N(xi, { ...e2 }), yi = (e2) => N(fi, { ...e2 }), wi = (e2) =>
|
|
|
2279
2279
|
_e2?.getCommand("insertImageFromFile")?.execute({ file: t3, options: { bounds: { x: a3.x, y: a3.y } }, goto: { range: { ...r3 } } });
|
|
2280
2280
|
} else _e2?.getCommand("openWorkbook")?.execute(t3);
|
|
2281
2281
|
}
|
|
2282
|
-
}, [_e2, Nt2]), Lt2 = W(() => Nt2 ? N(X, { sx: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", pointerEvents: "none", display: "flex", justifyContent: "center", alignItems: "center", background: (e3) => e3.palette.divider, color: (e3) => e3.palette.primary.dark }, children: N(Z, { variant: "h4", children: Nt2 }) }) : null, [Nt2]), Ht2 = U(null), Wt2 = W(() => N(
|
|
2282
|
+
}, [_e2, Nt2]), Lt2 = W(() => Nt2 ? N(X, { sx: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", pointerEvents: "none", display: "flex", justifyContent: "center", alignItems: "center", background: (e3) => e3.palette.divider, color: (e3) => e3.palette.primary.dark }, children: N(Z, { variant: "h4", children: Nt2 }) }) : null, [Nt2]), Ht2 = U(null), Wt2 = W(() => N(Qa, { in: !we2, nodeRef: Ht2, timeout: 500, classNames: "animating", unmountOnExit: true, children: N(X, { style: { display: "flex", alignItems: "center", justifyContent: "center", left: "0px", top: "0px", width: "100%", height: "100%", pointerEvents: we2 ? "none" : s2?.pointerEvents, position: "absolute", boxSizing: "border-box" }, children: Y2({ ref: Ht2, transitionDelay: "0", transparentBackground: false, sx: { opacity: we2 ? 0 : s2?.opacity, pointerEvents: we2 ? "none" : s2?.pointerEvents, position: "absolute", left: "0px", top: "0px", width: "100%", height: "100%", ...Q2 } }) }) }), [we2, Y2, Q2]), zt2 = W(() => k2({ sx: { marginTop: (e3) => e3.spacing(0.25), marginLeft: (e3) => e3.spacing(1), marginRight: (e3) => e3.spacing(1) }, workbook: pe2, sheetElement: ue2.current, gridStyle: Le2, onFocus: Ft2, ...y2, NamedCollectionEditorProps: { restoreFocus: (e3) => ue2.current.focus(e3), ...y2?.NamedCollectionEditorProps, commandPopupButtonProps: { commands: _e2, ...y2?.NamedCollectionEditorProps?.commandPopupButtonProps } } }, Ce2), [k2, y2, pe2, Le2, _e2, we2]), $t2 = z((e3) => {
|
|
2283
2283
|
const { movable: t3, ...o3 } = e3, n2 = { movable: t3, onContextMenuCapture: (e4) => {
|
|
2284
2284
|
Dt2(e4, t3);
|
|
2285
2285
|
}, ...o3 }, a3 = t3.getContent().getType();
|
|
@@ -2294,39 +2294,39 @@ const bi = (e2) => N(xi, { ...e2 }), yi = (e2) => N(fi, { ...e2 }), wi = (e2) =>
|
|
|
2294
2294
|
r3 = N(F, { ...e4 });
|
|
2295
2295
|
}
|
|
2296
2296
|
return N("div", { style: { position: "absolute", clipPath: "inset(0px)", display: "flex", alignItems: "stretch", justifyContent: "stretch", pointerEvents: "all" }, children: r3 }, t3.getUUID());
|
|
2297
|
-
}, []), Ot2 = W(() =>
|
|
2297
|
+
}, []), Ot2 = W(() => te2({ style: Fi, onFocus: Mt2, gridStyle: Le2, headersStyle: We2, sheet: Re2, commands: _e2, onSheetContextMenu: Tt2, onViewportChange: (e3) => {
|
|
2298
2298
|
$e2(e3);
|
|
2299
|
-
}, showScrollbars: false, viewportComponent: xe2, onRepeatCommandChange:
|
|
2300
|
-
nt2(e3.anchor, e3.display,
|
|
2299
|
+
}, showScrollbars: false, viewportComponent: xe2, onRepeatCommandChange: g2, onElementLoad: Se2, onShowColumnTooltip: (e3) => {
|
|
2300
|
+
nt2(e3.anchor, e3.display, Ia.Top);
|
|
2301
2301
|
}, onShowRowTooltip: (e3) => {
|
|
2302
|
-
nt2(e3.anchor, e3.display,
|
|
2302
|
+
nt2(e3.anchor, e3.display, Ia.Right);
|
|
2303
2303
|
}, onShowTooltip: (e3) => {
|
|
2304
2304
|
nt2({ x: e3.anchor.x, y: e3.anchor.y, width: 0, height: 0 }, e3.display, e3.placement);
|
|
2305
|
-
}, onCloseTooltip: () => ot2(), renderMovable: $t2, ...
|
|
2306
|
-
|
|
2307
|
-
}, ...
|
|
2305
|
+
}, onCloseTooltip: () => ot2(), renderMovable: $t2, ...ee2, cellRenderProps: { onFilterButtonMouseDown: (e3, t3) => {
|
|
2306
|
+
ee2?.cellRenderProps?.onFilterButtonMouseDown(e3, t3), vt2(e3, t3);
|
|
2307
|
+
}, ...ee2?.cellRenderProps } }, ue2), [te2, _e2, ee2, Re2, Le2, se2, g2]), Vt2 = W(() => {
|
|
2308
2308
|
if (!Ge2) return null;
|
|
2309
2309
|
const e3 = !Fe2.isStructureAllowed();
|
|
2310
|
-
return N(
|
|
2310
|
+
return N(ei, { sx: { marginBottom: (e4) => e4.spacing(0.5), border: (t3) => `solid ${e3 ? t3.palette.action.disabled : Oa(t3.palette.divider, 0.2)} 1px`, borderRadius: (e4) => `${e4.shape.borderRadius}px`, overflow: "hidden" }, onClose: () => {
|
|
2311
2311
|
Ue2(false), requestAnimationFrame(() => {
|
|
2312
2312
|
ue2.current.focus();
|
|
2313
2313
|
});
|
|
2314
2314
|
}, readOnly: e3, commands: _e2, ref: je2, scripts: pe2.getScripts() });
|
|
2315
|
-
}, [Ge2, _e2, pe2,
|
|
2316
|
-
const e3 = N(
|
|
2315
|
+
}, [Ge2, _e2, pe2, se2, Fe2]), Gt2 = W(() => {
|
|
2316
|
+
const e3 = N(La, { style: { ...Fi, marginRight: Vt2 && ft2 ? "0px" : "6px" }, viewport: ze2, touchElement: ue2.current?.getGridElement()?.stage, onScrollViewport: (e4) => {
|
|
2317
2317
|
ue2.current?.getGridElement()?.scrollTo(e4);
|
|
2318
2318
|
}, showHorizontalScrollbar: it2 || lt2, showVerticalScrollbar: ct2, createHorizontalScrollbar: bt2, createVerticalScrollbar: Bt2, children: Ot2 });
|
|
2319
2319
|
let t3 = e3;
|
|
2320
2320
|
ft2 || (t3 = E(A, { children: [e3, xt2] }));
|
|
2321
2321
|
let o3 = null, n2 = 4, a3 = 13;
|
|
2322
|
-
return ft2 ? o3 = "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" : (o3 = "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", n2 = 13, a3 = 4), N(
|
|
2323
|
-
}, [it2, lt2, bt2, ct2, ze2, Vt2, Ot2, xt2, de2, ft2]), Ut2 = W(() => N(Oe, { arrow: true, disableInteractive: true, open: Ke2, title: N(Z, { variant: "subtitle2", component: "div", children: Ze2 }), placement: Ye2, TransitionProps: { timeout: { exit: 0 } }, PopperProps: { popperRef: qe2, sx: { "& .MuiTooltip-tooltip": { padding: "2px 6px", "& .MuiTooltip-arrow": { display: Ke2 ? "visible" : "none" } } }, anchorEl: { getBoundingClientRect: () => new DOMRect(et2.x, et2.y, et2.width, et2.height) }, modifiers: [{ name: "offset", options: { offset: [0, 0] } }] }, children: N(X, {}) }), [Ke2, Ze2, Ye2, et2, qe2]), jt2 = W(() => ({ boxSizing: "border-box", background: (e3) => "dark" !== e3.palette.mode ? Le2.header.fill : e3.palette.background.paper, "& *": { ...An(de2), fontWeight: 400 }, "&.Mui-focusVisible": {}, "& .viewport-overlay": { borderRight: `solid ${mt2} 1px` }, ...
|
|
2324
|
-
return E(ce, { className: Yn("sheetxl-workbook",
|
|
2325
|
-
he2(true), Rt2(),
|
|
2322
|
+
return ft2 ? o3 = "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" : (o3 = "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", n2 = 13, a3 = 4), N(Ma, { fixedPane: "after", position: "40%", minAfter: ft2 ? "280px" : "120px", splitDirection: ft2 ? "row" : "column", style: Fi, ref: gt2, resizerProps: { className: "styled-resizer", style: { minWidth: ft2 ? "6px" : void 0, minHeight: ft2 ? void 0 : "6px", maskImage: `url("data:image/svg+xml,%3Csvg width='${n2}' height='${a3}' viewBox='0 0 ${n2} ${a3}' version='1.1' fill='${de2.palette.text.icon ?? de2.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${o3}' /%3E%3C/svg%3E%0A")`, maskRepeat: "no-repeat", maskPosition: ft2 ? "left center" : "top center" } }, elementBefore: t3, paneBeforeProps: { style: { flexDirection: "column" } }, elementAfter: Vt2, paneAfterProps: { style: { marginLeft: ft2 ? "0px" : "4px", marginRight: ft2 ? "8px" : "4px" } } });
|
|
2323
|
+
}, [it2, lt2, bt2, ct2, ze2, Vt2, Ot2, xt2, de2, ft2]), Ut2 = W(() => N(Oe, { arrow: true, disableInteractive: true, open: Ke2, title: N(Z, { variant: "subtitle2", component: "div", children: Ze2 }), placement: Ye2, TransitionProps: { timeout: { exit: 0 } }, PopperProps: { popperRef: qe2, sx: { "& .MuiTooltip-tooltip": { padding: "2px 6px", "& .MuiTooltip-arrow": { display: Ke2 ? "visible" : "none" } } }, anchorEl: { getBoundingClientRect: () => new DOMRect(et2.x, et2.y, et2.width, et2.height) }, modifiers: [{ name: "offset", options: { offset: [0, 0] } }] }, children: N(X, {}) }), [Ke2, Ze2, Ye2, et2, qe2]), jt2 = W(() => ({ boxSizing: "border-box", background: (e3) => "dark" !== e3.palette.mode ? Le2.header.fill : e3.palette.background.paper, "& *": { ...An(de2), fontWeight: 400 }, "&.Mui-focusVisible": {}, "& .viewport-overlay": { borderRight: `solid ${mt2} 1px` }, ...s2 }), [s2, Le2]), _t2 = W(() => N(X, { sx: { marginBottom: (e3) => e3.spacing(0.75) } }), []), qt2 = W(() => ({ flex: "1 1 100%", width: "100%", display: "flex", flexDirection: "column", opacity: we2 ? void 0 : 0, "--sxl-app-color-high-contrast": de2.palette.primary.main, "--sxl-app-color-primary": de2.palette.primary.main, "--sxl-app-color-primary-dark": de2.palette.primary.dark, "--sxl-app-color-primary-light": de2.palette.primary.light, "--sxl-app-color-info": de2.palette.info.main, "--sxl-app-color-info-dark": de2.palette.info.dark, "--sxl-app-color-info-light": de2.palette.info.light, "--sxl-app-color-secondary": de2.palette.secondary.main, "--sxl-app-color-secondary-dark": de2.palette.secondary.dark, "--sxl-app-color-secondary-light": de2.palette.secondary.light, "--sxl-app-color-success": de2.palette.success.main, "--sxl-app-color-success-dark": de2.palette.success.dark, "--sxl-app-color-success-light": de2.palette.success.light, "--sxl-app-color-warning": de2.palette.warning.main, "--sxl-app-color-warning-dark": de2.palette.warning.dark, "--sxl-app-color-warning-light": de2.palette.warning.light, "--sxl-app-color-error": de2.palette.error.main, "--sxl-app-color-error-dark": de2.palette.error.dark, "--sxl-app-color-error-light": de2.palette.error.light, "--sxl-app-color-text": de2.palette.text.primary, "--sxl-app-color-text-secondary": de2.palette.text.secondary, "--sxl-app-color-text-disabled": de2.palette.text.disabled, "--sxl-app-color-background": de2.palette.background.paper, "--sxl-app-color-button-surface": de2.palette.grey[600], "--sxl-app-color-shadow": de2.palette.action.focus, "--sxl-app-color-grey": de2.palette.grey[500], "--sxl-app-filter-dark-invert": Le2.body.darkMode && le2 ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", "--sxl-app-image-background": Le2.body.darkMode ? `linear-gradient(${Oa("#fff", Va(5))}, ${Oa("#fff", Va(5))})` : void 0 }), [Le2, de2, we2]), Kt2 = W(() => Yn(ol), []);
|
|
2324
|
+
return E(ce, { className: Yn("sheetxl-workbook", gi, { "Mui-focusVisible": ge2 }, ui, c2), sx: jt2, style: d2, square: false, ...ie2, ref: ve2, onFocus: (e3) => {
|
|
2325
|
+
he2(true), Rt2(), m2?.(e3);
|
|
2326
2326
|
}, onBlur: (e3) => {
|
|
2327
|
-
he2(false),
|
|
2327
|
+
he2(false), p2?.(e3);
|
|
2328
2328
|
}, onKeyDown: (e3) => {
|
|
2329
|
-
Pt2(e3),
|
|
2329
|
+
Pt2(e3), u2?.(e3);
|
|
2330
2330
|
}, onDragStart: (e3) => {
|
|
2331
2331
|
if (e3.target.src) {
|
|
2332
2332
|
const t3 = new Image();
|
|
@@ -2334,9 +2334,9 @@ const bi = (e2) => N(xi, { ...e2 }), yi = (e2) => N(fi, { ...e2 }), wi = (e2) =>
|
|
|
2334
2334
|
}
|
|
2335
2335
|
}, onDragEnter: At2, onDragLeave: At2, onDragOver: At2, onDrop: It2, children: [E("div", { className: Kt2, style: qt2, children: [ut2, st2 ? zt2 : null, _t2, Gt2, pt2, Ut2, Ct2, Lt2] }), Wt2] });
|
|
2336
2336
|
}));
|
|
2337
|
-
|
|
2338
|
-
const
|
|
2339
|
-
const { sx: o2, workbook: n2, title: a2 = "", placeHolder: r2 = "Untitled", onTitleChange: l2, readOnly: i2 = false, hidden: s2, ...d2 } = e2, [c2, m2] = O(false), [p2, u2] = O(false), [g2, h2] = O(a2 ?? ""), [f2, x2] = O(""), [b2, { width: y2 }] =
|
|
2337
|
+
Bi.displayName = "WorkbookElement";
|
|
2338
|
+
const Ni = (e2 = false, t2 = false) => t2 ? null : { "& input:not(:focus):not(:hover)": { color: (e3) => e3.palette.text.secondary }, backgroundColor: (e3) => Oa(e3.palette.background.paper, 0.6), borderRadius: (e3) => `${e3.shape.borderRadius}px`, border: (t3) => `solid ${e2 ? t3.palette.divider : "transparent"} 1px`, "&.Mui-disabled": { border: (t3) => `solid ${e2 ? t3.palette.divider : "transparent"} 1px` }, "&:focus-within:not([disabled])": { backgroundColor: (e3) => e3.palette.background.paper }, "&:hover:not([disabled])": { border: (t3) => `solid ${e2 ? t3.palette.text?.primary : t3.palette.divider} 1px`, backgroundColor: null }, "&.Mui-focusVisible": { outline: (e3) => `solid ${e3.palette.primary.main} 1px !important`, border: (e3) => `1px solid ${e3.palette?.primary?.main} !important` } }, Ei = L(H((e2, t2) => {
|
|
2339
|
+
const { sx: o2, workbook: n2, title: a2 = "", placeHolder: r2 = "Untitled", onTitleChange: l2, readOnly: i2 = false, hidden: s2, ...d2 } = e2, [c2, m2] = O(false), [p2, u2] = O(false), [g2, h2] = O(a2 ?? ""), [f2, x2] = O(""), [b2, { width: y2 }] = Ya(), [w2, { width: k2 }] = Ya(), [S2, C2] = O(false), v2 = U(null), T2 = U(null), D2 = Ra(t2, () => ({ requestWorkbookTitle: (e3 = null, t3) => {
|
|
2340
2340
|
T2.current = { onAccept: e3, requestReason: t3?.requestReason }, t3?.selectAll && v2.current?.select(), v2.current?.focus(t3);
|
|
2341
2341
|
}, focus: (e3) => {
|
|
2342
2342
|
v2.current?.focus(e3);
|
|
@@ -2344,38 +2344,38 @@ const Mi = (e2 = false, t2 = false) => t2 ? null : { "& input:not(:focus):not(:h
|
|
|
2344
2344
|
return K(() => {
|
|
2345
2345
|
C2(a2 !== g2), x2(a2), h2(a2);
|
|
2346
2346
|
}, [a2]), V(() => {
|
|
2347
|
-
S2 && 0 !== y2 &&
|
|
2347
|
+
S2 && 0 !== y2 && Ka.debounce(() => {
|
|
2348
2348
|
C2(false);
|
|
2349
2349
|
}, 300)();
|
|
2350
2350
|
}, [S2, y2]), V(() => {
|
|
2351
|
-
u2(g2 && !
|
|
2352
|
-
}, [g2]), s2 ? null : N(X, { sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", opacity: S2 ? "0" : "1", transition: S2 ? void 0 : "opacity .25s ease-in", "& .tooltip-wrapper": { maxWidth: "100%" } }, ref:
|
|
2351
|
+
u2(g2 && !tr.isValidWindowsFilename(g2));
|
|
2352
|
+
}, [g2]), s2 ? null : N(X, { sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", opacity: S2 ? "0" : "1", transition: S2 ? void 0 : "opacity .25s ease-in", "& .tooltip-wrapper": { maxWidth: "100%" } }, ref: qa([D2, w2, t2]), ...d2, children: N(Je, { label: T2.current?.requestReason ?? "Workbook Name", children: E(X, { className: Yn({ "Mui-focusVisible": c2 }), sx: { visibility: 0 === y2 ? "hidden" : "visible", display: "block", maxWidth: "100%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", paddingLeft: "12px", paddingRight: "12px", marginLeft: "2px", marginRight: "2px", paddingTop: "2px", paddingBottom: "1px", ...Ni(true, i2), ...o2 }, children: [i2 ? N(Z, { variant: "subtitle1", component: "div", sx: { whiteSpace: "nowrap", fontStyle: g2 !== f2 ? "italic" : void 0, userSelect: "none", textOverflow: "ellipsis", lineHeight: "1.4375em", border: "transparent 1px solid", color: (e3) => p2 ? e3.palette.error.dark : void 0 }, children: a2 ?? r2 }) : N(oe, { sx: { width: `${Math.min(y2 + 3, Math.max(k2, D2.current?.getBoundingClientRect()?.width))}px`, overflow: "hidden", whiteSpace: "nowrap", fontWeight: "600", maxWidth: "100%", border: "none", padding: "0px", margin: "0px", color: (e3) => p2 ? e3.palette.error.dark : void 0, fontStyle: g2 !== f2 ? "italic" : void 0, "& input": { paddingTop: "0px", paddingBottom: "0px", textOverflow: "ellipsis" } }, disableUnderline: true, fullWidth: false, multiline: false, readOnly: i2, spellCheck: false, placeholder: r2, onFocus: (e3) => {
|
|
2353
2353
|
m2(true), e3.target?.select();
|
|
2354
2354
|
}, inputProps: { name: "input-workbook-title", autoComplete: "off", ref: v2 }, onBlur: () => {
|
|
2355
2355
|
m2(false), p2 ? h2(f2) : (g2 !== f2 && (l2?.(g2), g2 && T2.current?.onAccept?.(g2, "blur")), T2.current = null);
|
|
2356
2356
|
}, onChange: (e3) => {
|
|
2357
|
-
if (e3.target.value.length >
|
|
2357
|
+
if (e3.target.value.length > tr.MAX_WORKBOOK_NAME_SIZE) return e3.stopPropagation(), void e3.preventDefault();
|
|
2358
2358
|
h2(e3.target.value);
|
|
2359
2359
|
}, onKeyDown: (e3) => {
|
|
2360
|
-
(
|
|
2360
|
+
(tr.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(e3.key) || e3.target?.value.length > tr.MAX_WORKBOOK_NAME_SIZE) && e3.preventDefault(), e3.which === Sa.Enter || e3.which === Sa.Tab ? (p2 ? h2(f2) : (l2?.(g2), g2 && (T2.current?.onAccept?.(g2, "keydown"), T2.current = null)), e3.stopPropagation(), e3.preventDefault(), n2?.focus()) : e3.which === Sa.Escape && (g2 === f2 ? n2?.focus() : (h2(f2), setTimeout(() => {
|
|
2361
2361
|
e3.target?.select();
|
|
2362
2362
|
}, 0)), T2.current = null, e3.stopPropagation(), e3.preventDefault());
|
|
2363
2363
|
}, value: g2 }), N(X, { ref: b2, sx: { position: "absolute", visibility: "hidden", top: "-9999px", fontWeight: "600 !important", whiteSpace: "pre", fontStyle: g2 !== f2 ? "italic" : void 0, fontFamily: (e3) => e3.typography.fontFamily, letterSpacing: "0.00938em" }, children: g2 || r2 })] }) }) });
|
|
2364
2364
|
}));
|
|
2365
|
-
|
|
2366
|
-
const
|
|
2365
|
+
Ei.displayName = "WorkbookTitle";
|
|
2366
|
+
const Ai = L(H((e2, t2) => {
|
|
2367
2367
|
const { sx: o2, style: n2, className: a2, licenseKey: r2, renderLoadingPanel: l2, ...i2 } = e2;
|
|
2368
2368
|
r2 && g.setLicenseKey(r2);
|
|
2369
2369
|
const s2 = W(() => {
|
|
2370
2370
|
const e3 = { transitionDelay: "160ms", transparentBackground: true };
|
|
2371
2371
|
return N(X, { sx: o2, style: { width: "100%", height: "100%", position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, children: l2?.(e3) ?? N(Ve, { ...e3 }) });
|
|
2372
|
-
}, [o2, n2, l2]), d2 = W(() => I.lazy(async () => await Promise.resolve().then(() =>
|
|
2372
|
+
}, [o2, n2, l2]), d2 = W(() => I.lazy(async () => await Promise.resolve().then(() => _i)), []);
|
|
2373
2373
|
return N(A, { children: N(G, { fallback: s2, children: N(d2, { ...i2, className: a2, renderLoadingPanel: l2, sx: o2, style: n2, ref: t2 }) }) });
|
|
2374
2374
|
}));
|
|
2375
|
-
|
|
2376
|
-
const
|
|
2377
|
-
class
|
|
2378
|
-
constructor(e2 =
|
|
2375
|
+
Ai.displayName = "Studio";
|
|
2376
|
+
const Ii = [{ key: "SheetXL", description: "SheetXL", mimeType: ".sxl", exts: ["sxl"], handler: null, isDefault: true }, { 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 }], Li = [{ key: "SheetXL", mimeType: "application/vnd.sheetxl.sheet", description: "SheetXL", ext: "sxl", handler: null, isDefault: true }, { 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 }];
|
|
2377
|
+
class Hi {
|
|
2378
|
+
constructor(e2 = Ii, t2 = Li) {
|
|
2379
2379
|
this._readFormatType = [], this._writeFormatType = [], this._readFormatType = Object.freeze([...e2]), this._writeFormatType = Object.freeze([...t2]);
|
|
2380
2380
|
}
|
|
2381
2381
|
getReadFormats() {
|
|
@@ -2406,9 +2406,9 @@ class Ai {
|
|
|
2406
2406
|
throw e3;
|
|
2407
2407
|
}
|
|
2408
2408
|
try {
|
|
2409
|
-
return await n2.WorkbookIO.read({ ...e2, async onStart(n3) {
|
|
2410
|
-
await e2?.onStart?.(n3), o2 = await t2?.showBusy?.(`Opening '${n3}'...`);
|
|
2411
|
-
} });
|
|
2409
|
+
return await n2.WorkbookIO.read({ ...e2, progress: { async onStart(n3) {
|
|
2410
|
+
await e2?.progress?.onStart?.(n3), o2 = await t2?.showBusy?.(`Opening '${n3}'...`);
|
|
2411
|
+
} } });
|
|
2412
2412
|
} catch (e3) {
|
|
2413
2413
|
throw a2?.(), o2?.(), e3;
|
|
2414
2414
|
} finally {
|
|
@@ -2416,21 +2416,21 @@ class Ai {
|
|
|
2416
2416
|
}
|
|
2417
2417
|
}
|
|
2418
2418
|
}
|
|
2419
|
-
const
|
|
2420
|
-
const { id: o2, message: n2, iconVariant: a2, error: r2, hideIconVariant: l2, ...i2 } = e2, { closeSnackbar: s2 } =
|
|
2419
|
+
const Wi = new Hi(), zi = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, $i = H((e2, t2) => {
|
|
2420
|
+
const { id: o2, message: n2, iconVariant: a2, error: r2, hideIconVariant: l2, ...i2 } = e2, { closeSnackbar: s2 } = nr(), d2 = $a(), [c2, m2] = O(false), p2 = z(() => {
|
|
2421
2421
|
m2((e3) => !e3);
|
|
2422
2422
|
}, []), u2 = z(() => {
|
|
2423
2423
|
s2(o2);
|
|
2424
2424
|
}, [o2, s2]);
|
|
2425
2425
|
let g2 = r2?.message;
|
|
2426
|
-
return !g2 && $(n2) && (g2 = n2), g2 || "string" != typeof n2 || (g2 = n2), g2 || (g2 = `Unknown Error: ${n2}`), N(
|
|
2426
|
+
return !g2 && $(n2) && (g2 = n2), g2 || "string" != typeof n2 || (g2 = n2), g2 || (g2 = `Unknown Error: ${n2}`), N(ar, { ref: t2, className: Yn(zi.root, "error-snackbar"), children: E(fe, { className: zi.card, style: { backgroundColor: d2.palette.error.dark, border: `1px solid ${d2.palette.error.dark}` }, children: [E(xe, { className: zi.actionRoot, children: [l2 ? null : a2?.error, N(Z, { variant: "body2", component: "div", className: zi.typography, children: g2 }), N("div", { style: { flex: "1 1 auto" } }), E("div", { className: zi.icons, children: [r2 ? N(J, { "aria-label": "Show more", size: "small", className: Yn(zi.expand, { [zi.expandOpen]: c2 }), onClick: p2, children: N(ca, {}) }) : null, N(J, { size: "small", className: zi.expand, onClick: u2, children: N(ga, { fontSize: "small" }) })] })] }), r2 ? N(be, { in: c2, timeout: "auto", unmountOnExit: true, children: N("div", { className: zi.stackTraceContainer, style: { backgroundColor: d2.palette.error.light, borderTop: `1px solid ${d2.palette.error.main}` }, children: N(In, { error: r2, hideLineNumbers: true }) }) }) : null] }) });
|
|
2427
2427
|
});
|
|
2428
|
-
|
|
2429
|
-
const
|
|
2428
|
+
$i.displayName = "ToastError";
|
|
2429
|
+
const Oi = L(H((e2, t2) => {
|
|
2430
2430
|
const { commands: o2, commandHook: n2, scope: a2 = "workbook", disabled: r2 = false, ...l2 } = e2, i2 = wa((e3) => {
|
|
2431
2431
|
const t3 = { variant: ya.Menuitem, parentFloat: e3.floatReference, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...t3, command: o2.getCommand("newWorkbook"), icon: we(N(Ln, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...t3, command: o2.getCommand("openWorkbook"), icon: we(N(Hn, {})) }), N(De, { ...t3, commands: o2, quickCommand: "saveWorkbook", icon: we(N($n, {})), createPopupPanel: (e4) => {
|
|
2432
2432
|
const n3 = { ...t3, parentFloat: e4.floatReference, scope: "saveWorkbook" }, a3 = [];
|
|
2433
|
-
return
|
|
2433
|
+
return Wi.getWriteFormats().forEach((e5) => {
|
|
2434
2434
|
if (e5.isDefault) return;
|
|
2435
2435
|
let t4 = null;
|
|
2436
2436
|
"CSV" === e5.key ? t4 = we(N(Wn, {})) : "Excel" === e5.key && (t4 = we(N(zn, {})));
|
|
@@ -2446,131 +2446,131 @@ const Wi = L(H((e2, t2) => {
|
|
|
2446
2446
|
}, [r2, o2, n2, a2]), s2 = "File";
|
|
2447
2447
|
return N(De, { commands: o2, disabled: r2, commandHook: n2, scope: a2, label: s2, tooltip: "Options for saving and loading the workbook.", sx: { paddingBottom: "0px", "& button": { paddingTop: "0px", paddingBottom: "0px", height: (e3) => `calc(1.25rem + ${e3.spacing(2)}px)` } }, ...l2, createPopupPanel: i2, icon: N(Ft, { className: "label", icon: null, label: s2 }) });
|
|
2448
2448
|
}));
|
|
2449
|
-
|
|
2450
|
-
const
|
|
2449
|
+
Oi.displayName = "StandaloneFileCommandButton";
|
|
2450
|
+
const Vi = N(Je, { label: "SheetXL", description: "Visit me at sheetxl.com.", children: N(X, { sx: { width: "24px", height: "24px", marginBottom: "4px", marginLeft: "6px" }, children: N(B, { onClick: () => {
|
|
2451
2451
|
window?.open("https://www.sheetxl.com", "_blank");
|
|
2452
|
-
}, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }),
|
|
2453
|
-
const { commands: o2, workbook: n2, logo: a2 =
|
|
2452
|
+
}, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), Gi = L(H((e2, t2) => {
|
|
2453
|
+
const { commands: o2, workbook: n2, logo: a2 = Vi, mainElement: r2, showFileMenu: l2 = true, showAppearanceMenu: i2 = true, ...s2 } = e2, { reference: d2 } = Eo(), [c2, { width: m2 }] = Ya(), p2 = m2 < 530, u2 = l2 ? N(Oi, { commands: o2, commandHook: { beforeExecute() {
|
|
2454
2454
|
d2?.closeAll();
|
|
2455
2455
|
}, onError(e3, t3, o3) {
|
|
2456
|
-
} } }) : null, g2 = i2 ? N(
|
|
2456
|
+
} } }) : null, g2 = i2 ? N(hl, { commands: o2, commandHook: { beforeExecute() {
|
|
2457
2457
|
d2?.closeAll();
|
|
2458
2458
|
}, onError(e3, t3, o3) {
|
|
2459
2459
|
} } }) : null, h2 = W(() => ({ paddingLeft: (e3) => e3.spacing(1), paddingRight: (e3) => e3.spacing(1) }), []), f2 = U(null);
|
|
2460
|
-
return N(X, { ref:
|
|
2460
|
+
return N(X, { ref: qa([f2, c2, t2]), ...s2, children: li({ commands: o2, renderCompact: p2, workbook: n2, selectWrapper: (e3) => E(X, { sx: { display: "flex", flex: "1", flexDirection: "row", alignItems: "stretch", gap: (e4) => e4.spacing(1), paddingLeft: (e4) => e4.spacing(1), paddingRight: (e4) => e4.spacing(1) }, children: [E(X, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (e4) => e4.spacing(0.5) }, children: [a2, E(X, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (e4) => e4.spacing(0.25) }, children: [u2, e3] })] }), N(X, { sx: { display: "flex", flexDirection: "row", flex: "1 1 300%", overflow: "hidden", alignItems: "center", justifyContent: "center" }, children: r2 }), N(X, { sx: { display: "flex", alignItems: "center", justifyContent: "end", flex: p2 && !g2 ? "0 0 auto" : "1 1 100%" }, children: g2 })] }), selectProps: h2, toolbarsProps: { Home: { sx: {} } } }) });
|
|
2461
2461
|
}));
|
|
2462
|
-
|
|
2463
|
-
const
|
|
2464
|
-
const { workbook: o2, setWorkbook: n2, refWorkbookTitle: a2, titleWorkbook: r2, setWorkbookTitle: l2, titlePlaceHolder: i2, children: s2, undoManager: d2, commands: c2, importExportDisabled: m2, themeOptions: p2 } = e2, u2 =
|
|
2462
|
+
Gi.displayName = "StudioToolbar";
|
|
2463
|
+
const Ui = L(H((e2, t2) => {
|
|
2464
|
+
const { workbook: o2, setWorkbook: n2, refWorkbookTitle: a2, titleWorkbook: r2, setWorkbookTitle: l2, titlePlaceHolder: i2, children: s2, undoManager: d2, commands: c2, importExportDisabled: m2, themeOptions: p2 } = e2, u2 = nr(), g2 = u2 ? u2.enqueueSnackbar : () => {
|
|
2465
2465
|
}, h2 = u2 ? u2.closeSnackbar : () => {
|
|
2466
2466
|
}, [f2, x2] = O({ isMounted: false, label: null, starting: /* @__PURE__ */ new Map(), running: /* @__PURE__ */ new Map() }), b2 = z(() => {
|
|
2467
2467
|
x2((e3) => ({ ...e3, isMounted: true }));
|
|
2468
2468
|
}, []), y2 = z(() => {
|
|
2469
2469
|
x2((e3) => ({ ...e3, isMounted: false }));
|
|
2470
2470
|
}, []), w2 = {}, k2 = Un(w2), S2 = jn(w2), C2 = _n(w2), v2 = U(/* @__PURE__ */ new Set()), T2 = W(() => {
|
|
2471
|
-
const e3 = (e4,
|
|
2472
|
-
if (
|
|
2473
|
-
if (v2.current.has(
|
|
2471
|
+
const e3 = (e4, t4) => {
|
|
2472
|
+
if (t4?.onceKey) {
|
|
2473
|
+
if (v2.current.has(t4.onceKey)) return;
|
|
2474
2474
|
const e5 = new Set(v2.current);
|
|
2475
|
-
e5.add(
|
|
2475
|
+
e5.add(t4.onceKey), v2.current = e5;
|
|
2476
2476
|
}
|
|
2477
|
-
const
|
|
2478
|
-
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
let o3 = null;
|
|
2477
|
+
const o4 = { variant: t4?.type ?? Pa.Info, anchorOrigin: { vertical: "top", horizontal: "center" }, preventDuplicate: t4?.preventDuplicate, persist: t4?.persist ?? t4?.type === Pa.Error, action: (e5) => N(J, { onClick: () => h2(e5), children: N(xa, {}) }) };
|
|
2478
|
+
t4?.enqueueProps && Object.assign(o4, t4.enqueueProps), e4 || console.log("message is 'null'", t4), g2(e4 ?? "Alert", o4);
|
|
2479
|
+
}, t3 = { showMessage: e3, showBusy: (e4, t4) => {
|
|
2480
|
+
let o4 = null;
|
|
2482
2481
|
const n3 = new Promise((e5) => {
|
|
2483
|
-
|
|
2482
|
+
o4 = e5;
|
|
2484
2483
|
});
|
|
2485
|
-
return x2((
|
|
2486
|
-
const a3 = new Map(
|
|
2487
|
-
a3.set(n3,
|
|
2488
|
-
return { ...
|
|
2484
|
+
return x2((t5) => {
|
|
2485
|
+
const a3 = new Map(t5.starting);
|
|
2486
|
+
a3.set(n3, o4);
|
|
2487
|
+
return { ...t5, label: e4, starting: a3 };
|
|
2489
2488
|
}), n3;
|
|
2490
|
-
}, showWindow: (e4,
|
|
2491
|
-
const n3 = { ...
|
|
2492
|
-
c2?.dispatchToFocusedCommand(e5), e5.isDefaultPrevented() || e5.isPropagationStopped() ||
|
|
2489
|
+
}, showWindow: (e4, t4, o4) => {
|
|
2490
|
+
const n3 = { ...t4, onKeyDown: (e5) => {
|
|
2491
|
+
c2?.dispatchToFocusedCommand(e5), e5.isDefaultPrevented() || e5.isPropagationStopped() || t4?.onKeyDown?.(e5);
|
|
2493
2492
|
} };
|
|
2494
|
-
return k2(e4, { sort: () => import("./
|
|
2495
|
-
}, showOptions: S2, showInputOptions: C2, showError: (
|
|
2496
|
-
let
|
|
2497
|
-
"string" == typeof
|
|
2498
|
-
} };
|
|
2493
|
+
return k2(e4, { sort: () => import("./DmbC0_ocWCB60DUY.mjs"), numberFormat: () => import("./nZVauB5xkNLVTaod.mjs"), hyperlink: () => import("./g5IsTuP_M7p1bN41.mjs"), comments: () => import("./C0x0sq_I7hdqCuBB.mjs"), find: () => import("./DUoSsHJRuVxAeHW-.mjs"), tableDetails: () => import("./DuFKPKejduTq6L6F.mjs"), tableNew: () => import("./DhjwHPKOhF-WGawL.mjs"), namedDetails: () => import("./VjNnErE5lO5hNix_.mjs") }[e4], n3, o4);
|
|
2494
|
+
}, showOptions: S2, showInputOptions: C2, showError: (t4) => {
|
|
2495
|
+
let o4, n3 = Pa.Error, a3 = "Unknown Error";
|
|
2496
|
+
"string" == typeof t4 ? a3 = t4 : t4 instanceof Error && (o4 = t4, t4.message && (a3 = t4.message)), t4 instanceof Za && (n3 = Pa.Info), e3(a3, { type: n3, enqueueProps: { error: o4 } });
|
|
2497
|
+
} }, o3 = new Wa();
|
|
2498
|
+
return o3.setDelegate(t3), o3;
|
|
2499
2499
|
}, []), D2 = z(() => {
|
|
2500
2500
|
}, []), P2 = ((e3) => {
|
|
2501
|
-
const { workbook: t3, setWorkbook: o3,
|
|
2501
|
+
const { workbook: t3, setWorkbook: o3, notifier: n3, importExportDisabled: a3, workbookTitle: r3 = "export", setWorkbookTitle: l3, requestWorkbookTitle: i3, themeOptions: s3, undoManager: d3, commands: c3, onExecute: m3 } = e3, p3 = wa(s3?.onModeChange, [s3?.onModeChange]), u3 = wa(s3?.onEnabledDarkGridChange, [s3?.onEnabledDarkGridChange]), g3 = wa(s3?.onEnabledDarkImagesChange, [s3?.onEnabledDarkImagesChange]), h3 = wa(async (e4 = null, t4 = null) => {
|
|
2502
2502
|
const o4 = [];
|
|
2503
|
-
let
|
|
2504
|
-
if ("string" == typeof e4 ?
|
|
2505
|
-
const i4 = { source:
|
|
2503
|
+
let a4, r4 = null, l4 = null;
|
|
2504
|
+
if ("string" == typeof e4 ? l4 = e4 : r4 = e4, a4 = r4 ? e4 : await Ka.openFileDialog(l4 ?? Wi.getAllReadFormatTypeAsString().join(",")), !a4) return null;
|
|
2505
|
+
const i4 = { source: a4, createWorkbookOptions: t4, onWarning: (e5) => {
|
|
2506
2506
|
o4.push(e5);
|
|
2507
|
-
} }, s4 = await
|
|
2508
|
-
return o4.length > 0 && (
|
|
2509
|
-
}, [m3,
|
|
2507
|
+
} }, s4 = await Wi.read(i4, n3);
|
|
2508
|
+
return o4.length > 0 && (n3.showMessage("Some elements were not able to be imported. See console for details."), console.warn("Import warnings:\n" + o4.join("\n"))), s4;
|
|
2509
|
+
}, [m3, n3, t3]), f3 = wa(async (e4, t4, o4) => {
|
|
2510
2510
|
if (!t4 && i3) {
|
|
2511
2511
|
const t5 = await i3("Enter Workbook name to " + (o4.isDefault ? "Save." : `Export as ${o4.description}.`));
|
|
2512
|
-
return null !== t5 &&
|
|
2512
|
+
return null !== t5 && Wi.writeFile(t5, e4, { formatType: o4.key });
|
|
2513
2513
|
}
|
|
2514
|
-
return
|
|
2515
|
-
}, [
|
|
2514
|
+
return Wi.writeFile(t4, e4, { formatType: o4.key });
|
|
2515
|
+
}, [n3, t3, i3]), x3 = z(() => ({ contains: (e4) => true, focus() {
|
|
2516
2516
|
} }), []), b3 = W(() => {
|
|
2517
2517
|
const e4 = [];
|
|
2518
|
-
|
|
2519
|
-
const
|
|
2520
|
-
|
|
2518
|
+
a3 || (Wi.getWriteFormats().forEach((o4) => {
|
|
2519
|
+
const a4 = o4.isDefault, l4 = { label: a4 ? "Save Workbook" : `Save Workbook as ${o4.description}`, scopedLabels: { workbook: "Save", saveWorkbook: `as ${o4.description}` }, tags: o4.tags, description: `Save the workbook to the desktop${a4 ? "" : ` as ${o4.description}`}.` };
|
|
2520
|
+
a4 && (l4.shortcut = { key: "S", modifiers: [Ea.Ctrl] }, e4.push(new Na("saveWorkbookAs", x3, { label: "Save Workbook As…", scopedLabels: { workbook: "Save as…", saveWorkbook: "as…" }, shortcut: [{ key: "S", modifiers: [Ea.Shift, Ea.Ctrl] }, { key: "F12" }], description: "Save the workbook to the desktop with the provided name." }, () => {
|
|
2521
2521
|
f3(t3, null, o4).catch((e5) => {
|
|
2522
|
-
|
|
2522
|
+
n3.showError(e5);
|
|
2523
2523
|
});
|
|
2524
2524
|
})));
|
|
2525
|
-
const i5 =
|
|
2526
|
-
e4.push(new
|
|
2527
|
-
f3(t3, e5 ??
|
|
2528
|
-
|
|
2525
|
+
const i5 = a4 ? "saveWorkbook" : `saveWorkbookAs${o4.key}`;
|
|
2526
|
+
e4.push(new Na(i5, x3, l4, (e5) => {
|
|
2527
|
+
f3(t3, e5 ?? r3, o4).catch((e6) => {
|
|
2528
|
+
n3.showError(e6);
|
|
2529
2529
|
});
|
|
2530
2530
|
}));
|
|
2531
|
-
}), e4.push(new
|
|
2532
|
-
const
|
|
2531
|
+
}), e4.push(new Na("openWorkbook", x3, { label: "Open Workbook…", scopedLabels: { workbook: "Open…" }, description: "Open a workbook from the desktop.", shortcut: { key: "O", modifiers: [Ea.Ctrl] } }, async (e5 = null) => {
|
|
2532
|
+
const a4 = { date1904: t3.isDate1904(), ...t3.options };
|
|
2533
2533
|
try {
|
|
2534
|
-
const
|
|
2535
|
-
if (!
|
|
2536
|
-
const i5 =
|
|
2537
|
-
if ("text/csv" ===
|
|
2534
|
+
const r4 = await h3(e5, a4);
|
|
2535
|
+
if (!r4) return;
|
|
2536
|
+
const i5 = r4.title, s4 = r4.workbook, d4 = s4.getSelectedSheet();
|
|
2537
|
+
if ("text/csv" === r4.formatType.mimeType) {
|
|
2538
2538
|
const e6 = t3.findValidSheetName(i5);
|
|
2539
2539
|
await t3.doBatch(async () => {
|
|
2540
2540
|
const o4 = d4.getUsedRange();
|
|
2541
|
-
if (!o4) return void
|
|
2542
|
-
const
|
|
2543
|
-
await
|
|
2541
|
+
if (!o4) return void n3.showMessage("The file appears to be blank.");
|
|
2542
|
+
const a5 = t3.getSheets().add({ name: e6, autoSelect: true }).getRange({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 });
|
|
2543
|
+
await a5.copyFrom(o4);
|
|
2544
2544
|
}, `Import CSV '${i5}'`);
|
|
2545
|
-
} else t3?.close(),
|
|
2545
|
+
} else t3?.close(), l3?.(i5), o3(s4);
|
|
2546
2546
|
} catch (e6) {
|
|
2547
|
-
|
|
2547
|
+
n3.showError(e6);
|
|
2548
2548
|
}
|
|
2549
|
-
})), e4.push(new
|
|
2549
|
+
})), e4.push(new Na("openWorkbookFromUrl", x3, { label: "Open Workbook From Web", scopedLabels: { insert: "From Web", workbook: "From Web…" }, description: "Open a workbook from the web." }, async function(e5) {
|
|
2550
2550
|
if (!e5) {
|
|
2551
|
-
const t4 = await
|
|
2551
|
+
const t4 = await n3.showInputOptions({ title: "Open Workbook from the Web", description: "Enter the web address for the workbook to open.", inputLabel: "Address", initialValue: "https://www.sheetxl.com/examples/features-checklist.xlsx", inputProps: { style: { minWidth: "440px" } }, options: ["Open"] });
|
|
2552
2552
|
if ("Open" !== t4.option) return;
|
|
2553
2553
|
e5 = t4.input;
|
|
2554
2554
|
}
|
|
2555
2555
|
e5 && console.log("openWorkbookFromUrl", e5);
|
|
2556
2556
|
})));
|
|
2557
2557
|
let i4 = [];
|
|
2558
|
-
return s3 && (i4 = [new
|
|
2559
|
-
}), new
|
|
2560
|
-
}), new
|
|
2558
|
+
return s3 && (i4 = [new Na("themeMode", x3, { label: "Light/Dark Mode", scopedLabels: { appearance: "Light/Dark Mode" }, description: "Toggle the application styling between light and dark mode." }), new Na("defaultThemeMode", x3, { label: "Use System Light/Dark Mode", scopedLabels: { appearance: "Use System Default" }, description: "Use the system settings to determine styling for light and dark mode." }), new Na("enableDarkGrid", x3, { label: "Enable Dark Grid", description: "Allow the grid to render in dark mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)." }), new Na("enableDarkImages", x3, { label: "Enable Dark Images", description: "Allow the images to render in dark mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode." })]), [...e4, ...i4, new Ba("help", x3, { label: "Show Help", description: "Provide Help.", shortcut: { key: "F1" } }, () => {
|
|
2559
|
+
}), new Ba("showKeyboardShortcuts", x3, { label: "Keyboard Shortcuts", description: "Show keyboard shortcuts.", shortcut: { key: "/", modifiers: [Ea.Ctrl] } }, () => {
|
|
2560
|
+
}), new Na("gotoUrlGithub", x3, { label: "Github", description: "Download examples, explore source code, and leave a star." }, () => {
|
|
2561
2561
|
window?.open("https://github.com/sheetxl/sheetxl");
|
|
2562
|
-
}), new
|
|
2562
|
+
}), new Na("gotoUrlDiscord", x3, { label: "Discord", description: "Join our community on discord." }, () => {
|
|
2563
2563
|
window?.open("https://discord.gg/NTKdwUgK9p");
|
|
2564
|
-
}), new
|
|
2564
|
+
}), new Na("gotoUrlDocumentation", x3, { label: "Documentation", description: "Read the documentation." }, () => {
|
|
2565
2565
|
window?.open("https://www.sheetxl.com/docs");
|
|
2566
|
-
}), new
|
|
2566
|
+
}), new Na("gotoUrlIssue", x3, { label: "Create Issue", description: "Create an issue to identify a bug or a feature request." }, () => {
|
|
2567
2567
|
window?.open("https://github.com/sheetxl/sheetxl/issues");
|
|
2568
2568
|
})];
|
|
2569
|
-
}, [t3,
|
|
2569
|
+
}, [t3, r3, n3, a3, s3, c3, d3]), y3 = W(() => {
|
|
2570
2570
|
let e4 = null;
|
|
2571
|
-
return e4 = c3 ? c3.createChildGroup(x3, "standaloneWorkbook", false) : new
|
|
2571
|
+
return e4 = c3 ? c3.createChildGroup(x3, "standaloneWorkbook", false) : new Aa(x3, "standaloneWorkbook"), e4.addCommands(b3, true), e4;
|
|
2572
2572
|
}, [c3, b3]);
|
|
2573
|
-
|
|
2573
|
+
Ha({ manager: d3, commands: y3 });
|
|
2574
2574
|
const { themeMode: w3 } = On();
|
|
2575
2575
|
V(() => {
|
|
2576
2576
|
if (!s3 || !y3) return;
|
|
@@ -2588,7 +2588,7 @@ const Oi = L(H((e2, t2) => {
|
|
|
2588
2588
|
const { showModal: k3 } = Gn();
|
|
2589
2589
|
return V(() => {
|
|
2590
2590
|
const e4 = () => new Promise((e5, t4) => {
|
|
2591
|
-
const o4 = I.lazy(() => import("./
|
|
2591
|
+
const o4 = I.lazy(() => import("./x7VDppl2hKDhIcfj.mjs")), n4 = k3(o4, { title: "Shortcut Keys Reference", commands: y3, onDone: () => {
|
|
2592
2592
|
n4.hide();
|
|
2593
2593
|
}, TransitionProps: { onExited: () => {
|
|
2594
2594
|
e5(true);
|
|
@@ -2596,11 +2596,11 @@ const Oi = L(H((e2, t2) => {
|
|
|
2596
2596
|
});
|
|
2597
2597
|
y3.getCommand("showKeyboardShortcuts").updateCallback(() => e4()), y3.getCommand("help").updateCallback(() => e4());
|
|
2598
2598
|
}, [b3, y3]), y3;
|
|
2599
|
-
})({ workbook: o2, setWorkbook: n2, importExportDisabled: m2, workbookTitle: r2, setWorkbookTitle: l2, commands: c2, requestWorkbookTitle: (e3) => new Promise((t3) => {
|
|
2599
|
+
})({ notifier: T2, workbook: o2, setWorkbook: n2, importExportDisabled: m2, workbookTitle: r2, setWorkbookTitle: l2, commands: c2, requestWorkbookTitle: (e3) => new Promise((t3) => {
|
|
2600
2600
|
a2.current ? a2.current.requestWorkbookTitle((e4, o3) => {
|
|
2601
2601
|
t3(e4);
|
|
2602
2602
|
}, { selectAll: true, requestReason: e3 }) : t3(i2);
|
|
2603
|
-
}), themeOptions: p2, undoManager: d2,
|
|
2603
|
+
}), themeOptions: p2, undoManager: d2, onExecute: D2 });
|
|
2604
2604
|
V(() => {
|
|
2605
2605
|
f2.starting.size <= 0 || !f2.isMounted || x2((e3) => {
|
|
2606
2606
|
const t3 = new Map(e3.running);
|
|
@@ -2621,18 +2621,18 @@ const Oi = L(H((e2, t2) => {
|
|
|
2621
2621
|
V(() => {
|
|
2622
2622
|
0 !== f2.starting.size || 0 !== f2.running.size ? M2(N(Ve, { icon: N(qn, { sx: { transform: "scale(0.7)", marginLeft: "-6px" } }), panel: true, label: f2.label, onMount: b2, onUnmount: y2, sx: { position: "absolute", left: "0", top: "0", width: "100%", height: "100%", zIndex: "9999" } })) : M2(null);
|
|
2623
2623
|
}, [f2.starting, f2.running]);
|
|
2624
|
-
const F2 = W(() => N(
|
|
2625
|
-
return o2 && (B2.statusBarProps = { childrenEnd: F2 }), E(
|
|
2624
|
+
const F2 = W(() => N(fl, { commands: P2, disableHover: true, sx: { padding: "0" }, buttonProps: { sx: { maxHeight: "22px" } } }), [P2]), B2 = { commands: P2 };
|
|
2625
|
+
return o2 && (B2.statusBarProps = { childrenEnd: F2 }), E(za, { notifier: T2, children: [R2, s2 ? I.cloneElement(s2, B2) : null] });
|
|
2626
2626
|
}));
|
|
2627
|
-
|
|
2628
|
-
const
|
|
2629
|
-
const { className: o2, sx: n2, style: a2, onElementLoad: r2, onError: l2, undoManager: i2, errorPanel: s2 = Kn, onKeyDown: d2, workbook: c2, createWorkbookOptions: m2, onWorkbookChange: p2, logo: u2, importExportDisabled: g2 = false, themeOptions: f2, autoFocus: x2 = false, commands: b2, title: y2, onTitleChange: w2, titleProps: k2, renderLoadingPanel: S2, ...C2 } = e2, T2 = U(null), D2 = wa(p2, [p2]), P2 = wa(w2 ?? k2?.onTitleChange, [w2 ?? k2?.onTitleChange]), R2 = k2?.placeHolder ?? "Untitled", M2 = f2?.mode, { themeMode: F2, source: B2 } = On({ mode: M2 }), A2 = W(() => ({ ...f2, light: Xn(false,
|
|
2627
|
+
Ui.displayName = "SnackbarAndCommandsWrapper";
|
|
2628
|
+
const ji = L(H((e2, t2) => {
|
|
2629
|
+
const { className: o2, sx: n2, style: a2, onElementLoad: r2, onError: l2, undoManager: i2, errorPanel: s2 = Kn, onKeyDown: d2, workbook: c2, createWorkbookOptions: m2, onWorkbookChange: p2, logo: u2, importExportDisabled: g2 = false, themeOptions: f2, autoFocus: x2 = false, commands: b2, title: y2, onTitleChange: w2, titleProps: k2, renderLoadingPanel: S2, ...C2 } = e2, T2 = U(null), D2 = wa(p2, [p2]), P2 = wa(w2 ?? k2?.onTitleChange, [w2 ?? k2?.onTitleChange]), R2 = k2?.placeHolder ?? "Untitled", M2 = f2?.mode, { themeMode: F2, source: B2 } = On({ mode: M2 }), A2 = W(() => ({ ...f2, light: Xn(false, Ka.deepMerge(f2?.theme ?? {}, f2?.light ?? {})), dark: Xn(true, Ka.deepMerge(f2?.theme ?? {}, f2?.dark ?? {})) }), [f2]), I2 = F2 === Vn.Dark, [L2, H2] = O(null);
|
|
2630
2630
|
V(() => {
|
|
2631
|
-
H2(i2 ?? new
|
|
2631
|
+
H2(i2 ?? new Ja());
|
|
2632
2632
|
}, [i2]);
|
|
2633
2633
|
const [$2, G2] = O(null), [j2, _2] = O(null), q2 = v();
|
|
2634
2634
|
K(() => {
|
|
2635
|
-
if (!c2 || 0 === Object.keys(c2).length && !
|
|
2635
|
+
if (!c2 || 0 === Object.keys(c2).length && !Ka.isPromiseLike(c2)) {
|
|
2636
2636
|
const e3 = { theme: q2.getDefaultTheme(), ...m2 };
|
|
2637
2637
|
_2(new h(e3));
|
|
2638
2638
|
} else _2(c2);
|
|
@@ -2642,7 +2642,7 @@ const Vi = L(H((e2, t2) => {
|
|
|
2642
2642
|
(async () => {
|
|
2643
2643
|
try {
|
|
2644
2644
|
let e3, t3 = await Promise.resolve(j2);
|
|
2645
|
-
t3 && t3.source && (t3 = await
|
|
2645
|
+
t3 && t3.source && (t3 = await Wi.read(t3)), t3.workbook ? (ee2(t3.title), e3 = t3.workbook) : e3 = t3, D2?.(e3), G2({ workbook: e3 });
|
|
2646
2646
|
} catch (e3) {
|
|
2647
2647
|
D2?.(null), G2({ error: e3 });
|
|
2648
2648
|
}
|
|
@@ -2671,7 +2671,7 @@ const Vi = L(H((e2, t2) => {
|
|
|
2671
2671
|
const [oe2, ne2] = O(null), ae2 = W(() => {
|
|
2672
2672
|
const e3 = () => ({ contains: (e4) => true, focus() {
|
|
2673
2673
|
} });
|
|
2674
|
-
return b2 ? b2.createChildGroup(e3, "application", false) : new
|
|
2674
|
+
return b2 ? b2.createChildGroup(e3, "application", false) : new Aa(e3, "application");
|
|
2675
2675
|
}, [b2]), re2 = wa((e3) => {
|
|
2676
2676
|
ne2(e3.source.getViewportElement()), J2(e3), ae2.activate("sheet"), r2?.(e3);
|
|
2677
2677
|
}, [ae2]);
|
|
@@ -2680,9 +2680,9 @@ const Vi = L(H((e2, t2) => {
|
|
|
2680
2680
|
}, [Z2]);
|
|
2681
2681
|
const le2 = U(null), ie2 = z((e3) => {
|
|
2682
2682
|
let t3 = null;
|
|
2683
|
-
return k2?.hidden || (t3 = N(
|
|
2683
|
+
return k2?.hidden || (t3 = N(Ei, { ...k2, style: { maxWidth: "100%", ...k2?.style }, workbook: T2.current, ref: le2, title: Q2, placeHolder: R2, onTitleChange: (e4) => {
|
|
2684
2684
|
ee2(e4);
|
|
2685
|
-
} })), N(
|
|
2685
|
+
} })), N(Gi, { ...e3, logo: u2, mainElement: t3, showFileMenu: !g2, showAppearanceMenu: !!(A2?.onEnabledDarkGridChange || A2?.onEnabledDarkImagesChange || A2?.onModeChange) });
|
|
2686
2686
|
}, [u2, Q2, k2, A2, g2, ae2]);
|
|
2687
2687
|
V(() => {
|
|
2688
2688
|
const e3 = (e4) => e4.preventDefault();
|
|
@@ -2693,100 +2693,100 @@ const Vi = L(H((e2, t2) => {
|
|
|
2693
2693
|
const se2 = W(() => {
|
|
2694
2694
|
const e3 = { transparentBackground: true };
|
|
2695
2695
|
return N(X, { sx: n2, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, display: "flex", alignItems: "center", justifyContent: "center", ...a2 }, children: S2?.(e3) ?? N(Ve, { ...e3 }) });
|
|
2696
|
-
}, [n2, a2, S2]), de2 = z(({ error: e3 }) => (l2?.(e3), N(s2, { sx: n2, style: a2, error: e3 ?? "Unable to display empty workbook." })), [n2, a2, l2]), ce2 = W(() => ({ ...n2, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-SnackbarContainer > div": { maxWidth: "100%" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-MuiContent *": { fontFamily: (e3) => e3.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [n2]), me2 =
|
|
2696
|
+
}, [n2, a2, S2]), de2 = z(({ error: e3 }) => (l2?.(e3), N(s2, { sx: n2, style: a2, error: e3 ?? "Unable to display empty workbook." })), [n2, a2, l2]), ce2 = W(() => ({ ...n2, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-SnackbarContainer > div": { maxWidth: "100%" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-MuiContent *": { fontFamily: (e3) => e3.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [n2]), me2 = qa([T2, t2]), pe2 = W(() => {
|
|
2697
2697
|
if (!$2) return se2;
|
|
2698
2698
|
if ($2.error || !$2.workbook) return de2({ error: $2.error });
|
|
2699
2699
|
let e3 = null, t3 = null, n3 = false;
|
|
2700
|
-
return A2 && (e3 = I2 ? A2.dark : A2.light, t3 = I2 && A2.enableDarkGrid ? A2.dark : A2.light, n3 = A2.enableDarkImages), N(
|
|
2700
|
+
return A2 && (e3 = I2 ? A2.dark : A2.light, t3 = I2 && A2.enableDarkGrid ? A2.dark : A2.light, n3 = A2.enableDarkImages), N(Bi, { sx: ce2, style: a2, tabIndex: 0, autoFocus: true, workbook: $2.workbook, ref: me2, renderToolbar: ie2, onElementLoad: re2, onRepeatCommandChange: Y2, onKeyDown: (e4) => {
|
|
2701
2701
|
d2?.(e4);
|
|
2702
2702
|
}, renderLoadingPanel: S2, gridTheme: t3, headersTheme: e3, enableDarkImages: n3, className: Yn(o2, "sheetxl-workbook"), onContextMenu: (e4) => e4.preventDefault(), ...C2 }, "WorkbookElement");
|
|
2703
2703
|
}, [$2, Q2, L2, se2, S2, A2, C2, ie2, ce2]);
|
|
2704
|
-
let ue2 = N(
|
|
2704
|
+
let ue2 = N(or, { fallbackRender: de2, children: N(rr, { maxSnack: 3, domRoot: oe2, anchorOrigin: { vertical: "bottom", horizontal: "right" }, autoHideDuration: 3500, onClose: (e3, t3, o3) => {
|
|
2705
2705
|
T2.current?.focus();
|
|
2706
|
-
}, Components: { error:
|
|
2707
|
-
return A2 && (ue2 = E(
|
|
2706
|
+
}, Components: { error: $i }, iconVariant: { success: N(te, { style: { marginRight: "8px" }, children: N("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: N(Jn, { style: { marginRight: "8px" } }) }, children: N(Zn, { children: N(Ui, { workbook: $2?.workbook, setWorkbook: _2, importExportDisabled: g2, titlePlaceHolder: R2, titleWorkbook: Q2, setWorkbookTitle: ee2, refWorkbookTitle: le2, commands: ae2, undoManager: L2, themeOptions: A2, children: pe2 }) }) }) });
|
|
2707
|
+
return A2 && (ue2 = E(Ga, { theme: I2 ? A2.dark : A2.light, children: [A2.cssBaseline ? N(ye, {}) : null, ue2] })), ue2;
|
|
2708
2708
|
}));
|
|
2709
|
-
|
|
2710
|
-
const
|
|
2709
|
+
ji.displayName = "EagerStudio";
|
|
2710
|
+
const _i = Object.freeze(Object.defineProperty({ __proto__: null, EagerStudio: ji, default: ji }, Symbol.toStringTag, { value: "Module" }));
|
|
2711
2711
|
export {
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2712
|
+
hl as AppearanceCommandButton,
|
|
2713
|
+
mr as AutoColorPosition,
|
|
2714
|
+
Mr as BorderCommandButton,
|
|
2715
|
+
Rr as BorderPopupButton,
|
|
2716
|
+
Pr as BorderStyleButton,
|
|
2717
|
+
hr as C,
|
|
2718
|
+
Lr as ClearCommandButton,
|
|
2719
|
+
xr as ColorButton,
|
|
2720
|
+
$r as ColorCommandButton,
|
|
2721
|
+
Sr as ColorPanel,
|
|
2722
|
+
cr as ColorPanelType,
|
|
2723
|
+
vr as ColorPopupButton,
|
|
2724
|
+
zr as DeleteCellsCommandButton,
|
|
2725
|
+
gl as DocThemeCommandButton,
|
|
2726
|
+
ji as EagerStudio,
|
|
2727
|
+
Hr as FillCommandButton,
|
|
2728
|
+
Nl as FilterColumnMenu,
|
|
2729
|
+
Gr as FilterCommandButton,
|
|
2730
|
+
El as Filters,
|
|
2731
|
+
Nr as FindCommandButton,
|
|
2732
|
+
qr as FontFamilyCommandButton,
|
|
2733
|
+
Er as FontSizeCommandButton,
|
|
2734
|
+
Bl as FormulaBar,
|
|
2735
|
+
Br as FreezeCommandButton,
|
|
2736
|
+
fl as HelpCommandButton,
|
|
2737
|
+
lr as HorizontalAlignCommandButton,
|
|
2738
|
+
Wr as InsertCellsCommandButton,
|
|
2739
|
+
Sl as InsertFunctionCommandPopupButton,
|
|
2740
|
+
yl as InsertFunctionSumCommandPopupButton,
|
|
2741
|
+
xl as InsertImageCommandButton,
|
|
2742
|
+
Zl as InsertScriptCommandButton,
|
|
2743
2743
|
LicenseManager,
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2744
|
+
Fr as MergeCommandButton,
|
|
2745
|
+
Ml as NamedCollectionEditor,
|
|
2746
|
+
vl as NamedInput,
|
|
2747
|
+
Ir as NumberFormatCommandButton,
|
|
2748
|
+
Zr as PasteCommandButton,
|
|
2749
|
+
tl as PresetCellStylesCommandButton,
|
|
2750
|
+
dl as PresetTableStylesCommandButton,
|
|
2751
|
+
Dl as RangeInput,
|
|
2752
|
+
oi as RunScriptCommandButton,
|
|
2753
|
+
Jl as ScriptEditorToolbar,
|
|
2754
|
+
ei as ScriptWorkspace,
|
|
2755
|
+
Al as SheetTab,
|
|
2756
|
+
Il as SheetTabMenu,
|
|
2757
|
+
Pl as SheetZoomScale,
|
|
2758
|
+
Ll as SheetsAllMenu,
|
|
2759
|
+
Vr as SortFilterCommandButton,
|
|
2760
|
+
Rl as StatusBar,
|
|
2761
|
+
Ai as Studio,
|
|
2762
|
+
Dr as StyledStrokeIcon,
|
|
2763
|
+
ll as TableStyleCanvasPreview,
|
|
2764
|
+
il as TableStyleOptionsPanel,
|
|
2765
|
+
al as TableStylePreview,
|
|
2766
|
+
Kr as TextEffectsCommandButton,
|
|
2767
|
+
sr as TextOverflowCommandButton,
|
|
2768
|
+
dr as TextRotateCommandButton,
|
|
2769
|
+
ml as ThemeSelectButton,
|
|
2770
|
+
pl as ThemeSelectPanel,
|
|
2771
|
+
ul as ThemeSelectPopupButton,
|
|
2772
|
+
Xr as UnderlineCommandButton,
|
|
2773
|
+
Ur as UndoRedoCommandButton,
|
|
2774
|
+
ir as VerticalAlignCommandButton,
|
|
2775
|
+
Or as ViewGridLinesCommandButton,
|
|
2776
|
+
Jr as ViewHeadingsCommandButton,
|
|
2777
|
+
bl as WalkingCopyCommandButton,
|
|
2778
|
+
yi as WorkbookContextMenu,
|
|
2779
|
+
Bi as WorkbookElement,
|
|
2780
|
+
Wi as WorkbookIO,
|
|
2781
|
+
bi as WorkbookStrip,
|
|
2782
|
+
Ei as WorkbookTitle,
|
|
2783
|
+
Yr as WorkbookViewCommandButton,
|
|
2784
|
+
Hi as _WorkbookIO,
|
|
2785
|
+
Gl as createGridStyleFromMUITheme,
|
|
2786
|
+
Ai as default,
|
|
2787
|
+
pi as defaultNewWorkbook,
|
|
2788
|
+
Ol as setPrintExamplesOnLoad,
|
|
2789
2789
|
useModelListener,
|
|
2790
2790
|
useRangeListener,
|
|
2791
|
-
|
|
2791
|
+
mi as useWorkbookCommands
|
|
2792
2792
|
};
|