@sheetxl/studio-mui 0.8.0-beta.15 → 0.8.0-beta.16
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/LICENSE.md +17 -7
- package/browser/esm/{CJWnWqGPw17cp9P3.mjs → 2DGUEeY8au7Hbmze.mjs} +2 -2
- package/browser/esm/{OmA1ClZ36ZMFrZe7.mjs → 9V0gwYl3BcajPwBD.mjs} +2 -2
- package/browser/esm/B0mscuFChIInl6Mo.mjs +119 -0
- package/browser/esm/{EFtp_C3sBnP3Nrns.mjs → BGg5TSbhaUimavRf.mjs} +7 -7
- package/browser/esm/BL-h4RElQAdaeHPF.mjs +360 -0
- package/browser/esm/{DOWfcHx0MO0J50de.mjs → BSrubs5qLEinR8Ew.mjs} +92 -87
- package/browser/esm/BUCQPr09aodgC88P.mjs +225 -0
- package/browser/esm/{BvpzsprI7cmVLuQn.mjs → Bg6bcIJsute7rxDL.mjs} +3 -3
- package/browser/esm/{CV-q-xCHVuNFhqEF.mjs → BjR7L3X6je3fXyQi.mjs} +2 -2
- package/browser/esm/{DMDi2lOps0veJKsM.mjs → Bo_18UwXk7eK6QaM.mjs} +3 -3
- package/browser/esm/{BfPTOOKhwUojRTef.mjs → Bp4rtdIKIFzTeJvr.mjs} +13 -9
- package/browser/esm/BxneVAXjYuQbCUQo.mjs +424 -0
- package/browser/esm/{BojGnpAWoIm5yCd8.mjs → C2V3kv29foh8dScC.mjs} +2 -2
- package/browser/esm/{BkxJY_YjMAEvhmuy.mjs → C8M4U_SswTd6auZd.mjs} +4 -4
- package/browser/esm/{BR51amBhaaHPBhpd.mjs → C9XRjC0yoGvS9Cm9.mjs} +3 -3
- package/browser/esm/{ghfcAaGu2CuZGdhi.mjs → CDgoQhayiKyo-7Br.mjs} +34 -33
- package/browser/esm/{Buzx8_zQYPX4DR7v.mjs → CLgar8cakFC22X3w.mjs} +2 -2
- package/browser/esm/{6SL2j-85OXrKJNZ5.mjs → CUh56URLD9Vh5Ak9.mjs} +1807 -1200
- package/browser/esm/{DLe9DT0DSurLSgiQ.mjs → CXgBRmauwDvHb3fQ.mjs} +2 -2
- package/browser/esm/{Bqba-3J9i8HsmusR.mjs → CYOaHHiaC7Ip5VLn.mjs} +2 -2
- package/browser/esm/C_qDBCzb8IHBlPhJ.mjs +294 -0
- package/browser/esm/{Cbkg5y4fYjLylYHF.mjs → CfsYKmwU44jlvh2Y.mjs} +2 -2
- package/browser/esm/Ch1y4AkETfKCYDwf.mjs +106 -0
- package/browser/esm/{By1IJOkvZJSlXs5f.mjs → CnId_LC0EekuwaAF.mjs} +3 -3
- package/browser/esm/{BsAoK_t2sn8IHtAO.mjs → CtVSJjciTocAi-ph.mjs} +3 -3
- package/browser/esm/{C8tci3dfo5lzeoK-.mjs → CuQsEoKZJrSL989Q.mjs} +6 -6
- package/browser/esm/{Cl_OUigCV04_zrRy.mjs → Cv99zJfRtzJQmM9a.mjs} +2 -2
- package/browser/esm/{BCDAnHFMvOd9XS8K.mjs → Cxk-oWZzE2jq5ul6.mjs} +3 -3
- package/browser/esm/{CcJHwg-rLMcCymSD.mjs → D3XdTSymYMag6tor.mjs} +6 -6
- package/browser/esm/{BH4eDAxZdwheO7d_.mjs → D4jGaUxHOgVc4qN0.mjs} +3 -3
- package/browser/esm/{BvbN9V67wFhTfq1-.mjs → DAdhaGB933dfni3E.mjs} +3 -3
- package/browser/esm/{DpAlQza0e5h3GGHC.mjs → DBx1Y3oFzB6gv-LQ.mjs} +3 -3
- package/browser/esm/{DJVpra0HoPH-4P7P.mjs → DIAnBUXPTvYAp5fm.mjs} +3 -3
- package/browser/esm/{idh3Y0jksygPSI3A.mjs → DIJh9jY37iVFn-tE.mjs} +2 -2
- package/browser/esm/{Ci74yk0whfoAP1TL.mjs → DK1K-M9iJV-DK3lK.mjs} +2 -2
- package/browser/esm/{BNas8wZuvrN45dRi.mjs → DMhFcJsnKSKTDivl.mjs} +2 -2
- package/browser/esm/{BWdpv2xf6GCyd4Te.mjs → DMj9kkIWw9chI5_u.mjs} +5 -5
- package/browser/esm/DUpW8HMoEhD3C9l6.mjs +235 -0
- package/browser/esm/{DzATG8XMcG6mmYbx.mjs → DVJ5AK0zcqSACGov.mjs} +9 -9
- package/browser/esm/{DYDnkmllpYTwfWir.mjs → DVaykBKx4eEsP4MI.mjs} +4 -4
- package/browser/esm/{C67SLDHwhVlVIMo0.mjs → Dex65RXS_A5CnMg3.mjs} +3 -3
- package/browser/esm/{BYnzaHXySiV-sc6w.mjs → DfYtGsqDIMAG4Sp8.mjs} +2 -2
- package/browser/esm/{IlX2PgLxvyTQu4Fh.mjs → Dj0VEFe2ckEWgQjy.mjs} +5 -5
- package/browser/esm/{DKkKac2vbeui2lDy.mjs → DjCDJhBfVI9O_Sq1.mjs} +6 -6
- package/browser/esm/DjjmLQLxU_U4JB3n.mjs +973 -0
- package/browser/esm/{CutWdrVA-c3x8IkL.mjs → DmOrKFaiUUr5hlFl.mjs} +5 -4
- package/browser/esm/{Bvq5aZyp5E79JB-s.mjs → DoYSmj1LQHAAqt5b.mjs} +2 -2
- package/browser/esm/{Dz20q7S5vmDWlO0p.mjs → KhOxaZS8EeSaYFXZ.mjs} +2 -2
- package/browser/esm/{DAYPqhHN3aQ2StjU.mjs → PvNtCGveCLbLAP3e.mjs} +14 -14
- package/browser/esm/{DfI4-5XM6AbILSti.mjs → ROOxAZY7YyHDmPcQ.mjs} +4 -4
- package/browser/esm/{DFAphWcDUw-gVtAl.mjs → TfUaejwwWzu5qFVE.mjs} +3 -3
- package/browser/esm/{DsM-NpB32hloRRR8.mjs → ZhI7zxDSTWb1DfaE.mjs} +3 -3
- package/browser/esm/{DY_EGsyx-zNiJS_0.mjs → fqZt7Z0jR4illVKU.mjs} +5 -5
- package/browser/esm/index.mjs +278 -277
- package/browser/esm/{OHvsc940xI-m_8cc.mjs → r7bLyFzJfaGLKP_7.mjs} +2 -2
- package/browser/esm/{DR9y7k4jB7stGPaZ.mjs → tffjGixzP1Ze4DqB.mjs} +3 -3
- package/browser/esm/{D90Bb0GPEwqYkf6R.mjs → tiC8hseLz66gO5BS.mjs} +804 -713
- package/node/esm/{-Adgw5-ltK-rfp33.mjs → -Il_piuBrbndDROB.mjs} +2 -2
- package/node/esm/0cm_0VYweOBWmzi7.mjs +972 -0
- package/node/esm/{CexPhV2NPh5ZGHus.mjs → 1gdwmt5CrQy4cGTH.mjs} +2 -2
- package/node/esm/{dUUbrmGMCILl8EOr.mjs → 3Geel3fylTwbPuxf.mjs} +2 -2
- package/node/esm/{CFi_Yls-gurU_CX3.mjs → 4pRKBhUYhbbE6qVT.mjs} +2 -2
- package/node/esm/{jGsHbOHP90nnx_hJ.mjs → 9qIZWfzxSaxNk6Cm.mjs} +16 -15
- package/node/esm/B9uLfbf5gMGnoUjH.mjs +224 -0
- package/node/esm/{BxIyViNSP0STSrfA.mjs → BFO2WxwRNbu-UmKe.mjs} +3 -3
- package/node/esm/{q2Byx8RdDnHk8YyG.mjs → BIJXqUbAalnd-gXD.mjs} +2 -2
- package/node/esm/{C4eVfVm_Omyt6NbE.mjs → BIviFvkWx6eP4dMd.mjs} +12 -12
- package/node/esm/{Cx4tBEsm3SjAafcw.mjs → BTOCej61y3MazK6r.mjs} +2 -2
- package/node/esm/{5etzEfk-28CCELyT.mjs → BV9hUarSGd3mWC8o.mjs} +3 -3
- package/node/esm/{DGtbmp72kfRXLtDu.mjs → BX1cTEV3SpcqLcXx.mjs} +81 -80
- package/node/esm/{DOuASwH2Lf83hMLe.mjs → BZu-8gEXwIzW_YX9.mjs} +2 -2
- package/node/esm/{CX13ASkhdJ0ZSAY4.mjs → B_jOG6MlKoiboP3D.mjs} +3 -3
- package/node/esm/{DwA7rfXJgzoNvjax.mjs → BgObBW8ZUr50OufC.mjs} +8 -8
- package/node/esm/{BKCNFVrdc_gTnOoS.mjs → BhiuBl2z87xThV1b.mjs} +2 -2
- package/node/esm/{B26ot2vO6Hd47uH0.mjs → Bm054Lh36PSa5m1P.mjs} +2 -2
- package/node/esm/BtxNP8JWe16vSXAs.mjs +106 -0
- package/node/esm/BzT_zks-KORaryRo.mjs +118 -0
- package/node/esm/{Bg3Yu66oJr6mNvAR.mjs → C5dRM0ExMHpFgKd0.mjs} +3 -3
- package/node/esm/{BZK6UksX7r-GgRms.mjs → CQxu_KONf2yyKKnD.mjs} +2 -2
- package/node/esm/{BaFRVcYZjcLoMQtk.mjs → CdoFRzEug2L0LwNb.mjs} +7 -7
- package/node/esm/{DybPyX8U-EqXKarV.mjs → Ch7Ebxf0bFrlCJpW.mjs} +2 -2
- package/node/esm/{CzKFdVrPSDYOUdWI.mjs → CsQTJ4JQRxLcJDiZ.mjs} +2 -2
- package/node/esm/{BFv2GzY6NjmJggAg.mjs → CyKOmz26TaZSFxmi.mjs} +3 -3
- package/node/esm/D3TsBlOewIFj-VDW.mjs +294 -0
- package/node/esm/{Ca31PUiJBGowHeob.mjs → D4TlOO7hjvqTR2HX.mjs} +3 -3
- package/node/esm/{TgwnKYh-WPxEgmyr.mjs → DYNM5HfUK0JbGHsx.mjs} +2 -2
- package/node/esm/{B7vbn_dO_cZnGyGM.mjs → DhPNzztIuq9WJwCz.mjs} +3 -3
- package/node/esm/{ISBEql8s7AnELTpd.mjs → cl-bDkq8M4STBYJy.mjs} +2 -2
- package/node/esm/fazR-cWd-2-W82Nk.mjs +425 -0
- package/node/esm/index.mjs +3391 -2778
- package/node/esm/{D9Ga7FFJDOO3Dpfu.mjs → iyOc5Rm5x746Qd3R.mjs} +2 -2
- package/node/esm/{CORxK68HpwPUYA6O.mjs → klLaIOeBuqaYuz_q.mjs} +2 -2
- package/node/esm/{D_JpopAVQopM26cb.mjs → mmzQ-lse6yBavXnw.mjs} +603 -514
- package/node/esm/{CkW8xNdW45Xg7jy7.mjs → rpHmm4X81z1orjHr.mjs} +3 -3
- package/node/esm/{HlNuwtpYoOARa894.mjs → tRnEFhRlzQPziQif.mjs} +2 -2
- package/package.json +10 -10
- package/resources/locales/de/groups.cmd.json +3 -0
- package/resources/locales/de/ui.msg.json +41 -0
- package/resources/locales/en/groups.cmd.json +3 -0
- package/resources/locales/en/ui.msg.json +41 -0
- package/types/src/command/PresetPivotStylesCommandButton.d.ts +17 -0
- package/types/src/command/index.d.ts +1 -0
- package/types/src/dialog/PivotTableNewDialog.d.ts +11 -0
- package/types/src/filter/PivotMenu.d.ts +31 -0
- package/types/src/filter/index.d.ts +1 -0
- package/types/src/pivot/PivotChipMenu.d.ts +10 -0
- package/types/src/pivot/PivotPlugin.d.ts +3 -0
- package/types/src/pivot/PivotStyleCanvasPreview.d.ts +23 -0
- package/types/src/pivot/PivotTableHeader.d.ts +12 -0
- package/types/src/pivot/PivotValueSettingsDialog.d.ts +15 -0
- package/types/src/pivot/_pivotSource.d.ts +7 -0
- package/types/src/table/_drawStyleSwatch.d.ts +25 -0
- package/types/src/workbook/DefaultRenderers.d.ts +10 -4
- package/browser/esm/C4ir9dn7q0RUoOm_.mjs +0 -319
- package/browser/esm/DEUzUShfyJLvgd6_.mjs +0 -1379
- package/browser/esm/xe1B8ohea8qfZlFg.mjs +0 -582
- package/node/esm/CKtnUYKjsTf7dYKS.mjs +0 -318
- package/node/esm/vf5X26EJO7Q1b8Ln.mjs +0 -1379
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.16
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import { NumberFormatOption as e, S as r, numberFormatCategoryLabel as t } from "./index.mjs";
|
|
8
|
+
import { a, i as n, n as o } from "./BtxNP8JWe16vSXAs.mjs";
|
|
9
|
+
import { NumberFormat as i } from "@sheetxl/sdk";
|
|
10
|
+
import { useCallbackRef as l, useTranslator as s } from "@sheetxl/utils-react";
|
|
11
|
+
import { forwardRef as c, memo as d, useEffect as u, useState as p } from "react";
|
|
12
|
+
import { ExhibitMenuItem as b, ExhibitPopupIconButton as h, SelectedIcon as f, defaultRenderPopupPanel as x } from "@sheetxl/utils-mui";
|
|
13
|
+
import { Fragment as g, jsx as y, jsxs as F } from "react/jsx-runtime";
|
|
14
|
+
import { Box as S, Checkbox as v, FormControl as k, FormControlLabel as E, InputLabel as T, List as C, ListItemButton as w, ListItemText as P, MenuItem as D, Select as R, TextField as I, Typography as M } from "@mui/material";
|
|
15
|
+
import N from "clsx";
|
|
16
|
+
var { Builder: A } = i, H = {
|
|
17
|
+
py: "2px",
|
|
18
|
+
px: 1,
|
|
19
|
+
minHeight: 0,
|
|
20
|
+
"& .MuiListItemText-root": { my: 0 },
|
|
21
|
+
"& .MuiListItemText-primary": {
|
|
22
|
+
fontSize: "0.8125rem",
|
|
23
|
+
lineHeight: 1.5
|
|
24
|
+
},
|
|
25
|
+
"& .MuiListItemText-secondary": {
|
|
26
|
+
fontSize: "0.7rem",
|
|
27
|
+
lineHeight: 1.3
|
|
28
|
+
}
|
|
29
|
+
}, L = {
|
|
30
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
31
|
+
borderRadius: (e) => `${e.shape.borderRadius}px`,
|
|
32
|
+
overflow: "auto",
|
|
33
|
+
maxHeight: 260
|
|
34
|
+
};
|
|
35
|
+
function _(e, r, t) {
|
|
36
|
+
switch (r) {
|
|
37
|
+
case "minus": return e("numberFormat.negMinus");
|
|
38
|
+
case "red": return e("numberFormat.negRed");
|
|
39
|
+
case "parens": return e("numberFormat.negParens");
|
|
40
|
+
case "redParens": return e("numberFormat.negRedParens");
|
|
41
|
+
default: return t;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function z(e, r, t) {
|
|
45
|
+
const a = r?.getValue();
|
|
46
|
+
return "Text" === e ? "string" == typeof a ? a : t : "Date" === e || "Time" === e ? "number" == typeof a ? a : 45658.625 : "number" == typeof a ? a : 1234.56;
|
|
47
|
+
}
|
|
48
|
+
function O(e, r, t) {
|
|
49
|
+
try {
|
|
50
|
+
return t ? t.createCell({
|
|
51
|
+
value: r,
|
|
52
|
+
style: { numberFormat: e }
|
|
53
|
+
}).getNumberFormat().displayText || "" : i.getEngine().format(e, r, {}).text ?? "";
|
|
54
|
+
} catch {
|
|
55
|
+
return "";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
var V = d(c((m, c) => {
|
|
59
|
+
const { value: d, onChange: V, context: W, onCommit: $, hideSample: B = !1, showQuickFormats: K = !1, disabled: j = !1, className: G, onKeyDown: Y, ...U } = m, Q = s(), [Z, q] = p(() => A.parse(d));
|
|
60
|
+
u(() => {
|
|
61
|
+
A.build(Z) !== d && q(A.parse(d));
|
|
62
|
+
}, [d]);
|
|
63
|
+
const J = W?.() ?? null, X = l((e) => {
|
|
64
|
+
q(e), V(A.build(e));
|
|
65
|
+
}, [V]), ee = l((e) => {
|
|
66
|
+
X({
|
|
67
|
+
...Z,
|
|
68
|
+
...e
|
|
69
|
+
});
|
|
70
|
+
}, [Z, X]), re = l(() => {
|
|
71
|
+
V(d);
|
|
72
|
+
}, [V, d]), te = l((e) => {
|
|
73
|
+
if (e === Z.category) return;
|
|
74
|
+
const r = A.defaultCodeForCategory(e), t = A.isParametricCategory(e) ? A.parse(r) : {
|
|
75
|
+
category: e,
|
|
76
|
+
code: r
|
|
77
|
+
};
|
|
78
|
+
X(t);
|
|
79
|
+
}, [Z.category, X]), ae = l((e) => {
|
|
80
|
+
if (Y?.(e), "Enter" === e.key) {
|
|
81
|
+
if (e.target.closest("[role=\"combobox\"], [role=\"menuitem\"]")) return;
|
|
82
|
+
e.preventDefault(), e.stopPropagation(), $?.();
|
|
83
|
+
}
|
|
84
|
+
}, [Y, $]), ne = (e, r, t) => (a) => {
|
|
85
|
+
let n = r;
|
|
86
|
+
switch (a.key) {
|
|
87
|
+
case "ArrowDown":
|
|
88
|
+
n = Math.min(e - 1, r + 1);
|
|
89
|
+
break;
|
|
90
|
+
case "ArrowUp":
|
|
91
|
+
n = Math.max(0, r - 1);
|
|
92
|
+
break;
|
|
93
|
+
case "Home":
|
|
94
|
+
n = 0;
|
|
95
|
+
break;
|
|
96
|
+
case "End":
|
|
97
|
+
n = e - 1;
|
|
98
|
+
break;
|
|
99
|
+
default: return;
|
|
100
|
+
}
|
|
101
|
+
a.preventDefault(), n !== r && n >= 0 && t(n), a.currentTarget.querySelectorAll(".MuiListItemButton-root")[n]?.focus();
|
|
102
|
+
}, oe = Z.category, ie = z(oe, J, Q("numberFormat.sampleText")), le = O(d, ie, J), se = y(o, {
|
|
103
|
+
label: Q("numberFormat.decimalPlaces"),
|
|
104
|
+
disabled: j,
|
|
105
|
+
value: Z.decimalPlaces ?? 0,
|
|
106
|
+
min: 0,
|
|
107
|
+
max: 30,
|
|
108
|
+
width: 140,
|
|
109
|
+
onChange: (e) => ee({ decimalPlaces: e })
|
|
110
|
+
}), me = Z.currencySymbol ?? "$", ce = F(k, {
|
|
111
|
+
size: "small",
|
|
112
|
+
sx: { width: 140 },
|
|
113
|
+
children: [y(T, {
|
|
114
|
+
shrink: !0,
|
|
115
|
+
children: Q("numberFormat.symbol")
|
|
116
|
+
}), y(R, {
|
|
117
|
+
label: Q("numberFormat.symbol"),
|
|
118
|
+
notched: !0,
|
|
119
|
+
disabled: j,
|
|
120
|
+
value: me,
|
|
121
|
+
onChange: (e) => ee({ currencySymbol: e.target.value }),
|
|
122
|
+
children: A.CURRENCY_SYMBOLS.map((e) => y(D, {
|
|
123
|
+
value: e,
|
|
124
|
+
onClick: a(me, e, re),
|
|
125
|
+
children: e
|
|
126
|
+
}, e))
|
|
127
|
+
})]
|
|
128
|
+
}), de = y(E, {
|
|
129
|
+
sx: { alignSelf: "center" },
|
|
130
|
+
control: y(v, {
|
|
131
|
+
size: "small",
|
|
132
|
+
disabled: j,
|
|
133
|
+
checked: !!Z.useSeparator,
|
|
134
|
+
onChange: (e) => ee({ useSeparator: e.target.checked })
|
|
135
|
+
}),
|
|
136
|
+
label: Q("numberFormat.useSeparator")
|
|
137
|
+
}), ue = F(S, {
|
|
138
|
+
sx: {
|
|
139
|
+
display: "flex",
|
|
140
|
+
flexDirection: "column",
|
|
141
|
+
minHeight: 0,
|
|
142
|
+
flex: "1 1 auto"
|
|
143
|
+
},
|
|
144
|
+
children: [y(M, {
|
|
145
|
+
variant: "caption",
|
|
146
|
+
component: "div",
|
|
147
|
+
sx: { mb: .5 },
|
|
148
|
+
children: Q("numberFormat.negativeNumbers")
|
|
149
|
+
}), y(C, {
|
|
150
|
+
dense: !0,
|
|
151
|
+
disablePadding: !0,
|
|
152
|
+
sx: {
|
|
153
|
+
...L,
|
|
154
|
+
flex: "1 1 auto"
|
|
155
|
+
},
|
|
156
|
+
onKeyDown: ne(A.NEGATIVE_STYLES.length, Z.negativeStyle ?? 0, (e) => ee({ negativeStyle: e })),
|
|
157
|
+
children: A.NEGATIVE_STYLES.map((e, r) => {
|
|
158
|
+
const t = O(A.build({
|
|
159
|
+
...Z,
|
|
160
|
+
negativeStyle: r
|
|
161
|
+
}), -function(e) {
|
|
162
|
+
return "number" == typeof e ? Math.abs(e) : 1234.56;
|
|
163
|
+
}(ie), J);
|
|
164
|
+
return y(w, {
|
|
165
|
+
disabled: j,
|
|
166
|
+
selected: (Z.negativeStyle ?? 0) === r,
|
|
167
|
+
onClick: () => ee({ negativeStyle: r }),
|
|
168
|
+
sx: H,
|
|
169
|
+
children: y(P, {
|
|
170
|
+
primary: t || _(Q, e.key, e.label),
|
|
171
|
+
slotProps: { primary: {
|
|
172
|
+
noWrap: !0,
|
|
173
|
+
sx: {
|
|
174
|
+
color: e.red ? "error.main" : void 0,
|
|
175
|
+
fontVariantNumeric: "tabular-nums"
|
|
176
|
+
}
|
|
177
|
+
} }
|
|
178
|
+
})
|
|
179
|
+
}, e.key);
|
|
180
|
+
})
|
|
181
|
+
})]
|
|
182
|
+
}), pe = (e, r) => y(C, {
|
|
183
|
+
dense: !0,
|
|
184
|
+
disablePadding: !0,
|
|
185
|
+
sx: {
|
|
186
|
+
...L,
|
|
187
|
+
flex: "1 1 auto"
|
|
188
|
+
},
|
|
189
|
+
onKeyDown: ne(e.length, e.indexOf(d), (r) => X({
|
|
190
|
+
category: oe,
|
|
191
|
+
code: e[r]
|
|
192
|
+
})),
|
|
193
|
+
children: e.map((e) => y(w, {
|
|
194
|
+
disabled: j,
|
|
195
|
+
selected: d === e,
|
|
196
|
+
onClick: () => X({
|
|
197
|
+
category: oe,
|
|
198
|
+
code: e
|
|
199
|
+
}),
|
|
200
|
+
sx: H,
|
|
201
|
+
children: y(P, {
|
|
202
|
+
primary: r?.[e] ?? O(e, ie, J) ?? e,
|
|
203
|
+
secondary: r ? e : void 0,
|
|
204
|
+
slotProps: {
|
|
205
|
+
primary: { noWrap: !0 },
|
|
206
|
+
secondary: { noWrap: !0 }
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
}, e))
|
|
210
|
+
}), be = y(I, {
|
|
211
|
+
label: Q("numberFormat.typeCode"),
|
|
212
|
+
size: "small",
|
|
213
|
+
fullWidth: !0,
|
|
214
|
+
disabled: j,
|
|
215
|
+
value: d,
|
|
216
|
+
error: !!d && !i.Parser.isValidFormat(d),
|
|
217
|
+
helperText: d && !i.Parser.isValidFormat(d) ? Q("numberFormat.invalidCode") : " ",
|
|
218
|
+
onChange: (e) => X({
|
|
219
|
+
category: "Custom",
|
|
220
|
+
code: e.target.value
|
|
221
|
+
}),
|
|
222
|
+
slotProps: {
|
|
223
|
+
inputLabel: { shrink: !0 },
|
|
224
|
+
htmlInput: {
|
|
225
|
+
spellCheck: !1,
|
|
226
|
+
autoComplete: "off"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}), he = (e) => y(S, {
|
|
230
|
+
sx: {
|
|
231
|
+
display: "flex",
|
|
232
|
+
flexWrap: "wrap",
|
|
233
|
+
gap: 1.5,
|
|
234
|
+
alignItems: "flex-start"
|
|
235
|
+
},
|
|
236
|
+
children: e
|
|
237
|
+
});
|
|
238
|
+
let fe;
|
|
239
|
+
switch (oe) {
|
|
240
|
+
case "General":
|
|
241
|
+
fe = y(M, {
|
|
242
|
+
variant: "body2",
|
|
243
|
+
children: Q("numberFormat.generalInfo")
|
|
244
|
+
});
|
|
245
|
+
break;
|
|
246
|
+
case "Number":
|
|
247
|
+
fe = F(g, { children: [he(F(g, { children: [se, de] })), ue] });
|
|
248
|
+
break;
|
|
249
|
+
case "Currency":
|
|
250
|
+
fe = F(g, { children: [he(F(g, { children: [se, ce] })), ue] });
|
|
251
|
+
break;
|
|
252
|
+
case "Accounting":
|
|
253
|
+
fe = F(g, { children: [he(F(g, { children: [se, ce] })), y(M, {
|
|
254
|
+
variant: "caption",
|
|
255
|
+
color: "text.secondary",
|
|
256
|
+
children: Q("numberFormat.accountingInfo")
|
|
257
|
+
})] });
|
|
258
|
+
break;
|
|
259
|
+
case "Percentage":
|
|
260
|
+
case "Scientific":
|
|
261
|
+
fe = se;
|
|
262
|
+
break;
|
|
263
|
+
case "Date":
|
|
264
|
+
fe = pe(A.DATE_PRESETS);
|
|
265
|
+
break;
|
|
266
|
+
case "Time":
|
|
267
|
+
fe = pe(A.TIME_PRESETS);
|
|
268
|
+
break;
|
|
269
|
+
case "Fraction":
|
|
270
|
+
fe = pe(A.FRACTION_PRESETS, ((e) => ({
|
|
271
|
+
"# ?/?": e("numberFormat.fractionOneDigit"),
|
|
272
|
+
"# ??/??": e("numberFormat.fractionTwoDigits"),
|
|
273
|
+
"# ???/???": e("numberFormat.fractionThreeDigits"),
|
|
274
|
+
"# ?/2": e("numberFormat.fractionHalves"),
|
|
275
|
+
"# ?/4": e("numberFormat.fractionQuarters"),
|
|
276
|
+
"# ?/8": e("numberFormat.fractionEighths"),
|
|
277
|
+
"# ??/16": e("numberFormat.fractionSixteenths"),
|
|
278
|
+
"# ?/10": e("numberFormat.fractionTenths"),
|
|
279
|
+
"# ??/100": e("numberFormat.fractionHundredths")
|
|
280
|
+
}))(Q));
|
|
281
|
+
break;
|
|
282
|
+
case "Special":
|
|
283
|
+
fe = pe(A.SPECIAL_PRESETS, ((e) => ({
|
|
284
|
+
"00000": e("numberFormat.specialZip"),
|
|
285
|
+
"00000-0000": e("numberFormat.specialZip4"),
|
|
286
|
+
"[<=9999999]###-####;(###) ###-####": e("numberFormat.specialPhone"),
|
|
287
|
+
"000-00-0000": e("numberFormat.specialSsn")
|
|
288
|
+
}))(Q));
|
|
289
|
+
break;
|
|
290
|
+
case "Text":
|
|
291
|
+
fe = y(M, {
|
|
292
|
+
variant: "body2",
|
|
293
|
+
children: Q("numberFormat.textInfo")
|
|
294
|
+
});
|
|
295
|
+
break;
|
|
296
|
+
case "Custom":
|
|
297
|
+
fe = F(g, { children: [be, pe(A.DATE_PRESETS.concat(A.TIME_PRESETS))] });
|
|
298
|
+
break;
|
|
299
|
+
default: fe = null;
|
|
300
|
+
}
|
|
301
|
+
return F(S, {
|
|
302
|
+
ref: c,
|
|
303
|
+
className: N("sxl-number-format-panel", G),
|
|
304
|
+
onKeyDown: ae,
|
|
305
|
+
sx: {
|
|
306
|
+
display: "flex",
|
|
307
|
+
flexDirection: "column",
|
|
308
|
+
gap: 1.25
|
|
309
|
+
},
|
|
310
|
+
...U,
|
|
311
|
+
children: [
|
|
312
|
+
B ? null : F(S, { children: [y(M, {
|
|
313
|
+
variant: "caption",
|
|
314
|
+
component: "div",
|
|
315
|
+
sx: { pl: .5 },
|
|
316
|
+
children: Q("numberFormat.sample")
|
|
317
|
+
}), y(M, {
|
|
318
|
+
variant: "body1",
|
|
319
|
+
component: "div",
|
|
320
|
+
sx: {
|
|
321
|
+
borderRadius: (e) => `${e.shape.borderRadius}px`,
|
|
322
|
+
padding: (e) => e.spacing(1),
|
|
323
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
324
|
+
minHeight: "1.6em",
|
|
325
|
+
fontVariantNumeric: "tabular-nums",
|
|
326
|
+
overflow: "hidden",
|
|
327
|
+
textOverflow: "ellipsis",
|
|
328
|
+
whiteSpace: "nowrap"
|
|
329
|
+
},
|
|
330
|
+
children: le || " "
|
|
331
|
+
})] }),
|
|
332
|
+
K ? y(r, {
|
|
333
|
+
disabled: j,
|
|
334
|
+
sx: {
|
|
335
|
+
justifyContent: "flex-start",
|
|
336
|
+
paddingBottom: 1
|
|
337
|
+
}
|
|
338
|
+
}) : null,
|
|
339
|
+
y(n, {
|
|
340
|
+
label: Q("numberFormat.category"),
|
|
341
|
+
sx: { marginBottom: .5 },
|
|
342
|
+
children: y(h, {
|
|
343
|
+
outlined: !0,
|
|
344
|
+
disabled: j,
|
|
345
|
+
sx: { width: "100%" },
|
|
346
|
+
renderPopupPanel: (r) => {
|
|
347
|
+
const { closeFloatAll: a } = r, n = A.CATEGORIES.map((r) => {
|
|
348
|
+
const n = r === oe, o = () => {
|
|
349
|
+
((e) => {
|
|
350
|
+
e === oe ? re() : te(e);
|
|
351
|
+
})(r), a?.();
|
|
352
|
+
};
|
|
353
|
+
return y(b, {
|
|
354
|
+
selected: n,
|
|
355
|
+
icon: y(f, {
|
|
356
|
+
selected: n,
|
|
357
|
+
children: n ? void 0 : null
|
|
358
|
+
}),
|
|
359
|
+
sx: { display: "flex" },
|
|
360
|
+
onMouseDown: (e) => {
|
|
361
|
+
0 === e.button && e.preventDefault();
|
|
362
|
+
},
|
|
363
|
+
onMouseUp: (e) => {
|
|
364
|
+
0 === e.button && o();
|
|
365
|
+
},
|
|
366
|
+
onKeyDown: (e) => {
|
|
367
|
+
"Enter" !== e.key && " " !== e.key || o();
|
|
368
|
+
},
|
|
369
|
+
children: y(e, {
|
|
370
|
+
label: t(Q, r),
|
|
371
|
+
sample: (i = r, "Custom" === i && i !== oe ? "" : O(i === oe ? d : A.defaultCodeForCategory(i), z(i, J, Q("numberFormat.sampleText")), J))
|
|
372
|
+
})
|
|
373
|
+
}, r);
|
|
374
|
+
var i;
|
|
375
|
+
});
|
|
376
|
+
return x({
|
|
377
|
+
...r,
|
|
378
|
+
children: y(S, {
|
|
379
|
+
sx: {
|
|
380
|
+
overflow: "auto",
|
|
381
|
+
flex: "1 1 100%"
|
|
382
|
+
},
|
|
383
|
+
children: n
|
|
384
|
+
})
|
|
385
|
+
});
|
|
386
|
+
},
|
|
387
|
+
icon: y(S, {
|
|
388
|
+
sx: {
|
|
389
|
+
display: "flex",
|
|
390
|
+
flex: "1 1 100%",
|
|
391
|
+
minWidth: 0,
|
|
392
|
+
paddingLeft: "4px",
|
|
393
|
+
paddingRight: "4px",
|
|
394
|
+
fontSize: (e) => `${Math.round(e.typography.fontSize)}px`,
|
|
395
|
+
lineHeight: 1.2,
|
|
396
|
+
fontFamily: (e) => e.typography.fontFamily,
|
|
397
|
+
color: (e) => e.palette.text.secondary
|
|
398
|
+
},
|
|
399
|
+
children: y(S, {
|
|
400
|
+
sx: {
|
|
401
|
+
overflow: "hidden",
|
|
402
|
+
textOverflow: "ellipsis",
|
|
403
|
+
whiteSpace: "pre"
|
|
404
|
+
},
|
|
405
|
+
children: t(Q, oe)
|
|
406
|
+
})
|
|
407
|
+
})
|
|
408
|
+
})
|
|
409
|
+
}),
|
|
410
|
+
y(S, {
|
|
411
|
+
sx: {
|
|
412
|
+
display: "flex",
|
|
413
|
+
flexDirection: "column",
|
|
414
|
+
gap: 1.25,
|
|
415
|
+
flex: "1 1 auto",
|
|
416
|
+
minWidth: 0,
|
|
417
|
+
minHeight: 0
|
|
418
|
+
},
|
|
419
|
+
children: fe
|
|
420
|
+
})
|
|
421
|
+
]
|
|
422
|
+
});
|
|
423
|
+
}));
|
|
424
|
+
V.displayName = "NumberFormatPanel";
|
|
425
|
+
export { V as t };
|