@odoo/o-spreadsheet 17.1.15 → 17.1.17
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 +109 -65
- package/dist/o-spreadsheet.d.ts +1 -0
- package/dist/o-spreadsheet.esm.js +109 -65
- package/dist/o-spreadsheet.iife.js +109 -65
- package/dist/o-spreadsheet.iife.min.js +101 -101
- 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 17.1.
|
|
6
|
-
* @date 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.1.17
|
|
6
|
+
* @date 2024-06-03T14:54:06.711Z
|
|
7
|
+
* @hash 7dedb2f
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Component, useRef, onMounted, onWillUnmount, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
|
|
@@ -565,8 +565,9 @@ function deepEquals(o1, o2, ignoreFunctions) {
|
|
|
565
565
|
return false;
|
|
566
566
|
}
|
|
567
567
|
else {
|
|
568
|
-
if (ignoreFunctions && typeOfO1Key === "function")
|
|
569
|
-
|
|
568
|
+
if (ignoreFunctions && typeOfO1Key === "function") {
|
|
569
|
+
continue;
|
|
570
|
+
}
|
|
570
571
|
if (o1[key] !== o2[key])
|
|
571
572
|
return false;
|
|
572
573
|
}
|
|
@@ -1800,7 +1801,7 @@ class LazyTranslatedString extends String {
|
|
|
1800
1801
|
}
|
|
1801
1802
|
valueOf() {
|
|
1802
1803
|
const str = super.valueOf();
|
|
1803
|
-
return _loaded() ? sprintf(_translate(str), ...this.values) : str;
|
|
1804
|
+
return _loaded() ? sprintf(_translate(str), ...this.values) : sprintf(str, ...this.values);
|
|
1804
1805
|
}
|
|
1805
1806
|
toString() {
|
|
1806
1807
|
return this.valueOf();
|
|
@@ -2604,7 +2605,7 @@ function evaluatePredicate(value, criterion) {
|
|
|
2604
2605
|
return false;
|
|
2605
2606
|
}
|
|
2606
2607
|
if (typeof operand === "number" && operator === "=") {
|
|
2607
|
-
return toString(
|
|
2608
|
+
return value.toString() === operand.toString();
|
|
2608
2609
|
}
|
|
2609
2610
|
if (operator === "<>" || operator === "=") {
|
|
2610
2611
|
let result;
|
|
@@ -2664,14 +2665,13 @@ function visitMatchingRanges(args, cb, locale, isQuery = false) {
|
|
|
2664
2665
|
if (countArg % 2 === 1) {
|
|
2665
2666
|
throw new EvaluationError(_t("Function [[FUNCTION_NAME]] expects criteria_range and criterion to be in pairs."));
|
|
2666
2667
|
}
|
|
2667
|
-
const
|
|
2668
|
-
const
|
|
2668
|
+
const firstArg = toMatrix(args[0]);
|
|
2669
|
+
const dimRow = firstArg.length;
|
|
2670
|
+
const dimCol = firstArg[0].length;
|
|
2669
2671
|
let predicates = [];
|
|
2670
2672
|
for (let i = 0; i < countArg - 1; i += 2) {
|
|
2671
|
-
const criteriaRange = args[i];
|
|
2672
|
-
if (
|
|
2673
|
-
criteriaRange.length !== dimRow ||
|
|
2674
|
-
criteriaRange[0].length !== dimCol) {
|
|
2673
|
+
const criteriaRange = toMatrix(args[i]);
|
|
2674
|
+
if (criteriaRange.length !== dimRow || criteriaRange[0].length !== dimCol) {
|
|
2675
2675
|
throw new EvaluationError(_t("Function [[FUNCTION_NAME]] expects criteria_range to have the same dimension"));
|
|
2676
2676
|
}
|
|
2677
2677
|
const description = toString(args[i + 1]);
|
|
@@ -2681,7 +2681,7 @@ function visitMatchingRanges(args, cb, locale, isQuery = false) {
|
|
|
2681
2681
|
for (let j = 0; j < dimCol; j++) {
|
|
2682
2682
|
let validatedPredicates = true;
|
|
2683
2683
|
for (let k = 0; k < countArg - 1; k += 2) {
|
|
2684
|
-
const criteriaValue = args[k][i][j].value;
|
|
2684
|
+
const criteriaValue = toMatrix(args[k])[i][j].value;
|
|
2685
2685
|
const criterion = predicates[k / 2];
|
|
2686
2686
|
validatedPredicates = evaluatePredicate(criteriaValue ?? undefined, criterion);
|
|
2687
2687
|
if (!validatedPredicates) {
|
|
@@ -4369,8 +4369,11 @@ function copyRangeWithNewSheetId(sheetIdFrom, sheetIdTo, range) {
|
|
|
4369
4369
|
/**
|
|
4370
4370
|
* Create a range from a xc. If the xc is empty, this function returns undefined.
|
|
4371
4371
|
*/
|
|
4372
|
-
function
|
|
4373
|
-
|
|
4372
|
+
function createValidRange(getters, sheetId, xc) {
|
|
4373
|
+
if (!xc)
|
|
4374
|
+
return;
|
|
4375
|
+
const range = getters.getRangeFromSheetXC(sheetId, xc);
|
|
4376
|
+
return !(range.invalidSheetName || range.invalidXc) ? range : undefined;
|
|
4374
4377
|
}
|
|
4375
4378
|
/**
|
|
4376
4379
|
* Spread multiple colrows zone to one row/col zone and add a many new input range as needed.
|
|
@@ -5301,8 +5304,8 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
5301
5304
|
type = "scorecard";
|
|
5302
5305
|
constructor(definition, sheetId, getters) {
|
|
5303
5306
|
super(definition, sheetId, getters);
|
|
5304
|
-
this.keyValue =
|
|
5305
|
-
this.baseline =
|
|
5307
|
+
this.keyValue = createValidRange(getters, sheetId, definition.keyValue);
|
|
5308
|
+
this.baseline = createValidRange(getters, sheetId, definition.baseline);
|
|
5306
5309
|
this.baselineMode = definition.baselineMode;
|
|
5307
5310
|
this.baselineDescr = definition.baselineDescr;
|
|
5308
5311
|
this.background = definition.background;
|
|
@@ -8645,7 +8648,7 @@ class BarChart extends AbstractChart {
|
|
|
8645
8648
|
constructor(definition, sheetId, getters) {
|
|
8646
8649
|
super(definition, sheetId, getters);
|
|
8647
8650
|
this.dataSets = createDataSets(getters, definition.dataSets, sheetId, definition.dataSetsHaveTitle);
|
|
8648
|
-
this.labelRange =
|
|
8651
|
+
this.labelRange = createValidRange(getters, sheetId, definition.labelRange);
|
|
8649
8652
|
this.background = definition.background;
|
|
8650
8653
|
this.verticalAxisPosition = definition.verticalAxisPosition;
|
|
8651
8654
|
this.legendPosition = definition.legendPosition;
|
|
@@ -8888,7 +8891,7 @@ class GaugeChart extends AbstractChart {
|
|
|
8888
8891
|
type = "gauge";
|
|
8889
8892
|
constructor(definition, sheetId, getters) {
|
|
8890
8893
|
super(definition, sheetId, getters);
|
|
8891
|
-
this.dataRange =
|
|
8894
|
+
this.dataRange = createValidRange(this.getters, this.sheetId, definition.dataRange);
|
|
8892
8895
|
this.sectionRule = definition.sectionRule;
|
|
8893
8896
|
this.background = definition.background;
|
|
8894
8897
|
}
|
|
@@ -9222,7 +9225,7 @@ class LineChart extends AbstractChart {
|
|
|
9222
9225
|
constructor(definition, sheetId, getters) {
|
|
9223
9226
|
super(definition, sheetId, getters);
|
|
9224
9227
|
this.dataSets = createDataSets(this.getters, definition.dataSets, sheetId, definition.dataSetsHaveTitle);
|
|
9225
|
-
this.labelRange =
|
|
9228
|
+
this.labelRange = createValidRange(this.getters, sheetId, definition.labelRange);
|
|
9226
9229
|
this.background = definition.background;
|
|
9227
9230
|
this.verticalAxisPosition = definition.verticalAxisPosition;
|
|
9228
9231
|
this.legendPosition = definition.legendPosition;
|
|
@@ -9542,7 +9545,7 @@ class PieChart extends AbstractChart {
|
|
|
9542
9545
|
constructor(definition, sheetId, getters) {
|
|
9543
9546
|
super(definition, sheetId, getters);
|
|
9544
9547
|
this.dataSets = createDataSets(getters, definition.dataSets, sheetId, definition.dataSetsHaveTitle);
|
|
9545
|
-
this.labelRange =
|
|
9548
|
+
this.labelRange = createValidRange(getters, sheetId, definition.labelRange);
|
|
9546
9549
|
this.background = definition.background;
|
|
9547
9550
|
this.legendPosition = definition.legendPosition;
|
|
9548
9551
|
this.aggregated = definition.aggregated;
|
|
@@ -11186,6 +11189,9 @@ function makeArg(str, description) {
|
|
|
11186
11189
|
if (types.some((t) => t.startsWith("RANGE"))) {
|
|
11187
11190
|
result.acceptMatrix = true;
|
|
11188
11191
|
}
|
|
11192
|
+
if (types.every((t) => t.startsWith("RANGE"))) {
|
|
11193
|
+
result.acceptMatrixOnly = true;
|
|
11194
|
+
}
|
|
11189
11195
|
return result;
|
|
11190
11196
|
}
|
|
11191
11197
|
/**
|
|
@@ -11467,11 +11473,16 @@ const CHOOSECOLS = {
|
|
|
11467
11473
|
compute: function (array, ...columns) {
|
|
11468
11474
|
const _array = toMatrix(array);
|
|
11469
11475
|
const _columns = flattenRowFirst(columns, (item) => toInteger(item?.value, this.locale));
|
|
11470
|
-
|
|
11476
|
+
const argOutOfRange = _columns.filter((col) => col === 0 || _array.length < Math.abs(col));
|
|
11477
|
+
assert(() => argOutOfRange.length === 0, _t("The columns arguments must be between -%s and %s (got %s), excluding 0.", _array.length.toString(), _array.length.toString(), argOutOfRange.join(",")));
|
|
11471
11478
|
const result = Array(_columns.length);
|
|
11472
11479
|
for (let col = 0; col < _columns.length; col++) {
|
|
11473
|
-
|
|
11474
|
-
|
|
11480
|
+
if (_columns[col] > 0) {
|
|
11481
|
+
result[col] = _array[_columns[col] - 1]; // -1 because columns arguments are 1-indexed
|
|
11482
|
+
}
|
|
11483
|
+
else {
|
|
11484
|
+
result[col] = _array[_array.length + _columns[col]];
|
|
11485
|
+
}
|
|
11475
11486
|
}
|
|
11476
11487
|
return result;
|
|
11477
11488
|
},
|
|
@@ -11492,8 +11503,14 @@ const CHOOSEROWS = {
|
|
|
11492
11503
|
const _array = toMatrix(array);
|
|
11493
11504
|
const _rows = flattenRowFirst(rows, (item) => toInteger(item?.value, this.locale));
|
|
11494
11505
|
const _nbColumns = _array.length;
|
|
11495
|
-
|
|
11496
|
-
|
|
11506
|
+
const argOutOfRange = _rows.filter((row) => row === 0 || _array[0].length < Math.abs(row));
|
|
11507
|
+
assert(() => argOutOfRange.length === 0, _t("The rows arguments must be between -%s and %s (got %s), excluding 0.", _array[0].length.toString(), _array[0].length.toString(), argOutOfRange.join(",")));
|
|
11508
|
+
return generateMatrix(_nbColumns, _rows.length, (col, row) => {
|
|
11509
|
+
if (_rows[row] > 0) {
|
|
11510
|
+
return _array[col][_rows[row] - 1]; // -1 because columns arguments are 1-indexed
|
|
11511
|
+
}
|
|
11512
|
+
return _array[col][_array[col].length + _rows[row]];
|
|
11513
|
+
});
|
|
11497
11514
|
},
|
|
11498
11515
|
isExported: true,
|
|
11499
11516
|
};
|
|
@@ -12401,7 +12418,7 @@ const COUNTUNIQUEIFS = {
|
|
|
12401
12418
|
compute: function (range, ...args) {
|
|
12402
12419
|
let uniqueValues = new Set();
|
|
12403
12420
|
visitMatchingRanges(args, (i, j) => {
|
|
12404
|
-
const data = range[i][j];
|
|
12421
|
+
const data = range[i]?.[j];
|
|
12405
12422
|
if (isDefined(data)) {
|
|
12406
12423
|
uniqueValues.add(data.value);
|
|
12407
12424
|
}
|
|
@@ -13031,7 +13048,7 @@ const SUMIF = {
|
|
|
13031
13048
|
}
|
|
13032
13049
|
let sum = 0;
|
|
13033
13050
|
visitMatchingRanges([criteriaRange, criterion], (i, j) => {
|
|
13034
|
-
const value = sumRange[i][j]
|
|
13051
|
+
const value = sumRange[i]?.[j]?.value;
|
|
13035
13052
|
if (typeof value === "number") {
|
|
13036
13053
|
sum += value;
|
|
13037
13054
|
}
|
|
@@ -13056,7 +13073,7 @@ const SUMIFS = {
|
|
|
13056
13073
|
compute: function (sumRange, ...criters) {
|
|
13057
13074
|
let sum = 0;
|
|
13058
13075
|
visitMatchingRanges(criters, (i, j) => {
|
|
13059
|
-
const value = sumRange[i][j]
|
|
13076
|
+
const value = sumRange[i]?.[j]?.value;
|
|
13060
13077
|
if (typeof value === "number") {
|
|
13061
13078
|
sum += value;
|
|
13062
13079
|
}
|
|
@@ -13603,7 +13620,7 @@ const AVERAGEIF = {
|
|
|
13603
13620
|
let count = 0;
|
|
13604
13621
|
let sum = 0;
|
|
13605
13622
|
visitMatchingRanges([criteriaRange, criterion], (i, j) => {
|
|
13606
|
-
const value = _averageRange[i][j]
|
|
13623
|
+
const value = _averageRange[i]?.[j]?.value;
|
|
13607
13624
|
if (typeof value === "number") {
|
|
13608
13625
|
count += 1;
|
|
13609
13626
|
sum += value;
|
|
@@ -13632,7 +13649,7 @@ const AVERAGEIFS = {
|
|
|
13632
13649
|
let count = 0;
|
|
13633
13650
|
let sum = 0;
|
|
13634
13651
|
visitMatchingRanges(args, (i, j) => {
|
|
13635
|
-
const value = _averageRange[i][j]
|
|
13652
|
+
const value = _averageRange[i]?.[j]?.value;
|
|
13636
13653
|
if (typeof value === "number") {
|
|
13637
13654
|
count += 1;
|
|
13638
13655
|
sum += value;
|
|
@@ -13937,7 +13954,7 @@ const MAXIFS = {
|
|
|
13937
13954
|
compute: function (range, ...args) {
|
|
13938
13955
|
let result = -Infinity;
|
|
13939
13956
|
visitMatchingRanges(args, (i, j) => {
|
|
13940
|
-
const value = range[i][j]
|
|
13957
|
+
const value = range[i]?.[j]?.value;
|
|
13941
13958
|
if (typeof value === "number") {
|
|
13942
13959
|
result = result < value ? value : result;
|
|
13943
13960
|
}
|
|
@@ -14020,7 +14037,7 @@ const MINIFS = {
|
|
|
14020
14037
|
compute: function (range, ...args) {
|
|
14021
14038
|
let result = Infinity;
|
|
14022
14039
|
visitMatchingRanges(args, (i, j) => {
|
|
14023
|
-
const value = range[i][j]
|
|
14040
|
+
const value = range[i]?.[j]?.value;
|
|
14024
14041
|
if (typeof value === "number") {
|
|
14025
14042
|
result = result > value ? value : result;
|
|
14026
14043
|
}
|
|
@@ -19797,6 +19814,9 @@ function addInputHandling(descr) {
|
|
|
19797
19814
|
}
|
|
19798
19815
|
args[i] = arg[0][0];
|
|
19799
19816
|
}
|
|
19817
|
+
if (!isMatrix(arg) && argDefinition.acceptMatrixOnly) {
|
|
19818
|
+
throw new BadExpressionError(_t("Function [[FUNCTION_NAME]] expects the parameter '%s' to be reference to a cell or range.", (i + 1).toString()));
|
|
19819
|
+
}
|
|
19800
19820
|
}
|
|
19801
19821
|
return descr.compute.apply(this, args);
|
|
19802
19822
|
}
|
|
@@ -22149,7 +22169,7 @@ class LineBarPieConfigPanel extends Component {
|
|
|
22149
22169
|
}
|
|
22150
22170
|
const getters = this.env.model.getters;
|
|
22151
22171
|
const sheetId = getters.getActiveSheetId();
|
|
22152
|
-
const labelRange =
|
|
22172
|
+
const labelRange = createValidRange(getters, sheetId, this.labelRange);
|
|
22153
22173
|
const dataSets = createDataSets(getters, this.dataSeriesRanges, sheetId, this.props.definition.dataSetsHaveTitle);
|
|
22154
22174
|
if (dataSets.length) {
|
|
22155
22175
|
return dataSets[0].dataRange.zone.top + 1;
|
|
@@ -26272,14 +26292,14 @@ class FigureComponent extends Component {
|
|
|
26272
26292
|
}
|
|
26273
26293
|
onKeyDown(ev) {
|
|
26274
26294
|
const figure = this.props.figure;
|
|
26275
|
-
|
|
26295
|
+
const keyDownShortcut = keyboardEventToShortcutString(ev);
|
|
26296
|
+
switch (keyDownShortcut) {
|
|
26276
26297
|
case "Delete":
|
|
26277
26298
|
this.env.model.dispatch("DELETE_FIGURE", {
|
|
26278
26299
|
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
26279
26300
|
id: figure.id,
|
|
26280
26301
|
});
|
|
26281
26302
|
this.props.onFigureDeleted();
|
|
26282
|
-
ev.stopPropagation();
|
|
26283
26303
|
ev.preventDefault();
|
|
26284
26304
|
ev.stopPropagation();
|
|
26285
26305
|
break;
|
|
@@ -26300,7 +26320,22 @@ class FigureComponent extends Component {
|
|
|
26300
26320
|
x: figure.x + delta[0],
|
|
26301
26321
|
y: figure.y + delta[1],
|
|
26302
26322
|
});
|
|
26323
|
+
ev.preventDefault();
|
|
26303
26324
|
ev.stopPropagation();
|
|
26325
|
+
break;
|
|
26326
|
+
case "Ctrl+A":
|
|
26327
|
+
// Maybe in the future we will implement a way to select all figures
|
|
26328
|
+
ev.preventDefault();
|
|
26329
|
+
ev.stopPropagation();
|
|
26330
|
+
break;
|
|
26331
|
+
case "Ctrl+Y":
|
|
26332
|
+
case "Ctrl+Z":
|
|
26333
|
+
if (keyDownShortcut === "Ctrl+Y") {
|
|
26334
|
+
this.env.model.dispatch("REQUEST_REDO");
|
|
26335
|
+
}
|
|
26336
|
+
else if (keyDownShortcut === "Ctrl+Z") {
|
|
26337
|
+
this.env.model.dispatch("REQUEST_UNDO");
|
|
26338
|
+
}
|
|
26304
26339
|
ev.preventDefault();
|
|
26305
26340
|
ev.stopPropagation();
|
|
26306
26341
|
break;
|
|
@@ -27175,7 +27210,7 @@ class Composer extends Component {
|
|
|
27175
27210
|
"Ctrl+Enter": this.processNewLineEvent,
|
|
27176
27211
|
Escape: this.processEscapeKey,
|
|
27177
27212
|
F2: () => console.warn("Not implemented"),
|
|
27178
|
-
F4: this.processF4Key,
|
|
27213
|
+
F4: (ev) => this.processF4Key(ev),
|
|
27179
27214
|
Tab: (ev) => this.processTabKey(ev, "right"),
|
|
27180
27215
|
"Shift+Tab": (ev) => this.processTabKey(ev, "left"),
|
|
27181
27216
|
};
|
|
@@ -27289,9 +27324,10 @@ class Composer extends Component {
|
|
|
27289
27324
|
processEscapeKey() {
|
|
27290
27325
|
this.env.model.dispatch("CANCEL_EDITION");
|
|
27291
27326
|
}
|
|
27292
|
-
processF4Key() {
|
|
27327
|
+
processF4Key(ev) {
|
|
27293
27328
|
this.env.model.dispatch("CYCLE_EDITION_REFERENCES");
|
|
27294
27329
|
this.processContent();
|
|
27330
|
+
ev.stopPropagation();
|
|
27295
27331
|
}
|
|
27296
27332
|
processNumpadDecimal(ev) {
|
|
27297
27333
|
ev.stopPropagation();
|
|
@@ -35760,12 +35796,6 @@ function compileTokens(tokens) {
|
|
|
35760
35796
|
// detect when an argument need to be evaluated as a meta argument
|
|
35761
35797
|
const isMeta = argTypes.includes("META");
|
|
35762
35798
|
const hasRange = argTypes.some((t) => isRangeType(t));
|
|
35763
|
-
const isRangeOnly = argTypes.every((t) => isRangeType(t));
|
|
35764
|
-
if (isRangeOnly) {
|
|
35765
|
-
if (!isRangeInput(currentArg)) {
|
|
35766
|
-
throw new BadExpressionError(_t("Function %s expects the parameter %s to be reference to a cell or range, not a %s.", functionName, (i + 1).toString(), currentArg.type.toLowerCase()));
|
|
35767
|
-
}
|
|
35768
|
-
}
|
|
35769
35799
|
compiledArgs.push(compileAST(currentArg, isMeta, hasRange, {
|
|
35770
35800
|
functionName,
|
|
35771
35801
|
paramIndex: i + 1,
|
|
@@ -35936,16 +35966,6 @@ function assertEnoughArgs(ast) {
|
|
|
35936
35966
|
function isRangeType(type) {
|
|
35937
35967
|
return type.startsWith("RANGE");
|
|
35938
35968
|
}
|
|
35939
|
-
function isRangeInput(arg) {
|
|
35940
|
-
if (arg.type === "REFERENCE") {
|
|
35941
|
-
return true;
|
|
35942
|
-
}
|
|
35943
|
-
if (arg.type === "FUNCALL") {
|
|
35944
|
-
const fnDef = functions$1[arg.value.toUpperCase()];
|
|
35945
|
-
return fnDef && isRangeType(fnDef.returns[0]);
|
|
35946
|
-
}
|
|
35947
|
-
return false;
|
|
35948
|
-
}
|
|
35949
35969
|
|
|
35950
35970
|
/**
|
|
35951
35971
|
* Add the following information on tokens:
|
|
@@ -38452,7 +38472,12 @@ class MergePlugin extends CorePlugin {
|
|
|
38452
38472
|
* if they have at least a common cell
|
|
38453
38473
|
*/
|
|
38454
38474
|
doesIntersectMerge(sheetId, zone) {
|
|
38455
|
-
|
|
38475
|
+
for (const merge of this.getMerges(sheetId)) {
|
|
38476
|
+
if (overlap(zone, merge)) {
|
|
38477
|
+
return true;
|
|
38478
|
+
}
|
|
38479
|
+
}
|
|
38480
|
+
return false;
|
|
38456
38481
|
}
|
|
38457
38482
|
/**
|
|
38458
38483
|
* Returns true if two columns have at least one merge in common
|
|
@@ -39053,6 +39078,9 @@ class RangeAdapter {
|
|
|
39053
39078
|
if (range.invalidXc) {
|
|
39054
39079
|
return range.invalidXc;
|
|
39055
39080
|
}
|
|
39081
|
+
if (!this.getters.tryGetSheet(range.sheetId)) {
|
|
39082
|
+
return CellErrorType.InvalidReference;
|
|
39083
|
+
}
|
|
39056
39084
|
if (range.zone.bottom - range.zone.top < 0 || range.zone.right - range.zone.left < 0) {
|
|
39057
39085
|
return CellErrorType.InvalidReference;
|
|
39058
39086
|
}
|
|
@@ -42500,16 +42528,22 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
42500
42528
|
let newContent = undefined;
|
|
42501
42529
|
let newFormat = undefined;
|
|
42502
42530
|
let isExported = true;
|
|
42531
|
+
const exportedSheetData = data.sheets.find((sheet) => sheet.id === position.sheetId);
|
|
42503
42532
|
const formulaCell = this.getCorrespondingFormulaCell(position);
|
|
42504
42533
|
if (formulaCell) {
|
|
42505
42534
|
isExported = isExportableToExcel(formulaCell.compiledFormula.tokens);
|
|
42506
42535
|
isFormula = isExported;
|
|
42507
42536
|
if (!isExported) {
|
|
42508
|
-
|
|
42509
|
-
|
|
42537
|
+
// If the cell contains a non-exported formula and that is evaluates to
|
|
42538
|
+
// nothing* ,we don't export it.
|
|
42539
|
+
// * non-falsy value are relevant and so are 0 and FALSE, which only leaves
|
|
42540
|
+
// the empty string.
|
|
42541
|
+
if (value !== "") {
|
|
42542
|
+
newContent = value.toString();
|
|
42543
|
+
newFormat = evaluatedCell.format;
|
|
42544
|
+
}
|
|
42510
42545
|
}
|
|
42511
42546
|
}
|
|
42512
|
-
const exportedSheetData = data.sheets.find((sheet) => sheet.id === position.sheetId);
|
|
42513
42547
|
const exportedCellData = exportedSheetData.cells[xc] || {};
|
|
42514
42548
|
const format = newFormat
|
|
42515
42549
|
? getItemId(newFormat, data.formats)
|
|
@@ -48811,7 +48845,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
48811
48845
|
case "ADD_COLUMNS_ROWS": {
|
|
48812
48846
|
this.status = "invisible";
|
|
48813
48847
|
// If we add a col/row inside or before the cut area, we invalidate the clipboard
|
|
48814
|
-
if (this.state?.operation !== "CUT") {
|
|
48848
|
+
if (this.state?.operation !== "CUT" || cmd.sheetId !== this.state?.sheetId) {
|
|
48815
48849
|
return;
|
|
48816
48850
|
}
|
|
48817
48851
|
const isClipboardDirty = this.state.isColRowDirtyingClipboard(cmd.position === "before" ? cmd.base : cmd.base + 1, cmd.dimension);
|
|
@@ -48823,7 +48857,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
48823
48857
|
case "REMOVE_COLUMNS_ROWS": {
|
|
48824
48858
|
this.status = "invisible";
|
|
48825
48859
|
// If we remove a col/row inside or before the cut area, we invalidate the clipboard
|
|
48826
|
-
if (this.state?.operation !== "CUT") {
|
|
48860
|
+
if (this.state?.operation !== "CUT" || cmd.sheetId !== this.state?.sheetId) {
|
|
48827
48861
|
return;
|
|
48828
48862
|
}
|
|
48829
48863
|
for (let el of cmd.elements) {
|
|
@@ -52006,9 +52040,11 @@ class BottomBarSheet extends Component {
|
|
|
52006
52040
|
if (ev.key === "Enter") {
|
|
52007
52041
|
ev.preventDefault();
|
|
52008
52042
|
this.stopEdition();
|
|
52043
|
+
this.env.focusableElement.focus();
|
|
52009
52044
|
}
|
|
52010
52045
|
if (ev.key === "Escape") {
|
|
52011
52046
|
this.cancelEdition();
|
|
52047
|
+
this.env.focusableElement.focus();
|
|
52012
52048
|
}
|
|
52013
52049
|
}
|
|
52014
52050
|
onClickSheetName(ev) {
|
|
@@ -53894,6 +53930,10 @@ class Spreadsheet extends Component {
|
|
|
53894
53930
|
}, () => [this.env.model.getters.getActiveSheetId()]);
|
|
53895
53931
|
useExternalListener(window, "resize", () => this.render(true));
|
|
53896
53932
|
useExternalListener(window, "beforeunload", this.unbindModelEvents.bind(this));
|
|
53933
|
+
// For some reason, the wheel event is not properly registered inside templates
|
|
53934
|
+
// in Chromium-based browsers based on chromium 125
|
|
53935
|
+
// This hack ensures the event declared in the template is properly registered/working
|
|
53936
|
+
useExternalListener(document.body, "wheel", () => { });
|
|
53897
53937
|
this.bindModelEvents();
|
|
53898
53938
|
onWillUpdateProps((nextProps) => {
|
|
53899
53939
|
if (nextProps.model !== this.props.model) {
|
|
@@ -56699,7 +56739,11 @@ function addRows(construct, data, sheet) {
|
|
|
56699
56739
|
let cellNode = escapeXml ``;
|
|
56700
56740
|
// Either formula or static value inside the cell
|
|
56701
56741
|
if (cell.isFormula) {
|
|
56702
|
-
|
|
56742
|
+
const res = addFormula(cell);
|
|
56743
|
+
if (!res) {
|
|
56744
|
+
continue;
|
|
56745
|
+
}
|
|
56746
|
+
({ attrs: additionalAttrs, node: cellNode } = res);
|
|
56703
56747
|
}
|
|
56704
56748
|
else if (cell.content && isMarkdownLink(cell.content)) {
|
|
56705
56749
|
const { label } = parseMarkdownLink(cell.content);
|
|
@@ -57693,6 +57737,6 @@ const constants = {
|
|
|
57693
57737
|
export { AbstractChart, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
57694
57738
|
|
|
57695
57739
|
|
|
57696
|
-
__info__.version = "17.1.
|
|
57697
|
-
__info__.date = "2024-
|
|
57698
|
-
__info__.hash = "
|
|
57740
|
+
__info__.version = "17.1.17";
|
|
57741
|
+
__info__.date = "2024-06-03T14:54:06.711Z";
|
|
57742
|
+
__info__.hash = "7dedb2f";
|