@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,18 +1,19 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IWorksheet } from '@sheetxl/sdk';
|
|
3
3
|
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
import { RenderSlotFn } from '@sheetxl/utils-react';
|
|
4
5
|
import { IMovableLayerElement, MovableLayerProps, MovableElementProps } from '../movable';
|
|
5
6
|
export interface SheetMovableLayerProps extends LayerProps {
|
|
6
7
|
/** Class forwarded to the inner layer's host box (devtools identification). */
|
|
7
8
|
className?: string;
|
|
8
|
-
sheet:
|
|
9
|
+
sheet: IWorksheet;
|
|
9
10
|
/**
|
|
10
11
|
* Render a movable element
|
|
11
12
|
*
|
|
12
13
|
* @param props The props for the movable element
|
|
13
14
|
* @returns The rendered movable element
|
|
14
15
|
*/
|
|
15
|
-
renderMovable:
|
|
16
|
+
renderMovable: RenderSlotFn<MovableElementProps>;
|
|
16
17
|
/**
|
|
17
18
|
* Props to pass to MovableLayer
|
|
18
19
|
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { IRange,
|
|
2
|
+
import { IRange, IWorksheet } from '@sheetxl/sdk';
|
|
3
3
|
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
4
|
import { OutlineButtonProps } from '../cell/OutlineButton';
|
|
5
5
|
export interface SheetOutlineLayerProps extends LayerProps {
|
|
6
6
|
/** The sheet whose outline is drawn. */
|
|
7
|
-
sheet:
|
|
7
|
+
sheet: IWorksheet;
|
|
8
8
|
/** Rows or columns. */
|
|
9
9
|
axis: IRange.Axis;
|
|
10
10
|
/** The lanes across the gutter: one per level, plus one. */
|
|
11
11
|
lanes: number;
|
|
12
12
|
/** Renders a group's collapse / expand button. Defaults to `OutlineButton`. */
|
|
13
|
-
renderButton?: (props: OutlineButtonProps) => React.ReactNode;
|
|
13
|
+
renderButton?: ((props: OutlineButtonProps) => React.ReactNode) | null;
|
|
14
14
|
/**
|
|
15
15
|
* The space around the buttons, in pixels: between neighbors, before the first and after the last.
|
|
16
16
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IWorksheet } from '@sheetxl/sdk';
|
|
3
3
|
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
4
|
export interface SheetTableCommandLayerProps extends LayerProps {
|
|
5
|
-
sheet:
|
|
5
|
+
sheet: IWorksheet;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* **Command-only layer for the `table` scope** — no visuals (the visual chrome lives in {@link TableLayer});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IWorksheet } from '@sheetxl/sdk';
|
|
3
3
|
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
4
|
export interface SpillLayerProps extends LayerProps {
|
|
5
5
|
/** Style for the outline box. */
|
|
@@ -7,7 +7,7 @@ export interface SpillLayerProps extends LayerProps {
|
|
|
7
7
|
/**
|
|
8
8
|
* The sheet.
|
|
9
9
|
*/
|
|
10
|
-
sheet:
|
|
10
|
+
sheet: IWorksheet;
|
|
11
11
|
/**
|
|
12
12
|
* The animation time in milliseconds.
|
|
13
13
|
*
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IWorksheet } from '@sheetxl/sdk';
|
|
3
3
|
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
4
|
import { TableToolbarRenderProps } from './TableToolbar';
|
|
5
5
|
export interface TableLayerProps extends LayerProps {
|
|
6
6
|
/**
|
|
7
7
|
* The sheet.
|
|
8
8
|
*/
|
|
9
|
-
sheet:
|
|
9
|
+
sheet: IWorksheet;
|
|
10
10
|
/**
|
|
11
11
|
* The toolbar that floats at a hovered table's top-right corner.
|
|
12
12
|
* @defaultValue a plain split button: edit the table · a menu of the table commands
|
|
13
13
|
*/
|
|
14
|
-
renderToolbar?: (props: TableToolbarRenderProps) => React.ReactNode;
|
|
14
|
+
renderToolbar?: ((props: TableToolbarRenderProps) => React.ReactNode) | null;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Is the outline, resizer, and row selection.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IWorksheet, ITable } from '@sheetxl/sdk';
|
|
3
3
|
import { HoverTipProps, StickyState } from '@sheetxl/grid-react';
|
|
4
4
|
/** What the table toolbar is handed. */
|
|
5
5
|
export interface TableToolbarRenderProps {
|
|
6
|
-
sheet:
|
|
6
|
+
sheet: IWorksheet;
|
|
7
7
|
/** The hovered table. A press anywhere on the toolbar makes it the current table first, so the table commands act on it. */
|
|
8
8
|
table: ITable;
|
|
9
9
|
/** The table's theme color, for chrome that wears it. */
|
|
@@ -19,10 +19,10 @@ export interface TableToolbarRenderProps {
|
|
|
19
19
|
}
|
|
20
20
|
/** What {@link TableLayer} hands its toolbar float. */
|
|
21
21
|
export interface TableToolbarFloatProps {
|
|
22
|
-
sheet:
|
|
22
|
+
sheet: IWorksheet;
|
|
23
23
|
/** The table under the pointer, as the table layer's hover found it. */
|
|
24
24
|
hovered: ITable | null;
|
|
25
|
-
renderToolbar?: (props: TableToolbarRenderProps) => React.ReactNode;
|
|
25
|
+
renderToolbar?: ((props: TableToolbarRenderProps) => React.ReactNode) | null;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* The **table toolbar** — hover a table and its commands float at its top-right corner: a quick action
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { CellCoords } from '@sheetxl/utils';
|
|
3
|
-
import {
|
|
3
|
+
import { IWorksheet, IDataValidation, IRange } from '@sheetxl/sdk';
|
|
4
4
|
import { IEditable, LayerProps } from '@sheetxl/grid-react';
|
|
5
5
|
/** What the probe hands the button: the validations to offer, and the cell they belong to. */
|
|
6
6
|
export interface ValidationDropdown {
|
|
@@ -22,7 +22,7 @@ export interface ValidationDropdownLayerProps extends Omit<LayerProps, 'children
|
|
|
22
22
|
/** Style for the floated button container. */
|
|
23
23
|
style?: React.CSSProperties;
|
|
24
24
|
/** The sheet whose selection is followed. */
|
|
25
|
-
sheet:
|
|
25
|
+
sheet: IWorksheet;
|
|
26
26
|
/**
|
|
27
27
|
* The editable a pick is entered through — the sheet's shared one, so a pick is a typed entry:
|
|
28
28
|
* coerced, formatted and checked as one. Without it the button opens nothing.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IWorksheet } from '@sheetxl/sdk';
|
|
3
3
|
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
4
|
export interface ValidationIndicatorLayerProps extends LayerProps {
|
|
5
5
|
/** Class for the layer (devtools identification). */
|
|
@@ -7,7 +7,7 @@ export interface ValidationIndicatorLayerProps extends LayerProps {
|
|
|
7
7
|
/** Style for the indicators host box. */
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
9
|
/** The sheet whose data validations are indicated. */
|
|
10
|
-
sheet:
|
|
10
|
+
sheet: IWorksheet;
|
|
11
11
|
/** Size (px, unzoomed) of the invalid-value corner mark. @defaultValue 7 */
|
|
12
12
|
markSize?: number;
|
|
13
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { CellCoords, RangeCoords } from '@sheetxl/utils';
|
|
3
|
-
import { IDataValidation,
|
|
3
|
+
import { IDataValidation, IWorksheet } from '@sheetxl/sdk';
|
|
4
4
|
import { IEditable, LayerProps } from '@sheetxl/grid-react';
|
|
5
5
|
import { ValidationAlert } from '../editor/validationAlert';
|
|
6
6
|
/** The prompt a cell shows: the rule's title and message, and the range it hangs under. */
|
|
@@ -16,16 +16,17 @@ export interface ValidationPrompt {
|
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* The input prompt for the cell at `coords`: from the first covering rule, by priority, that shows
|
|
19
|
-
* a prompt and has a title or a message to show. `null` when none does
|
|
19
|
+
* a prompt and has a title or a message to show. `null` when none does, or when the sheet disables
|
|
20
|
+
* prompts.
|
|
20
21
|
*/
|
|
21
|
-
export declare const findValidationPrompt: (sheet:
|
|
22
|
+
export declare const findValidationPrompt: (sheet: IWorksheet, coords: CellCoords) => ValidationPrompt | null;
|
|
22
23
|
export interface ValidationPromptLayerProps extends Omit<LayerProps, 'children'> {
|
|
23
24
|
/** Class for the floated container. */
|
|
24
25
|
className?: string;
|
|
25
26
|
/** Style for the floated container. */
|
|
26
27
|
style?: React.CSSProperties;
|
|
27
28
|
/** The sheet whose selection is followed, and whose entries are checked. */
|
|
28
|
-
sheet:
|
|
29
|
+
sheet: IWorksheet;
|
|
29
30
|
/**
|
|
30
31
|
* The editable entries are typed through. It tells an alert on an open edit, which stays while
|
|
31
32
|
* the edit does, from one left behind, which the next key or press clears.
|
|
@@ -35,14 +36,26 @@ export interface ValidationPromptLayerProps extends Omit<LayerProps, 'children'>
|
|
|
35
36
|
offset?: number;
|
|
36
37
|
/**
|
|
37
38
|
* Render the prompt yourself. Spread `floatProps` on the returned element. Omit for the default
|
|
38
|
-
* box: the title in bold over the message.
|
|
39
|
+
* box: the title in bold over the message; `null` for none.
|
|
39
40
|
*/
|
|
40
|
-
renderPrompt?: (
|
|
41
|
+
renderPrompt?: ((props: ValidationPromptRenderProps) => React.ReactNode) | null;
|
|
41
42
|
/**
|
|
42
43
|
* Render the alert yourself. Spread `floatProps` on the returned element. Omit for the default
|
|
43
|
-
* card: the rule's alert title and message, and what to do next.
|
|
44
|
+
* card: the rule's alert title and message, and what to do next; `null` for none.
|
|
44
45
|
*/
|
|
45
|
-
renderAlert?: (
|
|
46
|
+
renderAlert?: ((props: ValidationAlertRenderProps) => React.ReactNode) | null;
|
|
47
|
+
}
|
|
48
|
+
/** What {@link ValidationPromptLayerProps.renderPrompt} is handed. */
|
|
49
|
+
export interface ValidationPromptRenderProps {
|
|
50
|
+
prompt: ValidationPrompt;
|
|
51
|
+
/** Spread on the returned element: its placement and pointer handling. */
|
|
52
|
+
floatProps: React.HTMLAttributes<HTMLElement>;
|
|
53
|
+
}
|
|
54
|
+
/** What {@link ValidationPromptLayerProps.renderAlert} is handed. */
|
|
55
|
+
export interface ValidationAlertRenderProps {
|
|
56
|
+
alert: ValidationAlert;
|
|
57
|
+
/** Spread on the returned element: its placement and pointer handling. */
|
|
58
|
+
floatProps: React.HTMLAttributes<HTMLElement>;
|
|
46
59
|
}
|
|
47
60
|
/**
|
|
48
61
|
* The **input prompt** of a data validation, and the **alert** an entry raised in its place — one
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IWorksheet, ITable } from '@sheetxl/sdk';
|
|
2
2
|
/** The table's theme color (header fill / whole-table top border) as CSS; grey when the style has none. */
|
|
3
|
-
export declare const tableLabelColor: (table: ITable, sheet:
|
|
3
|
+
export declare const tableLabelColor: (table: ITable, sheet: IWorksheet) => string;
|
|
4
4
|
//# sourceMappingURL=_tableColor.d.ts.map
|
|
@@ -25,9 +25,12 @@ export * from './ValidationDropdownLayer';
|
|
|
25
25
|
export * from './ValidationPromptLayer';
|
|
26
26
|
export * from './useValidationPicker';
|
|
27
27
|
export * from './CircularIndicatorLayer';
|
|
28
|
+
export * from './CellIndicatorLayer';
|
|
28
29
|
export * from './CommentsLayer';
|
|
29
30
|
export * from './CommentCardLayer';
|
|
30
31
|
export * from './RangeAnnotationLayer';
|
|
32
|
+
export * from './SheetLayers';
|
|
33
|
+
export * from './CellInsertLayer';
|
|
31
34
|
export * from './ProtectionLayer';
|
|
32
35
|
export * from './HeaderSelectionLayer';
|
|
33
36
|
export * from './HeaderResizerLayer';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IWorksheet, IRange } from '@sheetxl/sdk';
|
|
2
2
|
import { FreezeDragPosition } from '@sheetxl/grid-react';
|
|
3
3
|
export interface FreezeDrag {
|
|
4
4
|
disabled: boolean;
|
|
@@ -18,5 +18,5 @@ export interface FreezeDrag {
|
|
|
18
18
|
* The drag is allowed only when the scrolling area starts exactly at the freeze — otherwise the frozen
|
|
19
19
|
* and scrolling areas are not contiguous and a drop could not land where it was let go.
|
|
20
20
|
*/
|
|
21
|
-
export declare const useFreezeDrag: (sheet:
|
|
21
|
+
export declare const useFreezeDrag: (sheet: IWorksheet, axis: IRange.Axis) => FreezeDrag;
|
|
22
22
|
//# sourceMappingURL=useFreezeDrag.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IWorksheet } from '@sheetxl/sdk';
|
|
2
|
+
import { BorderNormalLine } from '../border';
|
|
3
|
+
/**
|
|
4
|
+
* The Normal style's border as one line per axis — a border on every cell, blank ones included.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* A boundary is the trailing edge of one cell and the leading edge of the next; the Normal style's
|
|
8
|
+
* two edges meet there and the one Excel draws wins. `null` on an axis with no Normal border.
|
|
9
|
+
* Identity is stable while the resolved style is. The caller re-renders on `onStyleChange`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useNormalBorderLines: (sheet: IWorksheet) => {
|
|
12
|
+
rows: BorderNormalLine | null;
|
|
13
|
+
columns: BorderNormalLine | null;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useNormalBorderLines.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICellRange, ICellRegion, IRange,
|
|
1
|
+
import { ICellRange, ICellRegion, IRange, IWorksheet } from '@sheetxl/sdk';
|
|
2
2
|
import { IGridPane } from '@sheetxl/grid-react';
|
|
3
3
|
export interface SheetFeatureRegions {
|
|
4
4
|
/** The viewport's regions for the feature — engine-merged blocks, ready to place. */
|
|
@@ -17,5 +17,5 @@ export interface SheetFeatureRegions {
|
|
|
17
17
|
* {@link useSheetVisibleCells}'s shape — per-pane, cached by range key, token-invalidated — so
|
|
18
18
|
* layers can swap sources without changing their contract.
|
|
19
19
|
*/
|
|
20
|
-
export declare const useSheetFeatureRegions: (sheet:
|
|
20
|
+
export declare const useSheetFeatureRegions: (sheet: IWorksheet, feature: ICellRange.Feature) => SheetFeatureRegions;
|
|
21
21
|
//# sourceMappingURL=useSheetFeatureRegions.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IWorksheet, ICell, IRange } from '@sheetxl/sdk';
|
|
2
2
|
import { IGridPane } from '@sheetxl/grid-react';
|
|
3
3
|
export type SheetVisibleCell = {
|
|
4
4
|
cell: ICell.Coords;
|
|
@@ -56,5 +56,5 @@ export interface SheetVisibleCells {
|
|
|
56
56
|
* layer(s) that asked, never the grid above them. Used by {@link SheetCellLayer} and
|
|
57
57
|
* {@link SheetGridLineLayer}.
|
|
58
58
|
*/
|
|
59
|
-
export declare const useSheetVisibleCells: (sheet:
|
|
59
|
+
export declare const useSheetVisibleCells: (sheet: IWorksheet, options?: SheetVisibleCellsOptions) => SheetVisibleCells;
|
|
60
60
|
//# sourceMappingURL=useSheetVisibleCells.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IWorksheet, ICell, IRange, IConditionalFormat } from '@sheetxl/sdk';
|
|
2
2
|
import { IGridPane } from '@sheetxl/grid-react';
|
|
3
3
|
/** One visible cell a conditional-format rule DRAWS in. */
|
|
4
4
|
export interface SheetDecoratedCell {
|
|
@@ -38,5 +38,5 @@ export interface SheetVisibleDecorations {
|
|
|
38
38
|
* (`onConditionalFormatsChange`), or a value moves within a rule's range — which can restripe every
|
|
39
39
|
* cell the rule covers, not just the edited one, because the domain is range-wide.
|
|
40
40
|
*/
|
|
41
|
-
export declare const useSheetVisibleDecorations: (sheet:
|
|
41
|
+
export declare const useSheetVisibleDecorations: (sheet: IWorksheet, kind: SheetDecorationKind) => SheetVisibleDecorations;
|
|
42
42
|
//# sourceMappingURL=useSheetVisibleDecorations.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IWorksheet } from '@sheetxl/sdk';
|
|
2
2
|
import { SheetVisibleCells } from './useSheetVisibleCells';
|
|
3
3
|
/**
|
|
4
4
|
* The "which cells host a column (filter/sort) button" source for a single pane, plus
|
|
@@ -18,5 +18,5 @@ import { SheetVisibleCells } from './useSheetVisibleCells';
|
|
|
18
18
|
* table add/remove/auto-table/layout/undo (sheet events) and hidden-button / show-headers / column
|
|
19
19
|
* add-remove / resize (which fire `onAnyChange` on the TABLE, so we subscribe to each table too).
|
|
20
20
|
*/
|
|
21
|
-
export declare const useTableHeaderCells: (sheet:
|
|
21
|
+
export declare const useTableHeaderCells: (sheet: IWorksheet) => SheetVisibleCells;
|
|
22
22
|
//# sourceMappingURL=useTableHeaderCells.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CellCoords } from '@sheetxl/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { IWorksheet, IDataValidation } from '@sheetxl/sdk';
|
|
3
3
|
import { GridAnchor, IEditable } from '@sheetxl/grid-react';
|
|
4
4
|
import { CellPicker } from '../picker';
|
|
5
5
|
/**
|
|
@@ -8,7 +8,7 @@ import { CellPicker } from '../picker';
|
|
|
8
8
|
*/
|
|
9
9
|
export interface ValidationPickerOptions {
|
|
10
10
|
/** The sheet the chosen value is written to. */
|
|
11
|
-
sheet:
|
|
11
|
+
sheet: IWorksheet;
|
|
12
12
|
/**
|
|
13
13
|
* The editable the pick is entered through — the same path as typing the item's text, so the value
|
|
14
14
|
* coerces and formats as a typed one does. `null` offers nothing.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IWorksheet, ITable } from '@sheetxl/sdk';
|
|
2
2
|
export interface VisibleTables {
|
|
3
3
|
/** The tables intersecting this pane's visible range (empty array — stable identity — when none). */
|
|
4
4
|
visibleTables: readonly ITable[];
|
|
@@ -23,5 +23,5 @@ export interface VisibleTables {
|
|
|
23
23
|
* PLUS each visible table's `onAnyChange` — table mutations (hidden-button toggle, show-headers, column
|
|
24
24
|
* add/remove, resize) fire on the TABLE, not the sheet.
|
|
25
25
|
*/
|
|
26
|
-
export declare const useVisibleTables: (sheet:
|
|
26
|
+
export declare const useVisibleTables: (sheet: IWorksheet) => VisibleTables;
|
|
27
27
|
//# sourceMappingURL=useVisibleTables.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CellCoords, RangeCoords } from '@sheetxl/utils';
|
|
2
|
-
import { IDataValidation,
|
|
2
|
+
import { IDataValidation, IWorksheet } from '@sheetxl/sdk';
|
|
3
3
|
import { VisibleCell } from '@sheetxl/grid-react';
|
|
4
4
|
/**
|
|
5
5
|
* How a cell's value fails its data validations: `'failed'` when every failing rule raises no
|
|
@@ -38,7 +38,7 @@ export declare const resolveValidationMark: (rules: readonly IDataValidation[],
|
|
|
38
38
|
* Only cells holding a value are visited, unless a rule has Ignore blank off: an empty cell can fail
|
|
39
39
|
* that one, so the window's empty cells are visited too — bounded by the window, as painting is.
|
|
40
40
|
*/
|
|
41
|
-
export declare const findVisibleValidationMarks: (sheet:
|
|
41
|
+
export declare const findVisibleValidationMarks: (sheet: IWorksheet, coords: RangeCoords) => VisibleCell[];
|
|
42
42
|
/**
|
|
43
43
|
* What the hover tip over a cell's invalid-value mark says.
|
|
44
44
|
*/
|
|
@@ -55,7 +55,7 @@ export interface ValidationTip {
|
|
|
55
55
|
* (Show Invalid off), the value passes, or the cell is the active one and its input prompt is
|
|
56
56
|
* already saying what it wants.
|
|
57
57
|
*/
|
|
58
|
-
export declare const findValidationTip: (sheet:
|
|
58
|
+
export declare const findValidationTip: (sheet: IWorksheet, coords: CellCoords) => ValidationTip | null;
|
|
59
59
|
/** The color a mark is drawn in, per state: the theme's severity colors, neutral for no alert. */
|
|
60
60
|
export declare const VALIDATION_MARK_COLORS: Record<ValidationMarkState, string>;
|
|
61
61
|
/** The glyph for each state (the Base icon pack), the same the rule editor shows for a style. */
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export * from './useModelListener';
|
|
2
2
|
export * from './useRangeListener';
|
|
3
|
+
export * from './useCellRange';
|
|
4
|
+
export * from './useCellValue';
|
|
5
|
+
export * from './useCell';
|
|
6
|
+
export type { CellRangeTarget, CellRangeHookOptions } from './useRangeSnapshot';
|
|
7
|
+
export * from './useTable';
|
|
3
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ICell, ICellRange } from '@sheetxl/sdk';
|
|
2
|
+
import { CellRangeTarget, CellRangeHookOptions } from './useRangeSnapshot';
|
|
3
|
+
/**
|
|
4
|
+
* Binds a single cell: returns a snapshot of it and an updater, and re-renders with a new snapshot when
|
|
5
|
+
* the cell changes.
|
|
6
|
+
*
|
|
7
|
+
* @param target The workbook or sheet to read from, or `null` while there is none.
|
|
8
|
+
* @param address The cell's address. A larger range binds its top-left cell.
|
|
9
|
+
* @param options Listener options, and an optional `onChange` that receives each change event.
|
|
10
|
+
* @returns The cell, or `null` while `target` is `null`, and an updater that does nothing until there
|
|
11
|
+
* is a target.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* The cell is a snapshot: it does not change after it is returned, so it is safe to compare or memoize
|
|
15
|
+
* on. Its formatted text, type, formula, and errors are all available alongside the value.
|
|
16
|
+
*
|
|
17
|
+
* The updater takes anything {@link ICellRange.updateCells} does: a value, a cell, or
|
|
18
|
+
* {@link ICell.Modifiers} such as `{ value, style }`. Text is parsed by default, so `'=SUM(A1:A3)'`
|
|
19
|
+
* becomes a formula; pass `{ textParser: false }` to store it as text. For a plain value, see
|
|
20
|
+
* {@link useCellValue}.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const [total] = useCell(sheet, 'D23');
|
|
25
|
+
* return <output>{total?.getText()}</output>;
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const useCell: (target: CellRangeTarget | null | undefined, address: ICellRange.Address, options?: CellRangeHookOptions) => [ICell | null, (update: ICell.Update, options?: ICellRange.UpdateCellsOptions) => void];
|
|
29
|
+
//# sourceMappingURL=useCell.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ICellRange } from '@sheetxl/sdk';
|
|
2
|
+
import { CellRangeTarget, CellRangeHookOptions } from './useRangeSnapshot';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the range at `address` and re-renders whenever anything in it changes: values (including
|
|
5
|
+
* recalculated formula results), styles, or its address.
|
|
6
|
+
*
|
|
7
|
+
* @param target The workbook or sheet to read from, or `null` while there is none.
|
|
8
|
+
* @param address The range's address. An object address is compared by identity, so keep it stable.
|
|
9
|
+
* @param options Listener options, and an optional `onChange` that receives each change event.
|
|
10
|
+
* @returns The range, or `null` while `target` is `null`.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* The returned range is the same object across renders; read from it during render. For a single
|
|
14
|
+
* value use {@link useCellValue}, and for a single cell's full state use {@link useCell}.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const items = useCellRange(sheet, 'A7:C18');
|
|
19
|
+
* const rows = items?.getValues() ?? [];
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const useCellRange: (target: CellRangeTarget | null | undefined, address: ICellRange.Address, options?: CellRangeHookOptions) => ICellRange | null;
|
|
23
|
+
//# sourceMappingURL=useCellRange.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ICellRange, Scalar } from '@sheetxl/sdk';
|
|
2
|
+
import { CellRangeTarget, CellRangeHookOptions } from './useRangeSnapshot';
|
|
3
|
+
/**
|
|
4
|
+
* Binds a cell's value like `useState`: returns the value and a setter, and re-renders when the value
|
|
5
|
+
* changes, whether from the setter, the grid, or a recalculation.
|
|
6
|
+
*
|
|
7
|
+
* @template T The expected value type. This is not checked or converted: an empty cell is `null`, and a
|
|
8
|
+
* cell can hold any type.
|
|
9
|
+
* @param target The workbook or sheet to read from, or `null` while there is none.
|
|
10
|
+
* @param address The cell's address. A larger range binds its top-left cell.
|
|
11
|
+
* @param options Listener options, and an optional `onChange` that receives each change event.
|
|
12
|
+
* @returns The value, or `null` while `target` is `null`, and a setter that does nothing until there
|
|
13
|
+
* is a target.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* The setter writes the value as-is: text is never parsed, so `'=1+1'` is stored as text rather than as
|
|
17
|
+
* a formula. To write formulas or styles, use {@link useCell}.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const [customer, setCustomer] = useCellValue<string>(sheet, 'A4');
|
|
22
|
+
* return <input value={customer ?? ''} onChange={(e) => setCustomer(e.target.value)} />;
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const useCellValue: <T extends Scalar = Scalar>(target: CellRangeTarget | null | undefined, address: ICellRange.Address, options?: CellRangeHookOptions) => [T | null, (value: T | null) => void];
|
|
26
|
+
//# sourceMappingURL=useCellValue.d.ts.map
|
|
@@ -25,8 +25,8 @@ export interface ModelListenerOptions extends Omit<IListener.Options, 'once'> {
|
|
|
25
25
|
/**
|
|
26
26
|
* React hook for subscribing to model-level events (workbooks, sheets, etc.).
|
|
27
27
|
*
|
|
28
|
-
* @template SOURCE - The model type (e.g., IWorkbook,
|
|
29
|
-
* @template EVENTS - The listener interface type (e.g.,
|
|
28
|
+
* @template SOURCE - The model type (e.g., IWorkbook, IWorksheet)
|
|
29
|
+
* @template EVENTS - The listener interface type (e.g., IWorksheet.IListeners)
|
|
30
30
|
*
|
|
31
31
|
* @param source - The model instance to listen to, or `null` to listen to nothing
|
|
32
32
|
* @param listeners - Object containing listener callbacks for various events
|
|
@@ -45,8 +45,8 @@ export interface ModelListenerOptions extends Omit<IListener.Options, 'once'> {
|
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
47
|
* ```tsx
|
|
48
|
-
* function SheetComponent({ sheet }: { sheet:
|
|
49
|
-
* useModelListener<
|
|
48
|
+
* function SheetComponent({ sheet }: { sheet: IWorksheet }) {
|
|
49
|
+
* useModelListener<IWorksheet, IWorksheet.IListeners>(sheet, {
|
|
50
50
|
* onSave(source, json) {
|
|
51
51
|
* console.log('Sheet saved:', json);
|
|
52
52
|
* },
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { ICellRange } from '@sheetxl/sdk';
|
|
2
|
-
export
|
|
3
|
-
fireOnAddressChange: boolean;
|
|
4
|
-
}
|
|
2
|
+
export type useRangeListenerOptions = ICellRange.ListenerOptions;
|
|
5
3
|
export interface RangeContainer {
|
|
6
4
|
getRange(address: ICellRange.Address, options?: ICellRange.GetRangeOptions): ICellRange;
|
|
7
5
|
}
|
|
8
6
|
/**
|
|
9
|
-
*
|
|
7
|
+
* Listen to a range of `model` for as long as the component is mounted.
|
|
8
|
+
*
|
|
9
|
+
* @param model What the range is read from: a workbook or a sheet.
|
|
10
|
+
* @param address The range to listen to. Nothing is listened to while it is `null`.
|
|
11
|
+
* @param listener Called with each {@link ICellRange.Event}. The latest render's listener is the
|
|
12
|
+
* one called, so it may close over state without re-subscribing.
|
|
13
|
+
* @param options Which events to hear and how the range follows inserts and deletes
|
|
14
|
+
* ({@link ICellRange.ListenerOptions}). Read once per subscription.
|
|
10
15
|
*
|
|
11
|
-
* @
|
|
12
|
-
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* The subscription is renewed when `model` or `address` changes. Nothing is delivered for that
|
|
18
|
+
* renewal: the listener only hears what the range itself reports.
|
|
13
19
|
*/
|
|
14
|
-
export declare const useRangeListener: (model: RangeContainer, address: ICellRange.Address, listener: ICellRange.Listener, options?: useRangeListenerOptions) => void;
|
|
20
|
+
export declare const useRangeListener: (model: RangeContainer | null | undefined, address: ICellRange.Address | null | undefined, listener: ICellRange.Listener, options?: useRangeListenerOptions) => void;
|
|
15
21
|
//# sourceMappingURL=useRangeListener.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ICellRange, IWorkbook, IWorksheet } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* A workbook or a sheet: anything a range can be read from. A workbook address may be sheet-qualified
|
|
4
|
+
* (`'Invoice!A4'`); an unqualified one reads from the selected sheet.
|
|
5
|
+
*/
|
|
6
|
+
export type CellRangeTarget = IWorkbook | IWorksheet;
|
|
7
|
+
/**
|
|
8
|
+
* Options shared by the cell-binding hooks.
|
|
9
|
+
*/
|
|
10
|
+
export interface CellRangeHookOptions extends Omit<ICellRange.ListenerOptions, 'transactional'> {
|
|
11
|
+
/**
|
|
12
|
+
* Called with every change event the hook receives, before it re-renders.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Uses the hook's own subscription. To receive events without re-rendering, use
|
|
16
|
+
* {@link useRangeListener} instead.
|
|
17
|
+
*/
|
|
18
|
+
onChange?: ICellRange.Listener;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resolves `address` against `target` and returns the range with a value read from it. Both are
|
|
22
|
+
* re-read only after the range reports a change, so they are stable between changes, as
|
|
23
|
+
* `useSyncExternalStore` requires.
|
|
24
|
+
*
|
|
25
|
+
* @param topLeft Narrow the range to its top-left cell.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* The range follows its cells: when rows or columns are inserted or deleted around it (or undone),
|
|
29
|
+
* the returned range is the one at the new address, so a write goes where the cells went.
|
|
30
|
+
*/
|
|
31
|
+
export declare const useRangeSnapshot: <T>(target: CellRangeTarget | null | undefined, address: ICellRange.Address, topLeft: boolean, read: (range: ICellRange) => T, options?: CellRangeHookOptions) => {
|
|
32
|
+
range: ICellRange | null;
|
|
33
|
+
snapshot: T | null;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=useRangeSnapshot.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ITable } from '@sheetxl/sdk';
|
|
2
|
+
import { CellRangeTarget, CellRangeHookOptions } from './useRangeSnapshot';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the table named `name` and re-renders when it changes: rows added or removed, its cells
|
|
5
|
+
* edited, or its settings changed.
|
|
6
|
+
*
|
|
7
|
+
* @param target The workbook or sheet to find the table in, or `null` while there is none. A workbook
|
|
8
|
+
* looks in each of its sheets.
|
|
9
|
+
* @param name The table's name.
|
|
10
|
+
* @param options Listener options for its cells, and an optional `onChange` that receives each change
|
|
11
|
+
* event in them.
|
|
12
|
+
* @returns The table, or `null` while `target` is `null` or has no table of that name.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* The returned table is the same object across renders; read from it during render, and change it
|
|
16
|
+
* through its own methods, such as {@link ITable.addRow} and {@link ITable.deleteRowsAt}.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const items = useTable(workbook, 'Items');
|
|
21
|
+
* const rows = items?.getDataRange().getValues() ?? [];
|
|
22
|
+
* return <button onClick={() => items?.addRow()}>Add</button>;
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const useTable: (target: CellRangeTarget | null | undefined, name: string, options?: CellRangeHookOptions) => ITable | null;
|
|
26
|
+
//# sourceMappingURL=useTable.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MovableElementProps } from './IMovableArea';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a movable with the renderer for its kind of content, or a placeholder for a kind with
|
|
5
|
+
* none. The default `renderMovable` of a sheet element.
|
|
6
|
+
*/
|
|
7
|
+
export declare const defaultRenderMovable: (props: MovableElementProps) => React.ReactElement;
|
|
8
|
+
//# sourceMappingURL=DefaultMovable.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RemoveListener, EditModeHandler } from '@sheetxl/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { IWorksheet } from '@sheetxl/sdk';
|
|
3
3
|
import { Command, IReactNotifier } from '@sheetxl/utils-react';
|
|
4
4
|
import { ActivateFrameOptions, ITaskPaneArea } from '../taskPane';
|
|
5
5
|
/** Options for {@link contributeMovableCommands}. */
|
|
@@ -21,7 +21,7 @@ export interface ContributeMovableCommandsOptions {
|
|
|
21
21
|
*/
|
|
22
22
|
/** The single `data` bundle {@link contributeMovableCommands} takes (the `DynamicCommandContributor` shape). */
|
|
23
23
|
export interface MovableCommandData extends ContributeMovableCommandsOptions {
|
|
24
|
-
sheet:
|
|
24
|
+
sheet: IWorksheet | null;
|
|
25
25
|
}
|
|
26
26
|
export declare function contributeMovableCommands(contribution: Command.CommandContribution, data: MovableCommandData): RemoveListener;
|
|
27
27
|
//# sourceMappingURL=MovableCommands.d.ts.map
|
|
@@ -2,11 +2,13 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { IMovable } from '@sheetxl/sdk';
|
|
3
3
|
import { ResizeDirection } from './geometry';
|
|
4
4
|
import { MovablePreview } from './framePlacement';
|
|
5
|
+
/** A resize handle by its compass name, as `MovableLayerProps.resizeDirections` lists them. */
|
|
6
|
+
export type ResizeDirectionName = 'nw' | 'n' | 'ne' | 'w' | 'e' | 'sw' | 's' | 'se';
|
|
5
7
|
/** The resize cursor for a handle on a frame turned `rotation` degrees, so it follows the turn. */
|
|
6
8
|
export declare const resizeCursor: (direction: ResizeDirection, rotation: number) => string;
|
|
7
9
|
export interface MovableControlProps {
|
|
8
10
|
/** Compass names of the handles to draw (`nw`, `n`, … `se`). */
|
|
9
|
-
directions: readonly
|
|
11
|
+
directions: readonly ResizeDirectionName[];
|
|
10
12
|
/** Degrees clockwise the frame is turned; only the cursors use it, the box turns itself. */
|
|
11
13
|
rotation: number;
|
|
12
14
|
/**
|