@sheetxl/react 0.7.27 → 0.7.28-beta.2
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/cjs/Bo9Kx3L_XQkGPBJ5.cjs +1 -0
- package/browser/cjs/Pl04-kDEQSO8_qFU.cjs +156 -0
- package/browser/cjs/index.cjs +24 -24
- package/browser/esm/BPJdKxa9KFZWhw7o.mjs +6286 -0
- package/browser/esm/index.mjs +19258 -4911
- package/licenses/dependencies.txt +42 -214
- package/node/esm/CUEW3f18r-pU7F0q.mjs +9 -0
- package/node/esm/index.mjs +17035 -3691
- package/package.json +10 -11
- package/resources/contents.json +60 -0
- package/resources/locales/contents.json +114 -0
- package/resources/locales/de/clipboard.cmd.json +36 -0
- package/resources/locales/de/editor.cmd.json +128 -0
- package/resources/locales/de/movable.cmd.json +123 -0
- package/resources/locales/de/selection.cmd.json +373 -0
- package/resources/locales/de/sheet.cmd.json +1563 -0
- package/resources/locales/de/table.cmd.json +83 -0
- package/resources/locales/de/ui.msg.json +166 -0
- package/resources/locales/de/workbook.cmd.json +282 -0
- package/resources/locales/en/clipboard.cmd.json +36 -0
- package/resources/locales/en/editor.cmd.json +128 -0
- package/resources/locales/en/movable.cmd.json +123 -0
- package/resources/locales/en/selection.cmd.json +373 -0
- package/resources/locales/en/sheet.cmd.json +1563 -0
- package/resources/locales/en/table.cmd.json +83 -0
- package/resources/locales/en/ui.msg.json +166 -0
- package/resources/locales/en/workbook.cmd.json +282 -0
- package/types/index.d.ts +2 -1767
- package/types/src/border/StaticBorderRenderer.d.ts +32 -0
- package/types/src/border/StyledStrokePath.d.ts +14 -0
- package/types/src/border/index.d.ts +4 -0
- package/types/src/border/useBorders.d.ts +87 -0
- package/types/src/cell/ColumnButton.d.ts +45 -0
- package/types/src/cell/CornerTriangle.d.ts +27 -0
- package/types/src/cell/FormulaCellRenderer.d.ts +34 -0
- package/types/src/cell/SheetCellRenderer.d.ts +52 -0
- package/types/src/cell/SheetHeaderRenderer.d.ts +37 -0
- package/types/src/cell/index.d.ts +7 -0
- package/types/src/cell/useFormulaViewAnchor.d.ts +42 -0
- package/types/src/chart/ChartEditor.d.ts +17 -0
- package/types/src/chart/PresetChartTypeDescriptors.d.ts +35 -0
- package/types/src/chart/index.d.ts +3 -0
- package/types/src/chart/templates/area-stacked-percent-template.json.d.ts +10 -0
- package/types/src/chart/templates/area-stacked-template.json.d.ts +10 -0
- package/types/src/chart/templates/area-template.json.d.ts +9 -0
- package/types/src/chart/templates/bar-stacked-percent-template.json.d.ts +10 -0
- package/types/src/chart/templates/bar-stacked-template.json.d.ts +10 -0
- package/types/src/chart/templates/bar-template.json.d.ts +9 -0
- package/types/src/chart/templates/column-stacked-percent-template.json.d.ts +10 -0
- package/types/src/chart/templates/column-stacked-template.json.d.ts +10 -0
- package/types/src/chart/templates/column-template.json.d.ts +9 -0
- package/types/src/chart/templates/line-markers-template.json.d.ts +10 -0
- package/types/src/chart/templates/line-stacked-markers-template.json.d.ts +11 -0
- package/types/src/chart/templates/line-stacked-percent-markers-template.json.d.ts +11 -0
- package/types/src/chart/templates/line-stacked-percent-template.json.d.ts +10 -0
- package/types/src/chart/templates/line-stacked-template.json.d.ts +10 -0
- package/types/src/chart/templates/line-template.json.d.ts +9 -0
- package/types/src/chart/templates/pie-doughnut-template.json.d.ts +10 -0
- package/types/src/chart/templates/pie-template.json.d.ts +9 -0
- package/types/src/chart/templates/scatter-lines-markers-smooth-template.json.d.ts +10 -0
- package/types/src/chart/templates/scatter-lines-markers-template.json.d.ts +10 -0
- package/types/src/chart/templates/scatter-lines-smooth-template.json.d.ts +10 -0
- package/types/src/chart/templates/scatter-lines-template.json.d.ts +10 -0
- package/types/src/chart/templates/scatter-markers-template.json.d.ts +10 -0
- package/types/src/clipboard/ClipboardCommands.d.ts +68 -0
- package/types/src/clipboard/SheetClipboardLayer.d.ts +22 -0
- package/types/src/clipboard/index.d.ts +3 -0
- package/types/src/commands/Catalog.d.ts +8 -0
- package/types/src/commands/CommandRootProvider.d.ts +36 -0
- package/types/src/commands/InputClipboardCommands.d.ts +41 -0
- package/types/src/commands/InputClipboardInjector.d.ts +16 -0
- package/types/src/commands/MainFocusContext.d.ts +13 -0
- package/types/src/commands/PaneScopeProvider.d.ts +40 -0
- package/types/src/commands/createTransactionalMiddleware.d.ts +49 -0
- package/types/src/commands/index.d.ts +7 -0
- package/types/src/context/SheetContext.d.ts +18 -0
- package/types/src/context/WorkbookContext.d.ts +20 -0
- package/types/src/context/index.d.ts +3 -0
- package/types/src/editableLabel/EditableLabel.d.ts +28 -0
- package/types/src/editableLabel/index.d.ts +2 -0
- package/types/src/editor/EditorCommands.d.ts +98 -0
- package/types/src/editor/FunctionPreviewPanel.d.ts +166 -0
- package/types/src/editor/NamedHintPanel.d.ts +38 -0
- package/types/src/editor/NamedItemsPanel.d.ts +59 -0
- package/types/src/editor/SheetCellEditorLayer.d.ts +40 -0
- package/types/src/editor/SheetCellInput.d.ts +99 -0
- package/types/src/editor/SheetEditable.d.ts +53 -0
- package/types/src/editor/SheetReferenceHeaderLayer.d.ts +46 -0
- package/types/src/editor/SheetReferenceLayer.d.ts +55 -0
- package/types/src/editor/formulaCaret.d.ts +84 -0
- package/types/src/editor/formulaEval.d.ts +202 -0
- package/types/src/editor/formulaPresentation.d.ts +136 -0
- package/types/src/editor/formulaText.d.ts +80 -0
- package/types/src/editor/functionArgs.d.ts +111 -0
- package/types/src/editor/functionHint.d.ts +37 -0
- package/types/src/editor/index.d.ts +18 -0
- package/types/src/editor/referencePointNav.d.ts +39 -0
- package/types/src/editor/useFormulaHints.d.ts +126 -0
- package/types/src/editor/useFormulaInput.d.ts +326 -0
- package/types/src/editor/useProtectedEditNotice.d.ts +14 -0
- package/types/src/editor/useReferenceMode.d.ts +177 -0
- package/types/src/form/FormulaInput.d.ts +86 -0
- package/types/src/form/FormulaInputParts.d.ts +94 -0
- package/types/src/form/index.d.ts +5 -0
- package/types/src/form/useEditCommit.d.ts +174 -0
- package/types/src/form/useInputField.d.ts +86 -0
- package/types/src/frame/CommandContext.d.ts +179 -0
- package/types/src/frame/IFrame.d.ts +17 -0
- package/types/src/frame/index.d.ts +3 -0
- package/types/src/icons/LogoNoPaddingIcon.d.ts +3 -0
- package/types/src/icons/LogoTextNoPaddingIcon.d.ts +4 -0
- package/types/src/icons/WaterMark.d.ts +12 -0
- package/types/src/icons/chart/ChartAreaIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartAreaStackedIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartAreaStackedPercentIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartBarIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartBarStackedIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartBarStackedPercentIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartBubble3DIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartBubbleIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartColumnIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartColumnStackedIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartColumnStackedPercentIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineMarkersIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineStackedIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineStackedMarkersIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineStackedPercentIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartLineStackedPercentMarkersIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartPieDoughnutIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartPieIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartScatterLinesIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartScatterLinesMarkersIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartScatterLinesMarkersSmoothIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartScatterLinesSmoothIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartScatterMarkersIcon.d.ts +5 -0
- package/types/src/icons/chart/ChartWaterfallIcon.d.ts +5 -0
- package/types/src/icons/chart/ThemedChartIcon.d.ts +20 -0
- package/types/src/icons/chart/index.d.ts +50 -0
- package/types/src/icons/index.d.ts +4 -0
- package/types/src/index.d.ts +27 -0
- package/types/src/io/WorkbookIO.d.ts +50 -0
- package/types/src/io/index.d.ts +2 -0
- package/types/src/layer/BorderLayer.d.ts +14 -0
- package/types/src/layer/CellErrorLayer.d.ts +49 -0
- package/types/src/layer/CellFillLayer.d.ts +15 -0
- package/types/src/layer/ConditionalBarLayer.d.ts +41 -0
- package/types/src/layer/ConditionalIcons.d.ts +34 -0
- package/types/src/layer/ConditionalIconsLayer.d.ts +31 -0
- package/types/src/layer/ContextMenuLayer.d.ts +27 -0
- package/types/src/layer/HeaderResizerLayer.d.ts +28 -0
- package/types/src/layer/HeaderSelectionLayer.d.ts +89 -0
- package/types/src/layer/ResizeIndicator.d.ts +19 -0
- package/types/src/layer/SheetBackgroundLayer.d.ts +22 -0
- package/types/src/layer/SheetCellLayer.d.ts +49 -0
- package/types/src/layer/SheetColumnButtonLayer.d.ts +23 -0
- package/types/src/layer/SheetGridLineLayer.d.ts +22 -0
- package/types/src/layer/SheetHeaderCellLayer.d.ts +30 -0
- package/types/src/layer/SheetMovableLayer.d.ts +26 -0
- package/types/src/layer/SheetTableCommandLayer.d.ts +16 -0
- package/types/src/layer/SpillLayer.d.ts +22 -0
- package/types/src/layer/TableLayer.d.ts +22 -0
- package/types/src/layer/ValidationIndicatorLayer.d.ts +41 -0
- package/types/src/layer/index.d.ts +25 -0
- package/types/src/layer/resizeIndicatorState.d.ts +26 -0
- package/types/src/layer/useSheetFeatureRegions.d.ts +21 -0
- package/types/src/layer/useSheetVisibleCells.d.ts +60 -0
- package/types/src/layer/useSheetVisibleDecorations.d.ts +42 -0
- package/types/src/layer/useTableHeaderCells.d.ts +22 -0
- package/types/src/layer/useVisibleTables.d.ts +27 -0
- package/types/src/listener/index.d.ts +3 -0
- package/types/src/listener/useModelListener.d.ts +67 -0
- package/types/src/listener/useRangeListener.d.ts +15 -0
- package/types/src/movable/EmptyFrame.d.ts +16 -0
- package/types/src/movable/IMovableArea.d.ts +34 -0
- package/types/src/movable/MovableCommands.d.ts +22 -0
- package/types/src/movable/MovableFrame.d.ts +48 -0
- package/types/src/movable/MovableLayer.d.ts +77 -0
- package/types/src/movable/MoveableBundle.d.ts +4 -0
- package/types/src/movable/index.d.ts +4 -0
- package/types/src/picture/IPictureEditor.d.ts +39 -0
- package/types/src/picture/PictureEditor.d.ts +4 -0
- package/types/src/picture/index.d.ts +3 -0
- package/types/src/selection/SelectionCommands.d.ts +23 -0
- package/types/src/selection/SheetSelection.d.ts +53 -0
- package/types/src/selection/SheetSelectionLayer.d.ts +30 -0
- package/types/src/selection/index.d.ts +4 -0
- package/types/src/shape/ShapeEditor.d.ts +16 -0
- package/types/src/shape/index.d.ts +2 -0
- package/types/src/sheet/ConditionalFormatPresets.d.ts +56 -0
- package/types/src/sheet/ISheetElement.d.ts +233 -0
- package/types/src/sheet/ISheetHeaderElement.d.ts +138 -0
- package/types/src/sheet/NotImplemented.d.ts +3 -0
- package/types/src/sheet/SheetCommandProvider.d.ts +57 -0
- package/types/src/sheet/SheetCommands.d.ts +75 -0
- package/types/src/sheet/SheetElement.d.ts +15 -0
- package/types/src/sheet/SheetHeaderElement.d.ts +4 -0
- package/types/src/sheet/SheetScrollbar.d.ts +28 -0
- package/types/src/sheet/TopLeftCorner.d.ts +17 -0
- package/types/src/sheet/index.d.ts +7 -0
- package/types/src/slicer/SlicerEditor.d.ts +16 -0
- package/types/src/slicer/index.d.ts +2 -0
- package/types/src/tabStrip/SheetTab.d.ts +41 -0
- package/types/src/tabStrip/Sortable.d.ts +66 -0
- package/types/src/tabStrip/Tab.d.ts +19 -0
- package/types/src/tabStrip/TabStrip.d.ts +41 -0
- package/types/src/tabStrip/TabStripItem.d.ts +36 -0
- package/types/src/tabStrip/TabStripRow.d.ts +9 -0
- package/types/src/tabStrip/index.d.ts +7 -0
- package/types/src/table/TableCommands.d.ts +16 -0
- package/types/src/taskPane/ITaskPane.d.ts +72 -0
- package/types/src/taskPane/TaskPaneArea.d.ts +144 -0
- package/types/src/taskPane/TaskPaneFrame.d.ts +48 -0
- package/types/src/taskPane/TaskPaneRegistry.d.ts +108 -0
- package/types/src/taskPane/TaskPaneStrip.d.ts +33 -0
- package/types/src/taskPane/TaskPaneTitle.d.ts +24 -0
- package/types/src/taskPane/index.d.ts +7 -0
- package/types/src/taskPane/useTaskPane.d.ts +29 -0
- package/types/src/theme/DocThemesContext.d.ts +3 -0
- package/types/src/theme/DocThemesProvider.d.ts +15 -0
- package/types/src/theme/ThemeState.d.ts +19 -0
- package/types/src/theme/buildDocThemeCSS.d.ts +16 -0
- package/types/src/theme/buildOOXMLThemeCSS.d.ts +13 -0
- package/types/src/theme/createCSSSystemLookup.d.ts +51 -0
- package/types/src/theme/index.d.ts +11 -0
- package/types/src/theme/useAppColorScheme.d.ts +15 -0
- package/types/src/theme/useDocThemes.d.ts +3 -0
- package/types/src/theme/useGridColorScheme.d.ts +20 -0
- package/types/src/theme/useSystemColors.d.ts +44 -0
- package/types/src/undo/UndoCommands.d.ts +28 -0
- package/types/src/undo/UndoManagerContext.d.ts +14 -0
- package/types/src/undo/index.d.ts +3 -0
- package/types/src/workbook/DefaultRenderers.d.ts +14 -0
- package/types/src/workbook/GlobalWorkbookElement.d.ts +10 -0
- package/types/src/workbook/IWorkbookElement.d.ts +178 -0
- package/types/src/workbook/WindowChrome.d.ts +61 -0
- package/types/src/workbook/WorkbookCommandContributor.d.ts +24 -0
- package/types/src/workbook/WorkbookCommands.d.ts +97 -0
- package/types/src/workbook/WorkbookElement.d.ts +9 -0
- package/types/src/workbook/WorkbookStrip.d.ts +73 -0
- package/types/src/workbook/index.d.ts +17 -0
- package/types/src/workbook/resolveWorkbookInput.d.ts +27 -0
- package/types/src/workbook/useResolvedWorkbook.d.ts +31 -0
- package/types/src/workbook/useWindowChrome.d.ts +24 -0
- package/types/src/workbook/useWorkbookApp.d.ts +47 -0
- package/types/src/workbook/useWorkbookEncrypted.d.ts +15 -0
- package/types/src/workbook/useWorkbookFormat.d.ts +18 -0
- package/types/src/workbook/useWorkbookName.d.ts +13 -0
- package/types/src/workbook/useWorkbookSaveState.d.ts +29 -0
- package/browser/cjs/DNki9dGbSn_gUfd3.cjs +0 -7
- package/browser/cjs/Da611GSWMp5ncOGO.cjs +0 -16
- package/browser/cjs/F8ZECny0CwW2OV5X.cjs +0 -161
- package/browser/esm/BYGSBjns_83FWXAx.mjs +0 -3905
- package/browser/esm/CmObbQiLq9AAM7-q.mjs +0 -394
- package/browser/esm/Daa2g2QALCIHFgqP.mjs +0 -1377
- package/node/assets/style.css +0 -1
- package/node/esm/Bu9xI_rgkuupQ2AO.mjs +0 -11
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IRangeSelection, IRange } from '@sheetxl/sdk';
|
|
3
|
+
import { CellCoords, RangeCoords } from '@sheetxl/utils';
|
|
4
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
5
|
+
import { SheetSelection } from '../selection';
|
|
6
|
+
export interface HeaderSelectionLayerProps extends LayerProps {
|
|
7
|
+
/** Class for the decoration host box (devtools identification). */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Style for the decoration host box. */
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
/**
|
|
12
|
+
* The selection model this header layer renders + writes. The primary sheet selection
|
|
13
|
+
* (`sheet.getSelection()`) or a detached picker selection (`IRangeSelection.createSelection()`) — the
|
|
14
|
+
* layer is the same either way.
|
|
15
|
+
*/
|
|
16
|
+
selection: IRangeSelection;
|
|
17
|
+
/**
|
|
18
|
+
* Override the WRITE adapter the header pointer drives (default: a plain `SheetSelection` over
|
|
19
|
+
* {@link HeaderSelectionLayerProps.selection}). A reference-picker overlay passes a scope-stamping
|
|
20
|
+
* wrapper (`scopeDrawnRanges`) so a header pick reports the PANE's sheet — always-scoped reporting;
|
|
21
|
+
* the raw `selection` is still used for reads (`setAdjusting`, selected runs).
|
|
22
|
+
*/
|
|
23
|
+
adapter?: SheetSelection;
|
|
24
|
+
/**
|
|
25
|
+
* The axis of the header (row or column).
|
|
26
|
+
*/
|
|
27
|
+
axis: IRange.Axis;
|
|
28
|
+
/**
|
|
29
|
+
* The body's entire range (full rows × full columns) — the header projects every gesture across the
|
|
30
|
+
* opposite axis with it. Typically `sheet.getEntireRange().getCoords()`.
|
|
31
|
+
*/
|
|
32
|
+
entireCoords: RangeCoords;
|
|
33
|
+
/**
|
|
34
|
+
* The separator thickness (the grey non-selected edge at the band's body-facing side). The stage IS the
|
|
35
|
+
* full band, so the seam sits at the pane's cross size; the separator occupies its last `edgeSize` px and
|
|
36
|
+
* the selection accent is centered on the seam so it meets the body's top stroke. @defaultValue 1
|
|
37
|
+
*/
|
|
38
|
+
edgeSize?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Color of the non-selected separator edge (the grey gridline-like rule under/beside the band). Drawn
|
|
41
|
+
* across the whole band; selected runs paint the primary accent over it. @defaultValue `var(--sxl-color-base-300)`
|
|
42
|
+
*/
|
|
43
|
+
edgeColor?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Scroll a header cell into view during a drag (incl. the held-still auto-scroll). Given the header
|
|
46
|
+
* cell's axis coord (`{ colIndex }` for a column header, `{ rowIndex }` for a row header). Route it
|
|
47
|
+
* through the sheet (`sheet.scrollTo`) so the BODY grid scrolls — a header `GridSurface` has a
|
|
48
|
+
* controlled viewport and cannot scroll itself. Omit for a standalone header (falls back to self-scroll).
|
|
49
|
+
*/
|
|
50
|
+
scrollIntoView?: (coords: Partial<CellCoords>) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Render the selection accent (the header underline for selected rows/columns). Turn off for a picker
|
|
53
|
+
* overlay, whose reference rectangles are drawn by `RangesPickerLayer` — the accent would compete.
|
|
54
|
+
* @defaultValue true
|
|
55
|
+
*/
|
|
56
|
+
renderBorders?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Keep the current focus on pointer-up instead of focusing the grid pane. On for a picker overlay used
|
|
59
|
+
* while editing a formula (focusing the pane would blur the editor). @defaultValue false
|
|
60
|
+
*/
|
|
61
|
+
preserveFocus?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* **Point (reference-picking) mode.** A no-modifier header click/drag re-scopes the ACTIVE reference in
|
|
64
|
+
* place (or appends a new one), preserving the formula's other references, and consumes the gesture so a
|
|
65
|
+
* primary header selection below never runs its clobbering replace. On for the reference picker overlay
|
|
66
|
+
* (`SheetReferenceHeaderLayer`). @defaultValue false
|
|
67
|
+
*/
|
|
68
|
+
replaceActive?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Whether Ctrl/Cmd + click/drag APPENDS a range instead of replacing. Off for a single-range consumer
|
|
71
|
+
* (a table's range field), which must never be handed a second one. @defaultValue true
|
|
72
|
+
*/
|
|
73
|
+
allowMulti?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Intercept pointer-down before any selection change (e.g. the primary keeps a fully-selected header's
|
|
76
|
+
* multi-selection on right-click so the context menu acts on it). Return `false` to cancel.
|
|
77
|
+
*/
|
|
78
|
+
onPointerDownInterceptor?: (e: React.PointerEvent, coords: IRange.CellCoords) => boolean | void;
|
|
79
|
+
/**
|
|
80
|
+
* Callback when selection is manually started
|
|
81
|
+
*/
|
|
82
|
+
onSelectionStart?: () => void;
|
|
83
|
+
/**
|
|
84
|
+
* Callback when selection is manually changed
|
|
85
|
+
*/
|
|
86
|
+
onSelectionEnd?: () => void;
|
|
87
|
+
}
|
|
88
|
+
export declare const HeaderSelectionLayer: React.NamedExoticComponent<HeaderSelectionLayerProps & React.RefAttributes<HTMLDivElement>>;
|
|
89
|
+
//# sourceMappingURL=HeaderSelectionLayer.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link ResizeIndicator}.
|
|
5
|
+
*/
|
|
6
|
+
export interface ResizeIndicatorProps {
|
|
7
|
+
/** The sheet — for the unit readout (header scale factor) and the entire-range extent. */
|
|
8
|
+
sheet: ISheet;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The **main-grid overlay** for an in-progress header resize: the before/after guide-lines that span the
|
|
12
|
+
* body plus the live size tooltip. It's a self-contained grid layer — it reads the gesture from
|
|
13
|
+
* `useSurfaceState` (published by {@link HeaderResizerLayer} in the header surface, shared via the sheet's
|
|
14
|
+
* `SurfaceStateProvider`) and the pane from context, so it mounts as a plain child of the grid with no
|
|
15
|
+
* render-prop bridge. Rendered once per pane; each pane draws its own clipped slice of the lines, and the
|
|
16
|
+
* tooltip ({@link StickyFloat}) self-gates to a single owner pane.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ResizeIndicator: React.MemoExoticComponent<(props: ResizeIndicatorProps) => React.JSX.Element | null>;
|
|
19
|
+
//# sourceMappingURL=ResizeIndicator.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
2
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
3
|
+
export interface SheetBackgroundLayerProps extends LayerProps {
|
|
4
|
+
/** Class for the background box (devtools identification). */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Style for the background box. */
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
/** The sheet whose background picture (a tiled fill rendered behind the cells) is rendered. */
|
|
9
|
+
sheet: ISheet;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders the sheet's background.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* A {@link Layer} hosting a passive (`pointer-events:none`) full-view paint box, so clicks fall
|
|
16
|
+
* through to the cells. The tile pattern is anchored to the sheet's A1 origin — the pane's screen
|
|
17
|
+
* position for cell `0,0` encodes the current scroll offset — so it scrolls with the content (one
|
|
18
|
+
* instance per pane). The caller adds this layer only when a picture is present (see
|
|
19
|
+
* `ISheet.getPicture`) and places it FIRST, so it sits at the bottom of the z-stack.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SheetBackgroundLayer: import('react').NamedExoticComponent<SheetBackgroundLayerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
22
|
+
//# sourceMappingURL=SheetBackgroundLayer.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet, ISheetView } from '@sheetxl/sdk';
|
|
3
|
+
import { CellRendererProps, IEditable, LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
import { SheetCellRendererProps, ColumnButtonConfigProps } from '../cell';
|
|
5
|
+
export interface SheetCellLayerProps extends LayerProps {
|
|
6
|
+
/** Class for the layer (devtools identification). */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** The sheet whose cells are rendered. */
|
|
9
|
+
sheet: ISheet;
|
|
10
|
+
/** The sheet view — drives show-zeros / show-formulas (which cells are worth rendering). */
|
|
11
|
+
sheetView: ISheetView;
|
|
12
|
+
/**
|
|
13
|
+
* Custom per-cell renderer. Default: {@link SheetCellRenderer} wired to the sheet (doc theme,
|
|
14
|
+
* hyperlink taps, formula-view flags) — the layer owns cell styling, so most hosts never pass this.
|
|
15
|
+
*/
|
|
16
|
+
renderCell?: (props: CellRendererProps) => React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Customization channel for the DEFAULT renderer (hyperlink taps, per-cell overrides). The
|
|
19
|
+
* column-button members ride along on the shared type but are consumed by
|
|
20
|
+
* `SheetColumnButtonLayer`, not here — they are stripped before the spread.
|
|
21
|
+
*/
|
|
22
|
+
propsCellRender?: Partial<SheetCellRendererProps> & ColumnButtonConfigProps;
|
|
23
|
+
/**
|
|
24
|
+
* The shared editable. Subscribed so the edited cell is suppressed while its editor is open —
|
|
25
|
+
* via the layer's live CSS channel (`suppressCell`), so no tile is ever invalidated by an edit
|
|
26
|
+
* start/stop and the grid above is never touched.
|
|
27
|
+
*/
|
|
28
|
+
editable: IEditable<any, any, any>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The sheet's cell layer.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* A self-contained grid layer: it renders the sheet's cells and re-renders **itself** when the data in
|
|
35
|
+
* its pane's visible range changes (via {@link useSheetVisibleCells}) — so a value edit never
|
|
36
|
+
* re-renders the grid or recreates the panes. One instance per pane (it reads its pane from context),
|
|
37
|
+
* so each frozen region listens to its own range.
|
|
38
|
+
*
|
|
39
|
+
* Beside the immutable tile snapshots ({@link CellTileDiv}) the layer owns the two LIVE per-cell
|
|
40
|
+
* concerns that must never touch a tile:
|
|
41
|
+
* - the edited cell is suppressed while its editor is open (live CSS `suppressCell` channel);
|
|
42
|
+
* - **formula view** ({@link ISheetView.isShowFormulas}): when the selection anchor sits on a
|
|
43
|
+
* formula cell, that cell's plain snapshot is suppressed through the SAME channel and a
|
|
44
|
+
* tokenized, syntax-colored {@link FormulaCellRenderer} overlay is drawn in its place — the
|
|
45
|
+
* references themselves are outlined by `SheetReferenceLayer`, both keyed off
|
|
46
|
+
* {@link useFormulaViewAnchor} so text and rectangles share colors.
|
|
47
|
+
*/
|
|
48
|
+
export declare const SheetCellLayer: React.MemoExoticComponent<(props: SheetCellLayerProps) => React.JSX.Element | null>;
|
|
49
|
+
//# sourceMappingURL=SheetCellLayer.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
3
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
import { ColumnButtonConfigProps } from '../cell/ColumnButton';
|
|
5
|
+
export interface SheetColumnButtonLayerProps extends LayerProps, ColumnButtonConfigProps {
|
|
6
|
+
/** The sheet whose table column (filter/sort) buttons are rendered. */
|
|
7
|
+
sheet: ISheet;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The sheet's column (filter/sort) button layer — a {@link CellLayer} (which roots the {@link Layer})
|
|
11
|
+
* fed a table-aware source so it emits ONLY the header cells of visible tables (a table-free sheet
|
|
12
|
+
* does no per-cell work).
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* A sibling grid child of {@link TableLayer} (each owns its own {@link useVisibleTables}
|
|
16
|
+
* subscription; the hook's `cacheToken` drops the tile cache when the set / state of tables
|
|
17
|
+
* changes). It sits below the selection layer — fine: the button's own `stopPropagation` on
|
|
18
|
+
* pointerdown consumes the press before it reaches the grid-wide selection tap, so clicking a
|
|
19
|
+
* button never moves the selection regardless of layer z-order. The host box is
|
|
20
|
+
* `pointer-events:none` (CellLayer's default); only the button re-enables itself.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SheetColumnButtonLayer: React.MemoExoticComponent<(props: SheetColumnButtonLayerProps) => React.JSX.Element>;
|
|
23
|
+
//# sourceMappingURL=SheetColumnButtonLayer.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet, ISheetView } from '@sheetxl/sdk';
|
|
3
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
export interface SheetGridLineLayerProps extends LayerProps {
|
|
5
|
+
/** The sheet whose gridlines are rendered. */
|
|
6
|
+
sheet: ISheet;
|
|
7
|
+
/** The sheet view — drives styling, per-axis visibility, and which cells are scanned (for merges). */
|
|
8
|
+
sheetView: ISheetView;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The sheet's gridline layer.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* The line *styling* (color + the normal-style border edges baked into the line props) and per-axis
|
|
15
|
+
* *visibility* are structural, so this layer self-subscribes to `onStyleChange` (sheet) + `onZoomScaleChange`
|
|
16
|
+
* (view) and derives them from the sheet's normal style and the view's gridline color / zoom / show flags —
|
|
17
|
+
* decoupled from the grid above it. The *merges* the lines break around are data, so it also self-subscribes
|
|
18
|
+
* to its pane's visible range via {@link useSheetVisibleCells} and re-renders itself on a data change (busting
|
|
19
|
+
* the underlying grid-react {@link GridlineLayer} with its own token). One per pane.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SheetGridLineLayer: React.MemoExoticComponent<(props: SheetGridLineLayerProps) => React.JSX.Element>;
|
|
22
|
+
//# sourceMappingURL=SheetGridLineLayer.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheetHeader } from '@sheetxl/sdk';
|
|
3
|
+
import { CellRendererProps, LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
export interface SheetHeaderCellLayerProps extends LayerProps {
|
|
5
|
+
/** Class for the tiling-origin box (devtools identification). */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** The header model (row or column) whose labels are rendered. */
|
|
8
|
+
header: ISheetHeader;
|
|
9
|
+
/** Per-header renderer (the sheet's `SheetHeaderRenderer` wrapping). */
|
|
10
|
+
renderCell: (props: CellRendererProps) => React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The header's cell layer.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* The header sibling of {@link SheetCellLayer}: it renders the header labels and self-invalidates,
|
|
17
|
+
* busting the underlying grid-react {@link CellLayer} with its own token — so it re-renders only itself,
|
|
18
|
+
* not the header grid. Two triggers bump the token:
|
|
19
|
+
*
|
|
20
|
+
* - **size change** (`onSizesChange`) — alters what is visible/labeled;
|
|
21
|
+
* - **selection change** — header labels are styled by selection (fill / weight / color), but the tiled
|
|
22
|
+
* `CellLayer` cache survives scroll, so it must be dropped when *this header's* selected runs change.
|
|
23
|
+
* Gated on the runs {@link selectedRunsSignature} so it busts only when the styling would differ (not
|
|
24
|
+
* on every active-cell move, and never on scroll — there is no per-frame range work).
|
|
25
|
+
*
|
|
26
|
+
* Structural changes (theme / model swap) still flow through the header element's own invalidate. One
|
|
27
|
+
* instance per pane.
|
|
28
|
+
*/
|
|
29
|
+
export declare const SheetHeaderCellLayer: React.MemoExoticComponent<(props: SheetHeaderCellLayerProps) => React.JSX.Element>;
|
|
30
|
+
//# sourceMappingURL=SheetHeaderCellLayer.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
3
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
import { IMovableLayerElement, MovableLayerProps, MovableElementProps } from '../movable';
|
|
5
|
+
export interface SheetMovableLayerProps extends LayerProps {
|
|
6
|
+
/** Class forwarded to the inner layer's host box (devtools identification). */
|
|
7
|
+
className?: string;
|
|
8
|
+
sheet: ISheet;
|
|
9
|
+
/**
|
|
10
|
+
* Render a movable element
|
|
11
|
+
*
|
|
12
|
+
* @param props The props for the movable element
|
|
13
|
+
* @returns The rendered movable element
|
|
14
|
+
*/
|
|
15
|
+
renderMovable: (props: MovableElementProps) => React.ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* Props to pass to MovableLayer
|
|
18
|
+
*/
|
|
19
|
+
propsMovable?: Partial<MovableLayerProps>;
|
|
20
|
+
/**
|
|
21
|
+
* Ref to movable area
|
|
22
|
+
*/
|
|
23
|
+
ref?: React.Ref<IMovableLayerElement>;
|
|
24
|
+
}
|
|
25
|
+
export declare const SheetMovableLayer: React.NamedExoticComponent<Omit<SheetMovableLayerProps, "ref"> & React.RefAttributes<IMovableLayerElement>>;
|
|
26
|
+
//# sourceMappingURL=SheetMovableLayer.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
3
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
export interface SheetTableCommandLayerProps extends LayerProps {
|
|
5
|
+
sheet: ISheet;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* **Command-only layer for the `table` scope** — no visuals (the visual chrome lives in {@link TableLayer});
|
|
9
|
+
* this joins the pane's z-chain purely to contribute the {@link contributeTableCommands table
|
|
10
|
+
* operations} while tabular data is active. Mirrors {@link SheetMovableLayer}: a declarative
|
|
11
|
+
* `<CommandScopeProvider spec order={z}/>` so the `table` scope is a `sheet`-descendant leaf and its commands
|
|
12
|
+
* out-resolve the `sheet` scope when a table/autofilter is selected (the seam for future sheet-label
|
|
13
|
+
* overrides). Outside a command host (bare grid) there's no chain, so it simply doesn't stack.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SheetTableCommandLayer: import('react').MemoExoticComponent<(props: SheetTableCommandLayerProps) => ReactElement>;
|
|
16
|
+
//# sourceMappingURL=SheetTableCommandLayer.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
3
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
export interface SpillLayerProps extends LayerProps {
|
|
5
|
+
/** Style for the outline box. */
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
/**
|
|
8
|
+
* The sheet.
|
|
9
|
+
*/
|
|
10
|
+
sheet: ISheet;
|
|
11
|
+
/**
|
|
12
|
+
* The animation time in milliseconds.
|
|
13
|
+
*
|
|
14
|
+
* @defaultValue 60
|
|
15
|
+
*/
|
|
16
|
+
animationTime?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Shows an outline for spills
|
|
20
|
+
*/
|
|
21
|
+
export declare const SpillLayer: React.NamedExoticComponent<SpillLayerProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
//# sourceMappingURL=SpillLayer.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet, ITable } from '@sheetxl/sdk';
|
|
3
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
export interface TableLayerProps extends LayerProps {
|
|
5
|
+
/**
|
|
6
|
+
* The sheet.
|
|
7
|
+
*/
|
|
8
|
+
sheet: ISheet;
|
|
9
|
+
/**
|
|
10
|
+
* Invoked by the hover toolbar's **edit** button. Wire it to the `editTable` command; if omitted the
|
|
11
|
+
* button falls back to selecting the table.
|
|
12
|
+
*/
|
|
13
|
+
onEditTable?: (table: ITable) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Is the outline, resizer, and row selection.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Vertical selection is handled by the render to avoid the z-index with the filter button. (Unless we move the filter button here)
|
|
20
|
+
*/
|
|
21
|
+
export declare const TableLayer: React.NamedExoticComponent<TableLayerProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
//# sourceMappingURL=TableLayer.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CellCoords } from '@sheetxl/utils';
|
|
3
|
+
import { ISheet, IDataValidation } from '@sheetxl/sdk';
|
|
4
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
5
|
+
export interface ValidationIndicatorLayerProps extends LayerProps {
|
|
6
|
+
/** Class for the layer (devtools identification). */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Style for the indicators host box. */
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
/** The sheet whose data validations are indicated. */
|
|
11
|
+
sheet: ISheet;
|
|
12
|
+
/** Size (px, unzoomed) of the invalid-value corner mark. @defaultValue 7 */
|
|
13
|
+
markSize?: number;
|
|
14
|
+
/** Width (px, unzoomed) of the list dropdown button. @defaultValue 17 */
|
|
15
|
+
dropdownWidth?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Called when the selected cell's list dropdown is pressed.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* The layer draws the affordance but owns no picker — the list UI is a host concern (it needs
|
|
21
|
+
* the float stack and the editor). Omit and the button is inert.
|
|
22
|
+
*/
|
|
23
|
+
onOpenDropdown?: (cell: CellCoords, dataValidation: IDataValidation) => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The sheet's **data-validation indicators** — the mark on a cell holding a value its rule rejects,
|
|
27
|
+
* and the dropdown on a selected list cell.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Both used to be drawn by the cell renderer, which meant every cached tile probed the validation
|
|
31
|
+
* model whether or not the sheet had any validations, and neither mark could have a hover or press
|
|
32
|
+
* state (a tile is an immutable snapshot). As a layer they are live, they cost nothing on a sheet
|
|
33
|
+
* with no validations, and the cells layer no longer knows validation exists.
|
|
34
|
+
*
|
|
35
|
+
* The two marks answer different questions and so are scoped differently. The invalid mark is a
|
|
36
|
+
* property of a cell's VALUE, so it is drawn wherever one is in view. The dropdown is an
|
|
37
|
+
* affordance for editing, so — as in Excel — it appears on the selected cell alone; a column of
|
|
38
|
+
* list cells would otherwise be a column of buttons.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ValidationIndicatorLayer: React.MemoExoticComponent<(props: ValidationIndicatorLayerProps) => React.JSX.Element | null>;
|
|
41
|
+
//# sourceMappingURL=ValidationIndicatorLayer.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './useVisibleTables';
|
|
2
|
+
export * from './useSheetVisibleCells';
|
|
3
|
+
export * from './useSheetFeatureRegions';
|
|
4
|
+
export * from './useSheetVisibleDecorations';
|
|
5
|
+
export * from './CellFillLayer';
|
|
6
|
+
export * from './CellErrorLayer';
|
|
7
|
+
export * from './BorderLayer';
|
|
8
|
+
export * from './SheetCellLayer';
|
|
9
|
+
export * from './SheetColumnButtonLayer';
|
|
10
|
+
export * from './SheetGridLineLayer';
|
|
11
|
+
export * from './SheetBackgroundLayer';
|
|
12
|
+
export * from './SheetHeaderCellLayer';
|
|
13
|
+
export * from './SheetMovableLayer';
|
|
14
|
+
export * from './TableLayer';
|
|
15
|
+
export * from './SheetTableCommandLayer';
|
|
16
|
+
export * from './SpillLayer';
|
|
17
|
+
export * from './ConditionalIcons';
|
|
18
|
+
export * from './ConditionalBarLayer';
|
|
19
|
+
export * from './ConditionalIconsLayer';
|
|
20
|
+
export * from './ValidationIndicatorLayer';
|
|
21
|
+
export * from './HeaderSelectionLayer';
|
|
22
|
+
export * from './HeaderResizerLayer';
|
|
23
|
+
export * from './ResizeIndicator';
|
|
24
|
+
export * from './ContextMenuLayer';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IRange } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The transient state of an in-progress header resize, published by the producer
|
|
4
|
+
* ({@link HeaderResizerLayer}, which owns the gesture) and read by the consumer
|
|
5
|
+
* ({@link ResizeIndicator}, which draws the guide-lines across the main grid and the size tooltip).
|
|
6
|
+
*
|
|
7
|
+
* It rides `useSurfaceState` under {@link resizeIndicatorKey}, so the header surface that owns the drag
|
|
8
|
+
* and the main-grid overlay — different {@link GridSurface} subtrees — read one shared cell. `null` means
|
|
9
|
+
* no resize is active for that axis.
|
|
10
|
+
*/
|
|
11
|
+
export interface ResizeIndicatorState {
|
|
12
|
+
/** The index of the header (column or row) being resized. */
|
|
13
|
+
index: number;
|
|
14
|
+
/**
|
|
15
|
+
* Live size (px) of the header during the gesture — `prevSize` at start, the dragged size while moving.
|
|
16
|
+
* `0` ⇒ the header is (being) hidden (draw a single collapsed line, tooltip reads "Hidden").
|
|
17
|
+
* `null` ⇒ draw the guide-lines only, with no size tooltip (e.g. a press-and-hold before any drag).
|
|
18
|
+
*/
|
|
19
|
+
sizePX: number | null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The `useSurfaceState` key for the resize indicator, namespaced by axis. Column and row are distinct
|
|
23
|
+
* cells (the producer renders in both header surfaces), and the overlay reads whichever is active.
|
|
24
|
+
*/
|
|
25
|
+
export declare const resizeIndicatorKey: (axis: IRange.Axis) => string;
|
|
26
|
+
//# sourceMappingURL=resizeIndicatorState.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ICellRange, ICellRegion, IRange, ISheet } from '@sheetxl/sdk';
|
|
2
|
+
import { IGridPane } from '@sheetxl/grid-react';
|
|
3
|
+
export interface SheetFeatureRegions {
|
|
4
|
+
/** The viewport's regions for the feature — engine-merged blocks, ready to place. */
|
|
5
|
+
getRegions: (pane: IGridPane, range?: IRange.Coords) => ICellRegion[];
|
|
6
|
+
/** Cache-bust token — new identity when the regions may have changed (NOT on scroll). */
|
|
7
|
+
cacheToken: unknown;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Viewport-scoped feature regions for a single pane — `ICellRange.getRegions` with a per-range
|
|
11
|
+
* cache and self-invalidation.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* This replaces the scan-every-cell-then-re-merge pattern in the decoration layers: the engine
|
|
15
|
+
* already stores features as blocks, so the layer receives the merged regions directly and the
|
|
16
|
+
* anchor read is the payload (a region is uniform in its feature by construction). Mirrors
|
|
17
|
+
* {@link useSheetVisibleCells}'s shape — per-pane, cached by range key, token-invalidated — so
|
|
18
|
+
* layers can swap sources without changing their contract.
|
|
19
|
+
*/
|
|
20
|
+
export declare const useSheetFeatureRegions: (sheet: ISheet, feature: ICellRange.Feature) => SheetFeatureRegions;
|
|
21
|
+
//# sourceMappingURL=useSheetFeatureRegions.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ISheet, ICell, IRange } from '@sheetxl/sdk';
|
|
2
|
+
import { IGridPane } from '@sheetxl/grid-react';
|
|
3
|
+
export type SheetVisibleCell = {
|
|
4
|
+
cell: ICell.Coords;
|
|
5
|
+
value?: ICell;
|
|
6
|
+
range?: IRange.Coords;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* What the scan should treat as "worth rendering". Each layer passes ONLY the flags its own output
|
|
10
|
+
* depends on — a flag change busts this hook's scan cache + token, so an unused flag would rebuild
|
|
11
|
+
* the caller for nothing (e.g. gridlines must not rebuild on a show-zeros toggle).
|
|
12
|
+
*/
|
|
13
|
+
export interface SheetVisibleCellsOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Formula view: formula-only cells render (even valueless), and text-overflow extrusions are
|
|
16
|
+
* disabled (formulas never overflow-paint). Affects cells AND gridlines (extrusions break lines).
|
|
17
|
+
* @defaultValue false
|
|
18
|
+
*/
|
|
19
|
+
showFormulas?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Render zero-valued number cells. Affects only the cells layer.
|
|
22
|
+
* @defaultValue true
|
|
23
|
+
*/
|
|
24
|
+
showZeros?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Only cells the CONTENT renderer has something to paint for: values, formulas (when shown)
|
|
27
|
+
* and merge anchors. Style-only cells (a fill or border with no content) are skipped — they
|
|
28
|
+
* paint in the fill/border layers, so here they would be empty divs.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue false
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* This is a PREDICATE change only — the iteration still resolves the full intersection, so
|
|
34
|
+
* per-cell style resolution (table styles, named styles) is untouched. (A features-filtered
|
|
35
|
+
* iteration was tried and reverted: partial resolution breaks style composition.)
|
|
36
|
+
*/
|
|
37
|
+
contentOnly?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface SheetVisibleCells {
|
|
40
|
+
/** The visible-cell source to hand a grid-react `CellLayer` / `GridlineLayer`. */
|
|
41
|
+
getVisibleCells: (pane: IGridPane, range?: IRange.Coords) => SheetVisibleCell[];
|
|
42
|
+
/** Cache-bust token — a new identity each time the visible-range data OR the options change (NOT on scroll). */
|
|
43
|
+
cacheToken: unknown;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The shared "what cells are worth rendering" source for a single pane, plus self-invalidation.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* Reads the pane from context and subscribes (via {@link useRangeListener}) to data changes WITHIN that
|
|
50
|
+
* pane's visible range; on a real data change it drops its scan cache and bumps {@link
|
|
51
|
+
* SheetVisibleCells.cacheToken}. The scan {@link SheetVisibleCellsOptions | options} are ARGUMENTS, not
|
|
52
|
+
* internal view reads: the hook busts on an option change, and the caller owns re-rendering when its
|
|
53
|
+
* source flags change (e.g. `useModelSync(sheetView, ['onZoomScaleChange'])` — the view's setters all
|
|
54
|
+
* funnel through `_notifyAll`, which fires that event). Each caller (one per layer per pane) gets its
|
|
55
|
+
* OWN cache + subscription — the layers are deliberately decoupled, so a value edit re-renders only the
|
|
56
|
+
* layer(s) that asked, never the grid above them. Used by {@link SheetCellLayer} and
|
|
57
|
+
* {@link SheetGridLineLayer}.
|
|
58
|
+
*/
|
|
59
|
+
export declare const useSheetVisibleCells: (sheet: ISheet, options?: SheetVisibleCellsOptions) => SheetVisibleCells;
|
|
60
|
+
//# sourceMappingURL=useSheetVisibleCells.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ISheet, ICell, IRange, IConditionalFormat } from '@sheetxl/sdk';
|
|
2
|
+
import { IGridPane } from '@sheetxl/grid-react';
|
|
3
|
+
/** One visible cell a conditional-format rule DRAWS in. */
|
|
4
|
+
export interface SheetDecoratedCell {
|
|
5
|
+
/** Where the cell is. */
|
|
6
|
+
cell: ICell.Coords;
|
|
7
|
+
/** The cell itself — the layer reads its style (font size, alignment) to place the mark. */
|
|
8
|
+
value: ICell;
|
|
9
|
+
/** The merge the cell anchors, when it anchors one. A bar fills the merge, not the corner cell. */
|
|
10
|
+
range?: IRange.Coords;
|
|
11
|
+
/** What is drawn there. At least one slot is set, or the cell would not be in the list. */
|
|
12
|
+
decorations: Readonly<IConditionalFormat.Decorations>;
|
|
13
|
+
}
|
|
14
|
+
/** Which decoration a caller is scanning for — a layer draws one kind, so it asks for one kind. */
|
|
15
|
+
export type SheetDecorationKind = 'dataBar' | 'iconSet';
|
|
16
|
+
export interface SheetVisibleDecorations {
|
|
17
|
+
/** The decorated cells within a pane's visible range. Empty when nothing is decorated. */
|
|
18
|
+
getVisibleDecorations: (pane: IGridPane, range?: IRange.Coords) => SheetDecoratedCell[];
|
|
19
|
+
/** Cache-bust token — a new identity when the decorations can have changed (NOT on scroll). */
|
|
20
|
+
cacheToken: unknown;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The "what does conditional formatting draw in this pane" source for a single pane, plus
|
|
24
|
+
* self-invalidation.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* The sibling of `useSheetVisibleCells`, and it follows the same contract: reads its pane from
|
|
28
|
+
* context, keeps its OWN cache and subscriptions, and re-renders only its caller — so a value edit
|
|
29
|
+
* that moves a data bar never touches the cells above it.
|
|
30
|
+
*
|
|
31
|
+
* It is two-stage on purpose. The first question is whether the visible range intersects **any**
|
|
32
|
+
* rule at all, which the SDK answers from its spatial index without touching a cell; only if it
|
|
33
|
+
* does is there a per-cell scan. On the overwhelmingly common sheet — one with no conditional
|
|
34
|
+
* formatting, or none in view — the whole hook costs one index lookup per frame and its layer
|
|
35
|
+
* never mounts.
|
|
36
|
+
*
|
|
37
|
+
* Decorations move for two unrelated reasons and both are subscribed: the rules themselves change
|
|
38
|
+
* (`onConditionalFormatsChange`), or a value moves within a rule's range — which can restripe every
|
|
39
|
+
* cell the rule covers, not just the edited one, because the domain is range-wide.
|
|
40
|
+
*/
|
|
41
|
+
export declare const useSheetVisibleDecorations: (sheet: ISheet, kind: SheetDecorationKind) => SheetVisibleDecorations;
|
|
42
|
+
//# sourceMappingURL=useSheetVisibleDecorations.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
2
|
+
import { SheetVisibleCells } from './useSheetVisibleCells';
|
|
3
|
+
/**
|
|
4
|
+
* The "which cells host a column (filter/sort) button" source for a single pane, plus
|
|
5
|
+
* self-invalidation — the table-aware analogue of {@link useSheetVisibleCells}.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Fed to a {@link CellLayer} so the buttons render as their OWN layer (above the selection layer, so a
|
|
9
|
+
* click hits the button instead of moving the selection) while still reusing the tiled cell engine.
|
|
10
|
+
*
|
|
11
|
+
* The fast path is the whole point: {@link SheetVisibleCells.getVisibleCells} does ONE
|
|
12
|
+
* `getTables({ address })` lookup and returns `[]` when no table intersects the pane — so the common
|
|
13
|
+
* (table-free) sheet costs nothing, and a sheet WITH tables only ever emits the handful of header-row
|
|
14
|
+
* cells whose button isn't hidden, never the full visible grid.
|
|
15
|
+
*
|
|
16
|
+
* A button's own icon (filter/sort state) is NOT a concern here — {@link ColumnButton} subscribes to its
|
|
17
|
+
* table and repaints itself. This hook only invalidates when the SET / POSITION of buttons changes:
|
|
18
|
+
* table add/remove/auto-table/layout/undo (sheet events) and hidden-button / show-headers / column
|
|
19
|
+
* add-remove / resize (which fire `onAnyChange` on the TABLE, so we subscribe to each table too).
|
|
20
|
+
*/
|
|
21
|
+
export declare const useTableHeaderCells: (sheet: ISheet) => SheetVisibleCells;
|
|
22
|
+
//# sourceMappingURL=useTableHeaderCells.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ISheet, ITable } from '@sheetxl/sdk';
|
|
2
|
+
export interface VisibleTables {
|
|
3
|
+
/** The tables intersecting this pane's visible range (empty array — stable identity — when none). */
|
|
4
|
+
visibleTables: readonly ITable[];
|
|
5
|
+
/**
|
|
6
|
+
* Cache-bust token: a new identity whenever the SET / geometry / state of tables changes — table
|
|
7
|
+
* add/remove/auto-table/layout/undo (sheet events) and per-table `onAnyChange` (hidden-button,
|
|
8
|
+
* show-headers, column add/remove, resize). Does NOT change on plain scroll. Hand to a
|
|
9
|
+
* {@link CellLayer} `cacheToken` (or any table-derived memo) so it invalidates in lockstep.
|
|
10
|
+
*/
|
|
11
|
+
cacheToken: unknown;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The shared "which tables are in view + when to invalidate" source for a single pane.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Consolidates the table-tracking that both the in-grid column-button layer
|
|
18
|
+
* ({@link SheetColumnButtonLayer}) and the table chrome ({@link TableLayer}) need: one address-scoped
|
|
19
|
+
* `getTables` lookup plus the invalidation subscription. A table-free sheet costs one lookup and a
|
|
20
|
+
* stable-identity empty array.
|
|
21
|
+
*
|
|
22
|
+
* Invalidation: sheet-level `onTablesChange` / `onAutoTableChange` / `onLayoutChange` / `onInvalidated`,
|
|
23
|
+
* PLUS each visible table's `onAnyChange` — table mutations (hidden-button toggle, show-headers, column
|
|
24
|
+
* add/remove, resize) fire on the TABLE, not the sheet.
|
|
25
|
+
*/
|
|
26
|
+
export declare const useVisibleTables: (sheet: ISheet) => VisibleTables;
|
|
27
|
+
//# sourceMappingURL=useVisibleTables.d.ts.map
|