@odoo/o-spreadsheet 16.0.14 → 16.0.16

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.
@@ -106,7 +106,7 @@
106
106
  const HEADER_BORDER_COLOR = "#C0C0C0";
107
107
  const CELL_BORDER_COLOR = "#E2E3E3";
108
108
  const BACKGROUND_CHART_COLOR = "#FFFFFF";
109
- const MENU_ITEM_DISABLED_COLOR = "#CACACA";
109
+ const DISABLED_TEXT_COLOR = "#CACACA";
110
110
  const DEFAULT_COLOR_SCALE_MIDPOINT_COLOR = 0xb6d7a8;
111
111
  const LINK_COLOR = "#01666b";
112
112
  const FILTERS_COLOR = "#188038";
@@ -3104,7 +3104,6 @@
3104
3104
  "SET_VIEWPORT_OFFSET",
3105
3105
  "SELECT_SEARCH_NEXT_MATCH",
3106
3106
  "SELECT_SEARCH_PREVIOUS_MATCH",
3107
- "REFRESH_SEARCH",
3108
3107
  "UPDATE_SEARCH",
3109
3108
  "CLEAR_SEARCH",
3110
3109
  "EVALUATE_CELLS",
@@ -4031,7 +4030,7 @@
4031
4030
  }
4032
4031
  }
4033
4032
  &.disabled {
4034
- color: ${MENU_ITEM_DISABLED_COLOR};
4033
+ color: ${DISABLED_TEXT_COLOR};
4035
4034
  cursor: not-allowed;
4036
4035
  }
4037
4036
  }
@@ -9985,11 +9984,16 @@
9985
9984
  }
9986
9985
  setup() {
9987
9986
  this.showFormulaState = this.env.model.getters.shouldShowFormulas();
9987
+ this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
9988
9988
  owl.onMounted(() => this.focusInput());
9989
9989
  owl.onWillUnmount(() => {
9990
9990
  this.env.model.dispatch("CLEAR_SEARCH");
9991
9991
  this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
9992
9992
  });
9993
+ owl.useEffect(() => {
9994
+ this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
9995
+ this.searchFormulas();
9996
+ }, () => [this.env.model.getters.shouldShowFormulas()]);
9993
9997
  }
9994
9998
  onInput(ev) {
9995
9999
  this.state.toSearch = ev.target.value;
@@ -10007,10 +10011,6 @@
10007
10011
  this.replace();
10008
10012
  }
10009
10013
  }
10010
- onFocusSidePanel() {
10011
- this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
10012
- this.env.model.dispatch("REFRESH_SEARCH");
10013
- }
10014
10014
  searchFormulas() {
10015
10015
  this.env.model.dispatch("SET_FORMULA_VISIBILITY", {
10016
10016
  show: this.state.searchOptions.searchFormulas,
@@ -10029,10 +10029,6 @@
10029
10029
  searchOptions: this.state.searchOptions,
10030
10030
  });
10031
10031
  }
10032
- debouncedUpdateSearch() {
10033
- clearTimeout(this.inDebounce);
10034
- this.inDebounce = setTimeout(() => this.updateSearch.call(this), 400);
10035
- }
10036
10032
  replace() {
10037
10033
  this.env.model.dispatch("REPLACE_SEARCH", {
10038
10034
  replaceWith: this.state.replaceWith,
@@ -21160,6 +21156,14 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21160
21156
  if (dirY < 0) {
21161
21157
  this.dnd.y = dndInitialY - deltaY;
21162
21158
  }
21159
+ if (this.dnd.x < 0) {
21160
+ this.dnd.width += this.dnd.x;
21161
+ this.dnd.x = 0;
21162
+ }
21163
+ if (this.dnd.y < 0) {
21164
+ this.dnd.height += this.dnd.y;
21165
+ this.dnd.y = 0;
21166
+ }
21163
21167
  };
21164
21168
  const onMouseUp = (ev) => {
21165
21169
  if (!this.dnd.figId) {
@@ -28863,7 +28867,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28863
28867
  this.sizes = {};
28864
28868
  }
28865
28869
  handle(cmd) {
28866
- var _a, _b, _c;
28870
+ var _a, _b;
28867
28871
  switch (cmd.type) {
28868
28872
  case "CREATE_SHEET": {
28869
28873
  const computedSizes = this.computeSheetSizes(cmd.sheetId);
@@ -28951,7 +28955,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28951
28955
  }
28952
28956
  break;
28953
28957
  case "UPDATE_CELL":
28954
- 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)) {
28958
+ 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];
28959
+ if (row && !row.manualSize) {
28955
28960
  const { sheetId, row } = cmd;
28956
28961
  this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
28957
28962
  }
@@ -33291,6 +33296,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
33291
33296
  searchFormulas: false,
33292
33297
  };
33293
33298
  this.toSearch = "";
33299
+ this.isSearchDirty = false;
33294
33300
  }
33295
33301
  // ---------------------------------------------------------------------------
33296
33302
  // Command Handling
@@ -33315,18 +33321,29 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
33315
33321
  case "REPLACE_ALL_SEARCH":
33316
33322
  this.replaceAll(cmd.replaceWith);
33317
33323
  break;
33324
+ case "EVALUATE_CELLS":
33325
+ case "UPDATE_CELL":
33326
+ case "REMOVE_FILTER_TABLE":
33327
+ case "UPDATE_FILTER":
33328
+ this.isSearchDirty = true;
33329
+ break;
33318
33330
  case "UNDO":
33319
33331
  case "REDO":
33320
33332
  case "REMOVE_COLUMNS_ROWS":
33333
+ case "HIDE_COLUMNS_ROWS":
33334
+ case "UNHIDE_COLUMNS_ROWS":
33321
33335
  case "ADD_COLUMNS_ROWS":
33322
- this.clearSearch();
33323
- break;
33324
33336
  case "ACTIVATE_SHEET":
33325
- case "REFRESH_SEARCH":
33326
33337
  this.refreshSearch();
33327
33338
  break;
33328
33339
  }
33329
33340
  }
33341
+ finalize() {
33342
+ if (this.isSearchDirty) {
33343
+ this.refreshSearch();
33344
+ this.isSearchDirty = false;
33345
+ }
33346
+ }
33330
33347
  // ---------------------------------------------------------------------------
33331
33348
  // Getters
33332
33349
  // ---------------------------------------------------------------------------
@@ -33376,11 +33393,17 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
33376
33393
  * Find matches using the current regex
33377
33394
  */
33378
33395
  findMatches() {
33379
- const activeSheetId = this.getters.getActiveSheetId();
33380
- const cells = this.getters.getCells(activeSheetId);
33396
+ const sheetId = this.getters.getActiveSheetId();
33397
+ const cells = this.getters.getCells(sheetId);
33381
33398
  const matches = [];
33382
33399
  if (this.toSearch) {
33383
33400
  for (const cell of Object.values(cells)) {
33401
+ const { col, row } = this.getters.getCellPosition(cell.id);
33402
+ const isColHidden = this.getters.isColHidden(sheetId, col);
33403
+ const isRowHidden = this.getters.isRowHidden(sheetId, row);
33404
+ if (isColHidden || isRowHidden) {
33405
+ continue;
33406
+ }
33384
33407
  if (cell &&
33385
33408
  this.currentSearchRegex &&
33386
33409
  this.currentSearchRegex.test(this.searchOptions.searchFormulas
@@ -37268,6 +37291,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37268
37291
  const sortedIndexOfSortTypeCells = sortCells(sortingCells, sortDirection, Boolean(options.emptyCellAsZero));
37269
37292
  const sortedIndex = sortedIndexOfSortTypeCells.map((x) => x.index);
37270
37293
  const [width, height] = [cells.length, cells[0].length];
37294
+ const cellUpdates = [];
37271
37295
  for (let c = 0; c < width; c++) {
37272
37296
  for (let r = 0; r < height; r++) {
37273
37297
  let cell = cells[c][sortedIndex[r]];
@@ -37278,7 +37302,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37278
37302
  col: newCol,
37279
37303
  row: newRow,
37280
37304
  content: "",
37281
- value: "",
37282
37305
  };
37283
37306
  if (cell) {
37284
37307
  let content = cell.content;
@@ -37292,11 +37315,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37292
37315
  newCellValues.style = cell.style;
37293
37316
  newCellValues.content = content;
37294
37317
  newCellValues.format = cell.format;
37295
- newCellValues.value = cell.evaluated.value;
37296
37318
  }
37297
- this.dispatch("UPDATE_CELL", newCellValues);
37319
+ cellUpdates.push(newCellValues);
37298
37320
  }
37299
37321
  }
37322
+ cellUpdates.forEach((cmdPayload) => this.dispatch("UPDATE_CELL", cmdPayload));
37300
37323
  }
37301
37324
  /**
37302
37325
  * Return the distances between main merge cells in the zone.
@@ -38058,6 +38081,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
38058
38081
  .o-sidePanelButton:enabled {
38059
38082
  cursor: pointer;
38060
38083
  }
38084
+
38085
+ .o-sidePanelButton:disabled {
38086
+ color: ${DISABLED_TEXT_COLOR};
38087
+ }
38088
+
38061
38089
  .o-sidePanelButton:last-child {
38062
38090
  margin-right: 0px;
38063
38091
  }
@@ -42831,9 +42859,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42831
42859
  Object.defineProperty(exports, '__esModule', { value: true });
42832
42860
 
42833
42861
 
42834
- __info__.version = '16.0.14';
42835
- __info__.date = '2023-06-26T14:33:01.959Z';
42836
- __info__.hash = '1e37a94';
42862
+ __info__.version = '16.0.16';
42863
+ __info__.date = '2023-08-07T09:01:50.801Z';
42864
+ __info__.hash = '2b5ecd8';
42837
42865
 
42838
42866
 
42839
42867
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);