@odoo/o-spreadsheet 16.4.1 → 16.4.2

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.
@@ -24689,6 +24689,15 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
24689
24689
  y = initialFigure.y - deltaY;
24690
24690
  }
24691
24691
  }
24692
+ // Restrict resizing if x or y reaches header boundaries
24693
+ if (x < 0) {
24694
+ width += x;
24695
+ x = 0;
24696
+ }
24697
+ if (y < 0) {
24698
+ height += y;
24699
+ y = 0;
24700
+ }
24692
24701
  return { ...initialFigure, x, y, width, height };
24693
24702
  }
24694
24703
 
@@ -38552,9 +38561,17 @@ class FindAndReplacePlugin extends UIPlugin {
38552
38561
  case "REPLACE_ALL_SEARCH":
38553
38562
  this.replaceAll(cmd.replaceWith);
38554
38563
  break;
38564
+ case "EVALUATE_CELLS":
38565
+ case "UPDATE_CELL":
38566
+ case "REMOVE_FILTER_TABLE":
38567
+ case "UPDATE_FILTER":
38568
+ this.isSearchDirty = true;
38569
+ break;
38555
38570
  case "UNDO":
38556
38571
  case "REDO":
38557
38572
  case "REMOVE_COLUMNS_ROWS":
38573
+ case "HIDE_COLUMNS_ROWS":
38574
+ case "UNHIDE_COLUMNS_ROWS":
38558
38575
  case "ADD_COLUMNS_ROWS":
38559
38576
  case "EVALUATE_CELLS":
38560
38577
  case "UPDATE_CELL":
@@ -38690,37 +38707,32 @@ class FindAndReplacePlugin extends UIPlugin {
38690
38707
  // ---------------------------------------------------------------------------
38691
38708
  // Replace
38692
38709
  // ---------------------------------------------------------------------------
38693
- /**
38694
- * Replace the value of the currently selected match
38695
- */
38696
- replace(replaceWith) {
38697
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
38710
+ replaceMatch(selectedMatch, replaceWith) {
38711
+ if (!this.currentSearchRegex) {
38698
38712
  return;
38699
38713
  }
38700
- const matches = this.searchMatches;
38701
- const selectedMatch = matches[this.selectedMatchIndex];
38702
38714
  const sheetId = this.getters.getActiveSheetId();
38703
38715
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
38716
+ const { col, row } = selectedMatch;
38704
38717
  if (cell?.isFormula && !this.searchOptions.searchFormulas) {
38705
- this.selectNextCell(Direction.next);
38718
+ return;
38706
38719
  }
38707
- else {
38708
- const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
38709
- const toReplace = this.getSearchableString({
38710
- sheetId,
38711
- col: selectedMatch.col,
38712
- row: selectedMatch.row,
38713
- });
38714
- const newContent = toReplace.replace(replaceRegex, replaceWith);
38715
- this.dispatch("UPDATE_CELL", {
38716
- sheetId: this.getters.getActiveSheetId(),
38717
- col: selectedMatch.col,
38718
- row: selectedMatch.row,
38719
- content: canonicalizeContent(newContent, this.getters.getLocale()),
38720
- });
38721
- this.searchMatches.splice(this.selectedMatchIndex, 1);
38722
- this.selectNextCell(Direction.current);
38720
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
38721
+ const toReplace = this.getSearchableString({ sheetId, col, row });
38722
+ const content = toReplace.replace(replaceRegex, replaceWith);
38723
+ const canonicalContent = canonicalizeContent(content, this.getters.getLocale());
38724
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content: canonicalContent });
38725
+ }
38726
+ /**
38727
+ * Replace the value of the currently selected match
38728
+ */
38729
+ replace(replaceWith) {
38730
+ if (this.selectedMatchIndex === null) {
38731
+ return;
38723
38732
  }
38733
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
38734
+ this.replaceMatch(selectedMatch, replaceWith);
38735
+ this.selectNextCell(Direction.next);
38724
38736
  }
38725
38737
  /**
38726
38738
  * Apply the replace function to all the matches one time.
@@ -38728,7 +38740,7 @@ class FindAndReplacePlugin extends UIPlugin {
38728
38740
  replaceAll(replaceWith) {
38729
38741
  const matchCount = this.searchMatches.length;
38730
38742
  for (let i = 0; i < matchCount; i++) {
38731
- this.replace(replaceWith);
38743
+ this.replaceMatch(this.searchMatches[i], replaceWith);
38732
38744
  }
38733
38745
  }
38734
38746
  getSearchableString(position) {
@@ -50528,6 +50540,6 @@ exports.setTranslationMethod = setTranslationMethod;
50528
50540
  exports.tokenize = tokenize;
50529
50541
 
50530
50542
 
50531
- __info__.version = '16.4.1';
50532
- __info__.date = '2023-07-26T12:13:04.992Z';
50533
- __info__.hash = 'e687fa9';
50543
+ __info__.version = '16.4.2';
50544
+ __info__.date = '2023-08-07T12:49:47.066Z';
50545
+ __info__.hash = 'd5697c0';
@@ -1453,6 +1453,7 @@ declare class FindAndReplacePlugin extends UIPlugin {
1453
1453
  */
1454
1454
  private selectNextCell;
1455
1455
  private clearSearch;
1456
+ private replaceMatch;
1456
1457
  /**
1457
1458
  * Replace the value of the currently selected match
1458
1459
  */
@@ -24685,6 +24685,15 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
24685
24685
  y = initialFigure.y - deltaY;
24686
24686
  }
24687
24687
  }
24688
+ // Restrict resizing if x or y reaches header boundaries
24689
+ if (x < 0) {
24690
+ width += x;
24691
+ x = 0;
24692
+ }
24693
+ if (y < 0) {
24694
+ height += y;
24695
+ y = 0;
24696
+ }
24688
24697
  return { ...initialFigure, x, y, width, height };
24689
24698
  }
24690
24699
 
@@ -38548,9 +38557,17 @@ class FindAndReplacePlugin extends UIPlugin {
38548
38557
  case "REPLACE_ALL_SEARCH":
38549
38558
  this.replaceAll(cmd.replaceWith);
38550
38559
  break;
38560
+ case "EVALUATE_CELLS":
38561
+ case "UPDATE_CELL":
38562
+ case "REMOVE_FILTER_TABLE":
38563
+ case "UPDATE_FILTER":
38564
+ this.isSearchDirty = true;
38565
+ break;
38551
38566
  case "UNDO":
38552
38567
  case "REDO":
38553
38568
  case "REMOVE_COLUMNS_ROWS":
38569
+ case "HIDE_COLUMNS_ROWS":
38570
+ case "UNHIDE_COLUMNS_ROWS":
38554
38571
  case "ADD_COLUMNS_ROWS":
38555
38572
  case "EVALUATE_CELLS":
38556
38573
  case "UPDATE_CELL":
@@ -38686,37 +38703,32 @@ class FindAndReplacePlugin extends UIPlugin {
38686
38703
  // ---------------------------------------------------------------------------
38687
38704
  // Replace
38688
38705
  // ---------------------------------------------------------------------------
38689
- /**
38690
- * Replace the value of the currently selected match
38691
- */
38692
- replace(replaceWith) {
38693
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
38706
+ replaceMatch(selectedMatch, replaceWith) {
38707
+ if (!this.currentSearchRegex) {
38694
38708
  return;
38695
38709
  }
38696
- const matches = this.searchMatches;
38697
- const selectedMatch = matches[this.selectedMatchIndex];
38698
38710
  const sheetId = this.getters.getActiveSheetId();
38699
38711
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
38712
+ const { col, row } = selectedMatch;
38700
38713
  if (cell?.isFormula && !this.searchOptions.searchFormulas) {
38701
- this.selectNextCell(Direction.next);
38714
+ return;
38702
38715
  }
38703
- else {
38704
- const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
38705
- const toReplace = this.getSearchableString({
38706
- sheetId,
38707
- col: selectedMatch.col,
38708
- row: selectedMatch.row,
38709
- });
38710
- const newContent = toReplace.replace(replaceRegex, replaceWith);
38711
- this.dispatch("UPDATE_CELL", {
38712
- sheetId: this.getters.getActiveSheetId(),
38713
- col: selectedMatch.col,
38714
- row: selectedMatch.row,
38715
- content: canonicalizeContent(newContent, this.getters.getLocale()),
38716
- });
38717
- this.searchMatches.splice(this.selectedMatchIndex, 1);
38718
- this.selectNextCell(Direction.current);
38716
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
38717
+ const toReplace = this.getSearchableString({ sheetId, col, row });
38718
+ const content = toReplace.replace(replaceRegex, replaceWith);
38719
+ const canonicalContent = canonicalizeContent(content, this.getters.getLocale());
38720
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content: canonicalContent });
38721
+ }
38722
+ /**
38723
+ * Replace the value of the currently selected match
38724
+ */
38725
+ replace(replaceWith) {
38726
+ if (this.selectedMatchIndex === null) {
38727
+ return;
38719
38728
  }
38729
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
38730
+ this.replaceMatch(selectedMatch, replaceWith);
38731
+ this.selectNextCell(Direction.next);
38720
38732
  }
38721
38733
  /**
38722
38734
  * Apply the replace function to all the matches one time.
@@ -38724,7 +38736,7 @@ class FindAndReplacePlugin extends UIPlugin {
38724
38736
  replaceAll(replaceWith) {
38725
38737
  const matchCount = this.searchMatches.length;
38726
38738
  for (let i = 0; i < matchCount; i++) {
38727
- this.replace(replaceWith);
38739
+ this.replaceMatch(this.searchMatches[i], replaceWith);
38728
38740
  }
38729
38741
  }
38730
38742
  getSearchableString(position) {
@@ -50492,6 +50504,6 @@ const constants = {
50492
50504
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
50493
50505
 
50494
50506
 
50495
- __info__.version = '16.4.1';
50496
- __info__.date = '2023-07-26T12:13:04.992Z';
50497
- __info__.hash = 'e687fa9';
50507
+ __info__.version = '16.4.2';
50508
+ __info__.date = '2023-08-07T12:49:47.066Z';
50509
+ __info__.hash = 'd5697c0';
@@ -24686,6 +24686,15 @@
24686
24686
  y = initialFigure.y - deltaY;
24687
24687
  }
24688
24688
  }
24689
+ // Restrict resizing if x or y reaches header boundaries
24690
+ if (x < 0) {
24691
+ width += x;
24692
+ x = 0;
24693
+ }
24694
+ if (y < 0) {
24695
+ height += y;
24696
+ y = 0;
24697
+ }
24689
24698
  return { ...initialFigure, x, y, width, height };
24690
24699
  }
24691
24700
 
@@ -38549,9 +38558,17 @@
38549
38558
  case "REPLACE_ALL_SEARCH":
38550
38559
  this.replaceAll(cmd.replaceWith);
38551
38560
  break;
38561
+ case "EVALUATE_CELLS":
38562
+ case "UPDATE_CELL":
38563
+ case "REMOVE_FILTER_TABLE":
38564
+ case "UPDATE_FILTER":
38565
+ this.isSearchDirty = true;
38566
+ break;
38552
38567
  case "UNDO":
38553
38568
  case "REDO":
38554
38569
  case "REMOVE_COLUMNS_ROWS":
38570
+ case "HIDE_COLUMNS_ROWS":
38571
+ case "UNHIDE_COLUMNS_ROWS":
38555
38572
  case "ADD_COLUMNS_ROWS":
38556
38573
  case "EVALUATE_CELLS":
38557
38574
  case "UPDATE_CELL":
@@ -38687,37 +38704,32 @@
38687
38704
  // ---------------------------------------------------------------------------
38688
38705
  // Replace
38689
38706
  // ---------------------------------------------------------------------------
38690
- /**
38691
- * Replace the value of the currently selected match
38692
- */
38693
- replace(replaceWith) {
38694
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
38707
+ replaceMatch(selectedMatch, replaceWith) {
38708
+ if (!this.currentSearchRegex) {
38695
38709
  return;
38696
38710
  }
38697
- const matches = this.searchMatches;
38698
- const selectedMatch = matches[this.selectedMatchIndex];
38699
38711
  const sheetId = this.getters.getActiveSheetId();
38700
38712
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
38713
+ const { col, row } = selectedMatch;
38701
38714
  if (cell?.isFormula && !this.searchOptions.searchFormulas) {
38702
- this.selectNextCell(Direction.next);
38715
+ return;
38703
38716
  }
38704
- else {
38705
- const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
38706
- const toReplace = this.getSearchableString({
38707
- sheetId,
38708
- col: selectedMatch.col,
38709
- row: selectedMatch.row,
38710
- });
38711
- const newContent = toReplace.replace(replaceRegex, replaceWith);
38712
- this.dispatch("UPDATE_CELL", {
38713
- sheetId: this.getters.getActiveSheetId(),
38714
- col: selectedMatch.col,
38715
- row: selectedMatch.row,
38716
- content: canonicalizeContent(newContent, this.getters.getLocale()),
38717
- });
38718
- this.searchMatches.splice(this.selectedMatchIndex, 1);
38719
- this.selectNextCell(Direction.current);
38717
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
38718
+ const toReplace = this.getSearchableString({ sheetId, col, row });
38719
+ const content = toReplace.replace(replaceRegex, replaceWith);
38720
+ const canonicalContent = canonicalizeContent(content, this.getters.getLocale());
38721
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content: canonicalContent });
38722
+ }
38723
+ /**
38724
+ * Replace the value of the currently selected match
38725
+ */
38726
+ replace(replaceWith) {
38727
+ if (this.selectedMatchIndex === null) {
38728
+ return;
38720
38729
  }
38730
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
38731
+ this.replaceMatch(selectedMatch, replaceWith);
38732
+ this.selectNextCell(Direction.next);
38721
38733
  }
38722
38734
  /**
38723
38735
  * Apply the replace function to all the matches one time.
@@ -38725,7 +38737,7 @@
38725
38737
  replaceAll(replaceWith) {
38726
38738
  const matchCount = this.searchMatches.length;
38727
38739
  for (let i = 0; i < matchCount; i++) {
38728
- this.replace(replaceWith);
38740
+ this.replaceMatch(this.searchMatches[i], replaceWith);
38729
38741
  }
38730
38742
  }
38731
38743
  getSearchableString(position) {
@@ -50527,9 +50539,9 @@
50527
50539
  Object.defineProperty(exports, '__esModule', { value: true });
50528
50540
 
50529
50541
 
50530
- __info__.version = '16.4.1';
50531
- __info__.date = '2023-07-26T12:13:04.992Z';
50532
- __info__.hash = 'e687fa9';
50542
+ __info__.version = '16.4.2';
50543
+ __info__.date = '2023-08-07T12:49:47.066Z';
50544
+ __info__.hash = 'd5697c0';
50533
50545
 
50534
50546
 
50535
50547
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);