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