@odoo/o-spreadsheet 17.0.2 → 17.0.3

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.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.0.2
6
- * @date 2023-11-03T12:22:44.945Z
7
- * @hash 3184728
5
+ * @version 17.0.3
6
+ * @date 2023-11-16T11:59:49.524Z
7
+ * @hash 8bd0fb2
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -4541,14 +4541,14 @@
4541
4541
  switch (context.textBaseline) {
4542
4542
  case "top":
4543
4543
  underlineY += boxHeight - 2 * strokeWidth;
4544
- strikeY += boxHeight - textHeight;
4544
+ strikeY += boxHeight / 2 - strokeWidth;
4545
4545
  break;
4546
4546
  case "middle":
4547
4547
  underlineY += boxHeight / 2 - strokeWidth;
4548
4548
  break;
4549
4549
  case "alphabetic":
4550
4550
  underlineY += 2 * strokeWidth;
4551
- strikeY -= textHeight / 2 - strokeWidth / 2;
4551
+ strikeY -= 3 * strokeWidth;
4552
4552
  break;
4553
4553
  case "bottom":
4554
4554
  underlineY = y;
@@ -5967,7 +5967,7 @@
5967
5967
  return { cellData: {} };
5968
5968
  }
5969
5969
  const sheetId = data.sheetId;
5970
- const content = getters.getTranslatedCellFormula(sheetId, x, y, cell.compiledFormula, cell.dependencies);
5970
+ const content = getters.getTranslatedCellFormula(sheetId, x, y, cell.compiledFormula);
5971
5971
  return {
5972
5972
  cellData: {
5973
5973
  border: data.border,
@@ -10694,6 +10694,17 @@
10694
10694
  const IS_ONLY_ONE_RANGE = (env) => {
10695
10695
  return env.model.getters.getSelectedZones().length === 1;
10696
10696
  };
10697
+ const CAN_INSERT_HEADER = (env, dimension) => {
10698
+ if (!IS_ONLY_ONE_RANGE(env)) {
10699
+ return false;
10700
+ }
10701
+ const activeHeaders = dimension === "COL" ? env.model.getters.getActiveCols() : env.model.getters.getActiveRows();
10702
+ const ortogonalActiveHeaders = dimension === "COL" ? env.model.getters.getActiveRows() : env.model.getters.getActiveCols();
10703
+ const sheetId = env.model.getters.getActiveSheetId();
10704
+ const zone = env.model.getters.getSelectedZone();
10705
+ const allSheetSelected = isEqual(zone, env.model.getters.getSheetZone(sheetId));
10706
+ return isConsecutive(activeHeaders) && (ortogonalActiveHeaders.size === 0 || allSheetSelected);
10707
+ };
10697
10708
 
10698
10709
  const undo = {
10699
10710
  name: _t("Undo"),
@@ -19371,9 +19382,7 @@
19371
19382
  const number = getRowsNumber(env);
19372
19383
  return number === 1 ? _t("Insert row") : _t("Insert %s rows", number.toString());
19373
19384
  },
19374
- isVisible: (env) => isConsecutive(env.model.getters.getActiveRows()) &&
19375
- IS_ONLY_ONE_RANGE(env) &&
19376
- env.model.getters.getActiveCols().size === 0,
19385
+ isVisible: (env) => CAN_INSERT_HEADER(env, "ROW"),
19377
19386
  icon: "o-spreadsheet-Icon.INSERT_ROW",
19378
19387
  };
19379
19388
  const rowInsertRowBefore = {
@@ -19382,9 +19391,7 @@
19382
19391
  return number === 1 ? _t("Insert row above") : _t("Insert %s rows above", number.toString());
19383
19392
  },
19384
19393
  execute: INSERT_ROWS_BEFORE_ACTION,
19385
- isVisible: (env) => isConsecutive(env.model.getters.getActiveRows()) &&
19386
- IS_ONLY_ONE_RANGE(env) &&
19387
- env.model.getters.getActiveCols().size === 0,
19394
+ isVisible: (env) => CAN_INSERT_HEADER(env, "ROW"),
19388
19395
  icon: "o-spreadsheet-Icon.INSERT_ROW_BEFORE",
19389
19396
  };
19390
19397
  const topBarInsertRowsBefore = {
@@ -19415,9 +19422,7 @@
19415
19422
  const number = getRowsNumber(env);
19416
19423
  return number === 1 ? _t("Insert row below") : _t("Insert %s rows below", number.toString());
19417
19424
  },
19418
- isVisible: (env) => isConsecutive(env.model.getters.getActiveRows()) &&
19419
- IS_ONLY_ONE_RANGE(env) &&
19420
- env.model.getters.getActiveCols().size === 0,
19425
+ isVisible: (env) => CAN_INSERT_HEADER(env, "ROW"),
19421
19426
  icon: "o-spreadsheet-Icon.INSERT_ROW_AFTER",
19422
19427
  };
19423
19428
  const topBarInsertRowsAfter = {
@@ -19435,9 +19440,7 @@
19435
19440
  const number = getColumnsNumber(env);
19436
19441
  return number === 1 ? _t("Insert column") : _t("Insert %s columns", number.toString());
19437
19442
  },
19438
- isVisible: (env) => isConsecutive(env.model.getters.getActiveCols()) &&
19439
- IS_ONLY_ONE_RANGE(env) &&
19440
- env.model.getters.getActiveRows().size === 0,
19443
+ isVisible: (env) => CAN_INSERT_HEADER(env, "COL"),
19441
19444
  icon: "o-spreadsheet-Icon.INSERT_COL",
19442
19445
  };
19443
19446
  const colInsertColsBefore = {
@@ -19448,9 +19451,7 @@
19448
19451
  : _t("Insert %s columns left", number.toString());
19449
19452
  },
19450
19453
  execute: INSERT_COLUMNS_BEFORE_ACTION,
19451
- isVisible: (env) => isConsecutive(env.model.getters.getActiveCols()) &&
19452
- IS_ONLY_ONE_RANGE(env) &&
19453
- env.model.getters.getActiveRows().size === 0,
19454
+ isVisible: (env) => CAN_INSERT_HEADER(env, "COL"),
19454
19455
  icon: "o-spreadsheet-Icon.INSERT_COL_BEFORE",
19455
19456
  };
19456
19457
  const topBarInsertColsBefore = {
@@ -19483,9 +19484,7 @@
19483
19484
  : _t("Insert %s columns right", number.toString());
19484
19485
  },
19485
19486
  execute: INSERT_COLUMNS_AFTER_ACTION,
19486
- isVisible: (env) => isConsecutive(env.model.getters.getActiveCols()) &&
19487
- IS_ONLY_ONE_RANGE(env) &&
19488
- env.model.getters.getActiveRows().size === 0,
19487
+ isVisible: (env) => CAN_INSERT_HEADER(env, "COL"),
19489
19488
  icon: "o-spreadsheet-Icon.INSERT_COL_AFTER",
19490
19489
  };
19491
19490
  const topBarInsertColsAfter = {
@@ -23826,7 +23825,7 @@
23826
23825
  }
23827
23826
  .o-input-count {
23828
23827
  width: fit-content;
23829
- padding: 4 0 4 4;
23828
+ padding: 4px 0 4px 4px;
23830
23829
  }
23831
23830
  }
23832
23831
  }
@@ -34947,6 +34946,9 @@
34947
34946
  // -----------------------------------------------------------------------------
34948
34947
  function compile(formula) {
34949
34948
  const tokens = rangeTokenize(formula);
34949
+ return compileTokens(tokens);
34950
+ }
34951
+ function compileTokens(tokens) {
34950
34952
  const { dependencies, constantValues } = formulaArguments(tokens);
34951
34953
  const cacheKey = compilationCacheKey(tokens, dependencies, constantValues);
34952
34954
  if (!functionCache[cacheKey]) {
@@ -35313,11 +35315,11 @@
35313
35315
  for (const sheet of Object.keys(this.cells)) {
35314
35316
  for (const cell of Object.values(this.cells[sheet] || {})) {
35315
35317
  if (cell.isFormula) {
35316
- for (const range of cell.dependencies) {
35318
+ for (const range of cell.compiledFormula.dependencies) {
35317
35319
  if (!sheetId || range.sheetId === sheetId) {
35318
35320
  const change = applyChange(range);
35319
35321
  if (change.changeType !== "NONE") {
35320
- this.history.update("cells", sheet, cell.id, "dependencies", cell.dependencies.indexOf(range), change.range);
35322
+ this.history.update("cells", sheet, cell.id, "compiledFormula", "dependencies", cell.compiledFormula.dependencies.indexOf(range), change.range);
35321
35323
  }
35322
35324
  }
35323
35325
  }
@@ -35513,10 +35515,10 @@
35513
35515
  /*
35514
35516
  * Reconstructs the original formula string based on a normalized form and its dependencies
35515
35517
  */
35516
- getFormulaCellContent(sheetId, cell, dependencies) {
35517
- const ranges = dependencies || cell.dependencies;
35518
+ getFormulaCellContent(sheetId, compiledFormula, dependencies) {
35519
+ const ranges = dependencies || compiledFormula.dependencies;
35518
35520
  let rangeIndex = 0;
35519
- return concat(cell.compiledFormula.tokens.map((token) => {
35521
+ return concat(compiledFormula.tokens.map((token) => {
35520
35522
  if (token.type === "REFERENCE") {
35521
35523
  const range = ranges[rangeIndex++];
35522
35524
  return this.getters.getRangeString(range, sheetId);
@@ -35527,12 +35529,9 @@
35527
35529
  /*
35528
35530
  * Constructs a formula string based on an initial formula and a translation vector
35529
35531
  */
35530
- getTranslatedCellFormula(sheetId, offsetX, offsetY, compiledFormula, dependencies) {
35531
- const adaptedDependencies = this.getters.createAdaptedRanges(dependencies, offsetX, offsetY, sheetId);
35532
- return this.getFormulaCellContent(sheetId, {
35533
- compiledFormula,
35534
- dependencies: adaptedDependencies,
35535
- });
35532
+ getTranslatedCellFormula(sheetId, offsetX, offsetY, compiledFormula) {
35533
+ const adaptedDependencies = this.getters.createAdaptedRanges(compiledFormula.dependencies, offsetX, offsetY, sheetId);
35534
+ return this.getFormulaCellContent(sheetId, compiledFormula, adaptedDependencies);
35536
35535
  }
35537
35536
  getCellStyle(position) {
35538
35537
  return this.getters.getCell(position)?.style || {};
@@ -35712,8 +35711,10 @@
35712
35711
  style,
35713
35712
  format,
35714
35713
  isFormula: true,
35715
- compiledFormula,
35716
- dependencies: [],
35714
+ compiledFormula: {
35715
+ ...compiledFormula,
35716
+ dependencies: [],
35717
+ },
35717
35718
  };
35718
35719
  }
35719
35720
  /**
@@ -35722,7 +35723,7 @@
35722
35723
  */
35723
35724
  createFormulaCellWithDependencies(id, compiledFormula, format, style, sheetId) {
35724
35725
  const dependencies = compiledFormula.dependencies.map((xc) => this.getters.getRangeFromSheetXC(sheetId, xc));
35725
- return new FormulaCellWithDependencies(id, compiledFormula, format, style, dependencies, sheetId, this.getFormulaCellContent.bind(this));
35726
+ return new FormulaCellWithDependencies(id, compiledFormula, format, style, dependencies, sheetId, this.getters.getRangeString.bind(this));
35726
35727
  }
35727
35728
  createErrorFormula(id, content, format, style, error) {
35728
35729
  return {
@@ -35732,13 +35733,12 @@
35732
35733
  format,
35733
35734
  isFormula: true,
35734
35735
  compiledFormula: {
35735
- dependencies: [],
35736
35736
  tokens: tokenize(content),
35737
+ dependencies: [],
35737
35738
  execute: function () {
35738
35739
  throw error;
35739
35740
  },
35740
35741
  },
35741
- dependencies: [],
35742
35742
  };
35743
35743
  }
35744
35744
  checkCellOutOfSheet(sheetId, col, row) {
@@ -35751,27 +35751,44 @@
35751
35751
  }
35752
35752
  class FormulaCellWithDependencies {
35753
35753
  id;
35754
- compiledFormula;
35755
35754
  format;
35756
35755
  style;
35757
- dependencies;
35758
35756
  sheetId;
35759
- getFormulaCellContent;
35757
+ getRangeString;
35760
35758
  isFormula = true;
35761
- constructor(id, compiledFormula, format, style, dependencies, sheetId, getFormulaCellContent) {
35759
+ compiledFormula;
35760
+ constructor(id, compiledFormula, format, style, dependencies, sheetId, getRangeString) {
35762
35761
  this.id = id;
35763
- this.compiledFormula = compiledFormula;
35764
35762
  this.format = format;
35765
35763
  this.style = style;
35766
- this.dependencies = dependencies;
35767
35764
  this.sheetId = sheetId;
35768
- this.getFormulaCellContent = getFormulaCellContent;
35765
+ this.getRangeString = getRangeString;
35766
+ let rangeIndex = 0;
35767
+ const tokens = compiledFormula.tokens.map((token) => {
35768
+ if (token.type === "REFERENCE") {
35769
+ const index = rangeIndex++;
35770
+ return new RangeReferenceToken(() => this.getRangeString(dependencies[index], this.sheetId));
35771
+ }
35772
+ return token;
35773
+ });
35774
+ this.compiledFormula = {
35775
+ ...compiledFormula,
35776
+ dependencies,
35777
+ tokens,
35778
+ };
35769
35779
  }
35770
35780
  get content() {
35771
- return this.getFormulaCellContent(this.sheetId, {
35772
- dependencies: this.dependencies,
35773
- compiledFormula: this.compiledFormula,
35774
- });
35781
+ return concat(this.compiledFormula.tokens.map((token) => token.value));
35782
+ }
35783
+ }
35784
+ class RangeReferenceToken {
35785
+ getValue;
35786
+ type = "REFERENCE";
35787
+ constructor(getValue) {
35788
+ this.getValue = getValue;
35789
+ }
35790
+ get value() {
35791
+ return this.getValue();
35775
35792
  }
35776
35793
  }
35777
35794
 
@@ -36916,6 +36933,13 @@
36916
36933
  }
36917
36934
  onDeleteColumnsRows(cmd) {
36918
36935
  for (const table of this.getFilterTables(cmd.sheetId)) {
36936
+ // Remove the filter tables whose data filter headers are in the removed rows.
36937
+ if (cmd.dimension === "ROW" && cmd.elements.includes(table.zone.top)) {
36938
+ const tables = { ...this.tables[cmd.sheetId] };
36939
+ delete tables[table.id];
36940
+ this.history.update("tables", cmd.sheetId, tables);
36941
+ continue;
36942
+ }
36919
36943
  const zone = reduceZoneOnDeletion(table.zone, cmd.dimension === "COL" ? "left" : "top", cmd.elements);
36920
36944
  if (!zone) {
36921
36945
  const tables = { ...this.tables[cmd.sheetId] };
@@ -39964,6 +39988,13 @@
39964
39988
  return (this.evaluatedCells.get(this.encodePosition(position)) ||
39965
39989
  createEvaluatedCell("", { locale: this.getters.getLocale() }));
39966
39990
  }
39991
+ getSpreadPositionsOf(position) {
39992
+ const positionId = this.encodePosition(position);
39993
+ if (!this.spreadingRelations.isArrayFormula(positionId)) {
39994
+ return [];
39995
+ }
39996
+ return Array.from(this.spreadingRelations.getArrayResultPositionIds(positionId)).map(this.decodePosition.bind(this));
39997
+ }
39967
39998
  getArrayFormulaSpreadingOn(position) {
39968
39999
  const positionId = this.encodePosition(position);
39969
40000
  const formulaPosition = this.getArrayFormulaSpreadingOnId(positionId);
@@ -40122,7 +40153,7 @@
40122
40153
  const position = this.compilationParams[2].getters.getCellPosition(cellId);
40123
40154
  return toXC(position.col, position.row);
40124
40155
  };
40125
- const formulaReturn = cellData.compiledFormula.execute(cellData.dependencies, ...this.compilationParams);
40156
+ const formulaReturn = cellData.compiledFormula.execute(cellData.compiledFormula.dependencies, ...this.compilationParams);
40126
40157
  if (!isMatrix(formulaReturn)) {
40127
40158
  return createEvaluatedCell(formulaReturn.value, {
40128
40159
  format: cellData.format || formulaReturn.format,
@@ -40222,7 +40253,7 @@
40222
40253
  return [];
40223
40254
  }
40224
40255
  const dependencies = [];
40225
- for (const range of cell.dependencies) {
40256
+ for (const range of cell.compiledFormula.dependencies) {
40226
40257
  if (range.invalidSheetName || range.invalidXc) {
40227
40258
  continue;
40228
40259
  }
@@ -40428,6 +40459,7 @@
40428
40459
  "getEvaluatedCell",
40429
40460
  "getEvaluatedCells",
40430
40461
  "getEvaluatedCellsInZone",
40462
+ "getSpreadPositionsOf",
40431
40463
  ];
40432
40464
  shouldRebuildDependenciesGraph = true;
40433
40465
  evaluator;
@@ -40537,6 +40569,9 @@
40537
40569
  getEvaluatedCellsInZone(sheetId, zone) {
40538
40570
  return positions(zone).map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId, col, row }));
40539
40571
  }
40572
+ getSpreadPositionsOf(position) {
40573
+ return this.evaluator.getSpreadPositionsOf(position);
40574
+ }
40540
40575
  // ---------------------------------------------------------------------------
40541
40576
  // Export
40542
40577
  // ---------------------------------------------------------------------------
@@ -40574,10 +40609,10 @@
40574
40609
  */
40575
40610
  getCorrespondingFormulaCell(position) {
40576
40611
  const cell = this.getters.getCell(position);
40577
- if (cell && cell.content) {
40578
- if (cell.isFormula && !isBadExpression(cell.content)) {
40579
- return cell;
40580
- }
40612
+ if (cell && cell.isFormula) {
40613
+ return isBadExpression(cell.compiledFormula.tokens) ? undefined : cell;
40614
+ }
40615
+ else if (cell && cell.content) {
40581
40616
  return undefined;
40582
40617
  }
40583
40618
  const spreadingFormulaPosition = this.evaluator.getArrayFormulaSpreadingOn(position);
@@ -40594,9 +40629,9 @@
40594
40629
  return buildCompilationParameters(this.config.custom, this.getters, (position) => this.evaluator.getEvaluatedCell(position));
40595
40630
  }
40596
40631
  }
40597
- function isBadExpression(formula) {
40632
+ function isBadExpression(tokens) {
40598
40633
  try {
40599
- compile(formula);
40634
+ compileTokens(tokens);
40600
40635
  return false;
40601
40636
  }
40602
40637
  catch (error) {
@@ -40765,22 +40800,20 @@
40765
40800
  invalidateCFEvaluationCommands.has(cmd.type) ||
40766
40801
  cmd.type === "EVALUATE_CELLS" ||
40767
40802
  cmd.type === "UPDATE_CELL") {
40768
- if (cmd.type !== "UNDO" && cmd.type !== "REDO") {
40769
- for (const chartId in this.charts) {
40770
- this.history.update("charts", chartId, undefined);
40771
- }
40803
+ for (const chartId in this.charts) {
40804
+ this.charts[chartId] = undefined;
40772
40805
  }
40773
40806
  }
40774
40807
  switch (cmd.type) {
40775
40808
  case "UPDATE_CHART":
40776
40809
  case "CREATE_CHART":
40777
40810
  case "DELETE_FIGURE":
40778
- this.history.update("charts", cmd.id, undefined);
40811
+ this.charts[cmd.id] = undefined;
40779
40812
  break;
40780
40813
  case "DELETE_SHEET":
40781
40814
  for (let chartId in this.charts) {
40782
40815
  if (!this.getters.isChartDefined(chartId)) {
40783
- this.history.update("charts", chartId, undefined);
40816
+ this.charts[chartId] = undefined;
40784
40817
  }
40785
40818
  }
40786
40819
  break;
@@ -40792,8 +40825,7 @@
40792
40825
  if (!chart) {
40793
40826
  throw new Error(`No chart for the given id: ${figureId}`);
40794
40827
  }
40795
- const runtime = this.createRuntimeChart(chart);
40796
- this.history.update("charts", figureId, runtime);
40828
+ this.charts[figureId] = this.createRuntimeChart(chart);
40797
40829
  }
40798
40830
  return this.charts[figureId];
40799
40831
  }
@@ -40945,7 +40977,10 @@
40945
40977
  const values = cf.rule.values.map((value, i) => {
40946
40978
  const compiledFormula = formulas[i];
40947
40979
  if (compiledFormula) {
40948
- return this.getters.getTranslatedCellFormula(sheetId, col - zone.left, row - zone.top, compiledFormula, compiledFormula.dependencies.map((d) => this.getters.getRangeFromSheetXC(sheetId, d)));
40980
+ return this.getters.getTranslatedCellFormula(sheetId, col - zone.left, row - zone.top, {
40981
+ ...compiledFormula,
40982
+ dependencies: compiledFormula.dependencies.map((d) => this.getters.getRangeFromSheetXC(sheetId, d)),
40983
+ });
40949
40984
  }
40950
40985
  return value;
40951
40986
  });
@@ -41317,7 +41352,10 @@
41317
41352
  }
41318
41353
  try {
41319
41354
  const formula = compile(value);
41320
- const translatedFormula = this.getters.getTranslatedCellFormula(sheetId, offset.col, offset.row, formula, formula.dependencies.map((d) => this.getters.getRangeFromSheetXC(sheetId, d)));
41355
+ const translatedFormula = this.getters.getTranslatedCellFormula(sheetId, offset.col, offset.row, {
41356
+ ...formula,
41357
+ dependencies: formula.dependencies.map((d) => this.getters.getRangeFromSheetXC(sheetId, d)),
41358
+ });
41321
41359
  const evaluated = this.getters.evaluateFormula(sheetId, translatedFormula);
41322
41360
  return evaluated && !isMatrix(evaluated) ? evaluated.toString() : "";
41323
41361
  }
@@ -43569,7 +43607,7 @@
43569
43607
  }
43570
43608
  let content = origin.cell.content;
43571
43609
  if (origin.cell.isFormula && operation === "COPY") {
43572
- content = this.getters.getTranslatedCellFormula(sheetId, col - origin.position.col, row - origin.position.row, origin.cell.compiledFormula, origin.cell.dependencies);
43610
+ content = this.getters.getTranslatedCellFormula(sheetId, col - origin.position.col, row - origin.position.row, origin.cell.compiledFormula);
43573
43611
  }
43574
43612
  this.dispatch("UPDATE_CELL", {
43575
43613
  ...target,
@@ -44101,20 +44139,29 @@
44101
44139
  const sheetId = this.getters.getActiveSheetId();
44102
44140
  const cells = this.getters.getCells(sheetId);
44103
44141
  const matches = [];
44104
- if (this.toSearch) {
44142
+ if (this.toSearch && this.currentSearchRegex) {
44105
44143
  for (const cell of Object.values(cells)) {
44106
44144
  const { col, row } = this.getters.getCellPosition(cell.id);
44145
+ const cellPosition = { sheetId, col, row };
44107
44146
  const isColHidden = this.getters.isColHidden(sheetId, col);
44108
44147
  const isRowHidden = this.getters.isRowHidden(sheetId, row);
44109
44148
  if (isColHidden || isRowHidden) {
44110
44149
  continue;
44111
44150
  }
44112
- if (cell &&
44113
- this.currentSearchRegex &&
44114
- this.currentSearchRegex.test(this.getSearchableString({ sheetId, col, row }))) {
44151
+ if (this.currentSearchRegex.test(this.getSearchableString(cellPosition))) {
44115
44152
  const match = { col, row, selected: false };
44116
44153
  matches.push(match);
44117
44154
  }
44155
+ for (const spreadPosition of this.getters.getSpreadPositionsOf(cellPosition)) {
44156
+ if (this.currentSearchRegex.test(this.getSearchableString(spreadPosition))) {
44157
+ const match = {
44158
+ col: spreadPosition.col,
44159
+ row: spreadPosition.row,
44160
+ selected: false,
44161
+ };
44162
+ matches.push(match);
44163
+ }
44164
+ }
44118
44165
  }
44119
44166
  }
44120
44167
  return matches.sort(this.sortByRowThenColumn);
@@ -44173,16 +44220,19 @@
44173
44220
  return;
44174
44221
  }
44175
44222
  const sheetId = this.getters.getActiveSheetId();
44176
- const cell = this.getters.getCell({ sheetId, ...selectedMatch });
44177
- const { col, row } = selectedMatch;
44223
+ const position = { sheetId, ...selectedMatch };
44224
+ const cell = this.getters.getCell(position);
44225
+ if (!cell?.content) {
44226
+ return;
44227
+ }
44178
44228
  if (cell?.isFormula && !this.searchOptions.searchFormulas) {
44179
44229
  return;
44180
44230
  }
44181
44231
  const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
44182
- const toReplace = this.getSearchableString({ sheetId, col, row });
44232
+ const toReplace = this.getSearchableString(position);
44183
44233
  const content = toReplace.replace(replaceRegex, replaceWith);
44184
44234
  const canonicalContent = canonicalizeNumberContent(content, this.getters.getLocale());
44185
- this.dispatch("UPDATE_CELL", { sheetId, col, row, content: canonicalContent });
44235
+ this.dispatch("UPDATE_CELL", { ...position, content: canonicalContent });
44186
44236
  }
44187
44237
  /**
44188
44238
  * Replace the value of the currently selected match
@@ -45757,7 +45807,7 @@
45757
45807
  if (cell.isFormula) {
45758
45808
  const position = this.getters.getCellPosition(cell.id);
45759
45809
  // we only have a vertical offset
45760
- content = this.getters.getTranslatedCellFormula(sheetId, 0, newRow - position.row, cell.compiledFormula, cell.dependencies);
45810
+ content = this.getters.getTranslatedCellFormula(sheetId, 0, newRow - position.row, cell.compiledFormula);
45761
45811
  }
45762
45812
  newCellValues.style = cell.style;
45763
45813
  newCellValues.content = content;
@@ -47820,6 +47870,8 @@
47820
47870
  case "EVALUATE_CELLS":
47821
47871
  case "ACTIVATE_SHEET":
47822
47872
  case "REMOVE_FILTER_TABLE":
47873
+ case "ADD_COLUMNS_ROWS":
47874
+ case "REMOVE_COLUMNS_ROWS":
47823
47875
  this.isEvaluationDirty = true;
47824
47876
  break;
47825
47877
  case "START":
@@ -55843,6 +55895,7 @@
55843
55895
  exports.addFunction = addFunction;
55844
55896
  exports.astToFormula = astToFormula;
55845
55897
  exports.compile = compile;
55898
+ exports.compileTokens = compileTokens;
55846
55899
  exports.components = components;
55847
55900
  exports.constants = constants;
55848
55901
  exports.convertAstNodes = convertAstNodes;
@@ -55858,6 +55911,7 @@
55858
55911
  exports.links = links;
55859
55912
  exports.load = load;
55860
55913
  exports.parse = parse;
55914
+ exports.parseTokens = parseTokens;
55861
55915
  exports.readonlyAllowedCommands = readonlyAllowedCommands;
55862
55916
  exports.registries = registries;
55863
55917
  exports.setDefaultSheetViewSize = setDefaultSheetViewSize;
@@ -55865,9 +55919,9 @@
55865
55919
  exports.tokenize = tokenize;
55866
55920
 
55867
55921
 
55868
- __info__.version = "17.0.2";
55869
- __info__.date = "2023-11-03T12:22:44.945Z";
55870
- __info__.hash = "3184728";
55922
+ __info__.version = "17.0.3";
55923
+ __info__.date = "2023-11-16T11:59:49.524Z";
55924
+ __info__.hash = "8bd0fb2";
55871
55925
 
55872
55926
 
55873
55927
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);