@sheetxl/studio-mui 0.7.0 → 0.7.2
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/{KXseQ40_i5EYIHKK.cjs → B7w0OTmhuQrwQqVN.cjs} +2 -2
- package/browser/cjs/{Bgu3xn0Cn2HA02Su.cjs → BAbmJ4Ls0UAVWref.cjs} +3 -3
- package/browser/cjs/{t38E_xyFAcXesvqI.cjs → BTKJQTAiNX3PUH4J.cjs} +1 -1
- package/browser/cjs/{nD4ZrH7GY9tL6jBb.cjs → BvWKmFKC47AMDMFu.cjs} +2 -2
- package/browser/cjs/{BPKIn_9g0i3MzfMN.cjs → BwWj-AITfsL6qDpj.cjs} +1 -1
- package/browser/cjs/{CnNsjFH5STB8YFnm.cjs → DI5l6QVkb01TsEwV.cjs} +2 -2
- package/browser/cjs/{BIQy_mYkeFierSYz.cjs → DZhb2mEKXfkKfz6x.cjs} +1 -1
- package/browser/cjs/{kkkMrcgx-UG947kj.cjs → DpVOTM5LqKLF9WSk.cjs} +1 -1
- package/browser/cjs/{ZhYgttIRpv6rp7L5.cjs → Dz_LzICPkmdzQlzy.cjs} +11 -11
- package/browser/cjs/{D0KhAxuRFasImcjz.cjs → JOT43QluehBYwrKS.cjs} +1 -1
- package/browser/cjs/{WIkOIZdQ3MHoNFCf.cjs → Sm5xZWmdTjSCJxOx.cjs} +2 -2
- package/browser/cjs/{DnCsHDERpndJWBKT.cjs → Vrlvn1CfPRQisLYL.cjs} +2 -2
- package/browser/cjs/index.cjs +3 -3
- package/browser/esm/{BP0rO_pXLWXUrJtK.mjs → C4RZiafsbwfiLz-C.mjs} +1 -1
- package/browser/esm/{Bja4UhmOvImesWqh.mjs → CGIwipEW4v4OPSB8.mjs} +1 -1
- package/browser/esm/{Bg9E-5r3eADMJeXD.mjs → CMzmkaChmbnHntkb.mjs} +2 -2
- package/browser/esm/{CIwpe1l87iWZgPzm.mjs → CPjkuTz3sLh-etcJ.mjs} +1 -1
- package/browser/esm/{lYmMz7iPOSHyXkWi.mjs → CPuHFKqFT5LF6fXj.mjs} +1 -1
- package/browser/esm/{CP5FNbEmHjc1XKW1.mjs → CzxKHjziUuDxKzIn.mjs} +2 -2
- package/browser/esm/{D84rEMHoj0Q57z-P.mjs → DLrKIbuNE76u-F3y.mjs} +1259 -1257
- package/browser/esm/{CN9FboPd76rHcKVD.mjs → DUS29WdqCMuVVLpm.mjs} +1 -1
- package/browser/esm/{dfxFsL62VVhss7NK.mjs → Dh7XtuX1cWz1nW_v.mjs} +3 -3
- package/browser/esm/{vyIqqykVTPodlHMo.mjs → DzgkcKlJrnETrT-z.mjs} +2 -2
- package/browser/esm/{DS4DfMBqYb3Tiowe.mjs → Q18D_b2fTBJ7QH7K.mjs} +2 -2
- package/browser/esm/{C1ZdrEMByvpqZzTc.mjs → Su0kqIblR6zTAjB2.mjs} +2 -2
- package/browser/esm/index.mjs +82 -79
- package/node/assets/style.css +1 -1
- package/node/esm/{BEEGbztmxsqkp5hi.mjs → 1bQb13SILtJFnqBQ.mjs} +1 -1
- package/node/esm/{BGiOKSIfimbTrYfQ.mjs → 5715fftg6SqkmbCs.mjs} +1 -1
- package/node/esm/{4-NJ3B4jsYrqa5FL.mjs → BNH5761S3vit417d.mjs} +1 -1
- package/node/esm/{BaPccVvLo0Pzi3CC.mjs → BYxSe-f9SXkVQCOn.mjs} +1 -1
- package/node/esm/{DcrF4IMpmfF3lWdF.mjs → CJQiYToWJ-8AaD8d.mjs} +1 -1
- package/node/esm/{DsSHYONTZ2cTtLM7.mjs → DfoPtVWCLOfcAoCg.mjs} +1 -1
- package/node/esm/{BqnbvRx15uK96d3d.mjs → Dw2SSXphjQ4gTuEe.mjs} +1 -1
- package/node/esm/{qUJaR0FQsW_xewvW.mjs → _Nq9WHxw-bmMA6Eh.mjs} +1 -1
- package/node/esm/{B__0Jl_FlO9vmntO.mjs → d78UMCfSqw7_DwUj.mjs} +1 -1
- package/node/esm/index.mjs +1201 -1196
- package/node/esm/{CkNv_LFqNB-mu6nl.mjs → uS3k2AKeGAjgsirO.mjs} +1 -1
- package/package.json +8 -8
- package/types/index.d.ts +6 -0
package/node/esm/index.mjs
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.2
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
7
|
import { Color as e, IColor as t, ITheme as o, CommonUtils as n, IBorder as a, IFont as r, NumberFormat as l, IFontCollection as i, IStyle as s, ITextFrame as d, Table as c, IFill as m, CoordUtils as p, ISheet as u, LicenseManager as g, Workbook as h, TypesUtils as f } from "@sheetxl/sdk";
|
|
8
8
|
import { LicenseManager } from "@sheetxl/sdk";
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
9
|
+
import { StyledStrokePath as x, StaticBorderRenderer as b, FontUtils as y, useModelListener as w, createCellEditStateFromCell as k, SheetCellEditor as S, ScriptEditor as C, useDocThemes as v, TabStrip as T, SheetElement as D, SheetScrollbar as P, PictureEditor as R, ChartEditor as M, EmptyFrame as F, LogoNoPaddingIcon as B } from "@sheetxl/react";
|
|
10
|
+
import { useModelListener, useRangeListener } from "@sheetxl/react";
|
|
11
|
+
import { jsx as N, jsxs as E, Fragment as A } from "react/jsx-runtime";
|
|
12
|
+
import I, { memo as L, forwardRef as H, useMemo as W, useCallback as z, isValidElement as $, useState as O, useEffect as V, Suspense as G, useRef as U, createElement as j, useReducer as _, useImperativeHandle as q, useLayoutEffect as K } from "react";
|
|
13
|
+
import { Box as X, Typography as Z, IconButton as J, MenuItem as Y, Divider as Q, Button as ee, SvgIcon as te, Input as oe, FormControlLabel as ne, Checkbox as ae, useMediaQuery as re, FormControl as le, TextField as ie, InputAdornment as se, Slider as de, Paper as ce, CircularProgress as me, DialogTitle as pe, Select as ue, Tabs as ge, Tab as he, Card as fe, CardActions as xe, Collapse as be, CssBaseline as ye } from "@mui/material";
|
|
14
|
+
import { themeIcon as we, CommandButton as ke, ExhibitDivider as Se, FormatIndentDecreaseIcon as Ce, FormatIndentIncreaseIcon as ve, defaultCreatePopupPanel as Te, CommandPopupButton as De, TextVerticalTopIcon as Pe, TextVerticalCenterIcon as Re, TextVerticalBottomIcon as Me, TextHorizontalOverflowIcon as Fe, TextHorizontalWrapIcon as Be, TextHorizontalClipIcon as Ne, TextHorizontalShrinkIcon as Ee, TextRotation315Icon as Ae, TextRotation45Icon as Ie, TextRotation90Icon as Le, TextRotation2702Icon as He, TextRotationCustomIcon as We, TextRotation0Icon as ze, InputCommandButton as $e, SimpleTooltip as Oe, LoadingPanel as Ve, PopupButtonType as Ge, ExhibitPopupIconButton as Ue, ExhibitPopupMenuItem as je, ColorizedCircleIcon as _e, ExhibitMenuItem as qe, createStrokeShadowFilter as Ke, strokeShadowFilter as Xe, ColorizedStrokeIcon as Ze, ExhibitTooltip as Je, ExhibitIconButton as Ye, CommandTooltip as Qe, MergeAllIcon as et, MergeHorizontalIcon as tt, MergeVerticalIcon as ot, MergeUnMergeIcon as nt, FreezeBothIcon as at, FreezeRowsIcon as rt, FreezeColumnsIcon as lt, FreezeIcon as it, FindIcon as st, FindReplaceIcon as dt, GotoIcon as ct, TextSizeIncreaseIcon as mt, TextSizeDecreaseIcon as pt, SelectedIcon as ut, CurrencyDollarIcon as gt, PercentIcon as ht, CommaIcon as ft, IncreaseDecimalIcon2 as xt, DecreaseDecimalIcon2 as bt, ClearAllIcon as yt, ClearFormatsIcon as wt, ClearContentsIcon as kt, FillDownIcon as St, InsertCells as Ct, InsertRowIcon as vt, InsertColumn2Icon as Tt, BlankIcon as Dt, RemoveCellsIcon as Pt, RemoveRowIcon as Rt, RemoveColumn2Icon as Mt, LabelIcon as Ft, SortIncreaseIcon as Bt, SortDecreaseIcon as Nt, SortCustomIcon as Et, FilterToggleIcon as At, FilterClearIcon as It, FilterReapplyIcon as Lt, RedoIcon as Ht, UndoIcon as Wt, TextStrikeIcon as zt, TextSuperscriptIcon as $t, TextSubscriptIcon as Ot, TextUnderlineIcon as Vt, TextUnderlineDoubleIcon as Gt, TextUnderlineAccountingIcon as Ut, TextUnderlineAccountingDoubleIcon as jt, PasteIcon as _t, PasteValuesIcon as qt, PasteFormatsIcon as Kt, PasteFormulasIcon as Xt, PasteTransposeIcon as Zt, PasteLinksIcon as Jt, NewPresetStylesIcon as Yt, PresetStylesIcon as Qt, ExhibitMenuHeader as eo, ContextMenu as to, Theme2Icon as oo, SystemDefaultDarkMode as no, SystemDefaultLightMode as ao, GithubIcon as ro, DiscordIcon as lo, DocumentationIcon as io, TicketIcon as so, HelpIcon as co, InsertImageIcon as mo, WalkingCopyIcon as po, SimpleCommandPopupButton as uo, FunctionThinIcon as go, FunctionSumIcon as ho, FormulaGroupIcon as fo, FormulaFinancialIcon as xo, FormulaLogicalIcon as bo, FormulaTextIcon as yo, FormulaDateTimeIcon as wo, FormulaLookupReferenceIcon as ko, FormulaMathTrigIcon as So, FormulaStatisticalIcon as Co, FormulaEngineeringIcon as vo, FormulaInformationIcon as To, FormulaCubeIcon as Do, FormulaDatabaseIcon as Po, FormulaWebIcon as Ro, FormulaCustomIcon as Mo, ExhibitOptionButton as Fo, SelectRangeModeIcon as Bo, hexToRGB as No, useFloatStack as Eo, CellSelectionIcon as Ao, CellSelectionRemoveIcon as Io, CellSelectionEditIcon as Lo, InsertTableIcon as Ho, CellSelectionInsertIcon as Wo, CloseErrorIcon as zo, CheckSuccessIcon as $o, FunctionIcon as Oo, VisibilityOffIcon as Vo, elevateColor as Go, ThemedIcon as Uo, ScriptNewIcon as jo, ScriptFormulaIcon as _o, ScriptMacroIcon as qo, ScriptSaveIcon as Ko, CommandToolbar as Xo, CodeIcon as Zo, ScriptRunIcon as Jo, ColorizedTextIcon as Yo, ColorizedFillIcon as Qo, FormatPaintIcon as en, TextBoldIcon as tn, TextItalicIcon as on, InsertHyperlinkIcon as nn, InsertCommentIcon as an, FormulaViewIcon as rn, ViewZeroIcon as ln, FullScreenOffIcon as sn, FullScreenIcon as dn, createScrollEdgeButton as cn, createScrollEndButton as mn, createScrollStartButton as pn, HideColumnIcon as un, ShowColumnIcon as gn, HideRowIcon as hn, ShowRowIcon as fn, ColumnsResizeAutoIcon as xn, RowsResizeAutoIcon as bn, CutIcon as yn, DrawAspectIcon as wn, DrawAlignLeftIcon as kn, DrawResizeIcon as Sn, DrawAlignDistributeVertIcon as Cn, DrawAlignDistributeHorzIcon as vn, DrawAlignBottomIcon as Tn, DrawAlignMiddleIcon as Dn, DrawAlignTopIcon as Pn, DrawAlignRightIcon as Rn, DrawAlignCenterIcon as Mn, DrawMoveBackwardIcon as Fn, DrawToBackIcon as Bn, DrawMoveForwardIcon as Nn, DrawToFrontIcon as En, scrollbarTheming as An, StackTrace as In, FileNewIcon as Ln, FileOpenIcon as Hn, FileDownloadAsCSVIcon as Wn, FileDownloadAsExcelIcon as zn, FileDownloadAsSheetIcon as $n, useResolvedThemeMode as On, ThemeMode as Vn, useModal as Gn, useLazyWindow as Un, useOptionsDialog as jn, useInputDialog as _n, AnimatedTraversingEllipsisIcon as qn, ErrorPanel as Kn, createExhibitTheme as Xn, ModalProvider as Zn, ErrorAlertIcon as Jn } from "@sheetxl/utils-mui";
|
|
15
|
+
import Yn from "clsx";
|
|
16
|
+
import { FormatAlignLeft as Qn, FormatAlignCenter as ea, FormatAlignRight as ta, FormatAlignJustify as oa, Colorize as na, DarkMode as aa, LightMode as ra, Keyboard as la, Remove as ia, Add as sa, ExpandLess as da, ExpandMore as ca, Lock as ma, MoreHoriz as pa, WebhookOutlined as ua, Close as ga, AddCircleOutline as ha, Menu as fa, CancelOutlined as xa } from "@mui/icons-material";
|
|
17
|
+
import { useCommands as ba, CommandButtonType as ya, useCallbackRef as wa, ReactUtils as ka, KeyCodes as Sa, useCommand as Ca, useEditMode as va, useMouseDownAndHoldListener as Ta, NotificationType as Da, useImperativeElement as Pa, SplitPane as Ra, RoundedTab as Ma, SimpleCommand as Fa, Command as Ba, KeyModifiers as Na, CommandGroup as Ea, ToolTipPlacement as Aa, ScrollPane as Ia, useUndoManager as La } from "@sheetxl/utils-react";
|
|
18
|
+
import { useTheme as Ha, alpha as Wa, getOverlayAlpha as za, ThemeProvider as $a } from "@mui/material/styles";
|
|
18
19
|
import { alpha as Oa } from "@mui/system";
|
|
19
20
|
import { useFormContext as Va } from "react-hook-form";
|
|
20
21
|
import { ResizableBox as Ga } from "react-resizable";
|
|
@@ -26,62 +27,62 @@ import { useFullscreen as Ja } from "rooks";
|
|
|
26
27
|
import { IOUtils as Ya } from "@sheetxl/io";
|
|
27
28
|
import { ErrorBoundary as Qa } from "react-error-boundary";
|
|
28
29
|
import { useSnackbar as er, SnackbarContent as tr, SnackbarProvider as or } from "notistack";
|
|
29
|
-
const nr =
|
|
30
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, parentFloat: l2, ...i2 } = e2, s2 =
|
|
30
|
+
const nr = L(H((e2, t2) => {
|
|
31
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, parentFloat: l2, ...i2 } = e2, s2 = ba(o2, ["formatAlignLeftToggle", "formatAlignCenterToggle", "formatAlignRightToggle", "formatAlignJustifyToggle", "formatAlignCenterContinuousToggle", "formatAlignFillToggle", "formatAlignDistributedHorizontalToggle"]), d2 = W(() => {
|
|
31
32
|
for (let e3 = 0; e3 < s2.length; e3++) if (s2[e3]?.state()) return s2[e3].key();
|
|
32
33
|
return s2[0]?.key();
|
|
33
|
-
}, [s2]), c2 =
|
|
34
|
+
}, [s2]), c2 = W(() => {
|
|
34
35
|
const e3 = /* @__PURE__ */ new Map();
|
|
35
|
-
return e3.set("formatAlignLeftToggle",
|
|
36
|
-
}, []), m2 =
|
|
36
|
+
return e3.set("formatAlignLeftToggle", we(N(Qn, {}))), e3.set("formatAlignCenterToggle", we(N(ea, {}))), e3.set("formatAlignRightToggle", we(N(ta, {}))), e3.set("formatAlignJustifyToggle", we(N(oa, {}))), e3.set("formatAlignCenterContinuousToggle", we(N(ea, {}))), e3.set("formatAlignFillToggle", we(N(oa, {}))), e3.set("formatAlignDistributedHorizontalToggle", we(N(oa, {}))), e3;
|
|
37
|
+
}, []), m2 = W(() => {
|
|
37
38
|
if (!n2) return null;
|
|
38
39
|
const e3 = { ...n2 };
|
|
39
40
|
return delete e3.beforeExecute, e3;
|
|
40
|
-
}, [n2]), p2 =
|
|
41
|
-
const o3 = { variant:
|
|
42
|
-
return
|
|
41
|
+
}, [n2]), p2 = z((e3, t3) => {
|
|
42
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("formatAlignLeftToggle"), icon: c2.get("formatAlignLeftToggle") }), N(ke, { ...o3, command: t3.getCommand("formatAlignCenterToggle"), icon: c2.get("formatAlignCenterToggle") }), N(ke, { ...o3, command: t3.getCommand("formatAlignRightToggle"), icon: c2.get("formatAlignRightToggle") }), N(ke, { ...o3, command: t3.getCommand("formatAlignJustifyToggle"), icon: c2.get("formatAlignJustifyToggle") }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("formatAlignCenterContinuousToggle"), icon: c2.get("formatAlignCenterContinuousToggle") }), N(ke, { ...o3, command: t3.getCommand("formatAlignFillToggle"), icon: c2.get("formatAlignFillToggle") }), N(ke, { ...o3, command: t3.getCommand("formatAlignDistributedHorizontalToggle"), icon: c2.get("formatAlignDistributedHorizontalToggle") })] }), s3 = E(X, { sx: { className: Yn("quick-buttons"), display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (e4) => e4.stopPropagation(), children: [N(ke, { command: t3.getCommand("formatIndentDecrease"), commandHook: m2, scope: a2, disabled: r2, icon: we(N(Ce, {})) }), N(ke, { command: t3.getCommand("formatIndentIncrease"), commandHook: m2, scope: a2, disabled: r2, icon: we(N(ve, {})) })] }), d3 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...i2, children: [s3, N(Se, { orientation: "horizontal" }), N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: l3 })] });
|
|
43
|
+
return Te({ ...e3, children: d3 });
|
|
43
44
|
}, [r2, n2]);
|
|
44
|
-
return
|
|
45
|
-
})), ar =
|
|
46
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
45
|
+
return N(De, { ref: t2, parentFloat: l2, commands: o2, commandHook: n2, scope: a2, createPopupPanel: p2, label: "Horizontal Alignment", tooltip: "Configure how text is placed in the horizontal direction of the cell.", quickCommand: d2, icon: c2.get(d2) ?? N(Qn, {}), ...i2 });
|
|
46
|
+
})), ar = L(H((e2, t2) => {
|
|
47
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["formatAlignTopToggle", "formatAlignMiddleToggle", "formatAlignBottomToggle", "formatAlignJustifyVerticalToggle", "formatAlignDistributedVerticalToggle"]), s2 = W(() => {
|
|
47
48
|
for (let e3 = 0; e3 < i2.length; e3++) if (i2[e3]?.state()) return i2[e3].key();
|
|
48
49
|
return i2[0]?.key();
|
|
49
|
-
}, [i2]), d2 =
|
|
50
|
+
}, [i2]), d2 = W(() => {
|
|
50
51
|
const e3 = /* @__PURE__ */ new Map();
|
|
51
|
-
return e3.set("formatAlignTopToggle",
|
|
52
|
-
}, []), c2 =
|
|
53
|
-
const o3 = { variant:
|
|
54
|
-
return
|
|
52
|
+
return e3.set("formatAlignTopToggle", we(N(Pe, {}))), e3.set("formatAlignMiddleToggle", we(N(Re, {}))), e3.set("formatAlignBottomToggle", we(N(Me, {}))), e3.set("formatAlignJustifyVerticalToggle", we(N(oa, {}))), e3.set("formatAlignDistributedVerticalToggle", we(N(oa, {}))), e3;
|
|
53
|
+
}, []), c2 = z((e3, t3) => {
|
|
54
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("formatAlignTopToggle"), icon: d2.get("formatAlignTopToggle") }), N(ke, { ...o3, command: t3.getCommand("formatAlignMiddleToggle"), icon: d2.get("formatAlignMiddleToggle") }), N(ke, { ...o3, command: t3.getCommand("formatAlignBottomToggle"), icon: d2.get("formatAlignBottomToggle") }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("formatAlignJustifyVerticalToggle"), icon: d2.get("formatAlignJustifyVerticalToggle") }), N(ke, { ...o3, command: t3.getCommand("formatAlignDistributedVerticalToggle"), icon: d2.get("formatAlignDistributedVerticalToggle") })] });
|
|
55
|
+
return Te({ ...e3, children: l3 });
|
|
55
56
|
}, [r2, n2, d2]);
|
|
56
|
-
return
|
|
57
|
-
})), rr =
|
|
58
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
57
|
+
return N(De, { ref: t2, commands: o2, commandHook: n2, createPopupPanel: c2, label: "Vertical Alignment", tooltip: "Configure how text is placed in the vertical direction of the cell.", icon: d2.get(s2) ?? we(N(Me, {})), ...l2 });
|
|
58
|
+
})), rr = L(H((e2, t2) => {
|
|
59
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["formatTextOverflowVisibleToggle", "formatTextOverflowWrapToggle", "formatTextOverflowClipToggle", "formatTextOverflowShrinkToggle"]), s2 = W(() => {
|
|
59
60
|
for (let e3 = 0; e3 < i2.length; e3++) if (i2[e3]?.state()) return i2[e3].key();
|
|
60
61
|
return i2[0]?.key();
|
|
61
|
-
}, [i2]), d2 =
|
|
62
|
+
}, [i2]), d2 = W(() => {
|
|
62
63
|
const e3 = /* @__PURE__ */ new Map();
|
|
63
|
-
return e3.set("formatTextOverflowVisibleToggle",
|
|
64
|
-
}, []), c2 =
|
|
65
|
-
const o3 = { variant:
|
|
66
|
-
return
|
|
64
|
+
return e3.set("formatTextOverflowVisibleToggle", we(N(Fe, {}))), e3.set("formatTextOverflowWrapToggle", we(N(Be, {}))), e3.set("formatTextOverflowClipToggle", we(N(Ne, {}))), e3.set("formatTextOverflowShrinkToggle", we(N(Ee, {}))), e3;
|
|
65
|
+
}, []), c2 = wa((e3, t3) => {
|
|
66
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("formatTextOverflowVisibleToggle"), icon: d2.get("formatTextOverflowVisibleToggle") }), N(ke, { ...o3, command: t3.getCommand("formatTextOverflowWrapToggle"), icon: d2.get("formatTextOverflowWrapToggle") }), N(ke, { ...o3, command: t3.getCommand("formatTextOverflowClipToggle"), icon: d2.get("formatTextOverflowClipToggle") }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("formatTextOverflowShrinkToggle"), icon: d2.get("formatTextOverflowShrinkToggle") })] });
|
|
67
|
+
return Te({ ...e3, children: l3 });
|
|
67
68
|
}, [r2, n2, a2]);
|
|
68
|
-
return
|
|
69
|
-
})), lr =
|
|
70
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
69
|
+
return N(De, { ref: t2, commands: o2, commandHook: n2, scope: a2, label: "Text Overflow", tooltip: "Configure how text behaves when it doesn't fit within a cell.", createPopupPanel: c2, icon: d2.get(s2) ?? we(N(Fe, {})), ...l2 });
|
|
70
|
+
})), lr = L(H((e2, t2) => {
|
|
71
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["formatTextRotate0", "formatTextRotate315", "formatTextRotate45", "formatTextRotate90", "formatTextRotate270", "formatSubscriptToggle", "formatTextRotateCustom"]), s2 = W(() => {
|
|
71
72
|
const e3 = i2.length;
|
|
72
73
|
for (let t3 = 0; t3 < e3; t3++) {
|
|
73
74
|
const e4 = i2[t3];
|
|
74
75
|
if (e4?.state()) return e4.key();
|
|
75
76
|
}
|
|
76
77
|
return i2[1]?.key();
|
|
77
|
-
}, [i2]), d2 =
|
|
78
|
+
}, [i2]), d2 = W(() => {
|
|
78
79
|
const e3 = /* @__PURE__ */ new Map();
|
|
79
|
-
return e3.set("formatTextRotate0",
|
|
80
|
-
}, []), c2 =
|
|
81
|
-
const o3 = { variant:
|
|
82
|
-
return
|
|
83
|
-
}, [r2, n2, a2, o2]), m2 =
|
|
84
|
-
return
|
|
80
|
+
return e3.set("formatTextRotate0", we(N(Ae, {}))), e3.set("formatTextRotate315", we(N(Ae, {}))), e3.set("formatTextRotate45", we(N(Ie, {}))), e3.set("formatTextRotate90", we(N(Le, {}))), e3.set("formatTextRotate270", we(N(He, {}))), e3.set("formatTextRotateCustom", we(N(We, {}))), e3;
|
|
81
|
+
}, []), c2 = z((e3, t3) => {
|
|
82
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("formatTextRotate0"), icon: we(N(ze, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("formatTextRotate315"), icon: we(N(Ae, {})) }), N(ke, { ...o3, command: t3.getCommand("formatTextRotate45"), icon: we(N(Ie, {})) }), N(ke, { ...o3, command: t3.getCommand("formatTextRotate90"), icon: we(N(Le, {})) }), N(ke, { ...o3, command: t3.getCommand("formatTextRotate270"), icon: we(N(He, {})) }), N(Se, { orientation: "horizontal" }), N($e, { ...o3, command: t3.getCommand("formatTextRotateCustom"), icon: we(N(We, {})), label: "Custom" })] });
|
|
83
|
+
return Te({ ...e3, children: l3 });
|
|
84
|
+
}, [r2, n2, a2, o2]), m2 = W(() => 0 !== (o2.getCommand("formatTextRotateCustom")?.state() ?? 0), [i2]);
|
|
85
|
+
return N(De, { ref: t2, commands: o2, commandHook: n2, scope: a2, selected: m2, label: "Text Orientation", tooltip: "Rotate your text diagonally or vertically. This is a great way to label narrow columns.", createPopupPanel: c2, quickCommand: m2 ? "formatTextRotate0" : "formatTextRotate315", icon: we(d2.get(s2) ?? N(Ae, {})), ...l2 });
|
|
85
86
|
})), ir = { Preset: "preset", Custom: "custom" }, sr = { Start: "start", End: "end" }, dr = {}, cr = (e2, t2, o2, n2) => {
|
|
86
87
|
const a2 = e2 + "-" + t2 + "-" + o2 + (n2 ? "-server" : "");
|
|
87
88
|
if (dr[a2]) return dr[a2];
|
|
@@ -93,59 +94,59 @@ const nr = k(S((e2, t2) => {
|
|
|
93
94
|
return r3 ? (r3.fillStyle = e3, r3.fillRect(0, 0, a3.width, a3.height), r3.fillStyle = t3, r3.fillRect(0, 0, o3, o3), r3.translate(o3, o3), r3.fillRect(0, 0, o3, o3), a3.toDataURL()) : null;
|
|
94
95
|
})(e2, t2, o2, n2);
|
|
95
96
|
return dr[a2] = r2, r2;
|
|
96
|
-
}, mr = {}, pr =
|
|
97
|
-
const { className: t2, style: o2 =
|
|
98
|
-
return
|
|
99
|
-
}), ur =
|
|
100
|
-
const { selectedColor: t2, onSelectColor: o2, onPreviewColor: n2, onClick: a2, onKeyDown: r2, onMouseOver: l2, onMouseLeave: i2, onFocus: s2, style: d2 =
|
|
97
|
+
}, mr = {}, pr = L((e2) => {
|
|
98
|
+
const { className: t2, style: o2 = ka.EmptyCssProperties, white: n2 = "transparent", grey: a2 = "grey", size: r2 = 8, borderRadius: l2, boxShadow: i2, renderers: s2 = mr, children: d2, ...c2 } = e2, m2 = d2, p2 = W(() => Object.assign({ borderRadius: l2, boxShadow: i2, position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", background: `url(${cr(n2, a2, r2, s2?.canvas)}) center left` }, o2), [n2, a2, r2, s2]);
|
|
99
|
+
return $(d2) ? I.cloneElement(d2, { ...m2.props }) : N("div", { style: p2, ...c2 });
|
|
100
|
+
}), ur = L((e2) => {
|
|
101
|
+
const { selectedColor: t2, onSelectColor: o2, onPreviewColor: n2, onClick: a2, onKeyDown: r2, onMouseOver: l2, onMouseLeave: i2, onFocus: s2, style: d2 = ka.EmptyCssProperties, children: c2, alphaWhite: m2, alphaGrey: p2, darkMode: u2, alphaCheckSize: g2 = 7, ...h2 } = e2;
|
|
101
102
|
if (!t2) throw new Error("a selectedColor is required");
|
|
102
|
-
const f2 =
|
|
103
|
+
const f2 = z((e3) => {
|
|
103
104
|
a2?.(e3), e3.isDefaultPrevented() || (e3.ctrlKey ? n2?.(t2.toRGBA()) : o2?.(t2.toRGBA()));
|
|
104
|
-
}, [o2, n2, a2, t2]),
|
|
105
|
+
}, [o2, n2, a2, t2]), x2 = z((e3) => {
|
|
105
106
|
l2?.(e3), e3.isDefaultPrevented() || n2?.(t2.toRGBA());
|
|
106
|
-
}, [n2, l2, t2]),
|
|
107
|
+
}, [n2, l2, t2]), b2 = z((e3) => {
|
|
107
108
|
i2?.(e3), e3.isDefaultPrevented();
|
|
108
|
-
}, [n2, i2]),
|
|
109
|
+
}, [n2, i2]), y2 = z((e3) => {
|
|
109
110
|
s2?.(e3), e3.isDefaultPrevented() || n2?.(t2.toRGBA());
|
|
110
|
-
}, [n2, s2, t2]),
|
|
111
|
-
r2?.(e3), e3.isDefaultPrevented() || e3.keyCode ===
|
|
112
|
-
}, [o2, r2, t2]),
|
|
113
|
-
return
|
|
114
|
-
}), gr =
|
|
115
|
-
const { schemeColorLookup: n2, selectedColor: a2, previewColor: r2, colorDef: l2, onSelectColorDef: i2, onPreviewColorDef: s2, swatchProps: d2, defaultButtonSize: c2 = 24, isLarge: m2 = false, compareRGB: p2 = false, darkMode: u2 = false, ...g2 } = o2, h2 = new e({ val: l2.definition.val, adjs: l2.definition.adjs }, (e2) => n2(e2)), f2 = p2 ? h2.toRGBA().toString() : h2.toString(),
|
|
116
|
-
|
|
117
|
-
const
|
|
111
|
+
}, [n2, s2, t2]), w2 = z((e3) => {
|
|
112
|
+
r2?.(e3), e3.isDefaultPrevented() || e3.keyCode === Sa.Enter && o2?.(t2.toRGBA());
|
|
113
|
+
}, [o2, r2, t2]), k2 = W(() => 1 === t2.toRGBA().alpha ? null : N(pr, { size: g2, white: m2, grey: p2, style: { position: "absolute", width: "calc(100% - 1.5px)", height: "calc(100% - 1.5px)", top: "0.75px", left: "0.75px" } }), [m2, p2, t2]);
|
|
114
|
+
return E("div", { style: { position: "absolute", height: "100%", width: "100%", top: "0px", left: "0px", cursor: "pointer", outline: "none", ...d2 }, tabIndex: 0, ...h2, onClick: f2, onKeyDown: w2, onMouseOver: x2, onMouseLeave: b2, onFocus: y2, children: [k2, N("div", { style: { position: "absolute", top: "0px", left: "0px", height: "100%", width: "100%", background: t2.toCSS(u2) }, children: c2 })] });
|
|
115
|
+
}), gr = L((o2) => {
|
|
116
|
+
const { schemeColorLookup: n2, selectedColor: a2, previewColor: r2, colorDef: l2, onSelectColorDef: i2, onPreviewColorDef: s2, swatchProps: d2, defaultButtonSize: c2 = 24, isLarge: m2 = false, compareRGB: p2 = false, darkMode: u2 = false, ...g2 } = o2, h2 = new e({ val: l2.definition.val, adjs: l2.definition.adjs }, (e2) => n2(e2)), f2 = p2 ? h2.toRGBA().toString() : h2.toString(), x2 = a2 && (p2 ? a2.toRGBA().toString() : a2.toString()) === f2, b2 = r2 && (p2 ? r2.toRGBA().toString() : r2.toString()) === f2, y2 = [];
|
|
117
|
+
y2.push({ [t.AdjustmentType.Inv]: true }), y2.push({ [t.AdjustmentType.Alpha]: 100 });
|
|
118
|
+
const w2 = h2.adjust(y2), k2 = z(() => {
|
|
118
119
|
i2?.(l2);
|
|
119
|
-
}, [i2, l2]),
|
|
120
|
+
}, [i2, l2]), S2 = z((e2) => {
|
|
120
121
|
s2?.(e2 ? l2 : null);
|
|
121
122
|
}, [s2, l2]);
|
|
122
|
-
return
|
|
123
|
-
}), hr =
|
|
124
|
-
const { title: t2, schemeColorLookup: o2, colorDefs: n2, selectedColor: a2, previewColor: r2, onSelectColorDef: l2, onPreviewColorDef: i2, style: s2 =
|
|
123
|
+
return N(Oe, { disableInteractive: true, PopperProps: { style: { pointerEvents: "none" }, disablePortal: true, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: true, options: { boundariesElement: "viewport" } }] } }, title: l2.description, placement: "bottom-start", children: N("div", { style: { width: c2 * (m2 ? 1.2 : 1) + "px", height: c2 * (m2 ? 1.2 : 1) + "px", position: "relative", boxSizing: "border-box", cursor: "pointer", outline: "none" }, ...g2, children: E(ur, { selectedColor: h2, title: null, onSelectColor: k2, onPreviewColor: S2, alphaCheckSize: m2 ? 9 : void 0, darkMode: u2, ...d2, children: [N("div", { style: { position: "absolute", width: "100%", height: "100%", top: "0px", left: "0px", pointerEvents: "none", borderColor: w2.toRGBA(u2).toString(), borderWidth: "2px", borderStyle: "solid", boxSizing: "border-box", opacity: x2 ? "1" : "0" } }), N("div", { style: { position: "absolute", width: 0.33 * c2 * (m2 ? 1.2 : 1) + "px", height: 0.33 * c2 * (m2 ? 1.2 : 1) + "px", left: "calc(50% - 0.5px)", top: "calc(50% - 0.5px)", transform: "translate(-50%,-50%)", pointerEvents: "none", background: w2.toRGBA(u2).toString(), borderRadius: "50%", opacity: b2 ? "1" : "0" } })] }) }) });
|
|
124
|
+
}), hr = L((e2) => {
|
|
125
|
+
const { title: t2, schemeColorLookup: o2, colorDefs: n2, selectedColor: a2, previewColor: r2, onSelectColorDef: l2, onPreviewColorDef: i2, style: s2 = ka.EmptyCssProperties, compareRGB: d2 = false, darkMode: c2, swatchProps: m2, ...p2 } = e2;
|
|
125
126
|
let u2;
|
|
126
127
|
if (Array.isArray(n2[0])) u2 = n2;
|
|
127
128
|
else {
|
|
128
129
|
u2 = [];
|
|
129
130
|
for (let e3 = 0; e3 < n2.length; e3++) u2.push([n2[e3]]);
|
|
130
131
|
}
|
|
131
|
-
const g2 =
|
|
132
|
+
const g2 = z((e3) => {
|
|
132
133
|
l2?.(e3);
|
|
133
|
-
}, [l2]), h2 =
|
|
134
|
+
}, [l2]), h2 = z((e3) => {
|
|
134
135
|
i2?.(e3);
|
|
135
|
-
}, [i2]), f2 =
|
|
136
|
+
}, [i2]), f2 = W(() => {
|
|
136
137
|
let e3 = [];
|
|
137
138
|
for (let t3 = 0; t3 < u2.length; t3++) {
|
|
138
139
|
let n3 = [], l3 = u2[t3];
|
|
139
140
|
for (let e4 = 0; e4 < l3.length; e4++) {
|
|
140
141
|
let i4 = l3[e4];
|
|
141
|
-
n3.push(
|
|
142
|
+
n3.push(N(gr, { schemeColorLookup: o2, colorDef: i4, selectedColor: a2, previewColor: r2, onSelectColorDef: g2, onPreviewColorDef: h2, swatchProps: m2, compareRGB: d2, darkMode: c2 }, t3 + " " + e4));
|
|
142
143
|
}
|
|
143
|
-
let i3 =
|
|
144
|
+
let i3 = N(X, { className: "button-col", sx: { display: "flex", flexDirection: "column", justifyContent: "space-between", boxShadow: (e4) => e4.shadows[2], borderRadius: "2px", overflow: "hidden" }, children: n3 }, "" + t3);
|
|
144
145
|
e3.push(i3);
|
|
145
146
|
}
|
|
146
147
|
return e3;
|
|
147
|
-
}, [u2, a2, r2, g2, h2]),
|
|
148
|
-
return
|
|
148
|
+
}, [u2, a2, r2, g2, h2]), x2 = W(() => t2 ? N(Z, { noWrap: true, component: "div", sx: { display: "flex", flexShrink: "0", paddingLeft: "6px", paddingBottom: "4px", paddingTop: "0px", userSelect: "none", color: (e3) => e3.palette.text.secondary }, children: t2 }) : null, [t2]);
|
|
149
|
+
return E(X, { style: { ...s2 }, children: [x2, N(X, { sx: { display: "flex", flexDirection: "row", gap: "6px", marginBottom: "14px", flexWrap: "wrap", justifyContent: "flex-start" }, ...p2, children: f2 })] });
|
|
149
150
|
}), fr = (e2, t2) => ({ description: e2, definition: { val: t2, adjs: [] } }), xr = (t2, o2, n2, a2, r2, l2) => {
|
|
150
151
|
const i2 = fr(t2, o2);
|
|
151
152
|
a2?.push(i2);
|
|
@@ -153,14 +154,14 @@ const nr = k(S((e2, t2) => {
|
|
|
153
154
|
r2?.set(d2, s2);
|
|
154
155
|
const c2 = s2.toRGBA().toString();
|
|
155
156
|
l2?.set(c2, s2);
|
|
156
|
-
}, br =
|
|
157
|
-
const { selectedColor: r2 = null, previewColor: l2 = t2.selectedColor ?? null, recentColors: i2, schemeLookup: s2, disableAlpha: d2 = false, previewDebounceTime: c2 = 100, initialPanelType: m2, defaultButtonSize: p2 = 24, width: u2, onElementLoad: g2, onDone: h2, onEyeDropStart: f2, onEyeDropStop:
|
|
157
|
+
}, br = I.lazy(() => import("./DfoPtVWCLOfcAoCg.mjs")), yr = L(H((t2, a2) => {
|
|
158
|
+
const { selectedColor: r2 = null, previewColor: l2 = t2.selectedColor ?? null, recentColors: i2, schemeLookup: s2, disableAlpha: d2 = false, previewDebounceTime: c2 = 100, initialPanelType: m2, defaultButtonSize: p2 = 24, width: u2, onElementLoad: g2, onDone: h2, onEyeDropStart: f2, onEyeDropStop: x2, onPreviewColor: b2, onPreviewColorImmediate: y2, onSelectColor: w2, autoColor: k2, autoColorLabel: S2 = "Automatic", autoColorPosition: C2 = sr.Start, compareRGB: v2 = false, darkMode: T2 = false, ...D2 } = t2, P2 = l2 || r2, R2 = wa(b2, [b2]), M2 = wa(y2, [y2]), F2 = wa(w2, [w2]), B2 = wa(f2, [f2]), I2 = wa(x2, [x2]), [L2, H2] = O(false), $2 = Ha(), U2 = W(() => s2 || e.getDefaultSchemeLookup(), [s2]), j2 = W(() => {
|
|
158
159
|
const e2 = /* @__PURE__ */ new Map(), t3 = /* @__PURE__ */ new Map(), n2 = [];
|
|
159
|
-
xr("Primary Background", "bg1",
|
|
160
|
-
const a3 = o.buildPalette(n2,
|
|
161
|
-
if (xr("Dark Red", "C00000",
|
|
162
|
-
const t4 =
|
|
163
|
-
e2.set(t4,
|
|
160
|
+
xr("Primary Background", "bg1", U2, n2, e2, t3), xr("Primary Text", "tx1", U2, n2, e2, t3), xr("Secondary Background", "bg2", U2, n2, e2, t3), xr("Secondary Text", "tx2", U2, n2, e2, t3), xr("Accent 1", "accent1", U2, n2, e2, t3), xr("Accent 2", "accent2", U2, n2, e2, t3), xr("Accent 3", "accent3", U2, n2, e2, t3), xr("Accent 4", "accent4", U2, n2, e2, t3), xr("Accent 5", "accent5", U2, n2, e2, t3), xr("Accent 6", "accent6", U2, n2, e2, t3);
|
|
161
|
+
const a3 = o.buildPalette(n2, U2, e2, t3), r3 = [];
|
|
162
|
+
if (xr("Dark Red", "C00000", U2, r3, e2, t3), xr("Red", "FF0000", U2, r3, e2, t3), xr("Orange", "FFC000", U2, r3, e2, t3), xr("Yellow", "FFFF00", U2, r3, e2, t3), xr("Light Green", "92D050", U2, r3, e2, t3), xr("Green", "00B050", U2, r3, e2, t3), xr("Light Blue", "00B0F0", U2, r3, e2, t3), xr("Blue", "0070C0", U2, r3, e2, t3), xr("Dark Blue", "002060", U2, r3, e2, t3), d2 ? xr("Purple Is A Fruit", "7030A0", U2, r3, e2, t3) : xr("Transparent", "00000000", U2, r3, e2, t3), k2) {
|
|
163
|
+
const t4 = k2.toString();
|
|
164
|
+
e2.set(t4, k2);
|
|
164
165
|
}
|
|
165
166
|
const l3 = /* @__PURE__ */ new Map(), s3 = "function" == typeof i2 ? i2() : i2, c3 = [];
|
|
166
167
|
for (let e3 = 0; s3 && e3 < s3.length; e3++) {
|
|
@@ -168,145 +169,145 @@ const nr = k(S((e2, t2) => {
|
|
|
168
169
|
l3.set(t4, s3[e3]), c3.push({ description: "Recent " + (e3 + 1), definition: { val: s3[e3].toString() } });
|
|
169
170
|
}
|
|
170
171
|
return { primaryColors: n2, modifiedPresets: a3, standardColors: r3, recentColorsLimited: c3, mapAllPresets: e2, mapAllPresetsRGB: t3, mapRecent: l3 };
|
|
171
|
-
}, [
|
|
172
|
-
|
|
172
|
+
}, [U2, i2, d2, k2]);
|
|
173
|
+
V(() => {
|
|
173
174
|
g2?.();
|
|
174
175
|
}, []);
|
|
175
|
-
const [
|
|
176
|
-
|
|
176
|
+
const [_2, q2] = O(false), K2 = z(() => {
|
|
177
|
+
q2((e2) => !e2);
|
|
177
178
|
}, []);
|
|
178
|
-
|
|
179
|
-
if (m2)
|
|
179
|
+
V(() => {
|
|
180
|
+
if (m2) q2(m2 === ir.Custom);
|
|
180
181
|
else if (r2) {
|
|
181
|
-
let e2 = r2.toString(), t3 =
|
|
182
|
-
t3 || (e2 = r2.toRGBA().toString(), t3 =
|
|
183
|
-
const o2 =
|
|
184
|
-
|
|
182
|
+
let e2 = r2.toString(), t3 = j2.mapAllPresets.get(e2);
|
|
183
|
+
t3 || (e2 = r2.toRGBA().toString(), t3 = j2.mapAllPresetsRGB.get(e2));
|
|
184
|
+
const o2 = j2.mapRecent.get(e2);
|
|
185
|
+
q2(!t3 && !o2);
|
|
185
186
|
}
|
|
186
187
|
}, [r2, m2]);
|
|
187
|
-
const te2 =
|
|
188
|
-
|
|
189
|
-
}, c2), [
|
|
190
|
-
|
|
188
|
+
const te2 = z(n.debounce((e2) => {
|
|
189
|
+
R2?.(e2);
|
|
190
|
+
}, c2), [R2, c2]), [oe2, ne2] = O();
|
|
191
|
+
V(() => {
|
|
191
192
|
ne2(l2 || r2);
|
|
192
193
|
}, [l2, r2]);
|
|
193
|
-
const ae2 =
|
|
194
|
-
|
|
195
|
-
}, [
|
|
196
|
-
ae2(t3 ? new e({ val: t3.definition.val, adjs: t3.definition.adjs },
|
|
197
|
-
}, [
|
|
198
|
-
e2.ctrlKey &&
|
|
199
|
-
}, []), ie2 =
|
|
194
|
+
const ae2 = wa((e2) => {
|
|
195
|
+
M2 && (M2(e2), te2(e2));
|
|
196
|
+
}, [M2]), re2 = wa((t3) => {
|
|
197
|
+
ae2(t3 ? new e({ val: t3.definition.val, adjs: t3.definition.adjs }, U2) : null);
|
|
198
|
+
}, [U2]), le2 = z((e2) => {
|
|
199
|
+
e2.ctrlKey && q2(true);
|
|
200
|
+
}, []), ie2 = wa((e2) => {
|
|
200
201
|
let t3 = false;
|
|
201
202
|
if (e2) {
|
|
202
203
|
const o2 = e2.toString();
|
|
203
|
-
t3 = !
|
|
204
|
+
t3 = !j2.mapAllPresets.has(o2);
|
|
204
205
|
}
|
|
205
|
-
|
|
206
|
-
}, [
|
|
207
|
-
const o2 = t3 ? new e({ val: t3.definition.val, adjs: t3.definition.adjs },
|
|
206
|
+
F2?.(e2, t3);
|
|
207
|
+
}, [F2, j2]), se2 = wa((t3) => {
|
|
208
|
+
const o2 = t3 ? new e({ val: t3.definition.val, adjs: t3.definition.adjs }, U2) : null;
|
|
208
209
|
Promise.resolve(h2?.()).then(() => {
|
|
209
210
|
ie2(o2);
|
|
210
211
|
});
|
|
211
|
-
}, [
|
|
212
|
-
ae2(t3 ? new e(t3,
|
|
213
|
-
}, [
|
|
214
|
-
if (void 0 === window.EyeDropper) return
|
|
215
|
-
return
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
let o2 = new e(t3.sRGBHex), n2 = o2.toString(), a3 =
|
|
219
|
-
if (a3 || (n2 = o2.toRGBA().toString(), a3 =
|
|
212
|
+
}, [U2, h2]), de2 = wa((t3) => {
|
|
213
|
+
ae2(t3 ? new e(t3, U2) : null);
|
|
214
|
+
}, [U2]), ce2 = W(() => {
|
|
215
|
+
if (void 0 === window.EyeDropper) return N(A, {});
|
|
216
|
+
return N(J, { "aria-label": "eye dropper", size: "small", sx: { color: (e2) => e2.palette.text.icon ?? e2.palette.action.active }, onClick: async () => {
|
|
217
|
+
H2(true), B2?.(), await new EyeDropper().open().then((t3) => {
|
|
218
|
+
H2(false), I2?.();
|
|
219
|
+
let o2 = new e(t3.sRGBHex), n2 = o2.toString(), a3 = j2.mapAllPresets.get(n2);
|
|
220
|
+
if (a3 || (n2 = o2.toRGBA().toString(), a3 = j2.mapAllPresetsRGB.get(n2)), !a3) {
|
|
220
221
|
const e2 = o2.toRGBA(), t4 = 3;
|
|
221
222
|
let n3 = 255;
|
|
222
|
-
|
|
223
|
+
j2.mapAllPresetsRGB.forEach((o3, r3) => {
|
|
223
224
|
const l3 = o3.toRGBA(), i3 = Math.abs(l3.red - e2.red) + Math.abs(l3.blue - e2.blue) + Math.abs(l3.green - e2.green);
|
|
224
225
|
i3 < t4 && i3 < n3 && (a3 = o3);
|
|
225
226
|
});
|
|
226
227
|
}
|
|
227
|
-
|
|
228
|
+
q2(!a3), ae2(a3 || o2);
|
|
228
229
|
}).catch((e2) => {
|
|
229
|
-
|
|
230
|
+
H2(false), "AbortError" !== e2?.name && console.error(e2);
|
|
230
231
|
});
|
|
231
|
-
}, children:
|
|
232
|
-
}, [
|
|
233
|
-
if (!
|
|
234
|
-
const e2 = { opacity:
|
|
235
|
-
return
|
|
236
|
-
}, [
|
|
237
|
-
if (!
|
|
238
|
-
const e2 = { description:
|
|
239
|
-
return
|
|
232
|
+
}, children: N(na, {}) });
|
|
233
|
+
}, [j2, T2]), me2 = W(() => {
|
|
234
|
+
if (!_2) return;
|
|
235
|
+
const e2 = { opacity: _2 ? 1 : "0", position: "absolute", top: "0px", left: "0px", width: "100%", height: "100%", boxSizing: "border-box" };
|
|
236
|
+
return N(G, { fallback: N("div", { style: e2, children: N(Ve, {}) }), children: N(br, { style: e2, selectedColor: P2 ? P2.toRGBA().toString() : "transparent", onColorChange: de2, disableAlpha: d2 }) });
|
|
237
|
+
}, [_2, P2]), pe2 = W(() => ({ onClick: le2, alphaGrey: $2.palette.text.icon ?? $2.palette.action.active }), [le2, $2]), ue2 = W(() => {
|
|
238
|
+
if (!k2) return null;
|
|
239
|
+
const e2 = { description: S2, definition: { val: k2.getVal(), adjs: k2.getAdjustments() } };
|
|
240
|
+
return N(A, { children: E(Y, { sx: { display: "flex", color: (e3) => e3.palette.text.secondary }, onMouseOver: () => {
|
|
240
241
|
re2(null);
|
|
241
242
|
}, onClick: () => {
|
|
242
243
|
se2(null);
|
|
243
|
-
}, children: [
|
|
244
|
-
}, [
|
|
245
|
-
return
|
|
246
|
-
|
|
247
|
-
}, children:
|
|
244
|
+
}, children: [N(X, { sx: { flex: "none", boxShadow: (e3) => e3.shadows[2], borderRadius: (e3) => e3.spacing(0.5), overflow: "hidden" }, children: N(gr, { schemeColorLookup: U2, colorDef: e2, selectedColor: null === r2 ? k2 : r2, previewColor: null === l2 ? k2 : l2, defaultButtonSize: p2, isLarge: true, darkMode: T2, compareRGB: v2, swatchProps: pe2 }) }), N(Z, { noWrap: true, component: "div", style: { display: "flex", flex: "1 1 100%", marginLeft: "8px", userSelect: "none" }, children: S2 })] }) });
|
|
245
|
+
}, [k2, S2, U2, r2, l2]);
|
|
246
|
+
return E(X, { ref: a2, sx: { width: u2, outline: "none", padding: "10px 10px", overflow: "hidden", boxSizing: "content-box" }, ...D2, children: [E("div", { style: { position: "relative", display: "flex" }, children: [E("div", { style: { opacity: _2 ? "0" : 1 }, children: [ue2 && C2 === sr.Start ? E(A, { children: [ue2, N(Q, { light: true, style: { marginTop: "2px", marginBottom: "10px" } })] }) : null, N(hr, { title: "Theme Colors", schemeColorLookup: U2, colorDefs: j2.primaryColors, selectedColor: r2, previewColor: void 0 === l2 ? r2 : l2, swatchProps: pe2, onPreviewColorDef: re2, onSelectColorDef: se2, compareRGB: v2, darkMode: T2 }), N(hr, { schemeColorLookup: U2, colorDefs: j2.modifiedPresets, selectedColor: r2, previewColor: void 0 === l2 ? r2 : l2, swatchProps: pe2, onPreviewColorDef: re2, onSelectColorDef: se2, compareRGB: v2, darkMode: T2 }), N(Q, { light: true, style: { marginBottom: "10px" } }), N(hr, { title: "Standard Colors", schemeColorLookup: U2, colorDefs: j2.standardColors, selectedColor: r2, previewColor: void 0 === l2 ? r2 : l2, swatchProps: pe2, onPreviewColorDef: re2, onSelectColorDef: se2, compareRGB: v2, darkMode: T2 }), E("div", { style: { opacity: 0 === j2.recentColorsLimited.length ? "0" : void 0, display: 0 === j2.recentColorsLimited.length ? "none" : void 0 }, children: [N(Q, { light: true, style: { marginBottom: "10px" } }), N(hr, { title: "Recent Colors", schemeColorLookup: U2, colorDefs: j2.recentColorsLimited, selectedColor: r2, previewColor: void 0 === l2 ? r2 : l2, swatchProps: pe2, onPreviewColorDef: re2, onSelectColorDef: se2, compareRGB: v2, darkMode: T2 })] }), ue2 && C2 === sr.End ? E(A, { children: [N(Q, { light: true, sx: { marginTop: "2px", marginBottom: "2px" } }), ue2, N("div", { style: { marginBottom: "2px" } })] }) : null] }), me2] }), N(Q, { light: true, style: { marginBottom: "10px" } }), E("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-around", gap: "8px", paddingLeft: "2px", paddingRight: "2px" }, children: [ce2, N("div", { style: { flex: "1 1 100%", background: "pink" } }), N(ee, { style: { minWidth: "75px", maxWidth: "75px" }, value: "check", variant: "outlined", size: "small", onClick: () => {
|
|
247
|
+
K2();
|
|
248
|
+
}, children: N("div", _2 ? { children: "Preset" } : { children: "Custom" }) }), N(ee, { variant: "contained", size: "small", style: { minWidth: "75px" }, onClick: () => {
|
|
248
249
|
Promise.resolve(h2?.()).then(() => {
|
|
249
250
|
ie2(oe2);
|
|
250
251
|
});
|
|
251
252
|
}, children: "Done" })] })] });
|
|
252
|
-
})), wr =
|
|
253
|
-
const { selectedColor: o2, quickColor: n2, icon: a2 = wr, tooltip: r2, label: l2, onPreviewColor: i2, onPreviewColorImmediate: s2, onSelectColor: d2, variant: c2 =
|
|
254
|
-
}),
|
|
255
|
-
}, []),
|
|
256
|
-
|
|
257
|
-
}, [o2]),
|
|
258
|
-
|
|
259
|
-
}, [f2]),
|
|
260
|
-
|
|
261
|
-
}, [
|
|
262
|
-
|
|
263
|
-
}, [
|
|
264
|
-
|
|
265
|
-
}, [
|
|
253
|
+
})), wr = N(_e, {}), kr = L(H((e2, t2) => {
|
|
254
|
+
const { selectedColor: o2, quickColor: n2, icon: a2 = wr, tooltip: r2, label: l2, onPreviewColor: i2, onPreviewColorImmediate: s2, onSelectColor: d2, variant: c2 = Ge.Toolbar, panelProps: m2, shouldCloseFloatAll: p2 = true, compareRGB: u2 = false, darkMode: g2 = false, ...h2 } = e2, f2 = wa(i2, [i2]), x2 = wa(s2, [s2]), b2 = wa(d2, [d2]), [y2, w2] = O(() => {
|
|
255
|
+
}), k2 = n2 || (y2 || o2) || m2?.autoColor, S2 = U(false), C2 = z(() => {
|
|
256
|
+
}, []), v2 = wa(() => {
|
|
257
|
+
w2(o2);
|
|
258
|
+
}, [o2]), T2 = wa((e3) => {
|
|
259
|
+
S2.current || (w2(e3), f2?.(e3));
|
|
260
|
+
}, [f2]), D2 = wa((e3) => {
|
|
261
|
+
S2.current || (w2(e3), x2?.(e3));
|
|
262
|
+
}, [x2]), P2 = wa((e3, t3) => {
|
|
263
|
+
S2.current || (w2(void 0), b2?.(e3, t3));
|
|
264
|
+
}, [b2]), R2 = W(() => N(X, { sx: { width: "24px", height: "24px", color: "inherit", "--sxl-color-active": `${k2?.toCSS(g2) ?? "transparent"}`, "& .activeColor": { fill: `${k2?.toCSS(g2) ?? "transparent"}` }, "& .style_grey": { fill: (e3) => e3.palette.text.icon ?? e3.palette.action.active } }, children: "function" == typeof a2 ? a2() : a2 }), [k2, a2, g2]), M2 = wa((e3) => {
|
|
265
|
+
b2?.(n2, false);
|
|
266
|
+
}, [b2, n2]), [F2, B2] = O(false), E2 = z((e3) => {
|
|
266
267
|
const { closeFloat: t3, closeFloatAll: n3 } = e3;
|
|
267
|
-
return
|
|
268
|
-
e4.which ===
|
|
269
|
-
}, onPreviewColorImmediate:
|
|
270
|
-
}, [o2,
|
|
271
|
-
return c2 ===
|
|
268
|
+
return N(yr, { ...m2, selectedColor: o2, previewColor: y2, onDone: p2 ? n3 : t3, onKeyDown: (e4) => {
|
|
269
|
+
e4.which === Sa.Enter && (p2 ? n3() : t3());
|
|
270
|
+
}, onPreviewColorImmediate: D2, onPreviewColor: T2, onSelectColor: P2, onEyeDropStart: () => B2(true), onEyeDropStop: () => B2(false), compareRGB: u2, darkMode: g2 });
|
|
271
|
+
}, [o2, y2, p2, k2, m2?.autoColor, g2]), A2 = { onQuickClick: n2 ? M2 : void 0, createPopupPanel: E2, popupProps: { popperProps: { resizeOnOverflow: false } }, onPopupOpen: v2, onPopupClose: C2, tooltip: r2 || l2 || "Color", label: l2, icon: R2, ...h2 };
|
|
272
|
+
return c2 === Ge.Toolbar ? N(Ue, { ref: t2, ...A2 }) : N(je, { ref: t2, ...A2 });
|
|
272
273
|
})), Sr = 82, Cr = (e2) => {
|
|
273
274
|
const { styleColor: t2, length: o2 = Sr, width: n2 = 1, dashArray: a2 = null, sx: r2, isDouble: l2 = false, isAngled: i2 = false, darkMode: s2 = false, ...d2 } = e2;
|
|
274
|
-
return
|
|
275
|
-
}, vr =
|
|
276
|
-
const { variant: o2, showLabels: n2 = false, disabled: r2 = false, createPopupPanel: l2, styleColor: i2, selectedStyle: s2, onSelectStyle: d2, showNone: c2 = true, darkMode: m2, sx: p2, ...u2 } = e2, g2 =
|
|
275
|
+
return N(te, { sx: { width: `${o2}px`, height: `${n2}px`, color: "inherit", overflow: "visible", "& .activeColor": { stroke: (e3) => `${t2 ? t2.toRGBA(s2).toString() : e3.palette.text.icon ?? e3.palette.action.active}` }, "& .style_grey": { stroke: (e3) => e3.palette.text.icon ?? e3.palette.action.active }, ...r2 }, height: n2, width: o2, viewBox: `0 0 ${o2} ${n2}`, ...d2, children: N(x, { length: o2, width: n2, dashArray: a2, isDouble: l2, isAngled: i2, className: "activeColor" }) });
|
|
276
|
+
}, vr = L(H((e2, t2) => {
|
|
277
|
+
const { variant: o2, showLabels: n2 = false, disabled: r2 = false, createPopupPanel: l2, styleColor: i2, selectedStyle: s2, onSelectStyle: d2, showNone: c2 = true, darkMode: m2, sx: p2, ...u2 } = e2, g2 = wa(d2, []), h2 = z((e3) => {
|
|
277
278
|
const { popupContainer: t3, floatReference: o3, closeFloat: l3, ...d3 } = e3, p3 = [], u3 = a.BuiltInDefinitionsArray;
|
|
278
279
|
for (let e4 = 0; e4 < u3.length; e4++) {
|
|
279
280
|
const t4 = u3[e4];
|
|
280
281
|
if ("None" === t4.description && !c2) continue;
|
|
281
|
-
const a2 =
|
|
282
|
+
const a2 = N(Cr, { styleColor: i2, length: Sr, width: t4.width, darkMode: m2, dashArray: t4.pattern, isDouble: t4.description.toLowerCase().includes("double"), isAngled: t4.description.toLowerCase().includes("slant") });
|
|
282
283
|
let d4 = null;
|
|
283
|
-
d4 = n2 ?
|
|
284
|
+
d4 = n2 ? E(A, { children: [N(X, { sx: { marginRight: "6px" }, children: t4.description }), E(X, { sx: { marginLeft: "6px", marginRight: "6px", display: "flex", alignItems: "center", flex: "1 1 100%" }, children: [N("div", { style: { flex: "1 1 100%" } }), a2] })] }) : "None" === t4.description ? "None" : a2, p3.push(N(qe, { className: "border-stroke", tabIndex: 0, sx: { height: "28px", "& svg path.activeColor": { filter: Ke(4) }, paddingLeft: "16px", background: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})` }, tooltipProps: { description: n2 ? "" : t4.description }, icon: null, disabled: r2, onMouseDown: (e5) => e5.preventDefault(), onMouseUp: () => {
|
|
284
285
|
l3(), g2(t4.style);
|
|
285
286
|
}, onKeyDown: (e5) => {
|
|
286
|
-
e5.which ===
|
|
287
|
+
e5.which === Sa.Enter && l3();
|
|
287
288
|
}, selected: t4.style === s2, parentFloat: o3, children: d4 }, e4));
|
|
288
289
|
}
|
|
289
|
-
return
|
|
290
|
-
}, [r2, c2, i2, s2, m2]), f2 =
|
|
290
|
+
return N(X, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, children: p3 });
|
|
291
|
+
}, [r2, c2, i2, s2, m2]), f2 = W(() => {
|
|
291
292
|
const e3 = a.BuiltInDefinitions.get(s2);
|
|
292
293
|
let t3;
|
|
293
|
-
return t3 = "None" === e3.description ?
|
|
294
|
-
}, [s2, i2]),
|
|
295
|
-
return o2 ===
|
|
296
|
-
})), Tr =
|
|
297
|
-
const { autoColor: n2 = null, schemeLookup: r2, autoStrokeStyle: l2 = a.StrokeStyle.Thin, disabled: i2 = false, darkMode: s2 = false, showStylingBefore: d2 = true, onSelectBorder: c2, onPreviewBorder: m2, selectedBorder: p2, createTemporaryBorder: u2, ...g2 } = t2, h2 =
|
|
294
|
+
return t3 = "None" === e3.description ? N(X, { sx: { minWidth: `${Sr}px` }, children: "None" }) : N(Cr, { styleColor: i2, length: Sr, width: e3.width, dashArray: e3.pattern, darkMode: m2, isDouble: e3.description.toLowerCase().includes("double"), isAngled: e3.description.toLowerCase().includes("slant") }), N(X, { className: "border-stroke", sx: { paddingLeft: "12px", marginLeft: "4px", marginRight: "4px", height: "24px", display: "flex", alignItems: "center", "& svg path.activeColor": { filter: Ke() } }, children: t3 });
|
|
295
|
+
}, [s2, i2]), x2 = W(() => a.BuiltInDefinitions.get(s2), [s2]), b2 = { disabled: r2, icon: f2, tooltip: "Border Style: " + x2.description, sx: { background: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})`, ...p2 }, createPopupPanel: h2, ...u2 };
|
|
296
|
+
return o2 === Ge.Toolbar ? N(Ue, { ...b2 }) : N(je, { ...b2 });
|
|
297
|
+
})), Tr = L(H((t2, o2) => {
|
|
298
|
+
const { autoColor: n2 = null, schemeLookup: r2, autoStrokeStyle: l2 = a.StrokeStyle.Thin, disabled: i2 = false, darkMode: s2 = false, showStylingBefore: d2 = true, onSelectBorder: c2, onPreviewBorder: m2, selectedBorder: p2, createTemporaryBorder: u2, ...g2 } = t2, h2 = wa(c2, [c2]), f2 = wa(m2, [m2]), [x2, y2] = O(), [w2, k2] = O(), S2 = x2 ?? l2, C2 = w2 ?? n2, v2 = p2 || { bottom: { style: l2, color: n2?.toString() } }, T2 = wa((e2) => {
|
|
298
299
|
const t3 = {}, o3 = e2 ? Object.keys(e2) : [];
|
|
299
300
|
let n3 = false;
|
|
300
301
|
for (let r4 = 0; r4 < o3.length; r4++) e2[o3[r4]]?.style && (t3[o3[r4]] = { style: e2[o3[r4]].style, color: e2[o3[r4]].color }, n3 || t3[o3[r4]].style === a.StrokeStyle.None || (n3 = true));
|
|
301
302
|
o3.length < 6 && (n3 = true);
|
|
302
303
|
const r3 = n3 ? t3.left : null, l3 = n3 ? t3.top : null, i3 = n3 ? t3.right : null, d3 = n3 ? t3.bottom : null, c3 = n3 ? t3.vertical : null, m3 = n3 ? t3.horizontal : null;
|
|
303
304
|
let p3 = "";
|
|
304
|
-
return l3 || r3 || (p3 += "M 3,5 H 5 V 3 H 3 "), l3 || (p3 += "M 7,5 H 9 V 3 H 7 "), l3 || c3 || (p3 += "M 11,5 h 2 V 3 h -2 "), l3 || (p3 += "M 15,5 h 2 V 3 h -2 "), l3 || i3 || (p3 += "M 19,5 h 2 V 3 h -2 "), r3 || (p3 += "M 3,9 H 5 V 7 H 3 "), c3 || (p3 += "M 11,9 h 2 V 7 h -2 "), i3 || (p3 += "M 19,9 h 2 V 7 h -2 "), m3 || r3 || (p3 += "M 3,13 H 5 V 11 H 3 "), m3 || (p3 += "M 7,13 H 9 V 11 H 7 "), m3 || c3 || (p3 += "M 11,13 h 2 v -2 h -2 "), m3 || i3 || (p3 += "M 19,13 h 2 v -2 h -2 "), m3 || (p3 += "M 15,13 h 2 v -2 h -2 "), r3 || (p3 += "M 3,17 H 5 V 15 H 3 "), c3 || (p3 += "M 11,17 h 2 v -2 h -2 "), i3 || (p3 += "M 19,17 h 2 v -2 h -2 "), d3 || r3 || (p3 += "M 3,21 H 5 V 19 H 3 "), d3 || (p3 += "M 7,21 H 9 V 19 H 7 "), d3 || c3 || (p3 += "M 11,21 h 2 v -2 h -2 "), d3 || (p3 += "M 15,21 h 2 v -2 h -2 "), d3 || i3 || (p3 += "M 19,21 h 2 v -2 h -2 "),
|
|
305
|
+
return l3 || r3 || (p3 += "M 3,5 H 5 V 3 H 3 "), l3 || (p3 += "M 7,5 H 9 V 3 H 7 "), l3 || c3 || (p3 += "M 11,5 h 2 V 3 h -2 "), l3 || (p3 += "M 15,5 h 2 V 3 h -2 "), l3 || i3 || (p3 += "M 19,5 h 2 V 3 h -2 "), r3 || (p3 += "M 3,9 H 5 V 7 H 3 "), c3 || (p3 += "M 11,9 h 2 V 7 h -2 "), i3 || (p3 += "M 19,9 h 2 V 7 h -2 "), m3 || r3 || (p3 += "M 3,13 H 5 V 11 H 3 "), m3 || (p3 += "M 7,13 H 9 V 11 H 7 "), m3 || c3 || (p3 += "M 11,13 h 2 v -2 h -2 "), m3 || i3 || (p3 += "M 19,13 h 2 v -2 h -2 "), m3 || (p3 += "M 15,13 h 2 v -2 h -2 "), r3 || (p3 += "M 3,17 H 5 V 15 H 3 "), c3 || (p3 += "M 11,17 h 2 v -2 h -2 "), i3 || (p3 += "M 19,17 h 2 v -2 h -2 "), d3 || r3 || (p3 += "M 3,21 H 5 V 19 H 3 "), d3 || (p3 += "M 7,21 H 9 V 19 H 7 "), d3 || c3 || (p3 += "M 11,21 h 2 v -2 h -2 "), d3 || (p3 += "M 15,21 h 2 v -2 h -2 "), d3 || i3 || (p3 += "M 19,21 h 2 v -2 h -2 "), E("div", { style: { width: "24px", height: "24px", position: "relative" }, children: [N(te, { sx: { position: "absolute", top: "0px", left: "0px", "& path": { opacity: "0.8", transform: "translate(-0.5px, -0.5px)" } }, children: N("path", { d: p3 }) }), N(X, { sx: { width: "24px", height: "24px", display: "flex", alignItems: "center", justifyContent: "center", position: "absolute", top: "-1px", left: "-1px", "& svg path": { filter: Xe } }, children: N(b, { getBorderAt: (e3, n4) => {
|
|
305
306
|
if (!u2 || 0 === o3.length) return null;
|
|
306
307
|
const a2 = e3.rowIndex, r4 = e3.colIndex, l4 = {};
|
|
307
308
|
return 0 === a2 ? (l4.top = t3.top, l4.bottom = t3.horizontal) : (l4.top = t3.horizontal, l4.bottom = t3.bottom), 0 === r4 ? (l4.left = t3.left, l4.right = t3.vertical) : (l4.left = t3.vertical, l4.right = t3.right), u2?.(l4);
|
|
308
309
|
}, width: 18, height: 18, darkMode: s2, style: { top: "0px", left: "0px", width: "18px", height: "18px", minWidth: "18px", minHeight: "18px", position: "relative" } }) })] });
|
|
309
|
-
}, [
|
|
310
|
+
}, [C2, S2, s2]), D2 = z((e2, t3, o3) => {
|
|
310
311
|
let n3 = null;
|
|
311
312
|
if (e2 && e2.length > 0) {
|
|
312
313
|
let a2 = null;
|
|
@@ -314,120 +315,120 @@ const nr = k(S((e2, t2) => {
|
|
|
314
315
|
for (let t4 = 0; t4 < e2.length; t4++) n3[e2[t4]] = a2;
|
|
315
316
|
}
|
|
316
317
|
return n3;
|
|
317
|
-
}, []),
|
|
318
|
+
}, []), P2 = z((e2) => {
|
|
318
319
|
h2?.(e2);
|
|
319
|
-
}, []),
|
|
320
|
+
}, []), R2 = z((e2) => {
|
|
320
321
|
f2?.(e2);
|
|
321
|
-
}, []),
|
|
322
|
+
}, []), M2 = z((t3) => {
|
|
322
323
|
const { closeFloatAll: o3, floatReference: l3 } = t3, c3 = (e2, t4, n3 = "bottom", r3 = false) => {
|
|
323
|
-
const l4 =
|
|
324
|
-
return
|
|
325
|
-
o3(),
|
|
324
|
+
const l4 = D2(e2, C2 ?? null, r3 ? a.StrokeStyle.None : S2 ?? null), i3 = r3 ? D2([], C2 ?? null, S2 ?? null) : l4;
|
|
325
|
+
return N(Ye, { icon: T2(i3), sx: { background: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})` }, tooltipProps: { label: t4, simple: true, placement: n3 }, onClick: () => {
|
|
326
|
+
o3(), R2(l4), P2(l4);
|
|
326
327
|
} });
|
|
327
|
-
}, m3 =
|
|
328
|
-
|
|
328
|
+
}, m3 = E(A, { children: [E(X, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [c3([a.Edge.Left, a.Edge.Top, a.Edge.Right, a.Edge.Bottom, a.Edge.Horizontal, a.Edge.Vertical], "All Borders", "top"), c3([a.Edge.Horizontal, a.Edge.Vertical], "Inner Borders", "top"), c3([a.Edge.Horizontal], "Inside Horizontal Borders", "top"), c3([a.Edge.Vertical], "Inside Vertical Borders", "top"), c3([a.Edge.Left, a.Edge.Top, a.Edge.Right, a.Edge.Bottom], "Outside Borders", "top")] }), E(X, { sx: { display: "flex", padding: "6px 16px", justifyContent: "center", rowGap: "2px", gap: "2px" }, children: [c3([a.Edge.Left], "Left Borders"), c3([a.Edge.Top], "Top Borders"), c3([a.Edge.Right], "Right Borders"), c3([a.Edge.Bottom], "Bottom Borders"), c3([a.Edge.Left, a.Edge.Top, a.Edge.Right, a.Edge.Bottom, a.Edge.Horizontal, a.Edge.Vertical, a.Edge.DiagonalUp, a.Edge.DiagonalDown], "No Borders", "bottom", true)] })] }), p3 = N(A, { children: E(X, { sx: { display: "flex", padding: "6px 16px", flexDirection: "row", gap: "6px" }, children: [N(kr, { variant: Ge.Toolbar, icon: N(Ze, {}), selectedColor: S2 === a.StrokeStyle.None ? new e("transparent") : C2, onPreviewColor: (e2) => {
|
|
329
|
+
k2(e2);
|
|
329
330
|
}, onSelectColor: (e2, t4) => {
|
|
330
|
-
|
|
331
|
-
}, darkMode: s2, tooltip: "Border Color", panelProps: { disableAlpha: true, autoColor: n2, schemeLookup: r2 }, disabled: i2 ||
|
|
332
|
-
return
|
|
333
|
-
}, [
|
|
334
|
-
return
|
|
335
|
-
h2?.(
|
|
336
|
-
}, quickButtonProps: { sx: {} }, disabled: i2, icon:
|
|
337
|
-
})), Dr =
|
|
338
|
-
const { commands: o2, command: n2, commandHook: a2, variant: r2 =
|
|
339
|
-
|
|
340
|
-
}, [
|
|
331
|
+
k2(e2);
|
|
332
|
+
}, darkMode: s2, tooltip: "Border Color", panelProps: { disableAlpha: true, autoColor: n2, schemeLookup: r2 }, disabled: i2 || S2 === a.StrokeStyle.None, parentFloat: l3, shouldCloseFloatAll: false }), N(vr, { selectedStyle: S2, onSelectStyle: y2, styleColor: C2, darkMode: s2, variant: Ge.Toolbar, parentFloat: l3 })] }) });
|
|
333
|
+
return E(X, { sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, onClick: (e2) => e2.stopPropagation(), children: [d2 ? p3 : m3, N(Se, { orientation: "horizontal" }), d2 ? m3 : p3] });
|
|
334
|
+
}, [S2, C2, n2, r2, s2]), F2 = W(() => T2(v2), [v2, s2]);
|
|
335
|
+
return N(Ue, { ref: o2, createPopupPanel: M2, popupProps: { popperProps: { resizeOnOverflow: false } }, createTooltip: ({ children: e2 }, t3) => N(Je, { label: "Borders", description: "Set the borders.", disabled: t3, children: e2 }), onQuickClick: () => {
|
|
336
|
+
h2?.(v2);
|
|
337
|
+
}, quickButtonProps: { sx: {} }, disabled: i2, icon: F2, ...g2 });
|
|
338
|
+
})), Dr = L(H((e2, t2) => {
|
|
339
|
+
const { commands: o2, command: n2, commandHook: a2, variant: r2 = ya.Toolbar, disabled: l2 = false, autoColor: i2, autoStrokeStyle: s2, schemeLookup: d2, createTemporaryBorder: c2, selectedBorder: m2, onSelectBorder: p2, darkMode: u2, icon: g2, label: h2, ...f2 } = e2, x2 = ba(o2, ["formatBorder"]), b2 = n2 ?? x2[0], y2 = b2?.context() ?? null, w2 = y2?.autoColor ?? i2, k2 = y2?.autoStyle ?? s2, S2 = m2 ?? y2?.quickBorder, C2 = u2 ?? y2?.darkMode, v2 = c2 ?? y2?.createTemporaryBorder, T2 = d2 ?? y2?.schemeLookup, D2 = wa((e3) => {
|
|
340
|
+
y2?.onBorderSelect && y2.onBorderSelect(e3), p2?.(e3), b2?.execute(e3, a2);
|
|
341
|
+
}, [b2, p2, a2]), P2 = z((e3, t3) => {
|
|
341
342
|
const { children: o3, title: n3, ...a3 } = e3;
|
|
342
343
|
let i3 = e3.children;
|
|
343
|
-
return (
|
|
344
|
-
}, [
|
|
345
|
-
return
|
|
346
|
-
})), Pr =
|
|
347
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
348
|
-
const o3 = { variant:
|
|
349
|
-
return
|
|
344
|
+
return (b2?.disabled() || l2) && (i3 = N("div", { children: i3 })), N(Qe, { command: b2, placement: r2 === ya.Toolbar ? "bottom-start" : "right-start", disabled: t3, ...a3, children: i3 });
|
|
345
|
+
}, [b2, l2]);
|
|
346
|
+
return N(Tr, { ref: t2, autoColor: w2, darkMode: C2, autoStrokeStyle: k2, createTemporaryBorder: v2, schemeLookup: T2, selectedBorder: S2, onSelectBorder: D2, createTooltip: P2, disabled: l2 || !b2 || b2.disabled(), ...f2 });
|
|
347
|
+
})), Pr = L(H((e2, t2) => {
|
|
348
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
349
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("mergeToggle"), icon: we(N(et, {})) }), N(ke, { ...o3, command: t3.getCommand("mergeHorizontal"), icon: we(N(tt, {})) }), N(ke, { ...o3, command: t3.getCommand("mergeVertical"), icon: we(N(ot, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("unmerge"), icon: we(N(nt, {})) })] });
|
|
350
|
+
return Te({ ...e3, children: l3 });
|
|
350
351
|
}, [r2, n2, a2]);
|
|
351
|
-
return
|
|
352
|
-
})), Rr =
|
|
353
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
354
|
-
const o3 = { variant:
|
|
355
|
-
return
|
|
352
|
+
return N(De, { ref: t2, commands: o2, quickCommand: "mergeToggle", commandHook: n2, scope: a2, tooltip: "Combine or split cells.", createPopupPanel: i2, icon: we(N(et, {})), ...l2 });
|
|
353
|
+
})), Rr = L(H((e2, t2) => {
|
|
354
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
355
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("freezeToggle"), icon: we(N(at, {})) }), N(ke, { ...o3, command: t3.getCommand("freezeToggleHorizontal"), icon: we(N(rt, {})) }), N(ke, { ...o3, command: t3.getCommand("freezeToggleVertical"), icon: we(N(lt, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("unfreeze"), icon: N(nt, {}) })] });
|
|
356
|
+
return Te({ ...e3, children: l3 });
|
|
356
357
|
}, [r2, n2, a2]);
|
|
357
|
-
return
|
|
358
|
-
})), Mr =
|
|
359
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
360
|
-
const o3 = { variant:
|
|
361
|
-
return
|
|
358
|
+
return N(De, { ref: t2, commands: o2, commandHook: n2, createPopupPanel: i2, quickCommand: "freezeToggle", label: "Freeze Panes", tooltip: "Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.", icon: N(it, {}), ...l2 });
|
|
359
|
+
})), Mr = L(H((e2, t2) => {
|
|
360
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
361
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("find"), icon: we(N(st, {})) }), N(ke, { ...o3, command: t3.getCommand("findReplace"), icon: we(N(dt, {})) }), N(ke, { ...o3, command: t3.getCommand("goto"), icon: we(N(ct, {})) })] });
|
|
362
|
+
return Te({ ...e3, children: l3 });
|
|
362
363
|
}, [r2, n2, a2]);
|
|
363
|
-
return
|
|
364
|
-
})), Fr =
|
|
365
|
-
const { command: o2, commandHook: n2, showQuickButtons: a2 = !!e2.commands, commands: l2, fontSizes: i2 =
|
|
366
|
-
|
|
367
|
-
const g2 = () => o2?.state()?.toString() || "11", [h2, f2] =
|
|
364
|
+
return N(De, { ref: t2, commands: o2, commandHook: n2, createPopupPanel: i2, label: "Find & Select", tooltip: "Find and replace cells or go to a specific location.", quickCommand: "find", icon: we(N(st, {})), ...l2 });
|
|
365
|
+
})), Fr = L(H((e2, t2) => {
|
|
366
|
+
const { command: o2, commandHook: n2, showQuickButtons: a2 = !!e2.commands, commands: l2, fontSizes: i2 = y.DefaultFontSizes, disabled: s2 = false, parentFloat: d2, icon: c2, label: m2, sx: p2, ...u2 } = e2;
|
|
367
|
+
Ca(o2);
|
|
368
|
+
const g2 = () => o2?.state()?.toString() || "11", [h2, f2] = O(g2), x2 = wa(() => {
|
|
368
369
|
const e3 = parseFloat(h2);
|
|
369
370
|
isNaN(e3) ? f2(g2()) : parseFloat(g2()) !== e3 && o2.execute(e3, n2);
|
|
370
371
|
}, [g2, o2, h2, n2]);
|
|
371
|
-
|
|
372
|
+
V(() => {
|
|
372
373
|
f2(g2());
|
|
373
374
|
}, [o2?.state()]);
|
|
374
|
-
const
|
|
375
|
+
const b2 = W(() => {
|
|
375
376
|
if (!n2) return null;
|
|
376
377
|
const e3 = { ...n2 };
|
|
377
378
|
return delete e3.beforeExecute, e3;
|
|
378
|
-
}, [n2]),
|
|
379
|
+
}, [n2]), w2 = ba(l2, ["formatFontSizeIncrease", "formatFontSizeDecrease"]), k2 = W(() => w2 ? E(X, { className: Yn("quick-buttons", {}), sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (e3) => e3.stopPropagation(), children: [N(ke, { command: w2[0], commandHook: b2, icon: we(N(mt, {})) }), N(ke, { command: w2[1], icon: we(N(pt, {})) })] }) : null, [w2]), S2 = Ha(), C2 = W(() => `${r.getSharedMeasurer()("12.3", Math.round(S2.typography.fontSize), S2.typography.fontFamily).width}px`, [S2]), v2 = z((e3) => {
|
|
379
380
|
const { onMouseDown: t3, onMouseUp: n3, ...a3 } = e3;
|
|
380
|
-
return
|
|
381
|
+
return N(J, { component: "div", ...a3, disableRipple: true, children: N(oe, { inputMode: "numeric", disabled: s2 || !o2 || o2.disabled(), inputProps: { name: "font-input", autoComplete: "off", tabIndex: 0, type: "number", maxLength: 4, max: 409, min: 2 }, sx: { "&::before": { borderBottom: "1px solid transparent" }, "&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before": { borderBottom: (e4) => `1px solid ${e4.palette.text.icon ?? e4.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (e4) => `1px solid ${e4.palette.error.main}` }, "::after": { borderBottom: (e4) => `1px solid ${e4.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", paddingLeft: "0px", paddingRight: "0px", fontSize: (e4) => `${Math.round(e4.typography.fontSize)}px`, width: C2, color: (e4) => e4.palette.text.secondary, input: { padding: "0 0", textAlign: "center", MozAppearance: "textfield", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (e4) => e4.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (e4) => e4.palette.text.primary } }, "input::-webkit-inner-spin-button": { WebkitAppearance: "none", margin: "0" }, minHeight: "24px" }, value: h2, onFocus: (e4) => {
|
|
381
382
|
e4.target?.select();
|
|
382
383
|
}, onKeyDown: (e4) => {
|
|
383
|
-
if (e4.which ===
|
|
384
|
-
else if (e4.which ===
|
|
384
|
+
if (e4.which === Sa.Enter) g2() !== h2 && (e4.stopPropagation(), e4.preventDefault(), x2());
|
|
385
|
+
else if (e4.which === Sa.Escape) g2() !== h2 && (f2(g2()), setTimeout(() => {
|
|
385
386
|
e4.target?.select();
|
|
386
387
|
}, 0), e4.stopPropagation(), e4.preventDefault());
|
|
387
388
|
else {
|
|
388
389
|
if (e4.key.match("[-]")) return e4.stopPropagation(), void e4.preventDefault();
|
|
389
390
|
if (e4.key.match("[0-9.]") && (h2 + e4.key).length > 4) return e4.stopPropagation(), void e4.preventDefault();
|
|
390
|
-
if (e4.which ===
|
|
391
|
+
if (e4.which === Sa.Space) return void e4.preventDefault();
|
|
391
392
|
}
|
|
392
393
|
}, onBlur: () => {
|
|
393
|
-
|
|
394
|
+
x2();
|
|
394
395
|
}, onChange: (e4) => {
|
|
395
396
|
if (e4.target.value.length > 4) return e4.stopPropagation(), void e4.preventDefault();
|
|
396
397
|
f2(e4.target.value);
|
|
397
398
|
} }) });
|
|
398
|
-
}, [h2, s2, o2]),
|
|
399
|
+
}, [h2, s2, o2]), T2 = z((e3) => {
|
|
399
400
|
const t3 = (e4) => {
|
|
400
401
|
o2?.execute(e4, n2);
|
|
401
402
|
}, a3 = o2?.state(), r2 = [];
|
|
402
403
|
for (let e4 = 0; e4 < i2.length; e4++) {
|
|
403
404
|
const n3 = i2[e4] === a3;
|
|
404
|
-
r2.push(
|
|
405
|
+
r2.push(N(qe, { selected: n3, icon: n3 ? N(ut, {}) : void 0, disabled: s2 || !o2 || o2.disabled(), onMouseDown: (e5) => {
|
|
405
406
|
0 === e5.button && e5.preventDefault();
|
|
406
407
|
}, onMouseUp: (o3) => {
|
|
407
408
|
0 === o3.button && t3(i2[e4]);
|
|
408
409
|
}, onKeyDown: (o3) => {
|
|
409
|
-
o3.keyCode !==
|
|
410
|
-
}, sx: { paddingTop: "4px", paddingBottom: "4px" }, children:
|
|
410
|
+
o3.keyCode !== Sa.Enter && o3.keyCode !== Sa.Space || t3(i2[e4]);
|
|
411
|
+
}, sx: { paddingTop: "4px", paddingBottom: "4px" }, children: N(X, { sx: { display: "flex", flex: "1 1 100%", justifyContent: "end" }, children: i2[e4] }) }, "fontSize-" + e4));
|
|
411
412
|
}
|
|
412
|
-
const l3 =
|
|
413
|
-
return
|
|
413
|
+
const l3 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...u2, children: [k2, N(Se, { orientation: "horizontal" }), N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: r2 })] });
|
|
414
|
+
return Te({ ...e3, children: l3 });
|
|
414
415
|
}, [s2, o2?.state(), n2]);
|
|
415
|
-
return
|
|
416
|
-
})), Br =
|
|
416
|
+
return N(Ue, { ref: t2, sx: { ...p2 }, tabIndex: -1, outlined: true, disabled: s2, parentFloat: d2, createPopupPanel: T2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: o2?.label(), description: o2?.description(), disabled: t3 || o2?.disabled(), children: e3 }), createQuickButton: v2, ...u2 });
|
|
417
|
+
})), Br = L((e2) => {
|
|
417
418
|
const { selected: t2, disabled: o2, formattedValue: n2, handleSetFormat: a2, format: r2, sx: i2, ...s2 } = e2;
|
|
418
|
-
return
|
|
419
|
+
return N(qe, { sx: { maxWidth: "360px", display: "flex", "*": { lineHeight: "1.2" }, ...i2 }, disabled: o2, selected: t2, icon: t2 ? N(ut, {}) : void 0, onMouseDown: (e3) => {
|
|
419
420
|
0 === e3.button && e3.preventDefault();
|
|
420
421
|
}, onMouseUp: (e3) => {
|
|
421
422
|
0 === e3.button && a2(r2.numberFormat);
|
|
422
423
|
}, onKeyDown: (e3) => {
|
|
423
|
-
e3.keyCode !==
|
|
424
|
-
}, ...s2, children:
|
|
425
|
-
}), Nr =
|
|
426
|
-
const { commands: o2, commandHook: n2, scope: a2, sx: i2, disabled: s2 = false, parentFloat: d2, ...c2 } = e2, m2 =
|
|
424
|
+
e3.keyCode !== Sa.Enter && e3.keyCode !== Sa.Space || a2(r2.numberFormat);
|
|
425
|
+
}, ...s2, children: E(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [E(Z, { component: "div", children: [r2.formatType, r2.formatType === l.Type.Custom ? "…" : ""] }), N(Z, { variant: "caption", component: "div", sx: { color: (e3) => Oa(e3.palette.text.primary, 0.6), paddingTop: n2 && n2.length > 0 ? "1px" : void 0, overflow: "hidden", textOverflow: "ellipsis" }, children: n2 && n2.length > 0 ? n2 : " " })] }) });
|
|
426
|
+
}), Nr = L(H((e2, t2) => {
|
|
427
|
+
const { commands: o2, commandHook: n2, scope: a2, sx: i2, disabled: s2 = false, parentFloat: d2, ...c2 } = e2, m2 = ba(o2, ["formatNumberFormat"])[0], p2 = m2?.state() ? l.Styles.lookupStyle(m2?.state()).formatType : l.Type.General, u2 = W(() => {
|
|
427
428
|
if (!n2) return null;
|
|
428
429
|
const e3 = { ...n2 };
|
|
429
430
|
return delete e3.beforeExecute, e3;
|
|
430
|
-
}, [n2]), g2 =
|
|
431
|
+
}, [n2]), g2 = z((e3, t3) => {
|
|
431
432
|
const o3 = (e4) => {
|
|
432
433
|
n2?.beforeExecute?.(m2, m2?.state()), m2.execute(e4, n2), n2?.onExecute?.(m2, m2?.state());
|
|
433
434
|
}, r2 = m2?.context()(), i3 = l.Styles.lookupPrimary(), d3 = [];
|
|
@@ -440,149 +441,149 @@ const nr = k(S((e2, t2) => {
|
|
|
440
441
|
}
|
|
441
442
|
"" === t4 && i3[e4].formatType === l.Type.General && (t4 = "No specific format");
|
|
442
443
|
const n3 = i3[e4].formatType === p2;
|
|
443
|
-
d3.push(
|
|
444
|
+
d3.push(N(Br, { selected: n3, disabled: s2 || !m2 || m2.disabled(), formattedValue: t4, handleSetFormat: o3, format: i3[e4] }, i3[e4].formatType));
|
|
444
445
|
}
|
|
445
|
-
const g3 = { numberFormat: "", formatType: l.Type.Custom }, h3 = p2 === l.Type.Custom, f3 =
|
|
446
|
+
const g3 = { numberFormat: "", formatType: l.Type.Custom }, h3 = p2 === l.Type.Custom, f3 = N(Br, { selected: h3, disabled: s2 || !m2 || m2.disabled(), formattedValue: h3 ? r2.getNumberFormat().displayText : "", handleSetFormat: () => {
|
|
446
447
|
n2?.beforeExecute?.(m2, m2?.state()), t3.getCommand("formatNumberDialog")?.execute(m2?.state()), n2?.onExecute?.(m2, m2?.state());
|
|
447
|
-
}, format: g3, sx: { flex: "0", width: "100%" } }, l.Type.Custom),
|
|
448
|
-
return
|
|
449
|
-
}, [m2?.context(), m2?.state(), n2, a2]), h2 =
|
|
448
|
+
}, format: g3, sx: { flex: "0", width: "100%" } }, l.Type.Custom), x2 = E(X, { className: "quick-buttons", sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClick: (e4) => e4.stopPropagation(), children: [N(ke, { command: t3.getCommand("formatNumberFormatAccountingStyle"), commandHook: u2, scope: a2, icon: N(gt, {}) }), N(ke, { command: t3.getCommand("formatNumberFormatPercentStyle"), commandHook: u2, scope: a2, icon: N(ht, {}) }), N(ke, { command: t3.getCommand("formatNumberFormatCommaStyle"), commandHook: u2, scope: a2, icon: N(ft, {}) }), N(ke, { command: t3.getCommand("formatNumberFormatIncreaseDecimal"), commandHook: u2, scope: a2, icon: we(N(xt, {})) }), N(ke, { command: t3.getCommand("formatNumberFormatDecreaseDecimal"), commandHook: u2, scope: a2, icon: we(N(bt, {})) })] }), b2 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...c2, children: [x2, N(Se, { orientation: "horizontal" }), N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: d3 }), N(Se, { orientation: "horizontal" }), f3] });
|
|
449
|
+
return Te({ ...e3, children: b2 });
|
|
450
|
+
}, [m2?.context(), m2?.state(), n2, a2]), h2 = Ha(), f2 = W(() => {
|
|
450
451
|
const e3 = l.Type.MediumTime;
|
|
451
452
|
return `${r.getSharedMeasurer()(e3, Math.round(h2.typography.fontSize), h2.typography.fontFamily).width}px`;
|
|
452
453
|
}, [h2]);
|
|
453
|
-
return
|
|
454
|
-
})), Er =
|
|
455
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
456
|
-
const o3 = { variant:
|
|
457
|
-
return
|
|
454
|
+
return N(De, { ref: t2, commands: o2, sx: i2, outlined: true, disabled: s2, parentFloat: d2, createPopupPanel: g2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: m2?.label(), description: m2?.description(), disabled: t3, children: e3 }), icon: N(X, { sx: { display: "flex", paddingLeft: "4px", paddingRight: "4px", fontSize: (e3) => `${Math.round(e3.typography.fontSize)}px`, color: (e3) => e3.palette.text.secondary, fontFamily: (e3) => e3.typography.fontFamily, width: f2 }, children: N(X, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: p2 }) }), ...c2 });
|
|
455
|
+
})), Er = L(H((e2, t2) => {
|
|
456
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
457
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "clear", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("clearAll"), icon: N(yt, {}) }), N(ke, { ...o3, command: t3.getCommand("clearFormats"), icon: we(N(wt, {})) }), N(ke, { ...o3, command: t3.getCommand("clearContents"), icon: we(N(kt, {})) }), N(ke, { ...o3, command: t3.getCommand("clearComments") }), N(ke, { ...o3, command: t3.getCommand("clearHyperlinks") })] });
|
|
458
|
+
return Te({ ...e3, children: a3 });
|
|
458
459
|
}, [r2, n2, a2]);
|
|
459
|
-
return
|
|
460
|
-
})), Ar =
|
|
461
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
462
|
-
const o3 = { variant:
|
|
463
|
-
return
|
|
460
|
+
return N(De, { ref: t2, commands: o2, disabled: r2, commandHook: n2, scope: a2, label: "Clear", tooltip: "Clear everything in the cell, or remove just the formatting or contents.", createPopupPanel: i2, icon: N(yt, {}), ...l2 });
|
|
461
|
+
})), Ar = L(H((e2, t2) => {
|
|
462
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
463
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "fill", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("fillDown"), icon: we(N(St, {})) }), N(ke, { ...o3, command: t3.getCommand("fillRight"), icon: we(N(St, { sx: { transform: "rotate(270deg)" } })) }), N(ke, { ...o3, command: t3.getCommand("fillUp"), icon: we(N(St, { sx: { transform: "rotate(180deg)" } })) }), N(ke, { ...o3, command: t3.getCommand("fillLeft"), icon: we(N(St, { sx: { transform: "rotate(90deg)" } })) })] });
|
|
464
|
+
return Te({ ...e3, children: a3 });
|
|
464
465
|
}, [r2, n2, a2]);
|
|
465
|
-
return
|
|
466
|
-
})), Ir =
|
|
467
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, disableSheet: l2 = false, preferSingleMenu: i2 = true, showQuickButton: s2 = true, variant: d2 =
|
|
466
|
+
return N(De, { ref: t2, commands: o2, disabled: r2, commandHook: n2, label: "Fill", tooltip: "Fill the selected cells with the value from one of the corners.", createPopupPanel: i2, icon: we(N(St, {})), ...l2 });
|
|
467
|
+
})), Ir = L(H((e2, t2) => {
|
|
468
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, disableSheet: l2 = false, preferSingleMenu: i2 = true, showQuickButton: s2 = true, variant: d2 = ya.Toolbar, ...c2 } = e2, m2 = ["insertCellsShiftDown", "insertCellsShiftRight", "insertRows", "insertColumns"], p2 = ba(o2, m2), { singleCommand: u2, allDisabled: g2 } = W(() => {
|
|
468
469
|
let e3 = null, t3 = 0;
|
|
469
|
-
for (let o3 = 0; o3 < p2.length; o3++) p2[o3] && !p2[o3]?.disabled() && (i2 && d2 ===
|
|
470
|
+
for (let o3 = 0; o3 < p2.length; o3++) p2[o3] && !p2[o3]?.disabled() && (i2 && d2 === ya.Menuitem && (e3 = 0 === t3 ? p2[o3] : null), t3++);
|
|
470
471
|
return { singleCommand: e3, allDisabled: 0 === t3 };
|
|
471
|
-
}, [p2]), h2 =
|
|
472
|
+
}, [p2]), h2 = W(() => {
|
|
472
473
|
const e3 = /* @__PURE__ */ new Map();
|
|
473
|
-
return e3.set("insertCellsShiftDown",
|
|
474
|
-
}, []), f2 =
|
|
474
|
+
return e3.set("insertCellsShiftDown", we(N(Ct, {}))), e3.set("insertCellsShiftRight", we(N(Ct, { sx: { transform: "rotate(270deg)" } }))), e3.set("insertRows", we(N(vt, {}))), e3.set("insertColumns", we(N(Tt, {}))), e3;
|
|
475
|
+
}, []), f2 = z((e3, t3) => {
|
|
475
476
|
let o3 = null;
|
|
476
|
-
const a3 = { variant:
|
|
477
|
-
l2 || (o3 =
|
|
478
|
-
const i3 =
|
|
479
|
-
return
|
|
477
|
+
const a3 = { variant: ya.Menuitem, commandHook: n2, scope: "insertCells", disabled: r2 };
|
|
478
|
+
l2 || (o3 = E(A, { children: [N(Se, { orientation: "horizontal" }), N(ke, { ...a3, command: t3.getCommand("addSheet"), icon: we(N(Dt, {})) })] }));
|
|
479
|
+
const i3 = E(A, { children: [N(ke, { ...a3, command: p2[0], icon: h2.get(m2[0]) }), N(ke, { ...a3, command: p2[1], icon: h2.get(m2[1]) }), N(Se, { orientation: "horizontal" }), N(ke, { ...a3, command: p2[2], icon: h2.get(m2[2]) }), N(ke, { ...a3, command: p2[3], icon: h2.get(m2[3]) }), o3] });
|
|
480
|
+
return Te({ ...e3, children: i3 });
|
|
480
481
|
}, [r2, p2, n2, a2, h2]);
|
|
481
|
-
return u2 ?
|
|
482
|
-
})), Lr =
|
|
483
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, disableSheet: l2 = false, preferSingleMenu: i2 = true, showQuickButton: s2 = true, variant: d2 =
|
|
482
|
+
return u2 ? N(ke, { ref: t2, variant: d2, commandHook: n2, disabled: r2, command: u2, icon: h2.get(u2.key()), ...c2 }) : N(De, { ref: t2, variant: d2, quickCommand: "insertCells", commands: o2, commandHook: n2, scope: a2, disabled: r2 || g2, tooltip: E(A, { children: [N("span", { children: "Insert new cells, rows or columns to your workbook." }), N("br", {}), N("span", { children: "To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert." })] }), createPopupPanel: f2, icon: we(N(Tt, {})), ...c2 });
|
|
483
|
+
})), Lr = L(H((e2, t2) => {
|
|
484
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, disableSheet: l2 = false, preferSingleMenu: i2 = true, showQuickButton: s2 = true, variant: d2 = ya.Toolbar, ...c2 } = e2, m2 = ba(o2, ["deleteCellsShiftUp", "deleteCellsShiftLeft", "deleteRows", "deleteColumns"]), { singleCommand: p2, allDisabled: u2 } = W(() => {
|
|
484
485
|
let e3 = null, t3 = 0;
|
|
485
|
-
for (let o3 = 0; o3 < m2.length; o3++) m2[o3] && !m2[o3]?.disabled() && (i2 && d2 ===
|
|
486
|
+
for (let o3 = 0; o3 < m2.length; o3++) m2[o3] && !m2[o3]?.disabled() && (i2 && d2 === ya.Menuitem && (e3 = 0 === t3 ? m2[o3] : null), t3++);
|
|
486
487
|
return { singleCommand: e3, allDisabled: 0 === t3 };
|
|
487
|
-
}, [m2]), g2 =
|
|
488
|
+
}, [m2]), g2 = W(() => {
|
|
488
489
|
const e3 = /* @__PURE__ */ new Map();
|
|
489
|
-
return e3.set("deleteCellsShiftUp",
|
|
490
|
-
}, []), h2 =
|
|
491
|
-
const o3 = { variant:
|
|
490
|
+
return e3.set("deleteCellsShiftUp", we(N(Pt, { sx: { transform: "rotate(0deg)" } }))), e3.set("deleteCellsShiftLeft", we(N(Pt, { sx: { transform: "rotate(270deg)" } }))), e3.set("deleteRows", we(N(Rt, {}))), e3.set("deleteColumns", we(N(Mt, {}))), e3;
|
|
491
|
+
}, []), h2 = z((e3, t3) => {
|
|
492
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "deleteCells", disabled: r2 };
|
|
492
493
|
let a3 = null;
|
|
493
|
-
l2 || (a3 =
|
|
494
|
-
const i3 =
|
|
495
|
-
return
|
|
494
|
+
l2 || (a3 = E(A, { children: [N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("deleteSheet"), icon: we(N(Dt, {})) })] }));
|
|
495
|
+
const i3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("deleteCellsShiftUp"), icon: g2.get("deleteCellsShiftUp") }), N(ke, { ...o3, command: t3.getCommand("deleteCellsShiftLeft"), icon: g2.get("deleteCellsShiftLeft") }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("deleteRows"), icon: g2.get("deleteRows") }), N(ke, { ...o3, command: t3.getCommand("deleteColumns"), icon: g2.get("deleteColumns") }), a3] });
|
|
496
|
+
return Te({ ...e3, children: i3 });
|
|
496
497
|
}, [r2, n2, a2, g2]);
|
|
497
|
-
return p2 ?
|
|
498
|
-
})), Hr =
|
|
499
|
-
const { command: n2, commandHook: a2, onSelectColor: r2, disabled: l2 = false, variant: i2 =
|
|
498
|
+
return p2 ? N(ke, { ref: t2, variant: d2, commandHook: n2, disabled: r2, command: p2, icon: g2.get(p2.key()), ...c2 }) : N(De, { ref: t2, variant: d2, quickCommand: "deleteCells", commands: o2, commandHook: n2, scope: a2, disabled: r2 || u2, tooltip: E(A, { children: [N("span", { children: "Delete cells, rows, columns or sheets from your workbook." }), N("br", {}), N("span", { children: "To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete." })] }), createPopupPanel: h2, icon: we(N(Mt, {})), ...c2 });
|
|
499
|
+
})), Hr = L(H((t2, o2) => {
|
|
500
|
+
const { command: n2, commandHook: a2, onSelectColor: r2, disabled: l2 = false, variant: i2 = ya.Toolbar, quickColor: s2, panelProps: d2, isSplit: c2 = false, darkMode: m2, icon: p2, ...u2 } = t2, { autoColor: g2, schemeLookup: h2, recentColors: f2, ...x2 } = d2;
|
|
500
501
|
if (u2.selectedColor) throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
let
|
|
504
|
-
c2 && !
|
|
505
|
-
const
|
|
506
|
-
e2 && t3 &&
|
|
507
|
-
}, [n2, r2, a2,
|
|
502
|
+
Ca(n2);
|
|
503
|
+
const b2 = n2?.context();
|
|
504
|
+
let y2 = s2 ?? b2?.quickColor;
|
|
505
|
+
c2 && !y2 && (y2 = new e("transparent"));
|
|
506
|
+
const w2 = g2 ?? b2?.autoColor, k2 = h2 ?? b2?.schemeLookup, S2 = f2 ?? b2?.recentColors, C2 = m2 ?? b2?.darkMode, v2 = W(() => ({ autoColor: w2, schemeLookup: k2, recentColors: S2, darkMode: C2, ...x2 }), [w2, k2, S2, C2]), T2 = wa((e2, t3) => {
|
|
507
|
+
e2 && t3 && b2?.addRecentColor && b2.addRecentColor(e2), b2?.onColorSelect && b2.onColorSelect(e2), r2?.(e2, t3), n2?.execute(e2, a2);
|
|
508
|
+
}, [n2, r2, a2, b2]), D2 = z((e2, t3) => {
|
|
508
509
|
const { children: o3, title: a3, ...r3 } = e2;
|
|
509
510
|
let s3 = e2.children;
|
|
510
|
-
return (n2?.disabled() || l2) && (s3 =
|
|
511
|
+
return (n2?.disabled() || l2) && (s3 = N("div", { children: s3 })), N(Qe, { command: n2, placement: i2 === ya.Toolbar ? "bottom-start" : "right-start", disabled: t3, ...r3, children: s3 });
|
|
511
512
|
}, [n2, l2]);
|
|
512
|
-
return
|
|
513
|
+
return N(kr, { ref: o2, panelProps: v2, icon: p2, quickColor: y2, selectedColor: n2?.state(), onSelectColor: T2, variant: i2 === ya.Menuitem ? Ge.Menuitem : Ge.Toolbar, createTooltip: D2, label: n2?.label(), disabled: l2 || !n2 || n2.disabled(), compareRGB: true, darkMode: C2, ...u2 });
|
|
513
514
|
}));
|
|
514
515
|
Hr.displayName = "ColorCommandButton";
|
|
515
|
-
const Wr =
|
|
516
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, parentFloat: l2, ...i2 } = e2, s2 =
|
|
517
|
-
const o3 = { variant:
|
|
518
|
-
return
|
|
516
|
+
const Wr = L(H((e2, t2) => {
|
|
517
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, parentFloat: l2, ...i2 } = e2, s2 = ba(o2, ["gridlinesToggle", "sheetViewToggleGridlinesColumns", "sheetViewToggleGridlinesRows"]), d2 = z((e3, t3) => {
|
|
518
|
+
const o3 = { variant: ya.Menuitem, parentFloat: e3.floatReference, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("gridlinesToggle") }), N(Hr, { ...o3, command: t3.getCommand("sheetViewFormatGridlinesColor"), icon: N(Ze, {}), panelProps: { disableAlpha: true } }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("sheetViewToggleGridlinesColumns") }), N(ke, { ...o3, command: t3.getCommand("sheetViewToggleGridlinesRows") })] });
|
|
519
|
+
return Te({ ...e3, children: l3 });
|
|
519
520
|
}, [r2, n2]);
|
|
520
|
-
return
|
|
521
|
-
})), zr =
|
|
522
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
523
|
-
const o3 = { variant:
|
|
524
|
-
return
|
|
521
|
+
return N(De, { ref: t2, parentFloat: l2, quickCommand: s2[0]?.key(), commands: o2, commandHook: n2, createPopupPanel: d2, label: "Gridlines", tooltip: "Configure how the lines between rows and columns in the sheet are displayed.", icon: N(Ft, { command: s2[0], scope: "view" }), ...i2 });
|
|
522
|
+
})), zr = L(H((e2, t2) => {
|
|
523
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
524
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "sort", disabled: r2 }, a3 = t3.getCommand("sortCustom"), l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("sortAscending"), icon: we(N(Bt, {})) }), N(ke, { ...o3, command: t3.getCommand("sortDescending"), icon: we(N(Nt, {})) }), a3 ? N(ke, { ...o3, command: a3, icon: we(N(Et, {})) }) : null, N(Se, { orientation: "horizontal" }), N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterToggle"), icon: we(N(At, {})) }), N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterClear"), icon: we(N(It, {})) }), N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterReapply"), icon: we(N(Lt, {})) })] });
|
|
525
|
+
return Te({ ...e3, children: l3 });
|
|
525
526
|
}, [r2, n2, a2]);
|
|
526
|
-
return
|
|
527
|
-
})), $r =
|
|
528
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
529
|
-
const o3 = { variant:
|
|
530
|
-
return
|
|
527
|
+
return N(De, { ref: t2, commands: o2, commandHook: n2, scope: a2, disabled: r2, label: "Sort", tooltip: E(A, { children: [N("span", { children: "Organize your data so it's easier to analyze." }), N("br", {}), N("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), createPopupPanel: i2, icon: we(N(Bt, {})), ...l2 });
|
|
528
|
+
})), $r = L(H((e2, t2) => {
|
|
529
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = z((e3, t3) => {
|
|
530
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "sort", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterToggle"), icon: we(N(At, {})) }), N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterClear"), icon: we(N(It, {})) }), N(ke, { ...o3, scope: "filter", command: t3.getCommand("autoFilterReapply"), icon: we(N(Lt, {})) })] });
|
|
531
|
+
return Te({ ...e3, children: a3 });
|
|
531
532
|
}, [r2, n2, a2]);
|
|
532
|
-
return
|
|
533
|
-
})), Or =
|
|
533
|
+
return N(De, { ref: t2, commands: o2, commandHook: n2, scope: a2, disabled: r2, label: "Filter", tooltip: E(A, { children: [N("span", { children: "Organize your data so it's easier to analyze." }), N("br", {}), N("span", { children: "You can sort the selected data from smallest to largest or largest to smallest." })] }), createPopupPanel: i2, icon: we(N(At, {})), ...l2 });
|
|
534
|
+
})), Or = L(H((e2, t2) => {
|
|
534
535
|
const { quickCommand: o2, icon: n2, isRedo: a2 = false, nestRedo: r2 = true, undoManager: l2, scope: i2, sx: s2, disabled: d2, commands: c2, ...m2 } = e2, p2 = [o2];
|
|
535
536
|
!a2 && r2 && p2.push("redo");
|
|
536
|
-
const u2 =
|
|
537
|
-
let
|
|
538
|
-
d2 || (
|
|
539
|
-
const [
|
|
540
|
-
let o3 = 0 ===
|
|
537
|
+
const u2 = ba(c2, p2), g2 = u2[0], h2 = u2[1], f2 = l2 ?? g2?.context?.()?.undoManager;
|
|
538
|
+
let x2 = d2;
|
|
539
|
+
d2 || (x2 = !g2 || g2.disabled(), h2 && !h2.disabled() && (x2 = false));
|
|
540
|
+
const [b2, y2] = O(0), w2 = z((e3, t3) => {
|
|
541
|
+
let o3 = 0 === b2 ? "Cancel" : `${g2.label()} ${b2} Action${1 === b2 ? "" : "s"}`, n3 = false;
|
|
541
542
|
f2 || (n3 = true), n3 || (n3 = r2 ? !f2.hasRedo() && !f2.hasUndo() : !f2.hasRedo());
|
|
542
543
|
const l3 = (e4) => {
|
|
543
544
|
g2.execute(e4);
|
|
544
|
-
}, i3 =
|
|
545
|
-
|
|
545
|
+
}, i3 = N(qe, { sx: { display: "flex", flex: "none", alignItems: "center", justifyContent: "center", padding: n3 ? void 0 : "0 0", minWidth: "180px" }, icon: null, onMouseEnter: () => {
|
|
546
|
+
y2(0);
|
|
546
547
|
}, onMouseDown: (e4) => {
|
|
547
548
|
0 === e4.button && e4.preventDefault();
|
|
548
549
|
}, onMouseUp: (e4) => {
|
|
549
|
-
0 === e4.button && l3(
|
|
550
|
+
0 === e4.button && l3(b2);
|
|
550
551
|
}, onKeyDown: (e4) => {
|
|
551
|
-
e4.isDefaultPrevented() || e4.keyCode !==
|
|
552
|
-
}, children:
|
|
552
|
+
e4.isDefaultPrevented() || e4.keyCode !== Sa.Enter && e4.keyCode !== Sa.Space || l3(b2);
|
|
553
|
+
}, children: N(Z, { component: "div", variant: "caption", sx: { fontSize: "0.875rem", letterSpacing: "0.01071em" }, children: o3 }) });
|
|
553
554
|
if (n3) return i3;
|
|
554
555
|
const s3 = a2 ? f2?.getRedoDescriptions() : f2?.getUndoDescriptions(), d3 = [];
|
|
555
556
|
for (let e4 = 0; e4 < s3.length; e4++) {
|
|
556
557
|
const t4 = s3[e4];
|
|
557
|
-
d3.push(
|
|
558
|
-
|
|
558
|
+
d3.push(N(qe, { sx: { maxWidth: "360px", display: "flex" }, icon: N(Dt, {}), disabled: x2, selected: e4 < b2, onMouseEnter: () => {
|
|
559
|
+
y2(e4 + 1);
|
|
559
560
|
}, onMouseDown: (e5) => {
|
|
560
561
|
0 === e5.button && e5.preventDefault();
|
|
561
562
|
}, onMouseUp: (t5) => {
|
|
562
563
|
0 === t5.button && l3(e4 + 1);
|
|
563
564
|
}, onKeyDown: (t5) => {
|
|
564
|
-
t5.isDefaultPrevented() || t5.keyCode !==
|
|
565
|
-
}, children:
|
|
565
|
+
t5.isDefaultPrevented() || t5.keyCode !== Sa.Enter && t5.keyCode !== Sa.Space || l3(e4 + 1);
|
|
566
|
+
}, children: E(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", alignItems: "center", overflow: "hidden" }, children: [N(Z, { component: "div", children: t4 }), N(Dt, {})] }) }, `action:${e4}`));
|
|
566
567
|
}
|
|
567
568
|
let c3 = null;
|
|
568
569
|
if (!a2 && r2) {
|
|
569
|
-
const o4 = { scope: "undo", commands: t3, variant:
|
|
570
|
-
c3 = [], c3.push(
|
|
570
|
+
const o4 = { scope: "undo", commands: t3, variant: ya.Menuitem, parentFloat: e3.floatReference };
|
|
571
|
+
c3 = [], c3.push(N(Or, { ...o4, quickCommand: "redo", isRedo: true }, "nested:redo")), f2.hasRedo() && f2.hasUndo() && c3.push(N(Se, { orientation: "horizontal" }, "action:redo-div"));
|
|
571
572
|
}
|
|
572
|
-
const m3 =
|
|
573
|
+
const m3 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, onClick: () => {
|
|
573
574
|
e3.closeFloatAll();
|
|
574
575
|
}, onMouseLeave: () => {
|
|
575
|
-
|
|
576
|
-
}, children: [c3,
|
|
577
|
-
return
|
|
578
|
-
}, [g2?.context(), g2?.state(), i2, f2,
|
|
579
|
-
return
|
|
576
|
+
y2(0);
|
|
577
|
+
}, children: [c3, N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: d3 }), N(Se, { orientation: "horizontal" }), i3] });
|
|
578
|
+
return Te({ ...e3, children: m3 });
|
|
579
|
+
}, [g2?.context(), g2?.state(), i2, f2, b2, x2]);
|
|
580
|
+
return N(De, { ref: t2, commands: c2, quickCommand: o2, scope: i2, disabled: x2, label: g2?.label() ?? (a2 ? "Redo" : "Undo"), tooltip: N(A, { children: N("span", { children: `${g2?.label() ?? "No"} last actions.` }) }), createPopupPanel: w2, icon: n2 ?? we(N(a2 ? Ht : Wt, {})), selected: false, ...m2 });
|
|
580
581
|
})), Vr = i.getFontList(), Gr = /* @__PURE__ */ new Map();
|
|
581
582
|
for (let e2 = 0; e2 < Vr.length; e2++) Gr.set(Vr[e2].fontRef.getFamily(), Vr[e2]);
|
|
582
|
-
const Ur =
|
|
583
|
+
const Ur = L(H((e2, t2) => {
|
|
583
584
|
const { command: o2, commandHook: n2, sx: a2, disabled: l2 = false, parentFloat: i2, icon: s2, label: d2, ...c2 } = e2;
|
|
584
|
-
|
|
585
|
-
const m2 = o2?.state(), p2 =
|
|
585
|
+
Ca(o2);
|
|
586
|
+
const m2 = o2?.state(), p2 = Ha(), u2 = W(() => `${r.getSharedMeasurer()("Times New Roman", Math.round(p2.typography.fontSize), p2.typography.fontFamily).width}px`, [p2]), g2 = z((e3) => {
|
|
586
587
|
const t3 = (e4) => {
|
|
587
588
|
o2?.execute(e4, n2);
|
|
588
589
|
}, a3 = [];
|
|
@@ -591,131 +592,131 @@ const Ur = k(S((e2, t2) => {
|
|
|
591
592
|
const r2 = [];
|
|
592
593
|
for (let e4 = 0; e4 < a3.length; e4++) {
|
|
593
594
|
const n3 = a3[e4].key === m2;
|
|
594
|
-
r2.push(
|
|
595
|
+
r2.push(N(qe, { sx: { display: "flex", paddingTop: "4px", paddingBottom: "4px" }, selected: n3, disabled: l2 || !o2 || o2.disabled(), icon: n3 ? N(ut, {}) : void 0, onMouseUp: (o3) => {
|
|
595
596
|
0 === o3.button && t3(a3[e4].key);
|
|
596
597
|
}, onMouseDown: (e5) => {
|
|
597
598
|
0 === e5.button && e5.preventDefault();
|
|
598
599
|
}, onKeyDown: (o3) => {
|
|
599
|
-
o3.keyCode !==
|
|
600
|
-
}, children:
|
|
600
|
+
o3.keyCode !== Sa.Enter && o3.keyCode !== Sa.Space || t3(a3[e4].key);
|
|
601
|
+
}, children: N(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: N(Z, { component: "div", sx: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", fontFamily: () => a3[e4]?.key }, children: a3[e4].description }) }) }, e4 + "" + a3[e4].key));
|
|
601
602
|
}
|
|
602
|
-
const i3 =
|
|
603
|
-
return
|
|
603
|
+
const i3 = N(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%" }, ...c2, children: N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: r2 }) });
|
|
604
|
+
return Te({ ...e3, children: i3 });
|
|
604
605
|
}, [l2, o2?.state()]);
|
|
605
|
-
return
|
|
606
|
-
})), jr =
|
|
607
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
606
|
+
return N(Ue, { ref: t2, sx: { ...a2 }, outlined: true, disabled: l2, parentFloat: i2, createPopupPanel: g2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: o2?.label(), description: o2?.description(), disabled: t3, children: e3 }), icon: N(X, { sx: { display: "flex", paddingLeft: "4px", paddingRight: "4px", fontSize: (e3) => `${Math.round(e3.typography.fontSize)}px`, fontFamily: (e3) => e3.typography.fontFamily, color: (e3) => e3.palette.text.secondary, width: u2 }, children: N(X, { sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "pre" }, children: m2 }) }), ...c2 });
|
|
607
|
+
})), jr = L(H((e2, t2) => {
|
|
608
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["formatStrikeThroughToggle", "formatSuperscriptToggle", "formatSubscriptToggle"]), s2 = W(() => {
|
|
608
609
|
for (let e3 = 0; e3 < i2.length; e3++) if (i2[e3]?.state()) return i2[e3].key();
|
|
609
610
|
return i2[0]?.key();
|
|
610
|
-
}, [i2]), d2 =
|
|
611
|
+
}, [i2]), d2 = W(() => {
|
|
611
612
|
const e3 = /* @__PURE__ */ new Map();
|
|
612
|
-
return e3.set("formatStrikeThroughToggle",
|
|
613
|
-
}, []), c2 =
|
|
614
|
-
const o3 = { variant:
|
|
615
|
-
return
|
|
613
|
+
return e3.set("formatStrikeThroughToggle", we(N(zt, {}))), e3.set("formatSuperscriptToggle", we(N($t, {}))), e3.set("formatSubscriptToggle", we(N(Ot, {}))), e3;
|
|
614
|
+
}, []), c2 = z((e3, t3) => {
|
|
615
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "textEffects", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("formatStrikeThroughToggle"), icon: d2.get("formatStrikeThroughToggle") }), N(ke, { ...o3, command: t3.getCommand("formatSuperscriptToggle"), icon: d2.get("formatSuperscriptToggle") }), N(ke, { ...o3, command: t3.getCommand("formatSubscriptToggle"), icon: d2.get("formatSubscriptToggle") })] });
|
|
616
|
+
return Te({ ...e3, children: a3 });
|
|
616
617
|
}, [r2, n2, a2]);
|
|
617
|
-
return
|
|
618
|
-
})), _r =
|
|
619
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
618
|
+
return N(De, { ref: t2, quickCommand: s2, commands: o2, commandHook: n2, createPopupPanel: c2, label: "Text Effects", tooltip: "Style your text to differentiate it.", icon: d2.get(s2) ?? we(N(zt, {})), ...l2 });
|
|
619
|
+
})), _r = L(H((e2, t2) => {
|
|
620
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["formatUnderlinedToggle", "formatUnderlinedDoubleToggle", "formatUnderlinedAccountingToggle", "formatUnderlinedAccountingDoubleToggle"]), s2 = W(() => {
|
|
620
621
|
for (let e3 = 0; e3 < i2.length; e3++) if (i2[e3]?.state()) return i2[e3].key();
|
|
621
622
|
return i2[0]?.key();
|
|
622
|
-
}, [i2]), d2 =
|
|
623
|
+
}, [i2]), d2 = W(() => {
|
|
623
624
|
const e3 = /* @__PURE__ */ new Map();
|
|
624
|
-
return e3.set("formatUnderlinedToggle",
|
|
625
|
-
}, []), c2 =
|
|
626
|
-
const o3 = { variant:
|
|
627
|
-
return
|
|
625
|
+
return e3.set("formatUnderlinedToggle", we(N(Vt, {}))), e3.set("formatUnderlinedDoubleToggle", we(N(Gt, {}))), e3.set("formatUnderlinedAccountingToggle", we(N(Ut, {}))), e3.set("formatUnderlinedAccountingDoubleToggle", we(N(jt, {}))), e3;
|
|
626
|
+
}, []), c2 = z((e3, t3) => {
|
|
627
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "underline", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("formatUnderlinedToggle"), icon: we(N(Vt, {})) }), N(ke, { ...o3, command: t3.getCommand("formatUnderlinedDoubleToggle"), icon: we(N(Gt, {})) }), N(ke, { ...o3, command: t3.getCommand("formatUnderlinedAccountingToggle"), commandHook: n2, icon: we(N(Ut, {})) }), N(ke, { ...o3, command: t3.getCommand("formatUnderlinedAccountingDoubleToggle"), icon: we(N(jt, {})) })] });
|
|
628
|
+
return Te({ ...e3, children: a3 });
|
|
628
629
|
}, [r2, n2, a2]);
|
|
629
|
-
return
|
|
630
|
-
})), qr =
|
|
631
|
-
const { command: o2, commands: n2, commandHook: a2, scope: r2, includePasteAllInPopup: l2 = true, disabled: i2 = false, ...s2 } = e2, d2 =
|
|
632
|
-
const o3 = { variant:
|
|
633
|
-
return l2 && (n3.push(
|
|
630
|
+
return N(De, { ref: t2, quickCommand: s2, commands: o2, commandHook: n2, label: "Underline", tooltip: "All underline stylings.", createPopupPanel: c2, icon: d2.get(s2) ?? we(N(Vt, {})), ...l2 });
|
|
631
|
+
})), qr = L(H((e2, t2) => {
|
|
632
|
+
const { command: o2, commands: n2, commandHook: a2, scope: r2, includePasteAllInPopup: l2 = true, disabled: i2 = false, ...s2 } = e2, d2 = wa((e3, t3) => {
|
|
633
|
+
const o3 = { variant: ya.Menuitem, commandHook: a2, scope: "paste", disabled: i2 }, n3 = [];
|
|
634
|
+
return l2 && (n3.push(j(ke, { ...o3, command: t3.getCommand("paste"), key: "paste", icon: N(_t, {}) })), n3.push(N(Se, { orientation: "horizontal" }, "paste-div"))), n3.push(j(ke, { ...o3, command: t3.getCommand("pasteValues"), key: "pasteValues", icon: we(N(qt, {})) })), n3.push(j(ke, { ...o3, command: t3.getCommand("pasteFormats"), key: "pasteFormats", icon: we(N(Kt, {})) })), n3.push(j(ke, { ...o3, command: t3.getCommand("pasteFormulas"), key: "pasteFormulas", icon: we(N(Xt, {})) })), n3.push(j(ke, { ...o3, command: t3.getCommand("pasteTranspose"), key: "pasteTranspose", icon: we(N(Zt, {})) })), n3.push(j(ke, { ...o3, command: t3.getCommand("pasteLinks"), key: "pasteLinks", icon: we(N(Jt, {})) })), Te({ ...e3, children: n3 });
|
|
634
635
|
}, [i2, a2, r2, l2]);
|
|
635
|
-
return
|
|
636
|
-
})), Kr =
|
|
637
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, parentFloat: l2, ...i2 } = e2, s2 =
|
|
638
|
-
const o3 = { variant:
|
|
639
|
-
return
|
|
636
|
+
return N(De, { ref: t2, commands: n2, commandHook: a2, scope: r2, createPopupPanel: d2, label: "Paste", tooltip: "Add content to the clipboard to your document.", quickCommand: "paste", icon: N(_t, {}), ...s2 });
|
|
637
|
+
})), Kr = L(H((e2, t2) => {
|
|
638
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, parentFloat: l2, ...i2 } = e2, s2 = ba(o2, ["sheetViewToggleShowHeadings", "sheetViewToggleShowHeadingColumns", "sheetViewToggleShowHeadingRows"]), d2 = z((e3, t3) => {
|
|
639
|
+
const o3 = { variant: ya.Menuitem, parentFloat: e3.floatReference, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("sheetViewToggleShowHeadings") }), N(ke, { ...o3, command: t3.getCommand("sheetViewToggleShowHeadingsNumeric") }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("sheetViewToggleShowHeadingColumns") }), N(ke, { ...o3, command: t3.getCommand("sheetViewToggleShowHeadingRows") })] });
|
|
640
|
+
return Te({ ...e3, children: l3 });
|
|
640
641
|
}, [r2, n2, a2]);
|
|
641
|
-
return
|
|
642
|
-
})), Xr =
|
|
643
|
-
const { commands: o2, commandHook: n2, scope: a2 = "view", disabled: r2 = false, ...l2 } = e2, i2 =
|
|
644
|
-
const t3 = { variant:
|
|
645
|
-
return
|
|
642
|
+
return N(De, { ref: t2, parentFloat: l2, quickCommand: s2[0]?.key(), commands: o2, commandHook: n2, createPopupPanel: d2, label: "Headings", tooltip: "Configure how the column and rows headings in the sheet are displayed.", icon: N(Ft, { command: s2[0], scope: "view" }), ...i2 });
|
|
643
|
+
})), Xr = L(H((e2, t2) => {
|
|
644
|
+
const { commands: o2, commandHook: n2, scope: a2 = "view", disabled: r2 = false, ...l2 } = e2, i2 = z((e3) => {
|
|
645
|
+
const t3 = { variant: ya.Menuitem, parentFloat: e3.floatReference, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...t3, command: o2.getCommand("workbookViewToggleShowFormulaBar") }), N(ke, { ...t3, command: o2.getCommand("workbookViewToggleShowTabs") }), N(ke, { ...t3, command: o2.getCommand("workbookViewToggleShowStatusBar") }), N(Se, { orientation: "horizontal" }), N(ke, { ...t3, command: o2.getCommand("workbookViewToggleShowHorizontalScrollBar") }), N(ke, { ...t3, command: o2.getCommand("workbookViewToggleShowVerticalScrollBar") })] });
|
|
646
|
+
return Te({ ...e3, children: l3 });
|
|
646
647
|
}, [r2, o2, n2, a2]);
|
|
647
|
-
return
|
|
648
|
-
})), Zr =
|
|
649
|
-
const { value: o2, cellStyle: n2, styles: a2, createTemporaryCell: r2, bodyStyle: l2, sx: i2, borderProps: s2, disabled: c2, ...m2 } = e2, p2 =
|
|
650
|
-
return
|
|
651
|
-
})), Jr =
|
|
652
|
-
const { styles: t2, namedStyle: o2, selectedNamed: n2, hasContextMenu: a2 = true, bodyStyle: r2, onSelectNamed: l2, createTemporaryCell: i2, parentFloat: d2, commands: c2, disabled: m2, commandHook: p2, ...u2 } = e2, g2 =
|
|
653
|
-
const t3 = { variant:
|
|
654
|
-
return
|
|
648
|
+
return N(De, { ref: t2, commands: o2, disabled: r2, commandHook: n2, scope: a2, label: "Workbook View", tooltip: "Options to configure how the workbook is displayed.", createPopupPanel: i2, icon: N(Ft, { icon: null, label: "Workbook View" }), ...l2 });
|
|
649
|
+
})), Zr = L(H((e2, t2) => {
|
|
650
|
+
const { value: o2, cellStyle: n2, styles: a2, createTemporaryCell: r2, bodyStyle: l2, sx: i2, borderProps: s2, disabled: c2, ...m2 } = e2, p2 = W(() => r2({ value: o2, style: n2 }), [o2, n2, r2]), u2 = W(() => p2.getStyle(), [p2, l2]), g2 = W(() => u2.getFill().toCSS(l2?.darkMode ?? false), [u2]), h2 = u2.getInsets(), f2 = u2.getFont(), x2 = z(() => u2.getBorder(), [u2]);
|
|
651
|
+
return N(X, { ref: t2, sx: { width: "100px", textOverflow: "ellipsis", display: "flex", alignItems: "stretch", background: l2?.fill, filter: c2 ? "grayscale(0.4) opacity(0.8);" : "none", "& .fill": { flex: "1 1 100%", overflow: "hidden", ...g2 }, "& .text": { flex: "1 1 100%", ...f2.toCSS(l2?.darkMode ?? false, 1), boxSizing: "border-box", padding: `${h2.top}px ${h2.right}px ${h2.bottom}px ${h2.left}px`, margin: "0px", outline: "none", resize: "none", overflow: "hidden", textOverflow: "ellipsis", verticalAlign: "baseline", textDecoration: f2.toCSS().textDecoration, textAlign: d.toCSSHorizontalTextAlign(p2.getRenderHorizontalAlignment()), background: "transparent", maxHeight: "100%", whiteSpace: "pre", wordWrap: "break-word" }, ...i2 }, ...m2, children: N(b, { getBorderAt: x2, darkMode: l2?.darkMode ?? false, rowCount: 1, columnCount: 1, style: { display: "flex", flex: "1 1 100%", width: "100%", maxWidth: "100%", justifyContent: "start", alignItems: "stretch", ...s2?.style }, ...s2, children: N(X, { className: "fill", sx: { paddingLeft: "4px", paddingRight: "4px", marginLeft: "-1px", marginTop: "-1px", marginRight: "-1px", marginBottom: "-1px", overflow: "hidden", display: "flex", alignItems: "center" }, children: N(X, { className: "text", children: o2 }) }) }) });
|
|
652
|
+
})), Jr = L((e2) => {
|
|
653
|
+
const { styles: t2, namedStyle: o2, selectedNamed: n2, hasContextMenu: a2 = true, bodyStyle: r2, onSelectNamed: l2, createTemporaryCell: i2, parentFloat: d2, commands: c2, disabled: m2, commandHook: p2, ...u2 } = e2, g2 = z((e3) => {
|
|
654
|
+
const t3 = { variant: ya.Menuitem, commandHook: p2, context: "cellStyle" }, n3 = E(A, { children: [N(ke, { ...t3, sx: { fontWeight: 550 }, command: c2.getCommand("formatCellStyle"), commandState: o2, disabled: m2, icon: we(N(Qt, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...t3, command: c2.getCommand("modifyCellStyle"), commandState: { named: o2 } }), N(ke, { ...t3, command: c2.getCommand("deleteCellStyle"), commandState: o2, disabled: m2 || o2?.getName() === s.BuiltInName.Normal })] });
|
|
655
|
+
return Te({ ...e3, children: N(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: n3 }) }) });
|
|
655
656
|
}, []), h2 = o2?.getName() === n2?.getName();
|
|
656
|
-
let f2 =
|
|
657
|
+
let f2 = N(Ye, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (e3) => `solid ${h2 ? e3.palette.primary.dark : "transparent"} 1px` }, tooltipProps: { label: o2.getName(), placement: "bottom-start" }, disabled: m2, icon: null, onClick: () => {
|
|
657
658
|
l2?.(o2);
|
|
658
|
-
}, ...u2, children:
|
|
659
|
-
return a2 && (f2 =
|
|
660
|
-
}), Yr =
|
|
659
|
+
}, ...u2, children: N(Zr, { value: o2.getName(), cellStyle: { named: o2.getName() }, styles: t2, createTemporaryCell: i2, bodyStyle: r2 }) }, o2.getName());
|
|
660
|
+
return a2 && (f2 = N(to, { label: o2.getName(), parentFloat: d2, createPopupPanel: g2, children: f2 })), f2;
|
|
661
|
+
}), Yr = L(H((e2, t2) => {
|
|
661
662
|
const { commands: o2, command: n2, commandHook: a2, selectedNamed: l2, onSelectNamed: i2, disabled: d2 = false, bodyStyle: c2, usePreviewIcon: m2 = true, ...p2 } = e2;
|
|
662
|
-
|
|
663
|
-
const u2 = n2?.context(), g2 = u2?.styles, h2 = l2 ?? u2?.named(), f2 = c2 ?? u2?.bodyStyle(),
|
|
663
|
+
Ca(n2);
|
|
664
|
+
const u2 = n2?.context(), g2 = u2?.styles, h2 = l2 ?? u2?.named(), f2 = c2 ?? u2?.bodyStyle(), x2 = wa((e3) => {
|
|
664
665
|
i2?.(e3), n2?.execute(e3, a2);
|
|
665
|
-
}, [n2, i2, a2]),
|
|
666
|
-
const n3 = { onSelectNamed:
|
|
666
|
+
}, [n2, i2, a2]), b2 = z((e3, t3) => {
|
|
667
|
+
const n3 = { onSelectNamed: x2, styles: g2(), parentFloat: e3.floatReference }, r2 = g2().getCustomNamed(), l3 = /* @__PURE__ */ new Map(), i3 = [];
|
|
667
668
|
for (let e4 = 0; e4 < r2.length; e4++) l3.set(r2[e4].getName(), r2[e4]), null === g2().getNamed(r2[e4].getName()).getBuiltInID() && i3.push(r2[e4].getName());
|
|
668
669
|
const c3 = (e4) => {
|
|
669
670
|
let t4 = l3.get(e4);
|
|
670
|
-
return t4 || (t4 = g2().getNamed(e4)), !t4 || t4.isHidden() ? null :
|
|
671
|
+
return t4 || (t4 = g2().getNamed(e4)), !t4 || t4.isHidden() ? null : N(Jr, { namedStyle: t4, selectedNamed: h2, bodyStyle: u2.bodyStyle(), createTemporaryCell: u2.createTemporaryCell, commands: o2, commandHook: a2, ...n3 }, e4);
|
|
671
672
|
}, m3 = (e4, t4, o3 = true) => {
|
|
672
673
|
const n4 = [];
|
|
673
674
|
for (let e5 = 0; e5 < t4.length; e5++) {
|
|
674
675
|
const o4 = c3(t4[e5]);
|
|
675
676
|
o4 && n4.push(o4);
|
|
676
677
|
}
|
|
677
|
-
return 0 === n4.length ? null :
|
|
678
|
+
return 0 === n4.length ? null : E(X, { children: [o3 ? N(Se, { orientation: "horizontal" }) : null, N(eo, { children: e4 }, e4 + "-header"), N(X, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", width: "646px", maxWidth: "100%" }, children: n4 }, e4 + "-presets")] }, e4);
|
|
678
679
|
}, p3 = (e4, t4) => {
|
|
679
680
|
const o3 = [];
|
|
680
681
|
for (let e5 = 0; e5 < t4.length; e5++) {
|
|
681
682
|
const n4 = c3(t4[e5]);
|
|
682
683
|
n4 && o3.push(n4);
|
|
683
684
|
}
|
|
684
|
-
return 0 === o3.length ? null :
|
|
685
|
+
return 0 === o3.length ? null : N(X, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", flexDirection: "column", flex: "0 0 0%" }, children: o3 }, e4 + "-presets");
|
|
685
686
|
}, f3 = [];
|
|
686
687
|
f3.push(m3("Custom", i3, false)), f3.push(m3("Good, Bad and Neutral", [s.BuiltInName.Normal, s.BuiltInName.Bad, s.BuiltInName.Good, s.BuiltInName.Neutral], i3.length > 0)), f3.push(m3("Data and Model", [s.BuiltInName.Calculation, s.BuiltInName.CheckCell, s.BuiltInName.ExplanatoryText, s.BuiltInName.FollowedHyperlink, s.BuiltInName.Hyperlink, s.BuiltInName.Input, s.BuiltInName.LinkedCell, s.BuiltInName.Note, s.BuiltInName.Output, s.BuiltInName.WarningText])), f3.push(m3("Titles and Headings", [s.BuiltInName.Heading1, s.BuiltInName.Heading2, s.BuiltInName.Heading3, s.BuiltInName.Heading4, s.BuiltInName.Title, s.BuiltInName.Total]));
|
|
687
|
-
let
|
|
688
|
-
var
|
|
689
|
-
return
|
|
690
|
-
}, sx: { display: "flex", flexDirection: "column", paddingTop: "6px", paddingBottom: "0px", paddingLeft: "16px", paddingRight: "16px" }, children: f3 }),
|
|
691
|
-
}, [h2, g2?.().getTheme(), f2]),
|
|
688
|
+
let b3 = [];
|
|
689
|
+
var y3, w3;
|
|
690
|
+
return b3.push(p3("Accent 1", [s.BuiltInName.Accent1_20, s.BuiltInName.Accent1_40, s.BuiltInName.Accent1_60, s.BuiltInName.Accent1])), b3.push(p3("Accent 2", [s.BuiltInName.Accent2_20, s.BuiltInName.Accent2_40, s.BuiltInName.Accent2_60, s.BuiltInName.Accent2])), b3.push(p3("Accent 3", [s.BuiltInName.Accent3_20, s.BuiltInName.Accent3_40, s.BuiltInName.Accent3_60, s.BuiltInName.Accent3])), b3.push(p3("Accent 4", [s.BuiltInName.Accent4_20, s.BuiltInName.Accent4_40, s.BuiltInName.Accent4_60, s.BuiltInName.Accent4])), b3.push(p3("Accent 5", [s.BuiltInName.Accent5_20, s.BuiltInName.Accent5_40, s.BuiltInName.Accent5_60, s.BuiltInName.Accent5])), b3.push(p3("Accent 6", [s.BuiltInName.Accent6_20, s.BuiltInName.Accent6_40, s.BuiltInName.Accent6_60, s.BuiltInName.Accent6])), f3.push((y3 = "Themed Cell Styles", w3 = b3, E(X, { children: [N(Se, { orientation: "horizontal" }), N(eo, { children: y3 }, y3 + "-header"), N(X, { sx: { display: "flex", gap: "2px", flexWrap: "wrap", alignItems: "start", flexDirection: "row" }, children: w3 }, y3 + "-presets")] }, y3))), f3.push(m3("Number Format", [s.BuiltInName.Comma, s.BuiltInName.Comma0, s.BuiltInName.Currency, s.BuiltInName.Currency0, s.BuiltInName.Percent])), E(X, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", paddingTop: (e4) => `${e4.shape.borderRadius}px`, paddingBottom: (e4) => `${e4.shape.borderRadius}px` }, children: [N(X, { onContextMenu: () => {
|
|
691
|
+
}, sx: { display: "flex", flexDirection: "column", paddingTop: "6px", paddingBottom: "0px", paddingLeft: "16px", paddingRight: "16px" }, children: f3 }), N(Se, { orientation: "horizontal" }), N(ke, { variant: ya.Menuitem, commandState: h2, command: t3.getCommand("newCellStyle"), context: "styles", commandHook: a2, disabled: d2, icon: we(N(Yt, {})) })] });
|
|
692
|
+
}, [h2, g2?.().getTheme(), f2]), y2 = wa((e3) => {
|
|
692
693
|
const t3 = 18 / r.getDeviceScale(), o3 = u2?.createTemporaryCell(e3);
|
|
693
694
|
return o3.getStyle().getFont().getSize() <= t3 ? o3 : o3.createTemporaryCell({ style: { font: { size: t3 } } });
|
|
694
|
-
}, [u2?.createTemporaryCell]),
|
|
695
|
-
return
|
|
696
|
-
})), Qr = "_sheetxl-
|
|
697
|
-
const { styles: o2, table: n2, tableStyle: a2 = n2?.getStyle() ?? o2.getDefaultTableStyle(), bodyStyle: r2, sx: l2, disabled: i2, className: s2, forceThinBorder: d2, cellHeight: m2 = el, isLive: p2 = false, ...u2 } = e2, g2 = Math.ceil(1.3 * m2), [h2, f2] =
|
|
698
|
-
|
|
695
|
+
}, [u2?.createTemporaryCell]), w2 = d2 || !n2 || n2.disabled(), k2 = W(() => u2 && m2 ? N(Zr, { value: h2?.getName() ?? "Custom", cellStyle: h2 ? { named: h2.getName() } : void 0, styles: u2.styles(), createTemporaryCell: y2, bodyStyle: u2.bodyStyle(), className: "outline-hover", disabled: w2, sx: { maxHeight: "24px", height: "24px", marginRight: "2px", outline: (e3) => `1px solid ${e3.palette.action.hover}` }, borderProps: {} }) : we(N(Qt, {})), [h2, f2, w2]);
|
|
696
|
+
return N(De, { ref: t2, createPopupPanel: b2, outlined: m2, commands: o2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: n2?.label(), description: n2?.description(), disabled: t3, children: e3 }), selected: false, disabled: w2, label: n2?.label(), icon: k2, ...p2 });
|
|
697
|
+
})), Qr = "_sheetxl-reset_11z3j_1", el = 10, tl = L(H((e2, t2) => {
|
|
698
|
+
const { styles: o2, table: n2, tableStyle: a2 = n2?.getStyle() ?? o2.getDefaultTableStyle(), bodyStyle: r2, sx: l2, disabled: i2, className: s2, forceThinBorder: d2, cellHeight: m2 = el, isLive: p2 = false, ...u2 } = e2, g2 = Math.ceil(1.3 * m2), [h2, f2] = _((e3) => e3 + 1, 0);
|
|
699
|
+
V(() => {
|
|
699
700
|
if (p2 && n2) return n2.addListeners({ onAnyChange: () => {
|
|
700
701
|
f2();
|
|
701
702
|
} });
|
|
702
703
|
}, [n2, p2]);
|
|
703
|
-
const
|
|
704
|
+
const x2 = W(() => {
|
|
704
705
|
let e3 = n2?.toJSON() ?? {};
|
|
705
706
|
const t3 = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
706
707
|
return e3 && (e3.styleOptions = { ...e3.styleOptions, name: a2.getName() }), e3.ref = t3, new c({ initialAnchor: t3, json: e3, styles: o2 });
|
|
707
|
-
}, [h2, n2, a2, o2]), y2 =
|
|
708
|
+
}, [h2, n2, a2, o2]), y2 = W(() => {
|
|
708
709
|
const e3 = [];
|
|
709
710
|
for (let t3 = 0; t3 < 5; t3++) for (let o3 = 0; o3 < 5; o3++) {
|
|
710
|
-
const n3 =
|
|
711
|
+
const n3 = x2.getStyleAt({ colIndex: o3, rowIndex: t3 });
|
|
711
712
|
e3.push(n3);
|
|
712
713
|
}
|
|
713
714
|
return e3;
|
|
714
|
-
}, [
|
|
715
|
+
}, [x2]), w2 = W(() => {
|
|
715
716
|
const e3 = (e4, t4, o3) => {
|
|
716
717
|
let n3 = o3.getFill().toCSS(r2?.darkMode ?? false);
|
|
717
718
|
const a3 = g2 - (t4 < 4 ? 1 : 0), l3 = m2 - (e4 < 4 ? 1 : 0), i3 = o3.getFont().getFill().toCSS(r2?.darkMode ?? false);
|
|
718
|
-
return n3 = { ...n3, position: "absolute", boxSizing: "border-box", left: t4 * (g2 - 1), top: e4 * (m2 - 1), width: a3, height: l3 },
|
|
719
|
+
return n3 = { ...n3, position: "absolute", boxSizing: "border-box", left: t4 * (g2 - 1), top: e4 * (m2 - 1), width: a3, height: l3 }, N("td", { className: `table-style-fill ${e4}-${t4}`, style: n3, children: N("div", { className: `table-style-text ${e4}-${t4}`, style: { position: "absolute", boxSizing: "border-box", width: "6px", left: (a3 - 6) / 2, top: (l3 - 1) / 2, borderTop: `1px solid ${i3}` } }) }, `${e4}-${t4}`);
|
|
719
720
|
}, t3 = [];
|
|
720
721
|
for (let o3 = 0; o3 < 5; o3++) {
|
|
721
722
|
const n3 = [];
|
|
@@ -723,25 +724,25 @@ const Ur = k(S((e2, t2) => {
|
|
|
723
724
|
const a3 = y2[5 * o3 + t4];
|
|
724
725
|
n3.push(e3(o3, t4, a3));
|
|
725
726
|
}
|
|
726
|
-
t3.push(
|
|
727
|
+
t3.push(N("tr", { children: n3 }, o3));
|
|
727
728
|
}
|
|
728
729
|
return t3;
|
|
729
|
-
}, [
|
|
730
|
-
return
|
|
730
|
+
}, [x2, a2, r2]), k2 = z((e3, t3) => y2[t3].getBorder() ?? null, [y2]);
|
|
731
|
+
return N(X, { ref: t2, className: "table-format-preview", sx: { background: r2?.fill, filter: i2 ? "grayscale(0.4) opacity(0.8);" : "none", "& .styled-element": { position: "absolute" }, ...l2 }, ...u2, children: N(b, { getBorderAt: k2, rowCount: 5, columnCount: 5, forceThinBorder: d2, width: 5 * (g2 - 1) + 1, height: 5 * (m2 - 1) + 1, darkMode: r2?.darkMode ?? false, style: { pointerEvents: "none" }, children: N("table", { className: Yn(s2, "sheetxl-table-preview", Qr), style: { borderCollapse: "collapse", width: 5 * (g2 - 1) + 1, height: 5 * (m2 - 1) + 1 }, children: N("tbody", { children: w2 }) }) }) });
|
|
731
732
|
})), ol = (e2, t2, o2, n2, a2) => {
|
|
732
733
|
e2.beginPath(), e2.moveTo(t2 + 0.5, o2 + 0.5), e2.lineTo(n2 + 0.5, a2 + 0.5), e2.stroke();
|
|
733
|
-
}, nl =
|
|
734
|
-
const { table: o2, tableStyle: n2, styles: a2, bodyStyle: r2, disabled: l2, style: i2, className: s2, canvas: d2, ...p2 } = e2, u2 =
|
|
734
|
+
}, nl = L(H((e2, t2) => {
|
|
735
|
+
const { table: o2, tableStyle: n2, styles: a2, bodyStyle: r2, disabled: l2, style: i2, className: s2, canvas: d2, ...p2 } = e2, u2 = W(() => {
|
|
735
736
|
const e3 = o2.toJSON(), t3 = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
736
737
|
return e3.styleOptions = { ...e3.styleOptions, name: n2.getName() }, e3.ref = t3, new c({ initialAnchor: t3, json: e3, styles: a2 });
|
|
737
|
-
}, [o2, n2, a2]), g2 =
|
|
738
|
+
}, [o2, n2, a2]), g2 = W(() => {
|
|
738
739
|
const e3 = [];
|
|
739
740
|
for (let t3 = 0; t3 < 5; t3++) for (let o3 = 0; o3 < 5; o3++) {
|
|
740
741
|
const n3 = u2.getStyleAt({ colIndex: o3, rowIndex: t3 });
|
|
741
742
|
e3.push(n3);
|
|
742
743
|
}
|
|
743
744
|
return e3;
|
|
744
|
-
}, [u2]), h2 =
|
|
745
|
+
}, [u2]), h2 = W(() => {
|
|
745
746
|
let e3 = d2;
|
|
746
747
|
if (d2 || (e3 = document.createElement("canvas")), !e3) return null;
|
|
747
748
|
61 !== e3.width && (e3.width = 61), 46 !== e3.height && (e3.height = 46);
|
|
@@ -774,58 +775,58 @@ const Ur = k(S((e2, t2) => {
|
|
|
774
775
|
}
|
|
775
776
|
return `url(${e3.toDataURL()})`;
|
|
776
777
|
}, [d2, u2, n2, r2]);
|
|
777
|
-
return
|
|
778
|
-
})), al =
|
|
778
|
+
return N("div", { ref: t2, className: Yn("table-style-preview", s2), style: { backgroundImage: h2, width: 61, height: 46, ...i2 }, ...p2 });
|
|
779
|
+
})), al = L(H((e2, t2) => {
|
|
779
780
|
const { styleOptions: o2, onStyleOptionsChange: n2, showHeaderRow: a2, onShowHeaderRowChange: r2, showTotalRow: l2, onShowTotalRowChange: i2, showFilterButton: s2, onShowFilterButtonChange: d2, sx: c2, disabled: m2, ...p2 } = e2;
|
|
780
|
-
return
|
|
781
|
+
return E(X, { sx: { display: "flex", flexDirection: "column", flexWrap: "wrap", userSelect: "none", pt: 1, pb: 1, "& .MuiFormControlLabel-root": { marginLeft: (e3) => `${e3.spacing(2)}`, marginRight: (e3) => `${e3.spacing(2)}` }, "& .MuiCheckbox-root": { padding: (e3) => `${e3.spacing(0.5)}` }, ...c2 }, ...p2, ref: t2, children: [r2 && N(ne, { control: N(ae, { checked: a2 ?? false, indeterminate: null == a2, onChange: () => r2(!a2), disabled: m2 || null == a2 }), label: "Header Row", labelPlacement: "end" }), i2 && N(ne, { control: N(ae, { checked: l2 ?? false, indeterminate: null == l2, onChange: () => i2(!l2), disabled: m2 || null == l2 }), label: "Total Row", labelPlacement: "end" }), N(ne, { control: N(ae, { checked: o2?.showRowStripes ?? false, indeterminate: !o2, disabled: m2 || !o2, onChange: () => {
|
|
781
782
|
n2?.({ ...o2, showRowStripes: !o2?.showRowStripes });
|
|
782
|
-
} }), label: "Banded Rows", labelPlacement: "end" }),
|
|
783
|
+
} }), label: "Banded Rows", labelPlacement: "end" }), N(ne, { control: N(ae, { checked: o2?.showFirstColumn ?? false, indeterminate: !o2, disabled: m2 || !o2, onChange: () => {
|
|
783
784
|
n2?.({ ...o2, showFirstColumn: !o2?.showFirstColumn });
|
|
784
|
-
} }), label: "First Column", labelPlacement: "end" }),
|
|
785
|
+
} }), label: "First Column", labelPlacement: "end" }), N(ne, { control: N(ae, { checked: o2?.showLastColumn ?? false, indeterminate: !o2, disabled: m2 || !o2, onChange: () => {
|
|
785
786
|
n2?.({ ...o2, showLastColumn: !o2?.showLastColumn });
|
|
786
|
-
} }), label: "Last Column", labelPlacement: "end" }),
|
|
787
|
+
} }), label: "Last Column", labelPlacement: "end" }), N(ne, { control: N(ae, { checked: o2?.showColumnStripes ?? false, indeterminate: !o2, disabled: m2 || !o2, onChange: () => {
|
|
787
788
|
n2?.({ ...o2, showColumnStripes: !o2?.showColumnStripes });
|
|
788
|
-
} }), label: "Banded Columns", labelPlacement: "end" }), d2 &&
|
|
789
|
-
})), rl =
|
|
790
|
-
const { table: t2, tableStyle: o2, selectedTableStyleName: n2, onSelectTableStyleName: a2, styles: r2, hasContextMenu: l2 = true, bodyStyle: i2, parentFloat: s2, commands: d2, disabled: c2, commandHook: m2, useCanvasPreview: p2 = true, canvas: u2, ...g2 } = e2, h2 =
|
|
791
|
-
const t3 = { variant:
|
|
792
|
-
return
|
|
793
|
-
}, [d2]), f2 = o2?.getName() === n2,
|
|
789
|
+
} }), label: "Banded Columns", labelPlacement: "end" }), d2 && N(ne, { control: N(ae, { checked: s2 ?? false, indeterminate: null == s2, disabled: m2 || !o2 || null == s2, onChange: () => d2(!s2) }), label: "Filter Button", labelPlacement: "end" })] });
|
|
790
|
+
})), rl = L((e2) => {
|
|
791
|
+
const { table: t2, tableStyle: o2, selectedTableStyleName: n2, onSelectTableStyleName: a2, styles: r2, hasContextMenu: l2 = true, bodyStyle: i2, parentFloat: s2, commands: d2, disabled: c2, commandHook: m2, useCanvasPreview: p2 = true, canvas: u2, ...g2 } = e2, h2 = z((e3) => {
|
|
792
|
+
const t3 = { variant: ya.Menuitem, commandHook: m2, context: "table" }, n3 = E(A, { children: [N(ke, { ...t3, command: d2.getCommand("formatTableStyleClearCellStyles"), commandState: o2, disabled: c2, icon: we(N(Qt, {})) }), N(ke, { ...t3, sx: { fontWeight: 550 }, command: d2.getCommand("formatTableStyle"), commandState: { name: o2.getName() }, disabled: c2, icon: we(N(Qt, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...t3, command: d2.getCommand("setDefaultTableStyle"), commandState: o2.getName(), disabled: c2 }), N(Se, { orientation: "horizontal" }), N(ke, { ...t3, command: d2.getCommand("deleteTableStyle"), commandState: o2?.getName(), disabled: c2 || !o2 || o2.isBuiltIn() })] });
|
|
793
|
+
return Te({ ...e3, children: N(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: n3 }) }) });
|
|
794
|
+
}, [d2]), f2 = o2?.getName() === n2, x2 = W(() => {
|
|
794
795
|
const e3 = { table: t2, tableStyle: o2, styles: r2, bodyStyle: i2 };
|
|
795
|
-
return p2 ?
|
|
796
|
+
return p2 ? N(nl, { canvas: u2, ...e3 }) : N(tl, { ...e3 });
|
|
796
797
|
}, [t2, o2, r2, i2]);
|
|
797
|
-
let
|
|
798
|
+
let b2 = N(Ye, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (e3) => `solid ${f2 ? e3.palette.primary.dark : "transparent"} 1px` }, tooltipProps: { label: o2.getName() ?? "None", placement: "bottom-start" }, disabled: c2, icon: null, onClick: () => {
|
|
798
799
|
a2?.(o2?.getName());
|
|
799
|
-
}, ...g2, children:
|
|
800
|
-
return l2 && (
|
|
801
|
-
}), ll =
|
|
800
|
+
}, ...g2, children: x2 }, o2.getName());
|
|
801
|
+
return l2 && (b2 = N(to, { label: t2.getStyleOptions().name, parentFloat: s2, createPopupPanel: h2, children: b2 })), b2;
|
|
802
|
+
}), ll = L(H((e2, t2) => {
|
|
802
803
|
const { commands: o2, command: n2, commandHook: a2, selectedTable: r2, onSelectTableStyleName: l2, disabled: i2 = false, bodyStyle: s2, usePreviewIcon: d2 = false, ...m2 } = e2;
|
|
803
|
-
|
|
804
|
+
Ca(n2);
|
|
804
805
|
const p2 = n2?.context(), u2 = p2?.styles, g2 = r2 ?? p2?.table?.();
|
|
805
806
|
let h2 = "insertTable";
|
|
806
807
|
g2 && (h2 = "editTable");
|
|
807
|
-
const f2 =
|
|
808
|
+
const f2 = W(() => ((e3, t3) => {
|
|
808
809
|
const o3 = { rowStart: 0, colStart: 0, rowEnd: 4, colEnd: 4 };
|
|
809
810
|
return new c({ initialAnchor: o3, styles: t3, json: { name: "PreviewTable", ref: o3, description: "PreviewTable", headerRowCount: 1, totalsRowCount: 0, styleOptions: e3 } });
|
|
810
|
-
})(g2?.getStyleOptions(), u2?.()), [u2?.().getDefaultTableStyle(), g2?.getStyleOptions()]),
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
}, [
|
|
814
|
-
const
|
|
811
|
+
})(g2?.getStyleOptions(), u2?.()), [u2?.().getDefaultTableStyle(), g2?.getStyleOptions()]), x2 = g2 ?? f2, [b2, y2] = O(x2);
|
|
812
|
+
V(() => {
|
|
813
|
+
y2(x2);
|
|
814
|
+
}, [x2]);
|
|
815
|
+
const w2 = s2 ?? p2?.bodyStyle(), k2 = wa((e3) => {
|
|
815
816
|
l2?.(e3), n2?.execute({ name: e3 }, a2);
|
|
816
|
-
}, [n2, l2, a2]),
|
|
817
|
-
const o3 = { onSelectTableStyleName:
|
|
818
|
-
|
|
817
|
+
}, [n2, l2, a2]), S2 = U(null), C2 = z((e3, t3) => {
|
|
818
|
+
const o3 = { onSelectTableStyleName: k2, styles: u2(), parentFloat: e3.floatReference };
|
|
819
|
+
S2.current || (S2.current = document.createElement("canvas"));
|
|
819
820
|
const n3 = (e4) => {
|
|
820
821
|
const n4 = u2().getTableStyle(e4);
|
|
821
|
-
return n4 ?
|
|
822
|
+
return n4 ? N(rl, { table: b2, tableStyle: n4, selectedTableStyleName: b2.getStyleOptions().name, bodyStyle: p2.bodyStyle(), commands: t3, commandHook: a2, canvas: S2.current, ...o3 }, e4) : null;
|
|
822
823
|
}, r3 = (e4, t4, o4 = true) => {
|
|
823
824
|
const a3 = [];
|
|
824
825
|
for (let e5 = 0; e5 < t4.length; e5++) {
|
|
825
826
|
const o5 = n3(t4[e5]);
|
|
826
827
|
o5 && a3.push(o5);
|
|
827
828
|
}
|
|
828
|
-
return 0 === a3.length ? null :
|
|
829
|
+
return 0 === a3.length ? null : E(X, { children: [o4 ? N(Se, { orientation: "horizontal" }) : null, N(eo, { children: e4 }, e4 + "-header"), N(X, { sx: { display: "flex", gap: "2px", marginBottom: "6px", flexWrap: "wrap", width: "481px", maxWidth: "100%" }, children: a3 }, e4 + "-presets")] }, e4);
|
|
829
830
|
}, l3 = [], s3 = u2().getCustomTableStyles(), d3 = [];
|
|
830
831
|
if (s3.length > 0) {
|
|
831
832
|
for (let e4 = 0; e4 < s3.length; e4++) s3[e4].isShownInTableStyles() && d3.push(s3[e4].getName());
|
|
@@ -842,136 +843,136 @@ const Ur = k(S((e2, t2) => {
|
|
|
842
843
|
for (let e4 = 0; e4 < 11; e4++) h3.push("TableStyleDark" + (e4 + 1));
|
|
843
844
|
l3.push(r3("Dark", h3));
|
|
844
845
|
let f3 = null;
|
|
845
|
-
return g2 && (f3 =
|
|
846
|
+
return g2 && (f3 = E(A, { children: [N(Se, { orientation: "horizontal" }), N(ke, { variant: ya.Menuitem, command: t3.getCommand("formatTableStyleClearTableStyle"), commandHook: a2, disabled: i2, icon: we(N(wt, {})) })] })), E(X, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", paddingTop: (e4) => `${e4.shape.borderRadius}px`, paddingBottom: (e4) => `${e4.shape.borderRadius}px` }, children: [N(X, { onContextMenu: () => {
|
|
846
847
|
}, sx: { display: "flex", flexDirection: "column", padding: "6px 16px" }, children: l3 }), f3] });
|
|
847
|
-
}, [u2, u2?.().getTheme(),
|
|
848
|
-
if (!p2 || !d2) return
|
|
849
|
-
}, [
|
|
850
|
-
return
|
|
848
|
+
}, [u2, u2?.().getTheme(), w2, b2]), v2 = i2 || !n2 || n2.disabled(), T2 = W(() => {
|
|
849
|
+
if (!p2 || !d2) return we(N(Qt, {}));
|
|
850
|
+
}, [b2, w2, v2]);
|
|
851
|
+
return N(De, { ref: t2, quickCommand: h2, createPopupPanel: C2, commands: o2, label: n2?.label(), commandState: g2, commandHook: a2, selected: null !== g2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: n2?.label(), description: n2?.description(), disabled: t3, children: e3 }), disabled: v2, icon: T2, ...m2 });
|
|
851
852
|
})), il = [];
|
|
852
853
|
il.push(fr("Primary Background", "bg1")), il.push(fr("Primary Text", "tx1")), il.push(fr("Secondary Background", "bg2")), il.push(fr("Secondary Text", "tx2")), il.push(fr("Accent 1", "accent1")), il.push(fr("Accent 2", "accent2")), il.push(fr("Accent 3", "accent3")), il.push(fr("Accent 4", "accent4")), il.push(fr("Accent 5", "accent5")), il.push(fr("Accent 6", "accent6"));
|
|
853
854
|
const sl = (e2) => {
|
|
854
|
-
const { docTheme: t2, onSelectTheme: o2, darkMode: n2, isSelected: a2, outlined: r2, sx: l2, ...i2 } = e2, s2 =
|
|
855
|
+
const { docTheme: t2, onSelectTheme: o2, darkMode: n2, isSelected: a2, outlined: r2, sx: l2, ...i2 } = e2, s2 = Ha(), d2 = W(() => {
|
|
855
856
|
let e3 = [];
|
|
856
857
|
for (let o3 = 0; o3 < il.length; o3++) {
|
|
857
858
|
const a3 = il[o3];
|
|
858
|
-
e3.push(
|
|
859
|
+
e3.push(N(gr, { schemeColorLookup: t2.schemeLookup(), colorDef: a3, darkMode: n2, selectedColor: null }, o3 + "-colorDef"));
|
|
859
860
|
}
|
|
860
|
-
return
|
|
861
|
+
return N(X, { sx: { display: "flex", flexDirection: "row", flex: "none" }, children: N(X, { sx: { display: "flex", boxShadow: (e4) => e4.shadows[2] }, children: e3 }) });
|
|
861
862
|
}, [t2, s2]);
|
|
862
|
-
return
|
|
863
|
-
The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bottom-start", children:
|
|
864
|
-
}, dl =
|
|
865
|
-
const { themes: o2, selectedTheme: n2, onSelectTheme: a2, sx: r2, disabled: l2 = false, darkMode: i2, ...s2 } = e2, d2 =
|
|
863
|
+
return N(Ye, { sx: { borderRadius: "2px", padding: "2px", margin: "0px 0px", display: "flex", border: (e3) => `solid ${a2 ? e3.palette.text.primary : "transparent"} 1px`, "&:hover:not([disabled])": { border: (e3) => `solid ${e3.palette.text.primary} 1px !important` } }, icon: null, ...i2, children: E(X, { sx: { border: (e3) => `solid ${e3.palette.divider} 1px`, minWidth: "200px", borderRadius: "2px", padding: "4px 4px", textAlign: "left", display: "flex", gap: "4px", flexDirection: "column", alignItems: "stretch", color: (e3) => a2 ? e3.palette.text.primary : void 0, "&:hover:not([disabled])": { color: (e3) => e3.palette.text.primary } }, children: [N(X, { sx: {}, children: t2.getName() }), E(X, { sx: { paddingTop: "6px", paddingLeft: "12px", paddingRight: "12px", display: "flex", flexDirection: "column", alignItems: "stretch" }, children: [d2, N(X, { sx: { flex: "1 1 100%", textOverflow: "ellipsis", overflow: "hidden", marginTop: "2px", whiteSpace: "pre", fontFamily: () => t2.getFontScheme().getMajorFont() }, children: N(Oe, { disableInteractive: true, PopperProps: { style: { pointerEvents: "none" }, disablePortal: true, popperOptions: { strategy: "fixed", modifiers: [{ name: "preventOverflow", enabled: true, options: { boundariesElement: "viewport" } }] } }, title: N("div", { style: { textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "pre" }, children: `The font used for the body.
|
|
864
|
+
The heading font is '${t2.getFontScheme().getMajorFont()}'.` }), placement: "bottom-start", children: N("div", { children: t2.getFontScheme().getMinorFont() }) }) })] })] }) });
|
|
865
|
+
}, dl = L(H((e2, t2) => {
|
|
866
|
+
const { themes: o2, selectedTheme: n2, onSelectTheme: a2, sx: r2, disabled: l2 = false, darkMode: i2, ...s2 } = e2, d2 = W(() => {
|
|
866
867
|
const e3 = o2?.getItems({ selected: n2 }) ?? [], t3 = [];
|
|
867
|
-
if (0 === e3.length) return
|
|
868
|
+
if (0 === e3.length) return N(eo, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "6px", paddingBottom: "6px" }, children: "No themes" });
|
|
868
869
|
const r3 = e3.length;
|
|
869
870
|
for (let o3 = 0; o3 < r3; o3++) {
|
|
870
871
|
const r4 = e3[o3], s3 = n2 && r4?.getName() === n2.getName(), d3 = e3[o3 + 1];
|
|
871
|
-
d3 && d3.isCustom() !== r4.isCustom() && t3.push(
|
|
872
|
+
d3 && d3.isCustom() !== r4.isCustom() && t3.push(N(Se, { orientation: "horizontal", sx: { marginBottom: "4px" } }, `divider-${o3}`)), t3.push(N(sl, { docTheme: r4, onSelectTheme: () => a2(r4), isSelected: s3, disabled: l2, darkMode: i2, onMouseDown: (e4) => {
|
|
872
873
|
0 === e4.button && e4.preventDefault();
|
|
873
874
|
}, onMouseUp: (e4) => {
|
|
874
875
|
0 === e4.button && a2(r4);
|
|
875
876
|
}, onKeyDown: (e4) => {
|
|
876
|
-
e4.keyCode !==
|
|
877
|
+
e4.keyCode !== Sa.Enter && e4.keyCode !== Sa.Space || a2(r4);
|
|
877
878
|
} }, r4.getName()));
|
|
878
879
|
}
|
|
879
880
|
return t3;
|
|
880
881
|
}, [n2, a2, i2]);
|
|
881
|
-
return
|
|
882
|
-
})), cl =
|
|
883
|
-
const { themes: o2, selectedTheme: n2, onSelectTheme: a2, icon: r2, tooltip: l2, label: i2, variant: s2 =
|
|
882
|
+
return N(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%" }, ref: t2, ...s2, children: E(X, { sx: { display: "flex", flexDirection: "column", overflow: "hidden" }, children: [N(eo, { sx: { paddingLeft: "16px", paddingRight: "16px", paddingTop: "4px", paddingBottom: "2px" }, children: "Themes" }), N(Se, {}), N(X, { sx: { flex: "1 1 100%", overflow: "auto", padding: "6px 16px" }, children: d2 })] }) });
|
|
883
|
+
})), cl = L(H((e2, t2) => {
|
|
884
|
+
const { themes: o2, selectedTheme: n2, onSelectTheme: a2, icon: r2, tooltip: l2, label: i2, variant: s2 = Ge.Toolbar, darkMode: d2, panelProps: c2, ...m2 } = e2, p2 = r2 || we(N(oo, {})), u2 = { createPopupPanel: z((e3) => {
|
|
884
885
|
const { closeFloatAll: t3 } = e3;
|
|
885
|
-
return
|
|
886
|
-
e4.which ===
|
|
886
|
+
return N(dl, { ...c2, themes: o2, selectedTheme: n2, onSelectTheme: a2, darkMode: d2, onKeyDown: (e4) => {
|
|
887
|
+
e4.which === Sa.Enter && t3();
|
|
887
888
|
} });
|
|
888
889
|
}, [o2, n2, a2, c2, d2]), tooltip: l2 || i2 || "Theme", label: i2, icon: p2, ...m2 };
|
|
889
|
-
return s2 ===
|
|
890
|
-
})), ml =
|
|
890
|
+
return s2 === Ge.Toolbar ? N(Ue, { ref: t2, ...u2 }) : N(je, { ref: t2, ...u2 });
|
|
891
|
+
})), ml = L(H((e2, t2) => {
|
|
891
892
|
const { command: o2, commandHook: n2, selectedTheme: a2, onSelectTheme: r2, disabled: l2 = false, darkMode: i2, label: s2, icon: d2, variant: c2, ...m2 } = e2;
|
|
892
|
-
|
|
893
|
-
const p2 = o2?.context()?.themes, u2 = a2 || o2?.context()?.theme, g2 = i2 ?? o2?.context()?.darkMode, h2 = l2 || o2?.disabled(), f2 =
|
|
893
|
+
Ca(o2);
|
|
894
|
+
const p2 = o2?.context()?.themes, u2 = a2 || o2?.context()?.theme, g2 = i2 ?? o2?.context()?.darkMode, h2 = l2 || o2?.disabled(), f2 = wa((e3) => {
|
|
894
895
|
r2?.(e3), o2?.execute(e3, n2);
|
|
895
|
-
}, [r2, n2]),
|
|
896
|
+
}, [r2, n2]), x2 = z((e3, t3) => {
|
|
896
897
|
const { children: n3, title: a3, ...r3 } = e3;
|
|
897
898
|
let l3 = e3.children;
|
|
898
|
-
return (h2 || t3) && (l3 =
|
|
899
|
+
return (h2 || t3) && (l3 = N("div", { children: l3 })), N(Qe, { command: o2, placement: c2 === ya.Toolbar ? "bottom-start" : "right-start", disabled: h2 || t3, ...r3, children: l3 });
|
|
899
900
|
}, [o2, h2]);
|
|
900
|
-
return
|
|
901
|
-
})), pl =
|
|
902
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 =
|
|
903
|
-
const o3 = { variant:
|
|
904
|
-
return
|
|
901
|
+
return N(cl, { ref: t2, themes: p2, selectedTheme: u2, onSelectTheme: f2, variant: c2 === ya.Menuitem ? Ge.Menuitem : Ge.Toolbar, createTooltip: x2, disabled: h2, darkMode: g2, icon: we(N(oo, {})), ...m2 });
|
|
902
|
+
})), pl = L(H((e2, t2) => {
|
|
903
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = ba(o2, ["themeMode"])[0], s2 = i2?.state(), d2 = null !== i2?.state(), c2 = re("(prefers-color-scheme: dark)"), m2 = "dark" === s2 || null === s2 && c2, p2 = wa((e3, t3) => {
|
|
904
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "appearance", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, command: i2, icon: we(N(m2 ? aa : ra, {})) }), N(ke, { ...o3, command: t3.getCommand("defaultThemeMode"), icon: we(N(c2 ? no : ao, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("enableDarkGrid") }), N(ke, { ...o3, command: t3.getCommand("enableDarkImages") })] });
|
|
905
|
+
return Te({ ...e3, children: a3 });
|
|
905
906
|
}, [r2, i2, n2, a2, c2, s2, d2]);
|
|
906
|
-
return
|
|
907
|
+
return N(De, { ref: t2, quickCommand: "themeMode", commands: o2, commandHook: n2, createPopupPanel: p2, label: "Appearance", tooltip: "Change the light/dark mode to match your viewing preference. This does not affect the view for others.", onQuickClick: () => {
|
|
907
908
|
i2?.execute(m2 ? "light" : "dark", n2);
|
|
908
|
-
}, selected: d2, icon:
|
|
909
|
-
})), ul =
|
|
910
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, sx: l2, ...i2 } = e2, s2 =
|
|
911
|
-
const o3 = { variant:
|
|
909
|
+
}, selected: d2, icon: we(N(m2 ? aa : ra, {})), ...l2 });
|
|
910
|
+
})), ul = L(H((e2, t2) => {
|
|
911
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, sx: l2, ...i2 } = e2, s2 = z((e3, t3) => {
|
|
912
|
+
const o3 = { variant: ya.Menuitem, scope: "help", commandHook: { ...n2, beforeExecute: (t4, o4) => {
|
|
912
913
|
const a4 = n2?.beforeExecute?.(t4, o4);
|
|
913
914
|
return false !== a4 && e3.floatReference.closeAll();
|
|
914
|
-
} }, disabled: r2 }, a3 =
|
|
915
|
-
return
|
|
915
|
+
} }, disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("showKeyboardShortcuts"), icon: we(N(la, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...o3, command: t3.getCommand("gotoUrlGithub"), icon: we(N(ro, {})) }), N(ke, { ...o3, command: t3.getCommand("gotoUrlDiscord"), icon: we(N(lo, {})) }), N(ke, { ...o3, command: t3.getCommand("gotoUrlDocumentation"), icon: we(N(io, {})) }), N(ke, { ...o3, command: t3.getCommand("gotoUrlIssue"), icon: we(N(so, {})) })] });
|
|
916
|
+
return Te({ ...e3, children: a3 });
|
|
916
917
|
}, [r2, n2]);
|
|
917
|
-
return
|
|
918
|
-
})), gl =
|
|
919
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, preferSingleMenu: l2 = true, showQuickButton: i2 = true, variant: s2 =
|
|
918
|
+
return N(De, { ref: t2, sx: l2, commands: o2, disabled: r2, commandHook: n2, scope: a2, label: "Help", tooltip: "Help, feedback, and keyboard shortcuts.", createPopupPanel: s2, icon: we(N(co, { sx: { transform: "scale(0.75)" } })), ...i2 });
|
|
919
|
+
})), gl = L(H((e2, t2) => {
|
|
920
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, preferSingleMenu: l2 = true, showQuickButton: i2 = true, variant: s2 = ya.Toolbar, ...d2 } = e2, c2 = ba(o2, ["insertImageFromFile", "insertImageFromURL"]), { singleMenuCommand: m2, allDisabled: p2 } = W(() => {
|
|
920
921
|
let e3 = null, t3 = 0;
|
|
921
|
-
for (let o3 = 0; o3 < c2.length; o3++) c2[o3] && !c2[o3]?.disabled() && (l2 && s2 ===
|
|
922
|
+
for (let o3 = 0; o3 < c2.length; o3++) c2[o3] && !c2[o3]?.disabled() && (l2 && s2 === ya.Menuitem && (e3 = 0 === t3 ? c2[o3] : null), t3++);
|
|
922
923
|
return { singleMenuCommand: e3, allDisabled: 0 === t3 };
|
|
923
|
-
}, [c2]), u2 =
|
|
924
|
-
const o3 = { variant:
|
|
925
|
-
return
|
|
924
|
+
}, [c2]), u2 = z((e3, t3) => {
|
|
925
|
+
const o3 = { variant: ya.Menuitem, commandHook: n2, scope: "insertImage", disabled: r2 }, a3 = E(A, { children: [N(ke, { ...o3, command: t3.getCommand("insertImageFromFile"), icon: we(N(mo, {})) }), N(ke, { ...o3, command: t3.getCommand("insertImageFromURL"), icon: we(N(mo, {})) })] });
|
|
926
|
+
return Te({ ...e3, children: a3 });
|
|
926
927
|
}, [r2, n2, a2]);
|
|
927
|
-
return m2 ?
|
|
928
|
-
})), hl =
|
|
929
|
-
const { command: o2, ...n2 } = e2, a2 =
|
|
930
|
-
return
|
|
928
|
+
return m2 ? N(ke, { ref: t2, variant: s2, commandHook: n2, disabled: r2, command: m2, icon: we(N(mo, {})), ...d2 }) : N(De, { ref: t2, variant: s2, quickCommand: "insertImageFromFile", commands: o2, commandHook: n2, scope: a2, disabled: r2 || p2, tooltip: "Insert a picture from the web to complement your data.", createPopupPanel: u2, icon: we(N(mo, {})), ...d2 });
|
|
929
|
+
})), hl = L(H((e2, t2) => {
|
|
930
|
+
const { command: o2, ...n2 } = e2, a2 = va(), [r2, l2] = O(false), [i2, s2] = O("info");
|
|
931
|
+
return V(() => {
|
|
931
932
|
const e3 = a2.getMode();
|
|
932
933
|
l2("copy" === e3?.key || "cut" === e3?.key), s2("cut" === e3?.key ? "warning" : "info");
|
|
933
|
-
}, [a2]),
|
|
934
|
-
})), fl =
|
|
934
|
+
}, [a2]), N(ke, { ref: t2, command: o2, icon: we(N(po, { isWalking: r2, themedType: i2 })), ...n2 });
|
|
935
|
+
})), fl = L(H((e2, t2) => {
|
|
935
936
|
const { ...o2 } = e2;
|
|
936
|
-
return
|
|
937
|
+
return N(uo, { ref: t2, ...o2, popupCommandKeys: ["insertFunctionSum", "insertFunctionAverage", "insertFunctionCount", "insertFunctionMax", "insertFunctionMin", null, "insertFunction"], quickCommand: "insertFunctionSum", popupScope: "insertFunction", label: "Quick Function", tooltip: "More functions.", icon: (e3) => {
|
|
937
938
|
const t3 = e3?.key();
|
|
938
939
|
switch (t3) {
|
|
939
940
|
case "insertFunctionSum":
|
|
940
|
-
return
|
|
941
|
+
return we(N(ho, {}));
|
|
941
942
|
case "insertFunction":
|
|
942
|
-
return
|
|
943
|
+
return we(N(go, {}));
|
|
943
944
|
default:
|
|
944
945
|
return null;
|
|
945
946
|
}
|
|
946
947
|
} });
|
|
947
948
|
}));
|
|
948
949
|
fl.displayName = "InsertFunctionSumCommandPopupButton";
|
|
949
|
-
const xl = new Map([{ key: "financial", label: "Financial", icon:
|
|
950
|
+
const xl = new Map([{ key: "financial", label: "Financial", icon: N(xo, {}) }, { key: "logical", label: "Logical", icon: N(bo, {}) }, { key: "text", label: "Text", icon: N(yo, {}) }, { key: "dateTime", label: "Date & Time", icon: N(wo, {}) }, { key: "lookupReference", label: "Lookup & Reference", icon: N(ko, {}) }, { key: "mathTrig", label: "Math & Trig", icon: N(So, {}) }, { key: "statDist", label: "Statistical", icon: N(Co, {}) }, { key: "engineering", label: "Engineering", icon: N(vo, {}) }, { key: "information", label: "Information", icon: N(To, {}) }, { key: "cube", label: "Cube", icon: N(Do, {}) }, { key: "database", label: "Database", icon: N(Po, {}) }, { key: "web", label: "Web", icon: N(Ro, {}) }, { key: "custom", label: "Custom", icon: N(Mo, {}) }].map((e2) => [e2.key, e2])), bl = L((e2) => {
|
|
950
951
|
const { command: t2, formulaFunction: o2, commandHook: n2, disabled: a2 = false, parentFloat: r2, handleInsert: l2, icon: i2, label: s2, sx: d2, ...c2 } = e2, m2 = new Promise((e3) => {
|
|
951
952
|
o2.getDescriptor().then((t3) => {
|
|
952
953
|
e3(t3.getSummary());
|
|
953
954
|
});
|
|
954
955
|
});
|
|
955
|
-
return
|
|
956
|
+
return N(qe, { sx: { maxWidth: "360px", display: "flex", "*": { lineHeight: "1.2" }, ...d2 }, disabled: a2, tooltipProps: { label: m2, maxWidth: 1e3 }, onMouseDown: (e3) => {
|
|
956
957
|
0 === e3.button && e3.preventDefault();
|
|
957
958
|
}, onMouseUp: (e3) => {
|
|
958
959
|
0 === e3.button && l2(o2);
|
|
959
960
|
}, onKeyDown: (e3) => {
|
|
960
|
-
e3.keyCode ===
|
|
961
|
-
}, ...c2, children:
|
|
962
|
-
}), yl =
|
|
963
|
-
const { category: o2, commands: n2, commandHook: a2, scope: r2, sx: l2, disabled: i2 = false, parentFloat: s2, ...d2 } = e2, c2 =
|
|
961
|
+
e3.keyCode === Sa.Enter || (e3.keyCode, Sa.Space);
|
|
962
|
+
}, ...c2, children: N(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: N(Z, { component: "div", children: o2.getName() }) }) });
|
|
963
|
+
}), yl = L(H((e2, t2) => {
|
|
964
|
+
const { category: o2, commands: n2, commandHook: a2, scope: r2, sx: l2, disabled: i2 = false, parentFloat: s2, ...d2 } = e2, c2 = ba(n2, ["insertFunction"])[0], m2 = z((e3, t3) => {
|
|
964
965
|
const n3 = xl.get(o2);
|
|
965
966
|
if (!n3) return console.warn("invalidate category", o2), null;
|
|
966
|
-
const r3 = { commandHook: a2, ...e3 }, l3 =
|
|
967
|
-
return
|
|
967
|
+
const r3 = { commandHook: a2, ...e3 }, l3 = N(wl, { category: n3.label, ...r3, commands: t3 });
|
|
968
|
+
return Te({ ...e3, children: l3 });
|
|
968
969
|
}, [o2, c2, a2, r2]), p2 = xl.get(o2);
|
|
969
|
-
return
|
|
970
|
+
return N(De, { ref: t2, commands: n2, commandHook: a2, createPopupPanel: m2, label: p2.label, tooltip: "Insert Function", icon: we(xl.get(o2)?.icon ?? N(fo, {})), ...d2 });
|
|
970
971
|
}));
|
|
971
972
|
yl.displayName = "InsertFunctionCommandPopupButton";
|
|
972
|
-
const wl =
|
|
973
|
-
const { commands: o2, category: n2, commandHook: a2, ...r2 } = e2, l2 =
|
|
974
|
-
|
|
973
|
+
const wl = L(H((e2, t2) => {
|
|
974
|
+
const { commands: o2, category: n2, commandHook: a2, ...r2 } = e2, l2 = ba(o2, ["insertFunction"]), [i2, s2] = O([]), [d2, c2] = O(false);
|
|
975
|
+
V(() => {
|
|
975
976
|
(async () => {
|
|
976
977
|
c2(true);
|
|
977
978
|
const e3 = l2[0]?.context(), t3 = await e3.searchByCategory(n2);
|
|
@@ -983,153 +984,153 @@ const wl = k(S((e2, t2) => {
|
|
|
983
984
|
};
|
|
984
985
|
for (let e3 = 0; e3 < m2; e3++) {
|
|
985
986
|
const t3 = i2[e3];
|
|
986
|
-
p2[e3] =
|
|
987
|
+
p2[e3] = N(bl, { command: u2, formulaFunction: t3, handleInsert: g2 }, `formula-${t3.getName()}-${e3}`);
|
|
987
988
|
}
|
|
988
|
-
return
|
|
989
|
-
})), kl =
|
|
990
|
-
const { disabled: o2, style: n2, className: a2, sx: r2, defaultInput: l2, value: i2, formName: s2, formOptions: d2, onChangeInput: c2, onValidate: m2, onKeyDown: p2, ...u2 } = e2, g2 = Va(), h2 = s2 && g2 ? g2.register(s2, d2) : null, [f2,
|
|
991
|
-
|
|
992
|
-
|
|
989
|
+
return Te({ ...r2, children: N(X, { ref: t2, sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: m2 > 0 ? N(A, { children: N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: p2 }) }) : null }) });
|
|
990
|
+
})), kl = L(H((e2, t2) => {
|
|
991
|
+
const { disabled: o2, style: n2, className: a2, sx: r2, defaultInput: l2, value: i2, formName: s2, formOptions: d2, onChangeInput: c2, onValidate: m2, onKeyDown: p2, ...u2 } = e2, g2 = Va(), h2 = s2 && g2 ? g2.register(s2, d2) : null, [f2, x2] = O(""), [b2, y2] = O(""), [w2, k2] = O(i2);
|
|
992
|
+
V(() => {
|
|
993
|
+
k2(i2), y2("");
|
|
993
994
|
}, [i2]);
|
|
994
|
-
const
|
|
995
|
+
const S2 = wa((e3) => {
|
|
995
996
|
let t3 = "";
|
|
996
997
|
try {
|
|
997
|
-
|
|
998
|
+
k2(e3), m2?.(e3), c2?.(e3);
|
|
998
999
|
} catch (e4) {
|
|
999
1000
|
t3 = e4.message ?? "Invalid Name";
|
|
1000
1001
|
}
|
|
1001
|
-
s2 && g2 && (t3 ? g2.setError(s2, { message: t3 }) : g2.clearErrors(s2)),
|
|
1002
|
-
}, [i2, m2, c2]),
|
|
1003
|
-
e3.keyCode ===
|
|
1004
|
-
}, [p2, f2, i2, g2]),
|
|
1005
|
-
|
|
1006
|
-
}, []),
|
|
1007
|
-
|
|
1008
|
-
}, []),
|
|
1009
|
-
|
|
1002
|
+
s2 && g2 && (t3 ? g2.setError(s2, { message: t3 }) : g2.clearErrors(s2)), y2(t3);
|
|
1003
|
+
}, [i2, m2, c2]), C2 = wa(async (e3) => {
|
|
1004
|
+
e3.keyCode === Sa.Escape && f2 !== i2 && (S2(f2), g2?.setValue(s2, f2), g2?.clearErrors(s2), e3.stopPropagation()), p2?.(e3);
|
|
1005
|
+
}, [p2, f2, i2, g2]), v2 = wa((e3) => {
|
|
1006
|
+
x2(e3.target.value ?? "");
|
|
1007
|
+
}, []), T2 = wa((e3) => {
|
|
1008
|
+
x2(""), h2?.onBlur(e3);
|
|
1009
|
+
}, []), D2 = z((e3) => {
|
|
1010
|
+
S2(e3.target.value), h2?.onChange(e3);
|
|
1010
1011
|
}, [h2]);
|
|
1011
|
-
return
|
|
1012
|
+
return N(le, { sx: { paddingTop: (e3) => e3.spacing(1.5), minWidth: 135, width: "100%", ...r2 }, size: "small", ref: t2, className: Yn("named-input", a2), ...u2, children: N(ie, { label: "Name", placeholder: l2, onFocus: v2, onBlur: T2, inputRef: h2?.ref, disabled: o2, error: !!b2, helperText: b2 || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (e3) => e3.spacing(0.5) } }, InputLabelProps: { shrink: true }, InputProps: { inputProps: { className: "autoFocus", name: s2, spellCheck: false, autoComplete: "off", readOnly: o2, sx: { paddingTop: (e3) => e3.spacing(1.25), paddingBottom: (e3) => e3.spacing(0.75), backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})` } } }, value: w2 ?? "", onChange: D2, onKeyDownCapture: C2, onContextMenu: (e3) => {
|
|
1012
1013
|
e3.stopPropagation();
|
|
1013
1014
|
} }) });
|
|
1014
1015
|
}));
|
|
1015
1016
|
kl.displayName = "NamedInput";
|
|
1016
|
-
const Sl = (e2) => null === e2 ? "" : e2.toString(), Cl =
|
|
1017
|
-
const { formName: o2, formOptions: n2, disabled: a2, style: r2, className: l2, sx: i2, onKeyDown: s2, value: d2, onChangeInput: c2, resolvedAddress: m2, ...p2 } = e2, u2 = Va(), g2 = o2 && u2 ? u2.register(o2, n2) : null, [h2, f2] =
|
|
1018
|
-
|
|
1019
|
-
|
|
1017
|
+
const Sl = (e2) => null === e2 ? "" : e2.toString(), Cl = L(H((e2, t2) => {
|
|
1018
|
+
const { formName: o2, formOptions: n2, disabled: a2, style: r2, className: l2, sx: i2, onKeyDown: s2, value: d2, onChangeInput: c2, resolvedAddress: m2, ...p2 } = e2, u2 = Va(), g2 = o2 && u2 ? u2.register(o2, n2) : null, [h2, f2] = O(""), [x2, b2] = O(false), [y2, w2] = O(() => Sl(d2));
|
|
1019
|
+
V(() => {
|
|
1020
|
+
w2(Sl(d2)), f2(""), o2 && u2 && u2.clearErrors(o2), b2(false);
|
|
1020
1021
|
}, [d2]);
|
|
1021
|
-
const
|
|
1022
|
+
const k2 = wa((e3) => {
|
|
1022
1023
|
let t3 = "";
|
|
1023
1024
|
try {
|
|
1024
|
-
|
|
1025
|
+
w2(e3);
|
|
1025
1026
|
const t4 = Sl(d2), o3 = m2(e3);
|
|
1026
1027
|
o3.toString() !== t4 && c2?.(o3);
|
|
1027
1028
|
} catch (e4) {
|
|
1028
1029
|
t3 = "Invalid Range";
|
|
1029
1030
|
}
|
|
1030
|
-
o2 && u2 && (t3 ? u2.setError(o2, { message: t3 }) : u2.clearErrors(o2)), f2(t3),
|
|
1031
|
-
}, [
|
|
1032
|
-
if (
|
|
1031
|
+
o2 && u2 && (t3 ? u2.setError(o2, { message: t3 }) : u2.clearErrors(o2)), f2(t3), b2(true);
|
|
1032
|
+
}, [y2, c2, o2, u2]), S2 = wa(async (e3) => {
|
|
1033
|
+
if (x2 && e3.keyCode === Sa.Escape) {
|
|
1033
1034
|
const t3 = Sl(d2);
|
|
1034
|
-
|
|
1035
|
+
w2(t3), f2(""), b2(false), e3.stopPropagation();
|
|
1035
1036
|
}
|
|
1036
1037
|
s2?.(e3);
|
|
1037
|
-
}, [d2, c2, s2,
|
|
1038
|
+
}, [d2, c2, s2, x2]), C2 = wa((e3) => {
|
|
1038
1039
|
g2?.onBlur(e3);
|
|
1039
|
-
}, [g2]),
|
|
1040
|
-
|
|
1041
|
-
}, [g2]), [
|
|
1042
|
-
|
|
1043
|
-
}, label: "Select Range", icon:
|
|
1044
|
-
return
|
|
1040
|
+
}, [g2]), v2 = z((e3) => {
|
|
1041
|
+
k2(e3.target.value), g2?.onChange(e3);
|
|
1042
|
+
}, [g2]), [T2, D2] = O(false), P2 = W(() => N(se, { tabIndex: -1, sx: { display: "flex", position: "relative", flex: "0" }, position: "end", children: N(Fo, { disabled: true, selected: T2, onSelectToggle: (e3) => {
|
|
1043
|
+
D2(e3);
|
|
1044
|
+
}, label: "Select Range", icon: we(N(Bo, {})) }) }), [T2]);
|
|
1045
|
+
return N(le, { sx: { paddingTop: (e3) => e3.spacing(1.5), minWidth: 135, width: "100%", ...i2 }, size: "small", ref: t2, className: Yn("range-input", l2), ...p2, children: N(ie, { label: "Range", placeholder: "Enter Range", onBlur: C2, disabled: a2, error: !!h2, inputRef: g2?.ref, helperText: h2 || " ", sx: { "& .MuiFormHelperText-root": { marginTop: (e3) => e3.spacing(0.5) } }, InputLabelProps: { shrink: true }, InputProps: { inputProps: { spellCheck: false, autoComplete: "off", readOnly: a2, name: o2, sx: { paddingTop: (e3) => e3.spacing(1.25), paddingBottom: (e3) => e3.spacing(0.75) } }, sx: { backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})` }, endAdornment: P2 }, value: y2 ?? "", onChange: v2, onKeyDownCapture: S2, onContextMenu: (e3) => {
|
|
1045
1046
|
e3.stopPropagation();
|
|
1046
1047
|
} }) });
|
|
1047
1048
|
}));
|
|
1048
1049
|
Cl.displayName = "RangeInput";
|
|
1049
|
-
const vl =
|
|
1050
|
-
const { sheet: o2, className: a2, debounceDelay: l2 = 220, sx: i2, ...s2 } = e2, [d2, c2] =
|
|
1051
|
-
|
|
1050
|
+
const vl = L(H((e2, t2) => {
|
|
1051
|
+
const { sheet: o2, className: a2, debounceDelay: l2 = 220, sx: i2, ...s2 } = e2, [d2, c2] = O(() => o2.getView().getZoomScale()), [m2, p2] = O(null), u2 = U(0);
|
|
1052
|
+
w(o2, { onViewChange: () => {
|
|
1052
1053
|
p2(true), 0 === u2.current && c2(o2.getView().getZoomScale());
|
|
1053
|
-
} }),
|
|
1054
|
+
} }), V(() => {
|
|
1054
1055
|
u2.current = 0, p2(false), c2(o2.getView().getZoomScale());
|
|
1055
|
-
}, [o2]),
|
|
1056
|
+
}, [o2]), V(() => {
|
|
1056
1057
|
0 !== u2.current && n.debounce(() => {
|
|
1057
1058
|
d2 === u2.current && (u2.current = 0, o2.getView().update({ zoomScale: d2 }));
|
|
1058
1059
|
}, l2)();
|
|
1059
1060
|
}, [d2, l2]);
|
|
1060
|
-
const g2 =
|
|
1061
|
+
const g2 = wa((e3) => {
|
|
1061
1062
|
let t3 = e3;
|
|
1062
1063
|
e3 < 100 ? t3 = Math.round(e3 / (10 / 9) + 10) : e3 > 100 && (t3 = Math.round(3 * e3 - 200)), u2.current = t3, p2(true), c2(t3);
|
|
1063
1064
|
}, [o2]), h2 = (e3) => {
|
|
1064
1065
|
let t3 = e3;
|
|
1065
1066
|
return e3 < 100 ? t3 = 10 / 9 * (e3 - 10) : e3 > 100 && (t3 = (e3 + 200) / 3), t3;
|
|
1066
|
-
}, f2 = h2(d2), [
|
|
1067
|
-
const e3 =
|
|
1067
|
+
}, f2 = h2(d2), [x2, b2] = O(null), y2 = U(null), k2 = z(() => {
|
|
1068
|
+
const e3 = x2;
|
|
1068
1069
|
e3 && requestAnimationFrame(() => {
|
|
1069
|
-
|
|
1070
|
+
y2.current?.contains(document.activeElement) && e3.focus();
|
|
1070
1071
|
});
|
|
1071
|
-
}, []),
|
|
1072
|
+
}, []), S2 = Ta(() => {
|
|
1072
1073
|
g2(h2(n.findNextStep(o2.getView().getZoomScale(), false, 10)));
|
|
1073
|
-
}),
|
|
1074
|
-
return
|
|
1075
|
-
e3.relatedTarget && !
|
|
1074
|
+
}), C2 = Ta(() => g2(h2(n.findNextStep(o2.getView().getZoomScale(), true, 10)))), v2 = Ha(), T2 = W(() => `${r.getSharedMeasurer()("100%", Math.round(v2.typography.fontSize), v2.typography.fontFamily).width}px`, [v2]);
|
|
1075
|
+
return E(X, { ref: t2, className: Yn(a2), sx: { padding: "0px 0px", display: "flex", alignItems: "center", color: (e3) => e3.palette.text.secondary, ...i2 }, onFocus: (e3) => {
|
|
1076
|
+
e3.relatedTarget && !x2 && b2(e3.relatedTarget);
|
|
1076
1077
|
}, onBlur: (e3) => {
|
|
1077
|
-
|
|
1078
|
+
x2 && !y2?.current?.contains(e3.relatedTarget) && b2(null);
|
|
1078
1079
|
}, onMouseDown: (e3) => {
|
|
1079
1080
|
0 === e3.button && e3.preventDefault();
|
|
1080
1081
|
}, onMouseUp: (e3) => {
|
|
1081
|
-
0 === e3.button &&
|
|
1082
|
-
}, ...s2, children: [
|
|
1083
|
-
0 !== e3.button ? e3.preventDefault() :
|
|
1084
|
-
}, children:
|
|
1082
|
+
0 === e3.button && k2();
|
|
1083
|
+
}, ...s2, children: [N(Oe, { disableInteractive: true, title: "Zoom Out", children: N(J, { sx: { padding: "0", "&:hover:not([disabled])": { color: (e3) => e3.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (e3) => {
|
|
1084
|
+
0 !== e3.button ? e3.preventDefault() : S2(e3);
|
|
1085
|
+
}, children: N(ia, {}) }) }), N(de, { ref: y2, 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: (e3) => `0px 0px 0px 3px ${No(e3.palette.primary.main, 0.16)}` }, "&:focus, &:hover, &.Mui-active": { boxShadow: (e3) => `0px 0px 0px 2px ${No(e3.palette.primary.main, 0.16)}` } }, "& .MuiSlider-mark": { width: "1px", height: "8px" }, "& .MuiSlider-markActive": { backgroundColor: "currentColor" }, "& .MuiSlider-thumb:not(.MuiSlider-active)": { transition: m2 ? "left 260ms ease-in" : "none" } }, valueLabelDisplay: "auto", size: "small", track: false, min: 0, step: 1, value: f2, max: 200, marks: [{ value: 100 }], onAnimationEnd: () => p2(false), onWheel: (e3) => {
|
|
1085
1086
|
g2(h2(n.findNextStep(o2.getView().getZoomScale(), e3.deltaY < 0, 10)));
|
|
1086
1087
|
}, onKeyDown: (e3) => {
|
|
1087
|
-
e3.which ===
|
|
1088
|
+
e3.which === Sa.Down || e3.which === Sa.Right ? (g2(h2(n.findNextStep(o2.getView().getZoomScale(), true, 10))), e3.preventDefault()) : e3.which === Sa.Up || e3.which === Sa.Left ? (g2(h2(n.findNextStep(o2.getView().getZoomScale(), false, 10))), e3.preventDefault()) : e3.which !== Sa.Enter && e3.which !== Sa.Escape || k2();
|
|
1088
1089
|
}, onChange: (e3, t3) => {
|
|
1089
1090
|
Math.abs(t3 - 100) < 3 ? g2(100) : g2(t3);
|
|
1090
|
-
}, valueLabelFormat: (e3, t3) => `Zoom: ${Math.round(d2)}%` }),
|
|
1091
|
-
0 !== e3.button ? e3.preventDefault() :
|
|
1092
|
-
}, children:
|
|
1091
|
+
}, valueLabelFormat: (e3, t3) => `Zoom: ${Math.round(d2)}%` }), N(Oe, { disableInteractive: true, title: "Zoom In", children: N(J, { sx: { padding: "0", "&:hover:not([disabled])": { color: (e3) => e3.palette.primary.main }, "& svg": { width: "12px", height: "12px" } }, size: "small", onPointerDown: (e3) => {
|
|
1092
|
+
0 !== e3.button ? e3.preventDefault() : C2(e3);
|
|
1093
|
+
}, children: N(sa, {}) }) }), E(X, { sx: { display: "flex", flexDirection: "row" }, children: [N(X, { sx: { minWidth: "8px" } }), N(Z, { noWrap: true, component: "div", onClick: () => {
|
|
1093
1094
|
g2(100);
|
|
1094
|
-
}, sx: { cursor: "pointer", display: "flex", flex: "1 1 100%", fontSize: "0.70rem", marginLeft: "2px", marginRight: "2px", userSelect: "none", justifyContent: "center", width:
|
|
1095
|
+
}, sx: { cursor: "pointer", display: "flex", flex: "1 1 100%", fontSize: "0.70rem", marginLeft: "2px", marginRight: "2px", userSelect: "none", justifyContent: "center", width: T2 }, children: N("div", { children: Math.round(d2) + "%" }) })] })] });
|
|
1095
1096
|
}));
|
|
1096
1097
|
vl.displayName = "SheetZoomScale";
|
|
1097
|
-
const Tl =
|
|
1098
|
+
const Tl = L(H((e2, t2) => {
|
|
1098
1099
|
const { sx: o2, sheet: n2, gridStyle: a2, children: r2, childrenEnd: l2, ...i2 } = e2;
|
|
1099
|
-
|
|
1100
|
-
const s2 =
|
|
1101
|
-
|
|
1100
|
+
q(t2, () => ({}));
|
|
1101
|
+
const s2 = U(null);
|
|
1102
|
+
V(() => {
|
|
1102
1103
|
const e3 = (e4) => e4.preventDefault();
|
|
1103
1104
|
return s2.current?.addEventListener("wheel", e3, { passive: false }), () => {
|
|
1104
1105
|
s2.current?.removeEventListener("wheel", e3);
|
|
1105
1106
|
};
|
|
1106
1107
|
}, []);
|
|
1107
|
-
const d2 =
|
|
1108
|
+
const d2 = va(), c2 = W(() => {
|
|
1108
1109
|
const e3 = d2.getMode();
|
|
1109
1110
|
return e3?.description ? e3.description : "Ready";
|
|
1110
|
-
}, [d2]), [m2, p2] =
|
|
1111
|
-
return
|
|
1111
|
+
}, [d2]), [m2, p2] = O(false);
|
|
1112
|
+
return E(X, { ref: s2, sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", overflow: m2 ? "visible" : "hidden", boxShadow: `0px -1px 0px ${a2.header.edgeStrokeFill}`, ...o2 }, onMouseOver: () => p2(true), onMouseLeave: () => p2(false), ...i2, children: [r2, N("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "end", overflow: "hidden" }, children: N(Z, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: c2 }) }), l2 ? N(X, { sx: { display: "flex", alignItems: "center" }, children: l2 }) : null, N(Se, { style: { marginTop: "6px", marginBottom: "6px" } }), N(vl, { sx: { paddingLeft: "4px", minWidth: "175px" }, sheet: n2 })] });
|
|
1112
1113
|
}));
|
|
1113
1114
|
Tl.displayName = "StatusBar";
|
|
1114
|
-
const Dl =
|
|
1115
|
-
const { disabled: o2, names: a2, workbook: l2, restoreFocus: i2, readonly: s2 = false, disabled: d2 = false, commandPopupButtonProps: c2, sx: m2, notifier: u2, ...g2 } = e2, [h2, f2] =
|
|
1116
|
-
if (
|
|
1117
|
-
const e4 =
|
|
1118
|
-
return
|
|
1115
|
+
const Dl = L(H((e2, t2) => {
|
|
1116
|
+
const { disabled: o2, names: a2, workbook: l2, restoreFocus: i2, readonly: s2 = false, disabled: d2 = false, commandPopupButtonProps: c2, sx: m2, notifier: u2, ...g2 } = e2, [h2, f2] = O(null), [x2, b2] = O(() => l2.getSelectedRanges().getCoords()), [y2, k2] = O(false), { reference: S2 } = Eo({ parentFloat: c2?.parentFloat }), [C2, v2] = O(() => s2 || !l2.getProtection().isStructureAllowed()), T2 = () => h2?.text ?? "", [D2, P2] = O(T2), R2 = wa(() => {
|
|
1117
|
+
if (S2?.closeAll(), !D2) {
|
|
1118
|
+
const e4 = T2();
|
|
1119
|
+
return P2(T2()), e4;
|
|
1119
1120
|
}
|
|
1120
|
-
if (
|
|
1121
|
-
const e3 =
|
|
1122
|
-
if ("r" === e3 || "c" === e3) return
|
|
1121
|
+
if (T2() === D2) return D2;
|
|
1122
|
+
const e3 = D2.trim().toLowerCase();
|
|
1123
|
+
if ("r" === e3 || "c" === e3) return D2;
|
|
1123
1124
|
try {
|
|
1124
|
-
const e4 = l2.getRanges(
|
|
1125
|
+
const e4 = l2.getRanges(D2);
|
|
1125
1126
|
if (e4) return e4.toString();
|
|
1126
1127
|
} catch (e4) {
|
|
1127
1128
|
}
|
|
1128
|
-
const t3 = a2.getByName(
|
|
1129
|
-
if (t3 && t3.getRanges()) return
|
|
1129
|
+
const t3 = a2.getByName(D2);
|
|
1130
|
+
if (t3 && t3.getRanges()) return D2;
|
|
1130
1131
|
let o3 = null;
|
|
1131
1132
|
try {
|
|
1132
|
-
const e4 = l2.getRanges(
|
|
1133
|
+
const e4 = l2.getRanges(D2), t4 = e4.getCoords().map((e5) => ({ $colEnd: true, $rowEnd: true, $colStart: true, $rowStart: true, ...e5 }));
|
|
1133
1134
|
o3 = l2.getRanges(t4);
|
|
1134
1135
|
} catch (e4) {
|
|
1135
1136
|
}
|
|
@@ -1138,17 +1139,17 @@ const Dl = k(S((e2, t2) => {
|
|
|
1138
1139
|
o3 = l2.getRanges(e4);
|
|
1139
1140
|
}
|
|
1140
1141
|
try {
|
|
1141
|
-
let e4 = a2.getByName(
|
|
1142
|
-
|
|
1142
|
+
let e4 = a2.getByName(D2);
|
|
1143
|
+
C2 || e4 || (e4 = a2.addReference(D2, o3)), e4 && f2({ text: e4.getName() });
|
|
1143
1144
|
} catch (e4) {
|
|
1144
|
-
|
|
1145
|
+
P2(T2()), u2.showMessage?.(e4.message, { type: Da.Error });
|
|
1145
1146
|
}
|
|
1146
1147
|
return null;
|
|
1147
|
-
}, [
|
|
1148
|
+
}, [D2, a2, S2, C2]), M2 = wa(() => {
|
|
1148
1149
|
if (l2.isClosed()) return;
|
|
1149
1150
|
const e3 = [];
|
|
1150
|
-
for (let t4 = 0; t4 <
|
|
1151
|
-
const o4 =
|
|
1151
|
+
for (let t4 = 0; t4 < x2.length; t4++) {
|
|
1152
|
+
const o4 = x2[t4];
|
|
1152
1153
|
e3.push({ $colEnd: true, $rowEnd: true, $colStart: true, $rowStart: true, ...o4 });
|
|
1153
1154
|
}
|
|
1154
1155
|
let t3 = null;
|
|
@@ -1158,227 +1159,227 @@ const Dl = k(S((e2, t2) => {
|
|
|
1158
1159
|
}
|
|
1159
1160
|
let o3 = null;
|
|
1160
1161
|
o3 = t3?.length > 0 ? t3[0].getName() : l2.getSelectedSheet().getSelectedRange().toString(), f2({ text: o3 });
|
|
1161
|
-
}, [l2,
|
|
1162
|
-
|
|
1163
|
-
|
|
1162
|
+
}, [l2, x2]), [F2, B2] = O(() => a2?.getItems() ?? null);
|
|
1163
|
+
w(a2, { onCollectionChange(e3) {
|
|
1164
|
+
B2(a2.getItems()), M2();
|
|
1164
1165
|
}, onClose(e3) {
|
|
1165
|
-
|
|
1166
|
-
} }),
|
|
1167
|
-
|
|
1168
|
-
}, [h2,
|
|
1169
|
-
const [
|
|
1170
|
-
|
|
1171
|
-
|
|
1166
|
+
B2([]);
|
|
1167
|
+
} }), V(() => {
|
|
1168
|
+
P2(T2());
|
|
1169
|
+
}, [h2, x2]);
|
|
1170
|
+
const [I2, L2] = O(l2?.getSelectedSheet());
|
|
1171
|
+
w(l2, { onProtectionChange: (e3) => {
|
|
1172
|
+
v2(s2 || !e3.getProtection().isStructureAllowed());
|
|
1172
1173
|
}, onSheetsChange: (e3) => {
|
|
1173
|
-
|
|
1174
|
+
L2(e3?.getSelectedSheet());
|
|
1174
1175
|
}, onViewChange(e3) {
|
|
1175
|
-
|
|
1176
|
+
L2(e3?.getSelectedSheet());
|
|
1176
1177
|
} });
|
|
1177
|
-
const [
|
|
1178
|
-
|
|
1179
|
-
|
|
1178
|
+
const [H2, W2] = O(null), $2 = wa(n.debounce(M2, H2 ? 320 : 0), []);
|
|
1179
|
+
w(I2.getSelection(), { onChange: () => {
|
|
1180
|
+
b2((e3) => {
|
|
1180
1181
|
const t3 = l2.getSelectedRanges().getCoords();
|
|
1181
1182
|
return p.isEqualRangesArrays(t3, e3) ? e3 : t3;
|
|
1182
1183
|
});
|
|
1183
1184
|
}, onAdjustingChange: (e3) => {
|
|
1184
|
-
|
|
1185
|
-
} }),
|
|
1186
|
-
if (
|
|
1185
|
+
W2(e3.getAdjusting());
|
|
1186
|
+
} }), V(() => {
|
|
1187
|
+
if (H2) {
|
|
1187
1188
|
const e3 = l2.getSelectedRange(), t3 = e3.getRowCount(), o3 = e3.getColumnCount();
|
|
1188
1189
|
let n2 = `${t3}R x ${o3}C`;
|
|
1189
1190
|
if (n2.length > 17 && (n2 = `${t3}x${o3}`), t3 > 1 || o3 > 1) return void f2({ text: n2, fontStyle: "italic", justifyContent: "center" });
|
|
1190
1191
|
}
|
|
1191
|
-
f2({ text: l2.getSelectedSheet().getSelectedRange().toString() }),
|
|
1192
|
-
}, [
|
|
1193
|
-
const
|
|
1192
|
+
f2({ text: l2.getSelectedSheet().getSelectedRange().toString() }), $2();
|
|
1193
|
+
}, [x2, l2, H2]);
|
|
1194
|
+
const G2 = U(null), _2 = z((e3) => {
|
|
1194
1195
|
const { onMouseDown: t3, onMouseUp: o3, ...n2 } = e3;
|
|
1195
|
-
return
|
|
1196
|
+
return N(J, { ...n2, sx: { ...n2?.sx, display: "flex", flex: "1 1 100%" }, disableRipple: true, children: N(oe, { inputMode: "text", inputProps: { tabIndex: 0, name: "input-named-range", maxLength: 255, className: "input", autoFocus: false, spellCheck: false, autoComplete: "off", ref: G2 }, sx: { "&::before": { borderBottom: "1px solid transparent" }, "&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before": { borderBottom: (e4) => `1px solid ${e4.palette.text.icon ?? e4.palette.action.active}` }, "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (e4) => `1px solid ${e4.palette.primary.main}` }, "::after": { borderBottom: (e4) => `1px solid ${e4.palette.primary.main}` }, paddingTop: "0px", paddingBottom: "0px", fontSize: 11 * r.getDeviceScale(), fontStyle: h2?.fontStyle, paddingLeft: (e4) => e4.spacing(0.75), paddingRight: (e4) => e4.spacing(0.75), boxShadow: "none", flex: "1", color: (e4) => e4.palette.text.secondary, input: { padding: "0", textAlign: "left", "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (e4) => e4.palette.text.primary }, "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (e4) => e4.palette.text.primary } } }, value: D2, onFocus: (e4) => {
|
|
1196
1197
|
e4.target?.select();
|
|
1197
1198
|
}, onKeyDown: (e4) => {
|
|
1198
|
-
if (e4.which ===
|
|
1199
|
-
let t4 =
|
|
1200
|
-
|
|
1201
|
-
} else if (e4.which ===
|
|
1199
|
+
if (e4.which === Sa.Enter || e4.which === Sa.Tab) {
|
|
1200
|
+
let t4 = D2;
|
|
1201
|
+
T2() !== D2 && (e4.stopPropagation(), e4.preventDefault(), t4 = R2()), t4 ? q2(t4) : i2?.();
|
|
1202
|
+
} else if (e4.which === Sa.Escape) T2() !== D2 ? (P2(T2()), setTimeout(() => {
|
|
1202
1203
|
e4.target?.select();
|
|
1203
1204
|
}, 0), e4.stopPropagation(), e4.preventDefault()) : i2?.();
|
|
1204
|
-
else if (e4.which ===
|
|
1205
|
+
else if (e4.which === Sa.Space) return void e4.stopPropagation();
|
|
1205
1206
|
}, onBlur: () => {
|
|
1206
|
-
|
|
1207
|
+
P2(T2());
|
|
1207
1208
|
}, onChange: (e4) => {
|
|
1208
|
-
|
|
1209
|
+
P2(e4.target.value);
|
|
1209
1210
|
} }) });
|
|
1210
|
-
}, [
|
|
1211
|
+
}, [D2, h2]), q2 = wa(async (e3) => {
|
|
1211
1212
|
try {
|
|
1212
|
-
|
|
1213
|
+
S2?.closeAll();
|
|
1213
1214
|
const t3 = a2.lookupByRanges(e3)?.[0];
|
|
1214
1215
|
t3 && await t3?.select(), await l2.getRanges(e3)?.select();
|
|
1215
1216
|
} catch (e4) {
|
|
1216
|
-
u2.showMessage?.(e4.message, { type:
|
|
1217
|
+
u2.showMessage?.(e4.message, { type: Da.Error });
|
|
1217
1218
|
}
|
|
1218
|
-
}, [a2, u2, l2]),
|
|
1219
|
+
}, [a2, u2, l2]), K2 = z((e3) => {
|
|
1219
1220
|
setTimeout(() => {
|
|
1220
|
-
|
|
1221
|
+
k2(true);
|
|
1221
1222
|
}, 0);
|
|
1222
|
-
const t3 = { variant:
|
|
1223
|
+
const t3 = { variant: ya.Menuitem, parentFloat: e3.floatReference, commandHook: { ...c2?.commandHook, beforeExecute: (e4, t4) => (S2?.closeAll(), c2?.commandHook?.beforeExecute?.(e4, t4)) }, scope: c2?.scope, commands: c2?.commands };
|
|
1223
1224
|
let o3 = a2.getItems({ scope: l2?.getSelectedSheet().getName() });
|
|
1224
1225
|
o3 = o3.sort((e4, t4) => e4.getType() === t4.getType() ? e4.getName().localeCompare(t4.getName()) : "range" === e4.getType() ? -1 : 1);
|
|
1225
|
-
const n2 =
|
|
1226
|
+
const n2 = C2 ? null : ["editNamedReference", "deleteNamedReference"], r2 = C2 ? null : ["editTable", null, "convertTableToRange", "deleteTable"], i3 = [], s3 = o3.length;
|
|
1226
1227
|
for (let e4 = 0; e4 < s3; e4++) {
|
|
1227
1228
|
const a3 = o3[e4], l3 = a3.getRanges();
|
|
1228
1229
|
if (!l3 || a3.isHidden()) continue;
|
|
1229
1230
|
const s4 = a3.getType();
|
|
1230
|
-
s4 !== o3[e4 - 1]?.getType() && (e4 > 0 && i3.push(
|
|
1231
|
+
s4 !== o3[e4 - 1]?.getType() && (e4 > 0 && i3.push(N(Se, { orientation: "horizontal" }, `type-divider-${i3.length}`)), i3.push(N(eo, { variant: "subtitle2", sx: { paddingLeft: "16px" }, children: "reference" === a3.getType() ? "Ranges" : "Tables" }, `type-header-${i3.length}`))), "reference" === s4 ? i3.push(j(uo, { ...t3, key: "named-" + i3.length, popupCommandKeys: n2, popupScope: "namedItem", scope: "namedItem", commandState: a3, commands: c2?.commands, label: a3.getName(), quickCommand: "selectNamed", disabled: !a3.getRanges() || d2, icon: (e5) => {
|
|
1231
1232
|
switch (e5.key()) {
|
|
1232
1233
|
case "editNamedReference":
|
|
1233
|
-
return
|
|
1234
|
+
return we(N(Lo, {}));
|
|
1234
1235
|
case "deleteNamedReference":
|
|
1235
|
-
return
|
|
1236
|
+
return we(N(Io, {}));
|
|
1236
1237
|
default:
|
|
1237
|
-
return
|
|
1238
|
+
return we(N(Ao, {}));
|
|
1238
1239
|
}
|
|
1239
|
-
} })) : "table" === s4 && i3.push(
|
|
1240
|
+
} })) : "table" === s4 && i3.push(j(uo, { ...t3, key: "namedItem-" + i3.length, popupCommandKeys: r2, popupScope: "namedItem", scope: "namedItem", commands: c2?.commands, commandState: a3, label: a3.getName(), quickCommand: "selectNamed", disabled: !l3 || d2, icon: (e5) => {
|
|
1240
1241
|
e5.key();
|
|
1241
|
-
return
|
|
1242
|
+
return we(N(Ho, {}));
|
|
1242
1243
|
} }));
|
|
1243
1244
|
}
|
|
1244
|
-
const m3 =
|
|
1245
|
-
return
|
|
1246
|
-
}, [l2,
|
|
1247
|
-
|
|
1245
|
+
const m3 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, ...g2, children: [C2 ? null : N(ke, { ...t3, scope: "namedItem", command: c2?.commands.getCommand("addNamedReference"), icon: we(N(Wo, {})) }), i3 && i3.length > 0 ? E(A, { children: [C2 ? null : N(Se, { orientation: "horizontal" }), N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: i3 })] }) : null] });
|
|
1246
|
+
return Te({ ...e3, children: m3 });
|
|
1247
|
+
}, [l2, F2, a2, h2, C2]), Z2 = Pa(t2, () => ({ focus(e3) {
|
|
1248
|
+
G2.current?.focus(e3);
|
|
1248
1249
|
} }), []);
|
|
1249
|
-
return
|
|
1250
|
+
return N(X, { className: "outer", sx: { minWidth: 120, flex: "1 1 100%", display: "flex", alignItems: "center", justifyContent: "start", ...m2 }, ref: Ua([Z2, t2]), ...g2, children: N(Ue, { className: "outer-button", sx: { display: "flex", flex: "1 1 100%", "& .tooltip-wrapper": { display: "flex", flex: "1 1 100%", width: "100%", height: "27px" }, ...m2 }, buttonProps: { sx: { backgroundColor: (e3) => e3.palette.background.paper, backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})` } }, tabIndex: -1, outlined: { color: (e3) => o2 ? e3.palette.action.disabled : Wa(e3.palette.divider, 0.2) }, parentFloat: S2, createPopupPanel: K2, onPopupOpen: () => k2(true), onPopupClose: () => k2(false), createTooltip: ({ children: e3 }, t3) => N(Je, { title: t3 || y2 ? "" : "Name Box", disabled: t3, leaveDelay: 0, sx: { opacity: t3 || y2 ? 0 : 1 }, children: e3 }), createQuickButton: _2 }) });
|
|
1250
1251
|
}));
|
|
1251
1252
|
Dl.displayName = "NamedCollectionEditor";
|
|
1252
|
-
const Pl = (e2, t2) =>
|
|
1253
|
-
const { sx: o2, workbook: n2, sheetElement: a2, gridStyle: l2, showNamedCollectionEditor: i2 = true, NamedCollectionEditorProps: s2, renderNamedCollectionEditor: d2 = Pl, disabled: c2, commands: m2, ...p2 } = e2, [u2, g2] =
|
|
1254
|
-
|
|
1253
|
+
const Pl = (e2, t2) => N(Dl, { ref: t2, ...e2 }), Rl = L(H((e2, t2) => {
|
|
1254
|
+
const { sx: o2, workbook: n2, sheetElement: a2, gridStyle: l2, showNamedCollectionEditor: i2 = true, NamedCollectionEditorProps: s2, renderNamedCollectionEditor: d2 = Pl, disabled: c2, commands: m2, ...p2 } = e2, [u2, g2] = O(n2?.getSelectedSheet());
|
|
1255
|
+
w(n2, { onSheetsChange: (e3) => {
|
|
1255
1256
|
g2(e3?.getSelectedSheet());
|
|
1256
1257
|
}, onViewChange(e3) {
|
|
1257
1258
|
g2(e3?.getSelectedSheet());
|
|
1258
1259
|
} });
|
|
1259
|
-
const [h2, f2] =
|
|
1260
|
-
|
|
1260
|
+
const [h2, f2] = O(u2.getSelection().getCoords().cell), x2 = u2.getRange(h2).getCell(), b2 = c2 || !x2.isEditAllowed(), y2 = U(null), C2 = W(() => ({ fontSize: 11 }), []);
|
|
1261
|
+
w(u2.getSelection(), { onChange: () => {
|
|
1261
1262
|
f2(u2.getSelection().getCoords().cell);
|
|
1262
|
-
} }),
|
|
1263
|
+
} }), w(u2, { onProtectionChange() {
|
|
1263
1264
|
f2(u2.getSelection().getCoords().cell);
|
|
1264
1265
|
} });
|
|
1265
|
-
const
|
|
1266
|
+
const v2 = y2.current?.getLineHeight() ?? 20, [T2, D2] = O(v2), [P2, R2] = O(5), [M2, F2] = O(1), B2 = wa((e3, { size: t3 }) => {
|
|
1266
1267
|
e3.preventDefault(), e3.stopPropagation();
|
|
1267
|
-
const o3 = Math.floor(t3.height /
|
|
1268
|
-
|
|
1269
|
-
}, [
|
|
1270
|
-
const o3 = Math.floor(t3.height /
|
|
1271
|
-
|
|
1272
|
-
}, [
|
|
1268
|
+
const o3 = Math.floor(t3.height / v2);
|
|
1269
|
+
D2(o3 * v2 + 1), o3 > 1 && R2(o3);
|
|
1270
|
+
}, [v2]), I2 = wa((e3, { size: t3 }) => {
|
|
1271
|
+
const o3 = Math.floor(t3.height / v2);
|
|
1272
|
+
F2(o3);
|
|
1273
|
+
}, [v2]), L2 = va(), H2 = L2.getMode();
|
|
1273
1274
|
let z2 = null;
|
|
1274
|
-
"edit" ===
|
|
1275
|
-
const $2 =
|
|
1275
|
+
"edit" === H2?.key && (z2 = H2.args?.stateAndCoords);
|
|
1276
|
+
const $2 = W(() => {
|
|
1276
1277
|
let e3 = z2?.editState;
|
|
1277
|
-
return e3 || (e3 =
|
|
1278
|
+
return e3 || (e3 = k(() => u2.getRange(h2).getCell())), N(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "row", gap: 4 }, children: N(S, { ref: y2, activeCoords: h2, sheet: u2, onFocus: () => {
|
|
1278
1279
|
a2?.startEdit({ autoFocus: false, editMode: true, cell: h2 });
|
|
1279
|
-
}, defaultTextStyle:
|
|
1280
|
+
}, defaultTextStyle: C2, useRichStyling: false, disabled: b2, onChangeEdit: (e4) => {
|
|
1280
1281
|
if (void 0 !== e4.dirty) {
|
|
1281
1282
|
const t3 = { sheet: u2, coords: h2, editState: e4 };
|
|
1282
|
-
|
|
1283
|
+
L2.setMode((e5) => ({ ...e5, args: { ...e5?.args, stateAndCoords: t3 } }));
|
|
1283
1284
|
}
|
|
1284
1285
|
}, editState: e3, commands: m2, onCancelEdit: () => {
|
|
1285
1286
|
a2?.cancelEdit(), a2?.focus();
|
|
1286
1287
|
}, onSubmitEdit: () => {
|
|
1287
1288
|
a2?.submitEdit(), a2?.focus();
|
|
1288
|
-
}, linesVisible:
|
|
1289
|
-
}, [u2, z2, h2,
|
|
1289
|
+
}, linesVisible: M2 }) });
|
|
1290
|
+
}, [u2, z2, h2, M2, a2]), V2 = U(null), G2 = W(() => i2 ? d2({ names: n2.getNames(), workbook: n2, ...s2 }, V2) : null, [d2, s2, i2, u2, n2, b2]), j2 = W(() => E(ce, { elevation: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 0, backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})`, border: (e3) => `solid ${b2 ? e3.palette.action.disabled : Wa(e3.palette.divider, 0.2)} 1px` }, children: [N(Ye, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, color: "warning", "aria-label": "cancel-formula-edit", icon: we(N(zo, {})), tooltipProps: { label: "Cancel", simple: true }, disabled: b2 || null === z2, onMouseDown: (e3) => {
|
|
1290
1291
|
0 === e3.button && e3.preventDefault();
|
|
1291
1292
|
}, onClick: () => {
|
|
1292
1293
|
a2.cancelEdit();
|
|
1293
|
-
} }),
|
|
1294
|
+
} }), N(Ye, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, color: "primary", "aria-label": "commit-formula-edit", icon: we(N($o, {})), tooltipProps: { label: "Enter", simple: true }, disabled: b2 || null === z2, onMouseDown: (e3) => {
|
|
1294
1295
|
0 === e3.button && e3.preventDefault();
|
|
1295
1296
|
}, onClick: () => {
|
|
1296
1297
|
a2.submitEdit();
|
|
1297
|
-
} }),
|
|
1298
|
+
} }), N(Ye, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, disabled: true, "aria-label": "commit-formula-function", icon: we(N(Oo, { sx: { transform: "scale(0.85)" } })), tooltipProps: { label: "Insert Function", simple: true }, onMouseDown: (e3) => {
|
|
1298
1299
|
0 === e3.button && e3.preventDefault();
|
|
1299
|
-
} })] }), [
|
|
1300
|
+
} })] }), [b2, z2]), _2 = Ha(), [q2, K2] = O(false), Z2 = W(() => E(X, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", gap: (e3) => e3.spacing(0.5), alignItems: "start" }, children: [j2, E(ce, { elevation: 0, sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", fontFamily: (e3) => e3.typography.fontFamily, fontSize: 11 * r.getDeviceScale(), "& .editor-placement": { top: "2px !important" }, boxShadow: "none", borderRadius: (e3) => `${e3.shape.borderRadius}px`, backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})`, border: (e3) => `solid ${b2 ? e3.palette.action.disabled : Wa(e3.palette.divider, 0.2)} 1px`, "& textarea": { color: (e3) => b2 ? `${e3.palette.text.disabled} !important` : e3.palette.text.primary }, "& .react-resizable-handle": { width: "100%", height: "8px", backgroundColor: "transparent", boxSizing: "content-box", zIndex: 1e3 }, "& .react-resizable-handle-s": { position: "absolute", bottom: "-10px", cursor: "s-resize" } }, onFocus: () => K2(true), onBlur: () => K2(false), onMouseDown: (e3) => {
|
|
1300
1301
|
e3.target?.classList.contains("react-resizable-handle") && e3.preventDefault();
|
|
1301
|
-
}, children: [
|
|
1302
|
+
}, children: [N(X, { className: "formula-editor", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", alignSelf: "baseline", paddingLeft: (e3) => e3.spacing(1), paddingRight: (e3) => e3.spacing(1) }, children: N(Ga, { height: T2, draggableOpts: { grid: [v2, v2] }, minConstraints: [v2, v2], maxConstraints: [15 * v2, 15 * v2], onResize: I2, onResizeStop: B2, resizeHandles: ["s"], axis: "y", style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: $2 }) }), N(Ye, { sx: { padding: "0px", margin: "0px 0px", border: "none !important", "&.Mui-focusVisible": { border: "none" }, "&:hover:not([disabled])": { border: "none" } }, dense: true, outlined: false, "aria-label": "toggle-expand-formula-edit", icon: we(N(M2 > 1 ? da : ca, {})), tooltipProps: { label: (M2 > 1 ? "Collapse" : "Expand") + " Formula Bar", simple: true }, onMouseDown: (e3) => {
|
|
1302
1303
|
0 === e3.button && e3.preventDefault();
|
|
1303
1304
|
}, onClick: () => {
|
|
1304
|
-
const e3 =
|
|
1305
|
-
|
|
1306
|
-
} }),
|
|
1307
|
-
return
|
|
1305
|
+
const e3 = M2 > 1 ? 1 : P2;
|
|
1306
|
+
D2(e3 * v2 + 1), F2(e3);
|
|
1307
|
+
} }), N(X, { sx: { position: "absolute", width: "100%", height: "2px", bottom: "0", willChange: "opacity", transition: "opacity 60ms ease-in", opacity: q2 ? 1 : 0, borderBottomWidth: "2px", borderBottomStyle: "solid", borderBottomColor: (e3) => e3.palette.primary.main, borderRadius: (e3) => `${e3.shape.borderRadius}px` } })] })] }), [j2, $2, q2, M2, v2]), J2 = W(() => G2 || Z2 ? !G2 && Z2 ? Z2 : G2 && !Z2 ? G2 : N(A, { children: N(Ra, { fixedPane: "before", minBefore: "165px", minAfter: "200px", paneBeforeProps: { style: { alignItems: "flex-start" } }, paneAfterProps: { style: { overflow: "visible" } }, resizerProps: { style: { backgroundImage: `url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${_2.palette.text.icon ?? _2.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center 6.5px", minWidth: "18px" } }, elementBefore: G2, elementAfter: Z2 }) }) : null, [G2, Z2]), Y2 = Pa(t2, () => ({ isFormulaBarElement: () => true, getNamedCollectionEditorElement: () => V2.current }), []);
|
|
1308
|
+
return N(X, { sx: { display: "flex", flexDirection: "row", gap: (e3) => e3.spacing(0.5), ...o2 }, ref: Y2, ...p2, children: J2 });
|
|
1308
1309
|
}));
|
|
1309
1310
|
Rl.displayName = "FormulaBar";
|
|
1310
|
-
const Ml =
|
|
1311
|
-
const { filter: o2, commands: n2, disabled: a2, sx: r2, floatReference: l2, ...i2 } = e2, s2 =
|
|
1311
|
+
const Ml = L(H((e2, t2) => {
|
|
1312
|
+
const { filter: o2, commands: n2, disabled: a2, sx: r2, floatReference: l2, ...i2 } = e2, s2 = W(() => ({}), []), d2 = W(() => ({ commandHook: { beforeExecute: (e3, t3) => l2.closeAll(), onExecute() {
|
|
1312
1313
|
}, onError() {
|
|
1313
1314
|
console.log("onError");
|
|
1314
|
-
} }, disabled: a2, parentFloat: l2 }), [a2, l2]), c2 =
|
|
1315
|
-
return
|
|
1315
|
+
} }, disabled: a2, parentFloat: l2 }), [a2, l2]), c2 = W(() => ({ ...s2, ...d2, variant: ya.Menuitem }), [s2, d2]), m2 = E(A, { children: [N(ke, { ...c2, command: n2.getCommand("sortAscending"), icon: we(N(Bt, {})) }), N(ke, { ...c2, command: n2.getCommand("sortDescending"), icon: we(N(Nt, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...c2, command: n2.getCommand("autoFilterClear"), icon: we(N(It, {})) }), []] });
|
|
1316
|
+
return N(X, { ref: t2, sx: { paddingTop: "4px", paddingBottom: "4px", display: "flex", flexDirection: "column", ...r2 }, ...i2, children: m2 });
|
|
1316
1317
|
}));
|
|
1317
1318
|
Ml.displayName = "FilterColumnMenu";
|
|
1318
|
-
const Fl =
|
|
1319
|
-
const { children: o2, className: n2, disabled: a2, style: r2, filter: l2, ...i2 } = e2, s2 =
|
|
1320
|
-
return
|
|
1319
|
+
const Fl = L(H((e2, t2) => {
|
|
1320
|
+
const { children: o2, className: n2, disabled: a2, style: r2, filter: l2, ...i2 } = e2, s2 = Pa(t2, () => ({ isFilters: () => true }), []);
|
|
1321
|
+
return N("div", { ref: s2, className: Yn("filters", n2), style: { position: "relative", display: "flex", flexDirection: "column", alignItems: "center", gap: "8px", ...r2 }, ...i2, children: E("div", { style: { flex: "1 1 100%", display: "flex", minHeight: "100px", minWidth: "220px", alignItems: "center", border: "grey solid 1px", padding: "4px 4px", overflow: "hidden", flexDirection: "column", justifyContent: "space-evenly", marginTop: "4px", marginBottom: "4px", marginLeft: "16px", marginRight: "16px" }, children: [N("div", { children: l2.getName() }), N("div", { children: "Filter Widget" })] }) });
|
|
1321
1322
|
}));
|
|
1322
1323
|
Fl.displayName = "Filters";
|
|
1323
|
-
const Bl =
|
|
1324
|
-
const { children: o2, sheet: n2, style: a2, className: r2, value: l2, index: i2, editing: s2, editable: d2, disabled: c2, selectedIndex: m2, dragging: p2, borderColor: u2, borderWidth: g2, activeColor: h2, background: f2 = "white", tabRadius:
|
|
1325
|
-
|
|
1326
|
-
|
|
1324
|
+
const Bl = L(H((e2, t2) => {
|
|
1325
|
+
const { children: o2, sheet: n2, style: a2, className: r2, value: l2, index: i2, editing: s2, editable: d2, disabled: c2, selectedIndex: m2, dragging: p2, borderColor: u2, borderWidth: g2, activeColor: h2, background: f2 = "white", tabRadius: x2 = 4, gridTheme: b2, ...y2 } = e2, [k2, S2] = O(() => !!n2 && n2.getProtection().isLocked()), [C2, v2] = O(() => n2 ? n2.getTabColor() : null);
|
|
1326
|
+
w(n2, { onProtectionChange: () => {
|
|
1327
|
+
S2(n2.getProtection().isLocked());
|
|
1327
1328
|
}, onTabColorChange: () => {
|
|
1328
|
-
|
|
1329
|
+
v2(n2.getTabColor());
|
|
1329
1330
|
}, onStyleChange: () => {
|
|
1330
|
-
|
|
1331
|
+
v2(n2.getTabColor());
|
|
1331
1332
|
} });
|
|
1332
|
-
const
|
|
1333
|
-
let
|
|
1334
|
-
if (
|
|
1333
|
+
const T2 = Ha(), D2 = m2 === i2;
|
|
1334
|
+
let P2 = null, R2 = null;
|
|
1335
|
+
if (C2 || p2) {
|
|
1335
1336
|
let e3 = f2;
|
|
1336
|
-
|
|
1337
|
+
C2 ? (R2 = C2.toBlackOrWhite().toCSS(), e3 = C2?.toCSS()) : D2 || (e3 = T2.palette.background.paper), P2 = N(X, { sx: { position: "absolute", boxSizing: "border-box", top: "3px", left: "4px", right: "4.5px", bottom: "1.5px", opacity: D2 ? "50%" : "100%", borderRadius: "4px", border: (e4) => D2 ? `${f2} solid 1px` : `${e4.palette.divider} solid 1px`, background: D2 && C2 ? `linear-gradient(0deg, ${e3} 0%, transparent)` : e3 } });
|
|
1337
1338
|
}
|
|
1338
|
-
let
|
|
1339
|
-
"string" == typeof u2 ?
|
|
1340
|
-
const
|
|
1341
|
-
return
|
|
1339
|
+
let M2 = null;
|
|
1340
|
+
"string" == typeof u2 ? M2 = u2 : u2?.toCSS && (M2 = u2.toCSS());
|
|
1341
|
+
const F2 = D2 ? N(X, { sx: { width: "100%", borderRadius: "4px", minWidth: "4px", height: "2px", backgroundColor: (e3) => e3.palette.primary.main } }) : null;
|
|
1342
|
+
return N($a, { theme: D2 ? b2 ?? T2 : T2, children: N(X, { ref: t2, className: Yn(r2), sx: { ...a2, display: "flex", flexDirection: "column", minHeight: "0px", fontWeight: D2 ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", lineHeight: "1", textTransform: "none", minWidth: "unset", cursor: p2 ? "grabbing" : void 0 }, ...y2, children: N(Ma, { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, radius: x2, strokeColor: D2 ? M2 : "transparent", children: N(ee, { sx: { textTransform: "none", borderRadius: "0px", minHeight: "0px", paddingLeft: "11px", paddingRight: "12px", paddingTop: "3px", flex: "1 1 100%", paddingBottom: "3px", fontWeight: D2 ? "700" : "400", fontSize: "0.85rem", letterSpacing: "0", transition: "none", cursor: p2 ? "grabbing" : void 0, color: D2 ? "primary" : R2 || "text.secondary", backgroundColor: D2 ? f2 : "transparent", "&:hover:not([disabled])": { backgroundColor: D2 ? f2 : "transparent" }, "& input": { color: (e3) => `${e3.palette.text.primary}`, textAlign: "center", fontWeight: "500" }, marginTop: "0px", minWidth: "unset" }, disabled: c2, disableRipple: s2, component: "div", children: E(A, { children: [P2, E(X, { sx: { zIndex: "1", display: "flex", flexDirection: "row", alignItems: "center" }, children: [E(X, { sx: { display: "flex", flexDirection: "column", alignItems: "center", rowGap: "1px", lineHeight: "1", marginTop: D2 ? void 0 : "1px" }, children: [o2, F2] }), k2 ? N(ma, { sx: { scale: "0.80", marginLeft: "2px", width: "22px", height: "22px" }, color: "secondary" }) : N(X, { sx: { minHeight: "22px" } })] })] }) }, l2 + ":" + i2) }) }) });
|
|
1342
1343
|
}));
|
|
1343
1344
|
Bl.displayName = "SheetTab";
|
|
1344
|
-
const Nl =
|
|
1345
|
-
const { workbook: o2, index: n2, commands: a2, scope: r2 = "sheet", disabled: l2, floatReference: i2, sx: s2, className: d2, tabStripRef: c2, ...m2 } = e2, [p2, u2] =
|
|
1346
|
-
|
|
1345
|
+
const Nl = L(H((e2, t2) => {
|
|
1346
|
+
const { workbook: o2, index: n2, commands: a2, scope: r2 = "sheet", disabled: l2, floatReference: i2, sx: s2, className: d2, tabStripRef: c2, ...m2 } = e2, [p2, u2] = O(o2?.getProtection());
|
|
1347
|
+
w(o2, { onProtectionChange: (e3) => {
|
|
1347
1348
|
u2(e3?.getProtection());
|
|
1348
1349
|
} });
|
|
1349
|
-
const g2 =
|
|
1350
|
+
const g2 = W(() => ({}), []), h2 = W(() => ({ commandHook: { beforeExecute: (e3, t3) => i2.closeAll(), onExecute() {
|
|
1350
1351
|
}, onError() {
|
|
1351
1352
|
console.log("onError");
|
|
1352
|
-
} }, scope: r2, commandState: n2, disabled: l2 || void 0 === n2, parentFloat: i2 }), [l2, i2]), f2 =
|
|
1353
|
+
} }, scope: r2, commandState: n2, disabled: l2 || void 0 === n2, parentFloat: i2 }), [l2, i2]), f2 = W(() => ({ ...g2, ...h2 }), [g2, h2]), x2 = E(A, { children: [N(ke, { command: a2.getCommand("addSheet"), commandState: n2, ...f2, variant: ya.Menuitem }), N(ke, { command: a2.getCommand("deleteSheet"), ...f2, variant: ya.Menuitem }), E(qe, { onMouseDown: (e3) => {
|
|
1353
1354
|
0 === e3.button && e3.preventDefault();
|
|
1354
1355
|
}, onMouseUp: () => {
|
|
1355
1356
|
Promise.resolve(i2.closeAll()).then(() => {
|
|
1356
1357
|
c2?.startEdit(n2);
|
|
1357
1358
|
});
|
|
1358
|
-
}, disabled: l2 || !p2.isStructureAllowed(), parentFloat: i2, children: ["Rename", "sheet" !== r2 ? " Sheet" : ""] }),
|
|
1359
|
-
return
|
|
1359
|
+
}, disabled: l2 || !p2.isStructureAllowed(), parentFloat: i2, children: ["Rename", "sheet" !== r2 ? " Sheet" : ""] }), N(ke, { command: a2.getCommand("duplicateSheet"), ...f2, variant: ya.Menuitem }), N(ke, { command: a2?.getCommand("protectionSheetToggle"), ...f2, variant: ya.Menuitem, icon: N(ma, {}) }), N(Hr, { variant: ya.Menuitem, command: a2.getCommand("formatSheetTabColor"), icon: N(Ze, {}), panelProps: { disableAlpha: true, autoColorLabel: "No Tab Color", autoColorPosition: sr.End }, parentFloat: i2 }), N(Se, { orientation: "horizontal" }), N(ke, { command: a2.getCommand("hideSheet"), ...f2, variant: ya.Menuitem, icon: we(N(Vo, {})) })] });
|
|
1360
|
+
return N(X, { ref: t2, className: Yn("menu", d2), sx: { ...s2 }, ...m2, children: x2 });
|
|
1360
1361
|
}));
|
|
1361
1362
|
Nl.displayName = "SheetTabMenu";
|
|
1362
|
-
const El =
|
|
1363
|
-
const { workbook: o2, gridStyle: n2, floatReference: a2, closeFloatAll: r2, className: l2, ...i2 } = e2, [s2, d2] =
|
|
1364
|
-
|
|
1363
|
+
const El = L(H((e2, t2) => {
|
|
1364
|
+
const { workbook: o2, gridStyle: n2, floatReference: a2, closeFloatAll: r2, className: l2, ...i2 } = e2, [s2, d2] = O(o2?.getSheets().getItems()), [c2, m2] = O(o2?.getProtection());
|
|
1365
|
+
w(o2, { onSheetsChange: (e3) => {
|
|
1365
1366
|
d2(e3.getSheets().getItems());
|
|
1366
1367
|
}, onProtectionChange: (e3) => {
|
|
1367
1368
|
m2(e3?.getProtection());
|
|
1368
1369
|
} });
|
|
1369
|
-
const p2 =
|
|
1370
|
+
const p2 = W(() => {
|
|
1370
1371
|
const e3 = [], t3 = o2.getSheets().getItems({ visibility: u.Visibility.Hidden }), r3 = o2.getSelectedSheet();
|
|
1371
1372
|
for (let o3 = 0; o3 < t3.length; o3++) {
|
|
1372
1373
|
const l3 = t3[o3], i3 = l3.getVisibility();
|
|
1373
1374
|
if (i3 === u.Visibility.VeryHidden) continue;
|
|
1374
1375
|
const s3 = r3 === l3, d3 = l3.getProtection().isLocked(), m3 = l3.getTabColor(), p3 = n2?.body.fill ?? "transparent";
|
|
1375
1376
|
let g2 = null, h2 = null, f2 = p3;
|
|
1376
|
-
m3 && (f2 = m3.toCSS(), s3 || (h2 = m3.toBlackOrWhite().toCSS()), g2 =
|
|
1377
|
-
let
|
|
1378
|
-
d3 && (
|
|
1377
|
+
m3 && (f2 = m3.toCSS(), s3 || (h2 = m3.toBlackOrWhite().toCSS()), g2 = N(X, { sx: { position: "absolute", display: "flex", flexDirection: "column", top: "4px", left: "40px", right: "8px", bottom: "4px", background: s3 ? f2 : "transparent", borderRadius: "4px", border: `solid 1px ${n2.header.edgeStrokeFill}` }, children: N(X, { sx: { flex: "1 1 100%", boxSizing: "content-box", opacity: s3 || i3 === u.Visibility.Hidden ? "50%" : "100%", border: (e4) => s3 ? `${p3} solid 1.5px` : `${e4.palette.divider} solid 1px`, background: s3 && m3 ? `linear-gradient(0deg, ${f2} 0%, ${p3})` : f2, borderRadius: "4px" } }) }));
|
|
1378
|
+
let x2 = null;
|
|
1379
|
+
d3 && (x2 = N(ma, { color: "secondary" })), i3 !== u.Visibility.Visible && (x2 = we(N(Vo, { style: { opacity: c2.isStructureAllowed() ? 1 : 0.7 }, color: "secondary" }))), x2 && (x2 = N(X, { sx: { display: "flex", flex: "1 1 100%", alignItems: "center", ml: "16px", "& *": { lineHeight: "1em", fontSize: "1.3em" } }, children: x2 })), e3.push(N(qe, { disabled: !c2.isStructureAllowed() && i3 === u.Visibility.Hidden, sx: { color: (e4) => {
|
|
1379
1380
|
let t4 = s3 ? e4.palette.primary.main : e4.palette.text.secondary;
|
|
1380
1381
|
return h2 && (t4 = h2), i3 === u.Visibility.Hidden && (t4 = Oa(t4, e4.palette.action.disabledOpacity)), t4;
|
|
1381
|
-
}, borderLeft: (e4) => `${s3 ? e4.palette.primary.main : "transparent"} solid 2px`, paddingLeft: "4px", fontWeight: s3 ? "700" : "400", "&:hover": { fontWeight: "700" } }, icon: s3 ?
|
|
1382
|
+
}, borderLeft: (e4) => `${s3 ? e4.palette.primary.main : "transparent"} solid 2px`, paddingLeft: "4px", fontWeight: s3 ? "700" : "400", "&:hover": { fontWeight: "700" } }, icon: s3 ? N(ut, {}) : void 0, onMouseDown: (e4) => e4.preventDefault(), onMouseUp: () => {
|
|
1382
1383
|
Promise.resolve(a2.closeAll()).then(() => {
|
|
1383
1384
|
try {
|
|
1384
1385
|
l3.select();
|
|
@@ -1386,11 +1387,11 @@ const El = k(S((e2, t2) => {
|
|
|
1386
1387
|
console.error(e4);
|
|
1387
1388
|
}
|
|
1388
1389
|
});
|
|
1389
|
-
}, children:
|
|
1390
|
+
}, children: E(A, { children: [g2, E(X, { sx: { paddingRight: "0px", paddingLeft: "4px", display: "flex", flexDirection: "row", flex: "1 1 100%", overflow: "hidden", alignItems: "center", zIndex: 2 }, children: [E(X, { className: "sheet-name", sx: { display: "flex", flexDirection: "column", paddingLeft: "8px", paddingRight: "8px", alignItems: "center" }, children: [l3.getName(), N(X, { sx: { height: "0px", opacity: "0", fontWeight: "700" }, children: l3.getName() })] }), x2] })] }) }, "" + o3));
|
|
1390
1391
|
}
|
|
1391
1392
|
return e3;
|
|
1392
1393
|
}, [o2, c2, s2, a2, n2]);
|
|
1393
|
-
return
|
|
1394
|
+
return N(X, { ref: t2, className: Yn("menu", l2), ...i2, children: p2 });
|
|
1394
1395
|
}));
|
|
1395
1396
|
El.displayName = "SheetsAllMenu";
|
|
1396
1397
|
let Al = false, Il = false;
|
|
@@ -1425,30 +1426,30 @@ const Hl = async (e2) => {
|
|
|
1425
1426
|
}, zl = 0.12, $l = (e2, t2) => {
|
|
1426
1427
|
const o2 = {}, n2 = (e3) => {
|
|
1427
1428
|
const t3 = e3.palette?.background.default ?? "rgba(255,255,255,1)";
|
|
1428
|
-
return { text: { fontFamily: e3.typography?.fontFamily ?? "Calibri", fontSize: e3.typography?.fontSize ?? 8.25, fontWeight: e3.typography?.fontWeightRegular ?? "400", fill: "dark" === e3.palette.mode ? e3.palette?.text?.secondary : e3.palette?.text?.primary }, fill: t3, strokeFill:
|
|
1429
|
+
return { text: { fontFamily: e3.typography?.fontFamily ?? "Calibri", fontSize: e3.typography?.fontSize ?? 8.25, fontWeight: e3.typography?.fontWeightRegular ?? "400", fill: "dark" === e3.palette.mode ? e3.palette?.text?.secondary : e3.palette?.text?.primary }, fill: t3, strokeFill: Go(t3, zl, e3.palette?.mode), darkMode: "dark" === e3.palette.mode };
|
|
1429
1430
|
}, a2 = n2(t2);
|
|
1430
|
-
o2.body = n2(e2), o2.header = { ...o2.body, strokeFill:
|
|
1431
|
-
const r2 =
|
|
1432
|
-
o2.headerSelect = { ...o2.header, strokeFill: e2.palette.primary.main, fill: Oa(r2, 0.2), text: { ...o2.header.text, fill: e2.palette.primary.main }, dividerStrokeFill: Oa(r2, 0.7) }, o2.headerSelectAll = { ...o2.headerSelect, fill: Oa(r2, 0.9), text: { ...o2.headerSelect.text, fill: e2.palette.primary.contrastText }, edgeStrokeFill: o2.headerSelect.strokeFill }, o2.buttonSurface = { ...a2, strokeFill:
|
|
1431
|
+
o2.body = n2(e2), o2.header = { ...o2.body, strokeFill: Go(o2.body.fill, zl, e2.palette?.mode), fill: t2 && "dark" === e2.palette.mode && t2.palette.mode !== e2.palette.mode ? o2.body.fill : Go(o2.body.fill, 0.055, e2.palette?.mode), edgeStrokeFill: "dark" === e2.palette.mode ? o2.body.strokeFill : Go(o2.body.fill, 0.328, e2.palette?.mode) }, o2.headerHover = (t3) => ({ ...o2.header, strokeFill: Go(t3?.fill ?? o2.body.fill, 0.22, e2.palette?.mode), fill: Go(t3?.fill ?? o2.header.fill, 0.065, e2.palette?.mode), text: { ...t3?.text, fontWeight: e2.typography?.fontWeightBold } });
|
|
1432
|
+
const r2 = Go("dark" !== e2.palette.mode ? e2.palette.primary.light : e2.palette.primary.main, 0.055, e2.palette?.mode);
|
|
1433
|
+
o2.headerSelect = { ...o2.header, strokeFill: e2.palette.primary.main, fill: Oa(r2, 0.2), text: { ...o2.header.text, fill: e2.palette.primary.main }, dividerStrokeFill: Oa(r2, 0.7) }, o2.headerSelectAll = { ...o2.headerSelect, fill: Oa(r2, 0.9), text: { ...o2.headerSelect.text, fill: e2.palette.primary.contrastText }, edgeStrokeFill: o2.headerSelect.strokeFill }, o2.buttonSurface = { ...a2, strokeFill: Go(a2.fill, zl, t2.palette?.mode), fill: t2 && "dark" === t2.palette.mode && t2.palette.mode !== e2.palette.mode ? a2.fill : Go(a2.fill, 0.055, t2.palette?.mode), edgeStrokeFill: "dark" === t2.palette.mode ? a2.strokeFill : Go(a2.fill, 0.328, t2.palette?.mode) }, o2.headerSelection = { fill: e2.palette?.primary?.main ? Oa(e2.palette?.primary?.main, 0.1) : void 0, strokeFill: e2.palette?.primary?.main }, o2.headerSelectionInactive = { ...o2.headerSelection, fill: e2.palette?.divider ? Oa(e2.palette?.divider, 0.05) : void 0, strokeFill: "transparent" };
|
|
1433
1434
|
const l2 = t2 ?? e2, i2 = "dark" === l2.palette.mode;
|
|
1434
1435
|
return o2.selection = { fill: l2.palette?.primary?.main ? Oa(l2.palette?.primary?.main, 0.1) : void 0, strokeFill: l2.palette?.primary?.main }, o2.selectionInactive = { ...o2.selection, fill: l2.palette?.divider ? Oa(l2.palette?.divider, 0.05) : void 0, strokeFill: "transparent" }, o2.selectionRemove = { ...o2.selection, fill: Oa(l2.palette.warning.light, 0.05), strokeFill: l2.palette.warning.dark }, t2 && (o2.body = n2(t2)), o2.colorShadow = Oa(l2.palette.action.active, 0.5), o2.colorGrey = l2.palette.action.active, o2.filterDarkInvert = i2 ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", o2;
|
|
1435
|
-
}, Ol =
|
|
1436
|
-
const { children: o2, sx: n2, parentFloat: a2, ...r2 } = e2, l2 =
|
|
1437
|
-
|
|
1436
|
+
}, Ol = L(H((e2, t2) => {
|
|
1437
|
+
const { children: o2, sx: n2, parentFloat: a2, ...r2 } = e2, l2 = Pa(t2, () => ({}), []), [i2, s2] = Xa(), d2 = U(null), c2 = U(null), [m2, p2] = I.useReducer((e3) => e3 + 1, 0), [u2, g2] = O(null), [h2, f2] = O(null), [x2, b2] = O(null), { reference: y2 } = Eo({ parentFloat: a2, label: "overflow" });
|
|
1438
|
+
K(() => {
|
|
1438
1439
|
c2.current = { refs: [] };
|
|
1439
|
-
const e3 = [], t3 =
|
|
1440
|
+
const e3 = [], t3 = I.Children.toArray(o2);
|
|
1440
1441
|
let n3 = 0;
|
|
1441
1442
|
t3.forEach((o3, a3) => {
|
|
1442
|
-
e3.push(
|
|
1443
|
+
e3.push(N(X, { sx: { display: "flex" }, ref: (e4) => {
|
|
1443
1444
|
n3++, n3 === t3.length && p2();
|
|
1444
1445
|
const o4 = { current: null };
|
|
1445
1446
|
o4.current = e4, c2.current.refs[a3] = o4;
|
|
1446
1447
|
}, children: o3 }, a3));
|
|
1447
1448
|
}), g2(e3);
|
|
1448
|
-
}, [o2, s2]),
|
|
1449
|
+
}, [o2, s2]), K(() => {
|
|
1449
1450
|
if (!u2) return;
|
|
1450
1451
|
const e3 = c2.current.refs, t3 = e3 ? e3.length : 0;
|
|
1451
|
-
if (!l2.current || 0 === t3) return f2(null), void
|
|
1452
|
+
if (!l2.current || 0 === t3) return f2(null), void b2(null);
|
|
1452
1453
|
const o3 = l2.current?.getBoundingClientRect(), n3 = [], a3 = [];
|
|
1453
1454
|
let r3 = 0, i3 = false;
|
|
1454
1455
|
for (let n4 = 0; !i3 && n4 < t3; n4++) {
|
|
@@ -1461,7 +1462,7 @@ const Hl = async (e2) => {
|
|
|
1461
1462
|
const a4 = t4.current.getBoundingClientRect();
|
|
1462
1463
|
r3 += a4?.width, r3 > o3.width && (i3 = true);
|
|
1463
1464
|
}
|
|
1464
|
-
if (!i3) return f2(null), void
|
|
1465
|
+
if (!i3) return f2(null), void b2([]);
|
|
1465
1466
|
const s3 = d2.current?.getBoundingClientRect();
|
|
1466
1467
|
r3 = 0;
|
|
1467
1468
|
for (let l3 = 0; l3 < t3; l3++) {
|
|
@@ -1473,23 +1474,23 @@ const Hl = async (e2) => {
|
|
|
1473
1474
|
}
|
|
1474
1475
|
i4 ? n3.push(u2[l3]) : a3.push(u2[l3]);
|
|
1475
1476
|
}
|
|
1476
|
-
f2(n3.length > 0 ? n3 : null),
|
|
1477
|
-
}, [o2, u2, s2,
|
|
1478
|
-
const
|
|
1479
|
-
const t3 = [], o3 =
|
|
1477
|
+
f2(n3.length > 0 ? n3 : null), b2(a3.length > 0 ? a3 : null);
|
|
1478
|
+
}, [o2, u2, s2, y2, m2]);
|
|
1479
|
+
const w2 = wa((e3) => {
|
|
1480
|
+
const t3 = [], o3 = x2.length;
|
|
1480
1481
|
for (let n4 = 0; n4 < o3; n4++) {
|
|
1481
|
-
const o4 =
|
|
1482
|
-
|
|
1482
|
+
const o4 = I.Children.toArray(x2[n4])[0];
|
|
1483
|
+
I.Children.toArray(o4.props.children?.props?.children ?? o4.props.children).forEach((o5, a3) => {
|
|
1483
1484
|
const r3 = o5, l3 = { ...r3.props, key: `overflow-${n4}-${a3}${r3.key ?? ""}` };
|
|
1484
1485
|
l3.parentFloat && e3 && (l3.parentFloat = e3.floatReference);
|
|
1485
|
-
const i3 =
|
|
1486
|
+
const i3 = I.cloneElement(r3, l3);
|
|
1486
1487
|
t3.push(i3);
|
|
1487
1488
|
});
|
|
1488
1489
|
}
|
|
1489
|
-
const n3 =
|
|
1490
|
-
return
|
|
1491
|
-
}, [
|
|
1492
|
-
return
|
|
1490
|
+
const n3 = N(X, { className: "overflow-palette-popup-panel", sx: { display: "flex", flexDirection: "row", flexWrap: "wrap", rowGap: (e4) => e4.spacing(0.25), paddingTop: (e4) => e4.spacing(0.5), paddingBottom: (e4) => e4.spacing(0.5), paddingLeft: (e4) => e4.spacing(1), paddingRight: (e4) => e4.spacing(1), overflow: "hidden" }, children: t3 });
|
|
1491
|
+
return Te({ ...e3, children: n3 });
|
|
1492
|
+
}, [x2]);
|
|
1493
|
+
return E(X, { className: "overflow-palette", sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", width: "100%", maxWidth: "100%", ...n2 }, ref: Ua([l2, i2, t2]), ...r2, children: [N(X, { sx: { flexDirection: "row", display: "flex", maxWidth: "100%", flex: "1 1 100%" }, children: h2 ?? u2 }), N(X, { sx: { display: null !== x2 && 0 === x2.length ? "none" : "flex", flex: "1 1 0" }, children: N(Ue, { createPopupPanel: w2, ref: d2, parentFloat: y2, createTooltip: ({ children: e3 }, t3) => N(Je, { label: "More", description: "More toolbar options…", disabled: t3, children: e3 }), icon: N(Uo, { children: N(pa, {}) }) }) })] });
|
|
1493
1494
|
})), Vl = "https://unpkg.com/@sheetxl/scripting-templates/dist", Gl = (e2) => {
|
|
1494
1495
|
if (e2.metadata?.name) return e2.metadata.name;
|
|
1495
1496
|
let t2 = (e2.path.split("/").pop() || "").replace(/\.[^/.]+$/, "");
|
|
@@ -1521,19 +1522,19 @@ const Hl = async (e2) => {
|
|
|
1521
1522
|
return null;
|
|
1522
1523
|
});
|
|
1523
1524
|
return (await Promise.all(r2)).filter((e3) => null !== e3);
|
|
1524
|
-
}, jl = { fontSize: "0.8rem", marginRight: "4px" }, _l =
|
|
1525
|
+
}, jl = { fontSize: "0.8rem", marginRight: "4px" }, _l = L((e2) => {
|
|
1525
1526
|
const { disabled: t2, snippet: o2, description: n2, handleInsert: a2, sx: r2, ...l2 } = e2;
|
|
1526
1527
|
let i2;
|
|
1527
|
-
return i2 = "formula" === o2.metadata?.icon ?
|
|
1528
|
+
return i2 = "formula" === o2.metadata?.icon ? N(_o, { sx: jl }) : "macro" === o2.metadata?.icon ? N(qo, { sx: jl }) : N(ua, { sx: jl }), N(qe, { sx: { maxWidth: "460px", display: "flex", "*": { lineHeight: "1.2" }, ...r2 }, disabled: t2, icon: i2, onMouseDown: (e3) => {
|
|
1528
1529
|
0 === e3.button && e3.preventDefault();
|
|
1529
1530
|
}, onMouseUp: (e3) => {
|
|
1530
1531
|
0 === e3.button && a2(o2);
|
|
1531
1532
|
}, onKeyDown: (e3) => {
|
|
1532
|
-
e3.keyCode !==
|
|
1533
|
-
}, ...l2, children:
|
|
1534
|
-
}), ql =
|
|
1535
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, scriptPath: l2 = Vl, ...i2 } = e2, [s2, d2] =
|
|
1536
|
-
|
|
1533
|
+
e3.keyCode !== Sa.Enter && e3.keyCode !== Sa.Space || a2(o2);
|
|
1534
|
+
}, ...l2, children: E(X, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden" }, children: [N(Z, { component: "div", children: o2.metadata?.title ?? o2.path }), N(Z, { variant: "caption", component: "div", sx: { color: (e3) => Oa(e3.palette.text.secondary ?? e3.palette.text.primary, 0.6), overflow: "hidden", textOverflow: "ellipsis" }, children: o2.metadata?.summary })] }) });
|
|
1535
|
+
}), ql = L(H((e2, t2) => {
|
|
1536
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, scriptPath: l2 = Vl, ...i2 } = e2, [s2, d2] = O([]), [c2, m2] = O(true), p2 = ba(o2, ["executeSelectedScript"]), u2 = p2[0]?.context?.();
|
|
1537
|
+
V(() => {
|
|
1537
1538
|
(async () => {
|
|
1538
1539
|
try {
|
|
1539
1540
|
const e3 = await Ul(l2);
|
|
@@ -1544,30 +1545,30 @@ const Hl = async (e2) => {
|
|
|
1544
1545
|
}
|
|
1545
1546
|
})();
|
|
1546
1547
|
}, [l2]);
|
|
1547
|
-
const g2 =
|
|
1548
|
-
if (c2) return
|
|
1549
|
-
const a3 = { variant:
|
|
1548
|
+
const g2 = z((e3, t3) => {
|
|
1549
|
+
if (c2) return N("div", { children: "Loading..." });
|
|
1550
|
+
const a3 = { variant: ya.Menuitem, commandHook: n2, scope: "scripts", disabled: r2 }, l3 = (t4) => {
|
|
1550
1551
|
u2.getEditor()?.insertSnippet(t4.content), e3.closeFloat();
|
|
1551
1552
|
}, i3 = [];
|
|
1552
1553
|
for (let e4 = 0; e4 < s2.length; e4++) {
|
|
1553
1554
|
const t4 = s2[e4];
|
|
1554
|
-
t4 && i3.push(
|
|
1555
|
+
t4 && i3.push(N(_l, { handleInsert: l3, snippet: t4 }, t4.path));
|
|
1555
1556
|
}
|
|
1556
|
-
const d3 =
|
|
1557
|
-
return
|
|
1557
|
+
const d3 = E(X, { sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [i3.length > 0 ? E(A, { children: [N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: i3 }), N(Se, { orientation: "horizontal" })] }) : null, j(ke, { ...a3, key: "help", command: o2.getCommand("help"), icon: we(N(io, {})) })] });
|
|
1558
|
+
return Te({ ...e3, children: d3 });
|
|
1558
1559
|
}, [r2, n2, a2, c2, u2]);
|
|
1559
|
-
return
|
|
1560
|
-
})), Kl =
|
|
1561
|
-
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, l2 =
|
|
1560
|
+
return N(De, { ref: t2, commands: o2, disabled: r2, commandHook: n2, scope: a2, label: "Insert Script", tooltip: "Inserts a script from a set of templates.", createPopupPanel: g2, icon: we(N(jo, {})), ...i2 });
|
|
1561
|
+
})), Kl = L(H((e2, t2) => {
|
|
1562
|
+
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, l2 = wa((e3) => {
|
|
1562
1563
|
const { commandButtonProps: t3, commandPopupProps: a3 } = e3;
|
|
1563
|
-
return
|
|
1564
|
+
return N(A, { children: E("div", { style: { display: "flex", flex: "1 1 100%" }, children: [N("div", { children: N(Ol, { parentFloat: n2, style: {}, children: N(ke, { ...t3, command: o2.getCommand("saveScripts"), icon: we(N(Ko, {})) }) }) }), N("div", { style: { flex: "1 1 100%" } }), N("div", { children: N(Ol, { parentFloat: n2, style: {}, children: N(ql, { ...t3, commands: o2 }) }) })] }) });
|
|
1564
1565
|
}, [o2]);
|
|
1565
|
-
return
|
|
1566
|
+
return N(Xo, { ref: t2, commands: o2, parentFloat: n2, commandButtonProps: a2, createToolbarPalette: l2, ...r2 });
|
|
1566
1567
|
}));
|
|
1567
1568
|
Kl.displayName = "ScriptEditorToolbar";
|
|
1568
|
-
const Xl = { fontSize: "1rem" }, Zl =
|
|
1569
|
-
const { scriptPath: o2 = Vl, onScriptSelect: n2, sx: a2 =
|
|
1570
|
-
if (
|
|
1569
|
+
const Xl = { fontSize: "1rem" }, Zl = L(H((e2, t2) => {
|
|
1570
|
+
const { scriptPath: o2 = Vl, onScriptSelect: n2, sx: a2 = ka.EmptyCssProperties, className: r2, buttonMinWidth: l2 = 210, buttonMinHeight: i2 = 80, gap: s2 = 12, ...d2 } = e2, [c2, m2] = O([]), [p2, u2] = O(true), [g2, h2] = O(null);
|
|
1571
|
+
if (V(() => {
|
|
1571
1572
|
(async () => {
|
|
1572
1573
|
const e3 = [{ path: null, metadata: { title: "Blank Template...", summary: "Start with an empty script." }, content: "" }];
|
|
1573
1574
|
try {
|
|
@@ -1583,64 +1584,64 @@ const Xl = { fontSize: "1rem" }, Zl = k(S((e2, t2) => {
|
|
|
1583
1584
|
m2(e3), u2(false);
|
|
1584
1585
|
}
|
|
1585
1586
|
})();
|
|
1586
|
-
}, [o2]), p2) return
|
|
1587
|
+
}, [o2]), p2) return N(X, { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", className: Yn(r2, "script-select"), sx: { background: (e3) => e3.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})`, ...a2 }, ...d2, children: N(me, {}) });
|
|
1587
1588
|
let f2 = null;
|
|
1588
|
-
g2 && (f2 =
|
|
1589
|
-
const
|
|
1589
|
+
g2 && (f2 = E(X, { display: "flex", justifyContent: "center", alignItems: "center", className: Yn(r2, "script-select", "error-results"), sx: { background: (e3) => e3.palette.error.light, flex: "0", zIndex: 1e3, flexDirection: "column", padding: (e3) => e3.spacing(1), border: (e3) => `1px solid ${e3.palette.error.main}`, borderBottomLeftRadius: 1, borderBottomRightRadius: 1, backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})` }, ...d2, children: [N(Z, { color: "error", variant: "h6", component: "div", gutterBottom: true, children: "Error loading Templates" }), N(Z, { color: "error", component: "div", children: g2 })] }));
|
|
1590
|
+
const x2 = (e3) => {
|
|
1590
1591
|
const t3 = e3.metadata?.icon;
|
|
1591
|
-
return "macro" === t3 ?
|
|
1592
|
+
return "macro" === t3 ? N(qo, { sx: Xl }) : "formula" === t3 ? N(_o, { sx: Xl }) : "autostart" === t3 ? N(ua, { sx: Xl }) : null;
|
|
1592
1593
|
};
|
|
1593
|
-
return
|
|
1594
|
+
return E(X, { ref: t2, className: Yn(r2, "script-select"), sx: { background: (e3) => e3.palette.background.paper, zIndex: 1e3, backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})`, ...a2 }, ...d2, children: [E(X, { p: 3, className: "script-select-content", sx: { overflow: "auto", flex: "1 1 auto" }, children: [N(Z, { variant: "h6", gutterBottom: true, children: "Script Template" }), N(Z, { variant: "body2", component: "div", color: "text.secondary", gutterBottom: true, children: "Choose from a template to provide a starting point to automate tasks or create user defined functions." }), N(Z, { variant: "body2", component: "div", color: "text.secondary", gutterBottom: true, children: "Templates provide a foundation to customize and meet your specific needs." }), N(X, { sx: { display: "grid", gridTemplateColumns: `repeat(auto-fill, minmax(${l2}px, 1fr))`, gap: `${s2}px`, padding: 2, paddingLeft: "0px", paddingRight: "0px" }, children: c2.map((e3, t3) => E(ee, { variant: "outlined", sx: { minWidth: l2, minHeight: i2, display: "flex", flexDirection: "column", justifyContent: "flex-start", alignItems: "flex-start", textAlign: "left", padding: 2, textTransform: "none", overflow: "hidden", ...0 === t3 && { borderStyle: "dashed", marginBottom: "8px" }, ...1 === t3 && { gridColumn: "1" } }, onClick: () => n2?.(e3), children: [E(X, { sx: { display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%", marginBottom: 0.5 }, children: [N(Z, { variant: "subtitle2", component: "div", children: e3.metadata?.title || e3.path.split("/").pop()?.replace(/\.\w+$/, "") || "Untitled" }), x2(e3)] }), e3.metadata?.summary && N(Z, { variant: "body2", component: "div", color: "text.secondary", sx: { overflow: "hidden", display: "flex", flexDirection: "column", textOverflow: "ellipsis", alignItems: "flex-start" }, children: e3.metadata.summary })] }, `${e3.path}-${t3}`)) })] }), f2] });
|
|
1594
1595
|
}));
|
|
1595
1596
|
Zl.displayName = "TemplateSelectPanel";
|
|
1596
|
-
const Jl =
|
|
1597
|
-
const { className: o2, sx: n2, editorProps: a2, commands: r2, readOnly: l2 = false, onClose: i2, autoFocusSel: s2, autoFocus: d2 = true, scripts: c2, ...m2 } = e2, p2 =
|
|
1598
|
-
|
|
1597
|
+
const Jl = L(H((e2, t2) => {
|
|
1598
|
+
const { className: o2, sx: n2, editorProps: a2, commands: r2, readOnly: l2 = false, onClose: i2, autoFocusSel: s2, autoFocus: d2 = true, scripts: c2, ...m2 } = e2, p2 = Ha(), [u2, g2] = O(false), h2 = U(false), [f2, x2] = O({ message: "Loading", cursor: "", dirty: false }), [b2, y2] = O(null);
|
|
1599
|
+
V(() => {
|
|
1599
1600
|
let e3 = false;
|
|
1600
|
-
return
|
|
1601
|
+
return y2(null), (async function() {
|
|
1601
1602
|
if (c2 && (await c2.start(), !e3)) {
|
|
1602
1603
|
const e4 = c2.getModules().getItems()[0]?.getSource();
|
|
1603
|
-
|
|
1604
|
+
y2({ source: e4 || null });
|
|
1604
1605
|
}
|
|
1605
1606
|
})(), () => {
|
|
1606
1607
|
e3 = true;
|
|
1607
1608
|
};
|
|
1608
1609
|
}, [c2]);
|
|
1609
|
-
const
|
|
1610
|
-
|
|
1611
|
-
}, []),
|
|
1612
|
-
if (
|
|
1610
|
+
const w2 = z((e3) => {
|
|
1611
|
+
x2((t3) => ({ ...t3, ...e3 }));
|
|
1612
|
+
}, []), k2 = U(null), S2 = U(null), [v2, T2] = O(null), D2 = U(null), P2 = wa((e3) => {
|
|
1613
|
+
if (v2) return v2.focus(e3), true;
|
|
1613
1614
|
if (s2) {
|
|
1614
|
-
const t3 =
|
|
1615
|
+
const t3 = S2.current?.querySelectorAll?.(s2);
|
|
1615
1616
|
if (t3 && t3.length > 0) return t3[0]?.focus?.(e3), true;
|
|
1616
1617
|
}
|
|
1617
|
-
return
|
|
1618
|
-
}, [
|
|
1619
|
-
e3.isDefaultPrevented() || (e3.preventDefault(),
|
|
1620
|
-
}, children:
|
|
1621
|
-
|
|
1618
|
+
return S2.current?.focus?.(e3), false;
|
|
1619
|
+
}, [v2, s2, d2]), R2 = W(() => N(Ve, { transitionDelay: "160ms", style: { position: "absolute", width: "100%", height: "100%" }, transparentBackground: false }), []), M2 = W(() => N(ce, { elevation: 1, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})`, marginLeft: (e3) => e3.spacing(0.5), marginRight: (e3) => e3.spacing(0.5), marginTop: (e3) => e3.spacing(1), marginBottom: (e3) => e3.spacing(1) }, children: N(Kl, { commands: r2 }) }), [p2, r2]), F2 = W(() => N(X, { className: Yn("script-status-panel", "status-panel"), sx: { display: "flex", alignItems: "stretch", flexDirection: "row", flex: "0", paddingLeft: "12px", paddingRight: "12px", gap: "8px", paddingTop: "1px", minHeight: "calc(1em + 8px)", margin: 0, borderTop: `solid 1px ${p2.palette.divider}` }, children: E("div", { style: { flex: "1 1 100%", display: "flex", alignItems: "center", flexDirection: "row", justifyContent: "center" }, children: [N(Z, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "1 1 100%", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.message }), N(Z, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.dirty ? "Unsaved" : "" }), N(Z, { component: "div", sx: { userSelect: "none", whiteSpace: "pre", overflow: "hidden", textOverflow: "ellipsis", flex: "none", marginLeft: "8px", minWidth: "90px", display: "flex", justifyContent: "end", color: (e3) => e3.palette.text.secondary }, variant: "caption", children: f2.cursor })] }) }), [f2]), B2 = W(() => E(X, { className: Yn("script-editor-content"), sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "column", boxSizing: "border-box" }, children: [M2, N(X, { sx: { display: "flex", flex: "1 1 100%", width: "100%", flexDirection: "row", position: "relative", boxSizing: "border-box" }, children: N(C, { ref: S2, loadingPanel: R2, readOnly: l2, onClose: i2, autoFocus: d2, commands: r2, onStatusChange: w2, darkMode: "dark" === p2.palette.mode, ...a2 }) }), F2] }), [p2, r2, M2, F2, u2, R2, l2, a2, d2, s2, i2, w2]), A2 = W(() => N(pe, { className: Yn({ "Mui-selected": h2.current }), sx: { display: "flex", color: (e3) => e3.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: (e3) => `${e3.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: (e3) => e3.transitions.duration.shortest / 2 + "ms" }, backgroundColor: (e3) => Wa(e3.palette.action.hover, 0.03), borderBottom: (e3) => `solid ${Wa(e3.palette.divider, 0.2)} 1px` }, onPointerDown: (e3) => {
|
|
1620
|
+
e3.isDefaultPrevented() || (e3.preventDefault(), P2());
|
|
1621
|
+
}, children: E(X, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: (e3) => e3.spacing(0.25), marginBottom: (e3) => e3.spacing(0.25), marginLeft: (e3) => e3.spacing(1), marginRight: (e3) => e3.spacing(1) }, children: [N(X, { sx: { flex: "1 1 100%", paddingLeft: (e3) => e3.spacing(1) }, children: "Script (Typescript)" }), N(Je, { label: "Close", children: N(J, { "aria-label": "close", sx: { color: (e3) => e3.palette.text.icon ?? e3.palette.action.active }, touchRippleRef: k2, onPointerDown: (e3) => {
|
|
1622
|
+
k2.current?.start(e3, { center: false }), e3.stopPropagation(), e3.preventDefault();
|
|
1622
1623
|
}, onPointerUp: () => {
|
|
1623
|
-
|
|
1624
|
-
}, children:
|
|
1624
|
+
S2.current?.close();
|
|
1625
|
+
}, children: N(ga, {}) }) })] }) }), [p2, u2]), I2 = W(() => {
|
|
1625
1626
|
let e3;
|
|
1626
|
-
return null ===
|
|
1627
|
-
|
|
1628
|
-
} })),
|
|
1629
|
-
e4.isDefaultPrevented() ||
|
|
1630
|
-
}, children: [
|
|
1631
|
-
}, [
|
|
1632
|
-
|
|
1627
|
+
return null === b2 ? null : (null === b2.source && (e3 = N(Zl, { sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", position: "absolute", boxSizing: "border-box", width: "100%", height: "100%" }, onScriptSelect: (e4) => {
|
|
1628
|
+
S2.current?.getEditor().insertSnippet(e4.content), y2({ source: e4.content ?? "" });
|
|
1629
|
+
} })), E(X, { tabIndex: 0, className: Yn("script-workspace", o2), sx: { display: "flex", flex: "1 1 100%", flexDirection: "column", overflow: "hidden", alignItems: "stretch", userSelect: "none", flexGrow: 0, outline: "none", backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})` }, onPointerDown: (e4) => {
|
|
1630
|
+
e4.isDefaultPrevented() || S2.current?.focus();
|
|
1631
|
+
}, children: [A2, E(X, { sx: { flex: "1 1 100%", position: "relative", display: "flex" }, children: [B2, e3] })] }));
|
|
1632
|
+
}, [M2, B2, o2, b2]), L2 = Pa(t2, () => ({ isScriptWorkspaceElement: () => true, focus: (e3) => {
|
|
1633
|
+
P2(e3);
|
|
1633
1634
|
} }), []);
|
|
1634
|
-
return
|
|
1635
|
-
g2(true), h2.current = true,
|
|
1635
|
+
return N(X, { sx: { display: "flex", flexDirection: "row", flex: "1 1 100%", position: "relative", ...n2 }, ref: L2, ...m2, onFocus: (e3) => {
|
|
1636
|
+
g2(true), h2.current = true, L2.current?.contains(e3.target) && e3.target !== L2.current && T2(e3.target), e3.relatedTarget && !D2.current && (D2.current = e3.relatedTarget), m2?.onFocus?.(e3);
|
|
1636
1637
|
}, onBlur: (e3) => {
|
|
1637
|
-
|
|
1638
|
-
}, children:
|
|
1638
|
+
L2?.current?.contains(e3.relatedTarget) || L2?.current === e3.relatedTarget || (D2.current = null, h2.current = false, g2(false)), m2?.onBlur?.(e3);
|
|
1639
|
+
}, children: I2 });
|
|
1639
1640
|
}));
|
|
1640
1641
|
Jl.displayName = "ScriptWorkspace";
|
|
1641
|
-
const Yl =
|
|
1642
|
-
const { commands: o2, ...n2 } = e2, a2 =
|
|
1643
|
-
|
|
1642
|
+
const Yl = L(H((e2, t2) => {
|
|
1643
|
+
const { commands: o2, ...n2 } = e2, a2 = ba(o2, ["executeScript", "showScriptEditor"]), [r2, l2] = O([]), [i2, s2] = O(false), d2 = a2[0]?.context?.();
|
|
1644
|
+
V(() => {
|
|
1644
1645
|
const e3 = d2?.getScripts();
|
|
1645
1646
|
if (!e3) return;
|
|
1646
1647
|
(async () => {
|
|
@@ -1649,24 +1650,24 @@ const Yl = k(S((e2, t2) => {
|
|
|
1649
1650
|
l2(t3), s2(false);
|
|
1650
1651
|
})();
|
|
1651
1652
|
}, []);
|
|
1652
|
-
const c2 = { variant:
|
|
1653
|
+
const c2 = { variant: ya.Menuitem, parentFloat: e2.floatReference, scope: "scripts", shortcut: null }, m2 = [], p2 = r2.length;
|
|
1653
1654
|
for (let e3 = 0; e3 < p2; e3++) {
|
|
1654
1655
|
const t3 = r2[e3];
|
|
1655
|
-
m2.push(
|
|
1656
|
+
m2.push(N(ke, { ...c2, command: o2.getCommand("executeScript"), commandState: { declaration: t3 }, tooltipProps: { description: `Execute ${t3.getName() ?? "macro"}` }, icon: we(N(qo, {})), label: t3.getName() ?? `Script '${t3.getName()}'` }, `macro-${t3.getName()}-${e3}`));
|
|
1656
1657
|
}
|
|
1657
|
-
const u2 =
|
|
1658
|
-
return
|
|
1658
|
+
const u2 = E(X, { ref: t2, sx: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden" }, children: [m2.length > 0 ? E(A, { children: [N(X, { sx: { overflow: "auto", flex: "1 1 100%" }, children: m2 }), N(Se, { orientation: "horizontal" })] }) : null, j(ke, { ...c2, key: "show-editor", command: o2.getCommand("showScriptEditor"), icon: we(N(Zo, {})) })] });
|
|
1659
|
+
return Te({ ...n2, children: u2 });
|
|
1659
1660
|
}));
|
|
1660
1661
|
Yl.displayName = "RunScriptPopupPanel";
|
|
1661
|
-
const Ql =
|
|
1662
|
-
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = "showScriptEditor", s2 =
|
|
1663
|
-
const o3 =
|
|
1664
|
-
return
|
|
1662
|
+
const Ql = L(H((e2, t2) => {
|
|
1663
|
+
const { commands: o2, commandHook: n2, scope: a2, disabled: r2 = false, ...l2 } = e2, i2 = "showScriptEditor", s2 = ba(o2, ["executeScript", "showScriptEditor"])[0].context(), d2 = z((e3, t3) => {
|
|
1664
|
+
const o3 = N(Yl, { ...e3, commands: t3 });
|
|
1665
|
+
return Te({ ...e3, children: o3 });
|
|
1665
1666
|
}, [r2, s2, n2, a2]);
|
|
1666
|
-
return
|
|
1667
|
-
})), ei =
|
|
1668
|
-
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, [l2, i2] =
|
|
1669
|
-
|
|
1667
|
+
return N(De, { ref: t2, commands: o2, commandHook: n2, createPopupPanel: d2, selected: o2.getCommand(i2).state(), label: "Macros", tooltip: "Run or manage macros.", quickCommand: i2, icon: we(N(Jo, {})), ...l2 });
|
|
1668
|
+
})), ei = L(H((e2, t2) => {
|
|
1669
|
+
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, [l2, i2] = O(false), s2 = ba(o2, ["executeScript", "showScriptEditor"]), d2 = s2[0]?.context?.();
|
|
1670
|
+
V(() => {
|
|
1670
1671
|
const e3 = d2?.getScripts();
|
|
1671
1672
|
if (!e3) return;
|
|
1672
1673
|
const t3 = s2[1], o3 = async () => {
|
|
@@ -1688,82 +1689,82 @@ const Ql = k(S((e2, t2) => {
|
|
|
1688
1689
|
a3(), n3();
|
|
1689
1690
|
};
|
|
1690
1691
|
}, [d2]);
|
|
1691
|
-
const c2 =
|
|
1692
|
-
const { commandButtonProps: t3, commandPopupProps: a3 } = e3, r3 =
|
|
1692
|
+
const c2 = z((e3) => {
|
|
1693
|
+
const { commandButtonProps: t3, commandPopupProps: a3 } = e3, r3 = N(Hr, { ...a3, command: o2.getCommand("formatFontColor"), icon: N(Yo, {}), isSplit: true, panelProps: { disableAlpha: true } }), i3 = N(Hr, { ...a3, command: o2.getCommand("formatFillColor"), icon: N(Qo, {}), isSplit: true, panelProps: { disableAlpha: true, autoColorLabel: "No Fill", autoColorPosition: sr.End } }), s3 = o2.getCommand("undo") ? N(A, { children: N(Or, { ...a3, quickCommand: "undo" }) }) : null, d3 = o2.getCommand("find") ? N(A, { children: N(Mr, { ...a3 }) }) : null;
|
|
1693
1694
|
let c3 = null;
|
|
1694
|
-
l2 && (c3 =
|
|
1695
|
-
return
|
|
1695
|
+
l2 && (c3 = E(A, { children: [N(Se, {}), N(Ql, { ...a3 })] }));
|
|
1696
|
+
return E(Ol, { parentFloat: n2, children: [s3, null, s3 ? N(Se, {}) : null, N(qr, { ...a3, command: o2.getCommand("paste") }), N(ke, { ...t3, command: o2.getCommand("formatPainterToggle"), icon: we(N(en, {})) }), N(hl, { ...t3, command: o2.getCommand("copy") }), N(Se, {}), N(Ur, { ...a3, command: o2.getCommand("formatFontFamily") }), N(Fr, { ...a3, command: o2.getCommand("formatFontSize") }), N(ke, { ...t3, command: o2.getCommand("formatBoldToggle"), icon: N(tn, {}) }), N(ke, { ...t3, command: o2.getCommand("formatItalicToggle"), icon: N(on, {}) }), N(_r, { ...a3 }), N(jr, { ...a3 }), r3, N(Se, {}), i3, N(Dr, { ...a3 }), N(Pr, { ...a3 }), N(Se, {}), N(nr, { ...a3 }), N(ar, { ...a3 }), N(rr, { ...a3 }), N(lr, { ...a3 }), N(Se, {}), N(Nr, { ...a3 }), N(Yr, { command: o2.getCommand("formatCellStyle"), ...a3 }), N(ll, { command: o2.getCommand("formatTableStyle"), ...a3 }), N(Se, {}), N(Ir, { ...a3 }), N(Lr, { ...a3 }), N(Se, {}), N(Ar, { ...a3 }), null, N(Er, { ...a3 }), N(zr, { ...a3 }), d3, c3] });
|
|
1696
1697
|
}, [o2, s2, l2]);
|
|
1697
|
-
return
|
|
1698
|
+
return N(Xo, { ref: t2, commands: o2, parentFloat: n2, commandButtonProps: a2, createToolbarPalette: c2, ...r2 });
|
|
1698
1699
|
}));
|
|
1699
1700
|
ei.displayName = "HomeToolbar";
|
|
1700
|
-
const ti =
|
|
1701
|
-
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, l2 =
|
|
1701
|
+
const ti = L(H((e2, t2) => {
|
|
1702
|
+
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, l2 = wa((e3) => {
|
|
1702
1703
|
const { commandButtonProps: t3, commandPopupProps: a3 } = e3;
|
|
1703
|
-
return
|
|
1704
|
+
return E(Ol, { parentFloat: n2, children: [null, N(ke, { ...t3, command: o2.getCommand("updateHyperlink"), icon: we(N(nn, {})) }), N(ke, { ...t3, command: o2.getCommand("updateComments"), icon: we(N(an, {})) }), N(gl, { ...a3 }), N(ke, { ...t3, command: o2.getCommand("insertTable"), icon: we(N(Ho, {})) })] });
|
|
1704
1705
|
}, [o2]);
|
|
1705
|
-
return
|
|
1706
|
+
return N(Xo, { ref: t2, commands: o2, parentFloat: n2, commandButtonProps: a2, createToolbarPalette: l2, ...r2 });
|
|
1706
1707
|
}));
|
|
1707
1708
|
ti.displayName = "InsertToolbar";
|
|
1708
|
-
const oi =
|
|
1709
|
-
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, l2 =
|
|
1709
|
+
const oi = L(H((e2, t2) => {
|
|
1710
|
+
const { commands: o2, parentFloat: n2, commandButtonProps: a2, ...r2 } = e2, l2 = wa((e3) => {
|
|
1710
1711
|
const { commandButtonProps: t3, commandPopupProps: a3 } = e3;
|
|
1711
|
-
return
|
|
1712
|
+
return E(Ol, { parentFloat: n2, children: [N(Rr, { ...a3 }), N(ke, { ...t3, command: o2.getCommand("protectionSheetToggle"), icon: N(ma, { color: "secondary" }) }), N(Se, {}), N(Wr, { ...a3 }), N(Kr, { ...a3 }), N(Se, {}), N(ke, { ...t3, command: o2.getCommand("sheetViewToggleFormulaView"), scope: "view", icon: we(N(rn, {})) }), N(ke, { ...t3, command: o2.getCommand("sheetViewToggleShowZeros"), scope: "view", icon: we(N(ln, {})) }), N(Se, {}), N(Xr, { ...a3 }), N(ml, { command: o2.getCommand("selectTheme"), ...a3 }), N(Se, {}), N(Ql, { ...a3, scope: "view" }), N(Se, {}), N(ke, { ...t3, command: o2.getCommand("fullScreenToggle"), scope: "view", icon: () => we(o2.getCommand("fullScreenToggle").state() ? N(sn, {}) : N(dn, {})) })] });
|
|
1712
1713
|
}, [o2]);
|
|
1713
|
-
return
|
|
1714
|
+
return N(Xo, { ref: t2, commands: o2, parentFloat: n2, commandButtonProps: a2, createToolbarPalette: l2, ...r2 });
|
|
1714
1715
|
}));
|
|
1715
1716
|
oi.displayName = "ViewToolbar";
|
|
1716
|
-
const ni = (e2) =>
|
|
1717
|
+
const ni = (e2) => N(ii, { ...e2 }), ai = L((e2) => {
|
|
1717
1718
|
const { sx: t2, ...o2 } = e2;
|
|
1718
|
-
return
|
|
1719
|
+
return E(X, { sx: { display: "flex", flexDirection: "column", position: "relative", "&:hover:not([disabled]) .indicator": { borderBottom: (e3) => `${Wa(e3.palette.primary.main, 0.35)} solid 2px` } }, children: [N(he, { disableRipple: true, onMouseDown: (e3) => {
|
|
1719
1720
|
0 === e3.button && e3.preventDefault();
|
|
1720
|
-
}, sx: { textTransform: "none", flex: "1 1 100%", fontWeight: (e3) => e3.typography.fontWeightRegular, padding: "2px 6px", minHeight: "0px", minWidth: "0px", marginRight: (e3) => e3.spacing(0.5), "&.Mui-selected": {}, "&.Mui-focusVisible": {}, ...t2 }, ...o2 }),
|
|
1721
|
-
}), ri =
|
|
1722
|
-
const { toolbars: t2, value: o2, onToolbarChange: n2, sx: a2, ...r2 } = e2, l2 =
|
|
1721
|
+
}, sx: { textTransform: "none", flex: "1 1 100%", fontWeight: (e3) => e3.typography.fontWeightRegular, padding: "2px 6px", minHeight: "0px", minWidth: "0px", marginRight: (e3) => e3.spacing(0.5), "&.Mui-selected": {}, "&.Mui-focusVisible": {}, ...t2 }, ...o2 }), N(X, { className: "indicator", sx: { width: "90%", borderRadius: "4px", minWidth: "4px", position: "absolute", bottom: "0", alignSelf: "center", display: "flex" } })] });
|
|
1722
|
+
}), ri = L((e2) => {
|
|
1723
|
+
const { toolbars: t2, value: o2, onToolbarChange: n2, sx: a2, ...r2 } = e2, l2 = W(() => {
|
|
1723
1724
|
const e3 = [];
|
|
1724
|
-
for (let o3 = 0; o3 < t2.length; o3++) e3.push(
|
|
1725
|
+
for (let o3 = 0; o3 < t2.length; o3++) e3.push(N(ai, { label: t2[o3].label }, t2[o3].label));
|
|
1725
1726
|
return e3;
|
|
1726
1727
|
}, [t2]);
|
|
1727
|
-
return
|
|
1728
|
+
return N(ge, { value: o2, onChange: (e3, t3) => {
|
|
1728
1729
|
n2?.(t3);
|
|
1729
|
-
}, variant: "scrollable", scrollButtons: false, sx: { paddingLeft: (e3) => e3.spacing(1.5), paddingRight: (e3) => e3.spacing(1.5), paddingTop: (e3) => e3.spacing(0), paddingBottom: (e3) => e3.spacing(0), minHeight: "26px", alignItems: "center", "& .MuiTabs-indicator": { display: "flex", justifyContent: "center", backgroundColor: "transparent" }, "& .MuiTabs-indicatorSpan": { width: "90%", borderRadius: "4px", minWidth: "4px", backgroundColor: (e3) => e3.palette.primary.main }, "& .MuiTab-root": { marginRight: "0px" }, ...a2 }, TabIndicatorProps: { children:
|
|
1730
|
-
}), li =
|
|
1731
|
-
const { toolbars: t2, value: o2, onToolbarChange: n2, selectProps: a2, ...r2 } = e2, l2 =
|
|
1730
|
+
}, variant: "scrollable", scrollButtons: false, sx: { paddingLeft: (e3) => e3.spacing(1.5), paddingRight: (e3) => e3.spacing(1.5), paddingTop: (e3) => e3.spacing(0), paddingBottom: (e3) => e3.spacing(0), minHeight: "26px", alignItems: "center", "& .MuiTabs-indicator": { display: "flex", justifyContent: "center", backgroundColor: "transparent" }, "& .MuiTabs-indicatorSpan": { width: "90%", borderRadius: "4px", minWidth: "4px", backgroundColor: (e3) => e3.palette.primary.main }, "& .MuiTab-root": { marginRight: "0px" }, ...a2 }, TabIndicatorProps: { children: N("span", { className: "MuiTabs-indicatorSpan" }) }, ...r2, children: l2 });
|
|
1731
|
+
}), li = L((e2) => {
|
|
1732
|
+
const { toolbars: t2, value: o2, onToolbarChange: n2, selectProps: a2, ...r2 } = e2, l2 = z((e3) => {
|
|
1732
1733
|
n2?.(e3.target.value);
|
|
1733
|
-
}, [n2]), i2 =
|
|
1734
|
+
}, [n2]), i2 = W(() => {
|
|
1734
1735
|
const e3 = [];
|
|
1735
1736
|
for (let n3 = 0; n3 < t2.length; n3++) {
|
|
1736
1737
|
const a3 = t2[n3].label;
|
|
1737
|
-
e3.push(
|
|
1738
|
+
e3.push(N(Y, { value: n3, sx: { color: (e4) => {
|
|
1738
1739
|
if (o2 === n3) return e4.palette.primary.main;
|
|
1739
1740
|
} }, children: a3 }, a3));
|
|
1740
1741
|
}
|
|
1741
1742
|
return e3;
|
|
1742
1743
|
}, [t2, o2]);
|
|
1743
|
-
return
|
|
1744
|
-
}), ii =
|
|
1745
|
-
const { commands: o2, selectWrapper: n2, selectProps: a2 = {}, renderCompact: r2 = false, paletteWrapper: l2, toolbarsProps: i2, paletteProps: s2 = {}, workbook: d2, sx: c2, ...m2 } = e2, p2 =
|
|
1744
|
+
return N(le, { sx: { minWidth: "125px", maxWidth: "125px", "& .MuiInputBase-root": { paddingLeft: "0px", paddingRight: "0px" }, "& .MuiSelect-select": { paddingTop: (e3) => e3.spacing(0.5), paddingBottom: (e3) => e3.spacing(0.5), paddingLeft: (e3) => e3.spacing(2), color: (e3) => e3.palette.primary.main }, "& .MuiSelect-icon": { fill: (e3) => e3.palette.text.icon ?? e3.palette.action.active, "&:hover:not(.Mui-disabled)": { color: (e3) => e3.palette.text.icon ?? e3.palette.action.active } }, ...a2 }, size: "small", children: N(ue, { value: o2, onChange: l2, variant: "outlined", sx: { backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})` }, ...r2, children: i2 }) });
|
|
1745
|
+
}), ii = L(H((e2, t2) => {
|
|
1746
|
+
const { commands: o2, selectWrapper: n2, selectProps: a2 = {}, renderCompact: r2 = false, paletteWrapper: l2, toolbarsProps: i2, paletteProps: s2 = {}, workbook: d2, sx: c2, ...m2 } = e2, p2 = W(() => {
|
|
1746
1747
|
const e3 = [], { ref: t3, ...n3 } = i2?.Home || {};
|
|
1747
|
-
e3.push({ label: "Home", component:
|
|
1748
|
+
e3.push({ label: "Home", component: N(ei, { commands: o2, ...n3 }) });
|
|
1748
1749
|
const { ref: a3, ...r3 } = i2?.Insert || {};
|
|
1749
|
-
e3.push({ label: "Insert", component:
|
|
1750
|
+
e3.push({ label: "Insert", component: N(ti, { commands: o2, ...r3 }) });
|
|
1750
1751
|
const { ref: l3, ...s3 } = i2?.View || {};
|
|
1751
|
-
return e3.push({ label: "View", component:
|
|
1752
|
-
}, [o2, d2]), u2 =
|
|
1752
|
+
return e3.push({ label: "View", component: N(oi, { commands: o2, ...s3 }) }), e3;
|
|
1753
|
+
}, [o2, d2]), u2 = W(() => {
|
|
1753
1754
|
const e3 = [];
|
|
1754
|
-
for (let t3 = 0; t3 < p2.length; t3++) e3.push(
|
|
1755
|
+
for (let t3 = 0; t3 < p2.length; t3++) e3.push(I.cloneElement(p2[t3].component, { ...p2[t3].component.props, key: p2[t3].key ?? p2[t3].label }));
|
|
1755
1756
|
return e3;
|
|
1756
|
-
}, [p2]), [g2, h2] =
|
|
1757
|
+
}, [p2]), [g2, h2] = O(0), f2 = (e3) => {
|
|
1757
1758
|
h2(e3);
|
|
1758
|
-
},
|
|
1759
|
-
return
|
|
1759
|
+
}, x2 = W(() => N(r2 ? li : ri, { toolbars: p2, value: g2, onToolbarChange: f2, sx: a2 }), [p2, g2, a2, r2]), { sx: b2, ...y2 } = s2, w2 = N(ce, { elevation: 2, tabIndex: 0, sx: { display: "flex", alignItems: "center", userSelect: "none", flexGrow: 1, borderRadius: "8px", backgroundImage: `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})`, marginLeft: (e3) => e3.spacing(1), marginRight: (e3) => e3.spacing(1), marginTop: (e3) => e3.spacing(0.5), marginBottom: (e3) => e3.spacing(0.5), ...b2 }, ...y2, children: u2[g2] });
|
|
1760
|
+
return E(X, { ref: t2, className: "toolbarWrappers", sx: { display: "flex", flexDirection: "column", paddingTop: (e3) => e3.spacing(0.5), "*": { userSelect: "none" }, ...c2 }, ...m2, children: [n2 ? n2(x2) : x2, l2 ? l2(w2) : w2] });
|
|
1760
1761
|
}));
|
|
1761
1762
|
ii.displayName = "WorkbookToolbars";
|
|
1762
1763
|
const si = (e2) => {
|
|
1763
|
-
const { workbook: t2, workbookElement: o2, notifier: n2, target: a2, commands: r2, darkMode: l2, onShowSidebar: i2, onNewWorkbook: s2 = di } = e2, [d2, c2] =
|
|
1764
|
+
const { workbook: t2, workbookElement: o2, notifier: n2, target: a2, commands: r2, darkMode: l2, onShowSidebar: i2, onNewWorkbook: s2 = di } = e2, [d2, c2] = O(t2?.getSelectedSheet()), [m2, p2] = O(t2?.getSheets().getItems()), g2 = wa(i2, [i2]), h2 = wa(s2, [s2]), f2 = W(() => [new Fa("workbookStatistics", a2, { label: "Workbook Statistics", description: "Show the workbook statistics.", shortcut: { key: "G", modifiers: [Na.Ctrl, Na.Shift] } }), new Fa("showFormat", a2, { label: "Show Format", description: "Open the format pane.", shortcut: { key: "F", modifiers: [Na.Ctrl, Na.Shift] } }), new Ba("newCellStyle", a2, { label: "New Cell Style…", scopedLabels: { cellStyle: "New Cell Style" }, description: "Create a new named style can can be quickly used later." }), new Ba("deleteCellStyle", a2, { label: "Delete Cell Style", scopedLabels: { cellStyle: "Delete" }, description: "Remove a named style that is no longer needed." }), new Ba("modifyCellStyle", a2, { label: "Modify Cell Style", scopedLabels: { cellStyle: "Modify" }, description: "Update a style with the currently style." }), new Fa("find", a2, { label: "Find", description: "Open the Find window.", shortcut: [{ key: "F", modifiers: [Na.Ctrl] }, { key: "F5", modifiers: [Na.Shift] }] }), new Fa("findReplace", a2, { label: "Find & Replace", description: "Open the Find & Replace window.", shortcut: [{ key: "H", modifiers: [Na.Ctrl] }, { key: "H", modifiers: [Na.Ctrl, Na.Alt] }] }), new Fa("goto", a2, { label: "Go To", description: "Open the 'Go To' window.", shortcut: [{ key: "G", modifiers: [Na.Ctrl] }] }), new Fa("workbookViewToggleExpandFormulaBar", a2, { label: "Toggle Expand Formula bar", description: "Expand or collapse the formula bar.", shortcut: { key: "U", modifiers: [Na.Ctrl, Na.Shift] } }), new Fa("workbookViewToggleShowFormulaBar", a2, { label: "View Formula bar", scopedLabels: { view: "Formula Bar" }, description: "Show or hide the formula bar." }), new Fa("workbookViewToggleShowTabs", a2, { label: "View Sheet Tabs", description: "Show or hide the sheet tabs.", scopedLabels: { view: "Sheet Tabs" } }), new Fa("workbookViewToggleShowStatusBar", a2, { label: "View Status Bar", description: "Show or hide the status bar.", scopedLabels: { view: "Status Bar" } }), new Fa("workbookViewToggleShowHorizontalScrollBar", a2, { label: "View Horizontal Scrollbar", description: "Show or hide the horizontal scrollbar.", scopedLabels: { view: "Horizontal Scrollbar" } }), new Fa("workbookViewToggleShowVerticalScrollBar", a2, { label: "View Vertical Scrollbar", description: "Show or hide the vertical scrollbar.", scopedLabels: { view: "Vertical Scrollbar" } }), new Ba("hideSheet", a2, { 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 Ba("deleteSheet", a2, { label: "Delete Sheet", scopedLabels: { sheet: "Delete" }, description: "Delete the sheet and all the data." }), new Ba("addSheet", a2, { label: "Insert Sheet", scopedLabels: { sheet: "Insert" }, description: "Insert sheet before the current sheet.", shortcut: [{ key: "F11", modifiers: [Na.Shift] }, { key: "F1", modifiers: [Na.Alt, Na.Shift] }] }), new Ba("duplicateSheet", a2, { label: "Duplicate Sheet", description: "Duplicate the current sheet.", scopedLabels: { sheet: "Duplicate" } }), new Ba("nextSheet", a2, { label: "Next Sheet", scopedLabels: { sheet: "Next" }, description: "Activate the next sheet.", shortcut: [{ key: "PageDown", modifiers: [Na.Ctrl] }] }), new Ba("previousSheet", a2, { label: "Previous Sheet", scopedLabels: { sheet: "Previous" }, description: "Activate the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [Na.Ctrl] }] }), new Ba("selectNextSheet", a2, { label: "Select Next Sheet", scopedLabels: { sheet: "Select Next" }, description: "Select the next sheet.", shortcut: [{ key: "PageDown", modifiers: [Na.Ctrl, Na.Shift] }] }), new Ba("selectPreviousSheet", a2, { label: "Select Previous Sheet", scopedLabels: { sheet: "Select Previous" }, description: "Select the previous sheet.", shortcut: [{ key: "PageUp", modifiers: [Na.Ctrl, Na.Shift] }] }), new Ba("selectTheme", a2, { label: "Theme", description: "Select a theme that coveys a style suitable for your data." }), new Ba("selectNamed", a2, { label: (e3) => e3?.getName() ?? "Select Named Item", scopedLabels: { namedItem: (e3) => e3?.getName() ?? "Select" }, description: "Select the item." }), new Ba("addNamedReference", a2, { 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 Ba("editNamedReference", a2, { label: "Edit Named Reference…", scopedLabels: { namedItem: "Edit…" }, description: "Add a new named reference. Names can be used as a substitute for cell references." }), new Ba("deleteNamedReference", a2, { label: "Delete Named Reference", scopedLabels: { namedItem: "Delete" }, description: "Remove the named reference." }), new Fa("activeNameBox", a2, { label: "Activate Name Box", description: "Move the focus to the name box.", shortcut: { key: "F3", modifiers: [Na.Alt] } }), new Fa("createNamedReferenceFromSelection", a2, { label: "Create from Selection", description: "Automatically generate names from the selected cells.", shortcut: { key: "F3", modifiers: [Na.Ctrl, Na.Shift] } }), new Fa("activeNameManager", a2, { label: "Activate Name Manager", description: "Create, edit, delete, and find all the names used in the workbook.\n\nNames can be used as a substitute for cell references.", shortcut: { key: "F3", modifiers: [Na.Ctrl] } }), new Ba("fullScreenToggle", a2, { label: "FullScreen", description: "Toggle showing the workbook using the full screen.", shortcut: { key: "F11" } }), new Ba("showScriptEditor", a2, { label: "Scripts", scopedLabels: { scripts: "Script Editor…" }, description: "Show the script editor.", shortcut: [{ key: "F11", modifiers: [Na.Alt] }] }), new Ba("executeScript", a2, { label: "Run Script", description: "Run the selected or last executed script.", shortcut: { key: "F8" } }), new Ba("executeSelectedScript", a2, { label: "Run Script", description: "Run the selected script.", shortcut: { key: "F8" } }), new Ba("saveScripts", a2, { label: "Save Script", description: "Save the current scripts." }), new Ba("maximumWorkbookToggle", a2, { label: "Maximize", description: "Toggle showing the workbook maximized.", shortcut: { key: "F10", modifiers: [Na.Ctrl] } }), new Ba("spellCheck", a2, { label: "Spell Check", description: "Check the workbook for spelling mistakes.", shortcut: { key: "F7" } }), new Ba("calculateAll", a2, { label: "Calculate Now", description: "Recalculate all formulas.", shortcut: { key: "F9" } }), new Fa("closeWorkbook", a2, { label: "Close Workbook", description: "Close the workbook.", shortcut: { key: "W", modifiers: [Na.Ctrl] } }), new Fa("newWorkbook", a2, { label: "New Workbook", description: "Create a new workbook in another tab." })], []), x2 = W(() => {
|
|
1764
1765
|
let e3 = null;
|
|
1765
|
-
return e3 = r2 ? r2.createChildGroup(a2, "workbook", false) : new
|
|
1766
|
-
}, [r2, f2]), b2 =
|
|
1766
|
+
return e3 = r2 ? r2.createChildGroup(a2, "workbook", false) : new Ea(a2, "workbook"), e3.addCommands(f2, true), e3;
|
|
1767
|
+
}, [r2, f2]), b2 = va(), y2 = I.useRef(null), k2 = wa(() => {
|
|
1767
1768
|
let e3, o3 = null;
|
|
1768
1769
|
const a3 = x2.getCommand("executeScript");
|
|
1769
1770
|
if (a3.update({ disabled: false, context: { getScripts: () => t2.getScripts() } }), !a3) return;
|
|
@@ -1805,8 +1806,8 @@ const si = (e2) => {
|
|
|
1805
1806
|
return null;
|
|
1806
1807
|
}, getScripts: () => t2.getScripts() };
|
|
1807
1808
|
l3.update({ context: i3 });
|
|
1808
|
-
}, [x2, t2, o2, n2]), S2 =
|
|
1809
|
-
|
|
1809
|
+
}, [x2, t2, o2, n2]), S2 = I.useRef(null);
|
|
1810
|
+
w(t2, { onBeforeSave: async () => {
|
|
1810
1811
|
await S2.current?.onBeforeSave();
|
|
1811
1812
|
}, onProtectionChange: () => {
|
|
1812
1813
|
S2.current?.onReadonlyChange();
|
|
@@ -1814,7 +1815,7 @@ const si = (e2) => {
|
|
|
1814
1815
|
(async () => {
|
|
1815
1816
|
await t2.getCalculation().start(), t2.getScripts().start(), S2.current?.onScriptChange();
|
|
1816
1817
|
})();
|
|
1817
|
-
} }),
|
|
1818
|
+
} }), w(t2, { onSheetsChange: (e3) => {
|
|
1818
1819
|
p2(e3.getSheets().getItems());
|
|
1819
1820
|
}, onViewChange(e3) {
|
|
1820
1821
|
c2(e3?.getSelectedSheet());
|
|
@@ -1824,11 +1825,11 @@ const si = (e2) => {
|
|
|
1824
1825
|
}, onScriptsChange: (e3) => {
|
|
1825
1826
|
k2();
|
|
1826
1827
|
} });
|
|
1827
|
-
const { isFullscreenAvailable:
|
|
1828
|
-
|
|
1829
|
-
x2.getCommand("selectTheme").update({ state: () => t2.getTheme(), context: () => ({ theme: t2.getTheme(), themes:
|
|
1828
|
+
const { isFullscreenAvailable: C2, isFullscreenEnabled: T2, toggleFullscreen: D2 } = Ja({ target: { current: o2 ?? document.body } }), P2 = v();
|
|
1829
|
+
V(() => {
|
|
1830
|
+
x2.getCommand("selectTheme").update({ state: () => t2.getTheme(), context: () => ({ theme: t2.getTheme(), themes: P2, darkMode: l2 }) });
|
|
1830
1831
|
}, [t2?.getTheme(), l2]);
|
|
1831
|
-
const
|
|
1832
|
+
const R2 = wa(async function(e3, o3) {
|
|
1832
1833
|
let a3 = null;
|
|
1833
1834
|
const r3 = t2.getScripts();
|
|
1834
1835
|
if (e3?.declaration || e3?.functionName) {
|
|
@@ -1842,7 +1843,7 @@ const si = (e2) => {
|
|
|
1842
1843
|
return void n2?.showError?.(e4);
|
|
1843
1844
|
}
|
|
1844
1845
|
}, [t2, n2]);
|
|
1845
|
-
|
|
1846
|
+
V(() => {
|
|
1846
1847
|
x2.getCommand("newCellStyle").updateCallback((e3) => {
|
|
1847
1848
|
n2?.showInputOptions?.({ initialValue: (() => {
|
|
1848
1849
|
let e4 = 0;
|
|
@@ -1899,9 +1900,9 @@ const si = (e2) => {
|
|
|
1899
1900
|
"Close" === await n2?.showOptions({ title: "Confirm", description: "This will close the current workbook tab. Do you want to continue?", options: ["Close", "Cancel"], defaultOption: "Close" }) && window.close();
|
|
1900
1901
|
}), x2.getCommand("newWorkbook").updateCallback(() => {
|
|
1901
1902
|
h2?.();
|
|
1902
|
-
}), x2.getCommand("executeScript").updateCallback(
|
|
1903
|
+
}), x2.getCommand("executeScript").updateCallback(R2), x2.getCommand("executeSelectedScript").updateCallback(R2);
|
|
1903
1904
|
}, [t2, n2]);
|
|
1904
|
-
const
|
|
1905
|
+
const M2 = wa(async (e3) => {
|
|
1905
1906
|
let o3 = 0, a3 = null, r3 = "Find & Replace";
|
|
1906
1907
|
e3?.replace && !e3?.replaceOptions?.maxCount && (r3 = "Replace All");
|
|
1907
1908
|
const l3 = await n2?.showBusy?.(r3);
|
|
@@ -1921,7 +1922,7 @@ const si = (e2) => {
|
|
|
1921
1922
|
l3?.(), n2?.showError?.(e4);
|
|
1922
1923
|
}
|
|
1923
1924
|
return o3;
|
|
1924
|
-
}, [t2, o2]),
|
|
1925
|
+
}, [t2, o2]), F2 = wa((e3) => {
|
|
1925
1926
|
const o3 = { value: e3, context: { selection: () => {
|
|
1926
1927
|
const e4 = t2.getSelectedRanges(), o4 = [];
|
|
1927
1928
|
for (let t3 = 0; t3 < e4.getCount(); t3++) {
|
|
@@ -1933,14 +1934,14 @@ const si = (e2) => {
|
|
|
1933
1934
|
try {
|
|
1934
1935
|
await e4.select();
|
|
1935
1936
|
} catch (e5) {
|
|
1936
|
-
n2?.showMessage?.(e5.message, { type:
|
|
1937
|
+
n2?.showMessage?.(e5.message, { type: Da.Error });
|
|
1937
1938
|
}
|
|
1938
1939
|
} };
|
|
1939
1940
|
return n2.showWindow?.("namedDetails", o3);
|
|
1940
1941
|
}, [n2, t2, o2]);
|
|
1941
|
-
return
|
|
1942
|
+
return V(() => {
|
|
1942
1943
|
const e3 = (e4 = false) => {
|
|
1943
|
-
const o3 = t2.getSelectedCell(), a3 = { onFindOrReplace:
|
|
1944
|
+
const o3 = t2.getSelectedCell(), a3 = { onFindOrReplace: M2, onKeyDown: (e5) => {
|
|
1944
1945
|
x2.findCommandByEvent(e5) !== x2.getCommand("find") && x2.findCommandByEvent(e5) !== x2.getCommand("findReplace") || e5.preventDefault();
|
|
1945
1946
|
}, findOptions: {}, findText: o3.toTextUnformatted(true) };
|
|
1946
1947
|
a3.replace = e4, n2.showWindow?.("find", a3, { disableAutoDestroy: true });
|
|
@@ -1954,7 +1955,7 @@ const si = (e2) => {
|
|
|
1954
1955
|
try {
|
|
1955
1956
|
await t2.getRanges(e5).select();
|
|
1956
1957
|
} catch (e6) {
|
|
1957
|
-
n2?.showMessage?.(e6.message, { type:
|
|
1958
|
+
n2?.showMessage?.(e6.message, { type: Da.Error });
|
|
1958
1959
|
}
|
|
1959
1960
|
}, onKeyDown: (e5) => {
|
|
1960
1961
|
x2.findCommandByEvent(e5) === x2.getCommand("goto") && e5.preventDefault();
|
|
@@ -1967,15 +1968,15 @@ const si = (e2) => {
|
|
|
1967
1968
|
n2?.showError?.(e5);
|
|
1968
1969
|
}
|
|
1969
1970
|
}), x2.getCommand("addNamedReference")?.updateCallback(async function(e4) {
|
|
1970
|
-
|
|
1971
|
+
F2(null);
|
|
1971
1972
|
}), x2.getCommand("editNamedReference")?.updateCallback(async function(e4) {
|
|
1972
|
-
|
|
1973
|
+
F2(e4);
|
|
1973
1974
|
}), x2.getCommand("deleteNamedReference")?.updateCallback(async function(e4) {
|
|
1974
1975
|
e4?.delete?.();
|
|
1975
1976
|
}), x2.getCommand("activeNameBox")?.updateCallback(async function() {
|
|
1976
1977
|
o2?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus();
|
|
1977
1978
|
});
|
|
1978
|
-
}, [o2, t2, n2]),
|
|
1979
|
+
}, [o2, t2, n2]), w(t2?.getView(), { onViewChange: (e3) => {
|
|
1979
1980
|
x2.getCommand("workbookViewToggleShowFormulaBar").update({ state: e3.isShowFormulaBar() }).updateCallback(() => {
|
|
1980
1981
|
e3.setShowFormulaBar(!e3.isShowFormulaBar());
|
|
1981
1982
|
}), x2.getCommand("workbookViewToggleShowTabs").update({ state: e3.isShowTabs() }).updateCallback(() => {
|
|
@@ -1987,387 +1988,389 @@ const si = (e2) => {
|
|
|
1987
1988
|
}), x2.getCommand("workbookViewToggleShowVerticalScrollBar").update({ state: e3.isShowVerticalScrollbar() }).updateCallback(() => {
|
|
1988
1989
|
e3.setShowVerticalScrollbar(!e3.isShowVerticalScrollbar());
|
|
1989
1990
|
});
|
|
1990
|
-
} }),
|
|
1991
|
-
x2.getCommand("fullScreenToggle").update({ state: T2, disabled: !
|
|
1992
|
-
|
|
1991
|
+
} }), V(() => {
|
|
1992
|
+
x2.getCommand("fullScreenToggle").update({ state: T2, disabled: !C2 }).updateCallback(() => {
|
|
1993
|
+
D2();
|
|
1993
1994
|
});
|
|
1994
|
-
}, [T2,
|
|
1995
|
+
}, [T2, C2]), V(() => {
|
|
1995
1996
|
const e3 = t2.getProtection().isStructureAllowed();
|
|
1996
1997
|
x2.getCommand("hideSheet").update({ disabled: m2.length <= 1 || !e3 }), x2.getCommand("deleteSheet").update({ disabled: m2.length <= 1 || !e3 });
|
|
1997
1998
|
}, [m2, d2]), x2;
|
|
1998
1999
|
}, di = () => {
|
|
1999
2000
|
window.open(window.origin.toString(), "sheetxl-" + n.uuidV4(), "popup=true");
|
|
2000
|
-
}, ci = "_sheetxl-theme_4opcr_2", mi = "_sheetxl-
|
|
2001
|
-
const { workbook: o2, commands: n2, onBeforeUserChange: a2, onUserChange: r2, disabled: l2 = false, readOnly: i2 = false, contextMenuProps: s2, renderContextMenu: d2 = pi, sheetsAllProps: c2, renderSheetsAll: m2 = ui, sheetTabProps: p2, renderSheetTab: u2, background: g2 = "transparent", className: h2, notifier: f2, sx:
|
|
2002
|
-
|
|
2003
|
-
|
|
2001
|
+
}, ci = "_sheetxl-theme_4opcr_2", mi = "_sheetxl-workbook_g5t6x_5", pi = (e2) => N(Nl, { ...e2 }), ui = (e2) => N(El, { ...e2 }), gi = (e2) => N(Bl, { ...e2 }), hi = L(H((e2, t2) => {
|
|
2002
|
+
const { workbook: o2, commands: n2, onBeforeUserChange: a2, onUserChange: r2, disabled: l2 = false, readOnly: i2 = false, contextMenuProps: s2, renderContextMenu: d2 = pi, sheetsAllProps: c2, renderSheetsAll: m2 = ui, sheetTabProps: p2, renderSheetTab: u2, background: g2 = "transparent", className: h2, notifier: f2, sx: x2, borderWidth: b2, borderColor: y2, gridTheme: k2, gridStyle: S2, ...C2 } = e2, [v2, D2] = O(o2?.getSelectedSheetIndex()), [P2, R2] = O(o2?.getSheets().getItems()), [M2, F2] = O(o2?.getProtection());
|
|
2003
|
+
w(o2, { onViewChange(e3) {
|
|
2004
|
+
D2(e3?.getSelectedSheetIndex());
|
|
2004
2005
|
}, onSheetsChange: (e3) => {
|
|
2005
|
-
|
|
2006
|
+
R2(e3.getSheets().getItems());
|
|
2006
2007
|
}, onProtectionChange: (e3) => {
|
|
2007
|
-
|
|
2008
|
+
F2(e3?.getProtection());
|
|
2008
2009
|
} });
|
|
2009
|
-
const
|
|
2010
|
+
const B2 = i2 || !M2.isStructureAllowed(), A2 = W(() => {
|
|
2010
2011
|
const e3 = [];
|
|
2011
|
-
for (let t3 = 0; t3 <
|
|
2012
|
+
for (let t3 = 0; t3 < P2.length; t3++) e3.push(P2[t3].getName());
|
|
2012
2013
|
return e3;
|
|
2013
|
-
}, [
|
|
2014
|
+
}, [P2]), I2 = z((e3) => {
|
|
2014
2015
|
false !== a2?.(e3) && (o2.getSheetAt(e3).select(), r2?.(e3));
|
|
2015
|
-
}, [o2, a2, r2]),
|
|
2016
|
+
}, [o2, a2, r2]), L2 = z((e3, t3) => {
|
|
2016
2017
|
o2.getSheetAt(e3).setName(t3), r2?.(e3);
|
|
2017
|
-
}, [o2, r2]),
|
|
2018
|
+
}, [o2, r2]), H2 = z((e3, t3) => {
|
|
2018
2019
|
o2.getSheetAt(e3).setPosition(t3), r2?.(t3);
|
|
2019
|
-
}, [o2, r2]),
|
|
2020
|
-
if (false === a2?.(
|
|
2021
|
-
const e3 =
|
|
2020
|
+
}, [o2, r2]), $2 = wa(() => {
|
|
2021
|
+
if (false === a2?.(v2)) return;
|
|
2022
|
+
const e3 = v2 + 1;
|
|
2022
2023
|
o2.getSheets().add({ name: void 0, autoSelect: true }), r2?.(e3);
|
|
2023
|
-
}, [o2, a2, r2,
|
|
2024
|
+
}, [o2, a2, r2, v2]), G2 = W(() => ({ placement: "top-start" }), []), j2 = U(null), [_2, q2] = O(false), K2 = z((e3) => {
|
|
2024
2025
|
const { closeFloatAll: t3, floatReference: n3 } = e3;
|
|
2025
|
-
return m2({ workbook: o2, gridStyle:
|
|
2026
|
-
}, [m2, c2, l2, o2,
|
|
2026
|
+
return m2({ workbook: o2, gridStyle: S2, floatReference: n3, closeFloatAll: t3, ...c2 });
|
|
2027
|
+
}, [m2, c2, l2, o2, S2]), { reference: Z2, component: Y2 } = Eo({ label: "allSheet", popperProps: G2, anchor: j2.current, onOpen: () => q2(true), onClose: () => q2(false), createPopupPanel: K2 }), Q2 = U(null), [ee2, te2] = O(null), oe2 = z((e3) => {
|
|
2027
2028
|
const { floatReference: t3 } = e3;
|
|
2028
|
-
return d2?.({ workbook: o2, index:
|
|
2029
|
-
}, [d2, s2, l2, o2, n2,
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
}, [
|
|
2033
|
-
const
|
|
2034
|
-
e3.preventDefault(),
|
|
2035
|
-
}, []),
|
|
2029
|
+
return d2?.({ workbook: o2, index: ee2?.index, tabStripRef: Q2.current, commands: n2, disabled: l2, floatReference: t3, ...s2 });
|
|
2030
|
+
}, [d2, s2, l2, o2, n2, ee2]), { reference: ne2, component: ae2 } = Eo({ label: "sheetTab", popperProps: G2, anchor: { getBoundingClientRect: () => new DOMRect(ee2?.left || 0, ee2?.top || 0, 0, 0) }, onClose: () => te2(null), createPopupPanel: oe2 });
|
|
2031
|
+
V(() => {
|
|
2032
|
+
ee2 ? ne2.open(0) : ne2.close(0);
|
|
2033
|
+
}, [ee2]);
|
|
2034
|
+
const re2 = z((e3, t3) => {
|
|
2035
|
+
e3.preventDefault(), te2({ left: e3.clientX - 2, top: e3.clientY - 4, index: t3 });
|
|
2036
|
+
}, []), le2 = wa((e3) => {
|
|
2036
2037
|
let t3;
|
|
2037
2038
|
try {
|
|
2038
2039
|
t3 = o2?.getSheetAt(e3.index);
|
|
2039
2040
|
} catch (e4) {
|
|
2040
2041
|
}
|
|
2041
2042
|
if (!t3) return null;
|
|
2042
|
-
return (u2 ?? gi)({ sheet: t3, gridTheme:
|
|
2043
|
-
|
|
2043
|
+
return (u2 ?? gi)({ sheet: t3, gridTheme: k2, onContextMenu: (t4) => {
|
|
2044
|
+
I2(e3.index), re2(t4, e3.index);
|
|
2044
2045
|
}, ...e3, ...p2 });
|
|
2045
|
-
}, [u2, p2, o2,
|
|
2046
|
+
}, [u2, p2, o2, k2]), ie2 = W(() => B2 ? null : N(Oe, { disableInteractive: true, title: "New sheet", children: N(J, { disabled: l2, component: "div", sx: { padding: "0", "&:hover:not([disabled])": { color: (e3) => e3.palette.primary.main }, color: (e3) => e3.palette.text.icon ?? e3.palette.action.active, "& svg": { width: "18px", height: "18px" } }, "aria-label": "addTab", size: "small", onMouseDown: (e3) => {
|
|
2046
2047
|
0 === e3.button && e3.preventDefault();
|
|
2047
|
-
}, onClick: () =>
|
|
2048
|
-
return
|
|
2048
|
+
}, onClick: () => $2(), children: N(ha, {}) }) }), [l2, B2, $2]);
|
|
2049
|
+
return E(X, { ref: t2, className: Yn(h2), sx: { position: "relative", display: "flex", alignItems: "stretch", flex: "1 1 100%", maxWidth: "100%", ...x2 }, ...C2, children: [N(T, { ref: Q2, selectedTabIndex: v2, tabNames: A2, onSelectedTabIndexChange: I2, onTabNameChange: L2, onTabMove: H2, background: g2, borderColor: y2, borderWidth: b2, activeColor: null, disabled: l2, disableDrag: B2, createScrollStartButton: pn, createScrollEndButton: mn, createScrollEdgeButton: cn, createTabButton: le2, createTabDivider: (e3) => {
|
|
2049
2050
|
const { key: t3, ...o3 } = e3;
|
|
2050
|
-
return
|
|
2051
|
-
}, editLabelProps: { readOnly:
|
|
2051
|
+
return N(Se, { sx: { marginLeft: "-1px", marginRight: "0px", marginTop: "6px", marginBottom: "6px", background: (e4) => Wa(e4.palette.divider, 0.25) }, ...o3 }, t3);
|
|
2052
|
+
}, editLabelProps: { readOnly: B2, maxLength: 31, styleHover: { fontWeight: "700" }, onKeyPress: (e3) => {
|
|
2052
2053
|
o2.isValidSheetNameCharacter(e3.key) || e3.preventDefault();
|
|
2053
2054
|
}, onCancel: () => {
|
|
2054
|
-
r2?.(
|
|
2055
|
-
}, notifier: f2 }, children:
|
|
2055
|
+
r2?.(v2);
|
|
2056
|
+
}, notifier: f2 }, children: N(Oe, { disableInteractive: true, title: _2 ? "" : "List all sheets", children: N(Ye, { sx: { padding: "0px", ml: 0.5, mr: 0, mt: 0, mb: 0, "& svg": { transform: "scale(0.8, 1)" }, color: (e3) => e3.palette.text.icon ?? e3.palette.action.active }, ref: j2, dense: true, outlined: false, selected: _2, color: "primary", "aria-label": "menu", onMouseDown: (e3) => {
|
|
2056
2057
|
0 === e3.button && e3.preventDefault();
|
|
2057
2058
|
}, onClick: () => {
|
|
2058
|
-
_2 ?
|
|
2059
|
-
}, icon:
|
|
2059
|
+
_2 ? Z2.close(0) : Z2.open(0);
|
|
2060
|
+
}, icon: N(fa, {}) }) }) }), N("div", { style: { borderTop: `solid ${y2} ${b2}px`, minWidth: "4px" } }), N("div", { style: { borderTop: `solid ${y2} ${b2}px`, flex: "none", display: "flex", alignItems: "center" }, children: ie2 }), N("div", { style: { borderTop: `solid ${y2} ${b2}px`, flex: 1, minWidth: "24px" } }), ae2, Y2] });
|
|
2060
2061
|
}));
|
|
2061
2062
|
hi.displayName = "WorkbookStrip";
|
|
2062
|
-
const fi =
|
|
2063
|
-
const { workbook: o2, commands: n2, disabled: a2, sx: r2, floatReference: l2, className: i2, ...s2 } = e2, [d2, c2] =
|
|
2064
|
-
|
|
2063
|
+
const fi = L(H((e2, t2) => {
|
|
2064
|
+
const { workbook: o2, commands: n2, disabled: a2, sx: r2, floatReference: l2, className: i2, ...s2 } = e2, [d2, c2] = _((e3) => e3 + 1, 0), [m2, p2] = O(o2.getSelectedSheet()), [u2, g2] = O(m2.getSelectedRanges()), [h2, f2] = O(m2.getSelectedCell());
|
|
2065
|
+
w(o2, { onSheetsChange() {
|
|
2065
2066
|
p2(o2.getSelectedSheet());
|
|
2066
|
-
} }),
|
|
2067
|
+
} }), w(m2.getSelection(), { onChange() {
|
|
2067
2068
|
g2(m2.getSelectedRanges()), f2(m2.getSelectedCell());
|
|
2068
|
-
} }),
|
|
2069
|
+
} }), ba(n2, [], { onChange: () => {
|
|
2069
2070
|
c2();
|
|
2070
2071
|
} });
|
|
2071
|
-
const
|
|
2072
|
+
const x2 = W(() => ({}), []), b2 = W(() => ({ commandHook: { beforeExecute: (e3, t3) => l2.closeAll(), onExecute() {
|
|
2072
2073
|
}, onError() {
|
|
2073
2074
|
console.log("onError");
|
|
2074
|
-
} }, disabled: a2, scope: "contextMenu", parentFloat: l2 }), [a2, l2]),
|
|
2075
|
-
let
|
|
2076
|
-
u2 && (
|
|
2077
|
-
const
|
|
2078
|
-
if (
|
|
2079
|
-
if (
|
|
2075
|
+
} }, disabled: a2, scope: "contextMenu", parentFloat: l2 }), [a2, l2]), y2 = W(() => ({ ...x2, ...b2, variant: ya.Menuitem }), [x2, b2]), k2 = W(() => ({ commands: n2, variant: ya.Menuitem, parentFloat: l2, ...b2 }), [n2, b2, l2]), S2 = [];
|
|
2076
|
+
let C2 = u2.isEntireRows(), v2 = u2.isEntireColumns();
|
|
2077
|
+
u2 && (C2 && (S2.push(N(Se, { orientation: "horizontal" }, "context:" + S2.length)), S2.push(j(ke, { command: n2.getCommand("hideColumns"), ...y2, icon: we(N(un, {})), key: "context:" + S2.length })), S2.push(j(ke, { command: n2.getCommand("unhideColumns"), ...y2, icon: we(N(gn, {})), key: "context:" + S2.length }))), v2 && (S2.push(N(Se, { orientation: "horizontal" }, "context:" + S2.length)), S2.push(j(ke, { command: n2.getCommand("hideRows"), ...y2, icon: we(N(hn, {})), key: "context:" + S2.length })), S2.push(j(ke, { command: n2.getCommand("unhideRows"), ...y2, icon: we(N(fn, {})), key: "context:" + S2.length }))), (C2 || v2) && S2.push(N(Se, { orientation: "horizontal" }, "context:" + S2.length)), C2 && S2.push(j(ke, { command: n2.getCommand("autoFitColumns"), ...y2, icon: we(N(xn, {})), key: "context:" + S2.length })), v2 && S2.push(j(ke, { command: n2.getCommand("autoFitRows"), ...y2, icon: we(N(bn, {})), key: "context:" + S2.length })));
|
|
2078
|
+
const T2 = [], D2 = n2.getCommand("formatTableStyle"), P2 = D2?.context()?.table();
|
|
2079
|
+
if (Ca(D2), !C2 && !v2) {
|
|
2080
|
+
if (T2.push(N(Se, { orientation: "horizontal" }, "contextBefore:" + T2.length)), h2?.getHyperlink()) T2.push(j(uo, { ...k2, popupCommandKeys: ["updateHyperlink", "deleteHyperlink"], popupScope: "hyperlink", key: "contextBefore:action" + T2.length, quickCommand: "openHyperlink", icon: (e3) => "openHyperlink" === e3.key() ? we(N(nn, {})) : null }));
|
|
2080
2081
|
else {
|
|
2081
2082
|
const e3 = n2.getCommand("updateHyperlink");
|
|
2082
|
-
|
|
2083
|
+
T2.push(j(ke, { command: e3, ...y2, icon: we(N(nn, {})), key: "contextBefore:" + T2.length }));
|
|
2083
2084
|
}
|
|
2084
|
-
if (h2?.getComments())
|
|
2085
|
+
if (h2?.getComments()) T2.push(j(uo, { ...k2, popupCommandKeys: ["deleteComments"], key: "contextBefore:action" + T2.length, quickCommand: "updateComments", icon: (e3) => "updateComments" === e3.key() ? we(N(an, {})) : null }));
|
|
2085
2086
|
else {
|
|
2086
2087
|
const e3 = n2.getCommand("updateComments");
|
|
2087
|
-
|
|
2088
|
+
T2.push(j(ke, { command: e3, ...y2, icon: we(N(an, {})), key: "contextBefore:" + T2.length }));
|
|
2088
2089
|
}
|
|
2089
|
-
|
|
2090
|
+
P2 ? T2.push(j(uo, { ...k2, variant: ya.Menuitem, key: "contextBefore:" + T2.length, popupCommandKeys: ["convertTableToRange", "deleteTable"], popupScope: "table", scope: "context", commandState: P2, quickCommand: "editTable", icon: (e3) => {
|
|
2090
2091
|
e3.key();
|
|
2091
|
-
return
|
|
2092
|
-
} })) :
|
|
2092
|
+
return we(N(Ho, {}));
|
|
2093
|
+
} })) : T2.push(j(ke, { command: n2.getCommand("insertTable"), ...y2, icon: we(N(Ho, {})), key: "context:" + S2.length })), T2.push(j(gl, { ...k2, key: "contextBefore:" + T2.length }));
|
|
2093
2094
|
}
|
|
2094
|
-
const
|
|
2095
|
-
return
|
|
2095
|
+
const R2 = E(A, { children: [N(ke, { command: n2.getCommand("cut"), ...y2, icon: N(yn, {}) }), N(hl, { command: n2.getCommand("copy"), ...y2 }), N(qr, { command: n2.getCommand("paste"), ...k2, includePasteAllInPopup: false }), N(Se, { orientation: "horizontal" }), N(zr, { ...k2 }), N(Se, { orientation: "horizontal" }), N(Ir, { commands: n2, ...k2, disableSheet: true }), N(Lr, { commands: n2, ...k2, disableSheet: true }), N(Er, { ...k2 }), T2, S2] });
|
|
2096
|
+
return N(X, { ref: t2, className: Yn("menu", i2), sx: { ...r2 }, ...s2, children: R2 });
|
|
2096
2097
|
}));
|
|
2097
2098
|
fi.displayName = "WorkbookContextMenu";
|
|
2098
|
-
const xi =
|
|
2099
|
+
const xi = L(H((e2, t2) => {
|
|
2099
2100
|
const { movable: o2, commands: n2, disabled: a2, sx: r2, floatReference: l2, ...i2 } = e2;
|
|
2100
|
-
|
|
2101
|
+
w(o2, { onAnyChange(e3) {
|
|
2101
2102
|
} });
|
|
2102
|
-
const s2 =
|
|
2103
|
+
const s2 = W(() => ({}), []), d2 = W(() => ({ commandHook: { beforeExecute: (e3, t3) => l2.closeAll(), onExecute() {
|
|
2103
2104
|
}, onError() {
|
|
2104
2105
|
console.log("onError");
|
|
2105
|
-
} }, disabled: a2, parentFloat: l2 }), [a2, l2]), c2 =
|
|
2106
|
+
} }, disabled: a2, parentFloat: l2 }), [a2, l2]), c2 = W(() => ({ variant: ya.Menuitem, ...s2, ...d2 }), [s2, d2]), m2 = W(() => ({ commands: n2, variant: ya.Menuitem, parentFloat: l2, ...d2 }), [n2, d2, l2]), p2 = (e3) => {
|
|
2106
2107
|
const t3 = e3?.key();
|
|
2107
2108
|
switch (t3) {
|
|
2108
2109
|
case "moveToFront":
|
|
2109
|
-
return
|
|
2110
|
+
return we(N(En, {}));
|
|
2110
2111
|
case "moveForward":
|
|
2111
|
-
return
|
|
2112
|
+
return we(N(Nn, {}));
|
|
2112
2113
|
case "moveToBack":
|
|
2113
|
-
return
|
|
2114
|
+
return we(N(Bn, {}));
|
|
2114
2115
|
case "moveBackward":
|
|
2115
|
-
return
|
|
2116
|
+
return we(N(Fn, {}));
|
|
2116
2117
|
case "toggleLockAspectRatio":
|
|
2117
|
-
return
|
|
2118
|
+
return we(N(wn, {}));
|
|
2118
2119
|
case "formatDrawAlignLeft":
|
|
2119
|
-
return
|
|
2120
|
+
return we(N(kn, {}));
|
|
2120
2121
|
case "formatDrawAlignCenter":
|
|
2121
|
-
return
|
|
2122
|
+
return we(N(Mn, {}));
|
|
2122
2123
|
case "formatDrawAlignRight":
|
|
2123
|
-
return
|
|
2124
|
+
return we(N(Rn, {}));
|
|
2124
2125
|
case "formatDrawAlignTop":
|
|
2125
|
-
return
|
|
2126
|
+
return we(N(Pn, {}));
|
|
2126
2127
|
case "formatDrawAlignMiddle":
|
|
2127
|
-
return
|
|
2128
|
+
return we(N(Dn, {}));
|
|
2128
2129
|
case "formatDrawAlignBottom":
|
|
2129
|
-
return
|
|
2130
|
+
return we(N(Tn, {}));
|
|
2130
2131
|
case "formatDrawDistributeHorz":
|
|
2131
|
-
return
|
|
2132
|
+
return we(N(vn, {}));
|
|
2132
2133
|
case "formatDrawDistributeVert":
|
|
2133
|
-
return
|
|
2134
|
+
return we(N(Cn, {}));
|
|
2134
2135
|
case "formatAnchorTypeTwoCell":
|
|
2135
2136
|
case "formatAnchorTypeOneCell":
|
|
2136
2137
|
case "formatAnchorTypeAbsolute":
|
|
2137
|
-
return
|
|
2138
|
+
return we(N(Sn, {}));
|
|
2138
2139
|
default:
|
|
2139
2140
|
return null;
|
|
2140
2141
|
}
|
|
2141
|
-
}, u2 =
|
|
2142
|
+
}, u2 = E(A, { children: [N(hl, { command: n2.getCommand("copy"), ...c2, variant: ya.Menuitem }), [], N(Se, { orientation: "horizontal" }), N(uo, { ...m2, popupCommandKeys: ["moveToFront", "moveForward"], quickCommand: "moveToFront", icon: p2 }), N(uo, { ...m2, popupCommandKeys: ["moveToBack", "moveBackward"], quickCommand: "moveToBack", icon: p2 }), N(Se, { orientation: "horizontal" }), N(ke, { ...c2, command: n2.getCommand("toggleLockAspectRatio"), icon: we(N(wn, {})) }), N(Se, { orientation: "horizontal" }), N(uo, { ...m2, popupCommandKeys: ["formatDrawAlignLeft", "formatDrawAlignCenter", "formatDrawAlignRight", null, "formatDrawAlignTop", "formatDrawAlignMiddle", "formatDrawAlignBottom", null, "formatDrawDistributeHorz", "formatDrawDistributeVert"], label: "Align", icon: (e3) => {
|
|
2142
2143
|
const t3 = p2(e3);
|
|
2143
|
-
return t3 ||
|
|
2144
|
-
}, tooltip: "Quickly change the placement of your drawings." }),
|
|
2144
|
+
return t3 || we(N(kn, {}));
|
|
2145
|
+
}, tooltip: "Quickly change the placement of your drawings." }), N(Se, { orientation: "horizontal" }), N(uo, { ...m2, popupCommandKeys: ["formatAnchorTypeTwoCell", "formatAnchorTypeOneCell", "formatAnchorTypeAbsolute"], label: "Sizing", icon: (e3) => {
|
|
2145
2146
|
const t3 = p2(e3);
|
|
2146
|
-
return t3 ||
|
|
2147
|
+
return t3 || we(N(Sn, {}));
|
|
2147
2148
|
}, tooltip: "Determine how the drawing size will adjust as the cell sizes adjust." }), []] });
|
|
2148
|
-
return
|
|
2149
|
+
return N(X, { ref: t2, sx: { paddingTop: "4px", paddingBottom: "4px", ...r2 }, ...i2, children: u2 });
|
|
2149
2150
|
}));
|
|
2150
2151
|
xi.displayName = "MovableContextMenu";
|
|
2151
|
-
const bi = (e2) =>
|
|
2152
|
-
const { workbook: o2, createWorkbookOptions: a2, onNewWorkbook: r2, onElementLoad: l2, notifier: i2, autoFocus: s2 = false, sx: d2, style: c2, className: m2, onFocus: p2, onBlur: u2, onKeyDown: g2, onRepeatCommandChange:
|
|
2153
|
-
const e3 = { theme:
|
|
2152
|
+
const bi = (e2) => N(xi, { ...e2 }), yi = (e2) => N(fi, { ...e2 }), wi = (e2) => N(Ml, { ...e2 }), ki = (e2, t2) => N(Rl, { ref: t2, ...e2 }), Si = (e2) => N(Ve, { ...e2 }), Ci = (e2, t2) => N(D, { ref: t2, ...e2 }), vi = (e2) => N(Tl, { ...e2 }), Ti = (e2) => N(hi, { ...e2 }), Di = { fireOnModelChange: false }, Pi = { flex: "1 1 100%", display: "flex" }, Ri = L(H((e2, t2) => {
|
|
2153
|
+
const { workbook: o2, createWorkbookOptions: a2, onNewWorkbook: r2, onElementLoad: l2, notifier: i2, autoFocus: s2 = false, sx: d2, style: c2, className: m2, onFocus: p2, onBlur: u2, onKeyDown: g2, onRepeatCommandChange: x2, commands: b2, showFormulaBar: y2, formulaBarProps: k2, renderFormulaBar: S2 = ki, showTabs: C2, tabsProps: T2, renderTabs: D2 = Ti, showStatusBar: B2, statusBarProps: L2, renderStatusBar: H2 = vi, toolbarProps: $2, renderToolbar: G2 = ni, contextMenuSx: j2, renderContextMenu: q2 = yi, renderFilterMenu: J2 = wi, renderMovableMenu: Y2 = bi, renderLoadingPanel: Q2 = Si, loadingPanelProps: ee2, sheetProps: te2, renderSheet: oe2 = Ci, showHorizontalScrollbar: ne2, showVerticalScrollbar: ae2, gridTheme: re2, headersTheme: le2, enableDarkImages: ie2, ...se2 } = e2, de2 = Ha(), me2 = v(), pe2 = W(() => {
|
|
2154
|
+
const e3 = { theme: me2.getDefaultTheme(), ...a2 };
|
|
2154
2155
|
return o2 ?? new h(e3);
|
|
2155
|
-
}, [o2]),
|
|
2156
|
-
|
|
2157
|
-
}, []),
|
|
2158
|
-
|
|
2159
|
-
} }), [
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
}, [
|
|
2163
|
-
const
|
|
2156
|
+
}, [o2]), ue2 = U(null), [ge2, he2] = O(false), fe2 = U(null), xe2 = W(() => N(X, { className: "sheetxl-viewport", sx: { width: "100%", height: "100%", boxSizing: "border-box", position: "absolute", pointerEvents: "none !important", "& > :first-of-type": { position: "relative" } }, ref: fe2 }), []), [be2, ye2] = O(false), [we2, ke2] = O(false), Se2 = z(() => {
|
|
2157
|
+
ye2(true);
|
|
2158
|
+
}, []), Ce2 = U(null), ve2 = Pa(t2, () => ({ isWorkbookElement: () => true, getWorkbook: () => pe2, getSheetElement: () => ue2.current, getViewportElement: () => fe2.current, getFormulaBarElement: () => Ce2.current, focus() {
|
|
2159
|
+
ue2 && ue2.current && ue2.current.focus();
|
|
2160
|
+
} }), [pe2]), Te2 = U(null);
|
|
2161
|
+
K(() => {
|
|
2162
|
+
be2 && ve2.current && (ke2(true), Te2.current !== l2 && (l2?.({ source: ve2.current }), Te2.current = l2));
|
|
2163
|
+
}, [be2, ve2.current]), Hl(ve2.current);
|
|
2164
|
+
const De2 = z((e3) => (ue2.current?.submitEdit(), true), []), Pe2 = z(() => {
|
|
2164
2165
|
requestAnimationFrame(() => {
|
|
2165
|
-
|
|
2166
|
+
ue2?.current?.focus();
|
|
2166
2167
|
});
|
|
2167
|
-
}, []), [
|
|
2168
|
-
|
|
2169
|
-
|
|
2168
|
+
}, []), [Re2, Me2] = O(pe2?.getSelectedSheet()), [Fe2, Be2] = O(pe2?.getProtection());
|
|
2169
|
+
w(pe2, { onSheetsChange: (e3) => {
|
|
2170
|
+
Me2(e3?.getSelectedSheet());
|
|
2170
2171
|
}, onViewChange(e3) {
|
|
2171
|
-
|
|
2172
|
+
Me2(e3?.getSelectedSheet());
|
|
2172
2173
|
}, onProtectionChange: (e3) => {
|
|
2173
|
-
|
|
2174
|
-
} }),
|
|
2175
|
-
|
|
2176
|
-
|
|
2174
|
+
Be2(e3?.getProtection());
|
|
2175
|
+
} }), w(pe2, { onRequestSelect: async (e3, t3) => new Promise((e4) => {
|
|
2176
|
+
ue2.current.getSheet() !== t3 ? ue2.current.getGridElement()?.onViewChangeOnce(() => {
|
|
2177
|
+
ue2.current.getSheet() !== t3 && e4(false), e4(true);
|
|
2177
2178
|
}) : e4(true);
|
|
2178
2179
|
}) }, Di);
|
|
2179
|
-
const [
|
|
2180
|
-
|
|
2181
|
-
|
|
2180
|
+
const [Ne2, Ee2] = _((e3) => e3 + 1, 0), Ae2 = pe2?.getView();
|
|
2181
|
+
w(Ae2, { onViewChange: (e3) => {
|
|
2182
|
+
Ee2();
|
|
2182
2183
|
} });
|
|
2183
|
-
const
|
|
2184
|
-
|
|
2185
|
-
|
|
2184
|
+
const Ie2 = re2 ?? de2, Le2 = W(() => $l(de2, Ie2), [de2, Ie2]), He2 = le2 ?? de2, We2 = W(() => $l(de2, He2), [de2, He2]), [ze2, $e2] = O(null);
|
|
2185
|
+
z(() => {
|
|
2186
|
+
ue2.current.focus();
|
|
2186
2187
|
}, []);
|
|
2187
|
-
const [
|
|
2188
|
-
|
|
2189
|
-
} }),
|
|
2190
|
-
|
|
2191
|
-
},
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2188
|
+
const [Ge2, Ue2] = O(false), je2 = U(null), _e2 = si({ workbook: pe2, workbookElement: ve2.current, target: () => ue2.current, notifier: i2, commands: b2, darkMode: Le2.body.darkMode, onNewWorkbook: r2, onShowSidebar: () => {
|
|
2189
|
+
Ge2 ? je2.current?.focus() : Ue2(true);
|
|
2190
|
+
} }), qe2 = U(null), [Ke2, Xe2] = O(false), [Ze2, Je2] = O(null), [Ye2, Qe2] = O(Aa.Top), [et2, tt2] = O(f.EmptyBounds), ot2 = z(() => {
|
|
2191
|
+
Xe2(false), Je2(null);
|
|
2192
|
+
}, []), nt2 = z((e3, t3, o3 = Aa.Top) => {
|
|
2193
|
+
tt2(e3), Qe2(o3), Je2(t3), null !== qe2.current && setTimeout(() => {
|
|
2194
|
+
null !== qe2.current && qe2.current.update();
|
|
2195
|
+
}, 160), Xe2(true);
|
|
2196
|
+
}, []), [at2, rt2] = O("sheet"), lt2 = C2 ?? Ae2?.isShowTabs(), it2 = ne2 ?? Ae2?.isShowHorizontalScrollbar(), st2 = y2 ?? Ae2?.isShowFormulaBar(), dt2 = B2 ?? Ae2?.isShowStatusBar(), ct2 = ae2 ?? Ae2?.isShowVerticalScrollbar(), mt2 = Le2?.header?.edgeStrokeFill || "rgb(171,171,171)", pt2 = W(() => dt2 ? H2({ sheet: Re2, gridStyle: Le2, ...L2 }) : null, [H2, L2, dt2, Le2, Re2]), ut2 = W(() => G2({ commands: _e2, workbook: ve2.current, ...$2 }), [_e2, G2, $2, de2]), [gt2, { width: ht2 }] = Xa(), ft2 = 0 === ht2 || ht2 > 560, xt2 = W(() => {
|
|
2197
|
+
if (!lt2) return null;
|
|
2198
|
+
let e3 = D2({ background: Le2.body.fill, borderWidth: 1, borderColor: mt2, gridTheme: Ie2, gridStyle: Le2, onBeforeUserChange: De2, onUserChange: Pe2, workbook: pe2, commands: _e2, sheetTabProps: {}, notifier: i2, ...T2 });
|
|
2199
|
+
return ft2 || (e3 = N("div", { style: { flex: "none", display: "flex" }, children: e3 })), e3;
|
|
2200
|
+
}, [D2, T2, i2, de2, pe2, Ie2, ft2, _e2, lt2]), bt2 = z((e3) => {
|
|
2198
2201
|
const t3 = n.getOS() === n.OSType.Firefox;
|
|
2199
2202
|
let o3 = null, a3 = null, r3 = null;
|
|
2200
|
-
if (
|
|
2201
|
-
|
|
2202
|
-
}, onCloseTooltip: () =>
|
|
2203
|
-
|
|
2204
|
-
}, 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='${
|
|
2205
|
-
else if (
|
|
2203
|
+
if (it2 && (a3 = N("div", { style: { display: "flex", flex: "1 1 100%", borderTop: `solid ${mt2} 1px`, maxWidth: "100%" }, children: N(P, { style: { alignItems: "center", borderTop: (t3 ? 6 : 3) + "px solid transparent", borderBottom: (ft2 ? 6 : 3) + "px solid transparent", borderLeft: (t3 ? 3 : 0) + "px solid transparent", borderRight: (t3 ? 3 : 0) + "px solid transparent" }, ...e3, endGap: 700, sheet: Re2, showCustomScrollButtons: !t3, onShowTooltip: (e4) => {
|
|
2204
|
+
nt2({ x: e4.anchor.x, y: e4.anchor.y, width: 0, height: 0 }, e4.display, e4.placement);
|
|
2205
|
+
}, onCloseTooltip: () => ot2() }) })), lt2 && ft2 && (r3 = xt2), lt2 && ft2 && !it2 && (r3 = E(X, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: [r3, N(X, { sx: { borderTop: `solid ${mt2} 1px`, flex: "1" } })] })), r3 && it2) o3 = N(Ra, { position: pe2.getView().getTabRatio() / 10 + "%", onPositionChange: ({ percent: e4 }) => {
|
|
2206
|
+
pe2.getView().setTabRatio(Math.round(10 * e4));
|
|
2207
|
+
}, minBefore: "200px", minAfter: "180px", resizerProps: { style: { minWidth: "11px", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${de2.palette.text.icon ?? de2.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center", borderTop: `solid ${mt2} 1px`, borderBottom: "solid 3px transparent" } }, elementBefore: r3, elementAfter: a3 });
|
|
2208
|
+
else if (it2) o3 = a3;
|
|
2206
2209
|
else {
|
|
2207
|
-
if (!r3) return
|
|
2210
|
+
if (!r3) return N(X, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center", height: "1px", borderTop: dt2 ? null : `solid ${mt2} 1px` } });
|
|
2208
2211
|
o3 = r3;
|
|
2209
2212
|
}
|
|
2210
|
-
return
|
|
2211
|
-
}, [
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
}, [
|
|
2215
|
-
const
|
|
2213
|
+
return N(X, { sx: { display: "flex", flex: "1", position: "relative", alignContent: "center" }, children: o3 });
|
|
2214
|
+
}, [Re2, De2, pe2, Le2, Ie2, _e2, lt2, it2, dt2, ft2]), [yt2, wt2] = I.useState(null), kt2 = W(() => ({ placement: "right-start", ...yt2?.popperProps }), [yt2?.popperProps]), { reference: St2, component: Ct2 } = Eo({ label: "contextMenu", popperProps: kt2, anchor: yt2?.anchor ?? { getBoundingClientRect: () => new DOMRect(yt2?.clientX || 0, yt2?.clientY || 0) }, onClose: () => wt2(null), createPopupPanel: yt2?.createPopupPanel });
|
|
2215
|
+
V(() => {
|
|
2216
|
+
yt2 ? St2.open(0) : St2.close(0);
|
|
2217
|
+
}, [yt2]);
|
|
2218
|
+
const vt2 = wa((e3, t3) => {
|
|
2216
2219
|
if (e3?.isDefaultPrevented()) return true;
|
|
2217
|
-
e3.preventDefault(),
|
|
2220
|
+
e3.preventDefault(), yt2 && yt2.anchor === e3.currentTarget ? wt2(null) : wt2({ anchor: e3.currentTarget, popperProps: { offsets: [-4, 2] }, createPopupPanel: (e4) => {
|
|
2218
2221
|
const { floatReference: o3 } = e4;
|
|
2219
|
-
return
|
|
2222
|
+
return J2({ filter: t3, commands: _e2, floatReference: o3, sx: { ...j2 } });
|
|
2220
2223
|
} });
|
|
2221
|
-
}, [
|
|
2224
|
+
}, [J2, j2, _e2, pe2, yt2]), Tt2 = wa((e3) => {
|
|
2222
2225
|
if (e3.originalEvent?.isDefaultPrevented()) return true;
|
|
2223
|
-
e3.originalEvent?.preventDefault(),
|
|
2226
|
+
e3.originalEvent?.preventDefault(), wt2({ clientX: e3.clientX, clientY: e3.clientY, createPopupPanel: (e4) => {
|
|
2224
2227
|
const { floatReference: t3 } = e4;
|
|
2225
|
-
return
|
|
2228
|
+
return q2({ commands: _e2, workbook: pe2, floatReference: t3, sx: { ...j2 } });
|
|
2226
2229
|
} });
|
|
2227
|
-
}, [
|
|
2230
|
+
}, [q2, j2, _e2, pe2]), Dt2 = wa((e3, t3) => {
|
|
2228
2231
|
if (e3?.isDefaultPrevented()) return true;
|
|
2229
|
-
e3.preventDefault(),
|
|
2232
|
+
e3.preventDefault(), wt2({ clientX: e3.clientX, clientY: e3.clientY, createPopupPanel: (e4) => {
|
|
2230
2233
|
const { floatReference: o3 } = e4;
|
|
2231
|
-
return
|
|
2234
|
+
return Y2({ movable: t3, commands: _e2, floatReference: o3, sx: { ...j2 } });
|
|
2232
2235
|
} });
|
|
2233
|
-
}, [
|
|
2234
|
-
|
|
2235
|
-
const e3 = [new
|
|
2236
|
-
|
|
2237
|
-
}, [
|
|
2238
|
-
|
|
2239
|
-
const e3 =
|
|
2240
|
-
|
|
2236
|
+
}, [Y2, j2, _e2]);
|
|
2237
|
+
W(() => {
|
|
2238
|
+
const e3 = [new Fa("openContextMenu", () => ue2.current, { label: "Context Menu", description: "Open the context menu.", shortcut: [{ key: "F10", modifiers: [Na.Shift] }, { key: "ContextMenu" }] })];
|
|
2239
|
+
_e2.addCommands(e3, true);
|
|
2240
|
+
}, [_e2]), V(() => {
|
|
2241
|
+
_e2.getCommand("openContextMenu").updateCallback(() => {
|
|
2242
|
+
const e3 = Re2.getSelection().getCoords().cell;
|
|
2243
|
+
ue2.current?.getGridElement()?.scrollCellCoordsIntoView(e3).then((t3) => {
|
|
2241
2244
|
requestAnimationFrame(() => {
|
|
2242
|
-
const o3 =
|
|
2243
|
-
|
|
2245
|
+
const o3 = Re2.getView().getZoomScale() / 100, n2 = Re2.getColumnHeaders().findOffset(e3.colIndex + 1) * o3, a3 = Re2.getRowHeaders().findOffset(e3.rowIndex + 1) * o3, r3 = ue2.current?.getGridElement()?.getRelativePointFromClient(0, 0) || { x: 0, y: 0 };
|
|
2246
|
+
Tt2({ clientX: n2 - r3.x - t3.left + 6, clientY: a3 - r3.y - t3.top + 6 });
|
|
2244
2247
|
});
|
|
2245
2248
|
});
|
|
2246
2249
|
});
|
|
2247
|
-
}, [
|
|
2248
|
-
const
|
|
2249
|
-
|
|
2250
|
-
}, [
|
|
2251
|
-
Hl(
|
|
2252
|
-
}, [
|
|
2253
|
-
|
|
2254
|
-
}, []),
|
|
2255
|
-
|
|
2256
|
-
}, []),
|
|
2250
|
+
}, [Re2]);
|
|
2251
|
+
const Pt2 = wa((e3) => {
|
|
2252
|
+
_e2?.dispatchToFocusedCommand(e3);
|
|
2253
|
+
}, [_e2]), Rt2 = wa(() => {
|
|
2254
|
+
Hl(ve2.current);
|
|
2255
|
+
}, [pe2, ve2.current]), Mt2 = z(() => {
|
|
2256
|
+
rt2("sheet");
|
|
2257
|
+
}, []), Ft2 = z(() => {
|
|
2258
|
+
rt2("formulaBar");
|
|
2259
|
+
}, []), Bt2 = wa((e3) => {
|
|
2257
2260
|
const t3 = n.getOS() === n.OSType.Firefox;
|
|
2258
|
-
return
|
|
2259
|
-
|
|
2260
|
-
}, onCloseTooltip: () =>
|
|
2261
|
-
}, [
|
|
2262
|
-
|
|
2263
|
-
s2 &&
|
|
2261
|
+
return N(P, { style: { borderLeft: "3px solid transparent", borderRight: "0px solid transparent", borderTop: (t3 ? 3 : 0) + "px solid transparent", borderBottom: (t3 ? 3 : 0) + "px solid transparent", width: t3 ? "13px" : void 0 }, ...e3, sheet: Re2, endGap: 700, showCustomScrollButtons: !t3, onShowTooltip: (e4) => {
|
|
2262
|
+
nt2(e4.anchor, e4.display, Aa.Left);
|
|
2263
|
+
}, onCloseTooltip: () => ot2() });
|
|
2264
|
+
}, [Re2]);
|
|
2265
|
+
V(() => {
|
|
2266
|
+
s2 && ue2 && ue2.current && ue2.current.focus();
|
|
2264
2267
|
}, []);
|
|
2265
|
-
const [
|
|
2266
|
-
|
|
2267
|
-
}, [
|
|
2268
|
-
if (
|
|
2268
|
+
const [Nt2, Et2] = I.useState(null), At2 = z((e3) => {
|
|
2269
|
+
_e2?.getCommand("openWorkbook") && ("dragenter" === e3.type || "dragover" === e3.type ? e3.dataTransfer?.types.includes("Files") ? e3.dataTransfer.files[0]?.type?.startsWith("image/") || e3.dataTransfer.items[0]?.type?.startsWith("image/") || 1 === e3.dataTransfer.types.length && Et2("Drop to open") : (e3.dataTransfer?.types.includes("text/html") || e3.dataTransfer?.types.includes("text/plain"), e3.dataTransfer.effectAllowed = "none", e3.dataTransfer.dropEffect = "none") : "dragleave" === e3.type && Et2(null), e3.preventDefault());
|
|
2270
|
+
}, [_e2]), It2 = wa((e3) => {
|
|
2271
|
+
if (_e2?.getCommand("openWorkbook") && (e3.preventDefault(), e3.stopPropagation(), Et2(null), e3.dataTransfer.files && e3.dataTransfer.files.length > 0)) {
|
|
2269
2272
|
const t3 = e3.dataTransfer.files[0];
|
|
2270
2273
|
if (!t3) return;
|
|
2271
2274
|
if (t3?.type?.startsWith("image/")) {
|
|
2272
|
-
const o3 =
|
|
2275
|
+
const o3 = ue2.current?.getGridElement().getViewFromClient(e3.clientX, e3.clientY);
|
|
2273
2276
|
if (!o3) return;
|
|
2274
2277
|
const n2 = o3.getRelativePointFromClient(e3.clientX, e3.clientY), a3 = o3.toAbsoluteBounds({ ...n2, width: 0, height: 0 }), r3 = o3.getCellCoordsFromClient(e3.clientX, e3.clientY);
|
|
2275
2278
|
if (!r3) return;
|
|
2276
|
-
|
|
2277
|
-
} else
|
|
2279
|
+
_e2?.getCommand("insertImageFromFile")?.execute({ file: t3, options: { bounds: { x: a3.x, y: a3.y } }, goto: { range: { ...r3 } } });
|
|
2280
|
+
} else _e2?.getCommand("openWorkbook")?.execute(t3);
|
|
2278
2281
|
}
|
|
2279
|
-
}, [
|
|
2282
|
+
}, [_e2, Nt2]), Lt2 = W(() => Nt2 ? N(X, { sx: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", pointerEvents: "none", display: "flex", justifyContent: "center", alignItems: "center", background: (e3) => e3.palette.divider, color: (e3) => e3.palette.primary.dark }, children: N(Z, { variant: "h4", children: Nt2 }) }) : null, [Nt2]), Ht2 = U(null), Wt2 = W(() => N(Za, { in: !we2, nodeRef: Ht2, timeout: 500, classNames: "animating", unmountOnExit: true, children: N(X, { style: { display: "flex", alignItems: "center", justifyContent: "center", left: "0px", top: "0px", width: "100%", height: "100%", pointerEvents: we2 ? "none" : d2?.pointerEvents, position: "absolute", boxSizing: "border-box" }, children: Q2({ ref: Ht2, transitionDelay: "0", transparentBackground: false, sx: { opacity: we2 ? 0 : d2?.opacity, pointerEvents: we2 ? "none" : d2?.pointerEvents, position: "absolute", left: "0px", top: "0px", width: "100%", height: "100%", ...ee2 } }) }) }), [we2, Q2, ee2]), zt2 = W(() => S2({ sx: { marginTop: (e3) => e3.spacing(0.25), marginLeft: (e3) => e3.spacing(1), marginRight: (e3) => e3.spacing(1) }, workbook: pe2, sheetElement: ue2.current, gridStyle: Le2, onFocus: Ft2, ...k2, NamedCollectionEditorProps: { restoreFocus: (e3) => ue2.current.focus(e3), notifier: i2, ...k2?.NamedCollectionEditorProps, commandPopupButtonProps: { commands: _e2, ...k2?.NamedCollectionEditorProps?.commandPopupButtonProps } } }, Ce2), [S2, k2, pe2, Le2, _e2, we2]), $t2 = z((e3) => {
|
|
2280
2283
|
const { movable: t3, ...o3 } = e3, n2 = { movable: t3, onContextMenuCapture: (e4) => {
|
|
2281
|
-
|
|
2284
|
+
Dt2(e4, t3);
|
|
2282
2285
|
}, ...o3 }, a3 = t3.getContent().getType();
|
|
2283
2286
|
let r3 = null;
|
|
2284
|
-
if ("picture" === a3) return
|
|
2287
|
+
if ("picture" === a3) return N(R, { loadingPanel: N(Ve, { transitionDelay: "100", style: { position: "absolute" }, sx: { border: (e4) => `solid 1px ${e4.palette.action.active}` } }), picture: t3.getContent(), description: t3.getDescription() ?? t3?.getName(), ...n2 });
|
|
2285
2288
|
if ("chart" === a3) {
|
|
2286
2289
|
const e4 = { ...n2, chart: t3.getContent() };
|
|
2287
|
-
return
|
|
2290
|
+
return N(M, { ...e4 });
|
|
2288
2291
|
}
|
|
2289
2292
|
if (r3 = `Float of type '${a3}'.`, "string" == typeof r3) {
|
|
2290
2293
|
const e4 = { ...n2, description: r3 };
|
|
2291
|
-
r3 =
|
|
2294
|
+
r3 = N(F, { ...e4 });
|
|
2292
2295
|
}
|
|
2293
|
-
return
|
|
2294
|
-
}, []),
|
|
2295
|
-
|
|
2296
|
-
}, showScrollbars: false, viewportComponent:
|
|
2297
|
-
|
|
2296
|
+
return N("div", { style: { position: "absolute", clipPath: "inset(0px)", display: "flex", alignItems: "stretch", justifyContent: "stretch", pointerEvents: "all" }, children: r3 }, t3.getUUID());
|
|
2297
|
+
}, []), Ot2 = W(() => oe2({ style: Pi, onFocus: Mt2, notifier: i2, gridStyle: Le2, headersStyle: We2, sheet: Re2, commands: _e2, onSheetContextMenu: Tt2, onViewportChange: (e3) => {
|
|
2298
|
+
$e2(e3);
|
|
2299
|
+
}, showScrollbars: false, viewportComponent: xe2, onRepeatCommandChange: x2, onElementLoad: Se2, onShowColumnTooltip: (e3) => {
|
|
2300
|
+
nt2(e3.anchor, e3.display, Aa.Top);
|
|
2298
2301
|
}, onShowRowTooltip: (e3) => {
|
|
2299
|
-
|
|
2302
|
+
nt2(e3.anchor, e3.display, Aa.Right);
|
|
2300
2303
|
}, onShowTooltip: (e3) => {
|
|
2301
|
-
|
|
2302
|
-
}, onCloseTooltip: () =>
|
|
2303
|
-
|
|
2304
|
-
}, ...
|
|
2305
|
-
if (!
|
|
2306
|
-
const e3 = !
|
|
2307
|
-
return
|
|
2308
|
-
|
|
2309
|
-
|
|
2304
|
+
nt2({ x: e3.anchor.x, y: e3.anchor.y, width: 0, height: 0 }, e3.display, e3.placement);
|
|
2305
|
+
}, onCloseTooltip: () => ot2(), renderMovable: $t2, ...te2, cellRenderProps: { onFilterButtonMouseDown: (e3, t3) => {
|
|
2306
|
+
te2?.cellRenderProps?.onFilterButtonMouseDown(e3, t3), vt2(e3, t3);
|
|
2307
|
+
}, ...te2?.cellRenderProps } }, ue2), [oe2, _e2, te2, Re2, Le2, i2, x2]), Vt2 = W(() => {
|
|
2308
|
+
if (!Ge2) return null;
|
|
2309
|
+
const e3 = !Fe2.isStructureAllowed();
|
|
2310
|
+
return N(Jl, { sx: { marginBottom: (e4) => e4.spacing(0.5), border: (t3) => `solid ${e3 ? t3.palette.action.disabled : Wa(t3.palette.divider, 0.2)} 1px`, borderRadius: (e4) => `${e4.shape.borderRadius}px`, overflow: "hidden" }, onClose: () => {
|
|
2311
|
+
Ue2(false), requestAnimationFrame(() => {
|
|
2312
|
+
ue2.current.focus();
|
|
2310
2313
|
});
|
|
2311
|
-
}, readOnly: e3, commands:
|
|
2312
|
-
}, [
|
|
2313
|
-
const e3 =
|
|
2314
|
-
|
|
2315
|
-
}, showHorizontalScrollbar:
|
|
2314
|
+
}, readOnly: e3, commands: _e2, ref: je2, scripts: pe2.getScripts() });
|
|
2315
|
+
}, [Ge2, _e2, pe2, i2, Fe2]), Gt2 = W(() => {
|
|
2316
|
+
const e3 = N(Ia, { style: { ...Pi, marginRight: Vt2 && ft2 ? "0px" : "6px" }, viewport: ze2, touchElement: ue2.current?.getGridElement()?.stage, onScrollViewport: (e4) => {
|
|
2317
|
+
ue2.current?.getGridElement()?.scrollTo(e4);
|
|
2318
|
+
}, showHorizontalScrollbar: it2 || lt2, showVerticalScrollbar: ct2, createHorizontalScrollbar: bt2, createVerticalScrollbar: Bt2, children: Ot2 });
|
|
2316
2319
|
let t3 = e3;
|
|
2317
|
-
|
|
2320
|
+
ft2 || (t3 = E(A, { children: [e3, xt2] }));
|
|
2318
2321
|
let o3 = null, n2 = 4, a3 = 13;
|
|
2319
|
-
return
|
|
2320
|
-
}, [
|
|
2321
|
-
return
|
|
2322
|
-
|
|
2322
|
+
return ft2 ? o3 = "m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991" : (o3 = "M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991", n2 = 13, a3 = 4), N(Ra, { fixedPane: "after", position: "40%", minAfter: ft2 ? "280px" : "120px", splitDirection: ft2 ? "row" : "column", style: Pi, ref: gt2, resizerProps: { className: "styled-resizer", style: { minWidth: ft2 ? "6px" : void 0, minHeight: ft2 ? void 0 : "6px", maskImage: `url("data:image/svg+xml,%3Csvg width='${n2}' height='${a3}' viewBox='0 0 ${n2} ${a3}' version='1.1' fill='${de2.palette.text.icon ?? de2.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${o3}' /%3E%3C/svg%3E%0A")`, maskRepeat: "no-repeat", maskPosition: ft2 ? "left center" : "top center" } }, elementBefore: t3, paneBeforeProps: { style: { flexDirection: "column" } }, elementAfter: Vt2, paneAfterProps: { style: { marginLeft: ft2 ? "0px" : "4px", marginRight: ft2 ? "8px" : "4px" } } });
|
|
2323
|
+
}, [it2, lt2, bt2, ct2, ze2, Vt2, Ot2, xt2, de2, ft2]), Ut2 = W(() => N(Oe, { arrow: true, disableInteractive: true, open: Ke2, title: N(Z, { variant: "subtitle2", component: "div", children: Ze2 }), placement: Ye2, TransitionProps: { timeout: { exit: 0 } }, PopperProps: { popperRef: qe2, sx: { "& .MuiTooltip-tooltip": { padding: "2px 6px", "& .MuiTooltip-arrow": { display: Ke2 ? "visible" : "none" } } }, anchorEl: { getBoundingClientRect: () => new DOMRect(et2.x, et2.y, et2.width, et2.height) }, modifiers: [{ name: "offset", options: { offset: [0, 0] } }] }, children: N(X, {}) }), [Ke2, Ze2, Ye2, et2, qe2]), jt2 = W(() => ({ boxSizing: "border-box", background: (e3) => "dark" !== e3.palette.mode ? Le2.header.fill : e3.palette.background.paper, "& *": { ...An(de2), fontWeight: 400 }, "&.Mui-focusVisible": {}, "& .viewport-overlay": { borderRight: `solid ${mt2} 1px` }, ...d2 }), [d2, Le2]), _t2 = W(() => N(X, { sx: { marginBottom: (e3) => e3.spacing(0.75) } }), []), qt2 = W(() => ({ flex: "1 1 100%", width: "100%", display: "flex", flexDirection: "column", opacity: we2 ? void 0 : 0, "--sxl-app-color-high-contrast": de2.palette.primary.main, "--sxl-app-color-primary": de2.palette.primary.main, "--sxl-app-color-primary-dark": de2.palette.primary.dark, "--sxl-app-color-primary-light": de2.palette.primary.light, "--sxl-app-color-info": de2.palette.info.main, "--sxl-app-color-info-dark": de2.palette.info.dark, "--sxl-app-color-info-light": de2.palette.info.light, "--sxl-app-color-secondary": de2.palette.secondary.main, "--sxl-app-color-secondary-dark": de2.palette.secondary.dark, "--sxl-app-color-secondary-light": de2.palette.secondary.light, "--sxl-app-color-success": de2.palette.success.main, "--sxl-app-color-success-dark": de2.palette.success.dark, "--sxl-app-color-success-light": de2.palette.success.light, "--sxl-app-color-warning": de2.palette.warning.main, "--sxl-app-color-warning-dark": de2.palette.warning.dark, "--sxl-app-color-warning-light": de2.palette.warning.light, "--sxl-app-color-error": de2.palette.error.main, "--sxl-app-color-error-dark": de2.palette.error.dark, "--sxl-app-color-error-light": de2.palette.error.light, "--sxl-app-color-text": de2.palette.text.primary, "--sxl-app-color-text-secondary": de2.palette.text.secondary, "--sxl-app-color-text-disabled": de2.palette.text.disabled, "--sxl-app-color-background": de2.palette.background.paper, "--sxl-app-color-button-surface": de2.palette.grey[600], "--sxl-app-color-shadow": de2.palette.action.focus, "--sxl-app-color-grey": de2.palette.grey[500], "--sxl-app-filter-dark-invert": Le2.body.darkMode && ie2 ? "hue-rotate(180deg) invert(1) brightness(95%)" : "none", "--sxl-app-image-background": Le2.body.darkMode ? `linear-gradient(${Wa("#fff", za(5))}, ${Wa("#fff", za(5))})` : void 0 }), [Le2, de2, we2]), Kt2 = W(() => Yn(Qr), []);
|
|
2324
|
+
return E(ce, { className: Yn("sheetxl-workbook", mi, { "Mui-focusVisible": ge2 }, ci, m2), sx: jt2, style: c2, square: false, ...se2, ref: ve2, onFocus: (e3) => {
|
|
2325
|
+
he2(true), Rt2(), p2?.(e3);
|
|
2323
2326
|
}, onBlur: (e3) => {
|
|
2324
|
-
|
|
2327
|
+
he2(false), u2?.(e3);
|
|
2325
2328
|
}, onKeyDown: (e3) => {
|
|
2326
|
-
|
|
2329
|
+
Pt2(e3), g2?.(e3);
|
|
2327
2330
|
}, onDragStart: (e3) => {
|
|
2328
2331
|
if (e3.target.src) {
|
|
2329
2332
|
const t3 = new Image();
|
|
2330
2333
|
t3.src = e3.target.src, e3.dataTransfer.setDragImage(t3, 1, 1);
|
|
2331
2334
|
}
|
|
2332
|
-
}, onDragEnter:
|
|
2335
|
+
}, onDragEnter: At2, onDragLeave: At2, onDragOver: At2, onDrop: It2, children: [E("div", { className: Kt2, style: qt2, children: [ut2, st2 ? zt2 : null, _t2, Gt2, pt2, Ut2, Ct2, Lt2] }), Wt2] });
|
|
2333
2336
|
}));
|
|
2334
2337
|
Ri.displayName = "WorkbookElement";
|
|
2335
|
-
const Mi = (e2 = false, t2 = false) => t2 ? null : { "& input:not(:focus):not(:hover)": { color: (e3) => e3.palette.text.secondary }, backgroundColor: (e3) =>
|
|
2336
|
-
const { sx: o2, workbook: n2, title: a2 = "", placeHolder: r2 = "Untitled", onTitleChange: l2, readOnly: i2 = false, hidden: s2, ...d2 } = e2, [c2, m2] =
|
|
2337
|
-
|
|
2338
|
+
const Mi = (e2 = false, t2 = false) => t2 ? null : { "& input:not(:focus):not(:hover)": { color: (e3) => e3.palette.text.secondary }, backgroundColor: (e3) => Wa(e3.palette.background.paper, 0.6), borderRadius: (e3) => `${e3.shape.borderRadius}px`, border: (t3) => `solid ${e2 ? t3.palette.divider : "transparent"} 1px`, "&.Mui-disabled": { border: (t3) => `solid ${e2 ? t3.palette.divider : "transparent"} 1px` }, "&:focus-within:not([disabled])": { backgroundColor: (e3) => e3.palette.background.paper }, "&:hover:not([disabled])": { border: (t3) => `solid ${e2 ? t3.palette.text?.primary : t3.palette.divider} 1px`, backgroundColor: null }, "&.Mui-focusVisible": { outline: (e3) => `solid ${e3.palette.primary.main} 1px !important`, border: (e3) => `1px solid ${e3.palette?.primary?.main} !important` } }, Fi = L(H((e2, t2) => {
|
|
2339
|
+
const { sx: o2, workbook: n2, title: a2 = "", placeHolder: r2 = "Untitled", onTitleChange: l2, readOnly: i2 = false, hidden: s2, ...d2 } = e2, [c2, m2] = O(false), [p2, u2] = O(false), [g2, h2] = O(a2 ?? ""), [f2, x2] = O(""), [b2, { width: y2 }] = Xa(), [w2, { width: k2 }] = Xa(), [S2, C2] = O(false), v2 = U(null), T2 = U(null), D2 = Pa(t2, () => ({ requestWorkbookTitle: (e3 = null, t3) => {
|
|
2340
|
+
T2.current = { onAccept: e3, requestReason: t3?.requestReason }, t3?.selectAll && v2.current?.select(), v2.current?.focus(t3);
|
|
2338
2341
|
}, focus: (e3) => {
|
|
2339
|
-
|
|
2342
|
+
v2.current?.focus(e3);
|
|
2340
2343
|
} }), []);
|
|
2341
|
-
return
|
|
2342
|
-
|
|
2343
|
-
}, [a2]),
|
|
2344
|
-
|
|
2345
|
-
|
|
2344
|
+
return K(() => {
|
|
2345
|
+
C2(a2 !== g2), x2(a2), h2(a2);
|
|
2346
|
+
}, [a2]), V(() => {
|
|
2347
|
+
S2 && 0 !== y2 && ja.debounce(() => {
|
|
2348
|
+
C2(false);
|
|
2346
2349
|
}, 300)();
|
|
2347
|
-
}, [
|
|
2350
|
+
}, [S2, y2]), V(() => {
|
|
2348
2351
|
u2(g2 && !Ya.isValidWindowsFilename(g2));
|
|
2349
|
-
}, [g2]), s2 ? null :
|
|
2352
|
+
}, [g2]), s2 ? null : N(X, { sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", opacity: S2 ? "0" : "1", transition: S2 ? void 0 : "opacity .25s ease-in", "& .tooltip-wrapper": { maxWidth: "100%" } }, ref: Ua([D2, w2, t2]), ...d2, children: N(Je, { label: T2.current?.requestReason ?? "Workbook Name", children: E(X, { className: Yn({ "Mui-focusVisible": c2 }), sx: { visibility: 0 === y2 ? "hidden" : "visible", display: "block", maxWidth: "100%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", paddingLeft: "12px", paddingRight: "12px", marginLeft: "2px", marginRight: "2px", paddingTop: "2px", paddingBottom: "1px", ...Mi(true, i2), ...o2 }, children: [i2 ? N(Z, { variant: "subtitle1", component: "div", sx: { whiteSpace: "nowrap", fontStyle: g2 !== f2 ? "italic" : void 0, userSelect: "none", textOverflow: "ellipsis", lineHeight: "1.4375em", border: "transparent 1px solid", color: (e3) => p2 ? e3.palette.error.dark : void 0 }, children: a2 ?? r2 }) : N(oe, { sx: { width: `${Math.min(y2 + 3, Math.max(k2, D2.current?.getBoundingClientRect()?.width))}px`, overflow: "hidden", whiteSpace: "nowrap", fontWeight: "600", maxWidth: "100%", border: "none", padding: "0px", margin: "0px", color: (e3) => p2 ? e3.palette.error.dark : void 0, fontStyle: g2 !== f2 ? "italic" : void 0, "& input": { paddingTop: "0px", paddingBottom: "0px", textOverflow: "ellipsis" } }, disableUnderline: true, fullWidth: false, multiline: false, readOnly: i2, spellCheck: false, placeholder: r2, onFocus: (e3) => {
|
|
2350
2353
|
m2(true), e3.target?.select();
|
|
2351
|
-
}, inputProps: { name: "input-workbook-title", autoComplete: "off", ref:
|
|
2352
|
-
m2(false), p2 ? h2(f2) : (g2 !== f2 && (l2?.(g2), g2 &&
|
|
2354
|
+
}, inputProps: { name: "input-workbook-title", autoComplete: "off", ref: v2 }, onBlur: () => {
|
|
2355
|
+
m2(false), p2 ? h2(f2) : (g2 !== f2 && (l2?.(g2), g2 && T2.current?.onAccept?.(g2, "blur")), T2.current = null);
|
|
2353
2356
|
}, onChange: (e3) => {
|
|
2354
2357
|
if (e3.target.value.length > Ya.MAX_WORKBOOK_NAME_SIZE) return e3.stopPropagation(), void e3.preventDefault();
|
|
2355
2358
|
h2(e3.target.value);
|
|
2356
2359
|
}, onKeyDown: (e3) => {
|
|
2357
|
-
(Ya.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(e3.key) || e3.target?.value.length > Ya.MAX_WORKBOOK_NAME_SIZE) && e3.preventDefault(), e3.which ===
|
|
2360
|
+
(Ya.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(e3.key) || e3.target?.value.length > Ya.MAX_WORKBOOK_NAME_SIZE) && e3.preventDefault(), e3.which === Sa.Enter || e3.which === Sa.Tab ? (p2 ? h2(f2) : (l2?.(g2), g2 && (T2.current?.onAccept?.(g2, "keydown"), T2.current = null)), e3.stopPropagation(), e3.preventDefault(), n2?.focus()) : e3.which === Sa.Escape && (g2 === f2 ? n2?.focus() : (h2(f2), setTimeout(() => {
|
|
2358
2361
|
e3.target?.select();
|
|
2359
|
-
}, 0)),
|
|
2360
|
-
}, value: g2 }),
|
|
2362
|
+
}, 0)), T2.current = null, e3.stopPropagation(), e3.preventDefault());
|
|
2363
|
+
}, value: g2 }), N(X, { ref: b2, sx: { position: "absolute", visibility: "hidden", top: "-9999px", fontWeight: "600 !important", whiteSpace: "pre", fontStyle: g2 !== f2 ? "italic" : void 0, fontFamily: (e3) => e3.typography.fontFamily, letterSpacing: "0.00938em" }, children: g2 || r2 })] }) }) });
|
|
2361
2364
|
}));
|
|
2362
2365
|
Fi.displayName = "WorkbookTitle";
|
|
2363
|
-
const Bi =
|
|
2366
|
+
const Bi = L(H((e2, t2) => {
|
|
2364
2367
|
const { sx: o2, style: n2, className: a2, licenseKey: r2, renderLoadingPanel: l2, ...i2 } = e2;
|
|
2365
2368
|
r2 && g.setLicenseKey(r2);
|
|
2366
|
-
const s2 =
|
|
2369
|
+
const s2 = W(() => {
|
|
2367
2370
|
const e3 = { transitionDelay: "160ms", transparentBackground: true };
|
|
2368
|
-
return
|
|
2369
|
-
}, [o2, n2, l2]), d2 =
|
|
2370
|
-
return
|
|
2371
|
+
return N(X, { sx: o2, style: { width: "100%", height: "100%", position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, children: l2?.(e3) ?? N(Ve, { ...e3 }) });
|
|
2372
|
+
}, [o2, n2, l2]), d2 = W(() => I.lazy(async () => await Promise.resolve().then(() => Gi)), []);
|
|
2373
|
+
return N(A, { children: N(G, { fallback: s2, children: N(d2, { ...i2, className: a2, renderLoadingPanel: l2, sx: o2, style: n2, ref: t2 }) }) });
|
|
2371
2374
|
}));
|
|
2372
2375
|
Bi.displayName = "Studio";
|
|
2373
2376
|
const Ni = [{ key: "SheetXL", description: "SheetXL", mimeType: ".sxl", exts: ["sxl"], handler: null, isDefault: true }, { key: "CSV", description: "Comma Delimited", mimeType: "text/csv", exts: ["csv"], handler: null }, { key: "Excel", description: "Excel Workbook", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", exts: ["xlsx", "xls", "xlsm"], handler: null }], Ei = [{ key: "SheetXL", mimeType: "application/vnd.sheetxl.sheet", description: "SheetXL", ext: "sxl", handler: null, isDefault: true }, { key: "CSV", mimeType: "text/csv", description: "Comma Delimited", ext: "csv", handler: null }, { key: "Excel", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", description: "Excel Workbook", ext: "xlsx", tags: ["SheetJS Pro"], handler: null }];
|
|
@@ -2413,65 +2416,65 @@ class Ai {
|
|
|
2413
2416
|
}
|
|
2414
2417
|
}
|
|
2415
2418
|
}
|
|
2416
|
-
const Ii = new Ai(), Li = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, Hi =
|
|
2417
|
-
const { id: o2, message: n2, iconVariant: a2, error: r2, hideIconVariant: l2, ...i2 } = e2, { closeSnackbar: s2 } = er(), d2 =
|
|
2419
|
+
const Ii = new Ai(), Li = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, Hi = H((e2, t2) => {
|
|
2420
|
+
const { id: o2, message: n2, iconVariant: a2, error: r2, hideIconVariant: l2, ...i2 } = e2, { closeSnackbar: s2 } = er(), d2 = Ha(), [c2, m2] = O(false), p2 = z(() => {
|
|
2418
2421
|
m2((e3) => !e3);
|
|
2419
|
-
}, []), u2 =
|
|
2422
|
+
}, []), u2 = z(() => {
|
|
2420
2423
|
s2(o2);
|
|
2421
2424
|
}, [o2, s2]);
|
|
2422
2425
|
let g2 = r2?.message;
|
|
2423
|
-
return !g2 &&
|
|
2426
|
+
return !g2 && $(n2) && (g2 = n2), g2 || "string" != typeof n2 || (g2 = n2), g2 || (g2 = `Unknown Error: ${n2}`), N(tr, { ref: t2, className: Yn(Li.root, "error-snackbar"), children: E(fe, { className: Li.card, style: { backgroundColor: d2.palette.error.dark, border: `1px solid ${d2.palette.error.dark}` }, children: [E(xe, { className: Li.actionRoot, children: [l2 ? null : a2?.error, N(Z, { variant: "body2", component: "div", className: Li.typography, children: g2 }), N("div", { style: { flex: "1 1 auto" } }), E("div", { className: Li.icons, children: [r2 ? N(J, { "aria-label": "Show more", size: "small", className: Yn(Li.expand, { [Li.expandOpen]: c2 }), onClick: p2, children: N(ca, {}) }) : null, N(J, { size: "small", className: Li.expand, onClick: u2, children: N(ga, { fontSize: "small" }) })] })] }), r2 ? N(be, { in: c2, timeout: "auto", unmountOnExit: true, children: N("div", { className: Li.stackTraceContainer, style: { backgroundColor: d2.palette.error.light, borderTop: `1px solid ${d2.palette.error.main}` }, children: N(In, { error: r2, hideLineNumbers: true }) }) }) : null] }) });
|
|
2424
2427
|
});
|
|
2425
2428
|
Hi.displayName = "ToastError";
|
|
2426
|
-
const Wi =
|
|
2427
|
-
const { commands: o2, commandHook: n2, scope: a2 = "workbook", disabled: r2 = false, ...l2 } = e2, i2 =
|
|
2428
|
-
const t3 = { variant:
|
|
2429
|
+
const Wi = L(H((e2, t2) => {
|
|
2430
|
+
const { commands: o2, commandHook: n2, scope: a2 = "workbook", disabled: r2 = false, ...l2 } = e2, i2 = wa((e3) => {
|
|
2431
|
+
const t3 = { variant: ya.Menuitem, parentFloat: e3.floatReference, commandHook: n2, scope: a2, disabled: r2 }, l3 = E(A, { children: [N(ke, { ...t3, command: o2.getCommand("newWorkbook"), icon: we(N(Ln, {})) }), N(Se, { orientation: "horizontal" }), N(ke, { ...t3, command: o2.getCommand("openWorkbook"), icon: we(N(Hn, {})) }), N(De, { ...t3, commands: o2, quickCommand: "saveWorkbook", icon: we(N($n, {})), createPopupPanel: (e4) => {
|
|
2429
2432
|
const n3 = { ...t3, parentFloat: e4.floatReference, scope: "saveWorkbook" }, a3 = [];
|
|
2430
2433
|
return Ii.getWriteFormats().forEach((e5) => {
|
|
2431
2434
|
if (e5.isDefault) return;
|
|
2432
2435
|
let t4 = null;
|
|
2433
|
-
"CSV" === e5.key ? t4 =
|
|
2436
|
+
"CSV" === e5.key ? t4 = we(N(Wn, {})) : "Excel" === e5.key && (t4 = we(N(zn, {})));
|
|
2434
2437
|
const r3 = o2.getCommand(`saveWorkbookAs${e5.key}`);
|
|
2435
|
-
r3 ? a3.push(
|
|
2436
|
-
}),
|
|
2438
|
+
r3 ? a3.push(j(ke, { ...n3, key: e5.key, command: r3, icon: t4 })) : console.warn(`Unable to resolve command: 'saveWorkbookAs${e5.key}'`);
|
|
2439
|
+
}), Te({ ...e4, children: a3, onClick: () => {
|
|
2437
2440
|
e4.closeFloatAll();
|
|
2438
2441
|
} });
|
|
2439
2442
|
} })] });
|
|
2440
|
-
return
|
|
2443
|
+
return Te({ ...e3, children: l3, onClick: (t4) => {
|
|
2441
2444
|
t4.isDefaultPrevented || e3.closeFloatAll();
|
|
2442
2445
|
} });
|
|
2443
2446
|
}, [r2, o2, n2, a2]), s2 = "File";
|
|
2444
|
-
return
|
|
2447
|
+
return N(De, { commands: o2, disabled: r2, commandHook: n2, scope: a2, label: s2, tooltip: "Options for saving and loading the workbook.", sx: { paddingBottom: "0px", "& button": { paddingTop: "0px", paddingBottom: "0px", height: (e3) => `calc(1.25rem + ${e3.spacing(2)}px)` } }, ...l2, createPopupPanel: i2, icon: N(Ft, { className: "label", icon: null, label: s2 }) });
|
|
2445
2448
|
}));
|
|
2446
2449
|
Wi.displayName = "StandaloneFileCommandButton";
|
|
2447
|
-
const zi =
|
|
2450
|
+
const zi = N(Je, { label: "SheetXL", description: "Visit me at sheetxl.com.", children: N(X, { sx: { width: "24px", height: "24px", marginBottom: "4px", marginLeft: "6px" }, children: N(B, { onClick: () => {
|
|
2448
2451
|
window?.open("https://www.sheetxl.com", "_blank");
|
|
2449
|
-
}, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), $i =
|
|
2450
|
-
const { commands: o2, workbook: n2, logo: a2 = zi, mainElement: r2, showFileMenu: l2 = true, showAppearanceMenu: i2 = true, ...s2 } = e2, { reference: d2 } =
|
|
2452
|
+
}, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), $i = L(H((e2, t2) => {
|
|
2453
|
+
const { commands: o2, workbook: n2, logo: a2 = zi, mainElement: r2, showFileMenu: l2 = true, showAppearanceMenu: i2 = true, ...s2 } = e2, { reference: d2 } = Eo(), [c2, { width: m2 }] = Xa(), p2 = m2 < 530, u2 = l2 ? N(Wi, { commands: o2, commandHook: { beforeExecute() {
|
|
2451
2454
|
d2?.closeAll();
|
|
2452
2455
|
}, onError(e3, t3, o3) {
|
|
2453
|
-
} } }) : null, g2 = i2 ?
|
|
2456
|
+
} } }) : null, g2 = i2 ? N(pl, { commands: o2, commandHook: { beforeExecute() {
|
|
2454
2457
|
d2?.closeAll();
|
|
2455
2458
|
}, onError(e3, t3, o3) {
|
|
2456
|
-
} } }) : null, h2 =
|
|
2457
|
-
return
|
|
2459
|
+
} } }) : null, h2 = W(() => ({ paddingLeft: (e3) => e3.spacing(1), paddingRight: (e3) => e3.spacing(1) }), []), f2 = U(null);
|
|
2460
|
+
return N(X, { ref: Ua([f2, c2, t2]), ...s2, children: ni({ commands: o2, renderCompact: p2, workbook: n2, selectWrapper: (e3) => E(X, { sx: { display: "flex", flex: "1", flexDirection: "row", alignItems: "stretch", gap: (e4) => e4.spacing(1), paddingLeft: (e4) => e4.spacing(1), paddingRight: (e4) => e4.spacing(1) }, children: [E(X, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (e4) => e4.spacing(0.5) }, children: [a2, E(X, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (e4) => e4.spacing(0.25) }, children: [u2, e3] })] }), N(X, { sx: { display: "flex", flexDirection: "row", flex: "1 1 300%", overflow: "hidden", alignItems: "center", justifyContent: "center" }, children: r2 }), N(X, { sx: { display: "flex", alignItems: "center", justifyContent: "end", flex: p2 && !g2 ? "0 0 auto" : "1 1 100%" }, children: g2 })] }), selectProps: h2, toolbarsProps: { Home: { sx: {} } } }) });
|
|
2458
2461
|
}));
|
|
2459
2462
|
$i.displayName = "StudioToolbar";
|
|
2460
|
-
const Oi =
|
|
2463
|
+
const Oi = L(H((e2, t2) => {
|
|
2461
2464
|
const { workbook: o2, setWorkbook: n2, refWorkbookTitle: a2, titleWorkbook: r2, setWorkbookTitle: l2, titlePlaceHolder: i2, children: s2, undoManager: d2, commands: c2, importExportDisabled: m2, themeOptions: p2 } = e2, u2 = er(), g2 = u2 ? u2.enqueueSnackbar : () => {
|
|
2462
2465
|
}, h2 = u2 ? u2.closeSnackbar : () => {
|
|
2463
|
-
}, [f2,
|
|
2464
|
-
|
|
2465
|
-
}, []),
|
|
2466
|
-
|
|
2467
|
-
}, []),
|
|
2466
|
+
}, [f2, x2] = O({ isMounted: false, label: null, starting: /* @__PURE__ */ new Map(), running: /* @__PURE__ */ new Map() }), b2 = z(() => {
|
|
2467
|
+
x2((e3) => ({ ...e3, isMounted: true }));
|
|
2468
|
+
}, []), y2 = z(() => {
|
|
2469
|
+
x2((e3) => ({ ...e3, isMounted: false }));
|
|
2470
|
+
}, []), w2 = {}, k2 = Un(w2), S2 = jn(w2), C2 = _n(w2), v2 = U(/* @__PURE__ */ new Set()), T2 = W(() => {
|
|
2468
2471
|
const e3 = (e4, t3) => {
|
|
2469
2472
|
if (t3?.onceKey) {
|
|
2470
|
-
if (
|
|
2471
|
-
const e5 = new Set(
|
|
2472
|
-
e5.add(t3.onceKey),
|
|
2473
|
+
if (v2.current.has(t3.onceKey)) return;
|
|
2474
|
+
const e5 = new Set(v2.current);
|
|
2475
|
+
e5.add(t3.onceKey), v2.current = e5;
|
|
2473
2476
|
}
|
|
2474
|
-
const o3 = { variant: t3?.type ??
|
|
2477
|
+
const o3 = { variant: t3?.type ?? Da.Info, anchorOrigin: { vertical: "top", horizontal: "center" }, preventDuplicate: t3?.preventDuplicate, persist: t3?.persist ?? t3?.type === Da.Error, action: (e5) => N(J, { onClick: () => h2(e5), children: N(xa, {}) }) };
|
|
2475
2478
|
t3?.enqueueProps && Object.assign(o3, t3.enqueueProps), e4 || console.log("message is 'null'", t3), g2(e4 ?? "Alert", o3);
|
|
2476
2479
|
};
|
|
2477
2480
|
return { showMessage: e3, showBusy: (e4, t3) => {
|
|
@@ -2479,7 +2482,7 @@ const Oi = k(S((e2, t2) => {
|
|
|
2479
2482
|
const n3 = new Promise((e5) => {
|
|
2480
2483
|
o3 = e5;
|
|
2481
2484
|
});
|
|
2482
|
-
return
|
|
2485
|
+
return x2((t4) => {
|
|
2483
2486
|
const a3 = new Map(t4.starting);
|
|
2484
2487
|
a3.set(n3, o3);
|
|
2485
2488
|
return { ...t4, label: e4, starting: a3 };
|
|
@@ -2488,14 +2491,14 @@ const Oi = k(S((e2, t2) => {
|
|
|
2488
2491
|
const n3 = { ...t3, onKeyDown: (e5) => {
|
|
2489
2492
|
c2?.dispatchToFocusedCommand(e5), e5.isDefaultPrevented() || e5.isPropagationStopped() || t3?.onKeyDown?.(e5);
|
|
2490
2493
|
} };
|
|
2491
|
-
return
|
|
2492
|
-
}, showOptions:
|
|
2493
|
-
let o3, n3 =
|
|
2494
|
-
"string" == typeof t3 ? a3 = t3 : t3 instanceof Error && (o3 = t3, t3.message && (a3 = t3.message)), t3 instanceof qa && (n3 =
|
|
2494
|
+
return k2(e4, { sort: () => import("./BYxSe-f9SXkVQCOn.mjs"), numberFormat: () => import("./1bQb13SILtJFnqBQ.mjs"), hyperlink: () => import("./BNH5761S3vit417d.mjs"), comments: () => import("./_Nq9WHxw-bmMA6Eh.mjs"), find: () => import("./Dw2SSXphjQ4gTuEe.mjs"), tableDetails: () => import("./uS3k2AKeGAjgsirO.mjs"), tableNew: () => import("./5715fftg6SqkmbCs.mjs"), namedDetails: () => import("./CJQiYToWJ-8AaD8d.mjs") }[e4], n3, o3);
|
|
2495
|
+
}, showOptions: S2, showInputOptions: C2, showError: (t3) => {
|
|
2496
|
+
let o3, n3 = Da.Error, a3 = "Unknown Error";
|
|
2497
|
+
"string" == typeof t3 ? a3 = t3 : t3 instanceof Error && (o3 = t3, t3.message && (a3 = t3.message)), t3 instanceof qa && (n3 = Da.Info), e3(a3, { type: n3, enqueueProps: { error: o3 } });
|
|
2495
2498
|
} };
|
|
2496
|
-
}, []),
|
|
2497
|
-
}, []),
|
|
2498
|
-
const { workbook: t3, setWorkbook: o3, importExportDisabled: n3, workbookTitle: a3 = "export", setWorkbookTitle: r3, notifier: l3, requestWorkbookTitle: i3, themeOptions: s3, undoManager: d3, commands: c3, onExecute: m3 } = e3, p3 =
|
|
2499
|
+
}, []), D2 = z(() => {
|
|
2500
|
+
}, []), P2 = ((e3) => {
|
|
2501
|
+
const { workbook: t3, setWorkbook: o3, importExportDisabled: n3, workbookTitle: a3 = "export", setWorkbookTitle: r3, notifier: l3, requestWorkbookTitle: i3, themeOptions: s3, undoManager: d3, commands: c3, onExecute: m3 } = e3, p3 = wa(s3?.onModeChange, [s3?.onModeChange]), u3 = wa(s3?.onEnabledDarkGridChange, [s3?.onEnabledDarkGridChange]), g3 = wa(s3?.onEnabledDarkImagesChange, [s3?.onEnabledDarkImagesChange]), h3 = wa(async (e4 = null, t4 = null) => {
|
|
2499
2502
|
const o4 = [];
|
|
2500
2503
|
let n4, a4 = null, r4 = null;
|
|
2501
2504
|
if ("string" == typeof e4 ? r4 = e4 : a4 = e4, n4 = a4 ? e4 : await ja.openFileDialog(r4 ?? Ii.getAllReadFormatTypeAsString().join(",")), !n4) return null;
|
|
@@ -2503,29 +2506,29 @@ const Oi = k(S((e2, t2) => {
|
|
|
2503
2506
|
o4.push(e5);
|
|
2504
2507
|
} }, s4 = await Ii.read(i4, l3);
|
|
2505
2508
|
return o4.length > 0 && (l3?.showMessage?.("Some elements were not able to be imported. See console for details."), console.warn("Import warnings:\n" + o4.join("\n"))), s4;
|
|
2506
|
-
}, [m3, l3, t3]), f3 =
|
|
2509
|
+
}, [m3, l3, t3]), f3 = wa(async (e4, t4, o4) => {
|
|
2507
2510
|
if (!t4 && i3) {
|
|
2508
2511
|
const t5 = await i3("Enter Workbook name to " + (o4.isDefault ? "Save." : `Export as ${o4.description}.`));
|
|
2509
2512
|
return null !== t5 && Ii.writeFile(t5, e4, { formatType: o4.key });
|
|
2510
2513
|
}
|
|
2511
2514
|
return Ii.writeFile(t4, e4, { formatType: o4.key });
|
|
2512
|
-
}, [l3, t3, i3]),
|
|
2513
|
-
} }), []),
|
|
2515
|
+
}, [l3, t3, i3]), x3 = z(() => ({ contains: (e4) => true, focus() {
|
|
2516
|
+
} }), []), b3 = W(() => {
|
|
2514
2517
|
const e4 = [];
|
|
2515
2518
|
n3 || (Ii.getWriteFormats().forEach((o4) => {
|
|
2516
2519
|
const n4 = o4.isDefault, r4 = { label: n4 ? "Save Workbook" : `Save Workbook as ${o4.description}`, scopedLabels: { workbook: "Save", saveWorkbook: `as ${o4.description}` }, tags: o4.tags, description: `Save the workbook to the desktop${n4 ? "" : ` as ${o4.description}`}.` };
|
|
2517
|
-
n4 && (r4.shortcut = { key: "S", modifiers: [
|
|
2520
|
+
n4 && (r4.shortcut = { key: "S", modifiers: [Na.Ctrl] }, e4.push(new Ba("saveWorkbookAs", x3, { label: "Save Workbook As…", scopedLabels: { workbook: "Save as…", saveWorkbook: "as…" }, shortcut: [{ key: "S", modifiers: [Na.Shift, Na.Ctrl] }, { key: "F12" }], description: "Save the workbook to the desktop with the provided name." }, () => {
|
|
2518
2521
|
f3(t3, null, o4).catch((e5) => {
|
|
2519
2522
|
l3?.showError?.(e5);
|
|
2520
2523
|
});
|
|
2521
2524
|
})));
|
|
2522
2525
|
const i5 = n4 ? "saveWorkbook" : `saveWorkbookAs${o4.key}`;
|
|
2523
|
-
e4.push(new
|
|
2526
|
+
e4.push(new Ba(i5, x3, r4, (e5) => {
|
|
2524
2527
|
f3(t3, e5 ?? a3, o4).catch((e6) => {
|
|
2525
2528
|
l3?.showError?.(e6);
|
|
2526
2529
|
});
|
|
2527
2530
|
}));
|
|
2528
|
-
}), e4.push(new
|
|
2531
|
+
}), e4.push(new Ba("openWorkbook", x3, { label: "Open Workbook…", scopedLabels: { workbook: "Open…" }, description: "Open a workbook from the desktop.", shortcut: { key: "O", modifiers: [Na.Ctrl] } }, async (e5 = null) => {
|
|
2529
2532
|
const n4 = { date1904: t3.isDate1904(), ...t3.options };
|
|
2530
2533
|
try {
|
|
2531
2534
|
const a4 = await h3(e5, n4);
|
|
@@ -2543,7 +2546,7 @@ const Oi = k(S((e2, t2) => {
|
|
|
2543
2546
|
} catch (e6) {
|
|
2544
2547
|
l3?.showError?.(e6);
|
|
2545
2548
|
}
|
|
2546
|
-
})), e4.push(new
|
|
2549
|
+
})), e4.push(new Ba("openWorkbookFromUrl", x3, { label: "Open Workbook From Web", scopedLabels: { insert: "From Web", workbook: "From Web…" }, description: "Open a workbook from the web." }, async function(e5) {
|
|
2547
2550
|
if (!e5) {
|
|
2548
2551
|
const t4 = await l3?.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"] });
|
|
2549
2552
|
if ("Open" !== t4.option) return;
|
|
@@ -2552,58 +2555,58 @@ const Oi = k(S((e2, t2) => {
|
|
|
2552
2555
|
e5 && console.log("openWorkbookFromUrl", e5);
|
|
2553
2556
|
})));
|
|
2554
2557
|
let i4 = [];
|
|
2555
|
-
return s3 && (i4 = [new
|
|
2556
|
-
}), new
|
|
2557
|
-
}), new
|
|
2558
|
+
return s3 && (i4 = [new Ba("themeMode", x3, { label: "Light/Dark Mode", scopedLabels: { appearance: "Light/Dark Mode" }, description: "Toggle the application styling between light and dark mode." }), new Ba("defaultThemeMode", x3, { label: "Use System Light/Dark Mode", scopedLabels: { appearance: "Use System Default" }, description: "Use the system settings to determine styling for light and dark mode." }), new Ba("enableDarkGrid", x3, { label: "Enable Dark Grid", description: "Allow the grid to render in dark mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)." }), new Ba("enableDarkImages", x3, { label: "Enable Dark Images", description: "Allow the images to render in dark mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode." })]), [...e4, ...i4, new Fa("help", x3, { label: "Show Help", description: "Provide Help.", shortcut: { key: "F1" } }, () => {
|
|
2559
|
+
}), new Fa("showKeyboardShortcuts", x3, { label: "Keyboard Shortcuts", description: "Show keyboard shortcuts.", shortcut: { key: "/", modifiers: [Na.Ctrl] } }, () => {
|
|
2560
|
+
}), new Ba("gotoUrlGithub", x3, { label: "Github", description: "Download examples, explore source code, and leave a star." }, () => {
|
|
2558
2561
|
window?.open("https://github.com/sheetxl/sheetxl");
|
|
2559
|
-
}), new
|
|
2562
|
+
}), new Ba("gotoUrlDiscord", x3, { label: "Discord", description: "Join our community on discord." }, () => {
|
|
2560
2563
|
window?.open("https://discord.gg/NTKdwUgK9p");
|
|
2561
|
-
}), new
|
|
2564
|
+
}), new Ba("gotoUrlDocumentation", x3, { label: "Documentation", description: "Read the documentation." }, () => {
|
|
2562
2565
|
window?.open("https://www.sheetxl.com/docs");
|
|
2563
|
-
}), new
|
|
2566
|
+
}), new Ba("gotoUrlIssue", x3, { label: "Create Issue", description: "Create an issue to identify a bug or a feature request." }, () => {
|
|
2564
2567
|
window?.open("https://github.com/sheetxl/sheetxl/issues");
|
|
2565
2568
|
})];
|
|
2566
|
-
}, [t3, a3, l3, n3, s3, c3, d3]),
|
|
2569
|
+
}, [t3, a3, l3, n3, s3, c3, d3]), y3 = W(() => {
|
|
2567
2570
|
let e4 = null;
|
|
2568
|
-
return e4 = c3 ? c3.createChildGroup(
|
|
2569
|
-
}, [c3,
|
|
2570
|
-
|
|
2571
|
-
const { themeMode:
|
|
2572
|
-
|
|
2573
|
-
if (!s3 || !
|
|
2574
|
-
const e4 = "dark" === s3.mode || !s3.mode && "dark" ===
|
|
2575
|
-
|
|
2576
|
-
p3(e4 ?
|
|
2577
|
-
}),
|
|
2571
|
+
return e4 = c3 ? c3.createChildGroup(x3, "standaloneWorkbook", false) : new Ea(x3, "standaloneWorkbook"), e4.addCommands(b3, true), e4;
|
|
2572
|
+
}, [c3, b3]);
|
|
2573
|
+
La({ manager: d3, commands: y3, notifier: l3 });
|
|
2574
|
+
const { themeMode: w3 } = On();
|
|
2575
|
+
V(() => {
|
|
2576
|
+
if (!s3 || !y3) return;
|
|
2577
|
+
const e4 = "dark" === s3.mode || !s3.mode && "dark" === w3;
|
|
2578
|
+
y3.getCommand("themeMode").update({ state: s3.mode ?? null, label: e4 ? "Dark Mode" : "Light Mode", scopedLabels: { appearance: e4 ? "Dark Mode" : "Light Mode" } }).updateCallback(() => {
|
|
2579
|
+
p3(e4 ? Vn.Light : Vn.Dark);
|
|
2580
|
+
}), y3.getCommand("defaultThemeMode").update({ state: !s3.mode }).updateCallback(() => {
|
|
2578
2581
|
p3(null);
|
|
2579
|
-
}),
|
|
2582
|
+
}), y3.getCommand("enableDarkGrid").update({ state: s3.enableDarkGrid }).updateCallback(() => {
|
|
2580
2583
|
u3(!s3.enableDarkGrid);
|
|
2581
|
-
}),
|
|
2584
|
+
}), y3.getCommand("enableDarkImages").update({ state: s3.enableDarkImages }).updateCallback(() => {
|
|
2582
2585
|
g3(!s3.enableDarkImages);
|
|
2583
2586
|
});
|
|
2584
|
-
}, [
|
|
2585
|
-
const { showModal:
|
|
2586
|
-
return
|
|
2587
|
+
}, [w3, s3, b3]);
|
|
2588
|
+
const { showModal: k3 } = Gn();
|
|
2589
|
+
return V(() => {
|
|
2587
2590
|
const e4 = () => new Promise((e5, t4) => {
|
|
2588
|
-
const o4 =
|
|
2591
|
+
const o4 = I.lazy(() => import("./d78UMCfSqw7_DwUj.mjs")), n4 = k3(o4, { title: "Shortcut Keys Reference", commands: y3, onDone: () => {
|
|
2589
2592
|
n4.hide();
|
|
2590
2593
|
}, TransitionProps: { onExited: () => {
|
|
2591
2594
|
e5(true);
|
|
2592
2595
|
} } });
|
|
2593
2596
|
});
|
|
2594
|
-
|
|
2595
|
-
}, [
|
|
2597
|
+
y3.getCommand("showKeyboardShortcuts").updateCallback(() => e4()), y3.getCommand("help").updateCallback(() => e4());
|
|
2598
|
+
}, [b3, y3]), y3;
|
|
2596
2599
|
})({ workbook: o2, setWorkbook: n2, importExportDisabled: m2, workbookTitle: r2, setWorkbookTitle: l2, commands: c2, requestWorkbookTitle: (e3) => new Promise((t3) => {
|
|
2597
2600
|
a2.current ? a2.current.requestWorkbookTitle((e4, o3) => {
|
|
2598
2601
|
t3(e4);
|
|
2599
2602
|
}, { selectAll: true, requestReason: e3 }) : t3(i2);
|
|
2600
|
-
}), themeOptions: p2, undoManager: d2, notifier:
|
|
2601
|
-
|
|
2602
|
-
f2.starting.size <= 0 || !f2.isMounted ||
|
|
2603
|
+
}), themeOptions: p2, undoManager: d2, notifier: T2, onExecute: D2 });
|
|
2604
|
+
V(() => {
|
|
2605
|
+
f2.starting.size <= 0 || !f2.isMounted || x2((e3) => {
|
|
2603
2606
|
const t3 = new Map(e3.running);
|
|
2604
2607
|
e3.starting.forEach((e4, o3) => {
|
|
2605
2608
|
const n3 = () => {
|
|
2606
|
-
|
|
2609
|
+
x2((e5) => {
|
|
2607
2610
|
const t4 = new Map(e5.running);
|
|
2608
2611
|
t4.delete(o3);
|
|
2609
2612
|
return { ...e5, running: t4 };
|
|
@@ -2614,94 +2617,94 @@ const Oi = k(S((e2, t2) => {
|
|
|
2614
2617
|
return { ...e3, starting: /* @__PURE__ */ new Map(), running: t3 };
|
|
2615
2618
|
});
|
|
2616
2619
|
}, [f2]);
|
|
2617
|
-
const [
|
|
2618
|
-
|
|
2619
|
-
0 !== f2.starting.size || 0 !== f2.running.size ?
|
|
2620
|
+
const [R2, M2] = O(null);
|
|
2621
|
+
V(() => {
|
|
2622
|
+
0 !== f2.starting.size || 0 !== f2.running.size ? M2(N(Ve, { icon: N(qn, { sx: { transform: "scale(0.7)", marginLeft: "-6px" } }), panel: true, label: f2.label, onMount: b2, onUnmount: y2, sx: { position: "absolute", left: "0", top: "0", width: "100%", height: "100%", zIndex: "9999" } })) : M2(null);
|
|
2620
2623
|
}, [f2.starting, f2.running]);
|
|
2621
|
-
const
|
|
2622
|
-
return o2 && (
|
|
2624
|
+
const F2 = W(() => N(ul, { commands: P2, disableHover: true, sx: { padding: "0" }, buttonProps: { sx: { maxHeight: "22px" } } }), [P2]), B2 = { notifier: T2, commands: P2 };
|
|
2625
|
+
return o2 && (B2.statusBarProps = { childrenEnd: F2 }), E(A, { children: [R2, s2 ? I.cloneElement(s2, B2) : null] });
|
|
2623
2626
|
}));
|
|
2624
2627
|
Oi.displayName = "SnackbarAndCommandsWrapper";
|
|
2625
|
-
const Vi =
|
|
2626
|
-
const { className: o2, sx: n2, style: a2, onElementLoad: r2, onError: l2, undoManager: i2, errorPanel: s2 =
|
|
2627
|
-
|
|
2628
|
-
|
|
2628
|
+
const Vi = L(H((e2, t2) => {
|
|
2629
|
+
const { className: o2, sx: n2, style: a2, onElementLoad: r2, onError: l2, undoManager: i2, errorPanel: s2 = Kn, onKeyDown: d2, workbook: c2, createWorkbookOptions: m2, onWorkbookChange: p2, logo: u2, importExportDisabled: g2 = false, themeOptions: f2, autoFocus: x2 = false, commands: b2, title: y2, onTitleChange: w2, titleProps: k2, renderLoadingPanel: S2, ...C2 } = e2, T2 = U(null), D2 = wa(p2, [p2]), P2 = wa(w2 ?? k2?.onTitleChange, [w2 ?? k2?.onTitleChange]), R2 = k2?.placeHolder ?? "Untitled", M2 = f2?.mode, { themeMode: F2, source: B2 } = On({ mode: M2 }), A2 = W(() => ({ ...f2, light: Xn(false, ja.deepMerge(f2?.theme ?? {}, f2?.light ?? {})), dark: Xn(true, ja.deepMerge(f2?.theme ?? {}, f2?.dark ?? {})) }), [f2]), I2 = F2 === Vn.Dark, [L2, H2] = O(null);
|
|
2630
|
+
V(() => {
|
|
2631
|
+
H2(i2 ?? new Ka());
|
|
2629
2632
|
}, [i2]);
|
|
2630
|
-
const [
|
|
2631
|
-
|
|
2633
|
+
const [$2, G2] = O(null), [j2, _2] = O(null), q2 = v();
|
|
2634
|
+
K(() => {
|
|
2632
2635
|
if (!c2 || 0 === Object.keys(c2).length && !ja.isPromiseLike(c2)) {
|
|
2633
|
-
const e3 = { theme:
|
|
2634
|
-
|
|
2635
|
-
} else
|
|
2636
|
-
}, [c2]),
|
|
2637
|
-
if (!
|
|
2638
|
-
if (
|
|
2636
|
+
const e3 = { theme: q2.getDefaultTheme(), ...m2 };
|
|
2637
|
+
_2(new h(e3));
|
|
2638
|
+
} else _2(c2);
|
|
2639
|
+
}, [c2]), K(() => {
|
|
2640
|
+
if (!j2) return;
|
|
2641
|
+
if (j2 instanceof h) return G2({ workbook: j2 }), void (c2 !== j2 && D2?.(j2));
|
|
2639
2642
|
(async () => {
|
|
2640
2643
|
try {
|
|
2641
|
-
let e3, t3 = await Promise.resolve(
|
|
2642
|
-
t3 && t3.source && (t3 = await Ii.read(t3)), t3.workbook ? (ee2(t3.title), e3 = t3.workbook) : e3 = t3,
|
|
2644
|
+
let e3, t3 = await Promise.resolve(j2);
|
|
2645
|
+
t3 && t3.source && (t3 = await Ii.read(t3)), t3.workbook ? (ee2(t3.title), e3 = t3.workbook) : e3 = t3, D2?.(e3), G2({ workbook: e3 });
|
|
2643
2646
|
} catch (e3) {
|
|
2644
|
-
|
|
2647
|
+
D2?.(null), G2({ error: e3 });
|
|
2645
2648
|
}
|
|
2646
2649
|
})();
|
|
2647
|
-
}, [
|
|
2648
|
-
const [Z2, J2] =
|
|
2649
|
-
|
|
2650
|
-
if (!
|
|
2651
|
-
|
|
2652
|
-
const e3 =
|
|
2650
|
+
}, [j2]);
|
|
2651
|
+
const [Z2, J2] = O(null);
|
|
2652
|
+
V(() => {
|
|
2653
|
+
if (!L2 || !$2) return;
|
|
2654
|
+
L2.clear();
|
|
2655
|
+
const e3 = $2?.workbook?.getTransactions();
|
|
2653
2656
|
if (!e3) return;
|
|
2654
2657
|
return e3.addListener({ onCommitEnd: (t3) => {
|
|
2655
|
-
t3.getDescription() ?
|
|
2658
|
+
t3.getDescription() ? L2.addUndoOperation({ description: t3.getDescription(), undo: () => (e3.revert(t3.getId()), Z2.source?.focus(), () => {
|
|
2656
2659
|
e3.restore(t3.getId()), Z2.source?.focus();
|
|
2657
2660
|
}) }) : console.warn("commit has no description", t3);
|
|
2658
2661
|
} });
|
|
2659
|
-
}, [
|
|
2660
|
-
const Y2 =
|
|
2661
|
-
e3 ?
|
|
2662
|
-
}, [
|
|
2663
|
-
|
|
2664
|
-
ee2(
|
|
2665
|
-
}, [
|
|
2666
|
-
|
|
2662
|
+
}, [L2, $2, Z2]);
|
|
2663
|
+
const Y2 = wa((e3) => {
|
|
2664
|
+
e3 ? L2.setRepeatableOperation({ description: e3.label(), repeat: async () => e3.execute() }) : L2.setRepeatableOperation(null);
|
|
2665
|
+
}, [L2]), [Q2, ee2] = O(y2 ?? k2?.title ?? "");
|
|
2666
|
+
V(() => {
|
|
2667
|
+
ee2(y2 ?? k2?.title ?? "");
|
|
2668
|
+
}, [y2 ?? k2?.title]), V(() => {
|
|
2669
|
+
P2?.(Q2);
|
|
2667
2670
|
}, [Q2]);
|
|
2668
|
-
const [
|
|
2671
|
+
const [oe2, ne2] = O(null), ae2 = W(() => {
|
|
2669
2672
|
const e3 = () => ({ contains: (e4) => true, focus() {
|
|
2670
2673
|
} });
|
|
2671
|
-
return
|
|
2672
|
-
}, [
|
|
2673
|
-
|
|
2674
|
-
}, [
|
|
2675
|
-
|
|
2676
|
-
Z2 &&
|
|
2674
|
+
return b2 ? b2.createChildGroup(e3, "application", false) : new Ea(e3, "application");
|
|
2675
|
+
}, [b2]), re2 = wa((e3) => {
|
|
2676
|
+
ne2(e3.source.getViewportElement()), J2(e3), ae2.activate("sheet"), r2?.(e3);
|
|
2677
|
+
}, [ae2]);
|
|
2678
|
+
V(() => {
|
|
2679
|
+
Z2 && x2 && Z2.source?.focus("object" == typeof x2 ? x2 : void 0);
|
|
2677
2680
|
}, [Z2]);
|
|
2678
|
-
const le2 =
|
|
2681
|
+
const le2 = U(null), ie2 = z((e3) => {
|
|
2679
2682
|
let t3 = null;
|
|
2680
|
-
return
|
|
2683
|
+
return k2?.hidden || (t3 = N(Fi, { ...k2, style: { maxWidth: "100%", ...k2?.style }, workbook: T2.current, ref: le2, title: Q2, placeHolder: R2, onTitleChange: (e4) => {
|
|
2681
2684
|
ee2(e4);
|
|
2682
|
-
} })),
|
|
2683
|
-
}, [u2, Q2,
|
|
2684
|
-
|
|
2685
|
+
} })), N($i, { ...e3, logo: u2, mainElement: t3, showFileMenu: !g2, showAppearanceMenu: !!(A2?.onEnabledDarkGridChange || A2?.onEnabledDarkImagesChange || A2?.onModeChange) });
|
|
2686
|
+
}, [u2, Q2, k2, A2, g2, ae2]);
|
|
2687
|
+
V(() => {
|
|
2685
2688
|
const e3 = (e4) => e4.preventDefault();
|
|
2686
|
-
return
|
|
2687
|
-
|
|
2689
|
+
return T2.current?.addEventListener("wheel", e3, { passive: false }), () => {
|
|
2690
|
+
T2.current?.removeEventListener("wheel", e3);
|
|
2688
2691
|
};
|
|
2689
2692
|
}, []);
|
|
2690
|
-
const se2 =
|
|
2693
|
+
const se2 = W(() => {
|
|
2691
2694
|
const e3 = { transparentBackground: true };
|
|
2692
|
-
return
|
|
2693
|
-
}, [n2, a2,
|
|
2694
|
-
if (
|
|
2695
|
-
if (
|
|
2695
|
+
return N(X, { sx: n2, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, display: "flex", alignItems: "center", justifyContent: "center", ...a2 }, children: S2?.(e3) ?? N(Ve, { ...e3 }) });
|
|
2696
|
+
}, [n2, a2, S2]), de2 = z(({ error: e3 }) => (l2?.(e3), N(s2, { sx: n2, style: a2, error: e3 ?? "Unable to display empty workbook." })), [n2, a2, l2]), ce2 = W(() => ({ ...n2, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-SnackbarContainer > div": { maxWidth: "100%" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (e3) => e3.palette.getContrastText(e3.palette.error.main) }, "& .notistack-MuiContent *": { fontFamily: (e3) => e3.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [n2]), me2 = Ua([T2, t2]), pe2 = W(() => {
|
|
2697
|
+
if (!$2) return se2;
|
|
2698
|
+
if ($2.error || !$2.workbook) return de2({ error: $2.error });
|
|
2696
2699
|
let e3 = null, t3 = null, n3 = false;
|
|
2697
|
-
return
|
|
2700
|
+
return A2 && (e3 = I2 ? A2.dark : A2.light, t3 = I2 && A2.enableDarkGrid ? A2.dark : A2.light, n3 = A2.enableDarkImages), N(Ri, { sx: ce2, style: a2, tabIndex: 0, autoFocus: true, workbook: $2.workbook, ref: me2, renderToolbar: ie2, onElementLoad: re2, onRepeatCommandChange: Y2, onKeyDown: (e4) => {
|
|
2698
2701
|
d2?.(e4);
|
|
2699
|
-
}, renderLoadingPanel:
|
|
2700
|
-
}, [
|
|
2701
|
-
let ue2 =
|
|
2702
|
-
|
|
2703
|
-
}, Components: { error: Hi }, iconVariant: { success:
|
|
2704
|
-
return
|
|
2702
|
+
}, renderLoadingPanel: S2, gridTheme: t3, headersTheme: e3, enableDarkImages: n3, className: Yn(o2, "sheetxl-workbook"), onContextMenu: (e4) => e4.preventDefault(), ...C2 }, "WorkbookElement");
|
|
2703
|
+
}, [$2, Q2, L2, se2, S2, A2, C2, ie2, ce2]);
|
|
2704
|
+
let ue2 = N(Qa, { fallbackRender: de2, children: N(or, { maxSnack: 3, domRoot: oe2, anchorOrigin: { vertical: "bottom", horizontal: "right" }, autoHideDuration: 3500, onClose: (e3, t3, o3) => {
|
|
2705
|
+
T2.current?.focus();
|
|
2706
|
+
}, Components: { error: Hi }, iconVariant: { success: N(te, { style: { marginRight: "8px" }, children: N("path", { d: "M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z" }) }), error: N(Jn, { style: { marginRight: "8px" } }) }, children: N(Zn, { children: N(Oi, { workbook: $2?.workbook, setWorkbook: _2, importExportDisabled: g2, titlePlaceHolder: R2, titleWorkbook: Q2, setWorkbookTitle: ee2, refWorkbookTitle: le2, commands: ae2, undoManager: L2, themeOptions: A2, children: pe2 }) }) }) });
|
|
2707
|
+
return A2 && (ue2 = E($a, { theme: I2 ? A2.dark : A2.light, children: [A2.cssBaseline ? N(ye, {}) : null, ue2] })), ue2;
|
|
2705
2708
|
}));
|
|
2706
2709
|
Vi.displayName = "EagerStudio";
|
|
2707
2710
|
const Gi = Object.freeze(Object.defineProperty({ __proto__: null, EagerStudio: Vi, default: Vi }, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -2783,5 +2786,7 @@ export {
|
|
|
2783
2786
|
Bi as default,
|
|
2784
2787
|
di as defaultNewWorkbook,
|
|
2785
2788
|
Wl as setPrintExamplesOnLoad,
|
|
2789
|
+
useModelListener,
|
|
2790
|
+
useRangeListener,
|
|
2786
2791
|
si as useWorkbookCommands
|
|
2787
2792
|
};
|