@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
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, useExternalListener, onWillUpdateProps, onWillStart, onWillPatch, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -40,7 +40,8 @@ function createAction(item) {
|
|
|
40
40
|
return children
|
|
41
41
|
.map((child) => (typeof child === "function" ? child(env) : child))
|
|
42
42
|
.flat()
|
|
43
|
-
.map(createAction)
|
|
43
|
+
.map(createAction)
|
|
44
|
+
.sort((a, b) => a.sequence - b.sequence);
|
|
44
45
|
}
|
|
45
46
|
: () => [],
|
|
46
47
|
isReadonlyAllowed: item.isReadonlyAllowed || false,
|
|
@@ -332,6 +333,7 @@ const DEFAULT_STYLE = {
|
|
|
332
333
|
fillColor: "",
|
|
333
334
|
textColor: "",
|
|
334
335
|
};
|
|
336
|
+
const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
|
|
335
337
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
336
338
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
337
339
|
// Fonts
|
|
@@ -6385,67 +6387,6 @@ function getFullReference(sheetName, xc) {
|
|
|
6385
6387
|
return sheetName !== undefined ? `${getCanonicalSymbolName(sheetName)}!${xc}` : xc;
|
|
6386
6388
|
}
|
|
6387
6389
|
|
|
6388
|
-
function createDefaultRows(rowNumber) {
|
|
6389
|
-
const rows = [];
|
|
6390
|
-
for (let i = 0; i < rowNumber; i++) {
|
|
6391
|
-
const row = {
|
|
6392
|
-
cells: {},
|
|
6393
|
-
};
|
|
6394
|
-
rows.push(row);
|
|
6395
|
-
}
|
|
6396
|
-
return rows;
|
|
6397
|
-
}
|
|
6398
|
-
function moveHeaderIndexesOnHeaderAddition(indexHeaderAdded, numberAdded, headers) {
|
|
6399
|
-
return headers.map((header) => {
|
|
6400
|
-
if (header >= indexHeaderAdded) {
|
|
6401
|
-
return header + numberAdded;
|
|
6402
|
-
}
|
|
6403
|
-
return header;
|
|
6404
|
-
});
|
|
6405
|
-
}
|
|
6406
|
-
function moveHeaderIndexesOnHeaderDeletion(deletedHeaders, headers) {
|
|
6407
|
-
deletedHeaders = [...deletedHeaders].sort((a, b) => b - a);
|
|
6408
|
-
return headers
|
|
6409
|
-
.map((header) => {
|
|
6410
|
-
for (const deletedHeader of deletedHeaders) {
|
|
6411
|
-
if (header > deletedHeader) {
|
|
6412
|
-
header--;
|
|
6413
|
-
}
|
|
6414
|
-
else if (header === deletedHeader) {
|
|
6415
|
-
return undefined;
|
|
6416
|
-
}
|
|
6417
|
-
}
|
|
6418
|
-
return header;
|
|
6419
|
-
})
|
|
6420
|
-
.filter(isDefined);
|
|
6421
|
-
}
|
|
6422
|
-
function getNextSheetName(existingNames, baseName = "Sheet") {
|
|
6423
|
-
let i = 1;
|
|
6424
|
-
let name = `${baseName}${i}`;
|
|
6425
|
-
while (existingNames.includes(name)) {
|
|
6426
|
-
name = `${baseName}${i}`;
|
|
6427
|
-
i++;
|
|
6428
|
-
}
|
|
6429
|
-
return name;
|
|
6430
|
-
}
|
|
6431
|
-
function getDuplicateSheetName(nameToDuplicate, existingNames) {
|
|
6432
|
-
let i = 1;
|
|
6433
|
-
const baseName = _t("Copy of %s", nameToDuplicate);
|
|
6434
|
-
let name = baseName.toString();
|
|
6435
|
-
while (existingNames.includes(name)) {
|
|
6436
|
-
name = `${baseName} (${i})`;
|
|
6437
|
-
i++;
|
|
6438
|
-
}
|
|
6439
|
-
return name;
|
|
6440
|
-
}
|
|
6441
|
-
function isSheetNameEqual(name1, name2) {
|
|
6442
|
-
if (name1 === undefined || name2 === undefined) {
|
|
6443
|
-
return false;
|
|
6444
|
-
}
|
|
6445
|
-
return (getUnquotedSheetName(name1.trim().toUpperCase()) ===
|
|
6446
|
-
getUnquotedSheetName(name2.trim().toUpperCase()));
|
|
6447
|
-
}
|
|
6448
|
-
|
|
6449
6390
|
function createRange(args, getSheetSize) {
|
|
6450
6391
|
const unboundedZone = args.zone;
|
|
6451
6392
|
const zone = boundUnboundedZone(unboundedZone, getSheetSize(args.sheetId));
|
|
@@ -6689,8 +6630,8 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
6689
6630
|
elements.sort((a, b) => b - a);
|
|
6690
6631
|
const groups = groupConsecutive(elements);
|
|
6691
6632
|
return (range) => {
|
|
6692
|
-
if (
|
|
6693
|
-
return { changeType: "NONE" };
|
|
6633
|
+
if (range.sheetId !== cmd.sheetId) {
|
|
6634
|
+
return { changeType: "NONE", range };
|
|
6694
6635
|
}
|
|
6695
6636
|
let newRange = range;
|
|
6696
6637
|
let changeType = "NONE";
|
|
@@ -6717,10 +6658,7 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
6717
6658
|
newRange = createAdaptedRange(newRange, dimension, changeType, -(max - min + 1));
|
|
6718
6659
|
}
|
|
6719
6660
|
}
|
|
6720
|
-
|
|
6721
|
-
return { changeType, range: newRange };
|
|
6722
|
-
}
|
|
6723
|
-
return { changeType: "NONE" };
|
|
6661
|
+
return { changeType, range: newRange };
|
|
6724
6662
|
};
|
|
6725
6663
|
}
|
|
6726
6664
|
function getApplyRangeChangeAddColRow(cmd) {
|
|
@@ -6729,7 +6667,7 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
6729
6667
|
const dimension = cmd.dimension === "COL" ? "columns" : "rows";
|
|
6730
6668
|
return (range) => {
|
|
6731
6669
|
if (range.sheetId !== cmd.sheetId) {
|
|
6732
|
-
return { changeType: "NONE" };
|
|
6670
|
+
return { changeType: "NONE", range };
|
|
6733
6671
|
}
|
|
6734
6672
|
if (cmd.position === "after") {
|
|
6735
6673
|
if (range.zone[start] <= cmd.base && cmd.base < range.zone[end]) {
|
|
@@ -6759,13 +6697,13 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
6759
6697
|
};
|
|
6760
6698
|
}
|
|
6761
6699
|
}
|
|
6762
|
-
return { changeType: "NONE" };
|
|
6700
|
+
return { changeType: "NONE", range };
|
|
6763
6701
|
};
|
|
6764
6702
|
}
|
|
6765
6703
|
function getApplyRangeChangeDeleteSheet(cmd) {
|
|
6766
6704
|
return (range) => {
|
|
6767
6705
|
if (range.sheetId !== cmd.sheetId && range.invalidSheetName !== cmd.sheetName) {
|
|
6768
|
-
return { changeType: "NONE" };
|
|
6706
|
+
return { changeType: "NONE", range };
|
|
6769
6707
|
}
|
|
6770
6708
|
const invalidSheetName = cmd.sheetName;
|
|
6771
6709
|
range = {
|
|
@@ -6792,14 +6730,14 @@ function getApplyRangeChangeRenameSheet(cmd) {
|
|
|
6792
6730
|
const newRange = { ...range, sheetId, invalidSheetName };
|
|
6793
6731
|
return { changeType: "CHANGE", range: newRange };
|
|
6794
6732
|
}
|
|
6795
|
-
return { changeType: "NONE" };
|
|
6733
|
+
return { changeType: "NONE", range };
|
|
6796
6734
|
};
|
|
6797
6735
|
}
|
|
6798
6736
|
function getApplyRangeChangeMoveRange(cmd) {
|
|
6799
6737
|
const originZone = cmd.target[0];
|
|
6800
6738
|
return (range) => {
|
|
6801
6739
|
if (range.sheetId !== cmd.sheetId || !isZoneInside(range.zone, originZone)) {
|
|
6802
|
-
return { changeType: "NONE" };
|
|
6740
|
+
return { changeType: "NONE", range };
|
|
6803
6741
|
}
|
|
6804
6742
|
const targetSheetId = cmd.targetSheetId;
|
|
6805
6743
|
const offsetX = cmd.col - originZone.left;
|
|
@@ -6896,17 +6834,87 @@ function fuzzyLookup(pattern, list, fn) {
|
|
|
6896
6834
|
return results.map((r) => r.elem);
|
|
6897
6835
|
}
|
|
6898
6836
|
|
|
6837
|
+
function createDefaultRows(rowNumber) {
|
|
6838
|
+
const rows = [];
|
|
6839
|
+
for (let i = 0; i < rowNumber; i++) {
|
|
6840
|
+
const row = {
|
|
6841
|
+
cells: {},
|
|
6842
|
+
};
|
|
6843
|
+
rows.push(row);
|
|
6844
|
+
}
|
|
6845
|
+
return rows;
|
|
6846
|
+
}
|
|
6847
|
+
function moveHeaderIndexesOnHeaderAddition(indexHeaderAdded, numberAdded, headers) {
|
|
6848
|
+
return headers.map((header) => {
|
|
6849
|
+
if (header >= indexHeaderAdded) {
|
|
6850
|
+
return header + numberAdded;
|
|
6851
|
+
}
|
|
6852
|
+
return header;
|
|
6853
|
+
});
|
|
6854
|
+
}
|
|
6855
|
+
function moveHeaderIndexesOnHeaderDeletion(deletedHeaders, headers) {
|
|
6856
|
+
deletedHeaders = [...deletedHeaders].sort((a, b) => b - a);
|
|
6857
|
+
return headers
|
|
6858
|
+
.map((header) => {
|
|
6859
|
+
for (const deletedHeader of deletedHeaders) {
|
|
6860
|
+
if (header > deletedHeader) {
|
|
6861
|
+
header--;
|
|
6862
|
+
}
|
|
6863
|
+
else if (header === deletedHeader) {
|
|
6864
|
+
return undefined;
|
|
6865
|
+
}
|
|
6866
|
+
}
|
|
6867
|
+
return header;
|
|
6868
|
+
})
|
|
6869
|
+
.filter(isDefined);
|
|
6870
|
+
}
|
|
6871
|
+
function getNextSheetName(existingNames, baseName = "Sheet") {
|
|
6872
|
+
let i = 1;
|
|
6873
|
+
let name = `${baseName}${i}`;
|
|
6874
|
+
while (existingNames.includes(name)) {
|
|
6875
|
+
name = `${baseName}${i}`;
|
|
6876
|
+
i++;
|
|
6877
|
+
}
|
|
6878
|
+
return name;
|
|
6879
|
+
}
|
|
6880
|
+
function getDuplicateSheetName(nameToDuplicate, existingNames) {
|
|
6881
|
+
let i = 1;
|
|
6882
|
+
const baseName = _t("Copy of %s", nameToDuplicate);
|
|
6883
|
+
let name = baseName.toString();
|
|
6884
|
+
while (existingNames.includes(name)) {
|
|
6885
|
+
name = `${baseName} (${i})`;
|
|
6886
|
+
i++;
|
|
6887
|
+
}
|
|
6888
|
+
return name;
|
|
6889
|
+
}
|
|
6890
|
+
function isSheetNameEqual(name1, name2) {
|
|
6891
|
+
if (name1 === undefined || name2 === undefined) {
|
|
6892
|
+
return false;
|
|
6893
|
+
}
|
|
6894
|
+
return (getUnquotedSheetName(name1.trim().toUpperCase()) ===
|
|
6895
|
+
getUnquotedSheetName(name2.trim().toUpperCase()));
|
|
6896
|
+
}
|
|
6897
|
+
|
|
6899
6898
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
6900
6899
|
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
6901
6900
|
}
|
|
6902
6901
|
/**
|
|
6903
6902
|
* Get the default height of the cell given its style.
|
|
6904
6903
|
*/
|
|
6905
|
-
function getDefaultCellHeight(ctx, cell, colSize) {
|
|
6904
|
+
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
6906
6905
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
6907
6906
|
return DEFAULT_CELL_HEIGHT;
|
|
6908
6907
|
}
|
|
6909
|
-
|
|
6908
|
+
let content = "";
|
|
6909
|
+
try {
|
|
6910
|
+
if (!cell.isFormula) {
|
|
6911
|
+
const localeFormat = { format: cell.format, locale };
|
|
6912
|
+
content = formatValue(parseLiteral(cell.content, locale), localeFormat);
|
|
6913
|
+
}
|
|
6914
|
+
}
|
|
6915
|
+
catch {
|
|
6916
|
+
content = CellErrorType.GenericError;
|
|
6917
|
+
}
|
|
6910
6918
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
6911
6919
|
}
|
|
6912
6920
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
@@ -20987,7 +20995,16 @@ function createComputeFunction(descr) {
|
|
|
20987
20995
|
}
|
|
20988
20996
|
acceptToVectorize.push(!argDefinition.acceptMatrix);
|
|
20989
20997
|
}
|
|
20990
|
-
return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
|
|
20998
|
+
return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
|
|
20999
|
+
}
|
|
21000
|
+
function replaceErrorPlaceholderInResult(result) {
|
|
21001
|
+
if (!isMatrix(result)) {
|
|
21002
|
+
replaceFunctionNamePlaceholder(result, descr.name);
|
|
21003
|
+
}
|
|
21004
|
+
else {
|
|
21005
|
+
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
21006
|
+
}
|
|
21007
|
+
return result;
|
|
20991
21008
|
}
|
|
20992
21009
|
function errorHandlingCompute(...args) {
|
|
20993
21010
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -21016,13 +21033,12 @@ function createComputeFunction(descr) {
|
|
|
21016
21033
|
const result = descr.compute.apply(this, args);
|
|
21017
21034
|
if (!isMatrix(result)) {
|
|
21018
21035
|
if (typeof result === "object" && result !== null && "value" in result) {
|
|
21019
|
-
replaceFunctionNamePlaceholder(result, descr.name);
|
|
21020
21036
|
return result;
|
|
21021
21037
|
}
|
|
21038
|
+
descr.name;
|
|
21022
21039
|
return { value: result };
|
|
21023
21040
|
}
|
|
21024
21041
|
if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
|
|
21025
|
-
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
21026
21042
|
return result;
|
|
21027
21043
|
}
|
|
21028
21044
|
return matrixMap(result, (row) => ({ value: row }));
|
|
@@ -21474,7 +21490,7 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
21474
21490
|
continue;
|
|
21475
21491
|
}
|
|
21476
21492
|
const sheetXC = tokens[tokenIdx].value;
|
|
21477
|
-
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange);
|
|
21493
|
+
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange).range;
|
|
21478
21494
|
if (sheetXC !== newSheetXC) {
|
|
21479
21495
|
tokens[tokenIdx] = {
|
|
21480
21496
|
value: newSheetXC,
|
|
@@ -21484,23 +21500,30 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
21484
21500
|
}
|
|
21485
21501
|
return concat(tokens.map((token) => token.value));
|
|
21486
21502
|
}
|
|
21487
|
-
function adaptStringRange(defaultSheetId, sheetXC,
|
|
21503
|
+
function adaptStringRange(defaultSheetId, sheetXC, rangeAdapter) {
|
|
21488
21504
|
const sheetName = splitReference(sheetXC).sheetName;
|
|
21489
21505
|
if (sheetName
|
|
21490
|
-
? !isSheetNameEqual(sheetName,
|
|
21491
|
-
: defaultSheetId !==
|
|
21492
|
-
return sheetXC;
|
|
21506
|
+
? !isSheetNameEqual(sheetName, rangeAdapter.sheetName.old)
|
|
21507
|
+
: defaultSheetId !== rangeAdapter.sheetId) {
|
|
21508
|
+
return { changeType: "NONE", range: sheetXC };
|
|
21493
21509
|
}
|
|
21494
|
-
const sheetId = sheetName ?
|
|
21510
|
+
const sheetId = sheetName ? rangeAdapter.sheetId : defaultSheetId;
|
|
21495
21511
|
const range = getRange(sheetXC, sheetId);
|
|
21496
21512
|
if (range.invalidXc) {
|
|
21497
|
-
return sheetXC;
|
|
21513
|
+
return { changeType: "NONE", range: sheetXC };
|
|
21498
21514
|
}
|
|
21499
|
-
const change =
|
|
21515
|
+
const change = rangeAdapter.applyChange(range);
|
|
21500
21516
|
if (change.changeType === "NONE" || change.changeType === "REMOVE") {
|
|
21501
|
-
return sheetXC;
|
|
21517
|
+
return { changeType: change.changeType, range: sheetXC };
|
|
21518
|
+
}
|
|
21519
|
+
const rangeStr = getRangeString(change.range, defaultSheetId, getSheetNameGetter(rangeAdapter));
|
|
21520
|
+
if (rangeStr === CellErrorType.InvalidReference) {
|
|
21521
|
+
return { changeType: "REMOVE", range: rangeStr };
|
|
21502
21522
|
}
|
|
21503
|
-
return
|
|
21523
|
+
return {
|
|
21524
|
+
changeType: change.changeType,
|
|
21525
|
+
range: rangeStr,
|
|
21526
|
+
};
|
|
21504
21527
|
}
|
|
21505
21528
|
function getSheetNameGetter(applyChange) {
|
|
21506
21529
|
return (sheetId) => {
|
|
@@ -21605,8 +21628,6 @@ function adaptChartRange(range, applyChange) {
|
|
|
21605
21628
|
}
|
|
21606
21629
|
const change = applyChange(range);
|
|
21607
21630
|
switch (change.changeType) {
|
|
21608
|
-
case "NONE":
|
|
21609
|
-
return range;
|
|
21610
21631
|
case "REMOVE":
|
|
21611
21632
|
return undefined;
|
|
21612
21633
|
default:
|
|
@@ -21758,16 +21779,16 @@ function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
|
21758
21779
|
function transformChartDefinitionWithDataSetsWithZone(chartSheetId, definition, applyChange) {
|
|
21759
21780
|
let labelRange;
|
|
21760
21781
|
if (definition.labelRange) {
|
|
21761
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
21762
|
-
if (
|
|
21782
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
21783
|
+
if (changeType !== "REMOVE") {
|
|
21763
21784
|
labelRange = adaptedRange;
|
|
21764
21785
|
}
|
|
21765
21786
|
}
|
|
21766
21787
|
const dataSets = [];
|
|
21767
21788
|
for (const dataSet of definition.dataSets) {
|
|
21768
21789
|
const newDataSet = { ...dataSet };
|
|
21769
|
-
const adaptedRange = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
21770
|
-
if (
|
|
21790
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
21791
|
+
if (changeType !== "REMOVE") {
|
|
21771
21792
|
newDataSet.dataRange = adaptedRange;
|
|
21772
21793
|
dataSets.push(newDataSet);
|
|
21773
21794
|
}
|
|
@@ -23145,14 +23166,14 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
23145
23166
|
let baseline;
|
|
23146
23167
|
let keyValue;
|
|
23147
23168
|
if (definition.baseline) {
|
|
23148
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
23149
|
-
if (
|
|
23169
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
23170
|
+
if (changeType !== "REMOVE") {
|
|
23150
23171
|
baseline = adaptedRange;
|
|
23151
23172
|
}
|
|
23152
23173
|
}
|
|
23153
23174
|
if (definition.keyValue) {
|
|
23154
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
23155
|
-
if (
|
|
23175
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
23176
|
+
if (changeType !== "REMOVE") {
|
|
23156
23177
|
keyValue = adaptedRange;
|
|
23157
23178
|
}
|
|
23158
23179
|
}
|
|
@@ -23209,7 +23230,7 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
23209
23230
|
// This kind of graph is not exportable in Excel
|
|
23210
23231
|
return undefined;
|
|
23211
23232
|
}
|
|
23212
|
-
updateRanges(applyChange) {
|
|
23233
|
+
updateRanges({ applyChange }) {
|
|
23213
23234
|
const baseline = adaptChartRange(this.baseline, applyChange);
|
|
23214
23235
|
const keyValue = adaptChartRange(this.keyValue, applyChange);
|
|
23215
23236
|
if (this.baseline === baseline && this.keyValue === keyValue) {
|
|
@@ -26583,7 +26604,7 @@ class BarChart extends AbstractChart {
|
|
|
26583
26604
|
verticalAxis: getDefinedAxis(definition),
|
|
26584
26605
|
};
|
|
26585
26606
|
}
|
|
26586
|
-
updateRanges(applyChange) {
|
|
26607
|
+
updateRanges({ applyChange }) {
|
|
26587
26608
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
26588
26609
|
if (!isStale) {
|
|
26589
26610
|
return this;
|
|
@@ -27170,7 +27191,7 @@ class ComboChart extends AbstractChart {
|
|
|
27170
27191
|
verticalAxis: getDefinedAxis(definition),
|
|
27171
27192
|
};
|
|
27172
27193
|
}
|
|
27173
|
-
updateRanges(applyChange) {
|
|
27194
|
+
updateRanges({ applyChange }) {
|
|
27174
27195
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27175
27196
|
if (!isStale) {
|
|
27176
27197
|
return this;
|
|
@@ -27342,7 +27363,7 @@ class FunnelChart extends AbstractChart {
|
|
|
27342
27363
|
getDefinitionForExcel() {
|
|
27343
27364
|
return undefined;
|
|
27344
27365
|
}
|
|
27345
|
-
updateRanges(applyChange) {
|
|
27366
|
+
updateRanges({ applyChange }) {
|
|
27346
27367
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27347
27368
|
if (!isStale) {
|
|
27348
27369
|
return this;
|
|
@@ -27453,8 +27474,8 @@ class GaugeChart extends AbstractChart {
|
|
|
27453
27474
|
static transformDefinition(chartSheetId, definition, applyChange) {
|
|
27454
27475
|
let dataRange;
|
|
27455
27476
|
if (definition.dataRange) {
|
|
27456
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
27457
|
-
if (
|
|
27477
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
27478
|
+
if (changeType !== "REMOVE") {
|
|
27458
27479
|
dataRange = adaptedRange;
|
|
27459
27480
|
}
|
|
27460
27481
|
}
|
|
@@ -27529,13 +27550,9 @@ class GaugeChart extends AbstractChart {
|
|
|
27529
27550
|
: undefined,
|
|
27530
27551
|
};
|
|
27531
27552
|
}
|
|
27532
|
-
updateRanges(applyChange,
|
|
27553
|
+
updateRanges({ applyChange, adaptFormulaString }) {
|
|
27533
27554
|
const dataRange = adaptChartRange(this.dataRange, applyChange);
|
|
27534
|
-
const adaptFormula = (formula) =>
|
|
27535
|
-
applyChange,
|
|
27536
|
-
sheetId,
|
|
27537
|
-
sheetName: adaptSheetName,
|
|
27538
|
-
});
|
|
27555
|
+
const adaptFormula = (formula) => adaptFormulaString(this.sheetId, formula);
|
|
27539
27556
|
const sectionRule = adaptSectionRuleFormulas(this.sectionRule, adaptFormula);
|
|
27540
27557
|
const definition = this.getDefinitionWithSpecificRanges(dataRange, sectionRule);
|
|
27541
27558
|
return new GaugeChart(definition, this.sheetId, this.getters);
|
|
@@ -27757,7 +27774,7 @@ class GeoChart extends AbstractChart {
|
|
|
27757
27774
|
getDefinitionForExcel() {
|
|
27758
27775
|
return undefined;
|
|
27759
27776
|
}
|
|
27760
|
-
updateRanges(applyChange) {
|
|
27777
|
+
updateRanges({ applyChange }) {
|
|
27761
27778
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27762
27779
|
if (!isStale) {
|
|
27763
27780
|
return this;
|
|
@@ -27893,7 +27910,7 @@ class LineChart extends AbstractChart {
|
|
|
27893
27910
|
: undefined,
|
|
27894
27911
|
};
|
|
27895
27912
|
}
|
|
27896
|
-
updateRanges(applyChange) {
|
|
27913
|
+
updateRanges({ applyChange }) {
|
|
27897
27914
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27898
27915
|
if (!isStale) {
|
|
27899
27916
|
return this;
|
|
@@ -28053,7 +28070,7 @@ class PieChart extends AbstractChart {
|
|
|
28053
28070
|
labelRange,
|
|
28054
28071
|
};
|
|
28055
28072
|
}
|
|
28056
|
-
updateRanges(applyChange) {
|
|
28073
|
+
updateRanges({ applyChange }) {
|
|
28057
28074
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28058
28075
|
if (!isStale) {
|
|
28059
28076
|
return this;
|
|
@@ -28192,7 +28209,7 @@ class PyramidChart extends AbstractChart {
|
|
|
28192
28209
|
getDefinitionForExcel() {
|
|
28193
28210
|
return undefined;
|
|
28194
28211
|
}
|
|
28195
|
-
updateRanges(applyChange) {
|
|
28212
|
+
updateRanges({ applyChange }) {
|
|
28196
28213
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28197
28214
|
if (!isStale) {
|
|
28198
28215
|
return this;
|
|
@@ -28343,7 +28360,7 @@ class RadarChart extends AbstractChart {
|
|
|
28343
28360
|
labelRange,
|
|
28344
28361
|
};
|
|
28345
28362
|
}
|
|
28346
|
-
updateRanges(applyChange) {
|
|
28363
|
+
updateRanges({ applyChange }) {
|
|
28347
28364
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28348
28365
|
if (!isStale) {
|
|
28349
28366
|
return this;
|
|
@@ -28465,7 +28482,7 @@ class ScatterChart extends AbstractChart {
|
|
|
28465
28482
|
: undefined,
|
|
28466
28483
|
};
|
|
28467
28484
|
}
|
|
28468
|
-
updateRanges(applyChange) {
|
|
28485
|
+
updateRanges({ applyChange }) {
|
|
28469
28486
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28470
28487
|
if (!isStale) {
|
|
28471
28488
|
return this;
|
|
@@ -28630,7 +28647,7 @@ class SunburstChart extends AbstractChart {
|
|
|
28630
28647
|
getDefinitionForExcel() {
|
|
28631
28648
|
return undefined;
|
|
28632
28649
|
}
|
|
28633
|
-
updateRanges(applyChange) {
|
|
28650
|
+
updateRanges({ applyChange }) {
|
|
28634
28651
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28635
28652
|
if (!isStale) {
|
|
28636
28653
|
return this;
|
|
@@ -28778,7 +28795,7 @@ class TreeMapChart extends AbstractChart {
|
|
|
28778
28795
|
getDefinitionForExcel() {
|
|
28779
28796
|
return undefined;
|
|
28780
28797
|
}
|
|
28781
|
-
updateRanges(applyChange) {
|
|
28798
|
+
updateRanges({ applyChange }) {
|
|
28782
28799
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28783
28800
|
if (!isStale) {
|
|
28784
28801
|
return this;
|
|
@@ -28933,7 +28950,7 @@ class WaterfallChart extends AbstractChart {
|
|
|
28933
28950
|
// TODO: implement export excel
|
|
28934
28951
|
return undefined;
|
|
28935
28952
|
}
|
|
28936
|
-
updateRanges(applyChange) {
|
|
28953
|
+
updateRanges({ applyChange }) {
|
|
28937
28954
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28938
28955
|
if (!isStale) {
|
|
28939
28956
|
return this;
|
|
@@ -32641,7 +32658,6 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
32641
32658
|
});
|
|
32642
32659
|
}
|
|
32643
32660
|
handleEvent(event) {
|
|
32644
|
-
this.hideHelp();
|
|
32645
32661
|
const sheetId = this.getters.getActiveSheetId();
|
|
32646
32662
|
let unboundedZone;
|
|
32647
32663
|
if (event.options.unbounded) {
|
|
@@ -32995,6 +33011,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
32995
33011
|
this.colorIndexByRange = {};
|
|
32996
33012
|
this.hoveredTokens = [];
|
|
32997
33013
|
this.hoveredContentEvaluation = "";
|
|
33014
|
+
this.hideHelp();
|
|
32998
33015
|
}
|
|
32999
33016
|
/**
|
|
33000
33017
|
* Reset the current content to the active cell content
|
|
@@ -38616,6 +38633,7 @@ function extractStyle(data, content, styleId, formatId, borderId) {
|
|
|
38616
38633
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
38617
38634
|
: undefined,
|
|
38618
38635
|
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : undefined,
|
|
38636
|
+
shrinkToFit: style.wrapping === "clip" ? true : undefined,
|
|
38619
38637
|
},
|
|
38620
38638
|
};
|
|
38621
38639
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -38636,6 +38654,7 @@ function normalizeStyle(construct, styles) {
|
|
|
38636
38654
|
vertical: styles.alignment.vertical,
|
|
38637
38655
|
horizontal: styles.alignment.horizontal,
|
|
38638
38656
|
wrapText: styles.alignment.wrapText,
|
|
38657
|
+
shrinkToFit: styles.alignment.shrinkToFit,
|
|
38639
38658
|
},
|
|
38640
38659
|
};
|
|
38641
38660
|
return pushElement(style, construct.styles);
|
|
@@ -50819,7 +50838,7 @@ class GaugeChartConfigPanel extends Component {
|
|
|
50819
50838
|
});
|
|
50820
50839
|
dataRange = this.props.definition.dataRange;
|
|
50821
50840
|
get configurationErrorMessages() {
|
|
50822
|
-
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])];
|
|
50841
|
+
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
50823
50842
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
50824
50843
|
}
|
|
50825
50844
|
get isDataRangeInvalid() {
|
|
@@ -50904,7 +50923,7 @@ class GaugeChartDesignPanel extends Component {
|
|
|
50904
50923
|
});
|
|
50905
50924
|
}
|
|
50906
50925
|
get designErrorMessages() {
|
|
50907
|
-
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])];
|
|
50926
|
+
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
50908
50927
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
50909
50928
|
}
|
|
50910
50929
|
get isRangeMinInvalid() {
|
|
@@ -51269,7 +51288,7 @@ class ScorecardChartConfigPanel extends Component {
|
|
|
51269
51288
|
const cancelledReasons = [
|
|
51270
51289
|
...(this.state.keyValueDispatchResult?.reasons || []),
|
|
51271
51290
|
...(this.state.baselineDispatchResult?.reasons || []),
|
|
51272
|
-
];
|
|
51291
|
+
].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
51273
51292
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
51274
51293
|
}
|
|
51275
51294
|
get isKeyValueInvalid() {
|
|
@@ -56096,8 +56115,6 @@ function adaptPivotRange(range, applyChange) {
|
|
|
56096
56115
|
}
|
|
56097
56116
|
const change = applyChange(range);
|
|
56098
56117
|
switch (change.changeType) {
|
|
56099
|
-
case "NONE":
|
|
56100
|
-
return range;
|
|
56101
56118
|
case "REMOVE":
|
|
56102
56119
|
return undefined;
|
|
56103
56120
|
default:
|
|
@@ -58915,7 +58932,7 @@ class CorePlugin extends BasePlugin {
|
|
|
58915
58932
|
* @param sheetId an sheetId to adapt either range of that sheet specifically, or ranges pointing to that sheet
|
|
58916
58933
|
* @param sheetName couple of old and new sheet names to adapt ranges pointing to that sheet
|
|
58917
58934
|
*/
|
|
58918
|
-
adaptRanges(
|
|
58935
|
+
adaptRanges(rangeAdapterFunctions, sheetId, sheetName) { }
|
|
58919
58936
|
/**
|
|
58920
58937
|
* Implement this method to clean unused external resources, such as images
|
|
58921
58938
|
* stored on a server which have been deleted.
|
|
@@ -59511,7 +59528,7 @@ class CellPlugin extends CorePlugin {
|
|
|
59511
59528
|
];
|
|
59512
59529
|
nextId = 1;
|
|
59513
59530
|
cells = {};
|
|
59514
|
-
adaptRanges(applyChange, sheetId, sheetName) {
|
|
59531
|
+
adaptRanges({ applyChange }, sheetId, sheetName) {
|
|
59515
59532
|
for (const sheet of Object.keys(this.cells)) {
|
|
59516
59533
|
for (const cell of Object.values(this.cells[sheet] || {})) {
|
|
59517
59534
|
if (cell.isFormula) {
|
|
@@ -59733,7 +59750,7 @@ class CellPlugin extends CorePlugin {
|
|
|
59733
59750
|
for (const position of positions) {
|
|
59734
59751
|
const cell = this.getters.getCell(position);
|
|
59735
59752
|
const xc = toXC(position.col, position.row);
|
|
59736
|
-
const style = this.
|
|
59753
|
+
const style = this.extractCustomStyle(cell);
|
|
59737
59754
|
if (Object.keys(style).length) {
|
|
59738
59755
|
const styleId = getItemId(style, styles);
|
|
59739
59756
|
positionsByStyle[styleId] ??= [];
|
|
@@ -59779,10 +59796,14 @@ class CellPlugin extends CorePlugin {
|
|
|
59779
59796
|
}
|
|
59780
59797
|
}
|
|
59781
59798
|
}
|
|
59782
|
-
|
|
59783
|
-
const cleanedStyle = { ...style };
|
|
59784
|
-
|
|
59785
|
-
|
|
59799
|
+
extractCustomStyle(cell) {
|
|
59800
|
+
const cleanedStyle = { ...cell.style };
|
|
59801
|
+
const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
|
|
59802
|
+
? DEFAULT_NUMBER_STYLE
|
|
59803
|
+
: DEFAULT_STYLE;
|
|
59804
|
+
for (const property in cleanedStyle) {
|
|
59805
|
+
if ((property !== "align" || !cell.isFormula) &&
|
|
59806
|
+
cleanedStyle[property] === defaultStyle[property]) {
|
|
59786
59807
|
delete cleanedStyle[property];
|
|
59787
59808
|
}
|
|
59788
59809
|
}
|
|
@@ -60132,9 +60153,9 @@ class ChartPlugin extends CorePlugin {
|
|
|
60132
60153
|
charts = {};
|
|
60133
60154
|
createChart = chartFactory(this.getters);
|
|
60134
60155
|
validateChartDefinition = (cmd) => validateChartDefinition(this, cmd.definition);
|
|
60135
|
-
adaptRanges(
|
|
60156
|
+
adaptRanges(rangeAdapters) {
|
|
60136
60157
|
for (const [chartId, chart] of Object.entries(this.charts)) {
|
|
60137
|
-
this.history.update("charts", chartId, chart?.updateRanges(
|
|
60158
|
+
this.history.update("charts", chartId, chart?.updateRanges(rangeAdapters));
|
|
60138
60159
|
}
|
|
60139
60160
|
}
|
|
60140
60161
|
// ---------------------------------------------------------------------------
|
|
@@ -60324,7 +60345,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
60324
60345
|
"getAdaptedCfRanges",
|
|
60325
60346
|
];
|
|
60326
60347
|
cfRules = {};
|
|
60327
|
-
adaptCFFormulas(applyChange) {
|
|
60348
|
+
adaptCFFormulas({ applyChange, adaptFormulaString }) {
|
|
60328
60349
|
for (const sheetId in this.cfRules) {
|
|
60329
60350
|
for (const rule of this.cfRules[sheetId]) {
|
|
60330
60351
|
if (rule.rule.type === "DataBarRule" && rule.rule.rangeValues) {
|
|
@@ -60348,7 +60369,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
60348
60369
|
for (let i = 0; i < rule.rule.values.length; i++) {
|
|
60349
60370
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
60350
60371
|
//@ts-expect-error
|
|
60351
|
-
"values", i,
|
|
60372
|
+
"values", i, adaptFormulaString(sheetId, rule.rule.values[i]));
|
|
60352
60373
|
}
|
|
60353
60374
|
}
|
|
60354
60375
|
else if (rule.rule.type === "IconSetRule") {
|
|
@@ -60356,7 +60377,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
60356
60377
|
if (rule.rule[inflectionPoint].type === "formula") {
|
|
60357
60378
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
60358
60379
|
//@ts-expect-error
|
|
60359
|
-
inflectionPoint, "value",
|
|
60380
|
+
inflectionPoint, "value", adaptFormulaString(sheetId, rule.rule[inflectionPoint].value));
|
|
60360
60381
|
}
|
|
60361
60382
|
}
|
|
60362
60383
|
}
|
|
@@ -60366,14 +60387,14 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
60366
60387
|
if (ruleValue?.type === "formula" && ruleValue?.value) {
|
|
60367
60388
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
60368
60389
|
//@ts-expect-error
|
|
60369
|
-
value, "value",
|
|
60390
|
+
value, "value", adaptFormulaString(sheetId, ruleValue.value));
|
|
60370
60391
|
}
|
|
60371
60392
|
}
|
|
60372
60393
|
}
|
|
60373
60394
|
}
|
|
60374
60395
|
}
|
|
60375
60396
|
}
|
|
60376
|
-
adaptCFRanges(sheetId, applyChange) {
|
|
60397
|
+
adaptCFRanges(sheetId, { applyChange }) {
|
|
60377
60398
|
for (const rule of this.cfRules[sheetId]) {
|
|
60378
60399
|
for (const range of rule.ranges) {
|
|
60379
60400
|
const change = applyChange(range);
|
|
@@ -60397,12 +60418,12 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
60397
60418
|
}
|
|
60398
60419
|
}
|
|
60399
60420
|
}
|
|
60400
|
-
adaptRanges(
|
|
60421
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
60401
60422
|
const sheetIds = sheetId ? [sheetId] : Object.keys(this.cfRules);
|
|
60402
60423
|
for (const sheetId of sheetIds) {
|
|
60403
|
-
this.adaptCFRanges(sheetId,
|
|
60424
|
+
this.adaptCFRanges(sheetId, rangeAdapters);
|
|
60404
60425
|
}
|
|
60405
|
-
this.adaptCFFormulas(
|
|
60426
|
+
this.adaptCFFormulas(rangeAdapters);
|
|
60406
60427
|
}
|
|
60407
60428
|
// ---------------------------------------------------------------------------
|
|
60408
60429
|
// Command Handling
|
|
@@ -60779,23 +60800,23 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
60779
60800
|
"getValidationRuleForCell",
|
|
60780
60801
|
];
|
|
60781
60802
|
rules = {};
|
|
60782
|
-
adaptRanges(
|
|
60783
|
-
this.adaptDVRanges(sheetId,
|
|
60784
|
-
this.adaptDVFormulas(
|
|
60803
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
60804
|
+
this.adaptDVRanges(sheetId, rangeAdapters);
|
|
60805
|
+
this.adaptDVFormulas(rangeAdapters);
|
|
60785
60806
|
}
|
|
60786
|
-
adaptDVFormulas(
|
|
60807
|
+
adaptDVFormulas({ adaptFormulaString }) {
|
|
60787
60808
|
for (const sheetId in this.rules) {
|
|
60788
60809
|
const rules = this.rules[sheetId];
|
|
60789
60810
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
60790
60811
|
const rule = this.rules[sheetId][ruleIndex];
|
|
60791
60812
|
for (let valueIndex = 0; valueIndex < rule.criterion.values.length; valueIndex++) {
|
|
60792
|
-
const value =
|
|
60813
|
+
const value = adaptFormulaString(sheetId, rule.criterion.values[valueIndex]);
|
|
60793
60814
|
this.history.update("rules", sheetId, ruleIndex, "criterion", "values", valueIndex, value);
|
|
60794
60815
|
}
|
|
60795
60816
|
}
|
|
60796
60817
|
}
|
|
60797
60818
|
}
|
|
60798
|
-
adaptDVRanges(sheetId, applyChange) {
|
|
60819
|
+
adaptDVRanges(sheetId, { applyChange }) {
|
|
60799
60820
|
const rules = this.rules[sheetId];
|
|
60800
60821
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
60801
60822
|
const rule = this.rules[sheetId][ruleIndex];
|
|
@@ -61069,7 +61090,7 @@ class FigurePlugin extends CorePlugin {
|
|
|
61069
61090
|
// ---------------------------------------------------------------------------
|
|
61070
61091
|
// Command Handling
|
|
61071
61092
|
// ---------------------------------------------------------------------------
|
|
61072
|
-
adaptRanges(applyChange, sheetId) {
|
|
61093
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
61073
61094
|
for (const figure of this.getFigures(sheetId)) {
|
|
61074
61095
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, {
|
|
61075
61096
|
left: figure.col,
|
|
@@ -61877,8 +61898,8 @@ class MergePlugin extends CorePlugin {
|
|
|
61877
61898
|
break;
|
|
61878
61899
|
}
|
|
61879
61900
|
}
|
|
61880
|
-
adaptRanges(
|
|
61881
|
-
this.applyRangeChangeOnSheet(sheetId,
|
|
61901
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
61902
|
+
this.applyRangeChangeOnSheet(sheetId, rangeAdapters);
|
|
61882
61903
|
}
|
|
61883
61904
|
// ---------------------------------------------------------------------------
|
|
61884
61905
|
// Getters
|
|
@@ -62180,7 +62201,7 @@ class MergePlugin extends CorePlugin {
|
|
|
62180
62201
|
/**
|
|
62181
62202
|
* Apply a range change on merges of a particular sheet.
|
|
62182
62203
|
*/
|
|
62183
|
-
applyRangeChangeOnSheet(sheetId, applyChange) {
|
|
62204
|
+
applyRangeChangeOnSheet(sheetId, { applyChange }) {
|
|
62184
62205
|
const merges = Object.entries(this.merges[sheetId] || {});
|
|
62185
62206
|
for (const [mergeId, range] of merges) {
|
|
62186
62207
|
if (range) {
|
|
@@ -62254,7 +62275,7 @@ function rangeToMerge(mergeId, range) {
|
|
|
62254
62275
|
};
|
|
62255
62276
|
}
|
|
62256
62277
|
|
|
62257
|
-
class
|
|
62278
|
+
class RangeAdapterPlugin {
|
|
62258
62279
|
getters;
|
|
62259
62280
|
providers = [];
|
|
62260
62281
|
isAdaptingRanges = false;
|
|
@@ -62262,7 +62283,6 @@ class RangeAdapter {
|
|
|
62262
62283
|
this.getters = getters;
|
|
62263
62284
|
}
|
|
62264
62285
|
static getters = [
|
|
62265
|
-
"adaptFormulaStringDependencies",
|
|
62266
62286
|
"copyFormulaStringForSheet",
|
|
62267
62287
|
"extendRange",
|
|
62268
62288
|
"getRangeString",
|
|
@@ -62293,8 +62313,8 @@ class RangeAdapter {
|
|
|
62293
62313
|
throw new Error("Plugins cannot dispatch commands during adaptRanges phase");
|
|
62294
62314
|
}
|
|
62295
62315
|
const rangeAdapter = getRangeAdapter(cmd);
|
|
62296
|
-
if (rangeAdapter
|
|
62297
|
-
this.executeOnAllRanges(rangeAdapter
|
|
62316
|
+
if (rangeAdapter) {
|
|
62317
|
+
this.executeOnAllRanges(rangeAdapter);
|
|
62298
62318
|
}
|
|
62299
62319
|
}
|
|
62300
62320
|
finalize() { }
|
|
@@ -62313,11 +62333,15 @@ class RangeAdapter {
|
|
|
62313
62333
|
return result;
|
|
62314
62334
|
};
|
|
62315
62335
|
}
|
|
62316
|
-
executeOnAllRanges(
|
|
62336
|
+
executeOnAllRanges(rangeAdapter) {
|
|
62317
62337
|
this.isAdaptingRanges = true;
|
|
62318
|
-
const
|
|
62338
|
+
const adapterFunctions = {
|
|
62339
|
+
applyChange: this.verifyRangeRemoved(rangeAdapter.applyChange),
|
|
62340
|
+
adaptRangeString: (defaultSheetId, sheetXC) => adaptStringRange(defaultSheetId, sheetXC, rangeAdapter),
|
|
62341
|
+
adaptFormulaString: (defaultSheetId, formula) => adaptFormulaStringRanges(defaultSheetId, formula, rangeAdapter),
|
|
62342
|
+
};
|
|
62319
62343
|
for (const provider of this.providers) {
|
|
62320
|
-
provider(
|
|
62344
|
+
provider(adapterFunctions, rangeAdapter.sheetId, rangeAdapter.sheetName);
|
|
62321
62345
|
}
|
|
62322
62346
|
this.isAdaptingRanges = false;
|
|
62323
62347
|
}
|
|
@@ -62485,18 +62509,6 @@ class RangeAdapter {
|
|
|
62485
62509
|
const unionOfZones = unionUnboundedZones(...zones);
|
|
62486
62510
|
return this.getRangeFromZone(ranges[0].sheetId, unionOfZones);
|
|
62487
62511
|
}
|
|
62488
|
-
adaptFormulaStringDependencies(sheetId, formula, applyChange) {
|
|
62489
|
-
if (!formula.startsWith("=")) {
|
|
62490
|
-
return formula;
|
|
62491
|
-
}
|
|
62492
|
-
const compiledFormula = compile(formula);
|
|
62493
|
-
const updatedDependencies = compiledFormula.dependencies.map((dep) => {
|
|
62494
|
-
const range = this.getters.getRangeFromSheetXC(sheetId, dep);
|
|
62495
|
-
const changedRange = applyChange(range);
|
|
62496
|
-
return changedRange.changeType === "NONE" ? range : changedRange.range;
|
|
62497
|
-
});
|
|
62498
|
-
return this.getters.getFormulaString(sheetId, compiledFormula.tokens, updatedDependencies);
|
|
62499
|
-
}
|
|
62500
62512
|
/**
|
|
62501
62513
|
* Copy a formula string to another sheet.
|
|
62502
62514
|
*
|
|
@@ -63389,7 +63401,7 @@ class TablePlugin extends CorePlugin {
|
|
|
63389
63401
|
static getters = ["getCoreTable", "getCoreTables", "getCoreTableMatchingTopLeft"];
|
|
63390
63402
|
tables = {};
|
|
63391
63403
|
nextTableId = 1;
|
|
63392
|
-
adaptRanges(applyChange, sheetId) {
|
|
63404
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
63393
63405
|
for (const table of this.getCoreTables(sheetId)) {
|
|
63394
63406
|
this.applyRangeChangeOnTable(sheetId, table, applyChange);
|
|
63395
63407
|
}
|
|
@@ -64355,7 +64367,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64355
64367
|
}
|
|
64356
64368
|
}
|
|
64357
64369
|
}
|
|
64358
|
-
adaptRanges(applyChange) {
|
|
64370
|
+
adaptRanges({ applyChange, adaptFormulaString }) {
|
|
64359
64371
|
for (const pivotId in this.pivots) {
|
|
64360
64372
|
const definition = deepCopy(this.pivots[pivotId]?.definition);
|
|
64361
64373
|
if (!definition) {
|
|
@@ -64375,19 +64387,13 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64375
64387
|
continue;
|
|
64376
64388
|
}
|
|
64377
64389
|
const sheetId = measure.computedBy.sheetId;
|
|
64378
|
-
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId]
|
|
64379
|
-
|
|
64380
|
-
|
|
64381
|
-
|
|
64382
|
-
|
|
64383
|
-
newDependencies.push(range);
|
|
64384
|
-
}
|
|
64385
|
-
else {
|
|
64386
|
-
newDependencies.push(change.range);
|
|
64387
|
-
}
|
|
64388
|
-
}
|
|
64389
|
-
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
64390
|
+
const { formula: compiledFormula, dependencies: indirectDependencies } = this.compiledMeasureFormulas[pivotId][measureId];
|
|
64391
|
+
// adapt direct dependencies
|
|
64392
|
+
this.history.update("compiledMeasureFormulas", pivotId, measureId, "formula", "dependencies", compiledFormula.dependencies.map((range) => applyChange(range).range));
|
|
64393
|
+
// adapt all dependencies (including indirect)
|
|
64394
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", indirectDependencies.map((range) => applyChange(range).range));
|
|
64390
64395
|
const oldFormulaString = measure.computedBy.formula;
|
|
64396
|
+
const newFormulaString = adaptFormulaString(sheetId, oldFormulaString);
|
|
64391
64397
|
if (newFormulaString !== oldFormulaString) {
|
|
64392
64398
|
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
64393
64399
|
}
|
|
@@ -64549,7 +64555,6 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64549
64555
|
formula: newFormulaString,
|
|
64550
64556
|
sheetId: measure.computedBy.sheetId,
|
|
64551
64557
|
});
|
|
64552
|
-
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
64553
64558
|
}
|
|
64554
64559
|
checkSortedColumnInMeasures(definition) {
|
|
64555
64560
|
const measures = definition.measures.map((measure) => measure.id);
|
|
@@ -65931,11 +65936,16 @@ class SpreadingRelation {
|
|
|
65931
65936
|
return this.arrayFormulasToResults.get(formulasPosition);
|
|
65932
65937
|
}
|
|
65933
65938
|
/**
|
|
65934
|
-
* Remove a
|
|
65939
|
+
* Remove a spreading relation for a given array formula position
|
|
65940
|
+
* and its result zone
|
|
65935
65941
|
*/
|
|
65936
65942
|
removeNode(position) {
|
|
65943
|
+
const resultZone = this.arrayFormulasToResults.get(position);
|
|
65944
|
+
if (!resultZone) {
|
|
65945
|
+
return;
|
|
65946
|
+
}
|
|
65937
65947
|
this.resultsToArrayFormulas.remove({
|
|
65938
|
-
boundingBox: { sheetId: position.sheetId, zone:
|
|
65948
|
+
boundingBox: { sheetId: position.sheetId, zone: resultZone },
|
|
65939
65949
|
data: position,
|
|
65940
65950
|
});
|
|
65941
65951
|
this.arrayFormulasToResults.delete(position);
|
|
@@ -66223,6 +66233,10 @@ class Evaluator {
|
|
|
66223
66233
|
// empty matrix
|
|
66224
66234
|
return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
|
|
66225
66235
|
}
|
|
66236
|
+
if (nbRows === 1 && nbColumns === 1) {
|
|
66237
|
+
// single value matrix
|
|
66238
|
+
return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
|
|
66239
|
+
}
|
|
66226
66240
|
const resultZone = {
|
|
66227
66241
|
top: formulaPosition.row,
|
|
66228
66242
|
bottom: formulaPosition.row + nbRows - 1,
|
|
@@ -67909,6 +67923,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
67909
67923
|
handle(cmd) {
|
|
67910
67924
|
switch (cmd.type) {
|
|
67911
67925
|
case "START":
|
|
67926
|
+
case "UPDATE_LOCALE":
|
|
67912
67927
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
67913
67928
|
this.initializeSheet(sheetId);
|
|
67914
67929
|
}
|
|
@@ -68030,7 +68045,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
68030
68045
|
}
|
|
68031
68046
|
const cell = this.getters.getCell(position);
|
|
68032
68047
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
68033
|
-
return getDefaultCellHeight(this.ctx, cell, colSize);
|
|
68048
|
+
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
68034
68049
|
}
|
|
68035
68050
|
isInMultiRowMerge(position) {
|
|
68036
68051
|
const merge = this.getters.getMerge(position);
|
|
@@ -70339,7 +70354,7 @@ function addConditionalFormatCommandAdaptRange(cmd, applyChange) {
|
|
|
70339
70354
|
cmd.cf.rule = {
|
|
70340
70355
|
...rule,
|
|
70341
70356
|
rangeValues: rule.rangeValues
|
|
70342
|
-
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange)
|
|
70357
|
+
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange).range
|
|
70343
70358
|
: undefined,
|
|
70344
70359
|
};
|
|
70345
70360
|
}
|
|
@@ -83554,6 +83569,9 @@ function addStyles(styles) {
|
|
|
83554
83569
|
if (style.alignment && style.alignment.wrapText) {
|
|
83555
83570
|
alignAttrs.push(["wrapText", "1"]);
|
|
83556
83571
|
}
|
|
83572
|
+
if (style.alignment && style.alignment.shrinkToFit) {
|
|
83573
|
+
alignAttrs.push(["shrinkToFit", "1"]);
|
|
83574
|
+
}
|
|
83557
83575
|
if (alignAttrs.length > 0) {
|
|
83558
83576
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
83559
83577
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
@@ -84324,7 +84342,7 @@ class Model extends EventBus {
|
|
|
84324
84342
|
this.config = this.setupConfig(config);
|
|
84325
84343
|
this.session = this.setupSession(workbookData.revisionId);
|
|
84326
84344
|
this.coreGetters = {};
|
|
84327
|
-
this.range = new
|
|
84345
|
+
this.range = new RangeAdapterPlugin(this.coreGetters);
|
|
84328
84346
|
this.coreGetters.getRangeString = this.range.getRangeString.bind(this.range);
|
|
84329
84347
|
this.coreGetters.getRangeFromSheetXC = this.range.getRangeFromSheetXC.bind(this.range);
|
|
84330
84348
|
this.coreGetters.createAdaptedRanges = this.range.createAdaptedRanges.bind(this.range);
|
|
@@ -84338,8 +84356,6 @@ class Model extends EventBus {
|
|
|
84338
84356
|
this.coreGetters.extendRange = this.range.extendRange.bind(this.range);
|
|
84339
84357
|
this.coreGetters.getRangesUnion = this.range.getRangesUnion.bind(this.range);
|
|
84340
84358
|
this.coreGetters.removeRangesSheetPrefix = this.range.removeRangesSheetPrefix.bind(this.range);
|
|
84341
|
-
this.coreGetters.adaptFormulaStringDependencies =
|
|
84342
|
-
this.range.adaptFormulaStringDependencies.bind(this.range);
|
|
84343
84359
|
this.coreGetters.copyFormulaStringForSheet = this.range.copyFormulaStringForSheet.bind(this.range);
|
|
84344
84360
|
this.getters = {
|
|
84345
84361
|
isReadonly: () => this.config.mode === "readonly" || this.config.mode === "dashboard",
|
|
@@ -85014,6 +85030,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
85014
85030
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
85015
85031
|
|
|
85016
85032
|
|
|
85017
|
-
__info__.version = "18.4.
|
|
85018
|
-
__info__.date = "2026-01-
|
|
85019
|
-
__info__.hash = "
|
|
85033
|
+
__info__.version = "18.4.25";
|
|
85034
|
+
__info__.date = "2026-01-21T11:06:11.131Z";
|
|
85035
|
+
__info__.hash = "161472d";
|