@sheetxl/react 1.0.4 → 1.0.6
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/{B5I4vV_DP3EjMFOh.mjs → 4M1ime0lSMPwFdwq.mjs} +1 -1
- package/browser/esm/{B41IwWSVZSFBKWbl.mjs → 56NlLn16iTCMXWTn.mjs} +6 -6
- package/browser/esm/BBpLlCS6trF9IqY7.mjs +325 -0
- package/browser/esm/{DfPC75_EpLobRWyU.mjs → BCGOU0KEA92-tHXw.mjs} +5 -5
- package/browser/esm/{D9LWDuiSBP9TanuP.mjs → BPyvBK7c6TKRxVZb.mjs} +1 -1
- package/browser/esm/{Cy91S4xWoxd66-_0.mjs → BkkfkHsyalXv3k4Q.mjs} +1 -1
- package/browser/esm/{BCViSL9zpUH8tVsE.mjs → Bks84B7NgyzaBVv0.mjs} +1 -1
- package/browser/esm/{Vh1oaya1vexsM57z.mjs → Bl0-xYLr5UA_pMTT.mjs} +6 -6
- package/browser/esm/{Yzp80cMm3GyMSyGB.mjs → Bp-3XmIZb2fkqunF.mjs} +2 -2
- package/browser/esm/{sFi_HFLodIR0bKfI.mjs → C1luDkna9W7PNKrz.mjs} +1 -1
- package/browser/esm/{DrVUyngAZ439vUOV.mjs → CKYZvqAf2y2oAkB7.mjs} +1 -1
- package/browser/esm/{CclhdAtAI6HRaWjs.mjs → CsGmLR7d80u8xidY.mjs} +1 -1
- package/browser/esm/D20ReZZxs2JHIqXW.mjs +1681 -0
- package/browser/esm/{BhlDgb8_WVpUrXCE.mjs → D4OKTHNu7UroAOVB.mjs} +1 -1
- package/browser/esm/{2d3KRM4JSpo_wPqH.mjs → D9kzGjqEClI2OQO8.mjs} +1 -1
- package/browser/esm/{C257AeDQl6k6J19h.mjs → DAGQOiFH2fGWDOqj.mjs} +2 -2
- package/browser/esm/{BFUcvh3uC4U54r93.mjs → DBCT8TZn5tx3RRgu.mjs} +1 -1
- package/browser/esm/{CBACZ2nUHuOoDHLf.mjs → DIXBmbnM-qkL9ot2.mjs} +8 -6
- package/browser/esm/{DMVzoJFREEuE236r.mjs → DpQkiVYU6nJmsEXE.mjs} +3 -3
- package/browser/esm/{D2iNsoem4M78aLXn.mjs → Dq9OEmhDbQi90JyF.mjs} +3 -3
- package/browser/esm/{BDOdvxrpOY4gcCIl.mjs → Du_yTZVTH9ZhIwVz.mjs} +1 -1
- package/browser/esm/DzcsaJD62P_RrIgp.mjs +127 -0
- package/browser/esm/{Bs3j5q_SFWPRYcAj.mjs → OYfZSA6eTFsqp5MC.mjs} +1308 -1281
- package/browser/esm/{BIunYBnpZF-P8JFl.mjs → X9EpvcUhpbtf95sq.mjs} +1 -1
- package/browser/esm/{DO0HWpJD0WrboRDe.mjs → XkePaxnbmJijuUST.mjs} +1 -1
- package/browser/esm/chart.mjs +3 -3
- package/browser/esm/control.mjs +2 -2
- package/browser/esm/{lt-QhChnw2xCbjtV.mjs → dE1dGLDL9PIqTCiM.mjs} +73 -35
- package/browser/esm/group.mjs +3 -3
- package/browser/esm/index.mjs +8930 -9026
- package/browser/esm/note.mjs +4 -4
- package/browser/esm/{EJWEWelOH8yX7oez.mjs → pAnBA5Hy2mjpkAWB.mjs} +2 -2
- package/browser/esm/picture.mjs +2 -2
- package/browser/esm/shape.mjs +2 -2
- package/browser/esm/slicer.mjs +4 -4
- package/node/esm/{BZK8xNBGYCcvGYr-.mjs → BCTgV60zEAPoPG-u.mjs} +1 -1
- package/node/esm/{lAMyxp6V7Yamdtue.mjs → BRsrSOeAgAbh8LCL.mjs} +30 -28
- package/node/esm/BSYkbwvzEjg5tnyi.mjs +327 -0
- package/node/esm/BXCAuiepvo2pCMA6.mjs +177 -0
- package/node/esm/{DYAI1q7pZQijIEuk.mjs → Bf1ybiY9HNcds5_H.mjs} +1 -1
- package/node/esm/{BKe0zQV-NngKQLC6.mjs → BkT-mLvzP5h10mLU.mjs} +1 -1
- package/node/esm/{gXZTHKanG6sR8nJB.mjs → C-l3nPRIH0q_ucYX.mjs} +1 -1
- package/node/esm/{DMccpcT9DZhrCesw.mjs → C0syazJAmS6_LFTY.mjs} +5 -5
- package/node/esm/{0XJbNeNNSyYBMnWw.mjs → C3frF4D3I2rcLHK1.mjs} +1 -1
- package/node/esm/{Bvq6hR9TahHJQDSE.mjs → CIPjf-XhEAQufN0V.mjs} +1 -1
- package/node/esm/{wamMRABbIHPbB6TV.mjs → CJKhZu3BbJY3VsWH.mjs} +1 -1
- package/node/esm/CWoaMwpLSM7gBaVh.mjs +1681 -0
- package/node/esm/{xaiZuv1DcjoKGxuV.mjs → CcblOBJaE8U6tCWg.mjs} +1 -1
- package/node/esm/{EFIovoxkRAaNFoV2.mjs → D5UV0AjhZIYGotrV.mjs} +1 -1
- package/node/esm/{eRa_lhdJaHzyCbSo.mjs → D5rzzywf1R4MvJU0.mjs} +1 -1
- package/node/esm/{ChvRYQa8Z3QcAih_.mjs → DEH7X3vDYP518pp4.mjs} +1 -1
- package/node/esm/{BmwLJCwadUcJzm7_.mjs → DO7K3oDOoCZ4fpv-.mjs} +2 -2
- package/node/esm/{BMZIDcAXGazWv925.mjs → DnZ2zYP0QCJWioMW.mjs} +1 -1
- package/node/esm/{Bx4zBoy7r3wKhSfW.mjs → DrQEt2TfEEgKvYKL.mjs} +1 -1
- package/node/esm/{Drew11dteKH8ST2G.mjs → Dxv-9TQ2qdooz9VX.mjs} +347 -320
- package/node/esm/EvhDIPxbJ1B3lfrj.mjs +166 -0
- package/node/esm/{CHEbVdYUW8SqO1s1.mjs → KC9JU5CVeDBJ2aHR.mjs} +1 -1
- package/node/esm/{DS_Y37x1b6oFkuSX.mjs → WFBPS4qHr0sTxFmI.mjs} +1 -1
- package/node/esm/chart.mjs +2 -2
- package/node/esm/control.mjs +2 -2
- package/node/esm/group.mjs +3 -3
- package/node/esm/index.mjs +11035 -11128
- package/node/esm/note.mjs +4 -4
- package/node/esm/picture.mjs +5 -5
- package/node/esm/shape.mjs +6 -6
- package/node/esm/slicer.mjs +4 -4
- package/package.json +7 -7
- package/resources/contents.json +6 -0
- package/resources/locales/contents.json +14 -0
- package/resources/locales/de/cells.cmd.json +1589 -0
- package/resources/locales/de/chart.cmd.json +15 -0
- package/resources/locales/de/editor.cmd.json +8 -8
- package/resources/locales/de/movable.cmd.json +0 -8
- package/resources/locales/de/sheet.cmd.json +190 -1713
- package/resources/locales/de/ui.msg.json +67 -0
- package/resources/locales/en/cells.cmd.json +1602 -0
- package/resources/locales/en/chart.cmd.json +15 -0
- package/resources/locales/en/editor.cmd.json +8 -8
- package/resources/locales/en/movable.cmd.json +0 -8
- package/resources/locales/en/sheet.cmd.json +193 -1729
- package/resources/locales/en/ui.msg.json +67 -0
- package/types/src/chart/ChartCommands.d.ts +5 -3
- package/types/src/chart/ChartElement.d.ts +1 -1
- package/types/src/chart/PresetChartTypeDescriptors.d.ts +23 -2
- package/types/src/chart/_outlinePath.d.ts +17 -0
- package/types/src/chart/paint/_fills.d.ts +4 -1
- package/types/src/chart/paint/_graphics.d.ts +5 -2
- package/types/src/chart/paint/kinds/ChartPaintKind.d.ts +19 -5
- package/types/src/clipboard/ClipboardCommands.d.ts +16 -4
- package/types/src/commands/PaneScopeProvider.d.ts +2 -2
- package/types/src/editor/EditorCommands.d.ts +3 -3
- package/types/src/icons/chart/ChartIcons.d.ts +20 -0
- package/types/src/icons/chart/_ChartIconPack.d.ts +4 -0
- package/types/src/icons/chart/_chartIconKeys.d.ts +4 -0
- package/types/src/icons/chart/index.d.ts +1 -49
- package/types/src/index.d.ts +1 -0
- package/types/src/layer/MovableKindScope.d.ts +3 -2
- package/types/src/layer/MovableToolbar.d.ts +27 -0
- package/types/src/layer/RangeToolbar.d.ts +17 -4
- package/types/src/layer/SheetMovableLayer.d.ts +6 -0
- package/types/src/layer/ValidationDropdownLayer.d.ts +1 -1
- package/types/src/layer/index.d.ts +1 -0
- package/types/src/movable/MovableCommands.d.ts +8 -2
- package/types/src/movable/MovableLayer.d.ts +2 -0
- package/types/src/movable/MovableRenderers.d.ts +43 -1
- package/types/src/movable/_drawingFormat.d.ts +15 -0
- package/types/src/presence/PresenceCommands.d.ts +1 -1
- package/types/src/sheet/IWorksheetElement.d.ts +9 -0
- package/types/src/sheet/SheetCommandProvider.d.ts +17 -10
- package/types/src/sheet/SheetCommands.d.ts +17 -4
- package/types/src/taskPane/FormatPane.d.ts +46 -0
- package/types/src/taskPane/MovablePane.d.ts +8 -10
- package/types/src/taskPane/TaskPaneArea.d.ts +57 -2
- package/types/src/taskPane/TaskPaneEmpty.d.ts +14 -0
- package/types/src/taskPane/TaskPaneKeys.d.ts +8 -4
- package/types/src/taskPane/TaskPaneRegistry.d.ts +2 -1
- package/types/src/taskPane/TaskPaneStrip.d.ts +13 -2
- package/types/src/taskPane/_taskPaneHost.d.ts +9 -0
- package/types/src/taskPane/index.d.ts +2 -0
- package/types/src/taskPane/useTaskPane.d.ts +14 -18
- package/browser/esm/CNWfLXcWFeRPAr_J.mjs +0 -264
- package/node/esm/8ar-ImM_B3-FjI_A.mjs +0 -128
- package/node/esm/BwlokhQZotu1DmAO.mjs +0 -265
- package/types/src/icons/chart/ChartAreaIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartAreaStackedIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartAreaStackedPercentIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartBarIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartBarStackedIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartBarStackedPercentIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartBubble3DIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartBubbleIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartColumnIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartColumnStackedIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartColumnStackedPercentIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartLineIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartLineMarkersIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartLineStackedIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartLineStackedMarkersIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartLineStackedPercentIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartLineStackedPercentMarkersIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartPieDoughnutIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartPieIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartScatterLinesIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartScatterLinesMarkersIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartScatterLinesMarkersSmoothIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartScatterLinesSmoothIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartScatterMarkersIcon.d.ts +0 -5
- package/types/src/icons/chart/ChartWaterfallIcon.d.ts +0 -5
- package/types/src/icons/chart/ThemedChartIcon.d.ts +0 -20
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
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 { t as n } from "./
|
|
10
|
-
import { t as r } from "./
|
|
11
|
-
import { i, n as a, r as o, t as ee } from "./
|
|
7
|
+
import { t as e } from "./4M1ime0lSMPwFdwq.mjs";
|
|
8
|
+
import { n as t } from "./DBCT8TZn5tx3RRgu.mjs";
|
|
9
|
+
import { t as n } from "./Bks84B7NgyzaBVv0.mjs";
|
|
10
|
+
import { t as r } from "./X9EpvcUhpbtf95sq.mjs";
|
|
11
|
+
import { i, n as a, r as o, t as ee } from "./D4OKTHNu7UroAOVB.mjs";
|
|
12
12
|
import { forwardRef as s, memo as c, useCallback as l, useEffect as u, useMemo as d, useReducer as te, useRef as f, useState as p } from "react";
|
|
13
13
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
14
14
|
import { messageKey as ne } from "@sheetxl/utils";
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
|
+
*/
|
|
7
|
+
import { t as e } from "./C1luDkna9W7PNKrz.mjs";
|
|
8
|
+
import { createContext as t, forwardRef as n, memo as r, useCallback as i, useContext as a, useEffect as o, useId as s, useLayoutEffect as c, useRef as l, useState as u } from "react";
|
|
9
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
+
import { CommonUtils as p, defineLazyModule as m } from "@sheetxl/utils";
|
|
11
|
+
import { useImperativeElement as ee, useMeasure as te, usePendingRender as ne, usePersistentState as h, useResolvedThemeMode as g } from "@sheetxl/utils-react";
|
|
12
|
+
var _ = {
|
|
13
|
+
Mode: "themeMode",
|
|
14
|
+
DarkGrid: "enableDarkGrid",
|
|
15
|
+
DarkImages: "enableDarkImages"
|
|
16
|
+
}, v = {
|
|
17
|
+
[_.Mode]: null,
|
|
18
|
+
[_.DarkGrid]: !1,
|
|
19
|
+
[_.DarkImages]: !1
|
|
20
|
+
}, y = t(null);
|
|
21
|
+
y.displayName = "GridColorSchemeContext";
|
|
22
|
+
var b = (e) => {
|
|
23
|
+
let t = a(y), [n] = h(_.Mode, v[_.Mode]), [r] = h(_.DarkGrid, v[_.DarkGrid]), { themeMode: i } = g({ mode: e ?? n ?? void 0 });
|
|
24
|
+
return e ? e === "auto" ? i : e : t || (i === "dark" && r ? "dark" : "light");
|
|
25
|
+
}, x = (e) => {
|
|
26
|
+
let [t] = h(_.Mode, v[_.Mode]), { themeMode: n } = g({ mode: e ?? t ?? void 0 });
|
|
27
|
+
return n;
|
|
28
|
+
}, S = m("chart:paint", () => import("./OYfZSA6eTFsqp5MC.mjs")), C = (e) => String(Math.round(100 * e) / 100), w = (e) => `${C(e.x)} ${C(e.y)}`, T = (e, t, n) => {
|
|
29
|
+
let r = n * Math.PI / 180;
|
|
30
|
+
return {
|
|
31
|
+
x: e.x + t * Math.sin(r),
|
|
32
|
+
y: e.y - t * Math.cos(r)
|
|
33
|
+
};
|
|
34
|
+
}, E = (e, t, n) => {
|
|
35
|
+
let r = +!!n, i = w({
|
|
36
|
+
x: e.x - t,
|
|
37
|
+
y: e.y
|
|
38
|
+
}), a = w({
|
|
39
|
+
x: e.x + t,
|
|
40
|
+
y: e.y
|
|
41
|
+
});
|
|
42
|
+
return `M${i}A${C(t)} ${C(t)} 0 1 ${r} ${a}A${C(t)} ${C(t)} 0 1 ${r} ${i}Z`;
|
|
43
|
+
}, re = (e) => {
|
|
44
|
+
let { center: t, innerRadius: n, outerRadius: r, startAngle: i, endAngle: a } = e, o = a - i;
|
|
45
|
+
if (!(o > 0 && r > 0)) return "";
|
|
46
|
+
if (o >= 360) return E(t, r, !0) + (n > 0 ? E(t, n, !1) : "");
|
|
47
|
+
let s = +(o > 180), c = `M${w(T(t, r, i))}A${C(r)} ${C(r)} 0 ${s} 1 ${w(T(t, r, a))}`;
|
|
48
|
+
return n > 0 ? `${c}L${w(T(t, n, a))}A${C(n)} ${C(n)} 0 ${s} 0 ${w(T(t, n, i))}Z` : `${c}L${w(t)}Z`;
|
|
49
|
+
}, D = (e) => {
|
|
50
|
+
if (e.length < 3) return "";
|
|
51
|
+
let t = 0;
|
|
52
|
+
for (let n = 0; n < e.length; n++) {
|
|
53
|
+
let r = e[n], i = e[(n + 1) % e.length];
|
|
54
|
+
t += r.x * i.y - i.x * r.y;
|
|
55
|
+
}
|
|
56
|
+
return `M${(t >= 0 ? e : [...e].reverse()).map(w).join("L")}Z`;
|
|
57
|
+
}, O = (e) => {
|
|
58
|
+
let t = Math.min(e.x, e.x + e.width), n = Math.min(e.y, e.y + e.height);
|
|
59
|
+
return `M${C(t)} ${C(n)}h${C(Math.abs(e.width))}v${C(Math.abs(e.height))}h${C(-Math.abs(e.width))}Z`;
|
|
60
|
+
}, k = (e, t) => {
|
|
61
|
+
let n = e.getElementType();
|
|
62
|
+
if (n === "point") {
|
|
63
|
+
let n = e.getParent();
|
|
64
|
+
return t === n || t?.getElementType() === "point" && t.getParent() === n ? e : n;
|
|
65
|
+
}
|
|
66
|
+
if (n === "legendEntry") {
|
|
67
|
+
let n = e.getParent();
|
|
68
|
+
return t === n || t?.getElementType() === "legendEntry" ? e : n;
|
|
69
|
+
}
|
|
70
|
+
if (n === "dataLabel") {
|
|
71
|
+
let n = e.getParent()?.getParent(), r = n?.getDataLabels();
|
|
72
|
+
return r ? t === r || t?.getElementType() === "dataLabel" && t.getParent()?.getParent() === n ? e : r : e;
|
|
73
|
+
}
|
|
74
|
+
return e;
|
|
75
|
+
}, A = {
|
|
76
|
+
filled: "",
|
|
77
|
+
lines: []
|
|
78
|
+
}, ie = (e, t, n) => {
|
|
79
|
+
let r = [];
|
|
80
|
+
for (let i of n.getItems()) {
|
|
81
|
+
if (i.getChart() !== e) continue;
|
|
82
|
+
let n = e.getElementOutline(i, t);
|
|
83
|
+
n && r.push(...n);
|
|
84
|
+
}
|
|
85
|
+
return r.length > 0 ? ((e) => {
|
|
86
|
+
let t = "", n = [];
|
|
87
|
+
for (let r of e) switch (r.type) {
|
|
88
|
+
case "rect":
|
|
89
|
+
t += O(r);
|
|
90
|
+
break;
|
|
91
|
+
case "circle":
|
|
92
|
+
r.radius > 0 && (t += E(r.center, r.radius, !0));
|
|
93
|
+
break;
|
|
94
|
+
case "sector":
|
|
95
|
+
t += re(r);
|
|
96
|
+
break;
|
|
97
|
+
case "polygon":
|
|
98
|
+
t += D(r.points);
|
|
99
|
+
break;
|
|
100
|
+
case "line": r.points.length > 1 && n.push({
|
|
101
|
+
d: `M${r.points.map(w).join("L")}${r.closed ? "Z" : ""}`,
|
|
102
|
+
width: r.width
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
filled: t,
|
|
107
|
+
lines: n
|
|
108
|
+
};
|
|
109
|
+
})(r) : A;
|
|
110
|
+
}, j = r(n((t, n) => {
|
|
111
|
+
let { children: r, style: a, chart: m, onChartChange: h, zoom: g = 1, width: _, height: v, selection: y = null, colorScheme: b, onElementPress: C, onPointerDown: w, ...T } = t, [E, re] = u(() => p.isPromiseLike(m) ? null : m), [D, O] = u(null), j = l(h);
|
|
112
|
+
j.current = h;
|
|
113
|
+
let M = l(null);
|
|
114
|
+
o(() => {
|
|
115
|
+
let e = !0, t = (e, t) => {
|
|
116
|
+
O(t), re(e), M.current !== e && (M.current = e, j.current?.(e));
|
|
117
|
+
};
|
|
118
|
+
if (p.isPromiseLike(m)) return m.then((n) => {
|
|
119
|
+
e && t(n, null);
|
|
120
|
+
}, (n) => {
|
|
121
|
+
e && t(null, n);
|
|
122
|
+
}), () => {
|
|
123
|
+
e = !1;
|
|
124
|
+
};
|
|
125
|
+
t(m, null);
|
|
126
|
+
}, [m]);
|
|
127
|
+
let [ae, N] = te(), P = typeof _ == "number" ? _ : N.width, F = typeof v == "number" ? v : N.height, I = P ? Math.round(P / g) : 0, L = F ? Math.round(F / g) : 0, R = l({
|
|
128
|
+
width: I,
|
|
129
|
+
height: L
|
|
130
|
+
});
|
|
131
|
+
R.current = {
|
|
132
|
+
width: I,
|
|
133
|
+
height: L
|
|
134
|
+
};
|
|
135
|
+
let oe = x(), z = (b ?? oe) === "dark", B = i(async (e) => {
|
|
136
|
+
let t = R.current;
|
|
137
|
+
if (!E || !t.width || !t.height) return null;
|
|
138
|
+
let n = E.getLayout(t);
|
|
139
|
+
return n ? (await S.load()).renderChartToSVG(n, { darkMode: e?.darkMode ?? !1 }) : null;
|
|
140
|
+
}, [E]), V = l(null), H = l(null), U = l(g);
|
|
141
|
+
U.current = g;
|
|
142
|
+
let W = i((e, t) => {
|
|
143
|
+
let n = V.current;
|
|
144
|
+
if (!n) return null;
|
|
145
|
+
let r = n.getBoundingClientRect(), i = U.current || 1;
|
|
146
|
+
return {
|
|
147
|
+
x: (e - r.left) / i,
|
|
148
|
+
y: (t - r.top) / i
|
|
149
|
+
};
|
|
150
|
+
}, []), G = i((e, t) => {
|
|
151
|
+
let n = H.current, r = W(e, t);
|
|
152
|
+
return E && n && r ? E.getElementAt(r, n) : null;
|
|
153
|
+
}, [E, W]), se = ee(n, () => ({
|
|
154
|
+
isChartElement: () => !0,
|
|
155
|
+
getChart: () => E,
|
|
156
|
+
toSVG: B,
|
|
157
|
+
getElementAt: G
|
|
158
|
+
}), [
|
|
159
|
+
E,
|
|
160
|
+
B,
|
|
161
|
+
G
|
|
162
|
+
]), ce = e([
|
|
163
|
+
se,
|
|
164
|
+
ae,
|
|
165
|
+
V
|
|
166
|
+
]), K = l(null), q = l(null), [J, le] = u(() => S.peek() ?? null), [Y, ue] = u(null), [de, fe] = u(0), [X, pe] = u(A), Z = `sxl-chart-outline-${s().replace(/[^a-zA-Z0-9_-]/g, "")}`;
|
|
167
|
+
o(() => E?.addListeners({ onLayoutChange: () => fe((e) => e + 1) }), [E]), ne(!(Y || D || J && E)), o(() => {
|
|
168
|
+
if (J) return;
|
|
169
|
+
let e = !0;
|
|
170
|
+
return S.load().then((t) => {
|
|
171
|
+
e && le(t);
|
|
172
|
+
}, (t) => {
|
|
173
|
+
e && ue(t);
|
|
174
|
+
}), () => {
|
|
175
|
+
e = !1;
|
|
176
|
+
};
|
|
177
|
+
}, [J]);
|
|
178
|
+
let Q = i(() => {
|
|
179
|
+
let e = H.current;
|
|
180
|
+
pe(E && e && y && !y.isEmpty() ? ie(E, e, y) : A);
|
|
181
|
+
}, [E, y]);
|
|
182
|
+
o(() => y?.addListeners({ onChange: Q }), [y, Q]), c(() => {
|
|
183
|
+
let e = K.current;
|
|
184
|
+
if (!(J && e && E && I && L)) return;
|
|
185
|
+
let t = E.getLayout({
|
|
186
|
+
width: I,
|
|
187
|
+
height: L
|
|
188
|
+
});
|
|
189
|
+
if (H.current = t, !t) return q.current?.dispose(), q.current = null, e.style.backgroundColor = "", void Q();
|
|
190
|
+
let n = t.chartArea.fill === void 0;
|
|
191
|
+
e.style.backgroundColor = n ? `var(--sxl-color-base-100, ${z ? "#121212" : "#FFFFFF"})` : "", e.style.borderRadius = n ? `${t.chartArea.cornerRadius}px` : "";
|
|
192
|
+
let r = {
|
|
193
|
+
darkMode: z,
|
|
194
|
+
background: "transparent"
|
|
195
|
+
};
|
|
196
|
+
q.current ? q.current.update(t, r) : q.current = J.mountChart(e, t, r), Q();
|
|
197
|
+
}, [
|
|
198
|
+
J,
|
|
199
|
+
E,
|
|
200
|
+
I,
|
|
201
|
+
L,
|
|
202
|
+
de,
|
|
203
|
+
z,
|
|
204
|
+
Q
|
|
205
|
+
]), o(() => () => {
|
|
206
|
+
q.current?.dispose(), q.current = null, H.current = null;
|
|
207
|
+
}, [E]);
|
|
208
|
+
let me = i((e) => {
|
|
209
|
+
if (w?.(e), e.button !== 0 && e.button !== 2) return;
|
|
210
|
+
let t = H.current, n = W(e.clientX, e.clientY);
|
|
211
|
+
if (!E || !t || !n) return;
|
|
212
|
+
let r = E.getElementAt(n, t);
|
|
213
|
+
if (C?.({
|
|
214
|
+
element: r,
|
|
215
|
+
point: n,
|
|
216
|
+
event: e
|
|
217
|
+
}), !y) return;
|
|
218
|
+
if (!r || r.getElementType() === "chartArea") return void y.clear();
|
|
219
|
+
let i = k(r, y.getActive());
|
|
220
|
+
y.isSelected(i) && y.getItems().length === 1 || y.select([i]);
|
|
221
|
+
}, [
|
|
222
|
+
E,
|
|
223
|
+
y,
|
|
224
|
+
C,
|
|
225
|
+
w,
|
|
226
|
+
W
|
|
227
|
+
]);
|
|
228
|
+
if (E?.isDeleted()) return;
|
|
229
|
+
let he = Y ?? D, ge = X.filled !== "" || X.lines.length > 0, $ = 2 / (g || 1), _e = 1 / (g || 1);
|
|
230
|
+
return f("div", {
|
|
231
|
+
...T,
|
|
232
|
+
onPointerDown: me,
|
|
233
|
+
style: {
|
|
234
|
+
..._ === void 0 ? {} : { width: _ },
|
|
235
|
+
...v === void 0 ? {} : { height: v },
|
|
236
|
+
...a,
|
|
237
|
+
overflow: "hidden"
|
|
238
|
+
},
|
|
239
|
+
ref: ce,
|
|
240
|
+
children: [he ? d("div", {
|
|
241
|
+
className: "sxl-chart-element-error",
|
|
242
|
+
style: {
|
|
243
|
+
padding: "8px",
|
|
244
|
+
fontSize: "12px",
|
|
245
|
+
color: "var(--sxl-color-error, #b00020)"
|
|
246
|
+
},
|
|
247
|
+
children: he.message
|
|
248
|
+
}) : null, f("div", {
|
|
249
|
+
style: {
|
|
250
|
+
position: "relative",
|
|
251
|
+
width: "100%",
|
|
252
|
+
height: "100%"
|
|
253
|
+
},
|
|
254
|
+
children: [d("div", {
|
|
255
|
+
className: "sxl-chart-element",
|
|
256
|
+
ref: K,
|
|
257
|
+
style: {
|
|
258
|
+
width: I || "100%",
|
|
259
|
+
height: L || "100%",
|
|
260
|
+
zoom: g,
|
|
261
|
+
position: "relative"
|
|
262
|
+
}
|
|
263
|
+
}), ge ? f("svg", {
|
|
264
|
+
className: "sxl-chart-element-selection",
|
|
265
|
+
width: I * g,
|
|
266
|
+
height: L * g,
|
|
267
|
+
viewBox: `0 0 ${I} ${L}`,
|
|
268
|
+
fill: "none",
|
|
269
|
+
strokeLinejoin: "round",
|
|
270
|
+
strokeLinecap: "round",
|
|
271
|
+
style: {
|
|
272
|
+
position: "absolute",
|
|
273
|
+
left: 0,
|
|
274
|
+
top: 0,
|
|
275
|
+
pointerEvents: "none"
|
|
276
|
+
},
|
|
277
|
+
children: [f("mask", {
|
|
278
|
+
id: Z,
|
|
279
|
+
maskUnits: "userSpaceOnUse",
|
|
280
|
+
x: 0,
|
|
281
|
+
y: 0,
|
|
282
|
+
width: I,
|
|
283
|
+
height: L,
|
|
284
|
+
children: [
|
|
285
|
+
d("rect", {
|
|
286
|
+
width: I,
|
|
287
|
+
height: L,
|
|
288
|
+
fill: "#fff"
|
|
289
|
+
}),
|
|
290
|
+
X.filled ? d("path", {
|
|
291
|
+
d: X.filled,
|
|
292
|
+
fill: "#000"
|
|
293
|
+
}) : null,
|
|
294
|
+
X.lines.map((e, t) => d("path", {
|
|
295
|
+
d: e.d,
|
|
296
|
+
stroke: "#000",
|
|
297
|
+
strokeWidth: e.width,
|
|
298
|
+
strokeLinecap: "butt"
|
|
299
|
+
}, t))
|
|
300
|
+
]
|
|
301
|
+
}), d("g", {
|
|
302
|
+
mask: `url(#${Z})`,
|
|
303
|
+
children: [{
|
|
304
|
+
stroke: "var(--sxl-color-base-100, #fff)",
|
|
305
|
+
reach: $ + _e
|
|
306
|
+
}, {
|
|
307
|
+
stroke: "var(--sxl-color-primary, #1a73e8)",
|
|
308
|
+
reach: $
|
|
309
|
+
}].map(({ stroke: e, reach: t }, n) => f("g", {
|
|
310
|
+
stroke: e,
|
|
311
|
+
children: [X.filled ? d("path", {
|
|
312
|
+
d: X.filled,
|
|
313
|
+
strokeWidth: 2 * t
|
|
314
|
+
}) : null, X.lines.map((e, n) => d("path", {
|
|
315
|
+
d: e.d,
|
|
316
|
+
strokeWidth: e.width + 2 * t
|
|
317
|
+
}, n))]
|
|
318
|
+
}, n))
|
|
319
|
+
})]
|
|
320
|
+
}) : null]
|
|
321
|
+
})]
|
|
322
|
+
});
|
|
323
|
+
}));
|
|
324
|
+
j.displayName = "ChartElement";
|
|
325
|
+
export { y as a, b as i, k as n, v as o, x as r, _ as s, j as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
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 { t as n } from "./
|
|
10
|
-
import { i as r, r as i, t as a } from "./
|
|
7
|
+
import { t as e } from "./4M1ime0lSMPwFdwq.mjs";
|
|
8
|
+
import { n as t } from "./DBCT8TZn5tx3RRgu.mjs";
|
|
9
|
+
import { t as n } from "./Du_yTZVTH9ZhIwVz.mjs";
|
|
10
|
+
import { i as r, r as i, t as a } from "./D4OKTHNu7UroAOVB.mjs";
|
|
11
11
|
import { forwardRef as o, memo as s, useCallback as c, useEffect as l, useId as u, useMemo as d, useReducer as ee, useRef as te, useState as f } from "react";
|
|
12
12
|
import { jsx as p, jsxs as ne } from "react/jsx-runtime";
|
|
13
13
|
import { useSurfaceStateSetter as re } from "@sheetxl/grid-react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
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 { d as t } from "./
|
|
9
|
-
import { t as n } from "./
|
|
10
|
-
import { n as r } from "./
|
|
11
|
-
import { t as i } from "./
|
|
7
|
+
import { t as e } from "./4M1ime0lSMPwFdwq.mjs";
|
|
8
|
+
import { d as t } from "./DIXBmbnM-qkL9ot2.mjs";
|
|
9
|
+
import { t as n } from "./CsGmLR7d80u8xidY.mjs";
|
|
10
|
+
import { n as r } from "./CKYZvqAf2y2oAkB7.mjs";
|
|
11
|
+
import { t as i } from "./56NlLn16iTCMXWTn.mjs";
|
|
12
12
|
import { memo as a, useCallback as o, useReducer as s, useRef as c } from "react";
|
|
13
13
|
import { jsx as l } from "react/jsx-runtime";
|
|
14
14
|
import { messageKey as u } from "@sheetxl/utils";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
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 "./
|
|
7
|
+
import { t as e } from "./C1luDkna9W7PNKrz.mjs";
|
|
8
8
|
import { forwardRef as t, memo as n, useMemo as r, useRef as i } from "react";
|
|
9
9
|
import { jsx as a } from "react/jsx-runtime";
|
|
10
10
|
var o = "data-run", s = (e) => typeof e == "string" ? e ? [{ text: e }] : [] : e.runs ?? [], c = (e) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.6
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|