@odoo/o-spreadsheet 16.4.24 → 16.4.25

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.
@@ -5232,8 +5232,10 @@ function getGroup(cell, cells, filter) {
5232
5232
  if (x === cell) {
5233
5233
  found = true;
5234
5234
  }
5235
- const cellValue = evaluateLiteral(x?.content, { locale: DEFAULT_LOCALE });
5236
- if (filter(cellValue)) {
5235
+ const cellValue = x?.isFormula
5236
+ ? undefined
5237
+ : evaluateLiteral(x?.content, { locale: DEFAULT_LOCALE });
5238
+ if (cellValue && filter(cellValue)) {
5237
5239
  group.push(cellValue);
5238
5240
  }
5239
5241
  else {
@@ -24784,7 +24786,11 @@ class GridComposer extends owl.Component {
24784
24786
  }
24785
24787
  }
24786
24788
  updateCellReferenceVisibility() {
24787
- if (this.isCellReferenceVisible || this.env.model.getters.getEditionMode() === "inactive") {
24789
+ if (this.env.model.getters.getEditionMode() === "inactive") {
24790
+ this.isCellReferenceVisible = false;
24791
+ return;
24792
+ }
24793
+ if (this.isCellReferenceVisible) {
24788
24794
  return;
24789
24795
  }
24790
24796
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -34665,7 +34671,6 @@ class SheetPlugin extends CorePlugin {
34665
34671
  "getNumberHeaders",
34666
34672
  "getGridLinesVisibility",
34667
34673
  "getNextSheetName",
34668
- "isEmpty",
34669
34674
  "getSheetSize",
34670
34675
  "getSheetZone",
34671
34676
  "getPaneDivisions",
@@ -35041,14 +35046,6 @@ class SheetPlugin extends CorePlugin {
35041
35046
  // ---------------------------------------------------------------------------
35042
35047
  // Row/Col manipulation
35043
35048
  // ---------------------------------------------------------------------------
35044
- /**
35045
- * Check if a zone only contains empty cells
35046
- */
35047
- isEmpty(sheetId, zone) {
35048
- return positions(zone)
35049
- .map(({ col, row }) => this.getCell({ sheetId, col, row }))
35050
- .every((cell) => !cell || cell.content === "");
35051
- }
35052
35049
  getCommandZones(cmd) {
35053
35050
  const zones = [];
35054
35051
  if ("zone" in cmd) {
@@ -37108,6 +37105,7 @@ class EvaluationPlugin extends UIPlugin {
37108
37105
  "getEvaluatedCell",
37109
37106
  "getEvaluatedCells",
37110
37107
  "getEvaluatedCellsInZone",
37108
+ "isEmpty",
37111
37109
  ];
37112
37110
  shouldRebuildDependenciesGraph = true;
37113
37111
  evaluator;
@@ -37206,6 +37204,14 @@ class EvaluationPlugin extends UIPlugin {
37206
37204
  getEvaluatedCellsInZone(sheetId, zone) {
37207
37205
  return positions(zone).map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId, col, row }));
37208
37206
  }
37207
+ /**
37208
+ * Check if a zone only contains empty cells
37209
+ */
37210
+ isEmpty(sheetId, zone) {
37211
+ return positions(zone)
37212
+ .map(({ col, row }) => this.getEvaluatedCell({ sheetId, col, row }))
37213
+ .every((cell) => cell.type === CellValueType.empty);
37214
+ }
37209
37215
  // ---------------------------------------------------------------------------
37210
37216
  // Export
37211
37217
  // ---------------------------------------------------------------------------
@@ -51716,6 +51722,6 @@ exports.setTranslationMethod = setTranslationMethod;
51716
51722
  exports.tokenize = tokenize;
51717
51723
 
51718
51724
 
51719
- __info__.version = '16.4.24';
51720
- __info__.date = '2024-02-28T12:27:32.683Z';
51721
- __info__.hash = '90c74d1';
51725
+ __info__.version = '16.4.25';
51726
+ __info__.date = '2024-03-12T07:54:10.025Z';
51727
+ __info__.hash = '182ad16';
@@ -3648,7 +3648,7 @@ interface SheetState$1 {
3648
3648
  readonly cellPosition: Record<UID, CellPosition | undefined>;
3649
3649
  }
3650
3650
  declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState$1 {
3651
- static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "isEmpty", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones", "getUnboundedZone", "checkElementsIncludeAllNonFrozenHeaders"];
3651
+ static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones", "getUnboundedZone", "checkElementsIncludeAllNonFrozenHeaders"];
3652
3652
  readonly sheetIdsMapName: Record<string, UID | undefined>;
3653
3653
  readonly orderedSheetIds: UID[];
3654
3654
  readonly sheets: Record<UID, Sheet | undefined>;
@@ -3696,10 +3696,6 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
3696
3696
  * This validation ensures that all rows or columns cannot be deleted when frozen panes exist.
3697
3697
  */
3698
3698
  checkElementsIncludeAllNonFrozenHeaders(sheetId: UID, dimension: Dimension, elements: HeaderIndex[]): boolean;
3699
- /**
3700
- * Check if a zone only contains empty cells
3701
- */
3702
- isEmpty(sheetId: UID, zone: Zone): boolean;
3703
3699
  getCommandZones(cmd: Command): Zone[];
3704
3700
  /**
3705
3701
  * Check if zones in the command are well formed and
@@ -3794,7 +3790,7 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
3794
3790
  }
3795
3791
 
3796
3792
  declare class EvaluationPlugin extends UIPlugin {
3797
- static getters: readonly ["evaluateFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone"];
3793
+ static getters: readonly ["evaluateFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone", "isEmpty"];
3798
3794
  private shouldRebuildDependenciesGraph;
3799
3795
  private evaluator;
3800
3796
  private positionsToUpdate;
@@ -3818,6 +3814,10 @@ declare class EvaluationPlugin extends UIPlugin {
3818
3814
  getEvaluatedCell(position: CellPosition): EvaluatedCell;
3819
3815
  getEvaluatedCells(sheetId: UID): Record<UID, EvaluatedCell>;
3820
3816
  getEvaluatedCellsInZone(sheetId: UID, zone: Zone): EvaluatedCell[];
3817
+ /**
3818
+ * Check if a zone only contains empty cells
3819
+ */
3820
+ isEmpty(sheetId: UID, zone: Zone): boolean;
3821
3821
  exportForExcel(data: ExcelWorkbookData): void;
3822
3822
  /**
3823
3823
  * Returns the corresponding formula cell of a given cell
@@ -5228,8 +5228,10 @@ function getGroup(cell, cells, filter) {
5228
5228
  if (x === cell) {
5229
5229
  found = true;
5230
5230
  }
5231
- const cellValue = evaluateLiteral(x?.content, { locale: DEFAULT_LOCALE });
5232
- if (filter(cellValue)) {
5231
+ const cellValue = x?.isFormula
5232
+ ? undefined
5233
+ : evaluateLiteral(x?.content, { locale: DEFAULT_LOCALE });
5234
+ if (cellValue && filter(cellValue)) {
5233
5235
  group.push(cellValue);
5234
5236
  }
5235
5237
  else {
@@ -24780,7 +24782,11 @@ class GridComposer extends Component {
24780
24782
  }
24781
24783
  }
24782
24784
  updateCellReferenceVisibility() {
24783
- if (this.isCellReferenceVisible || this.env.model.getters.getEditionMode() === "inactive") {
24785
+ if (this.env.model.getters.getEditionMode() === "inactive") {
24786
+ this.isCellReferenceVisible = false;
24787
+ return;
24788
+ }
24789
+ if (this.isCellReferenceVisible) {
24784
24790
  return;
24785
24791
  }
24786
24792
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -34661,7 +34667,6 @@ class SheetPlugin extends CorePlugin {
34661
34667
  "getNumberHeaders",
34662
34668
  "getGridLinesVisibility",
34663
34669
  "getNextSheetName",
34664
- "isEmpty",
34665
34670
  "getSheetSize",
34666
34671
  "getSheetZone",
34667
34672
  "getPaneDivisions",
@@ -35037,14 +35042,6 @@ class SheetPlugin extends CorePlugin {
35037
35042
  // ---------------------------------------------------------------------------
35038
35043
  // Row/Col manipulation
35039
35044
  // ---------------------------------------------------------------------------
35040
- /**
35041
- * Check if a zone only contains empty cells
35042
- */
35043
- isEmpty(sheetId, zone) {
35044
- return positions(zone)
35045
- .map(({ col, row }) => this.getCell({ sheetId, col, row }))
35046
- .every((cell) => !cell || cell.content === "");
35047
- }
35048
35045
  getCommandZones(cmd) {
35049
35046
  const zones = [];
35050
35047
  if ("zone" in cmd) {
@@ -37104,6 +37101,7 @@ class EvaluationPlugin extends UIPlugin {
37104
37101
  "getEvaluatedCell",
37105
37102
  "getEvaluatedCells",
37106
37103
  "getEvaluatedCellsInZone",
37104
+ "isEmpty",
37107
37105
  ];
37108
37106
  shouldRebuildDependenciesGraph = true;
37109
37107
  evaluator;
@@ -37202,6 +37200,14 @@ class EvaluationPlugin extends UIPlugin {
37202
37200
  getEvaluatedCellsInZone(sheetId, zone) {
37203
37201
  return positions(zone).map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId, col, row }));
37204
37202
  }
37203
+ /**
37204
+ * Check if a zone only contains empty cells
37205
+ */
37206
+ isEmpty(sheetId, zone) {
37207
+ return positions(zone)
37208
+ .map(({ col, row }) => this.getEvaluatedCell({ sheetId, col, row }))
37209
+ .every((cell) => cell.type === CellValueType.empty);
37210
+ }
37205
37211
  // ---------------------------------------------------------------------------
37206
37212
  // Export
37207
37213
  // ---------------------------------------------------------------------------
@@ -51680,6 +51686,6 @@ const constants = {
51680
51686
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
51681
51687
 
51682
51688
 
51683
- __info__.version = '16.4.24';
51684
- __info__.date = '2024-02-28T12:27:32.683Z';
51685
- __info__.hash = '90c74d1';
51689
+ __info__.version = '16.4.25';
51690
+ __info__.date = '2024-03-12T07:54:10.025Z';
51691
+ __info__.hash = '182ad16';
@@ -5229,8 +5229,10 @@
5229
5229
  if (x === cell) {
5230
5230
  found = true;
5231
5231
  }
5232
- const cellValue = evaluateLiteral(x?.content, { locale: DEFAULT_LOCALE });
5233
- if (filter(cellValue)) {
5232
+ const cellValue = x?.isFormula
5233
+ ? undefined
5234
+ : evaluateLiteral(x?.content, { locale: DEFAULT_LOCALE });
5235
+ if (cellValue && filter(cellValue)) {
5234
5236
  group.push(cellValue);
5235
5237
  }
5236
5238
  else {
@@ -24781,7 +24783,11 @@
24781
24783
  }
24782
24784
  }
24783
24785
  updateCellReferenceVisibility() {
24784
- if (this.isCellReferenceVisible || this.env.model.getters.getEditionMode() === "inactive") {
24786
+ if (this.env.model.getters.getEditionMode() === "inactive") {
24787
+ this.isCellReferenceVisible = false;
24788
+ return;
24789
+ }
24790
+ if (this.isCellReferenceVisible) {
24785
24791
  return;
24786
24792
  }
24787
24793
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -34662,7 +34668,6 @@
34662
34668
  "getNumberHeaders",
34663
34669
  "getGridLinesVisibility",
34664
34670
  "getNextSheetName",
34665
- "isEmpty",
34666
34671
  "getSheetSize",
34667
34672
  "getSheetZone",
34668
34673
  "getPaneDivisions",
@@ -35038,14 +35043,6 @@
35038
35043
  // ---------------------------------------------------------------------------
35039
35044
  // Row/Col manipulation
35040
35045
  // ---------------------------------------------------------------------------
35041
- /**
35042
- * Check if a zone only contains empty cells
35043
- */
35044
- isEmpty(sheetId, zone) {
35045
- return positions(zone)
35046
- .map(({ col, row }) => this.getCell({ sheetId, col, row }))
35047
- .every((cell) => !cell || cell.content === "");
35048
- }
35049
35046
  getCommandZones(cmd) {
35050
35047
  const zones = [];
35051
35048
  if ("zone" in cmd) {
@@ -37105,6 +37102,7 @@
37105
37102
  "getEvaluatedCell",
37106
37103
  "getEvaluatedCells",
37107
37104
  "getEvaluatedCellsInZone",
37105
+ "isEmpty",
37108
37106
  ];
37109
37107
  shouldRebuildDependenciesGraph = true;
37110
37108
  evaluator;
@@ -37203,6 +37201,14 @@
37203
37201
  getEvaluatedCellsInZone(sheetId, zone) {
37204
37202
  return positions(zone).map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId, col, row }));
37205
37203
  }
37204
+ /**
37205
+ * Check if a zone only contains empty cells
37206
+ */
37207
+ isEmpty(sheetId, zone) {
37208
+ return positions(zone)
37209
+ .map(({ col, row }) => this.getEvaluatedCell({ sheetId, col, row }))
37210
+ .every((cell) => cell.type === CellValueType.empty);
37211
+ }
37206
37212
  // ---------------------------------------------------------------------------
37207
37213
  // Export
37208
37214
  // ---------------------------------------------------------------------------
@@ -51715,9 +51721,9 @@
51715
51721
  Object.defineProperty(exports, '__esModule', { value: true });
51716
51722
 
51717
51723
 
51718
- __info__.version = '16.4.24';
51719
- __info__.date = '2024-02-28T12:27:32.683Z';
51720
- __info__.hash = '90c74d1';
51724
+ __info__.version = '16.4.25';
51725
+ __info__.date = '2024-03-12T07:54:10.025Z';
51726
+ __info__.hash = '182ad16';
51721
51727
 
51722
51728
 
51723
51729
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);