@sheetxl/studio-mui 0.6.5 → 0.6.7
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/{BiXR_PE14hrnbjxg.cjs → 0lIBM05Oo-mPaz-z.cjs} +1 -1
- package/browser/cjs/5JvwHMk_pfEj4cZH.cjs +42 -0
- package/browser/cjs/{BdFSVVjjrhlXHPpK.cjs → BOqCECEhgUXx-4kI.cjs} +2 -2
- package/browser/cjs/BaMk9jpFcmdBLRiR.cjs +6 -0
- package/browser/cjs/CCynZK017xahlNmi.cjs +18 -0
- package/browser/cjs/{mocbOdB4d2s-EcmO.cjs → CG7Z-lZAq5czFOc4.cjs} +2 -2
- package/browser/cjs/CRAcvjlcqcZK3WEL.cjs +20 -0
- package/browser/cjs/{CHMLnYdMrxKoXUT-.cjs → CtkBZTjdHqYp7xft.cjs} +1 -1
- package/browser/cjs/{Bkxhpequ7eXKflN2.cjs → DmM-DjGh015RZXzh.cjs} +2 -2
- package/browser/cjs/{D3da_TJhCMaA-Jvd.cjs → U3YgQ0fN5bvp9-Kq.cjs} +2 -2
- package/browser/cjs/{CZibZcMftaStnfGU.cjs → aiA3IvXgAikOrMwA.cjs} +1 -1
- package/browser/cjs/{Cgcw3wtvrTN9St3u.cjs → dW-tltmR8b4Fnr8g.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{DNCGkZj-AkmOiPjY.mjs → BxFzIKTovnlqjZa-.mjs} +18 -18
- package/browser/esm/{BMSwIfNeNw_icSmZ.mjs → C1aztXQ58ekuzis6.mjs} +1 -1
- package/browser/esm/{CmyX3-QWO3ckLyv3.mjs → C9vgT92BfuOKSqpB.mjs} +1 -1
- package/browser/esm/{ClhYgmXRwTR4BGDR.mjs → COc-f5ehGeQiPNRP.mjs} +183 -183
- package/browser/esm/{BM3rF0tr-rYuco_b.mjs → Ck2WRaGuINSXU-Ds.mjs} +2 -2
- package/browser/esm/{DrthDGd5PMQYMoAg.mjs → DVbgcz-P2Z8D_yei.mjs} +2 -2
- package/browser/esm/{DnGxqCVe_CBDfW9k.mjs → Dcag5-NLJslhyfpE.mjs} +2 -2
- package/browser/esm/{BezPorS4-_Cf52pp.mjs → DnJZFwOGICYRq_KW.mjs} +1 -1
- package/browser/esm/{DhXNvjm-1jhrLfp9.mjs → EmQd5txQ_ErHLAeT.mjs} +2 -2
- package/browser/esm/MgTnV8wS66lhumxT.mjs +4482 -0
- package/browser/esm/{1-hjYTXne52O8OX_.mjs → _08whbc3oA7BY_S7.mjs} +1 -1
- package/browser/esm/{C79_LGbHVJJOQeTJ.mjs → he9qd0KA2ONjy_rM.mjs} +88 -88
- package/browser/esm/index.mjs +53 -52
- package/licenses/dependencies.txt +142 -142
- package/node/esm/{Diz6_VGLA3UKNUY9.mjs → B5K3cjwd0usYef8w.mjs} +3 -3
- package/node/esm/{Bzl7JElFM6-FCHSt.mjs → BAHfO9ALnEUni4Ts.mjs} +1 -1
- package/node/esm/{CztOzeLDzog1fyuN.mjs → BfPfvgdZrUoZvEme.mjs} +1 -1
- package/node/esm/{DGRe7O8zr5SC-f6x.mjs → BqPC_rbjZN2Jy_y4.mjs} +1 -1
- package/node/esm/{6F8OSHeXM9CEkZqx.mjs → CHNFCXGADLFVCwYo.mjs} +1 -1
- package/node/esm/{Cnq5yNOuwBbKS_5h.mjs → Cgxo3ZcSke1eBYVG.mjs} +1 -1
- package/node/esm/{CIovZ9X_7yBfY6gS.mjs → Ciwkv8DXp86zUjTb.mjs} +1 -1
- package/node/esm/{B8vjMUZKgFrmm-ow.mjs → DESr6vZQNH2lHWZ9.mjs} +1 -1
- package/node/esm/{Ky0P7yYYcyx15RUV.mjs → DhN2m_4WFHDBADx-.mjs} +1 -1
- package/node/esm/{B6FKzcfPmEc-2C3u.mjs → IID7UVIiXTHvqYHK.mjs} +1 -1
- package/node/esm/index.mjs +1246 -1170
- package/package.json +9 -9
- package/types/index.d.ts +30 -11
- package/browser/cjs/BMxf7QrY-RKnhIl4.cjs +0 -6
- package/browser/cjs/BS2wS_sZa-gKkoFx.cjs +0 -20
- package/browser/cjs/BTFMHzaEfycvibMu.cjs +0 -42
- package/browser/cjs/CUnh1LhecJpjlHt_.cjs +0 -18
- package/browser/esm/BZW3vg34hfduKfB_.mjs +0 -4408
|
@@ -1,4408 +0,0 @@
|
|
|
1
|
-
import { Color as ht, IColor as Hr, ITheme as is, CommonUtils as Ze, IBorder as Ce, IFont as Bt, NumberFormat as mt, IFontCollection as ls, IStyle as pe, ITextFrame as ss, Table as or, IFill as kn, CoordUtils as cs, ISheet as Rt, LicenseManager as vo, Workbook as jn, TypesUtils as ds } from "@sheetxl/sdk";
|
|
2
|
-
import { jsx as e, jsxs as j, Fragment as se } from "react/jsx-runtime";
|
|
3
|
-
import le, { memo as K, forwardRef as J, useMemo as W, useCallback as q, isValidElement as nr, useState as U, useEffect as me, Suspense as si, useRef as Se, createElement as Pe, useReducer as rr, useImperativeHandle as ps, version as us, useLayoutEffect as St, Component as ci, createContext as ms, useContext as gs, cloneElement as hs } from "react";
|
|
4
|
-
import { Box as B, Typography as Be, IconButton as dt, MenuItem as di, Divider as lo, Button as nn, SvgIcon as ar, Input as ir, FormControlLabel as Et, Checkbox as Dt, useMediaQuery as fs, FormControl as lr, TextField as pi, InputAdornment as xs, Slider as bs, Paper as Po, CircularProgress as ys, DialogTitle as ws, Select as Ss, Tabs as vs, Tab as Cs, Card as ks, CardActions as Ts, Collapse as Es, CssBaseline as Ds } from "@mui/material";
|
|
5
|
-
import { themeIcon as P, CommandButton as F, ExhibitDivider as re, FormatIndentDecreaseIcon as Ps, FormatIndentIncreaseIcon as Rs, defaultCreatePopupPanel as ke, CommandPopupButton as Re, TextVerticalTopIcon as Ms, TextVerticalCenterIcon as Ns, TextVerticalBottomIcon as zr, TextHorizontalOverflowIcon as Wr, TextHorizontalWrapIcon as Is, TextHorizontalClipIcon as Fs, TextHorizontalShrinkIcon as Os, TextRotation315Icon as zo, TextRotation45Icon as jr, TextRotation90Icon as Vr, TextRotation2702Icon as $r, TextRotationCustomIcon as _r, TextRotation0Icon as As, InputCommandButton as Bs, SimpleTooltip as At, LoadingPanel as Lt, PopupButtonType as nt, ExhibitPopupIconButton as vt, ExhibitPopupMenuItem as sr, ColorizedCircleIcon as Ls, ExhibitMenuItem as xt, createStrokeShadowFilter as Ur, strokeShadowFilter as Hs, ColorizedStrokeIcon as cr, ExhibitTooltip as rt, ExhibitIconButton as ft, CommandTooltip as dr, MergeAllIcon as qr, MergeHorizontalIcon as zs, MergeVerticalIcon as Ws, MergeUnMergeIcon as ui, FreezeBothIcon as js, FreezeRowsIcon as Vs, FreezeColumnsIcon as $s, FreezeIcon as _s, FindIcon as Gr, FindReplaceIcon as Us, GotoIcon as qs, TextSizeIncreaseIcon as Gs, TextSizeDecreaseIcon as Xs, SelectedIcon as sn, CurrencyDollarIcon as Ks, PercentIcon as Ys, CommaIcon as Zs, IncreaseDecimalIcon2 as Js, DecreaseDecimalIcon2 as Qs, ClearAllIcon as Xr, ClearFormatsIcon as mi, ClearContentsIcon as ec, FillDownIcon as so, InsertCells as Kr, InsertRowIcon as tc, InsertColumn2Icon as Yr, BlankIcon as rn, RemoveCellsIcon as Zr, RemoveRowIcon as oc, RemoveColumn2Icon as Jr, LabelIcon as eo, SortIncreaseIcon as Vn, SortDecreaseIcon as gi, SortCustomIcon as nc, FilterToggleIcon as $n, FilterClearIcon as pr, FilterReapplyIcon as hi, RedoIcon as rc, UndoIcon as ac, TextStrikeIcon as Qr, TextSuperscriptIcon as ic, TextSubscriptIcon as lc, TextUnderlineIcon as Tn, TextUnderlineDoubleIcon as ea, TextUnderlineAccountingIcon as ta, TextUnderlineAccountingDoubleIcon as oa, PasteIcon as na, PasteValuesIcon as sc, PasteFormatsIcon as cc, PasteFormulasIcon as dc, PasteTransposeIcon as pc, PasteLinksIcon as uc, NewPresetStylesIcon as mc, PresetStylesIcon as Ro, ExhibitMenuHeader as to, ContextMenu as fi, Theme2Icon as xi, SystemDefaultDarkMode as gc, SystemDefaultLightMode as hc, GithubIcon as fc, DiscordIcon as xc, DocumentationIcon as bi, TicketIcon as bc, HelpIcon as yc, InsertImageIcon as Wo, WalkingCopyIcon as wc, SimpleCommandPopupButton as ct, FunctionThinIcon as Sc, FunctionSumIcon as vc, ExhibitOptionButton as Cc, SelectRangeModeIcon as kc, hexToRGB as ra, useFloatStack as oo, CellSelectionIcon as Tc, CellSelectionRemoveIcon as Ec, CellSelectionEditIcon as Dc, InsertTableIcon as an, CellSelectionInsertIcon as Pc, CloseErrorIcon as Rc, CheckSuccessIcon as Mc, FunctionIcon as Nc, VisibilityOffIcon as yi, elevateColor as it, ThemedIcon as Ic, ScriptNewIcon as Fc, ScriptFormulaIcon as wi, ScriptMacroIcon as ur, ScriptSaveIcon as Oc, CommandToolbar as cn, CodeIcon as Ac, ScriptRunIcon as Bc, ColorizedTextIcon as Lc, ColorizedFillIcon as Hc, FormatPaintIcon as zc, TextBoldIcon as Wc, TextItalicIcon as jc, InsertHyperlinkIcon as _n, InsertCommentIcon as Un, FullScreenOffIcon as Vc, FullScreenIcon as $c, createScrollEdgeButton as _c, createScrollEndButton as Uc, createScrollStartButton as qc, HideColumnIcon as Gc, ShowColumnIcon as Xc, HideRowIcon as Kc, ShowRowIcon as Yc, ColumnsResizeAutoIcon as Zc, RowsResizeAutoIcon as Jc, CutIcon as Qc, DrawAspectIcon as aa, DrawAlignLeftIcon as ia, DrawResizeIcon as la, DrawAlignDistributeVertIcon as ed, DrawAlignDistributeHorzIcon as td, DrawAlignBottomIcon as od, DrawAlignMiddleIcon as nd, DrawAlignTopIcon as rd, DrawAlignRightIcon as ad, DrawAlignCenterIcon as id, DrawMoveBackwardIcon as ld, DrawToBackIcon as sd, DrawMoveForwardIcon as cd, DrawToFrontIcon as dd, scrollbarTheming as pd, StackTrace as ud, FileNewIcon as md, FileOpenIcon as gd, FileDownloadAsCSVIcon as hd, FileDownloadAsExcelIcon as fd, FileDownloadAsSheetIcon as xd, useResolvedThemeMode as Si, ThemeMode as qn, useModal as bd, useLazyWindow as yd, useOptionsDialog as wd, useInputDialog as Sd, AnimatedTraversingEllipsisIcon as vd, ErrorPanel as Cd, createExhibitTheme as sa, ModalProvider as kd, ErrorAlertIcon as Td } from "@sheetxl/utils-mui";
|
|
6
|
-
import { FormatAlignLeft as ca, FormatAlignCenter as da, FormatAlignRight as Ed, FormatAlignJustify as To, Colorize as Dd, DarkMode as pa, LightMode as ua, Keyboard as Pd, Remove as Rd, Add as Md, ExpandLess as Nd, ExpandMore as vi, Lock as dn, MoreHoriz as Id, WebhookOutlined as Ci, Close as ki, AddCircleOutline as Fd, Menu as Od, CancelOutlined as Ad } from "@mui/icons-material";
|
|
7
|
-
import { useCommands as We, CommandButtonType as ie, useCallbackRef as ee, ReactUtils as pn, KeyCodes as ye, useCommand as Ht, useEditMode as un, useMouseDownAndHoldListener as ma, NotificationType as wt, useImperativeElement as zt, SplitPane as Gn, RoundedTab as Bd, SimpleCommand as _e, Command as be, KeyModifiers as we, CommandGroup as mr, ToolTipPlacement as co, ScrollPane as Ld, useUndoManager as Hd } from "@sheetxl/utils-react";
|
|
8
|
-
import { useTheme as at, alpha as he, getOverlayAlpha as De, ThemeProvider as Ti } from "@mui/material/styles";
|
|
9
|
-
import { StyledStrokePath as zd, StaticBorderRenderer as gr, FontUtils as Wd, useModelListener as Ue, createCellEditStateFromCell as jd, SheetCellEditor as Vd, ScriptEditor as $d, useDocThemes as hr, TabStrip as _d, SheetElement as Ud, SheetScrollbar as ga, PictureEditor as qd, ChartEditor as Gd, EmptyFrame as Xd, LogoNoPaddingIcon as Kd } from "@sheetxl/react";
|
|
10
|
-
import { alpha as Qe } from "@mui/system";
|
|
11
|
-
import Kt, { createPortal as Yd } from "react-dom";
|
|
12
|
-
import { CommonUtils as Jt, ChainedError as Xn, PartialError as Zd, UndoManager as Jd } from "@sheetxl/utils";
|
|
13
|
-
import { IOUtils as Yt } from "@sheetxl/io";
|
|
14
|
-
/**
|
|
15
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.6.5
|
|
16
|
-
*
|
|
17
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
18
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
19
|
-
*/
|
|
20
|
-
function Ei(r) {
|
|
21
|
-
var i, o, t = "";
|
|
22
|
-
if (typeof r == "string" || typeof r == "number") t += r;
|
|
23
|
-
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
24
|
-
var n = r.length;
|
|
25
|
-
for (i = 0; i < n; i++) r[i] && (o = Ei(r[i])) && (t && (t += " "), t += o);
|
|
26
|
-
} else for (o in r) r[o] && (t && (t += " "), t += o);
|
|
27
|
-
return t;
|
|
28
|
-
}
|
|
29
|
-
function Oe() {
|
|
30
|
-
for (var r, i, o = 0, t = "", n = arguments.length; o < n; o++) (r = arguments[o]) && (i = Ei(r)) && (t && (t += " "), t += i);
|
|
31
|
-
return t;
|
|
32
|
-
}
|
|
33
|
-
const Qd = K(J((r, i) => {
|
|
34
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, parentFloat: c, ...m } = r, a = We(o, ["formatAlignLeftToggle", "formatAlignCenterToggle", "formatAlignRightToggle", "formatAlignJustifyToggle", "formatAlignCenterContinuousToggle", "formatAlignFillToggle", "formatAlignDistributedHorizontalToggle"]), s = W(() => {
|
|
35
|
-
for (let p = 0; p < a.length; p++) if (a[p]?.state()) return a[p].key();
|
|
36
|
-
return a[0]?.key();
|
|
37
|
-
}, [a]), u = W(() => {
|
|
38
|
-
const p = /* @__PURE__ */ new Map();
|
|
39
|
-
return p.set("formatAlignLeftToggle", P(e(ca, {}))), p.set("formatAlignCenterToggle", P(e(da, {}))), p.set("formatAlignRightToggle", P(e(Ed, {}))), p.set("formatAlignJustifyToggle", P(e(To, {}))), p.set("formatAlignCenterContinuousToggle", P(e(da, {}))), p.set("formatAlignFillToggle", P(e(To, {}))), p.set("formatAlignDistributedHorizontalToggle", P(e(To, {}))), p;
|
|
40
|
-
}, []), d = W(() => {
|
|
41
|
-
if (!t) return null;
|
|
42
|
-
const p = { ...t };
|
|
43
|
-
return delete p.beforeExecute, p;
|
|
44
|
-
}, [t]), f = q((p, g) => {
|
|
45
|
-
const y = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, b = j(se, { children: [e(F, { ...y, command: g.getCommand("formatAlignLeftToggle"), icon: u.get("formatAlignLeftToggle") }), e(F, { ...y, command: g.getCommand("formatAlignCenterToggle"), icon: u.get("formatAlignCenterToggle") }), e(F, { ...y, command: g.getCommand("formatAlignRightToggle"), icon: u.get("formatAlignRightToggle") }), e(F, { ...y, command: g.getCommand("formatAlignJustifyToggle"), icon: u.get("formatAlignJustifyToggle") }), e(re, { orientation: "horizontal" }), e(F, { ...y, command: g.getCommand("formatAlignCenterContinuousToggle"), icon: u.get("formatAlignCenterContinuousToggle") }), e(F, { ...y, command: g.getCommand("formatAlignFillToggle"), icon: u.get("formatAlignFillToggle") }), e(F, { ...y, command: g.getCommand("formatAlignDistributedHorizontalToggle"), icon: u.get("formatAlignDistributedHorizontalToggle") })] }), x = j(B, { sx: { className: Oe("quick-buttons"), display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (w) => w.stopPropagation(), children: [e(F, { command: g.getCommand("formatIndentDecrease"), commandHook: d, scope: n, disabled: l, icon: P(e(Ps, {})) }), e(F, { command: g.getCommand("formatIndentIncrease"), commandHook: d, scope: n, disabled: l, icon: P(e(Rs, {})) })] }), h = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...m, children: [x, e(re, { orientation: "horizontal" }), e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: b })] });
|
|
46
|
-
return ke({ ...p, children: h });
|
|
47
|
-
}, [l, t]);
|
|
48
|
-
return e(Re, { ref: i, parentFloat: c, commands: o, commandHook: t, scope: n, createPopupPanel: f, label: "Horizontal Alignment", tooltip: "Configure how text is placed in the horizontal direction of the cell.", quickCommand: s, icon: u.get(s) ?? e(ca, {}), ...m });
|
|
49
|
-
})), ep = K(J((r, i) => {
|
|
50
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = We(o, ["formatAlignTopToggle", "formatAlignMiddleToggle", "formatAlignBottomToggle", "formatAlignJustifyVerticalToggle", "formatAlignDistributedVerticalToggle"]), a = W(() => {
|
|
51
|
-
for (let d = 0; d < m.length; d++) if (m[d]?.state()) return m[d].key();
|
|
52
|
-
return m[0]?.key();
|
|
53
|
-
}, [m]), s = W(() => {
|
|
54
|
-
const d = /* @__PURE__ */ new Map();
|
|
55
|
-
return d.set("formatAlignTopToggle", P(e(Ms, {}))), d.set("formatAlignMiddleToggle", P(e(Ns, {}))), d.set("formatAlignBottomToggle", P(e(zr, {}))), d.set("formatAlignJustifyVerticalToggle", P(e(To, {}))), d.set("formatAlignDistributedVerticalToggle", P(e(To, {}))), d;
|
|
56
|
-
}, []), u = q((d, f) => {
|
|
57
|
-
const p = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, g = j(se, { children: [e(F, { ...p, command: f.getCommand("formatAlignTopToggle"), icon: s.get("formatAlignTopToggle") }), e(F, { ...p, command: f.getCommand("formatAlignMiddleToggle"), icon: s.get("formatAlignMiddleToggle") }), e(F, { ...p, command: f.getCommand("formatAlignBottomToggle"), icon: s.get("formatAlignBottomToggle") }), e(re, { orientation: "horizontal" }), e(F, { ...p, command: f.getCommand("formatAlignJustifyVerticalToggle"), icon: s.get("formatAlignJustifyVerticalToggle") }), e(F, { ...p, command: f.getCommand("formatAlignDistributedVerticalToggle"), icon: s.get("formatAlignDistributedVerticalToggle") })] });
|
|
58
|
-
return ke({ ...d, children: g });
|
|
59
|
-
}, [l, t, s]);
|
|
60
|
-
return e(Re, { ref: i, commands: o, commandHook: t, createPopupPanel: u, label: "Vertical Alignment", tooltip: "Configure how text is placed in the vertical direction of the cell.", icon: s.get(a) ?? P(e(zr, {})), ...c });
|
|
61
|
-
})), tp = K(J((r, i) => {
|
|
62
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = We(o, ["formatTextOverflowVisibleToggle", "formatTextOverflowWrapToggle", "formatTextOverflowClipToggle", "formatTextOverflowShrinkToggle"]), a = W(() => {
|
|
63
|
-
for (let d = 0; d < m.length; d++) if (m[d]?.state()) return m[d].key();
|
|
64
|
-
return m[0]?.key();
|
|
65
|
-
}, [m]), s = W(() => {
|
|
66
|
-
const d = /* @__PURE__ */ new Map();
|
|
67
|
-
return d.set("formatTextOverflowVisibleToggle", P(e(Wr, {}))), d.set("formatTextOverflowWrapToggle", P(e(Is, {}))), d.set("formatTextOverflowClipToggle", P(e(Fs, {}))), d.set("formatTextOverflowShrinkToggle", P(e(Os, {}))), d;
|
|
68
|
-
}, []), u = ee((d, f) => {
|
|
69
|
-
const p = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, g = j(se, { children: [e(F, { ...p, command: f.getCommand("formatTextOverflowVisibleToggle"), icon: s.get("formatTextOverflowVisibleToggle") }), e(F, { ...p, command: f.getCommand("formatTextOverflowWrapToggle"), icon: s.get("formatTextOverflowWrapToggle") }), e(F, { ...p, command: f.getCommand("formatTextOverflowClipToggle"), icon: s.get("formatTextOverflowClipToggle") }), e(re, { orientation: "horizontal" }), e(F, { ...p, command: f.getCommand("formatTextOverflowShrinkToggle"), icon: s.get("formatTextOverflowShrinkToggle") })] });
|
|
70
|
-
return ke({ ...d, children: g });
|
|
71
|
-
}, [l, t, n]);
|
|
72
|
-
return e(Re, { ref: i, commands: o, commandHook: t, scope: n, label: "Text Overflow", tooltip: "Configure how text behaves when it doesn't fit within a cell.", createPopupPanel: u, icon: s.get(a) ?? P(e(Wr, {})), ...c });
|
|
73
|
-
})), op = K(J((r, i) => {
|
|
74
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = We(o, ["formatTextRotate0", "formatTextRotate315", "formatTextRotate45", "formatTextRotate90", "formatTextRotate270", "formatSubscriptToggle", "formatTextRotateCustom"]), a = W(() => {
|
|
75
|
-
const f = m.length;
|
|
76
|
-
for (let p = 0; p < f; p++) {
|
|
77
|
-
const g = m[p];
|
|
78
|
-
if (g?.state()) return g.key();
|
|
79
|
-
}
|
|
80
|
-
return m[1]?.key();
|
|
81
|
-
}, [m]), s = W(() => {
|
|
82
|
-
const f = /* @__PURE__ */ new Map();
|
|
83
|
-
return f.set("formatTextRotate0", P(e(zo, {}))), f.set("formatTextRotate315", P(e(zo, {}))), f.set("formatTextRotate45", P(e(jr, {}))), f.set("formatTextRotate90", P(e(Vr, {}))), f.set("formatTextRotate270", P(e($r, {}))), f.set("formatTextRotateCustom", P(e(_r, {}))), f;
|
|
84
|
-
}, []), u = q((f, p) => {
|
|
85
|
-
const g = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, y = j(se, { children: [e(F, { ...g, command: p.getCommand("formatTextRotate0"), icon: P(e(As, {})) }), e(re, { orientation: "horizontal" }), e(F, { ...g, command: p.getCommand("formatTextRotate315"), icon: P(e(zo, {})) }), e(F, { ...g, command: p.getCommand("formatTextRotate45"), icon: P(e(jr, {})) }), e(F, { ...g, command: p.getCommand("formatTextRotate90"), icon: P(e(Vr, {})) }), e(F, { ...g, command: p.getCommand("formatTextRotate270"), icon: P(e($r, {})) }), e(re, { orientation: "horizontal" }), e(Bs, { ...g, command: p.getCommand("formatTextRotateCustom"), icon: P(e(_r, {})), label: "Custom" })] });
|
|
86
|
-
return ke({ ...f, children: y });
|
|
87
|
-
}, [l, t, n, o]), d = W(() => (o.getCommand("formatTextRotateCustom")?.state() ?? 0) !== 0, [m]);
|
|
88
|
-
return e(Re, { ref: i, commands: o, commandHook: t, scope: n, selected: d, label: "Text Orientation", tooltip: "Rotate your text diagonally or vertically. This is a great way to label narrow columns.", createPopupPanel: u, quickCommand: d ? "formatTextRotate0" : "formatTextRotate315", icon: P(s.get(a) ?? e(zo, {})), ...c });
|
|
89
|
-
})), np = { Preset: "preset", Custom: "custom" }, Eo = { Start: "start", End: "end" }, En = {}, rp = (r, i, o, t) => {
|
|
90
|
-
const n = r + "-" + i + "-" + o + (t ? "-server" : "");
|
|
91
|
-
if (En[n]) return En[n];
|
|
92
|
-
const l = ((c, m, a, s) => {
|
|
93
|
-
if (typeof document > "u" && !s) return null;
|
|
94
|
-
const u = s ? new s() : document.createElement("canvas");
|
|
95
|
-
u.width = 2 * a, u.height = 2 * a;
|
|
96
|
-
const d = u.getContext("2d");
|
|
97
|
-
return d ? (d.fillStyle = c, d.fillRect(0, 0, u.width, u.height), d.fillStyle = m, d.fillRect(0, 0, a, a), d.translate(a, a), d.fillRect(0, 0, a, a), u.toDataURL()) : null;
|
|
98
|
-
})(r, i, o, t);
|
|
99
|
-
return En[n] = l, l;
|
|
100
|
-
}, ap = {}, ip = K((r) => {
|
|
101
|
-
const { className: i, style: o = pn.EmptyCssProperties, white: t = "transparent", grey: n = "grey", size: l = 8, borderRadius: c, boxShadow: m, renderers: a = ap, children: s, ...u } = r, d = s, f = W(() => Object.assign({ borderRadius: c, boxShadow: m, position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", background: `url(${rp(t, n, l, a?.canvas)}) center left` }, o), [t, n, l, a]);
|
|
102
|
-
return nr(s) ? le.cloneElement(s, { ...d.props }) : e("div", { style: f, ...u });
|
|
103
|
-
}), lp = K((r) => {
|
|
104
|
-
const { selectedColor: i, onSelectColor: o, onPreviewColor: t, onClick: n, onKeyDown: l, onMouseOver: c, onMouseLeave: m, onFocus: a, style: s = pn.EmptyCssProperties, children: u, alphaWhite: d, alphaGrey: f, darkMode: p, alphaCheckSize: g = 7, ...y } = r;
|
|
105
|
-
if (!i) throw new Error("a selectedColor is required");
|
|
106
|
-
const b = q((k) => {
|
|
107
|
-
n?.(k), k.isDefaultPrevented() || (k.ctrlKey ? t?.(i.toRGBA()) : o?.(i.toRGBA()));
|
|
108
|
-
}, [o, t, n, i]), x = q((k) => {
|
|
109
|
-
c?.(k), k.isDefaultPrevented() || t?.(i.toRGBA());
|
|
110
|
-
}, [t, c, i]), h = q((k) => {
|
|
111
|
-
m?.(k), k.isDefaultPrevented();
|
|
112
|
-
}, [t, m]), w = q((k) => {
|
|
113
|
-
a?.(k), k.isDefaultPrevented() || t?.(i.toRGBA());
|
|
114
|
-
}, [t, a, i]), v = q((k) => {
|
|
115
|
-
l?.(k), k.isDefaultPrevented() || k.keyCode === ye.Enter && o?.(i.toRGBA());
|
|
116
|
-
}, [o, l, i]), C = W(() => i.toRGBA().alpha === 1 ? null : e(ip, { size: g, white: d, grey: f, style: { position: "absolute", width: "calc(100% - 1.5px)", height: "calc(100% - 1.5px)", top: "0.75px", left: "0.75px" } }), [d, f, i]);
|
|
117
|
-
return j("div", { style: { position: "absolute", height: "100%", width: "100%", top: "0px", left: "0px", cursor: "pointer", outline: "none", ...s }, tabIndex: 0, ...y, onClick: b, onKeyDown: v, onMouseOver: x, onMouseLeave: h, onFocus: w, children: [C, e("div", { style: { position: "absolute", top: "0px", left: "0px", height: "100%", width: "100%", background: i.toCSS(p) }, children: u })] });
|
|
118
|
-
}), fr = K((r) => {
|
|
119
|
-
const { schemeColorLookup: i, selectedColor: o, previewColor: t, colorDef: n, onSelectColorDef: l, onPreviewColorDef: c, swatchProps: m, defaultButtonSize: a = 24, isLarge: s = !1, compareRGB: u = !1, darkMode: d = !1, ...f } = r, p = new ht({ val: n.definition.val, adjs: n.definition.adjs }, (C) => i(C)), g = u ? p.toRGBA().toString() : p.toString(), y = o && (u ? o.toRGBA().toString() : o.toString()) === g, b = t && (u ? t.toRGBA().toString() : t.toString()) === g, x = [];
|
|
120
|
-
x.push({ [Hr.AdjustmentType.Inv]: !0 }), x.push({ [Hr.AdjustmentType.Alpha]: 100 });
|
|
121
|
-
const h = p.adjust(x), w = q(() => {
|
|
122
|
-
l?.(n);
|
|
123
|
-
}, [l, n]), v = q((C) => {
|
|
124
|
-
c?.(C ? n : null);
|
|
125
|
-
}, [c, n]);
|
|
126
|
-
return e(At, { disableInteractive: !0, PopperProps: { style: { pointerEvents: "none" }, disablePortal: !0, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: !0, options: { boundariesElement: "viewport" } }] } }, title: n.description, placement: "bottom-start", children: e("div", { style: { width: a * (s ? 1.2 : 1) + "px", height: a * (s ? 1.2 : 1) + "px", position: "relative", boxSizing: "border-box", cursor: "pointer", outline: "none" }, ...f, children: j(lp, { selectedColor: p, title: null, onSelectColor: w, onPreviewColor: v, alphaCheckSize: s ? 9 : void 0, darkMode: d, ...m, children: [e("div", { style: { position: "absolute", width: "100%", height: "100%", top: "0px", left: "0px", pointerEvents: "none", borderColor: h.toRGBA(d).toString(), borderWidth: "2px", borderStyle: "solid", boxSizing: "border-box", opacity: y ? "1" : "0" } }), e("div", { style: { position: "absolute", width: 0.33 * a * (s ? 1.2 : 1) + "px", height: 0.33 * a * (s ? 1.2 : 1) + "px", left: "calc(50% - 0.5px)", top: "calc(50% - 0.5px)", transform: "translate(-50%,-50%)", pointerEvents: "none", background: h.toRGBA(d).toString(), borderRadius: "50%", opacity: b ? "1" : "0" } })] }) }) });
|
|
127
|
-
}), jo = K((r) => {
|
|
128
|
-
const { title: i, schemeColorLookup: o, colorDefs: t, selectedColor: n, previewColor: l, onSelectColorDef: c, onPreviewColorDef: m, style: a = pn.EmptyCssProperties, compareRGB: s = !1, darkMode: u, swatchProps: d, ...f } = r;
|
|
129
|
-
let p;
|
|
130
|
-
if (Array.isArray(t[0])) p = t;
|
|
131
|
-
else {
|
|
132
|
-
p = [];
|
|
133
|
-
for (let h = 0; h < t.length; h++) p.push([t[h]]);
|
|
134
|
-
}
|
|
135
|
-
const g = q((h) => {
|
|
136
|
-
c?.(h);
|
|
137
|
-
}, [c]), y = q((h) => {
|
|
138
|
-
m?.(h);
|
|
139
|
-
}, [m]), b = W(() => {
|
|
140
|
-
let h = [];
|
|
141
|
-
for (let w = 0; w < p.length; w++) {
|
|
142
|
-
let v = [], C = p[w];
|
|
143
|
-
for (let T = 0; T < C.length; T++) {
|
|
144
|
-
let M = C[T];
|
|
145
|
-
v.push(e(fr, { schemeColorLookup: o, colorDef: M, selectedColor: n, previewColor: l, onSelectColorDef: g, onPreviewColorDef: y, swatchProps: d, compareRGB: s, darkMode: u }, w + " " + T));
|
|
146
|
-
}
|
|
147
|
-
let k = e(B, { className: "button-col", sx: { display: "flex", flexDirection: "column", justifyContent: "space-between", boxShadow: (T) => T.shadows[2], borderRadius: "2px", overflow: "hidden" }, children: v }, "" + w);
|
|
148
|
-
h.push(k);
|
|
149
|
-
}
|
|
150
|
-
return h;
|
|
151
|
-
}, [p, n, l, g, y]), x = W(() => i ? e(Be, { noWrap: !0, component: "div", sx: { display: "flex", flexShrink: "0", paddingLeft: "6px", paddingBottom: "4px", paddingTop: "0px", userSelect: "none", color: (h) => h.palette.text.secondary }, children: i }) : null, [i]);
|
|
152
|
-
return j(B, { style: { ...a }, children: [x, e(B, { sx: { display: "flex", flexDirection: "row", gap: "6px", marginBottom: "14px", flexWrap: "wrap", justifyContent: "flex-start" }, ...f, children: b })] });
|
|
153
|
-
}), ot = (r, i) => ({ description: r, definition: { val: i, adjs: [] } }), He = (r, i, o, t, n, l) => {
|
|
154
|
-
const c = ot(r, i);
|
|
155
|
-
t?.push(c);
|
|
156
|
-
const m = new ht({ val: c.definition.val, adjs: c.definition.adjs }, o), a = m.toString();
|
|
157
|
-
n?.set(a, m);
|
|
158
|
-
const s = m.toRGBA().toString();
|
|
159
|
-
l?.set(s, m);
|
|
160
|
-
}, sp = le.lazy(() => import("./ClhYgmXRwTR4BGDR.mjs")), cp = K(J((r, i) => {
|
|
161
|
-
const { selectedColor: o = null, previewColor: t = r.selectedColor ?? null, recentColors: n, schemeLookup: l, disableAlpha: c = !1, previewDebounceTime: m = 100, initialPanelType: a, defaultButtonSize: s = 24, width: u, onElementLoad: d, onDone: f, onEyeDropStart: p, onEyeDropStop: g, onPreviewColor: y, onPreviewColorImmediate: b, onSelectColor: x, autoColor: h, autoColorLabel: w = "Automatic", autoColorPosition: v = Eo.Start, compareRGB: C = !1, darkMode: k = !1, ...T } = r, M = t || o, I = ee(y, [y]), A = ee(b, [b]), R = ee(x, [x]), S = ee(p, [p]), N = ee(g, [g]), [L, O] = U(!1), $ = at(), D = W(() => l || ht.getDefaultSchemeLookup(), [l]), E = W(() => {
|
|
162
|
-
const H = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map(), Te = [];
|
|
163
|
-
He("Primary Background", "bg1", D, Te, H, oe), He("Primary Text", "tx1", D, Te, H, oe), He("Secondary Background", "bg2", D, Te, H, oe), He("Secondary Text", "tx2", D, Te, H, oe), He("Accent 1", "accent1", D, Te, H, oe), He("Accent 2", "accent2", D, Te, H, oe), He("Accent 3", "accent3", D, Te, H, oe), He("Accent 4", "accent4", D, Te, H, oe), He("Accent 5", "accent5", D, Te, H, oe), He("Accent 6", "accent6", D, Te, H, oe);
|
|
164
|
-
const ge = is.buildPalette(Te, D, H, oe), fe = [];
|
|
165
|
-
if (He("Dark Red", "C00000", D, fe, H, oe), He("Red", "FF0000", D, fe, H, oe), He("Orange", "FFC000", D, fe, H, oe), He("Yellow", "FFFF00", D, fe, H, oe), He("Light Green", "92D050", D, fe, H, oe), He("Green", "00B050", D, fe, H, oe), He("Light Blue", "00B0F0", D, fe, H, oe), He("Blue", "0070C0", D, fe, H, oe), He("Dark Blue", "002060", D, fe, H, oe), c ? He("Purple Is A Fruit", "7030A0", D, fe, H, oe) : He("Transparent", "00000000", D, fe, H, oe), h) {
|
|
166
|
-
const xe = h.toString();
|
|
167
|
-
H.set(xe, h);
|
|
168
|
-
}
|
|
169
|
-
const te = /* @__PURE__ */ new Map(), ce = typeof n == "function" ? n() : n, Me = [];
|
|
170
|
-
for (let xe = 0; ce && xe < ce.length; xe++) {
|
|
171
|
-
const Ge = ce[xe].toString();
|
|
172
|
-
te.set(Ge, ce[xe]), Me.push({ description: "Recent " + (xe + 1), definition: { val: ce[xe].toString() } });
|
|
173
|
-
}
|
|
174
|
-
return { primaryColors: Te, modifiedPresets: ge, standardColors: fe, recentColorsLimited: Me, mapAllPresets: H, mapAllPresetsRGB: oe, mapRecent: te };
|
|
175
|
-
}, [D, n, c, h]);
|
|
176
|
-
me(() => {
|
|
177
|
-
d?.();
|
|
178
|
-
}, []);
|
|
179
|
-
const [Y, Z] = U(!1), X = q(() => {
|
|
180
|
-
Z((H) => !H);
|
|
181
|
-
}, []);
|
|
182
|
-
me(() => {
|
|
183
|
-
if (a) Z(a === np.Custom);
|
|
184
|
-
else if (o) {
|
|
185
|
-
let H = o.toString(), oe = E.mapAllPresets.get(H);
|
|
186
|
-
oe || (H = o.toRGBA().toString(), oe = E.mapAllPresetsRGB.get(H));
|
|
187
|
-
const Te = E.mapRecent.get(H);
|
|
188
|
-
Z(!oe && !Te);
|
|
189
|
-
}
|
|
190
|
-
}, [o, a]);
|
|
191
|
-
const _ = q(Ze.debounce((H) => {
|
|
192
|
-
I?.(H);
|
|
193
|
-
}, m), [I, m]), [ne, ae] = U();
|
|
194
|
-
me(() => {
|
|
195
|
-
ae(t || o);
|
|
196
|
-
}, [t, o]);
|
|
197
|
-
const G = ee((H) => {
|
|
198
|
-
A && (A(H), _(H));
|
|
199
|
-
}, [A]), z = ee((H) => {
|
|
200
|
-
G(H ? new ht({ val: H.definition.val, adjs: H.definition.adjs }, D) : null);
|
|
201
|
-
}, [D]), Q = q((H) => {
|
|
202
|
-
H.ctrlKey && Z(!0);
|
|
203
|
-
}, []), ue = ee((H) => {
|
|
204
|
-
let oe = !1;
|
|
205
|
-
if (H) {
|
|
206
|
-
const Te = H.toString();
|
|
207
|
-
oe = !E.mapAllPresets.has(Te);
|
|
208
|
-
}
|
|
209
|
-
R?.(H, oe);
|
|
210
|
-
}, [R, E]), Le = ee((H) => {
|
|
211
|
-
const oe = H ? new ht({ val: H.definition.val, adjs: H.definition.adjs }, D) : null;
|
|
212
|
-
Promise.resolve(f?.()).then(() => {
|
|
213
|
-
ue(oe);
|
|
214
|
-
});
|
|
215
|
-
}, [D, f]), Fe = ee((H) => {
|
|
216
|
-
G(H ? new ht(H, D) : null);
|
|
217
|
-
}, [D]), Ae = W(() => window.EyeDropper === void 0 ? e(se, {}) : e(dt, { "aria-label": "eye dropper", size: "small", sx: { color: (H) => H.palette.text.icon ?? H.palette.action.active }, onClick: async () => {
|
|
218
|
-
O(!0), S?.(), await new EyeDropper().open().then((H) => {
|
|
219
|
-
O(!1), N?.();
|
|
220
|
-
let oe = new ht(H.sRGBHex), Te = oe.toString(), ge = E.mapAllPresets.get(Te);
|
|
221
|
-
if (ge || (Te = oe.toRGBA().toString(), ge = E.mapAllPresetsRGB.get(Te)), !ge) {
|
|
222
|
-
const fe = oe.toRGBA(), te = 3;
|
|
223
|
-
let ce = 255;
|
|
224
|
-
E.mapAllPresetsRGB.forEach((Me, xe) => {
|
|
225
|
-
const Ge = Me.toRGBA(), et = Math.abs(Ge.red - fe.red) + Math.abs(Ge.blue - fe.blue) + Math.abs(Ge.green - fe.green);
|
|
226
|
-
et < te && et < ce && (ge = Me);
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
Z(!ge), G(ge || oe);
|
|
230
|
-
}).catch((H) => {
|
|
231
|
-
O(!1), H?.name !== "AbortError" && console.error(H);
|
|
232
|
-
});
|
|
233
|
-
}, children: e(Dd, {}) }), [E, k]), Ye = W(() => {
|
|
234
|
-
if (!Y) return;
|
|
235
|
-
const H = { opacity: Y ? 1 : "0", position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", boxSizing: "border-box" };
|
|
236
|
-
return e(si, { fallback: e("div", { style: H, children: e(Lt, {}) }), children: e(sp, { style: H, selectedColor: M ? M.toRGBA().toString() : "transparent", onColorChange: Fe, disableAlpha: c }) });
|
|
237
|
-
}, [Y, M]), ve = W(() => ({ onClick: Q, alphaGrey: $.palette.text.icon ?? $.palette.action.active }), [Q, $]), je = W(() => {
|
|
238
|
-
if (!h) return null;
|
|
239
|
-
const H = { description: w, definition: { val: h.getVal(), adjs: h.getAdjustments() } };
|
|
240
|
-
return e(se, { children: j(di, { sx: { display: "flex", color: (oe) => oe.palette.text.secondary }, onMouseOver: () => {
|
|
241
|
-
z(null);
|
|
242
|
-
}, onClick: () => {
|
|
243
|
-
Le(null);
|
|
244
|
-
}, children: [e(B, { sx: { flex: "none", boxShadow: (oe) => oe.shadows[2], borderRadius: (oe) => oe.spacing(0.5), overflow: "hidden" }, children: e(fr, { schemeColorLookup: D, colorDef: H, selectedColor: o === null ? h : o, previewColor: t === null ? h : t, defaultButtonSize: s, isLarge: !0, darkMode: k, compareRGB: C, swatchProps: ve }) }), e(Be, { noWrap: !0, component: "div", style: { display: "flex", flex: "1 1 100%", marginLeft: "8px", userSelect: "none" }, children: w })] }) });
|
|
245
|
-
}, [h, w, D, o, t]);
|
|
246
|
-
return j(B, { ref: i, sx: { width: u, outline: "none", padding: "10px 10px", overflow: "hidden", boxSizing: "content-box" }, ...T, children: [j("div", { style: { position: "relative", display: "flex" }, children: [j("div", { style: { opacity: Y ? "0" : 1 }, children: [je && v === Eo.Start ? j(se, { children: [je, e(lo, { light: !0, style: { marginTop: "2px", marginBottom: "10px" } })] }) : null, e(jo, { title: "Theme Colors", schemeColorLookup: D, colorDefs: E.primaryColors, selectedColor: o, previewColor: t === void 0 ? o : t, swatchProps: ve, onPreviewColorDef: z, onSelectColorDef: Le, compareRGB: C, darkMode: k }), e(jo, { schemeColorLookup: D, colorDefs: E.modifiedPresets, selectedColor: o, previewColor: t === void 0 ? o : t, swatchProps: ve, onPreviewColorDef: z, onSelectColorDef: Le, compareRGB: C, darkMode: k }), e(lo, { light: !0, style: { marginBottom: "10px" } }), e(jo, { title: "Standard Colors", schemeColorLookup: D, colorDefs: E.standardColors, selectedColor: o, previewColor: t === void 0 ? o : t, swatchProps: ve, onPreviewColorDef: z, onSelectColorDef: Le, compareRGB: C, darkMode: k }), j("div", { style: { opacity: E.recentColorsLimited.length === 0 ? "0" : void 0, display: E.recentColorsLimited.length === 0 ? "none" : void 0 }, children: [e(lo, { light: !0, style: { marginBottom: "10px" } }), e(jo, { title: "Recent Colors", schemeColorLookup: D, colorDefs: E.recentColorsLimited, selectedColor: o, previewColor: t === void 0 ? o : t, swatchProps: ve, onPreviewColorDef: z, onSelectColorDef: Le, compareRGB: C, darkMode: k })] }), je && v === Eo.End ? j(se, { children: [e(lo, { light: !0, sx: { marginTop: "2px", marginBottom: "2px" } }), je, e("div", { style: { marginBottom: "2px" } })] }) : null] }), Ye] }), e(lo, { light: !0, style: { marginBottom: "10px" } }), j("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-around", gap: "8px", paddingLeft: "2px", paddingRight: "2px" }, children: [Ae, e("div", { style: { flex: "1 1 100%", background: "pink" } }), e(nn, { style: { minWidth: "75px", maxWidth: "75px" }, value: "check", variant: "outlined", size: "small", onClick: () => {
|
|
247
|
-
X();
|
|
248
|
-
}, children: e("div", Y ? { children: "Preset" } : { children: "Custom" }) }), e(nn, { variant: "contained", size: "small", style: { minWidth: "75px" }, onClick: () => {
|
|
249
|
-
Promise.resolve(f?.()).then(() => {
|
|
250
|
-
ue(ne);
|
|
251
|
-
});
|
|
252
|
-
}, children: "Done" })] })] });
|
|
253
|
-
})), dp = e(Ls, {}), Di = K(J((r, i) => {
|
|
254
|
-
const { selectedColor: o, quickColor: t, icon: n = dp, tooltip: l, label: c, onPreviewColor: m, onPreviewColorImmediate: a, onSelectColor: s, variant: u = nt.Toolbar, panelProps: d, shouldCloseFloatAll: f = !0, compareRGB: p = !1, darkMode: g = !1, ...y } = r, b = ee(m, [m]), x = ee(a, [a]), h = ee(s, [s]), [w, v] = U(() => {
|
|
255
|
-
}), C = t || w || o || d?.autoColor, k = Se(!1), T = q(() => {
|
|
256
|
-
}, []), M = ee(() => {
|
|
257
|
-
v(o);
|
|
258
|
-
}, [o]), I = ee((E) => {
|
|
259
|
-
k.current || (v(E), b?.(E));
|
|
260
|
-
}, [b]), A = ee((E) => {
|
|
261
|
-
k.current || (v(E), x?.(E));
|
|
262
|
-
}, [x]), R = ee((E, Y) => {
|
|
263
|
-
k.current || (v(void 0), h?.(E, Y));
|
|
264
|
-
}, [h]), S = W(() => e(B, { sx: { width: "24px", height: "24px", color: "inherit", "--sxl-color-active": `${C?.toCSS(g) ?? "transparent"}`, "& .activeColor": { fill: `${C?.toCSS(g) ?? "transparent"}` }, "& .style_grey": { fill: (E) => E.palette.text.icon ?? E.palette.action.active } }, children: typeof n == "function" ? n() : n }), [C, n, g]), N = ee((E) => {
|
|
265
|
-
h?.(t, !1);
|
|
266
|
-
}, [h, t]), [L, O] = U(!1), $ = q((E) => {
|
|
267
|
-
const { closeFloat: Y, closeFloatAll: Z } = E;
|
|
268
|
-
return e(cp, { ...d, selectedColor: o, previewColor: w, onDone: f ? Z : Y, onKeyDown: (X) => {
|
|
269
|
-
X.which === ye.Enter && (f ? Z() : Y());
|
|
270
|
-
}, onPreviewColorImmediate: A, onPreviewColor: I, onSelectColor: R, onEyeDropStart: () => O(!0), onEyeDropStop: () => O(!1), compareRGB: p, darkMode: g });
|
|
271
|
-
}, [o, w, f, C, d?.autoColor, g]), D = { onQuickClick: t ? N : void 0, createPopupPanel: $, popupProps: { popperProps: { resizeOnOverflow: !1 } }, onPopupOpen: M, onPopupClose: T, tooltip: l || c || "Color", label: c, icon: S, ...y };
|
|
272
|
-
return u === nt.Toolbar ? e(vt, { ref: i, ...D }) : e(sr, { ref: i, ...D });
|
|
273
|
-
})), tn = 82, ha = (r) => {
|
|
274
|
-
const { styleColor: i, length: o = tn, width: t = 1, dashArray: n = null, sx: l, isDouble: c = !1, isAngled: m = !1, darkMode: a = !1, ...s } = r;
|
|
275
|
-
return e(ar, { sx: { width: `${o}px`, height: `${t}px`, color: "inherit", overflow: "visible", "& .activeColor": { stroke: (u) => `${i ? i.toRGBA(a).toString() : u.palette.text.icon ?? u.palette.action.active}` }, "& .style_grey": { stroke: (u) => u.palette.text.icon ?? u.palette.action.active }, ...l }, height: t, width: o, viewBox: `0 0 ${o} ${t}`, ...s, children: e(zd, { length: o, width: t, dashArray: n, isDouble: c, isAngled: m, className: "activeColor" }) });
|
|
276
|
-
}, pp = K(J((r, i) => {
|
|
277
|
-
const { variant: o, showLabels: t = !1, disabled: n = !1, createPopupPanel: l, styleColor: c, selectedStyle: m, onSelectStyle: a, showNone: s = !0, darkMode: u, sx: d, ...f } = r, p = ee(a, []), g = q((h) => {
|
|
278
|
-
const { popupContainer: w, floatReference: v, closeFloat: C, ...k } = h, T = [], M = Ce.BuiltInDefinitionsArray;
|
|
279
|
-
for (let I = 0; I < M.length; I++) {
|
|
280
|
-
const A = M[I];
|
|
281
|
-
if (A.description === "None" && !s) continue;
|
|
282
|
-
const R = e(ha, { styleColor: c, length: tn, width: A.width, darkMode: u, dashArray: A.pattern, isDouble: A.description.toLowerCase().includes("double"), isAngled: A.description.toLowerCase().includes("slant") });
|
|
283
|
-
let S = null;
|
|
284
|
-
S = t ? j(se, { children: [e(B, { sx: { marginRight: "6px" }, children: A.description }), j(B, { sx: { marginLeft: "6px", marginRight: "6px", display: "flex", alignItems: "center", flex: "1 1 100%" }, children: [e("div", { style: { flex: "1 1 100%" } }), R] })] }) : A.description === "None" ? "None" : R, T.push(e(xt, { className: "border-stroke", tabIndex: 0, sx: { height: "28px", "& svg path.activeColor": { filter: Ur(4) }, paddingLeft: "16px", background: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})` }, tooltipProps: { description: t ? "" : A.description }, icon: null, disabled: n, onMouseDown: (N) => N.preventDefault(), onMouseUp: () => {
|
|
285
|
-
C(), p(A.style);
|
|
286
|
-
}, onKeyDown: (N) => {
|
|
287
|
-
N.which === ye.Enter && C();
|
|
288
|
-
}, selected: A.style === m, parentFloat: v, children: S }, I));
|
|
289
|
-
}
|
|
290
|
-
return e(B, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, children: T });
|
|
291
|
-
}, [n, s, c, m, u]), y = W(() => {
|
|
292
|
-
const h = Ce.BuiltInDefinitions.get(m);
|
|
293
|
-
let w;
|
|
294
|
-
return w = h.description === "None" ? e(B, { sx: { minWidth: `${tn}px` }, children: "None" }) : e(ha, { styleColor: c, length: tn, width: h.width, dashArray: h.pattern, darkMode: u, isDouble: h.description.toLowerCase().includes("double"), isAngled: h.description.toLowerCase().includes("slant") }), e(B, { className: "border-stroke", sx: { paddingLeft: "12px", marginLeft: "4px", marginRight: "4px", height: "24px", display: "flex", alignItems: "center", "& svg path.activeColor": { filter: Ur() } }, children: w });
|
|
295
|
-
}, [m, c]), b = W(() => Ce.BuiltInDefinitions.get(m), [m]), x = { disabled: n, icon: y, tooltip: "Border Style: " + b.description, sx: { background: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})`, ...d }, createPopupPanel: g, ...f };
|
|
296
|
-
return o === nt.Toolbar ? e(vt, { ...x }) : e(sr, { ...x });
|
|
297
|
-
})), up = K(J((r, i) => {
|
|
298
|
-
const { autoColor: o = null, schemeLookup: t, autoStrokeStyle: n = Ce.StrokeStyle.Thin, disabled: l = !1, darkMode: c = !1, showStylingBefore: m = !0, onSelectBorder: a, onPreviewBorder: s, selectedBorder: u, createTemporaryBorder: d, ...f } = r, p = ee(a, [a]), g = ee(s, [s]), [y, b] = U(), [x, h] = U(), w = y ?? n, v = x ?? o, C = u || { bottom: { style: n, color: o?.toString() } }, k = ee((S) => {
|
|
299
|
-
const N = {}, L = S ? Object.keys(S) : [];
|
|
300
|
-
let O = !1;
|
|
301
|
-
for (let ne = 0; ne < L.length; ne++) S[L[ne]]?.style && (N[L[ne]] = { style: S[L[ne]].style, color: S[L[ne]].color }, O || N[L[ne]].style === Ce.StrokeStyle.None || (O = !0));
|
|
302
|
-
L.length < 6 && (O = !0);
|
|
303
|
-
const $ = O ? N.left : null, D = O ? N.top : null, E = O ? N.right : null, Y = O ? N.bottom : null, Z = O ? N.vertical : null, X = O ? N.horizontal : null;
|
|
304
|
-
let _ = "";
|
|
305
|
-
return D || $ || (_ += "M 3,5 H 5 V 3 H 3 "), D || (_ += "M 7,5 H 9 V 3 H 7 "), D || Z || (_ += "M 11,5 h 2 V 3 h -2 "), D || (_ += "M 15,5 h 2 V 3 h -2 "), D || E || (_ += "M 19,5 h 2 V 3 h -2 "), $ || (_ += "M 3,9 H 5 V 7 H 3 "), Z || (_ += "M 11,9 h 2 V 7 h -2 "), E || (_ += "M 19,9 h 2 V 7 h -2 "), X || $ || (_ += "M 3,13 H 5 V 11 H 3 "), X || (_ += "M 7,13 H 9 V 11 H 7 "), X || Z || (_ += "M 11,13 h 2 v -2 h -2 "), X || E || (_ += "M 19,13 h 2 v -2 h -2 "), X || (_ += "M 15,13 h 2 v -2 h -2 "), $ || (_ += "M 3,17 H 5 V 15 H 3 "), Z || (_ += "M 11,17 h 2 v -2 h -2 "), E || (_ += "M 19,17 h 2 v -2 h -2 "), Y || $ || (_ += "M 3,21 H 5 V 19 H 3 "), Y || (_ += "M 7,21 H 9 V 19 H 7 "), Y || Z || (_ += "M 11,21 h 2 v -2 h -2 "), Y || (_ += "M 15,21 h 2 v -2 h -2 "), Y || E || (_ += "M 19,21 h 2 v -2 h -2 "), j("div", { style: { width: "24px", height: "24px", position: "relative" }, children: [e(ar, { sx: { position: "absolute", top: "0px", left: "0px", "& path": { opacity: "0.8", transform: "translate(-0.5px, -0.5px)" } }, children: e("path", { d: _ }) }), e(B, { sx: { width: "24px", height: "24px", display: "flex", alignItems: "center", justifyContent: "center", position: "absolute", top: "-1px", left: "-1px", "& svg path": { filter: Hs } }, children: e(gr, { getBorderAt: (ne, ae) => {
|
|
306
|
-
if (!d || L.length === 0) return null;
|
|
307
|
-
const G = ne.rowIndex, z = ne.colIndex, Q = {};
|
|
308
|
-
return G === 0 ? (Q.top = N.top, Q.bottom = N.horizontal) : (Q.top = N.horizontal, Q.bottom = N.bottom), z === 0 ? (Q.left = N.left, Q.right = N.vertical) : (Q.left = N.vertical, Q.right = N.right), d?.(Q);
|
|
309
|
-
}, width: 18, height: 18, darkMode: c, style: { top: "0px", left: "0px", width: "18px", height: "18px", minWidth: "18px", minHeight: "18px", position: "relative" } }) })] });
|
|
310
|
-
}, [v, w, c]), T = q((S, N, L) => {
|
|
311
|
-
let O = null;
|
|
312
|
-
if (S && S.length > 0) {
|
|
313
|
-
let $ = null;
|
|
314
|
-
(N || L) && ($ = { style: L, color: N?.toString() ?? null }), O = {};
|
|
315
|
-
for (let D = 0; D < S.length; D++) O[S[D]] = $;
|
|
316
|
-
}
|
|
317
|
-
return O;
|
|
318
|
-
}, []), M = q((S) => {
|
|
319
|
-
p?.(S);
|
|
320
|
-
}, []), I = q((S) => {
|
|
321
|
-
g?.(S);
|
|
322
|
-
}, []), A = q((S) => {
|
|
323
|
-
const { closeFloatAll: N, floatReference: L } = S, O = (E, Y, Z = "bottom", X = !1) => {
|
|
324
|
-
const _ = T(E, v ?? null, X ? Ce.StrokeStyle.None : w ?? null), ne = X ? T([], v ?? null, w ?? null) : _;
|
|
325
|
-
return e(ft, { icon: k(ne), sx: { background: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})` }, tooltipProps: { label: Y, simple: !0, placement: Z }, onClick: () => {
|
|
326
|
-
N(), I(_), M(_);
|
|
327
|
-
} });
|
|
328
|
-
}, $ = j(se, { children: [j(B, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [O([Ce.Edge.Left, Ce.Edge.Top, Ce.Edge.Right, Ce.Edge.Bottom, Ce.Edge.Horizontal, Ce.Edge.Vertical], "All Borders", "top"), O([Ce.Edge.Horizontal, Ce.Edge.Vertical], "Inner Borders", "top"), O([Ce.Edge.Horizontal], "Inside Horizontal Borders", "top"), O([Ce.Edge.Vertical], "Inside Vertical Borders", "top"), O([Ce.Edge.Left, Ce.Edge.Top, Ce.Edge.Right, Ce.Edge.Bottom], "Outside Borders", "top")] }), j(B, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [O([Ce.Edge.Left], "Left Borders"), O([Ce.Edge.Top], "Top Borders"), O([Ce.Edge.Right], "Right Borders"), O([Ce.Edge.Bottom], "Bottom Borders"), O([Ce.Edge.Left, Ce.Edge.Top, Ce.Edge.Right, Ce.Edge.Bottom, Ce.Edge.Horizontal, Ce.Edge.Vertical, Ce.Edge.DiagonalUp, Ce.Edge.DiagonalDown], "No Borders", "bottom", !0)] })] }), D = e(se, { children: j(B, { sx: { display: "flex", padding: "6px 16px", flexDirection: "row", gap: "6px" }, children: [e(Di, { variant: nt.Toolbar, icon: e(cr, {}), selectedColor: w === Ce.StrokeStyle.None ? new ht("transparent") : v, onPreviewColor: (E) => {
|
|
329
|
-
h(E);
|
|
330
|
-
}, onSelectColor: (E, Y) => {
|
|
331
|
-
h(E);
|
|
332
|
-
}, darkMode: c, tooltip: "Border Color", panelProps: { disableAlpha: !0, autoColor: o, schemeLookup: t }, disabled: l || w === Ce.StrokeStyle.None, parentFloat: L, shouldCloseFloatAll: !1 }), e(pp, { selectedStyle: w, onSelectStyle: b, styleColor: v, darkMode: c, variant: nt.Toolbar, parentFloat: L })] }) });
|
|
333
|
-
return j(B, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, onClick: (E) => E.stopPropagation(), children: [m ? D : $, e(re, { orientation: "horizontal" }), m ? $ : D] });
|
|
334
|
-
}, [w, v, o, t, c]), R = W(() => k(C), [C, c]);
|
|
335
|
-
return e(vt, { ref: i, createPopupPanel: A, popupProps: { popperProps: { resizeOnOverflow: !1 } }, createTooltip: ({ children: S }, N) => e(rt, { label: "Borders", description: "Set the borders.", disabled: N, children: S }), onQuickClick: () => {
|
|
336
|
-
p?.(C);
|
|
337
|
-
}, quickButtonProps: { sx: {} }, disabled: l, icon: R, ...f });
|
|
338
|
-
})), mp = K(J((r, i) => {
|
|
339
|
-
const { commands: o, command: t, commandHook: n, variant: l = ie.Toolbar, disabled: c = !1, autoColor: m, autoStrokeStyle: a, schemeLookup: s, createTemporaryBorder: u, selectedBorder: d, onSelectBorder: f, darkMode: p, icon: g, label: y, ...b } = r, x = We(o, ["formatBorder"]), h = t ?? x[0], w = h?.context() ?? null, v = w?.autoColor ?? m, C = w?.autoStyle ?? a, k = d ?? w?.quickBorder, T = p ?? w?.darkMode, M = u ?? w?.createTemporaryBorder, I = s ?? w?.schemeLookup, A = ee((S) => {
|
|
340
|
-
w?.onBorderSelect && w.onBorderSelect(S), f?.(S), h?.execute(S, n);
|
|
341
|
-
}, [h, f, n]), R = q((S, N) => {
|
|
342
|
-
const { children: L, title: O, ...$ } = S;
|
|
343
|
-
let D = S.children;
|
|
344
|
-
return (h?.disabled() || c) && (D = e("div", { children: D })), e(dr, { command: h, placement: l === ie.Toolbar ? "bottom-start" : "right-start", disabled: N, ...$, children: D });
|
|
345
|
-
}, [h, c]);
|
|
346
|
-
return e(up, { ref: i, autoColor: v, darkMode: T, autoStrokeStyle: C, createTemporaryBorder: M, schemeLookup: I, selectedBorder: k, onSelectBorder: A, createTooltip: R, disabled: c || !h || h.disabled(), ...b });
|
|
347
|
-
})), gp = K(J((r, i) => {
|
|
348
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = q((a, s) => {
|
|
349
|
-
const u = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, d = j(se, { children: [e(F, { ...u, command: s.getCommand("mergeToggle"), icon: P(e(qr, {})) }), e(F, { ...u, command: s.getCommand("mergeHorizontal"), icon: P(e(zs, {})) }), e(F, { ...u, command: s.getCommand("mergeVertical"), icon: P(e(Ws, {})) }), e(re, { orientation: "horizontal" }), e(F, { ...u, command: s.getCommand("unmerge"), icon: P(e(ui, {})) })] });
|
|
350
|
-
return ke({ ...a, children: d });
|
|
351
|
-
}, [l, t, n]);
|
|
352
|
-
return e(Re, { ref: i, commands: o, quickCommand: "mergeToggle", commandHook: t, scope: n, tooltip: "Combine or split cells.", createPopupPanel: m, icon: P(e(qr, {})), ...c });
|
|
353
|
-
})), hp = K(J((r, i) => {
|
|
354
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = q((a, s) => {
|
|
355
|
-
const u = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, d = j(se, { children: [e(F, { ...u, command: s.getCommand("freezeToggle"), icon: P(e(js, {})) }), e(F, { ...u, command: s.getCommand("freezeToggleHorizontal"), icon: P(e(Vs, {})) }), e(F, { ...u, command: s.getCommand("freezeToggleVertical"), icon: P(e($s, {})) }), e(re, { orientation: "horizontal" }), e(F, { ...u, command: s.getCommand("unfreeze"), icon: e(ui, {}) })] });
|
|
356
|
-
return ke({ ...a, children: d });
|
|
357
|
-
}, [l, t, n]);
|
|
358
|
-
return e(Re, { ref: i, commands: o, commandHook: t, createPopupPanel: m, 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: e(_s, {}), ...c });
|
|
359
|
-
})), fp = K(J((r, i) => {
|
|
360
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = q((a, s) => {
|
|
361
|
-
const u = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, d = j(se, { children: [e(F, { ...u, command: s.getCommand("find"), icon: P(e(Gr, {})) }), e(F, { ...u, command: s.getCommand("findReplace"), icon: P(e(Us, {})) }), e(F, { ...u, command: s.getCommand("goto"), icon: P(e(qs, {})) })] });
|
|
362
|
-
return ke({ ...a, children: d });
|
|
363
|
-
}, [l, t, n]);
|
|
364
|
-
return e(Re, { ref: i, commands: o, commandHook: t, createPopupPanel: m, label: "Find & Select", tooltip: "Find and replace cells or go to a specific location.", quickCommand: "find", icon: P(e(Gr, {})), ...c });
|
|
365
|
-
})), xp = K(J((r, i) => {
|
|
366
|
-
const { command: o, commandHook: t, showQuickButtons: n = !!r.commands, commands: l, fontSizes: c = Wd.DefaultFontSizes, disabled: m = !1, parentFloat: a, icon: s, label: u, sx: d, ...f } = r;
|
|
367
|
-
Ht(o);
|
|
368
|
-
const p = () => o?.state()?.toString() || "11", [g, y] = U(p), b = ee(() => {
|
|
369
|
-
const M = parseFloat(g);
|
|
370
|
-
isNaN(M) ? y(p()) : parseFloat(p()) !== M && o.execute(M, t);
|
|
371
|
-
}, [p, o, g, t]);
|
|
372
|
-
me(() => {
|
|
373
|
-
y(p());
|
|
374
|
-
}, [o?.state()]);
|
|
375
|
-
const x = W(() => {
|
|
376
|
-
if (!t) return null;
|
|
377
|
-
const M = { ...t };
|
|
378
|
-
return delete M.beforeExecute, M;
|
|
379
|
-
}, [t]), h = We(l, ["formatFontSizeIncrease", "formatFontSizeDecrease"]), w = W(() => h ? j(B, { className: Oe("quick-buttons", {}), sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (M) => M.stopPropagation(), children: [e(F, { command: h[0], commandHook: x, icon: P(e(Gs, {})) }), e(F, { command: h[1], icon: P(e(Xs, {})) })] }) : null, [h]), v = at(), C = W(() => `${Bt.getSharedMeasurer()("12.3", Math.round(v.typography.fontSize), v.typography.fontFamily).width}px`, [v]), k = q((M) => {
|
|
380
|
-
const { onMouseDown: I, onMouseUp: A, ...R } = M;
|
|
381
|
-
return e(dt, { component: "div", ...R, disableRipple: !0, children: e(ir, { inputMode: "numeric", disabled: m || !o || o.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: (S) => `1px solid ${S.palette.text.icon ?? S.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (S) => `1px solid ${S.palette.error.main}` }, "::after": { borderBottom: (S) => `1px solid ${S.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", paddingLeft: "0px", paddingRight: "0px", fontSize: (S) => `${Math.round(S.typography.fontSize)}px`, width: C, color: (S) => S.palette.text.secondary, input: { padding: "0 0", textAlign: "center", MozAppearance: "textfield", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (S) => S.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (S) => S.palette.text.primary } }, "input::-webkit-inner-spin-button": { WebkitAppearance: "none", margin: "0" }, minHeight: "24px" }, value: g, onFocus: (S) => {
|
|
382
|
-
S.target?.select();
|
|
383
|
-
}, onKeyDown: (S) => {
|
|
384
|
-
if (S.which === ye.Enter) p() !== g && (S.stopPropagation(), S.preventDefault(), b());
|
|
385
|
-
else if (S.which === ye.Escape) p() !== g && (y(p()), setTimeout(() => {
|
|
386
|
-
S.target?.select();
|
|
387
|
-
}, 0), S.stopPropagation(), S.preventDefault());
|
|
388
|
-
else {
|
|
389
|
-
if (S.key.match("[-]") || S.key.match("[0-9.]") && (g + S.key).length > 4) return S.stopPropagation(), void S.preventDefault();
|
|
390
|
-
if (S.which === ye.Space) return void S.preventDefault();
|
|
391
|
-
}
|
|
392
|
-
}, onBlur: () => {
|
|
393
|
-
b();
|
|
394
|
-
}, onChange: (S) => {
|
|
395
|
-
if (S.target.value.length > 4) return S.stopPropagation(), void S.preventDefault();
|
|
396
|
-
y(S.target.value);
|
|
397
|
-
} }) });
|
|
398
|
-
}, [g, m, o]), T = q((M) => {
|
|
399
|
-
const I = (N) => {
|
|
400
|
-
o?.execute(N, t);
|
|
401
|
-
}, A = o?.state(), R = [];
|
|
402
|
-
for (let N = 0; N < c.length; N++) {
|
|
403
|
-
const L = c[N] === A;
|
|
404
|
-
R.push(e(xt, { selected: L, icon: L ? e(sn, {}) : void 0, disabled: m || !o || o.disabled(), onMouseDown: (O) => {
|
|
405
|
-
O.button === 0 && O.preventDefault();
|
|
406
|
-
}, onMouseUp: (O) => {
|
|
407
|
-
O.button === 0 && I(c[N]);
|
|
408
|
-
}, onKeyDown: (O) => {
|
|
409
|
-
O.keyCode !== ye.Enter && O.keyCode !== ye.Space || I(c[N]);
|
|
410
|
-
}, sx: { paddingTop: "4px", paddingBottom: "4px" }, children: e(B, { sx: { display: "flex", flex: "1 1 100%", justifyContent: "end" }, children: c[N] }) }, "fontSize-" + N));
|
|
411
|
-
}
|
|
412
|
-
const S = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...f, children: [w, e(re, { orientation: "horizontal" }), e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: R })] });
|
|
413
|
-
return ke({ ...M, children: S });
|
|
414
|
-
}, [m, o?.state(), t]);
|
|
415
|
-
return e(vt, { ref: i, sx: { ...d }, tabIndex: -1, outlined: !0, disabled: m, parentFloat: a, createPopupPanel: T, createTooltip: ({ children: M }, I) => e(rt, { label: o?.label(), description: o?.description(), disabled: I || o?.disabled(), children: M }), createQuickButton: k, ...f });
|
|
416
|
-
})), fa = K((r) => {
|
|
417
|
-
const { selected: i, disabled: o, formattedValue: t, handleSetFormat: n, format: l, sx: c, ...m } = r;
|
|
418
|
-
return e(xt, { sx: { maxWidth: "360px", display: "flex", "*": { lineHeight: "1.2" }, ...c }, disabled: o, selected: i, icon: i ? e(sn, {}) : void 0, onMouseDown: (a) => {
|
|
419
|
-
a.button === 0 && a.preventDefault();
|
|
420
|
-
}, onMouseUp: (a) => {
|
|
421
|
-
a.button === 0 && n(l.numberFormat);
|
|
422
|
-
}, onKeyDown: (a) => {
|
|
423
|
-
a.keyCode !== ye.Enter && a.keyCode !== ye.Space || n(l.numberFormat);
|
|
424
|
-
}, ...m, children: j(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [j(Be, { component: "div", children: [l.formatType, l.formatType === mt.Type.Custom ? "…" : ""] }), e(Be, { variant: "caption", component: "div", sx: { color: (a) => Qe(a.palette.text.primary, 0.6), paddingTop: t && t.length > 0 ? "1px" : void 0, overflow: "hidden", textOverflow: "ellipsis" }, children: t && t.length > 0 ? t : " " })] }) });
|
|
425
|
-
}), bp = K(J((r, i) => {
|
|
426
|
-
const { commands: o, commandHook: t, scope: n, sx: l, disabled: c = !1, parentFloat: m, ...a } = r, s = We(o, ["formatNumberFormat"])[0], u = s?.state() ? mt.Styles.lookupStyle(s?.state()).formatType : mt.Type.General, d = W(() => {
|
|
427
|
-
if (!t) return null;
|
|
428
|
-
const y = { ...t };
|
|
429
|
-
return delete y.beforeExecute, y;
|
|
430
|
-
}, [t]), f = q((y, b) => {
|
|
431
|
-
const x = (A) => {
|
|
432
|
-
t?.beforeExecute?.(s, s?.state()), s.execute(A, t), t?.onExecute?.(s, s?.state());
|
|
433
|
-
}, h = s?.context()(), w = mt.Styles.lookupPrimary(), v = [];
|
|
434
|
-
for (let A = 0; A < w.length; A++) {
|
|
435
|
-
let R = "";
|
|
436
|
-
if (h && !h.isEmpty()) try {
|
|
437
|
-
R = h.getNumberFormat(w[A].numberFormat).displayText;
|
|
438
|
-
} catch (N) {
|
|
439
|
-
console.warn(N);
|
|
440
|
-
}
|
|
441
|
-
R === "" && w[A].formatType === mt.Type.General && (R = "No specific format");
|
|
442
|
-
const S = w[A].formatType === u;
|
|
443
|
-
v.push(e(fa, { selected: S, disabled: c || !s || s.disabled(), formattedValue: R, handleSetFormat: x, format: w[A] }, w[A].formatType));
|
|
444
|
-
}
|
|
445
|
-
const C = { numberFormat: "", formatType: mt.Type.Custom }, k = u === mt.Type.Custom, T = e(fa, { selected: k, disabled: c || !s || s.disabled(), formattedValue: k ? h.getNumberFormat().displayText : "", handleSetFormat: () => {
|
|
446
|
-
t?.beforeExecute?.(s, s?.state()), b.getCommand("formatNumberDialog")?.execute(s?.state()), t?.onExecute?.(s, s?.state());
|
|
447
|
-
}, format: C, sx: { flex: "0", width: "100%" } }, mt.Type.Custom), M = j(B, { className: "quick-buttons", sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (A) => A.stopPropagation(), children: [e(F, { command: b.getCommand("formatNumberFormatAccountingStyle"), commandHook: d, scope: n, icon: e(Ks, {}) }), e(F, { command: b.getCommand("formatNumberFormatPercentStyle"), commandHook: d, scope: n, icon: e(Ys, {}) }), e(F, { command: b.getCommand("formatNumberFormatCommaStyle"), commandHook: d, scope: n, icon: e(Zs, {}) }), e(F, { command: b.getCommand("formatNumberFormatIncreaseDecimal"), commandHook: d, scope: n, icon: P(e(Js, {})) }), e(F, { command: b.getCommand("formatNumberFormatDecreaseDecimal"), commandHook: d, scope: n, icon: P(e(Qs, {})) })] }), I = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...a, children: [M, e(re, { orientation: "horizontal" }), e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: v }), e(re, { orientation: "horizontal" }), T] });
|
|
448
|
-
return ke({ ...y, children: I });
|
|
449
|
-
}, [s?.context(), s?.state(), t, n]), p = at(), g = W(() => {
|
|
450
|
-
const y = mt.Type.MediumTime;
|
|
451
|
-
return `${Bt.getSharedMeasurer()(y, Math.round(p.typography.fontSize), p.typography.fontFamily).width}px`;
|
|
452
|
-
}, [p]);
|
|
453
|
-
return e(Re, { ref: i, commands: o, sx: l, outlined: !0, disabled: c, parentFloat: m, createPopupPanel: f, createTooltip: ({ children: y }, b) => e(rt, { label: s?.label(), description: s?.description(), disabled: b, children: y }), icon: e(B, { sx: { display: "flex", paddingLeft: "4px", paddingRight: "4px", fontSize: (y) => `${Math.round(y.typography.fontSize)}px`, color: (y) => y.palette.text.secondary, fontFamily: (y) => y.typography.fontFamily, width: g }, children: e(B, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: u }) }), ...a });
|
|
454
|
-
})), Pi = K(J((r, i) => {
|
|
455
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = q((a, s) => {
|
|
456
|
-
const u = { variant: ie.Menuitem, commandHook: t, scope: "clear", disabled: l }, d = j(se, { children: [e(F, { ...u, command: s.getCommand("clearAll"), icon: e(Xr, {}) }), e(F, { ...u, command: s.getCommand("clearFormats"), icon: P(e(mi, {})) }), e(F, { ...u, command: s.getCommand("clearContents"), icon: P(e(ec, {})) }), e(F, { ...u, command: s.getCommand("clearComments") }), e(F, { ...u, command: s.getCommand("clearHyperlinks") })] });
|
|
457
|
-
return ke({ ...a, children: d });
|
|
458
|
-
}, [l, t, n]);
|
|
459
|
-
return e(Re, { ref: i, commands: o, disabled: l, commandHook: t, scope: n, label: "Clear", tooltip: "Clear everything in the cell, or remove just the formatting or contents.", createPopupPanel: m, icon: e(Xr, {}), ...c });
|
|
460
|
-
})), yp = K(J((r, i) => {
|
|
461
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = q((a, s) => {
|
|
462
|
-
const u = { variant: ie.Menuitem, commandHook: t, scope: "fill", disabled: l }, d = j(se, { children: [e(F, { ...u, command: s.getCommand("fillDown"), icon: P(e(so, {})) }), e(F, { ...u, command: s.getCommand("fillRight"), icon: P(e(so, { sx: { transform: "rotate(270deg)" } })) }), e(F, { ...u, command: s.getCommand("fillUp"), icon: P(e(so, { sx: { transform: "rotate(180deg)" } })) }), e(F, { ...u, command: s.getCommand("fillLeft"), icon: P(e(so, { sx: { transform: "rotate(90deg)" } })) })] });
|
|
463
|
-
return ke({ ...a, children: d });
|
|
464
|
-
}, [l, t, n]);
|
|
465
|
-
return e(Re, { ref: i, commands: o, disabled: l, commandHook: t, label: "Fill", tooltip: "Fill the selected cells with the value from one of the corners.", createPopupPanel: m, icon: P(e(so, {})), ...c });
|
|
466
|
-
})), Ri = K(J((r, i) => {
|
|
467
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, disableSheet: c = !1, preferSingleMenu: m = !0, showQuickButton: a = !0, variant: s = ie.Toolbar, ...u } = r, d = ["insertCellsShiftDown", "insertCellsShiftRight", "insertRows", "insertColumns"], f = We(o, d), { singleCommand: p, allDisabled: g } = W(() => {
|
|
468
|
-
let x = null, h = 0;
|
|
469
|
-
for (let w = 0; w < f.length; w++) f[w] && !f[w]?.disabled() && (m && s === ie.Menuitem && (x = h === 0 ? f[w] : null), h++);
|
|
470
|
-
return { singleCommand: x, allDisabled: h === 0 };
|
|
471
|
-
}, [f]), y = W(() => {
|
|
472
|
-
const x = /* @__PURE__ */ new Map();
|
|
473
|
-
return x.set("insertCellsShiftDown", P(e(Kr, {}))), x.set("insertCellsShiftRight", P(e(Kr, { sx: { transform: "rotate(270deg)" } }))), x.set("insertRows", P(e(tc, {}))), x.set("insertColumns", P(e(Yr, {}))), x;
|
|
474
|
-
}, []), b = q((x, h) => {
|
|
475
|
-
let w = null;
|
|
476
|
-
const v = { variant: ie.Menuitem, commandHook: t, scope: "insertCells", disabled: l };
|
|
477
|
-
c || (w = j(se, { children: [e(re, { orientation: "horizontal" }), e(F, { ...v, command: h.getCommand("addSheet"), icon: P(e(rn, {})) })] }));
|
|
478
|
-
const C = j(se, { children: [e(F, { ...v, command: f[0], icon: y.get(d[0]) }), e(F, { ...v, command: f[1], icon: y.get(d[1]) }), e(re, { orientation: "horizontal" }), e(F, { ...v, command: f[2], icon: y.get(d[2]) }), e(F, { ...v, command: f[3], icon: y.get(d[3]) }), w] });
|
|
479
|
-
return ke({ ...x, children: C });
|
|
480
|
-
}, [l, f, t, n, y]);
|
|
481
|
-
return p ? e(F, { ref: i, variant: s, commandHook: t, disabled: l, command: p, icon: y.get(p.key()), ...u }) : e(Re, { ref: i, variant: s, quickCommand: "insertCells", commands: o, commandHook: t, scope: n, disabled: l || g, tooltip: j(se, { children: [e("span", { children: "Insert new cells, rows or columns to your workbook." }), e("br", {}), e("span", { children: "To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert." })] }), createPopupPanel: b, icon: P(e(Yr, {})), ...u });
|
|
482
|
-
})), Mi = K(J((r, i) => {
|
|
483
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, disableSheet: c = !1, preferSingleMenu: m = !0, showQuickButton: a = !0, variant: s = ie.Toolbar, ...u } = r, d = We(o, ["deleteCellsShiftUp", "deleteCellsShiftLeft", "deleteRows", "deleteColumns"]), { singleCommand: f, allDisabled: p } = W(() => {
|
|
484
|
-
let b = null, x = 0;
|
|
485
|
-
for (let h = 0; h < d.length; h++) d[h] && !d[h]?.disabled() && (m && s === ie.Menuitem && (b = x === 0 ? d[h] : null), x++);
|
|
486
|
-
return { singleCommand: b, allDisabled: x === 0 };
|
|
487
|
-
}, [d]), g = W(() => {
|
|
488
|
-
const b = /* @__PURE__ */ new Map();
|
|
489
|
-
return b.set("deleteCellsShiftUp", P(e(Zr, { sx: { transform: "rotate(0deg)" } }))), b.set("deleteCellsShiftLeft", P(e(Zr, { sx: { transform: "rotate(270deg)" } }))), b.set("deleteRows", P(e(oc, {}))), b.set("deleteColumns", P(e(Jr, {}))), b;
|
|
490
|
-
}, []), y = q((b, x) => {
|
|
491
|
-
const h = { variant: ie.Menuitem, commandHook: t, scope: "deleteCells", disabled: l };
|
|
492
|
-
let w = null;
|
|
493
|
-
c || (w = j(se, { children: [e(re, { orientation: "horizontal" }), e(F, { ...h, command: x.getCommand("deleteSheet"), icon: P(e(rn, {})) })] }));
|
|
494
|
-
const v = j(se, { children: [e(F, { ...h, command: x.getCommand("deleteCellsShiftUp"), icon: g.get("deleteCellsShiftUp") }), e(F, { ...h, command: x.getCommand("deleteCellsShiftLeft"), icon: g.get("deleteCellsShiftLeft") }), e(re, { orientation: "horizontal" }), e(F, { ...h, command: x.getCommand("deleteRows"), icon: g.get("deleteRows") }), e(F, { ...h, command: x.getCommand("deleteColumns"), icon: g.get("deleteColumns") }), w] });
|
|
495
|
-
return ke({ ...b, children: v });
|
|
496
|
-
}, [l, t, n, g]);
|
|
497
|
-
return f ? e(F, { ref: i, variant: s, commandHook: t, disabled: l, command: f, icon: g.get(f.key()), ...u }) : e(Re, { ref: i, variant: s, quickCommand: "deleteCells", commands: o, commandHook: t, scope: n, disabled: l || p, tooltip: j(se, { children: [e("span", { children: "Delete cells, rows, columns or sheets from your workbook." }), e("br", {}), e("span", { children: "To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete." })] }), createPopupPanel: y, icon: P(e(Jr, {})), ...u });
|
|
498
|
-
})), Mo = K(J((r, i) => {
|
|
499
|
-
const { command: o, commandHook: t, onSelectColor: n, disabled: l = !1, variant: c = ie.Toolbar, quickColor: m, panelProps: a, isSplit: s = !1, darkMode: u, icon: d, ...f } = r, { autoColor: p, schemeLookup: g, recentColors: y, ...b } = a;
|
|
500
|
-
if (f.selectedColor) throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");
|
|
501
|
-
Ht(o);
|
|
502
|
-
const x = o?.context();
|
|
503
|
-
let h = m ?? x?.quickColor;
|
|
504
|
-
s && !h && (h = new ht("transparent"));
|
|
505
|
-
const w = p ?? x?.autoColor, v = g ?? x?.schemeLookup, C = y ?? x?.recentColors, k = u ?? x?.darkMode, T = W(() => ({ autoColor: w, schemeLookup: v, recentColors: C, darkMode: k, ...b }), [w, v, C, k]), M = ee((A, R) => {
|
|
506
|
-
A && R && x?.addRecentColor && x.addRecentColor(A), x?.onColorSelect && x.onColorSelect(A), n?.(A, R), o?.execute(A, t);
|
|
507
|
-
}, [o, n, t, x]), I = q((A, R) => {
|
|
508
|
-
const { children: S, title: N, ...L } = A;
|
|
509
|
-
let O = A.children;
|
|
510
|
-
return (o?.disabled() || l) && (O = e("div", { children: O })), e(dr, { command: o, placement: c === ie.Toolbar ? "bottom-start" : "right-start", disabled: R, ...L, children: O });
|
|
511
|
-
}, [o, l]);
|
|
512
|
-
return e(Di, { ref: i, panelProps: T, icon: d, quickColor: h, selectedColor: o?.state(), onSelectColor: M, variant: c === ie.Menuitem ? nt.Menuitem : nt.Toolbar, createTooltip: I, label: o?.label(), disabled: l || !o || o.disabled(), compareRGB: !0, darkMode: k, ...f });
|
|
513
|
-
}));
|
|
514
|
-
Mo.displayName = "ColorCommandButton";
|
|
515
|
-
const wp = K(J((r, i) => {
|
|
516
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, parentFloat: c, ...m } = r, a = We(o, ["gridlinesToggle", "sheetViewToggleGridlinesColumns", "sheetViewToggleGridlinesRows"]), s = q((u, d) => {
|
|
517
|
-
const f = { variant: ie.Menuitem, parentFloat: u.floatReference, commandHook: t, scope: n, disabled: l }, p = j(se, { children: [e(F, { ...f, command: d.getCommand("gridlinesToggle") }), e(Mo, { ...f, command: d.getCommand("sheetViewFormatGridlinesColor"), icon: e(cr, {}), panelProps: { disableAlpha: !0 } }), e(re, { orientation: "horizontal" }), e(F, { ...f, command: d.getCommand("sheetViewToggleGridlinesColumns") }), e(F, { ...f, command: d.getCommand("sheetViewToggleGridlinesRows") })] });
|
|
518
|
-
return ke({ ...u, children: p });
|
|
519
|
-
}, [l, t]);
|
|
520
|
-
return e(Re, { ref: i, parentFloat: c, quickCommand: a[0]?.key(), commands: o, commandHook: t, createPopupPanel: s, label: "Gridlines", tooltip: "Configure how the lines between rows and columns in the sheet are displayed.", icon: e(eo, { command: a[0], scope: "view" }), ...m });
|
|
521
|
-
})), Ni = K(J((r, i) => {
|
|
522
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = q((a, s) => {
|
|
523
|
-
const u = { variant: ie.Menuitem, commandHook: t, scope: "sort", disabled: l }, d = s.getCommand("sortCustom"), f = j(se, { children: [e(F, { ...u, command: s.getCommand("sortAscending"), icon: P(e(Vn, {})) }), e(F, { ...u, command: s.getCommand("sortDescending"), icon: P(e(gi, {})) }), d ? e(F, { ...u, command: d, icon: P(e(nc, {})) }) : null, e(re, { orientation: "horizontal" }), e(F, { ...u, scope: "filter", command: s.getCommand("autoFilterToggle"), icon: P(e($n, {})) }), e(F, { ...u, scope: "filter", command: s.getCommand("autoFilterClear"), icon: P(e(pr, {})) }), e(F, { ...u, scope: "filter", command: s.getCommand("autoFilterReapply"), icon: P(e(hi, {})) })] });
|
|
524
|
-
return ke({ ...a, children: f });
|
|
525
|
-
}, [l, t, n]);
|
|
526
|
-
return e(Re, { ref: i, commands: o, commandHook: t, scope: n, disabled: l, label: "Sort", tooltip: j(se, { children: [e("span", { children: "Organize your data so it's easier to analyze." }), e("br", {}), e("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), createPopupPanel: m, icon: P(e(Vn, {})), ...c });
|
|
527
|
-
})), wm = K(J((r, i) => {
|
|
528
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = q((a, s) => {
|
|
529
|
-
const u = { variant: ie.Menuitem, commandHook: t, scope: "sort", disabled: l }, d = j(se, { children: [e(F, { ...u, scope: "filter", command: s.getCommand("autoFilterToggle"), icon: P(e($n, {})) }), e(F, { ...u, scope: "filter", command: s.getCommand("autoFilterClear"), icon: P(e(pr, {})) }), e(F, { ...u, scope: "filter", command: s.getCommand("autoFilterReapply"), icon: P(e(hi, {})) })] });
|
|
530
|
-
return ke({ ...a, children: d });
|
|
531
|
-
}, [l, t, n]);
|
|
532
|
-
return e(Re, { ref: i, commands: o, commandHook: t, scope: n, disabled: l, label: "Filter", tooltip: j(se, { children: [e("span", { children: "Organize your data so it's easier to analyze." }), e("br", {}), e("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), createPopupPanel: m, icon: P(e($n, {})), ...c });
|
|
533
|
-
})), Ii = K(J((r, i) => {
|
|
534
|
-
const { quickCommand: o, icon: t, isRedo: n = !1, nestRedo: l = !0, undoManager: c, scope: m, sx: a, disabled: s, commands: u, ...d } = r, f = [o];
|
|
535
|
-
!n && l && f.push("redo");
|
|
536
|
-
const p = We(u, f), g = p[0], y = p[1], b = c ?? g?.context?.()?.undoManager;
|
|
537
|
-
let x = s;
|
|
538
|
-
s || (x = !g || g.disabled(), y && !y.disabled() && (x = !1));
|
|
539
|
-
const [h, w] = U(0), v = q((C, k) => {
|
|
540
|
-
let T = h === 0 ? "Cancel" : `${g.label()} ${h} Action${h === 1 ? "" : "s"}`, M = !1;
|
|
541
|
-
b || (M = !0), M || (M = l ? !b.hasRedo() && !b.hasUndo() : !b.hasRedo());
|
|
542
|
-
const I = (O) => {
|
|
543
|
-
g.execute(O);
|
|
544
|
-
}, A = e(xt, { sx: { display: "flex", flex: "none", alignItems: "center", justifyContent: "center", padding: M ? void 0 : "0 0", minWidth: "180px" }, icon: null, onMouseEnter: () => {
|
|
545
|
-
w(0);
|
|
546
|
-
}, onMouseDown: (O) => {
|
|
547
|
-
O.button === 0 && O.preventDefault();
|
|
548
|
-
}, onMouseUp: (O) => {
|
|
549
|
-
O.button === 0 && I(h);
|
|
550
|
-
}, onKeyDown: (O) => {
|
|
551
|
-
O.isDefaultPrevented() || O.keyCode !== ye.Enter && O.keyCode !== ye.Space || I(h);
|
|
552
|
-
}, children: e(Be, { component: "div", variant: "caption", sx: { fontSize: "0.875rem", letterSpacing: "0.01071em" }, children: T }) });
|
|
553
|
-
if (M) return A;
|
|
554
|
-
const R = n ? b?.getRedoDescriptions() : b?.getUndoDescriptions(), S = [];
|
|
555
|
-
for (let O = 0; O < R.length; O++) {
|
|
556
|
-
const $ = R[O];
|
|
557
|
-
S.push(e(xt, { sx: { maxWidth: "360px", display: "flex" }, icon: e(rn, {}), disabled: x, selected: O < h, onMouseEnter: () => {
|
|
558
|
-
w(O + 1);
|
|
559
|
-
}, onMouseDown: (D) => {
|
|
560
|
-
D.button === 0 && D.preventDefault();
|
|
561
|
-
}, onMouseUp: (D) => {
|
|
562
|
-
D.button === 0 && I(O + 1);
|
|
563
|
-
}, onKeyDown: (D) => {
|
|
564
|
-
D.isDefaultPrevented() || D.keyCode !== ye.Enter && D.keyCode !== ye.Space || I(O + 1);
|
|
565
|
-
}, children: j(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", alignItems: "center", overflow: "hidden" }, children: [e(Be, { component: "div", children: $ }), e(rn, {})] }) }, `action:${O}`));
|
|
566
|
-
}
|
|
567
|
-
let N = null;
|
|
568
|
-
if (!n && l) {
|
|
569
|
-
const O = { scope: "undo", commands: k, variant: ie.Menuitem, parentFloat: C.floatReference };
|
|
570
|
-
N = [], N.push(e(Ii, { ...O, quickCommand: "redo", isRedo: !0 }, "nested:redo")), b.hasRedo() && b.hasUndo() && N.push(e(re, { orientation: "horizontal" }, "action:redo-div"));
|
|
571
|
-
}
|
|
572
|
-
const L = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, onClick: () => {
|
|
573
|
-
C.closeFloatAll();
|
|
574
|
-
}, onMouseLeave: () => {
|
|
575
|
-
w(0);
|
|
576
|
-
}, children: [N, e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: S }), e(re, { orientation: "horizontal" }), A] });
|
|
577
|
-
return ke({ ...C, children: L });
|
|
578
|
-
}, [g?.context(), g?.state(), m, b, h, x]);
|
|
579
|
-
return e(Re, { ref: i, commands: u, quickCommand: o, scope: m, disabled: x, label: g?.label() ?? (n ? "Redo" : "Undo"), tooltip: e(se, { children: e("span", { children: `${g?.label() ?? "No"} last actions.` }) }), createPopupPanel: v, icon: t ?? P(e(n ? rc : ac, {})), selected: !1, ...d });
|
|
580
|
-
})), Qt = ls.getFontList(), Fi = /* @__PURE__ */ new Map();
|
|
581
|
-
for (let r = 0; r < Qt.length; r++) Fi.set(Qt[r].fontRef.getFamily(), Qt[r]);
|
|
582
|
-
const Sp = K(J((r, i) => {
|
|
583
|
-
const { command: o, commandHook: t, sx: n, disabled: l = !1, parentFloat: c, icon: m, label: a, ...s } = r;
|
|
584
|
-
Ht(o);
|
|
585
|
-
const u = o?.state(), d = at(), f = W(() => `${Bt.getSharedMeasurer()("Times New Roman", Math.round(d.typography.fontSize), d.typography.fontFamily).width}px`, [d]), p = q((g) => {
|
|
586
|
-
const y = (w) => {
|
|
587
|
-
o?.execute(w, t);
|
|
588
|
-
}, b = [];
|
|
589
|
-
for (let w = 0; w < Qt.length; w++) b.push({ key: Qt[w].fontRef.getFamily(), description: Qt[w].fontRef.getFamily() });
|
|
590
|
-
Fi.get(u) || b.unshift({ key: u, description: u });
|
|
591
|
-
const x = [];
|
|
592
|
-
for (let w = 0; w < b.length; w++) {
|
|
593
|
-
const v = b[w].key === u;
|
|
594
|
-
x.push(e(xt, { sx: { display: "flex", paddingTop: "4px", paddingBottom: "4px" }, selected: v, disabled: l || !o || o.disabled(), icon: v ? e(sn, {}) : void 0, onMouseUp: (C) => {
|
|
595
|
-
C.button === 0 && y(b[w].key);
|
|
596
|
-
}, onMouseDown: (C) => {
|
|
597
|
-
C.button === 0 && C.preventDefault();
|
|
598
|
-
}, onKeyDown: (C) => {
|
|
599
|
-
C.keyCode !== ye.Enter && C.keyCode !== ye.Space || y(b[w].key);
|
|
600
|
-
}, children: e(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: e(Be, { component: "div", sx: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", fontFamily: () => b[w]?.key }, children: b[w].description }) }) }, w + "" + b[w].key));
|
|
601
|
-
}
|
|
602
|
-
const h = e(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%" }, ...s, children: e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: x }) });
|
|
603
|
-
return ke({ ...g, children: h });
|
|
604
|
-
}, [l, o?.state()]);
|
|
605
|
-
return e(vt, { ref: i, sx: { ...n }, outlined: !0, disabled: l, parentFloat: c, createPopupPanel: p, createTooltip: ({ children: g }, y) => e(rt, { label: o?.label(), description: o?.description(), disabled: y, children: g }), icon: e(B, { sx: { display: "flex", paddingLeft: "4px", paddingRight: "4px", fontSize: (g) => `${Math.round(g.typography.fontSize)}px`, fontFamily: (g) => g.typography.fontFamily, color: (g) => g.palette.text.secondary, width: f }, children: e(B, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: u }) }), ...s });
|
|
606
|
-
})), vp = K(J((r, i) => {
|
|
607
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = We(o, ["formatStrikeThroughToggle", "formatSuperscriptToggle", "formatSubscriptToggle"]), a = W(() => {
|
|
608
|
-
for (let d = 0; d < m.length; d++) if (m[d]?.state()) return m[d].key();
|
|
609
|
-
return m[0]?.key();
|
|
610
|
-
}, [m]), s = W(() => {
|
|
611
|
-
const d = /* @__PURE__ */ new Map();
|
|
612
|
-
return d.set("formatStrikeThroughToggle", P(e(Qr, {}))), d.set("formatSuperscriptToggle", P(e(ic, {}))), d.set("formatSubscriptToggle", P(e(lc, {}))), d;
|
|
613
|
-
}, []), u = q((d, f) => {
|
|
614
|
-
const p = { variant: ie.Menuitem, commandHook: t, scope: "textEffects", disabled: l }, g = j(se, { children: [e(F, { ...p, command: f.getCommand("formatStrikeThroughToggle"), icon: s.get("formatStrikeThroughToggle") }), e(F, { ...p, command: f.getCommand("formatSuperscriptToggle"), icon: s.get("formatSuperscriptToggle") }), e(F, { ...p, command: f.getCommand("formatSubscriptToggle"), icon: s.get("formatSubscriptToggle") })] });
|
|
615
|
-
return ke({ ...d, children: g });
|
|
616
|
-
}, [l, t, n]);
|
|
617
|
-
return e(Re, { ref: i, quickCommand: a, commands: o, commandHook: t, createPopupPanel: u, label: "Text Effects", tooltip: "Style your text to differentiate it.", icon: s.get(a) ?? P(e(Qr, {})), ...c });
|
|
618
|
-
})), Cp = K(J((r, i) => {
|
|
619
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = We(o, ["formatUnderlinedToggle", "formatUnderlinedDoubleToggle", "formatUnderlinedAccountingToggle", "formatUnderlinedAccountingDoubleToggle"]), a = W(() => {
|
|
620
|
-
for (let d = 0; d < m.length; d++) if (m[d]?.state()) return m[d].key();
|
|
621
|
-
return m[0]?.key();
|
|
622
|
-
}, [m]), s = W(() => {
|
|
623
|
-
const d = /* @__PURE__ */ new Map();
|
|
624
|
-
return d.set("formatUnderlinedToggle", P(e(Tn, {}))), d.set("formatUnderlinedDoubleToggle", P(e(ea, {}))), d.set("formatUnderlinedAccountingToggle", P(e(ta, {}))), d.set("formatUnderlinedAccountingDoubleToggle", P(e(oa, {}))), d;
|
|
625
|
-
}, []), u = q((d, f) => {
|
|
626
|
-
const p = { variant: ie.Menuitem, commandHook: t, scope: "underline", disabled: l }, g = j(se, { children: [e(F, { ...p, command: f.getCommand("formatUnderlinedToggle"), icon: P(e(Tn, {})) }), e(F, { ...p, command: f.getCommand("formatUnderlinedDoubleToggle"), icon: P(e(ea, {})) }), e(F, { ...p, command: f.getCommand("formatUnderlinedAccountingToggle"), commandHook: t, icon: P(e(ta, {})) }), e(F, { ...p, command: f.getCommand("formatUnderlinedAccountingDoubleToggle"), icon: P(e(oa, {})) })] });
|
|
627
|
-
return ke({ ...d, children: g });
|
|
628
|
-
}, [l, t, n]);
|
|
629
|
-
return e(Re, { ref: i, quickCommand: a, commands: o, commandHook: t, label: "Underline", tooltip: "All underline stylings.", createPopupPanel: u, icon: s.get(a) ?? P(e(Tn, {})), ...c });
|
|
630
|
-
})), Oi = K(J((r, i) => {
|
|
631
|
-
const { command: o, commands: t, commandHook: n, scope: l, includePasteAllInPopup: c = !0, disabled: m = !1, ...a } = r, s = ee((u, d) => {
|
|
632
|
-
const f = { variant: ie.Menuitem, commandHook: n, scope: "paste", disabled: m }, p = [];
|
|
633
|
-
return c && (p.push(Pe(F, { ...f, command: d.getCommand("paste"), key: "paste", icon: e(na, {}) })), p.push(e(re, { orientation: "horizontal" }, "paste-div"))), p.push(Pe(F, { ...f, command: d.getCommand("pasteValues"), key: "pasteValues", icon: P(e(sc, {})) })), p.push(Pe(F, { ...f, command: d.getCommand("pasteFormats"), key: "pasteFormats", icon: P(e(cc, {})) })), p.push(Pe(F, { ...f, command: d.getCommand("pasteFormulas"), key: "pasteFormulas", icon: P(e(dc, {})) })), p.push(Pe(F, { ...f, command: d.getCommand("pasteTranspose"), key: "pasteTranspose", icon: P(e(pc, {})) })), p.push(Pe(F, { ...f, command: d.getCommand("pasteLinks"), key: "pasteLinks", icon: P(e(uc, {})) })), ke({ ...u, children: p });
|
|
634
|
-
}, [m, n, l, c]);
|
|
635
|
-
return e(Re, { ref: i, commands: t, commandHook: n, scope: l, createPopupPanel: s, label: "Paste", tooltip: "Add content to the clipboard to your document.", quickCommand: "paste", icon: e(na, {}), ...a });
|
|
636
|
-
})), kp = K(J((r, i) => {
|
|
637
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, parentFloat: c, ...m } = r, a = We(o, ["sheetViewToggleShowHeadings", "sheetViewToggleShowHeadingColumns", "sheetViewToggleShowHeadingRows"]), s = q((u, d) => {
|
|
638
|
-
const f = { variant: ie.Menuitem, parentFloat: u.floatReference, commandHook: t, scope: n, disabled: l }, p = j(se, { children: [e(F, { ...f, command: d.getCommand("sheetViewToggleShowHeadings") }), e(F, { ...f, command: d.getCommand("sheetViewToggleShowHeadingsNumeric") }), e(re, { orientation: "horizontal" }), e(F, { ...f, command: d.getCommand("sheetViewToggleShowHeadingColumns") }), e(F, { ...f, command: d.getCommand("sheetViewToggleShowHeadingRows") })] });
|
|
639
|
-
return ke({ ...u, children: p });
|
|
640
|
-
}, [l, t, n]);
|
|
641
|
-
return e(Re, { ref: i, parentFloat: c, quickCommand: a[0]?.key(), commands: o, commandHook: t, createPopupPanel: s, label: "Headings", tooltip: "Configure how the column and rows headings in the sheet are displayed.", icon: e(eo, { command: a[0], scope: "view" }), ...m });
|
|
642
|
-
})), Tp = K(J((r, i) => {
|
|
643
|
-
const { commands: o, commandHook: t, scope: n = "view", disabled: l = !1, ...c } = r, m = q((a) => {
|
|
644
|
-
const s = { variant: ie.Menuitem, parentFloat: a.floatReference, commandHook: t, scope: n, disabled: l }, u = j(se, { children: [e(F, { ...s, command: o.getCommand("workbookViewToggleShowFormulaBar") }), e(F, { ...s, command: o.getCommand("workbookViewToggleShowTabs") }), e(F, { ...s, command: o.getCommand("workbookViewToggleShowStatusBar") }), e(re, { orientation: "horizontal" }), e(F, { ...s, command: o.getCommand("workbookViewToggleShowHorizontalScrollBar") }), e(F, { ...s, command: o.getCommand("workbookViewToggleShowVerticalScrollBar") })] });
|
|
645
|
-
return ke({ ...a, children: u });
|
|
646
|
-
}, [l, o, t, n]);
|
|
647
|
-
return e(Re, { ref: i, commands: o, disabled: l, commandHook: t, scope: n, label: "Workbook View", tooltip: "Options to configure how the workbook is displayed.", createPopupPanel: m, icon: e(eo, { icon: null, label: "Workbook View" }), ...c });
|
|
648
|
-
})), Ai = K(J((r, i) => {
|
|
649
|
-
const { value: o, cellStyle: t, styles: n, createTemporaryCell: l, bodyStyle: c, sx: m, borderProps: a, disabled: s, ...u } = r, d = W(() => l({ value: o, style: t }), [o, t, l]), f = W(() => d.getStyle(), [d, c]), p = W(() => f.getFill().toCSS(c?.darkMode ?? !1), [f]), g = f.getInsets(), y = f.getFont(), b = q(() => f.getBorder(), [f]);
|
|
650
|
-
return e(B, { ref: i, sx: { width: "100px", textOverflow: "ellipsis", display: "flex", alignItems: "stretch", background: c?.fill, filter: s ? "grayscale(0.4) opacity(0.8);" : "none", "& .fill": { flex: "1 1 100%", overflow: "hidden", ...p }, "& .text": { flex: "1 1 100%", ...y.toCSS(c?.darkMode ?? !1, 1), boxSizing: "border-box", padding: `${g.top}px ${g.right}px ${g.bottom}px ${g.left}px`, margin: "0px", outline: "none", resize: "none", overflow: "hidden", textOverflow: "ellipsis", verticalAlign: "baseline", textDecoration: y.toCSS().textDecoration, textAlign: ss.toCSSHorizontalTextAlign(d.getRenderHorizontalAlignment()), background: "transparent", maxHeight: "100%", whiteSpace: "pre", wordWrap: "break-word" }, ...m }, ...u, children: e(gr, { getBorderAt: b, darkMode: c?.darkMode ?? !1, rowCount: 1, columnCount: 1, style: { display: "flex", flex: "1 1 100%", width: "100%", maxWidth: "100%", justifyContent: "start", alignItems: "stretch", ...a?.style }, ...a, children: e(B, { className: "fill", sx: { paddingLeft: "4px", paddingRight: "4px", marginLeft: "-1px", marginTop: "-1px", marginRight: "-1px", marginBottom: "-1px", overflow: "hidden", display: "flex", alignItems: "center" }, children: e(B, { className: "text", children: o }) }) }) });
|
|
651
|
-
})), Ep = K((r) => {
|
|
652
|
-
const { styles: i, namedStyle: o, selectedNamed: t, hasContextMenu: n = !0, bodyStyle: l, onSelectNamed: c, createTemporaryCell: m, parentFloat: a, commands: s, disabled: u, commandHook: d, ...f } = r, p = q((b) => {
|
|
653
|
-
const x = { variant: ie.Menuitem, commandHook: d, context: "cellStyle" }, h = j(se, { children: [e(F, { ...x, sx: { fontWeight: 550 }, command: s.getCommand("formatCellStyle"), commandState: o, disabled: u, icon: P(e(Ro, {})) }), e(re, { orientation: "horizontal" }), e(F, { ...x, command: s.getCommand("modifyCellStyle"), commandState: { named: o } }), e(F, { ...x, command: s.getCommand("deleteCellStyle"), commandState: o, disabled: u || o?.getName() === pe.BuiltInName.Normal })] });
|
|
654
|
-
return ke({ ...b, children: e(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: h }) }) });
|
|
655
|
-
}, []), g = o?.getName() === t?.getName();
|
|
656
|
-
let y = e(ft, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (b) => `solid ${g ? b.palette.primary.dark : "transparent"} 1px` }, tooltipProps: { label: o.getName(), placement: "bottom-start" }, disabled: u, icon: null, onClick: () => {
|
|
657
|
-
c?.(o);
|
|
658
|
-
}, ...f, children: e(Ai, { value: o.getName(), cellStyle: { named: o.getName() }, styles: i, createTemporaryCell: m, bodyStyle: l }) }, o.getName());
|
|
659
|
-
return n && (y = e(fi, { label: o.getName(), parentFloat: a, createPopupPanel: p, children: y })), y;
|
|
660
|
-
}), Dp = K(J((r, i) => {
|
|
661
|
-
const { commands: o, command: t, commandHook: n, selectedNamed: l, onSelectNamed: c, disabled: m = !1, bodyStyle: a, usePreviewIcon: s = !0, ...u } = r;
|
|
662
|
-
Ht(t);
|
|
663
|
-
const d = t?.context(), f = d?.styles, p = l ?? d?.named(), g = a ?? d?.bodyStyle(), y = ee((v) => {
|
|
664
|
-
c?.(v), t?.execute(v, n);
|
|
665
|
-
}, [t, c, n]), b = q((v, C) => {
|
|
666
|
-
const k = { onSelectNamed: y, styles: f(), parentFloat: v.floatReference }, T = f().getCustomNamed(), M = /* @__PURE__ */ new Map(), I = [];
|
|
667
|
-
for (let D = 0; D < T.length; D++) M.set(T[D].getName(), T[D]), f().getNamed(T[D].getName()).getBuiltInID() === null && I.push(T[D].getName());
|
|
668
|
-
const A = (D) => {
|
|
669
|
-
let E = M.get(D);
|
|
670
|
-
return E || (E = f().getNamed(D)), !E || E.isHidden() ? null : e(Ep, { namedStyle: E, selectedNamed: p, bodyStyle: d.bodyStyle(), createTemporaryCell: d.createTemporaryCell, commands: o, commandHook: n, ...k }, D);
|
|
671
|
-
}, R = (D, E, Y = !0) => {
|
|
672
|
-
const Z = [];
|
|
673
|
-
for (let X = 0; X < E.length; X++) {
|
|
674
|
-
const _ = A(E[X]);
|
|
675
|
-
_ && Z.push(_);
|
|
676
|
-
}
|
|
677
|
-
return Z.length === 0 ? null : j(B, { children: [Y ? e(re, { orientation: "horizontal" }) : null, e(to, { children: D }, D + "-header"), e(B, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", width: "646px", maxWidth: "100%" }, children: Z }, D + "-presets")] }, D);
|
|
678
|
-
}, S = (D, E) => {
|
|
679
|
-
const Y = [];
|
|
680
|
-
for (let Z = 0; Z < E.length; Z++) {
|
|
681
|
-
const X = A(E[Z]);
|
|
682
|
-
X && Y.push(X);
|
|
683
|
-
}
|
|
684
|
-
return Y.length === 0 ? null : e(B, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", flexDirection: "column", flex: "0 0 0%" }, children: Y }, D + "-presets");
|
|
685
|
-
}, N = [];
|
|
686
|
-
N.push(R("Custom", I, !1)), N.push(R("Good, Bad and Neutral", [pe.BuiltInName.Normal, pe.BuiltInName.Bad, pe.BuiltInName.Good, pe.BuiltInName.Neutral], I.length > 0)), N.push(R("Data and Model", [pe.BuiltInName.Calculation, pe.BuiltInName.CheckCell, pe.BuiltInName.ExplanatoryText, pe.BuiltInName.FollowedHyperlink, pe.BuiltInName.Hyperlink, pe.BuiltInName.Input, pe.BuiltInName.LinkedCell, pe.BuiltInName.Note, pe.BuiltInName.Output, pe.BuiltInName.WarningText])), N.push(R("Titles and Headings", [pe.BuiltInName.Heading1, pe.BuiltInName.Heading2, pe.BuiltInName.Heading3, pe.BuiltInName.Heading4, pe.BuiltInName.Title, pe.BuiltInName.Total]));
|
|
687
|
-
let L = [];
|
|
688
|
-
var O, $;
|
|
689
|
-
return L.push(S("Accent 1", [pe.BuiltInName.Accent1_20, pe.BuiltInName.Accent1_40, pe.BuiltInName.Accent1_60, pe.BuiltInName.Accent1])), L.push(S("Accent 2", [pe.BuiltInName.Accent2_20, pe.BuiltInName.Accent2_40, pe.BuiltInName.Accent2_60, pe.BuiltInName.Accent2])), L.push(S("Accent 3", [pe.BuiltInName.Accent3_20, pe.BuiltInName.Accent3_40, pe.BuiltInName.Accent3_60, pe.BuiltInName.Accent3])), L.push(S("Accent 4", [pe.BuiltInName.Accent4_20, pe.BuiltInName.Accent4_40, pe.BuiltInName.Accent4_60, pe.BuiltInName.Accent4])), L.push(S("Accent 5", [pe.BuiltInName.Accent5_20, pe.BuiltInName.Accent5_40, pe.BuiltInName.Accent5_60, pe.BuiltInName.Accent5])), L.push(S("Accent 6", [pe.BuiltInName.Accent6_20, pe.BuiltInName.Accent6_40, pe.BuiltInName.Accent6_60, pe.BuiltInName.Accent6])), N.push((O = "Themed Cell Styles", $ = L, j(B, { children: [e(re, { orientation: "horizontal" }), e(to, { children: O }, O + "-header"), e(B, { sx: { display: "flex", gap: "2px", flexWrap: "wrap", alignItems: "start", flexDirection: "row" }, children: $ }, O + "-presets")] }, O))), N.push(R("Number Format", [pe.BuiltInName.Comma, pe.BuiltInName.Comma0, pe.BuiltInName.Currency, pe.BuiltInName.Currency0, pe.BuiltInName.Percent])), j(B, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", paddingTop: (D) => `${D.shape.borderRadius}px`, paddingBottom: (D) => `${D.shape.borderRadius}px` }, children: [e(B, { onContextMenu: () => {
|
|
690
|
-
}, sx: { display: "flex", flexDirection: "column", paddingTop: "6px", paddingBottom: "0px", paddingLeft: "16px", paddingRight: "16px" }, children: N }), e(re, { orientation: "horizontal" }), e(F, { variant: ie.Menuitem, commandState: p, command: C.getCommand("newCellStyle"), context: "styles", commandHook: n, disabled: m, icon: P(e(mc, {})) })] });
|
|
691
|
-
}, [p, f?.().getTheme(), g]), x = ee((v) => {
|
|
692
|
-
const C = 18 / Bt.getDeviceScale(), k = d?.createTemporaryCell(v);
|
|
693
|
-
return k.getStyle().getFont().getSize() <= C ? k : k.createTemporaryCell({ style: { font: { size: C } } });
|
|
694
|
-
}, [d?.createTemporaryCell]), h = m || !t || t.disabled(), w = W(() => d && s ? e(Ai, { value: p?.getName() ?? "Custom", cellStyle: p ? { named: p.getName() } : void 0, styles: d.styles(), createTemporaryCell: x, bodyStyle: d.bodyStyle(), className: "outline-hover", disabled: h, sx: { maxHeight: "24px", height: "24px", marginRight: "2px", outline: (v) => `1px solid ${v.palette.action.hover}` }, borderProps: {} }) : P(e(Ro, {})), [p, g, h]);
|
|
695
|
-
return e(Re, { ref: i, createPopupPanel: b, outlined: s, commands: o, createTooltip: ({ children: v }, C) => e(rt, { label: t?.label(), description: t?.description(), disabled: C, children: v }), selected: !1, disabled: h, label: t?.label(), icon: w, ...u });
|
|
696
|
-
})), Bi = "_sheetxl-reset_ods65_1", Pp = 10, Rp = K(J((r, i) => {
|
|
697
|
-
const { styles: o, table: t, tableStyle: n = t?.getStyle() ?? o.getDefaultTableStyle(), bodyStyle: l, sx: c, disabled: m, className: a, forceThinBorder: s, cellHeight: u = Pp, isLive: d = !1, ...f } = r, p = Math.ceil(1.3 * u), [g, y] = rr((v) => v + 1, 0);
|
|
698
|
-
me(() => {
|
|
699
|
-
if (d && t) return t.addListeners({ onAnyChange: () => {
|
|
700
|
-
y();
|
|
701
|
-
} });
|
|
702
|
-
}, [t, d]);
|
|
703
|
-
const b = W(() => {
|
|
704
|
-
let v = t?.toJSON() ?? {};
|
|
705
|
-
const C = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
706
|
-
return v && (v.styleOptions = { ...v.styleOptions, name: n.getName() }), v.ref = C, new or({ initialAnchor: C, json: v, styles: o });
|
|
707
|
-
}, [g, t, n, o]), x = W(() => {
|
|
708
|
-
const v = [];
|
|
709
|
-
for (let C = 0; C < 5; C++) for (let k = 0; k < 5; k++) {
|
|
710
|
-
const T = b.getStyleAt({ colIndex: k, rowIndex: C });
|
|
711
|
-
v.push(T);
|
|
712
|
-
}
|
|
713
|
-
return v;
|
|
714
|
-
}, [b]), h = W(() => {
|
|
715
|
-
const v = (k, T, M) => {
|
|
716
|
-
let I = M.getFill().toCSS(l?.darkMode ?? !1);
|
|
717
|
-
const A = p - (T < 4 ? 1 : 0), R = u - (k < 4 ? 1 : 0), S = M.getFont().getFill().toCSS(l?.darkMode ?? !1);
|
|
718
|
-
return I = { ...I, position: "absolute", boxSizing: "border-box", left: T * (p - 1), top: k * (u - 1), width: A, height: R }, e("td", { className: `table-style-fill ${k}-${T}`, style: I, children: e("div", { className: `table-style-text ${k}-${T}`, style: { position: "absolute", boxSizing: "border-box", width: "6px", left: (A - 6) / 2, top: (R - 1) / 2, borderTop: `1px solid ${S}` } }) }, `${k}-${T}`);
|
|
719
|
-
}, C = [];
|
|
720
|
-
for (let k = 0; k < 5; k++) {
|
|
721
|
-
const T = [];
|
|
722
|
-
for (let M = 0; M < 5; M++) {
|
|
723
|
-
const I = x[5 * k + M];
|
|
724
|
-
T.push(v(k, M, I));
|
|
725
|
-
}
|
|
726
|
-
C.push(e("tr", { children: T }, k));
|
|
727
|
-
}
|
|
728
|
-
return C;
|
|
729
|
-
}, [b, n, l]), w = q((v, C) => x[C].getBorder() ?? null, [x]);
|
|
730
|
-
return e(B, { ref: i, className: "table-format-preview", sx: { background: l?.fill, filter: m ? "grayscale(0.4) opacity(0.8);" : "none", "& .styled-element": { position: "absolute" }, ...c }, ...f, children: e(gr, { getBorderAt: w, rowCount: 5, columnCount: 5, forceThinBorder: s, width: 5 * (p - 1) + 1, height: 5 * (u - 1) + 1, darkMode: l?.darkMode ?? !1, style: { pointerEvents: "none" }, children: e("table", { className: Oe(a, "sheetxl-table-preview", Bi), style: { borderCollapse: "collapse", width: 5 * (p - 1) + 1, height: 5 * (u - 1) + 1 }, children: e("tbody", { children: h }) }) }) });
|
|
731
|
-
})), po = (r, i, o, t, n) => {
|
|
732
|
-
r.beginPath(), r.moveTo(i + 0.5, o + 0.5), r.lineTo(t + 0.5, n + 0.5), r.stroke();
|
|
733
|
-
}, Mp = K(J((r, i) => {
|
|
734
|
-
const { table: o, tableStyle: t, styles: n, bodyStyle: l, disabled: c, style: m, className: a, canvas: s, ...u } = r, d = W(() => {
|
|
735
|
-
const g = o.toJSON(), y = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
736
|
-
return g.styleOptions = { ...g.styleOptions, name: t.getName() }, g.ref = y, new or({ initialAnchor: y, json: g, styles: n });
|
|
737
|
-
}, [o, t, n]), f = W(() => {
|
|
738
|
-
const g = [];
|
|
739
|
-
for (let y = 0; y < 5; y++) for (let b = 0; b < 5; b++) {
|
|
740
|
-
const x = d.getStyleAt({ colIndex: b, rowIndex: y });
|
|
741
|
-
g.push(x);
|
|
742
|
-
}
|
|
743
|
-
return g;
|
|
744
|
-
}, [d]), p = W(() => {
|
|
745
|
-
let g = s;
|
|
746
|
-
if (s || (g = document.createElement("canvas")), !g) return null;
|
|
747
|
-
g.width !== 61 && (g.width = 61), g.height !== 46 && (g.height = 46);
|
|
748
|
-
const y = g.getContext("2d", { alpha: !1 });
|
|
749
|
-
if (!y) return null;
|
|
750
|
-
const b = 12, x = l?.darkMode ?? !1;
|
|
751
|
-
for (let h = 0; h < 5; h++) for (let w = 0; w < 5; w++) {
|
|
752
|
-
const v = f[5 * h + w].getFill();
|
|
753
|
-
let C = l?.fill;
|
|
754
|
-
v.getType() === kn.Type.Solid ? C = v.getColor().toCSS(x, !1) : v.getType() === kn.Type.Gradient ? C = v.getStops[0]?.color.toCSS(x, !1) : v.getType() === kn.Type.Pattern && (C = v.getForeground().toCSS(x, !1)), y.fillStyle = C;
|
|
755
|
-
const k = w * b, T = 9 * h;
|
|
756
|
-
y.fillRect(k, T, 13, 10);
|
|
757
|
-
}
|
|
758
|
-
y.lineWidth = 1;
|
|
759
|
-
for (let h = 0; h < 5; h++) for (let w = 0; w < 5; w++) {
|
|
760
|
-
const v = f[5 * h + w], C = w * b, k = 9 * h, T = v.getBorder();
|
|
761
|
-
if (!T.isEmpty()) {
|
|
762
|
-
const A = T.getLeft();
|
|
763
|
-
A.isNone() || (y.strokeStyle = A.getColor().toCSS(x, !1), po(y, C, k, C, k + 9));
|
|
764
|
-
const R = T.getTop();
|
|
765
|
-
R.isNone() || (y.strokeStyle = R.getColor().toCSS(x, !1), po(y, C, k, C + b, 9 * h));
|
|
766
|
-
const S = T.getRight();
|
|
767
|
-
S.isNone() || (y.strokeStyle = S.getColor().toCSS(x, !1), po(y, C + b, k, C + b, k + 9));
|
|
768
|
-
const N = T.getBottom();
|
|
769
|
-
N.isNone() || (y.strokeStyle = N.getColor().toCSS(x, !1), po(y, C, k + 9, C + b, k + 9));
|
|
770
|
-
}
|
|
771
|
-
y.strokeStyle = v.getFont().getFill().toCSS(x, !1);
|
|
772
|
-
const M = 4, I = 2.5;
|
|
773
|
-
po(y, w * b + I, 9 * h + M, w * b + I + 7, 9 * h + M);
|
|
774
|
-
}
|
|
775
|
-
return `url(${g.toDataURL()})`;
|
|
776
|
-
}, [s, d, t, l]);
|
|
777
|
-
return e("div", { ref: i, className: Oe("table-style-preview", a), style: { backgroundImage: p, width: 61, height: 46, ...m }, ...u });
|
|
778
|
-
})), Sm = K(J((r, i) => {
|
|
779
|
-
const { styleOptions: o, onStyleOptionsChange: t, showHeaderRow: n, onShowHeaderRowChange: l, showTotalRow: c, onShowTotalRowChange: m, showFilterButton: a, onShowFilterButtonChange: s, sx: u, disabled: d, ...f } = r;
|
|
780
|
-
return j(B, { sx: { display: "flex", flexDirection: "column", flexWrap: "wrap", userSelect: "none", pt: 1, pb: 1, "& .MuiFormControlLabel-root": { marginLeft: (p) => `${p.spacing(2)}`, marginRight: (p) => `${p.spacing(2)}` }, "& .MuiCheckbox-root": { padding: (p) => `${p.spacing(0.5)}` }, ...u }, ...f, ref: i, children: [l && e(Et, { control: e(Dt, { checked: n ?? !1, indeterminate: n == null, onChange: () => l(!n), disabled: d || n == null }), label: "Header Row", labelPlacement: "end" }), m && e(Et, { control: e(Dt, { checked: c ?? !1, indeterminate: c == null, onChange: () => m(!c), disabled: d || c == null }), label: "Total Row", labelPlacement: "end" }), e(Et, { control: e(Dt, { checked: o?.showRowStripes ?? !1, indeterminate: !o, disabled: d || !o, onChange: () => {
|
|
781
|
-
t?.({ ...o, showRowStripes: !o?.showRowStripes });
|
|
782
|
-
} }), label: "Banded Rows", labelPlacement: "end" }), e(Et, { control: e(Dt, { checked: o?.showFirstColumn ?? !1, indeterminate: !o, disabled: d || !o, onChange: () => {
|
|
783
|
-
t?.({ ...o, showFirstColumn: !o?.showFirstColumn });
|
|
784
|
-
} }), label: "First Column", labelPlacement: "end" }), e(Et, { control: e(Dt, { checked: o?.showLastColumn ?? !1, indeterminate: !o, disabled: d || !o, onChange: () => {
|
|
785
|
-
t?.({ ...o, showLastColumn: !o?.showLastColumn });
|
|
786
|
-
} }), label: "Last Column", labelPlacement: "end" }), e(Et, { control: e(Dt, { checked: o?.showColumnStripes ?? !1, indeterminate: !o, disabled: d || !o, onChange: () => {
|
|
787
|
-
t?.({ ...o, showColumnStripes: !o?.showColumnStripes });
|
|
788
|
-
} }), label: "Banded Columns", labelPlacement: "end" }), s && e(Et, { control: e(Dt, { checked: a ?? !1, indeterminate: a == null, disabled: d || !o || a == null, onChange: () => s(!a) }), label: "Filter Button", labelPlacement: "end" })] });
|
|
789
|
-
})), Np = K((r) => {
|
|
790
|
-
const { table: i, tableStyle: o, selectedTableStyleName: t, onSelectTableStyleName: n, styles: l, hasContextMenu: c = !0, bodyStyle: m, parentFloat: a, commands: s, disabled: u, commandHook: d, useCanvasPreview: f = !0, canvas: p, ...g } = r, y = q((w) => {
|
|
791
|
-
const v = { variant: ie.Menuitem, commandHook: d, context: "table" }, C = j(se, { children: [e(F, { ...v, command: s.getCommand("formatTableStyleClearCellStyles"), commandState: o, disabled: u, icon: P(e(Ro, {})) }), e(F, { ...v, sx: { fontWeight: 550 }, command: s.getCommand("formatTableStyle"), commandState: { name: o.getName() }, disabled: u, icon: P(e(Ro, {})) }), e(re, { orientation: "horizontal" }), e(F, { ...v, command: s.getCommand("setDefaultTableStyle"), commandState: o.getName(), disabled: u }), e(re, { orientation: "horizontal" }), e(F, { ...v, command: s.getCommand("deleteTableStyle"), commandState: o?.getName(), disabled: u || !o || o.isBuiltIn() })] });
|
|
792
|
-
return ke({ ...w, children: e(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: C }) }) });
|
|
793
|
-
}, [s]), b = o?.getName() === t, x = W(() => {
|
|
794
|
-
const w = { table: i, tableStyle: o, styles: l, bodyStyle: m };
|
|
795
|
-
return f ? e(Mp, { canvas: p, ...w }) : e(Rp, { ...w });
|
|
796
|
-
}, [i, o, l, m]);
|
|
797
|
-
let h = e(ft, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (w) => `solid ${b ? w.palette.primary.dark : "transparent"} 1px` }, tooltipProps: { label: o.getName() ?? "None", placement: "bottom-start" }, disabled: u, icon: null, onClick: () => {
|
|
798
|
-
n?.(o?.getName());
|
|
799
|
-
}, ...g, children: x }, o.getName());
|
|
800
|
-
return c && (h = e(fi, { label: i.getStyleOptions().name, parentFloat: a, createPopupPanel: y, children: h })), h;
|
|
801
|
-
}), Ip = K(J((r, i) => {
|
|
802
|
-
const { commands: o, command: t, commandHook: n, selectedTable: l, onSelectTableStyleName: c, disabled: m = !1, bodyStyle: a, usePreviewIcon: s = !1, ...u } = r;
|
|
803
|
-
Ht(t);
|
|
804
|
-
const d = t?.context(), f = d?.styles, p = l ?? d?.table?.();
|
|
805
|
-
let g = "insertTable";
|
|
806
|
-
p && (g = "editTable");
|
|
807
|
-
const y = W(() => ((I, A) => {
|
|
808
|
-
const R = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
809
|
-
return new or({ initialAnchor: R, styles: A, json: { name: "PreviewTable", ref: R, description: "PreviewTable", headerRowCount: 1, totalsRowCount: 0, styleOptions: I } });
|
|
810
|
-
})(p?.getStyleOptions(), f?.()), [f?.().getDefaultTableStyle(), p?.getStyleOptions()]), b = p ?? y, [x, h] = U(b);
|
|
811
|
-
me(() => {
|
|
812
|
-
h(b);
|
|
813
|
-
}, [b]);
|
|
814
|
-
const w = a ?? d?.bodyStyle(), v = ee((I) => {
|
|
815
|
-
c?.(I), t?.execute({ name: I }, n);
|
|
816
|
-
}, [t, c, n]), C = Se(null), k = q((I, A) => {
|
|
817
|
-
const R = { onSelectTableStyleName: v, styles: f(), parentFloat: I.floatReference };
|
|
818
|
-
C.current || (C.current = document.createElement("canvas"));
|
|
819
|
-
const S = (X) => {
|
|
820
|
-
const _ = f().getTableStyle(X);
|
|
821
|
-
return _ ? e(Np, { table: x, tableStyle: _, selectedTableStyleName: x.getStyleOptions().name, bodyStyle: d.bodyStyle(), commands: A, commandHook: n, canvas: C.current, ...R }, X) : null;
|
|
822
|
-
}, N = (X, _, ne = !0) => {
|
|
823
|
-
const ae = [];
|
|
824
|
-
for (let G = 0; G < _.length; G++) {
|
|
825
|
-
const z = S(_[G]);
|
|
826
|
-
z && ae.push(z);
|
|
827
|
-
}
|
|
828
|
-
return ae.length === 0 ? null : j(B, { children: [ne ? e(re, { orientation: "horizontal" }) : null, e(to, { children: X }, X + "-header"), e(B, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", width: "481px", maxWidth: "100%" }, children: ae }, X + "-presets")] }, X);
|
|
829
|
-
}, L = [], O = f().getCustomTableStyles(), $ = [];
|
|
830
|
-
if (O.length > 0) {
|
|
831
|
-
for (let X = 0; X < O.length; X++) O[X].isShownInTableStyles() && $.push(O[X].getName());
|
|
832
|
-
L.push(N("Custom", $, !1));
|
|
833
|
-
}
|
|
834
|
-
const D = [];
|
|
835
|
-
p && !p.getStyleOptions().name && D.push(null);
|
|
836
|
-
for (let X = 0; X < 21; X++) D.push("TableStyleLight" + (X + 1));
|
|
837
|
-
L.push(N("Light", D, $.length > 0));
|
|
838
|
-
const E = [];
|
|
839
|
-
for (let X = 0; X < 28; X++) E.push("TableStyleMedium" + (X + 1));
|
|
840
|
-
L.push(N("Medium", E));
|
|
841
|
-
const Y = [];
|
|
842
|
-
for (let X = 0; X < 11; X++) Y.push("TableStyleDark" + (X + 1));
|
|
843
|
-
L.push(N("Dark", Y));
|
|
844
|
-
let Z = null;
|
|
845
|
-
return p && (Z = j(se, { children: [e(re, { orientation: "horizontal" }), e(F, { variant: ie.Menuitem, command: A.getCommand("formatTableStyleClearTableStyle"), commandHook: n, disabled: m, icon: P(e(mi, {})) })] })), j(B, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", paddingTop: (X) => `${X.shape.borderRadius}px`, paddingBottom: (X) => `${X.shape.borderRadius}px` }, children: [e(B, { onContextMenu: () => {
|
|
846
|
-
}, sx: { display: "flex", flexDirection: "column", padding: "6px 16px" }, children: L }), Z] });
|
|
847
|
-
}, [f, f?.().getTheme(), w, x]), T = m || !t || t.disabled(), M = W(() => {
|
|
848
|
-
if (!d || !s) return P(e(Ro, {}));
|
|
849
|
-
}, [x, w, T]);
|
|
850
|
-
return e(Re, { ref: i, quickCommand: g, createPopupPanel: k, commands: o, label: t?.label(), commandState: p, commandHook: n, selected: p !== null, createTooltip: ({ children: I }, A) => e(rt, { label: t?.label(), description: t?.description(), disabled: A, children: I }), disabled: T, icon: M, ...u });
|
|
851
|
-
})), Je = [];
|
|
852
|
-
Je.push(ot("Primary Background", "bg1")), Je.push(ot("Primary Text", "tx1")), Je.push(ot("Secondary Background", "bg2")), Je.push(ot("Secondary Text", "tx2")), Je.push(ot("Accent 1", "accent1")), Je.push(ot("Accent 2", "accent2")), Je.push(ot("Accent 3", "accent3")), Je.push(ot("Accent 4", "accent4")), Je.push(ot("Accent 5", "accent5")), Je.push(ot("Accent 6", "accent6"));
|
|
853
|
-
const Fp = (r) => {
|
|
854
|
-
const { docTheme: i, onSelectTheme: o, darkMode: t, isSelected: n, outlined: l, sx: c, ...m } = r, a = at(), s = W(() => {
|
|
855
|
-
let u = [];
|
|
856
|
-
for (let d = 0; d < Je.length; d++) {
|
|
857
|
-
const f = Je[d];
|
|
858
|
-
u.push(e(fr, { schemeColorLookup: i.schemeLookup(), colorDef: f, darkMode: t, selectedColor: null }, d + "-colorDef"));
|
|
859
|
-
}
|
|
860
|
-
return e(B, { sx: { display: "flex", flexDirection: "row", flex: "none" }, children: e(B, { sx: { display: "flex", boxShadow: (d) => d.shadows[2] }, children: u }) });
|
|
861
|
-
}, [i, a]);
|
|
862
|
-
return e(ft, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (u) => `solid ${n ? u.palette.text.primary : "transparent"} 1px`, "&:hover:not([disabled])": { border: (u) => `solid ${u.palette.text.primary} 1px !important` } }, icon: null, ...m, children: j(B, { sx: { border: (u) => `solid ${u.palette.divider} 1px`, minWidth: "200px", borderRadius: "2px", padding: "4px 4px", textAlign: "left", display: "flex", gap: "4px", flexDirection: "column", alignItems: "stretch", color: (u) => n ? u.palette.text.primary : void 0, "&:hover:not([disabled])": { color: (u) => u.palette.text.primary } }, children: [e(B, { sx: {}, children: i.getName() }), j(B, { sx: { paddingTop: "6px", paddingLeft: "12px", paddingRight: "12px", display: "flex", flexDirection: "column", alignItems: "stretch" }, children: [s, e(B, { sx: { flex: "1 1 100%", textOverflow: "ellipsis", overflow: "hidden", marginTop: "2px", whiteSpace: "pre", fontFamily: () => i.getFontScheme().getMajorFont() }, children: e(At, { disableInteractive: !0, PopperProps: { style: { pointerEvents: "none" }, disablePortal: !0, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: !0, options: { boundariesElement: "viewport" } }] } }, title: e("div", { style: { textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "pre" }, children: `The font used for the body.
|
|
863
|
-
The heading font is '${i.getFontScheme().getMajorFont()}'.` }), placement: "bottom-start", children: e("div", { children: i.getFontScheme().getMinorFont() }) }) })] })] }) });
|
|
864
|
-
}, Op = K(J((r, i) => {
|
|
865
|
-
const { themes: o, selectedTheme: t, onSelectTheme: n, sx: l, disabled: c = !1, darkMode: m, ...a } = r, s = W(() => {
|
|
866
|
-
const u = o?.getItems({ selected: t }) ?? [], d = [];
|
|
867
|
-
if (u.length === 0) return e(to, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "6px", paddingBottom: "6px" }, children: "No themes" });
|
|
868
|
-
const f = u.length;
|
|
869
|
-
for (let p = 0; p < f; p++) {
|
|
870
|
-
const g = u[p], y = t && g?.getName() === t.getName(), b = u[p + 1];
|
|
871
|
-
b && b.isCustom() !== g.isCustom() && d.push(e(re, { orientation: "horizontal", sx: { marginBottom: "4px" } }, `divider-${p}`)), d.push(e(Fp, { docTheme: g, onSelectTheme: () => n(g), isSelected: y, disabled: c, darkMode: m, onMouseDown: (x) => {
|
|
872
|
-
x.button === 0 && x.preventDefault();
|
|
873
|
-
}, onMouseUp: (x) => {
|
|
874
|
-
x.button === 0 && n(g);
|
|
875
|
-
}, onKeyDown: (x) => {
|
|
876
|
-
x.keyCode !== ye.Enter && x.keyCode !== ye.Space || n(g);
|
|
877
|
-
} }, g.getName()));
|
|
878
|
-
}
|
|
879
|
-
return d;
|
|
880
|
-
}, [t, n, m]);
|
|
881
|
-
return e(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%" }, ref: i, ...a, children: j(B, { sx: { display: "flex", flexDirection: "column", overflow: "hidden" }, children: [e(to, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "4px", paddingBottom: "2px" }, children: "Themes" }), e(re, {}), e(B, { sx: { flex: "1 1 100%", overflow: "auto", padding: "6px 16px" }, children: s })] }) });
|
|
882
|
-
})), Ap = K(J((r, i) => {
|
|
883
|
-
const { themes: o, selectedTheme: t, onSelectTheme: n, icon: l, tooltip: c, label: m, variant: a = nt.Toolbar, darkMode: s, panelProps: u, ...d } = r, f = l || P(e(xi, {})), p = q((y) => {
|
|
884
|
-
const { closeFloatAll: b } = y;
|
|
885
|
-
return e(Op, { ...u, themes: o, selectedTheme: t, onSelectTheme: n, darkMode: s, onKeyDown: (x) => {
|
|
886
|
-
x.which === ye.Enter && b();
|
|
887
|
-
} });
|
|
888
|
-
}, [o, t, n, u, s]), g = { createPopupPanel: p, tooltip: c || m || "Theme", label: m, icon: f, ...d };
|
|
889
|
-
return a === nt.Toolbar ? e(vt, { ref: i, ...g }) : e(sr, { ref: i, ...g });
|
|
890
|
-
})), Bp = K(J((r, i) => {
|
|
891
|
-
const { command: o, commandHook: t, selectedTheme: n, onSelectTheme: l, disabled: c = !1, darkMode: m, label: a, icon: s, variant: u, ...d } = r;
|
|
892
|
-
Ht(o);
|
|
893
|
-
const f = o?.context()?.themes, p = n || o?.context()?.theme, g = m ?? o?.context()?.darkMode, y = c || o?.disabled(), b = ee((h) => {
|
|
894
|
-
l?.(h), o?.execute(h, t);
|
|
895
|
-
}, [l, t]), x = q((h, w) => {
|
|
896
|
-
const { children: v, title: C, ...k } = h;
|
|
897
|
-
let T = h.children;
|
|
898
|
-
return (y || w) && (T = e("div", { children: T })), e(dr, { command: o, placement: u === ie.Toolbar ? "bottom-start" : "right-start", disabled: y || w, ...k, children: T });
|
|
899
|
-
}, [o, y]);
|
|
900
|
-
return e(Ap, { ref: i, themes: f, selectedTheme: p, onSelectTheme: b, variant: u === ie.Menuitem ? nt.Menuitem : nt.Toolbar, createTooltip: x, disabled: y, darkMode: g, icon: P(e(xi, {})), ...d });
|
|
901
|
-
})), Lp = K(J((r, i) => {
|
|
902
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = We(o, ["themeMode"])[0], a = m?.state(), s = m?.state() !== null, u = fs("(prefers-color-scheme: dark)"), d = a === "dark" || a === null && u, f = ee((p, g) => {
|
|
903
|
-
const y = { variant: ie.Menuitem, commandHook: t, scope: "appearance", disabled: l }, b = j(se, { children: [e(F, { ...y, command: m, icon: P(e(d ? pa : ua, {})) }), e(F, { ...y, command: g.getCommand("defaultThemeMode"), icon: P(e(u ? gc : hc, {})) }), e(re, { orientation: "horizontal" }), e(F, { ...y, command: g.getCommand("enableDarkGrid") }), e(F, { ...y, command: g.getCommand("enableDarkImages") })] });
|
|
904
|
-
return ke({ ...p, children: b });
|
|
905
|
-
}, [l, m, t, n, u, a, s]);
|
|
906
|
-
return e(Re, { ref: i, quickCommand: "themeMode", commands: o, commandHook: t, createPopupPanel: f, label: "Appearance", tooltip: "Change the light/dark mode to match your viewing preference. This does not affect the view for others.", onQuickClick: () => {
|
|
907
|
-
m?.execute(d ? "light" : "dark", t);
|
|
908
|
-
}, selected: s, icon: P(e(d ? pa : ua, {})), ...c });
|
|
909
|
-
})), Hp = K(J((r, i) => {
|
|
910
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, sx: c, ...m } = r, a = q((s, u) => {
|
|
911
|
-
const d = { variant: ie.Menuitem, scope: "help", commandHook: { ...t, beforeExecute: (p, g) => t?.beforeExecute?.(p, g) !== !1 && s.floatReference.closeAll() }, disabled: l }, f = j(se, { children: [e(F, { ...d, command: u.getCommand("showKeyboardShortcuts"), icon: P(e(Pd, {})) }), e(re, { orientation: "horizontal" }), e(F, { ...d, command: u.getCommand("gotoUrlGithub"), icon: P(e(fc, {})) }), e(F, { ...d, command: u.getCommand("gotoUrlDiscord"), icon: P(e(xc, {})) }), e(F, { ...d, command: u.getCommand("gotoUrlDocumentation"), icon: P(e(bi, {})) }), e(F, { ...d, command: u.getCommand("gotoUrlIssue"), icon: P(e(bc, {})) })] });
|
|
912
|
-
return ke({ ...s, children: f });
|
|
913
|
-
}, [l, t]);
|
|
914
|
-
return e(Re, { ref: i, sx: c, commands: o, disabled: l, commandHook: t, scope: n, label: "Help", tooltip: "Help, feedback, and keyboard shortcuts.", createPopupPanel: a, icon: P(e(yc, { sx: { transform: "scale(0.75)" } })), ...m });
|
|
915
|
-
})), Li = K(J((r, i) => {
|
|
916
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, preferSingleMenu: c = !0, showQuickButton: m = !0, variant: a = ie.Toolbar, ...s } = r, u = We(o, ["insertImageFromFile", "insertImageFromURL"]), { singleMenuCommand: d, allDisabled: f } = W(() => {
|
|
917
|
-
let g = null, y = 0;
|
|
918
|
-
for (let b = 0; b < u.length; b++) u[b] && !u[b]?.disabled() && (c && a === ie.Menuitem && (g = y === 0 ? u[b] : null), y++);
|
|
919
|
-
return { singleMenuCommand: g, allDisabled: y === 0 };
|
|
920
|
-
}, [u]), p = q((g, y) => {
|
|
921
|
-
const b = { variant: ie.Menuitem, commandHook: t, scope: "insertImage", disabled: l }, x = j(se, { children: [e(F, { ...b, command: y.getCommand("insertImageFromFile"), icon: P(e(Wo, {})) }), e(F, { ...b, command: y.getCommand("insertImageFromURL"), icon: P(e(Wo, {})) })] });
|
|
922
|
-
return ke({ ...g, children: x });
|
|
923
|
-
}, [l, t, n]);
|
|
924
|
-
return d ? e(F, { ref: i, variant: a, commandHook: t, disabled: l, command: d, icon: P(e(Wo, {})), ...s }) : e(Re, { ref: i, variant: a, quickCommand: "insertImageFromFile", commands: o, commandHook: t, scope: n, disabled: l || f, tooltip: "Insert a picture from the web to complement your data.", createPopupPanel: p, icon: P(e(Wo, {})), ...s });
|
|
925
|
-
})), xr = K(J((r, i) => {
|
|
926
|
-
const { command: o, ...t } = r, n = un(), [l, c] = U(!1), [m, a] = U("info");
|
|
927
|
-
return me(() => {
|
|
928
|
-
const s = n.getMode();
|
|
929
|
-
c(s?.key === "copy" || s?.key === "cut"), a(s?.key === "cut" ? "warning" : "info");
|
|
930
|
-
}, [n]), e(F, { ref: i, command: o, icon: P(e(wc, { isWalking: l, themedType: m })), ...t });
|
|
931
|
-
})), vm = K(J((r, i) => {
|
|
932
|
-
const { ...o } = r;
|
|
933
|
-
return e(ct, { ref: i, ...o, popupCommandKeys: ["quickFormulaSum", "quickFormulaAverage", "quickFormulaCount", "quickFormulaMax", "quickFormulaMin", null, "insertFunction"], quickCommand: "quickFormulaSum", popupScope: "quickFormula", label: "Quick Formulas", tooltip: "More quick functions.", icon: (t) => {
|
|
934
|
-
switch (t?.key()) {
|
|
935
|
-
case "quickFormulaSum":
|
|
936
|
-
return P(e(vc, {}));
|
|
937
|
-
case "insertFunction":
|
|
938
|
-
return P(e(Sc, {}));
|
|
939
|
-
default:
|
|
940
|
-
return null;
|
|
941
|
-
}
|
|
942
|
-
} });
|
|
943
|
-
})), Hi = le.createContext(null);
|
|
944
|
-
Hi.displayName = "HookFormContext";
|
|
945
|
-
const zi = () => le.useContext(Hi), zp = K(J((r, i) => {
|
|
946
|
-
const { disabled: o, style: t, className: n, sx: l, defaultInput: c, value: m, formName: a, formOptions: s, onChangeInput: u, onValidate: d, onKeyDown: f, ...p } = r, g = zi(), y = a && g ? g.register(a, s) : null, [b, x] = U(""), [h, w] = U(""), [v, C] = U(m);
|
|
947
|
-
me(() => {
|
|
948
|
-
C(m), w("");
|
|
949
|
-
}, [m]);
|
|
950
|
-
const k = ee((R) => {
|
|
951
|
-
let S = "";
|
|
952
|
-
try {
|
|
953
|
-
C(R), d?.(R), u?.(R);
|
|
954
|
-
} catch (N) {
|
|
955
|
-
S = N.message ?? "Invalid Name";
|
|
956
|
-
}
|
|
957
|
-
a && g && (S ? g.setError(a, { message: S }) : g.clearErrors(a)), w(S);
|
|
958
|
-
}, [m, d, u]), T = ee(async (R) => {
|
|
959
|
-
R.keyCode === ye.Escape && b !== m && (k(b), g?.setValue(a, b), g?.clearErrors(a), R.stopPropagation()), f?.(R);
|
|
960
|
-
}, [f, b, m, g]), M = ee((R) => {
|
|
961
|
-
x(R.target.value ?? "");
|
|
962
|
-
}, []), I = ee((R) => {
|
|
963
|
-
x(""), y?.onBlur(R);
|
|
964
|
-
}, []), A = q((R) => {
|
|
965
|
-
k(R.target.value), y?.onChange(R);
|
|
966
|
-
}, [y]);
|
|
967
|
-
return e(lr, { sx: { paddingTop: (R) => R.spacing(1.5), minWidth: 135, width: "100%", ...l }, size: "small", ref: i, className: Oe("named-input", n), ...p, children: e(pi, { label: "Name", placeholder: c, onFocus: M, onBlur: I, inputRef: y?.ref, disabled: o, error: !!h, helperText: h || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (R) => R.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", name: a, spellCheck: !1, autoComplete: "off", readOnly: o, sx: { paddingTop: (R) => R.spacing(1.25), paddingBottom: (R) => R.spacing(0.75), backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})` } } }, value: v ?? "", onChange: A, onKeyDownCapture: T, onContextMenu: (R) => {
|
|
968
|
-
R.stopPropagation();
|
|
969
|
-
} }) });
|
|
970
|
-
}));
|
|
971
|
-
zp.displayName = "NamedInput";
|
|
972
|
-
const Vo = (r) => r === null ? "" : r.toString(), Wp = K(J((r, i) => {
|
|
973
|
-
const { formName: o, formOptions: t, disabled: n, style: l, className: c, sx: m, onKeyDown: a, value: s, onChangeInput: u, resolvedAddress: d, ...f } = r, p = zi(), g = o && p ? p.register(o, t) : null, [y, b] = U(""), [x, h] = U(!1), [w, v] = U(() => Vo(s));
|
|
974
|
-
me(() => {
|
|
975
|
-
v(Vo(s)), b(""), o && p && p.clearErrors(o), h(!1);
|
|
976
|
-
}, [s]);
|
|
977
|
-
const C = ee((S) => {
|
|
978
|
-
let N = "";
|
|
979
|
-
try {
|
|
980
|
-
v(S);
|
|
981
|
-
const L = Vo(s), O = d(S);
|
|
982
|
-
O.toString() !== L && u?.(O);
|
|
983
|
-
} catch {
|
|
984
|
-
N = "Invalid Range";
|
|
985
|
-
}
|
|
986
|
-
o && p && (N ? p.setError(o, { message: N }) : p.clearErrors(o)), b(N), h(!0);
|
|
987
|
-
}, [w, u, o, p]), k = ee(async (S) => {
|
|
988
|
-
if (x && S.keyCode === ye.Escape) {
|
|
989
|
-
const N = Vo(s);
|
|
990
|
-
v(N), b(""), h(!1), S.stopPropagation();
|
|
991
|
-
}
|
|
992
|
-
a?.(S);
|
|
993
|
-
}, [s, u, a, x]), T = ee((S) => {
|
|
994
|
-
g?.onBlur(S);
|
|
995
|
-
}, [g]), M = q((S) => {
|
|
996
|
-
C(S.target.value), g?.onChange(S);
|
|
997
|
-
}, [g]), [I, A] = U(!1), R = W(() => e(xs, { tabIndex: -1, sx: { display: "flex", position: "relative", flex: "0" }, position: "end", children: e(Cc, { disabled: !0, selected: I, onSelectToggle: (S) => {
|
|
998
|
-
A(S);
|
|
999
|
-
}, label: "Select Range", icon: P(e(kc, {})) }) }), [I]);
|
|
1000
|
-
return e(lr, { sx: { paddingTop: (S) => S.spacing(1.5), minWidth: 135, width: "100%", ...m }, size: "small", ref: i, className: Oe("range-input", c), ...f, children: e(pi, { label: "Range", placeholder: "Enter Range", onBlur: T, disabled: n, error: !!y, inputRef: g?.ref, helperText: y || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (S) => S.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { spellCheck: !1, autoComplete: "off", readOnly: n, name: o, sx: { paddingTop: (S) => S.spacing(1.25), paddingBottom: (S) => S.spacing(0.75) } }, sx: { backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})` }, endAdornment: R }, value: w ?? "", onChange: M, onKeyDownCapture: k, onContextMenu: (S) => {
|
|
1001
|
-
S.stopPropagation();
|
|
1002
|
-
} }) });
|
|
1003
|
-
}));
|
|
1004
|
-
Wp.displayName = "RangeInput";
|
|
1005
|
-
const Wi = K(J((r, i) => {
|
|
1006
|
-
const { sheet: o, className: t, debounceDelay: n = 220, sx: l, ...c } = r, [m, a] = U(() => o.getView().getZoomScale()), [s, u] = U(null), d = Se(0);
|
|
1007
|
-
Ue(o, { onViewChange: () => {
|
|
1008
|
-
u(!0), d.current === 0 && a(o.getView().getZoomScale());
|
|
1009
|
-
} }), me(() => {
|
|
1010
|
-
d.current = 0, u(!1), a(o.getView().getZoomScale());
|
|
1011
|
-
}, [o]), me(() => {
|
|
1012
|
-
d.current !== 0 && Ze.debounce(() => {
|
|
1013
|
-
m === d.current && (d.current = 0, o.getView().update({ zoomScale: m }));
|
|
1014
|
-
}, n)();
|
|
1015
|
-
}, [m, n]);
|
|
1016
|
-
const f = ee((T) => {
|
|
1017
|
-
let M = T;
|
|
1018
|
-
T < 100 ? M = Math.round(T / (10 / 9) + 10) : T > 100 && (M = Math.round(3 * T - 200)), d.current = M, u(!0), a(M);
|
|
1019
|
-
}, [o]), p = (T) => {
|
|
1020
|
-
let M = T;
|
|
1021
|
-
return T < 100 ? M = 10 / 9 * (T - 10) : T > 100 && (M = (T + 200) / 3), M;
|
|
1022
|
-
}, g = p(m), [y, b] = U(null), x = Se(null), h = q(() => {
|
|
1023
|
-
const T = y;
|
|
1024
|
-
T && requestAnimationFrame(() => {
|
|
1025
|
-
x.current?.contains(document.activeElement) && T.focus();
|
|
1026
|
-
});
|
|
1027
|
-
}, []), w = ma(() => {
|
|
1028
|
-
f(p(Ze.findNextStep(o.getView().getZoomScale(), !1, 10)));
|
|
1029
|
-
}), v = ma(() => f(p(Ze.findNextStep(o.getView().getZoomScale(), !0, 10)))), C = at(), k = W(() => `${Bt.getSharedMeasurer()("100%", Math.round(C.typography.fontSize), C.typography.fontFamily).width}px`, [C]);
|
|
1030
|
-
return j(B, { ref: i, className: Oe(t), sx: { padding: "0px 0px", display: "flex", alignItems: "center", color: (T) => T.palette.text.secondary, ...l }, onFocus: (T) => {
|
|
1031
|
-
T.relatedTarget && !y && b(T.relatedTarget);
|
|
1032
|
-
}, onBlur: (T) => {
|
|
1033
|
-
y && !x?.current?.contains(T.relatedTarget) && b(null);
|
|
1034
|
-
}, onMouseDown: (T) => {
|
|
1035
|
-
T.button === 0 && T.preventDefault();
|
|
1036
|
-
}, onMouseUp: (T) => {
|
|
1037
|
-
T.button === 0 && h();
|
|
1038
|
-
}, ...c, children: [e(At, { disableInteractive: !0, title: "Zoom Out", children: e(dt, { sx: { padding: "0", "&:hover:not([disabled])": { color: (T) => T.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (T) => {
|
|
1039
|
-
T.button !== 0 ? T.preventDefault() : w(T);
|
|
1040
|
-
}, children: e(Rd, {}) }) }), e(bs, { ref: x, sx: { flex: "1 1 100%", padding: "6px 0px !important", marginRight: "2px", marginLeft: "2px", "& .MuiSlider-thumb": { height: 14, width: 6, borderRadius: 0.75, "&.Mui-focusVisible": { boxShadow: (T) => `0px 0px 0px 3px ${ra(T.palette.primary.main, 0.16)}` }, "&:focus, &:hover, &.Mui-active": { boxShadow: (T) => `0px 0px 0px 2px ${ra(T.palette.primary.main, 0.16)}` } }, "& .MuiSlider-mark": { width: "1px", height: "8px" }, "& .MuiSlider-markActive": { backgroundColor: "currentColor" }, "& .MuiSlider-thumb:not(.MuiSlider-active)": { transition: s ? "left 260ms ease-in" : "none" } }, valueLabelDisplay: "auto", size: "small", track: !1, min: 0, step: 1, value: g, max: 200, marks: [{ value: 100 }], onAnimationEnd: () => u(!1), onWheel: (T) => {
|
|
1041
|
-
f(p(Ze.findNextStep(o.getView().getZoomScale(), T.deltaY < 0, 10)));
|
|
1042
|
-
}, onKeyDown: (T) => {
|
|
1043
|
-
T.which === ye.Down || T.which === ye.Right ? (f(p(Ze.findNextStep(o.getView().getZoomScale(), !0, 10))), T.preventDefault()) : T.which === ye.Up || T.which === ye.Left ? (f(p(Ze.findNextStep(o.getView().getZoomScale(), !1, 10))), T.preventDefault()) : T.which !== ye.Enter && T.which !== ye.Escape || h();
|
|
1044
|
-
}, onChange: (T, M) => {
|
|
1045
|
-
Math.abs(M - 100) < 3 ? f(100) : f(M);
|
|
1046
|
-
}, valueLabelFormat: (T, M) => `Zoom: ${Math.round(m)}%` }), e(At, { disableInteractive: !0, title: "Zoom In", children: e(dt, { sx: { padding: "0", "&:hover:not([disabled])": { color: (T) => T.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (T) => {
|
|
1047
|
-
T.button !== 0 ? T.preventDefault() : v(T);
|
|
1048
|
-
}, children: e(Md, {}) }) }), j(B, { sx: { display: "flex", flexDirection: "row" }, children: [e(B, { sx: { minWidth: "8px" } }), e(Be, { noWrap: !0, component: "div", onClick: () => {
|
|
1049
|
-
f(100);
|
|
1050
|
-
}, sx: { cursor: "pointer", display: "flex", flex: "1 1 100%", fontSize: "0.70rem", marginLeft: "2px", marginRight: "2px", userSelect: "none", justifyContent: "center", width: k }, children: e("div", { children: Math.round(m) + "%" }) })] })] });
|
|
1051
|
-
}));
|
|
1052
|
-
Wi.displayName = "SheetZoomScale";
|
|
1053
|
-
const ji = K(J((r, i) => {
|
|
1054
|
-
const { sx: o, sheet: t, gridStyle: n, children: l, childrenEnd: c, ...m } = r;
|
|
1055
|
-
ps(i, () => ({}));
|
|
1056
|
-
const a = Se(null);
|
|
1057
|
-
me(() => {
|
|
1058
|
-
const p = (g) => g.preventDefault();
|
|
1059
|
-
return a.current?.addEventListener("wheel", p, { passive: !1 }), () => {
|
|
1060
|
-
a.current?.removeEventListener("wheel", p);
|
|
1061
|
-
};
|
|
1062
|
-
}, []);
|
|
1063
|
-
const s = un(), u = W(() => {
|
|
1064
|
-
const p = s.getMode();
|
|
1065
|
-
return p?.description ? p.description : "Ready";
|
|
1066
|
-
}, [s]), [d, f] = U(!1);
|
|
1067
|
-
return j(B, { ref: a, sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", overflow: d ? "visible" : "hidden", boxShadow: `0px -1px 0px ${n.header.edgeStrokeFill}`, ...o }, onMouseOver: () => f(!0), onMouseLeave: () => f(!1), ...m, children: [l, e("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "end", overflow: "hidden" }, children: e(Be, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", color: (p) => p.palette.text.secondary }, variant: "caption", children: u }) }), c ? e(B, { sx: { display: "flex", alignItems: "center" }, children: c }) : null, e(re, { style: { marginTop: "6px", marginBottom: "6px" } }), e(Wi, { sx: { paddingLeft: "4px", minWidth: "175px" }, sheet: t })] });
|
|
1068
|
-
}));
|
|
1069
|
-
ji.displayName = "StatusBar";
|
|
1070
|
-
var Co = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1071
|
-
function Cm(r) {
|
|
1072
|
-
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
1073
|
-
}
|
|
1074
|
-
var xa, ba, Dn, ya, wa, $o = { exports: {} }, uo = {}, mo = { exports: {} }, Sa = {}, va = { exports: {} };
|
|
1075
|
-
function jp() {
|
|
1076
|
-
return ba ? xa : (ba = 1, xa = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1077
|
-
}
|
|
1078
|
-
function Vp() {
|
|
1079
|
-
if (ya) return Dn;
|
|
1080
|
-
ya = 1;
|
|
1081
|
-
var r = jp();
|
|
1082
|
-
function i() {
|
|
1083
|
-
}
|
|
1084
|
-
function o() {
|
|
1085
|
-
}
|
|
1086
|
-
return o.resetWarningCache = i, Dn = function() {
|
|
1087
|
-
function t(c, m, a, s, u, d) {
|
|
1088
|
-
if (d !== r) {
|
|
1089
|
-
var f = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
|
|
1090
|
-
throw f.name = "Invariant Violation", f;
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
function n() {
|
|
1094
|
-
return t;
|
|
1095
|
-
}
|
|
1096
|
-
t.isRequired = t;
|
|
1097
|
-
var l = { array: t, bigint: t, bool: t, func: t, number: t, object: t, string: t, symbol: t, any: t, arrayOf: n, element: t, elementType: t, instanceOf: n, node: t, objectOf: n, oneOf: n, oneOfType: n, shape: n, exact: n, checkPropTypes: o, resetWarningCache: i };
|
|
1098
|
-
return l.PropTypes = l, l;
|
|
1099
|
-
}, Dn;
|
|
1100
|
-
}
|
|
1101
|
-
function mn() {
|
|
1102
|
-
return wa || (wa = 1, va.exports = Vp()()), va.exports;
|
|
1103
|
-
}
|
|
1104
|
-
var Ca, _o = { exports: {} }, ka, ze = {}, bt = {};
|
|
1105
|
-
function gn() {
|
|
1106
|
-
return ka || (ka = 1, Object.defineProperty(bt, "__esModule", { value: !0 }), bt.dontSetMe = function(r, i, o) {
|
|
1107
|
-
if (r[i]) return new Error(`Invalid prop ${i} passed to ${o} - do not set this, set it on the child.`);
|
|
1108
|
-
}, bt.findInArray = function(r, i) {
|
|
1109
|
-
for (let o = 0, t = r.length; o < t; o++) if (i.apply(i, [r[o], o, r])) return r[o];
|
|
1110
|
-
}, bt.int = function(r) {
|
|
1111
|
-
return parseInt(r, 10);
|
|
1112
|
-
}, bt.isFunction = function(r) {
|
|
1113
|
-
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Function]";
|
|
1114
|
-
}, bt.isNum = function(r) {
|
|
1115
|
-
return typeof r == "number" && !isNaN(r);
|
|
1116
|
-
}), bt;
|
|
1117
|
-
}
|
|
1118
|
-
var Ta, Ea, yt = {};
|
|
1119
|
-
function br() {
|
|
1120
|
-
if (Ea) return ze;
|
|
1121
|
-
Ea = 1, Object.defineProperty(ze, "__esModule", { value: !0 }), ze.addClassName = c, ze.addEvent = function(a, s, u, d) {
|
|
1122
|
-
if (!a) return;
|
|
1123
|
-
const f = { capture: !0, ...d };
|
|
1124
|
-
a.addEventListener ? a.addEventListener(s, u, f) : a.attachEvent ? a.attachEvent("on" + s, u) : a["on" + s] = u;
|
|
1125
|
-
}, ze.addUserSelectStyles = function(a) {
|
|
1126
|
-
if (!a) return;
|
|
1127
|
-
let s = a.getElementById("react-draggable-style-el");
|
|
1128
|
-
s || (s = a.createElement("style"), s.type = "text/css", s.id = "react-draggable-style-el", s.innerHTML = `.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
1129
|
-
`, s.innerHTML += `.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
1130
|
-
`, a.getElementsByTagName("head")[0].appendChild(s)), a.body && c(a.body, "react-draggable-transparent-selection");
|
|
1131
|
-
}, ze.createCSSTransform = function(a, s) {
|
|
1132
|
-
const u = n(a, s, "px");
|
|
1133
|
-
return { [(0, i.browserPrefixToKey)("transform", i.default)]: u };
|
|
1134
|
-
}, ze.createSVGTransform = function(a, s) {
|
|
1135
|
-
return n(a, s, "");
|
|
1136
|
-
}, ze.getTouch = function(a, s) {
|
|
1137
|
-
return a.targetTouches && (0, r.findInArray)(a.targetTouches, (u) => s === u.identifier) || a.changedTouches && (0, r.findInArray)(a.changedTouches, (u) => s === u.identifier);
|
|
1138
|
-
}, ze.getTouchIdentifier = function(a) {
|
|
1139
|
-
if (a.targetTouches && a.targetTouches[0]) return a.targetTouches[0].identifier;
|
|
1140
|
-
if (a.changedTouches && a.changedTouches[0]) return a.changedTouches[0].identifier;
|
|
1141
|
-
}, ze.getTranslation = n, ze.innerHeight = function(a) {
|
|
1142
|
-
let s = a.clientHeight;
|
|
1143
|
-
const u = a.ownerDocument.defaultView.getComputedStyle(a);
|
|
1144
|
-
return s -= (0, r.int)(u.paddingTop), s -= (0, r.int)(u.paddingBottom), s;
|
|
1145
|
-
}, ze.innerWidth = function(a) {
|
|
1146
|
-
let s = a.clientWidth;
|
|
1147
|
-
const u = a.ownerDocument.defaultView.getComputedStyle(a);
|
|
1148
|
-
return s -= (0, r.int)(u.paddingLeft), s -= (0, r.int)(u.paddingRight), s;
|
|
1149
|
-
}, ze.matchesSelector = t, ze.matchesSelectorAndParentsTo = function(a, s, u) {
|
|
1150
|
-
let d = a;
|
|
1151
|
-
do {
|
|
1152
|
-
if (t(d, s)) return !0;
|
|
1153
|
-
if (d === u) return !1;
|
|
1154
|
-
d = d.parentNode;
|
|
1155
|
-
} while (d);
|
|
1156
|
-
return !1;
|
|
1157
|
-
}, ze.offsetXYFromParent = function(a, s, u) {
|
|
1158
|
-
const d = s === s.ownerDocument.body ? { left: 0, top: 0 } : s.getBoundingClientRect(), f = (a.clientX + s.scrollLeft - d.left) / u, p = (a.clientY + s.scrollTop - d.top) / u;
|
|
1159
|
-
return { x: f, y: p };
|
|
1160
|
-
}, ze.outerHeight = function(a) {
|
|
1161
|
-
let s = a.clientHeight;
|
|
1162
|
-
const u = a.ownerDocument.defaultView.getComputedStyle(a);
|
|
1163
|
-
return s += (0, r.int)(u.borderTopWidth), s += (0, r.int)(u.borderBottomWidth), s;
|
|
1164
|
-
}, ze.outerWidth = function(a) {
|
|
1165
|
-
let s = a.clientWidth;
|
|
1166
|
-
const u = a.ownerDocument.defaultView.getComputedStyle(a);
|
|
1167
|
-
return s += (0, r.int)(u.borderLeftWidth), s += (0, r.int)(u.borderRightWidth), s;
|
|
1168
|
-
}, ze.removeClassName = m, ze.removeEvent = function(a, s, u, d) {
|
|
1169
|
-
if (!a) return;
|
|
1170
|
-
const f = { capture: !0, ...d };
|
|
1171
|
-
a.removeEventListener ? a.removeEventListener(s, u, f) : a.detachEvent ? a.detachEvent("on" + s, u) : a["on" + s] = null;
|
|
1172
|
-
}, ze.scheduleRemoveUserSelectStyles = function(a) {
|
|
1173
|
-
window.requestAnimationFrame ? window.requestAnimationFrame(() => {
|
|
1174
|
-
l(a);
|
|
1175
|
-
}) : l(a);
|
|
1176
|
-
};
|
|
1177
|
-
var r = gn(), i = function(a, s) {
|
|
1178
|
-
if (typeof WeakMap == "function") var u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap();
|
|
1179
|
-
return function(f, p) {
|
|
1180
|
-
if (!p && f && f.__esModule) return f;
|
|
1181
|
-
var g, y, b = { __proto__: null, default: f };
|
|
1182
|
-
if (f === null || typeof f != "object" && typeof f != "function") return b;
|
|
1183
|
-
if (g = p ? d : u) {
|
|
1184
|
-
if (g.has(f)) return g.get(f);
|
|
1185
|
-
g.set(f, b);
|
|
1186
|
-
}
|
|
1187
|
-
for (const x in f) x !== "default" && {}.hasOwnProperty.call(f, x) && ((y = (g = Object.defineProperty) && Object.getOwnPropertyDescriptor(f, x)) && (y.get || y.set) ? g(b, x, y) : b[x] = f[x]);
|
|
1188
|
-
return b;
|
|
1189
|
-
}(a, s);
|
|
1190
|
-
}(function() {
|
|
1191
|
-
if (Ta) return yt;
|
|
1192
|
-
Ta = 1, Object.defineProperty(yt, "__esModule", { value: !0 }), yt.browserPrefixToKey = u, yt.browserPrefixToStyle = function(d, f) {
|
|
1193
|
-
return f ? `-${f.toLowerCase()}-${d}` : d;
|
|
1194
|
-
}, yt.default = void 0, yt.getPrefix = s;
|
|
1195
|
-
const a = ["Moz", "Webkit", "O", "ms"];
|
|
1196
|
-
function s() {
|
|
1197
|
-
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
|
|
1198
|
-
if (typeof window > "u") return "";
|
|
1199
|
-
const f = window.document?.documentElement?.style;
|
|
1200
|
-
if (!f || d in f) return "";
|
|
1201
|
-
for (let p = 0; p < a.length; p++) if (u(d, a[p]) in f) return a[p];
|
|
1202
|
-
return "";
|
|
1203
|
-
}
|
|
1204
|
-
function u(d, f) {
|
|
1205
|
-
return f ? `${f}${function(p) {
|
|
1206
|
-
let g = "", y = !0;
|
|
1207
|
-
for (let b = 0; b < p.length; b++) y ? (g += p[b].toUpperCase(), y = !1) : p[b] === "-" ? y = !0 : g += p[b];
|
|
1208
|
-
return g;
|
|
1209
|
-
}(d)}` : d;
|
|
1210
|
-
}
|
|
1211
|
-
return yt.default = s(), yt;
|
|
1212
|
-
}());
|
|
1213
|
-
let o = "";
|
|
1214
|
-
function t(a, s) {
|
|
1215
|
-
return o || (o = (0, r.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(u) {
|
|
1216
|
-
return (0, r.isFunction)(a[u]);
|
|
1217
|
-
})), !!(0, r.isFunction)(a[o]) && a[o](s);
|
|
1218
|
-
}
|
|
1219
|
-
function n(a, s, u) {
|
|
1220
|
-
let { x: d, y: f } = a, p = `translate(${d}${u},${f}${u})`;
|
|
1221
|
-
return s && (p = `translate(${`${typeof s.x == "string" ? s.x : s.x + u}`}, ${`${typeof s.y == "string" ? s.y : s.y + u}`})` + p), p;
|
|
1222
|
-
}
|
|
1223
|
-
function l(a) {
|
|
1224
|
-
if (a) try {
|
|
1225
|
-
if (a.body && m(a.body, "react-draggable-transparent-selection"), a.selection) a.selection.empty();
|
|
1226
|
-
else {
|
|
1227
|
-
const s = (a.defaultView || window).getSelection();
|
|
1228
|
-
s && s.type !== "Caret" && s.removeAllRanges();
|
|
1229
|
-
}
|
|
1230
|
-
} catch {
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
function c(a, s) {
|
|
1234
|
-
a.classList ? a.classList.add(s) : a.className.match(new RegExp(`(?:^|\\s)${s}(?!\\S)`)) || (a.className += ` ${s}`);
|
|
1235
|
-
}
|
|
1236
|
-
function m(a, s) {
|
|
1237
|
-
a.classList ? a.classList.remove(s) : a.className = a.className.replace(new RegExp(`(?:^|\\s)${s}(?!\\S)`, "g"), "");
|
|
1238
|
-
}
|
|
1239
|
-
return ze;
|
|
1240
|
-
}
|
|
1241
|
-
var Da, lt = {};
|
|
1242
|
-
function Vi() {
|
|
1243
|
-
if (Da) return lt;
|
|
1244
|
-
Da = 1, Object.defineProperty(lt, "__esModule", { value: !0 }), lt.canDragX = function(t) {
|
|
1245
|
-
return t.props.axis === "both" || t.props.axis === "x";
|
|
1246
|
-
}, lt.canDragY = function(t) {
|
|
1247
|
-
return t.props.axis === "both" || t.props.axis === "y";
|
|
1248
|
-
}, lt.createCoreData = function(t, n, l) {
|
|
1249
|
-
const c = !(0, r.isNum)(t.lastX), m = o(t);
|
|
1250
|
-
return c ? { node: m, deltaX: 0, deltaY: 0, lastX: n, lastY: l, x: n, y: l } : { node: m, deltaX: n - t.lastX, deltaY: l - t.lastY, lastX: t.lastX, lastY: t.lastY, x: n, y: l };
|
|
1251
|
-
}, lt.createDraggableData = function(t, n) {
|
|
1252
|
-
const l = t.props.scale;
|
|
1253
|
-
return { node: n.node, x: t.state.x + n.deltaX / l, y: t.state.y + n.deltaY / l, deltaX: n.deltaX / l, deltaY: n.deltaY / l, lastX: t.state.x, lastY: t.state.y };
|
|
1254
|
-
}, lt.getBoundPosition = function(t, n, l) {
|
|
1255
|
-
if (!t.props.bounds) return [n, l];
|
|
1256
|
-
let { bounds: c } = t.props;
|
|
1257
|
-
c = typeof c == "string" ? c : function(a) {
|
|
1258
|
-
return { left: a.left, top: a.top, right: a.right, bottom: a.bottom };
|
|
1259
|
-
}(c);
|
|
1260
|
-
const m = o(t);
|
|
1261
|
-
if (typeof c == "string") {
|
|
1262
|
-
const { ownerDocument: a } = m, s = a.defaultView;
|
|
1263
|
-
let u;
|
|
1264
|
-
if (c === "parent" ? u = m.parentNode : u = m.getRootNode().querySelector(c), !(u instanceof s.HTMLElement)) throw new Error('Bounds selector "' + c + '" could not find an element.');
|
|
1265
|
-
const d = u, f = s.getComputedStyle(m), p = s.getComputedStyle(d);
|
|
1266
|
-
c = { left: -m.offsetLeft + (0, r.int)(p.paddingLeft) + (0, r.int)(f.marginLeft), top: -m.offsetTop + (0, r.int)(p.paddingTop) + (0, r.int)(f.marginTop), right: (0, i.innerWidth)(d) - (0, i.outerWidth)(m) - m.offsetLeft + (0, r.int)(p.paddingRight) - (0, r.int)(f.marginRight), bottom: (0, i.innerHeight)(d) - (0, i.outerHeight)(m) - m.offsetTop + (0, r.int)(p.paddingBottom) - (0, r.int)(f.marginBottom) };
|
|
1267
|
-
}
|
|
1268
|
-
return (0, r.isNum)(c.right) && (n = Math.min(n, c.right)), (0, r.isNum)(c.bottom) && (l = Math.min(l, c.bottom)), (0, r.isNum)(c.left) && (n = Math.max(n, c.left)), (0, r.isNum)(c.top) && (l = Math.max(l, c.top)), [n, l];
|
|
1269
|
-
}, lt.getControlPosition = function(t, n, l) {
|
|
1270
|
-
const c = typeof n == "number" ? (0, i.getTouch)(t, n) : null;
|
|
1271
|
-
if (typeof n == "number" && !c) return null;
|
|
1272
|
-
const m = o(l), a = l.props.offsetParent || m.offsetParent || m.ownerDocument.body;
|
|
1273
|
-
return (0, i.offsetXYFromParent)(c || t, a, l.props.scale);
|
|
1274
|
-
}, lt.snapToGrid = function(t, n, l) {
|
|
1275
|
-
const c = Math.round(n / t[0]) * t[0], m = Math.round(l / t[1]) * t[1];
|
|
1276
|
-
return [c, m];
|
|
1277
|
-
};
|
|
1278
|
-
var r = gn(), i = br();
|
|
1279
|
-
function o(t) {
|
|
1280
|
-
const n = t.findDOMNode();
|
|
1281
|
-
if (!n) throw new Error("<DraggableCore>: Unmounted during event!");
|
|
1282
|
-
return n;
|
|
1283
|
-
}
|
|
1284
|
-
return lt;
|
|
1285
|
-
}
|
|
1286
|
-
var Pa, Ra, Ma, Na, go = {}, Uo = {};
|
|
1287
|
-
function $i() {
|
|
1288
|
-
return Pa || (Pa = 1, Object.defineProperty(Uo, "__esModule", { value: !0 }), Uo.default = function() {
|
|
1289
|
-
}), Uo;
|
|
1290
|
-
}
|
|
1291
|
-
function $p() {
|
|
1292
|
-
if (Ra) return go;
|
|
1293
|
-
Ra = 1, Object.defineProperty(go, "__esModule", { value: !0 }), go.default = void 0;
|
|
1294
|
-
var r = function(p, g) {
|
|
1295
|
-
if (typeof WeakMap == "function") var y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap();
|
|
1296
|
-
return function(x, h) {
|
|
1297
|
-
if (!h && x && x.__esModule) return x;
|
|
1298
|
-
var w, v, C = { __proto__: null, default: x };
|
|
1299
|
-
if (x === null || typeof x != "object" && typeof x != "function") return C;
|
|
1300
|
-
if (w = h ? b : y) {
|
|
1301
|
-
if (w.has(x)) return w.get(x);
|
|
1302
|
-
w.set(x, C);
|
|
1303
|
-
}
|
|
1304
|
-
for (const k in x) k !== "default" && {}.hasOwnProperty.call(x, k) && ((v = (w = Object.defineProperty) && Object.getOwnPropertyDescriptor(x, k)) && (v.get || v.set) ? w(C, k, v) : C[k] = x[k]);
|
|
1305
|
-
return C;
|
|
1306
|
-
}(p, g);
|
|
1307
|
-
}(le), i = m(mn()), o = m(Kt), t = br(), n = Vi(), l = gn(), c = m($i());
|
|
1308
|
-
function m(p) {
|
|
1309
|
-
return p && p.__esModule ? p : { default: p };
|
|
1310
|
-
}
|
|
1311
|
-
function a(p, g, y) {
|
|
1312
|
-
return (g = function(b) {
|
|
1313
|
-
var x = function(h, w) {
|
|
1314
|
-
if (typeof h != "object" || !h) return h;
|
|
1315
|
-
var v = h[Symbol.toPrimitive];
|
|
1316
|
-
if (v !== void 0) {
|
|
1317
|
-
var C = v.call(h, w);
|
|
1318
|
-
if (typeof C != "object") return C;
|
|
1319
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1320
|
-
}
|
|
1321
|
-
return (w === "string" ? String : Number)(h);
|
|
1322
|
-
}(b, "string");
|
|
1323
|
-
return typeof x == "symbol" ? x : x + "";
|
|
1324
|
-
}(g)) in p ? Object.defineProperty(p, g, { value: y, enumerable: !0, configurable: !0, writable: !0 }) : p[g] = y, p;
|
|
1325
|
-
}
|
|
1326
|
-
const s = { start: "touchstart", move: "touchmove", stop: "touchend" }, u = { start: "mousedown", move: "mousemove", stop: "mouseup" };
|
|
1327
|
-
let d = u, f = class extends r.Component {
|
|
1328
|
-
constructor() {
|
|
1329
|
-
super(...arguments), a(this, "dragging", !1), a(this, "lastX", NaN), a(this, "lastY", NaN), a(this, "touchIdentifier", null), a(this, "mounted", !1), a(this, "handleDragStart", (p) => {
|
|
1330
|
-
if (this.props.onMouseDown(p), !this.props.allowAnyClick && typeof p.button == "number" && p.button !== 0) return !1;
|
|
1331
|
-
const g = this.findDOMNode();
|
|
1332
|
-
if (!g || !g.ownerDocument || !g.ownerDocument.body) throw new Error("<DraggableCore> not mounted on DragStart!");
|
|
1333
|
-
const { ownerDocument: y } = g;
|
|
1334
|
-
if (this.props.disabled || !(p.target instanceof y.defaultView.Node) || this.props.handle && !(0, t.matchesSelectorAndParentsTo)(p.target, this.props.handle, g) || this.props.cancel && (0, t.matchesSelectorAndParentsTo)(p.target, this.props.cancel, g)) return;
|
|
1335
|
-
p.type !== "touchstart" || this.props.allowMobileScroll || p.preventDefault();
|
|
1336
|
-
const b = (0, t.getTouchIdentifier)(p);
|
|
1337
|
-
this.touchIdentifier = b;
|
|
1338
|
-
const x = (0, n.getControlPosition)(p, b, this);
|
|
1339
|
-
if (x == null) return;
|
|
1340
|
-
const { x: h, y: w } = x, v = (0, n.createCoreData)(this, h, w);
|
|
1341
|
-
(0, c.default)("DraggableCore: handleDragStart: %j", v), (0, c.default)("calling", this.props.onStart), this.props.onStart(p, v) !== !1 && this.mounted !== !1 && (this.props.enableUserSelectHack && (0, t.addUserSelectStyles)(y), this.dragging = !0, this.lastX = h, this.lastY = w, (0, t.addEvent)(y, d.move, this.handleDrag), (0, t.addEvent)(y, d.stop, this.handleDragStop));
|
|
1342
|
-
}), a(this, "handleDrag", (p) => {
|
|
1343
|
-
const g = (0, n.getControlPosition)(p, this.touchIdentifier, this);
|
|
1344
|
-
if (g == null) return;
|
|
1345
|
-
let { x: y, y: b } = g;
|
|
1346
|
-
if (Array.isArray(this.props.grid)) {
|
|
1347
|
-
let h = y - this.lastX, w = b - this.lastY;
|
|
1348
|
-
if ([h, w] = (0, n.snapToGrid)(this.props.grid, h, w), !h && !w) return;
|
|
1349
|
-
y = this.lastX + h, b = this.lastY + w;
|
|
1350
|
-
}
|
|
1351
|
-
const x = (0, n.createCoreData)(this, y, b);
|
|
1352
|
-
if ((0, c.default)("DraggableCore: handleDrag: %j", x), this.props.onDrag(p, x) !== !1 && this.mounted !== !1) this.lastX = y, this.lastY = b;
|
|
1353
|
-
else try {
|
|
1354
|
-
this.handleDragStop(new MouseEvent("mouseup"));
|
|
1355
|
-
} catch {
|
|
1356
|
-
const w = document.createEvent("MouseEvents");
|
|
1357
|
-
w.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(w);
|
|
1358
|
-
}
|
|
1359
|
-
}), a(this, "handleDragStop", (p) => {
|
|
1360
|
-
if (!this.dragging) return;
|
|
1361
|
-
const g = (0, n.getControlPosition)(p, this.touchIdentifier, this);
|
|
1362
|
-
if (g == null) return;
|
|
1363
|
-
let { x: y, y: b } = g;
|
|
1364
|
-
if (Array.isArray(this.props.grid)) {
|
|
1365
|
-
let w = y - this.lastX || 0, v = b - this.lastY || 0;
|
|
1366
|
-
[w, v] = (0, n.snapToGrid)(this.props.grid, w, v), y = this.lastX + w, b = this.lastY + v;
|
|
1367
|
-
}
|
|
1368
|
-
const x = (0, n.createCoreData)(this, y, b);
|
|
1369
|
-
if (this.props.onStop(p, x) === !1 || this.mounted === !1) return !1;
|
|
1370
|
-
const h = this.findDOMNode();
|
|
1371
|
-
h && this.props.enableUserSelectHack && (0, t.scheduleRemoveUserSelectStyles)(h.ownerDocument), (0, c.default)("DraggableCore: handleDragStop: %j", x), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, h && ((0, c.default)("DraggableCore: Removing handlers"), (0, t.removeEvent)(h.ownerDocument, d.move, this.handleDrag), (0, t.removeEvent)(h.ownerDocument, d.stop, this.handleDragStop));
|
|
1372
|
-
}), a(this, "onMouseDown", (p) => (d = u, this.handleDragStart(p))), a(this, "onMouseUp", (p) => (d = u, this.handleDragStop(p))), a(this, "onTouchStart", (p) => (d = s, this.handleDragStart(p))), a(this, "onTouchEnd", (p) => (d = s, this.handleDragStop(p)));
|
|
1373
|
-
}
|
|
1374
|
-
componentDidMount() {
|
|
1375
|
-
this.mounted = !0;
|
|
1376
|
-
const p = this.findDOMNode();
|
|
1377
|
-
p && (0, t.addEvent)(p, s.start, this.onTouchStart, { passive: !1 });
|
|
1378
|
-
}
|
|
1379
|
-
componentWillUnmount() {
|
|
1380
|
-
this.mounted = !1;
|
|
1381
|
-
const p = this.findDOMNode();
|
|
1382
|
-
if (p) {
|
|
1383
|
-
const { ownerDocument: g } = p;
|
|
1384
|
-
(0, t.removeEvent)(g, u.move, this.handleDrag), (0, t.removeEvent)(g, s.move, this.handleDrag), (0, t.removeEvent)(g, u.stop, this.handleDragStop), (0, t.removeEvent)(g, s.stop, this.handleDragStop), (0, t.removeEvent)(p, s.start, this.onTouchStart, { passive: !1 }), this.props.enableUserSelectHack && (0, t.scheduleRemoveUserSelectStyles)(g);
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
findDOMNode() {
|
|
1388
|
-
return this.props?.nodeRef ? this.props?.nodeRef?.current : o.default.findDOMNode(this);
|
|
1389
|
-
}
|
|
1390
|
-
render() {
|
|
1391
|
-
return r.cloneElement(r.Children.only(this.props.children), { onMouseDown: this.onMouseDown, onMouseUp: this.onMouseUp, onTouchEnd: this.onTouchEnd });
|
|
1392
|
-
}
|
|
1393
|
-
};
|
|
1394
|
-
return go.default = f, a(f, "displayName", "DraggableCore"), a(f, "propTypes", { allowAnyClick: i.default.bool, allowMobileScroll: i.default.bool, children: i.default.node.isRequired, disabled: i.default.bool, enableUserSelectHack: i.default.bool, offsetParent: function(p, g) {
|
|
1395
|
-
if (p[g] && p[g].nodeType !== 1) throw new Error("Draggable's offsetParent must be a DOM Node.");
|
|
1396
|
-
}, grid: i.default.arrayOf(i.default.number), handle: i.default.string, cancel: i.default.string, nodeRef: i.default.object, onStart: i.default.func, onDrag: i.default.func, onStop: i.default.func, onMouseDown: i.default.func, scale: i.default.number, className: l.dontSetMe, style: l.dontSetMe, transform: l.dontSetMe }), a(f, "defaultProps", { allowAnyClick: !1, allowMobileScroll: !1, disabled: !1, enableUserSelectHack: !0, onStart: function() {
|
|
1397
|
-
}, onDrag: function() {
|
|
1398
|
-
}, onStop: function() {
|
|
1399
|
-
}, onMouseDown: function() {
|
|
1400
|
-
}, scale: 1 }), go;
|
|
1401
|
-
}
|
|
1402
|
-
function _p() {
|
|
1403
|
-
return Ma || (Ma = 1, function(r) {
|
|
1404
|
-
Object.defineProperty(r, "__esModule", { value: !0 }), Object.defineProperty(r, "DraggableCore", { enumerable: !0, get: function() {
|
|
1405
|
-
return a.default;
|
|
1406
|
-
} }), r.default = void 0;
|
|
1407
|
-
var i = function(g, y) {
|
|
1408
|
-
if (typeof WeakMap == "function") var b = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap();
|
|
1409
|
-
return function(h, w) {
|
|
1410
|
-
if (!w && h && h.__esModule) return h;
|
|
1411
|
-
var v, C, k = { __proto__: null, default: h };
|
|
1412
|
-
if (h === null || typeof h != "object" && typeof h != "function") return k;
|
|
1413
|
-
if (v = w ? x : b) {
|
|
1414
|
-
if (v.has(h)) return v.get(h);
|
|
1415
|
-
v.set(h, k);
|
|
1416
|
-
}
|
|
1417
|
-
for (const T in h) T !== "default" && {}.hasOwnProperty.call(h, T) && ((C = (v = Object.defineProperty) && Object.getOwnPropertyDescriptor(h, T)) && (C.get || C.set) ? v(k, T, C) : k[T] = h[T]);
|
|
1418
|
-
return k;
|
|
1419
|
-
}(g, y);
|
|
1420
|
-
}(le), o = u(mn()), t = u(Kt), n = function() {
|
|
1421
|
-
if (Ca) return _o.exports;
|
|
1422
|
-
function g(b) {
|
|
1423
|
-
var x, h, w = "";
|
|
1424
|
-
if (typeof b == "string" || typeof b == "number") w += b;
|
|
1425
|
-
else if (typeof b == "object") if (Array.isArray(b)) {
|
|
1426
|
-
var v = b.length;
|
|
1427
|
-
for (x = 0; x < v; x++) b[x] && (h = g(b[x])) && (w && (w += " "), w += h);
|
|
1428
|
-
} else for (h in b) b[h] && (w && (w += " "), w += h);
|
|
1429
|
-
return w;
|
|
1430
|
-
}
|
|
1431
|
-
function y() {
|
|
1432
|
-
for (var b, x, h = 0, w = "", v = arguments.length; h < v; h++) (b = arguments[h]) && (x = g(b)) && (w && (w += " "), w += x);
|
|
1433
|
-
return w;
|
|
1434
|
-
}
|
|
1435
|
-
return Ca = 1, _o.exports = y, _o.exports.clsx = y, _o.exports;
|
|
1436
|
-
}(), l = br(), c = Vi(), m = gn(), a = u($p()), s = u($i());
|
|
1437
|
-
function u(g) {
|
|
1438
|
-
return g && g.__esModule ? g : { default: g };
|
|
1439
|
-
}
|
|
1440
|
-
function d() {
|
|
1441
|
-
return d = Object.assign ? Object.assign.bind() : function(g) {
|
|
1442
|
-
for (var y = 1; y < arguments.length; y++) {
|
|
1443
|
-
var b = arguments[y];
|
|
1444
|
-
for (var x in b) ({}).hasOwnProperty.call(b, x) && (g[x] = b[x]);
|
|
1445
|
-
}
|
|
1446
|
-
return g;
|
|
1447
|
-
}, d.apply(null, arguments);
|
|
1448
|
-
}
|
|
1449
|
-
function f(g, y, b) {
|
|
1450
|
-
return (y = function(x) {
|
|
1451
|
-
var h = function(w, v) {
|
|
1452
|
-
if (typeof w != "object" || !w) return w;
|
|
1453
|
-
var C = w[Symbol.toPrimitive];
|
|
1454
|
-
if (C !== void 0) {
|
|
1455
|
-
var k = C.call(w, v);
|
|
1456
|
-
if (typeof k != "object") return k;
|
|
1457
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1458
|
-
}
|
|
1459
|
-
return (v === "string" ? String : Number)(w);
|
|
1460
|
-
}(x, "string");
|
|
1461
|
-
return typeof h == "symbol" ? h : h + "";
|
|
1462
|
-
}(y)) in g ? Object.defineProperty(g, y, { value: b, enumerable: !0, configurable: !0, writable: !0 }) : g[y] = b, g;
|
|
1463
|
-
}
|
|
1464
|
-
class p extends i.Component {
|
|
1465
|
-
static getDerivedStateFromProps(y, b) {
|
|
1466
|
-
let { position: x } = y, { prevPropsPosition: h } = b;
|
|
1467
|
-
return !x || h && x.x === h.x && x.y === h.y ? null : ((0, s.default)("Draggable: getDerivedStateFromProps %j", { position: x, prevPropsPosition: h }), { x: x.x, y: x.y, prevPropsPosition: { ...x } });
|
|
1468
|
-
}
|
|
1469
|
-
constructor(y) {
|
|
1470
|
-
super(y), f(this, "onDragStart", (b, x) => {
|
|
1471
|
-
if ((0, s.default)("Draggable: onDragStart: %j", x), this.props.onStart(b, (0, c.createDraggableData)(this, x)) === !1) return !1;
|
|
1472
|
-
this.setState({ dragging: !0, dragged: !0 });
|
|
1473
|
-
}), f(this, "onDrag", (b, x) => {
|
|
1474
|
-
if (!this.state.dragging) return !1;
|
|
1475
|
-
(0, s.default)("Draggable: onDrag: %j", x);
|
|
1476
|
-
const h = (0, c.createDraggableData)(this, x), w = { x: h.x, y: h.y, slackX: 0, slackY: 0 };
|
|
1477
|
-
if (this.props.bounds) {
|
|
1478
|
-
const { x: v, y: C } = w;
|
|
1479
|
-
w.x += this.state.slackX, w.y += this.state.slackY;
|
|
1480
|
-
const [k, T] = (0, c.getBoundPosition)(this, w.x, w.y);
|
|
1481
|
-
w.x = k, w.y = T, w.slackX = this.state.slackX + (v - w.x), w.slackY = this.state.slackY + (C - w.y), h.x = w.x, h.y = w.y, h.deltaX = w.x - this.state.x, h.deltaY = w.y - this.state.y;
|
|
1482
|
-
}
|
|
1483
|
-
if (this.props.onDrag(b, h) === !1) return !1;
|
|
1484
|
-
this.setState(w);
|
|
1485
|
-
}), f(this, "onDragStop", (b, x) => {
|
|
1486
|
-
if (!this.state.dragging || this.props.onStop(b, (0, c.createDraggableData)(this, x)) === !1) return !1;
|
|
1487
|
-
(0, s.default)("Draggable: onDragStop: %j", x);
|
|
1488
|
-
const h = { dragging: !1, slackX: 0, slackY: 0 };
|
|
1489
|
-
if (this.props.position) {
|
|
1490
|
-
const { x: w, y: v } = this.props.position;
|
|
1491
|
-
h.x = w, h.y = v;
|
|
1492
|
-
}
|
|
1493
|
-
this.setState(h);
|
|
1494
|
-
}), this.state = { dragging: !1, dragged: !1, x: y.position ? y.position.x : y.defaultPosition.x, y: y.position ? y.position.y : y.defaultPosition.y, prevPropsPosition: { ...y.position }, slackX: 0, slackY: 0, isElementSVG: !1 }, !y.position || y.onDrag || y.onStop || console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
|
|
1495
|
-
}
|
|
1496
|
-
componentDidMount() {
|
|
1497
|
-
window.SVGElement !== void 0 && this.findDOMNode() instanceof window.SVGElement && this.setState({ isElementSVG: !0 });
|
|
1498
|
-
}
|
|
1499
|
-
componentWillUnmount() {
|
|
1500
|
-
this.state.dragging && this.setState({ dragging: !1 });
|
|
1501
|
-
}
|
|
1502
|
-
findDOMNode() {
|
|
1503
|
-
return this.props?.nodeRef?.current ?? t.default.findDOMNode(this);
|
|
1504
|
-
}
|
|
1505
|
-
render() {
|
|
1506
|
-
const { axis: y, bounds: b, children: x, defaultPosition: h, defaultClassName: w, defaultClassNameDragging: v, defaultClassNameDragged: C, position: k, positionOffset: T, scale: M, ...I } = this.props;
|
|
1507
|
-
let A = {}, R = null;
|
|
1508
|
-
const S = !k || this.state.dragging, N = k || h, L = { x: (0, c.canDragX)(this) && S ? this.state.x : N.x, y: (0, c.canDragY)(this) && S ? this.state.y : N.y };
|
|
1509
|
-
this.state.isElementSVG ? R = (0, l.createSVGTransform)(L, T) : A = (0, l.createCSSTransform)(L, T);
|
|
1510
|
-
const O = (0, n.clsx)(x.props.className || "", w, { [v]: this.state.dragging, [C]: this.state.dragged });
|
|
1511
|
-
return i.createElement(a.default, d({}, I, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }), i.cloneElement(i.Children.only(x), { className: O, style: { ...x.props.style, ...A }, transform: R }));
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
r.default = p, f(p, "displayName", "Draggable"), f(p, "propTypes", { ...a.default.propTypes, axis: o.default.oneOf(["both", "x", "y", "none"]), bounds: o.default.oneOfType([o.default.shape({ left: o.default.number, right: o.default.number, top: o.default.number, bottom: o.default.number }), o.default.string, o.default.oneOf([!1])]), defaultClassName: o.default.string, defaultClassNameDragging: o.default.string, defaultClassNameDragged: o.default.string, defaultPosition: o.default.shape({ x: o.default.number, y: o.default.number }), positionOffset: o.default.shape({ x: o.default.oneOfType([o.default.number, o.default.string]), y: o.default.oneOfType([o.default.number, o.default.string]) }), position: o.default.shape({ x: o.default.number, y: o.default.number }), className: m.dontSetMe, style: m.dontSetMe, transform: m.dontSetMe }), f(p, "defaultProps", { ...a.default.defaultProps, axis: "both", bounds: !1, defaultClassName: "react-draggable", defaultClassNameDragging: "react-draggable-dragging", defaultClassNameDragged: "react-draggable-dragged", defaultPosition: { x: 0, y: 0 }, scale: 1 });
|
|
1515
|
-
}(Sa)), Sa;
|
|
1516
|
-
}
|
|
1517
|
-
function _i() {
|
|
1518
|
-
if (Na) return mo.exports;
|
|
1519
|
-
Na = 1;
|
|
1520
|
-
const { default: r, DraggableCore: i } = _p();
|
|
1521
|
-
return mo.exports = r, mo.exports.default = r, mo.exports.DraggableCore = i, mo.exports;
|
|
1522
|
-
}
|
|
1523
|
-
var Ia, qo = {};
|
|
1524
|
-
function Up() {
|
|
1525
|
-
if (Ia) return qo;
|
|
1526
|
-
Ia = 1, qo.__esModule = !0, qo.cloneElement = function(l, c) {
|
|
1527
|
-
return c.style && l.props.style && (c.style = t(t({}, l.props.style), c.style)), c.className && l.props.className && (c.className = l.props.className + " " + c.className), i.default.cloneElement(l, c);
|
|
1528
|
-
};
|
|
1529
|
-
var r, i = (r = le) && r.__esModule ? r : { default: r };
|
|
1530
|
-
function o(l, c) {
|
|
1531
|
-
var m = Object.keys(l);
|
|
1532
|
-
if (Object.getOwnPropertySymbols) {
|
|
1533
|
-
var a = Object.getOwnPropertySymbols(l);
|
|
1534
|
-
c && (a = a.filter(function(s) {
|
|
1535
|
-
return Object.getOwnPropertyDescriptor(l, s).enumerable;
|
|
1536
|
-
})), m.push.apply(m, a);
|
|
1537
|
-
}
|
|
1538
|
-
return m;
|
|
1539
|
-
}
|
|
1540
|
-
function t(l) {
|
|
1541
|
-
for (var c = 1; c < arguments.length; c++) {
|
|
1542
|
-
var m = arguments[c] != null ? arguments[c] : {};
|
|
1543
|
-
c % 2 ? o(Object(m), !0).forEach(function(a) {
|
|
1544
|
-
n(l, a, m[a]);
|
|
1545
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(l, Object.getOwnPropertyDescriptors(m)) : o(Object(m)).forEach(function(a) {
|
|
1546
|
-
Object.defineProperty(l, a, Object.getOwnPropertyDescriptor(m, a));
|
|
1547
|
-
});
|
|
1548
|
-
}
|
|
1549
|
-
return l;
|
|
1550
|
-
}
|
|
1551
|
-
function n(l, c, m) {
|
|
1552
|
-
return (c = function(a) {
|
|
1553
|
-
var s = function(u, d) {
|
|
1554
|
-
if (typeof u != "object" || u === null) return u;
|
|
1555
|
-
var f = u[Symbol.toPrimitive];
|
|
1556
|
-
if (f !== void 0) {
|
|
1557
|
-
var p = f.call(u, d);
|
|
1558
|
-
if (typeof p != "object") return p;
|
|
1559
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1560
|
-
}
|
|
1561
|
-
return (d === "string" ? String : Number)(u);
|
|
1562
|
-
}(a, "string");
|
|
1563
|
-
return typeof s == "symbol" ? s : String(s);
|
|
1564
|
-
}(c)) in l ? Object.defineProperty(l, c, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : l[c] = m, l;
|
|
1565
|
-
}
|
|
1566
|
-
return qo;
|
|
1567
|
-
}
|
|
1568
|
-
var Fa, Oa, ho = {};
|
|
1569
|
-
function Ui() {
|
|
1570
|
-
if (Fa) return ho;
|
|
1571
|
-
Fa = 1, ho.__esModule = !0, ho.resizableProps = void 0;
|
|
1572
|
-
var r, i = (r = mn()) && r.__esModule ? r : { default: r };
|
|
1573
|
-
_i();
|
|
1574
|
-
var o = { axis: i.default.oneOf(["both", "x", "y", "none"]), className: i.default.string, children: i.default.element.isRequired, draggableOpts: i.default.shape({ allowAnyClick: i.default.bool, cancel: i.default.string, children: i.default.node, disabled: i.default.bool, enableUserSelectHack: i.default.bool, offsetParent: i.default.node, grid: i.default.arrayOf(i.default.number), handle: i.default.string, nodeRef: i.default.object, onStart: i.default.func, onDrag: i.default.func, onStop: i.default.func, onMouseDown: i.default.func, scale: i.default.number }), height: function() {
|
|
1575
|
-
for (var t = arguments.length, n = new Array(t), l = 0; l < t; l++) n[l] = arguments[l];
|
|
1576
|
-
var c, m = n[0];
|
|
1577
|
-
return m.axis === "both" || m.axis === "y" ? (c = i.default.number).isRequired.apply(c, n) : i.default.number.apply(i.default, n);
|
|
1578
|
-
}, handle: i.default.oneOfType([i.default.node, i.default.func]), handleSize: i.default.arrayOf(i.default.number), lockAspectRatio: i.default.bool, maxConstraints: i.default.arrayOf(i.default.number), minConstraints: i.default.arrayOf(i.default.number), onResizeStop: i.default.func, onResizeStart: i.default.func, onResize: i.default.func, resizeHandles: i.default.arrayOf(i.default.oneOf(["s", "w", "e", "n", "sw", "nw", "se", "ne"])), transformScale: i.default.number, width: function() {
|
|
1579
|
-
for (var t = arguments.length, n = new Array(t), l = 0; l < t; l++) n[l] = arguments[l];
|
|
1580
|
-
var c, m = n[0];
|
|
1581
|
-
return m.axis === "both" || m.axis === "x" ? (c = i.default.number).isRequired.apply(c, n) : i.default.number.apply(i.default, n);
|
|
1582
|
-
} };
|
|
1583
|
-
return ho.resizableProps = o, ho;
|
|
1584
|
-
}
|
|
1585
|
-
function qi() {
|
|
1586
|
-
if (Oa) return uo;
|
|
1587
|
-
Oa = 1, uo.__esModule = !0, uo.default = void 0;
|
|
1588
|
-
var r = function(f, p) {
|
|
1589
|
-
if (f && f.__esModule) return f;
|
|
1590
|
-
if (f === null || typeof f != "object" && typeof f != "function") return { default: f };
|
|
1591
|
-
var g = l(p);
|
|
1592
|
-
if (g && g.has(f)) return g.get(f);
|
|
1593
|
-
var y = {}, b = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
1594
|
-
for (var x in f) if (x !== "default" && Object.prototype.hasOwnProperty.call(f, x)) {
|
|
1595
|
-
var h = b ? Object.getOwnPropertyDescriptor(f, x) : null;
|
|
1596
|
-
h && (h.get || h.set) ? Object.defineProperty(y, x, h) : y[x] = f[x];
|
|
1597
|
-
}
|
|
1598
|
-
return y.default = f, g && g.set(f, y), y;
|
|
1599
|
-
}(le), i = _i(), o = Up(), t = Ui(), n = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
|
|
1600
|
-
function l(f) {
|
|
1601
|
-
if (typeof WeakMap != "function") return null;
|
|
1602
|
-
var p = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap();
|
|
1603
|
-
return (l = function(y) {
|
|
1604
|
-
return y ? g : p;
|
|
1605
|
-
})(f);
|
|
1606
|
-
}
|
|
1607
|
-
function c() {
|
|
1608
|
-
return c = Object.assign ? Object.assign.bind() : function(f) {
|
|
1609
|
-
for (var p = 1; p < arguments.length; p++) {
|
|
1610
|
-
var g = arguments[p];
|
|
1611
|
-
for (var y in g) Object.prototype.hasOwnProperty.call(g, y) && (f[y] = g[y]);
|
|
1612
|
-
}
|
|
1613
|
-
return f;
|
|
1614
|
-
}, c.apply(this, arguments);
|
|
1615
|
-
}
|
|
1616
|
-
function m(f, p) {
|
|
1617
|
-
var g = Object.keys(f);
|
|
1618
|
-
if (Object.getOwnPropertySymbols) {
|
|
1619
|
-
var y = Object.getOwnPropertySymbols(f);
|
|
1620
|
-
p && (y = y.filter(function(b) {
|
|
1621
|
-
return Object.getOwnPropertyDescriptor(f, b).enumerable;
|
|
1622
|
-
})), g.push.apply(g, y);
|
|
1623
|
-
}
|
|
1624
|
-
return g;
|
|
1625
|
-
}
|
|
1626
|
-
function a(f) {
|
|
1627
|
-
for (var p = 1; p < arguments.length; p++) {
|
|
1628
|
-
var g = arguments[p] != null ? arguments[p] : {};
|
|
1629
|
-
p % 2 ? m(Object(g), !0).forEach(function(y) {
|
|
1630
|
-
s(f, y, g[y]);
|
|
1631
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(f, Object.getOwnPropertyDescriptors(g)) : m(Object(g)).forEach(function(y) {
|
|
1632
|
-
Object.defineProperty(f, y, Object.getOwnPropertyDescriptor(g, y));
|
|
1633
|
-
});
|
|
1634
|
-
}
|
|
1635
|
-
return f;
|
|
1636
|
-
}
|
|
1637
|
-
function s(f, p, g) {
|
|
1638
|
-
return (p = function(y) {
|
|
1639
|
-
var b = function(x, h) {
|
|
1640
|
-
if (typeof x != "object" || x === null) return x;
|
|
1641
|
-
var w = x[Symbol.toPrimitive];
|
|
1642
|
-
if (w !== void 0) {
|
|
1643
|
-
var v = w.call(x, h);
|
|
1644
|
-
if (typeof v != "object") return v;
|
|
1645
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1646
|
-
}
|
|
1647
|
-
return (h === "string" ? String : Number)(x);
|
|
1648
|
-
}(y, "string");
|
|
1649
|
-
return typeof b == "symbol" ? b : String(b);
|
|
1650
|
-
}(p)) in f ? Object.defineProperty(f, p, { value: g, enumerable: !0, configurable: !0, writable: !0 }) : f[p] = g, f;
|
|
1651
|
-
}
|
|
1652
|
-
function u(f, p) {
|
|
1653
|
-
return u = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(g, y) {
|
|
1654
|
-
return g.__proto__ = y, g;
|
|
1655
|
-
}, u(f, p);
|
|
1656
|
-
}
|
|
1657
|
-
var d = function(f) {
|
|
1658
|
-
var p, g;
|
|
1659
|
-
function y() {
|
|
1660
|
-
for (var x, h = arguments.length, w = new Array(h), v = 0; v < h; v++) w[v] = arguments[v];
|
|
1661
|
-
return (x = f.call.apply(f, [this].concat(w)) || this).handleRefs = {}, x.lastHandleRect = null, x.slack = null, x;
|
|
1662
|
-
}
|
|
1663
|
-
g = f, (p = y).prototype = Object.create(g.prototype), p.prototype.constructor = p, u(p, g);
|
|
1664
|
-
var b = y.prototype;
|
|
1665
|
-
return b.componentWillUnmount = function() {
|
|
1666
|
-
this.resetData();
|
|
1667
|
-
}, b.resetData = function() {
|
|
1668
|
-
this.lastHandleRect = this.slack = null;
|
|
1669
|
-
}, b.runConstraints = function(x, h) {
|
|
1670
|
-
var w = this.props, v = w.minConstraints, C = w.maxConstraints, k = w.lockAspectRatio;
|
|
1671
|
-
if (!v && !C && !k) return [x, h];
|
|
1672
|
-
if (k) {
|
|
1673
|
-
var T = this.props.width / this.props.height, M = x - this.props.width, I = h - this.props.height;
|
|
1674
|
-
Math.abs(M) > Math.abs(I * T) ? h = x / T : x = h * T;
|
|
1675
|
-
}
|
|
1676
|
-
var A = x, R = h, S = this.slack || [0, 0], N = S[0], L = S[1];
|
|
1677
|
-
return x += N, h += L, v && (x = Math.max(v[0], x), h = Math.max(v[1], h)), C && (x = Math.min(C[0], x), h = Math.min(C[1], h)), this.slack = [N + (A - x), L + (R - h)], [x, h];
|
|
1678
|
-
}, b.resizeHandler = function(x, h) {
|
|
1679
|
-
var w = this;
|
|
1680
|
-
return function(v, C) {
|
|
1681
|
-
var k = C.node, T = C.deltaX, M = C.deltaY;
|
|
1682
|
-
x === "onResizeStart" && w.resetData();
|
|
1683
|
-
var I = (w.props.axis === "both" || w.props.axis === "x") && h !== "n" && h !== "s", A = (w.props.axis === "both" || w.props.axis === "y") && h !== "e" && h !== "w";
|
|
1684
|
-
if (I || A) {
|
|
1685
|
-
var R = h[0], S = h[h.length - 1], N = k.getBoundingClientRect();
|
|
1686
|
-
w.lastHandleRect != null && (S === "w" && (T += N.left - w.lastHandleRect.left), R === "n" && (M += N.top - w.lastHandleRect.top)), w.lastHandleRect = N, S === "w" && (T = -T), R === "n" && (M = -M);
|
|
1687
|
-
var L = w.props.width + (I ? T / w.props.transformScale : 0), O = w.props.height + (A ? M / w.props.transformScale : 0), $ = w.runConstraints(L, O);
|
|
1688
|
-
L = $[0], O = $[1];
|
|
1689
|
-
var D = L !== w.props.width || O !== w.props.height, E = typeof w.props[x] == "function" ? w.props[x] : null;
|
|
1690
|
-
E && !(x === "onResize" && !D) && (v.persist == null || v.persist(), E(v, { node: k, size: { width: L, height: O }, handle: h })), x === "onResizeStop" && w.resetData();
|
|
1691
|
-
}
|
|
1692
|
-
};
|
|
1693
|
-
}, b.renderResizeHandle = function(x, h) {
|
|
1694
|
-
var w = this.props.handle;
|
|
1695
|
-
if (!w) return r.createElement("span", { className: "react-resizable-handle react-resizable-handle-" + x, ref: h });
|
|
1696
|
-
if (typeof w == "function") return w(x, h);
|
|
1697
|
-
var v = a({ ref: h }, typeof w.type == "string" ? {} : { handleAxis: x });
|
|
1698
|
-
return r.cloneElement(w, v);
|
|
1699
|
-
}, b.render = function() {
|
|
1700
|
-
var x = this, h = this.props, w = h.children, v = h.className, C = h.draggableOpts;
|
|
1701
|
-
h.width, h.height, h.handle, h.handleSize, h.lockAspectRatio, h.axis, h.minConstraints, h.maxConstraints, h.onResize, h.onResizeStop, h.onResizeStart;
|
|
1702
|
-
var k = h.resizeHandles;
|
|
1703
|
-
h.transformScale;
|
|
1704
|
-
var T = function(M, I) {
|
|
1705
|
-
if (M == null) return {};
|
|
1706
|
-
var A, R, S = {}, N = Object.keys(M);
|
|
1707
|
-
for (R = 0; R < N.length; R++) A = N[R], I.indexOf(A) >= 0 || (S[A] = M[A]);
|
|
1708
|
-
return S;
|
|
1709
|
-
}(h, n);
|
|
1710
|
-
return (0, o.cloneElement)(w, a(a({}, T), {}, { className: (v ? v + " " : "") + "react-resizable", children: [].concat(w.props.children, k.map(function(M) {
|
|
1711
|
-
var I, A = (I = x.handleRefs[M]) != null ? I : x.handleRefs[M] = r.createRef();
|
|
1712
|
-
return r.createElement(i.DraggableCore, c({}, C, { nodeRef: A, key: "resizableHandle-" + M, onStop: x.resizeHandler("onResizeStop", M), onStart: x.resizeHandler("onResizeStart", M), onDrag: x.resizeHandler("onResize", M) }), x.renderResizeHandle(M, A));
|
|
1713
|
-
})) }));
|
|
1714
|
-
}, y;
|
|
1715
|
-
}(r.Component);
|
|
1716
|
-
return uo.default = d, d.propTypes = t.resizableProps, d.defaultProps = { axis: "both", handleSize: [20, 20], lockAspectRatio: !1, minConstraints: [20, 20], maxConstraints: [1 / 0, 1 / 0], resizeHandles: ["se"], transformScale: 1 }, uo;
|
|
1717
|
-
}
|
|
1718
|
-
var Aa, Ba, fo = {};
|
|
1719
|
-
function qp() {
|
|
1720
|
-
if (Aa) return fo;
|
|
1721
|
-
Aa = 1, fo.__esModule = !0, fo.default = void 0;
|
|
1722
|
-
var r = function(p, g) {
|
|
1723
|
-
if (p && p.__esModule) return p;
|
|
1724
|
-
if (p === null || typeof p != "object" && typeof p != "function") return { default: p };
|
|
1725
|
-
var y = c(g);
|
|
1726
|
-
if (y && y.has(p)) return y.get(p);
|
|
1727
|
-
var b = {}, x = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
1728
|
-
for (var h in p) if (h !== "default" && Object.prototype.hasOwnProperty.call(p, h)) {
|
|
1729
|
-
var w = x ? Object.getOwnPropertyDescriptor(p, h) : null;
|
|
1730
|
-
w && (w.get || w.set) ? Object.defineProperty(b, h, w) : b[h] = p[h];
|
|
1731
|
-
}
|
|
1732
|
-
return b.default = p, y && y.set(p, b), b;
|
|
1733
|
-
}(le), i = l(mn()), o = l(qi()), t = Ui(), n = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
|
|
1734
|
-
function l(p) {
|
|
1735
|
-
return p && p.__esModule ? p : { default: p };
|
|
1736
|
-
}
|
|
1737
|
-
function c(p) {
|
|
1738
|
-
if (typeof WeakMap != "function") return null;
|
|
1739
|
-
var g = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap();
|
|
1740
|
-
return (c = function(b) {
|
|
1741
|
-
return b ? y : g;
|
|
1742
|
-
})(p);
|
|
1743
|
-
}
|
|
1744
|
-
function m() {
|
|
1745
|
-
return m = Object.assign ? Object.assign.bind() : function(p) {
|
|
1746
|
-
for (var g = 1; g < arguments.length; g++) {
|
|
1747
|
-
var y = arguments[g];
|
|
1748
|
-
for (var b in y) Object.prototype.hasOwnProperty.call(y, b) && (p[b] = y[b]);
|
|
1749
|
-
}
|
|
1750
|
-
return p;
|
|
1751
|
-
}, m.apply(this, arguments);
|
|
1752
|
-
}
|
|
1753
|
-
function a(p, g) {
|
|
1754
|
-
var y = Object.keys(p);
|
|
1755
|
-
if (Object.getOwnPropertySymbols) {
|
|
1756
|
-
var b = Object.getOwnPropertySymbols(p);
|
|
1757
|
-
g && (b = b.filter(function(x) {
|
|
1758
|
-
return Object.getOwnPropertyDescriptor(p, x).enumerable;
|
|
1759
|
-
})), y.push.apply(y, b);
|
|
1760
|
-
}
|
|
1761
|
-
return y;
|
|
1762
|
-
}
|
|
1763
|
-
function s(p) {
|
|
1764
|
-
for (var g = 1; g < arguments.length; g++) {
|
|
1765
|
-
var y = arguments[g] != null ? arguments[g] : {};
|
|
1766
|
-
g % 2 ? a(Object(y), !0).forEach(function(b) {
|
|
1767
|
-
u(p, b, y[b]);
|
|
1768
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(p, Object.getOwnPropertyDescriptors(y)) : a(Object(y)).forEach(function(b) {
|
|
1769
|
-
Object.defineProperty(p, b, Object.getOwnPropertyDescriptor(y, b));
|
|
1770
|
-
});
|
|
1771
|
-
}
|
|
1772
|
-
return p;
|
|
1773
|
-
}
|
|
1774
|
-
function u(p, g, y) {
|
|
1775
|
-
return (g = function(b) {
|
|
1776
|
-
var x = function(h, w) {
|
|
1777
|
-
if (typeof h != "object" || h === null) return h;
|
|
1778
|
-
var v = h[Symbol.toPrimitive];
|
|
1779
|
-
if (v !== void 0) {
|
|
1780
|
-
var C = v.call(h, w);
|
|
1781
|
-
if (typeof C != "object") return C;
|
|
1782
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1783
|
-
}
|
|
1784
|
-
return (w === "string" ? String : Number)(h);
|
|
1785
|
-
}(b, "string");
|
|
1786
|
-
return typeof x == "symbol" ? x : String(x);
|
|
1787
|
-
}(g)) in p ? Object.defineProperty(p, g, { value: y, enumerable: !0, configurable: !0, writable: !0 }) : p[g] = y, p;
|
|
1788
|
-
}
|
|
1789
|
-
function d(p, g) {
|
|
1790
|
-
return d = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(y, b) {
|
|
1791
|
-
return y.__proto__ = b, y;
|
|
1792
|
-
}, d(p, g);
|
|
1793
|
-
}
|
|
1794
|
-
var f = function(p) {
|
|
1795
|
-
var g, y;
|
|
1796
|
-
function b() {
|
|
1797
|
-
for (var x, h = arguments.length, w = new Array(h), v = 0; v < h; v++) w[v] = arguments[v];
|
|
1798
|
-
return (x = p.call.apply(p, [this].concat(w)) || this).state = { width: x.props.width, height: x.props.height, propsWidth: x.props.width, propsHeight: x.props.height }, x.onResize = function(C, k) {
|
|
1799
|
-
var T = k.size;
|
|
1800
|
-
x.props.onResize ? (C.persist == null || C.persist(), x.setState(T, function() {
|
|
1801
|
-
return x.props.onResize && x.props.onResize(C, k);
|
|
1802
|
-
})) : x.setState(T);
|
|
1803
|
-
}, x;
|
|
1804
|
-
}
|
|
1805
|
-
return y = p, (g = b).prototype = Object.create(y.prototype), g.prototype.constructor = g, d(g, y), b.getDerivedStateFromProps = function(x, h) {
|
|
1806
|
-
return h.propsWidth !== x.width || h.propsHeight !== x.height ? { width: x.width, height: x.height, propsWidth: x.width, propsHeight: x.height } : null;
|
|
1807
|
-
}, b.prototype.render = function() {
|
|
1808
|
-
var x = this.props, h = x.handle, w = x.handleSize;
|
|
1809
|
-
x.onResize;
|
|
1810
|
-
var v = x.onResizeStart, C = x.onResizeStop, k = x.draggableOpts, T = x.minConstraints, M = x.maxConstraints, I = x.lockAspectRatio, A = x.axis;
|
|
1811
|
-
x.width, x.height;
|
|
1812
|
-
var R = x.resizeHandles, S = x.style, N = x.transformScale, L = function(O, $) {
|
|
1813
|
-
if (O == null) return {};
|
|
1814
|
-
var D, E, Y = {}, Z = Object.keys(O);
|
|
1815
|
-
for (E = 0; E < Z.length; E++) D = Z[E], $.indexOf(D) >= 0 || (Y[D] = O[D]);
|
|
1816
|
-
return Y;
|
|
1817
|
-
}(x, n);
|
|
1818
|
-
return r.createElement(o.default, { axis: A, draggableOpts: k, handle: h, handleSize: w, height: this.state.height, lockAspectRatio: I, maxConstraints: M, minConstraints: T, onResizeStart: v, onResize: this.onResize, onResizeStop: C, resizeHandles: R, transformScale: N, width: this.state.width }, r.createElement("div", m({}, L, { style: s(s({}, S), {}, { width: this.state.width + "px", height: this.state.height + "px" }) })));
|
|
1819
|
-
}, b;
|
|
1820
|
-
}(r.Component);
|
|
1821
|
-
return fo.default = f, f.propTypes = s(s({}, t.resizableProps), {}, { children: i.default.element }), fo;
|
|
1822
|
-
}
|
|
1823
|
-
var Gp = (Ba || (Ba = 1, $o.exports = function() {
|
|
1824
|
-
throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
|
|
1825
|
-
}, $o.exports.Resizable = qi().default, $o.exports.ResizableBox = qp().default), $o.exports);
|
|
1826
|
-
function Pn(r, i) {
|
|
1827
|
-
if (typeof r == "function") return r(i);
|
|
1828
|
-
r && (r.current = i);
|
|
1829
|
-
}
|
|
1830
|
-
var Fo = parseInt(us.split(".")[0], 10) >= 19 ? function(r) {
|
|
1831
|
-
return (i) => {
|
|
1832
|
-
const o = [];
|
|
1833
|
-
for (const t of r) {
|
|
1834
|
-
const n = Pn(t, i), l = typeof n == "function";
|
|
1835
|
-
o.push(l ? n : () => Pn(t, null));
|
|
1836
|
-
}
|
|
1837
|
-
return () => {
|
|
1838
|
-
for (const t of o) t();
|
|
1839
|
-
};
|
|
1840
|
-
};
|
|
1841
|
-
} : function(r) {
|
|
1842
|
-
return (i) => {
|
|
1843
|
-
for (const o of r) Pn(o, i);
|
|
1844
|
-
};
|
|
1845
|
-
};
|
|
1846
|
-
const Gi = K(J((r, i) => {
|
|
1847
|
-
const { disabled: o, names: t, workbook: n, restoreFocus: l, readonly: c = !1, disabled: m = !1, commandPopupButtonProps: a, sx: s, notifier: u, ...d } = r, [f, p] = U(null), [g, y] = U(() => n.getSelectedRanges().getCoords()), [b, x] = U(!1), { reference: h } = oo({ parentFloat: a?.parentFloat }), [w, v] = U(() => c || !n.getProtection().isStructureAllowed()), C = () => f?.text ?? "", [k, T] = U(C), M = ee(() => {
|
|
1848
|
-
if (h?.closeAll(), !k) {
|
|
1849
|
-
const G = C();
|
|
1850
|
-
return T(C()), G;
|
|
1851
|
-
}
|
|
1852
|
-
if (C() === k) return k;
|
|
1853
|
-
const _ = k.trim().toLowerCase();
|
|
1854
|
-
if (_ === "r" || _ === "c") return k;
|
|
1855
|
-
try {
|
|
1856
|
-
const G = n.getRanges(k);
|
|
1857
|
-
if (G) return G.toString();
|
|
1858
|
-
} catch {
|
|
1859
|
-
}
|
|
1860
|
-
const ne = t.getByName(k);
|
|
1861
|
-
if (ne && ne.getRanges()) return k;
|
|
1862
|
-
let ae = null;
|
|
1863
|
-
try {
|
|
1864
|
-
const G = n.getRanges(k), z = G.getCoords().map((Q) => ({ $colEnd: !0, $rowEnd: !0, $colStart: !0, $rowStart: !0, ...Q }));
|
|
1865
|
-
ae = n.getRanges(z);
|
|
1866
|
-
} catch {
|
|
1867
|
-
}
|
|
1868
|
-
if (!ae) {
|
|
1869
|
-
const G = n.getSelectedRanges().getCoords().map((z) => ({ $colEnd: !0, $rowEnd: !0, $colStart: !0, $rowStart: !0, ...z }));
|
|
1870
|
-
ae = n.getRanges(G);
|
|
1871
|
-
}
|
|
1872
|
-
try {
|
|
1873
|
-
let G = t.getByName(k);
|
|
1874
|
-
w || G || (G = t.addReference(k, ae)), G && p({ text: G.getName() });
|
|
1875
|
-
} catch (G) {
|
|
1876
|
-
T(C()), u.showMessage?.(G.message, { type: wt.Error });
|
|
1877
|
-
}
|
|
1878
|
-
return null;
|
|
1879
|
-
}, [k, t, h, w]), I = ee(() => {
|
|
1880
|
-
if (n.isClosed()) return;
|
|
1881
|
-
const _ = [];
|
|
1882
|
-
for (let G = 0; G < g.length; G++) {
|
|
1883
|
-
const z = g[G];
|
|
1884
|
-
_.push({ $colEnd: !0, $rowEnd: !0, $colStart: !0, $rowStart: !0, ...z });
|
|
1885
|
-
}
|
|
1886
|
-
let ne = null;
|
|
1887
|
-
try {
|
|
1888
|
-
ne = t.lookupByRanges(_);
|
|
1889
|
-
} catch {
|
|
1890
|
-
}
|
|
1891
|
-
let ae = null;
|
|
1892
|
-
ae = ne?.length > 0 ? ne[0].getName() : n.getSelectedSheet().getSelectedRange().toString(), p({ text: ae });
|
|
1893
|
-
}, [n, g]), [A, R] = U(() => t?.getItems() ?? null);
|
|
1894
|
-
Ue(t, { onCollectionChange(_) {
|
|
1895
|
-
R(t.getItems()), I();
|
|
1896
|
-
}, onClose(_) {
|
|
1897
|
-
R([]);
|
|
1898
|
-
} }), me(() => {
|
|
1899
|
-
T(C());
|
|
1900
|
-
}, [f, g]);
|
|
1901
|
-
const [S, N] = U(n?.getSelectedSheet());
|
|
1902
|
-
Ue(n, { onProtectionChange: (_) => {
|
|
1903
|
-
v(c || !_.getProtection().isStructureAllowed());
|
|
1904
|
-
}, onSheetsChange: (_) => {
|
|
1905
|
-
N(_?.getSelectedSheet());
|
|
1906
|
-
}, onViewChange(_) {
|
|
1907
|
-
N(_?.getSelectedSheet());
|
|
1908
|
-
} });
|
|
1909
|
-
const [L, O] = U(null), $ = ee(Ze.debounce(I, L ? 320 : 0), []);
|
|
1910
|
-
Ue(S.getSelection(), { onChange: () => {
|
|
1911
|
-
y((_) => {
|
|
1912
|
-
const ne = n.getSelectedRanges().getCoords();
|
|
1913
|
-
return cs.isEqualRangesArrays(ne, _) ? _ : ne;
|
|
1914
|
-
});
|
|
1915
|
-
}, onAdjustingChange: (_) => {
|
|
1916
|
-
O(_.getAdjusting());
|
|
1917
|
-
} }), me(() => {
|
|
1918
|
-
if (L) {
|
|
1919
|
-
const _ = n.getSelectedRange(), ne = _.getRowCount(), ae = _.getColumnCount();
|
|
1920
|
-
let G = `${ne}R x ${ae}C`;
|
|
1921
|
-
if (G.length > 17 && (G = `${ne}x${ae}`), ne > 1 || ae > 1) return void p({ text: G, fontStyle: "italic", justifyContent: "center" });
|
|
1922
|
-
}
|
|
1923
|
-
p({ text: n.getSelectedSheet().getSelectedRange().toString() }), $();
|
|
1924
|
-
}, [g, n, L]);
|
|
1925
|
-
const D = Se(null), E = q((_) => {
|
|
1926
|
-
const { onMouseDown: ne, onMouseUp: ae, ...G } = _;
|
|
1927
|
-
return e(dt, { ...G, sx: { ...G?.sx, display: "flex", flex: "1 1 100%" }, disableRipple: !0, children: e(ir, { inputMode: "text", inputProps: { tabIndex: 0, name: "input-named-range", maxLength: 255, className: "input", autoFocus: !1, spellCheck: !1, autoComplete: "off", ref: D }, sx: { "&::before": { borderBottom: "1px solid transparent" }, "&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before": { borderBottom: (z) => `1px solid ${z.palette.text.icon ?? z.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (z) => `1px solid ${z.palette.primary.main}` }, "::after": { borderBottom: (z) => `1px solid ${z.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", fontSize: 11 * Bt.getDeviceScale(), fontStyle: f?.fontStyle, paddingLeft: (z) => z.spacing(0.75), paddingRight: (z) => z.spacing(0.75), boxShadow: "none", flex: "1", color: (z) => z.palette.text.secondary, input: { padding: "0", textAlign: "left", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (z) => z.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (z) => z.palette.text.primary } } }, value: k, onFocus: (z) => {
|
|
1928
|
-
z.target?.select();
|
|
1929
|
-
}, onKeyDown: (z) => {
|
|
1930
|
-
if (z.which === ye.Enter || z.which === ye.Tab) {
|
|
1931
|
-
let Q = k;
|
|
1932
|
-
C() !== k && (z.stopPropagation(), z.preventDefault(), Q = M()), Q ? Y(Q) : l?.();
|
|
1933
|
-
} else if (z.which === ye.Escape) C() !== k ? (T(C()), setTimeout(() => {
|
|
1934
|
-
z.target?.select();
|
|
1935
|
-
}, 0), z.stopPropagation(), z.preventDefault()) : l?.();
|
|
1936
|
-
else if (z.which === ye.Space) return void z.stopPropagation();
|
|
1937
|
-
}, onBlur: () => {
|
|
1938
|
-
T(C());
|
|
1939
|
-
}, onChange: (z) => {
|
|
1940
|
-
T(z.target.value);
|
|
1941
|
-
} }) });
|
|
1942
|
-
}, [k, f]), Y = ee(async (_) => {
|
|
1943
|
-
try {
|
|
1944
|
-
h?.closeAll();
|
|
1945
|
-
const ne = t.lookupByRanges(_)?.[0];
|
|
1946
|
-
ne && await ne?.select(), await n.getRanges(_)?.select();
|
|
1947
|
-
} catch (ne) {
|
|
1948
|
-
u.showMessage?.(ne.message, { type: wt.Error });
|
|
1949
|
-
}
|
|
1950
|
-
}, [t, u, n]), Z = q((_) => {
|
|
1951
|
-
setTimeout(() => {
|
|
1952
|
-
x(!0);
|
|
1953
|
-
}, 0);
|
|
1954
|
-
const ne = { variant: ie.Menuitem, parentFloat: _.floatReference, commandHook: { ...a?.commandHook, beforeExecute: (Fe, Ae) => (h?.closeAll(), a?.commandHook?.beforeExecute?.(Fe, Ae)) }, scope: a?.scope, commands: a?.commands };
|
|
1955
|
-
let ae = t.getItems({ scope: n?.getSelectedSheet().getName() });
|
|
1956
|
-
ae = ae.sort((Fe, Ae) => Fe.getType() === Ae.getType() ? Fe.getName().localeCompare(Ae.getName()) : Fe.getType() === "range" ? -1 : 1);
|
|
1957
|
-
const G = w ? null : ["editNamedReference", "deleteNamedReference"], z = w ? null : ["editTable", null, "convertTableToRange", "deleteTable"], Q = [], ue = ae.length;
|
|
1958
|
-
for (let Fe = 0; Fe < ue; Fe++) {
|
|
1959
|
-
const Ae = ae[Fe], Ye = Ae.getRanges();
|
|
1960
|
-
if (!Ye || Ae.isHidden()) continue;
|
|
1961
|
-
const ve = Ae.getType();
|
|
1962
|
-
ve !== ae[Fe - 1]?.getType() && (Fe > 0 && Q.push(e(re, { orientation: "horizontal" }, `type-divider-${Q.length}`)), Q.push(e(to, { variant: "subtitle2", sx: { paddingLeft: "16px" }, children: Ae.getType() === "reference" ? "Ranges" : "Tables" }, `type-header-${Q.length}`))), ve === "reference" ? Q.push(Pe(ct, { ...ne, key: "named-" + Q.length, popupCommandKeys: G, popupScope: "namedItem", scope: "namedItem", commandState: Ae, commands: a?.commands, label: Ae.getName(), quickCommand: "selectNamed", disabled: !Ae.getRanges() || m, icon: (je) => {
|
|
1963
|
-
switch (je.key()) {
|
|
1964
|
-
case "editNamedReference":
|
|
1965
|
-
return P(e(Dc, {}));
|
|
1966
|
-
case "deleteNamedReference":
|
|
1967
|
-
return P(e(Ec, {}));
|
|
1968
|
-
default:
|
|
1969
|
-
return P(e(Tc, {}));
|
|
1970
|
-
}
|
|
1971
|
-
} })) : ve === "table" && Q.push(Pe(ct, { ...ne, key: "namedItem-" + Q.length, popupCommandKeys: z, popupScope: "namedItem", scope: "namedItem", commands: a?.commands, commandState: Ae, label: Ae.getName(), quickCommand: "selectNamed", disabled: !Ye || m, icon: (je) => (je.key(), P(e(an, {}))) }));
|
|
1972
|
-
}
|
|
1973
|
-
const Le = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...d, children: [w ? null : e(F, { ...ne, scope: "namedItem", command: a?.commands.getCommand("addNamedReference"), icon: P(e(Pc, {})) }), Q && Q.length > 0 ? j(se, { children: [w ? null : e(re, { orientation: "horizontal" }), e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: Q })] }) : null] });
|
|
1974
|
-
return ke({ ..._, children: Le });
|
|
1975
|
-
}, [n, A, t, f, w]), X = zt(i, () => ({ focus(_) {
|
|
1976
|
-
D.current?.focus(_);
|
|
1977
|
-
} }), []);
|
|
1978
|
-
return e(B, { className: "outer", sx: { minWidth: 120, flex: "1 1 100%", display: "flex", alignItems: "center", justifyContent: "start", ...s }, ref: Fo([X, i]), ...d, children: e(vt, { className: "outer-button", sx: { display: "flex", flex: "1 1 100%", "& .tooltip-wrapper": { display: "flex", flex: "1 1 100%", width: "100%", height: "27px" }, ...s }, buttonProps: { sx: { backgroundColor: (_) => _.palette.background.paper, backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})` } }, tabIndex: -1, outlined: { color: (_) => o ? _.palette.action.disabled : he(_.palette.divider, 0.2) }, parentFloat: h, createPopupPanel: Z, onPopupOpen: () => x(!0), onPopupClose: () => x(!1), createTooltip: ({ children: _ }, ne) => e(rt, { title: ne || b ? "" : "Name Box", disabled: ne, leaveDelay: 0, sx: { opacity: ne || b ? 0 : 1 }, children: _ }), createQuickButton: E }) });
|
|
1979
|
-
}));
|
|
1980
|
-
Gi.displayName = "NamedCollectionEditor";
|
|
1981
|
-
const Xp = (r, i) => e(Gi, { ref: i, ...r }), Xi = K(J((r, i) => {
|
|
1982
|
-
const { sx: o, workbook: t, sheetElement: n, gridStyle: l, showNamedCollectionEditor: c = !0, NamedCollectionEditorProps: m, renderNamedCollectionEditor: a = Xp, disabled: s, commands: u, ...d } = r, [f, p] = U(t?.getSelectedSheet());
|
|
1983
|
-
Ue(t, { onSheetsChange: (z) => {
|
|
1984
|
-
p(z?.getSelectedSheet());
|
|
1985
|
-
}, onViewChange(z) {
|
|
1986
|
-
p(z?.getSelectedSheet());
|
|
1987
|
-
} });
|
|
1988
|
-
const [g, y] = U(f.getSelection().getCoords().cell), b = f.getRange(g).getCell(), x = s || !b.isEditAllowed(), h = Se(null), w = W(() => ({ fontSize: 11 }), []);
|
|
1989
|
-
Ue(f.getSelection(), { onChange: () => {
|
|
1990
|
-
y(f.getSelection().getCoords().cell);
|
|
1991
|
-
} }), Ue(f, { onProtectionChange() {
|
|
1992
|
-
y(f.getSelection().getCoords().cell);
|
|
1993
|
-
} });
|
|
1994
|
-
const v = h.current?.getLineHeight() ?? 20, [C, k] = U(v), [T, M] = U(5), [I, A] = U(1), R = ee((z, { size: Q }) => {
|
|
1995
|
-
z.preventDefault(), z.stopPropagation();
|
|
1996
|
-
const ue = Math.floor(Q.height / v);
|
|
1997
|
-
k(ue * v + 1), ue > 1 && M(ue);
|
|
1998
|
-
}, [v]), S = ee((z, { size: Q }) => {
|
|
1999
|
-
const ue = Math.floor(Q.height / v);
|
|
2000
|
-
A(ue);
|
|
2001
|
-
}, [v]), N = un(), L = N.getMode();
|
|
2002
|
-
let O = null;
|
|
2003
|
-
L?.key === "edit" && (O = L.args?.stateAndCoords);
|
|
2004
|
-
const $ = W(() => {
|
|
2005
|
-
let z = O?.editState;
|
|
2006
|
-
return z || (z = jd(() => f.getRange(g).getCell())), e(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", gap: 4 }, children: e(Vd, { ref: h, activeCoords: g, sheet: f, onFocus: () => {
|
|
2007
|
-
n?.startEdit({ autoFocus: !1, editMode: !0, cell: g });
|
|
2008
|
-
}, defaultTextStyle: w, useRichStyling: !1, disabled: x, onChangeEdit: (Q) => {
|
|
2009
|
-
if (Q.dirty !== void 0) {
|
|
2010
|
-
const ue = { sheet: f, coords: g, editState: Q };
|
|
2011
|
-
N.setMode((Le) => ({ ...Le, args: { ...Le?.args, stateAndCoords: ue } }));
|
|
2012
|
-
}
|
|
2013
|
-
}, editState: z, commands: u, onCancelEdit: () => {
|
|
2014
|
-
n?.cancelEdit(), n?.focus();
|
|
2015
|
-
}, onSubmitEdit: () => {
|
|
2016
|
-
n?.submitEdit(), n?.focus();
|
|
2017
|
-
}, linesVisible: I }) });
|
|
2018
|
-
}, [f, O, g, I, n]), D = Se(null), E = W(() => c ? a({ names: t.getNames(), workbook: t, ...m }, D) : null, [a, m, c, f, t, x]), Y = W(() => j(Po, { elevation: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 0, backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})`, border: (z) => `solid ${x ? z.palette.action.disabled : he(z.palette.divider, 0.2)} 1px` }, children: [e(ft, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: !0, outlined: !1, color: "warning", "aria-label": "cancel-formula-edit", icon: P(e(Rc, {})), tooltipProps: { label: "Cancel", simple: !0 }, disabled: x || O === null, onMouseDown: (z) => {
|
|
2019
|
-
z.button === 0 && z.preventDefault();
|
|
2020
|
-
}, onClick: () => {
|
|
2021
|
-
n.cancelEdit();
|
|
2022
|
-
} }), e(ft, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: !0, outlined: !1, color: "primary", "aria-label": "commit-formula-edit", icon: P(e(Mc, {})), tooltipProps: { label: "Enter", simple: !0 }, disabled: x || O === null, onMouseDown: (z) => {
|
|
2023
|
-
z.button === 0 && z.preventDefault();
|
|
2024
|
-
}, onClick: () => {
|
|
2025
|
-
n.submitEdit();
|
|
2026
|
-
} }), e(ft, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: !0, outlined: !1, disabled: !0, "aria-label": "commit-formula-function", icon: P(e(Nc, { sx: { transform: "scale(0.85)" } })), tooltipProps: { label: "Insert Function", simple: !0 }, onMouseDown: (z) => {
|
|
2027
|
-
z.button === 0 && z.preventDefault();
|
|
2028
|
-
} })] }), [x, O]), Z = at(), [X, _] = U(!1), ne = W(() => j(B, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", gap: (z) => z.spacing(0.5), alignItems: "start" }, children: [Y, j(Po, { elevation: 0, sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", fontFamily: (z) => z.typography.fontFamily, fontSize: 11 * Bt.getDeviceScale(), "& .editor-placement": { top: "2px !important" }, boxShadow: "none", borderRadius: (z) => `${z.shape.borderRadius}px`, backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})`, border: (z) => `solid ${x ? z.palette.action.disabled : he(z.palette.divider, 0.2)} 1px`, "& textarea": { color: (z) => x ? `${z.palette.text.disabled} !important` : z.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: () => _(!0), onBlur: () => _(!1), onMouseDown: (z) => {
|
|
2029
|
-
z.target?.classList.contains("react-resizable-handle") && z.preventDefault();
|
|
2030
|
-
}, children: [e(B, { className: "formula-editor", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", alignSelf: "baseline", paddingLeft: (z) => z.spacing(1), paddingRight: (z) => z.spacing(1) }, children: e(Gp.ResizableBox, { height: C, draggableOpts: { grid: [v, v] }, minConstraints: [v, v], maxConstraints: [15 * v, 15 * v], onResize: S, onResizeStop: R, resizeHandles: ["s"], axis: "y", style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: $ }) }), e(ft, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: !0, outlined: !1, "aria-label": "toggle-expand-formula-edit", icon: P(e(I > 1 ? Nd : vi, {})), tooltipProps: { label: (I > 1 ? "Collapse" : "Expand") + " Formula Bar", simple: !0 }, onMouseDown: (z) => {
|
|
2031
|
-
z.button === 0 && z.preventDefault();
|
|
2032
|
-
}, onClick: () => {
|
|
2033
|
-
const z = I > 1 ? 1 : T;
|
|
2034
|
-
k(z * v + 1), A(z);
|
|
2035
|
-
} }), e(B, { sx: { position: "absolute", width: "100%", height: "2px", bottom: "0", willChange: "opacity", transition: "opacity 60ms ease-in", opacity: X ? 1 : 0, borderBottomWidth: "2px", borderBottomStyle: "solid", borderBottomColor: (z) => z.palette.primary.main, borderRadius: (z) => `${z.shape.borderRadius}px` } })] })] }), [Y, $, X, I, v]), ae = W(() => E || ne ? !E && ne ? ne : E && !ne ? E : e(se, { children: e(Gn, { 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='${Z.palette.text.icon ?? Z.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: E, elementAfter: ne }) }) : null, [E, ne]), G = zt(i, () => ({ isFormulaBarElement: () => !0, getNamedCollectionEditorElement: () => D.current }), []);
|
|
2036
|
-
return e(B, { sx: { display: "flex", flexDirection: "row", gap: (z) => z.spacing(0.5), ...o }, ref: G, ...d, children: ae });
|
|
2037
|
-
}));
|
|
2038
|
-
Xi.displayName = "FormulaBar";
|
|
2039
|
-
const Ki = K(J((r, i) => {
|
|
2040
|
-
const { filter: o, commands: t, disabled: n, sx: l, floatReference: c, ...m } = r, a = W(() => ({}), []), s = W(() => ({ commandHook: { beforeExecute: (f, p) => c.closeAll(), onExecute() {
|
|
2041
|
-
}, onError() {
|
|
2042
|
-
console.log("onError");
|
|
2043
|
-
} }, disabled: n, parentFloat: c }), [n, c]), u = W(() => ({ ...a, ...s, variant: ie.Menuitem }), [a, s]), d = j(se, { children: [e(F, { ...u, command: t.getCommand("sortAscending"), icon: P(e(Vn, {})) }), e(F, { ...u, command: t.getCommand("sortDescending"), icon: P(e(gi, {})) }), e(re, { orientation: "horizontal" }), e(F, { ...u, command: t.getCommand("autoFilterClear"), icon: P(e(pr, {})) }), []] });
|
|
2044
|
-
return e(B, { ref: i, sx: { paddingTop: "4px", paddingBottom: "4px", display: "flex", flexDirection: "column", ...l }, ...m, children: d });
|
|
2045
|
-
}));
|
|
2046
|
-
Ki.displayName = "FilterColumnMenu";
|
|
2047
|
-
const Kp = K(J((r, i) => {
|
|
2048
|
-
const { children: o, className: t, disabled: n, style: l, filter: c, ...m } = r, a = zt(i, () => ({ isFilters: () => !0 }), []);
|
|
2049
|
-
return e("div", { ref: a, className: Oe("filters", t), style: { position: "relative", display: "flex", flexDirection: "column", alignItems: "center", gap: "8px", ...l }, ...m, children: j("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: [e("div", { children: c.getName() }), e("div", { children: "Filter Widget" })] }) });
|
|
2050
|
-
}));
|
|
2051
|
-
Kp.displayName = "Filters";
|
|
2052
|
-
const Yi = K(J((r, i) => {
|
|
2053
|
-
const { children: o, sheet: t, style: n, className: l, value: c, index: m, editing: a, editable: s, disabled: u, selectedIndex: d, dragging: f, borderColor: p, borderWidth: g, activeColor: y, background: b = "white", tabRadius: x = 4, gridTheme: h, ...w } = r, [v, C] = U(() => !!t && t.getProtection().isLocked()), [k, T] = U(() => t ? t.getTabColor() : null);
|
|
2054
|
-
Ue(t, { onProtectionChange: () => {
|
|
2055
|
-
C(t.getProtection().isLocked());
|
|
2056
|
-
}, onTabColorChange: () => {
|
|
2057
|
-
T(t.getTabColor());
|
|
2058
|
-
}, onStyleChange: () => {
|
|
2059
|
-
T(t.getTabColor());
|
|
2060
|
-
} });
|
|
2061
|
-
const M = at(), I = d === m;
|
|
2062
|
-
let A = null, R = null;
|
|
2063
|
-
if (k || f) {
|
|
2064
|
-
let L = b;
|
|
2065
|
-
k ? (R = k.toBlackOrWhite().toCSS(), L = k?.toCSS()) : I || (L = M.palette.background.paper), A = e(B, { sx: { position: "absolute", boxSizing: "border-box", top: "3px", left: "4px", right: "4.5px", bottom: "1.5px", opacity: I ? "50%" : "100%", borderRadius: "4px", border: (O) => I ? `${b} solid 1px` : `${O.palette.divider} solid 1px`, background: I && k ? `linear-gradient(0deg, ${L} 0%, transparent)` : L } });
|
|
2066
|
-
}
|
|
2067
|
-
let S = null;
|
|
2068
|
-
typeof p == "string" ? S = p : p?.toCSS && (S = p.toCSS());
|
|
2069
|
-
const N = I ? e(B, { sx: { width: "100%", borderRadius: "4px", minWidth: "4px", height: "2px", backgroundColor: (L) => L.palette.primary.main } }) : null;
|
|
2070
|
-
return e(Ti, { theme: I ? h ?? M : M, children: e(B, { ref: i, className: Oe(l), sx: { ...n, display: "flex", flexDirection: "column", minHeight: "0px", fontWeight: I ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", lineHeight: "1", textTransform: "none", minWidth: "unset", cursor: f ? "grabbing" : void 0 }, ...w, children: e(Bd, { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, radius: x, strokeColor: I ? S : "transparent", children: e(nn, { sx: { textTransform: "none", borderRadius: "0px", minHeight: "0px", paddingLeft: "11px", paddingRight: "12px", paddingTop: "3px", flex: "1 1 100%", paddingBottom: "3px", fontWeight: I ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", transition: "none", cursor: f ? "grabbing" : void 0, color: I ? "primary" : R || "text.secondary", backgroundColor: I ? b : "transparent", "&:hover:not([disabled])": { backgroundColor: I ? b : "transparent" }, "& input": { color: (L) => `${L.palette.text.primary}`, textAlign: "center", fontWeight: "500" }, marginTop: "0px", minWidth: "unset" }, disabled: u, disableRipple: a, component: "div", children: j(se, { children: [A, j(B, { sx: { zIndex: "1", display: "flex", flexDirection: "row", alignItems: "center" }, children: [j(B, { sx: { display: "flex", flexDirection: "column", alignItems: "center", rowGap: "1px", lineHeight: "1", marginTop: I ? void 0 : "1px" }, children: [o, N] }), v ? e(dn, { sx: { scale: "0.80", marginLeft: "2px", width: "22px", height: "22px" }, color: "secondary" }) : e(B, { sx: { minHeight: "22px" } })] })] }) }, c + ":" + m) }) }) });
|
|
2071
|
-
}));
|
|
2072
|
-
Yi.displayName = "SheetTab";
|
|
2073
|
-
const Zi = K(J((r, i) => {
|
|
2074
|
-
const { workbook: o, index: t, commands: n, scope: l = "sheet", disabled: c, floatReference: m, sx: a, className: s, tabStripRef: u, ...d } = r, [f, p] = U(o?.getProtection());
|
|
2075
|
-
Ue(o, { onProtectionChange: (h) => {
|
|
2076
|
-
p(h?.getProtection());
|
|
2077
|
-
} });
|
|
2078
|
-
const g = W(() => ({}), []), y = W(() => ({ commandHook: { beforeExecute: (h, w) => m.closeAll(), onExecute() {
|
|
2079
|
-
}, onError() {
|
|
2080
|
-
console.log("onError");
|
|
2081
|
-
} }, scope: l, commandState: t, disabled: c || t === void 0, parentFloat: m }), [c, m]), b = W(() => ({ ...g, ...y }), [g, y]), x = j(se, { children: [e(F, { command: n.getCommand("addSheet"), commandState: t, ...b, variant: ie.Menuitem }), e(F, { command: n.getCommand("deleteSheet"), ...b, variant: ie.Menuitem }), j(xt, { onMouseDown: (h) => {
|
|
2082
|
-
h.button === 0 && h.preventDefault();
|
|
2083
|
-
}, onMouseUp: () => {
|
|
2084
|
-
Promise.resolve(m.closeAll()).then(() => {
|
|
2085
|
-
u?.startEdit(t);
|
|
2086
|
-
});
|
|
2087
|
-
}, disabled: c || !f.isStructureAllowed(), parentFloat: m, children: ["Rename", l !== "sheet" ? " Sheet" : ""] }), e(F, { command: n.getCommand("duplicateSheet"), ...b, variant: ie.Menuitem }), e(F, { command: n?.getCommand("protectionSheetToggle"), ...b, variant: ie.Menuitem, icon: e(dn, {}) }), e(Mo, { variant: ie.Menuitem, command: n.getCommand("formatSheetTabColor"), icon: e(cr, {}), panelProps: { disableAlpha: !0, autoColorLabel: "No Tab Color", autoColorPosition: Eo.End }, parentFloat: m }), e(re, { orientation: "horizontal" }), e(F, { command: n.getCommand("hideSheet"), ...b, variant: ie.Menuitem, icon: P(e(yi, {})) })] });
|
|
2088
|
-
return e(B, { ref: i, className: Oe("menu", s), sx: { ...a }, ...d, children: x });
|
|
2089
|
-
}));
|
|
2090
|
-
Zi.displayName = "SheetTabMenu";
|
|
2091
|
-
const Ji = K(J((r, i) => {
|
|
2092
|
-
const { workbook: o, gridStyle: t, floatReference: n, closeFloatAll: l, className: c, ...m } = r, [a, s] = U(o?.getSheets().getItems()), [u, d] = U(o?.getProtection());
|
|
2093
|
-
Ue(o, { onSheetsChange: (p) => {
|
|
2094
|
-
s(p.getSheets().getItems());
|
|
2095
|
-
}, onProtectionChange: (p) => {
|
|
2096
|
-
d(p?.getProtection());
|
|
2097
|
-
} });
|
|
2098
|
-
const f = W(() => {
|
|
2099
|
-
const p = [], g = o.getSheets().getItems({ visibility: Rt.Visibility.Hidden }), y = o.getSelectedSheet();
|
|
2100
|
-
for (let b = 0; b < g.length; b++) {
|
|
2101
|
-
const x = g[b], h = x.getVisibility();
|
|
2102
|
-
if (h === Rt.Visibility.VeryHidden) continue;
|
|
2103
|
-
const w = y === x, v = x.getProtection().isLocked(), C = x.getTabColor(), k = t?.body.fill ?? "transparent";
|
|
2104
|
-
let T = null, M = null, I = k;
|
|
2105
|
-
C && (I = C.toCSS(), w || (M = C.toBlackOrWhite().toCSS()), T = e(B, { sx: { position: "absolute", display: "flex", flexDirection: "column", top: "4px", left: "40px", right: "8px", bottom: "4px", background: w ? I : "transparent", borderRadius: "4px", border: `solid 1px ${t.header.edgeStrokeFill}` }, children: e(B, { sx: { flex: "1 1 100%", boxSizing: "content-box", opacity: w || h === Rt.Visibility.Hidden ? "50%" : "100%", border: (R) => w ? `${k} solid 1.5px` : `${R.palette.divider} solid 1px`, background: w && C ? `linear-gradient(0deg, ${I} 0%, ${k})` : I, borderRadius: "4px" } }) }));
|
|
2106
|
-
let A = null;
|
|
2107
|
-
v && (A = e(dn, { color: "secondary" })), h !== Rt.Visibility.Visible && (A = P(e(yi, { style: { opacity: u.isStructureAllowed() ? 1 : 0.7 }, color: "secondary" }))), A && (A = e(B, { sx: { display: "flex", flex: "1 1 100%", alignItems: "center", ml: "16px", "& *": { lineHeight: "1em", fontSize: "1.3em" } }, children: A })), p.push(e(xt, { disabled: !u.isStructureAllowed() && h === Rt.Visibility.Hidden, sx: { color: (R) => {
|
|
2108
|
-
let S = w ? R.palette.primary.main : R.palette.text.secondary;
|
|
2109
|
-
return M && (S = M), h === Rt.Visibility.Hidden && (S = Qe(S, R.palette.action.disabledOpacity)), S;
|
|
2110
|
-
}, borderLeft: (R) => `${w ? R.palette.primary.main : "transparent"} solid 2px`, paddingLeft: "4px", fontWeight: w ? "700" : "400", "&:hover": { fontWeight: "700" } }, icon: w ? e(sn, {}) : void 0, onMouseDown: (R) => R.preventDefault(), onMouseUp: () => {
|
|
2111
|
-
Promise.resolve(n.closeAll()).then(() => {
|
|
2112
|
-
try {
|
|
2113
|
-
x.select();
|
|
2114
|
-
} catch (R) {
|
|
2115
|
-
console.error(R);
|
|
2116
|
-
}
|
|
2117
|
-
});
|
|
2118
|
-
}, children: j(se, { children: [T, j(B, { sx: { paddingRight: "0px", paddingLeft: "4px", display: "flex", flexDirection: "row", flex: "1 1 100%", overflow: "hidden", alignItems: "center", zIndex: 2 }, children: [j(B, { className: "sheet-name", sx: { display: "flex", flexDirection: "column", paddingLeft: "8px", paddingRight: "8px", alignItems: "center" }, children: [x.getName(), e(B, { sx: { height: "0px", opacity: "0", fontWeight: "700" }, children: x.getName() })] }), A] })] }) }, "" + b));
|
|
2119
|
-
}
|
|
2120
|
-
return p;
|
|
2121
|
-
}, [o, u, a, n, t]);
|
|
2122
|
-
return e(B, { ref: i, className: Oe("menu", c), ...m, children: f });
|
|
2123
|
-
}));
|
|
2124
|
-
Ji.displayName = "SheetsAllMenu";
|
|
2125
|
-
let Go = !1, Qi = !1, Pt = null;
|
|
2126
|
-
const La = async (r) => {
|
|
2127
|
-
const i = await vo.getDetails();
|
|
2128
|
-
if (Qi || i.isEval()) {
|
|
2129
|
-
try {
|
|
2130
|
-
const o = top ?? window;
|
|
2131
|
-
o.SheetXL || (o.SheetXL = Object.freeze({ getSelectedWorkbook: () => Pt?.getWorkbook(), getSelectedSheet: () => Pt?.getWorkbook().getSelectedSheet(), getSelectedRange: () => Pt?.getWorkbook().getSelectedRange(), getRange: (t) => Pt?.getWorkbook().getRange(t), getSelectedWorkbookElement: () => Pt, getLicenseManager: () => vo, moreExamples: () => {
|
|
2132
|
-
console.table({ "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().updateStyle({ fill: 'accent4' })": { Summary: "Set fill to theme color 4." }, "SheetXL.getRange('E:L').updateStyle({ fill: 'accent1 lumMod 90 lumOff 40' })": { Summary: "Set some columns to a modified theme color." }, "SheetXL.getRange('e5:f10').updateStyle({ 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).updateStyle({ 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').updateStyle({ 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." } });
|
|
2133
|
-
} }));
|
|
2134
|
-
} catch (o) {
|
|
2135
|
-
o instanceof DOMException || console.error(o), Go = !0;
|
|
2136
|
-
}
|
|
2137
|
-
if (Pt !== r && (Pt = r, !Go)) try {
|
|
2138
|
-
Go = !0, (top ?? window).SheetXL && (await vo._validate(!0), vo.wasPrinted() && (() => {
|
|
2139
|
-
Jt.consoleWithNoSource(`%cTip: You can access the API directly in the console.
|
|
2140
|
-
Try
|
|
2141
|
-
%c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c
|
|
2142
|
-
>%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;"), Go = !0;
|
|
2143
|
-
const o = document.getElementById("openEditorLink");
|
|
2144
|
-
o && o.addEventListener("click", (t) => {
|
|
2145
|
-
t.preventDefault(), console.log("openScriptEditor called from console");
|
|
2146
|
-
});
|
|
2147
|
-
})());
|
|
2148
|
-
} catch (o) {
|
|
2149
|
-
o instanceof DOMException || console.error(o);
|
|
2150
|
-
}
|
|
2151
|
-
}
|
|
2152
|
-
}, km = (r) => {
|
|
2153
|
-
Qi = r;
|
|
2154
|
-
};
|
|
2155
|
-
var Yp = function() {
|
|
2156
|
-
}, el = typeof window < "u", Zp = el ? St : me, Ha = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
2157
|
-
const No = el && window.ResizeObserver !== void 0 ? function() {
|
|
2158
|
-
var r = U(null), i = r[0], o = r[1], t = U(Ha), n = t[0], l = t[1], c = W(function() {
|
|
2159
|
-
return new window.ResizeObserver(function(m) {
|
|
2160
|
-
if (m[0]) {
|
|
2161
|
-
var a = m[0].contentRect, s = a.x, u = a.y, d = a.width, f = a.height, p = a.top, g = a.left, y = a.bottom, b = a.right;
|
|
2162
|
-
l({ x: s, y: u, width: d, height: f, top: p, left: g, bottom: y, right: b });
|
|
2163
|
-
}
|
|
2164
|
-
});
|
|
2165
|
-
}, []);
|
|
2166
|
-
return Zp(function() {
|
|
2167
|
-
if (i) return c.observe(i), function() {
|
|
2168
|
-
c.disconnect();
|
|
2169
|
-
};
|
|
2170
|
-
}, [i]), [o, n];
|
|
2171
|
-
} : function() {
|
|
2172
|
-
return [Yp, Ha];
|
|
2173
|
-
};
|
|
2174
|
-
function Kn() {
|
|
2175
|
-
return Kn = Object.assign ? Object.assign.bind() : function(r) {
|
|
2176
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2177
|
-
var o = arguments[i];
|
|
2178
|
-
for (var t in o) ({}).hasOwnProperty.call(o, t) && (r[t] = o[t]);
|
|
2179
|
-
}
|
|
2180
|
-
return r;
|
|
2181
|
-
}, Kn.apply(null, arguments);
|
|
2182
|
-
}
|
|
2183
|
-
function tl(r, i) {
|
|
2184
|
-
if (r == null) return {};
|
|
2185
|
-
var o = {};
|
|
2186
|
-
for (var t in r) if ({}.hasOwnProperty.call(r, t)) {
|
|
2187
|
-
if (i.indexOf(t) !== -1) continue;
|
|
2188
|
-
o[t] = r[t];
|
|
2189
|
-
}
|
|
2190
|
-
return o;
|
|
2191
|
-
}
|
|
2192
|
-
function Yn(r, i) {
|
|
2193
|
-
return Yn = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, t) {
|
|
2194
|
-
return o.__proto__ = t, o;
|
|
2195
|
-
}, Yn(r, i);
|
|
2196
|
-
}
|
|
2197
|
-
function ol(r, i) {
|
|
2198
|
-
r.prototype = Object.create(i.prototype), r.prototype.constructor = r, Yn(r, i);
|
|
2199
|
-
}
|
|
2200
|
-
function za(r, i) {
|
|
2201
|
-
return r.replace(new RegExp("(^|\\s)" + i + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
2202
|
-
}
|
|
2203
|
-
const Wa = !1, nl = le.createContext(null);
|
|
2204
|
-
var rl = function(r) {
|
|
2205
|
-
return r.scrollTop;
|
|
2206
|
-
}, ko = "unmounted", Mt = "exited", Nt = "entering", Gt = "entered", Zn = "exiting", gt = function(r) {
|
|
2207
|
-
function i(t, n) {
|
|
2208
|
-
var l;
|
|
2209
|
-
l = r.call(this, t, n) || this;
|
|
2210
|
-
var c, m = n && !n.isMounting ? t.enter : t.appear;
|
|
2211
|
-
return l.appearStatus = null, t.in ? m ? (c = Mt, l.appearStatus = Nt) : c = Gt : c = t.unmountOnExit || t.mountOnEnter ? ko : Mt, l.state = { status: c }, l.nextCallback = null, l;
|
|
2212
|
-
}
|
|
2213
|
-
ol(i, r), i.getDerivedStateFromProps = function(t, n) {
|
|
2214
|
-
return t.in && n.status === ko ? { status: Mt } : null;
|
|
2215
|
-
};
|
|
2216
|
-
var o = i.prototype;
|
|
2217
|
-
return o.componentDidMount = function() {
|
|
2218
|
-
this.updateStatus(!0, this.appearStatus);
|
|
2219
|
-
}, o.componentDidUpdate = function(t) {
|
|
2220
|
-
var n = null;
|
|
2221
|
-
if (t !== this.props) {
|
|
2222
|
-
var l = this.state.status;
|
|
2223
|
-
this.props.in ? l !== Nt && l !== Gt && (n = Nt) : l !== Nt && l !== Gt || (n = Zn);
|
|
2224
|
-
}
|
|
2225
|
-
this.updateStatus(!1, n);
|
|
2226
|
-
}, o.componentWillUnmount = function() {
|
|
2227
|
-
this.cancelNextCallback();
|
|
2228
|
-
}, o.getTimeouts = function() {
|
|
2229
|
-
var t, n, l, c = this.props.timeout;
|
|
2230
|
-
return t = n = l = c, c != null && typeof c != "number" && (t = c.exit, n = c.enter, l = c.appear !== void 0 ? c.appear : n), { exit: t, enter: n, appear: l };
|
|
2231
|
-
}, o.updateStatus = function(t, n) {
|
|
2232
|
-
if (t === void 0 && (t = !1), n !== null) if (this.cancelNextCallback(), n === Nt) {
|
|
2233
|
-
if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
|
2234
|
-
var l = this.props.nodeRef ? this.props.nodeRef.current : Kt.findDOMNode(this);
|
|
2235
|
-
l && rl(l);
|
|
2236
|
-
}
|
|
2237
|
-
this.performEnter(t);
|
|
2238
|
-
} else this.performExit();
|
|
2239
|
-
else this.props.unmountOnExit && this.state.status === Mt && this.setState({ status: ko });
|
|
2240
|
-
}, o.performEnter = function(t) {
|
|
2241
|
-
var n = this, l = this.props.enter, c = this.context ? this.context.isMounting : t, m = this.props.nodeRef ? [c] : [Kt.findDOMNode(this), c], a = m[0], s = m[1], u = this.getTimeouts(), d = c ? u.appear : u.enter;
|
|
2242
|
-
!t && !l || Wa ? this.safeSetState({ status: Gt }, function() {
|
|
2243
|
-
n.props.onEntered(a);
|
|
2244
|
-
}) : (this.props.onEnter(a, s), this.safeSetState({ status: Nt }, function() {
|
|
2245
|
-
n.props.onEntering(a, s), n.onTransitionEnd(d, function() {
|
|
2246
|
-
n.safeSetState({ status: Gt }, function() {
|
|
2247
|
-
n.props.onEntered(a, s);
|
|
2248
|
-
});
|
|
2249
|
-
});
|
|
2250
|
-
}));
|
|
2251
|
-
}, o.performExit = function() {
|
|
2252
|
-
var t = this, n = this.props.exit, l = this.getTimeouts(), c = this.props.nodeRef ? void 0 : Kt.findDOMNode(this);
|
|
2253
|
-
n && !Wa ? (this.props.onExit(c), this.safeSetState({ status: Zn }, function() {
|
|
2254
|
-
t.props.onExiting(c), t.onTransitionEnd(l.exit, function() {
|
|
2255
|
-
t.safeSetState({ status: Mt }, function() {
|
|
2256
|
-
t.props.onExited(c);
|
|
2257
|
-
});
|
|
2258
|
-
});
|
|
2259
|
-
})) : this.safeSetState({ status: Mt }, function() {
|
|
2260
|
-
t.props.onExited(c);
|
|
2261
|
-
});
|
|
2262
|
-
}, o.cancelNextCallback = function() {
|
|
2263
|
-
this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
|
|
2264
|
-
}, o.safeSetState = function(t, n) {
|
|
2265
|
-
n = this.setNextCallback(n), this.setState(t, n);
|
|
2266
|
-
}, o.setNextCallback = function(t) {
|
|
2267
|
-
var n = this, l = !0;
|
|
2268
|
-
return this.nextCallback = function(c) {
|
|
2269
|
-
l && (l = !1, n.nextCallback = null, t(c));
|
|
2270
|
-
}, this.nextCallback.cancel = function() {
|
|
2271
|
-
l = !1;
|
|
2272
|
-
}, this.nextCallback;
|
|
2273
|
-
}, o.onTransitionEnd = function(t, n) {
|
|
2274
|
-
this.setNextCallback(n);
|
|
2275
|
-
var l = this.props.nodeRef ? this.props.nodeRef.current : Kt.findDOMNode(this), c = t == null && !this.props.addEndListener;
|
|
2276
|
-
if (l && !c) {
|
|
2277
|
-
if (this.props.addEndListener) {
|
|
2278
|
-
var m = this.props.nodeRef ? [this.nextCallback] : [l, this.nextCallback], a = m[0], s = m[1];
|
|
2279
|
-
this.props.addEndListener(a, s);
|
|
2280
|
-
}
|
|
2281
|
-
t != null && setTimeout(this.nextCallback, t);
|
|
2282
|
-
} else setTimeout(this.nextCallback, 0);
|
|
2283
|
-
}, o.render = function() {
|
|
2284
|
-
var t = this.state.status;
|
|
2285
|
-
if (t === ko) return null;
|
|
2286
|
-
var n = this.props, l = n.children;
|
|
2287
|
-
n.in, n.mountOnEnter, n.unmountOnExit, n.appear, n.enter, n.exit, n.timeout, n.addEndListener, n.onEnter, n.onEntering, n.onEntered, n.onExit, n.onExiting, n.onExited, n.nodeRef;
|
|
2288
|
-
var c = tl(n, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
|
|
2289
|
-
return le.createElement(nl.Provider, { value: null }, typeof l == "function" ? l(t, c) : le.cloneElement(le.Children.only(l), c));
|
|
2290
|
-
}, i;
|
|
2291
|
-
}(le.Component);
|
|
2292
|
-
function $t() {
|
|
2293
|
-
}
|
|
2294
|
-
gt.contextType = nl, gt.propTypes = {}, gt.defaultProps = { in: !1, mountOnEnter: !1, unmountOnExit: !1, appear: !1, enter: !0, exit: !0, onEnter: $t, onEntering: $t, onEntered: $t, onExit: $t, onExiting: $t, onExited: $t }, gt.UNMOUNTED = ko, gt.EXITED = Mt, gt.ENTERING = Nt, gt.ENTERED = Gt, gt.EXITING = Zn;
|
|
2295
|
-
var Rn = function(r, i) {
|
|
2296
|
-
return r && i && i.split(" ").forEach(function(o) {
|
|
2297
|
-
return n = o, void ((t = r).classList ? t.classList.remove(n) : typeof t.className == "string" ? t.className = za(t.className, n) : t.setAttribute("class", za(t.className && t.className.baseVal || "", n)));
|
|
2298
|
-
var t, n;
|
|
2299
|
-
});
|
|
2300
|
-
}, Jn = function(r) {
|
|
2301
|
-
function i() {
|
|
2302
|
-
for (var t, n = arguments.length, l = new Array(n), c = 0; c < n; c++) l[c] = arguments[c];
|
|
2303
|
-
return (t = r.call.apply(r, [this].concat(l)) || this).appliedClasses = { appear: {}, enter: {}, exit: {} }, t.onEnter = function(m, a) {
|
|
2304
|
-
var s = t.resolveArguments(m, a), u = s[0], d = s[1];
|
|
2305
|
-
t.removeClasses(u, "exit"), t.addClass(u, d ? "appear" : "enter", "base"), t.props.onEnter && t.props.onEnter(m, a);
|
|
2306
|
-
}, t.onEntering = function(m, a) {
|
|
2307
|
-
var s = t.resolveArguments(m, a), u = s[0], d = s[1] ? "appear" : "enter";
|
|
2308
|
-
t.addClass(u, d, "active"), t.props.onEntering && t.props.onEntering(m, a);
|
|
2309
|
-
}, t.onEntered = function(m, a) {
|
|
2310
|
-
var s = t.resolveArguments(m, a), u = s[0], d = s[1] ? "appear" : "enter";
|
|
2311
|
-
t.removeClasses(u, d), t.addClass(u, d, "done"), t.props.onEntered && t.props.onEntered(m, a);
|
|
2312
|
-
}, t.onExit = function(m) {
|
|
2313
|
-
var a = t.resolveArguments(m)[0];
|
|
2314
|
-
t.removeClasses(a, "appear"), t.removeClasses(a, "enter"), t.addClass(a, "exit", "base"), t.props.onExit && t.props.onExit(m);
|
|
2315
|
-
}, t.onExiting = function(m) {
|
|
2316
|
-
var a = t.resolveArguments(m)[0];
|
|
2317
|
-
t.addClass(a, "exit", "active"), t.props.onExiting && t.props.onExiting(m);
|
|
2318
|
-
}, t.onExited = function(m) {
|
|
2319
|
-
var a = t.resolveArguments(m)[0];
|
|
2320
|
-
t.removeClasses(a, "exit"), t.addClass(a, "exit", "done"), t.props.onExited && t.props.onExited(m);
|
|
2321
|
-
}, t.resolveArguments = function(m, a) {
|
|
2322
|
-
return t.props.nodeRef ? [t.props.nodeRef.current, m] : [m, a];
|
|
2323
|
-
}, t.getClassNames = function(m) {
|
|
2324
|
-
var a = t.props.classNames, s = typeof a == "string", u = s ? (s && a ? a + "-" : "") + m : a[m];
|
|
2325
|
-
return { baseClassName: u, activeClassName: s ? u + "-active" : a[m + "Active"], doneClassName: s ? u + "-done" : a[m + "Done"] };
|
|
2326
|
-
}, t;
|
|
2327
|
-
}
|
|
2328
|
-
ol(i, r);
|
|
2329
|
-
var o = i.prototype;
|
|
2330
|
-
return o.addClass = function(t, n, l) {
|
|
2331
|
-
var c = this.getClassNames(n)[l + "ClassName"], m = this.getClassNames("enter").doneClassName;
|
|
2332
|
-
n === "appear" && l === "done" && m && (c += " " + m), l === "active" && t && rl(t), c && (this.appliedClasses[n][l] = c, function(a, s) {
|
|
2333
|
-
a && s && s.split(" ").forEach(function(u) {
|
|
2334
|
-
return f = u, void ((d = a).classList ? d.classList.add(f) : function(p, g) {
|
|
2335
|
-
return p.classList ? !!g && p.classList.contains(g) : (" " + (p.className.baseVal || p.className) + " ").indexOf(" " + g + " ") !== -1;
|
|
2336
|
-
}(d, f) || (typeof d.className == "string" ? d.className = d.className + " " + f : d.setAttribute("class", (d.className && d.className.baseVal || "") + " " + f)));
|
|
2337
|
-
var d, f;
|
|
2338
|
-
});
|
|
2339
|
-
}(t, c));
|
|
2340
|
-
}, o.removeClasses = function(t, n) {
|
|
2341
|
-
var l = this.appliedClasses[n], c = l.base, m = l.active, a = l.done;
|
|
2342
|
-
this.appliedClasses[n] = {}, c && Rn(t, c), m && Rn(t, m), a && Rn(t, a);
|
|
2343
|
-
}, o.render = function() {
|
|
2344
|
-
var t = this.props;
|
|
2345
|
-
t.classNames;
|
|
2346
|
-
var n = tl(t, ["classNames"]);
|
|
2347
|
-
return le.createElement(gt, Kn({}, n, { onEnter: this.onEnter, onEntered: this.onEntered, onEntering: this.onEntering, onExit: this.onExit, onExiting: this.onExiting, onExited: this.onExited }));
|
|
2348
|
-
}, i;
|
|
2349
|
-
}(le.Component);
|
|
2350
|
-
Jn.defaultProps = { classNames: "" }, Jn.propTypes = {};
|
|
2351
|
-
const Mn = 0.12, ja = (r, i) => {
|
|
2352
|
-
const o = {}, t = (a) => {
|
|
2353
|
-
const s = a.palette?.background.default ?? "rgba(255,255,255,1)";
|
|
2354
|
-
return { text: { fontFamily: a.typography?.fontFamily ?? "Calibri", fontSize: a.typography?.fontSize ?? 8.25, fontWeight: a.typography?.fontWeightRegular ?? "400", fill: a.palette.mode === "dark" ? a.palette?.text?.secondary : a.palette?.text?.primary }, fill: s, strokeFill: it(s, Mn, a.palette?.mode), darkMode: a.palette.mode === "dark" };
|
|
2355
|
-
}, n = t(i);
|
|
2356
|
-
o.body = t(r), o.header = { ...o.body, strokeFill: it(o.body.fill, Mn, r.palette?.mode), fill: i && r.palette.mode === "dark" && i.palette.mode !== r.palette.mode ? o.body.fill : it(o.body.fill, 0.055, r.palette?.mode), edgeStrokeFill: r.palette.mode === "dark" ? o.body.strokeFill : it(o.body.fill, 0.328, r.palette?.mode) }, o.headerHover = (a) => ({ ...o.header, strokeFill: it(a?.fill ?? o.body.fill, 0.22, r.palette?.mode), fill: it(a?.fill ?? o.header.fill, 0.065, r.palette?.mode), text: { ...a?.text, fontWeight: r.typography?.fontWeightBold } });
|
|
2357
|
-
const l = it(r.palette.mode !== "dark" ? r.palette.primary.light : r.palette.primary.main, 0.055, r.palette?.mode);
|
|
2358
|
-
o.headerSelect = { ...o.header, strokeFill: r.palette.primary.main, fill: Qe(l, 0.2), text: { ...o.header.text, fill: r.palette.primary.main }, dividerStrokeFill: Qe(l, 0.7) }, o.headerSelectAll = { ...o.headerSelect, fill: Qe(l, 0.9), text: { ...o.headerSelect.text, fill: r.palette.primary.contrastText }, edgeStrokeFill: o.headerSelect.strokeFill }, o.buttonSurface = { ...n, strokeFill: it(n.fill, Mn, i.palette?.mode), fill: i && i.palette.mode === "dark" && i.palette.mode !== r.palette.mode ? n.fill : it(n.fill, 0.055, i.palette?.mode), edgeStrokeFill: i.palette.mode === "dark" ? n.strokeFill : it(n.fill, 0.328, i.palette?.mode) }, o.headerSelection = { fill: r.palette?.primary?.main ? Qe(r.palette?.primary?.main, 0.1) : void 0, strokeFill: r.palette?.primary?.main }, o.headerSelectionInactive = { ...o.headerSelection, fill: r.palette?.divider ? Qe(r.palette?.divider, 0.05) : void 0, strokeFill: "transparent" };
|
|
2359
|
-
const c = i ?? r, m = c.palette.mode === "dark";
|
|
2360
|
-
return o.selection = { fill: c.palette?.primary?.main ? Qe(c.palette?.primary?.main, 0.1) : void 0, strokeFill: c.palette?.primary?.main }, o.selectionInactive = { ...o.selection, fill: c.palette?.divider ? Qe(c.palette?.divider, 0.05) : void 0, strokeFill: "transparent" }, o.selectionRemove = { ...o.selection, fill: Qe(c.palette.warning.light, 0.05), strokeFill: c.palette.warning.dark }, i && (o.body = t(i)), o.colorShadow = Qe(c.palette.action.active, 0.5), o.colorGrey = c.palette.action.active, o.filterDarkInvert = m ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", o;
|
|
2361
|
-
}, Io = K(J((r, i) => {
|
|
2362
|
-
const { children: o, sx: t, parentFloat: n, ...l } = r, c = zt(i, () => ({}), []), [m, a] = No(), s = Se(null), u = Se(null), [d, f] = le.useReducer((C) => C + 1, 0), [p, g] = U(null), [y, b] = U(null), [x, h] = U(null), { reference: w } = oo({ parentFloat: n, label: "overflow" });
|
|
2363
|
-
St(() => {
|
|
2364
|
-
u.current = { refs: [] };
|
|
2365
|
-
const C = [], k = le.Children.toArray(o);
|
|
2366
|
-
let T = 0;
|
|
2367
|
-
k.forEach((M, I) => {
|
|
2368
|
-
C.push(e(B, { sx: { display: "flex" }, ref: (A) => {
|
|
2369
|
-
T++, T === k.length && f();
|
|
2370
|
-
const R = { current: null };
|
|
2371
|
-
R.current = A, u.current.refs[I] = R;
|
|
2372
|
-
}, children: M }, I));
|
|
2373
|
-
}), g(C);
|
|
2374
|
-
}, [o, a]), St(() => {
|
|
2375
|
-
if (!p) return;
|
|
2376
|
-
const C = u.current.refs;
|
|
2377
|
-
if (!c.current || !C || C.length === 0) return b(null), void h(null);
|
|
2378
|
-
const k = c.current?.getBoundingClientRect(), T = [], M = [];
|
|
2379
|
-
let I = 0, A = !1;
|
|
2380
|
-
for (let S = 0; !A && S < C.length; S++) {
|
|
2381
|
-
const N = C[S];
|
|
2382
|
-
if (!N) continue;
|
|
2383
|
-
if (!N.current) {
|
|
2384
|
-
A = !0;
|
|
2385
|
-
continue;
|
|
2386
|
-
}
|
|
2387
|
-
const L = N.current.getBoundingClientRect();
|
|
2388
|
-
I += L?.width, I > k.width && (A = !0);
|
|
2389
|
-
}
|
|
2390
|
-
if (!A) return b(null), void h([]);
|
|
2391
|
-
const R = s.current?.getBoundingClientRect();
|
|
2392
|
-
I = 0;
|
|
2393
|
-
for (let S = 0; S < C.length; S++) {
|
|
2394
|
-
const N = C[S];
|
|
2395
|
-
let L = !1;
|
|
2396
|
-
if (N.current) {
|
|
2397
|
-
const O = N.current.getBoundingClientRect();
|
|
2398
|
-
I += O?.width, I < k.width - R.width && (L = !0);
|
|
2399
|
-
}
|
|
2400
|
-
L ? T.push(p[S]) : M.push(p[S]);
|
|
2401
|
-
}
|
|
2402
|
-
b(T.length > 0 ? T : null), h(M.length > 0 ? M : null);
|
|
2403
|
-
}, [o, p, a, w, d]);
|
|
2404
|
-
const v = ee((C) => {
|
|
2405
|
-
const k = [];
|
|
2406
|
-
for (let M = 0; M < x.length; M++) {
|
|
2407
|
-
let I = le.Children.toArray(x[M]);
|
|
2408
|
-
const A = I[0];
|
|
2409
|
-
I = le.Children.toArray(A.props.children?.props.children ?? A.props.children);
|
|
2410
|
-
const R = I[0], S = { ...R.props };
|
|
2411
|
-
S.parentFloat && (S.parentFloat = C.floatReference);
|
|
2412
|
-
const N = le.cloneElement(R, S);
|
|
2413
|
-
k.push(N);
|
|
2414
|
-
}
|
|
2415
|
-
const T = e(B, { className: "overflow-palette-popup-panel", sx: { display: "flex", flexDirection: "row", flexWrap: "wrap", rowGap: (M) => M.spacing(0.25), paddingTop: (M) => M.spacing(0.5), paddingBottom: (M) => M.spacing(0.5), paddingLeft: (M) => M.spacing(1), paddingRight: (M) => M.spacing(1), overflow: "hidden" }, children: k });
|
|
2416
|
-
return ke({ ...C, children: T });
|
|
2417
|
-
}, [x]);
|
|
2418
|
-
return j(B, { className: "overflow-palette", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", width: "100%", maxWidth: "100%", ...t }, ref: Fo([c, m, i]), ...l, children: [e(B, { sx: { flexDirection: "row", display: "flex", maxWidth: "100%", flex: "1 1 100%" }, children: y ?? p }), e(B, { sx: { display: x !== null && x.length === 0 ? "none" : "flex", flex: "1 1 0" }, children: e(vt, { createPopupPanel: v, ref: s, parentFloat: w, createTooltip: ({ children: C }, k) => e(rt, { label: "More", description: "More toolbar options…", disabled: k, children: C }), icon: e(Ic, { children: e(Id, {}) }) }) })] });
|
|
2419
|
-
})), al = "https://unpkg.com/@sheetxl/scripting-templates/dist", Jp = (r) => {
|
|
2420
|
-
if (r.metadata?.name) return r.metadata.name;
|
|
2421
|
-
let i = (r.path.split("/").pop() || "").replace(/\.[^/.]+$/, "");
|
|
2422
|
-
return r.metadata?.icon === "formula" ? i.toUpperCase() : (i = i.replace(/([a-z])([A-Z])/g, "$1 $2"), i.replace(/[-_]/g, " ").trim().split(/\s+/).map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "));
|
|
2423
|
-
}, il = async (r) => {
|
|
2424
|
-
const i = Yt.relativePath(r, "./manifest.json"), o = await fetch(i);
|
|
2425
|
-
if (!o.ok) throw new Xn(`Failed to retrieve directory at '${r}': ${o.statusText}`);
|
|
2426
|
-
const t = await o.text();
|
|
2427
|
-
if (t.trim().toLowerCase().startsWith("<!doctype html") || t.trim().toLowerCase().startsWith("<html")) throw new Xn(`Failed to retrieve directory at '${r}'`);
|
|
2428
|
-
let n;
|
|
2429
|
-
try {
|
|
2430
|
-
n = JSON.parse(t);
|
|
2431
|
-
} catch (c) {
|
|
2432
|
-
throw new Error(`Failed to parse directory: ${c.message}. Ensure the file is valid JSON.`);
|
|
2433
|
-
}
|
|
2434
|
-
const l = n.map(async (c) => {
|
|
2435
|
-
try {
|
|
2436
|
-
const m = Yt.relativePath(r, c.path), a = await fetch(m);
|
|
2437
|
-
if (!a.ok) throw new Error(`Failed to fetch file at '${c.path}': ${a.statusText}`);
|
|
2438
|
-
const s = await a.text();
|
|
2439
|
-
let u = c.metadata;
|
|
2440
|
-
return u?.title || (u = { title: Jp(c), ...u }), { path: c.path, content: s, metadata: u };
|
|
2441
|
-
} catch (m) {
|
|
2442
|
-
console.error(m.message);
|
|
2443
|
-
}
|
|
2444
|
-
return null;
|
|
2445
|
-
});
|
|
2446
|
-
return (await Promise.all(l)).filter((c) => c !== null);
|
|
2447
|
-
}, Nn = { fontSize: "0.8rem", marginRight: "4px" }, Qp = K((r) => {
|
|
2448
|
-
const { disabled: i, snippet: o, description: t, handleInsert: n, sx: l, ...c } = r;
|
|
2449
|
-
let m;
|
|
2450
|
-
return m = o.metadata?.icon === "formula" ? e(wi, { sx: Nn }) : o.metadata?.icon === "macro" ? e(ur, { sx: Nn }) : e(Ci, { sx: Nn }), e(xt, { sx: { maxWidth: "460px", display: "flex", "*": { lineHeight: "1.2" }, ...l }, disabled: i, icon: m, onMouseDown: (a) => {
|
|
2451
|
-
a.button === 0 && a.preventDefault();
|
|
2452
|
-
}, onMouseUp: (a) => {
|
|
2453
|
-
a.button === 0 && n(o);
|
|
2454
|
-
}, onKeyDown: (a) => {
|
|
2455
|
-
a.keyCode !== ye.Enter && a.keyCode !== ye.Space || n(o);
|
|
2456
|
-
}, ...c, children: j(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [e(Be, { component: "div", children: o.metadata?.title ?? o.path }), e(Be, { variant: "caption", component: "div", sx: { color: (a) => Qe(a.palette.text.secondary ?? a.palette.text.primary, 0.6), overflow: "hidden", textOverflow: "ellipsis" }, children: o.metadata?.summary })] }) });
|
|
2457
|
-
}), eu = K(J((r, i) => {
|
|
2458
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, scriptPath: c = al, ...m } = r, [a, s] = U([]), [u, d] = U(!0), f = We(o, ["executeSelectedScript"]), p = f[0]?.context?.();
|
|
2459
|
-
me(() => {
|
|
2460
|
-
(async () => {
|
|
2461
|
-
try {
|
|
2462
|
-
const y = await il(c);
|
|
2463
|
-
s(y);
|
|
2464
|
-
} catch {
|
|
2465
|
-
} finally {
|
|
2466
|
-
d(!1);
|
|
2467
|
-
}
|
|
2468
|
-
})();
|
|
2469
|
-
}, [c]);
|
|
2470
|
-
const g = q((y, b) => {
|
|
2471
|
-
if (u) return e("div", { children: "Loading..." });
|
|
2472
|
-
const x = { variant: ie.Menuitem, commandHook: t, scope: "scripts", disabled: l }, h = (C) => {
|
|
2473
|
-
p.getEditor()?.insertSnippet(C.content), y.closeFloat();
|
|
2474
|
-
}, w = [];
|
|
2475
|
-
for (let C = 0; C < a.length; C++) {
|
|
2476
|
-
const k = a[C];
|
|
2477
|
-
k && w.push(e(Qp, { handleInsert: h, snippet: k }, k.path));
|
|
2478
|
-
}
|
|
2479
|
-
const v = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [w.length > 0 ? j(se, { children: [e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: w }), e(re, { orientation: "horizontal" })] }) : null, Pe(F, { ...x, key: "help", command: o.getCommand("help"), icon: P(e(bi, {})) })] });
|
|
2480
|
-
return ke({ ...y, children: v });
|
|
2481
|
-
}, [l, t, n, u, p]);
|
|
2482
|
-
return e(Re, { ref: i, commands: o, disabled: l, commandHook: t, scope: n, label: "Insert Script", tooltip: "Inserts a script from a set of templates.", createPopupPanel: g, icon: P(e(Fc, {})), ...m });
|
|
2483
|
-
})), ll = K(J((r, i) => {
|
|
2484
|
-
const { commands: o, parentFloat: t, commandButtonProps: n, ...l } = r, c = ee((m) => {
|
|
2485
|
-
const { commandButtonProps: a, commandPopupProps: s } = m;
|
|
2486
|
-
return e(se, { children: j("div", { style: { display: "flex", flex: "1 1 100%" }, children: [e("div", { children: e(Io, { parentFloat: t, style: {}, children: e(F, { ...a, command: o.getCommand("saveScripts"), icon: P(e(Oc, {})) }) }) }), e("div", { style: { flex: "1 1 100%" } }), e("div", { children: e(Io, { parentFloat: t, style: {}, children: e(eu, { ...a, commands: o }) }) })] }) });
|
|
2487
|
-
}, [o]);
|
|
2488
|
-
return e(cn, { ref: i, commands: o, parentFloat: t, commandButtonProps: n, createToolbarPalette: c, ...l });
|
|
2489
|
-
}));
|
|
2490
|
-
ll.displayName = "ScriptEditorToolbar";
|
|
2491
|
-
const In = { fontSize: "1rem" }, sl = K(J((r, i) => {
|
|
2492
|
-
const { scriptPath: o = al, onScriptSelect: t, sx: n = pn.EmptyCssProperties, className: l, buttonMinWidth: c = 210, buttonMinHeight: m = 80, gap: a = 12, ...s } = r, [u, d] = U([]), [f, p] = U(!0), [g, y] = U(null);
|
|
2493
|
-
if (me(() => {
|
|
2494
|
-
(async () => {
|
|
2495
|
-
const h = [{ path: null, metadata: { title: "Blank Template...", summary: "Start with an empty script." }, content: "" }];
|
|
2496
|
-
try {
|
|
2497
|
-
p(!0), y(null);
|
|
2498
|
-
const w = await il(o);
|
|
2499
|
-
for (let v = 0; v < w.length; v++) {
|
|
2500
|
-
const C = w[v];
|
|
2501
|
-
C && h.push(C);
|
|
2502
|
-
}
|
|
2503
|
-
} catch (w) {
|
|
2504
|
-
y(w instanceof Error ? w.message : "Failed to load scripts"), w instanceof Xn || console.error("Error loading scripts:", w);
|
|
2505
|
-
} finally {
|
|
2506
|
-
d(h), p(!1);
|
|
2507
|
-
}
|
|
2508
|
-
})();
|
|
2509
|
-
}, [o]), f) return e(B, { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", className: Oe(l, "script-select"), sx: { background: (h) => h.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})`, ...n }, ...s, children: e(ys, {}) });
|
|
2510
|
-
let b = null;
|
|
2511
|
-
g && (b = j(B, { display: "flex", justifyContent: "center", alignItems: "center", className: Oe(l, "script-select", "error-results"), sx: { background: (h) => h.palette.error.light, flex: "0", zIndex: 1e3, flexDirection: "column", padding: (h) => h.spacing(1), border: (h) => `1px solid ${h.palette.error.main}`, borderBottomLeftRadius: 1, borderBottomRightRadius: 1, backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})` }, ...s, children: [e(Be, { color: "error", variant: "h6", component: "div", gutterBottom: !0, children: "Error loading Templates" }), e(Be, { color: "error", component: "div", children: g })] }));
|
|
2512
|
-
const x = (h) => {
|
|
2513
|
-
const w = h.metadata?.icon;
|
|
2514
|
-
return w === "macro" ? e(ur, { sx: In }) : w === "formula" ? e(wi, { sx: In }) : w === "autostart" ? e(Ci, { sx: In }) : null;
|
|
2515
|
-
};
|
|
2516
|
-
return j(B, { ref: i, className: Oe(l, "script-select"), sx: { background: (h) => h.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})`, ...n }, ...s, children: [j(B, { p: 3, className: "script-select-content", sx: { overflow: "auto", flex: "1 1 auto" }, children: [e(Be, { variant: "h6", gutterBottom: !0, children: "Script Template" }), e(Be, { variant: "body2", component: "div", color: "text.secondary", gutterBottom: !0, children: "Choose from a template to provide a starting point to automate tasks or create user defined functions." }), e(Be, { variant: "body2", component: "div", color: "text.secondary", gutterBottom: !0, children: "Templates provide a foundation to customize and meet your specific needs." }), e(B, { sx: { display: "grid", gridTemplateColumns: `repeat(auto-fill, minmax(${c}px, 1fr))`, gap: `${a}px`, padding: 2, paddingLeft: "0px", paddingRight: "0px" }, children: u.map((h, w) => j(nn, { variant: "outlined", sx: { minWidth: c, minHeight: m, display: "flex", flexDirection: "column", justifyContent: "flex-start", alignItems: "flex-start", textAlign: "left", padding: 2, textTransform: "none", overflow: "hidden", ...w === 0 && { borderStyle: "dashed", marginBottom: "8px" }, ...w === 1 && { gridColumn: "1" } }, onClick: () => t?.(h), children: [j(B, { sx: { display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%", marginBottom: 0.5 }, children: [e(Be, { variant: "subtitle2", component: "div", children: h.metadata?.title || h.path.split("/").pop()?.replace(/\.\w+$/, "") || "Untitled" }), x(h)] }), h.metadata?.summary && e(Be, { variant: "body2", component: "div", color: "text.secondary", sx: { overflow: "hidden", display: "flex", flexDirection: "column", textOverflow: "ellipsis", alignItems: "flex-start" }, children: h.metadata.summary })] }, `${h.path}-${w}`)) })] }), b] });
|
|
2517
|
-
}));
|
|
2518
|
-
sl.displayName = "TemplateSelectPanel";
|
|
2519
|
-
const cl = K(J((r, i) => {
|
|
2520
|
-
const { className: o, sx: t, editorProps: n, commands: l, readOnly: c = !1, onClose: m, autoFocusSel: a, autoFocus: s = !0, scripts: u, ...d } = r, f = at(), [p, g] = U(!1), y = Se(!1), [b, x] = U({ message: "Loading", cursor: "", dirty: !1 }), [h, w] = U(null);
|
|
2521
|
-
me(() => {
|
|
2522
|
-
let E = !1;
|
|
2523
|
-
return w(null), async function() {
|
|
2524
|
-
if (u && (await u.start(), !E)) {
|
|
2525
|
-
const Y = u.getModules().getItems()[0]?.getSource();
|
|
2526
|
-
w({ source: Y || null });
|
|
2527
|
-
}
|
|
2528
|
-
}(), () => {
|
|
2529
|
-
E = !0;
|
|
2530
|
-
};
|
|
2531
|
-
}, [u]);
|
|
2532
|
-
const v = q((E) => {
|
|
2533
|
-
x((Y) => ({ ...Y, ...E }));
|
|
2534
|
-
}, []), C = Se(null), k = Se(null), [T, M] = U(null), I = Se(null), A = ee((E) => {
|
|
2535
|
-
if (T) return T.focus(E), !0;
|
|
2536
|
-
if (a) {
|
|
2537
|
-
const Y = k.current?.querySelectorAll?.(a);
|
|
2538
|
-
if (Y && Y.length > 0) return Y[0]?.focus?.(E), !0;
|
|
2539
|
-
}
|
|
2540
|
-
return k.current?.focus?.(E), !1;
|
|
2541
|
-
}, [T, a, s]), R = W(() => e(Lt, { transitionDelay: "160ms", style: { position: "absolute", width: "100%", height: "100%" }, transparentBackground: !1 }), []), S = W(() => e(Po, { elevation: 1, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})`, marginLeft: (E) => E.spacing(0.5), marginRight: (E) => E.spacing(0.5), marginTop: (E) => E.spacing(1), marginBottom: (E) => E.spacing(1) }, children: e(ll, { commands: l }) }), [f, l]), N = W(() => e(B, { className: Oe("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 ${f.palette.divider}` }, children: j("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "center", flexDirection: "row", justifyContent: "center" }, children: [e(Be, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "1 1 100%", color: (E) => E.palette.text.secondary }, variant: "caption", children: b.message }), e(Be, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", color: (E) => E.palette.text.secondary }, variant: "caption", children: b.dirty ? "Unsaved" : "" }), e(Be, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", marginLeft: "8px", minWidth: "90px", display: "flex", justifyContent: "end", color: (E) => E.palette.text.secondary }, variant: "caption", children: b.cursor })] }) }), [b]), L = W(() => j(B, { className: Oe("script-editor-content"), sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "column", boxSizing: "border-box" }, children: [S, e(B, { sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "row", position: "relative", boxSizing: "border-box" }, children: e($d, { ref: k, loadingPanel: R, readOnly: c, onClose: m, autoFocus: s, commands: l, onStatusChange: v, darkMode: f.palette.mode === "dark", ...n }) }), N] }), [f, l, S, N, p, R, c, n, s, a, m, v]), O = W(() => e(ws, { className: Oe({ "Mui-selected": y.current }), sx: { display: "flex", color: (E) => E.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: (E) => `${E.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: (E) => E.transitions.duration.shortest / 2 + "ms" }, backgroundColor: (E) => he(E.palette.action.hover, 0.03), borderBottom: (E) => `solid ${he(E.palette.divider, 0.2)} 1px` }, onPointerDown: (E) => {
|
|
2542
|
-
E.isDefaultPrevented() || (E.preventDefault(), A());
|
|
2543
|
-
}, children: j(B, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: (E) => E.spacing(0.25), marginBottom: (E) => E.spacing(0.25), marginLeft: (E) => E.spacing(1), marginRight: (E) => E.spacing(1) }, children: [e(B, { sx: { flex: "1 1 100%", paddingLeft: (E) => E.spacing(1) }, children: "Script (Typescript)" }), e(rt, { label: "Close", children: e(dt, { "aria-label": "close", sx: { color: (E) => E.palette.text.icon ?? E.palette.action.active }, touchRippleRef: C, onPointerDown: (E) => {
|
|
2544
|
-
C.current?.start(E, { center: !1 }), E.stopPropagation(), E.preventDefault();
|
|
2545
|
-
}, onPointerUp: () => {
|
|
2546
|
-
k.current?.close();
|
|
2547
|
-
}, children: e(ki, {}) }) })] }) }), [f, p]), $ = W(() => {
|
|
2548
|
-
let E;
|
|
2549
|
-
return h === null ? null : (h.source === null && (E = e(sl, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", position: "absolute", boxSizing: "border-box", width: "100%", height: "100%" }, onScriptSelect: (Y) => {
|
|
2550
|
-
k.current?.getEditor().insertSnippet(Y.content), w({ source: Y.content ?? "" });
|
|
2551
|
-
} })), j(B, { tabIndex: 0, className: Oe("script-workspace", o), sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", alignItems: "stretch", userSelect: "none", flexGrow: 0, outline: "none", backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})` }, onPointerDown: (Y) => {
|
|
2552
|
-
Y.isDefaultPrevented() || k.current?.focus();
|
|
2553
|
-
}, children: [O, j(B, { sx: { flex: "1 1 100%", position: "relative", display: "flex" }, children: [L, E] })] }));
|
|
2554
|
-
}, [S, L, o, h]), D = zt(i, () => ({ isScriptWorkspaceElement: () => !0, focus: (E) => {
|
|
2555
|
-
A(E);
|
|
2556
|
-
} }), []);
|
|
2557
|
-
return e(B, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", ...t }, ref: D, ...d, onFocus: (E) => {
|
|
2558
|
-
g(!0), y.current = !0, D.current?.contains(E.target) && E.target !== D.current && M(E.target), E.relatedTarget && !I.current && (I.current = E.relatedTarget), d?.onFocus?.(E);
|
|
2559
|
-
}, onBlur: (E) => {
|
|
2560
|
-
D?.current?.contains(E.relatedTarget) || D?.current === E.relatedTarget || (I.current = null, y.current = !1, g(!1)), d?.onBlur?.(E);
|
|
2561
|
-
}, children: $ });
|
|
2562
|
-
}));
|
|
2563
|
-
cl.displayName = "ScriptWorkspace";
|
|
2564
|
-
const dl = K(J((r, i) => {
|
|
2565
|
-
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = We(o, ["executeScript"])[0].context();
|
|
2566
|
-
We(o, ["showScriptEditor"]);
|
|
2567
|
-
const a = q((s, u) => {
|
|
2568
|
-
const d = { variant: ie.Menuitem, commandHook: t, scope: "scripts", disabled: l, shortcut: null }, f = m?.getScripts(), p = f?.searchFunction({ type: "macro" }), g = [];
|
|
2569
|
-
if (p) for (let b = 0; b < p.length; b++) {
|
|
2570
|
-
const x = p[b];
|
|
2571
|
-
g.push(e(F, { ...d, command: u.getCommand("executeScript"), commandState: { declaration: x }, tooltipProps: { description: `Execute ${x.getName() ?? "script"}` }, icon: P(e(ur, {})), label: x.getName() ?? `Script '${x.getName()}'` }, `script-${x.getName()}-${b}`));
|
|
2572
|
-
}
|
|
2573
|
-
const y = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [g.length > 0 ? j(se, { children: [e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: g }), e(re, { orientation: "horizontal" })] }) : null, Pe(F, { ...d, key: "show-editor", command: u.getCommand("showScriptEditor"), icon: P(e(Ac, {})) })] });
|
|
2574
|
-
return ke({ ...s, children: y });
|
|
2575
|
-
}, [l, m, t, n]);
|
|
2576
|
-
return e(Re, { ref: i, commands: o, commandHook: t, createPopupPanel: a, selected: o.getCommand("showScriptEditor").state(), label: "Macros", tooltip: "Run or manage macros.", quickCommand: "showScriptEditor", icon: P(e(Bc, {})), ...c });
|
|
2577
|
-
})), tu = K(J((r, i) => {
|
|
2578
|
-
const { commands: o, parentFloat: t, commandButtonProps: n, ...l } = r, c = We(o, ["executeScript", "showScriptEditor"]), m = c[0]?.context?.(), a = q((s) => {
|
|
2579
|
-
const { commandButtonProps: u, commandPopupProps: d } = s, f = e(Mo, { ...d, command: o.getCommand("formatFontColor"), icon: e(Lc, {}), isSplit: !0, panelProps: { disableAlpha: !0 } }), p = e(Mo, { ...d, command: o.getCommand("formatFillColor"), icon: e(Hc, {}), isSplit: !0, panelProps: { disableAlpha: !0, autoColorLabel: "No Fill", autoColorPosition: Eo.End } }), g = o.getCommand("undo") ? e(se, { children: e(Ii, { ...d, quickCommand: "undo" }) }) : null, y = o.getCommand("find") ? e(se, { children: e(fp, { ...d }) }) : null;
|
|
2580
|
-
let b = null;
|
|
2581
|
-
const x = m?.getScripts();
|
|
2582
|
-
if (c[1]?.state?.() || x) {
|
|
2583
|
-
let h = c[1]?.state?.();
|
|
2584
|
-
const w = x?.searchFunction({ type: "macro" });
|
|
2585
|
-
for (let v = 0; w && !h && v < w?.length; v++) h = !0;
|
|
2586
|
-
h && (b = j(se, { children: [e(re, {}), e(dl, { ...d })] }));
|
|
2587
|
-
}
|
|
2588
|
-
return j(Io, { parentFloat: t, children: [g, null, g ? e(re, {}) : null, e(Oi, { ...d, command: o.getCommand("paste") }), e(F, { ...u, command: o.getCommand("formatPainterToggle"), icon: P(e(zc, {})) }), e(xr, { ...u, command: o.getCommand("copy") }), e(re, {}), e(Sp, { ...d, command: o.getCommand("formatFontFamily") }), e(xp, { ...d, command: o.getCommand("formatFontSize") }), e(F, { ...u, command: o.getCommand("formatBoldToggle"), icon: e(Wc, {}) }), e(F, { ...u, command: o.getCommand("formatItalicToggle"), icon: e(jc, {}) }), e(Cp, { ...d }), e(vp, { ...d }), f, e(re, {}), p, e(mp, { ...d }), e(gp, { ...d }), e(re, {}), e(Qd, { ...d }), e(ep, { ...d }), e(tp, { ...d }), e(op, { ...d }), e(re, {}), e(bp, { ...d }), e(Dp, { command: o.getCommand("formatCellStyle"), ...d }), e(Ip, { command: o.getCommand("formatTableStyle"), ...d }), e(re, {}), e(Ri, { ...d }), e(Mi, { ...d }), e(re, {}), e(yp, { ...d }), null, e(Pi, { ...d }), e(Ni, { ...d }), y, b] });
|
|
2589
|
-
}, [o, c]);
|
|
2590
|
-
return e(cn, { ref: i, commands: o, parentFloat: t, commandButtonProps: n, createToolbarPalette: a, ...l });
|
|
2591
|
-
})), ou = K(J((r, i) => {
|
|
2592
|
-
const { commands: o, parentFloat: t, commandButtonProps: n, ...l } = r, c = ee((m) => {
|
|
2593
|
-
const { commandButtonProps: a, commandPopupProps: s } = m;
|
|
2594
|
-
return j(Io, { parentFloat: t, children: [null, e(F, { ...a, command: o.getCommand("updateHyperlink"), icon: P(e(_n, {})) }), e(F, { ...a, command: o.getCommand("updateComments"), icon: P(e(Un, {})) }), e(Li, { ...s }), e(F, { ...a, command: o.getCommand("insertTable"), icon: P(e(an, {})) })] });
|
|
2595
|
-
}, [o]);
|
|
2596
|
-
return e(cn, { ref: i, commands: o, parentFloat: t, commandButtonProps: n, createToolbarPalette: c, ...l });
|
|
2597
|
-
})), nu = K(J((r, i) => {
|
|
2598
|
-
const { commands: o, parentFloat: t, commandButtonProps: n, ...l } = r, c = ee((m) => {
|
|
2599
|
-
const { commandButtonProps: a, commandPopupProps: s } = m;
|
|
2600
|
-
return j(Io, { parentFloat: t, children: [e(hp, { ...s }), e(F, { ...a, command: o.getCommand("protectionSheetToggle"), icon: e(dn, { color: "secondary" }) }), e(re, {}), e(wp, { ...s }), e(kp, { ...s }), e(re, {}), e(F, { ...a, command: o.getCommand("sheetViewToggleFormulaView"), scope: "view", icon: e(eo, { command: o.getCommand("sheetViewToggleFormulaView"), scope: "view" }) }), e(F, { ...a, command: o.getCommand("sheetViewToggleShowZeros"), scope: "view", icon: e(eo, { command: o.getCommand("sheetViewToggleShowZeros"), scope: "view" }) }), e(re, {}), e(Tp, { ...s }), e(Bp, { command: o.getCommand("selectTheme"), ...s }), e(re, {}), e(dl, { ...s, scope: "view" }), e(re, {}), e(F, { ...a, command: o.getCommand("fullScreenToggle"), scope: "view", icon: () => P(o.getCommand("fullScreenToggle").state() ? e(Vc, {}) : e($c, {})) })] });
|
|
2601
|
-
}, [o]);
|
|
2602
|
-
return e(cn, { ref: i, commands: o, parentFloat: t, commandButtonProps: n, createToolbarPalette: c, ...l });
|
|
2603
|
-
})), pl = (r) => e(lu, { ...r }), ru = K((r) => {
|
|
2604
|
-
const { sx: i, ...o } = r;
|
|
2605
|
-
return j(B, { sx: { display: "flex", flexDirection: "column", position: "relative", "&:hover:not([disabled]) .indicator": { borderBottom: (t) => `${he(t.palette.primary.main, 0.35)} solid 2px` } }, children: [e(Cs, { disableRipple: !0, onMouseDown: (t) => {
|
|
2606
|
-
t.button === 0 && t.preventDefault();
|
|
2607
|
-
}, sx: { textTransform: "none", flex: "1 1 100%", fontWeight: (t) => t.typography.fontWeightRegular, padding: "2px 6px", minHeight: "0px", minWidth: "0px", marginRight: (t) => t.spacing(0.5), "&.Mui-selected": {}, "&.Mui-focusVisible": {}, ...i }, ...o }), e(B, { className: "indicator", sx: { width: "90%", borderRadius: "4px", minWidth: "4px", position: "absolute", bottom: "0", alignSelf: "center", display: "flex" } })] });
|
|
2608
|
-
}), au = K((r) => {
|
|
2609
|
-
const { toolbars: i, value: o, onToolbarChange: t, sx: n, ...l } = r, c = W(() => {
|
|
2610
|
-
const m = [];
|
|
2611
|
-
for (let a = 0; a < i.length; a++) m.push(e(ru, { label: i[a].label }, i[a].label));
|
|
2612
|
-
return m;
|
|
2613
|
-
}, [i]);
|
|
2614
|
-
return e(vs, { value: o, onChange: (m, a) => {
|
|
2615
|
-
t?.(a);
|
|
2616
|
-
}, variant: "scrollable", scrollButtons: !1, sx: { paddingLeft: (m) => m.spacing(1.5), paddingRight: (m) => m.spacing(1.5), paddingTop: (m) => m.spacing(0), paddingBottom: (m) => m.spacing(0), minHeight: "26px", alignItems: "center", "& .MuiTabs-indicator": { display: "flex", justifyContent: "center", backgroundColor: "transparent" }, "& .MuiTabs-indicatorSpan": { width: "90%", borderRadius: "4px", minWidth: "4px", backgroundColor: (m) => m.palette.primary.main }, "& .MuiTab-root": { marginRight: "0px" }, ...n }, TabIndicatorProps: { children: e("span", { className: "MuiTabs-indicatorSpan" }) }, ...l, children: c });
|
|
2617
|
-
}), iu = K((r) => {
|
|
2618
|
-
const { toolbars: i, value: o, onToolbarChange: t, selectProps: n, ...l } = r, c = q((a) => {
|
|
2619
|
-
t?.(a.target.value);
|
|
2620
|
-
}, [t]), m = W(() => {
|
|
2621
|
-
const a = [];
|
|
2622
|
-
for (let s = 0; s < i.length; s++) {
|
|
2623
|
-
const u = i[s].label;
|
|
2624
|
-
a.push(e(di, { value: s, sx: { color: (d) => {
|
|
2625
|
-
if (o === s) return d.palette.primary.main;
|
|
2626
|
-
} }, children: u }, u));
|
|
2627
|
-
}
|
|
2628
|
-
return a;
|
|
2629
|
-
}, [i, o]);
|
|
2630
|
-
return e(lr, { sx: { minWidth: "125px", maxWidth: "125px", "& .MuiInputBase-root": { paddingLeft: "0px", paddingRight: "0px" }, "& .MuiSelect-select": { paddingTop: (a) => a.spacing(0.5), paddingBottom: (a) => a.spacing(0.5), paddingLeft: (a) => a.spacing(2), color: (a) => a.palette.primary.main }, "& .MuiSelect-icon": { fill: (a) => a.palette.text.icon ?? a.palette.action.active, "&:hover:not(.Mui-disabled)": { color: (a) => a.palette.text.icon ?? a.palette.action.active } }, ...n }, size: "small", children: e(Ss, { value: o, onChange: c, variant: "outlined", sx: { backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})` }, ...l, children: m }) });
|
|
2631
|
-
}), lu = K(J((r, i) => {
|
|
2632
|
-
const { commands: o, selectWrapper: t, selectProps: n = {}, renderCompact: l = !1, paletteWrapper: c, toolbarsProps: m, paletteProps: a = {}, workbook: s, sx: u, ...d } = r, f = W(() => {
|
|
2633
|
-
const C = [], { ref: k, ...T } = m?.Home || {};
|
|
2634
|
-
C.push({ label: "Home", component: e(tu, { commands: o, ...T }) });
|
|
2635
|
-
const { ref: M, ...I } = m?.Insert || {};
|
|
2636
|
-
C.push({ label: "Insert", component: e(ou, { commands: o, ...I }) });
|
|
2637
|
-
const { ref: A, ...R } = m?.View || {};
|
|
2638
|
-
return C.push({ label: "View", component: e(nu, { commands: o, ...R }) }), C;
|
|
2639
|
-
}, [o]), p = W(() => {
|
|
2640
|
-
const C = [];
|
|
2641
|
-
for (let k = 0; k < f.length; k++) C.push(le.cloneElement(f[k].component, { ...f[k].component.props, key: f[k].key ?? f[k].label }));
|
|
2642
|
-
return C;
|
|
2643
|
-
}, [f]), [g, y] = U(0), b = (C) => {
|
|
2644
|
-
y(C);
|
|
2645
|
-
}, x = W(() => e(l ? iu : au, { toolbars: f, value: g, onToolbarChange: b, sx: n }), [f, g, n, l]), { sx: h, ...w } = a, v = e(Po, { elevation: 2, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, backgroundImage: `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})`, marginLeft: (C) => C.spacing(1), marginRight: (C) => C.spacing(1), marginTop: (C) => C.spacing(0.5), marginBottom: (C) => C.spacing(0.5), ...h }, ...w, children: p[g] });
|
|
2646
|
-
return j(B, { ref: i, className: "toolbarWrappers", sx: { display: "flex", flexDirection: "column", paddingTop: (C) => C.spacing(0.5), "*": { userSelect: "none" }, ...u }, ...d, children: [t ? t(x) : x, c ? c(v) : v] });
|
|
2647
|
-
}));
|
|
2648
|
-
var Va, $a;
|
|
2649
|
-
(function() {
|
|
2650
|
-
if ($a) return Va;
|
|
2651
|
-
$a = 1;
|
|
2652
|
-
var r = /^\s+|\s+$/g, i = /^[-+]0x[0-9a-f]+$/i, o = /^0b[01]+$/i, t = /^0o[0-7]+$/i, n = parseInt, l = typeof Co == "object" && Co && Co.Object === Object && Co, c = typeof self == "object" && self && self.Object === Object && self, m = l || c || Function("return this")(), a = Object.prototype.toString, s = Math.max, u = Math.min, d = function() {
|
|
2653
|
-
return m.Date.now();
|
|
2654
|
-
};
|
|
2655
|
-
function f(g) {
|
|
2656
|
-
var y = typeof g;
|
|
2657
|
-
return !!g && (y == "object" || y == "function");
|
|
2658
|
-
}
|
|
2659
|
-
function p(g) {
|
|
2660
|
-
if (typeof g == "number") return g;
|
|
2661
|
-
if (function(x) {
|
|
2662
|
-
return typeof x == "symbol" || /* @__PURE__ */ function(h) {
|
|
2663
|
-
return !!h && typeof h == "object";
|
|
2664
|
-
}(x) && a.call(x) == "[object Symbol]";
|
|
2665
|
-
}(g)) return NaN;
|
|
2666
|
-
if (f(g)) {
|
|
2667
|
-
var y = typeof g.valueOf == "function" ? g.valueOf() : g;
|
|
2668
|
-
g = f(y) ? y + "" : y;
|
|
2669
|
-
}
|
|
2670
|
-
if (typeof g != "string") return g === 0 ? g : +g;
|
|
2671
|
-
g = g.replace(r, "");
|
|
2672
|
-
var b = o.test(g);
|
|
2673
|
-
return b || t.test(g) ? n(g.slice(2), b ? 2 : 8) : i.test(g) ? NaN : +g;
|
|
2674
|
-
}
|
|
2675
|
-
Va = function(g, y, b) {
|
|
2676
|
-
var x, h, w, v, C, k, T = 0, M = !1, I = !1, A = !0;
|
|
2677
|
-
if (typeof g != "function") throw new TypeError("Expected a function");
|
|
2678
|
-
function R($) {
|
|
2679
|
-
var D = x, E = h;
|
|
2680
|
-
return x = h = void 0, T = $, v = g.apply(E, D);
|
|
2681
|
-
}
|
|
2682
|
-
function S($) {
|
|
2683
|
-
var D = $ - k;
|
|
2684
|
-
return k === void 0 || D >= y || D < 0 || I && $ - T >= w;
|
|
2685
|
-
}
|
|
2686
|
-
function N() {
|
|
2687
|
-
var $ = d();
|
|
2688
|
-
if (S($)) return L($);
|
|
2689
|
-
C = setTimeout(N, function(D) {
|
|
2690
|
-
var E = y - (D - k);
|
|
2691
|
-
return I ? u(E, w - (D - T)) : E;
|
|
2692
|
-
}($));
|
|
2693
|
-
}
|
|
2694
|
-
function L($) {
|
|
2695
|
-
return C = void 0, A && x ? R($) : (x = h = void 0, v);
|
|
2696
|
-
}
|
|
2697
|
-
function O() {
|
|
2698
|
-
var $ = d(), D = S($);
|
|
2699
|
-
if (x = arguments, h = this, k = $, D) {
|
|
2700
|
-
if (C === void 0) return function(E) {
|
|
2701
|
-
return T = E, C = setTimeout(N, y), M ? R(E) : v;
|
|
2702
|
-
}(k);
|
|
2703
|
-
if (I) return C = setTimeout(N, y), R(k);
|
|
2704
|
-
}
|
|
2705
|
-
return C === void 0 && (C = setTimeout(N, y)), v;
|
|
2706
|
-
}
|
|
2707
|
-
return y = p(y) || 0, f(b) && (M = !!b.leading, w = (I = "maxWait" in b) ? s(p(b.maxWait) || 0, y) : w, A = "trailing" in b ? !!b.trailing : A), O.cancel = function() {
|
|
2708
|
-
C !== void 0 && clearTimeout(C), T = 0, x = k = h = C = void 0;
|
|
2709
|
-
}, O.flush = function() {
|
|
2710
|
-
return C === void 0 ? v : L(d());
|
|
2711
|
-
}, O;
|
|
2712
|
-
};
|
|
2713
|
-
})();
|
|
2714
|
-
var _a, Ua, qa = { exports: {} }, Fn = {};
|
|
2715
|
-
Ua || (Ua = 1, qa.exports = function() {
|
|
2716
|
-
if (_a) return Fn;
|
|
2717
|
-
_a = 1;
|
|
2718
|
-
var r = le, i = typeof Object.is == "function" ? Object.is : function(a, s) {
|
|
2719
|
-
return a === s && (a !== 0 || 1 / a == 1 / s) || a != a && s != s;
|
|
2720
|
-
}, o = r.useState, t = r.useEffect, n = r.useLayoutEffect, l = r.useDebugValue;
|
|
2721
|
-
function c(a) {
|
|
2722
|
-
var s = a.getSnapshot;
|
|
2723
|
-
a = a.value;
|
|
2724
|
-
try {
|
|
2725
|
-
var u = s();
|
|
2726
|
-
return !i(a, u);
|
|
2727
|
-
} catch {
|
|
2728
|
-
return !0;
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2731
|
-
var m = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? function(a, s) {
|
|
2732
|
-
return s();
|
|
2733
|
-
} : function(a, s) {
|
|
2734
|
-
var u = s(), d = o({ inst: { value: u, getSnapshot: s } }), f = d[0].inst, p = d[1];
|
|
2735
|
-
return n(function() {
|
|
2736
|
-
f.value = u, f.getSnapshot = s, c(f) && p({ inst: f });
|
|
2737
|
-
}, [a, u, s]), t(function() {
|
|
2738
|
-
return c(f) && p({ inst: f }), a(function() {
|
|
2739
|
-
c(f) && p({ inst: f });
|
|
2740
|
-
});
|
|
2741
|
-
}, [a]), l(u), u;
|
|
2742
|
-
};
|
|
2743
|
-
return Fn.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : m, Fn;
|
|
2744
|
-
}()), qa.exports;
|
|
2745
|
-
var Ga, Xa, xo = { exports: {} }, Xt = { exports: {} }, su = Xt.exports;
|
|
2746
|
-
(function() {
|
|
2747
|
-
if (Xa) return xo.exports;
|
|
2748
|
-
Xa = 1;
|
|
2749
|
-
for (var r = (Ga || (Ga = 1, function() {
|
|
2750
|
-
var d, f, p, g, y, b;
|
|
2751
|
-
typeof performance < "u" && performance !== null && performance.now ? Xt.exports = function() {
|
|
2752
|
-
return performance.now();
|
|
2753
|
-
} : typeof process < "u" && process !== null && process.hrtime ? (Xt.exports = function() {
|
|
2754
|
-
return (d() - y) / 1e6;
|
|
2755
|
-
}, f = process.hrtime, g = (d = function() {
|
|
2756
|
-
var x;
|
|
2757
|
-
return 1e9 * (x = f())[0] + x[1];
|
|
2758
|
-
})(), b = 1e9 * process.uptime(), y = g - b) : Date.now ? (Xt.exports = function() {
|
|
2759
|
-
return Date.now() - p;
|
|
2760
|
-
}, p = Date.now()) : (Xt.exports = function() {
|
|
2761
|
-
return (/* @__PURE__ */ new Date()).getTime() - p;
|
|
2762
|
-
}, p = (/* @__PURE__ */ new Date()).getTime());
|
|
2763
|
-
}.call(su)), Xt.exports), i = typeof window > "u" ? Co : window, o = ["moz", "webkit"], t = "AnimationFrame", n = i["request" + t], l = i["cancel" + t] || i["cancelRequest" + t], c = 0; !n && c < o.length; c++) n = i[o[c] + "Request" + t], l = i[o[c] + "Cancel" + t] || i[o[c] + "CancelRequest" + t];
|
|
2764
|
-
if (!n || !l) {
|
|
2765
|
-
var m = 0, a = 0, s = [], u = 1e3 / 60;
|
|
2766
|
-
n = function(d) {
|
|
2767
|
-
if (s.length === 0) {
|
|
2768
|
-
var f = r(), p = Math.max(0, u - (f - m));
|
|
2769
|
-
m = p + f, setTimeout(function() {
|
|
2770
|
-
var g = s.slice(0);
|
|
2771
|
-
s.length = 0;
|
|
2772
|
-
for (var y = 0; y < g.length; y++) if (!g[y].cancelled) try {
|
|
2773
|
-
g[y].callback(m);
|
|
2774
|
-
} catch (b) {
|
|
2775
|
-
setTimeout(function() {
|
|
2776
|
-
throw b;
|
|
2777
|
-
}, 0);
|
|
2778
|
-
}
|
|
2779
|
-
}, Math.round(p));
|
|
2780
|
-
}
|
|
2781
|
-
return s.push({ handle: ++a, callback: d, cancelled: !1 }), a;
|
|
2782
|
-
}, l = function(d) {
|
|
2783
|
-
for (var f = 0; f < s.length; f++) s[f].handle === d && (s[f].cancelled = !0);
|
|
2784
|
-
};
|
|
2785
|
-
}
|
|
2786
|
-
xo.exports = function(d) {
|
|
2787
|
-
return n.call(i, d);
|
|
2788
|
-
}, xo.exports.cancel = function() {
|
|
2789
|
-
l.apply(i, arguments);
|
|
2790
|
-
}, xo.exports.polyfill = function(d) {
|
|
2791
|
-
d || (d = i), d.requestAnimationFrame = n, d.cancelAnimationFrame = l;
|
|
2792
|
-
}, xo.exports;
|
|
2793
|
-
})();
|
|
2794
|
-
var st = { DOM_UNAVAILABLE_ERROR: "DOM is unavailable server-side. Please use this method client-side only.", FULLSCREEN_UNSUPPORTED_ERROR: "Your browser does not support Fullscreen API.", getEventsNames() {
|
|
2795
|
-
if (typeof document > "u") return null;
|
|
2796
|
-
const r = document;
|
|
2797
|
-
return "exitFullscreen" in r ? ["fullscreenchange", "fullscreenerror"] : "webkitExitFullscreen" in r || "webkitCancelFullScreen" in r ? ["webkitfullscreenchange", "webkitfullscreenerror"] : "mozCancelFullScreen" in r ? ["mozfullscreenchange", "mozfullscreenerror"] : "msExitFullscreen" in r ? ["MSFullscreenChange", "MSFullscreenError"] : null;
|
|
2798
|
-
}, getEventName(r) {
|
|
2799
|
-
const i = this.getEventsNames();
|
|
2800
|
-
return i ? r === "change" ? i[0] : i[1] : null;
|
|
2801
|
-
}, get fullscreenEnabled() {
|
|
2802
|
-
if (typeof document > "u") return !1;
|
|
2803
|
-
const r = document;
|
|
2804
|
-
return r.fullscreenEnabled || r.webkitFullscreenEnabled || !!r.webkitCancelFullScreen || r.mozFullScreenEnabled || r.msFullscreenEnabled || !1;
|
|
2805
|
-
}, get fullscreenElement() {
|
|
2806
|
-
if (typeof document > "u") return null;
|
|
2807
|
-
const r = document;
|
|
2808
|
-
return r.fullscreenElement || r.webkitFullscreenElement || r.webkitCurrentFullScreenElement || r.mozFullScreenElement || r.msFullscreenElement || null;
|
|
2809
|
-
}, requestFullscreen(r, i) {
|
|
2810
|
-
if (typeof document > "u") throw new Error(this.DOM_UNAVAILABLE_ERROR);
|
|
2811
|
-
const o = r ?? document.documentElement, t = o.requestFullscreen || o.webkitRequestFullscreen || o.webkitRequestFullScreen || o.mozRequestFullScreen || o.msRequestFullscreen;
|
|
2812
|
-
if (!t) throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);
|
|
2813
|
-
return t.call(o, i);
|
|
2814
|
-
}, exitFullscreen() {
|
|
2815
|
-
if (typeof document > "u") throw new Error(this.DOM_UNAVAILABLE_ERROR);
|
|
2816
|
-
const r = document, i = r.exitFullscreen || r.webkitExitFullscreen || r.webkitCancelFullScreen || r.mozCancelFullScreen || r.msExitFullscreen;
|
|
2817
|
-
if (!i) throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);
|
|
2818
|
-
return i.call(r);
|
|
2819
|
-
}, on(r, i) {
|
|
2820
|
-
const o = this.getEventName(r);
|
|
2821
|
-
o && document.addEventListener(o, i);
|
|
2822
|
-
}, off(r, i) {
|
|
2823
|
-
const o = this.getEventName(r);
|
|
2824
|
-
o && document.removeEventListener(o, i);
|
|
2825
|
-
} };
|
|
2826
|
-
const cu = (r) => {
|
|
2827
|
-
const { workbook: i, workbookElement: o, notifier: t, commandTarget: n, commands: l, darkMode: c, onShowSidebar: m, onNewWorkbook: a = du } = r, [s, u] = U(i?.getSelectedSheet()), [d, f] = U(i?.getSheets().getItems()), p = ee(m, [m]), g = ee(a, [a]), y = W(() => [new _e("workbookStatistics", n, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [we.Ctrl, we.Shift] } }), new _e("showFormat", n, { label: "Show Format", description: "Open the format pane.", shortcut: { key: "F", modifiers: [we.Ctrl, we.Shift] } }), new be("newCellStyle", n, { label: "New Cell Style…", scopedLabels: { cellStyle: "New Cell Style" }, description: "Create a new named style can can be quickly used later." }), new be("deleteCellStyle", n, { label: "Delete Cell Style", scopedLabels: { cellStyle: "Delete" }, description: "Remove a named style that is no longer needed." }), new be("modifyCellStyle", n, { label: "Modify Cell Style", scopedLabels: { cellStyle: "Modify" }, description: "Update a style with the currently style." }), new _e("find", n, { label: "Find", description: "Open the Find window.", shortcut: [{ key: "F", modifiers: [we.Ctrl] }, { key: "F5", modifiers: [we.Shift] }] }), new _e("findReplace", n, { label: "Find & Replace", description: "Open the Find & Replace window.", shortcut: [{ key: "H", modifiers: [we.Ctrl] }, { key: "H", modifiers: [we.Ctrl, we.Alt] }] }), new _e("goto", n, { label: "Go To", description: "Open the 'Go To' window.", shortcut: [{ key: "G", modifiers: [we.Ctrl] }] }), new _e("workbookViewToggleExpandFormulaBar", n, { label: "Toggle Expand Formula bar", description: "Expand or collapse the formula bar.", shortcut: { key: "U", modifiers: [we.Ctrl, we.Shift] } }), new _e("workbookViewToggleShowFormulaBar", n, { label: "View Formula bar", scopedLabels: { view: "Formula Bar" }, description: "Show or hide the formula bar." }), new _e("workbookViewToggleShowTabs", n, { label: "View Sheet Tabs", description: "Show or hide the sheet tabs.", scopedLabels: { view: "Sheet Tabs" } }), new _e("workbookViewToggleShowStatusBar", n, { label: "View Status Bar", description: "Show or hide the status bar.", scopedLabels: { view: "Status Bar" } }), new _e("workbookViewToggleShowHorizontalScrollBar", n, { label: "View Horizontal Scrollbar", description: "Show or hide the horizontal scrollbar.", scopedLabels: { view: "Horizontal Scrollbar" } }), new _e("workbookViewToggleShowVerticalScrollBar", n, { label: "View Vertical Scrollbar", description: "Show or hide the vertical scrollbar.", scopedLabels: { view: "Vertical Scrollbar" } }), new be("hideSheet", n, { 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 be("deleteSheet", n, { label: "Delete Sheet", scopedLabels: { sheet: "Delete" }, description: "Delete the sheet and all the data." }), new be("addSheet", n, { label: "Insert Sheet", scopedLabels: { sheet: "Insert" }, description: "Insert sheet before the current sheet.", shortcut: [{ key: "F11", modifiers: [we.Shift] }, { key: "F1", modifiers: [we.Alt, we.Shift] }] }), new be("duplicateSheet", n, { label: "Duplicate Sheet", description: "Duplicate the current sheet.", scopedLabels: { sheet: "Duplicate" } }), new be("nextSheet", n, { label: "Next Sheet", scopedLabels: { sheet: "Next" }, description: "Activate the next sheet.", shortcut: [{ key: "PageDown", modifiers: [we.Ctrl] }] }), new be("previousSheet", n, { label: "Previous Sheet", scopedLabels: { sheet: "Previous" }, description: "Activate the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [we.Ctrl] }] }), new be("selectNextSheet", n, { label: "Select Next Sheet", scopedLabels: { sheet: "Select Next" }, description: "Select the next sheet.", shortcut: [{ key: "PageDown", modifiers: [we.Ctrl, we.Shift] }] }), new be("selectPreviousSheet", n, { label: "Select Previous Sheet", scopedLabels: { sheet: "Select Previous" }, description: "Select the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [we.Ctrl, we.Shift] }] }), new be("selectTheme", n, { label: "Theme", description: "Select a theme that coveys a style suitable for your data." }), new be("selectNamed", n, { label: (S) => S?.getName() ?? "Select Named Item", scopedLabels: { namedItem: (S) => S?.getName() ?? "Select" }, description: "Select the item." }), new be("addNamedReference", n, { 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 be("editNamedReference", n, { label: "Edit Named Reference…", scopedLabels: { namedItem: "Edit…" }, description: "Add a new named reference. Names can be used as a substitute for cell references." }), new be("deleteNamedReference", n, { label: "Delete Named Reference", scopedLabels: { namedItem: "Delete" }, description: "Remove the named reference." }), new _e("activeNameBox", n, { label: "Activate Name Box", description: "Move the focus to the name box.", shortcut: { key: "F3", modifiers: [we.Alt] } }), new _e("createNamedReferenceFromSelection", n, { label: "Create from Selection", description: "Automatically generate names from the selected cells.", shortcut: { key: "F3", modifiers: [we.Ctrl, we.Shift] } }), new _e("activeNameManager", n, { label: "Activate Name Manager", description: `Create, edit, delete, and find all the names used in the workbook.
|
|
2828
|
-
|
|
2829
|
-
Names can be used as a substitute for cell references.`, shortcut: { key: "F3", modifiers: [we.Ctrl] } }), new be("fullScreenToggle", n, { label: "FullScreen", description: "Toggle showing the workbook using the full screen.", shortcut: { key: "F11" } }), new be("showScriptEditor", n, { label: "Scripts", scopedLabels: { scripts: "Script Editor…" }, description: "Show the script editor.", shortcut: [{ key: "F11", modifiers: [we.Alt] }] }, function(S = !0) {
|
|
2830
|
-
p?.();
|
|
2831
|
-
}), new be("executeScript", n, { label: "Run Script", description: "Run the selected or last executed script.", shortcut: { key: "F8" } }), new be("executeSelectedScript", n, { label: "Run Script", description: "Run the selected script.", shortcut: { key: "F8" } }), new be("saveScripts", n, { label: "Save Script", description: "Save the current scripts." }), new be("maximumWorkbookToggle", n, { label: "Maximize", description: "Toggle showing the workbook maximized.", shortcut: { key: "F10", modifiers: [we.Ctrl] } }), new be("spellCheck", n, { label: "Spell Check", description: "Check the workbook for spelling mistakes.", shortcut: { key: "F7" } }), new be("calculateAll", n, { label: "Calculate Now", description: "Recalculate all formulas.", shortcut: { key: "F9" } }), new _e("calculate", n, { label: "Calculate Sheet", description: "Recalculate the formulas on the current sheet.", shortcut: { key: "=", modifiers: [we.Ctrl] } }), new _e("closeWorkbook", n, { label: "Close Workbook", description: "Close the workbook.", shortcut: { key: "W", modifiers: [we.Ctrl] } }), new _e("newWorkbook", n, { label: "New Workbook", description: "Create a new workbook in another tab." })], []), b = W(() => {
|
|
2832
|
-
let S = null;
|
|
2833
|
-
return S = l ? l.createChildGroup(n, "workbook", !1) : new mr(n, "workbook"), S.addCommands(y, !0), S;
|
|
2834
|
-
}, [l, y]), x = un(), h = le.useRef(null), w = ee(() => {
|
|
2835
|
-
let S, N = null;
|
|
2836
|
-
const L = b.getCommand("executeScript");
|
|
2837
|
-
if (L.update({ disabled: !1, context: { getScripts: () => i.getScripts() } }), !L) return;
|
|
2838
|
-
const O = b.getCommand("executeSelectedScript");
|
|
2839
|
-
if (!O) return;
|
|
2840
|
-
const $ = { saveSource: async (D) => {
|
|
2841
|
-
let E = null, Y = null;
|
|
2842
|
-
const Z = i.getScripts();
|
|
2843
|
-
try {
|
|
2844
|
-
D && (Y = await t?.showBusy?.("Saving Scripts..."), E = await Z.createModule({ source: D })), Z.addModule("scripts", E, { replace: !0 }), Y?.();
|
|
2845
|
-
} catch (X) {
|
|
2846
|
-
Y?.(), console.warn("Unable to compile", X), t?.showError?.(X);
|
|
2847
|
-
}
|
|
2848
|
-
return E;
|
|
2849
|
-
}, addContainerListener: (D) => (v.current = D, () => {
|
|
2850
|
-
v.current = null;
|
|
2851
|
-
}), setSelectedFunction: (D) => {
|
|
2852
|
-
S = D ?? h.current ?? null, Promise.resolve(S).then((E) => {
|
|
2853
|
-
O.update({ disabled: E === null });
|
|
2854
|
-
});
|
|
2855
|
-
}, quickInsertFunction: (D) => {
|
|
2856
|
-
const E = `=${D.toUpperCase()}(`, Y = { text: E + ")", editMode: !0, initialSelection: { start: E.length, end: E.length + 0 } };
|
|
2857
|
-
x.setMode((Z) => Z?.key === "edit" ? { ...Z, args: { ...Z.args } } : { key: "edit", args: { stateAndCoords: null, start: Y } });
|
|
2858
|
-
}, getSelectedFunction: () => S, setEditor: (D) => {
|
|
2859
|
-
N = D ?? null, b.getCommand("showScriptEditor")?.update({ state: D !== null });
|
|
2860
|
-
}, getEditor: () => N, getRanges: (D) => {
|
|
2861
|
-
try {
|
|
2862
|
-
return i.getRanges(D);
|
|
2863
|
-
} catch {
|
|
2864
|
-
}
|
|
2865
|
-
return null;
|
|
2866
|
-
}, getScripts: () => i.getScripts(), isReadOnly: () => i.getProtection().isStructureAllowed() === !1 };
|
|
2867
|
-
O.update({ context: $ });
|
|
2868
|
-
}, [b, i, o, t]), v = le.useRef(null);
|
|
2869
|
-
Ue(i, { onBeforeSave: async () => {
|
|
2870
|
-
await v.current?.onBeforeSave();
|
|
2871
|
-
}, onProtectionChange: () => {
|
|
2872
|
-
v.current?.onReadonlyChange();
|
|
2873
|
-
}, onLoad: () => {
|
|
2874
|
-
(async () => (await i.getCalculation().start(), i.getScripts().start(), v.current?.onScriptChange()))();
|
|
2875
|
-
} }), Ue(i, { onSheetsChange: (S) => {
|
|
2876
|
-
f(S.getSheets().getItems());
|
|
2877
|
-
}, onViewChange(S) {
|
|
2878
|
-
u(S?.getSelectedSheet());
|
|
2879
|
-
}, onProtectionChange: (S) => {
|
|
2880
|
-
const N = { disabled: !S.getProtection().isStructureAllowed() };
|
|
2881
|
-
b.getCommand("hideSheet").update(N), b.getCommand("deleteSheet").update(N), b.getCommand("addSheet").update(N), b.getCommand("duplicateSheet").update(N), b.getCommand("selectTheme").update(N), b.getCommand("addNamedReference").update(N), b.getCommand("editNamedReference").update(N), b.getCommand("deleteNamedReference").update(N);
|
|
2882
|
-
}, onScriptsChange: (S) => {
|
|
2883
|
-
w();
|
|
2884
|
-
} });
|
|
2885
|
-
const { isFullscreenAvailable: C, isFullscreenEnabled: k, toggleFullscreen: T } = function(S = {}) {
|
|
2886
|
-
const { target: N, onChange: L, onError: O, requestFullScreenOptions: $ } = S, [D, E] = U(!1), [Y, Z] = U(null), [X, _] = U(!1), ne = q(() => st.requestFullscreen(N?.current || null, $), [N, $]), ae = q(() => st.exitFullscreen(), []), G = q(() => st.fullscreenElement ? ae() : ne(), [ne, ae]), z = q((ue) => {
|
|
2887
|
-
const Le = st.fullscreenElement;
|
|
2888
|
-
Z(Le), _(!!Le), L?.(ue);
|
|
2889
|
-
}, [L]), Q = q((ue) => {
|
|
2890
|
-
const Le = st.fullscreenElement;
|
|
2891
|
-
Z(Le), _(!!Le), O?.(ue);
|
|
2892
|
-
}, [O]);
|
|
2893
|
-
return me(() => {
|
|
2894
|
-
E(st.fullscreenEnabled);
|
|
2895
|
-
}, []), me(() => (st.on("change", z), st.on("error", Q), () => {
|
|
2896
|
-
st.off("change", z), st.off("error", Q);
|
|
2897
|
-
}), [z, Q]), { isFullscreenAvailable: D, fullscreenElement: Y, isFullscreenEnabled: X, enableFullscreen: ne, disableFullscreen: ae, toggleFullscreen: G };
|
|
2898
|
-
}({ target: { current: o ?? document.body } }), M = hr();
|
|
2899
|
-
me(() => {
|
|
2900
|
-
b.getCommand("selectTheme").update({ state: () => i.getTheme(), context: () => ({ theme: i.getTheme(), themes: M, darkMode: c }) });
|
|
2901
|
-
}, [i?.getTheme(), c]);
|
|
2902
|
-
const I = ee(async function(S, N) {
|
|
2903
|
-
let L = null;
|
|
2904
|
-
const O = i.getScripts();
|
|
2905
|
-
if (S?.declaration || S?.functionName) {
|
|
2906
|
-
const $ = S.declaration ? S.declaration.getName() : S.functionName;
|
|
2907
|
-
O.searchFunction({ name: $ }).length > 0 && (L = $);
|
|
2908
|
-
}
|
|
2909
|
-
if (L) try {
|
|
2910
|
-
await O.executeMacro(L), h.current = Promise.resolve({ source: null, name: L });
|
|
2911
|
-
} catch ($) {
|
|
2912
|
-
return void t?.showError?.($);
|
|
2913
|
-
}
|
|
2914
|
-
}, [i, t]);
|
|
2915
|
-
me(() => {
|
|
2916
|
-
b.getCommand("newCellStyle").updateCallback((S) => {
|
|
2917
|
-
t?.showInputOptions?.({ initialValue: (() => {
|
|
2918
|
-
let N = 0;
|
|
2919
|
-
for (; ; ) {
|
|
2920
|
-
N++;
|
|
2921
|
-
const L = `Style ${N}`;
|
|
2922
|
-
try {
|
|
2923
|
-
return i.getStyles().validateStyleName(L, !0), L;
|
|
2924
|
-
} catch {
|
|
2925
|
-
}
|
|
2926
|
-
}
|
|
2927
|
-
})(), title: b.getCommand("newCellStyle")?.label("cellStyle"), description: "Enter a name for the new cell style.", inputLabel: "Style Name", inputProps: { style: { minWidth: "300px" } }, options: ["Ok", "Cancel"], defaultOption: "Ok", onValidateInputOption: async (N, L) => {
|
|
2928
|
-
let O = null;
|
|
2929
|
-
try {
|
|
2930
|
-
i.getStyles().validateStyleName(N, !1);
|
|
2931
|
-
} catch (E) {
|
|
2932
|
-
O = E.message;
|
|
2933
|
-
}
|
|
2934
|
-
let $ = i.getStyles().getNamed(N), D = O;
|
|
2935
|
-
return !D && $ && (D = `Update style '${$.getName()}'.`), { valid: O === null, message: D };
|
|
2936
|
-
} }).then(({ input: N, option: L }) => {
|
|
2937
|
-
const O = i.getSelectedSheet().getSelectedRange();
|
|
2938
|
-
if (L !== "Ok") return;
|
|
2939
|
-
const $ = i.getStyles().setNamed({ name: N, style: O.getCell().getStyle() });
|
|
2940
|
-
O.updateStyle({ named: $.getName() });
|
|
2941
|
-
});
|
|
2942
|
-
}), b.getCommand("deleteCellStyle").updateCallback((S) => {
|
|
2943
|
-
S.delete();
|
|
2944
|
-
}), b.getCommand("modifyCellStyle").updateCallback(({ named: S }) => {
|
|
2945
|
-
const N = i.getSelectedSheet().getSelectedRange();
|
|
2946
|
-
i.getStyles().setNamed({ name: S.getName(), style: N.getCell().getStyle() });
|
|
2947
|
-
}), b.getCommand("hideSheet").updateCallback((S) => {
|
|
2948
|
-
i.getSheetAt(S).setVisibility(Rt.Visibility.Hidden);
|
|
2949
|
-
}), b.getCommand("deleteSheet").updateCallback(async (S) => {
|
|
2950
|
-
i.getSheetAt(S ?? i.getSelectedSheetIndex())?.delete();
|
|
2951
|
-
}), b.getCommand("addSheet").updateCallback((S) => {
|
|
2952
|
-
i.getSheets().add({ index: S, autoSelect: !0 });
|
|
2953
|
-
}), b.getCommand("duplicateSheet").updateCallback(async (S) => {
|
|
2954
|
-
(await i.getSheetAt(S ?? i.getSelectedSheetIndex())?.duplicate())?.select();
|
|
2955
|
-
}), b.getCommand("nextSheet").updateCallback((S) => {
|
|
2956
|
-
i.getNextSheet(S ?? i.getSelectedSheetIndex()).select();
|
|
2957
|
-
}), b.getCommand("previousSheet").updateCallback((S) => {
|
|
2958
|
-
i.getPreviousSheet(S ?? i.getSelectedSheetIndex()).select();
|
|
2959
|
-
}), b.getCommand("selectNextSheet").updateCallback((S) => {
|
|
2960
|
-
i.getNextSheet(S ?? i.getSelectedSheetIndex()).select();
|
|
2961
|
-
}), b.getCommand("selectPreviousSheet").updateCallback((S) => {
|
|
2962
|
-
i.getPreviousSheet(S ?? i.getSelectedSheetIndex()).select();
|
|
2963
|
-
}), b.getCommand("selectTheme").updateCallback((S) => {
|
|
2964
|
-
i.setTheme(S);
|
|
2965
|
-
}), b.getCommand("calculateAll").updateCallback(() => {
|
|
2966
|
-
i.getSelectedSheet().getEntireRange().calculate(!0);
|
|
2967
|
-
}), b.getCommand("calculate").updateCallback(() => {
|
|
2968
|
-
i.getSelectedSheet().getEntireRange().calculate(!0);
|
|
2969
|
-
}), b.getCommand("closeWorkbook").updateCallback(async () => {
|
|
2970
|
-
await t?.showOptions({ title: "Confirm", description: "This will close the current workbook tab. Do you want to continue?", options: ["Close", "Cancel"], defaultOption: "Close" }) === "Close" && window.close();
|
|
2971
|
-
}), b.getCommand("newWorkbook").updateCallback(() => {
|
|
2972
|
-
g?.();
|
|
2973
|
-
}), b.getCommand("executeScript").updateCallback(I), b.getCommand("executeSelectedScript").updateCallback(I);
|
|
2974
|
-
}, [i, t]);
|
|
2975
|
-
const A = ee(async (S) => {
|
|
2976
|
-
let N = 0, L = null, O = "Find & Replace";
|
|
2977
|
-
S?.replace && !S?.replaceOptions?.maxCount && (O = "Replace All");
|
|
2978
|
-
const $ = await t?.showBusy?.(O);
|
|
2979
|
-
try {
|
|
2980
|
-
const D = S?.scope ?? "sheet";
|
|
2981
|
-
let E = null;
|
|
2982
|
-
const Y = i.getSelectedSheet(), Z = { from: Y.getSelectedCell(), ...S.findOptions };
|
|
2983
|
-
if (E = D === "sheet" ? i.getSelectedSheet().find(S.findText, Z) : i.find(S.findText, Z), S.replace) {
|
|
2984
|
-
const X = i.replace(E, S.replaceText, S.replaceOptions);
|
|
2985
|
-
N = X.count, S.replaceOptions.maxCount && (L = X.last);
|
|
2986
|
-
} else {
|
|
2987
|
-
let X = E.next();
|
|
2988
|
-
X.done || (N++, L = X.value);
|
|
2989
|
-
}
|
|
2990
|
-
L?.select({ autoFocus: !1 }), $?.(), !S.replaceOptions.maxCount && N > 1 && t?.showMessage?.(`We replaced ${N} cells.`);
|
|
2991
|
-
} catch (D) {
|
|
2992
|
-
$?.(), t?.showError?.(D);
|
|
2993
|
-
}
|
|
2994
|
-
return N;
|
|
2995
|
-
}, [i, o]), R = ee((S) => {
|
|
2996
|
-
const N = { value: S, context: { selection: () => {
|
|
2997
|
-
const L = i.getSelectedRanges(), O = [];
|
|
2998
|
-
for (let $ = 0; $ < L.getCount(); $++) {
|
|
2999
|
-
const D = L.at($).getFixed(!0).getCoords();
|
|
3000
|
-
O.push(D);
|
|
3001
|
-
}
|
|
3002
|
-
return i.getRanges(O);
|
|
3003
|
-
}, getNames: () => i.getNames() }, onUpdate: async (L) => {
|
|
3004
|
-
try {
|
|
3005
|
-
await L.select();
|
|
3006
|
-
} catch (O) {
|
|
3007
|
-
t?.showMessage?.(O.message, { type: wt.Error });
|
|
3008
|
-
}
|
|
3009
|
-
} };
|
|
3010
|
-
return t.showWindow?.("namedDetails", N);
|
|
3011
|
-
}, [t, i, o]);
|
|
3012
|
-
return me(() => {
|
|
3013
|
-
const S = (N = !1) => {
|
|
3014
|
-
const L = i.getSelectedCell(), O = { onFindOrReplace: A, onKeyDown: ($) => {
|
|
3015
|
-
b.findCommandByEvent($) !== b.getCommand("find") && b.findCommandByEvent($) !== b.getCommand("findReplace") || $.preventDefault();
|
|
3016
|
-
}, findOptions: {}, findText: L.toTextUnformatted(!0) };
|
|
3017
|
-
O.replace = N, t.showWindow?.("find", O, { disableAutoDestroy: !0 });
|
|
3018
|
-
};
|
|
3019
|
-
b.getCommand("find")?.update({ disabled: !t?.showWindow }).updateCallback(() => {
|
|
3020
|
-
S();
|
|
3021
|
-
}), b.getCommand("findReplace")?.update({ disabled: !t?.showWindow }).updateCallback(() => {
|
|
3022
|
-
S(!0);
|
|
3023
|
-
}), b.getCommand("goto")?.update({ disabled: !t }).updateCallback(() => {
|
|
3024
|
-
const N = { onInputOption: async (L) => {
|
|
3025
|
-
try {
|
|
3026
|
-
await i.getRanges(L).select();
|
|
3027
|
-
} catch (O) {
|
|
3028
|
-
t?.showMessage?.(O.message, { type: wt.Error });
|
|
3029
|
-
}
|
|
3030
|
-
}, onKeyDown: (L) => {
|
|
3031
|
-
b.findCommandByEvent(L) === b.getCommand("goto") && L.preventDefault();
|
|
3032
|
-
}, title: b.getCommand("goto")?.label(), inputLabel: "Location", options: ["Go To"] };
|
|
3033
|
-
t?.showInputOptions?.(N);
|
|
3034
|
-
}), b.getCommand("selectNamed")?.update({ disabled: !t }).updateCallback(async (N) => {
|
|
3035
|
-
if (N) try {
|
|
3036
|
-
await N.select();
|
|
3037
|
-
} catch (L) {
|
|
3038
|
-
t?.showError?.(L);
|
|
3039
|
-
}
|
|
3040
|
-
}), b.getCommand("addNamedReference")?.updateCallback(async function(N) {
|
|
3041
|
-
R(null);
|
|
3042
|
-
}), b.getCommand("editNamedReference")?.updateCallback(async function(N) {
|
|
3043
|
-
R(N);
|
|
3044
|
-
}), b.getCommand("deleteNamedReference")?.updateCallback(async function(N) {
|
|
3045
|
-
N?.delete?.();
|
|
3046
|
-
}), b.getCommand("activeNameBox")?.updateCallback(async function() {
|
|
3047
|
-
o?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus();
|
|
3048
|
-
});
|
|
3049
|
-
}, [o, i, t]), Ue(i?.getView(), { onViewChange: (S) => {
|
|
3050
|
-
b.getCommand("workbookViewToggleShowFormulaBar").update({ state: S.isShowFormulaBar() }).updateCallback(() => {
|
|
3051
|
-
S.setShowFormulaBar(!S.isShowFormulaBar());
|
|
3052
|
-
}), b.getCommand("workbookViewToggleShowTabs").update({ state: S.isShowTabs() }).updateCallback(() => {
|
|
3053
|
-
S.setShowTabs(!S.isShowTabs());
|
|
3054
|
-
}), b.getCommand("workbookViewToggleShowStatusBar").update({ state: S.isShowStatusBar() }).updateCallback(() => {
|
|
3055
|
-
S.setShowStatusBar(!S.isShowStatusBar());
|
|
3056
|
-
}), b.getCommand("workbookViewToggleShowHorizontalScrollBar").update({ state: S.isShowHorizontalScrollbar() }).updateCallback(() => {
|
|
3057
|
-
S.setShowHorizontalScrollbar(!S.isShowHorizontalScrollbar());
|
|
3058
|
-
}), b.getCommand("workbookViewToggleShowVerticalScrollBar").update({ state: S.isShowVerticalScrollbar() }).updateCallback(() => {
|
|
3059
|
-
S.setShowVerticalScrollbar(!S.isShowVerticalScrollbar());
|
|
3060
|
-
});
|
|
3061
|
-
} }), me(() => {
|
|
3062
|
-
b.getCommand("fullScreenToggle").update({ state: k, disabled: !C }).updateCallback(() => {
|
|
3063
|
-
T();
|
|
3064
|
-
});
|
|
3065
|
-
}, [k, C]), me(() => {
|
|
3066
|
-
const S = i.getProtection().isStructureAllowed();
|
|
3067
|
-
b.getCommand("hideSheet").update({ disabled: d.length <= 1 || !S }), b.getCommand("deleteSheet").update({ disabled: d.length <= 1 || !S });
|
|
3068
|
-
}, [d, s]), b;
|
|
3069
|
-
}, du = () => {
|
|
3070
|
-
window.open(window.origin.toString(), "sheetxl-" + Ze.uuidV4(), "popup=true");
|
|
3071
|
-
}, pu = "_sheetxl-theme_4opcr_2", uu = "_sheetxl-workbook_1j3lu_5", mu = (r) => e(Zi, { ...r }), gu = (r) => e(Ji, { ...r }), hu = (r) => e(Yi, { ...r }), ul = K(J((r, i) => {
|
|
3072
|
-
const { workbook: o, commands: t, onBeforeUserChange: n, onUserChange: l, disabled: c = !1, readOnly: m = !1, contextMenuProps: a, renderContextMenu: s = mu, sheetsAllProps: u, renderSheetsAll: d = gu, sheetTabProps: f, renderSheetTab: p, background: g = "transparent", className: y, notifier: b, sx: x, borderWidth: h, borderColor: w, gridTheme: v, gridStyle: C, ...k } = r, [T, M] = U(o?.getSelectedSheetIndex()), [I, A] = U(o?.getSheets().getItems()), [R, S] = U(o?.getProtection());
|
|
3073
|
-
Ue(o, { onViewChange(H) {
|
|
3074
|
-
M(H?.getSelectedSheetIndex());
|
|
3075
|
-
}, onSheetsChange: (H) => {
|
|
3076
|
-
A(H.getSheets().getItems());
|
|
3077
|
-
}, onProtectionChange: (H) => {
|
|
3078
|
-
S(H?.getProtection());
|
|
3079
|
-
} });
|
|
3080
|
-
const N = m || !R.isStructureAllowed(), L = W(() => {
|
|
3081
|
-
const H = [];
|
|
3082
|
-
for (let oe = 0; oe < I.length; oe++) H.push(I[oe].getName());
|
|
3083
|
-
return H;
|
|
3084
|
-
}, [I]), O = q((H) => {
|
|
3085
|
-
n?.(H) !== !1 && (o.getSheetAt(H).select(), l?.(H));
|
|
3086
|
-
}, [o, n, l]), $ = q((H, oe) => {
|
|
3087
|
-
o.getSheetAt(H).setName(oe), l?.(H);
|
|
3088
|
-
}, [o, l]), D = q((H, oe) => {
|
|
3089
|
-
o.getSheetAt(H).setPosition(oe), l?.(oe);
|
|
3090
|
-
}, [o, l]), E = ee(() => {
|
|
3091
|
-
if (n?.(T) === !1) return;
|
|
3092
|
-
const H = T + 1;
|
|
3093
|
-
o.getSheets().add({ name: void 0, autoSelect: !0 }), l?.(H);
|
|
3094
|
-
}, [o, n, l, T]), Y = W(() => ({ placement: "top-start" }), []), Z = Se(null), [X, _] = U(!1), ne = q((H) => {
|
|
3095
|
-
const { closeFloatAll: oe, floatReference: Te } = H;
|
|
3096
|
-
return d({ workbook: o, gridStyle: C, floatReference: Te, closeFloatAll: oe, ...u });
|
|
3097
|
-
}, [d, u, c, o, C]), { reference: ae, component: G } = oo({ label: "allSheet", popperProps: Y, anchor: Z.current, onOpen: () => _(!0), onClose: () => _(!1), createPopupPanel: ne }), z = Se(null), [Q, ue] = U(null), Le = q((H) => {
|
|
3098
|
-
const { floatReference: oe } = H;
|
|
3099
|
-
return s?.({ workbook: o, index: Q?.index, tabStripRef: z.current, commands: t, disabled: c, floatReference: oe, ...a });
|
|
3100
|
-
}, [s, a, c, o, t, Q]), { reference: Fe, component: Ae } = oo({ label: "sheetTab", popperProps: Y, anchor: { getBoundingClientRect: () => new DOMRect(Q?.left || 0, Q?.top || 0, 0, 0) }, onClose: () => ue(null), createPopupPanel: Le });
|
|
3101
|
-
me(() => {
|
|
3102
|
-
Q ? Fe.open(0) : Fe.close(0);
|
|
3103
|
-
}, [Q]);
|
|
3104
|
-
const Ye = q((H, oe) => {
|
|
3105
|
-
H.preventDefault(), ue({ left: H.clientX - 2, top: H.clientY - 4, index: oe });
|
|
3106
|
-
}, []), ve = ee((H) => {
|
|
3107
|
-
let oe;
|
|
3108
|
-
try {
|
|
3109
|
-
oe = o?.getSheetAt(H.index);
|
|
3110
|
-
} catch {
|
|
3111
|
-
}
|
|
3112
|
-
return oe ? (p ?? hu)({ sheet: oe, gridTheme: v, onContextMenu: (Te) => {
|
|
3113
|
-
O(H.index), Ye(Te, H.index);
|
|
3114
|
-
}, ...H, ...f }) : null;
|
|
3115
|
-
}, [p, f, o, v]), je = W(() => N ? null : e(At, { disableInteractive: !0, title: "New sheet", children: e(dt, { disabled: c, component: "div", sx: { padding: "0", "&:hover:not([disabled])": { color: (H) => H.palette.primary.main }, color: (H) => H.palette.text.icon ?? H.palette.action.active, "& svg": { width: "18px", height: "18px" } }, "aria-label": "addTab", size: "small", onMouseDown: (H) => {
|
|
3116
|
-
H.button === 0 && H.preventDefault();
|
|
3117
|
-
}, onClick: () => E(), children: e(Fd, {}) }) }), [c, N, E]);
|
|
3118
|
-
return j(B, { ref: i, className: Oe(y), sx: { position: "relative", display: "flex", alignItems: "stretch", flex: "1 1 100%", maxWidth: "100%", ...x }, ...k, children: [e(_d, { ref: z, selectedTabIndex: T, tabNames: L, onSelectedTabIndexChange: O, onTabNameChange: $, onTabMove: D, background: g, borderColor: w, borderWidth: h, activeColor: null, disabled: c, disableDrag: N, createScrollStartButton: qc, createScrollEndButton: Uc, createScrollEdgeButton: _c, createTabButton: ve, createTabDivider: (H) => {
|
|
3119
|
-
const { key: oe, ...Te } = H;
|
|
3120
|
-
return e(re, { sx: { marginLeft: "-1px", marginRight: "0px", marginTop: "6px", marginBottom: "6px", background: (ge) => he(ge.palette.divider, 0.25) }, ...Te }, oe);
|
|
3121
|
-
}, editLabelProps: { readOnly: N, maxLength: 31, styleHover: { fontWeight: "700" }, onKeyPress: (H) => {
|
|
3122
|
-
o.isValidSheetNameCharacter(H.key) || H.preventDefault();
|
|
3123
|
-
}, onCancel: () => {
|
|
3124
|
-
l?.(T);
|
|
3125
|
-
}, notifier: b }, children: e(At, { disableInteractive: !0, title: X ? "" : "List all sheets", children: e(ft, { sx: { padding: "0px", ml: 0.5, mr: 0, mt: 0, mb: 0, "& svg": { transform: "scale(0.8, 1)" }, color: (H) => H.palette.text.icon ?? H.palette.action.active }, ref: Z, dense: !0, outlined: !1, selected: X, color: "primary", "aria-label": "menu", onMouseDown: (H) => {
|
|
3126
|
-
H.button === 0 && H.preventDefault();
|
|
3127
|
-
}, onClick: () => {
|
|
3128
|
-
X ? ae.close(0) : ae.open(0);
|
|
3129
|
-
}, icon: e(Od, {}) }) }) }), e("div", { style: { borderTop: `solid ${w} ${h}px`, minWidth: "4px" } }), e("div", { style: { borderTop: `solid ${w} ${h}px`, flex: "none", display: "flex", alignItems: "center" }, children: je }), e("div", { style: { borderTop: `solid ${w} ${h}px`, flex: 1, minWidth: "24px" } }), Ae, G] });
|
|
3130
|
-
}));
|
|
3131
|
-
ul.displayName = "WorkbookStrip";
|
|
3132
|
-
const ml = K(J((r, i) => {
|
|
3133
|
-
const { workbook: o, commands: t, disabled: n, sx: l, floatReference: c, className: m, ...a } = r, [s, u] = rr((S) => S + 1, 0), [d, f] = U(o.getSelectedSheet()), [p, g] = U(d.getSelectedRanges()), [y, b] = U(d.getSelectedCell());
|
|
3134
|
-
Ue(o, { onSheetsChange() {
|
|
3135
|
-
f(o.getSelectedSheet());
|
|
3136
|
-
} }), Ue(d.getSelection(), { onChange() {
|
|
3137
|
-
g(d.getSelectedRanges()), b(d.getSelectedCell());
|
|
3138
|
-
} }), We(t, [], { onChange: () => {
|
|
3139
|
-
u();
|
|
3140
|
-
} });
|
|
3141
|
-
const x = W(() => ({}), []), h = W(() => ({ commandHook: { beforeExecute: (S, N) => c.closeAll(), onExecute() {
|
|
3142
|
-
}, onError() {
|
|
3143
|
-
console.log("onError");
|
|
3144
|
-
} }, disabled: n, scope: "contextMenu", parentFloat: c }), [n, c]), w = W(() => ({ ...x, ...h, variant: ie.Menuitem }), [x, h]), v = W(() => ({ commands: t, variant: ie.Menuitem, parentFloat: c, ...h }), [t, h, c]), C = [];
|
|
3145
|
-
let k = p.isEntireRows(), T = p.isEntireColumns();
|
|
3146
|
-
p && (k && (C.push(e(re, { orientation: "horizontal" }, "context:" + C.length)), C.push(Pe(F, { command: t.getCommand("hideColumns"), ...w, icon: P(e(Gc, {})), key: "context:" + C.length })), C.push(Pe(F, { command: t.getCommand("unhideColumns"), ...w, icon: P(e(Xc, {})), key: "context:" + C.length }))), T && (C.push(e(re, { orientation: "horizontal" }, "context:" + C.length)), C.push(Pe(F, { command: t.getCommand("hideRows"), ...w, icon: P(e(Kc, {})), key: "context:" + C.length })), C.push(Pe(F, { command: t.getCommand("unhideRows"), ...w, icon: P(e(Yc, {})), key: "context:" + C.length }))), (k || T) && C.push(e(re, { orientation: "horizontal" }, "context:" + C.length)), k && C.push(Pe(F, { command: t.getCommand("autoFitColumns"), ...w, icon: P(e(Zc, {})), key: "context:" + C.length })), T && C.push(Pe(F, { command: t.getCommand("autoFitRows"), ...w, icon: P(e(Jc, {})), key: "context:" + C.length })));
|
|
3147
|
-
const M = [], I = t.getCommand("formatTableStyle"), A = I?.context()?.table();
|
|
3148
|
-
if (Ht(I), !k && !T) {
|
|
3149
|
-
if (M.push(e(re, { orientation: "horizontal" }, "contextBefore:" + M.length)), y?.getHyperlink()) M.push(Pe(ct, { ...v, popupCommandKeys: ["updateHyperlink", "deleteHyperlink"], popupScope: "hyperlink", key: "contextBefore:action" + M.length, quickCommand: "openHyperlink", icon: (S) => S.key() === "openHyperlink" ? P(e(_n, {})) : null }));
|
|
3150
|
-
else {
|
|
3151
|
-
const S = t.getCommand("updateHyperlink");
|
|
3152
|
-
M.push(Pe(F, { command: S, ...w, icon: P(e(_n, {})), key: "contextBefore:" + M.length }));
|
|
3153
|
-
}
|
|
3154
|
-
if (y?.getComments()) M.push(Pe(ct, { ...v, popupCommandKeys: ["deleteComments"], key: "contextBefore:action" + M.length, quickCommand: "updateComments", icon: (S) => S.key() === "updateComments" ? P(e(Un, {})) : null }));
|
|
3155
|
-
else {
|
|
3156
|
-
const S = t.getCommand("updateComments");
|
|
3157
|
-
M.push(Pe(F, { command: S, ...w, icon: P(e(Un, {})), key: "contextBefore:" + M.length }));
|
|
3158
|
-
}
|
|
3159
|
-
A ? M.push(Pe(ct, { ...v, variant: ie.Menuitem, key: "contextBefore:" + M.length, popupCommandKeys: ["convertTableToRange", "deleteTable"], popupScope: "table", scope: "context", commandState: A, quickCommand: "editTable", icon: (S) => (S.key(), P(e(an, {}))) })) : M.push(Pe(F, { command: t.getCommand("insertTable"), ...w, icon: P(e(an, {})), key: "context:" + C.length })), M.push(Pe(Li, { ...v, key: "contextBefore:" + M.length }));
|
|
3160
|
-
}
|
|
3161
|
-
const R = j(se, { children: [e(F, { command: t.getCommand("cut"), ...w, icon: e(Qc, {}) }), e(xr, { command: t.getCommand("copy"), ...w }), e(Oi, { command: t.getCommand("paste"), ...v, includePasteAllInPopup: !1 }), e(re, { orientation: "horizontal" }), e(Ni, { ...v }), e(re, { orientation: "horizontal" }), e(Ri, { commands: t, ...v, disableSheet: !0 }), e(Mi, { commands: t, ...v, disableSheet: !0 }), e(Pi, { ...v }), M, C] });
|
|
3162
|
-
return e(B, { ref: i, className: Oe("menu", m), sx: { ...l }, ...a, children: R });
|
|
3163
|
-
}));
|
|
3164
|
-
ml.displayName = "WorkbookContextMenu";
|
|
3165
|
-
const gl = K(J((r, i) => {
|
|
3166
|
-
const { movable: o, commands: t, disabled: n, sx: l, floatReference: c, ...m } = r;
|
|
3167
|
-
Ue(o, { onAnyChange(g) {
|
|
3168
|
-
} });
|
|
3169
|
-
const a = W(() => ({}), []), s = W(() => ({ commandHook: { beforeExecute: (g, y) => c.closeAll(), onExecute() {
|
|
3170
|
-
}, onError() {
|
|
3171
|
-
console.log("onError");
|
|
3172
|
-
} }, disabled: n, parentFloat: c }), [n, c]), u = W(() => ({ variant: ie.Menuitem, ...a, ...s }), [a, s]), d = W(() => ({ commands: t, variant: ie.Menuitem, parentFloat: c, ...s }), [t, s, c]), f = (g) => {
|
|
3173
|
-
switch (g?.key()) {
|
|
3174
|
-
case "moveToFront":
|
|
3175
|
-
return P(e(dd, {}));
|
|
3176
|
-
case "moveForward":
|
|
3177
|
-
return P(e(cd, {}));
|
|
3178
|
-
case "moveToBack":
|
|
3179
|
-
return P(e(sd, {}));
|
|
3180
|
-
case "moveBackward":
|
|
3181
|
-
return P(e(ld, {}));
|
|
3182
|
-
case "toggleLockAspectRatio":
|
|
3183
|
-
return P(e(aa, {}));
|
|
3184
|
-
case "formatDrawAlignLeft":
|
|
3185
|
-
return P(e(ia, {}));
|
|
3186
|
-
case "formatDrawAlignCenter":
|
|
3187
|
-
return P(e(id, {}));
|
|
3188
|
-
case "formatDrawAlignRight":
|
|
3189
|
-
return P(e(ad, {}));
|
|
3190
|
-
case "formatDrawAlignTop":
|
|
3191
|
-
return P(e(rd, {}));
|
|
3192
|
-
case "formatDrawAlignMiddle":
|
|
3193
|
-
return P(e(nd, {}));
|
|
3194
|
-
case "formatDrawAlignBottom":
|
|
3195
|
-
return P(e(od, {}));
|
|
3196
|
-
case "formatDrawDistributeHorz":
|
|
3197
|
-
return P(e(td, {}));
|
|
3198
|
-
case "formatDrawDistributeVert":
|
|
3199
|
-
return P(e(ed, {}));
|
|
3200
|
-
case "formatAnchorTypeTwoCell":
|
|
3201
|
-
case "formatAnchorTypeOneCell":
|
|
3202
|
-
case "formatAnchorTypeAbsolute":
|
|
3203
|
-
return P(e(la, {}));
|
|
3204
|
-
default:
|
|
3205
|
-
return null;
|
|
3206
|
-
}
|
|
3207
|
-
}, p = j(se, { children: [e(xr, { command: t.getCommand("copy"), ...u, variant: ie.Menuitem }), [], e(re, { orientation: "horizontal" }), e(ct, { ...d, popupCommandKeys: ["moveToFront", "moveForward"], quickCommand: "moveToFront", icon: f }), e(ct, { ...d, popupCommandKeys: ["moveToBack", "moveBackward"], quickCommand: "moveToBack", icon: f }), e(re, { orientation: "horizontal" }), e(F, { ...u, command: t.getCommand("toggleLockAspectRatio"), icon: P(e(aa, {})) }), e(re, { orientation: "horizontal" }), e(ct, { ...d, popupCommandKeys: ["formatDrawAlignLeft", "formatDrawAlignCenter", "formatDrawAlignRight", null, "formatDrawAlignTop", "formatDrawAlignMiddle", "formatDrawAlignBottom", null, "formatDrawDistributeHorz", "formatDrawDistributeVert"], label: "Align", icon: (g) => f(g) || P(e(ia, {})), tooltip: "Quickly change the placement of your drawings." }), e(re, { orientation: "horizontal" }), e(ct, { ...d, popupCommandKeys: ["formatAnchorTypeTwoCell", "formatAnchorTypeOneCell", "formatAnchorTypeAbsolute"], label: "Sizing", icon: (g) => f(g) || P(e(la, {})), tooltip: "Determine how the drawing size will adjust as the cell sizes adjust." }), []] });
|
|
3208
|
-
return e(B, { ref: i, sx: { paddingTop: "4px", paddingBottom: "4px", ...l }, ...m, children: p });
|
|
3209
|
-
}));
|
|
3210
|
-
gl.displayName = "MovableContextMenu";
|
|
3211
|
-
const fu = (r) => e(gl, { ...r }), xu = (r) => e(ml, { ...r }), bu = (r) => e(Ki, { ...r }), yu = (r, i) => e(Xi, { ref: i, ...r }), wu = (r) => e(Lt, { ...r }), Su = (r, i) => e(Ud, { ref: i, ...r }), vu = (r) => e(ji, { ...r }), Cu = (r) => e(ul, { ...r }), ku = { fireOnModelChange: !1 }, On = { flex: "1 1 100%", display: "flex" }, hl = K(J((r, i) => {
|
|
3212
|
-
const { workbook: o, createWorkbookOptions: t, onNewWorkbook: n, onElementLoad: l, notifier: c, autoFocus: m = !1, sx: a, style: s, className: u, onFocus: d, onBlur: f, onKeyDown: p, onRepeatCommandChange: g, commands: y, showFormulaBar: b, formulaBarProps: x, renderFormulaBar: h = yu, showTabs: w, tabsProps: v, renderTabs: C = Cu, showStatusBar: k, statusBarProps: T, renderStatusBar: M = vu, toolbarProps: I, renderToolbar: A = pl, contextMenuSx: R, renderContextMenu: S = xu, renderFilterMenu: N = bu, renderMovableMenu: L = fu, renderLoadingPanel: O = wu, loadingPanelProps: $, sheetProps: D, renderSheet: E = Su, showHorizontalScrollbar: Y, showVerticalScrollbar: Z, gridTheme: X, headersTheme: _, enableDarkImages: ne, ...ae } = r, G = at(), z = hr(), Q = W(() => {
|
|
3213
|
-
const V = { theme: z.getDefaultTheme(), ...t };
|
|
3214
|
-
return o ?? new jn(V);
|
|
3215
|
-
}, [o]), ue = Se(null), [Le, Fe] = U(!1), Ae = Se(null), Ye = W(() => e(B, { className: "sheetxl-viewport", sx: { width: "100%", height: "100%", boxSizing: "border-box", position: "absolute", pointerEvents: "none !important", "& > :first-of-type": { position: "relative" } }, ref: Ae }), []), [ve, je] = U(!1), [H, oe] = U(!1), Te = q(() => {
|
|
3216
|
-
je(!0);
|
|
3217
|
-
}, []), ge = Se(null), fe = zt(i, () => ({ isWorkbookElement: () => !0, getWorkbook: () => Q, getSheetElement: () => ue.current, getViewportElement: () => Ae.current, getFormulaBarElement: () => ge.current, focus() {
|
|
3218
|
-
ue && ue.current && ue.current.focus();
|
|
3219
|
-
} }), [Q]), te = Se(null);
|
|
3220
|
-
St(() => {
|
|
3221
|
-
ve && fe.current && (oe(!0), te.current !== l && (l?.({ source: fe.current }), te.current = l));
|
|
3222
|
-
}, [ve, fe.current]), La(fe.current);
|
|
3223
|
-
const ce = q((V) => (ue.current?.submitEdit(), !0), []), Me = q(() => {
|
|
3224
|
-
requestAnimationFrame(() => {
|
|
3225
|
-
ue?.current?.focus();
|
|
3226
|
-
});
|
|
3227
|
-
}, []), [xe, Ge] = U(Q?.getSelectedSheet()), [et, no] = U(Q?.getProtection());
|
|
3228
|
-
Ue(Q, { onSheetsChange: (V) => {
|
|
3229
|
-
Ge(V?.getSelectedSheet());
|
|
3230
|
-
}, onViewChange(V) {
|
|
3231
|
-
Ge(V?.getSelectedSheet());
|
|
3232
|
-
}, onProtectionChange: (V) => {
|
|
3233
|
-
no(V?.getProtection());
|
|
3234
|
-
} }), Ue(Q, { onRequestSelect: async (V, de) => new Promise((Ee) => {
|
|
3235
|
-
ue.current.getSheet() !== de ? ue.current.getGridElement()?.onViewChangeOnce(() => {
|
|
3236
|
-
ue.current.getSheet() !== de && Ee(!1), Ee(!0);
|
|
3237
|
-
}) : Ee(!0);
|
|
3238
|
-
}) }, ku);
|
|
3239
|
-
const [fn, vr] = rr((V) => V + 1, 0), jt = Q?.getView();
|
|
3240
|
-
Ue(jt, { onViewChange: (V) => {
|
|
3241
|
-
vr();
|
|
3242
|
-
} });
|
|
3243
|
-
const ro = X ?? G, Ke = W(() => ja(G, ro), [G, ro]), Cr = _ ?? G, Ol = W(() => ja(G, Cr), [G, Cr]), [kr, Al] = U(null);
|
|
3244
|
-
q(() => {
|
|
3245
|
-
ue.current.focus();
|
|
3246
|
-
}, []);
|
|
3247
|
-
const [xn, Tr] = U(!1), Er = Se(null), Ne = cu({ workbook: Q, workbookElement: fe.current, commandTarget: () => ue.current, notifier: c, commands: y, darkMode: Ke.body.darkMode, onNewWorkbook: n, onShowSidebar: () => {
|
|
3248
|
-
xn ? Er.current?.focus() : Tr(!0);
|
|
3249
|
-
} }), bn = Se(null), [Dr, Pr] = U(!1), [Bl, Rr] = U(null), [Ll, Hl] = U(co.Top), [Bo, zl] = U(ds.EmptyBounds), yn = () => {
|
|
3250
|
-
Pr(!1), Rr(null);
|
|
3251
|
-
}, ao = (V, de, Ee = co.Top) => {
|
|
3252
|
-
zl(V), Hl(Ee), Rr(de), bn.current !== null && bn.current.update(), Pr(!0);
|
|
3253
|
-
}, [im, Mr] = U("sheet"), Ct = w ?? jt?.isShowTabs(), kt = Y ?? jt?.isShowHorizontalScrollbar(), Wl = b ?? jt?.isShowFormulaBar(), Lo = k ?? jt?.isShowStatusBar(), Nr = Z ?? jt?.isShowVerticalScrollbar(), Vt = Ke?.header?.edgeStrokeFill || "rgb(171,171,171)", jl = W(() => Lo ? M({ sheet: xe, gridStyle: Ke, ...T }) : null, [M, T, Lo, Ke, xe]), Vl = W(() => A({ commands: Ne, workbook: fe.current, ...I }), [Ne, A, I, G]), [$l, { width: Ir }] = No(), Xe = Ir === 0 || Ir > 560, wn = W(() => {
|
|
3254
|
-
if (!Ct) return null;
|
|
3255
|
-
let V = C({ background: Ke.body.fill, borderWidth: 1, borderColor: Vt, gridTheme: ro, gridStyle: Ke, onBeforeUserChange: ce, onUserChange: Me, workbook: Q, commands: Ne, sheetTabProps: {}, notifier: c, ...v });
|
|
3256
|
-
return Xe || (V = e("div", { style: { flex: "none", display: "flex" }, children: V })), V;
|
|
3257
|
-
}, [C, v, c, G, Q, ro, Xe, Ne, Ct]), Fr = q((V) => {
|
|
3258
|
-
const de = Ze.getOS() === Ze.OSType.Firefox;
|
|
3259
|
-
let Ee = null, qe = null, Ve = null;
|
|
3260
|
-
if (kt && (qe = e("div", { style: { display: "flex", flex: "1 1 100%", borderTop: `solid ${Vt} 1px`, maxWidth: "100%" }, children: e(ga, { style: { alignItems: "center", borderTop: (de ? 6 : 3) + "px solid transparent", borderBottom: (Xe ? 6 : 3) + "px solid transparent", borderLeft: (de ? 3 : 0) + "px solid transparent", borderRight: (de ? 3 : 0) + "px solid transparent" }, ...V, endGap: 700, sheet: xe, showCustomScrollButtons: !de, onShowTooltip: ($e) => {
|
|
3261
|
-
ao({ x: $e.anchor.x, y: $e.anchor.y, width: 0, height: 0 }, $e.display, $e.placement);
|
|
3262
|
-
}, onCloseTooltip: () => yn() }) })), Ct && Xe && (Ve = wn), Ct && Xe && !kt && (Ve = j(B, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: [Ve, e(B, { sx: { borderTop: `solid ${Vt} 1px`, flex: "1" } })] })), Ve && kt) Ee = e(Gn, { position: Q.getView().getTabRatio() / 10 + "%", onPositionChange: ({ percent: $e }) => {
|
|
3263
|
-
Q.getView().setTabRatio(Math.round(10 * $e));
|
|
3264
|
-
}, 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='${G.palette.text.icon ?? G.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 ${Vt} 1px`, borderBottom: "solid 3px transparent" } }, elementBefore: Ve, elementAfter: qe });
|
|
3265
|
-
else if (kt) Ee = qe;
|
|
3266
|
-
else {
|
|
3267
|
-
if (!Ve) return e(B, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center", height: "1px", borderTop: Lo ? null : `solid ${Vt} 1px` } });
|
|
3268
|
-
Ee = Ve;
|
|
3269
|
-
}
|
|
3270
|
-
return e(B, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: Ee });
|
|
3271
|
-
}, [xe, ce, Q, Ke, ro, Ne, Ct, kt, Lo, Xe]), [tt, io] = le.useState(null), _l = W(() => ({ placement: "right-start", ...tt?.popperProps }), [tt?.popperProps]), { reference: Or, component: Ul } = oo({ label: "contextMenu", popperProps: _l, anchor: tt?.anchor ?? { getBoundingClientRect: () => new DOMRect(tt?.clientX || 0, tt?.clientY || 0) }, onClose: () => io(null), createPopupPanel: tt?.createPopupPanel });
|
|
3272
|
-
me(() => {
|
|
3273
|
-
tt ? Or.open(0) : Or.close(0);
|
|
3274
|
-
}, [tt]);
|
|
3275
|
-
const ql = ee((V, de) => {
|
|
3276
|
-
if (V?.isDefaultPrevented()) return !0;
|
|
3277
|
-
V.preventDefault(), tt && tt.anchor === V.currentTarget ? io(null) : io({ anchor: V.currentTarget, popperProps: { offsets: [-4, 2] }, createPopupPanel: (Ee) => {
|
|
3278
|
-
const { floatReference: qe } = Ee;
|
|
3279
|
-
return N({ filter: de, commands: Ne, floatReference: qe, sx: { ...R } });
|
|
3280
|
-
} });
|
|
3281
|
-
}, [N, R, Ne, Q, tt]), Ar = ee((V) => {
|
|
3282
|
-
if (V.originalEvent?.isDefaultPrevented()) return !0;
|
|
3283
|
-
V.originalEvent?.preventDefault(), io({ clientX: V.clientX, clientY: V.clientY, createPopupPanel: (de) => {
|
|
3284
|
-
const { floatReference: Ee } = de;
|
|
3285
|
-
return S({ commands: Ne, workbook: Q, floatReference: Ee, sx: { ...R } });
|
|
3286
|
-
} });
|
|
3287
|
-
}, [S, R, Ne, Q]), Gl = ee((V, de) => {
|
|
3288
|
-
if (V?.isDefaultPrevented()) return !0;
|
|
3289
|
-
V.preventDefault(), io({ clientX: V.clientX, clientY: V.clientY, createPopupPanel: (Ee) => {
|
|
3290
|
-
const { floatReference: qe } = Ee;
|
|
3291
|
-
return L({ movable: de, commands: Ne, floatReference: qe, sx: { ...R } });
|
|
3292
|
-
} });
|
|
3293
|
-
}, [L, R, Ne]);
|
|
3294
|
-
W(() => {
|
|
3295
|
-
const V = [new _e("openContextMenu", () => ue.current, { label: "Context Menu", description: "Open the context menu.", shortcut: [{ key: "F10", modifiers: [we.Shift] }, { key: "ContextMenu" }] })];
|
|
3296
|
-
Ne.addCommands(V, !0);
|
|
3297
|
-
}, [Ne]), me(() => {
|
|
3298
|
-
Ne.getCommand("openContextMenu").updateCallback(() => {
|
|
3299
|
-
const V = xe.getSelection().getCoords().cell;
|
|
3300
|
-
ue.current?.getGridElement()?.scrollCellCoordsIntoView(V).then((de) => {
|
|
3301
|
-
requestAnimationFrame(() => {
|
|
3302
|
-
const Ee = xe.getView().getZoomScale() / 100, qe = xe.getColumnHeaders().findOffset(V.colIndex + 1) * Ee, Ve = xe.getRowHeaders().findOffset(V.rowIndex + 1) * Ee, $e = ue.current?.getGridElement()?.getRelativePointFromClient(0, 0) || { x: 0, y: 0 };
|
|
3303
|
-
Ar({ clientX: qe - $e.x - de.left + 6, clientY: Ve - $e.y - de.top + 6 });
|
|
3304
|
-
});
|
|
3305
|
-
});
|
|
3306
|
-
});
|
|
3307
|
-
}, [xe]);
|
|
3308
|
-
const Xl = ee((V) => {
|
|
3309
|
-
Ne?.dispatchToFocusedCommand(V);
|
|
3310
|
-
}, [Ne]), Kl = ee(() => {
|
|
3311
|
-
La(fe.current);
|
|
3312
|
-
}, [Q, fe.current]), Yl = q(() => {
|
|
3313
|
-
Mr("sheet");
|
|
3314
|
-
}, []), Zl = q(() => {
|
|
3315
|
-
Mr("formulaBar");
|
|
3316
|
-
}, []), Jl = ee((V) => {
|
|
3317
|
-
const de = Ze.getOS() === Ze.OSType.Firefox;
|
|
3318
|
-
return e(ga, { style: { borderLeft: "3px solid transparent", borderRight: "0px solid transparent", borderTop: (de ? 3 : 0) + "px solid transparent", borderBottom: (de ? 3 : 0) + "px solid transparent", width: de ? "13px" : void 0 }, ...V, sheet: xe, endGap: 700, showCustomScrollButtons: !de, onShowTooltip: (Ee) => {
|
|
3319
|
-
ao(Ee.anchor, Ee.display, co.Left);
|
|
3320
|
-
}, onCloseTooltip: () => yn() });
|
|
3321
|
-
}, [xe]);
|
|
3322
|
-
me(() => {
|
|
3323
|
-
m && ue && ue.current && ue.current.focus();
|
|
3324
|
-
}, []);
|
|
3325
|
-
const [Ho, Sn] = le.useState(null), vn = q((V) => {
|
|
3326
|
-
Ne?.getCommand("openWorkbook") && (V.type === "dragenter" || V.type === "dragover" ? V.dataTransfer?.types.includes("Files") ? V.dataTransfer.files[0]?.type?.startsWith("image/") || V.dataTransfer.items[0]?.type?.startsWith("image/") || V.dataTransfer.types.length === 1 && Sn("Drop to open") : (V.dataTransfer?.types.includes("text/html") || V.dataTransfer?.types.includes("text/plain"), V.dataTransfer.effectAllowed = "none", V.dataTransfer.dropEffect = "none") : V.type === "dragleave" && Sn(null), V.preventDefault());
|
|
3327
|
-
}, [Ne]), Ql = ee((V) => {
|
|
3328
|
-
if (Ne?.getCommand("openWorkbook") && (V.preventDefault(), V.stopPropagation(), Sn(null), V.dataTransfer.files && V.dataTransfer.files.length > 0)) {
|
|
3329
|
-
const de = V.dataTransfer.files[0];
|
|
3330
|
-
if (!de) return;
|
|
3331
|
-
if (de?.type?.startsWith("image/")) {
|
|
3332
|
-
const Ee = ue.current?.getGridElement().getViewFromClient(V.clientX, V.clientY);
|
|
3333
|
-
if (!Ee) return;
|
|
3334
|
-
const qe = Ee.getRelativePointFromClient(V.clientX, V.clientY), Ve = Ee.toAbsoluteBounds({ ...qe, width: 0, height: 0 }), $e = Ee.getCellCoordsFromClient(V.clientX, V.clientY);
|
|
3335
|
-
if (!$e) return;
|
|
3336
|
-
Ne?.getCommand("insertImageFromFile")?.execute({ file: de, options: { bounds: { x: Ve.x, y: Ve.y } }, goto: { range: { ...$e } } });
|
|
3337
|
-
} else Ne?.getCommand("openWorkbook")?.execute(de);
|
|
3338
|
-
}
|
|
3339
|
-
}, [Ne, Ho]), es = W(() => Ho ? e(B, { sx: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", pointerEvents: "none", display: "flex", justifyContent: "center", alignItems: "center", background: (V) => V.palette.divider, color: (V) => V.palette.primary.dark }, children: e(Be, { variant: "h4", children: Ho }) }) : null, [Ho]), Br = Se(null), ts = W(() => e(Jn, { in: !H, nodeRef: Br, timeout: 500, classNames: "animating", unmountOnExit: !0, children: e(B, { style: { display: "flex", alignItems: "center", justifyContent: "center", left: "0px", top: "0px", width: "100%", height: "100%", pointerEvents: H ? "none" : a?.pointerEvents, position: "absolute", boxSizing: "border-box" }, children: O({ ref: Br, transitionDelay: "0", transparentBackground: !1, sx: { opacity: H ? 0 : a?.opacity, pointerEvents: H ? "none" : a?.pointerEvents, position: "absolute", left: "0px", top: "0px", width: "100%", height: "100%", ...$ } }) }) }), [H, O, $]), os = W(() => h({ sx: { marginTop: (V) => V.spacing(0.25), marginLeft: (V) => V.spacing(1), marginRight: (V) => V.spacing(1) }, workbook: Q, sheetElement: ue.current, gridStyle: Ke, onFocus: Zl, ...x, NamedCollectionEditorProps: { restoreFocus: (V) => ue.current.focus(V), notifier: c, ...x?.NamedCollectionEditorProps, commandPopupButtonProps: { commands: Ne, ...x?.NamedCollectionEditorProps?.commandPopupButtonProps } } }, ge), [h, x, Q, Ke, Ne, H]), ns = q((V) => {
|
|
3340
|
-
const { movable: de, ...Ee } = V, qe = { movable: de, onContextMenuCapture: (Tt) => {
|
|
3341
|
-
Gl(Tt, de);
|
|
3342
|
-
}, ...Ee }, Ve = de.getContent().getType();
|
|
3343
|
-
let $e = null;
|
|
3344
|
-
if (Ve === "picture") return e(qd, { loadingPanel: e(Lt, { transitionDelay: "100", style: { position: "absolute" }, sx: { border: (Tt) => `solid 1px ${Tt.palette.action.active}` } }), picture: de.getContent(), description: de.getDescription() ?? de?.getName(), ...qe });
|
|
3345
|
-
if (Ve === "chart") {
|
|
3346
|
-
const Tt = { ...qe, chart: de.getContent() };
|
|
3347
|
-
return e(Gd, { ...Tt });
|
|
3348
|
-
}
|
|
3349
|
-
if ($e = `Float of type '${Ve}'.`, typeof $e == "string") {
|
|
3350
|
-
const Tt = { ...qe, description: $e };
|
|
3351
|
-
$e = e(Xd, { ...Tt });
|
|
3352
|
-
}
|
|
3353
|
-
return e("div", { style: { position: "absolute", clipPath: "inset(0px)", display: "flex", alignItems: "stretch", justifyContent: "stretch", pointerEvents: "all" }, children: $e }, de.getUUID());
|
|
3354
|
-
}, []), Lr = W(() => E({ style: On, onFocus: Yl, notifier: c, gridStyle: Ke, headersStyle: Ol, sheet: xe, commands: Ne, onSheetContextMenu: Ar, onViewportChange: (V) => {
|
|
3355
|
-
Al(V);
|
|
3356
|
-
}, showScrollbars: !1, viewportComponent: Ye, onRepeatCommandChange: g, onElementLoad: Te, onShowColumnTooltip: (V) => {
|
|
3357
|
-
ao(V.anchor, V.display, co.Top);
|
|
3358
|
-
}, onShowRowTooltip: (V) => {
|
|
3359
|
-
ao(V.anchor, V.display, co.Right);
|
|
3360
|
-
}, onShowTooltip: (V) => {
|
|
3361
|
-
ao({ x: V.anchor.x, y: V.anchor.y, width: 0, height: 0 }, V.display, V.placement);
|
|
3362
|
-
}, onCloseTooltip: () => yn(), renderMovable: ns, ...D, cellRenderProps: { onFilterButtonMouseDown: (V, de) => {
|
|
3363
|
-
D?.cellRenderProps?.onFilterButtonMouseDown(V, de), ql(V, de);
|
|
3364
|
-
}, ...D?.cellRenderProps } }, ue), [E, Ne, D, xe, Ke, c, g]), Cn = W(() => {
|
|
3365
|
-
if (!xn) return null;
|
|
3366
|
-
const V = !et.isStructureAllowed();
|
|
3367
|
-
return e(cl, { sx: { marginBottom: (de) => de.spacing(0.5), border: (de) => `solid ${V ? de.palette.action.disabled : he(de.palette.divider, 0.2)} 1px`, borderRadius: (de) => `${de.shape.borderRadius}px`, overflow: "hidden" }, onClose: () => {
|
|
3368
|
-
Tr(!1), requestAnimationFrame(() => {
|
|
3369
|
-
ue.current.focus();
|
|
3370
|
-
});
|
|
3371
|
-
}, readOnly: V, commands: Ne, ref: Er, scripts: Q.getScripts() });
|
|
3372
|
-
}, [xn, Ne, Q, c, et]), rs = W(() => {
|
|
3373
|
-
const V = e(Ld, { style: { ...On, marginRight: Cn && Xe ? "0px" : "6px" }, viewport: kr, touchElement: ue.current?.getGridElement()?.stage, onScrollViewport: ($e) => {
|
|
3374
|
-
ue.current?.getGridElement()?.scrollTo($e);
|
|
3375
|
-
}, showHorizontalScrollbar: kt || Ct, showVerticalScrollbar: Nr, createHorizontalScrollbar: Fr, createVerticalScrollbar: Jl, children: Lr });
|
|
3376
|
-
let de = V;
|
|
3377
|
-
Xe || (de = j(se, { children: [V, wn] }));
|
|
3378
|
-
let Ee = null, qe = 4, Ve = 13;
|
|
3379
|
-
return Xe ? Ee = "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" : (Ee = "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", qe = 13, Ve = 4), e(Gn, { fixedPane: "after", position: "40%", minAfter: Xe ? "280px" : "120px", splitDirection: Xe ? "row" : "column", style: On, ref: $l, resizerProps: { className: "styled-resizer", style: { minWidth: Xe ? "6px" : void 0, minHeight: Xe ? void 0 : "6px", maskImage: `url("data:image/svg+xml,%3Csvg width='${qe}' height='${Ve}' viewBox='0 0 ${qe} ${Ve}' version='1.1' fill='${G.palette.text.icon ?? G.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${Ee}' /%3E%3C/svg%3E%0A")`, maskRepeat: "no-repeat", maskPosition: Xe ? "left center" : "top center" } }, elementBefore: de, paneBeforeProps: { style: { flexDirection: "column" } }, elementAfter: Cn, paneAfterProps: { style: { marginLeft: Xe ? "0px" : "4px", marginRight: Xe ? "8px" : "4px" } } });
|
|
3380
|
-
}, [kt, Ct, Fr, Nr, kr, Cn, Lr, wn, G, Xe]), as = W(() => ({ boxSizing: "border-box", background: (V) => V.palette.mode !== "dark" ? Ke.header.fill : V.palette.background.paper, "& *": { ...pd(G), fontWeight: 400 }, "&.Mui-focusVisible": {}, "& .viewport-overlay": { borderRight: `solid ${Vt} 1px` }, ...a }), [a, Ke]);
|
|
3381
|
-
return j(Po, { className: Oe("sheetxl-workbook", uu, { "Mui-focusVisible": Le }, pu, u), sx: as, style: s, square: !1, ...ae, ref: fe, onFocus: (V) => {
|
|
3382
|
-
Fe(!0), Kl(), d?.(V);
|
|
3383
|
-
}, onBlur: (V) => {
|
|
3384
|
-
Fe(!1), f?.(V);
|
|
3385
|
-
}, onKeyDown: (V) => {
|
|
3386
|
-
Xl(V), p?.(V);
|
|
3387
|
-
}, onDragStart: (V) => {
|
|
3388
|
-
if (V.target.src) {
|
|
3389
|
-
const de = new Image();
|
|
3390
|
-
de.src = V.target.src, V.dataTransfer.setDragImage(de, 1, 1);
|
|
3391
|
-
}
|
|
3392
|
-
}, onDragEnter: vn, onDragLeave: vn, onDragOver: vn, onDrop: Ql, children: [j("div", { className: Oe(Bi), style: { flex: "1 1 100%", width: "100%", display: "flex", flexDirection: "column", opacity: H ? void 0 : 0, "--sxl-app-color-high-contrast": G.palette.primary.main, "--sxl-app-color-primary": G.palette.primary.main, "--sxl-app-color-primary-dark": G.palette.primary.dark, "--sxl-app-color-primary-light": G.palette.primary.light, "--sxl-app-color-info": G.palette.info.main, "--sxl-app-color-info-dark": G.palette.info.dark, "--sxl-app-color-info-light": G.palette.info.light, "--sxl-app-color-secondary": G.palette.secondary.main, "--sxl-app-color-secondary-dark": G.palette.secondary.dark, "--sxl-app-color-secondary-light": G.palette.secondary.light, "--sxl-app-color-success": G.palette.success.main, "--sxl-app-color-success-dark": G.palette.success.dark, "--sxl-app-color-success-light": G.palette.success.light, "--sxl-app-color-warning": G.palette.warning.main, "--sxl-app-color-warning-dark": G.palette.warning.dark, "--sxl-app-color-warning-light": G.palette.warning.light, "--sxl-app-color-error": G.palette.error.main, "--sxl-app-color-error-dark": G.palette.error.dark, "--sxl-app-color-error-light": G.palette.error.light, "--sxl-app-color-text": G.palette.text.primary, "--sxl-app-color-text-secondary": G.palette.text.secondary, "--sxl-app-color-text-disabled": G.palette.text.disabled, "--sxl-app-color-background": G.palette.background.paper, "--sxl-app-color-button-surface": G.palette.grey[600], "--sxl-app-color-shadow": G.palette.action.focus, "--sxl-app-color-grey": G.palette.grey[500], "--sxl-app-filter-dark-invert": Ke.body.darkMode && ne ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", "--sxl-app-image-background": Ke.body.darkMode ? `linear-gradient(${he("#fff", De(5))}, ${he("#fff", De(5))})` : void 0 }, children: [Vl, Wl ? os : null, e(B, { sx: { marginBottom: (V) => V.spacing(0.75) } }), rs, jl, e(At, { arrow: !0, disableInteractive: !0, open: Dr, title: e(Be, { variant: "subtitle2", component: "div", children: Bl }), placement: Ll, TransitionProps: { timeout: { exit: 0 } }, PopperProps: { popperRef: bn, sx: { "& .MuiTooltip-tooltip": { padding: "2px 6px", "& .MuiTooltip-arrow": { display: Dr ? "visible" : "none" } } }, anchorEl: { getBoundingClientRect: () => new DOMRect(Bo.x, Bo.y, Bo.width, Bo.height) }, modifiers: [{ name: "offset", options: { offset: [0, 0] } }] }, children: e(B, {}) }), Ul, es] }), ts] });
|
|
3393
|
-
}));
|
|
3394
|
-
hl.displayName = "WorkbookElement";
|
|
3395
|
-
const Tu = (r = !1, i = !1) => i ? null : { "& input:not(:focus):not(:hover)": { color: (o) => o.palette.text.secondary }, backgroundColor: (o) => he(o.palette.background.paper, 0.6), borderRadius: (o) => `${o.shape.borderRadius}px`, border: (o) => `solid ${r ? o.palette.divider : "transparent"} 1px`, "&.Mui-disabled": { border: (o) => `solid ${r ? o.palette.divider : "transparent"} 1px` }, "&:focus-within:not([disabled])": { backgroundColor: (o) => o.palette.background.paper }, "&:hover:not([disabled])": { border: (o) => `solid ${r ? o.palette.text?.primary : o.palette.divider} 1px`, backgroundColor: null }, "&.Mui-focusVisible": { outline: (o) => `solid ${o.palette.primary.main} 1px !important`, border: (o) => `1px solid ${o.palette?.primary?.main} !important` } }, fl = K(J((r, i) => {
|
|
3396
|
-
const { sx: o, workbook: t, title: n = "", placeHolder: l = "Untitled", onTitleChange: c, readOnly: m = !1, hidden: a, ...s } = r, [u, d] = U(!1), [f, p] = U(!1), [g, y] = U(n ?? ""), [b, x] = U(""), [h, { width: w }] = No(), [v, { width: C }] = No(), [k, T] = U(!1), M = Se(null), I = Se(null), A = zt(i, () => ({ requestWorkbookTitle: (R = null, S) => {
|
|
3397
|
-
I.current = { onAccept: R, requestReason: S?.requestReason }, S?.selectAll && M.current?.select(), M.current?.focus(S);
|
|
3398
|
-
}, focus: (R) => {
|
|
3399
|
-
M.current?.focus(R);
|
|
3400
|
-
} }), []);
|
|
3401
|
-
return St(() => {
|
|
3402
|
-
T(n !== g), x(n), y(n);
|
|
3403
|
-
}, [n]), me(() => {
|
|
3404
|
-
k && w !== 0 && Jt.debounce(() => {
|
|
3405
|
-
T(!1);
|
|
3406
|
-
}, 300)();
|
|
3407
|
-
}, [k, w]), me(() => {
|
|
3408
|
-
p(g && !Yt.isValidWindowsFilename(g));
|
|
3409
|
-
}, [g]), a ? null : e(B, { sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", opacity: k ? "0" : "1", transition: k ? void 0 : "opacity .25s ease-in", "& .tooltip-wrapper": { maxWidth: "100%" } }, ref: Fo([A, v, i]), ...s, children: e(rt, { label: I.current?.requestReason ?? "Workbook Name", children: j(B, { className: Oe({ "Mui-focusVisible": u }), sx: { visibility: w === 0 ? "hidden" : "visible", display: "block", maxWidth: "100%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", paddingLeft: "12px", paddingRight: "12px", marginLeft: "2px", marginRight: "2px", paddingTop: "2px", paddingBottom: "1px", ...Tu(!0, m), ...o }, children: [m ? e(Be, { variant: "subtitle1", component: "div", sx: { whiteSpace: "nowrap", fontStyle: g !== b ? "italic" : void 0, userSelect: "none", textOverflow: "ellipsis", lineHeight: "1.4375em", border: "transparent 1px solid", color: (R) => f ? R.palette.error.dark : void 0 }, children: n ?? l }) : e(ir, { sx: { width: `${Math.min(w + 3, Math.max(C, A.current?.getBoundingClientRect()?.width))}px`, overflow: "hidden", whiteSpace: "nowrap", fontWeight: "600", maxWidth: "100%", border: "none", padding: "0px", margin: "0px", color: (R) => f ? R.palette.error.dark : void 0, fontStyle: g !== b ? "italic" : void 0, "& input": { paddingTop: "0px", paddingBottom: "0px", textOverflow: "ellipsis" } }, disableUnderline: !0, fullWidth: !1, multiline: !1, readOnly: m, spellCheck: !1, placeholder: l, onFocus: (R) => {
|
|
3410
|
-
d(!0), R.target?.select();
|
|
3411
|
-
}, inputProps: { name: "input-workbook-title", autoComplete: "off", ref: M }, onBlur: () => {
|
|
3412
|
-
d(!1), f ? y(b) : (g !== b && (c?.(g), g && I.current?.onAccept?.(g, "blur")), I.current = null);
|
|
3413
|
-
}, onChange: (R) => {
|
|
3414
|
-
if (R.target.value.length > Yt.MAX_WORKBOOK_NAME_SIZE) return R.stopPropagation(), void R.preventDefault();
|
|
3415
|
-
y(R.target.value);
|
|
3416
|
-
}, onKeyDown: (R) => {
|
|
3417
|
-
(Yt.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(R.key) || R.target?.value.length > Yt.MAX_WORKBOOK_NAME_SIZE) && R.preventDefault(), R.which === ye.Enter || R.which === ye.Tab ? (f ? y(b) : (c?.(g), g && (I.current?.onAccept?.(g, "keydown"), I.current = null)), R.stopPropagation(), R.preventDefault(), t?.focus()) : R.which === ye.Escape && (g === b ? t?.focus() : (y(b), setTimeout(() => {
|
|
3418
|
-
R.target?.select();
|
|
3419
|
-
}, 0)), I.current = null, R.stopPropagation(), R.preventDefault());
|
|
3420
|
-
}, value: g }), e(B, { ref: h, sx: { position: "absolute", visibility: "hidden", top: "-9999px", fontWeight: "600 !important", whiteSpace: "pre", fontStyle: g !== b ? "italic" : void 0, fontFamily: (R) => R.typography.fontFamily, letterSpacing: "0.00938em" }, children: g || l })] }) }) });
|
|
3421
|
-
}));
|
|
3422
|
-
fl.displayName = "WorkbookTitle";
|
|
3423
|
-
const Eu = K(J((r, i) => {
|
|
3424
|
-
const { sx: o, style: t, className: n, licenseKey: l, renderLoadingPanel: c, ...m } = r;
|
|
3425
|
-
l && vo.setLicenseKey(l);
|
|
3426
|
-
const a = W(() => {
|
|
3427
|
-
const u = { transitionDelay: "160ms", transparentBackground: !0 };
|
|
3428
|
-
return e(B, { sx: o, style: { width: "100%", height: "100%", position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", ...t }, children: c?.(u) ?? e(Lt, { ...u }) });
|
|
3429
|
-
}, [o, t, c]), s = W(() => le.lazy(async () => await Promise.resolve().then(() => am)), []);
|
|
3430
|
-
return e(se, { children: e(si, { fallback: a, children: e(s, { ...m, className: n, renderLoadingPanel: c, sx: o, style: t, ref: i }) }) });
|
|
3431
|
-
}));
|
|
3432
|
-
Eu.displayName = "Studio";
|
|
3433
|
-
const Du = ms(null), An = { didCatch: !1, error: null };
|
|
3434
|
-
class Pu extends ci {
|
|
3435
|
-
constructor(i) {
|
|
3436
|
-
super(i), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = An;
|
|
3437
|
-
}
|
|
3438
|
-
static getDerivedStateFromError(i) {
|
|
3439
|
-
return { didCatch: !0, error: i };
|
|
3440
|
-
}
|
|
3441
|
-
resetErrorBoundary() {
|
|
3442
|
-
const { error: i } = this.state;
|
|
3443
|
-
if (i !== null) {
|
|
3444
|
-
for (var o, t, n = arguments.length, l = new Array(n), c = 0; c < n; c++) l[c] = arguments[c];
|
|
3445
|
-
(o = (t = this.props).onReset) === null || o === void 0 || o.call(t, { args: l, reason: "imperative-api" }), this.setState(An);
|
|
3446
|
-
}
|
|
3447
|
-
}
|
|
3448
|
-
componentDidCatch(i, o) {
|
|
3449
|
-
var t, n;
|
|
3450
|
-
(t = (n = this.props).onError) === null || t === void 0 || t.call(n, i, o);
|
|
3451
|
-
}
|
|
3452
|
-
componentDidUpdate(i, o) {
|
|
3453
|
-
const { didCatch: t } = this.state, { resetKeys: n } = this.props;
|
|
3454
|
-
var l, c;
|
|
3455
|
-
t && o.error !== null && function() {
|
|
3456
|
-
let m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
3457
|
-
return m.length !== a.length || m.some((s, u) => !Object.is(s, a[u]));
|
|
3458
|
-
}(i.resetKeys, n) && ((l = (c = this.props).onReset) === null || l === void 0 || l.call(c, { next: n, prev: i.resetKeys, reason: "keys" }), this.setState(An));
|
|
3459
|
-
}
|
|
3460
|
-
render() {
|
|
3461
|
-
const { children: i, fallbackRender: o, FallbackComponent: t, fallback: n } = this.props, { didCatch: l, error: c } = this.state;
|
|
3462
|
-
let m = i;
|
|
3463
|
-
if (l) {
|
|
3464
|
-
const a = { error: c, resetErrorBoundary: this.resetErrorBoundary };
|
|
3465
|
-
if (typeof o == "function") m = o(a);
|
|
3466
|
-
else if (t) m = Pe(t, a);
|
|
3467
|
-
else {
|
|
3468
|
-
if (n === void 0) throw c;
|
|
3469
|
-
m = n;
|
|
3470
|
-
}
|
|
3471
|
-
}
|
|
3472
|
-
return Pe(Du.Provider, { value: { didCatch: l, error: c, resetErrorBoundary: this.resetErrorBoundary } }, m);
|
|
3473
|
-
}
|
|
3474
|
-
}
|
|
3475
|
-
function xl(r) {
|
|
3476
|
-
var i, o, t = "";
|
|
3477
|
-
if (typeof r == "string" || typeof r == "number") t += r;
|
|
3478
|
-
else if (typeof r == "object") if (Array.isArray(r)) for (i = 0; i < r.length; i++) r[i] && (o = xl(r[i])) && (t && (t += " "), t += o);
|
|
3479
|
-
else for (i in r) r[i] && (t && (t += " "), t += i);
|
|
3480
|
-
return t;
|
|
3481
|
-
}
|
|
3482
|
-
function Wt() {
|
|
3483
|
-
for (var r, i, o = 0, t = ""; o < arguments.length; ) (r = arguments[o++]) && (i = xl(r)) && (t && (t += " "), t += i);
|
|
3484
|
-
return t;
|
|
3485
|
-
}
|
|
3486
|
-
let Ru = { data: "" }, Mu = (r) => typeof window == "object" ? ((r ? r.querySelector("#_goober") : window._goober) || Object.assign((r || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : r || Ru, Nu = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, Iu = /\/\*[^]*?\*\/| +/g, Ka = /\n+/g, Ft = (r, i) => {
|
|
3487
|
-
let o = "", t = "", n = "";
|
|
3488
|
-
for (let l in r) {
|
|
3489
|
-
let c = r[l];
|
|
3490
|
-
l[0] == "@" ? l[1] == "i" ? o = l + " " + c + ";" : t += l[1] == "f" ? Ft(c, l) : l + "{" + Ft(c, l[1] == "k" ? "" : i) + "}" : typeof c == "object" ? t += Ft(c, i ? i.replace(/([^,])+/g, (m) => l.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (a) => /&/.test(a) ? a.replace(/&/g, m) : m ? m + " " + a : a)) : l) : c != null && (l = /^--/.test(l) ? l : l.replace(/[A-Z]/g, "-$&").toLowerCase(), n += Ft.p ? Ft.p(l, c) : l + ":" + c + ";");
|
|
3491
|
-
}
|
|
3492
|
-
return o + (i && n ? i + "{" + n + "}" : n) + t;
|
|
3493
|
-
}, pt = {}, bl = (r) => {
|
|
3494
|
-
if (typeof r == "object") {
|
|
3495
|
-
let i = "";
|
|
3496
|
-
for (let o in r) i += o + bl(r[o]);
|
|
3497
|
-
return i;
|
|
3498
|
-
}
|
|
3499
|
-
return r;
|
|
3500
|
-
}, Fu = (r, i, o, t, n) => {
|
|
3501
|
-
let l = bl(r), c = pt[l] || (pt[l] = ((a) => {
|
|
3502
|
-
let s = 0, u = 11;
|
|
3503
|
-
for (; s < a.length; ) u = 101 * u + a.charCodeAt(s++) >>> 0;
|
|
3504
|
-
return "go" + u;
|
|
3505
|
-
})(l));
|
|
3506
|
-
if (!pt[c]) {
|
|
3507
|
-
let a = l !== r ? r : ((s) => {
|
|
3508
|
-
let u, d, f = [{}];
|
|
3509
|
-
for (; u = Nu.exec(s.replace(Iu, "")); ) u[4] ? f.shift() : u[3] ? (d = u[3].replace(Ka, " ").trim(), f.unshift(f[0][d] = f[0][d] || {})) : f[0][u[1]] = u[2].replace(Ka, " ").trim();
|
|
3510
|
-
return f[0];
|
|
3511
|
-
})(r);
|
|
3512
|
-
pt[c] = Ft(n ? { ["@keyframes " + c]: a } : a, o ? "" : "." + c);
|
|
3513
|
-
}
|
|
3514
|
-
let m = o && pt.g ? pt.g : null;
|
|
3515
|
-
return o && (pt.g = pt[c]), ((a, s, u, d) => {
|
|
3516
|
-
d ? s.data = s.data.replace(d, a) : s.data.indexOf(a) === -1 && (s.data = u ? a + s.data : s.data + a);
|
|
3517
|
-
})(pt[c], i, t, m), c;
|
|
3518
|
-
};
|
|
3519
|
-
function Qn(r) {
|
|
3520
|
-
let i = this || {}, o = r.call ? r(i.p) : r;
|
|
3521
|
-
return Fu(o.unshift ? o.raw ? ((t, n, l) => t.reduce((c, m, a) => {
|
|
3522
|
-
let s = n[a];
|
|
3523
|
-
if (s && s.call) {
|
|
3524
|
-
let u = s(l), d = u && u.props && u.props.className || /^go/.test(u) && u;
|
|
3525
|
-
s = d ? "." + d : u && typeof u == "object" ? u.props ? "" : Ft(u, "") : u === !1 ? "" : u;
|
|
3526
|
-
}
|
|
3527
|
-
return c + m + (s ?? "");
|
|
3528
|
-
}, ""))(o, [].slice.call(arguments, 1), i.p) : o.reduce((t, n) => Object.assign(t, n && n.call ? n(i.p) : n), {}) : o, Mu(i.target), i.g, i.o, i.k);
|
|
3529
|
-
}
|
|
3530
|
-
function yl(r, i, o) {
|
|
3531
|
-
return i && function(t, n) {
|
|
3532
|
-
for (var l = 0; l < n.length; l++) {
|
|
3533
|
-
var c = n[l];
|
|
3534
|
-
c.enumerable = c.enumerable || !1, c.configurable = !0, "value" in c && (c.writable = !0), Object.defineProperty(t, c.key, c);
|
|
3535
|
-
}
|
|
3536
|
-
}(r.prototype, i), r;
|
|
3537
|
-
}
|
|
3538
|
-
function Ie() {
|
|
3539
|
-
return Ie = Object.assign || function(r) {
|
|
3540
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
3541
|
-
var o = arguments[i];
|
|
3542
|
-
for (var t in o) Object.prototype.hasOwnProperty.call(o, t) && (r[t] = o[t]);
|
|
3543
|
-
}
|
|
3544
|
-
return r;
|
|
3545
|
-
}, Ie.apply(this, arguments);
|
|
3546
|
-
}
|
|
3547
|
-
function wl(r, i) {
|
|
3548
|
-
r.prototype = Object.create(i.prototype), r.prototype.constructor = r, r.__proto__ = i;
|
|
3549
|
-
}
|
|
3550
|
-
function Oo(r, i) {
|
|
3551
|
-
if (r == null) return {};
|
|
3552
|
-
var o, t, n = {}, l = Object.keys(r);
|
|
3553
|
-
for (t = 0; t < l.length; t++) o = l[t], i.indexOf(o) >= 0 || (n[o] = r[o]);
|
|
3554
|
-
return n;
|
|
3555
|
-
}
|
|
3556
|
-
function Ya(r) {
|
|
3557
|
-
if (r === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3558
|
-
return r;
|
|
3559
|
-
}
|
|
3560
|
-
Qn.bind({ g: 1 }), Qn.bind({ k: 1 });
|
|
3561
|
-
var Za = function() {
|
|
3562
|
-
return "";
|
|
3563
|
-
}, Sl = le.createContext({ enqueueSnackbar: Za, closeSnackbar: Za }), Bn = "@media (max-width:599.95px)", on = "@media (min-width:600px)", Ja = function(r) {
|
|
3564
|
-
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
3565
|
-
}, yr = function(r) {
|
|
3566
|
-
return "" + Ja(r.vertical) + Ja(r.horizontal);
|
|
3567
|
-
}, Xo = function(r) {
|
|
3568
|
-
return !!r || r === 0;
|
|
3569
|
-
}, Ko = "unmounted", _t = "exited", Ut = "entering", bo = "entered", Qa = "exiting", wr = function(r) {
|
|
3570
|
-
function i(t) {
|
|
3571
|
-
var n;
|
|
3572
|
-
n = r.call(this, t) || this;
|
|
3573
|
-
var l, c = t.appear;
|
|
3574
|
-
return n.appearStatus = null, t.in ? c ? (l = _t, n.appearStatus = Ut) : l = bo : l = t.unmountOnExit || t.mountOnEnter ? Ko : _t, n.state = { status: l }, n.nextCallback = null, n;
|
|
3575
|
-
}
|
|
3576
|
-
wl(i, r), i.getDerivedStateFromProps = function(t, n) {
|
|
3577
|
-
return t.in && n.status === Ko ? { status: _t } : null;
|
|
3578
|
-
};
|
|
3579
|
-
var o = i.prototype;
|
|
3580
|
-
return o.componentDidMount = function() {
|
|
3581
|
-
this.updateStatus(!0, this.appearStatus);
|
|
3582
|
-
}, o.componentDidUpdate = function(t) {
|
|
3583
|
-
var n = null;
|
|
3584
|
-
if (t !== this.props) {
|
|
3585
|
-
var l = this.state.status;
|
|
3586
|
-
this.props.in ? l !== Ut && l !== bo && (n = Ut) : l !== Ut && l !== bo || (n = Qa);
|
|
3587
|
-
}
|
|
3588
|
-
this.updateStatus(!1, n);
|
|
3589
|
-
}, o.componentWillUnmount = function() {
|
|
3590
|
-
this.cancelNextCallback();
|
|
3591
|
-
}, o.getTimeouts = function() {
|
|
3592
|
-
var t = this.props.timeout, n = t, l = t;
|
|
3593
|
-
return t != null && typeof t != "number" && typeof t != "string" && (l = t.exit, n = t.enter), { exit: l, enter: n };
|
|
3594
|
-
}, o.updateStatus = function(t, n) {
|
|
3595
|
-
t === void 0 && (t = !1), n !== null ? (this.cancelNextCallback(), n === Ut ? this.performEnter(t) : this.performExit()) : this.props.unmountOnExit && this.state.status === _t && this.setState({ status: Ko });
|
|
3596
|
-
}, o.performEnter = function(t) {
|
|
3597
|
-
var n = this, l = this.props.enter, c = t, m = this.getTimeouts();
|
|
3598
|
-
t || l ? (this.props.onEnter && this.props.onEnter(this.node, c), this.safeSetState({ status: Ut }, function() {
|
|
3599
|
-
n.props.onEntering && n.props.onEntering(n.node, c), n.onTransitionEnd(m.enter, function() {
|
|
3600
|
-
n.safeSetState({ status: bo }, function() {
|
|
3601
|
-
n.props.onEntered && n.props.onEntered(n.node, c);
|
|
3602
|
-
});
|
|
3603
|
-
});
|
|
3604
|
-
})) : this.safeSetState({ status: bo }, function() {
|
|
3605
|
-
n.props.onEntered && n.props.onEntered(n.node, c);
|
|
3606
|
-
});
|
|
3607
|
-
}, o.performExit = function() {
|
|
3608
|
-
var t = this, n = this.props.exit, l = this.getTimeouts();
|
|
3609
|
-
n ? (this.props.onExit && this.props.onExit(this.node), this.safeSetState({ status: Qa }, function() {
|
|
3610
|
-
t.props.onExiting && t.props.onExiting(t.node), t.onTransitionEnd(l.exit, function() {
|
|
3611
|
-
t.safeSetState({ status: _t }, function() {
|
|
3612
|
-
t.props.onExited && t.props.onExited(t.node);
|
|
3613
|
-
});
|
|
3614
|
-
});
|
|
3615
|
-
})) : this.safeSetState({ status: _t }, function() {
|
|
3616
|
-
t.props.onExited && t.props.onExited(t.node);
|
|
3617
|
-
});
|
|
3618
|
-
}, o.cancelNextCallback = function() {
|
|
3619
|
-
this.nextCallback !== null && this.nextCallback.cancel && (this.nextCallback.cancel(), this.nextCallback = null);
|
|
3620
|
-
}, o.safeSetState = function(t, n) {
|
|
3621
|
-
n = this.setNextCallback(n), this.setState(t, n);
|
|
3622
|
-
}, o.setNextCallback = function(t) {
|
|
3623
|
-
var n = this, l = !0;
|
|
3624
|
-
return this.nextCallback = function() {
|
|
3625
|
-
l && (l = !1, n.nextCallback = null, t());
|
|
3626
|
-
}, this.nextCallback.cancel = function() {
|
|
3627
|
-
l = !1;
|
|
3628
|
-
}, this.nextCallback;
|
|
3629
|
-
}, o.onTransitionEnd = function(t, n) {
|
|
3630
|
-
this.setNextCallback(n);
|
|
3631
|
-
var l = t == null && !this.props.addEndListener;
|
|
3632
|
-
this.node && !l ? (this.props.addEndListener && this.props.addEndListener(this.node, this.nextCallback), t != null && setTimeout(this.nextCallback, t)) : setTimeout(this.nextCallback, 0);
|
|
3633
|
-
}, o.render = function() {
|
|
3634
|
-
var t = this.state.status;
|
|
3635
|
-
if (t === Ko) return null;
|
|
3636
|
-
var n = this.props;
|
|
3637
|
-
return (0, n.children)(t, Oo(n, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]));
|
|
3638
|
-
}, yl(i, [{ key: "node", get: function() {
|
|
3639
|
-
var t, n = (t = this.props.nodeRef) === null || t === void 0 ? void 0 : t.current;
|
|
3640
|
-
if (!n) throw new Error("notistack - Custom snackbar is not refForwarding");
|
|
3641
|
-
return n;
|
|
3642
|
-
} }]), i;
|
|
3643
|
-
}(le.Component);
|
|
3644
|
-
function qt() {
|
|
3645
|
-
}
|
|
3646
|
-
function ei(r, i) {
|
|
3647
|
-
typeof r == "function" ? r(i) : r && (r.current = i);
|
|
3648
|
-
}
|
|
3649
|
-
function er(r, i) {
|
|
3650
|
-
return W(function() {
|
|
3651
|
-
return r == null && i == null ? null : function(o) {
|
|
3652
|
-
ei(r, o), ei(i, o);
|
|
3653
|
-
};
|
|
3654
|
-
}, [r, i]);
|
|
3655
|
-
}
|
|
3656
|
-
function ln(r) {
|
|
3657
|
-
var i = r.timeout, o = r.style, t = o === void 0 ? {} : o, n = r.mode;
|
|
3658
|
-
return { duration: typeof i == "object" ? i[n] || 0 : i, easing: t.transitionTimingFunction, delay: t.transitionDelay };
|
|
3659
|
-
}
|
|
3660
|
-
wr.defaultProps = { in: !1, mountOnEnter: !1, unmountOnExit: !1, appear: !1, enter: !0, exit: !0, onEnter: qt, onEntering: qt, onEntered: qt, onExit: qt, onExiting: qt, onExited: qt };
|
|
3661
|
-
var Ou = "cubic-bezier(0.4, 0, 0.2, 1)", Au = "cubic-bezier(0.0, 0, 0.2, 1)", Bu = "cubic-bezier(0.4, 0, 0.6, 1)", vl = function(r) {
|
|
3662
|
-
r.scrollTop = r.scrollTop;
|
|
3663
|
-
}, ti = function(r) {
|
|
3664
|
-
return Math.round(r) + "ms";
|
|
3665
|
-
};
|
|
3666
|
-
function Zt(r, i) {
|
|
3667
|
-
r === void 0 && (r = ["all"]);
|
|
3668
|
-
var o = i || {}, t = o.duration, n = t === void 0 ? 300 : t, l = o.easing, c = l === void 0 ? Ou : l, m = o.delay, a = m === void 0 ? 0 : m;
|
|
3669
|
-
return (Array.isArray(r) ? r : [r]).map(function(s) {
|
|
3670
|
-
var u = typeof n == "string" ? n : ti(n), d = typeof a == "string" ? a : ti(a);
|
|
3671
|
-
return s + " " + u + " " + c + " " + d;
|
|
3672
|
-
}).join(",");
|
|
3673
|
-
}
|
|
3674
|
-
function Cl(r) {
|
|
3675
|
-
var i = function(o) {
|
|
3676
|
-
return o && o.ownerDocument || document;
|
|
3677
|
-
}(r);
|
|
3678
|
-
return i.defaultView || window;
|
|
3679
|
-
}
|
|
3680
|
-
function Yo(r, i) {
|
|
3681
|
-
if (i) {
|
|
3682
|
-
var o = function(t, n) {
|
|
3683
|
-
var l, c = n.getBoundingClientRect(), m = Cl(n);
|
|
3684
|
-
if (n.fakeTransform) l = n.fakeTransform;
|
|
3685
|
-
else {
|
|
3686
|
-
var a = m.getComputedStyle(n);
|
|
3687
|
-
l = a.getPropertyValue("-webkit-transform") || a.getPropertyValue("transform");
|
|
3688
|
-
}
|
|
3689
|
-
var s = 0, u = 0;
|
|
3690
|
-
if (l && l !== "none" && typeof l == "string") {
|
|
3691
|
-
var d = l.split("(")[1].split(")")[0].split(",");
|
|
3692
|
-
s = parseInt(d[4], 10), u = parseInt(d[5], 10);
|
|
3693
|
-
}
|
|
3694
|
-
switch (t) {
|
|
3695
|
-
case "left":
|
|
3696
|
-
return "translateX(" + (m.innerWidth + s - c.left) + "px)";
|
|
3697
|
-
case "right":
|
|
3698
|
-
return "translateX(-" + (c.left + c.width - s) + "px)";
|
|
3699
|
-
case "up":
|
|
3700
|
-
return "translateY(" + (m.innerHeight + u - c.top) + "px)";
|
|
3701
|
-
default:
|
|
3702
|
-
return "translateY(-" + (c.top + c.height - u) + "px)";
|
|
3703
|
-
}
|
|
3704
|
-
}(r, i);
|
|
3705
|
-
o && (i.style.webkitTransform = o, i.style.transform = o);
|
|
3706
|
-
}
|
|
3707
|
-
}
|
|
3708
|
-
var kl = J(function(r, i) {
|
|
3709
|
-
var o = r.children, t = r.direction, n = t === void 0 ? "down" : t, l = r.in, c = r.style, m = r.timeout, a = m === void 0 ? 0 : m, s = r.onEnter, u = r.onEntered, d = r.onExit, f = r.onExited, p = Oo(r, ["children", "direction", "in", "style", "timeout", "onEnter", "onEntered", "onExit", "onExited"]), g = Se(null), y = er(o.ref, g), b = er(y, i), x = q(function() {
|
|
3710
|
-
g.current && Yo(n, g.current);
|
|
3711
|
-
}, [n]);
|
|
3712
|
-
return me(function() {
|
|
3713
|
-
if (!l && n !== "down" && n !== "right") {
|
|
3714
|
-
var h = function(v, C) {
|
|
3715
|
-
var k;
|
|
3716
|
-
function T() {
|
|
3717
|
-
for (var M = this, I = arguments.length, A = new Array(I), R = 0; R < I; R++) A[R] = arguments[R];
|
|
3718
|
-
clearTimeout(k), k = setTimeout(function() {
|
|
3719
|
-
v.apply(M, A);
|
|
3720
|
-
}, C);
|
|
3721
|
-
}
|
|
3722
|
-
return C === void 0 && (C = 166), T.clear = function() {
|
|
3723
|
-
clearTimeout(k);
|
|
3724
|
-
}, T;
|
|
3725
|
-
}(function() {
|
|
3726
|
-
g.current && Yo(n, g.current);
|
|
3727
|
-
}), w = Cl(g.current);
|
|
3728
|
-
return w.addEventListener("resize", h), function() {
|
|
3729
|
-
h.clear(), w.removeEventListener("resize", h);
|
|
3730
|
-
};
|
|
3731
|
-
}
|
|
3732
|
-
}, [n, l]), me(function() {
|
|
3733
|
-
l || x();
|
|
3734
|
-
}, [l, x]), Pe(wr, Object.assign({ appear: !0, nodeRef: g, onEnter: function(h, w) {
|
|
3735
|
-
Yo(n, h), vl(h), s && s(h, w);
|
|
3736
|
-
}, onEntered: u, onEntering: function(h) {
|
|
3737
|
-
var w = c?.transitionTimingFunction || Au, v = ln({ timeout: a, mode: "enter", style: Ie({}, c, { transitionTimingFunction: w }) });
|
|
3738
|
-
h.style.webkitTransition = Zt("-webkit-transform", v), h.style.transition = Zt("transform", v), h.style.webkitTransform = "none", h.style.transform = "none";
|
|
3739
|
-
}, onExit: function(h) {
|
|
3740
|
-
var w = c?.transitionTimingFunction || Bu, v = ln({ timeout: a, mode: "exit", style: Ie({}, c, { transitionTimingFunction: w }) });
|
|
3741
|
-
h.style.webkitTransition = Zt("-webkit-transform", v), h.style.transition = Zt("transform", v), Yo(n, h), d && d(h);
|
|
3742
|
-
}, onExited: function(h) {
|
|
3743
|
-
h.style.webkitTransition = "", h.style.transition = "", f && f(h);
|
|
3744
|
-
}, in: l, timeout: a }, p), function(h, w) {
|
|
3745
|
-
return hs(o, Ie({ ref: b, style: Ie({ visibility: h !== "exited" || l ? void 0 : "hidden" }, c, {}, o.props.style) }, w));
|
|
3746
|
-
});
|
|
3747
|
-
});
|
|
3748
|
-
kl.displayName = "Slide";
|
|
3749
|
-
var hn = function(r) {
|
|
3750
|
-
return le.createElement("svg", Object.assign({ viewBox: "0 0 24 24", focusable: "false", style: { fontSize: 20, marginInlineEnd: 8, userSelect: "none", width: "1em", height: "1em", display: "inline-block", fill: "currentColor", flexShrink: 0 } }, r));
|
|
3751
|
-
}, Lu = function() {
|
|
3752
|
-
return le.createElement(hn, null, le.createElement("path", { d: `M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
3753
|
-
10.59L10 14.17L17.59 6.58L19 8L10 17Z` }));
|
|
3754
|
-
}, Hu = function() {
|
|
3755
|
-
return le.createElement(hn, null, le.createElement("path", { d: "M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z" }));
|
|
3756
|
-
}, zu = function() {
|
|
3757
|
-
return le.createElement(hn, null, le.createElement("path", { d: `M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
|
|
3758
|
-
6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
|
|
3759
|
-
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z` }));
|
|
3760
|
-
}, Wu = function() {
|
|
3761
|
-
return le.createElement(hn, null, le.createElement("path", { d: `M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
|
|
3762
|
-
0 22,12A10,10 0 0,0 12,2Z` }));
|
|
3763
|
-
}, It = { maxSnack: 3, persist: !1, hideIconVariant: !1, disableWindowBlurListener: !1, variant: "default", autoHideDuration: 5e3, iconVariant: { default: void 0, success: le.createElement(Lu, null), warning: le.createElement(Hu, null), error: le.createElement(zu, null), info: le.createElement(Wu, null) }, anchorOrigin: { vertical: "bottom", horizontal: "left" }, TransitionComponent: kl, transitionDuration: { enter: 225, exit: 195 } }, ju = function(r, i) {
|
|
3764
|
-
return function(o, t) {
|
|
3765
|
-
return t === void 0 && (t = !1), t ? Ie({}, It[o], {}, i[o], {}, r[o]) : o === "autoHideDuration" ? (n = r.autoHideDuration, l = i.autoHideDuration, (c = function(m) {
|
|
3766
|
-
return typeof m == "number" || m === null;
|
|
3767
|
-
})(n) ? n : c(l) ? l : It.autoHideDuration) : o === "transitionDuration" ? function(m, a) {
|
|
3768
|
-
var s = function(u, d) {
|
|
3769
|
-
return d.some(function(f) {
|
|
3770
|
-
return typeof u === f;
|
|
3771
|
-
});
|
|
3772
|
-
};
|
|
3773
|
-
return s(m, ["string", "number"]) ? m : s(m, ["object"]) ? Ie({}, It.transitionDuration, {}, s(a, ["object"]) && a, {}, m) : s(a, ["string", "number"]) ? a : s(a, ["object"]) ? Ie({}, It.transitionDuration, {}, a) : It.transitionDuration;
|
|
3774
|
-
}(r.transitionDuration, i.transitionDuration) : r[o] || i[o] || It[o];
|
|
3775
|
-
var n, l, c;
|
|
3776
|
-
};
|
|
3777
|
-
};
|
|
3778
|
-
function Ao(r) {
|
|
3779
|
-
return Object.entries(r).reduce(function(i, o) {
|
|
3780
|
-
var t, n = o[0], l = o[1];
|
|
3781
|
-
return Ie({}, i, ((t = {})[n] = Qn(l), t));
|
|
3782
|
-
}, {});
|
|
3783
|
-
}
|
|
3784
|
-
var Vu = "notistack-SnackbarContainer", $u = "notistack-Snackbar", Tl = "notistack-CollapseWrapper", _u = "notistack-MuiContent", Uu = function(r) {
|
|
3785
|
-
return "notistack-MuiContent-" + r;
|
|
3786
|
-
}, oi = Ao({ root: { height: 0 }, entered: { height: "auto" } }), Ln = "0px", El = J(function(r, i) {
|
|
3787
|
-
var o = r.children, t = r.in, n = r.onExited, l = Se(null), c = Se(null), m = er(i, c), a = function() {
|
|
3788
|
-
return l.current ? l.current.clientHeight : 0;
|
|
3789
|
-
};
|
|
3790
|
-
return Pe(wr, { in: t, unmountOnExit: !0, onEnter: function(s) {
|
|
3791
|
-
s.style.height = Ln;
|
|
3792
|
-
}, onEntered: function(s) {
|
|
3793
|
-
s.style.height = "auto";
|
|
3794
|
-
}, onEntering: function(s) {
|
|
3795
|
-
var u = a(), d = ln({ timeout: 175, mode: "enter" }), f = d.duration, p = d.easing;
|
|
3796
|
-
s.style.transitionDuration = typeof f == "string" ? f : f + "ms", s.style.height = u + "px", s.style.transitionTimingFunction = p || "";
|
|
3797
|
-
}, onExit: function(s) {
|
|
3798
|
-
s.style.height = a() + "px";
|
|
3799
|
-
}, onExited: n, onExiting: function(s) {
|
|
3800
|
-
vl(s);
|
|
3801
|
-
var u = ln({ timeout: 175, mode: "exit" }), d = u.duration, f = u.easing;
|
|
3802
|
-
s.style.transitionDuration = typeof d == "string" ? d : d + "ms", s.style.height = Ln, s.style.transitionTimingFunction = f || "";
|
|
3803
|
-
}, nodeRef: c, timeout: 175 }, function(s, u) {
|
|
3804
|
-
return Pe("div", Object.assign({ ref: m, className: Wt(oi.root, s === "entered" && oi.entered), style: Ie({ pointerEvents: "all", overflow: "hidden", minHeight: Ln, transition: Zt("height") }, s === "entered" && { overflow: "visible" }, {}, s === "exited" && !t && { visibility: "hidden" }) }, u), Pe("div", { ref: l, className: Tl, style: { display: "flex", width: "100%" } }, o));
|
|
3805
|
-
});
|
|
3806
|
-
});
|
|
3807
|
-
El.displayName = "Collapse";
|
|
3808
|
-
var ni = { right: "left", left: "right", bottom: "up", top: "down" }, qu = function(r) {
|
|
3809
|
-
return "anchorOrigin" + yr(r);
|
|
3810
|
-
}, Gu = function() {
|
|
3811
|
-
};
|
|
3812
|
-
function Do(r, i) {
|
|
3813
|
-
return r.reduce(function(o, t) {
|
|
3814
|
-
return t == null ? o : function() {
|
|
3815
|
-
for (var n = arguments.length, l = new Array(n), c = 0; c < n; c++) l[c] = arguments[c];
|
|
3816
|
-
var m = [].concat(l);
|
|
3817
|
-
i && m.indexOf(i) === -1 && m.push(i), o.apply(this, m), t.apply(this, m);
|
|
3818
|
-
};
|
|
3819
|
-
}, Gu);
|
|
3820
|
-
}
|
|
3821
|
-
var Xu = typeof window < "u" ? St : me;
|
|
3822
|
-
function ri(r) {
|
|
3823
|
-
var i = Se(r);
|
|
3824
|
-
return Xu(function() {
|
|
3825
|
-
i.current = r;
|
|
3826
|
-
}), q(function() {
|
|
3827
|
-
return i.current.apply(void 0, arguments);
|
|
3828
|
-
}, []);
|
|
3829
|
-
}
|
|
3830
|
-
var Hn, Dl = J(function(r, i) {
|
|
3831
|
-
var o = r.children, t = r.className, n = r.autoHideDuration, l = r.disableWindowBlurListener, c = l !== void 0 && l, m = r.onClose, a = r.id, s = r.open, u = r.SnackbarProps, d = u === void 0 ? {} : u, f = Se(), p = ri(function() {
|
|
3832
|
-
m && m.apply(void 0, arguments);
|
|
3833
|
-
}), g = ri(function(x) {
|
|
3834
|
-
m && x != null && (f.current && clearTimeout(f.current), f.current = setTimeout(function() {
|
|
3835
|
-
p(null, "timeout", a);
|
|
3836
|
-
}, x));
|
|
3837
|
-
});
|
|
3838
|
-
me(function() {
|
|
3839
|
-
return s && g(n), function() {
|
|
3840
|
-
f.current && clearTimeout(f.current);
|
|
3841
|
-
};
|
|
3842
|
-
}, [s, n, g]);
|
|
3843
|
-
var y = function() {
|
|
3844
|
-
f.current && clearTimeout(f.current);
|
|
3845
|
-
}, b = q(function() {
|
|
3846
|
-
n != null && g(0.5 * n);
|
|
3847
|
-
}, [n, g]);
|
|
3848
|
-
return me(function() {
|
|
3849
|
-
if (!c && s) return window.addEventListener("focus", b), window.addEventListener("blur", y), function() {
|
|
3850
|
-
window.removeEventListener("focus", b), window.removeEventListener("blur", y);
|
|
3851
|
-
};
|
|
3852
|
-
}, [c, b, s]), Pe("div", Object.assign({ ref: i }, d, { className: Wt($u, t), onMouseEnter: function(x) {
|
|
3853
|
-
d.onMouseEnter && d.onMouseEnter(x), y();
|
|
3854
|
-
}, onMouseLeave: function(x) {
|
|
3855
|
-
d.onMouseLeave && d.onMouseLeave(x), b();
|
|
3856
|
-
} }), o);
|
|
3857
|
-
});
|
|
3858
|
-
Dl.displayName = "Snackbar";
|
|
3859
|
-
var Ku = Ao({ root: (Hn = { display: "flex", flexWrap: "wrap", flexGrow: 1 }, Hn[on] = { flexGrow: "initial", minWidth: "288px" }, Hn) }), Sr = J(function(r, i) {
|
|
3860
|
-
var o = r.className, t = Oo(r, ["className"]);
|
|
3861
|
-
return le.createElement("div", Object.assign({ ref: i, className: Wt(Ku.root, o) }, t));
|
|
3862
|
-
});
|
|
3863
|
-
Sr.displayName = "SnackbarContent";
|
|
3864
|
-
var yo = Ao({ root: { backgroundColor: "#313131", fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em", color: "#fff", alignItems: "center", padding: "6px 16px", borderRadius: "4px", boxShadow: "0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)" }, lessPadding: { paddingLeft: "20px" }, default: { backgroundColor: "#313131" }, success: { backgroundColor: "#43a047" }, error: { backgroundColor: "#d32f2f" }, warning: { backgroundColor: "#ff9800" }, info: { backgroundColor: "#2196f3" }, message: { display: "flex", alignItems: "center", padding: "8px 0" }, action: { display: "flex", alignItems: "center", marginLeft: "auto", paddingLeft: "16px", marginRight: "-8px" } }), ai = "notistack-snackbar", Pl = J(function(r, i) {
|
|
3865
|
-
var o = r.id, t = r.message, n = r.action, l = r.iconVariant, c = r.variant, m = r.hideIconVariant, a = r.style, s = r.className, u = l[c], d = n;
|
|
3866
|
-
return typeof d == "function" && (d = d(o)), le.createElement(Sr, { ref: i, role: "alert", "aria-describedby": ai, style: a, className: Wt(_u, Uu(c), yo.root, yo[c], s, !m && u && yo.lessPadding) }, le.createElement("div", { id: ai, className: yo.message }, m ? null : u, t), d && le.createElement("div", { className: yo.action }, d));
|
|
3867
|
-
});
|
|
3868
|
-
Pl.displayName = "MaterialDesignContent";
|
|
3869
|
-
var wo, zn, Zo, Jo, Wn, Yu = K(Pl), Zu = Ao({ wrappedRoot: { width: "100%", position: "relative", transform: "translateX(0)", top: 0, right: 0, bottom: 0, left: 0, minWidth: "288px" } }), Ju = function(r) {
|
|
3870
|
-
var i = Se(), o = U(!0), t = o[0], n = o[1], l = Do([r.snack.onClose, r.onClose]), c = q(function() {
|
|
3871
|
-
i.current = setTimeout(function() {
|
|
3872
|
-
n(function(M) {
|
|
3873
|
-
return !M;
|
|
3874
|
-
});
|
|
3875
|
-
}, 125);
|
|
3876
|
-
}, []);
|
|
3877
|
-
me(function() {
|
|
3878
|
-
return function() {
|
|
3879
|
-
i.current && clearTimeout(i.current);
|
|
3880
|
-
};
|
|
3881
|
-
}, []);
|
|
3882
|
-
var m, a = r.snack, s = r.classes, u = r.Component, d = u === void 0 ? Yu : u, f = W(function() {
|
|
3883
|
-
return function(M) {
|
|
3884
|
-
M === void 0 && (M = {});
|
|
3885
|
-
var I = { containerRoot: !0, containerAnchorOriginTopCenter: !0, containerAnchorOriginBottomCenter: !0, containerAnchorOriginTopRight: !0, containerAnchorOriginBottomRight: !0, containerAnchorOriginTopLeft: !0, containerAnchorOriginBottomLeft: !0 };
|
|
3886
|
-
return Object.keys(M).filter(function(A) {
|
|
3887
|
-
return !I[A];
|
|
3888
|
-
}).reduce(function(A, R) {
|
|
3889
|
-
var S;
|
|
3890
|
-
return Ie({}, A, ((S = {})[R] = M[R], S));
|
|
3891
|
-
}, {});
|
|
3892
|
-
}(s);
|
|
3893
|
-
}, [s]), p = a.open, g = a.SnackbarProps, y = a.TransitionComponent, b = a.TransitionProps, x = a.transitionDuration, h = a.disableWindowBlurListener, w = a.content, v = Oo(a, ["open", "SnackbarProps", "TransitionComponent", "TransitionProps", "transitionDuration", "disableWindowBlurListener", "content", "entered", "requestClose", "onEnter", "onEntered", "onExit", "onExited"]), C = Ie({ direction: (m = v.anchorOrigin, m.horizontal !== "center" ? ni[m.horizontal] : ni[m.vertical]), timeout: x }, b), k = w;
|
|
3894
|
-
typeof k == "function" && (k = k(v.id, v.message));
|
|
3895
|
-
var T = ["onEnter", "onEntered", "onExit", "onExited"].reduce(function(M, I) {
|
|
3896
|
-
var A;
|
|
3897
|
-
return Ie({}, M, ((A = {})[I] = Do([r.snack[I], r[I]], v.id), A));
|
|
3898
|
-
}, {});
|
|
3899
|
-
return le.createElement(El, { in: t, onExited: T.onExited }, le.createElement(Dl, { open: p, id: v.id, disableWindowBlurListener: h, autoHideDuration: v.autoHideDuration, className: Wt(Zu.wrappedRoot, f.root, f[qu(v.anchorOrigin)]), SnackbarProps: g, onClose: l }, le.createElement(y, Object.assign({}, C, { appear: !0, in: p, onExit: T.onExit, onExited: c, onEnter: T.onEnter, onEntered: Do([T.onEntered, function() {
|
|
3900
|
-
r.snack.requestClose && l(null, "instructed", r.snack.id);
|
|
3901
|
-
}], v.id) }), k || le.createElement(d, Object.assign({}, v)))));
|
|
3902
|
-
}, So = { default: 20 }, Qo = { default: 6, dense: 2 }, ii = "." + Tl, en = Ao({ root: (wo = { boxSizing: "border-box", display: "flex", maxHeight: "100%", position: "fixed", zIndex: 1400, height: "auto", width: "auto", transition: Zt(["top", "right", "bottom", "left", "max-width"], { duration: 300, easing: "ease" }), pointerEvents: "none" }, wo[ii] = { padding: Qo.default + "px 0px", transition: "padding 300ms ease 0ms" }, wo.maxWidth = "calc(100% - " + 2 * So.default + "px)", wo[Bn] = { width: "100%", maxWidth: "calc(100% - 32px)" }, wo), rootDense: (zn = {}, zn[ii] = { padding: Qo.dense + "px 0px" }, zn), top: { top: So.default - Qo.default + "px", flexDirection: "column" }, bottom: { bottom: So.default - Qo.default + "px", flexDirection: "column-reverse" }, left: (Zo = { left: So.default + "px" }, Zo[on] = { alignItems: "flex-start" }, Zo[Bn] = { left: "16px" }, Zo), right: (Jo = { right: So.default + "px" }, Jo[on] = { alignItems: "flex-end" }, Jo[Bn] = { right: "16px" }, Jo), center: (Wn = { left: "50%", transform: "translateX(-50%)" }, Wn[on] = { alignItems: "center" }, Wn) }), Qu = K(function(r) {
|
|
3903
|
-
var i = r.classes, o = i === void 0 ? {} : i, t = r.anchorOrigin, n = r.dense, l = r.children, c = Wt(Vu, en[t.vertical], en[t.horizontal], en.root, o.containerRoot, o["containerAnchorOrigin" + yr(t)], n && en.rootDense);
|
|
3904
|
-
return le.createElement("div", { className: c }, l);
|
|
3905
|
-
}), li = function(r) {
|
|
3906
|
-
return !(typeof r == "string" || nr(r));
|
|
3907
|
-
}, em = function(r) {
|
|
3908
|
-
function i(o) {
|
|
3909
|
-
var t;
|
|
3910
|
-
return (t = r.call(this, o) || this).enqueueSnackbar = function(n, l) {
|
|
3911
|
-
if (l === void 0 && (l = {}), n == null) throw new Error("enqueueSnackbar called with invalid argument");
|
|
3912
|
-
var c = li(n) ? n : l, m = li(n) ? n.message : n, a = c.key, s = c.preventDuplicate, u = Oo(c, ["key", "preventDuplicate"]), d = Xo(a), f = d ? a : (/* @__PURE__ */ new Date()).getTime() + Math.random(), p = ju(u, t.props), g = Ie({ id: f }, u, { message: m, open: !0, entered: !1, requestClose: !1, persist: p("persist"), action: p("action"), content: p("content"), variant: p("variant"), anchorOrigin: p("anchorOrigin"), disableWindowBlurListener: p("disableWindowBlurListener"), autoHideDuration: p("autoHideDuration"), hideIconVariant: p("hideIconVariant"), TransitionComponent: p("TransitionComponent"), transitionDuration: p("transitionDuration"), TransitionProps: p("TransitionProps", !0), iconVariant: p("iconVariant", !0), style: p("style", !0), SnackbarProps: p("SnackbarProps", !0), className: Wt(t.props.className, u.className) });
|
|
3913
|
-
return g.persist && (g.autoHideDuration = void 0), t.setState(function(y) {
|
|
3914
|
-
if (s === void 0 && t.props.preventDuplicate || s) {
|
|
3915
|
-
var b = function(w) {
|
|
3916
|
-
return d ? w.id === f : w.message === m;
|
|
3917
|
-
}, x = y.queue.findIndex(b) > -1, h = y.snacks.findIndex(b) > -1;
|
|
3918
|
-
if (x || h) return y;
|
|
3919
|
-
}
|
|
3920
|
-
return t.handleDisplaySnack(Ie({}, y, { queue: [].concat(y.queue, [g]) }));
|
|
3921
|
-
}), f;
|
|
3922
|
-
}, t.handleDisplaySnack = function(n) {
|
|
3923
|
-
return n.snacks.length >= t.maxSnack ? t.handleDismissOldest(n) : t.processQueue(n);
|
|
3924
|
-
}, t.processQueue = function(n) {
|
|
3925
|
-
var l = n.queue, c = n.snacks;
|
|
3926
|
-
return l.length > 0 ? Ie({}, n, { snacks: [].concat(c, [l[0]]), queue: l.slice(1, l.length) }) : n;
|
|
3927
|
-
}, t.handleDismissOldest = function(n) {
|
|
3928
|
-
if (n.snacks.some(function(a) {
|
|
3929
|
-
return !a.open || a.requestClose;
|
|
3930
|
-
})) return n;
|
|
3931
|
-
var l = !1, c = !1;
|
|
3932
|
-
n.snacks.reduce(function(a, s) {
|
|
3933
|
-
return a + (s.open && s.persist ? 1 : 0);
|
|
3934
|
-
}, 0) === t.maxSnack && (c = !0);
|
|
3935
|
-
var m = n.snacks.map(function(a) {
|
|
3936
|
-
return l || a.persist && !c ? Ie({}, a) : (l = !0, a.entered ? (a.onClose && a.onClose(null, "maxsnack", a.id), t.props.onClose && t.props.onClose(null, "maxsnack", a.id), Ie({}, a, { open: !1 })) : Ie({}, a, { requestClose: !0 }));
|
|
3937
|
-
});
|
|
3938
|
-
return Ie({}, n, { snacks: m });
|
|
3939
|
-
}, t.handleEnteredSnack = function(n, l, c) {
|
|
3940
|
-
if (!Xo(c)) throw new Error("handleEnteredSnack Cannot be called with undefined key");
|
|
3941
|
-
t.setState(function(m) {
|
|
3942
|
-
return { snacks: m.snacks.map(function(a) {
|
|
3943
|
-
return a.id === c ? Ie({}, a, { entered: !0 }) : Ie({}, a);
|
|
3944
|
-
}) };
|
|
3945
|
-
});
|
|
3946
|
-
}, t.handleCloseSnack = function(n, l, c) {
|
|
3947
|
-
t.props.onClose && t.props.onClose(n, l, c);
|
|
3948
|
-
var m = c === void 0;
|
|
3949
|
-
t.setState(function(a) {
|
|
3950
|
-
var s = a.snacks, u = a.queue;
|
|
3951
|
-
return { snacks: s.map(function(d) {
|
|
3952
|
-
return m || d.id === c ? d.entered ? Ie({}, d, { open: !1 }) : Ie({}, d, { requestClose: !0 }) : Ie({}, d);
|
|
3953
|
-
}), queue: u.filter(function(d) {
|
|
3954
|
-
return d.id !== c;
|
|
3955
|
-
}) };
|
|
3956
|
-
});
|
|
3957
|
-
}, t.closeSnackbar = function(n) {
|
|
3958
|
-
var l = t.state.snacks.find(function(c) {
|
|
3959
|
-
return c.id === n;
|
|
3960
|
-
});
|
|
3961
|
-
Xo(n) && l && l.onClose && l.onClose(null, "instructed", n), t.handleCloseSnack(null, "instructed", n);
|
|
3962
|
-
}, t.handleExitedSnack = function(n, l) {
|
|
3963
|
-
if (!Xo(l)) throw new Error("handleExitedSnack Cannot be called with undefined key");
|
|
3964
|
-
t.setState(function(c) {
|
|
3965
|
-
var m = t.processQueue(Ie({}, c, { snacks: c.snacks.filter(function(a) {
|
|
3966
|
-
return a.id !== l;
|
|
3967
|
-
}) }));
|
|
3968
|
-
return m.queue.length === 0 ? m : t.handleDismissOldest(m);
|
|
3969
|
-
});
|
|
3970
|
-
}, t.enqueueSnackbar, t.closeSnackbar, t.state = { snacks: [], queue: [], contextValue: { enqueueSnackbar: t.enqueueSnackbar.bind(Ya(t)), closeSnackbar: t.closeSnackbar.bind(Ya(t)) } }, t;
|
|
3971
|
-
}
|
|
3972
|
-
return wl(i, r), i.prototype.render = function() {
|
|
3973
|
-
var o = this, t = this.state.contextValue, n = this.props, l = n.domRoot, c = n.children, m = n.dense, a = m !== void 0 && m, s = n.Components, u = s === void 0 ? {} : s, d = n.classes, f = this.state.snacks.reduce(function(g, y) {
|
|
3974
|
-
var b, x = yr(y.anchorOrigin), h = g[x] || [];
|
|
3975
|
-
return Ie({}, g, ((b = {})[x] = [].concat(h, [y]), b));
|
|
3976
|
-
}, {}), p = Object.keys(f).map(function(g) {
|
|
3977
|
-
var y = f[g], b = y[0];
|
|
3978
|
-
return le.createElement(Qu, { key: g, dense: a, anchorOrigin: b.anchorOrigin, classes: d }, y.map(function(x) {
|
|
3979
|
-
return le.createElement(Ju, { key: x.id, snack: x, classes: d, Component: u[x.variant], onClose: o.handleCloseSnack, onEnter: o.props.onEnter, onExit: o.props.onExit, onExited: Do([o.handleExitedSnack, o.props.onExited], x.id), onEntered: Do([o.handleEnteredSnack, o.props.onEntered], x.id) });
|
|
3980
|
-
}));
|
|
3981
|
-
});
|
|
3982
|
-
return le.createElement(Sl.Provider, { value: t }, c, l ? Yd(p, l) : p);
|
|
3983
|
-
}, yl(i, [{ key: "maxSnack", get: function() {
|
|
3984
|
-
return this.props.maxSnack || It.maxSnack;
|
|
3985
|
-
} }]), i;
|
|
3986
|
-
}(ci), Rl = function() {
|
|
3987
|
-
return gs(Sl);
|
|
3988
|
-
};
|
|
3989
|
-
const tm = [{ key: "SheetXL", description: "SheetXL", mimeType: ".sxl", exts: ["sxl"], handler: null, isDefault: !0 }, { key: "CSV", description: "Comma Delimited", mimeType: "text/csv", exts: ["csv"], handler: null }, { key: "Excel", description: "Excel Workbook", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", exts: ["xlsx", "xls", "xlsm"], handler: null }], om = [{ key: "SheetXL", mimeType: "application/vnd.sheetxl.sheet", description: "SheetXL", ext: "sxl", handler: null, isDefault: !0 }, { key: "CSV", mimeType: "text/csv", description: "Comma Delimited", ext: "csv", handler: null }, { key: "Excel", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", description: "Excel Workbook", ext: "xlsx", tags: ["SheetJS Pro"], handler: null }];
|
|
3990
|
-
class nm {
|
|
3991
|
-
constructor(i = tm, o = om) {
|
|
3992
|
-
this._readFormatType = [], this._writeFormatType = [], this._readFormatType = Object.freeze([...i]), this._writeFormatType = Object.freeze([...o]);
|
|
3993
|
-
}
|
|
3994
|
-
getReadFormats() {
|
|
3995
|
-
return this._readFormatType;
|
|
3996
|
-
}
|
|
3997
|
-
getWriteFormats() {
|
|
3998
|
-
return this._writeFormatType;
|
|
3999
|
-
}
|
|
4000
|
-
getAllReadFormatTypeAsString() {
|
|
4001
|
-
const i = [], o = this._readFormatType;
|
|
4002
|
-
for (let t = 0; t < o.length; t++) for (let n = 0; n < o[t].exts.length; n++) i.push("." + o[t].exts[n]);
|
|
4003
|
-
return i;
|
|
4004
|
-
}
|
|
4005
|
-
async writeFile(i, o, t) {
|
|
4006
|
-
if (!o || !i) throw new Error("Workbook model or file name must be provided.");
|
|
4007
|
-
try {
|
|
4008
|
-
return (await import("@sheetxl/io")).WorkbookIO.writeFile(i, o, t);
|
|
4009
|
-
} catch (n) {
|
|
4010
|
-
throw new Error("Unable to load io library", { cause: n });
|
|
4011
|
-
}
|
|
4012
|
-
}
|
|
4013
|
-
async read(i, o) {
|
|
4014
|
-
let t, n;
|
|
4015
|
-
const l = await o?.showBusy?.(`Opening${i.name ? ` ${i.name}` : ""}...`);
|
|
4016
|
-
try {
|
|
4017
|
-
n = await import("@sheetxl/io");
|
|
4018
|
-
} catch (c) {
|
|
4019
|
-
throw c;
|
|
4020
|
-
}
|
|
4021
|
-
try {
|
|
4022
|
-
return await n.WorkbookIO.read({ ...i, async onStart(c) {
|
|
4023
|
-
await i?.onStart?.(c), t = await o?.showBusy?.(`Opening '${c}'...`);
|
|
4024
|
-
} });
|
|
4025
|
-
} catch (c) {
|
|
4026
|
-
throw l?.(), t?.(), c;
|
|
4027
|
-
} finally {
|
|
4028
|
-
l?.(), t?.();
|
|
4029
|
-
}
|
|
4030
|
-
}
|
|
4031
|
-
}
|
|
4032
|
-
const Ot = new nm(), ut = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, Ml = J((r, i) => {
|
|
4033
|
-
const { id: o, message: t, iconVariant: n, error: l, hideIconVariant: c, ...m } = r, { closeSnackbar: a } = Rl(), s = at(), [u, d] = U(!1), f = q(() => {
|
|
4034
|
-
d((y) => !y);
|
|
4035
|
-
}, []), p = q(() => {
|
|
4036
|
-
a(o);
|
|
4037
|
-
}, [o, a]);
|
|
4038
|
-
let g = l?.message;
|
|
4039
|
-
return !g && nr(t) && (g = t), g || typeof t != "string" || (g = t), g || (g = `Unknown Error: ${t}`), e(Sr, { ref: i, className: Oe(ut.root, "error-snackbar"), children: j(ks, { className: ut.card, style: { backgroundColor: s.palette.error.dark, border: `1px solid ${s.palette.error.dark}` }, children: [j(Ts, { className: ut.actionRoot, children: [c ? null : n?.error, e(Be, { variant: "body2", component: "div", className: ut.typography, style: { color: s.palette.text.primary }, children: g }), e("div", { style: { flex: "1 1 auto" } }), j("div", { className: ut.icons, children: [l ? e(dt, { "aria-label": "Show more", size: "small", className: Oe(ut.expand, { [ut.expandOpen]: u }), style: { color: s.palette.action.active }, onClick: f, children: e(vi, {}) }) : null, e(dt, { size: "small", className: ut.expand, style: { color: s.palette.action.active }, onClick: p, children: e(ki, { fontSize: "small" }) })] })] }), l ? e(Es, { in: u, timeout: "auto", unmountOnExit: !0, children: e("div", { className: ut.stackTraceContainer, style: { backgroundColor: s.palette.error.light, borderTop: `1px solid ${s.palette.error.main}` }, children: e(ud, { error: l, hideLineNumbers: !0 }) }) }) : null] }) });
|
|
4040
|
-
});
|
|
4041
|
-
Ml.displayName = "ToastError";
|
|
4042
|
-
const Nl = K(J((r, i) => {
|
|
4043
|
-
const { commands: o, commandHook: t, scope: n = "workbook", disabled: l = !1, ...c } = r, m = ee((s) => {
|
|
4044
|
-
const u = { variant: ie.Menuitem, parentFloat: s.floatReference, commandHook: t, scope: n, disabled: l }, d = j(se, { children: [e(F, { ...u, command: o.getCommand("newWorkbook"), icon: P(e(md, {})) }), e(re, { orientation: "horizontal" }), e(F, { ...u, command: o.getCommand("openWorkbook"), icon: P(e(gd, {})) }), e(Re, { ...u, commands: o, quickCommand: "saveWorkbook", icon: P(e(xd, {})), createPopupPanel: (f) => {
|
|
4045
|
-
const p = { ...u, parentFloat: f.floatReference, scope: "saveWorkbook" }, g = [];
|
|
4046
|
-
return Ot.getWriteFormats().forEach((y) => {
|
|
4047
|
-
if (y.isDefault) return;
|
|
4048
|
-
let b = null;
|
|
4049
|
-
y.key === "CSV" ? b = P(e(hd, {})) : y.key === "Excel" && (b = P(e(fd, {})));
|
|
4050
|
-
const x = o.getCommand(`saveWorkbookAs${y.key}`);
|
|
4051
|
-
x ? g.push(Pe(F, { ...p, key: y.key, command: x, icon: b })) : console.warn(`Unable to resolve command: 'saveWorkbookAs${y.key}'`);
|
|
4052
|
-
}), ke({ ...f, children: g, onClick: () => {
|
|
4053
|
-
f.closeFloatAll();
|
|
4054
|
-
} });
|
|
4055
|
-
} })] });
|
|
4056
|
-
return ke({ ...s, children: d, onClick: (f) => {
|
|
4057
|
-
f.isDefaultPrevented || s.closeFloatAll();
|
|
4058
|
-
} });
|
|
4059
|
-
}, [l, o, t, n]), a = "File";
|
|
4060
|
-
return e(Re, { commands: o, disabled: l, commandHook: t, scope: n, label: a, tooltip: "Options for saving and loading the workbook.", sx: { paddingBottom: "0px", "& button": { paddingTop: "0px", paddingBottom: "0px", height: (s) => `calc(1.25rem + ${s.spacing(2)}px)` } }, ...c, createPopupPanel: m, icon: e(eo, { className: "label", icon: null, label: a }) });
|
|
4061
|
-
}));
|
|
4062
|
-
Nl.displayName = "StandaloneFileCommandButton";
|
|
4063
|
-
const rm = e(rt, { label: "SheetXL", description: "Visit me at sheetxl.com.", children: e(B, { sx: { width: "24px", height: "24px", marginBottom: "4px", marginLeft: "6px" }, children: e(Kd, { onClick: () => {
|
|
4064
|
-
window?.open("https://www.sheetxl.com", "_blank");
|
|
4065
|
-
}, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), Il = K(J((r, i) => {
|
|
4066
|
-
const { commands: o, workbook: t, logo: n = rm, mainElement: l, showFileMenu: c = !0, showAppearanceMenu: m = !0, ...a } = r, { reference: s } = oo(), [u, { width: d }] = No(), f = d < 530, p = c ? e(Nl, { commands: o, commandHook: { beforeExecute() {
|
|
4067
|
-
s?.closeAll();
|
|
4068
|
-
}, onError(x, h, w) {
|
|
4069
|
-
} } }) : null, g = m ? e(Lp, { commands: o, commandHook: { beforeExecute() {
|
|
4070
|
-
s?.closeAll();
|
|
4071
|
-
}, onError(x, h, w) {
|
|
4072
|
-
} } }) : null, y = W(() => ({ paddingLeft: (x) => x.spacing(1), paddingRight: (x) => x.spacing(1) }), []), b = Se(null);
|
|
4073
|
-
return e(B, { ref: Fo([b, u, i]), ...a, children: pl({ commands: o, renderCompact: f, workbook: t, selectWrapper: (x) => j(B, { sx: { display: "flex", flex: "1", flexDirection: "row", alignItems: "stretch", gap: (h) => h.spacing(1), paddingLeft: (h) => h.spacing(1), paddingRight: (h) => h.spacing(1) }, children: [j(B, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (h) => h.spacing(0.5) }, children: [n, j(B, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (h) => h.spacing(0.25) }, children: [p, x] })] }), e(B, { sx: { display: "flex", flexDirection: "row", flex: "1 1 300%", overflow: "hidden", alignItems: "center", justifyContent: "center" }, children: l }), e(B, { sx: { display: "flex", alignItems: "center", justifyContent: "end", flex: f && !g ? "0 0 auto" : "1 1 100%" }, children: g })] }), selectProps: y, toolbarsProps: { Home: { sx: {} } } }) });
|
|
4074
|
-
}));
|
|
4075
|
-
Il.displayName = "StudioToolbar";
|
|
4076
|
-
const Fl = K(J((r, i) => {
|
|
4077
|
-
const { workbook: o, setWorkbook: t, refWorkbookTitle: n, titleWorkbook: l, setWorkbookTitle: c, titlePlaceHolder: m, children: a, undoManager: s, commands: u, importExportDisabled: d, themeOptions: f } = r, p = Rl(), g = p ? p.enqueueSnackbar : () => {
|
|
4078
|
-
}, y = p ? p.closeSnackbar : () => {
|
|
4079
|
-
}, [b, x] = U({ isMounted: !1, label: null, starting: /* @__PURE__ */ new Map(), running: /* @__PURE__ */ new Map() }), h = q(() => {
|
|
4080
|
-
x(($) => ({ ...$, isMounted: !0 }));
|
|
4081
|
-
}, []), w = q(() => {
|
|
4082
|
-
x(($) => ({ ...$, isMounted: !1 }));
|
|
4083
|
-
}, []), v = {}, C = yd(v), k = wd(v), T = Sd(v), M = Se(/* @__PURE__ */ new Set()), I = W(() => {
|
|
4084
|
-
const $ = (D, E) => {
|
|
4085
|
-
if (E?.onceKey) {
|
|
4086
|
-
if (M.current.has(E.onceKey)) return;
|
|
4087
|
-
const Z = new Set(M.current);
|
|
4088
|
-
Z.add(E.onceKey), M.current = Z;
|
|
4089
|
-
}
|
|
4090
|
-
const Y = { variant: E?.type ?? wt.Info, anchorOrigin: { vertical: "top", horizontal: "center" }, preventDuplicate: E?.preventDuplicate, persist: E?.persist ?? E?.type === wt.Error, action: (Z) => e(dt, { onClick: () => y(Z), children: e(Ad, {}) }) };
|
|
4091
|
-
E?.enqueueProps && Object.assign(Y, E.enqueueProps), D || console.log("message is 'null'", E), g(D ?? "Alert", Y);
|
|
4092
|
-
};
|
|
4093
|
-
return { showMessage: $, showBusy: (D, E) => {
|
|
4094
|
-
let Y = null;
|
|
4095
|
-
const Z = new Promise((X) => {
|
|
4096
|
-
Y = X;
|
|
4097
|
-
});
|
|
4098
|
-
return x((X) => {
|
|
4099
|
-
const _ = new Map(X.starting);
|
|
4100
|
-
return _.set(Z, Y), { ...X, label: D, starting: _ };
|
|
4101
|
-
}), Z;
|
|
4102
|
-
}, showWindow: (D, E, Y) => {
|
|
4103
|
-
const Z = { ...E, onKeyDown: (X) => {
|
|
4104
|
-
u?.dispatchToFocusedCommand(X), X.isDefaultPrevented() || X.isPropagationStopped() || E?.onKeyDown?.(X);
|
|
4105
|
-
} };
|
|
4106
|
-
return C(D, { sort: () => import("./BezPorS4-_Cf52pp.mjs"), numberFormat: () => import("./1-hjYTXne52O8OX_.mjs"), hyperlink: () => import("./BMSwIfNeNw_icSmZ.mjs"), comments: () => import("./CmyX3-QWO3ckLyv3.mjs"), find: () => import("./DhXNvjm-1jhrLfp9.mjs"), tableDetails: () => import("./DnGxqCVe_CBDfW9k.mjs"), tableNew: () => import("./DrthDGd5PMQYMoAg.mjs"), namedDetails: () => import("./BM3rF0tr-rYuco_b.mjs") }[D], Z, Y);
|
|
4107
|
-
}, showOptions: k, showInputOptions: T, showError: (D) => {
|
|
4108
|
-
let E, Y = wt.Error, Z = "Unknown Error";
|
|
4109
|
-
typeof D == "string" ? Z = D : D instanceof Error && (E = D, D.message && (Z = D.message)), D instanceof Zd && (Y = wt.Info), $(Z, { type: Y, enqueueProps: { error: E } });
|
|
4110
|
-
} };
|
|
4111
|
-
}, []), A = q(() => {
|
|
4112
|
-
}, []), R = (($) => {
|
|
4113
|
-
const { workbook: D, setWorkbook: E, importExportDisabled: Y, workbookTitle: Z = "export", setWorkbookTitle: X, notifier: _, requestWorkbookTitle: ne, themeOptions: ae, undoManager: G, commands: z, onExecute: Q } = $, ue = ee(ae?.onModeChange, [ae?.onModeChange]), Le = ee(ae?.onEnabledDarkGridChange, [ae?.onEnabledDarkGridChange]), Fe = ee(ae?.onEnabledDarkImagesChange, [ae?.onEnabledDarkImagesChange]), Ae = ee(async (ge = null, fe = null) => {
|
|
4114
|
-
const te = [];
|
|
4115
|
-
let ce, Me = null, xe = null;
|
|
4116
|
-
if (typeof ge == "string" ? xe = ge : Me = ge, ce = Me ? ge : await Jt.openFileDialog(xe ?? Ot.getAllReadFormatTypeAsString().join(",")), !ce) return null;
|
|
4117
|
-
const Ge = { source: ce, createWorkbookOptions: fe, onWarning: (no) => {
|
|
4118
|
-
te.push(no);
|
|
4119
|
-
} }, et = await Ot.read(Ge, _);
|
|
4120
|
-
return te.length > 0 && (_?.showMessage?.("Some elements were not able to be imported. See console for details."), console.warn(`Import warnings:
|
|
4121
|
-
` + te.join(`
|
|
4122
|
-
`))), et;
|
|
4123
|
-
}, [Q, _, D]), Ye = ee(async (ge, fe, te) => {
|
|
4124
|
-
if (!fe && ne) {
|
|
4125
|
-
const ce = await ne("Enter Workbook name to " + (te.isDefault ? "Save." : `Export as ${te.description}.`));
|
|
4126
|
-
return ce !== null && Ot.writeFile(ce, ge, { formatType: te.key });
|
|
4127
|
-
}
|
|
4128
|
-
return Ot.writeFile(fe, ge, { formatType: te.key });
|
|
4129
|
-
}, [_, D, ne]), ve = q(() => ({ contains: (ge) => !0, focus() {
|
|
4130
|
-
} }), []), je = W(() => {
|
|
4131
|
-
const ge = [];
|
|
4132
|
-
Y || (Ot.getWriteFormats().forEach((te) => {
|
|
4133
|
-
const ce = te.isDefault, Me = { label: ce ? "Save Workbook" : `Save Workbook as ${te.description}`, scopedLabels: { workbook: "Save", saveWorkbook: `as ${te.description}` }, tags: te.tags, description: `Save the workbook to the desktop${ce ? "" : ` as ${te.description}`}.` };
|
|
4134
|
-
ce && (Me.shortcut = { key: "S", modifiers: [we.Ctrl] }, ge.push(new be("saveWorkbookAs", ve, { label: "Save Workbook As…", scopedLabels: { workbook: "Save as…", saveWorkbook: "as…" }, shortcut: [{ key: "S", modifiers: [we.Shift, we.Ctrl] }, { key: "F12" }], description: "Save the workbook to the desktop with the provided name." }, () => {
|
|
4135
|
-
Ye(D, null, te).catch((Ge) => {
|
|
4136
|
-
_?.showError?.(Ge);
|
|
4137
|
-
});
|
|
4138
|
-
})));
|
|
4139
|
-
const xe = ce ? "saveWorkbook" : `saveWorkbookAs${te.key}`;
|
|
4140
|
-
ge.push(new be(xe, ve, Me, (Ge) => {
|
|
4141
|
-
Ye(D, Ge ?? Z, te).catch((et) => {
|
|
4142
|
-
_?.showError?.(et);
|
|
4143
|
-
});
|
|
4144
|
-
}));
|
|
4145
|
-
}), ge.push(new be("openWorkbook", ve, { label: "Open Workbook…", scopedLabels: { workbook: "Open…" }, description: "Open a workbook from the desktop.", shortcut: { key: "O", modifiers: [we.Ctrl] } }, async (te = null) => {
|
|
4146
|
-
const ce = { date1904: D.isDate1904(), ...D.options };
|
|
4147
|
-
try {
|
|
4148
|
-
const Me = await Ae(te, ce);
|
|
4149
|
-
if (!Me) return;
|
|
4150
|
-
const xe = Me.title, Ge = Me.workbook, et = Ge.getSelectedSheet();
|
|
4151
|
-
if (Me.formatType.mimeType === "text/csv") {
|
|
4152
|
-
const no = D.findValidSheetName(xe);
|
|
4153
|
-
await D.doBatch(async () => {
|
|
4154
|
-
const fn = et.getUsedRange();
|
|
4155
|
-
if (!fn) return void _?.showMessage("The file appears to be blank.");
|
|
4156
|
-
await D.getSheets().add({ name: no, autoSelect: !0 }).getRange({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }).copyFrom(fn);
|
|
4157
|
-
}, `Import CSV '${xe}'`);
|
|
4158
|
-
} else D?.close(), X?.(xe), E(Ge);
|
|
4159
|
-
} catch (Me) {
|
|
4160
|
-
_?.showError?.(Me);
|
|
4161
|
-
}
|
|
4162
|
-
})), ge.push(new be("openWorkbookFromUrl", ve, { label: "Open Workbook From Web", scopedLabels: { insert: "From Web", workbook: "From Web…" }, description: "Open a workbook from the web." }, async function(te) {
|
|
4163
|
-
if (!te) {
|
|
4164
|
-
const ce = await _?.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"] });
|
|
4165
|
-
if (ce.option !== "Open") return;
|
|
4166
|
-
te = ce.input;
|
|
4167
|
-
}
|
|
4168
|
-
te && console.log("openWorkbookFromUrl", te);
|
|
4169
|
-
})));
|
|
4170
|
-
let fe = [];
|
|
4171
|
-
return ae && (fe = [new be("themeMode", ve, { label: "Light/Dark Mode", scopedLabels: { appearance: "Light/Dark Mode" }, description: "Toggle the application styling between light and dark mode." }), new be("defaultThemeMode", ve, { label: "Use System Light/Dark Mode", scopedLabels: { appearance: "Use System Default" }, description: "Use the system settings to determine styling for light and dark mode." }), new be("enableDarkGrid", ve, { label: "Enable Dark Grid", description: "Allow the grid to render in dark mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)." }), new be("enableDarkImages", ve, { 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." })]), [...ge, ...fe, new _e("help", ve, { label: "Show Help", description: "Provide Help.", shortcut: { key: "F1" } }, () => {
|
|
4172
|
-
}), new _e("showKeyboardShortcuts", ve, { label: "Keyboard Shortcuts", description: "Show keyboard shortcuts.", shortcut: { key: "/", modifiers: [we.Ctrl] } }, () => {
|
|
4173
|
-
}), new be("gotoUrlGithub", ve, { label: "Github", description: "Download examples, explore source code, and leave a star." }, () => {
|
|
4174
|
-
window?.open("https://github.com/sheetxl/sheetxl");
|
|
4175
|
-
}), new be("gotoUrlDiscord", ve, { label: "Discord", description: "Join our community on discord." }, () => {
|
|
4176
|
-
window?.open("https://discord.gg/NTKdwUgK9p");
|
|
4177
|
-
}), new be("gotoUrlDocumentation", ve, { label: "Documentation", description: "Read the documentation." }, () => {
|
|
4178
|
-
window?.open("https://www.sheetxl.com/docs");
|
|
4179
|
-
}), new be("gotoUrlIssue", ve, { label: "Create Issue", description: "Create an issue to identify a bug or a feature request." }, () => {
|
|
4180
|
-
window?.open("https://github.com/sheetxl/sheetxl/issues");
|
|
4181
|
-
})];
|
|
4182
|
-
}, [D, Z, _, Y, ae, z, G]), H = W(() => {
|
|
4183
|
-
let ge = null;
|
|
4184
|
-
return ge = z ? z.createChildGroup(ve, "standaloneWorkbook", !1) : new mr(ve, "standaloneWorkbook"), ge.addCommands(je, !0), ge;
|
|
4185
|
-
}, [z, je]);
|
|
4186
|
-
Hd({ manager: G, commands: H, notifier: _ });
|
|
4187
|
-
const { themeMode: oe } = Si();
|
|
4188
|
-
me(() => {
|
|
4189
|
-
if (!ae || !H) return;
|
|
4190
|
-
const ge = ae.mode === "dark" || !ae.mode && oe === "dark";
|
|
4191
|
-
H.getCommand("themeMode").update({ state: ae.mode ?? null, label: ge ? "Dark Mode" : "Light Mode", scopedLabels: { appearance: ge ? "Dark Mode" : "Light Mode" } }).updateCallback(() => {
|
|
4192
|
-
ue(ge ? qn.Light : qn.Dark);
|
|
4193
|
-
}), H.getCommand("defaultThemeMode").update({ state: !ae.mode }).updateCallback(() => {
|
|
4194
|
-
ue(null);
|
|
4195
|
-
}), H.getCommand("enableDarkGrid").update({ state: ae.enableDarkGrid }).updateCallback(() => {
|
|
4196
|
-
Le(!ae.enableDarkGrid);
|
|
4197
|
-
}), H.getCommand("enableDarkImages").update({ state: ae.enableDarkImages }).updateCallback(() => {
|
|
4198
|
-
Fe(!ae.enableDarkImages);
|
|
4199
|
-
});
|
|
4200
|
-
}, [oe, ae, je]);
|
|
4201
|
-
const { showModal: Te } = bd();
|
|
4202
|
-
return me(() => {
|
|
4203
|
-
const ge = () => new Promise((fe, te) => {
|
|
4204
|
-
const ce = le.lazy(() => import("./C79_LGbHVJJOQeTJ.mjs")), Me = Te(ce, { title: "Shortcut Keys Reference", commands: H, onDone: () => {
|
|
4205
|
-
Me.hide();
|
|
4206
|
-
}, TransitionProps: { onExited: () => {
|
|
4207
|
-
fe(!0);
|
|
4208
|
-
} } });
|
|
4209
|
-
});
|
|
4210
|
-
H.getCommand("showKeyboardShortcuts").updateCallback(() => ge()), H.getCommand("help").updateCallback(() => ge());
|
|
4211
|
-
}, [je, H]), H;
|
|
4212
|
-
})({ workbook: o, setWorkbook: t, importExportDisabled: d, workbookTitle: l, setWorkbookTitle: c, commands: u, requestWorkbookTitle: ($) => new Promise((D) => {
|
|
4213
|
-
n.current ? n.current.requestWorkbookTitle((E, Y) => {
|
|
4214
|
-
D(E);
|
|
4215
|
-
}, { selectAll: !0, requestReason: $ }) : D(m);
|
|
4216
|
-
}), themeOptions: f, undoManager: s, notifier: I, onExecute: A });
|
|
4217
|
-
me(() => {
|
|
4218
|
-
b.starting.size <= 0 || !b.isMounted || x(($) => {
|
|
4219
|
-
const D = new Map($.running);
|
|
4220
|
-
return $.starting.forEach((E, Y) => {
|
|
4221
|
-
const Z = () => {
|
|
4222
|
-
x((X) => {
|
|
4223
|
-
const _ = new Map(X.running);
|
|
4224
|
-
return _.delete(Y), { ...X, running: _ };
|
|
4225
|
-
});
|
|
4226
|
-
};
|
|
4227
|
-
D.set(Y, Z), E(Z);
|
|
4228
|
-
}), { ...$, starting: /* @__PURE__ */ new Map(), running: D };
|
|
4229
|
-
});
|
|
4230
|
-
}, [b]);
|
|
4231
|
-
const [S, N] = U(null);
|
|
4232
|
-
me(() => {
|
|
4233
|
-
b.starting.size !== 0 || b.running.size !== 0 ? N(e(Lt, { icon: e(vd, { sx: { transform: "scale(0.7)", marginLeft: "-6px" } }), panel: !0, label: b.label, onMount: h, onUnmount: w, sx: { position: "absolute", left: "0", top: "0", width: "100%", height: "100%", zIndex: "9999" } })) : N(null);
|
|
4234
|
-
}, [b.starting, b.running]);
|
|
4235
|
-
const L = W(() => e(Hp, { commands: R, disableHover: !0, sx: { padding: "0" }, buttonProps: { sx: { maxHeight: "22px" } } }), [R]), O = { notifier: I, commands: R };
|
|
4236
|
-
return o && (O.statusBarProps = { childrenEnd: L }), j(se, { children: [S, a ? le.cloneElement(a, O) : null] });
|
|
4237
|
-
}));
|
|
4238
|
-
Fl.displayName = "SnackbarAndCommandsWrapper";
|
|
4239
|
-
const tr = K(J((r, i) => {
|
|
4240
|
-
const { className: o, sx: t, style: n, onElementLoad: l, onError: c, undoManager: m, errorPanel: a = Cd, onKeyDown: s, workbook: u, createWorkbookOptions: d, onWorkbookChange: f, logo: p, importExportDisabled: g = !1, themeOptions: y, autoFocus: b = !1, commands: x, title: h, onTitleChange: w, titleProps: v, renderLoadingPanel: C, ...k } = r, T = Se(null), M = ee(f, [f]), I = ee(w ?? v?.onTitleChange, [w ?? v?.onTitleChange]), A = v?.placeHolder ?? "Untitled", R = y?.mode, { themeMode: S, source: N } = Si({ mode: R }), L = W(() => ({ ...y, light: sa(!1, Jt.deepMerge(y?.theme ?? {}, y?.light ?? {})), dark: sa(!0, Jt.deepMerge(y?.theme ?? {}, y?.dark ?? {})) }), [y]), O = S === qn.Dark, [$, D] = U(null);
|
|
4241
|
-
me(() => {
|
|
4242
|
-
D(m ?? new Jd());
|
|
4243
|
-
}, [m]);
|
|
4244
|
-
const [E, Y] = U(null), [Z, X] = U(null), _ = hr();
|
|
4245
|
-
St(() => {
|
|
4246
|
-
if (!u || Object.keys(u).length === 0 && !Jt.isPromiseLike(u)) {
|
|
4247
|
-
const te = { theme: _.getDefaultTheme(), ...d };
|
|
4248
|
-
X(new jn(te));
|
|
4249
|
-
} else X(u);
|
|
4250
|
-
}, [u]), St(() => {
|
|
4251
|
-
if (Z) {
|
|
4252
|
-
if (Z instanceof jn) return Y({ workbook: Z }), void (u !== Z && M?.(Z));
|
|
4253
|
-
(async () => {
|
|
4254
|
-
try {
|
|
4255
|
-
let te, ce = await Promise.resolve(Z);
|
|
4256
|
-
ce && ce.source && (ce = await Ot.read(ce)), ce.workbook ? (Q(ce.title), te = ce.workbook) : te = ce, M?.(te), Y({ workbook: te });
|
|
4257
|
-
} catch (te) {
|
|
4258
|
-
M?.(null), Y({ error: te });
|
|
4259
|
-
}
|
|
4260
|
-
})();
|
|
4261
|
-
}
|
|
4262
|
-
}, [Z]);
|
|
4263
|
-
const [ne, ae] = U(null);
|
|
4264
|
-
me(() => {
|
|
4265
|
-
if (!$ || !E) return;
|
|
4266
|
-
$.clear();
|
|
4267
|
-
const te = E?.workbook?.getTransactions();
|
|
4268
|
-
if (te)
|
|
4269
|
-
return te.addListener({ onCommitEnd: (ce) => {
|
|
4270
|
-
ce.getDescription() ? $.addUndoOperation({ description: ce.getDescription(), undo: () => (te.revert(ce.getId()), ne.source?.focus(), () => {
|
|
4271
|
-
te.restore(ce.getId()), ne.source?.focus();
|
|
4272
|
-
}) }) : console.warn("commit has no description", ce);
|
|
4273
|
-
} });
|
|
4274
|
-
}, [$, E, ne]);
|
|
4275
|
-
const G = ee((te) => {
|
|
4276
|
-
te ? $.setRepeatableOperation({ description: te.label(), repeat: async () => te.execute() }) : $.setRepeatableOperation(null);
|
|
4277
|
-
}, [$]), [z, Q] = U(h ?? v?.title ?? "");
|
|
4278
|
-
me(() => {
|
|
4279
|
-
Q(h ?? v?.title ?? "");
|
|
4280
|
-
}, [h ?? v?.title]), me(() => {
|
|
4281
|
-
I?.(z);
|
|
4282
|
-
}, [z]);
|
|
4283
|
-
const [ue, Le] = U(null), Fe = W(() => {
|
|
4284
|
-
const te = () => ({ contains: (ce) => !0, focus() {
|
|
4285
|
-
} });
|
|
4286
|
-
return x ? x.createChildGroup(te, "application", !1) : new mr(te, "application");
|
|
4287
|
-
}, [x]), Ae = ee((te) => {
|
|
4288
|
-
Le(te.source.getViewportElement()), ae(te), Fe.activate("sheet"), l?.(te);
|
|
4289
|
-
}, [Fe]);
|
|
4290
|
-
me(() => {
|
|
4291
|
-
ne && b && ne.source?.focus(typeof b == "object" ? b : void 0);
|
|
4292
|
-
}, [ne]);
|
|
4293
|
-
const Ye = Se(null), ve = q((te) => {
|
|
4294
|
-
let ce = null;
|
|
4295
|
-
return v?.hidden || (ce = e(fl, { ...v, style: { maxWidth: "100%", ...v?.style }, workbook: T.current, ref: Ye, title: z, placeHolder: A, onTitleChange: (Me) => {
|
|
4296
|
-
Q(Me);
|
|
4297
|
-
} })), e(Il, { ...te, logo: p, mainElement: ce, showFileMenu: !g, showAppearanceMenu: !!(L?.onEnabledDarkGridChange || L?.onEnabledDarkImagesChange || L?.onModeChange) });
|
|
4298
|
-
}, [p, z, v, L, g, Fe]);
|
|
4299
|
-
me(() => {
|
|
4300
|
-
const te = (ce) => ce.preventDefault();
|
|
4301
|
-
return T.current?.addEventListener("wheel", te, { passive: !1 }), () => {
|
|
4302
|
-
T.current?.removeEventListener("wheel", te);
|
|
4303
|
-
};
|
|
4304
|
-
}, []);
|
|
4305
|
-
const je = W(() => {
|
|
4306
|
-
const te = { transparentBackground: !0 };
|
|
4307
|
-
return e(B, { sx: t, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, display: "flex", alignItems: "center", justifyContent: "center", ...n }, children: C?.(te) ?? e(Lt, { ...te }) });
|
|
4308
|
-
}, [t, n, C]), H = q(({ error: te }) => (c?.(te), e(a, { sx: t, style: n, error: te ?? "Unable to display empty workbook." })), [t, n, c]), oe = W(() => ({ ...t, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-MuiContent *": { fontFamily: (te) => te.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [t]), Te = Fo([T, i]), ge = W(() => {
|
|
4309
|
-
if (!E) return je;
|
|
4310
|
-
if (E.error || !E.workbook) return H({ error: E.error });
|
|
4311
|
-
let te = null, ce = null, Me = !1;
|
|
4312
|
-
return L && (te = O ? L.dark : L.light, ce = O && L.enableDarkGrid ? L.dark : L.light, Me = L.enableDarkImages), e(hl, { sx: oe, style: n, tabIndex: 0, autoFocus: !0, workbook: E.workbook, ref: Te, renderToolbar: ve, onElementLoad: Ae, onRepeatCommandChange: G, onKeyDown: (xe) => {
|
|
4313
|
-
s?.(xe);
|
|
4314
|
-
}, renderLoadingPanel: C, gridTheme: ce, headersTheme: te, enableDarkImages: Me, className: Oe(o, "sheetxl-workbook"), onContextMenu: (xe) => xe.preventDefault(), ...k }, "WorkbookElement");
|
|
4315
|
-
}, [E, z, $, je, C, L, k, ve, oe]);
|
|
4316
|
-
let fe = e(Pu, { fallbackRender: H, children: e(em, { maxSnack: 3, domRoot: ue, anchorOrigin: { vertical: "bottom", horizontal: "right" }, autoHideDuration: 3500, onClose: (te, ce, Me) => {
|
|
4317
|
-
T.current?.focus();
|
|
4318
|
-
}, Components: { error: Ml }, iconVariant: { success: e(ar, { style: { marginRight: "8px" }, children: e("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: e(Td, { style: { marginRight: "8px" } }) }, children: e(kd, { children: e(Fl, { workbook: E?.workbook, setWorkbook: X, importExportDisabled: g, titlePlaceHolder: A, titleWorkbook: z, setWorkbookTitle: Q, refWorkbookTitle: Ye, commands: Fe, undoManager: $, themeOptions: L, children: ge }) }) }) });
|
|
4319
|
-
return L && (fe = j(Ti, { theme: O ? L.dark : L.light, children: [L.cssBaseline ? e(Ds, {}) : null, fe] })), fe;
|
|
4320
|
-
}));
|
|
4321
|
-
tr.displayName = "EagerStudio";
|
|
4322
|
-
const am = Object.freeze(Object.defineProperty({ __proto__: null, EagerStudio: tr, default: tr }, Symbol.toStringTag, { value: "Module" }));
|
|
4323
|
-
export {
|
|
4324
|
-
cp as $,
|
|
4325
|
-
Bp as A,
|
|
4326
|
-
mp as B,
|
|
4327
|
-
ip as C,
|
|
4328
|
-
Mi as D,
|
|
4329
|
-
Lp as E,
|
|
4330
|
-
hp as F,
|
|
4331
|
-
Hp as G,
|
|
4332
|
-
Qd as H,
|
|
4333
|
-
Ri as I,
|
|
4334
|
-
Li as J,
|
|
4335
|
-
xr as K,
|
|
4336
|
-
up as L,
|
|
4337
|
-
gp as M,
|
|
4338
|
-
zp as N,
|
|
4339
|
-
ha as O,
|
|
4340
|
-
Oi as P,
|
|
4341
|
-
vm as Q,
|
|
4342
|
-
Wp as R,
|
|
4343
|
-
Eu as S,
|
|
4344
|
-
Sm as T,
|
|
4345
|
-
Ii as U,
|
|
4346
|
-
ep as V,
|
|
4347
|
-
Tp as W,
|
|
4348
|
-
pp as X,
|
|
4349
|
-
np as Y,
|
|
4350
|
-
Eo as Z,
|
|
4351
|
-
Yn as _,
|
|
4352
|
-
Rp as a,
|
|
4353
|
-
fr as a0,
|
|
4354
|
-
Di as a1,
|
|
4355
|
-
Fp as a2,
|
|
4356
|
-
Op as a3,
|
|
4357
|
-
Ap as a4,
|
|
4358
|
-
ji as a5,
|
|
4359
|
-
Wi as a6,
|
|
4360
|
-
Xi as a7,
|
|
4361
|
-
Gi as a8,
|
|
4362
|
-
Ki as a9,
|
|
4363
|
-
Kp as aa,
|
|
4364
|
-
Mp as ab,
|
|
4365
|
-
Yi as ac,
|
|
4366
|
-
Zi as ad,
|
|
4367
|
-
Ji as ae,
|
|
4368
|
-
km as af,
|
|
4369
|
-
hl as ag,
|
|
4370
|
-
fl as ah,
|
|
4371
|
-
ml as ai,
|
|
4372
|
-
ul as aj,
|
|
4373
|
-
cu as ak,
|
|
4374
|
-
du as al,
|
|
4375
|
-
ja as am,
|
|
4376
|
-
tr as an,
|
|
4377
|
-
nm as ao,
|
|
4378
|
-
Ot as ap,
|
|
4379
|
-
cl as aq,
|
|
4380
|
-
dl as ar,
|
|
4381
|
-
eu as as,
|
|
4382
|
-
ll as at,
|
|
4383
|
-
Wt as b,
|
|
4384
|
-
Co as c,
|
|
4385
|
-
Kn as d,
|
|
4386
|
-
tl as e,
|
|
4387
|
-
Oe as f,
|
|
4388
|
-
Cm as g,
|
|
4389
|
-
tp as h,
|
|
4390
|
-
op as i,
|
|
4391
|
-
fp as j,
|
|
4392
|
-
xp as k,
|
|
4393
|
-
bp as l,
|
|
4394
|
-
Pi as m,
|
|
4395
|
-
yp as n,
|
|
4396
|
-
wp as o,
|
|
4397
|
-
Ni as p,
|
|
4398
|
-
wm as q,
|
|
4399
|
-
mn as r,
|
|
4400
|
-
Mo as s,
|
|
4401
|
-
Sp as t,
|
|
4402
|
-
No as u,
|
|
4403
|
-
vp as v,
|
|
4404
|
-
Cp as w,
|
|
4405
|
-
kp as x,
|
|
4406
|
-
Dp as y,
|
|
4407
|
-
Ip as z
|
|
4408
|
-
};
|