@odoo/o-spreadsheet 17.4.32 → 17.4.33

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.4.32
6
- * @date 2025-04-25T08:06:59.937Z
7
- * @hash c370ddf
5
+ * @version 17.4.33
6
+ * @date 2025-05-02T12:30:31.263Z
7
+ * @hash 3ba00e6
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -2361,6 +2361,7 @@
2361
2361
  CommandResult["InvalidTableResize"] = "InvalidTableResize";
2362
2362
  CommandResult["PivotIdNotFound"] = "PivotIdNotFound";
2363
2363
  CommandResult["EmptyName"] = "EmptyName";
2364
+ CommandResult["InvalidPivotDataSet"] = "InvalidPivotDataSet";
2364
2365
  })(exports.CommandResult || (exports.CommandResult = {}));
2365
2366
 
2366
2367
  const PLAIN_TEXT_FORMAT = "@"; // see OpenXML spec §18.8.31
@@ -12242,6 +12243,7 @@ stores.inject(MyMetaStore, storeInstance);
12242
12243
  canvas = owl.useRef("graphContainer");
12243
12244
  chart;
12244
12245
  currentRuntime;
12246
+ currentDevicePixelRatio = window.devicePixelRatio;
12245
12247
  get background() {
12246
12248
  return this.chartRuntime.background;
12247
12249
  }
@@ -12275,11 +12277,11 @@ stores.inject(MyMetaStore, storeInstance);
12275
12277
  }
12276
12278
  this.currentRuntime = runtime;
12277
12279
  }
12280
+ else if (this.currentDevicePixelRatio !== window.devicePixelRatio) {
12281
+ this.currentDevicePixelRatio = window.devicePixelRatio;
12282
+ this.updateChartJs(deepCopy(this.currentRuntime));
12283
+ }
12278
12284
  });
12279
- owl.useEffect(() => {
12280
- this.currentRuntime = this.chartRuntime;
12281
- this.updateChartJs(deepCopy(this.currentRuntime));
12282
- }, () => [window.devicePixelRatio]);
12283
12285
  }
12284
12286
  createChart(chartData) {
12285
12287
  const canvas = this.canvas.el;
@@ -22741,18 +22743,28 @@ stores.inject(MyMetaStore, storeInstance);
22741
22743
  function useInterval(callback, delay) {
22742
22744
  let intervalId;
22743
22745
  const { setInterval, clearInterval } = window;
22746
+ const pause = () => {
22747
+ clearInterval(intervalId);
22748
+ intervalId = undefined;
22749
+ };
22750
+ const safeCallback = () => {
22751
+ try {
22752
+ callback();
22753
+ }
22754
+ catch (e) {
22755
+ pause();
22756
+ throw e;
22757
+ }
22758
+ };
22744
22759
  owl.useEffect(() => {
22745
- intervalId = setInterval(callback, delay);
22760
+ intervalId = setInterval(safeCallback, delay);
22746
22761
  return () => clearInterval(intervalId);
22747
22762
  }, () => [delay]);
22748
22763
  return {
22749
- pause: () => {
22750
- clearInterval(intervalId);
22751
- intervalId = undefined;
22752
- },
22764
+ pause,
22753
22765
  resume: () => {
22754
22766
  if (intervalId === undefined) {
22755
- intervalId = setInterval(callback, delay);
22767
+ intervalId = setInterval(safeCallback, delay);
22756
22768
  }
22757
22769
  },
22758
22770
  };
@@ -25335,9 +25347,6 @@ stores.inject(MyMetaStore, storeInstance);
25335
25347
  };
25336
25348
  }
25337
25349
  getDefinitionForExcel() {
25338
- // Excel does not support aggregating labels
25339
- if (this.aggregated)
25340
- return undefined;
25341
25350
  const dataSets = this.dataSets
25342
25351
  .map((ds) => toExcelDataset(this.getters, ds))
25343
25352
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -26414,9 +26423,6 @@ stores.inject(MyMetaStore, storeInstance);
26414
26423
  return new LineChart(definition, this.sheetId, this.getters);
26415
26424
  }
26416
26425
  getDefinitionForExcel() {
26417
- // Excel does not support aggregating labels
26418
- if (this.aggregated)
26419
- return undefined;
26420
26426
  const dataSets = this.dataSets
26421
26427
  .map((ds) => toExcelDataset(this.getters, ds))
26422
26428
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -26527,9 +26533,6 @@ stores.inject(MyMetaStore, storeInstance);
26527
26533
  return new PieChart(definition, sheetId, this.getters);
26528
26534
  }
26529
26535
  getDefinitionForExcel() {
26530
- // Excel does not support aggregating labels
26531
- if (this.aggregated)
26532
- return undefined;
26533
26536
  const dataSets = this.dataSets
26534
26537
  .map((ds) => toExcelDataset(this.getters, ds))
26535
26538
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -40999,7 +41002,7 @@ stores.inject(MyMetaStore, storeInstance);
40999
41002
  position: absolute;
41000
41003
  top: 0;
41001
41004
  left: ${HEADER_WIDTH}px;
41002
- right: 0;
41005
+ right: ${SCROLLBAR_WIDTH}px;
41003
41006
  height: ${HEADER_HEIGHT}px;
41004
41007
  &.o-dragging {
41005
41008
  cursor: grabbing;
@@ -41165,9 +41168,8 @@ stores.inject(MyMetaStore, storeInstance);
41165
41168
  position: absolute;
41166
41169
  top: ${HEADER_HEIGHT}px;
41167
41170
  left: 0;
41168
- right: 0;
41171
+ bottom: ${SCROLLBAR_WIDTH}px;
41169
41172
  width: ${HEADER_WIDTH}px;
41170
- height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px);
41171
41173
  &.o-dragging {
41172
41174
  cursor: grabbing;
41173
41175
  }
@@ -53132,6 +53134,15 @@ stores.inject(MyMetaStore, storeInstance);
53132
53134
  }
53133
53135
  }
53134
53136
  class SpreadsheetPivotCorePlugin extends CorePlugin {
53137
+ allowDispatch(cmd) {
53138
+ switch (cmd.type) {
53139
+ case "ADD_PIVOT":
53140
+ case "UPDATE_PIVOT":
53141
+ const definition = cmd.pivot;
53142
+ return this.checkDataSetValidity(definition);
53143
+ }
53144
+ return "Success" /* CommandResult.Success */;
53145
+ }
53135
53146
  adaptRanges(applyChange) {
53136
53147
  for (const pivotId of this.getters.getPivotIds()) {
53137
53148
  const definition = this.getters.getPivotCoreDefinition(pivotId);
@@ -53150,6 +53161,16 @@ stores.inject(MyMetaStore, storeInstance);
53150
53161
  }
53151
53162
  }
53152
53163
  }
53164
+ checkDataSetValidity(definition) {
53165
+ if (definition.type === "SPREADSHEET" && definition.dataSet) {
53166
+ const { zone, sheetId } = definition.dataSet;
53167
+ if (!sheetId || !this.getters.tryGetSheet(sheetId) || !zone || !isZoneValid(zone)) {
53168
+ return "InvalidDataSet" /* CommandResult.InvalidDataSet */;
53169
+ }
53170
+ return this.getters.checkZonesExistInSheet(sheetId, [zone]);
53171
+ }
53172
+ return "Success" /* CommandResult.Success */;
53173
+ }
53153
53174
  }
53154
53175
 
53155
53176
  class TableStylePlugin extends CorePlugin {
@@ -55985,7 +56006,7 @@ stores.inject(MyMetaStore, storeInstance);
55985
56006
  tables = {};
55986
56007
  handle(cmd) {
55987
56008
  if (invalidateEvaluationCommands.has(cmd.type) ||
55988
- (cmd.type === "UPDATE_CELL" && "content" in cmd) ||
56009
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
55989
56010
  cmd.type === "EVALUATE_CELLS") {
55990
56011
  this.tables = {};
55991
56012
  return;
@@ -59122,7 +59143,7 @@ stores.inject(MyMetaStore, storeInstance);
59122
59143
  tableStyles = {};
59123
59144
  handle(cmd) {
59124
59145
  if (invalidateEvaluationCommands.has(cmd.type) ||
59125
- (cmd.type === "UPDATE_CELL" && "content" in cmd) ||
59146
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
59126
59147
  cmd.type === "EVALUATE_CELLS") {
59127
59148
  this.tableStyles = {};
59128
59149
  return;
@@ -61093,6 +61114,8 @@ stores.inject(MyMetaStore, storeInstance);
61093
61114
  });
61094
61115
  this.selectCell(col, row);
61095
61116
  }
61117
+ const { col, row } = this.gridSelection.anchor.cell;
61118
+ this.moveClient({ sheetId: this.activeSheet.id, col, row });
61096
61119
  }
61097
61120
  /**
61098
61121
  * Ensure selections are not outside sheet boundaries.
@@ -61825,8 +61848,11 @@ stores.inject(MyMetaStore, storeInstance);
61825
61848
  case "REMOVE_TABLE":
61826
61849
  case "UPDATE_TABLE":
61827
61850
  case "UPDATE_FILTER":
61828
- this.sheetsWithDirtyViewports.add(cmd.sheetId);
61829
- break;
61851
+ case "UNFREEZE_ROWS":
61852
+ case "UNFREEZE_COLUMNS":
61853
+ case "FREEZE_COLUMNS":
61854
+ case "FREEZE_ROWS":
61855
+ case "UNFREEZE_COLUMNS_ROWS":
61830
61856
  case "REMOVE_COLUMNS_ROWS":
61831
61857
  case "RESIZE_COLUMNS_ROWS":
61832
61858
  case "HIDE_COLUMNS_ROWS":
@@ -61839,11 +61865,9 @@ stores.inject(MyMetaStore, storeInstance);
61839
61865
  case "FOLD_HEADER_GROUPS_IN_ZONE":
61840
61866
  case "UNFOLD_HEADER_GROUPS_IN_ZONE":
61841
61867
  case "UNFOLD_ALL_HEADER_GROUPS":
61842
- case "FOLD_ALL_HEADER_GROUPS": {
61843
- const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.getActiveSheetId();
61844
- this.sheetsWithDirtyViewports.add(sheetId);
61868
+ case "FOLD_ALL_HEADER_GROUPS":
61869
+ this.sheetsWithDirtyViewports.add(cmd.sheetId);
61845
61870
  break;
61846
- }
61847
61871
  case "UPDATE_CELL":
61848
61872
  // update cell content or format can change hidden rows because of data filters
61849
61873
  if ("content" in cmd || "format" in cmd || cmd.style?.fontSize !== undefined) {
@@ -61859,13 +61883,6 @@ stores.inject(MyMetaStore, storeInstance);
61859
61883
  case "ACTIVATE_SHEET":
61860
61884
  this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
61861
61885
  break;
61862
- case "UNFREEZE_ROWS":
61863
- case "UNFREEZE_COLUMNS":
61864
- case "FREEZE_COLUMNS":
61865
- case "FREEZE_ROWS":
61866
- case "UNFREEZE_COLUMNS_ROWS":
61867
- this.resetViewports(this.getters.getActiveSheetId());
61868
- break;
61869
61886
  case "DELETE_SHEET":
61870
61887
  this.sheetsWithDirtyViewports.delete(cmd.sheetId);
61871
61888
  break;
@@ -63021,7 +63038,7 @@ stores.inject(MyMetaStore, storeInstance);
63021
63038
  }
63022
63039
  handle(cmd) {
63023
63040
  if (invalidateEvaluationCommands.has(cmd.type) ||
63024
- (cmd.type === "UPDATE_CELL" && "content" in cmd)) {
63041
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd))) {
63025
63042
  this.isDirty = true;
63026
63043
  }
63027
63044
  switch (cmd.type) {
@@ -69388,9 +69405,9 @@ stores.inject(MyMetaStore, storeInstance);
69388
69405
  exports.tokenize = tokenize;
69389
69406
 
69390
69407
 
69391
- __info__.version = "17.4.32";
69392
- __info__.date = "2025-04-25T08:06:59.937Z";
69393
- __info__.hash = "c370ddf";
69408
+ __info__.version = "17.4.33";
69409
+ __info__.date = "2025-05-02T12:30:31.263Z";
69410
+ __info__.hash = "3ba00e6";
69394
69411
 
69395
69412
 
69396
69413
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);