@sheetxl/react 0.7.28-beta.4 → 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 (245) hide show
  1. package/browser/esm/BHjeSMaycUkS5dVL.mjs +66 -0
  2. package/browser/esm/BZcQ-KYwS62Ut45c.mjs +20 -0
  3. package/browser/esm/Bow9CzRJrYxak2i5.mjs +318 -0
  4. package/browser/esm/BuvXl14hs-1CvjeA.mjs +2706 -0
  5. package/browser/esm/BwRduT8FTrk5n72r.mjs +32 -0
  6. package/browser/esm/C6urN77szrYwODXF.mjs +134 -0
  7. package/browser/esm/CYMRbtPIr6SklGpp.mjs +775 -0
  8. package/browser/esm/CYoUd5KIl7W3AsxH.mjs +196 -0
  9. package/browser/esm/Cfe0kofqVKGxLqO6.mjs +31 -0
  10. package/browser/esm/CiRN-woJZWYOgTn4.mjs +36 -0
  11. package/browser/esm/Dd-ZybXAgoq9pgGv.mjs +45 -0
  12. package/browser/esm/DjiBz4H74I6nPUY6.mjs +79 -0
  13. package/browser/esm/DyU9UInRnfkPYYlR.mjs +63 -0
  14. package/browser/esm/J8cPagZBeXz86Lnd.mjs +777 -0
  15. package/browser/esm/Sp6PJavGKpF8SJzA.mjs +75 -0
  16. package/browser/esm/cYjYjqEsyd63x8t4.mjs +67 -0
  17. package/browser/esm/chart.mjs +60 -0
  18. package/browser/esm/control.mjs +216 -0
  19. package/browser/esm/group.mjs +123 -0
  20. package/browser/esm/index.mjs +14122 -8944
  21. package/browser/esm/note.mjs +86 -0
  22. package/browser/esm/picture.mjs +86 -0
  23. package/{node/esm/Ban9guHVB-Vxa-tq.mjs → browser/esm/shape.mjs} +2 -4
  24. package/browser/esm/slicer.mjs +276 -0
  25. package/licenses/dependencies.txt +6 -599
  26. package/node/esm/BJ7ZZm63j5O6cvrB.mjs +134 -0
  27. package/node/esm/BfRn5S5V4X8xIAEa.mjs +20 -0
  28. package/node/esm/BpwE3HqTnrLLzE3C.mjs +775 -0
  29. package/node/esm/Buw-VKYJy3y5dbaJ.mjs +197 -0
  30. package/node/esm/CFFlJxNwgyInjEnh.mjs +45 -0
  31. package/node/esm/CM5BT7h-hMtST2bE.mjs +2706 -0
  32. package/node/esm/CV3bT3Hql74GcHoU.mjs +37 -0
  33. package/node/esm/C_ANM4feA1xV-pri.mjs +32 -0
  34. package/node/esm/D3YXHeOyFp00Xk3m.mjs +323 -0
  35. package/node/esm/DPN0n6MGYQ9vZ2KO.mjs +80 -0
  36. package/node/esm/DYosMUJKp-3MSO4q.mjs +76 -0
  37. package/node/esm/DhSq680c5tgMFFbj.mjs +68 -0
  38. package/node/esm/Dxbm6ryIDCEi26RO.mjs +66 -0
  39. package/node/esm/GkmuxU7OwRZtm2Rf.mjs +63 -0
  40. package/node/esm/chart.mjs +60 -0
  41. package/node/esm/control.mjs +216 -0
  42. package/node/esm/group.mjs +123 -0
  43. package/node/esm/index.mjs +16649 -11320
  44. package/node/esm/note.mjs +87 -0
  45. package/node/esm/picture.mjs +86 -0
  46. package/node/esm/shape.mjs +783 -0
  47. package/node/esm/slicer.mjs +278 -0
  48. package/package.json +53 -14
  49. package/resources/contents.json +18 -0
  50. package/resources/locales/contents.json +42 -0
  51. package/resources/locales/de/movable.cmd.json +154 -0
  52. package/resources/locales/de/picture.cmd.json +31 -0
  53. package/resources/locales/de/selection.cmd.json +8 -0
  54. package/resources/locales/de/shape.cmd.json +17 -0
  55. package/resources/locales/de/sheet.cmd.json +328 -21
  56. package/resources/locales/de/slicer.cmd.json +17 -0
  57. package/resources/locales/de/table.cmd.json +9 -1
  58. package/resources/locales/de/ui.msg.json +309 -3
  59. package/resources/locales/de/workbook.cmd.json +10 -6
  60. package/resources/locales/en/movable.cmd.json +154 -0
  61. package/resources/locales/en/picture.cmd.json +31 -0
  62. package/resources/locales/en/selection.cmd.json +8 -0
  63. package/resources/locales/en/shape.cmd.json +17 -0
  64. package/resources/locales/en/sheet.cmd.json +342 -22
  65. package/resources/locales/en/slicer.cmd.json +17 -0
  66. package/resources/locales/en/table.cmd.json +9 -1
  67. package/resources/locales/en/ui.msg.json +309 -3
  68. package/resources/locales/en/workbook.cmd.json +11 -7
  69. package/types/chart.d.ts +2 -0
  70. package/types/control.d.ts +2 -0
  71. package/types/group.d.ts +2 -0
  72. package/types/note.d.ts +2 -0
  73. package/types/picture.d.ts +2 -0
  74. package/types/shape.d.ts +2 -0
  75. package/types/slicer.d.ts +2 -0
  76. package/types/src/annotation/RangeAnnotations.d.ts +119 -0
  77. package/types/src/annotation/index.d.ts +2 -0
  78. package/types/src/autoFill/AutoFillPresets.d.ts +14 -0
  79. package/types/src/autoFill/FillMenu.d.ts +36 -0
  80. package/types/src/autoFill/FillSeries.d.ts +38 -0
  81. package/types/src/autoFill/index.d.ts +4 -0
  82. package/types/src/border/StaticBorderRenderer.d.ts +2 -2
  83. package/types/src/border/useBorders.d.ts +7 -7
  84. package/types/src/cell/CornerTriangle.d.ts +6 -0
  85. package/types/src/cell/FormulaCellRenderer.d.ts +1 -1
  86. package/types/src/cell/OutlineButton.d.ts +123 -0
  87. package/types/src/cell/SheetCellRenderer.d.ts +17 -2
  88. package/types/src/cell/SheetHeaderRenderer.d.ts +5 -0
  89. package/types/src/cell/StaticCellRenderer.d.ts +57 -0
  90. package/types/src/cell/index.d.ts +2 -0
  91. package/types/src/cell/useFormulaViewAnchor.d.ts +1 -1
  92. package/types/src/chart/index.d.ts +0 -1
  93. package/types/src/checklist/ValueChecklist.d.ts +112 -0
  94. package/types/src/checklist/index.d.ts +2 -0
  95. package/types/src/commands/ContextualToolbar.d.ts +19 -0
  96. package/types/src/commands/createTransactionalMiddleware.d.ts +4 -1
  97. package/types/src/commands/index.d.ts +1 -0
  98. package/types/src/comment/CommentCardRequest.d.ts +94 -0
  99. package/types/src/comment/CommentUtils.d.ts +43 -0
  100. package/types/src/comment/NoteEditor.d.ts +20 -0
  101. package/types/src/comment/index.d.ts +5 -0
  102. package/types/src/comment/useCommentThread.d.ts +37 -0
  103. package/types/src/comment/useSheetComments.d.ts +28 -0
  104. package/types/src/{sheet → conditionalFormat}/ConditionalFormatPresets.d.ts +6 -6
  105. package/types/src/conditionalFormat/index.d.ts +1 -0
  106. package/types/src/control/FormControlRenderers.d.ts +22 -0
  107. package/types/src/editor/FunctionPreviewPanel.d.ts +15 -1
  108. package/types/src/editor/NamedItemLabel.d.ts +29 -0
  109. package/types/src/editor/NamedItemsPanel.d.ts +13 -2
  110. package/types/src/editor/SheetCellEditorLayer.d.ts +3 -7
  111. package/types/src/editor/SheetCellEditorStartLayer.d.ts +44 -0
  112. package/types/src/editor/SheetCellInput.d.ts +26 -2
  113. package/types/src/editor/SheetEditable.d.ts +8 -2
  114. package/types/src/editor/formulaCaret.d.ts +39 -10
  115. package/types/src/editor/formulaEval.d.ts +9 -5
  116. package/types/src/editor/formulaLint.d.ts +36 -0
  117. package/types/src/editor/formulaPresentation.d.ts +7 -0
  118. package/types/src/editor/formulaText.d.ts +17 -5
  119. package/types/src/editor/functionArgs.d.ts +20 -0
  120. package/types/src/editor/index.d.ts +4 -1
  121. package/types/src/editor/pickedReference.d.ts +76 -0
  122. package/types/src/editor/useEditRejectedNotice.d.ts +32 -0
  123. package/types/src/editor/useFormulaHints.d.ts +93 -3
  124. package/types/src/editor/useFormulaInput.d.ts +30 -4
  125. package/types/src/editor/useReferenceMode.d.ts +12 -0
  126. package/types/src/editor/validationAlert.d.ts +24 -0
  127. package/types/src/externalLink/ExternalLinksPaneArgs.d.ts +23 -0
  128. package/types/src/externalLink/index.d.ts +2 -0
  129. package/types/src/form/FormulaInput.d.ts +18 -2
  130. package/types/src/form/FormulaInputParts.d.ts +10 -1
  131. package/types/src/form/useEditCommit.d.ts +23 -3
  132. package/types/src/form/useInputField.d.ts +2 -3
  133. package/types/src/frame/CommandContext.d.ts +188 -6
  134. package/types/src/group/GroupEditor.d.ts +25 -0
  135. package/types/src/index.d.ts +12 -1
  136. package/types/src/io/WorkbookIO.d.ts +2 -0
  137. package/types/src/layer/CellErrorLayer.d.ts +24 -7
  138. package/types/src/layer/CommentCardLayer.d.ts +43 -0
  139. package/types/src/layer/CommentsLayer.d.ts +35 -0
  140. package/types/src/layer/ConditionalIcons.d.ts +4 -4
  141. package/types/src/layer/FreezeDragLines.d.ts +17 -0
  142. package/types/src/layer/GridFreezeLayer.d.ts +11 -0
  143. package/types/src/layer/HeaderFreezeLayer.d.ts +12 -0
  144. package/types/src/layer/HeaderResizerLayer.d.ts +2 -1
  145. package/types/src/layer/HyperlinkLayer.d.ts +109 -0
  146. package/types/src/layer/MovableKindScope.d.ts +17 -0
  147. package/types/src/layer/ProtectionLayer.d.ts +52 -0
  148. package/types/src/layer/RangeAnnotationLayer.d.ts +71 -0
  149. package/types/src/layer/ResizeIndicator.d.ts +9 -8
  150. package/types/src/layer/ResizeTooltip.d.ts +13 -0
  151. package/types/src/layer/SheetHeaderCellLayer.d.ts +10 -1
  152. package/types/src/layer/SheetOutlineLayer.d.ts +40 -0
  153. package/types/src/layer/TableLayer.d.ts +5 -4
  154. package/types/src/layer/TableToolbar.d.ts +42 -0
  155. package/types/src/layer/ValidationDropdownLayer.d.ts +61 -0
  156. package/types/src/layer/ValidationIndicatorLayer.d.ts +14 -21
  157. package/types/src/layer/ValidationPromptLayer.d.ts +64 -0
  158. package/types/src/layer/_tableColor.d.ts +4 -0
  159. package/types/src/layer/cellTip.d.ts +13 -0
  160. package/types/src/layer/freezeDragState.d.ts +21 -0
  161. package/types/src/layer/index.d.ts +14 -0
  162. package/types/src/layer/resizeIndicatorState.d.ts +3 -1
  163. package/types/src/layer/useFreezeDrag.d.ts +22 -0
  164. package/types/src/layer/useValidationPicker.d.ts +54 -0
  165. package/types/src/layer/validationMark.d.ts +63 -0
  166. package/types/src/listener/useModelListener.d.ts +4 -4
  167. package/types/src/movable/ConnectionSites.d.ts +18 -0
  168. package/types/src/movable/IMovableArea.d.ts +56 -0
  169. package/types/src/movable/MovableAdornment.d.ts +26 -0
  170. package/types/src/movable/MovableCommandGroups.d.ts +40 -0
  171. package/types/src/movable/MovableCommands.d.ts +6 -1
  172. package/types/src/movable/MovableControl.d.ts +78 -0
  173. package/types/src/movable/MovableEdit.d.ts +22 -0
  174. package/types/src/movable/MovableFrame.d.ts +16 -13
  175. package/types/src/movable/MovableLayer.d.ts +25 -7
  176. package/types/src/movable/MovableRenderers.d.ts +210 -0
  177. package/types/src/movable/PlaceholderFrames.d.ts +11 -0
  178. package/types/src/movable/RotateHandle.d.ts +37 -0
  179. package/types/src/movable/TextBox.d.ts +34 -0
  180. package/types/src/movable/connect.d.ts +16 -0
  181. package/types/src/movable/framePlacement.d.ts +72 -0
  182. package/types/src/movable/geometry.d.ts +61 -0
  183. package/types/src/movable/index.d.ts +10 -0
  184. package/types/src/movable/pressTarget.d.ts +20 -0
  185. package/types/src/picker/PickerPanel.d.ts +52 -0
  186. package/types/src/picker/cellPickerOpen.d.ts +6 -0
  187. package/types/src/picker/index.d.ts +4 -0
  188. package/types/src/picker/useCellPicker.d.ts +95 -0
  189. package/types/src/picture/PictureCommands.d.ts +12 -0
  190. package/types/src/picture/PictureKind.d.ts +7 -0
  191. package/types/src/picture/index.d.ts +0 -1
  192. package/types/src/protection/ProtectionPaneArgs.d.ts +31 -0
  193. package/types/src/protection/index.d.ts +3 -0
  194. package/types/src/protection/unlockProtectedRanges.d.ts +23 -0
  195. package/types/src/richText/RichTextEditor.d.ts +41 -0
  196. package/types/src/richText/index.d.ts +2 -0
  197. package/types/src/selection/SheetSelectionLayer.d.ts +14 -10
  198. package/types/src/shape/ConnectorControl.d.ts +46 -0
  199. package/types/src/shape/ShapeCommands.d.ts +11 -0
  200. package/types/src/shape/ShapeControl.d.ts +8 -0
  201. package/types/src/shape/ShapeEditor.d.ts +15 -2
  202. package/types/src/shape/ShapeGallery.d.ts +31 -0
  203. package/types/src/shape/ShapeHandles.d.ts +28 -0
  204. package/types/src/shape/ShapeKind.d.ts +7 -0
  205. package/types/src/shape/ShapeSVG.d.ts +22 -0
  206. package/types/src/shape/ShapeText.d.ts +17 -0
  207. package/types/src/shape/icons/ShapeIcons.d.ts +16 -0
  208. package/types/src/shape/icons/_ShapeIconPack.d.ts +4 -0
  209. package/types/src/shape/index.d.ts +3 -1
  210. package/types/src/shape/shapeFrame.d.ts +50 -0
  211. package/types/src/shape/shapeStyle.d.ts +82 -0
  212. package/types/src/sheet/ISheetElement.d.ts +62 -65
  213. package/types/src/sheet/SheetCommandProvider.d.ts +9 -4
  214. package/types/src/sheet/SheetCommands.d.ts +21 -6
  215. package/types/src/sheet/SheetOutlineElement.d.ts +70 -0
  216. package/types/src/sheet/SheetScrollbar.d.ts +1 -10
  217. package/types/src/sheet/_freezeAt.d.ts +10 -0
  218. package/types/src/sheet/_useHeaderMetrics.d.ts +11 -0
  219. package/types/src/sheet/circularReferences.d.ts +9 -1
  220. package/types/src/sheet/index.d.ts +1 -1
  221. package/types/src/sheet/useCycleHighlight.d.ts +21 -0
  222. package/types/src/slicer/SlicerCommands.d.ts +10 -0
  223. package/types/src/slicer/SlicerEditor.d.ts +8 -2
  224. package/types/src/slicer/SlicerKind.d.ts +7 -0
  225. package/types/src/slicer/SlicerStylePreview.d.ts +18 -0
  226. package/types/src/slicer/index.d.ts +2 -1
  227. package/types/src/slicer/slicerStyles.d.ts +32 -0
  228. package/types/src/tabStrip/TabStrip.d.ts +7 -0
  229. package/types/src/taskPane/ITaskPane.d.ts +12 -1
  230. package/types/src/taskPane/MovablePane.d.ts +17 -0
  231. package/types/src/taskPane/index.d.ts +1 -0
  232. package/types/src/theme/ThemeState.d.ts +14 -1
  233. package/types/src/theme/useGridColorScheme.d.ts +1 -1
  234. package/types/src/workbook/DefaultMovableRenderers.d.ts +20 -0
  235. package/types/src/workbook/IWorkbookElement.d.ts +24 -0
  236. package/types/src/workbook/WorkbookCommands.d.ts +2 -4
  237. package/types/src/workbook/WorkbookStrip.d.ts +9 -0
  238. package/types/src/workbook/_followOrigin.d.ts +9 -0
  239. package/types/src/workbook/useWorkbookFormat.d.ts +3 -3
  240. package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
  241. package/browser/cjs/Pl04-kDEQSO8_qFU.cjs +0 -156
  242. package/browser/cjs/index.cjs +0 -35
  243. package/browser/esm/BdJpSdwyWuh-Te5p.mjs +0 -6286
  244. package/types/src/editor/useProtectedEditNotice.d.ts +0 -14
  245. package/types/src/movable/MoveableBundle.d.ts +0 -4
@@ -0,0 +1,109 @@
1
+ import { default as React } from 'react';
2
+ import { CellCoords } from '@sheetxl/utils';
3
+ import { IHyperlink, ISheet } from '@sheetxl/sdk';
4
+ import { StickyState, GridPlacement, HoverTipProps, LayerProps } from '@sheetxl/grid-react';
5
+ /** What a link preview service found for a page. Every field is optional; an empty one shows nothing. */
6
+ export interface LinkPreview {
7
+ /** The page's picture: its social card (`og:image`) or a screenshot. */
8
+ image?: string;
9
+ /**
10
+ * The width the picture was asked for. A screenshot service answers with a placeholder while it
11
+ * renders; a loaded picture of another width IS that placeholder, and the card asks again.
12
+ */
13
+ imageWidth?: number;
14
+ title?: string;
15
+ description?: string;
16
+ }
17
+ /**
18
+ * Finds a {@link LinkPreview} for an address, or `null` for none. Synchronous when the preview is only
19
+ * a URL (a screenshot service), a promise when it has to be looked up (a social card).
20
+ */
21
+ export type LinkPreviewLookup = (address: string) => LinkPreview | Promise<LinkPreview | null> | null;
22
+ /** What a hyperlink card is handed. The actions are bound to the hovered cell. */
23
+ export interface HyperlinkCardRenderProps {
24
+ sheet: ISheet;
25
+ /** The hovered cell (the card anchors to its range, a merge included). */
26
+ coords: CellCoords;
27
+ hyperlink: IHyperlink;
28
+ /** Follow the link. */
29
+ open: () => Promise<void>;
30
+ /** Copy the address to the clipboard. */
31
+ copy: () => Promise<void>;
32
+ /** Select the cell and open the hyperlink editor. */
33
+ edit: () => void;
34
+ /** Remove the link; the cell's text stays. */
35
+ remove: () => void;
36
+ /**
37
+ * The linked page's preview once the lookup resolved, or `null` — see
38
+ * {@link HyperlinkLayerProps.preview}. Draw its picture with {@link LinkPreviewImage}, which shows it
39
+ * only once it exists.
40
+ */
41
+ preview: LinkPreview | null;
42
+ /** Spread onto the card root (keeps the card open while hovered; registers it with the tooltip group). */
43
+ tipProps: HoverTipProps;
44
+ state: StickyState;
45
+ }
46
+ /**
47
+ * Props for {@link HyperlinkLayer}.
48
+ */
49
+ export interface HyperlinkLayerProps extends Omit<LayerProps, 'children'> {
50
+ sheet: ISheet;
51
+ /** The card. @defaultValue the plain card: address · copy · edit · remove */
52
+ renderCard?: (props: HyperlinkCardRenderProps) => React.ReactNode;
53
+ /**
54
+ * Looks up a preview of the linked page to show under the actions. Off by default: it is a request to
55
+ * a third party per hovered web link. {@link linkPreviewMicrolink} (the page's social card) and
56
+ * {@link linkPreviewMShots} (a screenshot) are two free ones; results are kept per address for the
57
+ * session.
58
+ */
59
+ preview?: LinkPreviewLookup;
60
+ /** Where the card attaches. @defaultValue `{ side: 'b', align: 'start' }` */
61
+ placement?: GridPlacement;
62
+ /** Gap (px) between the cell and the card. @defaultValue 4 */
63
+ offset?: number;
64
+ className?: string;
65
+ }
66
+ /**
67
+ * A page's **social card** through [microlink](https://microlink.io): the `og:image`, title and
68
+ * description the page declares — what a chat app unfurls. Free without a key, rate limited (25 requests
69
+ * a window, so hovering many distinct links in a burst runs dry until it resets); allows browser calls.
70
+ * Web addresses only.
71
+ */
72
+ export declare const linkPreviewMicrolink: (address: string) => Promise<LinkPreview | null>;
73
+ /**
74
+ * A **screenshot** of the page through WordPress's free mShots service. No key, no quota stated. The
75
+ * address goes in the path as is (percent-encoding it is refused). While the shot is being taken the
76
+ * service redirects to a 400×300 placeholder, so `width` must not be 400 — {@link LinkPreviewImage}
77
+ * tells the placeholder from the shot by its width and asks again. Web addresses only.
78
+ */
79
+ export declare const linkPreviewMShots: (address: string, width?: number) => LinkPreview | null;
80
+ /**
81
+ * The **hyperlink card** — hover a cell carrying a link and a card offers its address (click to follow),
82
+ * copy, edit and remove, as Excel Online does. A {@link RangeTooltipLayer} whose probe asks the cell for
83
+ * its hyperlink; the card is the tooltip group's one open tip, interactive, and closes on any press
84
+ * outside it. What the card looks like is the host's (`renderCard`); the plain default draws with the
85
+ * grid's tokens.
86
+ *
87
+ * @remarks
88
+ * Edit goes through the sheet's `updateHyperlink` command, which acts on the selection — so it selects
89
+ * the hovered cell first, as Excel Online does. Remove is the link's own `delete()`.
90
+ */
91
+ export declare const HyperlinkLayer: React.MemoExoticComponent<(props: HyperlinkLayerProps) => React.JSX.Element>;
92
+ /**
93
+ * The preview picture, shown only once it exists and has loaded — a missing card or a failed request
94
+ * draws nothing, so the card never shows a broken image.
95
+ *
96
+ * A screenshot service answers while it is still rendering with a **placeholder picture** (mShots
97
+ * does). The caller says what width it asked for (`expectedWidth`); a loaded picture of another width
98
+ * is the placeholder, so it stays hidden and the request repeats every {@link PREVIEW_POLL_MS} until the
99
+ * shot arrives. The polling stops with the card.
100
+ */
101
+ export declare const LinkPreviewImage: React.FC<{
102
+ src: string;
103
+ /** The width the service was asked for; a loaded picture of another width is its placeholder. */
104
+ expectedWidth?: number;
105
+ /** The width to draw at. @defaultValue the container's */
106
+ width?: number | string;
107
+ style?: React.CSSProperties;
108
+ }>;
109
+ //# sourceMappingURL=HyperlinkLayer.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { ReactElement } from 'react';
2
+ import { ISheet } from '@sheetxl/sdk';
3
+ export interface MovableKindScopeProps {
4
+ sheet: ISheet;
5
+ /** The movable layer's z. The kind's scope joins the pane's chain just above it. */
6
+ order: number;
7
+ }
8
+ /**
9
+ * The scope and contextual tab of the active movable's kind. While a movable is the active selection,
10
+ * its kind's `commands` run in a scope named for the content type, stacked just above the `movable`
11
+ * scope so they out-resolve it, and its `toolbar` is shown in the main toolbar strip; a kind that
12
+ * brings no tab gets the default one ({@link createDefaultMovableToolbar}). Both follow the active
13
+ * movable and go when the selection clears; another movable of the same kind becoming active re-runs
14
+ * the commands with it. A kind whose module is still loading gets them when the load settles.
15
+ */
16
+ export declare const MovableKindScope: import('react').MemoExoticComponent<(props: MovableKindScopeProps) => ReactElement | null>;
17
+ //# sourceMappingURL=MovableKindScope.d.ts.map
@@ -0,0 +1,52 @@
1
+ import { default as React } from 'react';
2
+ import { RangeCoordValue } from '@sheetxl/utils';
3
+ import { ICellRegion, ISheet, ISheetView } from '@sheetxl/sdk';
4
+ import { LayerProps } from '@sheetxl/grid-react';
5
+ /**
6
+ * The regions to punch out of the hatch, coalesced by appearance.
7
+ *
8
+ * @internal Exported for its unit test; not part of the package's API.
9
+ *
10
+ * @remarks
11
+ * What the engine hands over is already a partition of the QUERIED range — clipped to it, with
12
+ * same-identity fragments merged into maximal rectangles. Two things it deliberately does NOT do,
13
+ * because they are questions about rendering rather than about the model:
14
+ *
15
+ * - **Adjacent blocks with different identities stay apart.** Two unlocked ranges side by side are
16
+ * two regions; so are the three strips an overlapping pair partitions into (A-only, A∩B, B-only).
17
+ * Placed as-is that draws outlines on seams that are not boundaries of anything a user drew.
18
+ * - So they are merged **by appearance**, not by identity — see {@link appearanceOf}.
19
+ *
20
+ * There is nothing to clip here: `getRegions` bounds its result to the range it was asked about,
21
+ * which is this pane's visible range. (Pinned by `sdk/__tests__/anchored/protectedRange.regions.test.ts`,
22
+ * because this layer would otherwise place a rect as tall as the sheet.)
23
+ */
24
+ export declare const visibleHoles: (regions: readonly ICellRegion[]) => RangeCoordValue[];
25
+ export interface ProtectionLayerProps extends LayerProps {
26
+ /** Class for the layer (devtools identification). */
27
+ className?: string;
28
+ /** The sheet whose locked area is hatched. */
29
+ sheet: ISheet;
30
+ /** The view carrying `isShowLockedShading()` — the toggle this layer draws for. */
31
+ sheetView: ISheetView;
32
+ }
33
+ /**
34
+ * The **locked-cell hatch** — the sheet's protected area, with the unlocked ranges cut out of it.
35
+ *
36
+ * @remarks
37
+ * Not an Excel feature; Google Sheets' *View › Show › Protected ranges* is the precedent.
38
+ *
39
+ * Drawn only on a sheet that is actually ENFORCING — not one that is unprotected, and not one that
40
+ * is paused. The hatch answers "what can't I edit right now?", and on both of those the answer is
41
+ * nothing; a paused sheet that kept its hatch would look locked while every cell takes an edit.
42
+ * (The pane's paused banner, not this layer, is what says the lock is still configured.)
43
+ *
44
+ * One `<pattern>` fill over the whole pane with a `<mask>` punching out the unlocked regions from
45
+ * {@link ICellRange.Feature.Unlock}, plus a thin outline on each hole — NOT a rect per cell. One
46
+ * pattern over one box is also what keeps the hatch CONTINUOUS: tiling it per region would restart
47
+ * the pattern's origin at every rect, and the diagonals would step at each boundary.
48
+ *
49
+ * Passive paint (`pointerEvents: none`), below the selection.
50
+ */
51
+ export declare const ProtectionLayer: React.MemoExoticComponent<(props: ProtectionLayerProps) => React.JSX.Element | null>;
52
+ //# sourceMappingURL=ProtectionLayer.d.ts.map
@@ -0,0 +1,71 @@
1
+ import { default as React } from 'react';
2
+ import { ISheet, IWorkbook } from '@sheetxl/sdk';
3
+ import { LayerProps, StickyState } from '@sheetxl/grid-react';
4
+ import { RangeAnnotation } from '../annotation';
5
+ /** How an intent is drawn: its box, and the chip's frame. */
6
+ export interface RangeAnnotationStyle {
7
+ /** The box border (and the chip's frame). */
8
+ border: string;
9
+ /** The box fill — translucent, the cells show through. */
10
+ fill: string;
11
+ /** The chip's frame — opaque; a chip reads by z-order, never by letting what is under it show through. */
12
+ chip: string;
13
+ }
14
+ /**
15
+ * The default look per intent. Deliberately flatter than the selection (no thick, handled border,
16
+ * which reads as "draggable"): a soft fill and a thin border.
17
+ */
18
+ export declare const DEFAULT_ANNOTATION_STYLES: Readonly<Record<string, RangeAnnotationStyle>>;
19
+ /** What a chip (or its out-of-view marker) is rendered from. */
20
+ export interface RangeAnnotationChipProps {
21
+ workbook: IWorkbook;
22
+ /** The annotation the chip stands for — the current one of its group when it is among them. */
23
+ annotation: RangeAnnotation;
24
+ /** Others sharing this chip's anchor cell. */
25
+ more: number;
26
+ /** 1-based position in the walked list; `0` for a `working` annotation. */
27
+ position: number;
28
+ /** How many are walked. */
29
+ total: number;
30
+ isCurrent: boolean;
31
+ style: RangeAnnotationStyle;
32
+ /** The float's resolved state (`slid`, `outOfView`, `scrollIntoView`, …). */
33
+ state: StickyState;
34
+ }
35
+ export interface RangeAnnotationLayerProps extends Omit<LayerProps, 'children'> {
36
+ /** The sheet whose annotations are drawn. @defaultValue the sheet in context (an injected layer needs none) */
37
+ sheet?: ISheet;
38
+ /** Per-intent look. Merged over {@link DEFAULT_ANNOTATION_STYLES}. */
39
+ styles?: Readonly<Record<string, RangeAnnotationStyle>>;
40
+ /** Render the chip beside an annotation that is in view. Omit for the default. */
41
+ renderChip?: (props: RangeAnnotationChipProps) => React.ReactNode;
42
+ /** Render the marker that stands in for a chip whose range is scrolled out of view. Omit for the default. */
43
+ renderMarker?: (props: RangeAnnotationChipProps) => React.ReactNode;
44
+ /** How much a box that is not the navigator's current one fades. Boxes only — never chips. @defaultValue 0.45 */
45
+ dimOpacity?: number;
46
+ /**
47
+ * Whether an annotation gets a chip (and, scrolled off, a marker) or is drawn as its box alone —
48
+ * for a host that shows some annotations elsewhere (an agent's cursor, in its own status control).
49
+ * @defaultValue every walked annotation, and a `working` one only when it has a label
50
+ */
51
+ showChip?: (annotation: RangeAnnotation) => boolean;
52
+ }
53
+ /**
54
+ * The workbook's range annotations on this sheet: a soft box per annotation, and a chip per anchor
55
+ * cell. The chip rides a {@link StickyPortal} with `whenOff: 'clamp'`, so when its range scrolls out
56
+ * of view it stays at the edge as a small marker (the position, an arrow toward the range; click
57
+ * reveals it) instead of vanishing.
58
+ *
59
+ * @remarks
60
+ * The navigator's current annotation draws last (on top) at full strength; the others dim. That is
61
+ * what keeps overlapping annotations legible. Hovering a chip lifts it — and its boxes — above the
62
+ * current one while the pointer stays, so a chip hidden under another can be read and reached. Annotations that share a top-left cell share one chip —
63
+ * the current one's if it is among them — with a `+N` for the rest, so chips never stack.
64
+ *
65
+ * A prebuilt layer, not part of the sheet's default stack: a host that shows annotations injects it
66
+ * through the sheet's `layers` (`propsSheet={{ layers: [<RangeAnnotationLayer key="annotations" />] }}`
67
+ * on a workbook element). It reads the sheet from context and draws nothing while the workbook has no
68
+ * annotations. Fed through {@link addRangeAnnotations}.
69
+ */
70
+ export declare const RangeAnnotationLayer: React.MemoExoticComponent<(props: RangeAnnotationLayerProps) => React.JSX.Element>;
71
+ //# sourceMappingURL=RangeAnnotationLayer.d.ts.map
@@ -1,19 +1,20 @@
1
1
  import { default as React } from 'react';
2
2
  import { ISheet } from '@sheetxl/sdk';
3
+ import { LayerProps } from '@sheetxl/grid-react';
3
4
  /**
4
5
  * Props for {@link ResizeIndicator}.
5
6
  */
6
- export interface ResizeIndicatorProps {
7
- /** The sheet — for the unit readout (header scale factor) and the entire-range extent. */
7
+ export interface ResizeIndicatorProps extends Omit<LayerProps, 'children'> {
8
+ /** The sheet — for the entire-range extent. */
8
9
  sheet: ISheet;
9
10
  }
10
11
  /**
11
12
  * The **main-grid overlay** for an in-progress header resize: the before/after guide-lines that span the
12
- * body plus the live size tooltip. It's a self-contained grid layer — it reads the gesture from
13
- * `useSurfaceState` (published by {@link HeaderResizerLayer} in the header surface, shared via the sheet's
14
- * `SurfaceStateProvider`) and the pane from context, so it mounts as a plain child of the grid with no
15
- * render-prop bridge. Rendered once per pane; each pane draws its own clipped slice of the lines, and the
16
- * tooltip ({@link StickyFloat}) self-gates to a single owner pane.
13
+ * body. It's a self-contained grid layer — it reads the gesture from `useSurfaceState` (published by
14
+ * {@link HeaderResizerLayer} in the header surface, shared via the sheet's `SurfaceStateProvider`) and the
15
+ * pane from context, so it mounts as a plain child of the grid with no render-prop bridge. Rendered once
16
+ * per pane; each pane draws its own clipped slice of the lines. The size tooltip belongs to the header
17
+ * ({@link ResizeTooltip}).
17
18
  */
18
- export declare const ResizeIndicator: React.MemoExoticComponent<(props: ResizeIndicatorProps) => React.JSX.Element | null>;
19
+ export declare const ResizeIndicator: React.MemoExoticComponent<(props: ResizeIndicatorProps) => React.JSX.Element>;
19
20
  //# sourceMappingURL=ResizeIndicator.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { ISheetHeader } from '@sheetxl/sdk';
2
+ export interface ResizeTooltipProps {
3
+ /** The header being resized. */
4
+ sheetHeader: ISheetHeader;
5
+ }
6
+ /**
7
+ * The size tooltip of an in-progress header resize, anchored to the header being resized. Renders inside a
8
+ * header's layer: the header lays out every move of the drag, so the tooltip stays centered on the size
9
+ * being dragged. Reads the gesture published by {@link HeaderResizerLayer}. A {@link GestureTip}: it holds
10
+ * the tooltip group for the drag and self-gates to one owner pane.
11
+ */
12
+ export declare const ResizeTooltip: import('react').MemoExoticComponent<(props: ResizeTooltipProps) => import("react").JSX.Element>;
13
+ //# sourceMappingURL=ResizeTooltip.d.ts.map
@@ -8,6 +8,12 @@ export interface SheetHeaderCellLayerProps extends LayerProps {
8
8
  header: ISheetHeader;
9
9
  /** Per-header renderer (the sheet's `SheetHeaderRenderer` wrapping). */
10
10
  renderCell: (props: CellRendererProps) => React.ReactNode;
11
+ /**
12
+ * A styling input the layer cannot watch itself: a new value busts the label cache. The header
13
+ * element passes its filtered runs' revision (a filter set or cleared may hide no row, so no
14
+ * size change repaints for it).
15
+ */
16
+ invalidateToken?: unknown;
11
17
  }
12
18
  /**
13
19
  * The header's cell layer.
@@ -17,9 +23,12 @@ export interface SheetHeaderCellLayerProps extends LayerProps {
17
23
  * busting the underlying grid-react {@link CellLayer} with its own token — so it re-renders only itself,
18
24
  * not the header grid. Two triggers bump the token:
19
25
  *
20
- * - **size change** (`onSizesChange`) — alters what is visible/labeled;
26
+ * - **metrics change** (`onMetricsChange`) — alters what is visible/labeled;
21
27
  * - **selection change** — header labels are styled by selection (fill / weight / color), but the tiled
22
28
  * `CellLayer` cache survives scroll, so it must be dropped when *this header's* selected runs change.
29
+ *
30
+ * A third comes from the owner as `invalidateToken`: the rows a filter holds a condition over (the blue
31
+ * row numbers), which the header element reads and the layer cannot.
23
32
  * Gated on the runs {@link selectedRunsSignature} so it busts only when the styling would differ (not
24
33
  * on every active-cell move, and never on scroll — there is no per-frame range work).
25
34
  *
@@ -0,0 +1,40 @@
1
+ import { default as React } from 'react';
2
+ import { IRange, ISheet } from '@sheetxl/sdk';
3
+ import { LayerProps } from '@sheetxl/grid-react';
4
+ import { OutlineButtonProps } from '../cell/OutlineButton';
5
+ export interface SheetOutlineLayerProps extends LayerProps {
6
+ /** The sheet whose outline is drawn. */
7
+ sheet: ISheet;
8
+ /** Rows or columns. */
9
+ axis: IRange.Axis;
10
+ /** The lanes across the gutter: one per level, plus one. */
11
+ lanes: number;
12
+ /** Renders a group's collapse / expand button. Defaults to `OutlineButton`. */
13
+ renderButton?: (props: OutlineButtonProps) => React.ReactNode;
14
+ /**
15
+ * The space around the buttons, in pixels: between neighbors, before the first and after the last.
16
+ *
17
+ * @defaultValue 1
18
+ */
19
+ laneGap?: number;
20
+ /**
21
+ * Space between a bracket's end and its button, in pixels.
22
+ *
23
+ * @defaultValue 0
24
+ */
25
+ bracketGap?: number;
26
+ }
27
+ /**
28
+ * The outline gutter's layer: for each group in view, a bracket beside its details and a button on
29
+ * its summary that collapses or expands it; and beside each detail header a dot, as Excel draws.
30
+ *
31
+ * @remarks
32
+ * Lane `level - 1` holds the groups of that level, outermost nearest the sheet edge. Groups come from
33
+ * {@link IOutline.getGroups} limited to the pane's visible span, so the work is per group in view. A
34
+ * collapsed group draws only its button. The dots are the gutter's cells: a {@link CellTileDiv} in
35
+ * this layer renders one per header the tiling engine finds in view, and a header at level `n` gets
36
+ * its dot in lane `n`, the lane after its deepest bracket, so a dot never sits on a line.
37
+ * Re-renders on scroll (the pane context) and on `onOutlineChange`.
38
+ */
39
+ export declare const SheetOutlineLayer: React.MemoExoticComponent<(props: SheetOutlineLayerProps) => React.JSX.Element>;
40
+ //# sourceMappingURL=SheetOutlineLayer.d.ts.map
@@ -1,16 +1,17 @@
1
1
  import { default as React } from 'react';
2
- import { ISheet, ITable } from '@sheetxl/sdk';
2
+ import { ISheet } from '@sheetxl/sdk';
3
3
  import { LayerProps } from '@sheetxl/grid-react';
4
+ import { TableToolbarRenderProps } from './TableToolbar';
4
5
  export interface TableLayerProps extends LayerProps {
5
6
  /**
6
7
  * The sheet.
7
8
  */
8
9
  sheet: ISheet;
9
10
  /**
10
- * Invoked by the hover toolbar's **edit** button. Wire it to the `editTable` command; if omitted the
11
- * button falls back to selecting the table.
11
+ * The toolbar that floats at a hovered table's top-right corner.
12
+ * @defaultValue a plain split button: edit the table · a menu of the table commands
12
13
  */
13
- onEditTable?: (table: ITable) => Promise<void>;
14
+ renderToolbar?: (props: TableToolbarRenderProps) => React.ReactNode;
14
15
  }
15
16
  /**
16
17
  * Is the outline, resizer, and row selection.
@@ -0,0 +1,42 @@
1
+ import { default as React } from 'react';
2
+ import { ISheet, ITable } from '@sheetxl/sdk';
3
+ import { HoverTipProps, StickyState } from '@sheetxl/grid-react';
4
+ /** What the table toolbar is handed. */
5
+ export interface TableToolbarRenderProps {
6
+ sheet: ISheet;
7
+ /** The hovered table. A press anywhere on the toolbar makes it the current table first, so the table commands act on it. */
8
+ table: ITable;
9
+ /** The table's theme color, for chrome that wears it. */
10
+ color: string;
11
+ /** Spread onto the toolbar root: it takes the pointer, and hovering it keeps the toolbar up. */
12
+ floatProps: HoverTipProps;
13
+ /**
14
+ * Keep the toolbar up while something it opened has the pointer — its dropdown. Call `true` when the
15
+ * dropdown opens and `false` when it closes.
16
+ */
17
+ setHeld: (held: boolean) => void;
18
+ state: StickyState;
19
+ }
20
+ /** What {@link TableLayer} hands its toolbar float. */
21
+ export interface TableToolbarFloatProps {
22
+ sheet: ISheet;
23
+ /** The table under the pointer, as the table layer's hover found it. */
24
+ hovered: ITable | null;
25
+ renderToolbar?: (props: TableToolbarRenderProps) => React.ReactNode;
26
+ }
27
+ /**
28
+ * The **table toolbar** — hover a table and its commands float at its top-right corner: a quick action
29
+ * (edit the table) and a dropdown of the rest. A {@link VirtualRangeFloat} inside the table layer, fed
30
+ * the table the layer's own hover found: opened by hover but not a tooltip (it outlives a tip opening
31
+ * beside it and a press on its own buttons), `clamp`ed so it stays on screen while the table's top is
32
+ * scrolled away. What it draws is the host's (`renderToolbar`); its commands resolve from the pane like
33
+ * any other.
34
+ *
35
+ * @remarks
36
+ * The table commands act on the table under the active cell, so a press on the toolbar first makes the
37
+ * hovered table that one (selecting it when the active cell is outside it). The dropdown opens in the
38
+ * float stack, so it closes under a context menu like any popup; while it is open the toolbar is held
39
+ * up (`setHeld`), as the pointer is on the dropdown, not the toolbar.
40
+ */
41
+ export declare const TableToolbarFloat: React.FC<TableToolbarFloatProps>;
42
+ //# sourceMappingURL=TableToolbar.d.ts.map
@@ -0,0 +1,61 @@
1
+ import { default as React } from 'react';
2
+ import { CellCoords } from '@sheetxl/utils';
3
+ import { ISheet, IDataValidation, IRange } from '@sheetxl/sdk';
4
+ import { IEditable, LayerProps } from '@sheetxl/grid-react';
5
+ /** What the probe hands the button: the validations to offer, and the cell they belong to. */
6
+ export interface ValidationDropdown {
7
+ /** The list validation the button opens a picker for: the first covering one, by priority. */
8
+ dataValidation: IDataValidation;
9
+ /**
10
+ * Every list validation covering the cell, in priority order. The picker offers the first one's
11
+ * items, intersected with the others' when there are several.
12
+ */
13
+ dataValidations: readonly IDataValidation[];
14
+ /** The cell holding it — the anchor cell when the validation sits on a merge. */
15
+ cell: CellCoords;
16
+ /** The merge that cell anchors, when it anchors one. */
17
+ merge?: IRange.Coords;
18
+ }
19
+ export interface ValidationDropdownLayerProps extends Omit<LayerProps, 'children'> {
20
+ /** Class for the floated button container. */
21
+ className?: string;
22
+ /** Style for the floated button container. */
23
+ style?: React.CSSProperties;
24
+ /** The sheet whose selection is followed. */
25
+ sheet: ISheet;
26
+ /**
27
+ * The editable a pick is entered through — the sheet's shared one, so a pick is a typed entry:
28
+ * coerced, formatted and checked as one. Without it the button opens nothing.
29
+ */
30
+ editable: IEditable<any, string, any> | null;
31
+ /** Width (px, unzoomed) of the button. @defaultValue 17 */
32
+ dropdownWidth?: number;
33
+ /**
34
+ * Intercept the press instead of opening the built-in picker.
35
+ *
36
+ * @remarks
37
+ * By default the button opens the shared list picker ({@link useValidationPicker}). Supply this to
38
+ * take the press over entirely — the built-in picker is then never opened, and presenting the list
39
+ * is yours.
40
+ */
41
+ onOpenDropdown?: (cell: CellCoords, dataValidation: IDataValidation) => void;
42
+ }
43
+ /**
44
+ * The **list-validation dropdown** on the selected cell — a {@link RangeFloatLayer} activated by the
45
+ * selection.
46
+ *
47
+ * @remarks
48
+ * Deliberately a separate layer from `ValidationIndicatorLayer`, because the two marks answer
49
+ * different questions and so are drawn by different mechanisms. The invalid-value mark is a property
50
+ * of a cell's VALUE: it belongs wherever one is in view, as cached tile snapshots that survive scroll.
51
+ * The dropdown appears on the ACTIVE CELL ALONE — which is the expensive predicate, since it would
52
+ * dirty a tile on every selection move — and it hugs the OUTSIDE of the cell's right edge (covering
53
+ * the neighbor, as Excel does) so it has to escape the pane clip. Tile and float; they share a sheet
54
+ * and nothing else.
55
+ *
56
+ * On a **merge** the affordance belongs to the merge, not to its anchor corner cell: the button hugs
57
+ * the MERGE's right edge, centered on it. It is a fixed square whatever the row or merge height —
58
+ * stretching it to fit would turn a tall merge into a full-height bar.
59
+ */
60
+ export declare const ValidationDropdownLayer: React.MemoExoticComponent<(props: ValidationDropdownLayerProps) => React.JSX.Element>;
61
+ //# sourceMappingURL=ValidationDropdownLayer.d.ts.map
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { CellCoords } from '@sheetxl/utils';
3
- import { ISheet, IDataValidation } from '@sheetxl/sdk';
2
+ import { ISheet } from '@sheetxl/sdk';
4
3
  import { LayerProps } from '@sheetxl/grid-react';
5
4
  export interface ValidationIndicatorLayerProps extends LayerProps {
6
5
  /** Class for the layer (devtools identification). */
@@ -11,31 +10,25 @@ export interface ValidationIndicatorLayerProps extends LayerProps {
11
10
  sheet: ISheet;
12
11
  /** Size (px, unzoomed) of the invalid-value corner mark. @defaultValue 7 */
13
12
  markSize?: number;
14
- /** Width (px, unzoomed) of the list dropdown button. @defaultValue 17 */
15
- dropdownWidth?: number;
16
- /**
17
- * Called when the selected cell's list dropdown is pressed.
18
- *
19
- * @remarks
20
- * The layer draws the affordance but owns no picker — the list UI is a host concern (it needs
21
- * the float stack and the editor). Omit and the button is inert.
22
- */
23
- onOpenDropdown?: (cell: CellCoords, dataValidation: IDataValidation) => void;
24
13
  }
25
14
  /**
26
- * The sheet's **data-validation indicators** — the mark on a cell holding a value its rule rejects,
27
- * and the dropdown on a selected list cell.
15
+ * The sheet's **invalid-value marks** — the corner mark on every in-view cell its validation rule
16
+ * rejects, shown while the view's Show Invalid is on. An empty cell is rejected by a rule with Ignore
17
+ * blank off, as Excel circles it.
28
18
  *
29
19
  * @remarks
20
+ * The mark sits in the bottom-right corner, beside the list dropdown, and is colored by how the
21
+ * value fails (`resolveValidationMark`): the alert style of the rule that answers for the cell, or
22
+ * neutral when no failing rule raises an alert. `CellErrorLayer` explains it on hover.
23
+ *
30
24
  * A layer of its own rather than part of the cell renderer, so the cells layer never probes the
31
- * validation model and a sheet with no validations costs one index lookup per frame.
25
+ * validation model and a sheet with no validations costs one index lookup per frame. A cell is marked
26
+ * when any rule covering it flags it, not only the primary one.
32
27
  *
33
- * The two marks answer different questions and so are drawn differently. The invalid mark is a
34
- * property of a cell's VALUE: it is drawn wherever one is in view, as {@link CellTileDiv}
35
- * snapshots that survive scroll. The dropdown is an affordance for editing, so — as in Excel — it
36
- * appears on the selected cell alone (a column of list cells would otherwise be a column of
37
- * buttons), and it follows the selection as a live {@link VirtualDiv} peer of the tiles, so an
38
- * arrow key never invalidates a tile.
28
+ * The mark is a property of a cell's VALUE, so it belongs wherever one is in view and is drawn as
29
+ * {@link CellTileDiv} snapshots that survive scroll — nothing here depends on the selection, which is
30
+ * what keeps the tile cache alive across cursor movement. The list DROPDOWN is the opposite predicate
31
+ * ("the active cell alone") and lives in `ValidationDropdownLayer`; they share a sheet and nothing else.
39
32
  */
40
33
  export declare const ValidationIndicatorLayer: React.MemoExoticComponent<(props: ValidationIndicatorLayerProps) => React.JSX.Element | null>;
41
34
  //# sourceMappingURL=ValidationIndicatorLayer.d.ts.map
@@ -0,0 +1,64 @@
1
+ import { default as React } from 'react';
2
+ import { CellCoords, RangeCoords } from '@sheetxl/utils';
3
+ import { IDataValidation, ISheet } from '@sheetxl/sdk';
4
+ import { IEditable, LayerProps } from '@sheetxl/grid-react';
5
+ import { ValidationAlert } from '../editor/validationAlert';
6
+ /** The prompt a cell shows: the rule's title and message, and the range it hangs under. */
7
+ export interface ValidationPrompt {
8
+ /** The cell, or the merge it anchors. */
9
+ range: RangeCoords;
10
+ /** The rule's prompt title; may be empty. */
11
+ title: string;
12
+ /** The rule's prompt message; may be empty. */
13
+ message: string;
14
+ /** The rule the prompt belongs to. */
15
+ dataValidation: IDataValidation;
16
+ }
17
+ /**
18
+ * The input prompt for the cell at `coords`: from the first covering rule, by priority, that shows
19
+ * a prompt and has a title or a message to show. `null` when none does.
20
+ */
21
+ export declare const findValidationPrompt: (sheet: ISheet, coords: CellCoords) => ValidationPrompt | null;
22
+ export interface ValidationPromptLayerProps extends Omit<LayerProps, 'children'> {
23
+ /** Class for the floated container. */
24
+ className?: string;
25
+ /** Style for the floated container. */
26
+ style?: React.CSSProperties;
27
+ /** The sheet whose selection is followed, and whose entries are checked. */
28
+ sheet: ISheet;
29
+ /**
30
+ * The editable entries are typed through. It tells an alert on an open edit, which stays while
31
+ * the edit does, from one left behind, which the next key or press clears.
32
+ */
33
+ editable?: IEditable<any, string, any> | null;
34
+ /** Gap (px) between the cell and the float, below it and past its right edge. @defaultValue 6 */
35
+ offset?: number;
36
+ /**
37
+ * Render the prompt yourself. Spread `floatProps` on the returned element. Omit for the default
38
+ * box: the title in bold over the message.
39
+ */
40
+ renderPrompt?: (prompt: ValidationPrompt, floatProps: React.HTMLAttributes<HTMLElement>) => React.ReactNode;
41
+ /**
42
+ * Render the alert yourself. Spread `floatProps` on the returned element. Omit for the default
43
+ * card: the rule's alert title and message, and what to do next.
44
+ */
45
+ renderAlert?: (alert: ValidationAlert, floatProps: React.HTMLAttributes<HTMLElement>) => React.ReactNode;
46
+ }
47
+ /**
48
+ * The **input prompt** of a data validation, and the **alert** an entry raised in its place — one
49
+ * {@link RangeFloatLayer} at the cell-tip placement the error tips use: under the active cell (or
50
+ * its merge), starting just past its right edge.
51
+ *
52
+ * @remarks
53
+ * At rest the float follows the selection and shows the title and message of the first covering
54
+ * rule that has a prompt to show ({@link findValidationPrompt}). It stays while the cell is being
55
+ * edited, as Excel's does, and steps aside while the list picker is open, since the picker drops
56
+ * under the same edge.
57
+ *
58
+ * An alert the entry check raised (`ValidationAlert`) takes the float over: Excel's alert dialog in
59
+ * tip form. A Stop keeps the edit open and the tip with it; a Warning's tip asks for Enter again; an
60
+ * Information entry is written and its tip stays until the next key or press. The prompt returns
61
+ * when the alert clears.
62
+ */
63
+ export declare const ValidationPromptLayer: React.MemoExoticComponent<(props: ValidationPromptLayerProps) => React.JSX.Element>;
64
+ //# sourceMappingURL=ValidationPromptLayer.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { ISheet, ITable } from '@sheetxl/sdk';
2
+ /** The table's theme color (header fill / whole-table top border) as CSS; grey when the style has none. */
3
+ export declare const tableLabelColor: (table: ITable, sheet: ISheet) => string;
4
+ //# sourceMappingURL=_tableColor.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { RangeCoords } from '@sheetxl/utils';
2
+ import { GridPlacement, IGridPane } from '@sheetxl/grid-react';
3
+ /**
4
+ * Where a cell's tips hang: the input prompt, and the hover tip on an error, a warning or a failed
5
+ * validation alike. Below the cell, starting just past its right edge (under a dropdown button), so
6
+ * the cell and the one below it stay in view. Flip and shift apply as to any grid float.
7
+ */
8
+ export declare const CELL_TIP_PLACEMENT: GridPlacement;
9
+ /** Gap (px) between a cell and its tip, below it and past its right edge alike. */
10
+ export declare const CELL_TIP_GAP = 6;
11
+ /** The align offset that starts a tip `gap` past the right edge of `range`. */
12
+ export declare const cellTipAlignOffset: (pane: IGridPane, range: RangeCoords, gap?: number) => number;
13
+ //# sourceMappingURL=cellTip.d.ts.map