@odoo/o-spreadsheet 16.0.63 → 16.0.65

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.
@@ -3584,10 +3584,13 @@ autofillRulesRegistry
3584
3584
  })
3585
3585
  .add("increment_number", {
3586
3586
  condition: (cell) => cell.evaluated.type === CellValueType.number,
3587
- generateRule: (cell, cells) => {
3587
+ generateRule: (cell, cells, direction) => {
3588
3588
  const group = getGroup(cell, cells);
3589
3589
  let increment = 1;
3590
- if (group.length == 2) {
3590
+ if (group.length === 1 && ["up", "left"].includes(direction)) {
3591
+ increment = -1;
3592
+ }
3593
+ else if (group.length == 2) {
3591
3594
  increment = (group[1] - group[0]) * 2;
3592
3595
  }
3593
3596
  else if (group.length > 2) {
@@ -19588,8 +19591,8 @@ class EditionPlugin extends UIPlugin {
19588
19591
  break;
19589
19592
  case "STOP_EDITION":
19590
19593
  if (cmd.cancel) {
19591
- this.cancelEditionAndActivateSheet();
19592
19594
  this.resetContent();
19595
+ this.cancelEditionAndActivateSheet();
19593
19596
  }
19594
19597
  else {
19595
19598
  this.stopEdition();
@@ -19604,8 +19607,8 @@ class EditionPlugin extends UIPlugin {
19604
19607
  this.replaceSelection(cmd.text);
19605
19608
  break;
19606
19609
  case "SELECT_FIGURE":
19607
- this.cancelEditionAndActivateSheet();
19608
19610
  this.resetContent();
19611
+ this.cancelEditionAndActivateSheet();
19609
19612
  break;
19610
19613
  case "ADD_COLUMNS_ROWS":
19611
19614
  this.onAddElements(cmd);
@@ -19664,8 +19667,8 @@ class EditionPlugin extends UIPlugin {
19664
19667
  const sheetIdExists = !!this.getters.tryGetSheet(this.sheetId);
19665
19668
  if (!sheetIdExists && this.mode !== "inactive") {
19666
19669
  this.sheetId = this.getters.getActiveSheetId();
19667
- this.cancelEditionAndActivateSheet();
19668
19670
  this.resetContent();
19671
+ this.cancelEditionAndActivateSheet();
19669
19672
  this.ui.notifyUI({
19670
19673
  type: "ERROR",
19671
19674
  text: CELL_DELETED_MESSAGE,
@@ -22187,6 +22190,9 @@ class ColResizer extends AbstractResizer {
22187
22190
  this.MAX_SIZE_MARGIN = 90;
22188
22191
  this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
22189
22192
  }
22193
+ get sheetId() {
22194
+ return this.env.model.getters.getActiveSheetId();
22195
+ }
22190
22196
  _getEvOffset(ev) {
22191
22197
  return ev.offsetX;
22192
22198
  }
@@ -22209,10 +22215,10 @@ class ColResizer extends AbstractResizer {
22209
22215
  return this.env.model.getters.getEdgeScrollCol(position, position, position);
22210
22216
  }
22211
22217
  _getDimensionsInViewport(index) {
22212
- return this.env.model.getters.getColDimensionsInViewport(this.env.model.getters.getActiveSheetId(), index);
22218
+ return this.env.model.getters.getColDimensionsInViewport(this.sheetId, index);
22213
22219
  }
22214
22220
  _getElementSize(index) {
22215
- return this.env.model.getters.getColSize(this.env.model.getters.getActiveSheetId(), index);
22221
+ return this.env.model.getters.getColSize(this.sheetId, index);
22216
22222
  }
22217
22223
  _getMaxSize() {
22218
22224
  return this.colResizerRef.el.clientWidth;
@@ -22223,7 +22229,7 @@ class ColResizer extends AbstractResizer {
22223
22229
  const cols = this.env.model.getters.getActiveCols();
22224
22230
  this.env.model.dispatch("RESIZE_COLUMNS_ROWS", {
22225
22231
  dimension: "COL",
22226
- sheetId: this.env.model.getters.getActiveSheetId(),
22232
+ sheetId: this.sheetId,
22227
22233
  elements: cols.has(index) ? [...cols] : [index],
22228
22234
  size,
22229
22235
  });
@@ -22236,7 +22242,7 @@ class ColResizer extends AbstractResizer {
22236
22242
  elements.push(colIndex);
22237
22243
  }
22238
22244
  const result = this.env.model.dispatch("MOVE_COLUMNS_ROWS", {
22239
- sheetId: this.env.model.getters.getActiveSheetId(),
22245
+ sheetId: this.sheetId,
22240
22246
  dimension: "COL",
22241
22247
  base: this.state.base,
22242
22248
  elements,
@@ -22255,7 +22261,7 @@ class ColResizer extends AbstractResizer {
22255
22261
  _fitElementSize(index) {
22256
22262
  const cols = this.env.model.getters.getActiveCols();
22257
22263
  this.env.model.dispatch("AUTORESIZE_COLUMNS", {
22258
- sheetId: this.env.model.getters.getActiveSheetId(),
22264
+ sheetId: this.sheetId,
22259
22265
  cols: cols.has(index) ? [...cols] : [index],
22260
22266
  });
22261
22267
  }
@@ -22266,7 +22272,7 @@ class ColResizer extends AbstractResizer {
22266
22272
  return this.env.model.getters.getActiveCols();
22267
22273
  }
22268
22274
  _getPreviousVisibleElement(index) {
22269
- const sheetId = this.env.model.getters.getActiveSheetId();
22275
+ const sheetId = this.sheetId;
22270
22276
  let row;
22271
22277
  for (row = index - 1; row >= 0; row--) {
22272
22278
  if (!this.env.model.getters.isColHidden(sheetId, row)) {
@@ -22277,7 +22283,7 @@ class ColResizer extends AbstractResizer {
22277
22283
  }
22278
22284
  unhide(hiddenElements) {
22279
22285
  this.env.model.dispatch("UNHIDE_COLUMNS_ROWS", {
22280
- sheetId: this.env.model.getters.getActiveSheetId(),
22286
+ sheetId: this.sheetId,
22281
22287
  elements: hiddenElements,
22282
22288
  dimension: "COL",
22283
22289
  });
@@ -22294,7 +22300,7 @@ css /* scss */ `
22294
22300
  left: 0;
22295
22301
  right: 0;
22296
22302
  width: ${HEADER_WIDTH}px;
22297
- height: 100%;
22303
+ height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px);
22298
22304
  &.o-dragging {
22299
22305
  cursor: grabbing;
22300
22306
  }
@@ -22357,6 +22363,9 @@ class RowResizer extends AbstractResizer {
22357
22363
  this.MAX_SIZE_MARGIN = 60;
22358
22364
  this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
22359
22365
  }
22366
+ get sheetId() {
22367
+ return this.env.model.getters.getActiveSheetId();
22368
+ }
22360
22369
  _getEvOffset(ev) {
22361
22370
  return ev.offsetY;
22362
22371
  }
@@ -22379,10 +22388,10 @@ class RowResizer extends AbstractResizer {
22379
22388
  return this.env.model.getters.getEdgeScrollRow(position, position, position);
22380
22389
  }
22381
22390
  _getDimensionsInViewport(index) {
22382
- return this.env.model.getters.getRowDimensionsInViewport(this.env.model.getters.getActiveSheetId(), index);
22391
+ return this.env.model.getters.getRowDimensionsInViewport(this.sheetId, index);
22383
22392
  }
22384
22393
  _getElementSize(index) {
22385
- return this.env.model.getters.getRowSize(this.env.model.getters.getActiveSheetId(), index);
22394
+ return this.env.model.getters.getRowSize(this.sheetId, index);
22386
22395
  }
22387
22396
  _getMaxSize() {
22388
22397
  return this.rowResizerRef.el.clientHeight;
@@ -22393,7 +22402,7 @@ class RowResizer extends AbstractResizer {
22393
22402
  const rows = this.env.model.getters.getActiveRows();
22394
22403
  this.env.model.dispatch("RESIZE_COLUMNS_ROWS", {
22395
22404
  dimension: "ROW",
22396
- sheetId: this.env.model.getters.getActiveSheetId(),
22405
+ sheetId: this.sheetId,
22397
22406
  elements: rows.has(index) ? [...rows] : [index],
22398
22407
  size,
22399
22408
  });
@@ -22406,7 +22415,7 @@ class RowResizer extends AbstractResizer {
22406
22415
  elements.push(rowIndex);
22407
22416
  }
22408
22417
  const result = this.env.model.dispatch("MOVE_COLUMNS_ROWS", {
22409
- sheetId: this.env.model.getters.getActiveSheetId(),
22418
+ sheetId: this.sheetId,
22410
22419
  dimension: "ROW",
22411
22420
  base: this.state.base,
22412
22421
  elements,
@@ -22425,7 +22434,7 @@ class RowResizer extends AbstractResizer {
22425
22434
  _fitElementSize(index) {
22426
22435
  const rows = this.env.model.getters.getActiveRows();
22427
22436
  this.env.model.dispatch("AUTORESIZE_ROWS", {
22428
- sheetId: this.env.model.getters.getActiveSheetId(),
22437
+ sheetId: this.sheetId,
22429
22438
  rows: rows.has(index) ? [...rows] : [index],
22430
22439
  });
22431
22440
  }
@@ -22436,7 +22445,7 @@ class RowResizer extends AbstractResizer {
22436
22445
  return this.env.model.getters.getActiveRows();
22437
22446
  }
22438
22447
  _getPreviousVisibleElement(index) {
22439
- const sheetId = this.env.model.getters.getActiveSheetId();
22448
+ const sheetId = this.sheetId;
22440
22449
  let row;
22441
22450
  for (row = index - 1; row >= 0; row--) {
22442
22451
  if (!this.env.model.getters.isRowHidden(sheetId, row)) {
@@ -22447,7 +22456,7 @@ class RowResizer extends AbstractResizer {
22447
22456
  }
22448
22457
  unhide(hiddenElements) {
22449
22458
  this.env.model.dispatch("UNHIDE_COLUMNS_ROWS", {
22450
- sheetId: this.env.model.getters.getActiveSheetId(),
22459
+ sheetId: this.sheetId,
22451
22460
  dimension: "ROW",
22452
22461
  elements: hiddenElements,
22453
22462
  });
@@ -25525,29 +25534,33 @@ function applyStyleToZone(appliedStyle, zone, cells, styles) {
25525
25534
  * In all the sheets, replace the table-only references in the formula cells with standard references.
25526
25535
  */
25527
25536
  function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
25528
- for (let sheet of convertedSheets) {
25529
- const tables = xlsxSheets.find((s) => s.sheetName === sheet.name).tables;
25537
+ for (let tableSheet of convertedSheets) {
25538
+ const tables = xlsxSheets.find((s) => s.sheetName === tableSheet.name).tables;
25530
25539
  for (let table of tables) {
25531
25540
  const tabRef = table.name + "[";
25532
- for (let position of positions(toZone(table.ref))) {
25533
- const xc = toXC(position.col, position.row);
25534
- const cell = sheet.cells[xc];
25535
- if (cell && cell.content && cell.content.startsWith("=")) {
25536
- let refIndex;
25537
- while ((refIndex = cell.content.indexOf(tabRef)) !== -1) {
25538
- let reference = cell.content.slice(refIndex + tabRef.length);
25539
- // Expression can either be tableName[colName] or tableName[[#This Row], [colName]]
25540
- let endIndex = reference.indexOf("]");
25541
- if (reference.startsWith(`[`)) {
25542
- endIndex = reference.indexOf("]", endIndex + 1);
25543
- endIndex = reference.indexOf("]", endIndex + 1);
25541
+ for (let sheet of convertedSheets) {
25542
+ for (let xc in sheet.cells) {
25543
+ const cell = sheet.cells[xc];
25544
+ if (cell && cell.content && cell.content.startsWith("=")) {
25545
+ let refIndex;
25546
+ while ((refIndex = cell.content.indexOf(tabRef)) !== -1) {
25547
+ let endIndex = refIndex + tabRef.length;
25548
+ let openBrackets = 1;
25549
+ while (openBrackets > 0 && endIndex < cell.content.length) {
25550
+ if (cell.content[endIndex] === "[") {
25551
+ openBrackets++;
25552
+ }
25553
+ else if (cell.content[endIndex] === "]") {
25554
+ openBrackets--;
25555
+ }
25556
+ endIndex++;
25557
+ }
25558
+ let reference = cell.content.slice(refIndex + tabRef.length, endIndex - 1);
25559
+ const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
25560
+ const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
25561
+ cell.content =
25562
+ cell.content.slice(0, refIndex) + convertedRef + cell.content.slice(endIndex);
25544
25563
  }
25545
- reference = reference.slice(0, endIndex);
25546
- const convertedRef = convertTableReference(reference, table, xc);
25547
- cell.content =
25548
- cell.content.slice(0, refIndex) +
25549
- convertedRef +
25550
- cell.content.slice(tabRef.length + refIndex + endIndex + 1);
25551
25564
  }
25552
25565
  }
25553
25566
  }
@@ -25555,11 +25568,17 @@ function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
25555
25568
  }
25556
25569
  }
25557
25570
  /**
25558
- * Convert table-specific references in formulas into standard references.
25571
+ * Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
25572
+ * and of keywords determining the rows of the table to reference.
25559
25573
  *
25560
25574
  * A reference in a table can have the form (only the part between brackets should be given to this function):
25561
25575
  * - tableName[colName] : reference to the whole column "colName"
25576
+ * - tableName[#keyword] : reference to the whatever row the keyword refers to
25562
25577
  * - tableName[[#keyword], [colName]] : reference to some of the element(s) of the column colName
25578
+ * - tableName[[#keyword], [colName]:[col2Name]] : reference to some of the element(s) of the columns colName to col2Name
25579
+ * - tableName[[#keyword1], [#keyword2], [colName]] : reference to all the rows referenced by the keywords in the column colName
25580
+ * - tableName[[#keyword1], [colName], [#keyword2]]: the keywords and colName can be in any order
25581
+ *
25563
25582
  *
25564
25583
  * The available keywords are :
25565
25584
  * - #All : all the column (including totals)
@@ -25567,58 +25586,109 @@ function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
25567
25586
  * - #Headers : only the header of the column
25568
25587
  * - #Totals : only the totals of the column
25569
25588
  * - #This Row : only the element in the same row as the cell
25589
+ *
25590
+ * Note that the only valid combination of multiple keywords are #Data + #Totals and #Headers + #Data.
25570
25591
  */
25571
- function convertTableReference(expr, table, cellXc) {
25572
- const refElements = expr.split(",");
25592
+ function convertTableReference(sheetPrefix, expr, table, cellXc) {
25593
+ // TODO: Ideally we'd want to make a real tokenizer, this simple approach won't work if for example the column name
25594
+ // contain # or , characters. But that's probably an edge case that we can ignore for now.
25595
+ const parts = expr.split(",").map((part) => part.trim());
25573
25596
  const tableZone = toZone(table.ref);
25574
- const refZone = { ...tableZone };
25575
- let isReferencedZoneValid = true;
25576
- // Single column reference
25577
- if (refElements.length === 1) {
25578
- const colRelativeIndex = table.cols.findIndex((col) => col.name === refElements[0]);
25579
- refZone.left = refZone.right = colRelativeIndex + tableZone.left;
25580
- if (table.headerRowCount) {
25581
- refZone.top += table.headerRowCount;
25582
- }
25583
- if (table.totalsRowCount) {
25584
- refZone.bottom -= 1;
25597
+ const colIndexes = [];
25598
+ const rowIndexes = [];
25599
+ const foundKeywords = [];
25600
+ for (const part of parts) {
25601
+ if (removeBrackets(part).startsWith("#")) {
25602
+ const keyWord = removeBrackets(part);
25603
+ foundKeywords.push(keyWord);
25604
+ switch (keyWord) {
25605
+ case "#All":
25606
+ rowIndexes.push(tableZone.top, tableZone.bottom);
25607
+ break;
25608
+ case "#Data":
25609
+ const top = table.headerRowCount ? tableZone.top + table.headerRowCount : tableZone.top;
25610
+ const bottom = table.totalsRowCount
25611
+ ? tableZone.bottom - table.totalsRowCount
25612
+ : tableZone.bottom;
25613
+ rowIndexes.push(top, bottom);
25614
+ break;
25615
+ case "#This Row":
25616
+ rowIndexes.push(toCartesian(cellXc).row);
25617
+ break;
25618
+ case "#Headers":
25619
+ if (!table.headerRowCount) {
25620
+ return INCORRECT_RANGE_STRING;
25621
+ }
25622
+ rowIndexes.push(tableZone.top);
25623
+ break;
25624
+ case "#Totals":
25625
+ if (!table.totalsRowCount) {
25626
+ return INCORRECT_RANGE_STRING;
25627
+ }
25628
+ rowIndexes.push(tableZone.bottom);
25629
+ break;
25630
+ }
25585
25631
  }
25586
- }
25587
- // Other references
25588
- else {
25589
- switch (refElements[0].slice(1, refElements[0].length - 1)) {
25590
- case "#All":
25591
- refZone.top = table.headerRowCount ? tableZone.top + table.headerRowCount : tableZone.top;
25592
- refZone.bottom = tableZone.bottom;
25593
- break;
25594
- case "#Data":
25595
- refZone.top = table.headerRowCount ? tableZone.top + table.headerRowCount : tableZone.top;
25596
- refZone.bottom = table.totalsRowCount ? tableZone.bottom + 1 : tableZone.bottom;
25597
- break;
25598
- case "#This Row":
25599
- refZone.top = refZone.bottom = toCartesian(cellXc).row;
25600
- break;
25601
- case "#Headers":
25602
- refZone.top = refZone.bottom = tableZone.top;
25603
- if (!table.headerRowCount) {
25604
- isReferencedZoneValid = false;
25605
- }
25606
- break;
25607
- case "#Totals":
25608
- refZone.top = refZone.bottom = tableZone.bottom;
25609
- if (!table.totalsRowCount) {
25610
- isReferencedZoneValid = false;
25632
+ else {
25633
+ const columns = part
25634
+ .split(":")
25635
+ .map((part) => part.trim())
25636
+ .map(removeBrackets);
25637
+ if (colIndexes.length) {
25638
+ return INCORRECT_RANGE_STRING;
25639
+ }
25640
+ const colRelativeIndex = table.cols.findIndex((col) => col.name === columns[0]);
25641
+ if (colRelativeIndex === -1) {
25642
+ return INCORRECT_RANGE_STRING;
25643
+ }
25644
+ colIndexes.push(colRelativeIndex + tableZone.left);
25645
+ if (columns[1]) {
25646
+ const colRelativeIndex2 = table.cols.findIndex((col) => col.name === columns[1]);
25647
+ if (colRelativeIndex2 === -1) {
25648
+ return INCORRECT_RANGE_STRING;
25611
25649
  }
25612
- break;
25650
+ colIndexes.push(colRelativeIndex2 + tableZone.left);
25651
+ }
25613
25652
  }
25614
- const colRef = refElements[1].slice(1, refElements[1].length - 1);
25615
- const colRelativeIndex = table.cols.findIndex((col) => col.name === colRef);
25616
- refZone.left = refZone.right = colRelativeIndex + tableZone.left;
25617
25653
  }
25618
- if (!isReferencedZoneValid) {
25654
+ if (!areKeywordsCompatible(foundKeywords)) {
25619
25655
  return INCORRECT_RANGE_STRING;
25620
25656
  }
25621
- return refZone.top !== refZone.bottom ? zoneToXc(refZone) : toXC(refZone.left, refZone.top);
25657
+ if (rowIndexes.length === 0) {
25658
+ const top = table.headerRowCount ? tableZone.top + table.headerRowCount : tableZone.top;
25659
+ const bottom = table.totalsRowCount
25660
+ ? tableZone.bottom - table.totalsRowCount
25661
+ : tableZone.bottom;
25662
+ rowIndexes.push(top, bottom);
25663
+ }
25664
+ if (colIndexes.length === 0) {
25665
+ colIndexes.push(tableZone.left, tableZone.right);
25666
+ }
25667
+ const refZone = {
25668
+ top: Math.min(...rowIndexes),
25669
+ left: Math.min(...colIndexes),
25670
+ bottom: Math.max(...rowIndexes),
25671
+ right: Math.max(...colIndexes),
25672
+ };
25673
+ return sheetPrefix + zoneToXc(refZone);
25674
+ }
25675
+ function removeBrackets(str) {
25676
+ return str.startsWith("[") && str.endsWith("]") ? str.slice(1, str.length - 1) : str;
25677
+ }
25678
+ function areKeywordsCompatible(keywords) {
25679
+ if (keywords.length < 2) {
25680
+ return true;
25681
+ }
25682
+ else if (keywords.length > 2) {
25683
+ return false;
25684
+ }
25685
+ else if (keywords.includes("#Data") && keywords.includes("#Totals")) {
25686
+ return true;
25687
+ }
25688
+ else if (keywords.includes("#Headers") && keywords.includes("#Data")) {
25689
+ return true;
25690
+ }
25691
+ return false;
25622
25692
  }
25623
25693
 
25624
25694
  // -------------------------------------
@@ -31596,7 +31666,7 @@ class AutofillPlugin extends UIPlugin {
31596
31666
  getRule(cell, cells) {
31597
31667
  const rules = autofillRulesRegistry.getAll().sort((a, b) => a.sequence - b.sequence);
31598
31668
  const rule = rules.find((rule) => rule.condition(cell, cells));
31599
- return rule && rule.generateRule(cell, cells);
31669
+ return rule && this.direction && rule.generateRule(cell, cells, this.direction);
31600
31670
  }
31601
31671
  /**
31602
31672
  * Create the generator to be able to autofill the next cells.
@@ -32379,12 +32449,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
32379
32449
  for (let c = 0; c < width; c++) {
32380
32450
  const origin = rowCells[c];
32381
32451
  const position = { col: col + c, row: row + r, sheetId: sheetId };
32382
- // TODO: refactor this part. the "Paste merge" action is also executed with
32383
- // MOVE_RANGES in pasteFromCut. Adding a condition on the operation type here
32384
- // is not appropriate
32385
- if (this.operation !== "CUT") {
32386
- this.pasteMergeIfExist(origin.position, position);
32387
- }
32452
+ this.pasteMergeIfExist(origin.position, position, this.operation);
32388
32453
  this.pasteCell(origin, position, this.operation, clipboardOptions);
32389
32454
  if (shouldPasteCF) {
32390
32455
  this.dispatch("PASTE_CONDITIONAL_FORMAT", {
@@ -32463,7 +32528,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
32463
32528
  * If the origin position given is the top left of a merge, merge the target
32464
32529
  * position.
32465
32530
  */
32466
- pasteMergeIfExist(origin, target) {
32531
+ pasteMergeIfExist(origin, target, operation) {
32467
32532
  let { sheetId, col, row } = origin;
32468
32533
  const { col: mainCellColOrigin, row: mainCellRowOrigin } = this.getters.getMainCellPosition(sheetId, col, row);
32469
32534
  if (mainCellColOrigin === col && mainCellRowOrigin === row) {
@@ -32471,6 +32536,9 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
32471
32536
  if (!merge) {
32472
32537
  return;
32473
32538
  }
32539
+ if (operation === "CUT") {
32540
+ this.dispatch("REMOVE_MERGE", { sheetId, target: [merge] });
32541
+ }
32474
32542
  ({ sheetId, col, row } = target);
32475
32543
  this.dispatch("ADD_MERGE", {
32476
32544
  sheetId,
@@ -37498,7 +37566,8 @@ class SheetViewPlugin extends UIPlugin {
37498
37566
  ? this.getters.getSheetViewVisibleCols()
37499
37567
  : this.getters.getSheetViewVisibleRows();
37500
37568
  const startIndex = visibleHeaders.findIndex((header) => referenceHeaderIndex >= header);
37501
- const endIndex = visibleHeaders.findIndex((header) => targetHeaderIndex <= header);
37569
+ let endIndex = visibleHeaders.findIndex((header) => targetHeaderIndex <= header);
37570
+ endIndex = endIndex === -1 ? visibleHeaders.length : endIndex;
37502
37571
  const relevantIndexes = visibleHeaders.slice(startIndex, endIndex);
37503
37572
  let offset = 0;
37504
37573
  for (const i of relevantIndexes) {
@@ -43691,6 +43760,6 @@ exports.setTranslationMethod = setTranslationMethod;
43691
43760
  exports.tokenize = tokenize;
43692
43761
 
43693
43762
 
43694
- __info__.version = '16.0.63';
43695
- __info__.date = '2025-02-25T05:54:41.386Z';
43696
- __info__.hash = 'b01aca6';
43763
+ __info__.version = '16.0.65';
43764
+ __info__.date = '2025-03-19T08:14:11.320Z';
43765
+ __info__.hash = '4e495e9';
@@ -5207,7 +5207,7 @@ declare class MenuItemRegistry extends Registry<FullMenuItem> {
5207
5207
  */
5208
5208
  interface AutofillRule {
5209
5209
  condition: (cell: Cell, cells: (Cell | undefined)[]) => boolean;
5210
- generateRule: (cell: Cell, cells: (Cell | undefined)[]) => AutofillModifier;
5210
+ generateRule: (cell: Cell, cells: (Cell | undefined)[], direction: DIRECTION) => AutofillModifier;
5211
5211
  sequence: number;
5212
5212
  }
5213
5213
 
@@ -5939,6 +5939,7 @@ declare class ColResizer extends AbstractResizer {
5939
5939
  static template: string;
5940
5940
  private colResizerRef;
5941
5941
  setup(): void;
5942
+ get sheetId(): UID;
5942
5943
  _getEvOffset(ev: MouseEvent): Pixel;
5943
5944
  _getViewportOffset(): Pixel;
5944
5945
  _getClientPosition(ev: MouseEvent): Pixel;
@@ -5964,6 +5965,7 @@ declare class RowResizer extends AbstractResizer {
5964
5965
  static template: string;
5965
5966
  setup(): void;
5966
5967
  private rowResizerRef;
5968
+ get sheetId(): UID;
5967
5969
  _getEvOffset(ev: MouseEvent): Pixel;
5968
5970
  _getViewportOffset(): Pixel;
5969
5971
  _getClientPosition(ev: MouseEvent): Pixel;