@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
|
@@ -0,0 +1,414 @@
|
|
|
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 "./DHZA48ZMCETvHmeP.mjs";
|
|
8
|
+
import { i as t } from "./PY3Br5Bo_TxcCnCU.mjs";
|
|
9
|
+
import { i as n, n as r, t as i } from "./BsngRDhvVYGVBJeK.mjs";
|
|
10
|
+
import { n as a, t as o } from "./BWfLpYmd3cSgJ0C6.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 };
|