@odoo/o-spreadsheet 16.1.23 → 16.1.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.
@@ -26079,12 +26079,15 @@ function createXMLFile(doc, path, contentType) {
26079
26079
  };
26080
26080
  }
26081
26081
  function xmlEscape(str) {
26082
- return String(str)
26082
+ return (String(str)
26083
26083
  .replace(/\&/g, "&")
26084
26084
  .replace(/\</g, "&lt;")
26085
26085
  .replace(/\>/g, "&gt;")
26086
26086
  .replace(/\"/g, "&quot;")
26087
- .replace(/\'/g, "&apos;");
26087
+ .replace(/\'/g, "&apos;")
26088
+ // Delete all ASCII control characters except for TAB (\x09), LF (\x0A) and CR (\x0D)
26089
+ // They are not valid at all in XML 1.0 (even escaped)
26090
+ .replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, ""));
26088
26091
  }
26089
26092
  function formatAttributes(attrs) {
26090
26093
  return new XMLString(attrs.map(([key, val]) => `${key}="${xmlEscape(val)}"`).join(" "));
@@ -33020,6 +33023,10 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
33020
33023
  }
33021
33024
  currentRanges = currentRanges.concat(toAdd);
33022
33025
  const newRangesXC = recomputeZones(currentRanges, toRemove);
33026
+ if (newRangesXC.length === 0) {
33027
+ this.dispatch("REMOVE_CONDITIONAL_FORMAT", { id: cf.id, sheetId });
33028
+ return;
33029
+ }
33023
33030
  this.dispatch("ADD_CONDITIONAL_FORMAT", {
33024
33031
  cf: {
33025
33032
  id: cf.id,
@@ -39037,11 +39044,19 @@ class GridSelectionPlugin extends UIPlugin {
39037
39044
  }
39038
39045
  }
39039
39046
  getStatisticFnResults() {
39040
- // get deduplicated cells in zones
39041
- const cells = new Set(this.gridSelection.zones
39042
- .map((zone) => this.getters.getEvaluatedCellsInZone(this.getters.getActiveSheetId(), zone))
39043
- .flat()
39044
- .filter((cell) => cell.type !== CellValueType.empty));
39047
+ const sheetId = this.getters.getActiveSheetId();
39048
+ const cells = new Set();
39049
+ for (const zone of this.gridSelection.zones) {
39050
+ for (const { col, row } of positions(zone)) {
39051
+ if (this.getters.isRowHidden(sheetId, row) || this.getters.isColHidden(sheetId, col)) {
39052
+ continue; // Skip hidden cells
39053
+ }
39054
+ const evaluatedCell = this.getters.getEvaluatedCell({ sheetId, col, row });
39055
+ if (evaluatedCell.type !== CellValueType.empty) {
39056
+ cells.add(evaluatedCell);
39057
+ }
39058
+ }
39059
+ }
39045
39060
  let cellsTypes = new Set();
39046
39061
  let cellsValues = [];
39047
39062
  for (let cell of cells) {
@@ -44420,6 +44435,6 @@ exports.setTranslationMethod = setTranslationMethod;
44420
44435
  exports.tokenize = tokenize;
44421
44436
 
44422
44437
 
44423
- __info__.version = '16.1.23';
44424
- __info__.date = '2023-10-10T07:27:03.376Z';
44425
- __info__.hash = '13bfa8f';
44438
+ __info__.version = '16.1.25';
44439
+ __info__.date = '2023-10-25T10:02:09.978Z';
44440
+ __info__.hash = '708e3d8';
@@ -26075,12 +26075,15 @@ function createXMLFile(doc, path, contentType) {
26075
26075
  };
26076
26076
  }
26077
26077
  function xmlEscape(str) {
26078
- return String(str)
26078
+ return (String(str)
26079
26079
  .replace(/\&/g, "&amp;")
26080
26080
  .replace(/\</g, "&lt;")
26081
26081
  .replace(/\>/g, "&gt;")
26082
26082
  .replace(/\"/g, "&quot;")
26083
- .replace(/\'/g, "&apos;");
26083
+ .replace(/\'/g, "&apos;")
26084
+ // Delete all ASCII control characters except for TAB (\x09), LF (\x0A) and CR (\x0D)
26085
+ // They are not valid at all in XML 1.0 (even escaped)
26086
+ .replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, ""));
26084
26087
  }
26085
26088
  function formatAttributes(attrs) {
26086
26089
  return new XMLString(attrs.map(([key, val]) => `${key}="${xmlEscape(val)}"`).join(" "));
@@ -33016,6 +33019,10 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
33016
33019
  }
33017
33020
  currentRanges = currentRanges.concat(toAdd);
33018
33021
  const newRangesXC = recomputeZones(currentRanges, toRemove);
33022
+ if (newRangesXC.length === 0) {
33023
+ this.dispatch("REMOVE_CONDITIONAL_FORMAT", { id: cf.id, sheetId });
33024
+ return;
33025
+ }
33019
33026
  this.dispatch("ADD_CONDITIONAL_FORMAT", {
33020
33027
  cf: {
33021
33028
  id: cf.id,
@@ -39033,11 +39040,19 @@ class GridSelectionPlugin extends UIPlugin {
39033
39040
  }
39034
39041
  }
39035
39042
  getStatisticFnResults() {
39036
- // get deduplicated cells in zones
39037
- const cells = new Set(this.gridSelection.zones
39038
- .map((zone) => this.getters.getEvaluatedCellsInZone(this.getters.getActiveSheetId(), zone))
39039
- .flat()
39040
- .filter((cell) => cell.type !== CellValueType.empty));
39043
+ const sheetId = this.getters.getActiveSheetId();
39044
+ const cells = new Set();
39045
+ for (const zone of this.gridSelection.zones) {
39046
+ for (const { col, row } of positions(zone)) {
39047
+ if (this.getters.isRowHidden(sheetId, row) || this.getters.isColHidden(sheetId, col)) {
39048
+ continue; // Skip hidden cells
39049
+ }
39050
+ const evaluatedCell = this.getters.getEvaluatedCell({ sheetId, col, row });
39051
+ if (evaluatedCell.type !== CellValueType.empty) {
39052
+ cells.add(evaluatedCell);
39053
+ }
39054
+ }
39055
+ }
39041
39056
  let cellsTypes = new Set();
39042
39057
  let cellsValues = [];
39043
39058
  for (let cell of cells) {
@@ -44388,6 +44403,6 @@ function addFunction(functionName, functionDescription) {
44388
44403
  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 };
44389
44404
 
44390
44405
 
44391
- __info__.version = '16.1.23';
44392
- __info__.date = '2023-10-10T07:27:03.376Z';
44393
- __info__.hash = '13bfa8f';
44406
+ __info__.version = '16.1.25';
44407
+ __info__.date = '2023-10-25T10:02:09.978Z';
44408
+ __info__.hash = '708e3d8';
@@ -26076,12 +26076,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
26076
26076
  };
26077
26077
  }
26078
26078
  function xmlEscape(str) {
26079
- return String(str)
26079
+ return (String(str)
26080
26080
  .replace(/\&/g, "&amp;")
26081
26081
  .replace(/\</g, "&lt;")
26082
26082
  .replace(/\>/g, "&gt;")
26083
26083
  .replace(/\"/g, "&quot;")
26084
- .replace(/\'/g, "&apos;");
26084
+ .replace(/\'/g, "&apos;")
26085
+ // Delete all ASCII control characters except for TAB (\x09), LF (\x0A) and CR (\x0D)
26086
+ // They are not valid at all in XML 1.0 (even escaped)
26087
+ .replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, ""));
26085
26088
  }
26086
26089
  function formatAttributes(attrs) {
26087
26090
  return new XMLString(attrs.map(([key, val]) => `${key}="${xmlEscape(val)}"`).join(" "));
@@ -33017,6 +33020,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
33017
33020
  }
33018
33021
  currentRanges = currentRanges.concat(toAdd);
33019
33022
  const newRangesXC = recomputeZones(currentRanges, toRemove);
33023
+ if (newRangesXC.length === 0) {
33024
+ this.dispatch("REMOVE_CONDITIONAL_FORMAT", { id: cf.id, sheetId });
33025
+ return;
33026
+ }
33020
33027
  this.dispatch("ADD_CONDITIONAL_FORMAT", {
33021
33028
  cf: {
33022
33029
  id: cf.id,
@@ -39034,11 +39041,19 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
39034
39041
  }
39035
39042
  }
39036
39043
  getStatisticFnResults() {
39037
- // get deduplicated cells in zones
39038
- const cells = new Set(this.gridSelection.zones
39039
- .map((zone) => this.getters.getEvaluatedCellsInZone(this.getters.getActiveSheetId(), zone))
39040
- .flat()
39041
- .filter((cell) => cell.type !== CellValueType.empty));
39044
+ const sheetId = this.getters.getActiveSheetId();
39045
+ const cells = new Set();
39046
+ for (const zone of this.gridSelection.zones) {
39047
+ for (const { col, row } of positions(zone)) {
39048
+ if (this.getters.isRowHidden(sheetId, row) || this.getters.isColHidden(sheetId, col)) {
39049
+ continue; // Skip hidden cells
39050
+ }
39051
+ const evaluatedCell = this.getters.getEvaluatedCell({ sheetId, col, row });
39052
+ if (evaluatedCell.type !== CellValueType.empty) {
39053
+ cells.add(evaluatedCell);
39054
+ }
39055
+ }
39056
+ }
39042
39057
  let cellsTypes = new Set();
39043
39058
  let cellsValues = [];
39044
39059
  for (let cell of cells) {
@@ -44419,9 +44434,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
44419
44434
  Object.defineProperty(exports, '__esModule', { value: true });
44420
44435
 
44421
44436
 
44422
- __info__.version = '16.1.23';
44423
- __info__.date = '2023-10-10T07:27:03.376Z';
44424
- __info__.hash = '13bfa8f';
44437
+ __info__.version = '16.1.25';
44438
+ __info__.date = '2023-10-25T10:02:09.978Z';
44439
+ __info__.hash = '708e3d8';
44425
44440
 
44426
44441
 
44427
44442
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);