@odoo/o-spreadsheet 19.1.0-alpha.10 → 19.1.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/o-spreadsheet-engine.d.ts +16 -5
- package/dist/o-spreadsheet-engine.esm.js +175 -208
- package/dist/o-spreadsheet-engine.iife.js +175 -208
- package/dist/o-spreadsheet-engine.min.iife.js +171 -171
- package/dist/o-spreadsheet.d.ts +179 -423
- package/dist/o_spreadsheet.esm.js +685 -382
- package/dist/o_spreadsheet.iife.js +685 -382
- package/dist/o_spreadsheet.min.iife.js +309 -309
- package/dist/o_spreadsheet.xml +388 -266
- package/package.json +2 -2
|
@@ -3,8 +3,8 @@
|
|
|
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
5
|
* @version 19.1.0-alpha.3
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
6
|
+
* @date 2025-11-12T14:16:26.552Z
|
|
7
|
+
* @hash 6fefc9c
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports) {
|
|
@@ -180,13 +180,13 @@
|
|
|
180
180
|
let optionalArg = 0;
|
|
181
181
|
for (const arg of addDescr.args) {
|
|
182
182
|
countArg++;
|
|
183
|
-
if (!arg.optional && !arg.
|
|
183
|
+
if (!arg.optional && !arg.default) {
|
|
184
184
|
minArg++;
|
|
185
185
|
}
|
|
186
186
|
if (arg.repeating) {
|
|
187
187
|
repeatingArg++;
|
|
188
188
|
}
|
|
189
|
-
if (arg.optional || arg.default) {
|
|
189
|
+
if ((arg.optional || arg.default) && !arg.repeating) {
|
|
190
190
|
optionalArg++;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
descr.minArgRequired = minArg;
|
|
195
195
|
descr.maxArgPossible = repeatingArg ? Infinity : countArg;
|
|
196
196
|
descr.nbrArgRepeating = repeatingArg;
|
|
197
|
-
descr.
|
|
197
|
+
descr.nbrOptionalNonRepeatingArgs = optionalArg;
|
|
198
198
|
descr.hidden = addDescr.hidden || false;
|
|
199
199
|
descr.name = name;
|
|
200
200
|
return descr;
|
|
@@ -222,9 +222,9 @@
|
|
|
222
222
|
* and rows representing the correspondence with the argument index.
|
|
223
223
|
*
|
|
224
224
|
* The tables are built based on the following conventions:
|
|
225
|
-
* - `m`: Mandatory argument
|
|
226
|
-
* - `o`: Optional argument
|
|
227
|
-
* - `r`: Repeating argument
|
|
225
|
+
* - `m`: Mandatory argument (count as one argument)
|
|
226
|
+
* - `o`: Optional argument (count as zero or one argument)
|
|
227
|
+
* - `r`: Repeating argument (count as one or more arguments)
|
|
228
228
|
*
|
|
229
229
|
*
|
|
230
230
|
* Configuration 1: (m, o) like the CEILING function
|
|
@@ -237,39 +237,39 @@
|
|
|
237
237
|
*
|
|
238
238
|
* Configuration 2: (m, m, m, r, r) like the SUMIFS function
|
|
239
239
|
*
|
|
240
|
-
* | |
|
|
241
|
-
*
|
|
242
|
-
* | m | 0 | 0
|
|
243
|
-
* | m | 1 | 1
|
|
244
|
-
* | m | 2 | 2
|
|
245
|
-
* | r |
|
|
246
|
-
* | r |
|
|
240
|
+
* | | 5 | 7 | 3 + 2n |
|
|
241
|
+
* |---|---|------|------------|
|
|
242
|
+
* | m | 0 | 0 | 0 |
|
|
243
|
+
* | m | 1 | 1 | 1 |
|
|
244
|
+
* | m | 2 | 2 | 2 |
|
|
245
|
+
* | r | 3 | 3, 5 | 3 + 2n |
|
|
246
|
+
* | r | 4 | 4, 6 | 3 + 2n + 1 |
|
|
247
247
|
*
|
|
248
248
|
*
|
|
249
249
|
* Configuration 3: (m, m, m, r, r, o) like the SWITCH function
|
|
250
250
|
*
|
|
251
|
-
* | |
|
|
252
|
-
*
|
|
253
|
-
* | m | 0 | 0 | 0
|
|
254
|
-
* | m | 1 | 1 | 1
|
|
255
|
-
* | m | 2 | 2 | 2
|
|
256
|
-
* | r |
|
|
257
|
-
* | r |
|
|
258
|
-
* | o | |
|
|
251
|
+
* | | 5 | 6 | 7 | 8 | 3 + 2n | 3 + 2n + 1 |
|
|
252
|
+
* |---|---|---|------|------|------------|----------------|
|
|
253
|
+
* | m | 0 | 0 | 0 | 0 | 0 | 0 |
|
|
254
|
+
* | m | 1 | 1 | 1 | 1 | 1 | 1 |
|
|
255
|
+
* | m | 2 | 2 | 2 | 2 | 2 | 2 |
|
|
256
|
+
* | r | 3 | 3 | 3, 5 | 3, 5 | 3 + 2n | 3 + 2n |
|
|
257
|
+
* | r | 4 | 4 | 4, 6 | 4, 6 | 3 + 2n + 1 | 3 + 2n + 1 |
|
|
258
|
+
* | o | | 5 | | 7 | | 3 + 2N + 2 |
|
|
259
259
|
*
|
|
260
260
|
*
|
|
261
261
|
* Configuration 4: (m, o, m, o, r, r, r, m) a complex case to understand subtleties
|
|
262
262
|
*
|
|
263
|
-
* | |
|
|
264
|
-
*
|
|
265
|
-
* | m | 0 | 0 | 0 | 0
|
|
266
|
-
* | o | | 1 | 1 |
|
|
267
|
-
* | m | 1 | 2 | 2 | 1
|
|
268
|
-
* | o | | | 3 |
|
|
269
|
-
* | r |
|
|
270
|
-
* | r |
|
|
271
|
-
* | r |
|
|
272
|
-
* | m |
|
|
263
|
+
* | | 6 | 7 | 8 | 9 | 10 | 11 | ... |
|
|
264
|
+
* |---|---|---|---|------|------|------|-----|
|
|
265
|
+
* | m | 0 | 0 | 0 | 0 | 0 | 0 | ... |
|
|
266
|
+
* | o | | 1 | 1 | | 1 | 1 | ... |
|
|
267
|
+
* | m | 1 | 2 | 2 | 1 | 2 | 2 | ... |
|
|
268
|
+
* | o | | | 3 | | | 3 | ... |
|
|
269
|
+
* | r | 2 | 3 | 4 | 2, 5 | 3, 6 | 4, 7 | ... |
|
|
270
|
+
* | r | 3 | 4 | 5 | 3, 6 | 4, 7 | 5, 8 | ... |
|
|
271
|
+
* | r | 4 | 5 | 6 | 4, 7 | 5, 8 | 6, 9 | ... |
|
|
272
|
+
* | m | 5 | 6 | 7 | 8 | 9 | 10 | ... |
|
|
273
273
|
*
|
|
274
274
|
*/
|
|
275
275
|
function argTargeting(functionDescription, nbrArgSupplied) {
|
|
@@ -288,30 +288,31 @@
|
|
|
288
288
|
}
|
|
289
289
|
function _argTargeting(functionDescription, nbrArgSupplied) {
|
|
290
290
|
const valueIndexToArgPosition = {};
|
|
291
|
-
const
|
|
291
|
+
const groupsOfOptionalRepeatingValues = functionDescription.nbrArgRepeating
|
|
292
292
|
? Math.floor((nbrArgSupplied - functionDescription.minArgRequired) / functionDescription.nbrArgRepeating)
|
|
293
293
|
: 0;
|
|
294
|
-
const
|
|
295
|
-
const nbrValueOptional = nbrArgSupplied - functionDescription.minArgRequired -
|
|
294
|
+
const nbrValueOptionalRepeating = functionDescription.nbrArgRepeating * groupsOfOptionalRepeatingValues;
|
|
295
|
+
const nbrValueOptional = nbrArgSupplied - functionDescription.minArgRequired - nbrValueOptionalRepeating;
|
|
296
296
|
let countValueSupplied = 0;
|
|
297
297
|
let countValueOptional = 0;
|
|
298
298
|
for (let i = 0; i < functionDescription.args.length; i++) {
|
|
299
299
|
const arg = functionDescription.args[i];
|
|
300
|
-
if (arg.optional || arg.default) {
|
|
300
|
+
if ((arg.optional || arg.default) && !arg.repeating) {
|
|
301
301
|
if (countValueOptional < nbrValueOptional) {
|
|
302
|
-
valueIndexToArgPosition[countValueSupplied] = i;
|
|
302
|
+
valueIndexToArgPosition[countValueSupplied] = { index: i };
|
|
303
303
|
countValueSupplied++;
|
|
304
304
|
}
|
|
305
305
|
countValueOptional++;
|
|
306
306
|
continue;
|
|
307
307
|
}
|
|
308
308
|
if (arg.repeating) {
|
|
309
|
+
const groupOfMandatoryRepeatingValues = arg.optional ? 0 : 1;
|
|
309
310
|
// As we know all repeating arguments are consecutive,
|
|
310
311
|
// --> we will treat all repeating arguments in one go
|
|
311
312
|
// --> the index i will be incremented by the number of repeating values at the end of the loop
|
|
312
|
-
for (let j = 0; j <
|
|
313
|
+
for (let j = 0; j < groupsOfOptionalRepeatingValues + groupOfMandatoryRepeatingValues; j++) {
|
|
313
314
|
for (let k = 0; k < functionDescription.nbrArgRepeating; k++) {
|
|
314
|
-
valueIndexToArgPosition[countValueSupplied] = i + k;
|
|
315
|
+
valueIndexToArgPosition[countValueSupplied] = { index: i + k, repeatingGroupIndex: j };
|
|
315
316
|
countValueSupplied++;
|
|
316
317
|
}
|
|
317
318
|
}
|
|
@@ -319,7 +320,7 @@
|
|
|
319
320
|
continue;
|
|
320
321
|
}
|
|
321
322
|
// End case: it's a required argument
|
|
322
|
-
valueIndexToArgPosition[countValueSupplied] = i;
|
|
323
|
+
valueIndexToArgPosition[countValueSupplied] = { index: i };
|
|
323
324
|
countValueSupplied++;
|
|
324
325
|
}
|
|
325
326
|
return (argPosition) => {
|
|
@@ -331,7 +332,7 @@
|
|
|
331
332
|
//------------------------------------------------------------------------------
|
|
332
333
|
const META_TYPES = ["META", "RANGE<META>"];
|
|
333
334
|
function validateArguments(descr) {
|
|
334
|
-
if (descr.nbrArgRepeating && descr.
|
|
335
|
+
if (descr.nbrArgRepeating && descr.nbrOptionalNonRepeatingArgs >= descr.nbrArgRepeating) {
|
|
335
336
|
throw new Error(`Function ${descr.name} has more optional arguments than repeatable ones.`);
|
|
336
337
|
}
|
|
337
338
|
let foundRepeating = false;
|
|
@@ -615,6 +616,7 @@
|
|
|
615
616
|
];
|
|
616
617
|
const DEFAULT_CELL_WIDTH = 96;
|
|
617
618
|
const DEFAULT_CELL_HEIGHT = 23;
|
|
619
|
+
const SCROLLBAR_WIDTH = 15;
|
|
618
620
|
const MIN_CF_ICON_MARGIN = 4;
|
|
619
621
|
const MIN_CELL_TEXT_MARGIN = 4;
|
|
620
622
|
const PADDING_AUTORESIZE_VERTICAL = 3;
|
|
@@ -2857,7 +2859,7 @@
|
|
|
2857
2859
|
const getArgToFocus = argTargeting(descr, args.length);
|
|
2858
2860
|
//#region Compute vectorisation limits
|
|
2859
2861
|
for (let i = 0; i < args.length; i++) {
|
|
2860
|
-
const argIndex = getArgToFocus(i) ?? -1;
|
|
2862
|
+
const argIndex = getArgToFocus(i).index ?? -1;
|
|
2861
2863
|
const argDefinition = descr.args[argIndex];
|
|
2862
2864
|
const arg = args[i];
|
|
2863
2865
|
if (!isMatrix(arg) && argDefinition.acceptMatrixOnly) {
|
|
@@ -2871,7 +2873,7 @@
|
|
|
2871
2873
|
for (let i = 0; i < args.length; i++) {
|
|
2872
2874
|
const arg = args[i];
|
|
2873
2875
|
const getArgToFocus = argTargeting(descr, args.length);
|
|
2874
|
-
const argDefinition = descr.args[getArgToFocus(i)
|
|
2876
|
+
const argDefinition = descr.args[getArgToFocus(i).index ?? i];
|
|
2875
2877
|
// Early exit if the argument is an error and the function does not accept errors
|
|
2876
2878
|
// We only check scalar arguments, not matrix arguments for performance reasons.
|
|
2877
2879
|
// Casting helpers are responsible for handling errors in matrix arguments.
|
|
@@ -3139,8 +3141,7 @@
|
|
|
3139
3141
|
description: _t("Creates a new array from the selected columns in the existing range."),
|
|
3140
3142
|
args: [
|
|
3141
3143
|
arg("array (any, range<any>)", _t("The array that contains the columns to be returned.")),
|
|
3142
|
-
arg("col_num (number, range<number
|
|
3143
|
-
arg("col_num2 (number, range<number>, repeating)", _t("The columns indexes of the columns to be returned.")),
|
|
3144
|
+
arg("col_num (number, range<number>, repeating)", _t("The column index of the column to be returned.")),
|
|
3144
3145
|
],
|
|
3145
3146
|
compute: function (array, ...columns) {
|
|
3146
3147
|
const _array = toMatrix(array);
|
|
@@ -3169,8 +3170,7 @@
|
|
|
3169
3170
|
description: _t("Creates a new array from the selected rows in the existing range."),
|
|
3170
3171
|
args: [
|
|
3171
3172
|
arg("array (any, range<any>)", _t("The array that contains the rows to be returned.")),
|
|
3172
|
-
arg("row_num (number, range<number
|
|
3173
|
-
arg("row_num2 (number, range<number>, repeating)", _t("The rows indexes of the rows to be returned.")),
|
|
3173
|
+
arg("row_num (number, range<number>, repeating)", _t("The row index of the row to be returned.")),
|
|
3174
3174
|
],
|
|
3175
3175
|
compute: function (array, ...rows) {
|
|
3176
3176
|
const _array = toMatrix(array);
|
|
@@ -3220,10 +3220,7 @@
|
|
|
3220
3220
|
// -----------------------------------------------------------------------------
|
|
3221
3221
|
const FLATTEN = {
|
|
3222
3222
|
description: _t("Flattens all the values from one or more ranges into a single column."),
|
|
3223
|
-
args: [
|
|
3224
|
-
arg("range (any, range<any>)", _t("The first range to flatten.")),
|
|
3225
|
-
arg("range2 (any, range<any>, repeating)", _t("Additional ranges to flatten.")),
|
|
3226
|
-
],
|
|
3223
|
+
args: [arg("range (any, range<any>, repeating)", _t("The range to flatten."))],
|
|
3227
3224
|
compute: function (...ranges) {
|
|
3228
3225
|
return [flattenRowFirst(ranges, (val) => (val === undefined ? { value: "" } : val))];
|
|
3229
3226
|
},
|
|
@@ -3281,10 +3278,7 @@
|
|
|
3281
3278
|
// -----------------------------------------------------------------------------
|
|
3282
3279
|
const HSTACK = {
|
|
3283
3280
|
description: _t("Appends ranges horizontally and in sequence to return a larger array."),
|
|
3284
|
-
args: [
|
|
3285
|
-
arg("range1 (any, range<any>)", _t("The first range to be appended.")),
|
|
3286
|
-
arg("range2 (any, range<any>, repeating)", _t("Additional ranges to add to range1.")),
|
|
3287
|
-
],
|
|
3281
|
+
args: [arg("range (any, range<any>, repeating)", _t("The range to be appended."))],
|
|
3288
3282
|
compute: function (...ranges) {
|
|
3289
3283
|
const nbRows = Math.max(...ranges.map((r) => r?.[0]?.length ?? 0));
|
|
3290
3284
|
const result = [];
|
|
@@ -3370,8 +3364,7 @@
|
|
|
3370
3364
|
const SUMPRODUCT = {
|
|
3371
3365
|
description: _t("Calculates the sum of the products of corresponding entries in equal-sized ranges."),
|
|
3372
3366
|
args: [
|
|
3373
|
-
arg("
|
|
3374
|
-
arg("range2 (number, range<number>, repeating)", _t("The other range whose entries will be multiplied with corresponding entries in the other ranges.")),
|
|
3367
|
+
arg("range (number, range<number>, repeating)", _t("The range whose entries will be multiplied with corresponding entries in the other range.")),
|
|
3375
3368
|
],
|
|
3376
3369
|
compute: function (...args) {
|
|
3377
3370
|
if (!areSameDimensions(...args)) {
|
|
@@ -3557,10 +3550,7 @@
|
|
|
3557
3550
|
// -----------------------------------------------------------------------------
|
|
3558
3551
|
const VSTACK = {
|
|
3559
3552
|
description: _t("Appends ranges vertically and in sequence to return a larger array."),
|
|
3560
|
-
args: [
|
|
3561
|
-
arg("range1 (any, range<any>)", _t("The first range to be appended.")),
|
|
3562
|
-
arg("range2 (any, range<any>, repeating)", _t("Additional ranges to add to range1.")),
|
|
3563
|
-
],
|
|
3553
|
+
args: [arg("range (any, range<any>, repeating)", _t("The range to be appended."))],
|
|
3564
3554
|
compute: function (...ranges) {
|
|
3565
3555
|
const nbColumns = Math.max(...ranges.map((range) => toMatrix(range).length));
|
|
3566
3556
|
const nbRows = ranges.reduce((acc, range) => acc + toMatrix(range)[0].length, 0);
|
|
@@ -5775,7 +5765,10 @@
|
|
|
5775
5765
|
* Check if a zone is inside another
|
|
5776
5766
|
*/
|
|
5777
5767
|
function isZoneInside(smallZone, biggerZone) {
|
|
5778
|
-
return
|
|
5768
|
+
return (smallZone.left >= biggerZone.left &&
|
|
5769
|
+
smallZone.right <= biggerZone.right &&
|
|
5770
|
+
smallZone.top >= biggerZone.top &&
|
|
5771
|
+
smallZone.bottom <= biggerZone.bottom);
|
|
5779
5772
|
}
|
|
5780
5773
|
function zoneToDimension(zone) {
|
|
5781
5774
|
return {
|
|
@@ -6155,6 +6148,7 @@
|
|
|
6155
6148
|
"COPY",
|
|
6156
6149
|
"RESIZE_SHEETVIEW",
|
|
6157
6150
|
"SET_VIEWPORT_OFFSET",
|
|
6151
|
+
"SET_ZOOM",
|
|
6158
6152
|
"EVALUATE_CELLS",
|
|
6159
6153
|
"EVALUATE_CHARTS",
|
|
6160
6154
|
"SET_FORMULA_VISIBILITY",
|
|
@@ -6870,8 +6864,7 @@
|
|
|
6870
6864
|
const COUNTBLANK = {
|
|
6871
6865
|
description: _t("Number of empty values."),
|
|
6872
6866
|
args: [
|
|
6873
|
-
arg("
|
|
6874
|
-
arg("value2 (any, range, repeating)", _t("Additional values or ranges in which to count the number of blanks.")),
|
|
6867
|
+
arg("value (any, range, repeating)", _t("Value or range in which to count the number of blanks.")),
|
|
6875
6868
|
],
|
|
6876
6869
|
compute: function (...args) {
|
|
6877
6870
|
return reduceAny(args, (acc, a) => {
|
|
@@ -6913,10 +6906,8 @@
|
|
|
6913
6906
|
const COUNTIFS = {
|
|
6914
6907
|
description: _t("Count values depending on multiple criteria."),
|
|
6915
6908
|
args: [
|
|
6916
|
-
arg("
|
|
6917
|
-
arg("
|
|
6918
|
-
arg("criteria_range2 (any, range, repeating)", _t("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),
|
|
6919
|
-
arg("criterion2 (string, repeating)", _t("Additional criteria to check.")),
|
|
6909
|
+
arg("criteria_range (any, range, repeating)", _t("Range over which to evaluate criteria.")),
|
|
6910
|
+
arg("criterion (string, repeating)", _t("Criteria to check.")),
|
|
6920
6911
|
],
|
|
6921
6912
|
compute: function (...args) {
|
|
6922
6913
|
let count = 0;
|
|
@@ -6932,10 +6923,7 @@
|
|
|
6932
6923
|
// -----------------------------------------------------------------------------
|
|
6933
6924
|
const COUNTUNIQUE = {
|
|
6934
6925
|
description: _t("Counts number of unique values in a range."),
|
|
6935
|
-
args: [
|
|
6936
|
-
arg("value1 (any, range)", _t("The first value or range to consider for uniqueness.")),
|
|
6937
|
-
arg("value2 (any, range, repeating)", _t("Additional values or ranges to consider for uniqueness.")),
|
|
6938
|
-
],
|
|
6926
|
+
args: [arg("value (any, range, repeating)", _t("Value or range to consider for uniqueness."))],
|
|
6939
6927
|
compute: function (...args) {
|
|
6940
6928
|
return countUnique(args);
|
|
6941
6929
|
},
|
|
@@ -6947,10 +6935,8 @@
|
|
|
6947
6935
|
description: _t("Counts number of unique values in a range, filtered by a set of criteria."),
|
|
6948
6936
|
args: [
|
|
6949
6937
|
arg("range (range)", _t("The range of cells from which the number of unique values will be counted.")),
|
|
6950
|
-
arg("
|
|
6951
|
-
arg("
|
|
6952
|
-
arg("criteria_range2 (any, range, repeating)", _t("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),
|
|
6953
|
-
arg("criterion2 (string, repeating)", _t("The pattern or test to apply to criteria_range2.")),
|
|
6938
|
+
arg("criteria_range (any, range, repeating)", _t("Range over which to evaluate criteria.")),
|
|
6939
|
+
arg("criterion (string, repeating)", _t("Criteria to check.")),
|
|
6954
6940
|
],
|
|
6955
6941
|
compute: function (range, ...args) {
|
|
6956
6942
|
const uniqueValues = new Set();
|
|
@@ -7306,8 +7292,7 @@
|
|
|
7306
7292
|
const PRODUCT = {
|
|
7307
7293
|
description: _t("Result of multiplying a series of numbers together."),
|
|
7308
7294
|
args: [
|
|
7309
|
-
arg("
|
|
7310
|
-
arg("factor2 (number, range<number>, repeating)", _t("More numbers or ranges to calculate for the product.")),
|
|
7295
|
+
arg("factor (number, range<number>, repeating)", _t("Number or range to calculate for the product.")),
|
|
7311
7296
|
],
|
|
7312
7297
|
compute: function (...factors) {
|
|
7313
7298
|
let count = 0;
|
|
@@ -7639,8 +7624,7 @@
|
|
|
7639
7624
|
...subtotalFunctionOptionsIncludeHiddenRows,
|
|
7640
7625
|
...subtotalFunctionOptionsExcludeHiddenRows,
|
|
7641
7626
|
]),
|
|
7642
|
-
arg("
|
|
7643
|
-
arg("ref2 (meta, range<meta>, repeating)", _t("Additional ranges or references for which you want the subtotal.")),
|
|
7627
|
+
arg("ref (meta, range<meta>, repeating)", _t("Range or reference for which you want the subtotal.")),
|
|
7644
7628
|
],
|
|
7645
7629
|
compute: function (functionCode, ...refs) {
|
|
7646
7630
|
let code = toInteger(functionCode, this.locale);
|
|
@@ -7684,10 +7668,7 @@
|
|
|
7684
7668
|
// -----------------------------------------------------------------------------
|
|
7685
7669
|
const SUM = {
|
|
7686
7670
|
description: _t("Sum of a series of numbers and/or cells."),
|
|
7687
|
-
args: [
|
|
7688
|
-
arg("value1 (number, range<number>)", _t("The first number or range to add together.")),
|
|
7689
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional numbers or ranges to add to value1.")),
|
|
7690
|
-
],
|
|
7671
|
+
args: [arg("value (number, range<number>, repeating)", _t("Number or range to add together."))],
|
|
7691
7672
|
compute: function (...values) {
|
|
7692
7673
|
const v1 = values[0];
|
|
7693
7674
|
return {
|
|
@@ -7729,10 +7710,8 @@
|
|
|
7729
7710
|
description: _t("Sums a range depending on multiple criteria."),
|
|
7730
7711
|
args: [
|
|
7731
7712
|
arg("sum_range (range)", _t("The range to sum.")),
|
|
7732
|
-
arg("
|
|
7733
|
-
arg("
|
|
7734
|
-
arg("criteria_range2 (any, range, repeating)", _t("Additional ranges to check.")),
|
|
7735
|
-
arg("criterion2 (string, repeating)", _t("Additional criteria to check.")),
|
|
7713
|
+
arg("criteria_range (any, range, repeating)", _t("Range to check.")),
|
|
7714
|
+
arg("criterion (string, repeating)", _t("Criteria to check.")),
|
|
7736
7715
|
],
|
|
7737
7716
|
compute: function (sumRange, ...criters) {
|
|
7738
7717
|
let sum = 0;
|
|
@@ -8199,8 +8178,7 @@
|
|
|
8199
8178
|
const AVEDEV = {
|
|
8200
8179
|
description: _t("Average magnitude of deviations from mean."),
|
|
8201
8180
|
args: [
|
|
8202
|
-
arg("
|
|
8203
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the sample.")),
|
|
8181
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the sample.")),
|
|
8204
8182
|
],
|
|
8205
8183
|
compute: function (...values) {
|
|
8206
8184
|
let count = 0;
|
|
@@ -8222,8 +8200,7 @@
|
|
|
8222
8200
|
const AVERAGE = {
|
|
8223
8201
|
description: _t("Numerical average value in a dataset, ignoring text."),
|
|
8224
8202
|
args: [
|
|
8225
|
-
arg("
|
|
8226
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to consider when calculating the average value.")),
|
|
8203
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to consider when calculating the average value.")),
|
|
8227
8204
|
],
|
|
8228
8205
|
compute: function (...values) {
|
|
8229
8206
|
return {
|
|
@@ -8241,10 +8218,8 @@
|
|
|
8241
8218
|
const AVERAGE_WEIGHTED = {
|
|
8242
8219
|
description: _t("Weighted average."),
|
|
8243
8220
|
args: [
|
|
8244
|
-
arg("values (number, range<number
|
|
8245
|
-
arg("weights (number, range<number
|
|
8246
|
-
arg("additional_values (number, range<number>, repeating)", _t("Additional values to average.")),
|
|
8247
|
-
arg("additional_weights (number, range<number>, repeating)", _t("Additional weights.")),
|
|
8221
|
+
arg("values (number, range<number>, repeating)", _t("Value to average.")),
|
|
8222
|
+
arg("weights (number, range<number>, repeating)", _t("Weight for each corresponding value.")),
|
|
8248
8223
|
],
|
|
8249
8224
|
compute: function (...args) {
|
|
8250
8225
|
let sum = 0;
|
|
@@ -8300,8 +8275,7 @@
|
|
|
8300
8275
|
const AVERAGEA = {
|
|
8301
8276
|
description: _t("Numerical average value in a dataset."),
|
|
8302
8277
|
args: [
|
|
8303
|
-
arg("
|
|
8304
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to consider when calculating the average value.")),
|
|
8278
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to consider when calculating the average value.")),
|
|
8305
8279
|
],
|
|
8306
8280
|
compute: function (...args) {
|
|
8307
8281
|
let count = 0;
|
|
@@ -8354,10 +8328,8 @@
|
|
|
8354
8328
|
description: _t("Average of values depending on multiple criteria."),
|
|
8355
8329
|
args: [
|
|
8356
8330
|
arg("average_range (range)", _t("The range to average.")),
|
|
8357
|
-
arg("
|
|
8358
|
-
arg("
|
|
8359
|
-
arg("criteria_range2 (any, range, repeating)", _t("Additional criteria_range and criterion to check.")),
|
|
8360
|
-
arg("criterion2 (string, repeating)", _t("The pattern or test to apply to criteria_range2.")),
|
|
8331
|
+
arg("criteria_range (any, range, repeating)", _t("Range to check.")),
|
|
8332
|
+
arg("criterion (string, repeating)", _t("Criterion to check.")),
|
|
8361
8333
|
],
|
|
8362
8334
|
compute: function (averageRange, ...args) {
|
|
8363
8335
|
const _averageRange = toMatrix(averageRange);
|
|
@@ -8383,8 +8355,7 @@
|
|
|
8383
8355
|
const COUNT = {
|
|
8384
8356
|
description: _t("The number of numeric values in dataset."),
|
|
8385
8357
|
args: [
|
|
8386
|
-
arg("
|
|
8387
|
-
arg("value2 (number, any, range<number>, repeating)", _t("Additional values or ranges to consider when counting.")),
|
|
8358
|
+
arg("value (number, any, range<number>, repeating)", _t("Value or range to consider when counting.")),
|
|
8388
8359
|
],
|
|
8389
8360
|
compute: function (...values) {
|
|
8390
8361
|
return countNumbers(values, this.locale);
|
|
@@ -8396,10 +8367,7 @@
|
|
|
8396
8367
|
// -----------------------------------------------------------------------------
|
|
8397
8368
|
const COUNTA = {
|
|
8398
8369
|
description: _t("The number of values in a dataset."),
|
|
8399
|
-
args: [
|
|
8400
|
-
arg("value1 (any, range)", _t("The first value or range to consider when counting.")),
|
|
8401
|
-
arg("value2 (any, range, repeating)", _t("Additional values or ranges to consider when counting.")),
|
|
8402
|
-
],
|
|
8370
|
+
args: [arg("value (any, range, repeating)", _t("Value or range to consider when counting."))],
|
|
8403
8371
|
compute: function (...values) {
|
|
8404
8372
|
return countAny(values);
|
|
8405
8373
|
},
|
|
@@ -8632,8 +8600,7 @@
|
|
|
8632
8600
|
const MAX = {
|
|
8633
8601
|
description: _t("Maximum value in a numeric dataset."),
|
|
8634
8602
|
args: [
|
|
8635
|
-
arg("
|
|
8636
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to consider when calculating the maximum value.")),
|
|
8603
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to consider when calculating the maximum value.")),
|
|
8637
8604
|
],
|
|
8638
8605
|
compute: function (...values) {
|
|
8639
8606
|
return max(values, this.locale);
|
|
@@ -8646,8 +8613,7 @@
|
|
|
8646
8613
|
const MAXA = {
|
|
8647
8614
|
description: _t("Maximum numeric value in a dataset."),
|
|
8648
8615
|
args: [
|
|
8649
|
-
arg("
|
|
8650
|
-
arg("value2 (any, range, repeating)", _t("Additional values or ranges to consider when calculating the maximum value.")),
|
|
8616
|
+
arg("value (any, range, repeating)", _t("Value or range to consider when calculating the maximum value.")),
|
|
8651
8617
|
],
|
|
8652
8618
|
compute: function (...args) {
|
|
8653
8619
|
const maxa = reduceNumbersTextAs0(args, (acc, a) => {
|
|
@@ -8664,10 +8630,8 @@
|
|
|
8664
8630
|
description: _t("Returns the maximum value in a range of cells, filtered by a set of criteria."),
|
|
8665
8631
|
args: [
|
|
8666
8632
|
arg("range (range)", _t("The range of cells from which the maximum will be determined.")),
|
|
8667
|
-
arg("
|
|
8668
|
-
arg("
|
|
8669
|
-
arg("criteria_range2 (any, range, repeating)", _t("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),
|
|
8670
|
-
arg("criterion2 (string, repeating)", _t("The pattern or test to apply to criteria_range2.")),
|
|
8633
|
+
arg("criteria_range (any, range, repeating)", _t("Range to evaluate criteria.")),
|
|
8634
|
+
arg("criterion (string, repeating)", _t("Criteria to check.")),
|
|
8671
8635
|
],
|
|
8672
8636
|
compute: function (range, ...args) {
|
|
8673
8637
|
let result = -Infinity;
|
|
@@ -8687,8 +8651,7 @@
|
|
|
8687
8651
|
const MEDIAN = {
|
|
8688
8652
|
description: _t("Median value in a numeric dataset."),
|
|
8689
8653
|
args: [
|
|
8690
|
-
arg("
|
|
8691
|
-
arg("value2 (any, range, repeating)", _t("Additional values or ranges to consider when calculating the median value.")),
|
|
8654
|
+
arg("value (any, range, repeating)", _t("Value or range to consider when calculating the median value.")),
|
|
8692
8655
|
],
|
|
8693
8656
|
compute: function (...values) {
|
|
8694
8657
|
const data = [];
|
|
@@ -8708,8 +8671,7 @@
|
|
|
8708
8671
|
const MIN = {
|
|
8709
8672
|
description: _t("Minimum value in a numeric dataset."),
|
|
8710
8673
|
args: [
|
|
8711
|
-
arg("
|
|
8712
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to consider when calculating the minimum value.")),
|
|
8674
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to consider when calculating the minimum value.")),
|
|
8713
8675
|
],
|
|
8714
8676
|
compute: function (...values) {
|
|
8715
8677
|
return min(values, this.locale);
|
|
@@ -8722,8 +8684,7 @@
|
|
|
8722
8684
|
const MINA = {
|
|
8723
8685
|
description: _t("Minimum numeric value in a dataset."),
|
|
8724
8686
|
args: [
|
|
8725
|
-
arg("
|
|
8726
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to consider when calculating the minimum value.")),
|
|
8687
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to consider when calculating the minimum value.")),
|
|
8727
8688
|
],
|
|
8728
8689
|
compute: function (...args) {
|
|
8729
8690
|
const mina = reduceNumbersTextAs0(args, (acc, a) => {
|
|
@@ -8740,10 +8701,8 @@
|
|
|
8740
8701
|
description: _t("Returns the minimum value in a range of cells, filtered by a set of criteria."),
|
|
8741
8702
|
args: [
|
|
8742
8703
|
arg("range (range)", _t("The range of cells from which the minimum will be determined.")),
|
|
8743
|
-
arg("
|
|
8744
|
-
arg("
|
|
8745
|
-
arg("criteria_range2 (any, range, repeating)", _t("Additional ranges over which to evaluate the additional criteria. The filtered set will be the intersection of the sets produced by each criterion-range pair.")),
|
|
8746
|
-
arg("criterion2 (string, repeating)", _t("The pattern or test to apply to criteria_range2.")),
|
|
8704
|
+
arg("criteria_range (any, range, repeating)", _t("Range to evaluate criteria.")),
|
|
8705
|
+
arg("criterion (string, repeating)", _t("Criterion to check.")),
|
|
8747
8706
|
],
|
|
8748
8707
|
compute: function (range, ...args) {
|
|
8749
8708
|
let result = Infinity;
|
|
@@ -9084,8 +9043,7 @@
|
|
|
9084
9043
|
const STDEV = {
|
|
9085
9044
|
description: _t("Standard deviation."),
|
|
9086
9045
|
args: [
|
|
9087
|
-
arg("
|
|
9088
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the sample.")),
|
|
9046
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the sample.")),
|
|
9089
9047
|
],
|
|
9090
9048
|
compute: function (...args) {
|
|
9091
9049
|
return Math.sqrt(VAR.compute.bind(this)(...args));
|
|
@@ -9098,8 +9056,7 @@
|
|
|
9098
9056
|
const STDEV_P = {
|
|
9099
9057
|
description: _t("Standard deviation of entire population."),
|
|
9100
9058
|
args: [
|
|
9101
|
-
arg("
|
|
9102
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the population.")),
|
|
9059
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the population.")),
|
|
9103
9060
|
],
|
|
9104
9061
|
compute: function (...args) {
|
|
9105
9062
|
return Math.sqrt(VAR_P.compute.bind(this)(...args));
|
|
@@ -9112,8 +9069,7 @@
|
|
|
9112
9069
|
const STDEV_S = {
|
|
9113
9070
|
description: _t("Standard deviation."),
|
|
9114
9071
|
args: [
|
|
9115
|
-
arg("
|
|
9116
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the sample.")),
|
|
9072
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the sample.")),
|
|
9117
9073
|
],
|
|
9118
9074
|
compute: function (...args) {
|
|
9119
9075
|
return Math.sqrt(VAR_S.compute.bind(this)(...args));
|
|
@@ -9126,8 +9082,7 @@
|
|
|
9126
9082
|
const STDEVA = {
|
|
9127
9083
|
description: _t("Standard deviation of sample (text as 0)."),
|
|
9128
9084
|
args: [
|
|
9129
|
-
arg("
|
|
9130
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the sample.")),
|
|
9085
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the sample.")),
|
|
9131
9086
|
],
|
|
9132
9087
|
compute: function (...args) {
|
|
9133
9088
|
return Math.sqrt(VARA.compute.bind(this)(...args));
|
|
@@ -9140,8 +9095,7 @@
|
|
|
9140
9095
|
const STDEVP = {
|
|
9141
9096
|
description: _t("Standard deviation of entire population."),
|
|
9142
9097
|
args: [
|
|
9143
|
-
arg("
|
|
9144
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the population.")),
|
|
9098
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the population.")),
|
|
9145
9099
|
],
|
|
9146
9100
|
compute: function (...args) {
|
|
9147
9101
|
return Math.sqrt(VARP.compute.bind(this)(...args));
|
|
@@ -9154,8 +9108,7 @@
|
|
|
9154
9108
|
const STDEVPA = {
|
|
9155
9109
|
description: _t("Standard deviation of entire population (text as 0)."),
|
|
9156
9110
|
args: [
|
|
9157
|
-
arg("
|
|
9158
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the population.")),
|
|
9111
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the population.")),
|
|
9159
9112
|
],
|
|
9160
9113
|
compute: function (...args) {
|
|
9161
9114
|
return Math.sqrt(VARPA.compute.bind(this)(...args));
|
|
@@ -9205,8 +9158,7 @@
|
|
|
9205
9158
|
const VAR = {
|
|
9206
9159
|
description: _t("Variance."),
|
|
9207
9160
|
args: [
|
|
9208
|
-
arg("
|
|
9209
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the sample.")),
|
|
9161
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the sample.")),
|
|
9210
9162
|
],
|
|
9211
9163
|
compute: function (...args) {
|
|
9212
9164
|
return variance(args, true, false, this.locale);
|
|
@@ -9219,8 +9171,7 @@
|
|
|
9219
9171
|
const VAR_P = {
|
|
9220
9172
|
description: _t("Variance of entire population."),
|
|
9221
9173
|
args: [
|
|
9222
|
-
arg("
|
|
9223
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the population.")),
|
|
9174
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the population.")),
|
|
9224
9175
|
],
|
|
9225
9176
|
compute: function (...args) {
|
|
9226
9177
|
return variance(args, false, false, this.locale);
|
|
@@ -9233,8 +9184,7 @@
|
|
|
9233
9184
|
const VAR_S = {
|
|
9234
9185
|
description: _t("Variance."),
|
|
9235
9186
|
args: [
|
|
9236
|
-
arg("
|
|
9237
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the sample.")),
|
|
9187
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the sample.")),
|
|
9238
9188
|
],
|
|
9239
9189
|
compute: function (...args) {
|
|
9240
9190
|
return variance(args, true, false, this.locale);
|
|
@@ -9247,8 +9197,7 @@
|
|
|
9247
9197
|
const VARA = {
|
|
9248
9198
|
description: _t("Variance of sample (text as 0)."),
|
|
9249
9199
|
args: [
|
|
9250
|
-
arg("
|
|
9251
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the sample.")),
|
|
9200
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the sample.")),
|
|
9252
9201
|
],
|
|
9253
9202
|
compute: function (...args) {
|
|
9254
9203
|
return variance(args, true, true, this.locale);
|
|
@@ -9261,8 +9210,7 @@
|
|
|
9261
9210
|
const VARP = {
|
|
9262
9211
|
description: _t("Variance of entire population."),
|
|
9263
9212
|
args: [
|
|
9264
|
-
arg("
|
|
9265
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the population.")),
|
|
9213
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the population.")),
|
|
9266
9214
|
],
|
|
9267
9215
|
compute: function (...args) {
|
|
9268
9216
|
return variance(args, false, false, this.locale);
|
|
@@ -9275,8 +9223,7 @@
|
|
|
9275
9223
|
const VARPA = {
|
|
9276
9224
|
description: _t("Variance of entire population (text as 0)."),
|
|
9277
9225
|
args: [
|
|
9278
|
-
arg("
|
|
9279
|
-
arg("value2 (number, range<number>, repeating)", _t("Additional values or ranges to include in the population.")),
|
|
9226
|
+
arg("value (number, range<number>, repeating)", _t("Value or range to include in the population.")),
|
|
9280
9227
|
],
|
|
9281
9228
|
compute: function (...args) {
|
|
9282
9229
|
return variance(args, false, true, this.locale);
|
|
@@ -11079,8 +11026,7 @@
|
|
|
11079
11026
|
// TODO modify args description when vectorization on formulas is available
|
|
11080
11027
|
args: [
|
|
11081
11028
|
arg("range (any, range<any>)", _t("The data to be filtered.")),
|
|
11082
|
-
arg("
|
|
11083
|
-
arg("condition2 (boolean, range<boolean>, repeating)", _t("Additional column or row containing true or false values.")),
|
|
11029
|
+
arg("condition (boolean, range<boolean>, repeating)", _t("Column or row containing true or false values corresponding to the range.")),
|
|
11084
11030
|
],
|
|
11085
11031
|
compute: function (range, ...conditions) {
|
|
11086
11032
|
let _array = toMatrix(range);
|
|
@@ -11120,8 +11066,8 @@
|
|
|
11120
11066
|
description: _t("Sorts the rows of a given array or range by the values in one or more columns."),
|
|
11121
11067
|
args: [
|
|
11122
11068
|
arg("range (range)", _t("The data to be sorted.")),
|
|
11123
|
-
arg("sort_column (any, range<number>, repeating)", _t("The index of the column in range or a range outside of range containing the
|
|
11124
|
-
arg("is_ascending (boolean, repeating)", _t("TRUE or FALSE indicating whether to sort sort_column in ascending order."), [
|
|
11069
|
+
arg("sort_column (any, range<number>, repeating, optional)", _t("The index of the column in range or a range outside of range containing the value by which to sort.")),
|
|
11070
|
+
arg("is_ascending (boolean, repeating, optional)", _t("TRUE or FALSE indicating whether to sort sort_column in ascending order. FALSE sorts in descending order."), [
|
|
11125
11071
|
{ value: true, label: _t("Ascending") },
|
|
11126
11072
|
{ value: false, label: _t("Descending") },
|
|
11127
11073
|
]),
|
|
@@ -11141,8 +11087,8 @@
|
|
|
11141
11087
|
arg("range (range)", _t("The data to be sorted.")),
|
|
11142
11088
|
arg("n (number)", _t("The number of items to return.")),
|
|
11143
11089
|
arg("display_ties_mode (number, default=0)", _t("A number representing the way to display ties.")),
|
|
11144
|
-
arg("sort_column (number, range<number>, repeating)", _t("The index of the column in range or a range outside of range containing the
|
|
11145
|
-
arg("is_ascending (boolean, repeating)", _t("TRUE or FALSE indicating whether to sort sort_column in ascending order."), [
|
|
11090
|
+
arg("sort_column (number, range<number>, repeating, optional)", _t("The index of the column in range or a range outside of range containing the value by which to sort.")),
|
|
11091
|
+
arg("is_ascending (boolean, repeating, optional)", _t("TRUE or FALSE indicating whether to sort sort_column in ascending order. FALSE sorts in descending order."), [
|
|
11146
11092
|
{ value: true, label: _t("Ascending") },
|
|
11147
11093
|
{ value: false, label: _t("Descending") },
|
|
11148
11094
|
]),
|
|
@@ -12410,8 +12356,7 @@
|
|
|
12410
12356
|
description: _t("The net present value of an investment based on a series of periodic cash flows and a discount rate."),
|
|
12411
12357
|
args: [
|
|
12412
12358
|
arg("discount (number)", _t("The discount rate of the investment over one period.")),
|
|
12413
|
-
arg("
|
|
12414
|
-
arg("cashflow2 (number, range<number>, repeating)", _t("Additional future cash flows.")),
|
|
12359
|
+
arg("cashflow (number, range<number>, repeating)", _t("The future cash flows.")),
|
|
12415
12360
|
],
|
|
12416
12361
|
// to do: replace by dollar format
|
|
12417
12362
|
compute: function (discount, ...values) {
|
|
@@ -13766,8 +13711,7 @@
|
|
|
13766
13711
|
const AND = {
|
|
13767
13712
|
description: _t("Logical `and` operator."),
|
|
13768
13713
|
args: [
|
|
13769
|
-
arg("
|
|
13770
|
-
arg("logical_expression2 (boolean, range<boolean>, repeating)", _t("More expressions that represent logical values.")),
|
|
13714
|
+
arg("logical_expression (boolean, range<boolean>, repeating)", _t("Expression or reference to a cell containing a logical value (TRUE/FALSE) or an expression that can be coerced to a logical value.")),
|
|
13771
13715
|
],
|
|
13772
13716
|
compute: function (...logicalExpressions) {
|
|
13773
13717
|
const { result, foundBoolean } = boolAnd(logicalExpressions);
|
|
@@ -13850,10 +13794,8 @@
|
|
|
13850
13794
|
const IFS = {
|
|
13851
13795
|
description: _t("Returns a value depending on multiple logical expressions."),
|
|
13852
13796
|
args: [
|
|
13853
|
-
arg("
|
|
13854
|
-
arg("
|
|
13855
|
-
arg("condition2 (boolean, any, range, repeating)", _t("Additional conditions to be evaluated if the previous ones are FALSE.")),
|
|
13856
|
-
arg("value2 (any, range, repeating)", _t("Additional values to be returned if their corresponding conditions are TRUE.")),
|
|
13797
|
+
arg("condition (any, range, repeating)", _t("The condition to be evaluated. It can be a boolean, a number, an array, or a reference to any of those.")),
|
|
13798
|
+
arg("value (any, range, repeating)", _t("The value to be returned if its corresponding condition is TRUE.")),
|
|
13857
13799
|
],
|
|
13858
13800
|
compute: function (...values) {
|
|
13859
13801
|
if (values.length % 2 !== 0) {
|
|
@@ -13892,8 +13834,7 @@
|
|
|
13892
13834
|
const OR = {
|
|
13893
13835
|
description: _t("Logical `or` operator."),
|
|
13894
13836
|
args: [
|
|
13895
|
-
arg("
|
|
13896
|
-
arg("logical_expression2 (boolean, range<boolean>, repeating)", _t("More expressions that evaluate to logical values.")),
|
|
13837
|
+
arg("logical_expression (boolean, range<boolean>, repeating)", _t("Expression or reference to a cell containing a logical value (TRUE/FALSE) or an expression that can be coerced to a logical value.")),
|
|
13897
13838
|
],
|
|
13898
13839
|
compute: function (...logicalExpressions) {
|
|
13899
13840
|
const { result, foundBoolean } = boolOr(logicalExpressions);
|
|
@@ -13911,10 +13852,8 @@
|
|
|
13911
13852
|
description: _t("Returns a value by comparing cases to an expression."),
|
|
13912
13853
|
args: [
|
|
13913
13854
|
arg("expression (number, boolean, string)", _t("The value to be checked.")),
|
|
13914
|
-
arg("
|
|
13915
|
-
arg("
|
|
13916
|
-
arg("case2 (any, repeating)", _t("Additional cases to try if the previous ones don't match expression.")),
|
|
13917
|
-
arg("value2 (any, repeating)", _t("Additional values to be returned if their corresponding cases match expression.")),
|
|
13855
|
+
arg("case (any, repeating)", _t("Case to be checked against expression.")),
|
|
13856
|
+
arg("value (any, repeating)", _t("Value to be returned if its corresponding case matches expression.")),
|
|
13918
13857
|
arg(`default (any, default="empty")`, _t("An optional default value to be returned if none of the cases match expression.")),
|
|
13919
13858
|
],
|
|
13920
13859
|
compute: function (expression, ...casesAndValues) {
|
|
@@ -13949,8 +13888,7 @@
|
|
|
13949
13888
|
const XOR = {
|
|
13950
13889
|
description: _t("Logical `xor` operator."),
|
|
13951
13890
|
args: [
|
|
13952
|
-
arg("
|
|
13953
|
-
arg("logical_expression2 (boolean, range<boolean>, repeating)", _t("More expressions that evaluate to logical values.")),
|
|
13891
|
+
arg("logical_expression (boolean, range<boolean>, repeating)", _t("Expression or reference to a cell containing a logical value (TRUE/FALSE) or an expression that can be coerced to a logical value.")),
|
|
13954
13892
|
],
|
|
13955
13893
|
compute: function (...logicalExpressions) {
|
|
13956
13894
|
let foundBoolean = false;
|
|
@@ -15425,8 +15363,8 @@
|
|
|
15425
15363
|
args: [
|
|
15426
15364
|
arg("pivot_id (number,string)", _t("ID of the pivot.")),
|
|
15427
15365
|
arg("measure_name (string)", _t("Name of the measure.")),
|
|
15428
|
-
arg("domain_field_name (string,repeating)", _t("Field name.")),
|
|
15429
|
-
arg("domain_value (number,string,boolean,repeating)", _t("Value.")),
|
|
15366
|
+
arg("domain_field_name (string,repeating,optional)", _t("Field name.")),
|
|
15367
|
+
arg("domain_value (number,string,boolean,repeating,optional)", _t("Value.")),
|
|
15430
15368
|
],
|
|
15431
15369
|
compute: function (formulaId, measureName, ...domainArgs) {
|
|
15432
15370
|
const _pivotFormulaId = toString(formulaId);
|
|
@@ -15461,8 +15399,8 @@
|
|
|
15461
15399
|
description: _t("Get the header of a pivot."),
|
|
15462
15400
|
args: [
|
|
15463
15401
|
arg("pivot_id (number,string)", _t("ID of the pivot.")),
|
|
15464
|
-
arg("domain_field_name (string,repeating)", _t("Field name.")),
|
|
15465
|
-
arg("domain_value (number,string,value,repeating)", _t("Value.")),
|
|
15402
|
+
arg("domain_field_name (string,repeating,optional)", _t("Field name.")),
|
|
15403
|
+
arg("domain_value (number,string,value,repeating,optional)", _t("Value.")),
|
|
15466
15404
|
],
|
|
15467
15405
|
compute: function (pivotId, ...domainArgs) {
|
|
15468
15406
|
const _pivotFormulaId = toString(pivotId);
|
|
@@ -16333,10 +16271,7 @@
|
|
|
16333
16271
|
// -----------------------------------------------------------------------------
|
|
16334
16272
|
const CONCATENATE = {
|
|
16335
16273
|
description: _t("Appends strings to one another."),
|
|
16336
|
-
args: [
|
|
16337
|
-
arg("string1 (string, range<string>)", _t("The initial string.")),
|
|
16338
|
-
arg("string2 (string, range<string>, repeating)", _t("More strings to append in sequence.")),
|
|
16339
|
-
],
|
|
16274
|
+
args: [arg("string (string, range<string>, repeating)", _t("String to append in sequence."))],
|
|
16340
16275
|
compute: function (...datas) {
|
|
16341
16276
|
return reduceAny(datas, (acc, a) => acc + toString(a), "");
|
|
16342
16277
|
},
|
|
@@ -16391,8 +16326,7 @@
|
|
|
16391
16326
|
description: _t("Concatenates elements of arrays with delimiter."),
|
|
16392
16327
|
args: [
|
|
16393
16328
|
arg("delimiter (string)", _t("The character or string to place between each concatenated value.")),
|
|
16394
|
-
arg("
|
|
16395
|
-
arg("value_or_array2 (string, range<string>, repeating)", _t("More values to be appended using delimiter.")),
|
|
16329
|
+
arg("value_or_array (string, range<string>, repeating)", _t("Value to be appended using delimiter.")),
|
|
16396
16330
|
],
|
|
16397
16331
|
compute: function (delimiter, ...valuesOrArrays) {
|
|
16398
16332
|
const _delimiter = toString(delimiter);
|
|
@@ -16683,13 +16617,12 @@
|
|
|
16683
16617
|
const TEXTJOIN = {
|
|
16684
16618
|
description: _t("Combines text from multiple strings and/or arrays."),
|
|
16685
16619
|
args: [
|
|
16686
|
-
arg("delimiter (string)", _t("
|
|
16620
|
+
arg("delimiter (string)", _t("A string, possible empty, or a reference to a valid string. If empty, the text will be simply concatenated.")),
|
|
16687
16621
|
arg("ignore_empty (boolean)", _t("A boolean; if TRUE, empty cells selected in the text arguments won't be included in the result."), [
|
|
16688
16622
|
{ value: true, label: _t("Ignore empty cells") },
|
|
16689
16623
|
{ value: false, label: _t("Include empty cells (default)") },
|
|
16690
16624
|
]),
|
|
16691
|
-
arg("
|
|
16692
|
-
arg("text2 (string, range<string>, repeating)", _t("Additional text item(s).")),
|
|
16625
|
+
arg("texts (string, range<string>, repeating)", _t("Text item to join.")),
|
|
16693
16626
|
],
|
|
16694
16627
|
compute: function (delimiter, ignoreEmpty = { value: TEXTJOIN_DEFAULT_IGNORE_EMPTY }, ...textsOrArrays) {
|
|
16695
16628
|
const _delimiter = toString(delimiter);
|
|
@@ -17562,7 +17495,7 @@
|
|
|
17562
17495
|
const compiledArgs = [];
|
|
17563
17496
|
const argToFocus = argTargeting(functionDefinition, args.length);
|
|
17564
17497
|
for (let i = 0; i < args.length; i++) {
|
|
17565
|
-
const argDefinition = functionDefinition.args[argToFocus(i) ?? -1];
|
|
17498
|
+
const argDefinition = functionDefinition.args[argToFocus(i).index ?? -1];
|
|
17566
17499
|
const currentArg = args[i];
|
|
17567
17500
|
const argTypes = argDefinition.type || [];
|
|
17568
17501
|
// detect when an argument need to be evaluated as a meta argument
|
|
@@ -17741,12 +17674,15 @@
|
|
|
17741
17674
|
}
|
|
17742
17675
|
if (nbrArgRepeating > 1) {
|
|
17743
17676
|
const nbrValueRepeating = nbrArgRepeating * Math.floor((nbrArgSupplied - minArgRequired) / nbrArgRepeating);
|
|
17744
|
-
const nbrValueRemaining = nbrArgSupplied -
|
|
17677
|
+
const nbrValueRemaining = nbrArgSupplied -
|
|
17678
|
+
minArgRequired -
|
|
17679
|
+
nbrValueRepeating -
|
|
17680
|
+
functionDefinition.nbrOptionalNonRepeatingArgs;
|
|
17745
17681
|
if (nbrValueRemaining > 0) {
|
|
17746
17682
|
throw new BadExpressionError(_t("Invalid number of arguments for the %(functionName)s function. Repeatable arguments should be supplied in groups of %(nbrArgRepeating)s, with up to %(nbrArgOptional)s optional. Got %(nbrValueRemaining)s too many.", {
|
|
17747
17683
|
functionName,
|
|
17748
17684
|
nbrArgRepeating,
|
|
17749
|
-
nbrArgOptional: functionDefinition.
|
|
17685
|
+
nbrArgOptional: functionDefinition.nbrOptionalNonRepeatingArgs,
|
|
17750
17686
|
nbrValueRemaining,
|
|
17751
17687
|
}));
|
|
17752
17688
|
}
|
|
@@ -17976,7 +17912,7 @@
|
|
|
17976
17912
|
let sheetName = "";
|
|
17977
17913
|
if (prefixSheet) {
|
|
17978
17914
|
if (range.invalidSheetName) {
|
|
17979
|
-
sheetName = range.invalidSheetName;
|
|
17915
|
+
sheetName = getCanonicalSymbolName(range.invalidSheetName);
|
|
17980
17916
|
}
|
|
17981
17917
|
else {
|
|
17982
17918
|
sheetName = getCanonicalSymbolName(getSheetName(range.sheetId));
|
|
@@ -19802,8 +19738,7 @@
|
|
|
19802
19738
|
.filter((ds) => !isTrendLineAxis(ds["xAxisID"]))
|
|
19803
19739
|
.map((ds) => ({
|
|
19804
19740
|
...ds,
|
|
19805
|
-
pointRadius: 0,
|
|
19806
|
-
showLine: true,
|
|
19741
|
+
pointRadius: ds.showLine === false ? 2 : 0, // Show points only for scatter plots
|
|
19807
19742
|
})),
|
|
19808
19743
|
},
|
|
19809
19744
|
options: {
|
|
@@ -38118,9 +38053,13 @@
|
|
|
38118
38053
|
if (!blob) {
|
|
38119
38054
|
return undefined;
|
|
38120
38055
|
}
|
|
38121
|
-
|
|
38122
|
-
|
|
38123
|
-
|
|
38056
|
+
return new Promise((resolve) => {
|
|
38057
|
+
const f = new FileReader();
|
|
38058
|
+
f.addEventListener("load", () => {
|
|
38059
|
+
resolve(f.result);
|
|
38060
|
+
});
|
|
38061
|
+
f.readAsDataURL(blob);
|
|
38062
|
+
});
|
|
38124
38063
|
}
|
|
38125
38064
|
|
|
38126
38065
|
class EvaluationChartPlugin extends CoreViewPlugin {
|
|
@@ -40495,6 +40434,7 @@
|
|
|
40495
40434
|
isMeasureCandidate: (field) => field.type !== "boolean",
|
|
40496
40435
|
isGroupable: () => true,
|
|
40497
40436
|
canHaveCustomGroup: (field) => field.type === "char" && !field.isCustomField,
|
|
40437
|
+
isPivotUnused: () => true,
|
|
40498
40438
|
});
|
|
40499
40439
|
|
|
40500
40440
|
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT", "REMOVE_PIVOT"];
|
|
@@ -40513,7 +40453,7 @@
|
|
|
40513
40453
|
"isSpillPivotFormula",
|
|
40514
40454
|
];
|
|
40515
40455
|
pivots = {};
|
|
40516
|
-
|
|
40456
|
+
unusedPivotsInFormulas;
|
|
40517
40457
|
custom;
|
|
40518
40458
|
constructor(config) {
|
|
40519
40459
|
super(config);
|
|
@@ -40553,12 +40493,12 @@
|
|
|
40553
40493
|
}
|
|
40554
40494
|
case "DELETE_SHEET":
|
|
40555
40495
|
case "UPDATE_CELL": {
|
|
40556
|
-
this.
|
|
40496
|
+
this.unusedPivotsInFormulas = undefined;
|
|
40557
40497
|
break;
|
|
40558
40498
|
}
|
|
40559
40499
|
case "UNDO":
|
|
40560
40500
|
case "REDO": {
|
|
40561
|
-
this.
|
|
40501
|
+
this.unusedPivotsInFormulas = undefined;
|
|
40562
40502
|
const pivotCommands = cmd.commands.filter(isPivotCommand);
|
|
40563
40503
|
for (const cmd of pivotCommands) {
|
|
40564
40504
|
const pivotId = cmd.pivotId;
|
|
@@ -40717,7 +40657,9 @@
|
|
|
40717
40657
|
return this.pivots[pivotId];
|
|
40718
40658
|
}
|
|
40719
40659
|
isPivotUnused(pivotId) {
|
|
40720
|
-
|
|
40660
|
+
const { type } = this.getters.getPivot(pivotId);
|
|
40661
|
+
return (this._getUnusedPivotsInFormulas().includes(pivotId) &&
|
|
40662
|
+
pivotRegistry.get(type).isPivotUnused(this.getters, pivotId));
|
|
40721
40663
|
}
|
|
40722
40664
|
getPivotCellSortDirection(position) {
|
|
40723
40665
|
const pivotId = this.getters.getPivotIdFromPosition(position);
|
|
@@ -40753,9 +40695,9 @@
|
|
|
40753
40695
|
this.pivots[pivotId].onDefinitionChange(definition);
|
|
40754
40696
|
}
|
|
40755
40697
|
}
|
|
40756
|
-
|
|
40757
|
-
if (this.
|
|
40758
|
-
return this.
|
|
40698
|
+
_getUnusedPivotsInFormulas() {
|
|
40699
|
+
if (this.unusedPivotsInFormulas !== undefined) {
|
|
40700
|
+
return this.unusedPivotsInFormulas;
|
|
40759
40701
|
}
|
|
40760
40702
|
const unusedPivots = new Set(this.getters.getPivotIds());
|
|
40761
40703
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
@@ -40765,14 +40707,14 @@
|
|
|
40765
40707
|
if (pivotId) {
|
|
40766
40708
|
unusedPivots.delete(pivotId);
|
|
40767
40709
|
if (!unusedPivots.size) {
|
|
40768
|
-
this.
|
|
40710
|
+
this.unusedPivotsInFormulas = [];
|
|
40769
40711
|
return [];
|
|
40770
40712
|
}
|
|
40771
40713
|
}
|
|
40772
40714
|
}
|
|
40773
40715
|
}
|
|
40774
|
-
this.
|
|
40775
|
-
return this.
|
|
40716
|
+
this.unusedPivotsInFormulas = [...unusedPivots];
|
|
40717
|
+
return this.unusedPivotsInFormulas;
|
|
40776
40718
|
}
|
|
40777
40719
|
}
|
|
40778
40720
|
|
|
@@ -46178,6 +46120,7 @@
|
|
|
46178
46120
|
"getVisibleFigures",
|
|
46179
46121
|
"getVisibleRect",
|
|
46180
46122
|
"getVisibleRectWithoutHeaders",
|
|
46123
|
+
"getVisibleRectWithZoom",
|
|
46181
46124
|
"getVisibleCellPositions",
|
|
46182
46125
|
"getColRowOffsetInViewport",
|
|
46183
46126
|
"getMainViewportCoordinates",
|
|
@@ -46193,6 +46136,8 @@
|
|
|
46193
46136
|
"getFigureUI",
|
|
46194
46137
|
"getPositionAnchorOffset",
|
|
46195
46138
|
"getGridOffset",
|
|
46139
|
+
"getViewportZoomLevel",
|
|
46140
|
+
"getScrollBarWidth",
|
|
46196
46141
|
];
|
|
46197
46142
|
viewports = {};
|
|
46198
46143
|
/**
|
|
@@ -46205,6 +46150,7 @@
|
|
|
46205
46150
|
sheetViewHeight = getDefaultSheetViewSize();
|
|
46206
46151
|
gridOffsetX = 0;
|
|
46207
46152
|
gridOffsetY = 0;
|
|
46153
|
+
zoomLevel = 1;
|
|
46208
46154
|
sheetsWithDirtyViewports = new Set();
|
|
46209
46155
|
shouldAdjustViewports = false;
|
|
46210
46156
|
// ---------------------------------------------------------------------------
|
|
@@ -46271,6 +46217,9 @@
|
|
|
46271
46217
|
case "SET_VIEWPORT_OFFSET":
|
|
46272
46218
|
this.setSheetViewOffset(cmd.offsetX, cmd.offsetY);
|
|
46273
46219
|
break;
|
|
46220
|
+
case "SET_ZOOM":
|
|
46221
|
+
this.zoomLevel = cmd.zoom || 1;
|
|
46222
|
+
break;
|
|
46274
46223
|
case "SHIFT_VIEWPORT_DOWN":
|
|
46275
46224
|
const sheetId = this.getters.getActiveSheetId();
|
|
46276
46225
|
const { top, viewportHeight, offsetCorrectionY } = this.getMainInternalViewport(sheetId);
|
|
@@ -46474,7 +46423,7 @@
|
|
|
46474
46423
|
for (const i of relevantIndexes) {
|
|
46475
46424
|
offset += this.getters.getHeaderSize(sheetId, dimension, i);
|
|
46476
46425
|
}
|
|
46477
|
-
return offset;
|
|
46426
|
+
return offset * this.zoomLevel;
|
|
46478
46427
|
}
|
|
46479
46428
|
/**
|
|
46480
46429
|
* Check if a given position is visible in the viewport.
|
|
@@ -46482,6 +46431,9 @@
|
|
|
46482
46431
|
isVisibleInViewport({ sheetId, col, row }) {
|
|
46483
46432
|
return this.getSubViewports(sheetId).some((pane) => pane.isVisible(col, row));
|
|
46484
46433
|
}
|
|
46434
|
+
getScrollBarWidth() {
|
|
46435
|
+
return SCROLLBAR_WIDTH / this.zoomLevel;
|
|
46436
|
+
}
|
|
46485
46437
|
// => returns the new offset
|
|
46486
46438
|
getEdgeScrollCol(x, previousX, startingX) {
|
|
46487
46439
|
let canEdgeScroll = false;
|
|
@@ -46560,6 +46512,18 @@
|
|
|
46560
46512
|
const rect = this.getVisibleRectWithoutHeaders(zone);
|
|
46561
46513
|
return { ...rect, x: rect.x + this.gridOffsetX, y: rect.y + this.gridOffsetY };
|
|
46562
46514
|
}
|
|
46515
|
+
/**
|
|
46516
|
+
* Computes the coordinates and size to draw the zone on the canvas after it has been zoomed
|
|
46517
|
+
*/
|
|
46518
|
+
getVisibleRectWithZoom(zone) {
|
|
46519
|
+
const zoom = this.getViewportZoomLevel();
|
|
46520
|
+
const rect = this.getVisibleRectWithoutHeaders(zone);
|
|
46521
|
+
rect.width = rect.width * zoom;
|
|
46522
|
+
rect.height = rect.height * zoom;
|
|
46523
|
+
rect.x = rect.x * zoom + this.gridOffsetX * zoom;
|
|
46524
|
+
rect.y = rect.y * zoom + this.gridOffsetY * zoom;
|
|
46525
|
+
return rect;
|
|
46526
|
+
}
|
|
46563
46527
|
/**
|
|
46564
46528
|
* Computes the coordinates and size to draw the zone without taking the grid offset into account
|
|
46565
46529
|
*/
|
|
@@ -46641,6 +46605,9 @@
|
|
|
46641
46605
|
};
|
|
46642
46606
|
});
|
|
46643
46607
|
}
|
|
46608
|
+
getViewportZoomLevel() {
|
|
46609
|
+
return this.zoomLevel;
|
|
46610
|
+
}
|
|
46644
46611
|
// ---------------------------------------------------------------------------
|
|
46645
46612
|
// Private
|
|
46646
46613
|
// ---------------------------------------------------------------------------
|
|
@@ -50960,8 +50927,8 @@
|
|
|
50960
50927
|
|
|
50961
50928
|
|
|
50962
50929
|
__info__.version = "19.1.0-alpha.3";
|
|
50963
|
-
__info__.date = "2025-
|
|
50964
|
-
__info__.hash = "
|
|
50930
|
+
__info__.date = "2025-11-12T14:16:26.552Z";
|
|
50931
|
+
__info__.hash = "6fefc9c";
|
|
50965
50932
|
|
|
50966
50933
|
|
|
50967
50934
|
})(this.o_spreadsheet_engine = this.o_spreadsheet_engine || {});
|