@sheetxl/sdk 0.7.28-beta.2 → 0.7.28-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.
- package/browser/cjs/1mH2uhx_Dmceu88H.cjs +33 -0
- package/browser/cjs/B4PKKgaDTG9aSO-f.cjs +1 -0
- package/browser/cjs/{CQf4zxkBmheTVbjX.cjs → BX6A6xGDOr_td9mw.cjs} +2 -2
- package/browser/cjs/{BG7YDVxiC4ErxvF1.cjs → CWCKcp58KidyndaL.cjs} +1 -1
- package/browser/cjs/{BREMLtxkQhtNSVra.cjs → D6cjnwWR_iUSe1f6.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{CZO1RubmqnJV96rq.mjs → B1gpnr-7kLU7jTy-.mjs} +2 -2
- package/browser/esm/{CB_4gdPPPruwremH.mjs → C78IaCXqwCcraBPe.mjs} +5055 -4959
- package/browser/esm/{DRWu3TmcE9JFf78V.mjs → CPgz9_iM7xyAcytg.mjs} +2 -2
- package/browser/esm/{DN4d5bDBkti28wuc.mjs → CX1NO_a1QPjXDvTU.mjs} +213 -207
- package/browser/esm/{vHWuKF-ftK7LM1uw.mjs → DZfds6s3ayTZrozO.mjs} +1 -1
- package/browser/esm/{DPOelA1J3WHbMXyh.mjs → Dv8FyXyeygJPXoHo.mjs} +2 -2
- package/browser/esm/{BxIOX1TojvA-1ZZP.mjs → Rj8e7SashcMlcdZJ.mjs} +2 -2
- package/browser/esm/index.mjs +419 -414
- package/node/esm/{C8tfYGL3wHy9IDDc.mjs → 8VtzCFSmLPKxJjOa.mjs} +2 -2
- package/node/esm/{XQhP3dYwF_tEuswB.mjs → BkY99r-c3BhlT_Kv.mjs} +303 -297
- package/node/esm/{B-tgcZihStNV9CbZ.mjs → DE3eIaqkk5xzmV1c.mjs} +1 -1
- package/node/esm/index.mjs +5312 -5213
- package/package.json +6 -6
- package/resources/locales/de/model.msg.json +12 -0
- package/resources/locales/en/model.msg.json +12 -0
- package/types/scripting.d.ts +76 -7
- package/types/src/calculation/ICalculation.d.ts +5 -0
- package/types/src/calculation/compiler/CompilerUtils.d.ts +20 -0
- package/types/src/calculation/compiler/FormulaParser.d.ts +32 -6
- package/types/src/calculation/functions/Operators.d.ts +1 -1
- package/types/src/calculation/grid/CalcGrid.d.ts +2 -0
- package/types/src/calculation/grid/ICalcGrid.d.ts +11 -0
- package/types/src/cellRange/ICellRange.d.ts +60 -3
- package/types/src/sheet/SheetRange.d.ts +12 -1
- package/browser/cjs/DoemwsUQoGCk0vBK.cjs +0 -33
- package/browser/cjs/_c2uwwpr03Y7lzIj.cjs +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/sdk",
|
|
3
3
|
"description": "SDK - A high-performance, embeddable spreadsheet engine.",
|
|
4
|
-
"version": "0.7.28-beta.
|
|
4
|
+
"version": "0.7.28-beta.3",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"automation"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@sheetxl/formulas": "^0.7.28-beta.
|
|
47
|
-
"@sheetxl/formulas-extended": "^0.7.28-beta.
|
|
48
|
-
"@sheetxl/primitives": "^0.7.28-beta.
|
|
49
|
-
"@sheetxl/scripting": "^0.7.28-beta.
|
|
50
|
-
"@sheetxl/utils": "^0.7.28-beta.
|
|
46
|
+
"@sheetxl/formulas": "^0.7.28-beta.3",
|
|
47
|
+
"@sheetxl/formulas-extended": "^0.7.28-beta.3",
|
|
48
|
+
"@sheetxl/primitives": "^0.7.28-beta.3",
|
|
49
|
+
"@sheetxl/scripting": "^0.7.28-beta.3",
|
|
50
|
+
"@sheetxl/utils": "^0.7.28-beta.3",
|
|
51
51
|
"bahttext": "^2.4.0",
|
|
52
52
|
"bessel": "^1.0.2",
|
|
53
53
|
"chalk": "^6.0.0",
|
|
@@ -95,6 +95,17 @@
|
|
|
95
95
|
"error.address.textToColumnsOverwrite": "Der Zielbereich enthält Daten.",
|
|
96
96
|
"error.anchor.protected": "{description} nicht möglich. Das Element ist geschützt.",
|
|
97
97
|
"error.hyperlink.invalidHyperlink": "Ungültiger Link.",
|
|
98
|
+
"error.io.encryptionUnavailable": "Kennwortschutz ist nicht verfügbar, daher kann diese Arbeitsmappe nicht mit einem Kennwort gespeichert werden.",
|
|
99
|
+
"error.io.passwordIncorrect": "Das Kennwort ist falsch.",
|
|
100
|
+
"error.io.passwordRequired": "''{name}'' ist kennwortgeschützt. Zum Öffnen ist ein Kennwort erforderlich.",
|
|
101
|
+
"error.io.passwordRequiredSave": "''{name}'' ist kennwortgeschützt. Geben Sie das Kennwort an, um die Datei zu speichern, oder speichern Sie sie ohne Schutz.",
|
|
102
|
+
"error.io.passwordRequiredSaveUnnamed": "Diese Datei ist kennwortgeschützt. Geben Sie das Kennwort an, um die Datei zu speichern, oder speichern Sie sie ohne Schutz.",
|
|
103
|
+
"error.io.passwordRequiredUnnamed": "Diese Datei ist kennwortgeschützt. Zum Öffnen ist ein Kennwort erforderlich.",
|
|
104
|
+
"error.io.readFailed": "{format} kann nicht gelesen werden — {reason}",
|
|
105
|
+
"error.io.readFormatUnavailable": "''{format}'' kann nicht geöffnet werden — dieser Dateityp wird nicht unterstützt.",
|
|
106
|
+
"error.io.writeFailed": "Die Arbeitsmappe kann nicht gespeichert werden — {reason}",
|
|
107
|
+
"error.io.writeFormatUnavailable": "Speichern als ''{format}'' ist nicht möglich — dieser Dateityp wird nicht unterstützt.",
|
|
108
|
+
"error.io.writeFormatUnresolved": "Der Dateityp zum Speichern konnte nicht ermittelt werden. Wählen Sie einen Dateityp oder verwenden Sie einen Dateinamen mit bekannter Erweiterung.",
|
|
98
109
|
"error.model.modelClosed": "Das Modell wurde geschlossen. Weitere Vorgänge sind nicht zulässig.",
|
|
99
110
|
"error.model.nameRequired": "Name ist erforderlich",
|
|
100
111
|
"error.named.containsSpaces": "Der Name darf keine Leerzeichen enthalten.",
|
|
@@ -506,5 +517,6 @@
|
|
|
506
517
|
"table.defaultName": "Tabelle{n}",
|
|
507
518
|
"table.emptyColumnName": "Spalte",
|
|
508
519
|
"table.totalsRowLabel": "Ergebnis",
|
|
520
|
+
"workbook.defaultName": "Arbeitsmappe",
|
|
509
521
|
"workbook.defaultSheetName": "Tabelle{n}"
|
|
510
522
|
}
|
|
@@ -96,6 +96,17 @@
|
|
|
96
96
|
"error.anchor.protected": "Unable to {description}. The item is protected.",
|
|
97
97
|
"error.function.builtInName": "''{name}'' is a built-in function. Choose a different name.",
|
|
98
98
|
"error.hyperlink.invalidHyperlink": "Invalid hyperlink",
|
|
99
|
+
"error.io.encryptionUnavailable": "Password protection is not available, so this workbook cannot be saved with a password.",
|
|
100
|
+
"error.io.passwordIncorrect": "The password is incorrect.",
|
|
101
|
+
"error.io.passwordRequired": "''{name}'' is password protected. A password is required to open it.",
|
|
102
|
+
"error.io.passwordRequiredSave": "''{name}'' is password protected. Supply the password to save it, or save it without protection.",
|
|
103
|
+
"error.io.passwordRequiredSaveUnnamed": "This file is password protected. Supply the password to save it, or save it without protection.",
|
|
104
|
+
"error.io.passwordRequiredUnnamed": "This file is password protected. A password is required to open it.",
|
|
105
|
+
"error.io.readFailed": "Unable to read {format} — {reason}",
|
|
106
|
+
"error.io.readFormatUnavailable": "Unable to open ''{format}'' — that file type is not supported.",
|
|
107
|
+
"error.io.writeFailed": "Unable to save the workbook — {reason}",
|
|
108
|
+
"error.io.writeFormatUnavailable": "Unable to save as ''{format}'' — that file type is not supported.",
|
|
109
|
+
"error.io.writeFormatUnresolved": "Unable to determine the file type to save as. Choose a file type, or use a file name with a known extension.",
|
|
99
110
|
"error.model.modelClosed": "Model has been closed. No further operations are allowed.",
|
|
100
111
|
"error.model.nameRequired": "Name is required",
|
|
101
112
|
"error.named.containsSpaces": "Name must not contain any spaces.",
|
|
@@ -521,5 +532,6 @@
|
|
|
521
532
|
"table.defaultName": "Table{n}",
|
|
522
533
|
"table.emptyColumnName": "Column",
|
|
523
534
|
"table.totalsRowLabel": "Total",
|
|
535
|
+
"workbook.defaultName": "Workbook",
|
|
524
536
|
"workbook.defaultSheetName": "Sheet{n}"
|
|
525
537
|
}
|
package/types/scripting.d.ts
CHANGED
|
@@ -2688,6 +2688,11 @@ declare global {
|
|
|
2688
2688
|
* two diverge exactly where normalization is lossy — a number (`3.0` → `3`, `1**2` → `100`) or a
|
|
2689
2689
|
* cell (raw `b2` vs the resolved coords). `undefined` only for a token with no captured source
|
|
2690
2690
|
* image (e.g. a reference the engine rewrote programmatically rather than one the user typed).
|
|
2691
|
+
*
|
|
2692
|
+
* A reference literal is ONE span: a typed sheet qualifier and a trailing spill anchor ride inside
|
|
2693
|
+
* the `cell`/`named` token's `text` (`Sheet2!A1#`), so the caret rules an editor applies per token
|
|
2694
|
+
* treat the whole reference as one. The anchor keeps its own `postfix` token (carrying the same
|
|
2695
|
+
* {@link referenceIndex}) imaging the empty string, so the concatenation above still holds.
|
|
2691
2696
|
*/
|
|
2692
2697
|
text?: string;
|
|
2693
2698
|
/**
|
|
@@ -4689,11 +4694,24 @@ declare global {
|
|
|
4689
4694
|
* Returns a range that includes the current range up to a content edge boundary.
|
|
4690
4695
|
*
|
|
4691
4696
|
* @param direction The direction.
|
|
4692
|
-
* @param cell
|
|
4693
|
-
*
|
|
4697
|
+
* @param cell Either the cell to walk from — as {@link ICellRange.GetExtendedOptions.cell}, and
|
|
4698
|
+
* the positional form Office Scripts' `getExtendedRange` takes — or the full
|
|
4699
|
+
* {@link ICellRange.GetExtendedOptions}. If neither is given the cell closest to
|
|
4700
|
+
* the edge is used.
|
|
4694
4701
|
* @returns `ICellRange` extended in the given direction.
|
|
4702
|
+
*
|
|
4703
|
+
* @remarks
|
|
4704
|
+
* The result **includes** the current range, and a boundary with nowhere to go returns the range
|
|
4705
|
+
* unchanged — so comparing the two is how you tell there was nothing to extend onto.
|
|
4706
|
+
*
|
|
4707
|
+
* {@link ICellRange.GetExtendedOptions.basis} picks what the boundary is read from: the range's
|
|
4708
|
+
* own content (Ctrl+Arrow, the default) or the lines flanking it (a double-clicked fill handle).
|
|
4709
|
+
*
|
|
4710
|
+
* Both bases read the content, merge and table indexes rather than walking cells, so the cost is
|
|
4711
|
+
* the blocks involved and not the distance traveled — extending across a million rows costs what
|
|
4712
|
+
* extending across ten does.
|
|
4695
4713
|
*/
|
|
4696
|
-
getExtended(direction: IRange.Direction, cell?: ICell.Address): this;
|
|
4714
|
+
getExtended(direction: IRange.Direction, cell?: ICell.Address | ICellRange.GetExtendedOptions): this;
|
|
4697
4715
|
/**
|
|
4698
4716
|
* Returns a range with coordinates adjusted to be fixed (absolute) or flexible (relative).
|
|
4699
4717
|
*
|
|
@@ -5809,6 +5827,50 @@ declare global {
|
|
|
5809
5827
|
*/
|
|
5810
5828
|
colEnd?: boolean;
|
|
5811
5829
|
}
|
|
5830
|
+
/**
|
|
5831
|
+
* Options for {@link ICellRange.getExtended}.
|
|
5832
|
+
*/
|
|
5833
|
+
interface GetExtendedOptions {
|
|
5834
|
+
/**
|
|
5835
|
+
* The cell to walk from. Only `'content'` extends from a cell — the flanking lines a
|
|
5836
|
+
* `'adjacent'` extension reads are fixed by the range's own edges — so this is ignored there.
|
|
5837
|
+
*
|
|
5838
|
+
* @defaultValue the cell of the range closest to the edge being extended toward.
|
|
5839
|
+
*/
|
|
5840
|
+
cell?: ICell.Address;
|
|
5841
|
+
/**
|
|
5842
|
+
* What the content edge is read from.
|
|
5843
|
+
*
|
|
5844
|
+
* - `'content'` — the range's own content, walked from {@link cell}. This is Ctrl+Arrow: it
|
|
5845
|
+
* runs to the end of the block it is in, or from a blank onto the next block.
|
|
5846
|
+
* - `'adjacent'` — the two lines flanking the range on the cross axis (for a downward
|
|
5847
|
+
* extension, the column left of the left edge and the column right of the right edge). Each
|
|
5848
|
+
* contributes its contiguous run measured from the line the extension would start on, and
|
|
5849
|
+
* the **further** of the two wins; a flank that starts blank contributes nothing, which is
|
|
5850
|
+
* why a spacer column stops the extension dead. The reach is then cut short **before** the
|
|
5851
|
+
* nearest populated line inside the range's own columns, so an existing block is not run
|
|
5852
|
+
* over. This is the destination Excel picks when the fill handle is double-clicked, and it
|
|
5853
|
+
* feeds {@link ICellRange.autoFill} directly.
|
|
5854
|
+
*
|
|
5855
|
+
* @defaultValue 'content'
|
|
5856
|
+
*/
|
|
5857
|
+
basis?: 'content' | 'adjacent';
|
|
5858
|
+
/**
|
|
5859
|
+
* Where a walk that begins on a **blank** cell comes to rest.
|
|
5860
|
+
*
|
|
5861
|
+
* - `'enter'` — on the first cell of the block it runs into. This is Ctrl+Arrow.
|
|
5862
|
+
* - `'before'` — on the last blank, one short of that block. This is what a double-clicked
|
|
5863
|
+
* selection border does.
|
|
5864
|
+
*
|
|
5865
|
+
* Blanks are the *only* thing this changes: from a populated cell both run to the end of that
|
|
5866
|
+
* cell's own block and stop in the same place. It is also independent of {@link basis} — that
|
|
5867
|
+
* says where the boundary is read from, this says what happens on the way — though `'adjacent'`
|
|
5868
|
+
* has nothing to apply it to, since a blank flank contributes no reach in the first place.
|
|
5869
|
+
*
|
|
5870
|
+
* @defaultValue 'enter'
|
|
5871
|
+
*/
|
|
5872
|
+
fromBlank?: 'enter' | 'before';
|
|
5873
|
+
}
|
|
5812
5874
|
/**
|
|
5813
5875
|
* Options for {@link ICellRange.getSurrounding}.
|
|
5814
5876
|
*/
|
|
@@ -12313,12 +12375,19 @@ declare global {
|
|
|
12313
12375
|
*/
|
|
12314
12376
|
getFormulaAt(row: number, column: number, sheetName?: string): string | null;
|
|
12315
12377
|
/**
|
|
12316
|
-
* Returns the
|
|
12378
|
+
* Returns the range the formula anchored at a cell OCCUPIES — what the spill anchor operator
|
|
12379
|
+
* (`A1#`) resolves to.
|
|
12317
12380
|
*
|
|
12318
|
-
* @param row The row
|
|
12319
|
-
* @param column The column
|
|
12381
|
+
* @param row The row the formula is anchored at.
|
|
12382
|
+
* @param column The column the formula is anchored at.
|
|
12320
12383
|
* @param sheetName The name of the sheet. If not provided the current sheet is used.
|
|
12321
|
-
* @returns The
|
|
12384
|
+
* @returns The range, or `null` if no formula is anchored there.
|
|
12385
|
+
*
|
|
12386
|
+
* @remarks
|
|
12387
|
+
* The range is the formula's spill when it produced an array, the whole block for a legacy
|
|
12388
|
+
* array formula, and the cell ITSELF for an ordinary formula — every formula occupies at least
|
|
12389
|
+
* the cell it sits in. `null` means no formula is anchored at that cell: it holds a constant, it
|
|
12390
|
+
* is empty, or it merely lies INSIDE another cell's spill or array block.
|
|
12322
12391
|
*/
|
|
12323
12392
|
getSpillAt(row: number, column: number, sheetName?: string): IReferenceRange | null;
|
|
12324
12393
|
/**
|
|
@@ -572,6 +572,11 @@ export declare namespace ICalculation {
|
|
|
572
572
|
* two diverge exactly where normalization is lossy — a number (`3.0` → `3`, `1**2` → `100`) or a
|
|
573
573
|
* cell (raw `b2` vs the resolved coords). `undefined` only for a token with no captured source
|
|
574
574
|
* image (e.g. a reference the engine rewrote programmatically rather than one the user typed).
|
|
575
|
+
*
|
|
576
|
+
* A reference literal is ONE span: a typed sheet qualifier and a trailing spill anchor ride inside
|
|
577
|
+
* the `cell`/`named` token's `text` (`Sheet2!A1#`), so the caret rules an editor applies per token
|
|
578
|
+
* treat the whole reference as one. The anchor keeps its own `postfix` token (carrying the same
|
|
579
|
+
* {@link referenceIndex}) imaging the empty string, so the concatenation above still holds.
|
|
575
580
|
*/
|
|
576
581
|
text?: string;
|
|
577
582
|
/**
|
|
@@ -129,6 +129,26 @@ export declare const isRangedNode: (node: ASTNode) => boolean;
|
|
|
129
129
|
* parse path has no access to — and "SUM is not a defined name" is an honest answer.
|
|
130
130
|
*/
|
|
131
131
|
export declare const findNonReferenceIntersectionOperand: (root: ASTNode, getFunction: ((name: string) => IFunction | null) | null) => ASTNode | null;
|
|
132
|
+
/**
|
|
133
|
+
* Finds a spill-anchor (`#`) operand that cannot possibly be a reference, or `null` if the formula
|
|
134
|
+
* has none.
|
|
135
|
+
*
|
|
136
|
+
* @param root The root of the formula's AST.
|
|
137
|
+
* @param getFunction Resolves a function's stableId to its declaration, or `null`.
|
|
138
|
+
*
|
|
139
|
+
* @remarks
|
|
140
|
+
* The anchor answers "where did the formula anchored HERE put its result", so its operand is a
|
|
141
|
+
* location, never a value — Excel's own declaration is `ANCHORARRAY(Range) -> Range|Array`. An
|
|
142
|
+
* operand that provably computes a value is refused at ENTRY, the same verdict (and the same
|
|
143
|
+
* predicate — {@link isDefinitelyNotReferenceNode}) as the intersection operand beside it.
|
|
144
|
+
*
|
|
145
|
+
* Measured against Excel 16.0 desktop (`spreadsheetbench/formula-tests/probe-anchor.ps1`): `=5#`,
|
|
146
|
+
* `={1,2}#` and `=SUM(X1:X3)#` cannot be typed at all, while a reference-returning call
|
|
147
|
+
* (`=INDEX(X1:X3,1)#`, `=OFFSET(B3,0,0)#`) is accepted. A NAME is accepted too — what it resolves
|
|
148
|
+
* to is not knowable here — and answers `#VALUE!` when it turns out to hold a constant, which is
|
|
149
|
+
* the runtime half of this same rule.
|
|
150
|
+
*/
|
|
151
|
+
export declare const findNonReferenceAnchorOperand: (root: ASTNode, getFunction: ((name: string) => IFunction | null) | null) => ASTNode | null;
|
|
132
152
|
/**
|
|
133
153
|
* Finds an array constant whose rows are not all the same length — a JAGGED literal such as
|
|
134
154
|
* `{1,2;3}`.
|
|
@@ -92,8 +92,11 @@ export declare class FormulaParser extends EmbeddedActionsParser {
|
|
|
92
92
|
/** Matches a single `+` or `-` token. Used as a helper by `_rulePrefixOp` and `_ruleLiteralForArray`. */
|
|
93
93
|
protected _rulePlusMinusOp: import('chevrotain').ParserMethod<[], IToken>;
|
|
94
94
|
/**
|
|
95
|
-
* Applies zero or more
|
|
96
|
-
*
|
|
95
|
+
* Applies zero or more `%` percent postfixes to the node produced by `_rulePrefixOp`, building a
|
|
96
|
+
* right-growing postfix AST chain.
|
|
97
|
+
*
|
|
98
|
+
* The other postfix, the spill anchor `#`, is NOT here: it binds tighter than the unary prefixes
|
|
99
|
+
* and looser than `:`, so it lives inside `_ruleRangeOp`.
|
|
97
100
|
*/
|
|
98
101
|
protected _rulePostfixOp: import('chevrotain').ParserMethod<[], ASTNode<TokenType, any>>;
|
|
99
102
|
/**
|
|
@@ -106,10 +109,33 @@ export declare class FormulaParser extends EmbeddedActionsParser {
|
|
|
106
109
|
*/
|
|
107
110
|
protected _rulePrefixOp: import('chevrotain').ParserMethod<[], ASTNode<TokenType, any>>;
|
|
108
111
|
/**
|
|
109
|
-
* Folds the range operators (`:` range, `.:.` / `.:` / `:.` range-trim)
|
|
110
|
-
* operators, binding tighter than the unary prefixes (`_rulePrefixOp`).
|
|
111
|
-
* (`A1:B2:C3` = `(A1:B2):C3`); every operator produces a reference
|
|
112
|
-
* whole span resolves to one reference. This rule sits just above the
|
|
112
|
+
* Folds the range operators (`:` range, `.:.` / `.:` / `:.` range-trim) and the spill anchor `#` —
|
|
113
|
+
* Excel's highest-precedence operators, binding tighter than the unary prefixes (`_rulePrefixOp`).
|
|
114
|
+
* Left-associative, single level (`A1:B2:C3` = `(A1:B2):C3`); every operator produces a reference
|
|
115
|
+
* node (`isRange = true`) so the whole span resolves to one reference. This rule sits just above the
|
|
116
|
+
* `_ruleCallOp` leaf.
|
|
117
|
+
*
|
|
118
|
+
* ── Why `#` is folded HERE, with the range operators ─────────────────────────────────────────
|
|
119
|
+
*
|
|
120
|
+
* The anchor is a postfix over the reference accumulated SO FAR, not over the primary in front of
|
|
121
|
+
* it: `A1:B2#` is `(A1:B2)#`, whose operand is a multi-cell reference — `#REF!` in Excel. What a
|
|
122
|
+
* `#` before the operator anchors is only its own operand, because that is all that has
|
|
123
|
+
* accumulated yet — `B3#:B1` is `(B3#):B1`, the rectangle spanning B1 and the whole of B3's spill.
|
|
124
|
+
*
|
|
125
|
+
* Measured against Excel 16.0 desktop (`spreadsheetbench/formula-tests/probe-anchor.ps1`); the
|
|
126
|
+
* xlsx round-trip is the unambiguous witness, since the anchor lowers to an explicit call there:
|
|
127
|
+
*
|
|
128
|
+
* | typed | value | stored |
|
|
129
|
+
* | --- | --- | --- |
|
|
130
|
+
* | `B1:B3#` | `#REF!` | `_xlfn.ANCHORARRAY(B1:B3)` |
|
|
131
|
+
* | `B11:B3#` | `#REF!` | `_xlfn.ANCHORARRAY(B3:B11)` — re-imaged as `=B3:B11#` |
|
|
132
|
+
* | `B3#:B1` | B1:B5 | `_xlfn.ANCHORARRAY(B3):B1` |
|
|
133
|
+
*
|
|
134
|
+
* Excel ONLINE parses the same text differently — its grammar attaches `#` to the PRIMARY
|
|
135
|
+
* (`re = q(primary, any(Pound, StructRef), ...)` in the shipped engine), so it reads `A1:(B2#)`.
|
|
136
|
+
* Desktop wins. (The one desktop form this fold does not reproduce is `B3#:B5#`, which Excel
|
|
137
|
+
* stores as `ANCHORARRAY(B3):ANCHORARRAY(B5)` while we anchor the accumulation. Both are `#REF!`
|
|
138
|
+
* — an anchor over a multi-cell reference either way — so only the re-imaged text differs.)
|
|
113
139
|
*/
|
|
114
140
|
protected _ruleRangeOp: import('chevrotain').ParserMethod<[], ASTNode<TokenType, any>>;
|
|
115
141
|
/**
|
|
@@ -25,6 +25,6 @@ export declare const Prefix: {
|
|
|
25
25
|
};
|
|
26
26
|
export declare const Postfix: {
|
|
27
27
|
'%': (context: IFormulaContext, value: any) => any;
|
|
28
|
-
'#': (context: IFormulaContext, value: any) => IReferenceRange;
|
|
28
|
+
'#': (context: IFormulaContext, value: any) => IReferenceRange | FormulaError.Known;
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=Operators.d.ts.map
|
|
@@ -75,6 +75,8 @@ export declare class CalcGrid implements ICalcGrid {
|
|
|
75
75
|
getDirtyRegions(): ISpatialQuery;
|
|
76
76
|
/** {@inheritDoc ICalcGrid.getFormulas} */
|
|
77
77
|
getFormulas(): ISpatialQuery<IFormulaBlock>;
|
|
78
|
+
/** {@inheritDoc ICalcGrid.getSpills} */
|
|
79
|
+
getSpills(): ISpatialQuery<SpillEntry>;
|
|
78
80
|
/** {@inheritDoc ICalcGrid.getSnapshot} */
|
|
79
81
|
getSnapshot(options?: ICalcGrid.GetSnapshotOptions): ICalcGrid.ISnapshot;
|
|
80
82
|
/** {@inheritDoc ICalcGrid.getDirectDependentsAt} */
|
|
@@ -66,6 +66,17 @@ export interface ICalcGrid {
|
|
|
66
66
|
* Used by sheet
|
|
67
67
|
*/
|
|
68
68
|
getFormulas(): ISpatialQuery<IFormulaBlock>;
|
|
69
|
+
/**
|
|
70
|
+
* Returns a queryable spatial index of the ARRAY EXTENTS on this grid — one entry per array
|
|
71
|
+
* formula, keyed by the cells it occupies: a dynamic array's spill, a legacy CSE block, or the
|
|
72
|
+
* single cell a blocked spill collapses to.
|
|
73
|
+
*
|
|
74
|
+
* @remark
|
|
75
|
+
* The same index a calculation pass writes through {@link ICalcGrid.IncrementalUpdates.spillSpatial}
|
|
76
|
+
* (`beginUpdates` hands out this very map), so a read answers identically inside and outside a
|
|
77
|
+
* pass — which is what lets a formula evaluated OUTSIDE one resolve a spill anchor.
|
|
78
|
+
*/
|
|
79
|
+
getSpills(): ISpatialQuery<SpillEntry>;
|
|
69
80
|
/**
|
|
70
81
|
* Returns the current values on the grid.
|
|
71
82
|
*/
|
|
@@ -246,11 +246,24 @@ export interface ICellRange {
|
|
|
246
246
|
* Returns a range that includes the current range up to a content edge boundary.
|
|
247
247
|
*
|
|
248
248
|
* @param direction The direction.
|
|
249
|
-
* @param cell
|
|
250
|
-
*
|
|
249
|
+
* @param cell Either the cell to walk from — as {@link ICellRange.GetExtendedOptions.cell}, and
|
|
250
|
+
* the positional form Office Scripts' `getExtendedRange` takes — or the full
|
|
251
|
+
* {@link ICellRange.GetExtendedOptions}. If neither is given the cell closest to
|
|
252
|
+
* the edge is used.
|
|
251
253
|
* @returns `ICellRange` extended in the given direction.
|
|
254
|
+
*
|
|
255
|
+
* @remarks
|
|
256
|
+
* The result **includes** the current range, and a boundary with nowhere to go returns the range
|
|
257
|
+
* unchanged — so comparing the two is how you tell there was nothing to extend onto.
|
|
258
|
+
*
|
|
259
|
+
* {@link ICellRange.GetExtendedOptions.basis} picks what the boundary is read from: the range's
|
|
260
|
+
* own content (Ctrl+Arrow, the default) or the lines flanking it (a double-clicked fill handle).
|
|
261
|
+
*
|
|
262
|
+
* Both bases read the content, merge and table indexes rather than walking cells, so the cost is
|
|
263
|
+
* the blocks involved and not the distance traveled — extending across a million rows costs what
|
|
264
|
+
* extending across ten does.
|
|
252
265
|
*/
|
|
253
|
-
getExtended(direction: IRange.Direction, cell?: ICell.Address): this;
|
|
266
|
+
getExtended(direction: IRange.Direction, cell?: ICell.Address | ICellRange.GetExtendedOptions): this;
|
|
254
267
|
/**
|
|
255
268
|
* Returns a range with coordinates adjusted to be fixed (absolute) or flexible (relative).
|
|
256
269
|
*
|
|
@@ -1391,6 +1404,50 @@ export declare namespace ICellRange {
|
|
|
1391
1404
|
*/
|
|
1392
1405
|
colEnd?: boolean;
|
|
1393
1406
|
}
|
|
1407
|
+
/**
|
|
1408
|
+
* Options for {@link ICellRange.getExtended}.
|
|
1409
|
+
*/
|
|
1410
|
+
interface GetExtendedOptions {
|
|
1411
|
+
/**
|
|
1412
|
+
* The cell to walk from. Only `'content'` extends from a cell — the flanking lines a
|
|
1413
|
+
* `'adjacent'` extension reads are fixed by the range's own edges — so this is ignored there.
|
|
1414
|
+
*
|
|
1415
|
+
* @defaultValue the cell of the range closest to the edge being extended toward.
|
|
1416
|
+
*/
|
|
1417
|
+
cell?: ICell.Address;
|
|
1418
|
+
/**
|
|
1419
|
+
* What the content edge is read from.
|
|
1420
|
+
*
|
|
1421
|
+
* - `'content'` — the range's own content, walked from {@link cell}. This is Ctrl+Arrow: it
|
|
1422
|
+
* runs to the end of the block it is in, or from a blank onto the next block.
|
|
1423
|
+
* - `'adjacent'` — the two lines flanking the range on the cross axis (for a downward
|
|
1424
|
+
* extension, the column left of the left edge and the column right of the right edge). Each
|
|
1425
|
+
* contributes its contiguous run measured from the line the extension would start on, and
|
|
1426
|
+
* the **further** of the two wins; a flank that starts blank contributes nothing, which is
|
|
1427
|
+
* why a spacer column stops the extension dead. The reach is then cut short **before** the
|
|
1428
|
+
* nearest populated line inside the range's own columns, so an existing block is not run
|
|
1429
|
+
* over. This is the destination Excel picks when the fill handle is double-clicked, and it
|
|
1430
|
+
* feeds {@link ICellRange.autoFill} directly.
|
|
1431
|
+
*
|
|
1432
|
+
* @defaultValue 'content'
|
|
1433
|
+
*/
|
|
1434
|
+
basis?: 'content' | 'adjacent';
|
|
1435
|
+
/**
|
|
1436
|
+
* Where a walk that begins on a **blank** cell comes to rest.
|
|
1437
|
+
*
|
|
1438
|
+
* - `'enter'` — on the first cell of the block it runs into. This is Ctrl+Arrow.
|
|
1439
|
+
* - `'before'` — on the last blank, one short of that block. This is what a double-clicked
|
|
1440
|
+
* selection border does.
|
|
1441
|
+
*
|
|
1442
|
+
* Blanks are the *only* thing this changes: from a populated cell both run to the end of that
|
|
1443
|
+
* cell's own block and stop in the same place. It is also independent of {@link basis} — that
|
|
1444
|
+
* says where the boundary is read from, this says what happens on the way — though `'adjacent'`
|
|
1445
|
+
* has nothing to apply it to, since a blank flank contributes no reach in the first place.
|
|
1446
|
+
*
|
|
1447
|
+
* @defaultValue 'enter'
|
|
1448
|
+
*/
|
|
1449
|
+
fromBlank?: 'enter' | 'before';
|
|
1450
|
+
}
|
|
1394
1451
|
/**
|
|
1395
1452
|
* Options for {@link ICellRange.getSurrounding}.
|
|
1396
1453
|
*/
|
|
@@ -162,7 +162,18 @@ export declare class SheetRange implements ICellRange {
|
|
|
162
162
|
/** {@inheritDoc ICellRange.getSurrounding} */
|
|
163
163
|
getSurrounding(options?: ICellRange.GetSurroundingOptions): this;
|
|
164
164
|
/** {@inheritDoc ICellRange.getExtended} */
|
|
165
|
-
getExtended(direction: IRange.Direction, cell?: ICell.Address): this;
|
|
165
|
+
getExtended(direction: IRange.Direction, cell?: ICell.Address | ICellRange.GetExtendedOptions): this;
|
|
166
|
+
/**
|
|
167
|
+
* `fromBlank: 'before'` — a walk that set off from a blank comes to rest on the last blank rather
|
|
168
|
+
* than on the first cell of the block it ran into. See
|
|
169
|
+
* {@link ICellRange.GetExtendedOptions.fromBlank}.
|
|
170
|
+
*/
|
|
171
|
+
private _restBeforeBlock;
|
|
172
|
+
/**
|
|
173
|
+
* `basis: 'adjacent'` — the boundary comes from the lines flanking the range rather than from its
|
|
174
|
+
* own content. See {@link ICellRange.GetExtendedOptions.basis} for the rule.
|
|
175
|
+
*/
|
|
176
|
+
private _extendedAdjacent;
|
|
166
177
|
/** {@inheritDoc ICellRange.getEntireRows} */
|
|
167
178
|
getEntireRows(shift?: boolean, options?: ICellRange.GetRangeOptions): this;
|
|
168
179
|
/** {@inheritDoc ICellRange.getEntireColumns} */
|