@odoo/o-spreadsheet 16.1.16 → 16.1.18

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
  }
@@ -32992,6 +32993,7 @@ class FilterEvaluationPlugin extends UIPlugin {
32992
32993
  this.filterValues[cmd.sheetId] = {};
32993
32994
  break;
32994
32995
  case "HIDE_COLUMNS_ROWS":
32996
+ case "UNHIDE_COLUMNS_ROWS":
32995
32997
  this.updateHiddenRows();
32996
32998
  break;
32997
32999
  case "UPDATE_FILTER":
@@ -34918,9 +34920,17 @@ class FindAndReplacePlugin extends UIPlugin {
34918
34920
  case "REPLACE_ALL_SEARCH":
34919
34921
  this.replaceAll(cmd.replaceWith);
34920
34922
  break;
34923
+ case "EVALUATE_CELLS":
34924
+ case "UPDATE_CELL":
34925
+ case "REMOVE_FILTER_TABLE":
34926
+ case "UPDATE_FILTER":
34927
+ this.isSearchDirty = true;
34928
+ break;
34921
34929
  case "UNDO":
34922
34930
  case "REDO":
34923
34931
  case "REMOVE_COLUMNS_ROWS":
34932
+ case "HIDE_COLUMNS_ROWS":
34933
+ case "UNHIDE_COLUMNS_ROWS":
34924
34934
  case "ADD_COLUMNS_ROWS":
34925
34935
  case "EVALUATE_CELLS":
34926
34936
  case "UPDATE_CELL":
@@ -35056,37 +35066,31 @@ class FindAndReplacePlugin extends UIPlugin {
35056
35066
  // ---------------------------------------------------------------------------
35057
35067
  // Replace
35058
35068
  // ---------------------------------------------------------------------------
35059
- /**
35060
- * Replace the value of the currently selected match
35061
- */
35062
- replace(replaceWith) {
35063
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
35069
+ replaceMatch(selectedMatch, replaceWith) {
35070
+ if (!this.currentSearchRegex) {
35064
35071
  return;
35065
35072
  }
35066
- const matches = this.searchMatches;
35067
- const selectedMatch = matches[this.selectedMatchIndex];
35068
35073
  const sheetId = this.getters.getActiveSheetId();
35069
35074
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
35075
+ const { col, row } = selectedMatch;
35070
35076
  if ((cell === null || cell === void 0 ? void 0 : cell.isFormula) && !this.searchOptions.searchFormulas) {
35071
- this.selectNextCell(Direction.next);
35077
+ return;
35072
35078
  }
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);
35079
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
35080
+ const toReplace = this.getSearchableString({ sheetId, col, row });
35081
+ const content = toReplace.replace(replaceRegex, replaceWith);
35082
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content });
35083
+ }
35084
+ /**
35085
+ * Replace the value of the currently selected match
35086
+ */
35087
+ replace(replaceWith) {
35088
+ if (this.selectedMatchIndex === null) {
35089
+ return;
35089
35090
  }
35091
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
35092
+ this.replaceMatch(selectedMatch, replaceWith);
35093
+ this.selectNextCell(Direction.next);
35090
35094
  }
35091
35095
  /**
35092
35096
  * Apply the replace function to all the matches one time.
@@ -35094,7 +35098,7 @@ class FindAndReplacePlugin extends UIPlugin {
35094
35098
  replaceAll(replaceWith) {
35095
35099
  const matchCount = this.searchMatches.length;
35096
35100
  for (let i = 0; i < matchCount; i++) {
35097
- this.replace(replaceWith);
35101
+ this.replaceMatch(this.searchMatches[i], replaceWith);
35098
35102
  }
35099
35103
  }
35100
35104
  getSearchableString(position) {
@@ -44309,6 +44313,6 @@ exports.setTranslationMethod = setTranslationMethod;
44309
44313
  exports.tokenize = tokenize;
44310
44314
 
44311
44315
 
44312
- __info__.version = '16.1.16';
44313
- __info__.date = '2023-07-26T12:09:57.059Z';
44314
- __info__.hash = '96f5f09';
44316
+ __info__.version = '16.1.18';
44317
+ __info__.date = '2023-08-09T09:09:27.826Z';
44318
+ __info__.hash = '2e594e3';
@@ -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
  }
@@ -32988,6 +32989,7 @@ class FilterEvaluationPlugin extends UIPlugin {
32988
32989
  this.filterValues[cmd.sheetId] = {};
32989
32990
  break;
32990
32991
  case "HIDE_COLUMNS_ROWS":
32992
+ case "UNHIDE_COLUMNS_ROWS":
32991
32993
  this.updateHiddenRows();
32992
32994
  break;
32993
32995
  case "UPDATE_FILTER":
@@ -34914,9 +34916,17 @@ class FindAndReplacePlugin extends UIPlugin {
34914
34916
  case "REPLACE_ALL_SEARCH":
34915
34917
  this.replaceAll(cmd.replaceWith);
34916
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;
34917
34925
  case "UNDO":
34918
34926
  case "REDO":
34919
34927
  case "REMOVE_COLUMNS_ROWS":
34928
+ case "HIDE_COLUMNS_ROWS":
34929
+ case "UNHIDE_COLUMNS_ROWS":
34920
34930
  case "ADD_COLUMNS_ROWS":
34921
34931
  case "EVALUATE_CELLS":
34922
34932
  case "UPDATE_CELL":
@@ -35052,37 +35062,31 @@ class FindAndReplacePlugin extends UIPlugin {
35052
35062
  // ---------------------------------------------------------------------------
35053
35063
  // Replace
35054
35064
  // ---------------------------------------------------------------------------
35055
- /**
35056
- * Replace the value of the currently selected match
35057
- */
35058
- replace(replaceWith) {
35059
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
35065
+ replaceMatch(selectedMatch, replaceWith) {
35066
+ if (!this.currentSearchRegex) {
35060
35067
  return;
35061
35068
  }
35062
- const matches = this.searchMatches;
35063
- const selectedMatch = matches[this.selectedMatchIndex];
35064
35069
  const sheetId = this.getters.getActiveSheetId();
35065
35070
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
35071
+ const { col, row } = selectedMatch;
35066
35072
  if ((cell === null || cell === void 0 ? void 0 : cell.isFormula) && !this.searchOptions.searchFormulas) {
35067
- this.selectNextCell(Direction.next);
35073
+ return;
35068
35074
  }
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);
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;
35085
35086
  }
35087
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
35088
+ this.replaceMatch(selectedMatch, replaceWith);
35089
+ this.selectNextCell(Direction.next);
35086
35090
  }
35087
35091
  /**
35088
35092
  * Apply the replace function to all the matches one time.
@@ -35090,7 +35094,7 @@ class FindAndReplacePlugin extends UIPlugin {
35090
35094
  replaceAll(replaceWith) {
35091
35095
  const matchCount = this.searchMatches.length;
35092
35096
  for (let i = 0; i < matchCount; i++) {
35093
- this.replace(replaceWith);
35097
+ this.replaceMatch(this.searchMatches[i], replaceWith);
35094
35098
  }
35095
35099
  }
35096
35100
  getSearchableString(position) {
@@ -44277,6 +44281,6 @@ function addFunction(functionName, functionDescription) {
44277
44281
  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
44282
 
44279
44283
 
44280
- __info__.version = '16.1.16';
44281
- __info__.date = '2023-07-26T12:09:57.059Z';
44282
- __info__.hash = '96f5f09';
44284
+ __info__.version = '16.1.18';
44285
+ __info__.date = '2023-08-09T09:09:27.826Z';
44286
+ __info__.hash = '2e594e3';
@@ -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
  }
@@ -32989,6 +32990,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32989
32990
  this.filterValues[cmd.sheetId] = {};
32990
32991
  break;
32991
32992
  case "HIDE_COLUMNS_ROWS":
32993
+ case "UNHIDE_COLUMNS_ROWS":
32992
32994
  this.updateHiddenRows();
32993
32995
  break;
32994
32996
  case "UPDATE_FILTER":
@@ -34915,9 +34917,17 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
34915
34917
  case "REPLACE_ALL_SEARCH":
34916
34918
  this.replaceAll(cmd.replaceWith);
34917
34919
  break;
34920
+ case "EVALUATE_CELLS":
34921
+ case "UPDATE_CELL":
34922
+ case "REMOVE_FILTER_TABLE":
34923
+ case "UPDATE_FILTER":
34924
+ this.isSearchDirty = true;
34925
+ break;
34918
34926
  case "UNDO":
34919
34927
  case "REDO":
34920
34928
  case "REMOVE_COLUMNS_ROWS":
34929
+ case "HIDE_COLUMNS_ROWS":
34930
+ case "UNHIDE_COLUMNS_ROWS":
34921
34931
  case "ADD_COLUMNS_ROWS":
34922
34932
  case "EVALUATE_CELLS":
34923
34933
  case "UPDATE_CELL":
@@ -35053,37 +35063,31 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35053
35063
  // ---------------------------------------------------------------------------
35054
35064
  // Replace
35055
35065
  // ---------------------------------------------------------------------------
35056
- /**
35057
- * Replace the value of the currently selected match
35058
- */
35059
- replace(replaceWith) {
35060
- if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
35066
+ replaceMatch(selectedMatch, replaceWith) {
35067
+ if (!this.currentSearchRegex) {
35061
35068
  return;
35062
35069
  }
35063
- const matches = this.searchMatches;
35064
- const selectedMatch = matches[this.selectedMatchIndex];
35065
35070
  const sheetId = this.getters.getActiveSheetId();
35066
35071
  const cell = this.getters.getCell({ sheetId, ...selectedMatch });
35072
+ const { col, row } = selectedMatch;
35067
35073
  if ((cell === null || cell === void 0 ? void 0 : cell.isFormula) && !this.searchOptions.searchFormulas) {
35068
- this.selectNextCell(Direction.next);
35074
+ return;
35069
35075
  }
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);
35076
+ const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
35077
+ const toReplace = this.getSearchableString({ sheetId, col, row });
35078
+ const content = toReplace.replace(replaceRegex, replaceWith);
35079
+ this.dispatch("UPDATE_CELL", { sheetId, col, row, content });
35080
+ }
35081
+ /**
35082
+ * Replace the value of the currently selected match
35083
+ */
35084
+ replace(replaceWith) {
35085
+ if (this.selectedMatchIndex === null) {
35086
+ return;
35086
35087
  }
35088
+ const selectedMatch = this.searchMatches[this.selectedMatchIndex];
35089
+ this.replaceMatch(selectedMatch, replaceWith);
35090
+ this.selectNextCell(Direction.next);
35087
35091
  }
35088
35092
  /**
35089
35093
  * Apply the replace function to all the matches one time.
@@ -35091,7 +35095,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35091
35095
  replaceAll(replaceWith) {
35092
35096
  const matchCount = this.searchMatches.length;
35093
35097
  for (let i = 0; i < matchCount; i++) {
35094
- this.replace(replaceWith);
35098
+ this.replaceMatch(this.searchMatches[i], replaceWith);
35095
35099
  }
35096
35100
  }
35097
35101
  getSearchableString(position) {
@@ -44308,9 +44312,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
44308
44312
  Object.defineProperty(exports, '__esModule', { value: true });
44309
44313
 
44310
44314
 
44311
- __info__.version = '16.1.16';
44312
- __info__.date = '2023-07-26T12:09:57.059Z';
44313
- __info__.hash = '96f5f09';
44315
+ __info__.version = '16.1.18';
44316
+ __info__.date = '2023-08-09T09:09:27.826Z';
44317
+ __info__.hash = '2e594e3';
44314
44318
 
44315
44319
 
44316
44320
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);