@odoo/o-spreadsheet 18.3.32 → 18.3.33
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 +214 -198
- package/dist/o-spreadsheet.d.ts +224 -218
- package/dist/o-spreadsheet.esm.js +214 -198
- package/dist/o-spreadsheet.iife.js +214 -198
- package/dist/o-spreadsheet.iife.min.js +399 -399
- 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 18.3.
|
|
6
|
-
* @date 2026-01-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.33
|
|
6
|
+
* @date 2026-01-21T11:05:17.933Z
|
|
7
|
+
* @hash b7e5d91
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -34,7 +34,8 @@ function createAction(item) {
|
|
|
34
34
|
return children
|
|
35
35
|
.map((child) => (typeof child === "function" ? child(env) : child))
|
|
36
36
|
.flat()
|
|
37
|
-
.map(createAction)
|
|
37
|
+
.map(createAction)
|
|
38
|
+
.sort((a, b) => a.sequence - b.sequence);
|
|
38
39
|
}
|
|
39
40
|
: () => [],
|
|
40
41
|
isReadonlyAllowed: item.isReadonlyAllowed || false,
|
|
@@ -309,6 +310,7 @@ const DEFAULT_STYLE = {
|
|
|
309
310
|
fillColor: "",
|
|
310
311
|
textColor: "",
|
|
311
312
|
};
|
|
313
|
+
const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
|
|
312
314
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
313
315
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
314
316
|
// Fonts
|
|
@@ -6181,67 +6183,6 @@ function getFullReference(sheetName, xc) {
|
|
|
6181
6183
|
return sheetName !== undefined ? `${getCanonicalSymbolName(sheetName)}!${xc}` : xc;
|
|
6182
6184
|
}
|
|
6183
6185
|
|
|
6184
|
-
function createDefaultRows(rowNumber) {
|
|
6185
|
-
const rows = [];
|
|
6186
|
-
for (let i = 0; i < rowNumber; i++) {
|
|
6187
|
-
const row = {
|
|
6188
|
-
cells: {},
|
|
6189
|
-
};
|
|
6190
|
-
rows.push(row);
|
|
6191
|
-
}
|
|
6192
|
-
return rows;
|
|
6193
|
-
}
|
|
6194
|
-
function moveHeaderIndexesOnHeaderAddition(indexHeaderAdded, numberAdded, headers) {
|
|
6195
|
-
return headers.map((header) => {
|
|
6196
|
-
if (header >= indexHeaderAdded) {
|
|
6197
|
-
return header + numberAdded;
|
|
6198
|
-
}
|
|
6199
|
-
return header;
|
|
6200
|
-
});
|
|
6201
|
-
}
|
|
6202
|
-
function moveHeaderIndexesOnHeaderDeletion(deletedHeaders, headers) {
|
|
6203
|
-
deletedHeaders = [...deletedHeaders].sort((a, b) => b - a);
|
|
6204
|
-
return headers
|
|
6205
|
-
.map((header) => {
|
|
6206
|
-
for (const deletedHeader of deletedHeaders) {
|
|
6207
|
-
if (header > deletedHeader) {
|
|
6208
|
-
header--;
|
|
6209
|
-
}
|
|
6210
|
-
else if (header === deletedHeader) {
|
|
6211
|
-
return undefined;
|
|
6212
|
-
}
|
|
6213
|
-
}
|
|
6214
|
-
return header;
|
|
6215
|
-
})
|
|
6216
|
-
.filter(isDefined);
|
|
6217
|
-
}
|
|
6218
|
-
function getNextSheetName(existingNames, baseName = "Sheet") {
|
|
6219
|
-
let i = 1;
|
|
6220
|
-
let name = `${baseName}${i}`;
|
|
6221
|
-
while (existingNames.includes(name)) {
|
|
6222
|
-
name = `${baseName}${i}`;
|
|
6223
|
-
i++;
|
|
6224
|
-
}
|
|
6225
|
-
return name;
|
|
6226
|
-
}
|
|
6227
|
-
function getDuplicateSheetName(nameToDuplicate, existingNames) {
|
|
6228
|
-
let i = 1;
|
|
6229
|
-
const baseName = _t("Copy of %s", nameToDuplicate);
|
|
6230
|
-
let name = baseName.toString();
|
|
6231
|
-
while (existingNames.includes(name)) {
|
|
6232
|
-
name = `${baseName} (${i})`;
|
|
6233
|
-
i++;
|
|
6234
|
-
}
|
|
6235
|
-
return name;
|
|
6236
|
-
}
|
|
6237
|
-
function isSheetNameEqual(name1, name2) {
|
|
6238
|
-
if (name1 === undefined || name2 === undefined) {
|
|
6239
|
-
return false;
|
|
6240
|
-
}
|
|
6241
|
-
return (getUnquotedSheetName(name1.trim().toUpperCase()) ===
|
|
6242
|
-
getUnquotedSheetName(name2.trim().toUpperCase()));
|
|
6243
|
-
}
|
|
6244
|
-
|
|
6245
6186
|
function createRange(args, getSheetSize) {
|
|
6246
6187
|
const unboundedZone = args.zone;
|
|
6247
6188
|
const zone = boundUnboundedZone(unboundedZone, getSheetSize(args.sheetId));
|
|
@@ -6536,8 +6477,8 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
6536
6477
|
elements.sort((a, b) => b - a);
|
|
6537
6478
|
const groups = groupConsecutive(elements);
|
|
6538
6479
|
return (range) => {
|
|
6539
|
-
if (
|
|
6540
|
-
return { changeType: "NONE" };
|
|
6480
|
+
if (range.sheetId !== cmd.sheetId) {
|
|
6481
|
+
return { changeType: "NONE", range };
|
|
6541
6482
|
}
|
|
6542
6483
|
let newRange = range;
|
|
6543
6484
|
let changeType = "NONE";
|
|
@@ -6564,10 +6505,7 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
6564
6505
|
newRange = createAdaptedRange(newRange, dimension, changeType, -(max - min + 1));
|
|
6565
6506
|
}
|
|
6566
6507
|
}
|
|
6567
|
-
|
|
6568
|
-
return { changeType, range: newRange };
|
|
6569
|
-
}
|
|
6570
|
-
return { changeType: "NONE" };
|
|
6508
|
+
return { changeType, range: newRange };
|
|
6571
6509
|
};
|
|
6572
6510
|
}
|
|
6573
6511
|
function getApplyRangeChangeAddColRow(cmd) {
|
|
@@ -6576,7 +6514,7 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
6576
6514
|
let dimension = cmd.dimension === "COL" ? "columns" : "rows";
|
|
6577
6515
|
return (range) => {
|
|
6578
6516
|
if (range.sheetId !== cmd.sheetId) {
|
|
6579
|
-
return { changeType: "NONE" };
|
|
6517
|
+
return { changeType: "NONE", range };
|
|
6580
6518
|
}
|
|
6581
6519
|
if (cmd.position === "after") {
|
|
6582
6520
|
if (range.zone[start] <= cmd.base && cmd.base < range.zone[end]) {
|
|
@@ -6606,13 +6544,13 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
6606
6544
|
};
|
|
6607
6545
|
}
|
|
6608
6546
|
}
|
|
6609
|
-
return { changeType: "NONE" };
|
|
6547
|
+
return { changeType: "NONE", range };
|
|
6610
6548
|
};
|
|
6611
6549
|
}
|
|
6612
6550
|
function getApplyRangeChangeDeleteSheet(cmd) {
|
|
6613
6551
|
return (range) => {
|
|
6614
6552
|
if (range.sheetId !== cmd.sheetId && range.invalidSheetName !== cmd.sheetName) {
|
|
6615
|
-
return { changeType: "NONE" };
|
|
6553
|
+
return { changeType: "NONE", range };
|
|
6616
6554
|
}
|
|
6617
6555
|
const invalidSheetName = cmd.sheetName;
|
|
6618
6556
|
range = {
|
|
@@ -6639,14 +6577,14 @@ function getApplyRangeChangeRenameSheet(cmd) {
|
|
|
6639
6577
|
const newRange = { ...range, sheetId, invalidSheetName };
|
|
6640
6578
|
return { changeType: "CHANGE", range: newRange };
|
|
6641
6579
|
}
|
|
6642
|
-
return { changeType: "NONE" };
|
|
6580
|
+
return { changeType: "NONE", range };
|
|
6643
6581
|
};
|
|
6644
6582
|
}
|
|
6645
6583
|
function getApplyRangeChangeMoveRange(cmd) {
|
|
6646
6584
|
const originZone = cmd.target[0];
|
|
6647
6585
|
return (range) => {
|
|
6648
6586
|
if (range.sheetId !== cmd.sheetId || !isZoneInside(range.zone, originZone)) {
|
|
6649
|
-
return { changeType: "NONE" };
|
|
6587
|
+
return { changeType: "NONE", range };
|
|
6650
6588
|
}
|
|
6651
6589
|
const targetSheetId = cmd.targetSheetId;
|
|
6652
6590
|
const offsetX = cmd.col - originZone.left;
|
|
@@ -6743,17 +6681,87 @@ function fuzzyLookup(pattern, list, fn) {
|
|
|
6743
6681
|
return results.map((r) => r.elem);
|
|
6744
6682
|
}
|
|
6745
6683
|
|
|
6684
|
+
function createDefaultRows(rowNumber) {
|
|
6685
|
+
const rows = [];
|
|
6686
|
+
for (let i = 0; i < rowNumber; i++) {
|
|
6687
|
+
const row = {
|
|
6688
|
+
cells: {},
|
|
6689
|
+
};
|
|
6690
|
+
rows.push(row);
|
|
6691
|
+
}
|
|
6692
|
+
return rows;
|
|
6693
|
+
}
|
|
6694
|
+
function moveHeaderIndexesOnHeaderAddition(indexHeaderAdded, numberAdded, headers) {
|
|
6695
|
+
return headers.map((header) => {
|
|
6696
|
+
if (header >= indexHeaderAdded) {
|
|
6697
|
+
return header + numberAdded;
|
|
6698
|
+
}
|
|
6699
|
+
return header;
|
|
6700
|
+
});
|
|
6701
|
+
}
|
|
6702
|
+
function moveHeaderIndexesOnHeaderDeletion(deletedHeaders, headers) {
|
|
6703
|
+
deletedHeaders = [...deletedHeaders].sort((a, b) => b - a);
|
|
6704
|
+
return headers
|
|
6705
|
+
.map((header) => {
|
|
6706
|
+
for (const deletedHeader of deletedHeaders) {
|
|
6707
|
+
if (header > deletedHeader) {
|
|
6708
|
+
header--;
|
|
6709
|
+
}
|
|
6710
|
+
else if (header === deletedHeader) {
|
|
6711
|
+
return undefined;
|
|
6712
|
+
}
|
|
6713
|
+
}
|
|
6714
|
+
return header;
|
|
6715
|
+
})
|
|
6716
|
+
.filter(isDefined);
|
|
6717
|
+
}
|
|
6718
|
+
function getNextSheetName(existingNames, baseName = "Sheet") {
|
|
6719
|
+
let i = 1;
|
|
6720
|
+
let name = `${baseName}${i}`;
|
|
6721
|
+
while (existingNames.includes(name)) {
|
|
6722
|
+
name = `${baseName}${i}`;
|
|
6723
|
+
i++;
|
|
6724
|
+
}
|
|
6725
|
+
return name;
|
|
6726
|
+
}
|
|
6727
|
+
function getDuplicateSheetName(nameToDuplicate, existingNames) {
|
|
6728
|
+
let i = 1;
|
|
6729
|
+
const baseName = _t("Copy of %s", nameToDuplicate);
|
|
6730
|
+
let name = baseName.toString();
|
|
6731
|
+
while (existingNames.includes(name)) {
|
|
6732
|
+
name = `${baseName} (${i})`;
|
|
6733
|
+
i++;
|
|
6734
|
+
}
|
|
6735
|
+
return name;
|
|
6736
|
+
}
|
|
6737
|
+
function isSheetNameEqual(name1, name2) {
|
|
6738
|
+
if (name1 === undefined || name2 === undefined) {
|
|
6739
|
+
return false;
|
|
6740
|
+
}
|
|
6741
|
+
return (getUnquotedSheetName(name1.trim().toUpperCase()) ===
|
|
6742
|
+
getUnquotedSheetName(name2.trim().toUpperCase()));
|
|
6743
|
+
}
|
|
6744
|
+
|
|
6746
6745
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
6747
6746
|
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
6748
6747
|
}
|
|
6749
6748
|
/**
|
|
6750
6749
|
* Get the default height of the cell given its style.
|
|
6751
6750
|
*/
|
|
6752
|
-
function getDefaultCellHeight(ctx, cell, colSize) {
|
|
6751
|
+
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
6753
6752
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
6754
6753
|
return DEFAULT_CELL_HEIGHT;
|
|
6755
6754
|
}
|
|
6756
|
-
|
|
6755
|
+
let content = "";
|
|
6756
|
+
try {
|
|
6757
|
+
if (!cell.isFormula) {
|
|
6758
|
+
const localeFormat = { format: cell.format, locale };
|
|
6759
|
+
content = formatValue(parseLiteral(cell.content, locale), localeFormat);
|
|
6760
|
+
}
|
|
6761
|
+
}
|
|
6762
|
+
catch {
|
|
6763
|
+
content = CellErrorType.GenericError;
|
|
6764
|
+
}
|
|
6757
6765
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
6758
6766
|
}
|
|
6759
6767
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
@@ -20186,7 +20194,16 @@ function createComputeFunction(descr) {
|
|
|
20186
20194
|
}
|
|
20187
20195
|
acceptToVectorize.push(!argDefinition.acceptMatrix);
|
|
20188
20196
|
}
|
|
20189
|
-
return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
|
|
20197
|
+
return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
|
|
20198
|
+
}
|
|
20199
|
+
function replaceErrorPlaceholderInResult(result) {
|
|
20200
|
+
if (!isMatrix(result)) {
|
|
20201
|
+
replaceFunctionNamePlaceholder(result, descr.name);
|
|
20202
|
+
}
|
|
20203
|
+
else {
|
|
20204
|
+
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
20205
|
+
}
|
|
20206
|
+
return result;
|
|
20190
20207
|
}
|
|
20191
20208
|
function errorHandlingCompute(...args) {
|
|
20192
20209
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -20214,13 +20231,12 @@ function createComputeFunction(descr) {
|
|
|
20214
20231
|
const result = descr.compute.apply(this, args);
|
|
20215
20232
|
if (!isMatrix(result)) {
|
|
20216
20233
|
if (typeof result === "object" && result !== null && "value" in result) {
|
|
20217
|
-
replaceFunctionNamePlaceholder(result, descr.name);
|
|
20218
20234
|
return result;
|
|
20219
20235
|
}
|
|
20236
|
+
descr.name;
|
|
20220
20237
|
return { value: result };
|
|
20221
20238
|
}
|
|
20222
20239
|
if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
|
|
20223
|
-
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
20224
20240
|
return result;
|
|
20225
20241
|
}
|
|
20226
20242
|
return matrixMap(result, (row) => ({ value: row }));
|
|
@@ -20672,7 +20688,7 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
20672
20688
|
continue;
|
|
20673
20689
|
}
|
|
20674
20690
|
const sheetXC = tokens[tokenIdx].value;
|
|
20675
|
-
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange);
|
|
20691
|
+
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange).range;
|
|
20676
20692
|
if (sheetXC !== newSheetXC) {
|
|
20677
20693
|
tokens[tokenIdx] = {
|
|
20678
20694
|
value: newSheetXC,
|
|
@@ -20682,23 +20698,30 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
20682
20698
|
}
|
|
20683
20699
|
return concat(tokens.map((token) => token.value));
|
|
20684
20700
|
}
|
|
20685
|
-
function adaptStringRange(defaultSheetId, sheetXC,
|
|
20701
|
+
function adaptStringRange(defaultSheetId, sheetXC, rangeAdapter) {
|
|
20686
20702
|
const sheetName = splitReference(sheetXC).sheetName;
|
|
20687
20703
|
if (sheetName
|
|
20688
|
-
? !isSheetNameEqual(sheetName,
|
|
20689
|
-
: defaultSheetId !==
|
|
20690
|
-
return sheetXC;
|
|
20704
|
+
? !isSheetNameEqual(sheetName, rangeAdapter.sheetName.old)
|
|
20705
|
+
: defaultSheetId !== rangeAdapter.sheetId) {
|
|
20706
|
+
return { changeType: "NONE", range: sheetXC };
|
|
20691
20707
|
}
|
|
20692
|
-
const sheetId = sheetName ?
|
|
20708
|
+
const sheetId = sheetName ? rangeAdapter.sheetId : defaultSheetId;
|
|
20693
20709
|
const range = getRange(sheetXC, sheetId);
|
|
20694
20710
|
if (range.invalidXc) {
|
|
20695
|
-
return sheetXC;
|
|
20711
|
+
return { changeType: "NONE", range: sheetXC };
|
|
20696
20712
|
}
|
|
20697
|
-
const change =
|
|
20713
|
+
const change = rangeAdapter.applyChange(range);
|
|
20698
20714
|
if (change.changeType === "NONE" || change.changeType === "REMOVE") {
|
|
20699
|
-
return sheetXC;
|
|
20715
|
+
return { changeType: change.changeType, range: sheetXC };
|
|
20716
|
+
}
|
|
20717
|
+
const rangeStr = getRangeString(change.range, defaultSheetId, getSheetNameGetter(rangeAdapter));
|
|
20718
|
+
if (rangeStr === CellErrorType.InvalidReference) {
|
|
20719
|
+
return { changeType: "REMOVE", range: rangeStr };
|
|
20700
20720
|
}
|
|
20701
|
-
return
|
|
20721
|
+
return {
|
|
20722
|
+
changeType: change.changeType,
|
|
20723
|
+
range: rangeStr,
|
|
20724
|
+
};
|
|
20702
20725
|
}
|
|
20703
20726
|
function getSheetNameGetter(applyChange) {
|
|
20704
20727
|
return (sheetId) => {
|
|
@@ -20797,8 +20820,6 @@ function adaptChartRange(range, applyChange) {
|
|
|
20797
20820
|
}
|
|
20798
20821
|
const change = applyChange(range);
|
|
20799
20822
|
switch (change.changeType) {
|
|
20800
|
-
case "NONE":
|
|
20801
|
-
return range;
|
|
20802
20823
|
case "REMOVE":
|
|
20803
20824
|
return undefined;
|
|
20804
20825
|
default:
|
|
@@ -20936,16 +20957,16 @@ function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
|
20936
20957
|
function transformChartDefinitionWithDataSetsWithZone(chartSheetId, definition, applyChange) {
|
|
20937
20958
|
let labelRange;
|
|
20938
20959
|
if (definition.labelRange) {
|
|
20939
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
20940
|
-
if (
|
|
20960
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
20961
|
+
if (changeType !== "REMOVE") {
|
|
20941
20962
|
labelRange = adaptedRange;
|
|
20942
20963
|
}
|
|
20943
20964
|
}
|
|
20944
20965
|
const dataSets = [];
|
|
20945
20966
|
for (const dataSet of definition.dataSets) {
|
|
20946
20967
|
const newDataSet = { ...dataSet };
|
|
20947
|
-
const adaptedRange = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
20948
|
-
if (
|
|
20968
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
20969
|
+
if (changeType !== "REMOVE") {
|
|
20949
20970
|
newDataSet.dataRange = adaptedRange;
|
|
20950
20971
|
dataSets.push(newDataSet);
|
|
20951
20972
|
}
|
|
@@ -22271,14 +22292,14 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
22271
22292
|
let baseline;
|
|
22272
22293
|
let keyValue;
|
|
22273
22294
|
if (definition.baseline) {
|
|
22274
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
22275
|
-
if (
|
|
22295
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
22296
|
+
if (changeType !== "REMOVE") {
|
|
22276
22297
|
baseline = adaptedRange;
|
|
22277
22298
|
}
|
|
22278
22299
|
}
|
|
22279
22300
|
if (definition.keyValue) {
|
|
22280
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
22281
|
-
if (
|
|
22301
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
22302
|
+
if (changeType !== "REMOVE") {
|
|
22282
22303
|
keyValue = adaptedRange;
|
|
22283
22304
|
}
|
|
22284
22305
|
}
|
|
@@ -22334,7 +22355,7 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
22334
22355
|
// This kind of graph is not exportable in Excel
|
|
22335
22356
|
return undefined;
|
|
22336
22357
|
}
|
|
22337
|
-
updateRanges(applyChange) {
|
|
22358
|
+
updateRanges({ applyChange }) {
|
|
22338
22359
|
const baseline = adaptChartRange(this.baseline, applyChange);
|
|
22339
22360
|
const keyValue = adaptChartRange(this.keyValue, applyChange);
|
|
22340
22361
|
if (this.baseline === baseline && this.keyValue === keyValue) {
|
|
@@ -27206,7 +27227,7 @@ class BarChart extends AbstractChart {
|
|
|
27206
27227
|
verticalAxis: getDefinedAxis(definition),
|
|
27207
27228
|
};
|
|
27208
27229
|
}
|
|
27209
|
-
updateRanges(applyChange) {
|
|
27230
|
+
updateRanges({ applyChange }) {
|
|
27210
27231
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27211
27232
|
if (!isStale) {
|
|
27212
27233
|
return this;
|
|
@@ -27327,7 +27348,7 @@ class ComboChart extends AbstractChart {
|
|
|
27327
27348
|
verticalAxis: getDefinedAxis(definition),
|
|
27328
27349
|
};
|
|
27329
27350
|
}
|
|
27330
|
-
updateRanges(applyChange) {
|
|
27351
|
+
updateRanges({ applyChange }) {
|
|
27331
27352
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27332
27353
|
if (!isStale) {
|
|
27333
27354
|
return this;
|
|
@@ -27498,7 +27519,7 @@ class FunnelChart extends AbstractChart {
|
|
|
27498
27519
|
getDefinitionForExcel() {
|
|
27499
27520
|
return undefined;
|
|
27500
27521
|
}
|
|
27501
|
-
updateRanges(applyChange) {
|
|
27522
|
+
updateRanges({ applyChange }) {
|
|
27502
27523
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27503
27524
|
if (!isStale) {
|
|
27504
27525
|
return this;
|
|
@@ -27609,8 +27630,8 @@ class GaugeChart extends AbstractChart {
|
|
|
27609
27630
|
static transformDefinition(chartSheetId, definition, applyChange) {
|
|
27610
27631
|
let dataRange;
|
|
27611
27632
|
if (definition.dataRange) {
|
|
27612
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
27613
|
-
if (
|
|
27633
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
27634
|
+
if (changeType !== "REMOVE") {
|
|
27614
27635
|
dataRange = adaptedRange;
|
|
27615
27636
|
}
|
|
27616
27637
|
}
|
|
@@ -27685,13 +27706,9 @@ class GaugeChart extends AbstractChart {
|
|
|
27685
27706
|
: undefined,
|
|
27686
27707
|
};
|
|
27687
27708
|
}
|
|
27688
|
-
updateRanges(applyChange,
|
|
27709
|
+
updateRanges({ applyChange, adaptFormulaString }) {
|
|
27689
27710
|
const dataRange = adaptChartRange(this.dataRange, applyChange);
|
|
27690
|
-
const adaptFormula = (formula) =>
|
|
27691
|
-
applyChange,
|
|
27692
|
-
sheetId,
|
|
27693
|
-
sheetName: adaptSheetName,
|
|
27694
|
-
});
|
|
27711
|
+
const adaptFormula = (formula) => adaptFormulaString(this.sheetId, formula);
|
|
27695
27712
|
const sectionRule = adaptSectionRuleFormulas(this.sectionRule, adaptFormula);
|
|
27696
27713
|
const definition = this.getDefinitionWithSpecificRanges(dataRange, sectionRule);
|
|
27697
27714
|
return new GaugeChart(definition, this.sheetId, this.getters);
|
|
@@ -27911,7 +27928,7 @@ class GeoChart extends AbstractChart {
|
|
|
27911
27928
|
getDefinitionForExcel() {
|
|
27912
27929
|
return undefined;
|
|
27913
27930
|
}
|
|
27914
|
-
updateRanges(applyChange) {
|
|
27931
|
+
updateRanges({ applyChange }) {
|
|
27915
27932
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27916
27933
|
if (!isStale) {
|
|
27917
27934
|
return this;
|
|
@@ -28043,7 +28060,7 @@ class LineChart extends AbstractChart {
|
|
|
28043
28060
|
: undefined,
|
|
28044
28061
|
};
|
|
28045
28062
|
}
|
|
28046
|
-
updateRanges(applyChange) {
|
|
28063
|
+
updateRanges({ applyChange }) {
|
|
28047
28064
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28048
28065
|
if (!isStale) {
|
|
28049
28066
|
return this;
|
|
@@ -28200,7 +28217,7 @@ class PieChart extends AbstractChart {
|
|
|
28200
28217
|
labelRange,
|
|
28201
28218
|
};
|
|
28202
28219
|
}
|
|
28203
|
-
updateRanges(applyChange) {
|
|
28220
|
+
updateRanges({ applyChange }) {
|
|
28204
28221
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28205
28222
|
if (!isStale) {
|
|
28206
28223
|
return this;
|
|
@@ -28336,7 +28353,7 @@ class PyramidChart extends AbstractChart {
|
|
|
28336
28353
|
getDefinitionForExcel() {
|
|
28337
28354
|
return undefined;
|
|
28338
28355
|
}
|
|
28339
|
-
updateRanges(applyChange) {
|
|
28356
|
+
updateRanges({ applyChange }) {
|
|
28340
28357
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28341
28358
|
if (!isStale) {
|
|
28342
28359
|
return this;
|
|
@@ -28483,7 +28500,7 @@ class RadarChart extends AbstractChart {
|
|
|
28483
28500
|
labelRange,
|
|
28484
28501
|
};
|
|
28485
28502
|
}
|
|
28486
|
-
updateRanges(applyChange) {
|
|
28503
|
+
updateRanges({ applyChange }) {
|
|
28487
28504
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28488
28505
|
if (!isStale) {
|
|
28489
28506
|
return this;
|
|
@@ -28605,7 +28622,7 @@ class ScatterChart extends AbstractChart {
|
|
|
28605
28622
|
: undefined,
|
|
28606
28623
|
};
|
|
28607
28624
|
}
|
|
28608
|
-
updateRanges(applyChange) {
|
|
28625
|
+
updateRanges({ applyChange }) {
|
|
28609
28626
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28610
28627
|
if (!isStale) {
|
|
28611
28628
|
return this;
|
|
@@ -28767,7 +28784,7 @@ class SunburstChart extends AbstractChart {
|
|
|
28767
28784
|
getDefinitionForExcel() {
|
|
28768
28785
|
return undefined;
|
|
28769
28786
|
}
|
|
28770
|
-
updateRanges(applyChange) {
|
|
28787
|
+
updateRanges({ applyChange }) {
|
|
28771
28788
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28772
28789
|
if (!isStale) {
|
|
28773
28790
|
return this;
|
|
@@ -28915,7 +28932,7 @@ class TreeMapChart extends AbstractChart {
|
|
|
28915
28932
|
getDefinitionForExcel() {
|
|
28916
28933
|
return undefined;
|
|
28917
28934
|
}
|
|
28918
|
-
updateRanges(applyChange) {
|
|
28935
|
+
updateRanges({ applyChange }) {
|
|
28919
28936
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28920
28937
|
if (!isStale) {
|
|
28921
28938
|
return this;
|
|
@@ -29070,7 +29087,7 @@ class WaterfallChart extends AbstractChart {
|
|
|
29070
29087
|
// TODO: implement export excel
|
|
29071
29088
|
return undefined;
|
|
29072
29089
|
}
|
|
29073
|
-
updateRanges(applyChange) {
|
|
29090
|
+
updateRanges({ applyChange }) {
|
|
29074
29091
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
29075
29092
|
if (!isStale) {
|
|
29076
29093
|
return this;
|
|
@@ -31938,6 +31955,7 @@ function extractStyle(data, content, styleId, formatId, borderId) {
|
|
|
31938
31955
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
31939
31956
|
: undefined,
|
|
31940
31957
|
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : undefined,
|
|
31958
|
+
shrinkToFit: style.wrapping === "clip" ? true : undefined,
|
|
31941
31959
|
},
|
|
31942
31960
|
};
|
|
31943
31961
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -31958,6 +31976,7 @@ function normalizeStyle(construct, styles) {
|
|
|
31958
31976
|
vertical: styles.alignment.vertical,
|
|
31959
31977
|
horizontal: styles.alignment.horizontal,
|
|
31960
31978
|
wrapText: styles.alignment.wrapText,
|
|
31979
|
+
shrinkToFit: styles.alignment.shrinkToFit,
|
|
31961
31980
|
},
|
|
31962
31981
|
};
|
|
31963
31982
|
return pushElement(style, construct.styles);
|
|
@@ -42962,7 +42981,7 @@ class GaugeChartConfigPanel extends owl.Component {
|
|
|
42962
42981
|
});
|
|
42963
42982
|
dataRange = this.props.definition.dataRange;
|
|
42964
42983
|
get configurationErrorMessages() {
|
|
42965
|
-
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])];
|
|
42984
|
+
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
42966
42985
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
42967
42986
|
}
|
|
42968
42987
|
get isDataRangeInvalid() {
|
|
@@ -44386,7 +44405,7 @@ class GaugeChartDesignPanel extends owl.Component {
|
|
|
44386
44405
|
});
|
|
44387
44406
|
}
|
|
44388
44407
|
get designErrorMessages() {
|
|
44389
|
-
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])];
|
|
44408
|
+
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
44390
44409
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
44391
44410
|
}
|
|
44392
44411
|
get isRangeMinInvalid() {
|
|
@@ -44722,7 +44741,7 @@ class ScorecardChartConfigPanel extends owl.Component {
|
|
|
44722
44741
|
const cancelledReasons = [
|
|
44723
44742
|
...(this.state.keyValueDispatchResult?.reasons || []),
|
|
44724
44743
|
...(this.state.baselineDispatchResult?.reasons || []),
|
|
44725
|
-
];
|
|
44744
|
+
].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
44726
44745
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
44727
44746
|
}
|
|
44728
44747
|
get isKeyValueInvalid() {
|
|
@@ -50327,8 +50346,6 @@ function adaptPivotRange(range, applyChange) {
|
|
|
50327
50346
|
}
|
|
50328
50347
|
const change = applyChange(range);
|
|
50329
50348
|
switch (change.changeType) {
|
|
50330
|
-
case "NONE":
|
|
50331
|
-
return range;
|
|
50332
50349
|
case "REMOVE":
|
|
50333
50350
|
return undefined;
|
|
50334
50351
|
default:
|
|
@@ -57391,7 +57408,7 @@ class CorePlugin extends BasePlugin {
|
|
|
57391
57408
|
* @param sheetId an sheetId to adapt either range of that sheet specifically, or ranges pointing to that sheet
|
|
57392
57409
|
* @param sheetName couple of old and new sheet names to adapt ranges pointing to that sheet
|
|
57393
57410
|
*/
|
|
57394
|
-
adaptRanges(
|
|
57411
|
+
adaptRanges(rangeAdapterFunctions, sheetId, sheetName) { }
|
|
57395
57412
|
/**
|
|
57396
57413
|
* Implement this method to clean unused external resources, such as images
|
|
57397
57414
|
* stored on a server which have been deleted.
|
|
@@ -57987,7 +58004,7 @@ class CellPlugin extends CorePlugin {
|
|
|
57987
58004
|
];
|
|
57988
58005
|
nextId = 1;
|
|
57989
58006
|
cells = {};
|
|
57990
|
-
adaptRanges(applyChange, sheetId, sheetName) {
|
|
58007
|
+
adaptRanges({ applyChange }, sheetId, sheetName) {
|
|
57991
58008
|
for (const sheet of Object.keys(this.cells)) {
|
|
57992
58009
|
for (const cell of Object.values(this.cells[sheet] || {})) {
|
|
57993
58010
|
if (cell.isFormula) {
|
|
@@ -58209,7 +58226,7 @@ class CellPlugin extends CorePlugin {
|
|
|
58209
58226
|
for (const position of positions) {
|
|
58210
58227
|
const cell = this.getters.getCell(position);
|
|
58211
58228
|
const xc = toXC(position.col, position.row);
|
|
58212
|
-
const style = this.
|
|
58229
|
+
const style = this.extractCustomStyle(cell);
|
|
58213
58230
|
if (Object.keys(style).length) {
|
|
58214
58231
|
const styleId = getItemId(style, styles);
|
|
58215
58232
|
positionsByStyle[styleId] ??= [];
|
|
@@ -58255,10 +58272,14 @@ class CellPlugin extends CorePlugin {
|
|
|
58255
58272
|
}
|
|
58256
58273
|
}
|
|
58257
58274
|
}
|
|
58258
|
-
|
|
58259
|
-
const cleanedStyle = { ...style };
|
|
58260
|
-
|
|
58261
|
-
|
|
58275
|
+
extractCustomStyle(cell) {
|
|
58276
|
+
const cleanedStyle = { ...cell.style };
|
|
58277
|
+
const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
|
|
58278
|
+
? DEFAULT_NUMBER_STYLE
|
|
58279
|
+
: DEFAULT_STYLE;
|
|
58280
|
+
for (const property in cleanedStyle) {
|
|
58281
|
+
if ((property !== "align" || !cell.isFormula) &&
|
|
58282
|
+
cleanedStyle[property] === defaultStyle[property]) {
|
|
58262
58283
|
delete cleanedStyle[property];
|
|
58263
58284
|
}
|
|
58264
58285
|
}
|
|
@@ -58608,9 +58629,9 @@ class ChartPlugin extends CorePlugin {
|
|
|
58608
58629
|
charts = {};
|
|
58609
58630
|
createChart = chartFactory(this.getters);
|
|
58610
58631
|
validateChartDefinition = (cmd) => validateChartDefinition(this, cmd.definition);
|
|
58611
|
-
adaptRanges(
|
|
58632
|
+
adaptRanges(rangeAdapters) {
|
|
58612
58633
|
for (const [chartId, chart] of Object.entries(this.charts)) {
|
|
58613
|
-
this.history.update("charts", chartId, chart?.updateRanges(
|
|
58634
|
+
this.history.update("charts", chartId, chart?.updateRanges(rangeAdapters));
|
|
58614
58635
|
}
|
|
58615
58636
|
}
|
|
58616
58637
|
// ---------------------------------------------------------------------------
|
|
@@ -58800,7 +58821,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58800
58821
|
"getAdaptedCfRanges",
|
|
58801
58822
|
];
|
|
58802
58823
|
cfRules = {};
|
|
58803
|
-
adaptCFFormulas(applyChange) {
|
|
58824
|
+
adaptCFFormulas({ applyChange, adaptFormulaString }) {
|
|
58804
58825
|
for (const sheetId in this.cfRules) {
|
|
58805
58826
|
for (const rule of this.cfRules[sheetId]) {
|
|
58806
58827
|
if (rule.rule.type === "DataBarRule" && rule.rule.rangeValues) {
|
|
@@ -58824,7 +58845,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58824
58845
|
for (let i = 0; i < rule.rule.values.length; i++) {
|
|
58825
58846
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
58826
58847
|
//@ts-expect-error
|
|
58827
|
-
"values", i,
|
|
58848
|
+
"values", i, adaptFormulaString(sheetId, rule.rule.values[i]));
|
|
58828
58849
|
}
|
|
58829
58850
|
}
|
|
58830
58851
|
else if (rule.rule.type === "IconSetRule") {
|
|
@@ -58832,7 +58853,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58832
58853
|
if (rule.rule[inflectionPoint].type === "formula") {
|
|
58833
58854
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
58834
58855
|
//@ts-expect-error
|
|
58835
|
-
inflectionPoint, "value",
|
|
58856
|
+
inflectionPoint, "value", adaptFormulaString(sheetId, rule.rule[inflectionPoint].value));
|
|
58836
58857
|
}
|
|
58837
58858
|
}
|
|
58838
58859
|
}
|
|
@@ -58842,14 +58863,14 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58842
58863
|
if (ruleValue?.type === "formula" && ruleValue?.value) {
|
|
58843
58864
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
58844
58865
|
//@ts-expect-error
|
|
58845
|
-
value, "value",
|
|
58866
|
+
value, "value", adaptFormulaString(sheetId, ruleValue.value));
|
|
58846
58867
|
}
|
|
58847
58868
|
}
|
|
58848
58869
|
}
|
|
58849
58870
|
}
|
|
58850
58871
|
}
|
|
58851
58872
|
}
|
|
58852
|
-
adaptCFRanges(sheetId, applyChange) {
|
|
58873
|
+
adaptCFRanges(sheetId, { applyChange }) {
|
|
58853
58874
|
for (const rule of this.cfRules[sheetId]) {
|
|
58854
58875
|
for (const range of rule.ranges) {
|
|
58855
58876
|
const change = applyChange(range);
|
|
@@ -58873,12 +58894,12 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58873
58894
|
}
|
|
58874
58895
|
}
|
|
58875
58896
|
}
|
|
58876
|
-
adaptRanges(
|
|
58897
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
58877
58898
|
const sheetIds = sheetId ? [sheetId] : Object.keys(this.cfRules);
|
|
58878
58899
|
for (const sheetId of sheetIds) {
|
|
58879
|
-
this.adaptCFRanges(sheetId,
|
|
58900
|
+
this.adaptCFRanges(sheetId, rangeAdapters);
|
|
58880
58901
|
}
|
|
58881
|
-
this.adaptCFFormulas(
|
|
58902
|
+
this.adaptCFFormulas(rangeAdapters);
|
|
58882
58903
|
}
|
|
58883
58904
|
// ---------------------------------------------------------------------------
|
|
58884
58905
|
// Command Handling
|
|
@@ -59269,23 +59290,23 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
59269
59290
|
"getValidationRuleForCell",
|
|
59270
59291
|
];
|
|
59271
59292
|
rules = {};
|
|
59272
|
-
adaptRanges(
|
|
59273
|
-
this.adaptDVRanges(sheetId,
|
|
59274
|
-
this.adaptDVFormulas(
|
|
59293
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
59294
|
+
this.adaptDVRanges(sheetId, rangeAdapters);
|
|
59295
|
+
this.adaptDVFormulas(rangeAdapters);
|
|
59275
59296
|
}
|
|
59276
|
-
adaptDVFormulas(
|
|
59297
|
+
adaptDVFormulas({ adaptFormulaString }) {
|
|
59277
59298
|
for (const sheetId in this.rules) {
|
|
59278
59299
|
const rules = this.rules[sheetId];
|
|
59279
59300
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
59280
59301
|
const rule = this.rules[sheetId][ruleIndex];
|
|
59281
59302
|
for (let valueIndex = 0; valueIndex < rule.criterion.values.length; valueIndex++) {
|
|
59282
|
-
const value =
|
|
59303
|
+
const value = adaptFormulaString(sheetId, rule.criterion.values[valueIndex]);
|
|
59283
59304
|
this.history.update("rules", sheetId, ruleIndex, "criterion", "values", valueIndex, value);
|
|
59284
59305
|
}
|
|
59285
59306
|
}
|
|
59286
59307
|
}
|
|
59287
59308
|
}
|
|
59288
|
-
adaptDVRanges(sheetId, applyChange) {
|
|
59309
|
+
adaptDVRanges(sheetId, { applyChange }) {
|
|
59289
59310
|
const rules = this.rules[sheetId];
|
|
59290
59311
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
59291
59312
|
const rule = this.rules[sheetId][ruleIndex];
|
|
@@ -59559,7 +59580,7 @@ class FigurePlugin extends CorePlugin {
|
|
|
59559
59580
|
// ---------------------------------------------------------------------------
|
|
59560
59581
|
// Command Handling
|
|
59561
59582
|
// ---------------------------------------------------------------------------
|
|
59562
|
-
adaptRanges(applyChange, sheetId) {
|
|
59583
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
59563
59584
|
for (const figure of this.getFigures(sheetId)) {
|
|
59564
59585
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, {
|
|
59565
59586
|
left: figure.col,
|
|
@@ -60366,8 +60387,8 @@ class MergePlugin extends CorePlugin {
|
|
|
60366
60387
|
break;
|
|
60367
60388
|
}
|
|
60368
60389
|
}
|
|
60369
|
-
adaptRanges(
|
|
60370
|
-
this.applyRangeChangeOnSheet(sheetId,
|
|
60390
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
60391
|
+
this.applyRangeChangeOnSheet(sheetId, rangeAdapters);
|
|
60371
60392
|
}
|
|
60372
60393
|
// ---------------------------------------------------------------------------
|
|
60373
60394
|
// Getters
|
|
@@ -60672,7 +60693,7 @@ class MergePlugin extends CorePlugin {
|
|
|
60672
60693
|
/**
|
|
60673
60694
|
* Apply a range change on merges of a particular sheet.
|
|
60674
60695
|
*/
|
|
60675
|
-
applyRangeChangeOnSheet(sheetId, applyChange) {
|
|
60696
|
+
applyRangeChangeOnSheet(sheetId, { applyChange }) {
|
|
60676
60697
|
const merges = Object.entries(this.merges[sheetId] || {});
|
|
60677
60698
|
for (const [mergeId, range] of merges) {
|
|
60678
60699
|
if (range) {
|
|
@@ -60746,7 +60767,7 @@ function rangeToMerge(mergeId, range) {
|
|
|
60746
60767
|
};
|
|
60747
60768
|
}
|
|
60748
60769
|
|
|
60749
|
-
class
|
|
60770
|
+
class RangeAdapterPlugin {
|
|
60750
60771
|
getters;
|
|
60751
60772
|
providers = [];
|
|
60752
60773
|
isAdaptingRanges = false;
|
|
@@ -60754,7 +60775,6 @@ class RangeAdapter {
|
|
|
60754
60775
|
this.getters = getters;
|
|
60755
60776
|
}
|
|
60756
60777
|
static getters = [
|
|
60757
|
-
"adaptFormulaStringDependencies",
|
|
60758
60778
|
"copyFormulaStringForSheet",
|
|
60759
60779
|
"extendRange",
|
|
60760
60780
|
"getRangeString",
|
|
@@ -60785,8 +60805,8 @@ class RangeAdapter {
|
|
|
60785
60805
|
throw new Error("Plugins cannot dispatch commands during adaptRanges phase");
|
|
60786
60806
|
}
|
|
60787
60807
|
const rangeAdapter = getRangeAdapter(cmd);
|
|
60788
|
-
if (rangeAdapter
|
|
60789
|
-
this.executeOnAllRanges(rangeAdapter
|
|
60808
|
+
if (rangeAdapter) {
|
|
60809
|
+
this.executeOnAllRanges(rangeAdapter);
|
|
60790
60810
|
}
|
|
60791
60811
|
}
|
|
60792
60812
|
finalize() { }
|
|
@@ -60805,11 +60825,15 @@ class RangeAdapter {
|
|
|
60805
60825
|
return result;
|
|
60806
60826
|
};
|
|
60807
60827
|
}
|
|
60808
|
-
executeOnAllRanges(
|
|
60828
|
+
executeOnAllRanges(rangeAdapter) {
|
|
60809
60829
|
this.isAdaptingRanges = true;
|
|
60810
|
-
const
|
|
60830
|
+
const adapterFunctions = {
|
|
60831
|
+
applyChange: this.verifyRangeRemoved(rangeAdapter.applyChange),
|
|
60832
|
+
adaptRangeString: (defaultSheetId, sheetXC) => adaptStringRange(defaultSheetId, sheetXC, rangeAdapter),
|
|
60833
|
+
adaptFormulaString: (defaultSheetId, formula) => adaptFormulaStringRanges(defaultSheetId, formula, rangeAdapter),
|
|
60834
|
+
};
|
|
60811
60835
|
for (const provider of this.providers) {
|
|
60812
|
-
provider(
|
|
60836
|
+
provider(adapterFunctions, rangeAdapter.sheetId, rangeAdapter.sheetName);
|
|
60813
60837
|
}
|
|
60814
60838
|
this.isAdaptingRanges = false;
|
|
60815
60839
|
}
|
|
@@ -60977,18 +61001,6 @@ class RangeAdapter {
|
|
|
60977
61001
|
const unionOfZones = unionUnboundedZones(...zones);
|
|
60978
61002
|
return this.getRangeFromZone(ranges[0].sheetId, unionOfZones);
|
|
60979
61003
|
}
|
|
60980
|
-
adaptFormulaStringDependencies(sheetId, formula, applyChange) {
|
|
60981
|
-
if (!formula.startsWith("=")) {
|
|
60982
|
-
return formula;
|
|
60983
|
-
}
|
|
60984
|
-
const compiledFormula = compile(formula);
|
|
60985
|
-
const updatedDependencies = compiledFormula.dependencies.map((dep) => {
|
|
60986
|
-
const range = this.getters.getRangeFromSheetXC(sheetId, dep);
|
|
60987
|
-
const changedRange = applyChange(range);
|
|
60988
|
-
return changedRange.changeType === "NONE" ? range : changedRange.range;
|
|
60989
|
-
});
|
|
60990
|
-
return this.getters.getFormulaString(sheetId, compiledFormula.tokens, updatedDependencies);
|
|
60991
|
-
}
|
|
60992
61004
|
/**
|
|
60993
61005
|
* Copy a formula string to another sheet.
|
|
60994
61006
|
*
|
|
@@ -61881,7 +61893,7 @@ class TablePlugin extends CorePlugin {
|
|
|
61881
61893
|
static getters = ["getCoreTable", "getCoreTables", "getCoreTableMatchingTopLeft"];
|
|
61882
61894
|
tables = {};
|
|
61883
61895
|
nextTableId = 1;
|
|
61884
|
-
adaptRanges(applyChange, sheetId) {
|
|
61896
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
61885
61897
|
for (const table of this.getCoreTables(sheetId)) {
|
|
61886
61898
|
this.applyRangeChangeOnTable(sheetId, table, applyChange);
|
|
61887
61899
|
}
|
|
@@ -62847,7 +62859,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62847
62859
|
}
|
|
62848
62860
|
}
|
|
62849
62861
|
}
|
|
62850
|
-
adaptRanges(applyChange) {
|
|
62862
|
+
adaptRanges({ applyChange, adaptFormulaString }) {
|
|
62851
62863
|
for (const pivotId in this.pivots) {
|
|
62852
62864
|
const definition = deepCopy(this.pivots[pivotId]?.definition);
|
|
62853
62865
|
if (!definition) {
|
|
@@ -62867,19 +62879,13 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62867
62879
|
continue;
|
|
62868
62880
|
}
|
|
62869
62881
|
const sheetId = measure.computedBy.sheetId;
|
|
62870
|
-
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId]
|
|
62871
|
-
|
|
62872
|
-
|
|
62873
|
-
|
|
62874
|
-
|
|
62875
|
-
newDependencies.push(range);
|
|
62876
|
-
}
|
|
62877
|
-
else {
|
|
62878
|
-
newDependencies.push(change.range);
|
|
62879
|
-
}
|
|
62880
|
-
}
|
|
62881
|
-
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
62882
|
+
const { formula: compiledFormula, dependencies: indirectDependencies } = this.compiledMeasureFormulas[pivotId][measureId];
|
|
62883
|
+
// adapt direct dependencies
|
|
62884
|
+
this.history.update("compiledMeasureFormulas", pivotId, measureId, "formula", "dependencies", compiledFormula.dependencies.map((range) => applyChange(range).range));
|
|
62885
|
+
// adapt all dependencies (including indirect)
|
|
62886
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", indirectDependencies.map((range) => applyChange(range).range));
|
|
62882
62887
|
const oldFormulaString = measure.computedBy.formula;
|
|
62888
|
+
const newFormulaString = adaptFormulaString(sheetId, oldFormulaString);
|
|
62883
62889
|
if (newFormulaString !== oldFormulaString) {
|
|
62884
62890
|
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
62885
62891
|
}
|
|
@@ -63044,7 +63050,6 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
63044
63050
|
formula: newFormulaString,
|
|
63045
63051
|
sheetId: measure.computedBy.sheetId,
|
|
63046
63052
|
});
|
|
63047
|
-
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
63048
63053
|
}
|
|
63049
63054
|
checkSortedColumnInMeasures(definition) {
|
|
63050
63055
|
definition = this.repairSortedColumn(definition);
|
|
@@ -64449,11 +64454,16 @@ class SpreadingRelation {
|
|
|
64449
64454
|
return this.arrayFormulasToResults.get(formulasPosition);
|
|
64450
64455
|
}
|
|
64451
64456
|
/**
|
|
64452
|
-
* Remove a
|
|
64457
|
+
* Remove a spreading relation for a given array formula position
|
|
64458
|
+
* and its result zone
|
|
64453
64459
|
*/
|
|
64454
64460
|
removeNode(position) {
|
|
64461
|
+
const resultZone = this.arrayFormulasToResults.get(position);
|
|
64462
|
+
if (!resultZone) {
|
|
64463
|
+
return;
|
|
64464
|
+
}
|
|
64455
64465
|
this.resultsToArrayFormulas.remove({
|
|
64456
|
-
boundingBox: { sheetId: position.sheetId, zone:
|
|
64466
|
+
boundingBox: { sheetId: position.sheetId, zone: resultZone },
|
|
64457
64467
|
data: position,
|
|
64458
64468
|
});
|
|
64459
64469
|
this.arrayFormulasToResults.delete(position);
|
|
@@ -64741,6 +64751,10 @@ class Evaluator {
|
|
|
64741
64751
|
// empty matrix
|
|
64742
64752
|
return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
|
|
64743
64753
|
}
|
|
64754
|
+
if (nbRows === 1 && nbColumns === 1) {
|
|
64755
|
+
// single value matrix
|
|
64756
|
+
return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
|
|
64757
|
+
}
|
|
64744
64758
|
const resultZone = {
|
|
64745
64759
|
top: formulaPosition.row,
|
|
64746
64760
|
bottom: formulaPosition.row + nbRows - 1,
|
|
@@ -66166,6 +66180,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
66166
66180
|
handle(cmd) {
|
|
66167
66181
|
switch (cmd.type) {
|
|
66168
66182
|
case "START":
|
|
66183
|
+
case "UPDATE_LOCALE":
|
|
66169
66184
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
66170
66185
|
this.initializeSheet(sheetId);
|
|
66171
66186
|
}
|
|
@@ -66287,7 +66302,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
66287
66302
|
}
|
|
66288
66303
|
const cell = this.getters.getCell(position);
|
|
66289
66304
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
66290
|
-
return getDefaultCellHeight(this.ctx, cell, colSize);
|
|
66305
|
+
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
66291
66306
|
}
|
|
66292
66307
|
isInMultiRowMerge(position) {
|
|
66293
66308
|
const merge = this.getters.getMerge(position);
|
|
@@ -68176,7 +68191,7 @@ function addConditionalFormatCommandAdaptRange(cmd, applyChange) {
|
|
|
68176
68191
|
cmd.cf.rule = {
|
|
68177
68192
|
...rule,
|
|
68178
68193
|
rangeValues: rule.rangeValues
|
|
68179
|
-
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange)
|
|
68194
|
+
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange).range
|
|
68180
68195
|
: undefined,
|
|
68181
68196
|
};
|
|
68182
68197
|
}
|
|
@@ -79663,6 +79678,9 @@ function addStyles(styles) {
|
|
|
79663
79678
|
if (style.alignment && style.alignment.wrapText) {
|
|
79664
79679
|
alignAttrs.push(["wrapText", "1"]);
|
|
79665
79680
|
}
|
|
79681
|
+
if (style.alignment && style.alignment.shrinkToFit) {
|
|
79682
|
+
alignAttrs.push(["shrinkToFit", "1"]);
|
|
79683
|
+
}
|
|
79666
79684
|
if (alignAttrs.length > 0) {
|
|
79667
79685
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
79668
79686
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
@@ -80433,7 +80451,7 @@ class Model extends EventBus {
|
|
|
80433
80451
|
this.config = this.setupConfig(config);
|
|
80434
80452
|
this.session = this.setupSession(workbookData.revisionId);
|
|
80435
80453
|
this.coreGetters = {};
|
|
80436
|
-
this.range = new
|
|
80454
|
+
this.range = new RangeAdapterPlugin(this.coreGetters);
|
|
80437
80455
|
this.coreGetters.getRangeString = this.range.getRangeString.bind(this.range);
|
|
80438
80456
|
this.coreGetters.getRangeFromSheetXC = this.range.getRangeFromSheetXC.bind(this.range);
|
|
80439
80457
|
this.coreGetters.createAdaptedRanges = this.range.createAdaptedRanges.bind(this.range);
|
|
@@ -80447,8 +80465,6 @@ class Model extends EventBus {
|
|
|
80447
80465
|
this.coreGetters.extendRange = this.range.extendRange.bind(this.range);
|
|
80448
80466
|
this.coreGetters.getRangesUnion = this.range.getRangesUnion.bind(this.range);
|
|
80449
80467
|
this.coreGetters.removeRangesSheetPrefix = this.range.removeRangesSheetPrefix.bind(this.range);
|
|
80450
|
-
this.coreGetters.adaptFormulaStringDependencies =
|
|
80451
|
-
this.range.adaptFormulaStringDependencies.bind(this.range);
|
|
80452
80468
|
this.coreGetters.copyFormulaStringForSheet = this.range.copyFormulaStringForSheet.bind(this.range);
|
|
80453
80469
|
this.getters = {
|
|
80454
80470
|
isReadonly: () => this.config.mode === "readonly" || this.config.mode === "dashboard",
|
|
@@ -81164,6 +81180,6 @@ exports.tokenColors = tokenColors;
|
|
|
81164
81180
|
exports.tokenize = tokenize;
|
|
81165
81181
|
|
|
81166
81182
|
|
|
81167
|
-
__info__.version = "18.3.
|
|
81168
|
-
__info__.date = "2026-01-
|
|
81169
|
-
__info__.hash = "
|
|
81183
|
+
__info__.version = "18.3.33";
|
|
81184
|
+
__info__.date = "2026-01-21T11:05:17.933Z";
|
|
81185
|
+
__info__.hash = "b7e5d91";
|