@svgrid/enterprise 3.0.1 → 3.0.2

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 (197) hide show
  1. package/dist/SvFormulaBar.svelte +606 -0
  2. package/dist/SvFormulaBar.svelte.d.ts +62 -0
  3. package/dist/SvPivotDesigner.svelte +65 -14
  4. package/dist/SvRibbonIcon.svelte +46 -0
  5. package/dist/SvRibbonIcon.svelte.d.ts +17 -0
  6. package/dist/SvSchemaChart.svelte +4 -2
  7. package/dist/SvSheet.svelte +4114 -0
  8. package/dist/SvSheet.svelte.d.ts +142 -0
  9. package/dist/SvSheetComment.svelte +98 -0
  10. package/dist/SvSheetComment.svelte.d.ts +22 -0
  11. package/dist/SvSheetConditionalFormat.svelte +162 -0
  12. package/dist/SvSheetConditionalFormat.svelte.d.ts +14 -0
  13. package/dist/SvSheetDataValidation.svelte +249 -0
  14. package/dist/SvSheetDataValidation.svelte.d.ts +14 -0
  15. package/dist/SvSheetFilterMenu.svelte +217 -0
  16. package/dist/SvSheetFilterMenu.svelte.d.ts +17 -0
  17. package/dist/SvSheetFindReplace.svelte +132 -0
  18. package/dist/SvSheetFindReplace.svelte.d.ts +10 -0
  19. package/dist/SvSheetFormatCells.svelte +421 -0
  20. package/dist/SvSheetFormatCells.svelte.d.ts +17 -0
  21. package/dist/SvSheetGoalSeek.svelte +144 -0
  22. package/dist/SvSheetGoalSeek.svelte.d.ts +12 -0
  23. package/dist/SvSheetInsertFunction.svelte +147 -0
  24. package/dist/SvSheetInsertFunction.svelte.d.ts +8 -0
  25. package/dist/SvSheetListPicker.svelte +89 -0
  26. package/dist/SvSheetListPicker.svelte.d.ts +16 -0
  27. package/dist/SvSheetManageRules.svelte +185 -0
  28. package/dist/SvSheetManageRules.svelte.d.ts +16 -0
  29. package/dist/SvSheetNameManager.svelte +225 -0
  30. package/dist/SvSheetNameManager.svelte.d.ts +11 -0
  31. package/dist/SvSheetPasteSpecial.svelte +105 -0
  32. package/dist/SvSheetPasteSpecial.svelte.d.ts +12 -0
  33. package/dist/SvSheetRemoveDuplicates.svelte +149 -0
  34. package/dist/SvSheetRemoveDuplicates.svelte.d.ts +12 -0
  35. package/dist/SvSheetRibbon.svelte +1201 -0
  36. package/dist/SvSheetRibbon.svelte.d.ts +34 -0
  37. package/dist/SvSheetSizeDialog.svelte +58 -0
  38. package/dist/SvSheetSizeDialog.svelte.d.ts +11 -0
  39. package/dist/SvSheetTabs.svelte +441 -0
  40. package/dist/SvSheetTabs.svelte.d.ts +36 -0
  41. package/dist/SvSheetTabs.test-harness.svelte.d.ts +17 -0
  42. package/dist/SvSheetTabs.test-harness.svelte.js +22 -0
  43. package/dist/SvSheetTextToColumns.svelte +172 -0
  44. package/dist/SvSheetTextToColumns.svelte.d.ts +13 -0
  45. package/dist/SvSheetValidationAlert.svelte +83 -0
  46. package/dist/SvSheetValidationAlert.svelte.d.ts +15 -0
  47. package/dist/cdn/svgrid-enterprise.svelte-external.js +18997 -5396
  48. package/dist/designer/assets/GridMenus-BlsvL_aU.js +8 -0
  49. package/dist/designer/assets/SvChartMenu-BYO9cYdy.css +1 -0
  50. package/dist/designer/assets/SvChartMenu-D9hEeHar.js +1 -0
  51. package/dist/designer/assets/SvDateRangeInput-BBRzrQeg.js +1 -0
  52. package/dist/designer/assets/SvDateTimePicker-DARvKUL2.js +1 -0
  53. package/dist/designer/assets/SvGridCellEditor-C7uQXYds.js +4 -0
  54. package/dist/designer/assets/SvGridChart-B8j1SSy3.js +3 -0
  55. package/dist/designer/assets/SvGridChart-BgLuPO7I.css +1 -0
  56. package/dist/designer/assets/SvGridChartBuilder-08YWWeqY.css +1 -0
  57. package/dist/designer/assets/SvGridChartBuilder-kvyIU_Rl.js +1 -0
  58. package/dist/designer/assets/SvGridChartPanel-4Pc8y5yO.css +1 -0
  59. package/dist/designer/assets/SvGridChartPanel-pT6ITc2P.js +4 -0
  60. package/dist/designer/assets/{SvGridChartView-DUc-1RUf.css → SvGridChartView-7msfnWZT.css} +1 -1
  61. package/dist/designer/assets/SvGridChartView-bg281UA1.js +1 -0
  62. package/dist/designer/assets/SvListBox-BDS66lmZ.js +110 -0
  63. package/dist/designer/assets/SvMenuList-DJ47ba1h.css +1 -0
  64. package/dist/designer/assets/SvMenuList-Dgq2D5VN.js +1 -0
  65. package/dist/designer/assets/SvTabs-DKmwb5p1.css +1 -0
  66. package/dist/designer/assets/SvTabs-UFCMTHXS.js +1 -0
  67. package/dist/designer/assets/chart-cIPUsbM5.js +1 -0
  68. package/dist/designer/assets/chart-export-B6bkQ3X8.js +11 -0
  69. package/dist/designer/assets/chart-export-pdf-BbA28-gt.js +11 -0
  70. package/dist/designer/assets/chart-panel-messages-DtTxpBUU.js +1 -0
  71. package/dist/designer/assets/chart-summary-Czu_5epb.js +1 -0
  72. package/dist/designer/assets/chart-trend-D5I5VEe8.js +1 -0
  73. package/dist/designer/assets/chart-validate-BMqM-qkF.js +1 -0
  74. package/dist/designer/assets/column-resize-BYDzR1Ve.js +1 -0
  75. package/dist/designer/assets/date-format-B8JbEtIG.js +1 -0
  76. package/dist/designer/assets/date-format-DKS-z0xS.css +1 -0
  77. package/dist/designer/assets/editor-contract-Bpoa7A5g.js +1 -0
  78. package/dist/designer/assets/focus-trap-CAreAhlU.js +1 -0
  79. package/dist/designer/assets/index-CMFgAoVV.css +1 -0
  80. package/dist/designer/assets/{index-C_a9Cj8Y.js → index-DwU7CAMm.js} +291 -290
  81. package/dist/designer/assets/list-option-BP_dWS66.js +1 -0
  82. package/dist/designer/assets/row-resize-DLktcqUK.js +1 -0
  83. package/dist/designer/assets/src-CITpcm6b.js +1 -0
  84. package/dist/designer/assets/src-EdI3Xqds.js +58 -0
  85. package/dist/designer/index.html +23 -14
  86. package/dist/export-pdf.d.ts +89 -0
  87. package/dist/export-pdf.js +130 -0
  88. package/dist/export.js +17 -10
  89. package/dist/index.d.ts +64 -1
  90. package/dist/index.js +68 -1
  91. package/dist/install.js +5 -0
  92. package/dist/node/studio.js +64 -2
  93. package/dist/pivot-chart.d.ts +25 -1
  94. package/dist/pivot-chart.js +25 -69
  95. package/dist/sheet/address.d.ts +43 -0
  96. package/dist/sheet/address.js +81 -0
  97. package/dist/sheet/ast.d.ts +94 -0
  98. package/dist/sheet/ast.js +56 -0
  99. package/dist/sheet/auto-filter.d.ts +66 -0
  100. package/dist/sheet/auto-filter.js +147 -0
  101. package/dist/sheet/autocomplete.d.ts +42 -0
  102. package/dist/sheet/autocomplete.js +162 -0
  103. package/dist/sheet/coerce.d.ts +31 -0
  104. package/dist/sheet/coerce.js +122 -0
  105. package/dist/sheet/commands.d.ts +89 -0
  106. package/dist/sheet/commands.js +230 -0
  107. package/dist/sheet/comments.d.ts +29 -0
  108. package/dist/sheet/comments.js +73 -0
  109. package/dist/sheet/conditional-formats.d.ts +144 -0
  110. package/dist/sheet/conditional-formats.js +316 -0
  111. package/dist/sheet/deps.d.ts +60 -0
  112. package/dist/sheet/deps.js +199 -0
  113. package/dist/sheet/document.d.ts +150 -0
  114. package/dist/sheet/document.js +264 -0
  115. package/dist/sheet/edit-keys.d.ts +14 -0
  116. package/dist/sheet/edit-keys.js +40 -0
  117. package/dist/sheet/entry.d.ts +31 -0
  118. package/dist/sheet/entry.js +76 -0
  119. package/dist/sheet/evaluate.d.ts +61 -0
  120. package/dist/sheet/evaluate.js +337 -0
  121. package/dist/sheet/find-replace.d.ts +62 -0
  122. package/dist/sheet/find-replace.js +152 -0
  123. package/dist/sheet/format-store.d.ts +99 -0
  124. package/dist/sheet/format-store.js +233 -0
  125. package/dist/sheet/freeze.d.ts +54 -0
  126. package/dist/sheet/freeze.js +58 -0
  127. package/dist/sheet/function-catalog.d.ts +10 -0
  128. package/dist/sheet/function-catalog.js +94 -0
  129. package/dist/sheet/functions.d.ts +28 -0
  130. package/dist/sheet/functions.js +362 -0
  131. package/dist/sheet/goal-seek.d.ts +73 -0
  132. package/dist/sheet/goal-seek.js +153 -0
  133. package/dist/sheet/index.d.ts +53 -0
  134. package/dist/sheet/index.js +53 -0
  135. package/dist/sheet/merges.d.ts +71 -0
  136. package/dist/sheet/merges.js +137 -0
  137. package/dist/sheet/names.d.ts +31 -0
  138. package/dist/sheet/names.js +87 -0
  139. package/dist/sheet/navigate.d.ts +52 -0
  140. package/dist/sheet/navigate.js +135 -0
  141. package/dist/sheet/number-format.d.ts +63 -0
  142. package/dist/sheet/number-format.js +508 -0
  143. package/dist/sheet/palette.d.ts +19 -0
  144. package/dist/sheet/palette.js +84 -0
  145. package/dist/sheet/parse.d.ts +13 -0
  146. package/dist/sheet/parse.js +108 -0
  147. package/dist/sheet/paste-special.d.ts +164 -0
  148. package/dist/sheet/paste-special.js +592 -0
  149. package/dist/sheet/protection.d.ts +21 -0
  150. package/dist/sheet/protection.js +48 -0
  151. package/dist/sheet/rects.d.ts +45 -0
  152. package/dist/sheet/rects.js +112 -0
  153. package/dist/sheet/refs.d.ts +82 -0
  154. package/dist/sheet/refs.js +266 -0
  155. package/dist/sheet/ribbon-icons.d.ts +31 -0
  156. package/dist/sheet/ribbon-icons.js +350 -0
  157. package/dist/sheet/ribbon.d.ts +173 -0
  158. package/dist/sheet/ribbon.js +753 -0
  159. package/dist/sheet/shortcuts.d.ts +164 -0
  160. package/dist/sheet/shortcuts.js +623 -0
  161. package/dist/sheet/structure.d.ts +87 -0
  162. package/dist/sheet/structure.js +166 -0
  163. package/dist/sheet/tables.d.ts +70 -0
  164. package/dist/sheet/tables.js +147 -0
  165. package/dist/sheet/tokenize.d.ts +54 -0
  166. package/dist/sheet/tokenize.js +304 -0
  167. package/dist/sheet/transforms.d.ts +76 -0
  168. package/dist/sheet/transforms.js +154 -0
  169. package/dist/sheet/validation.d.ts +92 -0
  170. package/dist/sheet/validation.js +241 -0
  171. package/dist/sheet/workbook.d.ts +72 -0
  172. package/dist/sheet/workbook.js +409 -0
  173. package/dist/sheet-enable.d.ts +6 -0
  174. package/dist/sheet-enable.js +46 -0
  175. package/dist/studio/ui-components.generated.js +63 -1
  176. package/dist/version.d.ts +1 -1
  177. package/dist/version.js +1 -1
  178. package/package.json +9 -4
  179. package/dist/designer/assets/GridMenus-B1JtIN21.js +0 -8
  180. package/dist/designer/assets/SvDateRangeInput-CjO7nn_x.js +0 -1
  181. package/dist/designer/assets/SvDateTimePicker-ByBD_ov6.js +0 -1
  182. package/dist/designer/assets/SvField-YDLipR6O.css +0 -1
  183. package/dist/designer/assets/SvField-cj1PFNgZ.js +0 -1
  184. package/dist/designer/assets/SvGridCellEditor-0W1L2hJ1.js +0 -2
  185. package/dist/designer/assets/SvGridChart-DBOR4xcz.js +0 -2
  186. package/dist/designer/assets/SvGridChart-fkMWeh1J.css +0 -1
  187. package/dist/designer/assets/SvGridChartPanel-symrhNnR.js +0 -11
  188. package/dist/designer/assets/SvGridChartView-BmRxq6mU.js +0 -1
  189. package/dist/designer/assets/SvListBox-1oUF6Iav.js +0 -110
  190. package/dist/designer/assets/chart-DXFganU8.js +0 -1
  191. package/dist/designer/assets/column-resize-C_inr5zT.js +0 -1
  192. package/dist/designer/assets/date-format-DGagAqRc.css +0 -1
  193. package/dist/designer/assets/date-format-onlYDsrY.js +0 -1
  194. package/dist/designer/assets/easing-zaypKrr0.js +0 -3
  195. package/dist/designer/assets/index-k2stW6L8.css +0 -1
  196. package/dist/designer/assets/row-resize-B0FWHcNr.js +0 -1
  197. package/dist/designer/assets/src-D9p27OGC.js +0 -58
@@ -0,0 +1,164 @@
1
+ /**
2
+ * The Excel keymap, as a table rather than an if-chain, so the bindings can be
3
+ * read in one screen and tested as data.
4
+ *
5
+ * Matching is exact on modifiers: a binding that does not ask for shift will
6
+ * not fire when shift is held. Without that, Ctrl+Shift+Arrow would match the
7
+ * Ctrl+Arrow binding and the extend-selection variant would be unreachable.
8
+ */
9
+ import type { GridCommandContext } from '@svgrid/grid/shortcuts';
10
+ import { type Direction, type Grid, type Rect } from './navigate.js';
11
+ import { type FormatPresetName } from './number-format.js';
12
+ import type { SheetFormatStore, CellAddressLookup, CellFormatEntry } from './format-store.js';
13
+ import type { Workbook } from './workbook.js';
14
+ export type SheetCommand = (cmd: GridCommandContext, event: KeyboardEvent) => boolean;
15
+ /**
16
+ * What the formatting commands write to, and how they turn a display position
17
+ * into the stable ids the store keys on.
18
+ *
19
+ * Optional because the shortcuts are useful without it: a grid that only wants
20
+ * navigation and fill never sets one up, and the format bindings decline
21
+ * rather than half-working.
22
+ */
23
+ export type SheetFormatTarget = {
24
+ store: SheetFormatStore;
25
+ lookup: CellAddressLookup;
26
+ /** Called after a change so the consumer can re-render. */
27
+ onChange?(): void;
28
+ /**
29
+ * Whether the rectangles may be formatted. A protected sheet says no for
30
+ * a selection with a locked cell in it; the ribbon greys its buttons on
31
+ * the same answer, so it must be cheap and must not talk to the user.
32
+ */
33
+ guard?(rects: ReadonlyArray<Rect>): boolean;
34
+ /** Called when a change was refused by `guard`: the place to say why. */
35
+ refused?(): void;
36
+ };
37
+ /** The guard's answer, with the refusal reported when it is no. */
38
+ export declare function formatAllowed(target: SheetFormatTarget, rects: ReadonlyArray<Rect>): boolean;
39
+ /** Attach the store the formatting shortcuts write to. */
40
+ export declare function setFormatTarget(target: SheetFormatTarget | null): void;
41
+ export declare function getFormatTarget(): SheetFormatTarget | null;
42
+ export declare function setWorkbook(next: Workbook | null, onChange?: () => void): void;
43
+ export declare function getWorkbook(): Workbook | null;
44
+ /** Move `delta` sheets from the active one. Excel does NOT wrap at the ends,
45
+ * so neither does this: hitting the last sheet and pressing again should
46
+ * leave you there rather than teleport you to the first. */
47
+ export declare function switchSheet(delta: number): boolean;
48
+ export declare function setPasteSpecialHandler(fn: ((cmd: GridCommandContext) => void) | null): void;
49
+ export declare function setFindReplaceHandler(fn: ((cmd: GridCommandContext) => void) | null): void;
50
+ /** Called when Ctrl+1 fires, so a consumer can open its own dialog. The
51
+ * shortcut layer does not ship one: what a Format Cells dialog should look
52
+ * like is a design decision, not a keyboard one. */
53
+ /**
54
+ * Ribbon actions a key raises: F9 recalculates, Ctrl+` shows formulas,
55
+ * Ctrl+Shift+L toggles the filter, Shift+F3 and Ctrl+F3 open Insert
56
+ * Function and the Name Manager, Ctrl+T formats as a table. The shell
57
+ * answers them the way it answers the ribbon button; returning false means
58
+ * nothing is behind the action and the key falls through.
59
+ */
60
+ export type RibbonKeyAction = 'recalculate' | 'toggle-formulas' | 'toggle-filter' | 'insert-function' | 'name-manager' | 'insert-table' | 'hide-rows' | 'hide-columns' | 'unhide-rows' | 'unhide-columns' | 'edit-comment' | 'open-list' | 'toggle-ribbon' | 'merge-center' | 'merge-across' | 'merge-cells' | 'unmerge-cells';
61
+ export declare function setRibbonActionHandler(fn: ((action: RibbonKeyAction, cmd: GridCommandContext) => boolean) | null): void;
62
+ /** Raise a ribbon action from a button whose face is not an entry of its own. */
63
+ export declare function raiseRibbonAction(action: RibbonKeyAction, cmd: GridCommandContext): boolean;
64
+ /** Excel's size ladder. Pixels here, since that is what the cell renders. */
65
+ export declare const FONT_SIZES: number[];
66
+ /** A cell with no size of its own renders at the grid's 13px. */
67
+ export declare const DEFAULT_FONT_SIZE = 13;
68
+ /** The format entry under the active cell, or undefined. */
69
+ export declare function activeEntry(cmd: GridCommandContext): CellFormatEntry | undefined;
70
+ /** Excel's Increase / Decrease Font Size: the next rung of the ladder. */
71
+ export declare function nudgeFontSize(direction: 1 | -1): SheetCommand;
72
+ export declare function setFormatDialogHandler(fn: ((cmd: GridCommandContext) => void) | null): void;
73
+ export type SheetBinding = {
74
+ /** Matched case-insensitively against `event.key`. */
75
+ key: string;
76
+ /**
77
+ * Matched against `event.code` INSTEAD of `key`, for bindings where shift
78
+ * changes the character. Pressing Ctrl+Shift+1 reports `event.key` as '!'
79
+ * on a US layout, ':' for Ctrl+Shift+; and '~' for Ctrl+Shift+`, so a
80
+ * binding spelling the unshifted character can never fire in a browser.
81
+ * `code` is the physical key and does not move.
82
+ */
83
+ code?: string;
84
+ /** Ctrl on Windows/Linux, Cmd on macOS. Both are accepted for either. */
85
+ mod?: boolean;
86
+ shift?: boolean;
87
+ alt?: boolean;
88
+ /**
89
+ * Runs while a cell is being edited, and only then. The other bindings
90
+ * act on the selection and stay out of the editor, where Ctrl+D is a
91
+ * keystroke the user meant for the text.
92
+ */
93
+ editing?: boolean;
94
+ run: SheetCommand;
95
+ /** For docs and the demo's cheat sheet. */
96
+ label: string;
97
+ };
98
+ /** Read the grid through the command context as a blank-aware matrix. */
99
+ export declare function gridOf(cmd: GridCommandContext): Grid;
100
+ /**
101
+ * Ctrl+End: the bottom-right corner of what has been typed, as in Excel,
102
+ * rather than the grid's last cell. A sheet has thousands of empty rows
103
+ * below the data, and the last of them is never where the user wanted to
104
+ * go. Ctrl+Home is the grid's own and already lands on A1.
105
+ */
106
+ export declare function lastUsedCell(cmd: GridCommandContext): {
107
+ row: number;
108
+ col: number;
109
+ };
110
+ export declare const goToLastUsed: SheetCommand;
111
+ /** F4 while editing: turn the reference at the caret through its anchorings. */
112
+ export declare const pinReference: SheetCommand;
113
+ export declare function move(dir: Direction, extend: boolean): SheetCommand;
114
+ /** Ctrl+A: the current region, then the whole sheet on a second press. */
115
+ export declare const selectRegion: SheetCommand;
116
+ /**
117
+ * Ctrl+Space / Shift+Space: the whole columns or rows the selection
118
+ * touches (B2:C3 gives rows 2:3), as in Excel; the active cell stays.
119
+ */
120
+ export declare function selectLine(axis: 'column' | 'row'): SheetCommand;
121
+ /** Ctrl+Shift+8 (Ctrl+*): the current region, and only that. */
122
+ export declare const selectCurrentRegion: SheetCommand;
123
+ /**
124
+ * Run a format change over `rects` as ONE undo step.
125
+ *
126
+ * The format store is not the grid's data, so a write to it is invisible
127
+ * to Ctrl+Z on its own: Bold would land and the Undo button would stay
128
+ * grey, which is not how a spreadsheet behaves. This snapshots every cell
129
+ * the change touches before and after, and hands the grid a step that puts
130
+ * either snapshot back. A cell's whole entry is restored rather than the
131
+ * one field, so undoing "bold" on a cell that was also made red does not
132
+ * have to know which of the two the press was about.
133
+ */
134
+ export declare function withFormatUndo(cmd: GridCommandContext, target: SheetFormatTarget, rects: ReadonlyArray<Rect>, mutate: () => void): void;
135
+ /** Apply a patch to the selection through the attached store. */
136
+ export declare function applyFormat(cmd: GridCommandContext, patch: CellFormatEntry): boolean;
137
+ export declare function toggleFormat(cmd: GridCommandContext, field: 'bold' | 'italic' | 'underline' | 'strike'): boolean;
138
+ export type BorderPreset = 'none' | 'bottom' | 'top' | 'left' | 'right' | 'all' | 'outside' | 'thick-bottom';
139
+ /**
140
+ * Excel's Borders menu, applied the way Excel applies it: "Bottom Border"
141
+ * puts a line under the bottom edge of the SELECTION, not under every
142
+ * cell; "All Borders" lines every cell; "Outside" frames the block. Sides
143
+ * merge with what a cell already has, so a top border does not erase a
144
+ * bottom one, and "No Border" clears all four.
145
+ */
146
+ export declare function applyBorders(cmd: GridCommandContext, preset: BorderPreset): boolean;
147
+ /** Excel's Clear Formats: drop every format on the selection, keep the values. */
148
+ export declare function clearFormats(cmd: GridCommandContext): boolean;
149
+ export declare function preset(name: FormatPresetName): SheetCommand;
150
+ /** Alt+=. Inserts =SUM(range) over the run Excel would guess. */
151
+ export declare const autoSum: SheetCommand;
152
+ export declare const SHEET_BINDINGS: ReadonlyArray<SheetBinding>;
153
+ export declare function structural(cmd: GridCommandContext, kind: 'insert' | 'delete'): boolean;
154
+ /**
155
+ * The handler registered with the grid. Returns true when a binding ran, which
156
+ * is what tells the grid to stop and not interpret the key itself.
157
+ *
158
+ * A binding marked `editing` runs only inside the editor and the others
159
+ * only outside it: Ctrl+D while someone is typing in a cell is a keystroke
160
+ * they meant for the text, and F4 on the grid root has nothing to pin.
161
+ * Alt+Enter needs no binding: the grid's multiline text editor takes it as
162
+ * a line break itself.
163
+ */
164
+ export declare function handleSheetKey(event: KeyboardEvent, cmd: GridCommandContext): boolean;