@sheetxl/react 0.8.0-beta.1 → 0.8.0-beta.3

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 (86) hide show
  1. package/browser/cjs/index.cjs +21 -15
  2. package/browser/esm/{SJMJzBwlXTJ9QIO5.mjs → CsAsyCbvykfsW4xo.mjs} +1 -1
  3. package/browser/esm/index.mjs +10358 -8370
  4. package/node/esm/{DAE_NG8D9uT50zUH.mjs → C-uhX7Vz_6yExNAO.mjs} +1 -1
  5. package/node/esm/index.mjs +9391 -7380
  6. package/package.json +6 -6
  7. package/resources/locales/de/movable.cmd.json +86 -0
  8. package/resources/locales/de/selection.cmd.json +8 -0
  9. package/resources/locales/de/sheet.cmd.json +170 -7
  10. package/resources/locales/de/ui.msg.json +48 -3
  11. package/resources/locales/de/workbook.cmd.json +9 -6
  12. package/resources/locales/en/movable.cmd.json +86 -0
  13. package/resources/locales/en/selection.cmd.json +8 -0
  14. package/resources/locales/en/sheet.cmd.json +171 -7
  15. package/resources/locales/en/ui.msg.json +48 -3
  16. package/resources/locales/en/workbook.cmd.json +10 -7
  17. package/types/src/autoFill/AutoFillPresets.d.ts +14 -0
  18. package/types/src/autoFill/FillMenu.d.ts +36 -0
  19. package/types/src/autoFill/FillSeries.d.ts +38 -0
  20. package/types/src/autoFill/index.d.ts +4 -0
  21. package/types/src/border/StaticBorderRenderer.d.ts +2 -2
  22. package/types/src/border/useBorders.d.ts +7 -7
  23. package/types/src/cell/FormulaCellRenderer.d.ts +1 -1
  24. package/types/src/cell/StaticCellRenderer.d.ts +57 -0
  25. package/types/src/cell/index.d.ts +1 -0
  26. package/types/src/cell/useFormulaViewAnchor.d.ts +1 -1
  27. package/types/src/checklist/ValueChecklist.d.ts +71 -0
  28. package/types/src/checklist/index.d.ts +2 -0
  29. package/types/src/conditionalFormat/index.d.ts +1 -0
  30. package/types/src/editor/FunctionPreviewPanel.d.ts +14 -0
  31. package/types/src/editor/NamedItemLabel.d.ts +29 -0
  32. package/types/src/editor/NamedItemsPanel.d.ts +13 -2
  33. package/types/src/editor/SheetCellEditorLayer.d.ts +8 -4
  34. package/types/src/editor/SheetCellInput.d.ts +12 -2
  35. package/types/src/editor/SheetEditable.d.ts +8 -2
  36. package/types/src/editor/formulaCaret.d.ts +39 -10
  37. package/types/src/editor/formulaEval.d.ts +9 -5
  38. package/types/src/editor/formulaLint.d.ts +36 -0
  39. package/types/src/editor/formulaPresentation.d.ts +7 -0
  40. package/types/src/editor/formulaText.d.ts +17 -5
  41. package/types/src/editor/functionArgs.d.ts +20 -0
  42. package/types/src/editor/index.d.ts +2 -1
  43. package/types/src/editor/pickedReference.d.ts +76 -0
  44. package/types/src/editor/useEditRejectedNotice.d.ts +32 -0
  45. package/types/src/editor/useFormulaHints.d.ts +93 -3
  46. package/types/src/editor/useFormulaInput.d.ts +15 -1
  47. package/types/src/editor/useReferenceMode.d.ts +12 -0
  48. package/types/src/externalLink/ExternalLinksPaneArgs.d.ts +23 -0
  49. package/types/src/externalLink/index.d.ts +2 -0
  50. package/types/src/form/FormulaInput.d.ts +13 -0
  51. package/types/src/form/FormulaInputParts.d.ts +10 -1
  52. package/types/src/frame/CommandContext.d.ts +147 -5
  53. package/types/src/index.d.ts +5 -1
  54. package/types/src/io/WorkbookIO.d.ts +2 -0
  55. package/types/src/layer/CellErrorLayer.d.ts +10 -3
  56. package/types/src/layer/ProtectionLayer.d.ts +52 -0
  57. package/types/src/layer/ValidationDropdownLayer.d.ts +15 -5
  58. package/types/src/layer/ValidationIndicatorLayer.d.ts +9 -3
  59. package/types/src/layer/ValidationPromptLayer.d.ts +46 -0
  60. package/types/src/layer/index.d.ts +2 -1
  61. package/types/src/layer/useValidationPicker.d.ts +35 -35
  62. package/types/src/layer/validationMark.d.ts +63 -0
  63. package/types/src/movable/MovableLayer.d.ts +1 -5
  64. package/types/src/picker/PickerPanel.d.ts +52 -0
  65. package/types/src/picker/cellPickerOpen.d.ts +6 -0
  66. package/types/src/picker/index.d.ts +4 -0
  67. package/types/src/picker/useCellPicker.d.ts +93 -0
  68. package/types/src/protection/ProtectionPaneArgs.d.ts +31 -0
  69. package/types/src/protection/index.d.ts +3 -0
  70. package/types/src/protection/unlockProtectedRanges.d.ts +23 -0
  71. package/types/src/selection/SheetSelectionLayer.d.ts +10 -0
  72. package/types/src/sheet/ISheetElement.d.ts +7 -0
  73. package/types/src/sheet/SheetCommands.d.ts +3 -3
  74. package/types/src/sheet/circularReferences.d.ts +9 -1
  75. package/types/src/sheet/index.d.ts +1 -1
  76. package/types/src/sheet/useCycleHighlight.d.ts +21 -0
  77. package/types/src/taskPane/ITaskPane.d.ts +12 -1
  78. package/types/src/workbook/IWorkbookElement.d.ts +5 -0
  79. package/types/src/workbook/WorkbookCommands.d.ts +0 -2
  80. package/types/src/workbook/_followOrigin.d.ts +9 -0
  81. package/types/src/workbook/useWorkbookFormat.d.ts +3 -3
  82. package/types/src/editor/useProtectedEditNotice.d.ts +0 -14
  83. package/types/src/layer/validationList.d.ts +0 -84
  84. package/types/src/list/SheetValueList.d.ts +0 -93
  85. package/types/src/list/index.d.ts +0 -2
  86. /package/types/src/{sheet → conditionalFormat}/ConditionalFormatPresets.d.ts +0 -0
@@ -10,9 +10,9 @@ import { IWorkbook } from '@sheetxl/sdk';
10
10
  * A format KEY, not a full format type — resolving one to the other needs the registry
11
11
  * (`getWriteFormats({ search: key })`), which is async and a concern of whoever is asking.
12
12
  *
13
- * Follows the handle's `onChange`, so chrome that names the current format (a Save As menu, a
14
- * status bar) updates the moment a Save As re-targets the workbook rather than going stale until
15
- * the next mount.
13
+ * Follows the workbook to whichever origin it lives in, so chrome that names the current format (a
14
+ * Save As menu, a status bar) updates the moment a Save As moves the workbook rather than going
15
+ * stale until the next mount.
16
16
  */
17
17
  export declare const useWorkbookFormat: (workbook: IWorkbook | null) => string | null;
18
18
  //# sourceMappingURL=useWorkbookFormat.d.ts.map
@@ -1,14 +0,0 @@
1
- import { ISheet } from '@sheetxl/sdk';
2
- /**
3
- * The Excel-style "sheet is protected" heads-up for a rejected edit attempt (`IEditable.startEdit`
4
- * returning `false`). Returns the callback a host invokes on each rejection; the notice shows once
5
- * per **visit** to `sheet` — Excel re-warns each time you come (back) to a tab, so the once-flag
6
- * resets on a `sheet` identity change (and naturally on remount). The `isLocked()` guard keeps the
7
- * message protection-specific: any other non-editable reason stays silent.
8
- *
9
- * One instance should serve one visit scope — `SheetElement` creates it and threads the callback to
10
- * every consumer it hosts (its imperative `startEdit` and each pane's editor layer), so four frozen
11
- * panes never warn four times.
12
- */
13
- export declare const useProtectedEditNotice: (sheet: ISheet) => (() => void);
14
- //# sourceMappingURL=useProtectedEditNotice.d.ts.map
@@ -1,84 +0,0 @@
1
- import { ICellRange, IDataValidation, ISheet, Scalar } from '@sheetxl/sdk';
2
- /**
3
- * The values a list validation offers, plus whether they are real.
4
- */
5
- export interface ResolvedList {
6
- /** The offered values. */
7
- items: readonly Scalar[];
8
- /**
9
- * `true` when {@link items} is **placeholder data** — the source exists but this build cannot
10
- * resolve it (see {@link resolveListItems}). Never let placeholder values reach the model or read
11
- * as real in the UI.
12
- */
13
- placeholder: boolean;
14
- }
15
- /**
16
- * The values a list validation offers.
17
- *
18
- * @remarks
19
- * A list source is stored as **formula text**, verbatim, so the round-trip is lossless — see
20
- * `io-xlsx`'s `toCondition`, which sets `param` to the raw `<formula1>`. Three forms reach here:
21
- *
22
- * - a `Scalar[]` under `param.items` — the programmatic form, used directly;
23
- * - a quoted literal (`"a,b,c"`) — parsed here;
24
- * - a reference or formula (`$A$1:$A$5`, a name, a cross-sheet ref) — **not resolvable in this
25
- * build**. `ICondition.IContext.resolveFormula` returns a single `Scalar`, not an array, and
26
- * `InSetOperator` carries the matching TODO: resolving a source to a list needs a formula→array
27
- * evaluation that does not exist yet. Until it does, this returns PLACEHOLDER values with
28
- * `placeholder: true` so the picker UI can be exercised — the caller must surface that, and must
29
- * never write one back to the model.
30
- *
31
- * Note the same gap makes such a validation inert as a *predicate* too (`InSetOperator` drops a
32
- * non-array `items`), so this is one missing capability, not a picker-only problem.
33
- */
34
- export declare const resolveListItems: (dataValidation: IDataValidation | null | undefined) => ResolvedList;
35
- /**
36
- * Options for {@link resolveListRange}.
37
- */
38
- export interface ResolveListRangeOptions {
39
- /**
40
- * The sheet the validation belongs to.
41
- *
42
- * @remarks
43
- * Its {@link IStyleCollection} is SHARED with the scratch sheet, so the offered values render in
44
- * the document's theme and `Normal` style instead of the defaults. Sharing is safe only because
45
- * the scratch sheet sets values and never a style — writing one would reach the host's collection.
46
- */
47
- host?: ISheet;
48
- }
49
- /**
50
- * A list validation's values, as a **range**.
51
- */
52
- export interface ResolvedListRange {
53
- /** The values to offer, or `null` when the validation offers none. */
54
- range: ICellRange | null;
55
- /**
56
- * The width (px) the values need — already measured, so a caller sizing a menu does not measure
57
- * again. `0` when there is no range.
58
- */
59
- contentWidth: number;
60
- /**
61
- * `true` when {@link range} holds **placeholder data** — the source exists but this build cannot
62
- * resolve it. Never let a placeholder reach the model or read as real in the UI.
63
- */
64
- placeholder: boolean;
65
- /**
66
- * Release the scratch sheet this materialized. A no-op for a source that was already a real range,
67
- * which is never ours to close.
68
- */
69
- close: () => void;
70
- }
71
- /**
72
- * The values a list validation offers, as a **range of real cells** — which is what a UI needs, since
73
- * only a cell knows how its value becomes text (a date is a date, a currency is a currency).
74
- *
75
- * @remarks
76
- * A literal source (`"a,b,c"`) is materialized onto a scratch sheet. A reference source
77
- * (`$A$1:$A$5`) will one day return that range directly, live, with no copy — the consumer does not
78
- * change when it does, which is the point of taking a range. Until the SDK can resolve a formula to
79
- * an array it returns marked placeholders; see {@link resolveListItems}.
80
- *
81
- * The caller MUST {@link ResolvedListRange.close} the result when it is done with it.
82
- */
83
- export declare const resolveListRange: (dataValidation: IDataValidation | null | undefined, options?: ResolveListRangeOptions) => ResolvedListRange;
84
- //# sourceMappingURL=validationList.d.ts.map
@@ -1,93 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ICell, ICellRange } from '@sheetxl/sdk';
3
- import { ISelection } from '@sheetxl/grid-react';
4
- export interface SheetValueListAttributes {
5
- isSheetValueList: () => true;
6
- }
7
- export interface ISheetValueListElement extends HTMLDivElement, SheetValueListAttributes {
8
- }
9
- /**
10
- * Props for {@link SheetValueList}.
11
- */
12
- export interface SheetValueListProps extends React.HTMLAttributes<HTMLDivElement> {
13
- /**
14
- * The values to offer — **the** input. A single column of a real sheet; only its first column is
15
- * read (a wider range is not an error, it is just narrowed).
16
- *
17
- * @remarks
18
- * A caller holding raw values makes itself a scratch sheet and hands over the resulting range —
19
- * see the component remarks. The list never writes to it: it is a **view**, so a *live* range (a
20
- * list validation's `$A$1:$A$5`, a table column) can be passed straight through with no copy and
21
- * no staleness.
22
- *
23
- * The range is never resized to render it. Ask `getBestFit()` how wide the values are and pass that
24
- * as {@link SheetValueListProps.contentWidth}; the range itself is left exactly as it was.
25
- */
26
- range: ICellRange;
27
- /**
28
- * The selection model — the highlighted row + Arrow-key navigation, in **list** coordinates (row 0
29
- * is the range's first row, whatever its sheet address). Owned by the caller so it can read what is
30
- * highlighted; a private one is created when omitted.
31
- */
32
- selection?: ISelection;
33
- /**
34
- * A row was chosen — clicked, or Enter/Space on the highlighted row. The cell is the real sheet
35
- * cell, so the caller can take its value, its text or its format.
36
- */
37
- onChoose?: (cell: ICell, index: number) => void;
38
- /**
39
- * Uniform row height in px. @defaultValue the range's first row height.
40
- *
41
- * @remarks
42
- * Uniform, deliberately: a dropdown wants even rows, and a source range brings heights that were
43
- * chosen for a sheet, not for a menu.
44
- */
45
- rowHeight?: number;
46
- /**
47
- * Width the **values** need, in px — normally `range.getBestFit({ axes: Column }).width`. The list
48
- * sizes itself to this plus its own scrollbar gutter, so the column really is this wide.
49
- *
50
- * @remarks
51
- * Pass this rather than a `style.width`: `getBestFit` describes the COLUMN, and a box of that width
52
- * hands the gutter back out of it — content that fits exactly then doesn't, and the renderer
53
- * replaces the values it can no longer fit with `#`. Cap the result with `style.maxWidth`.
54
- */
55
- contentWidth?: number;
56
- /** Take focus on mount, so the Arrow keys work without a click first. @defaultValue false */
57
- autoFocus?: boolean;
58
- /** Ref for the Element. */
59
- ref?: React.Ref<ISheetValueListElement>;
60
- }
61
- /**
62
- * A single-column list whose rows are **real cells on a real sheet** — so a date reads as a date, a
63
- * currency as currency, and a number stays right-aligned, because the values are drawn by the same
64
- * {@link SheetCellRenderer} the grid uses.
65
- *
66
- * @remarks
67
- * The input is a {@link SheetValueListProps.range | range}, and only a range. A caller holding raw
68
- * `Scalar[]` materializes a scratch sheet and passes the resulting range — which is what this
69
- * component would otherwise have had to do internally, so pushing it out costs nothing and makes the
70
- * reference-backed case (a list validation sourced from `$A$1:$A$5`) stop being special: same code
71
- * path, pointed at the live range.
72
- *
73
- * It is a **dropdown**, not a little spreadsheet: no headers, no gridlines, no fills or borders, and
74
- * a list-shaped highlight (see `ListSurface`, whose chrome it wears). It also adds **no padding of
75
- * its own** — a row's text sits exactly where the cell's own insets put it, which is what lets a
76
- * caller align the first row with the cell the menu drops out of. A border belongs OUTSIDE the
77
- * component (an outset on the panel), or every value shifts right by the border width.
78
- *
79
- * Sizing is split: pass {@link SheetValueListProps.contentWidth} (what the values need) and the list
80
- * adds its own chrome, but the width RULE — at least the anchored cell, at most a cap — stays the
81
- * caller's, since only the caller knows the anchor. Height is `style`'s.
82
- *
83
- * Rows are drawn with `allowTextOverflow={false}`: in a sheet, text too wide for its column spills
84
- * over its empty neighbors, and the SDK reports that spill in the SOURCE sheet's geometry — which the
85
- * list does not have. A dropdown row should not spill anyway, so the renderer lays out purely in the
86
- * bounds the list gives it and clips what does not fit.
87
- *
88
- * Note the font scale: a sheet's `Normal` font is in POINTS and paints at `points * 96/72` (11pt
89
- * Calibri renders at 14.667px), which is the scale every width here — `getBestFit` included — is
90
- * measured in. A width that looks too small next to a point size is usually this.
91
- */
92
- export declare const SheetValueList: React.ForwardRefExoticComponent<Omit<SheetValueListProps, "ref"> & React.RefAttributes<ISheetValueListElement>>;
93
- //# sourceMappingURL=SheetValueList.d.ts.map
@@ -1,2 +0,0 @@
1
- export * from './SheetValueList';
2
- //# sourceMappingURL=index.d.ts.map