@sheetxl/studio-mui 0.4.20 → 0.4.21
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/B1KlR2XYFpYbKjYS.cjs +20 -0
- package/browser/cjs/{DItuuqkIamMzp7Im.cjs → B1RMsexbz4bNlty_.cjs} +1 -1
- package/browser/cjs/B32faQpVaX1tkPuc.cjs +6 -0
- package/browser/cjs/B3XiHrRxW1LxML7F.cjs +6 -0
- package/browser/cjs/BGikYpeNpjwvXUdQ.cjs +18 -0
- package/browser/cjs/BY5l7DteiFtb2AKy.cjs +6 -0
- package/browser/cjs/Bb0Hd2RE7iVWVbm8.cjs +6 -0
- package/browser/cjs/C3EZkRIKfQURg9hX.cjs +6 -0
- package/browser/cjs/C7r573AdygYrVVEJ.cjs +7 -0
- package/browser/cjs/DEEknE8ARp0mc7fk.cjs +6 -0
- package/browser/cjs/DZwzUUHda3jr5jo4.cjs +6 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/veQZSq7ekc6G1FZT.cjs +42 -0
- package/browser/esm/B84RbTkXZiq6XIdH.mjs +49 -0
- package/browser/esm/{C5xUbwpUPDeNua-i.mjs → BLy-hRTZkVfaGrcr.mjs} +1 -1
- package/browser/esm/Bapmv0WdnDq3Jl_q.mjs +53 -0
- package/browser/esm/C0OuiugFYjsjbY8q.mjs +46 -0
- package/browser/esm/{5u-JEG1IfQBstjq0.mjs → CGVN-NJF8ZTm9apo.mjs} +11 -10
- package/browser/esm/CcLpUDzJOdfqQ8Kf.mjs +25 -0
- package/browser/esm/Csg-hJrzm9r4vJrm.mjs +2156 -0
- package/browser/esm/{C60ZnLCvtztDLuoT.mjs → DHf2N2UY78nZFge3.mjs} +100 -98
- package/browser/esm/Dlc8L0qha0mZFIkY.mjs +62 -0
- package/browser/esm/{BW3_mz5_8i9VLBYB.mjs → Dv-0R5pQwEnowzoO.mjs} +87 -85
- package/browser/esm/index.mjs +29 -29
- package/browser/esm/mVKwmIdSj4ua1Qce.mjs +4443 -0
- package/browser/esm/{CxXpPYi4eOFhBNt2.mjs → sHK4zKkWLGt2hVmW.mjs} +27 -26
- package/licenses/dependencies.txt +71 -342
- package/node/esm/{CrDbLKJh9omVo_TF.mjs → 49Eux5a_I5wZ-jfq.mjs} +29 -28
- package/node/esm/{Bn5TJPQAEMY-lGpF.mjs → B00pGeZ7sj6QOFgF.mjs} +4 -3
- package/node/esm/{D6A_o47zvz5ITIJK.mjs → BEtxwx_Ji4aFNg8V.mjs} +79 -78
- package/node/esm/{Ds5dinNcyNdC8ta6.mjs → BTcBIT144Lil18l-.mjs} +13 -11
- package/node/esm/{Bv12-Yyv0C86Iquy.mjs → Bw_f4uhXHpg1RA6Z.mjs} +7 -6
- package/node/esm/CGrG-gsnGd-Pn_T2.mjs +88 -0
- package/node/esm/CiUfb3MQCUC2McDP.mjs +46 -0
- package/node/esm/D1bjybdBQ28bumrW.mjs +63 -0
- package/node/esm/{CH6p2H0CMCoz4NgJ.mjs → Dcnd4LiYyGf2eaNl.mjs} +23 -22
- package/node/esm/{rlqvGCJlj4a2UcSM.mjs → DiLUM75s3D56Y6Fx.mjs} +11 -10
- package/node/esm/index.mjs +2381 -18514
- package/package.json +8 -8
- package/browser/cjs/-Z37a-mzY5SKXy--.cjs +0 -6
- package/browser/cjs/B384kb1_rsiCsdZG.cjs +0 -6
- package/browser/cjs/B8nWvy4zDv1CZsr_.cjs +0 -110
- package/browser/cjs/BBnMJiXp9lru0Rcq.cjs +0 -6
- package/browser/cjs/BFbHTu65n1oE-l0N.cjs +0 -6
- package/browser/cjs/BQMSHnQdWtqeakER.cjs +0 -6
- package/browser/cjs/BvjA0ybox6653eb5.cjs +0 -6
- package/browser/cjs/Cocgl4ghzWE9yVYS.cjs +0 -161
- package/browser/cjs/D21Q1NdM1zQ7uFlH.cjs +0 -6
- package/browser/cjs/D4LmaKqYiwjxp0Hs.cjs +0 -15
- package/browser/cjs/D6egUillMqBwTaEq.cjs +0 -6
- package/browser/cjs/D9lY6pd9tRxPeLKs.cjs +0 -18
- package/browser/cjs/DNqIYSqRYZkUpFxW.cjs +0 -7
- package/browser/cjs/DUImSlPsM-OipgBZ.cjs +0 -6
- package/browser/cjs/DUVLcBcwkTsuLb6q.cjs +0 -6
- package/browser/cjs/Db7IyKXFzo8IocDa.cjs +0 -145
- package/browser/cjs/DsHPj69dMFG09uD_.cjs +0 -16
- package/browser/cjs/DypblOPNMRx5Twgx.cjs +0 -12
- package/browser/cjs/QK7YNBstmN86K-xL.cjs +0 -6
- package/browser/cjs/VNWvn2kP6ZF0Snzw.cjs +0 -11
- package/browser/cjs/dc1YAArM3bSHvRcF.cjs +0 -7
- package/browser/cjs/mInXvB8P6r6q7pRY.cjs +0 -11
- package/browser/cjs/nop6N-Oi_LKy1Bpc.cjs +0 -42
- package/browser/cjs/s45oNHeIvJVeRjn5.cjs +0 -6
- package/browser/esm/1y10o01h14oGJtKG.mjs +0 -43
- package/browser/esm/BFpc8KBa-fb0nLSt.mjs +0 -46
- package/browser/esm/Bmjhrc6YMmfx_1Yi.mjs +0 -1703
- package/browser/esm/BnlJVFlQeWerd3KW.mjs +0 -3803
- package/browser/esm/BpuH_QvBidPOXgAR.mjs +0 -392
- package/browser/esm/CAiWSkkPRgUjk8CN.mjs +0 -424
- package/browser/esm/CW8taieVozHhyBOC.mjs +0 -1467
- package/browser/esm/CzyEerZmfWrW3i3U.mjs +0 -59
- package/browser/esm/D0FBHwm0Oz_wf0tR.mjs +0 -12
- package/browser/esm/DM9GPrZpbCcKOnyU.mjs +0 -1352
- package/browser/esm/DO1doKZhwYiL7vbF.mjs +0 -1672
- package/browser/esm/DS3anstzAV3EJBRw.mjs +0 -84
- package/browser/esm/DuEmdSQsXlkCWZIB.mjs +0 -1366
- package/browser/esm/FvK-pQsicRjtrKoS.mjs +0 -48
- package/browser/esm/KCTJzQeDChqf1yBO.mjs +0 -52
- package/browser/esm/P-3pIbidOtRCNsw3.mjs +0 -23
- package/browser/esm/W3EFMOPLR1aNXWvF.mjs +0 -2250
- package/browser/esm/Z_Sh-N3xHHWLCbEw.mjs +0 -23412
- package/browser/esm/mOmzoYDWAtgYndCA.mjs +0 -13391
- package/browser/esm/tnJECoiQzUzgUQZE.mjs +0 -44
- package/node/esm/54SjtcD6mOreKcCy.mjs +0 -1719
- package/node/esm/B2BlMiDOVpIp1FDQ.mjs +0 -1706
- package/node/esm/BNEvR1srnnwBgnrF.mjs +0 -1479
- package/node/esm/BZ20_F64yjZgn-_G.mjs +0 -1246
- package/node/esm/BfzRLuswtxg9uDsX.mjs +0 -78
- package/node/esm/C0ZBbkFa-24tJTnw.mjs +0 -60
- package/node/esm/CEVO60fX3MAPG0Hg.mjs +0 -1378
- package/node/esm/CdFmhVFplZFgBvTo.mjs +0 -44
- package/node/esm/Cx4mn0YEVkG-M1VL.mjs +0 -553
- package/node/esm/DDWek3aquTe_okr_.mjs +0 -392
- package/node/esm/DSLWcwr4qgHARs36.mjs +0 -13464
- package/node/esm/iXG86MN0JrtJkpqe.mjs +0 -44
- package/node/esm/m2teXjBzZLfLDFPx.mjs +0 -46
- package/node/esm/oykDy4erHC0NNHHq.mjs +0 -3776
- package/node/esm/sVOd1y3oNBREsKJ7.mjs +0 -86
|
@@ -0,0 +1,4443 @@
|
|
|
1
|
+
import { Color as gt, IColor as Br, ITheme as ss, CommonUtils as Ze, IBorder as ve, IFont as Bt, NumberFormat as mt, IFontCollection as cs, IStyle as ue, ITextFrame as ds, Table as tr, IFill as Cn, CoordUtils as ps, ISheet as Rt, LicenseManager as So, Workbook as Wn, TypesUtils as us } from "@sheetxl/sdk";
|
|
2
|
+
import { jsx as e, jsxs as j, Fragment as ce } from "react/jsx-runtime";
|
|
3
|
+
import le, { memo as Y, forwardRef as J, useMemo as W, useCallback as q, isValidElement as or, useState as _, useEffect as he, Suspense as si, useRef as Se, createElement as Ee, useReducer as nr, useImperativeHandle as ms, version as hs, useLayoutEffect as St, Component as ci, createContext as gs, useContext as fs, cloneElement as xs } from "react";
|
|
4
|
+
import { Box as B, Typography as Be, IconButton as ct, MenuItem as di, Divider as io, Button as nn, SvgIcon as rr, Input as ar, FormControlLabel as Et, Checkbox as Dt, useMediaQuery as bs, FormControl as ir, TextField as pi, InputAdornment as ys, Slider as ws, Paper as Do, CircularProgress as Ss, DialogTitle as vs, Select as Cs, Tabs as ks, Tab as Ts, Card as Es, CardActions as Ds, Collapse as Ps, CssBaseline as Rs } from "@mui/material";
|
|
5
|
+
import { themeIcon as D, CommandButton as O, ExhibitDivider as re, FormatIndentDecreaseIcon as Ms, FormatIndentIncreaseIcon as Ns, defaultCreatePopupPanel as Ce, CommandPopupButton as De, TextVerticalTopIcon as Fs, TextVerticalCenterIcon as Is, TextVerticalBottomIcon as Lr, TextHorizontalOverflowIcon as Hr, TextHorizontalWrapIcon as Os, TextHorizontalClipIcon as As, TextHorizontalShrinkIcon as Bs, TextRotation315Icon as zo, TextRotation45Icon as zr, TextRotation90Icon as Wr, TextRotation2702Icon as jr, TextRotationCustomIcon as Vr, TextRotation0Icon as Ls, InputCommandButton as Hs, SimpleTooltip as At, LoadingPanel as Lt, PopupButtonType as ot, ExhibitPopupIconButton as vt, ExhibitPopupMenuItem as lr, ColorizedCircleIcon as zs, ExhibitMenuItem as xt, createStrokeShadowFilter as $r, strokeShadowFilter as Ws, ColorizedStrokeIcon as sr, ExhibitTooltip as nt, ExhibitIconButton as ft, CommandTooltip as cr, MergeAllIcon as _r, MergeHorizontalIcon as js, MergeVerticalIcon as Vs, MergeUnMergeIcon as ui, FreezeBothIcon as $s, FreezeRowsIcon as _s, FreezeColumnsIcon as Us, FreezeIcon as qs, FindIcon as Ur, FindReplaceIcon as Gs, GotoIcon as Xs, TextSizeIncreaseIcon as Ks, TextSizeDecreaseIcon as Ys, SelectedIcon as sn, CurrencyDollarIcon as Zs, PercentIcon as Js, CommaIcon as Qs, IncreaseDecimalIcon2 as ec, DecreaseDecimalIcon2 as tc, ClearAllIcon as qr, ClearFormatsIcon as mi, ClearContentsIcon as oc, FillDownIcon as lo, InsertCells as Gr, InsertRowIcon as nc, InsertColumn2Icon as Xr, BlankIcon as rn, RemoveCellsIcon as Kr, RemoveRowIcon as rc, RemoveColumn2Icon as Yr, LabelIcon as eo, SortIncreaseIcon as jn, SortDecreaseIcon as hi, SortCustomIcon as ac, FilterToggleIcon as Vn, FilterClearIcon as dr, FilterReapplyIcon as gi, RedoIcon as ic, UndoIcon as lc, TextStrikeIcon as Zr, TextSuperscriptIcon as sc, TextSubscriptIcon as cc, TextUnderlineIcon as kn, TextUnderlineDoubleIcon as Jr, TextUnderlineAccountingIcon as Qr, TextUnderlineAccountingDoubleIcon as ea, PasteIcon as ta, PasteValuesIcon as dc, PasteFormatsIcon as pc, PasteFormulasIcon as uc, PasteTransposeIcon as mc, PasteLinksIcon as hc, NewPresetStylesIcon as gc, PresetStylesIcon as Po, ExhibitMenuHeader as to, ContextMenu as fi, Theme2Icon as xi, SystemDefaultDarkMode as fc, SystemDefaultLightMode as xc, GithubIcon as bc, DiscordIcon as yc, DocumentationIcon as bi, TicketIcon as wc, HelpIcon as Sc, InsertImageIcon as Wo, WalkingCopyIcon as vc, SimpleCommandPopupButton as st, FunctionThinIcon as Cc, FunctionSumIcon as kc, ExhibitOptionButton as Tc, SelectRangeModeIcon as Ec, hexToRGB as oa, useFloatStack as oo, CellSelectionIcon as Dc, CellSelectionRemoveIcon as Pc, CellSelectionEditIcon as Rc, InsertTableIcon as an, CellSelectionInsertIcon as Mc, CloseErrorIcon as Nc, CheckSuccessIcon as Fc, FunctionIcon as Ic, VisibilityOffIcon as yi, elevateColor as at, ThemedIcon as Oc, ScriptNewIcon as Ac, ScriptFormulaIcon as wi, ScriptMacroIcon as pr, ScriptSaveIcon as Bc, CommandToolbar as cn, CodeIcon as Lc, ScriptRunIcon as Hc, ColorizedTextIcon as zc, ColorizedFillIcon as Wc, FormatPaintIcon as jc, TextBoldIcon as Vc, TextItalicIcon as $c, InsertHyperlinkIcon as $n, InsertCommentIcon as _n, FullScreenOffIcon as _c, FullScreenIcon as Uc, createScrollEdgeButton as qc, createScrollEndButton as Gc, createScrollStartButton as Xc, HideColumnIcon as Kc, ShowColumnIcon as Yc, HideRowIcon as Zc, ShowRowIcon as Jc, ColumnsResizeAutoIcon as Qc, RowsResizeAutoIcon as ed, CutIcon as td, DrawAspectIcon as na, DrawAlignLeftIcon as ra, DrawResizeIcon as aa, DrawAlignDistributeVertIcon as od, DrawAlignDistributeHorzIcon as nd, DrawAlignBottomIcon as rd, DrawAlignMiddleIcon as ad, DrawAlignTopIcon as id, DrawAlignRightIcon as ld, DrawAlignCenterIcon as sd, DrawMoveBackwardIcon as cd, DrawToBackIcon as dd, DrawMoveForwardIcon as pd, DrawToFrontIcon as ud, scrollbarTheming as md, StackTrace as hd, FileNewIcon as gd, FileOpenIcon as fd, FileDownloadAsCSVIcon as xd, FileDownloadAsExcelIcon as bd, FileDownloadAsSheetIcon as yd, useModal as wd, useLazyWindow as Sd, useOptionsDialog as vd, useInputDialog as Cd, AnimatedTraversingEllipsisIcon as kd, ErrorPanel as Td, createExhibitTheme as ia, ModalProvider as Ed, ErrorAlertIcon as Dd } from "@sheetxl/utils-mui";
|
|
6
|
+
import { FormatAlignLeft as la, FormatAlignCenter as sa, FormatAlignRight as Pd, FormatAlignJustify as ko, Colorize as Rd, DarkMode as ca, LightMode as da, Keyboard as Md, Remove as Nd, Add as Fd, ExpandLess as Id, ExpandMore as Si, Lock as dn, MoreHoriz as Od, WebhookOutlined as vi, Close as Ci, AddCircleOutline as Ad, Menu as Bd, CancelOutlined as Ld } from "@mui/icons-material";
|
|
7
|
+
import { useCommands as Ve, CommandButtonType as ie, useCallbackRef as te, ReactUtils as pn, KeyCodes as we, useCommand as Ht, useEditMode as un, useMouseDownAndHoldListener as pa, NotificationType as wt, useImperativeElement as zt, SplitPane as Un, RoundedTab as Hd, SimpleCommand as Ue, Command as ye, KeyModifiers as be, CommandGroup as ur, ToolTipPlacement as so, ScrollPane as zd, useUndoManager as Wd } from "@sheetxl/utils-react";
|
|
8
|
+
import { useTheme as rt, alpha as fe, getOverlayAlpha as Te, ThemeProvider as ki } from "@mui/material/styles";
|
|
9
|
+
import { StyledStrokePath as jd, StaticBorderRenderer as mr, FontUtils as Vd, useModelListener as qe, createCellEditStateFromCell as $d, SheetCellEditor as _d, ScriptEditor as Ud, TabStrip as qd, useDocThemes as hr, SheetScrollbar as ua, PictureEditor as Gd, ChartEditor as Xd, SheetElement as Kd, EmptyFrame as Yd, LogoNoPaddingIcon as Zd } from "@sheetxl/react";
|
|
10
|
+
import { alpha as Qe } from "@mui/system";
|
|
11
|
+
import Kt, { createPortal as Jd } from "react-dom";
|
|
12
|
+
import { CommonUtils as Jt, ChainedError as qn, PartialError as Qd, UndoManager as ep } 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.4.21
|
|
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 Ti(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 = Ti(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 = Ti(r)) && (t && (t += " "), t += i);
|
|
31
|
+
return t;
|
|
32
|
+
}
|
|
33
|
+
const tp = Y(J((r, i) => {
|
|
34
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, parentFloat: c, ...m } = r, a = Ve(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", D(e(la, {}))), p.set("formatAlignCenterToggle", D(e(sa, {}))), p.set("formatAlignRightToggle", D(e(Pd, {}))), p.set("formatAlignJustifyToggle", D(e(ko, {}))), p.set("formatAlignCenterContinuousToggle", D(e(sa, {}))), p.set("formatAlignFillToggle", D(e(ko, {}))), p.set("formatAlignDistributedHorizontalToggle", D(e(ko, {}))), p;
|
|
40
|
+
}, []), d = W(() => {
|
|
41
|
+
if (!t) return null;
|
|
42
|
+
const p = { ...t };
|
|
43
|
+
return delete p.beforeExecute, p;
|
|
44
|
+
}, [t]), f = q((p, h) => {
|
|
45
|
+
const y = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, x = j(ce, { children: [e(O, { ...y, command: h.getCommand("formatAlignLeftToggle"), icon: u.get("formatAlignLeftToggle") }), e(O, { ...y, command: h.getCommand("formatAlignCenterToggle"), icon: u.get("formatAlignCenterToggle") }), e(O, { ...y, command: h.getCommand("formatAlignRightToggle"), icon: u.get("formatAlignRightToggle") }), e(O, { ...y, command: h.getCommand("formatAlignJustifyToggle"), icon: u.get("formatAlignJustifyToggle") }), e(re, { orientation: "horizontal" }), e(O, { ...y, command: h.getCommand("formatAlignCenterContinuousToggle"), icon: u.get("formatAlignCenterContinuousToggle") }), e(O, { ...y, command: h.getCommand("formatAlignFillToggle"), icon: u.get("formatAlignFillToggle") }), e(O, { ...y, command: h.getCommand("formatAlignDistributedHorizontalToggle"), icon: u.get("formatAlignDistributedHorizontalToggle") })] }), b = j(B, { sx: { className: Oe("quick-buttons"), display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (w) => w.stopPropagation(), children: [e(O, { command: h.getCommand("formatIndentDecrease"), commandHook: d, scope: n, disabled: l, icon: D(e(Ms, {})) }), e(O, { command: h.getCommand("formatIndentIncrease"), commandHook: d, scope: n, disabled: l, icon: D(e(Ns, {})) })] }), g = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...m, children: [b, e(re, { orientation: "horizontal" }), e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: x })] });
|
|
46
|
+
return Ce({ ...p, children: g });
|
|
47
|
+
}, [l, t]);
|
|
48
|
+
return e(De, { 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(la, {}), ...m });
|
|
49
|
+
})), op = Y(J((r, i) => {
|
|
50
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = Ve(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", D(e(Fs, {}))), d.set("formatAlignMiddleToggle", D(e(Is, {}))), d.set("formatAlignBottomToggle", D(e(Lr, {}))), d.set("formatAlignJustifyVerticalToggle", D(e(ko, {}))), d.set("formatAlignDistributedVerticalToggle", D(e(ko, {}))), d;
|
|
56
|
+
}, []), u = q((d, f) => {
|
|
57
|
+
const p = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, h = j(ce, { children: [e(O, { ...p, command: f.getCommand("formatAlignTopToggle"), icon: s.get("formatAlignTopToggle") }), e(O, { ...p, command: f.getCommand("formatAlignMiddleToggle"), icon: s.get("formatAlignMiddleToggle") }), e(O, { ...p, command: f.getCommand("formatAlignBottomToggle"), icon: s.get("formatAlignBottomToggle") }), e(re, { orientation: "horizontal" }), e(O, { ...p, command: f.getCommand("formatAlignJustifyVerticalToggle"), icon: s.get("formatAlignJustifyVerticalToggle") }), e(O, { ...p, command: f.getCommand("formatAlignDistributedVerticalToggle"), icon: s.get("formatAlignDistributedVerticalToggle") })] });
|
|
58
|
+
return Ce({ ...d, children: h });
|
|
59
|
+
}, [l, t, s]);
|
|
60
|
+
return e(De, { 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) ?? D(e(Lr, {})), ...c });
|
|
61
|
+
})), np = Y(J((r, i) => {
|
|
62
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = Ve(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", D(e(Hr, {}))), d.set("formatTextOverflowWrapToggle", D(e(Os, {}))), d.set("formatTextOverflowClipToggle", D(e(As, {}))), d.set("formatTextOverflowShrinkToggle", D(e(Bs, {}))), d;
|
|
68
|
+
}, []), u = te((d, f) => {
|
|
69
|
+
const p = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, h = j(ce, { children: [e(O, { ...p, command: f.getCommand("formatTextOverflowVisibleToggle"), icon: s.get("formatTextOverflowVisibleToggle") }), e(O, { ...p, command: f.getCommand("formatTextOverflowWrapToggle"), icon: s.get("formatTextOverflowWrapToggle") }), e(O, { ...p, command: f.getCommand("formatTextOverflowClipToggle"), icon: s.get("formatTextOverflowClipToggle") }), e(re, { orientation: "horizontal" }), e(O, { ...p, command: f.getCommand("formatTextOverflowShrinkToggle"), icon: s.get("formatTextOverflowShrinkToggle") })] });
|
|
70
|
+
return Ce({ ...d, children: h });
|
|
71
|
+
}, [l, t, n]);
|
|
72
|
+
return e(De, { 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) ?? D(e(Hr, {})), ...c });
|
|
73
|
+
})), rp = Y(J((r, i) => {
|
|
74
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = Ve(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 h = m[p];
|
|
78
|
+
if (h?.state()) return h.key();
|
|
79
|
+
}
|
|
80
|
+
return m[1]?.key();
|
|
81
|
+
}, [m]), s = W(() => {
|
|
82
|
+
const f = /* @__PURE__ */ new Map();
|
|
83
|
+
return f.set("formatTextRotate0", D(e(zo, {}))), f.set("formatTextRotate315", D(e(zo, {}))), f.set("formatTextRotate45", D(e(zr, {}))), f.set("formatTextRotate90", D(e(Wr, {}))), f.set("formatTextRotate270", D(e(jr, {}))), f.set("formatTextRotateCustom", D(e(Vr, {}))), f;
|
|
84
|
+
}, []), u = q((f, p) => {
|
|
85
|
+
const h = { variant: ie.Menuitem, commandHook: t, scope: n, disabled: l }, y = j(ce, { children: [e(O, { ...h, command: p.getCommand("formatTextRotate0"), icon: D(e(Ls, {})) }), e(re, { orientation: "horizontal" }), e(O, { ...h, command: p.getCommand("formatTextRotate315"), icon: D(e(zo, {})) }), e(O, { ...h, command: p.getCommand("formatTextRotate45"), icon: D(e(zr, {})) }), e(O, { ...h, command: p.getCommand("formatTextRotate90"), icon: D(e(Wr, {})) }), e(O, { ...h, command: p.getCommand("formatTextRotate270"), icon: D(e(jr, {})) }), e(re, { orientation: "horizontal" }), e(Hs, { ...h, command: p.getCommand("formatTextRotateCustom"), icon: D(e(Vr, {})), label: "Custom" })] });
|
|
86
|
+
return Ce({ ...f, children: y });
|
|
87
|
+
}, [l, t, n, o]), d = W(() => (o.getCommand("formatTextRotateCustom")?.state() ?? 0) !== 0, [m]);
|
|
88
|
+
return e(De, { 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: D(s.get(a) ?? e(zo, {})), ...c });
|
|
89
|
+
})), ap = { Preset: "preset", Custom: "custom" }, To = { Start: "start", End: "end" }, Tn = {}, ip = (r, i, o, t) => {
|
|
90
|
+
const n = r + "-" + i + "-" + o + (t ? "-server" : "");
|
|
91
|
+
if (Tn[n]) return Tn[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 Tn[n] = l, l;
|
|
100
|
+
}, lp = {}, sp = Y((r) => {
|
|
101
|
+
const { className: i, style: o = pn.EmptyCssProperties, white: t = "transparent", grey: n = "grey", size: l = 8, borderRadius: c, boxShadow: m, renderers: a = lp, 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(${ip(t, n, l, a?.canvas)}) center left` }, o), [t, n, l, a]);
|
|
102
|
+
return or(s) ? le.cloneElement(s, { ...d.props }) : e("div", { style: f, ...u });
|
|
103
|
+
}), cp = Y((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: h = 7, ...y } = r;
|
|
105
|
+
if (!i) throw new Error("a selectedColor is required");
|
|
106
|
+
const x = q((k) => {
|
|
107
|
+
n?.(k), k.isDefaultPrevented() || (k.ctrlKey ? t?.(i.toRGBA()) : o?.(i.toRGBA()));
|
|
108
|
+
}, [o, t, n, i]), b = q((k) => {
|
|
109
|
+
c?.(k), k.isDefaultPrevented() || t?.(i.toRGBA());
|
|
110
|
+
}, [t, c, i]), g = 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 === we.Enter && o?.(i.toRGBA());
|
|
116
|
+
}, [o, l, i]), C = W(() => i.toRGBA().alpha === 1 ? null : e(sp, { size: h, 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: x, onKeyDown: v, onMouseOver: b, onMouseLeave: g, onFocus: w, children: [C, e("div", { style: { position: "absolute", top: "0px", left: "0px", height: "100%", width: "100%", background: i.toCSS(p) }, children: u })] });
|
|
118
|
+
}), gr = Y((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 gt({ val: n.definition.val, adjs: n.definition.adjs }, (C) => i(C)), h = u ? p.toRGBA().toString() : p.toString(), y = o && (u ? o.toRGBA().toString() : o.toString()) === h, x = t && (u ? t.toRGBA().toString() : t.toString()) === h, b = [];
|
|
120
|
+
b.push({ [Br.AdjustmentType.Inv]: !0 }), b.push({ [Br.AdjustmentType.Alpha]: 100 });
|
|
121
|
+
const g = p.adjust(b), 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(cp, { 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: g.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: g.toRGBA(d).toString(), borderRadius: "50%", opacity: x ? "1" : "0" } })] }) }) });
|
|
127
|
+
}), jo = Y((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 g = 0; g < t.length; g++) p.push([t[g]]);
|
|
134
|
+
}
|
|
135
|
+
const h = q((g) => {
|
|
136
|
+
c?.(g);
|
|
137
|
+
}, [c]), y = q((g) => {
|
|
138
|
+
m?.(g);
|
|
139
|
+
}, [m]), x = W(() => {
|
|
140
|
+
let g = [];
|
|
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(gr, { schemeColorLookup: o, colorDef: M, selectedColor: n, previewColor: l, onSelectColorDef: h, 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
|
+
g.push(k);
|
|
149
|
+
}
|
|
150
|
+
return g;
|
|
151
|
+
}, [p, n, l, h, y]), b = W(() => i ? e(Be, { noWrap: !0, component: "div", sx: { display: "flex", flexShrink: "0", paddingLeft: "6px", paddingBottom: "4px", paddingTop: "0px", userSelect: "none", color: (g) => g.palette.text.secondary }, children: i }) : null, [i]);
|
|
152
|
+
return j(B, { style: { ...a }, children: [b, e(B, { sx: { display: "flex", flexDirection: "row", gap: "6px", marginBottom: "14px", flexWrap: "wrap", justifyContent: "flex-start" }, ...f, children: x })] });
|
|
153
|
+
}), tt = (r, i) => ({ description: r, definition: { val: i, adjs: [] } }), We = (r, i, o, t, n, l) => {
|
|
154
|
+
const c = tt(r, i);
|
|
155
|
+
t?.push(c);
|
|
156
|
+
const m = new gt({ 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
|
+
}, dp = le.lazy(() => import("./Dv-0R5pQwEnowzoO.mjs")), pp = Y(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: h, onPreviewColor: y, onPreviewColorImmediate: x, onSelectColor: b, autoColor: g, autoColorLabel: w = "Automatic", autoColorPosition: v = To.Start, compareRGB: C = !1, darkMode: k = !1, ...T } = r, M = t || o, I = te(y, [y]), A = te(x, [x]), P = te(b, [b]), S = te(p, [p]), N = te(h, [h]), [L, F] = _(!1), z = rt(), R = W(() => l || gt.getDefaultSchemeLookup(), [l]), E = W(() => {
|
|
162
|
+
const H = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map(), ae = [];
|
|
163
|
+
We("Primary Background", "bg1", R, ae, H, oe), We("Primary Text", "tx1", R, ae, H, oe), We("Secondary Background", "bg2", R, ae, H, oe), We("Secondary Text", "tx2", R, ae, H, oe), We("Accent 1", "accent1", R, ae, H, oe), We("Accent 2", "accent2", R, ae, H, oe), We("Accent 3", "accent3", R, ae, H, oe), We("Accent 4", "accent4", R, ae, H, oe), We("Accent 5", "accent5", R, ae, H, oe), We("Accent 6", "accent6", R, ae, H, oe);
|
|
164
|
+
const Ae = ss.buildPalette(ae, R, H, oe), se = [];
|
|
165
|
+
if (We("Dark Red", "C00000", R, se, H, oe), We("Red", "FF0000", R, se, H, oe), We("Orange", "FFC000", R, se, H, oe), We("Yellow", "FFFF00", R, se, H, oe), We("Light Green", "92D050", R, se, H, oe), We("Green", "00B050", R, se, H, oe), We("Light Blue", "00B0F0", R, se, H, oe), We("Blue", "0070C0", R, se, H, oe), We("Dark Blue", "002060", R, se, H, oe), c ? We("Purple Is A Fruit", "7030A0", R, se, H, oe) : We("Transparent", "00000000", R, se, H, oe), g) {
|
|
166
|
+
const xe = g.toString();
|
|
167
|
+
H.set(xe, g);
|
|
168
|
+
}
|
|
169
|
+
const ne = /* @__PURE__ */ new Map(), pe = typeof n == "function" ? n() : n, ze = [];
|
|
170
|
+
for (let xe = 0; pe && xe < pe.length; xe++) {
|
|
171
|
+
const Ye = pe[xe].toString();
|
|
172
|
+
ne.set(Ye, pe[xe]), ze.push({ description: "Recent " + (xe + 1), definition: { val: pe[xe].toString() } });
|
|
173
|
+
}
|
|
174
|
+
return { primaryColors: ae, modifiedPresets: Ae, standardColors: se, recentColorsLimited: ze, mapAllPresets: H, mapAllPresetsRGB: oe, mapRecent: ne };
|
|
175
|
+
}, [R, n, c, g]);
|
|
176
|
+
he(() => {
|
|
177
|
+
d?.();
|
|
178
|
+
}, []);
|
|
179
|
+
const [K, ee] = _(!1), X = q(() => {
|
|
180
|
+
ee((H) => !H);
|
|
181
|
+
}, []);
|
|
182
|
+
he(() => {
|
|
183
|
+
if (a) ee(a === ap.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 ae = E.mapRecent.get(H);
|
|
188
|
+
ee(!oe && !ae);
|
|
189
|
+
}
|
|
190
|
+
}, [o, a]);
|
|
191
|
+
const G = q(Ze.debounce((H) => {
|
|
192
|
+
I?.(H);
|
|
193
|
+
}, m), [I, m]), [Z, ge] = _();
|
|
194
|
+
he(() => {
|
|
195
|
+
ge(t || o);
|
|
196
|
+
}, [t, o]);
|
|
197
|
+
const U = te((H) => {
|
|
198
|
+
A && (A(H), G(H));
|
|
199
|
+
}, [A]), V = te((H) => {
|
|
200
|
+
U(H ? new gt({ val: H.definition.val, adjs: H.definition.adjs }, R) : null);
|
|
201
|
+
}, [R]), Q = q((H) => {
|
|
202
|
+
H.ctrlKey && ee(!0);
|
|
203
|
+
}, []), me = te((H) => {
|
|
204
|
+
let oe = !1;
|
|
205
|
+
if (H) {
|
|
206
|
+
const ae = H.toString();
|
|
207
|
+
oe = !E.mapAllPresets.has(ae);
|
|
208
|
+
}
|
|
209
|
+
P?.(H, oe);
|
|
210
|
+
}, [P, E]), Le = te((H) => {
|
|
211
|
+
const oe = H ? new gt({ val: H.definition.val, adjs: H.definition.adjs }, R) : null;
|
|
212
|
+
Promise.resolve(f?.()).then(() => {
|
|
213
|
+
me(oe);
|
|
214
|
+
});
|
|
215
|
+
}, [R, f]), Fe = te((H) => {
|
|
216
|
+
U(H ? new gt(H, R) : null);
|
|
217
|
+
}, [R]), Ie = W(() => window.EyeDropper === void 0 ? e(ce, {}) : e(ct, { "aria-label": "eye dropper", size: "small", sx: { color: (H) => H.palette.text.icon ?? H.palette.action.active }, onClick: async () => {
|
|
218
|
+
F(!0), S?.(), await new EyeDropper().open().then((H) => {
|
|
219
|
+
F(!1), N?.();
|
|
220
|
+
let oe = new gt(H.sRGBHex), ae = oe.toString(), Ae = E.mapAllPresets.get(ae);
|
|
221
|
+
if (Ae || (ae = oe.toRGBA().toString(), Ae = E.mapAllPresetsRGB.get(ae)), !Ae) {
|
|
222
|
+
const se = oe.toRGBA(), ne = 3;
|
|
223
|
+
let pe = 255;
|
|
224
|
+
E.mapAllPresetsRGB.forEach((ze, xe) => {
|
|
225
|
+
const Ye = ze.toRGBA(), dt = Math.abs(Ye.red - se.red) + Math.abs(Ye.blue - se.blue) + Math.abs(Ye.green - se.green);
|
|
226
|
+
dt < ne && dt < pe && (Ae = ze);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
ee(!Ae), U(Ae || oe);
|
|
230
|
+
}).catch((H) => {
|
|
231
|
+
F(!1), H?.name !== "AbortError" && console.error(H);
|
|
232
|
+
});
|
|
233
|
+
}, children: e(Rd, {}) }), [E, k]), Pe = W(() => {
|
|
234
|
+
if (!K) return;
|
|
235
|
+
const H = { opacity: K ? 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(dp, { style: H, selectedColor: M ? M.toRGBA().toString() : "transparent", onColorChange: Fe, disableAlpha: c }) });
|
|
237
|
+
}, [K, M]), He = W(() => ({ onClick: Q, alphaGrey: z.palette.text.icon ?? z.palette.action.active }), [Q, z]), Ne = W(() => {
|
|
238
|
+
if (!g) return null;
|
|
239
|
+
const H = { description: w, definition: { val: g.getVal(), adjs: g.getAdjustments() } };
|
|
240
|
+
return e(ce, { children: j(di, { sx: { display: "flex", color: (oe) => oe.palette.text.secondary }, onMouseOver: () => {
|
|
241
|
+
V(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(gr, { schemeColorLookup: R, colorDef: H, selectedColor: o === null ? g : o, previewColor: t === null ? g : t, defaultButtonSize: s, isLarge: !0, darkMode: k, compareRGB: C, swatchProps: He }) }), e(Be, { noWrap: !0, component: "div", style: { display: "flex", flex: "1 1 100%", marginLeft: "8px", userSelect: "none" }, children: w })] }) });
|
|
245
|
+
}, [g, w, R, 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: K ? "0" : 1 }, children: [Ne && v === To.Start ? j(ce, { children: [Ne, e(io, { light: !0, style: { marginTop: "2px", marginBottom: "10px" } })] }) : null, e(jo, { title: "Theme Colors", schemeColorLookup: R, colorDefs: E.primaryColors, selectedColor: o, previewColor: t === void 0 ? o : t, swatchProps: He, onPreviewColorDef: V, onSelectColorDef: Le, compareRGB: C, darkMode: k }), e(jo, { schemeColorLookup: R, colorDefs: E.modifiedPresets, selectedColor: o, previewColor: t === void 0 ? o : t, swatchProps: He, onPreviewColorDef: V, onSelectColorDef: Le, compareRGB: C, darkMode: k }), e(io, { light: !0, style: { marginBottom: "10px" } }), e(jo, { title: "Standard Colors", schemeColorLookup: R, colorDefs: E.standardColors, selectedColor: o, previewColor: t === void 0 ? o : t, swatchProps: He, onPreviewColorDef: V, 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(io, { light: !0, style: { marginBottom: "10px" } }), e(jo, { title: "Recent Colors", schemeColorLookup: R, colorDefs: E.recentColorsLimited, selectedColor: o, previewColor: t === void 0 ? o : t, swatchProps: He, onPreviewColorDef: V, onSelectColorDef: Le, compareRGB: C, darkMode: k })] }), Ne && v === To.End ? j(ce, { children: [e(io, { light: !0, sx: { marginTop: "2px", marginBottom: "2px" } }), Ne, e("div", { style: { marginBottom: "2px" } })] }) : null] }), Pe] }), e(io, { light: !0, style: { marginBottom: "10px" } }), j("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-around", gap: "8px", paddingLeft: "2px", paddingRight: "2px" }, children: [Ie, 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", K ? { children: "Preset" } : { children: "Custom" }) }), e(nn, { variant: "contained", size: "small", style: { minWidth: "75px" }, onClick: () => {
|
|
249
|
+
Promise.resolve(f?.()).then(() => {
|
|
250
|
+
me(Z);
|
|
251
|
+
});
|
|
252
|
+
}, children: "Done" })] })] });
|
|
253
|
+
})), up = e(zs, {}), Ei = Y(J((r, i) => {
|
|
254
|
+
const { selectedColor: o, quickColor: t, icon: n = up, tooltip: l, label: c, onPreviewColor: m, onPreviewColorImmediate: a, onSelectColor: s, variant: u = ot.Toolbar, panelProps: d, shouldCloseFloatAll: f = !0, compareRGB: p = !1, darkMode: h = !1, ...y } = r, x = te(m, [m]), b = te(a, [a]), g = te(s, [s]), [w, v] = _(() => {
|
|
255
|
+
}), C = t || w || o || d?.autoColor, k = Se(!1), T = q(() => {
|
|
256
|
+
}, []), M = te(() => {
|
|
257
|
+
v(o);
|
|
258
|
+
}, [o]), I = te((E) => {
|
|
259
|
+
k.current || (v(E), x?.(E));
|
|
260
|
+
}, [x]), A = te((E) => {
|
|
261
|
+
k.current || (v(E), b?.(E));
|
|
262
|
+
}, [b]), P = te((E, K) => {
|
|
263
|
+
k.current || (v(void 0), g?.(E, K));
|
|
264
|
+
}, [g]), S = W(() => e(B, { sx: { width: "24px", height: "24px", color: "inherit", "--sxl-color-active": `${C?.toCSS(h) ?? "transparent"}`, "& .activeColor": { fill: `${C?.toCSS(h) ?? "transparent"}` }, "& .style_grey": { fill: (E) => E.palette.text.icon ?? E.palette.action.active } }, children: typeof n == "function" ? n() : n }), [C, n, h]), N = te((E) => {
|
|
265
|
+
g?.(t, !1);
|
|
266
|
+
}, [g, t]), [L, F] = _(!1), z = q((E) => {
|
|
267
|
+
const { closeFloat: K, closeFloatAll: ee } = E;
|
|
268
|
+
return e(pp, { ...d, selectedColor: o, previewColor: w, onDone: f ? ee : K, onKeyDown: (X) => {
|
|
269
|
+
X.which === we.Enter && (f ? ee() : K());
|
|
270
|
+
}, onPreviewColorImmediate: A, onPreviewColor: I, onSelectColor: P, onEyeDropStart: () => F(!0), onEyeDropStop: () => F(!1), compareRGB: p, darkMode: h });
|
|
271
|
+
}, [o, w, f, C, d?.autoColor, h]), R = { onQuickClick: t ? N : void 0, createPopupPanel: z, popupProps: { popperProps: { resizeOnOverflow: !1 } }, onPopupOpen: M, onPopupClose: T, tooltip: l || c || "Color", label: c, icon: S, ...y };
|
|
272
|
+
return u === ot.Toolbar ? e(vt, { ref: i, ...R }) : e(lr, { ref: i, ...R });
|
|
273
|
+
})), tn = 82, ma = (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(rr, { 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(jd, { length: o, width: t, dashArray: n, isDouble: c, isAngled: m, className: "activeColor" }) });
|
|
276
|
+
}, mp = Y(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 = te(a, []), h = q((g) => {
|
|
278
|
+
const { popupContainer: w, floatReference: v, closeFloat: C, ...k } = g, T = [], M = ve.BuiltInDefinitionsArray;
|
|
279
|
+
for (let I = 0; I < M.length; I++) {
|
|
280
|
+
const A = M[I];
|
|
281
|
+
if (A.description === "None" && !s) continue;
|
|
282
|
+
const P = e(ma, { 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(ce, { 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%" } }), P] })] }) : A.description === "None" ? "None" : P, T.push(e(xt, { className: "border-stroke", tabIndex: 0, sx: { height: "28px", "& svg path.activeColor": { filter: $r(4) }, paddingLeft: "16px", background: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(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 === we.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 g = ve.BuiltInDefinitions.get(m);
|
|
293
|
+
let w;
|
|
294
|
+
return w = g.description === "None" ? e(B, { sx: { minWidth: `${tn}px` }, children: "None" }) : e(ma, { styleColor: c, length: tn, width: g.width, dashArray: g.pattern, darkMode: u, isDouble: g.description.toLowerCase().includes("double"), isAngled: g.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: $r() } }, children: w });
|
|
295
|
+
}, [m, c]), x = W(() => ve.BuiltInDefinitions.get(m), [m]), b = { disabled: n, icon: y, tooltip: "Border Style: " + x.description, sx: { background: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})`, ...d }, createPopupPanel: h, ...f };
|
|
296
|
+
return o === ot.Toolbar ? e(vt, { ...b }) : e(lr, { ...b });
|
|
297
|
+
})), hp = Y(J((r, i) => {
|
|
298
|
+
const { autoColor: o = null, schemeLookup: t, autoStrokeStyle: n = ve.StrokeStyle.Thin, disabled: l = !1, darkMode: c = !1, showStylingBefore: m = !0, onSelectBorder: a, onPreviewBorder: s, selectedBorder: u, createTemporaryBorder: d, ...f } = r, p = te(a, [a]), h = te(s, [s]), [y, x] = _(), [b, g] = _(), w = y ?? n, v = b ?? o, C = u || { bottom: { style: n, color: o?.toString() } }, k = te((S) => {
|
|
299
|
+
const N = {}, L = S ? Object.keys(S) : [];
|
|
300
|
+
let F = !1;
|
|
301
|
+
for (let Z = 0; Z < L.length; Z++) S[L[Z]]?.style && (N[L[Z]] = { style: S[L[Z]].style, color: S[L[Z]].color }, F || N[L[Z]].style === ve.StrokeStyle.None || (F = !0));
|
|
302
|
+
L.length < 6 && (F = !0);
|
|
303
|
+
const z = F ? N.left : null, R = F ? N.top : null, E = F ? N.right : null, K = F ? N.bottom : null, ee = F ? N.vertical : null, X = F ? N.horizontal : null;
|
|
304
|
+
let G = "";
|
|
305
|
+
return R || z || (G += "M 3,5 H 5 V 3 H 3 "), R || (G += "M 7,5 H 9 V 3 H 7 "), R || ee || (G += "M 11,5 h 2 V 3 h -2 "), R || (G += "M 15,5 h 2 V 3 h -2 "), R || E || (G += "M 19,5 h 2 V 3 h -2 "), z || (G += "M 3,9 H 5 V 7 H 3 "), ee || (G += "M 11,9 h 2 V 7 h -2 "), E || (G += "M 19,9 h 2 V 7 h -2 "), X || z || (G += "M 3,13 H 5 V 11 H 3 "), X || (G += "M 7,13 H 9 V 11 H 7 "), X || ee || (G += "M 11,13 h 2 v -2 h -2 "), X || E || (G += "M 19,13 h 2 v -2 h -2 "), X || (G += "M 15,13 h 2 v -2 h -2 "), z || (G += "M 3,17 H 5 V 15 H 3 "), ee || (G += "M 11,17 h 2 v -2 h -2 "), E || (G += "M 19,17 h 2 v -2 h -2 "), K || z || (G += "M 3,21 H 5 V 19 H 3 "), K || (G += "M 7,21 H 9 V 19 H 7 "), K || ee || (G += "M 11,21 h 2 v -2 h -2 "), K || (G += "M 15,21 h 2 v -2 h -2 "), K || E || (G += "M 19,21 h 2 v -2 h -2 "), j("div", { style: { width: "24px", height: "24px", position: "relative" }, children: [e(rr, { sx: { position: "absolute", top: "0px", left: "0px", "& path": { opacity: "0.8", transform: "translate(-0.5px, -0.5px)" } }, children: e("path", { d: G }) }), e(B, { sx: { width: "24px", height: "24px", display: "flex", alignItems: "center", justifyContent: "center", position: "absolute", top: "-1px", left: "-1px", "& svg path": { filter: Ws } }, children: e(mr, { getBorderAt: (Z, ge) => {
|
|
306
|
+
if (!d || L.length === 0) return null;
|
|
307
|
+
const U = Z.rowIndex, V = Z.colIndex, Q = {};
|
|
308
|
+
return U === 0 ? (Q.top = N.top, Q.bottom = N.horizontal) : (Q.top = N.horizontal, Q.bottom = N.bottom), V === 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 F = null;
|
|
312
|
+
if (S && S.length > 0) {
|
|
313
|
+
let z = null;
|
|
314
|
+
(N || L) && (z = { style: L, color: N?.toString() ?? null }), F = {};
|
|
315
|
+
for (let R = 0; R < S.length; R++) F[S[R]] = z;
|
|
316
|
+
}
|
|
317
|
+
return F;
|
|
318
|
+
}, []), M = q((S) => {
|
|
319
|
+
p?.(S);
|
|
320
|
+
}, []), I = q((S) => {
|
|
321
|
+
h?.(S);
|
|
322
|
+
}, []), A = q((S) => {
|
|
323
|
+
const { closeFloatAll: N, floatReference: L } = S, F = (E, K, ee = "bottom", X = !1) => {
|
|
324
|
+
const G = T(E, v ?? null, X ? ve.StrokeStyle.None : w ?? null), Z = X ? T([], v ?? null, w ?? null) : G;
|
|
325
|
+
return e(ft, { icon: k(Z), sx: { background: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})` }, tooltipProps: { label: K, simple: !0, placement: ee }, onClick: () => {
|
|
326
|
+
N(), I(G), M(G);
|
|
327
|
+
} });
|
|
328
|
+
}, z = j(ce, { children: [j(B, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [F([ve.Edge.Left, ve.Edge.Top, ve.Edge.Right, ve.Edge.Bottom, ve.Edge.Horizontal, ve.Edge.Vertical], "All Borders", "top"), F([ve.Edge.Horizontal, ve.Edge.Vertical], "Inner Borders", "top"), F([ve.Edge.Horizontal], "Inside Horizontal Borders", "top"), F([ve.Edge.Vertical], "Inside Vertical Borders", "top"), F([ve.Edge.Left, ve.Edge.Top, ve.Edge.Right, ve.Edge.Bottom], "Outside Borders", "top")] }), j(B, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [F([ve.Edge.Left], "Left Borders"), F([ve.Edge.Top], "Top Borders"), F([ve.Edge.Right], "Right Borders"), F([ve.Edge.Bottom], "Bottom Borders"), F([ve.Edge.Left, ve.Edge.Top, ve.Edge.Right, ve.Edge.Bottom, ve.Edge.Horizontal, ve.Edge.Vertical, ve.Edge.DiagonalUp, ve.Edge.DiagonalDown], "No Borders", "bottom", !0)] })] }), R = e(ce, { children: j(B, { sx: { display: "flex", padding: "6px 16px", flexDirection: "row", gap: "6px" }, children: [e(Ei, { variant: ot.Toolbar, icon: e(sr, {}), selectedColor: w === ve.StrokeStyle.None ? new gt("transparent") : v, onPreviewColor: (E) => {
|
|
329
|
+
g(E);
|
|
330
|
+
}, onSelectColor: (E, K) => {
|
|
331
|
+
g(E);
|
|
332
|
+
}, darkMode: c, tooltip: "Border Color", panelProps: { disableAlpha: !0, autoColor: o, schemeLookup: t }, disabled: l || w === ve.StrokeStyle.None, parentFloat: L, shouldCloseFloatAll: !1 }), e(mp, { selectedStyle: w, onSelectStyle: x, styleColor: v, darkMode: c, variant: ot.Toolbar, parentFloat: L })] }) });
|
|
333
|
+
return j(B, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, onClick: (E) => E.stopPropagation(), children: [m ? R : z, e(re, { orientation: "horizontal" }), m ? z : R] });
|
|
334
|
+
}, [w, v, o, t, c]), P = W(() => k(C), [C, c]);
|
|
335
|
+
return e(vt, { ref: i, createPopupPanel: A, popupProps: { popperProps: { resizeOnOverflow: !1 } }, createTooltip: ({ children: S }, N) => e(nt, { label: "Borders", description: "Set the borders.", disabled: N, children: S }), onQuickClick: () => {
|
|
336
|
+
p?.(C);
|
|
337
|
+
}, quickButtonProps: { sx: {} }, disabled: l, icon: P, ...f });
|
|
338
|
+
})), gp = Y(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: h, label: y, ...x } = r, b = Ve(o, ["formatBorder"]), g = t ?? b[0], w = g?.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 = te((S) => {
|
|
340
|
+
w?.onBorderSelect && w.onBorderSelect(S), f?.(S), g?.execute(S, n);
|
|
341
|
+
}, [g, f, n]), P = q((S, N) => {
|
|
342
|
+
const { children: L, title: F, ...z } = S;
|
|
343
|
+
let R = S.children;
|
|
344
|
+
return (g?.disabled() || c) && (R = e("div", { children: R })), e(cr, { command: g, placement: l === ie.Toolbar ? "bottom-start" : "right-start", disabled: N, ...z, children: R });
|
|
345
|
+
}, [g, c]);
|
|
346
|
+
return e(hp, { ref: i, autoColor: v, darkMode: T, autoStrokeStyle: C, createTemporaryBorder: M, schemeLookup: I, selectedBorder: k, onSelectBorder: A, createTooltip: P, disabled: c || !g || g.disabled(), ...x });
|
|
347
|
+
})), fp = Y(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(ce, { children: [e(O, { ...u, command: s.getCommand("mergeToggle"), icon: D(e(_r, {})) }), e(O, { ...u, command: s.getCommand("mergeHorizontal"), icon: D(e(js, {})) }), e(O, { ...u, command: s.getCommand("mergeVertical"), icon: D(e(Vs, {})) }), e(re, { orientation: "horizontal" }), e(O, { ...u, command: s.getCommand("unmerge"), icon: D(e(ui, {})) })] });
|
|
350
|
+
return Ce({ ...a, children: d });
|
|
351
|
+
}, [l, t, n]);
|
|
352
|
+
return e(De, { ref: i, commands: o, quickCommand: "mergeToggle", commandHook: t, scope: n, tooltip: "Combine or split cells.", createPopupPanel: m, icon: D(e(_r, {})), ...c });
|
|
353
|
+
})), xp = Y(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(ce, { children: [e(O, { ...u, command: s.getCommand("freezeToggle"), icon: D(e($s, {})) }), e(O, { ...u, command: s.getCommand("freezeToggleHorizontal"), icon: D(e(_s, {})) }), e(O, { ...u, command: s.getCommand("freezeToggleVertical"), icon: D(e(Us, {})) }), e(re, { orientation: "horizontal" }), e(O, { ...u, command: s.getCommand("unfreeze"), icon: e(ui, {}) })] });
|
|
356
|
+
return Ce({ ...a, children: d });
|
|
357
|
+
}, [l, t, n]);
|
|
358
|
+
return e(De, { 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(qs, {}), ...c });
|
|
359
|
+
})), bp = Y(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(ce, { children: [e(O, { ...u, command: s.getCommand("find"), icon: D(e(Ur, {})) }), e(O, { ...u, command: s.getCommand("findReplace"), icon: D(e(Gs, {})) }), e(O, { ...u, command: s.getCommand("goto"), icon: D(e(Xs, {})) })] });
|
|
362
|
+
return Ce({ ...a, children: d });
|
|
363
|
+
}, [l, t, n]);
|
|
364
|
+
return e(De, { 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: D(e(Ur, {})), ...c });
|
|
365
|
+
})), yp = Y(J((r, i) => {
|
|
366
|
+
const { command: o, commandHook: t, showQuickButtons: n = !!r.commands, commands: l, fontSizes: c = Vd.DefaultFontSizes, disabled: m = !1, parentFloat: a, icon: s, label: u, sx: d, ...f } = r;
|
|
367
|
+
Ht(o);
|
|
368
|
+
const p = () => o?.state()?.toString() || "11", [h, y] = _(p), x = te(() => {
|
|
369
|
+
const M = parseFloat(h);
|
|
370
|
+
isNaN(M) ? y(p()) : parseFloat(p()) !== M && o.execute(M, t);
|
|
371
|
+
}, [p, o, h, t]);
|
|
372
|
+
he(() => {
|
|
373
|
+
y(p());
|
|
374
|
+
}, [o?.state()]);
|
|
375
|
+
const b = W(() => {
|
|
376
|
+
if (!t) return null;
|
|
377
|
+
const M = { ...t };
|
|
378
|
+
return delete M.beforeExecute, M;
|
|
379
|
+
}, [t]), g = Ve(l, ["formatFontSizeIncrease", "formatFontSizeDecrease"]), w = W(() => g ? j(B, { className: Oe("quick-buttons", {}), sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (M) => M.stopPropagation(), children: [e(O, { command: g[0], commandHook: b, icon: D(e(Ks, {})) }), e(O, { command: g[1], icon: D(e(Ys, {})) })] }) : null, [g]), v = rt(), 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, ...P } = M;
|
|
381
|
+
return e(ct, { component: "div", ...P, disableRipple: !0, children: e(ar, { 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: h, onFocus: (S) => {
|
|
382
|
+
S.target?.select();
|
|
383
|
+
}, onKeyDown: (S) => {
|
|
384
|
+
if (S.which === we.Enter) p() !== h && (S.stopPropagation(), S.preventDefault(), x());
|
|
385
|
+
else if (S.which === we.Escape) p() !== h && (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.]") && (h + S.key).length > 4) return S.stopPropagation(), void S.preventDefault();
|
|
390
|
+
if (S.which === we.Space) return void S.preventDefault();
|
|
391
|
+
}
|
|
392
|
+
}, onBlur: () => {
|
|
393
|
+
x();
|
|
394
|
+
}, onChange: (S) => {
|
|
395
|
+
if (S.target.value.length > 4) return S.stopPropagation(), void S.preventDefault();
|
|
396
|
+
y(S.target.value);
|
|
397
|
+
} }) });
|
|
398
|
+
}, [h, m, o]), T = q((M) => {
|
|
399
|
+
const I = (N) => {
|
|
400
|
+
o?.execute(N, t);
|
|
401
|
+
}, A = o?.state(), P = [];
|
|
402
|
+
for (let N = 0; N < c.length; N++) {
|
|
403
|
+
const L = c[N] === A;
|
|
404
|
+
P.push(e(xt, { selected: L, icon: L ? e(sn, {}) : void 0, disabled: m || !o || o.disabled(), onMouseDown: (F) => {
|
|
405
|
+
F.button === 0 && F.preventDefault();
|
|
406
|
+
}, onMouseUp: (F) => {
|
|
407
|
+
F.button === 0 && I(c[N]);
|
|
408
|
+
}, onKeyDown: (F) => {
|
|
409
|
+
F.keyCode !== we.Enter && F.keyCode !== we.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: P })] });
|
|
413
|
+
return Ce({ ...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(nt, { label: o?.label(), description: o?.description(), disabled: I || o?.disabled(), children: M }), createQuickButton: k, ...f });
|
|
416
|
+
})), ha = Y((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 !== we.Enter && a.keyCode !== we.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
|
+
}), wp = Y(J((r, i) => {
|
|
426
|
+
const { commands: o, commandHook: t, scope: n, sx: l, disabled: c = !1, parentFloat: m, ...a } = r, s = Ve(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, x) => {
|
|
431
|
+
const b = (A) => {
|
|
432
|
+
t?.beforeExecute?.(s, s?.state()), s.execute(A, t), t?.onExecute?.(s, s?.state());
|
|
433
|
+
}, g = s?.context()(), w = mt.Styles.lookupPrimary(), v = [];
|
|
434
|
+
for (let A = 0; A < w.length; A++) {
|
|
435
|
+
let P = "";
|
|
436
|
+
if (g && !g.isEmpty()) try {
|
|
437
|
+
P = g.getNumberFormat(w[A].numberFormat).displayText;
|
|
438
|
+
} catch (N) {
|
|
439
|
+
console.warn(N);
|
|
440
|
+
}
|
|
441
|
+
P === "" && w[A].formatType === mt.Type.General && (P = "No specific format");
|
|
442
|
+
const S = w[A].formatType === u;
|
|
443
|
+
v.push(e(ha, { selected: S, disabled: c || !s || s.disabled(), formattedValue: P, handleSetFormat: b, format: w[A] }, w[A].formatType));
|
|
444
|
+
}
|
|
445
|
+
const C = { numberFormat: "", formatType: mt.Type.Custom }, k = u === mt.Type.Custom, T = e(ha, { selected: k, disabled: c || !s || s.disabled(), formattedValue: k ? g.getNumberFormat().displayText : "", handleSetFormat: () => {
|
|
446
|
+
t?.beforeExecute?.(s, s?.state()), x.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(O, { command: x.getCommand("formatNumberFormatAccountingStyle"), commandHook: d, scope: n, icon: e(Zs, {}) }), e(O, { command: x.getCommand("formatNumberFormatPercentStyle"), commandHook: d, scope: n, icon: e(Js, {}) }), e(O, { command: x.getCommand("formatNumberFormatCommaStyle"), commandHook: d, scope: n, icon: e(Qs, {}) }), e(O, { command: x.getCommand("formatNumberFormatIncreaseDecimal"), commandHook: d, scope: n, icon: D(e(ec, {})) }), e(O, { command: x.getCommand("formatNumberFormatDecreaseDecimal"), commandHook: d, scope: n, icon: D(e(tc, {})) })] }), 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 Ce({ ...y, children: I });
|
|
449
|
+
}, [s?.context(), s?.state(), t, n]), p = rt(), h = 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(De, { ref: i, commands: o, sx: l, outlined: !0, disabled: c, parentFloat: m, createPopupPanel: f, createTooltip: ({ children: y }, x) => e(nt, { label: s?.label(), description: s?.description(), disabled: x, 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: h }, children: e(B, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: u }) }), ...a });
|
|
454
|
+
})), Di = Y(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(ce, { children: [e(O, { ...u, command: s.getCommand("clearAll"), icon: e(qr, {}) }), e(O, { ...u, command: s.getCommand("clearFormats"), icon: D(e(mi, {})) }), e(O, { ...u, command: s.getCommand("clearContents"), icon: D(e(oc, {})) }), e(O, { ...u, command: s.getCommand("clearComments") }), e(O, { ...u, command: s.getCommand("clearHyperlinks") })] });
|
|
457
|
+
return Ce({ ...a, children: d });
|
|
458
|
+
}, [l, t, n]);
|
|
459
|
+
return e(De, { 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(qr, {}), ...c });
|
|
460
|
+
})), Sp = Y(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(ce, { children: [e(O, { ...u, command: s.getCommand("fillDown"), icon: D(e(lo, {})) }), e(O, { ...u, command: s.getCommand("fillRight"), icon: D(e(lo, { sx: { transform: "rotate(270deg)" } })) }), e(O, { ...u, command: s.getCommand("fillUp"), icon: D(e(lo, { sx: { transform: "rotate(180deg)" } })) }), e(O, { ...u, command: s.getCommand("fillLeft"), icon: D(e(lo, { sx: { transform: "rotate(90deg)" } })) })] });
|
|
463
|
+
return Ce({ ...a, children: d });
|
|
464
|
+
}, [l, t, n]);
|
|
465
|
+
return e(De, { 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: D(e(lo, {})), ...c });
|
|
466
|
+
})), Pi = Y(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 = Ve(o, d), { singleCommand: p, allDisabled: h } = W(() => {
|
|
468
|
+
let b = null, g = 0;
|
|
469
|
+
for (let w = 0; w < f.length; w++) f[w] && !f[w]?.disabled() && (m && s === ie.Menuitem && (b = g === 0 ? f[w] : null), g++);
|
|
470
|
+
return { singleCommand: b, allDisabled: g === 0 };
|
|
471
|
+
}, [f]), y = W(() => {
|
|
472
|
+
const b = /* @__PURE__ */ new Map();
|
|
473
|
+
return b.set("insertCellsShiftDown", D(e(Gr, {}))), b.set("insertCellsShiftRight", D(e(Gr, { sx: { transform: "rotate(270deg)" } }))), b.set("insertRows", D(e(nc, {}))), b.set("insertColumns", D(e(Xr, {}))), b;
|
|
474
|
+
}, []), x = q((b, g) => {
|
|
475
|
+
let w = null;
|
|
476
|
+
const v = { variant: ie.Menuitem, commandHook: t, scope: "insertCells", disabled: l };
|
|
477
|
+
c || (w = j(ce, { children: [e(re, { orientation: "horizontal" }), e(O, { ...v, command: g.getCommand("addSheet"), icon: D(e(rn, {})) })] }));
|
|
478
|
+
const C = j(ce, { children: [e(O, { ...v, command: f[0], icon: y.get(d[0]) }), e(O, { ...v, command: f[1], icon: y.get(d[1]) }), e(re, { orientation: "horizontal" }), e(O, { ...v, command: f[2], icon: y.get(d[2]) }), e(O, { ...v, command: f[3], icon: y.get(d[3]) }), w] });
|
|
479
|
+
return Ce({ ...b, children: C });
|
|
480
|
+
}, [l, f, t, n, y]);
|
|
481
|
+
return p ? e(O, { ref: i, variant: s, commandHook: t, disabled: l, command: p, icon: y.get(p.key()), ...u }) : e(De, { ref: i, variant: s, quickCommand: "insertCells", commands: o, commandHook: t, scope: n, disabled: l || h, tooltip: j(ce, { 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: x, icon: D(e(Xr, {})), ...u });
|
|
482
|
+
})), Ri = Y(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 = Ve(o, ["deleteCellsShiftUp", "deleteCellsShiftLeft", "deleteRows", "deleteColumns"]), { singleCommand: f, allDisabled: p } = W(() => {
|
|
484
|
+
let x = null, b = 0;
|
|
485
|
+
for (let g = 0; g < d.length; g++) d[g] && !d[g]?.disabled() && (m && s === ie.Menuitem && (x = b === 0 ? d[g] : null), b++);
|
|
486
|
+
return { singleCommand: x, allDisabled: b === 0 };
|
|
487
|
+
}, [d]), h = W(() => {
|
|
488
|
+
const x = /* @__PURE__ */ new Map();
|
|
489
|
+
return x.set("deleteCellsShiftUp", D(e(Kr, { sx: { transform: "rotate(0deg)" } }))), x.set("deleteCellsShiftLeft", D(e(Kr, { sx: { transform: "rotate(270deg)" } }))), x.set("deleteRows", D(e(rc, {}))), x.set("deleteColumns", D(e(Yr, {}))), x;
|
|
490
|
+
}, []), y = q((x, b) => {
|
|
491
|
+
const g = { variant: ie.Menuitem, commandHook: t, scope: "deleteCells", disabled: l };
|
|
492
|
+
let w = null;
|
|
493
|
+
c || (w = j(ce, { children: [e(re, { orientation: "horizontal" }), e(O, { ...g, command: b.getCommand("deleteSheet"), icon: D(e(rn, {})) })] }));
|
|
494
|
+
const v = j(ce, { children: [e(O, { ...g, command: b.getCommand("deleteCellsShiftUp"), icon: h.get("deleteCellsShiftUp") }), e(O, { ...g, command: b.getCommand("deleteCellsShiftLeft"), icon: h.get("deleteCellsShiftLeft") }), e(re, { orientation: "horizontal" }), e(O, { ...g, command: b.getCommand("deleteRows"), icon: h.get("deleteRows") }), e(O, { ...g, command: b.getCommand("deleteColumns"), icon: h.get("deleteColumns") }), w] });
|
|
495
|
+
return Ce({ ...x, children: v });
|
|
496
|
+
}, [l, t, n, h]);
|
|
497
|
+
return f ? e(O, { ref: i, variant: s, commandHook: t, disabled: l, command: f, icon: h.get(f.key()), ...u }) : e(De, { ref: i, variant: s, quickCommand: "deleteCells", commands: o, commandHook: t, scope: n, disabled: l || p, tooltip: j(ce, { 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: D(e(Yr, {})), ...u });
|
|
498
|
+
})), Ro = Y(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: h, recentColors: y, ...x } = 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 b = o?.context();
|
|
503
|
+
let g = m ?? b?.quickColor;
|
|
504
|
+
s && !g && (g = new gt("transparent"));
|
|
505
|
+
const w = p ?? b?.autoColor, v = h ?? b?.schemeLookup, C = y ?? b?.recentColors, k = u ?? b?.darkMode, T = W(() => ({ autoColor: w, schemeLookup: v, recentColors: C, darkMode: k, ...x }), [w, v, C, k]), M = te((A, P) => {
|
|
506
|
+
A && P && b?.addRecentColor && b.addRecentColor(A), b?.onColorSelect && b.onColorSelect(A), n?.(A, P), o?.execute(A, t);
|
|
507
|
+
}, [o, n, t, b]), I = q((A, P) => {
|
|
508
|
+
const { children: S, title: N, ...L } = A;
|
|
509
|
+
let F = A.children;
|
|
510
|
+
return (o?.disabled() || l) && (F = e("div", { children: F })), e(cr, { command: o, placement: c === ie.Toolbar ? "bottom-start" : "right-start", disabled: P, ...L, children: F });
|
|
511
|
+
}, [o, l]);
|
|
512
|
+
return e(Ei, { ref: i, panelProps: T, icon: d, quickColor: g, selectedColor: o?.state(), onSelectColor: M, variant: c === ie.Menuitem ? ot.Menuitem : ot.Toolbar, createTooltip: I, label: o?.label(), disabled: l || !o || o.disabled(), compareRGB: !0, darkMode: k, ...f });
|
|
513
|
+
}));
|
|
514
|
+
Ro.displayName = "ColorCommandButton";
|
|
515
|
+
const vp = Y(J((r, i) => {
|
|
516
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, parentFloat: c, ...m } = r, a = Ve(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(ce, { children: [e(O, { ...f, command: d.getCommand("gridlinesToggle") }), e(Ro, { ...f, command: d.getCommand("sheetViewFormatGridlinesColor"), icon: e(sr, {}), panelProps: { disableAlpha: !0 } }), e(re, { orientation: "horizontal" }), e(O, { ...f, command: d.getCommand("sheetViewToggleGridlinesColumns") }), e(O, { ...f, command: d.getCommand("sheetViewToggleGridlinesRows") })] });
|
|
518
|
+
return Ce({ ...u, children: p });
|
|
519
|
+
}, [l, t]);
|
|
520
|
+
return e(De, { 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
|
+
})), Mi = Y(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(ce, { children: [e(O, { ...u, command: s.getCommand("sortAscending"), icon: D(e(jn, {})) }), e(O, { ...u, command: s.getCommand("sortDescending"), icon: D(e(hi, {})) }), d ? e(O, { ...u, command: d, icon: D(e(ac, {})) }) : null, e(re, { orientation: "horizontal" }), e(O, { ...u, scope: "filter", command: s.getCommand("autoFilterToggle"), icon: D(e(Vn, {})) }), e(O, { ...u, scope: "filter", command: s.getCommand("autoFilterClear"), icon: D(e(dr, {})) }), e(O, { ...u, scope: "filter", command: s.getCommand("autoFilterReapply"), icon: D(e(gi, {})) })] });
|
|
524
|
+
return Ce({ ...a, children: f });
|
|
525
|
+
}, [l, t, n]);
|
|
526
|
+
return e(De, { ref: i, commands: o, commandHook: t, scope: n, disabled: l, label: "Sort", tooltip: j(ce, { 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: D(e(jn, {})), ...c });
|
|
527
|
+
})), vm = Y(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(ce, { children: [e(O, { ...u, scope: "filter", command: s.getCommand("autoFilterToggle"), icon: D(e(Vn, {})) }), e(O, { ...u, scope: "filter", command: s.getCommand("autoFilterClear"), icon: D(e(dr, {})) }), e(O, { ...u, scope: "filter", command: s.getCommand("autoFilterReapply"), icon: D(e(gi, {})) })] });
|
|
530
|
+
return Ce({ ...a, children: d });
|
|
531
|
+
}, [l, t, n]);
|
|
532
|
+
return e(De, { ref: i, commands: o, commandHook: t, scope: n, disabled: l, label: "Filter", tooltip: j(ce, { 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: D(e(Vn, {})), ...c });
|
|
533
|
+
})), Ni = Y(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 = Ve(u, f), h = p[0], y = p[1], x = c ?? h?.context?.()?.undoManager;
|
|
537
|
+
let b = s;
|
|
538
|
+
s || (b = !h || h.disabled(), y && !y.disabled() && (b = !1));
|
|
539
|
+
const [g, w] = _(0), v = q((C, k) => {
|
|
540
|
+
let T = g === 0 ? "Cancel" : `${h.label()} ${g} Action${g === 1 ? "" : "s"}`, M = !1;
|
|
541
|
+
x || (M = !0), M || (M = l ? !x.hasRedo() && !x.hasUndo() : !x.hasRedo());
|
|
542
|
+
const I = (F) => {
|
|
543
|
+
h.execute(F);
|
|
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: (F) => {
|
|
547
|
+
F.button === 0 && F.preventDefault();
|
|
548
|
+
}, onMouseUp: (F) => {
|
|
549
|
+
F.button === 0 && I(g);
|
|
550
|
+
}, onKeyDown: (F) => {
|
|
551
|
+
F.isDefaultPrevented() || F.keyCode !== we.Enter && F.keyCode !== we.Space || I(g);
|
|
552
|
+
}, children: e(Be, { component: "div", variant: "caption", sx: { fontSize: "0.875rem", letterSpacing: "0.01071em" }, children: T }) });
|
|
553
|
+
if (M) return A;
|
|
554
|
+
const P = n ? x?.getRedoDescriptions() : x?.getUndoDescriptions(), S = [];
|
|
555
|
+
for (let F = 0; F < P.length; F++) {
|
|
556
|
+
const z = P[F];
|
|
557
|
+
S.push(e(xt, { sx: { maxWidth: "360px", display: "flex" }, icon: e(rn, {}), disabled: b, selected: F < g, onMouseEnter: () => {
|
|
558
|
+
w(F + 1);
|
|
559
|
+
}, onMouseDown: (R) => {
|
|
560
|
+
R.button === 0 && R.preventDefault();
|
|
561
|
+
}, onMouseUp: (R) => {
|
|
562
|
+
R.button === 0 && I(F + 1);
|
|
563
|
+
}, onKeyDown: (R) => {
|
|
564
|
+
R.isDefaultPrevented() || R.keyCode !== we.Enter && R.keyCode !== we.Space || I(F + 1);
|
|
565
|
+
}, children: j(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", alignItems: "center", overflow: "hidden" }, children: [e(Be, { component: "div", children: z }), e(rn, {})] }) }, `action:${F}`));
|
|
566
|
+
}
|
|
567
|
+
let N = null;
|
|
568
|
+
if (!n && l) {
|
|
569
|
+
const F = { scope: "undo", commands: k, variant: ie.Menuitem, parentFloat: C.floatReference };
|
|
570
|
+
N = [], N.push(e(Ni, { ...F, quickCommand: "redo", isRedo: !0 }, "nested:redo")), x.hasRedo() && x.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 Ce({ ...C, children: L });
|
|
578
|
+
}, [h?.context(), h?.state(), m, x, g, b]);
|
|
579
|
+
return e(De, { ref: i, commands: u, quickCommand: o, scope: m, disabled: b, label: h?.label() ?? (n ? "Redo" : "Undo"), tooltip: e(ce, { children: e("span", { children: `${h?.label() ?? "No"} last actions.` }) }), createPopupPanel: v, icon: t ?? D(e(n ? ic : lc, {})), selected: !1, ...d });
|
|
580
|
+
})), Qt = cs.getFontList(), Fi = /* @__PURE__ */ new Map();
|
|
581
|
+
for (let r = 0; r < Qt.length; r++) Fi.set(Qt[r].fontRef.getFamily(), Qt[r]);
|
|
582
|
+
const Cp = Y(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 = rt(), f = W(() => `${Bt.getSharedMeasurer()("Times New Roman", Math.round(d.typography.fontSize), d.typography.fontFamily).width}px`, [d]), p = q((h) => {
|
|
586
|
+
const y = (w) => {
|
|
587
|
+
o?.execute(w, t);
|
|
588
|
+
}, x = [];
|
|
589
|
+
for (let w = 0; w < Qt.length; w++) x.push({ key: Qt[w].fontRef.getFamily(), description: Qt[w].fontRef.getFamily() });
|
|
590
|
+
Fi.get(u) || x.unshift({ key: u, description: u });
|
|
591
|
+
const b = [];
|
|
592
|
+
for (let w = 0; w < x.length; w++) {
|
|
593
|
+
const v = x[w].key === u;
|
|
594
|
+
b.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(x[w].key);
|
|
596
|
+
}, onMouseDown: (C) => {
|
|
597
|
+
C.button === 0 && C.preventDefault();
|
|
598
|
+
}, onKeyDown: (C) => {
|
|
599
|
+
C.keyCode !== we.Enter && C.keyCode !== we.Space || y(x[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: () => x[w]?.key }, children: x[w].description }) }) }, w + "" + x[w].key));
|
|
601
|
+
}
|
|
602
|
+
const g = e(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%" }, ...s, children: e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: b }) });
|
|
603
|
+
return Ce({ ...h, children: g });
|
|
604
|
+
}, [l, o?.state()]);
|
|
605
|
+
return e(vt, { ref: i, sx: { ...n }, outlined: !0, disabled: l, parentFloat: c, createPopupPanel: p, createTooltip: ({ children: h }, y) => e(nt, { label: o?.label(), description: o?.description(), disabled: y, children: h }), icon: e(B, { sx: { display: "flex", paddingLeft: "4px", paddingRight: "4px", fontSize: (h) => `${Math.round(h.typography.fontSize)}px`, fontFamily: (h) => h.typography.fontFamily, color: (h) => h.palette.text.secondary, width: f }, children: e(B, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: u }) }), ...s });
|
|
606
|
+
})), kp = Y(J((r, i) => {
|
|
607
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = Ve(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", D(e(Zr, {}))), d.set("formatSuperscriptToggle", D(e(sc, {}))), d.set("formatSubscriptToggle", D(e(cc, {}))), d;
|
|
613
|
+
}, []), u = q((d, f) => {
|
|
614
|
+
const p = { variant: ie.Menuitem, commandHook: t, scope: "textEffects", disabled: l }, h = j(ce, { children: [e(O, { ...p, command: f.getCommand("formatStrikeThroughToggle"), icon: s.get("formatStrikeThroughToggle") }), e(O, { ...p, command: f.getCommand("formatSuperscriptToggle"), icon: s.get("formatSuperscriptToggle") }), e(O, { ...p, command: f.getCommand("formatSubscriptToggle"), icon: s.get("formatSubscriptToggle") })] });
|
|
615
|
+
return Ce({ ...d, children: h });
|
|
616
|
+
}, [l, t, n]);
|
|
617
|
+
return e(De, { ref: i, quickCommand: a, commands: o, commandHook: t, createPopupPanel: u, label: "Text Effects", tooltip: "Style your text to differentiate it.", icon: s.get(a) ?? D(e(Zr, {})), ...c });
|
|
618
|
+
})), Tp = Y(J((r, i) => {
|
|
619
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = Ve(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", D(e(kn, {}))), d.set("formatUnderlinedDoubleToggle", D(e(Jr, {}))), d.set("formatUnderlinedAccountingToggle", D(e(Qr, {}))), d.set("formatUnderlinedAccountingDoubleToggle", D(e(ea, {}))), d;
|
|
625
|
+
}, []), u = q((d, f) => {
|
|
626
|
+
const p = { variant: ie.Menuitem, commandHook: t, scope: "underline", disabled: l }, h = j(ce, { children: [e(O, { ...p, command: f.getCommand("formatUnderlinedToggle"), icon: D(e(kn, {})) }), e(O, { ...p, command: f.getCommand("formatUnderlinedDoubleToggle"), icon: D(e(Jr, {})) }), e(O, { ...p, command: f.getCommand("formatUnderlinedAccountingToggle"), commandHook: t, icon: D(e(Qr, {})) }), e(O, { ...p, command: f.getCommand("formatUnderlinedAccountingDoubleToggle"), icon: D(e(ea, {})) })] });
|
|
627
|
+
return Ce({ ...d, children: h });
|
|
628
|
+
}, [l, t, n]);
|
|
629
|
+
return e(De, { ref: i, quickCommand: a, commands: o, commandHook: t, label: "Underline", tooltip: "All underline stylings.", createPopupPanel: u, icon: s.get(a) ?? D(e(kn, {})), ...c });
|
|
630
|
+
})), Ii = Y(J((r, i) => {
|
|
631
|
+
const { command: o, commands: t, commandHook: n, scope: l, includePasteAllInPopup: c = !0, disabled: m = !1, ...a } = r, s = te((u, d) => {
|
|
632
|
+
const f = { variant: ie.Menuitem, commandHook: n, scope: "paste", disabled: m }, p = [];
|
|
633
|
+
return c && (p.push(Ee(O, { ...f, command: d.getCommand("paste"), key: "paste", icon: e(ta, {}) })), p.push(e(re, { orientation: "horizontal" }, "paste-div"))), p.push(Ee(O, { ...f, command: d.getCommand("pasteValues"), key: "pasteValues", icon: D(e(dc, {})) })), p.push(Ee(O, { ...f, command: d.getCommand("pasteFormats"), key: "pasteFormats", icon: D(e(pc, {})) })), p.push(Ee(O, { ...f, command: d.getCommand("pasteFormulas"), key: "pasteFormulas", icon: D(e(uc, {})) })), p.push(Ee(O, { ...f, command: d.getCommand("pasteTranspose"), key: "pasteTranspose", icon: D(e(mc, {})) })), p.push(Ee(O, { ...f, command: d.getCommand("pasteLinks"), key: "pasteLinks", icon: D(e(hc, {})) })), Ce({ ...u, children: p });
|
|
634
|
+
}, [m, n, l, c]);
|
|
635
|
+
return e(De, { 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(ta, {}), ...a });
|
|
636
|
+
})), Ep = Y(J((r, i) => {
|
|
637
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, parentFloat: c, ...m } = r, a = Ve(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(ce, { children: [e(O, { ...f, command: d.getCommand("sheetViewToggleShowHeadings") }), e(O, { ...f, command: d.getCommand("sheetViewToggleShowHeadingsNumeric") }), e(re, { orientation: "horizontal" }), e(O, { ...f, command: d.getCommand("sheetViewToggleShowHeadingColumns") }), e(O, { ...f, command: d.getCommand("sheetViewToggleShowHeadingRows") })] });
|
|
639
|
+
return Ce({ ...u, children: p });
|
|
640
|
+
}, [l, t, n]);
|
|
641
|
+
return e(De, { 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
|
+
})), Dp = Y(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(ce, { children: [e(O, { ...s, command: o.getCommand("workbookViewToggleShowFormulaBar") }), e(O, { ...s, command: o.getCommand("workbookViewToggleShowTabs") }), e(O, { ...s, command: o.getCommand("workbookViewToggleShowStatusBar") }), e(re, { orientation: "horizontal" }), e(O, { ...s, command: o.getCommand("workbookViewToggleShowHorizontalScrollBar") }), e(O, { ...s, command: o.getCommand("workbookViewToggleShowVerticalScrollBar") })] });
|
|
645
|
+
return Ce({ ...a, children: u });
|
|
646
|
+
}, [l, o, t, n]);
|
|
647
|
+
return e(De, { 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
|
+
})), Oi = Y(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]), h = f.getInsets(), y = f.getFont(), x = 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: `${h.top}px ${h.right}px ${h.bottom}px ${h.left}px`, margin: "0px", outline: "none", resize: "none", overflow: "hidden", textOverflow: "ellipsis", verticalAlign: "baseline", textDecoration: y.toCSS().textDecoration, textAlign: ds.toCSSHorizontalTextAlign(d.getRenderHorizontalAlignment()), background: "transparent", maxHeight: "100%", whiteSpace: "pre", wordWrap: "break-word" }, ...m }, ...u, children: e(mr, { getBorderAt: x, 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
|
+
})), Pp = Y((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((x) => {
|
|
653
|
+
const b = { variant: ie.Menuitem, commandHook: d, context: "cellStyle" }, g = j(ce, { children: [e(O, { ...b, sx: { fontWeight: 550 }, command: s.getCommand("formatCellStyle"), commandState: o, disabled: u, icon: D(e(Po, {})) }), e(re, { orientation: "horizontal" }), e(O, { ...b, command: s.getCommand("modifyCellStyle"), commandState: { named: o } }), e(O, { ...b, command: s.getCommand("deleteCellStyle"), commandState: o, disabled: u || o?.getName() === ue.BuiltInName.Normal })] });
|
|
654
|
+
return Ce({ ...x, 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: g }) }) });
|
|
655
|
+
}, []), h = o?.getName() === t?.getName();
|
|
656
|
+
let y = e(ft, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (x) => `solid ${h ? x.palette.primary.dark : "transparent"} 1px` }, tooltipProps: { label: o.getName(), placement: "bottom-start" }, disabled: u, icon: null, onClick: () => {
|
|
657
|
+
c?.(o);
|
|
658
|
+
}, ...f, children: e(Oi, { 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
|
+
}), Rp = Y(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(), h = a ?? d?.bodyStyle(), y = te((v) => {
|
|
664
|
+
c?.(v), t?.execute(v, n);
|
|
665
|
+
}, [t, c, n]), x = q((v, C) => {
|
|
666
|
+
const k = { onSelectNamed: y, styles: f(), parentFloat: v.floatReference }, T = f().getCustomNamed(), M = /* @__PURE__ */ new Map(), I = [];
|
|
667
|
+
for (let R = 0; R < T.length; R++) M.set(T[R].getName(), T[R]), f().getNamed(T[R].getName()).getBuiltInID() === null && I.push(T[R].getName());
|
|
668
|
+
const A = (R) => {
|
|
669
|
+
let E = M.get(R);
|
|
670
|
+
return E || (E = f().getNamed(R)), !E || E.isHidden() ? null : e(Pp, { namedStyle: E, selectedNamed: p, bodyStyle: d.bodyStyle(), createTemporaryCell: d.createTemporaryCell, commands: o, commandHook: n, ...k }, R);
|
|
671
|
+
}, P = (R, E, K = !0) => {
|
|
672
|
+
const ee = [];
|
|
673
|
+
for (let X = 0; X < E.length; X++) {
|
|
674
|
+
const G = A(E[X]);
|
|
675
|
+
G && ee.push(G);
|
|
676
|
+
}
|
|
677
|
+
return ee.length === 0 ? null : j(B, { children: [K ? e(re, { orientation: "horizontal" }) : null, e(to, { children: R }, R + "-header"), e(B, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", width: "646px", maxWidth: "100%" }, children: ee }, R + "-presets")] }, R);
|
|
678
|
+
}, S = (R, E) => {
|
|
679
|
+
const K = [];
|
|
680
|
+
for (let ee = 0; ee < E.length; ee++) {
|
|
681
|
+
const X = A(E[ee]);
|
|
682
|
+
X && K.push(X);
|
|
683
|
+
}
|
|
684
|
+
return K.length === 0 ? null : e(B, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", flexDirection: "column", flex: "0 0 0%" }, children: K }, R + "-presets");
|
|
685
|
+
}, N = [];
|
|
686
|
+
N.push(P("Custom", I, !1)), N.push(P("Good, Bad and Neutral", [ue.BuiltInName.Normal, ue.BuiltInName.Bad, ue.BuiltInName.Good, ue.BuiltInName.Neutral], I.length > 0)), N.push(P("Data and Model", [ue.BuiltInName.Calculation, ue.BuiltInName.CheckCell, ue.BuiltInName.ExplanatoryText, ue.BuiltInName.FollowedHyperlink, ue.BuiltInName.Hyperlink, ue.BuiltInName.Input, ue.BuiltInName.LinkedCell, ue.BuiltInName.Note, ue.BuiltInName.Output, ue.BuiltInName.WarningText])), N.push(P("Titles and Headings", [ue.BuiltInName.Heading1, ue.BuiltInName.Heading2, ue.BuiltInName.Heading3, ue.BuiltInName.Heading4, ue.BuiltInName.Title, ue.BuiltInName.Total]));
|
|
687
|
+
let L = [];
|
|
688
|
+
var F, z;
|
|
689
|
+
return L.push(S("Accent 1", [ue.BuiltInName.Accent1_20, ue.BuiltInName.Accent1_40, ue.BuiltInName.Accent1_60, ue.BuiltInName.Accent1])), L.push(S("Accent 2", [ue.BuiltInName.Accent2_20, ue.BuiltInName.Accent2_40, ue.BuiltInName.Accent2_60, ue.BuiltInName.Accent2])), L.push(S("Accent 3", [ue.BuiltInName.Accent3_20, ue.BuiltInName.Accent3_40, ue.BuiltInName.Accent3_60, ue.BuiltInName.Accent3])), L.push(S("Accent 4", [ue.BuiltInName.Accent4_20, ue.BuiltInName.Accent4_40, ue.BuiltInName.Accent4_60, ue.BuiltInName.Accent4])), L.push(S("Accent 5", [ue.BuiltInName.Accent5_20, ue.BuiltInName.Accent5_40, ue.BuiltInName.Accent5_60, ue.BuiltInName.Accent5])), L.push(S("Accent 6", [ue.BuiltInName.Accent6_20, ue.BuiltInName.Accent6_40, ue.BuiltInName.Accent6_60, ue.BuiltInName.Accent6])), N.push((F = "Themed Cell Styles", z = L, j(B, { children: [e(re, { orientation: "horizontal" }), e(to, { children: F }, F + "-header"), e(B, { sx: { display: "flex", gap: "2px", flexWrap: "wrap", alignItems: "start", flexDirection: "row" }, children: z }, F + "-presets")] }, F))), N.push(P("Number Format", [ue.BuiltInName.Comma, ue.BuiltInName.Comma0, ue.BuiltInName.Currency, ue.BuiltInName.Currency0, ue.BuiltInName.Percent])), j(B, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", paddingTop: (R) => `${R.shape.borderRadius}px`, paddingBottom: (R) => `${R.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(O, { variant: ie.Menuitem, commandState: p, command: C.getCommand("newCellStyle"), context: "styles", commandHook: n, disabled: m, icon: D(e(gc, {})) })] });
|
|
691
|
+
}, [p, f?.().getTheme(), h]), b = te((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]), g = m || !t || t.disabled(), w = W(() => d && s ? e(Oi, { value: p?.getName() ?? "Custom", cellStyle: p ? { named: p.getName() } : void 0, styles: d.styles(), createTemporaryCell: b, bodyStyle: d.bodyStyle(), className: "outline-hover", disabled: g, sx: { maxHeight: "24px", height: "24px", marginRight: "2px", outline: (v) => `1px solid ${v.palette.action.hover}` }, borderProps: {} }) : D(e(Po, {})), [p, h, g]);
|
|
695
|
+
return e(De, { ref: i, createPopupPanel: x, outlined: s, commands: o, createTooltip: ({ children: v }, C) => e(nt, { label: t?.label(), description: t?.description(), disabled: C, children: v }), selected: !1, disabled: g, label: t?.label(), icon: w, ...u });
|
|
696
|
+
})), Ai = "_sheetxl-reset_ods65_1", Mp = 10, Np = Y(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 = Mp, isLive: d = !1, ...f } = r, p = Math.ceil(1.3 * u), [h, y] = nr((v) => v + 1, 0);
|
|
698
|
+
he(() => {
|
|
699
|
+
if (d && t) return t.addListeners({ onAnyChange: () => {
|
|
700
|
+
y();
|
|
701
|
+
} });
|
|
702
|
+
}, [t, d]);
|
|
703
|
+
const x = 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 tr({ initialAnchor: C, json: v, styles: o });
|
|
707
|
+
}, [h, t, n, o]), b = W(() => {
|
|
708
|
+
const v = [];
|
|
709
|
+
for (let C = 0; C < 5; C++) for (let k = 0; k < 5; k++) {
|
|
710
|
+
const T = x.getStyleAt({ colIndex: k, rowIndex: C });
|
|
711
|
+
v.push(T);
|
|
712
|
+
}
|
|
713
|
+
return v;
|
|
714
|
+
}, [x]), g = W(() => {
|
|
715
|
+
const v = (k, T, M) => {
|
|
716
|
+
let I = M.getFill().toCSS(l?.darkMode ?? !1);
|
|
717
|
+
const A = p - (T < 4 ? 1 : 0), P = 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: P }, 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: (P - 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 = b[5 * k + M];
|
|
724
|
+
T.push(v(k, M, I));
|
|
725
|
+
}
|
|
726
|
+
C.push(e("tr", { children: T }, k));
|
|
727
|
+
}
|
|
728
|
+
return C;
|
|
729
|
+
}, [x, n, l]), w = q((v, C) => b[C].getBorder() ?? null, [b]);
|
|
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(mr, { 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", Ai), style: { borderCollapse: "collapse", width: 5 * (p - 1) + 1, height: 5 * (u - 1) + 1 }, children: e("tbody", { children: g }) }) }) });
|
|
731
|
+
})), co = (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
|
+
}, Fp = Y(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 h = o.toJSON(), y = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
736
|
+
return h.styleOptions = { ...h.styleOptions, name: t.getName() }, h.ref = y, new tr({ initialAnchor: y, json: h, styles: n });
|
|
737
|
+
}, [o, t, n]), f = W(() => {
|
|
738
|
+
const h = [];
|
|
739
|
+
for (let y = 0; y < 5; y++) for (let x = 0; x < 5; x++) {
|
|
740
|
+
const b = d.getStyleAt({ colIndex: x, rowIndex: y });
|
|
741
|
+
h.push(b);
|
|
742
|
+
}
|
|
743
|
+
return h;
|
|
744
|
+
}, [d]), p = W(() => {
|
|
745
|
+
let h = s;
|
|
746
|
+
if (s || (h = document.createElement("canvas")), !h) return null;
|
|
747
|
+
h.width !== 61 && (h.width = 61), h.height !== 46 && (h.height = 46);
|
|
748
|
+
const y = h.getContext("2d", { alpha: !1 });
|
|
749
|
+
if (!y) return null;
|
|
750
|
+
const x = 12, b = l?.darkMode ?? !1;
|
|
751
|
+
for (let g = 0; g < 5; g++) for (let w = 0; w < 5; w++) {
|
|
752
|
+
const v = f[5 * g + w].getFill();
|
|
753
|
+
let C = l?.fill;
|
|
754
|
+
v.getType() === Cn.Type.Solid ? C = v.getColor().toCSS(b, !1) : v.getType() === Cn.Type.Gradient ? C = v.getStops[0]?.color.toCSS(b, !1) : v.getType() === Cn.Type.Pattern && (C = v.getForeground().toCSS(b, !1)), y.fillStyle = C;
|
|
755
|
+
const k = w * x, T = 9 * g;
|
|
756
|
+
y.fillRect(k, T, 13, 10);
|
|
757
|
+
}
|
|
758
|
+
y.lineWidth = 1;
|
|
759
|
+
for (let g = 0; g < 5; g++) for (let w = 0; w < 5; w++) {
|
|
760
|
+
const v = f[5 * g + w], C = w * x, k = 9 * g, T = v.getBorder();
|
|
761
|
+
if (!T.isEmpty()) {
|
|
762
|
+
const A = T.getLeft();
|
|
763
|
+
A.isNone() || (y.strokeStyle = A.getColor().toCSS(b, !1), co(y, C, k, C, k + 9));
|
|
764
|
+
const P = T.getTop();
|
|
765
|
+
P.isNone() || (y.strokeStyle = P.getColor().toCSS(b, !1), co(y, C, k, C + x, 9 * g));
|
|
766
|
+
const S = T.getRight();
|
|
767
|
+
S.isNone() || (y.strokeStyle = S.getColor().toCSS(b, !1), co(y, C + x, k, C + x, k + 9));
|
|
768
|
+
const N = T.getBottom();
|
|
769
|
+
N.isNone() || (y.strokeStyle = N.getColor().toCSS(b, !1), co(y, C, k + 9, C + x, k + 9));
|
|
770
|
+
}
|
|
771
|
+
y.strokeStyle = v.getFont().getFill().toCSS(b, !1);
|
|
772
|
+
const M = 4, I = 2.5;
|
|
773
|
+
co(y, w * x + I, 9 * g + M, w * x + I + 7, 9 * g + M);
|
|
774
|
+
}
|
|
775
|
+
return `url(${h.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
|
+
})), Cm = Y(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
|
+
})), Ip = Y((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, ...h } = r, y = q((w) => {
|
|
791
|
+
const v = { variant: ie.Menuitem, commandHook: d, context: "table" }, C = j(ce, { children: [e(O, { ...v, command: s.getCommand("formatTableStyleClearCellStyles"), commandState: o, disabled: u, icon: D(e(Po, {})) }), e(O, { ...v, sx: { fontWeight: 550 }, command: s.getCommand("formatTableStyle"), commandState: { name: o.getName() }, disabled: u, icon: D(e(Po, {})) }), e(re, { orientation: "horizontal" }), e(O, { ...v, command: s.getCommand("setDefaultTableStyle"), commandState: o.getName(), disabled: u }), e(re, { orientation: "horizontal" }), e(O, { ...v, command: s.getCommand("deleteTableStyle"), commandState: o?.getName(), disabled: u || !o || o.isBuiltIn() })] });
|
|
792
|
+
return Ce({ ...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]), x = o?.getName() === t, b = W(() => {
|
|
794
|
+
const w = { table: i, tableStyle: o, styles: l, bodyStyle: m };
|
|
795
|
+
return f ? e(Fp, { canvas: p, ...w }) : e(Np, { ...w });
|
|
796
|
+
}, [i, o, l, m]);
|
|
797
|
+
let g = e(ft, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (w) => `solid ${x ? w.palette.primary.dark : "transparent"} 1px` }, tooltipProps: { label: o.getName() ?? "None", placement: "bottom-start" }, disabled: u, icon: null, onClick: () => {
|
|
798
|
+
n?.(o?.getName());
|
|
799
|
+
}, ...h, children: b }, o.getName());
|
|
800
|
+
return c && (g = e(fi, { label: i.getStyleOptions().name, parentFloat: a, createPopupPanel: y, children: g })), g;
|
|
801
|
+
}), Op = Y(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 h = "insertTable";
|
|
806
|
+
p && (h = "editTable");
|
|
807
|
+
const y = W(() => ((I, A) => {
|
|
808
|
+
const P = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
809
|
+
return new tr({ initialAnchor: P, styles: A, json: { name: "PreviewTable", ref: P, description: "PreviewTable", headerRowCount: 1, totalsRowCount: 0, styleOptions: I } });
|
|
810
|
+
})(p?.getStyleOptions(), f?.()), [f?.().getDefaultTableStyle(), p?.getStyleOptions()]), x = p ?? y, [b, g] = _(x);
|
|
811
|
+
he(() => {
|
|
812
|
+
g(x);
|
|
813
|
+
}, [x]);
|
|
814
|
+
const w = a ?? d?.bodyStyle(), v = te((I) => {
|
|
815
|
+
c?.(I), t?.execute({ name: I }, n);
|
|
816
|
+
}, [t, c, n]), C = Se(null), k = q((I, A) => {
|
|
817
|
+
const P = { onSelectTableStyleName: v, styles: f(), parentFloat: I.floatReference };
|
|
818
|
+
C.current || (C.current = document.createElement("canvas"));
|
|
819
|
+
const S = (X) => {
|
|
820
|
+
const G = f().getTableStyle(X);
|
|
821
|
+
return G ? e(Ip, { table: b, tableStyle: G, selectedTableStyleName: b.getStyleOptions().name, bodyStyle: d.bodyStyle(), commands: A, commandHook: n, canvas: C.current, ...P }, X) : null;
|
|
822
|
+
}, N = (X, G, Z = !0) => {
|
|
823
|
+
const ge = [];
|
|
824
|
+
for (let U = 0; U < G.length; U++) {
|
|
825
|
+
const V = S(G[U]);
|
|
826
|
+
V && ge.push(V);
|
|
827
|
+
}
|
|
828
|
+
return ge.length === 0 ? null : j(B, { children: [Z ? 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: ge }, X + "-presets")] }, X);
|
|
829
|
+
}, L = [], F = f().getCustomTableStyles(), z = [];
|
|
830
|
+
if (F.length > 0) {
|
|
831
|
+
for (let X = 0; X < F.length; X++) F[X].isShownInTableStyles() && z.push(F[X].getName());
|
|
832
|
+
L.push(N("Custom", z, !1));
|
|
833
|
+
}
|
|
834
|
+
const R = [];
|
|
835
|
+
p && !p.getStyleOptions().name && R.push(null);
|
|
836
|
+
for (let X = 0; X < 21; X++) R.push("TableStyleLight" + (X + 1));
|
|
837
|
+
L.push(N("Light", R, z.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 K = [];
|
|
842
|
+
for (let X = 0; X < 11; X++) K.push("TableStyleDark" + (X + 1));
|
|
843
|
+
L.push(N("Dark", K));
|
|
844
|
+
let ee = null;
|
|
845
|
+
return p && (ee = j(ce, { children: [e(re, { orientation: "horizontal" }), e(O, { variant: ie.Menuitem, command: A.getCommand("formatTableStyleClearTableStyle"), commandHook: n, disabled: m, icon: D(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 }), ee] });
|
|
847
|
+
}, [f, f?.().getTheme(), w, b]), T = m || !t || t.disabled(), M = W(() => {
|
|
848
|
+
if (!d || !s) return D(e(Po, {}));
|
|
849
|
+
}, [b, w, T]);
|
|
850
|
+
return e(De, { ref: i, quickCommand: h, createPopupPanel: k, commands: o, label: t?.label(), commandState: p, commandHook: n, selected: p !== null, createTooltip: ({ children: I }, A) => e(nt, { label: t?.label(), description: t?.description(), disabled: A, children: I }), disabled: T, icon: M, ...u });
|
|
851
|
+
})), Je = [];
|
|
852
|
+
Je.push(tt("Primary Background", "bg1")), Je.push(tt("Primary Text", "tx1")), Je.push(tt("Secondary Background", "bg2")), Je.push(tt("Secondary Text", "tx2")), Je.push(tt("Accent 1", "accent1")), Je.push(tt("Accent 2", "accent2")), Je.push(tt("Accent 3", "accent3")), Je.push(tt("Accent 4", "accent4")), Je.push(tt("Accent 5", "accent5")), Je.push(tt("Accent 6", "accent6"));
|
|
853
|
+
const Ap = (r) => {
|
|
854
|
+
const { docTheme: i, onSelectTheme: o, darkMode: t, isSelected: n, outlined: l, sx: c, ...m } = r, a = rt(), s = W(() => {
|
|
855
|
+
let u = [];
|
|
856
|
+
for (let d = 0; d < Je.length; d++) {
|
|
857
|
+
const f = Je[d];
|
|
858
|
+
u.push(e(gr, { 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
|
+
}, Bp = Y(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?.search({ selected: t }) ?? [], d = [];
|
|
867
|
+
if (u.length === 0) return e(to, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "6px", paddingBottom: "6px" }, children: "No themes" });
|
|
868
|
+
for (let f = 0; f < u.length; f++) {
|
|
869
|
+
const p = u[f], h = t && p?.getName() === t.getName(), y = u[f + 1];
|
|
870
|
+
y && y.isCustom() !== p.isCustom() && d.push(e(re, { orientation: "horizontal", sx: { marginBottom: "4px" } }, `divider-${f}`)), d.push(e(Ap, { docTheme: p, onSelectTheme: () => n(p), isSelected: h, disabled: c, darkMode: m, onMouseDown: (x) => {
|
|
871
|
+
x.button === 0 && x.preventDefault();
|
|
872
|
+
}, onMouseUp: (x) => {
|
|
873
|
+
x.button === 0 && n(p);
|
|
874
|
+
}, onKeyDown: (x) => {
|
|
875
|
+
x.keyCode !== we.Enter && x.keyCode !== we.Space || n(p);
|
|
876
|
+
} }, p.getName()));
|
|
877
|
+
}
|
|
878
|
+
return d;
|
|
879
|
+
}, [t, n, m]);
|
|
880
|
+
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 })] }) });
|
|
881
|
+
})), Lp = Y(J((r, i) => {
|
|
882
|
+
const { themes: o, selectedTheme: t, onSelectTheme: n, icon: l, tooltip: c, label: m, variant: a = ot.Toolbar, darkMode: s, panelProps: u, ...d } = r, f = l || D(e(xi, {})), p = q((y) => {
|
|
883
|
+
const { closeFloatAll: x } = y;
|
|
884
|
+
return e(Bp, { ...u, themes: o, selectedTheme: t, onSelectTheme: n, darkMode: s, onKeyDown: (b) => {
|
|
885
|
+
b.which === we.Enter && x();
|
|
886
|
+
} });
|
|
887
|
+
}, [o, t, n, u, s]), h = { createPopupPanel: p, tooltip: c || m || "Theme", label: m, icon: f, ...d };
|
|
888
|
+
return a === ot.Toolbar ? e(vt, { ref: i, ...h }) : e(lr, { ref: i, ...h });
|
|
889
|
+
})), Hp = Y(J((r, i) => {
|
|
890
|
+
const { command: o, commandHook: t, selectedTheme: n, onSelectTheme: l, disabled: c = !1, darkMode: m, label: a, icon: s, variant: u, ...d } = r;
|
|
891
|
+
Ht(o);
|
|
892
|
+
const f = o?.context()?.themes, p = n || o?.context()?.theme, h = m ?? o?.context()?.darkMode, y = c || o?.disabled(), x = te((g) => {
|
|
893
|
+
l?.(g), o?.execute(g, t);
|
|
894
|
+
}, [l, t]), b = q((g, w) => {
|
|
895
|
+
const { children: v, title: C, ...k } = g;
|
|
896
|
+
let T = g.children;
|
|
897
|
+
return (y || w) && (T = e("div", { children: T })), e(cr, { command: o, placement: u === ie.Toolbar ? "bottom-start" : "right-start", disabled: y || w, ...k, children: T });
|
|
898
|
+
}, [o, y]);
|
|
899
|
+
return e(Lp, { ref: i, themes: f, selectedTheme: p, onSelectTheme: x, variant: u === ie.Menuitem ? ot.Menuitem : ot.Toolbar, createTooltip: b, disabled: y, darkMode: h, icon: D(e(xi, {})), ...d });
|
|
900
|
+
})), zp = Y(J((r, i) => {
|
|
901
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = Ve(o, ["themeMode"])[0], a = m?.state(), s = m?.state() !== null, u = bs("(prefers-color-scheme: dark)"), d = a === "dark" || a === null && u, f = te((p, h) => {
|
|
902
|
+
const y = { variant: ie.Menuitem, commandHook: t, scope: "appearance", disabled: l }, x = j(ce, { children: [e(O, { ...y, command: m, icon: D(e(d ? ca : da, {})) }), e(O, { ...y, command: h.getCommand("defaultThemeMode"), icon: D(e(u ? fc : xc, {})) }), e(re, { orientation: "horizontal" }), e(O, { ...y, command: h.getCommand("enableDarkGrid") }), e(O, { ...y, command: h.getCommand("enableDarkImages") })] });
|
|
903
|
+
return Ce({ ...p, children: x });
|
|
904
|
+
}, [l, m, t, n, u, a, s]);
|
|
905
|
+
return e(De, { 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: () => {
|
|
906
|
+
m?.execute(d ? "light" : "dark", t);
|
|
907
|
+
}, selected: s, icon: D(e(d ? ca : da, {})), ...c });
|
|
908
|
+
})), Wp = Y(J((r, i) => {
|
|
909
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, sx: c, ...m } = r, a = q((s, u) => {
|
|
910
|
+
const d = { variant: ie.Menuitem, scope: "help", commandHook: { ...t, beforeExecute: (p, h) => t?.beforeExecute?.(p, h) !== !1 && s.floatReference.closeAll() }, disabled: l }, f = j(ce, { children: [e(O, { ...d, command: u.getCommand("showKeyboardShortcuts"), icon: D(e(Md, {})) }), e(re, { orientation: "horizontal" }), e(O, { ...d, command: u.getCommand("gotoUrlGithub"), icon: D(e(bc, {})) }), e(O, { ...d, command: u.getCommand("gotoUrlDiscord"), icon: D(e(yc, {})) }), e(O, { ...d, command: u.getCommand("gotoUrlDocumentation"), icon: D(e(bi, {})) }), e(O, { ...d, command: u.getCommand("gotoUrlIssue"), icon: D(e(wc, {})) })] });
|
|
911
|
+
return Ce({ ...s, children: f });
|
|
912
|
+
}, [l, t]);
|
|
913
|
+
return e(De, { ref: i, sx: c, commands: o, disabled: l, commandHook: t, scope: n, label: "Help", tooltip: "Help, feedback, and keyboard shortcuts.", createPopupPanel: a, icon: D(e(Sc, { sx: { transform: "scale(0.75)" } })), ...m });
|
|
914
|
+
})), Bi = Y(J((r, i) => {
|
|
915
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, preferSingleMenu: c = !0, showQuickButton: m = !0, variant: a = ie.Toolbar, ...s } = r, u = Ve(o, ["insertImageFromFile", "insertImageFromURL"]), { singleMenuCommand: d, allDisabled: f } = W(() => {
|
|
916
|
+
let h = null, y = 0;
|
|
917
|
+
for (let x = 0; x < u.length; x++) u[x] && !u[x]?.disabled() && (c && a === ie.Menuitem && (h = y === 0 ? u[x] : null), y++);
|
|
918
|
+
return { singleMenuCommand: h, allDisabled: y === 0 };
|
|
919
|
+
}, [u]), p = q((h, y) => {
|
|
920
|
+
const x = { variant: ie.Menuitem, commandHook: t, scope: "insertImage", disabled: l }, b = j(ce, { children: [e(O, { ...x, command: y.getCommand("insertImageFromFile"), icon: D(e(Wo, {})) }), e(O, { ...x, command: y.getCommand("insertImageFromURL"), icon: D(e(Wo, {})) })] });
|
|
921
|
+
return Ce({ ...h, children: b });
|
|
922
|
+
}, [l, t, n]);
|
|
923
|
+
return d ? e(O, { ref: i, variant: a, commandHook: t, disabled: l, command: d, icon: D(e(Wo, {})), ...s }) : e(De, { 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: D(e(Wo, {})), ...s });
|
|
924
|
+
})), fr = Y(J((r, i) => {
|
|
925
|
+
const { command: o, ...t } = r, n = un(), [l, c] = _(!1), [m, a] = _("info");
|
|
926
|
+
return he(() => {
|
|
927
|
+
const s = n.getMode();
|
|
928
|
+
c(s?.key === "copy" || s?.key === "cut"), a(s?.key === "cut" ? "warning" : "info");
|
|
929
|
+
}, [n]), e(O, { ref: i, command: o, icon: D(e(vc, { isWalking: l, themedType: m })), ...t });
|
|
930
|
+
})), km = Y(J((r, i) => {
|
|
931
|
+
const { ...o } = r;
|
|
932
|
+
return e(st, { ref: i, ...o, popupCommandKeys: ["quickFormulaSum", "quickFormulaAverage", "quickFormulaCount", "quickFormulaMax", "quickFormulaMin", null, "insertFunction"], quickCommand: "quickFormulaSum", popupScope: "quickFormula", label: "Quick Formulas", tooltip: "More quick functions.", icon: (t) => {
|
|
933
|
+
switch (t?.key()) {
|
|
934
|
+
case "quickFormulaSum":
|
|
935
|
+
return D(e(kc, {}));
|
|
936
|
+
case "insertFunction":
|
|
937
|
+
return D(e(Cc, {}));
|
|
938
|
+
default:
|
|
939
|
+
return null;
|
|
940
|
+
}
|
|
941
|
+
} });
|
|
942
|
+
})), Li = le.createContext(null);
|
|
943
|
+
Li.displayName = "HookFormContext";
|
|
944
|
+
const Hi = () => le.useContext(Li), jp = Y(J((r, i) => {
|
|
945
|
+
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, h = Hi(), y = a && h ? h.register(a, s) : null, [x, b] = _(""), [g, w] = _(""), [v, C] = _(m);
|
|
946
|
+
he(() => {
|
|
947
|
+
C(m), w("");
|
|
948
|
+
}, [m]);
|
|
949
|
+
const k = te((P) => {
|
|
950
|
+
let S = "";
|
|
951
|
+
try {
|
|
952
|
+
C(P), d?.(P), u?.(P);
|
|
953
|
+
} catch (N) {
|
|
954
|
+
S = N.message ?? "Invalid Name";
|
|
955
|
+
}
|
|
956
|
+
a && h && (S ? h.setError(a, { message: S }) : h.clearErrors(a)), w(S);
|
|
957
|
+
}, [m, d, u]), T = te(async (P) => {
|
|
958
|
+
P.keyCode === we.Escape && x !== m && (k(x), h?.setValue(a, x), h?.clearErrors(a), P.stopPropagation()), f?.(P);
|
|
959
|
+
}, [f, x, m, h]), M = te((P) => {
|
|
960
|
+
b(P.target.value ?? "");
|
|
961
|
+
}, []), I = te((P) => {
|
|
962
|
+
b(""), y?.onBlur(P);
|
|
963
|
+
}, []), A = q((P) => {
|
|
964
|
+
k(P.target.value), y?.onChange(P);
|
|
965
|
+
}, [y]);
|
|
966
|
+
return e(ir, { sx: { paddingTop: (P) => P.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: !!g, helperText: g || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (P) => P.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", name: a, spellCheck: !1, autoComplete: "off", readOnly: o, sx: { paddingTop: (P) => P.spacing(1.25), paddingBottom: (P) => P.spacing(0.75), backgroundImage: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})` } } }, value: v ?? "", onChange: A, onKeyDownCapture: T, onContextMenu: (P) => {
|
|
967
|
+
P.stopPropagation();
|
|
968
|
+
} }) });
|
|
969
|
+
}));
|
|
970
|
+
jp.displayName = "NamedInput";
|
|
971
|
+
const Vo = (r) => r === null ? "" : r.toString(), Vp = Y(J((r, i) => {
|
|
972
|
+
const { formName: o, formOptions: t, disabled: n, style: l, className: c, sx: m, onKeyDown: a, value: s, onChangeInput: u, resolvedAddress: d, ...f } = r, p = Hi(), h = o && p ? p.register(o, t) : null, [y, x] = _(""), [b, g] = _(!1), [w, v] = _(() => Vo(s));
|
|
973
|
+
he(() => {
|
|
974
|
+
v(Vo(s)), x(""), o && p && p.clearErrors(o), g(!1);
|
|
975
|
+
}, [s]);
|
|
976
|
+
const C = te((S) => {
|
|
977
|
+
let N = "";
|
|
978
|
+
try {
|
|
979
|
+
v(S);
|
|
980
|
+
const L = Vo(s), F = d(S);
|
|
981
|
+
F.toString() !== L && u?.(F);
|
|
982
|
+
} catch {
|
|
983
|
+
N = "Invalid Range";
|
|
984
|
+
}
|
|
985
|
+
o && p && (N ? p.setError(o, { message: N }) : p.clearErrors(o)), x(N), g(!0);
|
|
986
|
+
}, [w, u, o, p]), k = te(async (S) => {
|
|
987
|
+
if (b && S.keyCode === we.Escape) {
|
|
988
|
+
const N = Vo(s);
|
|
989
|
+
v(N), x(""), g(!1), S.stopPropagation();
|
|
990
|
+
}
|
|
991
|
+
a?.(S);
|
|
992
|
+
}, [s, u, a, b]), T = te((S) => {
|
|
993
|
+
h?.onBlur(S);
|
|
994
|
+
}, [h]), M = q((S) => {
|
|
995
|
+
C(S.target.value), h?.onChange(S);
|
|
996
|
+
}, [h]), [I, A] = _(!1), P = W(() => e(ys, { tabIndex: -1, sx: { display: "flex", position: "relative", flex: "0" }, position: "end", children: e(Tc, { disabled: !0, selected: I, onSelectToggle: (S) => {
|
|
997
|
+
A(S);
|
|
998
|
+
}, label: "Select Range", icon: D(e(Ec, {})) }) }), [I]);
|
|
999
|
+
return e(ir, { 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: h?.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(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})` }, endAdornment: P }, value: w ?? "", onChange: M, onKeyDownCapture: k, onContextMenu: (S) => {
|
|
1000
|
+
S.stopPropagation();
|
|
1001
|
+
} }) });
|
|
1002
|
+
}));
|
|
1003
|
+
Vp.displayName = "RangeInput";
|
|
1004
|
+
const zi = Y(J((r, i) => {
|
|
1005
|
+
const { sheet: o, className: t, debounceDelay: n = 220, sx: l, ...c } = r, [m, a] = _(() => o.getView().getZoomScale()), [s, u] = _(null), d = Se(0);
|
|
1006
|
+
qe(o, { onViewChange: () => {
|
|
1007
|
+
u(!0), d.current === 0 && a(o.getView().getZoomScale());
|
|
1008
|
+
} }), he(() => {
|
|
1009
|
+
d.current = 0, u(!1), a(o.getView().getZoomScale());
|
|
1010
|
+
}, [o]), he(() => {
|
|
1011
|
+
d.current !== 0 && Ze.debounce(() => {
|
|
1012
|
+
m === d.current && (d.current = 0, o.getView().update({ zoomScale: m }));
|
|
1013
|
+
}, n)();
|
|
1014
|
+
}, [m, n]);
|
|
1015
|
+
const f = te((T) => {
|
|
1016
|
+
let M = T;
|
|
1017
|
+
T < 100 ? M = Math.round(T / (10 / 9) + 10) : T > 100 && (M = Math.round(3 * T - 200)), d.current = M, u(!0), a(M);
|
|
1018
|
+
}, [o]), p = (T) => {
|
|
1019
|
+
let M = T;
|
|
1020
|
+
return T < 100 ? M = 10 / 9 * (T - 10) : T > 100 && (M = (T + 200) / 3), M;
|
|
1021
|
+
}, h = p(m), [y, x] = _(null), b = Se(null), g = q(() => {
|
|
1022
|
+
const T = y;
|
|
1023
|
+
T && requestAnimationFrame(() => {
|
|
1024
|
+
b.current?.contains(document.activeElement) && T.focus();
|
|
1025
|
+
});
|
|
1026
|
+
}, []), w = pa(() => {
|
|
1027
|
+
f(p(Ze.findNextStep(o.getView().getZoomScale(), !1, 10)));
|
|
1028
|
+
}), v = pa(() => f(p(Ze.findNextStep(o.getView().getZoomScale(), !0, 10)))), C = rt(), k = W(() => `${Bt.getSharedMeasurer()("100%", Math.round(C.typography.fontSize), C.typography.fontFamily).width}px`, [C]);
|
|
1029
|
+
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) => {
|
|
1030
|
+
T.relatedTarget && !y && x(T.relatedTarget);
|
|
1031
|
+
}, onBlur: (T) => {
|
|
1032
|
+
y && !b?.current?.contains(T.relatedTarget) && x(null);
|
|
1033
|
+
}, onMouseDown: (T) => {
|
|
1034
|
+
T.button === 0 && T.preventDefault();
|
|
1035
|
+
}, onMouseUp: (T) => {
|
|
1036
|
+
T.button === 0 && g();
|
|
1037
|
+
}, ...c, children: [e(At, { disableInteractive: !0, title: "Zoom Out", children: e(ct, { sx: { padding: "0", "&:hover:not([disabled])": { color: (T) => T.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (T) => {
|
|
1038
|
+
T.button !== 0 ? T.preventDefault() : w(T);
|
|
1039
|
+
}, children: e(Nd, {}) }) }), e(ws, { ref: b, 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 ${oa(T.palette.primary.main, 0.16)}` }, "&:focus, &:hover, &.Mui-active": { boxShadow: (T) => `0px 0px 0px 2px ${oa(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: h, max: 200, marks: [{ value: 100 }], onAnimationEnd: () => u(!1), onWheel: (T) => {
|
|
1040
|
+
f(p(Ze.findNextStep(o.getView().getZoomScale(), T.deltaY < 0, 10)));
|
|
1041
|
+
}, onKeyDown: (T) => {
|
|
1042
|
+
T.which === we.Down || T.which === we.Right ? (f(p(Ze.findNextStep(o.getView().getZoomScale(), !0, 10))), T.preventDefault()) : T.which === we.Up || T.which === we.Left ? (f(p(Ze.findNextStep(o.getView().getZoomScale(), !1, 10))), T.preventDefault()) : T.which !== we.Enter && T.which !== we.Escape || g();
|
|
1043
|
+
}, onChange: (T, M) => {
|
|
1044
|
+
Math.abs(M - 100) < 3 ? f(100) : f(M);
|
|
1045
|
+
}, valueLabelFormat: (T, M) => `Zoom: ${Math.round(m)}%` }), e(At, { disableInteractive: !0, title: "Zoom In", children: e(ct, { sx: { padding: "0", "&:hover:not([disabled])": { color: (T) => T.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (T) => {
|
|
1046
|
+
T.button !== 0 ? T.preventDefault() : v(T);
|
|
1047
|
+
}, children: e(Fd, {}) }) }), j(B, { sx: { display: "flex", flexDirection: "row" }, children: [e(B, { sx: { minWidth: "8px" } }), e(Be, { noWrap: !0, component: "div", onClick: () => {
|
|
1048
|
+
f(100);
|
|
1049
|
+
}, 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) + "%" }) })] })] });
|
|
1050
|
+
}));
|
|
1051
|
+
zi.displayName = "SheetZoomScale";
|
|
1052
|
+
const Wi = Y(J((r, i) => {
|
|
1053
|
+
const { sx: o, sheet: t, gridStyle: n, children: l, childrenEnd: c, ...m } = r;
|
|
1054
|
+
ms(i, () => ({}));
|
|
1055
|
+
const a = Se(null);
|
|
1056
|
+
he(() => {
|
|
1057
|
+
const p = (h) => h.preventDefault();
|
|
1058
|
+
return a.current?.addEventListener("wheel", p, { passive: !1 }), () => {
|
|
1059
|
+
a.current?.removeEventListener("wheel", p);
|
|
1060
|
+
};
|
|
1061
|
+
}, []);
|
|
1062
|
+
const s = un(), u = W(() => {
|
|
1063
|
+
const p = s.getMode();
|
|
1064
|
+
return p?.description ? p.description : "Ready";
|
|
1065
|
+
}, [s]), [d, f] = _(!1);
|
|
1066
|
+
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(zi, { sx: { paddingLeft: "4px", minWidth: "175px" }, sheet: t })] });
|
|
1067
|
+
}));
|
|
1068
|
+
Wi.displayName = "StatusBar";
|
|
1069
|
+
var vo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1070
|
+
function Tm(r) {
|
|
1071
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
1072
|
+
}
|
|
1073
|
+
var ga, fa, En, xa, ba, $o = { exports: {} }, po = {}, uo = { exports: {} }, ya = {}, wa = { exports: {} };
|
|
1074
|
+
function $p() {
|
|
1075
|
+
return fa ? ga : (fa = 1, ga = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1076
|
+
}
|
|
1077
|
+
function _p() {
|
|
1078
|
+
if (xa) return En;
|
|
1079
|
+
xa = 1;
|
|
1080
|
+
var r = $p();
|
|
1081
|
+
function i() {
|
|
1082
|
+
}
|
|
1083
|
+
function o() {
|
|
1084
|
+
}
|
|
1085
|
+
return o.resetWarningCache = i, En = function() {
|
|
1086
|
+
function t(c, m, a, s, u, d) {
|
|
1087
|
+
if (d !== r) {
|
|
1088
|
+
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");
|
|
1089
|
+
throw f.name = "Invariant Violation", f;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
function n() {
|
|
1093
|
+
return t;
|
|
1094
|
+
}
|
|
1095
|
+
t.isRequired = t;
|
|
1096
|
+
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 };
|
|
1097
|
+
return l.PropTypes = l, l;
|
|
1098
|
+
}, En;
|
|
1099
|
+
}
|
|
1100
|
+
function mn() {
|
|
1101
|
+
return ba || (ba = 1, wa.exports = _p()()), wa.exports;
|
|
1102
|
+
}
|
|
1103
|
+
var Sa, _o = { exports: {} }, va, je = {}, bt = {};
|
|
1104
|
+
function hn() {
|
|
1105
|
+
return va || (va = 1, Object.defineProperty(bt, "__esModule", { value: !0 }), bt.dontSetMe = function(r, i, o) {
|
|
1106
|
+
if (r[i]) return new Error(`Invalid prop ${i} passed to ${o} - do not set this, set it on the child.`);
|
|
1107
|
+
}, bt.findInArray = function(r, i) {
|
|
1108
|
+
for (let o = 0, t = r.length; o < t; o++) if (i.apply(i, [r[o], o, r])) return r[o];
|
|
1109
|
+
}, bt.int = function(r) {
|
|
1110
|
+
return parseInt(r, 10);
|
|
1111
|
+
}, bt.isFunction = function(r) {
|
|
1112
|
+
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Function]";
|
|
1113
|
+
}, bt.isNum = function(r) {
|
|
1114
|
+
return typeof r == "number" && !isNaN(r);
|
|
1115
|
+
}), bt;
|
|
1116
|
+
}
|
|
1117
|
+
var Ca, ka, yt = {};
|
|
1118
|
+
function xr() {
|
|
1119
|
+
if (ka) return je;
|
|
1120
|
+
ka = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.addClassName = c, je.addEvent = function(a, s, u, d) {
|
|
1121
|
+
if (!a) return;
|
|
1122
|
+
const f = { capture: !0, ...d };
|
|
1123
|
+
a.addEventListener ? a.addEventListener(s, u, f) : a.attachEvent ? a.attachEvent("on" + s, u) : a["on" + s] = u;
|
|
1124
|
+
}, je.addUserSelectStyles = function(a) {
|
|
1125
|
+
if (!a) return;
|
|
1126
|
+
let s = a.getElementById("react-draggable-style-el");
|
|
1127
|
+
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;}
|
|
1128
|
+
`, s.innerHTML += `.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
1129
|
+
`, a.getElementsByTagName("head")[0].appendChild(s)), a.body && c(a.body, "react-draggable-transparent-selection");
|
|
1130
|
+
}, je.createCSSTransform = function(a, s) {
|
|
1131
|
+
const u = n(a, s, "px");
|
|
1132
|
+
return { [(0, i.browserPrefixToKey)("transform", i.default)]: u };
|
|
1133
|
+
}, je.createSVGTransform = function(a, s) {
|
|
1134
|
+
return n(a, s, "");
|
|
1135
|
+
}, je.getTouch = function(a, s) {
|
|
1136
|
+
return a.targetTouches && (0, r.findInArray)(a.targetTouches, (u) => s === u.identifier) || a.changedTouches && (0, r.findInArray)(a.changedTouches, (u) => s === u.identifier);
|
|
1137
|
+
}, je.getTouchIdentifier = function(a) {
|
|
1138
|
+
if (a.targetTouches && a.targetTouches[0]) return a.targetTouches[0].identifier;
|
|
1139
|
+
if (a.changedTouches && a.changedTouches[0]) return a.changedTouches[0].identifier;
|
|
1140
|
+
}, je.getTranslation = n, je.innerHeight = function(a) {
|
|
1141
|
+
let s = a.clientHeight;
|
|
1142
|
+
const u = a.ownerDocument.defaultView.getComputedStyle(a);
|
|
1143
|
+
return s -= (0, r.int)(u.paddingTop), s -= (0, r.int)(u.paddingBottom), s;
|
|
1144
|
+
}, je.innerWidth = function(a) {
|
|
1145
|
+
let s = a.clientWidth;
|
|
1146
|
+
const u = a.ownerDocument.defaultView.getComputedStyle(a);
|
|
1147
|
+
return s -= (0, r.int)(u.paddingLeft), s -= (0, r.int)(u.paddingRight), s;
|
|
1148
|
+
}, je.matchesSelector = t, je.matchesSelectorAndParentsTo = function(a, s, u) {
|
|
1149
|
+
let d = a;
|
|
1150
|
+
do {
|
|
1151
|
+
if (t(d, s)) return !0;
|
|
1152
|
+
if (d === u) return !1;
|
|
1153
|
+
d = d.parentNode;
|
|
1154
|
+
} while (d);
|
|
1155
|
+
return !1;
|
|
1156
|
+
}, je.offsetXYFromParent = function(a, s, u) {
|
|
1157
|
+
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;
|
|
1158
|
+
return { x: f, y: p };
|
|
1159
|
+
}, je.outerHeight = function(a) {
|
|
1160
|
+
let s = a.clientHeight;
|
|
1161
|
+
const u = a.ownerDocument.defaultView.getComputedStyle(a);
|
|
1162
|
+
return s += (0, r.int)(u.borderTopWidth), s += (0, r.int)(u.borderBottomWidth), s;
|
|
1163
|
+
}, je.outerWidth = function(a) {
|
|
1164
|
+
let s = a.clientWidth;
|
|
1165
|
+
const u = a.ownerDocument.defaultView.getComputedStyle(a);
|
|
1166
|
+
return s += (0, r.int)(u.borderLeftWidth), s += (0, r.int)(u.borderRightWidth), s;
|
|
1167
|
+
}, je.removeClassName = m, je.removeEvent = function(a, s, u, d) {
|
|
1168
|
+
if (!a) return;
|
|
1169
|
+
const f = { capture: !0, ...d };
|
|
1170
|
+
a.removeEventListener ? a.removeEventListener(s, u, f) : a.detachEvent ? a.detachEvent("on" + s, u) : a["on" + s] = null;
|
|
1171
|
+
}, je.scheduleRemoveUserSelectStyles = function(a) {
|
|
1172
|
+
window.requestAnimationFrame ? window.requestAnimationFrame(() => {
|
|
1173
|
+
l(a);
|
|
1174
|
+
}) : l(a);
|
|
1175
|
+
};
|
|
1176
|
+
var r = hn(), i = function(a, s) {
|
|
1177
|
+
if (typeof WeakMap == "function") var u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap();
|
|
1178
|
+
return function(f, p) {
|
|
1179
|
+
if (!p && f && f.__esModule) return f;
|
|
1180
|
+
var h, y, x = { __proto__: null, default: f };
|
|
1181
|
+
if (f === null || typeof f != "object" && typeof f != "function") return x;
|
|
1182
|
+
if (h = p ? d : u) {
|
|
1183
|
+
if (h.has(f)) return h.get(f);
|
|
1184
|
+
h.set(f, x);
|
|
1185
|
+
}
|
|
1186
|
+
for (const b in f) b !== "default" && {}.hasOwnProperty.call(f, b) && ((y = (h = Object.defineProperty) && Object.getOwnPropertyDescriptor(f, b)) && (y.get || y.set) ? h(x, b, y) : x[b] = f[b]);
|
|
1187
|
+
return x;
|
|
1188
|
+
}(a, s);
|
|
1189
|
+
}(function() {
|
|
1190
|
+
if (Ca) return yt;
|
|
1191
|
+
Ca = 1, Object.defineProperty(yt, "__esModule", { value: !0 }), yt.browserPrefixToKey = u, yt.browserPrefixToStyle = function(d, f) {
|
|
1192
|
+
return f ? `-${f.toLowerCase()}-${d}` : d;
|
|
1193
|
+
}, yt.default = void 0, yt.getPrefix = s;
|
|
1194
|
+
const a = ["Moz", "Webkit", "O", "ms"];
|
|
1195
|
+
function s() {
|
|
1196
|
+
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
|
|
1197
|
+
if (typeof window > "u") return "";
|
|
1198
|
+
const f = window.document?.documentElement?.style;
|
|
1199
|
+
if (!f || d in f) return "";
|
|
1200
|
+
for (let p = 0; p < a.length; p++) if (u(d, a[p]) in f) return a[p];
|
|
1201
|
+
return "";
|
|
1202
|
+
}
|
|
1203
|
+
function u(d, f) {
|
|
1204
|
+
return f ? `${f}${function(p) {
|
|
1205
|
+
let h = "", y = !0;
|
|
1206
|
+
for (let x = 0; x < p.length; x++) y ? (h += p[x].toUpperCase(), y = !1) : p[x] === "-" ? y = !0 : h += p[x];
|
|
1207
|
+
return h;
|
|
1208
|
+
}(d)}` : d;
|
|
1209
|
+
}
|
|
1210
|
+
return yt.default = s(), yt;
|
|
1211
|
+
}());
|
|
1212
|
+
let o = "";
|
|
1213
|
+
function t(a, s) {
|
|
1214
|
+
return o || (o = (0, r.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(u) {
|
|
1215
|
+
return (0, r.isFunction)(a[u]);
|
|
1216
|
+
})), !!(0, r.isFunction)(a[o]) && a[o](s);
|
|
1217
|
+
}
|
|
1218
|
+
function n(a, s, u) {
|
|
1219
|
+
let { x: d, y: f } = a, p = `translate(${d}${u},${f}${u})`;
|
|
1220
|
+
return s && (p = `translate(${`${typeof s.x == "string" ? s.x : s.x + u}`}, ${`${typeof s.y == "string" ? s.y : s.y + u}`})` + p), p;
|
|
1221
|
+
}
|
|
1222
|
+
function l(a) {
|
|
1223
|
+
if (a) try {
|
|
1224
|
+
if (a.body && m(a.body, "react-draggable-transparent-selection"), a.selection) a.selection.empty();
|
|
1225
|
+
else {
|
|
1226
|
+
const s = (a.defaultView || window).getSelection();
|
|
1227
|
+
s && s.type !== "Caret" && s.removeAllRanges();
|
|
1228
|
+
}
|
|
1229
|
+
} catch {
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
function c(a, s) {
|
|
1233
|
+
a.classList ? a.classList.add(s) : a.className.match(new RegExp(`(?:^|\\s)${s}(?!\\S)`)) || (a.className += ` ${s}`);
|
|
1234
|
+
}
|
|
1235
|
+
function m(a, s) {
|
|
1236
|
+
a.classList ? a.classList.remove(s) : a.className = a.className.replace(new RegExp(`(?:^|\\s)${s}(?!\\S)`, "g"), "");
|
|
1237
|
+
}
|
|
1238
|
+
return je;
|
|
1239
|
+
}
|
|
1240
|
+
var Ta, it = {};
|
|
1241
|
+
function ji() {
|
|
1242
|
+
if (Ta) return it;
|
|
1243
|
+
Ta = 1, Object.defineProperty(it, "__esModule", { value: !0 }), it.canDragX = function(t) {
|
|
1244
|
+
return t.props.axis === "both" || t.props.axis === "x";
|
|
1245
|
+
}, it.canDragY = function(t) {
|
|
1246
|
+
return t.props.axis === "both" || t.props.axis === "y";
|
|
1247
|
+
}, it.createCoreData = function(t, n, l) {
|
|
1248
|
+
const c = !(0, r.isNum)(t.lastX), m = o(t);
|
|
1249
|
+
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 };
|
|
1250
|
+
}, it.createDraggableData = function(t, n) {
|
|
1251
|
+
const l = t.props.scale;
|
|
1252
|
+
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 };
|
|
1253
|
+
}, it.getBoundPosition = function(t, n, l) {
|
|
1254
|
+
if (!t.props.bounds) return [n, l];
|
|
1255
|
+
let { bounds: c } = t.props;
|
|
1256
|
+
c = typeof c == "string" ? c : function(a) {
|
|
1257
|
+
return { left: a.left, top: a.top, right: a.right, bottom: a.bottom };
|
|
1258
|
+
}(c);
|
|
1259
|
+
const m = o(t);
|
|
1260
|
+
if (typeof c == "string") {
|
|
1261
|
+
const { ownerDocument: a } = m, s = a.defaultView;
|
|
1262
|
+
let u;
|
|
1263
|
+
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.');
|
|
1264
|
+
const d = u, f = s.getComputedStyle(m), p = s.getComputedStyle(d);
|
|
1265
|
+
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) };
|
|
1266
|
+
}
|
|
1267
|
+
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];
|
|
1268
|
+
}, it.getControlPosition = function(t, n, l) {
|
|
1269
|
+
const c = typeof n == "number" ? (0, i.getTouch)(t, n) : null;
|
|
1270
|
+
if (typeof n == "number" && !c) return null;
|
|
1271
|
+
const m = o(l), a = l.props.offsetParent || m.offsetParent || m.ownerDocument.body;
|
|
1272
|
+
return (0, i.offsetXYFromParent)(c || t, a, l.props.scale);
|
|
1273
|
+
}, it.snapToGrid = function(t, n, l) {
|
|
1274
|
+
const c = Math.round(n / t[0]) * t[0], m = Math.round(l / t[1]) * t[1];
|
|
1275
|
+
return [c, m];
|
|
1276
|
+
};
|
|
1277
|
+
var r = hn(), i = xr();
|
|
1278
|
+
function o(t) {
|
|
1279
|
+
const n = t.findDOMNode();
|
|
1280
|
+
if (!n) throw new Error("<DraggableCore>: Unmounted during event!");
|
|
1281
|
+
return n;
|
|
1282
|
+
}
|
|
1283
|
+
return it;
|
|
1284
|
+
}
|
|
1285
|
+
var Ea, Da, Pa, Ra, mo = {}, Uo = {};
|
|
1286
|
+
function Vi() {
|
|
1287
|
+
return Ea || (Ea = 1, Object.defineProperty(Uo, "__esModule", { value: !0 }), Uo.default = function() {
|
|
1288
|
+
}), Uo;
|
|
1289
|
+
}
|
|
1290
|
+
function Up() {
|
|
1291
|
+
if (Da) return mo;
|
|
1292
|
+
Da = 1, Object.defineProperty(mo, "__esModule", { value: !0 }), mo.default = void 0;
|
|
1293
|
+
var r = function(p, h) {
|
|
1294
|
+
if (typeof WeakMap == "function") var y = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap();
|
|
1295
|
+
return function(b, g) {
|
|
1296
|
+
if (!g && b && b.__esModule) return b;
|
|
1297
|
+
var w, v, C = { __proto__: null, default: b };
|
|
1298
|
+
if (b === null || typeof b != "object" && typeof b != "function") return C;
|
|
1299
|
+
if (w = g ? x : y) {
|
|
1300
|
+
if (w.has(b)) return w.get(b);
|
|
1301
|
+
w.set(b, C);
|
|
1302
|
+
}
|
|
1303
|
+
for (const k in b) k !== "default" && {}.hasOwnProperty.call(b, k) && ((v = (w = Object.defineProperty) && Object.getOwnPropertyDescriptor(b, k)) && (v.get || v.set) ? w(C, k, v) : C[k] = b[k]);
|
|
1304
|
+
return C;
|
|
1305
|
+
}(p, h);
|
|
1306
|
+
}(le), i = m(mn()), o = m(Kt), t = xr(), n = ji(), l = hn(), c = m(Vi());
|
|
1307
|
+
function m(p) {
|
|
1308
|
+
return p && p.__esModule ? p : { default: p };
|
|
1309
|
+
}
|
|
1310
|
+
function a(p, h, y) {
|
|
1311
|
+
return (h = function(x) {
|
|
1312
|
+
var b = function(g, w) {
|
|
1313
|
+
if (typeof g != "object" || !g) return g;
|
|
1314
|
+
var v = g[Symbol.toPrimitive];
|
|
1315
|
+
if (v !== void 0) {
|
|
1316
|
+
var C = v.call(g, w);
|
|
1317
|
+
if (typeof C != "object") return C;
|
|
1318
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1319
|
+
}
|
|
1320
|
+
return (w === "string" ? String : Number)(g);
|
|
1321
|
+
}(x, "string");
|
|
1322
|
+
return typeof b == "symbol" ? b : b + "";
|
|
1323
|
+
}(h)) in p ? Object.defineProperty(p, h, { value: y, enumerable: !0, configurable: !0, writable: !0 }) : p[h] = y, p;
|
|
1324
|
+
}
|
|
1325
|
+
const s = { start: "touchstart", move: "touchmove", stop: "touchend" }, u = { start: "mousedown", move: "mousemove", stop: "mouseup" };
|
|
1326
|
+
let d = u, f = class extends r.Component {
|
|
1327
|
+
constructor() {
|
|
1328
|
+
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) => {
|
|
1329
|
+
if (this.props.onMouseDown(p), !this.props.allowAnyClick && typeof p.button == "number" && p.button !== 0) return !1;
|
|
1330
|
+
const h = this.findDOMNode();
|
|
1331
|
+
if (!h || !h.ownerDocument || !h.ownerDocument.body) throw new Error("<DraggableCore> not mounted on DragStart!");
|
|
1332
|
+
const { ownerDocument: y } = h;
|
|
1333
|
+
if (this.props.disabled || !(p.target instanceof y.defaultView.Node) || this.props.handle && !(0, t.matchesSelectorAndParentsTo)(p.target, this.props.handle, h) || this.props.cancel && (0, t.matchesSelectorAndParentsTo)(p.target, this.props.cancel, h)) return;
|
|
1334
|
+
p.type !== "touchstart" || this.props.allowMobileScroll || p.preventDefault();
|
|
1335
|
+
const x = (0, t.getTouchIdentifier)(p);
|
|
1336
|
+
this.touchIdentifier = x;
|
|
1337
|
+
const b = (0, n.getControlPosition)(p, x, this);
|
|
1338
|
+
if (b == null) return;
|
|
1339
|
+
const { x: g, y: w } = b, v = (0, n.createCoreData)(this, g, w);
|
|
1340
|
+
(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 = g, this.lastY = w, (0, t.addEvent)(y, d.move, this.handleDrag), (0, t.addEvent)(y, d.stop, this.handleDragStop));
|
|
1341
|
+
}), a(this, "handleDrag", (p) => {
|
|
1342
|
+
const h = (0, n.getControlPosition)(p, this.touchIdentifier, this);
|
|
1343
|
+
if (h == null) return;
|
|
1344
|
+
let { x: y, y: x } = h;
|
|
1345
|
+
if (Array.isArray(this.props.grid)) {
|
|
1346
|
+
let g = y - this.lastX, w = x - this.lastY;
|
|
1347
|
+
if ([g, w] = (0, n.snapToGrid)(this.props.grid, g, w), !g && !w) return;
|
|
1348
|
+
y = this.lastX + g, x = this.lastY + w;
|
|
1349
|
+
}
|
|
1350
|
+
const b = (0, n.createCoreData)(this, y, x);
|
|
1351
|
+
if ((0, c.default)("DraggableCore: handleDrag: %j", b), this.props.onDrag(p, b) !== !1 && this.mounted !== !1) this.lastX = y, this.lastY = x;
|
|
1352
|
+
else try {
|
|
1353
|
+
this.handleDragStop(new MouseEvent("mouseup"));
|
|
1354
|
+
} catch {
|
|
1355
|
+
const w = document.createEvent("MouseEvents");
|
|
1356
|
+
w.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(w);
|
|
1357
|
+
}
|
|
1358
|
+
}), a(this, "handleDragStop", (p) => {
|
|
1359
|
+
if (!this.dragging) return;
|
|
1360
|
+
const h = (0, n.getControlPosition)(p, this.touchIdentifier, this);
|
|
1361
|
+
if (h == null) return;
|
|
1362
|
+
let { x: y, y: x } = h;
|
|
1363
|
+
if (Array.isArray(this.props.grid)) {
|
|
1364
|
+
let w = y - this.lastX || 0, v = x - this.lastY || 0;
|
|
1365
|
+
[w, v] = (0, n.snapToGrid)(this.props.grid, w, v), y = this.lastX + w, x = this.lastY + v;
|
|
1366
|
+
}
|
|
1367
|
+
const b = (0, n.createCoreData)(this, y, x);
|
|
1368
|
+
if (this.props.onStop(p, b) === !1 || this.mounted === !1) return !1;
|
|
1369
|
+
const g = this.findDOMNode();
|
|
1370
|
+
g && this.props.enableUserSelectHack && (0, t.scheduleRemoveUserSelectStyles)(g.ownerDocument), (0, c.default)("DraggableCore: handleDragStop: %j", b), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, g && ((0, c.default)("DraggableCore: Removing handlers"), (0, t.removeEvent)(g.ownerDocument, d.move, this.handleDrag), (0, t.removeEvent)(g.ownerDocument, d.stop, this.handleDragStop));
|
|
1371
|
+
}), 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)));
|
|
1372
|
+
}
|
|
1373
|
+
componentDidMount() {
|
|
1374
|
+
this.mounted = !0;
|
|
1375
|
+
const p = this.findDOMNode();
|
|
1376
|
+
p && (0, t.addEvent)(p, s.start, this.onTouchStart, { passive: !1 });
|
|
1377
|
+
}
|
|
1378
|
+
componentWillUnmount() {
|
|
1379
|
+
this.mounted = !1;
|
|
1380
|
+
const p = this.findDOMNode();
|
|
1381
|
+
if (p) {
|
|
1382
|
+
const { ownerDocument: h } = p;
|
|
1383
|
+
(0, t.removeEvent)(h, u.move, this.handleDrag), (0, t.removeEvent)(h, s.move, this.handleDrag), (0, t.removeEvent)(h, u.stop, this.handleDragStop), (0, t.removeEvent)(h, s.stop, this.handleDragStop), (0, t.removeEvent)(p, s.start, this.onTouchStart, { passive: !1 }), this.props.enableUserSelectHack && (0, t.scheduleRemoveUserSelectStyles)(h);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
findDOMNode() {
|
|
1387
|
+
return this.props?.nodeRef ? this.props?.nodeRef?.current : o.default.findDOMNode(this);
|
|
1388
|
+
}
|
|
1389
|
+
render() {
|
|
1390
|
+
return r.cloneElement(r.Children.only(this.props.children), { onMouseDown: this.onMouseDown, onMouseUp: this.onMouseUp, onTouchEnd: this.onTouchEnd });
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1393
|
+
return mo.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, h) {
|
|
1394
|
+
if (p[h] && p[h].nodeType !== 1) throw new Error("Draggable's offsetParent must be a DOM Node.");
|
|
1395
|
+
}, 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() {
|
|
1396
|
+
}, onDrag: function() {
|
|
1397
|
+
}, onStop: function() {
|
|
1398
|
+
}, onMouseDown: function() {
|
|
1399
|
+
}, scale: 1 }), mo;
|
|
1400
|
+
}
|
|
1401
|
+
function qp() {
|
|
1402
|
+
return Pa || (Pa = 1, function(r) {
|
|
1403
|
+
Object.defineProperty(r, "__esModule", { value: !0 }), Object.defineProperty(r, "DraggableCore", { enumerable: !0, get: function() {
|
|
1404
|
+
return a.default;
|
|
1405
|
+
} }), r.default = void 0;
|
|
1406
|
+
var i = function(h, y) {
|
|
1407
|
+
if (typeof WeakMap == "function") var x = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap();
|
|
1408
|
+
return function(g, w) {
|
|
1409
|
+
if (!w && g && g.__esModule) return g;
|
|
1410
|
+
var v, C, k = { __proto__: null, default: g };
|
|
1411
|
+
if (g === null || typeof g != "object" && typeof g != "function") return k;
|
|
1412
|
+
if (v = w ? b : x) {
|
|
1413
|
+
if (v.has(g)) return v.get(g);
|
|
1414
|
+
v.set(g, k);
|
|
1415
|
+
}
|
|
1416
|
+
for (const T in g) T !== "default" && {}.hasOwnProperty.call(g, T) && ((C = (v = Object.defineProperty) && Object.getOwnPropertyDescriptor(g, T)) && (C.get || C.set) ? v(k, T, C) : k[T] = g[T]);
|
|
1417
|
+
return k;
|
|
1418
|
+
}(h, y);
|
|
1419
|
+
}(le), o = u(mn()), t = u(Kt), n = function() {
|
|
1420
|
+
if (Sa) return _o.exports;
|
|
1421
|
+
function h(x) {
|
|
1422
|
+
var b, g, w = "";
|
|
1423
|
+
if (typeof x == "string" || typeof x == "number") w += x;
|
|
1424
|
+
else if (typeof x == "object") if (Array.isArray(x)) {
|
|
1425
|
+
var v = x.length;
|
|
1426
|
+
for (b = 0; b < v; b++) x[b] && (g = h(x[b])) && (w && (w += " "), w += g);
|
|
1427
|
+
} else for (g in x) x[g] && (w && (w += " "), w += g);
|
|
1428
|
+
return w;
|
|
1429
|
+
}
|
|
1430
|
+
function y() {
|
|
1431
|
+
for (var x, b, g = 0, w = "", v = arguments.length; g < v; g++) (x = arguments[g]) && (b = h(x)) && (w && (w += " "), w += b);
|
|
1432
|
+
return w;
|
|
1433
|
+
}
|
|
1434
|
+
return Sa = 1, _o.exports = y, _o.exports.clsx = y, _o.exports;
|
|
1435
|
+
}(), l = xr(), c = ji(), m = hn(), a = u(Up()), s = u(Vi());
|
|
1436
|
+
function u(h) {
|
|
1437
|
+
return h && h.__esModule ? h : { default: h };
|
|
1438
|
+
}
|
|
1439
|
+
function d() {
|
|
1440
|
+
return d = Object.assign ? Object.assign.bind() : function(h) {
|
|
1441
|
+
for (var y = 1; y < arguments.length; y++) {
|
|
1442
|
+
var x = arguments[y];
|
|
1443
|
+
for (var b in x) ({}).hasOwnProperty.call(x, b) && (h[b] = x[b]);
|
|
1444
|
+
}
|
|
1445
|
+
return h;
|
|
1446
|
+
}, d.apply(null, arguments);
|
|
1447
|
+
}
|
|
1448
|
+
function f(h, y, x) {
|
|
1449
|
+
return (y = function(b) {
|
|
1450
|
+
var g = function(w, v) {
|
|
1451
|
+
if (typeof w != "object" || !w) return w;
|
|
1452
|
+
var C = w[Symbol.toPrimitive];
|
|
1453
|
+
if (C !== void 0) {
|
|
1454
|
+
var k = C.call(w, v);
|
|
1455
|
+
if (typeof k != "object") return k;
|
|
1456
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1457
|
+
}
|
|
1458
|
+
return (v === "string" ? String : Number)(w);
|
|
1459
|
+
}(b, "string");
|
|
1460
|
+
return typeof g == "symbol" ? g : g + "";
|
|
1461
|
+
}(y)) in h ? Object.defineProperty(h, y, { value: x, enumerable: !0, configurable: !0, writable: !0 }) : h[y] = x, h;
|
|
1462
|
+
}
|
|
1463
|
+
class p extends i.Component {
|
|
1464
|
+
static getDerivedStateFromProps(y, x) {
|
|
1465
|
+
let { position: b } = y, { prevPropsPosition: g } = x;
|
|
1466
|
+
return !b || g && b.x === g.x && b.y === g.y ? null : ((0, s.default)("Draggable: getDerivedStateFromProps %j", { position: b, prevPropsPosition: g }), { x: b.x, y: b.y, prevPropsPosition: { ...b } });
|
|
1467
|
+
}
|
|
1468
|
+
constructor(y) {
|
|
1469
|
+
super(y), f(this, "onDragStart", (x, b) => {
|
|
1470
|
+
if ((0, s.default)("Draggable: onDragStart: %j", b), this.props.onStart(x, (0, c.createDraggableData)(this, b)) === !1) return !1;
|
|
1471
|
+
this.setState({ dragging: !0, dragged: !0 });
|
|
1472
|
+
}), f(this, "onDrag", (x, b) => {
|
|
1473
|
+
if (!this.state.dragging) return !1;
|
|
1474
|
+
(0, s.default)("Draggable: onDrag: %j", b);
|
|
1475
|
+
const g = (0, c.createDraggableData)(this, b), w = { x: g.x, y: g.y, slackX: 0, slackY: 0 };
|
|
1476
|
+
if (this.props.bounds) {
|
|
1477
|
+
const { x: v, y: C } = w;
|
|
1478
|
+
w.x += this.state.slackX, w.y += this.state.slackY;
|
|
1479
|
+
const [k, T] = (0, c.getBoundPosition)(this, w.x, w.y);
|
|
1480
|
+
w.x = k, w.y = T, w.slackX = this.state.slackX + (v - w.x), w.slackY = this.state.slackY + (C - w.y), g.x = w.x, g.y = w.y, g.deltaX = w.x - this.state.x, g.deltaY = w.y - this.state.y;
|
|
1481
|
+
}
|
|
1482
|
+
if (this.props.onDrag(x, g) === !1) return !1;
|
|
1483
|
+
this.setState(w);
|
|
1484
|
+
}), f(this, "onDragStop", (x, b) => {
|
|
1485
|
+
if (!this.state.dragging || this.props.onStop(x, (0, c.createDraggableData)(this, b)) === !1) return !1;
|
|
1486
|
+
(0, s.default)("Draggable: onDragStop: %j", b);
|
|
1487
|
+
const g = { dragging: !1, slackX: 0, slackY: 0 };
|
|
1488
|
+
if (this.props.position) {
|
|
1489
|
+
const { x: w, y: v } = this.props.position;
|
|
1490
|
+
g.x = w, g.y = v;
|
|
1491
|
+
}
|
|
1492
|
+
this.setState(g);
|
|
1493
|
+
}), 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.");
|
|
1494
|
+
}
|
|
1495
|
+
componentDidMount() {
|
|
1496
|
+
window.SVGElement !== void 0 && this.findDOMNode() instanceof window.SVGElement && this.setState({ isElementSVG: !0 });
|
|
1497
|
+
}
|
|
1498
|
+
componentWillUnmount() {
|
|
1499
|
+
this.state.dragging && this.setState({ dragging: !1 });
|
|
1500
|
+
}
|
|
1501
|
+
findDOMNode() {
|
|
1502
|
+
return this.props?.nodeRef?.current ?? t.default.findDOMNode(this);
|
|
1503
|
+
}
|
|
1504
|
+
render() {
|
|
1505
|
+
const { axis: y, bounds: x, children: b, defaultPosition: g, defaultClassName: w, defaultClassNameDragging: v, defaultClassNameDragged: C, position: k, positionOffset: T, scale: M, ...I } = this.props;
|
|
1506
|
+
let A = {}, P = null;
|
|
1507
|
+
const S = !k || this.state.dragging, N = k || g, L = { x: (0, c.canDragX)(this) && S ? this.state.x : N.x, y: (0, c.canDragY)(this) && S ? this.state.y : N.y };
|
|
1508
|
+
this.state.isElementSVG ? P = (0, l.createSVGTransform)(L, T) : A = (0, l.createCSSTransform)(L, T);
|
|
1509
|
+
const F = (0, n.clsx)(b.props.className || "", w, { [v]: this.state.dragging, [C]: this.state.dragged });
|
|
1510
|
+
return i.createElement(a.default, d({}, I, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }), i.cloneElement(i.Children.only(b), { className: F, style: { ...b.props.style, ...A }, transform: P }));
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
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 });
|
|
1514
|
+
}(ya)), ya;
|
|
1515
|
+
}
|
|
1516
|
+
function $i() {
|
|
1517
|
+
if (Ra) return uo.exports;
|
|
1518
|
+
Ra = 1;
|
|
1519
|
+
const { default: r, DraggableCore: i } = qp();
|
|
1520
|
+
return uo.exports = r, uo.exports.default = r, uo.exports.DraggableCore = i, uo.exports;
|
|
1521
|
+
}
|
|
1522
|
+
var Ma, qo = {};
|
|
1523
|
+
function Gp() {
|
|
1524
|
+
if (Ma) return qo;
|
|
1525
|
+
Ma = 1, qo.__esModule = !0, qo.cloneElement = function(l, c) {
|
|
1526
|
+
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);
|
|
1527
|
+
};
|
|
1528
|
+
var r, i = (r = le) && r.__esModule ? r : { default: r };
|
|
1529
|
+
function o(l, c) {
|
|
1530
|
+
var m = Object.keys(l);
|
|
1531
|
+
if (Object.getOwnPropertySymbols) {
|
|
1532
|
+
var a = Object.getOwnPropertySymbols(l);
|
|
1533
|
+
c && (a = a.filter(function(s) {
|
|
1534
|
+
return Object.getOwnPropertyDescriptor(l, s).enumerable;
|
|
1535
|
+
})), m.push.apply(m, a);
|
|
1536
|
+
}
|
|
1537
|
+
return m;
|
|
1538
|
+
}
|
|
1539
|
+
function t(l) {
|
|
1540
|
+
for (var c = 1; c < arguments.length; c++) {
|
|
1541
|
+
var m = arguments[c] != null ? arguments[c] : {};
|
|
1542
|
+
c % 2 ? o(Object(m), !0).forEach(function(a) {
|
|
1543
|
+
n(l, a, m[a]);
|
|
1544
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(l, Object.getOwnPropertyDescriptors(m)) : o(Object(m)).forEach(function(a) {
|
|
1545
|
+
Object.defineProperty(l, a, Object.getOwnPropertyDescriptor(m, a));
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
return l;
|
|
1549
|
+
}
|
|
1550
|
+
function n(l, c, m) {
|
|
1551
|
+
return (c = function(a) {
|
|
1552
|
+
var s = function(u, d) {
|
|
1553
|
+
if (typeof u != "object" || u === null) return u;
|
|
1554
|
+
var f = u[Symbol.toPrimitive];
|
|
1555
|
+
if (f !== void 0) {
|
|
1556
|
+
var p = f.call(u, d);
|
|
1557
|
+
if (typeof p != "object") return p;
|
|
1558
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1559
|
+
}
|
|
1560
|
+
return (d === "string" ? String : Number)(u);
|
|
1561
|
+
}(a, "string");
|
|
1562
|
+
return typeof s == "symbol" ? s : String(s);
|
|
1563
|
+
}(c)) in l ? Object.defineProperty(l, c, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : l[c] = m, l;
|
|
1564
|
+
}
|
|
1565
|
+
return qo;
|
|
1566
|
+
}
|
|
1567
|
+
var Na, Fa, ho = {};
|
|
1568
|
+
function _i() {
|
|
1569
|
+
if (Na) return ho;
|
|
1570
|
+
Na = 1, ho.__esModule = !0, ho.resizableProps = void 0;
|
|
1571
|
+
var r, i = (r = mn()) && r.__esModule ? r : { default: r };
|
|
1572
|
+
$i();
|
|
1573
|
+
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() {
|
|
1574
|
+
for (var t = arguments.length, n = new Array(t), l = 0; l < t; l++) n[l] = arguments[l];
|
|
1575
|
+
var c, m = n[0];
|
|
1576
|
+
return m.axis === "both" || m.axis === "y" ? (c = i.default.number).isRequired.apply(c, n) : i.default.number.apply(i.default, n);
|
|
1577
|
+
}, 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() {
|
|
1578
|
+
for (var t = arguments.length, n = new Array(t), l = 0; l < t; l++) n[l] = arguments[l];
|
|
1579
|
+
var c, m = n[0];
|
|
1580
|
+
return m.axis === "both" || m.axis === "x" ? (c = i.default.number).isRequired.apply(c, n) : i.default.number.apply(i.default, n);
|
|
1581
|
+
} };
|
|
1582
|
+
return ho.resizableProps = o, ho;
|
|
1583
|
+
}
|
|
1584
|
+
function Ui() {
|
|
1585
|
+
if (Fa) return po;
|
|
1586
|
+
Fa = 1, po.__esModule = !0, po.default = void 0;
|
|
1587
|
+
var r = function(f, p) {
|
|
1588
|
+
if (f && f.__esModule) return f;
|
|
1589
|
+
if (f === null || typeof f != "object" && typeof f != "function") return { default: f };
|
|
1590
|
+
var h = l(p);
|
|
1591
|
+
if (h && h.has(f)) return h.get(f);
|
|
1592
|
+
var y = {}, x = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
1593
|
+
for (var b in f) if (b !== "default" && Object.prototype.hasOwnProperty.call(f, b)) {
|
|
1594
|
+
var g = x ? Object.getOwnPropertyDescriptor(f, b) : null;
|
|
1595
|
+
g && (g.get || g.set) ? Object.defineProperty(y, b, g) : y[b] = f[b];
|
|
1596
|
+
}
|
|
1597
|
+
return y.default = f, h && h.set(f, y), y;
|
|
1598
|
+
}(le), i = $i(), o = Gp(), t = _i(), n = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
|
|
1599
|
+
function l(f) {
|
|
1600
|
+
if (typeof WeakMap != "function") return null;
|
|
1601
|
+
var p = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap();
|
|
1602
|
+
return (l = function(y) {
|
|
1603
|
+
return y ? h : p;
|
|
1604
|
+
})(f);
|
|
1605
|
+
}
|
|
1606
|
+
function c() {
|
|
1607
|
+
return c = Object.assign ? Object.assign.bind() : function(f) {
|
|
1608
|
+
for (var p = 1; p < arguments.length; p++) {
|
|
1609
|
+
var h = arguments[p];
|
|
1610
|
+
for (var y in h) Object.prototype.hasOwnProperty.call(h, y) && (f[y] = h[y]);
|
|
1611
|
+
}
|
|
1612
|
+
return f;
|
|
1613
|
+
}, c.apply(this, arguments);
|
|
1614
|
+
}
|
|
1615
|
+
function m(f, p) {
|
|
1616
|
+
var h = Object.keys(f);
|
|
1617
|
+
if (Object.getOwnPropertySymbols) {
|
|
1618
|
+
var y = Object.getOwnPropertySymbols(f);
|
|
1619
|
+
p && (y = y.filter(function(x) {
|
|
1620
|
+
return Object.getOwnPropertyDescriptor(f, x).enumerable;
|
|
1621
|
+
})), h.push.apply(h, y);
|
|
1622
|
+
}
|
|
1623
|
+
return h;
|
|
1624
|
+
}
|
|
1625
|
+
function a(f) {
|
|
1626
|
+
for (var p = 1; p < arguments.length; p++) {
|
|
1627
|
+
var h = arguments[p] != null ? arguments[p] : {};
|
|
1628
|
+
p % 2 ? m(Object(h), !0).forEach(function(y) {
|
|
1629
|
+
s(f, y, h[y]);
|
|
1630
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(f, Object.getOwnPropertyDescriptors(h)) : m(Object(h)).forEach(function(y) {
|
|
1631
|
+
Object.defineProperty(f, y, Object.getOwnPropertyDescriptor(h, y));
|
|
1632
|
+
});
|
|
1633
|
+
}
|
|
1634
|
+
return f;
|
|
1635
|
+
}
|
|
1636
|
+
function s(f, p, h) {
|
|
1637
|
+
return (p = function(y) {
|
|
1638
|
+
var x = function(b, g) {
|
|
1639
|
+
if (typeof b != "object" || b === null) return b;
|
|
1640
|
+
var w = b[Symbol.toPrimitive];
|
|
1641
|
+
if (w !== void 0) {
|
|
1642
|
+
var v = w.call(b, g);
|
|
1643
|
+
if (typeof v != "object") return v;
|
|
1644
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1645
|
+
}
|
|
1646
|
+
return (g === "string" ? String : Number)(b);
|
|
1647
|
+
}(y, "string");
|
|
1648
|
+
return typeof x == "symbol" ? x : String(x);
|
|
1649
|
+
}(p)) in f ? Object.defineProperty(f, p, { value: h, enumerable: !0, configurable: !0, writable: !0 }) : f[p] = h, f;
|
|
1650
|
+
}
|
|
1651
|
+
function u(f, p) {
|
|
1652
|
+
return u = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(h, y) {
|
|
1653
|
+
return h.__proto__ = y, h;
|
|
1654
|
+
}, u(f, p);
|
|
1655
|
+
}
|
|
1656
|
+
var d = function(f) {
|
|
1657
|
+
var p, h;
|
|
1658
|
+
function y() {
|
|
1659
|
+
for (var b, g = arguments.length, w = new Array(g), v = 0; v < g; v++) w[v] = arguments[v];
|
|
1660
|
+
return (b = f.call.apply(f, [this].concat(w)) || this).handleRefs = {}, b.lastHandleRect = null, b.slack = null, b;
|
|
1661
|
+
}
|
|
1662
|
+
h = f, (p = y).prototype = Object.create(h.prototype), p.prototype.constructor = p, u(p, h);
|
|
1663
|
+
var x = y.prototype;
|
|
1664
|
+
return x.componentWillUnmount = function() {
|
|
1665
|
+
this.resetData();
|
|
1666
|
+
}, x.resetData = function() {
|
|
1667
|
+
this.lastHandleRect = this.slack = null;
|
|
1668
|
+
}, x.runConstraints = function(b, g) {
|
|
1669
|
+
var w = this.props, v = w.minConstraints, C = w.maxConstraints, k = w.lockAspectRatio;
|
|
1670
|
+
if (!v && !C && !k) return [b, g];
|
|
1671
|
+
if (k) {
|
|
1672
|
+
var T = this.props.width / this.props.height, M = b - this.props.width, I = g - this.props.height;
|
|
1673
|
+
Math.abs(M) > Math.abs(I * T) ? g = b / T : b = g * T;
|
|
1674
|
+
}
|
|
1675
|
+
var A = b, P = g, S = this.slack || [0, 0], N = S[0], L = S[1];
|
|
1676
|
+
return b += N, g += L, v && (b = Math.max(v[0], b), g = Math.max(v[1], g)), C && (b = Math.min(C[0], b), g = Math.min(C[1], g)), this.slack = [N + (A - b), L + (P - g)], [b, g];
|
|
1677
|
+
}, x.resizeHandler = function(b, g) {
|
|
1678
|
+
var w = this;
|
|
1679
|
+
return function(v, C) {
|
|
1680
|
+
var k = C.node, T = C.deltaX, M = C.deltaY;
|
|
1681
|
+
b === "onResizeStart" && w.resetData();
|
|
1682
|
+
var I = (w.props.axis === "both" || w.props.axis === "x") && g !== "n" && g !== "s", A = (w.props.axis === "both" || w.props.axis === "y") && g !== "e" && g !== "w";
|
|
1683
|
+
if (I || A) {
|
|
1684
|
+
var P = g[0], S = g[g.length - 1], N = k.getBoundingClientRect();
|
|
1685
|
+
w.lastHandleRect != null && (S === "w" && (T += N.left - w.lastHandleRect.left), P === "n" && (M += N.top - w.lastHandleRect.top)), w.lastHandleRect = N, S === "w" && (T = -T), P === "n" && (M = -M);
|
|
1686
|
+
var L = w.props.width + (I ? T / w.props.transformScale : 0), F = w.props.height + (A ? M / w.props.transformScale : 0), z = w.runConstraints(L, F);
|
|
1687
|
+
L = z[0], F = z[1];
|
|
1688
|
+
var R = L !== w.props.width || F !== w.props.height, E = typeof w.props[b] == "function" ? w.props[b] : null;
|
|
1689
|
+
E && !(b === "onResize" && !R) && (v.persist == null || v.persist(), E(v, { node: k, size: { width: L, height: F }, handle: g })), b === "onResizeStop" && w.resetData();
|
|
1690
|
+
}
|
|
1691
|
+
};
|
|
1692
|
+
}, x.renderResizeHandle = function(b, g) {
|
|
1693
|
+
var w = this.props.handle;
|
|
1694
|
+
if (!w) return r.createElement("span", { className: "react-resizable-handle react-resizable-handle-" + b, ref: g });
|
|
1695
|
+
if (typeof w == "function") return w(b, g);
|
|
1696
|
+
var v = a({ ref: g }, typeof w.type == "string" ? {} : { handleAxis: b });
|
|
1697
|
+
return r.cloneElement(w, v);
|
|
1698
|
+
}, x.render = function() {
|
|
1699
|
+
var b = this, g = this.props, w = g.children, v = g.className, C = g.draggableOpts;
|
|
1700
|
+
g.width, g.height, g.handle, g.handleSize, g.lockAspectRatio, g.axis, g.minConstraints, g.maxConstraints, g.onResize, g.onResizeStop, g.onResizeStart;
|
|
1701
|
+
var k = g.resizeHandles;
|
|
1702
|
+
g.transformScale;
|
|
1703
|
+
var T = function(M, I) {
|
|
1704
|
+
if (M == null) return {};
|
|
1705
|
+
var A, P, S = {}, N = Object.keys(M);
|
|
1706
|
+
for (P = 0; P < N.length; P++) A = N[P], I.indexOf(A) >= 0 || (S[A] = M[A]);
|
|
1707
|
+
return S;
|
|
1708
|
+
}(g, n);
|
|
1709
|
+
return (0, o.cloneElement)(w, a(a({}, T), {}, { className: (v ? v + " " : "") + "react-resizable", children: [].concat(w.props.children, k.map(function(M) {
|
|
1710
|
+
var I, A = (I = b.handleRefs[M]) != null ? I : b.handleRefs[M] = r.createRef();
|
|
1711
|
+
return r.createElement(i.DraggableCore, c({}, C, { nodeRef: A, key: "resizableHandle-" + M, onStop: b.resizeHandler("onResizeStop", M), onStart: b.resizeHandler("onResizeStart", M), onDrag: b.resizeHandler("onResize", M) }), b.renderResizeHandle(M, A));
|
|
1712
|
+
})) }));
|
|
1713
|
+
}, y;
|
|
1714
|
+
}(r.Component);
|
|
1715
|
+
return po.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 }, po;
|
|
1716
|
+
}
|
|
1717
|
+
var Ia, Oa, go = {};
|
|
1718
|
+
function Xp() {
|
|
1719
|
+
if (Ia) return go;
|
|
1720
|
+
Ia = 1, go.__esModule = !0, go.default = void 0;
|
|
1721
|
+
var r = function(p, h) {
|
|
1722
|
+
if (p && p.__esModule) return p;
|
|
1723
|
+
if (p === null || typeof p != "object" && typeof p != "function") return { default: p };
|
|
1724
|
+
var y = c(h);
|
|
1725
|
+
if (y && y.has(p)) return y.get(p);
|
|
1726
|
+
var x = {}, b = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
1727
|
+
for (var g in p) if (g !== "default" && Object.prototype.hasOwnProperty.call(p, g)) {
|
|
1728
|
+
var w = b ? Object.getOwnPropertyDescriptor(p, g) : null;
|
|
1729
|
+
w && (w.get || w.set) ? Object.defineProperty(x, g, w) : x[g] = p[g];
|
|
1730
|
+
}
|
|
1731
|
+
return x.default = p, y && y.set(p, x), x;
|
|
1732
|
+
}(le), i = l(mn()), o = l(Ui()), t = _i(), n = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
|
|
1733
|
+
function l(p) {
|
|
1734
|
+
return p && p.__esModule ? p : { default: p };
|
|
1735
|
+
}
|
|
1736
|
+
function c(p) {
|
|
1737
|
+
if (typeof WeakMap != "function") return null;
|
|
1738
|
+
var h = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap();
|
|
1739
|
+
return (c = function(x) {
|
|
1740
|
+
return x ? y : h;
|
|
1741
|
+
})(p);
|
|
1742
|
+
}
|
|
1743
|
+
function m() {
|
|
1744
|
+
return m = Object.assign ? Object.assign.bind() : function(p) {
|
|
1745
|
+
for (var h = 1; h < arguments.length; h++) {
|
|
1746
|
+
var y = arguments[h];
|
|
1747
|
+
for (var x in y) Object.prototype.hasOwnProperty.call(y, x) && (p[x] = y[x]);
|
|
1748
|
+
}
|
|
1749
|
+
return p;
|
|
1750
|
+
}, m.apply(this, arguments);
|
|
1751
|
+
}
|
|
1752
|
+
function a(p, h) {
|
|
1753
|
+
var y = Object.keys(p);
|
|
1754
|
+
if (Object.getOwnPropertySymbols) {
|
|
1755
|
+
var x = Object.getOwnPropertySymbols(p);
|
|
1756
|
+
h && (x = x.filter(function(b) {
|
|
1757
|
+
return Object.getOwnPropertyDescriptor(p, b).enumerable;
|
|
1758
|
+
})), y.push.apply(y, x);
|
|
1759
|
+
}
|
|
1760
|
+
return y;
|
|
1761
|
+
}
|
|
1762
|
+
function s(p) {
|
|
1763
|
+
for (var h = 1; h < arguments.length; h++) {
|
|
1764
|
+
var y = arguments[h] != null ? arguments[h] : {};
|
|
1765
|
+
h % 2 ? a(Object(y), !0).forEach(function(x) {
|
|
1766
|
+
u(p, x, y[x]);
|
|
1767
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(p, Object.getOwnPropertyDescriptors(y)) : a(Object(y)).forEach(function(x) {
|
|
1768
|
+
Object.defineProperty(p, x, Object.getOwnPropertyDescriptor(y, x));
|
|
1769
|
+
});
|
|
1770
|
+
}
|
|
1771
|
+
return p;
|
|
1772
|
+
}
|
|
1773
|
+
function u(p, h, y) {
|
|
1774
|
+
return (h = function(x) {
|
|
1775
|
+
var b = function(g, w) {
|
|
1776
|
+
if (typeof g != "object" || g === null) return g;
|
|
1777
|
+
var v = g[Symbol.toPrimitive];
|
|
1778
|
+
if (v !== void 0) {
|
|
1779
|
+
var C = v.call(g, w);
|
|
1780
|
+
if (typeof C != "object") return C;
|
|
1781
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1782
|
+
}
|
|
1783
|
+
return (w === "string" ? String : Number)(g);
|
|
1784
|
+
}(x, "string");
|
|
1785
|
+
return typeof b == "symbol" ? b : String(b);
|
|
1786
|
+
}(h)) in p ? Object.defineProperty(p, h, { value: y, enumerable: !0, configurable: !0, writable: !0 }) : p[h] = y, p;
|
|
1787
|
+
}
|
|
1788
|
+
function d(p, h) {
|
|
1789
|
+
return d = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(y, x) {
|
|
1790
|
+
return y.__proto__ = x, y;
|
|
1791
|
+
}, d(p, h);
|
|
1792
|
+
}
|
|
1793
|
+
var f = function(p) {
|
|
1794
|
+
var h, y;
|
|
1795
|
+
function x() {
|
|
1796
|
+
for (var b, g = arguments.length, w = new Array(g), v = 0; v < g; v++) w[v] = arguments[v];
|
|
1797
|
+
return (b = p.call.apply(p, [this].concat(w)) || this).state = { width: b.props.width, height: b.props.height, propsWidth: b.props.width, propsHeight: b.props.height }, b.onResize = function(C, k) {
|
|
1798
|
+
var T = k.size;
|
|
1799
|
+
b.props.onResize ? (C.persist == null || C.persist(), b.setState(T, function() {
|
|
1800
|
+
return b.props.onResize && b.props.onResize(C, k);
|
|
1801
|
+
})) : b.setState(T);
|
|
1802
|
+
}, b;
|
|
1803
|
+
}
|
|
1804
|
+
return y = p, (h = x).prototype = Object.create(y.prototype), h.prototype.constructor = h, d(h, y), x.getDerivedStateFromProps = function(b, g) {
|
|
1805
|
+
return g.propsWidth !== b.width || g.propsHeight !== b.height ? { width: b.width, height: b.height, propsWidth: b.width, propsHeight: b.height } : null;
|
|
1806
|
+
}, x.prototype.render = function() {
|
|
1807
|
+
var b = this.props, g = b.handle, w = b.handleSize;
|
|
1808
|
+
b.onResize;
|
|
1809
|
+
var v = b.onResizeStart, C = b.onResizeStop, k = b.draggableOpts, T = b.minConstraints, M = b.maxConstraints, I = b.lockAspectRatio, A = b.axis;
|
|
1810
|
+
b.width, b.height;
|
|
1811
|
+
var P = b.resizeHandles, S = b.style, N = b.transformScale, L = function(F, z) {
|
|
1812
|
+
if (F == null) return {};
|
|
1813
|
+
var R, E, K = {}, ee = Object.keys(F);
|
|
1814
|
+
for (E = 0; E < ee.length; E++) R = ee[E], z.indexOf(R) >= 0 || (K[R] = F[R]);
|
|
1815
|
+
return K;
|
|
1816
|
+
}(b, n);
|
|
1817
|
+
return r.createElement(o.default, { axis: A, draggableOpts: k, handle: g, handleSize: w, height: this.state.height, lockAspectRatio: I, maxConstraints: M, minConstraints: T, onResizeStart: v, onResize: this.onResize, onResizeStop: C, resizeHandles: P, 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" }) })));
|
|
1818
|
+
}, x;
|
|
1819
|
+
}(r.Component);
|
|
1820
|
+
return go.default = f, f.propTypes = s(s({}, t.resizableProps), {}, { children: i.default.element }), go;
|
|
1821
|
+
}
|
|
1822
|
+
var Kp = (Oa || (Oa = 1, $o.exports = function() {
|
|
1823
|
+
throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
|
|
1824
|
+
}, $o.exports.Resizable = Ui().default, $o.exports.ResizableBox = Xp().default), $o.exports);
|
|
1825
|
+
function Dn(r, i) {
|
|
1826
|
+
if (typeof r == "function") return r(i);
|
|
1827
|
+
r && (r.current = i);
|
|
1828
|
+
}
|
|
1829
|
+
var Fo = parseInt(hs.split(".")[0], 10) >= 19 ? function(r) {
|
|
1830
|
+
return (i) => {
|
|
1831
|
+
const o = [];
|
|
1832
|
+
for (const t of r) {
|
|
1833
|
+
const n = Dn(t, i), l = typeof n == "function";
|
|
1834
|
+
o.push(l ? n : () => Dn(t, null));
|
|
1835
|
+
}
|
|
1836
|
+
return () => {
|
|
1837
|
+
for (const t of o) t();
|
|
1838
|
+
};
|
|
1839
|
+
};
|
|
1840
|
+
} : function(r) {
|
|
1841
|
+
return (i) => {
|
|
1842
|
+
for (const o of r) Dn(o, i);
|
|
1843
|
+
};
|
|
1844
|
+
};
|
|
1845
|
+
const qi = Y(J((r, i) => {
|
|
1846
|
+
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] = _(null), [h, y] = _(() => n.getSelectedRanges().getCoords()), [x, b] = _(!1), { reference: g } = oo({ parentFloat: a?.parentFloat }), [w, v] = _(() => c || !n.getProtection().isStructureAllowed()), C = () => f?.text ?? "", [k, T] = _(C), M = te(() => {
|
|
1847
|
+
if (g?.closeAll(), !k) {
|
|
1848
|
+
const U = C();
|
|
1849
|
+
return T(C()), U;
|
|
1850
|
+
}
|
|
1851
|
+
if (C() === k) return k;
|
|
1852
|
+
const G = k.trim().toLowerCase();
|
|
1853
|
+
if (G === "r" || G === "c") return k;
|
|
1854
|
+
try {
|
|
1855
|
+
const U = n.getRanges(k);
|
|
1856
|
+
if (U) return U.toString();
|
|
1857
|
+
} catch {
|
|
1858
|
+
}
|
|
1859
|
+
const Z = t.getByName(k);
|
|
1860
|
+
if (Z && Z.getRanges()) return k;
|
|
1861
|
+
let ge = null;
|
|
1862
|
+
try {
|
|
1863
|
+
const U = n.getRanges(k), V = U.getCoords().map((Q) => ({ $colEnd: !0, $rowEnd: !0, $colStart: !0, $rowStart: !0, ...Q }));
|
|
1864
|
+
ge = n.getRanges(V);
|
|
1865
|
+
} catch {
|
|
1866
|
+
}
|
|
1867
|
+
if (!ge) {
|
|
1868
|
+
const U = n.getSelectedRanges().getCoords().map((V) => ({ $colEnd: !0, $rowEnd: !0, $colStart: !0, $rowStart: !0, ...V }));
|
|
1869
|
+
ge = n.getRanges(U);
|
|
1870
|
+
}
|
|
1871
|
+
try {
|
|
1872
|
+
let U = t.getByName(k);
|
|
1873
|
+
w || U || (U = t.addReference(k, ge)), U && p({ text: U.getName() });
|
|
1874
|
+
} catch (U) {
|
|
1875
|
+
T(C()), u.showMessage?.(U.message, { type: wt.Error });
|
|
1876
|
+
}
|
|
1877
|
+
return null;
|
|
1878
|
+
}, [k, t, g, w]), I = te(() => {
|
|
1879
|
+
if (n.isClosed()) return;
|
|
1880
|
+
const G = [];
|
|
1881
|
+
for (let U = 0; U < h.length; U++) {
|
|
1882
|
+
const V = h[U];
|
|
1883
|
+
G.push({ $colEnd: !0, $rowEnd: !0, $colStart: !0, $rowStart: !0, ...V });
|
|
1884
|
+
}
|
|
1885
|
+
let Z = null;
|
|
1886
|
+
try {
|
|
1887
|
+
Z = t.lookupByRanges(G);
|
|
1888
|
+
} catch {
|
|
1889
|
+
}
|
|
1890
|
+
let ge = null;
|
|
1891
|
+
ge = Z?.length > 0 ? Z[0].getName() : n.getSelectedSheet().getSelectedRange().toString(), p({ text: ge });
|
|
1892
|
+
}, [n, h]), [A, P] = _(() => t?.search() ?? null);
|
|
1893
|
+
qe(t, { onCollectionChange(G) {
|
|
1894
|
+
P(t.search()), I();
|
|
1895
|
+
}, onClose(G) {
|
|
1896
|
+
P([]);
|
|
1897
|
+
} }), he(() => {
|
|
1898
|
+
T(C());
|
|
1899
|
+
}, [f, h]);
|
|
1900
|
+
const [S, N] = _(n?.getSelectedSheet());
|
|
1901
|
+
qe(n, { onProtectionChange: (G) => {
|
|
1902
|
+
v(c || !G.getProtection().isStructureAllowed());
|
|
1903
|
+
}, onSheetsChange: (G) => {
|
|
1904
|
+
N(G?.getSelectedSheet());
|
|
1905
|
+
}, onViewChange(G) {
|
|
1906
|
+
N(G?.getSelectedSheet());
|
|
1907
|
+
} });
|
|
1908
|
+
const [L, F] = _(null), z = te(Ze.debounce(I, L ? 320 : 0), []);
|
|
1909
|
+
qe(S.getSelection(), { onChange: () => {
|
|
1910
|
+
y((G) => {
|
|
1911
|
+
const Z = n.getSelectedRanges().getCoords();
|
|
1912
|
+
return ps.isEqualRangesArrays(Z, G) ? G : Z;
|
|
1913
|
+
});
|
|
1914
|
+
}, onAdjustingChange: (G) => {
|
|
1915
|
+
F(G.getAdjusting());
|
|
1916
|
+
} }), he(() => {
|
|
1917
|
+
if (L) {
|
|
1918
|
+
const G = n.getSelectedRange(), Z = G.getRowCount(), ge = G.getColumnCount();
|
|
1919
|
+
let U = `${Z}R x ${ge}C`;
|
|
1920
|
+
if (U.length > 17 && (U = `${Z}x${ge}`), Z > 1 || ge > 1) return void p({ text: U, fontStyle: "italic", justifyContent: "center" });
|
|
1921
|
+
}
|
|
1922
|
+
p({ text: n.getSelectedSheet().getSelectedRange().toString() }), z();
|
|
1923
|
+
}, [h, n, L]);
|
|
1924
|
+
const R = Se(null), E = q((G) => {
|
|
1925
|
+
const { onMouseDown: Z, onMouseUp: ge, ...U } = G;
|
|
1926
|
+
return e(ct, { ...U, sx: { ...U?.sx, display: "flex", flex: "1 1 100%" }, disableRipple: !0, children: e(ar, { inputMode: "text", inputProps: { tabIndex: 0, name: "input-named-range", maxLength: 255, className: "input", autoFocus: !1, spellCheck: !1, autoComplete: "off", ref: R }, sx: { "&::before": { borderBottom: "1px solid transparent" }, "&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before": { borderBottom: (V) => `1px solid ${V.palette.text.icon ?? V.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (V) => `1px solid ${V.palette.primary.main}` }, "::after": { borderBottom: (V) => `1px solid ${V.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", fontSize: 11 * Bt.getDeviceScale(), fontStyle: f?.fontStyle, paddingLeft: (V) => V.spacing(0.75), paddingRight: (V) => V.spacing(0.75), boxShadow: "none", flex: "1", color: (V) => V.palette.text.secondary, input: { padding: "0", textAlign: "left", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (V) => V.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (V) => V.palette.text.primary } } }, value: k, onFocus: (V) => {
|
|
1927
|
+
V.target?.select();
|
|
1928
|
+
}, onKeyDown: (V) => {
|
|
1929
|
+
if (V.which === we.Enter || V.which === we.Tab) {
|
|
1930
|
+
let Q = k;
|
|
1931
|
+
C() !== k && (V.stopPropagation(), V.preventDefault(), Q = M()), Q ? K(Q) : l?.();
|
|
1932
|
+
} else if (V.which === we.Escape) C() !== k ? (T(C()), setTimeout(() => {
|
|
1933
|
+
V.target?.select();
|
|
1934
|
+
}, 0), V.stopPropagation(), V.preventDefault()) : l?.();
|
|
1935
|
+
else if (V.which === we.Space) return void V.stopPropagation();
|
|
1936
|
+
}, onBlur: () => {
|
|
1937
|
+
T(C());
|
|
1938
|
+
}, onChange: (V) => {
|
|
1939
|
+
T(V.target.value);
|
|
1940
|
+
} }) });
|
|
1941
|
+
}, [k, f]), K = te(async (G) => {
|
|
1942
|
+
try {
|
|
1943
|
+
g?.closeAll();
|
|
1944
|
+
const Z = t.lookupByRanges(G)?.[0];
|
|
1945
|
+
Z && await Z?.select(), await n.getRanges(G)?.select();
|
|
1946
|
+
} catch (Z) {
|
|
1947
|
+
u.showMessage?.(Z.message, { type: wt.Error });
|
|
1948
|
+
}
|
|
1949
|
+
}, [t, u, n]), ee = q((G) => {
|
|
1950
|
+
setTimeout(() => {
|
|
1951
|
+
b(!0);
|
|
1952
|
+
}, 0);
|
|
1953
|
+
const Z = { variant: ie.Menuitem, parentFloat: G.floatReference, commandHook: { ...a?.commandHook, beforeExecute: (Fe, Ie) => (g?.closeAll(), a?.commandHook?.beforeExecute?.(Fe, Ie)) }, scope: a?.scope, commands: a?.commands };
|
|
1954
|
+
let ge = t.search({ scope: n?.getSelectedSheet().getName() });
|
|
1955
|
+
ge = ge.sort((Fe, Ie) => Fe.getType() === Ie.getType() ? Fe.getName().localeCompare(Ie.getName()) : Fe.getType() === "range" ? -1 : 1);
|
|
1956
|
+
const U = w ? null : ["editNamedReference", "deleteNamedReference"], V = w ? null : ["editTable", null, "convertTableToRange", "deleteTable"], Q = [], me = ge.length;
|
|
1957
|
+
for (let Fe = 0; Fe < me; Fe++) {
|
|
1958
|
+
const Ie = ge[Fe], Pe = Ie.getRanges();
|
|
1959
|
+
if (!Pe || Ie.isHidden()) continue;
|
|
1960
|
+
const He = Ie.getType();
|
|
1961
|
+
He !== ge[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: Ie.getType() === "reference" ? "Ranges" : "Tables" }, `type-header-${Q.length}`))), He === "reference" ? Q.push(Ee(st, { ...Z, key: "named-" + Q.length, popupCommandKeys: U, popupScope: "namedItem", scope: "namedItem", commandState: Ie, commands: a?.commands, label: Ie.getName(), quickCommand: "selectNamed", disabled: !Ie.getRanges() || m, icon: (Ne) => {
|
|
1962
|
+
switch (Ne.key()) {
|
|
1963
|
+
case "editNamedReference":
|
|
1964
|
+
return D(e(Rc, {}));
|
|
1965
|
+
case "deleteNamedReference":
|
|
1966
|
+
return D(e(Pc, {}));
|
|
1967
|
+
default:
|
|
1968
|
+
return D(e(Dc, {}));
|
|
1969
|
+
}
|
|
1970
|
+
} })) : He === "table" && Q.push(Ee(st, { ...Z, key: "namedItem-" + Q.length, popupCommandKeys: V, popupScope: "namedItem", scope: "namedItem", commands: a?.commands, commandState: Ie, label: Ie.getName(), quickCommand: "selectNamed", disabled: !Pe || m, icon: (Ne) => (Ne.key(), D(e(an, {}))) }));
|
|
1971
|
+
}
|
|
1972
|
+
const Le = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...d, children: [w ? null : e(O, { ...Z, scope: "namedItem", command: a?.commands.getCommand("addNamedReference"), icon: D(e(Mc, {})) }), Q && Q.length > 0 ? j(ce, { children: [w ? null : e(re, { orientation: "horizontal" }), e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: Q })] }) : null] });
|
|
1973
|
+
return Ce({ ...G, children: Le });
|
|
1974
|
+
}, [n, A, t, f, w]), X = zt(i, () => ({ focus(G) {
|
|
1975
|
+
R.current?.focus(G);
|
|
1976
|
+
} }), []);
|
|
1977
|
+
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: (G) => G.palette.background.paper, backgroundImage: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})` } }, tabIndex: -1, outlined: { color: (G) => o ? G.palette.action.disabled : fe(G.palette.divider, 0.2) }, parentFloat: g, createPopupPanel: ee, onPopupOpen: () => b(!0), onPopupClose: () => b(!1), createTooltip: ({ children: G }, Z) => e(nt, { title: Z || x ? "" : "Name Box", disabled: Z, leaveDelay: 0, sx: { opacity: Z || x ? 0 : 1 }, children: G }), createQuickButton: E }) });
|
|
1978
|
+
}));
|
|
1979
|
+
qi.displayName = "NamedCollectionEditor";
|
|
1980
|
+
const Yp = (r, i) => e(qi, { ref: i, ...r }), Gi = Y(J((r, i) => {
|
|
1981
|
+
const { sx: o, workbook: t, sheetElement: n, gridStyle: l, showNamedCollectionEditor: c = !0, NamedCollectionEditorProps: m, renderNamedCollectionEditor: a = Yp, disabled: s, commands: u, ...d } = r, [f, p] = _(t?.getSelectedSheet());
|
|
1982
|
+
qe(t, { onSheetsChange: (V) => {
|
|
1983
|
+
p(V?.getSelectedSheet());
|
|
1984
|
+
}, onViewChange(V) {
|
|
1985
|
+
p(V?.getSelectedSheet());
|
|
1986
|
+
} });
|
|
1987
|
+
const [h, y] = _(f.getSelection().getCoords().cell), x = f.getRange(h).getCell(), b = s || !x.isEditAllowed(), g = Se(null), w = W(() => ({ fontSize: 11 }), []);
|
|
1988
|
+
qe(f.getSelection(), { onChange: () => {
|
|
1989
|
+
y(f.getSelection().getCoords().cell);
|
|
1990
|
+
} }), qe(f, { onProtectionChange() {
|
|
1991
|
+
y(f.getSelection().getCoords().cell);
|
|
1992
|
+
} });
|
|
1993
|
+
const v = g.current?.getLineHeight() ?? 20, [C, k] = _(v), [T, M] = _(5), [I, A] = _(1), P = te((V, { size: Q }) => {
|
|
1994
|
+
V.preventDefault(), V.stopPropagation();
|
|
1995
|
+
const me = Math.floor(Q.height / v);
|
|
1996
|
+
k(me * v + 1), me > 1 && M(me);
|
|
1997
|
+
}, [v]), S = te((V, { size: Q }) => {
|
|
1998
|
+
const me = Math.floor(Q.height / v);
|
|
1999
|
+
A(me);
|
|
2000
|
+
}, [v]), N = un(), L = N.getMode();
|
|
2001
|
+
let F = null;
|
|
2002
|
+
L?.key === "edit" && (F = L.args?.stateAndCoords);
|
|
2003
|
+
const z = W(() => {
|
|
2004
|
+
let V = F?.editState;
|
|
2005
|
+
return V || (V = $d(() => f.getRange(h).getCell())), e(B, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", gap: 4 }, children: e(_d, { ref: g, activeCoords: h, sheet: f, onFocus: () => {
|
|
2006
|
+
n?.startEdit({ autoFocus: !1, editMode: !0, cell: h });
|
|
2007
|
+
}, defaultTextStyle: w, useRichStyling: !1, disabled: b, onChangeEdit: (Q) => {
|
|
2008
|
+
if (Q.dirty !== void 0) {
|
|
2009
|
+
const me = { sheet: f, coords: h, editState: Q };
|
|
2010
|
+
N.setMode((Le) => ({ ...Le, args: { ...Le?.args, stateAndCoords: me } }));
|
|
2011
|
+
}
|
|
2012
|
+
}, editState: V, commands: u, onCancelEdit: () => {
|
|
2013
|
+
n?.cancelEdit(), n?.focus();
|
|
2014
|
+
}, onSubmitEdit: () => {
|
|
2015
|
+
n?.submitEdit(), n?.focus();
|
|
2016
|
+
}, linesVisible: I }) });
|
|
2017
|
+
}, [f, F, h, I, n]), R = Se(null), E = W(() => c ? a({ names: t.getNames(), workbook: t, ...m }, R) : null, [a, m, c, f, t, b]), K = W(() => j(Do, { elevation: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 0, backgroundImage: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})`, border: (V) => `solid ${b ? V.palette.action.disabled : fe(V.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: D(e(Nc, {})), tooltipProps: { label: "Cancel", simple: !0 }, disabled: b || F === null, onMouseDown: (V) => {
|
|
2018
|
+
V.button === 0 && V.preventDefault();
|
|
2019
|
+
}, onClick: () => {
|
|
2020
|
+
n.cancelEdit();
|
|
2021
|
+
} }), 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: D(e(Fc, {})), tooltipProps: { label: "Enter", simple: !0 }, disabled: b || F === null, onMouseDown: (V) => {
|
|
2022
|
+
V.button === 0 && V.preventDefault();
|
|
2023
|
+
}, onClick: () => {
|
|
2024
|
+
n.submitEdit();
|
|
2025
|
+
} }), 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: D(e(Ic, { sx: { transform: "scale(0.85)" } })), tooltipProps: { label: "Insert Function", simple: !0 }, onMouseDown: (V) => {
|
|
2026
|
+
V.button === 0 && V.preventDefault();
|
|
2027
|
+
} })] }), [b, F]), ee = rt(), [X, G] = _(!1), Z = W(() => j(B, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", gap: (V) => V.spacing(0.5), alignItems: "start" }, children: [K, j(Do, { elevation: 0, sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", fontFamily: (V) => V.typography.fontFamily, fontSize: 11 * Bt.getDeviceScale(), "& .editor-placement": { top: "2px !important" }, boxShadow: "none", borderRadius: (V) => `${V.shape.borderRadius}px`, backgroundImage: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})`, border: (V) => `solid ${b ? V.palette.action.disabled : fe(V.palette.divider, 0.2)} 1px`, "& textarea": { color: (V) => b ? `${V.palette.text.disabled} !important` : V.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: () => G(!0), onBlur: () => G(!1), onMouseDown: (V) => {
|
|
2028
|
+
V.target?.classList.contains("react-resizable-handle") && V.preventDefault();
|
|
2029
|
+
}, children: [e(B, { className: "formula-editor", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", alignSelf: "baseline", paddingLeft: (V) => V.spacing(1), paddingRight: (V) => V.spacing(1) }, children: e(Kp.ResizableBox, { height: C, draggableOpts: { grid: [v, v] }, minConstraints: [v, v], maxConstraints: [15 * v, 15 * v], onResize: S, onResizeStop: P, resizeHandles: ["s"], axis: "y", style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: z }) }), 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: D(e(I > 1 ? Id : Si, {})), tooltipProps: { label: (I > 1 ? "Collapse" : "Expand") + " Formula Bar", simple: !0 }, onMouseDown: (V) => {
|
|
2030
|
+
V.button === 0 && V.preventDefault();
|
|
2031
|
+
}, onClick: () => {
|
|
2032
|
+
const V = I > 1 ? 1 : T;
|
|
2033
|
+
k(V * v + 1), A(V);
|
|
2034
|
+
} }), 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: (V) => V.palette.primary.main, borderRadius: (V) => `${V.shape.borderRadius}px` } })] })] }), [K, z, X, I, v]), ge = W(() => E || Z ? !E && Z ? Z : E && !Z ? E : e(ce, { children: e(Un, { 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='${ee.palette.text.icon ?? ee.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: Z }) }) : null, [E, Z]), U = zt(i, () => ({ isFormulaBarElement: () => !0, getNamedCollectionEditorElement: () => R.current }), []);
|
|
2035
|
+
return e(B, { sx: { display: "flex", flexDirection: "row", gap: (V) => V.spacing(0.5), ...o }, ref: U, ...d, children: ge });
|
|
2036
|
+
}));
|
|
2037
|
+
Gi.displayName = "FormulaBar";
|
|
2038
|
+
const Xi = Y(J((r, i) => {
|
|
2039
|
+
const { filter: o, commands: t, disabled: n, sx: l, floatReference: c, ...m } = r, a = W(() => ({}), []), s = W(() => ({ commandHook: { beforeExecute: (f, p) => c.closeAll(), onExecute() {
|
|
2040
|
+
}, onError() {
|
|
2041
|
+
console.log("onError");
|
|
2042
|
+
} }, disabled: n, parentFloat: c }), [n, c]), u = W(() => ({ ...a, ...s, variant: ie.Menuitem }), [a, s]), d = j(ce, { children: [e(O, { ...u, command: t.getCommand("sortAscending"), icon: D(e(jn, {})) }), e(O, { ...u, command: t.getCommand("sortDescending"), icon: D(e(hi, {})) }), e(re, { orientation: "horizontal" }), e(O, { ...u, command: t.getCommand("autoFilterClear"), icon: D(e(dr, {})) }), []] });
|
|
2043
|
+
return e(B, { ref: i, sx: { paddingTop: "4px", paddingBottom: "4px", display: "flex", flexDirection: "column", ...l }, ...m, children: d });
|
|
2044
|
+
}));
|
|
2045
|
+
Xi.displayName = "FilterColumnMenu";
|
|
2046
|
+
const Zp = Y(J((r, i) => {
|
|
2047
|
+
const { children: o, className: t, disabled: n, style: l, filter: c, ...m } = r, a = zt(i, () => ({ isFilters: () => !0 }), []);
|
|
2048
|
+
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" })] }) });
|
|
2049
|
+
}));
|
|
2050
|
+
Zp.displayName = "Filters";
|
|
2051
|
+
const Ki = Y(J((r, i) => {
|
|
2052
|
+
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: h, activeColor: y, background: x = "white", tabRadius: b = 4, gridTheme: g, ...w } = r, [v, C] = _(() => !!t && t.getProtection().isLocked()), [k, T] = _(() => t ? t.getTabColor() : null);
|
|
2053
|
+
qe(t, { onProtectionChange: () => {
|
|
2054
|
+
C(t.getProtection().isLocked());
|
|
2055
|
+
}, onTabColorChange: () => {
|
|
2056
|
+
T(t.getTabColor());
|
|
2057
|
+
}, onStyleChange: () => {
|
|
2058
|
+
T(t.getTabColor());
|
|
2059
|
+
} });
|
|
2060
|
+
const M = rt(), I = d === m;
|
|
2061
|
+
let A = null, P = null;
|
|
2062
|
+
if (k || f) {
|
|
2063
|
+
let L = x;
|
|
2064
|
+
k ? (P = 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: (F) => I ? `${x} solid 1px` : `${F.palette.divider} solid 1px`, background: I && k ? `linear-gradient(0deg, ${L} 0%, transparent)` : L } });
|
|
2065
|
+
}
|
|
2066
|
+
let S = null;
|
|
2067
|
+
typeof p == "string" ? S = p : p?.toCSS && (S = p.toCSS());
|
|
2068
|
+
const N = I ? e(B, { sx: { width: "100%", borderRadius: "4px", minWidth: "4px", height: "2px", backgroundColor: (L) => L.palette.primary.main } }) : null;
|
|
2069
|
+
return e(ki, { theme: I ? g ?? 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(Hd, { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, radius: b, 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" : P || "text.secondary", backgroundColor: I ? x : "transparent", "&:hover:not([disabled])": { backgroundColor: I ? x : "transparent" }, "& input": { color: (L) => `${L.palette.text.primary}`, textAlign: "center", fontWeight: "500" }, marginTop: "0px", minWidth: "unset" }, disabled: u, disableRipple: a, component: "div", children: j(ce, { 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) }) }) });
|
|
2070
|
+
}));
|
|
2071
|
+
Ki.displayName = "SheetTab";
|
|
2072
|
+
const Yi = Y(J((r, i) => {
|
|
2073
|
+
const { workbook: o, index: t, commands: n, scope: l = "sheet", disabled: c, floatReference: m, sx: a, className: s, tabStripRef: u, ...d } = r, [f, p] = _(o?.getProtection());
|
|
2074
|
+
qe(o, { onProtectionChange: (g) => {
|
|
2075
|
+
p(g?.getProtection());
|
|
2076
|
+
} });
|
|
2077
|
+
const h = W(() => ({}), []), y = W(() => ({ commandHook: { beforeExecute: (g, w) => m.closeAll(), onExecute() {
|
|
2078
|
+
}, onError() {
|
|
2079
|
+
console.log("onError");
|
|
2080
|
+
} }, scope: l, commandState: t, disabled: c || t === void 0, parentFloat: m }), [c, m]), x = W(() => ({ ...h, ...y }), [h, y]), b = j(ce, { children: [e(O, { command: n.getCommand("addSheet"), commandState: t, ...x, variant: ie.Menuitem }), e(O, { command: n.getCommand("deleteSheet"), ...x, variant: ie.Menuitem }), j(xt, { onMouseDown: (g) => {
|
|
2081
|
+
g.button === 0 && g.preventDefault();
|
|
2082
|
+
}, onMouseUp: () => {
|
|
2083
|
+
Promise.resolve(m.closeAll()).then(() => {
|
|
2084
|
+
u?.startEdit(t);
|
|
2085
|
+
});
|
|
2086
|
+
}, disabled: c || !f.isStructureAllowed(), parentFloat: m, children: ["Rename", l !== "sheet" ? " Sheet" : ""] }), e(O, { command: n.getCommand("duplicateSheet"), ...x, variant: ie.Menuitem }), e(O, { command: n?.getCommand("protectionSheetToggle"), ...x, variant: ie.Menuitem, icon: e(dn, {}) }), e(Ro, { variant: ie.Menuitem, command: n.getCommand("formatSheetTabColor"), icon: e(sr, {}), panelProps: { disableAlpha: !0, autoColorLabel: "No Tab Color", autoColorPosition: To.End }, parentFloat: m }), e(re, { orientation: "horizontal" }), e(O, { command: n.getCommand("hideSheet"), ...x, variant: ie.Menuitem, icon: D(e(yi, {})) })] });
|
|
2087
|
+
return e(B, { ref: i, className: Oe("menu", s), sx: { ...a }, ...d, children: b });
|
|
2088
|
+
}));
|
|
2089
|
+
Yi.displayName = "SheetTabMenu";
|
|
2090
|
+
const Zi = Y(J((r, i) => {
|
|
2091
|
+
const { workbook: o, gridStyle: t, floatReference: n, closeFloatAll: l, className: c, ...m } = r, [a, s] = _(o?.getSheets().search()), [u, d] = _(o?.getProtection());
|
|
2092
|
+
qe(o, { onSheetsChange: (p) => {
|
|
2093
|
+
s(p.getSheets().search());
|
|
2094
|
+
}, onProtectionChange: (p) => {
|
|
2095
|
+
d(p?.getProtection());
|
|
2096
|
+
} });
|
|
2097
|
+
const f = W(() => {
|
|
2098
|
+
const p = [], h = o.getSheets().search({ visibility: Rt.Visibility.Hidden }), y = o.getSelectedSheet();
|
|
2099
|
+
for (let x = 0; x < h.length; x++) {
|
|
2100
|
+
const b = h[x], g = b.getVisibility();
|
|
2101
|
+
if (g === Rt.Visibility.VeryHidden) continue;
|
|
2102
|
+
const w = y === b, v = b.getProtection().isLocked(), C = b.getTabColor(), k = t?.body.fill ?? "transparent";
|
|
2103
|
+
let T = null, M = null, I = k;
|
|
2104
|
+
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 || g === Rt.Visibility.Hidden ? "50%" : "100%", border: (P) => w ? `${k} solid 1.5px` : `${P.palette.divider} solid 1px`, background: w && C ? `linear-gradient(0deg, ${I} 0%, ${k})` : I, borderRadius: "4px" } }) }));
|
|
2105
|
+
let A = null;
|
|
2106
|
+
v && (A = e(dn, { color: "secondary" })), g !== Rt.Visibility.Visible && (A = D(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() && g === Rt.Visibility.Hidden, sx: { color: (P) => {
|
|
2107
|
+
let S = w ? P.palette.primary.main : P.palette.text.secondary;
|
|
2108
|
+
return M && (S = M), g === Rt.Visibility.Hidden && (S = Qe(S, P.palette.action.disabledOpacity)), S;
|
|
2109
|
+
}, borderLeft: (P) => `${w ? P.palette.primary.main : "transparent"} solid 2px`, paddingLeft: "4px", fontWeight: w ? "700" : "400", "&:hover": { fontWeight: "700" } }, icon: w ? e(sn, {}) : void 0, onMouseDown: (P) => P.preventDefault(), onMouseUp: () => {
|
|
2110
|
+
Promise.resolve(n.closeAll()).then(() => {
|
|
2111
|
+
try {
|
|
2112
|
+
b.select();
|
|
2113
|
+
} catch (P) {
|
|
2114
|
+
console.error(P);
|
|
2115
|
+
}
|
|
2116
|
+
});
|
|
2117
|
+
}, children: j(ce, { 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: [b.getName(), e(B, { sx: { height: "0px", opacity: "0", fontWeight: "700" }, children: b.getName() })] }), A] })] }) }, "" + x));
|
|
2118
|
+
}
|
|
2119
|
+
return p;
|
|
2120
|
+
}, [o, u, a, n, t]);
|
|
2121
|
+
return e(B, { ref: i, className: Oe("menu", c), ...m, children: f });
|
|
2122
|
+
}));
|
|
2123
|
+
Zi.displayName = "SheetsAllMenu";
|
|
2124
|
+
let Go = !1, Ji = !1, Pt = null;
|
|
2125
|
+
const Aa = async (r) => {
|
|
2126
|
+
const i = await So.getDetails();
|
|
2127
|
+
if (Ji || i.isEval()) {
|
|
2128
|
+
try {
|
|
2129
|
+
const o = top ?? window;
|
|
2130
|
+
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: () => So, moreExamples: () => {
|
|
2131
|
+
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." } });
|
|
2132
|
+
} }));
|
|
2133
|
+
} catch (o) {
|
|
2134
|
+
o instanceof DOMException || console.error(o), Go = !0;
|
|
2135
|
+
}
|
|
2136
|
+
if (Pt !== r && (Pt = r, !Go)) try {
|
|
2137
|
+
Go = !0, (top ?? window).SheetXL && (await So._validate(!0), So.wasPrinted() && (() => {
|
|
2138
|
+
Jt.consoleWithNoSource(`%cTip: You can access the API directly in the console.
|
|
2139
|
+
Try
|
|
2140
|
+
%c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c
|
|
2141
|
+
>%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;
|
|
2142
|
+
const o = document.getElementById("openEditorLink");
|
|
2143
|
+
o && o.addEventListener("click", (t) => {
|
|
2144
|
+
t.preventDefault(), console.log("openScriptEditor called from console");
|
|
2145
|
+
});
|
|
2146
|
+
})());
|
|
2147
|
+
} catch (o) {
|
|
2148
|
+
o instanceof DOMException || console.error(o);
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
}, Em = (r) => {
|
|
2152
|
+
Ji = r;
|
|
2153
|
+
};
|
|
2154
|
+
var Jp = function() {
|
|
2155
|
+
}, Qi = typeof window < "u", Qp = Qi ? St : he, Ba = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
2156
|
+
const Mo = Qi && window.ResizeObserver !== void 0 ? function() {
|
|
2157
|
+
var r = _(null), i = r[0], o = r[1], t = _(Ba), n = t[0], l = t[1], c = W(function() {
|
|
2158
|
+
return new window.ResizeObserver(function(m) {
|
|
2159
|
+
if (m[0]) {
|
|
2160
|
+
var a = m[0].contentRect, s = a.x, u = a.y, d = a.width, f = a.height, p = a.top, h = a.left, y = a.bottom, x = a.right;
|
|
2161
|
+
l({ x: s, y: u, width: d, height: f, top: p, left: h, bottom: y, right: x });
|
|
2162
|
+
}
|
|
2163
|
+
});
|
|
2164
|
+
}, []);
|
|
2165
|
+
return Qp(function() {
|
|
2166
|
+
if (i) return c.observe(i), function() {
|
|
2167
|
+
c.disconnect();
|
|
2168
|
+
};
|
|
2169
|
+
}, [i]), [o, n];
|
|
2170
|
+
} : function() {
|
|
2171
|
+
return [Jp, Ba];
|
|
2172
|
+
};
|
|
2173
|
+
function Gn() {
|
|
2174
|
+
return Gn = Object.assign ? Object.assign.bind() : function(r) {
|
|
2175
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2176
|
+
var o = arguments[i];
|
|
2177
|
+
for (var t in o) ({}).hasOwnProperty.call(o, t) && (r[t] = o[t]);
|
|
2178
|
+
}
|
|
2179
|
+
return r;
|
|
2180
|
+
}, Gn.apply(null, arguments);
|
|
2181
|
+
}
|
|
2182
|
+
function el(r, i) {
|
|
2183
|
+
if (r == null) return {};
|
|
2184
|
+
var o = {};
|
|
2185
|
+
for (var t in r) if ({}.hasOwnProperty.call(r, t)) {
|
|
2186
|
+
if (i.indexOf(t) !== -1) continue;
|
|
2187
|
+
o[t] = r[t];
|
|
2188
|
+
}
|
|
2189
|
+
return o;
|
|
2190
|
+
}
|
|
2191
|
+
function Xn(r, i) {
|
|
2192
|
+
return Xn = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, t) {
|
|
2193
|
+
return o.__proto__ = t, o;
|
|
2194
|
+
}, Xn(r, i);
|
|
2195
|
+
}
|
|
2196
|
+
function tl(r, i) {
|
|
2197
|
+
r.prototype = Object.create(i.prototype), r.prototype.constructor = r, Xn(r, i);
|
|
2198
|
+
}
|
|
2199
|
+
function La(r, i) {
|
|
2200
|
+
return r.replace(new RegExp("(^|\\s)" + i + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
2201
|
+
}
|
|
2202
|
+
const Ha = !1, ol = le.createContext(null);
|
|
2203
|
+
var nl = function(r) {
|
|
2204
|
+
return r.scrollTop;
|
|
2205
|
+
}, Co = "unmounted", Mt = "exited", Nt = "entering", Gt = "entered", Kn = "exiting", ht = function(r) {
|
|
2206
|
+
function i(t, n) {
|
|
2207
|
+
var l;
|
|
2208
|
+
l = r.call(this, t, n) || this;
|
|
2209
|
+
var c, m = n && !n.isMounting ? t.enter : t.appear;
|
|
2210
|
+
return l.appearStatus = null, t.in ? m ? (c = Mt, l.appearStatus = Nt) : c = Gt : c = t.unmountOnExit || t.mountOnEnter ? Co : Mt, l.state = { status: c }, l.nextCallback = null, l;
|
|
2211
|
+
}
|
|
2212
|
+
tl(i, r), i.getDerivedStateFromProps = function(t, n) {
|
|
2213
|
+
return t.in && n.status === Co ? { status: Mt } : null;
|
|
2214
|
+
};
|
|
2215
|
+
var o = i.prototype;
|
|
2216
|
+
return o.componentDidMount = function() {
|
|
2217
|
+
this.updateStatus(!0, this.appearStatus);
|
|
2218
|
+
}, o.componentDidUpdate = function(t) {
|
|
2219
|
+
var n = null;
|
|
2220
|
+
if (t !== this.props) {
|
|
2221
|
+
var l = this.state.status;
|
|
2222
|
+
this.props.in ? l !== Nt && l !== Gt && (n = Nt) : l !== Nt && l !== Gt || (n = Kn);
|
|
2223
|
+
}
|
|
2224
|
+
this.updateStatus(!1, n);
|
|
2225
|
+
}, o.componentWillUnmount = function() {
|
|
2226
|
+
this.cancelNextCallback();
|
|
2227
|
+
}, o.getTimeouts = function() {
|
|
2228
|
+
var t, n, l, c = this.props.timeout;
|
|
2229
|
+
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 };
|
|
2230
|
+
}, o.updateStatus = function(t, n) {
|
|
2231
|
+
if (t === void 0 && (t = !1), n !== null) if (this.cancelNextCallback(), n === Nt) {
|
|
2232
|
+
if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
|
2233
|
+
var l = this.props.nodeRef ? this.props.nodeRef.current : Kt.findDOMNode(this);
|
|
2234
|
+
l && nl(l);
|
|
2235
|
+
}
|
|
2236
|
+
this.performEnter(t);
|
|
2237
|
+
} else this.performExit();
|
|
2238
|
+
else this.props.unmountOnExit && this.state.status === Mt && this.setState({ status: Co });
|
|
2239
|
+
}, o.performEnter = function(t) {
|
|
2240
|
+
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;
|
|
2241
|
+
!t && !l || Ha ? this.safeSetState({ status: Gt }, function() {
|
|
2242
|
+
n.props.onEntered(a);
|
|
2243
|
+
}) : (this.props.onEnter(a, s), this.safeSetState({ status: Nt }, function() {
|
|
2244
|
+
n.props.onEntering(a, s), n.onTransitionEnd(d, function() {
|
|
2245
|
+
n.safeSetState({ status: Gt }, function() {
|
|
2246
|
+
n.props.onEntered(a, s);
|
|
2247
|
+
});
|
|
2248
|
+
});
|
|
2249
|
+
}));
|
|
2250
|
+
}, o.performExit = function() {
|
|
2251
|
+
var t = this, n = this.props.exit, l = this.getTimeouts(), c = this.props.nodeRef ? void 0 : Kt.findDOMNode(this);
|
|
2252
|
+
n && !Ha ? (this.props.onExit(c), this.safeSetState({ status: Kn }, function() {
|
|
2253
|
+
t.props.onExiting(c), t.onTransitionEnd(l.exit, function() {
|
|
2254
|
+
t.safeSetState({ status: Mt }, function() {
|
|
2255
|
+
t.props.onExited(c);
|
|
2256
|
+
});
|
|
2257
|
+
});
|
|
2258
|
+
})) : this.safeSetState({ status: Mt }, function() {
|
|
2259
|
+
t.props.onExited(c);
|
|
2260
|
+
});
|
|
2261
|
+
}, o.cancelNextCallback = function() {
|
|
2262
|
+
this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
|
|
2263
|
+
}, o.safeSetState = function(t, n) {
|
|
2264
|
+
n = this.setNextCallback(n), this.setState(t, n);
|
|
2265
|
+
}, o.setNextCallback = function(t) {
|
|
2266
|
+
var n = this, l = !0;
|
|
2267
|
+
return this.nextCallback = function(c) {
|
|
2268
|
+
l && (l = !1, n.nextCallback = null, t(c));
|
|
2269
|
+
}, this.nextCallback.cancel = function() {
|
|
2270
|
+
l = !1;
|
|
2271
|
+
}, this.nextCallback;
|
|
2272
|
+
}, o.onTransitionEnd = function(t, n) {
|
|
2273
|
+
this.setNextCallback(n);
|
|
2274
|
+
var l = this.props.nodeRef ? this.props.nodeRef.current : Kt.findDOMNode(this), c = t == null && !this.props.addEndListener;
|
|
2275
|
+
if (l && !c) {
|
|
2276
|
+
if (this.props.addEndListener) {
|
|
2277
|
+
var m = this.props.nodeRef ? [this.nextCallback] : [l, this.nextCallback], a = m[0], s = m[1];
|
|
2278
|
+
this.props.addEndListener(a, s);
|
|
2279
|
+
}
|
|
2280
|
+
t != null && setTimeout(this.nextCallback, t);
|
|
2281
|
+
} else setTimeout(this.nextCallback, 0);
|
|
2282
|
+
}, o.render = function() {
|
|
2283
|
+
var t = this.state.status;
|
|
2284
|
+
if (t === Co) return null;
|
|
2285
|
+
var n = this.props, l = n.children;
|
|
2286
|
+
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;
|
|
2287
|
+
var c = el(n, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
|
|
2288
|
+
return le.createElement(ol.Provider, { value: null }, typeof l == "function" ? l(t, c) : le.cloneElement(le.Children.only(l), c));
|
|
2289
|
+
}, i;
|
|
2290
|
+
}(le.Component);
|
|
2291
|
+
function $t() {
|
|
2292
|
+
}
|
|
2293
|
+
ht.contextType = ol, ht.propTypes = {}, ht.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 }, ht.UNMOUNTED = Co, ht.EXITED = Mt, ht.ENTERING = Nt, ht.ENTERED = Gt, ht.EXITING = Kn;
|
|
2294
|
+
var Pn = function(r, i) {
|
|
2295
|
+
return r && i && i.split(" ").forEach(function(o) {
|
|
2296
|
+
return n = o, void ((t = r).classList ? t.classList.remove(n) : typeof t.className == "string" ? t.className = La(t.className, n) : t.setAttribute("class", La(t.className && t.className.baseVal || "", n)));
|
|
2297
|
+
var t, n;
|
|
2298
|
+
});
|
|
2299
|
+
}, Yn = function(r) {
|
|
2300
|
+
function i() {
|
|
2301
|
+
for (var t, n = arguments.length, l = new Array(n), c = 0; c < n; c++) l[c] = arguments[c];
|
|
2302
|
+
return (t = r.call.apply(r, [this].concat(l)) || this).appliedClasses = { appear: {}, enter: {}, exit: {} }, t.onEnter = function(m, a) {
|
|
2303
|
+
var s = t.resolveArguments(m, a), u = s[0], d = s[1];
|
|
2304
|
+
t.removeClasses(u, "exit"), t.addClass(u, d ? "appear" : "enter", "base"), t.props.onEnter && t.props.onEnter(m, a);
|
|
2305
|
+
}, t.onEntering = function(m, a) {
|
|
2306
|
+
var s = t.resolveArguments(m, a), u = s[0], d = s[1] ? "appear" : "enter";
|
|
2307
|
+
t.addClass(u, d, "active"), t.props.onEntering && t.props.onEntering(m, a);
|
|
2308
|
+
}, t.onEntered = function(m, a) {
|
|
2309
|
+
var s = t.resolveArguments(m, a), u = s[0], d = s[1] ? "appear" : "enter";
|
|
2310
|
+
t.removeClasses(u, d), t.addClass(u, d, "done"), t.props.onEntered && t.props.onEntered(m, a);
|
|
2311
|
+
}, t.onExit = function(m) {
|
|
2312
|
+
var a = t.resolveArguments(m)[0];
|
|
2313
|
+
t.removeClasses(a, "appear"), t.removeClasses(a, "enter"), t.addClass(a, "exit", "base"), t.props.onExit && t.props.onExit(m);
|
|
2314
|
+
}, t.onExiting = function(m) {
|
|
2315
|
+
var a = t.resolveArguments(m)[0];
|
|
2316
|
+
t.addClass(a, "exit", "active"), t.props.onExiting && t.props.onExiting(m);
|
|
2317
|
+
}, t.onExited = function(m) {
|
|
2318
|
+
var a = t.resolveArguments(m)[0];
|
|
2319
|
+
t.removeClasses(a, "exit"), t.addClass(a, "exit", "done"), t.props.onExited && t.props.onExited(m);
|
|
2320
|
+
}, t.resolveArguments = function(m, a) {
|
|
2321
|
+
return t.props.nodeRef ? [t.props.nodeRef.current, m] : [m, a];
|
|
2322
|
+
}, t.getClassNames = function(m) {
|
|
2323
|
+
var a = t.props.classNames, s = typeof a == "string", u = s ? (s && a ? a + "-" : "") + m : a[m];
|
|
2324
|
+
return { baseClassName: u, activeClassName: s ? u + "-active" : a[m + "Active"], doneClassName: s ? u + "-done" : a[m + "Done"] };
|
|
2325
|
+
}, t;
|
|
2326
|
+
}
|
|
2327
|
+
tl(i, r);
|
|
2328
|
+
var o = i.prototype;
|
|
2329
|
+
return o.addClass = function(t, n, l) {
|
|
2330
|
+
var c = this.getClassNames(n)[l + "ClassName"], m = this.getClassNames("enter").doneClassName;
|
|
2331
|
+
n === "appear" && l === "done" && m && (c += " " + m), l === "active" && t && nl(t), c && (this.appliedClasses[n][l] = c, function(a, s) {
|
|
2332
|
+
a && s && s.split(" ").forEach(function(u) {
|
|
2333
|
+
return f = u, void ((d = a).classList ? d.classList.add(f) : function(p, h) {
|
|
2334
|
+
return p.classList ? !!h && p.classList.contains(h) : (" " + (p.className.baseVal || p.className) + " ").indexOf(" " + h + " ") !== -1;
|
|
2335
|
+
}(d, f) || (typeof d.className == "string" ? d.className = d.className + " " + f : d.setAttribute("class", (d.className && d.className.baseVal || "") + " " + f)));
|
|
2336
|
+
var d, f;
|
|
2337
|
+
});
|
|
2338
|
+
}(t, c));
|
|
2339
|
+
}, o.removeClasses = function(t, n) {
|
|
2340
|
+
var l = this.appliedClasses[n], c = l.base, m = l.active, a = l.done;
|
|
2341
|
+
this.appliedClasses[n] = {}, c && Pn(t, c), m && Pn(t, m), a && Pn(t, a);
|
|
2342
|
+
}, o.render = function() {
|
|
2343
|
+
var t = this.props;
|
|
2344
|
+
t.classNames;
|
|
2345
|
+
var n = el(t, ["classNames"]);
|
|
2346
|
+
return le.createElement(ht, Gn({}, n, { onEnter: this.onEnter, onEntered: this.onEntered, onEntering: this.onEntering, onExit: this.onExit, onExiting: this.onExiting, onExited: this.onExited }));
|
|
2347
|
+
}, i;
|
|
2348
|
+
}(le.Component);
|
|
2349
|
+
Yn.defaultProps = { classNames: "" }, Yn.propTypes = {};
|
|
2350
|
+
const Zn = { Light: "light", Dark: "dark" }, Rn = 0.12, za = (r, i) => {
|
|
2351
|
+
const o = {}, t = (a) => {
|
|
2352
|
+
const s = a.palette?.background.default ?? "rgba(255,255,255,1)";
|
|
2353
|
+
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: at(s, Rn, a.palette?.mode), darkMode: a.palette.mode === "dark" };
|
|
2354
|
+
}, n = t(i);
|
|
2355
|
+
o.body = t(r), o.header = { ...o.body, strokeFill: at(o.body.fill, Rn, r.palette?.mode), fill: i && r.palette.mode === "dark" && i.palette.mode !== r.palette.mode ? o.body.fill : at(o.body.fill, 0.055, r.palette?.mode), edgeStrokeFill: r.palette.mode === "dark" ? o.body.strokeFill : at(o.body.fill, 0.328, r.palette?.mode) }, o.headerHover = (a) => ({ ...o.header, strokeFill: at(a?.fill ?? o.body.fill, 0.22, r.palette?.mode), fill: at(a?.fill ?? o.header.fill, 0.065, r.palette?.mode), text: { ...a?.text, fontWeight: r.typography?.fontWeightBold } });
|
|
2356
|
+
const l = at(r.palette.mode !== "dark" ? r.palette.primary.light : r.palette.primary.main, 0.055, r.palette?.mode);
|
|
2357
|
+
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: at(n.fill, Rn, i.palette?.mode), fill: i && i.palette.mode === "dark" && i.palette.mode !== r.palette.mode ? n.fill : at(n.fill, 0.055, i.palette?.mode), edgeStrokeFill: i.palette.mode === "dark" ? n.strokeFill : at(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" };
|
|
2358
|
+
const c = i ?? r, m = c.palette.mode === "dark";
|
|
2359
|
+
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;
|
|
2360
|
+
};
|
|
2361
|
+
function rl(r) {
|
|
2362
|
+
const { mode: i } = r || {}, [o, t] = _(() => {
|
|
2363
|
+
if (i === "light" || i === "dark") return { themeMode: i, source: "prop" };
|
|
2364
|
+
if (typeof document < "u") {
|
|
2365
|
+
const n = Wa();
|
|
2366
|
+
if (n) return { themeMode: n, source: "class" };
|
|
2367
|
+
}
|
|
2368
|
+
return { themeMode: ja(), source: "media" };
|
|
2369
|
+
});
|
|
2370
|
+
return he(() => {
|
|
2371
|
+
const n = () => {
|
|
2372
|
+
if (i) return void (i === o.themeMode && o.source === "prop" || t((s) => ({ ...s, themeMode: i, source: "prop" })));
|
|
2373
|
+
const a = Wa();
|
|
2374
|
+
if (a) t({ themeMode: a, source: "class" });
|
|
2375
|
+
else {
|
|
2376
|
+
const s = ja();
|
|
2377
|
+
t({ themeMode: s, source: "media" });
|
|
2378
|
+
}
|
|
2379
|
+
}, l = new MutationObserver(n), c = [document.documentElement, document.body].filter(Boolean);
|
|
2380
|
+
for (const a of c) l.observe(a, { attributes: !0, attributeFilter: ["class"] });
|
|
2381
|
+
const m = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2382
|
+
return m.addEventListener("change", n), n(), () => {
|
|
2383
|
+
l.disconnect(), m.removeEventListener("change", n);
|
|
2384
|
+
};
|
|
2385
|
+
}, [i]), o;
|
|
2386
|
+
}
|
|
2387
|
+
function Wa() {
|
|
2388
|
+
if (typeof document > "u") return null;
|
|
2389
|
+
const r = [...Array.from(document.body.classList), ...document.documentElement ? Array.from(document.documentElement.classList) : []];
|
|
2390
|
+
return r.includes("dark") ? "dark" : r.includes("light") ? "light" : null;
|
|
2391
|
+
}
|
|
2392
|
+
function ja() {
|
|
2393
|
+
return typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
2394
|
+
}
|
|
2395
|
+
const No = Y(J((r, i) => {
|
|
2396
|
+
const { children: o, sx: t, parentFloat: n, ...l } = r, c = zt(i, () => ({}), []), [m, a] = Mo(), s = Se(null), u = Se(null), [d, f] = le.useReducer((C) => C + 1, 0), [p, h] = _(null), [y, x] = _(null), [b, g] = _(null), { reference: w } = oo({ parentFloat: n, label: "overflow" });
|
|
2397
|
+
St(() => {
|
|
2398
|
+
u.current = { refs: [] };
|
|
2399
|
+
const C = [], k = le.Children.toArray(o);
|
|
2400
|
+
let T = 0;
|
|
2401
|
+
k.forEach((M, I) => {
|
|
2402
|
+
C.push(e(B, { sx: { display: "flex" }, ref: (A) => {
|
|
2403
|
+
T++, T === k.length && f();
|
|
2404
|
+
const P = { current: null };
|
|
2405
|
+
P.current = A, u.current.refs[I] = P;
|
|
2406
|
+
}, children: M }, I));
|
|
2407
|
+
}), h(C);
|
|
2408
|
+
}, [o, a]), St(() => {
|
|
2409
|
+
if (!p) return;
|
|
2410
|
+
const C = u.current.refs;
|
|
2411
|
+
if (!c.current || !C || C.length === 0) return x(null), void g(null);
|
|
2412
|
+
const k = c.current?.getBoundingClientRect(), T = [], M = [];
|
|
2413
|
+
let I = 0, A = !1;
|
|
2414
|
+
for (let S = 0; !A && S < C.length; S++) {
|
|
2415
|
+
const N = C[S];
|
|
2416
|
+
if (!N) continue;
|
|
2417
|
+
if (!N.current) {
|
|
2418
|
+
A = !0;
|
|
2419
|
+
continue;
|
|
2420
|
+
}
|
|
2421
|
+
const L = N.current.getBoundingClientRect();
|
|
2422
|
+
I += L?.width, I > k.width && (A = !0);
|
|
2423
|
+
}
|
|
2424
|
+
if (!A) return x(null), void g([]);
|
|
2425
|
+
const P = s.current?.getBoundingClientRect();
|
|
2426
|
+
I = 0;
|
|
2427
|
+
for (let S = 0; S < C.length; S++) {
|
|
2428
|
+
const N = C[S];
|
|
2429
|
+
let L = !1;
|
|
2430
|
+
if (N.current) {
|
|
2431
|
+
const F = N.current.getBoundingClientRect();
|
|
2432
|
+
I += F?.width, I < k.width - P.width && (L = !0);
|
|
2433
|
+
}
|
|
2434
|
+
L ? T.push(p[S]) : M.push(p[S]);
|
|
2435
|
+
}
|
|
2436
|
+
x(T.length > 0 ? T : null), g(M.length > 0 ? M : null);
|
|
2437
|
+
}, [o, p, a, w, d]);
|
|
2438
|
+
const v = te((C) => {
|
|
2439
|
+
const k = [];
|
|
2440
|
+
for (let M = 0; M < b.length; M++) {
|
|
2441
|
+
let I = le.Children.toArray(b[M]);
|
|
2442
|
+
const A = I[0];
|
|
2443
|
+
I = le.Children.toArray(A.props.children?.props.children ?? A.props.children);
|
|
2444
|
+
const P = I[0], S = { ...P.props };
|
|
2445
|
+
S.parentFloat && (S.parentFloat = C.floatReference);
|
|
2446
|
+
const N = le.cloneElement(P, S);
|
|
2447
|
+
k.push(N);
|
|
2448
|
+
}
|
|
2449
|
+
const T = e(B, { className: "overflow-palette-popup-panel", sx: { display: "flex", flexDirection: "row", flexWrap: "wrap", 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 });
|
|
2450
|
+
return Ce({ ...C, children: T });
|
|
2451
|
+
}, [b]);
|
|
2452
|
+
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: b !== null && b.length === 0 ? "none" : "flex", flex: "1 1 0" }, children: e(vt, { createPopupPanel: v, ref: s, parentFloat: w, createTooltip: ({ children: C }, k) => e(nt, { label: "More", description: "More toolbar options…", disabled: k, children: C }), icon: e(Oc, { children: e(Od, {}) }) }) })] });
|
|
2453
|
+
})), al = "https://unpkg.com/@sheetxl/scripting-templates/dist", eu = (r) => {
|
|
2454
|
+
if (r.metadata?.name) return r.metadata.name;
|
|
2455
|
+
let i = (r.path.split("/").pop() || "").replace(/\.[^/.]+$/, "");
|
|
2456
|
+
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(" "));
|
|
2457
|
+
}, il = async (r) => {
|
|
2458
|
+
const i = Yt.relativePath(r, "./manifest.json"), o = await fetch(i);
|
|
2459
|
+
if (!o.ok) throw new qn(`Failed to retrieve directory at '${r}': ${o.statusText}`);
|
|
2460
|
+
const t = await o.text();
|
|
2461
|
+
if (t.trim().toLowerCase().startsWith("<!doctype html") || t.trim().toLowerCase().startsWith("<html")) throw new qn(`Failed to retrieve directory at '${r}'`);
|
|
2462
|
+
let n;
|
|
2463
|
+
try {
|
|
2464
|
+
n = JSON.parse(t);
|
|
2465
|
+
} catch (c) {
|
|
2466
|
+
throw new Error(`Failed to parse directory: ${c.message}. Ensure the file is valid JSON.`);
|
|
2467
|
+
}
|
|
2468
|
+
const l = n.map(async (c) => {
|
|
2469
|
+
try {
|
|
2470
|
+
const m = Yt.relativePath(r, c.path), a = await fetch(m);
|
|
2471
|
+
if (!a.ok) throw new Error(`Failed to fetch file at '${c.path}': ${a.statusText}`);
|
|
2472
|
+
const s = await a.text();
|
|
2473
|
+
let u = c.metadata;
|
|
2474
|
+
return u?.title || (u = { title: eu(c), ...u }), { path: c.path, content: s, metadata: u };
|
|
2475
|
+
} catch (m) {
|
|
2476
|
+
console.error(m.message);
|
|
2477
|
+
}
|
|
2478
|
+
return null;
|
|
2479
|
+
});
|
|
2480
|
+
return (await Promise.all(l)).filter((c) => c !== null);
|
|
2481
|
+
}, Mn = { fontSize: "0.8rem", marginRight: "4px" }, tu = Y((r) => {
|
|
2482
|
+
const { disabled: i, snippet: o, description: t, handleInsert: n, sx: l, ...c } = r;
|
|
2483
|
+
let m;
|
|
2484
|
+
return m = o.metadata?.icon === "formula" ? e(wi, { sx: Mn }) : o.metadata?.icon === "macro" ? e(pr, { sx: Mn }) : e(vi, { sx: Mn }), e(xt, { sx: { maxWidth: "460px", display: "flex", "*": { lineHeight: "1.2" }, ...l }, disabled: i, icon: m, onMouseDown: (a) => {
|
|
2485
|
+
a.button === 0 && a.preventDefault();
|
|
2486
|
+
}, onMouseUp: (a) => {
|
|
2487
|
+
a.button === 0 && n(o);
|
|
2488
|
+
}, onKeyDown: (a) => {
|
|
2489
|
+
a.keyCode !== we.Enter && a.keyCode !== we.Space || n(o);
|
|
2490
|
+
}, ...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 })] }) });
|
|
2491
|
+
}), ou = Y(J((r, i) => {
|
|
2492
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, scriptPath: c = al, ...m } = r, [a, s] = _([]), [u, d] = _(!0), f = Ve(o, ["executeSelectedScript"]), p = f[0]?.context?.();
|
|
2493
|
+
he(() => {
|
|
2494
|
+
(async () => {
|
|
2495
|
+
try {
|
|
2496
|
+
const y = await il(c);
|
|
2497
|
+
s(y);
|
|
2498
|
+
} catch {
|
|
2499
|
+
} finally {
|
|
2500
|
+
d(!1);
|
|
2501
|
+
}
|
|
2502
|
+
})();
|
|
2503
|
+
}, [c]);
|
|
2504
|
+
const h = q((y, x) => {
|
|
2505
|
+
if (u) return e("div", { children: "Loading..." });
|
|
2506
|
+
const b = { variant: ie.Menuitem, commandHook: t, scope: "scripts", disabled: l }, g = (C) => {
|
|
2507
|
+
p.getEditor()?.insertSnippet(C.content), y.closeFloat();
|
|
2508
|
+
}, w = [];
|
|
2509
|
+
for (let C = 0; C < a.length; C++) {
|
|
2510
|
+
const k = a[C];
|
|
2511
|
+
k && w.push(e(tu, { handleInsert: g, snippet: k }, k.path));
|
|
2512
|
+
}
|
|
2513
|
+
const v = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [w.length > 0 ? j(ce, { children: [e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: w }), e(re, { orientation: "horizontal" })] }) : null, Ee(O, { ...b, key: "help", command: o.getCommand("help"), icon: D(e(bi, {})) })] });
|
|
2514
|
+
return Ce({ ...y, children: v });
|
|
2515
|
+
}, [l, t, n, u, p]);
|
|
2516
|
+
return e(De, { ref: i, commands: o, disabled: l, commandHook: t, scope: n, label: "Insert Script", tooltip: "Inserts a script from a set of templates.", createPopupPanel: h, icon: D(e(Ac, {})), ...m });
|
|
2517
|
+
})), ll = Y(J((r, i) => {
|
|
2518
|
+
const { commands: o, parentFloat: t, commandButtonProps: n, ...l } = r, c = te((m) => {
|
|
2519
|
+
const { commandButtonProps: a, commandPopupProps: s } = m;
|
|
2520
|
+
return e(ce, { children: j("div", { style: { display: "flex", flex: "1 1 100%" }, children: [e("div", { children: e(No, { parentFloat: t, style: {}, children: e(O, { ...a, command: o.getCommand("saveScripts"), icon: D(e(Bc, {})) }) }) }), e("div", { style: { flex: "1 1 100%" } }), e("div", { children: e(No, { parentFloat: t, style: {}, children: e(ou, { ...a, commands: o }) }) })] }) });
|
|
2521
|
+
}, [o]);
|
|
2522
|
+
return e(cn, { ref: i, commands: o, parentFloat: t, commandButtonProps: n, createToolbarPalette: c, ...l });
|
|
2523
|
+
}));
|
|
2524
|
+
ll.displayName = "ScriptEditorToolbar";
|
|
2525
|
+
const Nn = { fontSize: "1rem" }, sl = Y(J((r, i) => {
|
|
2526
|
+
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] = _([]), [f, p] = _(!0), [h, y] = _(null);
|
|
2527
|
+
if (he(() => {
|
|
2528
|
+
(async () => {
|
|
2529
|
+
const g = [{ path: null, metadata: { title: "Blank Template...", summary: "Start with an empty script." }, content: "" }];
|
|
2530
|
+
try {
|
|
2531
|
+
p(!0), y(null);
|
|
2532
|
+
const w = await il(o);
|
|
2533
|
+
for (let v = 0; v < w.length; v++) {
|
|
2534
|
+
const C = w[v];
|
|
2535
|
+
C && g.push(C);
|
|
2536
|
+
}
|
|
2537
|
+
} catch (w) {
|
|
2538
|
+
y(w instanceof Error ? w.message : "Failed to load scripts"), w instanceof qn || console.error("Error loading scripts:", w);
|
|
2539
|
+
} finally {
|
|
2540
|
+
d(g), p(!1);
|
|
2541
|
+
}
|
|
2542
|
+
})();
|
|
2543
|
+
}, [o]), f) return e(B, { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", className: Oe(l, "script-select"), sx: { background: (g) => g.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})`, ...n }, ...s, children: e(Ss, {}) });
|
|
2544
|
+
let x = null;
|
|
2545
|
+
h && (x = j(B, { display: "flex", justifyContent: "center", alignItems: "center", className: Oe(l, "script-select", "error-results"), sx: { background: (g) => g.palette.error.light, flex: "0", zIndex: 1e3, flexDirection: "column", padding: (g) => g.spacing(1), border: (g) => `1px solid ${g.palette.error.main}`, borderBottomLeftRadius: 1, borderBottomRightRadius: 1, backgroundImage: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})` }, ...s, children: [e(Be, { color: "error", variant: "h6", component: "div", gutterBottom: !0, children: "Error loading Templates" }), e(Be, { color: "error", component: "div", children: h })] }));
|
|
2546
|
+
const b = (g) => {
|
|
2547
|
+
const w = g.metadata?.icon;
|
|
2548
|
+
return w === "macro" ? e(pr, { sx: Nn }) : w === "formula" ? e(wi, { sx: Nn }) : w === "autostart" ? e(vi, { sx: Nn }) : null;
|
|
2549
|
+
};
|
|
2550
|
+
return j(B, { ref: i, className: Oe(l, "script-select"), sx: { background: (g) => g.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(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((g, 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?.(g), 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: g.metadata?.title || g.path.split("/").pop()?.replace(/\.\w+$/, "") || "Untitled" }), b(g)] }), g.metadata?.summary && e(Be, { variant: "body2", component: "div", color: "text.secondary", sx: { overflow: "hidden", display: "flex", flexDirection: "column", textOverflow: "ellipsis", alignItems: "flex-start" }, children: g.metadata.summary })] }, `${g.path}-${w}`)) })] }), x] });
|
|
2551
|
+
}));
|
|
2552
|
+
sl.displayName = "TemplateSelectPanel";
|
|
2553
|
+
const cl = Y(J((r, i) => {
|
|
2554
|
+
const { className: o, sx: t, editorProps: n, commands: l, readOnly: c = !1, onClose: m, autoFocusSel: a, autoFocus: s = !0, scripts: u, ...d } = r, f = rt(), [p, h] = _(!1), y = Se(!1), [x, b] = _({ message: "Loading", cursor: "", dirty: !1 }), [g, w] = _(null);
|
|
2555
|
+
he(() => {
|
|
2556
|
+
let E = !1;
|
|
2557
|
+
return w(null), async function() {
|
|
2558
|
+
if (u && (await u.start(), !E)) {
|
|
2559
|
+
const K = u.getModules().search()[0]?.getSource();
|
|
2560
|
+
w({ source: K || null });
|
|
2561
|
+
}
|
|
2562
|
+
}(), () => {
|
|
2563
|
+
E = !0;
|
|
2564
|
+
};
|
|
2565
|
+
}, [u]);
|
|
2566
|
+
const v = q((E) => {
|
|
2567
|
+
b((K) => ({ ...K, ...E }));
|
|
2568
|
+
}, []), C = Se(null), k = Se(null), [T, M] = _(null), I = Se(null), A = te((E) => {
|
|
2569
|
+
if (T) return T.focus(E), !0;
|
|
2570
|
+
if (a) {
|
|
2571
|
+
const K = k.current?.querySelectorAll?.(a);
|
|
2572
|
+
if (K && K.length > 0) return K[0]?.focus?.(E), !0;
|
|
2573
|
+
}
|
|
2574
|
+
return k.current?.focus?.(E), !1;
|
|
2575
|
+
}, [T, a, s]), P = W(() => e(Lt, { transitionDelay: "160ms", style: { position: "absolute", width: "100%", height: "100%" }, transparentBackground: !1 }), []), S = W(() => e(Do, { elevation: 1, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, backgroundImage: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(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: x.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: x.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: x.cursor })] }) }), [x]), 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(Ud, { ref: k, loadingPanel: P, readOnly: c, onClose: m, autoFocus: s, commands: l, onStatusChange: v, darkMode: f.palette.mode === "dark", ...n }) }), N] }), [f, l, S, N, p, P, c, n, s, a, m, v]), F = W(() => e(vs, { 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) => fe(E.palette.action.hover, 0.03), borderBottom: (E) => `solid ${fe(E.palette.divider, 0.2)} 1px` }, onPointerDown: (E) => {
|
|
2576
|
+
E.isDefaultPrevented() || (E.preventDefault(), A());
|
|
2577
|
+
}, 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(nt, { label: "Close", children: e(ct, { "aria-label": "close", sx: { color: (E) => E.palette.text.icon ?? E.palette.action.active }, touchRippleRef: C, onPointerDown: (E) => {
|
|
2578
|
+
C.current?.start(E, { center: !1 }), E.stopPropagation(), E.preventDefault();
|
|
2579
|
+
}, onPointerUp: () => {
|
|
2580
|
+
k.current?.close();
|
|
2581
|
+
}, children: e(Ci, {}) }) })] }) }), [f, p]), z = W(() => {
|
|
2582
|
+
let E;
|
|
2583
|
+
return g === null ? null : (g.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: (K) => {
|
|
2584
|
+
k.current?.getEditor().insertSnippet(K.content), w({ source: K.content ?? "" });
|
|
2585
|
+
} })), 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(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})` }, onPointerDown: (K) => {
|
|
2586
|
+
K.isDefaultPrevented() || k.current?.focus();
|
|
2587
|
+
}, children: [F, j(B, { sx: { flex: "1 1 100%", position: "relative", display: "flex" }, children: [L, E] })] }));
|
|
2588
|
+
}, [S, L, o, g]), R = zt(i, () => ({ isScriptWorkspaceElement: () => !0, focus: (E) => {
|
|
2589
|
+
A(E);
|
|
2590
|
+
} }), []);
|
|
2591
|
+
return e(B, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", ...t }, ref: R, ...d, onFocus: (E) => {
|
|
2592
|
+
h(!0), y.current = !0, R.current?.contains(E.target) && E.target !== R.current && M(E.target), E.relatedTarget && !I.current && (I.current = E.relatedTarget), d?.onFocus?.(E);
|
|
2593
|
+
}, onBlur: (E) => {
|
|
2594
|
+
R?.current?.contains(E.relatedTarget) || R?.current === E.relatedTarget || (I.current = null, y.current = !1, h(!1)), d?.onBlur?.(E);
|
|
2595
|
+
}, children: z });
|
|
2596
|
+
}));
|
|
2597
|
+
cl.displayName = "ScriptWorkspace";
|
|
2598
|
+
const dl = Y(J((r, i) => {
|
|
2599
|
+
const { commands: o, commandHook: t, scope: n, disabled: l = !1, ...c } = r, m = Ve(o, ["executeScript"])[0].context();
|
|
2600
|
+
Ve(o, ["showScriptEditor"]);
|
|
2601
|
+
const a = q((s, u) => {
|
|
2602
|
+
const d = { variant: ie.Menuitem, commandHook: t, scope: "scripts", disabled: l, shortcut: null }, f = m?.getScripts(), p = f?.searchFunction({ type: "macro" }), h = [];
|
|
2603
|
+
if (p) for (let x = 0; x < p.length; x++) {
|
|
2604
|
+
const b = p[x];
|
|
2605
|
+
h.push(e(O, { ...d, command: u.getCommand("executeScript"), commandState: { declaration: b }, tooltipProps: { description: `Execute ${b.getName() ?? "script"}` }, icon: D(e(pr, {})), label: b.getName() ?? `Script '${b.getName()}'` }, `script-${b.getName()}-${x}`));
|
|
2606
|
+
}
|
|
2607
|
+
const y = j(B, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [h.length > 0 ? j(ce, { children: [e(B, { sx: { overflow: "auto", flex: "1 1 100%" }, children: h }), e(re, { orientation: "horizontal" })] }) : null, Ee(O, { ...d, key: "show-editor", command: u.getCommand("showScriptEditor"), icon: D(e(Lc, {})) })] });
|
|
2608
|
+
return Ce({ ...s, children: y });
|
|
2609
|
+
}, [l, m, t, n]);
|
|
2610
|
+
return e(De, { ref: i, commands: o, commandHook: t, createPopupPanel: a, selected: o.getCommand("showScriptEditor").state(), label: "Macros", tooltip: "Run or manage macros.", quickCommand: "showScriptEditor", icon: D(e(Hc, {})), ...c });
|
|
2611
|
+
})), nu = Y(J((r, i) => {
|
|
2612
|
+
const { commands: o, parentFloat: t, commandButtonProps: n, ...l } = r, c = Ve(o, ["executeScript", "showScriptEditor"]), m = c[0]?.context?.(), a = q((s) => {
|
|
2613
|
+
const { commandButtonProps: u, commandPopupProps: d } = s, f = e(Ro, { ...d, command: o.getCommand("formatFontColor"), icon: e(zc, {}), isSplit: !0, panelProps: { disableAlpha: !0 } }), p = e(Ro, { ...d, command: o.getCommand("formatFillColor"), icon: e(Wc, {}), isSplit: !0, panelProps: { disableAlpha: !0, autoColorLabel: "No Fill", autoColorPosition: To.End } }), h = o.getCommand("undo") ? e(ce, { children: e(Ni, { ...d, quickCommand: "undo" }) }) : null, y = o.getCommand("find") ? e(ce, { children: e(bp, { ...d }) }) : null;
|
|
2614
|
+
let x = null;
|
|
2615
|
+
const b = m?.getScripts();
|
|
2616
|
+
if (c[1]?.state?.() || b) {
|
|
2617
|
+
let g = c[1]?.state?.();
|
|
2618
|
+
const w = b?.searchFunction({ type: "macro" });
|
|
2619
|
+
for (let v = 0; w && !g && v < w?.length; v++) g = !0;
|
|
2620
|
+
g && (x = j(ce, { children: [e(re, {}), e(dl, { ...d })] }));
|
|
2621
|
+
}
|
|
2622
|
+
return j(No, { parentFloat: t, children: [h, null, h ? e(re, {}) : null, e(Ii, { ...d, command: o.getCommand("paste") }), e(O, { ...u, command: o.getCommand("formatPainterToggle"), icon: D(e(jc, {})) }), e(fr, { ...u, command: o.getCommand("copy") }), e(re, {}), e(Cp, { ...d, command: o.getCommand("formatFontFamily") }), e(yp, { ...d, command: o.getCommand("formatFontSize") }), e(O, { ...u, command: o.getCommand("formatBoldToggle"), icon: e(Vc, {}) }), e(O, { ...u, command: o.getCommand("formatItalicToggle"), icon: e($c, {}) }), e(Tp, { ...d }), e(kp, { ...d }), f, e(re, {}), p, e(gp, { ...d }), e(fp, { ...d }), e(re, {}), e(tp, { ...d }), e(op, { ...d }), e(np, { ...d }), e(rp, { ...d }), e(re, {}), e(wp, { ...d }), e(Rp, { command: o.getCommand("formatCellStyle"), ...d }), e(Op, { command: o.getCommand("formatTableStyle"), ...d }), e(re, {}), e(Pi, { ...d }), e(Ri, { ...d }), e(re, {}), e(Sp, { ...d }), null, e(Di, { ...d }), e(Mi, { ...d }), y, x] });
|
|
2623
|
+
}, [o, c]);
|
|
2624
|
+
return e(cn, { ref: i, commands: o, parentFloat: t, commandButtonProps: n, createToolbarPalette: a, ...l });
|
|
2625
|
+
})), ru = Y(J((r, i) => {
|
|
2626
|
+
const { commands: o, parentFloat: t, commandButtonProps: n, ...l } = r, c = te((m) => {
|
|
2627
|
+
const { commandButtonProps: a, commandPopupProps: s } = m;
|
|
2628
|
+
return j(No, { parentFloat: t, children: [null, e(O, { ...a, command: o.getCommand("updateHyperlink"), icon: D(e($n, {})) }), e(O, { ...a, command: o.getCommand("updateComments"), icon: D(e(_n, {})) }), e(Bi, { ...s }), e(O, { ...a, command: o.getCommand("insertTable"), icon: D(e(an, {})) })] });
|
|
2629
|
+
}, [o]);
|
|
2630
|
+
return e(cn, { ref: i, commands: o, parentFloat: t, commandButtonProps: n, createToolbarPalette: c, ...l });
|
|
2631
|
+
})), au = Y(J((r, i) => {
|
|
2632
|
+
const { commands: o, parentFloat: t, commandButtonProps: n, ...l } = r, c = te((m) => {
|
|
2633
|
+
const { commandButtonProps: a, commandPopupProps: s } = m;
|
|
2634
|
+
return j(No, { parentFloat: t, children: [e(xp, { ...s }), e(O, { ...a, command: o.getCommand("protectionSheetToggle"), icon: e(dn, { color: "secondary" }) }), e(re, {}), e(vp, { ...s }), e(Ep, { ...s }), e(re, {}), e(O, { ...a, command: o.getCommand("sheetViewToggleFormulaView"), scope: "view", icon: e(eo, { command: o.getCommand("sheetViewToggleFormulaView"), scope: "view" }) }), e(O, { ...a, command: o.getCommand("sheetViewToggleShowZeros"), scope: "view", icon: e(eo, { command: o.getCommand("sheetViewToggleShowZeros"), scope: "view" }) }), e(re, {}), e(Dp, { ...s }), e(Hp, { command: o.getCommand("selectTheme"), ...s }), e(re, {}), e(dl, { ...s, scope: "view" }), e(re, {}), e(O, { ...a, command: o.getCommand("fullScreenToggle"), scope: "view", icon: () => D(o.getCommand("fullScreenToggle").state() ? e(_c, {}) : e(Uc, {})) })] });
|
|
2635
|
+
}, [o]);
|
|
2636
|
+
return e(cn, { ref: i, commands: o, parentFloat: t, commandButtonProps: n, createToolbarPalette: c, ...l });
|
|
2637
|
+
})), pl = (r) => e(cu, { ...r }), iu = Y((r) => {
|
|
2638
|
+
const { sx: i, ...o } = r;
|
|
2639
|
+
return j(B, { sx: { display: "flex", flexDirection: "column", position: "relative", "&:hover:not([disabled]) .indicator": { borderBottom: (t) => `${fe(t.palette.primary.main, 0.35)} solid 2px` } }, children: [e(Ts, { disableRipple: !0, onMouseDown: (t) => {
|
|
2640
|
+
t.button === 0 && t.preventDefault();
|
|
2641
|
+
}, 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" } })] });
|
|
2642
|
+
}), lu = Y((r) => {
|
|
2643
|
+
const { toolbars: i, value: o, onToolbarChange: t, sx: n, ...l } = r, c = W(() => {
|
|
2644
|
+
const m = [];
|
|
2645
|
+
for (let a = 0; a < i.length; a++) m.push(e(iu, { label: i[a].label }, i[a].label));
|
|
2646
|
+
return m;
|
|
2647
|
+
}, [i]);
|
|
2648
|
+
return e(ks, { value: o, onChange: (m, a) => {
|
|
2649
|
+
t?.(a);
|
|
2650
|
+
}, 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 });
|
|
2651
|
+
}), su = Y((r) => {
|
|
2652
|
+
const { toolbars: i, value: o, onToolbarChange: t, selectProps: n, ...l } = r, c = q((a) => {
|
|
2653
|
+
t?.(a.target.value);
|
|
2654
|
+
}, [t]), m = W(() => {
|
|
2655
|
+
const a = [];
|
|
2656
|
+
for (let s = 0; s < i.length; s++) {
|
|
2657
|
+
const u = i[s].label;
|
|
2658
|
+
a.push(e(di, { value: s, sx: { color: (d) => {
|
|
2659
|
+
if (o === s) return d.palette.primary.main;
|
|
2660
|
+
} }, children: u }, u));
|
|
2661
|
+
}
|
|
2662
|
+
return a;
|
|
2663
|
+
}, [i, o]);
|
|
2664
|
+
return e(ir, { 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(Cs, { value: o, onChange: c, variant: "outlined", sx: { backgroundImage: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})` }, ...l, children: m }) });
|
|
2665
|
+
}), cu = Y(J((r, i) => {
|
|
2666
|
+
const { commands: o, selectWrapper: t, selectProps: n = {}, renderCompact: l = !1, paletteWrapper: c, toolbarsProps: m, paletteProps: a = {}, workbook: s, sx: u, ...d } = r, f = W(() => {
|
|
2667
|
+
const C = [], { ref: k, ...T } = m?.Home || {};
|
|
2668
|
+
C.push({ label: "Home", component: e(nu, { commands: o, ...T }) });
|
|
2669
|
+
const { ref: M, ...I } = m?.Insert || {};
|
|
2670
|
+
C.push({ label: "Insert", component: e(ru, { commands: o, ...I }) });
|
|
2671
|
+
const { ref: A, ...P } = m?.View || {};
|
|
2672
|
+
return C.push({ label: "View", component: e(au, { commands: o, ...P }) }), C;
|
|
2673
|
+
}, [o]), p = W(() => {
|
|
2674
|
+
const C = [];
|
|
2675
|
+
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 }));
|
|
2676
|
+
return C;
|
|
2677
|
+
}, [f]), [h, y] = _(0), x = (C) => {
|
|
2678
|
+
y(C);
|
|
2679
|
+
}, b = W(() => e(l ? su : lu, { toolbars: f, value: h, onToolbarChange: x, sx: n }), [f, h, n, l]), { sx: g, ...w } = a, v = e(Do, { elevation: 2, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, backgroundImage: `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})`, marginLeft: (C) => C.spacing(1), marginRight: (C) => C.spacing(1), marginTop: (C) => C.spacing(0.5), marginBottom: (C) => C.spacing(0.5), ...g }, ...w, children: p[h] });
|
|
2680
|
+
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(b) : b, c ? c(v) : v] });
|
|
2681
|
+
})), du = (r) => e(Yi, { ...r }), pu = (r) => e(Zi, { ...r }), uu = (r) => e(Ki, { ...r }), ul = Y(J((r, i) => {
|
|
2682
|
+
const { workbook: o, commands: t, onBeforeUserChange: n, onUserChange: l, disabled: c = !1, readOnly: m = !1, contextMenuProps: a, renderContextMenu: s = du, sheetsAllProps: u, renderSheetsAll: d = pu, sheetTabProps: f, renderSheetTab: p, background: h = "transparent", className: y, notifier: x, sx: b, borderWidth: g, borderColor: w, gridTheme: v, gridStyle: C, ...k } = r, [T, M] = _(o?.getSelectedSheetIndex()), [I, A] = _(o?.getSheets().search()), [P, S] = _(o?.getProtection());
|
|
2683
|
+
qe(o, { onViewChange(H) {
|
|
2684
|
+
M(H?.getSelectedSheetIndex());
|
|
2685
|
+
}, onSheetsChange: (H) => {
|
|
2686
|
+
A(H.getSheets().search());
|
|
2687
|
+
}, onProtectionChange: (H) => {
|
|
2688
|
+
S(H?.getProtection());
|
|
2689
|
+
} });
|
|
2690
|
+
const N = m || !P.isStructureAllowed(), L = W(() => {
|
|
2691
|
+
const H = [];
|
|
2692
|
+
for (let oe = 0; oe < I.length; oe++) H.push(I[oe].getName());
|
|
2693
|
+
return H;
|
|
2694
|
+
}, [I]), F = q((H) => {
|
|
2695
|
+
n?.(H) !== !1 && (o.getSheetAt(H).select(), l?.(H));
|
|
2696
|
+
}, [o, n, l]), z = q((H, oe) => {
|
|
2697
|
+
o.getSheetAt(H).setName(oe), l?.(H);
|
|
2698
|
+
}, [o, l]), R = q((H, oe) => {
|
|
2699
|
+
o.getSheetAt(H).setPosition(oe), l?.(oe);
|
|
2700
|
+
}, [o, l]), E = te(() => {
|
|
2701
|
+
if (n?.(T) === !1) return;
|
|
2702
|
+
const H = T + 1;
|
|
2703
|
+
o.getSheets().add({ name: void 0, autoSelect: !0 }), l?.(H);
|
|
2704
|
+
}, [o, n, l, T]), K = W(() => ({ placement: "top-start" }), []), ee = Se(null), [X, G] = _(!1), Z = q((H) => {
|
|
2705
|
+
const { closeFloatAll: oe, floatReference: ae } = H;
|
|
2706
|
+
return d({ workbook: o, gridStyle: C, floatReference: ae, closeFloatAll: oe, ...u });
|
|
2707
|
+
}, [d, u, c, o, C]), { reference: ge, component: U } = oo({ label: "allSheet", popperProps: K, anchor: ee.current, onOpen: () => G(!0), onClose: () => G(!1), createPopupPanel: Z }), V = Se(null), [Q, me] = _(null), Le = q((H) => {
|
|
2708
|
+
const { floatReference: oe } = H;
|
|
2709
|
+
return s?.({ workbook: o, index: Q?.index, tabStripRef: V.current, commands: t, disabled: c, floatReference: oe, ...a });
|
|
2710
|
+
}, [s, a, c, o, t, Q]), { reference: Fe, component: Ie } = oo({ label: "sheetTab", popperProps: K, anchor: { getBoundingClientRect: () => new DOMRect(Q?.left || 0, Q?.top || 0, 0, 0) }, onClose: () => me(null), createPopupPanel: Le });
|
|
2711
|
+
he(() => {
|
|
2712
|
+
Q ? Fe.open(0) : Fe.close(0);
|
|
2713
|
+
}, [Q]);
|
|
2714
|
+
const Pe = q((H, oe) => {
|
|
2715
|
+
H.preventDefault(), me({ left: H.clientX - 2, top: H.clientY - 4, index: oe });
|
|
2716
|
+
}, []), He = te((H) => {
|
|
2717
|
+
let oe;
|
|
2718
|
+
try {
|
|
2719
|
+
oe = o?.getSheetAt(H.index);
|
|
2720
|
+
} catch {
|
|
2721
|
+
}
|
|
2722
|
+
return oe ? (p ?? uu)({ sheet: oe, gridTheme: v, onContextMenu: (ae) => {
|
|
2723
|
+
F(H.index), Pe(ae, H.index);
|
|
2724
|
+
}, ...H, ...f }) : null;
|
|
2725
|
+
}, [p, f, o, v]), Ne = W(() => N ? null : e(At, { disableInteractive: !0, title: "New sheet", children: e(ct, { 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) => {
|
|
2726
|
+
H.button === 0 && H.preventDefault();
|
|
2727
|
+
}, onClick: () => E(), children: e(Ad, {}) }) }), [c, N, E]);
|
|
2728
|
+
return j(B, { ref: i, className: Oe(y), sx: { position: "relative", display: "flex", alignItems: "stretch", flex: "1 1 100%", maxWidth: "100%", ...b }, ...k, children: [e(qd, { ref: V, selectedTabIndex: T, tabNames: L, onSelectedTabIndexChange: F, onTabNameChange: z, onTabMove: R, background: h, borderColor: w, borderWidth: g, activeColor: null, disabled: c, disableDrag: N, createScrollStartButton: Xc, createScrollEndButton: Gc, createScrollEdgeButton: qc, createTabButton: He, createTabDivider: (H) => {
|
|
2729
|
+
const { key: oe, ...ae } = H;
|
|
2730
|
+
return e(re, { sx: { marginLeft: "-1px", marginRight: "0px", marginTop: "6px", marginBottom: "6px", background: (Ae) => fe(Ae.palette.divider, 0.25) }, ...ae }, oe);
|
|
2731
|
+
}, editLabelProps: { readOnly: N, maxLength: 31, styleHover: { fontWeight: "700" }, onKeyPress: (H) => {
|
|
2732
|
+
o.isValidSheetNameCharacter(H.key) || H.preventDefault();
|
|
2733
|
+
}, onCancel: () => {
|
|
2734
|
+
l?.(T);
|
|
2735
|
+
}, notifier: x }, 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: ee, dense: !0, outlined: !1, selected: X, color: "primary", "aria-label": "menu", onMouseDown: (H) => {
|
|
2736
|
+
H.button === 0 && H.preventDefault();
|
|
2737
|
+
}, onClick: () => {
|
|
2738
|
+
X ? ge.close(0) : ge.open(0);
|
|
2739
|
+
}, icon: e(Bd, {}) }) }) }), e("div", { style: { borderTop: `solid ${w} ${g}px`, minWidth: "4px" } }), e("div", { style: { borderTop: `solid ${w} ${g}px`, flex: "none", display: "flex", alignItems: "center" }, children: Ne }), e("div", { style: { borderTop: `solid ${w} ${g}px`, flex: 1, minWidth: "24px" } }), Ie, U] });
|
|
2740
|
+
}));
|
|
2741
|
+
ul.displayName = "WorkbookStrip";
|
|
2742
|
+
const ml = Y(J((r, i) => {
|
|
2743
|
+
const { workbook: o, commands: t, disabled: n, sx: l, floatReference: c, className: m, ...a } = r, [s, u] = nr((S) => S + 1, 0), [d, f] = _(o.getSelectedSheet()), [p, h] = _(d.getSelectedRanges()), [y, x] = _(d.getSelectedCell());
|
|
2744
|
+
qe(o, { onSheetsChange() {
|
|
2745
|
+
f(o.getSelectedSheet());
|
|
2746
|
+
} }), qe(d.getSelection(), { onChange() {
|
|
2747
|
+
h(d.getSelectedRanges()), x(d.getSelectedCell());
|
|
2748
|
+
} }), Ve(t, [], { onChange: () => {
|
|
2749
|
+
u();
|
|
2750
|
+
} });
|
|
2751
|
+
const b = W(() => ({}), []), g = W(() => ({ commandHook: { beforeExecute: (S, N) => c.closeAll(), onExecute() {
|
|
2752
|
+
}, onError() {
|
|
2753
|
+
console.log("onError");
|
|
2754
|
+
} }, disabled: n, scope: "contextMenu", parentFloat: c }), [n, c]), w = W(() => ({ ...b, ...g, variant: ie.Menuitem }), [b, g]), v = W(() => ({ commands: t, variant: ie.Menuitem, parentFloat: c, ...g }), [t, g, c]), C = [];
|
|
2755
|
+
let k = p.isEntireRows(), T = p.isEntireColumns();
|
|
2756
|
+
p && (k && (C.push(e(re, { orientation: "horizontal" }, "context:" + C.length)), C.push(Ee(O, { command: t.getCommand("hideColumns"), ...w, icon: D(e(Kc, {})), key: "context:" + C.length })), C.push(Ee(O, { command: t.getCommand("unhideColumns"), ...w, icon: D(e(Yc, {})), key: "context:" + C.length }))), T && (C.push(e(re, { orientation: "horizontal" }, "context:" + C.length)), C.push(Ee(O, { command: t.getCommand("hideRows"), ...w, icon: D(e(Zc, {})), key: "context:" + C.length })), C.push(Ee(O, { command: t.getCommand("unhideRows"), ...w, icon: D(e(Jc, {})), key: "context:" + C.length }))), (k || T) && C.push(e(re, { orientation: "horizontal" }, "context:" + C.length)), k && C.push(Ee(O, { command: t.getCommand("autoFitColumns"), ...w, icon: D(e(Qc, {})), key: "context:" + C.length })), T && C.push(Ee(O, { command: t.getCommand("autoFitRows"), ...w, icon: D(e(ed, {})), key: "context:" + C.length })));
|
|
2757
|
+
const M = [], I = t.getCommand("formatTableStyle"), A = I?.context()?.table();
|
|
2758
|
+
if (Ht(I), !k && !T) {
|
|
2759
|
+
if (M.push(e(re, { orientation: "horizontal" }, "contextBefore:" + M.length)), y?.getHyperlink()) M.push(Ee(st, { ...v, popupCommandKeys: ["updateHyperlink", "deleteHyperlink"], popupScope: "hyperlink", key: "contextBefore:action" + M.length, quickCommand: "openHyperlink", icon: (S) => S.key() === "openHyperlink" ? D(e($n, {})) : null }));
|
|
2760
|
+
else {
|
|
2761
|
+
const S = t.getCommand("updateHyperlink");
|
|
2762
|
+
M.push(Ee(O, { command: S, ...w, icon: D(e($n, {})), key: "contextBefore:" + M.length }));
|
|
2763
|
+
}
|
|
2764
|
+
if (y?.getComments()) M.push(Ee(st, { ...v, popupCommandKeys: ["deleteComments"], key: "contextBefore:action" + M.length, quickCommand: "updateComments", icon: (S) => S.key() === "updateComments" ? D(e(_n, {})) : null }));
|
|
2765
|
+
else {
|
|
2766
|
+
const S = t.getCommand("updateComments");
|
|
2767
|
+
M.push(Ee(O, { command: S, ...w, icon: D(e(_n, {})), key: "contextBefore:" + M.length }));
|
|
2768
|
+
}
|
|
2769
|
+
A ? M.push(Ee(st, { ...v, variant: ie.Menuitem, key: "contextBefore:" + M.length, popupCommandKeys: ["convertTableToRange", "deleteTable"], popupScope: "table", scope: "context", commandState: A, quickCommand: "editTable", icon: (S) => (S.key(), D(e(an, {}))) })) : M.push(Ee(O, { command: t.getCommand("insertTable"), ...w, icon: D(e(an, {})), key: "context:" + C.length })), M.push(Ee(Bi, { ...v, key: "contextBefore:" + M.length }));
|
|
2770
|
+
}
|
|
2771
|
+
const P = j(ce, { children: [e(O, { command: t.getCommand("cut"), ...w, icon: e(td, {}) }), e(fr, { command: t.getCommand("copy"), ...w }), e(Ii, { command: t.getCommand("paste"), ...v, includePasteAllInPopup: !1 }), e(re, { orientation: "horizontal" }), e(Mi, { ...v }), e(re, { orientation: "horizontal" }), e(Pi, { commands: t, ...v, disableSheet: !0 }), e(Ri, { commands: t, ...v, disableSheet: !0 }), e(Di, { ...v }), M, C] });
|
|
2772
|
+
return e(B, { ref: i, className: Oe("menu", m), sx: { ...l }, ...a, children: P });
|
|
2773
|
+
}));
|
|
2774
|
+
var Va, $a;
|
|
2775
|
+
ml.displayName = "WorkbookContextMenu", function() {
|
|
2776
|
+
if ($a) return Va;
|
|
2777
|
+
$a = 1;
|
|
2778
|
+
var r = /^\s+|\s+$/g, i = /^[-+]0x[0-9a-f]+$/i, o = /^0b[01]+$/i, t = /^0o[0-7]+$/i, n = parseInt, l = typeof vo == "object" && vo && vo.Object === Object && vo, 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() {
|
|
2779
|
+
return m.Date.now();
|
|
2780
|
+
};
|
|
2781
|
+
function f(h) {
|
|
2782
|
+
var y = typeof h;
|
|
2783
|
+
return !!h && (y == "object" || y == "function");
|
|
2784
|
+
}
|
|
2785
|
+
function p(h) {
|
|
2786
|
+
if (typeof h == "number") return h;
|
|
2787
|
+
if (function(b) {
|
|
2788
|
+
return typeof b == "symbol" || /* @__PURE__ */ function(g) {
|
|
2789
|
+
return !!g && typeof g == "object";
|
|
2790
|
+
}(b) && a.call(b) == "[object Symbol]";
|
|
2791
|
+
}(h)) return NaN;
|
|
2792
|
+
if (f(h)) {
|
|
2793
|
+
var y = typeof h.valueOf == "function" ? h.valueOf() : h;
|
|
2794
|
+
h = f(y) ? y + "" : y;
|
|
2795
|
+
}
|
|
2796
|
+
if (typeof h != "string") return h === 0 ? h : +h;
|
|
2797
|
+
h = h.replace(r, "");
|
|
2798
|
+
var x = o.test(h);
|
|
2799
|
+
return x || t.test(h) ? n(h.slice(2), x ? 2 : 8) : i.test(h) ? NaN : +h;
|
|
2800
|
+
}
|
|
2801
|
+
Va = function(h, y, x) {
|
|
2802
|
+
var b, g, w, v, C, k, T = 0, M = !1, I = !1, A = !0;
|
|
2803
|
+
if (typeof h != "function") throw new TypeError("Expected a function");
|
|
2804
|
+
function P(z) {
|
|
2805
|
+
var R = b, E = g;
|
|
2806
|
+
return b = g = void 0, T = z, v = h.apply(E, R);
|
|
2807
|
+
}
|
|
2808
|
+
function S(z) {
|
|
2809
|
+
var R = z - k;
|
|
2810
|
+
return k === void 0 || R >= y || R < 0 || I && z - T >= w;
|
|
2811
|
+
}
|
|
2812
|
+
function N() {
|
|
2813
|
+
var z = d();
|
|
2814
|
+
if (S(z)) return L(z);
|
|
2815
|
+
C = setTimeout(N, function(R) {
|
|
2816
|
+
var E = y - (R - k);
|
|
2817
|
+
return I ? u(E, w - (R - T)) : E;
|
|
2818
|
+
}(z));
|
|
2819
|
+
}
|
|
2820
|
+
function L(z) {
|
|
2821
|
+
return C = void 0, A && b ? P(z) : (b = g = void 0, v);
|
|
2822
|
+
}
|
|
2823
|
+
function F() {
|
|
2824
|
+
var z = d(), R = S(z);
|
|
2825
|
+
if (b = arguments, g = this, k = z, R) {
|
|
2826
|
+
if (C === void 0) return function(E) {
|
|
2827
|
+
return T = E, C = setTimeout(N, y), M ? P(E) : v;
|
|
2828
|
+
}(k);
|
|
2829
|
+
if (I) return C = setTimeout(N, y), P(k);
|
|
2830
|
+
}
|
|
2831
|
+
return C === void 0 && (C = setTimeout(N, y)), v;
|
|
2832
|
+
}
|
|
2833
|
+
return y = p(y) || 0, f(x) && (M = !!x.leading, w = (I = "maxWait" in x) ? s(p(x.maxWait) || 0, y) : w, A = "trailing" in x ? !!x.trailing : A), F.cancel = function() {
|
|
2834
|
+
C !== void 0 && clearTimeout(C), T = 0, b = k = g = C = void 0;
|
|
2835
|
+
}, F.flush = function() {
|
|
2836
|
+
return C === void 0 ? v : L(d());
|
|
2837
|
+
}, F;
|
|
2838
|
+
};
|
|
2839
|
+
}();
|
|
2840
|
+
var _a, Ua, qa = { exports: {} }, Fn = {};
|
|
2841
|
+
Ua || (Ua = 1, qa.exports = function() {
|
|
2842
|
+
if (_a) return Fn;
|
|
2843
|
+
_a = 1;
|
|
2844
|
+
var r = le, i = typeof Object.is == "function" ? Object.is : function(a, s) {
|
|
2845
|
+
return a === s && (a !== 0 || 1 / a == 1 / s) || a != a && s != s;
|
|
2846
|
+
}, o = r.useState, t = r.useEffect, n = r.useLayoutEffect, l = r.useDebugValue;
|
|
2847
|
+
function c(a) {
|
|
2848
|
+
var s = a.getSnapshot;
|
|
2849
|
+
a = a.value;
|
|
2850
|
+
try {
|
|
2851
|
+
var u = s();
|
|
2852
|
+
return !i(a, u);
|
|
2853
|
+
} catch {
|
|
2854
|
+
return !0;
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
var m = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? function(a, s) {
|
|
2858
|
+
return s();
|
|
2859
|
+
} : function(a, s) {
|
|
2860
|
+
var u = s(), d = o({ inst: { value: u, getSnapshot: s } }), f = d[0].inst, p = d[1];
|
|
2861
|
+
return n(function() {
|
|
2862
|
+
f.value = u, f.getSnapshot = s, c(f) && p({ inst: f });
|
|
2863
|
+
}, [a, u, s]), t(function() {
|
|
2864
|
+
return c(f) && p({ inst: f }), a(function() {
|
|
2865
|
+
c(f) && p({ inst: f });
|
|
2866
|
+
});
|
|
2867
|
+
}, [a]), l(u), u;
|
|
2868
|
+
};
|
|
2869
|
+
return Fn.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : m, Fn;
|
|
2870
|
+
}()), qa.exports;
|
|
2871
|
+
var Ga, Xa, fo = { exports: {} }, Xt = { exports: {} }, mu = Xt.exports;
|
|
2872
|
+
(function() {
|
|
2873
|
+
if (Xa) return fo.exports;
|
|
2874
|
+
Xa = 1;
|
|
2875
|
+
for (var r = (Ga || (Ga = 1, function() {
|
|
2876
|
+
var d, f, p, h, y, x;
|
|
2877
|
+
typeof performance < "u" && performance !== null && performance.now ? Xt.exports = function() {
|
|
2878
|
+
return performance.now();
|
|
2879
|
+
} : typeof process < "u" && process !== null && process.hrtime ? (Xt.exports = function() {
|
|
2880
|
+
return (d() - y) / 1e6;
|
|
2881
|
+
}, f = process.hrtime, h = (d = function() {
|
|
2882
|
+
var b;
|
|
2883
|
+
return 1e9 * (b = f())[0] + b[1];
|
|
2884
|
+
})(), x = 1e9 * process.uptime(), y = h - x) : Date.now ? (Xt.exports = function() {
|
|
2885
|
+
return Date.now() - p;
|
|
2886
|
+
}, p = Date.now()) : (Xt.exports = function() {
|
|
2887
|
+
return (/* @__PURE__ */ new Date()).getTime() - p;
|
|
2888
|
+
}, p = (/* @__PURE__ */ new Date()).getTime());
|
|
2889
|
+
}.call(mu)), Xt.exports), i = typeof window > "u" ? vo : 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];
|
|
2890
|
+
if (!n || !l) {
|
|
2891
|
+
var m = 0, a = 0, s = [], u = 1e3 / 60;
|
|
2892
|
+
n = function(d) {
|
|
2893
|
+
if (s.length === 0) {
|
|
2894
|
+
var f = r(), p = Math.max(0, u - (f - m));
|
|
2895
|
+
m = p + f, setTimeout(function() {
|
|
2896
|
+
var h = s.slice(0);
|
|
2897
|
+
s.length = 0;
|
|
2898
|
+
for (var y = 0; y < h.length; y++) if (!h[y].cancelled) try {
|
|
2899
|
+
h[y].callback(m);
|
|
2900
|
+
} catch (x) {
|
|
2901
|
+
setTimeout(function() {
|
|
2902
|
+
throw x;
|
|
2903
|
+
}, 0);
|
|
2904
|
+
}
|
|
2905
|
+
}, Math.round(p));
|
|
2906
|
+
}
|
|
2907
|
+
return s.push({ handle: ++a, callback: d, cancelled: !1 }), a;
|
|
2908
|
+
}, l = function(d) {
|
|
2909
|
+
for (var f = 0; f < s.length; f++) s[f].handle === d && (s[f].cancelled = !0);
|
|
2910
|
+
};
|
|
2911
|
+
}
|
|
2912
|
+
fo.exports = function(d) {
|
|
2913
|
+
return n.call(i, d);
|
|
2914
|
+
}, fo.exports.cancel = function() {
|
|
2915
|
+
l.apply(i, arguments);
|
|
2916
|
+
}, fo.exports.polyfill = function(d) {
|
|
2917
|
+
d || (d = i), d.requestAnimationFrame = n, d.cancelAnimationFrame = l;
|
|
2918
|
+
}, fo.exports;
|
|
2919
|
+
})();
|
|
2920
|
+
var lt = { DOM_UNAVAILABLE_ERROR: "DOM is unavailable server-side. Please use this method client-side only.", FULLSCREEN_UNSUPPORTED_ERROR: "Your browser does not support Fullscreen API.", getEventsNames() {
|
|
2921
|
+
if (typeof document > "u") return null;
|
|
2922
|
+
const r = document;
|
|
2923
|
+
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;
|
|
2924
|
+
}, getEventName(r) {
|
|
2925
|
+
const i = this.getEventsNames();
|
|
2926
|
+
return i ? r === "change" ? i[0] : i[1] : null;
|
|
2927
|
+
}, get fullscreenEnabled() {
|
|
2928
|
+
if (typeof document > "u") return !1;
|
|
2929
|
+
const r = document;
|
|
2930
|
+
return r.fullscreenEnabled || r.webkitFullscreenEnabled || !!r.webkitCancelFullScreen || r.mozFullScreenEnabled || r.msFullscreenEnabled || !1;
|
|
2931
|
+
}, get fullscreenElement() {
|
|
2932
|
+
if (typeof document > "u") return null;
|
|
2933
|
+
const r = document;
|
|
2934
|
+
return r.fullscreenElement || r.webkitFullscreenElement || r.webkitCurrentFullScreenElement || r.mozFullScreenElement || r.msFullscreenElement || null;
|
|
2935
|
+
}, requestFullscreen(r, i) {
|
|
2936
|
+
if (typeof document > "u") throw new Error(this.DOM_UNAVAILABLE_ERROR);
|
|
2937
|
+
const o = r ?? document.documentElement, t = o.requestFullscreen || o.webkitRequestFullscreen || o.webkitRequestFullScreen || o.mozRequestFullScreen || o.msRequestFullscreen;
|
|
2938
|
+
if (!t) throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);
|
|
2939
|
+
return t.call(o, i);
|
|
2940
|
+
}, exitFullscreen() {
|
|
2941
|
+
if (typeof document > "u") throw new Error(this.DOM_UNAVAILABLE_ERROR);
|
|
2942
|
+
const r = document, i = r.exitFullscreen || r.webkitExitFullscreen || r.webkitCancelFullScreen || r.mozCancelFullScreen || r.msExitFullscreen;
|
|
2943
|
+
if (!i) throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);
|
|
2944
|
+
return i.call(r);
|
|
2945
|
+
}, on(r, i) {
|
|
2946
|
+
const o = this.getEventName(r);
|
|
2947
|
+
o && document.addEventListener(o, i);
|
|
2948
|
+
}, off(r, i) {
|
|
2949
|
+
const o = this.getEventName(r);
|
|
2950
|
+
o && document.removeEventListener(o, i);
|
|
2951
|
+
} };
|
|
2952
|
+
const hu = (r) => {
|
|
2953
|
+
const { workbook: i, workbookElement: o, notifier: t, commandTarget: n, commands: l, darkMode: c, onShowSidebar: m, onNewWorkbook: a = gu } = r, [s, u] = _(i?.getSelectedSheet()), [d, f] = _(i?.getSheets().search()), p = te(m, [m]), h = te(a, [a]), y = W(() => [new Ue("workbookStatistics", n, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [be.Ctrl, be.Shift] } }), new Ue("showFormat", n, { label: "Show Format", description: "Open the format pane.", shortcut: { key: "F", modifiers: [be.Ctrl, be.Shift] } }), new ye("newCellStyle", n, { label: "New Cell Style…", scopedLabels: { cellStyle: "New Cell Style" }, description: "Create a new named style can can be quickly used later." }), new ye("deleteCellStyle", n, { label: "Delete Cell Style", scopedLabels: { cellStyle: "Delete" }, description: "Remove a named style that is no longer needed." }), new ye("modifyCellStyle", n, { label: "Modify Cell Style", scopedLabels: { cellStyle: "Modify" }, description: "Update a style with the currently style." }), new Ue("find", n, { label: "Find", description: "Open the Find window.", shortcut: [{ key: "F", modifiers: [be.Ctrl] }, { key: "F5", modifiers: [be.Shift] }] }), new Ue("findReplace", n, { label: "Find & Replace", description: "Open the Find & Replace window.", shortcut: [{ key: "H", modifiers: [be.Ctrl] }, { key: "H", modifiers: [be.Ctrl, be.Alt] }] }), new Ue("goto", n, { label: "Go To", description: "Open the 'Go To' window.", shortcut: [{ key: "G", modifiers: [be.Ctrl] }] }), new Ue("workbookViewToggleExpandFormulaBar", n, { label: "Toggle Expand Formula bar", description: "Expand or collapse the formula bar.", shortcut: { key: "U", modifiers: [be.Ctrl, be.Shift] } }), new Ue("workbookViewToggleShowFormulaBar", n, { label: "View Formula bar", scopedLabels: { view: "Formula Bar" }, description: "Show or hide the formula bar." }), new Ue("workbookViewToggleShowTabs", n, { label: "View Sheet Tabs", description: "Show or hide the sheet tabs.", scopedLabels: { view: "Sheet Tabs" } }), new Ue("workbookViewToggleShowStatusBar", n, { label: "View Status Bar", description: "Show or hide the status bar.", scopedLabels: { view: "Status Bar" } }), new Ue("workbookViewToggleShowHorizontalScrollBar", n, { label: "View Horizontal Scrollbar", description: "Show or hide the horizontal scrollbar.", scopedLabels: { view: "Horizontal Scrollbar" } }), new Ue("workbookViewToggleShowVerticalScrollBar", n, { label: "View Vertical Scrollbar", description: "Show or hide the vertical scrollbar.", scopedLabels: { view: "Vertical Scrollbar" } }), new ye("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 ye("deleteSheet", n, { label: "Delete Sheet", scopedLabels: { sheet: "Delete" }, description: "Delete the sheet and all the data." }), new ye("addSheet", n, { label: "Insert Sheet", scopedLabels: { sheet: "Insert" }, description: "Insert sheet before the current sheet.", shortcut: [{ key: "F11", modifiers: [be.Shift] }, { key: "F1", modifiers: [be.Alt, be.Shift] }] }), new ye("duplicateSheet", n, { label: "Duplicate Sheet", description: "Duplicate the current sheet.", scopedLabels: { sheet: "Duplicate" } }), new ye("nextSheet", n, { label: "Next Sheet", scopedLabels: { sheet: "Next" }, description: "Activate the next sheet.", shortcut: [{ key: "PageDown", modifiers: [be.Ctrl] }] }), new ye("previousSheet", n, { label: "Previous Sheet", scopedLabels: { sheet: "Previous" }, description: "Activate the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [be.Ctrl] }] }), new ye("selectNextSheet", n, { label: "Select Next Sheet", scopedLabels: { sheet: "Select Next" }, description: "Select the next sheet.", shortcut: [{ key: "PageDown", modifiers: [be.Ctrl, be.Shift] }] }), new ye("selectPreviousSheet", n, { label: "Select Previous Sheet", scopedLabels: { sheet: "Select Previous" }, description: "Select the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [be.Ctrl, be.Shift] }] }), new ye("selectTheme", n, { label: "Theme", description: "Select a theme that coveys a style suitable for your data." }), new ye("selectNamed", n, { label: (S) => S?.getName() ?? "Select Named Item", scopedLabels: { namedItem: (S) => S?.getName() ?? "Select" }, description: "Select the item." }), new ye("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 ye("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 ye("deleteNamedReference", n, { label: "Delete Named Reference", scopedLabels: { namedItem: "Delete" }, description: "Remove the named reference." }), new Ue("activeNameBox", n, { label: "Activate Name Box", description: "Move the focus to the name box.", shortcut: { key: "F3", modifiers: [be.Alt] } }), new Ue("createNamedReferenceFromSelection", n, { label: "Create from Selection", description: "Automatically generate names from the selected cells.", shortcut: { key: "F3", modifiers: [be.Ctrl, be.Shift] } }), new Ue("activeNameManager", n, { label: "Activate Name Manager", description: `Create, edit, delete, and find all the names used in the workbook.
|
|
2954
|
+
|
|
2955
|
+
Names can be used as a substitute for cell references.`, shortcut: { key: "F3", modifiers: [be.Ctrl] } }), new ye("fullScreenToggle", n, { label: "FullScreen", description: "Toggle showing the workbook using the full screen.", shortcut: { key: "F11" } }), new ye("showScriptEditor", n, { label: "Scripts", scopedLabels: { scripts: "Script Editor…" }, description: "Show the script editor.", shortcut: [{ key: "F11", modifiers: [be.Alt] }] }, function(S = !0) {
|
|
2956
|
+
p?.();
|
|
2957
|
+
}), new ye("executeScript", n, { label: "Run Script", description: "Run the selected or last executed script.", shortcut: { key: "F8" } }), new ye("executeSelectedScript", n, { label: "Run Script", description: "Run the selected script.", shortcut: { key: "F8" } }), new ye("saveScripts", n, { label: "Save Script", description: "Save the current scripts." }), new ye("maximumWorkbookToggle", n, { label: "Maximize", description: "Toggle showing the workbook maximized.", shortcut: { key: "F10", modifiers: [be.Ctrl] } }), new ye("spellCheck", n, { label: "Spell Check", description: "Check the workbook for spelling mistakes.", shortcut: { key: "F7" } }), new ye("calculateAll", n, { label: "Calculate Now", description: "Recalculate all formulas.", shortcut: { key: "F9" } }), new Ue("calculate", n, { label: "Calculate Sheet", description: "Recalculate the formulas on the current sheet.", shortcut: { key: "=", modifiers: [be.Ctrl] } }), new Ue("closeWorkbook", n, { label: "Close Workbook", description: "Close the workbook.", shortcut: { key: "W", modifiers: [be.Ctrl] } }), new Ue("newWorkbook", n, { label: "New Workbook", description: "Create a new workbook in another tab.", shortcut: { key: "N", modifiers: [be.Ctrl] } })], []), x = W(() => {
|
|
2958
|
+
let S = null;
|
|
2959
|
+
return S = l ? l.createChildGroup(n, "workbook", !1) : new ur(n, "workbook"), S.addCommands(y, !0), S;
|
|
2960
|
+
}, [l, y]), b = un(), g = le.useRef(null), w = te(() => {
|
|
2961
|
+
let S, N = null;
|
|
2962
|
+
const L = x.getCommand("executeScript");
|
|
2963
|
+
if (L.update({ disabled: !1, context: { getScripts: () => i.getScripts() } }), !L) return;
|
|
2964
|
+
const F = x.getCommand("executeSelectedScript");
|
|
2965
|
+
if (!F) return;
|
|
2966
|
+
const z = { saveSource: async (R) => {
|
|
2967
|
+
let E = null, K = null;
|
|
2968
|
+
const ee = i.getScripts();
|
|
2969
|
+
try {
|
|
2970
|
+
R && (K = await t?.showBusy?.("Saving Scripts..."), E = await ee.createModule({ source: R })), ee.addModule("scripts", E, { replace: !0 }), K?.();
|
|
2971
|
+
} catch (X) {
|
|
2972
|
+
K?.(), console.warn("Unable to compile", X), t?.showError?.(X);
|
|
2973
|
+
}
|
|
2974
|
+
return E;
|
|
2975
|
+
}, addContainerListener: (R) => (v.current = R, () => {
|
|
2976
|
+
v.current = null;
|
|
2977
|
+
}), setSelectedFunction: (R) => {
|
|
2978
|
+
S = R ?? g.current ?? null, Promise.resolve(S).then((E) => {
|
|
2979
|
+
F.update({ disabled: E === null });
|
|
2980
|
+
});
|
|
2981
|
+
}, quickInsertFunction: (R) => {
|
|
2982
|
+
const E = `=${R.toUpperCase()}(`, K = { text: E + ")", editMode: !0, initialSelection: { start: E.length, end: E.length + 0 } };
|
|
2983
|
+
b.setMode((ee) => ee?.key === "edit" ? { ...ee, args: { ...ee.args } } : { key: "edit", args: { stateAndCoords: null, start: K } });
|
|
2984
|
+
}, getSelectedFunction: () => S, setEditor: (R) => {
|
|
2985
|
+
N = R ?? null, x.getCommand("showScriptEditor")?.update({ state: R !== null });
|
|
2986
|
+
}, getEditor: () => N, getRanges: (R) => {
|
|
2987
|
+
try {
|
|
2988
|
+
return i.getRanges(R);
|
|
2989
|
+
} catch {
|
|
2990
|
+
}
|
|
2991
|
+
return null;
|
|
2992
|
+
}, getScripts: () => i.getScripts(), isReadOnly: () => i.getProtection().isStructureAllowed() === !1 };
|
|
2993
|
+
F.update({ context: z });
|
|
2994
|
+
}, [x, i, o, t]), v = le.useRef(null);
|
|
2995
|
+
qe(i, { onBeforeSave: async () => {
|
|
2996
|
+
await v.current?.onBeforeSave();
|
|
2997
|
+
}, onProtectionChange: () => {
|
|
2998
|
+
v.current?.onReadonlyChange();
|
|
2999
|
+
}, onLoad: () => {
|
|
3000
|
+
(async () => (await i.getCalculation().start(), i.getScripts().start(), v.current?.onScriptChange()))();
|
|
3001
|
+
} }), qe(i, { onSheetsChange: (S) => {
|
|
3002
|
+
f(S.getSheets().search());
|
|
3003
|
+
}, onViewChange(S) {
|
|
3004
|
+
u(S?.getSelectedSheet());
|
|
3005
|
+
}, onProtectionChange: (S) => {
|
|
3006
|
+
const N = { disabled: !S.getProtection().isStructureAllowed() };
|
|
3007
|
+
x.getCommand("hideSheet").update(N), x.getCommand("deleteSheet").update(N), x.getCommand("addSheet").update(N), x.getCommand("duplicateSheet").update(N), x.getCommand("selectTheme").update(N), x.getCommand("addNamedReference").update(N), x.getCommand("editNamedReference").update(N), x.getCommand("deleteNamedReference").update(N);
|
|
3008
|
+
}, onScriptsChange: (S) => {
|
|
3009
|
+
w();
|
|
3010
|
+
} });
|
|
3011
|
+
const { isFullscreenAvailable: C, isFullscreenEnabled: k, toggleFullscreen: T } = function(S = {}) {
|
|
3012
|
+
const { target: N, onChange: L, onError: F, requestFullScreenOptions: z } = S, [R, E] = _(!1), [K, ee] = _(null), [X, G] = _(!1), Z = q(() => lt.requestFullscreen(N?.current || null, z), [N, z]), ge = q(() => lt.exitFullscreen(), []), U = q(() => lt.fullscreenElement ? ge() : Z(), [Z, ge]), V = q((me) => {
|
|
3013
|
+
const Le = lt.fullscreenElement;
|
|
3014
|
+
ee(Le), G(!!Le), L?.(me);
|
|
3015
|
+
}, [L]), Q = q((me) => {
|
|
3016
|
+
const Le = lt.fullscreenElement;
|
|
3017
|
+
ee(Le), G(!!Le), F?.(me);
|
|
3018
|
+
}, [F]);
|
|
3019
|
+
return he(() => {
|
|
3020
|
+
E(lt.fullscreenEnabled);
|
|
3021
|
+
}, []), he(() => (lt.on("change", V), lt.on("error", Q), () => {
|
|
3022
|
+
lt.off("change", V), lt.off("error", Q);
|
|
3023
|
+
}), [V, Q]), { isFullscreenAvailable: R, fullscreenElement: K, isFullscreenEnabled: X, enableFullscreen: Z, disableFullscreen: ge, toggleFullscreen: U };
|
|
3024
|
+
}({ target: { current: o ?? document.body } }), M = hr();
|
|
3025
|
+
he(() => {
|
|
3026
|
+
x.getCommand("selectTheme").update({ state: () => i.getTheme(), context: () => ({ theme: i.getTheme(), themes: M, darkMode: c }) });
|
|
3027
|
+
}, [i?.getTheme(), c]);
|
|
3028
|
+
const I = te(async function(S, N) {
|
|
3029
|
+
let L = null;
|
|
3030
|
+
const F = i.getScripts();
|
|
3031
|
+
if (S?.declaration || S?.functionName) {
|
|
3032
|
+
const z = S.declaration ? S.declaration.getName() : S.functionName;
|
|
3033
|
+
F.searchFunction({ name: z }).length > 0 && (L = z);
|
|
3034
|
+
}
|
|
3035
|
+
if (L) try {
|
|
3036
|
+
await F.executeMacro(L), g.current = Promise.resolve({ source: null, name: L });
|
|
3037
|
+
} catch (z) {
|
|
3038
|
+
return void t?.showError?.(z);
|
|
3039
|
+
}
|
|
3040
|
+
}, [i, t]);
|
|
3041
|
+
he(() => {
|
|
3042
|
+
x.getCommand("newCellStyle").updateCallback((S) => {
|
|
3043
|
+
t?.showInputOptions?.({ initialValue: (() => {
|
|
3044
|
+
let N = 0;
|
|
3045
|
+
for (; ; ) {
|
|
3046
|
+
N++;
|
|
3047
|
+
const L = `Style ${N}`;
|
|
3048
|
+
try {
|
|
3049
|
+
return i.getStyles().validateStyleName(L, !0), L;
|
|
3050
|
+
} catch {
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
})(), title: x.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) => {
|
|
3054
|
+
let F = null;
|
|
3055
|
+
try {
|
|
3056
|
+
i.getStyles().validateStyleName(N, !1);
|
|
3057
|
+
} catch (E) {
|
|
3058
|
+
F = E.message;
|
|
3059
|
+
}
|
|
3060
|
+
let z = i.getStyles().getNamed(N), R = F;
|
|
3061
|
+
return !R && z && (R = `Update style '${z.getName()}'.`), { valid: F === null, message: R };
|
|
3062
|
+
} }).then(({ input: N, option: L }) => {
|
|
3063
|
+
const F = i.getSelectedSheet().getSelectedRange();
|
|
3064
|
+
if (L !== "Ok") return;
|
|
3065
|
+
const z = i.getStyles().setNamed({ name: N, style: F.getCell().getStyle() });
|
|
3066
|
+
F.updateStyle({ named: z.getName() });
|
|
3067
|
+
});
|
|
3068
|
+
}), x.getCommand("deleteCellStyle").updateCallback((S) => {
|
|
3069
|
+
S.delete();
|
|
3070
|
+
}), x.getCommand("modifyCellStyle").updateCallback(({ named: S }) => {
|
|
3071
|
+
const N = i.getSelectedSheet().getSelectedRange();
|
|
3072
|
+
i.getStyles().setNamed({ name: S.getName(), style: N.getCell().getStyle() });
|
|
3073
|
+
}), x.getCommand("hideSheet").updateCallback((S) => {
|
|
3074
|
+
i.getSheetAt(S).setVisibility(Rt.Visibility.Hidden);
|
|
3075
|
+
}), x.getCommand("deleteSheet").updateCallback(async (S) => {
|
|
3076
|
+
i.getSheetAt(S ?? i.getSelectedSheetIndex())?.delete();
|
|
3077
|
+
}), x.getCommand("addSheet").updateCallback((S) => {
|
|
3078
|
+
i.getSheets().add({ index: S, autoSelect: !0 });
|
|
3079
|
+
}), x.getCommand("duplicateSheet").updateCallback(async (S) => {
|
|
3080
|
+
(await i.getSheetAt(S ?? i.getSelectedSheetIndex())?.duplicate())?.select();
|
|
3081
|
+
}), x.getCommand("nextSheet").updateCallback((S) => {
|
|
3082
|
+
i.getNextSheet(S ?? i.getSelectedSheetIndex()).select();
|
|
3083
|
+
}), x.getCommand("previousSheet").updateCallback((S) => {
|
|
3084
|
+
i.getPreviousSheet(S ?? i.getSelectedSheetIndex()).select();
|
|
3085
|
+
}), x.getCommand("selectNextSheet").updateCallback((S) => {
|
|
3086
|
+
i.getNextSheet(S ?? i.getSelectedSheetIndex()).select();
|
|
3087
|
+
}), x.getCommand("selectPreviousSheet").updateCallback((S) => {
|
|
3088
|
+
i.getPreviousSheet(S ?? i.getSelectedSheetIndex()).select();
|
|
3089
|
+
}), x.getCommand("selectTheme").updateCallback((S) => {
|
|
3090
|
+
i.setTheme(S);
|
|
3091
|
+
}), x.getCommand("calculateAll").updateCallback(() => {
|
|
3092
|
+
i.getSelectedSheet().getEntireRange().calculate(!0);
|
|
3093
|
+
}), x.getCommand("calculate").updateCallback(() => {
|
|
3094
|
+
i.getSelectedSheet().getEntireRange().calculate(!0);
|
|
3095
|
+
}), x.getCommand("closeWorkbook").updateCallback(async () => {
|
|
3096
|
+
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();
|
|
3097
|
+
}), x.getCommand("newWorkbook").updateCallback(() => {
|
|
3098
|
+
h?.();
|
|
3099
|
+
}), x.getCommand("executeScript").updateCallback(I), x.getCommand("executeSelectedScript").updateCallback(I);
|
|
3100
|
+
}, [i, t]);
|
|
3101
|
+
const A = te(async (S) => {
|
|
3102
|
+
let N = 0, L = null, F = "Find & Replace";
|
|
3103
|
+
S?.replace && !S?.replaceOptions?.maxCount && (F = "Replace All");
|
|
3104
|
+
const z = await t?.showBusy?.(F);
|
|
3105
|
+
try {
|
|
3106
|
+
const R = S?.scope ?? "sheet";
|
|
3107
|
+
let E = null;
|
|
3108
|
+
const K = i.getSelectedSheet(), ee = { from: K.getSelectedCell(), ...S.findOptions };
|
|
3109
|
+
if (E = R === "sheet" ? i.getSelectedSheet().find(S.findText, ee) : i.find(S.findText, ee), S.replace) {
|
|
3110
|
+
const X = i.replace(E, S.replaceText, S.replaceOptions);
|
|
3111
|
+
N = X.count, S.replaceOptions.maxCount && (L = X.last);
|
|
3112
|
+
} else {
|
|
3113
|
+
let X = E.next();
|
|
3114
|
+
X.done || (N++, L = X.value);
|
|
3115
|
+
}
|
|
3116
|
+
L?.select({ autoFocus: !1 }), z?.(), !S.replaceOptions.maxCount && N > 1 && t?.showMessage?.(`We replaced ${N} cells.`);
|
|
3117
|
+
} catch (R) {
|
|
3118
|
+
z?.(), t?.showError?.(R);
|
|
3119
|
+
}
|
|
3120
|
+
return N;
|
|
3121
|
+
}, [i, o]), P = te((S) => {
|
|
3122
|
+
const N = { value: S, context: { selection: () => {
|
|
3123
|
+
const L = i.getSelectedRanges(), F = [];
|
|
3124
|
+
for (let z = 0; z < L.getCount(); z++) {
|
|
3125
|
+
const R = L.at(z).getFixed(!0).getCoords();
|
|
3126
|
+
F.push(R);
|
|
3127
|
+
}
|
|
3128
|
+
return i.getRanges(F);
|
|
3129
|
+
}, getNames: () => i.getNames() }, onUpdate: async (L) => {
|
|
3130
|
+
try {
|
|
3131
|
+
await L.select();
|
|
3132
|
+
} catch (F) {
|
|
3133
|
+
t?.showMessage?.(F.message, { type: wt.Error });
|
|
3134
|
+
}
|
|
3135
|
+
} };
|
|
3136
|
+
return t.showWindow?.("namedDetails", N);
|
|
3137
|
+
}, [t, i, o]);
|
|
3138
|
+
return he(() => {
|
|
3139
|
+
const S = (N = !1) => {
|
|
3140
|
+
const L = i.getSelectedCell(), F = { onFindOrReplace: A, onKeyDown: (z) => {
|
|
3141
|
+
x.findCommandByEvent(z) !== x.getCommand("find") && x.findCommandByEvent(z) !== x.getCommand("findReplace") || z.preventDefault();
|
|
3142
|
+
}, findOptions: {}, findText: L.toTextUnformatted(!0) };
|
|
3143
|
+
F.replace = N, t.showWindow?.("find", F, { disableAutoDestroy: !0 });
|
|
3144
|
+
};
|
|
3145
|
+
x.getCommand("find")?.update({ disabled: !t?.showWindow }).updateCallback(() => {
|
|
3146
|
+
S();
|
|
3147
|
+
}), x.getCommand("findReplace")?.update({ disabled: !t?.showWindow }).updateCallback(() => {
|
|
3148
|
+
S(!0);
|
|
3149
|
+
}), x.getCommand("goto")?.update({ disabled: !t }).updateCallback(() => {
|
|
3150
|
+
const N = { onInputOption: async (L) => {
|
|
3151
|
+
try {
|
|
3152
|
+
await i.getRanges(L).select();
|
|
3153
|
+
} catch (F) {
|
|
3154
|
+
t?.showMessage?.(F.message, { type: wt.Error });
|
|
3155
|
+
}
|
|
3156
|
+
}, onKeyDown: (L) => {
|
|
3157
|
+
x.findCommandByEvent(L) === x.getCommand("goto") && L.preventDefault();
|
|
3158
|
+
}, title: x.getCommand("goto")?.label(), inputLabel: "Location", options: ["Go To"] };
|
|
3159
|
+
t?.showInputOptions?.(N);
|
|
3160
|
+
}), x.getCommand("selectNamed")?.update({ disabled: !t }).updateCallback(async (N) => {
|
|
3161
|
+
if (N) try {
|
|
3162
|
+
await N.select();
|
|
3163
|
+
} catch (L) {
|
|
3164
|
+
t?.showError?.(L);
|
|
3165
|
+
}
|
|
3166
|
+
}), x.getCommand("addNamedReference")?.updateCallback(async function(N) {
|
|
3167
|
+
P(null);
|
|
3168
|
+
}), x.getCommand("editNamedReference")?.updateCallback(async function(N) {
|
|
3169
|
+
P(N);
|
|
3170
|
+
}), x.getCommand("deleteNamedReference")?.updateCallback(async function(N) {
|
|
3171
|
+
N?.delete?.();
|
|
3172
|
+
}), x.getCommand("activeNameBox")?.updateCallback(async function() {
|
|
3173
|
+
o?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus();
|
|
3174
|
+
});
|
|
3175
|
+
}, [o, i, t]), qe(i?.getView(), { onViewChange: (S) => {
|
|
3176
|
+
x.getCommand("workbookViewToggleShowFormulaBar").update({ state: S.isShowFormulaBar() }).updateCallback(() => {
|
|
3177
|
+
S.setShowFormulaBar(!S.isShowFormulaBar());
|
|
3178
|
+
}), x.getCommand("workbookViewToggleShowTabs").update({ state: S.isShowTabs() }).updateCallback(() => {
|
|
3179
|
+
S.setShowTabs(!S.isShowTabs());
|
|
3180
|
+
}), x.getCommand("workbookViewToggleShowStatusBar").update({ state: S.isShowStatusBar() }).updateCallback(() => {
|
|
3181
|
+
S.setShowStatusBar(!S.isShowStatusBar());
|
|
3182
|
+
}), x.getCommand("workbookViewToggleShowHorizontalScrollBar").update({ state: S.isShowHorizontalScrollbar() }).updateCallback(() => {
|
|
3183
|
+
S.setShowHorizontalScrollbar(!S.isShowHorizontalScrollbar());
|
|
3184
|
+
}), x.getCommand("workbookViewToggleShowVerticalScrollBar").update({ state: S.isShowVerticalScrollbar() }).updateCallback(() => {
|
|
3185
|
+
S.setShowVerticalScrollbar(!S.isShowVerticalScrollbar());
|
|
3186
|
+
});
|
|
3187
|
+
} }), he(() => {
|
|
3188
|
+
x.getCommand("fullScreenToggle").update({ state: k, disabled: !C }).updateCallback(() => {
|
|
3189
|
+
T();
|
|
3190
|
+
});
|
|
3191
|
+
}, [k, C]), he(() => {
|
|
3192
|
+
const S = i.getProtection().isStructureAllowed();
|
|
3193
|
+
x.getCommand("hideSheet").update({ disabled: d.length <= 1 || !S }), x.getCommand("deleteSheet").update({ disabled: d.length <= 1 || !S });
|
|
3194
|
+
}, [d, s]), x;
|
|
3195
|
+
}, gu = () => {
|
|
3196
|
+
window.open(window.origin.toString(), "sheetxl-" + Ze.uuidV4(), "popup=true");
|
|
3197
|
+
}, hl = Y(J((r, i) => {
|
|
3198
|
+
const { movable: o, commands: t, disabled: n, sx: l, floatReference: c, ...m } = r;
|
|
3199
|
+
qe(o, { onAnyChange(h) {
|
|
3200
|
+
} });
|
|
3201
|
+
const a = W(() => ({}), []), s = W(() => ({ commandHook: { beforeExecute: (h, y) => c.closeAll(), onExecute() {
|
|
3202
|
+
}, onError() {
|
|
3203
|
+
console.log("onError");
|
|
3204
|
+
} }, 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 = (h) => {
|
|
3205
|
+
switch (h?.key()) {
|
|
3206
|
+
case "moveToFront":
|
|
3207
|
+
return D(e(ud, {}));
|
|
3208
|
+
case "moveForward":
|
|
3209
|
+
return D(e(pd, {}));
|
|
3210
|
+
case "moveToBack":
|
|
3211
|
+
return D(e(dd, {}));
|
|
3212
|
+
case "moveBackward":
|
|
3213
|
+
return D(e(cd, {}));
|
|
3214
|
+
case "toggleLockAspectRatio":
|
|
3215
|
+
return D(e(na, {}));
|
|
3216
|
+
case "formatDrawAlignLeft":
|
|
3217
|
+
return D(e(ra, {}));
|
|
3218
|
+
case "formatDrawAlignCenter":
|
|
3219
|
+
return D(e(sd, {}));
|
|
3220
|
+
case "formatDrawAlignRight":
|
|
3221
|
+
return D(e(ld, {}));
|
|
3222
|
+
case "formatDrawAlignTop":
|
|
3223
|
+
return D(e(id, {}));
|
|
3224
|
+
case "formatDrawAlignMiddle":
|
|
3225
|
+
return D(e(ad, {}));
|
|
3226
|
+
case "formatDrawAlignBottom":
|
|
3227
|
+
return D(e(rd, {}));
|
|
3228
|
+
case "formatDrawDistributeHorz":
|
|
3229
|
+
return D(e(nd, {}));
|
|
3230
|
+
case "formatDrawDistributeVert":
|
|
3231
|
+
return D(e(od, {}));
|
|
3232
|
+
case "formatAnchorTypeTwoCell":
|
|
3233
|
+
case "formatAnchorTypeOneCell":
|
|
3234
|
+
case "formatAnchorTypeAbsolute":
|
|
3235
|
+
return D(e(aa, {}));
|
|
3236
|
+
default:
|
|
3237
|
+
return null;
|
|
3238
|
+
}
|
|
3239
|
+
}, p = j(ce, { children: [e(fr, { command: t.getCommand("copy"), ...u, variant: ie.Menuitem }), [], e(re, { orientation: "horizontal" }), e(st, { ...d, popupCommandKeys: ["moveToFront", "moveForward"], quickCommand: "moveToFront", icon: f }), e(st, { ...d, popupCommandKeys: ["moveToBack", "moveBackward"], quickCommand: "moveToBack", icon: f }), e(re, { orientation: "horizontal" }), e(O, { ...u, command: t.getCommand("toggleLockAspectRatio"), icon: D(e(na, {})) }), e(re, { orientation: "horizontal" }), e(st, { ...d, popupCommandKeys: ["formatDrawAlignLeft", "formatDrawAlignCenter", "formatDrawAlignRight", null, "formatDrawAlignTop", "formatDrawAlignMiddle", "formatDrawAlignBottom", null, "formatDrawDistributeHorz", "formatDrawDistributeVert"], label: "Align", icon: (h) => f(h) || D(e(ra, {})), tooltip: "Quickly change the placement of your drawings." }), e(re, { orientation: "horizontal" }), e(st, { ...d, popupCommandKeys: ["formatAnchorTypeTwoCell", "formatAnchorTypeOneCell", "formatAnchorTypeAbsolute"], label: "Sizing", icon: (h) => f(h) || D(e(aa, {})), tooltip: "Determine how the drawing size will adjust as the cell sizes adjust." }), []] });
|
|
3240
|
+
return e(B, { ref: i, sx: { paddingTop: "4px", paddingBottom: "4px", ...l }, ...m, children: p });
|
|
3241
|
+
}));
|
|
3242
|
+
hl.displayName = "MovableContextMenu";
|
|
3243
|
+
const fu = "_sheetxl-theme_4opcr_2", xu = "_sheetxl-workbook_1j3lu_5", bu = { fireOnModelChange: !1 }, In = { flex: "1 1 100%", display: "flex" }, yu = (r) => e(Wi, { ...r }), wu = (r) => e(ul, { ...r }), Su = (r) => e(hl, { ...r }), vu = (r) => e(ml, { ...r }), Cu = (r) => e(Xi, { ...r }), ku = (r, i) => e(Gi, { ref: i, ...r }), Tu = (r) => e(Lt, { ...r }), Eu = (r, i) => e(Kd, { ref: i, ...r }), gl = Y(J((r, i) => {
|
|
3244
|
+
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: h, commands: y, showFormulaBar: x, formulaBarProps: b, renderFormulaBar: g = ku, showTabs: w, tabsProps: v, renderTabs: C = wu, showStatusBar: k, statusBarProps: T, renderStatusBar: M = yu, toolbarProps: I, renderToolbar: A = pl, contextMenuSx: P, renderContextMenu: S = vu, renderFilterMenu: N = Cu, renderMovableMenu: L = Su, renderLoadingPanel: F = Tu, loadingPanelProps: z, sheetProps: R, renderSheet: E = Eu, showHorizontalScrollbar: K, showVerticalScrollbar: ee, gridTheme: X, headersTheme: G, enableDarkImages: Z, ...ge } = r, U = rt(), V = hr(), Q = W(() => {
|
|
3245
|
+
const $ = { theme: V.getDefaultTheme(), ...t };
|
|
3246
|
+
return o ?? new Wn($);
|
|
3247
|
+
}, [o]), me = Se(null), [Le, Fe] = _(!1), Ie = Se(null), Pe = 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: Ie }), []), [He, Ne] = _(!1), [H, oe] = _(!1), ae = q(() => {
|
|
3248
|
+
Ne(!0);
|
|
3249
|
+
}, []), Ae = Se(null), se = zt(i, () => ({ isWorkbookElement: () => !0, getWorkbook: () => Q, getSheetElement: () => me.current, getViewportElement: () => Ie.current, getFormulaBarElement: () => Ae.current, focus() {
|
|
3250
|
+
me && me.current && me.current.focus();
|
|
3251
|
+
} }), [Q]), ne = Se(null);
|
|
3252
|
+
St(() => {
|
|
3253
|
+
He && se.current && (oe(!0), ne.current !== l && (l?.({ source: se.current }), ne.current = l));
|
|
3254
|
+
}, [He, se.current]), Aa(se.current);
|
|
3255
|
+
const pe = q(($) => (me.current?.submitEdit(), !0), []), ze = q(() => {
|
|
3256
|
+
requestAnimationFrame(() => {
|
|
3257
|
+
me?.current?.focus();
|
|
3258
|
+
});
|
|
3259
|
+
}, []), [xe, Ye] = _(Q?.getSelectedSheet()), [dt, Ao] = _(Q?.getProtection());
|
|
3260
|
+
qe(Q, { onSheetsChange: ($) => {
|
|
3261
|
+
Ye($?.getSelectedSheet());
|
|
3262
|
+
}, onViewChange($) {
|
|
3263
|
+
Ye($?.getSelectedSheet());
|
|
3264
|
+
}, onProtectionChange: ($) => {
|
|
3265
|
+
Ao($?.getProtection());
|
|
3266
|
+
} }), qe(Q, { onRequestSelect: async ($, de) => new Promise((ke) => {
|
|
3267
|
+
me.current.getSheet() !== de ? me.current.getGridElement()?.onViewChangeOnce(() => {
|
|
3268
|
+
me.current.getSheet() !== de && ke(!1), ke(!0);
|
|
3269
|
+
}) : ke(!0);
|
|
3270
|
+
}) }, bu);
|
|
3271
|
+
const [Ol, Al] = nr(($) => $ + 1, 0), jt = Q?.getView();
|
|
3272
|
+
qe(jt, { onViewChange: ($) => {
|
|
3273
|
+
Al();
|
|
3274
|
+
} });
|
|
3275
|
+
const no = X ?? U, Ke = W(() => za(U, no), [U, no]), Sr = G ?? U, Bl = W(() => za(U, Sr), [U, Sr]), [vr, Ll] = _(null);
|
|
3276
|
+
q(() => {
|
|
3277
|
+
me.current.focus();
|
|
3278
|
+
}, []);
|
|
3279
|
+
const [fn, Cr] = _(!1), kr = Se(null), Re = hu({ workbook: Q, workbookElement: se.current, commandTarget: () => me.current, notifier: c, commands: y, darkMode: Ke.body.darkMode, onNewWorkbook: n, onShowSidebar: () => {
|
|
3280
|
+
fn ? kr.current?.focus() : Cr(!0);
|
|
3281
|
+
} }), xn = Se(null), [Tr, Er] = _(!1), [Hl, Dr] = _(null), [zl, Wl] = _(so.Top), [Bo, jl] = _(us.EmptyBounds), bn = () => {
|
|
3282
|
+
Er(!1), Dr(null);
|
|
3283
|
+
}, ro = ($, de, ke = so.Top) => {
|
|
3284
|
+
jl($), Wl(ke), Dr(de), xn.current !== null && xn.current.update(), Er(!0);
|
|
3285
|
+
}, [sm, Pr] = _("sheet"), Ct = w ?? jt?.isShowTabs(), kt = K ?? jt?.isShowHorizontalScrollbar(), Vl = x ?? jt?.isShowFormulaBar(), Lo = k ?? jt?.isShowStatusBar(), Rr = ee ?? jt?.isShowVerticalScrollbar(), Vt = Ke?.header?.edgeStrokeFill || "rgb(171,171,171)", $l = W(() => Lo ? M({ sheet: xe, gridStyle: Ke, ...T }) : null, [M, T, Lo, Ke, xe]), _l = W(() => A({ commands: Re, workbook: se.current, ...I }), [Re, A, I, U]), [Ul, { width: Mr }] = Mo(), Xe = Mr === 0 || Mr > 560, yn = W(() => {
|
|
3286
|
+
if (!Ct) return null;
|
|
3287
|
+
let $ = C({ background: Ke.body.fill, borderWidth: 1, borderColor: Vt, gridTheme: no, gridStyle: Ke, onBeforeUserChange: pe, onUserChange: ze, workbook: Q, commands: Re, sheetTabProps: {}, notifier: c, ...v });
|
|
3288
|
+
return Xe || ($ = e("div", { style: { flex: "none", display: "flex" }, children: $ })), $;
|
|
3289
|
+
}, [C, v, c, U, Q, no, Xe, Re, Ct]), Nr = q(($) => {
|
|
3290
|
+
const de = Ze.getOS() === Ze.OSType.Firefox;
|
|
3291
|
+
let ke = null, Ge = null, $e = null;
|
|
3292
|
+
if (kt && (Ge = e("div", { style: { display: "flex", flex: "1 1 100%", borderTop: `solid ${Vt} 1px`, maxWidth: "100%" }, children: e(ua, { 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" }, ...$, endGap: 700, sheet: xe, showCustomScrollButtons: !de, onShowTooltip: (_e) => {
|
|
3293
|
+
ro({ x: _e.anchor.x, y: _e.anchor.y, width: 0, height: 0 }, _e.display, _e.placement);
|
|
3294
|
+
}, onCloseTooltip: () => bn() }) })), Ct && Xe && ($e = yn), Ct && Xe && !kt && ($e = j(B, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: [$e, e(B, { sx: { borderTop: `solid ${Vt} 1px`, flex: "1" } })] })), $e && kt) ke = e(Un, { position: Q.getView().getTabRatio() / 10 + "%", onPositionChange: ({ percent: _e }) => {
|
|
3295
|
+
Q.getView().setTabRatio(Math.round(10 * _e));
|
|
3296
|
+
}, 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='${U.palette.text.icon ?? U.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: $e, elementAfter: Ge });
|
|
3297
|
+
else if (kt) ke = Ge;
|
|
3298
|
+
else {
|
|
3299
|
+
if (!$e) return e(B, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center", height: "1px", borderTop: Lo ? null : `solid ${Vt} 1px` } });
|
|
3300
|
+
ke = $e;
|
|
3301
|
+
}
|
|
3302
|
+
return e(B, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: ke });
|
|
3303
|
+
}, [xe, pe, Q, Ke, no, Re, Ct, kt, Lo, Xe]), [et, ao] = le.useState(null), ql = W(() => ({ placement: "right-start", ...et?.popperProps }), [et?.popperProps]), { reference: Fr, component: Gl } = oo({ label: "contextMenu", popperProps: ql, anchor: et?.anchor ?? { getBoundingClientRect: () => new DOMRect(et?.clientX || 0, et?.clientY || 0) }, onClose: () => ao(null), createPopupPanel: et?.createPopupPanel });
|
|
3304
|
+
he(() => {
|
|
3305
|
+
et ? Fr.open(0) : Fr.close(0);
|
|
3306
|
+
}, [et]);
|
|
3307
|
+
const Xl = te(($, de) => {
|
|
3308
|
+
if ($?.isDefaultPrevented()) return !0;
|
|
3309
|
+
$.preventDefault(), et && et.anchor === $.currentTarget ? ao(null) : ao({ anchor: $.currentTarget, popperProps: { offsets: [-4, 2] }, createPopupPanel: (ke) => {
|
|
3310
|
+
const { floatReference: Ge } = ke;
|
|
3311
|
+
return N({ filter: de, commands: Re, floatReference: Ge, sx: { ...P } });
|
|
3312
|
+
} });
|
|
3313
|
+
}, [N, P, Re, Q, et]), Ir = te(($) => {
|
|
3314
|
+
if ($.originalEvent?.isDefaultPrevented()) return !0;
|
|
3315
|
+
$.originalEvent?.preventDefault(), ao({ clientX: $.clientX, clientY: $.clientY, createPopupPanel: (de) => {
|
|
3316
|
+
const { floatReference: ke } = de;
|
|
3317
|
+
return S({ commands: Re, workbook: Q, floatReference: ke, sx: { ...P } });
|
|
3318
|
+
} });
|
|
3319
|
+
}, [S, P, Re, Q]), Kl = te(($, de) => {
|
|
3320
|
+
if ($?.isDefaultPrevented()) return !0;
|
|
3321
|
+
$.preventDefault(), ao({ clientX: $.clientX, clientY: $.clientY, createPopupPanel: (ke) => {
|
|
3322
|
+
const { floatReference: Ge } = ke;
|
|
3323
|
+
return L({ movable: de, commands: Re, floatReference: Ge, sx: { ...P } });
|
|
3324
|
+
} });
|
|
3325
|
+
}, [L, P, Re]);
|
|
3326
|
+
W(() => {
|
|
3327
|
+
const $ = [new Ue("openContextMenu", () => me.current, { label: "Context Menu", description: "Open the context menu.", shortcut: [{ key: "F10", modifiers: [be.Shift] }, { key: "ContextMenu" }] })];
|
|
3328
|
+
Re.addCommands($, !0);
|
|
3329
|
+
}, [Re]), he(() => {
|
|
3330
|
+
Re.getCommand("openContextMenu").updateCallback(() => {
|
|
3331
|
+
const $ = xe.getSelection().getCoords().cell;
|
|
3332
|
+
me.current?.getGridElement()?.scrollCellCoordsIntoView($).then((de) => {
|
|
3333
|
+
requestAnimationFrame(() => {
|
|
3334
|
+
const ke = xe.getView().getZoomScale() / 100, Ge = xe.getColumnHeaders().findOffset($.colIndex + 1) * ke, $e = xe.getRowHeaders().findOffset($.rowIndex + 1) * ke, _e = me.current?.getGridElement()?.getRelativePointFromClient(0, 0) || { x: 0, y: 0 };
|
|
3335
|
+
Ir({ clientX: Ge - _e.x - de.left + 6, clientY: $e - _e.y - de.top + 6 });
|
|
3336
|
+
});
|
|
3337
|
+
});
|
|
3338
|
+
});
|
|
3339
|
+
}, [xe]);
|
|
3340
|
+
const Yl = te(($) => {
|
|
3341
|
+
Re?.dispatchToFocusedCommand($);
|
|
3342
|
+
}, [Re]), Zl = te(() => {
|
|
3343
|
+
Aa(se.current);
|
|
3344
|
+
}, [Q, se.current]), Jl = q(() => {
|
|
3345
|
+
Pr("sheet");
|
|
3346
|
+
}, []), Ql = q(() => {
|
|
3347
|
+
Pr("formulaBar");
|
|
3348
|
+
}, []), es = te(($) => {
|
|
3349
|
+
const de = Ze.getOS() === Ze.OSType.Firefox;
|
|
3350
|
+
return e(ua, { 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 }, ...$, sheet: xe, endGap: 700, showCustomScrollButtons: !de, onShowTooltip: (ke) => {
|
|
3351
|
+
ro(ke.anchor, ke.display, so.Left);
|
|
3352
|
+
}, onCloseTooltip: () => bn() });
|
|
3353
|
+
}, [xe]);
|
|
3354
|
+
he(() => {
|
|
3355
|
+
m && me && me.current && me.current.focus();
|
|
3356
|
+
}, []);
|
|
3357
|
+
const [Ho, wn] = le.useState(null), Sn = q(($) => {
|
|
3358
|
+
Re?.getCommand("openWorkbook") && ($.type === "dragenter" || $.type === "dragover" ? $.dataTransfer?.types.includes("Files") ? $.dataTransfer.files[0]?.type?.startsWith("image/") || $.dataTransfer.items[0]?.type?.startsWith("image/") || $.dataTransfer.types.length === 1 && wn("Drop to open") : ($.dataTransfer?.types.includes("text/html") || $.dataTransfer?.types.includes("text/plain"), $.dataTransfer.effectAllowed = "none", $.dataTransfer.dropEffect = "none") : $.type === "dragleave" && wn(null), $.preventDefault());
|
|
3359
|
+
}, [Re]), ts = te(($) => {
|
|
3360
|
+
if (Re?.getCommand("openWorkbook") && ($.preventDefault(), $.stopPropagation(), wn(null), $.dataTransfer.files && $.dataTransfer.files.length > 0)) {
|
|
3361
|
+
const de = $.dataTransfer.files[0];
|
|
3362
|
+
if (!de) return;
|
|
3363
|
+
if (de?.type?.startsWith("image/")) {
|
|
3364
|
+
const ke = me.current?.getGridElement().getViewFromClient($.clientX, $.clientY);
|
|
3365
|
+
if (!ke) return;
|
|
3366
|
+
const Ge = ke.getRelativePointFromClient($.clientX, $.clientY), $e = ke.toAbsoluteBounds({ ...Ge, width: 0, height: 0 }), _e = ke.getCellCoordsFromClient($.clientX, $.clientY);
|
|
3367
|
+
if (!_e) return;
|
|
3368
|
+
Re?.getCommand("insertImageFromFile")?.execute({ file: de, options: { bounds: { x: $e.x, y: $e.y } }, goto: { range: { ..._e } } });
|
|
3369
|
+
} else Re?.getCommand("openWorkbook")?.execute(de);
|
|
3370
|
+
}
|
|
3371
|
+
}, [Re, Ho]), os = W(() => Ho ? e(B, { sx: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", pointerEvents: "none", display: "flex", justifyContent: "center", alignItems: "center", background: ($) => $.palette.divider, color: ($) => $.palette.primary.dark }, children: e(Be, { variant: "h4", children: Ho }) }) : null, [Ho]), Or = Se(null), ns = W(() => e(Yn, { in: !H, nodeRef: Or, 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: F({ ref: Or, 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%", ...z } }) }) }), [H, F, z]), rs = W(() => g({ sx: { marginTop: ($) => $.spacing(0.25), marginLeft: ($) => $.spacing(1), marginRight: ($) => $.spacing(1) }, workbook: Q, sheetElement: me.current, gridStyle: Ke, onFocus: Ql, ...b, NamedCollectionEditorProps: { restoreFocus: ($) => me.current.focus($), notifier: c, ...b?.NamedCollectionEditorProps, commandPopupButtonProps: { commands: Re, ...b?.NamedCollectionEditorProps?.commandPopupButtonProps } } }, Ae), [g, b, Q, Ke, Re, H]), as = q(($) => {
|
|
3372
|
+
const { movable: de, ...ke } = $, Ge = { movable: de, onContextMenuCapture: (Tt) => {
|
|
3373
|
+
Kl(Tt, de);
|
|
3374
|
+
}, ...ke }, $e = de.getContent().getType();
|
|
3375
|
+
let _e = null;
|
|
3376
|
+
if ($e === "picture") return e(Gd, { 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(), ...Ge });
|
|
3377
|
+
if ($e === "chart") {
|
|
3378
|
+
const Tt = { ...Ge, chart: de.getContent() };
|
|
3379
|
+
return e(Xd, { ...Tt });
|
|
3380
|
+
}
|
|
3381
|
+
if (_e = `Float of type '${$e}'.`, typeof _e == "string") {
|
|
3382
|
+
const Tt = { ...Ge, description: _e };
|
|
3383
|
+
_e = e(Yd, { ...Tt });
|
|
3384
|
+
}
|
|
3385
|
+
return e("div", { style: { position: "absolute", clipPath: "inset(0px)", display: "flex", alignItems: "stretch", justifyContent: "stretch", pointerEvents: "all" }, children: _e }, de.getUUID());
|
|
3386
|
+
}, []), Ar = W(() => E({ style: In, onFocus: Jl, notifier: c, gridStyle: Ke, headersStyle: Bl, sheet: xe, commands: Re, onSheetContextMenu: Ir, onViewportChange: ($) => {
|
|
3387
|
+
Ll($);
|
|
3388
|
+
}, showScrollbars: !1, viewportComponent: Pe, onRepeatCommandChange: h, onElementLoad: ae, onShowColumnTooltip: ($) => {
|
|
3389
|
+
ro($.anchor, $.display, so.Top);
|
|
3390
|
+
}, onShowRowTooltip: ($) => {
|
|
3391
|
+
ro($.anchor, $.display, so.Right);
|
|
3392
|
+
}, onShowTooltip: ($) => {
|
|
3393
|
+
ro({ x: $.anchor.x, y: $.anchor.y, width: 0, height: 0 }, $.display, $.placement);
|
|
3394
|
+
}, onCloseTooltip: () => bn(), renderMovable: as, ...R, cellRenderProps: { onFilterButtonMouseDown: ($, de) => {
|
|
3395
|
+
R?.cellRenderProps?.onFilterButtonMouseDown($, de), Xl($, de);
|
|
3396
|
+
}, ...R?.cellRenderProps } }, me), [E, Re, R, xe, Ke, c, h]), vn = W(() => {
|
|
3397
|
+
if (!fn) return null;
|
|
3398
|
+
const $ = !dt.isStructureAllowed();
|
|
3399
|
+
return e(cl, { sx: { marginBottom: (de) => de.spacing(0.5), border: (de) => `solid ${$ ? de.palette.action.disabled : fe(de.palette.divider, 0.2)} 1px`, borderRadius: (de) => `${de.shape.borderRadius}px`, overflow: "hidden" }, onClose: () => {
|
|
3400
|
+
Cr(!1), requestAnimationFrame(() => {
|
|
3401
|
+
me.current.focus();
|
|
3402
|
+
});
|
|
3403
|
+
}, readOnly: $, commands: Re, ref: kr, scripts: Q.getScripts() });
|
|
3404
|
+
}, [fn, Re, Q, c, dt]), is = W(() => {
|
|
3405
|
+
const $ = e(zd, { style: { ...In, marginRight: vn && Xe ? "0px" : "6px" }, viewport: vr, touchElement: me.current?.getGridElement()?.stage, onScrollViewport: (_e) => {
|
|
3406
|
+
me.current?.getGridElement()?.scrollTo(_e);
|
|
3407
|
+
}, showHorizontalScrollbar: kt || Ct, showVerticalScrollbar: Rr, createHorizontalScrollbar: Nr, createVerticalScrollbar: es, children: Ar });
|
|
3408
|
+
let de = $;
|
|
3409
|
+
Xe || (de = j(ce, { children: [$, yn] }));
|
|
3410
|
+
let ke = null, Ge = 4, $e = 13;
|
|
3411
|
+
return Xe ? ke = "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" : (ke = "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", Ge = 13, $e = 4), e(Un, { fixedPane: "after", position: "40%", minAfter: Xe ? "280px" : "120px", splitDirection: Xe ? "row" : "column", style: In, ref: Ul, resizerProps: { className: "styled-resizer", style: { minWidth: Xe ? "6px" : void 0, minHeight: Xe ? void 0 : "6px", maskImage: `url("data:image/svg+xml,%3Csvg width='${Ge}' height='${$e}' viewBox='0 0 ${Ge} ${$e}' version='1.1' fill='${U.palette.text.icon ?? U.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${ke}' /%3E%3C/svg%3E%0A")`, maskRepeat: "no-repeat", maskPosition: Xe ? "left center" : "top center" } }, elementBefore: de, paneBeforeProps: { style: { flexDirection: "column" } }, elementAfter: vn, paneAfterProps: { style: { marginLeft: Xe ? "0px" : "4px", marginRight: Xe ? "8px" : "4px" } } });
|
|
3412
|
+
}, [kt, Ct, Nr, Rr, vr, vn, Ar, yn, U, Xe]), ls = W(() => ({ boxSizing: "border-box", background: ($) => $.palette.mode !== "dark" ? Ke.header.fill : $.palette.background.paper, "& *": { ...md(U), fontWeight: 400 }, "&.Mui-focusVisible": {}, "& .viewport-overlay": { borderRight: `solid ${Vt} 1px` }, ...a }), [a, Ke]);
|
|
3413
|
+
return j(Do, { className: Oe("sheetxl-workbook", xu, { "Mui-focusVisible": Le }, fu, u), sx: ls, style: s, square: !1, ...ge, ref: se, onFocus: ($) => {
|
|
3414
|
+
Fe(!0), Zl(), d?.($);
|
|
3415
|
+
}, onBlur: ($) => {
|
|
3416
|
+
Fe(!1), f?.($);
|
|
3417
|
+
}, onKeyDown: ($) => {
|
|
3418
|
+
Yl($), p?.($);
|
|
3419
|
+
}, onDragStart: ($) => {
|
|
3420
|
+
if ($.target.src) {
|
|
3421
|
+
const de = new Image();
|
|
3422
|
+
de.src = $.target.src, $.dataTransfer.setDragImage(de, 1, 1);
|
|
3423
|
+
}
|
|
3424
|
+
}, onDragEnter: Sn, onDragLeave: Sn, onDragOver: Sn, onDrop: ts, children: [j("div", { className: Oe(Ai), style: { flex: "1 1 100%", width: "100%", display: "flex", flexDirection: "column", opacity: H ? void 0 : 0, "--sxl-app-color-high-contrast": U.palette.primary.main, "--sxl-app-color-primary": U.palette.primary.main, "--sxl-app-color-primary-dark": U.palette.primary.dark, "--sxl-app-color-primary-light": U.palette.primary.light, "--sxl-app-color-info": U.palette.info.main, "--sxl-app-color-info-dark": U.palette.info.dark, "--sxl-app-color-info-light": U.palette.info.light, "--sxl-app-color-secondary": U.palette.secondary.main, "--sxl-app-color-secondary-dark": U.palette.secondary.dark, "--sxl-app-color-secondary-light": U.palette.secondary.light, "--sxl-app-color-success": U.palette.success.main, "--sxl-app-color-success-dark": U.palette.success.dark, "--sxl-app-color-success-light": U.palette.success.light, "--sxl-app-color-warning": U.palette.warning.main, "--sxl-app-color-warning-dark": U.palette.warning.dark, "--sxl-app-color-warning-light": U.palette.warning.light, "--sxl-app-color-error": U.palette.error.main, "--sxl-app-color-error-dark": U.palette.error.dark, "--sxl-app-color-error-light": U.palette.error.light, "--sxl-app-color-text": U.palette.text.primary, "--sxl-app-color-text-secondary": U.palette.text.secondary, "--sxl-app-color-text-disabled": U.palette.text.disabled, "--sxl-app-color-background": U.palette.background.paper, "--sxl-app-color-button-surface": U.palette.grey[600], "--sxl-app-color-shadow": U.palette.action.focus, "--sxl-app-color-grey": U.palette.grey[500], "--sxl-app-filter-dark-invert": Ke.body.darkMode && Z ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", "--sxl-app-image-background": Ke.body.darkMode ? `linear-gradient(${fe("#fff", Te(5))}, ${fe("#fff", Te(5))})` : void 0 }, children: [_l, Vl ? rs : null, e(B, { sx: { marginBottom: ($) => $.spacing(0.75) } }), is, $l, e(At, { arrow: !0, disableInteractive: !0, open: Tr, title: e(Be, { variant: "subtitle2", component: "div", children: Hl }), placement: zl, TransitionProps: { timeout: { exit: 0 } }, PopperProps: { popperRef: xn, sx: { "& .MuiTooltip-tooltip": { padding: "2px 6px", "& .MuiTooltip-arrow": { display: Tr ? "visible" : "none" } } }, anchorEl: { getBoundingClientRect: () => new DOMRect(Bo.x, Bo.y, Bo.width, Bo.height) }, modifiers: [{ name: "offset", options: { offset: [0, 0] } }] }, children: e(B, {}) }), Gl, os] }), ns] });
|
|
3425
|
+
}));
|
|
3426
|
+
gl.displayName = "WorkbookElement";
|
|
3427
|
+
const Du = (r = !1, i = !1) => i ? null : { "& input:not(:focus):not(:hover)": { color: (o) => o.palette.text.secondary }, backgroundColor: (o) => fe(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 = Y(J((r, i) => {
|
|
3428
|
+
const { sx: o, workbook: t, title: n = "", placeHolder: l = "Untitled", onTitleChange: c, readOnly: m = !1, hidden: a, ...s } = r, [u, d] = _(!1), [f, p] = _(!1), [h, y] = _(n ?? ""), [x, b] = _(""), [g, { width: w }] = Mo(), [v, { width: C }] = Mo(), [k, T] = _(!1), M = Se(null), I = Se(null), A = zt(i, () => ({ requestWorkbookTitle: (P = null, S) => {
|
|
3429
|
+
I.current = { onAccept: P, requestReason: S?.requestReason }, S?.selectAll && M.current?.select(), M.current?.focus(S);
|
|
3430
|
+
}, focus: (P) => {
|
|
3431
|
+
M.current?.focus(P);
|
|
3432
|
+
} }), []);
|
|
3433
|
+
return St(() => {
|
|
3434
|
+
T(n !== h), b(n), y(n);
|
|
3435
|
+
}, [n]), he(() => {
|
|
3436
|
+
k && w !== 0 && Jt.debounce(() => {
|
|
3437
|
+
T(!1);
|
|
3438
|
+
}, 300)();
|
|
3439
|
+
}, [k, w]), he(() => {
|
|
3440
|
+
p(h && !Yt.isValidWindowsFilename(h));
|
|
3441
|
+
}, [h]), 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(nt, { 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", ...Du(!0, m), ...o }, children: [m ? e(Be, { variant: "subtitle1", component: "div", sx: { whiteSpace: "nowrap", fontStyle: h !== x ? "italic" : void 0, userSelect: "none", textOverflow: "ellipsis", lineHeight: "1.4375em", border: "transparent 1px solid", color: (P) => f ? P.palette.error.dark : void 0 }, children: n ?? l }) : e(ar, { 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: (P) => f ? P.palette.error.dark : void 0, fontStyle: h !== x ? "italic" : void 0, "& input": { paddingTop: "0px", paddingBottom: "0px", textOverflow: "ellipsis" } }, disableUnderline: !0, fullWidth: !1, multiline: !1, readOnly: m, spellCheck: !1, placeholder: l, onFocus: (P) => {
|
|
3442
|
+
d(!0), P.target?.select();
|
|
3443
|
+
}, inputProps: { name: "input-workbook-title", autoComplete: "off", ref: M }, onBlur: () => {
|
|
3444
|
+
d(!1), f ? y(x) : (h !== x && (c?.(h), h && I.current?.onAccept?.(h, "blur")), I.current = null);
|
|
3445
|
+
}, onChange: (P) => {
|
|
3446
|
+
if (P.target.value.length > Yt.MAX_WORKBOOK_NAME_SIZE) return P.stopPropagation(), void P.preventDefault();
|
|
3447
|
+
y(P.target.value);
|
|
3448
|
+
}, onKeyDown: (P) => {
|
|
3449
|
+
(Yt.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(P.key) || P.target?.value.length > Yt.MAX_WORKBOOK_NAME_SIZE) && P.preventDefault(), P.which === we.Enter || P.which === we.Tab ? (f ? y(x) : (c?.(h), h && (I.current?.onAccept?.(h, "keydown"), I.current = null)), P.stopPropagation(), P.preventDefault(), t?.focus()) : P.which === we.Escape && (h === x ? t?.focus() : (y(x), setTimeout(() => {
|
|
3450
|
+
P.target?.select();
|
|
3451
|
+
}, 0)), I.current = null, P.stopPropagation(), P.preventDefault());
|
|
3452
|
+
}, value: h }), e(B, { ref: g, sx: { position: "absolute", visibility: "hidden", top: "-9999px", fontWeight: "600 !important", whiteSpace: "pre", fontStyle: h !== x ? "italic" : void 0, fontFamily: (P) => P.typography.fontFamily, letterSpacing: "0.00938em" }, children: h || l })] }) }) });
|
|
3453
|
+
}));
|
|
3454
|
+
fl.displayName = "WorkbookTitle";
|
|
3455
|
+
const Pu = Y(J((r, i) => {
|
|
3456
|
+
const { sx: o, style: t, className: n, licenseKey: l, renderLoadingPanel: c, ...m } = r;
|
|
3457
|
+
l && So.setLicenseKey(l);
|
|
3458
|
+
const a = W(() => {
|
|
3459
|
+
const u = { transitionDelay: "160ms", transparentBackground: !0 };
|
|
3460
|
+
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 }) });
|
|
3461
|
+
}, [o, t, c]), s = W(() => le.lazy(async () => await Promise.resolve().then(() => lm)), []);
|
|
3462
|
+
return e(ce, { children: e(si, { fallback: a, children: e(s, { ...m, className: n, renderLoadingPanel: c, sx: o, style: t, ref: i }) }) });
|
|
3463
|
+
}));
|
|
3464
|
+
Pu.displayName = "Studio";
|
|
3465
|
+
const Ru = gs(null), On = { didCatch: !1, error: null };
|
|
3466
|
+
class Mu extends ci {
|
|
3467
|
+
constructor(i) {
|
|
3468
|
+
super(i), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = On;
|
|
3469
|
+
}
|
|
3470
|
+
static getDerivedStateFromError(i) {
|
|
3471
|
+
return { didCatch: !0, error: i };
|
|
3472
|
+
}
|
|
3473
|
+
resetErrorBoundary() {
|
|
3474
|
+
const { error: i } = this.state;
|
|
3475
|
+
if (i !== null) {
|
|
3476
|
+
for (var o, t, n = arguments.length, l = new Array(n), c = 0; c < n; c++) l[c] = arguments[c];
|
|
3477
|
+
(o = (t = this.props).onReset) === null || o === void 0 || o.call(t, { args: l, reason: "imperative-api" }), this.setState(On);
|
|
3478
|
+
}
|
|
3479
|
+
}
|
|
3480
|
+
componentDidCatch(i, o) {
|
|
3481
|
+
var t, n;
|
|
3482
|
+
(t = (n = this.props).onError) === null || t === void 0 || t.call(n, i, o);
|
|
3483
|
+
}
|
|
3484
|
+
componentDidUpdate(i, o) {
|
|
3485
|
+
const { didCatch: t } = this.state, { resetKeys: n } = this.props;
|
|
3486
|
+
var l, c;
|
|
3487
|
+
t && o.error !== null && function() {
|
|
3488
|
+
let m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
3489
|
+
return m.length !== a.length || m.some((s, u) => !Object.is(s, a[u]));
|
|
3490
|
+
}(i.resetKeys, n) && ((l = (c = this.props).onReset) === null || l === void 0 || l.call(c, { next: n, prev: i.resetKeys, reason: "keys" }), this.setState(On));
|
|
3491
|
+
}
|
|
3492
|
+
render() {
|
|
3493
|
+
const { children: i, fallbackRender: o, FallbackComponent: t, fallback: n } = this.props, { didCatch: l, error: c } = this.state;
|
|
3494
|
+
let m = i;
|
|
3495
|
+
if (l) {
|
|
3496
|
+
const a = { error: c, resetErrorBoundary: this.resetErrorBoundary };
|
|
3497
|
+
if (typeof o == "function") m = o(a);
|
|
3498
|
+
else if (t) m = Ee(t, a);
|
|
3499
|
+
else {
|
|
3500
|
+
if (n === void 0) throw c;
|
|
3501
|
+
m = n;
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
return Ee(Ru.Provider, { value: { didCatch: l, error: c, resetErrorBoundary: this.resetErrorBoundary } }, m);
|
|
3505
|
+
}
|
|
3506
|
+
}
|
|
3507
|
+
function xl(r) {
|
|
3508
|
+
var i, o, t = "";
|
|
3509
|
+
if (typeof r == "string" || typeof r == "number") t += r;
|
|
3510
|
+
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);
|
|
3511
|
+
else for (i in r) r[i] && (t && (t += " "), t += i);
|
|
3512
|
+
return t;
|
|
3513
|
+
}
|
|
3514
|
+
function Wt() {
|
|
3515
|
+
for (var r, i, o = 0, t = ""; o < arguments.length; ) (r = arguments[o++]) && (i = xl(r)) && (t && (t += " "), t += i);
|
|
3516
|
+
return t;
|
|
3517
|
+
}
|
|
3518
|
+
let Nu = { data: "" }, Fu = (r) => typeof window == "object" ? ((r ? r.querySelector("#_goober") : window._goober) || Object.assign((r || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : r || Nu, Iu = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, Ou = /\/\*[^]*?\*\/| +/g, Ka = /\n+/g, It = (r, i) => {
|
|
3519
|
+
let o = "", t = "", n = "";
|
|
3520
|
+
for (let l in r) {
|
|
3521
|
+
let c = r[l];
|
|
3522
|
+
l[0] == "@" ? l[1] == "i" ? o = l + " " + c + ";" : t += l[1] == "f" ? It(c, l) : l + "{" + It(c, l[1] == "k" ? "" : i) + "}" : typeof c == "object" ? t += It(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 += It.p ? It.p(l, c) : l + ":" + c + ";");
|
|
3523
|
+
}
|
|
3524
|
+
return o + (i && n ? i + "{" + n + "}" : n) + t;
|
|
3525
|
+
}, pt = {}, bl = (r) => {
|
|
3526
|
+
if (typeof r == "object") {
|
|
3527
|
+
let i = "";
|
|
3528
|
+
for (let o in r) i += o + bl(r[o]);
|
|
3529
|
+
return i;
|
|
3530
|
+
}
|
|
3531
|
+
return r;
|
|
3532
|
+
}, Au = (r, i, o, t, n) => {
|
|
3533
|
+
let l = bl(r), c = pt[l] || (pt[l] = ((a) => {
|
|
3534
|
+
let s = 0, u = 11;
|
|
3535
|
+
for (; s < a.length; ) u = 101 * u + a.charCodeAt(s++) >>> 0;
|
|
3536
|
+
return "go" + u;
|
|
3537
|
+
})(l));
|
|
3538
|
+
if (!pt[c]) {
|
|
3539
|
+
let a = l !== r ? r : ((s) => {
|
|
3540
|
+
let u, d, f = [{}];
|
|
3541
|
+
for (; u = Iu.exec(s.replace(Ou, "")); ) 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();
|
|
3542
|
+
return f[0];
|
|
3543
|
+
})(r);
|
|
3544
|
+
pt[c] = It(n ? { ["@keyframes " + c]: a } : a, o ? "" : "." + c);
|
|
3545
|
+
}
|
|
3546
|
+
let m = o && pt.g ? pt.g : null;
|
|
3547
|
+
return o && (pt.g = pt[c]), ((a, s, u, d) => {
|
|
3548
|
+
d ? s.data = s.data.replace(d, a) : s.data.indexOf(a) === -1 && (s.data = u ? a + s.data : s.data + a);
|
|
3549
|
+
})(pt[c], i, t, m), c;
|
|
3550
|
+
};
|
|
3551
|
+
function Jn(r) {
|
|
3552
|
+
let i = this || {}, o = r.call ? r(i.p) : r;
|
|
3553
|
+
return Au(o.unshift ? o.raw ? ((t, n, l) => t.reduce((c, m, a) => {
|
|
3554
|
+
let s = n[a];
|
|
3555
|
+
if (s && s.call) {
|
|
3556
|
+
let u = s(l), d = u && u.props && u.props.className || /^go/.test(u) && u;
|
|
3557
|
+
s = d ? "." + d : u && typeof u == "object" ? u.props ? "" : It(u, "") : u === !1 ? "" : u;
|
|
3558
|
+
}
|
|
3559
|
+
return c + m + (s ?? "");
|
|
3560
|
+
}, ""))(o, [].slice.call(arguments, 1), i.p) : o.reduce((t, n) => Object.assign(t, n && n.call ? n(i.p) : n), {}) : o, Fu(i.target), i.g, i.o, i.k);
|
|
3561
|
+
}
|
|
3562
|
+
function yl(r, i, o) {
|
|
3563
|
+
return i && function(t, n) {
|
|
3564
|
+
for (var l = 0; l < n.length; l++) {
|
|
3565
|
+
var c = n[l];
|
|
3566
|
+
c.enumerable = c.enumerable || !1, c.configurable = !0, "value" in c && (c.writable = !0), Object.defineProperty(t, c.key, c);
|
|
3567
|
+
}
|
|
3568
|
+
}(r.prototype, i), r;
|
|
3569
|
+
}
|
|
3570
|
+
function Me() {
|
|
3571
|
+
return Me = Object.assign || function(r) {
|
|
3572
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
3573
|
+
var o = arguments[i];
|
|
3574
|
+
for (var t in o) Object.prototype.hasOwnProperty.call(o, t) && (r[t] = o[t]);
|
|
3575
|
+
}
|
|
3576
|
+
return r;
|
|
3577
|
+
}, Me.apply(this, arguments);
|
|
3578
|
+
}
|
|
3579
|
+
function wl(r, i) {
|
|
3580
|
+
r.prototype = Object.create(i.prototype), r.prototype.constructor = r, r.__proto__ = i;
|
|
3581
|
+
}
|
|
3582
|
+
function Io(r, i) {
|
|
3583
|
+
if (r == null) return {};
|
|
3584
|
+
var o, t, n = {}, l = Object.keys(r);
|
|
3585
|
+
for (t = 0; t < l.length; t++) o = l[t], i.indexOf(o) >= 0 || (n[o] = r[o]);
|
|
3586
|
+
return n;
|
|
3587
|
+
}
|
|
3588
|
+
function Ya(r) {
|
|
3589
|
+
if (r === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3590
|
+
return r;
|
|
3591
|
+
}
|
|
3592
|
+
Jn.bind({ g: 1 }), Jn.bind({ k: 1 });
|
|
3593
|
+
var Za = function() {
|
|
3594
|
+
return "";
|
|
3595
|
+
}, Sl = le.createContext({ enqueueSnackbar: Za, closeSnackbar: Za }), An = "@media (max-width:599.95px)", on = "@media (min-width:600px)", Ja = function(r) {
|
|
3596
|
+
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
3597
|
+
}, br = function(r) {
|
|
3598
|
+
return "" + Ja(r.vertical) + Ja(r.horizontal);
|
|
3599
|
+
}, Xo = function(r) {
|
|
3600
|
+
return !!r || r === 0;
|
|
3601
|
+
}, Ko = "unmounted", _t = "exited", Ut = "entering", xo = "entered", Qa = "exiting", yr = function(r) {
|
|
3602
|
+
function i(t) {
|
|
3603
|
+
var n;
|
|
3604
|
+
n = r.call(this, t) || this;
|
|
3605
|
+
var l, c = t.appear;
|
|
3606
|
+
return n.appearStatus = null, t.in ? c ? (l = _t, n.appearStatus = Ut) : l = xo : l = t.unmountOnExit || t.mountOnEnter ? Ko : _t, n.state = { status: l }, n.nextCallback = null, n;
|
|
3607
|
+
}
|
|
3608
|
+
wl(i, r), i.getDerivedStateFromProps = function(t, n) {
|
|
3609
|
+
return t.in && n.status === Ko ? { status: _t } : null;
|
|
3610
|
+
};
|
|
3611
|
+
var o = i.prototype;
|
|
3612
|
+
return o.componentDidMount = function() {
|
|
3613
|
+
this.updateStatus(!0, this.appearStatus);
|
|
3614
|
+
}, o.componentDidUpdate = function(t) {
|
|
3615
|
+
var n = null;
|
|
3616
|
+
if (t !== this.props) {
|
|
3617
|
+
var l = this.state.status;
|
|
3618
|
+
this.props.in ? l !== Ut && l !== xo && (n = Ut) : l !== Ut && l !== xo || (n = Qa);
|
|
3619
|
+
}
|
|
3620
|
+
this.updateStatus(!1, n);
|
|
3621
|
+
}, o.componentWillUnmount = function() {
|
|
3622
|
+
this.cancelNextCallback();
|
|
3623
|
+
}, o.getTimeouts = function() {
|
|
3624
|
+
var t = this.props.timeout, n = t, l = t;
|
|
3625
|
+
return t != null && typeof t != "number" && typeof t != "string" && (l = t.exit, n = t.enter), { exit: l, enter: n };
|
|
3626
|
+
}, o.updateStatus = function(t, n) {
|
|
3627
|
+
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 });
|
|
3628
|
+
}, o.performEnter = function(t) {
|
|
3629
|
+
var n = this, l = this.props.enter, c = t, m = this.getTimeouts();
|
|
3630
|
+
t || l ? (this.props.onEnter && this.props.onEnter(this.node, c), this.safeSetState({ status: Ut }, function() {
|
|
3631
|
+
n.props.onEntering && n.props.onEntering(n.node, c), n.onTransitionEnd(m.enter, function() {
|
|
3632
|
+
n.safeSetState({ status: xo }, function() {
|
|
3633
|
+
n.props.onEntered && n.props.onEntered(n.node, c);
|
|
3634
|
+
});
|
|
3635
|
+
});
|
|
3636
|
+
})) : this.safeSetState({ status: xo }, function() {
|
|
3637
|
+
n.props.onEntered && n.props.onEntered(n.node, c);
|
|
3638
|
+
});
|
|
3639
|
+
}, o.performExit = function() {
|
|
3640
|
+
var t = this, n = this.props.exit, l = this.getTimeouts();
|
|
3641
|
+
n ? (this.props.onExit && this.props.onExit(this.node), this.safeSetState({ status: Qa }, function() {
|
|
3642
|
+
t.props.onExiting && t.props.onExiting(t.node), t.onTransitionEnd(l.exit, function() {
|
|
3643
|
+
t.safeSetState({ status: _t }, function() {
|
|
3644
|
+
t.props.onExited && t.props.onExited(t.node);
|
|
3645
|
+
});
|
|
3646
|
+
});
|
|
3647
|
+
})) : this.safeSetState({ status: _t }, function() {
|
|
3648
|
+
t.props.onExited && t.props.onExited(t.node);
|
|
3649
|
+
});
|
|
3650
|
+
}, o.cancelNextCallback = function() {
|
|
3651
|
+
this.nextCallback !== null && this.nextCallback.cancel && (this.nextCallback.cancel(), this.nextCallback = null);
|
|
3652
|
+
}, o.safeSetState = function(t, n) {
|
|
3653
|
+
n = this.setNextCallback(n), this.setState(t, n);
|
|
3654
|
+
}, o.setNextCallback = function(t) {
|
|
3655
|
+
var n = this, l = !0;
|
|
3656
|
+
return this.nextCallback = function() {
|
|
3657
|
+
l && (l = !1, n.nextCallback = null, t());
|
|
3658
|
+
}, this.nextCallback.cancel = function() {
|
|
3659
|
+
l = !1;
|
|
3660
|
+
}, this.nextCallback;
|
|
3661
|
+
}, o.onTransitionEnd = function(t, n) {
|
|
3662
|
+
this.setNextCallback(n);
|
|
3663
|
+
var l = t == null && !this.props.addEndListener;
|
|
3664
|
+
this.node && !l ? (this.props.addEndListener && this.props.addEndListener(this.node, this.nextCallback), t != null && setTimeout(this.nextCallback, t)) : setTimeout(this.nextCallback, 0);
|
|
3665
|
+
}, o.render = function() {
|
|
3666
|
+
var t = this.state.status;
|
|
3667
|
+
if (t === Ko) return null;
|
|
3668
|
+
var n = this.props;
|
|
3669
|
+
return (0, n.children)(t, Io(n, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]));
|
|
3670
|
+
}, yl(i, [{ key: "node", get: function() {
|
|
3671
|
+
var t, n = (t = this.props.nodeRef) === null || t === void 0 ? void 0 : t.current;
|
|
3672
|
+
if (!n) throw new Error("notistack - Custom snackbar is not refForwarding");
|
|
3673
|
+
return n;
|
|
3674
|
+
} }]), i;
|
|
3675
|
+
}(le.Component);
|
|
3676
|
+
function qt() {
|
|
3677
|
+
}
|
|
3678
|
+
function ei(r, i) {
|
|
3679
|
+
typeof r == "function" ? r(i) : r && (r.current = i);
|
|
3680
|
+
}
|
|
3681
|
+
function Qn(r, i) {
|
|
3682
|
+
return W(function() {
|
|
3683
|
+
return r == null && i == null ? null : function(o) {
|
|
3684
|
+
ei(r, o), ei(i, o);
|
|
3685
|
+
};
|
|
3686
|
+
}, [r, i]);
|
|
3687
|
+
}
|
|
3688
|
+
function ln(r) {
|
|
3689
|
+
var i = r.timeout, o = r.style, t = o === void 0 ? {} : o, n = r.mode;
|
|
3690
|
+
return { duration: typeof i == "object" ? i[n] || 0 : i, easing: t.transitionTimingFunction, delay: t.transitionDelay };
|
|
3691
|
+
}
|
|
3692
|
+
yr.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 };
|
|
3693
|
+
var Bu = "cubic-bezier(0.4, 0, 0.2, 1)", Lu = "cubic-bezier(0.0, 0, 0.2, 1)", Hu = "cubic-bezier(0.4, 0, 0.6, 1)", vl = function(r) {
|
|
3694
|
+
r.scrollTop = r.scrollTop;
|
|
3695
|
+
}, ti = function(r) {
|
|
3696
|
+
return Math.round(r) + "ms";
|
|
3697
|
+
};
|
|
3698
|
+
function Zt(r, i) {
|
|
3699
|
+
r === void 0 && (r = ["all"]);
|
|
3700
|
+
var o = i || {}, t = o.duration, n = t === void 0 ? 300 : t, l = o.easing, c = l === void 0 ? Bu : l, m = o.delay, a = m === void 0 ? 0 : m;
|
|
3701
|
+
return (Array.isArray(r) ? r : [r]).map(function(s) {
|
|
3702
|
+
var u = typeof n == "string" ? n : ti(n), d = typeof a == "string" ? a : ti(a);
|
|
3703
|
+
return s + " " + u + " " + c + " " + d;
|
|
3704
|
+
}).join(",");
|
|
3705
|
+
}
|
|
3706
|
+
function Cl(r) {
|
|
3707
|
+
var i = function(o) {
|
|
3708
|
+
return o && o.ownerDocument || document;
|
|
3709
|
+
}(r);
|
|
3710
|
+
return i.defaultView || window;
|
|
3711
|
+
}
|
|
3712
|
+
function Yo(r, i) {
|
|
3713
|
+
if (i) {
|
|
3714
|
+
var o = function(t, n) {
|
|
3715
|
+
var l, c = n.getBoundingClientRect(), m = Cl(n);
|
|
3716
|
+
if (n.fakeTransform) l = n.fakeTransform;
|
|
3717
|
+
else {
|
|
3718
|
+
var a = m.getComputedStyle(n);
|
|
3719
|
+
l = a.getPropertyValue("-webkit-transform") || a.getPropertyValue("transform");
|
|
3720
|
+
}
|
|
3721
|
+
var s = 0, u = 0;
|
|
3722
|
+
if (l && l !== "none" && typeof l == "string") {
|
|
3723
|
+
var d = l.split("(")[1].split(")")[0].split(",");
|
|
3724
|
+
s = parseInt(d[4], 10), u = parseInt(d[5], 10);
|
|
3725
|
+
}
|
|
3726
|
+
switch (t) {
|
|
3727
|
+
case "left":
|
|
3728
|
+
return "translateX(" + (m.innerWidth + s - c.left) + "px)";
|
|
3729
|
+
case "right":
|
|
3730
|
+
return "translateX(-" + (c.left + c.width - s) + "px)";
|
|
3731
|
+
case "up":
|
|
3732
|
+
return "translateY(" + (m.innerHeight + u - c.top) + "px)";
|
|
3733
|
+
default:
|
|
3734
|
+
return "translateY(-" + (c.top + c.height - u) + "px)";
|
|
3735
|
+
}
|
|
3736
|
+
}(r, i);
|
|
3737
|
+
o && (i.style.webkitTransform = o, i.style.transform = o);
|
|
3738
|
+
}
|
|
3739
|
+
}
|
|
3740
|
+
var kl = J(function(r, i) {
|
|
3741
|
+
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 = Io(r, ["children", "direction", "in", "style", "timeout", "onEnter", "onEntered", "onExit", "onExited"]), h = Se(null), y = Qn(o.ref, h), x = Qn(y, i), b = q(function() {
|
|
3742
|
+
h.current && Yo(n, h.current);
|
|
3743
|
+
}, [n]);
|
|
3744
|
+
return he(function() {
|
|
3745
|
+
if (!l && n !== "down" && n !== "right") {
|
|
3746
|
+
var g = function(v, C) {
|
|
3747
|
+
var k;
|
|
3748
|
+
function T() {
|
|
3749
|
+
for (var M = this, I = arguments.length, A = new Array(I), P = 0; P < I; P++) A[P] = arguments[P];
|
|
3750
|
+
clearTimeout(k), k = setTimeout(function() {
|
|
3751
|
+
v.apply(M, A);
|
|
3752
|
+
}, C);
|
|
3753
|
+
}
|
|
3754
|
+
return C === void 0 && (C = 166), T.clear = function() {
|
|
3755
|
+
clearTimeout(k);
|
|
3756
|
+
}, T;
|
|
3757
|
+
}(function() {
|
|
3758
|
+
h.current && Yo(n, h.current);
|
|
3759
|
+
}), w = Cl(h.current);
|
|
3760
|
+
return w.addEventListener("resize", g), function() {
|
|
3761
|
+
g.clear(), w.removeEventListener("resize", g);
|
|
3762
|
+
};
|
|
3763
|
+
}
|
|
3764
|
+
}, [n, l]), he(function() {
|
|
3765
|
+
l || b();
|
|
3766
|
+
}, [l, b]), Ee(yr, Object.assign({ appear: !0, nodeRef: h, onEnter: function(g, w) {
|
|
3767
|
+
Yo(n, g), vl(g), s && s(g, w);
|
|
3768
|
+
}, onEntered: u, onEntering: function(g) {
|
|
3769
|
+
var w = c?.transitionTimingFunction || Lu, v = ln({ timeout: a, mode: "enter", style: Me({}, c, { transitionTimingFunction: w }) });
|
|
3770
|
+
g.style.webkitTransition = Zt("-webkit-transform", v), g.style.transition = Zt("transform", v), g.style.webkitTransform = "none", g.style.transform = "none";
|
|
3771
|
+
}, onExit: function(g) {
|
|
3772
|
+
var w = c?.transitionTimingFunction || Hu, v = ln({ timeout: a, mode: "exit", style: Me({}, c, { transitionTimingFunction: w }) });
|
|
3773
|
+
g.style.webkitTransition = Zt("-webkit-transform", v), g.style.transition = Zt("transform", v), Yo(n, g), d && d(g);
|
|
3774
|
+
}, onExited: function(g) {
|
|
3775
|
+
g.style.webkitTransition = "", g.style.transition = "", f && f(g);
|
|
3776
|
+
}, in: l, timeout: a }, p), function(g, w) {
|
|
3777
|
+
return xs(o, Me({ ref: x, style: Me({ visibility: g !== "exited" || l ? void 0 : "hidden" }, c, {}, o.props.style) }, w));
|
|
3778
|
+
});
|
|
3779
|
+
});
|
|
3780
|
+
kl.displayName = "Slide";
|
|
3781
|
+
var gn = function(r) {
|
|
3782
|
+
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));
|
|
3783
|
+
}, zu = function() {
|
|
3784
|
+
return le.createElement(gn, 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
|
|
3785
|
+
10.59L10 14.17L17.59 6.58L19 8L10 17Z` }));
|
|
3786
|
+
}, Wu = function() {
|
|
3787
|
+
return le.createElement(gn, null, le.createElement("path", { d: "M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z" }));
|
|
3788
|
+
}, ju = function() {
|
|
3789
|
+
return le.createElement(gn, 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,
|
|
3790
|
+
6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
|
|
3791
|
+
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z` }));
|
|
3792
|
+
}, Vu = function() {
|
|
3793
|
+
return le.createElement(gn, null, le.createElement("path", { d: `M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
|
|
3794
|
+
0 22,12A10,10 0 0,0 12,2Z` }));
|
|
3795
|
+
}, Ft = { maxSnack: 3, persist: !1, hideIconVariant: !1, disableWindowBlurListener: !1, variant: "default", autoHideDuration: 5e3, iconVariant: { default: void 0, success: le.createElement(zu, null), warning: le.createElement(Wu, null), error: le.createElement(ju, null), info: le.createElement(Vu, null) }, anchorOrigin: { vertical: "bottom", horizontal: "left" }, TransitionComponent: kl, transitionDuration: { enter: 225, exit: 195 } }, $u = function(r, i) {
|
|
3796
|
+
return function(o, t) {
|
|
3797
|
+
return t === void 0 && (t = !1), t ? Me({}, Ft[o], {}, i[o], {}, r[o]) : o === "autoHideDuration" ? (n = r.autoHideDuration, l = i.autoHideDuration, (c = function(m) {
|
|
3798
|
+
return typeof m == "number" || m === null;
|
|
3799
|
+
})(n) ? n : c(l) ? l : Ft.autoHideDuration) : o === "transitionDuration" ? function(m, a) {
|
|
3800
|
+
var s = function(u, d) {
|
|
3801
|
+
return d.some(function(f) {
|
|
3802
|
+
return typeof u === f;
|
|
3803
|
+
});
|
|
3804
|
+
};
|
|
3805
|
+
return s(m, ["string", "number"]) ? m : s(m, ["object"]) ? Me({}, Ft.transitionDuration, {}, s(a, ["object"]) && a, {}, m) : s(a, ["string", "number"]) ? a : s(a, ["object"]) ? Me({}, Ft.transitionDuration, {}, a) : Ft.transitionDuration;
|
|
3806
|
+
}(r.transitionDuration, i.transitionDuration) : r[o] || i[o] || Ft[o];
|
|
3807
|
+
var n, l, c;
|
|
3808
|
+
};
|
|
3809
|
+
};
|
|
3810
|
+
function Oo(r) {
|
|
3811
|
+
return Object.entries(r).reduce(function(i, o) {
|
|
3812
|
+
var t, n = o[0], l = o[1];
|
|
3813
|
+
return Me({}, i, ((t = {})[n] = Jn(l), t));
|
|
3814
|
+
}, {});
|
|
3815
|
+
}
|
|
3816
|
+
var _u = "notistack-SnackbarContainer", Uu = "notistack-Snackbar", Tl = "notistack-CollapseWrapper", qu = "notistack-MuiContent", Gu = function(r) {
|
|
3817
|
+
return "notistack-MuiContent-" + r;
|
|
3818
|
+
}, oi = Oo({ root: { height: 0 }, entered: { height: "auto" } }), Bn = "0px", El = J(function(r, i) {
|
|
3819
|
+
var o = r.children, t = r.in, n = r.onExited, l = Se(null), c = Se(null), m = Qn(i, c), a = function() {
|
|
3820
|
+
return l.current ? l.current.clientHeight : 0;
|
|
3821
|
+
};
|
|
3822
|
+
return Ee(yr, { in: t, unmountOnExit: !0, onEnter: function(s) {
|
|
3823
|
+
s.style.height = Bn;
|
|
3824
|
+
}, onEntered: function(s) {
|
|
3825
|
+
s.style.height = "auto";
|
|
3826
|
+
}, onEntering: function(s) {
|
|
3827
|
+
var u = a(), d = ln({ timeout: 175, mode: "enter" }), f = d.duration, p = d.easing;
|
|
3828
|
+
s.style.transitionDuration = typeof f == "string" ? f : f + "ms", s.style.height = u + "px", s.style.transitionTimingFunction = p || "";
|
|
3829
|
+
}, onExit: function(s) {
|
|
3830
|
+
s.style.height = a() + "px";
|
|
3831
|
+
}, onExited: n, onExiting: function(s) {
|
|
3832
|
+
vl(s);
|
|
3833
|
+
var u = ln({ timeout: 175, mode: "exit" }), d = u.duration, f = u.easing;
|
|
3834
|
+
s.style.transitionDuration = typeof d == "string" ? d : d + "ms", s.style.height = Bn, s.style.transitionTimingFunction = f || "";
|
|
3835
|
+
}, nodeRef: c, timeout: 175 }, function(s, u) {
|
|
3836
|
+
return Ee("div", Object.assign({ ref: m, className: Wt(oi.root, s === "entered" && oi.entered), style: Me({ pointerEvents: "all", overflow: "hidden", minHeight: Bn, transition: Zt("height") }, s === "entered" && { overflow: "visible" }, {}, s === "exited" && !t && { visibility: "hidden" }) }, u), Ee("div", { ref: l, className: Tl, style: { display: "flex", width: "100%" } }, o));
|
|
3837
|
+
});
|
|
3838
|
+
});
|
|
3839
|
+
El.displayName = "Collapse";
|
|
3840
|
+
var ni = { right: "left", left: "right", bottom: "up", top: "down" }, Xu = function(r) {
|
|
3841
|
+
return "anchorOrigin" + br(r);
|
|
3842
|
+
}, Ku = function() {
|
|
3843
|
+
};
|
|
3844
|
+
function Eo(r, i) {
|
|
3845
|
+
return r.reduce(function(o, t) {
|
|
3846
|
+
return t == null ? o : function() {
|
|
3847
|
+
for (var n = arguments.length, l = new Array(n), c = 0; c < n; c++) l[c] = arguments[c];
|
|
3848
|
+
var m = [].concat(l);
|
|
3849
|
+
i && m.indexOf(i) === -1 && m.push(i), o.apply(this, m), t.apply(this, m);
|
|
3850
|
+
};
|
|
3851
|
+
}, Ku);
|
|
3852
|
+
}
|
|
3853
|
+
var Yu = typeof window < "u" ? St : he;
|
|
3854
|
+
function ri(r) {
|
|
3855
|
+
var i = Se(r);
|
|
3856
|
+
return Yu(function() {
|
|
3857
|
+
i.current = r;
|
|
3858
|
+
}), q(function() {
|
|
3859
|
+
return i.current.apply(void 0, arguments);
|
|
3860
|
+
}, []);
|
|
3861
|
+
}
|
|
3862
|
+
var Ln, Dl = J(function(r, i) {
|
|
3863
|
+
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() {
|
|
3864
|
+
m && m.apply(void 0, arguments);
|
|
3865
|
+
}), h = ri(function(b) {
|
|
3866
|
+
m && b != null && (f.current && clearTimeout(f.current), f.current = setTimeout(function() {
|
|
3867
|
+
p(null, "timeout", a);
|
|
3868
|
+
}, b));
|
|
3869
|
+
});
|
|
3870
|
+
he(function() {
|
|
3871
|
+
return s && h(n), function() {
|
|
3872
|
+
f.current && clearTimeout(f.current);
|
|
3873
|
+
};
|
|
3874
|
+
}, [s, n, h]);
|
|
3875
|
+
var y = function() {
|
|
3876
|
+
f.current && clearTimeout(f.current);
|
|
3877
|
+
}, x = q(function() {
|
|
3878
|
+
n != null && h(0.5 * n);
|
|
3879
|
+
}, [n, h]);
|
|
3880
|
+
return he(function() {
|
|
3881
|
+
if (!c && s) return window.addEventListener("focus", x), window.addEventListener("blur", y), function() {
|
|
3882
|
+
window.removeEventListener("focus", x), window.removeEventListener("blur", y);
|
|
3883
|
+
};
|
|
3884
|
+
}, [c, x, s]), Ee("div", Object.assign({ ref: i }, d, { className: Wt(Uu, t), onMouseEnter: function(b) {
|
|
3885
|
+
d.onMouseEnter && d.onMouseEnter(b), y();
|
|
3886
|
+
}, onMouseLeave: function(b) {
|
|
3887
|
+
d.onMouseLeave && d.onMouseLeave(b), x();
|
|
3888
|
+
} }), o);
|
|
3889
|
+
});
|
|
3890
|
+
Dl.displayName = "Snackbar";
|
|
3891
|
+
var Zu = Oo({ root: (Ln = { display: "flex", flexWrap: "wrap", flexGrow: 1 }, Ln[on] = { flexGrow: "initial", minWidth: "288px" }, Ln) }), wr = J(function(r, i) {
|
|
3892
|
+
var o = r.className, t = Io(r, ["className"]);
|
|
3893
|
+
return le.createElement("div", Object.assign({ ref: i, className: Wt(Zu.root, o) }, t));
|
|
3894
|
+
});
|
|
3895
|
+
wr.displayName = "SnackbarContent";
|
|
3896
|
+
var bo = Oo({ 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) {
|
|
3897
|
+
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;
|
|
3898
|
+
return typeof d == "function" && (d = d(o)), le.createElement(wr, { ref: i, role: "alert", "aria-describedby": ai, style: a, className: Wt(qu, Gu(c), bo.root, bo[c], s, !m && u && bo.lessPadding) }, le.createElement("div", { id: ai, className: bo.message }, m ? null : u, t), d && le.createElement("div", { className: bo.action }, d));
|
|
3899
|
+
});
|
|
3900
|
+
Pl.displayName = "MaterialDesignContent";
|
|
3901
|
+
var yo, Hn, Zo, Jo, zn, Ju = Y(Pl), Qu = Oo({ wrappedRoot: { width: "100%", position: "relative", transform: "translateX(0)", top: 0, right: 0, bottom: 0, left: 0, minWidth: "288px" } }), em = function(r) {
|
|
3902
|
+
var i = Se(), o = _(!0), t = o[0], n = o[1], l = Eo([r.snack.onClose, r.onClose]), c = q(function() {
|
|
3903
|
+
i.current = setTimeout(function() {
|
|
3904
|
+
n(function(M) {
|
|
3905
|
+
return !M;
|
|
3906
|
+
});
|
|
3907
|
+
}, 125);
|
|
3908
|
+
}, []);
|
|
3909
|
+
he(function() {
|
|
3910
|
+
return function() {
|
|
3911
|
+
i.current && clearTimeout(i.current);
|
|
3912
|
+
};
|
|
3913
|
+
}, []);
|
|
3914
|
+
var m, a = r.snack, s = r.classes, u = r.Component, d = u === void 0 ? Ju : u, f = W(function() {
|
|
3915
|
+
return function(M) {
|
|
3916
|
+
M === void 0 && (M = {});
|
|
3917
|
+
var I = { containerRoot: !0, containerAnchorOriginTopCenter: !0, containerAnchorOriginBottomCenter: !0, containerAnchorOriginTopRight: !0, containerAnchorOriginBottomRight: !0, containerAnchorOriginTopLeft: !0, containerAnchorOriginBottomLeft: !0 };
|
|
3918
|
+
return Object.keys(M).filter(function(A) {
|
|
3919
|
+
return !I[A];
|
|
3920
|
+
}).reduce(function(A, P) {
|
|
3921
|
+
var S;
|
|
3922
|
+
return Me({}, A, ((S = {})[P] = M[P], S));
|
|
3923
|
+
}, {});
|
|
3924
|
+
}(s);
|
|
3925
|
+
}, [s]), p = a.open, h = a.SnackbarProps, y = a.TransitionComponent, x = a.TransitionProps, b = a.transitionDuration, g = a.disableWindowBlurListener, w = a.content, v = Io(a, ["open", "SnackbarProps", "TransitionComponent", "TransitionProps", "transitionDuration", "disableWindowBlurListener", "content", "entered", "requestClose", "onEnter", "onEntered", "onExit", "onExited"]), C = Me({ direction: (m = v.anchorOrigin, m.horizontal !== "center" ? ni[m.horizontal] : ni[m.vertical]), timeout: b }, x), k = w;
|
|
3926
|
+
typeof k == "function" && (k = k(v.id, v.message));
|
|
3927
|
+
var T = ["onEnter", "onEntered", "onExit", "onExited"].reduce(function(M, I) {
|
|
3928
|
+
var A;
|
|
3929
|
+
return Me({}, M, ((A = {})[I] = Eo([r.snack[I], r[I]], v.id), A));
|
|
3930
|
+
}, {});
|
|
3931
|
+
return le.createElement(El, { in: t, onExited: T.onExited }, le.createElement(Dl, { open: p, id: v.id, disableWindowBlurListener: g, autoHideDuration: v.autoHideDuration, className: Wt(Qu.wrappedRoot, f.root, f[Xu(v.anchorOrigin)]), SnackbarProps: h, onClose: l }, le.createElement(y, Object.assign({}, C, { appear: !0, in: p, onExit: T.onExit, onExited: c, onEnter: T.onEnter, onEntered: Eo([T.onEntered, function() {
|
|
3932
|
+
r.snack.requestClose && l(null, "instructed", r.snack.id);
|
|
3933
|
+
}], v.id) }), k || le.createElement(d, Object.assign({}, v)))));
|
|
3934
|
+
}, wo = { default: 20 }, Qo = { default: 6, dense: 2 }, ii = "." + Tl, en = Oo({ root: (yo = { 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" }, yo[ii] = { padding: Qo.default + "px 0px", transition: "padding 300ms ease 0ms" }, yo.maxWidth = "calc(100% - " + 2 * wo.default + "px)", yo[An] = { width: "100%", maxWidth: "calc(100% - 32px)" }, yo), rootDense: (Hn = {}, Hn[ii] = { padding: Qo.dense + "px 0px" }, Hn), top: { top: wo.default - Qo.default + "px", flexDirection: "column" }, bottom: { bottom: wo.default - Qo.default + "px", flexDirection: "column-reverse" }, left: (Zo = { left: wo.default + "px" }, Zo[on] = { alignItems: "flex-start" }, Zo[An] = { left: "16px" }, Zo), right: (Jo = { right: wo.default + "px" }, Jo[on] = { alignItems: "flex-end" }, Jo[An] = { right: "16px" }, Jo), center: (zn = { left: "50%", transform: "translateX(-50%)" }, zn[on] = { alignItems: "center" }, zn) }), tm = Y(function(r) {
|
|
3935
|
+
var i = r.classes, o = i === void 0 ? {} : i, t = r.anchorOrigin, n = r.dense, l = r.children, c = Wt(_u, en[t.vertical], en[t.horizontal], en.root, o.containerRoot, o["containerAnchorOrigin" + br(t)], n && en.rootDense);
|
|
3936
|
+
return le.createElement("div", { className: c }, l);
|
|
3937
|
+
}), li = function(r) {
|
|
3938
|
+
return !(typeof r == "string" || or(r));
|
|
3939
|
+
}, om = function(r) {
|
|
3940
|
+
function i(o) {
|
|
3941
|
+
var t;
|
|
3942
|
+
return (t = r.call(this, o) || this).enqueueSnackbar = function(n, l) {
|
|
3943
|
+
if (l === void 0 && (l = {}), n == null) throw new Error("enqueueSnackbar called with invalid argument");
|
|
3944
|
+
var c = li(n) ? n : l, m = li(n) ? n.message : n, a = c.key, s = c.preventDuplicate, u = Io(c, ["key", "preventDuplicate"]), d = Xo(a), f = d ? a : (/* @__PURE__ */ new Date()).getTime() + Math.random(), p = $u(u, t.props), h = Me({ 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) });
|
|
3945
|
+
return h.persist && (h.autoHideDuration = void 0), t.setState(function(y) {
|
|
3946
|
+
if (s === void 0 && t.props.preventDuplicate || s) {
|
|
3947
|
+
var x = function(w) {
|
|
3948
|
+
return d ? w.id === f : w.message === m;
|
|
3949
|
+
}, b = y.queue.findIndex(x) > -1, g = y.snacks.findIndex(x) > -1;
|
|
3950
|
+
if (b || g) return y;
|
|
3951
|
+
}
|
|
3952
|
+
return t.handleDisplaySnack(Me({}, y, { queue: [].concat(y.queue, [h]) }));
|
|
3953
|
+
}), f;
|
|
3954
|
+
}, t.handleDisplaySnack = function(n) {
|
|
3955
|
+
return n.snacks.length >= t.maxSnack ? t.handleDismissOldest(n) : t.processQueue(n);
|
|
3956
|
+
}, t.processQueue = function(n) {
|
|
3957
|
+
var l = n.queue, c = n.snacks;
|
|
3958
|
+
return l.length > 0 ? Me({}, n, { snacks: [].concat(c, [l[0]]), queue: l.slice(1, l.length) }) : n;
|
|
3959
|
+
}, t.handleDismissOldest = function(n) {
|
|
3960
|
+
if (n.snacks.some(function(a) {
|
|
3961
|
+
return !a.open || a.requestClose;
|
|
3962
|
+
})) return n;
|
|
3963
|
+
var l = !1, c = !1;
|
|
3964
|
+
n.snacks.reduce(function(a, s) {
|
|
3965
|
+
return a + (s.open && s.persist ? 1 : 0);
|
|
3966
|
+
}, 0) === t.maxSnack && (c = !0);
|
|
3967
|
+
var m = n.snacks.map(function(a) {
|
|
3968
|
+
return l || a.persist && !c ? Me({}, a) : (l = !0, a.entered ? (a.onClose && a.onClose(null, "maxsnack", a.id), t.props.onClose && t.props.onClose(null, "maxsnack", a.id), Me({}, a, { open: !1 })) : Me({}, a, { requestClose: !0 }));
|
|
3969
|
+
});
|
|
3970
|
+
return Me({}, n, { snacks: m });
|
|
3971
|
+
}, t.handleEnteredSnack = function(n, l, c) {
|
|
3972
|
+
if (!Xo(c)) throw new Error("handleEnteredSnack Cannot be called with undefined key");
|
|
3973
|
+
t.setState(function(m) {
|
|
3974
|
+
return { snacks: m.snacks.map(function(a) {
|
|
3975
|
+
return a.id === c ? Me({}, a, { entered: !0 }) : Me({}, a);
|
|
3976
|
+
}) };
|
|
3977
|
+
});
|
|
3978
|
+
}, t.handleCloseSnack = function(n, l, c) {
|
|
3979
|
+
t.props.onClose && t.props.onClose(n, l, c);
|
|
3980
|
+
var m = c === void 0;
|
|
3981
|
+
t.setState(function(a) {
|
|
3982
|
+
var s = a.snacks, u = a.queue;
|
|
3983
|
+
return { snacks: s.map(function(d) {
|
|
3984
|
+
return m || d.id === c ? d.entered ? Me({}, d, { open: !1 }) : Me({}, d, { requestClose: !0 }) : Me({}, d);
|
|
3985
|
+
}), queue: u.filter(function(d) {
|
|
3986
|
+
return d.id !== c;
|
|
3987
|
+
}) };
|
|
3988
|
+
});
|
|
3989
|
+
}, t.closeSnackbar = function(n) {
|
|
3990
|
+
var l = t.state.snacks.find(function(c) {
|
|
3991
|
+
return c.id === n;
|
|
3992
|
+
});
|
|
3993
|
+
Xo(n) && l && l.onClose && l.onClose(null, "instructed", n), t.handleCloseSnack(null, "instructed", n);
|
|
3994
|
+
}, t.handleExitedSnack = function(n, l) {
|
|
3995
|
+
if (!Xo(l)) throw new Error("handleExitedSnack Cannot be called with undefined key");
|
|
3996
|
+
t.setState(function(c) {
|
|
3997
|
+
var m = t.processQueue(Me({}, c, { snacks: c.snacks.filter(function(a) {
|
|
3998
|
+
return a.id !== l;
|
|
3999
|
+
}) }));
|
|
4000
|
+
return m.queue.length === 0 ? m : t.handleDismissOldest(m);
|
|
4001
|
+
});
|
|
4002
|
+
}, t.enqueueSnackbar, t.closeSnackbar, t.state = { snacks: [], queue: [], contextValue: { enqueueSnackbar: t.enqueueSnackbar.bind(Ya(t)), closeSnackbar: t.closeSnackbar.bind(Ya(t)) } }, t;
|
|
4003
|
+
}
|
|
4004
|
+
return wl(i, r), i.prototype.render = function() {
|
|
4005
|
+
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(h, y) {
|
|
4006
|
+
var x, b = br(y.anchorOrigin), g = h[b] || [];
|
|
4007
|
+
return Me({}, h, ((x = {})[b] = [].concat(g, [y]), x));
|
|
4008
|
+
}, {}), p = Object.keys(f).map(function(h) {
|
|
4009
|
+
var y = f[h], x = y[0];
|
|
4010
|
+
return le.createElement(tm, { key: h, dense: a, anchorOrigin: x.anchorOrigin, classes: d }, y.map(function(b) {
|
|
4011
|
+
return le.createElement(em, { key: b.id, snack: b, classes: d, Component: u[b.variant], onClose: o.handleCloseSnack, onEnter: o.props.onEnter, onExit: o.props.onExit, onExited: Eo([o.handleExitedSnack, o.props.onExited], b.id), onEntered: Eo([o.handleEnteredSnack, o.props.onEntered], b.id) });
|
|
4012
|
+
}));
|
|
4013
|
+
});
|
|
4014
|
+
return le.createElement(Sl.Provider, { value: t }, c, l ? Jd(p, l) : p);
|
|
4015
|
+
}, yl(i, [{ key: "maxSnack", get: function() {
|
|
4016
|
+
return this.props.maxSnack || Ft.maxSnack;
|
|
4017
|
+
} }]), i;
|
|
4018
|
+
}(ci), Rl = function() {
|
|
4019
|
+
return fs(Sl);
|
|
4020
|
+
};
|
|
4021
|
+
const nm = [{ 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 }], rm = [{ 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 }];
|
|
4022
|
+
class am {
|
|
4023
|
+
constructor(i = nm, o = rm) {
|
|
4024
|
+
this._readFormatType = [], this._writeFormatType = [], this._readFormatType = Object.freeze([...i]), this._writeFormatType = Object.freeze([...o]);
|
|
4025
|
+
}
|
|
4026
|
+
getReadFormats() {
|
|
4027
|
+
return this._readFormatType;
|
|
4028
|
+
}
|
|
4029
|
+
getWriteFormats() {
|
|
4030
|
+
return this._writeFormatType;
|
|
4031
|
+
}
|
|
4032
|
+
getAllReadFormatTypeAsString() {
|
|
4033
|
+
const i = [], o = this._readFormatType;
|
|
4034
|
+
for (let t = 0; t < o.length; t++) for (let n = 0; n < o[t].exts.length; n++) i.push("." + o[t].exts[n]);
|
|
4035
|
+
return i;
|
|
4036
|
+
}
|
|
4037
|
+
async writeFile(i, o, t) {
|
|
4038
|
+
if (!o || !i) throw new Error("Workbook model or file name must be provided.");
|
|
4039
|
+
try {
|
|
4040
|
+
return (await import("@sheetxl/io")).WorkbookIO.writeFile(i, o, t);
|
|
4041
|
+
} catch (n) {
|
|
4042
|
+
throw new Error("Unable to load io library", { cause: n });
|
|
4043
|
+
}
|
|
4044
|
+
}
|
|
4045
|
+
async read(i, o) {
|
|
4046
|
+
let t, n;
|
|
4047
|
+
const l = await o?.showBusy?.(`Opening${i.name ? ` ${i.name}` : ""}...`);
|
|
4048
|
+
try {
|
|
4049
|
+
n = await import("@sheetxl/io");
|
|
4050
|
+
} catch (c) {
|
|
4051
|
+
throw c;
|
|
4052
|
+
}
|
|
4053
|
+
try {
|
|
4054
|
+
return await n.WorkbookIO.read({ ...i, async onStart(c) {
|
|
4055
|
+
await i?.onStart?.(c), t = await o?.showBusy?.(`Opening '${c}'...`);
|
|
4056
|
+
} });
|
|
4057
|
+
} catch (c) {
|
|
4058
|
+
throw l?.(), t?.(), c;
|
|
4059
|
+
} finally {
|
|
4060
|
+
l?.(), t?.();
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
}
|
|
4064
|
+
const Ot = new am(), 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) => {
|
|
4065
|
+
const { id: o, message: t, iconVariant: n, error: l, hideIconVariant: c, ...m } = r, { closeSnackbar: a } = Rl(), s = rt(), [u, d] = _(!1), f = q(() => {
|
|
4066
|
+
d((y) => !y);
|
|
4067
|
+
}, []), p = q(() => {
|
|
4068
|
+
a(o);
|
|
4069
|
+
}, [o, a]);
|
|
4070
|
+
let h = l?.message;
|
|
4071
|
+
return !h && or(t) && (h = t), h || typeof t != "string" || (h = t), h || (h = `Unknown Error: ${t}`), e(wr, { ref: i, className: Oe(ut.root, "error-snackbar"), children: j(Es, { className: ut.card, style: { backgroundColor: s.palette.error.dark, border: `1px solid ${s.palette.error.dark}` }, children: [j(Ds, { className: ut.actionRoot, children: [c ? null : n?.error, e(Be, { variant: "body2", component: "div", className: ut.typography, style: { color: s.palette.text.primary }, children: h }), e("div", { style: { flex: "1 1 auto" } }), j("div", { className: ut.icons, children: [l ? e(ct, { "aria-label": "Show more", size: "small", className: Oe(ut.expand, { [ut.expandOpen]: u }), style: { color: s.palette.action.active }, onClick: f, children: e(Si, {}) }) : null, e(ct, { size: "small", className: ut.expand, style: { color: s.palette.action.active }, onClick: p, children: e(Ci, { fontSize: "small" }) })] })] }), l ? e(Ps, { 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(hd, { error: l, hideLineNumbers: !0 }) }) }) : null] }) });
|
|
4072
|
+
});
|
|
4073
|
+
Ml.displayName = "ToastError";
|
|
4074
|
+
const Nl = Y(J((r, i) => {
|
|
4075
|
+
const { commands: o, commandHook: t, scope: n = "workbook", disabled: l = !1, ...c } = r, m = te((s) => {
|
|
4076
|
+
const u = { variant: ie.Menuitem, parentFloat: s.floatReference, commandHook: t, scope: n, disabled: l }, d = j(ce, { children: [e(O, { ...u, command: o.getCommand("newWorkbook"), icon: D(e(gd, {})) }), e(re, { orientation: "horizontal" }), e(O, { ...u, command: o.getCommand("openWorkbook"), icon: D(e(fd, {})) }), e(De, { ...u, commands: o, quickCommand: "saveWorkbook", icon: D(e(yd, {})), createPopupPanel: (f) => {
|
|
4077
|
+
const p = { ...u, parentFloat: f.floatReference, scope: "saveWorkbook" }, h = [];
|
|
4078
|
+
return Ot.getWriteFormats().forEach((y) => {
|
|
4079
|
+
if (y.isDefault) return;
|
|
4080
|
+
let x = null;
|
|
4081
|
+
y.key === "CSV" ? x = D(e(xd, {})) : y.key === "Excel" && (x = D(e(bd, {})));
|
|
4082
|
+
const b = o.getCommand(`saveWorkbookAs${y.key}`);
|
|
4083
|
+
b ? h.push(Ee(O, { ...p, key: y.key, command: b, icon: x })) : console.warn(`Unable to resolve command: 'saveWorkbookAs${y.key}'`);
|
|
4084
|
+
}), Ce({ ...f, children: h, onClick: () => {
|
|
4085
|
+
f.closeFloatAll();
|
|
4086
|
+
} });
|
|
4087
|
+
} })] });
|
|
4088
|
+
return Ce({ ...s, children: d, onClick: (f) => {
|
|
4089
|
+
f.isDefaultPrevented || s.closeFloatAll();
|
|
4090
|
+
} });
|
|
4091
|
+
}, [l, o, t, n]), a = "File";
|
|
4092
|
+
return e(De, { 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 }) });
|
|
4093
|
+
}));
|
|
4094
|
+
Nl.displayName = "StandaloneFileCommandButton";
|
|
4095
|
+
const im = e(nt, { label: "SheetXL", description: "Visit me at sheetxl.com.", children: e(B, { sx: { width: "24px", height: "24px", marginBottom: "4px", marginLeft: "6px" }, children: e(Zd, { onClick: () => {
|
|
4096
|
+
window?.open("https://www.sheetxl.com", "_blank");
|
|
4097
|
+
}, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), Fl = Y(J((r, i) => {
|
|
4098
|
+
const { commands: o, workbook: t, logo: n = im, mainElement: l, showFileMenu: c = !0, showAppearanceMenu: m = !0, ...a } = r, { reference: s } = oo(), [u, { width: d }] = Mo(), f = d < 530, p = c ? e(Nl, { commands: o, commandHook: { beforeExecute() {
|
|
4099
|
+
s?.closeAll();
|
|
4100
|
+
}, onError(b, g, w) {
|
|
4101
|
+
} } }) : null, h = m ? e(zp, { commands: o, commandHook: { beforeExecute() {
|
|
4102
|
+
s?.closeAll();
|
|
4103
|
+
}, onError(b, g, w) {
|
|
4104
|
+
} } }) : null, y = W(() => ({ paddingLeft: (b) => b.spacing(1), paddingRight: (b) => b.spacing(1) }), []), x = Se(null);
|
|
4105
|
+
return e(B, { ref: Fo([x, u, i]), ...a, children: pl({ commands: o, renderCompact: f, workbook: t, selectWrapper: (b) => j(B, { sx: { display: "flex", flex: "1", flexDirection: "row", alignItems: "stretch", gap: (g) => g.spacing(1), paddingLeft: (g) => g.spacing(1), paddingRight: (g) => g.spacing(1) }, children: [j(B, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (g) => g.spacing(0.5) }, children: [n, j(B, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (g) => g.spacing(0.25) }, children: [p, b] })] }), 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 && !h ? "0 0 auto" : "1 1 100%" }, children: h })] }), selectProps: y, toolbarsProps: { Home: { sx: {} } } }) });
|
|
4106
|
+
}));
|
|
4107
|
+
Fl.displayName = "StudioToolbar";
|
|
4108
|
+
const Il = Y(J((r, i) => {
|
|
4109
|
+
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(), h = p ? p.enqueueSnackbar : () => {
|
|
4110
|
+
}, y = p ? p.closeSnackbar : () => {
|
|
4111
|
+
}, [x, b] = _({ isMounted: !1, label: null, starting: /* @__PURE__ */ new Map(), running: /* @__PURE__ */ new Map() }), g = q(() => {
|
|
4112
|
+
b((F) => ({ ...F, isMounted: !0 }));
|
|
4113
|
+
}, []), w = q(() => {
|
|
4114
|
+
b((F) => ({ ...F, isMounted: !1 }));
|
|
4115
|
+
}, []), v = Sd(), C = vd(), k = Cd(), T = Se(/* @__PURE__ */ new Set()), M = W(() => {
|
|
4116
|
+
const F = (z, R) => {
|
|
4117
|
+
if (R?.onceKey) {
|
|
4118
|
+
if (T.current.has(R.onceKey)) return;
|
|
4119
|
+
const K = new Set(T.current);
|
|
4120
|
+
K.add(R.onceKey), T.current = K;
|
|
4121
|
+
}
|
|
4122
|
+
const E = { variant: R?.type ?? wt.Info, anchorOrigin: { vertical: "top", horizontal: "center" }, preventDuplicate: R?.preventDuplicate, persist: R?.persist ?? R?.type === wt.Error, action: (K) => e(ct, { onClick: () => y(K), children: e(Ld, {}) }) };
|
|
4123
|
+
R?.enqueueProps && Object.assign(E, R.enqueueProps), z || console.log("message is 'null'", R), h(z ?? "Alert", E);
|
|
4124
|
+
};
|
|
4125
|
+
return { showMessage: F, showBusy: (z, R) => {
|
|
4126
|
+
let E = null;
|
|
4127
|
+
const K = new Promise((ee) => {
|
|
4128
|
+
E = ee;
|
|
4129
|
+
});
|
|
4130
|
+
return b((ee) => {
|
|
4131
|
+
const X = new Map(ee.starting);
|
|
4132
|
+
return X.set(K, E), { ...ee, label: z, starting: X };
|
|
4133
|
+
}), K;
|
|
4134
|
+
}, showWindow: (z, R, E) => {
|
|
4135
|
+
const K = { ...R, onKeyDown: (ee) => {
|
|
4136
|
+
u?.dispatchToFocusedCommand(ee), ee.isDefaultPrevented() || ee.isPropagationStopped() || R?.onKeyDown?.(ee);
|
|
4137
|
+
} };
|
|
4138
|
+
return v(z, { sort: () => import("./CGVN-NJF8ZTm9apo.mjs"), numberFormat: () => import("./sHK4zKkWLGt2hVmW.mjs"), hyperlink: () => import("./B84RbTkXZiq6XIdH.mjs"), comments: () => import("./Bapmv0WdnDq3Jl_q.mjs"), find: () => import("./DHf2N2UY78nZFge3.mjs"), tableDetails: () => import("./Dlc8L0qha0mZFIkY.mjs"), tableNew: () => import("./CcLpUDzJOdfqQ8Kf.mjs"), namedDetails: () => import("./C0OuiugFYjsjbY8q.mjs") }[z], K, E);
|
|
4139
|
+
}, showOptions: C, showInputOptions: k, showError: (z) => {
|
|
4140
|
+
let R, E = wt.Error, K = "Unknown Error";
|
|
4141
|
+
typeof z == "string" ? K = z : z instanceof Error && (R = z, z.message && (K = z.message)), z instanceof Qd && (E = wt.Info), F(K, { type: E, enqueueProps: { error: R } });
|
|
4142
|
+
} };
|
|
4143
|
+
}, []), I = q(() => {
|
|
4144
|
+
}, []), A = ((F) => {
|
|
4145
|
+
const { workbook: z, setWorkbook: R, importExportDisabled: E, workbookTitle: K = "export", setWorkbookTitle: ee, notifier: X, requestWorkbookTitle: G, themeOptions: Z, undoManager: ge, commands: U, onExecute: V } = F, Q = te(Z?.onModeChange, [Z?.onModeChange]), me = te(Z?.onEnabledDarkGridChange, [Z?.onEnabledDarkGridChange]), Le = te(Z?.onEnabledDarkImagesChange, [Z?.onEnabledDarkImagesChange]), Fe = te(async (ae = null, Ae = null) => {
|
|
4146
|
+
const se = [];
|
|
4147
|
+
let ne, pe = null, ze = null;
|
|
4148
|
+
if (typeof ae == "string" ? ze = ae : pe = ae, ne = pe ? ae : await Jt.openFileDialog(ze ?? Ot.getAllReadFormatTypeAsString().join(",")), !ne) return null;
|
|
4149
|
+
const xe = { source: ne, createWorkbookOptions: Ae, onWarning: (dt) => {
|
|
4150
|
+
se.push(dt);
|
|
4151
|
+
} }, Ye = await Ot.read(xe, X);
|
|
4152
|
+
return se.length > 0 && (X?.showMessage?.("Some elements were not able to be imported. See console for details."), console.warn(`Import warnings:
|
|
4153
|
+
` + se.join(`
|
|
4154
|
+
`))), Ye;
|
|
4155
|
+
}, [V, X, z]), Ie = te(async (ae, Ae, se) => {
|
|
4156
|
+
if (!Ae && G) {
|
|
4157
|
+
const ne = await G("Enter Workbook name to " + (se.isDefault ? "Save." : `Export as ${se.description}.`));
|
|
4158
|
+
return ne !== null && Ot.writeFile(ne, ae, { formatType: se.key });
|
|
4159
|
+
}
|
|
4160
|
+
return Ot.writeFile(Ae, ae, { formatType: se.key });
|
|
4161
|
+
}, [X, z, G]), Pe = q(() => ({ contains: (ae) => !0, focus() {
|
|
4162
|
+
} }), []), He = W(() => {
|
|
4163
|
+
const ae = [];
|
|
4164
|
+
E || (Ot.getWriteFormats().forEach((se) => {
|
|
4165
|
+
const ne = se.isDefault, pe = { label: ne ? "Save Workbook" : `Save Workbook as ${se.description}`, scopedLabels: { workbook: "Save", saveWorkbook: `as ${se.description}` }, tags: se.tags, description: `Save the workbook to the desktop${ne ? "" : ` as ${se.description}`}.` };
|
|
4166
|
+
ne && (pe.shortcut = { key: "S", modifiers: [be.Ctrl] }, ae.push(new ye("saveWorkbookAs", Pe, { label: "Save Workbook As…", scopedLabels: { workbook: "Save as…", saveWorkbook: "as…" }, shortcut: [{ key: "S", modifiers: [be.Shift, be.Ctrl] }, { key: "F12" }], description: "Save the workbook to the desktop with the provided name." }, () => {
|
|
4167
|
+
Ie(z, null, se).catch((xe) => {
|
|
4168
|
+
X?.showError?.(xe);
|
|
4169
|
+
});
|
|
4170
|
+
})));
|
|
4171
|
+
const ze = ne ? "saveWorkbook" : `saveWorkbookAs${se.key}`;
|
|
4172
|
+
ae.push(new ye(ze, Pe, pe, (xe) => {
|
|
4173
|
+
Ie(z, xe ?? K, se).catch((Ye) => {
|
|
4174
|
+
X?.showError?.(Ye);
|
|
4175
|
+
});
|
|
4176
|
+
}));
|
|
4177
|
+
}), ae.push(new ye("openWorkbook", Pe, { label: "Open Workbook…", scopedLabels: { workbook: "Open…" }, description: "Open a workbook from the desktop.", shortcut: { key: "O", modifiers: [be.Ctrl] } }, async (se = null) => {
|
|
4178
|
+
const ne = { date1904: z.isDate1904(), ...z.options };
|
|
4179
|
+
try {
|
|
4180
|
+
const pe = await Fe(se, ne);
|
|
4181
|
+
if (!pe) return;
|
|
4182
|
+
const ze = pe.title, xe = pe.workbook, Ye = xe.getSelectedSheet();
|
|
4183
|
+
if (pe.formatType.mimeType === "text/csv") {
|
|
4184
|
+
const dt = z.findValidSheetName(ze);
|
|
4185
|
+
await z.doBatch(async () => {
|
|
4186
|
+
const Ao = Ye.getUsedRange();
|
|
4187
|
+
if (!Ao) return void X?.showMessage("The file appears to be blank.");
|
|
4188
|
+
await z.getSheets().add({ name: dt, autoSelect: !0 }).getRange({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }).copyFrom(Ao);
|
|
4189
|
+
}, `Import CSV '${ze}'`);
|
|
4190
|
+
} else z?.close(), ee?.(ze), R(xe);
|
|
4191
|
+
} catch (pe) {
|
|
4192
|
+
X?.showError?.(pe);
|
|
4193
|
+
}
|
|
4194
|
+
})), ae.push(new ye("openWorkbookFromUrl", Pe, { label: "Open Workbook From Web", scopedLabels: { insert: "From Web", workbook: "From Web…" }, description: "Open a workbook from the web." }, async function(se) {
|
|
4195
|
+
if (!se) {
|
|
4196
|
+
const ne = await X?.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"] });
|
|
4197
|
+
if (ne.option !== "Open") return;
|
|
4198
|
+
se = ne.input;
|
|
4199
|
+
}
|
|
4200
|
+
se && console.log("openWorkbookFromUrl", se);
|
|
4201
|
+
})));
|
|
4202
|
+
let Ae = [];
|
|
4203
|
+
return Z && (Ae = [new ye("themeMode", Pe, { label: "Light/Dark Mode", scopedLabels: { appearance: "Light/Dark Mode" }, description: "Toggle the application styling between light and dark mode." }), new ye("defaultThemeMode", Pe, { 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 ye("enableDarkGrid", Pe, { 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 ye("enableDarkImages", Pe, { 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." })]), [...ae, ...Ae, new Ue("help", Pe, { label: "Show Help", description: "Provide Help.", shortcut: { key: "F1" } }, () => {
|
|
4204
|
+
}), new Ue("showKeyboardShortcuts", Pe, { label: "Keyboard Shortcuts", description: "Show keyboard shortcuts.", shortcut: { key: "/", modifiers: [be.Ctrl] } }, () => {
|
|
4205
|
+
}), new ye("gotoUrlGithub", Pe, { label: "Github", description: "Download examples, explore source code, and leave a star." }, () => {
|
|
4206
|
+
window?.open("https://github.com/sheetxl/sheetxl");
|
|
4207
|
+
}), new ye("gotoUrlDiscord", Pe, { label: "Discord", description: "Join our community on discord." }, () => {
|
|
4208
|
+
window?.open("https://discord.gg/NTKdwUgK9p");
|
|
4209
|
+
}), new ye("gotoUrlDocumentation", Pe, { label: "Documentation", description: "Read the documentation." }, () => {
|
|
4210
|
+
window?.open("https://www.sheetxl.com/docs");
|
|
4211
|
+
}), new ye("gotoUrlIssue", Pe, { label: "Create Issue", description: "Create an issue to identify a bug or a feature request." }, () => {
|
|
4212
|
+
window?.open("https://github.com/sheetxl/sheetxl/issues");
|
|
4213
|
+
})];
|
|
4214
|
+
}, [z, K, X, E, Z, U, ge]), Ne = W(() => {
|
|
4215
|
+
let ae = null;
|
|
4216
|
+
return ae = U ? U.createChildGroup(Pe, "standaloneWorkbook", !1) : new ur(Pe, "standaloneWorkbook"), ae.addCommands(He, !0), ae;
|
|
4217
|
+
}, [U, He]);
|
|
4218
|
+
Wd({ manager: ge, commands: Ne, notifier: X });
|
|
4219
|
+
const { themeMode: H } = rl();
|
|
4220
|
+
he(() => {
|
|
4221
|
+
if (!Z || !Ne) return;
|
|
4222
|
+
const ae = Z.mode === "dark" || !Z.mode && H === "dark";
|
|
4223
|
+
Ne.getCommand("themeMode").update({ state: Z.mode ?? null, label: ae ? "Dark Mode" : "Light Mode", scopedLabels: { appearance: ae ? "Dark Mode" : "Light Mode" } }).updateCallback(() => {
|
|
4224
|
+
Q(ae ? Zn.Light : Zn.Dark);
|
|
4225
|
+
}), Ne.getCommand("defaultThemeMode").update({ state: !Z.mode }).updateCallback(() => {
|
|
4226
|
+
Q(null);
|
|
4227
|
+
}), Ne.getCommand("enableDarkGrid").update({ state: Z.enableDarkGrid }).updateCallback(() => {
|
|
4228
|
+
me(!Z.enableDarkGrid);
|
|
4229
|
+
}), Ne.getCommand("enableDarkImages").update({ state: Z.enableDarkImages }).updateCallback(() => {
|
|
4230
|
+
Le(!Z.enableDarkImages);
|
|
4231
|
+
});
|
|
4232
|
+
}, [H, Z, He]);
|
|
4233
|
+
const { showModal: oe } = wd();
|
|
4234
|
+
return he(() => {
|
|
4235
|
+
const ae = () => new Promise((Ae, se) => {
|
|
4236
|
+
const ne = le.lazy(() => import("./Csg-hJrzm9r4vJrm.mjs")), pe = oe(ne, { title: "Shortcut Keys Reference", commands: Ne, onDone: () => {
|
|
4237
|
+
pe.hide();
|
|
4238
|
+
}, TransitionProps: { onExited: () => {
|
|
4239
|
+
Ae(!0);
|
|
4240
|
+
} } });
|
|
4241
|
+
});
|
|
4242
|
+
Ne.getCommand("showKeyboardShortcuts").updateCallback(() => ae()), Ne.getCommand("help").updateCallback(() => ae());
|
|
4243
|
+
}, [He, Ne]), Ne;
|
|
4244
|
+
})({ workbook: o, setWorkbook: t, importExportDisabled: d, workbookTitle: l, setWorkbookTitle: c, commands: u, requestWorkbookTitle: (F) => new Promise((z) => {
|
|
4245
|
+
n.current ? n.current.requestWorkbookTitle((R, E) => {
|
|
4246
|
+
z(R);
|
|
4247
|
+
}, { selectAll: !0, requestReason: F }) : z(m);
|
|
4248
|
+
}), themeOptions: f, undoManager: s, notifier: M, onExecute: I });
|
|
4249
|
+
he(() => {
|
|
4250
|
+
x.starting.size <= 0 || !x.isMounted || b((F) => {
|
|
4251
|
+
const z = new Map(F.running);
|
|
4252
|
+
return F.starting.forEach((R, E) => {
|
|
4253
|
+
const K = () => {
|
|
4254
|
+
b((ee) => {
|
|
4255
|
+
const X = new Map(ee.running);
|
|
4256
|
+
return X.delete(E), { ...ee, running: X };
|
|
4257
|
+
});
|
|
4258
|
+
};
|
|
4259
|
+
z.set(E, K), R(K);
|
|
4260
|
+
}), { ...F, starting: /* @__PURE__ */ new Map(), running: z };
|
|
4261
|
+
});
|
|
4262
|
+
}, [x]);
|
|
4263
|
+
const [P, S] = _(null);
|
|
4264
|
+
he(() => {
|
|
4265
|
+
x.starting.size !== 0 || x.running.size !== 0 ? S(e(Lt, { icon: e(kd, { sx: { transform: "scale(0.7)", marginLeft: "-6px" } }), panel: !0, label: x.label, onMount: g, onUnmount: w, sx: { position: "absolute", left: "0", top: "0", width: "100%", height: "100%", zIndex: "9999" } })) : S(null);
|
|
4266
|
+
}, [x.starting, x.running]);
|
|
4267
|
+
const N = W(() => e(Wp, { commands: A, disableHover: !0, sx: { padding: "0" }, buttonProps: { sx: { maxHeight: "22px" } } }), [A]), L = { notifier: M, commands: A };
|
|
4268
|
+
return o && (L.statusBarProps = { childrenEnd: N }), j(ce, { children: [P, a ? le.cloneElement(a, L) : null] });
|
|
4269
|
+
}));
|
|
4270
|
+
Il.displayName = "SnackbarAndCommandsWrapper";
|
|
4271
|
+
const er = Y(J((r, i) => {
|
|
4272
|
+
const { className: o, sx: t, style: n, onElementLoad: l, onError: c, undoManager: m, errorPanel: a = Td, onKeyDown: s, workbook: u, createWorkbookOptions: d, onWorkbookChange: f, logo: p, importExportDisabled: h = !1, themeOptions: y, autoFocus: x = !1, commands: b, title: g, onTitleChange: w, titleProps: v, renderLoadingPanel: C, ...k } = r, T = Se(null), M = te(f, [f]), I = te(w ?? v?.onTitleChange, [w ?? v?.onTitleChange]), A = v?.placeHolder ?? "Untitled", P = y?.mode, { themeMode: S, source: N } = rl({ mode: P }), L = W(() => ({ ...y, light: ia(!1, Jt.deepMerge(y?.theme ?? {}, y?.light ?? {})), dark: ia(!0, Jt.deepMerge(y?.theme ?? {}, y?.dark ?? {})) }), [y]), F = S === Zn.Dark, [z, R] = _(null);
|
|
4273
|
+
he(() => {
|
|
4274
|
+
R(m ?? new ep());
|
|
4275
|
+
}, [m]);
|
|
4276
|
+
const [E, K] = _(null), [ee, X] = _(null), G = hr();
|
|
4277
|
+
St(() => {
|
|
4278
|
+
if (!u || Object.keys(u).length === 0 && !Jt.isPromiseLike(u)) {
|
|
4279
|
+
const ne = { theme: G.getDefaultTheme(), ...d };
|
|
4280
|
+
X(new Wn(ne));
|
|
4281
|
+
} else X(u);
|
|
4282
|
+
}, [u]), St(() => {
|
|
4283
|
+
if (ee) {
|
|
4284
|
+
if (ee instanceof Wn) return K({ workbook: ee }), void (u !== ee && M?.(ee));
|
|
4285
|
+
(async () => {
|
|
4286
|
+
try {
|
|
4287
|
+
let ne, pe = await Promise.resolve(ee);
|
|
4288
|
+
pe && pe.source && (pe = await Ot.read(pe)), pe.workbook ? (Q(pe.title), ne = pe.workbook) : ne = pe, M?.(ne), K({ workbook: ne });
|
|
4289
|
+
} catch (ne) {
|
|
4290
|
+
M?.(null), K({ error: ne });
|
|
4291
|
+
}
|
|
4292
|
+
})();
|
|
4293
|
+
}
|
|
4294
|
+
}, [ee]);
|
|
4295
|
+
const [Z, ge] = _(null);
|
|
4296
|
+
he(() => {
|
|
4297
|
+
if (!z || !E) return;
|
|
4298
|
+
z.clear();
|
|
4299
|
+
const ne = E?.workbook?.getTransactions();
|
|
4300
|
+
if (ne)
|
|
4301
|
+
return ne.addListener({ onCommitEnd: (pe) => {
|
|
4302
|
+
pe.getDescription() ? z.addUndoOperation({ description: pe.getDescription(), undo: () => (ne.revert(pe.getId()), Z.source?.focus(), () => {
|
|
4303
|
+
ne.restore(pe.getId()), Z.source?.focus();
|
|
4304
|
+
}) }) : console.warn("commit has no description", pe);
|
|
4305
|
+
} });
|
|
4306
|
+
}, [z, E, Z]);
|
|
4307
|
+
const U = te((ne) => {
|
|
4308
|
+
ne ? z.setRepeatableOperation({ description: ne.label(), repeat: async () => ne.execute() }) : z.setRepeatableOperation(null);
|
|
4309
|
+
}, [z]), [V, Q] = _(g ?? v?.title ?? "");
|
|
4310
|
+
he(() => {
|
|
4311
|
+
Q(g ?? v?.title ?? "");
|
|
4312
|
+
}, [g ?? v?.title]), he(() => {
|
|
4313
|
+
I?.(V);
|
|
4314
|
+
}, [V]);
|
|
4315
|
+
const [me, Le] = _(null), Fe = W(() => {
|
|
4316
|
+
const ne = () => ({ contains: (pe) => !0, focus() {
|
|
4317
|
+
} });
|
|
4318
|
+
return b ? b.createChildGroup(ne, "application", !1) : new ur(ne, "application");
|
|
4319
|
+
}, [b]), Ie = te((ne) => {
|
|
4320
|
+
Le(ne.source.getViewportElement()), ge(ne), Fe.activate("sheet"), l?.(ne);
|
|
4321
|
+
}, [Fe]);
|
|
4322
|
+
he(() => {
|
|
4323
|
+
Z && x && Z.source?.focus(typeof x == "object" ? x : void 0);
|
|
4324
|
+
}, [Z]);
|
|
4325
|
+
const Pe = Se(null), He = q((ne) => {
|
|
4326
|
+
let pe = null;
|
|
4327
|
+
return v?.hidden || (pe = e(fl, { ...v, style: { maxWidth: "100%", ...v?.style }, workbook: T.current, ref: Pe, title: V, placeHolder: A, onTitleChange: (ze) => {
|
|
4328
|
+
Q(ze);
|
|
4329
|
+
} })), e(Fl, { ...ne, logo: p, mainElement: pe, showFileMenu: !h, showAppearanceMenu: !!(L?.onEnabledDarkGridChange || L?.onEnabledDarkImagesChange || L?.onModeChange) });
|
|
4330
|
+
}, [p, V, v, L, h, Fe]);
|
|
4331
|
+
he(() => {
|
|
4332
|
+
const ne = (pe) => pe.preventDefault();
|
|
4333
|
+
return T.current?.addEventListener("wheel", ne, { passive: !1 }), () => {
|
|
4334
|
+
T.current?.removeEventListener("wheel", ne);
|
|
4335
|
+
};
|
|
4336
|
+
}, []);
|
|
4337
|
+
const Ne = W(() => {
|
|
4338
|
+
const ne = { transparentBackground: !0 };
|
|
4339
|
+
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?.(ne) ?? e(Lt, { ...ne }) });
|
|
4340
|
+
}, [t, n, C]), H = q(({ error: ne }) => (c?.(ne), e(a, { sx: t, style: n, error: ne ?? "Unable to display empty workbook." })), [t, n, c]), oe = W(() => ({ ...t, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-MuiContent *": { fontFamily: (ne) => ne.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [t]), ae = Fo([T, i]), Ae = W(() => {
|
|
4341
|
+
if (!E) return Ne;
|
|
4342
|
+
if (E.error || !E.workbook) return H({ error: E.error });
|
|
4343
|
+
let ne = null, pe = null, ze = !1;
|
|
4344
|
+
return L && (ne = F ? L.dark : L.light, pe = F && L.enableDarkGrid ? L.dark : L.light, ze = L.enableDarkImages), e(gl, { sx: oe, style: n, tabIndex: 0, autoFocus: !0, workbook: E.workbook, ref: ae, renderToolbar: He, onElementLoad: Ie, onRepeatCommandChange: U, onKeyDown: (xe) => {
|
|
4345
|
+
s?.(xe);
|
|
4346
|
+
}, renderLoadingPanel: C, gridTheme: pe, headersTheme: ne, enableDarkImages: ze, className: Oe(o, "sheetxl-workbook"), onContextMenu: (xe) => xe.preventDefault(), ...k }, "WorkbookElement");
|
|
4347
|
+
}, [E, V, z, Ne, C, L, k, He, oe]);
|
|
4348
|
+
let se = e(Mu, { fallbackRender: H, children: e(om, { maxSnack: 3, domRoot: me, anchorOrigin: { vertical: "bottom", horizontal: "right" }, autoHideDuration: 3500, onClose: (ne, pe, ze) => {
|
|
4349
|
+
T.current?.focus();
|
|
4350
|
+
}, Components: { error: Ml }, iconVariant: { success: e(rr, { 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(Dd, { style: { marginRight: "8px" } }) }, children: e(Ed, { children: e(Il, { workbook: E?.workbook, setWorkbook: X, importExportDisabled: h, titlePlaceHolder: A, titleWorkbook: V, setWorkbookTitle: Q, refWorkbookTitle: Pe, commands: Fe, undoManager: z, themeOptions: L, children: Ae }) }) }) });
|
|
4351
|
+
return L && (se = j(ki, { theme: F ? L.dark : L.light, children: [L.cssBaseline ? e(Rs, {}) : null, se] })), se;
|
|
4352
|
+
}));
|
|
4353
|
+
er.displayName = "EagerStudio";
|
|
4354
|
+
const lm = Object.freeze(Object.defineProperty({ __proto__: null, EagerStudio: er, default: er }, Symbol.toStringTag, { value: "Module" }));
|
|
4355
|
+
export {
|
|
4356
|
+
pp as $,
|
|
4357
|
+
Hp as A,
|
|
4358
|
+
gp as B,
|
|
4359
|
+
sp as C,
|
|
4360
|
+
Ri as D,
|
|
4361
|
+
zp as E,
|
|
4362
|
+
xp as F,
|
|
4363
|
+
Wp as G,
|
|
4364
|
+
tp as H,
|
|
4365
|
+
Pi as I,
|
|
4366
|
+
Bi as J,
|
|
4367
|
+
fr as K,
|
|
4368
|
+
hp as L,
|
|
4369
|
+
fp as M,
|
|
4370
|
+
jp as N,
|
|
4371
|
+
ma as O,
|
|
4372
|
+
Ii as P,
|
|
4373
|
+
km as Q,
|
|
4374
|
+
Vp as R,
|
|
4375
|
+
Pu as S,
|
|
4376
|
+
Cm as T,
|
|
4377
|
+
Ni as U,
|
|
4378
|
+
op as V,
|
|
4379
|
+
Dp as W,
|
|
4380
|
+
mp as X,
|
|
4381
|
+
ap as Y,
|
|
4382
|
+
To as Z,
|
|
4383
|
+
Xn as _,
|
|
4384
|
+
Np as a,
|
|
4385
|
+
gr as a0,
|
|
4386
|
+
Ei as a1,
|
|
4387
|
+
Ap as a2,
|
|
4388
|
+
Bp as a3,
|
|
4389
|
+
Lp as a4,
|
|
4390
|
+
Wi as a5,
|
|
4391
|
+
zi as a6,
|
|
4392
|
+
Gi as a7,
|
|
4393
|
+
qi as a8,
|
|
4394
|
+
Xi as a9,
|
|
4395
|
+
Zp as aa,
|
|
4396
|
+
Fp as ab,
|
|
4397
|
+
Ki as ac,
|
|
4398
|
+
Yi as ad,
|
|
4399
|
+
Zi as ae,
|
|
4400
|
+
Em as af,
|
|
4401
|
+
Tu as ag,
|
|
4402
|
+
gl as ah,
|
|
4403
|
+
fl as ai,
|
|
4404
|
+
ml as aj,
|
|
4405
|
+
ul as ak,
|
|
4406
|
+
hu as al,
|
|
4407
|
+
gu as am,
|
|
4408
|
+
Zn as an,
|
|
4409
|
+
za as ao,
|
|
4410
|
+
rl as ap,
|
|
4411
|
+
er as aq,
|
|
4412
|
+
am as ar,
|
|
4413
|
+
Ot as as,
|
|
4414
|
+
cl as at,
|
|
4415
|
+
dl as au,
|
|
4416
|
+
ou as av,
|
|
4417
|
+
ll as aw,
|
|
4418
|
+
Wt as b,
|
|
4419
|
+
vo as c,
|
|
4420
|
+
Gn as d,
|
|
4421
|
+
el as e,
|
|
4422
|
+
Oe as f,
|
|
4423
|
+
Tm as g,
|
|
4424
|
+
np as h,
|
|
4425
|
+
rp as i,
|
|
4426
|
+
bp as j,
|
|
4427
|
+
yp as k,
|
|
4428
|
+
wp as l,
|
|
4429
|
+
Di as m,
|
|
4430
|
+
Sp as n,
|
|
4431
|
+
vp as o,
|
|
4432
|
+
Mi as p,
|
|
4433
|
+
vm as q,
|
|
4434
|
+
mn as r,
|
|
4435
|
+
Ro as s,
|
|
4436
|
+
Cp as t,
|
|
4437
|
+
Mo as u,
|
|
4438
|
+
kp as v,
|
|
4439
|
+
Tp as w,
|
|
4440
|
+
Ep as x,
|
|
4441
|
+
Rp as y,
|
|
4442
|
+
Op as z
|
|
4443
|
+
};
|