@odoo/o-spreadsheet 18.1.23 → 18.1.24

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.23
6
- * @date 2025-05-30T08:45:44.408Z
7
- * @hash a21fa01
5
+ * @version 18.1.24
6
+ * @date 2025-06-06T09:31:57.011Z
7
+ * @hash 0e386b2
8
8
  */
9
9
 
10
10
  'use strict';
@@ -10208,8 +10208,6 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10208
10208
  if (isNaN(value)) {
10209
10209
  continue;
10210
10210
  }
10211
- const axisId = chart.config.type === "radar" ? dataset.rAxisID : dataset.yAxisID;
10212
- const displayValue = options.callback(Number(value), axisId);
10213
10211
  const point = dataset.data[i];
10214
10212
  const xPosition = point.x;
10215
10213
  let yPosition = 0;
@@ -10233,7 +10231,8 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10233
10231
  textsPositions[xPosition].push(yPosition);
10234
10232
  ctx.fillStyle = point.options.backgroundColor;
10235
10233
  ctx.strokeStyle = options.background || "#ffffff";
10236
- drawTextWithBackground(displayValue, xPosition, yPosition, ctx);
10234
+ const valueToDisplay = options.callback(Number(value), dataset, i);
10235
+ drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
10237
10236
  }
10238
10237
  }
10239
10238
  }
@@ -10250,7 +10249,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10250
10249
  if (isNaN(value)) {
10251
10250
  continue;
10252
10251
  }
10253
- const displayValue = options.callback(value, dataset.xAxisID);
10252
+ const displayValue = options.callback(value, dataset, i);
10254
10253
  const point = dataset.data[i];
10255
10254
  const yPosition = point.y;
10256
10255
  let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
@@ -10288,7 +10287,7 @@ function drawPieChartValues(chart, options, ctx) {
10288
10287
  const y = bar.y + midRadius * Math.sin(midAngle) + 7;
10289
10288
  ctx.fillStyle = chartFontColor(options.background);
10290
10289
  ctx.strokeStyle = options.background || "#ffffff";
10291
- const displayValue = options.callback(value, "y");
10290
+ const displayValue = options.callback(value, dataset, i);
10292
10291
  drawTextWithBackground(displayValue, x, y, ctx);
10293
10292
  }
10294
10293
  }
@@ -30053,9 +30052,51 @@ function getChartShowValues(definition, args) {
30053
30052
  horizontal: "horizontal" in definition && definition.horizontal,
30054
30053
  showValues: "showValues" in definition ? !!definition.showValues : false,
30055
30054
  background: definition.background,
30056
- callback: formatChartDatasetValue(axisFormats, locale),
30055
+ callback: (value, dataset) => {
30056
+ const axisId = getDatasetAxisId(definition, dataset);
30057
+ return formatChartDatasetValue(axisFormats, locale)(value, axisId);
30058
+ },
30057
30059
  };
30058
30060
  }
30061
+ function getPyramidChartShowValues(definition, args) {
30062
+ const { axisFormats, locale } = args;
30063
+ return {
30064
+ horizontal: true,
30065
+ showValues: "showValues" in definition ? !!definition.showValues : false,
30066
+ background: definition.background,
30067
+ callback: (value, dataset) => {
30068
+ value = Math.abs(Number(value));
30069
+ return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
30070
+ },
30071
+ };
30072
+ }
30073
+ function getWaterfallChartShowValues(definition, args) {
30074
+ const { axisFormats, locale, dataSetsValues } = args;
30075
+ const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
30076
+ subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
30077
+ return subtotalIndexes;
30078
+ }, []);
30079
+ return {
30080
+ showValues: "showValues" in definition ? !!definition.showValues : false,
30081
+ background: definition.background,
30082
+ callback: (value, dataset, index) => {
30083
+ const raw = dataset._dataset.data[index];
30084
+ const delta = raw[1] - raw[0];
30085
+ let sign = delta >= 0 ? "+" : "";
30086
+ if (definition.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
30087
+ sign = "";
30088
+ }
30089
+ return `${sign}${formatChartDatasetValue(axisFormats, locale)(delta, dataset.yAxisID)}`;
30090
+ },
30091
+ };
30092
+ }
30093
+ function getDatasetAxisId(definition, dataset) {
30094
+ if (dataset.rAxisID) {
30095
+ return dataset.rAxisID;
30096
+ }
30097
+ const axisId = "horizontal" in definition && definition.horizontal ? dataset.xAxisID : dataset.yAxisID;
30098
+ return axisId || "y";
30099
+ }
30059
30100
 
30060
30101
  function getChartTitle(definition) {
30061
30102
  const chartTitle = definition.title;
@@ -30264,6 +30305,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
30264
30305
  getPieChartTooltip: getPieChartTooltip,
30265
30306
  getPyramidChartData: getPyramidChartData,
30266
30307
  getPyramidChartScales: getPyramidChartScales,
30308
+ getPyramidChartShowValues: getPyramidChartShowValues,
30267
30309
  getPyramidChartTooltip: getPyramidChartTooltip,
30268
30310
  getRadarChartData: getRadarChartData,
30269
30311
  getRadarChartDatasets: getRadarChartDatasets,
@@ -30277,6 +30319,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
30277
30319
  getTrendDatasetForLineChart: getTrendDatasetForLineChart,
30278
30320
  getWaterfallChartLegend: getWaterfallChartLegend,
30279
30321
  getWaterfallChartScales: getWaterfallChartScales,
30322
+ getWaterfallChartShowValues: getWaterfallChartShowValues,
30280
30323
  getWaterfallChartTooltip: getWaterfallChartTooltip,
30281
30324
  getWaterfallDatasetAndLabels: getWaterfallDatasetAndLabels
30282
30325
  });
@@ -31375,7 +31418,7 @@ function createPyramidChartRuntime(chart, getters) {
31375
31418
  title: getChartTitle(definition),
31376
31419
  legend: getBarChartLegend(definition),
31377
31420
  tooltip: getPyramidChartTooltip(definition, chartData),
31378
- chartShowValuesPlugin: getChartShowValues(definition, chartData),
31421
+ chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
31379
31422
  },
31380
31423
  },
31381
31424
  };
@@ -31838,7 +31881,7 @@ function createWaterfallChartRuntime(chart, getters) {
31838
31881
  title: getChartTitle(definition),
31839
31882
  legend: getWaterfallChartLegend(definition),
31840
31883
  tooltip: getWaterfallChartTooltip(definition, chartData),
31841
- chartShowValuesPlugin: getChartShowValues(definition, chartData),
31884
+ chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
31842
31885
  waterfallLinesPlugin: { showConnectorLines: definition.showConnectorLines },
31843
31886
  },
31844
31887
  },
@@ -44321,13 +44364,15 @@ class FindAndReplaceStore extends SpreadsheetStore {
44321
44364
  if (this.selectedMatchIndex === null) {
44322
44365
  return;
44323
44366
  }
44367
+ this.preserveSelectedMatchIndex = true;
44368
+ this.shouldFinalizeUpdateSelection = true;
44324
44369
  this.model.dispatch("REPLACE_SEARCH", {
44325
44370
  searchString: this.toSearch,
44326
44371
  replaceWith: this.toReplace,
44327
44372
  matches: [this.searchMatches[this.selectedMatchIndex]],
44328
44373
  searchOptions: this.searchOptions,
44329
44374
  });
44330
- this.selectNextCell(Direction.next, { jumpToMatchSheet: true, updateSelection: true });
44375
+ this.preserveSelectedMatchIndex = false;
44331
44376
  }
44332
44377
  /**
44333
44378
  * Apply the replace function to all the matches one time.
@@ -51823,6 +51868,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
51823
51868
  let deltaX = lastX - clientX;
51824
51869
  let deltaY = lastY - clientY;
51825
51870
  const elapsedTime = currentTime - lastTime;
51871
+ if (!elapsedTime) {
51872
+ return;
51873
+ }
51826
51874
  velocityX = deltaX / elapsedTime;
51827
51875
  velocityY = deltaY / elapsedTime;
51828
51876
  lastX = clientX;
@@ -51843,6 +51891,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
51843
51891
  function onTouchEnd(ev) {
51844
51892
  isMouseDown = false;
51845
51893
  lastX = lastY = 0;
51894
+ if (resetTimeout) {
51895
+ clearTimeout(resetTimeout);
51896
+ }
51897
+ velocityX *= 1.2;
51898
+ velocityY *= 1.2;
51846
51899
  requestAnimationFrame(scroll);
51847
51900
  }
51848
51901
  function scroll() {
@@ -58944,7 +58997,7 @@ class PivotCorePlugin extends CorePlugin {
58944
58997
  break;
58945
58998
  }
58946
58999
  case "UPDATE_PIVOT": {
58947
- this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
59000
+ this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
58948
59001
  this.compileCalculatedMeasures(cmd.pivot.measures);
58949
59002
  break;
58950
59003
  }
@@ -59015,7 +59068,10 @@ class PivotCorePlugin extends CorePlugin {
59015
59068
  // Private
59016
59069
  // -------------------------------------------------------------------------
59017
59070
  addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
59018
- this.history.update("pivots", pivotId, { definition: deepCopy(pivot), formulaId });
59071
+ this.history.update("pivots", pivotId, {
59072
+ definition: this.repairSortedColumn(deepCopy(pivot)),
59073
+ formulaId,
59074
+ });
59019
59075
  this.compileCalculatedMeasures(pivot.measures);
59020
59076
  this.history.update("formulaIds", formulaId, pivotId);
59021
59077
  this.history.update("nextFormulaId", this.nextFormulaId + 1);
@@ -59108,6 +59164,26 @@ class PivotCorePlugin extends CorePlugin {
59108
59164
  }
59109
59165
  return "Success" /* CommandResult.Success */;
59110
59166
  }
59167
+ repairSortedColumn(definition) {
59168
+ if (definition.sortedColumn) {
59169
+ // Fix for an upgrade issue: the sortedColumn measure was not updated
59170
+ // from using fieldName to using id. If the sortedColumn measure matches
59171
+ // a measure fieldName in the definition, update it to use the measure's id instead
59172
+ // of its fieldName.
59173
+ // TODO: add an upgrade step to fix this in master and remove this code
59174
+ const sortedMeasure = definition.measures.find((measure) => measure.fieldName === definition.sortedColumn?.measure);
59175
+ if (sortedMeasure) {
59176
+ return {
59177
+ ...definition,
59178
+ sortedColumn: {
59179
+ ...definition.sortedColumn,
59180
+ measure: sortedMeasure.id,
59181
+ },
59182
+ };
59183
+ }
59184
+ }
59185
+ return definition;
59186
+ }
59111
59187
  // ---------------------------------------------------------------------
59112
59188
  // Import/Export
59113
59189
  // ---------------------------------------------------------------------
@@ -68016,11 +68092,6 @@ class GridSelectionPlugin extends UIPlugin {
68016
68092
  },
68017
68093
  ];
68018
68094
  const sheetId = this.getActiveSheetId();
68019
- const handler = new CellClipboardHandler(this.getters, this.dispatch);
68020
- const data = handler.copy(getClipboardDataPositions(sheetId, target));
68021
- if (!data) {
68022
- return;
68023
- }
68024
68095
  const base = isBasedBefore ? cmd.base : cmd.base + 1;
68025
68096
  const pasteTarget = [
68026
68097
  {
@@ -68030,7 +68101,14 @@ class GridSelectionPlugin extends UIPlugin {
68030
68101
  bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
68031
68102
  },
68032
68103
  ];
68033
- handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
68104
+ for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
68105
+ const handler = new Handler(this.getters, this.dispatch);
68106
+ const data = handler.copy(getClipboardDataPositions(sheetId, target));
68107
+ if (!data) {
68108
+ continue;
68109
+ }
68110
+ handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
68111
+ }
68034
68112
  const selection = pasteTarget[0];
68035
68113
  const col = selection.left;
68036
68114
  const row = selection.top;
@@ -76433,6 +76511,6 @@ exports.tokenColors = tokenColors;
76433
76511
  exports.tokenize = tokenize;
76434
76512
 
76435
76513
 
76436
- __info__.version = "18.1.23";
76437
- __info__.date = "2025-05-30T08:45:44.408Z";
76438
- __info__.hash = "a21fa01";
76514
+ __info__.version = "18.1.24";
76515
+ __info__.date = "2025-06-06T09:31:57.011Z";
76516
+ __info__.hash = "0e386b2";
@@ -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';
@@ -4822,6 +4822,7 @@ declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState
4822
4822
  private compileMeasureFormula;
4823
4823
  private replaceMeasureFormula;
4824
4824
  private checkDuplicatedMeasureIds;
4825
+ private repairSortedColumn;
4825
4826
  /**
4826
4827
  * Import the pivots
4827
4828
  */
@@ -6262,7 +6263,7 @@ interface ChartShowValuesPluginOptions {
6262
6263
  showValues: boolean;
6263
6264
  background?: Color;
6264
6265
  horizontal?: boolean;
6265
- callback: (value: number | string, axisId: string) => string;
6266
+ callback: (value: number | string, dataset: ChartMeta, index: number) => string;
6266
6267
  }
6267
6268
  declare module "chart.js" {
6268
6269
  interface PluginOptionsByType<TType extends ChartType$1> {
@@ -13276,6 +13277,8 @@ declare const chartHelpers: {
13276
13277
  [key: string]: chart_js.ScaleOptionsByType<"projection" | keyof chart_js.ColorScaleTypeRegistry>;
13277
13278
  }>;
13278
13279
  getChartShowValues(definition: ChartWithDataSetDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
13280
+ getPyramidChartShowValues(definition: ChartWithDataSetDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
13281
+ getWaterfallChartShowValues(definition: WaterfallChartDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
13279
13282
  getChartTitle(definition: ChartWithDataSetDefinition): chart_js_dist_types_utils._DeepPartialObject<chart_js.TitleOptions>;
13280
13283
  getBarChartTooltip(definition: GenericDefinition<BarChartDefinition>, args: ChartRuntimeGenerationArgs): chart_js_dist_types_utils._DeepPartialObject<chart_js.TooltipOptions<any>>;
13281
13284
  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.1.23
6
- * @date 2025-05-30T08:45:44.408Z
7
- * @hash a21fa01
5
+ * @version 18.1.24
6
+ * @date 2025-06-06T09:31:57.011Z
7
+ * @hash 0e386b2
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';
@@ -10206,8 +10206,6 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10206
10206
  if (isNaN(value)) {
10207
10207
  continue;
10208
10208
  }
10209
- const axisId = chart.config.type === "radar" ? dataset.rAxisID : dataset.yAxisID;
10210
- const displayValue = options.callback(Number(value), axisId);
10211
10209
  const point = dataset.data[i];
10212
10210
  const xPosition = point.x;
10213
10211
  let yPosition = 0;
@@ -10231,7 +10229,8 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10231
10229
  textsPositions[xPosition].push(yPosition);
10232
10230
  ctx.fillStyle = point.options.backgroundColor;
10233
10231
  ctx.strokeStyle = options.background || "#ffffff";
10234
- drawTextWithBackground(displayValue, xPosition, yPosition, ctx);
10232
+ const valueToDisplay = options.callback(Number(value), dataset, i);
10233
+ drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
10235
10234
  }
10236
10235
  }
10237
10236
  }
@@ -10248,7 +10247,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10248
10247
  if (isNaN(value)) {
10249
10248
  continue;
10250
10249
  }
10251
- const displayValue = options.callback(value, dataset.xAxisID);
10250
+ const displayValue = options.callback(value, dataset, i);
10252
10251
  const point = dataset.data[i];
10253
10252
  const yPosition = point.y;
10254
10253
  let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
@@ -10286,7 +10285,7 @@ function drawPieChartValues(chart, options, ctx) {
10286
10285
  const y = bar.y + midRadius * Math.sin(midAngle) + 7;
10287
10286
  ctx.fillStyle = chartFontColor(options.background);
10288
10287
  ctx.strokeStyle = options.background || "#ffffff";
10289
- const displayValue = options.callback(value, "y");
10288
+ const displayValue = options.callback(value, dataset, i);
10290
10289
  drawTextWithBackground(displayValue, x, y, ctx);
10291
10290
  }
10292
10291
  }
@@ -30051,9 +30050,51 @@ function getChartShowValues(definition, args) {
30051
30050
  horizontal: "horizontal" in definition && definition.horizontal,
30052
30051
  showValues: "showValues" in definition ? !!definition.showValues : false,
30053
30052
  background: definition.background,
30054
- callback: formatChartDatasetValue(axisFormats, locale),
30053
+ callback: (value, dataset) => {
30054
+ const axisId = getDatasetAxisId(definition, dataset);
30055
+ return formatChartDatasetValue(axisFormats, locale)(value, axisId);
30056
+ },
30055
30057
  };
30056
30058
  }
30059
+ function getPyramidChartShowValues(definition, args) {
30060
+ const { axisFormats, locale } = args;
30061
+ return {
30062
+ horizontal: true,
30063
+ showValues: "showValues" in definition ? !!definition.showValues : false,
30064
+ background: definition.background,
30065
+ callback: (value, dataset) => {
30066
+ value = Math.abs(Number(value));
30067
+ return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
30068
+ },
30069
+ };
30070
+ }
30071
+ function getWaterfallChartShowValues(definition, args) {
30072
+ const { axisFormats, locale, dataSetsValues } = args;
30073
+ const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
30074
+ subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
30075
+ return subtotalIndexes;
30076
+ }, []);
30077
+ return {
30078
+ showValues: "showValues" in definition ? !!definition.showValues : false,
30079
+ background: definition.background,
30080
+ callback: (value, dataset, index) => {
30081
+ const raw = dataset._dataset.data[index];
30082
+ const delta = raw[1] - raw[0];
30083
+ let sign = delta >= 0 ? "+" : "";
30084
+ if (definition.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
30085
+ sign = "";
30086
+ }
30087
+ return `${sign}${formatChartDatasetValue(axisFormats, locale)(delta, dataset.yAxisID)}`;
30088
+ },
30089
+ };
30090
+ }
30091
+ function getDatasetAxisId(definition, dataset) {
30092
+ if (dataset.rAxisID) {
30093
+ return dataset.rAxisID;
30094
+ }
30095
+ const axisId = "horizontal" in definition && definition.horizontal ? dataset.xAxisID : dataset.yAxisID;
30096
+ return axisId || "y";
30097
+ }
30057
30098
 
30058
30099
  function getChartTitle(definition) {
30059
30100
  const chartTitle = definition.title;
@@ -30262,6 +30303,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
30262
30303
  getPieChartTooltip: getPieChartTooltip,
30263
30304
  getPyramidChartData: getPyramidChartData,
30264
30305
  getPyramidChartScales: getPyramidChartScales,
30306
+ getPyramidChartShowValues: getPyramidChartShowValues,
30265
30307
  getPyramidChartTooltip: getPyramidChartTooltip,
30266
30308
  getRadarChartData: getRadarChartData,
30267
30309
  getRadarChartDatasets: getRadarChartDatasets,
@@ -30275,6 +30317,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
30275
30317
  getTrendDatasetForLineChart: getTrendDatasetForLineChart,
30276
30318
  getWaterfallChartLegend: getWaterfallChartLegend,
30277
30319
  getWaterfallChartScales: getWaterfallChartScales,
30320
+ getWaterfallChartShowValues: getWaterfallChartShowValues,
30278
30321
  getWaterfallChartTooltip: getWaterfallChartTooltip,
30279
30322
  getWaterfallDatasetAndLabels: getWaterfallDatasetAndLabels
30280
30323
  });
@@ -31373,7 +31416,7 @@ function createPyramidChartRuntime(chart, getters) {
31373
31416
  title: getChartTitle(definition),
31374
31417
  legend: getBarChartLegend(definition),
31375
31418
  tooltip: getPyramidChartTooltip(definition, chartData),
31376
- chartShowValuesPlugin: getChartShowValues(definition, chartData),
31419
+ chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
31377
31420
  },
31378
31421
  },
31379
31422
  };
@@ -31836,7 +31879,7 @@ function createWaterfallChartRuntime(chart, getters) {
31836
31879
  title: getChartTitle(definition),
31837
31880
  legend: getWaterfallChartLegend(definition),
31838
31881
  tooltip: getWaterfallChartTooltip(definition, chartData),
31839
- chartShowValuesPlugin: getChartShowValues(definition, chartData),
31882
+ chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
31840
31883
  waterfallLinesPlugin: { showConnectorLines: definition.showConnectorLines },
31841
31884
  },
31842
31885
  },
@@ -44319,13 +44362,15 @@ class FindAndReplaceStore extends SpreadsheetStore {
44319
44362
  if (this.selectedMatchIndex === null) {
44320
44363
  return;
44321
44364
  }
44365
+ this.preserveSelectedMatchIndex = true;
44366
+ this.shouldFinalizeUpdateSelection = true;
44322
44367
  this.model.dispatch("REPLACE_SEARCH", {
44323
44368
  searchString: this.toSearch,
44324
44369
  replaceWith: this.toReplace,
44325
44370
  matches: [this.searchMatches[this.selectedMatchIndex]],
44326
44371
  searchOptions: this.searchOptions,
44327
44372
  });
44328
- this.selectNextCell(Direction.next, { jumpToMatchSheet: true, updateSelection: true });
44373
+ this.preserveSelectedMatchIndex = false;
44329
44374
  }
44330
44375
  /**
44331
44376
  * Apply the replace function to all the matches one time.
@@ -51821,6 +51866,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
51821
51866
  let deltaX = lastX - clientX;
51822
51867
  let deltaY = lastY - clientY;
51823
51868
  const elapsedTime = currentTime - lastTime;
51869
+ if (!elapsedTime) {
51870
+ return;
51871
+ }
51824
51872
  velocityX = deltaX / elapsedTime;
51825
51873
  velocityY = deltaY / elapsedTime;
51826
51874
  lastX = clientX;
@@ -51841,6 +51889,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
51841
51889
  function onTouchEnd(ev) {
51842
51890
  isMouseDown = false;
51843
51891
  lastX = lastY = 0;
51892
+ if (resetTimeout) {
51893
+ clearTimeout(resetTimeout);
51894
+ }
51895
+ velocityX *= 1.2;
51896
+ velocityY *= 1.2;
51844
51897
  requestAnimationFrame(scroll);
51845
51898
  }
51846
51899
  function scroll() {
@@ -58942,7 +58995,7 @@ class PivotCorePlugin extends CorePlugin {
58942
58995
  break;
58943
58996
  }
58944
58997
  case "UPDATE_PIVOT": {
58945
- this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
58998
+ this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
58946
58999
  this.compileCalculatedMeasures(cmd.pivot.measures);
58947
59000
  break;
58948
59001
  }
@@ -59013,7 +59066,10 @@ class PivotCorePlugin extends CorePlugin {
59013
59066
  // Private
59014
59067
  // -------------------------------------------------------------------------
59015
59068
  addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
59016
- this.history.update("pivots", pivotId, { definition: deepCopy(pivot), formulaId });
59069
+ this.history.update("pivots", pivotId, {
59070
+ definition: this.repairSortedColumn(deepCopy(pivot)),
59071
+ formulaId,
59072
+ });
59017
59073
  this.compileCalculatedMeasures(pivot.measures);
59018
59074
  this.history.update("formulaIds", formulaId, pivotId);
59019
59075
  this.history.update("nextFormulaId", this.nextFormulaId + 1);
@@ -59106,6 +59162,26 @@ class PivotCorePlugin extends CorePlugin {
59106
59162
  }
59107
59163
  return "Success" /* CommandResult.Success */;
59108
59164
  }
59165
+ repairSortedColumn(definition) {
59166
+ if (definition.sortedColumn) {
59167
+ // Fix for an upgrade issue: the sortedColumn measure was not updated
59168
+ // from using fieldName to using id. If the sortedColumn measure matches
59169
+ // a measure fieldName in the definition, update it to use the measure's id instead
59170
+ // of its fieldName.
59171
+ // TODO: add an upgrade step to fix this in master and remove this code
59172
+ const sortedMeasure = definition.measures.find((measure) => measure.fieldName === definition.sortedColumn?.measure);
59173
+ if (sortedMeasure) {
59174
+ return {
59175
+ ...definition,
59176
+ sortedColumn: {
59177
+ ...definition.sortedColumn,
59178
+ measure: sortedMeasure.id,
59179
+ },
59180
+ };
59181
+ }
59182
+ }
59183
+ return definition;
59184
+ }
59109
59185
  // ---------------------------------------------------------------------
59110
59186
  // Import/Export
59111
59187
  // ---------------------------------------------------------------------
@@ -68014,11 +68090,6 @@ class GridSelectionPlugin extends UIPlugin {
68014
68090
  },
68015
68091
  ];
68016
68092
  const sheetId = this.getActiveSheetId();
68017
- const handler = new CellClipboardHandler(this.getters, this.dispatch);
68018
- const data = handler.copy(getClipboardDataPositions(sheetId, target));
68019
- if (!data) {
68020
- return;
68021
- }
68022
68093
  const base = isBasedBefore ? cmd.base : cmd.base + 1;
68023
68094
  const pasteTarget = [
68024
68095
  {
@@ -68028,7 +68099,14 @@ class GridSelectionPlugin extends UIPlugin {
68028
68099
  bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
68029
68100
  },
68030
68101
  ];
68031
- handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
68102
+ for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
68103
+ const handler = new Handler(this.getters, this.dispatch);
68104
+ const data = handler.copy(getClipboardDataPositions(sheetId, target));
68105
+ if (!data) {
68106
+ continue;
68107
+ }
68108
+ handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
68109
+ }
68032
68110
  const selection = pasteTarget[0];
68033
68111
  const col = selection.left;
68034
68112
  const row = selection.top;
@@ -76387,6 +76465,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
76387
76465
  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 };
76388
76466
 
76389
76467
 
76390
- __info__.version = "18.1.23";
76391
- __info__.date = "2025-05-30T08:45:44.408Z";
76392
- __info__.hash = "a21fa01";
76468
+ __info__.version = "18.1.24";
76469
+ __info__.date = "2025-06-06T09:31:57.011Z";
76470
+ __info__.hash = "0e386b2";