@odoo/o-spreadsheet 18.1.25 → 18.1.26

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.25
6
- * @date 2025-06-12T09:49:08.707Z
7
- * @hash a232524
5
+ * @version 18.1.26
6
+ * @date 2025-06-19T18:21:37.648Z
7
+ * @hash 06479d4
8
8
  */
9
9
 
10
10
  'use strict';
@@ -10204,6 +10204,7 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10204
10204
  if (isTrendLineAxis(dataset.xAxisID) || dataset.hidden) {
10205
10205
  continue;
10206
10206
  }
10207
+ const yAxisScale = chart.scales[dataset.yAxisID];
10207
10208
  for (let i = 0; i < dataset._parsed.length; i++) {
10208
10209
  const parsedValue = dataset._parsed[i];
10209
10210
  const value = Number(chart.config.type === "radar" ? parsedValue.r : parsedValue.y);
@@ -10214,10 +10215,18 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10214
10215
  const xPosition = point.x;
10215
10216
  let yPosition = 0;
10216
10217
  if (chart.config.type === "line" || chart.config.type === "radar") {
10217
- yPosition = point.y - 10;
10218
+ yPosition = value < 0 ? point.y + 10 : point.y - 10;
10218
10219
  }
10219
10220
  else {
10220
- yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
10221
+ const yZeroLine = yAxisScale.getPixelForValue(0);
10222
+ const distanceFromAxisOrigin = Math.abs(yZeroLine - point.y);
10223
+ const textHeight = 12; // ChartJS default text height
10224
+ if (distanceFromAxisOrigin < textHeight) {
10225
+ yPosition = value < 0 ? yZeroLine + textHeight / 2 : yZeroLine - textHeight / 2;
10226
+ }
10227
+ else {
10228
+ yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
10229
+ }
10221
10230
  }
10222
10231
  yPosition = Math.min(yPosition, yMax);
10223
10232
  yPosition = Math.max(yPosition, yMin);
@@ -10227,7 +10236,7 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10227
10236
  }
10228
10237
  for (const otherPosition of textsPositions[xPosition] || []) {
10229
10238
  if (Math.abs(otherPosition - yPosition) < 13) {
10230
- yPosition = otherPosition - 13;
10239
+ yPosition = value < 0 ? otherPosition + 13 : otherPosition - 13;
10231
10240
  }
10232
10241
  }
10233
10242
  textsPositions[xPosition].push(yPosition);
@@ -10246,6 +10255,8 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10246
10255
  if (isTrendLineAxis(dataset.xAxisID)) {
10247
10256
  return; // ignore trend lines
10248
10257
  }
10258
+ const xAxisScale = chart.scales[dataset.xAxisID];
10259
+ const xZeroLine = xAxisScale.getPixelForValue(0);
10249
10260
  for (let i = 0; i < dataset._parsed.length; i++) {
10250
10261
  const value = Number(dataset._parsed[i].x);
10251
10262
  if (isNaN(value)) {
@@ -10254,17 +10265,27 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10254
10265
  const displayValue = options.callback(value, dataset, i);
10255
10266
  const point = dataset.data[i];
10256
10267
  const yPosition = point.y;
10257
- let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
10258
- xPosition = Math.min(xPosition, xMax);
10259
- xPosition = Math.max(xPosition, xMin);
10268
+ const textWidth = computeTextWidth(ctx, displayValue, { fontSize: 12 }, "px");
10269
+ const distanceFromAxisOrigin = Math.abs(point.x - xZeroLine);
10270
+ const PADDING = 3;
10271
+ let xPosition;
10272
+ if (distanceFromAxisOrigin < textWidth) {
10273
+ xPosition =
10274
+ value < 0 ? xZeroLine - textWidth / 2 - PADDING : xZeroLine + textWidth / 2 + PADDING;
10275
+ }
10276
+ else {
10277
+ xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
10278
+ xPosition = Math.min(xPosition, xMax);
10279
+ xPosition = Math.max(xPosition, xMin);
10280
+ }
10260
10281
  // Avoid overlapping texts with same Y
10261
10282
  if (!textsPositions[yPosition]) {
10262
10283
  textsPositions[yPosition] = [];
10263
10284
  }
10264
- const textWidth = computeTextWidth(ctx, displayValue, { fontSize: 12 }, "px");
10265
10285
  for (const otherPosition of textsPositions[yPosition]) {
10266
10286
  if (Math.abs(otherPosition - xPosition) < textWidth) {
10267
- xPosition = otherPosition + textWidth + 3;
10287
+ xPosition =
10288
+ value < 0 ? otherPosition - textWidth - PADDING : otherPosition + textWidth + PADDING;
10268
10289
  }
10269
10290
  }
10270
10291
  textsPositions[yPosition].push(xPosition);
@@ -30080,7 +30101,9 @@ function getPyramidChartShowValues(definition, args) {
30080
30101
  background: definition.background,
30081
30102
  callback: (value, dataset) => {
30082
30103
  value = Math.abs(Number(value));
30083
- return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
30104
+ return value === 0
30105
+ ? ""
30106
+ : formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
30084
30107
  },
30085
30108
  };
30086
30109
  }
@@ -34580,6 +34603,10 @@ const REMOVE_ROWS_ACTION = (env) => {
34580
34603
  });
34581
34604
  };
34582
34605
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
34606
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
34607
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
34608
+ return false;
34609
+ }
34583
34610
  const sheetId = env.model.getters.getActiveSheetId();
34584
34611
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
34585
34612
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -37559,11 +37586,11 @@ class OTRegistry extends Registry {
37559
37586
  * transformation function given
37560
37587
  */
37561
37588
  addTransformation(executed, toTransforms, fn) {
37562
- for (let toTransform of toTransforms) {
37563
- if (!this.content[toTransform]) {
37564
- this.content[toTransform] = new Map();
37565
- }
37566
- this.content[toTransform].set(executed, fn);
37589
+ if (!this.content[executed]) {
37590
+ this.content[executed] = new Map();
37591
+ }
37592
+ for (const toTransform of toTransforms) {
37593
+ this.content[executed].set(toTransform, fn);
37567
37594
  }
37568
37595
  return this;
37569
37596
  }
@@ -37572,7 +37599,7 @@ class OTRegistry extends Registry {
37572
37599
  * that the executed command happened.
37573
37600
  */
37574
37601
  getTransformation(toTransform, executed) {
37575
- return this.content[toTransform] && this.content[toTransform].get(executed);
37602
+ return this.content[executed] && this.content[executed].get(toTransform);
37576
37603
  }
37577
37604
  }
37578
37605
  const otRegistry = new OTRegistry();
@@ -64267,10 +64294,20 @@ function transform(toTransform, executed) {
64267
64294
  */
64268
64295
  function transformAll(toTransform, executed) {
64269
64296
  let transformedCommands = [...toTransform];
64297
+ const possibleTransformations = new Set(otRegistry.getKeys());
64270
64298
  for (const executedCommand of executed) {
64271
- transformedCommands = transformedCommands
64272
- .map((cmd) => transform(cmd, executedCommand))
64273
- .filter(isDefined);
64299
+ // If the executed command is not in the registry, we skip it
64300
+ // because we know there won't be any transformation impacting the
64301
+ // commands to transform.
64302
+ if (possibleTransformations.has(executedCommand.type)) {
64303
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
64304
+ const transformed = transform(cmd, executedCommand);
64305
+ if (transformed) {
64306
+ acc.push(transformed);
64307
+ }
64308
+ return acc;
64309
+ }, []);
64310
+ }
64274
64311
  }
64275
64312
  return transformedCommands;
64276
64313
  }
@@ -65965,7 +66002,7 @@ class SheetUIPlugin extends UIPlugin {
65965
66002
  }
65966
66003
  const position = this.getters.getCellPosition(cell.id);
65967
66004
  const colSize = this.getters.getColSize(sheetId, position.col);
65968
- if (cell.isFormula) {
66005
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
65969
66006
  const content = this.getters.getEvaluatedCell(position).formattedValue;
65970
66007
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
65971
66008
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -76537,6 +76574,6 @@ exports.tokenColors = tokenColors;
76537
76574
  exports.tokenize = tokenize;
76538
76575
 
76539
76576
 
76540
- __info__.version = "18.1.25";
76541
- __info__.date = "2025-06-12T09:49:08.707Z";
76542
- __info__.hash = "a232524";
76577
+ __info__.version = "18.1.26";
76578
+ __info__.date = "2025-06-19T18:21:37.648Z";
76579
+ __info__.hash = "06479d4";
@@ -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.25
6
- * @date 2025-06-12T09:49:08.707Z
7
- * @hash a232524
5
+ * @version 18.1.26
6
+ * @date 2025-06-19T18:21:37.648Z
7
+ * @hash 06479d4
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';
@@ -10202,6 +10202,7 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10202
10202
  if (isTrendLineAxis(dataset.xAxisID) || dataset.hidden) {
10203
10203
  continue;
10204
10204
  }
10205
+ const yAxisScale = chart.scales[dataset.yAxisID];
10205
10206
  for (let i = 0; i < dataset._parsed.length; i++) {
10206
10207
  const parsedValue = dataset._parsed[i];
10207
10208
  const value = Number(chart.config.type === "radar" ? parsedValue.r : parsedValue.y);
@@ -10212,10 +10213,18 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10212
10213
  const xPosition = point.x;
10213
10214
  let yPosition = 0;
10214
10215
  if (chart.config.type === "line" || chart.config.type === "radar") {
10215
- yPosition = point.y - 10;
10216
+ yPosition = value < 0 ? point.y + 10 : point.y - 10;
10216
10217
  }
10217
10218
  else {
10218
- yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
10219
+ const yZeroLine = yAxisScale.getPixelForValue(0);
10220
+ const distanceFromAxisOrigin = Math.abs(yZeroLine - point.y);
10221
+ const textHeight = 12; // ChartJS default text height
10222
+ if (distanceFromAxisOrigin < textHeight) {
10223
+ yPosition = value < 0 ? yZeroLine + textHeight / 2 : yZeroLine - textHeight / 2;
10224
+ }
10225
+ else {
10226
+ yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
10227
+ }
10219
10228
  }
10220
10229
  yPosition = Math.min(yPosition, yMax);
10221
10230
  yPosition = Math.max(yPosition, yMin);
@@ -10225,7 +10234,7 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10225
10234
  }
10226
10235
  for (const otherPosition of textsPositions[xPosition] || []) {
10227
10236
  if (Math.abs(otherPosition - yPosition) < 13) {
10228
- yPosition = otherPosition - 13;
10237
+ yPosition = value < 0 ? otherPosition + 13 : otherPosition - 13;
10229
10238
  }
10230
10239
  }
10231
10240
  textsPositions[xPosition].push(yPosition);
@@ -10244,6 +10253,8 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10244
10253
  if (isTrendLineAxis(dataset.xAxisID)) {
10245
10254
  return; // ignore trend lines
10246
10255
  }
10256
+ const xAxisScale = chart.scales[dataset.xAxisID];
10257
+ const xZeroLine = xAxisScale.getPixelForValue(0);
10247
10258
  for (let i = 0; i < dataset._parsed.length; i++) {
10248
10259
  const value = Number(dataset._parsed[i].x);
10249
10260
  if (isNaN(value)) {
@@ -10252,17 +10263,27 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
10252
10263
  const displayValue = options.callback(value, dataset, i);
10253
10264
  const point = dataset.data[i];
10254
10265
  const yPosition = point.y;
10255
- let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
10256
- xPosition = Math.min(xPosition, xMax);
10257
- xPosition = Math.max(xPosition, xMin);
10266
+ const textWidth = computeTextWidth(ctx, displayValue, { fontSize: 12 }, "px");
10267
+ const distanceFromAxisOrigin = Math.abs(point.x - xZeroLine);
10268
+ const PADDING = 3;
10269
+ let xPosition;
10270
+ if (distanceFromAxisOrigin < textWidth) {
10271
+ xPosition =
10272
+ value < 0 ? xZeroLine - textWidth / 2 - PADDING : xZeroLine + textWidth / 2 + PADDING;
10273
+ }
10274
+ else {
10275
+ xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
10276
+ xPosition = Math.min(xPosition, xMax);
10277
+ xPosition = Math.max(xPosition, xMin);
10278
+ }
10258
10279
  // Avoid overlapping texts with same Y
10259
10280
  if (!textsPositions[yPosition]) {
10260
10281
  textsPositions[yPosition] = [];
10261
10282
  }
10262
- const textWidth = computeTextWidth(ctx, displayValue, { fontSize: 12 }, "px");
10263
10283
  for (const otherPosition of textsPositions[yPosition]) {
10264
10284
  if (Math.abs(otherPosition - xPosition) < textWidth) {
10265
- xPosition = otherPosition + textWidth + 3;
10285
+ xPosition =
10286
+ value < 0 ? otherPosition - textWidth - PADDING : otherPosition + textWidth + PADDING;
10266
10287
  }
10267
10288
  }
10268
10289
  textsPositions[yPosition].push(xPosition);
@@ -30078,7 +30099,9 @@ function getPyramidChartShowValues(definition, args) {
30078
30099
  background: definition.background,
30079
30100
  callback: (value, dataset) => {
30080
30101
  value = Math.abs(Number(value));
30081
- return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
30102
+ return value === 0
30103
+ ? ""
30104
+ : formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
30082
30105
  },
30083
30106
  };
30084
30107
  }
@@ -34578,6 +34601,10 @@ const REMOVE_ROWS_ACTION = (env) => {
34578
34601
  });
34579
34602
  };
34580
34603
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
34604
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
34605
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
34606
+ return false;
34607
+ }
34581
34608
  const sheetId = env.model.getters.getActiveSheetId();
34582
34609
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
34583
34610
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -37557,11 +37584,11 @@ class OTRegistry extends Registry {
37557
37584
  * transformation function given
37558
37585
  */
37559
37586
  addTransformation(executed, toTransforms, fn) {
37560
- for (let toTransform of toTransforms) {
37561
- if (!this.content[toTransform]) {
37562
- this.content[toTransform] = new Map();
37563
- }
37564
- this.content[toTransform].set(executed, fn);
37587
+ if (!this.content[executed]) {
37588
+ this.content[executed] = new Map();
37589
+ }
37590
+ for (const toTransform of toTransforms) {
37591
+ this.content[executed].set(toTransform, fn);
37565
37592
  }
37566
37593
  return this;
37567
37594
  }
@@ -37570,7 +37597,7 @@ class OTRegistry extends Registry {
37570
37597
  * that the executed command happened.
37571
37598
  */
37572
37599
  getTransformation(toTransform, executed) {
37573
- return this.content[toTransform] && this.content[toTransform].get(executed);
37600
+ return this.content[executed] && this.content[executed].get(toTransform);
37574
37601
  }
37575
37602
  }
37576
37603
  const otRegistry = new OTRegistry();
@@ -64265,10 +64292,20 @@ function transform(toTransform, executed) {
64265
64292
  */
64266
64293
  function transformAll(toTransform, executed) {
64267
64294
  let transformedCommands = [...toTransform];
64295
+ const possibleTransformations = new Set(otRegistry.getKeys());
64268
64296
  for (const executedCommand of executed) {
64269
- transformedCommands = transformedCommands
64270
- .map((cmd) => transform(cmd, executedCommand))
64271
- .filter(isDefined);
64297
+ // If the executed command is not in the registry, we skip it
64298
+ // because we know there won't be any transformation impacting the
64299
+ // commands to transform.
64300
+ if (possibleTransformations.has(executedCommand.type)) {
64301
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
64302
+ const transformed = transform(cmd, executedCommand);
64303
+ if (transformed) {
64304
+ acc.push(transformed);
64305
+ }
64306
+ return acc;
64307
+ }, []);
64308
+ }
64272
64309
  }
64273
64310
  return transformedCommands;
64274
64311
  }
@@ -65963,7 +66000,7 @@ class SheetUIPlugin extends UIPlugin {
65963
66000
  }
65964
66001
  const position = this.getters.getCellPosition(cell.id);
65965
66002
  const colSize = this.getters.getColSize(sheetId, position.col);
65966
- if (cell.isFormula) {
66003
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
65967
66004
  const content = this.getters.getEvaluatedCell(position).formattedValue;
65968
66005
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
65969
66006
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -76491,6 +76528,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
76491
76528
  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 };
76492
76529
 
76493
76530
 
76494
- __info__.version = "18.1.25";
76495
- __info__.date = "2025-06-12T09:49:08.707Z";
76496
- __info__.hash = "a232524";
76531
+ __info__.version = "18.1.26";
76532
+ __info__.date = "2025-06-19T18:21:37.648Z";
76533
+ __info__.hash = "06479d4";
@@ -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.25
6
- * @date 2025-06-12T09:49:08.707Z
7
- * @hash a232524
5
+ * @version 18.1.26
6
+ * @date 2025-06-19T18:21:37.648Z
7
+ * @hash 06479d4
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -10203,6 +10203,7 @@ stores.inject(MyMetaStore, storeInstance);
10203
10203
  if (isTrendLineAxis(dataset.xAxisID) || dataset.hidden) {
10204
10204
  continue;
10205
10205
  }
10206
+ const yAxisScale = chart.scales[dataset.yAxisID];
10206
10207
  for (let i = 0; i < dataset._parsed.length; i++) {
10207
10208
  const parsedValue = dataset._parsed[i];
10208
10209
  const value = Number(chart.config.type === "radar" ? parsedValue.r : parsedValue.y);
@@ -10213,10 +10214,18 @@ stores.inject(MyMetaStore, storeInstance);
10213
10214
  const xPosition = point.x;
10214
10215
  let yPosition = 0;
10215
10216
  if (chart.config.type === "line" || chart.config.type === "radar") {
10216
- yPosition = point.y - 10;
10217
+ yPosition = value < 0 ? point.y + 10 : point.y - 10;
10217
10218
  }
10218
10219
  else {
10219
- yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
10220
+ const yZeroLine = yAxisScale.getPixelForValue(0);
10221
+ const distanceFromAxisOrigin = Math.abs(yZeroLine - point.y);
10222
+ const textHeight = 12; // ChartJS default text height
10223
+ if (distanceFromAxisOrigin < textHeight) {
10224
+ yPosition = value < 0 ? yZeroLine + textHeight / 2 : yZeroLine - textHeight / 2;
10225
+ }
10226
+ else {
10227
+ yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
10228
+ }
10220
10229
  }
10221
10230
  yPosition = Math.min(yPosition, yMax);
10222
10231
  yPosition = Math.max(yPosition, yMin);
@@ -10226,7 +10235,7 @@ stores.inject(MyMetaStore, storeInstance);
10226
10235
  }
10227
10236
  for (const otherPosition of textsPositions[xPosition] || []) {
10228
10237
  if (Math.abs(otherPosition - yPosition) < 13) {
10229
- yPosition = otherPosition - 13;
10238
+ yPosition = value < 0 ? otherPosition + 13 : otherPosition - 13;
10230
10239
  }
10231
10240
  }
10232
10241
  textsPositions[xPosition].push(yPosition);
@@ -10245,6 +10254,8 @@ stores.inject(MyMetaStore, storeInstance);
10245
10254
  if (isTrendLineAxis(dataset.xAxisID)) {
10246
10255
  return; // ignore trend lines
10247
10256
  }
10257
+ const xAxisScale = chart.scales[dataset.xAxisID];
10258
+ const xZeroLine = xAxisScale.getPixelForValue(0);
10248
10259
  for (let i = 0; i < dataset._parsed.length; i++) {
10249
10260
  const value = Number(dataset._parsed[i].x);
10250
10261
  if (isNaN(value)) {
@@ -10253,17 +10264,27 @@ stores.inject(MyMetaStore, storeInstance);
10253
10264
  const displayValue = options.callback(value, dataset, i);
10254
10265
  const point = dataset.data[i];
10255
10266
  const yPosition = point.y;
10256
- let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
10257
- xPosition = Math.min(xPosition, xMax);
10258
- xPosition = Math.max(xPosition, xMin);
10267
+ const textWidth = computeTextWidth(ctx, displayValue, { fontSize: 12 }, "px");
10268
+ const distanceFromAxisOrigin = Math.abs(point.x - xZeroLine);
10269
+ const PADDING = 3;
10270
+ let xPosition;
10271
+ if (distanceFromAxisOrigin < textWidth) {
10272
+ xPosition =
10273
+ value < 0 ? xZeroLine - textWidth / 2 - PADDING : xZeroLine + textWidth / 2 + PADDING;
10274
+ }
10275
+ else {
10276
+ xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
10277
+ xPosition = Math.min(xPosition, xMax);
10278
+ xPosition = Math.max(xPosition, xMin);
10279
+ }
10259
10280
  // Avoid overlapping texts with same Y
10260
10281
  if (!textsPositions[yPosition]) {
10261
10282
  textsPositions[yPosition] = [];
10262
10283
  }
10263
- const textWidth = computeTextWidth(ctx, displayValue, { fontSize: 12 }, "px");
10264
10284
  for (const otherPosition of textsPositions[yPosition]) {
10265
10285
  if (Math.abs(otherPosition - xPosition) < textWidth) {
10266
- xPosition = otherPosition + textWidth + 3;
10286
+ xPosition =
10287
+ value < 0 ? otherPosition - textWidth - PADDING : otherPosition + textWidth + PADDING;
10267
10288
  }
10268
10289
  }
10269
10290
  textsPositions[yPosition].push(xPosition);
@@ -30079,7 +30100,9 @@ stores.inject(MyMetaStore, storeInstance);
30079
30100
  background: definition.background,
30080
30101
  callback: (value, dataset) => {
30081
30102
  value = Math.abs(Number(value));
30082
- return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
30103
+ return value === 0
30104
+ ? ""
30105
+ : formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
30083
30106
  },
30084
30107
  };
30085
30108
  }
@@ -34579,6 +34602,10 @@ stores.inject(MyMetaStore, storeInstance);
34579
34602
  });
34580
34603
  };
34581
34604
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
34605
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
34606
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
34607
+ return false;
34608
+ }
34582
34609
  const sheetId = env.model.getters.getActiveSheetId();
34583
34610
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
34584
34611
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -37558,11 +37585,11 @@ stores.inject(MyMetaStore, storeInstance);
37558
37585
  * transformation function given
37559
37586
  */
37560
37587
  addTransformation(executed, toTransforms, fn) {
37561
- for (let toTransform of toTransforms) {
37562
- if (!this.content[toTransform]) {
37563
- this.content[toTransform] = new Map();
37564
- }
37565
- this.content[toTransform].set(executed, fn);
37588
+ if (!this.content[executed]) {
37589
+ this.content[executed] = new Map();
37590
+ }
37591
+ for (const toTransform of toTransforms) {
37592
+ this.content[executed].set(toTransform, fn);
37566
37593
  }
37567
37594
  return this;
37568
37595
  }
@@ -37571,7 +37598,7 @@ stores.inject(MyMetaStore, storeInstance);
37571
37598
  * that the executed command happened.
37572
37599
  */
37573
37600
  getTransformation(toTransform, executed) {
37574
- return this.content[toTransform] && this.content[toTransform].get(executed);
37601
+ return this.content[executed] && this.content[executed].get(toTransform);
37575
37602
  }
37576
37603
  }
37577
37604
  const otRegistry = new OTRegistry();
@@ -64266,10 +64293,20 @@ stores.inject(MyMetaStore, storeInstance);
64266
64293
  */
64267
64294
  function transformAll(toTransform, executed) {
64268
64295
  let transformedCommands = [...toTransform];
64296
+ const possibleTransformations = new Set(otRegistry.getKeys());
64269
64297
  for (const executedCommand of executed) {
64270
- transformedCommands = transformedCommands
64271
- .map((cmd) => transform(cmd, executedCommand))
64272
- .filter(isDefined);
64298
+ // If the executed command is not in the registry, we skip it
64299
+ // because we know there won't be any transformation impacting the
64300
+ // commands to transform.
64301
+ if (possibleTransformations.has(executedCommand.type)) {
64302
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
64303
+ const transformed = transform(cmd, executedCommand);
64304
+ if (transformed) {
64305
+ acc.push(transformed);
64306
+ }
64307
+ return acc;
64308
+ }, []);
64309
+ }
64273
64310
  }
64274
64311
  return transformedCommands;
64275
64312
  }
@@ -65964,7 +66001,7 @@ stores.inject(MyMetaStore, storeInstance);
65964
66001
  }
65965
66002
  const position = this.getters.getCellPosition(cell.id);
65966
66003
  const colSize = this.getters.getColSize(sheetId, position.col);
65967
- if (cell.isFormula) {
66004
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
65968
66005
  const content = this.getters.getEvaluatedCell(position).formattedValue;
65969
66006
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
65970
66007
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -76536,9 +76573,9 @@ stores.inject(MyMetaStore, storeInstance);
76536
76573
  exports.tokenize = tokenize;
76537
76574
 
76538
76575
 
76539
- __info__.version = "18.1.25";
76540
- __info__.date = "2025-06-12T09:49:08.707Z";
76541
- __info__.hash = "a232524";
76576
+ __info__.version = "18.1.26";
76577
+ __info__.date = "2025-06-19T18:21:37.648Z";
76578
+ __info__.hash = "06479d4";
76542
76579
 
76543
76580
 
76544
76581
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);