@sheetxl/studio-mui 0.8.0-beta.10 → 0.8.0-beta.11
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/0BWO0bLZ8Vm_dKd2.mjs +582 -0
- package/browser/esm/BAbq4-I5f5oUiNaF.mjs +141 -0
- package/browser/esm/BED6h6YAwCf1HEQJ.mjs +161 -0
- package/browser/esm/{CEvZe2cZK-voZTif.mjs → BXhNFzyEGokTF-BL.mjs} +5 -5
- package/browser/esm/BYE9gCDWKyx6mnVs.mjs +381 -0
- package/browser/esm/{DBtc4lku0uHVcqWn.mjs → BjvD_4t2KGsZP5V8.mjs} +3 -3
- package/browser/esm/{DU3J8Gcf-WpBxNYg.mjs → BknfGJouygmnpFIU.mjs} +4 -4
- package/browser/esm/{D8al_cJ4U-NgzwoK.mjs → BlE_8o8tO2AgAlaj.mjs} +19 -17
- package/browser/esm/BokqKEpU6TFgfRs6.mjs +252 -0
- package/browser/esm/{DHY19rkSiiRZxShC.mjs → Brsh5yscJ_4uKFXp.mjs} +3 -3
- package/browser/esm/Bujtz_Guj88d03vI.mjs +831 -0
- package/browser/esm/Buqcl7J75MJrhpVE.mjs +1379 -0
- package/browser/esm/BvhYPwX3GrRaO9CM.mjs +319 -0
- package/browser/esm/C0wlMAIn9iREPK6w.mjs +87 -0
- package/browser/esm/C8JU4KsMasmLvojI.mjs +103 -0
- package/browser/esm/{CjznclrKqJRi7u9O.mjs → C9pIZVACtl9unFOp.mjs} +2 -2
- package/browser/esm/CBD4RiRKbbZtSXV-.mjs +318 -0
- package/browser/esm/{Blaj2R5hYxtLAW__.mjs → CEtXsBzEjEKk9GOj.mjs} +6 -6
- package/browser/esm/{CIu1bjPJe_x31Oww.mjs → COlZu93LRwuBvjE-.mjs} +3 -3
- package/browser/esm/{CoSiOS-og0zFw4Ws.mjs → CTjqDD-swFMZzI-Y.mjs} +2 -2
- package/browser/esm/CWkOgdL7mOKiTR62.mjs +975 -0
- package/browser/esm/ChSVxkPTIjgcC8PL.mjs +412 -0
- package/browser/esm/{5cbK03T_Oh3tNdR7.mjs → ClBvNPeNCAhuVWrG.mjs} +1 -1
- package/browser/esm/CyLn6zOOp_biA3xU.mjs +335 -0
- package/browser/esm/CynTY0oNtyJnoaBq.mjs +14 -0
- package/browser/esm/{xKiLJKiLxto8SayF.mjs → D3rRUK4dIM5gUSmj.mjs} +2 -2
- package/browser/esm/D9ISy7VkaRRFJl46.mjs +515 -0
- package/browser/esm/{fb126BNj3F8URR19.mjs → DDc6rDuU9JAo1DH_.mjs} +3 -3
- package/browser/esm/DDczwkXhz_MHub4z.mjs +197 -0
- package/browser/esm/{X1Db3b_7b_7OuCk6.mjs → DEv4pIEgYr5C7etm.mjs} +1 -1
- package/browser/esm/DG21x7RKDpge6zAE.mjs +31 -0
- package/browser/esm/DJOOed_OtB-XT7f3.mjs +437 -0
- package/browser/esm/{9eKCkvqpMQwqcXiw.mjs → DKtJxrpN0axtuQ0l.mjs} +1 -1
- package/browser/esm/DRSCS6aLiYmPjUz1.mjs +1543 -0
- package/browser/esm/{ByeL_BZuJ2kl8gtf.mjs → DTpRkgsTm_zYnWfW.mjs} +1 -1
- package/browser/esm/DV6i9RQZfJiKtEaJ.mjs +2552 -0
- package/browser/esm/DdcZrjMLWVukWcU5.mjs +7473 -0
- package/browser/esm/Di3BUxA0SqFWWgeg.mjs +94 -0
- package/browser/esm/DnGaP5F7mLwCGUYG.mjs +408 -0
- package/browser/esm/DpD4fg2WcyiKX_2K.mjs +414 -0
- package/browser/esm/{C1Rp2hZrApo5MUc8.mjs → Ds3XRkne7HxcXD8J.mjs} +2 -2
- package/browser/esm/{sFOAxZpxXo-qvDSp.mjs → DsoNMWDwHZP8UXQd.mjs} +1 -1
- package/browser/esm/G0Inqm6Eqw47dMpa.mjs +212 -0
- package/browser/esm/{B1Yp_uy1vFHcJB3U.mjs → HViD4Wfoi0mmqk9w.mjs} +1 -1
- package/browser/esm/LZoYSQAYV2wksnDv.mjs +386 -0
- package/browser/esm/{CtEFHbzYNvYjDYvi.mjs → QgaAIDUMmBQBsXP9.mjs} +8 -8
- package/browser/esm/{D6S8kVTzOjCn0-SK.mjs → YThnrg3PadGs7B4j.mjs} +51 -51
- package/browser/esm/index.mjs +1028 -170
- package/browser/esm/ttjcNHcFn8O6hfnd.mjs +1288 -0
- package/browser/esm/{yZxC4qUENOlMhVUH.mjs → w_JrR69vEpvoyeMy.mjs} +1 -1
- package/browser/esm/{DmCQbW4zwkT_Rq88.mjs → xFqkfN8QMCxvsetB.mjs} +1 -1
- package/browser/esm/{IQLeaAbtGTipUsOD.mjs → zqilJefihVd7At2T.mjs} +22 -21
- package/licenses/dependencies.txt +94 -94
- package/node/esm/{BYsG3KYVmxSe_CIQ.mjs → 1bf4gn-2vld4BZ9u.mjs} +1 -1
- package/node/esm/{CKu1AtRgyltyEdEN.mjs → 3WghtBXAvCDwcVrq.mjs} +1 -1
- package/node/esm/{cqzp431iNSLWictb.mjs → 4HmLH0bPVJCZLgik.mjs} +22 -22
- package/node/esm/{BYVLi0md4AYuDsB_.mjs → B0bdb_6p7fQI_ivo.mjs} +28 -28
- package/node/esm/BIMkjQUwG4Ih-6Sh.mjs +142 -0
- package/node/esm/BNg4QQY0WAPLE0q7.mjs +141 -0
- package/node/esm/BPzcW4BejRqso338.mjs +72 -0
- package/node/esm/BR45ogAR-hY2bE60.mjs +318 -0
- package/node/esm/BlN7G0DVC24zauig.mjs +197 -0
- package/node/esm/{ah3CUg4-VmNstGk_.mjs → Bph-sR3l6AYWeuxK.mjs} +2 -2
- package/node/esm/CPq-MIdEnc-53JpF.mjs +319 -0
- package/node/esm/CSAnTp5rwId0DUb8.mjs +380 -0
- package/node/esm/CWcv7UVXF8IUB0PC.mjs +1379 -0
- package/node/esm/{D9rzScOA9pEYFrtz.mjs → CYIoK22I6Yvv12_x.mjs} +20 -20
- package/node/esm/CZyA9uD4SkTvqp_G.mjs +1283 -0
- package/node/esm/{ci8d-mF1H9wnYzix.mjs → CjC6s3RUJQNCF7mP.mjs} +1 -1
- package/node/esm/{D6oQL8knsPpgdXuk.mjs → CuMePia6i_8yfJ6S.mjs} +9 -9
- package/node/esm/CvRbu8JPxFarsSR-.mjs +412 -0
- package/node/esm/{DNSjK5DAH3M14Qbc.mjs → CyafafEgfmjLqE5O.mjs} +1 -1
- package/node/esm/D-xqQ5qOSd6WrzwJ.mjs +94 -0
- package/node/esm/DLqBHdFp6wvm6EGs.mjs +212 -0
- package/node/esm/{BcwMb6CyVfvEwbHn.mjs → DMXLxp3T0E0SRTQc.mjs} +1 -1
- package/node/esm/{DZzvTQxIKr9LbEsA.mjs → DWqvf4H5F2wMnZ0L.mjs} +32 -30
- package/node/esm/DatM6eEYPpAtIMy-.mjs +405 -0
- package/node/esm/Db3dbaYLKUO66T9s.mjs +1689 -0
- package/node/esm/{B_jRGdwGFkudwmL-.mjs → DdEzhVqYTrGODXrz.mjs} +1 -1
- package/node/esm/DeZJlLk8WJ3BLtLs.mjs +975 -0
- package/node/esm/DfCuL8AUxMFoEG2s.mjs +519 -0
- package/node/esm/{Bb1sLMqXWKjdve23.mjs → Do-zCKziWhoG5eAv.mjs} +2 -2
- package/node/esm/{B8SQfjKjzYHLxzZR.mjs → DpJ2gmZJioCyq8La.mjs} +67 -67
- package/node/esm/{ETK6T6G0SIcFXDe5.mjs → XEDcegsv5AGKBfu2.mjs} +40 -40
- package/node/esm/index.mjs +8941 -13558
- package/node/esm/yCUxQuqVuC4DHKPx.mjs +385 -0
- package/node/esm/zITjZ7R4raDqhP-n.mjs +515 -0
- package/package.json +9 -9
- package/resources/locales/de/ui.msg.json +97 -0
- package/resources/locales/en/ui.msg.json +97 -0
- 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/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/comments/CommentCard.d.ts +2 -2
- package/types/src/conditions/useFormulaOption.d.ts +2 -2
- package/types/src/dialog/WorkbookStatisticsDialog.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/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/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/workbook/DefaultRenderers.d.ts +2 -2
- package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
- package/browser/esm/Biy7bhzzzPb5sfRN.mjs +0 -152
- package/browser/esm/COv-m-c2byCgvU3M.mjs +0 -14861
- package/browser/esm/Die9NXVFveHvcCT-.mjs +0 -4205
- package/browser/esm/sam1KGQZ59B_fADz.mjs +0 -1941
- package/node/esm/BYwXhrEwkRAt9nJS.mjs +0 -71
- package/node/esm/Cmt8Wv806N7NmE4Y.mjs +0 -3344
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.11
|
|
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 "./BED6h6YAwCf1HEQJ.mjs";
|
|
8
|
+
import { i as t } from "./BokqKEpU6TFgfRs6.mjs";
|
|
9
|
+
import { i as n, n as r, t as i } from "./DRSCS6aLiYmPjUz1.mjs";
|
|
10
|
+
import { n as a, t as o } from "./BAbq4-I5f5oUiNaF.mjs";
|
|
11
|
+
import { ICondition as s, IDataValidation as c } from "@sheetxl/sdk";
|
|
12
|
+
import { useModelSync as l } from "@sheetxl/react";
|
|
13
|
+
import { DynamicIcon as u, useTranslator as d } from "@sheetxl/utils-react";
|
|
14
|
+
import { forwardRef as f, memo as p, useState as m } from "react";
|
|
15
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
16
|
+
import { Box as v, Checkbox as y, FormControl as b, FormControlLabel as x, InputLabel as S, MenuItem as C, Paper as w, Select as T, Tab as E, Tabs as D, TextField as O, Typography as k } from "@mui/material";
|
|
17
|
+
import { messageKey as A } from "@sheetxl/utils";
|
|
18
|
+
var j = s.BuiltInSelectorNames, M = {
|
|
19
|
+
[j.Whole]: "FormulaMathTrig",
|
|
20
|
+
[j.Number]: "IncreaseDecimal",
|
|
21
|
+
[j.Date]: "FormulaDateTime",
|
|
22
|
+
[j.DateTime]: "FormulaDateTime",
|
|
23
|
+
[j.Time]: "FormulaDateTime",
|
|
24
|
+
[j.TextLength]: "FormulaText"
|
|
25
|
+
}, N = (e) => {
|
|
26
|
+
let t = e.getCondition();
|
|
27
|
+
if (!t) return "DataValidation";
|
|
28
|
+
let n = t.toJSON();
|
|
29
|
+
return n.operator === s.BuiltInOperatorNames.Expression ? "FormulaCustom" : n.selector || n.operator !== s.BuiltInOperatorNames.InSet ? typeof n.selector == "string" && M[n.selector] || "DataValidation" : "Menu";
|
|
30
|
+
}, P = p(({ dataValidation: t, size: n = 28 }) => (l(t, "onAnyChange"), g(e, {
|
|
31
|
+
className: "sxl-dv-icon",
|
|
32
|
+
sx: {
|
|
33
|
+
width: "auto",
|
|
34
|
+
minWidth: 1.7 * n + "px",
|
|
35
|
+
height: `${n}px`
|
|
36
|
+
},
|
|
37
|
+
children: g(u, {
|
|
38
|
+
iconKey: N(t),
|
|
39
|
+
size: Math.round(.6 * n),
|
|
40
|
+
ariaHidden: !0
|
|
41
|
+
})
|
|
42
|
+
})));
|
|
43
|
+
P.displayName = "DataValidationIcon";
|
|
44
|
+
var F = (e, t) => {
|
|
45
|
+
let n = e.getCondition();
|
|
46
|
+
if (!n) return t("dataValidation.anyValue");
|
|
47
|
+
let r = n.toJSON();
|
|
48
|
+
if (r.operator === s.BuiltInOperatorNames.Expression && typeof r.param == "string") return t("dataValidation.titleCustom", { formula: r.param });
|
|
49
|
+
if (!r.selector && r.operator === s.BuiltInOperatorNames.InSet) {
|
|
50
|
+
let e = r.param, n = e?.source;
|
|
51
|
+
if (typeof n == "string" && n.length > 0) return t("dataValidation.titleListFrom", { source: n });
|
|
52
|
+
let i = (e?.items ?? []).map((e) => String(e ?? "")).concat((e?.additions ?? []).map((e) => e.trimStart()));
|
|
53
|
+
return t("dataValidation.titleList", {
|
|
54
|
+
items: i.slice(0, 3).join(", "),
|
|
55
|
+
more: Math.max(0, i.length - 3)
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return n.toString();
|
|
59
|
+
}, I = {
|
|
60
|
+
[c.AlertStyle.Stop]: "ValidationStop",
|
|
61
|
+
[c.AlertStyle.Warning]: "ValidationWarning",
|
|
62
|
+
[c.AlertStyle.Information]: "ValidationInformation"
|
|
63
|
+
}, L = "none", R = {
|
|
64
|
+
width: 18,
|
|
65
|
+
height: 18,
|
|
66
|
+
flex: "0 0 auto"
|
|
67
|
+
}, z = {
|
|
68
|
+
[c.AlertStyle.Stop]: A("dataValidation.alertStop"),
|
|
69
|
+
[c.AlertStyle.Warning]: A("dataValidation.alertWarning"),
|
|
70
|
+
[c.AlertStyle.Information]: A("dataValidation.alertInformation")
|
|
71
|
+
}, B = p((e) => {
|
|
72
|
+
let { dataValidation: a } = e, s = d();
|
|
73
|
+
l(a, "onAnyChange");
|
|
74
|
+
let c = a.isProtected(), f = a.getRenderHints().includes("list"), [p, A] = m("rule"), j = _(w, {
|
|
75
|
+
tabIndex: 0,
|
|
76
|
+
className: t["editor-panel"],
|
|
77
|
+
sx: {
|
|
78
|
+
gap: (e) => e.spacing(1),
|
|
79
|
+
paddingTop: (e) => e.spacing(1.25),
|
|
80
|
+
paddingBottom: (e) => e.spacing(2),
|
|
81
|
+
paddingLeft: (e) => e.spacing(1.5),
|
|
82
|
+
paddingRight: (e) => e.spacing(1.5),
|
|
83
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
84
|
+
borderRadius: (e) => e.spacing(1.25),
|
|
85
|
+
overflow: "auto"
|
|
86
|
+
},
|
|
87
|
+
children: [
|
|
88
|
+
_(v, {
|
|
89
|
+
sx: {
|
|
90
|
+
display: "flex",
|
|
91
|
+
flexDirection: "column",
|
|
92
|
+
gap: (e) => e.spacing(1.75),
|
|
93
|
+
margin: (e) => e.spacing(1.25),
|
|
94
|
+
marginBottom: 0
|
|
95
|
+
},
|
|
96
|
+
children: [_(v, {
|
|
97
|
+
sx: {
|
|
98
|
+
display: "flex",
|
|
99
|
+
alignItems: "center",
|
|
100
|
+
gap: (e) => e.spacing(1.5)
|
|
101
|
+
},
|
|
102
|
+
children: [g(P, {
|
|
103
|
+
dataValidation: a,
|
|
104
|
+
size: 48
|
|
105
|
+
}), g(k, {
|
|
106
|
+
variant: "body2",
|
|
107
|
+
sx: {
|
|
108
|
+
minWidth: 0,
|
|
109
|
+
wordBreak: "break-word"
|
|
110
|
+
},
|
|
111
|
+
children: F(a, s)
|
|
112
|
+
})]
|
|
113
|
+
}), g(o, {
|
|
114
|
+
item: a,
|
|
115
|
+
label: s("dataValidation.applyTo")
|
|
116
|
+
})]
|
|
117
|
+
}),
|
|
118
|
+
_(D, {
|
|
119
|
+
value: p,
|
|
120
|
+
onChange: (e, t) => A(t),
|
|
121
|
+
sx: {
|
|
122
|
+
minHeight: "36px",
|
|
123
|
+
borderBottom: 1,
|
|
124
|
+
borderColor: "divider",
|
|
125
|
+
"& .MuiTab-root": {
|
|
126
|
+
minHeight: "36px",
|
|
127
|
+
textTransform: "none",
|
|
128
|
+
pt: .5,
|
|
129
|
+
pb: .5,
|
|
130
|
+
px: 1.5,
|
|
131
|
+
minWidth: 0
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
children: [g(E, {
|
|
135
|
+
value: "rule",
|
|
136
|
+
label: s("dataValidation.tabRule")
|
|
137
|
+
}), g(E, {
|
|
138
|
+
value: "prompt",
|
|
139
|
+
label: s("dataValidation.prompt")
|
|
140
|
+
})]
|
|
141
|
+
}),
|
|
142
|
+
p === "prompt" ? _(v, {
|
|
143
|
+
sx: {
|
|
144
|
+
display: "flex",
|
|
145
|
+
flexDirection: "column",
|
|
146
|
+
gap: 2
|
|
147
|
+
},
|
|
148
|
+
children: [
|
|
149
|
+
g(x, {
|
|
150
|
+
control: g(y, {
|
|
151
|
+
checked: a.isShowPromptMessage(),
|
|
152
|
+
disabled: c,
|
|
153
|
+
onChange: (e) => a.setShowPromptMessage(e.target.checked)
|
|
154
|
+
}),
|
|
155
|
+
label: s("dataValidation.showPrompt"),
|
|
156
|
+
sx: {
|
|
157
|
+
ml: 0,
|
|
158
|
+
pl: .5
|
|
159
|
+
}
|
|
160
|
+
}),
|
|
161
|
+
g(O, {
|
|
162
|
+
size: "small",
|
|
163
|
+
label: s("dataValidation.title"),
|
|
164
|
+
value: a.getPromptTitle(),
|
|
165
|
+
onChange: (e) => a.setPromptTitle(e.target.value),
|
|
166
|
+
disabled: c,
|
|
167
|
+
fullWidth: !0,
|
|
168
|
+
slotProps: { htmlInput: { maxLength: 32 } },
|
|
169
|
+
sx: { backgroundColor: "background.paper" }
|
|
170
|
+
}),
|
|
171
|
+
g(O, {
|
|
172
|
+
size: "small",
|
|
173
|
+
label: s("dataValidation.message"),
|
|
174
|
+
value: a.getPromptMessage(),
|
|
175
|
+
onChange: (e) => a.setPromptMessage(e.target.value),
|
|
176
|
+
disabled: c,
|
|
177
|
+
multiline: !0,
|
|
178
|
+
rows: 2,
|
|
179
|
+
fullWidth: !0,
|
|
180
|
+
slotProps: { htmlInput: { maxLength: 254 } },
|
|
181
|
+
sx: { backgroundColor: "background.paper" }
|
|
182
|
+
})
|
|
183
|
+
]
|
|
184
|
+
}) : _(h, { children: [g(i, {
|
|
185
|
+
sx: {
|
|
186
|
+
...r,
|
|
187
|
+
p: 2,
|
|
188
|
+
pb: 0
|
|
189
|
+
},
|
|
190
|
+
selectorTitle: s("dataValidation.allow"),
|
|
191
|
+
condition: a.getCondition(),
|
|
192
|
+
ranges: a.getRanges(),
|
|
193
|
+
readOnly: c,
|
|
194
|
+
onConditionChange: (e) => {
|
|
195
|
+
let t = !a.getCondition() && e ? {
|
|
196
|
+
...e,
|
|
197
|
+
includeBlanks: !0
|
|
198
|
+
} : e;
|
|
199
|
+
a.setCondition(t);
|
|
200
|
+
},
|
|
201
|
+
qualifiers: f ? g(x, {
|
|
202
|
+
control: g(y, {
|
|
203
|
+
size: "small",
|
|
204
|
+
checked: !a.isHideDropdown(),
|
|
205
|
+
disabled: c,
|
|
206
|
+
onChange: (e) => a.setHideDropdown(!e.target.checked)
|
|
207
|
+
}),
|
|
208
|
+
label: s("dataValidation.inCellDropdown")
|
|
209
|
+
}) : null
|
|
210
|
+
}), _(v, {
|
|
211
|
+
sx: {
|
|
212
|
+
display: "flex",
|
|
213
|
+
flexDirection: "column",
|
|
214
|
+
gap: 2,
|
|
215
|
+
p: 2,
|
|
216
|
+
border: 1,
|
|
217
|
+
borderColor: "divider",
|
|
218
|
+
borderRadius: 1
|
|
219
|
+
},
|
|
220
|
+
children: [_(b, {
|
|
221
|
+
fullWidth: !0,
|
|
222
|
+
size: "small",
|
|
223
|
+
disabled: c,
|
|
224
|
+
sx: { backgroundColor: "background.paper" },
|
|
225
|
+
children: [g(S, { children: s("dataValidation.onInvalid") }), _(T, {
|
|
226
|
+
className: "on-invalid",
|
|
227
|
+
value: a.isShowAlertMessage() ? a.getAlertStyle() : L,
|
|
228
|
+
label: s("dataValidation.onInvalid"),
|
|
229
|
+
onChange: (e) => {
|
|
230
|
+
let t = e.target.value;
|
|
231
|
+
t === L ? a.setShowAlertMessage(!1) : (a.setAlertStyle(t), a.setShowAlertMessage(!0));
|
|
232
|
+
},
|
|
233
|
+
renderValue: (e) => _(v, {
|
|
234
|
+
sx: {
|
|
235
|
+
display: "flex",
|
|
236
|
+
alignItems: "center",
|
|
237
|
+
gap: 1
|
|
238
|
+
},
|
|
239
|
+
children: [e === L ? g(v, { sx: R }) : g(u, {
|
|
240
|
+
iconKey: I[e],
|
|
241
|
+
size: 18,
|
|
242
|
+
ariaHidden: !0
|
|
243
|
+
}), s(e === L ? "dataValidation.alertNone" : z[e])]
|
|
244
|
+
}),
|
|
245
|
+
children: [Object.keys(I).map((e) => _(C, {
|
|
246
|
+
value: e,
|
|
247
|
+
sx: { gap: 1 },
|
|
248
|
+
children: [g(u, {
|
|
249
|
+
iconKey: I[e],
|
|
250
|
+
size: 18,
|
|
251
|
+
ariaHidden: !0
|
|
252
|
+
}), s(z[e])]
|
|
253
|
+
}, e)), _(C, {
|
|
254
|
+
value: L,
|
|
255
|
+
sx: { gap: 1 },
|
|
256
|
+
children: [g(v, { sx: R }), s("dataValidation.alertNone")]
|
|
257
|
+
}, L)]
|
|
258
|
+
})]
|
|
259
|
+
}), a.isShowAlertMessage() ? _(h, { children: [g(O, {
|
|
260
|
+
size: "small",
|
|
261
|
+
label: s("dataValidation.title"),
|
|
262
|
+
value: a.getAlertTitle(),
|
|
263
|
+
onChange: (e) => a.setAlertTitle(e.target.value),
|
|
264
|
+
disabled: c,
|
|
265
|
+
fullWidth: !0,
|
|
266
|
+
slotProps: { htmlInput: { maxLength: 32 } },
|
|
267
|
+
sx: { backgroundColor: "background.paper" }
|
|
268
|
+
}), g(O, {
|
|
269
|
+
size: "small",
|
|
270
|
+
label: s("dataValidation.message"),
|
|
271
|
+
value: a.getAlertMessage(),
|
|
272
|
+
onChange: (e) => a.setAlertMessage(e.target.value),
|
|
273
|
+
disabled: c,
|
|
274
|
+
multiline: !0,
|
|
275
|
+
rows: 2,
|
|
276
|
+
fullWidth: !0,
|
|
277
|
+
slotProps: { htmlInput: { maxLength: 225 } },
|
|
278
|
+
sx: { backgroundColor: "background.paper" }
|
|
279
|
+
})] }) : null]
|
|
280
|
+
})] })
|
|
281
|
+
]
|
|
282
|
+
});
|
|
283
|
+
return g(n.Provider, {
|
|
284
|
+
value: a,
|
|
285
|
+
children: j
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
B.displayName = "DataValidationEditorPanel";
|
|
289
|
+
var V = ({ icon: e, title: t, children: n }) => _(v, {
|
|
290
|
+
className: "validation-badge",
|
|
291
|
+
title: t,
|
|
292
|
+
"aria-label": t,
|
|
293
|
+
sx: {
|
|
294
|
+
display: "inline-flex",
|
|
295
|
+
alignItems: "center",
|
|
296
|
+
gap: .5,
|
|
297
|
+
px: .75,
|
|
298
|
+
py: .25,
|
|
299
|
+
border: 1,
|
|
300
|
+
borderColor: "divider",
|
|
301
|
+
borderRadius: 1,
|
|
302
|
+
color: "text.secondary"
|
|
303
|
+
},
|
|
304
|
+
children: [g(u, {
|
|
305
|
+
iconKey: e,
|
|
306
|
+
size: 14,
|
|
307
|
+
ariaHidden: !0
|
|
308
|
+
}), n ? g(k, {
|
|
309
|
+
variant: "caption",
|
|
310
|
+
children: n
|
|
311
|
+
}) : null]
|
|
312
|
+
}), H = {
|
|
313
|
+
[c.AlertStyle.Stop]: "dataValidation.alertStop",
|
|
314
|
+
[c.AlertStyle.Warning]: "dataValidation.alertWarning",
|
|
315
|
+
[c.AlertStyle.Information]: "dataValidation.alertInformation"
|
|
316
|
+
}, U = p(({ item: e }) => {
|
|
317
|
+
let t = d();
|
|
318
|
+
l(e, "onAnyChange");
|
|
319
|
+
let n = [];
|
|
320
|
+
if (e.isShowPromptMessage() && n.push(g(V, {
|
|
321
|
+
icon: "NoteInsert",
|
|
322
|
+
title: t("dataValidation.prompt"),
|
|
323
|
+
children: e.getPromptTitle() || null
|
|
324
|
+
}, "prompt")), e.getCondition() && e.isShowAlertMessage()) {
|
|
325
|
+
let r = e.getAlertStyle();
|
|
326
|
+
n.push(g(V, {
|
|
327
|
+
icon: I[r],
|
|
328
|
+
title: `${t("dataValidation.alert")}: ${t(H[r])}`
|
|
329
|
+
}, "alert"));
|
|
330
|
+
}
|
|
331
|
+
return !e.isHideDropdown() && e.getRenderHints().includes("list") && n.push(g(V, {
|
|
332
|
+
icon: "ArrowDownOutline",
|
|
333
|
+
title: t("dataValidation.inCellDropdown")
|
|
334
|
+
}, "dropdown")), n.length === 0 ? null : g(v, {
|
|
335
|
+
sx: {
|
|
336
|
+
display: "flex",
|
|
337
|
+
flexWrap: "wrap",
|
|
338
|
+
gap: .5
|
|
339
|
+
},
|
|
340
|
+
children: n
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
U.displayName = "DataValidationCardBody";
|
|
344
|
+
var W = p(({ item: e }) => {
|
|
345
|
+
let t = d();
|
|
346
|
+
return g(o, {
|
|
347
|
+
item: e,
|
|
348
|
+
label: t("dataValidation.applyTo"),
|
|
349
|
+
helperText: null
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
W.displayName = "DataValidationCardRanges";
|
|
353
|
+
var G = {
|
|
354
|
+
key: "data-validation",
|
|
355
|
+
messageKeys: {
|
|
356
|
+
none: A("dataValidation.none"),
|
|
357
|
+
addPrompt: A("dataValidation.addPrompt"),
|
|
358
|
+
heading: A("dataValidation.heading"),
|
|
359
|
+
insert: A("dataValidation.insert"),
|
|
360
|
+
new: A("dataValidation.new"),
|
|
361
|
+
moveUp: A("dataValidation.moveUp"),
|
|
362
|
+
moveDown: A("dataValidation.moveDown"),
|
|
363
|
+
edit: A("dataValidation.edit"),
|
|
364
|
+
duplicate: A("dataValidation.duplicate"),
|
|
365
|
+
delete: A("dataValidation.delete"),
|
|
366
|
+
cancel: A("dataValidation.cancel"),
|
|
367
|
+
save: A("dataValidation.save")
|
|
368
|
+
},
|
|
369
|
+
getCollection: (e) => e.getDataValidations(),
|
|
370
|
+
changeEvents: ["onDataValidationsChange"],
|
|
371
|
+
isReadOnly: (e) => e.getProtection().isLocked() || e.getProtection().isReadOnly(),
|
|
372
|
+
applyUpdate: (e, t) => {
|
|
373
|
+
e.update(t);
|
|
374
|
+
},
|
|
375
|
+
validate: (e) => e.getCondition()?.validate() ?? null,
|
|
376
|
+
applyNewDefaults: (e) => {
|
|
377
|
+
e.update({
|
|
378
|
+
alertStyle: c.AlertStyle.Stop,
|
|
379
|
+
showAlertMessage: !0
|
|
380
|
+
});
|
|
381
|
+
},
|
|
382
|
+
applySeed: (e, t) => {
|
|
383
|
+
e.update(t);
|
|
384
|
+
},
|
|
385
|
+
getCardTitle: F,
|
|
386
|
+
CardMedia: ({ item: e }) => g(P, {
|
|
387
|
+
dataValidation: e,
|
|
388
|
+
size: 32
|
|
389
|
+
}),
|
|
390
|
+
CardSubtitle: W,
|
|
391
|
+
CardBody: U,
|
|
392
|
+
EditorBody: ({ item: e }) => g(B, { dataValidation: e })
|
|
393
|
+
}, K = p(f((e, t) => {
|
|
394
|
+
let { workbook: n, args: r, ...i } = e;
|
|
395
|
+
return g(a, {
|
|
396
|
+
ref: t,
|
|
397
|
+
workbook: n,
|
|
398
|
+
descriptor: G,
|
|
399
|
+
args: r,
|
|
400
|
+
dragReorder: !0,
|
|
401
|
+
...i
|
|
402
|
+
});
|
|
403
|
+
}));
|
|
404
|
+
K.displayName = "DataValidationDetailsPanel";
|
|
405
|
+
var q = (e) => {
|
|
406
|
+
let { model: t, entryKey: n, frame: r, args: i, ref: a, ...o } = e;
|
|
407
|
+
return g(K, {
|
|
408
|
+
ref: a,
|
|
409
|
+
workbook: t,
|
|
410
|
+
args: i,
|
|
411
|
+
...o
|
|
412
|
+
});
|
|
413
|
+
};
|
|
414
|
+
export { q as DataValidationDetailsTaskPane };
|
|
@@ -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.11
|
|
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 { t as e } from "./
|
|
7
|
+
import { t as e } from "./xFqkfN8QMCxvsetB.mjs";
|
|
8
8
|
import { ReactUtils as t } from "@sheetxl/utils-react";
|
|
9
9
|
import { Component as n, PureComponent as r, memo as i, useCallback as a, useLayoutEffect as o, useState as s } from "react";
|
|
10
10
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
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.11
|
|
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.
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.11
|
|
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 { ICellRange as e } from "@sheetxl/sdk";
|
|
8
|
+
import { addRangeAnnotations as t, clearRangeAnnotations as n, useModelListener as r } from "@sheetxl/react";
|
|
9
|
+
import { DynamicIcon as i } from "@sheetxl/utils-react";
|
|
10
|
+
import { memo as a, useEffect as o, useState as s } from "react";
|
|
11
|
+
import { SimpleTooltip as c } from "@sheetxl/utils-mui";
|
|
12
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
13
|
+
import { Box as d, Button as f, Chip as p, IconButton as m, Typography as h } from "@mui/material";
|
|
14
|
+
var g = "anomalies", _ = {
|
|
15
|
+
formula: "Inconsistent formula",
|
|
16
|
+
formulaRange: "Omits adjacent cells",
|
|
17
|
+
numberStoredAsText: "Number stored as text",
|
|
18
|
+
emptyCellReference: "Refers to an empty cell",
|
|
19
|
+
unlockedFormula: "Unlocked formula",
|
|
20
|
+
hardcodeInRun: "Typed value in a run of formulas",
|
|
21
|
+
styleBreak: "Format break"
|
|
22
|
+
}, v = (e, t) => `'${e.getName().replace(/'/g, "''")}'!${t}`, y = (e) => {
|
|
23
|
+
let t = e.evidence, n = [];
|
|
24
|
+
return t.axis !== void 0 && n.push(t.axis === "row" ? "run left and right" : "run above and below"), t.expected !== void 0 && n.push(`run has ${t.expected}`), t.actual !== void 0 && n.push(`here ${t.actual}`), t.reference !== void 0 && n.push(`reads ${t.reference}`), t.omitted !== void 0 && n.push(`stops before ${t.omitted}`), Number(t.thickness) > 1 && n.push(`${t.thickness} thick`), Number(t.flanks) === 1 && n.push("one cell each side"), n.join(" · ");
|
|
25
|
+
}, b = a((a) => {
|
|
26
|
+
let { model: b, args: x, entryKey: S, frame: C, ref: w, ...T } = a, [E, D] = s(() => b?.getSelectedWorksheet() ?? null);
|
|
27
|
+
r(b, { onSheetsChange() {
|
|
28
|
+
D(b?.getSelectedWorksheet() ?? null);
|
|
29
|
+
} });
|
|
30
|
+
let [O, k] = s(null), [A, j] = s(() => /* @__PURE__ */ new Set()), [M, N] = s(0), [P, F] = s(E);
|
|
31
|
+
P !== E && (F(E), k(null), j(/* @__PURE__ */ new Set()));
|
|
32
|
+
let I = () => {
|
|
33
|
+
b && n(b, {
|
|
34
|
+
intent: "working",
|
|
35
|
+
source: g
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
if (o(() => I, [b]), !b || !E) return null;
|
|
39
|
+
let L = O?.filter((e) => !A.has(e.key)) ?? [], R = L.reduce((e, t) => e + t.rows * t.cols, 0);
|
|
40
|
+
return u(d, {
|
|
41
|
+
ref: w,
|
|
42
|
+
...T,
|
|
43
|
+
className: "sxl-anomalies-pane",
|
|
44
|
+
sx: {
|
|
45
|
+
display: "flex",
|
|
46
|
+
flexDirection: "column",
|
|
47
|
+
width: "100%",
|
|
48
|
+
minWidth: 0,
|
|
49
|
+
flex: "1 1 auto",
|
|
50
|
+
height: "100%",
|
|
51
|
+
minHeight: 0,
|
|
52
|
+
overflowX: "hidden"
|
|
53
|
+
},
|
|
54
|
+
children: [u(d, {
|
|
55
|
+
sx: {
|
|
56
|
+
display: "flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
gap: 1,
|
|
59
|
+
flex: "0 0 auto",
|
|
60
|
+
px: 1.5,
|
|
61
|
+
py: 1,
|
|
62
|
+
borderBottom: 1,
|
|
63
|
+
borderColor: "divider"
|
|
64
|
+
},
|
|
65
|
+
children: [l(f, {
|
|
66
|
+
variant: "contained",
|
|
67
|
+
size: "small",
|
|
68
|
+
sx: { textTransform: "none" },
|
|
69
|
+
onClick: () => {
|
|
70
|
+
I();
|
|
71
|
+
let t = performance.now();
|
|
72
|
+
k(((t) => {
|
|
73
|
+
let n = t.getUsedRange();
|
|
74
|
+
return n ? [...n.getRegions(e.Feature.Anomalies)].map((e) => {
|
|
75
|
+
let t = e.getCoords();
|
|
76
|
+
return {
|
|
77
|
+
key: `${t.rowStart},${t.colStart},${t.rowEnd},${t.colEnd}`,
|
|
78
|
+
coords: t,
|
|
79
|
+
address: e.getAddress(),
|
|
80
|
+
rows: e.getRowCount(),
|
|
81
|
+
cols: e.getColumnCount(),
|
|
82
|
+
anomalies: e.getCell().getAnomalies()
|
|
83
|
+
};
|
|
84
|
+
}) : [];
|
|
85
|
+
})(E)), N(Math.round(performance.now() - t)), j(/* @__PURE__ */ new Set());
|
|
86
|
+
},
|
|
87
|
+
children: "Analyze"
|
|
88
|
+
}), l(h, {
|
|
89
|
+
variant: "body2",
|
|
90
|
+
sx: {
|
|
91
|
+
color: "text.secondary",
|
|
92
|
+
minWidth: 0,
|
|
93
|
+
overflow: "hidden",
|
|
94
|
+
textOverflow: "ellipsis",
|
|
95
|
+
whiteSpace: "nowrap"
|
|
96
|
+
},
|
|
97
|
+
children: O === null ? E.getName() : `${E.getName()} · ${L.length} regions · ${R} cells · ${M} ms`
|
|
98
|
+
})]
|
|
99
|
+
}), u(d, {
|
|
100
|
+
className: "sxl-anomalies-list",
|
|
101
|
+
sx: {
|
|
102
|
+
flex: "1 1 auto",
|
|
103
|
+
minHeight: 0,
|
|
104
|
+
overflowY: "auto",
|
|
105
|
+
display: "flex",
|
|
106
|
+
flexDirection: "column",
|
|
107
|
+
gap: 1,
|
|
108
|
+
p: 1.5
|
|
109
|
+
},
|
|
110
|
+
onMouseLeave: I,
|
|
111
|
+
children: [O === null ? l(h, {
|
|
112
|
+
variant: "body2",
|
|
113
|
+
sx: { color: "text.secondary" },
|
|
114
|
+
children: "Analyze lists where this sheet breaks its own patterns."
|
|
115
|
+
}) : L.length === 0 ? l(h, {
|
|
116
|
+
variant: "body2",
|
|
117
|
+
sx: { color: "text.secondary" },
|
|
118
|
+
children: "Nothing breaks a pattern here."
|
|
119
|
+
}) : null, L.map((e) => u(d, {
|
|
120
|
+
className: "sxl-anomalies-card",
|
|
121
|
+
onMouseEnter: () => ((e) => {
|
|
122
|
+
t(b, "working", [{ range: v(E, e.address) }], { source: g });
|
|
123
|
+
})(e),
|
|
124
|
+
onClick: () => {
|
|
125
|
+
E.getRange(e.coords).select();
|
|
126
|
+
},
|
|
127
|
+
sx: {
|
|
128
|
+
display: "flex",
|
|
129
|
+
flexDirection: "column",
|
|
130
|
+
gap: .5,
|
|
131
|
+
flex: "0 0 auto",
|
|
132
|
+
border: 1,
|
|
133
|
+
borderColor: "divider",
|
|
134
|
+
borderRadius: 1,
|
|
135
|
+
px: 1.25,
|
|
136
|
+
py: 1,
|
|
137
|
+
cursor: "pointer",
|
|
138
|
+
"&:hover": { borderColor: "primary.main" }
|
|
139
|
+
},
|
|
140
|
+
children: [u(d, {
|
|
141
|
+
sx: {
|
|
142
|
+
display: "flex",
|
|
143
|
+
alignItems: "center",
|
|
144
|
+
gap: 1
|
|
145
|
+
},
|
|
146
|
+
children: [
|
|
147
|
+
l(h, {
|
|
148
|
+
variant: "body2",
|
|
149
|
+
sx: { fontWeight: 600 },
|
|
150
|
+
children: e.address
|
|
151
|
+
}),
|
|
152
|
+
l(h, {
|
|
153
|
+
variant: "caption",
|
|
154
|
+
sx: { color: "text.secondary" },
|
|
155
|
+
children: `${e.rows}×${e.cols} · rank ${e.anomalies[0]?.rank ?? 0}`
|
|
156
|
+
}),
|
|
157
|
+
l(d, { sx: { flex: "1 1 auto" } }),
|
|
158
|
+
l(c, {
|
|
159
|
+
disableInteractive: !0,
|
|
160
|
+
title: "Dismiss",
|
|
161
|
+
children: l(m, {
|
|
162
|
+
size: "small",
|
|
163
|
+
"aria-label": "Dismiss",
|
|
164
|
+
onClick: (t) => {
|
|
165
|
+
t.stopPropagation(), I(), j((t) => new Set(t).add(e.key));
|
|
166
|
+
},
|
|
167
|
+
children: l(i, { iconKey: "Close" })
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
}), e.anomalies.map((e, t) => {
|
|
172
|
+
let n = e.evidence.corroborated, r = e.evidence.layer;
|
|
173
|
+
return u(d, {
|
|
174
|
+
sx: {
|
|
175
|
+
display: "flex",
|
|
176
|
+
flexDirection: "column",
|
|
177
|
+
gap: .25
|
|
178
|
+
},
|
|
179
|
+
children: [
|
|
180
|
+
l(h, {
|
|
181
|
+
variant: "body2",
|
|
182
|
+
children: `${_[e.check] ?? e.check}${r ? ` · ${r}` : ""}`
|
|
183
|
+
}),
|
|
184
|
+
l(h, {
|
|
185
|
+
variant: "caption",
|
|
186
|
+
sx: {
|
|
187
|
+
color: "text.secondary",
|
|
188
|
+
overflowWrap: "anywhere"
|
|
189
|
+
},
|
|
190
|
+
children: y(e)
|
|
191
|
+
}),
|
|
192
|
+
Array.isArray(n) && n.length > 0 ? l(d, {
|
|
193
|
+
sx: {
|
|
194
|
+
display: "flex",
|
|
195
|
+
flexWrap: "wrap",
|
|
196
|
+
gap: .5
|
|
197
|
+
},
|
|
198
|
+
children: n.map((e) => l(p, {
|
|
199
|
+
size: "small",
|
|
200
|
+
variant: "outlined",
|
|
201
|
+
label: e
|
|
202
|
+
}, e))
|
|
203
|
+
}) : null
|
|
204
|
+
]
|
|
205
|
+
}, t);
|
|
206
|
+
})]
|
|
207
|
+
}, e.key))]
|
|
208
|
+
})]
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
b.displayName = "AnomaliesTaskPane";
|
|
212
|
+
export { b as AnomaliesTaskPane, b as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
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.11
|
|
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.
|