@odoo/o-spreadsheet 18.4.24 → 18.4.25
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 +215 -199
- package/dist/o-spreadsheet.d.ts +223 -217
- package/dist/o-spreadsheet.esm.js +215 -199
- package/dist/o-spreadsheet.iife.js +215 -199
- package/dist/o-spreadsheet.iife.min.js +416 -416
- 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.4.
|
|
6
|
-
* @date 2026-01-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.4.25
|
|
6
|
+
* @date 2026-01-21T11:06:11.131Z
|
|
7
|
+
* @hash 161472d
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -42,7 +42,8 @@ function createAction(item) {
|
|
|
42
42
|
return children
|
|
43
43
|
.map((child) => (typeof child === "function" ? child(env) : child))
|
|
44
44
|
.flat()
|
|
45
|
-
.map(createAction)
|
|
45
|
+
.map(createAction)
|
|
46
|
+
.sort((a, b) => a.sequence - b.sequence);
|
|
46
47
|
}
|
|
47
48
|
: () => [],
|
|
48
49
|
isReadonlyAllowed: item.isReadonlyAllowed || false,
|
|
@@ -334,6 +335,7 @@ const DEFAULT_STYLE = {
|
|
|
334
335
|
fillColor: "",
|
|
335
336
|
textColor: "",
|
|
336
337
|
};
|
|
338
|
+
const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
|
|
337
339
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
338
340
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
339
341
|
// Fonts
|
|
@@ -6387,67 +6389,6 @@ function getFullReference(sheetName, xc) {
|
|
|
6387
6389
|
return sheetName !== undefined ? `${getCanonicalSymbolName(sheetName)}!${xc}` : xc;
|
|
6388
6390
|
}
|
|
6389
6391
|
|
|
6390
|
-
function createDefaultRows(rowNumber) {
|
|
6391
|
-
const rows = [];
|
|
6392
|
-
for (let i = 0; i < rowNumber; i++) {
|
|
6393
|
-
const row = {
|
|
6394
|
-
cells: {},
|
|
6395
|
-
};
|
|
6396
|
-
rows.push(row);
|
|
6397
|
-
}
|
|
6398
|
-
return rows;
|
|
6399
|
-
}
|
|
6400
|
-
function moveHeaderIndexesOnHeaderAddition(indexHeaderAdded, numberAdded, headers) {
|
|
6401
|
-
return headers.map((header) => {
|
|
6402
|
-
if (header >= indexHeaderAdded) {
|
|
6403
|
-
return header + numberAdded;
|
|
6404
|
-
}
|
|
6405
|
-
return header;
|
|
6406
|
-
});
|
|
6407
|
-
}
|
|
6408
|
-
function moveHeaderIndexesOnHeaderDeletion(deletedHeaders, headers) {
|
|
6409
|
-
deletedHeaders = [...deletedHeaders].sort((a, b) => b - a);
|
|
6410
|
-
return headers
|
|
6411
|
-
.map((header) => {
|
|
6412
|
-
for (const deletedHeader of deletedHeaders) {
|
|
6413
|
-
if (header > deletedHeader) {
|
|
6414
|
-
header--;
|
|
6415
|
-
}
|
|
6416
|
-
else if (header === deletedHeader) {
|
|
6417
|
-
return undefined;
|
|
6418
|
-
}
|
|
6419
|
-
}
|
|
6420
|
-
return header;
|
|
6421
|
-
})
|
|
6422
|
-
.filter(isDefined);
|
|
6423
|
-
}
|
|
6424
|
-
function getNextSheetName(existingNames, baseName = "Sheet") {
|
|
6425
|
-
let i = 1;
|
|
6426
|
-
let name = `${baseName}${i}`;
|
|
6427
|
-
while (existingNames.includes(name)) {
|
|
6428
|
-
name = `${baseName}${i}`;
|
|
6429
|
-
i++;
|
|
6430
|
-
}
|
|
6431
|
-
return name;
|
|
6432
|
-
}
|
|
6433
|
-
function getDuplicateSheetName(nameToDuplicate, existingNames) {
|
|
6434
|
-
let i = 1;
|
|
6435
|
-
const baseName = _t("Copy of %s", nameToDuplicate);
|
|
6436
|
-
let name = baseName.toString();
|
|
6437
|
-
while (existingNames.includes(name)) {
|
|
6438
|
-
name = `${baseName} (${i})`;
|
|
6439
|
-
i++;
|
|
6440
|
-
}
|
|
6441
|
-
return name;
|
|
6442
|
-
}
|
|
6443
|
-
function isSheetNameEqual(name1, name2) {
|
|
6444
|
-
if (name1 === undefined || name2 === undefined) {
|
|
6445
|
-
return false;
|
|
6446
|
-
}
|
|
6447
|
-
return (getUnquotedSheetName(name1.trim().toUpperCase()) ===
|
|
6448
|
-
getUnquotedSheetName(name2.trim().toUpperCase()));
|
|
6449
|
-
}
|
|
6450
|
-
|
|
6451
6392
|
function createRange(args, getSheetSize) {
|
|
6452
6393
|
const unboundedZone = args.zone;
|
|
6453
6394
|
const zone = boundUnboundedZone(unboundedZone, getSheetSize(args.sheetId));
|
|
@@ -6691,8 +6632,8 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
6691
6632
|
elements.sort((a, b) => b - a);
|
|
6692
6633
|
const groups = groupConsecutive(elements);
|
|
6693
6634
|
return (range) => {
|
|
6694
|
-
if (
|
|
6695
|
-
return { changeType: "NONE" };
|
|
6635
|
+
if (range.sheetId !== cmd.sheetId) {
|
|
6636
|
+
return { changeType: "NONE", range };
|
|
6696
6637
|
}
|
|
6697
6638
|
let newRange = range;
|
|
6698
6639
|
let changeType = "NONE";
|
|
@@ -6719,10 +6660,7 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
6719
6660
|
newRange = createAdaptedRange(newRange, dimension, changeType, -(max - min + 1));
|
|
6720
6661
|
}
|
|
6721
6662
|
}
|
|
6722
|
-
|
|
6723
|
-
return { changeType, range: newRange };
|
|
6724
|
-
}
|
|
6725
|
-
return { changeType: "NONE" };
|
|
6663
|
+
return { changeType, range: newRange };
|
|
6726
6664
|
};
|
|
6727
6665
|
}
|
|
6728
6666
|
function getApplyRangeChangeAddColRow(cmd) {
|
|
@@ -6731,7 +6669,7 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
6731
6669
|
const dimension = cmd.dimension === "COL" ? "columns" : "rows";
|
|
6732
6670
|
return (range) => {
|
|
6733
6671
|
if (range.sheetId !== cmd.sheetId) {
|
|
6734
|
-
return { changeType: "NONE" };
|
|
6672
|
+
return { changeType: "NONE", range };
|
|
6735
6673
|
}
|
|
6736
6674
|
if (cmd.position === "after") {
|
|
6737
6675
|
if (range.zone[start] <= cmd.base && cmd.base < range.zone[end]) {
|
|
@@ -6761,13 +6699,13 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
6761
6699
|
};
|
|
6762
6700
|
}
|
|
6763
6701
|
}
|
|
6764
|
-
return { changeType: "NONE" };
|
|
6702
|
+
return { changeType: "NONE", range };
|
|
6765
6703
|
};
|
|
6766
6704
|
}
|
|
6767
6705
|
function getApplyRangeChangeDeleteSheet(cmd) {
|
|
6768
6706
|
return (range) => {
|
|
6769
6707
|
if (range.sheetId !== cmd.sheetId && range.invalidSheetName !== cmd.sheetName) {
|
|
6770
|
-
return { changeType: "NONE" };
|
|
6708
|
+
return { changeType: "NONE", range };
|
|
6771
6709
|
}
|
|
6772
6710
|
const invalidSheetName = cmd.sheetName;
|
|
6773
6711
|
range = {
|
|
@@ -6794,14 +6732,14 @@ function getApplyRangeChangeRenameSheet(cmd) {
|
|
|
6794
6732
|
const newRange = { ...range, sheetId, invalidSheetName };
|
|
6795
6733
|
return { changeType: "CHANGE", range: newRange };
|
|
6796
6734
|
}
|
|
6797
|
-
return { changeType: "NONE" };
|
|
6735
|
+
return { changeType: "NONE", range };
|
|
6798
6736
|
};
|
|
6799
6737
|
}
|
|
6800
6738
|
function getApplyRangeChangeMoveRange(cmd) {
|
|
6801
6739
|
const originZone = cmd.target[0];
|
|
6802
6740
|
return (range) => {
|
|
6803
6741
|
if (range.sheetId !== cmd.sheetId || !isZoneInside(range.zone, originZone)) {
|
|
6804
|
-
return { changeType: "NONE" };
|
|
6742
|
+
return { changeType: "NONE", range };
|
|
6805
6743
|
}
|
|
6806
6744
|
const targetSheetId = cmd.targetSheetId;
|
|
6807
6745
|
const offsetX = cmd.col - originZone.left;
|
|
@@ -6898,17 +6836,87 @@ function fuzzyLookup(pattern, list, fn) {
|
|
|
6898
6836
|
return results.map((r) => r.elem);
|
|
6899
6837
|
}
|
|
6900
6838
|
|
|
6839
|
+
function createDefaultRows(rowNumber) {
|
|
6840
|
+
const rows = [];
|
|
6841
|
+
for (let i = 0; i < rowNumber; i++) {
|
|
6842
|
+
const row = {
|
|
6843
|
+
cells: {},
|
|
6844
|
+
};
|
|
6845
|
+
rows.push(row);
|
|
6846
|
+
}
|
|
6847
|
+
return rows;
|
|
6848
|
+
}
|
|
6849
|
+
function moveHeaderIndexesOnHeaderAddition(indexHeaderAdded, numberAdded, headers) {
|
|
6850
|
+
return headers.map((header) => {
|
|
6851
|
+
if (header >= indexHeaderAdded) {
|
|
6852
|
+
return header + numberAdded;
|
|
6853
|
+
}
|
|
6854
|
+
return header;
|
|
6855
|
+
});
|
|
6856
|
+
}
|
|
6857
|
+
function moveHeaderIndexesOnHeaderDeletion(deletedHeaders, headers) {
|
|
6858
|
+
deletedHeaders = [...deletedHeaders].sort((a, b) => b - a);
|
|
6859
|
+
return headers
|
|
6860
|
+
.map((header) => {
|
|
6861
|
+
for (const deletedHeader of deletedHeaders) {
|
|
6862
|
+
if (header > deletedHeader) {
|
|
6863
|
+
header--;
|
|
6864
|
+
}
|
|
6865
|
+
else if (header === deletedHeader) {
|
|
6866
|
+
return undefined;
|
|
6867
|
+
}
|
|
6868
|
+
}
|
|
6869
|
+
return header;
|
|
6870
|
+
})
|
|
6871
|
+
.filter(isDefined);
|
|
6872
|
+
}
|
|
6873
|
+
function getNextSheetName(existingNames, baseName = "Sheet") {
|
|
6874
|
+
let i = 1;
|
|
6875
|
+
let name = `${baseName}${i}`;
|
|
6876
|
+
while (existingNames.includes(name)) {
|
|
6877
|
+
name = `${baseName}${i}`;
|
|
6878
|
+
i++;
|
|
6879
|
+
}
|
|
6880
|
+
return name;
|
|
6881
|
+
}
|
|
6882
|
+
function getDuplicateSheetName(nameToDuplicate, existingNames) {
|
|
6883
|
+
let i = 1;
|
|
6884
|
+
const baseName = _t("Copy of %s", nameToDuplicate);
|
|
6885
|
+
let name = baseName.toString();
|
|
6886
|
+
while (existingNames.includes(name)) {
|
|
6887
|
+
name = `${baseName} (${i})`;
|
|
6888
|
+
i++;
|
|
6889
|
+
}
|
|
6890
|
+
return name;
|
|
6891
|
+
}
|
|
6892
|
+
function isSheetNameEqual(name1, name2) {
|
|
6893
|
+
if (name1 === undefined || name2 === undefined) {
|
|
6894
|
+
return false;
|
|
6895
|
+
}
|
|
6896
|
+
return (getUnquotedSheetName(name1.trim().toUpperCase()) ===
|
|
6897
|
+
getUnquotedSheetName(name2.trim().toUpperCase()));
|
|
6898
|
+
}
|
|
6899
|
+
|
|
6901
6900
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
6902
6901
|
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
6903
6902
|
}
|
|
6904
6903
|
/**
|
|
6905
6904
|
* Get the default height of the cell given its style.
|
|
6906
6905
|
*/
|
|
6907
|
-
function getDefaultCellHeight(ctx, cell, colSize) {
|
|
6906
|
+
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
6908
6907
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
6909
6908
|
return DEFAULT_CELL_HEIGHT;
|
|
6910
6909
|
}
|
|
6911
|
-
|
|
6910
|
+
let content = "";
|
|
6911
|
+
try {
|
|
6912
|
+
if (!cell.isFormula) {
|
|
6913
|
+
const localeFormat = { format: cell.format, locale };
|
|
6914
|
+
content = formatValue(parseLiteral(cell.content, locale), localeFormat);
|
|
6915
|
+
}
|
|
6916
|
+
}
|
|
6917
|
+
catch {
|
|
6918
|
+
content = CellErrorType.GenericError;
|
|
6919
|
+
}
|
|
6912
6920
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
6913
6921
|
}
|
|
6914
6922
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
@@ -20989,7 +20997,16 @@ function createComputeFunction(descr) {
|
|
|
20989
20997
|
}
|
|
20990
20998
|
acceptToVectorize.push(!argDefinition.acceptMatrix);
|
|
20991
20999
|
}
|
|
20992
|
-
return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
|
|
21000
|
+
return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
|
|
21001
|
+
}
|
|
21002
|
+
function replaceErrorPlaceholderInResult(result) {
|
|
21003
|
+
if (!isMatrix(result)) {
|
|
21004
|
+
replaceFunctionNamePlaceholder(result, descr.name);
|
|
21005
|
+
}
|
|
21006
|
+
else {
|
|
21007
|
+
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
21008
|
+
}
|
|
21009
|
+
return result;
|
|
20993
21010
|
}
|
|
20994
21011
|
function errorHandlingCompute(...args) {
|
|
20995
21012
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -21018,13 +21035,12 @@ function createComputeFunction(descr) {
|
|
|
21018
21035
|
const result = descr.compute.apply(this, args);
|
|
21019
21036
|
if (!isMatrix(result)) {
|
|
21020
21037
|
if (typeof result === "object" && result !== null && "value" in result) {
|
|
21021
|
-
replaceFunctionNamePlaceholder(result, descr.name);
|
|
21022
21038
|
return result;
|
|
21023
21039
|
}
|
|
21040
|
+
descr.name;
|
|
21024
21041
|
return { value: result };
|
|
21025
21042
|
}
|
|
21026
21043
|
if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
|
|
21027
|
-
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
21028
21044
|
return result;
|
|
21029
21045
|
}
|
|
21030
21046
|
return matrixMap(result, (row) => ({ value: row }));
|
|
@@ -21476,7 +21492,7 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
21476
21492
|
continue;
|
|
21477
21493
|
}
|
|
21478
21494
|
const sheetXC = tokens[tokenIdx].value;
|
|
21479
|
-
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange);
|
|
21495
|
+
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange).range;
|
|
21480
21496
|
if (sheetXC !== newSheetXC) {
|
|
21481
21497
|
tokens[tokenIdx] = {
|
|
21482
21498
|
value: newSheetXC,
|
|
@@ -21486,23 +21502,30 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
21486
21502
|
}
|
|
21487
21503
|
return concat(tokens.map((token) => token.value));
|
|
21488
21504
|
}
|
|
21489
|
-
function adaptStringRange(defaultSheetId, sheetXC,
|
|
21505
|
+
function adaptStringRange(defaultSheetId, sheetXC, rangeAdapter) {
|
|
21490
21506
|
const sheetName = splitReference(sheetXC).sheetName;
|
|
21491
21507
|
if (sheetName
|
|
21492
|
-
? !isSheetNameEqual(sheetName,
|
|
21493
|
-
: defaultSheetId !==
|
|
21494
|
-
return sheetXC;
|
|
21508
|
+
? !isSheetNameEqual(sheetName, rangeAdapter.sheetName.old)
|
|
21509
|
+
: defaultSheetId !== rangeAdapter.sheetId) {
|
|
21510
|
+
return { changeType: "NONE", range: sheetXC };
|
|
21495
21511
|
}
|
|
21496
|
-
const sheetId = sheetName ?
|
|
21512
|
+
const sheetId = sheetName ? rangeAdapter.sheetId : defaultSheetId;
|
|
21497
21513
|
const range = getRange(sheetXC, sheetId);
|
|
21498
21514
|
if (range.invalidXc) {
|
|
21499
|
-
return sheetXC;
|
|
21515
|
+
return { changeType: "NONE", range: sheetXC };
|
|
21500
21516
|
}
|
|
21501
|
-
const change =
|
|
21517
|
+
const change = rangeAdapter.applyChange(range);
|
|
21502
21518
|
if (change.changeType === "NONE" || change.changeType === "REMOVE") {
|
|
21503
|
-
return sheetXC;
|
|
21519
|
+
return { changeType: change.changeType, range: sheetXC };
|
|
21520
|
+
}
|
|
21521
|
+
const rangeStr = getRangeString(change.range, defaultSheetId, getSheetNameGetter(rangeAdapter));
|
|
21522
|
+
if (rangeStr === CellErrorType.InvalidReference) {
|
|
21523
|
+
return { changeType: "REMOVE", range: rangeStr };
|
|
21504
21524
|
}
|
|
21505
|
-
return
|
|
21525
|
+
return {
|
|
21526
|
+
changeType: change.changeType,
|
|
21527
|
+
range: rangeStr,
|
|
21528
|
+
};
|
|
21506
21529
|
}
|
|
21507
21530
|
function getSheetNameGetter(applyChange) {
|
|
21508
21531
|
return (sheetId) => {
|
|
@@ -21607,8 +21630,6 @@ function adaptChartRange(range, applyChange) {
|
|
|
21607
21630
|
}
|
|
21608
21631
|
const change = applyChange(range);
|
|
21609
21632
|
switch (change.changeType) {
|
|
21610
|
-
case "NONE":
|
|
21611
|
-
return range;
|
|
21612
21633
|
case "REMOVE":
|
|
21613
21634
|
return undefined;
|
|
21614
21635
|
default:
|
|
@@ -21760,16 +21781,16 @@ function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
|
21760
21781
|
function transformChartDefinitionWithDataSetsWithZone(chartSheetId, definition, applyChange) {
|
|
21761
21782
|
let labelRange;
|
|
21762
21783
|
if (definition.labelRange) {
|
|
21763
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
21764
|
-
if (
|
|
21784
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
21785
|
+
if (changeType !== "REMOVE") {
|
|
21765
21786
|
labelRange = adaptedRange;
|
|
21766
21787
|
}
|
|
21767
21788
|
}
|
|
21768
21789
|
const dataSets = [];
|
|
21769
21790
|
for (const dataSet of definition.dataSets) {
|
|
21770
21791
|
const newDataSet = { ...dataSet };
|
|
21771
|
-
const adaptedRange = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
21772
|
-
if (
|
|
21792
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
21793
|
+
if (changeType !== "REMOVE") {
|
|
21773
21794
|
newDataSet.dataRange = adaptedRange;
|
|
21774
21795
|
dataSets.push(newDataSet);
|
|
21775
21796
|
}
|
|
@@ -23147,14 +23168,14 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
23147
23168
|
let baseline;
|
|
23148
23169
|
let keyValue;
|
|
23149
23170
|
if (definition.baseline) {
|
|
23150
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
23151
|
-
if (
|
|
23171
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
23172
|
+
if (changeType !== "REMOVE") {
|
|
23152
23173
|
baseline = adaptedRange;
|
|
23153
23174
|
}
|
|
23154
23175
|
}
|
|
23155
23176
|
if (definition.keyValue) {
|
|
23156
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
23157
|
-
if (
|
|
23177
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
23178
|
+
if (changeType !== "REMOVE") {
|
|
23158
23179
|
keyValue = adaptedRange;
|
|
23159
23180
|
}
|
|
23160
23181
|
}
|
|
@@ -23211,7 +23232,7 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
23211
23232
|
// This kind of graph is not exportable in Excel
|
|
23212
23233
|
return undefined;
|
|
23213
23234
|
}
|
|
23214
|
-
updateRanges(applyChange) {
|
|
23235
|
+
updateRanges({ applyChange }) {
|
|
23215
23236
|
const baseline = adaptChartRange(this.baseline, applyChange);
|
|
23216
23237
|
const keyValue = adaptChartRange(this.keyValue, applyChange);
|
|
23217
23238
|
if (this.baseline === baseline && this.keyValue === keyValue) {
|
|
@@ -26585,7 +26606,7 @@ class BarChart extends AbstractChart {
|
|
|
26585
26606
|
verticalAxis: getDefinedAxis(definition),
|
|
26586
26607
|
};
|
|
26587
26608
|
}
|
|
26588
|
-
updateRanges(applyChange) {
|
|
26609
|
+
updateRanges({ applyChange }) {
|
|
26589
26610
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
26590
26611
|
if (!isStale) {
|
|
26591
26612
|
return this;
|
|
@@ -27172,7 +27193,7 @@ class ComboChart extends AbstractChart {
|
|
|
27172
27193
|
verticalAxis: getDefinedAxis(definition),
|
|
27173
27194
|
};
|
|
27174
27195
|
}
|
|
27175
|
-
updateRanges(applyChange) {
|
|
27196
|
+
updateRanges({ applyChange }) {
|
|
27176
27197
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27177
27198
|
if (!isStale) {
|
|
27178
27199
|
return this;
|
|
@@ -27344,7 +27365,7 @@ class FunnelChart extends AbstractChart {
|
|
|
27344
27365
|
getDefinitionForExcel() {
|
|
27345
27366
|
return undefined;
|
|
27346
27367
|
}
|
|
27347
|
-
updateRanges(applyChange) {
|
|
27368
|
+
updateRanges({ applyChange }) {
|
|
27348
27369
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27349
27370
|
if (!isStale) {
|
|
27350
27371
|
return this;
|
|
@@ -27455,8 +27476,8 @@ class GaugeChart extends AbstractChart {
|
|
|
27455
27476
|
static transformDefinition(chartSheetId, definition, applyChange) {
|
|
27456
27477
|
let dataRange;
|
|
27457
27478
|
if (definition.dataRange) {
|
|
27458
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
27459
|
-
if (
|
|
27479
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
27480
|
+
if (changeType !== "REMOVE") {
|
|
27460
27481
|
dataRange = adaptedRange;
|
|
27461
27482
|
}
|
|
27462
27483
|
}
|
|
@@ -27531,13 +27552,9 @@ class GaugeChart extends AbstractChart {
|
|
|
27531
27552
|
: undefined,
|
|
27532
27553
|
};
|
|
27533
27554
|
}
|
|
27534
|
-
updateRanges(applyChange,
|
|
27555
|
+
updateRanges({ applyChange, adaptFormulaString }) {
|
|
27535
27556
|
const dataRange = adaptChartRange(this.dataRange, applyChange);
|
|
27536
|
-
const adaptFormula = (formula) =>
|
|
27537
|
-
applyChange,
|
|
27538
|
-
sheetId,
|
|
27539
|
-
sheetName: adaptSheetName,
|
|
27540
|
-
});
|
|
27557
|
+
const adaptFormula = (formula) => adaptFormulaString(this.sheetId, formula);
|
|
27541
27558
|
const sectionRule = adaptSectionRuleFormulas(this.sectionRule, adaptFormula);
|
|
27542
27559
|
const definition = this.getDefinitionWithSpecificRanges(dataRange, sectionRule);
|
|
27543
27560
|
return new GaugeChart(definition, this.sheetId, this.getters);
|
|
@@ -27759,7 +27776,7 @@ class GeoChart extends AbstractChart {
|
|
|
27759
27776
|
getDefinitionForExcel() {
|
|
27760
27777
|
return undefined;
|
|
27761
27778
|
}
|
|
27762
|
-
updateRanges(applyChange) {
|
|
27779
|
+
updateRanges({ applyChange }) {
|
|
27763
27780
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27764
27781
|
if (!isStale) {
|
|
27765
27782
|
return this;
|
|
@@ -27895,7 +27912,7 @@ class LineChart extends AbstractChart {
|
|
|
27895
27912
|
: undefined,
|
|
27896
27913
|
};
|
|
27897
27914
|
}
|
|
27898
|
-
updateRanges(applyChange) {
|
|
27915
|
+
updateRanges({ applyChange }) {
|
|
27899
27916
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27900
27917
|
if (!isStale) {
|
|
27901
27918
|
return this;
|
|
@@ -28055,7 +28072,7 @@ class PieChart extends AbstractChart {
|
|
|
28055
28072
|
labelRange,
|
|
28056
28073
|
};
|
|
28057
28074
|
}
|
|
28058
|
-
updateRanges(applyChange) {
|
|
28075
|
+
updateRanges({ applyChange }) {
|
|
28059
28076
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28060
28077
|
if (!isStale) {
|
|
28061
28078
|
return this;
|
|
@@ -28194,7 +28211,7 @@ class PyramidChart extends AbstractChart {
|
|
|
28194
28211
|
getDefinitionForExcel() {
|
|
28195
28212
|
return undefined;
|
|
28196
28213
|
}
|
|
28197
|
-
updateRanges(applyChange) {
|
|
28214
|
+
updateRanges({ applyChange }) {
|
|
28198
28215
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28199
28216
|
if (!isStale) {
|
|
28200
28217
|
return this;
|
|
@@ -28345,7 +28362,7 @@ class RadarChart extends AbstractChart {
|
|
|
28345
28362
|
labelRange,
|
|
28346
28363
|
};
|
|
28347
28364
|
}
|
|
28348
|
-
updateRanges(applyChange) {
|
|
28365
|
+
updateRanges({ applyChange }) {
|
|
28349
28366
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28350
28367
|
if (!isStale) {
|
|
28351
28368
|
return this;
|
|
@@ -28467,7 +28484,7 @@ class ScatterChart extends AbstractChart {
|
|
|
28467
28484
|
: undefined,
|
|
28468
28485
|
};
|
|
28469
28486
|
}
|
|
28470
|
-
updateRanges(applyChange) {
|
|
28487
|
+
updateRanges({ applyChange }) {
|
|
28471
28488
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28472
28489
|
if (!isStale) {
|
|
28473
28490
|
return this;
|
|
@@ -28632,7 +28649,7 @@ class SunburstChart extends AbstractChart {
|
|
|
28632
28649
|
getDefinitionForExcel() {
|
|
28633
28650
|
return undefined;
|
|
28634
28651
|
}
|
|
28635
|
-
updateRanges(applyChange) {
|
|
28652
|
+
updateRanges({ applyChange }) {
|
|
28636
28653
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28637
28654
|
if (!isStale) {
|
|
28638
28655
|
return this;
|
|
@@ -28780,7 +28797,7 @@ class TreeMapChart extends AbstractChart {
|
|
|
28780
28797
|
getDefinitionForExcel() {
|
|
28781
28798
|
return undefined;
|
|
28782
28799
|
}
|
|
28783
|
-
updateRanges(applyChange) {
|
|
28800
|
+
updateRanges({ applyChange }) {
|
|
28784
28801
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28785
28802
|
if (!isStale) {
|
|
28786
28803
|
return this;
|
|
@@ -28935,7 +28952,7 @@ class WaterfallChart extends AbstractChart {
|
|
|
28935
28952
|
// TODO: implement export excel
|
|
28936
28953
|
return undefined;
|
|
28937
28954
|
}
|
|
28938
|
-
updateRanges(applyChange) {
|
|
28955
|
+
updateRanges({ applyChange }) {
|
|
28939
28956
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28940
28957
|
if (!isStale) {
|
|
28941
28958
|
return this;
|
|
@@ -32643,7 +32660,6 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
32643
32660
|
});
|
|
32644
32661
|
}
|
|
32645
32662
|
handleEvent(event) {
|
|
32646
|
-
this.hideHelp();
|
|
32647
32663
|
const sheetId = this.getters.getActiveSheetId();
|
|
32648
32664
|
let unboundedZone;
|
|
32649
32665
|
if (event.options.unbounded) {
|
|
@@ -32997,6 +33013,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
32997
33013
|
this.colorIndexByRange = {};
|
|
32998
33014
|
this.hoveredTokens = [];
|
|
32999
33015
|
this.hoveredContentEvaluation = "";
|
|
33016
|
+
this.hideHelp();
|
|
33000
33017
|
}
|
|
33001
33018
|
/**
|
|
33002
33019
|
* Reset the current content to the active cell content
|
|
@@ -38618,6 +38635,7 @@ function extractStyle(data, content, styleId, formatId, borderId) {
|
|
|
38618
38635
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
38619
38636
|
: undefined,
|
|
38620
38637
|
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : undefined,
|
|
38638
|
+
shrinkToFit: style.wrapping === "clip" ? true : undefined,
|
|
38621
38639
|
},
|
|
38622
38640
|
};
|
|
38623
38641
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -38638,6 +38656,7 @@ function normalizeStyle(construct, styles) {
|
|
|
38638
38656
|
vertical: styles.alignment.vertical,
|
|
38639
38657
|
horizontal: styles.alignment.horizontal,
|
|
38640
38658
|
wrapText: styles.alignment.wrapText,
|
|
38659
|
+
shrinkToFit: styles.alignment.shrinkToFit,
|
|
38641
38660
|
},
|
|
38642
38661
|
};
|
|
38643
38662
|
return pushElement(style, construct.styles);
|
|
@@ -50821,7 +50840,7 @@ class GaugeChartConfigPanel extends owl.Component {
|
|
|
50821
50840
|
});
|
|
50822
50841
|
dataRange = this.props.definition.dataRange;
|
|
50823
50842
|
get configurationErrorMessages() {
|
|
50824
|
-
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])];
|
|
50843
|
+
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
50825
50844
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
50826
50845
|
}
|
|
50827
50846
|
get isDataRangeInvalid() {
|
|
@@ -50906,7 +50925,7 @@ class GaugeChartDesignPanel extends owl.Component {
|
|
|
50906
50925
|
});
|
|
50907
50926
|
}
|
|
50908
50927
|
get designErrorMessages() {
|
|
50909
|
-
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])];
|
|
50928
|
+
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
50910
50929
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
50911
50930
|
}
|
|
50912
50931
|
get isRangeMinInvalid() {
|
|
@@ -51271,7 +51290,7 @@ class ScorecardChartConfigPanel extends owl.Component {
|
|
|
51271
51290
|
const cancelledReasons = [
|
|
51272
51291
|
...(this.state.keyValueDispatchResult?.reasons || []),
|
|
51273
51292
|
...(this.state.baselineDispatchResult?.reasons || []),
|
|
51274
|
-
];
|
|
51293
|
+
].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
51275
51294
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
51276
51295
|
}
|
|
51277
51296
|
get isKeyValueInvalid() {
|
|
@@ -56098,8 +56117,6 @@ function adaptPivotRange(range, applyChange) {
|
|
|
56098
56117
|
}
|
|
56099
56118
|
const change = applyChange(range);
|
|
56100
56119
|
switch (change.changeType) {
|
|
56101
|
-
case "NONE":
|
|
56102
|
-
return range;
|
|
56103
56120
|
case "REMOVE":
|
|
56104
56121
|
return undefined;
|
|
56105
56122
|
default:
|
|
@@ -58917,7 +58934,7 @@ class CorePlugin extends BasePlugin {
|
|
|
58917
58934
|
* @param sheetId an sheetId to adapt either range of that sheet specifically, or ranges pointing to that sheet
|
|
58918
58935
|
* @param sheetName couple of old and new sheet names to adapt ranges pointing to that sheet
|
|
58919
58936
|
*/
|
|
58920
|
-
adaptRanges(
|
|
58937
|
+
adaptRanges(rangeAdapterFunctions, sheetId, sheetName) { }
|
|
58921
58938
|
/**
|
|
58922
58939
|
* Implement this method to clean unused external resources, such as images
|
|
58923
58940
|
* stored on a server which have been deleted.
|
|
@@ -59513,7 +59530,7 @@ class CellPlugin extends CorePlugin {
|
|
|
59513
59530
|
];
|
|
59514
59531
|
nextId = 1;
|
|
59515
59532
|
cells = {};
|
|
59516
|
-
adaptRanges(applyChange, sheetId, sheetName) {
|
|
59533
|
+
adaptRanges({ applyChange }, sheetId, sheetName) {
|
|
59517
59534
|
for (const sheet of Object.keys(this.cells)) {
|
|
59518
59535
|
for (const cell of Object.values(this.cells[sheet] || {})) {
|
|
59519
59536
|
if (cell.isFormula) {
|
|
@@ -59735,7 +59752,7 @@ class CellPlugin extends CorePlugin {
|
|
|
59735
59752
|
for (const position of positions) {
|
|
59736
59753
|
const cell = this.getters.getCell(position);
|
|
59737
59754
|
const xc = toXC(position.col, position.row);
|
|
59738
|
-
const style = this.
|
|
59755
|
+
const style = this.extractCustomStyle(cell);
|
|
59739
59756
|
if (Object.keys(style).length) {
|
|
59740
59757
|
const styleId = getItemId(style, styles);
|
|
59741
59758
|
positionsByStyle[styleId] ??= [];
|
|
@@ -59781,10 +59798,14 @@ class CellPlugin extends CorePlugin {
|
|
|
59781
59798
|
}
|
|
59782
59799
|
}
|
|
59783
59800
|
}
|
|
59784
|
-
|
|
59785
|
-
const cleanedStyle = { ...style };
|
|
59786
|
-
|
|
59787
|
-
|
|
59801
|
+
extractCustomStyle(cell) {
|
|
59802
|
+
const cleanedStyle = { ...cell.style };
|
|
59803
|
+
const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
|
|
59804
|
+
? DEFAULT_NUMBER_STYLE
|
|
59805
|
+
: DEFAULT_STYLE;
|
|
59806
|
+
for (const property in cleanedStyle) {
|
|
59807
|
+
if ((property !== "align" || !cell.isFormula) &&
|
|
59808
|
+
cleanedStyle[property] === defaultStyle[property]) {
|
|
59788
59809
|
delete cleanedStyle[property];
|
|
59789
59810
|
}
|
|
59790
59811
|
}
|
|
@@ -60134,9 +60155,9 @@ class ChartPlugin extends CorePlugin {
|
|
|
60134
60155
|
charts = {};
|
|
60135
60156
|
createChart = chartFactory(this.getters);
|
|
60136
60157
|
validateChartDefinition = (cmd) => validateChartDefinition(this, cmd.definition);
|
|
60137
|
-
adaptRanges(
|
|
60158
|
+
adaptRanges(rangeAdapters) {
|
|
60138
60159
|
for (const [chartId, chart] of Object.entries(this.charts)) {
|
|
60139
|
-
this.history.update("charts", chartId, chart?.updateRanges(
|
|
60160
|
+
this.history.update("charts", chartId, chart?.updateRanges(rangeAdapters));
|
|
60140
60161
|
}
|
|
60141
60162
|
}
|
|
60142
60163
|
// ---------------------------------------------------------------------------
|
|
@@ -60326,7 +60347,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
60326
60347
|
"getAdaptedCfRanges",
|
|
60327
60348
|
];
|
|
60328
60349
|
cfRules = {};
|
|
60329
|
-
adaptCFFormulas(applyChange) {
|
|
60350
|
+
adaptCFFormulas({ applyChange, adaptFormulaString }) {
|
|
60330
60351
|
for (const sheetId in this.cfRules) {
|
|
60331
60352
|
for (const rule of this.cfRules[sheetId]) {
|
|
60332
60353
|
if (rule.rule.type === "DataBarRule" && rule.rule.rangeValues) {
|
|
@@ -60350,7 +60371,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
60350
60371
|
for (let i = 0; i < rule.rule.values.length; i++) {
|
|
60351
60372
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
60352
60373
|
//@ts-expect-error
|
|
60353
|
-
"values", i,
|
|
60374
|
+
"values", i, adaptFormulaString(sheetId, rule.rule.values[i]));
|
|
60354
60375
|
}
|
|
60355
60376
|
}
|
|
60356
60377
|
else if (rule.rule.type === "IconSetRule") {
|
|
@@ -60358,7 +60379,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
60358
60379
|
if (rule.rule[inflectionPoint].type === "formula") {
|
|
60359
60380
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
60360
60381
|
//@ts-expect-error
|
|
60361
|
-
inflectionPoint, "value",
|
|
60382
|
+
inflectionPoint, "value", adaptFormulaString(sheetId, rule.rule[inflectionPoint].value));
|
|
60362
60383
|
}
|
|
60363
60384
|
}
|
|
60364
60385
|
}
|
|
@@ -60368,14 +60389,14 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
60368
60389
|
if (ruleValue?.type === "formula" && ruleValue?.value) {
|
|
60369
60390
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
60370
60391
|
//@ts-expect-error
|
|
60371
|
-
value, "value",
|
|
60392
|
+
value, "value", adaptFormulaString(sheetId, ruleValue.value));
|
|
60372
60393
|
}
|
|
60373
60394
|
}
|
|
60374
60395
|
}
|
|
60375
60396
|
}
|
|
60376
60397
|
}
|
|
60377
60398
|
}
|
|
60378
|
-
adaptCFRanges(sheetId, applyChange) {
|
|
60399
|
+
adaptCFRanges(sheetId, { applyChange }) {
|
|
60379
60400
|
for (const rule of this.cfRules[sheetId]) {
|
|
60380
60401
|
for (const range of rule.ranges) {
|
|
60381
60402
|
const change = applyChange(range);
|
|
@@ -60399,12 +60420,12 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
60399
60420
|
}
|
|
60400
60421
|
}
|
|
60401
60422
|
}
|
|
60402
|
-
adaptRanges(
|
|
60423
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
60403
60424
|
const sheetIds = sheetId ? [sheetId] : Object.keys(this.cfRules);
|
|
60404
60425
|
for (const sheetId of sheetIds) {
|
|
60405
|
-
this.adaptCFRanges(sheetId,
|
|
60426
|
+
this.adaptCFRanges(sheetId, rangeAdapters);
|
|
60406
60427
|
}
|
|
60407
|
-
this.adaptCFFormulas(
|
|
60428
|
+
this.adaptCFFormulas(rangeAdapters);
|
|
60408
60429
|
}
|
|
60409
60430
|
// ---------------------------------------------------------------------------
|
|
60410
60431
|
// Command Handling
|
|
@@ -60781,23 +60802,23 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
60781
60802
|
"getValidationRuleForCell",
|
|
60782
60803
|
];
|
|
60783
60804
|
rules = {};
|
|
60784
|
-
adaptRanges(
|
|
60785
|
-
this.adaptDVRanges(sheetId,
|
|
60786
|
-
this.adaptDVFormulas(
|
|
60805
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
60806
|
+
this.adaptDVRanges(sheetId, rangeAdapters);
|
|
60807
|
+
this.adaptDVFormulas(rangeAdapters);
|
|
60787
60808
|
}
|
|
60788
|
-
adaptDVFormulas(
|
|
60809
|
+
adaptDVFormulas({ adaptFormulaString }) {
|
|
60789
60810
|
for (const sheetId in this.rules) {
|
|
60790
60811
|
const rules = this.rules[sheetId];
|
|
60791
60812
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
60792
60813
|
const rule = this.rules[sheetId][ruleIndex];
|
|
60793
60814
|
for (let valueIndex = 0; valueIndex < rule.criterion.values.length; valueIndex++) {
|
|
60794
|
-
const value =
|
|
60815
|
+
const value = adaptFormulaString(sheetId, rule.criterion.values[valueIndex]);
|
|
60795
60816
|
this.history.update("rules", sheetId, ruleIndex, "criterion", "values", valueIndex, value);
|
|
60796
60817
|
}
|
|
60797
60818
|
}
|
|
60798
60819
|
}
|
|
60799
60820
|
}
|
|
60800
|
-
adaptDVRanges(sheetId, applyChange) {
|
|
60821
|
+
adaptDVRanges(sheetId, { applyChange }) {
|
|
60801
60822
|
const rules = this.rules[sheetId];
|
|
60802
60823
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
60803
60824
|
const rule = this.rules[sheetId][ruleIndex];
|
|
@@ -61071,7 +61092,7 @@ class FigurePlugin extends CorePlugin {
|
|
|
61071
61092
|
// ---------------------------------------------------------------------------
|
|
61072
61093
|
// Command Handling
|
|
61073
61094
|
// ---------------------------------------------------------------------------
|
|
61074
|
-
adaptRanges(applyChange, sheetId) {
|
|
61095
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
61075
61096
|
for (const figure of this.getFigures(sheetId)) {
|
|
61076
61097
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, {
|
|
61077
61098
|
left: figure.col,
|
|
@@ -61879,8 +61900,8 @@ class MergePlugin extends CorePlugin {
|
|
|
61879
61900
|
break;
|
|
61880
61901
|
}
|
|
61881
61902
|
}
|
|
61882
|
-
adaptRanges(
|
|
61883
|
-
this.applyRangeChangeOnSheet(sheetId,
|
|
61903
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
61904
|
+
this.applyRangeChangeOnSheet(sheetId, rangeAdapters);
|
|
61884
61905
|
}
|
|
61885
61906
|
// ---------------------------------------------------------------------------
|
|
61886
61907
|
// Getters
|
|
@@ -62182,7 +62203,7 @@ class MergePlugin extends CorePlugin {
|
|
|
62182
62203
|
/**
|
|
62183
62204
|
* Apply a range change on merges of a particular sheet.
|
|
62184
62205
|
*/
|
|
62185
|
-
applyRangeChangeOnSheet(sheetId, applyChange) {
|
|
62206
|
+
applyRangeChangeOnSheet(sheetId, { applyChange }) {
|
|
62186
62207
|
const merges = Object.entries(this.merges[sheetId] || {});
|
|
62187
62208
|
for (const [mergeId, range] of merges) {
|
|
62188
62209
|
if (range) {
|
|
@@ -62256,7 +62277,7 @@ function rangeToMerge(mergeId, range) {
|
|
|
62256
62277
|
};
|
|
62257
62278
|
}
|
|
62258
62279
|
|
|
62259
|
-
class
|
|
62280
|
+
class RangeAdapterPlugin {
|
|
62260
62281
|
getters;
|
|
62261
62282
|
providers = [];
|
|
62262
62283
|
isAdaptingRanges = false;
|
|
@@ -62264,7 +62285,6 @@ class RangeAdapter {
|
|
|
62264
62285
|
this.getters = getters;
|
|
62265
62286
|
}
|
|
62266
62287
|
static getters = [
|
|
62267
|
-
"adaptFormulaStringDependencies",
|
|
62268
62288
|
"copyFormulaStringForSheet",
|
|
62269
62289
|
"extendRange",
|
|
62270
62290
|
"getRangeString",
|
|
@@ -62295,8 +62315,8 @@ class RangeAdapter {
|
|
|
62295
62315
|
throw new Error("Plugins cannot dispatch commands during adaptRanges phase");
|
|
62296
62316
|
}
|
|
62297
62317
|
const rangeAdapter = getRangeAdapter(cmd);
|
|
62298
|
-
if (rangeAdapter
|
|
62299
|
-
this.executeOnAllRanges(rangeAdapter
|
|
62318
|
+
if (rangeAdapter) {
|
|
62319
|
+
this.executeOnAllRanges(rangeAdapter);
|
|
62300
62320
|
}
|
|
62301
62321
|
}
|
|
62302
62322
|
finalize() { }
|
|
@@ -62315,11 +62335,15 @@ class RangeAdapter {
|
|
|
62315
62335
|
return result;
|
|
62316
62336
|
};
|
|
62317
62337
|
}
|
|
62318
|
-
executeOnAllRanges(
|
|
62338
|
+
executeOnAllRanges(rangeAdapter) {
|
|
62319
62339
|
this.isAdaptingRanges = true;
|
|
62320
|
-
const
|
|
62340
|
+
const adapterFunctions = {
|
|
62341
|
+
applyChange: this.verifyRangeRemoved(rangeAdapter.applyChange),
|
|
62342
|
+
adaptRangeString: (defaultSheetId, sheetXC) => adaptStringRange(defaultSheetId, sheetXC, rangeAdapter),
|
|
62343
|
+
adaptFormulaString: (defaultSheetId, formula) => adaptFormulaStringRanges(defaultSheetId, formula, rangeAdapter),
|
|
62344
|
+
};
|
|
62321
62345
|
for (const provider of this.providers) {
|
|
62322
|
-
provider(
|
|
62346
|
+
provider(adapterFunctions, rangeAdapter.sheetId, rangeAdapter.sheetName);
|
|
62323
62347
|
}
|
|
62324
62348
|
this.isAdaptingRanges = false;
|
|
62325
62349
|
}
|
|
@@ -62487,18 +62511,6 @@ class RangeAdapter {
|
|
|
62487
62511
|
const unionOfZones = unionUnboundedZones(...zones);
|
|
62488
62512
|
return this.getRangeFromZone(ranges[0].sheetId, unionOfZones);
|
|
62489
62513
|
}
|
|
62490
|
-
adaptFormulaStringDependencies(sheetId, formula, applyChange) {
|
|
62491
|
-
if (!formula.startsWith("=")) {
|
|
62492
|
-
return formula;
|
|
62493
|
-
}
|
|
62494
|
-
const compiledFormula = compile(formula);
|
|
62495
|
-
const updatedDependencies = compiledFormula.dependencies.map((dep) => {
|
|
62496
|
-
const range = this.getters.getRangeFromSheetXC(sheetId, dep);
|
|
62497
|
-
const changedRange = applyChange(range);
|
|
62498
|
-
return changedRange.changeType === "NONE" ? range : changedRange.range;
|
|
62499
|
-
});
|
|
62500
|
-
return this.getters.getFormulaString(sheetId, compiledFormula.tokens, updatedDependencies);
|
|
62501
|
-
}
|
|
62502
62514
|
/**
|
|
62503
62515
|
* Copy a formula string to another sheet.
|
|
62504
62516
|
*
|
|
@@ -63391,7 +63403,7 @@ class TablePlugin extends CorePlugin {
|
|
|
63391
63403
|
static getters = ["getCoreTable", "getCoreTables", "getCoreTableMatchingTopLeft"];
|
|
63392
63404
|
tables = {};
|
|
63393
63405
|
nextTableId = 1;
|
|
63394
|
-
adaptRanges(applyChange, sheetId) {
|
|
63406
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
63395
63407
|
for (const table of this.getCoreTables(sheetId)) {
|
|
63396
63408
|
this.applyRangeChangeOnTable(sheetId, table, applyChange);
|
|
63397
63409
|
}
|
|
@@ -64357,7 +64369,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64357
64369
|
}
|
|
64358
64370
|
}
|
|
64359
64371
|
}
|
|
64360
|
-
adaptRanges(applyChange) {
|
|
64372
|
+
adaptRanges({ applyChange, adaptFormulaString }) {
|
|
64361
64373
|
for (const pivotId in this.pivots) {
|
|
64362
64374
|
const definition = deepCopy(this.pivots[pivotId]?.definition);
|
|
64363
64375
|
if (!definition) {
|
|
@@ -64377,19 +64389,13 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64377
64389
|
continue;
|
|
64378
64390
|
}
|
|
64379
64391
|
const sheetId = measure.computedBy.sheetId;
|
|
64380
|
-
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId]
|
|
64381
|
-
|
|
64382
|
-
|
|
64383
|
-
|
|
64384
|
-
|
|
64385
|
-
newDependencies.push(range);
|
|
64386
|
-
}
|
|
64387
|
-
else {
|
|
64388
|
-
newDependencies.push(change.range);
|
|
64389
|
-
}
|
|
64390
|
-
}
|
|
64391
|
-
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
64392
|
+
const { formula: compiledFormula, dependencies: indirectDependencies } = this.compiledMeasureFormulas[pivotId][measureId];
|
|
64393
|
+
// adapt direct dependencies
|
|
64394
|
+
this.history.update("compiledMeasureFormulas", pivotId, measureId, "formula", "dependencies", compiledFormula.dependencies.map((range) => applyChange(range).range));
|
|
64395
|
+
// adapt all dependencies (including indirect)
|
|
64396
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", indirectDependencies.map((range) => applyChange(range).range));
|
|
64392
64397
|
const oldFormulaString = measure.computedBy.formula;
|
|
64398
|
+
const newFormulaString = adaptFormulaString(sheetId, oldFormulaString);
|
|
64393
64399
|
if (newFormulaString !== oldFormulaString) {
|
|
64394
64400
|
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
64395
64401
|
}
|
|
@@ -64551,7 +64557,6 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64551
64557
|
formula: newFormulaString,
|
|
64552
64558
|
sheetId: measure.computedBy.sheetId,
|
|
64553
64559
|
});
|
|
64554
|
-
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
64555
64560
|
}
|
|
64556
64561
|
checkSortedColumnInMeasures(definition) {
|
|
64557
64562
|
const measures = definition.measures.map((measure) => measure.id);
|
|
@@ -65933,11 +65938,16 @@ class SpreadingRelation {
|
|
|
65933
65938
|
return this.arrayFormulasToResults.get(formulasPosition);
|
|
65934
65939
|
}
|
|
65935
65940
|
/**
|
|
65936
|
-
* Remove a
|
|
65941
|
+
* Remove a spreading relation for a given array formula position
|
|
65942
|
+
* and its result zone
|
|
65937
65943
|
*/
|
|
65938
65944
|
removeNode(position) {
|
|
65945
|
+
const resultZone = this.arrayFormulasToResults.get(position);
|
|
65946
|
+
if (!resultZone) {
|
|
65947
|
+
return;
|
|
65948
|
+
}
|
|
65939
65949
|
this.resultsToArrayFormulas.remove({
|
|
65940
|
-
boundingBox: { sheetId: position.sheetId, zone:
|
|
65950
|
+
boundingBox: { sheetId: position.sheetId, zone: resultZone },
|
|
65941
65951
|
data: position,
|
|
65942
65952
|
});
|
|
65943
65953
|
this.arrayFormulasToResults.delete(position);
|
|
@@ -66225,6 +66235,10 @@ class Evaluator {
|
|
|
66225
66235
|
// empty matrix
|
|
66226
66236
|
return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
|
|
66227
66237
|
}
|
|
66238
|
+
if (nbRows === 1 && nbColumns === 1) {
|
|
66239
|
+
// single value matrix
|
|
66240
|
+
return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
|
|
66241
|
+
}
|
|
66228
66242
|
const resultZone = {
|
|
66229
66243
|
top: formulaPosition.row,
|
|
66230
66244
|
bottom: formulaPosition.row + nbRows - 1,
|
|
@@ -67911,6 +67925,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
67911
67925
|
handle(cmd) {
|
|
67912
67926
|
switch (cmd.type) {
|
|
67913
67927
|
case "START":
|
|
67928
|
+
case "UPDATE_LOCALE":
|
|
67914
67929
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
67915
67930
|
this.initializeSheet(sheetId);
|
|
67916
67931
|
}
|
|
@@ -68032,7 +68047,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
68032
68047
|
}
|
|
68033
68048
|
const cell = this.getters.getCell(position);
|
|
68034
68049
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
68035
|
-
return getDefaultCellHeight(this.ctx, cell, colSize);
|
|
68050
|
+
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
68036
68051
|
}
|
|
68037
68052
|
isInMultiRowMerge(position) {
|
|
68038
68053
|
const merge = this.getters.getMerge(position);
|
|
@@ -70341,7 +70356,7 @@ function addConditionalFormatCommandAdaptRange(cmd, applyChange) {
|
|
|
70341
70356
|
cmd.cf.rule = {
|
|
70342
70357
|
...rule,
|
|
70343
70358
|
rangeValues: rule.rangeValues
|
|
70344
|
-
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange)
|
|
70359
|
+
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange).range
|
|
70345
70360
|
: undefined,
|
|
70346
70361
|
};
|
|
70347
70362
|
}
|
|
@@ -83556,6 +83571,9 @@ function addStyles(styles) {
|
|
|
83556
83571
|
if (style.alignment && style.alignment.wrapText) {
|
|
83557
83572
|
alignAttrs.push(["wrapText", "1"]);
|
|
83558
83573
|
}
|
|
83574
|
+
if (style.alignment && style.alignment.shrinkToFit) {
|
|
83575
|
+
alignAttrs.push(["shrinkToFit", "1"]);
|
|
83576
|
+
}
|
|
83559
83577
|
if (alignAttrs.length > 0) {
|
|
83560
83578
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
83561
83579
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
@@ -84326,7 +84344,7 @@ class Model extends EventBus {
|
|
|
84326
84344
|
this.config = this.setupConfig(config);
|
|
84327
84345
|
this.session = this.setupSession(workbookData.revisionId);
|
|
84328
84346
|
this.coreGetters = {};
|
|
84329
|
-
this.range = new
|
|
84347
|
+
this.range = new RangeAdapterPlugin(this.coreGetters);
|
|
84330
84348
|
this.coreGetters.getRangeString = this.range.getRangeString.bind(this.range);
|
|
84331
84349
|
this.coreGetters.getRangeFromSheetXC = this.range.getRangeFromSheetXC.bind(this.range);
|
|
84332
84350
|
this.coreGetters.createAdaptedRanges = this.range.createAdaptedRanges.bind(this.range);
|
|
@@ -84340,8 +84358,6 @@ class Model extends EventBus {
|
|
|
84340
84358
|
this.coreGetters.extendRange = this.range.extendRange.bind(this.range);
|
|
84341
84359
|
this.coreGetters.getRangesUnion = this.range.getRangesUnion.bind(this.range);
|
|
84342
84360
|
this.coreGetters.removeRangesSheetPrefix = this.range.removeRangesSheetPrefix.bind(this.range);
|
|
84343
|
-
this.coreGetters.adaptFormulaStringDependencies =
|
|
84344
|
-
this.range.adaptFormulaStringDependencies.bind(this.range);
|
|
84345
84361
|
this.coreGetters.copyFormulaStringForSheet = this.range.copyFormulaStringForSheet.bind(this.range);
|
|
84346
84362
|
this.getters = {
|
|
84347
84363
|
isReadonly: () => this.config.mode === "readonly" || this.config.mode === "dashboard",
|
|
@@ -85064,6 +85080,6 @@ exports.tokenColors = tokenColors;
|
|
|
85064
85080
|
exports.tokenize = tokenize;
|
|
85065
85081
|
|
|
85066
85082
|
|
|
85067
|
-
__info__.version = "18.4.
|
|
85068
|
-
__info__.date = "2026-01-
|
|
85069
|
-
__info__.hash = "
|
|
85083
|
+
__info__.version = "18.4.25";
|
|
85084
|
+
__info__.date = "2026-01-21T11:06:11.131Z";
|
|
85085
|
+
__info__.hash = "161472d";
|