@odoo/o-spreadsheet 18.0.30 → 18.0.32

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.0.30
6
- * @date 2025-05-26T12:35:05.184Z
7
- * @hash 838c4f7
5
+ * @version 18.0.32
6
+ * @date 2025-06-06T09:29:16.581Z
7
+ * @hash bef1e2b
8
8
  */
9
9
 
10
10
  'use strict';
@@ -8116,9 +8116,10 @@ const AGGREGATOR_NAMES = {
8116
8116
  avg: _t("Average"),
8117
8117
  sum: _t("Sum"),
8118
8118
  };
8119
+ const NUMBER_CHAR_AGGREGATORS = ["max", "min", "avg", "sum", "count_distinct", "count"];
8119
8120
  const AGGREGATORS_BY_FIELD_TYPE = {
8120
- integer: ["max", "min", "avg", "sum", "count_distinct", "count"],
8121
- char: ["count_distinct", "count"],
8121
+ integer: NUMBER_CHAR_AGGREGATORS,
8122
+ char: NUMBER_CHAR_AGGREGATORS,
8122
8123
  boolean: ["count_distinct", "count", "bool_and", "bool_or"],
8123
8124
  };
8124
8125
  const AGGREGATORS = {};
@@ -10121,7 +10122,8 @@ function drawLineOrBarChartValues(chart, options, ctx) {
10121
10122
  textsPositions[xPosition].push(yPosition);
10122
10123
  ctx.fillStyle = point.options.backgroundColor;
10123
10124
  ctx.strokeStyle = options.background || "#ffffff";
10124
- drawTextWithBackground(options.callback(value - 0), xPosition, yPosition, ctx);
10125
+ const valueToDisplay = options.callback(Number(value), dataset, i);
10126
+ drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
10125
10127
  }
10126
10128
  }
10127
10129
  }
@@ -10135,7 +10137,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10135
10137
  }
10136
10138
  for (let i = 0; i < dataset._parsed.length; i++) {
10137
10139
  const value = dataset._parsed[i].x;
10138
- const displayValue = options.callback(value - 0);
10140
+ const displayValue = options.callback(value, dataset, i);
10139
10141
  const point = dataset.data[i];
10140
10142
  const yPosition = point.y;
10141
10143
  let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
@@ -10173,7 +10175,7 @@ function drawPieChartValues(chart, options, ctx) {
10173
10175
  const y = bar.y + midRadius * Math.sin(midAngle) + 7;
10174
10176
  ctx.fillStyle = chartFontColor(options.background);
10175
10177
  ctx.strokeStyle = options.background || "#ffffff";
10176
- const displayValue = options.callback(value);
10178
+ const displayValue = options.callback(value, dataset, i);
10177
10179
  drawTextWithBackground(displayValue, x, y, ctx);
10178
10180
  }
10179
10181
  }
@@ -30890,7 +30892,7 @@ function createPyramidChartRuntime(chart, getters) {
30890
30892
  return tooltipLabelCallback(tooltipItem);
30891
30893
  };
30892
30894
  const callback = config.options.plugins.chartShowValuesPlugin.callback;
30893
- config.options.plugins.chartShowValuesPlugin.callback = (x) => callback(Math.abs(x));
30895
+ config.options.plugins.chartShowValuesPlugin.callback = (value, dataset, index) => callback(Math.abs(value), dataset, index);
30894
30896
  return { chartJsConfig: config, background: chart.background || BACKGROUND_CHART_COLOR };
30895
30897
  }
30896
30898
 
@@ -31165,7 +31167,7 @@ class WaterfallChart extends AbstractChart {
31165
31167
  return new WaterfallChart(definition, this.sheetId, this.getters);
31166
31168
  }
31167
31169
  }
31168
- function getWaterfallConfiguration(chart, labels, dataSeriesLabels, localeFormat) {
31170
+ function getWaterfallConfiguration(chart, labels, dataSeriesLabels, localeFormat, dataSetsValues) {
31169
31171
  const { locale, format } = localeFormat;
31170
31172
  const fontColor = chartFontColor(chart.background);
31171
31173
  const config = getDefaultChartJsRuntime(chart, labels, fontColor, localeFormat);
@@ -31258,10 +31260,22 @@ function getWaterfallConfiguration(chart, labels, dataSeriesLabels, localeFormat
31258
31260
  },
31259
31261
  };
31260
31262
  config.options.plugins.waterfallLinesPlugin = { showConnectorLines: chart.showConnectorLines };
31263
+ const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
31264
+ subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
31265
+ return subtotalIndexes;
31266
+ }, []);
31261
31267
  config.options.plugins.chartShowValuesPlugin = {
31262
31268
  showValues: chart.showValues,
31263
31269
  background: chart.background,
31264
- callback: formatTickValue(localeFormat),
31270
+ callback: (value, dataset, index) => {
31271
+ const raw = dataset._dataset.data[index];
31272
+ const delta = raw[1] - raw[0];
31273
+ let sign = delta >= 0 ? "+" : "";
31274
+ if (chart.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
31275
+ sign = "";
31276
+ }
31277
+ return `${sign}${formatTickValue(localeFormat)(delta)}`;
31278
+ },
31265
31279
  };
31266
31280
  return config;
31267
31281
  }
@@ -31282,10 +31296,7 @@ function createWaterfallChartRuntime(chart, getters) {
31282
31296
  const dataSetFormat = getChartDatasetFormat(getters, chart.dataSets);
31283
31297
  const locale = getters.getLocale();
31284
31298
  const dataSeriesLabels = dataSetsValues.map((dataSet) => dataSet.label);
31285
- const config = getWaterfallConfiguration(chart, labels, dataSeriesLabels, {
31286
- format: dataSetFormat,
31287
- locale,
31288
- });
31299
+ const config = getWaterfallConfiguration(chart, labels, dataSeriesLabels, { format: dataSetFormat, locale }, dataSetsValues);
31289
31300
  config.type = "bar";
31290
31301
  const negativeColor = chart.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
31291
31302
  const positiveColor = chart.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
@@ -42346,13 +42357,14 @@ class FindAndReplaceStore extends SpreadsheetStore {
42346
42357
  if (this.selectedMatchIndex === null) {
42347
42358
  return;
42348
42359
  }
42360
+ this.preserveSelectedMatchIndex = true;
42349
42361
  this.model.dispatch("REPLACE_SEARCH", {
42350
42362
  searchString: this.toSearch,
42351
42363
  replaceWith: this.toReplace,
42352
42364
  matches: [this.searchMatches[this.selectedMatchIndex]],
42353
42365
  searchOptions: this.searchOptions,
42354
42366
  });
42355
- this.selectNextCell(Direction.next);
42367
+ this.preserveSelectedMatchIndex = false;
42356
42368
  }
42357
42369
  /**
42358
42370
  * Apply the replace function to all the matches one time.
@@ -44664,12 +44676,7 @@ class SpreadsheetPivot {
44664
44676
  entry[field.name] = { value: null, type: CellValueType.empty, formattedValue: "" };
44665
44677
  }
44666
44678
  else {
44667
- if (field.type === "char") {
44668
- entry[field.name] = { ...cell, value: cell.formattedValue || null };
44669
- }
44670
- else {
44671
- entry[field.name] = cell;
44672
- }
44679
+ entry[field.name] = cell;
44673
44680
  }
44674
44681
  }
44675
44682
  entry["__count"] = { value: 1, type: CellValueType.number, formattedValue: "1" };
@@ -49702,6 +49709,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
49702
49709
  let deltaX = lastX - clientX;
49703
49710
  let deltaY = lastY - clientY;
49704
49711
  const elapsedTime = currentTime - lastTime;
49712
+ if (!elapsedTime) {
49713
+ return;
49714
+ }
49705
49715
  velocityX = deltaX / elapsedTime;
49706
49716
  velocityY = deltaY / elapsedTime;
49707
49717
  lastX = clientX;
@@ -49722,6 +49732,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
49722
49732
  function onTouchEnd(ev) {
49723
49733
  isMouseDown = false;
49724
49734
  lastX = lastY = 0;
49735
+ if (resetTimeout) {
49736
+ clearTimeout(resetTimeout);
49737
+ }
49738
+ velocityX *= 1.2;
49739
+ velocityY *= 1.2;
49725
49740
  requestAnimationFrame(scroll);
49726
49741
  }
49727
49742
  function scroll() {
@@ -65974,11 +65989,6 @@ class GridSelectionPlugin extends UIPlugin {
65974
65989
  },
65975
65990
  ];
65976
65991
  const sheetId = this.getActiveSheetId();
65977
- const handler = new CellClipboardHandler(this.getters, this.dispatch);
65978
- const data = handler.copy(getClipboardDataPositions(sheetId, target));
65979
- if (!data) {
65980
- return;
65981
- }
65982
65992
  const base = isBasedBefore ? cmd.base : cmd.base + 1;
65983
65993
  const pasteTarget = [
65984
65994
  {
@@ -65988,7 +65998,14 @@ class GridSelectionPlugin extends UIPlugin {
65988
65998
  bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
65989
65999
  },
65990
66000
  ];
65991
- handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
66001
+ for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
66002
+ const handler = new Handler(this.getters, this.dispatch);
66003
+ const data = handler.copy(getClipboardDataPositions(sheetId, target));
66004
+ if (!data) {
66005
+ continue;
66006
+ }
66007
+ handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
66008
+ }
65992
66009
  const selection = pasteTarget[0];
65993
66010
  const col = selection.left;
65994
66011
  const row = selection.top;
@@ -74404,6 +74421,6 @@ exports.tokenColors = tokenColors;
74404
74421
  exports.tokenize = tokenize;
74405
74422
 
74406
74423
 
74407
- __info__.version = "18.0.30";
74408
- __info__.date = "2025-05-26T12:35:05.184Z";
74409
- __info__.hash = "838c4f7";
74424
+ __info__.version = "18.0.32";
74425
+ __info__.date = "2025-06-06T09:29:16.581Z";
74426
+ __info__.hash = "bef1e2b";
@@ -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.0.30
6
- * @date 2025-05-26T12:35:05.184Z
7
- * @hash 838c4f7
5
+ * @version 18.0.32
6
+ * @date 2025-06-06T09:29:16.581Z
7
+ * @hash bef1e2b
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';
@@ -8114,9 +8114,10 @@ const AGGREGATOR_NAMES = {
8114
8114
  avg: _t("Average"),
8115
8115
  sum: _t("Sum"),
8116
8116
  };
8117
+ const NUMBER_CHAR_AGGREGATORS = ["max", "min", "avg", "sum", "count_distinct", "count"];
8117
8118
  const AGGREGATORS_BY_FIELD_TYPE = {
8118
- integer: ["max", "min", "avg", "sum", "count_distinct", "count"],
8119
- char: ["count_distinct", "count"],
8119
+ integer: NUMBER_CHAR_AGGREGATORS,
8120
+ char: NUMBER_CHAR_AGGREGATORS,
8120
8121
  boolean: ["count_distinct", "count", "bool_and", "bool_or"],
8121
8122
  };
8122
8123
  const AGGREGATORS = {};
@@ -10119,7 +10120,8 @@ function drawLineOrBarChartValues(chart, options, ctx) {
10119
10120
  textsPositions[xPosition].push(yPosition);
10120
10121
  ctx.fillStyle = point.options.backgroundColor;
10121
10122
  ctx.strokeStyle = options.background || "#ffffff";
10122
- drawTextWithBackground(options.callback(value - 0), xPosition, yPosition, ctx);
10123
+ const valueToDisplay = options.callback(Number(value), dataset, i);
10124
+ drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
10123
10125
  }
10124
10126
  }
10125
10127
  }
@@ -10133,7 +10135,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10133
10135
  }
10134
10136
  for (let i = 0; i < dataset._parsed.length; i++) {
10135
10137
  const value = dataset._parsed[i].x;
10136
- const displayValue = options.callback(value - 0);
10138
+ const displayValue = options.callback(value, dataset, i);
10137
10139
  const point = dataset.data[i];
10138
10140
  const yPosition = point.y;
10139
10141
  let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
@@ -10171,7 +10173,7 @@ function drawPieChartValues(chart, options, ctx) {
10171
10173
  const y = bar.y + midRadius * Math.sin(midAngle) + 7;
10172
10174
  ctx.fillStyle = chartFontColor(options.background);
10173
10175
  ctx.strokeStyle = options.background || "#ffffff";
10174
- const displayValue = options.callback(value);
10176
+ const displayValue = options.callback(value, dataset, i);
10175
10177
  drawTextWithBackground(displayValue, x, y, ctx);
10176
10178
  }
10177
10179
  }
@@ -30888,7 +30890,7 @@ function createPyramidChartRuntime(chart, getters) {
30888
30890
  return tooltipLabelCallback(tooltipItem);
30889
30891
  };
30890
30892
  const callback = config.options.plugins.chartShowValuesPlugin.callback;
30891
- config.options.plugins.chartShowValuesPlugin.callback = (x) => callback(Math.abs(x));
30893
+ config.options.plugins.chartShowValuesPlugin.callback = (value, dataset, index) => callback(Math.abs(value), dataset, index);
30892
30894
  return { chartJsConfig: config, background: chart.background || BACKGROUND_CHART_COLOR };
30893
30895
  }
30894
30896
 
@@ -31163,7 +31165,7 @@ class WaterfallChart extends AbstractChart {
31163
31165
  return new WaterfallChart(definition, this.sheetId, this.getters);
31164
31166
  }
31165
31167
  }
31166
- function getWaterfallConfiguration(chart, labels, dataSeriesLabels, localeFormat) {
31168
+ function getWaterfallConfiguration(chart, labels, dataSeriesLabels, localeFormat, dataSetsValues) {
31167
31169
  const { locale, format } = localeFormat;
31168
31170
  const fontColor = chartFontColor(chart.background);
31169
31171
  const config = getDefaultChartJsRuntime(chart, labels, fontColor, localeFormat);
@@ -31256,10 +31258,22 @@ function getWaterfallConfiguration(chart, labels, dataSeriesLabels, localeFormat
31256
31258
  },
31257
31259
  };
31258
31260
  config.options.plugins.waterfallLinesPlugin = { showConnectorLines: chart.showConnectorLines };
31261
+ const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
31262
+ subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
31263
+ return subtotalIndexes;
31264
+ }, []);
31259
31265
  config.options.plugins.chartShowValuesPlugin = {
31260
31266
  showValues: chart.showValues,
31261
31267
  background: chart.background,
31262
- callback: formatTickValue(localeFormat),
31268
+ callback: (value, dataset, index) => {
31269
+ const raw = dataset._dataset.data[index];
31270
+ const delta = raw[1] - raw[0];
31271
+ let sign = delta >= 0 ? "+" : "";
31272
+ if (chart.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
31273
+ sign = "";
31274
+ }
31275
+ return `${sign}${formatTickValue(localeFormat)(delta)}`;
31276
+ },
31263
31277
  };
31264
31278
  return config;
31265
31279
  }
@@ -31280,10 +31294,7 @@ function createWaterfallChartRuntime(chart, getters) {
31280
31294
  const dataSetFormat = getChartDatasetFormat(getters, chart.dataSets);
31281
31295
  const locale = getters.getLocale();
31282
31296
  const dataSeriesLabels = dataSetsValues.map((dataSet) => dataSet.label);
31283
- const config = getWaterfallConfiguration(chart, labels, dataSeriesLabels, {
31284
- format: dataSetFormat,
31285
- locale,
31286
- });
31297
+ const config = getWaterfallConfiguration(chart, labels, dataSeriesLabels, { format: dataSetFormat, locale }, dataSetsValues);
31287
31298
  config.type = "bar";
31288
31299
  const negativeColor = chart.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
31289
31300
  const positiveColor = chart.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
@@ -42344,13 +42355,14 @@ class FindAndReplaceStore extends SpreadsheetStore {
42344
42355
  if (this.selectedMatchIndex === null) {
42345
42356
  return;
42346
42357
  }
42358
+ this.preserveSelectedMatchIndex = true;
42347
42359
  this.model.dispatch("REPLACE_SEARCH", {
42348
42360
  searchString: this.toSearch,
42349
42361
  replaceWith: this.toReplace,
42350
42362
  matches: [this.searchMatches[this.selectedMatchIndex]],
42351
42363
  searchOptions: this.searchOptions,
42352
42364
  });
42353
- this.selectNextCell(Direction.next);
42365
+ this.preserveSelectedMatchIndex = false;
42354
42366
  }
42355
42367
  /**
42356
42368
  * Apply the replace function to all the matches one time.
@@ -44662,12 +44674,7 @@ class SpreadsheetPivot {
44662
44674
  entry[field.name] = { value: null, type: CellValueType.empty, formattedValue: "" };
44663
44675
  }
44664
44676
  else {
44665
- if (field.type === "char") {
44666
- entry[field.name] = { ...cell, value: cell.formattedValue || null };
44667
- }
44668
- else {
44669
- entry[field.name] = cell;
44670
- }
44677
+ entry[field.name] = cell;
44671
44678
  }
44672
44679
  }
44673
44680
  entry["__count"] = { value: 1, type: CellValueType.number, formattedValue: "1" };
@@ -49700,6 +49707,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
49700
49707
  let deltaX = lastX - clientX;
49701
49708
  let deltaY = lastY - clientY;
49702
49709
  const elapsedTime = currentTime - lastTime;
49710
+ if (!elapsedTime) {
49711
+ return;
49712
+ }
49703
49713
  velocityX = deltaX / elapsedTime;
49704
49714
  velocityY = deltaY / elapsedTime;
49705
49715
  lastX = clientX;
@@ -49720,6 +49730,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
49720
49730
  function onTouchEnd(ev) {
49721
49731
  isMouseDown = false;
49722
49732
  lastX = lastY = 0;
49733
+ if (resetTimeout) {
49734
+ clearTimeout(resetTimeout);
49735
+ }
49736
+ velocityX *= 1.2;
49737
+ velocityY *= 1.2;
49723
49738
  requestAnimationFrame(scroll);
49724
49739
  }
49725
49740
  function scroll() {
@@ -65972,11 +65987,6 @@ class GridSelectionPlugin extends UIPlugin {
65972
65987
  },
65973
65988
  ];
65974
65989
  const sheetId = this.getActiveSheetId();
65975
- const handler = new CellClipboardHandler(this.getters, this.dispatch);
65976
- const data = handler.copy(getClipboardDataPositions(sheetId, target));
65977
- if (!data) {
65978
- return;
65979
- }
65980
65990
  const base = isBasedBefore ? cmd.base : cmd.base + 1;
65981
65991
  const pasteTarget = [
65982
65992
  {
@@ -65986,7 +65996,14 @@ class GridSelectionPlugin extends UIPlugin {
65986
65996
  bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
65987
65997
  },
65988
65998
  ];
65989
- handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
65999
+ for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
66000
+ const handler = new Handler(this.getters, this.dispatch);
66001
+ const data = handler.copy(getClipboardDataPositions(sheetId, target));
66002
+ if (!data) {
66003
+ continue;
66004
+ }
66005
+ handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
66006
+ }
65990
66007
  const selection = pasteTarget[0];
65991
66008
  const col = selection.left;
65992
66009
  const row = selection.top;
@@ -74359,6 +74376,6 @@ const constants = {
74359
74376
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, 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 };
74360
74377
 
74361
74378
 
74362
- __info__.version = "18.0.30";
74363
- __info__.date = "2025-05-26T12:35:05.184Z";
74364
- __info__.hash = "838c4f7";
74379
+ __info__.version = "18.0.32";
74380
+ __info__.date = "2025-06-06T09:29:16.581Z";
74381
+ __info__.hash = "bef1e2b";
@@ -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.0.30
6
- * @date 2025-05-26T12:35:05.184Z
7
- * @hash 838c4f7
5
+ * @version 18.0.32
6
+ * @date 2025-06-06T09:29:16.581Z
7
+ * @hash bef1e2b
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -8115,9 +8115,10 @@
8115
8115
  avg: _t("Average"),
8116
8116
  sum: _t("Sum"),
8117
8117
  };
8118
+ const NUMBER_CHAR_AGGREGATORS = ["max", "min", "avg", "sum", "count_distinct", "count"];
8118
8119
  const AGGREGATORS_BY_FIELD_TYPE = {
8119
- integer: ["max", "min", "avg", "sum", "count_distinct", "count"],
8120
- char: ["count_distinct", "count"],
8120
+ integer: NUMBER_CHAR_AGGREGATORS,
8121
+ char: NUMBER_CHAR_AGGREGATORS,
8121
8122
  boolean: ["count_distinct", "count", "bool_and", "bool_or"],
8122
8123
  };
8123
8124
  const AGGREGATORS = {};
@@ -10120,7 +10121,8 @@ stores.inject(MyMetaStore, storeInstance);
10120
10121
  textsPositions[xPosition].push(yPosition);
10121
10122
  ctx.fillStyle = point.options.backgroundColor;
10122
10123
  ctx.strokeStyle = options.background || "#ffffff";
10123
- drawTextWithBackground(options.callback(value - 0), xPosition, yPosition, ctx);
10124
+ const valueToDisplay = options.callback(Number(value), dataset, i);
10125
+ drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
10124
10126
  }
10125
10127
  }
10126
10128
  }
@@ -10134,7 +10136,7 @@ stores.inject(MyMetaStore, storeInstance);
10134
10136
  }
10135
10137
  for (let i = 0; i < dataset._parsed.length; i++) {
10136
10138
  const value = dataset._parsed[i].x;
10137
- const displayValue = options.callback(value - 0);
10139
+ const displayValue = options.callback(value, dataset, i);
10138
10140
  const point = dataset.data[i];
10139
10141
  const yPosition = point.y;
10140
10142
  let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
@@ -10172,7 +10174,7 @@ stores.inject(MyMetaStore, storeInstance);
10172
10174
  const y = bar.y + midRadius * Math.sin(midAngle) + 7;
10173
10175
  ctx.fillStyle = chartFontColor(options.background);
10174
10176
  ctx.strokeStyle = options.background || "#ffffff";
10175
- const displayValue = options.callback(value);
10177
+ const displayValue = options.callback(value, dataset, i);
10176
10178
  drawTextWithBackground(displayValue, x, y, ctx);
10177
10179
  }
10178
10180
  }
@@ -30889,7 +30891,7 @@ stores.inject(MyMetaStore, storeInstance);
30889
30891
  return tooltipLabelCallback(tooltipItem);
30890
30892
  };
30891
30893
  const callback = config.options.plugins.chartShowValuesPlugin.callback;
30892
- config.options.plugins.chartShowValuesPlugin.callback = (x) => callback(Math.abs(x));
30894
+ config.options.plugins.chartShowValuesPlugin.callback = (value, dataset, index) => callback(Math.abs(value), dataset, index);
30893
30895
  return { chartJsConfig: config, background: chart.background || BACKGROUND_CHART_COLOR };
30894
30896
  }
30895
30897
 
@@ -31164,7 +31166,7 @@ stores.inject(MyMetaStore, storeInstance);
31164
31166
  return new WaterfallChart(definition, this.sheetId, this.getters);
31165
31167
  }
31166
31168
  }
31167
- function getWaterfallConfiguration(chart, labels, dataSeriesLabels, localeFormat) {
31169
+ function getWaterfallConfiguration(chart, labels, dataSeriesLabels, localeFormat, dataSetsValues) {
31168
31170
  const { locale, format } = localeFormat;
31169
31171
  const fontColor = chartFontColor(chart.background);
31170
31172
  const config = getDefaultChartJsRuntime(chart, labels, fontColor, localeFormat);
@@ -31257,10 +31259,22 @@ stores.inject(MyMetaStore, storeInstance);
31257
31259
  },
31258
31260
  };
31259
31261
  config.options.plugins.waterfallLinesPlugin = { showConnectorLines: chart.showConnectorLines };
31262
+ const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
31263
+ subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
31264
+ return subtotalIndexes;
31265
+ }, []);
31260
31266
  config.options.plugins.chartShowValuesPlugin = {
31261
31267
  showValues: chart.showValues,
31262
31268
  background: chart.background,
31263
- callback: formatTickValue(localeFormat),
31269
+ callback: (value, dataset, index) => {
31270
+ const raw = dataset._dataset.data[index];
31271
+ const delta = raw[1] - raw[0];
31272
+ let sign = delta >= 0 ? "+" : "";
31273
+ if (chart.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
31274
+ sign = "";
31275
+ }
31276
+ return `${sign}${formatTickValue(localeFormat)(delta)}`;
31277
+ },
31264
31278
  };
31265
31279
  return config;
31266
31280
  }
@@ -31281,10 +31295,7 @@ stores.inject(MyMetaStore, storeInstance);
31281
31295
  const dataSetFormat = getChartDatasetFormat(getters, chart.dataSets);
31282
31296
  const locale = getters.getLocale();
31283
31297
  const dataSeriesLabels = dataSetsValues.map((dataSet) => dataSet.label);
31284
- const config = getWaterfallConfiguration(chart, labels, dataSeriesLabels, {
31285
- format: dataSetFormat,
31286
- locale,
31287
- });
31298
+ const config = getWaterfallConfiguration(chart, labels, dataSeriesLabels, { format: dataSetFormat, locale }, dataSetsValues);
31288
31299
  config.type = "bar";
31289
31300
  const negativeColor = chart.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
31290
31301
  const positiveColor = chart.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
@@ -42345,13 +42356,14 @@ stores.inject(MyMetaStore, storeInstance);
42345
42356
  if (this.selectedMatchIndex === null) {
42346
42357
  return;
42347
42358
  }
42359
+ this.preserveSelectedMatchIndex = true;
42348
42360
  this.model.dispatch("REPLACE_SEARCH", {
42349
42361
  searchString: this.toSearch,
42350
42362
  replaceWith: this.toReplace,
42351
42363
  matches: [this.searchMatches[this.selectedMatchIndex]],
42352
42364
  searchOptions: this.searchOptions,
42353
42365
  });
42354
- this.selectNextCell(Direction.next);
42366
+ this.preserveSelectedMatchIndex = false;
42355
42367
  }
42356
42368
  /**
42357
42369
  * Apply the replace function to all the matches one time.
@@ -44663,12 +44675,7 @@ stores.inject(MyMetaStore, storeInstance);
44663
44675
  entry[field.name] = { value: null, type: CellValueType.empty, formattedValue: "" };
44664
44676
  }
44665
44677
  else {
44666
- if (field.type === "char") {
44667
- entry[field.name] = { ...cell, value: cell.formattedValue || null };
44668
- }
44669
- else {
44670
- entry[field.name] = cell;
44671
- }
44678
+ entry[field.name] = cell;
44672
44679
  }
44673
44680
  }
44674
44681
  entry["__count"] = { value: 1, type: CellValueType.number, formattedValue: "1" };
@@ -49701,6 +49708,9 @@ stores.inject(MyMetaStore, storeInstance);
49701
49708
  let deltaX = lastX - clientX;
49702
49709
  let deltaY = lastY - clientY;
49703
49710
  const elapsedTime = currentTime - lastTime;
49711
+ if (!elapsedTime) {
49712
+ return;
49713
+ }
49704
49714
  velocityX = deltaX / elapsedTime;
49705
49715
  velocityY = deltaY / elapsedTime;
49706
49716
  lastX = clientX;
@@ -49721,6 +49731,11 @@ stores.inject(MyMetaStore, storeInstance);
49721
49731
  function onTouchEnd(ev) {
49722
49732
  isMouseDown = false;
49723
49733
  lastX = lastY = 0;
49734
+ if (resetTimeout) {
49735
+ clearTimeout(resetTimeout);
49736
+ }
49737
+ velocityX *= 1.2;
49738
+ velocityY *= 1.2;
49724
49739
  requestAnimationFrame(scroll);
49725
49740
  }
49726
49741
  function scroll() {
@@ -65973,11 +65988,6 @@ stores.inject(MyMetaStore, storeInstance);
65973
65988
  },
65974
65989
  ];
65975
65990
  const sheetId = this.getActiveSheetId();
65976
- const handler = new CellClipboardHandler(this.getters, this.dispatch);
65977
- const data = handler.copy(getClipboardDataPositions(sheetId, target));
65978
- if (!data) {
65979
- return;
65980
- }
65981
65991
  const base = isBasedBefore ? cmd.base : cmd.base + 1;
65982
65992
  const pasteTarget = [
65983
65993
  {
@@ -65987,7 +65997,14 @@ stores.inject(MyMetaStore, storeInstance);
65987
65997
  bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
65988
65998
  },
65989
65999
  ];
65990
- handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
66000
+ for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
66001
+ const handler = new Handler(this.getters, this.dispatch);
66002
+ const data = handler.copy(getClipboardDataPositions(sheetId, target));
66003
+ if (!data) {
66004
+ continue;
66005
+ }
66006
+ handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
66007
+ }
65991
66008
  const selection = pasteTarget[0];
65992
66009
  const col = selection.left;
65993
66010
  const row = selection.top;
@@ -74403,9 +74420,9 @@ stores.inject(MyMetaStore, storeInstance);
74403
74420
  exports.tokenize = tokenize;
74404
74421
 
74405
74422
 
74406
- __info__.version = "18.0.30";
74407
- __info__.date = "2025-05-26T12:35:05.184Z";
74408
- __info__.hash = "838c4f7";
74423
+ __info__.version = "18.0.32";
74424
+ __info__.date = "2025-06-06T09:29:16.581Z";
74425
+ __info__.hash = "bef1e2b";
74409
74426
 
74410
74427
 
74411
74428
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);