@odoo/o-spreadsheet 19.1.3 → 19.1.4
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-engine.d.ts +33 -27
- package/dist/o-spreadsheet-engine.esm.js +121 -101
- package/dist/o-spreadsheet-engine.iife.js +121 -101
- package/dist/o-spreadsheet-engine.min.iife.js +165 -165
- package/dist/o-spreadsheet.d.ts +39 -33
- package/dist/o_spreadsheet.css +3 -3
- package/dist/o_spreadsheet.esm.js +159 -144
- package/dist/o_spreadsheet.iife.js +159 -144
- package/dist/o_spreadsheet.min.iife.js +32 -32
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 19.1.
|
|
6
|
-
* @date 2026-01-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.1.4
|
|
6
|
+
* @date 2026-01-21T11:07:17.372Z
|
|
7
|
+
* @hash ceae12a
|
|
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';
|
|
@@ -3841,7 +3841,11 @@ function evaluatePredicate(value = "", criterion, locale) {
|
|
|
3841
3841
|
if (operator === "<>" || operator === "=") {
|
|
3842
3842
|
let result;
|
|
3843
3843
|
if (typeof value === typeof operand) {
|
|
3844
|
-
if (
|
|
3844
|
+
if (value === "" && operand === "") {
|
|
3845
|
+
// fast path to avoid regex evaluation
|
|
3846
|
+
result = true;
|
|
3847
|
+
}
|
|
3848
|
+
else if (typeof value === "string" && typeof operand === "string") {
|
|
3845
3849
|
result = wildcardToRegExp(operand).test(value);
|
|
3846
3850
|
}
|
|
3847
3851
|
else {
|
|
@@ -4195,7 +4199,16 @@ function createComputeFunction(descr) {
|
|
|
4195
4199
|
}
|
|
4196
4200
|
acceptToVectorize.push(!argDefinition.acceptMatrix);
|
|
4197
4201
|
}
|
|
4198
|
-
return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
|
|
4202
|
+
return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
|
|
4203
|
+
}
|
|
4204
|
+
function replaceErrorPlaceholderInResult(result) {
|
|
4205
|
+
if (!isMatrix(result)) {
|
|
4206
|
+
replaceFunctionNamePlaceholder(result, descr.name);
|
|
4207
|
+
}
|
|
4208
|
+
else {
|
|
4209
|
+
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
4210
|
+
}
|
|
4211
|
+
return result;
|
|
4199
4212
|
}
|
|
4200
4213
|
function errorHandlingCompute(...args) {
|
|
4201
4214
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -4224,13 +4237,12 @@ function createComputeFunction(descr) {
|
|
|
4224
4237
|
const result = descr.compute.apply(this, args);
|
|
4225
4238
|
if (!isMatrix(result)) {
|
|
4226
4239
|
if (typeof result === "object" && result !== null && "value" in result) {
|
|
4227
|
-
replaceFunctionNamePlaceholder(result, descr.name);
|
|
4228
4240
|
return result;
|
|
4229
4241
|
}
|
|
4242
|
+
descr.name;
|
|
4230
4243
|
return { value: result };
|
|
4231
4244
|
}
|
|
4232
4245
|
if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
|
|
4233
|
-
matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, descr.name));
|
|
4234
4246
|
return result;
|
|
4235
4247
|
}
|
|
4236
4248
|
return matrixMap(result, (row) => ({ value: row }));
|
|
@@ -18341,7 +18353,8 @@ function createAction(item) {
|
|
|
18341
18353
|
return children
|
|
18342
18354
|
.map((child) => (typeof child === "function" ? child(env) : child))
|
|
18343
18355
|
.flat()
|
|
18344
|
-
.map(createAction)
|
|
18356
|
+
.map(createAction)
|
|
18357
|
+
.sort((a, b) => a.sequence - b.sequence);
|
|
18345
18358
|
}
|
|
18346
18359
|
: () => [],
|
|
18347
18360
|
isReadonlyAllowed: item.isReadonlyAllowed || false,
|
|
@@ -20002,7 +20015,7 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
20002
20015
|
const groups = groupConsecutive(elements);
|
|
20003
20016
|
return (range) => {
|
|
20004
20017
|
if (range.sheetId !== cmd.sheetId) {
|
|
20005
|
-
return { changeType: "NONE" };
|
|
20018
|
+
return { changeType: "NONE", range };
|
|
20006
20019
|
}
|
|
20007
20020
|
let newRange = range;
|
|
20008
20021
|
let changeType = "NONE";
|
|
@@ -20029,10 +20042,7 @@ function getApplyRangeChangeRemoveColRow(cmd) {
|
|
|
20029
20042
|
newRange = createAdaptedRange(newRange, dimension, changeType, -(max - min + 1));
|
|
20030
20043
|
}
|
|
20031
20044
|
}
|
|
20032
|
-
|
|
20033
|
-
return { changeType, range: newRange };
|
|
20034
|
-
}
|
|
20035
|
-
return { changeType: "NONE" };
|
|
20045
|
+
return { changeType, range: newRange };
|
|
20036
20046
|
};
|
|
20037
20047
|
}
|
|
20038
20048
|
function getApplyRangeChangeAddColRow(cmd) {
|
|
@@ -20041,7 +20051,7 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
20041
20051
|
const dimension = cmd.dimension === "COL" ? "columns" : "rows";
|
|
20042
20052
|
return (range) => {
|
|
20043
20053
|
if (range.sheetId !== cmd.sheetId) {
|
|
20044
|
-
return { changeType: "NONE" };
|
|
20054
|
+
return { changeType: "NONE", range };
|
|
20045
20055
|
}
|
|
20046
20056
|
if (cmd.position === "after") {
|
|
20047
20057
|
if (range.zone[start] <= cmd.base && cmd.base < range.zone[end]) {
|
|
@@ -20071,13 +20081,13 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
20071
20081
|
};
|
|
20072
20082
|
}
|
|
20073
20083
|
}
|
|
20074
|
-
return { changeType: "NONE" };
|
|
20084
|
+
return { changeType: "NONE", range };
|
|
20075
20085
|
};
|
|
20076
20086
|
}
|
|
20077
20087
|
function getApplyRangeChangeDeleteSheet(cmd) {
|
|
20078
20088
|
return (range) => {
|
|
20079
20089
|
if (range.sheetId !== cmd.sheetId && range.invalidSheetName !== cmd.sheetName) {
|
|
20080
|
-
return { changeType: "NONE" };
|
|
20090
|
+
return { changeType: "NONE", range };
|
|
20081
20091
|
}
|
|
20082
20092
|
const invalidSheetName = cmd.sheetName;
|
|
20083
20093
|
range = {
|
|
@@ -20104,14 +20114,14 @@ function getApplyRangeChangeRenameSheet(cmd) {
|
|
|
20104
20114
|
const newRange = { ...range, sheetId, invalidSheetName };
|
|
20105
20115
|
return { changeType: "CHANGE", range: newRange };
|
|
20106
20116
|
}
|
|
20107
|
-
return { changeType: "NONE" };
|
|
20117
|
+
return { changeType: "NONE", range };
|
|
20108
20118
|
};
|
|
20109
20119
|
}
|
|
20110
20120
|
function getApplyRangeChangeMoveRange(cmd) {
|
|
20111
20121
|
const originZone = cmd.target[0];
|
|
20112
20122
|
return (range) => {
|
|
20113
20123
|
if (range.sheetId !== cmd.sheetId || !isZoneInside(range.zone, originZone)) {
|
|
20114
|
-
return { changeType: "NONE" };
|
|
20124
|
+
return { changeType: "NONE", range };
|
|
20115
20125
|
}
|
|
20116
20126
|
const targetSheetId = cmd.targetSheetId;
|
|
20117
20127
|
const offsetX = cmd.col - originZone.left;
|
|
@@ -20232,11 +20242,20 @@ function getCanvas$1(width = 100, height = 100) {
|
|
|
20232
20242
|
/**
|
|
20233
20243
|
* Get the default height of the cell given its style.
|
|
20234
20244
|
*/
|
|
20235
|
-
function getDefaultCellHeight(ctx, cell, style, colSize) {
|
|
20245
|
+
function getDefaultCellHeight(ctx, cell, style, locale, colSize) {
|
|
20236
20246
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
20237
20247
|
return DEFAULT_CELL_HEIGHT;
|
|
20238
20248
|
}
|
|
20239
|
-
|
|
20249
|
+
let content = "";
|
|
20250
|
+
try {
|
|
20251
|
+
if (!cell.isFormula) {
|
|
20252
|
+
const localeFormat = { format: cell.format, locale };
|
|
20253
|
+
content = formatValue(parseLiteral(cell.content, locale), localeFormat);
|
|
20254
|
+
}
|
|
20255
|
+
}
|
|
20256
|
+
catch {
|
|
20257
|
+
content = CellErrorType.GenericError;
|
|
20258
|
+
}
|
|
20240
20259
|
return getCellContentHeight(ctx, content, style, colSize);
|
|
20241
20260
|
}
|
|
20242
20261
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
@@ -21103,7 +21122,7 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
21103
21122
|
continue;
|
|
21104
21123
|
}
|
|
21105
21124
|
const sheetXC = tokens[tokenIdx].value;
|
|
21106
|
-
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange);
|
|
21125
|
+
const newSheetXC = adaptStringRange(defaultSheetId, sheetXC, applyChange).range;
|
|
21107
21126
|
if (sheetXC !== newSheetXC) {
|
|
21108
21127
|
tokens[tokenIdx] = {
|
|
21109
21128
|
value: newSheetXC,
|
|
@@ -21113,23 +21132,30 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
21113
21132
|
}
|
|
21114
21133
|
return concat$1(tokens.map((token) => token.value));
|
|
21115
21134
|
}
|
|
21116
|
-
function adaptStringRange(defaultSheetId, sheetXC,
|
|
21135
|
+
function adaptStringRange(defaultSheetId, sheetXC, rangeAdapter) {
|
|
21117
21136
|
const sheetName = splitReference(sheetXC).sheetName;
|
|
21118
21137
|
if (sheetName
|
|
21119
|
-
? !isSheetNameEqual(sheetName,
|
|
21120
|
-
: defaultSheetId !==
|
|
21121
|
-
return sheetXC;
|
|
21138
|
+
? !isSheetNameEqual(sheetName, rangeAdapter.sheetName.old)
|
|
21139
|
+
: defaultSheetId !== rangeAdapter.sheetId) {
|
|
21140
|
+
return { changeType: "NONE", range: sheetXC };
|
|
21122
21141
|
}
|
|
21123
|
-
const sheetId = sheetName ?
|
|
21142
|
+
const sheetId = sheetName ? rangeAdapter.sheetId : defaultSheetId;
|
|
21124
21143
|
const range = getRange(sheetXC, sheetId);
|
|
21125
21144
|
if (range.invalidXc) {
|
|
21126
|
-
return sheetXC;
|
|
21145
|
+
return { changeType: "NONE", range: sheetXC };
|
|
21127
21146
|
}
|
|
21128
|
-
const change =
|
|
21147
|
+
const change = rangeAdapter.applyChange(range);
|
|
21129
21148
|
if (change.changeType === "NONE" || change.changeType === "REMOVE") {
|
|
21130
|
-
return sheetXC;
|
|
21149
|
+
return { changeType: change.changeType, range: sheetXC };
|
|
21131
21150
|
}
|
|
21132
|
-
|
|
21151
|
+
const rangeStr = getRangeString(change.range, defaultSheetId, getSheetNameGetter(rangeAdapter));
|
|
21152
|
+
if (rangeStr === CellErrorType.InvalidReference) {
|
|
21153
|
+
return { changeType: "REMOVE", range: rangeStr };
|
|
21154
|
+
}
|
|
21155
|
+
return {
|
|
21156
|
+
changeType: change.changeType,
|
|
21157
|
+
range: rangeStr,
|
|
21158
|
+
};
|
|
21133
21159
|
}
|
|
21134
21160
|
function getSheetNameGetter(applyChange) {
|
|
21135
21161
|
return (sheetId) => {
|
|
@@ -21234,8 +21260,6 @@ function adaptChartRange(range, applyChange) {
|
|
|
21234
21260
|
}
|
|
21235
21261
|
const change = applyChange(range);
|
|
21236
21262
|
switch (change.changeType) {
|
|
21237
|
-
case "NONE":
|
|
21238
|
-
return range;
|
|
21239
21263
|
case "REMOVE":
|
|
21240
21264
|
return undefined;
|
|
21241
21265
|
default:
|
|
@@ -21387,16 +21411,16 @@ function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
|
21387
21411
|
function transformChartDefinitionWithDataSetsWithZone(chartSheetId, definition, applyChange) {
|
|
21388
21412
|
let labelRange;
|
|
21389
21413
|
if (definition.labelRange) {
|
|
21390
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
21391
|
-
if (
|
|
21414
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.labelRange, applyChange);
|
|
21415
|
+
if (changeType !== "REMOVE") {
|
|
21392
21416
|
labelRange = adaptedRange;
|
|
21393
21417
|
}
|
|
21394
21418
|
}
|
|
21395
21419
|
const dataSets = [];
|
|
21396
21420
|
for (const dataSet of definition.dataSets) {
|
|
21397
21421
|
const newDataSet = { ...dataSet };
|
|
21398
|
-
const adaptedRange = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
21399
|
-
if (
|
|
21422
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, dataSet.dataRange, applyChange);
|
|
21423
|
+
if (changeType !== "REMOVE") {
|
|
21400
21424
|
newDataSet.dataRange = adaptedRange;
|
|
21401
21425
|
dataSets.push(newDataSet);
|
|
21402
21426
|
}
|
|
@@ -31890,7 +31914,7 @@ function addConditionalFormatCommandAdaptRange(cmd, applyChange) {
|
|
|
31890
31914
|
cmd.cf.rule = {
|
|
31891
31915
|
...rule,
|
|
31892
31916
|
rangeValues: rule.rangeValues
|
|
31893
|
-
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange)
|
|
31917
|
+
? adaptStringRange(cmd.sheetId, rule.rangeValues, applyChange).range
|
|
31894
31918
|
: undefined,
|
|
31895
31919
|
};
|
|
31896
31920
|
}
|
|
@@ -34512,6 +34536,7 @@ function extractStyle(data, content, styleId, formatId, borderId) {
|
|
|
34512
34536
|
: undefined,
|
|
34513
34537
|
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : undefined,
|
|
34514
34538
|
textRotation: style.rotation ? rotationToXLSX(style.rotation) : undefined,
|
|
34539
|
+
shrinkToFit: style.wrapping === "clip" ? true : undefined,
|
|
34515
34540
|
},
|
|
34516
34541
|
};
|
|
34517
34542
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -34556,6 +34581,7 @@ function normalizeStyle(construct, styles) {
|
|
|
34556
34581
|
horizontal: styles.alignment.horizontal,
|
|
34557
34582
|
wrapText: styles.alignment.wrapText,
|
|
34558
34583
|
textRotation: styles.alignment.textRotation,
|
|
34584
|
+
shrinkToFit: styles.alignment.shrinkToFit,
|
|
34559
34585
|
},
|
|
34560
34586
|
};
|
|
34561
34587
|
return pushElement(style, construct.styles);
|
|
@@ -38843,7 +38869,7 @@ class CorePlugin extends BasePlugin {
|
|
|
38843
38869
|
* @param sheetId an sheetId to adapt either range of that sheet specifically, or ranges pointing to that sheet
|
|
38844
38870
|
* @param sheetName couple of old and new sheet names to adapt ranges pointing to that sheet
|
|
38845
38871
|
*/
|
|
38846
|
-
adaptRanges(
|
|
38872
|
+
adaptRanges(rangeAdapterFunctions, sheetId, sheetName) { }
|
|
38847
38873
|
}
|
|
38848
38874
|
|
|
38849
38875
|
class BordersPlugin extends CorePlugin {
|
|
@@ -38917,7 +38943,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
38917
38943
|
}
|
|
38918
38944
|
}
|
|
38919
38945
|
}
|
|
38920
|
-
adaptRanges(applyChange, sheetId) {
|
|
38946
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
38921
38947
|
const newBorders = [];
|
|
38922
38948
|
for (const border of this.borders[sheetId] ?? []) {
|
|
38923
38949
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, border.zone));
|
|
@@ -39398,7 +39424,7 @@ class CellPlugin extends CorePlugin {
|
|
|
39398
39424
|
];
|
|
39399
39425
|
nextId = 1;
|
|
39400
39426
|
cells = {};
|
|
39401
|
-
adaptRanges(applyChange, sheetId, sheetName) {
|
|
39427
|
+
adaptRanges({ applyChange }, sheetId, sheetName) {
|
|
39402
39428
|
for (const sheet of Object.keys(this.cells)) {
|
|
39403
39429
|
for (const cell of Object.values(this.cells[sheet] || {})) {
|
|
39404
39430
|
if (cell.isFormula) {
|
|
@@ -39959,12 +39985,12 @@ class ChartPlugin extends CorePlugin {
|
|
|
39959
39985
|
charts = {};
|
|
39960
39986
|
createChart = chartFactory(this.getters);
|
|
39961
39987
|
validateChartDefinition = (cmd) => validateChartDefinition(this, cmd.definition);
|
|
39962
|
-
adaptRanges(
|
|
39988
|
+
adaptRanges(rangeAdapters) {
|
|
39963
39989
|
for (const [chartId, chart] of Object.entries(this.charts)) {
|
|
39964
39990
|
if (!chart) {
|
|
39965
39991
|
continue;
|
|
39966
39992
|
}
|
|
39967
|
-
const newChart = chart.chart.updateRanges(
|
|
39993
|
+
const newChart = chart.chart.updateRanges(rangeAdapters);
|
|
39968
39994
|
this.history.update("charts", chartId, newChart ? { figureId: chart.figureId, chart: newChart } : undefined);
|
|
39969
39995
|
}
|
|
39970
39996
|
}
|
|
@@ -40785,7 +40811,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
40785
40811
|
"getAdaptedCfRanges",
|
|
40786
40812
|
];
|
|
40787
40813
|
cfRules = {};
|
|
40788
|
-
adaptCFFormulas(applyChange) {
|
|
40814
|
+
adaptCFFormulas({ applyChange, adaptFormulaString }) {
|
|
40789
40815
|
for (const sheetId in this.cfRules) {
|
|
40790
40816
|
for (const rule of this.cfRules[sheetId]) {
|
|
40791
40817
|
if (rule.rule.type === "DataBarRule" && rule.rule.rangeValues) {
|
|
@@ -40809,7 +40835,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
40809
40835
|
for (let i = 0; i < rule.rule.values.length; i++) {
|
|
40810
40836
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
40811
40837
|
//@ts-expect-error
|
|
40812
|
-
"values", i,
|
|
40838
|
+
"values", i, adaptFormulaString(sheetId, rule.rule.values[i]));
|
|
40813
40839
|
}
|
|
40814
40840
|
}
|
|
40815
40841
|
else if (rule.rule.type === "IconSetRule") {
|
|
@@ -40817,7 +40843,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
40817
40843
|
if (rule.rule[inflectionPoint].type === "formula") {
|
|
40818
40844
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
40819
40845
|
//@ts-expect-error
|
|
40820
|
-
inflectionPoint, "value",
|
|
40846
|
+
inflectionPoint, "value", adaptFormulaString(sheetId, rule.rule[inflectionPoint].value));
|
|
40821
40847
|
}
|
|
40822
40848
|
}
|
|
40823
40849
|
}
|
|
@@ -40827,14 +40853,14 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
40827
40853
|
if (ruleValue?.type === "formula" && ruleValue?.value) {
|
|
40828
40854
|
this.history.update("cfRules", sheetId, this.cfRules[sheetId].indexOf(rule), "rule",
|
|
40829
40855
|
//@ts-expect-error
|
|
40830
|
-
value, "value",
|
|
40856
|
+
value, "value", adaptFormulaString(sheetId, ruleValue.value));
|
|
40831
40857
|
}
|
|
40832
40858
|
}
|
|
40833
40859
|
}
|
|
40834
40860
|
}
|
|
40835
40861
|
}
|
|
40836
40862
|
}
|
|
40837
|
-
adaptCFRanges(sheetId, applyChange) {
|
|
40863
|
+
adaptCFRanges(sheetId, { applyChange }) {
|
|
40838
40864
|
for (const rule of this.cfRules[sheetId]) {
|
|
40839
40865
|
for (const range of rule.ranges) {
|
|
40840
40866
|
const change = applyChange(range);
|
|
@@ -40858,12 +40884,12 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
40858
40884
|
}
|
|
40859
40885
|
}
|
|
40860
40886
|
}
|
|
40861
|
-
adaptRanges(
|
|
40887
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
40862
40888
|
const sheetIds = sheetId ? [sheetId] : Object.keys(this.cfRules);
|
|
40863
40889
|
for (const sheetId of sheetIds) {
|
|
40864
|
-
this.adaptCFRanges(sheetId,
|
|
40890
|
+
this.adaptCFRanges(sheetId, rangeAdapters);
|
|
40865
40891
|
}
|
|
40866
|
-
this.adaptCFFormulas(
|
|
40892
|
+
this.adaptCFFormulas(rangeAdapters);
|
|
40867
40893
|
}
|
|
40868
40894
|
// ---------------------------------------------------------------------------
|
|
40869
40895
|
// Command Handling
|
|
@@ -41240,23 +41266,23 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
41240
41266
|
"getValidationRuleForCell",
|
|
41241
41267
|
];
|
|
41242
41268
|
rules = {};
|
|
41243
|
-
adaptRanges(
|
|
41244
|
-
this.adaptDVRanges(sheetId,
|
|
41245
|
-
this.adaptDVFormulas(
|
|
41269
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
41270
|
+
this.adaptDVRanges(sheetId, rangeAdapters);
|
|
41271
|
+
this.adaptDVFormulas(rangeAdapters);
|
|
41246
41272
|
}
|
|
41247
|
-
adaptDVFormulas(
|
|
41273
|
+
adaptDVFormulas({ adaptFormulaString }) {
|
|
41248
41274
|
for (const sheetId in this.rules) {
|
|
41249
41275
|
const rules = this.rules[sheetId];
|
|
41250
41276
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
41251
41277
|
const rule = this.rules[sheetId][ruleIndex];
|
|
41252
41278
|
for (let valueIndex = 0; valueIndex < rule.criterion.values.length; valueIndex++) {
|
|
41253
|
-
const value =
|
|
41279
|
+
const value = adaptFormulaString(sheetId, rule.criterion.values[valueIndex]);
|
|
41254
41280
|
this.history.update("rules", sheetId, ruleIndex, "criterion", "values", valueIndex, value);
|
|
41255
41281
|
}
|
|
41256
41282
|
}
|
|
41257
41283
|
}
|
|
41258
41284
|
}
|
|
41259
|
-
adaptDVRanges(sheetId, applyChange) {
|
|
41285
|
+
adaptDVRanges(sheetId, { applyChange }) {
|
|
41260
41286
|
const rules = this.rules[sheetId];
|
|
41261
41287
|
for (let ruleIndex = rules.length - 1; ruleIndex >= 0; ruleIndex--) {
|
|
41262
41288
|
const rule = this.rules[sheetId][ruleIndex];
|
|
@@ -41530,7 +41556,7 @@ class FigurePlugin extends CorePlugin {
|
|
|
41530
41556
|
// ---------------------------------------------------------------------------
|
|
41531
41557
|
// Command Handling
|
|
41532
41558
|
// ---------------------------------------------------------------------------
|
|
41533
|
-
adaptRanges(applyChange, sheetId) {
|
|
41559
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
41534
41560
|
for (const figure of this.getFigures(sheetId)) {
|
|
41535
41561
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, {
|
|
41536
41562
|
left: figure.col,
|
|
@@ -42770,8 +42796,8 @@ class MergePlugin extends CorePlugin {
|
|
|
42770
42796
|
break;
|
|
42771
42797
|
}
|
|
42772
42798
|
}
|
|
42773
|
-
adaptRanges(
|
|
42774
|
-
this.applyRangeChangeOnSheet(sheetId,
|
|
42799
|
+
adaptRanges(rangeAdapters, sheetId) {
|
|
42800
|
+
this.applyRangeChangeOnSheet(sheetId, rangeAdapters);
|
|
42775
42801
|
}
|
|
42776
42802
|
// ---------------------------------------------------------------------------
|
|
42777
42803
|
// Getters
|
|
@@ -43071,7 +43097,7 @@ class MergePlugin extends CorePlugin {
|
|
|
43071
43097
|
/**
|
|
43072
43098
|
* Apply a range change on merges of a particular sheet.
|
|
43073
43099
|
*/
|
|
43074
|
-
applyRangeChangeOnSheet(sheetId, applyChange) {
|
|
43100
|
+
applyRangeChangeOnSheet(sheetId, { applyChange }) {
|
|
43075
43101
|
const merges = Object.entries(this.merges[sheetId] || {});
|
|
43076
43102
|
for (const [mergeId, range] of merges) {
|
|
43077
43103
|
if (range) {
|
|
@@ -44690,8 +44716,6 @@ function adaptPivotRange(range, applyChange) {
|
|
|
44690
44716
|
}
|
|
44691
44717
|
const change = applyChange(range);
|
|
44692
44718
|
switch (change.changeType) {
|
|
44693
|
-
case "NONE":
|
|
44694
|
-
return range;
|
|
44695
44719
|
case "REMOVE":
|
|
44696
44720
|
return undefined;
|
|
44697
44721
|
default:
|
|
@@ -44800,7 +44824,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
44800
44824
|
}
|
|
44801
44825
|
}
|
|
44802
44826
|
}
|
|
44803
|
-
adaptRanges(applyChange) {
|
|
44827
|
+
adaptRanges({ applyChange, adaptFormulaString }) {
|
|
44804
44828
|
for (const pivotId in this.pivots) {
|
|
44805
44829
|
const definition = deepCopy(this.pivots[pivotId]?.definition);
|
|
44806
44830
|
if (!definition) {
|
|
@@ -44820,19 +44844,13 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
44820
44844
|
continue;
|
|
44821
44845
|
}
|
|
44822
44846
|
const sheetId = measure.computedBy.sheetId;
|
|
44823
|
-
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId]
|
|
44824
|
-
|
|
44825
|
-
|
|
44826
|
-
|
|
44827
|
-
|
|
44828
|
-
newDependencies.push(range);
|
|
44829
|
-
}
|
|
44830
|
-
else {
|
|
44831
|
-
newDependencies.push(change.range);
|
|
44832
|
-
}
|
|
44833
|
-
}
|
|
44834
|
-
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
44847
|
+
const { formula: compiledFormula, dependencies: indirectDependencies } = this.compiledMeasureFormulas[pivotId][measureId];
|
|
44848
|
+
// adapt direct dependencies
|
|
44849
|
+
this.history.update("compiledMeasureFormulas", pivotId, measureId, "formula", "dependencies", compiledFormula.dependencies.map((range) => applyChange(range).range));
|
|
44850
|
+
// adapt all dependencies (including indirect)
|
|
44851
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", indirectDependencies.map((range) => applyChange(range).range));
|
|
44835
44852
|
const oldFormulaString = measure.computedBy.formula;
|
|
44853
|
+
const newFormulaString = adaptFormulaString(sheetId, oldFormulaString);
|
|
44836
44854
|
if (newFormulaString !== oldFormulaString) {
|
|
44837
44855
|
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
44838
44856
|
}
|
|
@@ -44994,7 +45012,6 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
44994
45012
|
formula: newFormulaString,
|
|
44995
45013
|
sheetId: measure.computedBy.sheetId,
|
|
44996
45014
|
});
|
|
44997
|
-
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
44998
45015
|
}
|
|
44999
45016
|
checkSortedColumnInMeasures(definition) {
|
|
45000
45017
|
const measures = definition.measures.map((measure) => measure.id);
|
|
@@ -46081,7 +46098,7 @@ class StylePlugin extends CorePlugin {
|
|
|
46081
46098
|
break;
|
|
46082
46099
|
}
|
|
46083
46100
|
}
|
|
46084
|
-
adaptRanges(applyChange, sheetId) {
|
|
46101
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
46085
46102
|
const newStyles = [];
|
|
46086
46103
|
for (const style of this.styles[sheetId] ?? []) {
|
|
46087
46104
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, style.zone));
|
|
@@ -46594,7 +46611,7 @@ class TablePlugin extends CorePlugin {
|
|
|
46594
46611
|
static getters = ["getCoreTable", "getCoreTables", "getCoreTableMatchingTopLeft"];
|
|
46595
46612
|
tables = {};
|
|
46596
46613
|
nextTableId = 1;
|
|
46597
|
-
adaptRanges(applyChange, sheetId) {
|
|
46614
|
+
adaptRanges({ applyChange }, sheetId) {
|
|
46598
46615
|
for (const table of this.getCoreTables(sheetId)) {
|
|
46599
46616
|
this.applyRangeChangeOnTable(sheetId, table, applyChange);
|
|
46600
46617
|
}
|
|
@@ -48426,11 +48443,16 @@ class SpreadingRelation {
|
|
|
48426
48443
|
return this.arrayFormulasToResults.get(formulasPosition);
|
|
48427
48444
|
}
|
|
48428
48445
|
/**
|
|
48429
|
-
* Remove a
|
|
48446
|
+
* Remove a spreading relation for a given array formula position
|
|
48447
|
+
* and its result zone
|
|
48430
48448
|
*/
|
|
48431
48449
|
removeNode(position) {
|
|
48450
|
+
const resultZone = this.arrayFormulasToResults.get(position);
|
|
48451
|
+
if (!resultZone) {
|
|
48452
|
+
return;
|
|
48453
|
+
}
|
|
48432
48454
|
this.resultsToArrayFormulas.remove({
|
|
48433
|
-
boundingBox: { sheetId: position.sheetId, zone:
|
|
48455
|
+
boundingBox: { sheetId: position.sheetId, zone: resultZone },
|
|
48434
48456
|
data: position,
|
|
48435
48457
|
});
|
|
48436
48458
|
this.arrayFormulasToResults.delete(position);
|
|
@@ -48757,6 +48779,10 @@ class Evaluator {
|
|
|
48757
48779
|
// empty matrix
|
|
48758
48780
|
return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
|
|
48759
48781
|
}
|
|
48782
|
+
if (nbRows === 1 && nbColumns === 1) {
|
|
48783
|
+
// single value matrix
|
|
48784
|
+
return createEvaluatedCell(validateNumberValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
|
|
48785
|
+
}
|
|
48760
48786
|
const resultZone = {
|
|
48761
48787
|
top: formulaPosition.row,
|
|
48762
48788
|
bottom: formulaPosition.row + nbRows - 1,
|
|
@@ -50362,14 +50388,14 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
50362
50388
|
let baseline;
|
|
50363
50389
|
let keyValue;
|
|
50364
50390
|
if (definition.baseline) {
|
|
50365
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
50366
|
-
if (
|
|
50391
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.baseline, applyChange);
|
|
50392
|
+
if (changeType !== "REMOVE") {
|
|
50367
50393
|
baseline = adaptedRange;
|
|
50368
50394
|
}
|
|
50369
50395
|
}
|
|
50370
50396
|
if (definition.keyValue) {
|
|
50371
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
50372
|
-
if (
|
|
50397
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.keyValue, applyChange);
|
|
50398
|
+
if (changeType !== "REMOVE") {
|
|
50373
50399
|
keyValue = adaptedRange;
|
|
50374
50400
|
}
|
|
50375
50401
|
}
|
|
@@ -50426,7 +50452,7 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
50426
50452
|
// This kind of graph is not exportable in Excel
|
|
50427
50453
|
return undefined;
|
|
50428
50454
|
}
|
|
50429
|
-
updateRanges(applyChange) {
|
|
50455
|
+
updateRanges({ applyChange }) {
|
|
50430
50456
|
const baseline = adaptChartRange(this.baseline, applyChange);
|
|
50431
50457
|
const keyValue = adaptChartRange(this.keyValue, applyChange);
|
|
50432
50458
|
if (this.baseline === baseline && this.keyValue === keyValue) {
|
|
@@ -50879,15 +50905,15 @@ async function chartToImageUrl(runtime, figure, type) {
|
|
|
50879
50905
|
if (!extensionsLoaded) {
|
|
50880
50906
|
registerChartJSExtensions();
|
|
50881
50907
|
}
|
|
50882
|
-
|
|
50883
|
-
|
|
50908
|
+
const config = deepCopy(runtime.chartJsConfig);
|
|
50909
|
+
config.plugins = [backgroundColorChartJSPlugin];
|
|
50910
|
+
if (!globalThis.Chart.registry.controllers.get(config.type)) {
|
|
50911
|
+
console.log(`Chart of type "${config.type}" is not registered in Chart.js library.`);
|
|
50884
50912
|
if (!extensionsLoaded) {
|
|
50885
50913
|
unregisterChartJsExtensions();
|
|
50886
50914
|
}
|
|
50887
50915
|
return imageUrl;
|
|
50888
50916
|
}
|
|
50889
|
-
const config = deepCopy(runtime.chartJsConfig);
|
|
50890
|
-
config.plugins = [backgroundColorChartJSPlugin];
|
|
50891
50917
|
const chart = new globalThis.Chart(canvas, config);
|
|
50892
50918
|
try {
|
|
50893
50919
|
imageUrl = await canvasToObjectUrl(canvas);
|
|
@@ -50927,15 +50953,15 @@ async function chartToImageFile(runtime, figure, type) {
|
|
|
50927
50953
|
if (!extensionsLoaded) {
|
|
50928
50954
|
registerChartJSExtensions();
|
|
50929
50955
|
}
|
|
50930
|
-
|
|
50931
|
-
|
|
50956
|
+
const config = deepCopy(runtime.chartJsConfig);
|
|
50957
|
+
config.plugins = [backgroundColorChartJSPlugin];
|
|
50958
|
+
if (!globalThis.Chart.registry.controllers.get(config.type)) {
|
|
50959
|
+
console.log(`Chart of type "${config.type}" is not registered in Chart.js library.`);
|
|
50932
50960
|
if (!extensionsLoaded) {
|
|
50933
50961
|
unregisterChartJsExtensions();
|
|
50934
50962
|
}
|
|
50935
50963
|
return chartBlob;
|
|
50936
50964
|
}
|
|
50937
|
-
const config = deepCopy(runtime.chartJsConfig);
|
|
50938
|
-
config.plugins = [backgroundColorChartJSPlugin];
|
|
50939
50965
|
const chart = new globalThis.Chart(canvas, config);
|
|
50940
50966
|
try {
|
|
50941
50967
|
chartBlob = await canvasToBlob(canvas);
|
|
@@ -51600,6 +51626,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
51600
51626
|
handle(cmd) {
|
|
51601
51627
|
switch (cmd.type) {
|
|
51602
51628
|
case "START":
|
|
51629
|
+
case "UPDATE_LOCALE":
|
|
51603
51630
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
51604
51631
|
this.initializeSheet(sheetId);
|
|
51605
51632
|
}
|
|
@@ -51737,7 +51764,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
|
|
|
51737
51764
|
const cell = this.getters.getCell(position);
|
|
51738
51765
|
const style = this.getters.getCellStyle(position);
|
|
51739
51766
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
51740
|
-
return getDefaultCellHeight(this.ctx, cell, style, colSize);
|
|
51767
|
+
return getDefaultCellHeight(this.ctx, cell, style, this.getters.getLocale(), colSize);
|
|
51741
51768
|
}
|
|
51742
51769
|
isInMultiRowMerge(position) {
|
|
51743
51770
|
const merge = this.getters.getMerge(position);
|
|
@@ -59329,7 +59356,7 @@ const coreViewsPluginRegistry = new Registry$2()
|
|
|
59329
59356
|
.add("pivot_ui", PivotUIPlugin)
|
|
59330
59357
|
.add("cell_icon", CellIconPlugin);
|
|
59331
59358
|
|
|
59332
|
-
class
|
|
59359
|
+
class RangeAdapterPlugin {
|
|
59333
59360
|
getters;
|
|
59334
59361
|
providers = [];
|
|
59335
59362
|
isAdaptingRanges = false;
|
|
@@ -59337,7 +59364,6 @@ class RangeAdapter {
|
|
|
59337
59364
|
this.getters = getters;
|
|
59338
59365
|
}
|
|
59339
59366
|
static getters = [
|
|
59340
|
-
"adaptFormulaStringDependencies",
|
|
59341
59367
|
"copyFormulaStringForSheet",
|
|
59342
59368
|
"extendRange",
|
|
59343
59369
|
"getRangeString",
|
|
@@ -59368,8 +59394,8 @@ class RangeAdapter {
|
|
|
59368
59394
|
throw new Error("Plugins cannot dispatch commands during adaptRanges phase");
|
|
59369
59395
|
}
|
|
59370
59396
|
const rangeAdapter = getRangeAdapter(cmd);
|
|
59371
|
-
if (rangeAdapter
|
|
59372
|
-
this.executeOnAllRanges(rangeAdapter
|
|
59397
|
+
if (rangeAdapter) {
|
|
59398
|
+
this.executeOnAllRanges(rangeAdapter);
|
|
59373
59399
|
}
|
|
59374
59400
|
}
|
|
59375
59401
|
finalize() { }
|
|
@@ -59388,11 +59414,15 @@ class RangeAdapter {
|
|
|
59388
59414
|
return result;
|
|
59389
59415
|
};
|
|
59390
59416
|
}
|
|
59391
|
-
executeOnAllRanges(
|
|
59417
|
+
executeOnAllRanges(rangeAdapter) {
|
|
59392
59418
|
this.isAdaptingRanges = true;
|
|
59393
|
-
const
|
|
59419
|
+
const adapterFunctions = {
|
|
59420
|
+
applyChange: this.verifyRangeRemoved(rangeAdapter.applyChange),
|
|
59421
|
+
adaptRangeString: (defaultSheetId, sheetXC) => adaptStringRange(defaultSheetId, sheetXC, rangeAdapter),
|
|
59422
|
+
adaptFormulaString: (defaultSheetId, formula) => adaptFormulaStringRanges(defaultSheetId, formula, rangeAdapter),
|
|
59423
|
+
};
|
|
59394
59424
|
for (const provider of this.providers) {
|
|
59395
|
-
provider(
|
|
59425
|
+
provider(adapterFunctions, rangeAdapter.sheetId, rangeAdapter.sheetName);
|
|
59396
59426
|
}
|
|
59397
59427
|
this.isAdaptingRanges = false;
|
|
59398
59428
|
}
|
|
@@ -59560,18 +59590,6 @@ class RangeAdapter {
|
|
|
59560
59590
|
const unionOfZones = unionUnboundedZones(...zones);
|
|
59561
59591
|
return this.getRangeFromZone(ranges[0].sheetId, unionOfZones);
|
|
59562
59592
|
}
|
|
59563
|
-
adaptFormulaStringDependencies(sheetId, formula, applyChange) {
|
|
59564
|
-
if (!formula.startsWith("=")) {
|
|
59565
|
-
return formula;
|
|
59566
|
-
}
|
|
59567
|
-
const compiledFormula = compile(formula);
|
|
59568
|
-
const updatedDependencies = compiledFormula.dependencies.map((dep) => {
|
|
59569
|
-
const range = this.getters.getRangeFromSheetXC(sheetId, dep);
|
|
59570
|
-
const changedRange = applyChange(range);
|
|
59571
|
-
return changedRange.changeType === "NONE" ? range : changedRange.range;
|
|
59572
|
-
});
|
|
59573
|
-
return this.getters.getFormulaString(sheetId, compiledFormula.tokens, updatedDependencies);
|
|
59574
|
-
}
|
|
59575
59593
|
/**
|
|
59576
59594
|
* Copy a formula string to another sheet.
|
|
59577
59595
|
*
|
|
@@ -62016,6 +62034,9 @@ function addStyles(styles) {
|
|
|
62016
62034
|
if (style.alignment && style.alignment.textRotation) {
|
|
62017
62035
|
alignAttrs.push(["textRotation", style.alignment.textRotation]);
|
|
62018
62036
|
}
|
|
62037
|
+
if (style.alignment && style.alignment.shrinkToFit) {
|
|
62038
|
+
alignAttrs.push(["shrinkToFit", "1"]);
|
|
62039
|
+
}
|
|
62019
62040
|
if (alignAttrs.length > 0) {
|
|
62020
62041
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
62021
62042
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
@@ -62810,7 +62831,7 @@ class Model extends EventBus {
|
|
|
62810
62831
|
this.config = this.setupConfig(config);
|
|
62811
62832
|
this.session = this.setupSession(workbookData.revisionId);
|
|
62812
62833
|
this.coreGetters = {};
|
|
62813
|
-
this.range = new
|
|
62834
|
+
this.range = new RangeAdapterPlugin(this.coreGetters);
|
|
62814
62835
|
this.coreGetters.getRangeString = this.range.getRangeString.bind(this.range);
|
|
62815
62836
|
this.coreGetters.getRangeFromSheetXC = this.range.getRangeFromSheetXC.bind(this.range);
|
|
62816
62837
|
this.coreGetters.createAdaptedRanges = this.range.createAdaptedRanges.bind(this.range);
|
|
@@ -62824,8 +62845,6 @@ class Model extends EventBus {
|
|
|
62824
62845
|
this.coreGetters.extendRange = this.range.extendRange.bind(this.range);
|
|
62825
62846
|
this.coreGetters.getRangesUnion = this.range.getRangesUnion.bind(this.range);
|
|
62826
62847
|
this.coreGetters.removeRangesSheetPrefix = this.range.removeRangesSheetPrefix.bind(this.range);
|
|
62827
|
-
this.coreGetters.adaptFormulaStringDependencies =
|
|
62828
|
-
this.range.adaptFormulaStringDependencies.bind(this.range);
|
|
62829
62848
|
this.coreGetters.copyFormulaStringForSheet = this.range.copyFormulaStringForSheet.bind(this.range);
|
|
62830
62849
|
this.getters = {
|
|
62831
62850
|
isReadonly: () => this.config.mode === "readonly" || this.config.mode === "dashboard",
|
|
@@ -66953,7 +66972,7 @@ class BarChart extends AbstractChart {
|
|
|
66953
66972
|
verticalAxis: getDefinedAxis(definition),
|
|
66954
66973
|
};
|
|
66955
66974
|
}
|
|
66956
|
-
updateRanges(applyChange) {
|
|
66975
|
+
updateRanges({ applyChange }) {
|
|
66957
66976
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
66958
66977
|
if (!isStale) {
|
|
66959
66978
|
return this;
|
|
@@ -67064,8 +67083,8 @@ class GaugeChart extends AbstractChart {
|
|
|
67064
67083
|
static transformDefinition(chartSheetId, definition, applyChange) {
|
|
67065
67084
|
let dataRange;
|
|
67066
67085
|
if (definition.dataRange) {
|
|
67067
|
-
const adaptedRange = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
67068
|
-
if (
|
|
67086
|
+
const { changeType, range: adaptedRange } = adaptStringRange(chartSheetId, definition.dataRange, applyChange);
|
|
67087
|
+
if (changeType !== "REMOVE") {
|
|
67069
67088
|
dataRange = adaptedRange;
|
|
67070
67089
|
}
|
|
67071
67090
|
}
|
|
@@ -67142,13 +67161,9 @@ class GaugeChart extends AbstractChart {
|
|
|
67142
67161
|
: undefined,
|
|
67143
67162
|
};
|
|
67144
67163
|
}
|
|
67145
|
-
updateRanges(applyChange,
|
|
67164
|
+
updateRanges({ applyChange, adaptFormulaString }) {
|
|
67146
67165
|
const dataRange = adaptChartRange(this.dataRange, applyChange);
|
|
67147
|
-
const adaptFormula = (formula) =>
|
|
67148
|
-
applyChange,
|
|
67149
|
-
sheetId,
|
|
67150
|
-
sheetName: adaptSheetName,
|
|
67151
|
-
});
|
|
67166
|
+
const adaptFormula = (formula) => adaptFormulaString(this.sheetId, formula);
|
|
67152
67167
|
const sectionRule = adaptSectionRuleFormulas(this.sectionRule, adaptFormula);
|
|
67153
67168
|
const definition = this.getDefinitionWithSpecificRanges(dataRange, sectionRule);
|
|
67154
67169
|
return new GaugeChart(definition, this.sheetId, this.getters);
|
|
@@ -67390,7 +67405,7 @@ class LineChart extends AbstractChart {
|
|
|
67390
67405
|
: undefined,
|
|
67391
67406
|
};
|
|
67392
67407
|
}
|
|
67393
|
-
updateRanges(applyChange) {
|
|
67408
|
+
updateRanges({ applyChange }) {
|
|
67394
67409
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
67395
67410
|
if (!isStale) {
|
|
67396
67411
|
return this;
|
|
@@ -67547,7 +67562,7 @@ class PieChart extends AbstractChart {
|
|
|
67547
67562
|
labelRange,
|
|
67548
67563
|
};
|
|
67549
67564
|
}
|
|
67550
|
-
updateRanges(applyChange) {
|
|
67565
|
+
updateRanges({ applyChange }) {
|
|
67551
67566
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
67552
67567
|
if (!isStale) {
|
|
67553
67568
|
return this;
|
|
@@ -67712,7 +67727,7 @@ class WaterfallChart extends AbstractChart {
|
|
|
67712
67727
|
// TODO: implement export excel
|
|
67713
67728
|
return undefined;
|
|
67714
67729
|
}
|
|
67715
|
-
updateRanges(applyChange) {
|
|
67730
|
+
updateRanges({ applyChange }) {
|
|
67716
67731
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
67717
67732
|
if (!isStale) {
|
|
67718
67733
|
return this;
|
|
@@ -72088,7 +72103,6 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
72088
72103
|
});
|
|
72089
72104
|
}
|
|
72090
72105
|
handleEvent(event) {
|
|
72091
|
-
this.hideHelp();
|
|
72092
72106
|
const sheetId = this.getters.getActiveSheetId();
|
|
72093
72107
|
let unboundedZone;
|
|
72094
72108
|
if (event.options.unbounded) {
|
|
@@ -72410,6 +72424,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
72410
72424
|
this.colorIndexByRange = {};
|
|
72411
72425
|
this.hoveredTokens = [];
|
|
72412
72426
|
this.hoveredContentEvaluation = "";
|
|
72427
|
+
this.hideHelp();
|
|
72413
72428
|
}
|
|
72414
72429
|
/**
|
|
72415
72430
|
* Reset the current content to the active cell content
|
|
@@ -84436,7 +84451,7 @@ class GaugeChartConfigPanel extends Component {
|
|
|
84436
84451
|
});
|
|
84437
84452
|
dataRange = this.props.definition.dataRange;
|
|
84438
84453
|
get configurationErrorMessages() {
|
|
84439
|
-
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])];
|
|
84454
|
+
const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
84440
84455
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
84441
84456
|
}
|
|
84442
84457
|
get isDataRangeInvalid() {
|
|
@@ -84478,7 +84493,7 @@ class GaugeChartDesignPanel extends Component {
|
|
|
84478
84493
|
});
|
|
84479
84494
|
}
|
|
84480
84495
|
get designErrorMessages() {
|
|
84481
|
-
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])];
|
|
84496
|
+
const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
84482
84497
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
84483
84498
|
}
|
|
84484
84499
|
get isRangeMinInvalid() {
|
|
@@ -84854,7 +84869,7 @@ class ScatterChart extends AbstractChart {
|
|
|
84854
84869
|
: undefined,
|
|
84855
84870
|
};
|
|
84856
84871
|
}
|
|
84857
|
-
updateRanges(applyChange) {
|
|
84872
|
+
updateRanges({ applyChange }) {
|
|
84858
84873
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
84859
84874
|
if (!isStale) {
|
|
84860
84875
|
return this;
|
|
@@ -84959,7 +84974,7 @@ class ScorecardChartConfigPanel extends Component {
|
|
|
84959
84974
|
const cancelledReasons = [
|
|
84960
84975
|
...(this.state.keyValueDispatchResult?.reasons || []),
|
|
84961
84976
|
...(this.state.baselineDispatchResult?.reasons || []),
|
|
84962
|
-
];
|
|
84977
|
+
].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
84963
84978
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
84964
84979
|
}
|
|
84965
84980
|
get isKeyValueInvalid() {
|
|
@@ -95473,7 +95488,7 @@ class CalendarChart extends AbstractChart {
|
|
|
95473
95488
|
getDefinitionForExcel() {
|
|
95474
95489
|
return undefined;
|
|
95475
95490
|
}
|
|
95476
|
-
updateRanges(applyChange) {
|
|
95491
|
+
updateRanges({ applyChange }) {
|
|
95477
95492
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
95478
95493
|
if (!isStale) {
|
|
95479
95494
|
return this;
|
|
@@ -95601,7 +95616,7 @@ class ComboChart extends AbstractChart {
|
|
|
95601
95616
|
verticalAxis: getDefinedAxis(definition),
|
|
95602
95617
|
};
|
|
95603
95618
|
}
|
|
95604
|
-
updateRanges(applyChange) {
|
|
95619
|
+
updateRanges({ applyChange }) {
|
|
95605
95620
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
95606
95621
|
if (!isStale) {
|
|
95607
95622
|
return this;
|
|
@@ -95777,7 +95792,7 @@ class FunnelChart extends AbstractChart {
|
|
|
95777
95792
|
getDefinitionForExcel() {
|
|
95778
95793
|
return undefined;
|
|
95779
95794
|
}
|
|
95780
|
-
updateRanges(applyChange) {
|
|
95795
|
+
updateRanges({ applyChange }) {
|
|
95781
95796
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
95782
95797
|
if (!isStale) {
|
|
95783
95798
|
return this;
|
|
@@ -95908,7 +95923,7 @@ class GeoChart extends AbstractChart {
|
|
|
95908
95923
|
getDefinitionForExcel() {
|
|
95909
95924
|
return undefined;
|
|
95910
95925
|
}
|
|
95911
|
-
updateRanges(applyChange) {
|
|
95926
|
+
updateRanges({ applyChange }) {
|
|
95912
95927
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
95913
95928
|
if (!isStale) {
|
|
95914
95929
|
return this;
|
|
@@ -96059,7 +96074,7 @@ class PyramidChart extends AbstractChart {
|
|
|
96059
96074
|
maxValue,
|
|
96060
96075
|
};
|
|
96061
96076
|
}
|
|
96062
|
-
updateRanges(applyChange) {
|
|
96077
|
+
updateRanges({ applyChange }) {
|
|
96063
96078
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
96064
96079
|
if (!isStale) {
|
|
96065
96080
|
return this;
|
|
@@ -96209,7 +96224,7 @@ class RadarChart extends AbstractChart {
|
|
|
96209
96224
|
labelRange,
|
|
96210
96225
|
};
|
|
96211
96226
|
}
|
|
96212
|
-
updateRanges(applyChange) {
|
|
96227
|
+
updateRanges({ applyChange }) {
|
|
96213
96228
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
96214
96229
|
if (!isStale) {
|
|
96215
96230
|
return this;
|
|
@@ -96346,7 +96361,7 @@ class SunburstChart extends AbstractChart {
|
|
|
96346
96361
|
getDefinitionForExcel() {
|
|
96347
96362
|
return undefined;
|
|
96348
96363
|
}
|
|
96349
|
-
updateRanges(applyChange) {
|
|
96364
|
+
updateRanges({ applyChange }) {
|
|
96350
96365
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
96351
96366
|
if (!isStale) {
|
|
96352
96367
|
return this;
|
|
@@ -96496,7 +96511,7 @@ class TreeMapChart extends AbstractChart {
|
|
|
96496
96511
|
getDefinitionForExcel() {
|
|
96497
96512
|
return undefined;
|
|
96498
96513
|
}
|
|
96499
|
-
updateRanges(applyChange) {
|
|
96514
|
+
updateRanges({ applyChange }) {
|
|
96500
96515
|
const { dataSets, labelRange, isStale } = updateChartRangesWithDataSets(this.getters, applyChange, this.dataSets, this.labelRange);
|
|
96501
96516
|
if (!isStale) {
|
|
96502
96517
|
return this;
|
|
@@ -98032,6 +98047,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
98032
98047
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CorePlugin, CoreViewPlugin, DEFAULT_LOCALE, DEFAULT_LOCALES, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry$1 as Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, categories, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, createAutocompleteArgumentsProvider, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse$1 as parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
98033
98048
|
|
|
98034
98049
|
|
|
98035
|
-
__info__.version = "19.1.
|
|
98036
|
-
__info__.date = "2026-01-
|
|
98037
|
-
__info__.hash = "
|
|
98050
|
+
__info__.version = "19.1.4";
|
|
98051
|
+
__info__.date = "2026-01-21T11:07:17.372Z";
|
|
98052
|
+
__info__.hash = "ceae12a";
|