@sheetxl/studio-mui 0.8.0-beta.15 → 0.8.0-beta.17
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/{DJVpra0HoPH-4P7P.mjs → 0FLmtunmoRFjO-dk.mjs} +3 -3
- package/browser/esm/{6SL2j-85OXrKJNZ5.mjs → B2LvYLt27hzoarA9.mjs} +1807 -1200
- package/browser/esm/{D90Bb0GPEwqYkf6R.mjs → BBGsto_-YGhTouc9.mjs} +804 -713
- package/browser/esm/{BR51amBhaaHPBhpd.mjs → BEIcp6BzAg3H6JBB.mjs} +3 -3
- package/browser/esm/{EFtp_C3sBnP3Nrns.mjs → BFN88LECqMerqLYN.mjs} +7 -7
- package/browser/esm/{ghfcAaGu2CuZGdhi.mjs → BGNhe08mdWf8dIuk.mjs} +34 -33
- package/browser/esm/BNfIFd07bhGqs-U9.mjs +235 -0
- package/browser/esm/{CcJHwg-rLMcCymSD.mjs → BTb_Djaoxz3G27t-.mjs} +6 -6
- package/browser/esm/{Cl_OUigCV04_zrRy.mjs → BXhWCOPioL48V_9k.mjs} +2 -2
- package/browser/esm/{DsM-NpB32hloRRR8.mjs → Bh1YkrKuSZs-xdlw.mjs} +3 -3
- package/browser/esm/{CV-q-xCHVuNFhqEF.mjs → BkABsPS9qbyYS2i7.mjs} +2 -2
- package/browser/esm/{Buzx8_zQYPX4DR7v.mjs → BnLdmQ91UIGs0zyR.mjs} +2 -2
- package/browser/esm/BnMZSJdWZzdK-AXs.mjs +119 -0
- package/browser/esm/BoXCzcrUFER3B585.mjs +225 -0
- package/browser/esm/{BNas8wZuvrN45dRi.mjs → BxHaU8-LCw4IHrDn.mjs} +2 -2
- package/browser/esm/C2ZbV5cXpGPYeqM1.mjs +106 -0
- package/browser/esm/C8kveDS4xm6D2Aaq.mjs +294 -0
- package/browser/esm/{OHvsc940xI-m_8cc.mjs → CHm8-sLarqD1--If.mjs} +2 -2
- package/browser/esm/{DOWfcHx0MO0J50de.mjs → CMIM0wPs_KvfwLEl.mjs} +92 -87
- package/browser/esm/{DY_EGsyx-zNiJS_0.mjs → CP-c6sUINCv0Nf4P.mjs} +5 -5
- package/browser/esm/{BCDAnHFMvOd9XS8K.mjs → CaI0Mfu6ECDIzCpr.mjs} +3 -3
- package/browser/esm/{Bvq5aZyp5E79JB-s.mjs → Cb3HSSD7snyRPNh8.mjs} +2 -2
- package/browser/esm/{BsAoK_t2sn8IHtAO.mjs → Cf855AHLcB7WuFr3.mjs} +3 -3
- package/browser/esm/{Bqba-3J9i8HsmusR.mjs → ChORBNItvZW0e8Nb.mjs} +2 -2
- package/browser/esm/{DfI4-5XM6AbILSti.mjs → CmMD76_yBG4xmsEr.mjs} +4 -4
- package/browser/esm/{idh3Y0jksygPSI3A.mjs → CuysyoZ-rmDHwaJJ.mjs} +2 -2
- package/browser/esm/{DMDi2lOps0veJKsM.mjs → Cvbms6f8QMP1ubyI.mjs} +3 -3
- package/browser/esm/{DKkKac2vbeui2lDy.mjs → CvzzESAZRMWQ4cGq.mjs} +6 -6
- package/browser/esm/{DFAphWcDUw-gVtAl.mjs → D078ssKRI39FdHNq.mjs} +3 -3
- package/browser/esm/{BvpzsprI7cmVLuQn.mjs → D1_8p15KJ7DSZEis.mjs} +3 -3
- package/browser/esm/{Dz20q7S5vmDWlO0p.mjs → D2Kz08pq5zPz2n3y.mjs} +2 -2
- package/browser/esm/{BojGnpAWoIm5yCd8.mjs → D4FRExfK7RsdS08S.mjs} +2 -2
- package/browser/esm/{CJWnWqGPw17cp9P3.mjs → D9ija-5d57x-qUQv.mjs} +2 -2
- package/browser/esm/{DAYPqhHN3aQ2StjU.mjs → DGkQsCJP29nZteu8.mjs} +14 -14
- package/browser/esm/{DR9y7k4jB7stGPaZ.mjs → DK39s_Fn9M22RfJm.mjs} +3 -3
- package/browser/esm/{CutWdrVA-c3x8IkL.mjs → DL0r5MrPx8CkL_r_.mjs} +5 -4
- package/browser/esm/{IlX2PgLxvyTQu4Fh.mjs → DQjJFUPHg_aU2BDi.mjs} +5 -5
- package/browser/esm/{OmA1ClZ36ZMFrZe7.mjs → DcUtMgA17fh_UJlQ.mjs} +2 -2
- package/browser/esm/{BfPTOOKhwUojRTef.mjs → Dd6iR6EeV81idc-J.mjs} +13 -9
- package/browser/esm/{DLe9DT0DSurLSgiQ.mjs → Dd8j9U2Vlvrue2LA.mjs} +2 -2
- package/browser/esm/{BkxJY_YjMAEvhmuy.mjs → DmBu6kgMNT26tmsZ.mjs} +4 -4
- package/browser/esm/{DpAlQza0e5h3GGHC.mjs → DrtEkQTJM7oPvC9v.mjs} +3 -3
- package/browser/esm/DwiKIdqmaBk2pTBp.mjs +973 -0
- package/browser/esm/{C67SLDHwhVlVIMo0.mjs → Dx0ymWD1uI_Q63eZ.mjs} +3 -3
- package/browser/esm/{Ci74yk0whfoAP1TL.mjs → DxFw-07oIjr7GRb3.mjs} +2 -2
- package/browser/esm/{BH4eDAxZdwheO7d_.mjs → GqSAEzE_2tOJlvNG.mjs} +3 -3
- package/browser/esm/{By1IJOkvZJSlXs5f.mjs → JqMZ95e5lhq09vm6.mjs} +3 -3
- package/browser/esm/{DzATG8XMcG6mmYbx.mjs → LaC0D0C9yJ8y_l6X.mjs} +9 -9
- package/browser/esm/{BYnzaHXySiV-sc6w.mjs → NQzIcNkm0QxNuzx9.mjs} +2 -2
- package/browser/esm/{DYDnkmllpYTwfWir.mjs → W5Rvml-3G4XekwoR.mjs} +4 -4
- package/browser/esm/_PlChb18jQMPAKJX.mjs +360 -0
- package/browser/esm/{BWdpv2xf6GCyd4Te.mjs → cNsbq0TIia7SdBHP.mjs} +5 -5
- package/browser/esm/{Cbkg5y4fYjLylYHF.mjs → fSCwNKAcSc0mr2Ec.mjs} +2 -2
- package/browser/esm/g_bvg4HpyaF6f_JY.mjs +424 -0
- package/browser/esm/index.mjs +278 -277
- package/browser/esm/{C8tci3dfo5lzeoK-.mjs → mP32LfcEodsaGDPi.mjs} +6 -6
- package/browser/esm/{BvbN9V67wFhTfq1-.mjs → sjJ2Yb_cf_KL--Cl.mjs} +3 -3
- package/licenses/dependencies.txt +33 -33
- package/node/esm/{DybPyX8U-EqXKarV.mjs → 5Kkr-d9gc7GsfmI5.mjs} +2 -2
- package/node/esm/B6YmbuWU-fHrjOnB.mjs +106 -0
- package/node/esm/{DwA7rfXJgzoNvjax.mjs → BGWb71anMM4S4UTg.mjs} +8 -8
- package/node/esm/{C4eVfVm_Omyt6NbE.mjs → BINV_bzMi8YLqzor.mjs} +12 -12
- package/node/esm/{DGtbmp72kfRXLtDu.mjs → BWl0RjNZfoJvRX_2.mjs} +81 -80
- package/node/esm/{-Adgw5-ltK-rfp33.mjs → BiVdQ27eA1Rs9liu.mjs} +2 -2
- package/node/esm/{CkW8xNdW45Xg7jy7.mjs → Bp6WSG8tmXefxSlk.mjs} +3 -3
- package/node/esm/BrHbeFtSmaPq19cu.mjs +224 -0
- package/node/esm/BySbwlaepgugcINA.mjs +972 -0
- package/node/esm/{q2Byx8RdDnHk8YyG.mjs → BzLnWJ1JhLnookTH.mjs} +2 -2
- package/node/esm/{Bg3Yu66oJr6mNvAR.mjs → C-Y0ELSBNT5h6V0l.mjs} +3 -3
- package/node/esm/{TgwnKYh-WPxEgmyr.mjs → CA2iwgwOkAwRJU9j.mjs} +2 -2
- package/node/esm/{CzKFdVrPSDYOUdWI.mjs → CCy_wcDWd9xbQnyM.mjs} +2 -2
- package/node/esm/{D9Ga7FFJDOO3Dpfu.mjs → CD-S0_rfDY5u82_A.mjs} +2 -2
- package/node/esm/{Cx4tBEsm3SjAafcw.mjs → CQd5k9d0BWpU8yCQ.mjs} +2 -2
- package/node/esm/{BZK6UksX7r-GgRms.mjs → Cb0TicO5Utg9e5Qy.mjs} +2 -2
- package/node/esm/{DOuASwH2Lf83hMLe.mjs → ClwmPxZc7Uh4nRcr.mjs} +2 -2
- package/node/esm/{dUUbrmGMCILl8EOr.mjs → CyxhIZwqwx_Kt70P.mjs} +2 -2
- package/node/esm/D1XvISMVj1HimOTS.mjs +425 -0
- package/node/esm/{B26ot2vO6Hd47uH0.mjs → D2ZUCui3Xosjj66H.mjs} +2 -2
- package/node/esm/{BaFRVcYZjcLoMQtk.mjs → D71TbUFABfTixyiQ.mjs} +7 -7
- package/node/esm/{ISBEql8s7AnELTpd.mjs → D7__y1LhVOR38yxz.mjs} +2 -2
- package/node/esm/{Ca31PUiJBGowHeob.mjs → D9jTg0iWTubkisDB.mjs} +3 -3
- package/node/esm/{5etzEfk-28CCELyT.mjs → DHiJ5D_q7YVsClMf.mjs} +3 -3
- package/node/esm/{BxIyViNSP0STSrfA.mjs → DJuEU0TbZXyTnThP.mjs} +3 -3
- package/node/esm/{D_JpopAVQopM26cb.mjs → DMfK0wa8UHeJyxii.mjs} +603 -514
- package/node/esm/{CFi_Yls-gurU_CX3.mjs → DN2KKVrC1ye0mldi.mjs} +2 -2
- package/node/esm/{HlNuwtpYoOARa894.mjs → DYRV7b1ZSbxrjcuA.mjs} +2 -2
- package/node/esm/Dm-skjfQUaumyQPp.mjs +118 -0
- package/node/esm/{jGsHbOHP90nnx_hJ.mjs → DvN4Z2Hx4Es0sdaK.mjs} +16 -15
- package/node/esm/{CORxK68HpwPUYA6O.mjs → Jp--thwzf0FSnHTH.mjs} +2 -2
- package/node/esm/{BKCNFVrdc_gTnOoS.mjs → a69xG_vSg2OC9_22.mjs} +2 -2
- package/node/esm/{CX13ASkhdJ0ZSAY4.mjs → akKdwInE4KLNjHQu.mjs} +3 -3
- package/node/esm/axzlGUKK8euccdja.mjs +294 -0
- package/node/esm/index.mjs +3391 -2778
- package/node/esm/{B7vbn_dO_cZnGyGM.mjs → lhMHEjzlz63h_qU0.mjs} +3 -3
- package/node/esm/{CexPhV2NPh5ZGHus.mjs → r8bpi-MSpulvmozZ.mjs} +2 -2
- package/node/esm/{BFv2GzY6NjmJggAg.mjs → sHdUrEwlYxyLkkL6.mjs} +3 -3
- 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,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.17
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import { c as e, r as t } from "./DmBu6kgMNT26tmsZ.mjs";
|
|
8
|
+
import { t as n } from "./BxHaU8-LCw4IHrDn.mjs";
|
|
9
|
+
import { DEFAULT_GRADIENT as ee, GradientEditor as r, PatternPopupButton as te, toGradientValue as i, toPatternSlots as a } from "./index.mjs";
|
|
10
|
+
import { a as o, i as s, o as c, r as l } from "./C2ZbV5cXpGPYeqM1.mjs";
|
|
11
|
+
import { Color as u, IColor as d, IFill as f } from "@sheetxl/sdk";
|
|
12
|
+
import { useCallbackRef as p, useCommands as ne, useTranslator as m } from "@sheetxl/utils-react";
|
|
13
|
+
import { memo as h, useMemo as g } from "react";
|
|
14
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
15
|
+
import { Box as re, FormControl as ie, InputLabel as ae, MenuItem as b, Select as x } from "@mui/material";
|
|
16
|
+
import { messageKey as S } from "@sheetxl/utils";
|
|
17
|
+
var C = f.BuiltInSheetPattern.Gray125, w = new u(d.Named.Transparent), T = (e) => ({
|
|
18
|
+
fill: e.style.getFill(),
|
|
19
|
+
styles: e.styles,
|
|
20
|
+
schemeLookup: e.schemeLookup,
|
|
21
|
+
darkMode: e.darkMode,
|
|
22
|
+
disabled: e.disabled,
|
|
23
|
+
createCell: e.createCell,
|
|
24
|
+
applyFill: (t, n) => e.applyStyle({ fill: t }, n)
|
|
25
|
+
}), E = h((h) => {
|
|
26
|
+
let { selection: T, disabled: E, maxGradientStops: D, className: O, ...k } = h, A = m(), { fill: j, applyFill: M, createCell: oe, schemeLookup: N, styles: P, darkMode: F } = T, I = E || T.disabled, L = p((e, t) => {
|
|
27
|
+
M(e.fill, t);
|
|
28
|
+
}, [M]), R = j.getType(), z = R === f.Type.None ? f.Type.Solid : R, B = R === f.Type.Pattern ? j : null, V = B?.getPatternType() ?? C, H = B ? a(V, B.getForeground(), B.getBackground()) : null, U = g(() => new u(d.Scheme.Tx1, N), [N]), W = H?.foreground ?? U, G = H?.background ?? new u(d.Named.Transparent, N), K = R === f.Type.Solid ? j.getColor() : null, q = p(() => P.recentColors(), [P]), [J] = ne(["formatFillColor"]), Y = J?.getContext(), X = Y?.quickColor ?? null, se = p((e, t) => {
|
|
29
|
+
e && t && P.addRecentColor(e), Y?.onColorSelect?.(e), e ? L({ fill: {
|
|
30
|
+
type: f.Type.Solid,
|
|
31
|
+
color: e.toString()
|
|
32
|
+
} }, S("op.setFillColor")) : L({ fill: { type: f.Type.None } }, S("op.setFillNone"));
|
|
33
|
+
}, [
|
|
34
|
+
L,
|
|
35
|
+
P,
|
|
36
|
+
Y
|
|
37
|
+
]), Z = p((e) => {
|
|
38
|
+
let t = e.patternType ?? V, n = a(t, e.foreground ?? W.toString(), e.background ?? G.toString());
|
|
39
|
+
L({ fill: {
|
|
40
|
+
type: f.Type.Pattern,
|
|
41
|
+
patternType: t,
|
|
42
|
+
foreground: n.foreground,
|
|
43
|
+
background: n.background
|
|
44
|
+
} }, S("op.setFillPattern"));
|
|
45
|
+
}, [
|
|
46
|
+
L,
|
|
47
|
+
V,
|
|
48
|
+
W,
|
|
49
|
+
G
|
|
50
|
+
]), Q = p((e) => {
|
|
51
|
+
L({ fill: {
|
|
52
|
+
type: f.Type.Gradient,
|
|
53
|
+
gradientType: e.gradientType,
|
|
54
|
+
angle: e.angle,
|
|
55
|
+
stops: e.stops.map((e) => ({
|
|
56
|
+
offset: e.offset,
|
|
57
|
+
color: e.color
|
|
58
|
+
}))
|
|
59
|
+
} }, S("op.setFillGradient"));
|
|
60
|
+
}, [L]), ce = p((e) => {
|
|
61
|
+
if (e !== z) switch (e) {
|
|
62
|
+
case f.Type.Solid:
|
|
63
|
+
L({ fill: {
|
|
64
|
+
type: f.Type.Solid,
|
|
65
|
+
color: (X ?? j.getColor())?.toString() ?? "ffffff"
|
|
66
|
+
} }, S("op.setFillSolid"));
|
|
67
|
+
break;
|
|
68
|
+
case f.Type.Pattern:
|
|
69
|
+
Z({});
|
|
70
|
+
break;
|
|
71
|
+
case f.Type.Gradient: Q(ee);
|
|
72
|
+
}
|
|
73
|
+
}, [
|
|
74
|
+
z,
|
|
75
|
+
j,
|
|
76
|
+
X,
|
|
77
|
+
L,
|
|
78
|
+
Z,
|
|
79
|
+
Q
|
|
80
|
+
]), $ = p(() => {
|
|
81
|
+
switch (R) {
|
|
82
|
+
case f.Type.Pattern:
|
|
83
|
+
Z({});
|
|
84
|
+
break;
|
|
85
|
+
case f.Type.Gradient:
|
|
86
|
+
Q(i(j));
|
|
87
|
+
break;
|
|
88
|
+
case f.Type.Solid:
|
|
89
|
+
L({ fill: {
|
|
90
|
+
type: f.Type.Solid,
|
|
91
|
+
color: j.getColor().toString()
|
|
92
|
+
} }, S("op.setFillColor"));
|
|
93
|
+
break;
|
|
94
|
+
default: L({ fill: { type: f.Type.None } }, S("op.setFillNone"));
|
|
95
|
+
}
|
|
96
|
+
}, [
|
|
97
|
+
R,
|
|
98
|
+
j,
|
|
99
|
+
L,
|
|
100
|
+
Z,
|
|
101
|
+
Q
|
|
102
|
+
]);
|
|
103
|
+
return y(re, {
|
|
104
|
+
className: n("sxl-format-fill-panel", O),
|
|
105
|
+
sx: c,
|
|
106
|
+
...k,
|
|
107
|
+
children: [
|
|
108
|
+
v(s, { children: y(ie, {
|
|
109
|
+
size: "small",
|
|
110
|
+
fullWidth: !0,
|
|
111
|
+
children: [v(ae, {
|
|
112
|
+
shrink: !0,
|
|
113
|
+
children: A("fill.type")
|
|
114
|
+
}), y(x, {
|
|
115
|
+
label: A("fill.type"),
|
|
116
|
+
notched: !0,
|
|
117
|
+
disabled: I,
|
|
118
|
+
value: z,
|
|
119
|
+
onChange: (e) => ce(e.target.value),
|
|
120
|
+
children: [
|
|
121
|
+
v(b, {
|
|
122
|
+
value: f.Type.Solid,
|
|
123
|
+
onClick: o(z, f.Type.Solid, $),
|
|
124
|
+
children: A("fill.typeSolid")
|
|
125
|
+
}),
|
|
126
|
+
v(b, {
|
|
127
|
+
value: f.Type.Pattern,
|
|
128
|
+
onClick: o(z, f.Type.Pattern, $),
|
|
129
|
+
children: A("fill.typePattern")
|
|
130
|
+
}),
|
|
131
|
+
v(b, {
|
|
132
|
+
value: f.Type.Gradient,
|
|
133
|
+
onClick: o(z, f.Type.Gradient, $),
|
|
134
|
+
children: A("fill.typeGradient")
|
|
135
|
+
}),
|
|
136
|
+
R === f.Type.Image ? v(b, {
|
|
137
|
+
value: f.Type.Image,
|
|
138
|
+
disabled: !0,
|
|
139
|
+
children: A("fill.typeImage")
|
|
140
|
+
}) : null
|
|
141
|
+
]
|
|
142
|
+
})]
|
|
143
|
+
}) }),
|
|
144
|
+
z === f.Type.Solid ? v(s, {
|
|
145
|
+
label: A("fill.backgroundColor"),
|
|
146
|
+
children: v(l, { children: v(t, {
|
|
147
|
+
icon: "fill.colored",
|
|
148
|
+
disabled: I,
|
|
149
|
+
darkMode: F,
|
|
150
|
+
compareRGB: !0,
|
|
151
|
+
selectedColor: K,
|
|
152
|
+
onSelectColor: se,
|
|
153
|
+
propsPanel: {
|
|
154
|
+
disableAlpha: !0,
|
|
155
|
+
autoColor: w,
|
|
156
|
+
autoColorLabelKey: S("color.noFill"),
|
|
157
|
+
autoColorPosition: e.End,
|
|
158
|
+
schemeLookup: N,
|
|
159
|
+
recentColors: q
|
|
160
|
+
}
|
|
161
|
+
}) })
|
|
162
|
+
}) : null,
|
|
163
|
+
R === f.Type.Pattern ? y(_, { children: [
|
|
164
|
+
v(s, {
|
|
165
|
+
label: A("fill.patternStyle"),
|
|
166
|
+
children: v(l, { children: v(te, {
|
|
167
|
+
disabled: I,
|
|
168
|
+
darkMode: F,
|
|
169
|
+
selectedPattern: V,
|
|
170
|
+
foreground: W.toString(),
|
|
171
|
+
background: G.toString(),
|
|
172
|
+
createCell: oe,
|
|
173
|
+
onSelectPattern: (e) => Z({ patternType: e })
|
|
174
|
+
}) })
|
|
175
|
+
}),
|
|
176
|
+
v(s, {
|
|
177
|
+
label: A("fill.patternForeground"),
|
|
178
|
+
children: v(l, { children: v(t, {
|
|
179
|
+
disabled: I,
|
|
180
|
+
darkMode: F,
|
|
181
|
+
selectedColor: W,
|
|
182
|
+
onSelectColor: (e) => {
|
|
183
|
+
Z({ foreground: (e ?? U).toString() });
|
|
184
|
+
},
|
|
185
|
+
propsPanel: {
|
|
186
|
+
disableAlpha: !0,
|
|
187
|
+
autoColor: U,
|
|
188
|
+
schemeLookup: N,
|
|
189
|
+
recentColors: q
|
|
190
|
+
}
|
|
191
|
+
}) })
|
|
192
|
+
}),
|
|
193
|
+
v(s, {
|
|
194
|
+
label: A("fill.patternBackground"),
|
|
195
|
+
children: v(l, { children: v(t, {
|
|
196
|
+
disabled: I,
|
|
197
|
+
darkMode: F,
|
|
198
|
+
selectedColor: G,
|
|
199
|
+
onSelectColor: (e) => {
|
|
200
|
+
Z({ background: (e ?? w).toString() });
|
|
201
|
+
},
|
|
202
|
+
propsPanel: {
|
|
203
|
+
disableAlpha: !0,
|
|
204
|
+
autoColor: w,
|
|
205
|
+
autoColorLabelKey: S("color.noFill"),
|
|
206
|
+
schemeLookup: N,
|
|
207
|
+
recentColors: q
|
|
208
|
+
}
|
|
209
|
+
}) })
|
|
210
|
+
})
|
|
211
|
+
] }) : null,
|
|
212
|
+
R === f.Type.Gradient ? v(s, { children: v(r, {
|
|
213
|
+
disabled: I,
|
|
214
|
+
maxStops: D,
|
|
215
|
+
darkMode: F,
|
|
216
|
+
schemeLookup: N,
|
|
217
|
+
recentColors: q,
|
|
218
|
+
value: i(j),
|
|
219
|
+
onChange: Q
|
|
220
|
+
}) }) : null
|
|
221
|
+
]
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
E.displayName = "FillPanel";
|
|
225
|
+
export { T as n, E as t };
|
|
@@ -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.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.17
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License:
|
|
5
|
+
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
function e(t) {
|
|
8
8
|
var n, r, i = "";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.17
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import { InputField as e } from "./index.mjs";
|
|
8
|
+
import { memo as t, useRef as n } from "react";
|
|
9
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
10
|
+
import { Box as a, Typography as o } from "@mui/material";
|
|
11
|
+
var s = (e, t, n) => () => {
|
|
12
|
+
t === e && n();
|
|
13
|
+
}, c = t((t) => {
|
|
14
|
+
let { label: i, value: a, min: o, max: s, step: c = 1, decimals: l = !1, width: u, disabled: d, onChange: f } = t, p = n(null), m = (e) => Math.max(o, Math.min(s, e)), h = (e) => {
|
|
15
|
+
let t = l ? parseFloat(e) : parseInt(e, 10);
|
|
16
|
+
return Number.isNaN(t) ? null : m(t);
|
|
17
|
+
};
|
|
18
|
+
return r(e, {
|
|
19
|
+
label: i,
|
|
20
|
+
value: String(a),
|
|
21
|
+
disabled: d,
|
|
22
|
+
hideAdornment: !0,
|
|
23
|
+
helperText: null,
|
|
24
|
+
propsInput: {
|
|
25
|
+
type: "number",
|
|
26
|
+
min: o,
|
|
27
|
+
max: s,
|
|
28
|
+
step: c
|
|
29
|
+
},
|
|
30
|
+
sx: {
|
|
31
|
+
width: u,
|
|
32
|
+
minWidth: 0,
|
|
33
|
+
"& input": { textAlign: "right" }
|
|
34
|
+
},
|
|
35
|
+
onChangeInput: (e) => {
|
|
36
|
+
let t = h(e);
|
|
37
|
+
t !== null && (p.current = t, f(t));
|
|
38
|
+
},
|
|
39
|
+
onDone: (e) => {
|
|
40
|
+
let t = h(e) ?? m(0), n = p.current;
|
|
41
|
+
p.current = null, n !== t && f(t);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
c.displayName = "FormatNumberField";
|
|
46
|
+
var l = {
|
|
47
|
+
display: "flex",
|
|
48
|
+
flexDirection: "column",
|
|
49
|
+
gap: 1.5,
|
|
50
|
+
minWidth: 0
|
|
51
|
+
}, u = t((e) => {
|
|
52
|
+
let { label: t, children: n, sx: s, ...c } = e;
|
|
53
|
+
return i(a, {
|
|
54
|
+
sx: {
|
|
55
|
+
display: "flex",
|
|
56
|
+
flexDirection: "column",
|
|
57
|
+
gap: .75,
|
|
58
|
+
minWidth: 0,
|
|
59
|
+
...s
|
|
60
|
+
},
|
|
61
|
+
...c,
|
|
62
|
+
children: [t ? r(o, {
|
|
63
|
+
variant: "caption",
|
|
64
|
+
component: "div",
|
|
65
|
+
sx: {
|
|
66
|
+
color: "text.secondary",
|
|
67
|
+
lineHeight: 1.4
|
|
68
|
+
},
|
|
69
|
+
children: t
|
|
70
|
+
}) : null, n]
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
u.displayName = "FormatSection";
|
|
74
|
+
var d = t((e) => {
|
|
75
|
+
let { children: t, sx: n, ...i } = e;
|
|
76
|
+
return r(a, {
|
|
77
|
+
sx: {
|
|
78
|
+
display: "flex",
|
|
79
|
+
flexWrap: "wrap",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
gap: 1,
|
|
82
|
+
minWidth: 0,
|
|
83
|
+
...n
|
|
84
|
+
},
|
|
85
|
+
...i,
|
|
86
|
+
children: t
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
d.displayName = "FormatRow";
|
|
90
|
+
var f = t((e) => {
|
|
91
|
+
let { children: t, sx: n, ...i } = e;
|
|
92
|
+
return r(a, {
|
|
93
|
+
sx: {
|
|
94
|
+
display: "flex",
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
gap: .25,
|
|
97
|
+
flexWrap: "wrap",
|
|
98
|
+
minWidth: 0,
|
|
99
|
+
...n
|
|
100
|
+
},
|
|
101
|
+
...i,
|
|
102
|
+
children: t
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
f.displayName = "FormatButtonGroup";
|
|
106
|
+
export { s as a, u as i, c as n, l as o, d as r, f as t };
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.17
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import { t as e } from "./g_bvg4HpyaF6f_JY.mjs";
|
|
8
|
+
import { useCallbackRef as t, useTranslator as n } from "@sheetxl/utils-react";
|
|
9
|
+
import { memo as r, useMemo as i, useState as a } from "react";
|
|
10
|
+
import { OptionsDialog as ee } from "@sheetxl/utils-mui";
|
|
11
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
12
|
+
import { Box as c, List as te, ListItemButton as l, ListItemText as u, MenuItem as d, Tab as f, Tabs as p, TextField as m, Typography as h } from "@mui/material";
|
|
13
|
+
import { messageKey as g } from "@sheetxl/utils";
|
|
14
|
+
var _ = ["Ok", "Cancel"], v = [
|
|
15
|
+
"sum",
|
|
16
|
+
"count",
|
|
17
|
+
"average",
|
|
18
|
+
"max",
|
|
19
|
+
"min",
|
|
20
|
+
"product",
|
|
21
|
+
"countNums",
|
|
22
|
+
"stdDev",
|
|
23
|
+
"stdDevp",
|
|
24
|
+
"var",
|
|
25
|
+
"varp"
|
|
26
|
+
], y = {
|
|
27
|
+
sum: g("pivot.function.sum"),
|
|
28
|
+
count: g("pivot.function.count"),
|
|
29
|
+
average: g("pivot.function.average"),
|
|
30
|
+
max: g("pivot.function.max"),
|
|
31
|
+
min: g("pivot.function.min"),
|
|
32
|
+
product: g("pivot.function.product"),
|
|
33
|
+
countNums: g("pivot.function.countNums"),
|
|
34
|
+
stdDev: g("pivot.function.stdDev"),
|
|
35
|
+
stdDevp: g("pivot.function.stdDevp"),
|
|
36
|
+
var: g("pivot.function.var"),
|
|
37
|
+
varp: g("pivot.function.varp")
|
|
38
|
+
}, ne = [
|
|
39
|
+
"normal",
|
|
40
|
+
"percentOfTotal",
|
|
41
|
+
"percentOfCol",
|
|
42
|
+
"percentOfRow",
|
|
43
|
+
"percent",
|
|
44
|
+
"percentOfParentRow",
|
|
45
|
+
"percentOfParentCol",
|
|
46
|
+
"percentOfParent",
|
|
47
|
+
"difference",
|
|
48
|
+
"percentDiff",
|
|
49
|
+
"runTotal",
|
|
50
|
+
"percentOfRunningTotal",
|
|
51
|
+
"rankAscending",
|
|
52
|
+
"rankDescending",
|
|
53
|
+
"index"
|
|
54
|
+
], re = {
|
|
55
|
+
normal: g("pivotValueSettings.kind.normal"),
|
|
56
|
+
percentOfTotal: g("pivotValueSettings.kind.percentOfTotal"),
|
|
57
|
+
percentOfCol: g("pivotValueSettings.kind.percentOfCol"),
|
|
58
|
+
percentOfRow: g("pivotValueSettings.kind.percentOfRow"),
|
|
59
|
+
percent: g("pivotValueSettings.kind.percent"),
|
|
60
|
+
percentOfParentRow: g("pivotValueSettings.kind.percentOfParentRow"),
|
|
61
|
+
percentOfParentCol: g("pivotValueSettings.kind.percentOfParentCol"),
|
|
62
|
+
percentOfParent: g("pivotValueSettings.kind.percentOfParent"),
|
|
63
|
+
difference: g("pivotValueSettings.kind.difference"),
|
|
64
|
+
percentDiff: g("pivotValueSettings.kind.percentDiff"),
|
|
65
|
+
runTotal: g("pivotValueSettings.kind.runTotal"),
|
|
66
|
+
percentOfRunningTotal: g("pivotValueSettings.kind.percentOfRunningTotal"),
|
|
67
|
+
rankAscending: g("pivotValueSettings.kind.rankAscending"),
|
|
68
|
+
rankDescending: g("pivotValueSettings.kind.rankDescending"),
|
|
69
|
+
index: g("pivotValueSettings.kind.index")
|
|
70
|
+
}, b = /* @__PURE__ */ new Set([
|
|
71
|
+
"percent",
|
|
72
|
+
"percentOfParent",
|
|
73
|
+
"difference",
|
|
74
|
+
"percentDiff",
|
|
75
|
+
"runTotal",
|
|
76
|
+
"percentOfRunningTotal",
|
|
77
|
+
"rankAscending",
|
|
78
|
+
"rankDescending"
|
|
79
|
+
]), x = /* @__PURE__ */ new Set([
|
|
80
|
+
"percent",
|
|
81
|
+
"difference",
|
|
82
|
+
"percentDiff"
|
|
83
|
+
]), S = "(previous)", C = r((r) => {
|
|
84
|
+
let { initialValue: g, onOption: C, onValidateOption: w, onInput: T, onDone: E, options: D = _, defaultOption: O = D?.[0], cancelOption: k = "Cancel", sx: A, ...j } = r, M = n(), N = g.value, P = i(() => ({
|
|
85
|
+
name: N.getName(),
|
|
86
|
+
fn: N.getFunction(),
|
|
87
|
+
showAs: N.getShowAs(),
|
|
88
|
+
numberFormat: N.getNumberFormat()
|
|
89
|
+
}), [N]), F = i(() => N.getPivotTable().getFields(), [N]), [I, L] = a("function"), [R, z] = a(P.name), [B, V] = a(!1), [H, U] = a(P.fn), [W, G] = a(P.showAs?.kind ?? "normal"), [K, q] = a(P.showAs?.baseField ?? F[0]?.getName() ?? ""), [J, Y] = a(P.showAs?.baseItem ?? S), [X, ie] = a(P.numberFormat), [Z, ae] = a(!1), oe = i(() => {
|
|
90
|
+
let e = F.find((e) => e.getName() === K);
|
|
91
|
+
return e ? e.getItems().map((e) => e.getName()) : [];
|
|
92
|
+
}, [F, K]), Q = (e) => {
|
|
93
|
+
U(e), B || z(N.getCaptionFor(e));
|
|
94
|
+
}, se = () => {
|
|
95
|
+
let e = W === "normal" ? null : {
|
|
96
|
+
kind: W,
|
|
97
|
+
...b.has(W) ? { baseField: K } : {},
|
|
98
|
+
...x.has(W) ? { baseItem: J } : {}
|
|
99
|
+
}, t = R.trim();
|
|
100
|
+
return {
|
|
101
|
+
...H === P.fn ? {} : { function: H },
|
|
102
|
+
...(n = e, r = P.showAs, (n?.kind ?? null) !== (r?.kind ?? null) || n?.baseField !== r?.baseField || n?.baseItem !== r?.baseItem ? { showAs: e } : {}),
|
|
103
|
+
...Z && X !== P.numberFormat ? { numberFormat: X } : {},
|
|
104
|
+
...B && t && t !== N.getCaptionFor(H) ? { name: t } : {}
|
|
105
|
+
};
|
|
106
|
+
var n, r;
|
|
107
|
+
}, $ = t(async (e) => {
|
|
108
|
+
let t = e === k;
|
|
109
|
+
t || T?.({
|
|
110
|
+
value: N,
|
|
111
|
+
changes: se()
|
|
112
|
+
}, e), C?.(e, t, e === O), E?.();
|
|
113
|
+
}, [
|
|
114
|
+
T,
|
|
115
|
+
E,
|
|
116
|
+
C,
|
|
117
|
+
k,
|
|
118
|
+
O,
|
|
119
|
+
N,
|
|
120
|
+
H,
|
|
121
|
+
W,
|
|
122
|
+
K,
|
|
123
|
+
J,
|
|
124
|
+
X,
|
|
125
|
+
Z,
|
|
126
|
+
R,
|
|
127
|
+
B
|
|
128
|
+
]);
|
|
129
|
+
return o(ee, {
|
|
130
|
+
title: M("pivotValueSettings.title"),
|
|
131
|
+
options: D,
|
|
132
|
+
onDone: E,
|
|
133
|
+
onOption: (e) => $(e),
|
|
134
|
+
onValidateOption: w,
|
|
135
|
+
defaultOption: O,
|
|
136
|
+
cancelOption: k,
|
|
137
|
+
autoFocusSel: ".autoFocus input",
|
|
138
|
+
sx: {
|
|
139
|
+
width: "440px",
|
|
140
|
+
...A
|
|
141
|
+
},
|
|
142
|
+
...j,
|
|
143
|
+
children: s(c, {
|
|
144
|
+
sx: {
|
|
145
|
+
display: "flex",
|
|
146
|
+
flexDirection: "column",
|
|
147
|
+
gap: (e) => e.spacing(1.5)
|
|
148
|
+
},
|
|
149
|
+
children: [
|
|
150
|
+
o(h, {
|
|
151
|
+
variant: "body2",
|
|
152
|
+
className: "pivot-source-name",
|
|
153
|
+
children: M("pivotValueSettings.sourceName", { name: N.getField().getName() })
|
|
154
|
+
}),
|
|
155
|
+
o(m, {
|
|
156
|
+
className: "autoFocus",
|
|
157
|
+
size: "small",
|
|
158
|
+
label: M("pivotValueSettings.customName"),
|
|
159
|
+
value: R,
|
|
160
|
+
onChange: (e) => {
|
|
161
|
+
z(e.target.value), V(!0);
|
|
162
|
+
}
|
|
163
|
+
}),
|
|
164
|
+
s(p, {
|
|
165
|
+
value: I,
|
|
166
|
+
onChange: (e, t) => L(t),
|
|
167
|
+
sx: {
|
|
168
|
+
minHeight: "36px",
|
|
169
|
+
borderBottom: 1,
|
|
170
|
+
borderColor: "divider",
|
|
171
|
+
"& .MuiTab-root": {
|
|
172
|
+
minHeight: "36px",
|
|
173
|
+
textTransform: "none",
|
|
174
|
+
pt: .5,
|
|
175
|
+
pb: .5,
|
|
176
|
+
px: 1.5,
|
|
177
|
+
minWidth: 0
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
children: [
|
|
181
|
+
o(f, {
|
|
182
|
+
value: "function",
|
|
183
|
+
label: M("pivotValueSettings.tabFunction")
|
|
184
|
+
}),
|
|
185
|
+
o(f, {
|
|
186
|
+
value: "showAs",
|
|
187
|
+
label: M("pivotValueSettings.tabShowAs")
|
|
188
|
+
}),
|
|
189
|
+
o(f, {
|
|
190
|
+
value: "numberFormat",
|
|
191
|
+
label: M("pivotValueSettings.tabNumberFormat")
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
}),
|
|
195
|
+
s(c, {
|
|
196
|
+
sx: {
|
|
197
|
+
height: "300px",
|
|
198
|
+
overflow: "auto"
|
|
199
|
+
},
|
|
200
|
+
children: [
|
|
201
|
+
I === "function" ? o(te, {
|
|
202
|
+
dense: !0,
|
|
203
|
+
disablePadding: !0,
|
|
204
|
+
role: "listbox",
|
|
205
|
+
"aria-label": M("pivotValueSettings.tabFunction"),
|
|
206
|
+
className: "pivot-functions",
|
|
207
|
+
children: v.map((e) => o(l, {
|
|
208
|
+
role: "option",
|
|
209
|
+
"aria-selected": e === H,
|
|
210
|
+
selected: e === H,
|
|
211
|
+
onClick: () => Q(e),
|
|
212
|
+
onDoubleClick: () => {
|
|
213
|
+
Q(e), $(O);
|
|
214
|
+
},
|
|
215
|
+
children: o(u, { primary: M(y[e]) })
|
|
216
|
+
}, e))
|
|
217
|
+
}) : null,
|
|
218
|
+
I === "showAs" ? s(c, {
|
|
219
|
+
sx: {
|
|
220
|
+
display: "flex",
|
|
221
|
+
flexDirection: "column",
|
|
222
|
+
gap: (e) => e.spacing(2),
|
|
223
|
+
pt: 1
|
|
224
|
+
},
|
|
225
|
+
children: [
|
|
226
|
+
o(m, {
|
|
227
|
+
select: !0,
|
|
228
|
+
size: "small",
|
|
229
|
+
className: "pivot-show-as",
|
|
230
|
+
label: M("pivotValueSettings.showAs"),
|
|
231
|
+
value: W,
|
|
232
|
+
onChange: (e) => G(e.target.value),
|
|
233
|
+
children: ne.map((e) => o(d, {
|
|
234
|
+
value: e,
|
|
235
|
+
children: M(re[e])
|
|
236
|
+
}, e))
|
|
237
|
+
}),
|
|
238
|
+
o(m, {
|
|
239
|
+
select: !0,
|
|
240
|
+
size: "small",
|
|
241
|
+
className: "pivot-base-field",
|
|
242
|
+
label: M("pivotValueSettings.baseField"),
|
|
243
|
+
value: K,
|
|
244
|
+
disabled: !b.has(W),
|
|
245
|
+
onChange: (e) => {
|
|
246
|
+
q(e.target.value), Y(S);
|
|
247
|
+
},
|
|
248
|
+
children: F.map((e) => o(d, {
|
|
249
|
+
value: e.getName(),
|
|
250
|
+
children: e.getName()
|
|
251
|
+
}, e.getName()))
|
|
252
|
+
}),
|
|
253
|
+
s(m, {
|
|
254
|
+
select: !0,
|
|
255
|
+
size: "small",
|
|
256
|
+
className: "pivot-base-item",
|
|
257
|
+
label: M("pivotValueSettings.baseItem"),
|
|
258
|
+
value: J,
|
|
259
|
+
disabled: !x.has(W),
|
|
260
|
+
onChange: (e) => Y(e.target.value),
|
|
261
|
+
children: [
|
|
262
|
+
o(d, {
|
|
263
|
+
value: S,
|
|
264
|
+
children: M("pivotValueSettings.previous")
|
|
265
|
+
}),
|
|
266
|
+
o(d, {
|
|
267
|
+
value: "(next)",
|
|
268
|
+
children: M("pivotValueSettings.next")
|
|
269
|
+
}),
|
|
270
|
+
oe.map((e) => o(d, {
|
|
271
|
+
value: e,
|
|
272
|
+
children: e
|
|
273
|
+
}, e))
|
|
274
|
+
]
|
|
275
|
+
})
|
|
276
|
+
]
|
|
277
|
+
}) : null,
|
|
278
|
+
I === "numberFormat" ? o(e, {
|
|
279
|
+
value: X,
|
|
280
|
+
onChange: (e) => {
|
|
281
|
+
ie(e), ae(!0);
|
|
282
|
+
},
|
|
283
|
+
onCommit: () => {
|
|
284
|
+
$(O);
|
|
285
|
+
}
|
|
286
|
+
}) : null
|
|
287
|
+
]
|
|
288
|
+
})
|
|
289
|
+
]
|
|
290
|
+
})
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
C.displayName = "PivotValueSettingsDialog";
|
|
294
|
+
export { C as PivotValueSettingsDialog, C as default };
|
|
@@ -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.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.17
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License:
|
|
5
|
+
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
import { useCallbackRef as e, useTranslator as t } from "@sheetxl/utils-react";
|
|
8
8
|
import { memo as n, useState as r } from "react";
|