@sheetxl/react 0.8.0-beta.12 → 0.8.0-beta.14
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/{DGG1auUKsjFbAazu.mjs → 3bA4ZNVK9px28j8g.mjs} +3 -3
- package/browser/esm/{CUekkfE6uwwsdQpc.mjs → B1mBZyt2eP2CpVwp.mjs} +1 -1
- package/browser/esm/{ZoS0cpNEBcv6p-Z1.mjs → B9bUlu6d3vrRZxS-.mjs} +3 -3
- package/browser/esm/BAhJx_sa3wR4i_0q.mjs +145 -0
- package/browser/esm/{BDlpRkuBok0Uu4Hn.mjs → BCZ5elyhp4P5oEuf.mjs} +1 -1
- package/browser/esm/BLYs69szBviI7Jjh.mjs +303 -0
- package/browser/esm/{D_usN3pWuCJU2GN-.mjs → BNyPX5tVpHU3d3Vj.mjs} +2 -2
- package/browser/esm/{_6Sb6ElRcZftxMNh.mjs → BSqY5OuRUNgKmwp8.mjs} +1 -1
- package/browser/esm/{D22NJmTiky4NL8tM.mjs → Bk4hW9MxdjC3CGlC.mjs} +1 -1
- package/browser/esm/{D2GydDzPuvIjdpok.mjs → BoJ5N_Kc7V9zyftG.mjs} +1 -1
- package/browser/esm/{C_LUq-BnguetvGZz.mjs → C1yjI8GDwCp8bC1Z.mjs} +2 -2
- package/browser/esm/{LBQDhVhz7S7i6a8i.mjs → C6TgQuQt88nz0-jL.mjs} +1 -1
- package/browser/esm/{CSFORKZ8zrVL_Y0w.mjs → CAT9L5BY3HAluoJf.mjs} +1 -1
- package/browser/esm/{DxEczXCHTerDemDP.mjs → CDf6czK5WuKJhq0y.mjs} +4 -4
- package/browser/esm/CoRairrEG42TjiZk.mjs +19 -0
- package/browser/esm/CuPu7ToiaqUerd85.mjs +401 -0
- package/browser/esm/{BapujiblfiXDlu67.mjs → D0Sg0TONmNBjIlEg.mjs} +1 -1
- package/browser/esm/{Cslk_qRdBSuJIi1O.mjs → DxwO-Y_gJ9IaBQ4B.mjs} +6 -6
- package/browser/esm/{DN3lqq95KY0K6f1x.mjs → K9YyKehkJlT3axZh.mjs} +1 -1
- package/browser/esm/NG_Q0Dq4JXnEWACp.mjs +341 -0
- package/browser/esm/{B4mT3G7GHwgDYFGP.mjs → PL83wgS5ferhptps.mjs} +2 -2
- package/browser/esm/chart.mjs +3 -3
- package/browser/esm/control.mjs +74 -73
- package/browser/esm/group.mjs +3 -3
- package/browser/esm/index.mjs +3971 -3744
- package/browser/esm/{CtGhA0kS2MCfEsHN.mjs → nm3DZw1nJMIh89Dx.mjs} +3 -3
- package/browser/esm/note.mjs +5 -5
- package/browser/esm/picture.mjs +2 -81
- package/browser/esm/shape.mjs +2 -2
- package/browser/esm/slicer.mjs +112 -111
- package/browser/esm/{Ck1LbcsdSfKNi6xq.mjs → wQh060x4Bo_NqUYk.mjs} +1 -1
- package/node/esm/6VFNx4NTcuHaXbnF.mjs +146 -0
- package/node/esm/{CzN6c6KyxVmNvayz.mjs → BBm7LjTGVud73kml.mjs} +1 -1
- package/node/esm/{CH1DVfFhjdd_3pw1.mjs → BayAQ4VhPgK40T5V.mjs} +2 -2
- package/node/esm/{T5lfCrudsUnOTxEn.mjs → BgH9YejvQpQrZeHl.mjs} +1 -1
- package/node/esm/{iL9jKJcnED6oi0B4.mjs → ByTkh2-kGcBTZn9j.mjs} +1 -1
- package/node/esm/{DayGI0Bt57FDNbVF.mjs → C0HgFe1pYpEl1EgM.mjs} +1 -1
- package/node/esm/{MWges5ywL3aEdChp.mjs → CEyXz1TulkCpAv0t.mjs} +1 -1
- package/node/esm/{C0KLMCRb3sbd5Q20.mjs → CMSfxUMv1tFyNlRJ.mjs} +5 -5
- package/node/esm/{DWkPWuf5ZrLRMixG.mjs → CZfiN5xD1_Zws8z-.mjs} +15 -15
- package/node/esm/{DXiNwr6ZnXBe7TlG.mjs → D-lQa7ydREp9WwxP.mjs} +1 -1
- package/node/esm/{Bi2Jwc0zpweaNzKc.mjs → D2dDGnBtilmmDxBJ.mjs} +2 -2
- package/node/esm/{CNOLkUDURBElaaIf.mjs → DA6UdPMREzxobL8H.mjs} +3 -3
- package/node/esm/{YB_qExw23Ci4nMYy.mjs → Duu2zmr8YkGTo-iP.mjs} +2 -2
- package/node/esm/{Apcuz4_QtBHt7G47.mjs → Dztz6JUUcE4NG6sn.mjs} +1 -1
- package/node/esm/ShpbUw8_QnOxZu2h.mjs +19 -0
- package/node/esm/{DyetXBW7vFLJWB22.mjs → _OzLYz_iliC3tcW2.mjs} +1 -1
- package/node/esm/chart.mjs +2 -2
- package/node/esm/control.mjs +79 -78
- package/node/esm/eG-mlQfoOvRwAwU1.mjs +406 -0
- package/node/esm/{DKqdv5JubgVaq-g9.mjs → fhOm7EkeM-0FAdDI.mjs} +1 -1
- package/node/esm/group.mjs +3 -3
- package/node/esm/index.mjs +6469 -6242
- package/node/esm/note.mjs +18 -18
- package/node/esm/picture.mjs +269 -50
- package/node/esm/{CalVk3o4-kX79s3v.mjs → r0Bg1Uwd5WHBFQyj.mjs} +1 -1
- package/node/esm/shape.mjs +186 -580
- package/node/esm/slicer.mjs +51 -50
- package/node/esm/{bRD1KCpSpAYTEs50.mjs → wtQ7d7f37N1tuJZB.mjs} +1 -1
- package/package.json +7 -7
- package/resources/locales/de/picture.cmd.json +157 -0
- package/resources/locales/de/sheet.cmd.json +24 -2
- package/resources/locales/de/ui.msg.json +3 -0
- package/resources/locales/en/picture.cmd.json +157 -0
- package/resources/locales/en/sheet.cmd.json +24 -2
- package/resources/locales/en/ui.msg.json +3 -0
- package/types/src/chart/ChartCommands.d.ts +1 -1
- package/types/src/chart/paint/_graphics.d.ts +0 -8
- package/types/src/chart/paint/echarts.d.ts +1 -1
- package/types/src/chart/paint/index.d.ts +1 -1
- package/types/src/chart/paint/kinds/ChartPaintKind.d.ts +1 -1
- package/types/src/chart/paint/kinds/_builtIns.d.ts +0 -9
- package/types/src/chart/paint/toEChartsOption.d.ts +1 -1
- package/types/src/layer/CircularIndicatorLayer.d.ts +1 -1
- package/types/src/layer/HyperlinkLayer.d.ts +13 -9
- package/types/src/layer/_visibleCellFeatures.d.ts +11 -0
- package/types/src/layer/useValidationPicker.d.ts +1 -1
- package/types/src/movable/useFramePreview.d.ts +17 -0
- package/types/src/picture/PictureCommands.d.ts +8 -0
- package/types/src/picture/_pictureHyperlink.d.ts +13 -0
- package/types/src/picture/pictureCrop.d.ts +32 -0
- package/types/src/sheet/_hyperlinkEdit.d.ts +7 -0
- package/types/src/sheet/circularReferences.d.ts +1 -1
- package/types/src/theme/buildDocThemeCSS.d.ts +4 -1
- package/browser/esm/BR-AiOwuQlYh5-tr.mjs +0 -730
- package/browser/esm/DhYQRc8L2kALmFNz.mjs +0 -75
- package/node/esm/Cp1DuCae46eQKzWy.mjs +0 -76
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.14
|
|
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 "./C6TgQuQt88nz0-jL.mjs";
|
|
8
|
+
import { n as t } from "./wQh060x4Bo_NqUYk.mjs";
|
|
9
|
+
import { t as n } from "./CAT9L5BY3HAluoJf.mjs";
|
|
10
|
+
import { t as r } from "./B9bUlu6d3vrRZxS-.mjs";
|
|
11
|
+
import { i, n as a, r as o, t as ee } from "./CuPu7ToiaqUerd85.mjs";
|
|
12
|
+
import { forwardRef as s, memo as c, useCallback as l, useEffect as u, useMemo as d, useReducer as f, useRef as p, useState as m } from "react";
|
|
13
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
14
|
+
import { messageKey as te } from "@sheetxl/utils";
|
|
15
|
+
import { ReactUtils as _, useImperativeElement as v } from "@sheetxl/utils-react";
|
|
16
|
+
import { createPortal as ne } from "react-dom";
|
|
17
|
+
var re = c(({ handles: e, width: t, height: n, zoom: r, onDrag: i }) => {
|
|
18
|
+
let a = p(null), o = p(null), [ee, s] = m(!1), c = l((e) => {
|
|
19
|
+
let t = a.current, n = t?.getScreenCTM();
|
|
20
|
+
if (!t || !n) return null;
|
|
21
|
+
let r = new DOMPoint(e.clientX, e.clientY).matrixTransform(n.inverse());
|
|
22
|
+
return {
|
|
23
|
+
x: r.x,
|
|
24
|
+
y: r.y
|
|
25
|
+
};
|
|
26
|
+
}, []), u = l((e, t) => {
|
|
27
|
+
e.button === 0 && (e.stopPropagation(), e.preventDefault(), o.current = {
|
|
28
|
+
index: t,
|
|
29
|
+
pointerId: e.pointerId
|
|
30
|
+
}, e.currentTarget.setPointerCapture(e.pointerId), s(!0));
|
|
31
|
+
}, []), d = l((e) => {
|
|
32
|
+
let t = o.current;
|
|
33
|
+
if (!t || t.pointerId !== e.pointerId) return;
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
let n = c(e);
|
|
36
|
+
n && i(t.index, n.x, n.y, "move");
|
|
37
|
+
}, [c, i]), f = l((e) => {
|
|
38
|
+
let t = o.current;
|
|
39
|
+
if (!t || t.pointerId !== e.pointerId) return;
|
|
40
|
+
e.stopPropagation(), o.current = null, s(!1);
|
|
41
|
+
let n = c(e);
|
|
42
|
+
n ? i(t.index, n.x, n.y, "end") : i(t.index, 0, 0, "cancel");
|
|
43
|
+
}, [c, i]), te = l((e) => {
|
|
44
|
+
let t = o.current;
|
|
45
|
+
t && t.pointerId === e.pointerId && (o.current = null, s(!1), i(t.index, 0, 0, "cancel"));
|
|
46
|
+
}, [i]);
|
|
47
|
+
if (!(e.length !== 0 && t > 0 && n > 0)) return null;
|
|
48
|
+
let _ = r > 0 ? r : 1, v = 4.5 / _;
|
|
49
|
+
return h("svg", {
|
|
50
|
+
ref: a,
|
|
51
|
+
className: ee ? "shape-handles movable-gesture" : "shape-handles",
|
|
52
|
+
viewBox: `0 0 ${t} ${n}`,
|
|
53
|
+
width: "100%",
|
|
54
|
+
height: "100%",
|
|
55
|
+
preserveAspectRatio: "none",
|
|
56
|
+
overflow: "visible",
|
|
57
|
+
style: {
|
|
58
|
+
position: "absolute",
|
|
59
|
+
left: 0,
|
|
60
|
+
top: 0,
|
|
61
|
+
display: "block",
|
|
62
|
+
pointerEvents: "none",
|
|
63
|
+
touchAction: "none"
|
|
64
|
+
},
|
|
65
|
+
children: e.map((e) => g("g", {
|
|
66
|
+
className: "shape-handle",
|
|
67
|
+
style: { "--shape-scale": _ },
|
|
68
|
+
children: [h("circle", {
|
|
69
|
+
cx: e.x,
|
|
70
|
+
cy: e.y,
|
|
71
|
+
r: v,
|
|
72
|
+
fill: "#ffc000",
|
|
73
|
+
stroke: "#7f6000",
|
|
74
|
+
strokeWidth: 1 / _,
|
|
75
|
+
style: { pointerEvents: "none" }
|
|
76
|
+
}), h("circle", {
|
|
77
|
+
className: "shape-handle-hit",
|
|
78
|
+
cx: e.x,
|
|
79
|
+
cy: e.y,
|
|
80
|
+
r: v,
|
|
81
|
+
fill: "transparent",
|
|
82
|
+
style: {
|
|
83
|
+
pointerEvents: "all",
|
|
84
|
+
cursor: "crosshair",
|
|
85
|
+
touchAction: "none"
|
|
86
|
+
},
|
|
87
|
+
onPointerDown: (t) => u(t, e.index),
|
|
88
|
+
onPointerMove: d,
|
|
89
|
+
onPointerUp: f,
|
|
90
|
+
onPointerCancel: te,
|
|
91
|
+
onMouseDown: (e) => e.stopPropagation()
|
|
92
|
+
})]
|
|
93
|
+
}, e.index))
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
re.displayName = "ShapeHandles";
|
|
97
|
+
var y = (e, t) => e > 0 || t > 0, b = (e, t, n) => !e || e.getWidth() === t && e.getHeight() === n ? e : y(t, n) ? e.resize(t, n) : null, ie = (e) => {
|
|
98
|
+
let t = [];
|
|
99
|
+
return e.forEachConnection((e) => t.push(e)), t;
|
|
100
|
+
}, x = c(s((s, c) => {
|
|
101
|
+
let { children: x, disabled: S, style: ae, shape: C, movable: w, zoom: T = 1, isDragging: oe, onHide: se, onShow: ce, onDragZone: le, adornmentHost: ue, flip: de, gesture: E, debugGeometry: fe = !1, ...pe } = s, D = t()?.getStyles() ?? null, [me, O] = f((e) => e + 1, 0);
|
|
102
|
+
e(C, { onAnyChange: O }), e(w ?? null, {
|
|
103
|
+
onBoundsChange: O,
|
|
104
|
+
onSelectionChange: O
|
|
105
|
+
});
|
|
106
|
+
let k = C.toJSON(), { width: A, height: j, rotation: he, content: M } = i(w), N = C.getShapeType(), ge = C.getAdjustments(), P = y(A, j), [F, I] = m(null), L = p(0);
|
|
107
|
+
u(() => {
|
|
108
|
+
if (!P) return void I(null);
|
|
109
|
+
let e = ++L.current, t = C.getShapeType();
|
|
110
|
+
C.getGeometry(A, j).then((n) => {
|
|
111
|
+
L.current === e && I(n ? {
|
|
112
|
+
shapeType: t,
|
|
113
|
+
geometry: n
|
|
114
|
+
} : null);
|
|
115
|
+
}, () => {
|
|
116
|
+
L.current === e && I(null);
|
|
117
|
+
});
|
|
118
|
+
}, [
|
|
119
|
+
C,
|
|
120
|
+
A,
|
|
121
|
+
j,
|
|
122
|
+
me
|
|
123
|
+
]);
|
|
124
|
+
let R = M?.shapeType !== void 0 && M.shapeType !== N ? M.shapeType : null, [z, _e] = m(null);
|
|
125
|
+
u(() => {
|
|
126
|
+
if (!R || !P || z?.shapeType === R) return;
|
|
127
|
+
let e = !0;
|
|
128
|
+
return C.getGeometry(A, j, { shapeType: R }).then((t) => {
|
|
129
|
+
e && t && _e({
|
|
130
|
+
shapeType: R,
|
|
131
|
+
geometry: t
|
|
132
|
+
});
|
|
133
|
+
}, () => {}), () => {
|
|
134
|
+
e = !1;
|
|
135
|
+
};
|
|
136
|
+
}, [
|
|
137
|
+
C,
|
|
138
|
+
R,
|
|
139
|
+
P
|
|
140
|
+
]);
|
|
141
|
+
let B = d(() => {
|
|
142
|
+
let e = F?.shapeType === N ? F : z?.shapeType === N ? z : null;
|
|
143
|
+
return e ? b(e.geometry, A, j)?.withAdjustments(ge) ?? null : b(F?.geometry ?? null, A, j);
|
|
144
|
+
}, [
|
|
145
|
+
F,
|
|
146
|
+
z,
|
|
147
|
+
N,
|
|
148
|
+
ge,
|
|
149
|
+
A,
|
|
150
|
+
j
|
|
151
|
+
]), ve = l((e) => C.getResource(e), [C]);
|
|
152
|
+
u(() => {
|
|
153
|
+
let e = [];
|
|
154
|
+
for (let t = w?.getParent() ?? null; t; t = t.getParent()) e.push(t.getContent().addListeners({ onAnyChange: O }));
|
|
155
|
+
return () => {
|
|
156
|
+
for (let t of e) t();
|
|
157
|
+
};
|
|
158
|
+
}, [w]);
|
|
159
|
+
let V = a(w), H = d(() => o(k, D, ve, V), [
|
|
160
|
+
k,
|
|
161
|
+
D,
|
|
162
|
+
ve,
|
|
163
|
+
V
|
|
164
|
+
]), [ye, U] = m(null), W = M?.adjustments === void 0 ? ye ?? void 0 : M.adjustments, G = d(() => {
|
|
165
|
+
if (R && z?.shapeType !== R) return B;
|
|
166
|
+
let e = R ? b(z.geometry, A, j) : B;
|
|
167
|
+
return e && W !== void 0 ? e.withAdjustments(W) : e;
|
|
168
|
+
}, [
|
|
169
|
+
B,
|
|
170
|
+
R,
|
|
171
|
+
z,
|
|
172
|
+
A,
|
|
173
|
+
j,
|
|
174
|
+
W
|
|
175
|
+
]), K = p(null), [be, q] = m(!1), xe = l((e, t, n, r) => {
|
|
176
|
+
if (r === "cancel") return K.current && (K.current = null, q(!1), E?.cancel()), void U(null);
|
|
177
|
+
if (!G || !B) return;
|
|
178
|
+
let i = G.adjustmentsFromHandle(e, t, n);
|
|
179
|
+
if (r === "move") {
|
|
180
|
+
if (E && !S) {
|
|
181
|
+
if (!K.current) {
|
|
182
|
+
let e = { adjustments: i };
|
|
183
|
+
if (!E.start(te("op.setShapeAdjustments"), (t) => {
|
|
184
|
+
t.getContent().setAdjustments(e.adjustments);
|
|
185
|
+
})) return;
|
|
186
|
+
K.current = e, q(!0);
|
|
187
|
+
}
|
|
188
|
+
K.current.adjustments = i, E.preview({ content: { adjustments: i } });
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
U(i);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
let a = K.current;
|
|
195
|
+
if (a) return K.current = null, q(!1), a.adjustments = i, void E?.finish();
|
|
196
|
+
U(null), S || C.setAdjustments(i);
|
|
197
|
+
}, [
|
|
198
|
+
G,
|
|
199
|
+
B,
|
|
200
|
+
C,
|
|
201
|
+
S,
|
|
202
|
+
E
|
|
203
|
+
]), Se = d(() => {
|
|
204
|
+
let e = [];
|
|
205
|
+
return G?.forEachHandle((t) => e.push(t)), e;
|
|
206
|
+
}, [G]), Ce = v(c, () => ({ isShapeEditor: () => !0 }), []), we = de ?? w?.getFlip(), J = we?.horizontal ?? !1, Y = we?.vertical ?? !1, Te = he % 360 != 0, Ee = d(() => !Te && y(A, j) ? {
|
|
207
|
+
dpr: _.getDevicePixelRatio(),
|
|
208
|
+
zoom: T,
|
|
209
|
+
width: A,
|
|
210
|
+
height: j,
|
|
211
|
+
flipH: J,
|
|
212
|
+
flipV: Y
|
|
213
|
+
} : null, [
|
|
214
|
+
Te,
|
|
215
|
+
T,
|
|
216
|
+
A,
|
|
217
|
+
j,
|
|
218
|
+
J,
|
|
219
|
+
Y
|
|
220
|
+
]);
|
|
221
|
+
if (C.isDeleted() || !k) return null;
|
|
222
|
+
let X = ae?.pointerEvents === "none", De = X ? "none" : "visiblePainted", Oe = !X && !S && (!oe || be) && !!w?.isSelected(), ke = {
|
|
223
|
+
transform: J || Y ? `scale(${J ? -1 : 1}, ${Y ? -1 : 1})` : void 0,
|
|
224
|
+
transformOrigin: "center"
|
|
225
|
+
}, Z = null;
|
|
226
|
+
Oe && Se.length > 0 && (Z = h(re, {
|
|
227
|
+
handles: Se,
|
|
228
|
+
width: A,
|
|
229
|
+
height: j,
|
|
230
|
+
zoom: T,
|
|
231
|
+
onDrag: xe
|
|
232
|
+
}), ue && (Z = ne(h("div", {
|
|
233
|
+
className: "shape-adornment",
|
|
234
|
+
style: {
|
|
235
|
+
position: "absolute",
|
|
236
|
+
left: 0,
|
|
237
|
+
top: 0,
|
|
238
|
+
width: "100%",
|
|
239
|
+
height: "100%",
|
|
240
|
+
...ke,
|
|
241
|
+
pointerEvents: "none"
|
|
242
|
+
},
|
|
243
|
+
children: Z
|
|
244
|
+
}), ue)));
|
|
245
|
+
let Ae = J === Y ? void 0 : "scaleX(-1)", Q = G?.getTextRect(), $ = k.text, je = !!$ && $.paragraphs.some((e) => e.runs.some((e) => e.text !== ""));
|
|
246
|
+
return g("div", {
|
|
247
|
+
className: "shape-editor",
|
|
248
|
+
...pe,
|
|
249
|
+
ref: Ce,
|
|
250
|
+
style: {
|
|
251
|
+
width: "100%",
|
|
252
|
+
height: "100%",
|
|
253
|
+
position: "relative",
|
|
254
|
+
overflow: "visible",
|
|
255
|
+
filter: S ? "blur(1px)" : void 0,
|
|
256
|
+
...ke,
|
|
257
|
+
...ae,
|
|
258
|
+
pointerEvents: "none"
|
|
259
|
+
},
|
|
260
|
+
children: [
|
|
261
|
+
y(A, j) ? g("svg", {
|
|
262
|
+
className: "shape-geometry",
|
|
263
|
+
viewBox: `0 0 ${A > 0 ? A : 1 / T} ${j > 0 ? j : 1 / T}`,
|
|
264
|
+
width: A > 0 ? "100%" : "1px",
|
|
265
|
+
height: j > 0 ? "100%" : "1px",
|
|
266
|
+
preserveAspectRatio: "none",
|
|
267
|
+
overflow: "visible",
|
|
268
|
+
style: {
|
|
269
|
+
position: "absolute",
|
|
270
|
+
left: 0,
|
|
271
|
+
top: 0,
|
|
272
|
+
display: "block",
|
|
273
|
+
pointerEvents: "none",
|
|
274
|
+
filter: Oe ? "drop-shadow(1px 1px 2px rgba(0,0,0,.15))" : void 0
|
|
275
|
+
},
|
|
276
|
+
children: [G ? h(ee, {
|
|
277
|
+
geometry: G,
|
|
278
|
+
style: H,
|
|
279
|
+
zoom: T,
|
|
280
|
+
grid: Ee,
|
|
281
|
+
hit: De
|
|
282
|
+
}) : null, fe && G && Q ? g("g", {
|
|
283
|
+
pointerEvents: "none",
|
|
284
|
+
children: [h("rect", {
|
|
285
|
+
x: Q.l,
|
|
286
|
+
y: Q.t,
|
|
287
|
+
width: Math.max(0, Q.r - Q.l),
|
|
288
|
+
height: Math.max(0, Q.b - Q.t),
|
|
289
|
+
fill: "none",
|
|
290
|
+
stroke: "#c00",
|
|
291
|
+
strokeWidth: 1 / T,
|
|
292
|
+
strokeDasharray: `${4 / T} ${2 / T}`
|
|
293
|
+
}), ie(G).map((e) => h("rect", {
|
|
294
|
+
x: e.x - 3 / T,
|
|
295
|
+
y: e.y - 3 / T,
|
|
296
|
+
width: 6 / T,
|
|
297
|
+
height: 6 / T,
|
|
298
|
+
fill: "#0a0"
|
|
299
|
+
}, e.index))]
|
|
300
|
+
}) : null]
|
|
301
|
+
}) : null,
|
|
302
|
+
je && Q ? h("div", {
|
|
303
|
+
className: "shape-text-frame",
|
|
304
|
+
style: {
|
|
305
|
+
position: "absolute",
|
|
306
|
+
left: Q.l,
|
|
307
|
+
top: Q.t,
|
|
308
|
+
width: Math.max(0, Q.r - Q.l),
|
|
309
|
+
height: Math.max(0, Q.b - Q.t),
|
|
310
|
+
zoom: T,
|
|
311
|
+
transform: Ae,
|
|
312
|
+
transformOrigin: "center",
|
|
313
|
+
pointerEvents: X ? "none" : "auto",
|
|
314
|
+
color: H.textColor ?? void 0
|
|
315
|
+
},
|
|
316
|
+
children: h(n, {
|
|
317
|
+
movable: w,
|
|
318
|
+
disabled: !0,
|
|
319
|
+
style: {
|
|
320
|
+
fontFamily: "Calibri, Carlito, sans-serif",
|
|
321
|
+
fontSize: "11pt",
|
|
322
|
+
lineHeight: 1.2,
|
|
323
|
+
padding: 0
|
|
324
|
+
},
|
|
325
|
+
contentStyle: {
|
|
326
|
+
padding: 0,
|
|
327
|
+
overflow: "hidden"
|
|
328
|
+
},
|
|
329
|
+
children: h(r, {
|
|
330
|
+
text: $,
|
|
331
|
+
styles: D,
|
|
332
|
+
color: H.textColor
|
|
333
|
+
})
|
|
334
|
+
})
|
|
335
|
+
}) : null,
|
|
336
|
+
Z
|
|
337
|
+
]
|
|
338
|
+
});
|
|
339
|
+
}));
|
|
340
|
+
x.displayName = "ShapeEditor";
|
|
341
|
+
export { x as t };
|
|
@@ -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.14
|
|
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 { n as e } from "./
|
|
7
|
+
import { n as e } from "./B1mBZyt2eP2CpVwp.mjs";
|
|
8
8
|
import { ChartEditor as t } from "./chart.mjs";
|
|
9
9
|
import { jsx as n } from "react/jsx-runtime";
|
|
10
10
|
import { messageKey as r, t as i } from "@sheetxl/utils";
|
package/browser/esm/chart.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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.14
|
|
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 { i as e, n as t, t as n } from "./
|
|
8
|
-
import { t as r } from "./
|
|
7
|
+
import { i as e, n as t, t as n } from "./nm3DZw1nJMIh89Dx.mjs";
|
|
8
|
+
import { t as r } from "./K9YyKehkJlT3axZh.mjs";
|
|
9
9
|
import { forwardRef as i, memo as a, useCallback as o, useLayoutEffect as s, useRef as c } from "react";
|
|
10
10
|
import { jsx as l } from "react/jsx-runtime";
|
|
11
11
|
import { useImperativeElement as u } from "@sheetxl/utils-react";
|
package/browser/esm/control.mjs
CHANGED
|
@@ -1,47 +1,48 @@
|
|
|
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.14
|
|
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 { t as e } from "./
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
7
|
+
import { t as e } from "./C6TgQuQt88nz0-jL.mjs";
|
|
8
|
+
import { IFont as t } from "@sheetxl/sdk";
|
|
9
|
+
import { memo as n, useEffect as r, useReducer as i, useRef as a } from "react";
|
|
10
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
11
|
+
var c = (e) => {
|
|
12
|
+
let n = e.getFont();
|
|
13
|
+
if (!n) return {};
|
|
14
|
+
let r = {};
|
|
15
|
+
return n.name && (r.fontFamily = t.toCSSFontFamily(n.name)), n.size !== void 0 && (r.fontSize = `${n.size}pt`), n.bold && (r.fontWeight = "bold"), n.italic && (r.fontStyle = "italic"), n.color && (r.color = n.color), r;
|
|
16
|
+
}, l = {
|
|
16
17
|
pointerEvents: "none",
|
|
17
18
|
width: "100%",
|
|
18
19
|
height: "100%",
|
|
19
20
|
boxSizing: "border-box",
|
|
20
21
|
margin: 0
|
|
21
|
-
},
|
|
22
|
-
...
|
|
22
|
+
}, u = {
|
|
23
|
+
...l,
|
|
23
24
|
display: "flex",
|
|
24
25
|
alignItems: "center",
|
|
25
26
|
gap: "0.35em",
|
|
26
27
|
padding: "0 2px",
|
|
27
28
|
overflow: "hidden",
|
|
28
29
|
whiteSpace: "nowrap"
|
|
29
|
-
},
|
|
30
|
-
let s =
|
|
31
|
-
let { children:
|
|
30
|
+
}, d = (t, a) => {
|
|
31
|
+
let s = n((n) => {
|
|
32
|
+
let { children: a, disabled: s, style: c, movable: u, zoom: d = 1, isDragging: f, onHide: p, onShow: m, onDragZone: h, adornmentHost: g, flip: _, ...v } = n, y = u.getContent(), [, b] = i((e) => e + 1, 0);
|
|
32
33
|
e(y, { onAnyChange() {
|
|
33
34
|
b();
|
|
34
35
|
} });
|
|
35
36
|
let x = y, S = y, C = x.getLinkedCell?.() ?? null;
|
|
36
|
-
|
|
37
|
+
r(() => {
|
|
37
38
|
if (C) return x.getLinkedRange?.()?.addListener(() => b(), { ignoreAddressChanges: !0 });
|
|
38
39
|
}, [y, C]);
|
|
39
40
|
let w = S.getListFillRange?.() ?? null;
|
|
40
|
-
if (
|
|
41
|
+
if (r(() => {
|
|
41
42
|
if (w) return S.getListSourceRange?.()?.addListener(() => b(), { ignoreAddressChanges: !0 });
|
|
42
43
|
}, [y, w]), y.isDeleted()) return null;
|
|
43
44
|
let T = u.getBounds();
|
|
44
|
-
return
|
|
45
|
+
return o("div", {
|
|
45
46
|
className: "form-control-renderer",
|
|
46
47
|
...v,
|
|
47
48
|
style: {
|
|
@@ -51,12 +52,12 @@ var s = (e) => {
|
|
|
51
52
|
position: "relative",
|
|
52
53
|
boxShadow: f ? "1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))" : void 0,
|
|
53
54
|
overflow: "hidden",
|
|
54
|
-
...
|
|
55
|
+
...c
|
|
55
56
|
},
|
|
56
|
-
children:
|
|
57
|
+
children: o("div", {
|
|
57
58
|
inert: !0,
|
|
58
|
-
style:
|
|
59
|
-
children:
|
|
59
|
+
style: l,
|
|
60
|
+
children: o(t, {
|
|
60
61
|
control: y,
|
|
61
62
|
width: T?.width ?? 0,
|
|
62
63
|
height: T?.height ?? 0
|
|
@@ -64,44 +65,44 @@ var s = (e) => {
|
|
|
64
65
|
})
|
|
65
66
|
});
|
|
66
67
|
});
|
|
67
|
-
return s.displayName =
|
|
68
|
-
},
|
|
68
|
+
return s.displayName = a, s;
|
|
69
|
+
}, f = d(({ control: e }) => o("button", {
|
|
69
70
|
type: "button",
|
|
70
71
|
tabIndex: -1,
|
|
71
72
|
style: {
|
|
72
|
-
...
|
|
73
|
-
...
|
|
73
|
+
...l,
|
|
74
|
+
...c(e)
|
|
74
75
|
},
|
|
75
76
|
children: e.getCaption() ?? ""
|
|
76
|
-
}), "ButtonRenderer"),
|
|
77
|
-
let t =
|
|
78
|
-
return
|
|
79
|
-
t.current && (t.current.indeterminate =
|
|
80
|
-
}, [
|
|
77
|
+
}), "ButtonRenderer"), p = d(({ control: e }) => {
|
|
78
|
+
let t = a(null), n = e.isMixed();
|
|
79
|
+
return r(() => {
|
|
80
|
+
t.current && (t.current.indeterminate = n);
|
|
81
|
+
}, [n]), s("label", {
|
|
81
82
|
style: {
|
|
82
|
-
...
|
|
83
|
-
...
|
|
83
|
+
...u,
|
|
84
|
+
...c(e)
|
|
84
85
|
},
|
|
85
|
-
children: [
|
|
86
|
+
children: [o("input", {
|
|
86
87
|
ref: t,
|
|
87
88
|
type: "checkbox",
|
|
88
89
|
checked: e.isChecked(),
|
|
89
90
|
readOnly: !0
|
|
90
|
-
}),
|
|
91
|
+
}), o("span", { children: e.getCaption() ?? "" })]
|
|
91
92
|
});
|
|
92
|
-
}, "CheckBoxRenderer"),
|
|
93
|
+
}, "CheckBoxRenderer"), m = d(({ control: e }) => s("label", {
|
|
93
94
|
style: {
|
|
94
|
-
...
|
|
95
|
-
...
|
|
95
|
+
...u,
|
|
96
|
+
...c(e)
|
|
96
97
|
},
|
|
97
|
-
children: [
|
|
98
|
+
children: [o("input", {
|
|
98
99
|
type: "radio",
|
|
99
100
|
checked: e.isChecked(),
|
|
100
101
|
readOnly: !0
|
|
101
|
-
}),
|
|
102
|
-
}), "OptionButtonRenderer"),
|
|
102
|
+
}), o("span", { children: e.getCaption() ?? "" })]
|
|
103
|
+
}), "OptionButtonRenderer"), h = d(({ control: e }) => {
|
|
103
104
|
let t = e.isHorizontal();
|
|
104
|
-
return
|
|
105
|
+
return o("input", {
|
|
105
106
|
type: "range",
|
|
106
107
|
tabIndex: -1,
|
|
107
108
|
readOnly: !0,
|
|
@@ -110,18 +111,18 @@ var s = (e) => {
|
|
|
110
111
|
step: e.getIncrement() ?? 1,
|
|
111
112
|
value: e.getValue() ?? e.getMin() ?? 0,
|
|
112
113
|
style: {
|
|
113
|
-
...
|
|
114
|
+
...l,
|
|
114
115
|
writingMode: t ? void 0 : "vertical-lr"
|
|
115
116
|
}
|
|
116
117
|
});
|
|
117
|
-
}, "ScrollBarRenderer"),
|
|
118
|
+
}, "ScrollBarRenderer"), g = (e) => {
|
|
118
119
|
let t = {
|
|
119
120
|
up: "2,7 5,4 8,7",
|
|
120
121
|
down: "2,3 5,6 8,3",
|
|
121
122
|
left: "7,2 4,5 7,8",
|
|
122
123
|
right: "3,2 6,5 3,8"
|
|
123
124
|
}[e.direction];
|
|
124
|
-
return
|
|
125
|
+
return o("svg", {
|
|
125
126
|
viewBox: "0 0 10 10",
|
|
126
127
|
style: {
|
|
127
128
|
width: "100%",
|
|
@@ -129,14 +130,14 @@ var s = (e) => {
|
|
|
129
130
|
maxWidth: 10,
|
|
130
131
|
maxHeight: 10
|
|
131
132
|
},
|
|
132
|
-
children:
|
|
133
|
+
children: o("polyline", {
|
|
133
134
|
points: t,
|
|
134
135
|
fill: "none",
|
|
135
136
|
stroke: "currentColor",
|
|
136
137
|
strokeWidth: 1.5
|
|
137
138
|
})
|
|
138
139
|
});
|
|
139
|
-
},
|
|
140
|
+
}, _ = {
|
|
140
141
|
flex: "1 1 0",
|
|
141
142
|
minWidth: 0,
|
|
142
143
|
minHeight: 0,
|
|
@@ -145,64 +146,64 @@ var s = (e) => {
|
|
|
145
146
|
display: "flex",
|
|
146
147
|
alignItems: "center",
|
|
147
148
|
justifyContent: "center"
|
|
148
|
-
},
|
|
149
|
+
}, v = d(({ width: e, height: t }) => {
|
|
149
150
|
let n = ((e, t, n) => e > 0 && t > 0 ? e > t : n)(e, t, !1);
|
|
150
|
-
return
|
|
151
|
+
return s("div", {
|
|
151
152
|
style: {
|
|
152
|
-
...
|
|
153
|
+
...l,
|
|
153
154
|
display: "flex",
|
|
154
155
|
flexDirection: n ? "row" : "column"
|
|
155
156
|
},
|
|
156
|
-
children: [
|
|
157
|
+
children: [o("button", {
|
|
157
158
|
type: "button",
|
|
158
159
|
tabIndex: -1,
|
|
159
|
-
style:
|
|
160
|
-
children:
|
|
161
|
-
}),
|
|
160
|
+
style: _,
|
|
161
|
+
children: o(g, { direction: n ? "left" : "up" })
|
|
162
|
+
}), o("button", {
|
|
162
163
|
type: "button",
|
|
163
164
|
tabIndex: -1,
|
|
164
|
-
style:
|
|
165
|
-
children:
|
|
165
|
+
style: _,
|
|
166
|
+
children: o(g, { direction: n ? "right" : "down" })
|
|
166
167
|
})]
|
|
167
168
|
});
|
|
168
|
-
}, "SpinnerRenderer"),
|
|
169
|
+
}, "SpinnerRenderer"), y = (e) => e.getListItems().map((e, t) => o("option", {
|
|
169
170
|
value: t,
|
|
170
171
|
children: e
|
|
171
|
-
}, t)),
|
|
172
|
+
}, t)), b = d(({ control: e }) => s("select", {
|
|
172
173
|
tabIndex: -1,
|
|
173
174
|
value: e.getSelectedIndex() ?? -1,
|
|
174
|
-
style:
|
|
175
|
+
style: l,
|
|
175
176
|
onChange: () => {},
|
|
176
|
-
children: [e.getSelectedIndex() === null ?
|
|
177
|
-
}), "DropDownRenderer"),
|
|
177
|
+
children: [e.getSelectedIndex() === null ? o("option", { value: -1 }) : null, y(e)]
|
|
178
|
+
}), "DropDownRenderer"), x = d(({ control: e }) => o("select", {
|
|
178
179
|
tabIndex: -1,
|
|
179
180
|
size: Math.max(2, e.getListItems().length),
|
|
180
181
|
value: e.getSelectedIndex() ?? void 0,
|
|
181
|
-
style:
|
|
182
|
+
style: l,
|
|
182
183
|
onChange: () => {},
|
|
183
|
-
children:
|
|
184
|
-
}), "ListBoxRenderer"),
|
|
184
|
+
children: y(e)
|
|
185
|
+
}), "ListBoxRenderer"), S = d(({ control: e }) => o("fieldset", {
|
|
185
186
|
style: {
|
|
186
|
-
...
|
|
187
|
+
...l,
|
|
187
188
|
padding: 0,
|
|
188
|
-
...
|
|
189
|
+
...c(e)
|
|
189
190
|
},
|
|
190
|
-
children:
|
|
191
|
+
children: o("legend", {
|
|
191
192
|
style: {
|
|
192
193
|
marginLeft: "6px",
|
|
193
194
|
padding: "0 2px"
|
|
194
195
|
},
|
|
195
196
|
children: e.getCaption() ?? ""
|
|
196
197
|
})
|
|
197
|
-
}), "GroupBoxRenderer"),
|
|
198
|
+
}), "GroupBoxRenderer"), C = d(({ control: e }) => o("span", {
|
|
198
199
|
style: {
|
|
199
|
-
...
|
|
200
|
-
...
|
|
200
|
+
...u,
|
|
201
|
+
...c(e)
|
|
201
202
|
},
|
|
202
203
|
children: e.getCaption() ?? ""
|
|
203
|
-
}), "LabelRenderer"),
|
|
204
|
+
}), "LabelRenderer"), w = d(({ control: e }) => o("div", {
|
|
204
205
|
style: {
|
|
205
|
-
...
|
|
206
|
+
...l,
|
|
206
207
|
border: "var(--sxl-color-neutral, grey) solid 1px",
|
|
207
208
|
backgroundColor: "var(--sxl-color-base-100, white)",
|
|
208
209
|
display: "flex",
|
|
@@ -213,4 +214,4 @@ var s = (e) => {
|
|
|
213
214
|
},
|
|
214
215
|
children: e.getName?.() ?? e.getTypeDescription()
|
|
215
216
|
}), "UnmodeledControlRenderer");
|
|
216
|
-
export {
|
|
217
|
+
export { f as ButtonRenderer, p as CheckBoxRenderer, b as DropDownRenderer, S as GroupBoxRenderer, C as LabelRenderer, x as ListBoxRenderer, m as OptionButtonRenderer, h as ScrollBarRenderer, v as SpinnerRenderer, w as UnmodeledControlRenderer };
|
package/browser/esm/group.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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.14
|
|
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 { t as e } from "./
|
|
8
|
-
import { h as t, i as n, p as r } from "./
|
|
7
|
+
import { t as e } from "./C6TgQuQt88nz0-jL.mjs";
|
|
8
|
+
import { h as t, i as n, p as r } from "./CDf6czK5WuKJhq0y.mjs";
|
|
9
9
|
import { forwardRef as i, memo as a, useContext as o, useEffect as s, useReducer as c } from "react";
|
|
10
10
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
11
|
import { useSurfaceState as d } from "@sheetxl/grid-react";
|