@sheetxl/studio-mui 1.0.4 → 1.0.6
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/{N5L4wQxRGEOH_wbp.mjs → 6wAcMpoIZS1ffzqR.mjs} +3 -3
- package/browser/esm/{DHmh3sMFGq4sRPhh.mjs → AVMBYVWPe170RO8d.mjs} +20 -20
- package/browser/esm/{D_r8MdiauI15ds00.mjs → B2k09pbNHOie-ZPU.mjs} +5 -5
- package/browser/esm/B5hj7BR72rs3Xx2-.mjs +40 -0
- package/browser/esm/{jDqohhLNEI6wqjo7.mjs → BK0H9A2QjD4YqPxq.mjs} +2 -2
- package/browser/esm/{CHfzSl32Bs6LVY3G.mjs → BMtR4PaoNnEhVh2U.mjs} +243 -245
- package/browser/esm/{DZngQvRDu3Qh7_uy.mjs → BVQX7HEZNPIvf0Bg.mjs} +1 -1
- package/browser/esm/BZWyHJnsP5yHfByl.mjs +461 -0
- package/browser/esm/{n1z1c9np4M3gMGCX.mjs → BaYDGaXi_5fNEPo1.mjs} +1 -1
- package/browser/esm/{B4vVBfkY4Oq6M196.mjs → BgOevzKxdIm3FqSz.mjs} +4 -4
- package/browser/esm/{BH1Qj4pv8pPWZVhO.mjs → BgvcXlX-fe99mlfa.mjs} +1 -1
- package/browser/esm/{BDSYU5nx_6eGxAa4.mjs → BmJRmCarQ2Y_DhcS.mjs} +6 -6
- package/browser/esm/{Cf6bsmEPyPpiNtxU.mjs → BnIfAdE8Qnu8RF3t.mjs} +1 -1
- package/browser/esm/{B130jd-PqNgY2pV8.mjs → Bu4IunF89gqzLc6A.mjs} +2 -2
- package/browser/esm/{B4EWee1CcAHS5vAA.mjs → BvvD5BVF5uSL-2Ow.mjs} +2 -2
- package/browser/esm/{CzWXYarhfF4mF8fj.mjs → Bzr0CzpORAOD9X-l.mjs} +1 -1
- package/browser/esm/{CEvJVwoVP9nscIcl.mjs → C-lKdgOAbn4Ycu7e.mjs} +2 -2
- package/browser/esm/{CFiyY-_XmW7G0_9y.mjs → C211u9yUXa4149g9.mjs} +1 -1
- package/browser/esm/{DoJ8N6FhUY0kYz9u.mjs → C7RPgX_8hKN1Umxm.mjs} +2 -2
- package/browser/esm/{DqP1sKmMsG0tKwmV.mjs → C9cBnewCaYFf2JV6.mjs} +21 -22
- package/browser/esm/{Cx1r__xbzz-5zZgw.mjs → CA42_0vpQwF292tA.mjs} +1 -1
- package/browser/esm/{D1WSqegx9Zbjc-cL.mjs → CAbY1N8X3Iryy2XC.mjs} +4 -4
- package/browser/esm/{k0bdGBFIHCTGANHW.mjs → CD6iCHysAki3ui3u.mjs} +4 -4
- package/browser/esm/{DVQZtsBbf_Fsh-B6.mjs → CFUur1yDoVOJMuo5.mjs} +1 -1
- package/browser/esm/{npsX_Rztx4_7rCGP.mjs → CHb2gapathcPfhdM.mjs} +5 -5
- package/browser/esm/{94_olh2OyEbGAcNw.mjs → CIZh3NmE8QG5ZkiA.mjs} +2 -2
- package/browser/esm/{BBNFlngSL8Y3242O.mjs → CImvd-NxbJGZOozE.mjs} +1 -1
- package/browser/esm/{Me9wSTkBepRyMDHH.mjs → CO-AxUDR6qjjgpyK.mjs} +2 -2
- package/browser/esm/CQ1ArTuEvBmc7W5I.mjs +695 -0
- package/browser/esm/{uV_YgeJoyPa9SdGV.mjs → CVNzlTdizLlhU05M.mjs} +2 -2
- package/browser/esm/{D2YXkXpEcP-NqHMv.mjs → CXwkm9x8MkCxPz74.mjs} +1 -1
- package/browser/esm/{WQaRUnIjMCkaRwsb.mjs → CZIV7UuyM5VGNrJT.mjs} +4 -4
- package/browser/esm/{BQTUWwRUxgqg4s6Y.mjs → CdK1lF_PdSw6YfAo.mjs} +1 -1
- package/browser/esm/{DoYGmNZ_X3Kvxx3K.mjs → CpgoYQ3P-S7njA7p.mjs} +2 -2
- package/browser/esm/{ph1FP1S-yYM0I269.mjs → CqEyDFDlQ75w1c41.mjs} +2 -2
- package/browser/esm/{BYUokd7Q6y5Xw36U.mjs → CqIX3rp_vI2S2KbN.mjs} +2 -2
- package/browser/esm/{NSuxs1P3kFsoLIMa.mjs → Csmz2j1S5pk-J0B3.mjs} +2 -2
- package/browser/esm/{B0q0gHDAexrBB16B.mjs → CsuFocZfRucugR3q.mjs} +1153 -922
- package/browser/esm/{SHaQophNZjobC_4f.mjs → Cw6wZyiZkwn9DPZn.mjs} +193 -105
- package/browser/esm/{m5mPoZGqgwOCQQOs.mjs → D91G6sYfKgwC24dQ.mjs} +1 -1
- package/browser/esm/{B1SDDlETvGUJ2Ipu.mjs → DF_ssRdRHuBueJgX.mjs} +89 -102
- package/browser/esm/{CWgz8hWLf3OzuMyZ.mjs → DJaMl_5NGyq62zwW.mjs} +1 -1
- package/browser/esm/DLixDE7fzzurotzQ.mjs +826 -0
- package/browser/esm/{dlNcqumPfehZG2ai.mjs → DM86XhEF4qmUnjuK.mjs} +4 -4
- package/browser/esm/{BrFq6SNq-qx1PYZO.mjs → DNXDqUO4_S_N8sSC.mjs} +2 -2
- package/browser/esm/{BMIfZN_dgjS_p-pF.mjs → DfrMUwmPoZFEFJFk.mjs} +1 -1
- package/browser/esm/{BESsacbR41SalUJv.mjs → Dn3ur1I_S9SlR8vu.mjs} +1 -1
- package/browser/esm/{CbCTAkfOjIThF31A.mjs → IUt6EgxYCpZe9iCH.mjs} +2 -2
- package/browser/esm/{a7OD-X4Jjp810Y6v.mjs → JNoXh3IYri5h1W3Y.mjs} +1 -1
- package/browser/esm/{1JW5qOuAMlejsOrm.mjs → LZ2X5C1kjiwUCDGz.mjs} +2 -2
- package/browser/esm/{DlZoddGNGipM3S72.mjs → MSkt-6o2ZLEiAbDl.mjs} +1 -1
- package/browser/esm/{MR6LXUjaCV0DShNi.mjs → bQOt-2VGBciMnvp_.mjs} +3 -3
- package/browser/esm/{CbC8ObddTe-7ix6F.mjs → drMcpHj_xCQ0KxuA.mjs} +4 -4
- package/browser/esm/{DGz8aGpEm8yfccoW.mjs → g-ScvvLFu66BzoGI.mjs} +2 -2
- package/browser/esm/index.mjs +299 -299
- package/browser/esm/{dikVMLRWr5g6T0E7.mjs → j6NYTR7qK3Ra-ctk.mjs} +2 -2
- package/browser/esm/qSdXw8S3Pv-_PPNl.mjs +210 -0
- package/browser/esm/{Bz6OaRkDOpj807bi.mjs → r8gxfS-mY5qhTMtJ.mjs} +2 -2
- package/browser/esm/{DVXQrjSOGoB23arZ.mjs → ro5VSIHWH1Nehr75.mjs} +1 -1
- package/browser/esm/tfUleloRF2hBRjjZ.mjs +996 -0
- package/browser/esm/vTlYAw0bvWP8B4jg.mjs +103 -0
- package/browser/esm/{D8RzgRnl0S1-W_Tx.mjs → vzJavAz2onbnB0zm.mjs} +1183 -1204
- package/browser/esm/{wwSpRKFXL9eeyQND.mjs → xaG6CESboBdgd5SL.mjs} +3 -3
- package/browser/esm/{B0ymykpoTxxHQosi.mjs → ze358yTiZmVH9_vX.mjs} +6 -4
- package/licenses/dependencies.txt +33 -33
- package/node/esm/5WNL9ztJdLI0VLJ7.mjs +997 -0
- package/node/esm/{B_7rer9pnurpMB9J.mjs → 8aFKkKyEL5n7sJAn.mjs} +12 -12
- package/node/esm/{DGieA81teTm8uNPr.mjs → 9Yzu2QTWzvPBNvc4.mjs} +1 -1
- package/node/esm/{DF5w_ZBWiRtITKLQ.mjs → BDGax8JuzpXDLe1U.mjs} +1 -1
- package/node/esm/{BedAzhQqTjs4BBb4.mjs → BMuPM5U4Q2kQVYTt.mjs} +251 -253
- package/node/esm/B_XE-SYyFRwWgVyQ.mjs +2070 -0
- package/node/esm/{C4esZkRHnb4HEK3k.mjs → Bap-XMVZ0X80-MNV.mjs} +2 -2
- package/node/esm/{DHrxhle3aK3XU-Jz.mjs → BghhH54dXAqciBpw.mjs} +2 -2
- package/node/esm/{Diu9L9DJzZCMtFb4.mjs → Bgsi1G5RDBa4Rnmh.mjs} +1 -1
- package/node/esm/{mHNl4j2rIZTqcQqb.mjs → Bj6wKB1N--BJ0A7u.mjs} +1 -1
- package/node/esm/{BBRSP-QRw-F0qQdJ.mjs → Bp6DyaGr7Ah4mCbj.mjs} +2 -2
- package/node/esm/BxIw0JqQD7Ibk44S.mjs +103 -0
- package/node/esm/{BRICG2VkglJJKy0X.mjs → C6J3DXYnvgXi5m4u.mjs} +1 -1
- package/node/esm/{Cr94rxP9x4CWSBhF.mjs → CAXzH3lCFKI5mhsY.mjs} +2 -2
- package/node/esm/CBpG1x4pS6pNfRR1.mjs +461 -0
- package/node/esm/{qYIPGp0bxwW5i6Tn.mjs → CDx7cgKCqLflEubV.mjs} +1 -1
- package/node/esm/{vTyr2di6cTC3sA1F.mjs → CFL1BiUsTE9X1-c8.mjs} +24 -24
- package/node/esm/{BRpSVGr1A8w4AG_c.mjs → CHBfOuyPAMiTojvS.mjs} +97 -110
- package/node/esm/{B1CcqB7Ue-EPkdE-.mjs → CJIgRvLMiUJG79DB.mjs} +1 -1
- package/node/esm/{Bwtmjq_jln0eMEMe.mjs → CcbjmWOlODDY8gGF.mjs} +1 -1
- package/node/esm/CdrSmZ9WDzkEGAXL.mjs +695 -0
- package/node/esm/{MNdDR5PA6J1YEtyL.mjs → Ck0jN6hnefC5Hbsk.mjs} +22 -22
- package/node/esm/{D13aAzbfNwj50sqn.mjs → CkGQNbOwGQPWEcUf.mjs} +2 -2
- package/node/esm/{4mAgDExCti1oMAez.mjs → D283LXrMqi3exI_l.mjs} +1 -1
- package/node/esm/DH0tw27cVxmy7-AI.mjs +40 -0
- package/node/esm/{CBes_pLI-7rJsre4.mjs → DJ4lhPXDGigmgQ-y.mjs} +2 -2
- package/node/esm/{CJszsuCXRBPNuT1A.mjs → DUZYSELfaHMSnDU2.mjs} +1 -1
- package/node/esm/{Bm31UyWMCsJ7z4wJ.mjs → DZYzjxDF58TKD0xV.mjs} +2 -2
- package/node/esm/{Bz0uw5YbQGvhlPhZ.mjs → Debl1EJrMSlRwGcN.mjs} +2 -2
- package/node/esm/{D2eYMCx5eAEJsfP6.mjs → Dga-nEOi0B5TjgH6.mjs} +148 -148
- package/node/esm/{BSZ0bAJn4ODpGusx.mjs → Diszdr1X5yDuuIzT.mjs} +1 -1
- package/node/esm/{suDXa2UiBKJB4nsR.mjs → Dms4poPA6WOC4jyK.mjs} +1 -1
- package/node/esm/{pm_LpeNYjo6Aahu3.mjs → DnjxhVMqfBhfsNHj.mjs} +14 -14
- package/node/esm/{D__UzirlxQlq32Rm.mjs → DsoWGkhZNfvhmpK-.mjs} +2 -2
- package/node/esm/DyKgKDqbquskgXEA.mjs +828 -0
- package/node/esm/{DlSfkSNLCwzofCfS.mjs → DzZb-LzjScchWCpk.mjs} +66 -67
- package/node/esm/{C1y7Z0K9Ougef8dU.mjs → MvXs13X1leYt7rBb.mjs} +2 -2
- package/node/esm/{DXQFo_r4CCCvIubP.mjs → SBp59gHxCkFpvNwi.mjs} +1 -1
- package/node/esm/{n5-pWzwq4pDS4adG.mjs → iJrkLXWLGxVhCmtE.mjs} +1 -1
- package/node/esm/index.mjs +3294 -3031
- package/node/esm/{B7_-3nxcN-ZSDQVT.mjs → l0liY9jxGCFXsxNX.mjs} +1 -1
- package/node/esm/{DvlZnGlon5gwQBxU.mjs → mhPcr4NaFejGRG5p.mjs} +1 -1
- package/node/esm/{9e9_OZYxc0ATDkNI.mjs → vfgV7wwOvzh9iYjc.mjs} +1 -1
- package/package.json +9 -9
- package/resources/locales/de/groups.cmd.json +4 -6
- package/resources/locales/de/ui.msg.json +164 -3
- package/resources/locales/en/groups.cmd.json +4 -6
- package/resources/locales/en/ui.msg.json +164 -3
- package/types/src/anomalies/AnomaliesCommands.d.ts +1 -1
- package/types/src/chart/ChartDetailsPanel.d.ts +34 -0
- package/types/src/chart/ChartDetailsTaskPane.d.ts +9 -0
- package/types/src/chart/ChartFormatPanel.d.ts +12 -14
- package/types/src/chart/command/ChartColorsCommandButton.d.ts +54 -0
- package/types/src/chart/command/ChartStyleCommandButton.d.ts +64 -0
- package/types/src/chart/command/InsertChartCommandButton.d.ts +15 -0
- package/types/src/chart/command/index.d.ts +2 -0
- package/types/src/chart/format/ChartElementFormat.d.ts +54 -0
- package/types/src/chart/pane/ChartPaneModel.d.ts +134 -0
- package/types/src/chart/pane/ChartPaneRow.d.ts +77 -0
- package/types/src/color/ColorSetSwatch.d.ts +34 -0
- package/types/src/color/index.d.ts +1 -0
- package/types/src/command/NumberFormatQuickButtons.d.ts +1 -1
- package/types/src/format/FillPanel.d.ts +1 -3
- package/types/src/format/FormatPanelParts.d.ts +2 -2
- package/types/src/format/FormatPlugin.d.ts +2 -2
- package/types/src/format/FormatTaskPane.d.ts +4 -10
- package/types/src/format/LinePanel.d.ts +0 -2
- package/types/src/format/editor/FormatEditor.d.ts +36 -0
- package/types/src/format/editor/FormatField.d.ts +97 -0
- package/types/src/format/editor/FormatFields.d.ts +20 -0
- package/types/src/format/editor/index.d.ts +4 -0
- package/types/src/format/index.d.ts +1 -0
- package/types/src/format/useFormatSelection.d.ts +0 -2
- package/types/src/index.d.ts +1 -1
- package/types/src/shape/ShapeFormatPanel.d.ts +3 -7
- package/types/src/workbook/DefaultRenderers.d.ts +7 -1
- package/browser/esm/39iN4gKrFnhPhM1Z.mjs +0 -517
- package/browser/esm/BWXXi0teArfwa70E.mjs +0 -72
- package/browser/esm/J519wp1_d0QjzPfN.mjs +0 -516
- package/node/esm/Bc2iZ6Qs3kHdsECK.mjs +0 -1831
- package/node/esm/BvKg2K2J7Us2czkC.mjs +0 -519
- package/node/esm/CwQPIQaC6CcVGkD2.mjs +0 -73
- package/node/esm/CyQekcyEfM7Engbk.mjs +0 -516
- package/types/src/studio/StudioSplitPane.d.ts +0 -60
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v1.0.6
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
import { ColorPopupButton as e, FormulaField as l, StyledStrokeIcon as n } from "./index.mjs";
|
|
8
|
+
import { i as t, n as a, o as i, r as o } from "./vfgV7wwOvzh9iYjc.mjs";
|
|
9
|
+
import { t as s } from "./DzZb-LzjScchWCpk.mjs";
|
|
10
|
+
import { IColor as d, IFill as r, IStroke as h } from "@sheetxl/sdk";
|
|
11
|
+
import { useGridColorScheme as c } from "@sheetxl/react";
|
|
12
|
+
import { KeyCodes as p, useCallbackRef as u, useTranslator as m } from "@sheetxl/utils-react";
|
|
13
|
+
import { memo as g, useCallback as y, useMemo as b, useRef as S, useState as D } from "react";
|
|
14
|
+
import { ExhibitIconButton as L, ExhibitMenuItem as x, ExhibitPopupIconButton as k, ExhibitPopupMenuItem as f, createStrokeShadowFilter as v } from "@sheetxl/utils-mui";
|
|
15
|
+
import { Fragment as C, jsx as T, jsxs as w } from "react/jsx-runtime";
|
|
16
|
+
import { Box as z, Checkbox as E, FormControl as M, FormControlLabel as $, InputLabel as N, MenuItem as B, Select as A, TextField as F, Typography as R } from "@mui/material";
|
|
17
|
+
import { messageKey as W } from "@sheetxl/utils";
|
|
18
|
+
import j from "clsx";
|
|
19
|
+
var J = {
|
|
20
|
+
[h.DashStyle.Solid]: null,
|
|
21
|
+
[h.DashStyle.Dot]: [1, 3],
|
|
22
|
+
[h.DashStyle.Dash]: [4, 3],
|
|
23
|
+
[h.DashStyle.LongDash]: [8, 3],
|
|
24
|
+
[h.DashStyle.DashDot]: [
|
|
25
|
+
4,
|
|
26
|
+
3,
|
|
27
|
+
1,
|
|
28
|
+
3
|
|
29
|
+
],
|
|
30
|
+
[h.DashStyle.LongDashDot]: [
|
|
31
|
+
8,
|
|
32
|
+
3,
|
|
33
|
+
1,
|
|
34
|
+
3
|
|
35
|
+
],
|
|
36
|
+
[h.DashStyle.LongDashDotDot]: [
|
|
37
|
+
8,
|
|
38
|
+
3,
|
|
39
|
+
1,
|
|
40
|
+
3,
|
|
41
|
+
1,
|
|
42
|
+
3
|
|
43
|
+
],
|
|
44
|
+
[h.DashStyle.SysDash]: [3, 1],
|
|
45
|
+
[h.DashStyle.SysDot]: [1, 1],
|
|
46
|
+
[h.DashStyle.SysDashDot]: [
|
|
47
|
+
3,
|
|
48
|
+
1,
|
|
49
|
+
1,
|
|
50
|
+
1
|
|
51
|
+
],
|
|
52
|
+
[h.DashStyle.SysDashDotDot]: [
|
|
53
|
+
3,
|
|
54
|
+
1,
|
|
55
|
+
1,
|
|
56
|
+
1,
|
|
57
|
+
1,
|
|
58
|
+
1
|
|
59
|
+
]
|
|
60
|
+
}, P = g((e) => {
|
|
61
|
+
const { dash: l, color: t, darkMode: a } = e, i = Array.isArray(l) ? l : J[l] ?? null;
|
|
62
|
+
return T(n, {
|
|
63
|
+
styleColor: t,
|
|
64
|
+
length: 60,
|
|
65
|
+
width: 2,
|
|
66
|
+
darkMode: a,
|
|
67
|
+
dashArray: i ? i.map((e) => 2 * e) : void 0
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
P.displayName = "DashIcon";
|
|
71
|
+
var I = {
|
|
72
|
+
sm: 2.5,
|
|
73
|
+
med: 4,
|
|
74
|
+
lg: 6
|
|
75
|
+
}, O = {
|
|
76
|
+
sm: 5,
|
|
77
|
+
med: 8,
|
|
78
|
+
lg: 12
|
|
79
|
+
}, U = g((e) => {
|
|
80
|
+
const { end: l, atStart: n = !1, color: t, darkMode: a = !1 } = e, i = 19, o = I[l.width ?? h.LineEndSize.Medium], s = O[l.length ?? h.LineEndSize.Medium];
|
|
81
|
+
let d = null, r = i;
|
|
82
|
+
switch (l.type) {
|
|
83
|
+
case h.LineEndType.Triangle:
|
|
84
|
+
d = T("polygon", { points: `19,8 ${i - s},${8 - o} ${i - s},${8 + o}` }), r = i - s;
|
|
85
|
+
break;
|
|
86
|
+
case h.LineEndType.Stealth:
|
|
87
|
+
d = T("polygon", { points: `19,8 ${i - s},${8 - o} ${i - .6 * s},8 ${i - s},${8 + o}` }), r = i - .6 * s;
|
|
88
|
+
break;
|
|
89
|
+
case h.LineEndType.Diamond:
|
|
90
|
+
d = T("polygon", { points: `19,8 ${i - s / 2},${8 - o} ${i - s},8 ${i - s / 2},${8 + o}` }), r = i - s;
|
|
91
|
+
break;
|
|
92
|
+
case h.LineEndType.Oval:
|
|
93
|
+
d = T("ellipse", {
|
|
94
|
+
cx: i - s / 2,
|
|
95
|
+
cy: 8,
|
|
96
|
+
rx: s / 2,
|
|
97
|
+
ry: o
|
|
98
|
+
}), r = i - s;
|
|
99
|
+
break;
|
|
100
|
+
case h.LineEndType.Arrow: d = T("polyline", {
|
|
101
|
+
points: `${i - s},${8 - o} 19,8 ${i - s},${8 + o}`,
|
|
102
|
+
fill: "none",
|
|
103
|
+
strokeWidth: 2,
|
|
104
|
+
strokeLinecap: "round",
|
|
105
|
+
strokeLinejoin: "round"
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
const c = t ? t.toRGBA(a).toString() : "currentColor";
|
|
109
|
+
return w(z, {
|
|
110
|
+
component: "svg",
|
|
111
|
+
width: 20,
|
|
112
|
+
height: 16,
|
|
113
|
+
viewBox: "0 0 20 16",
|
|
114
|
+
sx: {
|
|
115
|
+
display: "block",
|
|
116
|
+
overflow: "visible",
|
|
117
|
+
fill: c,
|
|
118
|
+
stroke: c,
|
|
119
|
+
filter: v(),
|
|
120
|
+
transform: n ? "scaleX(-1)" : void 0
|
|
121
|
+
},
|
|
122
|
+
children: [T("line", {
|
|
123
|
+
x1: 1,
|
|
124
|
+
y1: 8,
|
|
125
|
+
x2: r,
|
|
126
|
+
y2: 8,
|
|
127
|
+
strokeWidth: 2
|
|
128
|
+
}), d]
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
U.displayName = "LineEndIcon";
|
|
132
|
+
var q = (e) => {
|
|
133
|
+
const { end: l, atStart: n = !1, color: t, darkMode: a, types: i, sizes: o, typeLabels: s, sizeLabels: d, widthLabel: r, lengthLabel: c, tooltip: p, disabled: u, onSelect: m } = e, g = y((e) => {
|
|
134
|
+
const { closeFloatAll: p, floatReference: g } = e, y = i.map((e) => {
|
|
135
|
+
const i = T(U, {
|
|
136
|
+
end: {
|
|
137
|
+
...l,
|
|
138
|
+
type: e
|
|
139
|
+
},
|
|
140
|
+
atStart: n,
|
|
141
|
+
color: t,
|
|
142
|
+
darkMode: a
|
|
143
|
+
}), y = e === l.type;
|
|
144
|
+
if (e === h.LineEndType.None) return T(x, {
|
|
145
|
+
icon: i,
|
|
146
|
+
selected: y,
|
|
147
|
+
disabled: u,
|
|
148
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
149
|
+
onMouseUp: () => {
|
|
150
|
+
p?.(), m(null);
|
|
151
|
+
},
|
|
152
|
+
children: s[e]
|
|
153
|
+
}, e);
|
|
154
|
+
return T(f, {
|
|
155
|
+
icon: i,
|
|
156
|
+
label: s[e],
|
|
157
|
+
selected: y,
|
|
158
|
+
disabled: u,
|
|
159
|
+
parentFloat: g,
|
|
160
|
+
renderPopupPanel: (i) => T(z, {
|
|
161
|
+
sx: {
|
|
162
|
+
display: "grid",
|
|
163
|
+
gridTemplateColumns: `repeat(${o.length}, auto)`,
|
|
164
|
+
gap: "2px",
|
|
165
|
+
padding: "6px 8px"
|
|
166
|
+
},
|
|
167
|
+
children: o.map((s) => o.map((o) => T(L, {
|
|
168
|
+
icon: T(U, {
|
|
169
|
+
end: {
|
|
170
|
+
type: e,
|
|
171
|
+
width: o,
|
|
172
|
+
length: s
|
|
173
|
+
},
|
|
174
|
+
atStart: n,
|
|
175
|
+
color: t,
|
|
176
|
+
darkMode: a
|
|
177
|
+
}),
|
|
178
|
+
selected: y && (l.width ?? h.LineEndSize.Medium) === o && (l.length ?? h.LineEndSize.Medium) === s,
|
|
179
|
+
disabled: u,
|
|
180
|
+
propsTooltip: {
|
|
181
|
+
label: `${r}: ${d[o]} · ${c}: ${d[s]}`,
|
|
182
|
+
simple: !0
|
|
183
|
+
},
|
|
184
|
+
onClick: () => {
|
|
185
|
+
i.closeFloatAll?.(), m({
|
|
186
|
+
type: e,
|
|
187
|
+
width: o,
|
|
188
|
+
length: s
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}, `${o}-${s}`)))
|
|
192
|
+
}),
|
|
193
|
+
onQuickClick: () => {
|
|
194
|
+
p?.(), m({
|
|
195
|
+
...l,
|
|
196
|
+
type: e
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}, e);
|
|
200
|
+
});
|
|
201
|
+
return T(z, {
|
|
202
|
+
sx: {
|
|
203
|
+
display: "flex",
|
|
204
|
+
flexDirection: "column",
|
|
205
|
+
paddingTop: "4px",
|
|
206
|
+
paddingBottom: "4px"
|
|
207
|
+
},
|
|
208
|
+
children: y
|
|
209
|
+
});
|
|
210
|
+
}, [
|
|
211
|
+
l,
|
|
212
|
+
n,
|
|
213
|
+
t,
|
|
214
|
+
a,
|
|
215
|
+
i,
|
|
216
|
+
o,
|
|
217
|
+
s,
|
|
218
|
+
d,
|
|
219
|
+
r,
|
|
220
|
+
c,
|
|
221
|
+
u,
|
|
222
|
+
m
|
|
223
|
+
]);
|
|
224
|
+
return T(k, {
|
|
225
|
+
disabled: u,
|
|
226
|
+
icon: T(z, {
|
|
227
|
+
sx: {
|
|
228
|
+
paddingLeft: "4px",
|
|
229
|
+
marginRight: "4px",
|
|
230
|
+
height: "24px",
|
|
231
|
+
display: "flex",
|
|
232
|
+
alignItems: "center"
|
|
233
|
+
},
|
|
234
|
+
children: T(U, {
|
|
235
|
+
end: l,
|
|
236
|
+
atStart: n,
|
|
237
|
+
color: t,
|
|
238
|
+
darkMode: a
|
|
239
|
+
})
|
|
240
|
+
}),
|
|
241
|
+
tooltip: p ? `${p}: ${s[l.type]}` : s[l.type],
|
|
242
|
+
renderPopupPanel: g
|
|
243
|
+
});
|
|
244
|
+
}, G = (e) => {
|
|
245
|
+
const { value: l, options: n, onSelect: t, columns: a, tooltip: i, disabled: o, icon: s } = e, d = n.find((e) => e.value === l) ?? n[0], r = y((e) => {
|
|
246
|
+
const { closeFloat: i } = e;
|
|
247
|
+
return T(z, a ? {
|
|
248
|
+
sx: {
|
|
249
|
+
display: "grid",
|
|
250
|
+
gridTemplateColumns: `repeat(${a}, auto)`,
|
|
251
|
+
gap: "2px",
|
|
252
|
+
padding: "6px 8px"
|
|
253
|
+
},
|
|
254
|
+
children: n.map((e) => T(L, {
|
|
255
|
+
icon: e.icon,
|
|
256
|
+
selected: e.value === l,
|
|
257
|
+
disabled: o,
|
|
258
|
+
propsTooltip: {
|
|
259
|
+
label: e.label,
|
|
260
|
+
simple: !0
|
|
261
|
+
},
|
|
262
|
+
onClick: () => {
|
|
263
|
+
i?.(), t(e.value);
|
|
264
|
+
}
|
|
265
|
+
}, e.value))
|
|
266
|
+
} : {
|
|
267
|
+
sx: {
|
|
268
|
+
display: "flex",
|
|
269
|
+
flexDirection: "column",
|
|
270
|
+
paddingTop: "4px",
|
|
271
|
+
paddingBottom: "4px"
|
|
272
|
+
},
|
|
273
|
+
children: n.map((e) => T(x, {
|
|
274
|
+
tabIndex: 0,
|
|
275
|
+
sx: {
|
|
276
|
+
height: "28px",
|
|
277
|
+
paddingLeft: "16px"
|
|
278
|
+
},
|
|
279
|
+
propsTooltip: { description: e.label },
|
|
280
|
+
icon: null,
|
|
281
|
+
disabled: o,
|
|
282
|
+
selected: e.value === l,
|
|
283
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
284
|
+
onMouseUp: () => {
|
|
285
|
+
i?.(), t(e.value);
|
|
286
|
+
},
|
|
287
|
+
onKeyDown: (e) => {
|
|
288
|
+
e.which === p.Enter && i?.();
|
|
289
|
+
},
|
|
290
|
+
children: e.icon
|
|
291
|
+
}, e.value))
|
|
292
|
+
});
|
|
293
|
+
}, [
|
|
294
|
+
n,
|
|
295
|
+
l,
|
|
296
|
+
t,
|
|
297
|
+
a,
|
|
298
|
+
o
|
|
299
|
+
]);
|
|
300
|
+
return T(k, {
|
|
301
|
+
disabled: o,
|
|
302
|
+
icon: T(z, {
|
|
303
|
+
sx: {
|
|
304
|
+
paddingLeft: "4px",
|
|
305
|
+
marginRight: "4px",
|
|
306
|
+
height: "24px",
|
|
307
|
+
display: "flex",
|
|
308
|
+
alignItems: "center"
|
|
309
|
+
},
|
|
310
|
+
children: s ?? d?.icon
|
|
311
|
+
}),
|
|
312
|
+
tooltip: i ? `${i}: ${d?.label ?? ""}` : d?.label,
|
|
313
|
+
renderPopupPanel: r
|
|
314
|
+
});
|
|
315
|
+
}, K = "none", H = "solid", Q = [
|
|
316
|
+
h.DashStyle.Solid,
|
|
317
|
+
h.DashStyle.SysDot,
|
|
318
|
+
h.DashStyle.SysDash,
|
|
319
|
+
h.DashStyle.Dash,
|
|
320
|
+
h.DashStyle.DashDot,
|
|
321
|
+
h.DashStyle.LongDash,
|
|
322
|
+
h.DashStyle.LongDashDot,
|
|
323
|
+
h.DashStyle.LongDashDotDot
|
|
324
|
+
], V = "custom", X = [
|
|
325
|
+
h.LineCap.Square,
|
|
326
|
+
h.LineCap.Round,
|
|
327
|
+
h.LineCap.Butt
|
|
328
|
+
], Y = [
|
|
329
|
+
h.LineJoin.Round,
|
|
330
|
+
h.LineJoin.Bevel,
|
|
331
|
+
h.LineJoin.Miter
|
|
332
|
+
], Z = [
|
|
333
|
+
h.LineEndType.None,
|
|
334
|
+
h.LineEndType.Triangle,
|
|
335
|
+
h.LineEndType.Arrow,
|
|
336
|
+
h.LineEndType.Stealth,
|
|
337
|
+
h.LineEndType.Diamond,
|
|
338
|
+
h.LineEndType.Oval
|
|
339
|
+
], _ = [
|
|
340
|
+
h.LineEndSize.Small,
|
|
341
|
+
h.LineEndSize.Medium,
|
|
342
|
+
h.LineEndSize.Large
|
|
343
|
+
], ee = g((l) => {
|
|
344
|
+
const { selection: n, disabled: s, className: d, ...c } = l, p = m(), { stroke: g, stated: y, autoColor: S, applyStroke: D, styles: L, darkMode: x } = n, k = L.schemeLookup(), f = s || n.disabled, v = g.isVisible(), E = v ? H : K, $ = y?.fill && y.fill.type !== r.Type.None ? g.getFill().getColor() : null, F = $ ?? S, R = g.getDash(), J = "string" == typeof R && Q.includes(R) ? R : V, I = g.getHead(), O = g.getTail(), U = u(() => L.recentColors(), [L]), ee = u((e) => {
|
|
345
|
+
e !== E && D(e === K ? { fill: { type: r.Type.None } } : {
|
|
346
|
+
fill: null,
|
|
347
|
+
width: g.getWidth() > 0 ? void 0 : null
|
|
348
|
+
}, W("op.setShapeStroke"));
|
|
349
|
+
}, [
|
|
350
|
+
E,
|
|
351
|
+
g,
|
|
352
|
+
D
|
|
353
|
+
]), le = u((e, l) => {
|
|
354
|
+
e && l && L.addRecentColor(e), D({ fill: e ? e.toString() : null }, W("op.setStrokeColor"));
|
|
355
|
+
}, [D, L]), ne = u((e) => {
|
|
356
|
+
D({ width: e }, W("op.setStrokeWidth"));
|
|
357
|
+
}, [D]), te = u((e) => {
|
|
358
|
+
e !== V && D({ dash: e }, W("op.setStrokeDash"));
|
|
359
|
+
}, [D]), ae = u((e) => {
|
|
360
|
+
D({ lineCap: e }, W("op.setStroke"));
|
|
361
|
+
}, [D]), ie = u((e) => {
|
|
362
|
+
D({ lineJoin: e }, W("op.setStroke"));
|
|
363
|
+
}, [D]), oe = u((e, l) => {
|
|
364
|
+
D({ [e]: l }, W("op.setLineEnds"));
|
|
365
|
+
}, [D]), se = b(() => ({
|
|
366
|
+
dash: {
|
|
367
|
+
[h.DashStyle.Solid]: p("line.dash.solid"),
|
|
368
|
+
[h.DashStyle.SysDot]: p("line.dash.sysDot"),
|
|
369
|
+
[h.DashStyle.SysDash]: p("line.dash.sysDash"),
|
|
370
|
+
[h.DashStyle.Dash]: p("line.dash.dash"),
|
|
371
|
+
[h.DashStyle.DashDot]: p("line.dash.dashDot"),
|
|
372
|
+
[h.DashStyle.LongDash]: p("line.dash.lgDash"),
|
|
373
|
+
[h.DashStyle.LongDashDot]: p("line.dash.lgDashDot"),
|
|
374
|
+
[h.DashStyle.LongDashDotDot]: p("line.dash.lgDashDotDot"),
|
|
375
|
+
[V]: p("line.dashCustom")
|
|
376
|
+
},
|
|
377
|
+
cap: {
|
|
378
|
+
[h.LineCap.Square]: p("line.capSquare"),
|
|
379
|
+
[h.LineCap.Round]: p("line.capRound"),
|
|
380
|
+
[h.LineCap.Butt]: p("line.capFlat")
|
|
381
|
+
},
|
|
382
|
+
join: {
|
|
383
|
+
[h.LineJoin.Round]: p("line.joinRound"),
|
|
384
|
+
[h.LineJoin.Bevel]: p("line.joinBevel"),
|
|
385
|
+
[h.LineJoin.Miter]: p("line.joinMiter")
|
|
386
|
+
},
|
|
387
|
+
end: {
|
|
388
|
+
[h.LineEndType.None]: p("line.end.none"),
|
|
389
|
+
[h.LineEndType.Triangle]: p("line.end.triangle"),
|
|
390
|
+
[h.LineEndType.Arrow]: p("line.end.arrow"),
|
|
391
|
+
[h.LineEndType.Stealth]: p("line.end.stealth"),
|
|
392
|
+
[h.LineEndType.Diamond]: p("line.end.diamond"),
|
|
393
|
+
[h.LineEndType.Oval]: p("line.end.oval")
|
|
394
|
+
},
|
|
395
|
+
size: {
|
|
396
|
+
[h.LineEndSize.Small]: p("line.sizeSmall"),
|
|
397
|
+
[h.LineEndSize.Medium]: p("line.sizeMedium"),
|
|
398
|
+
[h.LineEndSize.Large]: p("line.sizeLarge")
|
|
399
|
+
}
|
|
400
|
+
}), [p]), de = Q.map((e) => ({
|
|
401
|
+
value: e,
|
|
402
|
+
label: se.dash[e],
|
|
403
|
+
icon: T(P, {
|
|
404
|
+
dash: e,
|
|
405
|
+
color: F,
|
|
406
|
+
darkMode: x
|
|
407
|
+
})
|
|
408
|
+
}));
|
|
409
|
+
J === V && de.push({
|
|
410
|
+
value: V,
|
|
411
|
+
label: se.dash[V],
|
|
412
|
+
icon: T(P, {
|
|
413
|
+
dash: R,
|
|
414
|
+
color: F,
|
|
415
|
+
darkMode: x
|
|
416
|
+
})
|
|
417
|
+
});
|
|
418
|
+
const re = (e, l, n, t, a, i) => w(M, {
|
|
419
|
+
size: "small",
|
|
420
|
+
fullWidth: void 0 === i,
|
|
421
|
+
sx: void 0 === i ? void 0 : { width: i },
|
|
422
|
+
children: [T(N, {
|
|
423
|
+
shrink: !0,
|
|
424
|
+
children: e
|
|
425
|
+
}), T(A, {
|
|
426
|
+
label: e,
|
|
427
|
+
notched: !0,
|
|
428
|
+
disabled: f,
|
|
429
|
+
value: l,
|
|
430
|
+
onChange: (e) => a(e.target.value),
|
|
431
|
+
children: n.map((e) => T(B, {
|
|
432
|
+
value: e,
|
|
433
|
+
children: t[e]
|
|
434
|
+
}, e))
|
|
435
|
+
})]
|
|
436
|
+
});
|
|
437
|
+
return w(z, {
|
|
438
|
+
className: j("sxl-format-line-panel", d),
|
|
439
|
+
sx: i,
|
|
440
|
+
...c,
|
|
441
|
+
children: [T(t, { children: re(p("line.type"), E, [K, H], {
|
|
442
|
+
[K]: p("line.typeNone"),
|
|
443
|
+
[H]: p("line.typeSolid")
|
|
444
|
+
}, ee) }), v ? w(C, { children: [
|
|
445
|
+
T(t, {
|
|
446
|
+
label: p("line.color"),
|
|
447
|
+
children: w(o, { children: [T(e, {
|
|
448
|
+
icon: "stroke.colored",
|
|
449
|
+
disabled: f,
|
|
450
|
+
darkMode: x,
|
|
451
|
+
compareRGB: !0,
|
|
452
|
+
selectedColor: $,
|
|
453
|
+
onSelectColor: le,
|
|
454
|
+
propsPanel: {
|
|
455
|
+
disableAlpha: !0,
|
|
456
|
+
autoColor: S,
|
|
457
|
+
schemeLookup: k,
|
|
458
|
+
recentColors: U
|
|
459
|
+
}
|
|
460
|
+
}), T(a, {
|
|
461
|
+
label: p("line.width"),
|
|
462
|
+
value: g.getWidth(),
|
|
463
|
+
min: 0,
|
|
464
|
+
max: 1584,
|
|
465
|
+
step: .25,
|
|
466
|
+
decimals: !0,
|
|
467
|
+
width: 96,
|
|
468
|
+
disabled: f,
|
|
469
|
+
onChange: ne
|
|
470
|
+
})] })
|
|
471
|
+
}),
|
|
472
|
+
T(t, {
|
|
473
|
+
label: p("line.dashArrows"),
|
|
474
|
+
children: w(o, { children: [
|
|
475
|
+
T(q, {
|
|
476
|
+
end: I,
|
|
477
|
+
atStart: !0,
|
|
478
|
+
color: F,
|
|
479
|
+
darkMode: x,
|
|
480
|
+
types: Z,
|
|
481
|
+
sizes: _,
|
|
482
|
+
typeLabels: se.end,
|
|
483
|
+
sizeLabels: se.size,
|
|
484
|
+
widthLabel: p("line.sizeWidth"),
|
|
485
|
+
lengthLabel: p("line.sizeLength"),
|
|
486
|
+
tooltip: p("line.head"),
|
|
487
|
+
disabled: f,
|
|
488
|
+
onSelect: (e) => oe("head", e)
|
|
489
|
+
}),
|
|
490
|
+
T(G, {
|
|
491
|
+
value: J,
|
|
492
|
+
options: de,
|
|
493
|
+
onSelect: te,
|
|
494
|
+
tooltip: p("line.dash"),
|
|
495
|
+
disabled: f
|
|
496
|
+
}),
|
|
497
|
+
T(q, {
|
|
498
|
+
end: O,
|
|
499
|
+
color: F,
|
|
500
|
+
darkMode: x,
|
|
501
|
+
types: Z,
|
|
502
|
+
sizes: _,
|
|
503
|
+
typeLabels: se.end,
|
|
504
|
+
sizeLabels: se.size,
|
|
505
|
+
widthLabel: p("line.sizeWidth"),
|
|
506
|
+
lengthLabel: p("line.sizeLength"),
|
|
507
|
+
tooltip: p("line.tail"),
|
|
508
|
+
disabled: f,
|
|
509
|
+
onSelect: (e) => oe("tail", e)
|
|
510
|
+
})
|
|
511
|
+
] })
|
|
512
|
+
}),
|
|
513
|
+
T(t, {
|
|
514
|
+
label: p("line.capJoin"),
|
|
515
|
+
children: w(o, { children: [re(p("line.cap"), g.getLineCap(), X, se.cap, ae, 128), re(p("line.join"), g.getLineJoin(), Y, se.join, ie, 128)] })
|
|
516
|
+
})
|
|
517
|
+
] }) : null]
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
ee.displayName = "LinePanel";
|
|
521
|
+
var le = (e) => T(R, {
|
|
522
|
+
variant: "subtitle2",
|
|
523
|
+
component: "div",
|
|
524
|
+
children: e.children
|
|
525
|
+
}), ne = (e, l) => {
|
|
526
|
+
const n = e.getDefault().getStroke().getFill();
|
|
527
|
+
return n.getType() === r.Type.Solid ? n.getColor() : l.parseColor(d.Scheme.Tx1);
|
|
528
|
+
}, te = (e) => {
|
|
529
|
+
const { style: l, sheet: n, disabled: t } = e, a = n.getStyles(), i = "dark" === c(), o = {
|
|
530
|
+
fill: l.getFill(),
|
|
531
|
+
styles: a,
|
|
532
|
+
darkMode: i,
|
|
533
|
+
disabled: t,
|
|
534
|
+
createCell: (e) => n.createCell(e),
|
|
535
|
+
applyFill: (e, n) => {
|
|
536
|
+
l.setFill(e, { description: n });
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
return T(s, { selection: o });
|
|
540
|
+
}, ae = (e) => {
|
|
541
|
+
const { style: l, sheet: n, disabled: t } = e, a = n.getStyles(), i = "dark" === c(), o = {
|
|
542
|
+
stroke: l.getStroke(),
|
|
543
|
+
stated: l.toJSON()?.stroke ?? null,
|
|
544
|
+
autoColor: ne(l, a),
|
|
545
|
+
styles: a,
|
|
546
|
+
darkMode: i,
|
|
547
|
+
disabled: t,
|
|
548
|
+
applyStroke: (e, n) => {
|
|
549
|
+
l.setStroke(e, { description: n });
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
return T(ee, { selection: o });
|
|
553
|
+
}, ie = (e) => w(M, {
|
|
554
|
+
size: "small",
|
|
555
|
+
fullWidth: !0,
|
|
556
|
+
disabled: e.disabled,
|
|
557
|
+
children: [T(N, { children: e.label }), T(A, {
|
|
558
|
+
label: e.label,
|
|
559
|
+
value: e.value,
|
|
560
|
+
onChange: (l) => e.onChange(l.target.value),
|
|
561
|
+
children: e.options.map((l) => T(B, {
|
|
562
|
+
value: l,
|
|
563
|
+
children: e.labels[l] ?? l
|
|
564
|
+
}, l))
|
|
565
|
+
})]
|
|
566
|
+
}), oe = (e) => T($, {
|
|
567
|
+
label: e.label,
|
|
568
|
+
disabled: e.disabled,
|
|
569
|
+
control: T(E, {
|
|
570
|
+
size: "small",
|
|
571
|
+
checked: e.checked,
|
|
572
|
+
onChange: (l) => e.onChange(l.target.checked)
|
|
573
|
+
})
|
|
574
|
+
}), se = (e) => {
|
|
575
|
+
const [l, n] = D(null), t = () => {
|
|
576
|
+
null !== l && l !== e.value && e.onCommit(l), n(null);
|
|
577
|
+
};
|
|
578
|
+
return T(F, {
|
|
579
|
+
size: "small",
|
|
580
|
+
fullWidth: !0,
|
|
581
|
+
label: e.label,
|
|
582
|
+
disabled: e.disabled,
|
|
583
|
+
value: l ?? e.value,
|
|
584
|
+
onChange: (e) => n(e.target.value),
|
|
585
|
+
onBlur: t,
|
|
586
|
+
onKeyDown: (e) => {
|
|
587
|
+
"Enter" === e.key && t();
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
}, de = (e) => {
|
|
591
|
+
const [l, n] = D(null), t = null === e.value ? "" : String(e.value), a = () => {
|
|
592
|
+
const a = l;
|
|
593
|
+
if (n(null), null === a || a.trim() === t) return;
|
|
594
|
+
if ("" === a.trim()) return void e.onCommit(null);
|
|
595
|
+
const i = Number(a);
|
|
596
|
+
Number.isNaN(i) || e.onCommit(Math.max(e.min, Math.min(e.max, i)));
|
|
597
|
+
};
|
|
598
|
+
return T(F, {
|
|
599
|
+
size: "small",
|
|
600
|
+
label: e.label,
|
|
601
|
+
placeholder: e.auto,
|
|
602
|
+
disabled: e.disabled,
|
|
603
|
+
value: l ?? t,
|
|
604
|
+
onChange: (e) => n(e.target.value),
|
|
605
|
+
onBlur: a,
|
|
606
|
+
onKeyDown: (e) => {
|
|
607
|
+
"Enter" === e.key && a();
|
|
608
|
+
},
|
|
609
|
+
slotProps: {
|
|
610
|
+
inputLabel: { shrink: !0 },
|
|
611
|
+
htmlInput: { inputMode: "decimal" }
|
|
612
|
+
},
|
|
613
|
+
sx: {
|
|
614
|
+
flex: "1 1 0",
|
|
615
|
+
minWidth: 0,
|
|
616
|
+
"& input": { textAlign: "right" }
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
}, re = (e) => {
|
|
620
|
+
const n = S(null);
|
|
621
|
+
return T(l, {
|
|
622
|
+
grammar: "formula",
|
|
623
|
+
equals: e.literal ? "literal" : "optional",
|
|
624
|
+
value: e.value || null,
|
|
625
|
+
changeOn: "done",
|
|
626
|
+
pickAs: "absolute",
|
|
627
|
+
label: e.label,
|
|
628
|
+
placeholder: e.placeholder,
|
|
629
|
+
helperText: null,
|
|
630
|
+
disabled: e.disabled,
|
|
631
|
+
onChangeText: (e) => {
|
|
632
|
+
n.current = e;
|
|
633
|
+
},
|
|
634
|
+
onDone: (l, t) => {
|
|
635
|
+
const a = n.current;
|
|
636
|
+
n.current = null, null !== a && "accept" === t.reason && e.onCommit(a);
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
}, he = [
|
|
640
|
+
"none",
|
|
641
|
+
"single",
|
|
642
|
+
"double"
|
|
643
|
+
], ce = [
|
|
644
|
+
"none",
|
|
645
|
+
"single",
|
|
646
|
+
"double"
|
|
647
|
+
], pe = (l) => {
|
|
648
|
+
const { font: n, styles: i, disabled: s, run: d } = l, r = m(), h = "dark" === c(), p = u(() => i.recentColors(), [i]), g = n.getColor(), y = {
|
|
649
|
+
none: r("chart.pane.text.lineNone"),
|
|
650
|
+
single: r("chart.pane.text.lineSingle"),
|
|
651
|
+
double: r("chart.pane.text.lineDouble")
|
|
652
|
+
};
|
|
653
|
+
return w(C, { children: [
|
|
654
|
+
T(t, { children: T(se, {
|
|
655
|
+
label: r("format.fontFamily"),
|
|
656
|
+
value: n.getFamily(),
|
|
657
|
+
disabled: s,
|
|
658
|
+
onCommit: (e) => d(() => n.setFamily(e || null))
|
|
659
|
+
}) }),
|
|
660
|
+
T(t, { children: w(o, { children: [T(a, {
|
|
661
|
+
label: r("format.fontSize"),
|
|
662
|
+
value: n.getSize(),
|
|
663
|
+
min: 1,
|
|
664
|
+
max: 400,
|
|
665
|
+
step: 1,
|
|
666
|
+
decimals: !0,
|
|
667
|
+
width: 96,
|
|
668
|
+
disabled: s,
|
|
669
|
+
onChange: (e) => d(() => n.setSize(e))
|
|
670
|
+
}), T(e, {
|
|
671
|
+
icon: "text.colored",
|
|
672
|
+
disabled: s,
|
|
673
|
+
darkMode: h,
|
|
674
|
+
compareRGB: !0,
|
|
675
|
+
selectedColor: g,
|
|
676
|
+
onSelectColor: (e, l) => {
|
|
677
|
+
e && l && i.addRecentColor(e), d(() => n.setColor(e ? e.toString() : null));
|
|
678
|
+
},
|
|
679
|
+
propsPanel: {
|
|
680
|
+
disableAlpha: !0,
|
|
681
|
+
schemeLookup: i.schemeLookup(),
|
|
682
|
+
recentColors: p
|
|
683
|
+
}
|
|
684
|
+
})] }) }),
|
|
685
|
+
T(t, { children: w(o, { children: [T(oe, {
|
|
686
|
+
label: r("chart.pane.text.bold"),
|
|
687
|
+
checked: n.getBold(),
|
|
688
|
+
disabled: s,
|
|
689
|
+
onChange: (e) => d(() => n.setBold(e))
|
|
690
|
+
}), T(oe, {
|
|
691
|
+
label: r("chart.pane.text.italic"),
|
|
692
|
+
checked: n.getItalic(),
|
|
693
|
+
disabled: s,
|
|
694
|
+
onChange: (e) => d(() => n.setItalic(e))
|
|
695
|
+
})] }) }),
|
|
696
|
+
T(t, { children: w(o, { children: [T(ie, {
|
|
697
|
+
label: r("chart.pane.text.underline"),
|
|
698
|
+
value: he.includes(n.getUnderline()) ? n.getUnderline() : "single",
|
|
699
|
+
options: he,
|
|
700
|
+
labels: y,
|
|
701
|
+
disabled: s,
|
|
702
|
+
onChange: (e) => d(() => n.setUnderline(e))
|
|
703
|
+
}), T(ie, {
|
|
704
|
+
label: r("chart.pane.text.strike"),
|
|
705
|
+
value: n.getStrike(),
|
|
706
|
+
options: ce,
|
|
707
|
+
labels: y,
|
|
708
|
+
disabled: s,
|
|
709
|
+
onChange: (e) => d(() => n.setStrike(e))
|
|
710
|
+
})] }) })
|
|
711
|
+
] });
|
|
712
|
+
}, ue = (e) => {
|
|
713
|
+
const { field: l, sheet: n, disabled: t, run: i } = e;
|
|
714
|
+
switch (l.type) {
|
|
715
|
+
case "flag": return T(oe, {
|
|
716
|
+
label: l.label,
|
|
717
|
+
checked: l.get(),
|
|
718
|
+
disabled: t,
|
|
719
|
+
onChange: (e) => i(() => l.set(e))
|
|
720
|
+
});
|
|
721
|
+
case "choice": return T(ie, {
|
|
722
|
+
label: l.label,
|
|
723
|
+
value: l.get(),
|
|
724
|
+
options: l.options,
|
|
725
|
+
labels: l.labels,
|
|
726
|
+
disabled: t,
|
|
727
|
+
onChange: (e) => i(() => l.set(e))
|
|
728
|
+
});
|
|
729
|
+
case "number": return void 0 !== l.auto ? T(de, {
|
|
730
|
+
label: l.label,
|
|
731
|
+
value: l.get(),
|
|
732
|
+
auto: l.auto,
|
|
733
|
+
min: l.min,
|
|
734
|
+
max: l.max,
|
|
735
|
+
disabled: t,
|
|
736
|
+
onCommit: (e) => i(() => l.set(e))
|
|
737
|
+
}) : T(a, {
|
|
738
|
+
label: l.label,
|
|
739
|
+
value: l.get() ?? 0,
|
|
740
|
+
min: l.min,
|
|
741
|
+
max: l.max,
|
|
742
|
+
decimals: l.decimals,
|
|
743
|
+
width: l.row ? 108 : "100%",
|
|
744
|
+
disabled: t,
|
|
745
|
+
onChange: (e) => i(() => l.set(e))
|
|
746
|
+
});
|
|
747
|
+
case "text": return T(se, {
|
|
748
|
+
label: l.label,
|
|
749
|
+
value: l.get(),
|
|
750
|
+
disabled: t,
|
|
751
|
+
onCommit: (e) => i(() => l.set(e))
|
|
752
|
+
});
|
|
753
|
+
case "formula": return T(re, {
|
|
754
|
+
label: l.label,
|
|
755
|
+
value: l.get(),
|
|
756
|
+
literal: !0 === l.literal,
|
|
757
|
+
placeholder: l.placeholder,
|
|
758
|
+
disabled: t,
|
|
759
|
+
onCommit: (e) => i(() => l.set(e))
|
|
760
|
+
});
|
|
761
|
+
case "font": return w(C, { children: [T(le, { children: l.label }), T(pe, {
|
|
762
|
+
font: l.font,
|
|
763
|
+
styles: n.getStyles(),
|
|
764
|
+
disabled: t,
|
|
765
|
+
run: i
|
|
766
|
+
})] });
|
|
767
|
+
case "fill": return w(C, { children: [T(le, { children: l.label }), T(te, {
|
|
768
|
+
style: l.style,
|
|
769
|
+
sheet: n,
|
|
770
|
+
disabled: t
|
|
771
|
+
})] });
|
|
772
|
+
case "line": return w(C, { children: [T(le, { children: l.label }), T(ae, {
|
|
773
|
+
style: l.style,
|
|
774
|
+
sheet: n,
|
|
775
|
+
disabled: t
|
|
776
|
+
})] });
|
|
777
|
+
}
|
|
778
|
+
}, me = (e) => {
|
|
779
|
+
const { fields: l, sheet: n, disabled: t, run: a } = e, i = [];
|
|
780
|
+
let s;
|
|
781
|
+
for (let e = 0; e < l.length; e++) {
|
|
782
|
+
const d = l[e];
|
|
783
|
+
if (d.shared !== s && (s = d.shared, s && i.push(T(R, {
|
|
784
|
+
variant: "caption",
|
|
785
|
+
component: "div",
|
|
786
|
+
sx: { color: "text.secondary" },
|
|
787
|
+
children: s
|
|
788
|
+
}, `shared:${d.key}`))), d.heading && i.push(T(le, { children: d.heading }, `heading:${d.key}`)), d.row) {
|
|
789
|
+
const s = [d];
|
|
790
|
+
for (; e + 1 < l.length && l[e + 1].row === d.row;) s.push(l[++e]);
|
|
791
|
+
i.push(T(o, { children: s.map((e) => T(ue, {
|
|
792
|
+
field: e,
|
|
793
|
+
sheet: n,
|
|
794
|
+
disabled: t,
|
|
795
|
+
run: a
|
|
796
|
+
}, e.key)) }, `row:${d.key}`));
|
|
797
|
+
continue;
|
|
798
|
+
}
|
|
799
|
+
const r = "flag" === d.type;
|
|
800
|
+
i.push(w(z, {
|
|
801
|
+
"data-field": d.key,
|
|
802
|
+
"data-flag": r ? "" : void 0,
|
|
803
|
+
sx: {
|
|
804
|
+
display: "flex",
|
|
805
|
+
flexDirection: "column",
|
|
806
|
+
gap: 1,
|
|
807
|
+
minWidth: 0,
|
|
808
|
+
...r ? { "[data-flag] + &": { marginTop: -1.5 } } : null
|
|
809
|
+
},
|
|
810
|
+
children: [T(ue, {
|
|
811
|
+
field: d,
|
|
812
|
+
sheet: n,
|
|
813
|
+
disabled: t,
|
|
814
|
+
run: a
|
|
815
|
+
}), d.hint ? T(R, {
|
|
816
|
+
variant: "caption",
|
|
817
|
+
component: "div",
|
|
818
|
+
sx: {
|
|
819
|
+
color: "text.secondary",
|
|
820
|
+
marginTop: -.5
|
|
821
|
+
},
|
|
822
|
+
children: d.hint
|
|
823
|
+
}) : null]
|
|
824
|
+
}, d.key));
|
|
825
|
+
}
|
|
826
|
+
return T(C, { children: i });
|
|
827
|
+
};
|
|
828
|
+
export { me as t };
|