@odoo/o-spreadsheet 18.3.18 → 18.3.19
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 +140 -98
- package/dist/o-spreadsheet.d.ts +67 -62
- package/dist/o-spreadsheet.esm.js +140 -98
- package/dist/o-spreadsheet.iife.js +140 -98
- package/dist/o-spreadsheet.iife.min.js +381 -381
- 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 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.19
|
|
6
|
+
* @date 2025-09-05T07:38:30.661Z
|
|
7
|
+
* @hash 77fd307
|
|
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';
|
|
@@ -3497,6 +3497,7 @@ const invalidateBordersCommands = new Set([
|
|
|
3497
3497
|
"AUTOFILL_CELL",
|
|
3498
3498
|
"SET_BORDER",
|
|
3499
3499
|
"SET_ZONE_BORDERS",
|
|
3500
|
+
"SET_BORDERS_ON_TARGET",
|
|
3500
3501
|
]);
|
|
3501
3502
|
const readonlyAllowedCommands = new Set([
|
|
3502
3503
|
"START",
|
|
@@ -6442,40 +6443,44 @@ function orderRange(range) {
|
|
|
6442
6443
|
};
|
|
6443
6444
|
}
|
|
6444
6445
|
function getRangeAdapter(cmd) {
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
applyChange: getApplyRangeChangeAddColRow(cmd),
|
|
6455
|
-
sheetId: cmd.sheetId,
|
|
6456
|
-
sheetName: cmd.sheetName,
|
|
6457
|
-
};
|
|
6458
|
-
case "DELETE_SHEET":
|
|
6459
|
-
return {
|
|
6460
|
-
applyChange: getApplyRangeChangeDeleteSheet(cmd),
|
|
6461
|
-
sheetId: cmd.sheetId,
|
|
6462
|
-
sheetName: cmd.sheetName,
|
|
6463
|
-
};
|
|
6464
|
-
case "RENAME_SHEET":
|
|
6465
|
-
return {
|
|
6466
|
-
applyChange: getApplyRangeChangeRenameSheet(cmd),
|
|
6467
|
-
sheetId: cmd.sheetId,
|
|
6468
|
-
sheetName: cmd.oldName,
|
|
6469
|
-
};
|
|
6470
|
-
case "MOVE_RANGES":
|
|
6471
|
-
return {
|
|
6472
|
-
applyChange: getApplyRangeChangeMoveRange(cmd),
|
|
6473
|
-
sheetId: cmd.sheetId,
|
|
6474
|
-
sheetName: cmd.sheetName,
|
|
6475
|
-
};
|
|
6446
|
+
return rangeAdapterRegistry.get(cmd.type)?.(cmd);
|
|
6447
|
+
}
|
|
6448
|
+
class RangeAdapterRegistry extends Registry {
|
|
6449
|
+
add(cmdType, fn) {
|
|
6450
|
+
super.add(cmdType, fn);
|
|
6451
|
+
return this;
|
|
6452
|
+
}
|
|
6453
|
+
get(cmdType) {
|
|
6454
|
+
return this.content[cmdType];
|
|
6476
6455
|
}
|
|
6477
|
-
return undefined;
|
|
6478
6456
|
}
|
|
6457
|
+
const rangeAdapterRegistry = new RangeAdapterRegistry();
|
|
6458
|
+
rangeAdapterRegistry
|
|
6459
|
+
.add("REMOVE_COLUMNS_ROWS", (cmd) => ({
|
|
6460
|
+
applyChange: getApplyRangeChangeRemoveColRow(cmd),
|
|
6461
|
+
sheetId: cmd.sheetId,
|
|
6462
|
+
sheetName: { old: cmd.sheetName, current: cmd.sheetName },
|
|
6463
|
+
}))
|
|
6464
|
+
.add("ADD_COLUMNS_ROWS", (cmd) => ({
|
|
6465
|
+
applyChange: getApplyRangeChangeAddColRow(cmd),
|
|
6466
|
+
sheetId: cmd.sheetId,
|
|
6467
|
+
sheetName: { old: cmd.sheetName, current: cmd.sheetName },
|
|
6468
|
+
}))
|
|
6469
|
+
.add("DELETE_SHEET", (cmd) => ({
|
|
6470
|
+
applyChange: getApplyRangeChangeDeleteSheet(cmd),
|
|
6471
|
+
sheetId: cmd.sheetId,
|
|
6472
|
+
sheetName: { old: cmd.sheetName, current: cmd.sheetName },
|
|
6473
|
+
}))
|
|
6474
|
+
.add("RENAME_SHEET", (cmd) => ({
|
|
6475
|
+
applyChange: getApplyRangeChangeRenameSheet(cmd),
|
|
6476
|
+
sheetId: cmd.sheetId,
|
|
6477
|
+
sheetName: { old: cmd.oldName, current: cmd.newName },
|
|
6478
|
+
}))
|
|
6479
|
+
.add("MOVE_RANGES", (cmd) => ({
|
|
6480
|
+
applyChange: getApplyRangeChangeMoveRange(cmd),
|
|
6481
|
+
sheetId: cmd.sheetId,
|
|
6482
|
+
sheetName: { old: cmd.sheetName, current: cmd.sheetName },
|
|
6483
|
+
}));
|
|
6479
6484
|
function getApplyRangeChangeRemoveColRow(cmd) {
|
|
6480
6485
|
let start = cmd.dimension === "COL" ? "left" : "top";
|
|
6481
6486
|
let end = cmd.dimension === "COL" ? "right" : "bottom";
|
|
@@ -7826,8 +7831,11 @@ function invertMatrix(M) {
|
|
|
7826
7831
|
// (a) Swap 2 rows. This multiply the determinant by -1.
|
|
7827
7832
|
// (b) Multiply a row by a scalar. This multiply the determinant by that scalar.
|
|
7828
7833
|
// (c) Add to a row a multiple of another row. This does not change the determinant.
|
|
7834
|
+
if (M.length < 1 || M[0].length < 1) {
|
|
7835
|
+
throw new Error("invertMatrix: an empty matrix cannot be inverted.");
|
|
7836
|
+
}
|
|
7829
7837
|
if (M.length !== M[0].length) {
|
|
7830
|
-
throw new
|
|
7838
|
+
throw new Error("invertMatrix: only square matrices are invertible");
|
|
7831
7839
|
}
|
|
7832
7840
|
let determinant = 1;
|
|
7833
7841
|
const dim = M.length;
|
|
@@ -7896,8 +7904,11 @@ function swapMatrixRows(matrix, row1, row2) {
|
|
|
7896
7904
|
* Note: we use indexing [col][row] instead of the standard mathematical notation [row][col]
|
|
7897
7905
|
*/
|
|
7898
7906
|
function multiplyMatrices(matrix1, matrix2) {
|
|
7907
|
+
if (matrix1.length < 1 || matrix2.length < 1) {
|
|
7908
|
+
throw new Error("multiplyMatrices: empty matrices cannot be multiplied.");
|
|
7909
|
+
}
|
|
7899
7910
|
if (matrix1.length !== matrix2[0].length) {
|
|
7900
|
-
throw new
|
|
7911
|
+
throw new Error("multiplyMatrices: incompatible matrices size.");
|
|
7901
7912
|
}
|
|
7902
7913
|
const rowsM1 = matrix1[0].length;
|
|
7903
7914
|
const colsM2 = matrix2.length;
|
|
@@ -7923,7 +7934,7 @@ function toScalar(arg) {
|
|
|
7923
7934
|
return arg;
|
|
7924
7935
|
}
|
|
7925
7936
|
if (!isSingleElementMatrix(arg)) {
|
|
7926
|
-
throw new
|
|
7937
|
+
throw new Error("The value should be a scalar or a 1x1 matrix");
|
|
7927
7938
|
}
|
|
7928
7939
|
return arg[0][0];
|
|
7929
7940
|
}
|
|
@@ -8160,6 +8171,16 @@ function getMovingAverageValues(dataset, labels, windowSize = DEFAULT_WINDOW_SIZ
|
|
|
8160
8171
|
}
|
|
8161
8172
|
return values;
|
|
8162
8173
|
}
|
|
8174
|
+
function assertNonEmptyMatrix(matrix, argName) {
|
|
8175
|
+
assert(() => matrix.length > 0 && matrix[0].length > 0, _t("[[FUNCTION_NAME]] expects the provided values of %(argName)s to be a non-empty matrix.", {
|
|
8176
|
+
argName,
|
|
8177
|
+
}));
|
|
8178
|
+
}
|
|
8179
|
+
function assertNonEmpty(...data) {
|
|
8180
|
+
if (data.length === 0 || data.some((arg) => arg.length === 0)) {
|
|
8181
|
+
throw new NotAvailableError(_t("[[FUNCTION_NAME]] has no valid input data."));
|
|
8182
|
+
}
|
|
8183
|
+
}
|
|
8163
8184
|
|
|
8164
8185
|
const PREVIOUS_VALUE = "(previous)";
|
|
8165
8186
|
const NEXT_VALUE = "(next)";
|
|
@@ -10983,6 +11004,7 @@ const MMULT = {
|
|
|
10983
11004
|
compute: function (matrix1, matrix2) {
|
|
10984
11005
|
const _matrix1 = toNumberMatrix(matrix1, "matrix1");
|
|
10985
11006
|
const _matrix2 = toNumberMatrix(matrix2, "matrix2");
|
|
11007
|
+
assert(() => _matrix1.length > 0 && _matrix2.length > 0, _t("The first and second arguments of [[FUNCTION_NAME]] must be non-empty matrices."));
|
|
10986
11008
|
assert(() => _matrix1.length === _matrix2[0].length, _t("In [[FUNCTION_NAME]], the number of columns of the first matrix (%s) must be equal to the \
|
|
10987
11009
|
number of rows of the second matrix (%s).", _matrix1.length.toString(), _matrix2[0].length.toString()));
|
|
10988
11010
|
return multiplyMatrices(_matrix1, _matrix2);
|
|
@@ -12778,6 +12800,7 @@ const FORECAST = {
|
|
|
12778
12800
|
],
|
|
12779
12801
|
compute: function (x, dataY, dataX) {
|
|
12780
12802
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
12803
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
12781
12804
|
return predictLinearValues([flatDataY], [flatDataX], matrixMap(toMatrix(x), (value) => toNumber(value, this.locale)), true);
|
|
12782
12805
|
},
|
|
12783
12806
|
isExported: true,
|
|
@@ -12794,6 +12817,7 @@ const GROWTH = {
|
|
|
12794
12817
|
arg("b (boolean, default=TRUE)", _t("Given a general exponential form of y = b*m^x for a curve fit, calculates b if TRUE or forces b to be 1 and only calculates the m values if FALSE.")),
|
|
12795
12818
|
],
|
|
12796
12819
|
compute: function (knownDataY, knownDataX = [[]], newDataX = [[]], b = { value: true }) {
|
|
12820
|
+
assertNonEmptyMatrix(knownDataY, "known_data_y");
|
|
12797
12821
|
return expM(predictLinearValues(logM(toNumberMatrix(knownDataY, "the first argument (known_data_y)")), toNumberMatrix(knownDataX, "the second argument (known_data_x)"), toNumberMatrix(newDataX, "the third argument (new_data_y)"), toBoolean(b)));
|
|
12798
12822
|
},
|
|
12799
12823
|
};
|
|
@@ -12808,6 +12832,7 @@ const INTERCEPT = {
|
|
|
12808
12832
|
],
|
|
12809
12833
|
compute: function (dataY, dataX) {
|
|
12810
12834
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
12835
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
12811
12836
|
const [[], [intercept]] = fullLinearRegression([flatDataX], [flatDataY]);
|
|
12812
12837
|
return intercept;
|
|
12813
12838
|
},
|
|
@@ -12857,6 +12882,7 @@ const LINEST = {
|
|
|
12857
12882
|
arg("verbose (boolean, default=FALSE)", _t("A flag specifying whether to return additional regression statistics or only the linear coefficients and the y-intercept")),
|
|
12858
12883
|
],
|
|
12859
12884
|
compute: function (dataY, dataX = [[]], calculateB = { value: true }, verbose = { value: false }) {
|
|
12885
|
+
assertNonEmptyMatrix(dataY, "data_y");
|
|
12860
12886
|
return fullLinearRegression(toNumberMatrix(dataX, "the first argument (data_y)"), toNumberMatrix(dataY, "the second argument (data_x)"), toBoolean(calculateB), toBoolean(verbose));
|
|
12861
12887
|
},
|
|
12862
12888
|
isExported: true,
|
|
@@ -12873,6 +12899,7 @@ const LOGEST = {
|
|
|
12873
12899
|
arg("verbose (boolean, default=FALSE)", _t("A flag specifying whether to return additional regression statistics or only the linear coefficients and the y-intercept")),
|
|
12874
12900
|
],
|
|
12875
12901
|
compute: function (dataY, dataX = [[]], calculateB = { value: true }, verbose = { value: false }) {
|
|
12902
|
+
assertNonEmptyMatrix(dataY, "data_y");
|
|
12876
12903
|
const coeffs = fullLinearRegression(toNumberMatrix(dataX, "the second argument (data_x)"), logM(toNumberMatrix(dataY, "the first argument (data_y)")), toBoolean(calculateB), toBoolean(verbose));
|
|
12877
12904
|
for (let i = 0; i < coeffs.length; i++) {
|
|
12878
12905
|
coeffs[i][0] = Math.exp(coeffs[i][0]);
|
|
@@ -12894,9 +12921,7 @@ const MATTHEWS = {
|
|
|
12894
12921
|
const flatX = dataX.flat();
|
|
12895
12922
|
const flatY = dataY.flat();
|
|
12896
12923
|
assertSameNumberOfElements(flatX, flatY);
|
|
12897
|
-
|
|
12898
|
-
return new EvaluationError(_t("[[FUNCTION_NAME]] expects non-empty ranges for both parameters."));
|
|
12899
|
-
}
|
|
12924
|
+
assertNonEmpty(flatX, flatY);
|
|
12900
12925
|
const n = flatX.length;
|
|
12901
12926
|
let trueN = 0, trueP = 0, falseP = 0, falseN = 0;
|
|
12902
12927
|
for (let i = 0; i < n; ++i) {
|
|
@@ -13060,12 +13085,7 @@ const MINIFS = {
|
|
|
13060
13085
|
// -----------------------------------------------------------------------------
|
|
13061
13086
|
function pearson(dataY, dataX) {
|
|
13062
13087
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13063
|
-
|
|
13064
|
-
throw new EvaluationError(_t("[[FUNCTION_NAME]] expects non-empty ranges for both parameters."));
|
|
13065
|
-
}
|
|
13066
|
-
if (flatDataX.length < 2) {
|
|
13067
|
-
throw new EvaluationError(_t("[[FUNCTION_NAME]] needs at least two values for both parameters."));
|
|
13068
|
-
}
|
|
13088
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13069
13089
|
const n = flatDataX.length;
|
|
13070
13090
|
let sumX = 0, sumY = 0, sumXY = 0, sumXX = 0, sumYY = 0;
|
|
13071
13091
|
for (let i = 0; i < n; i++) {
|
|
@@ -13154,6 +13174,7 @@ const POLYFIT_COEFFS = {
|
|
|
13154
13174
|
],
|
|
13155
13175
|
compute: function (dataY, dataX, order, intercept = { value: true }) {
|
|
13156
13176
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13177
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13157
13178
|
return polynomialRegression(flatDataY, flatDataX, toNumber(order, this.locale), toBoolean(intercept));
|
|
13158
13179
|
},
|
|
13159
13180
|
isExported: false,
|
|
@@ -13173,6 +13194,7 @@ const POLYFIT_FORECAST = {
|
|
|
13173
13194
|
compute: function (x, dataY, dataX, order, intercept = { value: true }) {
|
|
13174
13195
|
const _order = toNumber(order, this.locale);
|
|
13175
13196
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13197
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13176
13198
|
const coeffs = polynomialRegression(flatDataY, flatDataX, _order, toBoolean(intercept)).flat();
|
|
13177
13199
|
return matrixMap(toMatrix(x), (xij) => evaluatePolynomial(coeffs, toNumber(xij, this.locale), _order));
|
|
13178
13200
|
},
|
|
@@ -13289,6 +13311,7 @@ const SLOPE = {
|
|
|
13289
13311
|
],
|
|
13290
13312
|
compute: function (dataY, dataX) {
|
|
13291
13313
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13314
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13292
13315
|
const [[slope]] = fullLinearRegression([flatDataX], [flatDataY]);
|
|
13293
13316
|
return slope;
|
|
13294
13317
|
},
|
|
@@ -13337,6 +13360,7 @@ const SPEARMAN = {
|
|
|
13337
13360
|
],
|
|
13338
13361
|
compute: function (dataX, dataY) {
|
|
13339
13362
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13363
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13340
13364
|
const n = flatDataX.length;
|
|
13341
13365
|
const order = flatDataX.map((e, i) => [e, flatDataY[i]]);
|
|
13342
13366
|
order.sort((a, b) => a[0] - b[0]);
|
|
@@ -13447,6 +13471,7 @@ const STEYX = {
|
|
|
13447
13471
|
],
|
|
13448
13472
|
compute: function (dataY, dataX) {
|
|
13449
13473
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13474
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13450
13475
|
const data = fullLinearRegression([flatDataX], [flatDataY], true, true);
|
|
13451
13476
|
return data[1][2];
|
|
13452
13477
|
},
|
|
@@ -13464,6 +13489,7 @@ const TREND = {
|
|
|
13464
13489
|
arg("b (boolean, optional, default=TRUE)", _t("Given a general linear form of y = m*x+b for a curve fit, calculates b if TRUE or forces b to be 0 and only calculates the m values if FALSE, i.e. forces the curve fit to pass through the origin.")),
|
|
13465
13490
|
],
|
|
13466
13491
|
compute: function (knownDataY, knownDataX = [[]], newDataX = [[]], b = { value: true }) {
|
|
13492
|
+
assertNonEmptyMatrix(knownDataY, "known_data_y");
|
|
13467
13493
|
return predictLinearValues(toNumberMatrix(knownDataY, "the first argument (known_data_y)"), toNumberMatrix(knownDataX, "the second argument (known_data_x)"), toNumberMatrix(newDataX, "the third argument (new_data_y)"), toBoolean(b));
|
|
13468
13494
|
},
|
|
13469
13495
|
};
|
|
@@ -20600,7 +20626,7 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
20600
20626
|
function adaptStringRange(defaultSheetId, sheetXC, applyChange) {
|
|
20601
20627
|
const sheetName = splitReference(sheetXC).sheetName;
|
|
20602
20628
|
if (sheetName
|
|
20603
|
-
? !isSheetNameEqual(sheetName, applyChange.sheetName)
|
|
20629
|
+
? !isSheetNameEqual(sheetName, applyChange.sheetName.old)
|
|
20604
20630
|
: defaultSheetId !== applyChange.sheetId) {
|
|
20605
20631
|
return sheetXC;
|
|
20606
20632
|
}
|
|
@@ -20617,7 +20643,7 @@ function adaptStringRange(defaultSheetId, sheetXC, applyChange) {
|
|
|
20617
20643
|
}
|
|
20618
20644
|
function getSheetNameGetter(applyChange) {
|
|
20619
20645
|
return (sheetId) => {
|
|
20620
|
-
return sheetId === applyChange.sheetId ? applyChange.sheetName : "";
|
|
20646
|
+
return sheetId === applyChange.sheetId ? applyChange.sheetName.current : "";
|
|
20621
20647
|
};
|
|
20622
20648
|
}
|
|
20623
20649
|
function defaultGetSheetSize(sheetId) {
|
|
@@ -27580,9 +27606,13 @@ class GaugeChart extends AbstractChart {
|
|
|
27580
27606
|
: undefined,
|
|
27581
27607
|
};
|
|
27582
27608
|
}
|
|
27583
|
-
updateRanges(applyChange) {
|
|
27609
|
+
updateRanges(applyChange, sheetId, adaptSheetName) {
|
|
27584
27610
|
const dataRange = adaptChartRange(this.dataRange, applyChange);
|
|
27585
|
-
const adaptFormula = (formula) =>
|
|
27611
|
+
const adaptFormula = (formula) => adaptFormulaStringRanges(this.sheetId, formula, {
|
|
27612
|
+
applyChange,
|
|
27613
|
+
sheetId,
|
|
27614
|
+
sheetName: adaptSheetName,
|
|
27615
|
+
});
|
|
27586
27616
|
const sectionRule = adaptSectionRuleFormulas(this.sectionRule, adaptFormula);
|
|
27587
27617
|
const definition = this.getDefinitionWithSpecificRanges(dataRange, sectionRule);
|
|
27588
27618
|
return new GaugeChart(definition, this.sheetId, this.getters);
|
|
@@ -30209,7 +30239,8 @@ const inverseCommandRegistry = new Registry()
|
|
|
30209
30239
|
.add("HIDE_COLUMNS_ROWS", inverseHideColumnsRows)
|
|
30210
30240
|
.add("UNHIDE_COLUMNS_ROWS", inverseUnhideColumnsRows)
|
|
30211
30241
|
.add("CREATE_TABLE_STYLE", inverseCreateTableStyle)
|
|
30212
|
-
.add("ADD_PIVOT", inverseAddPivot)
|
|
30242
|
+
.add("ADD_PIVOT", inverseAddPivot)
|
|
30243
|
+
.add("RENAME_SHEET", inverseRenameSheet);
|
|
30213
30244
|
for (const cmd of coreTypes.values()) {
|
|
30214
30245
|
if (!inverseCommandRegistry.contains(cmd)) {
|
|
30215
30246
|
inverseCommandRegistry.add(cmd, identity);
|
|
@@ -30307,6 +30338,16 @@ function inverseUnhideColumnsRows(cmd) {
|
|
|
30307
30338
|
function inverseCreateTableStyle(cmd) {
|
|
30308
30339
|
return [{ type: "REMOVE_TABLE_STYLE", tableStyleId: cmd.tableStyleId }];
|
|
30309
30340
|
}
|
|
30341
|
+
function inverseRenameSheet(cmd) {
|
|
30342
|
+
return [
|
|
30343
|
+
{
|
|
30344
|
+
type: "RENAME_SHEET",
|
|
30345
|
+
sheetId: cmd.sheetId,
|
|
30346
|
+
oldName: cmd.newName,
|
|
30347
|
+
newName: cmd.oldName,
|
|
30348
|
+
},
|
|
30349
|
+
];
|
|
30350
|
+
}
|
|
30310
30351
|
|
|
30311
30352
|
/**
|
|
30312
30353
|
* The class Registry is extended in order to add the function addChild
|
|
@@ -31556,9 +31597,9 @@ function convertConditionalFormats(xlsxCfs, dxfs, warningManager) {
|
|
|
31556
31597
|
if (!rule.operator || !rule.formula || rule.formula.length === 0)
|
|
31557
31598
|
continue;
|
|
31558
31599
|
operator = convertCFCellIsOperator(rule.operator);
|
|
31559
|
-
values.push(rule.formula[0]);
|
|
31600
|
+
values.push(prefixFormula(rule.formula[0]));
|
|
31560
31601
|
if (rule.formula.length === 2) {
|
|
31561
|
-
values.push(rule.formula[1]);
|
|
31602
|
+
values.push(prefixFormula(rule.formula[1]));
|
|
31562
31603
|
}
|
|
31563
31604
|
break;
|
|
31564
31605
|
}
|
|
@@ -31716,6 +31757,11 @@ function convertIcons(xlsxIconSet, index) {
|
|
|
31716
31757
|
? ICON_SETS[iconSet].neutral
|
|
31717
31758
|
: ICON_SETS[iconSet].good;
|
|
31718
31759
|
}
|
|
31760
|
+
/** Prefix the string by "=" if the string looks like a formula */
|
|
31761
|
+
function prefixFormula(formula) {
|
|
31762
|
+
const tokens = tokenize(formula);
|
|
31763
|
+
return tokens.length === 1 && tokens[0].type !== "REFERENCE" ? formula : "=" + formula;
|
|
31764
|
+
}
|
|
31719
31765
|
// ---------------------------------------------------------------------------
|
|
31720
31766
|
// Warnings
|
|
31721
31767
|
// ---------------------------------------------------------------------------
|
|
@@ -31978,7 +32024,7 @@ function getColPosition(colIndex, sheetData) {
|
|
|
31978
32024
|
function getRowPosition(rowIndex, sheetData) {
|
|
31979
32025
|
let position = 0;
|
|
31980
32026
|
for (let i = 0; i < rowIndex; i++) {
|
|
31981
|
-
const rowAtIndex = sheetData.rows
|
|
32027
|
+
const rowAtIndex = sheetData.rows.find((row) => row.index - 1 === i);
|
|
31982
32028
|
if (rowAtIndex?.height) {
|
|
31983
32029
|
position += rowAtIndex.height;
|
|
31984
32030
|
}
|
|
@@ -32118,8 +32164,8 @@ function convertExcelRangeToSheetXC(range, dataSetsHaveTitle) {
|
|
|
32118
32164
|
}
|
|
32119
32165
|
function convertAnchor(XLSXanchor) {
|
|
32120
32166
|
const offset = {
|
|
32121
|
-
x: convertEMUToDotValue(XLSXanchor.colOffset),
|
|
32122
|
-
y: convertEMUToDotValue(XLSXanchor.rowOffset),
|
|
32167
|
+
x: convertEMUToDotValue(XLSXanchor.colOffset) - FIGURE_BORDER_WIDTH,
|
|
32168
|
+
y: convertEMUToDotValue(XLSXanchor.rowOffset) - FIGURE_BORDER_WIDTH,
|
|
32123
32169
|
};
|
|
32124
32170
|
return { col: XLSXanchor.col, row: XLSXanchor.row, offset };
|
|
32125
32171
|
}
|
|
@@ -32502,8 +32548,12 @@ function getSheetDims(sheet) {
|
|
|
32502
32548
|
dims[0] = Math.max(dims[0], largeMax(row.cells.map((cell) => toCartesian(cell.xc).col)));
|
|
32503
32549
|
dims[1] = Math.max(dims[1], row.index);
|
|
32504
32550
|
}
|
|
32505
|
-
|
|
32506
|
-
|
|
32551
|
+
for (const fig of sheet.figures) {
|
|
32552
|
+
dims[0] = Math.max(dims[0], fig.anchors[fig.anchors.length - 1]?.col ?? 0);
|
|
32553
|
+
dims[1] = Math.max(dims[1], fig.anchors[fig.anchors.length - 1]?.row ?? 0);
|
|
32554
|
+
}
|
|
32555
|
+
dims[0] = Math.max(dims[0] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
|
|
32556
|
+
dims[1] = Math.max(dims[1] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
|
|
32507
32557
|
return dims;
|
|
32508
32558
|
}
|
|
32509
32559
|
/**
|
|
@@ -34508,7 +34558,7 @@ function getRelationFile(file, xmls) {
|
|
|
34508
34558
|
return relsFile;
|
|
34509
34559
|
}
|
|
34510
34560
|
|
|
34511
|
-
const EXCEL_IMPORT_VERSION = "18.3";
|
|
34561
|
+
const EXCEL_IMPORT_VERSION = "18.3.1";
|
|
34512
34562
|
class XlsxReader {
|
|
34513
34563
|
warningManager;
|
|
34514
34564
|
xmls;
|
|
@@ -38512,7 +38562,7 @@ const splitToColumns = {
|
|
|
38512
38562
|
const reinsertDynamicPivotMenu = {
|
|
38513
38563
|
id: "reinsert_dynamic_pivot",
|
|
38514
38564
|
name: _t("Re-insert dynamic pivot"),
|
|
38515
|
-
sequence:
|
|
38565
|
+
sequence: 60,
|
|
38516
38566
|
icon: "o-spreadsheet-Icon.INSERT_PIVOT",
|
|
38517
38567
|
children: [REINSERT_DYNAMIC_PIVOT_CHILDREN],
|
|
38518
38568
|
isVisible: (env) => env.model.getters.getPivotIds().some((id) => env.model.getters.getPivot(id).isValid()),
|
|
@@ -38520,7 +38570,7 @@ const reinsertDynamicPivotMenu = {
|
|
|
38520
38570
|
const reinsertStaticPivotMenu = {
|
|
38521
38571
|
id: "reinsert_static_pivot",
|
|
38522
38572
|
name: _t("Re-insert static pivot"),
|
|
38523
|
-
sequence:
|
|
38573
|
+
sequence: 70,
|
|
38524
38574
|
icon: "o-spreadsheet-Icon.INSERT_PIVOT",
|
|
38525
38575
|
children: [REINSERT_STATIC_PIVOT_CHILDREN],
|
|
38526
38576
|
isVisible: (env) => env.model.getters.getPivotIds().some((id) => env.model.getters.getPivot(id).isValid()),
|
|
@@ -40189,8 +40239,9 @@ topbarMenuRegistry
|
|
|
40189
40239
|
sequence: 40,
|
|
40190
40240
|
separator: true,
|
|
40191
40241
|
})
|
|
40192
|
-
.addChild("
|
|
40242
|
+
.addChild("pivot_data_sources", ["data"], (env) => {
|
|
40193
40243
|
const sequence = 50;
|
|
40244
|
+
const numberOfPivots = env.model.getters.getPivotIds().length;
|
|
40194
40245
|
return env.model.getters.getPivotIds().map((pivotId, index) => {
|
|
40195
40246
|
const highlightProvider = {
|
|
40196
40247
|
get highlights() {
|
|
@@ -40200,7 +40251,7 @@ topbarMenuRegistry
|
|
|
40200
40251
|
return {
|
|
40201
40252
|
id: `item_pivot_${env.model.getters.getPivotFormulaId(pivotId)}`,
|
|
40202
40253
|
name: env.model.getters.getPivotDisplayName(pivotId),
|
|
40203
|
-
sequence: sequence + index,
|
|
40254
|
+
sequence: sequence + index / numberOfPivots,
|
|
40204
40255
|
isReadonlyAllowed: true,
|
|
40205
40256
|
execute: (env) => env.openSidePanel("PivotSidePanel", { pivotId }),
|
|
40206
40257
|
onStartHover: (env) => env.getStore(HighlightStore).register(highlightProvider),
|
|
@@ -57198,7 +57249,8 @@ class CorePlugin extends BasePlugin {
|
|
|
57198
57249
|
* the type of change that occurred.
|
|
57199
57250
|
*
|
|
57200
57251
|
* @param applyChange a function that, when called, will adapt the range according to the change on the grid
|
|
57201
|
-
* @param sheetId an
|
|
57252
|
+
* @param sheetId an sheetId to adapt either range of that sheet specifically, or ranges pointing to that sheet
|
|
57253
|
+
* @param sheetName couple of old and new sheet names to adapt ranges pointing to that sheet
|
|
57202
57254
|
*/
|
|
57203
57255
|
adaptRanges(applyChange, sheetId, sheetName) { }
|
|
57204
57256
|
/**
|
|
@@ -57801,9 +57853,7 @@ class CellPlugin extends CorePlugin {
|
|
|
57801
57853
|
for (const cell of Object.values(this.cells[sheet] || {})) {
|
|
57802
57854
|
if (cell.isFormula) {
|
|
57803
57855
|
for (const range of cell.compiledFormula.dependencies) {
|
|
57804
|
-
if (
|
|
57805
|
-
range.sheetId === sheetId ||
|
|
57806
|
-
(sheetName && range.invalidSheetName === sheetName)) {
|
|
57856
|
+
if (range.sheetId === sheetId || range.invalidSheetName === sheetName.old) {
|
|
57807
57857
|
const change = applyChange(range);
|
|
57808
57858
|
if (change.changeType !== "NONE") {
|
|
57809
57859
|
this.history.update("cells", sheet, cell.id, "compiledFormula", "dependencies", cell.compiledFormula.dependencies.indexOf(range), change.range);
|
|
@@ -58419,9 +58469,9 @@ class ChartPlugin extends CorePlugin {
|
|
|
58419
58469
|
charts = {};
|
|
58420
58470
|
createChart = chartFactory(this.getters);
|
|
58421
58471
|
validateChartDefinition = (cmd) => validateChartDefinition(this, cmd.definition);
|
|
58422
|
-
adaptRanges(applyChange) {
|
|
58472
|
+
adaptRanges(applyChange, sheetId, adaptSheetName) {
|
|
58423
58473
|
for (const [chartId, chart] of Object.entries(this.charts)) {
|
|
58424
|
-
this.history.update("charts", chartId, chart?.updateRanges(applyChange));
|
|
58474
|
+
this.history.update("charts", chartId, chart?.updateRanges(applyChange, sheetId, adaptSheetName));
|
|
58425
58475
|
}
|
|
58426
58476
|
}
|
|
58427
58477
|
// ---------------------------------------------------------------------------
|
|
@@ -58684,7 +58734,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58684
58734
|
}
|
|
58685
58735
|
}
|
|
58686
58736
|
}
|
|
58687
|
-
adaptRanges(applyChange, sheetId
|
|
58737
|
+
adaptRanges(applyChange, sheetId) {
|
|
58688
58738
|
const sheetIds = sheetId ? [sheetId] : Object.keys(this.cfRules);
|
|
58689
58739
|
for (const sheetId of sheetIds) {
|
|
58690
58740
|
this.adaptCFRanges(sheetId, applyChange);
|
|
@@ -59080,11 +59130,8 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
59080
59130
|
"getValidationRuleForCell",
|
|
59081
59131
|
];
|
|
59082
59132
|
rules = {};
|
|
59083
|
-
adaptRanges(applyChange, sheetId
|
|
59084
|
-
|
|
59085
|
-
for (const sheetId of sheetIds) {
|
|
59086
|
-
this.adaptDVRanges(sheetId, applyChange);
|
|
59087
|
-
}
|
|
59133
|
+
adaptRanges(applyChange, sheetId) {
|
|
59134
|
+
this.adaptDVRanges(sheetId, applyChange);
|
|
59088
59135
|
this.adaptDVFormulas(applyChange);
|
|
59089
59136
|
}
|
|
59090
59137
|
adaptDVFormulas(applyChange) {
|
|
@@ -59374,9 +59421,6 @@ class FigurePlugin extends CorePlugin {
|
|
|
59374
59421
|
// Command Handling
|
|
59375
59422
|
// ---------------------------------------------------------------------------
|
|
59376
59423
|
adaptRanges(applyChange, sheetId) {
|
|
59377
|
-
if (!sheetId) {
|
|
59378
|
-
return;
|
|
59379
|
-
}
|
|
59380
59424
|
for (const figure of this.getFigures(sheetId)) {
|
|
59381
59425
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, {
|
|
59382
59426
|
left: figure.col,
|
|
@@ -60184,11 +60228,8 @@ class MergePlugin extends CorePlugin {
|
|
|
60184
60228
|
break;
|
|
60185
60229
|
}
|
|
60186
60230
|
}
|
|
60187
|
-
adaptRanges(applyChange, sheetId
|
|
60188
|
-
|
|
60189
|
-
for (const sheetId of sheetIds) {
|
|
60190
|
-
this.applyRangeChangeOnSheet(sheetId, applyChange);
|
|
60191
|
-
}
|
|
60231
|
+
adaptRanges(applyChange, sheetId) {
|
|
60232
|
+
this.applyRangeChangeOnSheet(sheetId, applyChange);
|
|
60192
60233
|
}
|
|
60193
60234
|
// ---------------------------------------------------------------------------
|
|
60194
60235
|
// Getters
|
|
@@ -61696,12 +61737,9 @@ class TablePlugin extends CorePlugin {
|
|
|
61696
61737
|
static getters = ["getCoreTable", "getCoreTables", "getCoreTableMatchingTopLeft"];
|
|
61697
61738
|
tables = {};
|
|
61698
61739
|
nextTableId = 1;
|
|
61699
|
-
adaptRanges(applyChange, sheetId
|
|
61700
|
-
const
|
|
61701
|
-
|
|
61702
|
-
for (const table of this.getCoreTables(sheetId)) {
|
|
61703
|
-
this.applyRangeChangeOnTable(sheetId, table, applyChange);
|
|
61704
|
-
}
|
|
61740
|
+
adaptRanges(applyChange, sheetId) {
|
|
61741
|
+
for (const table of this.getCoreTables(sheetId)) {
|
|
61742
|
+
this.applyRangeChangeOnTable(sheetId, table, applyChange);
|
|
61705
61743
|
}
|
|
61706
61744
|
}
|
|
61707
61745
|
allowDispatch(cmd) {
|
|
@@ -62664,7 +62702,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62664
62702
|
}
|
|
62665
62703
|
}
|
|
62666
62704
|
}
|
|
62667
|
-
adaptRanges(applyChange
|
|
62705
|
+
adaptRanges(applyChange) {
|
|
62668
62706
|
for (const sheetId in this.compiledMeasureFormulas) {
|
|
62669
62707
|
for (const formulaString in this.compiledMeasureFormulas[sheetId]) {
|
|
62670
62708
|
const compiledFormula = this.compiledMeasureFormulas[sheetId][formulaString];
|
|
@@ -66825,7 +66863,7 @@ class PivotUIPlugin extends CoreViewPlugin {
|
|
|
66825
66863
|
if (!result) {
|
|
66826
66864
|
return EMPTY_PIVOT_CELL;
|
|
66827
66865
|
}
|
|
66828
|
-
|
|
66866
|
+
let { functionName, args } = result;
|
|
66829
66867
|
const formulaId = args[0];
|
|
66830
66868
|
if (!formulaId) {
|
|
66831
66869
|
return EMPTY_PIVOT_CELL;
|
|
@@ -66855,6 +66893,9 @@ class PivotUIPlugin extends CoreViewPlugin {
|
|
|
66855
66893
|
return pivotCells[pivotCol][pivotRow];
|
|
66856
66894
|
}
|
|
66857
66895
|
try {
|
|
66896
|
+
const offsetRow = position.row - mainPosition.row;
|
|
66897
|
+
const offsetCol = position.col - mainPosition.col;
|
|
66898
|
+
args = args.map((arg) => (isMatrix(arg) ? arg[offsetCol][offsetRow] : arg));
|
|
66858
66899
|
if (functionName === "PIVOT.HEADER" && args.at(-2) === "measure") {
|
|
66859
66900
|
const domain = pivot.parseArgsToPivotDomain(args.slice(1, -2).map((value) => ({ value })));
|
|
66860
66901
|
return {
|
|
@@ -68053,7 +68094,8 @@ function transformAll(toTransform, executed) {
|
|
|
68053
68094
|
// If the executed command is not in the registry, we skip it
|
|
68054
68095
|
// because we know there won't be any transformation impacting the
|
|
68055
68096
|
// commands to transform.
|
|
68056
|
-
if (possibleTransformations.has(executedCommand.type)
|
|
68097
|
+
if (possibleTransformations.has(executedCommand.type) ||
|
|
68098
|
+
rangeAdapterRegistry.contains(executedCommand.type)) {
|
|
68057
68099
|
transformedCommands = transformedCommands.reduce((acc, cmd) => {
|
|
68058
68100
|
const transformed = transform(cmd, executedCommand);
|
|
68059
68101
|
if (transformed) {
|
|
@@ -79214,7 +79256,7 @@ function figureCoordinates(headers, anchor, offset) {
|
|
|
79214
79256
|
for (const [headerIndex, header] of headers.slice(anchor).entries()) {
|
|
79215
79257
|
if (currentPosition <= offset && offset < currentPosition + header.size) {
|
|
79216
79258
|
return {
|
|
79217
|
-
index: headerIndex,
|
|
79259
|
+
index: anchor + headerIndex,
|
|
79218
79260
|
offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH),
|
|
79219
79261
|
};
|
|
79220
79262
|
}
|
|
@@ -80210,7 +80252,7 @@ class Model extends EventBus {
|
|
|
80210
80252
|
handlers = [];
|
|
80211
80253
|
uiHandlers = [];
|
|
80212
80254
|
coreHandlers = [];
|
|
80213
|
-
constructor(data = {}, config = {}, stateUpdateMessages = [], uuidGenerator = new UuidGenerator(), verboseImport =
|
|
80255
|
+
constructor(data = {}, config = {}, stateUpdateMessages = [], uuidGenerator = new UuidGenerator(), verboseImport = true) {
|
|
80214
80256
|
const start = performance.now();
|
|
80215
80257
|
console.debug("##### Model creation #####");
|
|
80216
80258
|
super();
|
|
@@ -80907,6 +80949,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
80907
80949
|
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 };
|
|
80908
80950
|
|
|
80909
80951
|
|
|
80910
|
-
__info__.version = "18.3.
|
|
80911
|
-
__info__.date = "2025-
|
|
80912
|
-
__info__.hash = "
|
|
80952
|
+
__info__.version = "18.3.19";
|
|
80953
|
+
__info__.date = "2025-09-05T07:38:30.661Z";
|
|
80954
|
+
__info__.hash = "77fd307";
|