@odoo/o-spreadsheet 18.2.15 → 18.2.16

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.15
6
- * @date 2025-05-30T08:45:53.952Z
7
- * @hash 607492d
5
+ * @version 18.2.16
6
+ * @date 2025-06-06T09:32:04.909Z
7
+ * @hash 7ee118c
8
8
  */
9
9
 
10
10
  'use strict';
@@ -10372,8 +10372,6 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10372
10372
  if (isNaN(value)) {
10373
10373
  continue;
10374
10374
  }
10375
- const axisId = chart.config.type === "radar" ? dataset.rAxisID : dataset.yAxisID;
10376
- const displayValue = options.callback(Number(value), axisId);
10377
10375
  const point = dataset.data[i];
10378
10376
  const xPosition = point.x;
10379
10377
  let yPosition = 0;
@@ -10397,7 +10395,8 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10397
10395
  textsPositions[xPosition].push(yPosition);
10398
10396
  ctx.fillStyle = point.options.backgroundColor;
10399
10397
  ctx.strokeStyle = options.background || "#ffffff";
10400
- drawTextWithBackground(displayValue, xPosition, yPosition, ctx);
10398
+ const valueToDisplay = options.callback(Number(value), dataset, i);
10399
+ drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
10401
10400
  }
10402
10401
  }
10403
10402
  }
@@ -10414,7 +10413,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10414
10413
  if (isNaN(value)) {
10415
10414
  continue;
10416
10415
  }
10417
- const displayValue = options.callback(value, dataset.xAxisID);
10416
+ const displayValue = options.callback(value, dataset, i);
10418
10417
  const point = dataset.data[i];
10419
10418
  const yPosition = point.y;
10420
10419
  let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
@@ -10452,7 +10451,7 @@ function drawPieChartValues(chart, options, ctx) {
10452
10451
  const y = bar.y + midRadius * Math.sin(midAngle) + 7;
10453
10452
  ctx.fillStyle = chartFontColor(options.background);
10454
10453
  ctx.strokeStyle = options.background || "#ffffff";
10455
- const displayValue = options.callback(value, "y");
10454
+ const displayValue = options.callback(value, dataset, i);
10456
10455
  drawTextWithBackground(displayValue, x, y, ctx);
10457
10456
  }
10458
10457
  }
@@ -30085,9 +30084,51 @@ function getChartShowValues(definition, args) {
30085
30084
  horizontal: "horizontal" in definition && definition.horizontal,
30086
30085
  showValues: "showValues" in definition ? !!definition.showValues : false,
30087
30086
  background: definition.background,
30088
- callback: formatChartDatasetValue(axisFormats, locale),
30087
+ callback: (value, dataset) => {
30088
+ const axisId = getDatasetAxisId(definition, dataset);
30089
+ return formatChartDatasetValue(axisFormats, locale)(value, axisId);
30090
+ },
30089
30091
  };
30090
30092
  }
30093
+ function getPyramidChartShowValues(definition, args) {
30094
+ const { axisFormats, locale } = args;
30095
+ return {
30096
+ horizontal: true,
30097
+ showValues: "showValues" in definition ? !!definition.showValues : false,
30098
+ background: definition.background,
30099
+ callback: (value, dataset) => {
30100
+ value = Math.abs(Number(value));
30101
+ return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
30102
+ },
30103
+ };
30104
+ }
30105
+ function getWaterfallChartShowValues(definition, args) {
30106
+ const { axisFormats, locale, dataSetsValues } = args;
30107
+ const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
30108
+ subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
30109
+ return subtotalIndexes;
30110
+ }, []);
30111
+ return {
30112
+ showValues: "showValues" in definition ? !!definition.showValues : false,
30113
+ background: definition.background,
30114
+ callback: (value, dataset, index) => {
30115
+ const raw = dataset._dataset.data[index];
30116
+ const delta = raw[1] - raw[0];
30117
+ let sign = delta >= 0 ? "+" : "";
30118
+ if (definition.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
30119
+ sign = "";
30120
+ }
30121
+ return `${sign}${formatChartDatasetValue(axisFormats, locale)(delta, dataset.yAxisID)}`;
30122
+ },
30123
+ };
30124
+ }
30125
+ function getDatasetAxisId(definition, dataset) {
30126
+ if (dataset.rAxisID) {
30127
+ return dataset.rAxisID;
30128
+ }
30129
+ const axisId = "horizontal" in definition && definition.horizontal ? dataset.xAxisID : dataset.yAxisID;
30130
+ return axisId || "y";
30131
+ }
30091
30132
 
30092
30133
  function getChartTitle(definition) {
30093
30134
  const chartTitle = definition.title;
@@ -30411,6 +30452,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
30411
30452
  getPieChartTooltip: getPieChartTooltip,
30412
30453
  getPyramidChartData: getPyramidChartData,
30413
30454
  getPyramidChartScales: getPyramidChartScales,
30455
+ getPyramidChartShowValues: getPyramidChartShowValues,
30414
30456
  getPyramidChartTooltip: getPyramidChartTooltip,
30415
30457
  getRadarChartData: getRadarChartData,
30416
30458
  getRadarChartDatasets: getRadarChartDatasets,
@@ -30424,6 +30466,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
30424
30466
  getTrendDatasetForLineChart: getTrendDatasetForLineChart,
30425
30467
  getWaterfallChartLegend: getWaterfallChartLegend,
30426
30468
  getWaterfallChartScales: getWaterfallChartScales,
30469
+ getWaterfallChartShowValues: getWaterfallChartShowValues,
30427
30470
  getWaterfallChartTooltip: getWaterfallChartTooltip,
30428
30471
  getWaterfallDatasetAndLabels: getWaterfallDatasetAndLabels
30429
30472
  });
@@ -31556,7 +31599,7 @@ function createPyramidChartRuntime(chart, getters) {
31556
31599
  title: getChartTitle(definition),
31557
31600
  legend: getBarChartLegend(definition),
31558
31601
  tooltip: getPyramidChartTooltip(definition, chartData),
31559
- chartShowValuesPlugin: getChartShowValues(definition, chartData),
31602
+ chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
31560
31603
  },
31561
31604
  },
31562
31605
  };
@@ -32019,7 +32062,7 @@ function createWaterfallChartRuntime(chart, getters) {
32019
32062
  title: getChartTitle(definition),
32020
32063
  legend: getWaterfallChartLegend(definition),
32021
32064
  tooltip: getWaterfallChartTooltip(definition, chartData),
32022
- chartShowValuesPlugin: getChartShowValues(definition, chartData),
32065
+ chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
32023
32066
  waterfallLinesPlugin: { showConnectorLines: definition.showConnectorLines },
32024
32067
  },
32025
32068
  },
@@ -44665,13 +44708,15 @@ class FindAndReplaceStore extends SpreadsheetStore {
44665
44708
  if (this.selectedMatchIndex === null) {
44666
44709
  return;
44667
44710
  }
44711
+ this.preserveSelectedMatchIndex = true;
44712
+ this.shouldFinalizeUpdateSelection = true;
44668
44713
  this.model.dispatch("REPLACE_SEARCH", {
44669
44714
  searchString: this.toSearch,
44670
44715
  replaceWith: this.toReplace,
44671
44716
  matches: [this.searchMatches[this.selectedMatchIndex]],
44672
44717
  searchOptions: this.searchOptions,
44673
44718
  });
44674
- this.selectNextCell(Direction.next, { jumpToMatchSheet: true, updateSelection: true });
44719
+ this.preserveSelectedMatchIndex = false;
44675
44720
  }
44676
44721
  /**
44677
44722
  * Apply the replace function to all the matches one time.
@@ -52272,6 +52317,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
52272
52317
  let deltaX = lastX - clientX;
52273
52318
  let deltaY = lastY - clientY;
52274
52319
  const elapsedTime = currentTime - lastTime;
52320
+ if (!elapsedTime) {
52321
+ return;
52322
+ }
52275
52323
  velocityX = deltaX / elapsedTime;
52276
52324
  velocityY = deltaY / elapsedTime;
52277
52325
  lastX = clientX;
@@ -52292,6 +52340,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
52292
52340
  function onTouchEnd(ev) {
52293
52341
  isMouseDown = false;
52294
52342
  lastX = lastY = 0;
52343
+ if (resetTimeout) {
52344
+ clearTimeout(resetTimeout);
52345
+ }
52346
+ velocityX *= 1.2;
52347
+ velocityY *= 1.2;
52295
52348
  requestAnimationFrame(scroll);
52296
52349
  }
52297
52350
  function scroll() {
@@ -59432,7 +59485,7 @@ class PivotCorePlugin extends CorePlugin {
59432
59485
  break;
59433
59486
  }
59434
59487
  case "UPDATE_PIVOT": {
59435
- this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
59488
+ this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
59436
59489
  this.compileCalculatedMeasures(cmd.pivot.measures);
59437
59490
  break;
59438
59491
  }
@@ -59503,7 +59556,10 @@ class PivotCorePlugin extends CorePlugin {
59503
59556
  // Private
59504
59557
  // -------------------------------------------------------------------------
59505
59558
  addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
59506
- this.history.update("pivots", pivotId, { definition: deepCopy(pivot), formulaId });
59559
+ this.history.update("pivots", pivotId, {
59560
+ definition: this.repairSortedColumn(deepCopy(pivot)),
59561
+ formulaId,
59562
+ });
59507
59563
  this.compileCalculatedMeasures(pivot.measures);
59508
59564
  this.history.update("formulaIds", formulaId, pivotId);
59509
59565
  this.history.update("nextFormulaId", this.nextFormulaId + 1);
@@ -59596,6 +59652,26 @@ class PivotCorePlugin extends CorePlugin {
59596
59652
  }
59597
59653
  return "Success" /* CommandResult.Success */;
59598
59654
  }
59655
+ repairSortedColumn(definition) {
59656
+ if (definition.sortedColumn) {
59657
+ // Fix for an upgrade issue: the sortedColumn measure was not updated
59658
+ // from using fieldName to using id. If the sortedColumn measure matches
59659
+ // a measure fieldName in the definition, update it to use the measure's id instead
59660
+ // of its fieldName.
59661
+ // TODO: add an upgrade step to fix this in master and remove this code
59662
+ const sortedMeasure = definition.measures.find((measure) => measure.fieldName === definition.sortedColumn?.measure);
59663
+ if (sortedMeasure) {
59664
+ return {
59665
+ ...definition,
59666
+ sortedColumn: {
59667
+ ...definition.sortedColumn,
59668
+ measure: sortedMeasure.id,
59669
+ },
59670
+ };
59671
+ }
59672
+ }
59673
+ return definition;
59674
+ }
59599
59675
  // ---------------------------------------------------------------------
59600
59676
  // Import/Export
59601
59677
  // ---------------------------------------------------------------------
@@ -68507,11 +68583,6 @@ class GridSelectionPlugin extends UIPlugin {
68507
68583
  },
68508
68584
  ];
68509
68585
  const sheetId = this.getActiveSheetId();
68510
- const handler = new CellClipboardHandler(this.getters, this.dispatch);
68511
- const data = handler.copy(getClipboardDataPositions(sheetId, target));
68512
- if (!data) {
68513
- return;
68514
- }
68515
68586
  const base = isBasedBefore ? cmd.base : cmd.base + 1;
68516
68587
  const pasteTarget = [
68517
68588
  {
@@ -68521,7 +68592,14 @@ class GridSelectionPlugin extends UIPlugin {
68521
68592
  bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
68522
68593
  },
68523
68594
  ];
68524
- handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
68595
+ for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
68596
+ const handler = new Handler(this.getters, this.dispatch);
68597
+ const data = handler.copy(getClipboardDataPositions(sheetId, target));
68598
+ if (!data) {
68599
+ continue;
68600
+ }
68601
+ handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
68602
+ }
68525
68603
  const selection = pasteTarget[0];
68526
68604
  const col = selection.left;
68527
68605
  const row = selection.top;
@@ -76911,6 +76989,6 @@ exports.tokenColors = tokenColors;
76911
76989
  exports.tokenize = tokenize;
76912
76990
 
76913
76991
 
76914
- __info__.version = "18.2.15";
76915
- __info__.date = "2025-05-30T08:45:53.952Z";
76916
- __info__.hash = "607492d";
76992
+ __info__.version = "18.2.16";
76993
+ __info__.date = "2025-06-06T09:32:04.909Z";
76994
+ __info__.hash = "7ee118c";
@@ -1,5 +1,5 @@
1
1
  import * as chart_js from 'chart.js';
2
- import { ChartConfiguration, Point, Chart, Color as Color$1, ChartType as ChartType$1 } from 'chart.js';
2
+ import { ChartConfiguration, Point, Chart, Color as Color$1, ChartType as ChartType$1, ChartMeta } from 'chart.js';
3
3
  import * as ChartGeo from 'chartjs-chart-geo';
4
4
  import * as GeoJSON$1 from 'geojson';
5
5
  import * as _odoo_owl from '@odoo/owl';
@@ -4834,6 +4834,7 @@ declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState
4834
4834
  private compileMeasureFormula;
4835
4835
  private replaceMeasureFormula;
4836
4836
  private checkDuplicatedMeasureIds;
4837
+ private repairSortedColumn;
4837
4838
  /**
4838
4839
  * Import the pivots
4839
4840
  */
@@ -6286,7 +6287,7 @@ interface ChartShowValuesPluginOptions {
6286
6287
  showValues: boolean;
6287
6288
  background?: Color;
6288
6289
  horizontal?: boolean;
6289
- callback: (value: number | string, axisId: string) => string;
6290
+ callback: (value: number | string, dataset: ChartMeta, index: number) => string;
6290
6291
  }
6291
6292
  declare module "chart.js" {
6292
6293
  interface PluginOptionsByType<TType extends ChartType$1> {
@@ -13433,6 +13434,8 @@ declare const chartHelpers: {
13433
13434
  [key: string]: chart_js.ScaleOptionsByType<"projection" | keyof chart_js.ColorScaleTypeRegistry>;
13434
13435
  }>;
13435
13436
  getChartShowValues(definition: ChartWithDataSetDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
13437
+ getPyramidChartShowValues(definition: ChartWithDataSetDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
13438
+ getWaterfallChartShowValues(definition: WaterfallChartDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
13436
13439
  getChartTitle(definition: ChartWithDataSetDefinition): chart_js_dist_types_utils._DeepPartialObject<chart_js.TitleOptions>;
13437
13440
  getBarChartTooltip(definition: GenericDefinition<BarChartDefinition>, args: ChartRuntimeGenerationArgs): chart_js_dist_types_utils._DeepPartialObject<chart_js.TooltipOptions<any>>;
13438
13441
  getLineChartTooltip(definition: GenericDefinition<LineChartDefinition>, args: ChartRuntimeGenerationArgs): chart_js_dist_types_utils._DeepPartialObject<chart_js.TooltipOptions<any>>;
@@ -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.15
6
- * @date 2025-05-30T08:45:53.952Z
7
- * @hash 607492d
5
+ * @version 18.2.16
6
+ * @date 2025-06-06T09:32:04.909Z
7
+ * @hash 7ee118c
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';
@@ -10370,8 +10370,6 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10370
10370
  if (isNaN(value)) {
10371
10371
  continue;
10372
10372
  }
10373
- const axisId = chart.config.type === "radar" ? dataset.rAxisID : dataset.yAxisID;
10374
- const displayValue = options.callback(Number(value), axisId);
10375
10373
  const point = dataset.data[i];
10376
10374
  const xPosition = point.x;
10377
10375
  let yPosition = 0;
@@ -10395,7 +10393,8 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10395
10393
  textsPositions[xPosition].push(yPosition);
10396
10394
  ctx.fillStyle = point.options.backgroundColor;
10397
10395
  ctx.strokeStyle = options.background || "#ffffff";
10398
- drawTextWithBackground(displayValue, xPosition, yPosition, ctx);
10396
+ const valueToDisplay = options.callback(Number(value), dataset, i);
10397
+ drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
10399
10398
  }
10400
10399
  }
10401
10400
  }
@@ -10412,7 +10411,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10412
10411
  if (isNaN(value)) {
10413
10412
  continue;
10414
10413
  }
10415
- const displayValue = options.callback(value, dataset.xAxisID);
10414
+ const displayValue = options.callback(value, dataset, i);
10416
10415
  const point = dataset.data[i];
10417
10416
  const yPosition = point.y;
10418
10417
  let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
@@ -10450,7 +10449,7 @@ function drawPieChartValues(chart, options, ctx) {
10450
10449
  const y = bar.y + midRadius * Math.sin(midAngle) + 7;
10451
10450
  ctx.fillStyle = chartFontColor(options.background);
10452
10451
  ctx.strokeStyle = options.background || "#ffffff";
10453
- const displayValue = options.callback(value, "y");
10452
+ const displayValue = options.callback(value, dataset, i);
10454
10453
  drawTextWithBackground(displayValue, x, y, ctx);
10455
10454
  }
10456
10455
  }
@@ -30083,9 +30082,51 @@ function getChartShowValues(definition, args) {
30083
30082
  horizontal: "horizontal" in definition && definition.horizontal,
30084
30083
  showValues: "showValues" in definition ? !!definition.showValues : false,
30085
30084
  background: definition.background,
30086
- callback: formatChartDatasetValue(axisFormats, locale),
30085
+ callback: (value, dataset) => {
30086
+ const axisId = getDatasetAxisId(definition, dataset);
30087
+ return formatChartDatasetValue(axisFormats, locale)(value, axisId);
30088
+ },
30087
30089
  };
30088
30090
  }
30091
+ function getPyramidChartShowValues(definition, args) {
30092
+ const { axisFormats, locale } = args;
30093
+ return {
30094
+ horizontal: true,
30095
+ showValues: "showValues" in definition ? !!definition.showValues : false,
30096
+ background: definition.background,
30097
+ callback: (value, dataset) => {
30098
+ value = Math.abs(Number(value));
30099
+ return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
30100
+ },
30101
+ };
30102
+ }
30103
+ function getWaterfallChartShowValues(definition, args) {
30104
+ const { axisFormats, locale, dataSetsValues } = args;
30105
+ const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
30106
+ subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
30107
+ return subtotalIndexes;
30108
+ }, []);
30109
+ return {
30110
+ showValues: "showValues" in definition ? !!definition.showValues : false,
30111
+ background: definition.background,
30112
+ callback: (value, dataset, index) => {
30113
+ const raw = dataset._dataset.data[index];
30114
+ const delta = raw[1] - raw[0];
30115
+ let sign = delta >= 0 ? "+" : "";
30116
+ if (definition.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
30117
+ sign = "";
30118
+ }
30119
+ return `${sign}${formatChartDatasetValue(axisFormats, locale)(delta, dataset.yAxisID)}`;
30120
+ },
30121
+ };
30122
+ }
30123
+ function getDatasetAxisId(definition, dataset) {
30124
+ if (dataset.rAxisID) {
30125
+ return dataset.rAxisID;
30126
+ }
30127
+ const axisId = "horizontal" in definition && definition.horizontal ? dataset.xAxisID : dataset.yAxisID;
30128
+ return axisId || "y";
30129
+ }
30089
30130
 
30090
30131
  function getChartTitle(definition) {
30091
30132
  const chartTitle = definition.title;
@@ -30409,6 +30450,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
30409
30450
  getPieChartTooltip: getPieChartTooltip,
30410
30451
  getPyramidChartData: getPyramidChartData,
30411
30452
  getPyramidChartScales: getPyramidChartScales,
30453
+ getPyramidChartShowValues: getPyramidChartShowValues,
30412
30454
  getPyramidChartTooltip: getPyramidChartTooltip,
30413
30455
  getRadarChartData: getRadarChartData,
30414
30456
  getRadarChartDatasets: getRadarChartDatasets,
@@ -30422,6 +30464,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
30422
30464
  getTrendDatasetForLineChart: getTrendDatasetForLineChart,
30423
30465
  getWaterfallChartLegend: getWaterfallChartLegend,
30424
30466
  getWaterfallChartScales: getWaterfallChartScales,
30467
+ getWaterfallChartShowValues: getWaterfallChartShowValues,
30425
30468
  getWaterfallChartTooltip: getWaterfallChartTooltip,
30426
30469
  getWaterfallDatasetAndLabels: getWaterfallDatasetAndLabels
30427
30470
  });
@@ -31554,7 +31597,7 @@ function createPyramidChartRuntime(chart, getters) {
31554
31597
  title: getChartTitle(definition),
31555
31598
  legend: getBarChartLegend(definition),
31556
31599
  tooltip: getPyramidChartTooltip(definition, chartData),
31557
- chartShowValuesPlugin: getChartShowValues(definition, chartData),
31600
+ chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
31558
31601
  },
31559
31602
  },
31560
31603
  };
@@ -32017,7 +32060,7 @@ function createWaterfallChartRuntime(chart, getters) {
32017
32060
  title: getChartTitle(definition),
32018
32061
  legend: getWaterfallChartLegend(definition),
32019
32062
  tooltip: getWaterfallChartTooltip(definition, chartData),
32020
- chartShowValuesPlugin: getChartShowValues(definition, chartData),
32063
+ chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
32021
32064
  waterfallLinesPlugin: { showConnectorLines: definition.showConnectorLines },
32022
32065
  },
32023
32066
  },
@@ -44663,13 +44706,15 @@ class FindAndReplaceStore extends SpreadsheetStore {
44663
44706
  if (this.selectedMatchIndex === null) {
44664
44707
  return;
44665
44708
  }
44709
+ this.preserveSelectedMatchIndex = true;
44710
+ this.shouldFinalizeUpdateSelection = true;
44666
44711
  this.model.dispatch("REPLACE_SEARCH", {
44667
44712
  searchString: this.toSearch,
44668
44713
  replaceWith: this.toReplace,
44669
44714
  matches: [this.searchMatches[this.selectedMatchIndex]],
44670
44715
  searchOptions: this.searchOptions,
44671
44716
  });
44672
- this.selectNextCell(Direction.next, { jumpToMatchSheet: true, updateSelection: true });
44717
+ this.preserveSelectedMatchIndex = false;
44673
44718
  }
44674
44719
  /**
44675
44720
  * Apply the replace function to all the matches one time.
@@ -52270,6 +52315,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
52270
52315
  let deltaX = lastX - clientX;
52271
52316
  let deltaY = lastY - clientY;
52272
52317
  const elapsedTime = currentTime - lastTime;
52318
+ if (!elapsedTime) {
52319
+ return;
52320
+ }
52273
52321
  velocityX = deltaX / elapsedTime;
52274
52322
  velocityY = deltaY / elapsedTime;
52275
52323
  lastX = clientX;
@@ -52290,6 +52338,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
52290
52338
  function onTouchEnd(ev) {
52291
52339
  isMouseDown = false;
52292
52340
  lastX = lastY = 0;
52341
+ if (resetTimeout) {
52342
+ clearTimeout(resetTimeout);
52343
+ }
52344
+ velocityX *= 1.2;
52345
+ velocityY *= 1.2;
52293
52346
  requestAnimationFrame(scroll);
52294
52347
  }
52295
52348
  function scroll() {
@@ -59430,7 +59483,7 @@ class PivotCorePlugin extends CorePlugin {
59430
59483
  break;
59431
59484
  }
59432
59485
  case "UPDATE_PIVOT": {
59433
- this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
59486
+ this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
59434
59487
  this.compileCalculatedMeasures(cmd.pivot.measures);
59435
59488
  break;
59436
59489
  }
@@ -59501,7 +59554,10 @@ class PivotCorePlugin extends CorePlugin {
59501
59554
  // Private
59502
59555
  // -------------------------------------------------------------------------
59503
59556
  addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
59504
- this.history.update("pivots", pivotId, { definition: deepCopy(pivot), formulaId });
59557
+ this.history.update("pivots", pivotId, {
59558
+ definition: this.repairSortedColumn(deepCopy(pivot)),
59559
+ formulaId,
59560
+ });
59505
59561
  this.compileCalculatedMeasures(pivot.measures);
59506
59562
  this.history.update("formulaIds", formulaId, pivotId);
59507
59563
  this.history.update("nextFormulaId", this.nextFormulaId + 1);
@@ -59594,6 +59650,26 @@ class PivotCorePlugin extends CorePlugin {
59594
59650
  }
59595
59651
  return "Success" /* CommandResult.Success */;
59596
59652
  }
59653
+ repairSortedColumn(definition) {
59654
+ if (definition.sortedColumn) {
59655
+ // Fix for an upgrade issue: the sortedColumn measure was not updated
59656
+ // from using fieldName to using id. If the sortedColumn measure matches
59657
+ // a measure fieldName in the definition, update it to use the measure's id instead
59658
+ // of its fieldName.
59659
+ // TODO: add an upgrade step to fix this in master and remove this code
59660
+ const sortedMeasure = definition.measures.find((measure) => measure.fieldName === definition.sortedColumn?.measure);
59661
+ if (sortedMeasure) {
59662
+ return {
59663
+ ...definition,
59664
+ sortedColumn: {
59665
+ ...definition.sortedColumn,
59666
+ measure: sortedMeasure.id,
59667
+ },
59668
+ };
59669
+ }
59670
+ }
59671
+ return definition;
59672
+ }
59597
59673
  // ---------------------------------------------------------------------
59598
59674
  // Import/Export
59599
59675
  // ---------------------------------------------------------------------
@@ -68505,11 +68581,6 @@ class GridSelectionPlugin extends UIPlugin {
68505
68581
  },
68506
68582
  ];
68507
68583
  const sheetId = this.getActiveSheetId();
68508
- const handler = new CellClipboardHandler(this.getters, this.dispatch);
68509
- const data = handler.copy(getClipboardDataPositions(sheetId, target));
68510
- if (!data) {
68511
- return;
68512
- }
68513
68584
  const base = isBasedBefore ? cmd.base : cmd.base + 1;
68514
68585
  const pasteTarget = [
68515
68586
  {
@@ -68519,7 +68590,14 @@ class GridSelectionPlugin extends UIPlugin {
68519
68590
  bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
68520
68591
  },
68521
68592
  ];
68522
- handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
68593
+ for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
68594
+ const handler = new Handler(this.getters, this.dispatch);
68595
+ const data = handler.copy(getClipboardDataPositions(sheetId, target));
68596
+ if (!data) {
68597
+ continue;
68598
+ }
68599
+ handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
68600
+ }
68523
68601
  const selection = pasteTarget[0];
68524
68602
  const col = selection.left;
68525
68603
  const row = selection.top;
@@ -76864,6 +76942,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
76864
76942
  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 };
76865
76943
 
76866
76944
 
76867
- __info__.version = "18.2.15";
76868
- __info__.date = "2025-05-30T08:45:53.952Z";
76869
- __info__.hash = "607492d";
76945
+ __info__.version = "18.2.16";
76946
+ __info__.date = "2025-06-06T09:32:04.909Z";
76947
+ __info__.hash = "7ee118c";