@odoo/o-spreadsheet 17.2.23 → 17.2.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.
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.23
7
- * @date 2024-09-05T09:32:03.325Z
8
- * @hash e5e2be8
6
+ * @version 17.2.25
7
+ * @date 2024-11-08T12:13:19.966Z
8
+ * @hash 40d42f8
9
9
  */
10
10
 
11
11
  'use strict';
@@ -163,7 +163,7 @@ const DEFAULT_STYLE = {
163
163
  underline: false,
164
164
  fontSize: 10,
165
165
  fillColor: "",
166
- textColor: "#000000",
166
+ textColor: "",
167
167
  };
168
168
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
169
169
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
@@ -6301,25 +6301,26 @@ class TableClipboardHandler extends AbstractCellClipboardHandler {
6301
6301
  for (let col of columnsIndexes) {
6302
6302
  const position = { col, row, sheetId };
6303
6303
  const table = this.getters.getTable(position);
6304
- if (!table || copiedTablesIds.has(table.id)) {
6304
+ if (!table) {
6305
6305
  tableCellsInRow.push({});
6306
6306
  continue;
6307
6307
  }
6308
+ let copiedTable = undefined;
6308
6309
  // Copy whole table
6309
- if (zones.some((z) => isZoneInside(table.range.zone, z))) {
6310
+ if (!copiedTablesIds.has(table.id) &&
6311
+ zones.some((z) => isZoneInside(table.range.zone, z))) {
6310
6312
  copiedTablesIds.add(table.id);
6311
6313
  const values = [];
6312
6314
  for (const col of range(table.range.zone.left, table.range.zone.right + 1)) {
6313
6315
  values.push(this.getters.getFilterHiddenValues({ sheetId, col, row: table.range.zone.top }));
6314
6316
  }
6315
- tableCellsInRow.push({
6316
- table: { filtersValues: values, range: table.range, config: table.config },
6317
- });
6318
- }
6319
- // Copy only style of cell
6320
- else {
6321
- tableCellsInRow.push({ style: this.getTableStyleToCopy(position) });
6317
+ copiedTable = { filtersValues: values, range: table.range, config: table.config };
6322
6318
  }
6319
+ tableCellsInRow.push({
6320
+ table: copiedTable,
6321
+ style: this.getTableStyleToCopy(position),
6322
+ isWholeTableCopied: copiedTablesIds.has(table.id),
6323
+ });
6323
6324
  }
6324
6325
  }
6325
6326
  return {
@@ -6411,8 +6412,12 @@ class TableClipboardHandler extends AbstractCellClipboardHandler {
6411
6412
  }
6412
6413
  }
6413
6414
  // Do not paste table style if we're inside another table
6414
- if (!this.getters.getTable(position)) {
6415
- if (tableCell.style?.style && options?.pasteOption !== "asValue") {
6415
+ if (this.getters.getTable(position) || options?.pasteOption === "asValue") {
6416
+ return;
6417
+ }
6418
+ if ((!options?.pasteOption && !tableCell.isWholeTableCopied) ||
6419
+ options?.pasteOption === "onlyFormat") {
6420
+ if (tableCell.style?.style) {
6416
6421
  this.dispatch("UPDATE_CELL", { ...position, style: tableCell.style.style });
6417
6422
  }
6418
6423
  if (tableCell.style?.border) {
@@ -6642,7 +6647,10 @@ function parseOperand(tokens) {
6642
6647
  case "STRING":
6643
6648
  return { type: "STRING", value: removeStringQuotes(current.value) };
6644
6649
  case "INVALID_REFERENCE":
6645
- throw new InvalidReferenceError();
6650
+ return {
6651
+ type: "REFERENCE",
6652
+ value: CellErrorType.InvalidReference,
6653
+ };
6646
6654
  case "REFERENCE":
6647
6655
  if (tokens[0]?.value === ":" && tokens[1]?.type === "REFERENCE") {
6648
6656
  tokens.shift();
@@ -50673,6 +50681,7 @@ class Session extends EventBus {
50673
50681
  case "REMOTE_REVISION":
50674
50682
  case "REVISION_REDONE":
50675
50683
  case "REVISION_UNDONE":
50684
+ case "SNAPSHOT_CREATED":
50676
50685
  return this.processedRevisions.has(message.nextRevisionId);
50677
50686
  default:
50678
50687
  return false;
@@ -52139,6 +52148,9 @@ class TableStylePlugin extends UIPlugin {
52139
52148
  case "FOLD_HEADER_GROUP":
52140
52149
  case "FOLD_ALL_HEADER_GROUPS":
52141
52150
  case "UNFOLD_ALL_HEADER_GROUPS":
52151
+ case "FOLD_HEADER_GROUPS_IN_ZONE":
52152
+ case "UNFOLD_HEADER_GROUPS_IN_ZONE":
52153
+ case "UNGROUP_HEADERS":
52142
52154
  case "UPDATE_TABLE":
52143
52155
  case "UPDATE_FILTER":
52144
52156
  delete this.tableStyles[cmd.sheetId];
@@ -52834,6 +52846,8 @@ class FilterEvaluationPlugin extends UIPlugin {
52834
52846
  case "UNFOLD_HEADER_GROUP":
52835
52847
  case "FOLD_ALL_HEADER_GROUPS":
52836
52848
  case "UNFOLD_ALL_HEADER_GROUPS":
52849
+ case "FOLD_HEADER_GROUPS_IN_ZONE":
52850
+ case "UNFOLD_HEADER_GROUPS_IN_ZONE":
52837
52851
  this.updateHiddenRows(cmd.sheetId);
52838
52852
  break;
52839
52853
  case "UPDATE_FILTER":
@@ -59041,7 +59055,8 @@ function addFormula(cell) {
59041
59055
  }
59042
59056
  const attrs = [["t", type]];
59043
59057
  const XlsxFormula = adaptFormulaToExcel(formula);
59044
- const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${cell.value}</v>`;
59058
+ const exportedValue = adaptFormulaValueToExcel(cell.value);
59059
+ const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${exportedValue}</v>`;
59045
59060
  return { attrs, node };
59046
59061
  }
59047
59062
  function addContent(content, sharedStrings, forceString = false) {
@@ -59076,8 +59091,14 @@ function adaptFormulaToExcel(formulaText) {
59076
59091
  ast = addMissingRequiredArgs(ast);
59077
59092
  return ast;
59078
59093
  });
59094
+ ast = convertAstNodes(ast, "REFERENCE", (ast) => {
59095
+ return ast.value === CellErrorType.InvalidReference ? { ...ast, value: "#REF!" } : ast;
59096
+ });
59079
59097
  return ast ? astToFormula(ast) : formulaText;
59080
59098
  }
59099
+ function adaptFormulaValueToExcel(formulaValue) {
59100
+ return formulaValue === CellErrorType.InvalidReference ? "#REF!" : formulaValue;
59101
+ }
59081
59102
  /**
59082
59103
  * Some Excel function need required args that might not be mandatory in o-spreadsheet.
59083
59104
  * This adds those missing args.
@@ -60948,6 +60969,6 @@ exports.tokenColors = tokenColors;
60948
60969
  exports.tokenize = tokenize;
60949
60970
 
60950
60971
 
60951
- __info__.version = "17.2.23";
60952
- __info__.date = "2024-09-05T09:32:03.325Z";
60953
- __info__.hash = "e5e2be8";
60972
+ __info__.version = "17.2.25";
60973
+ __info__.date = "2024-11-08T12:13:19.966Z";
60974
+ __info__.hash = "40d42f8";
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.23
7
- * @date 2024-09-05T09:32:03.325Z
8
- * @hash e5e2be8
6
+ * @version 17.2.25
7
+ * @date 2024-11-08T12:13:19.966Z
8
+ * @hash 40d42f8
9
9
  */
10
10
 
11
11
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw } from '@odoo/owl';
@@ -161,7 +161,7 @@ const DEFAULT_STYLE = {
161
161
  underline: false,
162
162
  fontSize: 10,
163
163
  fillColor: "",
164
- textColor: "#000000",
164
+ textColor: "",
165
165
  };
166
166
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
167
167
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
@@ -6299,25 +6299,26 @@ class TableClipboardHandler extends AbstractCellClipboardHandler {
6299
6299
  for (let col of columnsIndexes) {
6300
6300
  const position = { col, row, sheetId };
6301
6301
  const table = this.getters.getTable(position);
6302
- if (!table || copiedTablesIds.has(table.id)) {
6302
+ if (!table) {
6303
6303
  tableCellsInRow.push({});
6304
6304
  continue;
6305
6305
  }
6306
+ let copiedTable = undefined;
6306
6307
  // Copy whole table
6307
- if (zones.some((z) => isZoneInside(table.range.zone, z))) {
6308
+ if (!copiedTablesIds.has(table.id) &&
6309
+ zones.some((z) => isZoneInside(table.range.zone, z))) {
6308
6310
  copiedTablesIds.add(table.id);
6309
6311
  const values = [];
6310
6312
  for (const col of range(table.range.zone.left, table.range.zone.right + 1)) {
6311
6313
  values.push(this.getters.getFilterHiddenValues({ sheetId, col, row: table.range.zone.top }));
6312
6314
  }
6313
- tableCellsInRow.push({
6314
- table: { filtersValues: values, range: table.range, config: table.config },
6315
- });
6316
- }
6317
- // Copy only style of cell
6318
- else {
6319
- tableCellsInRow.push({ style: this.getTableStyleToCopy(position) });
6315
+ copiedTable = { filtersValues: values, range: table.range, config: table.config };
6320
6316
  }
6317
+ tableCellsInRow.push({
6318
+ table: copiedTable,
6319
+ style: this.getTableStyleToCopy(position),
6320
+ isWholeTableCopied: copiedTablesIds.has(table.id),
6321
+ });
6321
6322
  }
6322
6323
  }
6323
6324
  return {
@@ -6409,8 +6410,12 @@ class TableClipboardHandler extends AbstractCellClipboardHandler {
6409
6410
  }
6410
6411
  }
6411
6412
  // Do not paste table style if we're inside another table
6412
- if (!this.getters.getTable(position)) {
6413
- if (tableCell.style?.style && options?.pasteOption !== "asValue") {
6413
+ if (this.getters.getTable(position) || options?.pasteOption === "asValue") {
6414
+ return;
6415
+ }
6416
+ if ((!options?.pasteOption && !tableCell.isWholeTableCopied) ||
6417
+ options?.pasteOption === "onlyFormat") {
6418
+ if (tableCell.style?.style) {
6414
6419
  this.dispatch("UPDATE_CELL", { ...position, style: tableCell.style.style });
6415
6420
  }
6416
6421
  if (tableCell.style?.border) {
@@ -6640,7 +6645,10 @@ function parseOperand(tokens) {
6640
6645
  case "STRING":
6641
6646
  return { type: "STRING", value: removeStringQuotes(current.value) };
6642
6647
  case "INVALID_REFERENCE":
6643
- throw new InvalidReferenceError();
6648
+ return {
6649
+ type: "REFERENCE",
6650
+ value: CellErrorType.InvalidReference,
6651
+ };
6644
6652
  case "REFERENCE":
6645
6653
  if (tokens[0]?.value === ":" && tokens[1]?.type === "REFERENCE") {
6646
6654
  tokens.shift();
@@ -50671,6 +50679,7 @@ class Session extends EventBus {
50671
50679
  case "REMOTE_REVISION":
50672
50680
  case "REVISION_REDONE":
50673
50681
  case "REVISION_UNDONE":
50682
+ case "SNAPSHOT_CREATED":
50674
50683
  return this.processedRevisions.has(message.nextRevisionId);
50675
50684
  default:
50676
50685
  return false;
@@ -52137,6 +52146,9 @@ class TableStylePlugin extends UIPlugin {
52137
52146
  case "FOLD_HEADER_GROUP":
52138
52147
  case "FOLD_ALL_HEADER_GROUPS":
52139
52148
  case "UNFOLD_ALL_HEADER_GROUPS":
52149
+ case "FOLD_HEADER_GROUPS_IN_ZONE":
52150
+ case "UNFOLD_HEADER_GROUPS_IN_ZONE":
52151
+ case "UNGROUP_HEADERS":
52140
52152
  case "UPDATE_TABLE":
52141
52153
  case "UPDATE_FILTER":
52142
52154
  delete this.tableStyles[cmd.sheetId];
@@ -52832,6 +52844,8 @@ class FilterEvaluationPlugin extends UIPlugin {
52832
52844
  case "UNFOLD_HEADER_GROUP":
52833
52845
  case "FOLD_ALL_HEADER_GROUPS":
52834
52846
  case "UNFOLD_ALL_HEADER_GROUPS":
52847
+ case "FOLD_HEADER_GROUPS_IN_ZONE":
52848
+ case "UNFOLD_HEADER_GROUPS_IN_ZONE":
52835
52849
  this.updateHiddenRows(cmd.sheetId);
52836
52850
  break;
52837
52851
  case "UPDATE_FILTER":
@@ -59039,7 +59053,8 @@ function addFormula(cell) {
59039
59053
  }
59040
59054
  const attrs = [["t", type]];
59041
59055
  const XlsxFormula = adaptFormulaToExcel(formula);
59042
- const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${cell.value}</v>`;
59056
+ const exportedValue = adaptFormulaValueToExcel(cell.value);
59057
+ const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${exportedValue}</v>`;
59043
59058
  return { attrs, node };
59044
59059
  }
59045
59060
  function addContent(content, sharedStrings, forceString = false) {
@@ -59074,8 +59089,14 @@ function adaptFormulaToExcel(formulaText) {
59074
59089
  ast = addMissingRequiredArgs(ast);
59075
59090
  return ast;
59076
59091
  });
59092
+ ast = convertAstNodes(ast, "REFERENCE", (ast) => {
59093
+ return ast.value === CellErrorType.InvalidReference ? { ...ast, value: "#REF!" } : ast;
59094
+ });
59077
59095
  return ast ? astToFormula(ast) : formulaText;
59078
59096
  }
59097
+ function adaptFormulaValueToExcel(formulaValue) {
59098
+ return formulaValue === CellErrorType.InvalidReference ? "#REF!" : formulaValue;
59099
+ }
59079
59100
  /**
59080
59101
  * Some Excel function need required args that might not be mandatory in o-spreadsheet.
59081
59102
  * This adds those missing args.
@@ -60905,6 +60926,6 @@ const constants = {
60905
60926
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
60906
60927
 
60907
60928
 
60908
- __info__.version = "17.2.23";
60909
- __info__.date = "2024-09-05T09:32:03.325Z";
60910
- __info__.hash = "e5e2be8";
60929
+ __info__.version = "17.2.25";
60930
+ __info__.date = "2024-11-08T12:13:19.966Z";
60931
+ __info__.hash = "40d42f8";
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.23
7
- * @date 2024-09-05T09:32:03.325Z
8
- * @hash e5e2be8
6
+ * @version 17.2.25
7
+ * @date 2024-11-08T12:13:19.966Z
8
+ * @hash 40d42f8
9
9
  */
10
10
 
11
11
  (function (exports, owl) {
@@ -162,7 +162,7 @@
162
162
  underline: false,
163
163
  fontSize: 10,
164
164
  fillColor: "",
165
- textColor: "#000000",
165
+ textColor: "",
166
166
  };
167
167
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
168
168
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
@@ -6300,25 +6300,26 @@
6300
6300
  for (let col of columnsIndexes) {
6301
6301
  const position = { col, row, sheetId };
6302
6302
  const table = this.getters.getTable(position);
6303
- if (!table || copiedTablesIds.has(table.id)) {
6303
+ if (!table) {
6304
6304
  tableCellsInRow.push({});
6305
6305
  continue;
6306
6306
  }
6307
+ let copiedTable = undefined;
6307
6308
  // Copy whole table
6308
- if (zones.some((z) => isZoneInside(table.range.zone, z))) {
6309
+ if (!copiedTablesIds.has(table.id) &&
6310
+ zones.some((z) => isZoneInside(table.range.zone, z))) {
6309
6311
  copiedTablesIds.add(table.id);
6310
6312
  const values = [];
6311
6313
  for (const col of range(table.range.zone.left, table.range.zone.right + 1)) {
6312
6314
  values.push(this.getters.getFilterHiddenValues({ sheetId, col, row: table.range.zone.top }));
6313
6315
  }
6314
- tableCellsInRow.push({
6315
- table: { filtersValues: values, range: table.range, config: table.config },
6316
- });
6317
- }
6318
- // Copy only style of cell
6319
- else {
6320
- tableCellsInRow.push({ style: this.getTableStyleToCopy(position) });
6316
+ copiedTable = { filtersValues: values, range: table.range, config: table.config };
6321
6317
  }
6318
+ tableCellsInRow.push({
6319
+ table: copiedTable,
6320
+ style: this.getTableStyleToCopy(position),
6321
+ isWholeTableCopied: copiedTablesIds.has(table.id),
6322
+ });
6322
6323
  }
6323
6324
  }
6324
6325
  return {
@@ -6410,8 +6411,12 @@
6410
6411
  }
6411
6412
  }
6412
6413
  // Do not paste table style if we're inside another table
6413
- if (!this.getters.getTable(position)) {
6414
- if (tableCell.style?.style && options?.pasteOption !== "asValue") {
6414
+ if (this.getters.getTable(position) || options?.pasteOption === "asValue") {
6415
+ return;
6416
+ }
6417
+ if ((!options?.pasteOption && !tableCell.isWholeTableCopied) ||
6418
+ options?.pasteOption === "onlyFormat") {
6419
+ if (tableCell.style?.style) {
6415
6420
  this.dispatch("UPDATE_CELL", { ...position, style: tableCell.style.style });
6416
6421
  }
6417
6422
  if (tableCell.style?.border) {
@@ -6641,7 +6646,10 @@
6641
6646
  case "STRING":
6642
6647
  return { type: "STRING", value: removeStringQuotes(current.value) };
6643
6648
  case "INVALID_REFERENCE":
6644
- throw new InvalidReferenceError();
6649
+ return {
6650
+ type: "REFERENCE",
6651
+ value: CellErrorType.InvalidReference,
6652
+ };
6645
6653
  case "REFERENCE":
6646
6654
  if (tokens[0]?.value === ":" && tokens[1]?.type === "REFERENCE") {
6647
6655
  tokens.shift();
@@ -50672,6 +50680,7 @@ stores.inject(MyMetaStore, storeInstance);
50672
50680
  case "REMOTE_REVISION":
50673
50681
  case "REVISION_REDONE":
50674
50682
  case "REVISION_UNDONE":
50683
+ case "SNAPSHOT_CREATED":
50675
50684
  return this.processedRevisions.has(message.nextRevisionId);
50676
50685
  default:
50677
50686
  return false;
@@ -52138,6 +52147,9 @@ stores.inject(MyMetaStore, storeInstance);
52138
52147
  case "FOLD_HEADER_GROUP":
52139
52148
  case "FOLD_ALL_HEADER_GROUPS":
52140
52149
  case "UNFOLD_ALL_HEADER_GROUPS":
52150
+ case "FOLD_HEADER_GROUPS_IN_ZONE":
52151
+ case "UNFOLD_HEADER_GROUPS_IN_ZONE":
52152
+ case "UNGROUP_HEADERS":
52141
52153
  case "UPDATE_TABLE":
52142
52154
  case "UPDATE_FILTER":
52143
52155
  delete this.tableStyles[cmd.sheetId];
@@ -52833,6 +52845,8 @@ stores.inject(MyMetaStore, storeInstance);
52833
52845
  case "UNFOLD_HEADER_GROUP":
52834
52846
  case "FOLD_ALL_HEADER_GROUPS":
52835
52847
  case "UNFOLD_ALL_HEADER_GROUPS":
52848
+ case "FOLD_HEADER_GROUPS_IN_ZONE":
52849
+ case "UNFOLD_HEADER_GROUPS_IN_ZONE":
52836
52850
  this.updateHiddenRows(cmd.sheetId);
52837
52851
  break;
52838
52852
  case "UPDATE_FILTER":
@@ -59040,7 +59054,8 @@ stores.inject(MyMetaStore, storeInstance);
59040
59054
  }
59041
59055
  const attrs = [["t", type]];
59042
59056
  const XlsxFormula = adaptFormulaToExcel(formula);
59043
- const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${cell.value}</v>`;
59057
+ const exportedValue = adaptFormulaValueToExcel(cell.value);
59058
+ const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${exportedValue}</v>`;
59044
59059
  return { attrs, node };
59045
59060
  }
59046
59061
  function addContent(content, sharedStrings, forceString = false) {
@@ -59075,8 +59090,14 @@ stores.inject(MyMetaStore, storeInstance);
59075
59090
  ast = addMissingRequiredArgs(ast);
59076
59091
  return ast;
59077
59092
  });
59093
+ ast = convertAstNodes(ast, "REFERENCE", (ast) => {
59094
+ return ast.value === CellErrorType.InvalidReference ? { ...ast, value: "#REF!" } : ast;
59095
+ });
59078
59096
  return ast ? astToFormula(ast) : formulaText;
59079
59097
  }
59098
+ function adaptFormulaValueToExcel(formulaValue) {
59099
+ return formulaValue === CellErrorType.InvalidReference ? "#REF!" : formulaValue;
59100
+ }
59080
59101
  /**
59081
59102
  * Some Excel function need required args that might not be mandatory in o-spreadsheet.
59082
59103
  * This adds those missing args.
@@ -60947,9 +60968,9 @@ stores.inject(MyMetaStore, storeInstance);
60947
60968
  exports.tokenize = tokenize;
60948
60969
 
60949
60970
 
60950
- __info__.version = "17.2.23";
60951
- __info__.date = "2024-09-05T09:32:03.325Z";
60952
- __info__.hash = "e5e2be8";
60971
+ __info__.version = "17.2.25";
60972
+ __info__.date = "2024-11-08T12:13:19.966Z";
60973
+ __info__.hash = "40d42f8";
60953
60974
 
60954
60975
 
60955
60976
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);