@sheetxl/studio-mui 0.8.0-beta.10 → 0.8.0-beta.12
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/{ByeL_BZuJ2kl8gtf.mjs → 0IBZhOJaVmzJxuTv.mjs} +1 -1
- package/browser/esm/2nRxqrNYbmEn8fS8.mjs +386 -0
- package/browser/esm/{fb126BNj3F8URR19.mjs → 7fVZXXuonYb6Z7FU.mjs} +3 -3
- package/browser/esm/BAzhmMX4Fk_qnUTp.mjs +414 -0
- package/browser/esm/BGL3x0W74D7qZXlf.mjs +318 -0
- package/browser/esm/BHGr2gsFofTdAFxq.mjs +515 -0
- package/browser/esm/{DU3J8Gcf-WpBxNYg.mjs → BKhcJI-G15D3kGap.mjs} +4 -4
- package/browser/esm/BNbub9weuqm3mcoF.mjs +335 -0
- package/browser/esm/BSv9MVJaz1DVEffm.mjs +975 -0
- package/browser/esm/BWfLpYmd3cSgJ0C6.mjs +141 -0
- package/browser/esm/BZqwbIE8qzjSOYcJ.mjs +582 -0
- package/browser/esm/BZy9xUrYpAtnKeji.mjs +1288 -0
- package/browser/esm/{CIu1bjPJe_x31Oww.mjs → BnkwC5rsg9LZyhoP.mjs} +3 -3
- package/browser/esm/BpJsBv413cNQpyg0.mjs +319 -0
- package/browser/esm/BpVrgbVISiTDyFR3.mjs +197 -0
- package/browser/esm/BsngRDhvVYGVBJeK.mjs +1546 -0
- package/browser/esm/{C1Rp2hZrApo5MUc8.mjs → C29TKq47CbXs652l.mjs} +2 -2
- package/browser/esm/{CEvZe2cZK-voZTif.mjs → C8p2iMad_NNCwGI_.mjs} +5 -5
- package/browser/esm/CBzXksWnb-1gGEWZ.mjs +212 -0
- package/browser/esm/{IQLeaAbtGTipUsOD.mjs → CFIAWgpU3UyepLBn.mjs} +25 -24
- package/browser/esm/CJD4jF4m9cBGHzr_.mjs +31 -0
- package/browser/esm/{CjznclrKqJRi7u9O.mjs → CMc7G7cevxzPGxr9.mjs} +2 -2
- package/browser/esm/{B1Yp_uy1vFHcJB3U.mjs → CYtULLhY9M2m3DeH.mjs} +1 -1
- package/browser/esm/CeF35ZeFP28Do5Zx.mjs +1379 -0
- package/browser/esm/{xKiLJKiLxto8SayF.mjs → CjYKDxU4EP2Kf_vo.mjs} +2 -2
- package/browser/esm/{D8al_cJ4U-NgzwoK.mjs → Cq82lvdjyBvlJ8xJ.mjs} +19 -17
- package/browser/esm/{X1Db3b_7b_7OuCk6.mjs → CuRxFAO42JkQvMEx.mjs} +1 -1
- package/browser/esm/Cvk2yY90hpgXWMAt.mjs +103 -0
- package/browser/esm/D0slJycx3nq53qmf.mjs +14 -0
- package/browser/esm/{9eKCkvqpMQwqcXiw.mjs → D2jzliMwAo2ENpfi.mjs} +1 -1
- package/browser/esm/D5Fn0Hqllwv5HY6i.mjs +7581 -0
- package/browser/esm/D5N4nGaZsXtrHAOh.mjs +831 -0
- package/browser/esm/D7AqPfyhMiuda5l5.mjs +412 -0
- package/browser/esm/DHZA48ZMCETvHmeP.mjs +161 -0
- package/browser/esm/DX2_vf7WX6uRLaOZ.mjs +94 -0
- package/browser/esm/DaxpbAF1ShkT7hNU.mjs +490 -0
- package/browser/esm/{D6S8kVTzOjCn0-SK.mjs → Db3oHfXiRtcH015t.mjs} +162 -156
- package/browser/esm/Dt47Huh1l3C4_5_w.mjs +87 -0
- package/browser/esm/{DmCQbW4zwkT_Rq88.mjs → DtPt0phL7m56YfHZ.mjs} +1 -1
- package/browser/esm/{CoSiOS-og0zFw4Ws.mjs → DtTDaXmnWUoG4VBO.mjs} +2 -2
- package/browser/esm/{DHY19rkSiiRZxShC.mjs → DuuyN4-7K6_io2Py.mjs} +3 -3
- package/browser/esm/{yZxC4qUENOlMhVUH.mjs → NeGeLF3gbGMZyV6E.mjs} +1 -1
- package/browser/esm/PY3Br5Bo_TxcCnCU.mjs +252 -0
- package/browser/esm/WIhvQtBkGiw-oFUs.mjs +2566 -0
- package/browser/esm/WgIvwAENeO8LANax.mjs +437 -0
- package/browser/esm/{DBtc4lku0uHVcqWn.mjs → Yjq3p_7eVGFw2Jod.mjs} +3 -3
- package/browser/esm/index.mjs +1053 -192
- package/browser/esm/jFRFCWlkD7Dsrhkh.mjs +236 -0
- package/browser/esm/lKXEDVt2ow1NlWJj.mjs +392 -0
- package/browser/esm/{Blaj2R5hYxtLAW__.mjs → oC0OwOddhOD0OoCJ.mjs} +6 -6
- package/browser/esm/{sFOAxZpxXo-qvDSp.mjs → tIKqpsA0vNXH9EgU.mjs} +1 -1
- package/browser/esm/{5cbK03T_Oh3tNdR7.mjs → u84rSnESjxqB6gay.mjs} +1 -1
- package/licenses/dependencies.txt +94 -94
- package/node/esm/{BcwMb6CyVfvEwbHn.mjs → B8Ls4Eh1k8-Yiry_.mjs} +1 -1
- package/node/esm/{CKu1AtRgyltyEdEN.mjs → B9X3n8MglL4OitAV.mjs} +1 -1
- package/node/esm/{ETK6T6G0SIcFXDe5.mjs → BBGoyqs2L_ccSH1e.mjs} +40 -40
- package/node/esm/BLv99aovW4R3C5PE.mjs +515 -0
- package/node/esm/BUGU_5lUtnCRlp3n.mjs +519 -0
- package/node/esm/BalROFG_oa9PFs9Q.mjs +141 -0
- package/node/esm/{ah3CUg4-VmNstGk_.mjs → BqVxnA1mo52ubjdf.mjs} +2 -2
- package/node/esm/C3FCh9xju2SccUIE.mjs +1283 -0
- package/node/esm/{Bb1sLMqXWKjdve23.mjs → C4F6WY8M4nkLyxdb.mjs} +2 -2
- package/node/esm/CKWeipCqqpLnLE5e.mjs +391 -0
- package/node/esm/CTnVNfz4eqFnM92M.mjs +212 -0
- package/node/esm/Cfi_ly8fBDZZdiZT.mjs +72 -0
- package/node/esm/CgKa6JuyJ1tTodev.mjs +1703 -0
- package/node/esm/{cqzp431iNSLWictb.mjs → Cq53M7bAUSXMNq1f.mjs} +22 -22
- package/node/esm/{BYsG3KYVmxSe_CIQ.mjs → Cr8AYWUoU-XVt0hu.mjs} +1 -1
- package/node/esm/CyuOE595I2e-U4cG.mjs +236 -0
- package/node/esm/D72CupF9mfy2D1Xa.mjs +94 -0
- package/node/esm/{DNSjK5DAH3M14Qbc.mjs → DGDHFK8okuVbRCe5.mjs} +1 -1
- package/node/esm/{B8SQfjKjzYHLxzZR.mjs → DJFkALt4XrwkMbnU.mjs} +163 -157
- package/node/esm/DJpwI8PlKBI2rk0r.mjs +319 -0
- package/node/esm/{DZzvTQxIKr9LbEsA.mjs → DQaGPUYbgL4Y5YZW.mjs} +32 -30
- package/node/esm/{D9rzScOA9pEYFrtz.mjs → DsNYnq4NtYBxPmeA.mjs} +20 -20
- package/node/esm/DygDgOpa9sJ6YFVS.mjs +385 -0
- package/node/esm/Dz0Hg87UcJ-awwiI.mjs +489 -0
- package/node/esm/M7YxvRPGCuxuk9aK.mjs +142 -0
- package/node/esm/QNjtpX8rIpqGGLEJ.mjs +1379 -0
- package/node/esm/{B_jRGdwGFkudwmL-.mjs → ZzvsynJTCSuChYS-.mjs} +1 -1
- package/node/esm/{ci8d-mF1H9wnYzix.mjs → di_8-pXh90j4BO4j.mjs} +1 -1
- package/node/esm/dm8dmEaTIqfmgyeL.mjs +412 -0
- package/node/esm/{D6oQL8knsPpgdXuk.mjs → fmya3XQnTGyQisvT.mjs} +2 -2
- package/node/esm/gPYAb_A0T5ZwcQ1E.mjs +318 -0
- package/node/esm/index.mjs +8915 -13417
- package/node/esm/wB8xMpyJ_NvE16yG.mjs +975 -0
- package/node/esm/zGAcd4Jr7wkvXDBS.mjs +197 -0
- package/package.json +9 -9
- package/resources/locales/de/groups.cmd.json +4 -0
- package/resources/locales/de/ui.msg.json +100 -1
- package/resources/locales/en/groups.cmd.json +4 -0
- package/resources/locales/en/ui.msg.json +100 -1
- 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/BorderPopupButton.d.ts +1 -1
- 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/color/ColorPopupButton.d.ts +1 -1
- package/types/src/command/AccountingStyleCommandButton.d.ts +1 -1
- package/types/src/command/DocThemeCommandButton.d.ts +1 -1
- package/types/src/command/FontFamilyCommandButton.d.ts +1 -1
- package/types/src/command/FontSizeCommandButton.d.ts +1 -1
- package/types/src/command/InsertCellControlCommandButton.d.ts +17 -0
- package/types/src/command/LanguageCommandButton.d.ts +1 -1
- package/types/src/command/LocaleCommandButton.d.ts +1 -1
- package/types/src/command/index.d.ts +1 -0
- package/types/src/comments/CommentCard.d.ts +2 -2
- package/types/src/conditionalFormat/IconPickerPopupButton.d.ts +1 -1
- package/types/src/conditions/ConditionEditor.d.ts +1 -1
- package/types/src/conditions/OperatorAndParamEditor.d.ts +1 -1
- package/types/src/conditions/OperatorSelectPopupButton.d.ts +1 -1
- package/types/src/conditions/useFormulaOption.d.ts +2 -2
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
- package/types/src/fill/PatternPopupButton.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/IFormulaBar.d.ts +4 -2
- 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/itemsPanel/ItemsPanel.d.ts +5 -0
- package/types/src/named/NamedDetailsPanel.d.ts +2 -2
- 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/statusBar/PendingStatus.d.ts +19 -0
- package/types/src/statusBar/index.d.ts +1 -0
- package/types/src/studio/StudioProps.d.ts +10 -10
- package/types/src/template/TemplatePanel.d.ts +5 -1
- package/types/src/theme/ThemeSelectPopupButton.d.ts +1 -1
- package/types/src/toolbar/WorkbookToolbars.d.ts +1 -1
- package/types/src/workbook/DefaultRenderers.d.ts +31 -19
- package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
- package/types/src/workbook/WorkbookElement.d.ts +5 -4
- package/types/src/workbook/WorkbookStrip.d.ts +8 -7
- package/types/src/workbook/index.d.ts +1 -1
- package/browser/esm/Biy7bhzzzPb5sfRN.mjs +0 -152
- package/browser/esm/COv-m-c2byCgvU3M.mjs +0 -14861
- package/browser/esm/CtEFHbzYNvYjDYvi.mjs +0 -236
- package/browser/esm/Die9NXVFveHvcCT-.mjs +0 -4205
- package/browser/esm/sam1KGQZ59B_fADz.mjs +0 -1941
- package/node/esm/BYVLi0md4AYuDsB_.mjs +0 -236
- package/node/esm/BYwXhrEwkRAt9nJS.mjs +0 -71
- package/node/esm/Cmt8Wv806N7NmE4Y.mjs +0 -3344
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.12
|
|
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 { t as e } from "./u84rSnESjxqB6gay.mjs";
|
|
8
|
+
import { IFill as t, Table as n } from "@sheetxl/sdk";
|
|
9
|
+
import { StaticBorderRenderer as r, useGridColorScheme as i } from "@sheetxl/react";
|
|
10
|
+
import { CommandButtonType as a, useCallbackRef as o, useCommands as s, useTranslator as c } from "@sheetxl/utils-react";
|
|
11
|
+
import { forwardRef as l, memo as u, useCallback as d, useEffect as f, useLayoutEffect as p, useMemo as m, useReducer as h, useRef as g, useState as _ } from "react";
|
|
12
|
+
import { CommandButton as v, CommandPopupButton as y, ContextMenu as b, ExhibitDivider as x, ExhibitIconButton as S, ExhibitMenuHeader as C, ExhibitTooltip as w, defaultRenderPopupPanel as T } from "@sheetxl/utils-mui";
|
|
13
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
14
|
+
import { Box as k } from "@mui/material";
|
|
15
|
+
var A = "_sheetxl-reset_11z3j_1", j = 10, M = u(l((t, a) => {
|
|
16
|
+
let { styles: o, table: s, tableStyle: c = s?.getStyle() ?? o.getTableStyles().getDefault(), sx: l, disabled: u, className: p, forceThinBorder: g, cellHeight: _ = j, isLive: v = !1, ...y } = t, b = i(), x = b === "dark", S = Math.ceil(1.3 * _), [C, w] = h((e) => e + 1, 0);
|
|
17
|
+
f(() => {
|
|
18
|
+
if (v && s) return s.addListeners({ onAnyChange: () => {
|
|
19
|
+
w();
|
|
20
|
+
} });
|
|
21
|
+
}, [s, v]);
|
|
22
|
+
let T = m(() => {
|
|
23
|
+
let e = s?.toJSON() ?? {}, t = {
|
|
24
|
+
width: 5,
|
|
25
|
+
height: 5
|
|
26
|
+
};
|
|
27
|
+
return e && (e.style = {
|
|
28
|
+
...e.style,
|
|
29
|
+
name: c.getName()
|
|
30
|
+
}), new n({
|
|
31
|
+
size: t,
|
|
32
|
+
json: e,
|
|
33
|
+
styles: o
|
|
34
|
+
});
|
|
35
|
+
}, [
|
|
36
|
+
C,
|
|
37
|
+
s,
|
|
38
|
+
c,
|
|
39
|
+
o
|
|
40
|
+
]), E = m(() => {
|
|
41
|
+
let e = [];
|
|
42
|
+
for (let t = 0; t < 5; t++) for (let n = 0; n < 5; n++) {
|
|
43
|
+
let r = T.getStyleAt({
|
|
44
|
+
colIndex: n,
|
|
45
|
+
rowIndex: t
|
|
46
|
+
});
|
|
47
|
+
e.push(r);
|
|
48
|
+
}
|
|
49
|
+
return e;
|
|
50
|
+
}, [T]), M = m(() => {
|
|
51
|
+
let e = T.isHiddenButtons() || !T.isShowHeaders(), t = (t, n, r) => {
|
|
52
|
+
let i = !e && t === 0, a = r.getFill().toCSS(x), o = S - +(n < 4), s = _ - +(t < 4), c = r.getFont().getColor().toCSS(x);
|
|
53
|
+
a = {
|
|
54
|
+
...a,
|
|
55
|
+
position: "absolute",
|
|
56
|
+
display: "flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: i ? "space-evenly" : "center",
|
|
59
|
+
boxSizing: "border-box",
|
|
60
|
+
left: n * (S - 1),
|
|
61
|
+
top: t * (_ - 1),
|
|
62
|
+
width: o,
|
|
63
|
+
height: s
|
|
64
|
+
};
|
|
65
|
+
let l = null;
|
|
66
|
+
return i && (l = D("svg", {
|
|
67
|
+
width: "15",
|
|
68
|
+
height: "15",
|
|
69
|
+
viewBox: "0 0 15 15",
|
|
70
|
+
style: { fill: c },
|
|
71
|
+
children: D("path", { d: "M 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673" })
|
|
72
|
+
})), O("td", {
|
|
73
|
+
className: `table-style-fill ${t}-${n}`,
|
|
74
|
+
style: a,
|
|
75
|
+
children: [D("div", {
|
|
76
|
+
className: `table-style-text ${t}-${n}`,
|
|
77
|
+
style: {
|
|
78
|
+
boxSizing: "border-box",
|
|
79
|
+
width: "6px",
|
|
80
|
+
borderTop: `1px solid ${c}`
|
|
81
|
+
}
|
|
82
|
+
}), l]
|
|
83
|
+
}, `${t}-${n}`);
|
|
84
|
+
}, n = [];
|
|
85
|
+
for (let e = 0; e < 5; e++) {
|
|
86
|
+
let r = [];
|
|
87
|
+
for (let n = 0; n < 5; n++) {
|
|
88
|
+
let i = E[5 * e + n];
|
|
89
|
+
r.push(t(e, n, i));
|
|
90
|
+
}
|
|
91
|
+
n.push(D("tr", { children: r }, e));
|
|
92
|
+
}
|
|
93
|
+
return n;
|
|
94
|
+
}, [
|
|
95
|
+
T,
|
|
96
|
+
c,
|
|
97
|
+
x,
|
|
98
|
+
T.isHiddenButtons()
|
|
99
|
+
]), N = d((e, t) => E[t].getBorders() ?? null, [E]);
|
|
100
|
+
return D(k, {
|
|
101
|
+
ref: a,
|
|
102
|
+
className: "table-format-preview",
|
|
103
|
+
"data-sxl-theme-surface": "grid",
|
|
104
|
+
"data-sxl-theme-mode": b,
|
|
105
|
+
sx: {
|
|
106
|
+
background: "var(--sxl-color-base-100)",
|
|
107
|
+
filter: u ? "grayscale(0.4) opacity(0.8);" : "none",
|
|
108
|
+
"& .styled-element": { position: "absolute" },
|
|
109
|
+
...l
|
|
110
|
+
},
|
|
111
|
+
...y,
|
|
112
|
+
children: D(r, {
|
|
113
|
+
getBorderAt: N,
|
|
114
|
+
rowCount: 5,
|
|
115
|
+
columnCount: 5,
|
|
116
|
+
forceThinBorder: g,
|
|
117
|
+
width: 5 * (S - 1) + 1,
|
|
118
|
+
height: 5 * (_ - 1) + 1,
|
|
119
|
+
style: { pointerEvents: "none" },
|
|
120
|
+
children: D("table", {
|
|
121
|
+
className: e(p, "sheetxl-table-preview", A),
|
|
122
|
+
style: {
|
|
123
|
+
borderCollapse: "collapse",
|
|
124
|
+
width: 5 * (S - 1) + 1,
|
|
125
|
+
height: 5 * (_ - 1) + 1
|
|
126
|
+
},
|
|
127
|
+
children: D("tbody", { children: M })
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
})), N = (e, t, n, r, i) => {
|
|
132
|
+
e.beginPath(), e.moveTo(t + .5, n + .5), e.lineTo(r + .5, i + .5), e.stroke();
|
|
133
|
+
}, P = /* @__PURE__ */ new WeakMap(), F = u(l((r, a) => {
|
|
134
|
+
let { table: o, tableStyle: s, styles: c, disabled: l, style: u, className: f, canvas: h, ...g } = r, v = i(), y = v === "dark", [b, x] = _(null), [S, C] = _(void 0), w = d((e) => {
|
|
135
|
+
x(e), typeof a == "function" ? a(e) : a && (a.current = e);
|
|
136
|
+
}, [a]);
|
|
137
|
+
p(() => {
|
|
138
|
+
b && C(getComputedStyle(b).getPropertyValue("--sxl-color-base-100").trim() || "#ffffff");
|
|
139
|
+
}, [b, v]);
|
|
140
|
+
let T = m(() => {
|
|
141
|
+
if (S === void 0) return null;
|
|
142
|
+
let e = o.toJSON();
|
|
143
|
+
if (!e) return null;
|
|
144
|
+
e.style = {
|
|
145
|
+
...e.style,
|
|
146
|
+
name: s.getName()
|
|
147
|
+
};
|
|
148
|
+
let r = S, i = c?.getTheme(), a = `${JSON.stringify(e.style)}|h${e.headerRowCount ?? 0}|t${e.totalsRowCount ?? 0}|${y ? "dark" : "light"}|${r}` + (s.isBuiltIn() ? "" : `|${JSON.stringify(s.toJSON())}`), l = i ? P.get(i) : void 0, u = l?.get(a);
|
|
149
|
+
if (u) return u;
|
|
150
|
+
let d = new n({
|
|
151
|
+
size: {
|
|
152
|
+
width: 5,
|
|
153
|
+
height: 5
|
|
154
|
+
},
|
|
155
|
+
json: e,
|
|
156
|
+
styles: c
|
|
157
|
+
}), f = [];
|
|
158
|
+
for (let e = 0; e < 5; e++) for (let t = 0; t < 5; t++) f.push(d.getStyleAt({
|
|
159
|
+
colIndex: t,
|
|
160
|
+
rowIndex: e
|
|
161
|
+
}));
|
|
162
|
+
let p = h;
|
|
163
|
+
if (h || (p = document.createElement("canvas")), !p) return null;
|
|
164
|
+
p.width !== 61 && (p.width = 61), p.height !== 46 && (p.height = 46);
|
|
165
|
+
let m = p.getContext("2d", {
|
|
166
|
+
alpha: !1,
|
|
167
|
+
willReadFrequently: !0
|
|
168
|
+
});
|
|
169
|
+
if (!m) return null;
|
|
170
|
+
for (let e = 0; e < 5; e++) for (let n = 0; n < 5; n++) {
|
|
171
|
+
let i = f[5 * e + n].getFill(), a = r;
|
|
172
|
+
i.getType() === t.Type.Solid ? a = i.getColor().toRGBA(y).toString() : i.getType() === t.Type.Gradient ? a = i.getStops()[0]?.getColor().toRGBA(y).toString() : i.getType() === t.Type.Pattern && (a = i.getForeground().toRGBA(y).toString()), m.fillStyle = a ?? r;
|
|
173
|
+
let o = n * 12, s = 9 * e;
|
|
174
|
+
m.fillRect(o, s, 13, 10);
|
|
175
|
+
}
|
|
176
|
+
m.lineWidth = 1;
|
|
177
|
+
for (let e = 0; e < 5; e++) for (let t = 0; t < 5; t++) {
|
|
178
|
+
let n = f[5 * e + t], r = t * 12, i = 9 * e, a = n.getBorders();
|
|
179
|
+
if (!a.isEmpty()) {
|
|
180
|
+
let t = a.getLeft();
|
|
181
|
+
t.isNone() || (m.strokeStyle = t.getColor().toRGBA(y).toString(), N(m, r, i, r, i + 9));
|
|
182
|
+
let n = a.getTop();
|
|
183
|
+
n.isNone() || (m.strokeStyle = n.getColor().toRGBA(y).toString(), N(m, r, i, r + 12, 9 * e));
|
|
184
|
+
let o = a.getRight();
|
|
185
|
+
o.isNone() || (m.strokeStyle = o.getColor().toRGBA(y).toString(), N(m, r + 12, i, r + 12, i + 9));
|
|
186
|
+
let s = a.getBottom();
|
|
187
|
+
s.isNone() || (m.strokeStyle = s.getColor().toRGBA(y).toString(), N(m, r, i + 9, r + 12, i + 9));
|
|
188
|
+
}
|
|
189
|
+
m.strokeStyle = n.getFont().getColor().toRGBA(y).toString();
|
|
190
|
+
let o = 2.5;
|
|
191
|
+
N(m, t * 12 + o, 9 * e + 4, t * 12 + o + 7, 9 * e + 4);
|
|
192
|
+
}
|
|
193
|
+
let g = `url(${p.toDataURL()})`;
|
|
194
|
+
return i && (l || (l = /* @__PURE__ */ new Map(), P.set(i, l)), l.set(a, g)), g;
|
|
195
|
+
}, [
|
|
196
|
+
h,
|
|
197
|
+
o,
|
|
198
|
+
s,
|
|
199
|
+
c,
|
|
200
|
+
y,
|
|
201
|
+
S
|
|
202
|
+
]);
|
|
203
|
+
return D("div", {
|
|
204
|
+
ref: w,
|
|
205
|
+
"data-sxl-theme-surface": "grid",
|
|
206
|
+
"data-sxl-theme-mode": v,
|
|
207
|
+
className: e("table-style-preview", f),
|
|
208
|
+
style: {
|
|
209
|
+
backgroundImage: T ?? void 0,
|
|
210
|
+
width: 61,
|
|
211
|
+
height: 46,
|
|
212
|
+
...u
|
|
213
|
+
},
|
|
214
|
+
...g
|
|
215
|
+
});
|
|
216
|
+
})), I = u((e) => {
|
|
217
|
+
let { table: t, tableStyle: n, selectedTableStyleName: r, onSelectTableStyleName: i, styles: o, hasContextMenu: s = !0, disabled: l, useCanvasPreview: u = !0, canvas: f, ...p } = e, h = c(), g = d((e) => {
|
|
218
|
+
let t = {
|
|
219
|
+
variant: a.Menuitem,
|
|
220
|
+
groupKey: "tableStyleOptions"
|
|
221
|
+
}, r = O(E, { children: [
|
|
222
|
+
D(v, {
|
|
223
|
+
...t,
|
|
224
|
+
commandKey: "formatTableStyleClearCellStyles",
|
|
225
|
+
commandState: n,
|
|
226
|
+
disabled: l
|
|
227
|
+
}),
|
|
228
|
+
D(v, {
|
|
229
|
+
...t,
|
|
230
|
+
style: { fontWeight: 550 },
|
|
231
|
+
commandKey: "formatTableStyle",
|
|
232
|
+
commandState: { name: n.getName() },
|
|
233
|
+
disabled: l
|
|
234
|
+
}),
|
|
235
|
+
D(x, { orientation: "horizontal" }),
|
|
236
|
+
D(v, {
|
|
237
|
+
...t,
|
|
238
|
+
commandKey: "setDefaultTableStyle",
|
|
239
|
+
commandState: n.getName(),
|
|
240
|
+
disabled: l
|
|
241
|
+
}),
|
|
242
|
+
D(x, { orientation: "horizontal" }),
|
|
243
|
+
D(v, {
|
|
244
|
+
...t,
|
|
245
|
+
commandKey: "deleteTableStyle",
|
|
246
|
+
commandState: n?.getName(),
|
|
247
|
+
disabled: l || !n || n.isBuiltIn()
|
|
248
|
+
})
|
|
249
|
+
] });
|
|
250
|
+
return T({
|
|
251
|
+
...e,
|
|
252
|
+
children: D(k, {
|
|
253
|
+
sx: {
|
|
254
|
+
display: "flex",
|
|
255
|
+
flexDirection: "column",
|
|
256
|
+
flex: "1 1 100%",
|
|
257
|
+
overflow: "hidden"
|
|
258
|
+
},
|
|
259
|
+
children: D(k, {
|
|
260
|
+
sx: {
|
|
261
|
+
overflow: "auto",
|
|
262
|
+
flex: "1 1 100%"
|
|
263
|
+
},
|
|
264
|
+
children: r
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
});
|
|
268
|
+
}, []), _ = n?.getName() === r, y = m(() => {
|
|
269
|
+
let e = {
|
|
270
|
+
table: t,
|
|
271
|
+
tableStyle: n,
|
|
272
|
+
styles: o
|
|
273
|
+
};
|
|
274
|
+
return u ? D(F, {
|
|
275
|
+
canvas: f,
|
|
276
|
+
...e
|
|
277
|
+
}) : D(M, { ...e });
|
|
278
|
+
}, [
|
|
279
|
+
t,
|
|
280
|
+
n,
|
|
281
|
+
o
|
|
282
|
+
]), C = D(S, {
|
|
283
|
+
sx: {
|
|
284
|
+
borderRadius: "2px",
|
|
285
|
+
padding: "2px",
|
|
286
|
+
margin: "0px 0px",
|
|
287
|
+
display: "flex",
|
|
288
|
+
border: (e) => `solid ${_ ? e.palette.primary.dark : "transparent"} 1px`
|
|
289
|
+
},
|
|
290
|
+
propsTooltip: {
|
|
291
|
+
label: n.getName() ?? h("tableStyle.none"),
|
|
292
|
+
placement: "bottom-start"
|
|
293
|
+
},
|
|
294
|
+
disabled: l,
|
|
295
|
+
icon: null,
|
|
296
|
+
onClick: () => {
|
|
297
|
+
i?.(n?.getName());
|
|
298
|
+
},
|
|
299
|
+
...p,
|
|
300
|
+
children: y
|
|
301
|
+
}, n.getName());
|
|
302
|
+
return s && (C = D(b, {
|
|
303
|
+
label: t.getStyleOptions().name,
|
|
304
|
+
renderPopupPanel: g,
|
|
305
|
+
children: C
|
|
306
|
+
})), C;
|
|
307
|
+
}), L = u(l((e, t) => {
|
|
308
|
+
let { commandKey: r, selectedTable: i, onSelectTableStyleName: l, disabled: u, disabledQuickKey: p = !1, usePreviewIcon: h = !1, groupKey: b, ...S } = e, T = c(), A = s([r])[0], j = A?.getContext(), M = j?.styles, N = M?.(), P = i ?? j?.table?.() ?? null, F = "insertTable";
|
|
309
|
+
P && (F = "editTable");
|
|
310
|
+
let L = m(() => ((e, t) => new n({
|
|
311
|
+
size: {
|
|
312
|
+
width: 5,
|
|
313
|
+
height: 5
|
|
314
|
+
},
|
|
315
|
+
styles: t,
|
|
316
|
+
json: {
|
|
317
|
+
name: "PreviewTable",
|
|
318
|
+
description: "PreviewTable",
|
|
319
|
+
headerRowCount: 1,
|
|
320
|
+
totalsRowCount: 0,
|
|
321
|
+
style: e
|
|
322
|
+
}
|
|
323
|
+
}))(P?.getStyleOptions(), N), [N?.getTableStyles().getDefault(), P?.getStyleOptions()]), R = P ?? L, [z, B] = _(R);
|
|
324
|
+
f(() => {
|
|
325
|
+
B(R);
|
|
326
|
+
}, [R]);
|
|
327
|
+
let V = o((e) => {
|
|
328
|
+
l?.(e), A?.execute({ name: e });
|
|
329
|
+
}, [A, l]), H = g(null), U = d((e) => {
|
|
330
|
+
let t = {
|
|
331
|
+
onSelectTableStyleName: V,
|
|
332
|
+
styles: N
|
|
333
|
+
};
|
|
334
|
+
H.current ||= document.createElement("canvas");
|
|
335
|
+
let n = (e) => {
|
|
336
|
+
if (!e) return null;
|
|
337
|
+
let n = N?.getTableStyles().getByName(e);
|
|
338
|
+
return n ? D(I, {
|
|
339
|
+
table: z,
|
|
340
|
+
tableStyle: n,
|
|
341
|
+
selectedTableStyleName: z.getStyleOptions().name,
|
|
342
|
+
canvas: H.current,
|
|
343
|
+
...t
|
|
344
|
+
}, e) : null;
|
|
345
|
+
}, r = (e, t, r = !0) => {
|
|
346
|
+
let i = [];
|
|
347
|
+
for (let e = 0; e < t.length; e++) {
|
|
348
|
+
let r = n(t[e]);
|
|
349
|
+
r && i.push(r);
|
|
350
|
+
}
|
|
351
|
+
return i.length === 0 ? null : O(k, { children: [
|
|
352
|
+
r ? D(x, { orientation: "horizontal" }) : null,
|
|
353
|
+
D(C, { children: e }, e + "-header"),
|
|
354
|
+
D(k, {
|
|
355
|
+
sx: {
|
|
356
|
+
display: "flex",
|
|
357
|
+
gap: "2px",
|
|
358
|
+
marginBottom: "6px",
|
|
359
|
+
flexWrap: "wrap",
|
|
360
|
+
width: "481px",
|
|
361
|
+
maxWidth: "100%"
|
|
362
|
+
},
|
|
363
|
+
children: i
|
|
364
|
+
}, e + "-presets")
|
|
365
|
+
] }, e);
|
|
366
|
+
}, i = [], o = N?.getTableStyles().getItems({ type: "custom" }), s = [], c = o ? o.length : 0;
|
|
367
|
+
if (c > 0) {
|
|
368
|
+
for (let e = 0; e < c; e++) {
|
|
369
|
+
let t = o[e];
|
|
370
|
+
t.isShownInTableStyles() && s.push(t.getName());
|
|
371
|
+
}
|
|
372
|
+
i.push(r(T("tableStyle.category.custom"), s, !1));
|
|
373
|
+
}
|
|
374
|
+
let l = [];
|
|
375
|
+
P && !P.getStyleOptions().name && l.push(null);
|
|
376
|
+
for (let e = 0; e < 21; e++) l.push("TableStyleLight" + (e + 1));
|
|
377
|
+
i.push(r(T("tableStyle.category.light"), l, s.length > 0));
|
|
378
|
+
let d = [];
|
|
379
|
+
for (let e = 0; e < 28; e++) d.push("TableStyleMedium" + (e + 1));
|
|
380
|
+
i.push(r(T("tableStyle.category.medium"), d));
|
|
381
|
+
let f = [];
|
|
382
|
+
for (let e = 0; e < 11; e++) f.push("TableStyleDark" + (e + 1));
|
|
383
|
+
i.push(r(T("tableStyle.category.dark"), f));
|
|
384
|
+
let p = null;
|
|
385
|
+
return P && (p = O(E, { children: [D(x, { orientation: "horizontal" }), D(v, {
|
|
386
|
+
variant: a.Menuitem,
|
|
387
|
+
commandKey: "formatTableStyleClearTableStyle",
|
|
388
|
+
disabled: u
|
|
389
|
+
})] })), O(k, {
|
|
390
|
+
sx: {
|
|
391
|
+
display: "flex",
|
|
392
|
+
flexDirection: "column",
|
|
393
|
+
maxWidth: "100%",
|
|
394
|
+
paddingTop: (e) => `${e.shape.borderRadius}px`,
|
|
395
|
+
paddingBottom: (e) => `${e.shape.borderRadius}px`
|
|
396
|
+
},
|
|
397
|
+
children: [D(k, {
|
|
398
|
+
onContextMenu: () => {},
|
|
399
|
+
sx: {
|
|
400
|
+
display: "flex",
|
|
401
|
+
flexDirection: "column",
|
|
402
|
+
padding: "6px 16px"
|
|
403
|
+
},
|
|
404
|
+
children: i
|
|
405
|
+
}), p]
|
|
406
|
+
});
|
|
407
|
+
}, [
|
|
408
|
+
N,
|
|
409
|
+
N?.getTheme(),
|
|
410
|
+
z,
|
|
411
|
+
T
|
|
412
|
+
]), W = u ?? (!A || A.disabled()), G = m(() => {
|
|
413
|
+
if (!j || !h) return A?.getIcon();
|
|
414
|
+
}, [
|
|
415
|
+
z,
|
|
416
|
+
W,
|
|
417
|
+
A
|
|
418
|
+
]);
|
|
419
|
+
return D(y, {
|
|
420
|
+
ref: t,
|
|
421
|
+
quickCommand: p ? void 0 : F,
|
|
422
|
+
renderPopupPanel: U,
|
|
423
|
+
label: A?.getLabel(b),
|
|
424
|
+
groupKey: b,
|
|
425
|
+
commandState: P,
|
|
426
|
+
renderTooltip: ({ children: e, disabled: t }) => D(w, {
|
|
427
|
+
label: A?.getLabel(),
|
|
428
|
+
description: A?.getDescription(),
|
|
429
|
+
disabled: t,
|
|
430
|
+
children: e
|
|
431
|
+
}),
|
|
432
|
+
disabled: W,
|
|
433
|
+
icon: G,
|
|
434
|
+
...S
|
|
435
|
+
});
|
|
436
|
+
}));
|
|
437
|
+
export { F as n, M as r, L as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
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.12
|
|
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 { c as e, t } from "./
|
|
8
|
-
import { t as n } from "./
|
|
7
|
+
import { c as e, t } from "./BpJsBv413cNQpyg0.mjs";
|
|
8
|
+
import { t as n } from "./CFIAWgpU3UyepLBn.mjs";
|
|
9
9
|
import { IFill as r, ShapeStyleUtils as i } from "@sheetxl/sdk";
|
|
10
10
|
import { useGridColorScheme as a } from "@sheetxl/react";
|
|
11
11
|
import { useTranslator as o } from "@sheetxl/utils-react";
|