@sheetxl/grid-react 0.8.0-beta.12 → 0.8.0-beta.14
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/index.mjs +1284 -1271
- package/node/esm/index.mjs +1238 -1225
- package/package.json +3 -3
- package/types/src/layer/RangeFloatLayer.d.ts +6 -1
- package/types/src/layer/RangeTooltip.d.ts +5 -0
- package/types/src/layer/RangeTooltipLayer.d.ts +1 -1
- package/types/src/layer/TooltipProvider.d.ts +7 -5
- package/types/src/layer/_Utils.d.ts +2 -0
- package/types/src/layer/useHoverIntent.d.ts +3 -3
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.14",
|
|
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.14",
|
|
44
|
+
"@sheetxl/utils-react": "^0.8.0-beta.14",
|
|
45
45
|
"clsx": "^2.1.1",
|
|
46
46
|
"react-merge-refs": "^3.0.2"
|
|
47
47
|
},
|
|
@@ -108,7 +108,7 @@ export interface RangeFloatOptions<T = unknown> {
|
|
|
108
108
|
/** Grace (ms) before a hovered float hides (bridges the gap to the float). @defaultValue the group's `leaveDelay` (400) */
|
|
109
109
|
closeDelay?: number;
|
|
110
110
|
/**
|
|
111
|
-
* A hovered float joins the grid's tooltip group (one tip at a time, closed by
|
|
111
|
+
* A hovered float joins the grid's tooltip group (one tip at a time, closed by a press outside it or Escape).
|
|
112
112
|
* `false` for a hover-opened float that is not a tooltip — a toolbar — which must survive a tip
|
|
113
113
|
* opening beside it and a press on its own buttons.
|
|
114
114
|
* @defaultValue true
|
|
@@ -202,6 +202,11 @@ export interface RangeFloatLayerProps<T = unknown> extends Omit<LayerProps, 'chi
|
|
|
202
202
|
* selection — the layer only ever reads the active cell and subscribes to it.
|
|
203
203
|
*/
|
|
204
204
|
selection?: ICellAnchor;
|
|
205
|
+
/**
|
|
206
|
+
* What the pointer is over that the cells cannot tell the tap: something drawn above them, which
|
|
207
|
+
* takes the pointer first. Wins over the probed cell while it is set.
|
|
208
|
+
*/
|
|
209
|
+
hoveredOver?: RangeFloatTarget<T> | null;
|
|
205
210
|
}
|
|
206
211
|
/**
|
|
207
212
|
* The **range float layer**: a {@link VirtualRangeFloat} as a layer of its own, whose tap probes the
|
|
@@ -113,6 +113,11 @@ export declare const RangeTooltipProvider: React.FC<RangeTooltipProviderProps>;
|
|
|
113
113
|
export declare const RangeTooltip: (props: RangeTooltipProps) => null;
|
|
114
114
|
export interface RangeTooltipHostProps extends Omit<LayerProps, 'children'> {
|
|
115
115
|
className?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Close the open tip and open no other while this holds, for whatever reason the host's owner has
|
|
118
|
+
* (the cell under the pointer is being edited, say).
|
|
119
|
+
*/
|
|
120
|
+
dismiss?: boolean;
|
|
116
121
|
}
|
|
117
122
|
/**
|
|
118
123
|
* The layer that draws the {@link RangeTooltip}s of the nearest {@link RangeTooltipProvider}: one tap,
|
|
@@ -42,7 +42,7 @@ export interface RangeTooltipLayerProps<T = unknown> extends Omit<RangeFloatLaye
|
|
|
42
42
|
* The **tooltip kind** of range float: transient, opened by hovering a cell the probe recognizes, one
|
|
43
43
|
* at a time grid-wide. A preset of {@link RangeFloatLayer} (`activateOn: 'hover'`) whose hover intent is
|
|
44
44
|
* the tooltip group's client — so it inherits the group's timing, single-open rule, armed re-open, and
|
|
45
|
-
* closes on
|
|
45
|
+
* closes on a press outside it or Escape — drawn in the group's bubble, under any menu.
|
|
46
46
|
*
|
|
47
47
|
* @remarks
|
|
48
48
|
* Reach for `RangeFloatLayer` directly when the float is activated by the selection, driven by a
|
|
@@ -40,19 +40,21 @@ export interface TooltipClient {
|
|
|
40
40
|
readonly key: string;
|
|
41
41
|
/**
|
|
42
42
|
* A gesture tip holds the group: hover tips may not open while it is up. It is not closed by a press
|
|
43
|
-
* or
|
|
43
|
+
* or Escape, and its close does not arm the group.
|
|
44
44
|
*/
|
|
45
45
|
readonly gesture: boolean;
|
|
46
46
|
/** The tip's element once mounted — a pointerdown inside it does not close it. */
|
|
47
47
|
getElement(): Element | null;
|
|
48
|
-
/** Close now, no grace (the group took the slot, or the user pressed
|
|
48
|
+
/** Close now, no grace (the group took the slot, or the user pressed elsewhere or hit Escape). */
|
|
49
49
|
forceClose(): void;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* The single-open coordinator: at most one tip (by key) is up at a time, the next open is fast for
|
|
53
|
-
* {@link TooltipTiming.armedFor} after a close, a gesture tip preempts hover, and
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* {@link TooltipTiming.armedFor} after a close, a gesture tip preempts hover, and a pointerdown outside
|
|
54
|
+
* an open hover tip or Escape closes it (a gesture tip closes with its gesture). No other key and no
|
|
55
|
+
* selection change closes a tip; a layer's owner closes one for its own reasons through `dismiss`. Owned
|
|
56
|
+
* by the top {@link TooltipProvider} (or one that `isolate`s); a built-in default serves a tree with no
|
|
57
|
+
* provider.
|
|
56
58
|
*/
|
|
57
59
|
export interface TooltipGroup {
|
|
58
60
|
/** `client` is opening: every client open on another key closes first, with no grace. */
|
|
@@ -2,6 +2,8 @@ import { RangeCoords } from '@sheetxl/utils';
|
|
|
2
2
|
import { LayerNode } from './LayerTypes';
|
|
3
3
|
/** Content key for a range — stable across object identity (dedupe / memo / hover-target keys). */
|
|
4
4
|
export declare const rangeKey: (r: RangeCoords) => string;
|
|
5
|
+
/** Where a cell's hover tip stacks: over the grid's other floats, and under any menu. */
|
|
6
|
+
export declare const GRID_TIP_Z_INDEX: string;
|
|
5
7
|
/**
|
|
6
8
|
* A layer's **derived stacking order** — its index in the normalized layer list, i.e. the react list
|
|
7
9
|
* order with explicit-`zIndex` overrides already folded in (see {@link normalizeLayers}). This is the
|
|
@@ -13,8 +13,8 @@ export interface UseHoverIntentOptions {
|
|
|
13
13
|
*/
|
|
14
14
|
closeDelay?: number;
|
|
15
15
|
/**
|
|
16
|
-
* Join the grid's tooltip group: one tip open at a time, a fast re-open while armed, closed by
|
|
17
|
-
* pointerdown or
|
|
16
|
+
* Join the grid's tooltip group: one tip open at a time, a fast re-open while armed, closed by a
|
|
17
|
+
* pointerdown outside it or Escape, refused while a gesture tip or a popup is up. `false` for a hover-opened float that is not
|
|
18
18
|
* a tooltip — a table toolbar, a note's box — which must survive a tip opening beside it.
|
|
19
19
|
* @defaultValue true
|
|
20
20
|
*/
|
|
@@ -65,7 +65,7 @@ export interface UseHoverIntentResult {
|
|
|
65
65
|
/**
|
|
66
66
|
* The **hover-intent state machine** behind a tip — the per-tip client of the grid's tooltip group
|
|
67
67
|
* ({@link TooltipProvider}): dwell / grace timing, keep-open-on-tip-hover, and the group's rules
|
|
68
|
-
* (single open, armed re-open, gesture
|
|
68
|
+
* (single open, armed re-open, gesture and popup preempt hover, closed by a press outside it or Escape). It does NO
|
|
69
69
|
* hit-testing: feed it a target key via {@link UseHoverIntentResult.setTarget} (`null` = nothing) and
|
|
70
70
|
* spread {@link UseHoverIntentResult.tipProps} on the float.
|
|
71
71
|
*
|