@sheetxl/studio-mui 0.8.0-beta.10 → 0.8.0-beta.12
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/esm/{ByeL_BZuJ2kl8gtf.mjs → 0IBZhOJaVmzJxuTv.mjs} +1 -1
- package/browser/esm/2nRxqrNYbmEn8fS8.mjs +386 -0
- package/browser/esm/{fb126BNj3F8URR19.mjs → 7fVZXXuonYb6Z7FU.mjs} +3 -3
- package/browser/esm/BAzhmMX4Fk_qnUTp.mjs +414 -0
- package/browser/esm/BGL3x0W74D7qZXlf.mjs +318 -0
- package/browser/esm/BHGr2gsFofTdAFxq.mjs +515 -0
- package/browser/esm/{DU3J8Gcf-WpBxNYg.mjs → BKhcJI-G15D3kGap.mjs} +4 -4
- package/browser/esm/BNbub9weuqm3mcoF.mjs +335 -0
- package/browser/esm/BSv9MVJaz1DVEffm.mjs +975 -0
- package/browser/esm/BWfLpYmd3cSgJ0C6.mjs +141 -0
- package/browser/esm/BZqwbIE8qzjSOYcJ.mjs +582 -0
- package/browser/esm/BZy9xUrYpAtnKeji.mjs +1288 -0
- package/browser/esm/{CIu1bjPJe_x31Oww.mjs → BnkwC5rsg9LZyhoP.mjs} +3 -3
- package/browser/esm/BpJsBv413cNQpyg0.mjs +319 -0
- package/browser/esm/BpVrgbVISiTDyFR3.mjs +197 -0
- package/browser/esm/BsngRDhvVYGVBJeK.mjs +1546 -0
- package/browser/esm/{C1Rp2hZrApo5MUc8.mjs → C29TKq47CbXs652l.mjs} +2 -2
- package/browser/esm/{CEvZe2cZK-voZTif.mjs → C8p2iMad_NNCwGI_.mjs} +5 -5
- package/browser/esm/CBzXksWnb-1gGEWZ.mjs +212 -0
- package/browser/esm/{IQLeaAbtGTipUsOD.mjs → CFIAWgpU3UyepLBn.mjs} +25 -24
- package/browser/esm/CJD4jF4m9cBGHzr_.mjs +31 -0
- package/browser/esm/{CjznclrKqJRi7u9O.mjs → CMc7G7cevxzPGxr9.mjs} +2 -2
- package/browser/esm/{B1Yp_uy1vFHcJB3U.mjs → CYtULLhY9M2m3DeH.mjs} +1 -1
- package/browser/esm/CeF35ZeFP28Do5Zx.mjs +1379 -0
- package/browser/esm/{xKiLJKiLxto8SayF.mjs → CjYKDxU4EP2Kf_vo.mjs} +2 -2
- package/browser/esm/{D8al_cJ4U-NgzwoK.mjs → Cq82lvdjyBvlJ8xJ.mjs} +19 -17
- package/browser/esm/{X1Db3b_7b_7OuCk6.mjs → CuRxFAO42JkQvMEx.mjs} +1 -1
- package/browser/esm/Cvk2yY90hpgXWMAt.mjs +103 -0
- package/browser/esm/D0slJycx3nq53qmf.mjs +14 -0
- package/browser/esm/{9eKCkvqpMQwqcXiw.mjs → D2jzliMwAo2ENpfi.mjs} +1 -1
- package/browser/esm/D5Fn0Hqllwv5HY6i.mjs +7581 -0
- package/browser/esm/D5N4nGaZsXtrHAOh.mjs +831 -0
- package/browser/esm/D7AqPfyhMiuda5l5.mjs +412 -0
- package/browser/esm/DHZA48ZMCETvHmeP.mjs +161 -0
- package/browser/esm/DX2_vf7WX6uRLaOZ.mjs +94 -0
- package/browser/esm/DaxpbAF1ShkT7hNU.mjs +490 -0
- package/browser/esm/{D6S8kVTzOjCn0-SK.mjs → Db3oHfXiRtcH015t.mjs} +162 -156
- package/browser/esm/Dt47Huh1l3C4_5_w.mjs +87 -0
- package/browser/esm/{DmCQbW4zwkT_Rq88.mjs → DtPt0phL7m56YfHZ.mjs} +1 -1
- package/browser/esm/{CoSiOS-og0zFw4Ws.mjs → DtTDaXmnWUoG4VBO.mjs} +2 -2
- package/browser/esm/{DHY19rkSiiRZxShC.mjs → DuuyN4-7K6_io2Py.mjs} +3 -3
- package/browser/esm/{yZxC4qUENOlMhVUH.mjs → NeGeLF3gbGMZyV6E.mjs} +1 -1
- package/browser/esm/PY3Br5Bo_TxcCnCU.mjs +252 -0
- package/browser/esm/WIhvQtBkGiw-oFUs.mjs +2566 -0
- package/browser/esm/WgIvwAENeO8LANax.mjs +437 -0
- package/browser/esm/{DBtc4lku0uHVcqWn.mjs → Yjq3p_7eVGFw2Jod.mjs} +3 -3
- package/browser/esm/index.mjs +1053 -192
- package/browser/esm/jFRFCWlkD7Dsrhkh.mjs +236 -0
- package/browser/esm/lKXEDVt2ow1NlWJj.mjs +392 -0
- package/browser/esm/{Blaj2R5hYxtLAW__.mjs → oC0OwOddhOD0OoCJ.mjs} +6 -6
- package/browser/esm/{sFOAxZpxXo-qvDSp.mjs → tIKqpsA0vNXH9EgU.mjs} +1 -1
- package/browser/esm/{5cbK03T_Oh3tNdR7.mjs → u84rSnESjxqB6gay.mjs} +1 -1
- package/licenses/dependencies.txt +94 -94
- package/node/esm/{BcwMb6CyVfvEwbHn.mjs → B8Ls4Eh1k8-Yiry_.mjs} +1 -1
- package/node/esm/{CKu1AtRgyltyEdEN.mjs → B9X3n8MglL4OitAV.mjs} +1 -1
- package/node/esm/{ETK6T6G0SIcFXDe5.mjs → BBGoyqs2L_ccSH1e.mjs} +40 -40
- package/node/esm/BLv99aovW4R3C5PE.mjs +515 -0
- package/node/esm/BUGU_5lUtnCRlp3n.mjs +519 -0
- package/node/esm/BalROFG_oa9PFs9Q.mjs +141 -0
- package/node/esm/{ah3CUg4-VmNstGk_.mjs → BqVxnA1mo52ubjdf.mjs} +2 -2
- package/node/esm/C3FCh9xju2SccUIE.mjs +1283 -0
- package/node/esm/{Bb1sLMqXWKjdve23.mjs → C4F6WY8M4nkLyxdb.mjs} +2 -2
- package/node/esm/CKWeipCqqpLnLE5e.mjs +391 -0
- package/node/esm/CTnVNfz4eqFnM92M.mjs +212 -0
- package/node/esm/Cfi_ly8fBDZZdiZT.mjs +72 -0
- package/node/esm/CgKa6JuyJ1tTodev.mjs +1703 -0
- package/node/esm/{cqzp431iNSLWictb.mjs → Cq53M7bAUSXMNq1f.mjs} +22 -22
- package/node/esm/{BYsG3KYVmxSe_CIQ.mjs → Cr8AYWUoU-XVt0hu.mjs} +1 -1
- package/node/esm/CyuOE595I2e-U4cG.mjs +236 -0
- package/node/esm/D72CupF9mfy2D1Xa.mjs +94 -0
- package/node/esm/{DNSjK5DAH3M14Qbc.mjs → DGDHFK8okuVbRCe5.mjs} +1 -1
- package/node/esm/{B8SQfjKjzYHLxzZR.mjs → DJFkALt4XrwkMbnU.mjs} +163 -157
- package/node/esm/DJpwI8PlKBI2rk0r.mjs +319 -0
- package/node/esm/{DZzvTQxIKr9LbEsA.mjs → DQaGPUYbgL4Y5YZW.mjs} +32 -30
- package/node/esm/{D9rzScOA9pEYFrtz.mjs → DsNYnq4NtYBxPmeA.mjs} +20 -20
- package/node/esm/DygDgOpa9sJ6YFVS.mjs +385 -0
- package/node/esm/Dz0Hg87UcJ-awwiI.mjs +489 -0
- package/node/esm/M7YxvRPGCuxuk9aK.mjs +142 -0
- package/node/esm/QNjtpX8rIpqGGLEJ.mjs +1379 -0
- package/node/esm/{B_jRGdwGFkudwmL-.mjs → ZzvsynJTCSuChYS-.mjs} +1 -1
- package/node/esm/{ci8d-mF1H9wnYzix.mjs → di_8-pXh90j4BO4j.mjs} +1 -1
- package/node/esm/dm8dmEaTIqfmgyeL.mjs +412 -0
- package/node/esm/{D6oQL8knsPpgdXuk.mjs → fmya3XQnTGyQisvT.mjs} +2 -2
- package/node/esm/gPYAb_A0T5ZwcQ1E.mjs +318 -0
- package/node/esm/index.mjs +8915 -13417
- package/node/esm/wB8xMpyJ_NvE16yG.mjs +975 -0
- package/node/esm/zGAcd4Jr7wkvXDBS.mjs +197 -0
- package/package.json +9 -9
- package/resources/locales/de/groups.cmd.json +4 -0
- package/resources/locales/de/ui.msg.json +100 -1
- package/resources/locales/en/groups.cmd.json +4 -0
- package/resources/locales/en/ui.msg.json +100 -1
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +4 -4
- package/types/src/anomalies/AnomaliesPlugin.d.ts +5 -0
- package/types/src/anomalies/AnomaliesTaskPane.d.ts +17 -0
- package/types/src/anomalies/index.d.ts +3 -0
- package/types/src/border/BorderPopupButton.d.ts +1 -1
- package/types/src/border/BorderTemplateIcon.d.ts +6 -1
- package/types/src/chart/ChartFormatPanel.d.ts +20 -0
- package/types/src/chart/ChartPlugin.d.ts +6 -0
- package/types/src/chart/index.d.ts +3 -0
- package/types/src/color/ColorPopupButton.d.ts +1 -1
- package/types/src/command/AccountingStyleCommandButton.d.ts +1 -1
- package/types/src/command/DocThemeCommandButton.d.ts +1 -1
- package/types/src/command/FontFamilyCommandButton.d.ts +1 -1
- package/types/src/command/FontSizeCommandButton.d.ts +1 -1
- package/types/src/command/InsertCellControlCommandButton.d.ts +17 -0
- package/types/src/command/LanguageCommandButton.d.ts +1 -1
- package/types/src/command/LocaleCommandButton.d.ts +1 -1
- package/types/src/command/index.d.ts +1 -0
- package/types/src/comments/CommentCard.d.ts +2 -2
- package/types/src/conditionalFormat/IconPickerPopupButton.d.ts +1 -1
- package/types/src/conditions/ConditionEditor.d.ts +1 -1
- package/types/src/conditions/OperatorAndParamEditor.d.ts +1 -1
- package/types/src/conditions/OperatorSelectPopupButton.d.ts +1 -1
- package/types/src/conditions/useFormulaOption.d.ts +2 -2
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
- package/types/src/fill/PatternPopupButton.d.ts +1 -1
- package/types/src/format/BorderPreview.d.ts +11 -4
- package/types/src/format/useFormatSelection.d.ts +4 -4
- package/types/src/formulaBar/IFormulaBar.d.ts +4 -2
- package/types/src/formulaBar/MobileFormulaBar.d.ts +18 -6
- package/types/src/formulaBar/MobileInputToolbar.d.ts +9 -3
- package/types/src/formulaBar/useFormulaBarSession.d.ts +6 -3
- package/types/src/index.d.ts +15 -6
- package/types/src/itemsPanel/ItemsPanel.d.ts +5 -0
- package/types/src/named/NamedDetailsPanel.d.ts +2 -2
- package/types/src/protection/ProtectedCellsPanel.d.ts +2 -2
- package/types/src/protection/{SheetProtectionPanel.d.ts → WorksheetProtectionPanel.d.ts} +6 -6
- package/types/src/protection/index.d.ts +1 -1
- package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +2 -2
- package/types/src/statusBar/PendingStatus.d.ts +19 -0
- package/types/src/statusBar/index.d.ts +1 -0
- package/types/src/studio/StudioProps.d.ts +10 -10
- package/types/src/template/TemplatePanel.d.ts +5 -1
- package/types/src/theme/ThemeSelectPopupButton.d.ts +1 -1
- package/types/src/toolbar/WorkbookToolbars.d.ts +1 -1
- package/types/src/workbook/DefaultRenderers.d.ts +31 -19
- package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
- package/types/src/workbook/WorkbookElement.d.ts +5 -4
- package/types/src/workbook/WorkbookStrip.d.ts +8 -7
- package/types/src/workbook/index.d.ts +1 -1
- package/browser/esm/Biy7bhzzzPb5sfRN.mjs +0 -152
- package/browser/esm/COv-m-c2byCgvU3M.mjs +0 -14861
- package/browser/esm/CtEFHbzYNvYjDYvi.mjs +0 -236
- package/browser/esm/Die9NXVFveHvcCT-.mjs +0 -4205
- package/browser/esm/sam1KGQZ59B_fADz.mjs +0 -1941
- package/node/esm/BYVLi0md4AYuDsB_.mjs +0 -236
- package/node/esm/BYwXhrEwkRAt9nJS.mjs +0 -71
- package/node/esm/Cmt8Wv806N7NmE4Y.mjs +0 -3344
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { n as e, t } from "./
|
|
7
|
+
import { n as e, t } from "./7fVZXXuonYb6Z7FU.mjs";
|
|
8
8
|
import { FunctionArgIcons as n, FunctionPreviewContent as r, FunctionSignature as i, NamedItemLabel as a, argTypeKey as o, assembleCall as s, createFunctionDescriptor as c, createFunctionHint as l, formatEvalValue as u, toArgRows as d, useWorkbook as f } from "@sheetxl/react";
|
|
9
9
|
import { DynamicIcon as p, KeyCodes as m, useCallbackRef as h, useTranslator as ee } from "@sheetxl/utils-react";
|
|
10
10
|
import { memo as g, useEffect as _, useId as te, useMemo as v, useRef as y, useState as b } from "react";
|
|
@@ -328,7 +328,7 @@ var j = g((r) => {
|
|
|
328
328
|
});
|
|
329
329
|
}, [K]);
|
|
330
330
|
_(() => {
|
|
331
|
-
let e = D ? D.
|
|
331
|
+
let e = D ? D.getSelectedWorksheet()?.getCalculation() ?? D.getCalculation() : null, t = U.some((e, t) => !e.optional && !O[t]?.trim());
|
|
332
332
|
if (!e || t || U.length > 0 && !O.some((e) => e?.trim())) return K(-1), void F(null);
|
|
333
333
|
let n = K(-1);
|
|
334
334
|
(async () => {
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.12
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { c as e, r as t } from "./D5N4nGaZsXtrHAOh.mjs";
|
|
8
|
+
import { t as n } from "./u84rSnESjxqB6gay.mjs";
|
|
9
|
+
import { DEFAULT_GRADIENT as r, GradientEditor as i, InputField as a, PatternPopupButton as o, toGradientValue as s, toPatternSlots as c } from "./index.mjs";
|
|
10
|
+
import { Color as l, IColor as u, IFill as d } from "@sheetxl/sdk";
|
|
11
|
+
import { useCallbackRef as f, useCommands as p, useTranslator as m } from "@sheetxl/utils-react";
|
|
12
|
+
import { memo as h, useMemo as ee, useRef as g } from "react";
|
|
13
|
+
import { Fragment as te, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
14
|
+
import { Box as y, FormControl as ne, InputLabel as re, MenuItem as b, Select as x, Typography as S } from "@mui/material";
|
|
15
|
+
import { messageKey as C } from "@sheetxl/utils";
|
|
16
|
+
var w = (e, t, n) => () => {
|
|
17
|
+
t === e && n();
|
|
18
|
+
}, T = h((e) => {
|
|
19
|
+
let { label: t, value: n, min: r, max: i, step: o = 1, decimals: s = !1, width: c, disabled: l, onChange: u } = e, d = g(null), f = (e) => Math.max(r, Math.min(i, e)), p = (e) => {
|
|
20
|
+
let t = s ? parseFloat(e) : parseInt(e, 10);
|
|
21
|
+
return Number.isNaN(t) ? null : f(t);
|
|
22
|
+
};
|
|
23
|
+
return _(a, {
|
|
24
|
+
label: t,
|
|
25
|
+
value: String(n),
|
|
26
|
+
disabled: l,
|
|
27
|
+
hideAdornment: !0,
|
|
28
|
+
helperText: null,
|
|
29
|
+
propsInput: {
|
|
30
|
+
type: "number",
|
|
31
|
+
min: r,
|
|
32
|
+
max: i,
|
|
33
|
+
step: o
|
|
34
|
+
},
|
|
35
|
+
sx: {
|
|
36
|
+
width: c,
|
|
37
|
+
minWidth: 0,
|
|
38
|
+
"& input": { textAlign: "right" }
|
|
39
|
+
},
|
|
40
|
+
onChangeInput: (e) => {
|
|
41
|
+
let t = p(e);
|
|
42
|
+
t !== null && (d.current = t, u(t));
|
|
43
|
+
},
|
|
44
|
+
onDone: (e) => {
|
|
45
|
+
let t = p(e) ?? f(0), n = d.current;
|
|
46
|
+
d.current = null, n !== t && u(t);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
T.displayName = "FormatNumberField";
|
|
51
|
+
var E = {
|
|
52
|
+
display: "flex",
|
|
53
|
+
flexDirection: "column",
|
|
54
|
+
gap: 1.5,
|
|
55
|
+
minWidth: 0
|
|
56
|
+
}, D = h((e) => {
|
|
57
|
+
let { label: t, children: n, sx: r, ...i } = e;
|
|
58
|
+
return v(y, {
|
|
59
|
+
sx: {
|
|
60
|
+
display: "flex",
|
|
61
|
+
flexDirection: "column",
|
|
62
|
+
gap: .75,
|
|
63
|
+
minWidth: 0,
|
|
64
|
+
...r
|
|
65
|
+
},
|
|
66
|
+
...i,
|
|
67
|
+
children: [t ? _(S, {
|
|
68
|
+
variant: "caption",
|
|
69
|
+
component: "div",
|
|
70
|
+
sx: {
|
|
71
|
+
color: "text.secondary",
|
|
72
|
+
lineHeight: 1.4
|
|
73
|
+
},
|
|
74
|
+
children: t
|
|
75
|
+
}) : null, n]
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
D.displayName = "FormatSection";
|
|
79
|
+
var O = h((e) => {
|
|
80
|
+
let { children: t, sx: n, ...r } = e;
|
|
81
|
+
return _(y, {
|
|
82
|
+
sx: {
|
|
83
|
+
display: "flex",
|
|
84
|
+
flexWrap: "wrap",
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
gap: 1,
|
|
87
|
+
minWidth: 0,
|
|
88
|
+
...n
|
|
89
|
+
},
|
|
90
|
+
...r,
|
|
91
|
+
children: t
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
O.displayName = "FormatRow";
|
|
95
|
+
var k = h((e) => {
|
|
96
|
+
let { children: t, sx: n, ...r } = e;
|
|
97
|
+
return _(y, {
|
|
98
|
+
sx: {
|
|
99
|
+
display: "flex",
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
gap: .25,
|
|
102
|
+
flexWrap: "wrap",
|
|
103
|
+
minWidth: 0,
|
|
104
|
+
...n
|
|
105
|
+
},
|
|
106
|
+
...r,
|
|
107
|
+
children: t
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
k.displayName = "FormatButtonGroup";
|
|
111
|
+
var ie = d.BuiltInSheetPattern.Gray125, A = new l(u.Named.Transparent), j = (e) => ({
|
|
112
|
+
fill: e.style.getFill(),
|
|
113
|
+
styles: e.styles,
|
|
114
|
+
schemeLookup: e.schemeLookup,
|
|
115
|
+
darkMode: e.darkMode,
|
|
116
|
+
disabled: e.disabled,
|
|
117
|
+
createCell: e.createCell,
|
|
118
|
+
applyFill: (t, n) => e.applyStyle({ fill: t }, n)
|
|
119
|
+
}), M = h((a) => {
|
|
120
|
+
let { selection: h, disabled: g, maxGradientStops: S, className: T, ...k } = a, j = m(), { fill: M, applyFill: N, createCell: P, schemeLookup: F, styles: I, darkMode: L } = h, R = g || h.disabled, z = f((e, t) => {
|
|
121
|
+
N(e.fill, t);
|
|
122
|
+
}, [N]), B = M.getType(), V = B === d.Type.None ? d.Type.Solid : B, H = B === d.Type.Pattern ? M : null, U = H?.getPatternType() ?? ie, W = H ? c(U, H.getForeground(), H.getBackground()) : null, G = ee(() => new l(u.Scheme.Tx1, F), [F]), K = W?.foreground ?? G, q = W?.background ?? new l(u.Named.Transparent, F), ae = B === d.Type.Solid ? M.getColor() : null, J = f(() => I.recentColors(), [I]), [oe] = p(["formatFillColor"]), Y = oe?.getContext(), X = Y?.quickColor ?? null, se = f((e, t) => {
|
|
123
|
+
e && t && I.addRecentColor(e), Y?.onColorSelect?.(e), e ? z({ fill: {
|
|
124
|
+
type: d.Type.Solid,
|
|
125
|
+
color: e.toString()
|
|
126
|
+
} }, C("op.setFillColor")) : z({ fill: { type: d.Type.None } }, C("op.setFillNone"));
|
|
127
|
+
}, [
|
|
128
|
+
z,
|
|
129
|
+
I,
|
|
130
|
+
Y
|
|
131
|
+
]), Z = f((e) => {
|
|
132
|
+
let t = e.patternType ?? U, n = c(t, e.foreground ?? K.toString(), e.background ?? q.toString());
|
|
133
|
+
z({ fill: {
|
|
134
|
+
type: d.Type.Pattern,
|
|
135
|
+
patternType: t,
|
|
136
|
+
foreground: n.foreground,
|
|
137
|
+
background: n.background
|
|
138
|
+
} }, C("op.setFillPattern"));
|
|
139
|
+
}, [
|
|
140
|
+
z,
|
|
141
|
+
U,
|
|
142
|
+
K,
|
|
143
|
+
q
|
|
144
|
+
]), Q = f((e) => {
|
|
145
|
+
z({ fill: {
|
|
146
|
+
type: d.Type.Gradient,
|
|
147
|
+
gradientType: e.gradientType,
|
|
148
|
+
angle: e.angle,
|
|
149
|
+
stops: e.stops.map((e) => ({
|
|
150
|
+
offset: e.offset,
|
|
151
|
+
color: e.color
|
|
152
|
+
}))
|
|
153
|
+
} }, C("op.setFillGradient"));
|
|
154
|
+
}, [z]), ce = f((e) => {
|
|
155
|
+
if (e !== V) switch (e) {
|
|
156
|
+
case d.Type.Solid:
|
|
157
|
+
z({ fill: {
|
|
158
|
+
type: d.Type.Solid,
|
|
159
|
+
color: (X ?? M.getColor())?.toString() ?? "ffffff"
|
|
160
|
+
} }, C("op.setFillSolid"));
|
|
161
|
+
break;
|
|
162
|
+
case d.Type.Pattern:
|
|
163
|
+
Z({});
|
|
164
|
+
break;
|
|
165
|
+
case d.Type.Gradient: Q(r);
|
|
166
|
+
}
|
|
167
|
+
}, [
|
|
168
|
+
V,
|
|
169
|
+
M,
|
|
170
|
+
X,
|
|
171
|
+
z,
|
|
172
|
+
Z,
|
|
173
|
+
Q
|
|
174
|
+
]), $ = f(() => {
|
|
175
|
+
switch (B) {
|
|
176
|
+
case d.Type.Pattern:
|
|
177
|
+
Z({});
|
|
178
|
+
break;
|
|
179
|
+
case d.Type.Gradient:
|
|
180
|
+
Q(s(M));
|
|
181
|
+
break;
|
|
182
|
+
case d.Type.Solid:
|
|
183
|
+
z({ fill: {
|
|
184
|
+
type: d.Type.Solid,
|
|
185
|
+
color: M.getColor().toString()
|
|
186
|
+
} }, C("op.setFillColor"));
|
|
187
|
+
break;
|
|
188
|
+
default: z({ fill: { type: d.Type.None } }, C("op.setFillNone"));
|
|
189
|
+
}
|
|
190
|
+
}, [
|
|
191
|
+
B,
|
|
192
|
+
M,
|
|
193
|
+
z,
|
|
194
|
+
Z,
|
|
195
|
+
Q
|
|
196
|
+
]);
|
|
197
|
+
return v(y, {
|
|
198
|
+
className: n("sxl-format-fill-panel", T),
|
|
199
|
+
sx: E,
|
|
200
|
+
...k,
|
|
201
|
+
children: [
|
|
202
|
+
_(D, { children: v(ne, {
|
|
203
|
+
size: "small",
|
|
204
|
+
fullWidth: !0,
|
|
205
|
+
children: [_(re, {
|
|
206
|
+
shrink: !0,
|
|
207
|
+
children: j("fill.type")
|
|
208
|
+
}), v(x, {
|
|
209
|
+
label: j("fill.type"),
|
|
210
|
+
notched: !0,
|
|
211
|
+
disabled: R,
|
|
212
|
+
value: V,
|
|
213
|
+
onChange: (e) => ce(e.target.value),
|
|
214
|
+
children: [
|
|
215
|
+
_(b, {
|
|
216
|
+
value: d.Type.Solid,
|
|
217
|
+
onClick: w(V, d.Type.Solid, $),
|
|
218
|
+
children: j("fill.typeSolid")
|
|
219
|
+
}),
|
|
220
|
+
_(b, {
|
|
221
|
+
value: d.Type.Pattern,
|
|
222
|
+
onClick: w(V, d.Type.Pattern, $),
|
|
223
|
+
children: j("fill.typePattern")
|
|
224
|
+
}),
|
|
225
|
+
_(b, {
|
|
226
|
+
value: d.Type.Gradient,
|
|
227
|
+
onClick: w(V, d.Type.Gradient, $),
|
|
228
|
+
children: j("fill.typeGradient")
|
|
229
|
+
}),
|
|
230
|
+
B === d.Type.Image ? _(b, {
|
|
231
|
+
value: d.Type.Image,
|
|
232
|
+
disabled: !0,
|
|
233
|
+
children: j("fill.typeImage")
|
|
234
|
+
}) : null
|
|
235
|
+
]
|
|
236
|
+
})]
|
|
237
|
+
}) }),
|
|
238
|
+
V === d.Type.Solid ? _(D, {
|
|
239
|
+
label: j("fill.backgroundColor"),
|
|
240
|
+
children: _(O, { children: _(t, {
|
|
241
|
+
icon: "fill.colored",
|
|
242
|
+
disabled: R,
|
|
243
|
+
darkMode: L,
|
|
244
|
+
compareRGB: !0,
|
|
245
|
+
selectedColor: ae,
|
|
246
|
+
onSelectColor: se,
|
|
247
|
+
propsPanel: {
|
|
248
|
+
disableAlpha: !0,
|
|
249
|
+
autoColor: A,
|
|
250
|
+
autoColorLabelKey: C("color.noFill"),
|
|
251
|
+
autoColorPosition: e.End,
|
|
252
|
+
schemeLookup: F,
|
|
253
|
+
recentColors: J
|
|
254
|
+
}
|
|
255
|
+
}) })
|
|
256
|
+
}) : null,
|
|
257
|
+
B === d.Type.Pattern ? v(te, { children: [
|
|
258
|
+
_(D, {
|
|
259
|
+
label: j("fill.patternStyle"),
|
|
260
|
+
children: _(O, { children: _(o, {
|
|
261
|
+
disabled: R,
|
|
262
|
+
darkMode: L,
|
|
263
|
+
selectedPattern: U,
|
|
264
|
+
foreground: K.toString(),
|
|
265
|
+
background: q.toString(),
|
|
266
|
+
createCell: P,
|
|
267
|
+
onSelectPattern: (e) => Z({ patternType: e })
|
|
268
|
+
}) })
|
|
269
|
+
}),
|
|
270
|
+
_(D, {
|
|
271
|
+
label: j("fill.patternForeground"),
|
|
272
|
+
children: _(O, { children: _(t, {
|
|
273
|
+
disabled: R,
|
|
274
|
+
darkMode: L,
|
|
275
|
+
selectedColor: K,
|
|
276
|
+
onSelectColor: (e) => {
|
|
277
|
+
Z({ foreground: (e ?? G).toString() });
|
|
278
|
+
},
|
|
279
|
+
propsPanel: {
|
|
280
|
+
disableAlpha: !0,
|
|
281
|
+
autoColor: G,
|
|
282
|
+
schemeLookup: F,
|
|
283
|
+
recentColors: J
|
|
284
|
+
}
|
|
285
|
+
}) })
|
|
286
|
+
}),
|
|
287
|
+
_(D, {
|
|
288
|
+
label: j("fill.patternBackground"),
|
|
289
|
+
children: _(O, { children: _(t, {
|
|
290
|
+
disabled: R,
|
|
291
|
+
darkMode: L,
|
|
292
|
+
selectedColor: q,
|
|
293
|
+
onSelectColor: (e) => {
|
|
294
|
+
Z({ background: (e ?? A).toString() });
|
|
295
|
+
},
|
|
296
|
+
propsPanel: {
|
|
297
|
+
disableAlpha: !0,
|
|
298
|
+
autoColor: A,
|
|
299
|
+
autoColorLabelKey: C("color.noFill"),
|
|
300
|
+
schemeLookup: F,
|
|
301
|
+
recentColors: J
|
|
302
|
+
}
|
|
303
|
+
}) })
|
|
304
|
+
})
|
|
305
|
+
] }) : null,
|
|
306
|
+
B === d.Type.Gradient ? _(D, { children: _(i, {
|
|
307
|
+
disabled: R,
|
|
308
|
+
maxStops: S,
|
|
309
|
+
darkMode: L,
|
|
310
|
+
schemeLookup: F,
|
|
311
|
+
recentColors: J,
|
|
312
|
+
value: s(M),
|
|
313
|
+
onChange: Q
|
|
314
|
+
}) }) : null
|
|
315
|
+
]
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
M.displayName = "FillPanel";
|
|
319
|
+
export { O as a, E as c, T as i, j as n, D as o, k as r, w as s, M as t };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.12
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { t as e } from "./D7AqPfyhMiuda5l5.mjs";
|
|
8
|
+
import { getCommentCoords as t, useModelListener as n, useSheetComments as r } from "@sheetxl/react";
|
|
9
|
+
import { DynamicIcon as i, usePersistentState as ee, useTranslator as te } from "@sheetxl/utils-react";
|
|
10
|
+
import { memo as a, useEffect as o, useMemo as ne, useRef as s, useState as c } from "react";
|
|
11
|
+
import { SimpleTooltip as l } from "@sheetxl/utils-mui";
|
|
12
|
+
import { Fragment as re, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
13
|
+
import { Box as f, Button as p, IconButton as m, ToggleButton as h, ToggleButtonGroup as g, Typography as _ } from "@mui/material";
|
|
14
|
+
import { CoordUtils as ie, messageKey as v } from "@sheetxl/utils";
|
|
15
|
+
var y = {
|
|
16
|
+
all: v("comment.filter.all"),
|
|
17
|
+
open: v("comment.filter.open"),
|
|
18
|
+
resolved: v("comment.filter.resolved")
|
|
19
|
+
}, b = Object.keys(y), x = "comments.filter", S = {
|
|
20
|
+
add: v("comment.new"),
|
|
21
|
+
addPrompt: v("comment.addPrompt"),
|
|
22
|
+
noMatches: v("comment.noMatches")
|
|
23
|
+
}, C = (e, t) => e.coords.rowIndex - t.coords.rowIndex || e.coords.colIndex - t.coords.colIndex, w = a((a) => {
|
|
24
|
+
let { model: v, args: w, defaultFilter: T = "all", entryKey: ae, frame: oe, ref: E, ...D } = a, O = te(), [k, se] = c(() => v?.getSelectedWorksheet() ?? null);
|
|
25
|
+
n(v, { onSheetsChange() {
|
|
26
|
+
se(v?.getSelectedWorksheet() ?? null);
|
|
27
|
+
} });
|
|
28
|
+
let [A, ce] = ee(x, T), [le, j] = c(!1), M = le ? "all" : b.includes(A) ? A : T, N = r(k, { resolved: M === "all" ? void 0 : M === "resolved" }), P = r(k), [F, I] = c(null), [L, R] = c(null), [z, B] = c(null), V = s(0), H = s(/* @__PURE__ */ new Map());
|
|
29
|
+
n(k?.getSelection(), { onChange() {
|
|
30
|
+
B(k?.getSelectedCell().getCoords() ?? null);
|
|
31
|
+
} });
|
|
32
|
+
let [U, W] = c(k);
|
|
33
|
+
U !== k && (W(k), I(null), R(null));
|
|
34
|
+
let G = (e) => `${e.rowIndex},${e.colIndex}`, K = (e) => {
|
|
35
|
+
R({
|
|
36
|
+
key: e,
|
|
37
|
+
request: ++V.current
|
|
38
|
+
});
|
|
39
|
+
}, q = () => {
|
|
40
|
+
if (!k) return;
|
|
41
|
+
let e = k.getSelectedCell(), n = e.getCoords();
|
|
42
|
+
if (!n) return;
|
|
43
|
+
let r = e.getComments();
|
|
44
|
+
if (!r?.isNote()) {
|
|
45
|
+
if (r) return j(!0), void K(G(t(r)));
|
|
46
|
+
I(n), K(G(n));
|
|
47
|
+
}
|
|
48
|
+
}, [ue, de] = c(void 0);
|
|
49
|
+
if (w !== ue) {
|
|
50
|
+
de(w);
|
|
51
|
+
let e = w?.focus;
|
|
52
|
+
!e || e.isDeleted() || e.isNote() ? w?.insert && q() : (j(!0), K(G(t(e))));
|
|
53
|
+
}
|
|
54
|
+
let J = ne(() => {
|
|
55
|
+
let e = N.map((e) => {
|
|
56
|
+
let n = t(e);
|
|
57
|
+
return {
|
|
58
|
+
key: G(n),
|
|
59
|
+
coords: n,
|
|
60
|
+
comment: e
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
return F && !P.some((e) => G(t(e)) === G(F)) && (e.push({
|
|
64
|
+
key: G(F),
|
|
65
|
+
coords: F,
|
|
66
|
+
comment: null
|
|
67
|
+
}), e.sort(C)), e;
|
|
68
|
+
}, [
|
|
69
|
+
N,
|
|
70
|
+
P,
|
|
71
|
+
F
|
|
72
|
+
]), Y = z ? G(z) : null, X = L?.key ?? null, Z = L?.request ?? 0;
|
|
73
|
+
if (o(() => {
|
|
74
|
+
Y && H.current.get(Y)?.scrollIntoView?.({ block: "nearest" });
|
|
75
|
+
}, [Y]), o(() => {
|
|
76
|
+
X && H.current.get(X)?.scrollIntoView?.({ block: "nearest" });
|
|
77
|
+
}, [X, Z]), !v || !k) return null;
|
|
78
|
+
let Q = k.getSelectedCell().getComments(), $ = J.length === 0 && P.length === 0;
|
|
79
|
+
return d(f, {
|
|
80
|
+
ref: E,
|
|
81
|
+
...D,
|
|
82
|
+
className: "sxl-comments-pane",
|
|
83
|
+
sx: {
|
|
84
|
+
display: "flex",
|
|
85
|
+
flexDirection: "column",
|
|
86
|
+
width: "100%",
|
|
87
|
+
minWidth: 0,
|
|
88
|
+
flex: "1 1 auto",
|
|
89
|
+
height: "100%",
|
|
90
|
+
minHeight: 0,
|
|
91
|
+
overflowX: "hidden"
|
|
92
|
+
},
|
|
93
|
+
children: [$ ? null : d(f, {
|
|
94
|
+
sx: {
|
|
95
|
+
display: "flex",
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
gap: 1,
|
|
98
|
+
flex: "0 0 auto",
|
|
99
|
+
px: 1.5,
|
|
100
|
+
py: 1,
|
|
101
|
+
borderBottom: 1,
|
|
102
|
+
borderColor: "divider"
|
|
103
|
+
},
|
|
104
|
+
children: [
|
|
105
|
+
u(g, {
|
|
106
|
+
className: "sxl-comments-filter",
|
|
107
|
+
size: "small",
|
|
108
|
+
exclusive: !0,
|
|
109
|
+
value: M,
|
|
110
|
+
onChange: (e, t) => {
|
|
111
|
+
t && (j(!1), ce(t));
|
|
112
|
+
},
|
|
113
|
+
children: b.map((e) => u(h, {
|
|
114
|
+
value: e,
|
|
115
|
+
sx: {
|
|
116
|
+
textTransform: "none",
|
|
117
|
+
py: .25,
|
|
118
|
+
px: 1
|
|
119
|
+
},
|
|
120
|
+
children: O(y[e])
|
|
121
|
+
}, e))
|
|
122
|
+
}),
|
|
123
|
+
u(f, { sx: { flex: "1 1 auto" } }),
|
|
124
|
+
u(l, {
|
|
125
|
+
disableInteractive: !0,
|
|
126
|
+
title: O(S.add),
|
|
127
|
+
children: u("span", { children: u(m, {
|
|
128
|
+
className: "sxl-comments-add",
|
|
129
|
+
"aria-label": O(S.add),
|
|
130
|
+
disabled: !!Q?.isNote(),
|
|
131
|
+
onClick: q,
|
|
132
|
+
children: u(i, { iconKey: "Insert" })
|
|
133
|
+
}) })
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
}), d(f, {
|
|
137
|
+
className: "sxl-comments-list",
|
|
138
|
+
sx: {
|
|
139
|
+
flex: "1 1 auto",
|
|
140
|
+
minHeight: 0,
|
|
141
|
+
overflowY: "auto",
|
|
142
|
+
display: "flex",
|
|
143
|
+
flexDirection: "column",
|
|
144
|
+
gap: 1,
|
|
145
|
+
p: 1.5,
|
|
146
|
+
pl: $ ? 1.5 : 3.5
|
|
147
|
+
},
|
|
148
|
+
children: [$ ? d(re, { children: [
|
|
149
|
+
u(f, { sx: { flex: "1 1 0" } }),
|
|
150
|
+
d(f, {
|
|
151
|
+
className: "sxl-comments-empty",
|
|
152
|
+
sx: {
|
|
153
|
+
display: "flex",
|
|
154
|
+
flex: "0 0 auto",
|
|
155
|
+
flexDirection: "column",
|
|
156
|
+
alignItems: "center",
|
|
157
|
+
alignSelf: "center",
|
|
158
|
+
gap: 2.5,
|
|
159
|
+
maxWidth: "min(360px, 90%)"
|
|
160
|
+
},
|
|
161
|
+
children: [u(_, {
|
|
162
|
+
variant: "body2",
|
|
163
|
+
align: "center",
|
|
164
|
+
children: O(S.addPrompt)
|
|
165
|
+
}), u(p, {
|
|
166
|
+
variant: "contained",
|
|
167
|
+
sx: { textTransform: "none" },
|
|
168
|
+
disabled: !!Q?.isNote(),
|
|
169
|
+
onClick: q,
|
|
170
|
+
children: O(S.add)
|
|
171
|
+
})]
|
|
172
|
+
}),
|
|
173
|
+
u(f, { sx: { flex: "1.5 1 0" } })
|
|
174
|
+
] }) : J.length === 0 ? u(_, {
|
|
175
|
+
variant: "body2",
|
|
176
|
+
sx: { color: "text.secondary" },
|
|
177
|
+
children: O(S.noMatches)
|
|
178
|
+
}) : null, J.map((t) => u(e, {
|
|
179
|
+
ref: (e) => {
|
|
180
|
+
e ? H.current.set(t.key, e) : H.current.delete(t.key);
|
|
181
|
+
},
|
|
182
|
+
sheet: k,
|
|
183
|
+
coords: t.coords,
|
|
184
|
+
comment: t.comment,
|
|
185
|
+
highlighted: t.key === Y,
|
|
186
|
+
focusRequest: t.key === X ? Z : 0,
|
|
187
|
+
onSelect: () => {
|
|
188
|
+
k.getRange(ie.cellToRange(t.coords)).select();
|
|
189
|
+
},
|
|
190
|
+
onClose: () => I(null),
|
|
191
|
+
onPosted: () => I(null)
|
|
192
|
+
}, t.key))]
|
|
193
|
+
})]
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
w.displayName = "CommentsTaskPane";
|
|
197
|
+
export { x as COMMENTS_FILTER_KEY, w as CommentsTaskPane, w as default };
|