@odoo/o-spreadsheet 16.1.16 → 16.1.17

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.
@@ -29789,7 +29789,7 @@ class HeaderSizePlugin extends CorePlugin {
29789
29789
  this.sizes = {};
29790
29790
  }
29791
29791
  handle(cmd) {
29792
- var _a, _b, _c;
29792
+ var _a, _b;
29793
29793
  switch (cmd.type) {
29794
29794
  case "CREATE_SHEET": {
29795
29795
  const computedSizes = this.computeSheetSizes(cmd.sheetId);
@@ -29877,7 +29877,8 @@ class HeaderSizePlugin extends CorePlugin {
29877
29877
  }
29878
29878
  break;
29879
29879
  case "UPDATE_CELL":
29880
- 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)) {
29880
+ 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];
29881
+ if (row && !row.manualSize) {
29881
29882
  const { sheetId, row } = cmd;
29882
29883
  this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
29883
29884
  }
@@ -34918,9 +34919,17 @@ class FindAndReplacePlugin extends UIPlugin {
34918
34919
  case "REPLACE_ALL_SEARCH":
34919
34920
  this.replaceAll(cmd.replaceWith);
34920
34921
  break;
34922
+ case "EVALUATE_CELLS":
34923
+ case "UPDATE_CELL":
34924
+ case "REMOVE_FILTER_TABLE":
34925
+ case "UPDATE_FILTER":
34926
+ this.isSearchDirty = true;
34927
+ break;
34921
34928
  case "UNDO":
34922
34929
  case "REDO":
34923
34930
  case "REMOVE_COLUMNS_ROWS":
34931
+ case "HIDE_COLUMNS_ROWS":
34932
+ case "UNHIDE_COLUMNS_ROWS":
34924
34933
  case "ADD_COLUMNS_ROWS":
34925
34934
  case "EVALUATE_CELLS":
34926
34935
  case "UPDATE_CELL":
@@ -35056,37 +35065,31 @@ class FindAndReplacePlugin extends UIPlugin {
35056
35065
  // ---------------------------------------------------------------------------
35057
35066
  // Replace
35058
35067
  // ---------------------------------------------------------------------------
35059
- /**
35060
- * Replace the value of the currently selected match
35061
- */
35062
- replace(replaceWith) {
35063
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
35068
+ replaceMatch(selectedMatch, replaceWith) {
35069
+ if (!this.currentSearchRegex) {
35064
35070
  return;
35065
35071
  }
35066
- const matches = this.searchMatches;
35067
- const selectedMatch = matches[this.selectedMatchIndex];
35068
35072
  const sheetId = this.getters.getActiveSheetId();
35069
35073
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
35074
+ const { col, row } = selectedMatch;
35070
35075
  if ((cell === null || cell === void 0 ? void 0 : cell.isFormula) && !this.searchOptions.searchFormulas) {
35071
- this.selectNextCell(Direction.next);
35076
+ return;
35072
35077
  }
35073
- else {
35074
- const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
35075
- const toReplace = this.getSearchableString({
35076
- sheetId,
35077
- col: selectedMatch.col,
35078
- row: selectedMatch.row,
35079
- });
35080
- const newContent = toReplace.replace(replaceRegex, replaceWith);
35081
- this.dispatch("UPDATE_CELL", {
35082
- sheetId: this.getters.getActiveSheetId(),
35083
- col: selectedMatch.col,
35084
- row: selectedMatch.row,
35085
- content: newContent,
35086
- });
35087
- this.searchMatches.splice(this.selectedMatchIndex, 1);
35088
- this.selectNextCell(Direction.current);
35078
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
35079
+ const toReplace = this.getSearchableString({ sheetId, col, row });
35080
+ const content = toReplace.replace(replaceRegex, replaceWith);
35081
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content });
35082
+ }
35083
+ /**
35084
+ * Replace the value of the currently selected match
35085
+ */
35086
+ replace(replaceWith) {
35087
+ if (this.selectedMatchIndex === null) {
35088
+ return;
35089
35089
  }
35090
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
35091
+ this.replaceMatch(selectedMatch, replaceWith);
35092
+ this.selectNextCell(Direction.next);
35090
35093
  }
35091
35094
  /**
35092
35095
  * Apply the replace function to all the matches one time.
@@ -35094,7 +35097,7 @@ class FindAndReplacePlugin extends UIPlugin {
35094
35097
  replaceAll(replaceWith) {
35095
35098
  const matchCount = this.searchMatches.length;
35096
35099
  for (let i = 0; i < matchCount; i++) {
35097
- this.replace(replaceWith);
35100
+ this.replaceMatch(this.searchMatches[i], replaceWith);
35098
35101
  }
35099
35102
  }
35100
35103
  getSearchableString(position) {
@@ -44309,6 +44312,6 @@ exports.setTranslationMethod = setTranslationMethod;
44309
44312
  exports.tokenize = tokenize;
44310
44313
 
44311
44314
 
44312
- __info__.version = '16.1.16';
44313
- __info__.date = '2023-07-26T12:09:57.059Z';
44314
- __info__.hash = '96f5f09';
44315
+ __info__.version = '16.1.17';
44316
+ __info__.date = '2023-08-07T09:00:57.212Z';
44317
+ __info__.hash = '2a79aa8';
@@ -1359,6 +1359,7 @@ declare class FindAndReplacePlugin extends UIPlugin {
1359
1359
  */
1360
1360
  private selectNextCell;
1361
1361
  private clearSearch;
1362
+ private replaceMatch;
1362
1363
  /**
1363
1364
  * Replace the value of the currently selected match
1364
1365
  */
@@ -29785,7 +29785,7 @@ class HeaderSizePlugin extends CorePlugin {
29785
29785
  this.sizes = {};
29786
29786
  }
29787
29787
  handle(cmd) {
29788
- var _a, _b, _c;
29788
+ var _a, _b;
29789
29789
  switch (cmd.type) {
29790
29790
  case "CREATE_SHEET": {
29791
29791
  const computedSizes = this.computeSheetSizes(cmd.sheetId);
@@ -29873,7 +29873,8 @@ class HeaderSizePlugin extends CorePlugin {
29873
29873
  }
29874
29874
  break;
29875
29875
  case "UPDATE_CELL":
29876
- 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)) {
29876
+ 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];
29877
+ if (row && !row.manualSize) {
29877
29878
  const { sheetId, row } = cmd;
29878
29879
  this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
29879
29880
  }
@@ -34914,9 +34915,17 @@ class FindAndReplacePlugin extends UIPlugin {
34914
34915
  case "REPLACE_ALL_SEARCH":
34915
34916
  this.replaceAll(cmd.replaceWith);
34916
34917
  break;
34918
+ case "EVALUATE_CELLS":
34919
+ case "UPDATE_CELL":
34920
+ case "REMOVE_FILTER_TABLE":
34921
+ case "UPDATE_FILTER":
34922
+ this.isSearchDirty = true;
34923
+ break;
34917
34924
  case "UNDO":
34918
34925
  case "REDO":
34919
34926
  case "REMOVE_COLUMNS_ROWS":
34927
+ case "HIDE_COLUMNS_ROWS":
34928
+ case "UNHIDE_COLUMNS_ROWS":
34920
34929
  case "ADD_COLUMNS_ROWS":
34921
34930
  case "EVALUATE_CELLS":
34922
34931
  case "UPDATE_CELL":
@@ -35052,37 +35061,31 @@ class FindAndReplacePlugin extends UIPlugin {
35052
35061
  // ---------------------------------------------------------------------------
35053
35062
  // Replace
35054
35063
  // ---------------------------------------------------------------------------
35055
- /**
35056
- * Replace the value of the currently selected match
35057
- */
35058
- replace(replaceWith) {
35059
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
35064
+ replaceMatch(selectedMatch, replaceWith) {
35065
+ if (!this.currentSearchRegex) {
35060
35066
  return;
35061
35067
  }
35062
- const matches = this.searchMatches;
35063
- const selectedMatch = matches[this.selectedMatchIndex];
35064
35068
  const sheetId = this.getters.getActiveSheetId();
35065
35069
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
35070
+ const { col, row } = selectedMatch;
35066
35071
  if ((cell === null || cell === void 0 ? void 0 : cell.isFormula) && !this.searchOptions.searchFormulas) {
35067
- this.selectNextCell(Direction.next);
35072
+ return;
35068
35073
  }
35069
- else {
35070
- const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
35071
- const toReplace = this.getSearchableString({
35072
- sheetId,
35073
- col: selectedMatch.col,
35074
- row: selectedMatch.row,
35075
- });
35076
- const newContent = toReplace.replace(replaceRegex, replaceWith);
35077
- this.dispatch("UPDATE_CELL", {
35078
- sheetId: this.getters.getActiveSheetId(),
35079
- col: selectedMatch.col,
35080
- row: selectedMatch.row,
35081
- content: newContent,
35082
- });
35083
- this.searchMatches.splice(this.selectedMatchIndex, 1);
35084
- this.selectNextCell(Direction.current);
35074
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
35075
+ const toReplace = this.getSearchableString({ sheetId, col, row });
35076
+ const content = toReplace.replace(replaceRegex, replaceWith);
35077
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content });
35078
+ }
35079
+ /**
35080
+ * Replace the value of the currently selected match
35081
+ */
35082
+ replace(replaceWith) {
35083
+ if (this.selectedMatchIndex === null) {
35084
+ return;
35085
35085
  }
35086
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
35087
+ this.replaceMatch(selectedMatch, replaceWith);
35088
+ this.selectNextCell(Direction.next);
35086
35089
  }
35087
35090
  /**
35088
35091
  * Apply the replace function to all the matches one time.
@@ -35090,7 +35093,7 @@ class FindAndReplacePlugin extends UIPlugin {
35090
35093
  replaceAll(replaceWith) {
35091
35094
  const matchCount = this.searchMatches.length;
35092
35095
  for (let i = 0; i < matchCount; i++) {
35093
- this.replace(replaceWith);
35096
+ this.replaceMatch(this.searchMatches[i], replaceWith);
35094
35097
  }
35095
35098
  }
35096
35099
  getSearchableString(position) {
@@ -44277,6 +44280,6 @@ function addFunction(functionName, functionDescription) {
44277
44280
  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 };
44278
44281
 
44279
44282
 
44280
- __info__.version = '16.1.16';
44281
- __info__.date = '2023-07-26T12:09:57.059Z';
44282
- __info__.hash = '96f5f09';
44283
+ __info__.version = '16.1.17';
44284
+ __info__.date = '2023-08-07T09:00:57.212Z';
44285
+ __info__.hash = '2a79aa8';
@@ -29786,7 +29786,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29786
29786
  this.sizes = {};
29787
29787
  }
29788
29788
  handle(cmd) {
29789
- var _a, _b, _c;
29789
+ var _a, _b;
29790
29790
  switch (cmd.type) {
29791
29791
  case "CREATE_SHEET": {
29792
29792
  const computedSizes = this.computeSheetSizes(cmd.sheetId);
@@ -29874,7 +29874,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29874
29874
  }
29875
29875
  break;
29876
29876
  case "UPDATE_CELL":
29877
- 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)) {
29877
+ 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];
29878
+ if (row && !row.manualSize) {
29878
29879
  const { sheetId, row } = cmd;
29879
29880
  this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
29880
29881
  }
@@ -34915,9 +34916,17 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
34915
34916
  case "REPLACE_ALL_SEARCH":
34916
34917
  this.replaceAll(cmd.replaceWith);
34917
34918
  break;
34919
+ case "EVALUATE_CELLS":
34920
+ case "UPDATE_CELL":
34921
+ case "REMOVE_FILTER_TABLE":
34922
+ case "UPDATE_FILTER":
34923
+ this.isSearchDirty = true;
34924
+ break;
34918
34925
  case "UNDO":
34919
34926
  case "REDO":
34920
34927
  case "REMOVE_COLUMNS_ROWS":
34928
+ case "HIDE_COLUMNS_ROWS":
34929
+ case "UNHIDE_COLUMNS_ROWS":
34921
34930
  case "ADD_COLUMNS_ROWS":
34922
34931
  case "EVALUATE_CELLS":
34923
34932
  case "UPDATE_CELL":
@@ -35053,37 +35062,31 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35053
35062
  // ---------------------------------------------------------------------------
35054
35063
  // Replace
35055
35064
  // ---------------------------------------------------------------------------
35056
- /**
35057
- * Replace the value of the currently selected match
35058
- */
35059
- replace(replaceWith) {
35060
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
35065
+ replaceMatch(selectedMatch, replaceWith) {
35066
+ if (!this.currentSearchRegex) {
35061
35067
  return;
35062
35068
  }
35063
- const matches = this.searchMatches;
35064
- const selectedMatch = matches[this.selectedMatchIndex];
35065
35069
  const sheetId = this.getters.getActiveSheetId();
35066
35070
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
35071
+ const { col, row } = selectedMatch;
35067
35072
  if ((cell === null || cell === void 0 ? void 0 : cell.isFormula) && !this.searchOptions.searchFormulas) {
35068
- this.selectNextCell(Direction.next);
35073
+ return;
35069
35074
  }
35070
- else {
35071
- const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
35072
- const toReplace = this.getSearchableString({
35073
- sheetId,
35074
- col: selectedMatch.col,
35075
- row: selectedMatch.row,
35076
- });
35077
- const newContent = toReplace.replace(replaceRegex, replaceWith);
35078
- this.dispatch("UPDATE_CELL", {
35079
- sheetId: this.getters.getActiveSheetId(),
35080
- col: selectedMatch.col,
35081
- row: selectedMatch.row,
35082
- content: newContent,
35083
- });
35084
- this.searchMatches.splice(this.selectedMatchIndex, 1);
35085
- this.selectNextCell(Direction.current);
35075
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
35076
+ const toReplace = this.getSearchableString({ sheetId, col, row });
35077
+ const content = toReplace.replace(replaceRegex, replaceWith);
35078
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content });
35079
+ }
35080
+ /**
35081
+ * Replace the value of the currently selected match
35082
+ */
35083
+ replace(replaceWith) {
35084
+ if (this.selectedMatchIndex === null) {
35085
+ return;
35086
35086
  }
35087
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
35088
+ this.replaceMatch(selectedMatch, replaceWith);
35089
+ this.selectNextCell(Direction.next);
35087
35090
  }
35088
35091
  /**
35089
35092
  * Apply the replace function to all the matches one time.
@@ -35091,7 +35094,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35091
35094
  replaceAll(replaceWith) {
35092
35095
  const matchCount = this.searchMatches.length;
35093
35096
  for (let i = 0; i < matchCount; i++) {
35094
- this.replace(replaceWith);
35097
+ this.replaceMatch(this.searchMatches[i], replaceWith);
35095
35098
  }
35096
35099
  }
35097
35100
  getSearchableString(position) {
@@ -44308,9 +44311,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
44308
44311
  Object.defineProperty(exports, '__esModule', { value: true });
44309
44312
 
44310
44313
 
44311
- __info__.version = '16.1.16';
44312
- __info__.date = '2023-07-26T12:09:57.059Z';
44313
- __info__.hash = '96f5f09';
44314
+ __info__.version = '16.1.17';
44315
+ __info__.date = '2023-08-07T09:00:57.212Z';
44316
+ __info__.hash = '2a79aa8';
44314
44317
 
44315
44318
 
44316
44319
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);