@sheetxl/react 0.7.28-beta.4 → 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 +14122 -8944
- package/browser/esm/note.mjs +86 -0
- package/browser/esm/picture.mjs +86 -0
- package/{node/esm/Ban9guHVB-Vxa-tq.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 +16649 -11320
- 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 +17 -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 -1
- 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 +61 -0
- package/types/src/layer/ValidationIndicatorLayer.d.ts +14 -21
- 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 +14 -0
- 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 +54 -0
- 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/BdJpSdwyWuh-Te5p.mjs +0 -6286
- package/types/src/editor/useProtectedEditNotice.d.ts +0 -14
- package/types/src/movable/MoveableBundle.d.ts +0 -4
|
@@ -0,0 +1,75 @@
|
|
|
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 { PictureEditor as e } from "./picture.mjs";
|
|
8
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
9
|
+
import { DOMUtils as n, messageKey as r, t as i } from "@sheetxl/utils";
|
|
10
|
+
import { NotifierType as a } from "@sheetxl/utils-react";
|
|
11
|
+
var o = {
|
|
12
|
+
renderer: (n) => {
|
|
13
|
+
let r = n.movable.getContent();
|
|
14
|
+
return t(e, {
|
|
15
|
+
loadingPanel: t("div", { style: {
|
|
16
|
+
position: "absolute",
|
|
17
|
+
width: "100%",
|
|
18
|
+
height: "100%"
|
|
19
|
+
} }),
|
|
20
|
+
picture: r,
|
|
21
|
+
description: r.getDescription() ?? r.getName?.() ?? void 0,
|
|
22
|
+
...n
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
commands: (e, t) => {
|
|
26
|
+
let { sheet: o, movable: s, notifier: c } = t, l = s.getContent(), u = async (e) => {
|
|
27
|
+
let t = await (async (e) => {
|
|
28
|
+
let t = await Promise.resolve(c?.showBusy?.(i(r("op.setPictureResource"))) ?? null);
|
|
29
|
+
try {
|
|
30
|
+
let t = o.getResources().add(e);
|
|
31
|
+
return await t.toBuffer(), t;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
let t = e;
|
|
34
|
+
if (typeof t != "string") {
|
|
35
|
+
console.warn(e);
|
|
36
|
+
let n = typeof e?.cause == "string" ? e.cause : "", r = typeof e?.message == "string" ? e.message : "";
|
|
37
|
+
n && (r = r ? `${r} (${n})` : n), t = i("error.insertImage.unresolved", { detail: r });
|
|
38
|
+
}
|
|
39
|
+
return c?.showMessage?.(t, { type: a.Error }), null;
|
|
40
|
+
} finally {
|
|
41
|
+
t?.();
|
|
42
|
+
}
|
|
43
|
+
})(e);
|
|
44
|
+
t && l.setResource(t);
|
|
45
|
+
};
|
|
46
|
+
e.updateCommand("changePictureFromFile", {
|
|
47
|
+
tags: ["noTransaction", "noRepeat"],
|
|
48
|
+
callback: async (e) => {
|
|
49
|
+
let t = null, r = null;
|
|
50
|
+
typeof e == "string" ? r = e : t = e ?? null, (t || (t = await n.openFileDialog(r ?? "image/*"), t)) && await u({ source: { file: await Promise.resolve(t) } });
|
|
51
|
+
}
|
|
52
|
+
}), e.updateCommand("changePictureFromURL", {
|
|
53
|
+
tags: ["noTransaction", "noRepeat"],
|
|
54
|
+
callback: async (e) => {
|
|
55
|
+
if (!e) {
|
|
56
|
+
let t = await c?.showInput?.({
|
|
57
|
+
title: i("dialog.changePicture.title"),
|
|
58
|
+
description: i("dialog.changePicture.description"),
|
|
59
|
+
inputLabel: i("dialog.insertImage.inputLabel"),
|
|
60
|
+
initialValue: "https://picsum.photos/360",
|
|
61
|
+
propsInput: { style: { minWidth: "440px" } },
|
|
62
|
+
options: [{
|
|
63
|
+
id: "Change",
|
|
64
|
+
label: () => i("dialog.change")
|
|
65
|
+
}]
|
|
66
|
+
});
|
|
67
|
+
if (!t || t.option !== "Change") return;
|
|
68
|
+
e = t.input;
|
|
69
|
+
}
|
|
70
|
+
e && await u({ source: { fetch: e } });
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
export { o as PictureKind };
|
|
@@ -0,0 +1,67 @@
|
|
|
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 = (e) => {
|
|
8
|
+
let t = e?.getSlicerStyles();
|
|
9
|
+
if (!t) return {
|
|
10
|
+
custom: [],
|
|
11
|
+
light: [],
|
|
12
|
+
other: [],
|
|
13
|
+
dark: []
|
|
14
|
+
};
|
|
15
|
+
let n = t.getItems({ type: "builtIn" }).map((e) => e.getName()), r = new Set(n.map((e) => e.toLowerCase()));
|
|
16
|
+
return {
|
|
17
|
+
custom: t.getItems({ type: "custom" }).map((e) => e.getName()).filter((e) => !r.has(e.toLowerCase())),
|
|
18
|
+
light: n.filter((e) => e.startsWith("SlicerStyleLight")),
|
|
19
|
+
other: n.filter((e) => e.startsWith("SlicerStyleOther")),
|
|
20
|
+
dark: n.filter((e) => e.startsWith("SlicerStyleDark"))
|
|
21
|
+
};
|
|
22
|
+
}, t = (e, t) => {
|
|
23
|
+
let n = t?.getSlicerStyles();
|
|
24
|
+
return n ? (n.getByName(e) ?? n.getByName("SlicerStyleLight1"))?.getProperties() ?? null : null;
|
|
25
|
+
}, n = (e, t, n) => {
|
|
26
|
+
let r = `${e ? "Selected" : "Unselected"}ItemWith${t ? "Data" : "NoData"}`;
|
|
27
|
+
return n ? `hovered${r}` : r.charAt(0).toLowerCase() + r.slice(1);
|
|
28
|
+
}, r = (e, t) => {
|
|
29
|
+
let n = {};
|
|
30
|
+
if (!e || !t) return n;
|
|
31
|
+
let r = (e) => {
|
|
32
|
+
if (e) return t.parseColor(e)?.toCSS("adaptive") ?? void 0;
|
|
33
|
+
}, i = e.font;
|
|
34
|
+
if (i) {
|
|
35
|
+
(i.weight ?? 400) >= 700 && (n.fontWeight = "bold");
|
|
36
|
+
let e = r(i.color);
|
|
37
|
+
e && (n.color = e);
|
|
38
|
+
}
|
|
39
|
+
let a = e.fill;
|
|
40
|
+
if (a?.type === "gradient" && a.stops?.length) {
|
|
41
|
+
let e = a.stops.length, t = a.stops.map((t, n) => {
|
|
42
|
+
let i = t && typeof t == "object" && "color" in t ? t : { color: t }, a = i.offset ?? (e > 1 ? n / (e - 1) : 0);
|
|
43
|
+
return `${r(i.color) ?? "transparent"} ${100 * a}%`;
|
|
44
|
+
});
|
|
45
|
+
n.background = `linear-gradient(${a.angle ?? 0}deg, ${t.join(", ")})`;
|
|
46
|
+
} else if (a?.type === "pattern" && a.patternType !== "none") {
|
|
47
|
+
let e = r(a.foreground);
|
|
48
|
+
e && (n.background = e);
|
|
49
|
+
} else if (a?.type === "solid") {
|
|
50
|
+
let e = r(a.color);
|
|
51
|
+
e && (n.background = e);
|
|
52
|
+
}
|
|
53
|
+
let o = e.borders;
|
|
54
|
+
if (o) for (let e of [
|
|
55
|
+
"left",
|
|
56
|
+
"right",
|
|
57
|
+
"top",
|
|
58
|
+
"bottom"
|
|
59
|
+
]) {
|
|
60
|
+
let t = o[e];
|
|
61
|
+
if (!t || t.style === "none") continue;
|
|
62
|
+
let i = r(t.color);
|
|
63
|
+
i && (n[`border${e.charAt(0).toUpperCase()}${e.slice(1)}`] = `1px solid ${i}`);
|
|
64
|
+
}
|
|
65
|
+
return n;
|
|
66
|
+
};
|
|
67
|
+
export { n as i, e as n, r, t };
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { n as t, t as n } from "./CYMRbtPIr6SklGpp.mjs";
|
|
9
|
+
import { forwardRef as r, memo as i, useEffect as a } from "react";
|
|
10
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
11
|
+
import { CommonUtils as c } from "@sheetxl/utils";
|
|
12
|
+
import { useImperativeElement as l, useMeasure as u } from "@sheetxl/utils-react";
|
|
13
|
+
var d = i(r((r, i) => {
|
|
14
|
+
let { children: d, disabled: f, chart: p, zoom: m = 1, isDragging: h, onHide: g, onShow: _, onDragZone: v, adornmentHost: y, flip: b, gesture: x, ...S } = r;
|
|
15
|
+
a(() => {}, [p]);
|
|
16
|
+
let C = l(i, () => ({ isChartEditor: () => !0 }), []), [w, { height: T, width: E }] = u(), D = e([C, w]);
|
|
17
|
+
if (p.isDeleted()) return;
|
|
18
|
+
let O = t(p.getChartType());
|
|
19
|
+
O ||= t(n.Column);
|
|
20
|
+
let k = O.Icon;
|
|
21
|
+
return o("div", {
|
|
22
|
+
...S,
|
|
23
|
+
ref: D,
|
|
24
|
+
children: s("div", {
|
|
25
|
+
className: "chart-editor",
|
|
26
|
+
style: {
|
|
27
|
+
width: "100%",
|
|
28
|
+
height: "100%",
|
|
29
|
+
paddingTop: "20px",
|
|
30
|
+
paddingBottom: "20px",
|
|
31
|
+
backgroundColor: "var(--sxl-color-base-100, white)",
|
|
32
|
+
backgroundImage: "var(--sxl-image-background)",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
zoom: m,
|
|
36
|
+
display: "flex",
|
|
37
|
+
flexDirection: "column",
|
|
38
|
+
rowGap: "8px",
|
|
39
|
+
position: "relative",
|
|
40
|
+
border: "var(--sxl-color-neutral, grey) solid 1px",
|
|
41
|
+
filter: f ? "blur(1px)" : void 0,
|
|
42
|
+
boxShadow: h ? "1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))" : void 0
|
|
43
|
+
},
|
|
44
|
+
children: [
|
|
45
|
+
p.getChartTitle(),
|
|
46
|
+
o(k, { style: {
|
|
47
|
+
maxWidth: "260px",
|
|
48
|
+
fill: "grey",
|
|
49
|
+
opacity: .4
|
|
50
|
+
} }),
|
|
51
|
+
o("div", {
|
|
52
|
+
style: { textAlign: "center" },
|
|
53
|
+
children: c.camelToPrettyCase(p.getChartType())
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}));
|
|
59
|
+
d.displayName = "ChartEditor";
|
|
60
|
+
export { d as ChartEditor };
|
|
@@ -0,0 +1,216 @@
|
|
|
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 { memo as t, useEffect as n, useReducer as r, useRef as i } from "react";
|
|
9
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
10
|
+
var s = (e) => {
|
|
11
|
+
let t = e.getFont();
|
|
12
|
+
if (!t) return {};
|
|
13
|
+
let n = {};
|
|
14
|
+
return t.name && (n.fontFamily = t.name), t.size !== void 0 && (n.fontSize = `${t.size}pt`), t.bold && (n.fontWeight = "bold"), t.italic && (n.fontStyle = "italic"), t.color && (n.color = t.color), n;
|
|
15
|
+
}, c = {
|
|
16
|
+
pointerEvents: "none",
|
|
17
|
+
width: "100%",
|
|
18
|
+
height: "100%",
|
|
19
|
+
boxSizing: "border-box",
|
|
20
|
+
margin: 0
|
|
21
|
+
}, l = {
|
|
22
|
+
...c,
|
|
23
|
+
display: "flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
gap: "0.35em",
|
|
26
|
+
padding: "0 2px",
|
|
27
|
+
overflow: "hidden",
|
|
28
|
+
whiteSpace: "nowrap"
|
|
29
|
+
}, u = (i, o) => {
|
|
30
|
+
let s = t((t) => {
|
|
31
|
+
let { children: o, disabled: s, style: l, movable: u, zoom: d = 1, isDragging: f, onHide: p, onShow: m, onDragZone: h, adornmentHost: g, flip: _, ...v } = t, y = u.getContent(), [, b] = r((e) => e + 1, 0);
|
|
32
|
+
e(y, { onAnyChange() {
|
|
33
|
+
b();
|
|
34
|
+
} });
|
|
35
|
+
let x = y, S = y, C = x.getLinkedCell?.() ?? null;
|
|
36
|
+
n(() => {
|
|
37
|
+
if (C) return x.getLinkedRange?.()?.addListener(() => b(), { ignoreAddressChanges: !0 });
|
|
38
|
+
}, [y, C]);
|
|
39
|
+
let w = S.getListFillRange?.() ?? null;
|
|
40
|
+
if (n(() => {
|
|
41
|
+
if (w) return S.getListSourceRange?.()?.addListener(() => b(), { ignoreAddressChanges: !0 });
|
|
42
|
+
}, [y, w]), y.isDeleted()) return null;
|
|
43
|
+
let T = u.getBounds();
|
|
44
|
+
return a("div", {
|
|
45
|
+
className: "form-control-renderer",
|
|
46
|
+
...v,
|
|
47
|
+
style: {
|
|
48
|
+
width: "100%",
|
|
49
|
+
height: "100%",
|
|
50
|
+
zoom: d,
|
|
51
|
+
position: "relative",
|
|
52
|
+
boxShadow: f ? "1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))" : void 0,
|
|
53
|
+
overflow: "hidden",
|
|
54
|
+
...l
|
|
55
|
+
},
|
|
56
|
+
children: a("div", {
|
|
57
|
+
inert: !0,
|
|
58
|
+
style: c,
|
|
59
|
+
children: a(i, {
|
|
60
|
+
control: y,
|
|
61
|
+
width: T?.width ?? 0,
|
|
62
|
+
height: T?.height ?? 0
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
return s.displayName = o, s;
|
|
68
|
+
}, d = u(({ control: e }) => a("button", {
|
|
69
|
+
type: "button",
|
|
70
|
+
tabIndex: -1,
|
|
71
|
+
style: {
|
|
72
|
+
...c,
|
|
73
|
+
...s(e)
|
|
74
|
+
},
|
|
75
|
+
children: e.getCaption() ?? ""
|
|
76
|
+
}), "ButtonRenderer"), f = u(({ control: e }) => {
|
|
77
|
+
let t = i(null), r = e.isMixed();
|
|
78
|
+
return n(() => {
|
|
79
|
+
t.current && (t.current.indeterminate = r);
|
|
80
|
+
}, [r]), o("label", {
|
|
81
|
+
style: {
|
|
82
|
+
...l,
|
|
83
|
+
...s(e)
|
|
84
|
+
},
|
|
85
|
+
children: [a("input", {
|
|
86
|
+
ref: t,
|
|
87
|
+
type: "checkbox",
|
|
88
|
+
checked: e.isChecked(),
|
|
89
|
+
readOnly: !0
|
|
90
|
+
}), a("span", { children: e.getCaption() ?? "" })]
|
|
91
|
+
});
|
|
92
|
+
}, "CheckBoxRenderer"), p = u(({ control: e }) => o("label", {
|
|
93
|
+
style: {
|
|
94
|
+
...l,
|
|
95
|
+
...s(e)
|
|
96
|
+
},
|
|
97
|
+
children: [a("input", {
|
|
98
|
+
type: "radio",
|
|
99
|
+
checked: e.isChecked(),
|
|
100
|
+
readOnly: !0
|
|
101
|
+
}), a("span", { children: e.getCaption() ?? "" })]
|
|
102
|
+
}), "OptionButtonRenderer"), m = u(({ control: e }) => {
|
|
103
|
+
let t = e.isHorizontal();
|
|
104
|
+
return a("input", {
|
|
105
|
+
type: "range",
|
|
106
|
+
tabIndex: -1,
|
|
107
|
+
readOnly: !0,
|
|
108
|
+
min: e.getMin() ?? 0,
|
|
109
|
+
max: e.getMax() ?? 100,
|
|
110
|
+
step: e.getIncrement() ?? 1,
|
|
111
|
+
value: e.getValue() ?? e.getMin() ?? 0,
|
|
112
|
+
style: {
|
|
113
|
+
...c,
|
|
114
|
+
writingMode: t ? void 0 : "vertical-lr"
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}, "ScrollBarRenderer"), h = (e) => {
|
|
118
|
+
let t = {
|
|
119
|
+
up: "2,7 5,4 8,7",
|
|
120
|
+
down: "2,3 5,6 8,3",
|
|
121
|
+
left: "7,2 4,5 7,8",
|
|
122
|
+
right: "3,2 6,5 3,8"
|
|
123
|
+
}[e.direction];
|
|
124
|
+
return a("svg", {
|
|
125
|
+
viewBox: "0 0 10 10",
|
|
126
|
+
style: {
|
|
127
|
+
width: "100%",
|
|
128
|
+
height: "100%",
|
|
129
|
+
maxWidth: 10,
|
|
130
|
+
maxHeight: 10
|
|
131
|
+
},
|
|
132
|
+
children: a("polyline", {
|
|
133
|
+
points: t,
|
|
134
|
+
fill: "none",
|
|
135
|
+
stroke: "currentColor",
|
|
136
|
+
strokeWidth: 1.5
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
}, g = {
|
|
140
|
+
flex: "1 1 0",
|
|
141
|
+
minWidth: 0,
|
|
142
|
+
minHeight: 0,
|
|
143
|
+
margin: 0,
|
|
144
|
+
padding: 0,
|
|
145
|
+
display: "flex",
|
|
146
|
+
alignItems: "center",
|
|
147
|
+
justifyContent: "center"
|
|
148
|
+
}, _ = u(({ width: e, height: t }) => {
|
|
149
|
+
let n = ((e, t, n) => e > 0 && t > 0 ? e > t : n)(e, t, !1);
|
|
150
|
+
return o("div", {
|
|
151
|
+
style: {
|
|
152
|
+
...c,
|
|
153
|
+
display: "flex",
|
|
154
|
+
flexDirection: n ? "row" : "column"
|
|
155
|
+
},
|
|
156
|
+
children: [a("button", {
|
|
157
|
+
type: "button",
|
|
158
|
+
tabIndex: -1,
|
|
159
|
+
style: g,
|
|
160
|
+
children: a(h, { direction: n ? "left" : "up" })
|
|
161
|
+
}), a("button", {
|
|
162
|
+
type: "button",
|
|
163
|
+
tabIndex: -1,
|
|
164
|
+
style: g,
|
|
165
|
+
children: a(h, { direction: n ? "right" : "down" })
|
|
166
|
+
})]
|
|
167
|
+
});
|
|
168
|
+
}, "SpinnerRenderer"), v = (e) => e.getListItems().map((e, t) => a("option", {
|
|
169
|
+
value: t,
|
|
170
|
+
children: e
|
|
171
|
+
}, t)), y = u(({ control: e }) => o("select", {
|
|
172
|
+
tabIndex: -1,
|
|
173
|
+
value: e.getSelectedIndex() ?? -1,
|
|
174
|
+
style: c,
|
|
175
|
+
onChange: () => {},
|
|
176
|
+
children: [e.getSelectedIndex() === null ? a("option", { value: -1 }) : null, v(e)]
|
|
177
|
+
}), "DropDownRenderer"), b = u(({ control: e }) => a("select", {
|
|
178
|
+
tabIndex: -1,
|
|
179
|
+
size: Math.max(2, e.getListItems().length),
|
|
180
|
+
value: e.getSelectedIndex() ?? void 0,
|
|
181
|
+
style: c,
|
|
182
|
+
onChange: () => {},
|
|
183
|
+
children: v(e)
|
|
184
|
+
}), "ListBoxRenderer"), x = u(({ control: e }) => a("fieldset", {
|
|
185
|
+
style: {
|
|
186
|
+
...c,
|
|
187
|
+
padding: 0,
|
|
188
|
+
...s(e)
|
|
189
|
+
},
|
|
190
|
+
children: a("legend", {
|
|
191
|
+
style: {
|
|
192
|
+
marginLeft: "6px",
|
|
193
|
+
padding: "0 2px"
|
|
194
|
+
},
|
|
195
|
+
children: e.getCaption() ?? ""
|
|
196
|
+
})
|
|
197
|
+
}), "GroupBoxRenderer"), S = u(({ control: e }) => a("span", {
|
|
198
|
+
style: {
|
|
199
|
+
...l,
|
|
200
|
+
...s(e)
|
|
201
|
+
},
|
|
202
|
+
children: e.getCaption() ?? ""
|
|
203
|
+
}), "LabelRenderer"), C = u(({ control: e }) => a("div", {
|
|
204
|
+
style: {
|
|
205
|
+
...c,
|
|
206
|
+
border: "var(--sxl-color-neutral, grey) solid 1px",
|
|
207
|
+
backgroundColor: "var(--sxl-color-base-100, white)",
|
|
208
|
+
display: "flex",
|
|
209
|
+
alignItems: "center",
|
|
210
|
+
justifyContent: "center",
|
|
211
|
+
overflow: "hidden",
|
|
212
|
+
whiteSpace: "nowrap"
|
|
213
|
+
},
|
|
214
|
+
children: e.getName?.() ?? e.getTypeDescription()
|
|
215
|
+
}), "UnmodeledControlRenderer");
|
|
216
|
+
export { d as ButtonRenderer, f as CheckBoxRenderer, y as DropDownRenderer, x as GroupBoxRenderer, S as LabelRenderer, b as ListBoxRenderer, p as OptionButtonRenderer, m as ScrollBarRenderer, _ as SpinnerRenderer, C as UnmodeledControlRenderer };
|
|
@@ -0,0 +1,123 @@
|
|
|
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 { h as t, i as n, p as r } from "./Bow9CzRJrYxak2i5.mjs";
|
|
9
|
+
import { forwardRef as i, memo as a, useContext as o, useEffect as s, useReducer as c } from "react";
|
|
10
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
|
+
import { useSurfaceState as d } from "@sheetxl/grid-react";
|
|
12
|
+
var f = a(i((i, a) => {
|
|
13
|
+
let { children: f, disabled: p, style: m, container: h, movable: g, zoom: _ = 1, isDragging: v, onHide: y, onShow: b, onDragZone: x, adornmentHost: S, flip: C, gesture: w, ...T } = i, [, E] = c((e) => e + 1, 0);
|
|
14
|
+
e(g ?? null, {
|
|
15
|
+
onBoundsChange: E,
|
|
16
|
+
onSelectionChange: E,
|
|
17
|
+
onAnyChange: E
|
|
18
|
+
});
|
|
19
|
+
let D = g?.getMovables() ?? null;
|
|
20
|
+
e(D, { onCollectionChange: E });
|
|
21
|
+
let [O] = d("movable-drag", null), k = o(r), A = D?.getItems({ ignoreHidden: !0 }) ?? [];
|
|
22
|
+
s(() => {
|
|
23
|
+
let e = A.map((e) => e.addListeners({
|
|
24
|
+
onBoundsChange: E,
|
|
25
|
+
onAnyChange: E,
|
|
26
|
+
onSelectionChange: E
|
|
27
|
+
}));
|
|
28
|
+
return () => {
|
|
29
|
+
for (let t of e) t();
|
|
30
|
+
};
|
|
31
|
+
}, [A.map((e) => e.getId()).join("|")]);
|
|
32
|
+
let j = g?.getBounds();
|
|
33
|
+
if (h.isDeleted() || !g || !j) return null;
|
|
34
|
+
let M = m?.pointerEvents === "none", N = !M && !p && g.isSelected(), P = O?.[g.getId()] ?? null, F = P?.bounds ?? j, I = g.getFlip(), L = C ?? P?.flip ?? I, R = (j.width > 0 ? F.width / j.width : 1) * (L.horizontal === I.horizontal ? 1 : -1), z = (j.height > 0 ? F.height / j.height : 1) * (L.vertical === I.vertical ? 1 : -1), B = g.getRotation() || 0, V = [
|
|
35
|
+
`translate(${F.width * _ / 2}px, ${F.height * _ / 2}px)`,
|
|
36
|
+
R !== 1 || z !== 1 ? `scale(${R}, ${z})` : "",
|
|
37
|
+
B ? `rotate(${-B}deg)` : "",
|
|
38
|
+
`translate(${-(j.x + j.width / 2) * _}px, ${-(j.y + j.height / 2) * _}px)`
|
|
39
|
+
].filter(Boolean).join(" ");
|
|
40
|
+
return u("div", {
|
|
41
|
+
className: "group-editor",
|
|
42
|
+
...T,
|
|
43
|
+
ref: a,
|
|
44
|
+
style: {
|
|
45
|
+
width: "100%",
|
|
46
|
+
height: "100%",
|
|
47
|
+
position: "relative",
|
|
48
|
+
overflow: "visible",
|
|
49
|
+
...m,
|
|
50
|
+
pointerEvents: "none"
|
|
51
|
+
},
|
|
52
|
+
children: [l("div", {
|
|
53
|
+
className: "group-canvas",
|
|
54
|
+
style: {
|
|
55
|
+
position: "absolute",
|
|
56
|
+
left: 0,
|
|
57
|
+
top: 0,
|
|
58
|
+
transformOrigin: "0 0",
|
|
59
|
+
transform: V,
|
|
60
|
+
pointerEvents: "none"
|
|
61
|
+
},
|
|
62
|
+
children: A.map((e) => {
|
|
63
|
+
let r = n(e.getContent().getType()), i = O?.[e.getId()] ?? null, a = i?.bounds ?? e.getBounds();
|
|
64
|
+
if (!a || !r) return null;
|
|
65
|
+
let o = i?.rotation ?? (e.getRotation() || 0);
|
|
66
|
+
return l("div", {
|
|
67
|
+
className: "group-member",
|
|
68
|
+
[t]: e.getId(),
|
|
69
|
+
style: {
|
|
70
|
+
position: "absolute",
|
|
71
|
+
left: a.x * _,
|
|
72
|
+
top: a.y * _,
|
|
73
|
+
width: a.width * _,
|
|
74
|
+
height: a.height * _,
|
|
75
|
+
transform: o ? `rotate(${o}deg)` : void 0,
|
|
76
|
+
transformOrigin: "center",
|
|
77
|
+
opacity: i ? .7 : void 0,
|
|
78
|
+
pointerEvents: "none"
|
|
79
|
+
},
|
|
80
|
+
children: l(r, {
|
|
81
|
+
movable: e,
|
|
82
|
+
zoom: _,
|
|
83
|
+
flip: i?.flip ?? e.getFlip(),
|
|
84
|
+
disabled: p,
|
|
85
|
+
isDragging: v || !!i,
|
|
86
|
+
adornmentHost: k.get(e) ?? null,
|
|
87
|
+
style: {
|
|
88
|
+
position: "relative",
|
|
89
|
+
left: 0,
|
|
90
|
+
top: 0,
|
|
91
|
+
width: "100%",
|
|
92
|
+
height: "100%",
|
|
93
|
+
pointerEvents: M ? "none" : "auto"
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
}, e.getId());
|
|
97
|
+
})
|
|
98
|
+
}), N ? l("svg", {
|
|
99
|
+
className: "group-edge",
|
|
100
|
+
width: "100%",
|
|
101
|
+
height: "100%",
|
|
102
|
+
style: {
|
|
103
|
+
position: "absolute",
|
|
104
|
+
left: 0,
|
|
105
|
+
top: 0,
|
|
106
|
+
overflow: "visible",
|
|
107
|
+
pointerEvents: "none"
|
|
108
|
+
},
|
|
109
|
+
children: l("rect", {
|
|
110
|
+
x: 0,
|
|
111
|
+
y: 0,
|
|
112
|
+
width: "100%",
|
|
113
|
+
height: "100%",
|
|
114
|
+
fill: "none",
|
|
115
|
+
stroke: "transparent",
|
|
116
|
+
pointerEvents: "stroke",
|
|
117
|
+
style: { strokeWidth: "var(--sxl-handle-hit, 11px)" }
|
|
118
|
+
})
|
|
119
|
+
}) : null]
|
|
120
|
+
});
|
|
121
|
+
}));
|
|
122
|
+
f.displayName = "GroupEditor";
|
|
123
|
+
export { f as GroupEditor };
|