@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,973 @@
|
|
|
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 { r as e, t } from "./DmBu6kgMNT26tmsZ.mjs";
|
|
8
|
+
import { t as n } from "./ChORBNItvZW0e8Nb.mjs";
|
|
9
|
+
import { t as r } from "./BxHaU8-LCw4IHrDn.mjs";
|
|
10
|
+
import { n as i, r as a, t as o } from "./_PlChb18jQMPAKJX.mjs";
|
|
11
|
+
import { i as s, n as c, o as l, r as u, t as d } from "./C2ZbV5cXpGPYeqM1.mjs";
|
|
12
|
+
import { t as f } from "./g_bvg4HpyaF6f_JY.mjs";
|
|
13
|
+
import { n as p, t as m } from "./BoXCzcrUFER3B585.mjs";
|
|
14
|
+
import { IBorders as h, IRange as g, NumberFormat as _ } from "@sheetxl/sdk";
|
|
15
|
+
import { StaticBorderRenderer as v, StaticCellRenderer as y, useGridColorScheme as b, useModelListener as x, useModelSync as S } from "@sheetxl/react";
|
|
16
|
+
import { DynamicIcon as ee, useCallbackRef as C, useCommands as te, usePersistentState as w, useTranslator as T } from "@sheetxl/utils-react";
|
|
17
|
+
import { memo as E, useCallback as D, useEffect as ne, useMemo as O, useReducer as re, useRef as ie, useState as k } from "react";
|
|
18
|
+
import { CommandButton as A, ExhibitIconButton as ae, PopupButtonType as oe } from "@sheetxl/utils-mui";
|
|
19
|
+
import { jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
20
|
+
import { Box as N, Paper as P, Tab as F, Tabs as se, Typography as ce, alpha as I } from "@mui/material";
|
|
21
|
+
import { messageKey as L } from "@sheetxl/utils";
|
|
22
|
+
var R = {
|
|
23
|
+
autoFocus: !1,
|
|
24
|
+
scrollIntoView: !1
|
|
25
|
+
}, z = E((e) => {
|
|
26
|
+
let { selection: t, height: n = 46, maxWidth: r = 260, ...i } = e, a = T(), { cell: o, createCell: s, disabled: c } = t, l = O(() => typeof o.getValue() == "number" ? o : s({
|
|
27
|
+
value: 1234.56,
|
|
28
|
+
style: o.getStyle()
|
|
29
|
+
}), [o, s]);
|
|
30
|
+
return M(N, {
|
|
31
|
+
sx: {
|
|
32
|
+
display: "flex",
|
|
33
|
+
flexDirection: "column",
|
|
34
|
+
gap: .5
|
|
35
|
+
},
|
|
36
|
+
...i,
|
|
37
|
+
children: [j(ce, {
|
|
38
|
+
variant: "caption",
|
|
39
|
+
component: "div",
|
|
40
|
+
children: a("format.preview")
|
|
41
|
+
}), j(y, {
|
|
42
|
+
cell: l,
|
|
43
|
+
disabled: c,
|
|
44
|
+
style: {
|
|
45
|
+
width: "100%",
|
|
46
|
+
maxWidth: `${r}px`,
|
|
47
|
+
height: `${n}px`,
|
|
48
|
+
flex: "0 0 auto",
|
|
49
|
+
border: "1px solid var(--sxl-color-base-300, rgb(224, 224, 224))"
|
|
50
|
+
},
|
|
51
|
+
propsBorder: { style: {
|
|
52
|
+
height: "100%",
|
|
53
|
+
width: "100%"
|
|
54
|
+
} }
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
z.displayName = "FormatCellPreview";
|
|
59
|
+
var B = {
|
|
60
|
+
axes: g.AxisSelection.Column,
|
|
61
|
+
expandOnly: !0,
|
|
62
|
+
skipCustomSize: !0
|
|
63
|
+
}, V = (e) => e > 180 ? e - 360 : e, H = (e) => {
|
|
64
|
+
let t = Math.max(-90, Math.min(90, Math.round(e)));
|
|
65
|
+
return t < 0 ? t + 360 : t;
|
|
66
|
+
}, U = E((e) => {
|
|
67
|
+
let { selection: t, disabled: n, className: i, ...a } = e, o = T(), { style: f, applyStyle: p } = t, m = n || t.disabled, h = f.getAlignment(), g = h.getIndent(), _ = h.getStacked(), v = _ ? 0 : h.getRotation(), y = C((e) => {
|
|
68
|
+
p({ alignment: { indent: e } }, L("op.setAlignment"), B);
|
|
69
|
+
}, [p]), b = C((e) => {
|
|
70
|
+
p({ alignment: { rotation: H(e) } }, L("op.setAlignment"));
|
|
71
|
+
}, [p]);
|
|
72
|
+
return M(N, {
|
|
73
|
+
className: r("sxl-format-alignment-panel", i),
|
|
74
|
+
sx: l,
|
|
75
|
+
...a,
|
|
76
|
+
children: [
|
|
77
|
+
j(s, {
|
|
78
|
+
label: o("format.horizontalAlignment"),
|
|
79
|
+
children: j(u, { children: M(d, { children: [
|
|
80
|
+
j(A, {
|
|
81
|
+
commandKey: "formatAlignLeftToggle",
|
|
82
|
+
groupKey: "horizontalAlignOptions",
|
|
83
|
+
disabled: m
|
|
84
|
+
}),
|
|
85
|
+
j(A, {
|
|
86
|
+
commandKey: "formatAlignCenterToggle",
|
|
87
|
+
groupKey: "horizontalAlignOptions",
|
|
88
|
+
disabled: m
|
|
89
|
+
}),
|
|
90
|
+
j(A, {
|
|
91
|
+
commandKey: "formatAlignRightToggle",
|
|
92
|
+
groupKey: "horizontalAlignOptions",
|
|
93
|
+
disabled: m
|
|
94
|
+
}),
|
|
95
|
+
j(A, {
|
|
96
|
+
commandKey: "formatAlignJustifyToggle",
|
|
97
|
+
groupKey: "horizontalAlignOptions",
|
|
98
|
+
disabled: m
|
|
99
|
+
}),
|
|
100
|
+
j(A, {
|
|
101
|
+
commandKey: "formatAlignDistributedHorizontalToggle",
|
|
102
|
+
groupKey: "horizontalAlignOptions",
|
|
103
|
+
disabled: m
|
|
104
|
+
}),
|
|
105
|
+
j(A, {
|
|
106
|
+
commandKey: "formatAlignCenterContinuousToggle",
|
|
107
|
+
groupKey: "horizontalAlignOptions",
|
|
108
|
+
disabled: m
|
|
109
|
+
}),
|
|
110
|
+
j(A, {
|
|
111
|
+
commandKey: "formatAlignFillToggle",
|
|
112
|
+
groupKey: "horizontalAlignOptions",
|
|
113
|
+
disabled: m
|
|
114
|
+
})
|
|
115
|
+
] }) })
|
|
116
|
+
}),
|
|
117
|
+
j(s, {
|
|
118
|
+
label: o("format.indent"),
|
|
119
|
+
children: M(u, { children: [
|
|
120
|
+
j(A, {
|
|
121
|
+
commandKey: "formatIndentDecrease",
|
|
122
|
+
groupKey: "horizontalAlignOptions",
|
|
123
|
+
disabled: m
|
|
124
|
+
}),
|
|
125
|
+
j(A, {
|
|
126
|
+
commandKey: "formatIndentIncrease",
|
|
127
|
+
groupKey: "horizontalAlignOptions",
|
|
128
|
+
disabled: m
|
|
129
|
+
}),
|
|
130
|
+
j(c, {
|
|
131
|
+
label: o("format.indentUnit"),
|
|
132
|
+
disabled: m,
|
|
133
|
+
value: g,
|
|
134
|
+
min: 0,
|
|
135
|
+
max: 250,
|
|
136
|
+
width: 104,
|
|
137
|
+
onChange: y
|
|
138
|
+
})
|
|
139
|
+
] })
|
|
140
|
+
}),
|
|
141
|
+
j(s, {
|
|
142
|
+
label: o("format.verticalAlignment"),
|
|
143
|
+
children: M(d, { children: [
|
|
144
|
+
j(A, {
|
|
145
|
+
commandKey: "formatAlignTopToggle",
|
|
146
|
+
groupKey: "verticalAlignOptions",
|
|
147
|
+
disabled: m
|
|
148
|
+
}),
|
|
149
|
+
j(A, {
|
|
150
|
+
commandKey: "formatAlignMiddleToggle",
|
|
151
|
+
groupKey: "verticalAlignOptions",
|
|
152
|
+
disabled: m
|
|
153
|
+
}),
|
|
154
|
+
j(A, {
|
|
155
|
+
commandKey: "formatAlignBottomToggle",
|
|
156
|
+
groupKey: "verticalAlignOptions",
|
|
157
|
+
disabled: m
|
|
158
|
+
}),
|
|
159
|
+
j(A, {
|
|
160
|
+
commandKey: "formatAlignJustifyVerticalToggle",
|
|
161
|
+
groupKey: "verticalAlignOptions",
|
|
162
|
+
disabled: m
|
|
163
|
+
}),
|
|
164
|
+
j(A, {
|
|
165
|
+
commandKey: "formatAlignDistributedVerticalToggle",
|
|
166
|
+
groupKey: "verticalAlignOptions",
|
|
167
|
+
disabled: m
|
|
168
|
+
})
|
|
169
|
+
] })
|
|
170
|
+
}),
|
|
171
|
+
j(s, {
|
|
172
|
+
label: o("format.overflow"),
|
|
173
|
+
children: M(d, { children: [
|
|
174
|
+
j(A, {
|
|
175
|
+
commandKey: "formatTextOverflowWrapToggle",
|
|
176
|
+
groupKey: "textOverflowOptions",
|
|
177
|
+
disabled: m
|
|
178
|
+
}),
|
|
179
|
+
j(A, {
|
|
180
|
+
commandKey: "formatTextOverflowShrinkToggle",
|
|
181
|
+
groupKey: "textOverflowOptions",
|
|
182
|
+
disabled: m
|
|
183
|
+
}),
|
|
184
|
+
j(A, {
|
|
185
|
+
commandKey: "formatTextOverflowClipToggle",
|
|
186
|
+
groupKey: "textOverflowOptions",
|
|
187
|
+
disabled: m
|
|
188
|
+
}),
|
|
189
|
+
j(A, {
|
|
190
|
+
commandKey: "formatTextOverflowVisibleToggle",
|
|
191
|
+
groupKey: "textOverflowOptions",
|
|
192
|
+
disabled: m
|
|
193
|
+
})
|
|
194
|
+
] })
|
|
195
|
+
}),
|
|
196
|
+
j(s, {
|
|
197
|
+
label: o("format.merge"),
|
|
198
|
+
children: M(d, { children: [
|
|
199
|
+
j(A, {
|
|
200
|
+
commandKey: "mergeToggle",
|
|
201
|
+
groupKey: "mergeOptions",
|
|
202
|
+
disabled: m
|
|
203
|
+
}),
|
|
204
|
+
j(A, {
|
|
205
|
+
commandKey: "mergeHorizontal",
|
|
206
|
+
groupKey: "mergeOptions",
|
|
207
|
+
disabled: m
|
|
208
|
+
}),
|
|
209
|
+
j(A, {
|
|
210
|
+
commandKey: "mergeVertical",
|
|
211
|
+
groupKey: "mergeOptions",
|
|
212
|
+
disabled: m
|
|
213
|
+
}),
|
|
214
|
+
j(A, {
|
|
215
|
+
commandKey: "unmerge",
|
|
216
|
+
groupKey: "mergeOptions",
|
|
217
|
+
disabled: m
|
|
218
|
+
})
|
|
219
|
+
] })
|
|
220
|
+
}),
|
|
221
|
+
j(s, {
|
|
222
|
+
label: o("format.orientation"),
|
|
223
|
+
children: M(u, { children: [M(d, { children: [
|
|
224
|
+
j(A, {
|
|
225
|
+
commandKey: "formatTextRotate0",
|
|
226
|
+
groupKey: "textRotateOptions",
|
|
227
|
+
disabled: m
|
|
228
|
+
}),
|
|
229
|
+
j(A, {
|
|
230
|
+
commandKey: "formatTextRotate45",
|
|
231
|
+
groupKey: "textRotateOptions",
|
|
232
|
+
disabled: m
|
|
233
|
+
}),
|
|
234
|
+
j(A, {
|
|
235
|
+
commandKey: "formatTextRotate315",
|
|
236
|
+
groupKey: "textRotateOptions",
|
|
237
|
+
disabled: m
|
|
238
|
+
}),
|
|
239
|
+
j(A, {
|
|
240
|
+
commandKey: "formatTextRotate90",
|
|
241
|
+
groupKey: "textRotateOptions",
|
|
242
|
+
disabled: m
|
|
243
|
+
}),
|
|
244
|
+
j(A, {
|
|
245
|
+
commandKey: "formatTextRotateVertical",
|
|
246
|
+
groupKey: "textRotateOptions",
|
|
247
|
+
disabled: m
|
|
248
|
+
}),
|
|
249
|
+
j(A, {
|
|
250
|
+
commandKey: "formatTextRotate270",
|
|
251
|
+
groupKey: "textRotateOptions",
|
|
252
|
+
disabled: m
|
|
253
|
+
})
|
|
254
|
+
] }), j(c, {
|
|
255
|
+
label: o("format.degrees"),
|
|
256
|
+
disabled: m || _,
|
|
257
|
+
value: V(v),
|
|
258
|
+
min: -90,
|
|
259
|
+
max: 90,
|
|
260
|
+
step: 5,
|
|
261
|
+
width: 104,
|
|
262
|
+
onChange: b
|
|
263
|
+
})] })
|
|
264
|
+
})
|
|
265
|
+
]
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
U.displayName = "AlignmentPanel";
|
|
269
|
+
var W = E((e) => {
|
|
270
|
+
let { selection: t, disabled: n, className: c, ...f } = e, p = T(), m = n || t.disabled;
|
|
271
|
+
return M(N, {
|
|
272
|
+
className: r("sxl-format-font-panel", c),
|
|
273
|
+
sx: l,
|
|
274
|
+
...f,
|
|
275
|
+
children: [
|
|
276
|
+
j(s, {
|
|
277
|
+
label: p("format.fontFamily"),
|
|
278
|
+
children: j(o, {
|
|
279
|
+
commandKey: "formatFontFamily",
|
|
280
|
+
disabled: m,
|
|
281
|
+
sx: { width: "100%" }
|
|
282
|
+
})
|
|
283
|
+
}),
|
|
284
|
+
j(s, {
|
|
285
|
+
label: p("format.fontSize"),
|
|
286
|
+
children: M(u, { children: [
|
|
287
|
+
j(a, {
|
|
288
|
+
commandKey: "formatFontSize",
|
|
289
|
+
disabled: m,
|
|
290
|
+
sx: { width: 96 }
|
|
291
|
+
}),
|
|
292
|
+
j(A, {
|
|
293
|
+
commandKey: "formatFontSizeIncrease",
|
|
294
|
+
disabled: m
|
|
295
|
+
}),
|
|
296
|
+
j(A, {
|
|
297
|
+
commandKey: "formatFontSizeDecrease",
|
|
298
|
+
disabled: m
|
|
299
|
+
})
|
|
300
|
+
] })
|
|
301
|
+
}),
|
|
302
|
+
j(s, {
|
|
303
|
+
label: p("format.color"),
|
|
304
|
+
children: j(u, { children: j(i, {
|
|
305
|
+
commandKey: "formatFontColor",
|
|
306
|
+
disabled: m
|
|
307
|
+
}) })
|
|
308
|
+
}),
|
|
309
|
+
j(s, {
|
|
310
|
+
label: p("format.effects"),
|
|
311
|
+
children: M(d, { children: [
|
|
312
|
+
j(A, {
|
|
313
|
+
commandKey: "formatBoldToggle",
|
|
314
|
+
disabled: m
|
|
315
|
+
}),
|
|
316
|
+
j(A, {
|
|
317
|
+
commandKey: "formatItalicToggle",
|
|
318
|
+
disabled: m
|
|
319
|
+
}),
|
|
320
|
+
j(A, {
|
|
321
|
+
commandKey: "formatUnderlinedToggle",
|
|
322
|
+
groupKey: "underlineOptions",
|
|
323
|
+
disabled: m
|
|
324
|
+
}),
|
|
325
|
+
j(A, {
|
|
326
|
+
commandKey: "formatUnderlinedDoubleToggle",
|
|
327
|
+
groupKey: "underlineOptions",
|
|
328
|
+
disabled: m
|
|
329
|
+
}),
|
|
330
|
+
j(N, { sx: { width: "8px" } }),
|
|
331
|
+
j(A, {
|
|
332
|
+
commandKey: "formatStrikeThroughToggle",
|
|
333
|
+
disabled: m
|
|
334
|
+
}),
|
|
335
|
+
j(A, {
|
|
336
|
+
commandKey: "formatSuperscriptToggle",
|
|
337
|
+
disabled: m
|
|
338
|
+
}),
|
|
339
|
+
j(A, {
|
|
340
|
+
commandKey: "formatSubscriptToggle",
|
|
341
|
+
disabled: m
|
|
342
|
+
})
|
|
343
|
+
] })
|
|
344
|
+
}),
|
|
345
|
+
j(s, {
|
|
346
|
+
label: p("format.accountingUnderline"),
|
|
347
|
+
children: M(d, { children: [j(A, {
|
|
348
|
+
commandKey: "formatUnderlinedAccountingToggle",
|
|
349
|
+
groupKey: "underlineOptions",
|
|
350
|
+
disabled: m
|
|
351
|
+
}), j(A, {
|
|
352
|
+
commandKey: "formatUnderlinedAccountingDoubleToggle",
|
|
353
|
+
groupKey: "underlineOptions",
|
|
354
|
+
disabled: m
|
|
355
|
+
})] })
|
|
356
|
+
})
|
|
357
|
+
]
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
W.displayName = "FontPanel";
|
|
361
|
+
var G = Object.freeze([
|
|
362
|
+
h.Edge.Top,
|
|
363
|
+
h.Edge.Bottom,
|
|
364
|
+
h.Edge.Left,
|
|
365
|
+
h.Edge.Right,
|
|
366
|
+
h.Edge.Horizontal,
|
|
367
|
+
h.Edge.Vertical
|
|
368
|
+
]), K = Object.freeze([]), le = Object.freeze([h.Edge.Horizontal, h.Edge.Vertical]), q = new Map([
|
|
369
|
+
...G,
|
|
370
|
+
h.Edge.DiagonalUp,
|
|
371
|
+
h.Edge.DiagonalDown
|
|
372
|
+
].map((e) => [e, Object.freeze([e])])), J = (e) => e === h.Edge.DiagonalUp || e === h.Edge.DiagonalDown;
|
|
373
|
+
function Y(e, t) {
|
|
374
|
+
switch (t) {
|
|
375
|
+
case h.Edge.Top: return e("border.top");
|
|
376
|
+
case h.Edge.Left: return e("border.left");
|
|
377
|
+
case h.Edge.Right: return e("border.right");
|
|
378
|
+
case h.Edge.Bottom: return e("border.bottom");
|
|
379
|
+
case h.Edge.Horizontal: return e("border.insideHorizontal");
|
|
380
|
+
case h.Edge.Vertical: return e("border.insideVertical");
|
|
381
|
+
case h.Edge.DiagonalUp: return e("border.diagonalUp");
|
|
382
|
+
case h.Edge.DiagonalDown: return e("border.diagonalDown");
|
|
383
|
+
default: return t;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
var ue = (e) => e === 0 ? "0px" : e === 1 ? "calc(100% - 1px)" : `calc(${100 * e}% - 0.5px)`, de = (e, t) => {
|
|
387
|
+
let n = "-7px", r = [];
|
|
388
|
+
for (let e = 0; e <= t; e++) {
|
|
389
|
+
let i = ue(e / t);
|
|
390
|
+
r.push({
|
|
391
|
+
left: i,
|
|
392
|
+
top: n,
|
|
393
|
+
width: "1px",
|
|
394
|
+
height: "5px"
|
|
395
|
+
}), r.push({
|
|
396
|
+
left: i,
|
|
397
|
+
bottom: n,
|
|
398
|
+
width: "1px",
|
|
399
|
+
height: "5px"
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
for (let t = 0; t <= e; t++) {
|
|
403
|
+
let i = ue(t / e);
|
|
404
|
+
r.push({
|
|
405
|
+
top: i,
|
|
406
|
+
left: n,
|
|
407
|
+
height: "1px",
|
|
408
|
+
width: "5px"
|
|
409
|
+
}), r.push({
|
|
410
|
+
top: i,
|
|
411
|
+
right: n,
|
|
412
|
+
height: "1px",
|
|
413
|
+
width: "5px"
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
return r;
|
|
417
|
+
}, fe = (e) => e === h.Edge.Left || e === h.Edge.Vertical || e === h.Edge.Right, pe = (e) => {
|
|
418
|
+
switch (e) {
|
|
419
|
+
case h.Edge.Top:
|
|
420
|
+
case h.Edge.Left: return 0;
|
|
421
|
+
case h.Edge.Horizontal:
|
|
422
|
+
case h.Edge.Vertical: return .5;
|
|
423
|
+
default: return 1;
|
|
424
|
+
}
|
|
425
|
+
}, me = (e) => {
|
|
426
|
+
let { edges: t, createBorder: n, onToggleEdges: i, omittedEdges: a, disabled: o = !1, height: s = 104, className: c, ...l } = e, u = T(), d = ie(null), [f, p] = k(K), m = D((e) => !a?.includes(e), [a]), g = D((e) => !o && m(e), [o, m]), _ = m(h.Edge.Horizontal) ? 2 : 1, y = m(h.Edge.Vertical) ? 2 : 1, b = D((e) => n({
|
|
427
|
+
top: e.rowIndex === 0 ? t.top : t.horizontal,
|
|
428
|
+
bottom: e.rowIndex === _ - 1 ? t.bottom : t.horizontal,
|
|
429
|
+
left: e.colIndex === 0 ? t.left : t.vertical,
|
|
430
|
+
right: e.colIndex === y - 1 ? t.right : t.vertical,
|
|
431
|
+
diagonalUp: t.diagonalUp,
|
|
432
|
+
diagonalDown: t.diagonalDown
|
|
433
|
+
}), [
|
|
434
|
+
t,
|
|
435
|
+
n,
|
|
436
|
+
_,
|
|
437
|
+
y
|
|
438
|
+
]), x = D((e) => {
|
|
439
|
+
let t = d.current;
|
|
440
|
+
if (!t) return K;
|
|
441
|
+
let n = t.getBoundingClientRect();
|
|
442
|
+
return function(e, t, n, r, i) {
|
|
443
|
+
if (n <= 0 || r <= 0) return K;
|
|
444
|
+
let a = Math.min(10, n / 5, r / 5);
|
|
445
|
+
if (le.every(i) && Math.abs(e - n / 2) <= a && Math.abs(t - r / 2) <= a) return le;
|
|
446
|
+
let o = Math.abs(e) <= a, s = Math.abs(e - n) <= a, c = Math.abs(t) <= a, l = Math.abs(t - r) <= a;
|
|
447
|
+
if ((o || s) && (c || l)) {
|
|
448
|
+
let e = o === c ? h.Edge.DiagonalDown : h.Edge.DiagonalUp;
|
|
449
|
+
if (i(e)) return q.get(e);
|
|
450
|
+
}
|
|
451
|
+
let u = null, d = Infinity;
|
|
452
|
+
for (let a of G) {
|
|
453
|
+
if (!i(a)) continue;
|
|
454
|
+
let o = fe(a), s = o ? r : n, c = o ? t : e, l = Math.max(0, -c, c - s), f = (o ? e : t) - pe(a) * (o ? n : r), p = Math.hypot(l, f);
|
|
455
|
+
p < d && (d = p, u = a);
|
|
456
|
+
}
|
|
457
|
+
return u && d <= a ? q.get(u) : K;
|
|
458
|
+
}(e.clientX - n.left, e.clientY - n.top, n.width, n.height, g);
|
|
459
|
+
}, [g]);
|
|
460
|
+
return j(N, {
|
|
461
|
+
className: r("sxl-border-preview", c),
|
|
462
|
+
...l,
|
|
463
|
+
onPointerMove: (e) => p(x(e)),
|
|
464
|
+
onPointerLeave: () => p(K),
|
|
465
|
+
onClick: (e) => {
|
|
466
|
+
let t = x(e);
|
|
467
|
+
t.length > 0 && i(t);
|
|
468
|
+
},
|
|
469
|
+
sx: {
|
|
470
|
+
position: "relative",
|
|
471
|
+
boxSizing: "border-box",
|
|
472
|
+
height: `${s}px`,
|
|
473
|
+
width: "100%",
|
|
474
|
+
padding: "10px",
|
|
475
|
+
cursor: f.length > 0 ? "pointer" : "default",
|
|
476
|
+
borderRadius: (e) => `${e.shape.borderRadius}px`,
|
|
477
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
478
|
+
opacity: o ? .6 : 1
|
|
479
|
+
},
|
|
480
|
+
children: M(N, {
|
|
481
|
+
ref: d,
|
|
482
|
+
sx: {
|
|
483
|
+
position: "relative",
|
|
484
|
+
width: "100%",
|
|
485
|
+
height: "100%"
|
|
486
|
+
},
|
|
487
|
+
children: [
|
|
488
|
+
j(N, {
|
|
489
|
+
"aria-hidden": "true",
|
|
490
|
+
sx: {
|
|
491
|
+
position: "absolute",
|
|
492
|
+
inset: 0,
|
|
493
|
+
display: "grid",
|
|
494
|
+
gridTemplateColumns: `repeat(${y}, 1fr)`,
|
|
495
|
+
gridTemplateRows: `repeat(${_}, 1fr)`,
|
|
496
|
+
gap: "2px",
|
|
497
|
+
pointerEvents: "none",
|
|
498
|
+
"& > div": { backgroundColor: (e) => I(e.palette.text.primary, .05) }
|
|
499
|
+
},
|
|
500
|
+
children: Array.from({ length: _ * y }, (e, t) => j("div", {}, t))
|
|
501
|
+
}),
|
|
502
|
+
j(N, {
|
|
503
|
+
"aria-hidden": "true",
|
|
504
|
+
sx: {
|
|
505
|
+
position: "absolute",
|
|
506
|
+
inset: 0,
|
|
507
|
+
pointerEvents: "none",
|
|
508
|
+
"& > div": {
|
|
509
|
+
position: "absolute",
|
|
510
|
+
backgroundColor: (e) => e.palette.text.secondary
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
children: de(_, y).map((e, t) => j("div", { style: e }, t))
|
|
514
|
+
}),
|
|
515
|
+
f.length > 0 ? M(N, {
|
|
516
|
+
"aria-hidden": "true",
|
|
517
|
+
sx: {
|
|
518
|
+
position: "absolute",
|
|
519
|
+
inset: 0,
|
|
520
|
+
pointerEvents: "none",
|
|
521
|
+
opacity: .22,
|
|
522
|
+
"& > div": {
|
|
523
|
+
position: "absolute",
|
|
524
|
+
borderRadius: "3px",
|
|
525
|
+
backgroundColor: (e) => e.palette.text.primary
|
|
526
|
+
},
|
|
527
|
+
"& line": { stroke: (e) => e.palette.text.primary }
|
|
528
|
+
},
|
|
529
|
+
children: [f.filter((e) => !J(e)).map((e) => j("div", { style: he(e) }, e)), f.some(J) ? j("svg", {
|
|
530
|
+
viewBox: "0 0 100 100",
|
|
531
|
+
preserveAspectRatio: "none",
|
|
532
|
+
style: {
|
|
533
|
+
position: "absolute",
|
|
534
|
+
inset: 0,
|
|
535
|
+
width: "100%",
|
|
536
|
+
height: "100%",
|
|
537
|
+
overflow: "visible"
|
|
538
|
+
},
|
|
539
|
+
children: f.filter(J).flatMap((e) => function(e, t, n) {
|
|
540
|
+
let r = [];
|
|
541
|
+
for (let i = 0; i < t; i++) for (let a = 0; a < n; a++) {
|
|
542
|
+
let o = a / n * 100, s = (a + 1) / n * 100, c = i / t * 100, l = (i + 1) / t * 100, u = e === h.Edge.DiagonalDown;
|
|
543
|
+
r.push(j("line", {
|
|
544
|
+
x1: o,
|
|
545
|
+
y1: u ? c : l,
|
|
546
|
+
x2: s,
|
|
547
|
+
y2: u ? l : c,
|
|
548
|
+
strokeWidth: 6,
|
|
549
|
+
strokeLinecap: "round",
|
|
550
|
+
vectorEffect: "non-scaling-stroke"
|
|
551
|
+
}, `${e}:${i}:${a}`));
|
|
552
|
+
}
|
|
553
|
+
return r;
|
|
554
|
+
}(e, _, y))
|
|
555
|
+
}) : null]
|
|
556
|
+
}) : null,
|
|
557
|
+
j(v, {
|
|
558
|
+
getBorderAt: b,
|
|
559
|
+
rowCount: _,
|
|
560
|
+
columnCount: y,
|
|
561
|
+
style: {
|
|
562
|
+
position: "absolute",
|
|
563
|
+
inset: 0,
|
|
564
|
+
height: "100%",
|
|
565
|
+
width: "100%"
|
|
566
|
+
}
|
|
567
|
+
}),
|
|
568
|
+
G.filter(m).map((e) => j(N, {
|
|
569
|
+
component: "button",
|
|
570
|
+
type: "button",
|
|
571
|
+
"aria-label": Y(u, e),
|
|
572
|
+
"aria-pressed": !!t[e],
|
|
573
|
+
title: Y(u, e),
|
|
574
|
+
disabled: !g(e),
|
|
575
|
+
onClick: (t) => {
|
|
576
|
+
t.stopPropagation(), i(q.get(e));
|
|
577
|
+
},
|
|
578
|
+
sx: {
|
|
579
|
+
position: "absolute",
|
|
580
|
+
appearance: "none",
|
|
581
|
+
background: "transparent",
|
|
582
|
+
border: "none",
|
|
583
|
+
padding: 0,
|
|
584
|
+
pointerEvents: "none",
|
|
585
|
+
borderRadius: "3px",
|
|
586
|
+
"&:focus-visible": { outline: (e) => `2px solid ${e.palette.primary.main}` },
|
|
587
|
+
...he(e)
|
|
588
|
+
}
|
|
589
|
+
}, e))
|
|
590
|
+
]
|
|
591
|
+
})
|
|
592
|
+
});
|
|
593
|
+
};
|
|
594
|
+
function he(e) {
|
|
595
|
+
let t = `calc(${100 * pe(e)}% - 3px)`;
|
|
596
|
+
return fe(e) ? {
|
|
597
|
+
top: 0,
|
|
598
|
+
bottom: 0,
|
|
599
|
+
left: t,
|
|
600
|
+
width: "6px"
|
|
601
|
+
} : {
|
|
602
|
+
left: 0,
|
|
603
|
+
right: 0,
|
|
604
|
+
top: t,
|
|
605
|
+
height: "6px"
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
me.displayName = "BorderPreview";
|
|
609
|
+
var ge = h.StrokeStyle.Thin, X = Object.freeze([
|
|
610
|
+
h.Edge.Left,
|
|
611
|
+
h.Edge.Top,
|
|
612
|
+
h.Edge.Right,
|
|
613
|
+
h.Edge.Bottom
|
|
614
|
+
]), _e = Object.freeze([h.Edge.Horizontal, h.Edge.Vertical]), Z = Object.freeze([...X, ..._e]), ve = Object.freeze([h.Edge.DiagonalUp, h.Edge.DiagonalDown]), ye = Object.freeze([...Z, ...ve]), be = (e, t, n) => {
|
|
615
|
+
let r = {
|
|
616
|
+
style: t,
|
|
617
|
+
color: n?.toString()
|
|
618
|
+
}, i = {};
|
|
619
|
+
for (let t of e) i[t] = r;
|
|
620
|
+
return i;
|
|
621
|
+
}, xe = (e) => {
|
|
622
|
+
let t = {};
|
|
623
|
+
for (let n of e) t[n] = null;
|
|
624
|
+
return t;
|
|
625
|
+
}, Se = (e) => e ? e.toString() : null, Ce = E((i) => {
|
|
626
|
+
let { selection: a, disabled: o, className: c, ...f } = i, p = T(), { getEdgeStroke: m, createBorder: g, applyStyle: _, styles: v, schemeLookup: y, autoColor: b, darkMode: x, hasInnerHorizontal: S, hasInnerVertical: te } = a, w = o || a.disabled, E = C((e) => e === h.Edge.Horizontal ? !S : e === h.Edge.Vertical && !te, [S, te]), [D, ne] = k(() => {
|
|
627
|
+
let e = m(h.Edge.Bottom)?.getStyle();
|
|
628
|
+
return e && e !== h.StrokeStyle.None ? e : ge;
|
|
629
|
+
}), [O, re] = k(() => {
|
|
630
|
+
let e = m(h.Edge.Bottom);
|
|
631
|
+
return !e || e.isNone() ? null : e.getProperties().color ? e.getColor() : null;
|
|
632
|
+
}), ie = C(() => v.recentColors(), [v]), A = C((e) => {
|
|
633
|
+
_({ borders: e }, L("op.setBorders"));
|
|
634
|
+
}, [_]), P = C((e) => {
|
|
635
|
+
e.length !== 0 && _([{ borders: xe(e) }, { borders: be(e, D, O) }], L("op.setBorders"));
|
|
636
|
+
}, [
|
|
637
|
+
_,
|
|
638
|
+
D,
|
|
639
|
+
O
|
|
640
|
+
]), F = C((e) => {
|
|
641
|
+
e.length !== 0 && A(be(e, h.StrokeStyle.None, null));
|
|
642
|
+
}, [A]), se = C((e) => {
|
|
643
|
+
P(e.filter((e) => !E(e)));
|
|
644
|
+
}, [P, E]), I = {};
|
|
645
|
+
for (let e of ye) {
|
|
646
|
+
let t = m(e);
|
|
647
|
+
t && !t.isNone() && (I[e] = t.getProperties());
|
|
648
|
+
}
|
|
649
|
+
let R = C((e) => {
|
|
650
|
+
let t = I[e];
|
|
651
|
+
return (t?.style ?? h.StrokeStyle.None) === D && Se(t?.color) === Se(O);
|
|
652
|
+
}, [
|
|
653
|
+
I,
|
|
654
|
+
D,
|
|
655
|
+
O
|
|
656
|
+
]), z = (e) => {
|
|
657
|
+
let t = e.filter((e) => !E(e));
|
|
658
|
+
return t.length > 0 && t.every(R);
|
|
659
|
+
}, B = C((e) => {
|
|
660
|
+
let t = e.filter((e) => !E(e));
|
|
661
|
+
D === h.StrokeStyle.None || t.every(R) ? F(t) : P(t);
|
|
662
|
+
}, [
|
|
663
|
+
F,
|
|
664
|
+
P,
|
|
665
|
+
R,
|
|
666
|
+
E,
|
|
667
|
+
D
|
|
668
|
+
]), V = (e) => be(e, D, O), H = (e, t, r) => j(ae, {
|
|
669
|
+
disabled: w,
|
|
670
|
+
icon: j(n, {
|
|
671
|
+
border: e.length > 0 ? V(e) : null,
|
|
672
|
+
createBorder: g
|
|
673
|
+
}),
|
|
674
|
+
propsTooltip: {
|
|
675
|
+
label: t,
|
|
676
|
+
simple: !0
|
|
677
|
+
},
|
|
678
|
+
onClick: r
|
|
679
|
+
}), U = (e, t) => {
|
|
680
|
+
let r = w || e.every(E);
|
|
681
|
+
return j(ae, {
|
|
682
|
+
disabled: r,
|
|
683
|
+
selected: !r && D !== h.StrokeStyle.None && z(e),
|
|
684
|
+
icon: j(n, {
|
|
685
|
+
border: V(e),
|
|
686
|
+
createBorder: g
|
|
687
|
+
}),
|
|
688
|
+
propsTooltip: {
|
|
689
|
+
label: t,
|
|
690
|
+
simple: !0
|
|
691
|
+
},
|
|
692
|
+
onClick: () => B(e)
|
|
693
|
+
});
|
|
694
|
+
}, W = (e) => U([e], Y(p, e));
|
|
695
|
+
return M(N, {
|
|
696
|
+
className: r("sxl-format-border-panel", c),
|
|
697
|
+
sx: l,
|
|
698
|
+
...f,
|
|
699
|
+
children: [
|
|
700
|
+
M(u, { children: [j(e, {
|
|
701
|
+
disabled: w || D === h.StrokeStyle.None,
|
|
702
|
+
darkMode: x,
|
|
703
|
+
icon: j(ee, { iconKey: "stroke.colored" }),
|
|
704
|
+
tooltip: p("border.colorTooltip"),
|
|
705
|
+
selectedColor: O,
|
|
706
|
+
onSelectColor: (e) => re(e),
|
|
707
|
+
propsPanel: {
|
|
708
|
+
disableAlpha: !0,
|
|
709
|
+
schemeLookup: y,
|
|
710
|
+
recentColors: ie,
|
|
711
|
+
autoColor: b
|
|
712
|
+
}
|
|
713
|
+
}), j(t, {
|
|
714
|
+
disabled: w,
|
|
715
|
+
darkMode: x,
|
|
716
|
+
selectedStyle: D,
|
|
717
|
+
styleColor: O,
|
|
718
|
+
variant: oe.Toolbar,
|
|
719
|
+
onSelectStyle: (e) => ne(e ?? h.StrokeStyle.None)
|
|
720
|
+
})] }),
|
|
721
|
+
M(d, {
|
|
722
|
+
sx: { justifyContent: "center" },
|
|
723
|
+
children: [
|
|
724
|
+
H(Z, p("border.all"), () => se(Z)),
|
|
725
|
+
H(X, p("border.outside"), () => se(X)),
|
|
726
|
+
H([], p("border.none"), () => A(null))
|
|
727
|
+
]
|
|
728
|
+
}),
|
|
729
|
+
M(s, {
|
|
730
|
+
sx: { px: 1.5 },
|
|
731
|
+
children: [M(N, {
|
|
732
|
+
sx: {
|
|
733
|
+
display: "grid",
|
|
734
|
+
gridTemplateColumns: "auto minmax(0, 156px) auto",
|
|
735
|
+
justifyContent: "center",
|
|
736
|
+
columnGap: .5,
|
|
737
|
+
rowGap: .25,
|
|
738
|
+
minWidth: 0
|
|
739
|
+
},
|
|
740
|
+
children: [
|
|
741
|
+
M(N, {
|
|
742
|
+
sx: {
|
|
743
|
+
display: "flex",
|
|
744
|
+
flexDirection: "column",
|
|
745
|
+
justifyContent: "space-between",
|
|
746
|
+
height: "104px"
|
|
747
|
+
},
|
|
748
|
+
children: [
|
|
749
|
+
W(h.Edge.Top),
|
|
750
|
+
W(h.Edge.Horizontal),
|
|
751
|
+
W(h.Edge.Bottom)
|
|
752
|
+
]
|
|
753
|
+
}),
|
|
754
|
+
j(me, {
|
|
755
|
+
edges: I,
|
|
756
|
+
createBorder: g,
|
|
757
|
+
disabled: w,
|
|
758
|
+
height: 104,
|
|
759
|
+
omittedEdges: Z.filter(E),
|
|
760
|
+
onToggleEdges: B
|
|
761
|
+
}),
|
|
762
|
+
j(N, {
|
|
763
|
+
sx: {
|
|
764
|
+
display: "flex",
|
|
765
|
+
alignItems: "center"
|
|
766
|
+
},
|
|
767
|
+
children: U(_e, p("border.inner"))
|
|
768
|
+
}),
|
|
769
|
+
W(h.Edge.DiagonalUp),
|
|
770
|
+
M(N, {
|
|
771
|
+
sx: {
|
|
772
|
+
display: "flex",
|
|
773
|
+
justifyContent: "space-between",
|
|
774
|
+
minWidth: 0
|
|
775
|
+
},
|
|
776
|
+
children: [
|
|
777
|
+
W(h.Edge.Left),
|
|
778
|
+
W(h.Edge.Vertical),
|
|
779
|
+
W(h.Edge.Right)
|
|
780
|
+
]
|
|
781
|
+
}),
|
|
782
|
+
W(h.Edge.DiagonalDown)
|
|
783
|
+
]
|
|
784
|
+
}), j(ce, {
|
|
785
|
+
variant: "caption",
|
|
786
|
+
component: "div",
|
|
787
|
+
sx: {
|
|
788
|
+
color: "text.secondary",
|
|
789
|
+
lineHeight: 1.4,
|
|
790
|
+
textAlign: "center"
|
|
791
|
+
},
|
|
792
|
+
children: p("format.borderDiagram")
|
|
793
|
+
})]
|
|
794
|
+
})
|
|
795
|
+
]
|
|
796
|
+
});
|
|
797
|
+
});
|
|
798
|
+
Ce.displayName = "BorderPanel";
|
|
799
|
+
var Q = {
|
|
800
|
+
Number: "number",
|
|
801
|
+
Alignment: "alignment",
|
|
802
|
+
Font: "font",
|
|
803
|
+
Border: "border",
|
|
804
|
+
Fill: "fill"
|
|
805
|
+
}, we = "format.tab", Te = Object.freeze([
|
|
806
|
+
Q.Number,
|
|
807
|
+
Q.Alignment,
|
|
808
|
+
Q.Font,
|
|
809
|
+
Q.Border,
|
|
810
|
+
Q.Fill
|
|
811
|
+
]), $ = E((e) => {
|
|
812
|
+
let t = e.model, n = T();
|
|
813
|
+
S(t, "onSelectedSheetChange");
|
|
814
|
+
let r = t.getSelectedWorksheet();
|
|
815
|
+
if (!r) {
|
|
816
|
+
let { model: t, args: r, entryKey: i, frame: a, ref: o, ...s } = e;
|
|
817
|
+
return j(P, {
|
|
818
|
+
square: !0,
|
|
819
|
+
ref: o,
|
|
820
|
+
sx: {
|
|
821
|
+
display: "flex",
|
|
822
|
+
flex: "1 1 auto",
|
|
823
|
+
padding: (e) => e.spacing(2, 2)
|
|
824
|
+
},
|
|
825
|
+
...s,
|
|
826
|
+
children: n("format.noWorksheet")
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
return j(Ee, {
|
|
830
|
+
...e,
|
|
831
|
+
sheet: r
|
|
832
|
+
});
|
|
833
|
+
});
|
|
834
|
+
$.displayName = "FormatTaskPane";
|
|
835
|
+
var Ee = E((e) => {
|
|
836
|
+
let { model: t, sheet: n, args: r, entryKey: i, frame: a, ref: o, ...s } = e, c = T(), l = ((e) => {
|
|
837
|
+
let [, t] = re((e) => e + 1, 0);
|
|
838
|
+
x(e, {
|
|
839
|
+
onSelectionChange: () => t(),
|
|
840
|
+
onStyleChange: () => t()
|
|
841
|
+
});
|
|
842
|
+
let [n] = te(["formatBoldToggle"]), r = b(), i = e.getSelectedCell(), a = e.getStyles(), o = e.getSelectedRanges(), s = C((t, n, r) => {
|
|
843
|
+
let i = Array.isArray(t) ? t : [t];
|
|
844
|
+
e.doBatch(() => {
|
|
845
|
+
for (let t of i) e.getSelectedRanges().getStyle().update(t, {
|
|
846
|
+
autoSelect: R,
|
|
847
|
+
autoFit: r ?? !0
|
|
848
|
+
});
|
|
849
|
+
}, { description: n ?? L("op.updateStyle") });
|
|
850
|
+
}, [e]), c = C((t) => e.createCell(t), [e]), l = C((e) => a.getNormal().createStyle({ borders: e }).getBorders(), [a]), u = o.getCoords()[0], d = C((t) => {
|
|
851
|
+
if (!u) return null;
|
|
852
|
+
let n = (t, n) => e.getCell({
|
|
853
|
+
rowIndex: t,
|
|
854
|
+
colIndex: n
|
|
855
|
+
}).getStyle(!0).getBorders();
|
|
856
|
+
switch (t) {
|
|
857
|
+
case h.Edge.Top: return n(u.rowStart, u.colStart).getTop();
|
|
858
|
+
case h.Edge.Left: return n(u.rowStart, u.colStart).getLeft();
|
|
859
|
+
case h.Edge.Bottom: return n(u.rowEnd, u.colEnd).getBottom();
|
|
860
|
+
case h.Edge.Right: return n(u.rowEnd, u.colEnd).getRight();
|
|
861
|
+
case h.Edge.Horizontal: return u.rowEnd <= u.rowStart ? null : n(u.rowStart + 1, u.colStart).getTop();
|
|
862
|
+
case h.Edge.Vertical: return u.colEnd <= u.colStart ? null : n(u.rowStart, u.colStart + 1).getLeft();
|
|
863
|
+
case h.Edge.DiagonalUp: return n(u.rowStart, u.colStart).getDiagonalUp();
|
|
864
|
+
case h.Edge.DiagonalDown: return n(u.rowStart, u.colStart).getDiagonalDown();
|
|
865
|
+
default: return null;
|
|
866
|
+
}
|
|
867
|
+
}, [e, u]);
|
|
868
|
+
return {
|
|
869
|
+
sheet: e,
|
|
870
|
+
cell: i,
|
|
871
|
+
style: i.getStyle(),
|
|
872
|
+
styles: a,
|
|
873
|
+
schemeLookup: a.schemeLookup(),
|
|
874
|
+
autoColor: a.getNormal().getFont().getColor(),
|
|
875
|
+
darkMode: r === "dark",
|
|
876
|
+
disabled: n?.disabled() ?? !1,
|
|
877
|
+
applyStyle: s,
|
|
878
|
+
createCell: c,
|
|
879
|
+
createBorder: l,
|
|
880
|
+
getEdgeStroke: d,
|
|
881
|
+
hasInnerHorizontal: o.getRowCount() > 1,
|
|
882
|
+
hasInnerVertical: o.getColumnCount() > 1
|
|
883
|
+
};
|
|
884
|
+
})(n), [u, d] = w(we, Q.Number), g = Te.includes(u) ? u : Q.Number;
|
|
885
|
+
ne(() => {
|
|
886
|
+
let e = r?.tab;
|
|
887
|
+
e && d(e);
|
|
888
|
+
}, [r]);
|
|
889
|
+
let v = l.style.getNumberFormat(), y = typeof v == "number" ? _.resolve(v) : v ?? "General";
|
|
890
|
+
return M(P, {
|
|
891
|
+
square: !0,
|
|
892
|
+
ref: o,
|
|
893
|
+
sx: {
|
|
894
|
+
display: "flex",
|
|
895
|
+
flexDirection: "column",
|
|
896
|
+
flex: "1 1 auto",
|
|
897
|
+
width: "100%",
|
|
898
|
+
height: "100%",
|
|
899
|
+
minHeight: 0,
|
|
900
|
+
overflow: "hidden"
|
|
901
|
+
},
|
|
902
|
+
...s,
|
|
903
|
+
children: [
|
|
904
|
+
j(N, {
|
|
905
|
+
sx: {
|
|
906
|
+
flexShrink: 0,
|
|
907
|
+
padding: (e) => e.spacing(1.5, 2)
|
|
908
|
+
},
|
|
909
|
+
children: j(z, { selection: l })
|
|
910
|
+
}),
|
|
911
|
+
j(se, {
|
|
912
|
+
value: g,
|
|
913
|
+
onChange: (e, t) => d(t),
|
|
914
|
+
variant: "scrollable",
|
|
915
|
+
scrollButtons: "auto",
|
|
916
|
+
allowScrollButtonsMobile: !0,
|
|
917
|
+
sx: {
|
|
918
|
+
minHeight: 0,
|
|
919
|
+
flexShrink: 0,
|
|
920
|
+
borderBottom: (e) => `1px solid ${e.palette.divider}`,
|
|
921
|
+
"& .MuiTab-root": {
|
|
922
|
+
textTransform: "none",
|
|
923
|
+
whiteSpace: "nowrap",
|
|
924
|
+
minHeight: 0,
|
|
925
|
+
minWidth: 0,
|
|
926
|
+
flex: "1 0 auto",
|
|
927
|
+
padding: "8px 4px"
|
|
928
|
+
}
|
|
929
|
+
},
|
|
930
|
+
children: Te.map((e) => j(F, {
|
|
931
|
+
value: e,
|
|
932
|
+
label: De(c, e)
|
|
933
|
+
}, e))
|
|
934
|
+
}),
|
|
935
|
+
M(N, {
|
|
936
|
+
sx: {
|
|
937
|
+
flex: "1 1 auto",
|
|
938
|
+
minHeight: 0,
|
|
939
|
+
overflow: "auto",
|
|
940
|
+
padding: (e) => e.spacing(2.5, 2)
|
|
941
|
+
},
|
|
942
|
+
children: [
|
|
943
|
+
g === Q.Number ? j(f, {
|
|
944
|
+
hideSample: !0,
|
|
945
|
+
showQuickFormats: !0,
|
|
946
|
+
value: y,
|
|
947
|
+
disabled: l.disabled,
|
|
948
|
+
context: () => l.cell,
|
|
949
|
+
onChange: (e) => {
|
|
950
|
+
l.applyStyle({ numberFormat: e }, L("op.setNumberFormat"));
|
|
951
|
+
}
|
|
952
|
+
}) : null,
|
|
953
|
+
g === Q.Alignment ? j(U, { selection: l }) : null,
|
|
954
|
+
g === Q.Font ? j(W, { selection: l }) : null,
|
|
955
|
+
g === Q.Fill ? j(m, { selection: p(l) }) : null,
|
|
956
|
+
g === Q.Border ? j(Ce, { selection: l }) : null
|
|
957
|
+
]
|
|
958
|
+
})
|
|
959
|
+
]
|
|
960
|
+
});
|
|
961
|
+
});
|
|
962
|
+
function De(e, t) {
|
|
963
|
+
switch (t) {
|
|
964
|
+
case Q.Number: return e("format.tabNumber");
|
|
965
|
+
case Q.Alignment: return e("format.tabAlignment");
|
|
966
|
+
case Q.Font: return e("format.tabFont");
|
|
967
|
+
case Q.Fill: return e("format.tabFill");
|
|
968
|
+
case Q.Border: return e("format.tabBorder");
|
|
969
|
+
default: return t;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
Ee.displayName = "FormatTaskPaneBody";
|
|
973
|
+
export { we as FORMAT_TAB_KEY, Q as FormatTab, $ as FormatTaskPane, $ as default };
|