@odoo/o-spreadsheet 18.3.18 → 18.3.20
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 +191 -131
- package/dist/o-spreadsheet.d.ts +70 -64
- package/dist/o-spreadsheet.esm.js +191 -131
- package/dist/o-spreadsheet.iife.js +191 -131
- package/dist/o-spreadsheet.iife.min.js +381 -381
- package/dist/o_spreadsheet.xml +4 -7
- 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.20
|
|
6
|
+
* @date 2025-09-11T08:45:37.934Z
|
|
7
|
+
* @hash ef829f4
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -3499,6 +3499,7 @@ const invalidateBordersCommands = new Set([
|
|
|
3499
3499
|
"AUTOFILL_CELL",
|
|
3500
3500
|
"SET_BORDER",
|
|
3501
3501
|
"SET_ZONE_BORDERS",
|
|
3502
|
+
"SET_BORDERS_ON_TARGET",
|
|
3502
3503
|
]);
|
|
3503
3504
|
const readonlyAllowedCommands = new Set([
|
|
3504
3505
|
"START",
|
|
@@ -6444,40 +6445,44 @@ function orderRange(range) {
|
|
|
6444
6445
|
};
|
|
6445
6446
|
}
|
|
6446
6447
|
function getRangeAdapter(cmd) {
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
applyChange: getApplyRangeChangeAddColRow(cmd),
|
|
6457
|
-
sheetId: cmd.sheetId,
|
|
6458
|
-
sheetName: cmd.sheetName,
|
|
6459
|
-
};
|
|
6460
|
-
case "DELETE_SHEET":
|
|
6461
|
-
return {
|
|
6462
|
-
applyChange: getApplyRangeChangeDeleteSheet(cmd),
|
|
6463
|
-
sheetId: cmd.sheetId,
|
|
6464
|
-
sheetName: cmd.sheetName,
|
|
6465
|
-
};
|
|
6466
|
-
case "RENAME_SHEET":
|
|
6467
|
-
return {
|
|
6468
|
-
applyChange: getApplyRangeChangeRenameSheet(cmd),
|
|
6469
|
-
sheetId: cmd.sheetId,
|
|
6470
|
-
sheetName: cmd.oldName,
|
|
6471
|
-
};
|
|
6472
|
-
case "MOVE_RANGES":
|
|
6473
|
-
return {
|
|
6474
|
-
applyChange: getApplyRangeChangeMoveRange(cmd),
|
|
6475
|
-
sheetId: cmd.sheetId,
|
|
6476
|
-
sheetName: cmd.sheetName,
|
|
6477
|
-
};
|
|
6448
|
+
return rangeAdapterRegistry.get(cmd.type)?.(cmd);
|
|
6449
|
+
}
|
|
6450
|
+
class RangeAdapterRegistry extends Registry {
|
|
6451
|
+
add(cmdType, fn) {
|
|
6452
|
+
super.add(cmdType, fn);
|
|
6453
|
+
return this;
|
|
6454
|
+
}
|
|
6455
|
+
get(cmdType) {
|
|
6456
|
+
return this.content[cmdType];
|
|
6478
6457
|
}
|
|
6479
|
-
return undefined;
|
|
6480
6458
|
}
|
|
6459
|
+
const rangeAdapterRegistry = new RangeAdapterRegistry();
|
|
6460
|
+
rangeAdapterRegistry
|
|
6461
|
+
.add("REMOVE_COLUMNS_ROWS", (cmd) => ({
|
|
6462
|
+
applyChange: getApplyRangeChangeRemoveColRow(cmd),
|
|
6463
|
+
sheetId: cmd.sheetId,
|
|
6464
|
+
sheetName: { old: cmd.sheetName, current: cmd.sheetName },
|
|
6465
|
+
}))
|
|
6466
|
+
.add("ADD_COLUMNS_ROWS", (cmd) => ({
|
|
6467
|
+
applyChange: getApplyRangeChangeAddColRow(cmd),
|
|
6468
|
+
sheetId: cmd.sheetId,
|
|
6469
|
+
sheetName: { old: cmd.sheetName, current: cmd.sheetName },
|
|
6470
|
+
}))
|
|
6471
|
+
.add("DELETE_SHEET", (cmd) => ({
|
|
6472
|
+
applyChange: getApplyRangeChangeDeleteSheet(cmd),
|
|
6473
|
+
sheetId: cmd.sheetId,
|
|
6474
|
+
sheetName: { old: cmd.sheetName, current: cmd.sheetName },
|
|
6475
|
+
}))
|
|
6476
|
+
.add("RENAME_SHEET", (cmd) => ({
|
|
6477
|
+
applyChange: getApplyRangeChangeRenameSheet(cmd),
|
|
6478
|
+
sheetId: cmd.sheetId,
|
|
6479
|
+
sheetName: { old: cmd.oldName, current: cmd.newName },
|
|
6480
|
+
}))
|
|
6481
|
+
.add("MOVE_RANGES", (cmd) => ({
|
|
6482
|
+
applyChange: getApplyRangeChangeMoveRange(cmd),
|
|
6483
|
+
sheetId: cmd.sheetId,
|
|
6484
|
+
sheetName: { old: cmd.sheetName, current: cmd.sheetName },
|
|
6485
|
+
}));
|
|
6481
6486
|
function getApplyRangeChangeRemoveColRow(cmd) {
|
|
6482
6487
|
let start = cmd.dimension === "COL" ? "left" : "top";
|
|
6483
6488
|
let end = cmd.dimension === "COL" ? "right" : "bottom";
|
|
@@ -7204,7 +7209,7 @@ class ClipboardHandler {
|
|
|
7204
7209
|
this.getters = getters;
|
|
7205
7210
|
this.dispatch = dispatch;
|
|
7206
7211
|
}
|
|
7207
|
-
copy(data, isCutOperation) {
|
|
7212
|
+
copy(data, isCutOperation, mode = "copyPaste") {
|
|
7208
7213
|
return;
|
|
7209
7214
|
}
|
|
7210
7215
|
paste(target, clippedContent, options) { }
|
|
@@ -7223,7 +7228,7 @@ class ClipboardHandler {
|
|
|
7223
7228
|
}
|
|
7224
7229
|
|
|
7225
7230
|
class AbstractCellClipboardHandler extends ClipboardHandler {
|
|
7226
|
-
copy(data) {
|
|
7231
|
+
copy(data, isCutOperation, mode = "copyPaste") {
|
|
7227
7232
|
return;
|
|
7228
7233
|
}
|
|
7229
7234
|
pasteFromCopy(sheetId, target, content, options) {
|
|
@@ -7828,8 +7833,11 @@ function invertMatrix(M) {
|
|
|
7828
7833
|
// (a) Swap 2 rows. This multiply the determinant by -1.
|
|
7829
7834
|
// (b) Multiply a row by a scalar. This multiply the determinant by that scalar.
|
|
7830
7835
|
// (c) Add to a row a multiple of another row. This does not change the determinant.
|
|
7836
|
+
if (M.length < 1 || M[0].length < 1) {
|
|
7837
|
+
throw new Error("invertMatrix: an empty matrix cannot be inverted.");
|
|
7838
|
+
}
|
|
7831
7839
|
if (M.length !== M[0].length) {
|
|
7832
|
-
throw new
|
|
7840
|
+
throw new Error("invertMatrix: only square matrices are invertible");
|
|
7833
7841
|
}
|
|
7834
7842
|
let determinant = 1;
|
|
7835
7843
|
const dim = M.length;
|
|
@@ -7898,8 +7906,11 @@ function swapMatrixRows(matrix, row1, row2) {
|
|
|
7898
7906
|
* Note: we use indexing [col][row] instead of the standard mathematical notation [row][col]
|
|
7899
7907
|
*/
|
|
7900
7908
|
function multiplyMatrices(matrix1, matrix2) {
|
|
7909
|
+
if (matrix1.length < 1 || matrix2.length < 1) {
|
|
7910
|
+
throw new Error("multiplyMatrices: empty matrices cannot be multiplied.");
|
|
7911
|
+
}
|
|
7901
7912
|
if (matrix1.length !== matrix2[0].length) {
|
|
7902
|
-
throw new
|
|
7913
|
+
throw new Error("multiplyMatrices: incompatible matrices size.");
|
|
7903
7914
|
}
|
|
7904
7915
|
const rowsM1 = matrix1[0].length;
|
|
7905
7916
|
const colsM2 = matrix2.length;
|
|
@@ -7925,7 +7936,7 @@ function toScalar(arg) {
|
|
|
7925
7936
|
return arg;
|
|
7926
7937
|
}
|
|
7927
7938
|
if (!isSingleElementMatrix(arg)) {
|
|
7928
|
-
throw new
|
|
7939
|
+
throw new Error("The value should be a scalar or a 1x1 matrix");
|
|
7929
7940
|
}
|
|
7930
7941
|
return arg[0][0];
|
|
7931
7942
|
}
|
|
@@ -8162,6 +8173,16 @@ function getMovingAverageValues(dataset, labels, windowSize = DEFAULT_WINDOW_SIZ
|
|
|
8162
8173
|
}
|
|
8163
8174
|
return values;
|
|
8164
8175
|
}
|
|
8176
|
+
function assertNonEmptyMatrix(matrix, argName) {
|
|
8177
|
+
assert(() => matrix.length > 0 && matrix[0].length > 0, _t("[[FUNCTION_NAME]] expects the provided values of %(argName)s to be a non-empty matrix.", {
|
|
8178
|
+
argName,
|
|
8179
|
+
}));
|
|
8180
|
+
}
|
|
8181
|
+
function assertNonEmpty(...data) {
|
|
8182
|
+
if (data.length === 0 || data.some((arg) => arg.length === 0)) {
|
|
8183
|
+
throw new NotAvailableError(_t("[[FUNCTION_NAME]] has no valid input data."));
|
|
8184
|
+
}
|
|
8185
|
+
}
|
|
8165
8186
|
|
|
8166
8187
|
const PREVIOUS_VALUE = "(previous)";
|
|
8167
8188
|
const NEXT_VALUE = "(next)";
|
|
@@ -8930,7 +8951,7 @@ class CellClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
8930
8951
|
}
|
|
8931
8952
|
return "Success" /* CommandResult.Success */;
|
|
8932
8953
|
}
|
|
8933
|
-
copy(data) {
|
|
8954
|
+
copy(data, isCutOperation, mode = "copyPaste") {
|
|
8934
8955
|
const sheetId = data.sheetId;
|
|
8935
8956
|
const { clippedZones, rowsIndexes, columnsIndexes } = data;
|
|
8936
8957
|
const clippedCells = [];
|
|
@@ -8943,7 +8964,7 @@ class CellClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
8943
8964
|
const evaluatedCell = this.getters.getEvaluatedCell(position);
|
|
8944
8965
|
const pivotId = this.getters.getPivotIdFromPosition(position);
|
|
8945
8966
|
const spreader = this.getters.getArrayFormulaSpreadingOn(position);
|
|
8946
|
-
if (pivotId && spreader) {
|
|
8967
|
+
if (mode !== "shiftCells" && pivotId && spreader) {
|
|
8947
8968
|
const pivotZone = this.getters.getSpreadZone(spreader);
|
|
8948
8969
|
if ((!deepEquals(spreader, position) || !isCopyingOneCell) &&
|
|
8949
8970
|
pivotZone &&
|
|
@@ -8961,7 +8982,7 @@ class CellClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
8961
8982
|
};
|
|
8962
8983
|
}
|
|
8963
8984
|
}
|
|
8964
|
-
else {
|
|
8985
|
+
else if (mode !== "shiftCells") {
|
|
8965
8986
|
if (spreader && !deepEquals(spreader, position)) {
|
|
8966
8987
|
const isSpreaderCopied = rowsIndexes.includes(spreader.row) && columnsIndexes.includes(spreader.col);
|
|
8967
8988
|
const content = isSpreaderCopied
|
|
@@ -9661,7 +9682,7 @@ class SheetClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
9661
9682
|
}
|
|
9662
9683
|
|
|
9663
9684
|
class TableClipboardHandler extends AbstractCellClipboardHandler {
|
|
9664
|
-
copy(data, isCutOperation) {
|
|
9685
|
+
copy(data, isCutOperation, mode = "copyPaste") {
|
|
9665
9686
|
const sheetId = data.sheetId;
|
|
9666
9687
|
const { rowsIndexes, columnsIndexes, zones } = data;
|
|
9667
9688
|
const copiedTablesIds = new Set();
|
|
@@ -9699,11 +9720,13 @@ class TableClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
9699
9720
|
type: coreTable.type,
|
|
9700
9721
|
};
|
|
9701
9722
|
}
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9723
|
+
if (mode !== "shiftCells") {
|
|
9724
|
+
tableCellsInRow.push({
|
|
9725
|
+
table: copiedTable,
|
|
9726
|
+
style: this.getTableStyleToCopy(position),
|
|
9727
|
+
isWholeTableCopied: copiedTablesIds.has(table.id),
|
|
9728
|
+
});
|
|
9729
|
+
}
|
|
9707
9730
|
}
|
|
9708
9731
|
}
|
|
9709
9732
|
return {
|
|
@@ -10985,6 +11008,7 @@ const MMULT = {
|
|
|
10985
11008
|
compute: function (matrix1, matrix2) {
|
|
10986
11009
|
const _matrix1 = toNumberMatrix(matrix1, "matrix1");
|
|
10987
11010
|
const _matrix2 = toNumberMatrix(matrix2, "matrix2");
|
|
11011
|
+
assert(() => _matrix1.length > 0 && _matrix2.length > 0, _t("The first and second arguments of [[FUNCTION_NAME]] must be non-empty matrices."));
|
|
10988
11012
|
assert(() => _matrix1.length === _matrix2[0].length, _t("In [[FUNCTION_NAME]], the number of columns of the first matrix (%s) must be equal to the \
|
|
10989
11013
|
number of rows of the second matrix (%s).", _matrix1.length.toString(), _matrix2[0].length.toString()));
|
|
10990
11014
|
return multiplyMatrices(_matrix1, _matrix2);
|
|
@@ -12780,6 +12804,7 @@ const FORECAST = {
|
|
|
12780
12804
|
],
|
|
12781
12805
|
compute: function (x, dataY, dataX) {
|
|
12782
12806
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
12807
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
12783
12808
|
return predictLinearValues([flatDataY], [flatDataX], matrixMap(toMatrix(x), (value) => toNumber(value, this.locale)), true);
|
|
12784
12809
|
},
|
|
12785
12810
|
isExported: true,
|
|
@@ -12796,6 +12821,7 @@ const GROWTH = {
|
|
|
12796
12821
|
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.")),
|
|
12797
12822
|
],
|
|
12798
12823
|
compute: function (knownDataY, knownDataX = [[]], newDataX = [[]], b = { value: true }) {
|
|
12824
|
+
assertNonEmptyMatrix(knownDataY, "known_data_y");
|
|
12799
12825
|
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)));
|
|
12800
12826
|
},
|
|
12801
12827
|
};
|
|
@@ -12810,6 +12836,7 @@ const INTERCEPT = {
|
|
|
12810
12836
|
],
|
|
12811
12837
|
compute: function (dataY, dataX) {
|
|
12812
12838
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
12839
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
12813
12840
|
const [[], [intercept]] = fullLinearRegression([flatDataX], [flatDataY]);
|
|
12814
12841
|
return intercept;
|
|
12815
12842
|
},
|
|
@@ -12859,6 +12886,7 @@ const LINEST = {
|
|
|
12859
12886
|
arg("verbose (boolean, default=FALSE)", _t("A flag specifying whether to return additional regression statistics or only the linear coefficients and the y-intercept")),
|
|
12860
12887
|
],
|
|
12861
12888
|
compute: function (dataY, dataX = [[]], calculateB = { value: true }, verbose = { value: false }) {
|
|
12889
|
+
assertNonEmptyMatrix(dataY, "data_y");
|
|
12862
12890
|
return fullLinearRegression(toNumberMatrix(dataX, "the first argument (data_y)"), toNumberMatrix(dataY, "the second argument (data_x)"), toBoolean(calculateB), toBoolean(verbose));
|
|
12863
12891
|
},
|
|
12864
12892
|
isExported: true,
|
|
@@ -12875,6 +12903,7 @@ const LOGEST = {
|
|
|
12875
12903
|
arg("verbose (boolean, default=FALSE)", _t("A flag specifying whether to return additional regression statistics or only the linear coefficients and the y-intercept")),
|
|
12876
12904
|
],
|
|
12877
12905
|
compute: function (dataY, dataX = [[]], calculateB = { value: true }, verbose = { value: false }) {
|
|
12906
|
+
assertNonEmptyMatrix(dataY, "data_y");
|
|
12878
12907
|
const coeffs = fullLinearRegression(toNumberMatrix(dataX, "the second argument (data_x)"), logM(toNumberMatrix(dataY, "the first argument (data_y)")), toBoolean(calculateB), toBoolean(verbose));
|
|
12879
12908
|
for (let i = 0; i < coeffs.length; i++) {
|
|
12880
12909
|
coeffs[i][0] = Math.exp(coeffs[i][0]);
|
|
@@ -12896,9 +12925,7 @@ const MATTHEWS = {
|
|
|
12896
12925
|
const flatX = dataX.flat();
|
|
12897
12926
|
const flatY = dataY.flat();
|
|
12898
12927
|
assertSameNumberOfElements(flatX, flatY);
|
|
12899
|
-
|
|
12900
|
-
return new EvaluationError(_t("[[FUNCTION_NAME]] expects non-empty ranges for both parameters."));
|
|
12901
|
-
}
|
|
12928
|
+
assertNonEmpty(flatX, flatY);
|
|
12902
12929
|
const n = flatX.length;
|
|
12903
12930
|
let trueN = 0, trueP = 0, falseP = 0, falseN = 0;
|
|
12904
12931
|
for (let i = 0; i < n; ++i) {
|
|
@@ -13062,12 +13089,7 @@ const MINIFS = {
|
|
|
13062
13089
|
// -----------------------------------------------------------------------------
|
|
13063
13090
|
function pearson(dataY, dataX) {
|
|
13064
13091
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13065
|
-
|
|
13066
|
-
throw new EvaluationError(_t("[[FUNCTION_NAME]] expects non-empty ranges for both parameters."));
|
|
13067
|
-
}
|
|
13068
|
-
if (flatDataX.length < 2) {
|
|
13069
|
-
throw new EvaluationError(_t("[[FUNCTION_NAME]] needs at least two values for both parameters."));
|
|
13070
|
-
}
|
|
13092
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13071
13093
|
const n = flatDataX.length;
|
|
13072
13094
|
let sumX = 0, sumY = 0, sumXY = 0, sumXX = 0, sumYY = 0;
|
|
13073
13095
|
for (let i = 0; i < n; i++) {
|
|
@@ -13156,6 +13178,7 @@ const POLYFIT_COEFFS = {
|
|
|
13156
13178
|
],
|
|
13157
13179
|
compute: function (dataY, dataX, order, intercept = { value: true }) {
|
|
13158
13180
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13181
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13159
13182
|
return polynomialRegression(flatDataY, flatDataX, toNumber(order, this.locale), toBoolean(intercept));
|
|
13160
13183
|
},
|
|
13161
13184
|
isExported: false,
|
|
@@ -13175,6 +13198,7 @@ const POLYFIT_FORECAST = {
|
|
|
13175
13198
|
compute: function (x, dataY, dataX, order, intercept = { value: true }) {
|
|
13176
13199
|
const _order = toNumber(order, this.locale);
|
|
13177
13200
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13201
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13178
13202
|
const coeffs = polynomialRegression(flatDataY, flatDataX, _order, toBoolean(intercept)).flat();
|
|
13179
13203
|
return matrixMap(toMatrix(x), (xij) => evaluatePolynomial(coeffs, toNumber(xij, this.locale), _order));
|
|
13180
13204
|
},
|
|
@@ -13291,6 +13315,7 @@ const SLOPE = {
|
|
|
13291
13315
|
],
|
|
13292
13316
|
compute: function (dataY, dataX) {
|
|
13293
13317
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13318
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13294
13319
|
const [[slope]] = fullLinearRegression([flatDataX], [flatDataY]);
|
|
13295
13320
|
return slope;
|
|
13296
13321
|
},
|
|
@@ -13339,6 +13364,7 @@ const SPEARMAN = {
|
|
|
13339
13364
|
],
|
|
13340
13365
|
compute: function (dataX, dataY) {
|
|
13341
13366
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13367
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13342
13368
|
const n = flatDataX.length;
|
|
13343
13369
|
const order = flatDataX.map((e, i) => [e, flatDataY[i]]);
|
|
13344
13370
|
order.sort((a, b) => a[0] - b[0]);
|
|
@@ -13449,6 +13475,7 @@ const STEYX = {
|
|
|
13449
13475
|
],
|
|
13450
13476
|
compute: function (dataY, dataX) {
|
|
13451
13477
|
const { flatDataX, flatDataY } = filterAndFlatData(dataY, dataX);
|
|
13478
|
+
assertNonEmpty(flatDataX, flatDataY);
|
|
13452
13479
|
const data = fullLinearRegression([flatDataX], [flatDataY], true, true);
|
|
13453
13480
|
return data[1][2];
|
|
13454
13481
|
},
|
|
@@ -13466,6 +13493,7 @@ const TREND = {
|
|
|
13466
13493
|
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.")),
|
|
13467
13494
|
],
|
|
13468
13495
|
compute: function (knownDataY, knownDataX = [[]], newDataX = [[]], b = { value: true }) {
|
|
13496
|
+
assertNonEmptyMatrix(knownDataY, "known_data_y");
|
|
13469
13497
|
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));
|
|
13470
13498
|
},
|
|
13471
13499
|
};
|
|
@@ -20602,7 +20630,7 @@ function adaptFormulaStringRanges(defaultSheetId, formula, applyChange) {
|
|
|
20602
20630
|
function adaptStringRange(defaultSheetId, sheetXC, applyChange) {
|
|
20603
20631
|
const sheetName = splitReference(sheetXC).sheetName;
|
|
20604
20632
|
if (sheetName
|
|
20605
|
-
? !isSheetNameEqual(sheetName, applyChange.sheetName)
|
|
20633
|
+
? !isSheetNameEqual(sheetName, applyChange.sheetName.old)
|
|
20606
20634
|
: defaultSheetId !== applyChange.sheetId) {
|
|
20607
20635
|
return sheetXC;
|
|
20608
20636
|
}
|
|
@@ -20619,7 +20647,7 @@ function adaptStringRange(defaultSheetId, sheetXC, applyChange) {
|
|
|
20619
20647
|
}
|
|
20620
20648
|
function getSheetNameGetter(applyChange) {
|
|
20621
20649
|
return (sheetId) => {
|
|
20622
|
-
return sheetId === applyChange.sheetId ? applyChange.sheetName : "";
|
|
20650
|
+
return sheetId === applyChange.sheetId ? applyChange.sheetName.current : "";
|
|
20623
20651
|
};
|
|
20624
20652
|
}
|
|
20625
20653
|
function defaultGetSheetSize(sheetId) {
|
|
@@ -27582,9 +27610,13 @@ class GaugeChart extends AbstractChart {
|
|
|
27582
27610
|
: undefined,
|
|
27583
27611
|
};
|
|
27584
27612
|
}
|
|
27585
|
-
updateRanges(applyChange) {
|
|
27613
|
+
updateRanges(applyChange, sheetId, adaptSheetName) {
|
|
27586
27614
|
const dataRange = adaptChartRange(this.dataRange, applyChange);
|
|
27587
|
-
const adaptFormula = (formula) =>
|
|
27615
|
+
const adaptFormula = (formula) => adaptFormulaStringRanges(this.sheetId, formula, {
|
|
27616
|
+
applyChange,
|
|
27617
|
+
sheetId,
|
|
27618
|
+
sheetName: adaptSheetName,
|
|
27619
|
+
});
|
|
27588
27620
|
const sectionRule = adaptSectionRuleFormulas(this.sectionRule, adaptFormula);
|
|
27589
27621
|
const definition = this.getDefinitionWithSpecificRanges(dataRange, sectionRule);
|
|
27590
27622
|
return new GaugeChart(definition, this.sheetId, this.getters);
|
|
@@ -30211,7 +30243,8 @@ const inverseCommandRegistry = new Registry()
|
|
|
30211
30243
|
.add("HIDE_COLUMNS_ROWS", inverseHideColumnsRows)
|
|
30212
30244
|
.add("UNHIDE_COLUMNS_ROWS", inverseUnhideColumnsRows)
|
|
30213
30245
|
.add("CREATE_TABLE_STYLE", inverseCreateTableStyle)
|
|
30214
|
-
.add("ADD_PIVOT", inverseAddPivot)
|
|
30246
|
+
.add("ADD_PIVOT", inverseAddPivot)
|
|
30247
|
+
.add("RENAME_SHEET", inverseRenameSheet);
|
|
30215
30248
|
for (const cmd of coreTypes.values()) {
|
|
30216
30249
|
if (!inverseCommandRegistry.contains(cmd)) {
|
|
30217
30250
|
inverseCommandRegistry.add(cmd, identity);
|
|
@@ -30309,6 +30342,16 @@ function inverseUnhideColumnsRows(cmd) {
|
|
|
30309
30342
|
function inverseCreateTableStyle(cmd) {
|
|
30310
30343
|
return [{ type: "REMOVE_TABLE_STYLE", tableStyleId: cmd.tableStyleId }];
|
|
30311
30344
|
}
|
|
30345
|
+
function inverseRenameSheet(cmd) {
|
|
30346
|
+
return [
|
|
30347
|
+
{
|
|
30348
|
+
type: "RENAME_SHEET",
|
|
30349
|
+
sheetId: cmd.sheetId,
|
|
30350
|
+
oldName: cmd.newName,
|
|
30351
|
+
newName: cmd.oldName,
|
|
30352
|
+
},
|
|
30353
|
+
];
|
|
30354
|
+
}
|
|
30312
30355
|
|
|
30313
30356
|
/**
|
|
30314
30357
|
* The class Registry is extended in order to add the function addChild
|
|
@@ -30845,7 +30888,7 @@ const SUPPORTED_HORIZONTAL_ALIGNMENTS = [
|
|
|
30845
30888
|
];
|
|
30846
30889
|
const SUPPORTED_VERTICAL_ALIGNMENTS = ["top", "center", "bottom"];
|
|
30847
30890
|
const SUPPORTED_FONTS = ["Arial"];
|
|
30848
|
-
const SUPPORTED_FILL_PATTERNS = ["solid"];
|
|
30891
|
+
const SUPPORTED_FILL_PATTERNS = ["solid", "none"];
|
|
30849
30892
|
const SUPPORTED_CF_TYPES = [
|
|
30850
30893
|
"expression",
|
|
30851
30894
|
"cellIs",
|
|
@@ -31030,7 +31073,7 @@ const SUBTOTAL_FUNCTION_CONVERSION_MAP = {
|
|
|
31030
31073
|
};
|
|
31031
31074
|
/** Mapping between Excel format indexes (see XLSX_FORMAT_MAP) and some supported formats */
|
|
31032
31075
|
const XLSX_FORMATS_CONVERSION_MAP = {
|
|
31033
|
-
0: "",
|
|
31076
|
+
0: "General",
|
|
31034
31077
|
1: "0",
|
|
31035
31078
|
2: "0.00",
|
|
31036
31079
|
3: "#,#00",
|
|
@@ -31356,11 +31399,11 @@ const XLSX_DATE_FORMAT_REGEX = /^(yy|yyyy|m{1,5}|d{1,4}|h{1,2}|s{1,2}|am\/pm|a\/
|
|
|
31356
31399
|
* Excel format are defined in openXML §18.8.31
|
|
31357
31400
|
*/
|
|
31358
31401
|
function convertXlsxFormat(numFmtId, formats, warningManager) {
|
|
31359
|
-
if (numFmtId === 0) {
|
|
31360
|
-
return undefined;
|
|
31361
|
-
}
|
|
31362
31402
|
// Format is either defined in the imported data, or the formatId is defined in openXML §18.8.30
|
|
31363
31403
|
let format = XLSX_FORMATS_CONVERSION_MAP[numFmtId] || formats.find((f) => f.id === numFmtId)?.format;
|
|
31404
|
+
if (format === "General") {
|
|
31405
|
+
return undefined;
|
|
31406
|
+
}
|
|
31364
31407
|
if (format) {
|
|
31365
31408
|
try {
|
|
31366
31409
|
let convertedFormat = format.replace(/\[(.*)-[A-Z0-9]{3}\]/g, "[$1]"); // remove currency and locale/date system/number system info (ECMA §18.8.31)
|
|
@@ -31558,9 +31601,9 @@ function convertConditionalFormats(xlsxCfs, dxfs, warningManager) {
|
|
|
31558
31601
|
if (!rule.operator || !rule.formula || rule.formula.length === 0)
|
|
31559
31602
|
continue;
|
|
31560
31603
|
operator = convertCFCellIsOperator(rule.operator);
|
|
31561
|
-
values.push(rule.formula[0]);
|
|
31604
|
+
values.push(prefixFormula(rule.formula[0]));
|
|
31562
31605
|
if (rule.formula.length === 2) {
|
|
31563
|
-
values.push(rule.formula[1]);
|
|
31606
|
+
values.push(prefixFormula(rule.formula[1]));
|
|
31564
31607
|
}
|
|
31565
31608
|
break;
|
|
31566
31609
|
}
|
|
@@ -31718,6 +31761,11 @@ function convertIcons(xlsxIconSet, index) {
|
|
|
31718
31761
|
? ICON_SETS[iconSet].neutral
|
|
31719
31762
|
: ICON_SETS[iconSet].good;
|
|
31720
31763
|
}
|
|
31764
|
+
/** Prefix the string by "=" if the string looks like a formula */
|
|
31765
|
+
function prefixFormula(formula) {
|
|
31766
|
+
const tokens = tokenize(formula);
|
|
31767
|
+
return tokens.length === 1 && tokens[0].type !== "REFERENCE" ? formula : "=" + formula;
|
|
31768
|
+
}
|
|
31721
31769
|
// ---------------------------------------------------------------------------
|
|
31722
31770
|
// Warnings
|
|
31723
31771
|
// ---------------------------------------------------------------------------
|
|
@@ -31980,7 +32028,7 @@ function getColPosition(colIndex, sheetData) {
|
|
|
31980
32028
|
function getRowPosition(rowIndex, sheetData) {
|
|
31981
32029
|
let position = 0;
|
|
31982
32030
|
for (let i = 0; i < rowIndex; i++) {
|
|
31983
|
-
const rowAtIndex = sheetData.rows
|
|
32031
|
+
const rowAtIndex = sheetData.rows.find((row) => row.index - 1 === i);
|
|
31984
32032
|
if (rowAtIndex?.height) {
|
|
31985
32033
|
position += rowAtIndex.height;
|
|
31986
32034
|
}
|
|
@@ -32120,8 +32168,8 @@ function convertExcelRangeToSheetXC(range, dataSetsHaveTitle) {
|
|
|
32120
32168
|
}
|
|
32121
32169
|
function convertAnchor(XLSXanchor) {
|
|
32122
32170
|
const offset = {
|
|
32123
|
-
x: convertEMUToDotValue(XLSXanchor.colOffset),
|
|
32124
|
-
y: convertEMUToDotValue(XLSXanchor.rowOffset),
|
|
32171
|
+
x: convertEMUToDotValue(XLSXanchor.colOffset) - FIGURE_BORDER_WIDTH,
|
|
32172
|
+
y: convertEMUToDotValue(XLSXanchor.rowOffset) - FIGURE_BORDER_WIDTH,
|
|
32125
32173
|
};
|
|
32126
32174
|
return { col: XLSXanchor.col, row: XLSXanchor.row, offset };
|
|
32127
32175
|
}
|
|
@@ -32504,8 +32552,12 @@ function getSheetDims(sheet) {
|
|
|
32504
32552
|
dims[0] = Math.max(dims[0], largeMax(row.cells.map((cell) => toCartesian(cell.xc).col)));
|
|
32505
32553
|
dims[1] = Math.max(dims[1], row.index);
|
|
32506
32554
|
}
|
|
32507
|
-
|
|
32508
|
-
|
|
32555
|
+
for (const fig of sheet.figures) {
|
|
32556
|
+
dims[0] = Math.max(dims[0], fig.anchors[fig.anchors.length - 1]?.col ?? 0);
|
|
32557
|
+
dims[1] = Math.max(dims[1], fig.anchors[fig.anchors.length - 1]?.row ?? 0);
|
|
32558
|
+
}
|
|
32559
|
+
dims[0] = Math.max(dims[0] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
|
|
32560
|
+
dims[1] = Math.max(dims[1] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
|
|
32509
32561
|
return dims;
|
|
32510
32562
|
}
|
|
32511
32563
|
/**
|
|
@@ -34196,10 +34248,11 @@ class XlsxSheetExtractor extends XlsxBaseExtractor {
|
|
|
34196
34248
|
});
|
|
34197
34249
|
}
|
|
34198
34250
|
extractRows(worksheet) {
|
|
34251
|
+
const spilledCells = new Set();
|
|
34199
34252
|
return this.mapOnElements({ parent: worksheet, query: "sheetData row" }, (rowElement) => {
|
|
34200
34253
|
return {
|
|
34201
34254
|
index: this.extractAttr(rowElement, "r", { required: true })?.asNum(),
|
|
34202
|
-
cells: this.extractCells(rowElement),
|
|
34255
|
+
cells: this.extractCells(rowElement, spilledCells),
|
|
34203
34256
|
height: this.extractAttr(rowElement, "ht")?.asNum(),
|
|
34204
34257
|
customHeight: this.extractAttr(rowElement, "customHeight")?.asBool(),
|
|
34205
34258
|
hidden: this.extractAttr(rowElement, "hidden")?.asBool(),
|
|
@@ -34209,14 +34262,26 @@ class XlsxSheetExtractor extends XlsxBaseExtractor {
|
|
|
34209
34262
|
};
|
|
34210
34263
|
});
|
|
34211
34264
|
}
|
|
34212
|
-
extractCells(row) {
|
|
34265
|
+
extractCells(row, spilledCells) {
|
|
34213
34266
|
return this.mapOnElements({ parent: row, query: "c" }, (cellElement) => {
|
|
34267
|
+
const xc = this.extractAttr(cellElement, "r", { required: true })?.asString();
|
|
34268
|
+
const formula = this.extractCellFormula(cellElement);
|
|
34269
|
+
if (formula?.ref && formula.sharedIndex === undefined) {
|
|
34270
|
+
const zone = toZone(formula.ref);
|
|
34271
|
+
for (const { col, row } of positions(zone)) {
|
|
34272
|
+
const followerXc = toXC(col, row);
|
|
34273
|
+
if (followerXc !== xc) {
|
|
34274
|
+
spilledCells.add(followerXc);
|
|
34275
|
+
}
|
|
34276
|
+
}
|
|
34277
|
+
}
|
|
34278
|
+
const isSpilled = spilledCells.has(xc);
|
|
34214
34279
|
return {
|
|
34215
|
-
xc
|
|
34280
|
+
xc,
|
|
34216
34281
|
styleIndex: this.extractAttr(cellElement, "s")?.asNum(),
|
|
34217
34282
|
type: CELL_TYPE_CONVERSION_MAP[this.extractAttr(cellElement, "t", { default: "n" })?.asString()],
|
|
34218
|
-
value: this.extractChildTextContent(cellElement, "v"),
|
|
34219
|
-
formula:
|
|
34283
|
+
value: isSpilled ? undefined : this.extractChildTextContent(cellElement, "v") ?? undefined,
|
|
34284
|
+
formula: isSpilled ? undefined : formula,
|
|
34220
34285
|
};
|
|
34221
34286
|
});
|
|
34222
34287
|
}
|
|
@@ -34224,11 +34289,14 @@ class XlsxSheetExtractor extends XlsxBaseExtractor {
|
|
|
34224
34289
|
const formulaElement = this.querySelector(cellElement, "f");
|
|
34225
34290
|
if (!formulaElement)
|
|
34226
34291
|
return undefined;
|
|
34227
|
-
|
|
34228
|
-
|
|
34229
|
-
|
|
34230
|
-
|
|
34231
|
-
|
|
34292
|
+
const content = this.extractTextContent(formulaElement);
|
|
34293
|
+
const sharedIndex = this.extractAttr(formulaElement, "si")?.asNum();
|
|
34294
|
+
const ref = this.extractAttr(formulaElement, "ref")?.asString();
|
|
34295
|
+
// This is the case of spilled cells of array formulas where <f> is empty
|
|
34296
|
+
if ((content === undefined || content.trim() === "") && sharedIndex === undefined) {
|
|
34297
|
+
return undefined;
|
|
34298
|
+
}
|
|
34299
|
+
return { content, sharedIndex, ref };
|
|
34232
34300
|
}
|
|
34233
34301
|
extractHyperLinks(worksheet) {
|
|
34234
34302
|
return this.mapOnElements({ parent: worksheet, query: "hyperlink" }, (linkElement) => {
|
|
@@ -34510,7 +34578,7 @@ function getRelationFile(file, xmls) {
|
|
|
34510
34578
|
return relsFile;
|
|
34511
34579
|
}
|
|
34512
34580
|
|
|
34513
|
-
const EXCEL_IMPORT_VERSION = "18.3";
|
|
34581
|
+
const EXCEL_IMPORT_VERSION = "18.3.1";
|
|
34514
34582
|
class XlsxReader {
|
|
34515
34583
|
warningManager;
|
|
34516
34584
|
xmls;
|
|
@@ -38514,7 +38582,7 @@ const splitToColumns = {
|
|
|
38514
38582
|
const reinsertDynamicPivotMenu = {
|
|
38515
38583
|
id: "reinsert_dynamic_pivot",
|
|
38516
38584
|
name: _t("Re-insert dynamic pivot"),
|
|
38517
|
-
sequence:
|
|
38585
|
+
sequence: 60,
|
|
38518
38586
|
icon: "o-spreadsheet-Icon.INSERT_PIVOT",
|
|
38519
38587
|
children: [REINSERT_DYNAMIC_PIVOT_CHILDREN],
|
|
38520
38588
|
isVisible: (env) => env.model.getters.getPivotIds().some((id) => env.model.getters.getPivot(id).isValid()),
|
|
@@ -38522,7 +38590,7 @@ const reinsertDynamicPivotMenu = {
|
|
|
38522
38590
|
const reinsertStaticPivotMenu = {
|
|
38523
38591
|
id: "reinsert_static_pivot",
|
|
38524
38592
|
name: _t("Re-insert static pivot"),
|
|
38525
|
-
sequence:
|
|
38593
|
+
sequence: 70,
|
|
38526
38594
|
icon: "o-spreadsheet-Icon.INSERT_PIVOT",
|
|
38527
38595
|
children: [REINSERT_STATIC_PIVOT_CHILDREN],
|
|
38528
38596
|
isVisible: (env) => env.model.getters.getPivotIds().some((id) => env.model.getters.getPivot(id).isValid()),
|
|
@@ -40191,8 +40259,9 @@ topbarMenuRegistry
|
|
|
40191
40259
|
sequence: 40,
|
|
40192
40260
|
separator: true,
|
|
40193
40261
|
})
|
|
40194
|
-
.addChild("
|
|
40262
|
+
.addChild("pivot_data_sources", ["data"], (env) => {
|
|
40195
40263
|
const sequence = 50;
|
|
40264
|
+
const numberOfPivots = env.model.getters.getPivotIds().length;
|
|
40196
40265
|
return env.model.getters.getPivotIds().map((pivotId, index) => {
|
|
40197
40266
|
const highlightProvider = {
|
|
40198
40267
|
get highlights() {
|
|
@@ -40202,7 +40271,7 @@ topbarMenuRegistry
|
|
|
40202
40271
|
return {
|
|
40203
40272
|
id: `item_pivot_${env.model.getters.getPivotFormulaId(pivotId)}`,
|
|
40204
40273
|
name: env.model.getters.getPivotDisplayName(pivotId),
|
|
40205
|
-
sequence: sequence + index,
|
|
40274
|
+
sequence: sequence + index / numberOfPivots,
|
|
40206
40275
|
isReadonlyAllowed: true,
|
|
40207
40276
|
execute: (env) => env.openSidePanel("PivotSidePanel", { pivotId }),
|
|
40208
40277
|
onStartHover: (env) => env.getStore(HighlightStore).register(highlightProvider),
|
|
@@ -57200,7 +57269,8 @@ class CorePlugin extends BasePlugin {
|
|
|
57200
57269
|
* the type of change that occurred.
|
|
57201
57270
|
*
|
|
57202
57271
|
* @param applyChange a function that, when called, will adapt the range according to the change on the grid
|
|
57203
|
-
* @param sheetId an
|
|
57272
|
+
* @param sheetId an sheetId to adapt either range of that sheet specifically, or ranges pointing to that sheet
|
|
57273
|
+
* @param sheetName couple of old and new sheet names to adapt ranges pointing to that sheet
|
|
57204
57274
|
*/
|
|
57205
57275
|
adaptRanges(applyChange, sheetId, sheetName) { }
|
|
57206
57276
|
/**
|
|
@@ -57803,9 +57873,7 @@ class CellPlugin extends CorePlugin {
|
|
|
57803
57873
|
for (const cell of Object.values(this.cells[sheet] || {})) {
|
|
57804
57874
|
if (cell.isFormula) {
|
|
57805
57875
|
for (const range of cell.compiledFormula.dependencies) {
|
|
57806
|
-
if (
|
|
57807
|
-
range.sheetId === sheetId ||
|
|
57808
|
-
(sheetName && range.invalidSheetName === sheetName)) {
|
|
57876
|
+
if (range.sheetId === sheetId || range.invalidSheetName === sheetName.old) {
|
|
57809
57877
|
const change = applyChange(range);
|
|
57810
57878
|
if (change.changeType !== "NONE") {
|
|
57811
57879
|
this.history.update("cells", sheet, cell.id, "compiledFormula", "dependencies", cell.compiledFormula.dependencies.indexOf(range), change.range);
|
|
@@ -58421,9 +58489,9 @@ class ChartPlugin extends CorePlugin {
|
|
|
58421
58489
|
charts = {};
|
|
58422
58490
|
createChart = chartFactory(this.getters);
|
|
58423
58491
|
validateChartDefinition = (cmd) => validateChartDefinition(this, cmd.definition);
|
|
58424
|
-
adaptRanges(applyChange) {
|
|
58492
|
+
adaptRanges(applyChange, sheetId, adaptSheetName) {
|
|
58425
58493
|
for (const [chartId, chart] of Object.entries(this.charts)) {
|
|
58426
|
-
this.history.update("charts", chartId, chart?.updateRanges(applyChange));
|
|
58494
|
+
this.history.update("charts", chartId, chart?.updateRanges(applyChange, sheetId, adaptSheetName));
|
|
58427
58495
|
}
|
|
58428
58496
|
}
|
|
58429
58497
|
// ---------------------------------------------------------------------------
|
|
@@ -58686,7 +58754,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
58686
58754
|
}
|
|
58687
58755
|
}
|
|
58688
58756
|
}
|
|
58689
|
-
adaptRanges(applyChange, sheetId
|
|
58757
|
+
adaptRanges(applyChange, sheetId) {
|
|
58690
58758
|
const sheetIds = sheetId ? [sheetId] : Object.keys(this.cfRules);
|
|
58691
58759
|
for (const sheetId of sheetIds) {
|
|
58692
58760
|
this.adaptCFRanges(sheetId, applyChange);
|
|
@@ -59082,11 +59150,8 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
59082
59150
|
"getValidationRuleForCell",
|
|
59083
59151
|
];
|
|
59084
59152
|
rules = {};
|
|
59085
|
-
adaptRanges(applyChange, sheetId
|
|
59086
|
-
|
|
59087
|
-
for (const sheetId of sheetIds) {
|
|
59088
|
-
this.adaptDVRanges(sheetId, applyChange);
|
|
59089
|
-
}
|
|
59153
|
+
adaptRanges(applyChange, sheetId) {
|
|
59154
|
+
this.adaptDVRanges(sheetId, applyChange);
|
|
59090
59155
|
this.adaptDVFormulas(applyChange);
|
|
59091
59156
|
}
|
|
59092
59157
|
adaptDVFormulas(applyChange) {
|
|
@@ -59376,9 +59441,6 @@ class FigurePlugin extends CorePlugin {
|
|
|
59376
59441
|
// Command Handling
|
|
59377
59442
|
// ---------------------------------------------------------------------------
|
|
59378
59443
|
adaptRanges(applyChange, sheetId) {
|
|
59379
|
-
if (!sheetId) {
|
|
59380
|
-
return;
|
|
59381
|
-
}
|
|
59382
59444
|
for (const figure of this.getFigures(sheetId)) {
|
|
59383
59445
|
const change = applyChange(this.getters.getRangeFromZone(sheetId, {
|
|
59384
59446
|
left: figure.col,
|
|
@@ -60186,11 +60248,8 @@ class MergePlugin extends CorePlugin {
|
|
|
60186
60248
|
break;
|
|
60187
60249
|
}
|
|
60188
60250
|
}
|
|
60189
|
-
adaptRanges(applyChange, sheetId
|
|
60190
|
-
|
|
60191
|
-
for (const sheetId of sheetIds) {
|
|
60192
|
-
this.applyRangeChangeOnSheet(sheetId, applyChange);
|
|
60193
|
-
}
|
|
60251
|
+
adaptRanges(applyChange, sheetId) {
|
|
60252
|
+
this.applyRangeChangeOnSheet(sheetId, applyChange);
|
|
60194
60253
|
}
|
|
60195
60254
|
// ---------------------------------------------------------------------------
|
|
60196
60255
|
// Getters
|
|
@@ -61698,12 +61757,9 @@ class TablePlugin extends CorePlugin {
|
|
|
61698
61757
|
static getters = ["getCoreTable", "getCoreTables", "getCoreTableMatchingTopLeft"];
|
|
61699
61758
|
tables = {};
|
|
61700
61759
|
nextTableId = 1;
|
|
61701
|
-
adaptRanges(applyChange, sheetId
|
|
61702
|
-
const
|
|
61703
|
-
|
|
61704
|
-
for (const table of this.getCoreTables(sheetId)) {
|
|
61705
|
-
this.applyRangeChangeOnTable(sheetId, table, applyChange);
|
|
61706
|
-
}
|
|
61760
|
+
adaptRanges(applyChange, sheetId) {
|
|
61761
|
+
for (const table of this.getCoreTables(sheetId)) {
|
|
61762
|
+
this.applyRangeChangeOnTable(sheetId, table, applyChange);
|
|
61707
61763
|
}
|
|
61708
61764
|
}
|
|
61709
61765
|
allowDispatch(cmd) {
|
|
@@ -62666,7 +62722,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62666
62722
|
}
|
|
62667
62723
|
}
|
|
62668
62724
|
}
|
|
62669
|
-
adaptRanges(applyChange
|
|
62725
|
+
adaptRanges(applyChange) {
|
|
62670
62726
|
for (const sheetId in this.compiledMeasureFormulas) {
|
|
62671
62727
|
for (const formulaString in this.compiledMeasureFormulas[sheetId]) {
|
|
62672
62728
|
const compiledFormula = this.compiledMeasureFormulas[sheetId][formulaString];
|
|
@@ -66827,7 +66883,7 @@ class PivotUIPlugin extends CoreViewPlugin {
|
|
|
66827
66883
|
if (!result) {
|
|
66828
66884
|
return EMPTY_PIVOT_CELL;
|
|
66829
66885
|
}
|
|
66830
|
-
|
|
66886
|
+
let { functionName, args } = result;
|
|
66831
66887
|
const formulaId = args[0];
|
|
66832
66888
|
if (!formulaId) {
|
|
66833
66889
|
return EMPTY_PIVOT_CELL;
|
|
@@ -66857,6 +66913,9 @@ class PivotUIPlugin extends CoreViewPlugin {
|
|
|
66857
66913
|
return pivotCells[pivotCol][pivotRow];
|
|
66858
66914
|
}
|
|
66859
66915
|
try {
|
|
66916
|
+
const offsetRow = position.row - mainPosition.row;
|
|
66917
|
+
const offsetCol = position.col - mainPosition.col;
|
|
66918
|
+
args = args.map((arg) => (isMatrix(arg) ? arg[offsetCol][offsetRow] : arg));
|
|
66860
66919
|
if (functionName === "PIVOT.HEADER" && args.at(-2) === "measure") {
|
|
66861
66920
|
const domain = pivot.parseArgsToPivotDomain(args.slice(1, -2).map((value) => ({ value })));
|
|
66862
66921
|
return {
|
|
@@ -68055,7 +68114,8 @@ function transformAll(toTransform, executed) {
|
|
|
68055
68114
|
// If the executed command is not in the registry, we skip it
|
|
68056
68115
|
// because we know there won't be any transformation impacting the
|
|
68057
68116
|
// commands to transform.
|
|
68058
|
-
if (possibleTransformations.has(executedCommand.type)
|
|
68117
|
+
if (possibleTransformations.has(executedCommand.type) ||
|
|
68118
|
+
rangeAdapterRegistry.contains(executedCommand.type)) {
|
|
68059
68119
|
transformedCommands = transformedCommands.reduce((acc, cmd) => {
|
|
68060
68120
|
const transformed = transform(cmd, executedCommand);
|
|
68061
68121
|
if (transformed) {
|
|
@@ -68789,7 +68849,7 @@ class DataCleanupPlugin extends UIPlugin {
|
|
|
68789
68849
|
bottom: rowIndex,
|
|
68790
68850
|
}));
|
|
68791
68851
|
const handler = new CellClipboardHandler(this.getters, this.dispatch);
|
|
68792
|
-
const data = handler.copy(getClipboardDataPositions(sheetId, rowsToKeep));
|
|
68852
|
+
const data = handler.copy(getClipboardDataPositions(sheetId, rowsToKeep), false);
|
|
68793
68853
|
if (!data) {
|
|
68794
68854
|
return;
|
|
68795
68855
|
}
|
|
@@ -70829,12 +70889,12 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
70829
70889
|
}
|
|
70830
70890
|
case "INSERT_CELL": {
|
|
70831
70891
|
const { cut, paste } = this.getInsertCellsTargets(cmd.zone, cmd.shiftDimension);
|
|
70832
|
-
const copiedData = this.copy(cut);
|
|
70892
|
+
const copiedData = this.copy(cut, "shiftCells");
|
|
70833
70893
|
return this.isPasteAllowed(paste, copiedData, { isCutOperation: true });
|
|
70834
70894
|
}
|
|
70835
70895
|
case "DELETE_CELL": {
|
|
70836
70896
|
const { cut, paste } = this.getDeleteCellsTargets(cmd.zone, cmd.shiftDimension);
|
|
70837
|
-
const copiedData = this.copy(cut);
|
|
70897
|
+
const copiedData = this.copy(cut, "shiftCells");
|
|
70838
70898
|
return this.isPasteAllowed(paste, copiedData, { isCutOperation: true });
|
|
70839
70899
|
}
|
|
70840
70900
|
}
|
|
@@ -70945,13 +71005,13 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
70945
71005
|
});
|
|
70946
71006
|
break;
|
|
70947
71007
|
}
|
|
70948
|
-
const copiedData = this.copy(cut);
|
|
71008
|
+
const copiedData = this.copy(cut, "shiftCells");
|
|
70949
71009
|
this.paste(paste, copiedData, { isCutOperation: true });
|
|
70950
71010
|
break;
|
|
70951
71011
|
}
|
|
70952
71012
|
case "INSERT_CELL": {
|
|
70953
71013
|
const { cut, paste } = this.getInsertCellsTargets(cmd.zone, cmd.shiftDimension);
|
|
70954
|
-
const copiedData = this.copy(cut);
|
|
71014
|
+
const copiedData = this.copy(cut, "shiftCells");
|
|
70955
71015
|
this.paste(paste, copiedData, { isCutOperation: true });
|
|
70956
71016
|
break;
|
|
70957
71017
|
}
|
|
@@ -71066,11 +71126,11 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
71066
71126
|
}
|
|
71067
71127
|
return false;
|
|
71068
71128
|
}
|
|
71069
|
-
copy(zones) {
|
|
71129
|
+
copy(zones, mode = "copyPaste") {
|
|
71070
71130
|
let copiedData = {};
|
|
71071
71131
|
const clipboardData = this.getClipboardData(zones);
|
|
71072
71132
|
for (const { handlerName, handler } of this.selectClipboardHandlers(clipboardData)) {
|
|
71073
|
-
const data = handler.copy(clipboardData, this._isCutOperation);
|
|
71133
|
+
const data = handler.copy(clipboardData, this._isCutOperation, mode);
|
|
71074
71134
|
copiedData[handlerName] = data;
|
|
71075
71135
|
const minimalKeys = ["sheetId", "cells", "zones", "figureId"];
|
|
71076
71136
|
for (const key of minimalKeys) {
|
|
@@ -72021,7 +72081,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
72021
72081
|
];
|
|
72022
72082
|
for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
|
|
72023
72083
|
const handler = new Handler(this.getters, this.dispatch);
|
|
72024
|
-
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
72084
|
+
const data = handler.copy(getClipboardDataPositions(sheetId, target), false, "shiftCells");
|
|
72025
72085
|
if (!data) {
|
|
72026
72086
|
continue;
|
|
72027
72087
|
}
|
|
@@ -79216,7 +79276,7 @@ function figureCoordinates(headers, anchor, offset) {
|
|
|
79216
79276
|
for (const [headerIndex, header] of headers.slice(anchor).entries()) {
|
|
79217
79277
|
if (currentPosition <= offset && offset < currentPosition + header.size) {
|
|
79218
79278
|
return {
|
|
79219
|
-
index: headerIndex,
|
|
79279
|
+
index: anchor + headerIndex,
|
|
79220
79280
|
offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH),
|
|
79221
79281
|
};
|
|
79222
79282
|
}
|
|
@@ -80955,6 +81015,6 @@ exports.tokenColors = tokenColors;
|
|
|
80955
81015
|
exports.tokenize = tokenize;
|
|
80956
81016
|
|
|
80957
81017
|
|
|
80958
|
-
__info__.version = "18.3.
|
|
80959
|
-
__info__.date = "2025-
|
|
80960
|
-
__info__.hash = "
|
|
81018
|
+
__info__.version = "18.3.20";
|
|
81019
|
+
__info__.date = "2025-09-11T08:45:37.934Z";
|
|
81020
|
+
__info__.hash = "ef829f4";
|