@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
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -32,7 +32,8 @@ function createAction(item) {
|
|
|
32
32
|
return children
|
|
33
33
|
.map((child) => (typeof child === "function" ? child(env) : child))
|
|
34
34
|
.flat()
|
|
35
|
-
.map(createAction)
|
|
35
|
+
.map(createAction)
|
|
36
|
+
.sort((a, b) => a.sequence - b.sequence);
|
|
36
37
|
}
|
|
37
38
|
: () => [],
|
|
38
39
|
isReadonlyAllowed: item.isReadonlyAllowed || false,
|
|
@@ -300,6 +301,7 @@ const DEFAULT_STYLE = {
|
|
|
300
301
|
fillColor: "",
|
|
301
302
|
textColor: "",
|
|
302
303
|
};
|
|
304
|
+
const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
|
|
303
305
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
304
306
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
305
307
|
// Fonts
|
|
@@ -6313,11 +6315,20 @@ function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
|
6313
6315
|
/**
|
|
6314
6316
|
* Get the default height of the cell given its style.
|
|
6315
6317
|
*/
|
|
6316
|
-
function getDefaultCellHeight(ctx, cell, colSize) {
|
|
6318
|
+
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
6317
6319
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
6318
6320
|
return DEFAULT_CELL_HEIGHT;
|
|
6319
6321
|
}
|
|
6320
|
-
|
|
6322
|
+
let content = "";
|
|
6323
|
+
try {
|
|
6324
|
+
if (!cell.isFormula) {
|
|
6325
|
+
const localeFormat = { format: cell.format, locale };
|
|
6326
|
+
content = formatValue(parseLiteral(cell.content, locale), localeFormat);
|
|
6327
|
+
}
|
|
6328
|
+
}
|
|
6329
|
+
catch {
|
|
6330
|
+
content = CellErrorType.GenericError;
|
|
6331
|
+
}
|
|
6321
6332
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
6322
6333
|
}
|
|
6323
6334
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
@@ -18563,9 +18574,10 @@ function assertDomainLength(domain) {
|
|
|
18563
18574
|
throw new EvaluationError(_t("Function PIVOT takes an even number of arguments."));
|
|
18564
18575
|
}
|
|
18565
18576
|
}
|
|
18566
|
-
function addPivotDependencies(evalContext,
|
|
18577
|
+
function addPivotDependencies(evalContext, pivotId, forMeasures) {
|
|
18567
18578
|
//TODO This function can be very costly when used with PIVOT.VALUE and PIVOT.HEADER
|
|
18568
18579
|
const dependencies = [];
|
|
18580
|
+
const coreDefinition = evalContext.getters.getPivotCoreDefinition(pivotId);
|
|
18569
18581
|
if (coreDefinition.type === "SPREADSHEET" && coreDefinition.dataSet) {
|
|
18570
18582
|
const { sheetId, zone } = coreDefinition.dataSet;
|
|
18571
18583
|
const xc = zoneToXc(zone);
|
|
@@ -18582,8 +18594,7 @@ function addPivotDependencies(evalContext, coreDefinition, forMeasures) {
|
|
|
18582
18594
|
}
|
|
18583
18595
|
for (const measure of forMeasures) {
|
|
18584
18596
|
if (measure.computedBy) {
|
|
18585
|
-
|
|
18586
|
-
dependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
|
|
18597
|
+
dependencies.push(...evalContext.getters.getMeasureFullDependencies(pivotId, measure));
|
|
18587
18598
|
}
|
|
18588
18599
|
}
|
|
18589
18600
|
const originPosition = evalContext.__originCellPosition;
|
|
@@ -19024,7 +19035,7 @@ const PIVOT_VALUE = {
|
|
|
19024
19035
|
assertDomainLength(domainArgs);
|
|
19025
19036
|
const pivot = this.getters.getPivot(pivotId);
|
|
19026
19037
|
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
|
|
19027
|
-
addPivotDependencies(this,
|
|
19038
|
+
addPivotDependencies(this, pivotId, coreDefinition.measures.filter((m) => m.id === _measure));
|
|
19028
19039
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19029
19040
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19030
19041
|
if (error) {
|
|
@@ -19057,8 +19068,7 @@ const PIVOT_HEADER = {
|
|
|
19057
19068
|
const _pivotId = getPivotId(_pivotFormulaId, this.getters);
|
|
19058
19069
|
assertDomainLength(domainArgs);
|
|
19059
19070
|
const pivot = this.getters.getPivot(_pivotId);
|
|
19060
|
-
|
|
19061
|
-
addPivotDependencies(this, coreDefinition, []);
|
|
19071
|
+
addPivotDependencies(this, _pivotId, []);
|
|
19062
19072
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19063
19073
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19064
19074
|
if (error) {
|
|
@@ -19112,7 +19122,7 @@ const PIVOT = {
|
|
|
19112
19122
|
const pivotId = getPivotId(_pivotFormulaId, this.getters);
|
|
19113
19123
|
const pivot = this.getters.getPivot(pivotId);
|
|
19114
19124
|
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
|
|
19115
|
-
addPivotDependencies(this,
|
|
19125
|
+
addPivotDependencies(this, pivotId, coreDefinition.measures);
|
|
19116
19126
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19117
19127
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19118
19128
|
if (error) {
|
|
@@ -20320,7 +20330,16 @@ function createComputeFunction(descr, functionName) {
|
|
|
20320
20330
|
}
|
|
20321
20331
|
acceptToVectorize.push(!argDefinition.acceptMatrix);
|
|
20322
20332
|
}
|
|
20323
|
-
return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
|
|
20333
|
+
return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
|
|
20334
|
+
}
|
|
20335
|
+
function replaceErrorPlaceholderInResult(result) {
|
|
20336
|
+
if (!isMatrix(result)) {
|
|
20337
|
+
replaceFunctionNamePlaceholder(result, functionName);
|
|
20338
|
+
}
|
|
20339
|
+
else {
|
|
20340
|
+
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
|
|
20341
|
+
}
|
|
20342
|
+
return result;
|
|
20324
20343
|
}
|
|
20325
20344
|
function errorHandlingCompute(...args) {
|
|
20326
20345
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -20344,13 +20363,11 @@ function createComputeFunction(descr, functionName) {
|
|
|
20344
20363
|
const result = descr.compute.apply(this, args);
|
|
20345
20364
|
if (!isMatrix(result)) {
|
|
20346
20365
|
if (typeof result === "object" && result !== null && "value" in result) {
|
|
20347
|
-
replaceFunctionNamePlaceholder(result, functionName);
|
|
20348
20366
|
return result;
|
|
20349
20367
|
}
|
|
20350
20368
|
return { value: result };
|
|
20351
20369
|
}
|
|
20352
20370
|
if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
|
|
20353
|
-
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
|
|
20354
20371
|
return result;
|
|
20355
20372
|
}
|
|
20356
20373
|
return matrixMap(result, (row) => ({ value: row }));
|
|
@@ -21796,6 +21813,7 @@ function extractStyle(cell, data) {
|
|
|
21796
21813
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
21797
21814
|
: undefined,
|
|
21798
21815
|
wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
|
|
21816
|
+
shrinkToFit: style.wrapping === "clip" ? true : undefined,
|
|
21799
21817
|
},
|
|
21800
21818
|
};
|
|
21801
21819
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -21822,6 +21840,7 @@ function normalizeStyle(construct, styles) {
|
|
|
21822
21840
|
vertical: styles.alignment.vertical,
|
|
21823
21841
|
horizontal: styles.alignment.horizontal,
|
|
21824
21842
|
wrapText: styles.alignment.wrapText,
|
|
21843
|
+
shrinkToFit: styles.alignment.shrinkToFit,
|
|
21825
21844
|
},
|
|
21826
21845
|
};
|
|
21827
21846
|
return pushElement(style, construct.styles);
|
|
@@ -42459,6 +42478,11 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
42459
42478
|
case "UPDATE_CELL":
|
|
42460
42479
|
case "ACTIVATE_SHEET":
|
|
42461
42480
|
this.isSearchDirty = true;
|
|
42481
|
+
if (this.searchOptions.specificRange) {
|
|
42482
|
+
this.searchOptions.specificRange = this.searchOptions.specificRange.clone({
|
|
42483
|
+
sheetId: this.getters.getActiveSheetId(),
|
|
42484
|
+
});
|
|
42485
|
+
}
|
|
42462
42486
|
break;
|
|
42463
42487
|
case "REPLACE_SEARCH":
|
|
42464
42488
|
for (const match of cmd.matches) {
|
|
@@ -42864,9 +42888,20 @@ class FindAndReplacePanel extends Component {
|
|
|
42864
42888
|
const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
|
|
42865
42889
|
this.store.updateSearchOptions({ specificRange });
|
|
42866
42890
|
}
|
|
42891
|
+
get specificRange() {
|
|
42892
|
+
const range = this.store.searchOptions.specificRange;
|
|
42893
|
+
return range ? this.env.model.getters.getRangeString(range, "forceSheetReference") : "";
|
|
42894
|
+
}
|
|
42867
42895
|
get pendingSearch() {
|
|
42868
42896
|
return this.updateSearchContent.isDebouncePending();
|
|
42869
42897
|
}
|
|
42898
|
+
get selectionInputKey() {
|
|
42899
|
+
// Selections input are made to work with objects linked to a sheet id. They store the active sheet id at their creation,
|
|
42900
|
+
// and have specific behaviour linked to it (eg. go back to the initial sheet after confirmation).
|
|
42901
|
+
// We don't want all those behaviors here, so we force the recreation of the component when the active sheet changes.
|
|
42902
|
+
// The only drawback is that the input loses focus when changing sheet.
|
|
42903
|
+
return this.env.model.getters.getActiveSheetId();
|
|
42904
|
+
}
|
|
42870
42905
|
}
|
|
42871
42906
|
|
|
42872
42907
|
css /* scss */ `
|
|
@@ -52613,7 +52648,7 @@ class CellPlugin extends CorePlugin {
|
|
|
52613
52648
|
for (const position of positions) {
|
|
52614
52649
|
const cell = this.getters.getCell(position);
|
|
52615
52650
|
const xc = toXC(position.col, position.row);
|
|
52616
|
-
const style = this.
|
|
52651
|
+
const style = this.extractCustomStyle(cell);
|
|
52617
52652
|
if (Object.keys(style).length) {
|
|
52618
52653
|
const styleId = getItemId(style, styles);
|
|
52619
52654
|
positionsByStyle[styleId] ??= [];
|
|
@@ -52654,7 +52689,7 @@ class CellPlugin extends CorePlugin {
|
|
|
52654
52689
|
}
|
|
52655
52690
|
if (cell?.style) {
|
|
52656
52691
|
sheet.cells[xc] ??= {};
|
|
52657
|
-
sheet.cells[xc].style = getItemId(this.
|
|
52692
|
+
sheet.cells[xc].style = getItemId(this.extractCustomStyle(cell), data.styles);
|
|
52658
52693
|
}
|
|
52659
52694
|
}
|
|
52660
52695
|
}
|
|
@@ -52677,10 +52712,14 @@ class CellPlugin extends CorePlugin {
|
|
|
52677
52712
|
}
|
|
52678
52713
|
}
|
|
52679
52714
|
}
|
|
52680
|
-
|
|
52681
|
-
const cleanedStyle = { ...style };
|
|
52682
|
-
|
|
52683
|
-
|
|
52715
|
+
extractCustomStyle(cell) {
|
|
52716
|
+
const cleanedStyle = { ...cell.style };
|
|
52717
|
+
const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
|
|
52718
|
+
? DEFAULT_NUMBER_STYLE
|
|
52719
|
+
: DEFAULT_STYLE;
|
|
52720
|
+
for (const property in cleanedStyle) {
|
|
52721
|
+
if ((property !== "align" || !cell.isFormula) &&
|
|
52722
|
+
cleanedStyle[property] === defaultStyle[property]) {
|
|
52684
52723
|
delete cleanedStyle[property];
|
|
52685
52724
|
}
|
|
52686
52725
|
}
|
|
@@ -57203,6 +57242,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
57203
57242
|
"getMeasureCompiledFormula",
|
|
57204
57243
|
"getPivotName",
|
|
57205
57244
|
"isExistingPivot",
|
|
57245
|
+
"getMeasureFullDependencies",
|
|
57206
57246
|
];
|
|
57207
57247
|
nextFormulaId = 1;
|
|
57208
57248
|
pivots = {};
|
|
@@ -57285,7 +57325,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
57285
57325
|
}
|
|
57286
57326
|
case "UPDATE_PIVOT": {
|
|
57287
57327
|
this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
|
|
57288
|
-
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
57328
|
+
this.compileCalculatedMeasures(cmd.pivotId, cmd.pivot.measures);
|
|
57289
57329
|
break;
|
|
57290
57330
|
}
|
|
57291
57331
|
}
|
|
@@ -57303,9 +57343,14 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
57303
57343
|
this.history.update("pivots", pivotId, "definition", newDefinition);
|
|
57304
57344
|
}
|
|
57305
57345
|
}
|
|
57306
|
-
for (const
|
|
57307
|
-
for (const
|
|
57308
|
-
const
|
|
57346
|
+
for (const pivotId in this.compiledMeasureFormulas) {
|
|
57347
|
+
for (const measureId in this.compiledMeasureFormulas[pivotId]) {
|
|
57348
|
+
const measure = this.pivots[pivotId]?.definition.measures.find((m) => m.id === measureId);
|
|
57349
|
+
if (!measure || !measure.computedBy) {
|
|
57350
|
+
continue;
|
|
57351
|
+
}
|
|
57352
|
+
const sheetId = measure.computedBy.sheetId;
|
|
57353
|
+
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId].formula;
|
|
57309
57354
|
const newDependencies = [];
|
|
57310
57355
|
for (const range of compiledFormula.dependencies) {
|
|
57311
57356
|
const change = applyChange(range);
|
|
@@ -57317,8 +57362,9 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
57317
57362
|
}
|
|
57318
57363
|
}
|
|
57319
57364
|
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
57320
|
-
|
|
57321
|
-
|
|
57365
|
+
const oldFormulaString = measure.computedBy.formula;
|
|
57366
|
+
if (newFormulaString !== oldFormulaString) {
|
|
57367
|
+
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
57322
57368
|
}
|
|
57323
57369
|
}
|
|
57324
57370
|
}
|
|
@@ -57356,31 +57402,60 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
57356
57402
|
isExistingPivot(pivotId) {
|
|
57357
57403
|
return pivotId in this.pivots;
|
|
57358
57404
|
}
|
|
57359
|
-
getMeasureCompiledFormula(measure) {
|
|
57405
|
+
getMeasureCompiledFormula(pivotId, measure) {
|
|
57406
|
+
if (!measure.computedBy) {
|
|
57407
|
+
throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
|
|
57408
|
+
}
|
|
57409
|
+
return this.compiledMeasureFormulas[pivotId][measure.id].formula;
|
|
57410
|
+
}
|
|
57411
|
+
getMeasureFullDependencies(pivotId, measure) {
|
|
57360
57412
|
if (!measure.computedBy) {
|
|
57361
57413
|
throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
|
|
57362
57414
|
}
|
|
57363
|
-
|
|
57364
|
-
return this.compiledMeasureFormulas[sheetId][measure.computedBy.formula];
|
|
57415
|
+
return this.compiledMeasureFormulas[pivotId][measure.id].dependencies;
|
|
57365
57416
|
}
|
|
57366
57417
|
// -------------------------------------------------------------------------
|
|
57367
57418
|
// Private
|
|
57368
57419
|
// -------------------------------------------------------------------------
|
|
57369
57420
|
addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
|
|
57370
57421
|
this.history.update("pivots", pivotId, { definition: deepCopy(pivot), formulaId });
|
|
57371
|
-
this.compileCalculatedMeasures(pivot.measures);
|
|
57422
|
+
this.compileCalculatedMeasures(pivotId, pivot.measures);
|
|
57372
57423
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
57373
57424
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
57374
57425
|
}
|
|
57375
|
-
compileCalculatedMeasures(measures) {
|
|
57426
|
+
compileCalculatedMeasures(pivotId, measures) {
|
|
57376
57427
|
for (const measure of measures) {
|
|
57377
57428
|
if (measure.computedBy) {
|
|
57378
|
-
const sheetId = measure.computedBy.sheetId;
|
|
57379
57429
|
const compiledFormula = this.compileMeasureFormula(measure.computedBy.sheetId, measure.computedBy.formula);
|
|
57380
|
-
this.history.update("compiledMeasureFormulas",
|
|
57430
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "formula", compiledFormula);
|
|
57431
|
+
}
|
|
57432
|
+
}
|
|
57433
|
+
for (const measure of measures) {
|
|
57434
|
+
if (measure.computedBy) {
|
|
57435
|
+
const dependencies = this.computeMeasureFullDependencies(pivotId, measure);
|
|
57436
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", dependencies);
|
|
57381
57437
|
}
|
|
57382
57438
|
}
|
|
57383
57439
|
}
|
|
57440
|
+
computeMeasureFullDependencies(pivotId, measure, exploredMeasures = new Set()) {
|
|
57441
|
+
const rangeDependencies = [];
|
|
57442
|
+
const definition = this.getPivotCoreDefinition(pivotId);
|
|
57443
|
+
const formula = this.getMeasureCompiledFormula(pivotId, measure);
|
|
57444
|
+
exploredMeasures.add(measure.id);
|
|
57445
|
+
for (const token of formula.tokens) {
|
|
57446
|
+
if (token.type !== "SYMBOL") {
|
|
57447
|
+
continue;
|
|
57448
|
+
}
|
|
57449
|
+
const otherMeasure = definition.measures.find((measureCandidate) => getCanonicalSymbolName(measureCandidate.id) === token.value &&
|
|
57450
|
+
measure.id !== measureCandidate.id);
|
|
57451
|
+
if (!otherMeasure || exploredMeasures.has(otherMeasure.id) || !otherMeasure.computedBy) {
|
|
57452
|
+
continue;
|
|
57453
|
+
}
|
|
57454
|
+
rangeDependencies.push(...this.computeMeasureFullDependencies(pivotId, otherMeasure, exploredMeasures));
|
|
57455
|
+
}
|
|
57456
|
+
rangeDependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
|
|
57457
|
+
return rangeDependencies;
|
|
57458
|
+
}
|
|
57384
57459
|
insertPivot(position, formulaId, table) {
|
|
57385
57460
|
this.resizeSheet(position.sheetId, position, table);
|
|
57386
57461
|
const pivotCells = table.getPivotCells();
|
|
@@ -57437,21 +57512,17 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
57437
57512
|
dependencies: rangeDependencies,
|
|
57438
57513
|
};
|
|
57439
57514
|
}
|
|
57440
|
-
replaceMeasureFormula(
|
|
57441
|
-
|
|
57442
|
-
|
|
57443
|
-
|
|
57444
|
-
const pivot = this.pivots[pivotId];
|
|
57445
|
-
if (!pivot) {
|
|
57446
|
-
continue;
|
|
57447
|
-
}
|
|
57448
|
-
for (const measure of pivot.definition.measures) {
|
|
57449
|
-
if (measure.computedBy?.formula === formulaString) {
|
|
57450
|
-
const measureIndex = pivot.definition.measures.indexOf(measure);
|
|
57451
|
-
this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
|
|
57452
|
-
}
|
|
57453
|
-
}
|
|
57515
|
+
replaceMeasureFormula(pivotId, measure, newFormulaString) {
|
|
57516
|
+
const pivot = this.pivots[pivotId];
|
|
57517
|
+
if (!pivot) {
|
|
57518
|
+
return;
|
|
57454
57519
|
}
|
|
57520
|
+
const measureIndex = pivot.definition.measures.indexOf(measure);
|
|
57521
|
+
this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", {
|
|
57522
|
+
formula: newFormulaString,
|
|
57523
|
+
sheetId: measure.computedBy.sheetId,
|
|
57524
|
+
});
|
|
57525
|
+
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
57455
57526
|
}
|
|
57456
57527
|
checkDuplicatedMeasureIds(definition) {
|
|
57457
57528
|
const uniqueIds = new Set(definition.measures.map((m) => m.id));
|
|
@@ -58844,11 +58915,16 @@ class SpreadingRelation {
|
|
|
58844
58915
|
return this.arrayFormulasToResults.get(formulasPosition);
|
|
58845
58916
|
}
|
|
58846
58917
|
/**
|
|
58847
|
-
* Remove a
|
|
58918
|
+
* Remove a spreading relation for a given array formula position
|
|
58919
|
+
* and its result zone
|
|
58848
58920
|
*/
|
|
58849
58921
|
removeNode(position) {
|
|
58922
|
+
const resultZone = this.arrayFormulasToResults.get(position);
|
|
58923
|
+
if (!resultZone) {
|
|
58924
|
+
return;
|
|
58925
|
+
}
|
|
58850
58926
|
this.resultsToArrayFormulas.remove({
|
|
58851
|
-
boundingBox: { sheetId: position.sheetId, zone:
|
|
58927
|
+
boundingBox: { sheetId: position.sheetId, zone: resultZone },
|
|
58852
58928
|
data: position,
|
|
58853
58929
|
});
|
|
58854
58930
|
this.arrayFormulasToResults.delete(position);
|
|
@@ -59132,6 +59208,10 @@ class Evaluator {
|
|
|
59132
59208
|
// empty matrix
|
|
59133
59209
|
return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
|
|
59134
59210
|
}
|
|
59211
|
+
if (nbRows === 1 && nbColumns === 1) {
|
|
59212
|
+
// single value matrix
|
|
59213
|
+
return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
|
|
59214
|
+
}
|
|
59135
59215
|
const resultZone = {
|
|
59136
59216
|
top: formulaPosition.row,
|
|
59137
59217
|
bottom: formulaPosition.row + nbRows - 1,
|
|
@@ -60591,6 +60671,7 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
60591
60671
|
handle(cmd) {
|
|
60592
60672
|
switch (cmd.type) {
|
|
60593
60673
|
case "START":
|
|
60674
|
+
case "UPDATE_LOCALE":
|
|
60594
60675
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
60595
60676
|
this.initializeSheet(sheetId);
|
|
60596
60677
|
}
|
|
@@ -60696,7 +60777,7 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
60696
60777
|
}
|
|
60697
60778
|
const cell = this.getters.getCell(position);
|
|
60698
60779
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
60699
|
-
return getDefaultCellHeight(this.ctx, cell, colSize);
|
|
60780
|
+
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
60700
60781
|
}
|
|
60701
60782
|
isInMultiRowMerge(position) {
|
|
60702
60783
|
const merge = this.getters.getMerge(position);
|
|
@@ -60743,14 +60824,16 @@ const PERCENT_FORMAT = "0.00%";
|
|
|
60743
60824
|
function withPivotPresentationLayer (PivotClass) {
|
|
60744
60825
|
class PivotPresentationLayer extends PivotClass {
|
|
60745
60826
|
getters;
|
|
60827
|
+
pivotId;
|
|
60746
60828
|
cache = {};
|
|
60747
60829
|
rankAsc = {};
|
|
60748
60830
|
rankDesc = {};
|
|
60749
60831
|
runningTotal = {};
|
|
60750
60832
|
runningTotalInPercent = {};
|
|
60751
|
-
constructor(custom, params) {
|
|
60833
|
+
constructor(pivotId, custom, params) {
|
|
60752
60834
|
super(custom, params);
|
|
60753
60835
|
this.getters = params.getters;
|
|
60836
|
+
this.pivotId = pivotId;
|
|
60754
60837
|
}
|
|
60755
60838
|
markAsDirtyForEvaluation() {
|
|
60756
60839
|
this.cache = {};
|
|
@@ -60800,7 +60883,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
60800
60883
|
return handleError(error, measure.aggregator.toUpperCase());
|
|
60801
60884
|
}
|
|
60802
60885
|
}
|
|
60803
|
-
const formula = this.getters.getMeasureCompiledFormula(measure);
|
|
60886
|
+
const formula = this.getters.getMeasureCompiledFormula(this.pivotId, measure);
|
|
60804
60887
|
const getSymbolValue = (symbolName) => {
|
|
60805
60888
|
const { columns, rows } = this.definition;
|
|
60806
60889
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
@@ -61518,7 +61601,7 @@ class PivotUIPlugin extends UIPlugin {
|
|
|
61518
61601
|
const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
|
|
61519
61602
|
if (!(pivotId in this.pivots)) {
|
|
61520
61603
|
const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
|
|
61521
|
-
this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
|
|
61604
|
+
this.pivots[pivotId] = new Pivot(pivotId, this.custom, { definition, getters: this.getters });
|
|
61522
61605
|
}
|
|
61523
61606
|
else if (recreate) {
|
|
61524
61607
|
this.pivots[pivotId].onDefinitionChange(definition);
|
|
@@ -73325,6 +73408,9 @@ function addStyles(styles) {
|
|
|
73325
73408
|
if (style.alignment && style.alignment.wrapText) {
|
|
73326
73409
|
alignAttrs.push(["wrapText", "1"]);
|
|
73327
73410
|
}
|
|
73411
|
+
if (style.alignment && style.alignment.shrinkToFit) {
|
|
73412
|
+
alignAttrs.push(["shrinkToFit", "1"]);
|
|
73413
|
+
}
|
|
73328
73414
|
if (alignAttrs.length > 0) {
|
|
73329
73415
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
73330
73416
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
@@ -74749,6 +74835,6 @@ const constants = {
|
|
|
74749
74835
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
74750
74836
|
|
|
74751
74837
|
|
|
74752
|
-
__info__.version = "18.0.
|
|
74753
|
-
__info__.date = "
|
|
74754
|
-
__info__.hash = "
|
|
74838
|
+
__info__.version = "18.0.55";
|
|
74839
|
+
__info__.date = "2026-01-21T11:03:48.979Z";
|
|
74840
|
+
__info__.hash = "0c94015";
|