@sheetxl/react 0.8.0-beta.10 → 0.8.0-beta.12
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/B4mT3G7GHwgDYFGP.mjs +128 -0
- package/browser/esm/{BwRduT8FTrk5n72r.mjs → BDlpRkuBok0Uu4Hn.mjs} +1 -1
- package/browser/esm/BR-AiOwuQlYh5-tr.mjs +730 -0
- package/browser/esm/{BuvXl14hs-1CvjeA.mjs → BapujiblfiXDlu67.mjs} +1 -1
- package/browser/esm/{DyU9UInRnfkPYYlR.mjs → CSFORKZ8zrVL_Y0w.mjs} +1 -1
- package/browser/esm/CUekkfE6uwwsdQpc.mjs +36 -0
- package/browser/esm/C_LUq-BnguetvGZz.mjs +23561 -0
- package/browser/esm/{BZcQ-KYwS62Ut45c.mjs → Ck1LbcsdSfKNi6xq.mjs} +1 -1
- package/browser/esm/{CYoUd5KIl7W3AsxH.mjs → Cslk_qRdBSuJIi1O.mjs} +24 -23
- package/browser/esm/CtGhA0kS2MCfEsHN.mjs +262 -0
- package/browser/esm/D22NJmTiky4NL8tM.mjs +8 -0
- package/browser/esm/D2GydDzPuvIjdpok.mjs +42 -0
- package/browser/esm/DGG1auUKsjFbAazu.mjs +60 -0
- package/browser/esm/{Cfe0kofqVKGxLqO6.mjs → DN3lqq95KY0K6f1x.mjs} +1 -1
- package/browser/esm/{DjiBz4H74I6nPUY6.mjs → D_usN3pWuCJU2GN-.mjs} +2 -2
- package/browser/esm/{Sp6PJavGKpF8SJzA.mjs → DhYQRc8L2kALmFNz.mjs} +1 -1
- package/browser/esm/{Bow9CzRJrYxak2i5.mjs → DxEczXCHTerDemDP.mjs} +113 -108
- package/browser/esm/{Dd-ZybXAgoq9pgGv.mjs → LBQDhVhz7S7i6a8i.mjs} +1 -1
- package/browser/esm/{C6urN77szrYwODXF.mjs → ZoS0cpNEBcv6p-Z1.mjs} +1 -1
- package/browser/esm/{cYjYjqEsyd63x8t4.mjs → _6Sb6ElRcZftxMNh.mjs} +1 -1
- package/browser/esm/chart.mjs +33 -52
- package/browser/esm/control.mjs +2 -2
- package/browser/esm/group.mjs +3 -3
- package/browser/esm/index.mjs +8074 -5647
- package/browser/esm/note.mjs +73 -47
- package/browser/esm/picture.mjs +41 -41
- package/browser/esm/shape.mjs +2 -2
- package/browser/esm/slicer.mjs +5 -5
- package/licenses/dependencies.txt +313 -1
- package/node/esm/{Dxbm6ryIDCEi26RO.mjs → Apcuz4_QtBHt7G47.mjs} +1 -1
- package/node/esm/Bi2Jwc0zpweaNzKc.mjs +1697 -0
- package/node/esm/{Buw-VKYJy3y5dbaJ.mjs → C0KLMCRb3sbd5Q20.mjs} +23 -22
- package/node/esm/CH1DVfFhjdd_3pw1.mjs +128 -0
- package/node/esm/{BJ7ZZm63j5O6cvrB.mjs → CNOLkUDURBElaaIf.mjs} +1 -1
- package/node/esm/{DhSq680c5tgMFFbj.mjs → CalVk3o4-kX79s3v.mjs} +1 -1
- package/node/esm/{DYosMUJKp-3MSO4q.mjs → Cp1DuCae46eQKzWy.mjs} +1 -1
- package/node/esm/CzN6c6KyxVmNvayz.mjs +8 -0
- package/node/esm/DKqdv5JubgVaq-g9.mjs +35 -0
- package/node/esm/DWkPWuf5ZrLRMixG.mjs +328 -0
- package/node/esm/{BfRn5S5V4X8xIAEa.mjs → DXiNwr6ZnXBe7TlG.mjs} +1 -1
- package/node/esm/DayGI0Bt57FDNbVF.mjs +37 -0
- package/node/esm/{CM5BT7h-hMtST2bE.mjs → DyetXBW7vFLJWB22.mjs} +1 -1
- package/node/esm/{CFFlJxNwgyInjEnh.mjs → MWges5ywL3aEdChp.mjs} +1 -1
- package/node/esm/{DPN0n6MGYQ9vZ2KO.mjs → T5lfCrudsUnOTxEn.mjs} +1 -1
- package/node/esm/YB_qExw23Ci4nMYy.mjs +263 -0
- package/node/esm/{GkmuxU7OwRZtm2Rf.mjs → bRD1KCpSpAYTEs50.mjs} +1 -1
- package/node/esm/chart.mjs +32 -51
- package/node/esm/control.mjs +2 -2
- package/node/esm/group.mjs +3 -3
- package/node/esm/{C_ANM4feA1xV-pri.mjs → iL9jKJcnED6oi0B4.mjs} +1 -1
- package/node/esm/index.mjs +10998 -8556
- package/node/esm/note.mjs +86 -60
- package/node/esm/picture.mjs +41 -41
- package/node/esm/shape.mjs +285 -332
- package/node/esm/slicer.mjs +15 -15
- package/package.json +8 -6
- package/resources/contents.json +6 -0
- package/resources/locales/contents.json +14 -0
- package/resources/locales/de/chart.cmd.json +82 -0
- package/resources/locales/de/sheet.cmd.json +32 -0
- package/resources/locales/de/table.cmd.json +1 -1
- package/resources/locales/de/ui.msg.json +12 -0
- package/resources/locales/de/workbook.cmd.json +11 -0
- package/resources/locales/en/chart.cmd.json +82 -0
- package/resources/locales/en/sheet.cmd.json +32 -0
- package/resources/locales/en/table.cmd.json +1 -1
- package/resources/locales/en/ui.msg.json +14 -0
- package/resources/locales/en/workbook.cmd.json +11 -0
- package/types/src/autoFill/FillMenu.d.ts +2 -2
- package/types/src/autoFill/FillSeries.d.ts +2 -2
- package/types/src/border/StaticBorderRenderer.d.ts +18 -1
- package/types/src/border/useBorders.d.ts +76 -3
- package/types/src/cell/CellCheckboxRenderer.d.ts +20 -0
- package/types/src/cell/CellContent.d.ts +68 -0
- package/types/src/cell/CellControlContext.d.ts +37 -0
- package/types/src/cell/{FormulaCellRenderer.d.ts → CellFormulaRenderer.d.ts} +10 -7
- package/types/src/cell/CellImageRenderer.d.ts +11 -0
- package/types/src/cell/CellRenderers.d.ts +190 -0
- package/types/src/cell/{SheetCellRenderer.d.ts → CellTextRenderer.d.ts} +9 -6
- package/types/src/cell/ColumnButton.d.ts +3 -3
- package/types/src/cell/OutlineButton.d.ts +4 -4
- package/types/src/cell/SheetHeaderRenderer.d.ts +1 -1
- package/types/src/cell/index.d.ts +8 -2
- package/types/src/cell/useFormulaViewAnchor.d.ts +3 -3
- package/types/src/cell/useInsertableCellControls.d.ts +25 -0
- package/types/src/chart/ChartCommands.d.ts +15 -0
- package/types/src/chart/ChartEditor.d.ts +12 -2
- package/types/src/chart/ChartElement.d.ts +122 -0
- package/types/src/chart/ChartKind.d.ts +7 -0
- package/types/src/chart/PresetChartTypeDescriptors.d.ts +3 -1
- package/types/src/chart/index.d.ts +2 -0
- package/types/src/chart/paint/_fills.d.ts +24 -0
- package/types/src/chart/paint/_graphics.d.ts +46 -0
- package/types/src/chart/paint/_mode.d.ts +6 -0
- package/types/src/chart/paint/echarts.d.ts +33 -0
- package/types/src/chart/paint/index.d.ts +12 -0
- package/types/src/chart/paint/kinds/ChartPaintKind.d.ts +140 -0
- package/types/src/chart/paint/kinds/_Area.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Bar.d.ts +3 -0
- package/types/src/chart/paint/kinds/_BoxWhisker.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Bubble.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Funnel.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Histogram.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Line.d.ts +10 -0
- package/types/src/chart/paint/kinds/_OfPie.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Pie.d.ts +21 -0
- package/types/src/chart/paint/kinds/_Placeholder.d.ts +7 -0
- package/types/src/chart/paint/kinds/_Radar.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Scatter.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Sunburst.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Surface.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Treemap.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Waterfall.d.ts +3 -0
- package/types/src/chart/paint/kinds/_builtIns.d.ts +12 -0
- package/types/src/chart/paint/toEChartsOption.d.ts +42 -0
- package/types/src/clipboard/ClipboardCommands.d.ts +3 -3
- package/types/src/clipboard/SheetClipboardLayer.d.ts +2 -2
- package/types/src/comment/CommentCardRequest.d.ts +9 -9
- package/types/src/comment/useSheetComments.d.ts +2 -2
- package/types/src/context/WorksheetContext.d.ts +18 -0
- package/types/src/context/index.d.ts +1 -1
- package/types/src/editableLabel/EditableLabel.d.ts +3 -1
- package/types/src/editor/EditorCommands.d.ts +3 -3
- package/types/src/editor/SheetCellEditorLayer.d.ts +2 -2
- package/types/src/editor/SheetCellEditorStartLayer.d.ts +22 -5
- package/types/src/editor/SheetEditable.d.ts +6 -6
- package/types/src/editor/SheetReferenceHeaderLayer.d.ts +1 -1
- package/types/src/editor/SheetReferenceLayer.d.ts +4 -4
- package/types/src/editor/VirtualKeyboardLayer.d.ts +49 -0
- package/types/src/editor/formulaAnchor.d.ts +12 -0
- package/types/src/editor/index.d.ts +1 -0
- package/types/src/editor/pickedReference.d.ts +3 -3
- package/types/src/editor/useEditRejectedNotice.d.ts +3 -3
- package/types/src/editor/useFormulaHints.d.ts +3 -3
- package/types/src/editor/validationAlert.d.ts +3 -3
- package/types/src/frame/CommandContext.d.ts +7 -7
- package/types/src/index.d.ts +2 -0
- package/types/src/layer/BorderLayer.d.ts +2 -2
- package/types/src/layer/CellErrorLayer.d.ts +5 -4
- package/types/src/layer/CellFillLayer.d.ts +2 -2
- package/types/src/layer/CellIndicatorLayer.d.ts +31 -0
- package/types/src/layer/CellInsertLayer.d.ts +71 -0
- package/types/src/layer/CircularIndicatorLayer.d.ts +2 -2
- package/types/src/layer/CommentCardLayer.d.ts +2 -2
- package/types/src/layer/CommentsLayer.d.ts +2 -2
- package/types/src/layer/ConditionalBarLayer.d.ts +2 -2
- package/types/src/layer/ConditionalIconsLayer.d.ts +2 -2
- package/types/src/layer/ContextMenuLayer.d.ts +2 -2
- package/types/src/layer/GridFreezeLayer.d.ts +2 -2
- package/types/src/layer/HeaderSelectionLayer.d.ts +4 -4
- package/types/src/layer/HyperlinkLayer.d.ts +11 -8
- package/types/src/layer/MovableKindScope.d.ts +2 -2
- package/types/src/layer/ProtectionLayer.d.ts +4 -5
- package/types/src/layer/RangeAnnotationLayer.d.ts +2 -2
- package/types/src/layer/ResizeIndicator.d.ts +2 -2
- package/types/src/layer/SheetBackgroundLayer.d.ts +3 -3
- package/types/src/layer/SheetCellLayer.d.ts +15 -8
- package/types/src/layer/SheetColumnButtonLayer.d.ts +2 -2
- package/types/src/layer/SheetGridLineLayer.d.ts +11 -13
- package/types/src/layer/SheetLayers.d.ts +115 -0
- package/types/src/layer/SheetMovableLayer.d.ts +4 -3
- package/types/src/layer/SheetOutlineLayer.d.ts +3 -3
- package/types/src/layer/SheetTableCommandLayer.d.ts +2 -2
- package/types/src/layer/SpillLayer.d.ts +2 -2
- package/types/src/layer/TableLayer.d.ts +3 -3
- package/types/src/layer/TableToolbar.d.ts +4 -4
- package/types/src/layer/ValidationDropdownLayer.d.ts +2 -2
- package/types/src/layer/ValidationIndicatorLayer.d.ts +2 -2
- package/types/src/layer/ValidationPromptLayer.d.ts +21 -8
- package/types/src/layer/_tableColor.d.ts +2 -2
- package/types/src/layer/index.d.ts +3 -0
- package/types/src/layer/useFreezeDrag.d.ts +2 -2
- package/types/src/layer/useNormalBorderLines.d.ts +15 -0
- package/types/src/layer/useSheetFeatureRegions.d.ts +2 -2
- package/types/src/layer/useSheetVisibleCells.d.ts +2 -2
- package/types/src/layer/useSheetVisibleDecorations.d.ts +2 -2
- package/types/src/layer/useTableHeaderCells.d.ts +2 -2
- package/types/src/layer/useValidationPicker.d.ts +2 -2
- package/types/src/layer/useVisibleTables.d.ts +2 -2
- package/types/src/layer/validationMark.d.ts +3 -3
- package/types/src/listener/index.d.ts +5 -0
- package/types/src/listener/useCell.d.ts +29 -0
- package/types/src/listener/useCellRange.d.ts +23 -0
- package/types/src/listener/useCellValue.d.ts +26 -0
- package/types/src/listener/useModelListener.d.ts +4 -4
- package/types/src/listener/useRangeListener.d.ts +13 -7
- package/types/src/listener/useRangeSnapshot.d.ts +35 -0
- package/types/src/listener/useTable.d.ts +26 -0
- package/types/src/movable/DefaultMovable.d.ts +8 -0
- package/types/src/movable/MovableCommands.d.ts +2 -2
- package/types/src/movable/MovableControl.d.ts +3 -1
- package/types/src/movable/MovableFrame.d.ts +2 -1
- package/types/src/movable/MovableLayer.d.ts +6 -3
- package/types/src/movable/MovableRenderers.d.ts +3 -3
- package/types/src/movable/index.d.ts +1 -0
- package/types/src/picker/cellPickerOpen.d.ts +3 -3
- package/types/src/picker/useCellPicker.d.ts +2 -2
- package/types/src/richText/RichTextEditor.d.ts +2 -2
- package/types/src/selection/SelectionCommands.d.ts +2 -2
- package/types/src/selection/SheetSelectionLayer.d.ts +2 -2
- package/types/src/sheet/ISheetHeaderElement.d.ts +3 -3
- package/types/src/sheet/{ISheetElement.d.ts → IWorksheetElement.d.ts} +64 -32
- package/types/src/sheet/OpaqueSheetElement.d.ts +21 -0
- package/types/src/sheet/SheetCommandProvider.d.ts +5 -2
- package/types/src/sheet/SheetCommands.d.ts +2 -2
- package/types/src/sheet/SheetKindIcon.d.ts +14 -0
- package/types/src/sheet/SheetOutlineElement.d.ts +6 -6
- package/types/src/sheet/SheetPanels.d.ts +11 -0
- package/types/src/sheet/SheetScrollbar.d.ts +3 -3
- package/types/src/sheet/TopLeftCorner.d.ts +2 -2
- package/types/src/sheet/WorksheetElement.d.ts +12 -0
- package/types/src/sheet/_freezeAt.d.ts +2 -2
- package/types/src/sheet/circularReferences.d.ts +3 -3
- package/types/src/sheet/index.d.ts +5 -2
- package/types/src/sheet/useCycleHighlight.d.ts +2 -2
- package/types/src/tabStrip/SheetTab.d.ts +1 -1
- package/types/src/tabStrip/Sortable.d.ts +5 -5
- package/types/src/tabStrip/TabStrip.d.ts +6 -6
- package/types/src/tabStrip/TabStripItem.d.ts +15 -13
- package/types/src/table/TableCommands.d.ts +2 -2
- package/types/src/taskPane/CellControlPane.d.ts +17 -0
- package/types/src/taskPane/TaskPaneArea.d.ts +7 -0
- package/types/src/taskPane/index.d.ts +1 -0
- package/types/src/taskPane/useTaskPane.d.ts +6 -3
- package/types/src/theme/buildOOXMLThemeCSS.d.ts +2 -2
- package/types/src/theme/useGridColorScheme.d.ts +1 -1
- package/types/src/theme/useSystemColors.d.ts +2 -2
- package/types/src/workbook/DefaultRenderers.d.ts +5 -4
- package/types/src/workbook/IWorkbookElement.d.ts +76 -22
- package/types/src/workbook/WorkbookStrip.d.ts +5 -5
- package/browser/esm/BHjeSMaycUkS5dVL.mjs +0 -66
- package/browser/esm/CYMRbtPIr6SklGpp.mjs +0 -775
- package/browser/esm/CiRN-woJZWYOgTn4.mjs +0 -36
- package/browser/esm/J8cPagZBeXz86Lnd.mjs +0 -777
- package/node/esm/BpwE3HqTnrLLzE3C.mjs +0 -775
- package/node/esm/CV3bT3Hql74GcHoU.mjs +0 -37
- package/node/esm/D3YXHeOyFp00Xk3m.mjs +0 -323
- package/types/src/chart/templates/area-stacked-percent-template.json.d.ts +0 -10
- package/types/src/chart/templates/area-stacked-template.json.d.ts +0 -10
- package/types/src/chart/templates/area-template.json.d.ts +0 -9
- package/types/src/chart/templates/bar-stacked-percent-template.json.d.ts +0 -10
- package/types/src/chart/templates/bar-stacked-template.json.d.ts +0 -10
- package/types/src/chart/templates/bar-template.json.d.ts +0 -9
- package/types/src/chart/templates/column-stacked-percent-template.json.d.ts +0 -10
- package/types/src/chart/templates/column-stacked-template.json.d.ts +0 -10
- package/types/src/chart/templates/column-template.json.d.ts +0 -9
- package/types/src/chart/templates/line-markers-template.json.d.ts +0 -10
- package/types/src/chart/templates/line-stacked-markers-template.json.d.ts +0 -11
- package/types/src/chart/templates/line-stacked-percent-markers-template.json.d.ts +0 -11
- package/types/src/chart/templates/line-stacked-percent-template.json.d.ts +0 -10
- package/types/src/chart/templates/line-stacked-template.json.d.ts +0 -10
- package/types/src/chart/templates/line-template.json.d.ts +0 -9
- package/types/src/chart/templates/pie-doughnut-template.json.d.ts +0 -10
- package/types/src/chart/templates/pie-template.json.d.ts +0 -9
- package/types/src/chart/templates/scatter-lines-markers-smooth-template.json.d.ts +0 -10
- package/types/src/chart/templates/scatter-lines-markers-template.json.d.ts +0 -10
- package/types/src/chart/templates/scatter-lines-smooth-template.json.d.ts +0 -10
- package/types/src/chart/templates/scatter-lines-template.json.d.ts +0 -10
- package/types/src/chart/templates/scatter-markers-template.json.d.ts +0 -10
- package/types/src/context/SheetContext.d.ts +0 -18
- package/types/src/sheet/SheetElement.d.ts +0 -15
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.12
|
|
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, useCallback as r, useEffect as n, useLayoutEffect as o, useRef as l, useState as s } from "react";
|
|
8
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
9
|
+
import { CommonUtils as c, defineLazyModule as d } from "@sheetxl/utils";
|
|
10
|
+
import { useImperativeElement as u, useMeasure as h, usePendingRender as g, usePersistentState as m, useResolvedThemeMode as p } from "@sheetxl/utils-react";
|
|
11
|
+
import { useMergeRefs as f } from "react-merge-refs";
|
|
12
|
+
var y = {
|
|
13
|
+
Mode: "themeMode",
|
|
14
|
+
DarkGrid: "enableDarkGrid",
|
|
15
|
+
DarkImages: "enableDarkImages"
|
|
16
|
+
}, b = {
|
|
17
|
+
[y.Mode]: null,
|
|
18
|
+
[y.DarkGrid]: !1,
|
|
19
|
+
[y.DarkImages]: !1
|
|
20
|
+
}, x = (e) => {
|
|
21
|
+
const [t] = m(y.Mode, b[y.Mode]), [r] = m(y.DarkGrid, b[y.DarkGrid]), { themeMode: n } = p({ mode: e ?? t ?? void 0 });
|
|
22
|
+
return e || ("dark" === n && r ? "dark" : "light");
|
|
23
|
+
}, v = () => {
|
|
24
|
+
const [e] = m(y.Mode, b[y.Mode]), { themeMode: t } = p({ mode: e ?? void 0 });
|
|
25
|
+
return t;
|
|
26
|
+
}, k = d("chart:paint", () => import("./Bi2Jwc0zpweaNzKc.mjs")), w = (e, t) => {
|
|
27
|
+
const r = e.getElementType();
|
|
28
|
+
if ("point" === r) {
|
|
29
|
+
const r = e.getParent();
|
|
30
|
+
return t === r || "point" === t?.getElementType() && t.getParent() === r ? e : r;
|
|
31
|
+
}
|
|
32
|
+
if ("legendEntry" === r) {
|
|
33
|
+
const r = e.getParent();
|
|
34
|
+
return t === r || "legendEntry" === t?.getElementType() ? e : r;
|
|
35
|
+
}
|
|
36
|
+
if ("dataLabel" === r) {
|
|
37
|
+
const r = e.getParent()?.getParent(), n = r?.getDataLabels();
|
|
38
|
+
return n ? t === n || "dataLabel" === t?.getElementType() && t.getParent()?.getParent() === r ? e : n : e;
|
|
39
|
+
}
|
|
40
|
+
return e;
|
|
41
|
+
}, E = {
|
|
42
|
+
boxes: [],
|
|
43
|
+
handles: []
|
|
44
|
+
}, M = t(e((e, t) => {
|
|
45
|
+
const { children: d, style: m, chart: p, onChartChange: y, zoom: b = 1, width: x, height: M, selection: P = null, colorScheme: C, onElementPress: D, onPointerDown: L, ...A } = e, [G, S] = s(() => c.isPromiseLike(p) ? null : p), [T, z] = s(null), F = l(y);
|
|
46
|
+
F.current = y;
|
|
47
|
+
const I = l(null);
|
|
48
|
+
n(() => {
|
|
49
|
+
let e = !0;
|
|
50
|
+
const t = (e, t) => {
|
|
51
|
+
z(t), S(e), I.current !== e && (I.current = e, F.current?.(e));
|
|
52
|
+
};
|
|
53
|
+
if (c.isPromiseLike(p)) return p.then((r) => {
|
|
54
|
+
e && t(r, null);
|
|
55
|
+
}, (r) => {
|
|
56
|
+
e && t(null, r);
|
|
57
|
+
}), () => {
|
|
58
|
+
e = !1;
|
|
59
|
+
};
|
|
60
|
+
t(p, null);
|
|
61
|
+
}, [p]);
|
|
62
|
+
const [N, $] = h(), B = "number" == typeof x ? x : $.width, R = "number" == typeof M ? M : $.height, j = B ? Math.round(B / b) : 0, V = R ? Math.round(R / b) : 0, X = l({
|
|
63
|
+
width: j,
|
|
64
|
+
height: V
|
|
65
|
+
});
|
|
66
|
+
X.current = {
|
|
67
|
+
width: j,
|
|
68
|
+
height: V
|
|
69
|
+
};
|
|
70
|
+
const Y = v(), q = "dark" === (C ?? Y), H = r(async (e) => {
|
|
71
|
+
const t = X.current;
|
|
72
|
+
if (!G || !t.width || !t.height) return null;
|
|
73
|
+
const r = G.getLayout(t);
|
|
74
|
+
return r ? (await k.load()).renderChartToSVG(r, { darkMode: e?.darkMode ?? !1 }) : null;
|
|
75
|
+
}, [G]), J = l(null), K = l(null), O = l(b);
|
|
76
|
+
O.current = b;
|
|
77
|
+
const Q = r((e, t) => {
|
|
78
|
+
const r = J.current;
|
|
79
|
+
if (!r) return null;
|
|
80
|
+
const n = r.getBoundingClientRect(), o = O.current || 1;
|
|
81
|
+
return {
|
|
82
|
+
x: (e - n.left) / o,
|
|
83
|
+
y: (t - n.top) / o
|
|
84
|
+
};
|
|
85
|
+
}, []), U = r((e, t) => {
|
|
86
|
+
const r = K.current, n = Q(e, t);
|
|
87
|
+
return G && r && n ? G.getElementAt(n, r) : null;
|
|
88
|
+
}, [G, Q]), W = u(t, () => ({
|
|
89
|
+
isChartElement: () => !0,
|
|
90
|
+
getChart: () => G,
|
|
91
|
+
toSVG: H,
|
|
92
|
+
getElementAt: U
|
|
93
|
+
}), [
|
|
94
|
+
G,
|
|
95
|
+
H,
|
|
96
|
+
U
|
|
97
|
+
]), Z = f([
|
|
98
|
+
W,
|
|
99
|
+
N,
|
|
100
|
+
J
|
|
101
|
+
]), _ = l(null), ee = l(null), [te, re] = s(() => k.peek() ?? null), [ne, oe] = s(null), [le, se] = s(0), [ie, ae] = s(E);
|
|
102
|
+
n(() => G?.addListeners({ onLayoutChange: () => se((e) => e + 1) }), [G]), g(!(ne || T || te && G)), n(() => {
|
|
103
|
+
if (te) return;
|
|
104
|
+
let e = !0;
|
|
105
|
+
return k.load().then((t) => {
|
|
106
|
+
e && re(t);
|
|
107
|
+
}, (t) => {
|
|
108
|
+
e && oe(t);
|
|
109
|
+
}), () => {
|
|
110
|
+
e = !1;
|
|
111
|
+
};
|
|
112
|
+
}, [te]);
|
|
113
|
+
const ce = r(() => {
|
|
114
|
+
const e = K.current;
|
|
115
|
+
ae(G && e && P && !P.isEmpty() ? ((e, t, r) => {
|
|
116
|
+
const n = [], o = [];
|
|
117
|
+
for (const l of r.getItems()) {
|
|
118
|
+
if (l.getChart() !== e) continue;
|
|
119
|
+
const s = l.getElementType();
|
|
120
|
+
if ("series" === s || "dataLabels" === s) {
|
|
121
|
+
const r = "series" === s ? l : l.getParent(), o = "series" === s ? r.getPoints() : r.getPoints().map((e) => e.getDataLabel());
|
|
122
|
+
for (const r of o) {
|
|
123
|
+
const o = e.getElementBounds(r, t);
|
|
124
|
+
o && n.push(o);
|
|
125
|
+
}
|
|
126
|
+
if (n.length > 0) continue;
|
|
127
|
+
}
|
|
128
|
+
const i = e.getElementBounds(l, t);
|
|
129
|
+
if (i && (n.push(i), 1 === r.getItems().length)) {
|
|
130
|
+
const e = [
|
|
131
|
+
i.x,
|
|
132
|
+
i.x + i.width / 2,
|
|
133
|
+
i.x + i.width
|
|
134
|
+
], t = [
|
|
135
|
+
i.y,
|
|
136
|
+
i.y + i.height / 2,
|
|
137
|
+
i.y + i.height
|
|
138
|
+
];
|
|
139
|
+
for (const r of e) for (const n of t) r === e[1] && n === t[1] || o.push({
|
|
140
|
+
x: r,
|
|
141
|
+
y: n
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
boxes: n,
|
|
147
|
+
handles: o
|
|
148
|
+
};
|
|
149
|
+
})(G, e, P) : E);
|
|
150
|
+
}, [G, P]);
|
|
151
|
+
n(() => P?.addListeners({ onChange: ce }), [P, ce]), o(() => {
|
|
152
|
+
const e = _.current;
|
|
153
|
+
if (!(te && e && G && j && V)) return;
|
|
154
|
+
const t = G.getLayout({
|
|
155
|
+
width: j,
|
|
156
|
+
height: V
|
|
157
|
+
});
|
|
158
|
+
if (K.current = t, !t) return ee.current?.dispose(), ee.current = null, e.style.backgroundColor = "", void ce();
|
|
159
|
+
const r = void 0 === t.chartArea.fill;
|
|
160
|
+
e.style.backgroundColor = r ? `var(--sxl-color-base-100, ${q ? "#121212" : "#FFFFFF"})` : "", e.style.borderRadius = r ? `${t.chartArea.cornerRadius}px` : "";
|
|
161
|
+
const n = {
|
|
162
|
+
darkMode: q,
|
|
163
|
+
background: "transparent"
|
|
164
|
+
};
|
|
165
|
+
ee.current ? ee.current.update(t, n) : ee.current = te.mountChart(e, t, n), ce();
|
|
166
|
+
}, [
|
|
167
|
+
te,
|
|
168
|
+
G,
|
|
169
|
+
j,
|
|
170
|
+
V,
|
|
171
|
+
le,
|
|
172
|
+
q,
|
|
173
|
+
ce
|
|
174
|
+
]), n(() => () => {
|
|
175
|
+
ee.current?.dispose(), ee.current = null, K.current = null;
|
|
176
|
+
}, [G]);
|
|
177
|
+
const de = r((e) => {
|
|
178
|
+
if (L?.(e), 0 !== e.button && 2 !== e.button) return;
|
|
179
|
+
const t = K.current, r = Q(e.clientX, e.clientY);
|
|
180
|
+
if (!G || !t || !r) return;
|
|
181
|
+
const n = G.getElementAt(r, t);
|
|
182
|
+
if (D?.({
|
|
183
|
+
element: n,
|
|
184
|
+
point: r,
|
|
185
|
+
event: e
|
|
186
|
+
}), !P) return;
|
|
187
|
+
if (!n || "chartArea" === n.getElementType()) return void P.clear();
|
|
188
|
+
const o = w(n, P.getActive());
|
|
189
|
+
P.isSelected(o) && 1 === P.getItems().length || P.select([o]);
|
|
190
|
+
}, [
|
|
191
|
+
G,
|
|
192
|
+
P,
|
|
193
|
+
D,
|
|
194
|
+
L,
|
|
195
|
+
Q
|
|
196
|
+
]);
|
|
197
|
+
if (G?.isDeleted()) return;
|
|
198
|
+
const ue = ne ?? T;
|
|
199
|
+
return a("div", {
|
|
200
|
+
...A,
|
|
201
|
+
onPointerDown: de,
|
|
202
|
+
style: {
|
|
203
|
+
...void 0 !== x ? { width: x } : {},
|
|
204
|
+
...void 0 !== M ? { height: M } : {},
|
|
205
|
+
...m,
|
|
206
|
+
overflow: "hidden"
|
|
207
|
+
},
|
|
208
|
+
ref: Z,
|
|
209
|
+
children: [
|
|
210
|
+
ue ? i("div", {
|
|
211
|
+
className: "chart-element-error",
|
|
212
|
+
style: {
|
|
213
|
+
padding: "8px",
|
|
214
|
+
fontSize: "12px",
|
|
215
|
+
color: "var(--sxl-color-error, #b00020)"
|
|
216
|
+
},
|
|
217
|
+
children: ue.message
|
|
218
|
+
}) : null,
|
|
219
|
+
i("div", {
|
|
220
|
+
className: "chart-element",
|
|
221
|
+
ref: _,
|
|
222
|
+
style: {
|
|
223
|
+
width: j || "100%",
|
|
224
|
+
height: V || "100%",
|
|
225
|
+
zoom: b,
|
|
226
|
+
position: "relative"
|
|
227
|
+
}
|
|
228
|
+
}),
|
|
229
|
+
ie.boxes.length > 0 ? a("div", {
|
|
230
|
+
className: "chart-element-selection",
|
|
231
|
+
style: {
|
|
232
|
+
position: "absolute",
|
|
233
|
+
left: 0,
|
|
234
|
+
top: 0,
|
|
235
|
+
width: j,
|
|
236
|
+
height: V,
|
|
237
|
+
zoom: b,
|
|
238
|
+
pointerEvents: "none"
|
|
239
|
+
},
|
|
240
|
+
children: [ie.boxes.map((e, t) => i("div", { style: {
|
|
241
|
+
position: "absolute",
|
|
242
|
+
left: e.x - 1,
|
|
243
|
+
top: e.y - 1,
|
|
244
|
+
width: Math.max(0, e.width),
|
|
245
|
+
height: Math.max(0, e.height),
|
|
246
|
+
border: "1px solid var(--sxl-color-primary, #1a73e8)",
|
|
247
|
+
boxSizing: "content-box"
|
|
248
|
+
} }, `box-${t}`)), ie.handles.map((e, t) => i("div", { style: {
|
|
249
|
+
position: "absolute",
|
|
250
|
+
left: e.x - 3,
|
|
251
|
+
top: e.y - 3,
|
|
252
|
+
width: 6,
|
|
253
|
+
height: 6,
|
|
254
|
+
background: "var(--sxl-color-base-100, #fff)",
|
|
255
|
+
border: "1px solid var(--sxl-color-primary, #1a73e8)",
|
|
256
|
+
boxSizing: "border-box"
|
|
257
|
+
} }, `handle-${t}`))]
|
|
258
|
+
}) : null
|
|
259
|
+
]
|
|
260
|
+
});
|
|
261
|
+
}));
|
|
262
|
+
M.displayName = "ChartElement";
|
|
263
|
+
export { b as a, x as i, w as n, y as o, v as r, M as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/node/esm/chart.mjs
CHANGED
|
@@ -1,60 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import { forwardRef as
|
|
9
|
-
import { jsx as a
|
|
10
|
-
import {
|
|
11
|
-
import { useImperativeElement as s, useMeasure as d } from "@sheetxl/utils-react";
|
|
7
|
+
import { i as e, n as t, t as r } from "./YB_qExw23Ci4nMYy.mjs";
|
|
8
|
+
import { forwardRef as o, memo as n, useCallback as l, useLayoutEffect as i, useRef as s } from "react";
|
|
9
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
10
|
+
import { useImperativeElement as m } from "@sheetxl/utils-react";
|
|
12
11
|
import { useMergeRefs as c } from "react-merge-refs";
|
|
13
|
-
var
|
|
14
|
-
const { children:
|
|
15
|
-
i(() => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
var g = n(o((t, o) => {
|
|
13
|
+
const { children: n, disabled: g, style: h, chart: p, zoom: d = 1, isDragging: u, movable: f, onHide: x, onShow: E, onDragZone: v, adornmentHost: b, flip: y, gesture: S, ...w } = t, A = m(o, () => ({ isChartEditor: () => !0 }), []), C = s(null), D = c([A, C]), j = e(), z = f?.getRange()?.getWorksheet()?.getView()?.getChartElementSelection() ?? null;
|
|
14
|
+
i(() => {
|
|
15
|
+
v?.((e) => {
|
|
16
|
+
const t = "touches" in e ? e.touches[0] : e;
|
|
17
|
+
if (!t) return !0;
|
|
18
|
+
const r = C.current?.getElementAt(t.clientX, t.clientY) ?? null;
|
|
19
|
+
return !r || "chartArea" === r.getElementType();
|
|
20
|
+
});
|
|
21
|
+
}, [v]);
|
|
22
|
+
const H = l((e) => {
|
|
23
|
+
!g && e.element && "chartArea" !== e.element.getElementType() && (e.event.stopPropagation(), f && !f.isSelected() && f.select());
|
|
24
|
+
}, [f, g]);
|
|
25
|
+
if (!p.isDeleted()) return a(r, {
|
|
22
26
|
...w,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
justifyContent: "center",
|
|
35
|
-
zoom: g,
|
|
36
|
-
display: "flex",
|
|
37
|
-
flexDirection: "column",
|
|
38
|
-
rowGap: "8px",
|
|
39
|
-
position: "relative",
|
|
40
|
-
border: "var(--sxl-color-neutral, grey) solid 1px",
|
|
41
|
-
filter: p ? "blur(1px)" : void 0,
|
|
42
|
-
boxShadow: x ? "1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))" : void 0
|
|
43
|
-
},
|
|
44
|
-
children: [
|
|
45
|
-
h.getChartTitle(),
|
|
46
|
-
a(E, { style: {
|
|
47
|
-
maxWidth: "260px",
|
|
48
|
-
fill: "grey",
|
|
49
|
-
opacity: .4
|
|
50
|
-
} }),
|
|
51
|
-
a("div", {
|
|
52
|
-
style: { textAlign: "center" },
|
|
53
|
-
children: n.camelToPrettyCase(h.getChartType())
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
})
|
|
27
|
+
chart: p,
|
|
28
|
+
zoom: d,
|
|
29
|
+
colorScheme: j,
|
|
30
|
+
selection: g ? null : z,
|
|
31
|
+
onElementPress: H,
|
|
32
|
+
style: {
|
|
33
|
+
...h,
|
|
34
|
+
filter: g ? "blur(1px)" : void 0,
|
|
35
|
+
boxShadow: u ? "1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))" : void 0
|
|
36
|
+
},
|
|
37
|
+
ref: D
|
|
57
38
|
});
|
|
58
39
|
}));
|
|
59
|
-
|
|
60
|
-
export {
|
|
40
|
+
g.displayName = "ChartEditor";
|
|
41
|
+
export { g as ChartEditor, r as ChartElement, t as nextSelected };
|
package/node/esm/control.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { t as e } from "./
|
|
7
|
+
import { t as e } from "./MWges5ywL3aEdChp.mjs";
|
|
8
8
|
import { memo as t, useEffect as n, useReducer as r, useRef as o } from "react";
|
|
9
9
|
import { jsx as i, jsxs as l } from "react/jsx-runtime";
|
|
10
10
|
var d = (e) => {
|
package/node/esm/group.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { t as e } from "./
|
|
8
|
-
import { h as t, i as o, p as n } from "./
|
|
7
|
+
import { t as e } from "./MWges5ywL3aEdChp.mjs";
|
|
8
|
+
import { h as t, i as o, p as n } from "./DWkPWuf5ZrLRMixG.mjs";
|
|
9
9
|
import { forwardRef as i, memo as r, useContext as s, useEffect as l, useReducer as a } from "react";
|
|
10
10
|
import { jsx as d, jsxs as g } from "react/jsx-runtime";
|
|
11
11
|
import { useSurfaceState as h } from "@sheetxl/grid-react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|