@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.
Files changed (248) hide show
  1. package/browser/esm/BHjeSMaycUkS5dVL.mjs +66 -0
  2. package/browser/esm/BZcQ-KYwS62Ut45c.mjs +20 -0
  3. package/browser/esm/Bow9CzRJrYxak2i5.mjs +318 -0
  4. package/browser/esm/BuvXl14hs-1CvjeA.mjs +2706 -0
  5. package/browser/esm/BwRduT8FTrk5n72r.mjs +32 -0
  6. package/browser/esm/C6urN77szrYwODXF.mjs +134 -0
  7. package/browser/esm/CYMRbtPIr6SklGpp.mjs +775 -0
  8. package/browser/esm/CYoUd5KIl7W3AsxH.mjs +196 -0
  9. package/browser/esm/Cfe0kofqVKGxLqO6.mjs +31 -0
  10. package/browser/esm/CiRN-woJZWYOgTn4.mjs +36 -0
  11. package/browser/esm/Dd-ZybXAgoq9pgGv.mjs +45 -0
  12. package/browser/esm/DjiBz4H74I6nPUY6.mjs +79 -0
  13. package/browser/esm/DyU9UInRnfkPYYlR.mjs +63 -0
  14. package/browser/esm/J8cPagZBeXz86Lnd.mjs +777 -0
  15. package/browser/esm/Sp6PJavGKpF8SJzA.mjs +75 -0
  16. package/browser/esm/cYjYjqEsyd63x8t4.mjs +67 -0
  17. package/browser/esm/chart.mjs +60 -0
  18. package/browser/esm/control.mjs +216 -0
  19. package/browser/esm/group.mjs +123 -0
  20. package/browser/esm/index.mjs +14070 -9138
  21. package/browser/esm/note.mjs +86 -0
  22. package/browser/esm/picture.mjs +86 -0
  23. package/{node/esm/DAE_NG8D9uT50zUH.mjs → browser/esm/shape.mjs} +2 -4
  24. package/browser/esm/slicer.mjs +276 -0
  25. package/licenses/dependencies.txt +6 -599
  26. package/node/esm/BJ7ZZm63j5O6cvrB.mjs +134 -0
  27. package/node/esm/BfRn5S5V4X8xIAEa.mjs +20 -0
  28. package/node/esm/BpwE3HqTnrLLzE3C.mjs +775 -0
  29. package/node/esm/Buw-VKYJy3y5dbaJ.mjs +197 -0
  30. package/node/esm/CFFlJxNwgyInjEnh.mjs +45 -0
  31. package/node/esm/CM5BT7h-hMtST2bE.mjs +2706 -0
  32. package/node/esm/CV3bT3Hql74GcHoU.mjs +37 -0
  33. package/node/esm/C_ANM4feA1xV-pri.mjs +32 -0
  34. package/node/esm/D3YXHeOyFp00Xk3m.mjs +323 -0
  35. package/node/esm/DPN0n6MGYQ9vZ2KO.mjs +80 -0
  36. package/node/esm/DYosMUJKp-3MSO4q.mjs +76 -0
  37. package/node/esm/DhSq680c5tgMFFbj.mjs +68 -0
  38. package/node/esm/Dxbm6ryIDCEi26RO.mjs +66 -0
  39. package/node/esm/GkmuxU7OwRZtm2Rf.mjs +63 -0
  40. package/node/esm/chart.mjs +60 -0
  41. package/node/esm/control.mjs +216 -0
  42. package/node/esm/group.mjs +123 -0
  43. package/node/esm/index.mjs +16618 -11534
  44. package/node/esm/note.mjs +87 -0
  45. package/node/esm/picture.mjs +86 -0
  46. package/node/esm/shape.mjs +783 -0
  47. package/node/esm/slicer.mjs +278 -0
  48. package/package.json +53 -14
  49. package/resources/contents.json +18 -0
  50. package/resources/locales/contents.json +42 -0
  51. package/resources/locales/de/movable.cmd.json +154 -0
  52. package/resources/locales/de/picture.cmd.json +31 -0
  53. package/resources/locales/de/selection.cmd.json +8 -0
  54. package/resources/locales/de/shape.cmd.json +17 -0
  55. package/resources/locales/de/sheet.cmd.json +328 -21
  56. package/resources/locales/de/slicer.cmd.json +17 -0
  57. package/resources/locales/de/table.cmd.json +9 -1
  58. package/resources/locales/de/ui.msg.json +309 -3
  59. package/resources/locales/de/workbook.cmd.json +10 -6
  60. package/resources/locales/en/movable.cmd.json +154 -0
  61. package/resources/locales/en/picture.cmd.json +31 -0
  62. package/resources/locales/en/selection.cmd.json +8 -0
  63. package/resources/locales/en/shape.cmd.json +17 -0
  64. package/resources/locales/en/sheet.cmd.json +342 -22
  65. package/resources/locales/en/slicer.cmd.json +17 -0
  66. package/resources/locales/en/table.cmd.json +9 -1
  67. package/resources/locales/en/ui.msg.json +309 -3
  68. package/resources/locales/en/workbook.cmd.json +11 -7
  69. package/types/chart.d.ts +2 -0
  70. package/types/control.d.ts +2 -0
  71. package/types/group.d.ts +2 -0
  72. package/types/note.d.ts +2 -0
  73. package/types/picture.d.ts +2 -0
  74. package/types/shape.d.ts +2 -0
  75. package/types/slicer.d.ts +2 -0
  76. package/types/src/annotation/RangeAnnotations.d.ts +119 -0
  77. package/types/src/annotation/index.d.ts +2 -0
  78. package/types/src/autoFill/AutoFillPresets.d.ts +14 -0
  79. package/types/src/autoFill/FillMenu.d.ts +36 -0
  80. package/types/src/autoFill/FillSeries.d.ts +38 -0
  81. package/types/src/autoFill/index.d.ts +4 -0
  82. package/types/src/border/StaticBorderRenderer.d.ts +2 -2
  83. package/types/src/border/useBorders.d.ts +7 -7
  84. package/types/src/cell/CornerTriangle.d.ts +6 -0
  85. package/types/src/cell/FormulaCellRenderer.d.ts +1 -1
  86. package/types/src/cell/OutlineButton.d.ts +123 -0
  87. package/types/src/cell/SheetCellRenderer.d.ts +2 -2
  88. package/types/src/cell/SheetHeaderRenderer.d.ts +5 -0
  89. package/types/src/cell/StaticCellRenderer.d.ts +57 -0
  90. package/types/src/cell/index.d.ts +2 -0
  91. package/types/src/cell/useFormulaViewAnchor.d.ts +1 -1
  92. package/types/src/chart/index.d.ts +0 -1
  93. package/types/src/checklist/ValueChecklist.d.ts +112 -0
  94. package/types/src/checklist/index.d.ts +2 -0
  95. package/types/src/commands/ContextualToolbar.d.ts +19 -0
  96. package/types/src/commands/createTransactionalMiddleware.d.ts +4 -1
  97. package/types/src/commands/index.d.ts +1 -0
  98. package/types/src/comment/CommentCardRequest.d.ts +94 -0
  99. package/types/src/comment/CommentUtils.d.ts +43 -0
  100. package/types/src/comment/NoteEditor.d.ts +20 -0
  101. package/types/src/comment/index.d.ts +5 -0
  102. package/types/src/comment/useCommentThread.d.ts +37 -0
  103. package/types/src/comment/useSheetComments.d.ts +28 -0
  104. package/types/src/{sheet → conditionalFormat}/ConditionalFormatPresets.d.ts +6 -6
  105. package/types/src/conditionalFormat/index.d.ts +1 -0
  106. package/types/src/control/FormControlRenderers.d.ts +22 -0
  107. package/types/src/editor/FunctionPreviewPanel.d.ts +15 -1
  108. package/types/src/editor/NamedItemLabel.d.ts +29 -0
  109. package/types/src/editor/NamedItemsPanel.d.ts +13 -2
  110. package/types/src/editor/SheetCellEditorLayer.d.ts +3 -7
  111. package/types/src/editor/SheetCellEditorStartLayer.d.ts +44 -0
  112. package/types/src/editor/SheetCellInput.d.ts +26 -2
  113. package/types/src/editor/SheetEditable.d.ts +8 -2
  114. package/types/src/editor/formulaCaret.d.ts +39 -10
  115. package/types/src/editor/formulaEval.d.ts +9 -5
  116. package/types/src/editor/formulaLint.d.ts +36 -0
  117. package/types/src/editor/formulaPresentation.d.ts +7 -0
  118. package/types/src/editor/formulaText.d.ts +17 -5
  119. package/types/src/editor/functionArgs.d.ts +20 -0
  120. package/types/src/editor/index.d.ts +4 -1
  121. package/types/src/editor/pickedReference.d.ts +76 -0
  122. package/types/src/editor/useEditRejectedNotice.d.ts +32 -0
  123. package/types/src/editor/useFormulaHints.d.ts +93 -3
  124. package/types/src/editor/useFormulaInput.d.ts +30 -4
  125. package/types/src/editor/useReferenceMode.d.ts +12 -0
  126. package/types/src/editor/validationAlert.d.ts +24 -0
  127. package/types/src/externalLink/ExternalLinksPaneArgs.d.ts +23 -0
  128. package/types/src/externalLink/index.d.ts +2 -0
  129. package/types/src/form/FormulaInput.d.ts +18 -2
  130. package/types/src/form/FormulaInputParts.d.ts +10 -1
  131. package/types/src/form/useEditCommit.d.ts +23 -3
  132. package/types/src/form/useInputField.d.ts +2 -3
  133. package/types/src/frame/CommandContext.d.ts +188 -6
  134. package/types/src/group/GroupEditor.d.ts +25 -0
  135. package/types/src/index.d.ts +12 -2
  136. package/types/src/io/WorkbookIO.d.ts +2 -0
  137. package/types/src/layer/CellErrorLayer.d.ts +24 -7
  138. package/types/src/layer/CommentCardLayer.d.ts +43 -0
  139. package/types/src/layer/CommentsLayer.d.ts +35 -0
  140. package/types/src/layer/ConditionalIcons.d.ts +4 -4
  141. package/types/src/layer/FreezeDragLines.d.ts +17 -0
  142. package/types/src/layer/GridFreezeLayer.d.ts +11 -0
  143. package/types/src/layer/HeaderFreezeLayer.d.ts +12 -0
  144. package/types/src/layer/HeaderResizerLayer.d.ts +2 -1
  145. package/types/src/layer/HyperlinkLayer.d.ts +109 -0
  146. package/types/src/layer/MovableKindScope.d.ts +17 -0
  147. package/types/src/layer/ProtectionLayer.d.ts +52 -0
  148. package/types/src/layer/RangeAnnotationLayer.d.ts +71 -0
  149. package/types/src/layer/ResizeIndicator.d.ts +9 -8
  150. package/types/src/layer/ResizeTooltip.d.ts +13 -0
  151. package/types/src/layer/SheetHeaderCellLayer.d.ts +10 -1
  152. package/types/src/layer/SheetOutlineLayer.d.ts +40 -0
  153. package/types/src/layer/TableLayer.d.ts +5 -4
  154. package/types/src/layer/TableToolbar.d.ts +42 -0
  155. package/types/src/layer/ValidationDropdownLayer.d.ts +15 -5
  156. package/types/src/layer/ValidationIndicatorLayer.d.ts +9 -3
  157. package/types/src/layer/ValidationPromptLayer.d.ts +64 -0
  158. package/types/src/layer/_tableColor.d.ts +4 -0
  159. package/types/src/layer/cellTip.d.ts +13 -0
  160. package/types/src/layer/freezeDragState.d.ts +21 -0
  161. package/types/src/layer/index.d.ts +12 -1
  162. package/types/src/layer/resizeIndicatorState.d.ts +3 -1
  163. package/types/src/layer/useFreezeDrag.d.ts +22 -0
  164. package/types/src/layer/useValidationPicker.d.ts +35 -35
  165. package/types/src/layer/validationMark.d.ts +63 -0
  166. package/types/src/listener/useModelListener.d.ts +4 -4
  167. package/types/src/movable/ConnectionSites.d.ts +18 -0
  168. package/types/src/movable/IMovableArea.d.ts +56 -0
  169. package/types/src/movable/MovableAdornment.d.ts +26 -0
  170. package/types/src/movable/MovableCommandGroups.d.ts +40 -0
  171. package/types/src/movable/MovableCommands.d.ts +6 -1
  172. package/types/src/movable/MovableControl.d.ts +78 -0
  173. package/types/src/movable/MovableEdit.d.ts +22 -0
  174. package/types/src/movable/MovableFrame.d.ts +16 -13
  175. package/types/src/movable/MovableLayer.d.ts +25 -7
  176. package/types/src/movable/MovableRenderers.d.ts +210 -0
  177. package/types/src/movable/PlaceholderFrames.d.ts +11 -0
  178. package/types/src/movable/RotateHandle.d.ts +37 -0
  179. package/types/src/movable/TextBox.d.ts +34 -0
  180. package/types/src/movable/connect.d.ts +16 -0
  181. package/types/src/movable/framePlacement.d.ts +72 -0
  182. package/types/src/movable/geometry.d.ts +61 -0
  183. package/types/src/movable/index.d.ts +10 -0
  184. package/types/src/movable/pressTarget.d.ts +20 -0
  185. package/types/src/picker/PickerPanel.d.ts +52 -0
  186. package/types/src/picker/cellPickerOpen.d.ts +6 -0
  187. package/types/src/picker/index.d.ts +4 -0
  188. package/types/src/picker/useCellPicker.d.ts +95 -0
  189. package/types/src/picture/PictureCommands.d.ts +12 -0
  190. package/types/src/picture/PictureKind.d.ts +7 -0
  191. package/types/src/picture/index.d.ts +0 -1
  192. package/types/src/protection/ProtectionPaneArgs.d.ts +31 -0
  193. package/types/src/protection/index.d.ts +3 -0
  194. package/types/src/protection/unlockProtectedRanges.d.ts +23 -0
  195. package/types/src/richText/RichTextEditor.d.ts +41 -0
  196. package/types/src/richText/index.d.ts +2 -0
  197. package/types/src/selection/SheetSelectionLayer.d.ts +14 -10
  198. package/types/src/shape/ConnectorControl.d.ts +46 -0
  199. package/types/src/shape/ShapeCommands.d.ts +11 -0
  200. package/types/src/shape/ShapeControl.d.ts +8 -0
  201. package/types/src/shape/ShapeEditor.d.ts +15 -2
  202. package/types/src/shape/ShapeGallery.d.ts +31 -0
  203. package/types/src/shape/ShapeHandles.d.ts +28 -0
  204. package/types/src/shape/ShapeKind.d.ts +7 -0
  205. package/types/src/shape/ShapeSVG.d.ts +22 -0
  206. package/types/src/shape/ShapeText.d.ts +17 -0
  207. package/types/src/shape/icons/ShapeIcons.d.ts +16 -0
  208. package/types/src/shape/icons/_ShapeIconPack.d.ts +4 -0
  209. package/types/src/shape/index.d.ts +3 -1
  210. package/types/src/shape/shapeFrame.d.ts +50 -0
  211. package/types/src/shape/shapeStyle.d.ts +82 -0
  212. package/types/src/sheet/ISheetElement.d.ts +62 -65
  213. package/types/src/sheet/SheetCommandProvider.d.ts +9 -4
  214. package/types/src/sheet/SheetCommands.d.ts +21 -6
  215. package/types/src/sheet/SheetOutlineElement.d.ts +70 -0
  216. package/types/src/sheet/SheetScrollbar.d.ts +1 -10
  217. package/types/src/sheet/_freezeAt.d.ts +10 -0
  218. package/types/src/sheet/_useHeaderMetrics.d.ts +11 -0
  219. package/types/src/sheet/circularReferences.d.ts +9 -1
  220. package/types/src/sheet/index.d.ts +1 -1
  221. package/types/src/sheet/useCycleHighlight.d.ts +21 -0
  222. package/types/src/slicer/SlicerCommands.d.ts +10 -0
  223. package/types/src/slicer/SlicerEditor.d.ts +8 -2
  224. package/types/src/slicer/SlicerKind.d.ts +7 -0
  225. package/types/src/slicer/SlicerStylePreview.d.ts +18 -0
  226. package/types/src/slicer/index.d.ts +2 -1
  227. package/types/src/slicer/slicerStyles.d.ts +32 -0
  228. package/types/src/tabStrip/TabStrip.d.ts +7 -0
  229. package/types/src/taskPane/ITaskPane.d.ts +12 -1
  230. package/types/src/taskPane/MovablePane.d.ts +17 -0
  231. package/types/src/taskPane/index.d.ts +1 -0
  232. package/types/src/theme/ThemeState.d.ts +14 -1
  233. package/types/src/theme/useGridColorScheme.d.ts +1 -1
  234. package/types/src/workbook/DefaultMovableRenderers.d.ts +20 -0
  235. package/types/src/workbook/IWorkbookElement.d.ts +24 -0
  236. package/types/src/workbook/WorkbookCommands.d.ts +2 -4
  237. package/types/src/workbook/WorkbookStrip.d.ts +9 -0
  238. package/types/src/workbook/_followOrigin.d.ts +9 -0
  239. package/types/src/workbook/useWorkbookFormat.d.ts +3 -3
  240. package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
  241. package/browser/cjs/Pl04-kDEQSO8_qFU.cjs +0 -156
  242. package/browser/cjs/index.cjs +0 -35
  243. package/browser/esm/SJMJzBwlXTJ9QIO5.mjs +0 -6286
  244. package/types/src/editor/useProtectedEditNotice.d.ts +0 -14
  245. package/types/src/layer/validationList.d.ts +0 -84
  246. package/types/src/list/SheetValueList.d.ts +0 -93
  247. package/types/src/list/index.d.ts +0 -2
  248. 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 };