@sheetxl/grid-react 0.8.0-beta.1 → 0.8.0-beta.10

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.
Files changed (57) hide show
  1. package/README.md +16 -5
  2. package/browser/esm/index.mjs +3419 -2810
  3. package/licenses/dependencies.txt +0 -208
  4. package/node/esm/index.mjs +3699 -2172
  5. package/package.json +8 -12
  6. package/types/src/cell/CellRenderer.d.ts +14 -3
  7. package/types/src/editor/DefaultEditable.d.ts +23 -4
  8. package/types/src/editor/EditSession.d.ts +34 -5
  9. package/types/src/editor/EditState.d.ts +6 -0
  10. package/types/src/editor/EditorInput.d.ts +7 -3
  11. package/types/src/editor/EditorLayer.d.ts +9 -4
  12. package/types/src/editor/EditorStartLayer.d.ts +32 -0
  13. package/types/src/editor/index.d.ts +1 -0
  14. package/types/src/editor/useEditorKeymap.d.ts +18 -2
  15. package/types/src/header/GridFreezeAnchor.d.ts +29 -0
  16. package/types/src/header/HeaderDividerAnchor.d.ts +29 -0
  17. package/types/src/header/HeaderFreezeAnchor.d.ts +37 -0
  18. package/types/src/header/_freezeSnap.d.ts +28 -0
  19. package/types/src/header/_useFreezeGrip.d.ts +28 -0
  20. package/types/src/header/index.d.ts +2 -0
  21. package/types/src/header/useHeaderSelectionPointer.d.ts +10 -6
  22. package/types/src/layer/GestureTip.d.ts +69 -0
  23. package/types/src/layer/GridFloatPanel.d.ts +19 -0
  24. package/types/src/layer/Layer.d.ts +6 -0
  25. package/types/src/layer/RangeFloatLayer.d.ts +143 -51
  26. package/types/src/layer/RangePrompt.d.ts +8 -8
  27. package/types/src/layer/RangeTooltip.d.ts +123 -0
  28. package/types/src/layer/RangeTooltipLayer.d.ts +53 -0
  29. package/types/src/layer/StickyAnchor.d.ts +15 -5
  30. package/types/src/layer/StickyPortal.d.ts +73 -0
  31. package/types/src/layer/TooltipProvider.d.ts +101 -0
  32. package/types/src/layer/index.d.ts +7 -4
  33. package/types/src/layer/useGridAnchor.d.ts +45 -4
  34. package/types/src/layer/useHoverIntent.d.ts +35 -8
  35. package/types/src/list/CheckboxList.d.ts +22 -1
  36. package/types/src/list/List.d.ts +11 -2
  37. package/types/src/list/ListSearch.d.ts +52 -0
  38. package/types/src/list/ListSurface.d.ts +25 -5
  39. package/types/src/list/PickList.d.ts +71 -0
  40. package/types/src/list/_measureText.d.ts +14 -0
  41. package/types/src/list/index.d.ts +2 -0
  42. package/types/src/range/DragHandle.d.ts +19 -2
  43. package/types/src/range/Draggable.d.ts +132 -7
  44. package/types/src/range/FillHandle.d.ts +33 -3
  45. package/types/src/range/RangeInsertBar.d.ts +91 -0
  46. package/types/src/range/index.d.ts +2 -0
  47. package/types/src/selection/SelectionLayer.d.ts +128 -15
  48. package/types/src/selection/SelectionStyle.d.ts +33 -0
  49. package/types/src/selection/SelectionTouchGrips.d.ts +0 -4
  50. package/types/src/selection/_SelectionUtils.d.ts +6 -0
  51. package/types/src/selection/useDragCells.d.ts +65 -9
  52. package/types/src/surface/useSurfaceState.d.ts +19 -0
  53. package/types/src/svg/_Glide.d.ts +9 -0
  54. package/browser/cjs/index.cjs +0 -3
  55. package/types/src/layer/HoverTipLayer.d.ts +0 -47
  56. package/types/src/layer/StickyFloat.d.ts +0 -68
  57. 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