@sheetxl/studio-mui 0.8.0-beta.10 → 0.8.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/esm/0BWO0bLZ8Vm_dKd2.mjs +582 -0
- package/browser/esm/BAbq4-I5f5oUiNaF.mjs +141 -0
- package/browser/esm/BED6h6YAwCf1HEQJ.mjs +161 -0
- package/browser/esm/{CEvZe2cZK-voZTif.mjs → BXhNFzyEGokTF-BL.mjs} +5 -5
- package/browser/esm/BYE9gCDWKyx6mnVs.mjs +381 -0
- package/browser/esm/{DBtc4lku0uHVcqWn.mjs → BjvD_4t2KGsZP5V8.mjs} +3 -3
- package/browser/esm/{DU3J8Gcf-WpBxNYg.mjs → BknfGJouygmnpFIU.mjs} +4 -4
- package/browser/esm/{D8al_cJ4U-NgzwoK.mjs → BlE_8o8tO2AgAlaj.mjs} +19 -17
- package/browser/esm/BokqKEpU6TFgfRs6.mjs +252 -0
- package/browser/esm/{DHY19rkSiiRZxShC.mjs → Brsh5yscJ_4uKFXp.mjs} +3 -3
- package/browser/esm/Bujtz_Guj88d03vI.mjs +831 -0
- package/browser/esm/Buqcl7J75MJrhpVE.mjs +1379 -0
- package/browser/esm/BvhYPwX3GrRaO9CM.mjs +319 -0
- package/browser/esm/C0wlMAIn9iREPK6w.mjs +87 -0
- package/browser/esm/C8JU4KsMasmLvojI.mjs +103 -0
- package/browser/esm/{CjznclrKqJRi7u9O.mjs → C9pIZVACtl9unFOp.mjs} +2 -2
- package/browser/esm/CBD4RiRKbbZtSXV-.mjs +318 -0
- package/browser/esm/{Blaj2R5hYxtLAW__.mjs → CEtXsBzEjEKk9GOj.mjs} +6 -6
- package/browser/esm/{CIu1bjPJe_x31Oww.mjs → COlZu93LRwuBvjE-.mjs} +3 -3
- package/browser/esm/{CoSiOS-og0zFw4Ws.mjs → CTjqDD-swFMZzI-Y.mjs} +2 -2
- package/browser/esm/CWkOgdL7mOKiTR62.mjs +975 -0
- package/browser/esm/ChSVxkPTIjgcC8PL.mjs +412 -0
- package/browser/esm/{5cbK03T_Oh3tNdR7.mjs → ClBvNPeNCAhuVWrG.mjs} +1 -1
- package/browser/esm/CyLn6zOOp_biA3xU.mjs +335 -0
- package/browser/esm/CynTY0oNtyJnoaBq.mjs +14 -0
- package/browser/esm/{xKiLJKiLxto8SayF.mjs → D3rRUK4dIM5gUSmj.mjs} +2 -2
- package/browser/esm/D9ISy7VkaRRFJl46.mjs +515 -0
- package/browser/esm/{fb126BNj3F8URR19.mjs → DDc6rDuU9JAo1DH_.mjs} +3 -3
- package/browser/esm/DDczwkXhz_MHub4z.mjs +197 -0
- package/browser/esm/{X1Db3b_7b_7OuCk6.mjs → DEv4pIEgYr5C7etm.mjs} +1 -1
- package/browser/esm/DG21x7RKDpge6zAE.mjs +31 -0
- package/browser/esm/DJOOed_OtB-XT7f3.mjs +437 -0
- package/browser/esm/{9eKCkvqpMQwqcXiw.mjs → DKtJxrpN0axtuQ0l.mjs} +1 -1
- package/browser/esm/DRSCS6aLiYmPjUz1.mjs +1543 -0
- package/browser/esm/{ByeL_BZuJ2kl8gtf.mjs → DTpRkgsTm_zYnWfW.mjs} +1 -1
- package/browser/esm/DV6i9RQZfJiKtEaJ.mjs +2552 -0
- package/browser/esm/DdcZrjMLWVukWcU5.mjs +7473 -0
- package/browser/esm/Di3BUxA0SqFWWgeg.mjs +94 -0
- package/browser/esm/DnGaP5F7mLwCGUYG.mjs +408 -0
- package/browser/esm/DpD4fg2WcyiKX_2K.mjs +414 -0
- package/browser/esm/{C1Rp2hZrApo5MUc8.mjs → Ds3XRkne7HxcXD8J.mjs} +2 -2
- package/browser/esm/{sFOAxZpxXo-qvDSp.mjs → DsoNMWDwHZP8UXQd.mjs} +1 -1
- package/browser/esm/G0Inqm6Eqw47dMpa.mjs +212 -0
- package/browser/esm/{B1Yp_uy1vFHcJB3U.mjs → HViD4Wfoi0mmqk9w.mjs} +1 -1
- package/browser/esm/LZoYSQAYV2wksnDv.mjs +386 -0
- package/browser/esm/{CtEFHbzYNvYjDYvi.mjs → QgaAIDUMmBQBsXP9.mjs} +8 -8
- package/browser/esm/{D6S8kVTzOjCn0-SK.mjs → YThnrg3PadGs7B4j.mjs} +51 -51
- package/browser/esm/index.mjs +1028 -170
- package/browser/esm/ttjcNHcFn8O6hfnd.mjs +1288 -0
- package/browser/esm/{yZxC4qUENOlMhVUH.mjs → w_JrR69vEpvoyeMy.mjs} +1 -1
- package/browser/esm/{DmCQbW4zwkT_Rq88.mjs → xFqkfN8QMCxvsetB.mjs} +1 -1
- package/browser/esm/{IQLeaAbtGTipUsOD.mjs → zqilJefihVd7At2T.mjs} +22 -21
- package/licenses/dependencies.txt +94 -94
- package/node/esm/{BYsG3KYVmxSe_CIQ.mjs → 1bf4gn-2vld4BZ9u.mjs} +1 -1
- package/node/esm/{CKu1AtRgyltyEdEN.mjs → 3WghtBXAvCDwcVrq.mjs} +1 -1
- package/node/esm/{cqzp431iNSLWictb.mjs → 4HmLH0bPVJCZLgik.mjs} +22 -22
- package/node/esm/{BYVLi0md4AYuDsB_.mjs → B0bdb_6p7fQI_ivo.mjs} +28 -28
- package/node/esm/BIMkjQUwG4Ih-6Sh.mjs +142 -0
- package/node/esm/BNg4QQY0WAPLE0q7.mjs +141 -0
- package/node/esm/BPzcW4BejRqso338.mjs +72 -0
- package/node/esm/BR45ogAR-hY2bE60.mjs +318 -0
- package/node/esm/BlN7G0DVC24zauig.mjs +197 -0
- package/node/esm/{ah3CUg4-VmNstGk_.mjs → Bph-sR3l6AYWeuxK.mjs} +2 -2
- package/node/esm/CPq-MIdEnc-53JpF.mjs +319 -0
- package/node/esm/CSAnTp5rwId0DUb8.mjs +380 -0
- package/node/esm/CWcv7UVXF8IUB0PC.mjs +1379 -0
- package/node/esm/{D9rzScOA9pEYFrtz.mjs → CYIoK22I6Yvv12_x.mjs} +20 -20
- package/node/esm/CZyA9uD4SkTvqp_G.mjs +1283 -0
- package/node/esm/{ci8d-mF1H9wnYzix.mjs → CjC6s3RUJQNCF7mP.mjs} +1 -1
- package/node/esm/{D6oQL8knsPpgdXuk.mjs → CuMePia6i_8yfJ6S.mjs} +9 -9
- package/node/esm/CvRbu8JPxFarsSR-.mjs +412 -0
- package/node/esm/{DNSjK5DAH3M14Qbc.mjs → CyafafEgfmjLqE5O.mjs} +1 -1
- package/node/esm/D-xqQ5qOSd6WrzwJ.mjs +94 -0
- package/node/esm/DLqBHdFp6wvm6EGs.mjs +212 -0
- package/node/esm/{BcwMb6CyVfvEwbHn.mjs → DMXLxp3T0E0SRTQc.mjs} +1 -1
- package/node/esm/{DZzvTQxIKr9LbEsA.mjs → DWqvf4H5F2wMnZ0L.mjs} +32 -30
- package/node/esm/DatM6eEYPpAtIMy-.mjs +405 -0
- package/node/esm/Db3dbaYLKUO66T9s.mjs +1689 -0
- package/node/esm/{B_jRGdwGFkudwmL-.mjs → DdEzhVqYTrGODXrz.mjs} +1 -1
- package/node/esm/DeZJlLk8WJ3BLtLs.mjs +975 -0
- package/node/esm/DfCuL8AUxMFoEG2s.mjs +519 -0
- package/node/esm/{Bb1sLMqXWKjdve23.mjs → Do-zCKziWhoG5eAv.mjs} +2 -2
- package/node/esm/{B8SQfjKjzYHLxzZR.mjs → DpJ2gmZJioCyq8La.mjs} +67 -67
- package/node/esm/{ETK6T6G0SIcFXDe5.mjs → XEDcegsv5AGKBfu2.mjs} +40 -40
- package/node/esm/index.mjs +8941 -13558
- package/node/esm/yCUxQuqVuC4DHKPx.mjs +385 -0
- package/node/esm/zITjZ7R4raDqhP-n.mjs +515 -0
- package/package.json +9 -9
- package/resources/locales/de/ui.msg.json +97 -0
- package/resources/locales/en/ui.msg.json +97 -0
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +4 -4
- package/types/src/anomalies/AnomaliesPlugin.d.ts +5 -0
- package/types/src/anomalies/AnomaliesTaskPane.d.ts +17 -0
- package/types/src/anomalies/index.d.ts +3 -0
- package/types/src/border/BorderTemplateIcon.d.ts +6 -1
- package/types/src/chart/ChartFormatPanel.d.ts +20 -0
- package/types/src/chart/ChartPlugin.d.ts +6 -0
- package/types/src/chart/index.d.ts +3 -0
- package/types/src/comments/CommentCard.d.ts +2 -2
- package/types/src/conditions/useFormulaOption.d.ts +2 -2
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
- package/types/src/format/BorderPreview.d.ts +11 -4
- package/types/src/format/useFormatSelection.d.ts +4 -4
- package/types/src/formulaBar/MobileFormulaBar.d.ts +18 -6
- package/types/src/formulaBar/MobileInputToolbar.d.ts +9 -3
- package/types/src/formulaBar/useFormulaBarSession.d.ts +6 -3
- package/types/src/index.d.ts +15 -6
- package/types/src/protection/ProtectedCellsPanel.d.ts +2 -2
- package/types/src/protection/{SheetProtectionPanel.d.ts → WorksheetProtectionPanel.d.ts} +6 -6
- package/types/src/protection/index.d.ts +1 -1
- package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +2 -2
- package/types/src/workbook/DefaultRenderers.d.ts +2 -2
- package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
- package/browser/esm/Biy7bhzzzPb5sfRN.mjs +0 -152
- package/browser/esm/COv-m-c2byCgvU3M.mjs +0 -14861
- package/browser/esm/Die9NXVFveHvcCT-.mjs +0 -4205
- package/browser/esm/sam1KGQZ59B_fADz.mjs +0 -1941
- package/node/esm/BYwXhrEwkRAt9nJS.mjs +0 -71
- package/node/esm/Cmt8Wv806N7NmE4Y.mjs +0 -3344
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.11
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { ColorPopupButton as e, StyledStrokeIcon as l } from "./index.mjs";
|
|
8
|
+
import { a as i, c as n, i as o, o as t } from "./BR45ogAR-hY2bE60.mjs";
|
|
9
|
+
import { IFill as a, IStroke as s } from "@sheetxl/sdk";
|
|
10
|
+
import { KeyCodes as d, useCallbackRef as r, useTranslator as p } from "@sheetxl/utils-react";
|
|
11
|
+
import { memo as h, useCallback as c, useMemo as y } from "react";
|
|
12
|
+
import { ExhibitIconButton as D, ExhibitMenuItem as u, ExhibitPopupIconButton as m, ExhibitPopupMenuItem as S, createStrokeShadowFilter as L } from "@sheetxl/utils-mui";
|
|
13
|
+
import { Fragment as g, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
|
+
import { Box as k, FormControl as f, InputLabel as v, MenuItem as E, Select as T } from "@mui/material";
|
|
15
|
+
import { messageKey as $ } from "@sheetxl/utils";
|
|
16
|
+
import z from "clsx";
|
|
17
|
+
var C = {
|
|
18
|
+
[s.DashStyle.Solid]: null,
|
|
19
|
+
[s.DashStyle.Dot]: [1, 3],
|
|
20
|
+
[s.DashStyle.Dash]: [4, 3],
|
|
21
|
+
[s.DashStyle.LongDash]: [8, 3],
|
|
22
|
+
[s.DashStyle.DashDot]: [
|
|
23
|
+
4,
|
|
24
|
+
3,
|
|
25
|
+
1,
|
|
26
|
+
3
|
|
27
|
+
],
|
|
28
|
+
[s.DashStyle.LongDashDot]: [
|
|
29
|
+
8,
|
|
30
|
+
3,
|
|
31
|
+
1,
|
|
32
|
+
3
|
|
33
|
+
],
|
|
34
|
+
[s.DashStyle.LongDashDotDot]: [
|
|
35
|
+
8,
|
|
36
|
+
3,
|
|
37
|
+
1,
|
|
38
|
+
3,
|
|
39
|
+
1,
|
|
40
|
+
3
|
|
41
|
+
],
|
|
42
|
+
[s.DashStyle.SysDash]: [3, 1],
|
|
43
|
+
[s.DashStyle.SysDot]: [1, 1],
|
|
44
|
+
[s.DashStyle.SysDashDot]: [
|
|
45
|
+
3,
|
|
46
|
+
1,
|
|
47
|
+
1,
|
|
48
|
+
1
|
|
49
|
+
],
|
|
50
|
+
[s.DashStyle.SysDashDotDot]: [
|
|
51
|
+
3,
|
|
52
|
+
1,
|
|
53
|
+
1,
|
|
54
|
+
1,
|
|
55
|
+
1,
|
|
56
|
+
1
|
|
57
|
+
]
|
|
58
|
+
}, M = h((e) => {
|
|
59
|
+
const { dash: i, color: n, darkMode: o } = e, t = Array.isArray(i) ? i : C[i] ?? null;
|
|
60
|
+
return b(l, {
|
|
61
|
+
styleColor: n,
|
|
62
|
+
length: 60,
|
|
63
|
+
width: 2,
|
|
64
|
+
darkMode: o,
|
|
65
|
+
dashArray: t ? t.map((e) => 2 * e) : void 0
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
M.displayName = "DashIcon";
|
|
69
|
+
var w = {
|
|
70
|
+
sm: 2.5,
|
|
71
|
+
med: 4,
|
|
72
|
+
lg: 6
|
|
73
|
+
}, R = {
|
|
74
|
+
sm: 5,
|
|
75
|
+
med: 8,
|
|
76
|
+
lg: 12
|
|
77
|
+
}, A = h((e) => {
|
|
78
|
+
const { end: l, atStart: i = !1, color: n, darkMode: o = !1 } = e, t = 19, a = w[l.width ?? s.LineEndSize.Medium], d = R[l.length ?? s.LineEndSize.Medium];
|
|
79
|
+
let r = null, p = t;
|
|
80
|
+
switch (l.type) {
|
|
81
|
+
case s.LineEndType.Triangle:
|
|
82
|
+
r = b("polygon", { points: `19,8 ${t - d},${8 - a} ${t - d},${8 + a}` }), p = t - d;
|
|
83
|
+
break;
|
|
84
|
+
case s.LineEndType.Stealth:
|
|
85
|
+
r = b("polygon", { points: `19,8 ${t - d},${8 - a} ${t - .6 * d},8 ${t - d},${8 + a}` }), p = t - .6 * d;
|
|
86
|
+
break;
|
|
87
|
+
case s.LineEndType.Diamond:
|
|
88
|
+
r = b("polygon", { points: `19,8 ${t - d / 2},${8 - a} ${t - d},8 ${t - d / 2},${8 + a}` }), p = t - d;
|
|
89
|
+
break;
|
|
90
|
+
case s.LineEndType.Oval:
|
|
91
|
+
r = b("ellipse", {
|
|
92
|
+
cx: t - d / 2,
|
|
93
|
+
cy: 8,
|
|
94
|
+
rx: d / 2,
|
|
95
|
+
ry: a
|
|
96
|
+
}), p = t - d;
|
|
97
|
+
break;
|
|
98
|
+
case s.LineEndType.Arrow: r = b("polyline", {
|
|
99
|
+
points: `${t - d},${8 - a} 19,8 ${t - d},${8 + a}`,
|
|
100
|
+
fill: "none",
|
|
101
|
+
strokeWidth: 2,
|
|
102
|
+
strokeLinecap: "round",
|
|
103
|
+
strokeLinejoin: "round"
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const h = n ? n.toRGBA(o).toString() : "currentColor";
|
|
107
|
+
return x(k, {
|
|
108
|
+
component: "svg",
|
|
109
|
+
width: 20,
|
|
110
|
+
height: 16,
|
|
111
|
+
viewBox: "0 0 20 16",
|
|
112
|
+
sx: {
|
|
113
|
+
display: "block",
|
|
114
|
+
overflow: "visible",
|
|
115
|
+
fill: h,
|
|
116
|
+
stroke: h,
|
|
117
|
+
filter: L(),
|
|
118
|
+
transform: i ? "scaleX(-1)" : void 0
|
|
119
|
+
},
|
|
120
|
+
children: [b("line", {
|
|
121
|
+
x1: 1,
|
|
122
|
+
y1: 8,
|
|
123
|
+
x2: p,
|
|
124
|
+
y2: 8,
|
|
125
|
+
strokeWidth: 2
|
|
126
|
+
}), r]
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
A.displayName = "LineEndIcon";
|
|
130
|
+
var N = (e) => {
|
|
131
|
+
const { end: l, atStart: i = !1, color: n, darkMode: o, types: t, sizes: a, typeLabels: d, sizeLabels: r, widthLabel: p, lengthLabel: h, tooltip: y, disabled: L, onSelect: g } = e, x = c((e) => {
|
|
132
|
+
const { closeFloatAll: c, floatReference: y } = e, m = t.map((e) => {
|
|
133
|
+
const t = b(A, {
|
|
134
|
+
end: {
|
|
135
|
+
...l,
|
|
136
|
+
type: e
|
|
137
|
+
},
|
|
138
|
+
atStart: i,
|
|
139
|
+
color: n,
|
|
140
|
+
darkMode: o
|
|
141
|
+
}), m = e === l.type;
|
|
142
|
+
if (e === s.LineEndType.None) return b(u, {
|
|
143
|
+
icon: t,
|
|
144
|
+
selected: m,
|
|
145
|
+
disabled: L,
|
|
146
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
147
|
+
onMouseUp: () => {
|
|
148
|
+
c?.(), g(null);
|
|
149
|
+
},
|
|
150
|
+
children: d[e]
|
|
151
|
+
}, e);
|
|
152
|
+
return b(S, {
|
|
153
|
+
icon: t,
|
|
154
|
+
label: d[e],
|
|
155
|
+
selected: m,
|
|
156
|
+
disabled: L,
|
|
157
|
+
parentFloat: y,
|
|
158
|
+
createPopupPanel: (t) => b(k, {
|
|
159
|
+
sx: {
|
|
160
|
+
display: "grid",
|
|
161
|
+
gridTemplateColumns: `repeat(${a.length}, auto)`,
|
|
162
|
+
gap: "2px",
|
|
163
|
+
padding: "6px 8px"
|
|
164
|
+
},
|
|
165
|
+
children: a.map((d) => a.map((a) => b(D, {
|
|
166
|
+
icon: b(A, {
|
|
167
|
+
end: {
|
|
168
|
+
type: e,
|
|
169
|
+
width: a,
|
|
170
|
+
length: d
|
|
171
|
+
},
|
|
172
|
+
atStart: i,
|
|
173
|
+
color: n,
|
|
174
|
+
darkMode: o
|
|
175
|
+
}),
|
|
176
|
+
selected: m && (l.width ?? s.LineEndSize.Medium) === a && (l.length ?? s.LineEndSize.Medium) === d,
|
|
177
|
+
disabled: L,
|
|
178
|
+
propsTooltip: {
|
|
179
|
+
label: `${p}: ${r[a]} · ${h}: ${r[d]}`,
|
|
180
|
+
simple: !0
|
|
181
|
+
},
|
|
182
|
+
onClick: () => {
|
|
183
|
+
t.closeFloatAll?.(), g({
|
|
184
|
+
type: e,
|
|
185
|
+
width: a,
|
|
186
|
+
length: d
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}, `${a}-${d}`)))
|
|
190
|
+
}),
|
|
191
|
+
onQuickClick: () => {
|
|
192
|
+
c?.(), g({
|
|
193
|
+
...l,
|
|
194
|
+
type: e
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}, e);
|
|
198
|
+
});
|
|
199
|
+
return b(k, {
|
|
200
|
+
sx: {
|
|
201
|
+
display: "flex",
|
|
202
|
+
flexDirection: "column",
|
|
203
|
+
paddingTop: "4px",
|
|
204
|
+
paddingBottom: "4px"
|
|
205
|
+
},
|
|
206
|
+
children: m
|
|
207
|
+
});
|
|
208
|
+
}, [
|
|
209
|
+
l,
|
|
210
|
+
i,
|
|
211
|
+
n,
|
|
212
|
+
o,
|
|
213
|
+
t,
|
|
214
|
+
a,
|
|
215
|
+
d,
|
|
216
|
+
r,
|
|
217
|
+
p,
|
|
218
|
+
h,
|
|
219
|
+
L,
|
|
220
|
+
g
|
|
221
|
+
]);
|
|
222
|
+
return b(m, {
|
|
223
|
+
disabled: L,
|
|
224
|
+
icon: b(k, {
|
|
225
|
+
sx: {
|
|
226
|
+
paddingLeft: "4px",
|
|
227
|
+
marginRight: "4px",
|
|
228
|
+
height: "24px",
|
|
229
|
+
display: "flex",
|
|
230
|
+
alignItems: "center"
|
|
231
|
+
},
|
|
232
|
+
children: b(A, {
|
|
233
|
+
end: l,
|
|
234
|
+
atStart: i,
|
|
235
|
+
color: n,
|
|
236
|
+
darkMode: o
|
|
237
|
+
})
|
|
238
|
+
}),
|
|
239
|
+
tooltip: y ? `${y}: ${d[l.type]}` : d[l.type],
|
|
240
|
+
createPopupPanel: x
|
|
241
|
+
});
|
|
242
|
+
}, j = (e) => {
|
|
243
|
+
const { value: l, options: i, onSelect: n, columns: o, tooltip: t, disabled: a, icon: s } = e, r = i.find((e) => e.value === l) ?? i[0], p = c((e) => {
|
|
244
|
+
const { closeFloat: t } = e;
|
|
245
|
+
return b(k, o ? {
|
|
246
|
+
sx: {
|
|
247
|
+
display: "grid",
|
|
248
|
+
gridTemplateColumns: `repeat(${o}, auto)`,
|
|
249
|
+
gap: "2px",
|
|
250
|
+
padding: "6px 8px"
|
|
251
|
+
},
|
|
252
|
+
children: i.map((e) => b(D, {
|
|
253
|
+
icon: e.icon,
|
|
254
|
+
selected: e.value === l,
|
|
255
|
+
disabled: a,
|
|
256
|
+
propsTooltip: {
|
|
257
|
+
label: e.label,
|
|
258
|
+
simple: !0
|
|
259
|
+
},
|
|
260
|
+
onClick: () => {
|
|
261
|
+
t?.(), n(e.value);
|
|
262
|
+
}
|
|
263
|
+
}, e.value))
|
|
264
|
+
} : {
|
|
265
|
+
sx: {
|
|
266
|
+
display: "flex",
|
|
267
|
+
flexDirection: "column",
|
|
268
|
+
paddingTop: "4px",
|
|
269
|
+
paddingBottom: "4px"
|
|
270
|
+
},
|
|
271
|
+
children: i.map((e) => b(u, {
|
|
272
|
+
tabIndex: 0,
|
|
273
|
+
sx: {
|
|
274
|
+
height: "28px",
|
|
275
|
+
paddingLeft: "16px"
|
|
276
|
+
},
|
|
277
|
+
propsTooltip: { description: e.label },
|
|
278
|
+
icon: null,
|
|
279
|
+
disabled: a,
|
|
280
|
+
selected: e.value === l,
|
|
281
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
282
|
+
onMouseUp: () => {
|
|
283
|
+
t?.(), n(e.value);
|
|
284
|
+
},
|
|
285
|
+
onKeyDown: (e) => {
|
|
286
|
+
e.which === d.Enter && t?.();
|
|
287
|
+
},
|
|
288
|
+
children: e.icon
|
|
289
|
+
}, e.value))
|
|
290
|
+
});
|
|
291
|
+
}, [
|
|
292
|
+
i,
|
|
293
|
+
l,
|
|
294
|
+
n,
|
|
295
|
+
o,
|
|
296
|
+
a
|
|
297
|
+
]);
|
|
298
|
+
return b(m, {
|
|
299
|
+
disabled: a,
|
|
300
|
+
icon: b(k, {
|
|
301
|
+
sx: {
|
|
302
|
+
paddingLeft: "4px",
|
|
303
|
+
marginRight: "4px",
|
|
304
|
+
height: "24px",
|
|
305
|
+
display: "flex",
|
|
306
|
+
alignItems: "center"
|
|
307
|
+
},
|
|
308
|
+
children: s ?? r?.icon
|
|
309
|
+
}),
|
|
310
|
+
tooltip: t ? `${t}: ${r?.label ?? ""}` : r?.label,
|
|
311
|
+
createPopupPanel: p
|
|
312
|
+
});
|
|
313
|
+
}, B = "none", J = "solid", P = [
|
|
314
|
+
s.DashStyle.Solid,
|
|
315
|
+
s.DashStyle.SysDot,
|
|
316
|
+
s.DashStyle.SysDash,
|
|
317
|
+
s.DashStyle.Dash,
|
|
318
|
+
s.DashStyle.DashDot,
|
|
319
|
+
s.DashStyle.LongDash,
|
|
320
|
+
s.DashStyle.LongDashDot,
|
|
321
|
+
s.DashStyle.LongDashDotDot
|
|
322
|
+
], W = "custom", F = [
|
|
323
|
+
s.LineCap.Square,
|
|
324
|
+
s.LineCap.Round,
|
|
325
|
+
s.LineCap.Butt
|
|
326
|
+
], I = [
|
|
327
|
+
s.LineJoin.Round,
|
|
328
|
+
s.LineJoin.Bevel,
|
|
329
|
+
s.LineJoin.Miter
|
|
330
|
+
], q = [
|
|
331
|
+
s.LineEndType.None,
|
|
332
|
+
s.LineEndType.Triangle,
|
|
333
|
+
s.LineEndType.Arrow,
|
|
334
|
+
s.LineEndType.Stealth,
|
|
335
|
+
s.LineEndType.Diamond,
|
|
336
|
+
s.LineEndType.Oval
|
|
337
|
+
], O = [
|
|
338
|
+
s.LineEndSize.Small,
|
|
339
|
+
s.LineEndSize.Medium,
|
|
340
|
+
s.LineEndSize.Large
|
|
341
|
+
], G = h((l) => {
|
|
342
|
+
const { selection: d, disabled: h, className: c, ...D } = l, u = p(), { stroke: m, stated: S, autoColor: L, applyStroke: C, schemeLookup: w, styles: R, darkMode: A } = d, G = h || d.disabled, U = m.isVisible(), H = U ? J : B, K = S?.fill && S.fill.type !== a.Type.None ? m.getFill().getColor() : null, Q = K ?? L, V = m.getDash(), X = "string" == typeof V && P.includes(V) ? V : W, Y = m.getHead(), Z = m.getTail(), _ = r(() => R.recentColors(), [R]), ee = r((e) => {
|
|
343
|
+
e !== H && C(e === B ? { fill: { type: a.Type.None } } : {
|
|
344
|
+
fill: null,
|
|
345
|
+
width: m.getWidth() > 0 ? void 0 : null
|
|
346
|
+
}, $("op.setShapeStroke"));
|
|
347
|
+
}, [
|
|
348
|
+
H,
|
|
349
|
+
m,
|
|
350
|
+
C
|
|
351
|
+
]), le = r((e, l) => {
|
|
352
|
+
e && l && R.addRecentColor(e), C({ fill: e ? e.toString() : null }, $("op.setStrokeColor"));
|
|
353
|
+
}, [C, R]), ie = r((e) => {
|
|
354
|
+
C({ width: e }, $("op.setStrokeWidth"));
|
|
355
|
+
}, [C]), ne = r((e) => {
|
|
356
|
+
e !== W && C({ dash: e }, $("op.setStrokeDash"));
|
|
357
|
+
}, [C]), oe = r((e) => {
|
|
358
|
+
C({ lineCap: e }, $("op.setStroke"));
|
|
359
|
+
}, [C]), te = r((e) => {
|
|
360
|
+
C({ lineJoin: e }, $("op.setStroke"));
|
|
361
|
+
}, [C]), ae = r((e, l) => {
|
|
362
|
+
C({ [e]: l }, $("op.setLineEnds"));
|
|
363
|
+
}, [C]), se = y(() => ({
|
|
364
|
+
dash: {
|
|
365
|
+
[s.DashStyle.Solid]: u("line.dash.solid"),
|
|
366
|
+
[s.DashStyle.SysDot]: u("line.dash.sysDot"),
|
|
367
|
+
[s.DashStyle.SysDash]: u("line.dash.sysDash"),
|
|
368
|
+
[s.DashStyle.Dash]: u("line.dash.dash"),
|
|
369
|
+
[s.DashStyle.DashDot]: u("line.dash.dashDot"),
|
|
370
|
+
[s.DashStyle.LongDash]: u("line.dash.lgDash"),
|
|
371
|
+
[s.DashStyle.LongDashDot]: u("line.dash.lgDashDot"),
|
|
372
|
+
[s.DashStyle.LongDashDotDot]: u("line.dash.lgDashDotDot"),
|
|
373
|
+
[W]: u("line.dashCustom")
|
|
374
|
+
},
|
|
375
|
+
cap: {
|
|
376
|
+
[s.LineCap.Square]: u("line.capSquare"),
|
|
377
|
+
[s.LineCap.Round]: u("line.capRound"),
|
|
378
|
+
[s.LineCap.Butt]: u("line.capFlat")
|
|
379
|
+
},
|
|
380
|
+
join: {
|
|
381
|
+
[s.LineJoin.Round]: u("line.joinRound"),
|
|
382
|
+
[s.LineJoin.Bevel]: u("line.joinBevel"),
|
|
383
|
+
[s.LineJoin.Miter]: u("line.joinMiter")
|
|
384
|
+
},
|
|
385
|
+
end: {
|
|
386
|
+
[s.LineEndType.None]: u("line.end.none"),
|
|
387
|
+
[s.LineEndType.Triangle]: u("line.end.triangle"),
|
|
388
|
+
[s.LineEndType.Arrow]: u("line.end.arrow"),
|
|
389
|
+
[s.LineEndType.Stealth]: u("line.end.stealth"),
|
|
390
|
+
[s.LineEndType.Diamond]: u("line.end.diamond"),
|
|
391
|
+
[s.LineEndType.Oval]: u("line.end.oval")
|
|
392
|
+
},
|
|
393
|
+
size: {
|
|
394
|
+
[s.LineEndSize.Small]: u("line.sizeSmall"),
|
|
395
|
+
[s.LineEndSize.Medium]: u("line.sizeMedium"),
|
|
396
|
+
[s.LineEndSize.Large]: u("line.sizeLarge")
|
|
397
|
+
}
|
|
398
|
+
}), [u]), de = P.map((e) => ({
|
|
399
|
+
value: e,
|
|
400
|
+
label: se.dash[e],
|
|
401
|
+
icon: b(M, {
|
|
402
|
+
dash: e,
|
|
403
|
+
color: Q,
|
|
404
|
+
darkMode: A
|
|
405
|
+
})
|
|
406
|
+
}));
|
|
407
|
+
X === W && de.push({
|
|
408
|
+
value: W,
|
|
409
|
+
label: se.dash[W],
|
|
410
|
+
icon: b(M, {
|
|
411
|
+
dash: V,
|
|
412
|
+
color: Q,
|
|
413
|
+
darkMode: A
|
|
414
|
+
})
|
|
415
|
+
});
|
|
416
|
+
const re = (e, l, i, n, o, t) => x(f, {
|
|
417
|
+
size: "small",
|
|
418
|
+
fullWidth: void 0 === t,
|
|
419
|
+
sx: void 0 === t ? void 0 : { width: t },
|
|
420
|
+
children: [b(v, {
|
|
421
|
+
shrink: !0,
|
|
422
|
+
children: e
|
|
423
|
+
}), b(T, {
|
|
424
|
+
label: e,
|
|
425
|
+
notched: !0,
|
|
426
|
+
disabled: G,
|
|
427
|
+
value: l,
|
|
428
|
+
onChange: (e) => o(e.target.value),
|
|
429
|
+
children: i.map((e) => b(E, {
|
|
430
|
+
value: e,
|
|
431
|
+
children: n[e]
|
|
432
|
+
}, e))
|
|
433
|
+
})]
|
|
434
|
+
});
|
|
435
|
+
return x(k, {
|
|
436
|
+
className: z("sxl-format-line-panel", c),
|
|
437
|
+
sx: n,
|
|
438
|
+
...D,
|
|
439
|
+
children: [b(t, { children: re(u("line.type"), H, [B, J], {
|
|
440
|
+
[B]: u("line.typeNone"),
|
|
441
|
+
[J]: u("line.typeSolid")
|
|
442
|
+
}, ee) }), U ? x(g, { children: [
|
|
443
|
+
b(t, {
|
|
444
|
+
label: u("line.color"),
|
|
445
|
+
children: x(i, { children: [b(e, {
|
|
446
|
+
icon: "stroke.colored",
|
|
447
|
+
disabled: G,
|
|
448
|
+
darkMode: A,
|
|
449
|
+
compareRGB: !0,
|
|
450
|
+
selectedColor: K,
|
|
451
|
+
onSelectColor: le,
|
|
452
|
+
propsPanel: {
|
|
453
|
+
disableAlpha: !0,
|
|
454
|
+
autoColor: L,
|
|
455
|
+
schemeLookup: w,
|
|
456
|
+
recentColors: _
|
|
457
|
+
}
|
|
458
|
+
}), b(o, {
|
|
459
|
+
label: u("line.width"),
|
|
460
|
+
value: m.getWidth(),
|
|
461
|
+
min: 0,
|
|
462
|
+
max: 1584,
|
|
463
|
+
step: .25,
|
|
464
|
+
decimals: !0,
|
|
465
|
+
width: 96,
|
|
466
|
+
disabled: G,
|
|
467
|
+
onChange: ie
|
|
468
|
+
})] })
|
|
469
|
+
}),
|
|
470
|
+
b(t, {
|
|
471
|
+
label: u("line.dashArrows"),
|
|
472
|
+
children: x(i, { children: [
|
|
473
|
+
b(N, {
|
|
474
|
+
end: Y,
|
|
475
|
+
atStart: !0,
|
|
476
|
+
color: Q,
|
|
477
|
+
darkMode: A,
|
|
478
|
+
types: q,
|
|
479
|
+
sizes: O,
|
|
480
|
+
typeLabels: se.end,
|
|
481
|
+
sizeLabels: se.size,
|
|
482
|
+
widthLabel: u("line.sizeWidth"),
|
|
483
|
+
lengthLabel: u("line.sizeLength"),
|
|
484
|
+
tooltip: u("line.head"),
|
|
485
|
+
disabled: G,
|
|
486
|
+
onSelect: (e) => ae("head", e)
|
|
487
|
+
}),
|
|
488
|
+
b(j, {
|
|
489
|
+
value: X,
|
|
490
|
+
options: de,
|
|
491
|
+
onSelect: ne,
|
|
492
|
+
tooltip: u("line.dash"),
|
|
493
|
+
disabled: G
|
|
494
|
+
}),
|
|
495
|
+
b(N, {
|
|
496
|
+
end: Z,
|
|
497
|
+
color: Q,
|
|
498
|
+
darkMode: A,
|
|
499
|
+
types: q,
|
|
500
|
+
sizes: O,
|
|
501
|
+
typeLabels: se.end,
|
|
502
|
+
sizeLabels: se.size,
|
|
503
|
+
widthLabel: u("line.sizeWidth"),
|
|
504
|
+
lengthLabel: u("line.sizeLength"),
|
|
505
|
+
tooltip: u("line.tail"),
|
|
506
|
+
disabled: G,
|
|
507
|
+
onSelect: (e) => ae("tail", e)
|
|
508
|
+
})
|
|
509
|
+
] })
|
|
510
|
+
}),
|
|
511
|
+
b(t, {
|
|
512
|
+
label: u("line.capJoin"),
|
|
513
|
+
children: x(i, { children: [re(u("line.cap"), m.getLineCap(), F, se.cap, oe, 128), re(u("line.join"), m.getLineJoin(), I, se.join, te, 128)] })
|
|
514
|
+
})
|
|
515
|
+
] }) : null]
|
|
516
|
+
});
|
|
517
|
+
});
|
|
518
|
+
G.displayName = "LinePanel";
|
|
519
|
+
export { G as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
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.11
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { a as t, i as e, n as a, r as i } from "./
|
|
7
|
+
import { a as t, i as e, n as a, r as i } from "./DpJ2gmZJioCyq8La.mjs";
|
|
8
8
|
import { useTranslator as o } from "@sheetxl/utils-react";
|
|
9
9
|
import { useCallback as r, useState as s } from "react";
|
|
10
10
|
import { InternalWindow as n } from "@sheetxl/utils-mui";
|