@sheetxl/studio-mui 0.8.0-beta.10 → 0.8.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/esm/0BWO0bLZ8Vm_dKd2.mjs +582 -0
- package/browser/esm/BAbq4-I5f5oUiNaF.mjs +141 -0
- package/browser/esm/BED6h6YAwCf1HEQJ.mjs +161 -0
- package/browser/esm/{CEvZe2cZK-voZTif.mjs → BXhNFzyEGokTF-BL.mjs} +5 -5
- package/browser/esm/BYE9gCDWKyx6mnVs.mjs +381 -0
- package/browser/esm/{DBtc4lku0uHVcqWn.mjs → BjvD_4t2KGsZP5V8.mjs} +3 -3
- package/browser/esm/{DU3J8Gcf-WpBxNYg.mjs → BknfGJouygmnpFIU.mjs} +4 -4
- package/browser/esm/{D8al_cJ4U-NgzwoK.mjs → BlE_8o8tO2AgAlaj.mjs} +19 -17
- package/browser/esm/BokqKEpU6TFgfRs6.mjs +252 -0
- package/browser/esm/{DHY19rkSiiRZxShC.mjs → Brsh5yscJ_4uKFXp.mjs} +3 -3
- package/browser/esm/Bujtz_Guj88d03vI.mjs +831 -0
- package/browser/esm/Buqcl7J75MJrhpVE.mjs +1379 -0
- package/browser/esm/BvhYPwX3GrRaO9CM.mjs +319 -0
- package/browser/esm/C0wlMAIn9iREPK6w.mjs +87 -0
- package/browser/esm/C8JU4KsMasmLvojI.mjs +103 -0
- package/browser/esm/{CjznclrKqJRi7u9O.mjs → C9pIZVACtl9unFOp.mjs} +2 -2
- package/browser/esm/CBD4RiRKbbZtSXV-.mjs +318 -0
- package/browser/esm/{Blaj2R5hYxtLAW__.mjs → CEtXsBzEjEKk9GOj.mjs} +6 -6
- package/browser/esm/{CIu1bjPJe_x31Oww.mjs → COlZu93LRwuBvjE-.mjs} +3 -3
- package/browser/esm/{CoSiOS-og0zFw4Ws.mjs → CTjqDD-swFMZzI-Y.mjs} +2 -2
- package/browser/esm/CWkOgdL7mOKiTR62.mjs +975 -0
- package/browser/esm/ChSVxkPTIjgcC8PL.mjs +412 -0
- package/browser/esm/{5cbK03T_Oh3tNdR7.mjs → ClBvNPeNCAhuVWrG.mjs} +1 -1
- package/browser/esm/CyLn6zOOp_biA3xU.mjs +335 -0
- package/browser/esm/CynTY0oNtyJnoaBq.mjs +14 -0
- package/browser/esm/{xKiLJKiLxto8SayF.mjs → D3rRUK4dIM5gUSmj.mjs} +2 -2
- package/browser/esm/D9ISy7VkaRRFJl46.mjs +515 -0
- package/browser/esm/{fb126BNj3F8URR19.mjs → DDc6rDuU9JAo1DH_.mjs} +3 -3
- package/browser/esm/DDczwkXhz_MHub4z.mjs +197 -0
- package/browser/esm/{X1Db3b_7b_7OuCk6.mjs → DEv4pIEgYr5C7etm.mjs} +1 -1
- package/browser/esm/DG21x7RKDpge6zAE.mjs +31 -0
- package/browser/esm/DJOOed_OtB-XT7f3.mjs +437 -0
- package/browser/esm/{9eKCkvqpMQwqcXiw.mjs → DKtJxrpN0axtuQ0l.mjs} +1 -1
- package/browser/esm/DRSCS6aLiYmPjUz1.mjs +1543 -0
- package/browser/esm/{ByeL_BZuJ2kl8gtf.mjs → DTpRkgsTm_zYnWfW.mjs} +1 -1
- package/browser/esm/DV6i9RQZfJiKtEaJ.mjs +2552 -0
- package/browser/esm/DdcZrjMLWVukWcU5.mjs +7473 -0
- package/browser/esm/Di3BUxA0SqFWWgeg.mjs +94 -0
- package/browser/esm/DnGaP5F7mLwCGUYG.mjs +408 -0
- package/browser/esm/DpD4fg2WcyiKX_2K.mjs +414 -0
- package/browser/esm/{C1Rp2hZrApo5MUc8.mjs → Ds3XRkne7HxcXD8J.mjs} +2 -2
- package/browser/esm/{sFOAxZpxXo-qvDSp.mjs → DsoNMWDwHZP8UXQd.mjs} +1 -1
- package/browser/esm/G0Inqm6Eqw47dMpa.mjs +212 -0
- package/browser/esm/{B1Yp_uy1vFHcJB3U.mjs → HViD4Wfoi0mmqk9w.mjs} +1 -1
- package/browser/esm/LZoYSQAYV2wksnDv.mjs +386 -0
- package/browser/esm/{CtEFHbzYNvYjDYvi.mjs → QgaAIDUMmBQBsXP9.mjs} +8 -8
- package/browser/esm/{D6S8kVTzOjCn0-SK.mjs → YThnrg3PadGs7B4j.mjs} +51 -51
- package/browser/esm/index.mjs +1028 -170
- package/browser/esm/ttjcNHcFn8O6hfnd.mjs +1288 -0
- package/browser/esm/{yZxC4qUENOlMhVUH.mjs → w_JrR69vEpvoyeMy.mjs} +1 -1
- package/browser/esm/{DmCQbW4zwkT_Rq88.mjs → xFqkfN8QMCxvsetB.mjs} +1 -1
- package/browser/esm/{IQLeaAbtGTipUsOD.mjs → zqilJefihVd7At2T.mjs} +22 -21
- package/licenses/dependencies.txt +94 -94
- package/node/esm/{BYsG3KYVmxSe_CIQ.mjs → 1bf4gn-2vld4BZ9u.mjs} +1 -1
- package/node/esm/{CKu1AtRgyltyEdEN.mjs → 3WghtBXAvCDwcVrq.mjs} +1 -1
- package/node/esm/{cqzp431iNSLWictb.mjs → 4HmLH0bPVJCZLgik.mjs} +22 -22
- package/node/esm/{BYVLi0md4AYuDsB_.mjs → B0bdb_6p7fQI_ivo.mjs} +28 -28
- package/node/esm/BIMkjQUwG4Ih-6Sh.mjs +142 -0
- package/node/esm/BNg4QQY0WAPLE0q7.mjs +141 -0
- package/node/esm/BPzcW4BejRqso338.mjs +72 -0
- package/node/esm/BR45ogAR-hY2bE60.mjs +318 -0
- package/node/esm/BlN7G0DVC24zauig.mjs +197 -0
- package/node/esm/{ah3CUg4-VmNstGk_.mjs → Bph-sR3l6AYWeuxK.mjs} +2 -2
- package/node/esm/CPq-MIdEnc-53JpF.mjs +319 -0
- package/node/esm/CSAnTp5rwId0DUb8.mjs +380 -0
- package/node/esm/CWcv7UVXF8IUB0PC.mjs +1379 -0
- package/node/esm/{D9rzScOA9pEYFrtz.mjs → CYIoK22I6Yvv12_x.mjs} +20 -20
- package/node/esm/CZyA9uD4SkTvqp_G.mjs +1283 -0
- package/node/esm/{ci8d-mF1H9wnYzix.mjs → CjC6s3RUJQNCF7mP.mjs} +1 -1
- package/node/esm/{D6oQL8knsPpgdXuk.mjs → CuMePia6i_8yfJ6S.mjs} +9 -9
- package/node/esm/CvRbu8JPxFarsSR-.mjs +412 -0
- package/node/esm/{DNSjK5DAH3M14Qbc.mjs → CyafafEgfmjLqE5O.mjs} +1 -1
- package/node/esm/D-xqQ5qOSd6WrzwJ.mjs +94 -0
- package/node/esm/DLqBHdFp6wvm6EGs.mjs +212 -0
- package/node/esm/{BcwMb6CyVfvEwbHn.mjs → DMXLxp3T0E0SRTQc.mjs} +1 -1
- package/node/esm/{DZzvTQxIKr9LbEsA.mjs → DWqvf4H5F2wMnZ0L.mjs} +32 -30
- package/node/esm/DatM6eEYPpAtIMy-.mjs +405 -0
- package/node/esm/Db3dbaYLKUO66T9s.mjs +1689 -0
- package/node/esm/{B_jRGdwGFkudwmL-.mjs → DdEzhVqYTrGODXrz.mjs} +1 -1
- package/node/esm/DeZJlLk8WJ3BLtLs.mjs +975 -0
- package/node/esm/DfCuL8AUxMFoEG2s.mjs +519 -0
- package/node/esm/{Bb1sLMqXWKjdve23.mjs → Do-zCKziWhoG5eAv.mjs} +2 -2
- package/node/esm/{B8SQfjKjzYHLxzZR.mjs → DpJ2gmZJioCyq8La.mjs} +67 -67
- package/node/esm/{ETK6T6G0SIcFXDe5.mjs → XEDcegsv5AGKBfu2.mjs} +40 -40
- package/node/esm/index.mjs +8941 -13558
- package/node/esm/yCUxQuqVuC4DHKPx.mjs +385 -0
- package/node/esm/zITjZ7R4raDqhP-n.mjs +515 -0
- package/package.json +9 -9
- package/resources/locales/de/ui.msg.json +97 -0
- package/resources/locales/en/ui.msg.json +97 -0
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +4 -4
- package/types/src/anomalies/AnomaliesPlugin.d.ts +5 -0
- package/types/src/anomalies/AnomaliesTaskPane.d.ts +17 -0
- package/types/src/anomalies/index.d.ts +3 -0
- package/types/src/border/BorderTemplateIcon.d.ts +6 -1
- package/types/src/chart/ChartFormatPanel.d.ts +20 -0
- package/types/src/chart/ChartPlugin.d.ts +6 -0
- package/types/src/chart/index.d.ts +3 -0
- package/types/src/comments/CommentCard.d.ts +2 -2
- package/types/src/conditions/useFormulaOption.d.ts +2 -2
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
- package/types/src/format/BorderPreview.d.ts +11 -4
- package/types/src/format/useFormatSelection.d.ts +4 -4
- package/types/src/formulaBar/MobileFormulaBar.d.ts +18 -6
- package/types/src/formulaBar/MobileInputToolbar.d.ts +9 -3
- package/types/src/formulaBar/useFormulaBarSession.d.ts +6 -3
- package/types/src/index.d.ts +15 -6
- package/types/src/protection/ProtectedCellsPanel.d.ts +2 -2
- package/types/src/protection/{SheetProtectionPanel.d.ts → WorksheetProtectionPanel.d.ts} +6 -6
- package/types/src/protection/index.d.ts +1 -1
- package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +2 -2
- package/types/src/workbook/DefaultRenderers.d.ts +2 -2
- package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
- package/browser/esm/Biy7bhzzzPb5sfRN.mjs +0 -152
- package/browser/esm/COv-m-c2byCgvU3M.mjs +0 -14861
- package/browser/esm/Die9NXVFveHvcCT-.mjs +0 -4205
- package/browser/esm/sam1KGQZ59B_fADz.mjs +0 -1941
- package/node/esm/BYwXhrEwkRAt9nJS.mjs +0 -71
- package/node/esm/Cmt8Wv806N7NmE4Y.mjs +0 -3344
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.11
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { memo as t, useMemo as r, useRef as e } from "react";
|
|
8
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
9
|
+
import { Box as o } from "@mui/material";
|
|
10
|
+
import i from "clsx";
|
|
11
|
+
import { DndContext as a, MouseSensor as s, TouchSensor as l, closestCenter as c, useSensor as d, useSensors as u } from "@dnd-kit/core";
|
|
12
|
+
import { restrictToVerticalAxis as m } from "@dnd-kit/modifiers";
|
|
13
|
+
import { SortableContext as f, useSortable as g, verticalListSortingStrategy as p } from "@dnd-kit/sortable";
|
|
14
|
+
import { CSS as b, useIsomorphicLayoutEffect as y } from "@dnd-kit/utilities";
|
|
15
|
+
var x = "data-sxl-flip", v = t((t) => {
|
|
16
|
+
const { ids: o, onMove: i, scrollRef: g, children: b } = t, y = u(d(s, { activationConstraint: { distance: 6 } }), d(l, { activationConstraint: {
|
|
17
|
+
delay: 200,
|
|
18
|
+
tolerance: 6
|
|
19
|
+
} })), v = e(null), h = r(() => [m, ({ draggingNodeRect: t, transform: r }) => {
|
|
20
|
+
const e = v.current;
|
|
21
|
+
return t && e ? t.top + r.y < e.top ? {
|
|
22
|
+
...r,
|
|
23
|
+
y: e.top - t.top
|
|
24
|
+
} : t.bottom + r.y > e.bottom ? {
|
|
25
|
+
...r,
|
|
26
|
+
y: e.bottom - t.bottom
|
|
27
|
+
} : r : r;
|
|
28
|
+
}], []);
|
|
29
|
+
return n(a, {
|
|
30
|
+
sensors: y,
|
|
31
|
+
collisionDetection: c,
|
|
32
|
+
modifiers: h,
|
|
33
|
+
onDragStart: () => {
|
|
34
|
+
v.current = ((t) => {
|
|
35
|
+
if (!t) return null;
|
|
36
|
+
const r = t.querySelectorAll(`[${x}]`);
|
|
37
|
+
if (0 === r.length) return null;
|
|
38
|
+
let e = 1 / 0, n = -1 / 0;
|
|
39
|
+
for (let t = 0; t < r.length; t++) {
|
|
40
|
+
const o = r[t].getBoundingClientRect();
|
|
41
|
+
o.top < e && (e = o.top), o.bottom > n && (n = o.bottom);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
top: e,
|
|
45
|
+
bottom: n
|
|
46
|
+
};
|
|
47
|
+
})(g.current);
|
|
48
|
+
},
|
|
49
|
+
onDragCancel: () => {
|
|
50
|
+
v.current = null;
|
|
51
|
+
},
|
|
52
|
+
autoScroll: { canScroll: (t) => {
|
|
53
|
+
if (t === document.scrollingElement || t === document.documentElement || t === document.body) return !1;
|
|
54
|
+
const r = g.current;
|
|
55
|
+
return !!r && (t === r || t.contains(r));
|
|
56
|
+
} },
|
|
57
|
+
onDragEnd: (t) => {
|
|
58
|
+
v.current = null;
|
|
59
|
+
const { active: r, over: e } = t;
|
|
60
|
+
if (!e || r.id === e.id) return;
|
|
61
|
+
const n = o.indexOf(String(r.id)), a = o.indexOf(String(e.id));
|
|
62
|
+
-1 !== n && -1 !== a && n !== a && i(n, a);
|
|
63
|
+
},
|
|
64
|
+
children: n(f, {
|
|
65
|
+
items: o,
|
|
66
|
+
strategy: p,
|
|
67
|
+
children: b
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
function h(t, r, n) {
|
|
72
|
+
const o = e(/* @__PURE__ */ new Map());
|
|
73
|
+
y(() => {
|
|
74
|
+
if (!r || !t.current) return void (o.current = /* @__PURE__ */ new Map());
|
|
75
|
+
const e = o.current, i = /* @__PURE__ */ new Map(), a = [], s = t.current.querySelectorAll(`[${x}]`);
|
|
76
|
+
for (let t = 0; t < s.length; t++) {
|
|
77
|
+
const r = s[t], n = r.getAttribute(x), o = r.offsetTop;
|
|
78
|
+
i.set(n, o);
|
|
79
|
+
const l = e.get(n);
|
|
80
|
+
void 0 !== l && l !== o && a.push({
|
|
81
|
+
element: r,
|
|
82
|
+
delta: l - o
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (o.current = i, 0 !== a.length) if (n.current) n.current = !1;
|
|
86
|
+
else {
|
|
87
|
+
for (const { element: t, delta: r } of a) t.style.transition = "none", t.style.transform = `translateY(${r}px)`;
|
|
88
|
+
t.current.offsetHeight;
|
|
89
|
+
for (const { element: t } of a) t.style.transition = "transform 200ms ease", t.style.transform = "", t.addEventListener("transitionend", function r() {
|
|
90
|
+
t.style.transition = "", t.removeEventListener("transitionend", r);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
v.displayName = "SortableCards";
|
|
96
|
+
var S = t((t) => {
|
|
97
|
+
const { id: e, disabled: a, children: s } = t, { setNodeRef: l, transform: c, transition: d, isDragging: u, listeners: m } = g({
|
|
98
|
+
id: e,
|
|
99
|
+
disabled: a
|
|
100
|
+
}), f = r(() => {
|
|
101
|
+
if (!m) return m;
|
|
102
|
+
const t = {};
|
|
103
|
+
for (const [r, e] of Object.entries(m)) t[r] = (t, ...r) => {
|
|
104
|
+
(t?.target)?.closest?.("button, input, textarea, select, a[href], [contenteditable=\"true\"], [role=\"combobox\"]") || e(t, ...r);
|
|
105
|
+
};
|
|
106
|
+
return t;
|
|
107
|
+
}, [m]);
|
|
108
|
+
return n(o, {
|
|
109
|
+
ref: l,
|
|
110
|
+
...f,
|
|
111
|
+
[x]: e,
|
|
112
|
+
className: i("sxl-sortable-card", {
|
|
113
|
+
"sxl-dragging": u,
|
|
114
|
+
"sxl-drag-disabled": a
|
|
115
|
+
}),
|
|
116
|
+
sx: {
|
|
117
|
+
flex: "0 0 auto",
|
|
118
|
+
borderRadius: (t) => t.spacing(1.25),
|
|
119
|
+
boxShadow: u ? 6 : void 0,
|
|
120
|
+
...a ? null : {
|
|
121
|
+
cursor: u ? "grabbing" : "grab",
|
|
122
|
+
"&:active": { cursor: "grabbing" }
|
|
123
|
+
},
|
|
124
|
+
...u ? {
|
|
125
|
+
"& *": { cursor: "grabbing !important" },
|
|
126
|
+
backgroundColor: (t) => t.palette.background.paper
|
|
127
|
+
} : null
|
|
128
|
+
},
|
|
129
|
+
style: {
|
|
130
|
+
transform: b.Translate.toString(c),
|
|
131
|
+
transition: d,
|
|
132
|
+
touchAction: "manipulation",
|
|
133
|
+
...u ? {
|
|
134
|
+
position: "relative",
|
|
135
|
+
zIndex: 1
|
|
136
|
+
} : null
|
|
137
|
+
},
|
|
138
|
+
children: s
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
S.displayName = "SortableCard";
|
|
142
|
+
export { v as n, h as r, S as t };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.11
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { t as e } from "./CSAnTp5rwId0DUb8.mjs";
|
|
8
|
+
import { FormulaField as t, d as r } from "./index.mjs";
|
|
9
|
+
import { useModelSync as a } from "@sheetxl/react";
|
|
10
|
+
import { NotifierType as n, useNotifier as o } from "@sheetxl/utils-react";
|
|
11
|
+
import { forwardRef as s, memo as d, useCallback as l, useMemo as i, useRef as c } from "react";
|
|
12
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
13
|
+
var m = (e) => {
|
|
14
|
+
const t = (t) => e.getCollection(t.getWorksheet());
|
|
15
|
+
return {
|
|
16
|
+
key: e.key,
|
|
17
|
+
messageKeys: e.messageKeys,
|
|
18
|
+
getItems: (t) => ((t) => {
|
|
19
|
+
const r = t.getSelectedWorksheet();
|
|
20
|
+
return r ? e.getCollection(r) : null;
|
|
21
|
+
})(t)?.getItems() ?? [],
|
|
22
|
+
subscribe: (t, r) => {
|
|
23
|
+
let a = null;
|
|
24
|
+
const n = () => {
|
|
25
|
+
a?.();
|
|
26
|
+
const n = {
|
|
27
|
+
onProtectionChange: () => r.onChange(),
|
|
28
|
+
onInvalidated: () => r.onInvalidated()
|
|
29
|
+
};
|
|
30
|
+
for (const t of e.changeEvents) n[t] = () => r.onChange();
|
|
31
|
+
a = t.getSelectedWorksheet()?.addListeners(n, { transactional: !1 }) ?? null;
|
|
32
|
+
};
|
|
33
|
+
n();
|
|
34
|
+
const o = t.addListeners({ onSelectedSheetChange: () => {
|
|
35
|
+
n(), r.onChange();
|
|
36
|
+
} }, { transactional: !1 });
|
|
37
|
+
return () => {
|
|
38
|
+
a?.(), o?.();
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
isReadOnly: (t) => {
|
|
42
|
+
const r = t.getSelectedWorksheet();
|
|
43
|
+
return !r || (e.isReadOnly?.(r) ?? !r.getProtection().isObjectsAllowed());
|
|
44
|
+
},
|
|
45
|
+
isItemReadOnly: (t, r) => {
|
|
46
|
+
const a = r.getSelectedWorksheet();
|
|
47
|
+
return !a || (e.isReadOnly?.(a) ?? !a.getProtection().isObjectsAllowed()) || t.isProtected();
|
|
48
|
+
},
|
|
49
|
+
subscribeItem: (e, t) => e.addListeners({
|
|
50
|
+
onInvalidated: () => t(),
|
|
51
|
+
onProtectedChange: () => t()
|
|
52
|
+
}, { transactional: !1 }),
|
|
53
|
+
createDraft: (r, a) => {
|
|
54
|
+
const n = t(r).createItem(a);
|
|
55
|
+
return a || e.applyNewDefaults?.(n), n;
|
|
56
|
+
},
|
|
57
|
+
createSeededDraft: e.applySeed ? (r, a) => {
|
|
58
|
+
const n = t(r).createItem();
|
|
59
|
+
return e.applyNewDefaults?.(n), e.applySeed(n, a), n;
|
|
60
|
+
} : void 0,
|
|
61
|
+
beforeSave: e.beforeSave,
|
|
62
|
+
validate: e.validate,
|
|
63
|
+
save: (r, a, n) => {
|
|
64
|
+
if (null === n) t(r).add(a, { replaceExisting: !0 });
|
|
65
|
+
else {
|
|
66
|
+
e.applyUpdate(n, a);
|
|
67
|
+
const t = a.getRanges();
|
|
68
|
+
t.isInvalid() || t.toString() === n.getRanges().toString() || n.setRanges(t);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
delete: (e) => e.delete(),
|
|
72
|
+
duplicate: (e, r) => {
|
|
73
|
+
const a = t(r);
|
|
74
|
+
a.add(a.createItem(e), { index: e.getIndex() });
|
|
75
|
+
},
|
|
76
|
+
moveBy: e.reorderable ?? 1 ? (e, t) => {
|
|
77
|
+
e.setIndex(e.getIndex() + t);
|
|
78
|
+
} : void 0,
|
|
79
|
+
getCardTitle: e.getCardTitle,
|
|
80
|
+
getCardSubtitle: (e) => e.getRanges().toString(),
|
|
81
|
+
CardSubtitle: e.CardSubtitle,
|
|
82
|
+
CardMedia: e.CardMedia,
|
|
83
|
+
CardBody: e.CardBody,
|
|
84
|
+
EditorBody: ({ draft: t }) => {
|
|
85
|
+
const r = e.EditorBody;
|
|
86
|
+
return g(r, { item: t });
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}, u = d(s((t, r) => {
|
|
90
|
+
const { workbook: a, descriptor: n, args: o, dragReorder: s, ...d } = t, l = i(() => m(n), [n]);
|
|
91
|
+
return g(e, {
|
|
92
|
+
ref: r,
|
|
93
|
+
workbook: a,
|
|
94
|
+
descriptor: l,
|
|
95
|
+
args: o,
|
|
96
|
+
dragReorder: s,
|
|
97
|
+
...d
|
|
98
|
+
});
|
|
99
|
+
}));
|
|
100
|
+
u.displayName = "AnchorItemsPanel";
|
|
101
|
+
var p = d((e) => {
|
|
102
|
+
const { item: s, label: d, helperText: m } = e, u = o();
|
|
103
|
+
a(s, ["onAnchorCoordsChange", "onAnyChange"]);
|
|
104
|
+
const p = s.getRanges(), h = i(() => {
|
|
105
|
+
if (p.isInvalid()) return;
|
|
106
|
+
const e = p.at(0).getCoords();
|
|
107
|
+
return {
|
|
108
|
+
rowIndex: e.rowStart,
|
|
109
|
+
colIndex: e.colStart,
|
|
110
|
+
scope: p.at(0).getWorksheet().getName()
|
|
111
|
+
};
|
|
112
|
+
}, [p]), y = c(!1), f = l((e) => {
|
|
113
|
+
y.current = !1;
|
|
114
|
+
const t = e?.getReferences();
|
|
115
|
+
if (t && !t.isInvalid()) try {
|
|
116
|
+
s.setRanges(t);
|
|
117
|
+
} catch (e) {
|
|
118
|
+
y.current = !0, u.showMessage?.(e.message, { type: n.Error });
|
|
119
|
+
}
|
|
120
|
+
}, [s, u]), C = c(null);
|
|
121
|
+
return r(() => {
|
|
122
|
+
const e = C.current;
|
|
123
|
+
return !e || !e.dirty || !e.error && (e.commit(), !y.current);
|
|
124
|
+
}), g(t, {
|
|
125
|
+
grammar: "reference",
|
|
126
|
+
value: p,
|
|
127
|
+
allowMulti: !0,
|
|
128
|
+
allowCrossSheet: !1,
|
|
129
|
+
required: !0,
|
|
130
|
+
home: h,
|
|
131
|
+
pickAs: "absolute",
|
|
132
|
+
changeOn: "done",
|
|
133
|
+
onDone: f,
|
|
134
|
+
apiRef: C,
|
|
135
|
+
label: d,
|
|
136
|
+
helperText: m,
|
|
137
|
+
disabled: s.isProtected()
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
p.displayName = "AnchoredRangeField";
|
|
141
|
+
export { u as n, p as t };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.11
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { c as e, t } from "./BR45ogAR-hY2bE60.mjs";
|
|
8
|
+
import { t as o } from "./DfCuL8AUxMFoEG2s.mjs";
|
|
9
|
+
import { IFill as l, ShapeStyleUtils as r } from "@sheetxl/sdk";
|
|
10
|
+
import { useGridColorScheme as s } from "@sheetxl/react";
|
|
11
|
+
import { useTranslator as i } from "@sheetxl/utils-react";
|
|
12
|
+
import { memo as a, useEffect as n, useReducer as p } from "react";
|
|
13
|
+
import { jsx as m, jsxs as c } from "react/jsx-runtime";
|
|
14
|
+
import { Box as d, Typography as h } from "@mui/material";
|
|
15
|
+
var u = (e, t, o) => {
|
|
16
|
+
const s = e.toJSON();
|
|
17
|
+
let i = null;
|
|
18
|
+
try {
|
|
19
|
+
i = o.getTheme()?.toJSON() ?? null;
|
|
20
|
+
} catch {
|
|
21
|
+
i = null;
|
|
22
|
+
}
|
|
23
|
+
const a = r.resolve(s ? {
|
|
24
|
+
...s,
|
|
25
|
+
stroke: void 0
|
|
26
|
+
} : null, i, r.inheritedGroupFill(t)).stroke?.fill, n = a?.type === l.Type.Solid ? a.color : void 0;
|
|
27
|
+
return n ? o.parseColor(n) : o.getNormal().getFont().getColor();
|
|
28
|
+
}, k = (e) => m(h, {
|
|
29
|
+
variant: "subtitle2",
|
|
30
|
+
component: "div",
|
|
31
|
+
children: e.children
|
|
32
|
+
}), g = a((l) => {
|
|
33
|
+
const { movable: r, sheet: a } = l, h = i(), g = r.getContent(), [, y] = p((e) => e + 1, 0);
|
|
34
|
+
n(() => g.addListeners({ onAnyChange: y }), [g]);
|
|
35
|
+
const f = a.getStyles(), S = "dark" === s(), v = g.isReadOnly(), C = g.getStyle(), x = {
|
|
36
|
+
fill: C.getFill(),
|
|
37
|
+
styles: f,
|
|
38
|
+
schemeLookup: f.schemeLookup(),
|
|
39
|
+
darkMode: S,
|
|
40
|
+
disabled: v,
|
|
41
|
+
createCell: (e) => a.createCell(e),
|
|
42
|
+
applyFill: (e, t) => {
|
|
43
|
+
C.setFill(e, { description: t });
|
|
44
|
+
}
|
|
45
|
+
}, F = {
|
|
46
|
+
stroke: C.getStroke(),
|
|
47
|
+
stated: C.toJSON()?.stroke ?? null,
|
|
48
|
+
autoColor: u(g, r, f),
|
|
49
|
+
styles: f,
|
|
50
|
+
schemeLookup: f.schemeLookup(),
|
|
51
|
+
darkMode: S,
|
|
52
|
+
disabled: v,
|
|
53
|
+
applyStroke: (e, t) => {
|
|
54
|
+
C.setStroke(e, { description: t });
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return c(d, {
|
|
58
|
+
sx: {
|
|
59
|
+
...e,
|
|
60
|
+
gap: 2,
|
|
61
|
+
paddingTop: (e) => e.spacing(1)
|
|
62
|
+
},
|
|
63
|
+
children: [
|
|
64
|
+
m(k, { children: h("shape.pane.fill") }),
|
|
65
|
+
m(t, { selection: x }),
|
|
66
|
+
m(k, { children: h("shape.pane.line") }),
|
|
67
|
+
m(o, { selection: F })
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
g.displayName = "ShapeFormatPanel";
|
|
72
|
+
export { g as ShapeFormatPanel };
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.11
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { AutoColorPosition as e, ColorPopupButton as l, DEFAULT_GRADIENT as o, GradientEditor as r, InputField as t, PatternPopupButton as a, toGradientValue as n, toPatternSlots as i } from "./index.mjs";
|
|
8
|
+
import { Color as d, IColor as s, IFill as p } from "@sheetxl/sdk";
|
|
9
|
+
import { useCallbackRef as c, useCommands as u, useTranslator as m } from "@sheetxl/utils-react";
|
|
10
|
+
import { memo as y, useMemo as h, useRef as f } from "react";
|
|
11
|
+
import { Fragment as g, jsx as b, jsxs as C } from "react/jsx-runtime";
|
|
12
|
+
import { Box as T, FormControl as k, InputLabel as x, MenuItem as S, Select as F, Typography as N } from "@mui/material";
|
|
13
|
+
import { messageKey as P } from "@sheetxl/utils";
|
|
14
|
+
import v from "clsx";
|
|
15
|
+
var G = (e, l, o) => () => {
|
|
16
|
+
l === e && o();
|
|
17
|
+
}, w = y((e) => {
|
|
18
|
+
const { label: l, value: o, min: r, max: a, step: n = 1, decimals: i = !1, width: d, disabled: s, onChange: p } = e, c = f(null), u = (e) => Math.max(r, Math.min(a, e)), m = (e) => {
|
|
19
|
+
const l = i ? parseFloat(e) : parseInt(e, 10);
|
|
20
|
+
return Number.isNaN(l) ? null : u(l);
|
|
21
|
+
};
|
|
22
|
+
return b(t, {
|
|
23
|
+
label: l,
|
|
24
|
+
value: String(o),
|
|
25
|
+
disabled: s,
|
|
26
|
+
hideAdornment: !0,
|
|
27
|
+
helperText: null,
|
|
28
|
+
propsInput: {
|
|
29
|
+
type: "number",
|
|
30
|
+
min: r,
|
|
31
|
+
max: a,
|
|
32
|
+
step: n
|
|
33
|
+
},
|
|
34
|
+
sx: {
|
|
35
|
+
width: d,
|
|
36
|
+
minWidth: 0,
|
|
37
|
+
"& input": { textAlign: "right" }
|
|
38
|
+
},
|
|
39
|
+
onChangeInput: (e) => {
|
|
40
|
+
const l = m(e);
|
|
41
|
+
null !== l && (c.current = l, p(l));
|
|
42
|
+
},
|
|
43
|
+
onDone: (e) => {
|
|
44
|
+
const l = m(e) ?? u(0), o = c.current;
|
|
45
|
+
c.current = null, o !== l && p(l);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
w.displayName = "FormatNumberField";
|
|
50
|
+
var M = {
|
|
51
|
+
display: "flex",
|
|
52
|
+
flexDirection: "column",
|
|
53
|
+
gap: 1.5,
|
|
54
|
+
minWidth: 0
|
|
55
|
+
}, I = y((e) => {
|
|
56
|
+
const { label: l, children: o, sx: r, ...t } = e;
|
|
57
|
+
return C(T, {
|
|
58
|
+
sx: {
|
|
59
|
+
display: "flex",
|
|
60
|
+
flexDirection: "column",
|
|
61
|
+
gap: .75,
|
|
62
|
+
minWidth: 0,
|
|
63
|
+
...r
|
|
64
|
+
},
|
|
65
|
+
...t,
|
|
66
|
+
children: [l ? b(N, {
|
|
67
|
+
variant: "caption",
|
|
68
|
+
component: "div",
|
|
69
|
+
sx: {
|
|
70
|
+
color: "text.secondary",
|
|
71
|
+
lineHeight: 1.4
|
|
72
|
+
},
|
|
73
|
+
children: l
|
|
74
|
+
}) : null, o]
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
I.displayName = "FormatSection";
|
|
78
|
+
var L = y((e) => {
|
|
79
|
+
const { children: l, sx: o, ...r } = e;
|
|
80
|
+
return b(T, {
|
|
81
|
+
sx: {
|
|
82
|
+
display: "flex",
|
|
83
|
+
flexWrap: "wrap",
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
gap: 1,
|
|
86
|
+
minWidth: 0,
|
|
87
|
+
...o
|
|
88
|
+
},
|
|
89
|
+
...r,
|
|
90
|
+
children: l
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
L.displayName = "FormatRow";
|
|
94
|
+
var W = y((e) => {
|
|
95
|
+
const { children: l, sx: o, ...r } = e;
|
|
96
|
+
return b(T, {
|
|
97
|
+
sx: {
|
|
98
|
+
display: "flex",
|
|
99
|
+
alignItems: "center",
|
|
100
|
+
gap: .25,
|
|
101
|
+
flexWrap: "wrap",
|
|
102
|
+
minWidth: 0,
|
|
103
|
+
...o
|
|
104
|
+
},
|
|
105
|
+
...r,
|
|
106
|
+
children: l
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
W.displayName = "FormatButtonGroup";
|
|
110
|
+
var A = p.BuiltInSheetPattern.Gray125, B = new d(s.Named.Transparent), D = (e) => ({
|
|
111
|
+
fill: e.style.getFill(),
|
|
112
|
+
styles: e.styles,
|
|
113
|
+
schemeLookup: e.schemeLookup,
|
|
114
|
+
darkMode: e.darkMode,
|
|
115
|
+
disabled: e.disabled,
|
|
116
|
+
createCell: e.createCell,
|
|
117
|
+
applyFill: (l, o) => e.applyStyle({ fill: l }, o)
|
|
118
|
+
}), R = y((t) => {
|
|
119
|
+
const { selection: y, disabled: f, maxGradientStops: N, className: w, ...W } = t, D = m(), { fill: R, applyFill: j, createCell: K, schemeLookup: q, styles: z, darkMode: E } = y, H = f || y.disabled, J = c((e, l) => {
|
|
120
|
+
j(e.fill, l);
|
|
121
|
+
}, [j]), O = R.getType(), Q = O === p.Type.None ? p.Type.Solid : O, U = O === p.Type.Pattern ? R : null, V = U?.getPatternType() ?? A, X = U ? i(V, U.getForeground(), U.getBackground()) : null, Y = h(() => new d(s.Scheme.Tx1, q), [q]), Z = X?.foreground ?? Y, $ = X?.background ?? new d(s.Named.Transparent, q), _ = O === p.Type.Solid ? R.getColor() : null, ee = c(() => z.recentColors(), [z]), [le] = u(["formatFillColor"]), oe = le?.getContext(), re = oe?.quickColor ?? null, te = c((e, l) => {
|
|
122
|
+
e && l && z.addRecentColor(e), oe?.onColorSelect?.(e), e ? J({ fill: {
|
|
123
|
+
type: p.Type.Solid,
|
|
124
|
+
color: e.toString()
|
|
125
|
+
} }, P("op.setFillColor")) : J({ fill: { type: p.Type.None } }, P("op.setFillNone"));
|
|
126
|
+
}, [
|
|
127
|
+
J,
|
|
128
|
+
z,
|
|
129
|
+
oe
|
|
130
|
+
]), ae = c((e) => {
|
|
131
|
+
const l = e.patternType ?? V, o = i(l, e.foreground ?? Z.toString(), e.background ?? $.toString());
|
|
132
|
+
J({ fill: {
|
|
133
|
+
type: p.Type.Pattern,
|
|
134
|
+
patternType: l,
|
|
135
|
+
foreground: o.foreground,
|
|
136
|
+
background: o.background
|
|
137
|
+
} }, P("op.setFillPattern"));
|
|
138
|
+
}, [
|
|
139
|
+
J,
|
|
140
|
+
V,
|
|
141
|
+
Z,
|
|
142
|
+
$
|
|
143
|
+
]), ne = c((e) => {
|
|
144
|
+
J({ fill: {
|
|
145
|
+
type: p.Type.Gradient,
|
|
146
|
+
gradientType: e.gradientType,
|
|
147
|
+
angle: e.angle,
|
|
148
|
+
stops: e.stops.map((e) => ({
|
|
149
|
+
offset: e.offset,
|
|
150
|
+
color: e.color
|
|
151
|
+
}))
|
|
152
|
+
} }, P("op.setFillGradient"));
|
|
153
|
+
}, [J]), ie = c((e) => {
|
|
154
|
+
if (e !== Q) switch (e) {
|
|
155
|
+
case p.Type.Solid:
|
|
156
|
+
J({ fill: {
|
|
157
|
+
type: p.Type.Solid,
|
|
158
|
+
color: (re ?? R.getColor())?.toString() ?? "ffffff"
|
|
159
|
+
} }, P("op.setFillSolid"));
|
|
160
|
+
break;
|
|
161
|
+
case p.Type.Pattern:
|
|
162
|
+
ae({});
|
|
163
|
+
break;
|
|
164
|
+
case p.Type.Gradient: ne(o);
|
|
165
|
+
}
|
|
166
|
+
}, [
|
|
167
|
+
Q,
|
|
168
|
+
R,
|
|
169
|
+
re,
|
|
170
|
+
J,
|
|
171
|
+
ae,
|
|
172
|
+
ne
|
|
173
|
+
]), de = c(() => {
|
|
174
|
+
switch (O) {
|
|
175
|
+
case p.Type.Pattern:
|
|
176
|
+
ae({});
|
|
177
|
+
break;
|
|
178
|
+
case p.Type.Gradient:
|
|
179
|
+
ne(n(R));
|
|
180
|
+
break;
|
|
181
|
+
case p.Type.Solid:
|
|
182
|
+
J({ fill: {
|
|
183
|
+
type: p.Type.Solid,
|
|
184
|
+
color: R.getColor().toString()
|
|
185
|
+
} }, P("op.setFillColor"));
|
|
186
|
+
break;
|
|
187
|
+
default: J({ fill: { type: p.Type.None } }, P("op.setFillNone"));
|
|
188
|
+
}
|
|
189
|
+
}, [
|
|
190
|
+
O,
|
|
191
|
+
R,
|
|
192
|
+
J,
|
|
193
|
+
ae,
|
|
194
|
+
ne
|
|
195
|
+
]);
|
|
196
|
+
return C(T, {
|
|
197
|
+
className: v("sxl-format-fill-panel", w),
|
|
198
|
+
sx: M,
|
|
199
|
+
...W,
|
|
200
|
+
children: [
|
|
201
|
+
b(I, { children: C(k, {
|
|
202
|
+
size: "small",
|
|
203
|
+
fullWidth: !0,
|
|
204
|
+
children: [b(x, {
|
|
205
|
+
shrink: !0,
|
|
206
|
+
children: D("fill.type")
|
|
207
|
+
}), C(F, {
|
|
208
|
+
label: D("fill.type"),
|
|
209
|
+
notched: !0,
|
|
210
|
+
disabled: H,
|
|
211
|
+
value: Q,
|
|
212
|
+
onChange: (e) => ie(e.target.value),
|
|
213
|
+
children: [
|
|
214
|
+
b(S, {
|
|
215
|
+
value: p.Type.Solid,
|
|
216
|
+
onClick: G(Q, p.Type.Solid, de),
|
|
217
|
+
children: D("fill.typeSolid")
|
|
218
|
+
}),
|
|
219
|
+
b(S, {
|
|
220
|
+
value: p.Type.Pattern,
|
|
221
|
+
onClick: G(Q, p.Type.Pattern, de),
|
|
222
|
+
children: D("fill.typePattern")
|
|
223
|
+
}),
|
|
224
|
+
b(S, {
|
|
225
|
+
value: p.Type.Gradient,
|
|
226
|
+
onClick: G(Q, p.Type.Gradient, de),
|
|
227
|
+
children: D("fill.typeGradient")
|
|
228
|
+
}),
|
|
229
|
+
O === p.Type.Image ? b(S, {
|
|
230
|
+
value: p.Type.Image,
|
|
231
|
+
disabled: !0,
|
|
232
|
+
children: D("fill.typeImage")
|
|
233
|
+
}) : null
|
|
234
|
+
]
|
|
235
|
+
})]
|
|
236
|
+
}) }),
|
|
237
|
+
Q === p.Type.Solid ? b(I, {
|
|
238
|
+
label: D("fill.backgroundColor"),
|
|
239
|
+
children: b(L, { children: b(l, {
|
|
240
|
+
icon: "fill.colored",
|
|
241
|
+
disabled: H,
|
|
242
|
+
darkMode: E,
|
|
243
|
+
compareRGB: !0,
|
|
244
|
+
selectedColor: _,
|
|
245
|
+
onSelectColor: te,
|
|
246
|
+
propsPanel: {
|
|
247
|
+
disableAlpha: !0,
|
|
248
|
+
autoColor: B,
|
|
249
|
+
autoColorLabelKey: P("color.noFill"),
|
|
250
|
+
autoColorPosition: e.End,
|
|
251
|
+
schemeLookup: q,
|
|
252
|
+
recentColors: ee
|
|
253
|
+
}
|
|
254
|
+
}) })
|
|
255
|
+
}) : null,
|
|
256
|
+
O === p.Type.Pattern ? C(g, { children: [
|
|
257
|
+
b(I, {
|
|
258
|
+
label: D("fill.patternStyle"),
|
|
259
|
+
children: b(L, { children: b(a, {
|
|
260
|
+
disabled: H,
|
|
261
|
+
darkMode: E,
|
|
262
|
+
selectedPattern: V,
|
|
263
|
+
foreground: Z.toString(),
|
|
264
|
+
background: $.toString(),
|
|
265
|
+
createCell: K,
|
|
266
|
+
onSelectPattern: (e) => ae({ patternType: e })
|
|
267
|
+
}) })
|
|
268
|
+
}),
|
|
269
|
+
b(I, {
|
|
270
|
+
label: D("fill.patternForeground"),
|
|
271
|
+
children: b(L, { children: b(l, {
|
|
272
|
+
disabled: H,
|
|
273
|
+
darkMode: E,
|
|
274
|
+
selectedColor: Z,
|
|
275
|
+
onSelectColor: (e) => {
|
|
276
|
+
ae({ foreground: (e ?? Y).toString() });
|
|
277
|
+
},
|
|
278
|
+
propsPanel: {
|
|
279
|
+
disableAlpha: !0,
|
|
280
|
+
autoColor: Y,
|
|
281
|
+
schemeLookup: q,
|
|
282
|
+
recentColors: ee
|
|
283
|
+
}
|
|
284
|
+
}) })
|
|
285
|
+
}),
|
|
286
|
+
b(I, {
|
|
287
|
+
label: D("fill.patternBackground"),
|
|
288
|
+
children: b(L, { children: b(l, {
|
|
289
|
+
disabled: H,
|
|
290
|
+
darkMode: E,
|
|
291
|
+
selectedColor: $,
|
|
292
|
+
onSelectColor: (e) => {
|
|
293
|
+
ae({ background: (e ?? B).toString() });
|
|
294
|
+
},
|
|
295
|
+
propsPanel: {
|
|
296
|
+
disableAlpha: !0,
|
|
297
|
+
autoColor: B,
|
|
298
|
+
autoColorLabelKey: P("color.noFill"),
|
|
299
|
+
schemeLookup: q,
|
|
300
|
+
recentColors: ee
|
|
301
|
+
}
|
|
302
|
+
}) })
|
|
303
|
+
})
|
|
304
|
+
] }) : null,
|
|
305
|
+
O === p.Type.Gradient ? b(I, { children: b(r, {
|
|
306
|
+
disabled: H,
|
|
307
|
+
maxStops: N,
|
|
308
|
+
darkMode: E,
|
|
309
|
+
schemeLookup: q,
|
|
310
|
+
recentColors: ee,
|
|
311
|
+
value: n(R),
|
|
312
|
+
onChange: ne
|
|
313
|
+
}) }) : null
|
|
314
|
+
]
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
R.displayName = "FillPanel";
|
|
318
|
+
export { L as a, M as c, w as i, D as n, I as o, W as r, G as s, R as t };
|