@odoo/o-spreadsheet 19.0.17 → 19.0.18
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 +159 -139
- package/dist/o-spreadsheet.d.ts +109 -103
- package/dist/o-spreadsheet.esm.js +159 -139
- package/dist/o-spreadsheet.iife.js +159 -139
- package/dist/o-spreadsheet.iife.min.js +430 -430
- package/dist/o_spreadsheet.css +3 -3
- package/dist/o_spreadsheet.xml +3 -3
- 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 19.0.
|
|
6
|
-
* @date 2026-01-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.0.18
|
|
6
|
+
* @date 2026-01-21T11:06:57.346Z
|
|
7
|
+
* @hash bd44f59
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -42,7 +42,8 @@ function createAction(item) {
|
|
|
42
42
|
return children
|
|
43
43
|
.map((child) => (typeof child === "function" ? child(env) : child))
|
|
44
44
|
.flat()
|
|
45
|
-
.map(createAction)
|
|
45
|
+
.map(createAction)
|
|
46
|
+
.sort((a, b) => a.sequence - b.sequence);
|
|
46
47
|
}
|
|
47
48
|
: () => [],
|
|
48
49
|
isReadonlyAllowed: item.isReadonlyAllowed || false,
|
|
@@ -782,6 +783,7 @@ const DEFAULT_STYLE = {
|
|
|
782
783
|
fillColor: "",
|
|
783
784
|
textColor: "",
|
|
784
785
|
};
|
|
786
|
+
const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
|
|
785
787
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
786
788
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
787
789
|
// Fonts
|
|
@@ -5028,7 +5030,11 @@ function evaluatePredicate(value = "", criterion, locale) {
|
|
|
5028
5030
|
if (operator === "<>" || operator === "=") {
|
|
5029
5031
|
let result;
|
|
5030
5032
|
if (typeof value === typeof operand) {
|
|
5031
|
-
if (
|
|
5033
|
+
if (value === "" && operand === "") {
|
|
5034
|
+
// fast path to avoid regex evaluation
|
|
5035
|
+
result = true;
|
|
5036
|
+
}
|
|
5037
|
+
else if (typeof value === "string" && typeof operand === "string") {
|
|
5032
5038
|
result = wildcardToRegExp(operand).test(value);
|
|
5033
5039
|
}
|
|
5034
5040
|
else {
|
|
@@ -7054,7 +7060,7 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
7054
7060
|
const groups = groupConsecutive(elements);
|
|
7055
7061
|
return (range) => {
|
|
7056
7062
|
if (range.sheetId !== cmd.sheetId) {
|
|
7057
|
-
return { changeType: "NONE" };
|
|
7063
|
+
return { changeType: "NONE", range };
|
|
7058
7064
|
}
|
|
7059
7065
|
let newRange = range;
|
|
7060
7066
|
let changeType = "NONE";
|
|
@@ -7081,10 +7087,7 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
7081
7087
|
newRange = createAdaptedRange(newRange, dimension, changeType, -(max - min + 1));
|
|
7082
7088
|
}
|
|
7083
7089
|
}
|
|
7084
|
-
|
|
7085
|
-
return { changeType, range: newRange };
|
|
7086
|
-
}
|
|
7087
|
-
return { changeType: "NONE" };
|
|
7090
|
+
return { changeType, range: newRange };
|
|
7088
7091
|
};
|
|
7089
7092
|
}
|
|
7090
7093
|
function getApplyRangeChangeAddColRow(cmd) {
|
|
@@ -7093,7 +7096,7 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
7093
7096
|
const dimension = cmd.dimension === "COL" ? "columns" : "rows";
|
|
7094
7097
|
return (range) => {
|
|
7095
7098
|
if (range.sheetId !== cmd.sheetId) {
|
|
7096
|
-
return { changeType: "NONE" };
|
|
7099
|
+
return { changeType: "NONE", range };
|
|
7097
7100
|
}
|
|
7098
7101
|
if (cmd.position === "after") {
|
|
7099
7102
|
if (range.zone[start] <= cmd.base && cmd.base < range.zone[end]) {
|
|
@@ -7123,13 +7126,13 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
7123
7126
|
};
|
|
7124
7127
|
}
|
|
7125
7128
|
}
|
|
7126
|
-
return { changeType: "NONE" };
|
|
7129
|
+
return { changeType: "NONE", range };
|
|
7127
7130
|
};
|
|
7128
7131
|
}
|
|
7129
7132
|
function getApplyRangeChangeDeleteSheet(cmd) {
|
|
7130
7133
|
return (range) => {
|
|
7131
7134
|
if (range.sheetId !== cmd.sheetId && range.invalidSheetName !== cmd.sheetName) {
|
|
7132
|
-
return { changeType: "NONE" };
|
|
7135
|
+
return { changeType: "NONE", range };
|
|
7133
7136
|
}
|
|
7134
7137
|
const invalidSheetName = cmd.sheetName;
|
|
7135
7138
|
range = {
|
|
@@ -7156,14 +7159,14 @@ function getApplyRangeChangeRenameSheet(cmd) {
|
|
|
7156
7159
|
const newRange = { ...range, sheetId, invalidSheetName };
|
|
7157
7160
|
return { changeType: "CHANGE", range: newRange };
|
|
7158
7161
|
}
|
|
7159
|
-
return { changeType: "NONE" };
|
|
7162
|
+
return { changeType: "NONE", range };
|
|
7160
7163
|
};
|
|
7161
7164
|
}
|
|
7162
7165
|
function getApplyRangeChangeMoveRange(cmd) {
|
|
7163
7166
|
const originZone = cmd.target[0];
|
|
7164
7167
|
return (range) => {
|
|
7165
7168
|
if (range.sheetId !== cmd.sheetId || !isZoneInside(range.zone, originZone)) {
|
|
7166
|
-
return { changeType: "NONE" };
|
|
7169
|
+
return { changeType: "NONE", range };
|
|
7167
7170
|
}
|
|
7168
7171
|
const targetSheetId = cmd.targetSheetId;
|
|
7169
7172
|
const offsetX = cmd.col - originZone.left;
|
|
@@ -7329,11 +7332,20 @@ function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
|
7329
7332
|
/**
|
|
7330
7333
|
* Get the default height of the cell given its style.
|
|
7331
7334
|
*/
|
|
7332
|
-
function getDefaultCellHeight(ctx, cell, colSize) {
|
|
7335
|
+
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
7333
7336
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
7334
7337
|
return DEFAULT_CELL_HEIGHT;
|
|
7335
7338
|
}
|
|
7336
|
-
|
|
7339
|
+
let content = "";
|
|
7340
|
+
try {
|
|
7341
|
+
if (!cell.isFormula) {
|
|
7342
|
+
const localeFormat = { format: cell.format, locale };
|
|
7343
|
+
content = formatValue(parseLiteral(cell.content, locale), localeFormat);
|
|
7344
|
+
}
|
|
7345
|
+
}
|
|
7346
|
+
catch {
|
|
7347
|
+
content = CellErrorType.GenericError;
|
|
7348
|
+
}
|
|
7337
7349
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
7338
7350
|
}
|
|
7339
7351
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
@@ -22227,7 +22239,16 @@ function createComputeFunction(descr) {
|
|
|
22227
22239
|
}
|
|
22228
22240
|
acceptToVectorize.push(!argDefinition.acceptMatrix);
|
|
22229
22241
|
}
|
|
22230
|
-
return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
|
|
22242
|
+
return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
|
|
22243
|
+
}
|
|
22244
|
+
function replaceErrorPlaceholderInResult(result) {
|
|
22245
|
+
if (!isMatrix(result)) {
|
|
22246
|
+
replaceFunctionNamePlaceholder(result, descr.name);
|
|
22247
|
+
}
|
|
22248
|
+
else {
|
|
22249
|
+
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
22250
|
+
}
|
|
22251
|
+
return result;
|
|
22231
22252
|
}
|
|
22232
22253
|
function errorHandlingCompute(...args) {
|
|
22233
22254
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -22256,13 +22277,12 @@ function createComputeFunction(descr) {
|
|
|
22256
22277
|
const result = descr.compute.apply(this, args);
|
|
22257
22278
|
if (!isMatrix(result)) {
|
|
22258
22279
|
if (typeof result === "object" && result !== null && "value" in result) {
|
|
22259
|
-
replaceFunctionNamePlaceholder(result, descr.name);
|
|
22260
22280
|
return result;
|
|
22261
22281
|
}
|
|
22282
|
+
descr.name;
|
|
22262
22283
|
return { value: result };
|
|
22263
22284
|
}
|
|
22264
22285
|
if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
|
|
22265
|
-
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
22266
22286
|
return result;
|
|
22267
22287
|
}
|
|
22268
22288
|
return matrixMap(result, (row) => ({ value: row }));
|
|
@@ -22775,7 +22795,7 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
22775
22795
|
continue;
|
|
22776
22796
|
}
|
|
22777
22797
|
const sheetXC = tokens[tokenIdx].value;
|
|
22778
|
-
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange);
|
|
22798
|
+
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange).range;
|
|
22779
22799
|
if (sheetXC !== newSheetXC) {
|
|
22780
22800
|
tokens[tokenIdx] = {
|
|
22781
22801
|
value: newSheetXC,
|
|
@@ -22785,23 +22805,30 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
22785
22805
|
}
|
|
22786
22806
|
return concat$1(tokens.map((token) => token.value));
|
|
22787
22807
|
}
|
|
22788
|
-
function adaptStringRange(defaultSheetId, sheetXC,
|
|
22808
|
+
function adaptStringRange(defaultSheetId, sheetXC, rangeAdapter) {
|
|
22789
22809
|
const sheetName = splitReference(sheetXC).sheetName;
|
|
22790
22810
|
if (sheetName
|
|
22791
|
-
? !isSheetNameEqual(sheetName,
|
|
22792
|
-
: defaultSheetId !==
|
|
22793
|
-
return sheetXC;
|
|
22811
|
+
? !isSheetNameEqual(sheetName, rangeAdapter.sheetName.old)
|
|
22812
|
+
: defaultSheetId !== rangeAdapter.sheetId) {
|
|
22813
|
+
return { changeType: "NONE", range: sheetXC };
|
|
22794
22814
|
}
|
|
22795
|
-
const sheetId = sheetName ?
|
|
22815
|
+
const sheetId = sheetName ? rangeAdapter.sheetId : defaultSheetId;
|
|
22796
22816
|
const range = getRange(sheetXC, sheetId);
|
|
22797
22817
|
if (range.invalidXc) {
|
|
22798
|
-
return sheetXC;
|
|
22818
|
+
return { changeType: "NONE", range: sheetXC };
|
|
22799
22819
|
}
|
|
22800
|
-
const change =
|
|
22820
|
+
const change = rangeAdapter.applyChange(range);
|
|
22801
22821
|
if (change.changeType === "NONE" || change.changeType === "REMOVE") {
|
|
22802
|
-
return sheetXC;
|
|
22822
|
+
return { changeType: change.changeType, range: sheetXC };
|
|
22823
|
+
}
|
|
22824
|
+
const rangeStr = getRangeString(change.range, defaultSheetId, getSheetNameGetter(rangeAdapter));
|
|
22825
|
+
if (rangeStr === CellErrorType.InvalidReference) {
|
|
22826
|
+
return { changeType: "REMOVE", range: rangeStr };
|
|
22803
22827
|
}
|
|
22804
|
-
return
|
|
22828
|
+
return {
|
|
22829
|
+
changeType: change.changeType,
|
|
22830
|
+
range: rangeStr,
|
|
22831
|
+
};
|
|
22805
22832
|
}
|
|
22806
22833
|
function getSheetNameGetter(applyChange) {
|
|
22807
22834
|
return (sheetId) => {
|
|
@@ -22906,8 +22933,6 @@ function adaptChartRange(range, applyChange) {
|
|
|
22906
22933
|
}
|
|
22907
22934
|
const change = applyChange(range);
|
|
22908
22935
|
switch (change.changeType) {
|
|
22909
|
-
case "NONE":
|
|
22910
|
-
return range;
|
|
22911
22936
|
case "REMOVE":
|
|
22912
22937
|
return undefined;
|
|
22913
22938
|
default:
|
|
@@ -23059,16 +23084,16 @@ function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
|
23059
23084
|
function transformChartDefinitionWithDataSetsWithZone(chartSheetId, definition, applyChange) {
|
|
23060
23085
|
let labelRange;
|
|
23061
23086
|
if (definition.labelRange) {
|
|
23062
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
23063
|
-
if (
|
|
23087
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
23088
|
+
if (changeType !== "REMOVE") {
|
|
23064
23089
|
labelRange = adaptedRange;
|
|
23065
23090
|
}
|
|
23066
23091
|
}
|
|
23067
23092
|
const dataSets = [];
|
|
23068
23093
|
for (const dataSet of definition.dataSets) {
|
|
23069
23094
|
const newDataSet = { ...dataSet };
|
|
23070
|
-
const adaptedRange = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
23071
|
-
if (
|
|
23095
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
23096
|
+
if (changeType !== "REMOVE") {
|
|
23072
23097
|
newDataSet.dataRange = adaptedRange;
|
|
23073
23098
|
dataSets.push(newDataSet);
|
|
23074
23099
|
}
|
|
@@ -24467,14 +24492,14 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
24467
24492
|
let baseline;
|
|
24468
24493
|
let keyValue;
|
|
24469
24494
|
if (definition.baseline) {
|
|
24470
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
24471
|
-
if (
|
|
24495
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
24496
|
+
if (changeType !== "REMOVE") {
|
|
24472
24497
|
baseline = adaptedRange;
|
|
24473
24498
|
}
|
|
24474
24499
|
}
|
|
24475
24500
|
if (definition.keyValue) {
|
|
24476
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
24477
|
-
if (
|
|
24501
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
24502
|
+
if (changeType !== "REMOVE") {
|
|
24478
24503
|
keyValue = adaptedRange;
|
|
24479
24504
|
}
|
|
24480
24505
|
}
|
|
@@ -24531,7 +24556,7 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
24531
24556
|
// This kind of graph is not exportable in Excel
|
|
24532
24557
|
return undefined;
|
|
24533
24558
|
}
|
|
24534
|
-
updateRanges(applyChange) {
|
|
24559
|
+
updateRanges({ applyChange }) {
|
|
24535
24560
|
const baseline = adaptChartRange(this.baseline, applyChange);
|
|
24536
24561
|
const keyValue = adaptChartRange(this.keyValue, applyChange);
|
|
24537
24562
|
if (this.baseline === baseline && this.keyValue === keyValue) {
|
|
@@ -27697,7 +27722,7 @@ class BarChart extends AbstractChart {
|
|
|
27697
27722
|
verticalAxis: getDefinedAxis(definition),
|
|
27698
27723
|
};
|
|
27699
27724
|
}
|
|
27700
|
-
updateRanges(applyChange) {
|
|
27725
|
+
updateRanges({ applyChange }) {
|
|
27701
27726
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27702
27727
|
if (!isStale) {
|
|
27703
27728
|
return this;
|
|
@@ -28903,7 +28928,7 @@ class ComboChart extends AbstractChart {
|
|
|
28903
28928
|
verticalAxis: getDefinedAxis(definition),
|
|
28904
28929
|
};
|
|
28905
28930
|
}
|
|
28906
|
-
updateRanges(applyChange) {
|
|
28931
|
+
updateRanges({ applyChange }) {
|
|
28907
28932
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28908
28933
|
if (!isStale) {
|
|
28909
28934
|
return this;
|
|
@@ -29079,7 +29104,7 @@ class FunnelChart extends AbstractChart {
|
|
|
29079
29104
|
getDefinitionForExcel() {
|
|
29080
29105
|
return undefined;
|
|
29081
29106
|
}
|
|
29082
|
-
updateRanges(applyChange) {
|
|
29107
|
+
updateRanges({ applyChange }) {
|
|
29083
29108
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
29084
29109
|
if (!isStale) {
|
|
29085
29110
|
return this;
|
|
@@ -29190,8 +29215,8 @@ class GaugeChart extends AbstractChart {
|
|
|
29190
29215
|
static transformDefinition(chartSheetId, definition, applyChange) {
|
|
29191
29216
|
let dataRange;
|
|
29192
29217
|
if (definition.dataRange) {
|
|
29193
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
29194
|
-
if (
|
|
29218
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
29219
|
+
if (changeType !== "REMOVE") {
|
|
29195
29220
|
dataRange = adaptedRange;
|
|
29196
29221
|
}
|
|
29197
29222
|
}
|
|
@@ -29268,13 +29293,9 @@ class GaugeChart extends AbstractChart {
|
|
|
29268
29293
|
: undefined,
|
|
29269
29294
|
};
|
|
29270
29295
|
}
|
|
29271
|
-
updateRanges(applyChange,
|
|
29296
|
+
updateRanges({ applyChange, adaptFormulaString }) {
|
|
29272
29297
|
const dataRange = adaptChartRange(this.dataRange, applyChange);
|
|
29273
|
-
const adaptFormula = (formula) =>
|
|
29274
|
-
applyChange,
|
|
29275
|
-
sheetId,
|
|
29276
|
-
sheetName: adaptSheetName,
|
|
29277
|
-
});
|
|
29298
|
+
const adaptFormula = (formula) => adaptFormulaString(this.sheetId, formula);
|
|
29278
29299
|
const sectionRule = adaptSectionRuleFormulas(this.sectionRule, adaptFormula);
|
|
29279
29300
|
const definition = this.getDefinitionWithSpecificRanges(dataRange, sectionRule);
|
|
29280
29301
|
return new GaugeChart(definition, this.sheetId, this.getters);
|
|
@@ -29502,7 +29523,7 @@ class GeoChart extends AbstractChart {
|
|
|
29502
29523
|
getDefinitionForExcel() {
|
|
29503
29524
|
return undefined;
|
|
29504
29525
|
}
|
|
29505
|
-
updateRanges(applyChange) {
|
|
29526
|
+
updateRanges({ applyChange }) {
|
|
29506
29527
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
29507
29528
|
if (!isStale) {
|
|
29508
29529
|
return this;
|
|
@@ -29644,7 +29665,7 @@ class LineChart extends AbstractChart {
|
|
|
29644
29665
|
: undefined,
|
|
29645
29666
|
};
|
|
29646
29667
|
}
|
|
29647
|
-
updateRanges(applyChange) {
|
|
29668
|
+
updateRanges({ applyChange }) {
|
|
29648
29669
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
29649
29670
|
if (!isStale) {
|
|
29650
29671
|
return this;
|
|
@@ -29801,7 +29822,7 @@ class PieChart extends AbstractChart {
|
|
|
29801
29822
|
labelRange,
|
|
29802
29823
|
};
|
|
29803
29824
|
}
|
|
29804
|
-
updateRanges(applyChange) {
|
|
29825
|
+
updateRanges({ applyChange }) {
|
|
29805
29826
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
29806
29827
|
if (!isStale) {
|
|
29807
29828
|
return this;
|
|
@@ -29956,7 +29977,7 @@ class PyramidChart extends AbstractChart {
|
|
|
29956
29977
|
maxValue,
|
|
29957
29978
|
};
|
|
29958
29979
|
}
|
|
29959
|
-
updateRanges(applyChange) {
|
|
29980
|
+
updateRanges({ applyChange }) {
|
|
29960
29981
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
29961
29982
|
if (!isStale) {
|
|
29962
29983
|
return this;
|
|
@@ -30106,7 +30127,7 @@ class RadarChart extends AbstractChart {
|
|
|
30106
30127
|
labelRange,
|
|
30107
30128
|
};
|
|
30108
30129
|
}
|
|
30109
|
-
updateRanges(applyChange) {
|
|
30130
|
+
updateRanges({ applyChange }) {
|
|
30110
30131
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
30111
30132
|
if (!isStale) {
|
|
30112
30133
|
return this;
|
|
@@ -30234,7 +30255,7 @@ class ScatterChart extends AbstractChart {
|
|
|
30234
30255
|
: undefined,
|
|
30235
30256
|
};
|
|
30236
30257
|
}
|
|
30237
|
-
updateRanges(applyChange) {
|
|
30258
|
+
updateRanges({ applyChange }) {
|
|
30238
30259
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
30239
30260
|
if (!isStale) {
|
|
30240
30261
|
return this;
|
|
@@ -30401,7 +30422,7 @@ class SunburstChart extends AbstractChart {
|
|
|
30401
30422
|
getDefinitionForExcel() {
|
|
30402
30423
|
return undefined;
|
|
30403
30424
|
}
|
|
30404
|
-
updateRanges(applyChange) {
|
|
30425
|
+
updateRanges({ applyChange }) {
|
|
30405
30426
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
30406
30427
|
if (!isStale) {
|
|
30407
30428
|
return this;
|
|
@@ -30551,7 +30572,7 @@ class TreeMapChart extends AbstractChart {
|
|
|
30551
30572
|
getDefinitionForExcel() {
|
|
30552
30573
|
return undefined;
|
|
30553
30574
|
}
|
|
30554
|
-
updateRanges(applyChange) {
|
|
30575
|
+
updateRanges({ applyChange }) {
|
|
30555
30576
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
30556
30577
|
if (!isStale) {
|
|
30557
30578
|
return this;
|
|
@@ -30712,7 +30733,7 @@ class WaterfallChart extends AbstractChart {
|
|
|
30712
30733
|
// TODO: implement export excel
|
|
30713
30734
|
return undefined;
|
|
30714
30735
|
}
|
|
30715
|
-
updateRanges(applyChange) {
|
|
30736
|
+
updateRanges({ applyChange }) {
|
|
30716
30737
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
30717
30738
|
if (!isStale) {
|
|
30718
30739
|
return this;
|
|
@@ -35229,7 +35250,6 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
35229
35250
|
});
|
|
35230
35251
|
}
|
|
35231
35252
|
handleEvent(event) {
|
|
35232
|
-
this.hideHelp();
|
|
35233
35253
|
const sheetId = this.getters.getActiveSheetId();
|
|
35234
35254
|
let unboundedZone;
|
|
35235
35255
|
if (event.options.unbounded) {
|
|
@@ -35577,6 +35597,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
35577
35597
|
this.colorIndexByRange = {};
|
|
35578
35598
|
this.hoveredTokens = [];
|
|
35579
35599
|
this.hoveredContentEvaluation = "";
|
|
35600
|
+
this.hideHelp();
|
|
35580
35601
|
}
|
|
35581
35602
|
/**
|
|
35582
35603
|
* Reset the current content to the active cell content
|
|
@@ -40819,6 +40840,7 @@ function extractStyle(data, content, styleId, formatId, borderId) {
|
|
|
40819
40840
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
40820
40841
|
: undefined,
|
|
40821
40842
|
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : undefined,
|
|
40843
|
+
shrinkToFit: style.wrapping === "clip" ? true : undefined,
|
|
40822
40844
|
},
|
|
40823
40845
|
};
|
|
40824
40846
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -40839,6 +40861,7 @@ function normalizeStyle(construct, styles) {
|
|
|
40839
40861
|
vertical: styles.alignment.vertical,
|
|
40840
40862
|
horizontal: styles.alignment.horizontal,
|
|
40841
40863
|
wrapText: styles.alignment.wrapText,
|
|
40864
|
+
shrinkToFit: styles.alignment.shrinkToFit,
|
|
40842
40865
|
},
|
|
40843
40866
|
};
|
|
40844
40867
|
return pushElement(style, construct.styles);
|
|
@@ -47889,8 +47912,6 @@ function adaptPivotRange(range, applyChange) {
|
|
|
47889
47912
|
}
|
|
47890
47913
|
const change = applyChange(range);
|
|
47891
47914
|
switch (change.changeType) {
|
|
47892
|
-
case "NONE":
|
|
47893
|
-
return range;
|
|
47894
47915
|
case "REMOVE":
|
|
47895
47916
|
return undefined;
|
|
47896
47917
|
default:
|
|
@@ -55456,7 +55477,7 @@ class GaugeChartConfigPanel extends owl.Component {
|
|
|
55456
55477
|
});
|
|
55457
55478
|
dataRange = this.props.definition.dataRange;
|
|
55458
55479
|
get configurationErrorMessages() {
|
|
55459
|
-
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])];
|
|
55480
|
+
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
55460
55481
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
55461
55482
|
}
|
|
55462
55483
|
get isDataRangeInvalid() {
|
|
@@ -55542,7 +55563,7 @@ class GaugeChartDesignPanel extends owl.Component {
|
|
|
55542
55563
|
});
|
|
55543
55564
|
}
|
|
55544
55565
|
get designErrorMessages() {
|
|
55545
|
-
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])];
|
|
55566
|
+
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
55546
55567
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
55547
55568
|
}
|
|
55548
55569
|
get isRangeMinInvalid() {
|
|
@@ -55914,7 +55935,7 @@ class ScorecardChartConfigPanel extends owl.Component {
|
|
|
55914
55935
|
const cancelledReasons = [
|
|
55915
55936
|
...(this.state.keyValueDispatchResult?.reasons || []),
|
|
55916
55937
|
...(this.state.baselineDispatchResult?.reasons || []),
|
|
55917
|
-
];
|
|
55938
|
+
].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
55918
55939
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
55919
55940
|
}
|
|
55920
55941
|
get isKeyValueInvalid() {
|
|
@@ -62220,7 +62241,7 @@ class CorePlugin extends BasePlugin {
|
|
|
62220
62241
|
* @param sheetId an sheetId to adapt either range of that sheet specifically, or ranges pointing to that sheet
|
|
62221
62242
|
* @param sheetName couple of old and new sheet names to adapt ranges pointing to that sheet
|
|
62222
62243
|
*/
|
|
62223
|
-
adaptRanges(
|
|
62244
|
+
adaptRanges(rangeAdapterFunctions, sheetId, sheetName) { }
|
|
62224
62245
|
/**
|
|
62225
62246
|
* Implement this method to clean unused external resources, such as images
|
|
62226
62247
|
* stored on a server which have been deleted.
|
|
@@ -62299,7 +62320,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
62299
62320
|
}
|
|
62300
62321
|
}
|
|
62301
62322
|
}
|
|
62302
|
-
adaptRanges(applyChange, sheetId) {
|
|
62323
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
62303
62324
|
const newBorders = [];
|
|
62304
62325
|
for (const border of this.borders[sheetId] ?? []) {
|
|
62305
62326
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, border.zone));
|
|
@@ -62662,7 +62683,7 @@ class CellPlugin extends CorePlugin {
|
|
|
62662
62683
|
];
|
|
62663
62684
|
nextId = 1;
|
|
62664
62685
|
cells = {};
|
|
62665
|
-
adaptRanges(applyChange, sheetId, sheetName) {
|
|
62686
|
+
adaptRanges({ applyChange }, sheetId, sheetName) {
|
|
62666
62687
|
for (const sheet of Object.keys(this.cells)) {
|
|
62667
62688
|
for (const cell of Object.values(this.cells[sheet] || {})) {
|
|
62668
62689
|
if (cell.isFormula) {
|
|
@@ -62884,7 +62905,7 @@ class CellPlugin extends CorePlugin {
|
|
|
62884
62905
|
for (const position of positions) {
|
|
62885
62906
|
const cell = this.getters.getCell(position);
|
|
62886
62907
|
const xc = toXC(position.col, position.row);
|
|
62887
|
-
const style = this.
|
|
62908
|
+
const style = this.extractCustomStyle(cell);
|
|
62888
62909
|
if (Object.keys(style).length) {
|
|
62889
62910
|
const styleId = getItemId(style, styles);
|
|
62890
62911
|
positionsByStyle[styleId] ??= [];
|
|
@@ -62930,10 +62951,14 @@ class CellPlugin extends CorePlugin {
|
|
|
62930
62951
|
}
|
|
62931
62952
|
}
|
|
62932
62953
|
}
|
|
62933
|
-
|
|
62934
|
-
const cleanedStyle = { ...style };
|
|
62935
|
-
|
|
62936
|
-
|
|
62954
|
+
extractCustomStyle(cell) {
|
|
62955
|
+
const cleanedStyle = { ...cell.style };
|
|
62956
|
+
const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
|
|
62957
|
+
? DEFAULT_NUMBER_STYLE
|
|
62958
|
+
: DEFAULT_STYLE;
|
|
62959
|
+
for (const property in cleanedStyle) {
|
|
62960
|
+
if ((property !== "align" || !cell.isFormula) &&
|
|
62961
|
+
cleanedStyle[property] === defaultStyle[property]) {
|
|
62937
62962
|
delete cleanedStyle[property];
|
|
62938
62963
|
}
|
|
62939
62964
|
}
|
|
@@ -63284,12 +63309,12 @@ class ChartPlugin extends CorePlugin {
|
|
|
63284
63309
|
charts = {};
|
|
63285
63310
|
createChart = chartFactory(this.getters);
|
|
63286
63311
|
validateChartDefinition = (cmd) => validateChartDefinition(this, cmd.definition);
|
|
63287
|
-
adaptRanges(
|
|
63312
|
+
adaptRanges(rangeAdapters) {
|
|
63288
63313
|
for (const [chartId, chart] of Object.entries(this.charts)) {
|
|
63289
63314
|
if (!chart) {
|
|
63290
63315
|
continue;
|
|
63291
63316
|
}
|
|
63292
|
-
const newChart = chart.chart.updateRanges(
|
|
63317
|
+
const newChart = chart.chart.updateRanges(rangeAdapters);
|
|
63293
63318
|
this.history.update("charts", chartId, newChart ? { figureId: chart.figureId, chart: newChart } : undefined);
|
|
63294
63319
|
}
|
|
63295
63320
|
}
|
|
@@ -63544,7 +63569,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
63544
63569
|
"getAdaptedCfRanges",
|
|
63545
63570
|
];
|
|
63546
63571
|
cfRules = {};
|
|
63547
|
-
adaptCFFormulas(applyChange) {
|
|
63572
|
+
adaptCFFormulas({ applyChange, adaptFormulaString }) {
|
|
63548
63573
|
for (const sheetId in this.cfRules) {
|
|
63549
63574
|
for (const rule of this.cfRules[sheetId]) {
|
|
63550
63575
|
if (rule.rule.type === "DataBarRule" && rule.rule.rangeValues) {
|
|
@@ -63568,7 +63593,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
63568
63593
|
for (let i = 0; i < rule.rule.values.length; i++) {
|
|
63569
63594
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
63570
63595
|
//@ts-expect-error
|
|
63571
|
-
"values", i,
|
|
63596
|
+
"values", i, adaptFormulaString(sheetId, rule.rule.values[i]));
|
|
63572
63597
|
}
|
|
63573
63598
|
}
|
|
63574
63599
|
else if (rule.rule.type === "IconSetRule") {
|
|
@@ -63576,7 +63601,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
63576
63601
|
if (rule.rule[inflectionPoint].type === "formula") {
|
|
63577
63602
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
63578
63603
|
//@ts-expect-error
|
|
63579
|
-
inflectionPoint, "value",
|
|
63604
|
+
inflectionPoint, "value", adaptFormulaString(sheetId, rule.rule[inflectionPoint].value));
|
|
63580
63605
|
}
|
|
63581
63606
|
}
|
|
63582
63607
|
}
|
|
@@ -63586,14 +63611,14 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
63586
63611
|
if (ruleValue?.type === "formula" && ruleValue?.value) {
|
|
63587
63612
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
63588
63613
|
//@ts-expect-error
|
|
63589
|
-
value, "value",
|
|
63614
|
+
value, "value", adaptFormulaString(sheetId, ruleValue.value));
|
|
63590
63615
|
}
|
|
63591
63616
|
}
|
|
63592
63617
|
}
|
|
63593
63618
|
}
|
|
63594
63619
|
}
|
|
63595
63620
|
}
|
|
63596
|
-
adaptCFRanges(sheetId, applyChange) {
|
|
63621
|
+
adaptCFRanges(sheetId, { applyChange }) {
|
|
63597
63622
|
for (const rule of this.cfRules[sheetId]) {
|
|
63598
63623
|
for (const range of rule.ranges) {
|
|
63599
63624
|
const change = applyChange(range);
|
|
@@ -63617,12 +63642,12 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
63617
63642
|
}
|
|
63618
63643
|
}
|
|
63619
63644
|
}
|
|
63620
|
-
adaptRanges(
|
|
63645
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
63621
63646
|
const sheetIds = sheetId ? [sheetId] : Object.keys(this.cfRules);
|
|
63622
63647
|
for (const sheetId of sheetIds) {
|
|
63623
|
-
this.adaptCFRanges(sheetId,
|
|
63648
|
+
this.adaptCFRanges(sheetId, rangeAdapters);
|
|
63624
63649
|
}
|
|
63625
|
-
this.adaptCFFormulas(
|
|
63650
|
+
this.adaptCFFormulas(rangeAdapters);
|
|
63626
63651
|
}
|
|
63627
63652
|
// ---------------------------------------------------------------------------
|
|
63628
63653
|
// Command Handling
|
|
@@ -63999,23 +64024,23 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
63999
64024
|
"getValidationRuleForCell",
|
|
64000
64025
|
];
|
|
64001
64026
|
rules = {};
|
|
64002
|
-
adaptRanges(
|
|
64003
|
-
this.adaptDVRanges(sheetId,
|
|
64004
|
-
this.adaptDVFormulas(
|
|
64027
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
64028
|
+
this.adaptDVRanges(sheetId, rangeAdapters);
|
|
64029
|
+
this.adaptDVFormulas(rangeAdapters);
|
|
64005
64030
|
}
|
|
64006
|
-
adaptDVFormulas(
|
|
64031
|
+
adaptDVFormulas({ adaptFormulaString }) {
|
|
64007
64032
|
for (const sheetId in this.rules) {
|
|
64008
64033
|
const rules = this.rules[sheetId];
|
|
64009
64034
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
64010
64035
|
const rule = this.rules[sheetId][ruleIndex];
|
|
64011
64036
|
for (let valueIndex = 0; valueIndex < rule.criterion.values.length; valueIndex++) {
|
|
64012
|
-
const value =
|
|
64037
|
+
const value = adaptFormulaString(sheetId, rule.criterion.values[valueIndex]);
|
|
64013
64038
|
this.history.update("rules", sheetId, ruleIndex, "criterion", "values", valueIndex, value);
|
|
64014
64039
|
}
|
|
64015
64040
|
}
|
|
64016
64041
|
}
|
|
64017
64042
|
}
|
|
64018
|
-
adaptDVRanges(sheetId, applyChange) {
|
|
64043
|
+
adaptDVRanges(sheetId, { applyChange }) {
|
|
64019
64044
|
const rules = this.rules[sheetId];
|
|
64020
64045
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
64021
64046
|
const rule = this.rules[sheetId][ruleIndex];
|
|
@@ -64289,7 +64314,7 @@ class FigurePlugin extends CorePlugin {
|
|
|
64289
64314
|
// ---------------------------------------------------------------------------
|
|
64290
64315
|
// Command Handling
|
|
64291
64316
|
// ---------------------------------------------------------------------------
|
|
64292
|
-
adaptRanges(applyChange, sheetId) {
|
|
64317
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
64293
64318
|
for (const figure of this.getFigures(sheetId)) {
|
|
64294
64319
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, {
|
|
64295
64320
|
left: figure.col,
|
|
@@ -65120,8 +65145,8 @@ class MergePlugin extends CorePlugin {
|
|
|
65120
65145
|
break;
|
|
65121
65146
|
}
|
|
65122
65147
|
}
|
|
65123
|
-
adaptRanges(
|
|
65124
|
-
this.applyRangeChangeOnSheet(sheetId,
|
|
65148
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
65149
|
+
this.applyRangeChangeOnSheet(sheetId, rangeAdapters);
|
|
65125
65150
|
}
|
|
65126
65151
|
// ---------------------------------------------------------------------------
|
|
65127
65152
|
// Getters
|
|
@@ -65423,7 +65448,7 @@ class MergePlugin extends CorePlugin {
|
|
|
65423
65448
|
/**
|
|
65424
65449
|
* Apply a range change on merges of a particular sheet.
|
|
65425
65450
|
*/
|
|
65426
|
-
applyRangeChangeOnSheet(sheetId, applyChange) {
|
|
65451
|
+
applyRangeChangeOnSheet(sheetId, { applyChange }) {
|
|
65427
65452
|
const merges = Object.entries(this.merges[sheetId] || {});
|
|
65428
65453
|
for (const [mergeId, range] of merges) {
|
|
65429
65454
|
if (range) {
|
|
@@ -65497,7 +65522,7 @@ function rangeToMerge(mergeId, range) {
|
|
|
65497
65522
|
};
|
|
65498
65523
|
}
|
|
65499
65524
|
|
|
65500
|
-
class
|
|
65525
|
+
class RangeAdapterPlugin {
|
|
65501
65526
|
getters;
|
|
65502
65527
|
providers = [];
|
|
65503
65528
|
isAdaptingRanges = false;
|
|
@@ -65505,7 +65530,6 @@ class RangeAdapter {
|
|
|
65505
65530
|
this.getters = getters;
|
|
65506
65531
|
}
|
|
65507
65532
|
static getters = [
|
|
65508
|
-
"adaptFormulaStringDependencies",
|
|
65509
65533
|
"copyFormulaStringForSheet",
|
|
65510
65534
|
"extendRange",
|
|
65511
65535
|
"getRangeString",
|
|
@@ -65536,8 +65560,8 @@ class RangeAdapter {
|
|
|
65536
65560
|
throw new Error("Plugins cannot dispatch commands during adaptRanges phase");
|
|
65537
65561
|
}
|
|
65538
65562
|
const rangeAdapter = getRangeAdapter(cmd);
|
|
65539
|
-
if (rangeAdapter
|
|
65540
|
-
this.executeOnAllRanges(rangeAdapter
|
|
65563
|
+
if (rangeAdapter) {
|
|
65564
|
+
this.executeOnAllRanges(rangeAdapter);
|
|
65541
65565
|
}
|
|
65542
65566
|
}
|
|
65543
65567
|
finalize() { }
|
|
@@ -65556,11 +65580,15 @@ class RangeAdapter {
|
|
|
65556
65580
|
return result;
|
|
65557
65581
|
};
|
|
65558
65582
|
}
|
|
65559
|
-
executeOnAllRanges(
|
|
65583
|
+
executeOnAllRanges(rangeAdapter) {
|
|
65560
65584
|
this.isAdaptingRanges = true;
|
|
65561
|
-
const
|
|
65585
|
+
const adapterFunctions = {
|
|
65586
|
+
applyChange: this.verifyRangeRemoved(rangeAdapter.applyChange),
|
|
65587
|
+
adaptRangeString: (defaultSheetId, sheetXC) => adaptStringRange(defaultSheetId, sheetXC, rangeAdapter),
|
|
65588
|
+
adaptFormulaString: (defaultSheetId, formula) => adaptFormulaStringRanges(defaultSheetId, formula, rangeAdapter),
|
|
65589
|
+
};
|
|
65562
65590
|
for (const provider of this.providers) {
|
|
65563
|
-
provider(
|
|
65591
|
+
provider(adapterFunctions, rangeAdapter.sheetId, rangeAdapter.sheetName);
|
|
65564
65592
|
}
|
|
65565
65593
|
this.isAdaptingRanges = false;
|
|
65566
65594
|
}
|
|
@@ -65728,18 +65756,6 @@ class RangeAdapter {
|
|
|
65728
65756
|
const unionOfZones = unionUnboundedZones(...zones);
|
|
65729
65757
|
return this.getRangeFromZone(ranges[0].sheetId, unionOfZones);
|
|
65730
65758
|
}
|
|
65731
|
-
adaptFormulaStringDependencies(sheetId, formula, applyChange) {
|
|
65732
|
-
if (!formula.startsWith("=")) {
|
|
65733
|
-
return formula;
|
|
65734
|
-
}
|
|
65735
|
-
const compiledFormula = compile(formula);
|
|
65736
|
-
const updatedDependencies = compiledFormula.dependencies.map((dep) => {
|
|
65737
|
-
const range = this.getters.getRangeFromSheetXC(sheetId, dep);
|
|
65738
|
-
const changedRange = applyChange(range);
|
|
65739
|
-
return changedRange.changeType === "NONE" ? range : changedRange.range;
|
|
65740
|
-
});
|
|
65741
|
-
return this.getters.getFormulaString(sheetId, compiledFormula.tokens, updatedDependencies);
|
|
65742
|
-
}
|
|
65743
65759
|
/**
|
|
65744
65760
|
* Copy a formula string to another sheet.
|
|
65745
65761
|
*
|
|
@@ -66627,7 +66643,7 @@ class TablePlugin extends CorePlugin {
|
|
|
66627
66643
|
static getters = ["getCoreTable", "getCoreTables", "getCoreTableMatchingTopLeft"];
|
|
66628
66644
|
tables = {};
|
|
66629
66645
|
nextTableId = 1;
|
|
66630
|
-
adaptRanges(applyChange, sheetId) {
|
|
66646
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
66631
66647
|
for (const table of this.getCoreTables(sheetId)) {
|
|
66632
66648
|
this.applyRangeChangeOnTable(sheetId, table, applyChange);
|
|
66633
66649
|
}
|
|
@@ -67712,7 +67728,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
67712
67728
|
}
|
|
67713
67729
|
}
|
|
67714
67730
|
}
|
|
67715
|
-
adaptRanges(applyChange) {
|
|
67731
|
+
adaptRanges({ applyChange, adaptFormulaString }) {
|
|
67716
67732
|
for (const pivotId in this.pivots) {
|
|
67717
67733
|
const definition = deepCopy(this.pivots[pivotId]?.definition);
|
|
67718
67734
|
if (!definition) {
|
|
@@ -67732,19 +67748,13 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
67732
67748
|
continue;
|
|
67733
67749
|
}
|
|
67734
67750
|
const sheetId = measure.computedBy.sheetId;
|
|
67735
|
-
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId]
|
|
67736
|
-
|
|
67737
|
-
|
|
67738
|
-
|
|
67739
|
-
|
|
67740
|
-
newDependencies.push(range);
|
|
67741
|
-
}
|
|
67742
|
-
else {
|
|
67743
|
-
newDependencies.push(change.range);
|
|
67744
|
-
}
|
|
67745
|
-
}
|
|
67746
|
-
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
67751
|
+
const { formula: compiledFormula, dependencies: indirectDependencies } = this.compiledMeasureFormulas[pivotId][measureId];
|
|
67752
|
+
// adapt direct dependencies
|
|
67753
|
+
this.history.update("compiledMeasureFormulas", pivotId, measureId, "formula", "dependencies", compiledFormula.dependencies.map((range) => applyChange(range).range));
|
|
67754
|
+
// adapt all dependencies (including indirect)
|
|
67755
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", indirectDependencies.map((range) => applyChange(range).range));
|
|
67747
67756
|
const oldFormulaString = measure.computedBy.formula;
|
|
67757
|
+
const newFormulaString = adaptFormulaString(sheetId, oldFormulaString);
|
|
67748
67758
|
if (newFormulaString !== oldFormulaString) {
|
|
67749
67759
|
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
67750
67760
|
}
|
|
@@ -67906,7 +67916,6 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
67906
67916
|
formula: newFormulaString,
|
|
67907
67917
|
sheetId: measure.computedBy.sheetId,
|
|
67908
67918
|
});
|
|
67909
|
-
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
67910
67919
|
}
|
|
67911
67920
|
checkSortedColumnInMeasures(definition) {
|
|
67912
67921
|
const measures = definition.measures.map((measure) => measure.id);
|
|
@@ -69552,11 +69561,16 @@ class SpreadingRelation {
|
|
|
69552
69561
|
return this.arrayFormulasToResults.get(formulasPosition);
|
|
69553
69562
|
}
|
|
69554
69563
|
/**
|
|
69555
|
-
* Remove a
|
|
69564
|
+
* Remove a spreading relation for a given array formula position
|
|
69565
|
+
* and its result zone
|
|
69556
69566
|
*/
|
|
69557
69567
|
removeNode(position) {
|
|
69568
|
+
const resultZone = this.arrayFormulasToResults.get(position);
|
|
69569
|
+
if (!resultZone) {
|
|
69570
|
+
return;
|
|
69571
|
+
}
|
|
69558
69572
|
this.resultsToArrayFormulas.remove({
|
|
69559
|
-
boundingBox: { sheetId: position.sheetId, zone:
|
|
69573
|
+
boundingBox: { sheetId: position.sheetId, zone: resultZone },
|
|
69560
69574
|
data: position,
|
|
69561
69575
|
});
|
|
69562
69576
|
this.arrayFormulasToResults.delete(position);
|
|
@@ -69869,6 +69883,10 @@ class Evaluator {
|
|
|
69869
69883
|
// empty matrix
|
|
69870
69884
|
return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
|
|
69871
69885
|
}
|
|
69886
|
+
if (nbRows === 1 && nbColumns === 1) {
|
|
69887
|
+
// single value matrix
|
|
69888
|
+
return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
|
|
69889
|
+
}
|
|
69872
69890
|
const resultZone = {
|
|
69873
69891
|
top: formulaPosition.row,
|
|
69874
69892
|
bottom: formulaPosition.row + nbRows - 1,
|
|
@@ -71588,6 +71606,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
71588
71606
|
handle(cmd) {
|
|
71589
71607
|
switch (cmd.type) {
|
|
71590
71608
|
case "START":
|
|
71609
|
+
case "UPDATE_LOCALE":
|
|
71591
71610
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
71592
71611
|
this.initializeSheet(sheetId);
|
|
71593
71612
|
}
|
|
@@ -71709,7 +71728,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
71709
71728
|
}
|
|
71710
71729
|
const cell = this.getters.getCell(position);
|
|
71711
71730
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
71712
|
-
return getDefaultCellHeight(this.ctx, cell, colSize);
|
|
71731
|
+
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
71713
71732
|
}
|
|
71714
71733
|
isInMultiRowMerge(position) {
|
|
71715
71734
|
const merge = this.getters.getMerge(position);
|
|
@@ -74032,7 +74051,7 @@ function addConditionalFormatCommandAdaptRange(cmd, applyChange) {
|
|
|
74032
74051
|
cmd.cf.rule = {
|
|
74033
74052
|
...rule,
|
|
74034
74053
|
rangeValues: rule.rangeValues
|
|
74035
|
-
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange)
|
|
74054
|
+
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange).range
|
|
74036
74055
|
: undefined,
|
|
74037
74056
|
};
|
|
74038
74057
|
}
|
|
@@ -87652,6 +87671,9 @@ function addStyles(styles) {
|
|
|
87652
87671
|
if (style.alignment && style.alignment.wrapText) {
|
|
87653
87672
|
alignAttrs.push(["wrapText", "1"]);
|
|
87654
87673
|
}
|
|
87674
|
+
if (style.alignment && style.alignment.shrinkToFit) {
|
|
87675
|
+
alignAttrs.push(["shrinkToFit", "1"]);
|
|
87676
|
+
}
|
|
87655
87677
|
if (alignAttrs.length > 0) {
|
|
87656
87678
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
87657
87679
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
@@ -88422,7 +88444,7 @@ class Model extends EventBus {
|
|
|
88422
88444
|
this.config = this.setupConfig(config);
|
|
88423
88445
|
this.session = this.setupSession(workbookData.revisionId);
|
|
88424
88446
|
this.coreGetters = {};
|
|
88425
|
-
this.range = new
|
|
88447
|
+
this.range = new RangeAdapterPlugin(this.coreGetters);
|
|
88426
88448
|
this.coreGetters.getRangeString = this.range.getRangeString.bind(this.range);
|
|
88427
88449
|
this.coreGetters.getRangeFromSheetXC = this.range.getRangeFromSheetXC.bind(this.range);
|
|
88428
88450
|
this.coreGetters.createAdaptedRanges = this.range.createAdaptedRanges.bind(this.range);
|
|
@@ -88436,8 +88458,6 @@ class Model extends EventBus {
|
|
|
88436
88458
|
this.coreGetters.extendRange = this.range.extendRange.bind(this.range);
|
|
88437
88459
|
this.coreGetters.getRangesUnion = this.range.getRangesUnion.bind(this.range);
|
|
88438
88460
|
this.coreGetters.removeRangesSheetPrefix = this.range.removeRangesSheetPrefix.bind(this.range);
|
|
88439
|
-
this.coreGetters.adaptFormulaStringDependencies =
|
|
88440
|
-
this.range.adaptFormulaStringDependencies.bind(this.range);
|
|
88441
88461
|
this.coreGetters.copyFormulaStringForSheet = this.range.copyFormulaStringForSheet.bind(this.range);
|
|
88442
88462
|
this.getters = {
|
|
88443
88463
|
isReadonly: () => this.config.mode === "readonly" || this.config.mode === "dashboard",
|
|
@@ -89175,6 +89195,6 @@ exports.tokenColors = tokenColors;
|
|
|
89175
89195
|
exports.tokenize = tokenize;
|
|
89176
89196
|
|
|
89177
89197
|
|
|
89178
|
-
__info__.version = "19.0.
|
|
89179
|
-
__info__.date = "2026-01-
|
|
89180
|
-
__info__.hash = "
|
|
89198
|
+
__info__.version = "19.0.18";
|
|
89199
|
+
__info__.date = "2026-01-21T11:06:57.346Z";
|
|
89200
|
+
__info__.hash = "bd44f59";
|