@odoo/o-spreadsheet 18.1.17 → 18.1.18

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 18.1.17
6
- * @date 2025-04-25T08:08:46.599Z
7
- * @hash a63687f
5
+ * @version 18.1.18
6
+ * @date 2025-05-02T12:30:47.822Z
7
+ * @hash 29c21c6
8
8
  */
9
9
 
10
10
  'use strict';
@@ -3762,6 +3762,7 @@ exports.CommandResult = void 0;
3762
3762
  CommandResult["ValueCellIsInvalidFormula"] = "ValueCellIsInvalidFormula";
3763
3763
  CommandResult["InvalidDefinition"] = "InvalidDefinition";
3764
3764
  CommandResult["InvalidColor"] = "InvalidColor";
3765
+ CommandResult["InvalidPivotDataSet"] = "InvalidPivotDataSet";
3765
3766
  })(exports.CommandResult || (exports.CommandResult = {}));
3766
3767
 
3767
3768
  const DEFAULT_LOCALES = [
@@ -10009,7 +10010,7 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10009
10010
  const yMin = chart.chartArea.top;
10010
10011
  const textsPositions = {};
10011
10012
  for (const dataset of chart._metasets) {
10012
- if (isTrendLineAxis(dataset.axisID) || dataset.hidden) {
10013
+ if (isTrendLineAxis(dataset.xAxisID) || dataset.hidden) {
10013
10014
  continue;
10014
10015
  }
10015
10016
  for (let i = 0; i < dataset._parsed.length; i++) {
@@ -10052,7 +10053,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10052
10053
  const xMin = chart.chartArea.left;
10053
10054
  const textsPositions = {};
10054
10055
  for (const dataset of chart._metasets) {
10055
- if (isTrendLineAxis(dataset.axisID)) {
10056
+ if (isTrendLineAxis(dataset.xAxisID)) {
10056
10057
  return; // ignore trend lines
10057
10058
  }
10058
10059
  for (let i = 0; i < dataset._parsed.length; i++) {
@@ -10168,6 +10169,7 @@ class ChartJsComponent extends owl.Component {
10168
10169
  canvas = owl.useRef("graphContainer");
10169
10170
  chart;
10170
10171
  currentRuntime;
10172
+ currentDevicePixelRatio = window.devicePixelRatio;
10171
10173
  get background() {
10172
10174
  return this.chartRuntime.background;
10173
10175
  }
@@ -10201,6 +10203,10 @@ class ChartJsComponent extends owl.Component {
10201
10203
  }
10202
10204
  this.currentRuntime = runtime;
10203
10205
  }
10206
+ else if (this.currentDevicePixelRatio !== window.devicePixelRatio) {
10207
+ this.currentDevicePixelRatio = window.devicePixelRatio;
10208
+ this.updateChartJs(deepCopy(this.currentRuntime.chartJsConfig));
10209
+ }
10204
10210
  });
10205
10211
  }
10206
10212
  createChart(chartData) {
@@ -10456,9 +10462,11 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
10456
10462
  };
10457
10463
  function drawScoreChart(structure, canvas) {
10458
10464
  const ctx = canvas.getContext("2d");
10459
- canvas.width = structure.canvas.width;
10460
- const availableWidth = canvas.width - CHART_PADDING$1 * 2;
10461
- canvas.height = structure.canvas.height;
10465
+ const dpr = window.devicePixelRatio || 1;
10466
+ canvas.width = dpr * structure.canvas.width;
10467
+ canvas.height = dpr * structure.canvas.height;
10468
+ ctx.scale(dpr, dpr);
10469
+ const availableWidth = structure.canvas.width - CHART_PADDING$1 * 2;
10462
10470
  ctx.fillStyle = structure.canvas.backgroundColor;
10463
10471
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
10464
10472
  if (structure.title) {
@@ -10821,7 +10829,7 @@ class ScorecardChart extends owl.Component {
10821
10829
  owl.useEffect(this.createChart.bind(this), () => {
10822
10830
  const canvas = this.canvas.el;
10823
10831
  const rect = canvas.getBoundingClientRect();
10824
- return [rect.width, rect.height, this.runtime, this.canvas.el];
10832
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
10825
10833
  });
10826
10834
  }
10827
10835
  createChart() {
@@ -22410,9 +22418,11 @@ const GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN = 6;
22410
22418
  const GAUGE_TITLE_SECTION_HEIGHT = 25;
22411
22419
  function drawGaugeChart(canvas, runtime) {
22412
22420
  const canvasBoundingRect = canvas.getBoundingClientRect();
22413
- canvas.width = canvasBoundingRect.width;
22414
- canvas.height = canvasBoundingRect.height;
22421
+ const dpr = window.devicePixelRatio || 1;
22422
+ canvas.width = dpr * canvasBoundingRect.width;
22423
+ canvas.height = dpr * canvasBoundingRect.height;
22415
22424
  const ctx = canvas.getContext("2d");
22425
+ ctx.scale(dpr, dpr);
22416
22426
  const config = getGaugeRenderingConfig(canvasBoundingRect, runtime, ctx);
22417
22427
  drawBackground(ctx, config);
22418
22428
  drawGauge(ctx, config);
@@ -22747,7 +22757,7 @@ class GaugeChartComponent extends owl.Component {
22747
22757
  owl.useEffect(() => drawGaugeChart(this.canvas.el, this.runtime), () => {
22748
22758
  const canvas = this.canvas.el;
22749
22759
  const rect = canvas.getBoundingClientRect();
22750
- return [rect.width, rect.height, this.runtime, this.canvas.el];
22760
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
22751
22761
  });
22752
22762
  }
22753
22763
  }
@@ -29559,7 +29569,7 @@ function getBarChartScales(definition, args) {
29559
29569
  };
29560
29570
  scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID] = {
29561
29571
  ...scales.x,
29562
- offset: false,
29572
+ offset: true,
29563
29573
  display: false,
29564
29574
  };
29565
29575
  }
@@ -30156,9 +30166,6 @@ class BarChart extends AbstractChart {
30156
30166
  };
30157
30167
  }
30158
30168
  getDefinitionForExcel() {
30159
- // Excel does not support aggregating labels
30160
- if (this.aggregated)
30161
- return undefined;
30162
30169
  const dataSets = this.dataSets
30163
30170
  .map((ds) => toExcelDataset(this.getters, ds))
30164
30171
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -30839,9 +30846,6 @@ class LineChart extends AbstractChart {
30839
30846
  return new LineChart(definition, this.sheetId, this.getters);
30840
30847
  }
30841
30848
  getDefinitionForExcel() {
30842
- // Excel does not support aggregating labels
30843
- if (this.aggregated)
30844
- return undefined;
30845
30849
  const dataSets = this.dataSets
30846
30850
  .map((ds) => toExcelDataset(this.getters, ds))
30847
30851
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -30978,9 +30982,6 @@ class PieChart extends AbstractChart {
30978
30982
  return new PieChart(definition, sheetId, this.getters);
30979
30983
  }
30980
30984
  getDefinitionForExcel() {
30981
- // Excel does not support aggregating labels
30982
- if (this.aggregated)
30983
- return undefined;
30984
30985
  const dataSets = this.dataSets
30985
30986
  .map((ds) => toExcelDataset(this.getters, ds))
30986
30987
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -33456,18 +33457,28 @@ function isCtrlKey(ev) {
33456
33457
  function useInterval(callback, delay) {
33457
33458
  let intervalId;
33458
33459
  const { setInterval, clearInterval } = window;
33460
+ const pause = () => {
33461
+ clearInterval(intervalId);
33462
+ intervalId = undefined;
33463
+ };
33464
+ const safeCallback = () => {
33465
+ try {
33466
+ callback();
33467
+ }
33468
+ catch (e) {
33469
+ pause();
33470
+ throw e;
33471
+ }
33472
+ };
33459
33473
  owl.useEffect(() => {
33460
- intervalId = setInterval(callback, delay);
33474
+ intervalId = setInterval(safeCallback, delay);
33461
33475
  return () => clearInterval(intervalId);
33462
33476
  }, () => [delay]);
33463
33477
  return {
33464
- pause: () => {
33465
- clearInterval(intervalId);
33466
- intervalId = undefined;
33467
- },
33478
+ pause,
33468
33479
  resume: () => {
33469
33480
  if (intervalId === undefined) {
33470
- intervalId = setInterval(callback, delay);
33481
+ intervalId = setInterval(safeCallback, delay);
33471
33482
  }
33472
33483
  },
33473
33484
  };
@@ -50456,7 +50467,7 @@ css /* scss */ `
50456
50467
  position: absolute;
50457
50468
  top: 0;
50458
50469
  left: ${HEADER_WIDTH}px;
50459
- right: 0;
50470
+ right: ${SCROLLBAR_WIDTH}px;
50460
50471
  height: ${HEADER_HEIGHT}px;
50461
50472
  &.o-dragging {
50462
50473
  cursor: grabbing;
@@ -50622,9 +50633,8 @@ css /* scss */ `
50622
50633
  position: absolute;
50623
50634
  top: ${HEADER_HEIGHT}px;
50624
50635
  left: 0;
50625
- right: 0;
50636
+ bottom: ${SCROLLBAR_WIDTH}px;
50626
50637
  width: ${HEADER_WIDTH}px;
50627
- height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px);
50628
50638
  &.o-dragging {
50629
50639
  cursor: grabbing;
50630
50640
  }
@@ -58625,6 +58635,15 @@ function adaptPivotRange(range, applyChange) {
58625
58635
  }
58626
58636
  }
58627
58637
  class SpreadsheetPivotCorePlugin extends CorePlugin {
58638
+ allowDispatch(cmd) {
58639
+ switch (cmd.type) {
58640
+ case "ADD_PIVOT":
58641
+ case "UPDATE_PIVOT":
58642
+ const definition = cmd.pivot;
58643
+ return this.checkDataSetValidity(definition);
58644
+ }
58645
+ return "Success" /* CommandResult.Success */;
58646
+ }
58628
58647
  adaptRanges(applyChange) {
58629
58648
  for (const pivotId of this.getters.getPivotIds()) {
58630
58649
  const definition = this.getters.getPivotCoreDefinition(pivotId);
@@ -58643,6 +58662,16 @@ class SpreadsheetPivotCorePlugin extends CorePlugin {
58643
58662
  }
58644
58663
  }
58645
58664
  }
58665
+ checkDataSetValidity(definition) {
58666
+ if (definition.type === "SPREADSHEET" && definition.dataSet) {
58667
+ const { zone, sheetId } = definition.dataSet;
58668
+ if (!sheetId || !this.getters.tryGetSheet(sheetId) || !zone || !isZoneValid(zone)) {
58669
+ return "InvalidDataSet" /* CommandResult.InvalidDataSet */;
58670
+ }
58671
+ return this.getters.checkZonesExistInSheet(sheetId, [zone]);
58672
+ }
58673
+ return "Success" /* CommandResult.Success */;
58674
+ }
58646
58675
  }
58647
58676
 
58648
58677
  class TableStylePlugin extends CorePlugin {
@@ -61442,7 +61471,7 @@ class DynamicTablesPlugin extends UIPlugin {
61442
61471
  tables = {};
61443
61472
  handle(cmd) {
61444
61473
  if (invalidateEvaluationCommands.has(cmd.type) ||
61445
- (cmd.type === "UPDATE_CELL" && "content" in cmd) ||
61474
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
61446
61475
  cmd.type === "EVALUATE_CELLS") {
61447
61476
  this.tables = {};
61448
61477
  return;
@@ -65299,7 +65328,7 @@ class TableComputedStylePlugin extends UIPlugin {
65299
65328
  tableStyles = {};
65300
65329
  handle(cmd) {
65301
65330
  if (invalidateEvaluationCommands.has(cmd.type) ||
65302
- (cmd.type === "UPDATE_CELL" && "content" in cmd) ||
65331
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
65303
65332
  cmd.type === "EVALUATE_CELLS") {
65304
65333
  this.tableStyles = {};
65305
65334
  return;
@@ -67263,6 +67292,8 @@ class GridSelectionPlugin extends UIPlugin {
67263
67292
  });
67264
67293
  this.selectCell(col, row);
67265
67294
  }
67295
+ const { col, row } = this.gridSelection.anchor.cell;
67296
+ this.moveClient({ sheetId: this.activeSheet.id, col, row });
67266
67297
  }
67267
67298
  /**
67268
67299
  * Ensure selections are not outside sheet boundaries.
@@ -68002,8 +68033,11 @@ class SheetViewPlugin extends UIPlugin {
68002
68033
  case "REMOVE_TABLE":
68003
68034
  case "UPDATE_TABLE":
68004
68035
  case "UPDATE_FILTER":
68005
- this.sheetsWithDirtyViewports.add(cmd.sheetId);
68006
- break;
68036
+ case "UNFREEZE_ROWS":
68037
+ case "UNFREEZE_COLUMNS":
68038
+ case "FREEZE_COLUMNS":
68039
+ case "FREEZE_ROWS":
68040
+ case "UNFREEZE_COLUMNS_ROWS":
68007
68041
  case "REMOVE_COLUMNS_ROWS":
68008
68042
  case "RESIZE_COLUMNS_ROWS":
68009
68043
  case "HIDE_COLUMNS_ROWS":
@@ -68016,11 +68050,9 @@ class SheetViewPlugin extends UIPlugin {
68016
68050
  case "FOLD_HEADER_GROUPS_IN_ZONE":
68017
68051
  case "UNFOLD_HEADER_GROUPS_IN_ZONE":
68018
68052
  case "UNFOLD_ALL_HEADER_GROUPS":
68019
- case "FOLD_ALL_HEADER_GROUPS": {
68020
- const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.getActiveSheetId();
68021
- this.sheetsWithDirtyViewports.add(sheetId);
68053
+ case "FOLD_ALL_HEADER_GROUPS":
68054
+ this.sheetsWithDirtyViewports.add(cmd.sheetId);
68022
68055
  break;
68023
- }
68024
68056
  case "UPDATE_CELL":
68025
68057
  // update cell content or format can change hidden rows because of data filters
68026
68058
  if ("content" in cmd || "format" in cmd || cmd.style?.fontSize !== undefined) {
@@ -68036,13 +68068,6 @@ class SheetViewPlugin extends UIPlugin {
68036
68068
  case "ACTIVATE_SHEET":
68037
68069
  this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
68038
68070
  break;
68039
- case "UNFREEZE_ROWS":
68040
- case "UNFREEZE_COLUMNS":
68041
- case "FREEZE_COLUMNS":
68042
- case "FREEZE_ROWS":
68043
- case "UNFREEZE_COLUMNS_ROWS":
68044
- this.resetViewports(this.getters.getActiveSheetId());
68045
- break;
68046
68071
  case "SCROLL_TO_CELL":
68047
68072
  this.refreshViewport(this.getters.getActiveSheetId(), { col: cmd.col, row: cmd.row });
68048
68073
  break;
@@ -69220,7 +69245,7 @@ class AggregateStatisticsStore extends SpreadsheetStore {
69220
69245
  }
69221
69246
  handle(cmd) {
69222
69247
  if (invalidateEvaluationCommands.has(cmd.type) ||
69223
- (cmd.type === "UPDATE_CELL" && "content" in cmd)) {
69248
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd))) {
69224
69249
  this.isDirty = true;
69225
69250
  }
69226
69251
  switch (cmd.type) {
@@ -75781,6 +75806,6 @@ exports.tokenColors = tokenColors;
75781
75806
  exports.tokenize = tokenize;
75782
75807
 
75783
75808
 
75784
- __info__.version = "18.1.17";
75785
- __info__.date = "2025-04-25T08:08:46.599Z";
75786
- __info__.hash = "a63687f";
75809
+ __info__.version = "18.1.18";
75810
+ __info__.date = "2025-05-02T12:30:47.822Z";
75811
+ __info__.hash = "29c21c6";
@@ -3147,7 +3147,8 @@ declare const enum CommandResult {
3147
3147
  EmptyName = "EmptyName",
3148
3148
  ValueCellIsInvalidFormula = "ValueCellIsInvalidFormula",
3149
3149
  InvalidDefinition = "InvalidDefinition",
3150
- InvalidColor = "InvalidColor"
3150
+ InvalidColor = "InvalidColor",
3151
+ InvalidPivotDataSet = "InvalidPivotDataSet"
3151
3152
  }
3152
3153
  interface CommandHandler<T> {
3153
3154
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -8558,6 +8559,7 @@ declare class ChartJsComponent extends Component<Props$O, SpreadsheetChildEnv> {
8558
8559
  private canvas;
8559
8560
  private chart?;
8560
8561
  private currentRuntime;
8562
+ private currentDevicePixelRatio;
8561
8563
  get background(): string;
8562
8564
  get canvasStyle(): string;
8563
8565
  get chartRuntime(): ChartJSRuntime;
@@ -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 18.1.17
6
- * @date 2025-04-25T08:08:46.599Z
7
- * @hash a63687f
5
+ * @version 18.1.18
6
+ * @date 2025-05-02T12:30:47.822Z
7
+ * @hash 29c21c6
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -3760,6 +3760,7 @@ var CommandResult;
3760
3760
  CommandResult["ValueCellIsInvalidFormula"] = "ValueCellIsInvalidFormula";
3761
3761
  CommandResult["InvalidDefinition"] = "InvalidDefinition";
3762
3762
  CommandResult["InvalidColor"] = "InvalidColor";
3763
+ CommandResult["InvalidPivotDataSet"] = "InvalidPivotDataSet";
3763
3764
  })(CommandResult || (CommandResult = {}));
3764
3765
 
3765
3766
  const DEFAULT_LOCALES = [
@@ -10007,7 +10008,7 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10007
10008
  const yMin = chart.chartArea.top;
10008
10009
  const textsPositions = {};
10009
10010
  for (const dataset of chart._metasets) {
10010
- if (isTrendLineAxis(dataset.axisID) || dataset.hidden) {
10011
+ if (isTrendLineAxis(dataset.xAxisID) || dataset.hidden) {
10011
10012
  continue;
10012
10013
  }
10013
10014
  for (let i = 0; i < dataset._parsed.length; i++) {
@@ -10050,7 +10051,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10050
10051
  const xMin = chart.chartArea.left;
10051
10052
  const textsPositions = {};
10052
10053
  for (const dataset of chart._metasets) {
10053
- if (isTrendLineAxis(dataset.axisID)) {
10054
+ if (isTrendLineAxis(dataset.xAxisID)) {
10054
10055
  return; // ignore trend lines
10055
10056
  }
10056
10057
  for (let i = 0; i < dataset._parsed.length; i++) {
@@ -10166,6 +10167,7 @@ class ChartJsComponent extends Component {
10166
10167
  canvas = useRef("graphContainer");
10167
10168
  chart;
10168
10169
  currentRuntime;
10170
+ currentDevicePixelRatio = window.devicePixelRatio;
10169
10171
  get background() {
10170
10172
  return this.chartRuntime.background;
10171
10173
  }
@@ -10199,6 +10201,10 @@ class ChartJsComponent extends Component {
10199
10201
  }
10200
10202
  this.currentRuntime = runtime;
10201
10203
  }
10204
+ else if (this.currentDevicePixelRatio !== window.devicePixelRatio) {
10205
+ this.currentDevicePixelRatio = window.devicePixelRatio;
10206
+ this.updateChartJs(deepCopy(this.currentRuntime.chartJsConfig));
10207
+ }
10202
10208
  });
10203
10209
  }
10204
10210
  createChart(chartData) {
@@ -10454,9 +10460,11 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
10454
10460
  };
10455
10461
  function drawScoreChart(structure, canvas) {
10456
10462
  const ctx = canvas.getContext("2d");
10457
- canvas.width = structure.canvas.width;
10458
- const availableWidth = canvas.width - CHART_PADDING$1 * 2;
10459
- canvas.height = structure.canvas.height;
10463
+ const dpr = window.devicePixelRatio || 1;
10464
+ canvas.width = dpr * structure.canvas.width;
10465
+ canvas.height = dpr * structure.canvas.height;
10466
+ ctx.scale(dpr, dpr);
10467
+ const availableWidth = structure.canvas.width - CHART_PADDING$1 * 2;
10460
10468
  ctx.fillStyle = structure.canvas.backgroundColor;
10461
10469
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
10462
10470
  if (structure.title) {
@@ -10819,7 +10827,7 @@ class ScorecardChart extends Component {
10819
10827
  useEffect(this.createChart.bind(this), () => {
10820
10828
  const canvas = this.canvas.el;
10821
10829
  const rect = canvas.getBoundingClientRect();
10822
- return [rect.width, rect.height, this.runtime, this.canvas.el];
10830
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
10823
10831
  });
10824
10832
  }
10825
10833
  createChart() {
@@ -22408,9 +22416,11 @@ const GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN = 6;
22408
22416
  const GAUGE_TITLE_SECTION_HEIGHT = 25;
22409
22417
  function drawGaugeChart(canvas, runtime) {
22410
22418
  const canvasBoundingRect = canvas.getBoundingClientRect();
22411
- canvas.width = canvasBoundingRect.width;
22412
- canvas.height = canvasBoundingRect.height;
22419
+ const dpr = window.devicePixelRatio || 1;
22420
+ canvas.width = dpr * canvasBoundingRect.width;
22421
+ canvas.height = dpr * canvasBoundingRect.height;
22413
22422
  const ctx = canvas.getContext("2d");
22423
+ ctx.scale(dpr, dpr);
22414
22424
  const config = getGaugeRenderingConfig(canvasBoundingRect, runtime, ctx);
22415
22425
  drawBackground(ctx, config);
22416
22426
  drawGauge(ctx, config);
@@ -22745,7 +22755,7 @@ class GaugeChartComponent extends Component {
22745
22755
  useEffect(() => drawGaugeChart(this.canvas.el, this.runtime), () => {
22746
22756
  const canvas = this.canvas.el;
22747
22757
  const rect = canvas.getBoundingClientRect();
22748
- return [rect.width, rect.height, this.runtime, this.canvas.el];
22758
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
22749
22759
  });
22750
22760
  }
22751
22761
  }
@@ -29557,7 +29567,7 @@ function getBarChartScales(definition, args) {
29557
29567
  };
29558
29568
  scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID] = {
29559
29569
  ...scales.x,
29560
- offset: false,
29570
+ offset: true,
29561
29571
  display: false,
29562
29572
  };
29563
29573
  }
@@ -30154,9 +30164,6 @@ class BarChart extends AbstractChart {
30154
30164
  };
30155
30165
  }
30156
30166
  getDefinitionForExcel() {
30157
- // Excel does not support aggregating labels
30158
- if (this.aggregated)
30159
- return undefined;
30160
30167
  const dataSets = this.dataSets
30161
30168
  .map((ds) => toExcelDataset(this.getters, ds))
30162
30169
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -30837,9 +30844,6 @@ class LineChart extends AbstractChart {
30837
30844
  return new LineChart(definition, this.sheetId, this.getters);
30838
30845
  }
30839
30846
  getDefinitionForExcel() {
30840
- // Excel does not support aggregating labels
30841
- if (this.aggregated)
30842
- return undefined;
30843
30847
  const dataSets = this.dataSets
30844
30848
  .map((ds) => toExcelDataset(this.getters, ds))
30845
30849
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -30976,9 +30980,6 @@ class PieChart extends AbstractChart {
30976
30980
  return new PieChart(definition, sheetId, this.getters);
30977
30981
  }
30978
30982
  getDefinitionForExcel() {
30979
- // Excel does not support aggregating labels
30980
- if (this.aggregated)
30981
- return undefined;
30982
30983
  const dataSets = this.dataSets
30983
30984
  .map((ds) => toExcelDataset(this.getters, ds))
30984
30985
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -33454,18 +33455,28 @@ function isCtrlKey(ev) {
33454
33455
  function useInterval(callback, delay) {
33455
33456
  let intervalId;
33456
33457
  const { setInterval, clearInterval } = window;
33458
+ const pause = () => {
33459
+ clearInterval(intervalId);
33460
+ intervalId = undefined;
33461
+ };
33462
+ const safeCallback = () => {
33463
+ try {
33464
+ callback();
33465
+ }
33466
+ catch (e) {
33467
+ pause();
33468
+ throw e;
33469
+ }
33470
+ };
33457
33471
  useEffect(() => {
33458
- intervalId = setInterval(callback, delay);
33472
+ intervalId = setInterval(safeCallback, delay);
33459
33473
  return () => clearInterval(intervalId);
33460
33474
  }, () => [delay]);
33461
33475
  return {
33462
- pause: () => {
33463
- clearInterval(intervalId);
33464
- intervalId = undefined;
33465
- },
33476
+ pause,
33466
33477
  resume: () => {
33467
33478
  if (intervalId === undefined) {
33468
- intervalId = setInterval(callback, delay);
33479
+ intervalId = setInterval(safeCallback, delay);
33469
33480
  }
33470
33481
  },
33471
33482
  };
@@ -50454,7 +50465,7 @@ css /* scss */ `
50454
50465
  position: absolute;
50455
50466
  top: 0;
50456
50467
  left: ${HEADER_WIDTH}px;
50457
- right: 0;
50468
+ right: ${SCROLLBAR_WIDTH}px;
50458
50469
  height: ${HEADER_HEIGHT}px;
50459
50470
  &.o-dragging {
50460
50471
  cursor: grabbing;
@@ -50620,9 +50631,8 @@ css /* scss */ `
50620
50631
  position: absolute;
50621
50632
  top: ${HEADER_HEIGHT}px;
50622
50633
  left: 0;
50623
- right: 0;
50634
+ bottom: ${SCROLLBAR_WIDTH}px;
50624
50635
  width: ${HEADER_WIDTH}px;
50625
- height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px);
50626
50636
  &.o-dragging {
50627
50637
  cursor: grabbing;
50628
50638
  }
@@ -58623,6 +58633,15 @@ function adaptPivotRange(range, applyChange) {
58623
58633
  }
58624
58634
  }
58625
58635
  class SpreadsheetPivotCorePlugin extends CorePlugin {
58636
+ allowDispatch(cmd) {
58637
+ switch (cmd.type) {
58638
+ case "ADD_PIVOT":
58639
+ case "UPDATE_PIVOT":
58640
+ const definition = cmd.pivot;
58641
+ return this.checkDataSetValidity(definition);
58642
+ }
58643
+ return "Success" /* CommandResult.Success */;
58644
+ }
58626
58645
  adaptRanges(applyChange) {
58627
58646
  for (const pivotId of this.getters.getPivotIds()) {
58628
58647
  const definition = this.getters.getPivotCoreDefinition(pivotId);
@@ -58641,6 +58660,16 @@ class SpreadsheetPivotCorePlugin extends CorePlugin {
58641
58660
  }
58642
58661
  }
58643
58662
  }
58663
+ checkDataSetValidity(definition) {
58664
+ if (definition.type === "SPREADSHEET" && definition.dataSet) {
58665
+ const { zone, sheetId } = definition.dataSet;
58666
+ if (!sheetId || !this.getters.tryGetSheet(sheetId) || !zone || !isZoneValid(zone)) {
58667
+ return "InvalidDataSet" /* CommandResult.InvalidDataSet */;
58668
+ }
58669
+ return this.getters.checkZonesExistInSheet(sheetId, [zone]);
58670
+ }
58671
+ return "Success" /* CommandResult.Success */;
58672
+ }
58644
58673
  }
58645
58674
 
58646
58675
  class TableStylePlugin extends CorePlugin {
@@ -61440,7 +61469,7 @@ class DynamicTablesPlugin extends UIPlugin {
61440
61469
  tables = {};
61441
61470
  handle(cmd) {
61442
61471
  if (invalidateEvaluationCommands.has(cmd.type) ||
61443
- (cmd.type === "UPDATE_CELL" && "content" in cmd) ||
61472
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
61444
61473
  cmd.type === "EVALUATE_CELLS") {
61445
61474
  this.tables = {};
61446
61475
  return;
@@ -65297,7 +65326,7 @@ class TableComputedStylePlugin extends UIPlugin {
65297
65326
  tableStyles = {};
65298
65327
  handle(cmd) {
65299
65328
  if (invalidateEvaluationCommands.has(cmd.type) ||
65300
- (cmd.type === "UPDATE_CELL" && "content" in cmd) ||
65329
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
65301
65330
  cmd.type === "EVALUATE_CELLS") {
65302
65331
  this.tableStyles = {};
65303
65332
  return;
@@ -67261,6 +67290,8 @@ class GridSelectionPlugin extends UIPlugin {
67261
67290
  });
67262
67291
  this.selectCell(col, row);
67263
67292
  }
67293
+ const { col, row } = this.gridSelection.anchor.cell;
67294
+ this.moveClient({ sheetId: this.activeSheet.id, col, row });
67264
67295
  }
67265
67296
  /**
67266
67297
  * Ensure selections are not outside sheet boundaries.
@@ -68000,8 +68031,11 @@ class SheetViewPlugin extends UIPlugin {
68000
68031
  case "REMOVE_TABLE":
68001
68032
  case "UPDATE_TABLE":
68002
68033
  case "UPDATE_FILTER":
68003
- this.sheetsWithDirtyViewports.add(cmd.sheetId);
68004
- break;
68034
+ case "UNFREEZE_ROWS":
68035
+ case "UNFREEZE_COLUMNS":
68036
+ case "FREEZE_COLUMNS":
68037
+ case "FREEZE_ROWS":
68038
+ case "UNFREEZE_COLUMNS_ROWS":
68005
68039
  case "REMOVE_COLUMNS_ROWS":
68006
68040
  case "RESIZE_COLUMNS_ROWS":
68007
68041
  case "HIDE_COLUMNS_ROWS":
@@ -68014,11 +68048,9 @@ class SheetViewPlugin extends UIPlugin {
68014
68048
  case "FOLD_HEADER_GROUPS_IN_ZONE":
68015
68049
  case "UNFOLD_HEADER_GROUPS_IN_ZONE":
68016
68050
  case "UNFOLD_ALL_HEADER_GROUPS":
68017
- case "FOLD_ALL_HEADER_GROUPS": {
68018
- const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.getActiveSheetId();
68019
- this.sheetsWithDirtyViewports.add(sheetId);
68051
+ case "FOLD_ALL_HEADER_GROUPS":
68052
+ this.sheetsWithDirtyViewports.add(cmd.sheetId);
68020
68053
  break;
68021
- }
68022
68054
  case "UPDATE_CELL":
68023
68055
  // update cell content or format can change hidden rows because of data filters
68024
68056
  if ("content" in cmd || "format" in cmd || cmd.style?.fontSize !== undefined) {
@@ -68034,13 +68066,6 @@ class SheetViewPlugin extends UIPlugin {
68034
68066
  case "ACTIVATE_SHEET":
68035
68067
  this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
68036
68068
  break;
68037
- case "UNFREEZE_ROWS":
68038
- case "UNFREEZE_COLUMNS":
68039
- case "FREEZE_COLUMNS":
68040
- case "FREEZE_ROWS":
68041
- case "UNFREEZE_COLUMNS_ROWS":
68042
- this.resetViewports(this.getters.getActiveSheetId());
68043
- break;
68044
68069
  case "SCROLL_TO_CELL":
68045
68070
  this.refreshViewport(this.getters.getActiveSheetId(), { col: cmd.col, row: cmd.row });
68046
68071
  break;
@@ -69218,7 +69243,7 @@ class AggregateStatisticsStore extends SpreadsheetStore {
69218
69243
  }
69219
69244
  handle(cmd) {
69220
69245
  if (invalidateEvaluationCommands.has(cmd.type) ||
69221
- (cmd.type === "UPDATE_CELL" && "content" in cmd)) {
69246
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd))) {
69222
69247
  this.isDirty = true;
69223
69248
  }
69224
69249
  switch (cmd.type) {
@@ -75735,6 +75760,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
75735
75760
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, 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 };
75736
75761
 
75737
75762
 
75738
- __info__.version = "18.1.17";
75739
- __info__.date = "2025-04-25T08:08:46.599Z";
75740
- __info__.hash = "a63687f";
75763
+ __info__.version = "18.1.18";
75764
+ __info__.date = "2025-05-02T12:30:47.822Z";
75765
+ __info__.hash = "29c21c6";