@odoo/o-spreadsheet 18.0.53 → 18.0.55
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 +144 -58
- package/dist/o-spreadsheet.d.ts +11 -5
- package/dist/o-spreadsheet.esm.js +144 -58
- package/dist/o-spreadsheet.iife.js +144 -58
- package/dist/o-spreadsheet.iife.min.js +378 -378
- 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.0.
|
|
6
|
-
* @date
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.55
|
|
6
|
+
* @date 2026-01-21T11:03:48.979Z
|
|
7
|
+
* @hash 0c94015
|
|
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,
|
|
@@ -301,6 +302,7 @@
|
|
|
301
302
|
fillColor: "",
|
|
302
303
|
textColor: "",
|
|
303
304
|
};
|
|
305
|
+
const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
|
|
304
306
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
305
307
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
306
308
|
// Fonts
|
|
@@ -6314,11 +6316,20 @@
|
|
|
6314
6316
|
/**
|
|
6315
6317
|
* Get the default height of the cell given its style.
|
|
6316
6318
|
*/
|
|
6317
|
-
function getDefaultCellHeight(ctx, cell, colSize) {
|
|
6319
|
+
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
6318
6320
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
6319
6321
|
return DEFAULT_CELL_HEIGHT;
|
|
6320
6322
|
}
|
|
6321
|
-
|
|
6323
|
+
let content = "";
|
|
6324
|
+
try {
|
|
6325
|
+
if (!cell.isFormula) {
|
|
6326
|
+
const localeFormat = { format: cell.format, locale };
|
|
6327
|
+
content = formatValue(parseLiteral(cell.content, locale), localeFormat);
|
|
6328
|
+
}
|
|
6329
|
+
}
|
|
6330
|
+
catch {
|
|
6331
|
+
content = CellErrorType.GenericError;
|
|
6332
|
+
}
|
|
6322
6333
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
6323
6334
|
}
|
|
6324
6335
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
@@ -18564,9 +18575,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18564
18575
|
throw new EvaluationError(_t("Function PIVOT takes an even number of arguments."));
|
|
18565
18576
|
}
|
|
18566
18577
|
}
|
|
18567
|
-
function addPivotDependencies(evalContext,
|
|
18578
|
+
function addPivotDependencies(evalContext, pivotId, forMeasures) {
|
|
18568
18579
|
//TODO This function can be very costly when used with PIVOT.VALUE and PIVOT.HEADER
|
|
18569
18580
|
const dependencies = [];
|
|
18581
|
+
const coreDefinition = evalContext.getters.getPivotCoreDefinition(pivotId);
|
|
18570
18582
|
if (coreDefinition.type === "SPREADSHEET" && coreDefinition.dataSet) {
|
|
18571
18583
|
const { sheetId, zone } = coreDefinition.dataSet;
|
|
18572
18584
|
const xc = zoneToXc(zone);
|
|
@@ -18583,8 +18595,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18583
18595
|
}
|
|
18584
18596
|
for (const measure of forMeasures) {
|
|
18585
18597
|
if (measure.computedBy) {
|
|
18586
|
-
|
|
18587
|
-
dependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
|
|
18598
|
+
dependencies.push(...evalContext.getters.getMeasureFullDependencies(pivotId, measure));
|
|
18588
18599
|
}
|
|
18589
18600
|
}
|
|
18590
18601
|
const originPosition = evalContext.__originCellPosition;
|
|
@@ -19025,7 +19036,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19025
19036
|
assertDomainLength(domainArgs);
|
|
19026
19037
|
const pivot = this.getters.getPivot(pivotId);
|
|
19027
19038
|
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
|
|
19028
|
-
addPivotDependencies(this,
|
|
19039
|
+
addPivotDependencies(this, pivotId, coreDefinition.measures.filter((m) => m.id === _measure));
|
|
19029
19040
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19030
19041
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19031
19042
|
if (error) {
|
|
@@ -19058,8 +19069,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19058
19069
|
const _pivotId = getPivotId(_pivotFormulaId, this.getters);
|
|
19059
19070
|
assertDomainLength(domainArgs);
|
|
19060
19071
|
const pivot = this.getters.getPivot(_pivotId);
|
|
19061
|
-
|
|
19062
|
-
addPivotDependencies(this, coreDefinition, []);
|
|
19072
|
+
addPivotDependencies(this, _pivotId, []);
|
|
19063
19073
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19064
19074
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19065
19075
|
if (error) {
|
|
@@ -19113,7 +19123,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19113
19123
|
const pivotId = getPivotId(_pivotFormulaId, this.getters);
|
|
19114
19124
|
const pivot = this.getters.getPivot(pivotId);
|
|
19115
19125
|
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
|
|
19116
|
-
addPivotDependencies(this,
|
|
19126
|
+
addPivotDependencies(this, pivotId, coreDefinition.measures);
|
|
19117
19127
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19118
19128
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19119
19129
|
if (error) {
|
|
@@ -20321,7 +20331,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
20321
20331
|
}
|
|
20322
20332
|
acceptToVectorize.push(!argDefinition.acceptMatrix);
|
|
20323
20333
|
}
|
|
20324
|
-
return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
|
|
20334
|
+
return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
|
|
20335
|
+
}
|
|
20336
|
+
function replaceErrorPlaceholderInResult(result) {
|
|
20337
|
+
if (!isMatrix(result)) {
|
|
20338
|
+
replaceFunctionNamePlaceholder(result, functionName);
|
|
20339
|
+
}
|
|
20340
|
+
else {
|
|
20341
|
+
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
|
|
20342
|
+
}
|
|
20343
|
+
return result;
|
|
20325
20344
|
}
|
|
20326
20345
|
function errorHandlingCompute(...args) {
|
|
20327
20346
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -20345,13 +20364,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
20345
20364
|
const result = descr.compute.apply(this, args);
|
|
20346
20365
|
if (!isMatrix(result)) {
|
|
20347
20366
|
if (typeof result === "object" && result !== null && "value" in result) {
|
|
20348
|
-
replaceFunctionNamePlaceholder(result, functionName);
|
|
20349
20367
|
return result;
|
|
20350
20368
|
}
|
|
20351
20369
|
return { value: result };
|
|
20352
20370
|
}
|
|
20353
20371
|
if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
|
|
20354
|
-
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
|
|
20355
20372
|
return result;
|
|
20356
20373
|
}
|
|
20357
20374
|
return matrixMap(result, (row) => ({ value: row }));
|
|
@@ -21797,6 +21814,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
21797
21814
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
21798
21815
|
: undefined,
|
|
21799
21816
|
wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
|
|
21817
|
+
shrinkToFit: style.wrapping === "clip" ? true : undefined,
|
|
21800
21818
|
},
|
|
21801
21819
|
};
|
|
21802
21820
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -21823,6 +21841,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
21823
21841
|
vertical: styles.alignment.vertical,
|
|
21824
21842
|
horizontal: styles.alignment.horizontal,
|
|
21825
21843
|
wrapText: styles.alignment.wrapText,
|
|
21844
|
+
shrinkToFit: styles.alignment.shrinkToFit,
|
|
21826
21845
|
},
|
|
21827
21846
|
};
|
|
21828
21847
|
return pushElement(style, construct.styles);
|
|
@@ -42460,6 +42479,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42460
42479
|
case "UPDATE_CELL":
|
|
42461
42480
|
case "ACTIVATE_SHEET":
|
|
42462
42481
|
this.isSearchDirty = true;
|
|
42482
|
+
if (this.searchOptions.specificRange) {
|
|
42483
|
+
this.searchOptions.specificRange = this.searchOptions.specificRange.clone({
|
|
42484
|
+
sheetId: this.getters.getActiveSheetId(),
|
|
42485
|
+
});
|
|
42486
|
+
}
|
|
42463
42487
|
break;
|
|
42464
42488
|
case "REPLACE_SEARCH":
|
|
42465
42489
|
for (const match of cmd.matches) {
|
|
@@ -42865,9 +42889,20 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42865
42889
|
const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
|
|
42866
42890
|
this.store.updateSearchOptions({ specificRange });
|
|
42867
42891
|
}
|
|
42892
|
+
get specificRange() {
|
|
42893
|
+
const range = this.store.searchOptions.specificRange;
|
|
42894
|
+
return range ? this.env.model.getters.getRangeString(range, "forceSheetReference") : "";
|
|
42895
|
+
}
|
|
42868
42896
|
get pendingSearch() {
|
|
42869
42897
|
return this.updateSearchContent.isDebouncePending();
|
|
42870
42898
|
}
|
|
42899
|
+
get selectionInputKey() {
|
|
42900
|
+
// Selections input are made to work with objects linked to a sheet id. They store the active sheet id at their creation,
|
|
42901
|
+
// and have specific behaviour linked to it (eg. go back to the initial sheet after confirmation).
|
|
42902
|
+
// We don't want all those behaviors here, so we force the recreation of the component when the active sheet changes.
|
|
42903
|
+
// The only drawback is that the input loses focus when changing sheet.
|
|
42904
|
+
return this.env.model.getters.getActiveSheetId();
|
|
42905
|
+
}
|
|
42871
42906
|
}
|
|
42872
42907
|
|
|
42873
42908
|
css /* scss */ `
|
|
@@ -52614,7 +52649,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52614
52649
|
for (const position of positions) {
|
|
52615
52650
|
const cell = this.getters.getCell(position);
|
|
52616
52651
|
const xc = toXC(position.col, position.row);
|
|
52617
|
-
const style = this.
|
|
52652
|
+
const style = this.extractCustomStyle(cell);
|
|
52618
52653
|
if (Object.keys(style).length) {
|
|
52619
52654
|
const styleId = getItemId(style, styles);
|
|
52620
52655
|
positionsByStyle[styleId] ??= [];
|
|
@@ -52655,7 +52690,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52655
52690
|
}
|
|
52656
52691
|
if (cell?.style) {
|
|
52657
52692
|
sheet.cells[xc] ??= {};
|
|
52658
|
-
sheet.cells[xc].style = getItemId(this.
|
|
52693
|
+
sheet.cells[xc].style = getItemId(this.extractCustomStyle(cell), data.styles);
|
|
52659
52694
|
}
|
|
52660
52695
|
}
|
|
52661
52696
|
}
|
|
@@ -52678,10 +52713,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52678
52713
|
}
|
|
52679
52714
|
}
|
|
52680
52715
|
}
|
|
52681
|
-
|
|
52682
|
-
const cleanedStyle = { ...style };
|
|
52683
|
-
|
|
52684
|
-
|
|
52716
|
+
extractCustomStyle(cell) {
|
|
52717
|
+
const cleanedStyle = { ...cell.style };
|
|
52718
|
+
const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
|
|
52719
|
+
? DEFAULT_NUMBER_STYLE
|
|
52720
|
+
: DEFAULT_STYLE;
|
|
52721
|
+
for (const property in cleanedStyle) {
|
|
52722
|
+
if ((property !== "align" || !cell.isFormula) &&
|
|
52723
|
+
cleanedStyle[property] === defaultStyle[property]) {
|
|
52685
52724
|
delete cleanedStyle[property];
|
|
52686
52725
|
}
|
|
52687
52726
|
}
|
|
@@ -57204,6 +57243,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57204
57243
|
"getMeasureCompiledFormula",
|
|
57205
57244
|
"getPivotName",
|
|
57206
57245
|
"isExistingPivot",
|
|
57246
|
+
"getMeasureFullDependencies",
|
|
57207
57247
|
];
|
|
57208
57248
|
nextFormulaId = 1;
|
|
57209
57249
|
pivots = {};
|
|
@@ -57286,7 +57326,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57286
57326
|
}
|
|
57287
57327
|
case "UPDATE_PIVOT": {
|
|
57288
57328
|
this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
|
|
57289
|
-
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
57329
|
+
this.compileCalculatedMeasures(cmd.pivotId, cmd.pivot.measures);
|
|
57290
57330
|
break;
|
|
57291
57331
|
}
|
|
57292
57332
|
}
|
|
@@ -57304,9 +57344,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57304
57344
|
this.history.update("pivots", pivotId, "definition", newDefinition);
|
|
57305
57345
|
}
|
|
57306
57346
|
}
|
|
57307
|
-
for (const
|
|
57308
|
-
for (const
|
|
57309
|
-
const
|
|
57347
|
+
for (const pivotId in this.compiledMeasureFormulas) {
|
|
57348
|
+
for (const measureId in this.compiledMeasureFormulas[pivotId]) {
|
|
57349
|
+
const measure = this.pivots[pivotId]?.definition.measures.find((m) => m.id === measureId);
|
|
57350
|
+
if (!measure || !measure.computedBy) {
|
|
57351
|
+
continue;
|
|
57352
|
+
}
|
|
57353
|
+
const sheetId = measure.computedBy.sheetId;
|
|
57354
|
+
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId].formula;
|
|
57310
57355
|
const newDependencies = [];
|
|
57311
57356
|
for (const range of compiledFormula.dependencies) {
|
|
57312
57357
|
const change = applyChange(range);
|
|
@@ -57318,8 +57363,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57318
57363
|
}
|
|
57319
57364
|
}
|
|
57320
57365
|
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
57321
|
-
|
|
57322
|
-
|
|
57366
|
+
const oldFormulaString = measure.computedBy.formula;
|
|
57367
|
+
if (newFormulaString !== oldFormulaString) {
|
|
57368
|
+
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
57323
57369
|
}
|
|
57324
57370
|
}
|
|
57325
57371
|
}
|
|
@@ -57357,31 +57403,60 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57357
57403
|
isExistingPivot(pivotId) {
|
|
57358
57404
|
return pivotId in this.pivots;
|
|
57359
57405
|
}
|
|
57360
|
-
getMeasureCompiledFormula(measure) {
|
|
57406
|
+
getMeasureCompiledFormula(pivotId, measure) {
|
|
57407
|
+
if (!measure.computedBy) {
|
|
57408
|
+
throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
|
|
57409
|
+
}
|
|
57410
|
+
return this.compiledMeasureFormulas[pivotId][measure.id].formula;
|
|
57411
|
+
}
|
|
57412
|
+
getMeasureFullDependencies(pivotId, measure) {
|
|
57361
57413
|
if (!measure.computedBy) {
|
|
57362
57414
|
throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
|
|
57363
57415
|
}
|
|
57364
|
-
|
|
57365
|
-
return this.compiledMeasureFormulas[sheetId][measure.computedBy.formula];
|
|
57416
|
+
return this.compiledMeasureFormulas[pivotId][measure.id].dependencies;
|
|
57366
57417
|
}
|
|
57367
57418
|
// -------------------------------------------------------------------------
|
|
57368
57419
|
// Private
|
|
57369
57420
|
// -------------------------------------------------------------------------
|
|
57370
57421
|
addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
|
|
57371
57422
|
this.history.update("pivots", pivotId, { definition: deepCopy(pivot), formulaId });
|
|
57372
|
-
this.compileCalculatedMeasures(pivot.measures);
|
|
57423
|
+
this.compileCalculatedMeasures(pivotId, pivot.measures);
|
|
57373
57424
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
57374
57425
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
57375
57426
|
}
|
|
57376
|
-
compileCalculatedMeasures(measures) {
|
|
57427
|
+
compileCalculatedMeasures(pivotId, measures) {
|
|
57377
57428
|
for (const measure of measures) {
|
|
57378
57429
|
if (measure.computedBy) {
|
|
57379
|
-
const sheetId = measure.computedBy.sheetId;
|
|
57380
57430
|
const compiledFormula = this.compileMeasureFormula(measure.computedBy.sheetId, measure.computedBy.formula);
|
|
57381
|
-
this.history.update("compiledMeasureFormulas",
|
|
57431
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "formula", compiledFormula);
|
|
57432
|
+
}
|
|
57433
|
+
}
|
|
57434
|
+
for (const measure of measures) {
|
|
57435
|
+
if (measure.computedBy) {
|
|
57436
|
+
const dependencies = this.computeMeasureFullDependencies(pivotId, measure);
|
|
57437
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", dependencies);
|
|
57382
57438
|
}
|
|
57383
57439
|
}
|
|
57384
57440
|
}
|
|
57441
|
+
computeMeasureFullDependencies(pivotId, measure, exploredMeasures = new Set()) {
|
|
57442
|
+
const rangeDependencies = [];
|
|
57443
|
+
const definition = this.getPivotCoreDefinition(pivotId);
|
|
57444
|
+
const formula = this.getMeasureCompiledFormula(pivotId, measure);
|
|
57445
|
+
exploredMeasures.add(measure.id);
|
|
57446
|
+
for (const token of formula.tokens) {
|
|
57447
|
+
if (token.type !== "SYMBOL") {
|
|
57448
|
+
continue;
|
|
57449
|
+
}
|
|
57450
|
+
const otherMeasure = definition.measures.find((measureCandidate) => getCanonicalSymbolName(measureCandidate.id) === token.value &&
|
|
57451
|
+
measure.id !== measureCandidate.id);
|
|
57452
|
+
if (!otherMeasure || exploredMeasures.has(otherMeasure.id) || !otherMeasure.computedBy) {
|
|
57453
|
+
continue;
|
|
57454
|
+
}
|
|
57455
|
+
rangeDependencies.push(...this.computeMeasureFullDependencies(pivotId, otherMeasure, exploredMeasures));
|
|
57456
|
+
}
|
|
57457
|
+
rangeDependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
|
|
57458
|
+
return rangeDependencies;
|
|
57459
|
+
}
|
|
57385
57460
|
insertPivot(position, formulaId, table) {
|
|
57386
57461
|
this.resizeSheet(position.sheetId, position, table);
|
|
57387
57462
|
const pivotCells = table.getPivotCells();
|
|
@@ -57438,21 +57513,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57438
57513
|
dependencies: rangeDependencies,
|
|
57439
57514
|
};
|
|
57440
57515
|
}
|
|
57441
|
-
replaceMeasureFormula(
|
|
57442
|
-
|
|
57443
|
-
|
|
57444
|
-
|
|
57445
|
-
const pivot = this.pivots[pivotId];
|
|
57446
|
-
if (!pivot) {
|
|
57447
|
-
continue;
|
|
57448
|
-
}
|
|
57449
|
-
for (const measure of pivot.definition.measures) {
|
|
57450
|
-
if (measure.computedBy?.formula === formulaString) {
|
|
57451
|
-
const measureIndex = pivot.definition.measures.indexOf(measure);
|
|
57452
|
-
this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
|
|
57453
|
-
}
|
|
57454
|
-
}
|
|
57516
|
+
replaceMeasureFormula(pivotId, measure, newFormulaString) {
|
|
57517
|
+
const pivot = this.pivots[pivotId];
|
|
57518
|
+
if (!pivot) {
|
|
57519
|
+
return;
|
|
57455
57520
|
}
|
|
57521
|
+
const measureIndex = pivot.definition.measures.indexOf(measure);
|
|
57522
|
+
this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", {
|
|
57523
|
+
formula: newFormulaString,
|
|
57524
|
+
sheetId: measure.computedBy.sheetId,
|
|
57525
|
+
});
|
|
57526
|
+
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
57456
57527
|
}
|
|
57457
57528
|
checkDuplicatedMeasureIds(definition) {
|
|
57458
57529
|
const uniqueIds = new Set(definition.measures.map((m) => m.id));
|
|
@@ -58845,11 +58916,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
58845
58916
|
return this.arrayFormulasToResults.get(formulasPosition);
|
|
58846
58917
|
}
|
|
58847
58918
|
/**
|
|
58848
|
-
* Remove a
|
|
58919
|
+
* Remove a spreading relation for a given array formula position
|
|
58920
|
+
* and its result zone
|
|
58849
58921
|
*/
|
|
58850
58922
|
removeNode(position) {
|
|
58923
|
+
const resultZone = this.arrayFormulasToResults.get(position);
|
|
58924
|
+
if (!resultZone) {
|
|
58925
|
+
return;
|
|
58926
|
+
}
|
|
58851
58927
|
this.resultsToArrayFormulas.remove({
|
|
58852
|
-
boundingBox: { sheetId: position.sheetId, zone:
|
|
58928
|
+
boundingBox: { sheetId: position.sheetId, zone: resultZone },
|
|
58853
58929
|
data: position,
|
|
58854
58930
|
});
|
|
58855
58931
|
this.arrayFormulasToResults.delete(position);
|
|
@@ -59133,6 +59209,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59133
59209
|
// empty matrix
|
|
59134
59210
|
return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
|
|
59135
59211
|
}
|
|
59212
|
+
if (nbRows === 1 && nbColumns === 1) {
|
|
59213
|
+
// single value matrix
|
|
59214
|
+
return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
|
|
59215
|
+
}
|
|
59136
59216
|
const resultZone = {
|
|
59137
59217
|
top: formulaPosition.row,
|
|
59138
59218
|
bottom: formulaPosition.row + nbRows - 1,
|
|
@@ -60592,6 +60672,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60592
60672
|
handle(cmd) {
|
|
60593
60673
|
switch (cmd.type) {
|
|
60594
60674
|
case "START":
|
|
60675
|
+
case "UPDATE_LOCALE":
|
|
60595
60676
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
60596
60677
|
this.initializeSheet(sheetId);
|
|
60597
60678
|
}
|
|
@@ -60697,7 +60778,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60697
60778
|
}
|
|
60698
60779
|
const cell = this.getters.getCell(position);
|
|
60699
60780
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
60700
|
-
return getDefaultCellHeight(this.ctx, cell, colSize);
|
|
60781
|
+
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
60701
60782
|
}
|
|
60702
60783
|
isInMultiRowMerge(position) {
|
|
60703
60784
|
const merge = this.getters.getMerge(position);
|
|
@@ -60744,14 +60825,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60744
60825
|
function withPivotPresentationLayer (PivotClass) {
|
|
60745
60826
|
class PivotPresentationLayer extends PivotClass {
|
|
60746
60827
|
getters;
|
|
60828
|
+
pivotId;
|
|
60747
60829
|
cache = {};
|
|
60748
60830
|
rankAsc = {};
|
|
60749
60831
|
rankDesc = {};
|
|
60750
60832
|
runningTotal = {};
|
|
60751
60833
|
runningTotalInPercent = {};
|
|
60752
|
-
constructor(custom, params) {
|
|
60834
|
+
constructor(pivotId, custom, params) {
|
|
60753
60835
|
super(custom, params);
|
|
60754
60836
|
this.getters = params.getters;
|
|
60837
|
+
this.pivotId = pivotId;
|
|
60755
60838
|
}
|
|
60756
60839
|
markAsDirtyForEvaluation() {
|
|
60757
60840
|
this.cache = {};
|
|
@@ -60801,7 +60884,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60801
60884
|
return handleError(error, measure.aggregator.toUpperCase());
|
|
60802
60885
|
}
|
|
60803
60886
|
}
|
|
60804
|
-
const formula = this.getters.getMeasureCompiledFormula(measure);
|
|
60887
|
+
const formula = this.getters.getMeasureCompiledFormula(this.pivotId, measure);
|
|
60805
60888
|
const getSymbolValue = (symbolName) => {
|
|
60806
60889
|
const { columns, rows } = this.definition;
|
|
60807
60890
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
@@ -61519,7 +61602,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61519
61602
|
const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
|
|
61520
61603
|
if (!(pivotId in this.pivots)) {
|
|
61521
61604
|
const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
|
|
61522
|
-
this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
|
|
61605
|
+
this.pivots[pivotId] = new Pivot(pivotId, this.custom, { definition, getters: this.getters });
|
|
61523
61606
|
}
|
|
61524
61607
|
else if (recreate) {
|
|
61525
61608
|
this.pivots[pivotId].onDefinitionChange(definition);
|
|
@@ -73326,6 +73409,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73326
73409
|
if (style.alignment && style.alignment.wrapText) {
|
|
73327
73410
|
alignAttrs.push(["wrapText", "1"]);
|
|
73328
73411
|
}
|
|
73412
|
+
if (style.alignment && style.alignment.shrinkToFit) {
|
|
73413
|
+
alignAttrs.push(["shrinkToFit", "1"]);
|
|
73414
|
+
}
|
|
73329
73415
|
if (alignAttrs.length > 0) {
|
|
73330
73416
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
73331
73417
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
@@ -74793,9 +74879,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
74793
74879
|
exports.tokenize = tokenize;
|
|
74794
74880
|
|
|
74795
74881
|
|
|
74796
|
-
__info__.version = "18.0.
|
|
74797
|
-
__info__.date = "
|
|
74798
|
-
__info__.hash = "
|
|
74882
|
+
__info__.version = "18.0.55";
|
|
74883
|
+
__info__.date = "2026-01-21T11:03:48.979Z";
|
|
74884
|
+
__info__.hash = "0c94015";
|
|
74799
74885
|
|
|
74800
74886
|
|
|
74801
74887
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|