@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.
Files changed (119) hide show
  1. package/LICENSE.md +17 -7
  2. package/browser/esm/{CJWnWqGPw17cp9P3.mjs → 2DGUEeY8au7Hbmze.mjs} +2 -2
  3. package/browser/esm/{OmA1ClZ36ZMFrZe7.mjs → 9V0gwYl3BcajPwBD.mjs} +2 -2
  4. package/browser/esm/B0mscuFChIInl6Mo.mjs +119 -0
  5. package/browser/esm/{EFtp_C3sBnP3Nrns.mjs → BGg5TSbhaUimavRf.mjs} +7 -7
  6. package/browser/esm/BL-h4RElQAdaeHPF.mjs +360 -0
  7. package/browser/esm/{DOWfcHx0MO0J50de.mjs → BSrubs5qLEinR8Ew.mjs} +92 -87
  8. package/browser/esm/BUCQPr09aodgC88P.mjs +225 -0
  9. package/browser/esm/{BvpzsprI7cmVLuQn.mjs → Bg6bcIJsute7rxDL.mjs} +3 -3
  10. package/browser/esm/{CV-q-xCHVuNFhqEF.mjs → BjR7L3X6je3fXyQi.mjs} +2 -2
  11. package/browser/esm/{DMDi2lOps0veJKsM.mjs → Bo_18UwXk7eK6QaM.mjs} +3 -3
  12. package/browser/esm/{BfPTOOKhwUojRTef.mjs → Bp4rtdIKIFzTeJvr.mjs} +13 -9
  13. package/browser/esm/BxneVAXjYuQbCUQo.mjs +424 -0
  14. package/browser/esm/{BojGnpAWoIm5yCd8.mjs → C2V3kv29foh8dScC.mjs} +2 -2
  15. package/browser/esm/{BkxJY_YjMAEvhmuy.mjs → C8M4U_SswTd6auZd.mjs} +4 -4
  16. package/browser/esm/{BR51amBhaaHPBhpd.mjs → C9XRjC0yoGvS9Cm9.mjs} +3 -3
  17. package/browser/esm/{ghfcAaGu2CuZGdhi.mjs → CDgoQhayiKyo-7Br.mjs} +34 -33
  18. package/browser/esm/{Buzx8_zQYPX4DR7v.mjs → CLgar8cakFC22X3w.mjs} +2 -2
  19. package/browser/esm/{6SL2j-85OXrKJNZ5.mjs → CUh56URLD9Vh5Ak9.mjs} +1807 -1200
  20. package/browser/esm/{DLe9DT0DSurLSgiQ.mjs → CXgBRmauwDvHb3fQ.mjs} +2 -2
  21. package/browser/esm/{Bqba-3J9i8HsmusR.mjs → CYOaHHiaC7Ip5VLn.mjs} +2 -2
  22. package/browser/esm/C_qDBCzb8IHBlPhJ.mjs +294 -0
  23. package/browser/esm/{Cbkg5y4fYjLylYHF.mjs → CfsYKmwU44jlvh2Y.mjs} +2 -2
  24. package/browser/esm/Ch1y4AkETfKCYDwf.mjs +106 -0
  25. package/browser/esm/{By1IJOkvZJSlXs5f.mjs → CnId_LC0EekuwaAF.mjs} +3 -3
  26. package/browser/esm/{BsAoK_t2sn8IHtAO.mjs → CtVSJjciTocAi-ph.mjs} +3 -3
  27. package/browser/esm/{C8tci3dfo5lzeoK-.mjs → CuQsEoKZJrSL989Q.mjs} +6 -6
  28. package/browser/esm/{Cl_OUigCV04_zrRy.mjs → Cv99zJfRtzJQmM9a.mjs} +2 -2
  29. package/browser/esm/{BCDAnHFMvOd9XS8K.mjs → Cxk-oWZzE2jq5ul6.mjs} +3 -3
  30. package/browser/esm/{CcJHwg-rLMcCymSD.mjs → D3XdTSymYMag6tor.mjs} +6 -6
  31. package/browser/esm/{BH4eDAxZdwheO7d_.mjs → D4jGaUxHOgVc4qN0.mjs} +3 -3
  32. package/browser/esm/{BvbN9V67wFhTfq1-.mjs → DAdhaGB933dfni3E.mjs} +3 -3
  33. package/browser/esm/{DpAlQza0e5h3GGHC.mjs → DBx1Y3oFzB6gv-LQ.mjs} +3 -3
  34. package/browser/esm/{DJVpra0HoPH-4P7P.mjs → DIAnBUXPTvYAp5fm.mjs} +3 -3
  35. package/browser/esm/{idh3Y0jksygPSI3A.mjs → DIJh9jY37iVFn-tE.mjs} +2 -2
  36. package/browser/esm/{Ci74yk0whfoAP1TL.mjs → DK1K-M9iJV-DK3lK.mjs} +2 -2
  37. package/browser/esm/{BNas8wZuvrN45dRi.mjs → DMhFcJsnKSKTDivl.mjs} +2 -2
  38. package/browser/esm/{BWdpv2xf6GCyd4Te.mjs → DMj9kkIWw9chI5_u.mjs} +5 -5
  39. package/browser/esm/DUpW8HMoEhD3C9l6.mjs +235 -0
  40. package/browser/esm/{DzATG8XMcG6mmYbx.mjs → DVJ5AK0zcqSACGov.mjs} +9 -9
  41. package/browser/esm/{DYDnkmllpYTwfWir.mjs → DVaykBKx4eEsP4MI.mjs} +4 -4
  42. package/browser/esm/{C67SLDHwhVlVIMo0.mjs → Dex65RXS_A5CnMg3.mjs} +3 -3
  43. package/browser/esm/{BYnzaHXySiV-sc6w.mjs → DfYtGsqDIMAG4Sp8.mjs} +2 -2
  44. package/browser/esm/{IlX2PgLxvyTQu4Fh.mjs → Dj0VEFe2ckEWgQjy.mjs} +5 -5
  45. package/browser/esm/{DKkKac2vbeui2lDy.mjs → DjCDJhBfVI9O_Sq1.mjs} +6 -6
  46. package/browser/esm/DjjmLQLxU_U4JB3n.mjs +973 -0
  47. package/browser/esm/{CutWdrVA-c3x8IkL.mjs → DmOrKFaiUUr5hlFl.mjs} +5 -4
  48. package/browser/esm/{Bvq5aZyp5E79JB-s.mjs → DoYSmj1LQHAAqt5b.mjs} +2 -2
  49. package/browser/esm/{Dz20q7S5vmDWlO0p.mjs → KhOxaZS8EeSaYFXZ.mjs} +2 -2
  50. package/browser/esm/{DAYPqhHN3aQ2StjU.mjs → PvNtCGveCLbLAP3e.mjs} +14 -14
  51. package/browser/esm/{DfI4-5XM6AbILSti.mjs → ROOxAZY7YyHDmPcQ.mjs} +4 -4
  52. package/browser/esm/{DFAphWcDUw-gVtAl.mjs → TfUaejwwWzu5qFVE.mjs} +3 -3
  53. package/browser/esm/{DsM-NpB32hloRRR8.mjs → ZhI7zxDSTWb1DfaE.mjs} +3 -3
  54. package/browser/esm/{DY_EGsyx-zNiJS_0.mjs → fqZt7Z0jR4illVKU.mjs} +5 -5
  55. package/browser/esm/index.mjs +278 -277
  56. package/browser/esm/{OHvsc940xI-m_8cc.mjs → r7bLyFzJfaGLKP_7.mjs} +2 -2
  57. package/browser/esm/{DR9y7k4jB7stGPaZ.mjs → tffjGixzP1Ze4DqB.mjs} +3 -3
  58. package/browser/esm/{D90Bb0GPEwqYkf6R.mjs → tiC8hseLz66gO5BS.mjs} +804 -713
  59. package/node/esm/{-Adgw5-ltK-rfp33.mjs → -Il_piuBrbndDROB.mjs} +2 -2
  60. package/node/esm/0cm_0VYweOBWmzi7.mjs +972 -0
  61. package/node/esm/{CexPhV2NPh5ZGHus.mjs → 1gdwmt5CrQy4cGTH.mjs} +2 -2
  62. package/node/esm/{dUUbrmGMCILl8EOr.mjs → 3Geel3fylTwbPuxf.mjs} +2 -2
  63. package/node/esm/{CFi_Yls-gurU_CX3.mjs → 4pRKBhUYhbbE6qVT.mjs} +2 -2
  64. package/node/esm/{jGsHbOHP90nnx_hJ.mjs → 9qIZWfzxSaxNk6Cm.mjs} +16 -15
  65. package/node/esm/B9uLfbf5gMGnoUjH.mjs +224 -0
  66. package/node/esm/{BxIyViNSP0STSrfA.mjs → BFO2WxwRNbu-UmKe.mjs} +3 -3
  67. package/node/esm/{q2Byx8RdDnHk8YyG.mjs → BIJXqUbAalnd-gXD.mjs} +2 -2
  68. package/node/esm/{C4eVfVm_Omyt6NbE.mjs → BIviFvkWx6eP4dMd.mjs} +12 -12
  69. package/node/esm/{Cx4tBEsm3SjAafcw.mjs → BTOCej61y3MazK6r.mjs} +2 -2
  70. package/node/esm/{5etzEfk-28CCELyT.mjs → BV9hUarSGd3mWC8o.mjs} +3 -3
  71. package/node/esm/{DGtbmp72kfRXLtDu.mjs → BX1cTEV3SpcqLcXx.mjs} +81 -80
  72. package/node/esm/{DOuASwH2Lf83hMLe.mjs → BZu-8gEXwIzW_YX9.mjs} +2 -2
  73. package/node/esm/{CX13ASkhdJ0ZSAY4.mjs → B_jOG6MlKoiboP3D.mjs} +3 -3
  74. package/node/esm/{DwA7rfXJgzoNvjax.mjs → BgObBW8ZUr50OufC.mjs} +8 -8
  75. package/node/esm/{BKCNFVrdc_gTnOoS.mjs → BhiuBl2z87xThV1b.mjs} +2 -2
  76. package/node/esm/{B26ot2vO6Hd47uH0.mjs → Bm054Lh36PSa5m1P.mjs} +2 -2
  77. package/node/esm/BtxNP8JWe16vSXAs.mjs +106 -0
  78. package/node/esm/BzT_zks-KORaryRo.mjs +118 -0
  79. package/node/esm/{Bg3Yu66oJr6mNvAR.mjs → C5dRM0ExMHpFgKd0.mjs} +3 -3
  80. package/node/esm/{BZK6UksX7r-GgRms.mjs → CQxu_KONf2yyKKnD.mjs} +2 -2
  81. package/node/esm/{BaFRVcYZjcLoMQtk.mjs → CdoFRzEug2L0LwNb.mjs} +7 -7
  82. package/node/esm/{DybPyX8U-EqXKarV.mjs → Ch7Ebxf0bFrlCJpW.mjs} +2 -2
  83. package/node/esm/{CzKFdVrPSDYOUdWI.mjs → CsQTJ4JQRxLcJDiZ.mjs} +2 -2
  84. package/node/esm/{BFv2GzY6NjmJggAg.mjs → CyKOmz26TaZSFxmi.mjs} +3 -3
  85. package/node/esm/D3TsBlOewIFj-VDW.mjs +294 -0
  86. package/node/esm/{Ca31PUiJBGowHeob.mjs → D4TlOO7hjvqTR2HX.mjs} +3 -3
  87. package/node/esm/{TgwnKYh-WPxEgmyr.mjs → DYNM5HfUK0JbGHsx.mjs} +2 -2
  88. package/node/esm/{B7vbn_dO_cZnGyGM.mjs → DhPNzztIuq9WJwCz.mjs} +3 -3
  89. package/node/esm/{ISBEql8s7AnELTpd.mjs → cl-bDkq8M4STBYJy.mjs} +2 -2
  90. package/node/esm/fazR-cWd-2-W82Nk.mjs +425 -0
  91. package/node/esm/index.mjs +3391 -2778
  92. package/node/esm/{D9Ga7FFJDOO3Dpfu.mjs → iyOc5Rm5x746Qd3R.mjs} +2 -2
  93. package/node/esm/{CORxK68HpwPUYA6O.mjs → klLaIOeBuqaYuz_q.mjs} +2 -2
  94. package/node/esm/{D_JpopAVQopM26cb.mjs → mmzQ-lse6yBavXnw.mjs} +603 -514
  95. package/node/esm/{CkW8xNdW45Xg7jy7.mjs → rpHmm4X81z1orjHr.mjs} +3 -3
  96. package/node/esm/{HlNuwtpYoOARa894.mjs → tRnEFhRlzQPziQif.mjs} +2 -2
  97. package/package.json +10 -10
  98. package/resources/locales/de/groups.cmd.json +3 -0
  99. package/resources/locales/de/ui.msg.json +41 -0
  100. package/resources/locales/en/groups.cmd.json +3 -0
  101. package/resources/locales/en/ui.msg.json +41 -0
  102. package/types/src/command/PresetPivotStylesCommandButton.d.ts +17 -0
  103. package/types/src/command/index.d.ts +1 -0
  104. package/types/src/dialog/PivotTableNewDialog.d.ts +11 -0
  105. package/types/src/filter/PivotMenu.d.ts +31 -0
  106. package/types/src/filter/index.d.ts +1 -0
  107. package/types/src/pivot/PivotChipMenu.d.ts +10 -0
  108. package/types/src/pivot/PivotPlugin.d.ts +3 -0
  109. package/types/src/pivot/PivotStyleCanvasPreview.d.ts +23 -0
  110. package/types/src/pivot/PivotTableHeader.d.ts +12 -0
  111. package/types/src/pivot/PivotValueSettingsDialog.d.ts +15 -0
  112. package/types/src/pivot/_pivotSource.d.ts +7 -0
  113. package/types/src/table/_drawStyleSwatch.d.ts +25 -0
  114. package/types/src/workbook/DefaultRenderers.d.ts +10 -4
  115. package/browser/esm/C4ir9dn7q0RUoOm_.mjs +0 -319
  116. package/browser/esm/DEUzUShfyJLvgd6_.mjs +0 -1379
  117. package/browser/esm/xe1B8ohea8qfZlFg.mjs +0 -582
  118. package/node/esm/CKtnUYKjsTf7dYKS.mjs +0 -318
  119. package/node/esm/vf5X26EJO7Q1b8Ln.mjs +0 -1379
package/LICENSE.md CHANGED
@@ -1,11 +1,21 @@
1
- # Repository Licensing
1
+ MIT License
2
2
 
3
- SheetXL contains a mix of open-source and commercially licensed packages. Each package is individually licensed and contains its own license file.
3
+ Copyright (c) 2026-present SheetXL Inc. & Michael T. Ford
4
4
 
5
- For the specific terms and conditions applicable to a package, please see the `LICENSE.md` file located in that package's root directory.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
6
11
 
7
- Generally, packages intended for public distribution (such as CLIs, adapters, and vanilla wrappers) are licensed under the MIT license. All other core packages are proprietary and require a commercial license for use.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
8
14
 
9
- For more details on commercial licensing, please visit our website:
10
-
11
- https://www.sheetxl.com/docs/guides/licensing-pricing
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.15
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.16
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
5
+ * License: MIT
6
6
  */
7
7
  import { ScalarType as e } from "@sheetxl/sdk";
8
8
  import { useTranslator as t } from "@sheetxl/utils-react";
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.15
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.16
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
5
+ * License: MIT
6
6
  */
7
7
  import { useMemo as e, version as t } from "react";
8
8
  function n(e, t) {
@@ -0,0 +1,119 @@
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 { n as e } from "./DVaykBKx4eEsP4MI.mjs";
8
+ import { InputField as t } from "./index.mjs";
9
+ import { n } from "./tiC8hseLz66gO5BS.mjs";
10
+ import { useReferenceMode as r, useWorkbook as i } from "@sheetxl/react";
11
+ import { useCallbackRef as a, useTranslator as o } from "@sheetxl/utils-react";
12
+ import { memo as s, useCallback as c, useMemo as l, useState as u } from "react";
13
+ import { OptionsDialog as d } from "@sheetxl/utils-mui";
14
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
15
+ import { Box as m } from "@mui/material";
16
+ var h = ["Ok", "Cancel"], g = s((s) => {
17
+ let { onInput: g, onOption: _, onValidateOption: v, onDone: y, options: b = h, defaultOption: x = b?.[0], cancelOption: S = "Cancel", sx: C, initialValue: w, context: T, ...E } = s, D = o(), [O, k] = u(!1), [A, j] = u(() => w?.name ?? ""), [M, N] = u(() => w?.source ?? null), [P, F] = u(() => w?.location ?? null), I = T?.(), L = l(() => {
18
+ let e = w?.source, t = e && typeof e != "string" ? e.getWorksheet?.()?.getName() : void 0;
19
+ return t ? { scope: t } : void 0;
20
+ }, [w]), R = i(), [z] = u(() => {
21
+ let e = R?.getSelectedWorksheet()?.getName();
22
+ return e ? { scope: e } : void 0;
23
+ }), B = r().getMode()?.mode === "point", V = l(() => P ? I?.checkLocation(P) ?? null : null, [P, I]), H = a((e) => {
24
+ I?.validateName(e, P);
25
+ }, [I, P]), U = a((e) => {
26
+ let t = M && P ? {
27
+ ...w,
28
+ name: A,
29
+ source: M,
30
+ location: P
31
+ } : null, n = e === S || !e;
32
+ g?.(!n && t ? t : void 0), _?.(e ?? S, n, e === x), y?.({
33
+ option: e,
34
+ value: t
35
+ });
36
+ }, [
37
+ y,
38
+ _,
39
+ x,
40
+ S,
41
+ A,
42
+ M,
43
+ P,
44
+ w
45
+ ]), W = c(async (e, t) => {
46
+ if (!M || !P || V) return !1;
47
+ try {
48
+ H(A);
49
+ } catch {
50
+ return !1;
51
+ }
52
+ return !0;
53
+ }, [
54
+ H,
55
+ A,
56
+ M,
57
+ P,
58
+ V
59
+ ]), G = (e) => {
60
+ O || e.target?.select(), k(!0);
61
+ };
62
+ return f(d, {
63
+ title: D("pivotTableNew.title"),
64
+ options: b,
65
+ onDone: U,
66
+ onValidateOption: W,
67
+ defaultOption: x,
68
+ cancelOption: S,
69
+ autoFocusSel: ".autoFocus",
70
+ suspendModal: B,
71
+ sx: {
72
+ width: "360px",
73
+ ...C
74
+ },
75
+ ...E,
76
+ children: p(m, {
77
+ sx: {
78
+ paddingTop: (e) => e.spacing(1),
79
+ paddingBottom: (e) => e.spacing(0),
80
+ rowGap: (e) => e.spacing(1),
81
+ display: "flex",
82
+ flexDirection: "column"
83
+ },
84
+ children: [
85
+ f(t, {
86
+ formName: "name",
87
+ value: A,
88
+ onChangeInput: j,
89
+ onValidate: H,
90
+ onFocus: G
91
+ }),
92
+ f(e, {
93
+ grammar: "reference",
94
+ classNameInput: "autoFocus",
95
+ formName: "source",
96
+ label: D("pivotTableNew.source"),
97
+ value: M,
98
+ allowMulti: !1,
99
+ home: L,
100
+ pickAs: "absolute",
101
+ onChangeInput: (e) => N(n(e)),
102
+ onFocus: G
103
+ }),
104
+ f(e, {
105
+ grammar: "reference",
106
+ formName: "location",
107
+ label: D("pivotTableNew.location"),
108
+ value: P,
109
+ allowMulti: !1,
110
+ home: z,
111
+ validationError: V,
112
+ onChangeInput: (e) => F(e?.getReferences() ?? null),
113
+ onFocus: G
114
+ })
115
+ ]
116
+ })
117
+ });
118
+ });
119
+ export { g as PivotTableNewDialog, g as default };
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.15
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.16
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
5
+ * License: MIT
6
6
  */
7
- import { t as e } from "./BNas8wZuvrN45dRi.mjs";
8
- import { n as t } from "./OmA1ClZ36ZMFrZe7.mjs";
9
- import { i as n, n as r, t as i } from "./DR9y7k4jB7stGPaZ.mjs";
10
- import { t as a } from "./Bvq5aZyp5E79JB-s.mjs";
11
- import { n as o, r as s, t as c } from "./BsAoK_t2sn8IHtAO.mjs";
7
+ import { t as e } from "./DMhFcJsnKSKTDivl.mjs";
8
+ import { n as t } from "./9V0gwYl3BcajPwBD.mjs";
9
+ import { i as n, n as r, t as i } from "./tffjGixzP1Ze4DqB.mjs";
10
+ import { t as a } from "./DoYSmj1LQHAAqt5b.mjs";
11
+ import { n as o, r as s, t as c } from "./CtVSJjciTocAi-ph.mjs";
12
12
  import { DynamicIcon as l, NotifierType as u, useNotifier as d, useTranslator as f } from "@sheetxl/utils-react";
13
13
  import { forwardRef as p, memo as m, useCallback as h, useEffect as g, useMemo as _, useReducer as ee, useRef as v, useState as y } from "react";
14
14
  import { SimpleTooltip as te } from "@sheetxl/utils-mui";
@@ -0,0 +1,360 @@
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 { r as e } from "./C8M4U_SswTd6auZd.mjs";
8
+ import { t } from "./DMhFcJsnKSKTDivl.mjs";
9
+ import { Color as n, FontUtils as r, IFontCollection as i } from "@sheetxl/sdk";
10
+ import { useGridColorScheme as a } from "@sheetxl/react";
11
+ import { CommandButtonType as o, KeyCodes as s, measureUIText as c, themeSurfaceProps as l, useCallbackRef as u, useCommands as d, useTextSelectionDrag as f } from "@sheetxl/utils-react";
12
+ import { forwardRef as p, memo as m, useCallback as h, useEffect as g, useMemo as _, useState as v } from "react";
13
+ import { CommandButton as y, CommandTooltip as b, ExhibitDivider as x, ExhibitMenuItem as S, ExhibitPopupIconButton as C, ExhibitTooltip as w, PopupButtonType as T, SelectedIcon as E, defaultRenderPopupPanel as D } from "@sheetxl/utils-mui";
14
+ import { jsx as O, jsxs as k } from "react/jsx-runtime";
15
+ import { Box as A, IconButton as j, Input as M, Typography as N, useTheme as P } from "@mui/material";
16
+ var F = m(p((e, n) => {
17
+ let { commandKey: i, showQuickButtons: a, fontSizes: o = r.DefaultFontSizes, disabled: l, icon: p, label: m, sx: b, ...T } = e, [N] = d([i ?? ""]), F = () => N?.getState()?.toString() || "11", [I, L] = v(F), R = u(() => {
18
+ let e = parseFloat(I);
19
+ isNaN(e) ? L(F()) : parseFloat(F()) !== e && N?.execute(e);
20
+ }, [
21
+ F,
22
+ N,
23
+ I
24
+ ]);
25
+ g(() => {
26
+ L(F());
27
+ }, [N?.getState()]);
28
+ let z = ["formatFontSizeIncrease", "formatFontSizeDecrease"], B = _(() => z ? k(A, {
29
+ className: t("quick-buttons", {}),
30
+ sx: {
31
+ display: "flex",
32
+ alignItems: "center",
33
+ justifyContent: "center"
34
+ },
35
+ children: [O(y, { commandKey: z[0] }), O(y, { commandKey: z[1] })]
36
+ }) : null, [z]), V = P(), H = _(() => `${c("12.3", {
37
+ size: Math.round(V.typography.fontSize),
38
+ family: V.typography.fontFamily ?? ""
39
+ })}px`, [V]), U = l ?? (!N || N.disabled()), W = f(), G = h((e) => {
40
+ let { onMouseDown: t, onMouseUp: n, ...r } = e;
41
+ return O(j, {
42
+ component: "div",
43
+ ...r,
44
+ disableRipple: !0,
45
+ children: O(M, {
46
+ inputMode: "numeric",
47
+ disabled: l || !N || N.disabled(),
48
+ inputProps: {
49
+ name: "font-input",
50
+ autoComplete: "off",
51
+ onPointerDown: W.onPointerDown,
52
+ onDragStart: W.onDragStart,
53
+ tabIndex: 0,
54
+ type: "number",
55
+ maxLength: 4,
56
+ max: 409,
57
+ min: 2
58
+ },
59
+ sx: {
60
+ "&::before": { borderBottom: "1px solid transparent" },
61
+ "&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before": { borderBottom: (e) => `1px solid ${e.palette.text.icon ?? e.palette.action.active}` },
62
+ "&:hover:not(.Mui-disabled):not(.Mui-error):before": { borderBottom: (e) => `1px solid ${e.palette.error.main}` },
63
+ "::after": { borderBottom: (e) => `1px solid ${e.palette.primary.main}` },
64
+ paddingTop: "0px",
65
+ paddingBottom: "0px",
66
+ paddingLeft: "0px",
67
+ paddingRight: "0px",
68
+ fontSize: (e) => `${Math.round(e.typography.fontSize)}px`,
69
+ width: H,
70
+ color: (e) => e.palette.text.secondary,
71
+ input: {
72
+ padding: "0 0",
73
+ textAlign: "center",
74
+ height: "1rem",
75
+ MozAppearance: "textfield",
76
+ "&:hover:not(.Mui-disabled):not(.Mui-error)": { color: (e) => e.palette.text.primary },
77
+ "&:focus:not(.Mui-disabled):not(.Mui-error)": { color: (e) => e.palette.text.primary }
78
+ },
79
+ "input::-webkit-inner-spin-button": {
80
+ WebkitAppearance: "none",
81
+ margin: "0"
82
+ }
83
+ },
84
+ value: I,
85
+ onFocus: (e) => {
86
+ e.target?.select();
87
+ },
88
+ onKeyDown: (e) => {
89
+ if (e.which === s.Enter) F() !== I && (e.stopPropagation(), e.preventDefault(), R());
90
+ else if (e.which === s.Escape) F() !== I && (L(F()), setTimeout(() => {
91
+ e.target?.select();
92
+ }, 0), e.stopPropagation(), e.preventDefault());
93
+ else {
94
+ if (e.key.match("[-]") || e.key.match("[0-9.]") && (I + e.key).length > 4) return e.stopPropagation(), void e.preventDefault();
95
+ if (e.which === s.Space) return void e.preventDefault();
96
+ }
97
+ },
98
+ onBlur: () => {
99
+ R();
100
+ },
101
+ onChange: (e) => {
102
+ if (e.target.value.length > 4) return e.stopPropagation(), void e.preventDefault();
103
+ L(e.target.value);
104
+ }
105
+ })
106
+ });
107
+ }, [
108
+ I,
109
+ U,
110
+ N,
111
+ W
112
+ ]), K = h((e) => {
113
+ let t = (e) => {
114
+ N?.execute(e);
115
+ }, n = N?.getState(), r = [];
116
+ for (let e = 0; e < o.length; e++) {
117
+ let i = o[e] === n;
118
+ r.push(O(S, {
119
+ selected: i,
120
+ icon: i ? O(E, {}) : void 0,
121
+ disabled: l || !N || N.disabled(),
122
+ onMouseDown: (e) => {
123
+ e.button === 0 && e.preventDefault();
124
+ },
125
+ onMouseUp: (n) => {
126
+ n.button === 0 && t(o[e]);
127
+ },
128
+ onKeyDown: (n) => {
129
+ n.keyCode !== s.Enter && n.keyCode !== s.Space || t(o[e]);
130
+ },
131
+ sx: {
132
+ paddingTop: "4px",
133
+ paddingBottom: "4px"
134
+ },
135
+ children: O(A, {
136
+ sx: {
137
+ display: "flex",
138
+ flex: "1 1 100%",
139
+ justifyContent: "end"
140
+ },
141
+ children: o[e]
142
+ })
143
+ }, "fontSize-" + e));
144
+ }
145
+ let i = k(A, {
146
+ sx: {
147
+ display: "flex",
148
+ flexDirection: "column",
149
+ flex: "1 1 100%",
150
+ overflow: "hidden"
151
+ },
152
+ ...T,
153
+ children: [
154
+ B,
155
+ O(x, { orientation: "horizontal" }),
156
+ O(A, {
157
+ sx: {
158
+ overflow: "auto",
159
+ flex: "1 1 100%"
160
+ },
161
+ children: r
162
+ })
163
+ ]
164
+ });
165
+ return D({
166
+ ...e,
167
+ children: i
168
+ });
169
+ }, [U, N]);
170
+ return O(C, {
171
+ ref: n,
172
+ sx: { ...b },
173
+ tabIndex: -1,
174
+ outlined: !0,
175
+ disabled: U,
176
+ renderPopupPanel: K,
177
+ renderTooltip: ({ children: e, disabled: t }) => O(w, {
178
+ label: N?.getLabel(),
179
+ description: N?.getDescription(),
180
+ disabled: t || N?.disabled(),
181
+ children: e
182
+ }),
183
+ renderQuickButton: G,
184
+ ...T
185
+ });
186
+ })), I = m(p((t, r) => {
187
+ let { commandKey: i, onSelectColor: s, disabled: c, variant: f = o.Toolbar, quickColor: p, propsPanel: m, isSplit: g = !1, darkMode: v, icon: y, ...x } = t, { autoColor: S, schemeLookup: C, recentColors: w, ...E } = m ?? {};
188
+ if (x.selectedColor) throw Error("Command selectedColor will be used. Do not try to provide one as a direct argument");
189
+ let [D] = d([i ?? ""]), k = D?.getContext(), A = p ?? k?.quickColor;
190
+ g && !A && (A = new n("transparent"));
191
+ let j = S === void 0 ? k?.autoColor : S, M = C ?? k?.schemeLookup, N = w ?? k?.recentColors, P = a(), F = v ?? P === "dark", I = _(() => ({
192
+ autoColor: j,
193
+ schemeLookup: M,
194
+ recentColors: N,
195
+ darkMode: F,
196
+ ...l("grid", F ? "dark" : "light"),
197
+ ...E
198
+ }), [
199
+ j,
200
+ M,
201
+ N,
202
+ F
203
+ ]), L = u((e, t) => {
204
+ e && t && k?.addRecentColor && k.addRecentColor(e), k?.onColorSelect && k.onColorSelect(e), s?.(e, t), D?.execute(e);
205
+ }, [
206
+ D,
207
+ s,
208
+ k
209
+ ]), R = h((e) => {
210
+ let { disabled: t, children: n, title: r, ...a } = e, s = e.children;
211
+ return (D?.disabled() || c) && (s = O("div", { children: s })), O(b, {
212
+ commandKey: i,
213
+ placement: f === o.Toolbar ? "bottom-start" : "right-start",
214
+ disabled: t,
215
+ ...a,
216
+ children: s
217
+ });
218
+ }, [D, c]);
219
+ return O(e, {
220
+ ref: r,
221
+ propsPanel: I,
222
+ icon: y ?? D?.getIcon(),
223
+ quickColor: A,
224
+ selectedColor: D?.getState(),
225
+ onSelectColor: L,
226
+ variant: f === o.Menuitem ? T.Menuitem : T.Toolbar,
227
+ renderTooltip: R,
228
+ label: D?.getLabel(),
229
+ disabled: c ?? (!D || D.disabled()),
230
+ compareRGB: !0,
231
+ darkMode: F,
232
+ ...x
233
+ });
234
+ }));
235
+ I.displayName = "ColorCommandButton";
236
+ var L = m(p((e, t) => {
237
+ let { commandKey: n, sx: r, disabled: a, icon: o, label: l, ...u } = e, [f] = d([n]), p = f?.getState(), m = P(), g = _(() => `${c("Times New Roman", {
238
+ size: Math.round(m.typography.fontSize),
239
+ family: m.typography.fontFamily ?? ""
240
+ })}px`, [m]), v = a ?? (!f || f.disabled()), y = h((e) => {
241
+ let t = (e) => {
242
+ f?.execute(e);
243
+ }, n = i.getShared().getFontList(), r = [];
244
+ for (let e = 0; e < n.length; e++) {
245
+ let t = n[e].fontRef;
246
+ if (!t) continue;
247
+ let i = t.getFamily();
248
+ r.push({
249
+ key: i,
250
+ description: i
251
+ });
252
+ }
253
+ r.some((e) => e.key === p) || r.unshift({
254
+ key: p,
255
+ description: p
256
+ });
257
+ let o = [], c = r.length;
258
+ for (let e = 0; e < c; e++) {
259
+ let n = r[e];
260
+ if (!n) continue;
261
+ let i = n.key, c = n.key === p;
262
+ o.push(O(S, {
263
+ sx: {
264
+ display: "flex",
265
+ paddingTop: "4px",
266
+ paddingBottom: "4px"
267
+ },
268
+ selected: c,
269
+ disabled: a || !f || f.disabled(),
270
+ icon: c ? O(E, {}) : void 0,
271
+ onMouseUp: (e) => {
272
+ e.button === 0 && t(i);
273
+ },
274
+ onMouseDown: (e) => {
275
+ e.button === 0 && e.preventDefault();
276
+ },
277
+ onKeyDown: (e) => {
278
+ e.keyCode !== s.Enter && e.keyCode !== s.Space || t(i);
279
+ },
280
+ children: O(A, {
281
+ sx: {
282
+ display: "flex",
283
+ flex: "1 1 100%",
284
+ flexDirection: "column",
285
+ overflow: "hidden"
286
+ },
287
+ children: O(N, {
288
+ component: "div",
289
+ sx: {
290
+ whiteSpace: "nowrap",
291
+ overflow: "hidden",
292
+ textOverflow: "ellipsis",
293
+ fontFamily: () => i
294
+ },
295
+ children: r[e].description
296
+ })
297
+ })
298
+ }, e + "" + i));
299
+ }
300
+ let l = O(A, {
301
+ sx: {
302
+ display: "flex",
303
+ flexDirection: "column",
304
+ flex: "1 1 100%"
305
+ },
306
+ ...u,
307
+ children: O(A, {
308
+ sx: {
309
+ overflow: "auto",
310
+ flex: "1 1 100%"
311
+ },
312
+ children: o
313
+ })
314
+ });
315
+ return D({
316
+ ...e,
317
+ children: l
318
+ });
319
+ }, [
320
+ v,
321
+ f,
322
+ p
323
+ ]);
324
+ return O(C, {
325
+ ref: t,
326
+ sx: { ...r },
327
+ outlined: !0,
328
+ disabled: v,
329
+ renderPopupPanel: y,
330
+ renderTooltip: ({ children: e, disabled: t }) => O(w, {
331
+ label: f?.getLabel(),
332
+ description: f?.getDescription(),
333
+ disabled: t,
334
+ children: e
335
+ }),
336
+ icon: O(A, {
337
+ sx: {
338
+ display: "flex",
339
+ paddingLeft: "4px",
340
+ paddingRight: "4px",
341
+ fontSize: (e) => `${Math.round(e.typography.fontSize)}px`,
342
+ lineHeight: 1.2,
343
+ fontFamily: (e) => e.typography.fontFamily,
344
+ color: (e) => e.palette.text.secondary,
345
+ flex: "1 1 auto",
346
+ width: g
347
+ },
348
+ children: O(A, {
349
+ sx: {
350
+ overflow: "hidden",
351
+ textOverflow: "ellipsis",
352
+ whiteSpace: "pre"
353
+ },
354
+ children: p
355
+ })
356
+ }),
357
+ ...u
358
+ });
359
+ }));
360
+ export { I as n, F as r, L as t };