@sheetxl/react 0.8.0-beta.11 → 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/{94dxo1A-z8lgiiGw.mjs → B4mT3G7GHwgDYFGP.mjs} +2 -2
- package/browser/esm/{B26QVfjer2oY2ewK.mjs → BDlpRkuBok0Uu4Hn.mjs} +1 -1
- package/browser/esm/{CRi6DQ3UXmPEv-w_.mjs → BR-AiOwuQlYh5-tr.mjs} +147 -146
- package/browser/esm/{ClAtIfYbsUPA073B.mjs → BapujiblfiXDlu67.mjs} +1 -1
- package/browser/esm/{D2u6THGErqw64KQI.mjs → CSFORKZ8zrVL_Y0w.mjs} +1 -1
- package/browser/esm/{Bl2BFCQ00fotauKB.mjs → CUekkfE6uwwsdQpc.mjs} +1 -1
- package/browser/esm/{DgL7Dy-Lqcr1TvW6.mjs → C_LUq-BnguetvGZz.mjs} +4851 -4818
- package/browser/esm/{BQYS2Yf-EAV_tBLr.mjs → Ck1LbcsdSfKNi6xq.mjs} +1 -1
- package/browser/esm/{1-LEUre9ZLG0OYYB.mjs → Cslk_qRdBSuJIi1O.mjs} +6 -6
- package/browser/esm/CtGhA0kS2MCfEsHN.mjs +262 -0
- package/browser/esm/{BegvsXeRs7e-9t8k.mjs → D22NJmTiky4NL8tM.mjs} +1 -1
- package/browser/esm/{B93LSmhnvkxNXTq-.mjs → D2GydDzPuvIjdpok.mjs} +1 -1
- package/browser/esm/{CzRIbc-Lk__VMLKM.mjs → DGG1auUKsjFbAazu.mjs} +3 -3
- package/browser/esm/{Bos4Rkp8UTF7QXUB.mjs → DN3lqq95KY0K6f1x.mjs} +1 -1
- package/browser/esm/{Dnh1kpz3v1JKtRD_.mjs → D_usN3pWuCJU2GN-.mjs} +2 -2
- package/browser/esm/{cQ6xdPFkEcuDlNTN.mjs → DhYQRc8L2kALmFNz.mjs} +1 -1
- package/browser/esm/{DS66lAIM-9M-YoZQ.mjs → DxEczXCHTerDemDP.mjs} +112 -104
- package/browser/esm/{C1pc9F4Rt2C5FKUo.mjs → LBQDhVhz7S7i6a8i.mjs} +1 -1
- package/browser/esm/{CPnnESfZz2jjJd82.mjs → ZoS0cpNEBcv6p-Z1.mjs} +1 -1
- package/browser/esm/{DMdsMPT0fWBbTkNn.mjs → _6Sb6ElRcZftxMNh.mjs} +1 -1
- package/browser/esm/chart.mjs +28 -27
- package/browser/esm/control.mjs +2 -2
- package/browser/esm/group.mjs +3 -3
- package/browser/esm/index.mjs +5750 -5089
- package/browser/esm/note.mjs +4 -4
- package/browser/esm/picture.mjs +41 -41
- package/browser/esm/shape.mjs +2 -2
- package/browser/esm/slicer.mjs +4 -4
- package/node/esm/{BaRfst1euuhquupX.mjs → Apcuz4_QtBHt7G47.mjs} +1 -1
- package/node/esm/{b-XRVRI1fYQQMkTC.mjs → Bi2Jwc0zpweaNzKc.mjs} +525 -492
- package/node/esm/{D_pCpfdQowV_4Aje.mjs → C0KLMCRb3sbd5Q20.mjs} +5 -5
- package/node/esm/{sigD1UFqvPlWUw_9.mjs → CH1DVfFhjdd_3pw1.mjs} +2 -2
- package/node/esm/{Be9c1GwQkPo8Piuh.mjs → CNOLkUDURBElaaIf.mjs} +1 -1
- package/node/esm/{BiaDWnN3tT7neoRL.mjs → CalVk3o4-kX79s3v.mjs} +1 -1
- package/node/esm/{DgGEHydEjD7nfsDB.mjs → Cp1DuCae46eQKzWy.mjs} +1 -1
- package/node/esm/{BlxXufqBBg1PtsXd.mjs → CzN6c6KyxVmNvayz.mjs} +1 -1
- package/node/esm/{6zApGj9DozhFy-bx.mjs → DKqdv5JubgVaq-g9.mjs} +1 -1
- package/node/esm/{umljAT66yb3_rURh.mjs → DWkPWuf5ZrLRMixG.mjs} +118 -110
- package/node/esm/{JiQGhLkoL8CJpVvA.mjs → DXiNwr6ZnXBe7TlG.mjs} +1 -1
- package/node/esm/{DTMTIrYIK1eZswsM.mjs → DayGI0Bt57FDNbVF.mjs} +1 -1
- package/node/esm/{C_SNx7TlFEcwbYjx.mjs → DyetXBW7vFLJWB22.mjs} +1 -1
- package/node/esm/{Dj5FM7_-YWhCtCCt.mjs → MWges5ywL3aEdChp.mjs} +1 -1
- package/node/esm/{BMVK5plvmBOAIlxP.mjs → T5lfCrudsUnOTxEn.mjs} +1 -1
- package/node/esm/YB_qExw23Ci4nMYy.mjs +263 -0
- package/node/esm/{DxQZmb-j4NLUO9Af.mjs → bRD1KCpSpAYTEs50.mjs} +1 -1
- package/node/esm/chart.mjs +26 -25
- package/node/esm/control.mjs +2 -2
- package/node/esm/group.mjs +3 -3
- package/node/esm/{gpD-9LDW92phhoma.mjs → iL9jKJcnED6oi0B4.mjs} +1 -1
- package/node/esm/index.mjs +7658 -6996
- package/node/esm/note.mjs +4 -4
- package/node/esm/picture.mjs +41 -41
- package/node/esm/shape.mjs +50 -49
- package/node/esm/slicer.mjs +4 -4
- package/package.json +7 -7
- package/resources/locales/de/sheet.cmd.json +21 -0
- package/resources/locales/de/workbook.cmd.json +6 -0
- package/resources/locales/en/sheet.cmd.json +21 -0
- package/resources/locales/en/ui.msg.json +2 -0
- package/resources/locales/en/workbook.cmd.json +6 -0
- package/types/src/border/useBorders.d.ts +2 -2
- 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} +5 -5
- 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 +1 -1
- package/types/src/cell/useInsertableCellControls.d.ts +25 -0
- package/types/src/chart/ChartEditor.d.ts +2 -0
- package/types/src/chart/ChartElement.d.ts +14 -3
- package/types/src/chart/paint/_mode.d.ts +6 -0
- package/types/src/chart/paint/echarts.d.ts +5 -2
- package/types/src/chart/paint/kinds/ChartPaintKind.d.ts +8 -0
- package/types/src/chart/paint/toEChartsOption.d.ts +11 -0
- package/types/src/editableLabel/EditableLabel.d.ts +3 -1
- package/types/src/editor/SheetReferenceHeaderLayer.d.ts +1 -1
- package/types/src/editor/useFormulaHints.d.ts +1 -1
- package/types/src/layer/CellErrorLayer.d.ts +3 -2
- package/types/src/layer/CellIndicatorLayer.d.ts +31 -0
- package/types/src/layer/HeaderSelectionLayer.d.ts +4 -4
- package/types/src/layer/HyperlinkLayer.d.ts +8 -5
- package/types/src/layer/ProtectionLayer.d.ts +1 -2
- package/types/src/layer/SheetCellLayer.d.ts +11 -4
- package/types/src/layer/SheetMovableLayer.d.ts +2 -1
- package/types/src/layer/SheetOutlineLayer.d.ts +1 -1
- package/types/src/layer/TableLayer.d.ts +1 -1
- package/types/src/layer/TableToolbar.d.ts +1 -1
- package/types/src/layer/ValidationPromptLayer.d.ts +16 -4
- package/types/src/layer/index.d.ts +1 -0
- package/types/src/listener/useRangeListener.d.ts +13 -7
- package/types/src/movable/DefaultMovable.d.ts +1 -1
- 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/sheet/ISheetHeaderElement.d.ts +2 -2
- package/types/src/sheet/IWorksheetElement.d.ts +21 -22
- package/types/src/sheet/SheetCommandProvider.d.ts +3 -0
- package/types/src/sheet/SheetOutlineElement.d.ts +2 -2
- package/types/src/sheet/SheetPanels.d.ts +2 -2
- 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/taskPane/CellControlPane.d.ts +17 -0
- package/types/src/taskPane/index.d.ts +1 -0
- package/types/src/taskPane/useTaskPane.d.ts +6 -3
- package/types/src/workbook/DefaultRenderers.d.ts +4 -4
- package/types/src/workbook/IWorkbookElement.d.ts +52 -20
- package/types/src/workbook/WorkbookStrip.d.ts +5 -5
- package/browser/esm/ugfE7YeZALQURDKF.mjs +0 -241
- package/node/esm/DJPgbB1X22YmhbaR.mjs +0 -242
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CellContentRendererProps } from './CellRenderers';
|
|
3
|
+
/**
|
|
4
|
+
* The value type whose General alignment {@link CellContent} follows: text sits left, a number
|
|
5
|
+
* right, a boolean centered.
|
|
6
|
+
*/
|
|
7
|
+
export type CellContentAlignAs = 'text' | 'number' | 'boolean';
|
|
8
|
+
/**
|
|
9
|
+
* Props for {@link CellContent}: the renderer's own props, spread whole, plus what the host should
|
|
10
|
+
* do with them.
|
|
11
|
+
*/
|
|
12
|
+
export interface CellContentProps extends CellContentRendererProps {
|
|
13
|
+
/**
|
|
14
|
+
* Where General alignment places the children: where it would place a value of this type. An
|
|
15
|
+
* explicit horizontal alignment on the cell places them instead.
|
|
16
|
+
*
|
|
17
|
+
* @defaultValue 'boolean'
|
|
18
|
+
*/
|
|
19
|
+
alignAs?: CellContentAlignAs;
|
|
20
|
+
/**
|
|
21
|
+
* Makes the whole cell the hit region: the root carries
|
|
22
|
+
* {@link CellContentRendererProps.interactiveProps}. Leave it off and spread the props on the
|
|
23
|
+
* element inside that should take the pointer instead (a checkbox's box, a rating's stars).
|
|
24
|
+
*/
|
|
25
|
+
interactive?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Centers the children on the line the cell's text would paint in, rather than placing them
|
|
28
|
+
* against the content box: the cell's vertical alignment, font and row height move them as they
|
|
29
|
+
* move text. For content sized to the font that sits beside text (a checkbox, a slider). Content
|
|
30
|
+
* taller than the room about the line is centered on it and may be shrunk by `max-height`.
|
|
31
|
+
*/
|
|
32
|
+
centerOnTextLine?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Places the children inside the cell's text insets, the padding text gets. Turn it off for
|
|
35
|
+
* content that runs to the cell's edges, such as a picture or a button.
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue true
|
|
38
|
+
*/
|
|
39
|
+
inset?: boolean;
|
|
40
|
+
/** The cell's content. */
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The host a content renderer draws into: the cell's root, placed by the layer, with the renderer's
|
|
45
|
+
* props stripped of what is not for the DOM, its children placed in the cell's content box by the
|
|
46
|
+
* cell's alignment, in the cell's font color and size.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* Spread the renderer's props onto it whole and put what the cell shows inside:
|
|
50
|
+
*
|
|
51
|
+
* ```tsx
|
|
52
|
+
* const StarsRenderer: CellContentRenderer = (props) => (
|
|
53
|
+
* <CellContent {...props} alignAs="text">
|
|
54
|
+
* <div {...props.interactiveProps}>★★★☆☆</div>
|
|
55
|
+
* </CellContent>
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* It is a component, so a renderer that uses it is one fiber per cell inside a cached tile; the
|
|
60
|
+
* layer calls the renderer itself as a plain function. A renderer that replaces the text and
|
|
61
|
+
* positions nothing of its own needs nothing else; one that decorates the text wraps
|
|
62
|
+
* {@link CellContentRendererProps.Default} instead, which is its own root.
|
|
63
|
+
*/
|
|
64
|
+
export declare const CellContent: {
|
|
65
|
+
(props: CellContentProps): React.ReactElement;
|
|
66
|
+
displayName: string;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=CellContent.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ICell, ICellRange, IWorksheet, Scalar } from '@sheetxl/sdk';
|
|
2
|
+
import { IReactNotifier } from '@sheetxl/utils-react';
|
|
3
|
+
import { EditRejectedNotice } from '../editor/useEditRejectedNotice';
|
|
4
|
+
/**
|
|
5
|
+
* What a cell content entry writes through: guarded writes into the sheet, and the notifier for
|
|
6
|
+
* anything else it has to say. One per layer; every entry of the layer shares it.
|
|
7
|
+
*/
|
|
8
|
+
export interface CellControlContext {
|
|
9
|
+
sheet: IWorksheet;
|
|
10
|
+
notifier: IReactNotifier;
|
|
11
|
+
/**
|
|
12
|
+
* Writes `value` into `cell`.
|
|
13
|
+
*
|
|
14
|
+
* @returns `false` when the cell refuses the write: it holds a formula, or it is locked on a
|
|
15
|
+
* protected sheet (the user is told why).
|
|
16
|
+
*/
|
|
17
|
+
setCellValue(cell: ICell, value: Scalar): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Writes `value` into every cell of `range` that holds no formula, in one operation.
|
|
20
|
+
*
|
|
21
|
+
* @returns `false` when nothing was written: every cell holds a formula, or the sheet refused
|
|
22
|
+
* (a locked cell on a protected sheet; the user is told why).
|
|
23
|
+
*/
|
|
24
|
+
setRangeValue(range: ICellRange, value: Scalar): boolean;
|
|
25
|
+
}
|
|
26
|
+
/** What {@link createCellControlContext} binds. */
|
|
27
|
+
export interface CellControlContextOptions {
|
|
28
|
+
sheet: IWorksheet;
|
|
29
|
+
notifier: IReactNotifier;
|
|
30
|
+
/** The Excel-style heads-up for a write the sheet's protection refuses. */
|
|
31
|
+
notifyEditRejected: EditRejectedNotice;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates the {@link CellControlContext} of a layer.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createCellControlContext(options: CellControlContextOptions): CellControlContext;
|
|
37
|
+
//# sourceMappingURL=CellControlContext.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ICalculation, ICell, Size } from '@sheetxl/sdk';
|
|
3
3
|
/**
|
|
4
|
-
* Props for {@link
|
|
4
|
+
* Props for {@link CellFormulaRenderer}.
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface CellFormulaRendererProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
/** The formula cell being rendered (styling source: font, alignment, insets). */
|
|
8
8
|
cell: ICell;
|
|
9
9
|
/**
|
|
@@ -22,7 +22,7 @@ export interface FormulaCellRendererProps extends React.HTMLAttributes<HTMLDivEl
|
|
|
22
22
|
* The **formula-view** cell renderer: the anchor cell's formula as tokenized, syntax-colored text.
|
|
23
23
|
*
|
|
24
24
|
* @remarks
|
|
25
|
-
* The live counterpart of `
|
|
25
|
+
* The live counterpart of `CellTextRenderer`'s (plain) `showFormulas` path: the tiled layer keeps
|
|
26
26
|
* every formula cell as an immutable plain-text snapshot, and `SheetCellLayer` suppresses the
|
|
27
27
|
* ANCHOR cell (the live `data-rc` CSS channel) and overlays this renderer in its place — so
|
|
28
28
|
* selection moves never invalidate a tile. Colors are emitted as theme tokens (`light-dark()`
|
|
@@ -33,5 +33,5 @@ export interface FormulaCellRendererProps extends React.HTMLAttributes<HTMLDivEl
|
|
|
33
33
|
* the letter-spacing that paints the text at its measured width.
|
|
34
34
|
* (2nd pass: hover highlight/eval tooltips like the editor's overlay.)
|
|
35
35
|
*/
|
|
36
|
-
export declare const
|
|
37
|
-
//# sourceMappingURL=
|
|
36
|
+
export declare const CellFormulaRenderer: React.FC<CellFormulaRendererProps>;
|
|
37
|
+
//# sourceMappingURL=CellFormulaRenderer.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CellContentEntry, CellContentRendererProps } from './CellRenderers';
|
|
3
|
+
/**
|
|
4
|
+
* Draws an image value: the picture in the cell, edge to edge, placed by the cell's alignment
|
|
5
|
+
* (left under General, as text is) and sized by the value's sizing. Nothing draws until the bytes are in;
|
|
6
|
+
* a source with no picture draws `#VALUE!`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CellImageRenderer: (props: CellContentRendererProps) => React.ReactElement;
|
|
9
|
+
/** What an image value contributes to the UI: its picture. */
|
|
10
|
+
export declare const CellImageContent: CellContentEntry;
|
|
11
|
+
//# sourceMappingURL=CellImageRenderer.d.ts.map
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ICell, ICellControl, IRangeSelection, IWorksheet } from '@sheetxl/sdk';
|
|
3
|
+
import { CellRendererProps } from '@sheetxl/grid-react';
|
|
4
|
+
import { CellTextRendererProps } from './CellTextRenderer';
|
|
5
|
+
import { CellControlContext } from './CellControlContext';
|
|
6
|
+
/**
|
|
7
|
+
* The props spread onto the element of a cell's content that takes the pointer (see
|
|
8
|
+
* {@link CellContentRendererProps.interactiveProps}). A marker only: one frozen object for every
|
|
9
|
+
* cell, no handlers.
|
|
10
|
+
*/
|
|
11
|
+
export type CellInteractiveProps = Readonly<Record<string, string>>;
|
|
12
|
+
/**
|
|
13
|
+
* The props of the default text renderer as a content renderer receives it
|
|
14
|
+
* ({@link CellContentRendererProps.Default}): the content props may be spread straight onto it.
|
|
15
|
+
*/
|
|
16
|
+
export type DefaultCellContentProps = Omit<CellContentRendererProps, keyof CellContentOnlyProps> & Partial<CellContentOnlyProps> & Partial<Omit<CellTextRendererProps, keyof CellRendererProps<ICell>>>;
|
|
17
|
+
/** The props a content renderer has that the default text renderer does not. */
|
|
18
|
+
export interface CellContentOnlyProps {
|
|
19
|
+
control: ICellControl | null;
|
|
20
|
+
context: CellControlContext;
|
|
21
|
+
interactiveProps: CellInteractiveProps;
|
|
22
|
+
Default: React.ComponentType<DefaultCellContentProps>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* What a cell content renderer is given: the cell layer's props for the cell, the layer's write
|
|
26
|
+
* context, the props that make an element interactive, and the default text renderer.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* A renderer is a pure function of these props: it is rendered inside the cell layer's cached
|
|
30
|
+
* tiles and calls no hook.
|
|
31
|
+
*/
|
|
32
|
+
export interface CellContentRendererProps extends CellRendererProps<ICell> {
|
|
33
|
+
/**
|
|
34
|
+
* The control the renderer draws for, when it was chosen by the cell's control; `null` when it
|
|
35
|
+
* was chosen by the value's rich data type.
|
|
36
|
+
*/
|
|
37
|
+
control: ICellControl | null;
|
|
38
|
+
/**
|
|
39
|
+
* The layer's write context, one for every cell of the layer: guarded writes
|
|
40
|
+
* (`setCellValue(cell, value)`) for a renderer that writes from its own pointer handlers, such
|
|
41
|
+
* as a slider's drag. A press and a key write through the entry instead.
|
|
42
|
+
*/
|
|
43
|
+
context: CellControlContext;
|
|
44
|
+
/**
|
|
45
|
+
* Spread onto the element that takes the pointer: the box of a checkbox, a button, the track of a
|
|
46
|
+
* slider. It marks the element, nothing more. A plain press on a marked element selects the cell
|
|
47
|
+
* and then reaches the element; the cell layer runs the entry's {@link CellContentEntry.onPress}
|
|
48
|
+
* for it and stops the press, and keeps a double-click on it from opening the editor. For a drag
|
|
49
|
+
* or hover add your own handlers on the element (capture the pointer on it for a drag); a handler
|
|
50
|
+
* that stops the press keeps the layer out of it.
|
|
51
|
+
*/
|
|
52
|
+
interactiveProps: CellInteractiveProps;
|
|
53
|
+
/**
|
|
54
|
+
* The default text renderer, bound to this layer's theme, Normal style and view flags. For a
|
|
55
|
+
* renderer that decorates the text rather than replacing it: `<Default {...props}>{badge}</Default>`.
|
|
56
|
+
*/
|
|
57
|
+
Default: React.ComponentType<DefaultCellContentProps>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Draws a cell's content in place of its text.
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* A pure function of its props: the layer calls it directly inside its cached tiles, not as a
|
|
64
|
+
* component, so it can hold no state and call no hook (a hook throws). It returns the cell's root,
|
|
65
|
+
* which applies `props.style` to place itself in the cell; `CellContent` is that root ready-made.
|
|
66
|
+
* The layer takes no pointer events; the part that should take the pointer spreads
|
|
67
|
+
* `props.interactiveProps`.
|
|
68
|
+
*/
|
|
69
|
+
export type CellContentRenderer = (props: CellContentRendererProps) => React.ReactNode;
|
|
70
|
+
/** What a key offered to a content entry is about: the selection it acts on. */
|
|
71
|
+
export interface CellKeyTarget {
|
|
72
|
+
sheet: IWorksheet;
|
|
73
|
+
selection: IRangeSelection;
|
|
74
|
+
/** The selection's anchor cell. */
|
|
75
|
+
anchor: ICell;
|
|
76
|
+
/** The controls of the entry's type that the selection touches; empty for a rich data entry. */
|
|
77
|
+
controls: ICellControl[];
|
|
78
|
+
}
|
|
79
|
+
/** Props of a content entry's task pane body ({@link CellContentEntry.pane}). */
|
|
80
|
+
export interface CellControlPaneProps {
|
|
81
|
+
sheet: IWorksheet;
|
|
82
|
+
/** The anchor cell. */
|
|
83
|
+
cell: ICell;
|
|
84
|
+
/** The cell's control; `null` for a rich data entry. */
|
|
85
|
+
control: ICellControl | null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* What a type of cell control, or of rich data value, contributes to the UI: how its cells draw,
|
|
89
|
+
* what a press and a key do to them, and the task pane body for them. Every field is optional; a
|
|
90
|
+
* type registered with none draws as text.
|
|
91
|
+
*/
|
|
92
|
+
export interface CellContentEntry {
|
|
93
|
+
/** Draws the cell in place of its text. Without it the cell draws as text. */
|
|
94
|
+
renderer?: CellContentRenderer;
|
|
95
|
+
/**
|
|
96
|
+
* A press on the content: a primary press on an element carrying
|
|
97
|
+
* {@link CellContentRendererProps.interactiveProps}. A checkbox writes the other value. The
|
|
98
|
+
* event says what was pressed: a renderer with several hit zones in one cell (the stars of a
|
|
99
|
+
* rating) marks them with attributes of its own and reads `event.target`.
|
|
100
|
+
*/
|
|
101
|
+
onPress?: (cell: ICell, ctx: CellControlContext, event: CellPressEvent) => void;
|
|
102
|
+
/**
|
|
103
|
+
* A printable key, Space included, typed on the grid while the selection touches cells of this
|
|
104
|
+
* type. Never Enter, Tab, an arrow, Escape or a function key, and never a key with a modifier.
|
|
105
|
+
* Return `true` when consumed: the key then never starts an edit. Return `false` to let the key
|
|
106
|
+
* start the normal edit of the anchor cell. Offered once per type with the whole selection; a
|
|
107
|
+
* checkbox toggles every checkbox cell of it on Space.
|
|
108
|
+
*/
|
|
109
|
+
onKey?: (key: string, target: CellKeyTarget, ctx: CellControlContext) => boolean;
|
|
110
|
+
/** The body the cell control pane shows while a cell of this type is the selection's anchor. */
|
|
111
|
+
pane?: React.ComponentType<CellControlPaneProps>;
|
|
112
|
+
/**
|
|
113
|
+
* The icon where a UI lists the types that can be inserted: a `DynamicIcon` key or an element.
|
|
114
|
+
* The name comes from the sdk kind's `label`.
|
|
115
|
+
*/
|
|
116
|
+
icon?: string | React.ReactElement;
|
|
117
|
+
/**
|
|
118
|
+
* Whether a UI lists the type among those that can be inserted. Off for a type whose default
|
|
119
|
+
* value shows nothing, such as an image, which needs a source.
|
|
120
|
+
*
|
|
121
|
+
* @defaultValue true
|
|
122
|
+
*/
|
|
123
|
+
insertable?: boolean;
|
|
124
|
+
}
|
|
125
|
+
/** The press handed to {@link CellContentEntry.onPress}: the pointer event, already consumed. */
|
|
126
|
+
export type CellPressEvent = Pick<React.PointerEvent, 'button' | 'target' | 'clientX' | 'clientY' | 'shiftKey' | 'ctrlKey' | 'metaKey' | 'altKey'>;
|
|
127
|
+
/** A cell's content entry and what chose it, as {@link getCellContent} answers it. */
|
|
128
|
+
export interface ResolvedCellContent {
|
|
129
|
+
entry: CellContentEntry;
|
|
130
|
+
/** {@inheritDoc CellContentRendererProps.control} */
|
|
131
|
+
control: ICellControl | null;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Registers what a type of cell control contributes to the UI, replacing the built-in entry.
|
|
135
|
+
*
|
|
136
|
+
* @param type The control type (`ICellControl.getType()`), as registered with `CellControlRegistry`
|
|
137
|
+
* in the SDK.
|
|
138
|
+
* @returns A function that removes the registration.
|
|
139
|
+
*/
|
|
140
|
+
export declare function registerCellControl(type: string, entry: CellContentEntry): () => void;
|
|
141
|
+
/**
|
|
142
|
+
* Registers what a type of rich data value contributes to the UI, used when the cell's control
|
|
143
|
+
* does not draw the value. Replaces the built-in entry (`image`).
|
|
144
|
+
*
|
|
145
|
+
* @param type The rich data type (`IRichData.getKind().getName()`), as registered with `RichDataRegistry` in
|
|
146
|
+
* the SDK.
|
|
147
|
+
* @returns A function that removes the registration.
|
|
148
|
+
*/
|
|
149
|
+
export declare function registerRichData(type: string, entry: CellContentEntry): () => void;
|
|
150
|
+
/** The entry registered for a rich data type, built-in or not, or `undefined`. */
|
|
151
|
+
export declare function getRichDataEntry(type: string): CellContentEntry | undefined;
|
|
152
|
+
/** The entry registered for a control type, built-in or not, or `undefined`. */
|
|
153
|
+
export declare function getCellControlEntry(type: string): CellContentEntry | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* The content entry for `cell`, or `null` for plain text.
|
|
156
|
+
*
|
|
157
|
+
* @remarks
|
|
158
|
+
* The cell's control comes first, when it accepts the cell's value and an entry is registered for
|
|
159
|
+
* its type; then the entry for the value's rich data type. The entry may still have no renderer,
|
|
160
|
+
* in which case the cell draws as text.
|
|
161
|
+
*/
|
|
162
|
+
export declare function getCellContent(cell: ICell): ResolvedCellContent | null;
|
|
163
|
+
/**
|
|
164
|
+
* Calls `listener` whenever what {@link getCellContent} answers may have changed: an entry
|
|
165
|
+
* registered or removed.
|
|
166
|
+
*
|
|
167
|
+
* @returns A function that removes the listener.
|
|
168
|
+
*/
|
|
169
|
+
export declare function addCellContentListener(listener: () => void): () => void;
|
|
170
|
+
/**
|
|
171
|
+
* Changes whenever an entry is registered or removed, for `useSyncExternalStore`.
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
export declare function getCellContentVersion(): number;
|
|
175
|
+
/**
|
|
176
|
+
* A primary press that reached the cell layer: when it is on interactive content whose entry has a
|
|
177
|
+
* press, runs the press and consumes the event. The layer's own handler, so no cell carries one.
|
|
178
|
+
*
|
|
179
|
+
* @returns Whether the press was taken.
|
|
180
|
+
*/
|
|
181
|
+
export declare function pressCellContent(e: CellPressEvent & Pick<React.PointerEvent, 'stopPropagation' | 'preventDefault'>, sheet: IWorksheet, ctx: CellControlContext): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Offers a printable key typed on the grid to the content entries the selection touches, once per
|
|
184
|
+
* type with the whole selection (the selection's controls grouped by type, then the anchor's rich
|
|
185
|
+
* data type).
|
|
186
|
+
*
|
|
187
|
+
* @returns Whether an entry consumed it. The caller then never starts an edit with the key.
|
|
188
|
+
*/
|
|
189
|
+
export declare function offerCellKey(key: string, sheet: IWorksheet, ctx: CellControlContext): boolean;
|
|
190
|
+
//# sourceMappingURL=CellRenderers.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ICell, ICellStyle, ITheme } from '@sheetxl/sdk';
|
|
3
3
|
import { CellRendererProps } from '@sheetxl/grid-react';
|
|
4
|
-
export interface
|
|
4
|
+
export interface CellTextRendererProps extends CellRendererProps<ICell> {
|
|
5
5
|
/**
|
|
6
6
|
* If true, prefer to show the formulas over values
|
|
7
7
|
*/
|
|
@@ -37,14 +37,17 @@ export interface SheetCellRendererProps extends CellRendererProps<ICell> {
|
|
|
37
37
|
*/
|
|
38
38
|
normalStyle?: ICellStyle;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Called when the cell's hyperlink is clicked: on release, as Excel follows a link on mouse up
|
|
41
|
+
* (the press itself selects the cell). The link text is interactive content of the cell.
|
|
41
42
|
*
|
|
42
43
|
* @param event - The mouse event
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
+
onLinkClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
45
46
|
}
|
|
46
47
|
/**
|
|
47
|
-
*
|
|
48
|
+
* Paints a cell's value as text: the formatted value (or its formula in formula view), laid out
|
|
49
|
+
* and decorated the way the sheet shows it. Everything else a cell shows (fill, borders,
|
|
50
|
+
* conditional icons and bars, column buttons, indicators) is a layer of its own.
|
|
48
51
|
*
|
|
49
52
|
* Some of the features are:
|
|
50
53
|
* 1. Text Color
|
|
@@ -63,5 +66,5 @@ export interface SheetCellRendererProps extends CellRendererProps<ICell> {
|
|
|
63
66
|
*
|
|
64
67
|
* @param props
|
|
65
68
|
*/
|
|
66
|
-
export declare const
|
|
67
|
-
//# sourceMappingURL=
|
|
69
|
+
export declare const CellTextRenderer: React.FC<CellTextRendererProps>;
|
|
70
|
+
//# sourceMappingURL=CellTextRenderer.d.ts.map
|
|
@@ -24,15 +24,15 @@ export interface ColumnButtonConfigProps {
|
|
|
24
24
|
/**
|
|
25
25
|
* Callback for creating a custom column button.
|
|
26
26
|
*
|
|
27
|
-
* @returns A React Element representing the ColumnButton.
|
|
28
27
|
*/
|
|
29
|
-
renderColumnButton?: (props: ColumnButtonProps) => React.
|
|
28
|
+
renderColumnButton?: (props: ColumnButtonProps) => React.ReactNode;
|
|
30
29
|
}
|
|
31
30
|
/**
|
|
32
31
|
* Property for the filter button
|
|
33
32
|
*/
|
|
34
33
|
export interface ColumnButtonProps extends React.HTMLAttributes<HTMLElement> {
|
|
35
|
-
|
|
34
|
+
/** The header cell's box the button pins itself into. */
|
|
35
|
+
bounds: Bounds;
|
|
36
36
|
zoom: number;
|
|
37
37
|
disabled: boolean;
|
|
38
38
|
column: ITable.IColumn;
|
|
@@ -53,12 +53,12 @@ export interface OutlineProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
53
53
|
* Renders a group's collapse / expand button, filling the square it is placed in. Defaults to
|
|
54
54
|
* {@link OutlineButton}.
|
|
55
55
|
*/
|
|
56
|
-
renderButton?: (props: OutlineButtonProps) => React.ReactNode;
|
|
56
|
+
renderButton?: ((props: OutlineButtonProps) => React.ReactNode) | null;
|
|
57
57
|
/**
|
|
58
58
|
* Renders a level button, filling the square it is placed in. Defaults to
|
|
59
59
|
* {@link OutlineLevelButton}.
|
|
60
60
|
*/
|
|
61
|
-
renderLevelButton?: (props: OutlineLevelButtonProps) => React.ReactNode;
|
|
61
|
+
renderLevelButton?: ((props: OutlineLevelButtonProps) => React.ReactNode) | null;
|
|
62
62
|
/**
|
|
63
63
|
* The size of one level's lane across the gutter, in pixels at 100% zoom. A button fills its lane,
|
|
64
64
|
* less {@link laneGap}.
|
|
@@ -118,6 +118,6 @@ export declare const OutlineButton: React.MemoExoticComponent<(props: OutlineBut
|
|
|
118
118
|
* The chromeless level button: a square with its level number, in the corner knob's colors.
|
|
119
119
|
*/
|
|
120
120
|
export declare const OutlineLevelButton: React.MemoExoticComponent<(props: OutlineLevelButtonProps) => React.JSX.Element>;
|
|
121
|
-
export declare const
|
|
122
|
-
export declare const
|
|
121
|
+
export declare const defaultRenderOutlineButton: (props: OutlineButtonProps) => React.ReactNode;
|
|
122
|
+
export declare const defaultRenderOutlineLevelButton: (props: OutlineLevelButtonProps) => React.ReactNode;
|
|
123
123
|
//# sourceMappingURL=OutlineButton.d.ts.map
|
|
@@ -36,7 +36,7 @@ export interface SheetHeaderRendererProps extends CellRendererProps {
|
|
|
36
36
|
*
|
|
37
37
|
* @returns A React Element representing the ColumnButton.
|
|
38
38
|
*/
|
|
39
|
-
renderColumnButton?: (props: ColumnButtonProps) => React.
|
|
39
|
+
renderColumnButton?: (props: ColumnButtonProps) => React.ReactNode;
|
|
40
40
|
}
|
|
41
41
|
export declare const SheetHeaderRenderer: React.MemoExoticComponent<(props: SheetHeaderRendererProps) => React.JSX.Element>;
|
|
42
42
|
//# sourceMappingURL=SheetHeaderRenderer.d.ts.map
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './CellTextRenderer';
|
|
2
|
+
export { registerCellControl, registerRichData, getCellContent, getCellControlEntry, addCellContentListener, type CellContentEntry, type CellContentRenderer, type CellContentRendererProps, type CellInteractiveProps, type CellPressEvent, type CellKeyTarget, type CellControlPaneProps, type DefaultCellContentProps, type ResolvedCellContent } from './CellRenderers';
|
|
3
|
+
export * from './CellControlContext';
|
|
4
|
+
export * from './CellContent';
|
|
5
|
+
export * from './CellCheckboxRenderer';
|
|
6
|
+
export * from './CellImageRenderer';
|
|
7
|
+
export * from './useInsertableCellControls';
|
|
2
8
|
export * from './StaticCellRenderer';
|
|
3
|
-
export * from './
|
|
9
|
+
export * from './CellFormulaRenderer';
|
|
4
10
|
export * from './useFormulaViewAnchor';
|
|
5
11
|
export * from './SheetHeaderRenderer';
|
|
6
12
|
export * from './ColumnButton';
|
|
@@ -28,7 +28,7 @@ export interface FormulaViewAnchor {
|
|
|
28
28
|
* The shared **formula-view spotlight** source: while `sheetView.isShowFormulas()` is on, tracks the
|
|
29
29
|
* sheet's selection anchor and — when it sits on a formula cell — returns that formula's tokens and
|
|
30
30
|
* scoped reference ranges. Consumed by `SheetCellLayer` (suppress the anchor's plain tile text +
|
|
31
|
-
* overlay the colored `
|
|
31
|
+
* overlay the colored `CellFormulaRenderer`) and `SheetReferenceLayer` (outline the references via
|
|
32
32
|
* the ranges picker), so the two always agree on what is spotlighted — and colors line up, both
|
|
33
33
|
* keying off `referenceIndex`.
|
|
34
34
|
*
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** A type of cell content that a UI can offer to insert: a cell control or a rich data value. */
|
|
3
|
+
export interface InsertableCellControl {
|
|
4
|
+
/** The control type or the rich data type, as registered in the SDK. */
|
|
5
|
+
type: string;
|
|
6
|
+
/**
|
|
7
|
+
* What inserting it does: `'control'` puts the control on the cells and keeps their values;
|
|
8
|
+
* `'richData'` writes the kind's default value into them.
|
|
9
|
+
*/
|
|
10
|
+
family: 'control' | 'richData';
|
|
11
|
+
/** The sdk kind's `label`, or the type when the kind has none. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** The entry's `icon`, or `null`. */
|
|
14
|
+
icon: string | React.ReactElement | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The cell content types that can be inserted: cell control types and rich data types registered
|
|
18
|
+
* in the SDK whose UI entry draws them, built-ins included.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Follows {@link registerCellControl} and {@link registerRichData} live. The SDK registries have no
|
|
22
|
+
* change signal, so register a type's sdk kind before its UI entry.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useInsertableCellControls(): readonly InsertableCellControl[];
|
|
25
|
+
//# sourceMappingURL=useInsertableCellControls.d.ts.map
|
|
@@ -17,6 +17,8 @@ export interface ChartEditorProps extends MovableElementProps {
|
|
|
17
17
|
* shows the frame's states (disabled, dragging).
|
|
18
18
|
*
|
|
19
19
|
* @remarks
|
|
20
|
+
* The chart is drawn in the grid's color scheme, as the cells about it are.
|
|
21
|
+
*
|
|
20
22
|
* A press inside the chart selects what is under the pointer in the sheet view's chart element
|
|
21
23
|
* selection, Excel's way (the series first, its point next), and is the element's: the frame
|
|
22
24
|
* drags the chart from its chart area alone, as Excel does.
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IChart, IChartElementSelection } from '@sheetxl/sdk';
|
|
3
3
|
import { Point } from '@sheetxl/utils';
|
|
4
|
+
import { ThemeMode } from '@sheetxl/utils-react';
|
|
4
5
|
export interface ChartElementAttributes {
|
|
5
6
|
isChartElement: () => true;
|
|
6
7
|
/** The chart drawn; `null` until a `Promise` input resolves. */
|
|
7
8
|
getChart: () => IChart | null;
|
|
8
9
|
/**
|
|
9
|
-
* The chart as
|
|
10
|
-
*
|
|
10
|
+
* The chart as an SVG document of the element's unzoomed size; `null` while the chart has no
|
|
11
|
+
* layout or the element no size. It is drawn light, a chart area with no fill of its own white,
|
|
12
|
+
* unless `darkMode`.
|
|
11
13
|
*/
|
|
12
|
-
toSVG: (
|
|
14
|
+
toSVG: (options?: {
|
|
15
|
+
darkMode?: boolean;
|
|
16
|
+
}) => Promise<string | null>;
|
|
13
17
|
/**
|
|
14
18
|
* The chart element drawn under a point of the page (`clientX`, `clientY`), as the chart is
|
|
15
19
|
* painted now; `null` outside the chart, or before it is painted.
|
|
@@ -76,6 +80,13 @@ export interface ChartElementProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
76
80
|
* A press on the chart area empties the selection: the chart is then what is selected.
|
|
77
81
|
*/
|
|
78
82
|
selection?: IChartElementSelection | null;
|
|
83
|
+
/**
|
|
84
|
+
* Whether the chart is drawn light or dark. Dark, its colors are drawn as a dark grid draws its
|
|
85
|
+
* cells. A chart area with no fill of its own is the surface's background
|
|
86
|
+
* (`--sxl-color-base-100`) in either mode.
|
|
87
|
+
* @defaultValue the app's scheme (`useAppColorScheme`); a chart on a sheet is drawn in the grid's
|
|
88
|
+
*/
|
|
89
|
+
colorScheme?: ThemeMode;
|
|
79
90
|
/**
|
|
80
91
|
* Called on a press inside the chart with what is under the pointer, before the selection (if
|
|
81
92
|
* any) changes.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ChartLayout } from '@sheetxl/sdk';
|
|
2
|
+
/** A concrete CSS color as a dark grid draws it; one that cannot be read as it is. */
|
|
3
|
+
export declare const darkColor: (css: string) => string;
|
|
4
|
+
/** The layout with each of its colors as a dark grid draws it; the layout itself when light. */
|
|
5
|
+
export declare const layoutInMode: (layout: ChartLayout, darkMode: boolean) => ChartLayout;
|
|
6
|
+
//# sourceMappingURL=_mode.d.ts.map
|
|
@@ -18,8 +18,11 @@ export declare function renderChartToSVG(layout: ChartLayout, options?: Translat
|
|
|
18
18
|
* what is under the pointer asks the chart (`IChart.getElementAt`) with the layout it painted.
|
|
19
19
|
*/
|
|
20
20
|
export interface MountedChart {
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Paints a new layout; a new size resizes the instance first.
|
|
23
|
+
* @param options How it is translated now; by default as it was mounted.
|
|
24
|
+
*/
|
|
25
|
+
update(layout: ChartLayout, options?: TranslateOptions): void;
|
|
23
26
|
dispose(): void;
|
|
24
27
|
}
|
|
25
28
|
/**
|
|
@@ -58,7 +58,15 @@ export declare namespace ChartPaintKind {
|
|
|
58
58
|
}
|
|
59
59
|
/** What a kind is given to paint a group. */
|
|
60
60
|
interface Context {
|
|
61
|
+
/** The layout to paint, its colors already in the mode painted. */
|
|
61
62
|
readonly layout: ChartLayout;
|
|
63
|
+
/** Whether the chart is drawn as a dark grid draws its cells. */
|
|
64
|
+
readonly darkMode: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* A concrete CSS color of the kind's own (not the layout's, which are in the mode already) as
|
|
67
|
+
* the chart is drawn: as a dark grid draws it when {@link darkMode}.
|
|
68
|
+
*/
|
|
69
|
+
color(css: string): string;
|
|
62
70
|
axisOf(id: number): ChartLayout.AxisLayout | undefined;
|
|
63
71
|
/** The grid a group's axes are on. */
|
|
64
72
|
cartesian(group: {
|
|
@@ -15,6 +15,17 @@ export interface TranslateOptions {
|
|
|
15
15
|
* @defaultValue 'graphic'
|
|
16
16
|
*/
|
|
17
17
|
legend?: 'native' | 'graphic';
|
|
18
|
+
/**
|
|
19
|
+
* Whether the chart is drawn as a dark grid draws its cells: each color through `IColor.toRGBA(true)`.
|
|
20
|
+
* @defaultValue false
|
|
21
|
+
*/
|
|
22
|
+
darkMode?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* What a chart area that states no fill is filled with, light: the background of where it is
|
|
25
|
+
* drawn. `'transparent'` leaves it to what is behind the chart.
|
|
26
|
+
* @defaultValue '#FFFFFF'
|
|
27
|
+
*/
|
|
28
|
+
background?: string;
|
|
18
29
|
}
|
|
19
30
|
/**
|
|
20
31
|
* Translates a {@link ChartLayout} to an ECharts option.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { RenderSlotFn } from '@sheetxl/utils-react';
|
|
2
3
|
export interface EditableLabelAttributes {
|
|
3
4
|
startEdit(): void;
|
|
4
5
|
cancel(): void;
|
|
@@ -18,7 +19,8 @@ export interface EditableLabelProps extends Omit<React.HTMLAttributes<HTMLDivEle
|
|
|
18
19
|
onChange?: (value: string) => void;
|
|
19
20
|
onSubmit?: (value: string) => boolean | void;
|
|
20
21
|
onCancel?: () => void;
|
|
21
|
-
|
|
22
|
+
/** Render the input shown while editing. Spread the props on an `<input>`. */
|
|
23
|
+
renderInput?: RenderSlotFn<React.InputHTMLAttributes<HTMLInputElement>>;
|
|
22
24
|
/**
|
|
23
25
|
* Reference to the HTMLInputElement (or other) used for editing
|
|
24
26
|
*/
|
|
@@ -34,7 +34,7 @@ export interface SheetReferenceHeaderLayerProps extends LayerProps {
|
|
|
34
34
|
* primary header selection fully in charge. The producer's gates — `scope` and `allowMulti` — are read
|
|
35
35
|
* here exactly as {@link SheetReferenceLayer} reads them for the body: the two surfaces drive one
|
|
36
36
|
* selection, so a gate honored by only one of them is no gate at all. It is a pointer surface
|
|
37
|
-
* only ({@link HeaderSelectionLayer} with `
|
|
37
|
+
* only ({@link HeaderSelectionLayer} with `hideAccent`) — the reference rectangles are drawn on
|
|
38
38
|
* the body grid by {@link SheetReferenceLayer}; `preserveFocus` keeps the formula editor focused across a
|
|
39
39
|
* header drag; `replaceActive` re-scopes/inserts the active reference instead of the primary's whole-
|
|
40
40
|
* selection replace.
|
|
@@ -195,7 +195,7 @@ export interface FormulaHintsApi {
|
|
|
195
195
|
*/
|
|
196
196
|
getAnchorOffset(): number;
|
|
197
197
|
/**
|
|
198
|
-
* STABLE-identity panel renderer for `useFloatStack.
|
|
198
|
+
* STABLE-identity panel renderer for `useFloatStack.renderPopupPanel` — the autocomplete list when
|
|
199
199
|
* it has matches, else the signature preview. Returns `null` when there is nothing to show.
|
|
200
200
|
*/
|
|
201
201
|
renderPanel(): React.ReactNode;
|
|
@@ -60,9 +60,10 @@ export interface CellErrorLayerProps extends Omit<LayerProps, 'children'> {
|
|
|
60
60
|
closeDelay?: number;
|
|
61
61
|
/**
|
|
62
62
|
* Optional custom tip renderer. Spread `tipProps` (from context via `useSticky`, or reuse the
|
|
63
|
-
* default) onto the returned element to keep the tip open while hovered. Omit for the default card
|
|
63
|
+
* default) onto the returned element to keep the tip open while hovered. Omit for the default card;
|
|
64
|
+
* `null` for none.
|
|
64
65
|
*/
|
|
65
|
-
renderTip?: (tip: CellErrorTip) => React.ReactNode;
|
|
66
|
+
renderTip?: ((tip: CellErrorTip) => React.ReactNode) | null;
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
68
69
|
* A grid layer that shows a **hover tooltip on cells carrying errors / warnings**. A thin
|