@odoo/o-spreadsheet 18.2.39 → 18.2.41
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.cjs.js +147 -61
- package/dist/o-spreadsheet.d.ts +21 -15
- package/dist/o-spreadsheet.esm.js +147 -61
- package/dist/o-spreadsheet.iife.js +147 -61
- package/dist/o-spreadsheet.iife.min.js +401 -401
- package/dist/o_spreadsheet.css +3 -3
- package/dist/o_spreadsheet.xml +5 -4
- package/package.json +1 -1
|
@@ -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 18.2.
|
|
6
|
-
* @date
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.41
|
|
6
|
+
* @date 2026-01-21T11:04:23.927Z
|
|
7
|
+
* @hash 2d9316b
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
return children
|
|
34
34
|
.map((child) => (typeof child === "function" ? child(env) : child))
|
|
35
35
|
.flat()
|
|
36
|
-
.map(createAction)
|
|
36
|
+
.map(createAction)
|
|
37
|
+
.sort((a, b) => a.sequence - b.sequence);
|
|
37
38
|
}
|
|
38
39
|
: () => [],
|
|
39
40
|
isReadonlyAllowed: item.isReadonlyAllowed || false,
|
|
@@ -303,6 +304,7 @@
|
|
|
303
304
|
fillColor: "",
|
|
304
305
|
textColor: "",
|
|
305
306
|
};
|
|
307
|
+
const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
|
|
306
308
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
307
309
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
308
310
|
// Fonts
|
|
@@ -6492,11 +6494,20 @@
|
|
|
6492
6494
|
/**
|
|
6493
6495
|
* Get the default height of the cell given its style.
|
|
6494
6496
|
*/
|
|
6495
|
-
function getDefaultCellHeight(ctx, cell, colSize) {
|
|
6497
|
+
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
6496
6498
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
6497
6499
|
return DEFAULT_CELL_HEIGHT;
|
|
6498
6500
|
}
|
|
6499
|
-
|
|
6501
|
+
let content = "";
|
|
6502
|
+
try {
|
|
6503
|
+
if (!cell.isFormula) {
|
|
6504
|
+
const localeFormat = { format: cell.format, locale };
|
|
6505
|
+
content = formatValue(parseLiteral(cell.content, locale), localeFormat);
|
|
6506
|
+
}
|
|
6507
|
+
}
|
|
6508
|
+
catch {
|
|
6509
|
+
content = CellErrorType.GenericError;
|
|
6510
|
+
}
|
|
6500
6511
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
6501
6512
|
}
|
|
6502
6513
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
@@ -19118,9 +19129,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19118
19129
|
throw new EvaluationError(_t("Function PIVOT takes an even number of arguments."));
|
|
19119
19130
|
}
|
|
19120
19131
|
}
|
|
19121
|
-
function addPivotDependencies(evalContext,
|
|
19132
|
+
function addPivotDependencies(evalContext, pivotId, forMeasures) {
|
|
19122
19133
|
//TODO This function can be very costly when used with PIVOT.VALUE and PIVOT.HEADER
|
|
19123
19134
|
const dependencies = [];
|
|
19135
|
+
const coreDefinition = evalContext.getters.getPivotCoreDefinition(pivotId);
|
|
19124
19136
|
if (coreDefinition.type === "SPREADSHEET" && coreDefinition.dataSet) {
|
|
19125
19137
|
const { sheetId, zone } = coreDefinition.dataSet;
|
|
19126
19138
|
const xc = zoneToXc(zone);
|
|
@@ -19137,8 +19149,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19137
19149
|
}
|
|
19138
19150
|
for (const measure of forMeasures) {
|
|
19139
19151
|
if (measure.computedBy) {
|
|
19140
|
-
|
|
19141
|
-
dependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
|
|
19152
|
+
dependencies.push(...evalContext.getters.getMeasureFullDependencies(pivotId, measure));
|
|
19142
19153
|
}
|
|
19143
19154
|
}
|
|
19144
19155
|
const originPosition = evalContext.__originCellPosition;
|
|
@@ -19579,7 +19590,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19579
19590
|
assertDomainLength(domainArgs);
|
|
19580
19591
|
const pivot = this.getters.getPivot(pivotId);
|
|
19581
19592
|
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
|
|
19582
|
-
addPivotDependencies(this,
|
|
19593
|
+
addPivotDependencies(this, pivotId, coreDefinition.measures.filter((m) => m.id === _measure));
|
|
19583
19594
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19584
19595
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19585
19596
|
if (error) {
|
|
@@ -19612,8 +19623,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19612
19623
|
const _pivotId = getPivotId(_pivotFormulaId, this.getters);
|
|
19613
19624
|
assertDomainLength(domainArgs);
|
|
19614
19625
|
const pivot = this.getters.getPivot(_pivotId);
|
|
19615
|
-
|
|
19616
|
-
addPivotDependencies(this, coreDefinition, []);
|
|
19626
|
+
addPivotDependencies(this, _pivotId, []);
|
|
19617
19627
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19618
19628
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19619
19629
|
if (error) {
|
|
@@ -19667,7 +19677,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19667
19677
|
const pivotId = getPivotId(_pivotFormulaId, this.getters);
|
|
19668
19678
|
const pivot = this.getters.getPivot(pivotId);
|
|
19669
19679
|
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
|
|
19670
|
-
addPivotDependencies(this,
|
|
19680
|
+
addPivotDependencies(this, pivotId, coreDefinition.measures);
|
|
19671
19681
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19672
19682
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19673
19683
|
if (error) {
|
|
@@ -20893,7 +20903,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
20893
20903
|
}
|
|
20894
20904
|
acceptToVectorize.push(!argDefinition.acceptMatrix);
|
|
20895
20905
|
}
|
|
20896
|
-
return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
|
|
20906
|
+
return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
|
|
20907
|
+
}
|
|
20908
|
+
function replaceErrorPlaceholderInResult(result) {
|
|
20909
|
+
if (!isMatrix(result)) {
|
|
20910
|
+
replaceFunctionNamePlaceholder(result, functionName);
|
|
20911
|
+
}
|
|
20912
|
+
else {
|
|
20913
|
+
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
|
|
20914
|
+
}
|
|
20915
|
+
return result;
|
|
20897
20916
|
}
|
|
20898
20917
|
function errorHandlingCompute(...args) {
|
|
20899
20918
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -20920,13 +20939,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
20920
20939
|
const result = descr.compute.apply(this, args);
|
|
20921
20940
|
if (!isMatrix(result)) {
|
|
20922
20941
|
if (typeof result === "object" && result !== null && "value" in result) {
|
|
20923
|
-
replaceFunctionNamePlaceholder(result, functionName);
|
|
20924
20942
|
return result;
|
|
20925
20943
|
}
|
|
20926
20944
|
return { value: result };
|
|
20927
20945
|
}
|
|
20928
20946
|
if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
|
|
20929
|
-
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
|
|
20930
20947
|
return result;
|
|
20931
20948
|
}
|
|
20932
20949
|
return matrixMap(result, (row) => ({ value: row }));
|
|
@@ -21324,7 +21341,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
21324
21341
|
}
|
|
21325
21342
|
captureSelection(zone, col, row) {
|
|
21326
21343
|
this.model.selection.capture(this, {
|
|
21327
|
-
cell: { col: col ?? zone.left, row: row ?? zone.
|
|
21344
|
+
cell: { col: col ?? zone.left, row: row ?? zone.top },
|
|
21328
21345
|
zone,
|
|
21329
21346
|
}, {
|
|
21330
21347
|
handleEvent: this.handleEvent.bind(this),
|
|
@@ -24839,6 +24856,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24839
24856
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
24840
24857
|
: undefined,
|
|
24841
24858
|
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : undefined,
|
|
24859
|
+
shrinkToFit: style.wrapping === "clip" ? true : undefined,
|
|
24842
24860
|
},
|
|
24843
24861
|
};
|
|
24844
24862
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -24859,6 +24877,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24859
24877
|
vertical: styles.alignment.vertical,
|
|
24860
24878
|
horizontal: styles.alignment.horizontal,
|
|
24861
24879
|
wrapText: styles.alignment.wrapText,
|
|
24880
|
+
shrinkToFit: styles.alignment.shrinkToFit,
|
|
24862
24881
|
},
|
|
24863
24882
|
};
|
|
24864
24883
|
return pushElement(style, construct.styles);
|
|
@@ -40551,7 +40570,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
40551
40570
|
});
|
|
40552
40571
|
dataRange = this.props.definition.dataRange;
|
|
40553
40572
|
get configurationErrorMessages() {
|
|
40554
|
-
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])];
|
|
40573
|
+
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
40555
40574
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
40556
40575
|
}
|
|
40557
40576
|
get isDataRangeInvalid() {
|
|
@@ -41818,7 +41837,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41818
41837
|
});
|
|
41819
41838
|
}
|
|
41820
41839
|
get designErrorMessages() {
|
|
41821
|
-
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])];
|
|
41840
|
+
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
41822
41841
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
41823
41842
|
}
|
|
41824
41843
|
get isRangeMinInvalid() {
|
|
@@ -42139,7 +42158,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42139
42158
|
const cancelledReasons = [
|
|
42140
42159
|
...(this.state.keyValueDispatchResult?.reasons || []),
|
|
42141
42160
|
...(this.state.baselineDispatchResult?.reasons || []),
|
|
42142
|
-
];
|
|
42161
|
+
].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
42143
42162
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
42144
42163
|
}
|
|
42145
42164
|
get isKeyValueInvalid() {
|
|
@@ -44865,6 +44884,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44865
44884
|
case "ACTIVATE_SHEET":
|
|
44866
44885
|
this.isSearchDirty = true;
|
|
44867
44886
|
this.shouldFinalizeUpdateSelection = true;
|
|
44887
|
+
if (this.searchOptions.specificRange) {
|
|
44888
|
+
this.searchOptions.specificRange = this.searchOptions.specificRange.clone({
|
|
44889
|
+
sheetId: this.getters.getActiveSheetId(),
|
|
44890
|
+
});
|
|
44891
|
+
}
|
|
44868
44892
|
break;
|
|
44869
44893
|
case "REPLACE_SEARCH":
|
|
44870
44894
|
for (const match of cmd.matches) {
|
|
@@ -45286,9 +45310,20 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45286
45310
|
const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
|
|
45287
45311
|
this.store.updateSearchOptions({ specificRange });
|
|
45288
45312
|
}
|
|
45313
|
+
get specificRange() {
|
|
45314
|
+
const range = this.store.searchOptions.specificRange;
|
|
45315
|
+
return range ? this.env.model.getters.getRangeString(range, "forceSheetReference") : "";
|
|
45316
|
+
}
|
|
45289
45317
|
get pendingSearch() {
|
|
45290
45318
|
return this.updateSearchContent.isDebouncePending();
|
|
45291
45319
|
}
|
|
45320
|
+
get selectionInputKey() {
|
|
45321
|
+
// Selections input are made to work with objects linked to a sheet id. They store the active sheet id at their creation,
|
|
45322
|
+
// and have specific behaviour linked to it (eg. go back to the initial sheet after confirmation).
|
|
45323
|
+
// We don't want all those behaviors here, so we force the recreation of the component when the active sheet changes.
|
|
45324
|
+
// The only drawback is that the input loses focus when changing sheet.
|
|
45325
|
+
return this.env.model.getters.getActiveSheetId();
|
|
45326
|
+
}
|
|
45292
45327
|
}
|
|
45293
45328
|
|
|
45294
45329
|
css /* scss */ `
|
|
@@ -55199,7 +55234,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55199
55234
|
for (const position of positions) {
|
|
55200
55235
|
const cell = this.getters.getCell(position);
|
|
55201
55236
|
const xc = toXC(position.col, position.row);
|
|
55202
|
-
const style = this.
|
|
55237
|
+
const style = this.extractCustomStyle(cell);
|
|
55203
55238
|
if (Object.keys(style).length) {
|
|
55204
55239
|
const styleId = getItemId(style, styles);
|
|
55205
55240
|
positionsByStyle[styleId] ??= [];
|
|
@@ -55245,10 +55280,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55245
55280
|
}
|
|
55246
55281
|
}
|
|
55247
55282
|
}
|
|
55248
|
-
|
|
55249
|
-
const cleanedStyle = { ...style };
|
|
55250
|
-
|
|
55251
|
-
|
|
55283
|
+
extractCustomStyle(cell) {
|
|
55284
|
+
const cleanedStyle = { ...cell.style };
|
|
55285
|
+
const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
|
|
55286
|
+
? DEFAULT_NUMBER_STYLE
|
|
55287
|
+
: DEFAULT_STYLE;
|
|
55288
|
+
for (const property in cleanedStyle) {
|
|
55289
|
+
if ((property !== "align" || !cell.isFormula) &&
|
|
55290
|
+
cleanedStyle[property] === defaultStyle[property]) {
|
|
55252
55291
|
delete cleanedStyle[property];
|
|
55253
55292
|
}
|
|
55254
55293
|
}
|
|
@@ -59819,6 +59858,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59819
59858
|
"getMeasureCompiledFormula",
|
|
59820
59859
|
"getPivotName",
|
|
59821
59860
|
"isExistingPivot",
|
|
59861
|
+
"getMeasureFullDependencies",
|
|
59822
59862
|
];
|
|
59823
59863
|
nextFormulaId = 1;
|
|
59824
59864
|
pivots = {};
|
|
@@ -59901,7 +59941,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59901
59941
|
}
|
|
59902
59942
|
case "UPDATE_PIVOT": {
|
|
59903
59943
|
this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
|
|
59904
|
-
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
59944
|
+
this.compileCalculatedMeasures(cmd.pivotId, cmd.pivot.measures);
|
|
59905
59945
|
break;
|
|
59906
59946
|
}
|
|
59907
59947
|
}
|
|
@@ -59919,9 +59959,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59919
59959
|
this.history.update("pivots", pivotId, "definition", newDefinition);
|
|
59920
59960
|
}
|
|
59921
59961
|
}
|
|
59922
|
-
for (const
|
|
59923
|
-
for (const
|
|
59924
|
-
const
|
|
59962
|
+
for (const pivotId in this.compiledMeasureFormulas) {
|
|
59963
|
+
for (const measureId in this.compiledMeasureFormulas[pivotId]) {
|
|
59964
|
+
const measure = this.pivots[pivotId]?.definition.measures.find((m) => m.id === measureId);
|
|
59965
|
+
if (!measure || !measure.computedBy) {
|
|
59966
|
+
continue;
|
|
59967
|
+
}
|
|
59968
|
+
const sheetId = measure.computedBy.sheetId;
|
|
59969
|
+
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId].formula;
|
|
59925
59970
|
const newDependencies = [];
|
|
59926
59971
|
for (const range of compiledFormula.dependencies) {
|
|
59927
59972
|
const change = applyChange(range);
|
|
@@ -59933,8 +59978,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59933
59978
|
}
|
|
59934
59979
|
}
|
|
59935
59980
|
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
59936
|
-
|
|
59937
|
-
|
|
59981
|
+
const oldFormulaString = measure.computedBy.formula;
|
|
59982
|
+
if (newFormulaString !== oldFormulaString) {
|
|
59983
|
+
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
59938
59984
|
}
|
|
59939
59985
|
}
|
|
59940
59986
|
}
|
|
@@ -59972,12 +60018,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59972
60018
|
isExistingPivot(pivotId) {
|
|
59973
60019
|
return pivotId in this.pivots;
|
|
59974
60020
|
}
|
|
59975
|
-
getMeasureCompiledFormula(measure) {
|
|
60021
|
+
getMeasureCompiledFormula(pivotId, measure) {
|
|
59976
60022
|
if (!measure.computedBy) {
|
|
59977
60023
|
throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
|
|
59978
60024
|
}
|
|
59979
|
-
|
|
59980
|
-
|
|
60025
|
+
return this.compiledMeasureFormulas[pivotId][measure.id].formula;
|
|
60026
|
+
}
|
|
60027
|
+
getMeasureFullDependencies(pivotId, measure) {
|
|
60028
|
+
if (!measure.computedBy) {
|
|
60029
|
+
throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
|
|
60030
|
+
}
|
|
60031
|
+
return this.compiledMeasureFormulas[pivotId][measure.id].dependencies;
|
|
59981
60032
|
}
|
|
59982
60033
|
// -------------------------------------------------------------------------
|
|
59983
60034
|
// Private
|
|
@@ -59987,19 +60038,43 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59987
60038
|
definition: this.repairSortedColumn(deepCopy(pivot)),
|
|
59988
60039
|
formulaId,
|
|
59989
60040
|
});
|
|
59990
|
-
this.compileCalculatedMeasures(pivot.measures);
|
|
60041
|
+
this.compileCalculatedMeasures(pivotId, pivot.measures);
|
|
59991
60042
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
59992
60043
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
59993
60044
|
}
|
|
59994
|
-
compileCalculatedMeasures(measures) {
|
|
60045
|
+
compileCalculatedMeasures(pivotId, measures) {
|
|
59995
60046
|
for (const measure of measures) {
|
|
59996
60047
|
if (measure.computedBy) {
|
|
59997
|
-
const sheetId = measure.computedBy.sheetId;
|
|
59998
60048
|
const compiledFormula = this.compileMeasureFormula(measure.computedBy.sheetId, measure.computedBy.formula);
|
|
59999
|
-
this.history.update("compiledMeasureFormulas",
|
|
60049
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "formula", compiledFormula);
|
|
60050
|
+
}
|
|
60051
|
+
}
|
|
60052
|
+
for (const measure of measures) {
|
|
60053
|
+
if (measure.computedBy) {
|
|
60054
|
+
const dependencies = this.computeMeasureFullDependencies(pivotId, measure);
|
|
60055
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", dependencies);
|
|
60000
60056
|
}
|
|
60001
60057
|
}
|
|
60002
60058
|
}
|
|
60059
|
+
computeMeasureFullDependencies(pivotId, measure, exploredMeasures = new Set()) {
|
|
60060
|
+
const rangeDependencies = [];
|
|
60061
|
+
const definition = this.getPivotCoreDefinition(pivotId);
|
|
60062
|
+
const formula = this.getMeasureCompiledFormula(pivotId, measure);
|
|
60063
|
+
exploredMeasures.add(measure.id);
|
|
60064
|
+
for (const token of formula.tokens) {
|
|
60065
|
+
if (token.type !== "SYMBOL") {
|
|
60066
|
+
continue;
|
|
60067
|
+
}
|
|
60068
|
+
const otherMeasure = definition.measures.find((measureCandidate) => getCanonicalSymbolName(measureCandidate.id) === token.value &&
|
|
60069
|
+
measure.id !== measureCandidate.id);
|
|
60070
|
+
if (!otherMeasure || exploredMeasures.has(otherMeasure.id) || !otherMeasure.computedBy) {
|
|
60071
|
+
continue;
|
|
60072
|
+
}
|
|
60073
|
+
rangeDependencies.push(...this.computeMeasureFullDependencies(pivotId, otherMeasure, exploredMeasures));
|
|
60074
|
+
}
|
|
60075
|
+
rangeDependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
|
|
60076
|
+
return rangeDependencies;
|
|
60077
|
+
}
|
|
60003
60078
|
insertPivot(position, formulaId, table) {
|
|
60004
60079
|
this.resizeSheet(position.sheetId, position, table);
|
|
60005
60080
|
const pivotCells = table.getPivotCells();
|
|
@@ -60056,21 +60131,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60056
60131
|
dependencies: rangeDependencies,
|
|
60057
60132
|
};
|
|
60058
60133
|
}
|
|
60059
|
-
replaceMeasureFormula(
|
|
60060
|
-
|
|
60061
|
-
|
|
60062
|
-
|
|
60063
|
-
const pivot = this.pivots[pivotId];
|
|
60064
|
-
if (!pivot) {
|
|
60065
|
-
continue;
|
|
60066
|
-
}
|
|
60067
|
-
for (const measure of pivot.definition.measures) {
|
|
60068
|
-
if (measure.computedBy?.formula === formulaString) {
|
|
60069
|
-
const measureIndex = pivot.definition.measures.indexOf(measure);
|
|
60070
|
-
this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
|
|
60071
|
-
}
|
|
60072
|
-
}
|
|
60134
|
+
replaceMeasureFormula(pivotId, measure, newFormulaString) {
|
|
60135
|
+
const pivot = this.pivots[pivotId];
|
|
60136
|
+
if (!pivot) {
|
|
60137
|
+
return;
|
|
60073
60138
|
}
|
|
60139
|
+
const measureIndex = pivot.definition.measures.indexOf(measure);
|
|
60140
|
+
this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", {
|
|
60141
|
+
formula: newFormulaString,
|
|
60142
|
+
sheetId: measure.computedBy.sheetId,
|
|
60143
|
+
});
|
|
60144
|
+
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
60074
60145
|
}
|
|
60075
60146
|
checkDuplicatedMeasureIds(definition) {
|
|
60076
60147
|
const uniqueIds = new Set(definition.measures.map((m) => m.id));
|
|
@@ -61467,11 +61538,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61467
61538
|
return this.arrayFormulasToResults.get(formulasPosition);
|
|
61468
61539
|
}
|
|
61469
61540
|
/**
|
|
61470
|
-
* Remove a
|
|
61541
|
+
* Remove a spreading relation for a given array formula position
|
|
61542
|
+
* and its result zone
|
|
61471
61543
|
*/
|
|
61472
61544
|
removeNode(position) {
|
|
61545
|
+
const resultZone = this.arrayFormulasToResults.get(position);
|
|
61546
|
+
if (!resultZone) {
|
|
61547
|
+
return;
|
|
61548
|
+
}
|
|
61473
61549
|
this.resultsToArrayFormulas.remove({
|
|
61474
|
-
boundingBox: { sheetId: position.sheetId, zone:
|
|
61550
|
+
boundingBox: { sheetId: position.sheetId, zone: resultZone },
|
|
61475
61551
|
data: position,
|
|
61476
61552
|
});
|
|
61477
61553
|
this.arrayFormulasToResults.delete(position);
|
|
@@ -61759,6 +61835,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61759
61835
|
// empty matrix
|
|
61760
61836
|
return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
|
|
61761
61837
|
}
|
|
61838
|
+
if (nbRows === 1 && nbColumns === 1) {
|
|
61839
|
+
// single value matrix
|
|
61840
|
+
return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
|
|
61841
|
+
}
|
|
61762
61842
|
const resultZone = {
|
|
61763
61843
|
top: formulaPosition.row,
|
|
61764
61844
|
bottom: formulaPosition.row + nbRows - 1,
|
|
@@ -63183,6 +63263,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63183
63263
|
handle(cmd) {
|
|
63184
63264
|
switch (cmd.type) {
|
|
63185
63265
|
case "START":
|
|
63266
|
+
case "UPDATE_LOCALE":
|
|
63186
63267
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
63187
63268
|
this.initializeSheet(sheetId);
|
|
63188
63269
|
}
|
|
@@ -63288,7 +63369,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63288
63369
|
}
|
|
63289
63370
|
const cell = this.getters.getCell(position);
|
|
63290
63371
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
63291
|
-
return getDefaultCellHeight(this.ctx, cell, colSize);
|
|
63372
|
+
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
63292
63373
|
}
|
|
63293
63374
|
isInMultiRowMerge(position) {
|
|
63294
63375
|
const merge = this.getters.getMerge(position);
|
|
@@ -63335,14 +63416,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63335
63416
|
function withPivotPresentationLayer (PivotClass) {
|
|
63336
63417
|
class PivotPresentationLayer extends PivotClass {
|
|
63337
63418
|
getters;
|
|
63419
|
+
pivotId;
|
|
63338
63420
|
cache = {};
|
|
63339
63421
|
rankAsc = {};
|
|
63340
63422
|
rankDesc = {};
|
|
63341
63423
|
runningTotal = {};
|
|
63342
63424
|
runningTotalInPercent = {};
|
|
63343
|
-
constructor(custom, params) {
|
|
63425
|
+
constructor(pivotId, custom, params) {
|
|
63344
63426
|
super(custom, params);
|
|
63345
63427
|
this.getters = params.getters;
|
|
63428
|
+
this.pivotId = pivotId;
|
|
63346
63429
|
}
|
|
63347
63430
|
markAsDirtyForEvaluation() {
|
|
63348
63431
|
this.cache = {};
|
|
@@ -63392,7 +63475,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63392
63475
|
return handleError(error, measure.aggregator.toUpperCase());
|
|
63393
63476
|
}
|
|
63394
63477
|
}
|
|
63395
|
-
const formula = this.getters.getMeasureCompiledFormula(measure);
|
|
63478
|
+
const formula = this.getters.getMeasureCompiledFormula(this.pivotId, measure);
|
|
63396
63479
|
const getSymbolValue = (symbolName) => {
|
|
63397
63480
|
const { columns, rows } = this.definition;
|
|
63398
63481
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
@@ -64120,7 +64203,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
64120
64203
|
const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
|
|
64121
64204
|
if (!(pivotId in this.pivots)) {
|
|
64122
64205
|
const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
|
|
64123
|
-
this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
|
|
64206
|
+
this.pivots[pivotId] = new Pivot(pivotId, this.custom, { definition, getters: this.getters });
|
|
64124
64207
|
}
|
|
64125
64208
|
else if (recreate) {
|
|
64126
64209
|
this.pivots[pivotId].onDefinitionChange(definition);
|
|
@@ -75926,6 +76009,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
75926
76009
|
if (style.alignment && style.alignment.wrapText) {
|
|
75927
76010
|
alignAttrs.push(["wrapText", "1"]);
|
|
75928
76011
|
}
|
|
76012
|
+
if (style.alignment && style.alignment.shrinkToFit) {
|
|
76013
|
+
alignAttrs.push(["shrinkToFit", "1"]);
|
|
76014
|
+
}
|
|
75929
76015
|
if (alignAttrs.length > 0) {
|
|
75930
76016
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
75931
76017
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
@@ -77420,9 +77506,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
77420
77506
|
exports.tokenize = tokenize;
|
|
77421
77507
|
|
|
77422
77508
|
|
|
77423
|
-
__info__.version = "18.2.
|
|
77424
|
-
__info__.date = "
|
|
77425
|
-
__info__.hash = "
|
|
77509
|
+
__info__.version = "18.2.41";
|
|
77510
|
+
__info__.date = "2026-01-21T11:04:23.927Z";
|
|
77511
|
+
__info__.hash = "2d9316b";
|
|
77426
77512
|
|
|
77427
77513
|
|
|
77428
77514
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|