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