@sheetxl/grid-react 0.8.0-beta.10 → 0.8.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/browser/esm/index.mjs +1426 -1321
- package/node/esm/index.mjs +1429 -1323
- package/package.json +3 -3
- package/types/src/cell/CellRenderer.d.ts +32 -0
- package/types/src/cell/GridlineLayer.d.ts +39 -1
- package/types/src/editor/DefaultEditable.d.ts +2 -2
- package/types/src/editor/EditorDiv.d.ts +3 -2
- package/types/src/editor/EditorStartLayer.d.ts +4 -3
- package/types/src/grid/Grid.d.ts +1 -1
- package/types/src/grid/IGrid.d.ts +4 -4
- package/types/src/header/HeaderDividerAnchor.d.ts +7 -1
- package/types/src/layer/TooltipProvider.d.ts +3 -2
- package/types/src/list/CheckboxList.d.ts +7 -1
- package/types/src/list/PickList.d.ts +6 -1
- package/types/src/range/Draggable.d.ts +7 -1
- package/types/src/surface/GridPane.d.ts +2 -0
- package/types/src/surface/IGridPane.d.ts +15 -2
- package/types/src/surface/SurfaceStateProvider.d.ts +1 -1
- package/types/src/surface/getPrimaryPane.d.ts +13 -0
- package/types/src/surface/index.d.ts +1 -0
- package/types/src/theme/GridTheme.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/grid-react",
|
|
3
3
|
"description": "Grid React - Advanced grid component for React",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.12",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"table"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
44
|
-
"@sheetxl/utils-react": "^0.8.0-beta.
|
|
43
|
+
"@sheetxl/utils": "^0.8.0-beta.12",
|
|
44
|
+
"@sheetxl/utils-react": "^0.8.0-beta.12",
|
|
45
45
|
"clsx": "^2.1.1",
|
|
46
46
|
"react-merge-refs": "^3.0.2"
|
|
47
47
|
},
|
|
@@ -50,4 +50,36 @@ export interface CellRendererProps<T = any> extends React.HTMLAttributes<HTMLEle
|
|
|
50
50
|
*/
|
|
51
51
|
'data-rc'?: string;
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The attribute that marks cell content as **interactive**: an element a rendered cell draws that
|
|
55
|
+
* takes the pointer itself (a checkbox, a button, a slider's thumb). Spread
|
|
56
|
+
* {@link CELL_INTERACTIVE_PROPS} onto that element rather than writing the attribute by hand.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* A rendered cell is `pointer-events: none`, and the selection layer above the cells starts a
|
|
60
|
+
* gesture on every press, so without this nothing drawn in a cell can take a press. A primary
|
|
61
|
+
* press on a marked element selects its cell and starts no drag; the event then reaches the
|
|
62
|
+
* element's own handlers, which decide what the press does (and stop it, so nothing below acts).
|
|
63
|
+
* A press with a modifier (Shift, Ctrl) is a selection press as usual. Layers above the selection
|
|
64
|
+
* still hear the press first.
|
|
65
|
+
*/
|
|
66
|
+
export declare const CELL_INTERACTIVE_ATTRIBUTE = "data-cell-interactive";
|
|
67
|
+
/**
|
|
68
|
+
* The props that make an element of cell content interactive ({@link CELL_INTERACTIVE_ATTRIBUTE}):
|
|
69
|
+
* spread them onto the element that takes the pointer, then add its handlers (`onPointerDown`,
|
|
70
|
+
* `onPointerMove`, …) as on any element. The cell layer gives it `pointer-events: auto`; a drag
|
|
71
|
+
* captures the pointer on the element itself (`setPointerCapture`), as the Stage honors capture.
|
|
72
|
+
*/
|
|
73
|
+
export declare const CELL_INTERACTIVE_PROPS: Readonly<Record<string, string>>;
|
|
74
|
+
/**
|
|
75
|
+
* Whether `target` is, or is inside, interactive cell content ({@link CELL_INTERACTIVE_ATTRIBUTE}).
|
|
76
|
+
*/
|
|
77
|
+
export declare const isCellInteractiveTarget: (target: EventTarget | null) => boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The cell the interactive content under `target` belongs to, read from the layer's `data-rc`
|
|
80
|
+
* stamp on the content's cell root, or `null` when `target` is not interactive content or the
|
|
81
|
+
* content carries no stamp. Content can reach past its cell (overflowing link text), so a press
|
|
82
|
+
* on it is about the content's cell, not the cell under the pointer.
|
|
83
|
+
*/
|
|
84
|
+
export declare const getCellInteractiveCoords: (target: EventTarget | null) => CellCoords | null;
|
|
53
85
|
//# sourceMappingURL=CellRenderer.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { OrientationFlags } from '@sheetxl/utils';
|
|
2
|
+
import { RangeCoords, OrientationFlags } from '@sheetxl/utils';
|
|
3
|
+
import { IGridPane } from '../surface';
|
|
3
4
|
import { LayerProps } from '../layer';
|
|
4
5
|
import { CellModelOptions } from './_CellModel';
|
|
5
6
|
/**
|
|
@@ -28,6 +29,43 @@ export interface GridlineLayerProps extends Omit<LayerProps, 'children'>, CellMo
|
|
|
28
29
|
/** Per-`<path>` props for the vertical (column) lines. */
|
|
29
30
|
propsColumns?: React.SVGProps<SVGPathElement>;
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Options for {@link buildGridlinePath}.
|
|
34
|
+
*/
|
|
35
|
+
export interface GridlinePathOptions {
|
|
36
|
+
/**
|
|
37
|
+
* Stroke width in device pixels; decides how each line center snaps.
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue 1
|
|
40
|
+
*/
|
|
41
|
+
width?: number;
|
|
42
|
+
/**
|
|
43
|
+
* CSS px added to each line's cross-axis position before it snaps (an even-width stroke that
|
|
44
|
+
* grows toward the trailing side).
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue 0
|
|
47
|
+
*/
|
|
48
|
+
shift?: number;
|
|
49
|
+
/**
|
|
50
|
+
* More gaps for one line, as view-relative `[start0, end0, start1, end1, ...]` along the line,
|
|
51
|
+
* sorted by start. `trailIndex` is the row (horizontal) or column (vertical) whose trailing edge
|
|
52
|
+
* the line is.
|
|
53
|
+
*/
|
|
54
|
+
breaksAt?: (trailIndex: number) => readonly number[] | undefined;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Build a single SVG path `d` for one orientation's gridlines — each line broken around the merged
|
|
58
|
+
* ranges that straddle it. ONE path with many `M…L…` subpaths (vs one `<path>` per segment) keeps the
|
|
59
|
+
* DOM to a single node per axis; the segment count changes every scroll tick, so per-segment elements
|
|
60
|
+
* would thrash the DOM. Device snapping is baked into each subpath's coordinates and the stroke width
|
|
61
|
+
* is uniform, so a single path renders identically to N separate paths at any dpr.
|
|
62
|
+
*
|
|
63
|
+
* @param pane The pane to draw for.
|
|
64
|
+
* @param isHorizontal `true` for the row lines, `false` for the column lines.
|
|
65
|
+
* @param ranges Index-space ranges the lines break around (merges, overflow).
|
|
66
|
+
* @param options See {@link GridlinePathOptions}.
|
|
67
|
+
*/
|
|
68
|
+
export declare const buildGridlinePath: (pane: IGridPane, isHorizontal: boolean, ranges: readonly RangeCoords[], options?: GridlinePathOptions) => string;
|
|
31
69
|
/**
|
|
32
70
|
* A **layer** (pane-aware): paints the gridlines for its pane, broken around merged cells, inside a
|
|
33
71
|
* single full-pane {@link Layer} host box. Sources the merge spans from the merges-only
|
|
@@ -10,7 +10,7 @@ import { EditSession, StartEditOptions, EditModel } from './EditSession';
|
|
|
10
10
|
* @remarks
|
|
11
11
|
* An implementation detail of {@link DefaultEditable}, not part of the layer-facing contract. Collapses
|
|
12
12
|
* the former `getClean` + `canEdit` + `commit` (`null` ⇒ "not editable"). A story closes over a values
|
|
13
|
-
* map; the real app reads an `
|
|
13
|
+
* map; the real app reads an `IWorksheet` (and returns `null` for a protected cell).
|
|
14
14
|
*
|
|
15
15
|
* @typeParam C - clean type. @typeParam D - dirty type. @typeParam A - commit args.
|
|
16
16
|
*/
|
|
@@ -25,7 +25,7 @@ export type CreateEdit<C, D = string, A = EditCommitArgs> = (coords: CellCoords)
|
|
|
25
25
|
* (`startEdit`/`commit`/`cancel`); an app-side bridge can publish {@link getSession} onto the edit-mode
|
|
26
26
|
* bus on each `subscribe` notification. It does **not** vend sessions — there is only
|
|
27
27
|
* ever one active edit, held here. {@link DefaultEditable} is the default implementation; the real app
|
|
28
|
-
* supplies its own (or reuses it with an `
|
|
28
|
+
* supplies its own (or reuses it with an `IWorksheet`-backed {@link CreateEdit}).
|
|
29
29
|
*
|
|
30
30
|
* @typeParam C - clean type. @typeParam D - dirty type. @typeParam A - commit args.
|
|
31
31
|
*/
|
|
@@ -55,8 +55,9 @@ export interface EditorDivProps<C, D = string, A = EditCommitArgs> {
|
|
|
55
55
|
*
|
|
56
56
|
* @remarks
|
|
57
57
|
* Unlike the layer, this is **always visible** — while idle it shows {@link EditorDivProps.idleClean}
|
|
58
|
-
* (the active cell). It
|
|
59
|
-
*
|
|
58
|
+
* (the active cell). It does not grab focus for an ordinary edit: the field is focused by the user's
|
|
59
|
+
* click, so the in-grid editor and the formula bar don't fight over focus when an edit begins. An edit
|
|
60
|
+
* whose session names this host as its active editor from the start is the exception: it opens here.
|
|
60
61
|
*/
|
|
61
62
|
export declare function EditorDiv<C, D = string, A = EditCommitArgs>(props: EditorDivProps<C, D, A>): React.ReactElement;
|
|
62
63
|
export declare namespace EditorDiv {
|
|
@@ -24,9 +24,10 @@ export interface EditorStartLayerProps<C, D = string, A = EditCommitArgs> {
|
|
|
24
24
|
* Keys are positionless, so the floor position alone is not enough for them: a focused widget that
|
|
25
25
|
* does not consume a printable key (it has no use for it, and must let keys through so its own
|
|
26
26
|
* commands can resolve) would otherwise still reach this tap. The key start therefore acts only when
|
|
27
|
-
* the key is aimed at the grid surface itself — the surface
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* the key is aimed at the grid surface itself — the surface (or the pane's focus target, which
|
|
28
|
+
* stands in for it) is the focused element — which is what "the grid is in
|
|
29
|
+
* ready mode" means. A double-click needs no such guard: it has a position, and a widget that owns
|
|
30
|
+
* that position consumes it.
|
|
30
31
|
*/
|
|
31
32
|
export declare function EditorStartLayer<C, D = string, A = EditCommitArgs>(props: EditorStartLayerProps<C, D, A>): React.ReactElement;
|
|
32
33
|
//# sourceMappingURL=EditorStartLayer.d.ts.map
|
package/types/src/grid/Grid.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { GridProps, IGrid } from './IGrid';
|
|
|
3
3
|
/**
|
|
4
4
|
* A virtualized grid: a thin wrapper around {@link GridSurface} that re-adds the cell + gridline
|
|
5
5
|
* rendering the surface itself is agnostic to. It composes a `CellLayer` (cells), a `GridlineLayer`
|
|
6
|
-
* (gridlines) and an optional `
|
|
6
|
+
* (gridlines) and an optional `borderLayers` slot as ordinary layers — in the conventional z-order
|
|
7
7
|
* (gridlines → borders → below-layers → cells → above-layers) — and owns the content cache token the
|
|
8
8
|
* cells bust on. Everything else is forwarded to the surface.
|
|
9
9
|
*
|
|
@@ -36,13 +36,13 @@ export interface GridProps extends GridSurfaceProps {
|
|
|
36
36
|
* Layer(s) rendered BELOW the cells/borders (but above the gridlines) — the place for fills and
|
|
37
37
|
* highlights. The `children` are the layers ABOVE the cells/borders.
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
layersBelow?: LayerNode;
|
|
40
40
|
/**
|
|
41
|
-
* Optional border layer(s), rendered just below the cells (above {@link GridProps.
|
|
42
|
-
* gridlines)
|
|
41
|
+
* Optional border layer(s), rendered just below the cells (above {@link GridProps.layersBelow} /
|
|
42
|
+
* gridlines), for a custom border treatment — distinct from the light
|
|
43
43
|
* {@link GridProps.showGridLines} gridlines.
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
borderLayers?: LayerNode;
|
|
46
46
|
/**
|
|
47
47
|
* Show grid lines. Useful for spreadsheets.
|
|
48
48
|
*/
|
|
@@ -56,6 +56,8 @@ export interface IHeaderDividerAttributes {
|
|
|
56
56
|
export interface IHeaderDividerElement extends HTMLDivElement, IHeaderDividerAttributes {
|
|
57
57
|
}
|
|
58
58
|
export interface HeaderDividerRendererProps extends HeaderDividerProps {
|
|
59
|
+
/** The pane the divider is drawn in. */
|
|
60
|
+
pane: IGridPane;
|
|
59
61
|
/**
|
|
60
62
|
* The divider's line in pane coordinates — zero-width for a column divider, zero-height for a row —
|
|
61
63
|
* snapped to the device pixel the gridline paints. The renderer positions its element (hit area and
|
|
@@ -76,7 +78,7 @@ export interface HeaderDividerRendererProps extends HeaderDividerProps {
|
|
|
76
78
|
isActive?: boolean;
|
|
77
79
|
}
|
|
78
80
|
export interface HeaderDividerAnchorProps extends HeaderDividerProps {
|
|
79
|
-
renderDivider?: (props: HeaderDividerRendererProps
|
|
81
|
+
renderDivider?: (props: HeaderDividerRendererProps) => React.ReactNode;
|
|
80
82
|
/**
|
|
81
83
|
* The clipped bounds of the pane's visible headers, from {@link getHeaderDividerBounds}. Computed when
|
|
82
84
|
* omitted; pass it when rendering a pane's worth of dividers so it is computed once.
|
|
@@ -135,6 +137,10 @@ export interface HeaderDividerAnchorProps extends HeaderDividerProps {
|
|
|
135
137
|
*/
|
|
136
138
|
onDividerUnhide?: (index: number) => void;
|
|
137
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* The class on the default divider's root element, for styling and for finding dividers in the DOM.
|
|
142
|
+
*/
|
|
143
|
+
export declare const HEADER_DIVIDER_CLASS = "header-divider";
|
|
138
144
|
export declare const DefaultHeaderDivider: import('react').NamedExoticComponent<Omit<HeaderDividerRendererProps, "ref"> & import('react').RefAttributes<IHeaderDividerElement>>;
|
|
139
145
|
/**
|
|
140
146
|
* A divider placed between headers to provider a visual cue for various actions.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { RenderSlotFn } from '@sheetxl/utils-react';
|
|
2
3
|
import { GridPlacement } from './useGridAnchor';
|
|
3
4
|
import { HoverTipProps } from './useHoverIntent';
|
|
4
5
|
/**
|
|
@@ -29,7 +30,7 @@ export interface TooltipRenderProps {
|
|
|
29
30
|
style?: React.CSSProperties;
|
|
30
31
|
}
|
|
31
32
|
/** The bubble around a tip's content — the host's chrome, arrow and theme. */
|
|
32
|
-
export type RenderTooltip =
|
|
33
|
+
export type RenderTooltip = RenderSlotFn<TooltipRenderProps>;
|
|
33
34
|
/**
|
|
34
35
|
* A tip registered with its {@link TooltipGroup}. One per `useHoverIntent`; the per-pane copies of a
|
|
35
36
|
* layer share a `key`, so they count as one tip.
|
|
@@ -97,5 +98,5 @@ export interface TooltipProviderProps {
|
|
|
97
98
|
*/
|
|
98
99
|
export declare const TooltipProvider: React.FC<TooltipProviderProps>;
|
|
99
100
|
/** The grid's default bubble — used when no provider supplies `renderTooltip`. */
|
|
100
|
-
export declare const
|
|
101
|
+
export declare const defaultRenderTooltip: RenderTooltip;
|
|
101
102
|
//# sourceMappingURL=TooltipProvider.d.ts.map
|
|
@@ -15,6 +15,12 @@ export interface ICheckboxListElement extends HTMLDivElement, CheckboxListAttrib
|
|
|
15
15
|
/**
|
|
16
16
|
* Props for {@link CheckboxList}.
|
|
17
17
|
*/
|
|
18
|
+
/** What {@link CheckboxListProps.renderCheckbox} is handed. */
|
|
19
|
+
export interface CheckboxRenderProps {
|
|
20
|
+
checked: boolean;
|
|
21
|
+
/** Set for the `(Select All)` tri-state when only some rows are checked. */
|
|
22
|
+
indeterminate?: boolean;
|
|
23
|
+
}
|
|
18
24
|
export interface CheckboxListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
19
25
|
/** Number of rows. */
|
|
20
26
|
itemCount: number;
|
|
@@ -37,7 +43,7 @@ export interface CheckboxListProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
37
43
|
* `pointerEvents:none`). `indeterminate` is set for the `(Select All)` tri-state. Override to use a
|
|
38
44
|
* styled control (MUI etc.). @defaultValue a native checkbox.
|
|
39
45
|
*/
|
|
40
|
-
renderCheckbox?: (
|
|
46
|
+
renderCheckbox?: (props: CheckboxRenderProps) => React.ReactNode;
|
|
41
47
|
/**
|
|
42
48
|
* Render a divider between the `(Select All)` header and the list, or elsewhere as needed.
|
|
43
49
|
*/
|
|
@@ -5,6 +5,11 @@ export interface PickListItem {
|
|
|
5
5
|
/** The row's text. */
|
|
6
6
|
text: string;
|
|
7
7
|
}
|
|
8
|
+
/** What {@link PickListProps.renderItem} is handed. */
|
|
9
|
+
export interface PickListItemRenderProps {
|
|
10
|
+
item: PickListItem;
|
|
11
|
+
index: number;
|
|
12
|
+
}
|
|
8
13
|
export interface PickListAttributes {
|
|
9
14
|
isPickList: () => true;
|
|
10
15
|
/** The highlighted row, or `-1` when the list is empty. */
|
|
@@ -47,7 +52,7 @@ export interface PickListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
47
52
|
*/
|
|
48
53
|
measureText?: (text: string) => number;
|
|
49
54
|
/** Render a row's content. @defaultValue the text, clipped with an ellipsis. */
|
|
50
|
-
renderItem?: (
|
|
55
|
+
renderItem?: (props: PickListItemRenderProps) => React.ReactNode;
|
|
51
56
|
/** Take focus on mount, so the Arrow keys work without a click first. @defaultValue false */
|
|
52
57
|
autoFocus?: boolean;
|
|
53
58
|
/** The scroll state, when the caller owns it (see `ListSurfaceProps.viewport`). */
|
|
@@ -29,6 +29,12 @@ export interface DragInsert {
|
|
|
29
29
|
* the drop will DO, and no pointer event carries that. Read the modifiers from here, never off the
|
|
30
30
|
* event handed to the same callback (which is the last one the *pointer* fired).
|
|
31
31
|
*/
|
|
32
|
+
/** What {@link DraggableProps.renderMove} is handed. */
|
|
33
|
+
export interface DragMoveRenderProps {
|
|
34
|
+
/** The in-flight range. */
|
|
35
|
+
range: RangeCoords;
|
|
36
|
+
info: DragMoveInfo;
|
|
37
|
+
}
|
|
32
38
|
export interface DragMoveInfo {
|
|
33
39
|
/** The live Ctrl / Shift / Alt / Meta state (Excel: Ctrl = copy, Shift = insert). */
|
|
34
40
|
mods: DragModifiers;
|
|
@@ -169,7 +175,7 @@ export interface DraggableProps {
|
|
|
169
175
|
* `info` re-renders the preview on a modifier change, so the ghost can become an insert I-beam the
|
|
170
176
|
* moment Shift goes down.
|
|
171
177
|
*/
|
|
172
|
-
renderMove?: (
|
|
178
|
+
renderMove?: (props: DragMoveRenderProps) => React.ReactNode;
|
|
173
179
|
/**
|
|
174
180
|
* The cursor painted for the duration of the drag. The grip's element is pointer-captured, so ITS
|
|
175
181
|
* cursor is the one the browser shows once a drag is in flight — pass a mode-derived cursor (`copy`
|
|
@@ -35,6 +35,8 @@ export interface GridPaneDef {
|
|
|
35
35
|
rowIndex: number;
|
|
36
36
|
elemStage: React.ReactNode;
|
|
37
37
|
refStage: IStageElement | null;
|
|
38
|
+
/** See {@link IGridPane.registerFocusTarget}. */
|
|
39
|
+
focusTarget?: (() => HTMLElement | null) | null;
|
|
38
40
|
scrollOrientation: OrientationFlags;
|
|
39
41
|
insets: Rectangle;
|
|
40
42
|
}
|
|
@@ -6,9 +6,22 @@ import { IGridMetrics } from '../metrics';
|
|
|
6
6
|
*/
|
|
7
7
|
export interface IGridPane {
|
|
8
8
|
/**
|
|
9
|
-
* Sets focus to the view.
|
|
9
|
+
* Sets focus to the view: its surface, or its {@link getFocusTarget | focus target} when there is one.
|
|
10
10
|
*/
|
|
11
11
|
focus(options?: FocusOptions): void;
|
|
12
|
+
/**
|
|
13
|
+
* Register a focus target: an element inside the pane that takes the pane's focus in place of its
|
|
14
|
+
* surface while `target` returns it. A key aimed at it is a key aimed at the surface. The latest
|
|
15
|
+
* registration wins.
|
|
16
|
+
*
|
|
17
|
+
* @param target Asked each time the pane is focused; `null` lets the surface take focus.
|
|
18
|
+
*/
|
|
19
|
+
registerFocusTarget(target: () => HTMLElement | null): RemoveListener;
|
|
20
|
+
/**
|
|
21
|
+
* The element focusing the pane lands on in place of its surface right now, or `null` for the
|
|
22
|
+
* surface itself.
|
|
23
|
+
*/
|
|
24
|
+
getFocusTarget(): HTMLElement | null;
|
|
12
25
|
/**
|
|
13
26
|
* Set pointer capture to the view.
|
|
14
27
|
*/
|
|
@@ -161,7 +174,7 @@ export interface IGridPane {
|
|
|
161
174
|
* For the freeze STRUCTURE use {@link getAllPanes} — the `Top` / `Left` / `TopLeft` entries exist only
|
|
162
175
|
* when frozen — and each frozen pane's {@link getPaneRange} is exactly its frozen cell band, so
|
|
163
176
|
* `getPaneRange().colEnd + 1` / `.rowEnd + 1` gives the frozen column / row COUNT. The configured
|
|
164
|
-
* freeze count as a model value lives on `
|
|
177
|
+
* freeze count as a model value lives on `IWorksheetView.getFreezePanes().coords`.
|
|
165
178
|
*/
|
|
166
179
|
getFreezeTopLeft(): TopLeft;
|
|
167
180
|
/**
|
|
@@ -36,7 +36,7 @@ export interface SurfaceStateProviderProps {
|
|
|
36
36
|
*
|
|
37
37
|
* 1. an explicit {@link SurfaceStateProviderProps.store} prop (override);
|
|
38
38
|
* 2. a store **inherited** from an ancestor `SurfaceStateProvider` — so a wider parent (e.g. a
|
|
39
|
-
* `
|
|
39
|
+
* `WorksheetElement` wrapping its top-left corner + both header `GridSurface`s + the main `GridSurface`)
|
|
40
40
|
* shares one scope across sibling surfaces, letting a layer keyed the same in a header and in the body
|
|
41
41
|
* read one cell;
|
|
42
42
|
* 3. otherwise a **lazily-created own** store (the standalone default).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnchorLocation } from '@sheetxl/utils';
|
|
2
|
+
import { IGridPane } from './IGridPane';
|
|
3
|
+
/**
|
|
4
|
+
* The pane to use when no particular pane is called for: the one that owns a once-per-grid job, or
|
|
5
|
+
* takes focus and scrolling with nothing else to go by. The center (scrolling) pane when there is
|
|
6
|
+
* one, else the first frozen pane.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* The center pane is not always there: a freeze larger than the view leaves it no room, and the grid
|
|
10
|
+
* builds no pane without room. `null` only while the grid has no panes at all (it has no size).
|
|
11
|
+
*/
|
|
12
|
+
export declare const getPrimaryPane: (panes: Readonly<Partial<Record<AnchorLocation, IGridPane>>>) => IGridPane | null;
|
|
13
|
+
//# sourceMappingURL=getPrimaryPane.d.ts.map
|
|
@@ -48,7 +48,7 @@ export interface GridThemeCSSOptions {
|
|
|
48
48
|
/**
|
|
49
49
|
* grid-react's theme stylesheet — the app baseline (utils-react `defaultTheme`, or a passed one) + the
|
|
50
50
|
* `grid` / `header` surface overrides, compiled to the `data-sxl-theme-*` attribute matrix. Called by the
|
|
51
|
-
* react `
|
|
51
|
+
* react `WorksheetElement` with neutral defaults into `@layer sxl-defaults` (so even a chromeless sheet is
|
|
52
52
|
* themed), and by studio-mui with MUI-derived values into `sxl-app` on top; clients override in
|
|
53
53
|
* `sxl-overrides`. Consumers just set `data-sxl-theme-*` attributes.
|
|
54
54
|
*/
|