@odoo/o-spreadsheet 16.2.31 → 16.2.33

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.
@@ -16889,7 +16889,7 @@ class SelectionInput extends owl.Component {
16889
16889
  : this.props.ranges
16890
16890
  ? this.props.ranges.map((xc, id) => ({
16891
16891
  xc,
16892
- id,
16892
+ id: id + 1,
16893
16893
  isFocused: false,
16894
16894
  }))
16895
16895
  : [];
@@ -28203,9 +28203,9 @@ class CellPlugin extends CorePlugin {
28203
28203
  allowDispatch(cmd) {
28204
28204
  switch (cmd.type) {
28205
28205
  case "UPDATE_CELL":
28206
- return this.checkCellOutOfSheet(cmd);
28206
+ return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
28207
28207
  case "CLEAR_CELL":
28208
- return this.checkValidations(cmd, this.chainValidations(this.checkCellOutOfSheet, this.checkUselessClearCell));
28208
+ return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
28209
28209
  default:
28210
28210
  return 0 /* CommandResult.Success */;
28211
28211
  }
@@ -28500,7 +28500,7 @@ class CellPlugin extends CorePlugin {
28500
28500
  else {
28501
28501
  style = before ? before.style : undefined;
28502
28502
  }
28503
- let format = ("format" in after ? after.format : before && before.format) || detectFormat(afterContent);
28503
+ const format = "format" in after ? after.format : before && before.format;
28504
28504
  /* Read the following IF as:
28505
28505
  * we need to remove the cell if it is completely empty, but we can know if it completely empty if:
28506
28506
  * - the command says the new content is empty and has no border/format/style
@@ -28544,7 +28544,7 @@ class CellPlugin extends CorePlugin {
28544
28544
  id,
28545
28545
  content,
28546
28546
  style,
28547
- format,
28547
+ format: format || detectFormat(content),
28548
28548
  isFormula: false,
28549
28549
  };
28550
28550
  }
@@ -28621,6 +28621,18 @@ class CellPlugin extends CorePlugin {
28621
28621
  }
28622
28622
  return 0 /* CommandResult.Success */;
28623
28623
  }
28624
+ checkUselessUpdateCell(cmd) {
28625
+ const cell = this.getters.getCell(cmd);
28626
+ const hasContent = "content" in cmd || "formula" in cmd;
28627
+ const hasStyle = "style" in cmd;
28628
+ const hasFormat = "format" in cmd;
28629
+ if ((!hasContent || (cell === null || cell === void 0 ? void 0 : cell.content) === cmd.content) &&
28630
+ (!hasStyle || deepEquals(cell === null || cell === void 0 ? void 0 : cell.style, cmd.style)) &&
28631
+ (!hasFormat || (cell === null || cell === void 0 ? void 0 : cell.format) === cmd.format)) {
28632
+ return 89 /* CommandResult.NoChanges */;
28633
+ }
28634
+ return 0 /* CommandResult.Success */;
28635
+ }
28624
28636
  }
28625
28637
  CellPlugin.getters = [
28626
28638
  "zoneToXC",
@@ -34275,8 +34287,7 @@ class AutofillPlugin extends UIPlugin {
34275
34287
  let row = zone.bottom;
34276
34288
  if (col > 0) {
34277
34289
  let leftPosition = { sheetId, col: col - 1, row };
34278
- while (this.getters.getEvaluatedCell(leftPosition).type !== CellValueType.empty ||
34279
- ((_a = this.getters.getCell(leftPosition)) === null || _a === void 0 ? void 0 : _a.content)) {
34290
+ while ((_a = this.getters.getCell(leftPosition)) === null || _a === void 0 ? void 0 : _a.content) {
34280
34291
  row += 1;
34281
34292
  leftPosition = { sheetId, col: col - 1, row };
34282
34293
  }
@@ -34285,8 +34296,7 @@ class AutofillPlugin extends UIPlugin {
34285
34296
  col = zone.right;
34286
34297
  if (col <= this.getters.getNumberCols(sheetId)) {
34287
34298
  let rightPosition = { sheetId, col: col + 1, row };
34288
- while (this.getters.getEvaluatedCell(rightPosition).type !== CellValueType.empty ||
34289
- ((_b = this.getters.getCell(rightPosition)) === null || _b === void 0 ? void 0 : _b.content)) {
34299
+ while ((_b = this.getters.getCell(rightPosition)) === null || _b === void 0 ? void 0 : _b.content) {
34290
34300
  row += 1;
34291
34301
  rightPosition = { sheetId, col: col + 1, row };
34292
34302
  }
@@ -36186,9 +36196,9 @@ class SelectionInputsManagerPlugin extends UIPlugin {
36186
36196
  break;
36187
36197
  case "FOCUS_RANGE":
36188
36198
  case "CHANGE_RANGE":
36189
- if (cmd.id !== this.focusedInputId) {
36190
- const input = this.inputs[cmd.id];
36191
- const range = input.ranges.find((range) => range.id === cmd.rangeId);
36199
+ const input = this.inputs[cmd.id];
36200
+ const range = input.ranges.find((range) => range.id === cmd.rangeId);
36201
+ if (range) {
36192
36202
  const sheetId = this.getters.getActiveSheetId();
36193
36203
  const zone = this.getters.getRangeFromSheetXC(sheetId, (range === null || range === void 0 ? void 0 : range.xc) || "A1").zone;
36194
36204
  this.selection.capture(input, { cell: { col: zone.left, row: zone.top }, zone }, { handleEvent: input.handleEvent.bind(input) });
@@ -43564,11 +43574,10 @@ class SelectionStreamProcessorImpl {
43564
43574
  * next cluster if the given cell is outside a cluster or at the border of a cluster in the given direction.
43565
43575
  */
43566
43576
  getEndOfCluster(startPosition, dim, dir) {
43567
- const sheet = this.getters.getActiveSheet();
43568
43577
  let currentPosition = startPosition;
43569
43578
  // If both the current cell and the next cell are not empty, we want to go to the end of the cluster
43570
43579
  const nextCellPosition = this.getNextCellPosition(startPosition, dim, dir);
43571
- let mode = !this.isCellEmpty(currentPosition, sheet.id) && !this.isCellEmpty(nextCellPosition, sheet.id)
43580
+ let mode = !this.isEvaluatedCellEmpty(currentPosition) && !this.isEvaluatedCellEmpty(nextCellPosition)
43572
43581
  ? "endOfCluster"
43573
43582
  : "nextCluster";
43574
43583
  while (true) {
@@ -43578,7 +43587,7 @@ class SelectionStreamProcessorImpl {
43578
43587
  currentPosition.row === nextCellPosition.row) {
43579
43588
  break;
43580
43589
  }
43581
- const isNextCellEmpty = this.isCellEmpty(nextCellPosition, sheet.id);
43590
+ const isNextCellEmpty = this.isEvaluatedCellEmpty(nextCellPosition);
43582
43591
  if (mode === "endOfCluster" && isNextCellEmpty) {
43583
43592
  break;
43584
43593
  }
@@ -43592,14 +43601,25 @@ class SelectionStreamProcessorImpl {
43592
43601
  return dim === "cols" ? currentPosition.col : currentPosition.row;
43593
43602
  }
43594
43603
  /**
43595
- * Check if a cell is empty or undefined in the model. If the cell is part of a merge,
43596
- * check if the merge containing the cell is empty.
43604
+ * Check if a cell evaluated value is empty. If the cell is part of a merge,
43605
+ * the check applies to the main cell of the merge.
43597
43606
  */
43598
- isCellEmpty({ col, row }, sheetId = this.getters.getActiveSheetId()) {
43607
+ isEvaluatedCellEmpty({ col, row }) {
43608
+ const sheetId = this.getters.getActiveSheetId();
43599
43609
  const position = this.getters.getMainCellPosition({ sheetId, col, row });
43600
43610
  const cell = this.getters.getEvaluatedCell(position);
43601
43611
  return cell.type === CellValueType.empty;
43602
43612
  }
43613
+ /**
43614
+ * Checks if a cell is empty (i.e. does not have a content). If the cell is part of a merge,
43615
+ * the check applies to the main cell of the merge.
43616
+ */
43617
+ isCellEmpty({ col, row }) {
43618
+ var _a;
43619
+ const sheetId = this.getters.getActiveSheetId();
43620
+ const position = this.getters.getMainCellPosition({ sheetId, col, row });
43621
+ return !((_a = this.getters.getCell(position)) === null || _a === void 0 ? void 0 : _a.content);
43622
+ }
43603
43623
  /** Computes the next cell position in the given direction by crossing through merges and skipping hidden cells.
43604
43624
  *
43605
43625
  * This has the same behaviour as getNextAvailablePosition() for certain arguments, but use this method instead
@@ -45771,6 +45791,6 @@ exports.setTranslationMethod = setTranslationMethod;
45771
45791
  exports.tokenize = tokenize;
45772
45792
 
45773
45793
 
45774
- __info__.version = '16.2.31';
45775
- __info__.date = '2024-02-09T13:05:40.161Z';
45776
- __info__.hash = '2e76bdf';
45794
+ __info__.version = '16.2.33';
45795
+ __info__.date = '2024-02-28T12:25:47.181Z';
45796
+ __info__.hash = '52d01b2';
@@ -3168,6 +3168,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3168
3168
  private createErrorFormula;
3169
3169
  private checkCellOutOfSheet;
3170
3170
  private checkUselessClearCell;
3171
+ private checkUselessUpdateCell;
3171
3172
  }
3172
3173
 
3173
3174
  /**
@@ -16885,7 +16885,7 @@ class SelectionInput extends Component {
16885
16885
  : this.props.ranges
16886
16886
  ? this.props.ranges.map((xc, id) => ({
16887
16887
  xc,
16888
- id,
16888
+ id: id + 1,
16889
16889
  isFocused: false,
16890
16890
  }))
16891
16891
  : [];
@@ -28199,9 +28199,9 @@ class CellPlugin extends CorePlugin {
28199
28199
  allowDispatch(cmd) {
28200
28200
  switch (cmd.type) {
28201
28201
  case "UPDATE_CELL":
28202
- return this.checkCellOutOfSheet(cmd);
28202
+ return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
28203
28203
  case "CLEAR_CELL":
28204
- return this.checkValidations(cmd, this.chainValidations(this.checkCellOutOfSheet, this.checkUselessClearCell));
28204
+ return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
28205
28205
  default:
28206
28206
  return 0 /* CommandResult.Success */;
28207
28207
  }
@@ -28496,7 +28496,7 @@ class CellPlugin extends CorePlugin {
28496
28496
  else {
28497
28497
  style = before ? before.style : undefined;
28498
28498
  }
28499
- let format = ("format" in after ? after.format : before && before.format) || detectFormat(afterContent);
28499
+ const format = "format" in after ? after.format : before && before.format;
28500
28500
  /* Read the following IF as:
28501
28501
  * we need to remove the cell if it is completely empty, but we can know if it completely empty if:
28502
28502
  * - the command says the new content is empty and has no border/format/style
@@ -28540,7 +28540,7 @@ class CellPlugin extends CorePlugin {
28540
28540
  id,
28541
28541
  content,
28542
28542
  style,
28543
- format,
28543
+ format: format || detectFormat(content),
28544
28544
  isFormula: false,
28545
28545
  };
28546
28546
  }
@@ -28617,6 +28617,18 @@ class CellPlugin extends CorePlugin {
28617
28617
  }
28618
28618
  return 0 /* CommandResult.Success */;
28619
28619
  }
28620
+ checkUselessUpdateCell(cmd) {
28621
+ const cell = this.getters.getCell(cmd);
28622
+ const hasContent = "content" in cmd || "formula" in cmd;
28623
+ const hasStyle = "style" in cmd;
28624
+ const hasFormat = "format" in cmd;
28625
+ if ((!hasContent || (cell === null || cell === void 0 ? void 0 : cell.content) === cmd.content) &&
28626
+ (!hasStyle || deepEquals(cell === null || cell === void 0 ? void 0 : cell.style, cmd.style)) &&
28627
+ (!hasFormat || (cell === null || cell === void 0 ? void 0 : cell.format) === cmd.format)) {
28628
+ return 89 /* CommandResult.NoChanges */;
28629
+ }
28630
+ return 0 /* CommandResult.Success */;
28631
+ }
28620
28632
  }
28621
28633
  CellPlugin.getters = [
28622
28634
  "zoneToXC",
@@ -34271,8 +34283,7 @@ class AutofillPlugin extends UIPlugin {
34271
34283
  let row = zone.bottom;
34272
34284
  if (col > 0) {
34273
34285
  let leftPosition = { sheetId, col: col - 1, row };
34274
- while (this.getters.getEvaluatedCell(leftPosition).type !== CellValueType.empty ||
34275
- ((_a = this.getters.getCell(leftPosition)) === null || _a === void 0 ? void 0 : _a.content)) {
34286
+ while ((_a = this.getters.getCell(leftPosition)) === null || _a === void 0 ? void 0 : _a.content) {
34276
34287
  row += 1;
34277
34288
  leftPosition = { sheetId, col: col - 1, row };
34278
34289
  }
@@ -34281,8 +34292,7 @@ class AutofillPlugin extends UIPlugin {
34281
34292
  col = zone.right;
34282
34293
  if (col <= this.getters.getNumberCols(sheetId)) {
34283
34294
  let rightPosition = { sheetId, col: col + 1, row };
34284
- while (this.getters.getEvaluatedCell(rightPosition).type !== CellValueType.empty ||
34285
- ((_b = this.getters.getCell(rightPosition)) === null || _b === void 0 ? void 0 : _b.content)) {
34295
+ while ((_b = this.getters.getCell(rightPosition)) === null || _b === void 0 ? void 0 : _b.content) {
34286
34296
  row += 1;
34287
34297
  rightPosition = { sheetId, col: col + 1, row };
34288
34298
  }
@@ -36182,9 +36192,9 @@ class SelectionInputsManagerPlugin extends UIPlugin {
36182
36192
  break;
36183
36193
  case "FOCUS_RANGE":
36184
36194
  case "CHANGE_RANGE":
36185
- if (cmd.id !== this.focusedInputId) {
36186
- const input = this.inputs[cmd.id];
36187
- const range = input.ranges.find((range) => range.id === cmd.rangeId);
36195
+ const input = this.inputs[cmd.id];
36196
+ const range = input.ranges.find((range) => range.id === cmd.rangeId);
36197
+ if (range) {
36188
36198
  const sheetId = this.getters.getActiveSheetId();
36189
36199
  const zone = this.getters.getRangeFromSheetXC(sheetId, (range === null || range === void 0 ? void 0 : range.xc) || "A1").zone;
36190
36200
  this.selection.capture(input, { cell: { col: zone.left, row: zone.top }, zone }, { handleEvent: input.handleEvent.bind(input) });
@@ -43560,11 +43570,10 @@ class SelectionStreamProcessorImpl {
43560
43570
  * next cluster if the given cell is outside a cluster or at the border of a cluster in the given direction.
43561
43571
  */
43562
43572
  getEndOfCluster(startPosition, dim, dir) {
43563
- const sheet = this.getters.getActiveSheet();
43564
43573
  let currentPosition = startPosition;
43565
43574
  // If both the current cell and the next cell are not empty, we want to go to the end of the cluster
43566
43575
  const nextCellPosition = this.getNextCellPosition(startPosition, dim, dir);
43567
- let mode = !this.isCellEmpty(currentPosition, sheet.id) && !this.isCellEmpty(nextCellPosition, sheet.id)
43576
+ let mode = !this.isEvaluatedCellEmpty(currentPosition) && !this.isEvaluatedCellEmpty(nextCellPosition)
43568
43577
  ? "endOfCluster"
43569
43578
  : "nextCluster";
43570
43579
  while (true) {
@@ -43574,7 +43583,7 @@ class SelectionStreamProcessorImpl {
43574
43583
  currentPosition.row === nextCellPosition.row) {
43575
43584
  break;
43576
43585
  }
43577
- const isNextCellEmpty = this.isCellEmpty(nextCellPosition, sheet.id);
43586
+ const isNextCellEmpty = this.isEvaluatedCellEmpty(nextCellPosition);
43578
43587
  if (mode === "endOfCluster" && isNextCellEmpty) {
43579
43588
  break;
43580
43589
  }
@@ -43588,14 +43597,25 @@ class SelectionStreamProcessorImpl {
43588
43597
  return dim === "cols" ? currentPosition.col : currentPosition.row;
43589
43598
  }
43590
43599
  /**
43591
- * Check if a cell is empty or undefined in the model. If the cell is part of a merge,
43592
- * check if the merge containing the cell is empty.
43600
+ * Check if a cell evaluated value is empty. If the cell is part of a merge,
43601
+ * the check applies to the main cell of the merge.
43593
43602
  */
43594
- isCellEmpty({ col, row }, sheetId = this.getters.getActiveSheetId()) {
43603
+ isEvaluatedCellEmpty({ col, row }) {
43604
+ const sheetId = this.getters.getActiveSheetId();
43595
43605
  const position = this.getters.getMainCellPosition({ sheetId, col, row });
43596
43606
  const cell = this.getters.getEvaluatedCell(position);
43597
43607
  return cell.type === CellValueType.empty;
43598
43608
  }
43609
+ /**
43610
+ * Checks if a cell is empty (i.e. does not have a content). If the cell is part of a merge,
43611
+ * the check applies to the main cell of the merge.
43612
+ */
43613
+ isCellEmpty({ col, row }) {
43614
+ var _a;
43615
+ const sheetId = this.getters.getActiveSheetId();
43616
+ const position = this.getters.getMainCellPosition({ sheetId, col, row });
43617
+ return !((_a = this.getters.getCell(position)) === null || _a === void 0 ? void 0 : _a.content);
43618
+ }
43599
43619
  /** Computes the next cell position in the given direction by crossing through merges and skipping hidden cells.
43600
43620
  *
43601
43621
  * This has the same behaviour as getNextAvailablePosition() for certain arguments, but use this method instead
@@ -45739,6 +45759,6 @@ function addFunction(functionName, functionDescription) {
45739
45759
  export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
45740
45760
 
45741
45761
 
45742
- __info__.version = '16.2.31';
45743
- __info__.date = '2024-02-09T13:05:40.161Z';
45744
- __info__.hash = '2e76bdf';
45762
+ __info__.version = '16.2.33';
45763
+ __info__.date = '2024-02-28T12:25:47.181Z';
45764
+ __info__.hash = '52d01b2';
@@ -16886,7 +16886,7 @@
16886
16886
  : this.props.ranges
16887
16887
  ? this.props.ranges.map((xc, id) => ({
16888
16888
  xc,
16889
- id,
16889
+ id: id + 1,
16890
16890
  isFocused: false,
16891
16891
  }))
16892
16892
  : [];
@@ -28200,9 +28200,9 @@
28200
28200
  allowDispatch(cmd) {
28201
28201
  switch (cmd.type) {
28202
28202
  case "UPDATE_CELL":
28203
- return this.checkCellOutOfSheet(cmd);
28203
+ return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
28204
28204
  case "CLEAR_CELL":
28205
- return this.checkValidations(cmd, this.chainValidations(this.checkCellOutOfSheet, this.checkUselessClearCell));
28205
+ return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
28206
28206
  default:
28207
28207
  return 0 /* CommandResult.Success */;
28208
28208
  }
@@ -28497,7 +28497,7 @@
28497
28497
  else {
28498
28498
  style = before ? before.style : undefined;
28499
28499
  }
28500
- let format = ("format" in after ? after.format : before && before.format) || detectFormat(afterContent);
28500
+ const format = "format" in after ? after.format : before && before.format;
28501
28501
  /* Read the following IF as:
28502
28502
  * we need to remove the cell if it is completely empty, but we can know if it completely empty if:
28503
28503
  * - the command says the new content is empty and has no border/format/style
@@ -28541,7 +28541,7 @@
28541
28541
  id,
28542
28542
  content,
28543
28543
  style,
28544
- format,
28544
+ format: format || detectFormat(content),
28545
28545
  isFormula: false,
28546
28546
  };
28547
28547
  }
@@ -28618,6 +28618,18 @@
28618
28618
  }
28619
28619
  return 0 /* CommandResult.Success */;
28620
28620
  }
28621
+ checkUselessUpdateCell(cmd) {
28622
+ const cell = this.getters.getCell(cmd);
28623
+ const hasContent = "content" in cmd || "formula" in cmd;
28624
+ const hasStyle = "style" in cmd;
28625
+ const hasFormat = "format" in cmd;
28626
+ if ((!hasContent || (cell === null || cell === void 0 ? void 0 : cell.content) === cmd.content) &&
28627
+ (!hasStyle || deepEquals(cell === null || cell === void 0 ? void 0 : cell.style, cmd.style)) &&
28628
+ (!hasFormat || (cell === null || cell === void 0 ? void 0 : cell.format) === cmd.format)) {
28629
+ return 89 /* CommandResult.NoChanges */;
28630
+ }
28631
+ return 0 /* CommandResult.Success */;
28632
+ }
28621
28633
  }
28622
28634
  CellPlugin.getters = [
28623
28635
  "zoneToXC",
@@ -34272,8 +34284,7 @@
34272
34284
  let row = zone.bottom;
34273
34285
  if (col > 0) {
34274
34286
  let leftPosition = { sheetId, col: col - 1, row };
34275
- while (this.getters.getEvaluatedCell(leftPosition).type !== CellValueType.empty ||
34276
- ((_a = this.getters.getCell(leftPosition)) === null || _a === void 0 ? void 0 : _a.content)) {
34287
+ while ((_a = this.getters.getCell(leftPosition)) === null || _a === void 0 ? void 0 : _a.content) {
34277
34288
  row += 1;
34278
34289
  leftPosition = { sheetId, col: col - 1, row };
34279
34290
  }
@@ -34282,8 +34293,7 @@
34282
34293
  col = zone.right;
34283
34294
  if (col <= this.getters.getNumberCols(sheetId)) {
34284
34295
  let rightPosition = { sheetId, col: col + 1, row };
34285
- while (this.getters.getEvaluatedCell(rightPosition).type !== CellValueType.empty ||
34286
- ((_b = this.getters.getCell(rightPosition)) === null || _b === void 0 ? void 0 : _b.content)) {
34296
+ while ((_b = this.getters.getCell(rightPosition)) === null || _b === void 0 ? void 0 : _b.content) {
34287
34297
  row += 1;
34288
34298
  rightPosition = { sheetId, col: col + 1, row };
34289
34299
  }
@@ -36183,9 +36193,9 @@
36183
36193
  break;
36184
36194
  case "FOCUS_RANGE":
36185
36195
  case "CHANGE_RANGE":
36186
- if (cmd.id !== this.focusedInputId) {
36187
- const input = this.inputs[cmd.id];
36188
- const range = input.ranges.find((range) => range.id === cmd.rangeId);
36196
+ const input = this.inputs[cmd.id];
36197
+ const range = input.ranges.find((range) => range.id === cmd.rangeId);
36198
+ if (range) {
36189
36199
  const sheetId = this.getters.getActiveSheetId();
36190
36200
  const zone = this.getters.getRangeFromSheetXC(sheetId, (range === null || range === void 0 ? void 0 : range.xc) || "A1").zone;
36191
36201
  this.selection.capture(input, { cell: { col: zone.left, row: zone.top }, zone }, { handleEvent: input.handleEvent.bind(input) });
@@ -43561,11 +43571,10 @@
43561
43571
  * next cluster if the given cell is outside a cluster or at the border of a cluster in the given direction.
43562
43572
  */
43563
43573
  getEndOfCluster(startPosition, dim, dir) {
43564
- const sheet = this.getters.getActiveSheet();
43565
43574
  let currentPosition = startPosition;
43566
43575
  // If both the current cell and the next cell are not empty, we want to go to the end of the cluster
43567
43576
  const nextCellPosition = this.getNextCellPosition(startPosition, dim, dir);
43568
- let mode = !this.isCellEmpty(currentPosition, sheet.id) && !this.isCellEmpty(nextCellPosition, sheet.id)
43577
+ let mode = !this.isEvaluatedCellEmpty(currentPosition) && !this.isEvaluatedCellEmpty(nextCellPosition)
43569
43578
  ? "endOfCluster"
43570
43579
  : "nextCluster";
43571
43580
  while (true) {
@@ -43575,7 +43584,7 @@
43575
43584
  currentPosition.row === nextCellPosition.row) {
43576
43585
  break;
43577
43586
  }
43578
- const isNextCellEmpty = this.isCellEmpty(nextCellPosition, sheet.id);
43587
+ const isNextCellEmpty = this.isEvaluatedCellEmpty(nextCellPosition);
43579
43588
  if (mode === "endOfCluster" && isNextCellEmpty) {
43580
43589
  break;
43581
43590
  }
@@ -43589,14 +43598,25 @@
43589
43598
  return dim === "cols" ? currentPosition.col : currentPosition.row;
43590
43599
  }
43591
43600
  /**
43592
- * Check if a cell is empty or undefined in the model. If the cell is part of a merge,
43593
- * check if the merge containing the cell is empty.
43601
+ * Check if a cell evaluated value is empty. If the cell is part of a merge,
43602
+ * the check applies to the main cell of the merge.
43594
43603
  */
43595
- isCellEmpty({ col, row }, sheetId = this.getters.getActiveSheetId()) {
43604
+ isEvaluatedCellEmpty({ col, row }) {
43605
+ const sheetId = this.getters.getActiveSheetId();
43596
43606
  const position = this.getters.getMainCellPosition({ sheetId, col, row });
43597
43607
  const cell = this.getters.getEvaluatedCell(position);
43598
43608
  return cell.type === CellValueType.empty;
43599
43609
  }
43610
+ /**
43611
+ * Checks if a cell is empty (i.e. does not have a content). If the cell is part of a merge,
43612
+ * the check applies to the main cell of the merge.
43613
+ */
43614
+ isCellEmpty({ col, row }) {
43615
+ var _a;
43616
+ const sheetId = this.getters.getActiveSheetId();
43617
+ const position = this.getters.getMainCellPosition({ sheetId, col, row });
43618
+ return !((_a = this.getters.getCell(position)) === null || _a === void 0 ? void 0 : _a.content);
43619
+ }
43600
43620
  /** Computes the next cell position in the given direction by crossing through merges and skipping hidden cells.
43601
43621
  *
43602
43622
  * This has the same behaviour as getNextAvailablePosition() for certain arguments, but use this method instead
@@ -45770,9 +45790,9 @@
45770
45790
  Object.defineProperty(exports, '__esModule', { value: true });
45771
45791
 
45772
45792
 
45773
- __info__.version = '16.2.31';
45774
- __info__.date = '2024-02-09T13:05:40.161Z';
45775
- __info__.hash = '2e76bdf';
45793
+ __info__.version = '16.2.33';
45794
+ __info__.date = '2024-02-28T12:25:47.181Z';
45795
+ __info__.hash = '52d01b2';
45776
45796
 
45777
45797
 
45778
45798
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);