@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,1288 @@
|
|
|
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 { c as e, r as t } from "./Bujtz_Guj88d03vI.mjs";
|
|
8
|
+
import { a as n, i as r, r as i, t as a } from "./CyLn6zOOp_biA3xU.mjs";
|
|
9
|
+
import { n as o } from "./DDc6rDuU9JAo1DH_.mjs";
|
|
10
|
+
import { a as s, c, i as l, l as u, n as d, o as f, r as p, s as m, t as h, u as g } from "./BED6h6YAwCf1HEQJ.mjs";
|
|
11
|
+
import { i as _ } from "./BokqKEpU6TFgfRs6.mjs";
|
|
12
|
+
import { a as v, i as y, n as b, t as x } from "./DRSCS6aLiYmPjUz1.mjs";
|
|
13
|
+
import { n as S, t as C } from "./BAbq4-I5f5oUiNaF.mjs";
|
|
14
|
+
import { Color as w, CommonUtils as T, ICellStyle as ee, ICondition as te, IConditionalFormat as E, IFill as D, IFont as O } from "@sheetxl/sdk";
|
|
15
|
+
import { COLOR_SCALE_PRESETS as ne, DATA_BAR_PRESETS as re, ICON_CATALOG as ie, IconSetGlyphs as k, NO_CELL_ICON as ae, STYLE_PRESETS as oe, defaultColorScale as se, defaultDataBar as ce, defaultIconSet as le, defaultIconStops as ue, getConditionalIconSet as de, iconSetSize as fe, resolveIconSetIcons as pe, useModelSync as A, withIconOverride as me } from "@sheetxl/react";
|
|
16
|
+
import { DynamicIcon as j, useTranslator as M } from "@sheetxl/utils-react";
|
|
17
|
+
import { forwardRef as he, memo as N, useCallback as ge, useMemo as P, useRef as _e } from "react";
|
|
18
|
+
import { ExhibitPopupIconButton as F, defaultCreatePopupPanel as I } from "@sheetxl/utils-mui";
|
|
19
|
+
import { Fragment as ve, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
20
|
+
import { Box as z, Checkbox as B, FormControl as ye, FormControlLabel as V, InputLabel as be, MenuItem as H, Paper as xe, Select as U, Tab as Se, Tabs as Ce, TextField as we, ToggleButton as W, ToggleButtonGroup as Te, Typography as G } from "@mui/material";
|
|
21
|
+
import { messageKey as K } from "@sheetxl/utils";
|
|
22
|
+
var q = N((e) => {
|
|
23
|
+
let { variant: t = "format", children: n, sx: r, ...i } = e;
|
|
24
|
+
return L(z, {
|
|
25
|
+
className: `sxl-cf-rule-section sxl-cf-rule-section-${t}`,
|
|
26
|
+
sx: {
|
|
27
|
+
display: "flex",
|
|
28
|
+
flexDirection: "column",
|
|
29
|
+
gap: 1,
|
|
30
|
+
p: 2,
|
|
31
|
+
border: 1,
|
|
32
|
+
borderColor: "divider",
|
|
33
|
+
borderRadius: 1,
|
|
34
|
+
...t === "config" ? { backgroundColor: "action.hover" } : null,
|
|
35
|
+
...r
|
|
36
|
+
},
|
|
37
|
+
...i,
|
|
38
|
+
children: n
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
q.displayName = "RuleSection";
|
|
42
|
+
var Ee = new w("transparent"), De = {
|
|
43
|
+
lightRedFillDarkRedText: K("conditionalFormat.preset.lightRedFillDarkRedText"),
|
|
44
|
+
yellowFillDarkYellowText: K("conditionalFormat.preset.yellowFillDarkYellowText"),
|
|
45
|
+
greenFillDarkGreenText: K("conditionalFormat.preset.greenFillDarkGreenText"),
|
|
46
|
+
lightRedFill: K("conditionalFormat.preset.lightRedFill"),
|
|
47
|
+
redText: K("conditionalFormat.preset.redText"),
|
|
48
|
+
redBorder: K("conditionalFormat.preset.redBorder")
|
|
49
|
+
}, Oe = (e) => e ? typeof e == "string" ? e : e.type === D.Type.None ? null : e.color ?? e.foreground ?? null : null, J = (e, t) => e === "auto" ? null : u(e, t), ke = N((r) => {
|
|
50
|
+
let { format: i, onFormatChange: a, readOnly: o, ...s } = r, c = M(), { workbook: l, schemeLookup: u, themeKey: d, darkMode: f, propsColorPanel: p } = g(), m = i?.font ?? null, _ = (m?.weight ?? 400) >= 600, v = m?.style === O.Style.Italic, y = !!m?.underline && m.underline !== O.UnderlineStyle.None, b = !!m?.strike && m.strike !== O.StrikeStyle.None, x = (e) => {
|
|
51
|
+
let t = { ...m };
|
|
52
|
+
for (let [n, r] of Object.entries(e)) r === void 0 ? delete t[n] : t[n] = r;
|
|
53
|
+
let n = { ...i };
|
|
54
|
+
Object.keys(t).length === 0 ? delete n.font : n.font = t, a(Object.keys(n).length === 0 ? null : n);
|
|
55
|
+
}, S = P(() => l?.getStyles().getNormal().getFont().getColor(), [l, d]), C = P(() => J(m?.color, l), [
|
|
56
|
+
m?.color,
|
|
57
|
+
l,
|
|
58
|
+
d
|
|
59
|
+
]), w = P(() => J(Oe(i?.fill), l), [
|
|
60
|
+
i?.fill,
|
|
61
|
+
l,
|
|
62
|
+
d
|
|
63
|
+
]), T = {
|
|
64
|
+
padding: "4px",
|
|
65
|
+
border: "none",
|
|
66
|
+
borderRadius: 1
|
|
67
|
+
};
|
|
68
|
+
return R(q, {
|
|
69
|
+
...s,
|
|
70
|
+
children: [R(z, {
|
|
71
|
+
sx: {
|
|
72
|
+
display: "flex",
|
|
73
|
+
alignItems: "flex-start",
|
|
74
|
+
gap: 1
|
|
75
|
+
},
|
|
76
|
+
children: [L(z, {
|
|
77
|
+
sx: {
|
|
78
|
+
flex: "1 1 auto",
|
|
79
|
+
minWidth: 0,
|
|
80
|
+
display: "flex",
|
|
81
|
+
gap: .5,
|
|
82
|
+
flexWrap: "wrap"
|
|
83
|
+
},
|
|
84
|
+
children: oe.map((e, t) => {
|
|
85
|
+
let n = J(Oe(e.style.fill), l), r = J(e.style.font?.color, l), i = e.style.borders ? J(Object.values(e.style.borders)[0]?.color, l) : null;
|
|
86
|
+
return L(h, {
|
|
87
|
+
sheet: !0,
|
|
88
|
+
title: c(De[e.key] ?? e.key),
|
|
89
|
+
disabled: o,
|
|
90
|
+
onClick: () => a(structuredClone(e.style)),
|
|
91
|
+
sx: {
|
|
92
|
+
backgroundColor: n?.toCSS("adaptive") ?? void 0,
|
|
93
|
+
color: r?.toCSS("adaptive") ?? void 0,
|
|
94
|
+
outline: i ? `1px solid ${i.toCSS("adaptive")}` : void 0,
|
|
95
|
+
outlineOffset: "-3px"
|
|
96
|
+
},
|
|
97
|
+
children: "Aa"
|
|
98
|
+
}, t);
|
|
99
|
+
})
|
|
100
|
+
}), L(h, {
|
|
101
|
+
title: c("conditionalFormat.clearStyle"),
|
|
102
|
+
disabled: o || !i,
|
|
103
|
+
onClick: () => a(null),
|
|
104
|
+
sx: {
|
|
105
|
+
color: "text.secondary",
|
|
106
|
+
"&:disabled": { opacity: .4 }
|
|
107
|
+
},
|
|
108
|
+
children: L(j, {
|
|
109
|
+
iconKey: "ClearFormats",
|
|
110
|
+
size: 16
|
|
111
|
+
})
|
|
112
|
+
})]
|
|
113
|
+
}), R(z, {
|
|
114
|
+
sx: {
|
|
115
|
+
display: "flex",
|
|
116
|
+
alignItems: "center",
|
|
117
|
+
gap: .25
|
|
118
|
+
},
|
|
119
|
+
children: [
|
|
120
|
+
L(W, {
|
|
121
|
+
value: "bold",
|
|
122
|
+
size: "small",
|
|
123
|
+
sx: T,
|
|
124
|
+
selected: _,
|
|
125
|
+
disabled: o,
|
|
126
|
+
onChange: () => x({ weight: _ ? void 0 : 700 }),
|
|
127
|
+
children: L(j, { iconKey: "TextBold" })
|
|
128
|
+
}),
|
|
129
|
+
L(W, {
|
|
130
|
+
value: "italic",
|
|
131
|
+
size: "small",
|
|
132
|
+
sx: T,
|
|
133
|
+
selected: v,
|
|
134
|
+
disabled: o,
|
|
135
|
+
onChange: () => x({ style: v ? void 0 : O.Style.Italic }),
|
|
136
|
+
children: L(j, { iconKey: "TextItalic" })
|
|
137
|
+
}),
|
|
138
|
+
L(W, {
|
|
139
|
+
value: "underline",
|
|
140
|
+
size: "small",
|
|
141
|
+
sx: T,
|
|
142
|
+
selected: y,
|
|
143
|
+
disabled: o,
|
|
144
|
+
onChange: () => x({ underline: y ? void 0 : O.UnderlineStyle.Single }),
|
|
145
|
+
children: L(j, { iconKey: "TextUnderline" })
|
|
146
|
+
}),
|
|
147
|
+
L(W, {
|
|
148
|
+
value: "strike",
|
|
149
|
+
size: "small",
|
|
150
|
+
sx: T,
|
|
151
|
+
selected: b,
|
|
152
|
+
disabled: o,
|
|
153
|
+
onChange: () => x({ strike: b ? void 0 : O.StrikeStyle.Single }),
|
|
154
|
+
children: L(j, { iconKey: "TextStrike" })
|
|
155
|
+
}),
|
|
156
|
+
l && L(n, {
|
|
157
|
+
tooltip: c("conditionalFormat.border"),
|
|
158
|
+
selectedBorder: i?.borders,
|
|
159
|
+
createBorder: (e) => l.getStyles().getNormal().createStyle({ borders: e }).getBorders(),
|
|
160
|
+
schemeLookup: u,
|
|
161
|
+
autoColor: S,
|
|
162
|
+
darkMode: f,
|
|
163
|
+
disabled: o,
|
|
164
|
+
onSelectBorder: (e) => ((e) => {
|
|
165
|
+
let t = { ...i };
|
|
166
|
+
e && Object.keys(e).length !== 0 ? t.borders = e : delete t.borders, a(Object.keys(t).length === 0 ? null : t);
|
|
167
|
+
})(e)
|
|
168
|
+
}),
|
|
169
|
+
L(t, {
|
|
170
|
+
icon: "fill.colored",
|
|
171
|
+
tooltip: c("conditionalFormat.fillColor"),
|
|
172
|
+
selectedColor: w,
|
|
173
|
+
disabled: o,
|
|
174
|
+
onSelectColor: (e) => ((e) => {
|
|
175
|
+
let t = { ...i };
|
|
176
|
+
e ? t.fill = {
|
|
177
|
+
type: D.Type.Solid,
|
|
178
|
+
color: e.toString()
|
|
179
|
+
} : delete t.fill, a(Object.keys(t).length === 0 ? null : t);
|
|
180
|
+
})(e),
|
|
181
|
+
darkMode: f,
|
|
182
|
+
propsPanel: {
|
|
183
|
+
disableAlpha: !0,
|
|
184
|
+
autoColor: Ee,
|
|
185
|
+
autoColorLabelKey: K("color.noFill"),
|
|
186
|
+
autoColorPosition: e.End,
|
|
187
|
+
...p
|
|
188
|
+
}
|
|
189
|
+
}),
|
|
190
|
+
L(t, {
|
|
191
|
+
icon: "text.colored",
|
|
192
|
+
tooltip: c("conditionalFormat.fontColor"),
|
|
193
|
+
selectedColor: C,
|
|
194
|
+
disabled: o,
|
|
195
|
+
onSelectColor: (e) => x({ color: e ? e.toString() : void 0 }),
|
|
196
|
+
darkMode: f,
|
|
197
|
+
propsPanel: {
|
|
198
|
+
disableAlpha: !0,
|
|
199
|
+
autoColor: S,
|
|
200
|
+
...p
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
})]
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
ke.displayName = "ConditionalFormatStylePicker";
|
|
208
|
+
var Ae = {
|
|
209
|
+
[E.ColorStopType.AutoMin]: K("conditionalFormat.stopType.autoMin"),
|
|
210
|
+
[E.ColorStopType.AutoMax]: K("conditionalFormat.stopType.autoMax"),
|
|
211
|
+
[E.ColorStopType.Min]: K("conditionalFormat.stopType.min"),
|
|
212
|
+
[E.ColorStopType.Max]: K("conditionalFormat.stopType.max"),
|
|
213
|
+
[E.ColorStopType.Num]: K("conditionalFormat.stopType.num"),
|
|
214
|
+
[E.ColorStopType.Percent]: K("conditionalFormat.stopType.percent"),
|
|
215
|
+
[E.ColorStopType.Percentile]: K("conditionalFormat.stopType.percentile"),
|
|
216
|
+
[E.ColorStopType.Formula]: K("conditionalFormat.stopType.formula")
|
|
217
|
+
}, je = /* @__PURE__ */ new Set([
|
|
218
|
+
E.ColorStopType.AutoMin,
|
|
219
|
+
E.ColorStopType.AutoMax,
|
|
220
|
+
E.ColorStopType.Min,
|
|
221
|
+
E.ColorStopType.Max
|
|
222
|
+
]), Y = N((e) => {
|
|
223
|
+
let { label: n, stop: r, onStopChange: i, allowedTypes: a, showColor: s = !1, leading: c, showExclusive: l = !1, readOnly: u, ...d } = e, f = M(), { darkMode: p, toColor: m, propsColorPanel: h } = g(), _ = v(), y = r.type ?? E.ColorStopType.Num, b = !je.has(y), x = u || !b, S = y === E.ColorStopType.Formula, C = r.value?.isIFormula ? r.value : null, w = r.color, T = s ? m(w) : null;
|
|
224
|
+
return R(z, {
|
|
225
|
+
sx: {
|
|
226
|
+
display: "flex",
|
|
227
|
+
alignItems: "center",
|
|
228
|
+
gap: .5
|
|
229
|
+
},
|
|
230
|
+
...d,
|
|
231
|
+
children: [
|
|
232
|
+
n !== void 0 && L(G, {
|
|
233
|
+
variant: "caption",
|
|
234
|
+
sx: {
|
|
235
|
+
color: "text.secondary",
|
|
236
|
+
flex: "0 0 62px",
|
|
237
|
+
minWidth: 0,
|
|
238
|
+
overflow: "hidden",
|
|
239
|
+
textOverflow: "ellipsis"
|
|
240
|
+
},
|
|
241
|
+
children: n
|
|
242
|
+
}),
|
|
243
|
+
c,
|
|
244
|
+
s && L(t, {
|
|
245
|
+
tooltip: f("conditionalFormat.stopColor"),
|
|
246
|
+
selectedColor: T,
|
|
247
|
+
disabled: u,
|
|
248
|
+
onSelectColor: (e) => {
|
|
249
|
+
e && i({
|
|
250
|
+
...r,
|
|
251
|
+
color: e.toString()
|
|
252
|
+
});
|
|
253
|
+
},
|
|
254
|
+
darkMode: p,
|
|
255
|
+
propsPanel: {
|
|
256
|
+
disableAlpha: !0,
|
|
257
|
+
...h
|
|
258
|
+
}
|
|
259
|
+
}),
|
|
260
|
+
l && R(U, {
|
|
261
|
+
size: "small",
|
|
262
|
+
value: r.exclusive ? "gt" : "gte",
|
|
263
|
+
disabled: u,
|
|
264
|
+
onChange: (e) => {
|
|
265
|
+
let t = { ...r };
|
|
266
|
+
e.target.value === "gt" ? t.exclusive = !0 : delete t.exclusive, i(t);
|
|
267
|
+
},
|
|
268
|
+
sx: {
|
|
269
|
+
flex: "0 0 auto",
|
|
270
|
+
backgroundColor: "background.paper"
|
|
271
|
+
},
|
|
272
|
+
children: [L(H, {
|
|
273
|
+
value: "gte",
|
|
274
|
+
children: ">="
|
|
275
|
+
}), L(H, {
|
|
276
|
+
value: "gt",
|
|
277
|
+
children: ">"
|
|
278
|
+
})]
|
|
279
|
+
}),
|
|
280
|
+
L(U, {
|
|
281
|
+
size: "small",
|
|
282
|
+
value: y,
|
|
283
|
+
disabled: u,
|
|
284
|
+
onChange: (e) => ((e) => {
|
|
285
|
+
let t = {
|
|
286
|
+
...r,
|
|
287
|
+
type: e
|
|
288
|
+
};
|
|
289
|
+
if (je.has(e)) delete t.value;
|
|
290
|
+
else if (t.value === void 0) t.value = e === E.ColorStopType.Formula ? "" : 0;
|
|
291
|
+
else if (e !== E.ColorStopType.Formula && typeof t.value != "number") {
|
|
292
|
+
let e = typeof t.value == "string" ? Number(t.value) : NaN;
|
|
293
|
+
t.value = Number.isFinite(e) ? e : 0;
|
|
294
|
+
}
|
|
295
|
+
i(t);
|
|
296
|
+
})(e.target.value),
|
|
297
|
+
sx: {
|
|
298
|
+
flex: "1 1 40%",
|
|
299
|
+
minWidth: 0,
|
|
300
|
+
backgroundColor: "background.paper"
|
|
301
|
+
},
|
|
302
|
+
children: a.map((e) => L(H, {
|
|
303
|
+
value: e,
|
|
304
|
+
children: f(Ae[e])
|
|
305
|
+
}, e))
|
|
306
|
+
}),
|
|
307
|
+
S ? L(o, {
|
|
308
|
+
size: "small",
|
|
309
|
+
home: _.home,
|
|
310
|
+
value: C ? _.display(C) : `${r.value ?? ""}`,
|
|
311
|
+
onChangeText: (e) => {
|
|
312
|
+
i({
|
|
313
|
+
...r,
|
|
314
|
+
value: e.trim().length > 0 ? _.compile(e) : e
|
|
315
|
+
});
|
|
316
|
+
},
|
|
317
|
+
placeholder: f("conditionalFormat.enterFormula"),
|
|
318
|
+
disabled: x,
|
|
319
|
+
equals: "bare",
|
|
320
|
+
pickAs: "absolute",
|
|
321
|
+
label: null,
|
|
322
|
+
showError: !1,
|
|
323
|
+
helperText: null,
|
|
324
|
+
sx: {
|
|
325
|
+
flex: "1 1 30%",
|
|
326
|
+
minWidth: 0,
|
|
327
|
+
"& .MuiInputBase-root": { backgroundColor: x ? "action.disabledBackground" : "background.paper" }
|
|
328
|
+
}
|
|
329
|
+
}) : L(we, {
|
|
330
|
+
size: "small",
|
|
331
|
+
type: "number",
|
|
332
|
+
placeholder: b ? void 0 : f("conditionalFormat.stopFromData"),
|
|
333
|
+
value: b ? `${r.value ?? ""}` : "",
|
|
334
|
+
disabled: x,
|
|
335
|
+
onChange: (e) => {
|
|
336
|
+
let t = e.target.value;
|
|
337
|
+
i({
|
|
338
|
+
...r,
|
|
339
|
+
value: t === "" ? 0 : Number(t)
|
|
340
|
+
});
|
|
341
|
+
},
|
|
342
|
+
sx: {
|
|
343
|
+
flex: "1 1 30%",
|
|
344
|
+
minWidth: 0,
|
|
345
|
+
cursor: x ? "not-allowed" : void 0
|
|
346
|
+
},
|
|
347
|
+
slotProps: { input: { sx: {
|
|
348
|
+
backgroundColor: x ? "action.disabledBackground" : "background.paper",
|
|
349
|
+
cursor: x ? "not-allowed" : void 0
|
|
350
|
+
} } }
|
|
351
|
+
})
|
|
352
|
+
]
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
Y.displayName = "ScaleStopRow";
|
|
356
|
+
var Me = [
|
|
357
|
+
E.ColorStopType.Min,
|
|
358
|
+
E.ColorStopType.Max,
|
|
359
|
+
E.ColorStopType.Num,
|
|
360
|
+
E.ColorStopType.Percent,
|
|
361
|
+
E.ColorStopType.Percentile,
|
|
362
|
+
E.ColorStopType.Formula
|
|
363
|
+
], Ne = N((e) => {
|
|
364
|
+
let { scale: t, onScaleChange: n, readOnly: r, ...i } = e, a = M(), { workbook: o, toColor: s } = g(), c = t.stops ?? [], l = c.length === 2 ? [K("conditionalFormat.stop.minimum"), K("conditionalFormat.stop.maximum")] : [
|
|
365
|
+
K("conditionalFormat.stop.minimum"),
|
|
366
|
+
K("conditionalFormat.stop.midpoint"),
|
|
367
|
+
K("conditionalFormat.stop.maximum")
|
|
368
|
+
];
|
|
369
|
+
return R(z, {
|
|
370
|
+
sx: {
|
|
371
|
+
display: "flex",
|
|
372
|
+
flexDirection: "column",
|
|
373
|
+
gap: 1
|
|
374
|
+
},
|
|
375
|
+
...i,
|
|
376
|
+
children: [L(q, { children: R(z, {
|
|
377
|
+
sx: {
|
|
378
|
+
display: "flex",
|
|
379
|
+
alignItems: "flex-start",
|
|
380
|
+
gap: 1
|
|
381
|
+
},
|
|
382
|
+
children: [L(z, {
|
|
383
|
+
sx: {
|
|
384
|
+
flex: "1 1 auto",
|
|
385
|
+
minWidth: 0,
|
|
386
|
+
display: "flex",
|
|
387
|
+
gap: .5,
|
|
388
|
+
flexWrap: "wrap"
|
|
389
|
+
},
|
|
390
|
+
children: ne.filter((e) => e.stops.length === (c.length === 2 ? 2 : 3)).map((e, t) => L(h, {
|
|
391
|
+
sheet: !0,
|
|
392
|
+
disabled: r,
|
|
393
|
+
onClick: () => n(structuredClone(e)),
|
|
394
|
+
children: L(f, { rows: m(e.stops ?? [], p, o) })
|
|
395
|
+
}, t))
|
|
396
|
+
}), R(Te, {
|
|
397
|
+
exclusive: !0,
|
|
398
|
+
size: "small",
|
|
399
|
+
value: c.length === 2 ? 2 : 3,
|
|
400
|
+
disabled: r,
|
|
401
|
+
onChange: (e, r) => {
|
|
402
|
+
r && ((e) => {
|
|
403
|
+
if (e === c.length || e !== 2 && e !== 3) return;
|
|
404
|
+
let r = c.slice();
|
|
405
|
+
if (e === 3) {
|
|
406
|
+
let e = "#FFEB84", t = s(c[0]?.color ?? e)?.toRGBA(), n = s(c[c.length - 1]?.color ?? e)?.toRGBA();
|
|
407
|
+
if (t && n) {
|
|
408
|
+
let r = (e) => Math.round(e).toString(16).padStart(2, "0").toUpperCase();
|
|
409
|
+
e = `#${r((t.red + n.red) / 2)}${r((t.green + n.green) / 2)}${r((t.blue + n.blue) / 2)}`;
|
|
410
|
+
}
|
|
411
|
+
r.splice(1, 0, {
|
|
412
|
+
type: E.ColorStopType.Percentile,
|
|
413
|
+
value: 50,
|
|
414
|
+
color: e
|
|
415
|
+
});
|
|
416
|
+
} else r.splice(1, r.length - 2);
|
|
417
|
+
n({
|
|
418
|
+
...t,
|
|
419
|
+
stops: r
|
|
420
|
+
});
|
|
421
|
+
})(r);
|
|
422
|
+
},
|
|
423
|
+
sx: { flex: "0 0 auto" },
|
|
424
|
+
children: [L(W, {
|
|
425
|
+
value: 2,
|
|
426
|
+
sx: {
|
|
427
|
+
textTransform: "none",
|
|
428
|
+
pt: .25,
|
|
429
|
+
pb: .25
|
|
430
|
+
},
|
|
431
|
+
children: a("conditionalFormat.twoColor")
|
|
432
|
+
}), L(W, {
|
|
433
|
+
value: 3,
|
|
434
|
+
sx: {
|
|
435
|
+
textTransform: "none",
|
|
436
|
+
pt: .25,
|
|
437
|
+
pb: .25
|
|
438
|
+
},
|
|
439
|
+
children: a("conditionalFormat.threeColor")
|
|
440
|
+
})]
|
|
441
|
+
})]
|
|
442
|
+
}) }), L(q, {
|
|
443
|
+
variant: "config",
|
|
444
|
+
children: c.map((e, i) => L(Y, {
|
|
445
|
+
label: a(l[Math.min(i, l.length - 1)]),
|
|
446
|
+
stop: e,
|
|
447
|
+
allowedTypes: Me,
|
|
448
|
+
showColor: !0,
|
|
449
|
+
readOnly: r,
|
|
450
|
+
onStopChange: (e) => {
|
|
451
|
+
let r = c.slice();
|
|
452
|
+
r[i] = e, n({
|
|
453
|
+
...t,
|
|
454
|
+
stops: r
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
}, i))
|
|
458
|
+
})]
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
Ne.displayName = "ColorScaleRulePanel";
|
|
462
|
+
var Pe = [
|
|
463
|
+
E.ColorStopType.AutoMin,
|
|
464
|
+
E.ColorStopType.Min,
|
|
465
|
+
E.ColorStopType.Num,
|
|
466
|
+
E.ColorStopType.Percent,
|
|
467
|
+
E.ColorStopType.Percentile,
|
|
468
|
+
E.ColorStopType.Formula
|
|
469
|
+
], Fe = [
|
|
470
|
+
E.ColorStopType.AutoMax,
|
|
471
|
+
E.ColorStopType.Max,
|
|
472
|
+
E.ColorStopType.Num,
|
|
473
|
+
E.ColorStopType.Percent,
|
|
474
|
+
E.ColorStopType.Percentile,
|
|
475
|
+
E.ColorStopType.Formula
|
|
476
|
+
], X = "__auto__", Ie = N((e) => {
|
|
477
|
+
let { scale: n, onScaleChange: r, readOnly: i, ...a } = e, o = M(), { darkMode: s, toColor: l, propsColorPanel: u } = g(), d = n.stops ?? [], p = l(n.color), m = l(n.negativeFillColor), _ = l(n.borderColor), v = l(n.negativeBorderColor), y = n.gradient ?? !1, b = (e) => {
|
|
478
|
+
let t = { ...n };
|
|
479
|
+
for (let [n, r] of Object.entries(e)) r === void 0 ? delete t[n] : t[n] = r;
|
|
480
|
+
r(t);
|
|
481
|
+
}, x = { backgroundColor: "background.paper" };
|
|
482
|
+
return R(z, {
|
|
483
|
+
sx: {
|
|
484
|
+
display: "flex",
|
|
485
|
+
flexDirection: "column",
|
|
486
|
+
gap: 1
|
|
487
|
+
},
|
|
488
|
+
...a,
|
|
489
|
+
children: [R(q, { children: [
|
|
490
|
+
R(z, {
|
|
491
|
+
sx: {
|
|
492
|
+
display: "flex",
|
|
493
|
+
alignItems: "flex-start",
|
|
494
|
+
gap: 1
|
|
495
|
+
},
|
|
496
|
+
children: [L(z, {
|
|
497
|
+
sx: {
|
|
498
|
+
flex: "1 1 auto",
|
|
499
|
+
minWidth: 0,
|
|
500
|
+
display: "flex",
|
|
501
|
+
gap: .5,
|
|
502
|
+
flexWrap: "wrap"
|
|
503
|
+
},
|
|
504
|
+
children: re.filter((e) => (e.gradient ?? !1) === y).map((e, t) => L(h, {
|
|
505
|
+
sheet: !0,
|
|
506
|
+
disabled: i,
|
|
507
|
+
onClick: () => b({
|
|
508
|
+
color: e.color,
|
|
509
|
+
gradient: e.gradient,
|
|
510
|
+
borderColor: e.borderColor
|
|
511
|
+
}),
|
|
512
|
+
children: L(f, { rows: c(e, l(e.color)?.toCSS("adaptive") ?? "var(--sxl-color-primary, rgb(33, 115, 70))") })
|
|
513
|
+
}, t))
|
|
514
|
+
}), R(Te, {
|
|
515
|
+
exclusive: !0,
|
|
516
|
+
size: "small",
|
|
517
|
+
value: y,
|
|
518
|
+
disabled: i,
|
|
519
|
+
onChange: (e, t) => {
|
|
520
|
+
t !== null && b({ gradient: !!t || void 0 });
|
|
521
|
+
},
|
|
522
|
+
sx: { flex: "0 0 auto" },
|
|
523
|
+
children: [L(W, {
|
|
524
|
+
value: !1,
|
|
525
|
+
sx: {
|
|
526
|
+
textTransform: "none",
|
|
527
|
+
pt: .25,
|
|
528
|
+
pb: .25
|
|
529
|
+
},
|
|
530
|
+
children: o("conditionalFormat.solidFill")
|
|
531
|
+
}), L(W, {
|
|
532
|
+
value: !0,
|
|
533
|
+
sx: {
|
|
534
|
+
textTransform: "none",
|
|
535
|
+
pt: .25,
|
|
536
|
+
pb: .25
|
|
537
|
+
},
|
|
538
|
+
children: o("conditionalFormat.gradientFill")
|
|
539
|
+
})]
|
|
540
|
+
})]
|
|
541
|
+
}),
|
|
542
|
+
L(V, {
|
|
543
|
+
control: L(B, {
|
|
544
|
+
size: "small",
|
|
545
|
+
checked: !1 === n.showValue,
|
|
546
|
+
disabled: i,
|
|
547
|
+
onChange: (e) => b({ showValue: !e.target.checked && void 0 })
|
|
548
|
+
}),
|
|
549
|
+
label: L(G, {
|
|
550
|
+
variant: "body2",
|
|
551
|
+
children: o("conditionalFormat.showBarsOnly")
|
|
552
|
+
})
|
|
553
|
+
}),
|
|
554
|
+
R(z, {
|
|
555
|
+
sx: {
|
|
556
|
+
display: "flex",
|
|
557
|
+
alignItems: "center",
|
|
558
|
+
gap: .5
|
|
559
|
+
},
|
|
560
|
+
children: [
|
|
561
|
+
L(G, {
|
|
562
|
+
variant: "caption",
|
|
563
|
+
sx: {
|
|
564
|
+
color: "text.secondary",
|
|
565
|
+
flex: "0 0 62px"
|
|
566
|
+
},
|
|
567
|
+
children: o("conditionalFormat.bar")
|
|
568
|
+
}),
|
|
569
|
+
L(t, {
|
|
570
|
+
icon: "fill.colored",
|
|
571
|
+
tooltip: o("conditionalFormat.barColor"),
|
|
572
|
+
selectedColor: p,
|
|
573
|
+
disabled: i,
|
|
574
|
+
onSelectColor: (e) => b({ color: e ? e.toString() : void 0 }),
|
|
575
|
+
darkMode: s,
|
|
576
|
+
propsPanel: {
|
|
577
|
+
disableAlpha: !0,
|
|
578
|
+
...u
|
|
579
|
+
}
|
|
580
|
+
}),
|
|
581
|
+
L(t, {
|
|
582
|
+
icon: "stroke.colored",
|
|
583
|
+
tooltip: o("conditionalFormat.barBorderColor"),
|
|
584
|
+
selectedColor: _,
|
|
585
|
+
disabled: i,
|
|
586
|
+
onSelectColor: (e) => b({ borderColor: e ? e.toString() : void 0 }),
|
|
587
|
+
darkMode: s,
|
|
588
|
+
propsPanel: {
|
|
589
|
+
disableAlpha: !0,
|
|
590
|
+
...u
|
|
591
|
+
}
|
|
592
|
+
})
|
|
593
|
+
]
|
|
594
|
+
}),
|
|
595
|
+
R(z, {
|
|
596
|
+
sx: {
|
|
597
|
+
display: "flex",
|
|
598
|
+
alignItems: "center",
|
|
599
|
+
gap: .5
|
|
600
|
+
},
|
|
601
|
+
children: [
|
|
602
|
+
L(G, {
|
|
603
|
+
variant: "caption",
|
|
604
|
+
sx: {
|
|
605
|
+
color: "text.secondary",
|
|
606
|
+
flex: "0 0 62px"
|
|
607
|
+
},
|
|
608
|
+
children: o("conditionalFormat.negative")
|
|
609
|
+
}),
|
|
610
|
+
L(t, {
|
|
611
|
+
icon: "fill.colored",
|
|
612
|
+
tooltip: o("conditionalFormat.negativeColor"),
|
|
613
|
+
selectedColor: m ?? p,
|
|
614
|
+
disabled: i,
|
|
615
|
+
onSelectColor: (e) => b({ negativeFillColor: e ? e.toString() : void 0 }),
|
|
616
|
+
darkMode: s,
|
|
617
|
+
propsPanel: {
|
|
618
|
+
disableAlpha: !0,
|
|
619
|
+
...u
|
|
620
|
+
}
|
|
621
|
+
}),
|
|
622
|
+
L(t, {
|
|
623
|
+
icon: "stroke.colored",
|
|
624
|
+
tooltip: o("conditionalFormat.negativeBorderColor"),
|
|
625
|
+
selectedColor: v ?? _,
|
|
626
|
+
disabled: i,
|
|
627
|
+
onSelectColor: (e) => b({ negativeBorderColor: e ? e.toString() : void 0 }),
|
|
628
|
+
darkMode: s,
|
|
629
|
+
propsPanel: {
|
|
630
|
+
disableAlpha: !0,
|
|
631
|
+
...u
|
|
632
|
+
}
|
|
633
|
+
}),
|
|
634
|
+
L(h, {
|
|
635
|
+
title: o("conditionalFormat.sameAsPositive"),
|
|
636
|
+
disabled: i || !n.negativeFillColor && !n.negativeBorderColor,
|
|
637
|
+
onClick: () => b({
|
|
638
|
+
negativeFillColor: void 0,
|
|
639
|
+
negativeBorderColor: void 0
|
|
640
|
+
}),
|
|
641
|
+
sx: {
|
|
642
|
+
color: "text.secondary",
|
|
643
|
+
"&:disabled": { opacity: .4 }
|
|
644
|
+
},
|
|
645
|
+
children: L(j, {
|
|
646
|
+
iconKey: "ClearFormats",
|
|
647
|
+
size: 16
|
|
648
|
+
})
|
|
649
|
+
})
|
|
650
|
+
]
|
|
651
|
+
}),
|
|
652
|
+
R(z, {
|
|
653
|
+
sx: {
|
|
654
|
+
display: "flex",
|
|
655
|
+
gap: 1,
|
|
656
|
+
mt: .5
|
|
657
|
+
},
|
|
658
|
+
children: [R(ye, {
|
|
659
|
+
size: "small",
|
|
660
|
+
sx: {
|
|
661
|
+
flex: 1,
|
|
662
|
+
minWidth: 0
|
|
663
|
+
},
|
|
664
|
+
children: [L(be, { children: o("conditionalFormat.axis") }), R(U, {
|
|
665
|
+
label: o("conditionalFormat.axis"),
|
|
666
|
+
value: n.axisPosition ?? X,
|
|
667
|
+
disabled: i,
|
|
668
|
+
sx: x,
|
|
669
|
+
onChange: (e) => {
|
|
670
|
+
let t = e.target.value;
|
|
671
|
+
b({ axisPosition: t === X ? void 0 : t });
|
|
672
|
+
},
|
|
673
|
+
children: [
|
|
674
|
+
L(H, {
|
|
675
|
+
value: X,
|
|
676
|
+
children: o("conditionalFormat.automatic")
|
|
677
|
+
}),
|
|
678
|
+
L(H, {
|
|
679
|
+
value: "middle",
|
|
680
|
+
children: o("conditionalFormat.axisMiddle")
|
|
681
|
+
}),
|
|
682
|
+
L(H, {
|
|
683
|
+
value: "none",
|
|
684
|
+
children: o("conditionalFormat.axisNone")
|
|
685
|
+
})
|
|
686
|
+
]
|
|
687
|
+
})]
|
|
688
|
+
}), R(ye, {
|
|
689
|
+
size: "small",
|
|
690
|
+
sx: {
|
|
691
|
+
flex: 1,
|
|
692
|
+
minWidth: 0
|
|
693
|
+
},
|
|
694
|
+
children: [L(be, { children: o("conditionalFormat.direction") }), R(U, {
|
|
695
|
+
label: o("conditionalFormat.direction"),
|
|
696
|
+
value: n.direction ?? X,
|
|
697
|
+
disabled: i,
|
|
698
|
+
sx: x,
|
|
699
|
+
onChange: (e) => {
|
|
700
|
+
let t = e.target.value;
|
|
701
|
+
b({ direction: t === X ? void 0 : t });
|
|
702
|
+
},
|
|
703
|
+
children: [
|
|
704
|
+
L(H, {
|
|
705
|
+
value: X,
|
|
706
|
+
children: o("conditionalFormat.automatic")
|
|
707
|
+
}),
|
|
708
|
+
L(H, {
|
|
709
|
+
value: "leftToRight",
|
|
710
|
+
children: o("conditionalFormat.leftToRight")
|
|
711
|
+
}),
|
|
712
|
+
L(H, {
|
|
713
|
+
value: "rightToLeft",
|
|
714
|
+
children: o("conditionalFormat.rightToLeft")
|
|
715
|
+
})
|
|
716
|
+
]
|
|
717
|
+
})]
|
|
718
|
+
})]
|
|
719
|
+
})
|
|
720
|
+
] }), R(q, {
|
|
721
|
+
variant: "config",
|
|
722
|
+
children: [L(Y, {
|
|
723
|
+
label: o("conditionalFormat.stop.minimum"),
|
|
724
|
+
stop: d[0] ?? { type: E.ColorStopType.AutoMin },
|
|
725
|
+
allowedTypes: Pe,
|
|
726
|
+
readOnly: i,
|
|
727
|
+
onStopChange: (e) => {
|
|
728
|
+
let t = d.slice();
|
|
729
|
+
t[0] = e, b({ stops: t });
|
|
730
|
+
}
|
|
731
|
+
}), L(Y, {
|
|
732
|
+
label: o("conditionalFormat.stop.maximum"),
|
|
733
|
+
stop: d[1] ?? { type: E.ColorStopType.AutoMax },
|
|
734
|
+
allowedTypes: Fe,
|
|
735
|
+
readOnly: i,
|
|
736
|
+
onStopChange: (e) => {
|
|
737
|
+
let t = d.slice();
|
|
738
|
+
for (; t.length < 2;) t.push({ type: E.ColorStopType.AutoMax });
|
|
739
|
+
t[1] = e, b({ stops: t });
|
|
740
|
+
}
|
|
741
|
+
})]
|
|
742
|
+
})]
|
|
743
|
+
});
|
|
744
|
+
});
|
|
745
|
+
Ie.displayName = "DataBarRulePanel";
|
|
746
|
+
var Le = K("conditionalFormat.noCellIcon"), Re = K("conditionalFormat.cellIcon"), ze = {
|
|
747
|
+
borderColor: "primary.main",
|
|
748
|
+
boxShadow: (e) => `inset 0 0 0 1px ${e.palette.primary.main}`
|
|
749
|
+
}, Be = {
|
|
750
|
+
width: "28px",
|
|
751
|
+
height: "26px"
|
|
752
|
+
}, Ve = N((e) => {
|
|
753
|
+
let { icon: t, onPick: n } = e, i = M();
|
|
754
|
+
return R(z, {
|
|
755
|
+
sx: {
|
|
756
|
+
display: "flex",
|
|
757
|
+
flexDirection: "column",
|
|
758
|
+
gap: "4px",
|
|
759
|
+
padding: "6px 8px"
|
|
760
|
+
},
|
|
761
|
+
children: [L(h, {
|
|
762
|
+
sheet: !0,
|
|
763
|
+
title: i(Le),
|
|
764
|
+
"aria-pressed": t === null,
|
|
765
|
+
sx: {
|
|
766
|
+
...Be,
|
|
767
|
+
...t === null ? ze : null
|
|
768
|
+
},
|
|
769
|
+
onClick: () => {
|
|
770
|
+
n({ ...ae });
|
|
771
|
+
},
|
|
772
|
+
children: L(k, {
|
|
773
|
+
icons: [null],
|
|
774
|
+
size: 16
|
|
775
|
+
})
|
|
776
|
+
}), L(z, {
|
|
777
|
+
sx: {
|
|
778
|
+
display: "grid",
|
|
779
|
+
gridTemplateColumns: "repeat(8, auto)",
|
|
780
|
+
justifyContent: "start",
|
|
781
|
+
gap: "3px"
|
|
782
|
+
},
|
|
783
|
+
children: ie.map((e) => {
|
|
784
|
+
let a = (o = t, s = e.spec, !!o && o.iconKey === s.iconKey && o.color === s.color);
|
|
785
|
+
var o, s;
|
|
786
|
+
return L(h, {
|
|
787
|
+
sheet: !0,
|
|
788
|
+
title: r(i, e.spec),
|
|
789
|
+
"aria-pressed": a,
|
|
790
|
+
sx: {
|
|
791
|
+
...Be,
|
|
792
|
+
...a ? ze : null
|
|
793
|
+
},
|
|
794
|
+
onClick: () => {
|
|
795
|
+
n({
|
|
796
|
+
set: e.set,
|
|
797
|
+
id: e.id
|
|
798
|
+
});
|
|
799
|
+
},
|
|
800
|
+
children: L(k, {
|
|
801
|
+
icons: [e.spec],
|
|
802
|
+
size: 16
|
|
803
|
+
})
|
|
804
|
+
}, `${e.set}:${e.id}`);
|
|
805
|
+
})
|
|
806
|
+
})]
|
|
807
|
+
});
|
|
808
|
+
});
|
|
809
|
+
Ve.displayName = "IconCatalogPanel";
|
|
810
|
+
var Z = N(he((e, t) => {
|
|
811
|
+
let { icon: n, onPick: r, tooltip: i, ...a } = e, o = M(), s = ge((e) => {
|
|
812
|
+
let { closeFloat: t } = e, i = L(Ve, {
|
|
813
|
+
icon: n,
|
|
814
|
+
onPick: (e) => {
|
|
815
|
+
t?.(), r(e);
|
|
816
|
+
}
|
|
817
|
+
});
|
|
818
|
+
return I({
|
|
819
|
+
...e,
|
|
820
|
+
children: i
|
|
821
|
+
});
|
|
822
|
+
}, [n, r]);
|
|
823
|
+
return L(F, {
|
|
824
|
+
ref: t,
|
|
825
|
+
createPopupPanel: s,
|
|
826
|
+
tooltip: i ?? o(Re),
|
|
827
|
+
icon: L(k, {
|
|
828
|
+
icons: [n],
|
|
829
|
+
size: 16
|
|
830
|
+
}),
|
|
831
|
+
outlined: !0,
|
|
832
|
+
...a
|
|
833
|
+
});
|
|
834
|
+
}));
|
|
835
|
+
Z.displayName = "IconPickerPopupButton";
|
|
836
|
+
var He = [
|
|
837
|
+
E.ColorStopType.Percent,
|
|
838
|
+
E.ColorStopType.Num,
|
|
839
|
+
E.ColorStopType.Percentile,
|
|
840
|
+
E.ColorStopType.Formula
|
|
841
|
+
], Ue = N((e) => {
|
|
842
|
+
let { scale: t, onScaleChange: n, readOnly: r, ...o } = e, s = M(), c = t.iconSet ?? ee.IconSet.TrafficLights3, l = de(c).length === 0, u = t.stops ?? [], d = u.length, f = pe(t), p = (e) => {
|
|
843
|
+
let r = { ...t };
|
|
844
|
+
for (let [t, n] of Object.entries(e)) n === void 0 ? delete r[t] : r[t] = n;
|
|
845
|
+
n(r);
|
|
846
|
+
}, m = ge((e) => {
|
|
847
|
+
let { closeFloat: t } = e, n = L(i, {
|
|
848
|
+
groups: a,
|
|
849
|
+
disabled: r,
|
|
850
|
+
onPick: (e) => {
|
|
851
|
+
t?.(), e.type === E.ScaleType.IconSet && e.iconSet && ((e) => {
|
|
852
|
+
if (e === c) return;
|
|
853
|
+
let t = fe(e), n = u;
|
|
854
|
+
t !== u.length && (n = ue(t)), p({
|
|
855
|
+
iconSet: e,
|
|
856
|
+
stops: n,
|
|
857
|
+
icon: void 0
|
|
858
|
+
});
|
|
859
|
+
})(e.iconSet);
|
|
860
|
+
}
|
|
861
|
+
});
|
|
862
|
+
return I({
|
|
863
|
+
...e,
|
|
864
|
+
children: n
|
|
865
|
+
});
|
|
866
|
+
}, [r, t]), h = T.camelToPrettyCase(c);
|
|
867
|
+
return R(z, {
|
|
868
|
+
sx: {
|
|
869
|
+
display: "flex",
|
|
870
|
+
flexDirection: "column",
|
|
871
|
+
gap: 1
|
|
872
|
+
},
|
|
873
|
+
...o,
|
|
874
|
+
children: [R(q, { children: [
|
|
875
|
+
L(z, {
|
|
876
|
+
sx: {
|
|
877
|
+
display: "flex",
|
|
878
|
+
alignItems: "center",
|
|
879
|
+
gap: 1
|
|
880
|
+
},
|
|
881
|
+
children: L(F, {
|
|
882
|
+
outlined: !0,
|
|
883
|
+
disabled: r,
|
|
884
|
+
label: h,
|
|
885
|
+
tooltip: h,
|
|
886
|
+
icon: L(z, {
|
|
887
|
+
sx: {
|
|
888
|
+
width: "82px",
|
|
889
|
+
display: "flex",
|
|
890
|
+
justifyContent: "center"
|
|
891
|
+
},
|
|
892
|
+
children: l ? L(G, {
|
|
893
|
+
variant: "caption",
|
|
894
|
+
noWrap: !0,
|
|
895
|
+
children: h
|
|
896
|
+
}) : L(k, {
|
|
897
|
+
icons: de(c),
|
|
898
|
+
order: "descending",
|
|
899
|
+
size: 14,
|
|
900
|
+
gap: 3
|
|
901
|
+
})
|
|
902
|
+
}),
|
|
903
|
+
createPopupPanel: m
|
|
904
|
+
})
|
|
905
|
+
}),
|
|
906
|
+
l && L(G, {
|
|
907
|
+
variant: "caption",
|
|
908
|
+
sx: { color: "text.secondary" },
|
|
909
|
+
children: s("conditionalFormat.adoptedIconSet")
|
|
910
|
+
}),
|
|
911
|
+
R(z, {
|
|
912
|
+
sx: {
|
|
913
|
+
display: "flex",
|
|
914
|
+
gap: 1
|
|
915
|
+
},
|
|
916
|
+
children: [L(V, {
|
|
917
|
+
control: L(B, {
|
|
918
|
+
size: "small",
|
|
919
|
+
checked: !1 === t.showValue,
|
|
920
|
+
disabled: r,
|
|
921
|
+
onChange: (e) => p({ showValue: !e.target.checked && void 0 })
|
|
922
|
+
}),
|
|
923
|
+
label: L(G, {
|
|
924
|
+
variant: "body2",
|
|
925
|
+
children: s("conditionalFormat.showIconsOnly")
|
|
926
|
+
})
|
|
927
|
+
}), L(V, {
|
|
928
|
+
control: L(B, {
|
|
929
|
+
size: "small",
|
|
930
|
+
checked: t.reverse ?? !1,
|
|
931
|
+
disabled: r,
|
|
932
|
+
onChange: (e) => p({ reverse: !!e.target.checked || void 0 })
|
|
933
|
+
}),
|
|
934
|
+
label: L(G, {
|
|
935
|
+
variant: "body2",
|
|
936
|
+
children: s("conditionalFormat.reverseIcons")
|
|
937
|
+
})
|
|
938
|
+
})]
|
|
939
|
+
})
|
|
940
|
+
] }), L(q, {
|
|
941
|
+
variant: "config",
|
|
942
|
+
children: u.map((e, i) => {
|
|
943
|
+
let a = t.reverse ? d - 1 - i : i;
|
|
944
|
+
return L(Y, {
|
|
945
|
+
stop: e,
|
|
946
|
+
allowedTypes: He,
|
|
947
|
+
showExclusive: !0,
|
|
948
|
+
readOnly: r || i === 0,
|
|
949
|
+
leading: L(Z, {
|
|
950
|
+
icon: f[i] ?? null,
|
|
951
|
+
disabled: r || l,
|
|
952
|
+
onPick: (e) => n(me(t, a, e))
|
|
953
|
+
}),
|
|
954
|
+
onStopChange: (e) => {
|
|
955
|
+
let t = u.slice();
|
|
956
|
+
t[i] = e, p({ stops: t });
|
|
957
|
+
}
|
|
958
|
+
}, i);
|
|
959
|
+
})
|
|
960
|
+
})]
|
|
961
|
+
});
|
|
962
|
+
});
|
|
963
|
+
Ue.displayName = "IconSetRulePanel";
|
|
964
|
+
var Q = (e, t, n) => u(e, t)?.toCSS("adaptive") ?? n, We = (e, t, n) => {
|
|
965
|
+
if (!e) return n;
|
|
966
|
+
if (typeof e == "string") return Q(e, t, n);
|
|
967
|
+
if (e.type === D.Type.None) return n;
|
|
968
|
+
let r = e, i = e;
|
|
969
|
+
return Q(i.foreground ?? r.color ?? i.background, t, n);
|
|
970
|
+
}, $ = N((e) => {
|
|
971
|
+
let { conditionalFormat: t, size: n = 28, ...r } = e, { workbook: i, themeKey: a } = g();
|
|
972
|
+
A(t, "onAnyChange");
|
|
973
|
+
let o = t.getScale(), u = t.getStyle(), _ = P(() => {
|
|
974
|
+
try {
|
|
975
|
+
return i?.getStyles().getNormal().getFont().toCSS("adaptive") ?? {};
|
|
976
|
+
} catch {
|
|
977
|
+
return {};
|
|
978
|
+
}
|
|
979
|
+
}, [i, a]), v = P(() => {
|
|
980
|
+
if (o?.type === E.ScaleType.ColorScale) return L(f, { rows: m(o.stops ?? [], p, i) });
|
|
981
|
+
if (o?.type === E.ScaleType.DataBar) return L(f, { rows: c(o, Q(o.color, i, d), o.borderColor ? Q(o.borderColor, i, d) : void 0) });
|
|
982
|
+
if (o?.type === E.ScaleType.IconSet) return L(z, {
|
|
983
|
+
sx: {
|
|
984
|
+
display: "flex",
|
|
985
|
+
alignItems: "center",
|
|
986
|
+
justifyContent: "center",
|
|
987
|
+
width: "100%",
|
|
988
|
+
height: "100%",
|
|
989
|
+
px: .5
|
|
990
|
+
},
|
|
991
|
+
children: L(k, {
|
|
992
|
+
icons: pe(o),
|
|
993
|
+
order: "descending",
|
|
994
|
+
size: 14,
|
|
995
|
+
gap: 3
|
|
996
|
+
})
|
|
997
|
+
});
|
|
998
|
+
let e = u?.font, t = e?.underline && e.underline !== O.UnderlineStyle.None;
|
|
999
|
+
return L(z, {
|
|
1000
|
+
sx: {
|
|
1001
|
+
width: "100%",
|
|
1002
|
+
height: "100%",
|
|
1003
|
+
display: "flex",
|
|
1004
|
+
alignItems: "center",
|
|
1005
|
+
justifyContent: "center",
|
|
1006
|
+
..._,
|
|
1007
|
+
backgroundColor: We(u?.fill, i, "transparent"),
|
|
1008
|
+
...e?.color && e.color !== "auto" ? { color: Q(e.color, i, s) } : null,
|
|
1009
|
+
...e?.weight ? { fontWeight: e.weight } : null,
|
|
1010
|
+
...e?.style ? { fontStyle: e.style } : null,
|
|
1011
|
+
textDecoration: [t ? "underline" : "", e?.strike ? "line-through" : ""].join(" ").trim() || "none",
|
|
1012
|
+
fontSize: `${Math.round(.5 * n)}px`,
|
|
1013
|
+
lineHeight: 1,
|
|
1014
|
+
outline: u?.borders ? `1px solid ${Q(Object.values(u.borders)[0]?.color, i, l)}` : void 0,
|
|
1015
|
+
outlineOffset: "-3px"
|
|
1016
|
+
},
|
|
1017
|
+
children: "Aa"
|
|
1018
|
+
});
|
|
1019
|
+
}, [
|
|
1020
|
+
o,
|
|
1021
|
+
u,
|
|
1022
|
+
n,
|
|
1023
|
+
_,
|
|
1024
|
+
i,
|
|
1025
|
+
a
|
|
1026
|
+
]);
|
|
1027
|
+
return L(h, {
|
|
1028
|
+
sheet: !0,
|
|
1029
|
+
className: "sxl-cf-rule-preview",
|
|
1030
|
+
sx: {
|
|
1031
|
+
width: "auto",
|
|
1032
|
+
minWidth: 1.7 * n + "px",
|
|
1033
|
+
height: `${n}px`
|
|
1034
|
+
},
|
|
1035
|
+
...r,
|
|
1036
|
+
children: v
|
|
1037
|
+
});
|
|
1038
|
+
});
|
|
1039
|
+
$.displayName = "RulePreview";
|
|
1040
|
+
var Ge = (e, t) => {
|
|
1041
|
+
let n = e.getCondition()?.toString();
|
|
1042
|
+
if (n) return n;
|
|
1043
|
+
let r = e.getScale();
|
|
1044
|
+
return r ? T.camelToPrettyCase(r.type) : t("conditionalFormat.noCondition");
|
|
1045
|
+
}, Ke = {
|
|
1046
|
+
classic: K("conditionalFormat.tab.classic"),
|
|
1047
|
+
[E.ScaleType.ColorScale]: K("conditionalFormat.tab.colorScale"),
|
|
1048
|
+
[E.ScaleType.DataBar]: K("conditionalFormat.tab.dataBars"),
|
|
1049
|
+
[E.ScaleType.IconSet]: K("conditionalFormat.tab.iconSets")
|
|
1050
|
+
}, qe = N((e) => {
|
|
1051
|
+
let { conditionalFormat: t } = e, n = M();
|
|
1052
|
+
A(t, "onAnyChange");
|
|
1053
|
+
let r = t.getScale(), i = t.getCondition(), a = t.getStyle(), o = t.isProtected(), s = r?.type ?? "classic", c = _e({ scales: {} }), l = (e) => {
|
|
1054
|
+
t.update({ scale: e });
|
|
1055
|
+
}, u = R(xe, {
|
|
1056
|
+
tabIndex: 0,
|
|
1057
|
+
className: _["editor-panel"],
|
|
1058
|
+
sx: {
|
|
1059
|
+
gap: (e) => e.spacing(1),
|
|
1060
|
+
paddingTop: (e) => e.spacing(1.25),
|
|
1061
|
+
paddingBottom: (e) => e.spacing(2),
|
|
1062
|
+
paddingLeft: (e) => e.spacing(1.5),
|
|
1063
|
+
paddingRight: (e) => e.spacing(1.5),
|
|
1064
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
1065
|
+
borderRadius: (e) => e.spacing(1.25),
|
|
1066
|
+
overflow: "auto"
|
|
1067
|
+
},
|
|
1068
|
+
children: [
|
|
1069
|
+
R(z, {
|
|
1070
|
+
sx: {
|
|
1071
|
+
display: "flex",
|
|
1072
|
+
flexDirection: "column",
|
|
1073
|
+
gap: (e) => e.spacing(1.75),
|
|
1074
|
+
margin: (e) => e.spacing(1.25),
|
|
1075
|
+
marginBottom: 0
|
|
1076
|
+
},
|
|
1077
|
+
children: [R(z, {
|
|
1078
|
+
sx: {
|
|
1079
|
+
display: "flex",
|
|
1080
|
+
alignItems: "center",
|
|
1081
|
+
gap: (e) => e.spacing(1.5)
|
|
1082
|
+
},
|
|
1083
|
+
children: [L($, {
|
|
1084
|
+
conditionalFormat: t,
|
|
1085
|
+
size: 48
|
|
1086
|
+
}), L(G, {
|
|
1087
|
+
variant: "body2",
|
|
1088
|
+
sx: {
|
|
1089
|
+
minWidth: 0,
|
|
1090
|
+
wordBreak: "break-word"
|
|
1091
|
+
},
|
|
1092
|
+
children: Ge(t, n)
|
|
1093
|
+
})]
|
|
1094
|
+
}), L(C, {
|
|
1095
|
+
item: t,
|
|
1096
|
+
label: n("conditionalFormat.applyTo")
|
|
1097
|
+
})]
|
|
1098
|
+
}),
|
|
1099
|
+
L(Ce, {
|
|
1100
|
+
value: s,
|
|
1101
|
+
onChange: (e, n) => {
|
|
1102
|
+
o || ((e) => {
|
|
1103
|
+
if (e !== s) {
|
|
1104
|
+
if (s === "classic" ? (c.current.condition = i?.toJSON() ?? null, c.current.style = a) : r && (c.current.scales[r.type] = r), e === "classic") t.update({
|
|
1105
|
+
condition: c.current.condition ?? {
|
|
1106
|
+
operator: te.BuiltInOperatorNames.Between,
|
|
1107
|
+
param: null
|
|
1108
|
+
},
|
|
1109
|
+
style: c.current.style ?? null,
|
|
1110
|
+
scale: null
|
|
1111
|
+
});
|
|
1112
|
+
else {
|
|
1113
|
+
let n = c.current.scales[e] ?? (e === E.ScaleType.ColorScale ? se() : e === E.ScaleType.DataBar ? ce() : le());
|
|
1114
|
+
t.update({
|
|
1115
|
+
scale: n,
|
|
1116
|
+
condition: null,
|
|
1117
|
+
style: null
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
})(n);
|
|
1122
|
+
},
|
|
1123
|
+
variant: "fullWidth",
|
|
1124
|
+
sx: {
|
|
1125
|
+
minHeight: "36px",
|
|
1126
|
+
borderBottom: 1,
|
|
1127
|
+
borderColor: "divider",
|
|
1128
|
+
"& .MuiTab-root": {
|
|
1129
|
+
minHeight: "36px",
|
|
1130
|
+
textTransform: "none",
|
|
1131
|
+
pt: .5,
|
|
1132
|
+
pb: .5,
|
|
1133
|
+
px: .5,
|
|
1134
|
+
minWidth: 0
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
children: Object.keys(Ke).map((e) => L(Se, {
|
|
1138
|
+
value: e,
|
|
1139
|
+
label: n(Ke[e])
|
|
1140
|
+
}, e))
|
|
1141
|
+
}),
|
|
1142
|
+
s === "classic" && R(ve, { children: [L(ke, {
|
|
1143
|
+
format: a,
|
|
1144
|
+
readOnly: o,
|
|
1145
|
+
onFormatChange: (e) => t.update({ style: e })
|
|
1146
|
+
}), L(x, {
|
|
1147
|
+
sx: {
|
|
1148
|
+
...b,
|
|
1149
|
+
p: 2,
|
|
1150
|
+
pb: 1
|
|
1151
|
+
},
|
|
1152
|
+
selectorTitle: n("conditionalFormat.highlight"),
|
|
1153
|
+
condition: i,
|
|
1154
|
+
ranges: t.getRanges(),
|
|
1155
|
+
readOnly: o,
|
|
1156
|
+
onConditionChange: (e) => t.setCondition(e)
|
|
1157
|
+
})] }),
|
|
1158
|
+
r?.type === E.ScaleType.ColorScale && L(Ne, {
|
|
1159
|
+
scale: r,
|
|
1160
|
+
onScaleChange: l,
|
|
1161
|
+
readOnly: o
|
|
1162
|
+
}),
|
|
1163
|
+
r?.type === E.ScaleType.DataBar && L(Ie, {
|
|
1164
|
+
scale: r,
|
|
1165
|
+
onScaleChange: l,
|
|
1166
|
+
readOnly: o
|
|
1167
|
+
}),
|
|
1168
|
+
r?.type === E.ScaleType.IconSet && L(Ue, {
|
|
1169
|
+
scale: r,
|
|
1170
|
+
onScaleChange: l,
|
|
1171
|
+
readOnly: o
|
|
1172
|
+
}),
|
|
1173
|
+
s === "classic" && L(z, {
|
|
1174
|
+
sx: {
|
|
1175
|
+
pl: 2,
|
|
1176
|
+
pr: 2,
|
|
1177
|
+
border: 1,
|
|
1178
|
+
borderColor: "divider",
|
|
1179
|
+
borderRadius: 1
|
|
1180
|
+
},
|
|
1181
|
+
children: L(V, {
|
|
1182
|
+
control: L(B, {
|
|
1183
|
+
checked: t.isStopIfTrue(),
|
|
1184
|
+
disabled: o,
|
|
1185
|
+
onChange: (e) => t.setStopIfTrue(e.target.checked)
|
|
1186
|
+
}),
|
|
1187
|
+
label: n("conditionalFormat.stopIfTrue")
|
|
1188
|
+
})
|
|
1189
|
+
})
|
|
1190
|
+
]
|
|
1191
|
+
});
|
|
1192
|
+
return L(y.Provider, {
|
|
1193
|
+
value: t,
|
|
1194
|
+
children: u
|
|
1195
|
+
});
|
|
1196
|
+
});
|
|
1197
|
+
qe.displayName = "ConditionalFormatEditorPanel";
|
|
1198
|
+
var Je = N(({ item: e }) => {
|
|
1199
|
+
let t = M();
|
|
1200
|
+
return A(e, "onAnyChange"), !e.isStopIfTrue() || e.getScale() ? null : L(z, {
|
|
1201
|
+
sx: {
|
|
1202
|
+
display: "inline-flex",
|
|
1203
|
+
alignItems: "center",
|
|
1204
|
+
alignSelf: "flex-start",
|
|
1205
|
+
px: .75,
|
|
1206
|
+
py: .25,
|
|
1207
|
+
border: 1,
|
|
1208
|
+
borderColor: "divider",
|
|
1209
|
+
borderRadius: 1,
|
|
1210
|
+
color: "text.secondary"
|
|
1211
|
+
},
|
|
1212
|
+
children: L(G, {
|
|
1213
|
+
variant: "caption",
|
|
1214
|
+
children: t("conditionalFormat.stopIfTrue")
|
|
1215
|
+
})
|
|
1216
|
+
});
|
|
1217
|
+
});
|
|
1218
|
+
Je.displayName = "StopIfTrueBadge";
|
|
1219
|
+
var Ye = N(({ item: e }) => {
|
|
1220
|
+
let t = M();
|
|
1221
|
+
return L(C, {
|
|
1222
|
+
item: e,
|
|
1223
|
+
label: t("conditionalFormat.applyTo"),
|
|
1224
|
+
helperText: null
|
|
1225
|
+
});
|
|
1226
|
+
});
|
|
1227
|
+
Ye.displayName = "ConditionalFormatCardRanges";
|
|
1228
|
+
var Xe = {
|
|
1229
|
+
key: "conditional-format",
|
|
1230
|
+
messageKeys: {
|
|
1231
|
+
none: K("conditionalFormat.none"),
|
|
1232
|
+
addPrompt: K("conditionalFormat.addPrompt"),
|
|
1233
|
+
heading: K("conditionalFormat.heading"),
|
|
1234
|
+
insert: K("conditionalFormat.insert"),
|
|
1235
|
+
new: K("conditionalFormat.new"),
|
|
1236
|
+
moveUp: K("conditionalFormat.moveUp"),
|
|
1237
|
+
moveDown: K("conditionalFormat.moveDown"),
|
|
1238
|
+
edit: K("conditionalFormat.edit"),
|
|
1239
|
+
duplicate: K("conditionalFormat.duplicate"),
|
|
1240
|
+
delete: K("conditionalFormat.delete"),
|
|
1241
|
+
cancel: K("conditionalFormat.cancel"),
|
|
1242
|
+
save: K("conditionalFormat.save")
|
|
1243
|
+
},
|
|
1244
|
+
getCollection: (e) => e.getConditionalFormats(),
|
|
1245
|
+
changeEvents: ["onConditionalFormatsChange"],
|
|
1246
|
+
isReadOnly: (e) => !e.getProtection().isFormatCellsAllowed(),
|
|
1247
|
+
applyUpdate: (e, t) => {
|
|
1248
|
+
e.update(t);
|
|
1249
|
+
},
|
|
1250
|
+
validate: (e) => e.getCondition()?.validate() ?? null,
|
|
1251
|
+
applySeed: (e, t) => {
|
|
1252
|
+
e.update({
|
|
1253
|
+
condition: t.condition ?? null,
|
|
1254
|
+
style: t.style ?? null,
|
|
1255
|
+
scale: t.scale ?? null,
|
|
1256
|
+
stopIfTrue: t.stopIfTrue ?? !1
|
|
1257
|
+
});
|
|
1258
|
+
},
|
|
1259
|
+
getCardTitle: Ge,
|
|
1260
|
+
CardMedia: ({ item: e }) => L($, {
|
|
1261
|
+
conditionalFormat: e,
|
|
1262
|
+
size: 32
|
|
1263
|
+
}),
|
|
1264
|
+
CardSubtitle: Ye,
|
|
1265
|
+
CardBody: Je,
|
|
1266
|
+
EditorBody: ({ item: e }) => L(qe, { conditionalFormat: e })
|
|
1267
|
+
}, Ze = N(he((e, t) => {
|
|
1268
|
+
let { workbook: n, args: r, ...i } = e;
|
|
1269
|
+
return L(S, {
|
|
1270
|
+
ref: t,
|
|
1271
|
+
workbook: n,
|
|
1272
|
+
descriptor: Xe,
|
|
1273
|
+
args: r,
|
|
1274
|
+
dragReorder: !0,
|
|
1275
|
+
...i
|
|
1276
|
+
});
|
|
1277
|
+
}));
|
|
1278
|
+
Ze.displayName = "ConditionalFormatDetailsPanel";
|
|
1279
|
+
var Qe = (e) => {
|
|
1280
|
+
let { model: t, entryKey: n, frame: r, args: i, ref: a, ...o } = e;
|
|
1281
|
+
return L(Ze, {
|
|
1282
|
+
ref: a,
|
|
1283
|
+
workbook: t,
|
|
1284
|
+
args: i,
|
|
1285
|
+
...o
|
|
1286
|
+
});
|
|
1287
|
+
};
|
|
1288
|
+
export { Qe as ConditionalFormatDetailsTaskPane };
|