@odoo/o-spreadsheet 19.2.20 → 19.2.21
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/dist/o_spreadsheet.css
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/*
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 19.2.
|
|
6
|
-
* @date 2026-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.2.21
|
|
6
|
+
* @date 2026-07-20T11:02:04.627Z
|
|
7
|
+
* @hash fba73fe
|
|
8
8
|
*/
|
|
9
9
|
:root {
|
|
10
10
|
--os-gray-100: light-dark(#f9fafb, #1b1d26);
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 19.2.
|
|
6
|
-
* @date 2026-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.2.21
|
|
6
|
+
* @date 2026-07-20T11:02:03.049Z
|
|
7
|
+
* @hash fba73fe
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { App, Component, blockDom, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, whenReady, xml } from "@odoo/owl";
|
|
@@ -6268,7 +6268,7 @@ function getRangeString(range, forSheetId, getSheetName, options = {
|
|
|
6268
6268
|
if (prefixSheet && !sheetName) return CellErrorType.InvalidReference;
|
|
6269
6269
|
let rangeString = getRangePartString(range, 0, options);
|
|
6270
6270
|
if (range.parts && range.parts.length === 2) {
|
|
6271
|
-
if (range.zone.top !== range.zone.bottom || range.zone.left !== range.zone.right || range.parts[0].rowFixed || range.parts[0].colFixed || range.parts[1].rowFixed || range.parts[1].colFixed) {
|
|
6271
|
+
if (range.zone.top !== range.zone.bottom || range.zone.left !== range.zone.right || range.parts[0].rowFixed || range.parts[0].colFixed || range.parts[1].rowFixed || range.parts[1].colFixed || options.doNotSimplifyRange) {
|
|
6272
6272
|
rangeString += ":";
|
|
6273
6273
|
rangeString += getRangePartString(range, 1, options);
|
|
6274
6274
|
}
|
|
@@ -40478,7 +40478,7 @@ var ScorecardChartConfigPanel = class extends Component {
|
|
|
40478
40478
|
return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardKeyValue");
|
|
40479
40479
|
}
|
|
40480
40480
|
get isBaselineInvalid() {
|
|
40481
|
-
return !!this.state.
|
|
40481
|
+
return !!this.state.baselineDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
|
|
40482
40482
|
}
|
|
40483
40483
|
onKeyValueRangeChanged(ranges) {
|
|
40484
40484
|
this.keyValue = ranges[0];
|
|
@@ -43796,6 +43796,11 @@ var CompiledFormula = class CompiledFormula {
|
|
|
43796
43796
|
const params = compileTokens(rangeTokenize(formula));
|
|
43797
43797
|
return new CompiledFormula(sheetId, params.tokens, params.literalValues, params.symbols, params.dependencies.map((xc) => getters.getRangeFromSheetXC(sheetId, xc)), params.isBadExpression, params.normalizedFormula, params.execute);
|
|
43798
43798
|
}
|
|
43799
|
+
areRangeShapesInLineWithNormalizedFormula() {
|
|
43800
|
+
return Array.from(this.normalizedFormula.matchAll(/\|C\||\|R\|/g)).every((value, index) => {
|
|
43801
|
+
return this.rangeDependencies[index].parts.length === 1 && value[0] === "|C|" || this.rangeDependencies[index].parts.length === 2 && value[0] === "|R|" || this.rangeDependencies[index].invalidXc || this.rangeDependencies[index].invalidSheetName;
|
|
43802
|
+
});
|
|
43803
|
+
}
|
|
43799
43804
|
};
|
|
43800
43805
|
function compileTokens(tokens) {
|
|
43801
43806
|
try {
|
|
@@ -55778,6 +55783,7 @@ var Squisher = class {
|
|
|
55778
55783
|
alreadyAppliedNumberOffsets = [];
|
|
55779
55784
|
previousStrings = [];
|
|
55780
55785
|
baseFormulaWasTransformed = false;
|
|
55786
|
+
rangeToStringOptions = { doNotSimplifyRange: true };
|
|
55781
55787
|
constructor(getters) {
|
|
55782
55788
|
this.getters = getters;
|
|
55783
55789
|
}
|
|
@@ -55834,9 +55840,9 @@ var Squisher = class {
|
|
|
55834
55840
|
let references = [];
|
|
55835
55841
|
if (!this.baseFormula || this.baseFormula.normalizedFormula !== cell.compiledFormula.normalizedFormula) {
|
|
55836
55842
|
this.resetBaseTo(cell.compiledFormula);
|
|
55837
|
-
return cell.compiledFormula.toFormulaString(this.getters);
|
|
55843
|
+
return cell.compiledFormula.toFormulaString(this.getters, this.rangeToStringOptions);
|
|
55838
55844
|
} else {
|
|
55839
|
-
if (!this.baseFormulaWasTransformed && deepEquals(cell.compiledFormula.literalValues, this.baseFormula.literalValues) && deepEquals(cell.compiledFormula.rangeDependencies, this.baseFormula.rangeDependencies)) return cell.compiledFormula.toFormulaString(this.getters);
|
|
55845
|
+
if (!this.baseFormulaWasTransformed && deepEquals(cell.compiledFormula.literalValues, this.baseFormula.literalValues) && deepEquals(cell.compiledFormula.rangeDependencies, this.baseFormula.rangeDependencies)) return cell.compiledFormula.toFormulaString(this.getters, this.rangeToStringOptions);
|
|
55840
55846
|
numbers = this.squishNumbers(cell.compiledFormula.literalValues.numbers);
|
|
55841
55847
|
strings = this.squishStrings(cell.compiledFormula.literalValues.strings);
|
|
55842
55848
|
references = this.squishReferences(cell.compiledFormula.rangeDependencies, forSheetId);
|
|
@@ -55879,23 +55885,23 @@ var Squisher = class {
|
|
|
55879
55885
|
squishOneReference(reference, previousReferences, index, forSheetId) {
|
|
55880
55886
|
const previousReference = previousReferences[index];
|
|
55881
55887
|
if (deepEquals(previousReference, reference)) return "=";
|
|
55882
|
-
if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc) {
|
|
55888
|
+
if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc || previousReference.parts.length !== reference.parts.length) {
|
|
55883
55889
|
previousReferences[index] = deepCopy(reference);
|
|
55884
|
-
return getRangeString(reference, forSheetId, this.getters.getSheetName);
|
|
55890
|
+
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
55885
55891
|
}
|
|
55886
55892
|
if (previousReference.unboundedZone.bottom === void 0 || previousReference.unboundedZone.right === void 0 || reference.unboundedZone.bottom === void 0 || reference.unboundedZone.right === void 0) {
|
|
55887
55893
|
previousReferences[index] = deepCopy(reference);
|
|
55888
|
-
return getRangeString(reference, forSheetId, this.getters.getSheetName);
|
|
55894
|
+
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
55889
55895
|
}
|
|
55890
55896
|
for (let i = 0; i < reference.parts.length; i++) if (previousReference.parts[i].colFixed !== reference.parts[i].colFixed || previousReference.parts[i].rowFixed !== reference.parts[i].rowFixed) {
|
|
55891
55897
|
previousReferences[index] = deepCopy(reference);
|
|
55892
|
-
return getRangeString(reference, forSheetId, this.getters.getSheetName);
|
|
55898
|
+
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
55893
55899
|
}
|
|
55894
55900
|
const currentZone = reference.zone;
|
|
55895
55901
|
const previousZone = previousReference.zone;
|
|
55896
55902
|
if (currentZone.top !== currentZone.bottom || currentZone.left !== currentZone.right || previousZone.top !== previousZone.bottom || previousZone.left !== previousZone.right) {
|
|
55897
55903
|
previousReferences[index] = deepCopy(reference);
|
|
55898
|
-
return getRangeString(reference, forSheetId, this.getters.getSheetName);
|
|
55904
|
+
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
55899
55905
|
}
|
|
55900
55906
|
const diffCol = reference.zone.left - previousReference.zone.left;
|
|
55901
55907
|
const diffRow = reference.zone.top - previousReference.zone.top;
|
|
@@ -55903,7 +55909,7 @@ var Squisher = class {
|
|
|
55903
55909
|
previousReference.unboundedZone = deepCopy(reference.unboundedZone);
|
|
55904
55910
|
if (diffCol !== 0 && diffRow === 0) return `${diffCol > 0 ? "+" : "-"}C${Math.abs(diffCol)}`;
|
|
55905
55911
|
else if (diffRow !== 0 && diffCol === 0) return `${diffRow > 0 ? "+" : "-"}R${Math.abs(diffRow)}`;
|
|
55906
|
-
return getRangeString(reference, forSheetId, this.getters.getSheetName);
|
|
55912
|
+
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
55907
55913
|
}
|
|
55908
55914
|
/**
|
|
55909
55915
|
* Squish the number parameters. Result for each parameter should be compared the previous formula.
|
|
@@ -56014,10 +56020,19 @@ var Unsquisher = class {
|
|
|
56014
56020
|
break;
|
|
56015
56021
|
case "FIRST_OFFSET":
|
|
56016
56022
|
this.previousOffset = current;
|
|
56017
|
-
for (const position of positionsOfKey)
|
|
56018
|
-
|
|
56019
|
-
|
|
56020
|
-
|
|
56023
|
+
for (const position of positionsOfKey) {
|
|
56024
|
+
const result = this.unsquish(current, sheetId, getters);
|
|
56025
|
+
if (!result.areRangeShapesInLineWithNormalizedFormula()) {
|
|
56026
|
+
const formulaString = result.toFormulaString(getters);
|
|
56027
|
+
yield {
|
|
56028
|
+
position,
|
|
56029
|
+
compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
|
|
56030
|
+
};
|
|
56031
|
+
} else yield {
|
|
56032
|
+
position,
|
|
56033
|
+
compiled: result
|
|
56034
|
+
};
|
|
56035
|
+
}
|
|
56021
56036
|
break;
|
|
56022
56037
|
case "COMBINE_OFFSET":
|
|
56023
56038
|
if (!this.previousOffset) throw new Error("No previous offset to combine with");
|
|
@@ -56025,10 +56040,19 @@ var Unsquisher = class {
|
|
|
56025
56040
|
this.previousOffset.N = currentOffset.N ?? this.previousOffset.N;
|
|
56026
56041
|
this.previousOffset.S = currentOffset.S ?? this.previousOffset.S;
|
|
56027
56042
|
this.previousOffset.R = currentOffset.R ?? this.previousOffset.R;
|
|
56028
|
-
for (const position of positionsOfKey)
|
|
56029
|
-
|
|
56030
|
-
|
|
56031
|
-
|
|
56043
|
+
for (const position of positionsOfKey) {
|
|
56044
|
+
const result = this.unsquish(this.previousOffset, sheetId, getters);
|
|
56045
|
+
if (!result.areRangeShapesInLineWithNormalizedFormula()) {
|
|
56046
|
+
const formulaString = result.toFormulaString(getters);
|
|
56047
|
+
yield {
|
|
56048
|
+
position,
|
|
56049
|
+
compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
|
|
56050
|
+
};
|
|
56051
|
+
} else yield {
|
|
56052
|
+
position,
|
|
56053
|
+
compiled: result
|
|
56054
|
+
};
|
|
56055
|
+
}
|
|
56032
56056
|
break;
|
|
56033
56057
|
}
|
|
56034
56058
|
}
|
|
@@ -63545,6 +63569,8 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
63545
63569
|
pivots = {};
|
|
63546
63570
|
unusedPivotsInFormulas;
|
|
63547
63571
|
custom;
|
|
63572
|
+
pivotPositionCache = new PositionMap();
|
|
63573
|
+
shouldInvalidateCache = false;
|
|
63548
63574
|
constructor(config) {
|
|
63549
63575
|
super(config);
|
|
63550
63576
|
this.custom = config.custom;
|
|
@@ -63555,7 +63581,11 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
63555
63581
|
}
|
|
63556
63582
|
}
|
|
63557
63583
|
handle(cmd) {
|
|
63558
|
-
if (invalidateEvaluationCommands.has(cmd.type))
|
|
63584
|
+
if (invalidateEvaluationCommands.has(cmd.type)) {
|
|
63585
|
+
this.shouldInvalidateCache = true;
|
|
63586
|
+
for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
|
|
63587
|
+
}
|
|
63588
|
+
if (cmd.type === "UPDATE_CELL") this.shouldInvalidateCache = true;
|
|
63559
63589
|
switch (cmd.type) {
|
|
63560
63590
|
case "REFRESH_PIVOT":
|
|
63561
63591
|
this.refreshPivot(cmd.id);
|
|
@@ -63595,6 +63625,12 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
63595
63625
|
break;
|
|
63596
63626
|
}
|
|
63597
63627
|
}
|
|
63628
|
+
finalize() {
|
|
63629
|
+
if (this.shouldInvalidateCache) {
|
|
63630
|
+
this.pivotPositionCache = new PositionMap();
|
|
63631
|
+
this.shouldInvalidateCache = false;
|
|
63632
|
+
}
|
|
63633
|
+
}
|
|
63598
63634
|
/**
|
|
63599
63635
|
* Get the id of the first pivot in the formula at the given position. Returns undefined if there
|
|
63600
63636
|
* is no pivot at this position
|
|
@@ -63606,9 +63642,14 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
63606
63642
|
* Get all of the ids of the pivot present in the formula at the given position.
|
|
63607
63643
|
*/
|
|
63608
63644
|
getPivotIdsFromPosition(position) {
|
|
63609
|
-
|
|
63610
|
-
|
|
63611
|
-
|
|
63645
|
+
if (!this.pivotPositionCache.has(position)) {
|
|
63646
|
+
const cell = this.getters.getCorrespondingFormulaCell(position);
|
|
63647
|
+
if (cell && cell.isFormula) {
|
|
63648
|
+
const pivotIds = this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
|
|
63649
|
+
this.pivotPositionCache.set(position, pivotIds);
|
|
63650
|
+
}
|
|
63651
|
+
}
|
|
63652
|
+
return this.pivotPositionCache.get(position) || [];
|
|
63612
63653
|
}
|
|
63613
63654
|
getPivotIdsFromFormula(sheetId, formula) {
|
|
63614
63655
|
return this.getPivotFunctions(sheetId, formula).map((pivotFunction) => {
|
|
@@ -65357,7 +65398,12 @@ var TableComputedStylePlugin = class extends UIPlugin {
|
|
|
65357
65398
|
computeTableStyle(sheetId, table) {
|
|
65358
65399
|
return lazy(() => {
|
|
65359
65400
|
const style = this.getters.getTableStyle(table.config.styleId);
|
|
65360
|
-
const
|
|
65401
|
+
const tableMetaDataAndConfig = this.getTableMetaData(sheetId, table);
|
|
65402
|
+
if (!tableMetaDataAndConfig) return {
|
|
65403
|
+
borders: {},
|
|
65404
|
+
styles: {}
|
|
65405
|
+
};
|
|
65406
|
+
const { tableMetaData, config } = tableMetaDataAndConfig;
|
|
65361
65407
|
const relativeTableStyle = getComputedTableStyle(config, style, tableMetaData);
|
|
65362
65408
|
const mapping = this.getTableMapping(sheetId, table);
|
|
65363
65409
|
const absoluteTableStyle = {
|
|
@@ -65395,6 +65441,7 @@ var TableComputedStylePlugin = class extends UIPlugin {
|
|
|
65395
65441
|
const pivotInfo = this.getters.getPivotStyleAtPosition(mainPosition);
|
|
65396
65442
|
if (!pivotInfo) throw new Error("No dynamic pivot info found at pivot table position");
|
|
65397
65443
|
const pivot = this.getters.getPivot(pivotInfo.pivotId);
|
|
65444
|
+
if (!pivot.isValid()) return;
|
|
65398
65445
|
const pivotStyle = pivotInfo.pivotStyle;
|
|
65399
65446
|
const maxRowDepth = pivot.getExpandedTableStructure().getNumberOfRowGroupBys();
|
|
65400
65447
|
const pivotCells = pivot.getCollapsedTableStructure().getPivotCells(pivotStyle);
|
|
@@ -81544,7 +81591,8 @@ const helpers = {
|
|
|
81544
81591
|
DateTime,
|
|
81545
81592
|
parseFormat,
|
|
81546
81593
|
isFormula,
|
|
81547
|
-
domainToColRowDomain
|
|
81594
|
+
domainToColRowDomain,
|
|
81595
|
+
PositionMap
|
|
81548
81596
|
};
|
|
81549
81597
|
const links = {
|
|
81550
81598
|
isMarkdownLink,
|
|
@@ -81664,6 +81712,6 @@ const chartHelpers = {
|
|
|
81664
81712
|
//#endregion
|
|
81665
81713
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CompiledFormula, CorePlugin, CoreViewPlugin, DEFAULT_LOCALE, DEFAULT_LOCALES, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, canExecuteInReadonly, categories, chartHelpers, components, constants, convertAstNodes, coreTypes, createAutocompleteArgumentsProvider, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, isCoreCommand, isSheetDependent, iterateAstNodes, links, load, lockedSheetAllowedCommands, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
81666
81714
|
|
|
81667
|
-
__info__.version = "19.2.
|
|
81668
|
-
__info__.date = "2026-07-
|
|
81669
|
-
__info__.hash = "
|
|
81715
|
+
__info__.version = "19.2.21";
|
|
81716
|
+
__info__.date = "2026-07-20T11:02:03.049Z";
|
|
81717
|
+
__info__.hash = "fba73fe";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 19.2.
|
|
6
|
-
* @date 2026-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.2.21
|
|
6
|
+
* @date 2026-07-20T11:02:03.049Z
|
|
7
|
+
* @hash fba73fe
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function(exports, _odoo_owl) {
|
|
@@ -6270,7 +6270,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
6270
6270
|
if (prefixSheet && !sheetName) return CellErrorType.InvalidReference;
|
|
6271
6271
|
let rangeString = getRangePartString(range, 0, options);
|
|
6272
6272
|
if (range.parts && range.parts.length === 2) {
|
|
6273
|
-
if (range.zone.top !== range.zone.bottom || range.zone.left !== range.zone.right || range.parts[0].rowFixed || range.parts[0].colFixed || range.parts[1].rowFixed || range.parts[1].colFixed) {
|
|
6273
|
+
if (range.zone.top !== range.zone.bottom || range.zone.left !== range.zone.right || range.parts[0].rowFixed || range.parts[0].colFixed || range.parts[1].rowFixed || range.parts[1].colFixed || options.doNotSimplifyRange) {
|
|
6274
6274
|
rangeString += ":";
|
|
6275
6275
|
rangeString += getRangePartString(range, 1, options);
|
|
6276
6276
|
}
|
|
@@ -40480,7 +40480,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
40480
40480
|
return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardKeyValue");
|
|
40481
40481
|
}
|
|
40482
40482
|
get isBaselineInvalid() {
|
|
40483
|
-
return !!this.state.
|
|
40483
|
+
return !!this.state.baselineDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
|
|
40484
40484
|
}
|
|
40485
40485
|
onKeyValueRangeChanged(ranges) {
|
|
40486
40486
|
this.keyValue = ranges[0];
|
|
@@ -43798,6 +43798,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43798
43798
|
const params = compileTokens(rangeTokenize(formula));
|
|
43799
43799
|
return new CompiledFormula(sheetId, params.tokens, params.literalValues, params.symbols, params.dependencies.map((xc) => getters.getRangeFromSheetXC(sheetId, xc)), params.isBadExpression, params.normalizedFormula, params.execute);
|
|
43800
43800
|
}
|
|
43801
|
+
areRangeShapesInLineWithNormalizedFormula() {
|
|
43802
|
+
return Array.from(this.normalizedFormula.matchAll(/\|C\||\|R\|/g)).every((value, index) => {
|
|
43803
|
+
return this.rangeDependencies[index].parts.length === 1 && value[0] === "|C|" || this.rangeDependencies[index].parts.length === 2 && value[0] === "|R|" || this.rangeDependencies[index].invalidXc || this.rangeDependencies[index].invalidSheetName;
|
|
43804
|
+
});
|
|
43805
|
+
}
|
|
43801
43806
|
};
|
|
43802
43807
|
function compileTokens(tokens) {
|
|
43803
43808
|
try {
|
|
@@ -55780,6 +55785,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55780
55785
|
alreadyAppliedNumberOffsets = [];
|
|
55781
55786
|
previousStrings = [];
|
|
55782
55787
|
baseFormulaWasTransformed = false;
|
|
55788
|
+
rangeToStringOptions = { doNotSimplifyRange: true };
|
|
55783
55789
|
constructor(getters) {
|
|
55784
55790
|
this.getters = getters;
|
|
55785
55791
|
}
|
|
@@ -55836,9 +55842,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55836
55842
|
let references = [];
|
|
55837
55843
|
if (!this.baseFormula || this.baseFormula.normalizedFormula !== cell.compiledFormula.normalizedFormula) {
|
|
55838
55844
|
this.resetBaseTo(cell.compiledFormula);
|
|
55839
|
-
return cell.compiledFormula.toFormulaString(this.getters);
|
|
55845
|
+
return cell.compiledFormula.toFormulaString(this.getters, this.rangeToStringOptions);
|
|
55840
55846
|
} else {
|
|
55841
|
-
if (!this.baseFormulaWasTransformed && deepEquals(cell.compiledFormula.literalValues, this.baseFormula.literalValues) && deepEquals(cell.compiledFormula.rangeDependencies, this.baseFormula.rangeDependencies)) return cell.compiledFormula.toFormulaString(this.getters);
|
|
55847
|
+
if (!this.baseFormulaWasTransformed && deepEquals(cell.compiledFormula.literalValues, this.baseFormula.literalValues) && deepEquals(cell.compiledFormula.rangeDependencies, this.baseFormula.rangeDependencies)) return cell.compiledFormula.toFormulaString(this.getters, this.rangeToStringOptions);
|
|
55842
55848
|
numbers = this.squishNumbers(cell.compiledFormula.literalValues.numbers);
|
|
55843
55849
|
strings = this.squishStrings(cell.compiledFormula.literalValues.strings);
|
|
55844
55850
|
references = this.squishReferences(cell.compiledFormula.rangeDependencies, forSheetId);
|
|
@@ -55881,23 +55887,23 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55881
55887
|
squishOneReference(reference, previousReferences, index, forSheetId) {
|
|
55882
55888
|
const previousReference = previousReferences[index];
|
|
55883
55889
|
if (deepEquals(previousReference, reference)) return "=";
|
|
55884
|
-
if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc) {
|
|
55890
|
+
if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc || previousReference.parts.length !== reference.parts.length) {
|
|
55885
55891
|
previousReferences[index] = deepCopy(reference);
|
|
55886
|
-
return getRangeString(reference, forSheetId, this.getters.getSheetName);
|
|
55892
|
+
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
55887
55893
|
}
|
|
55888
55894
|
if (previousReference.unboundedZone.bottom === void 0 || previousReference.unboundedZone.right === void 0 || reference.unboundedZone.bottom === void 0 || reference.unboundedZone.right === void 0) {
|
|
55889
55895
|
previousReferences[index] = deepCopy(reference);
|
|
55890
|
-
return getRangeString(reference, forSheetId, this.getters.getSheetName);
|
|
55896
|
+
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
55891
55897
|
}
|
|
55892
55898
|
for (let i = 0; i < reference.parts.length; i++) if (previousReference.parts[i].colFixed !== reference.parts[i].colFixed || previousReference.parts[i].rowFixed !== reference.parts[i].rowFixed) {
|
|
55893
55899
|
previousReferences[index] = deepCopy(reference);
|
|
55894
|
-
return getRangeString(reference, forSheetId, this.getters.getSheetName);
|
|
55900
|
+
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
55895
55901
|
}
|
|
55896
55902
|
const currentZone = reference.zone;
|
|
55897
55903
|
const previousZone = previousReference.zone;
|
|
55898
55904
|
if (currentZone.top !== currentZone.bottom || currentZone.left !== currentZone.right || previousZone.top !== previousZone.bottom || previousZone.left !== previousZone.right) {
|
|
55899
55905
|
previousReferences[index] = deepCopy(reference);
|
|
55900
|
-
return getRangeString(reference, forSheetId, this.getters.getSheetName);
|
|
55906
|
+
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
55901
55907
|
}
|
|
55902
55908
|
const diffCol = reference.zone.left - previousReference.zone.left;
|
|
55903
55909
|
const diffRow = reference.zone.top - previousReference.zone.top;
|
|
@@ -55905,7 +55911,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55905
55911
|
previousReference.unboundedZone = deepCopy(reference.unboundedZone);
|
|
55906
55912
|
if (diffCol !== 0 && diffRow === 0) return `${diffCol > 0 ? "+" : "-"}C${Math.abs(diffCol)}`;
|
|
55907
55913
|
else if (diffRow !== 0 && diffCol === 0) return `${diffRow > 0 ? "+" : "-"}R${Math.abs(diffRow)}`;
|
|
55908
|
-
return getRangeString(reference, forSheetId, this.getters.getSheetName);
|
|
55914
|
+
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
55909
55915
|
}
|
|
55910
55916
|
/**
|
|
55911
55917
|
* Squish the number parameters. Result for each parameter should be compared the previous formula.
|
|
@@ -56016,10 +56022,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56016
56022
|
break;
|
|
56017
56023
|
case "FIRST_OFFSET":
|
|
56018
56024
|
this.previousOffset = current;
|
|
56019
|
-
for (const position of positionsOfKey)
|
|
56020
|
-
|
|
56021
|
-
|
|
56022
|
-
|
|
56025
|
+
for (const position of positionsOfKey) {
|
|
56026
|
+
const result = this.unsquish(current, sheetId, getters);
|
|
56027
|
+
if (!result.areRangeShapesInLineWithNormalizedFormula()) {
|
|
56028
|
+
const formulaString = result.toFormulaString(getters);
|
|
56029
|
+
yield {
|
|
56030
|
+
position,
|
|
56031
|
+
compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
|
|
56032
|
+
};
|
|
56033
|
+
} else yield {
|
|
56034
|
+
position,
|
|
56035
|
+
compiled: result
|
|
56036
|
+
};
|
|
56037
|
+
}
|
|
56023
56038
|
break;
|
|
56024
56039
|
case "COMBINE_OFFSET":
|
|
56025
56040
|
if (!this.previousOffset) throw new Error("No previous offset to combine with");
|
|
@@ -56027,10 +56042,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56027
56042
|
this.previousOffset.N = currentOffset.N ?? this.previousOffset.N;
|
|
56028
56043
|
this.previousOffset.S = currentOffset.S ?? this.previousOffset.S;
|
|
56029
56044
|
this.previousOffset.R = currentOffset.R ?? this.previousOffset.R;
|
|
56030
|
-
for (const position of positionsOfKey)
|
|
56031
|
-
|
|
56032
|
-
|
|
56033
|
-
|
|
56045
|
+
for (const position of positionsOfKey) {
|
|
56046
|
+
const result = this.unsquish(this.previousOffset, sheetId, getters);
|
|
56047
|
+
if (!result.areRangeShapesInLineWithNormalizedFormula()) {
|
|
56048
|
+
const formulaString = result.toFormulaString(getters);
|
|
56049
|
+
yield {
|
|
56050
|
+
position,
|
|
56051
|
+
compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
|
|
56052
|
+
};
|
|
56053
|
+
} else yield {
|
|
56054
|
+
position,
|
|
56055
|
+
compiled: result
|
|
56056
|
+
};
|
|
56057
|
+
}
|
|
56034
56058
|
break;
|
|
56035
56059
|
}
|
|
56036
56060
|
}
|
|
@@ -63547,6 +63571,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63547
63571
|
pivots = {};
|
|
63548
63572
|
unusedPivotsInFormulas;
|
|
63549
63573
|
custom;
|
|
63574
|
+
pivotPositionCache = new PositionMap();
|
|
63575
|
+
shouldInvalidateCache = false;
|
|
63550
63576
|
constructor(config) {
|
|
63551
63577
|
super(config);
|
|
63552
63578
|
this.custom = config.custom;
|
|
@@ -63557,7 +63583,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63557
63583
|
}
|
|
63558
63584
|
}
|
|
63559
63585
|
handle(cmd) {
|
|
63560
|
-
if (invalidateEvaluationCommands.has(cmd.type))
|
|
63586
|
+
if (invalidateEvaluationCommands.has(cmd.type)) {
|
|
63587
|
+
this.shouldInvalidateCache = true;
|
|
63588
|
+
for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
|
|
63589
|
+
}
|
|
63590
|
+
if (cmd.type === "UPDATE_CELL") this.shouldInvalidateCache = true;
|
|
63561
63591
|
switch (cmd.type) {
|
|
63562
63592
|
case "REFRESH_PIVOT":
|
|
63563
63593
|
this.refreshPivot(cmd.id);
|
|
@@ -63597,6 +63627,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63597
63627
|
break;
|
|
63598
63628
|
}
|
|
63599
63629
|
}
|
|
63630
|
+
finalize() {
|
|
63631
|
+
if (this.shouldInvalidateCache) {
|
|
63632
|
+
this.pivotPositionCache = new PositionMap();
|
|
63633
|
+
this.shouldInvalidateCache = false;
|
|
63634
|
+
}
|
|
63635
|
+
}
|
|
63600
63636
|
/**
|
|
63601
63637
|
* Get the id of the first pivot in the formula at the given position. Returns undefined if there
|
|
63602
63638
|
* is no pivot at this position
|
|
@@ -63608,9 +63644,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63608
63644
|
* Get all of the ids of the pivot present in the formula at the given position.
|
|
63609
63645
|
*/
|
|
63610
63646
|
getPivotIdsFromPosition(position) {
|
|
63611
|
-
|
|
63612
|
-
|
|
63613
|
-
|
|
63647
|
+
if (!this.pivotPositionCache.has(position)) {
|
|
63648
|
+
const cell = this.getters.getCorrespondingFormulaCell(position);
|
|
63649
|
+
if (cell && cell.isFormula) {
|
|
63650
|
+
const pivotIds = this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
|
|
63651
|
+
this.pivotPositionCache.set(position, pivotIds);
|
|
63652
|
+
}
|
|
63653
|
+
}
|
|
63654
|
+
return this.pivotPositionCache.get(position) || [];
|
|
63614
63655
|
}
|
|
63615
63656
|
getPivotIdsFromFormula(sheetId, formula) {
|
|
63616
63657
|
return this.getPivotFunctions(sheetId, formula).map((pivotFunction) => {
|
|
@@ -65359,7 +65400,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65359
65400
|
computeTableStyle(sheetId, table) {
|
|
65360
65401
|
return lazy(() => {
|
|
65361
65402
|
const style = this.getters.getTableStyle(table.config.styleId);
|
|
65362
|
-
const
|
|
65403
|
+
const tableMetaDataAndConfig = this.getTableMetaData(sheetId, table);
|
|
65404
|
+
if (!tableMetaDataAndConfig) return {
|
|
65405
|
+
borders: {},
|
|
65406
|
+
styles: {}
|
|
65407
|
+
};
|
|
65408
|
+
const { tableMetaData, config } = tableMetaDataAndConfig;
|
|
65363
65409
|
const relativeTableStyle = getComputedTableStyle(config, style, tableMetaData);
|
|
65364
65410
|
const mapping = this.getTableMapping(sheetId, table);
|
|
65365
65411
|
const absoluteTableStyle = {
|
|
@@ -65397,6 +65443,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65397
65443
|
const pivotInfo = this.getters.getPivotStyleAtPosition(mainPosition);
|
|
65398
65444
|
if (!pivotInfo) throw new Error("No dynamic pivot info found at pivot table position");
|
|
65399
65445
|
const pivot = this.getters.getPivot(pivotInfo.pivotId);
|
|
65446
|
+
if (!pivot.isValid()) return;
|
|
65400
65447
|
const pivotStyle = pivotInfo.pivotStyle;
|
|
65401
65448
|
const maxRowDepth = pivot.getExpandedTableStructure().getNumberOfRowGroupBys();
|
|
65402
65449
|
const pivotCells = pivot.getCollapsedTableStructure().getPivotCells(pivotStyle);
|
|
@@ -81546,7 +81593,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
81546
81593
|
DateTime,
|
|
81547
81594
|
parseFormat,
|
|
81548
81595
|
isFormula,
|
|
81549
|
-
domainToColRowDomain
|
|
81596
|
+
domainToColRowDomain,
|
|
81597
|
+
PositionMap
|
|
81550
81598
|
};
|
|
81551
81599
|
const links = {
|
|
81552
81600
|
isMarkdownLink,
|
|
@@ -81724,8 +81772,8 @@ exports.stores = stores;
|
|
|
81724
81772
|
exports.tokenColors = tokenColors;
|
|
81725
81773
|
exports.tokenize = tokenize;
|
|
81726
81774
|
|
|
81727
|
-
__info__.version = "19.2.
|
|
81728
|
-
__info__.date = "2026-07-
|
|
81729
|
-
__info__.hash = "
|
|
81775
|
+
__info__.version = "19.2.21";
|
|
81776
|
+
__info__.date = "2026-07-20T11:02:03.049Z";
|
|
81777
|
+
__info__.hash = "fba73fe";
|
|
81730
81778
|
|
|
81731
81779
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|