@odoo/o-spreadsheet 16.0.62 → 16.0.64
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 +168 -95
- package/dist/o-spreadsheet.d.ts +3 -1
- package/dist/o-spreadsheet.esm.js +168 -95
- package/dist/o-spreadsheet.iife.js +168 -95
- package/dist/o-spreadsheet.iife.min.js +216 -216
- package/dist/o_spreadsheet.xml +18 -11
- package/package.json +2 -1
|
@@ -2395,11 +2395,12 @@ class UuidGenerator {
|
|
|
2395
2395
|
if (this.isFastIdStrategy) {
|
|
2396
2396
|
this.fastIdStart++;
|
|
2397
2397
|
return String(this.fastIdStart);
|
|
2398
|
-
//@ts-ignore
|
|
2399
2398
|
}
|
|
2400
|
-
else if (window.crypto
|
|
2401
|
-
|
|
2402
|
-
|
|
2399
|
+
else if (window.crypto) {
|
|
2400
|
+
return "10000000-1000".replace(/[01]/g, (c) => {
|
|
2401
|
+
const n = Number(c);
|
|
2402
|
+
return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
|
|
2403
|
+
});
|
|
2403
2404
|
}
|
|
2404
2405
|
else {
|
|
2405
2406
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
@@ -2417,11 +2418,12 @@ class UuidGenerator {
|
|
|
2417
2418
|
if (this.isFastIdStrategy) {
|
|
2418
2419
|
this.fastIdStart++;
|
|
2419
2420
|
return String(this.fastIdStart);
|
|
2420
|
-
//@ts-ignore
|
|
2421
2421
|
}
|
|
2422
|
-
else if (window.crypto
|
|
2423
|
-
|
|
2424
|
-
|
|
2422
|
+
else if (window.crypto) {
|
|
2423
|
+
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => {
|
|
2424
|
+
const n = Number(c);
|
|
2425
|
+
return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
|
|
2426
|
+
});
|
|
2425
2427
|
}
|
|
2426
2428
|
else {
|
|
2427
2429
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
@@ -3578,10 +3580,13 @@ autofillRulesRegistry
|
|
|
3578
3580
|
})
|
|
3579
3581
|
.add("increment_number", {
|
|
3580
3582
|
condition: (cell) => cell.evaluated.type === CellValueType.number,
|
|
3581
|
-
generateRule: (cell, cells) => {
|
|
3583
|
+
generateRule: (cell, cells, direction) => {
|
|
3582
3584
|
const group = getGroup(cell, cells);
|
|
3583
3585
|
let increment = 1;
|
|
3584
|
-
if (group.length
|
|
3586
|
+
if (group.length === 1 && ["up", "left"].includes(direction)) {
|
|
3587
|
+
increment = -1;
|
|
3588
|
+
}
|
|
3589
|
+
else if (group.length == 2) {
|
|
3585
3590
|
increment = (group[1] - group[0]) * 2;
|
|
3586
3591
|
}
|
|
3587
3592
|
else if (group.length > 2) {
|
|
@@ -22181,6 +22186,9 @@ class ColResizer extends AbstractResizer {
|
|
|
22181
22186
|
this.MAX_SIZE_MARGIN = 90;
|
|
22182
22187
|
this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
|
|
22183
22188
|
}
|
|
22189
|
+
get sheetId() {
|
|
22190
|
+
return this.env.model.getters.getActiveSheetId();
|
|
22191
|
+
}
|
|
22184
22192
|
_getEvOffset(ev) {
|
|
22185
22193
|
return ev.offsetX;
|
|
22186
22194
|
}
|
|
@@ -22203,10 +22211,10 @@ class ColResizer extends AbstractResizer {
|
|
|
22203
22211
|
return this.env.model.getters.getEdgeScrollCol(position, position, position);
|
|
22204
22212
|
}
|
|
22205
22213
|
_getDimensionsInViewport(index) {
|
|
22206
|
-
return this.env.model.getters.getColDimensionsInViewport(this.
|
|
22214
|
+
return this.env.model.getters.getColDimensionsInViewport(this.sheetId, index);
|
|
22207
22215
|
}
|
|
22208
22216
|
_getElementSize(index) {
|
|
22209
|
-
return this.env.model.getters.getColSize(this.
|
|
22217
|
+
return this.env.model.getters.getColSize(this.sheetId, index);
|
|
22210
22218
|
}
|
|
22211
22219
|
_getMaxSize() {
|
|
22212
22220
|
return this.colResizerRef.el.clientWidth;
|
|
@@ -22217,7 +22225,7 @@ class ColResizer extends AbstractResizer {
|
|
|
22217
22225
|
const cols = this.env.model.getters.getActiveCols();
|
|
22218
22226
|
this.env.model.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
22219
22227
|
dimension: "COL",
|
|
22220
|
-
sheetId: this.
|
|
22228
|
+
sheetId: this.sheetId,
|
|
22221
22229
|
elements: cols.has(index) ? [...cols] : [index],
|
|
22222
22230
|
size,
|
|
22223
22231
|
});
|
|
@@ -22230,7 +22238,7 @@ class ColResizer extends AbstractResizer {
|
|
|
22230
22238
|
elements.push(colIndex);
|
|
22231
22239
|
}
|
|
22232
22240
|
const result = this.env.model.dispatch("MOVE_COLUMNS_ROWS", {
|
|
22233
|
-
sheetId: this.
|
|
22241
|
+
sheetId: this.sheetId,
|
|
22234
22242
|
dimension: "COL",
|
|
22235
22243
|
base: this.state.base,
|
|
22236
22244
|
elements,
|
|
@@ -22249,7 +22257,7 @@ class ColResizer extends AbstractResizer {
|
|
|
22249
22257
|
_fitElementSize(index) {
|
|
22250
22258
|
const cols = this.env.model.getters.getActiveCols();
|
|
22251
22259
|
this.env.model.dispatch("AUTORESIZE_COLUMNS", {
|
|
22252
|
-
sheetId: this.
|
|
22260
|
+
sheetId: this.sheetId,
|
|
22253
22261
|
cols: cols.has(index) ? [...cols] : [index],
|
|
22254
22262
|
});
|
|
22255
22263
|
}
|
|
@@ -22260,7 +22268,7 @@ class ColResizer extends AbstractResizer {
|
|
|
22260
22268
|
return this.env.model.getters.getActiveCols();
|
|
22261
22269
|
}
|
|
22262
22270
|
_getPreviousVisibleElement(index) {
|
|
22263
|
-
const sheetId = this.
|
|
22271
|
+
const sheetId = this.sheetId;
|
|
22264
22272
|
let row;
|
|
22265
22273
|
for (row = index - 1; row >= 0; row--) {
|
|
22266
22274
|
if (!this.env.model.getters.isColHidden(sheetId, row)) {
|
|
@@ -22271,7 +22279,7 @@ class ColResizer extends AbstractResizer {
|
|
|
22271
22279
|
}
|
|
22272
22280
|
unhide(hiddenElements) {
|
|
22273
22281
|
this.env.model.dispatch("UNHIDE_COLUMNS_ROWS", {
|
|
22274
|
-
sheetId: this.
|
|
22282
|
+
sheetId: this.sheetId,
|
|
22275
22283
|
elements: hiddenElements,
|
|
22276
22284
|
dimension: "COL",
|
|
22277
22285
|
});
|
|
@@ -22288,7 +22296,7 @@ css /* scss */ `
|
|
|
22288
22296
|
left: 0;
|
|
22289
22297
|
right: 0;
|
|
22290
22298
|
width: ${HEADER_WIDTH}px;
|
|
22291
|
-
height: 100
|
|
22299
|
+
height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px);
|
|
22292
22300
|
&.o-dragging {
|
|
22293
22301
|
cursor: grabbing;
|
|
22294
22302
|
}
|
|
@@ -22351,6 +22359,9 @@ class RowResizer extends AbstractResizer {
|
|
|
22351
22359
|
this.MAX_SIZE_MARGIN = 60;
|
|
22352
22360
|
this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
|
|
22353
22361
|
}
|
|
22362
|
+
get sheetId() {
|
|
22363
|
+
return this.env.model.getters.getActiveSheetId();
|
|
22364
|
+
}
|
|
22354
22365
|
_getEvOffset(ev) {
|
|
22355
22366
|
return ev.offsetY;
|
|
22356
22367
|
}
|
|
@@ -22373,10 +22384,10 @@ class RowResizer extends AbstractResizer {
|
|
|
22373
22384
|
return this.env.model.getters.getEdgeScrollRow(position, position, position);
|
|
22374
22385
|
}
|
|
22375
22386
|
_getDimensionsInViewport(index) {
|
|
22376
|
-
return this.env.model.getters.getRowDimensionsInViewport(this.
|
|
22387
|
+
return this.env.model.getters.getRowDimensionsInViewport(this.sheetId, index);
|
|
22377
22388
|
}
|
|
22378
22389
|
_getElementSize(index) {
|
|
22379
|
-
return this.env.model.getters.getRowSize(this.
|
|
22390
|
+
return this.env.model.getters.getRowSize(this.sheetId, index);
|
|
22380
22391
|
}
|
|
22381
22392
|
_getMaxSize() {
|
|
22382
22393
|
return this.rowResizerRef.el.clientHeight;
|
|
@@ -22387,7 +22398,7 @@ class RowResizer extends AbstractResizer {
|
|
|
22387
22398
|
const rows = this.env.model.getters.getActiveRows();
|
|
22388
22399
|
this.env.model.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
22389
22400
|
dimension: "ROW",
|
|
22390
|
-
sheetId: this.
|
|
22401
|
+
sheetId: this.sheetId,
|
|
22391
22402
|
elements: rows.has(index) ? [...rows] : [index],
|
|
22392
22403
|
size,
|
|
22393
22404
|
});
|
|
@@ -22400,7 +22411,7 @@ class RowResizer extends AbstractResizer {
|
|
|
22400
22411
|
elements.push(rowIndex);
|
|
22401
22412
|
}
|
|
22402
22413
|
const result = this.env.model.dispatch("MOVE_COLUMNS_ROWS", {
|
|
22403
|
-
sheetId: this.
|
|
22414
|
+
sheetId: this.sheetId,
|
|
22404
22415
|
dimension: "ROW",
|
|
22405
22416
|
base: this.state.base,
|
|
22406
22417
|
elements,
|
|
@@ -22419,7 +22430,7 @@ class RowResizer extends AbstractResizer {
|
|
|
22419
22430
|
_fitElementSize(index) {
|
|
22420
22431
|
const rows = this.env.model.getters.getActiveRows();
|
|
22421
22432
|
this.env.model.dispatch("AUTORESIZE_ROWS", {
|
|
22422
|
-
sheetId: this.
|
|
22433
|
+
sheetId: this.sheetId,
|
|
22423
22434
|
rows: rows.has(index) ? [...rows] : [index],
|
|
22424
22435
|
});
|
|
22425
22436
|
}
|
|
@@ -22430,7 +22441,7 @@ class RowResizer extends AbstractResizer {
|
|
|
22430
22441
|
return this.env.model.getters.getActiveRows();
|
|
22431
22442
|
}
|
|
22432
22443
|
_getPreviousVisibleElement(index) {
|
|
22433
|
-
const sheetId = this.
|
|
22444
|
+
const sheetId = this.sheetId;
|
|
22434
22445
|
let row;
|
|
22435
22446
|
for (row = index - 1; row >= 0; row--) {
|
|
22436
22447
|
if (!this.env.model.getters.isRowHidden(sheetId, row)) {
|
|
@@ -22441,7 +22452,7 @@ class RowResizer extends AbstractResizer {
|
|
|
22441
22452
|
}
|
|
22442
22453
|
unhide(hiddenElements) {
|
|
22443
22454
|
this.env.model.dispatch("UNHIDE_COLUMNS_ROWS", {
|
|
22444
|
-
sheetId: this.
|
|
22455
|
+
sheetId: this.sheetId,
|
|
22445
22456
|
dimension: "ROW",
|
|
22446
22457
|
elements: hiddenElements,
|
|
22447
22458
|
});
|
|
@@ -25519,29 +25530,33 @@ function applyStyleToZone(appliedStyle, zone, cells, styles) {
|
|
|
25519
25530
|
* In all the sheets, replace the table-only references in the formula cells with standard references.
|
|
25520
25531
|
*/
|
|
25521
25532
|
function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
|
|
25522
|
-
for (let
|
|
25523
|
-
const tables = xlsxSheets.find((s) => s.sheetName ===
|
|
25533
|
+
for (let tableSheet of convertedSheets) {
|
|
25534
|
+
const tables = xlsxSheets.find((s) => s.sheetName === tableSheet.name).tables;
|
|
25524
25535
|
for (let table of tables) {
|
|
25525
25536
|
const tabRef = table.name + "[";
|
|
25526
|
-
for (let
|
|
25527
|
-
|
|
25528
|
-
|
|
25529
|
-
|
|
25530
|
-
|
|
25531
|
-
|
|
25532
|
-
|
|
25533
|
-
|
|
25534
|
-
|
|
25535
|
-
|
|
25536
|
-
|
|
25537
|
-
|
|
25537
|
+
for (let sheet of convertedSheets) {
|
|
25538
|
+
for (let xc in sheet.cells) {
|
|
25539
|
+
const cell = sheet.cells[xc];
|
|
25540
|
+
if (cell && cell.content && cell.content.startsWith("=")) {
|
|
25541
|
+
let refIndex;
|
|
25542
|
+
while ((refIndex = cell.content.indexOf(tabRef)) !== -1) {
|
|
25543
|
+
let endIndex = refIndex + tabRef.length;
|
|
25544
|
+
let openBrackets = 1;
|
|
25545
|
+
while (openBrackets > 0 && endIndex < cell.content.length) {
|
|
25546
|
+
if (cell.content[endIndex] === "[") {
|
|
25547
|
+
openBrackets++;
|
|
25548
|
+
}
|
|
25549
|
+
else if (cell.content[endIndex] === "]") {
|
|
25550
|
+
openBrackets--;
|
|
25551
|
+
}
|
|
25552
|
+
endIndex++;
|
|
25553
|
+
}
|
|
25554
|
+
let reference = cell.content.slice(refIndex + tabRef.length, endIndex - 1);
|
|
25555
|
+
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
25556
|
+
const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
|
|
25557
|
+
cell.content =
|
|
25558
|
+
cell.content.slice(0, refIndex) + convertedRef + cell.content.slice(endIndex);
|
|
25538
25559
|
}
|
|
25539
|
-
reference = reference.slice(0, endIndex);
|
|
25540
|
-
const convertedRef = convertTableReference(reference, table, xc);
|
|
25541
|
-
cell.content =
|
|
25542
|
-
cell.content.slice(0, refIndex) +
|
|
25543
|
-
convertedRef +
|
|
25544
|
-
cell.content.slice(tabRef.length + refIndex + endIndex + 1);
|
|
25545
25560
|
}
|
|
25546
25561
|
}
|
|
25547
25562
|
}
|
|
@@ -25549,11 +25564,17 @@ function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
|
|
|
25549
25564
|
}
|
|
25550
25565
|
}
|
|
25551
25566
|
/**
|
|
25552
|
-
* Convert table-specific references in formulas into standard references.
|
|
25567
|
+
* Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
|
|
25568
|
+
* and of keywords determining the rows of the table to reference.
|
|
25553
25569
|
*
|
|
25554
25570
|
* A reference in a table can have the form (only the part between brackets should be given to this function):
|
|
25555
25571
|
* - tableName[colName] : reference to the whole column "colName"
|
|
25572
|
+
* - tableName[#keyword] : reference to the whatever row the keyword refers to
|
|
25556
25573
|
* - tableName[[#keyword], [colName]] : reference to some of the element(s) of the column colName
|
|
25574
|
+
* - tableName[[#keyword], [colName]:[col2Name]] : reference to some of the element(s) of the columns colName to col2Name
|
|
25575
|
+
* - tableName[[#keyword1], [#keyword2], [colName]] : reference to all the rows referenced by the keywords in the column colName
|
|
25576
|
+
* - tableName[[#keyword1], [colName], [#keyword2]]: the keywords and colName can be in any order
|
|
25577
|
+
*
|
|
25557
25578
|
*
|
|
25558
25579
|
* The available keywords are :
|
|
25559
25580
|
* - #All : all the column (including totals)
|
|
@@ -25561,58 +25582,109 @@ function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
|
|
|
25561
25582
|
* - #Headers : only the header of the column
|
|
25562
25583
|
* - #Totals : only the totals of the column
|
|
25563
25584
|
* - #This Row : only the element in the same row as the cell
|
|
25585
|
+
*
|
|
25586
|
+
* Note that the only valid combination of multiple keywords are #Data + #Totals and #Headers + #Data.
|
|
25564
25587
|
*/
|
|
25565
|
-
function convertTableReference(expr, table, cellXc) {
|
|
25566
|
-
|
|
25588
|
+
function convertTableReference(sheetPrefix, expr, table, cellXc) {
|
|
25589
|
+
// TODO: Ideally we'd want to make a real tokenizer, this simple approach won't work if for example the column name
|
|
25590
|
+
// contain # or , characters. But that's probably an edge case that we can ignore for now.
|
|
25591
|
+
const parts = expr.split(",").map((part) => part.trim());
|
|
25567
25592
|
const tableZone = toZone(table.ref);
|
|
25568
|
-
const
|
|
25569
|
-
|
|
25570
|
-
|
|
25571
|
-
|
|
25572
|
-
|
|
25573
|
-
|
|
25574
|
-
|
|
25575
|
-
|
|
25576
|
-
|
|
25577
|
-
|
|
25578
|
-
|
|
25593
|
+
const colIndexes = [];
|
|
25594
|
+
const rowIndexes = [];
|
|
25595
|
+
const foundKeywords = [];
|
|
25596
|
+
for (const part of parts) {
|
|
25597
|
+
if (removeBrackets(part).startsWith("#")) {
|
|
25598
|
+
const keyWord = removeBrackets(part);
|
|
25599
|
+
foundKeywords.push(keyWord);
|
|
25600
|
+
switch (keyWord) {
|
|
25601
|
+
case "#All":
|
|
25602
|
+
rowIndexes.push(tableZone.top, tableZone.bottom);
|
|
25603
|
+
break;
|
|
25604
|
+
case "#Data":
|
|
25605
|
+
const top = table.headerRowCount ? tableZone.top + table.headerRowCount : tableZone.top;
|
|
25606
|
+
const bottom = table.totalsRowCount
|
|
25607
|
+
? tableZone.bottom - table.totalsRowCount
|
|
25608
|
+
: tableZone.bottom;
|
|
25609
|
+
rowIndexes.push(top, bottom);
|
|
25610
|
+
break;
|
|
25611
|
+
case "#This Row":
|
|
25612
|
+
rowIndexes.push(toCartesian(cellXc).row);
|
|
25613
|
+
break;
|
|
25614
|
+
case "#Headers":
|
|
25615
|
+
if (!table.headerRowCount) {
|
|
25616
|
+
return INCORRECT_RANGE_STRING;
|
|
25617
|
+
}
|
|
25618
|
+
rowIndexes.push(tableZone.top);
|
|
25619
|
+
break;
|
|
25620
|
+
case "#Totals":
|
|
25621
|
+
if (!table.totalsRowCount) {
|
|
25622
|
+
return INCORRECT_RANGE_STRING;
|
|
25623
|
+
}
|
|
25624
|
+
rowIndexes.push(tableZone.bottom);
|
|
25625
|
+
break;
|
|
25626
|
+
}
|
|
25579
25627
|
}
|
|
25580
|
-
|
|
25581
|
-
|
|
25582
|
-
|
|
25583
|
-
|
|
25584
|
-
|
|
25585
|
-
|
|
25586
|
-
|
|
25587
|
-
|
|
25588
|
-
|
|
25589
|
-
|
|
25590
|
-
|
|
25591
|
-
|
|
25592
|
-
|
|
25593
|
-
|
|
25594
|
-
|
|
25595
|
-
|
|
25596
|
-
|
|
25597
|
-
if (!table.headerRowCount) {
|
|
25598
|
-
isReferencedZoneValid = false;
|
|
25599
|
-
}
|
|
25600
|
-
break;
|
|
25601
|
-
case "#Totals":
|
|
25602
|
-
refZone.top = refZone.bottom = tableZone.bottom;
|
|
25603
|
-
if (!table.totalsRowCount) {
|
|
25604
|
-
isReferencedZoneValid = false;
|
|
25628
|
+
else {
|
|
25629
|
+
const columns = part
|
|
25630
|
+
.split(":")
|
|
25631
|
+
.map((part) => part.trim())
|
|
25632
|
+
.map(removeBrackets);
|
|
25633
|
+
if (colIndexes.length) {
|
|
25634
|
+
return INCORRECT_RANGE_STRING;
|
|
25635
|
+
}
|
|
25636
|
+
const colRelativeIndex = table.cols.findIndex((col) => col.name === columns[0]);
|
|
25637
|
+
if (colRelativeIndex === -1) {
|
|
25638
|
+
return INCORRECT_RANGE_STRING;
|
|
25639
|
+
}
|
|
25640
|
+
colIndexes.push(colRelativeIndex + tableZone.left);
|
|
25641
|
+
if (columns[1]) {
|
|
25642
|
+
const colRelativeIndex2 = table.cols.findIndex((col) => col.name === columns[1]);
|
|
25643
|
+
if (colRelativeIndex2 === -1) {
|
|
25644
|
+
return INCORRECT_RANGE_STRING;
|
|
25605
25645
|
}
|
|
25606
|
-
|
|
25646
|
+
colIndexes.push(colRelativeIndex2 + tableZone.left);
|
|
25647
|
+
}
|
|
25607
25648
|
}
|
|
25608
|
-
const colRef = refElements[1].slice(1, refElements[1].length - 1);
|
|
25609
|
-
const colRelativeIndex = table.cols.findIndex((col) => col.name === colRef);
|
|
25610
|
-
refZone.left = refZone.right = colRelativeIndex + tableZone.left;
|
|
25611
25649
|
}
|
|
25612
|
-
if (!
|
|
25650
|
+
if (!areKeywordsCompatible(foundKeywords)) {
|
|
25613
25651
|
return INCORRECT_RANGE_STRING;
|
|
25614
25652
|
}
|
|
25615
|
-
|
|
25653
|
+
if (rowIndexes.length === 0) {
|
|
25654
|
+
const top = table.headerRowCount ? tableZone.top + table.headerRowCount : tableZone.top;
|
|
25655
|
+
const bottom = table.totalsRowCount
|
|
25656
|
+
? tableZone.bottom - table.totalsRowCount
|
|
25657
|
+
: tableZone.bottom;
|
|
25658
|
+
rowIndexes.push(top, bottom);
|
|
25659
|
+
}
|
|
25660
|
+
if (colIndexes.length === 0) {
|
|
25661
|
+
colIndexes.push(tableZone.left, tableZone.right);
|
|
25662
|
+
}
|
|
25663
|
+
const refZone = {
|
|
25664
|
+
top: Math.min(...rowIndexes),
|
|
25665
|
+
left: Math.min(...colIndexes),
|
|
25666
|
+
bottom: Math.max(...rowIndexes),
|
|
25667
|
+
right: Math.max(...colIndexes),
|
|
25668
|
+
};
|
|
25669
|
+
return sheetPrefix + zoneToXc(refZone);
|
|
25670
|
+
}
|
|
25671
|
+
function removeBrackets(str) {
|
|
25672
|
+
return str.startsWith("[") && str.endsWith("]") ? str.slice(1, str.length - 1) : str;
|
|
25673
|
+
}
|
|
25674
|
+
function areKeywordsCompatible(keywords) {
|
|
25675
|
+
if (keywords.length < 2) {
|
|
25676
|
+
return true;
|
|
25677
|
+
}
|
|
25678
|
+
else if (keywords.length > 2) {
|
|
25679
|
+
return false;
|
|
25680
|
+
}
|
|
25681
|
+
else if (keywords.includes("#Data") && keywords.includes("#Totals")) {
|
|
25682
|
+
return true;
|
|
25683
|
+
}
|
|
25684
|
+
else if (keywords.includes("#Headers") && keywords.includes("#Data")) {
|
|
25685
|
+
return true;
|
|
25686
|
+
}
|
|
25687
|
+
return false;
|
|
25616
25688
|
}
|
|
25617
25689
|
|
|
25618
25690
|
// -------------------------------------
|
|
@@ -31590,7 +31662,7 @@ class AutofillPlugin extends UIPlugin {
|
|
|
31590
31662
|
getRule(cell, cells) {
|
|
31591
31663
|
const rules = autofillRulesRegistry.getAll().sort((a, b) => a.sequence - b.sequence);
|
|
31592
31664
|
const rule = rules.find((rule) => rule.condition(cell, cells));
|
|
31593
|
-
return rule && rule.generateRule(cell, cells);
|
|
31665
|
+
return rule && this.direction && rule.generateRule(cell, cells, this.direction);
|
|
31594
31666
|
}
|
|
31595
31667
|
/**
|
|
31596
31668
|
* Create the generator to be able to autofill the next cells.
|
|
@@ -37492,7 +37564,8 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
37492
37564
|
? this.getters.getSheetViewVisibleCols()
|
|
37493
37565
|
: this.getters.getSheetViewVisibleRows();
|
|
37494
37566
|
const startIndex = visibleHeaders.findIndex((header) => referenceHeaderIndex >= header);
|
|
37495
|
-
|
|
37567
|
+
let endIndex = visibleHeaders.findIndex((header) => targetHeaderIndex <= header);
|
|
37568
|
+
endIndex = endIndex === -1 ? visibleHeaders.length : endIndex;
|
|
37496
37569
|
const relevantIndexes = visibleHeaders.slice(startIndex, endIndex);
|
|
37497
37570
|
let offset = 0;
|
|
37498
37571
|
for (const i of relevantIndexes) {
|
|
@@ -43657,6 +43730,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
43657
43730
|
export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
|
|
43658
43731
|
|
|
43659
43732
|
|
|
43660
|
-
__info__.version = '16.0.
|
|
43661
|
-
__info__.date = '2025-
|
|
43662
|
-
__info__.hash = '
|
|
43733
|
+
__info__.version = '16.0.64';
|
|
43734
|
+
__info__.date = '2025-03-07T10:29:50.957Z';
|
|
43735
|
+
__info__.hash = '20def15';
|