@sheetxl/grid-react 0.8.0-beta.2 → 0.8.0-beta.20
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/LICENSE.md +8 -7
- package/README.md +21 -8
- package/browser/esm/index.mjs +3617 -3107
- package/licenses/dependencies.txt +0 -208
- package/node/esm/index.mjs +3955 -2532
- package/package.json +9 -13
- 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 +16 -6
- package/types/src/editor/EditSession.d.ts +28 -5
- package/types/src/editor/EditorDiv.d.ts +3 -2
- package/types/src/editor/EditorInput.d.ts +5 -2
- package/types/src/editor/EditorLayer.d.ts +9 -4
- package/types/src/editor/EditorStartLayer.d.ts +33 -0
- package/types/src/editor/index.d.ts +1 -0
- package/types/src/editor/useEditorKeymap.d.ts +7 -2
- package/types/src/grid/Grid.d.ts +1 -1
- package/types/src/grid/IGrid.d.ts +4 -4
- package/types/src/header/GridFreezeAnchor.d.ts +29 -0
- package/types/src/header/HeaderDividerAnchor.d.ts +36 -1
- package/types/src/header/HeaderFreezeAnchor.d.ts +37 -0
- package/types/src/header/_freezeSnap.d.ts +28 -0
- package/types/src/header/_useFreezeGrip.d.ts +28 -0
- package/types/src/header/index.d.ts +2 -0
- package/types/src/header/useHeaderSelectionPointer.d.ts +4 -4
- package/types/src/layer/GestureTip.d.ts +77 -0
- package/types/src/layer/GridFloatPanel.d.ts +3 -2
- package/types/src/layer/Layer.d.ts +6 -0
- package/types/src/layer/RangeFloatLayer.d.ts +145 -53
- package/types/src/layer/RangePrompt.d.ts +8 -8
- package/types/src/layer/RangeTooltip.d.ts +128 -0
- package/types/src/layer/RangeTooltipLayer.d.ts +53 -0
- package/types/src/layer/StickyAnchor.d.ts +15 -5
- package/types/src/layer/StickyPortal.d.ts +73 -0
- package/types/src/layer/TooltipProvider.d.ts +104 -0
- package/types/src/layer/_Utils.d.ts +9 -3
- package/types/src/layer/index.d.ts +6 -4
- package/types/src/layer/useGridAnchor.d.ts +45 -4
- package/types/src/layer/useHoverIntent.d.ts +35 -8
- package/types/src/list/CheckboxList.d.ts +18 -2
- package/types/src/list/ListSearch.d.ts +24 -3
- package/types/src/list/PickList.d.ts +6 -1
- package/types/src/range/DragHandle.d.ts +13 -6
- package/types/src/range/Draggable.d.ts +29 -3
- package/types/src/range/FillHandle.d.ts +11 -2
- package/types/src/range/RangeGlide.d.ts +160 -0
- package/types/src/range/RangeRect.d.ts +7 -0
- package/types/src/range/RangeResizer.d.ts +7 -1
- package/types/src/range/index.d.ts +2 -0
- package/types/src/range/useRangeGlide.d.ts +11 -0
- package/types/src/selection/RangesPickerLayer.d.ts +4 -1
- package/types/src/selection/SelectionLayer.d.ts +71 -15
- package/types/src/selection/SelectionStyle.d.ts +4 -1
- package/types/src/selection/SelectionTouchGrips.d.ts +6 -4
- package/types/src/selection/_SelectionUtils.d.ts +6 -0
- package/types/src/selection/useDragCells.d.ts +29 -9
- 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/surface/useSurfaceState.d.ts +29 -0
- package/types/src/svg/RectangleSVG.d.ts +21 -4
- package/types/src/theme/GridTheme.d.ts +1 -1
- package/browser/cjs/index.cjs +0 -3
- package/types/src/layer/HoverTipLayer.d.ts +0 -47
- package/types/src/layer/StickyFloat.d.ts +0 -68
- package/types/src/layer/useRangeHover.d.ts +0 -36
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { ThemeAttrs } from '@sheetxl/utils-react';
|
|
3
|
-
import { IGridPane } from '../surface';
|
|
4
|
-
import { StickyState } from './StickyAnchor';
|
|
5
|
-
import { GridAnchor, GridPlacement, GridBoundary, GridWhenOff } from './useGridAnchor';
|
|
6
|
-
/**
|
|
7
|
-
* Carry a grid float's theme **across the portal boundary**. A grid float portals into the shared,
|
|
8
|
-
* theme-free fullscreen root, where the grid's `--sxl-color-*` tokens do NOT cascade in (the CSS cascade
|
|
9
|
-
* doesn't cross a portal — unlike MUI content, which rides React context and so themes for free). Returns
|
|
10
|
-
* the `className` + `data-sxl-theme-*` attrs to put on the portaled element so the token rules resolve —
|
|
11
|
-
* the same mechanism `FloatPopper` uses for menus.
|
|
12
|
-
*
|
|
13
|
-
* Two parts, because the app themes with `@scope` (per-instance), not just global attribute rules:
|
|
14
|
-
* - **attrs** — the pane's live `mode` / `surface` (grid surface, and the grid's own mode even if it
|
|
15
|
-
* differs from the app). These select WHICH token values apply.
|
|
16
|
-
* - **className** — the theme **scope class(es)** (the float surface's, plus the nearest token provider's
|
|
17
|
-
* `scopeClass` when the instance is isolated). Without a scope class the portaled element is outside
|
|
18
|
-
* every `@scope` root, so the `@scope (.cls){ :scope[mode][surface]{…} }` rules never match it and the
|
|
19
|
-
* attrs alone resolve nothing. The class makes the portal a `:scope` root so those rules apply.
|
|
20
|
-
*/
|
|
21
|
-
export declare const useGridFloatTheme: (pane: IGridPane | null | undefined) => {
|
|
22
|
-
className?: string;
|
|
23
|
-
attrs: ThemeAttrs;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Props for {@link StickyFloat}.
|
|
27
|
-
*/
|
|
28
|
-
export interface StickyFloatProps {
|
|
29
|
-
/** WHERE to anchor — a grid coordinate (range / cell / bounds / edge / point). */
|
|
30
|
-
anchor: GridAnchor;
|
|
31
|
-
/** Which side + align the float attaches to. @defaultValue `{ side: 't', align: 'center' }` */
|
|
32
|
-
placement?: GridPlacement;
|
|
33
|
-
/** What happens when the anchor leaves the data area. @defaultValue 'hide' */
|
|
34
|
-
whenOff?: GridWhenOff;
|
|
35
|
-
/**
|
|
36
|
-
* Where the float may LIVE — one rect, resolved by {@link GridBoundary}: it is both the anchor's
|
|
37
|
-
* clip / clamp boundary and the rect `flip` / `shift` collide against. @defaultValue 'data'
|
|
38
|
-
*/
|
|
39
|
-
boundary?: GridBoundary;
|
|
40
|
-
/** Px overlap below which a geometried anchor reads as clipped. @defaultValue 0 */
|
|
41
|
-
minVisible?: number;
|
|
42
|
-
/** Gap (px) between the anchor edge and the float. @defaultValue 4 */
|
|
43
|
-
offset?: number;
|
|
44
|
-
/**
|
|
45
|
-
* Offset (px) along the anchor EDGE — only applies to `start` / `end` alignment (a centered float has
|
|
46
|
-
* no edge to slide along). Positive insets the float inward from the corner. @defaultValue 0
|
|
47
|
-
*/
|
|
48
|
-
alignOffset?: number;
|
|
49
|
-
/** Controlled visibility (e.g. a hover tooltip). @defaultValue true */
|
|
50
|
-
open?: boolean;
|
|
51
|
-
/** Portal container. @defaultValue the fullscreen-aware root ({@link useFullscreenPortal}). */
|
|
52
|
-
container?: Element;
|
|
53
|
-
className?: string;
|
|
54
|
-
style?: React.CSSProperties;
|
|
55
|
-
/** @defaultValue 1250 (a below-modal band; see FLOATING-DESIGN §z-index). */
|
|
56
|
-
zIndex?: number;
|
|
57
|
-
/** The float content — a node, or a render function `(state) => node` (e.g. to react to `slid`). */
|
|
58
|
-
children?: React.ReactNode | ((state: StickyState) => React.ReactNode);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* The ergonomic **floating label**: a {@link StickyAnchor} that renders its child in a **portal**
|
|
62
|
-
* (escaping the pane clip, so it can flow past the pane bounds — e.g. overhang a freeze line) anchored
|
|
63
|
-
* at the resolved point. The common case — `<StickyFloat anchor={{ range }}>A1:B4</StickyFloat>` —
|
|
64
|
-
* with no hand-written `createPortal`. For an in-grid (clipping) label, use `<StickyAnchor>` with a plain
|
|
65
|
-
* `<div>` child instead.
|
|
66
|
-
*/
|
|
67
|
-
export declare const StickyFloat: React.FC<StickyFloatProps>;
|
|
68
|
-
//# sourceMappingURL=StickyFloat.d.ts.map
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { RangeCoords } from '@sheetxl/utils';
|
|
2
|
-
import { UseHoverIntentOptions, HoverTipProps } from './useHoverIntent';
|
|
3
|
-
/**
|
|
4
|
-
* The result of {@link useRangeHover}.
|
|
5
|
-
*/
|
|
6
|
-
export interface UseRangeHoverResult {
|
|
7
|
-
/** Whether a hover tooltip for the range should be shown (after the intent delays). */
|
|
8
|
-
open: boolean;
|
|
9
|
-
/** Spread onto the floated tip so hovering it keeps the tooltip open (see {@link HoverTipProps}). */
|
|
10
|
-
tipProps: HoverTipProps;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Tracks the pointer over a **fixed grid range** and drives hover-tooltip intent: returns `open` (with
|
|
14
|
-
* open / close delays) plus `tipProps` to keep the tip open while the pointer is on it. Pair with
|
|
15
|
-
* {@link StickyFloat} for the label:
|
|
16
|
-
*
|
|
17
|
-
* ```tsx
|
|
18
|
-
* const { open, tipProps } = useRangeHover(range);
|
|
19
|
-
* <StickyFloat anchor={{ range }} placement={{ side: 't' }} offset={6} open={open}>
|
|
20
|
-
* <div {...tipProps}>Value must be a positive number</div>
|
|
21
|
-
* </StickyFloat>
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* Must be called inside a grid (needs pane context). For a **dynamic** target (an error layer that
|
|
25
|
-
* discovers whichever hovered cell has errors), drive {@link useHoverIntent} directly instead.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* Registers a passive `pointermove` / `pointerleave` responder on the pane's Stage (mirrors
|
|
29
|
-
* a {@link Layer} tap); it never consumes the event. Because a grid child renders per pane, the pointer
|
|
30
|
-
* is seen by whichever pane it is over while the tip renders on the pane owning the anchor — which for
|
|
31
|
-
* a range straddling a freeze is a DIFFERENT pane. The aimed target is therefore brokered through
|
|
32
|
-
* {@link useSurfaceState}, so every pane copy runs its intent off the same signal and the owner is
|
|
33
|
-
* armed no matter where the pointer is.
|
|
34
|
-
*/
|
|
35
|
-
export declare const useRangeHover: (range: RangeCoords, options?: UseHoverIntentOptions) => UseRangeHoverResult;
|
|
36
|
-
//# sourceMappingURL=useRangeHover.d.ts.map
|