@sheetxl/react 0.8.0-beta.22 → 0.8.0-beta.24
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/{Bjzo7g25tw9kTCYC.mjs → 6KeWPjMKNZY8i19M.mjs} +2 -2
- package/browser/esm/{CJVcfqrty5b-eowN.mjs → 9t5N76NQ0awbiItG.mjs} +2 -2
- package/browser/esm/{QKnTzTdIYAMcBU8r.mjs → B-rvtChAVnzrPJsd.mjs} +1 -1
- package/browser/esm/{DxsGY5rYjITV3SLK.mjs → B0asaf6iVJnOyxYq.mjs} +1 -1
- package/browser/esm/{np1ChcItFltS6AC5.mjs → BoljuF1xywgBQ3vp.mjs} +1 -1
- package/browser/esm/{CgOhJ3utK7aSQm26.mjs → BuDfdWztNZKCN_Ld.mjs} +1 -1
- package/browser/esm/{D7P7zWW2gdWclI2p.mjs → BwuvgXRS-KMp6XCe.mjs} +3 -3
- package/browser/esm/{Biz8qA4-1wRN8de2.mjs → By0ADE8R8h3hKM64.mjs} +1 -1
- package/browser/esm/{DyFeCww9e_4G9c-1.mjs → CGazs9mfVVzc04Y7.mjs} +178 -158
- package/browser/esm/{DgmkBz2cYtVZ8tXv.mjs → CXX4sovIFgAQsSxN.mjs} +1 -1
- package/browser/esm/{D8NUgUzdI7YFxyyA.mjs → CaV--rSRIoGsErhZ.mjs} +7 -7
- package/browser/esm/{D01C312OntVURMN9.mjs → CfIPv0YuwhlpYzf2.mjs} +122 -122
- package/browser/esm/{mJyEnJIX0iGfGtvE.mjs → Cgbmuy79jiY1HjS3.mjs} +1 -1
- package/browser/esm/{HQkKZC6SPUdQwgxi.mjs → CmoM33qZfV9EioFC.mjs} +1 -1
- package/browser/esm/{hTeTTb8oYTssk6EY.mjs → DHncl8rL4Tri3OBI.mjs} +1 -1
- package/browser/esm/{D0g7sllamMog1m-Z.mjs → DK8YNIcwWG9l7BpT.mjs} +3 -3
- package/browser/esm/{BPS1PDZKyF6ivJwa.mjs → DQfqezyi9TgWoADc.mjs} +1 -1
- package/browser/esm/{DH8xeknZXWn7AV5q.mjs → Dw1dknWgStq1jnIp.mjs} +6 -6
- package/browser/esm/{B9rbGikcuRq1OnhM.mjs → IF4tK8a7bQsrq8gd.mjs} +2 -2
- package/browser/esm/{BqIbT28MM3SBdvh_.mjs → ISe4yn20JJcyYnhz.mjs} +2 -2
- package/browser/esm/{mUKvsPCmRWzQke-M.mjs → UKEdlUOzahaOstGm.mjs} +1 -1
- package/browser/esm/{DhGJU1camaOf7KOq.mjs → W00O27emy3mpzSYw.mjs} +4 -4
- package/browser/esm/chart.mjs +11 -11
- package/browser/esm/control.mjs +16 -16
- package/browser/esm/{C7rc3CMd_XOITW1V.mjs → dwz-qrgJG3GabtJ0.mjs} +7 -7
- package/browser/esm/group.mjs +29 -29
- package/browser/esm/index.mjs +6469 -6440
- package/browser/esm/{B9wkino8VMasq6E3.mjs → jmoe5Dbqx1WjBgUO.mjs} +2 -2
- package/browser/esm/note.mjs +10 -10
- package/browser/esm/picture.mjs +2 -2
- package/browser/esm/{CrTfqdSwWScJN566.mjs → plaFoOG2sGGR9984.mjs} +1 -1
- package/browser/esm/shape.mjs +2 -2
- package/browser/esm/slicer.mjs +55 -50
- package/node/esm/{GG78Gq3CY8SDS-48.mjs → 7HceIR_VkgIhKM8f.mjs} +12 -12
- package/node/esm/{CZc2QH8i-TgW9nGI.mjs → 9vtv3spOcuota3Vb.mjs} +1 -1
- package/node/esm/{BPMjPMRyVTEZq_6j.mjs → B0EM467vxmzaUp9t.mjs} +1 -1
- package/node/esm/{BpcTu_chuDjr_XFv.mjs → BUiM5r_ksWRJMWPn.mjs} +1 -1
- package/node/esm/{CE5fMGMmykts2yJP.mjs → BYhlpUYwaNUr67Yi.mjs} +1 -1
- package/node/esm/{COlzVELrEvgm2STX.mjs → Bd_YMUKA8RxBL4G2.mjs} +4 -4
- package/node/esm/{DHTbAHbCiEWhilV_.mjs → BgCEqNCStGMDZ1QF.mjs} +1 -1
- package/node/esm/{FUQMKIiQQ5m3xzeO.mjs → BguHdiclysorJICc.mjs} +1 -1
- package/node/esm/{C3XXdc_UXH2g2W5E.mjs → BlahUrDcsABBUCM0.mjs} +1 -1
- package/node/esm/{C91YeRrspETjFcRc.mjs → Bub_Mjqm7gIOrcpM.mjs} +2 -2
- package/node/esm/{aLt3NYdUcYQu4Ur4.mjs → CH0kTLjibrtP2Cbj.mjs} +1 -1
- package/node/esm/{i4aPmKocZebCBeSd.mjs → CHPFQjpRp8efzowW.mjs} +6 -6
- package/node/esm/{l0GtU6LYlBywzc9T.mjs → CtBn6NAJs8ogJXEf.mjs} +2 -2
- package/node/esm/{CzQMRmArhJ6blZJp.mjs → D1Kny6jQY-Z5cM3U.mjs} +1 -1
- package/node/esm/{CcLUKcJROXrbSXjb.mjs → D2CFdcWIygfybLGD.mjs} +1 -1
- package/node/esm/{CfpNgRvWmu36cTfV.mjs → DFc3ldcMwcvqOz8-.mjs} +5 -5
- package/node/esm/{cju5Gx-t_74o116W.mjs → DHtgb2GVYcKg4gyl.mjs} +2 -2
- package/node/esm/{DX7ysYSfnigj0ak8.mjs → DUzvBfMhVRALWCyY.mjs} +1 -1
- package/node/esm/{DxKxx-yEkSydHyWQ.mjs → DXMUS-l19Pg6Apgt.mjs} +1 -1
- package/node/esm/chart.mjs +19 -19
- package/node/esm/control.mjs +16 -16
- package/node/esm/{BcASbEBHzMKiXn5i.mjs → fFLn4uIFYXSk57YZ.mjs} +1 -1
- package/node/esm/group.mjs +27 -27
- package/node/esm/index.mjs +3640 -3610
- package/node/esm/note.mjs +10 -10
- package/node/esm/picture.mjs +182 -161
- package/node/esm/shape.mjs +169 -169
- package/node/esm/slicer.mjs +100 -95
- package/node/esm/{-6T2zqPkDm0WgUKI.mjs → xDrQGeYKZL5Q1dWB.mjs} +2 -2
- package/package.json +7 -7
- package/types/src/cell/CornerTriangle.d.ts +2 -1
- package/types/src/editor/SheetCellEditorLayer.d.ts +0 -5
- package/types/src/editor/formulaPresentation.d.ts +4 -3
- package/types/src/movable/IMovableArea.d.ts +11 -0
- package/types/src/sheet/IWorksheetElement.d.ts +13 -4
- package/types/src/theme/ExplicitTokens.d.ts +18 -0
- package/types/src/theme/ThemeRootStyles.d.ts +31 -0
- package/types/src/theme/buildTokensCSS.d.ts +15 -0
- package/types/src/theme/index.d.ts +2 -4
- package/types/src/theme/useAppColorScheme.d.ts +4 -1
- package/types/src/theme/useGridColorScheme.d.ts +2 -1
- package/types/src/theme/useSystemColors.d.ts +0 -14
- package/types/src/workbook/IWorkbookElement.d.ts +71 -10
package/node/esm/slicer.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.24
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { t as e } from "./
|
|
8
|
-
import { n as t } from "./
|
|
9
|
-
import { i as r, r as o, t as l } from "./
|
|
7
|
+
import { t as e } from "./DUzvBfMhVRALWCyY.mjs";
|
|
8
|
+
import { n as t } from "./D1Kny6jQY-Z5cM3U.mjs";
|
|
9
|
+
import { i as r, r as o, t as l } from "./9vtv3spOcuota3Vb.mjs";
|
|
10
10
|
import { IFont as i } from "@sheetxl/sdk";
|
|
11
11
|
import { forwardRef as n, memo as s, useCallback as a, useEffect as c, useLayoutEffect as d, useMemo as h, useReducer as p, useRef as u, useState as m } from "react";
|
|
12
12
|
import { jsx as g, jsxs as x } from "react/jsx-runtime";
|
|
@@ -42,87 +42,92 @@ var v = () => x("svg", {
|
|
|
42
42
|
stroke: "currentColor",
|
|
43
43
|
strokeWidth: 1.2
|
|
44
44
|
})]
|
|
45
|
-
}), k = (e) => {
|
|
45
|
+
}), k = (e) => ({
|
|
46
|
+
borderLeft: e,
|
|
47
|
+
borderRight: e,
|
|
48
|
+
borderTop: e,
|
|
49
|
+
borderBottom: e
|
|
50
|
+
}), C = (e) => {
|
|
46
51
|
const t = e?.getTheme().getFontScheme().getMinorFont();
|
|
47
52
|
return {
|
|
48
53
|
fontFamily: i.toCSSFontFamily(t ?? "", ["sans-serif"]),
|
|
49
54
|
fontSize: "11pt"
|
|
50
55
|
};
|
|
51
|
-
},
|
|
52
|
-
const { children: s, disabled:
|
|
53
|
-
e(
|
|
56
|
+
}, S = s(n((i, n) => {
|
|
57
|
+
const { children: s, disabled: S, style: M, slicer: F, movable: R, zoom: D = 1, isDragging: z, onHide: I, onShow: N, onDragZone: O, onTap: j, adornmentHost: H, flip: T, gesture: E, ...K } = i, W = b(), B = y(), L = (t() ?? F.getTable()?.getWorksheet() ?? null)?.getStyles() ?? null, [P, A] = p((e) => e + 1, 0);
|
|
58
|
+
e(F, {
|
|
54
59
|
onAnyChange: A,
|
|
55
60
|
onReferencesChange: A
|
|
56
|
-
}), c(() =>
|
|
57
|
-
const [
|
|
61
|
+
}), c(() => L?.addListeners({ onAnyChange: A }), [L]);
|
|
62
|
+
const [$, J] = m([]);
|
|
58
63
|
c(() => {
|
|
59
64
|
let e = !0;
|
|
60
|
-
if (!
|
|
61
|
-
e &&
|
|
65
|
+
if (!F.isDeleted()) return F.getItems().then((t) => {
|
|
66
|
+
e && J(t);
|
|
62
67
|
}).catch(() => {
|
|
63
|
-
e &&
|
|
68
|
+
e && J([]);
|
|
64
69
|
}), () => {
|
|
65
70
|
e = !1;
|
|
66
71
|
};
|
|
67
|
-
}, [
|
|
68
|
-
const [
|
|
72
|
+
}, [F, P]);
|
|
73
|
+
const [X, Y] = m(!1), [Z, q] = m(null), G = u(null), Q = u(null), U = u(null), [V, _] = m(!1);
|
|
69
74
|
d(() => {
|
|
70
|
-
const e =
|
|
75
|
+
const e = U.current;
|
|
71
76
|
if (!e) return;
|
|
72
|
-
const t = () =>
|
|
77
|
+
const t = () => _(e.scrollHeight > e.clientHeight);
|
|
73
78
|
if (t(), "undefined" == typeof ResizeObserver) return;
|
|
74
79
|
const r = new ResizeObserver(t);
|
|
75
80
|
return r.observe(e), () => r.disconnect();
|
|
76
81
|
}, [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
$,
|
|
83
|
+
F.getRowHeight(),
|
|
84
|
+
F.getColumnCount(),
|
|
85
|
+
F.isShowCaption()
|
|
81
86
|
]), d(() => {
|
|
82
|
-
|
|
87
|
+
O?.((e) => {
|
|
83
88
|
const t = e.target;
|
|
84
|
-
return !t || !
|
|
89
|
+
return !t || !U.current?.contains(t) && !t.closest?.("button");
|
|
85
90
|
});
|
|
86
|
-
}, [
|
|
87
|
-
const
|
|
91
|
+
}, [O]);
|
|
92
|
+
const ee = u(!1), te = F.getColumnCount(), re = F.getRowHeight();
|
|
88
93
|
d(() => {
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
const e =
|
|
92
|
-
e > 0 && (
|
|
94
|
+
if (ee.current || 0 === $.length || !U.current) return;
|
|
95
|
+
ee.current = !0;
|
|
96
|
+
const e = F.toJSON()?.startItem ?? 0;
|
|
97
|
+
e > 0 && (U.current.scrollTop = Math.floor(e / te) * (re + 4));
|
|
93
98
|
}, [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
$,
|
|
100
|
+
te,
|
|
101
|
+
re
|
|
97
102
|
]);
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
}, [
|
|
101
|
-
if (
|
|
102
|
-
const r =
|
|
103
|
+
const oe = a((e) => {
|
|
104
|
+
F.selectItems(e).catch((e) => B.showError(e));
|
|
105
|
+
}, [F, B]), le = a((e, t) => {
|
|
106
|
+
if (S) return;
|
|
107
|
+
const r = $.map((e) => e.key), o = F.isFilterCleared() ? [] : $.filter((e) => e.isSelected).map((e) => e.key), l = G.current;
|
|
103
108
|
if (t.shiftKey && null !== l && r.includes(l)) {
|
|
104
109
|
const i = r.indexOf(l), n = r.indexOf(e.key), s = r.slice(Math.min(i, n), Math.max(i, n) + 1);
|
|
105
|
-
|
|
110
|
+
oe(t.ctrlKey || t.metaKey ? [.../* @__PURE__ */ new Set([...o, ...s])] : s);
|
|
106
111
|
return;
|
|
107
112
|
}
|
|
108
|
-
|
|
113
|
+
G.current = e.key, t.ctrlKey || t.metaKey || X ? 0 === o.length ? oe([e.key]) : o.includes(e.key) ? oe(o.filter((t) => t !== e.key)) : oe([...o, e.key]) : oe([e.key]);
|
|
109
114
|
}, [
|
|
110
|
-
|
|
111
|
-
B,
|
|
115
|
+
F,
|
|
112
116
|
$,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
X,
|
|
118
|
+
S,
|
|
119
|
+
oe
|
|
120
|
+
]), ie = f(n, () => ({ isSlicerEditor: () => !0 }), []), ne = l(F.getStyle(), L), se = h(() => o(ne?.wholeTable, L), [
|
|
121
|
+
ne,
|
|
122
|
+
L,
|
|
118
123
|
P
|
|
119
|
-
]),
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
]), ae = h(() => o(ne?.headerRow, L), [
|
|
125
|
+
ne,
|
|
126
|
+
L,
|
|
122
127
|
P
|
|
123
128
|
]);
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
129
|
+
if (F.isDeleted()) return null;
|
|
130
|
+
const ce = F.isFilterCleared(), de = F.isShowCaption(), he = {
|
|
126
131
|
display: "flex",
|
|
127
132
|
alignItems: "center",
|
|
128
133
|
justifyContent: "center",
|
|
@@ -138,8 +143,8 @@ var v = () => x("svg", {
|
|
|
138
143
|
};
|
|
139
144
|
return x("div", {
|
|
140
145
|
className: "sxl-slicer-editor",
|
|
141
|
-
...
|
|
142
|
-
ref:
|
|
146
|
+
...K,
|
|
147
|
+
ref: ie,
|
|
143
148
|
style: {
|
|
144
149
|
width: "100%",
|
|
145
150
|
height: "100%",
|
|
@@ -149,16 +154,16 @@ var v = () => x("svg", {
|
|
|
149
154
|
flexDirection: "column",
|
|
150
155
|
overflow: "hidden",
|
|
151
156
|
position: "relative",
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
...
|
|
155
|
-
...
|
|
156
|
-
filter:
|
|
157
|
-
boxShadow:
|
|
158
|
-
...
|
|
157
|
+
background: "var(--sxl-color-base-100, white)",
|
|
158
|
+
...k("var(--sxl-color-neutral, grey) solid 1px"),
|
|
159
|
+
...C(L),
|
|
160
|
+
...se,
|
|
161
|
+
filter: S ? "blur(1px)" : void 0,
|
|
162
|
+
boxShadow: z ? "1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))" : void 0,
|
|
163
|
+
...M
|
|
159
164
|
},
|
|
160
|
-
children: [
|
|
161
|
-
ref:
|
|
165
|
+
children: [de ? x("div", {
|
|
166
|
+
ref: Q,
|
|
162
167
|
className: "sxl-slicer-caption",
|
|
163
168
|
style: {
|
|
164
169
|
display: "flex",
|
|
@@ -167,7 +172,7 @@ var v = () => x("svg", {
|
|
|
167
172
|
margin: "0 9px",
|
|
168
173
|
padding: "6px 0 4px 0",
|
|
169
174
|
flex: "none",
|
|
170
|
-
...
|
|
175
|
+
...ae
|
|
171
176
|
},
|
|
172
177
|
children: [
|
|
173
178
|
g("span", {
|
|
@@ -177,47 +182,47 @@ var v = () => x("svg", {
|
|
|
177
182
|
textOverflow: "ellipsis",
|
|
178
183
|
whiteSpace: "nowrap"
|
|
179
184
|
},
|
|
180
|
-
children:
|
|
185
|
+
children: F.getCaption()
|
|
181
186
|
}),
|
|
182
187
|
g("button", {
|
|
183
188
|
type: "button",
|
|
184
189
|
className: "sxl-slicer-multi-select",
|
|
185
190
|
tabIndex: -1,
|
|
186
|
-
title:
|
|
187
|
-
"aria-label":
|
|
188
|
-
"aria-pressed":
|
|
191
|
+
title: W("slicer.multiSelect"),
|
|
192
|
+
"aria-label": W("slicer.multiSelect"),
|
|
193
|
+
"aria-pressed": X,
|
|
189
194
|
style: {
|
|
190
|
-
...
|
|
191
|
-
borderColor:
|
|
192
|
-
backgroundColor:
|
|
195
|
+
...he,
|
|
196
|
+
borderColor: X ? "var(--sxl-color-neutral, grey)" : "transparent",
|
|
197
|
+
backgroundColor: X ? "var(--sxl-color-base-200, #eee)" : "transparent"
|
|
193
198
|
},
|
|
194
|
-
onClick: () =>
|
|
199
|
+
onClick: () => Y((e) => !e),
|
|
195
200
|
children: g(w, {})
|
|
196
201
|
}),
|
|
197
202
|
g("button", {
|
|
198
203
|
type: "button",
|
|
199
204
|
className: "sxl-slicer-clear",
|
|
200
205
|
tabIndex: -1,
|
|
201
|
-
title:
|
|
202
|
-
"aria-label":
|
|
203
|
-
disabled:
|
|
206
|
+
title: W("slicer.clearFilter"),
|
|
207
|
+
"aria-label": W("slicer.clearFilter"),
|
|
208
|
+
disabled: ce || S,
|
|
204
209
|
style: {
|
|
205
|
-
...
|
|
206
|
-
opacity:
|
|
207
|
-
cursor:
|
|
210
|
+
...he,
|
|
211
|
+
opacity: ce ? .4 : 1,
|
|
212
|
+
cursor: ce ? "default" : "pointer"
|
|
208
213
|
},
|
|
209
214
|
onClick: () => {
|
|
210
|
-
|
|
215
|
+
F.clearFilters().catch((e) => B.showError(e));
|
|
211
216
|
},
|
|
212
217
|
children: g(v, {})
|
|
213
218
|
})
|
|
214
219
|
]
|
|
215
220
|
}) : null, g("div", {
|
|
216
|
-
ref:
|
|
221
|
+
ref: U,
|
|
217
222
|
className: "sxl-slicer-items",
|
|
218
223
|
role: "listbox",
|
|
219
224
|
"aria-multiselectable": !0,
|
|
220
|
-
"aria-label":
|
|
225
|
+
"aria-label": F.getCaption(),
|
|
221
226
|
style: {
|
|
222
227
|
flex: "1 1 auto",
|
|
223
228
|
minHeight: 0,
|
|
@@ -227,16 +232,16 @@ var v = () => x("svg", {
|
|
|
227
232
|
"--scrollbar-width": "8px",
|
|
228
233
|
"--scrollbar-border-width": "1px",
|
|
229
234
|
display: "grid",
|
|
230
|
-
gridTemplateColumns: `repeat(${
|
|
231
|
-
gridAutoRows: `${
|
|
235
|
+
gridTemplateColumns: `repeat(${te}, minmax(0, 1fr))`,
|
|
236
|
+
gridAutoRows: `${re}px`,
|
|
232
237
|
alignContent: "start",
|
|
233
238
|
gap: 4,
|
|
234
|
-
margin: (
|
|
235
|
-
paddingRight:
|
|
239
|
+
margin: (de ? 4 : 9) + "px 9px 9px 9px",
|
|
240
|
+
paddingRight: V ? 3 : 0
|
|
236
241
|
},
|
|
237
|
-
onPointerLeave: () =>
|
|
238
|
-
children:
|
|
239
|
-
const t = r(e.isSelected, e.hasData,
|
|
242
|
+
onPointerLeave: () => q(null),
|
|
243
|
+
children: $.map((e) => {
|
|
244
|
+
const t = r(e.isSelected, e.hasData, Z === e.key);
|
|
240
245
|
return g("div", {
|
|
241
246
|
className: "sxl-slicer-item",
|
|
242
247
|
role: "option",
|
|
@@ -254,15 +259,15 @@ var v = () => x("svg", {
|
|
|
254
259
|
whiteSpace: "nowrap",
|
|
255
260
|
textOverflow: "ellipsis",
|
|
256
261
|
userSelect: "none",
|
|
257
|
-
cursor:
|
|
258
|
-
|
|
259
|
-
...o(
|
|
262
|
+
cursor: S ? void 0 : "pointer",
|
|
263
|
+
...k("1px solid transparent"),
|
|
264
|
+
...o(ne?.[t], L)
|
|
260
265
|
},
|
|
261
|
-
onPointerEnter: () =>
|
|
266
|
+
onPointerEnter: () => q(e.key),
|
|
262
267
|
onPointerDown: (e) => {
|
|
263
|
-
0 === e.button && (e.stopPropagation(), e.preventDefault(),
|
|
268
|
+
0 === e.button && (e.stopPropagation(), e.preventDefault(), R && !R.isSelected() && R.select());
|
|
264
269
|
},
|
|
265
|
-
onClick: (t) =>
|
|
270
|
+
onClick: (t) => le(e, t),
|
|
266
271
|
children: g("span", {
|
|
267
272
|
style: {
|
|
268
273
|
overflow: "hidden",
|
|
@@ -275,5 +280,5 @@ var v = () => x("svg", {
|
|
|
275
280
|
})]
|
|
276
281
|
});
|
|
277
282
|
}));
|
|
278
|
-
|
|
279
|
-
export {
|
|
283
|
+
S.displayName = "SlicerEditor";
|
|
284
|
+
export { S as SlicerEditor };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.24
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { n as e } from "./
|
|
7
|
+
import { n as e } from "./B0EM467vxmzaUp9t.mjs";
|
|
8
8
|
import { ChartEditor as t } from "./chart.mjs";
|
|
9
9
|
import { jsx as a } from "react/jsx-runtime";
|
|
10
10
|
import { messageKey as s, t as o } from "@sheetxl/utils";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/react",
|
|
3
3
|
"description": "React - React components needed to build advanced grid and spreadsheet UIs.",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.24",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -89,11 +89,11 @@
|
|
|
89
89
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
90
90
|
"@dnd-kit/sortable": "^10.0.0",
|
|
91
91
|
"@dnd-kit/utilities": "^3.2.2",
|
|
92
|
-
"@sheetxl/grid-react": "^0.8.0-beta.
|
|
93
|
-
"@sheetxl/io": "^0.8.0-beta.
|
|
94
|
-
"@sheetxl/sdk": "^0.8.0-beta.
|
|
95
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
96
|
-
"@sheetxl/utils-react": "^0.8.0-beta.
|
|
92
|
+
"@sheetxl/grid-react": "^0.8.0-beta.24",
|
|
93
|
+
"@sheetxl/io": "^0.8.0-beta.24",
|
|
94
|
+
"@sheetxl/sdk": "^0.8.0-beta.24",
|
|
95
|
+
"@sheetxl/utils": "^0.8.0-beta.24",
|
|
96
|
+
"@sheetxl/utils-react": "^0.8.0-beta.24",
|
|
97
97
|
"clsx": "^2.1.1",
|
|
98
98
|
"echarts": "~6.1.0",
|
|
99
99
|
"react-merge-refs": "^3.0.2",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"react-dom": "^19.0.0"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@sheetxl/io-xlsx": "^0.8.0-beta.
|
|
107
|
+
"@sheetxl/io-xlsx": "^0.8.0-beta.24",
|
|
108
108
|
"@types/react": "^19.3.0",
|
|
109
109
|
"@types/react-dom": "^19.3.0"
|
|
110
110
|
}
|
|
@@ -6,7 +6,8 @@ export interface CornerTriangleProps extends React.SVGProps<SVGSVGElement> {
|
|
|
6
6
|
*/
|
|
7
7
|
anchorLocation?: AnchorLocation;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* The mark's color. Set on the root `<svg>`, so a stylesheet rule on the mark's class wins over it.
|
|
10
|
+
* @defaultValue the `color-neutral` token
|
|
10
11
|
*/
|
|
11
12
|
fill?: string;
|
|
12
13
|
/**
|
|
@@ -2,11 +2,6 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { IWorksheet } from '@sheetxl/sdk';
|
|
3
3
|
import { EditorAlignment, VirtualDivProps } from '@sheetxl/grid-react';
|
|
4
4
|
import { SheetEditable } from './SheetEditable';
|
|
5
|
-
/**
|
|
6
|
-
* Props for {@link SheetCellEditorLayer}.
|
|
7
|
-
*
|
|
8
|
-
* @typeParam C - clean value type. @typeParam D - dirty value type. @typeParam A - commit args.
|
|
9
|
-
*/
|
|
10
5
|
export interface SheetCellEditorLayerProps extends VirtualDivProps {
|
|
11
6
|
/**
|
|
12
7
|
* Stacking override, read by the grid's sorter **off this element** when the editor is a grid
|
|
@@ -59,9 +59,10 @@ export declare const EVAL_RUN_STYLE: CSSProperties;
|
|
|
59
59
|
*/
|
|
60
60
|
export declare const EVAL_RUN_OUTLINE_STYLE: CSSProperties;
|
|
61
61
|
/**
|
|
62
|
-
* The hue for a paren at `depth` (0 = outermost), cycling once the palette is
|
|
63
|
-
*
|
|
64
|
-
*
|
|
62
|
+
* The hue for a paren at `depth` (0 = outermost): the `color-bracket` token, cycling once the palette is
|
|
63
|
+
* exhausted. A pair shares one hue and nesting rotates it, so which `)` closes which `(` reads at a glance
|
|
64
|
+
* in a deep formula without moving the caret there. Not the `color-series` palette the references use:
|
|
65
|
+
* parens and references sit in the same line of text and have to stay tellable apart.
|
|
65
66
|
*/
|
|
66
67
|
export declare const parenDepthColor: (depth: number) => string;
|
|
67
68
|
/**
|
|
@@ -54,6 +54,17 @@ export interface MovableElementProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
54
54
|
* box can drag from its border and put the caret where its text is pressed.
|
|
55
55
|
*/
|
|
56
56
|
onDragZone?: (isDragZone: (event: MouseEvent | TouchEvent) => boolean) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Registers what a finger tap does on the movable while it is not selected: answer `true` to take
|
|
59
|
+
* the tap, and the frame leaves the movable unselected. Without one, or on `false`, the tap selects.
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* A finger pressed on a movable that is not selected may be starting a pan of the sheet, so the
|
|
63
|
+
* content never receives that press: the frame waits for the finger to lift where it went down,
|
|
64
|
+
* the sheet unscrolled, and only then calls this. A link that opens on a tap is the use; the sheet
|
|
65
|
+
* still pans from anywhere on the movable.
|
|
66
|
+
*/
|
|
67
|
+
onTap?: (tap: (event: PointerEvent) => boolean) => void;
|
|
57
68
|
/**
|
|
58
69
|
* A box above the selection chrome, placed and turned exactly as the frame is, for the content's
|
|
59
70
|
* own controls (a shape's adjustment handles). `null` when the movable has none.
|
|
@@ -10,6 +10,7 @@ import { ValidationPromptRenderProps, ValidationAlertRenderProps } from '../laye
|
|
|
10
10
|
import { TableToolbarRenderProps } from '../layer/TableToolbar';
|
|
11
11
|
import { PivotToolbarRenderProps } from '../layer/PivotToolbar';
|
|
12
12
|
import { CommandContext } from '../frame';
|
|
13
|
+
import { ExplicitTokens } from '../theme';
|
|
13
14
|
import { ISheetHeaderElement, SheetHeaderProps } from './ISheetHeaderElement';
|
|
14
15
|
export interface SheetLocation {
|
|
15
16
|
clientX: number;
|
|
@@ -62,14 +63,22 @@ export interface WorksheetElementProps extends React.HTMLAttributes<HTMLDivEleme
|
|
|
62
63
|
*/
|
|
63
64
|
renderSheetError?: RenderSlotFn<ErrorPanelProps> | null;
|
|
64
65
|
/**
|
|
65
|
-
* The app (chrome / header) color scheme — selects the header/app surface mode.
|
|
66
|
+
* The app (chrome / header) color scheme — selects the header/app surface mode. `'auto'` follows the
|
|
67
|
+
* page: a `dark`/`light` class on `<html>`/`<body>`, else the OS.
|
|
66
68
|
*/
|
|
67
|
-
colorScheme?: ThemeMode;
|
|
69
|
+
colorScheme?: ThemeMode | 'auto';
|
|
68
70
|
/**
|
|
69
71
|
* The grid-body color scheme (stays light in a dark app when *Enable Dark Grid* is off) — drives the grid
|
|
70
|
-
* `darkMode` rendering intent and the grid surface mode.
|
|
72
|
+
* `darkMode` rendering intent and the grid surface mode. `'auto'` follows the page as
|
|
73
|
+
* {@link colorScheme} does.
|
|
71
74
|
*/
|
|
72
|
-
gridColorScheme?: ThemeMode;
|
|
75
|
+
gridColorScheme?: ThemeMode | 'auto';
|
|
76
|
+
/**
|
|
77
|
+
* Token values for this sheet, per mode and surface: the React form of a stylesheet in
|
|
78
|
+
* `@layer sxl-overrides`, scoped to this instance. Same shape as the workbook's `tokens`; inside a
|
|
79
|
+
* workbook, set them there instead.
|
|
80
|
+
*/
|
|
81
|
+
tokens?: ExplicitTokens;
|
|
73
82
|
/**
|
|
74
83
|
* Show the column headers
|
|
75
84
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TokenTheme, ThemeMode } from '@sheetxl/utils-react';
|
|
2
|
+
/** The surfaces a host can address: the `data-sxl-theme-surface` values a workbook introduces. */
|
|
3
|
+
export type ExplicitSurface = 'app' | 'header' | 'grid';
|
|
4
|
+
/**
|
|
5
|
+
* Token values a host states, addressed by **cell**: a `(mode × surface)` pair, so a host can name the
|
|
6
|
+
* header paper without a new token existing.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* {
|
|
10
|
+
* dark: {
|
|
11
|
+
* app: { 'color-base-100': '#14102c', 'color-base-200': '#14102c', 'color-primary': '#6e9bff' },
|
|
12
|
+
* header: { 'color-base-100': '#1a1538', 'color-base-300': '#312b55' }
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export type ExplicitTokens = Partial<Record<ThemeMode, Partial<Record<ExplicitSurface, Partial<TokenTheme>>>>>;
|
|
18
|
+
//# sourceMappingURL=ExplicitTokens.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ExplicitTokens } from './ExplicitTokens';
|
|
3
|
+
export interface ThemeRootStylesProps {
|
|
4
|
+
/**
|
|
5
|
+
* The theme root's scope class, without the leading dot. Put the same class on the root element; the
|
|
6
|
+
* styles apply to it and everything inside it, and to floats that carry it.
|
|
7
|
+
*/
|
|
8
|
+
scopeClass: string;
|
|
9
|
+
/** Token values for this root, per mode and surface. Pass a stable object. */
|
|
10
|
+
tokens?: ExplicitTokens;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The stylesheets that make an element a self-contained themed instance: the neutral token defaults for
|
|
14
|
+
* the `app`, `grid` and `header` surfaces, the spreadsheet system colors (`--sxl-sys-color-*`) resolved
|
|
15
|
+
* against those surfaces, and the host's {@link ThemeRootStylesProps.tokens}, all scoped to `scopeClass`.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* `WorkbookElement` and `WorksheetElement` render this at their roots. Render it yourself only when you
|
|
19
|
+
* build your own shell around them and its chrome sits outside their roots: then that shell is the theme
|
|
20
|
+
* root. Set `data-sxl-theme-mode` on the root element alongside the class.
|
|
21
|
+
*
|
|
22
|
+
* ```tsx
|
|
23
|
+
* const scopeClass = createThemeScopeClass('shell', useId());
|
|
24
|
+
* <div className={scopeClass} data-sxl-theme-mode="dark">
|
|
25
|
+
* <ThemeRootStyles scopeClass={scopeClass} />
|
|
26
|
+
* …
|
|
27
|
+
* </div>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const ThemeRootStyles: React.MemoExoticComponent<({ scopeClass, tokens }: ThemeRootStylesProps) => React.JSX.Element>;
|
|
31
|
+
//# sourceMappingURL=ThemeRootStyles.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExplicitTokens } from './ExplicitTokens';
|
|
2
|
+
/**
|
|
3
|
+
* The override stylesheet for {@link ExplicitTokens}: the same rules a client would write by hand in
|
|
4
|
+
* `@layer sxl-overrides`, scoped to one instance.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* An `app` value reaches every surface in that mode, because each surface element carries its own mode and
|
|
8
|
+
* the override layer outranks the surface defaults. State a `grid` or `header` cell to make that surface
|
|
9
|
+
* differ. A value stated for one mode never applies in the other.
|
|
10
|
+
*
|
|
11
|
+
* @param tokens The host's cells.
|
|
12
|
+
* @param scope The instance's `@scope` selector (e.g. `.sheetxl-workbook-r1`).
|
|
13
|
+
*/
|
|
14
|
+
export declare const buildTokensCSS: (tokens: ExplicitTokens, scope?: string) => string;
|
|
15
|
+
//# sourceMappingURL=buildTokensCSS.d.ts.map
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export * from './DocThemesContext';
|
|
2
2
|
export * from './DocThemesProvider';
|
|
3
3
|
export * from './useDocThemes';
|
|
4
|
-
export * from './createCSSSystemLookup';
|
|
5
|
-
export * from './useSystemColors';
|
|
6
|
-
export * from './buildOOXMLThemeCSS';
|
|
7
|
-
export * from './buildDocThemeCSS';
|
|
8
4
|
export * from './ThemeState';
|
|
9
5
|
export * from './useGridColorScheme';
|
|
10
6
|
export * from './useAppColorScheme';
|
|
7
|
+
export * from './ExplicitTokens';
|
|
8
|
+
export * from './ThemeRootStyles';
|
|
11
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -10,6 +10,9 @@ import { ThemeMode } from '@sheetxl/utils-react';
|
|
|
10
10
|
* rule, and both the workbook root (app mode) and the sheet (grid mode) are ancestors, so CSS would pick by
|
|
11
11
|
* source order rather than proximity. Stating the mode selects the compound `[mode][surface]` cell, which is
|
|
12
12
|
* emitted last and wins.
|
|
13
|
+
*
|
|
14
|
+
* @param override A controlled scheme (a host's `colorScheme` prop); when provided it wins over the
|
|
15
|
+
* preference. `'auto'` follows the page class, else the OS.
|
|
13
16
|
*/
|
|
14
|
-
export declare const useAppColorScheme: () => ThemeMode;
|
|
17
|
+
export declare const useAppColorScheme: (override?: ThemeMode | "auto") => ThemeMode;
|
|
15
18
|
//# sourceMappingURL=useAppColorScheme.d.ts.map
|
|
@@ -19,6 +19,7 @@ import { ThemeMode } from '@sheetxl/utils-react';
|
|
|
19
19
|
* element, then resolves `--sxl-*` from the cascade / `getComputedStyle`.
|
|
20
20
|
*
|
|
21
21
|
* @param override Optional controlled scheme; when provided it wins over the enclosing grid and the preference.
|
|
22
|
+
* `'auto'` follows the page class, else the OS, without the *Enable Dark Grid* gate: the host asked for it.
|
|
22
23
|
*/
|
|
23
|
-
export declare const useGridColorScheme: (override?: ThemeMode) => ThemeMode;
|
|
24
|
+
export declare const useGridColorScheme: (override?: ThemeMode | "auto") => ThemeMode;
|
|
24
25
|
//# sourceMappingURL=useGridColorScheme.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IColor } from '@sheetxl/sdk';
|
|
2
1
|
import { CSSSystemLookup } from './createCSSSystemLookup';
|
|
3
2
|
/**
|
|
4
3
|
* Injects the default `--sxl-sys-color-*` CSS variables — the built-in (baked) system color
|
|
@@ -12,19 +11,6 @@ import { CSSSystemLookup } from './createCSSSystemLookup';
|
|
|
12
11
|
* `:root` stylesheet (not inline styles) keeps specificity low so host overrides win.
|
|
13
12
|
*/
|
|
14
13
|
export declare const installSystemColorDefaults: () => void;
|
|
15
|
-
/**
|
|
16
|
-
* Builds `--sxl-sys-color-*` CSS variable overrides from a partial set of {@link IColor.Named} system
|
|
17
|
-
* colors, so that system/auto colors (which `IColor.toCSS()` emits as `var(--sxl-sys-color-*)`) resolve
|
|
18
|
-
* to the provided values rather than the global host mapping.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* Used by the grid container ({@link WorksheetElement}) and by UI rendered *outside* the grid subtree
|
|
22
|
-
* that must still match the grid's light/dark intent — most notably a color picker popup, which is
|
|
23
|
-
* portaled and would otherwise inherit the host's `--sxl-sys-color-*` (e.g. a light grid in a dark host
|
|
24
|
-
* would show the host's dark `auto` color). Names are lower-cased to match the variable
|
|
25
|
-
* `IColor.toCSS()` references; centralizing that here keeps callers from drifting.
|
|
26
|
-
*/
|
|
27
|
-
export declare const createSystemColorVars: (colors: Partial<Record<IColor.Named, string>>) => Record<string, string>;
|
|
28
14
|
/**
|
|
29
15
|
* Ensures the default system-color CSS variables are present (see {@link installSystemColorDefaults}).
|
|
30
16
|
* Wired into `WorksheetElement`, so the grid themes from `--sxl-sys-color-*` out of the box.
|