@xlcalc/vue 0.0.0-stage → 0.21.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 (125) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE +21 -0
  3. package/README.md +75 -2
  4. package/dist/abort.d.ts +6 -0
  5. package/dist/components/CellDraft.vue.d.ts +7 -0
  6. package/dist/components/CellEditor.vue.d.ts +3 -0
  7. package/dist/components/ColourSwatches.vue.d.ts +13 -0
  8. package/dist/components/DialogShell.vue.d.ts +37 -0
  9. package/dist/components/ExplainPanel.vue.d.ts +3 -0
  10. package/dist/components/FilterPopover.vue.d.ts +3 -0
  11. package/dist/components/FindBar.vue.d.ts +3 -0
  12. package/dist/components/FormatBorders.vue.d.ts +14 -0
  13. package/dist/components/FormatColour.vue.d.ts +19 -0
  14. package/dist/components/FormatDialog.vue.d.ts +24 -0
  15. package/dist/components/FormulaBar.vue.d.ts +3 -0
  16. package/dist/components/FunctionList.vue.d.ts +28 -0
  17. package/dist/components/FunctionTip.vue.d.ts +14 -0
  18. package/dist/components/InsertFunction.vue.d.ts +9 -0
  19. package/dist/components/OutlineCell.vue.d.ts +8 -0
  20. package/dist/components/OutlineLevels.vue.d.ts +7 -0
  21. package/dist/components/SheetGrid.vue.d.ts +3 -0
  22. package/dist/components/SheetMarks.vue.d.ts +3 -0
  23. package/dist/components/SheetMenu.vue.d.ts +3 -0
  24. package/dist/components/SheetRow.vue.d.ts +18 -0
  25. package/dist/components/SheetTabs.vue.d.ts +3 -0
  26. package/dist/components/SheetToolbar.vue.d.ts +43 -0
  27. package/dist/components/SheetView.vue.d.ts +56 -0
  28. package/dist/components/ValidationAlert.vue.d.ts +16 -0
  29. package/dist/components/ValidationDropdown.vue.d.ts +33 -0
  30. package/dist/components/ValidationPrompt.vue.d.ts +16 -0
  31. package/dist/components/cf-icons.d.ts +6 -0
  32. package/dist/components/context.d.ts +4 -0
  33. package/dist/components/dom.d.ts +7 -0
  34. package/dist/components/icons.d.ts +33 -0
  35. package/dist/components/popup.d.ts +29 -0
  36. package/dist/components/toolbar-icons.d.ts +24 -0
  37. package/dist/contract/memory.d.ts +108 -0
  38. package/dist/contract/messages.d.ts +260 -0
  39. package/dist/contract/source.d.ts +433 -0
  40. package/dist/contract/view.d.ts +108 -0
  41. package/dist/contract.d.ts +9 -0
  42. package/dist/core/ask.d.ts +2 -0
  43. package/dist/core/autocomplete.d.ts +28 -0
  44. package/dist/core/cell-style.d.ts +33 -0
  45. package/dist/core/cell-view.d.ts +104 -0
  46. package/dist/core/clip.d.ts +43 -0
  47. package/dist/core/commands.d.ts +47 -0
  48. package/dist/core/conditional.d.ts +16 -0
  49. package/dist/core/editing.d.ts +85 -0
  50. package/dist/core/explain.d.ts +36 -0
  51. package/dist/core/fill.d.ts +42 -0
  52. package/dist/core/filter.d.ts +72 -0
  53. package/dist/core/find.d.ts +53 -0
  54. package/dist/core/formula.d.ts +41 -0
  55. package/dist/core/function-tip.d.ts +34 -0
  56. package/dist/core/geometry.d.ts +55 -0
  57. package/dist/core/keys.d.ts +8 -0
  58. package/dist/core/list-keys.d.ts +4 -0
  59. package/dist/core/list.d.ts +17 -0
  60. package/dist/core/menu.d.ts +155 -0
  61. package/dist/core/merge.d.ts +19 -0
  62. package/dist/core/navigation.d.ts +72 -0
  63. package/dist/core/outline.d.ts +34 -0
  64. package/dist/core/point.d.ts +34 -0
  65. package/dist/core/ref-paint.d.ts +21 -0
  66. package/dist/core/selection.d.ts +45 -0
  67. package/dist/core/sheet.d.ts +774 -0
  68. package/dist/core/state.d.ts +107 -0
  69. package/dist/core/storage.d.ts +6 -0
  70. package/dist/core/totals.d.ts +16 -0
  71. package/dist/core/validation.d.ts +95 -0
  72. package/dist/core/viewport.d.ts +83 -0
  73. package/dist/core/windows.d.ts +102 -0
  74. package/dist/entry.d.ts +3 -0
  75. package/dist/failure.d.ts +5 -0
  76. package/dist/filter-key.d.ts +3 -0
  77. package/dist/find-match.d.ts +24 -0
  78. package/dist/format-cells.d.ts +85 -0
  79. package/dist/frame.d.ts +5 -0
  80. package/dist/grid-ref.d.ts +3 -0
  81. package/dist/index.d.ts +6 -0
  82. package/dist/index.js +12767 -0
  83. package/dist/lines.d.ts +16 -0
  84. package/dist/local/find.d.ts +15 -0
  85. package/dist/local/index.d.ts +3 -0
  86. package/dist/local/locale.d.ts +5 -0
  87. package/dist/local/outcome.d.ts +21 -0
  88. package/dist/local/query.d.ts +23 -0
  89. package/dist/local/source.d.ts +4 -0
  90. package/dist/local/types.d.ts +37 -0
  91. package/dist/local/validation.d.ts +8 -0
  92. package/dist/local/window.d.ts +16 -0
  93. package/dist/local/xlsx.d.ts +23 -0
  94. package/dist/local.js +1025 -0
  95. package/dist/locale-ref.d.ts +7 -0
  96. package/dist/locales.d.ts +3 -0
  97. package/dist/memory-outline.d.ts +31 -0
  98. package/dist/memory-query.d.ts +26 -0
  99. package/dist/memory-source.d.ts +3 -0
  100. package/dist/memory-validation.d.ts +17 -0
  101. package/dist/messages.d.ts +6 -0
  102. package/dist/number-formats.d.ts +13 -0
  103. package/dist/rect.d.ts +9 -0
  104. package/dist/ru-RU-BVeg6JGM.js +931 -0
  105. package/dist/sheet-query.d.ts +22 -0
  106. package/dist/stats.d.ts +8 -0
  107. package/dist/style.css +2 -0
  108. package/dist/toolbar.d.ts +39 -0
  109. package/dist/typed-entry-2l9Ay-hV.js +4559 -0
  110. package/dist/window-size.d.ts +4 -0
  111. package/docs/api.md +520 -0
  112. package/docs/autocomplete.md +60 -0
  113. package/docs/checks.md +40 -0
  114. package/docs/clipboard.md +48 -0
  115. package/docs/editing.md +97 -0
  116. package/docs/example-app.md +26 -0
  117. package/docs/find-replace.md +26 -0
  118. package/docs/list-mode.md +86 -0
  119. package/docs/local.md +94 -0
  120. package/docs/quick-start.md +221 -0
  121. package/docs/sheets.md +61 -0
  122. package/docs/toolbar.md +72 -0
  123. package/docs/validation.md +41 -0
  124. package/docs/view.md +50 -0
  125. package/package.json +92 -4
@@ -0,0 +1,7 @@
1
+ import { type ShallowRef } from 'vue';
2
+ import type { Locale } from 'xlcalc/contract';
3
+ /**
4
+ * The locale object of `tag()`: null while its module loads; undefined for a tag the package has no module for (en-US)
5
+ * and for a module that failed to load, which is treated as en-US. A module that arrives after the tag changed is discarded.
6
+ */
7
+ export declare function useLocaleModule(tag: () => string | undefined): ShallowRef<Locale | undefined | null>;
@@ -0,0 +1,3 @@
1
+ import type { Locale } from 'xlcalc/contract';
2
+ /** Each a dynamic import a bundler can see: the main entry point ships it as a separate chunk, `./local` leaves it to the host's xlcalc. */
3
+ export declare const LOCALE_MODULES: Readonly<Record<string, () => Promise<Locale>>>;
@@ -0,0 +1,31 @@
1
+ import type { OutlineEditOp, OutlineGroup as BookGroup, OutlineSettings, SheetInput } from 'xlcalc/contract';
2
+ import { type LineAxis } from './lines.js';
3
+ import type { OutlineChange, SheetOutline } from './contract/source.js';
4
+ /** One axis's rows or columns as `memorySource` stores them, one by one: outline levels, collapsed flags and hidden ones. */
5
+ export interface AxisLines {
6
+ levels: Map<number, number>;
7
+ marks: Set<number>;
8
+ hidden: Set<number>;
9
+ }
10
+ /** The summary settings alone, as xlcalc takes them: an omitted field is Excel's default. */
11
+ export declare function outlineSettings(o?: OutlineSettings | null): OutlineSettings;
12
+ /** A sheet's rows and columns on both axes as xlcalc's outline reads them, with its summaries where the settings put them. */
13
+ export declare function outlineSheet(axes: Record<LineAxis, AxisLines>, settings?: OutlineSettings | null): Pick<SheetInput, 'rows' | 'columns' | 'outline'>;
14
+ /** A sheet's outline in the contract's terms from xlcalc's groups on both axes; none for a sheet without groups. */
15
+ export declare function outlineOf(groups: Record<LineAxis, BookGroup[]>, settings?: OutlineSettings | null): SheetOutline | undefined;
16
+ /**
17
+ * The component's outline command as xlcalc's, or why there is none. A group's button is Show or Hide Detail at its summary
18
+ * row or column, with the group found among the axis's groups by its rows or columns and level; a group at the edge of the
19
+ * sheet has no summary row or column and, as in Excel, no button.
20
+ */
21
+ export declare function outlineOp(change: OutlineChange, groups: (axis: LineAxis) => readonly BookGroup[]): OutlineEditOp | {
22
+ refused: string;
23
+ };
24
+ /**
25
+ * Runs an outline command on the rows or columns of its axis as xlcalc's `outlineEdit` does, changing them in place; returns
26
+ * Excel's rejection in English with xlcalc's code, or null. A command xlcalc cannot parse (a level button beyond 8) throws its `InputError`.
27
+ */
28
+ export declare function outlineCommand(lines: AxisLines, settings: OutlineSettings | null | undefined, change: OutlineChange): {
29
+ code?: string;
30
+ message: string;
31
+ } | null;
@@ -0,0 +1,26 @@
1
+ import type { CellRect } from 'xlcalc/contract';
2
+ import { type CellText } from './find-match.js';
3
+ import { type QuerySheet } from './sheet-query.js';
4
+ import type { FindRequest, FindResult, RangeStats, SheetFilter } from './contract/source.js';
5
+ /** What the queries read of a sheet: what the display filter reads, and for search where its columns end and what each cell opens with. */
6
+ export interface MemorySheetQuery extends QuerySheet {
7
+ maxCol: number;
8
+ /** The text a cell opens with: its formula, otherwise its value as typed. */
9
+ editAt(row: number, col: number): string;
10
+ }
11
+ /** The sheet's rows in display order: the header first, then the rows that match the conditions, sorted; null without conditions. */
12
+ export declare function visibleList(sheet: MemorySheetQuery, filter: SheetFilter | undefined): number[] | null;
13
+ /** A column's displayed values with their counts, over the rows the other columns' conditions keep; '' is an empty cell. */
14
+ export declare function columnList(sheet: MemorySheetQuery, col: number, filter: SheetFilter): {
15
+ values: {
16
+ text: string;
17
+ count: number;
18
+ }[];
19
+ more: number;
20
+ };
21
+ /** Excel's Find: matches in its order, only the visible rows under a filter. */
22
+ export declare function findHits(sheet: MemorySheetQuery, req: FindRequest): FindResult;
23
+ /** Excel's Replace All: the new text of each cell the request finds in formulas, as Excel replaces whatever Look in says. */
24
+ export declare function replaceTexts(sheet: MemorySheetQuery, req: FindRequest, by: string): CellText[];
25
+ /** Totals of a range as in Excel's status bar, over the visible rows under a filter. */
26
+ export declare function rangeStats(sheet: MemorySheetQuery, rect: CellRect, filter: SheetFilter | undefined): RangeStats;
@@ -0,0 +1,3 @@
1
+ import type { MemoryBook, MemorySource, MemorySourceOptions } from './contract/memory.js';
2
+ /** A source over `book`; the workbook's objects are copied, and edits change the copy. */
3
+ export declare function memorySource(book: MemoryBook, options?: MemorySourceOptions): MemorySource;
@@ -0,0 +1,17 @@
1
+ import type { CellEntry, EditOutcome, SheetValidation } from './contract/source.js';
2
+ import type { MemoryValidation } from './contract/memory.js';
3
+ /** A number as the in-memory workbook parses a typed one: digits, a minus sign and a decimal point, nothing else. */
4
+ export declare const PLAIN_NUMBER: RegExp;
5
+ /** A sheet's rules with their ranges, parsed once. */
6
+ export declare class MemoryRules {
7
+ private readonly rules;
8
+ constructor(rules?: MemoryValidation[]);
9
+ /** The rule that applies to a cell (the first, since no two rules on a sheet overlap in Excel). */
10
+ at(cell: string): MemoryValidation | null;
11
+ /** What the cell displays of its rule: the list's items and the input message; null without a rule. */
12
+ show(cell: string): SheetValidation | null;
13
+ }
14
+ /** The alert of the strictest rule that typed entries violate, the first of that style, as a rejection; null when all are accepted. */
15
+ export declare function memoryRefusal(entries: CellEntry[], rulesOf: (sheet: string) => MemoryRules | undefined): Extract<EditOutcome, {
16
+ ok: false;
17
+ }> | null;
@@ -0,0 +1,6 @@
1
+ import { type ComputedRef } from 'vue';
2
+ import type { SheetMessages } from './contract/messages.js';
3
+ export declare const enMessages: SheetMessages;
4
+ export declare const ruMessages: SheetMessages;
5
+ /** A component's texts: the English set overridden by the part a host passed. */
6
+ export declare function useMessages(part: () => Partial<SheetMessages> | undefined): ComputedRef<SheetMessages>;
@@ -0,0 +1,13 @@
1
+ import { type ComputedRef } from 'vue';
2
+ import type { FormatChoice, NumberFormatCategory } from 'xlcalc/contract';
3
+ export interface NumberFormats {
4
+ /** The list's items in Excel's order, each with its name, the format it applies and that format's code; empty while the locale loads. */
5
+ choices: ComputedRef<FormatChoice[]>;
6
+ /** The category the box shows for a code (General without one); null while the locale loads. */
7
+ categoryOf: (code: string | undefined) => NumberFormatCategory | null;
8
+ }
9
+ /**
10
+ * The box in the workbook's locale (`SheetView`'s `locale`, en-US without one): one of the package's locales loads as a
11
+ * separate chunk, as the grid's formula text does; a tag the package has no module for is treated as en-US.
12
+ */
13
+ export declare function useNumberFormats(tag: () => string | undefined): NumberFormats;
package/dist/rect.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import type { CellPosition, CellRect } from 'xlcalc/contract';
2
+ /** The range of a single cell. */
3
+ export declare const cellRect: (row: number, col: number) => CellRect;
4
+ /** The range two corners span, in any order. */
5
+ export declare const rectOf: (a: CellPosition, b: CellPosition) => CellRect;
6
+ /** The smallest range containing both. */
7
+ export declare const unionRect: (a: CellRect, b: CellRect) => CellRect;
8
+ /** `v` clamped to `lo`..`hi`. */
9
+ export declare const clamp: (v: number, lo: number, hi: number) => number;