@sheetxl/react 0.8.0-beta.1 → 0.8.0-beta.10
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/BHjeSMaycUkS5dVL.mjs +66 -0
- package/browser/esm/BZcQ-KYwS62Ut45c.mjs +20 -0
- package/browser/esm/Bow9CzRJrYxak2i5.mjs +318 -0
- package/browser/esm/BuvXl14hs-1CvjeA.mjs +2706 -0
- package/browser/esm/BwRduT8FTrk5n72r.mjs +32 -0
- package/browser/esm/C6urN77szrYwODXF.mjs +134 -0
- package/browser/esm/CYMRbtPIr6SklGpp.mjs +775 -0
- package/browser/esm/CYoUd5KIl7W3AsxH.mjs +196 -0
- package/browser/esm/Cfe0kofqVKGxLqO6.mjs +31 -0
- package/browser/esm/CiRN-woJZWYOgTn4.mjs +36 -0
- package/browser/esm/Dd-ZybXAgoq9pgGv.mjs +45 -0
- package/browser/esm/DjiBz4H74I6nPUY6.mjs +79 -0
- package/browser/esm/DyU9UInRnfkPYYlR.mjs +63 -0
- package/browser/esm/J8cPagZBeXz86Lnd.mjs +777 -0
- package/browser/esm/Sp6PJavGKpF8SJzA.mjs +75 -0
- package/browser/esm/cYjYjqEsyd63x8t4.mjs +67 -0
- package/browser/esm/chart.mjs +60 -0
- package/browser/esm/control.mjs +216 -0
- package/browser/esm/group.mjs +123 -0
- package/browser/esm/index.mjs +14070 -9138
- package/browser/esm/note.mjs +86 -0
- package/browser/esm/picture.mjs +86 -0
- package/{node/esm/DAE_NG8D9uT50zUH.mjs → browser/esm/shape.mjs} +2 -4
- package/browser/esm/slicer.mjs +276 -0
- package/licenses/dependencies.txt +6 -599
- package/node/esm/BJ7ZZm63j5O6cvrB.mjs +134 -0
- package/node/esm/BfRn5S5V4X8xIAEa.mjs +20 -0
- package/node/esm/BpwE3HqTnrLLzE3C.mjs +775 -0
- package/node/esm/Buw-VKYJy3y5dbaJ.mjs +197 -0
- package/node/esm/CFFlJxNwgyInjEnh.mjs +45 -0
- package/node/esm/CM5BT7h-hMtST2bE.mjs +2706 -0
- package/node/esm/CV3bT3Hql74GcHoU.mjs +37 -0
- package/node/esm/C_ANM4feA1xV-pri.mjs +32 -0
- package/node/esm/D3YXHeOyFp00Xk3m.mjs +323 -0
- package/node/esm/DPN0n6MGYQ9vZ2KO.mjs +80 -0
- package/node/esm/DYosMUJKp-3MSO4q.mjs +76 -0
- package/node/esm/DhSq680c5tgMFFbj.mjs +68 -0
- package/node/esm/Dxbm6ryIDCEi26RO.mjs +66 -0
- package/node/esm/GkmuxU7OwRZtm2Rf.mjs +63 -0
- package/node/esm/chart.mjs +60 -0
- package/node/esm/control.mjs +216 -0
- package/node/esm/group.mjs +123 -0
- package/node/esm/index.mjs +16618 -11534
- package/node/esm/note.mjs +87 -0
- package/node/esm/picture.mjs +86 -0
- package/node/esm/shape.mjs +783 -0
- package/node/esm/slicer.mjs +278 -0
- package/package.json +53 -14
- package/resources/contents.json +18 -0
- package/resources/locales/contents.json +42 -0
- package/resources/locales/de/movable.cmd.json +154 -0
- package/resources/locales/de/picture.cmd.json +31 -0
- package/resources/locales/de/selection.cmd.json +8 -0
- package/resources/locales/de/shape.cmd.json +17 -0
- package/resources/locales/de/sheet.cmd.json +328 -21
- package/resources/locales/de/slicer.cmd.json +17 -0
- package/resources/locales/de/table.cmd.json +9 -1
- package/resources/locales/de/ui.msg.json +309 -3
- package/resources/locales/de/workbook.cmd.json +10 -6
- package/resources/locales/en/movable.cmd.json +154 -0
- package/resources/locales/en/picture.cmd.json +31 -0
- package/resources/locales/en/selection.cmd.json +8 -0
- package/resources/locales/en/shape.cmd.json +17 -0
- package/resources/locales/en/sheet.cmd.json +342 -22
- package/resources/locales/en/slicer.cmd.json +17 -0
- package/resources/locales/en/table.cmd.json +9 -1
- package/resources/locales/en/ui.msg.json +309 -3
- package/resources/locales/en/workbook.cmd.json +11 -7
- package/types/chart.d.ts +2 -0
- package/types/control.d.ts +2 -0
- package/types/group.d.ts +2 -0
- package/types/note.d.ts +2 -0
- package/types/picture.d.ts +2 -0
- package/types/shape.d.ts +2 -0
- package/types/slicer.d.ts +2 -0
- package/types/src/annotation/RangeAnnotations.d.ts +119 -0
- package/types/src/annotation/index.d.ts +2 -0
- package/types/src/autoFill/AutoFillPresets.d.ts +14 -0
- package/types/src/autoFill/FillMenu.d.ts +36 -0
- package/types/src/autoFill/FillSeries.d.ts +38 -0
- package/types/src/autoFill/index.d.ts +4 -0
- package/types/src/border/StaticBorderRenderer.d.ts +2 -2
- package/types/src/border/useBorders.d.ts +7 -7
- package/types/src/cell/CornerTriangle.d.ts +6 -0
- package/types/src/cell/FormulaCellRenderer.d.ts +1 -1
- package/types/src/cell/OutlineButton.d.ts +123 -0
- package/types/src/cell/SheetCellRenderer.d.ts +2 -2
- package/types/src/cell/SheetHeaderRenderer.d.ts +5 -0
- package/types/src/cell/StaticCellRenderer.d.ts +57 -0
- package/types/src/cell/index.d.ts +2 -0
- package/types/src/cell/useFormulaViewAnchor.d.ts +1 -1
- package/types/src/chart/index.d.ts +0 -1
- package/types/src/checklist/ValueChecklist.d.ts +112 -0
- package/types/src/checklist/index.d.ts +2 -0
- package/types/src/commands/ContextualToolbar.d.ts +19 -0
- package/types/src/commands/createTransactionalMiddleware.d.ts +4 -1
- package/types/src/commands/index.d.ts +1 -0
- package/types/src/comment/CommentCardRequest.d.ts +94 -0
- package/types/src/comment/CommentUtils.d.ts +43 -0
- package/types/src/comment/NoteEditor.d.ts +20 -0
- package/types/src/comment/index.d.ts +5 -0
- package/types/src/comment/useCommentThread.d.ts +37 -0
- package/types/src/comment/useSheetComments.d.ts +28 -0
- package/types/src/{sheet → conditionalFormat}/ConditionalFormatPresets.d.ts +6 -6
- package/types/src/conditionalFormat/index.d.ts +1 -0
- package/types/src/control/FormControlRenderers.d.ts +22 -0
- package/types/src/editor/FunctionPreviewPanel.d.ts +15 -1
- package/types/src/editor/NamedItemLabel.d.ts +29 -0
- package/types/src/editor/NamedItemsPanel.d.ts +13 -2
- package/types/src/editor/SheetCellEditorLayer.d.ts +3 -7
- package/types/src/editor/SheetCellEditorStartLayer.d.ts +44 -0
- package/types/src/editor/SheetCellInput.d.ts +26 -2
- package/types/src/editor/SheetEditable.d.ts +8 -2
- package/types/src/editor/formulaCaret.d.ts +39 -10
- package/types/src/editor/formulaEval.d.ts +9 -5
- package/types/src/editor/formulaLint.d.ts +36 -0
- package/types/src/editor/formulaPresentation.d.ts +7 -0
- package/types/src/editor/formulaText.d.ts +17 -5
- package/types/src/editor/functionArgs.d.ts +20 -0
- package/types/src/editor/index.d.ts +4 -1
- package/types/src/editor/pickedReference.d.ts +76 -0
- package/types/src/editor/useEditRejectedNotice.d.ts +32 -0
- package/types/src/editor/useFormulaHints.d.ts +93 -3
- package/types/src/editor/useFormulaInput.d.ts +30 -4
- package/types/src/editor/useReferenceMode.d.ts +12 -0
- package/types/src/editor/validationAlert.d.ts +24 -0
- package/types/src/externalLink/ExternalLinksPaneArgs.d.ts +23 -0
- package/types/src/externalLink/index.d.ts +2 -0
- package/types/src/form/FormulaInput.d.ts +18 -2
- package/types/src/form/FormulaInputParts.d.ts +10 -1
- package/types/src/form/useEditCommit.d.ts +23 -3
- package/types/src/form/useInputField.d.ts +2 -3
- package/types/src/frame/CommandContext.d.ts +188 -6
- package/types/src/group/GroupEditor.d.ts +25 -0
- package/types/src/index.d.ts +12 -2
- package/types/src/io/WorkbookIO.d.ts +2 -0
- package/types/src/layer/CellErrorLayer.d.ts +24 -7
- package/types/src/layer/CommentCardLayer.d.ts +43 -0
- package/types/src/layer/CommentsLayer.d.ts +35 -0
- package/types/src/layer/ConditionalIcons.d.ts +4 -4
- package/types/src/layer/FreezeDragLines.d.ts +17 -0
- package/types/src/layer/GridFreezeLayer.d.ts +11 -0
- package/types/src/layer/HeaderFreezeLayer.d.ts +12 -0
- package/types/src/layer/HeaderResizerLayer.d.ts +2 -1
- package/types/src/layer/HyperlinkLayer.d.ts +109 -0
- package/types/src/layer/MovableKindScope.d.ts +17 -0
- package/types/src/layer/ProtectionLayer.d.ts +52 -0
- package/types/src/layer/RangeAnnotationLayer.d.ts +71 -0
- package/types/src/layer/ResizeIndicator.d.ts +9 -8
- package/types/src/layer/ResizeTooltip.d.ts +13 -0
- package/types/src/layer/SheetHeaderCellLayer.d.ts +10 -1
- package/types/src/layer/SheetOutlineLayer.d.ts +40 -0
- package/types/src/layer/TableLayer.d.ts +5 -4
- package/types/src/layer/TableToolbar.d.ts +42 -0
- package/types/src/layer/ValidationDropdownLayer.d.ts +15 -5
- package/types/src/layer/ValidationIndicatorLayer.d.ts +9 -3
- package/types/src/layer/ValidationPromptLayer.d.ts +64 -0
- package/types/src/layer/_tableColor.d.ts +4 -0
- package/types/src/layer/cellTip.d.ts +13 -0
- package/types/src/layer/freezeDragState.d.ts +21 -0
- package/types/src/layer/index.d.ts +12 -1
- package/types/src/layer/resizeIndicatorState.d.ts +3 -1
- package/types/src/layer/useFreezeDrag.d.ts +22 -0
- package/types/src/layer/useValidationPicker.d.ts +35 -35
- package/types/src/layer/validationMark.d.ts +63 -0
- package/types/src/listener/useModelListener.d.ts +4 -4
- package/types/src/movable/ConnectionSites.d.ts +18 -0
- package/types/src/movable/IMovableArea.d.ts +56 -0
- package/types/src/movable/MovableAdornment.d.ts +26 -0
- package/types/src/movable/MovableCommandGroups.d.ts +40 -0
- package/types/src/movable/MovableCommands.d.ts +6 -1
- package/types/src/movable/MovableControl.d.ts +78 -0
- package/types/src/movable/MovableEdit.d.ts +22 -0
- package/types/src/movable/MovableFrame.d.ts +16 -13
- package/types/src/movable/MovableLayer.d.ts +25 -7
- package/types/src/movable/MovableRenderers.d.ts +210 -0
- package/types/src/movable/PlaceholderFrames.d.ts +11 -0
- package/types/src/movable/RotateHandle.d.ts +37 -0
- package/types/src/movable/TextBox.d.ts +34 -0
- package/types/src/movable/connect.d.ts +16 -0
- package/types/src/movable/framePlacement.d.ts +72 -0
- package/types/src/movable/geometry.d.ts +61 -0
- package/types/src/movable/index.d.ts +10 -0
- package/types/src/movable/pressTarget.d.ts +20 -0
- package/types/src/picker/PickerPanel.d.ts +52 -0
- package/types/src/picker/cellPickerOpen.d.ts +6 -0
- package/types/src/picker/index.d.ts +4 -0
- package/types/src/picker/useCellPicker.d.ts +95 -0
- package/types/src/picture/PictureCommands.d.ts +12 -0
- package/types/src/picture/PictureKind.d.ts +7 -0
- package/types/src/picture/index.d.ts +0 -1
- package/types/src/protection/ProtectionPaneArgs.d.ts +31 -0
- package/types/src/protection/index.d.ts +3 -0
- package/types/src/protection/unlockProtectedRanges.d.ts +23 -0
- package/types/src/richText/RichTextEditor.d.ts +41 -0
- package/types/src/richText/index.d.ts +2 -0
- package/types/src/selection/SheetSelectionLayer.d.ts +14 -10
- package/types/src/shape/ConnectorControl.d.ts +46 -0
- package/types/src/shape/ShapeCommands.d.ts +11 -0
- package/types/src/shape/ShapeControl.d.ts +8 -0
- package/types/src/shape/ShapeEditor.d.ts +15 -2
- package/types/src/shape/ShapeGallery.d.ts +31 -0
- package/types/src/shape/ShapeHandles.d.ts +28 -0
- package/types/src/shape/ShapeKind.d.ts +7 -0
- package/types/src/shape/ShapeSVG.d.ts +22 -0
- package/types/src/shape/ShapeText.d.ts +17 -0
- package/types/src/shape/icons/ShapeIcons.d.ts +16 -0
- package/types/src/shape/icons/_ShapeIconPack.d.ts +4 -0
- package/types/src/shape/index.d.ts +3 -1
- package/types/src/shape/shapeFrame.d.ts +50 -0
- package/types/src/shape/shapeStyle.d.ts +82 -0
- package/types/src/sheet/ISheetElement.d.ts +62 -65
- package/types/src/sheet/SheetCommandProvider.d.ts +9 -4
- package/types/src/sheet/SheetCommands.d.ts +21 -6
- package/types/src/sheet/SheetOutlineElement.d.ts +70 -0
- package/types/src/sheet/SheetScrollbar.d.ts +1 -10
- package/types/src/sheet/_freezeAt.d.ts +10 -0
- package/types/src/sheet/_useHeaderMetrics.d.ts +11 -0
- package/types/src/sheet/circularReferences.d.ts +9 -1
- package/types/src/sheet/index.d.ts +1 -1
- package/types/src/sheet/useCycleHighlight.d.ts +21 -0
- package/types/src/slicer/SlicerCommands.d.ts +10 -0
- package/types/src/slicer/SlicerEditor.d.ts +8 -2
- package/types/src/slicer/SlicerKind.d.ts +7 -0
- package/types/src/slicer/SlicerStylePreview.d.ts +18 -0
- package/types/src/slicer/index.d.ts +2 -1
- package/types/src/slicer/slicerStyles.d.ts +32 -0
- package/types/src/tabStrip/TabStrip.d.ts +7 -0
- package/types/src/taskPane/ITaskPane.d.ts +12 -1
- package/types/src/taskPane/MovablePane.d.ts +17 -0
- package/types/src/taskPane/index.d.ts +1 -0
- package/types/src/theme/ThemeState.d.ts +14 -1
- package/types/src/theme/useGridColorScheme.d.ts +1 -1
- package/types/src/workbook/DefaultMovableRenderers.d.ts +20 -0
- package/types/src/workbook/IWorkbookElement.d.ts +24 -0
- package/types/src/workbook/WorkbookCommands.d.ts +2 -4
- package/types/src/workbook/WorkbookStrip.d.ts +9 -0
- package/types/src/workbook/_followOrigin.d.ts +9 -0
- package/types/src/workbook/useWorkbookFormat.d.ts +3 -3
- package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
- package/browser/cjs/Pl04-kDEQSO8_qFU.cjs +0 -156
- package/browser/cjs/index.cjs +0 -35
- package/browser/esm/SJMJzBwlXTJ9QIO5.mjs +0 -6286
- package/types/src/editor/useProtectedEditNotice.d.ts +0 -14
- package/types/src/layer/validationList.d.ts +0 -84
- package/types/src/list/SheetValueList.d.ts +0 -93
- package/types/src/list/index.d.ts +0 -2
- package/types/src/movable/MoveableBundle.d.ts +0 -4
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
|
|
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 "./Dd-ZybXAgoq9pgGv.mjs";
|
|
8
|
+
import { d as t } from "./Bow9CzRJrYxak2i5.mjs";
|
|
9
|
+
import { n, r } from "./CiRN-woJZWYOgTn4.mjs";
|
|
10
|
+
import { t as i } from "./J8cPagZBeXz86Lnd.mjs";
|
|
11
|
+
import { memo as a, useCallback as o, useReducer as s, useRef as c } from "react";
|
|
12
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
13
|
+
import { messageKey as u } from "@sheetxl/utils";
|
|
14
|
+
import { useGridPaneOptional as d, useSurfaceStateSetter as f } from "@sheetxl/grid-react";
|
|
15
|
+
var p = (e, t) => {
|
|
16
|
+
let n = [t.horizontal ? 1 : -1, t.vertical ? 1 : -1];
|
|
17
|
+
return e === "start" ? n : [-n[0], -n[1]];
|
|
18
|
+
}, m = (e) => {
|
|
19
|
+
let t = e.getBounds();
|
|
20
|
+
return t ? {
|
|
21
|
+
bounds: t,
|
|
22
|
+
rotation: e.getRotation() || 0,
|
|
23
|
+
flip: e.getFlip()
|
|
24
|
+
} : null;
|
|
25
|
+
}, h = (e, t, n) => {
|
|
26
|
+
let { x: r, y: i, width: a, height: o } = e.bounds, s = -(e.rotation || 0) * Math.PI / 180, c = t.x - (r + a / 2), l = t.y - (i + o / 2), u = c * Math.cos(s) - l * Math.sin(s), d = c * Math.sin(s) + l * Math.cos(s);
|
|
27
|
+
return Math.abs(u) <= a / 2 + n && Math.abs(d) <= o / 2 + n;
|
|
28
|
+
}, g = a((t) => {
|
|
29
|
+
let { movable: n, flip: i, isDragging: a = !1, gesture: g } = t, _ = d(), v = f(r, null), [, y] = s((e) => e + 1, 0), b = n.getContent();
|
|
30
|
+
e(b, { onAnyChange: y });
|
|
31
|
+
let x = b.getConnectorFormat(), S = c(null), C = o((e) => {
|
|
32
|
+
let t = _?.getPanePointFromPointer(e.clientX, e.clientY);
|
|
33
|
+
if (!_ || !t) return null;
|
|
34
|
+
let n = _.toAbsoluteBounds({
|
|
35
|
+
x: t.x,
|
|
36
|
+
y: t.y,
|
|
37
|
+
width: 0,
|
|
38
|
+
height: 0
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
x: n.x,
|
|
42
|
+
y: n.y
|
|
43
|
+
};
|
|
44
|
+
}, [_]), w = o((e) => {
|
|
45
|
+
if (e.button !== 0) return;
|
|
46
|
+
e.stopPropagation(), e.preventDefault();
|
|
47
|
+
let t = e.currentTarget.dataset.end, r = m(n);
|
|
48
|
+
if (!r || !_) return;
|
|
49
|
+
let i = {
|
|
50
|
+
pointerId: e.pointerId,
|
|
51
|
+
end: t,
|
|
52
|
+
placement: r,
|
|
53
|
+
candidates: [],
|
|
54
|
+
hit: null
|
|
55
|
+
};
|
|
56
|
+
g.start(u("op.connectShape"), (e) => {
|
|
57
|
+
let n = e.getContent().getConnectorFormat();
|
|
58
|
+
if (!n) return;
|
|
59
|
+
let r = i.hit, a = t === "start" ? n.getStartConnectedMovable() : n.getEndConnectedMovable(), o = t === "start" ? n.getStartConnectionSite() : n.getEndConnectionSite();
|
|
60
|
+
(r ? a !== r.target || o !== r.index : a !== null) && (r ? t === "start" ? n.startConnect(r.target, r.index) : n.endConnect(r.target, r.index) : t === "start" ? n.startDisconnect() : n.endDisconnect());
|
|
61
|
+
}) && (i.candidates = ((e) => {
|
|
62
|
+
let t = e.getRange().getSheet(), n = /* @__PURE__ */ new Set([e]);
|
|
63
|
+
for (let t = e.getParent(); t; t = t.getParent()) n.add(t);
|
|
64
|
+
let r = [];
|
|
65
|
+
for (let e of t.getMovables().getItems({ deep: !0 })) {
|
|
66
|
+
if (n.has(e) || e.isHidden()) continue;
|
|
67
|
+
let t = m(e);
|
|
68
|
+
t && r.push({
|
|
69
|
+
movable: e,
|
|
70
|
+
placement: t
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return r;
|
|
74
|
+
})(n), S.current = i, e.currentTarget.setPointerCapture(e.pointerId), v({
|
|
75
|
+
connector: n.getId(),
|
|
76
|
+
target: null,
|
|
77
|
+
index: null
|
|
78
|
+
}));
|
|
79
|
+
}, [
|
|
80
|
+
n,
|
|
81
|
+
_,
|
|
82
|
+
g,
|
|
83
|
+
v
|
|
84
|
+
]), T = o((e) => {
|
|
85
|
+
let t = S.current;
|
|
86
|
+
if (!t || t.pointerId !== e.pointerId) return;
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
let r = C(e);
|
|
89
|
+
if (!r) return;
|
|
90
|
+
let i = ((e, t, n) => {
|
|
91
|
+
let r = 8 / n, i = 10 / n, a = null, o = 1 / 0;
|
|
92
|
+
for (let { movable: n, placement: s } of t) {
|
|
93
|
+
let t = n.getConnectionSites(s);
|
|
94
|
+
if (!t || t.length === 0) continue;
|
|
95
|
+
let c = h(s, e, r);
|
|
96
|
+
for (let r of t) {
|
|
97
|
+
let t = Math.hypot(r.x - e.x, r.y - e.y);
|
|
98
|
+
(c || t <= i) && t < o && (a = {
|
|
99
|
+
target: n,
|
|
100
|
+
index: r.index,
|
|
101
|
+
x: r.x,
|
|
102
|
+
y: r.y
|
|
103
|
+
}, o = t);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return a;
|
|
107
|
+
})(r, t.candidates, _?.getZoom() || 1);
|
|
108
|
+
t.hit = i;
|
|
109
|
+
let a = n.getContent().getConnectorFormat(), o = a?.getEndPoints(t.placement);
|
|
110
|
+
if (!a || !o) return;
|
|
111
|
+
let s = o[t.end === "start" ? "end" : "start"];
|
|
112
|
+
o[t.end] = i ? {
|
|
113
|
+
x: i.x,
|
|
114
|
+
y: i.y
|
|
115
|
+
} : e.shiftKey ? ((e, t, n = 15) => {
|
|
116
|
+
let r = t.x - e.x, i = t.y - e.y;
|
|
117
|
+
if (r === 0 && i === 0) return t;
|
|
118
|
+
let a = n * Math.PI / 180, o = Math.round(Math.atan2(i, r) / a) * a, s = Math.abs(Math.cos(o)) < 1e-12 ? 0 : Math.cos(o), c = Math.abs(Math.sin(o)) < 1e-12 ? 0 : Math.sin(o), l = r * s + i * c;
|
|
119
|
+
return {
|
|
120
|
+
x: e.x + l * s,
|
|
121
|
+
y: e.y + l * c
|
|
122
|
+
};
|
|
123
|
+
})(s, r) : r;
|
|
124
|
+
let c = a.placeEnds(o.start, o.end);
|
|
125
|
+
v({
|
|
126
|
+
connector: n.getId(),
|
|
127
|
+
target: i ? i.target.getId() : null,
|
|
128
|
+
index: i ? i.index : null
|
|
129
|
+
}), g.preview({
|
|
130
|
+
bounds: c.bounds,
|
|
131
|
+
flip: c.flip,
|
|
132
|
+
grip: {
|
|
133
|
+
kind: "resize",
|
|
134
|
+
direction: p(t.end, c.flip)
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}, [
|
|
138
|
+
C,
|
|
139
|
+
_,
|
|
140
|
+
n,
|
|
141
|
+
g,
|
|
142
|
+
v
|
|
143
|
+
]), E = o((e) => {
|
|
144
|
+
let t = S.current;
|
|
145
|
+
t && t.pointerId === e.pointerId && (e.stopPropagation(), S.current = null, v(null), g.finish());
|
|
146
|
+
}, [g, v]), D = o((e) => {
|
|
147
|
+
let t = S.current;
|
|
148
|
+
t && t.pointerId === e.pointerId && (S.current = null, v(null), g.cancel());
|
|
149
|
+
}, [g, v]);
|
|
150
|
+
return l("div", {
|
|
151
|
+
className: [
|
|
152
|
+
"movable-control",
|
|
153
|
+
"connector",
|
|
154
|
+
a ? "dragging" : null
|
|
155
|
+
].filter(Boolean).join(" "),
|
|
156
|
+
children: ["start", "end"].map((e) => {
|
|
157
|
+
let t = p(e, i), n = e === "start" ? !!x?.isStartConnected() : !!x?.isEndConnected();
|
|
158
|
+
return l("div", {
|
|
159
|
+
className: n ? "movable-control-handle connector-end glued" : "movable-control-handle connector-end",
|
|
160
|
+
"data-end": e,
|
|
161
|
+
style: {
|
|
162
|
+
left: 50 * (t[0] + 1) + "%",
|
|
163
|
+
top: 50 * (t[1] + 1) + "%"
|
|
164
|
+
},
|
|
165
|
+
onPointerDown: w,
|
|
166
|
+
onPointerMove: T,
|
|
167
|
+
onPointerUp: E,
|
|
168
|
+
onPointerCancel: D
|
|
169
|
+
}, e);
|
|
170
|
+
})
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
g.displayName = "ConnectorControl";
|
|
174
|
+
var _ = a((e) => e.movable.getContent().isConnector() ? l(g, { ...e }) : l(t, { ...e }));
|
|
175
|
+
_.displayName = "ShapeControl";
|
|
176
|
+
var v = {
|
|
177
|
+
renderer: (e) => l(i, {
|
|
178
|
+
...e,
|
|
179
|
+
shape: e.movable.getContent()
|
|
180
|
+
}),
|
|
181
|
+
control: _,
|
|
182
|
+
commands: (e, t) => {
|
|
183
|
+
let { sheet: r, movable: i, notifier: a } = t, o = i.getContent();
|
|
184
|
+
e.use(n({
|
|
185
|
+
transaction: r,
|
|
186
|
+
notifier: a
|
|
187
|
+
})), e.updateCommand("changeShape", {
|
|
188
|
+
disabledReasons: o.getConnectorFormat() ? [u("reason.connectorShape")] : [],
|
|
189
|
+
callback: (e) => {
|
|
190
|
+
let t = typeof e == "object" && e ? e.geometry : e;
|
|
191
|
+
o.setShapeType(typeof t == "string" ? t : "rect");
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
export { v as ShapeKind };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
|
|
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 { useMemo as e, version as t } from "react";
|
|
8
|
+
function n(e, t) {
|
|
9
|
+
if (typeof e == "function") return e(t);
|
|
10
|
+
e && (e.current = t);
|
|
11
|
+
}
|
|
12
|
+
var r = parseInt(t.split(".")[0], 10) >= 19 ? function(e) {
|
|
13
|
+
return (t) => {
|
|
14
|
+
let r = [];
|
|
15
|
+
for (let i of e) {
|
|
16
|
+
let e = n(i, t), a = typeof e == "function";
|
|
17
|
+
r.push(a ? e : () => n(i, null));
|
|
18
|
+
}
|
|
19
|
+
return () => {
|
|
20
|
+
for (let e of r) e();
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
} : function(e) {
|
|
24
|
+
return (t) => {
|
|
25
|
+
for (let r of e) n(r, t);
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
function i(t) {
|
|
29
|
+
return e(() => r(t), t);
|
|
30
|
+
}
|
|
31
|
+
export { i as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
|
|
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
|
+
var e = "movable-connect", t = "command", n = (e, t) => !!e && (e.getTags?.() ?? []).includes(t);
|
|
8
|
+
function r(e) {
|
|
9
|
+
let { transaction: r, notifier: i, manager: a } = e, o = e.isRepeatable ?? ((e) => !n(e, "noRepeat")), s = Promise.resolve();
|
|
10
|
+
return (e) => (c, l) => {
|
|
11
|
+
if (n(l, "noTransaction")) return e(c, l);
|
|
12
|
+
let u = s.then(async () => {
|
|
13
|
+
let n = l?.getLabel?.() ?? void 0, s = l?.getKey?.(), u = i ? await Promise.resolve(i.showBusy(n ?? "Working…")) : null;
|
|
14
|
+
try {
|
|
15
|
+
let i;
|
|
16
|
+
return await r.doBatch(async () => {
|
|
17
|
+
i = await e(c, l);
|
|
18
|
+
}, {
|
|
19
|
+
description: n,
|
|
20
|
+
meta: s ? { [t]: s } : void 0
|
|
21
|
+
}), a && l && o(l) && a.setRepeatableOperation({
|
|
22
|
+
description: n ?? "last action",
|
|
23
|
+
repeat: () => {
|
|
24
|
+
l.execute(c);
|
|
25
|
+
}
|
|
26
|
+
}), i;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
e && i?.showError?.(e);
|
|
29
|
+
} finally {
|
|
30
|
+
u?.();
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return s = u.then(() => {}, () => {}), u;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export { r as n, e as r, t };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
|
|
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 { useEffect as e, useMemo as t, useReducer as n, useRef as r } from "react";
|
|
8
|
+
var i = (t, n, i) => {
|
|
9
|
+
let a = r(n);
|
|
10
|
+
a.current = n;
|
|
11
|
+
let s = (i = i ? {
|
|
12
|
+
...o,
|
|
13
|
+
...i
|
|
14
|
+
} : o).ignoreModelChange;
|
|
15
|
+
e(() => {
|
|
16
|
+
if (!t || !a.current) return;
|
|
17
|
+
let e = Object.keys(a.current), n = {}, r = e.length;
|
|
18
|
+
for (let t = 0; t < r; t++) {
|
|
19
|
+
let r = e[t];
|
|
20
|
+
n[r] = (e, t) => a.current[r]?.(e, t);
|
|
21
|
+
}
|
|
22
|
+
let o = i?.debugText;
|
|
23
|
+
o && console.log("Add: " + o);
|
|
24
|
+
let c = t.addListeners(n, i);
|
|
25
|
+
if (!s) for (let i = 0; i < r; i++) n[e[i]]?.(t);
|
|
26
|
+
return () => {
|
|
27
|
+
o && console.log("Remove: " + o), c?.();
|
|
28
|
+
};
|
|
29
|
+
}, [t]);
|
|
30
|
+
};
|
|
31
|
+
function a(e, r) {
|
|
32
|
+
let [a, o] = n((e) => e + 1, 0);
|
|
33
|
+
i(e, t(() => {
|
|
34
|
+
let e = (e, t) => {
|
|
35
|
+
o();
|
|
36
|
+
}, t = Array.isArray(r) ? r : [r], n = {};
|
|
37
|
+
for (let r of t) n[r] = e;
|
|
38
|
+
return n;
|
|
39
|
+
}, [e, ...Array.isArray(r) ? r : [r]]));
|
|
40
|
+
}
|
|
41
|
+
var o = {
|
|
42
|
+
transactional: !1,
|
|
43
|
+
ignoreModelChange: !1
|
|
44
|
+
};
|
|
45
|
+
export { a as n, i as t };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
|
|
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 "./Cfe0kofqVKGxLqO6.mjs";
|
|
8
|
+
import { forwardRef as t, memo as n, useMemo as r, useRef as i } from "react";
|
|
9
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
10
|
+
var o = "data-run", s = (e) => typeof e == "string" ? e ? [{ text: e }] : [] : e.runs ?? [], c = (e) => {
|
|
11
|
+
if (e.nodeType === 3) return e.nodeValue ?? "";
|
|
12
|
+
if (e.nodeType !== 1) return "";
|
|
13
|
+
if (e.localName === "br") return "\n";
|
|
14
|
+
let t = "", n = e.childNodes;
|
|
15
|
+
for (let e = 0; e < n.length; e++) t += c(n[e]);
|
|
16
|
+
return t;
|
|
17
|
+
}, l = n(t((t, n) => {
|
|
18
|
+
let { value: l, onChange: u, onDone: d, readOnly: f = !1, runStyle: p, style: m, onKeyDown: h, onBlur: g, ..._ } = t, v = i(null), y = r(() => s(l), [l]), b = r(() => JSON.stringify(l), [l]), x = () => {
|
|
19
|
+
let e = v.current;
|
|
20
|
+
if (!e || f) return;
|
|
21
|
+
let t = ((e, t) => {
|
|
22
|
+
let n = [], r = e.childNodes;
|
|
23
|
+
for (let e = 0; e < r.length; e++) {
|
|
24
|
+
let i = r[e], a = c(i);
|
|
25
|
+
if (!a) continue;
|
|
26
|
+
let s = i.nodeType === 1 ? i.getAttribute(o) : null;
|
|
27
|
+
if (s !== null) {
|
|
28
|
+
let e = t[parseInt(s, 10)]?.font;
|
|
29
|
+
n.push(e ? {
|
|
30
|
+
text: a,
|
|
31
|
+
font: e
|
|
32
|
+
} : { text: a });
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
let l = n[n.length - 1];
|
|
36
|
+
l ? l.text += a : n.push({ text: a });
|
|
37
|
+
}
|
|
38
|
+
return n.every((e) => !e.font) ? n.map((e) => e.text).join("") : { runs: n };
|
|
39
|
+
})(e, y);
|
|
40
|
+
JSON.stringify(s(t)) !== JSON.stringify(y) && u?.(t);
|
|
41
|
+
}, S = (e) => {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
}, C = e([v, n]);
|
|
44
|
+
return a("div", {
|
|
45
|
+
ref: C,
|
|
46
|
+
contentEditable: !f && "plaintext-only",
|
|
47
|
+
suppressContentEditableWarning: !0,
|
|
48
|
+
spellCheck: !1,
|
|
49
|
+
..._,
|
|
50
|
+
style: {
|
|
51
|
+
width: "100%",
|
|
52
|
+
minHeight: "100%",
|
|
53
|
+
boxSizing: "border-box",
|
|
54
|
+
outline: "none",
|
|
55
|
+
whiteSpace: "pre-wrap",
|
|
56
|
+
overflowWrap: "break-word",
|
|
57
|
+
userSelect: "text",
|
|
58
|
+
cursor: f ? void 0 : "text",
|
|
59
|
+
...m
|
|
60
|
+
},
|
|
61
|
+
onKeyDown: (e) => {
|
|
62
|
+
h?.(e), f || (e.stopPropagation(), e.key === "Escape" && (e.preventDefault(), e.currentTarget.blur(), d?.()));
|
|
63
|
+
},
|
|
64
|
+
onKeyUp: f ? void 0 : S,
|
|
65
|
+
onCopy: f ? void 0 : S,
|
|
66
|
+
onCut: f ? void 0 : S,
|
|
67
|
+
onPaste: f ? void 0 : S,
|
|
68
|
+
onBlur: (e) => {
|
|
69
|
+
x(), g?.(e);
|
|
70
|
+
},
|
|
71
|
+
children: y.map((e, t) => a("span", {
|
|
72
|
+
[o]: t,
|
|
73
|
+
style: e.font ? p?.(e.font) : void 0,
|
|
74
|
+
children: e.text
|
|
75
|
+
}, t))
|
|
76
|
+
}, b);
|
|
77
|
+
}));
|
|
78
|
+
l.displayName = "RichTextEditor";
|
|
79
|
+
export { l as t };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
|
|
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 { forwardRef as e, memo as t, useEffect as n, useLayoutEffect as r, useRef as i } from "react";
|
|
8
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
9
|
+
var o = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakSet(), c = (e) => !!((e) => {
|
|
10
|
+
let t = o.get(e);
|
|
11
|
+
if (!t) return !1;
|
|
12
|
+
for (let e of t) if (e()) return !0;
|
|
13
|
+
return !1;
|
|
14
|
+
})(e) || (s.add(e), !1), l = (e, t) => {
|
|
15
|
+
let n = o.get(e);
|
|
16
|
+
return n || (n = /* @__PURE__ */ new Set(), o.set(e, n)), n.add(t), s.has(e) && (s.delete(e), e.isSelected() && t()), () => {
|
|
17
|
+
n.delete(t);
|
|
18
|
+
};
|
|
19
|
+
}, u = t(e((e, t) => {
|
|
20
|
+
let { children: o, style: s, contentStyle: c, disabled: u = !1, movable: d, onDragZone: f, ...p } = e, m = i(null);
|
|
21
|
+
return r(() => {
|
|
22
|
+
f?.((e) => {
|
|
23
|
+
let t = m.current;
|
|
24
|
+
return !t || !t.contains(e.target);
|
|
25
|
+
});
|
|
26
|
+
}, [f]), n(() => {
|
|
27
|
+
if (d && !u) return l(d, () => ((e) => {
|
|
28
|
+
let t = e?.querySelector("textarea, input, [contenteditable]:not([contenteditable=\"false\"])");
|
|
29
|
+
if (!t) return !1;
|
|
30
|
+
if (t.focus(), t.isContentEditable) {
|
|
31
|
+
let e = t.ownerDocument.getSelection();
|
|
32
|
+
e?.selectAllChildren(t), e?.collapseToEnd();
|
|
33
|
+
}
|
|
34
|
+
return !0;
|
|
35
|
+
})(m.current));
|
|
36
|
+
}, [d, u]), a("div", {
|
|
37
|
+
ref: t,
|
|
38
|
+
...p,
|
|
39
|
+
style: {
|
|
40
|
+
width: "100%",
|
|
41
|
+
height: "100%",
|
|
42
|
+
boxSizing: "border-box",
|
|
43
|
+
padding: "3px",
|
|
44
|
+
position: "relative",
|
|
45
|
+
overflow: "hidden",
|
|
46
|
+
...s
|
|
47
|
+
},
|
|
48
|
+
children: a("div", {
|
|
49
|
+
ref: m,
|
|
50
|
+
style: {
|
|
51
|
+
width: "100%",
|
|
52
|
+
height: "100%",
|
|
53
|
+
boxSizing: "border-box",
|
|
54
|
+
overflow: "hidden",
|
|
55
|
+
cursor: u ? void 0 : "text",
|
|
56
|
+
...c
|
|
57
|
+
},
|
|
58
|
+
children: o
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}));
|
|
62
|
+
u.displayName = "TextBox";
|
|
63
|
+
export { l as n, c as r, u as t };
|