@odoo/o-spreadsheet 18.3.32 → 18.3.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/o-spreadsheet.cjs.js +214 -198
- package/dist/o-spreadsheet.d.ts +224 -218
- package/dist/o-spreadsheet.esm.js +214 -198
- package/dist/o-spreadsheet.iife.js +214 -198
- package/dist/o-spreadsheet.iife.min.js +399 -399
- package/dist/o_spreadsheet.css +3 -3
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.3.
|
|
6
|
-
* @date 2026-01-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.33
|
|
6
|
+
* @date 2026-01-21T11:05:17.933Z
|
|
7
|
+
* @hash b7e5d91
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -32,7 +32,8 @@ function createAction(item) {
|
|
|
32
32
|
return children
|
|
33
33
|
.map((child) => (typeof child === "function" ? child(env) : child))
|
|
34
34
|
.flat()
|
|
35
|
-
.map(createAction)
|
|
35
|
+
.map(createAction)
|
|
36
|
+
.sort((a, b) => a.sequence - b.sequence);
|
|
36
37
|
}
|
|
37
38
|
: () => [],
|
|
38
39
|
isReadonlyAllowed: item.isReadonlyAllowed || false,
|
|
@@ -307,6 +308,7 @@ const DEFAULT_STYLE = {
|
|
|
307
308
|
fillColor: "",
|
|
308
309
|
textColor: "",
|
|
309
310
|
};
|
|
311
|
+
const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
|
|
310
312
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
311
313
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
312
314
|
// Fonts
|
|
@@ -6179,67 +6181,6 @@ function getFullReference(sheetName, xc) {
|
|
|
6179
6181
|
return sheetName !== undefined ? `${getCanonicalSymbolName(sheetName)}!${xc}` : xc;
|
|
6180
6182
|
}
|
|
6181
6183
|
|
|
6182
|
-
function createDefaultRows(rowNumber) {
|
|
6183
|
-
const rows = [];
|
|
6184
|
-
for (let i = 0; i < rowNumber; i++) {
|
|
6185
|
-
const row = {
|
|
6186
|
-
cells: {},
|
|
6187
|
-
};
|
|
6188
|
-
rows.push(row);
|
|
6189
|
-
}
|
|
6190
|
-
return rows;
|
|
6191
|
-
}
|
|
6192
|
-
function moveHeaderIndexesOnHeaderAddition(indexHeaderAdded, numberAdded, headers) {
|
|
6193
|
-
return headers.map((header) => {
|
|
6194
|
-
if (header >= indexHeaderAdded) {
|
|
6195
|
-
return header + numberAdded;
|
|
6196
|
-
}
|
|
6197
|
-
return header;
|
|
6198
|
-
});
|
|
6199
|
-
}
|
|
6200
|
-
function moveHeaderIndexesOnHeaderDeletion(deletedHeaders, headers) {
|
|
6201
|
-
deletedHeaders = [...deletedHeaders].sort((a, b) => b - a);
|
|
6202
|
-
return headers
|
|
6203
|
-
.map((header) => {
|
|
6204
|
-
for (const deletedHeader of deletedHeaders) {
|
|
6205
|
-
if (header > deletedHeader) {
|
|
6206
|
-
header--;
|
|
6207
|
-
}
|
|
6208
|
-
else if (header === deletedHeader) {
|
|
6209
|
-
return undefined;
|
|
6210
|
-
}
|
|
6211
|
-
}
|
|
6212
|
-
return header;
|
|
6213
|
-
})
|
|
6214
|
-
.filter(isDefined);
|
|
6215
|
-
}
|
|
6216
|
-
function getNextSheetName(existingNames, baseName = "Sheet") {
|
|
6217
|
-
let i = 1;
|
|
6218
|
-
let name = `${baseName}${i}`;
|
|
6219
|
-
while (existingNames.includes(name)) {
|
|
6220
|
-
name = `${baseName}${i}`;
|
|
6221
|
-
i++;
|
|
6222
|
-
}
|
|
6223
|
-
return name;
|
|
6224
|
-
}
|
|
6225
|
-
function getDuplicateSheetName(nameToDuplicate, existingNames) {
|
|
6226
|
-
let i = 1;
|
|
6227
|
-
const baseName = _t("Copy of %s", nameToDuplicate);
|
|
6228
|
-
let name = baseName.toString();
|
|
6229
|
-
while (existingNames.includes(name)) {
|
|
6230
|
-
name = `${baseName} (${i})`;
|
|
6231
|
-
i++;
|
|
6232
|
-
}
|
|
6233
|
-
return name;
|
|
6234
|
-
}
|
|
6235
|
-
function isSheetNameEqual(name1, name2) {
|
|
6236
|
-
if (name1 === undefined || name2 === undefined) {
|
|
6237
|
-
return false;
|
|
6238
|
-
}
|
|
6239
|
-
return (getUnquotedSheetName(name1.trim().toUpperCase()) ===
|
|
6240
|
-
getUnquotedSheetName(name2.trim().toUpperCase()));
|
|
6241
|
-
}
|
|
6242
|
-
|
|
6243
6184
|
function createRange(args, getSheetSize) {
|
|
6244
6185
|
const unboundedZone = args.zone;
|
|
6245
6186
|
const zone = boundUnboundedZone(unboundedZone, getSheetSize(args.sheetId));
|
|
@@ -6534,8 +6475,8 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
6534
6475
|
elements.sort((a, b) => b - a);
|
|
6535
6476
|
const groups = groupConsecutive(elements);
|
|
6536
6477
|
return (range) => {
|
|
6537
|
-
if (
|
|
6538
|
-
return { changeType: "NONE" };
|
|
6478
|
+
if (range.sheetId !== cmd.sheetId) {
|
|
6479
|
+
return { changeType: "NONE", range };
|
|
6539
6480
|
}
|
|
6540
6481
|
let newRange = range;
|
|
6541
6482
|
let changeType = "NONE";
|
|
@@ -6562,10 +6503,7 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
6562
6503
|
newRange = createAdaptedRange(newRange, dimension, changeType, -(max - min + 1));
|
|
6563
6504
|
}
|
|
6564
6505
|
}
|
|
6565
|
-
|
|
6566
|
-
return { changeType, range: newRange };
|
|
6567
|
-
}
|
|
6568
|
-
return { changeType: "NONE" };
|
|
6506
|
+
return { changeType, range: newRange };
|
|
6569
6507
|
};
|
|
6570
6508
|
}
|
|
6571
6509
|
function getApplyRangeChangeAddColRow(cmd) {
|
|
@@ -6574,7 +6512,7 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
6574
6512
|
let dimension = cmd.dimension === "COL" ? "columns" : "rows";
|
|
6575
6513
|
return (range) => {
|
|
6576
6514
|
if (range.sheetId !== cmd.sheetId) {
|
|
6577
|
-
return { changeType: "NONE" };
|
|
6515
|
+
return { changeType: "NONE", range };
|
|
6578
6516
|
}
|
|
6579
6517
|
if (cmd.position === "after") {
|
|
6580
6518
|
if (range.zone[start] <= cmd.base && cmd.base < range.zone[end]) {
|
|
@@ -6604,13 +6542,13 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
6604
6542
|
};
|
|
6605
6543
|
}
|
|
6606
6544
|
}
|
|
6607
|
-
return { changeType: "NONE" };
|
|
6545
|
+
return { changeType: "NONE", range };
|
|
6608
6546
|
};
|
|
6609
6547
|
}
|
|
6610
6548
|
function getApplyRangeChangeDeleteSheet(cmd) {
|
|
6611
6549
|
return (range) => {
|
|
6612
6550
|
if (range.sheetId !== cmd.sheetId && range.invalidSheetName !== cmd.sheetName) {
|
|
6613
|
-
return { changeType: "NONE" };
|
|
6551
|
+
return { changeType: "NONE", range };
|
|
6614
6552
|
}
|
|
6615
6553
|
const invalidSheetName = cmd.sheetName;
|
|
6616
6554
|
range = {
|
|
@@ -6637,14 +6575,14 @@ function getApplyRangeChangeRenameSheet(cmd) {
|
|
|
6637
6575
|
const newRange = { ...range, sheetId, invalidSheetName };
|
|
6638
6576
|
return { changeType: "CHANGE", range: newRange };
|
|
6639
6577
|
}
|
|
6640
|
-
return { changeType: "NONE" };
|
|
6578
|
+
return { changeType: "NONE", range };
|
|
6641
6579
|
};
|
|
6642
6580
|
}
|
|
6643
6581
|
function getApplyRangeChangeMoveRange(cmd) {
|
|
6644
6582
|
const originZone = cmd.target[0];
|
|
6645
6583
|
return (range) => {
|
|
6646
6584
|
if (range.sheetId !== cmd.sheetId || !isZoneInside(range.zone, originZone)) {
|
|
6647
|
-
return { changeType: "NONE" };
|
|
6585
|
+
return { changeType: "NONE", range };
|
|
6648
6586
|
}
|
|
6649
6587
|
const targetSheetId = cmd.targetSheetId;
|
|
6650
6588
|
const offsetX = cmd.col - originZone.left;
|
|
@@ -6741,17 +6679,87 @@ function fuzzyLookup(pattern, list, fn) {
|
|
|
6741
6679
|
return results.map((r) => r.elem);
|
|
6742
6680
|
}
|
|
6743
6681
|
|
|
6682
|
+
function createDefaultRows(rowNumber) {
|
|
6683
|
+
const rows = [];
|
|
6684
|
+
for (let i = 0; i < rowNumber; i++) {
|
|
6685
|
+
const row = {
|
|
6686
|
+
cells: {},
|
|
6687
|
+
};
|
|
6688
|
+
rows.push(row);
|
|
6689
|
+
}
|
|
6690
|
+
return rows;
|
|
6691
|
+
}
|
|
6692
|
+
function moveHeaderIndexesOnHeaderAddition(indexHeaderAdded, numberAdded, headers) {
|
|
6693
|
+
return headers.map((header) => {
|
|
6694
|
+
if (header >= indexHeaderAdded) {
|
|
6695
|
+
return header + numberAdded;
|
|
6696
|
+
}
|
|
6697
|
+
return header;
|
|
6698
|
+
});
|
|
6699
|
+
}
|
|
6700
|
+
function moveHeaderIndexesOnHeaderDeletion(deletedHeaders, headers) {
|
|
6701
|
+
deletedHeaders = [...deletedHeaders].sort((a, b) => b - a);
|
|
6702
|
+
return headers
|
|
6703
|
+
.map((header) => {
|
|
6704
|
+
for (const deletedHeader of deletedHeaders) {
|
|
6705
|
+
if (header > deletedHeader) {
|
|
6706
|
+
header--;
|
|
6707
|
+
}
|
|
6708
|
+
else if (header === deletedHeader) {
|
|
6709
|
+
return undefined;
|
|
6710
|
+
}
|
|
6711
|
+
}
|
|
6712
|
+
return header;
|
|
6713
|
+
})
|
|
6714
|
+
.filter(isDefined);
|
|
6715
|
+
}
|
|
6716
|
+
function getNextSheetName(existingNames, baseName = "Sheet") {
|
|
6717
|
+
let i = 1;
|
|
6718
|
+
let name = `${baseName}${i}`;
|
|
6719
|
+
while (existingNames.includes(name)) {
|
|
6720
|
+
name = `${baseName}${i}`;
|
|
6721
|
+
i++;
|
|
6722
|
+
}
|
|
6723
|
+
return name;
|
|
6724
|
+
}
|
|
6725
|
+
function getDuplicateSheetName(nameToDuplicate, existingNames) {
|
|
6726
|
+
let i = 1;
|
|
6727
|
+
const baseName = _t("Copy of %s", nameToDuplicate);
|
|
6728
|
+
let name = baseName.toString();
|
|
6729
|
+
while (existingNames.includes(name)) {
|
|
6730
|
+
name = `${baseName} (${i})`;
|
|
6731
|
+
i++;
|
|
6732
|
+
}
|
|
6733
|
+
return name;
|
|
6734
|
+
}
|
|
6735
|
+
function isSheetNameEqual(name1, name2) {
|
|
6736
|
+
if (name1 === undefined || name2 === undefined) {
|
|
6737
|
+
return false;
|
|
6738
|
+
}
|
|
6739
|
+
return (getUnquotedSheetName(name1.trim().toUpperCase()) ===
|
|
6740
|
+
getUnquotedSheetName(name2.trim().toUpperCase()));
|
|
6741
|
+
}
|
|
6742
|
+
|
|
6744
6743
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
6745
6744
|
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
6746
6745
|
}
|
|
6747
6746
|
/**
|
|
6748
6747
|
* Get the default height of the cell given its style.
|
|
6749
6748
|
*/
|
|
6750
|
-
function getDefaultCellHeight(ctx, cell, colSize) {
|
|
6749
|
+
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
6751
6750
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
6752
6751
|
return DEFAULT_CELL_HEIGHT;
|
|
6753
6752
|
}
|
|
6754
|
-
|
|
6753
|
+
let content = "";
|
|
6754
|
+
try {
|
|
6755
|
+
if (!cell.isFormula) {
|
|
6756
|
+
const localeFormat = { format: cell.format, locale };
|
|
6757
|
+
content = formatValue(parseLiteral(cell.content, locale), localeFormat);
|
|
6758
|
+
}
|
|
6759
|
+
}
|
|
6760
|
+
catch {
|
|
6761
|
+
content = CellErrorType.GenericError;
|
|
6762
|
+
}
|
|
6755
6763
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
6756
6764
|
}
|
|
6757
6765
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
@@ -20184,7 +20192,16 @@ function createComputeFunction(descr) {
|
|
|
20184
20192
|
}
|
|
20185
20193
|
acceptToVectorize.push(!argDefinition.acceptMatrix);
|
|
20186
20194
|
}
|
|
20187
|
-
return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
|
|
20195
|
+
return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
|
|
20196
|
+
}
|
|
20197
|
+
function replaceErrorPlaceholderInResult(result) {
|
|
20198
|
+
if (!isMatrix(result)) {
|
|
20199
|
+
replaceFunctionNamePlaceholder(result, descr.name);
|
|
20200
|
+
}
|
|
20201
|
+
else {
|
|
20202
|
+
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
20203
|
+
}
|
|
20204
|
+
return result;
|
|
20188
20205
|
}
|
|
20189
20206
|
function errorHandlingCompute(...args) {
|
|
20190
20207
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -20212,13 +20229,12 @@ function createComputeFunction(descr) {
|
|
|
20212
20229
|
const result = descr.compute.apply(this, args);
|
|
20213
20230
|
if (!isMatrix(result)) {
|
|
20214
20231
|
if (typeof result === "object" && result !== null && "value" in result) {
|
|
20215
|
-
replaceFunctionNamePlaceholder(result, descr.name);
|
|
20216
20232
|
return result;
|
|
20217
20233
|
}
|
|
20234
|
+
descr.name;
|
|
20218
20235
|
return { value: result };
|
|
20219
20236
|
}
|
|
20220
20237
|
if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
|
|
20221
|
-
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
20222
20238
|
return result;
|
|
20223
20239
|
}
|
|
20224
20240
|
return matrixMap(result, (row) => ({ value: row }));
|
|
@@ -20670,7 +20686,7 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
20670
20686
|
continue;
|
|
20671
20687
|
}
|
|
20672
20688
|
const sheetXC = tokens[tokenIdx].value;
|
|
20673
|
-
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange);
|
|
20689
|
+
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange).range;
|
|
20674
20690
|
if (sheetXC !== newSheetXC) {
|
|
20675
20691
|
tokens[tokenIdx] = {
|
|
20676
20692
|
value: newSheetXC,
|
|
@@ -20680,23 +20696,30 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
20680
20696
|
}
|
|
20681
20697
|
return concat(tokens.map((token) => token.value));
|
|
20682
20698
|
}
|
|
20683
|
-
function adaptStringRange(defaultSheetId, sheetXC,
|
|
20699
|
+
function adaptStringRange(defaultSheetId, sheetXC, rangeAdapter) {
|
|
20684
20700
|
const sheetName = splitReference(sheetXC).sheetName;
|
|
20685
20701
|
if (sheetName
|
|
20686
|
-
? !isSheetNameEqual(sheetName,
|
|
20687
|
-
: defaultSheetId !==
|
|
20688
|
-
return sheetXC;
|
|
20702
|
+
? !isSheetNameEqual(sheetName, rangeAdapter.sheetName.old)
|
|
20703
|
+
: defaultSheetId !== rangeAdapter.sheetId) {
|
|
20704
|
+
return { changeType: "NONE", range: sheetXC };
|
|
20689
20705
|
}
|
|
20690
|
-
const sheetId = sheetName ?
|
|
20706
|
+
const sheetId = sheetName ? rangeAdapter.sheetId : defaultSheetId;
|
|
20691
20707
|
const range = getRange(sheetXC, sheetId);
|
|
20692
20708
|
if (range.invalidXc) {
|
|
20693
|
-
return sheetXC;
|
|
20709
|
+
return { changeType: "NONE", range: sheetXC };
|
|
20694
20710
|
}
|
|
20695
|
-
const change =
|
|
20711
|
+
const change = rangeAdapter.applyChange(range);
|
|
20696
20712
|
if (change.changeType === "NONE" || change.changeType === "REMOVE") {
|
|
20697
|
-
return sheetXC;
|
|
20713
|
+
return { changeType: change.changeType, range: sheetXC };
|
|
20714
|
+
}
|
|
20715
|
+
const rangeStr = getRangeString(change.range, defaultSheetId, getSheetNameGetter(rangeAdapter));
|
|
20716
|
+
if (rangeStr === CellErrorType.InvalidReference) {
|
|
20717
|
+
return { changeType: "REMOVE", range: rangeStr };
|
|
20698
20718
|
}
|
|
20699
|
-
return
|
|
20719
|
+
return {
|
|
20720
|
+
changeType: change.changeType,
|
|
20721
|
+
range: rangeStr,
|
|
20722
|
+
};
|
|
20700
20723
|
}
|
|
20701
20724
|
function getSheetNameGetter(applyChange) {
|
|
20702
20725
|
return (sheetId) => {
|
|
@@ -20795,8 +20818,6 @@ function adaptChartRange(range, applyChange) {
|
|
|
20795
20818
|
}
|
|
20796
20819
|
const change = applyChange(range);
|
|
20797
20820
|
switch (change.changeType) {
|
|
20798
|
-
case "NONE":
|
|
20799
|
-
return range;
|
|
20800
20821
|
case "REMOVE":
|
|
20801
20822
|
return undefined;
|
|
20802
20823
|
default:
|
|
@@ -20934,16 +20955,16 @@ function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
|
20934
20955
|
function transformChartDefinitionWithDataSetsWithZone(chartSheetId, definition, applyChange) {
|
|
20935
20956
|
let labelRange;
|
|
20936
20957
|
if (definition.labelRange) {
|
|
20937
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
20938
|
-
if (
|
|
20958
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
20959
|
+
if (changeType !== "REMOVE") {
|
|
20939
20960
|
labelRange = adaptedRange;
|
|
20940
20961
|
}
|
|
20941
20962
|
}
|
|
20942
20963
|
const dataSets = [];
|
|
20943
20964
|
for (const dataSet of definition.dataSets) {
|
|
20944
20965
|
const newDataSet = { ...dataSet };
|
|
20945
|
-
const adaptedRange = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
20946
|
-
if (
|
|
20966
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
20967
|
+
if (changeType !== "REMOVE") {
|
|
20947
20968
|
newDataSet.dataRange = adaptedRange;
|
|
20948
20969
|
dataSets.push(newDataSet);
|
|
20949
20970
|
}
|
|
@@ -22269,14 +22290,14 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
22269
22290
|
let baseline;
|
|
22270
22291
|
let keyValue;
|
|
22271
22292
|
if (definition.baseline) {
|
|
22272
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
22273
|
-
if (
|
|
22293
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
22294
|
+
if (changeType !== "REMOVE") {
|
|
22274
22295
|
baseline = adaptedRange;
|
|
22275
22296
|
}
|
|
22276
22297
|
}
|
|
22277
22298
|
if (definition.keyValue) {
|
|
22278
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
22279
|
-
if (
|
|
22299
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
22300
|
+
if (changeType !== "REMOVE") {
|
|
22280
22301
|
keyValue = adaptedRange;
|
|
22281
22302
|
}
|
|
22282
22303
|
}
|
|
@@ -22332,7 +22353,7 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
22332
22353
|
// This kind of graph is not exportable in Excel
|
|
22333
22354
|
return undefined;
|
|
22334
22355
|
}
|
|
22335
|
-
updateRanges(applyChange) {
|
|
22356
|
+
updateRanges({ applyChange }) {
|
|
22336
22357
|
const baseline = adaptChartRange(this.baseline, applyChange);
|
|
22337
22358
|
const keyValue = adaptChartRange(this.keyValue, applyChange);
|
|
22338
22359
|
if (this.baseline === baseline && this.keyValue === keyValue) {
|
|
@@ -27204,7 +27225,7 @@ class BarChart extends AbstractChart {
|
|
|
27204
27225
|
verticalAxis: getDefinedAxis(definition),
|
|
27205
27226
|
};
|
|
27206
27227
|
}
|
|
27207
|
-
updateRanges(applyChange) {
|
|
27228
|
+
updateRanges({ applyChange }) {
|
|
27208
27229
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27209
27230
|
if (!isStale) {
|
|
27210
27231
|
return this;
|
|
@@ -27325,7 +27346,7 @@ class ComboChart extends AbstractChart {
|
|
|
27325
27346
|
verticalAxis: getDefinedAxis(definition),
|
|
27326
27347
|
};
|
|
27327
27348
|
}
|
|
27328
|
-
updateRanges(applyChange) {
|
|
27349
|
+
updateRanges({ applyChange }) {
|
|
27329
27350
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27330
27351
|
if (!isStale) {
|
|
27331
27352
|
return this;
|
|
@@ -27496,7 +27517,7 @@ class FunnelChart extends AbstractChart {
|
|
|
27496
27517
|
getDefinitionForExcel() {
|
|
27497
27518
|
return undefined;
|
|
27498
27519
|
}
|
|
27499
|
-
updateRanges(applyChange) {
|
|
27520
|
+
updateRanges({ applyChange }) {
|
|
27500
27521
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27501
27522
|
if (!isStale) {
|
|
27502
27523
|
return this;
|
|
@@ -27607,8 +27628,8 @@ class GaugeChart extends AbstractChart {
|
|
|
27607
27628
|
static transformDefinition(chartSheetId, definition, applyChange) {
|
|
27608
27629
|
let dataRange;
|
|
27609
27630
|
if (definition.dataRange) {
|
|
27610
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
27611
|
-
if (
|
|
27631
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
27632
|
+
if (changeType !== "REMOVE") {
|
|
27612
27633
|
dataRange = adaptedRange;
|
|
27613
27634
|
}
|
|
27614
27635
|
}
|
|
@@ -27683,13 +27704,9 @@ class GaugeChart extends AbstractChart {
|
|
|
27683
27704
|
: undefined,
|
|
27684
27705
|
};
|
|
27685
27706
|
}
|
|
27686
|
-
updateRanges(applyChange,
|
|
27707
|
+
updateRanges({ applyChange, adaptFormulaString }) {
|
|
27687
27708
|
const dataRange = adaptChartRange(this.dataRange, applyChange);
|
|
27688
|
-
const adaptFormula = (formula) =>
|
|
27689
|
-
applyChange,
|
|
27690
|
-
sheetId,
|
|
27691
|
-
sheetName: adaptSheetName,
|
|
27692
|
-
});
|
|
27709
|
+
const adaptFormula = (formula) => adaptFormulaString(this.sheetId, formula);
|
|
27693
27710
|
const sectionRule = adaptSectionRuleFormulas(this.sectionRule, adaptFormula);
|
|
27694
27711
|
const definition = this.getDefinitionWithSpecificRanges(dataRange, sectionRule);
|
|
27695
27712
|
return new GaugeChart(definition, this.sheetId, this.getters);
|
|
@@ -27909,7 +27926,7 @@ class GeoChart extends AbstractChart {
|
|
|
27909
27926
|
getDefinitionForExcel() {
|
|
27910
27927
|
return undefined;
|
|
27911
27928
|
}
|
|
27912
|
-
updateRanges(applyChange) {
|
|
27929
|
+
updateRanges({ applyChange }) {
|
|
27913
27930
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
27914
27931
|
if (!isStale) {
|
|
27915
27932
|
return this;
|
|
@@ -28041,7 +28058,7 @@ class LineChart extends AbstractChart {
|
|
|
28041
28058
|
: undefined,
|
|
28042
28059
|
};
|
|
28043
28060
|
}
|
|
28044
|
-
updateRanges(applyChange) {
|
|
28061
|
+
updateRanges({ applyChange }) {
|
|
28045
28062
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28046
28063
|
if (!isStale) {
|
|
28047
28064
|
return this;
|
|
@@ -28198,7 +28215,7 @@ class PieChart extends AbstractChart {
|
|
|
28198
28215
|
labelRange,
|
|
28199
28216
|
};
|
|
28200
28217
|
}
|
|
28201
|
-
updateRanges(applyChange) {
|
|
28218
|
+
updateRanges({ applyChange }) {
|
|
28202
28219
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28203
28220
|
if (!isStale) {
|
|
28204
28221
|
return this;
|
|
@@ -28334,7 +28351,7 @@ class PyramidChart extends AbstractChart {
|
|
|
28334
28351
|
getDefinitionForExcel() {
|
|
28335
28352
|
return undefined;
|
|
28336
28353
|
}
|
|
28337
|
-
updateRanges(applyChange) {
|
|
28354
|
+
updateRanges({ applyChange }) {
|
|
28338
28355
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28339
28356
|
if (!isStale) {
|
|
28340
28357
|
return this;
|
|
@@ -28481,7 +28498,7 @@ class RadarChart extends AbstractChart {
|
|
|
28481
28498
|
labelRange,
|
|
28482
28499
|
};
|
|
28483
28500
|
}
|
|
28484
|
-
updateRanges(applyChange) {
|
|
28501
|
+
updateRanges({ applyChange }) {
|
|
28485
28502
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28486
28503
|
if (!isStale) {
|
|
28487
28504
|
return this;
|
|
@@ -28603,7 +28620,7 @@ class ScatterChart extends AbstractChart {
|
|
|
28603
28620
|
: undefined,
|
|
28604
28621
|
};
|
|
28605
28622
|
}
|
|
28606
|
-
updateRanges(applyChange) {
|
|
28623
|
+
updateRanges({ applyChange }) {
|
|
28607
28624
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28608
28625
|
if (!isStale) {
|
|
28609
28626
|
return this;
|
|
@@ -28765,7 +28782,7 @@ class SunburstChart extends AbstractChart {
|
|
|
28765
28782
|
getDefinitionForExcel() {
|
|
28766
28783
|
return undefined;
|
|
28767
28784
|
}
|
|
28768
|
-
updateRanges(applyChange) {
|
|
28785
|
+
updateRanges({ applyChange }) {
|
|
28769
28786
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28770
28787
|
if (!isStale) {
|
|
28771
28788
|
return this;
|
|
@@ -28913,7 +28930,7 @@ class TreeMapChart extends AbstractChart {
|
|
|
28913
28930
|
getDefinitionForExcel() {
|
|
28914
28931
|
return undefined;
|
|
28915
28932
|
}
|
|
28916
|
-
updateRanges(applyChange) {
|
|
28933
|
+
updateRanges({ applyChange }) {
|
|
28917
28934
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
28918
28935
|
if (!isStale) {
|
|
28919
28936
|
return this;
|
|
@@ -29068,7 +29085,7 @@ class WaterfallChart extends AbstractChart {
|
|
|
29068
29085
|
// TODO: implement export excel
|
|
29069
29086
|
return undefined;
|
|
29070
29087
|
}
|
|
29071
|
-
updateRanges(applyChange) {
|
|
29088
|
+
updateRanges({ applyChange }) {
|
|
29072
29089
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
29073
29090
|
if (!isStale) {
|
|
29074
29091
|
return this;
|
|
@@ -31936,6 +31953,7 @@ function extractStyle(data, content, styleId, formatId, borderId) {
|
|
|
31936
31953
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
31937
31954
|
: undefined,
|
|
31938
31955
|
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : undefined,
|
|
31956
|
+
shrinkToFit: style.wrapping === "clip" ? true : undefined,
|
|
31939
31957
|
},
|
|
31940
31958
|
};
|
|
31941
31959
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -31956,6 +31974,7 @@ function normalizeStyle(construct, styles) {
|
|
|
31956
31974
|
vertical: styles.alignment.vertical,
|
|
31957
31975
|
horizontal: styles.alignment.horizontal,
|
|
31958
31976
|
wrapText: styles.alignment.wrapText,
|
|
31977
|
+
shrinkToFit: styles.alignment.shrinkToFit,
|
|
31959
31978
|
},
|
|
31960
31979
|
};
|
|
31961
31980
|
return pushElement(style, construct.styles);
|
|
@@ -42960,7 +42979,7 @@ class GaugeChartConfigPanel extends Component {
|
|
|
42960
42979
|
});
|
|
42961
42980
|
dataRange = this.props.definition.dataRange;
|
|
42962
42981
|
get configurationErrorMessages() {
|
|
42963
|
-
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])];
|
|
42982
|
+
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
42964
42983
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
42965
42984
|
}
|
|
42966
42985
|
get isDataRangeInvalid() {
|
|
@@ -44384,7 +44403,7 @@ class GaugeChartDesignPanel extends Component {
|
|
|
44384
44403
|
});
|
|
44385
44404
|
}
|
|
44386
44405
|
get designErrorMessages() {
|
|
44387
|
-
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])];
|
|
44406
|
+
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
44388
44407
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
44389
44408
|
}
|
|
44390
44409
|
get isRangeMinInvalid() {
|
|
@@ -44720,7 +44739,7 @@ class ScorecardChartConfigPanel extends Component {
|
|
|
44720
44739
|
const cancelledReasons = [
|
|
44721
44740
|
...(this.state.keyValueDispatchResult?.reasons || []),
|
|
44722
44741
|
...(this.state.baselineDispatchResult?.reasons || []),
|
|
44723
|
-
];
|
|
44742
|
+
].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
44724
44743
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
44725
44744
|
}
|
|
44726
44745
|
get isKeyValueInvalid() {
|
|
@@ -50325,8 +50344,6 @@ function adaptPivotRange(range, applyChange) {
|
|
|
50325
50344
|
}
|
|
50326
50345
|
const change = applyChange(range);
|
|
50327
50346
|
switch (change.changeType) {
|
|
50328
|
-
case "NONE":
|
|
50329
|
-
return range;
|
|
50330
50347
|
case "REMOVE":
|
|
50331
50348
|
return undefined;
|
|
50332
50349
|
default:
|
|
@@ -57389,7 +57406,7 @@ class CorePlugin extends BasePlugin {
|
|
|
57389
57406
|
* @param sheetId an sheetId to adapt either range of that sheet specifically, or ranges pointing to that sheet
|
|
57390
57407
|
* @param sheetName couple of old and new sheet names to adapt ranges pointing to that sheet
|
|
57391
57408
|
*/
|
|
57392
|
-
adaptRanges(
|
|
57409
|
+
adaptRanges(rangeAdapterFunctions, sheetId, sheetName) { }
|
|
57393
57410
|
/**
|
|
57394
57411
|
* Implement this method to clean unused external resources, such as images
|
|
57395
57412
|
* stored on a server which have been deleted.
|
|
@@ -57985,7 +58002,7 @@ class CellPlugin extends CorePlugin {
|
|
|
57985
58002
|
];
|
|
57986
58003
|
nextId = 1;
|
|
57987
58004
|
cells = {};
|
|
57988
|
-
adaptRanges(applyChange, sheetId, sheetName) {
|
|
58005
|
+
adaptRanges({ applyChange }, sheetId, sheetName) {
|
|
57989
58006
|
for (const sheet of Object.keys(this.cells)) {
|
|
57990
58007
|
for (const cell of Object.values(this.cells[sheet] || {})) {
|
|
57991
58008
|
if (cell.isFormula) {
|
|
@@ -58207,7 +58224,7 @@ class CellPlugin extends CorePlugin {
|
|
|
58207
58224
|
for (const position of positions) {
|
|
58208
58225
|
const cell = this.getters.getCell(position);
|
|
58209
58226
|
const xc = toXC(position.col, position.row);
|
|
58210
|
-
const style = this.
|
|
58227
|
+
const style = this.extractCustomStyle(cell);
|
|
58211
58228
|
if (Object.keys(style).length) {
|
|
58212
58229
|
const styleId = getItemId(style, styles);
|
|
58213
58230
|
positionsByStyle[styleId] ??= [];
|
|
@@ -58253,10 +58270,14 @@ class CellPlugin extends CorePlugin {
|
|
|
58253
58270
|
}
|
|
58254
58271
|
}
|
|
58255
58272
|
}
|
|
58256
|
-
|
|
58257
|
-
const cleanedStyle = { ...style };
|
|
58258
|
-
|
|
58259
|
-
|
|
58273
|
+
extractCustomStyle(cell) {
|
|
58274
|
+
const cleanedStyle = { ...cell.style };
|
|
58275
|
+
const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
|
|
58276
|
+
? DEFAULT_NUMBER_STYLE
|
|
58277
|
+
: DEFAULT_STYLE;
|
|
58278
|
+
for (const property in cleanedStyle) {
|
|
58279
|
+
if ((property !== "align" || !cell.isFormula) &&
|
|
58280
|
+
cleanedStyle[property] === defaultStyle[property]) {
|
|
58260
58281
|
delete cleanedStyle[property];
|
|
58261
58282
|
}
|
|
58262
58283
|
}
|
|
@@ -58606,9 +58627,9 @@ class ChartPlugin extends CorePlugin {
|
|
|
58606
58627
|
charts = {};
|
|
58607
58628
|
createChart = chartFactory(this.getters);
|
|
58608
58629
|
validateChartDefinition = (cmd) => validateChartDefinition(this, cmd.definition);
|
|
58609
|
-
adaptRanges(
|
|
58630
|
+
adaptRanges(rangeAdapters) {
|
|
58610
58631
|
for (const [chartId, chart] of Object.entries(this.charts)) {
|
|
58611
|
-
this.history.update("charts", chartId, chart?.updateRanges(
|
|
58632
|
+
this.history.update("charts", chartId, chart?.updateRanges(rangeAdapters));
|
|
58612
58633
|
}
|
|
58613
58634
|
}
|
|
58614
58635
|
// ---------------------------------------------------------------------------
|
|
@@ -58798,7 +58819,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58798
58819
|
"getAdaptedCfRanges",
|
|
58799
58820
|
];
|
|
58800
58821
|
cfRules = {};
|
|
58801
|
-
adaptCFFormulas(applyChange) {
|
|
58822
|
+
adaptCFFormulas({ applyChange, adaptFormulaString }) {
|
|
58802
58823
|
for (const sheetId in this.cfRules) {
|
|
58803
58824
|
for (const rule of this.cfRules[sheetId]) {
|
|
58804
58825
|
if (rule.rule.type === "DataBarRule" && rule.rule.rangeValues) {
|
|
@@ -58822,7 +58843,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58822
58843
|
for (let i = 0; i < rule.rule.values.length; i++) {
|
|
58823
58844
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
58824
58845
|
//@ts-expect-error
|
|
58825
|
-
"values", i,
|
|
58846
|
+
"values", i, adaptFormulaString(sheetId, rule.rule.values[i]));
|
|
58826
58847
|
}
|
|
58827
58848
|
}
|
|
58828
58849
|
else if (rule.rule.type === "IconSetRule") {
|
|
@@ -58830,7 +58851,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58830
58851
|
if (rule.rule[inflectionPoint].type === "formula") {
|
|
58831
58852
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
58832
58853
|
//@ts-expect-error
|
|
58833
|
-
inflectionPoint, "value",
|
|
58854
|
+
inflectionPoint, "value", adaptFormulaString(sheetId, rule.rule[inflectionPoint].value));
|
|
58834
58855
|
}
|
|
58835
58856
|
}
|
|
58836
58857
|
}
|
|
@@ -58840,14 +58861,14 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58840
58861
|
if (ruleValue?.type === "formula" && ruleValue?.value) {
|
|
58841
58862
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
58842
58863
|
//@ts-expect-error
|
|
58843
|
-
value, "value",
|
|
58864
|
+
value, "value", adaptFormulaString(sheetId, ruleValue.value));
|
|
58844
58865
|
}
|
|
58845
58866
|
}
|
|
58846
58867
|
}
|
|
58847
58868
|
}
|
|
58848
58869
|
}
|
|
58849
58870
|
}
|
|
58850
|
-
adaptCFRanges(sheetId, applyChange) {
|
|
58871
|
+
adaptCFRanges(sheetId, { applyChange }) {
|
|
58851
58872
|
for (const rule of this.cfRules[sheetId]) {
|
|
58852
58873
|
for (const range of rule.ranges) {
|
|
58853
58874
|
const change = applyChange(range);
|
|
@@ -58871,12 +58892,12 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58871
58892
|
}
|
|
58872
58893
|
}
|
|
58873
58894
|
}
|
|
58874
|
-
adaptRanges(
|
|
58895
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
58875
58896
|
const sheetIds = sheetId ? [sheetId] : Object.keys(this.cfRules);
|
|
58876
58897
|
for (const sheetId of sheetIds) {
|
|
58877
|
-
this.adaptCFRanges(sheetId,
|
|
58898
|
+
this.adaptCFRanges(sheetId, rangeAdapters);
|
|
58878
58899
|
}
|
|
58879
|
-
this.adaptCFFormulas(
|
|
58900
|
+
this.adaptCFFormulas(rangeAdapters);
|
|
58880
58901
|
}
|
|
58881
58902
|
// ---------------------------------------------------------------------------
|
|
58882
58903
|
// Command Handling
|
|
@@ -59267,23 +59288,23 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
59267
59288
|
"getValidationRuleForCell",
|
|
59268
59289
|
];
|
|
59269
59290
|
rules = {};
|
|
59270
|
-
adaptRanges(
|
|
59271
|
-
this.adaptDVRanges(sheetId,
|
|
59272
|
-
this.adaptDVFormulas(
|
|
59291
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
59292
|
+
this.adaptDVRanges(sheetId, rangeAdapters);
|
|
59293
|
+
this.adaptDVFormulas(rangeAdapters);
|
|
59273
59294
|
}
|
|
59274
|
-
adaptDVFormulas(
|
|
59295
|
+
adaptDVFormulas({ adaptFormulaString }) {
|
|
59275
59296
|
for (const sheetId in this.rules) {
|
|
59276
59297
|
const rules = this.rules[sheetId];
|
|
59277
59298
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
59278
59299
|
const rule = this.rules[sheetId][ruleIndex];
|
|
59279
59300
|
for (let valueIndex = 0; valueIndex < rule.criterion.values.length; valueIndex++) {
|
|
59280
|
-
const value =
|
|
59301
|
+
const value = adaptFormulaString(sheetId, rule.criterion.values[valueIndex]);
|
|
59281
59302
|
this.history.update("rules", sheetId, ruleIndex, "criterion", "values", valueIndex, value);
|
|
59282
59303
|
}
|
|
59283
59304
|
}
|
|
59284
59305
|
}
|
|
59285
59306
|
}
|
|
59286
|
-
adaptDVRanges(sheetId, applyChange) {
|
|
59307
|
+
adaptDVRanges(sheetId, { applyChange }) {
|
|
59287
59308
|
const rules = this.rules[sheetId];
|
|
59288
59309
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
59289
59310
|
const rule = this.rules[sheetId][ruleIndex];
|
|
@@ -59557,7 +59578,7 @@ class FigurePlugin extends CorePlugin {
|
|
|
59557
59578
|
// ---------------------------------------------------------------------------
|
|
59558
59579
|
// Command Handling
|
|
59559
59580
|
// ---------------------------------------------------------------------------
|
|
59560
|
-
adaptRanges(applyChange, sheetId) {
|
|
59581
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
59561
59582
|
for (const figure of this.getFigures(sheetId)) {
|
|
59562
59583
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, {
|
|
59563
59584
|
left: figure.col,
|
|
@@ -60364,8 +60385,8 @@ class MergePlugin extends CorePlugin {
|
|
|
60364
60385
|
break;
|
|
60365
60386
|
}
|
|
60366
60387
|
}
|
|
60367
|
-
adaptRanges(
|
|
60368
|
-
this.applyRangeChangeOnSheet(sheetId,
|
|
60388
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
60389
|
+
this.applyRangeChangeOnSheet(sheetId, rangeAdapters);
|
|
60369
60390
|
}
|
|
60370
60391
|
// ---------------------------------------------------------------------------
|
|
60371
60392
|
// Getters
|
|
@@ -60670,7 +60691,7 @@ class MergePlugin extends CorePlugin {
|
|
|
60670
60691
|
/**
|
|
60671
60692
|
* Apply a range change on merges of a particular sheet.
|
|
60672
60693
|
*/
|
|
60673
|
-
applyRangeChangeOnSheet(sheetId, applyChange) {
|
|
60694
|
+
applyRangeChangeOnSheet(sheetId, { applyChange }) {
|
|
60674
60695
|
const merges = Object.entries(this.merges[sheetId] || {});
|
|
60675
60696
|
for (const [mergeId, range] of merges) {
|
|
60676
60697
|
if (range) {
|
|
@@ -60744,7 +60765,7 @@ function rangeToMerge(mergeId, range) {
|
|
|
60744
60765
|
};
|
|
60745
60766
|
}
|
|
60746
60767
|
|
|
60747
|
-
class
|
|
60768
|
+
class RangeAdapterPlugin {
|
|
60748
60769
|
getters;
|
|
60749
60770
|
providers = [];
|
|
60750
60771
|
isAdaptingRanges = false;
|
|
@@ -60752,7 +60773,6 @@ class RangeAdapter {
|
|
|
60752
60773
|
this.getters = getters;
|
|
60753
60774
|
}
|
|
60754
60775
|
static getters = [
|
|
60755
|
-
"adaptFormulaStringDependencies",
|
|
60756
60776
|
"copyFormulaStringForSheet",
|
|
60757
60777
|
"extendRange",
|
|
60758
60778
|
"getRangeString",
|
|
@@ -60783,8 +60803,8 @@ class RangeAdapter {
|
|
|
60783
60803
|
throw new Error("Plugins cannot dispatch commands during adaptRanges phase");
|
|
60784
60804
|
}
|
|
60785
60805
|
const rangeAdapter = getRangeAdapter(cmd);
|
|
60786
|
-
if (rangeAdapter
|
|
60787
|
-
this.executeOnAllRanges(rangeAdapter
|
|
60806
|
+
if (rangeAdapter) {
|
|
60807
|
+
this.executeOnAllRanges(rangeAdapter);
|
|
60788
60808
|
}
|
|
60789
60809
|
}
|
|
60790
60810
|
finalize() { }
|
|
@@ -60803,11 +60823,15 @@ class RangeAdapter {
|
|
|
60803
60823
|
return result;
|
|
60804
60824
|
};
|
|
60805
60825
|
}
|
|
60806
|
-
executeOnAllRanges(
|
|
60826
|
+
executeOnAllRanges(rangeAdapter) {
|
|
60807
60827
|
this.isAdaptingRanges = true;
|
|
60808
|
-
const
|
|
60828
|
+
const adapterFunctions = {
|
|
60829
|
+
applyChange: this.verifyRangeRemoved(rangeAdapter.applyChange),
|
|
60830
|
+
adaptRangeString: (defaultSheetId, sheetXC) => adaptStringRange(defaultSheetId, sheetXC, rangeAdapter),
|
|
60831
|
+
adaptFormulaString: (defaultSheetId, formula) => adaptFormulaStringRanges(defaultSheetId, formula, rangeAdapter),
|
|
60832
|
+
};
|
|
60809
60833
|
for (const provider of this.providers) {
|
|
60810
|
-
provider(
|
|
60834
|
+
provider(adapterFunctions, rangeAdapter.sheetId, rangeAdapter.sheetName);
|
|
60811
60835
|
}
|
|
60812
60836
|
this.isAdaptingRanges = false;
|
|
60813
60837
|
}
|
|
@@ -60975,18 +60999,6 @@ class RangeAdapter {
|
|
|
60975
60999
|
const unionOfZones = unionUnboundedZones(...zones);
|
|
60976
61000
|
return this.getRangeFromZone(ranges[0].sheetId, unionOfZones);
|
|
60977
61001
|
}
|
|
60978
|
-
adaptFormulaStringDependencies(sheetId, formula, applyChange) {
|
|
60979
|
-
if (!formula.startsWith("=")) {
|
|
60980
|
-
return formula;
|
|
60981
|
-
}
|
|
60982
|
-
const compiledFormula = compile(formula);
|
|
60983
|
-
const updatedDependencies = compiledFormula.dependencies.map((dep) => {
|
|
60984
|
-
const range = this.getters.getRangeFromSheetXC(sheetId, dep);
|
|
60985
|
-
const changedRange = applyChange(range);
|
|
60986
|
-
return changedRange.changeType === "NONE" ? range : changedRange.range;
|
|
60987
|
-
});
|
|
60988
|
-
return this.getters.getFormulaString(sheetId, compiledFormula.tokens, updatedDependencies);
|
|
60989
|
-
}
|
|
60990
61002
|
/**
|
|
60991
61003
|
* Copy a formula string to another sheet.
|
|
60992
61004
|
*
|
|
@@ -61879,7 +61891,7 @@ class TablePlugin extends CorePlugin {
|
|
|
61879
61891
|
static getters = ["getCoreTable", "getCoreTables", "getCoreTableMatchingTopLeft"];
|
|
61880
61892
|
tables = {};
|
|
61881
61893
|
nextTableId = 1;
|
|
61882
|
-
adaptRanges(applyChange, sheetId) {
|
|
61894
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
61883
61895
|
for (const table of this.getCoreTables(sheetId)) {
|
|
61884
61896
|
this.applyRangeChangeOnTable(sheetId, table, applyChange);
|
|
61885
61897
|
}
|
|
@@ -62845,7 +62857,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62845
62857
|
}
|
|
62846
62858
|
}
|
|
62847
62859
|
}
|
|
62848
|
-
adaptRanges(applyChange) {
|
|
62860
|
+
adaptRanges({ applyChange, adaptFormulaString }) {
|
|
62849
62861
|
for (const pivotId in this.pivots) {
|
|
62850
62862
|
const definition = deepCopy(this.pivots[pivotId]?.definition);
|
|
62851
62863
|
if (!definition) {
|
|
@@ -62865,19 +62877,13 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62865
62877
|
continue;
|
|
62866
62878
|
}
|
|
62867
62879
|
const sheetId = measure.computedBy.sheetId;
|
|
62868
|
-
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId]
|
|
62869
|
-
|
|
62870
|
-
|
|
62871
|
-
|
|
62872
|
-
|
|
62873
|
-
newDependencies.push(range);
|
|
62874
|
-
}
|
|
62875
|
-
else {
|
|
62876
|
-
newDependencies.push(change.range);
|
|
62877
|
-
}
|
|
62878
|
-
}
|
|
62879
|
-
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
62880
|
+
const { formula: compiledFormula, dependencies: indirectDependencies } = this.compiledMeasureFormulas[pivotId][measureId];
|
|
62881
|
+
// adapt direct dependencies
|
|
62882
|
+
this.history.update("compiledMeasureFormulas", pivotId, measureId, "formula", "dependencies", compiledFormula.dependencies.map((range) => applyChange(range).range));
|
|
62883
|
+
// adapt all dependencies (including indirect)
|
|
62884
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", indirectDependencies.map((range) => applyChange(range).range));
|
|
62880
62885
|
const oldFormulaString = measure.computedBy.formula;
|
|
62886
|
+
const newFormulaString = adaptFormulaString(sheetId, oldFormulaString);
|
|
62881
62887
|
if (newFormulaString !== oldFormulaString) {
|
|
62882
62888
|
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
62883
62889
|
}
|
|
@@ -63042,7 +63048,6 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
63042
63048
|
formula: newFormulaString,
|
|
63043
63049
|
sheetId: measure.computedBy.sheetId,
|
|
63044
63050
|
});
|
|
63045
|
-
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
63046
63051
|
}
|
|
63047
63052
|
checkSortedColumnInMeasures(definition) {
|
|
63048
63053
|
definition = this.repairSortedColumn(definition);
|
|
@@ -64447,11 +64452,16 @@ class SpreadingRelation {
|
|
|
64447
64452
|
return this.arrayFormulasToResults.get(formulasPosition);
|
|
64448
64453
|
}
|
|
64449
64454
|
/**
|
|
64450
|
-
* Remove a
|
|
64455
|
+
* Remove a spreading relation for a given array formula position
|
|
64456
|
+
* and its result zone
|
|
64451
64457
|
*/
|
|
64452
64458
|
removeNode(position) {
|
|
64459
|
+
const resultZone = this.arrayFormulasToResults.get(position);
|
|
64460
|
+
if (!resultZone) {
|
|
64461
|
+
return;
|
|
64462
|
+
}
|
|
64453
64463
|
this.resultsToArrayFormulas.remove({
|
|
64454
|
-
boundingBox: { sheetId: position.sheetId, zone:
|
|
64464
|
+
boundingBox: { sheetId: position.sheetId, zone: resultZone },
|
|
64455
64465
|
data: position,
|
|
64456
64466
|
});
|
|
64457
64467
|
this.arrayFormulasToResults.delete(position);
|
|
@@ -64739,6 +64749,10 @@ class Evaluator {
|
|
|
64739
64749
|
// empty matrix
|
|
64740
64750
|
return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
|
|
64741
64751
|
}
|
|
64752
|
+
if (nbRows === 1 && nbColumns === 1) {
|
|
64753
|
+
// single value matrix
|
|
64754
|
+
return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
|
|
64755
|
+
}
|
|
64742
64756
|
const resultZone = {
|
|
64743
64757
|
top: formulaPosition.row,
|
|
64744
64758
|
bottom: formulaPosition.row + nbRows - 1,
|
|
@@ -66164,6 +66178,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
66164
66178
|
handle(cmd) {
|
|
66165
66179
|
switch (cmd.type) {
|
|
66166
66180
|
case "START":
|
|
66181
|
+
case "UPDATE_LOCALE":
|
|
66167
66182
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
66168
66183
|
this.initializeSheet(sheetId);
|
|
66169
66184
|
}
|
|
@@ -66285,7 +66300,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
66285
66300
|
}
|
|
66286
66301
|
const cell = this.getters.getCell(position);
|
|
66287
66302
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
66288
|
-
return getDefaultCellHeight(this.ctx, cell, colSize);
|
|
66303
|
+
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
66289
66304
|
}
|
|
66290
66305
|
isInMultiRowMerge(position) {
|
|
66291
66306
|
const merge = this.getters.getMerge(position);
|
|
@@ -68174,7 +68189,7 @@ function addConditionalFormatCommandAdaptRange(cmd, applyChange) {
|
|
|
68174
68189
|
cmd.cf.rule = {
|
|
68175
68190
|
...rule,
|
|
68176
68191
|
rangeValues: rule.rangeValues
|
|
68177
|
-
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange)
|
|
68192
|
+
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange).range
|
|
68178
68193
|
: undefined,
|
|
68179
68194
|
};
|
|
68180
68195
|
}
|
|
@@ -79661,6 +79676,9 @@ function addStyles(styles) {
|
|
|
79661
79676
|
if (style.alignment && style.alignment.wrapText) {
|
|
79662
79677
|
alignAttrs.push(["wrapText", "1"]);
|
|
79663
79678
|
}
|
|
79679
|
+
if (style.alignment && style.alignment.shrinkToFit) {
|
|
79680
|
+
alignAttrs.push(["shrinkToFit", "1"]);
|
|
79681
|
+
}
|
|
79664
79682
|
if (alignAttrs.length > 0) {
|
|
79665
79683
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
79666
79684
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
@@ -80431,7 +80449,7 @@ class Model extends EventBus {
|
|
|
80431
80449
|
this.config = this.setupConfig(config);
|
|
80432
80450
|
this.session = this.setupSession(workbookData.revisionId);
|
|
80433
80451
|
this.coreGetters = {};
|
|
80434
|
-
this.range = new
|
|
80452
|
+
this.range = new RangeAdapterPlugin(this.coreGetters);
|
|
80435
80453
|
this.coreGetters.getRangeString = this.range.getRangeString.bind(this.range);
|
|
80436
80454
|
this.coreGetters.getRangeFromSheetXC = this.range.getRangeFromSheetXC.bind(this.range);
|
|
80437
80455
|
this.coreGetters.createAdaptedRanges = this.range.createAdaptedRanges.bind(this.range);
|
|
@@ -80445,8 +80463,6 @@ class Model extends EventBus {
|
|
|
80445
80463
|
this.coreGetters.extendRange = this.range.extendRange.bind(this.range);
|
|
80446
80464
|
this.coreGetters.getRangesUnion = this.range.getRangesUnion.bind(this.range);
|
|
80447
80465
|
this.coreGetters.removeRangesSheetPrefix = this.range.removeRangesSheetPrefix.bind(this.range);
|
|
80448
|
-
this.coreGetters.adaptFormulaStringDependencies =
|
|
80449
|
-
this.range.adaptFormulaStringDependencies.bind(this.range);
|
|
80450
80466
|
this.coreGetters.copyFormulaStringForSheet = this.range.copyFormulaStringForSheet.bind(this.range);
|
|
80451
80467
|
this.getters = {
|
|
80452
80468
|
isReadonly: () => this.config.mode === "readonly" || this.config.mode === "dashboard",
|
|
@@ -81116,6 +81132,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
81116
81132
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, 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 };
|
|
81117
81133
|
|
|
81118
81134
|
|
|
81119
|
-
__info__.version = "18.3.
|
|
81120
|
-
__info__.date = "2026-01-
|
|
81121
|
-
__info__.hash = "
|
|
81135
|
+
__info__.version = "18.3.33";
|
|
81136
|
+
__info__.date = "2026-01-21T11:05:17.933Z";
|
|
81137
|
+
__info__.hash = "b7e5d91";
|