@odoo/o-spreadsheet 18.2.9 → 18.2.10

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.2.9
6
- * @date 2025-04-25T08:06:52.677Z
7
- * @hash 3e88645
5
+ * @version 18.2.10
6
+ * @date 2025-05-02T12:34:39.632Z
7
+ * @hash e8ff3fc
8
8
  */
9
9
 
10
10
  'use strict';
@@ -3771,6 +3771,7 @@ exports.CommandResult = void 0;
3771
3771
  CommandResult["ValueCellIsInvalidFormula"] = "ValueCellIsInvalidFormula";
3772
3772
  CommandResult["InvalidDefinition"] = "InvalidDefinition";
3773
3773
  CommandResult["InvalidColor"] = "InvalidColor";
3774
+ CommandResult["InvalidPivotDataSet"] = "InvalidPivotDataSet";
3774
3775
  })(exports.CommandResult || (exports.CommandResult = {}));
3775
3776
 
3776
3777
  const DEFAULT_LOCALES = [
@@ -10173,7 +10174,7 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10173
10174
  const yMin = chart.chartArea.top;
10174
10175
  const textsPositions = {};
10175
10176
  for (const dataset of chart._metasets) {
10176
- if (isTrendLineAxis(dataset.axisID) || dataset.hidden) {
10177
+ if (isTrendLineAxis(dataset.xAxisID) || dataset.hidden) {
10177
10178
  continue;
10178
10179
  }
10179
10180
  for (let i = 0; i < dataset._parsed.length; i++) {
@@ -10216,7 +10217,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10216
10217
  const xMin = chart.chartArea.left;
10217
10218
  const textsPositions = {};
10218
10219
  for (const dataset of chart._metasets) {
10219
- if (isTrendLineAxis(dataset.axisID)) {
10220
+ if (isTrendLineAxis(dataset.xAxisID)) {
10220
10221
  return; // ignore trend lines
10221
10222
  }
10222
10223
  for (let i = 0; i < dataset._parsed.length; i++) {
@@ -10341,6 +10342,7 @@ class ChartJsComponent extends owl.Component {
10341
10342
  canvas = owl.useRef("graphContainer");
10342
10343
  chart;
10343
10344
  currentRuntime;
10345
+ currentDevicePixelRatio = window.devicePixelRatio;
10344
10346
  get background() {
10345
10347
  return this.chartRuntime.background;
10346
10348
  }
@@ -10374,6 +10376,10 @@ class ChartJsComponent extends owl.Component {
10374
10376
  }
10375
10377
  this.currentRuntime = runtime;
10376
10378
  }
10379
+ else if (this.currentDevicePixelRatio !== window.devicePixelRatio) {
10380
+ this.currentDevicePixelRatio = window.devicePixelRatio;
10381
+ this.updateChartJs(deepCopy(this.currentRuntime.chartJsConfig));
10382
+ }
10377
10383
  });
10378
10384
  }
10379
10385
  createChart(chartData) {
@@ -10629,9 +10635,11 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
10629
10635
  };
10630
10636
  function drawScoreChart(structure, canvas) {
10631
10637
  const ctx = canvas.getContext("2d");
10632
- canvas.width = structure.canvas.width;
10633
- const availableWidth = canvas.width - CHART_PADDING$1 * 2;
10634
- canvas.height = structure.canvas.height;
10638
+ const dpr = window.devicePixelRatio || 1;
10639
+ canvas.width = dpr * structure.canvas.width;
10640
+ canvas.height = dpr * structure.canvas.height;
10641
+ ctx.scale(dpr, dpr);
10642
+ const availableWidth = structure.canvas.width - CHART_PADDING$1 * 2;
10635
10643
  ctx.fillStyle = structure.canvas.backgroundColor;
10636
10644
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
10637
10645
  if (structure.title) {
@@ -10994,7 +11002,7 @@ class ScorecardChart extends owl.Component {
10994
11002
  owl.useEffect(this.createChart.bind(this), () => {
10995
11003
  const canvas = this.canvas.el;
10996
11004
  const rect = canvas.getBoundingClientRect();
10997
- return [rect.width, rect.height, this.runtime, this.canvas.el];
11005
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
10998
11006
  });
10999
11007
  }
11000
11008
  createChart() {
@@ -22583,9 +22591,11 @@ const GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN = 6;
22583
22591
  const GAUGE_TITLE_SECTION_HEIGHT = 25;
22584
22592
  function drawGaugeChart(canvas, runtime) {
22585
22593
  const canvasBoundingRect = canvas.getBoundingClientRect();
22586
- canvas.width = canvasBoundingRect.width;
22587
- canvas.height = canvasBoundingRect.height;
22594
+ const dpr = window.devicePixelRatio || 1;
22595
+ canvas.width = dpr * canvasBoundingRect.width;
22596
+ canvas.height = dpr * canvasBoundingRect.height;
22588
22597
  const ctx = canvas.getContext("2d");
22598
+ ctx.scale(dpr, dpr);
22589
22599
  const config = getGaugeRenderingConfig(canvasBoundingRect, runtime, ctx);
22590
22600
  drawBackground(ctx, config);
22591
22601
  drawGauge(ctx, config);
@@ -22920,7 +22930,7 @@ class GaugeChartComponent extends owl.Component {
22920
22930
  owl.useEffect(() => drawGaugeChart(this.canvas.el, this.runtime), () => {
22921
22931
  const canvas = this.canvas.el;
22922
22932
  const rect = canvas.getBoundingClientRect();
22923
- return [rect.width, rect.height, this.runtime, this.canvas.el];
22933
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
22924
22934
  });
22925
22935
  }
22926
22936
  }
@@ -29583,7 +29593,7 @@ function getBarChartScales(definition, args) {
29583
29593
  };
29584
29594
  scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID] = {
29585
29595
  ...scales.x,
29586
- offset: false,
29596
+ offset: true,
29587
29597
  display: false,
29588
29598
  };
29589
29599
  }
@@ -30303,9 +30313,6 @@ class BarChart extends AbstractChart {
30303
30313
  };
30304
30314
  }
30305
30315
  getDefinitionForExcel() {
30306
- // Excel does not support aggregating labels
30307
- if (this.aggregated)
30308
- return undefined;
30309
30316
  const dataSets = this.dataSets
30310
30317
  .map((ds) => toExcelDataset(this.getters, ds))
30311
30318
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -31020,9 +31027,6 @@ class LineChart extends AbstractChart {
31020
31027
  return new LineChart(definition, this.sheetId, this.getters);
31021
31028
  }
31022
31029
  getDefinitionForExcel() {
31023
- // Excel does not support aggregating labels
31024
- if (this.aggregated)
31025
- return undefined;
31026
31030
  const dataSets = this.dataSets
31027
31031
  .map((ds) => toExcelDataset(this.getters, ds))
31028
31032
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -31159,9 +31163,6 @@ class PieChart extends AbstractChart {
31159
31163
  return new PieChart(definition, sheetId, this.getters);
31160
31164
  }
31161
31165
  getDefinitionForExcel() {
31162
- // Excel does not support aggregating labels
31163
- if (this.aggregated)
31164
- return undefined;
31165
31166
  const dataSets = this.dataSets
31166
31167
  .map((ds) => toExcelDataset(this.getters, ds))
31167
31168
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -33660,18 +33661,28 @@ function isBrowserFirefox() {
33660
33661
  function useInterval(callback, delay) {
33661
33662
  let intervalId;
33662
33663
  const { setInterval, clearInterval } = window;
33664
+ const pause = () => {
33665
+ clearInterval(intervalId);
33666
+ intervalId = undefined;
33667
+ };
33668
+ const safeCallback = () => {
33669
+ try {
33670
+ callback();
33671
+ }
33672
+ catch (e) {
33673
+ pause();
33674
+ throw e;
33675
+ }
33676
+ };
33663
33677
  owl.useEffect(() => {
33664
- intervalId = setInterval(callback, delay);
33678
+ intervalId = setInterval(safeCallback, delay);
33665
33679
  return () => clearInterval(intervalId);
33666
33680
  }, () => [delay]);
33667
33681
  return {
33668
- pause: () => {
33669
- clearInterval(intervalId);
33670
- intervalId = undefined;
33671
- },
33682
+ pause,
33672
33683
  resume: () => {
33673
33684
  if (intervalId === undefined) {
33674
- intervalId = setInterval(callback, delay);
33685
+ intervalId = setInterval(safeCallback, delay);
33675
33686
  }
33676
33687
  },
33677
33688
  };
@@ -38452,8 +38463,11 @@ class SelectionInput extends owl.Component {
38452
38463
  }
38453
38464
  removeInput(rangeId) {
38454
38465
  const index = this.store.selectionInputs.findIndex((range) => range.id === rangeId);
38455
- this.props.onSelectionRemoved?.(index);
38456
- this.props.onSelectionConfirmed?.();
38466
+ if (this.ranges.find((range) => range.id === rangeId)?.xc) {
38467
+ this.props.onSelectionRemoved?.(index);
38468
+ this.props.onSelectionConfirmed?.();
38469
+ }
38470
+ this.store.removeRange(rangeId);
38457
38471
  }
38458
38472
  onInputChanged(rangeId, ev) {
38459
38473
  const target = ev.target;
@@ -50853,7 +50867,7 @@ css /* scss */ `
50853
50867
  position: absolute;
50854
50868
  top: 0;
50855
50869
  left: ${HEADER_WIDTH}px;
50856
- right: 0;
50870
+ right: ${SCROLLBAR_WIDTH}px;
50857
50871
  height: ${HEADER_HEIGHT}px;
50858
50872
  width: calc(100% - ${HEADER_WIDTH + SCROLLBAR_WIDTH}px);
50859
50873
  &.o-dragging {
@@ -51046,9 +51060,8 @@ css /* scss */ `
51046
51060
  position: absolute;
51047
51061
  top: ${HEADER_HEIGHT}px;
51048
51062
  left: 0;
51049
- right: 0;
51063
+ bottom: ${SCROLLBAR_WIDTH}px;
51050
51064
  width: ${HEADER_WIDTH}px;
51051
- height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px);
51052
51065
  &.o-dragging {
51053
51066
  cursor: grabbing;
51054
51067
  }
@@ -59096,6 +59109,15 @@ function adaptPivotRange(range, applyChange) {
59096
59109
  }
59097
59110
  }
59098
59111
  class SpreadsheetPivotCorePlugin extends CorePlugin {
59112
+ allowDispatch(cmd) {
59113
+ switch (cmd.type) {
59114
+ case "ADD_PIVOT":
59115
+ case "UPDATE_PIVOT":
59116
+ const definition = cmd.pivot;
59117
+ return this.checkDataSetValidity(definition);
59118
+ }
59119
+ return "Success" /* CommandResult.Success */;
59120
+ }
59099
59121
  adaptRanges(applyChange) {
59100
59122
  for (const pivotId of this.getters.getPivotIds()) {
59101
59123
  const definition = this.getters.getPivotCoreDefinition(pivotId);
@@ -59114,6 +59136,16 @@ class SpreadsheetPivotCorePlugin extends CorePlugin {
59114
59136
  }
59115
59137
  }
59116
59138
  }
59139
+ checkDataSetValidity(definition) {
59140
+ if (definition.type === "SPREADSHEET" && definition.dataSet) {
59141
+ const { zone, sheetId } = definition.dataSet;
59142
+ if (!sheetId || !this.getters.tryGetSheet(sheetId) || !zone || !isZoneValid(zone)) {
59143
+ return "InvalidDataSet" /* CommandResult.InvalidDataSet */;
59144
+ }
59145
+ return this.getters.checkZonesExistInSheet(sheetId, [zone]);
59146
+ }
59147
+ return "Success" /* CommandResult.Success */;
59148
+ }
59117
59149
  }
59118
59150
 
59119
59151
  class TableStylePlugin extends CorePlugin {
@@ -61904,7 +61936,7 @@ class DynamicTablesPlugin extends CoreViewPlugin {
61904
61936
  tables = {};
61905
61937
  handle(cmd) {
61906
61938
  if (invalidateEvaluationCommands.has(cmd.type) ||
61907
- (cmd.type === "UPDATE_CELL" && "content" in cmd) ||
61939
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
61908
61940
  cmd.type === "EVALUATE_CELLS") {
61909
61941
  this.tables = {};
61910
61942
  return;
@@ -65776,7 +65808,7 @@ class TableComputedStylePlugin extends UIPlugin {
65776
65808
  tableStyles = {};
65777
65809
  handle(cmd) {
65778
65810
  if (invalidateEvaluationCommands.has(cmd.type) ||
65779
- (cmd.type === "UPDATE_CELL" && "content" in cmd) ||
65811
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
65780
65812
  cmd.type === "EVALUATE_CELLS") {
65781
65813
  this.tableStyles = {};
65782
65814
  return;
@@ -67737,6 +67769,8 @@ class GridSelectionPlugin extends UIPlugin {
67737
67769
  });
67738
67770
  this.selectCell(col, row);
67739
67771
  }
67772
+ const { col, row } = this.gridSelection.anchor.cell;
67773
+ this.moveClient({ sheetId: this.activeSheet.id, col, row });
67740
67774
  }
67741
67775
  /**
67742
67776
  * Ensure selections are not outside sheet boundaries.
@@ -68452,8 +68486,11 @@ class SheetViewPlugin extends UIPlugin {
68452
68486
  case "REMOVE_TABLE":
68453
68487
  case "UPDATE_TABLE":
68454
68488
  case "UPDATE_FILTER":
68455
- this.sheetsWithDirtyViewports.add(cmd.sheetId);
68456
- break;
68489
+ case "UNFREEZE_ROWS":
68490
+ case "UNFREEZE_COLUMNS":
68491
+ case "FREEZE_COLUMNS":
68492
+ case "FREEZE_ROWS":
68493
+ case "UNFREEZE_COLUMNS_ROWS":
68457
68494
  case "REMOVE_COLUMNS_ROWS":
68458
68495
  case "RESIZE_COLUMNS_ROWS":
68459
68496
  case "HIDE_COLUMNS_ROWS":
@@ -68466,11 +68503,9 @@ class SheetViewPlugin extends UIPlugin {
68466
68503
  case "FOLD_HEADER_GROUPS_IN_ZONE":
68467
68504
  case "UNFOLD_HEADER_GROUPS_IN_ZONE":
68468
68505
  case "UNFOLD_ALL_HEADER_GROUPS":
68469
- case "FOLD_ALL_HEADER_GROUPS": {
68470
- const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.getActiveSheetId();
68471
- this.sheetsWithDirtyViewports.add(sheetId);
68506
+ case "FOLD_ALL_HEADER_GROUPS":
68507
+ this.sheetsWithDirtyViewports.add(cmd.sheetId);
68472
68508
  break;
68473
- }
68474
68509
  case "UPDATE_CELL":
68475
68510
  // update cell content or format can change hidden rows because of data filters
68476
68511
  if ("content" in cmd || "format" in cmd || cmd.style?.fontSize !== undefined) {
@@ -68486,13 +68521,6 @@ class SheetViewPlugin extends UIPlugin {
68486
68521
  case "ACTIVATE_SHEET":
68487
68522
  this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
68488
68523
  break;
68489
- case "UNFREEZE_ROWS":
68490
- case "UNFREEZE_COLUMNS":
68491
- case "FREEZE_COLUMNS":
68492
- case "FREEZE_ROWS":
68493
- case "UNFREEZE_COLUMNS_ROWS":
68494
- this.resetViewports(this.getters.getActiveSheetId());
68495
- break;
68496
68524
  case "SCROLL_TO_CELL":
68497
68525
  this.refreshViewport(this.getters.getActiveSheetId(), { col: cmd.col, row: cmd.row });
68498
68526
  break;
@@ -69660,7 +69688,7 @@ class AggregateStatisticsStore extends SpreadsheetStore {
69660
69688
  }
69661
69689
  handle(cmd) {
69662
69690
  if (invalidateEvaluationCommands.has(cmd.type) ||
69663
- (cmd.type === "UPDATE_CELL" && "content" in cmd)) {
69691
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd))) {
69664
69692
  this.isDirty = true;
69665
69693
  }
69666
69694
  switch (cmd.type) {
@@ -76242,6 +76270,6 @@ exports.tokenColors = tokenColors;
76242
76270
  exports.tokenize = tokenize;
76243
76271
 
76244
76272
 
76245
- __info__.version = "18.2.9";
76246
- __info__.date = "2025-04-25T08:06:52.677Z";
76247
- __info__.hash = "3e88645";
76273
+ __info__.version = "18.2.10";
76274
+ __info__.date = "2025-05-02T12:34:39.632Z";
76275
+ __info__.hash = "e8ff3fc";
@@ -3150,7 +3150,8 @@ declare const enum CommandResult {
3150
3150
  EmptyName = "EmptyName",
3151
3151
  ValueCellIsInvalidFormula = "ValueCellIsInvalidFormula",
3152
3152
  InvalidDefinition = "InvalidDefinition",
3153
- InvalidColor = "InvalidColor"
3153
+ InvalidColor = "InvalidColor",
3154
+ InvalidPivotDataSet = "InvalidPivotDataSet"
3154
3155
  }
3155
3156
  interface CommandHandler<T> {
3156
3157
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -8686,6 +8687,7 @@ declare class ChartJsComponent extends Component<Props$O, SpreadsheetChildEnv> {
8686
8687
  private canvas;
8687
8688
  private chart?;
8688
8689
  private currentRuntime;
8690
+ private currentDevicePixelRatio;
8689
8691
  get background(): string;
8690
8692
  get canvasStyle(): string;
8691
8693
  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.2.9
6
- * @date 2025-04-25T08:06:52.677Z
7
- * @hash 3e88645
5
+ * @version 18.2.10
6
+ * @date 2025-05-02T12:34:39.632Z
7
+ * @hash e8ff3fc
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -3769,6 +3769,7 @@ var CommandResult;
3769
3769
  CommandResult["ValueCellIsInvalidFormula"] = "ValueCellIsInvalidFormula";
3770
3770
  CommandResult["InvalidDefinition"] = "InvalidDefinition";
3771
3771
  CommandResult["InvalidColor"] = "InvalidColor";
3772
+ CommandResult["InvalidPivotDataSet"] = "InvalidPivotDataSet";
3772
3773
  })(CommandResult || (CommandResult = {}));
3773
3774
 
3774
3775
  const DEFAULT_LOCALES = [
@@ -10171,7 +10172,7 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10171
10172
  const yMin = chart.chartArea.top;
10172
10173
  const textsPositions = {};
10173
10174
  for (const dataset of chart._metasets) {
10174
- if (isTrendLineAxis(dataset.axisID) || dataset.hidden) {
10175
+ if (isTrendLineAxis(dataset.xAxisID) || dataset.hidden) {
10175
10176
  continue;
10176
10177
  }
10177
10178
  for (let i = 0; i < dataset._parsed.length; i++) {
@@ -10214,7 +10215,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10214
10215
  const xMin = chart.chartArea.left;
10215
10216
  const textsPositions = {};
10216
10217
  for (const dataset of chart._metasets) {
10217
- if (isTrendLineAxis(dataset.axisID)) {
10218
+ if (isTrendLineAxis(dataset.xAxisID)) {
10218
10219
  return; // ignore trend lines
10219
10220
  }
10220
10221
  for (let i = 0; i < dataset._parsed.length; i++) {
@@ -10339,6 +10340,7 @@ class ChartJsComponent extends Component {
10339
10340
  canvas = useRef("graphContainer");
10340
10341
  chart;
10341
10342
  currentRuntime;
10343
+ currentDevicePixelRatio = window.devicePixelRatio;
10342
10344
  get background() {
10343
10345
  return this.chartRuntime.background;
10344
10346
  }
@@ -10372,6 +10374,10 @@ class ChartJsComponent extends Component {
10372
10374
  }
10373
10375
  this.currentRuntime = runtime;
10374
10376
  }
10377
+ else if (this.currentDevicePixelRatio !== window.devicePixelRatio) {
10378
+ this.currentDevicePixelRatio = window.devicePixelRatio;
10379
+ this.updateChartJs(deepCopy(this.currentRuntime.chartJsConfig));
10380
+ }
10375
10381
  });
10376
10382
  }
10377
10383
  createChart(chartData) {
@@ -10627,9 +10633,11 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
10627
10633
  };
10628
10634
  function drawScoreChart(structure, canvas) {
10629
10635
  const ctx = canvas.getContext("2d");
10630
- canvas.width = structure.canvas.width;
10631
- const availableWidth = canvas.width - CHART_PADDING$1 * 2;
10632
- canvas.height = structure.canvas.height;
10636
+ const dpr = window.devicePixelRatio || 1;
10637
+ canvas.width = dpr * structure.canvas.width;
10638
+ canvas.height = dpr * structure.canvas.height;
10639
+ ctx.scale(dpr, dpr);
10640
+ const availableWidth = structure.canvas.width - CHART_PADDING$1 * 2;
10633
10641
  ctx.fillStyle = structure.canvas.backgroundColor;
10634
10642
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
10635
10643
  if (structure.title) {
@@ -10992,7 +11000,7 @@ class ScorecardChart extends Component {
10992
11000
  useEffect(this.createChart.bind(this), () => {
10993
11001
  const canvas = this.canvas.el;
10994
11002
  const rect = canvas.getBoundingClientRect();
10995
- return [rect.width, rect.height, this.runtime, this.canvas.el];
11003
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
10996
11004
  });
10997
11005
  }
10998
11006
  createChart() {
@@ -22581,9 +22589,11 @@ const GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN = 6;
22581
22589
  const GAUGE_TITLE_SECTION_HEIGHT = 25;
22582
22590
  function drawGaugeChart(canvas, runtime) {
22583
22591
  const canvasBoundingRect = canvas.getBoundingClientRect();
22584
- canvas.width = canvasBoundingRect.width;
22585
- canvas.height = canvasBoundingRect.height;
22592
+ const dpr = window.devicePixelRatio || 1;
22593
+ canvas.width = dpr * canvasBoundingRect.width;
22594
+ canvas.height = dpr * canvasBoundingRect.height;
22586
22595
  const ctx = canvas.getContext("2d");
22596
+ ctx.scale(dpr, dpr);
22587
22597
  const config = getGaugeRenderingConfig(canvasBoundingRect, runtime, ctx);
22588
22598
  drawBackground(ctx, config);
22589
22599
  drawGauge(ctx, config);
@@ -22918,7 +22928,7 @@ class GaugeChartComponent extends Component {
22918
22928
  useEffect(() => drawGaugeChart(this.canvas.el, this.runtime), () => {
22919
22929
  const canvas = this.canvas.el;
22920
22930
  const rect = canvas.getBoundingClientRect();
22921
- return [rect.width, rect.height, this.runtime, this.canvas.el];
22931
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
22922
22932
  });
22923
22933
  }
22924
22934
  }
@@ -29581,7 +29591,7 @@ function getBarChartScales(definition, args) {
29581
29591
  };
29582
29592
  scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID] = {
29583
29593
  ...scales.x,
29584
- offset: false,
29594
+ offset: true,
29585
29595
  display: false,
29586
29596
  };
29587
29597
  }
@@ -30301,9 +30311,6 @@ class BarChart extends AbstractChart {
30301
30311
  };
30302
30312
  }
30303
30313
  getDefinitionForExcel() {
30304
- // Excel does not support aggregating labels
30305
- if (this.aggregated)
30306
- return undefined;
30307
30314
  const dataSets = this.dataSets
30308
30315
  .map((ds) => toExcelDataset(this.getters, ds))
30309
30316
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -31018,9 +31025,6 @@ class LineChart extends AbstractChart {
31018
31025
  return new LineChart(definition, this.sheetId, this.getters);
31019
31026
  }
31020
31027
  getDefinitionForExcel() {
31021
- // Excel does not support aggregating labels
31022
- if (this.aggregated)
31023
- return undefined;
31024
31028
  const dataSets = this.dataSets
31025
31029
  .map((ds) => toExcelDataset(this.getters, ds))
31026
31030
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -31157,9 +31161,6 @@ class PieChart extends AbstractChart {
31157
31161
  return new PieChart(definition, sheetId, this.getters);
31158
31162
  }
31159
31163
  getDefinitionForExcel() {
31160
- // Excel does not support aggregating labels
31161
- if (this.aggregated)
31162
- return undefined;
31163
31164
  const dataSets = this.dataSets
31164
31165
  .map((ds) => toExcelDataset(this.getters, ds))
31165
31166
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -33658,18 +33659,28 @@ function isBrowserFirefox() {
33658
33659
  function useInterval(callback, delay) {
33659
33660
  let intervalId;
33660
33661
  const { setInterval, clearInterval } = window;
33662
+ const pause = () => {
33663
+ clearInterval(intervalId);
33664
+ intervalId = undefined;
33665
+ };
33666
+ const safeCallback = () => {
33667
+ try {
33668
+ callback();
33669
+ }
33670
+ catch (e) {
33671
+ pause();
33672
+ throw e;
33673
+ }
33674
+ };
33661
33675
  useEffect(() => {
33662
- intervalId = setInterval(callback, delay);
33676
+ intervalId = setInterval(safeCallback, delay);
33663
33677
  return () => clearInterval(intervalId);
33664
33678
  }, () => [delay]);
33665
33679
  return {
33666
- pause: () => {
33667
- clearInterval(intervalId);
33668
- intervalId = undefined;
33669
- },
33680
+ pause,
33670
33681
  resume: () => {
33671
33682
  if (intervalId === undefined) {
33672
- intervalId = setInterval(callback, delay);
33683
+ intervalId = setInterval(safeCallback, delay);
33673
33684
  }
33674
33685
  },
33675
33686
  };
@@ -38450,8 +38461,11 @@ class SelectionInput extends Component {
38450
38461
  }
38451
38462
  removeInput(rangeId) {
38452
38463
  const index = this.store.selectionInputs.findIndex((range) => range.id === rangeId);
38453
- this.props.onSelectionRemoved?.(index);
38454
- this.props.onSelectionConfirmed?.();
38464
+ if (this.ranges.find((range) => range.id === rangeId)?.xc) {
38465
+ this.props.onSelectionRemoved?.(index);
38466
+ this.props.onSelectionConfirmed?.();
38467
+ }
38468
+ this.store.removeRange(rangeId);
38455
38469
  }
38456
38470
  onInputChanged(rangeId, ev) {
38457
38471
  const target = ev.target;
@@ -50851,7 +50865,7 @@ css /* scss */ `
50851
50865
  position: absolute;
50852
50866
  top: 0;
50853
50867
  left: ${HEADER_WIDTH}px;
50854
- right: 0;
50868
+ right: ${SCROLLBAR_WIDTH}px;
50855
50869
  height: ${HEADER_HEIGHT}px;
50856
50870
  width: calc(100% - ${HEADER_WIDTH + SCROLLBAR_WIDTH}px);
50857
50871
  &.o-dragging {
@@ -51044,9 +51058,8 @@ css /* scss */ `
51044
51058
  position: absolute;
51045
51059
  top: ${HEADER_HEIGHT}px;
51046
51060
  left: 0;
51047
- right: 0;
51061
+ bottom: ${SCROLLBAR_WIDTH}px;
51048
51062
  width: ${HEADER_WIDTH}px;
51049
- height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px);
51050
51063
  &.o-dragging {
51051
51064
  cursor: grabbing;
51052
51065
  }
@@ -59094,6 +59107,15 @@ function adaptPivotRange(range, applyChange) {
59094
59107
  }
59095
59108
  }
59096
59109
  class SpreadsheetPivotCorePlugin extends CorePlugin {
59110
+ allowDispatch(cmd) {
59111
+ switch (cmd.type) {
59112
+ case "ADD_PIVOT":
59113
+ case "UPDATE_PIVOT":
59114
+ const definition = cmd.pivot;
59115
+ return this.checkDataSetValidity(definition);
59116
+ }
59117
+ return "Success" /* CommandResult.Success */;
59118
+ }
59097
59119
  adaptRanges(applyChange) {
59098
59120
  for (const pivotId of this.getters.getPivotIds()) {
59099
59121
  const definition = this.getters.getPivotCoreDefinition(pivotId);
@@ -59112,6 +59134,16 @@ class SpreadsheetPivotCorePlugin extends CorePlugin {
59112
59134
  }
59113
59135
  }
59114
59136
  }
59137
+ checkDataSetValidity(definition) {
59138
+ if (definition.type === "SPREADSHEET" && definition.dataSet) {
59139
+ const { zone, sheetId } = definition.dataSet;
59140
+ if (!sheetId || !this.getters.tryGetSheet(sheetId) || !zone || !isZoneValid(zone)) {
59141
+ return "InvalidDataSet" /* CommandResult.InvalidDataSet */;
59142
+ }
59143
+ return this.getters.checkZonesExistInSheet(sheetId, [zone]);
59144
+ }
59145
+ return "Success" /* CommandResult.Success */;
59146
+ }
59115
59147
  }
59116
59148
 
59117
59149
  class TableStylePlugin extends CorePlugin {
@@ -61902,7 +61934,7 @@ class DynamicTablesPlugin extends CoreViewPlugin {
61902
61934
  tables = {};
61903
61935
  handle(cmd) {
61904
61936
  if (invalidateEvaluationCommands.has(cmd.type) ||
61905
- (cmd.type === "UPDATE_CELL" && "content" in cmd) ||
61937
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
61906
61938
  cmd.type === "EVALUATE_CELLS") {
61907
61939
  this.tables = {};
61908
61940
  return;
@@ -65774,7 +65806,7 @@ class TableComputedStylePlugin extends UIPlugin {
65774
65806
  tableStyles = {};
65775
65807
  handle(cmd) {
65776
65808
  if (invalidateEvaluationCommands.has(cmd.type) ||
65777
- (cmd.type === "UPDATE_CELL" && "content" in cmd) ||
65809
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
65778
65810
  cmd.type === "EVALUATE_CELLS") {
65779
65811
  this.tableStyles = {};
65780
65812
  return;
@@ -67735,6 +67767,8 @@ class GridSelectionPlugin extends UIPlugin {
67735
67767
  });
67736
67768
  this.selectCell(col, row);
67737
67769
  }
67770
+ const { col, row } = this.gridSelection.anchor.cell;
67771
+ this.moveClient({ sheetId: this.activeSheet.id, col, row });
67738
67772
  }
67739
67773
  /**
67740
67774
  * Ensure selections are not outside sheet boundaries.
@@ -68450,8 +68484,11 @@ class SheetViewPlugin extends UIPlugin {
68450
68484
  case "REMOVE_TABLE":
68451
68485
  case "UPDATE_TABLE":
68452
68486
  case "UPDATE_FILTER":
68453
- this.sheetsWithDirtyViewports.add(cmd.sheetId);
68454
- break;
68487
+ case "UNFREEZE_ROWS":
68488
+ case "UNFREEZE_COLUMNS":
68489
+ case "FREEZE_COLUMNS":
68490
+ case "FREEZE_ROWS":
68491
+ case "UNFREEZE_COLUMNS_ROWS":
68455
68492
  case "REMOVE_COLUMNS_ROWS":
68456
68493
  case "RESIZE_COLUMNS_ROWS":
68457
68494
  case "HIDE_COLUMNS_ROWS":
@@ -68464,11 +68501,9 @@ class SheetViewPlugin extends UIPlugin {
68464
68501
  case "FOLD_HEADER_GROUPS_IN_ZONE":
68465
68502
  case "UNFOLD_HEADER_GROUPS_IN_ZONE":
68466
68503
  case "UNFOLD_ALL_HEADER_GROUPS":
68467
- case "FOLD_ALL_HEADER_GROUPS": {
68468
- const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.getActiveSheetId();
68469
- this.sheetsWithDirtyViewports.add(sheetId);
68504
+ case "FOLD_ALL_HEADER_GROUPS":
68505
+ this.sheetsWithDirtyViewports.add(cmd.sheetId);
68470
68506
  break;
68471
- }
68472
68507
  case "UPDATE_CELL":
68473
68508
  // update cell content or format can change hidden rows because of data filters
68474
68509
  if ("content" in cmd || "format" in cmd || cmd.style?.fontSize !== undefined) {
@@ -68484,13 +68519,6 @@ class SheetViewPlugin extends UIPlugin {
68484
68519
  case "ACTIVATE_SHEET":
68485
68520
  this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
68486
68521
  break;
68487
- case "UNFREEZE_ROWS":
68488
- case "UNFREEZE_COLUMNS":
68489
- case "FREEZE_COLUMNS":
68490
- case "FREEZE_ROWS":
68491
- case "UNFREEZE_COLUMNS_ROWS":
68492
- this.resetViewports(this.getters.getActiveSheetId());
68493
- break;
68494
68522
  case "SCROLL_TO_CELL":
68495
68523
  this.refreshViewport(this.getters.getActiveSheetId(), { col: cmd.col, row: cmd.row });
68496
68524
  break;
@@ -69658,7 +69686,7 @@ class AggregateStatisticsStore extends SpreadsheetStore {
69658
69686
  }
69659
69687
  handle(cmd) {
69660
69688
  if (invalidateEvaluationCommands.has(cmd.type) ||
69661
- (cmd.type === "UPDATE_CELL" && "content" in cmd)) {
69689
+ (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd))) {
69662
69690
  this.isDirty = true;
69663
69691
  }
69664
69692
  switch (cmd.type) {
@@ -76195,6 +76223,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
76195
76223
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, 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 };
76196
76224
 
76197
76225
 
76198
- __info__.version = "18.2.9";
76199
- __info__.date = "2025-04-25T08:06:52.677Z";
76200
- __info__.hash = "3e88645";
76226
+ __info__.version = "18.2.10";
76227
+ __info__.date = "2025-05-02T12:34:39.632Z";
76228
+ __info__.hash = "e8ff3fc";