@sheetxl/studio-mui 0.8.0-beta.14 → 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.
Files changed (120) hide show
  1. package/LICENSE.md +17 -7
  2. package/browser/esm/{DviYEVpPnQaWx-Tr.mjs → 2DGUEeY8au7Hbmze.mjs} +2 -2
  3. package/browser/esm/{D5ASCLEncVX6S3t7.mjs → 9V0gwYl3BcajPwBD.mjs} +2 -2
  4. package/browser/esm/B0mscuFChIInl6Mo.mjs +119 -0
  5. package/browser/esm/{cMMnySiLwLtz8_Zk.mjs → BGg5TSbhaUimavRf.mjs} +7 -7
  6. package/browser/esm/BL-h4RElQAdaeHPF.mjs +360 -0
  7. package/browser/esm/{XkkwDAFA6f5msXE4.mjs → BSrubs5qLEinR8Ew.mjs} +92 -87
  8. package/browser/esm/BUCQPr09aodgC88P.mjs +225 -0
  9. package/browser/esm/{BJn4i5eSKttOM7Va.mjs → Bg6bcIJsute7rxDL.mjs} +3 -3
  10. package/browser/esm/{b6OpGIOfqvVgPkpN.mjs → BjR7L3X6je3fXyQi.mjs} +2 -2
  11. package/browser/esm/{Cm7gnL7wtPzU7kH9.mjs → Bo_18UwXk7eK6QaM.mjs} +3 -3
  12. package/browser/esm/{C4-74xZS6PXqeP2-.mjs → Bp4rtdIKIFzTeJvr.mjs} +13 -9
  13. package/browser/esm/BxneVAXjYuQbCUQo.mjs +424 -0
  14. package/browser/esm/{BhurfBABcwf3sq1Y.mjs → C2V3kv29foh8dScC.mjs} +2 -2
  15. package/browser/esm/{4meV2QrzGwOTw-Wg.mjs → C8M4U_SswTd6auZd.mjs} +4 -4
  16. package/browser/esm/{DydtA0Kx0EIVeRVq.mjs → C9XRjC0yoGvS9Cm9.mjs} +3 -3
  17. package/browser/esm/{D1METLVOmQUWB2GY.mjs → CDgoQhayiKyo-7Br.mjs} +34 -33
  18. package/browser/esm/{DJytYYs6hwKzoGdK.mjs → CLgar8cakFC22X3w.mjs} +2 -2
  19. package/browser/esm/{DSMZVJXRlgHj6hnF.mjs → CUh56URLD9Vh5Ak9.mjs} +1807 -1200
  20. package/browser/esm/{D7SHK5F4crIKlHfX.mjs → CXgBRmauwDvHb3fQ.mjs} +2 -2
  21. package/browser/esm/{CM5uH7kPI6bp0Ynb.mjs → CYOaHHiaC7Ip5VLn.mjs} +2 -2
  22. package/browser/esm/C_qDBCzb8IHBlPhJ.mjs +294 -0
  23. package/browser/esm/{CouH7NfOLzq-7BFG.mjs → CfsYKmwU44jlvh2Y.mjs} +2 -2
  24. package/browser/esm/Ch1y4AkETfKCYDwf.mjs +106 -0
  25. package/browser/esm/{C7G22BSOh6ahi_YA.mjs → CnId_LC0EekuwaAF.mjs} +3 -3
  26. package/browser/esm/{DUMfNkupQUkMYbRX.mjs → CtVSJjciTocAi-ph.mjs} +3 -3
  27. package/browser/esm/{BSgsK2ctkA7acJ8B.mjs → CuQsEoKZJrSL989Q.mjs} +6 -6
  28. package/browser/esm/{B65gFGIGbaB2HJ7S.mjs → Cv99zJfRtzJQmM9a.mjs} +2 -2
  29. package/browser/esm/{9wRFUyQKqfHCPUiS.mjs → Cxk-oWZzE2jq5ul6.mjs} +3 -3
  30. package/browser/esm/{B0u4XScttbCbHUuj.mjs → D3XdTSymYMag6tor.mjs} +6 -6
  31. package/browser/esm/{BLWzmTXqRJp_rp2R.mjs → D4jGaUxHOgVc4qN0.mjs} +3 -3
  32. package/browser/esm/{D5ioZQTn_SJateKf.mjs → DAdhaGB933dfni3E.mjs} +3 -3
  33. package/browser/esm/{DYKsNTXsl78btQCN.mjs → DBx1Y3oFzB6gv-LQ.mjs} +3 -3
  34. package/browser/esm/{DROcTh8qOW1i6ktd.mjs → DIAnBUXPTvYAp5fm.mjs} +3 -3
  35. package/browser/esm/{CQmRcbXzQ2ZnzWkm.mjs → DIJh9jY37iVFn-tE.mjs} +2 -2
  36. package/browser/esm/{DC70OHr0cJy33grZ.mjs → DK1K-M9iJV-DK3lK.mjs} +2 -2
  37. package/browser/esm/{ATDkpSD6QYiZqoUd.mjs → DMhFcJsnKSKTDivl.mjs} +2 -2
  38. package/browser/esm/{C4UBegw-DrnYEN3U.mjs → DMj9kkIWw9chI5_u.mjs} +5 -5
  39. package/browser/esm/DUpW8HMoEhD3C9l6.mjs +235 -0
  40. package/browser/esm/{IF6KtCM-Yj_9GGEI.mjs → DVJ5AK0zcqSACGov.mjs} +9 -9
  41. package/browser/esm/{TJm3V2B1CMw1iZoU.mjs → DVaykBKx4eEsP4MI.mjs} +4 -4
  42. package/browser/esm/{Dh1o7OIOvCQaeaVN.mjs → Dex65RXS_A5CnMg3.mjs} +3 -3
  43. package/browser/esm/{DcF7yoU5XaD0TzDi.mjs → DfYtGsqDIMAG4Sp8.mjs} +2 -2
  44. package/browser/esm/{B2NGlVfdWvs2G_Fq.mjs → Dj0VEFe2ckEWgQjy.mjs} +5 -5
  45. package/browser/esm/{CSjn0SmASZfMzjJD.mjs → DjCDJhBfVI9O_Sq1.mjs} +6 -6
  46. package/browser/esm/DjjmLQLxU_U4JB3n.mjs +973 -0
  47. package/browser/esm/{dcZCjUD2UCAzFGTB.mjs → DmOrKFaiUUr5hlFl.mjs} +5 -4
  48. package/browser/esm/{BnRqW8S8uRFT1dsa.mjs → DoYSmj1LQHAAqt5b.mjs} +2 -2
  49. package/browser/esm/{DEu_fNm5LXqXGUqI.mjs → KhOxaZS8EeSaYFXZ.mjs} +2 -2
  50. package/browser/esm/{CqAaow0-s9wI-Zco.mjs → PvNtCGveCLbLAP3e.mjs} +14 -14
  51. package/browser/esm/{DGGNjWCfZChvgtCJ.mjs → ROOxAZY7YyHDmPcQ.mjs} +4 -4
  52. package/browser/esm/{C85QGz19eE9ggqzR.mjs → TfUaejwwWzu5qFVE.mjs} +3 -3
  53. package/browser/esm/{CeYt9oGNq5J48kA8.mjs → ZhI7zxDSTWb1DfaE.mjs} +3 -3
  54. package/browser/esm/{BPEGlembHUmOukt-.mjs → fqZt7Z0jR4illVKU.mjs} +5 -5
  55. package/browser/esm/index.mjs +278 -277
  56. package/browser/esm/{7GvHfNWduigxqNjI.mjs → r7bLyFzJfaGLKP_7.mjs} +2 -2
  57. package/browser/esm/{DGsTOxJVdwIgmFiF.mjs → tffjGixzP1Ze4DqB.mjs} +3 -3
  58. package/browser/esm/{CQ6F1l897Rr74YXa.mjs → tiC8hseLz66gO5BS.mjs} +804 -713
  59. package/licenses/dependencies.txt +33 -33
  60. package/node/esm/{CnHJuuebdiYB4hU1.mjs → -Il_piuBrbndDROB.mjs} +2 -2
  61. package/node/esm/0cm_0VYweOBWmzi7.mjs +972 -0
  62. package/node/esm/{Ua-hzH0IDC5UU7I1.mjs → 1gdwmt5CrQy4cGTH.mjs} +2 -2
  63. package/node/esm/{BXq4h4T2V5D0e0GE.mjs → 3Geel3fylTwbPuxf.mjs} +2 -2
  64. package/node/esm/{BPbOKZTCABQS1v4l.mjs → 4pRKBhUYhbbE6qVT.mjs} +2 -2
  65. package/node/esm/{DV7GtbZngmzKJkGC.mjs → 9qIZWfzxSaxNk6Cm.mjs} +16 -15
  66. package/node/esm/B9uLfbf5gMGnoUjH.mjs +224 -0
  67. package/node/esm/{C2ZhJJ6JogM32N6v.mjs → BFO2WxwRNbu-UmKe.mjs} +3 -3
  68. package/node/esm/{DrZYqa9k2cas_dpR.mjs → BIJXqUbAalnd-gXD.mjs} +2 -2
  69. package/node/esm/{DLa2dwTHx-TF9X28.mjs → BIviFvkWx6eP4dMd.mjs} +12 -12
  70. package/node/esm/{By9Y6KcwsjQGiP4W.mjs → BTOCej61y3MazK6r.mjs} +2 -2
  71. package/node/esm/{DNhFkzvStZYjYqlY.mjs → BV9hUarSGd3mWC8o.mjs} +3 -3
  72. package/node/esm/{ChAnZ_8BZXB8xGku.mjs → BX1cTEV3SpcqLcXx.mjs} +81 -80
  73. package/node/esm/{DINEK8QwAC2xbcJg.mjs → BZu-8gEXwIzW_YX9.mjs} +2 -2
  74. package/node/esm/{Dua4HsVMCVMOSuUP.mjs → B_jOG6MlKoiboP3D.mjs} +3 -3
  75. package/node/esm/{a4ksKvzRiZRS-LjD.mjs → BgObBW8ZUr50OufC.mjs} +8 -8
  76. package/node/esm/{BIbJ-RvwV7EKR1AK.mjs → BhiuBl2z87xThV1b.mjs} +2 -2
  77. package/node/esm/{Cv_gkzf1CvleEpGx.mjs → Bm054Lh36PSa5m1P.mjs} +2 -2
  78. package/node/esm/BtxNP8JWe16vSXAs.mjs +106 -0
  79. package/node/esm/BzT_zks-KORaryRo.mjs +118 -0
  80. package/node/esm/{DfRwTR3tR0Wx5I0U.mjs → C5dRM0ExMHpFgKd0.mjs} +3 -3
  81. package/node/esm/{DKJDmlxmNG0mVHmb.mjs → CQxu_KONf2yyKKnD.mjs} +2 -2
  82. package/node/esm/{D9neYUsRInmBz-7P.mjs → CdoFRzEug2L0LwNb.mjs} +7 -7
  83. package/node/esm/{Hp0ggyjuRLoV7Zkw.mjs → Ch7Ebxf0bFrlCJpW.mjs} +2 -2
  84. package/node/esm/{GkXvPmel2BbE1Yvo.mjs → CsQTJ4JQRxLcJDiZ.mjs} +2 -2
  85. package/node/esm/{D1RBCi056McbAuVe.mjs → CyKOmz26TaZSFxmi.mjs} +3 -3
  86. package/node/esm/D3TsBlOewIFj-VDW.mjs +294 -0
  87. package/node/esm/{rSq-rFZ2oBrx0daL.mjs → D4TlOO7hjvqTR2HX.mjs} +3 -3
  88. package/node/esm/{CLArZpAFWoKR9UXC.mjs → DYNM5HfUK0JbGHsx.mjs} +2 -2
  89. package/node/esm/{B74EJtfb07jNPG2i.mjs → DhPNzztIuq9WJwCz.mjs} +3 -3
  90. package/node/esm/{CMsWjZqAF2n3PniO.mjs → cl-bDkq8M4STBYJy.mjs} +2 -2
  91. package/node/esm/fazR-cWd-2-W82Nk.mjs +425 -0
  92. package/node/esm/index.mjs +3391 -2778
  93. package/node/esm/{CzQvRTTBIzvSAQWs.mjs → iyOc5Rm5x746Qd3R.mjs} +2 -2
  94. package/node/esm/{D3BoGAsVExHN5pzo.mjs → klLaIOeBuqaYuz_q.mjs} +2 -2
  95. package/node/esm/{0TWX9zLKXvPj1qMo.mjs → mmzQ-lse6yBavXnw.mjs} +603 -514
  96. package/node/esm/{C29ReEXb9EK4DP6E.mjs → rpHmm4X81z1orjHr.mjs} +3 -3
  97. package/node/esm/{Y0a0MfNj9jzVeoRQ.mjs → tRnEFhRlzQPziQif.mjs} +2 -2
  98. package/package.json +10 -10
  99. package/resources/locales/de/groups.cmd.json +3 -0
  100. package/resources/locales/de/ui.msg.json +41 -0
  101. package/resources/locales/en/groups.cmd.json +3 -0
  102. package/resources/locales/en/ui.msg.json +41 -0
  103. package/types/src/command/PresetPivotStylesCommandButton.d.ts +17 -0
  104. package/types/src/command/index.d.ts +1 -0
  105. package/types/src/dialog/PivotTableNewDialog.d.ts +11 -0
  106. package/types/src/filter/PivotMenu.d.ts +31 -0
  107. package/types/src/filter/index.d.ts +1 -0
  108. package/types/src/pivot/PivotChipMenu.d.ts +10 -0
  109. package/types/src/pivot/PivotPlugin.d.ts +3 -0
  110. package/types/src/pivot/PivotStyleCanvasPreview.d.ts +23 -0
  111. package/types/src/pivot/PivotTableHeader.d.ts +12 -0
  112. package/types/src/pivot/PivotValueSettingsDialog.d.ts +15 -0
  113. package/types/src/pivot/_pivotSource.d.ts +7 -0
  114. package/types/src/table/_drawStyleSwatch.d.ts +25 -0
  115. package/types/src/workbook/DefaultRenderers.d.ts +10 -4
  116. package/browser/esm/BJPuzqf8wzAaSBCD.mjs +0 -1379
  117. package/browser/esm/CUBCWkB6A5HH4u5Q.mjs +0 -319
  118. package/browser/esm/DKnuzGrJHk4qI0Zi.mjs +0 -582
  119. package/node/esm/BbCPG2xTU1rpAM5l.mjs +0 -318
  120. package/node/esm/DtxnTVIKKE8mp6rU.mjs +0 -1379
@@ -1,582 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.14
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 { r as e } from "./4meV2QrzGwOTw-Wg.mjs";
8
- import { t } from "./ATDkpSD6QYiZqoUd.mjs";
9
- import { Color as n, FontUtils as r, IFontCollection as i, NumberFormat as a } from "@sheetxl/sdk";
10
- import { useGridColorScheme as o } from "@sheetxl/react";
11
- import { CommandButtonType as s, DynamicIcon as c, KeyCodes as l, measureUIText as u, themeSurfaceProps as d, useCallbackRef as f, useCommands as p, useLanguage as m, useTextSelectionDrag as h, useTranslator as g } from "@sheetxl/utils-react";
12
- import { forwardRef as _, memo as v, useCallback as y, useEffect as b, useMemo as x, useState as S } from "react";
13
- import { CommandButton as C, CommandPopupButton as w, CommandTooltip as T, ExhibitDivider as E, ExhibitMenuItem as D, ExhibitPopupIconButton as O, ExhibitTooltip as k, PopupButtonType as A, SelectedIcon as j, defaultRenderPopupPanel as M } from "@sheetxl/utils-mui";
14
- import { jsx as N, jsxs as P } from "react/jsx-runtime";
15
- import { Box as F, IconButton as I, Input as L, Typography as R, useTheme as z } from "@mui/material";
16
- import { alpha as B } from "@mui/system";
17
- var V = v(_((e, n) => {
18
- let { commandKey: i, showQuickButtons: a, fontSizes: o = r.DefaultFontSizes, disabled: s, icon: c, label: d, sx: m, ...g } = e, [_] = p([i ?? ""]), v = () => _?.getState()?.toString() || "11", [w, T] = S(v), A = f(() => {
19
- let e = parseFloat(w);
20
- isNaN(e) ? T(v()) : parseFloat(v()) !== e && _?.execute(e);
21
- }, [
22
- v,
23
- _,
24
- w
25
- ]);
26
- b(() => {
27
- T(v());
28
- }, [_?.getState()]);
29
- let R = ["formatFontSizeIncrease", "formatFontSizeDecrease"], B = x(() => R ? P(F, {
30
- className: t("quick-buttons", {}),
31
- sx: {
32
- display: "flex",
33
- alignItems: "center",
34
- justifyContent: "center"
35
- },
36
- children: [N(C, { commandKey: R[0] }), N(C, { commandKey: R[1] })]
37
- }) : null, [R]), V = z(), H = x(() => `${u("12.3", {
38
- size: Math.round(V.typography.fontSize),
39
- family: V.typography.fontFamily ?? ""
40
- })}px`, [V]), U = s ?? (!_ || _.disabled()), W = h(), G = y((e) => {
41
- let { onMouseDown: t, onMouseUp: n, ...r } = e;
42
- return N(I, {
43
- component: "div",
44
- ...r,
45
- disableRipple: !0,
46
- children: N(L, {
47
- inputMode: "numeric",
48
- disabled: s || !_ || _.disabled(),
49
- inputProps: {
50
- name: "font-input",
51
- autoComplete: "off",
52
- onPointerDown: W.onPointerDown,
53
- onDragStart: W.onDragStart,
54
- tabIndex: 0,
55
- type: "number",
56
- maxLength: 4,
57
- max: 409,
58
- min: 2
59
- },
60
- sx: {
61
- "&::before": { borderBottom: "1px solid transparent" },
62
- "&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before": { borderBottom: (e) => `1px solid ${e.palette.text.icon ?? e.palette.action.active}` },
63
- "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (e) => `1px solid ${e.palette.error.main}` },
64
- "::after": { borderBottom: (e) => `1px solid ${e.palette.primary.main}` },
65
- paddingTop: "0px",
66
- paddingBottom: "0px",
67
- paddingLeft: "0px",
68
- paddingRight: "0px",
69
- fontSize: (e) => `${Math.round(e.typography.fontSize)}px`,
70
- width: H,
71
- color: (e) => e.palette.text.secondary,
72
- input: {
73
- padding: "0 0",
74
- textAlign: "center",
75
- height: "1rem",
76
- MozAppearance: "textfield",
77
- "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (e) => e.palette.text.primary },
78
- "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (e) => e.palette.text.primary }
79
- },
80
- "input::-webkit-inner-spin-button": {
81
- WebkitAppearance: "none",
82
- margin: "0"
83
- }
84
- },
85
- value: w,
86
- onFocus: (e) => {
87
- e.target?.select();
88
- },
89
- onKeyDown: (e) => {
90
- if (e.which === l.Enter) v() !== w && (e.stopPropagation(), e.preventDefault(), A());
91
- else if (e.which === l.Escape) v() !== w && (T(v()), setTimeout(() => {
92
- e.target?.select();
93
- }, 0), e.stopPropagation(), e.preventDefault());
94
- else {
95
- if (e.key.match("[-]") || e.key.match("[0-9.]") && (w + e.key).length > 4) return e.stopPropagation(), void e.preventDefault();
96
- if (e.which === l.Space) return void e.preventDefault();
97
- }
98
- },
99
- onBlur: () => {
100
- A();
101
- },
102
- onChange: (e) => {
103
- if (e.target.value.length > 4) return e.stopPropagation(), void e.preventDefault();
104
- T(e.target.value);
105
- }
106
- })
107
- });
108
- }, [
109
- w,
110
- U,
111
- _,
112
- W
113
- ]), K = y((e) => {
114
- let t = (e) => {
115
- _?.execute(e);
116
- }, n = _?.getState(), r = [];
117
- for (let e = 0; e < o.length; e++) {
118
- let i = o[e] === n;
119
- r.push(N(D, {
120
- selected: i,
121
- icon: i ? N(j, {}) : void 0,
122
- disabled: s || !_ || _.disabled(),
123
- onMouseDown: (e) => {
124
- e.button === 0 && e.preventDefault();
125
- },
126
- onMouseUp: (n) => {
127
- n.button === 0 && t(o[e]);
128
- },
129
- onKeyDown: (n) => {
130
- n.keyCode !== l.Enter && n.keyCode !== l.Space || t(o[e]);
131
- },
132
- sx: {
133
- paddingTop: "4px",
134
- paddingBottom: "4px"
135
- },
136
- children: N(F, {
137
- sx: {
138
- display: "flex",
139
- flex: "1 1 100%",
140
- justifyContent: "end"
141
- },
142
- children: o[e]
143
- })
144
- }, "fontSize-" + e));
145
- }
146
- let i = P(F, {
147
- sx: {
148
- display: "flex",
149
- flexDirection: "column",
150
- flex: "1 1 100%",
151
- overflow: "hidden"
152
- },
153
- ...g,
154
- children: [
155
- B,
156
- N(E, { orientation: "horizontal" }),
157
- N(F, {
158
- sx: {
159
- overflow: "auto",
160
- flex: "1 1 100%"
161
- },
162
- children: r
163
- })
164
- ]
165
- });
166
- return M({
167
- ...e,
168
- children: i
169
- });
170
- }, [U, _]);
171
- return N(O, {
172
- ref: n,
173
- sx: { ...m },
174
- tabIndex: -1,
175
- outlined: !0,
176
- disabled: U,
177
- renderPopupPanel: K,
178
- renderTooltip: ({ children: e, disabled: t }) => N(k, {
179
- label: _?.getLabel(),
180
- description: _?.getDescription(),
181
- disabled: t || _?.disabled(),
182
- children: e
183
- }),
184
- renderQuickButton: G,
185
- ...g
186
- });
187
- })), H = v((e) => {
188
- let { label: t, sample: n, sx: r, ...i } = e, a = !!n && n.length > 0;
189
- return P(F, {
190
- sx: {
191
- display: "flex",
192
- flex: "1 1 100%",
193
- flexDirection: "column",
194
- overflow: "hidden",
195
- "*": { lineHeight: "1.4" },
196
- ...r
197
- },
198
- ...i,
199
- children: [N(R, {
200
- component: "div",
201
- children: t
202
- }), N(R, {
203
- variant: "caption",
204
- component: "div",
205
- sx: {
206
- color: (e) => B(e.palette.text.primary, .6),
207
- paddingTop: a ? "1px" : void 0,
208
- overflow: "hidden",
209
- textOverflow: "ellipsis"
210
- },
211
- children: a ? n : " "
212
- })]
213
- });
214
- });
215
- H.displayName = "NumberFormatOption";
216
- var U = (e, t) => {
217
- switch (t) {
218
- case a.Type.General: return e("numberFormat.catGeneral");
219
- case a.Type.Number: return e("numberFormat.catNumber");
220
- case a.Type.Currency: return e("numberFormat.catCurrency");
221
- case a.Type.Accounting: return e("numberFormat.catAccounting");
222
- case a.Type.ShortDate: return e("numberFormat.typeShortDate");
223
- case a.Type.MediumDate: return e("numberFormat.typeMediumDate");
224
- case a.Type.LongDate: return e("numberFormat.typeLongDate");
225
- case a.Type.ShortTime: return e("numberFormat.typeShortTime");
226
- case a.Type.MediumTime: return e("numberFormat.typeMediumTime");
227
- case a.Type.LongTime: return e("numberFormat.typeLongTime");
228
- case a.Type.Comma: return e("numberFormat.typeComma");
229
- case a.Type.Percentage: return e("numberFormat.catPercentage");
230
- case a.Type.Fraction: return e("numberFormat.catFraction");
231
- case a.Type.Scientific: return e("numberFormat.catScientific");
232
- case a.Type.Text: return e("numberFormat.catText");
233
- case a.Type.Special: return e("numberFormat.catSpecial");
234
- case a.Type.Custom: return e("numberFormat.catCustom");
235
- default: return t;
236
- }
237
- }, W = (e, t) => {
238
- switch (t) {
239
- case "General": return e("numberFormat.catGeneral");
240
- case "Number": return e("numberFormat.catNumber");
241
- case "Currency": return e("numberFormat.catCurrency");
242
- case "Accounting": return e("numberFormat.catAccounting");
243
- case "Date": return e("numberFormat.catDate");
244
- case "Time": return e("numberFormat.catTime");
245
- case "Percentage": return e("numberFormat.catPercentage");
246
- case "Fraction": return e("numberFormat.catFraction");
247
- case "Scientific": return e("numberFormat.catScientific");
248
- case "Text": return e("numberFormat.catText");
249
- case "Special": return e("numberFormat.catSpecial");
250
- case "Custom": return e("numberFormat.catCustom");
251
- default: return t;
252
- }
253
- }, { Builder: G } = a, K = /* @__PURE__ */ "USD.EUR.JPY.GBP.CNY.AUD.CAD.CHF.HKD.SGD.SEK.NOK.DKK.NZD.KRW.INR.BRL.RUB.ZAR.MXN.TRY.PLN.THB.IDR.ILS.AED.SAR.CZK.HUF.PHP.MYR.TWD".split("."), q = v(_((e, t) => {
254
- let { sx: n, disabled: r, groupKey: i, ...a } = e, o = g(), s = m(), [u] = p(["formatNumberFormatAccountingStyle"]), d = r ?? (!u || u.disabled()), f = y((e) => {
255
- let t = (t) => {
256
- e.closeFloat?.(), u?.execute(t ?? void 0);
257
- }, n = (e) => ({
258
- disabled: d,
259
- sx: {
260
- display: "flex",
261
- paddingTop: "4px",
262
- paddingBottom: "4px",
263
- flex: "none"
264
- },
265
- onMouseUp: (t) => {
266
- t.button === 0 && e();
267
- },
268
- onMouseDown: (e) => {
269
- e.button === 0 && e.preventDefault();
270
- },
271
- onKeyDown: (t) => {
272
- t.keyCode !== l.Enter && t.keyCode !== l.Space || e();
273
- }
274
- }), r = (e) => N(F, {
275
- sx: {
276
- display: "flex",
277
- flex: "1 1 100%",
278
- flexDirection: "column",
279
- overflow: "hidden"
280
- },
281
- children: N(R, {
282
- component: "div",
283
- sx: {
284
- whiteSpace: "nowrap",
285
- overflow: "hidden",
286
- textOverflow: "ellipsis"
287
- },
288
- children: e
289
- })
290
- }), i = [...K].sort((e, t) => J(e, s).localeCompare(J(t, s))).map((e) => {
291
- let i = function(e) {
292
- try {
293
- return new Intl.NumberFormat("en", {
294
- style: "currency",
295
- currency: e,
296
- currencyDisplay: "narrowSymbol"
297
- }).formatToParts(0).find((e) => e.type === "currency")?.value ?? e;
298
- } catch {
299
- return e;
300
- }
301
- }(e);
302
- return N(D, {
303
- ...n(() => t(function(e) {
304
- let t = G.parse(G.defaultCodeForCategory("Accounting"));
305
- return G.build({
306
- ...t,
307
- currencySymbol: e
308
- });
309
- }(i))),
310
- children: r(`${i} ${J(e, s)} (${e})`)
311
- }, e);
312
- });
313
- return M({
314
- ...e,
315
- children: P(F, {
316
- sx: {
317
- display: "flex",
318
- flexDirection: "column",
319
- flex: "1 1 100%",
320
- overflow: "hidden"
321
- },
322
- children: [P(F, {
323
- sx: { flex: "none" },
324
- children: [N(D, {
325
- ...n(() => t()),
326
- children: r(o("numberFormat.accountingDefault"))
327
- }, "default-currency"), N(E, { orientation: "horizontal" })]
328
- }), N(F, {
329
- sx: {
330
- overflow: "auto",
331
- flex: "1 1 100%"
332
- },
333
- children: i
334
- })]
335
- })
336
- });
337
- }, [
338
- u,
339
- d,
340
- o,
341
- s
342
- ]);
343
- return N(w, {
344
- ref: t,
345
- sx: { ...n },
346
- disabled: d,
347
- quickCommand: "formatNumberFormatAccountingStyle",
348
- renderPopupPanel: f,
349
- renderTooltip: ({ children: e, disabled: t }) => N(k, {
350
- label: u?.getLabel?.(i),
351
- description: u?.getDescription?.(i),
352
- disabled: t,
353
- children: e
354
- }),
355
- icon: N(c, { iconKey: "CurrencyDollar" }),
356
- label: u?.getLabel?.(i),
357
- ...a
358
- });
359
- }));
360
- function J(e, t) {
361
- try {
362
- return new Intl.DisplayNames([t ?? "en"], { type: "currency" }).of(e) ?? e;
363
- } catch {
364
- return e;
365
- }
366
- }
367
- var Y = "numberFormatOptions", X = v(_((e, t) => {
368
- let { groupKey: n = Y, disabled: r, sx: i, ...a } = e;
369
- return P(F, {
370
- ref: t,
371
- className: "quick-buttons",
372
- sx: {
373
- display: "flex",
374
- alignItems: "center",
375
- justifyContent: "center",
376
- ...i
377
- },
378
- ...a,
379
- children: [
380
- N(q, {
381
- groupKey: n,
382
- disabled: r
383
- }),
384
- N(C, {
385
- commandKey: "formatNumberFormatPercentStyle",
386
- groupKey: n,
387
- disabled: r
388
- }),
389
- N(C, {
390
- commandKey: "formatNumberFormatCommaStyle",
391
- groupKey: n,
392
- disabled: r
393
- }),
394
- N(C, {
395
- commandKey: "formatNumberFormatIncreaseDecimal",
396
- groupKey: n,
397
- disabled: r
398
- }),
399
- N(C, {
400
- commandKey: "formatNumberFormatDecreaseDecimal",
401
- groupKey: n,
402
- disabled: r
403
- })
404
- ]
405
- });
406
- }));
407
- X.displayName = "NumberFormatQuickButtons";
408
- var Z = v(_((t, r) => {
409
- let { commandKey: i, onSelectColor: a, disabled: c, variant: l = s.Toolbar, quickColor: u, propsPanel: m, isSplit: h = !1, darkMode: g, icon: _, ...v } = t, { autoColor: b, schemeLookup: S, recentColors: C, ...w } = m ?? {};
410
- if (v.selectedColor) throw Error("Command selectedColor will be used. Do not try to provide one as a direct argument");
411
- let [E] = p([i ?? ""]), D = E?.getContext(), O = u ?? D?.quickColor;
412
- h && !O && (O = new n("transparent"));
413
- let k = b === void 0 ? D?.autoColor : b, j = S ?? D?.schemeLookup, M = C ?? D?.recentColors, P = o(), F = g ?? P === "dark", I = x(() => ({
414
- autoColor: k,
415
- schemeLookup: j,
416
- recentColors: M,
417
- darkMode: F,
418
- ...d("grid", F ? "dark" : "light"),
419
- ...w
420
- }), [
421
- k,
422
- j,
423
- M,
424
- F
425
- ]), L = f((e, t) => {
426
- e && t && D?.addRecentColor && D.addRecentColor(e), D?.onColorSelect && D.onColorSelect(e), a?.(e, t), E?.execute(e);
427
- }, [
428
- E,
429
- a,
430
- D
431
- ]), R = y((e) => {
432
- let { disabled: t, children: n, title: r, ...a } = e, o = e.children;
433
- return (E?.disabled() || c) && (o = N("div", { children: o })), N(T, {
434
- commandKey: i,
435
- placement: l === s.Toolbar ? "bottom-start" : "right-start",
436
- disabled: t,
437
- ...a,
438
- children: o
439
- });
440
- }, [E, c]);
441
- return N(e, {
442
- ref: r,
443
- propsPanel: I,
444
- icon: _ ?? E?.getIcon(),
445
- quickColor: O,
446
- selectedColor: E?.getState(),
447
- onSelectColor: L,
448
- variant: l === s.Menuitem ? A.Menuitem : A.Toolbar,
449
- renderTooltip: R,
450
- label: E?.getLabel(),
451
- disabled: c ?? (!E || E.disabled()),
452
- compareRGB: !0,
453
- darkMode: F,
454
- ...v
455
- });
456
- }));
457
- Z.displayName = "ColorCommandButton";
458
- var Q = v(_((e, t) => {
459
- let { commandKey: n, sx: r, disabled: a, icon: o, label: s, ...c } = e, [d] = p([n]), f = d?.getState(), m = z(), h = x(() => `${u("Times New Roman", {
460
- size: Math.round(m.typography.fontSize),
461
- family: m.typography.fontFamily ?? ""
462
- })}px`, [m]), g = a ?? (!d || d.disabled()), _ = y((e) => {
463
- let t = (e) => {
464
- d?.execute(e);
465
- }, n = i.getShared().getFontList(), r = [];
466
- for (let e = 0; e < n.length; e++) {
467
- let t = n[e].fontRef;
468
- if (!t) continue;
469
- let i = t.getFamily();
470
- r.push({
471
- key: i,
472
- description: i
473
- });
474
- }
475
- r.some((e) => e.key === f) || r.unshift({
476
- key: f,
477
- description: f
478
- });
479
- let o = [], s = r.length;
480
- for (let e = 0; e < s; e++) {
481
- let n = r[e];
482
- if (!n) continue;
483
- let i = n.key, s = n.key === f;
484
- o.push(N(D, {
485
- sx: {
486
- display: "flex",
487
- paddingTop: "4px",
488
- paddingBottom: "4px"
489
- },
490
- selected: s,
491
- disabled: a || !d || d.disabled(),
492
- icon: s ? N(j, {}) : void 0,
493
- onMouseUp: (e) => {
494
- e.button === 0 && t(i);
495
- },
496
- onMouseDown: (e) => {
497
- e.button === 0 && e.preventDefault();
498
- },
499
- onKeyDown: (e) => {
500
- e.keyCode !== l.Enter && e.keyCode !== l.Space || t(i);
501
- },
502
- children: N(F, {
503
- sx: {
504
- display: "flex",
505
- flex: "1 1 100%",
506
- flexDirection: "column",
507
- overflow: "hidden"
508
- },
509
- children: N(R, {
510
- component: "div",
511
- sx: {
512
- whiteSpace: "nowrap",
513
- overflow: "hidden",
514
- textOverflow: "ellipsis",
515
- fontFamily: () => i
516
- },
517
- children: r[e].description
518
- })
519
- })
520
- }, e + "" + i));
521
- }
522
- let u = N(F, {
523
- sx: {
524
- display: "flex",
525
- flexDirection: "column",
526
- flex: "1 1 100%"
527
- },
528
- ...c,
529
- children: N(F, {
530
- sx: {
531
- overflow: "auto",
532
- flex: "1 1 100%"
533
- },
534
- children: o
535
- })
536
- });
537
- return M({
538
- ...e,
539
- children: u
540
- });
541
- }, [
542
- g,
543
- d,
544
- f
545
- ]);
546
- return N(O, {
547
- ref: t,
548
- sx: { ...r },
549
- outlined: !0,
550
- disabled: g,
551
- renderPopupPanel: _,
552
- renderTooltip: ({ children: e, disabled: t }) => N(k, {
553
- label: d?.getLabel(),
554
- description: d?.getDescription(),
555
- disabled: t,
556
- children: e
557
- }),
558
- icon: N(F, {
559
- sx: {
560
- display: "flex",
561
- paddingLeft: "4px",
562
- paddingRight: "4px",
563
- fontSize: (e) => `${Math.round(e.typography.fontSize)}px`,
564
- lineHeight: 1.2,
565
- fontFamily: (e) => e.typography.fontFamily,
566
- color: (e) => e.palette.text.secondary,
567
- flex: "1 1 auto",
568
- width: h
569
- },
570
- children: N(F, {
571
- sx: {
572
- overflow: "hidden",
573
- textOverflow: "ellipsis",
574
- whiteSpace: "pre"
575
- },
576
- children: f
577
- })
578
- }),
579
- ...c
580
- });
581
- }));
582
- export { H as a, V as c, X as i, Z as n, W as o, Y as r, U as s, Q as t };