@odoo/o-spreadsheet 16.2.11 → 16.2.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.
@@ -20716,6 +20716,14 @@ class FiguresContainer extends owl.Component {
20716
20716
  if (dirY < 0) {
20717
20717
  this.dnd.y = dndInitialY + figure.height * fraction;
20718
20718
  }
20719
+ if (this.dnd.x < 0) {
20720
+ this.dnd.width += this.dnd.x;
20721
+ this.dnd.x = 0;
20722
+ }
20723
+ if (this.dnd.y < 0) {
20724
+ this.dnd.height += this.dnd.y;
20725
+ this.dnd.y = 0;
20726
+ }
20719
20727
  };
20720
20728
  }
20721
20729
  else {
@@ -20731,6 +20739,14 @@ class FiguresContainer extends owl.Component {
20731
20739
  if (dirY < 0) {
20732
20740
  this.dnd.y = dndInitialY - deltaY;
20733
20741
  }
20742
+ if (this.dnd.x < 0) {
20743
+ this.dnd.width += this.dnd.x;
20744
+ this.dnd.x = 0;
20745
+ }
20746
+ if (this.dnd.y < 0) {
20747
+ this.dnd.height += this.dnd.y;
20748
+ this.dnd.y = 0;
20749
+ }
20734
20750
  };
20735
20751
  }
20736
20752
  const onMouseUp = (ev) => {
@@ -29344,7 +29360,7 @@ class HeaderSizePlugin extends CorePlugin {
29344
29360
  this.sizes = {};
29345
29361
  }
29346
29362
  handle(cmd) {
29347
- var _a, _b, _c;
29363
+ var _a, _b;
29348
29364
  switch (cmd.type) {
29349
29365
  case "CREATE_SHEET": {
29350
29366
  const computedSizes = this.computeSheetSizes(cmd.sheetId);
@@ -29432,7 +29448,8 @@ class HeaderSizePlugin extends CorePlugin {
29432
29448
  }
29433
29449
  break;
29434
29450
  case "UPDATE_CELL":
29435
- if (!((_c = (_b = (_a = this.sizes[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a["ROW"]) === null || _b === void 0 ? void 0 : _b[cmd.row]) === null || _c === void 0 ? void 0 : _c.manualSize)) {
29451
+ const row = (_b = (_a = this.sizes[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a["ROW"]) === null || _b === void 0 ? void 0 : _b[cmd.row];
29452
+ if (row && !row.manualSize) {
29436
29453
  const { sheetId, row } = cmd;
29437
29454
  this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
29438
29455
  }
@@ -34507,9 +34524,17 @@ class FindAndReplacePlugin extends UIPlugin {
34507
34524
  case "REPLACE_ALL_SEARCH":
34508
34525
  this.replaceAll(cmd.replaceWith);
34509
34526
  break;
34527
+ case "EVALUATE_CELLS":
34528
+ case "UPDATE_CELL":
34529
+ case "REMOVE_FILTER_TABLE":
34530
+ case "UPDATE_FILTER":
34531
+ this.isSearchDirty = true;
34532
+ break;
34510
34533
  case "UNDO":
34511
34534
  case "REDO":
34512
34535
  case "REMOVE_COLUMNS_ROWS":
34536
+ case "HIDE_COLUMNS_ROWS":
34537
+ case "UNHIDE_COLUMNS_ROWS":
34513
34538
  case "ADD_COLUMNS_ROWS":
34514
34539
  case "EVALUATE_CELLS":
34515
34540
  case "UPDATE_CELL":
@@ -34645,37 +34670,31 @@ class FindAndReplacePlugin extends UIPlugin {
34645
34670
  // ---------------------------------------------------------------------------
34646
34671
  // Replace
34647
34672
  // ---------------------------------------------------------------------------
34648
- /**
34649
- * Replace the value of the currently selected match
34650
- */
34651
- replace(replaceWith) {
34652
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
34673
+ replaceMatch(selectedMatch, replaceWith) {
34674
+ if (!this.currentSearchRegex) {
34653
34675
  return;
34654
34676
  }
34655
- const matches = this.searchMatches;
34656
- const selectedMatch = matches[this.selectedMatchIndex];
34657
34677
  const sheetId = this.getters.getActiveSheetId();
34658
34678
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
34679
+ const { col, row } = selectedMatch;
34659
34680
  if ((cell === null || cell === void 0 ? void 0 : cell.isFormula) && !this.searchOptions.searchFormulas) {
34660
- this.selectNextCell(Direction.next);
34681
+ return;
34661
34682
  }
34662
- else {
34663
- const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
34664
- const toReplace = this.getSearchableString({
34665
- sheetId,
34666
- col: selectedMatch.col,
34667
- row: selectedMatch.row,
34668
- });
34669
- const newContent = toReplace.replace(replaceRegex, replaceWith);
34670
- this.dispatch("UPDATE_CELL", {
34671
- sheetId: this.getters.getActiveSheetId(),
34672
- col: selectedMatch.col,
34673
- row: selectedMatch.row,
34674
- content: newContent,
34675
- });
34676
- this.searchMatches.splice(this.selectedMatchIndex, 1);
34677
- this.selectNextCell(Direction.current);
34683
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
34684
+ const toReplace = this.getSearchableString({ sheetId, col, row });
34685
+ const content = toReplace.replace(replaceRegex, replaceWith);
34686
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content });
34687
+ }
34688
+ /**
34689
+ * Replace the value of the currently selected match
34690
+ */
34691
+ replace(replaceWith) {
34692
+ if (this.selectedMatchIndex === null) {
34693
+ return;
34678
34694
  }
34695
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
34696
+ this.replaceMatch(selectedMatch, replaceWith);
34697
+ this.selectNextCell(Direction.next);
34679
34698
  }
34680
34699
  /**
34681
34700
  * Apply the replace function to all the matches one time.
@@ -34683,7 +34702,7 @@ class FindAndReplacePlugin extends UIPlugin {
34683
34702
  replaceAll(replaceWith) {
34684
34703
  const matchCount = this.searchMatches.length;
34685
34704
  for (let i = 0; i < matchCount; i++) {
34686
- this.replace(replaceWith);
34705
+ this.replaceMatch(this.searchMatches[i], replaceWith);
34687
34706
  }
34688
34707
  }
34689
34708
  getSearchableString(position) {
@@ -45388,6 +45407,6 @@ exports.setTranslationMethod = setTranslationMethod;
45388
45407
  exports.tokenize = tokenize;
45389
45408
 
45390
45409
 
45391
- __info__.version = '16.2.11';
45392
- __info__.date = '2023-07-26T12:09:59.264Z';
45393
- __info__.hash = '0d46dde';
45410
+ __info__.version = '16.2.12';
45411
+ __info__.date = '2023-08-07T09:01:10.621Z';
45412
+ __info__.hash = '6d1a538';
@@ -1246,6 +1246,7 @@ declare class FindAndReplacePlugin extends UIPlugin {
1246
1246
  */
1247
1247
  private selectNextCell;
1248
1248
  private clearSearch;
1249
+ private replaceMatch;
1249
1250
  /**
1250
1251
  * Replace the value of the currently selected match
1251
1252
  */
@@ -20712,6 +20712,14 @@ class FiguresContainer extends Component {
20712
20712
  if (dirY < 0) {
20713
20713
  this.dnd.y = dndInitialY + figure.height * fraction;
20714
20714
  }
20715
+ if (this.dnd.x < 0) {
20716
+ this.dnd.width += this.dnd.x;
20717
+ this.dnd.x = 0;
20718
+ }
20719
+ if (this.dnd.y < 0) {
20720
+ this.dnd.height += this.dnd.y;
20721
+ this.dnd.y = 0;
20722
+ }
20715
20723
  };
20716
20724
  }
20717
20725
  else {
@@ -20727,6 +20735,14 @@ class FiguresContainer extends Component {
20727
20735
  if (dirY < 0) {
20728
20736
  this.dnd.y = dndInitialY - deltaY;
20729
20737
  }
20738
+ if (this.dnd.x < 0) {
20739
+ this.dnd.width += this.dnd.x;
20740
+ this.dnd.x = 0;
20741
+ }
20742
+ if (this.dnd.y < 0) {
20743
+ this.dnd.height += this.dnd.y;
20744
+ this.dnd.y = 0;
20745
+ }
20730
20746
  };
20731
20747
  }
20732
20748
  const onMouseUp = (ev) => {
@@ -29340,7 +29356,7 @@ class HeaderSizePlugin extends CorePlugin {
29340
29356
  this.sizes = {};
29341
29357
  }
29342
29358
  handle(cmd) {
29343
- var _a, _b, _c;
29359
+ var _a, _b;
29344
29360
  switch (cmd.type) {
29345
29361
  case "CREATE_SHEET": {
29346
29362
  const computedSizes = this.computeSheetSizes(cmd.sheetId);
@@ -29428,7 +29444,8 @@ class HeaderSizePlugin extends CorePlugin {
29428
29444
  }
29429
29445
  break;
29430
29446
  case "UPDATE_CELL":
29431
- if (!((_c = (_b = (_a = this.sizes[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a["ROW"]) === null || _b === void 0 ? void 0 : _b[cmd.row]) === null || _c === void 0 ? void 0 : _c.manualSize)) {
29447
+ const row = (_b = (_a = this.sizes[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a["ROW"]) === null || _b === void 0 ? void 0 : _b[cmd.row];
29448
+ if (row && !row.manualSize) {
29432
29449
  const { sheetId, row } = cmd;
29433
29450
  this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
29434
29451
  }
@@ -34503,9 +34520,17 @@ class FindAndReplacePlugin extends UIPlugin {
34503
34520
  case "REPLACE_ALL_SEARCH":
34504
34521
  this.replaceAll(cmd.replaceWith);
34505
34522
  break;
34523
+ case "EVALUATE_CELLS":
34524
+ case "UPDATE_CELL":
34525
+ case "REMOVE_FILTER_TABLE":
34526
+ case "UPDATE_FILTER":
34527
+ this.isSearchDirty = true;
34528
+ break;
34506
34529
  case "UNDO":
34507
34530
  case "REDO":
34508
34531
  case "REMOVE_COLUMNS_ROWS":
34532
+ case "HIDE_COLUMNS_ROWS":
34533
+ case "UNHIDE_COLUMNS_ROWS":
34509
34534
  case "ADD_COLUMNS_ROWS":
34510
34535
  case "EVALUATE_CELLS":
34511
34536
  case "UPDATE_CELL":
@@ -34641,37 +34666,31 @@ class FindAndReplacePlugin extends UIPlugin {
34641
34666
  // ---------------------------------------------------------------------------
34642
34667
  // Replace
34643
34668
  // ---------------------------------------------------------------------------
34644
- /**
34645
- * Replace the value of the currently selected match
34646
- */
34647
- replace(replaceWith) {
34648
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
34669
+ replaceMatch(selectedMatch, replaceWith) {
34670
+ if (!this.currentSearchRegex) {
34649
34671
  return;
34650
34672
  }
34651
- const matches = this.searchMatches;
34652
- const selectedMatch = matches[this.selectedMatchIndex];
34653
34673
  const sheetId = this.getters.getActiveSheetId();
34654
34674
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
34675
+ const { col, row } = selectedMatch;
34655
34676
  if ((cell === null || cell === void 0 ? void 0 : cell.isFormula) && !this.searchOptions.searchFormulas) {
34656
- this.selectNextCell(Direction.next);
34677
+ return;
34657
34678
  }
34658
- else {
34659
- const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
34660
- const toReplace = this.getSearchableString({
34661
- sheetId,
34662
- col: selectedMatch.col,
34663
- row: selectedMatch.row,
34664
- });
34665
- const newContent = toReplace.replace(replaceRegex, replaceWith);
34666
- this.dispatch("UPDATE_CELL", {
34667
- sheetId: this.getters.getActiveSheetId(),
34668
- col: selectedMatch.col,
34669
- row: selectedMatch.row,
34670
- content: newContent,
34671
- });
34672
- this.searchMatches.splice(this.selectedMatchIndex, 1);
34673
- this.selectNextCell(Direction.current);
34679
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
34680
+ const toReplace = this.getSearchableString({ sheetId, col, row });
34681
+ const content = toReplace.replace(replaceRegex, replaceWith);
34682
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content });
34683
+ }
34684
+ /**
34685
+ * Replace the value of the currently selected match
34686
+ */
34687
+ replace(replaceWith) {
34688
+ if (this.selectedMatchIndex === null) {
34689
+ return;
34674
34690
  }
34691
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
34692
+ this.replaceMatch(selectedMatch, replaceWith);
34693
+ this.selectNextCell(Direction.next);
34675
34694
  }
34676
34695
  /**
34677
34696
  * Apply the replace function to all the matches one time.
@@ -34679,7 +34698,7 @@ class FindAndReplacePlugin extends UIPlugin {
34679
34698
  replaceAll(replaceWith) {
34680
34699
  const matchCount = this.searchMatches.length;
34681
34700
  for (let i = 0; i < matchCount; i++) {
34682
- this.replace(replaceWith);
34701
+ this.replaceMatch(this.searchMatches[i], replaceWith);
34683
34702
  }
34684
34703
  }
34685
34704
  getSearchableString(position) {
@@ -45356,6 +45375,6 @@ function addFunction(functionName, functionDescription) {
45356
45375
  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 };
45357
45376
 
45358
45377
 
45359
- __info__.version = '16.2.11';
45360
- __info__.date = '2023-07-26T12:09:59.264Z';
45361
- __info__.hash = '0d46dde';
45378
+ __info__.version = '16.2.12';
45379
+ __info__.date = '2023-08-07T09:01:10.621Z';
45380
+ __info__.hash = '6d1a538';
@@ -20713,6 +20713,14 @@
20713
20713
  if (dirY < 0) {
20714
20714
  this.dnd.y = dndInitialY + figure.height * fraction;
20715
20715
  }
20716
+ if (this.dnd.x < 0) {
20717
+ this.dnd.width += this.dnd.x;
20718
+ this.dnd.x = 0;
20719
+ }
20720
+ if (this.dnd.y < 0) {
20721
+ this.dnd.height += this.dnd.y;
20722
+ this.dnd.y = 0;
20723
+ }
20716
20724
  };
20717
20725
  }
20718
20726
  else {
@@ -20728,6 +20736,14 @@
20728
20736
  if (dirY < 0) {
20729
20737
  this.dnd.y = dndInitialY - deltaY;
20730
20738
  }
20739
+ if (this.dnd.x < 0) {
20740
+ this.dnd.width += this.dnd.x;
20741
+ this.dnd.x = 0;
20742
+ }
20743
+ if (this.dnd.y < 0) {
20744
+ this.dnd.height += this.dnd.y;
20745
+ this.dnd.y = 0;
20746
+ }
20731
20747
  };
20732
20748
  }
20733
20749
  const onMouseUp = (ev) => {
@@ -29341,7 +29357,7 @@
29341
29357
  this.sizes = {};
29342
29358
  }
29343
29359
  handle(cmd) {
29344
- var _a, _b, _c;
29360
+ var _a, _b;
29345
29361
  switch (cmd.type) {
29346
29362
  case "CREATE_SHEET": {
29347
29363
  const computedSizes = this.computeSheetSizes(cmd.sheetId);
@@ -29429,7 +29445,8 @@
29429
29445
  }
29430
29446
  break;
29431
29447
  case "UPDATE_CELL":
29432
- if (!((_c = (_b = (_a = this.sizes[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a["ROW"]) === null || _b === void 0 ? void 0 : _b[cmd.row]) === null || _c === void 0 ? void 0 : _c.manualSize)) {
29448
+ const row = (_b = (_a = this.sizes[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a["ROW"]) === null || _b === void 0 ? void 0 : _b[cmd.row];
29449
+ if (row && !row.manualSize) {
29433
29450
  const { sheetId, row } = cmd;
29434
29451
  this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
29435
29452
  }
@@ -34504,9 +34521,17 @@
34504
34521
  case "REPLACE_ALL_SEARCH":
34505
34522
  this.replaceAll(cmd.replaceWith);
34506
34523
  break;
34524
+ case "EVALUATE_CELLS":
34525
+ case "UPDATE_CELL":
34526
+ case "REMOVE_FILTER_TABLE":
34527
+ case "UPDATE_FILTER":
34528
+ this.isSearchDirty = true;
34529
+ break;
34507
34530
  case "UNDO":
34508
34531
  case "REDO":
34509
34532
  case "REMOVE_COLUMNS_ROWS":
34533
+ case "HIDE_COLUMNS_ROWS":
34534
+ case "UNHIDE_COLUMNS_ROWS":
34510
34535
  case "ADD_COLUMNS_ROWS":
34511
34536
  case "EVALUATE_CELLS":
34512
34537
  case "UPDATE_CELL":
@@ -34642,37 +34667,31 @@
34642
34667
  // ---------------------------------------------------------------------------
34643
34668
  // Replace
34644
34669
  // ---------------------------------------------------------------------------
34645
- /**
34646
- * Replace the value of the currently selected match
34647
- */
34648
- replace(replaceWith) {
34649
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
34670
+ replaceMatch(selectedMatch, replaceWith) {
34671
+ if (!this.currentSearchRegex) {
34650
34672
  return;
34651
34673
  }
34652
- const matches = this.searchMatches;
34653
- const selectedMatch = matches[this.selectedMatchIndex];
34654
34674
  const sheetId = this.getters.getActiveSheetId();
34655
34675
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
34676
+ const { col, row } = selectedMatch;
34656
34677
  if ((cell === null || cell === void 0 ? void 0 : cell.isFormula) && !this.searchOptions.searchFormulas) {
34657
- this.selectNextCell(Direction.next);
34678
+ return;
34658
34679
  }
34659
- else {
34660
- const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
34661
- const toReplace = this.getSearchableString({
34662
- sheetId,
34663
- col: selectedMatch.col,
34664
- row: selectedMatch.row,
34665
- });
34666
- const newContent = toReplace.replace(replaceRegex, replaceWith);
34667
- this.dispatch("UPDATE_CELL", {
34668
- sheetId: this.getters.getActiveSheetId(),
34669
- col: selectedMatch.col,
34670
- row: selectedMatch.row,
34671
- content: newContent,
34672
- });
34673
- this.searchMatches.splice(this.selectedMatchIndex, 1);
34674
- this.selectNextCell(Direction.current);
34680
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
34681
+ const toReplace = this.getSearchableString({ sheetId, col, row });
34682
+ const content = toReplace.replace(replaceRegex, replaceWith);
34683
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content });
34684
+ }
34685
+ /**
34686
+ * Replace the value of the currently selected match
34687
+ */
34688
+ replace(replaceWith) {
34689
+ if (this.selectedMatchIndex === null) {
34690
+ return;
34675
34691
  }
34692
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
34693
+ this.replaceMatch(selectedMatch, replaceWith);
34694
+ this.selectNextCell(Direction.next);
34676
34695
  }
34677
34696
  /**
34678
34697
  * Apply the replace function to all the matches one time.
@@ -34680,7 +34699,7 @@
34680
34699
  replaceAll(replaceWith) {
34681
34700
  const matchCount = this.searchMatches.length;
34682
34701
  for (let i = 0; i < matchCount; i++) {
34683
- this.replace(replaceWith);
34702
+ this.replaceMatch(this.searchMatches[i], replaceWith);
34684
34703
  }
34685
34704
  }
34686
34705
  getSearchableString(position) {
@@ -45387,9 +45406,9 @@
45387
45406
  Object.defineProperty(exports, '__esModule', { value: true });
45388
45407
 
45389
45408
 
45390
- __info__.version = '16.2.11';
45391
- __info__.date = '2023-07-26T12:09:59.264Z';
45392
- __info__.hash = '0d46dde';
45409
+ __info__.version = '16.2.12';
45410
+ __info__.date = '2023-08-07T09:01:10.621Z';
45411
+ __info__.hash = '6d1a538';
45393
45412
 
45394
45413
 
45395
45414
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);