@odoo/o-spreadsheet 19.5.0-alpha.2 → 19.5.0-alpha.3

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 19.5.0-alpha.2
6
- * @date 2026-07-13T06:26:20.354Z
7
- * @hash a4d2f90
5
+ * @version 19.5.0-alpha.3
6
+ * @date 2026-07-14T10:17:06.949Z
7
+ * @hash c029184
8
8
  */
9
9
 
10
10
  import * as owl from "@odoo/owl";
@@ -1247,6 +1247,12 @@ function defaultDict(def) {
1247
1247
  }
1248
1248
  };
1249
1249
  }
1250
+ function repeat(array, times) {
1251
+ const len = array.length;
1252
+ const result = new Array(len * times);
1253
+ for (let t = 0; t < times; t++) for (let i = 0; i < len; i++) result[t * len + i] = array[i];
1254
+ return result;
1255
+ }
1250
1256
 
1251
1257
  //#endregion
1252
1258
  //#region src/helpers/coordinates.ts
@@ -10132,6 +10138,7 @@ function getChartBackgroundColor({ background }, getters) {
10132
10138
  //#endregion
10133
10139
  //#region src/components/figures/chart/chartJs/chartjs_show_values_plugin.ts
10134
10140
  const MINIMAL_VERTICAL_DISTANCE = 13;
10141
+ const HORIZONTAL_PADDING = 3;
10135
10142
  function isLineOverlayOnBarChart(options, dataset) {
10136
10143
  return options.type === "bar" && dataset.type === "line";
10137
10144
  }
@@ -10141,175 +10148,276 @@ const chartShowValuesPlugin = {
10141
10148
  afterDatasetsDraw(chart, args, options) {
10142
10149
  if (!options.showValues) return;
10143
10150
  if (!chart._metasets?.[0]?.data) return;
10144
- const ctx = chart.ctx;
10145
- ctx.save();
10146
- ctx.textAlign = "center";
10147
- ctx.textBaseline = "middle";
10148
- ctx.miterLimit = 1;
10149
10151
  switch (options.type) {
10150
10152
  case "pie":
10151
- drawPieChartValues(chart, options, ctx);
10153
+ drawPieValues(chart, options);
10152
10154
  break;
10153
10155
  case "line":
10154
10156
  case "scatter":
10157
+ drawLineValues(chart, options);
10158
+ break;
10155
10159
  case "combo":
10156
10160
  case "waterfall":
10161
+ drawComboValues(chart, options);
10162
+ break;
10157
10163
  case "radar":
10158
- drawLineOrBarOrRadarChartValues(chart, options, ctx);
10164
+ drawRadarValues(chart, options);
10159
10165
  break;
10160
10166
  case "bar":
10161
- options.horizontal ? drawHorizontalBarChartValues(chart, options, ctx) : drawLineOrBarOrRadarChartValues(chart, options, ctx);
10167
+ options.horizontal ? drawHorizontalBarValues(chart, options) : drawVerticalBarValues(chart, options);
10162
10168
  break;
10163
10169
  case "pyramid":
10164
- drawHorizontalBarChartValues(chart, options, ctx);
10170
+ drawHorizontalBarValues(chart, options);
10165
10171
  break;
10166
10172
  case "calendar":
10167
- drawBarChartValues(chart, options, ctx);
10173
+ drawCalendarValues(chart, options);
10168
10174
  break;
10169
10175
  case "bubble":
10170
- drawBubbleChartValues(chart, options, ctx);
10176
+ drawBubbleValues(chart, options);
10171
10177
  break;
10172
10178
  case "funnel":
10173
- drawHorizontalBarChartValues(chart, options, ctx);
10179
+ drawFunnelValues(chart, options);
10174
10180
  break;
10175
10181
  }
10176
- ctx.restore();
10177
10182
  }
10178
10183
  };
10179
- function drawTextWithBackground(text, x, y, ctx) {
10180
- ctx.lineWidth = 3;
10181
- ctx.strokeText(text, x, y);
10182
- ctx.lineWidth = 1;
10183
- ctx.fillText(text, x, y);
10184
- }
10185
- function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
10184
+ function drawValues(args) {
10185
+ const { chart, options, getNumberValue, direction } = args;
10186
+ const ctx = chart.ctx;
10187
+ ctx.save();
10188
+ ctx.textAlign = "center";
10189
+ ctx.textBaseline = "middle";
10190
+ ctx.miterLimit = 1;
10186
10191
  const textsPositions = {};
10187
10192
  for (const dataset of chart._metasets) {
10188
- if (isTrendLineAxis(dataset.xAxisID) || dataset.hidden || isLineOverlayOnBarChart(options, dataset)) continue;
10189
- const yAxisScale = chart.scales[dataset.yAxisID];
10193
+ if (isTrendLineAxis(dataset.xAxisID) || dataset.hidden) continue;
10190
10194
  for (let i = 0; i < dataset._parsed.length; i++) {
10191
- const parsedValue = dataset._parsed[i];
10192
- const value = Number(chart.config.type === "radar" ? parsedValue.r : parsedValue.y);
10193
- if (isNaN(value)) continue;
10194
- const point = dataset.data[i];
10195
- const xPosition = point.x;
10196
- let yPosition = 0;
10197
- if (chart.config.type === "line" || chart.config.type === "radar") yPosition = value < 0 ? point.y + 10 : point.y - 10;
10198
- else if (chart.config.type === "bubble") yPosition = point.y;
10199
- else {
10200
- const yZeroLine = yAxisScale.getPixelForValue(0);
10201
- const distanceFromAxisOrigin = Math.abs(yZeroLine - point.y);
10202
- const textHeight = globalThis.Chart?.defaults.font.size ?? 12;
10203
- if (distanceFromAxisOrigin < textHeight) yPosition = value < 0 ? yZeroLine + textHeight / 2 : yZeroLine - textHeight / 2;
10204
- else yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
10205
- }
10206
- if (!textsPositions[xPosition]) textsPositions[xPosition] = [];
10207
- for (const otherPosition of textsPositions[xPosition] || []) if (Math.abs(otherPosition - yPosition) < MINIMAL_VERTICAL_DISTANCE) yPosition = otherPosition + MINIMAL_VERTICAL_DISTANCE * (value < 0 ? 1 : -1);
10208
- textsPositions[xPosition].push(yPosition);
10209
- ctx.fillStyle = point.options.backgroundColor;
10210
- ctx.strokeStyle = options.background(Number(value), dataset, i) || "#ffffff";
10211
- drawTextWithBackground(options.callback(Number(value), dataset, i), xPosition, yPosition, ctx);
10195
+ const numberValue = getNumberValue(dataset, i);
10196
+ if (numberValue === void 0 || isNaN(numberValue)) continue;
10197
+ const chartElement = dataset.data[i];
10198
+ const elementColor = chartElement.options.backgroundColor;
10199
+ if (!elementColor || colorToRGBA(elementColor).a !== 1) continue;
10200
+ const valueToDisplay = options.callback(numberValue, dataset, i);
10201
+ const textSize = getTextDimensions(valueToDisplay, ctx);
10202
+ const callbackArgs = {
10203
+ dataset,
10204
+ chartElement,
10205
+ numberValue,
10206
+ valueIndex: i,
10207
+ textSize,
10208
+ options,
10209
+ chart
10210
+ };
10211
+ const position = args.getValuePosition(callbackArgs);
10212
+ if (args.shouldSkipValue?.(callbackArgs)) continue;
10213
+ if (direction === "vertical") {
10214
+ const key = Math.round(position.x);
10215
+ if (!textsPositions[key]) textsPositions[key] = [];
10216
+ for (const otherPosition of textsPositions[key] || []) if (Math.abs(otherPosition - position.y) < MINIMAL_VERTICAL_DISTANCE) position.y = otherPosition + MINIMAL_VERTICAL_DISTANCE * (numberValue < 0 ? 1 : -1);
10217
+ textsPositions[key].push(position.y);
10218
+ } else {
10219
+ const key = Math.round(position.y);
10220
+ if (!textsPositions[key]) textsPositions[key] = [];
10221
+ for (const otherPosition of textsPositions[key]) if (Math.abs(otherPosition - position.x) < textSize.width) position.x = numberValue < 0 ? otherPosition - textSize.width - HORIZONTAL_PADDING : otherPosition + textSize.width + HORIZONTAL_PADDING;
10222
+ textsPositions[key].push(position.x);
10223
+ }
10224
+ const { strokeColor, textColor } = args.getTextColors(callbackArgs);
10225
+ if (!!strokeColor) {
10226
+ ctx.strokeStyle = strokeColor;
10227
+ ctx.lineWidth = 3;
10228
+ ctx.strokeText(valueToDisplay, position.x, position.y);
10229
+ }
10230
+ ctx.fillStyle = textColor;
10231
+ ctx.lineWidth = 1;
10232
+ ctx.fillText(valueToDisplay, position.x, position.y);
10212
10233
  }
10213
10234
  }
10235
+ ctx.restore();
10214
10236
  }
10215
- function drawBarChartValues(chart, options, ctx) {
10216
- const yMax = chart.chartArea.bottom;
10217
- const yMin = chart.chartArea.top;
10218
- for (const dataset of chart._metasets) {
10219
- if (isTrendLineAxis(dataset.xAxisID) || dataset.hidden) continue;
10220
- const yAxisScale = chart.scales[dataset.yAxisID];
10221
- for (let i = 0; i < dataset._parsed.length; i++) {
10222
- const parsedValue = dataset._parsed[i];
10223
- const value = Number(chart.config.type === "radar" ? parsedValue.r : parsedValue.y);
10224
- if (isNaN(value)) continue;
10225
- const point = dataset.data[i];
10226
- const xPosition = point.x;
10227
- let yPosition = 0;
10228
- const yZeroLine = yAxisScale.getPixelForValue(0);
10229
- const distanceFromAxisOrigin = Math.abs(yZeroLine - point.y);
10230
- const textHeight = globalThis.Chart?.defaults.font.size ?? 12;
10231
- if (distanceFromAxisOrigin < textHeight) yPosition = value < 0 ? yZeroLine + textHeight / 2 : yZeroLine - textHeight / 2;
10232
- else yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
10233
- yPosition = Math.min(yPosition, yMax);
10234
- yPosition = Math.max(yPosition, yMin);
10235
- ctx.strokeStyle = point.options.backgroundColor;
10236
- ctx.fillStyle = options.background(Number(value), dataset, i) || "#ffffff";
10237
- const valueToDisplay = options.callback(Number(value), dataset, i);
10238
- const measures = ctx.measureText(valueToDisplay);
10239
- if (measures.actualBoundingBoxAscent + measures.actualBoundingBoxDescent + 2 > Math.abs(point.height) - 2) continue;
10240
- drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
10241
- }
10242
- }
10243
- }
10244
- function drawBubbleChartValues(chart, options, ctx) {
10245
- const yMax = chart.chartArea.bottom;
10246
- const yMin = chart.chartArea.top;
10247
- const textsPositions = {};
10248
- for (const dataset of chart._metasets) for (let i = 0; i < dataset._parsed.length; i++) {
10249
- const value = dataset._parsed[i].y;
10250
- if (isNaN(value)) continue;
10251
- const point = dataset.data[i];
10252
- const xPosition = point.x;
10253
- let yPosition = Math.max(Math.min(point.y, yMax), yMin);
10254
- if (!textsPositions[xPosition]) textsPositions[xPosition] = [];
10255
- for (const otherPosition of textsPositions[xPosition] || []) if (Math.abs(otherPosition - yPosition) < MINIMAL_VERTICAL_DISTANCE) yPosition = otherPosition + MINIMAL_VERTICAL_DISTANCE * (value < 0 ? 1 : -1);
10256
- textsPositions[xPosition].push(yPosition);
10257
- const color = point.options.backgroundColor ?? "#ffffff";
10258
- if (hexToHSLA(toHex(color)).a === 1) ctx.fillStyle = chartFontColor(color);
10259
- else ctx.fillStyle = "#000000";
10260
- const valueToDisplay = options.callback(Number(value), dataset, i);
10261
- ctx.fillText(valueToDisplay, xPosition, yPosition);
10262
- }
10263
- }
10264
- function drawHorizontalBarChartValues(chart, options, ctx) {
10265
- const textsPositions = {};
10266
- for (const dataset of chart._metasets) {
10267
- if (isTrendLineAxis(dataset.xAxisID) || isLineOverlayOnBarChart(options, dataset)) continue;
10268
- const xZeroLine = chart.scales[dataset.xAxisID].getPixelForValue(0);
10269
- for (let i = 0; i < dataset._parsed.length; i++) {
10270
- const value = Number(dataset._parsed[i].x);
10271
- if (isNaN(value)) continue;
10272
- const displayValue = options.callback(value, dataset, i);
10273
- const point = dataset.data[i];
10274
- const yPosition = point.y;
10275
- const textWidth = computeTextWidth(ctx, displayValue, { fontSize: globalThis.Chart?.defaults.font.size ?? 12 }, "px");
10276
- const distanceFromAxisOrigin = Math.abs(point.x - xZeroLine);
10277
- const PADDING = 3;
10237
+ function drawVerticalBarValues(chart, options) {
10238
+ drawValues({
10239
+ chart,
10240
+ options,
10241
+ direction: "vertical",
10242
+ getNumberValue: (dataset, i) => Number(dataset._parsed[i].y),
10243
+ getValuePosition: getVerticalBarValuePosition,
10244
+ shouldSkipValue: ({ dataset }) => isLineOverlayOnBarChart(options, dataset),
10245
+ getTextColors: chartBackgroundColoredTextWithElementColoredHalo
10246
+ });
10247
+ }
10248
+ function drawRadarValues(chart, options) {
10249
+ drawValues({
10250
+ chart,
10251
+ options,
10252
+ direction: "vertical",
10253
+ getNumberValue: (dataset, i) => Number(dataset._parsed[i].r),
10254
+ getValuePosition: ({ chartElement }) => ({
10255
+ x: chartElement.x,
10256
+ y: chartElement.y - 10
10257
+ }),
10258
+ shouldSkipValue: () => false,
10259
+ getTextColors: chartElementColoredTextWithChartBackgroundHalo
10260
+ });
10261
+ }
10262
+ function drawLineValues(chart, options) {
10263
+ drawValues({
10264
+ chart,
10265
+ options,
10266
+ direction: "vertical",
10267
+ getNumberValue: (dataset, i) => Number(dataset._parsed[i].y),
10268
+ getValuePosition: ({ chartElement }) => ({
10269
+ x: chartElement.x,
10270
+ y: chartElement.y - 10
10271
+ }),
10272
+ shouldSkipValue: () => false,
10273
+ getTextColors: chartElementColoredTextWithChartBackgroundHalo
10274
+ });
10275
+ }
10276
+ function drawComboValues(chart, options) {
10277
+ drawValues({
10278
+ chart,
10279
+ options,
10280
+ direction: "vertical",
10281
+ getNumberValue: (dataset, i) => Number(dataset._parsed[i].y),
10282
+ getValuePosition: (args) => args.dataset.type === "line" ? {
10283
+ x: args.chartElement.x,
10284
+ y: args.chartElement.y - 10
10285
+ } : getVerticalBarValuePosition(args),
10286
+ shouldSkipValue: () => false,
10287
+ getTextColors: (args) => args.dataset.type === "line" ? chartElementColoredTextWithChartBackgroundHalo(args) : chartBackgroundColoredTextWithElementColoredHalo(args)
10288
+ });
10289
+ }
10290
+ function drawCalendarValues(chart, options) {
10291
+ drawValues({
10292
+ chart,
10293
+ options,
10294
+ direction: "vertical",
10295
+ getNumberValue: (dataset, i) => dataset._parsed[i].y,
10296
+ getValuePosition: ({ chartElement }) => ({
10297
+ x: chartElement.x,
10298
+ y: chartElement.y + chartElement.height / 2
10299
+ }),
10300
+ shouldSkipValue: ({ chartElement, textSize }) => textSize.height + 2 > Math.abs(chartElement.height) - 2,
10301
+ getTextColors: ({ chartElement }) => ({
10302
+ strokeColor: void 0,
10303
+ textColor: chartFontColor(chartElement.options.backgroundColor)
10304
+ })
10305
+ });
10306
+ }
10307
+ function drawBubbleValues(chart, options) {
10308
+ const canDrawTextInsideBubble = (chartElement, textSize) => {
10309
+ const radius = chartElement.options.radius ?? globalThis.Chart?.defaults.elements.point.radius ?? 3;
10310
+ return textSize.height < radius * 2;
10311
+ };
10312
+ drawValues({
10313
+ chart,
10314
+ options,
10315
+ direction: "vertical",
10316
+ getNumberValue: (dataset, i) => dataset._parsed[i].y,
10317
+ getValuePosition: ({ chartElement, textSize }) => ({
10318
+ x: chartElement.x,
10319
+ y: canDrawTextInsideBubble(chartElement, textSize) ? chartElement.y : chartElement.y - 10
10320
+ }),
10321
+ shouldSkipValue: () => false,
10322
+ getTextColors: (args) => {
10323
+ return canDrawTextInsideBubble(args.chartElement, args.textSize) ? chartBackgroundColoredTextWithElementColoredHalo(args) : chartElementColoredTextWithChartBackgroundHalo(args);
10324
+ }
10325
+ });
10326
+ }
10327
+ function drawHorizontalBarValues(chart, options) {
10328
+ drawValues({
10329
+ chart,
10330
+ options,
10331
+ direction: "horizontal",
10332
+ getNumberValue: (dataset, i) => dataset._parsed[i].x,
10333
+ getValuePosition: ({ chartElement, numberValue, textSize, dataset }) => {
10334
+ const xZeroLine = chart.scales[dataset.xAxisID].getPixelForValue(0);
10335
+ const distanceFromAxisOrigin = Math.abs(chartElement.x - xZeroLine);
10278
10336
  let xPosition;
10279
- if (distanceFromAxisOrigin < textWidth) xPosition = value < 0 ? xZeroLine - textWidth / 2 - PADDING : xZeroLine + textWidth / 2 + PADDING;
10280
- else xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
10281
- if (!textsPositions[yPosition]) textsPositions[yPosition] = [];
10282
- for (const otherPosition of textsPositions[yPosition]) if (Math.abs(otherPosition - xPosition) < textWidth) xPosition = value < 0 ? otherPosition - textWidth - PADDING : otherPosition + textWidth + PADDING;
10283
- textsPositions[yPosition].push(xPosition);
10284
- ctx.strokeStyle = point.options.backgroundColor;
10285
- ctx.fillStyle = options.background(Number(value), dataset, i) || "#ffffff";
10286
- drawTextWithBackground(displayValue, xPosition, yPosition, ctx);
10287
- }
10288
- }
10289
- }
10290
- function drawPieChartValues(chart, options, ctx) {
10291
- for (const dataset of chart._metasets) for (let i = 0; i < dataset._parsed.length; i++) {
10292
- const value = Number(dataset._parsed[i]);
10293
- if (isNaN(value) || value === 0) continue;
10294
- const bar = dataset.data[i];
10295
- const { startAngle, endAngle, innerRadius, outerRadius } = bar;
10296
- const midAngle = (startAngle + endAngle) / 2;
10297
- const midRadius = (innerRadius + outerRadius) / 2;
10298
- const x = bar.x + midRadius * Math.cos(midAngle);
10299
- const y = bar.y + midRadius * Math.sin(midAngle);
10300
- const displayValue = options.callback(value, dataset, i);
10301
- const textHeight = globalThis.Chart?.defaults.font.size ?? 12;
10302
- const textWidth = computeTextWidth(ctx, displayValue, { fontSize: textHeight }, "px");
10303
- const radius = outerRadius - innerRadius;
10304
- if (textWidth >= radius || radius < textHeight) continue;
10305
- const sliceAngle = endAngle - startAngle;
10306
- const midWidth = 2 * midRadius * Math.tan(sliceAngle / 2);
10307
- if (sliceAngle < Math.PI / 2 && (textWidth >= midWidth || midWidth < textHeight)) continue;
10308
- const background = options.background(Number(value), dataset, i);
10309
- ctx.fillStyle = chartFontColor(background);
10310
- ctx.strokeStyle = background || "#ffffff";
10311
- drawTextWithBackground(displayValue, x, y, ctx);
10312
- }
10337
+ const sign = numberValue < 0 ? -1 : 1;
10338
+ if (distanceFromAxisOrigin < textSize.width) xPosition = xZeroLine + sign * (textSize.width / 2 + HORIZONTAL_PADDING);
10339
+ else xPosition = chartElement.x - sign * (chartElement.width / 2);
10340
+ return {
10341
+ x: xPosition,
10342
+ y: chartElement.y
10343
+ };
10344
+ },
10345
+ shouldSkipValue: ({ dataset }) => isLineOverlayOnBarChart(options, dataset),
10346
+ getTextColors: chartBackgroundColoredTextWithElementColoredHalo
10347
+ });
10348
+ }
10349
+ function drawFunnelValues(chart, options) {
10350
+ drawValues({
10351
+ chart,
10352
+ options,
10353
+ direction: "horizontal",
10354
+ getNumberValue: (dataset, i) => dataset._parsed[i].x,
10355
+ getValuePosition: ({ chartElement }) => ({
10356
+ x: chartElement.x - chartElement.width / 2,
10357
+ y: chartElement.y
10358
+ }),
10359
+ shouldSkipValue: () => false,
10360
+ getTextColors: chartBackgroundColoredTextWithElementColoredHalo
10361
+ });
10362
+ }
10363
+ function drawPieValues(chart, options) {
10364
+ const getSliceDimensions = (chartElement) => {
10365
+ const { startAngle, endAngle, innerRadius, outerRadius } = chartElement;
10366
+ return {
10367
+ midAngle: (startAngle + endAngle) / 2,
10368
+ midRadius: (innerRadius + outerRadius) / 2
10369
+ };
10370
+ };
10371
+ drawValues({
10372
+ chart,
10373
+ options,
10374
+ direction: "vertical",
10375
+ getNumberValue: (dataset, i) => Number(dataset._parsed[i]),
10376
+ getValuePosition: ({ chartElement }) => {
10377
+ const { midAngle, midRadius } = getSliceDimensions(chartElement);
10378
+ return {
10379
+ x: chartElement.x + midRadius * Math.cos(midAngle),
10380
+ y: chartElement.y + midRadius * Math.sin(midAngle)
10381
+ };
10382
+ },
10383
+ shouldSkipValue: ({ chartElement, textSize }) => {
10384
+ const { midRadius } = getSliceDimensions(chartElement);
10385
+ const sliceAngle = chartElement.endAngle - chartElement.startAngle;
10386
+ const midWidth = 2 * midRadius * Math.tan(sliceAngle / 2);
10387
+ return sliceAngle < Math.PI / 2 && (textSize.width >= midWidth || midWidth < textSize.height);
10388
+ },
10389
+ getTextColors: chartBackgroundColoredTextWithElementColoredHalo
10390
+ });
10391
+ }
10392
+ function getTextDimensions(text, ctx) {
10393
+ return computeCachedTextDimension(ctx, text, computeTextFont({ fontSize: globalThis.Chart?.defaults.font.size ?? 12 }, "px"));
10394
+ }
10395
+ function chartBackgroundColoredTextWithElementColoredHalo(args) {
10396
+ const { dataset, numberValue, valueIndex, chartElement, options } = args;
10397
+ return {
10398
+ strokeColor: chartElement.options.backgroundColor,
10399
+ textColor: options.background(numberValue, dataset, valueIndex) || "#ffffff"
10400
+ };
10401
+ }
10402
+ function chartElementColoredTextWithChartBackgroundHalo(args) {
10403
+ const { dataset, numberValue, valueIndex, chartElement, options } = args;
10404
+ return {
10405
+ strokeColor: options.background(numberValue, dataset, valueIndex) || "#ffffff",
10406
+ textColor: chartElement.options.backgroundColor
10407
+ };
10408
+ }
10409
+ function getVerticalBarValuePosition(args) {
10410
+ const { chartElement, numberValue, dataset, textSize, chart } = args;
10411
+ const yZeroLine = chart.scales[dataset.yAxisID].getPixelForValue(0);
10412
+ const distanceFromAxisOrigin = Math.abs(yZeroLine - chartElement.y);
10413
+ const sign = numberValue < 0 ? -1 : 1;
10414
+ let yPosition = 0;
10415
+ if (distanceFromAxisOrigin < textSize.height) yPosition = yZeroLine - sign * (textSize.height / 2);
10416
+ else yPosition = chartElement.y + sign * (chartElement.height / 2);
10417
+ return {
10418
+ x: chartElement.x,
10419
+ y: yPosition
10420
+ };
10313
10421
  }
10314
10422
 
10315
10423
  //#endregion
@@ -11166,6 +11274,7 @@ function getRadarChartDatasets(definition, args) {
11166
11274
  hidden,
11167
11275
  borderColor,
11168
11276
  backgroundColor: borderColor,
11277
+ pointBackgroundColor: borderColor,
11169
11278
  pointRadius: definition.hideDataMarkers ? 0 : 3
11170
11279
  };
11171
11280
  if (fill) {
@@ -28633,23 +28742,11 @@ function getChartShowValues(definition, args) {
28633
28742
  }
28634
28743
  function getCalendarChartShowValues(definition, args) {
28635
28744
  const { locale, axisFormats } = args;
28636
- let background = (_value, dataset, index) => definition.background;
28637
- const values = args.dataSetsValues.flat().flatMap((dsv) => dsv?.data.filter(isNumberResult)).map((cell) => cell.value);
28638
- if (values.length) {
28639
- const min = Math.min(...values);
28640
- const max = Math.max(...values);
28641
- const colorScale = getRuntimeColorScale(definition.colorScale ?? schemeToColorScale("oranges"), min, max);
28642
- background = (_value, dataset, index) => {
28643
- const value = dataset._dataset.values[index];
28644
- if (value === void 0) return definition.background;
28645
- return chartFontColor(colorScale(value));
28646
- };
28647
- }
28648
28745
  return {
28649
28746
  type: "calendar",
28650
28747
  horizontal: false,
28651
28748
  showValues: "showValues" in definition ? !!definition.showValues : false,
28652
- background,
28749
+ background: () => definition.background,
28653
28750
  callback: (_value, dataset, index) => {
28654
28751
  const value = dataset._dataset.values[index];
28655
28752
  return value === void 0 ? "" : humanizeNumber({
@@ -53080,11 +53177,16 @@ var DefaultPlugin = class extends CorePlugin {
53080
53177
  const deltaStyle = {};
53081
53178
  let hasDelta = false;
53082
53179
  const styleSheet = this.style[position.sheetId];
53083
- if (!styleSheet) continue;
53084
53180
  for (const key in newDefaultStyle) {
53085
53181
  if (key in cellStyle) continue;
53086
- const defaults = styleSheet[key];
53087
- if (!defaults) continue;
53182
+ const defaults = styleSheet?.[key];
53183
+ if (!defaults) {
53184
+ if (newDefaultStyle[key] !== DEFAULT_STYLE[key]) {
53185
+ deltaStyle[key] = DEFAULT_STYLE[key];
53186
+ hasDelta = true;
53187
+ }
53188
+ continue;
53189
+ }
53088
53190
  const rowDefault = defaults.rowDefault?.[position.row];
53089
53191
  if (rowDefault !== void 0) {
53090
53192
  if (priorities.shouldUseDefaultRow) {
@@ -53126,7 +53228,8 @@ var DefaultPlugin = class extends CorePlugin {
53126
53228
  for (const key in styleSheet) if (!(key in style)) {
53127
53229
  const defaults = styleSheet[key];
53128
53230
  if (!defaults) continue;
53129
- style[key] = defaults.rowDefault?.[position.row] ?? defaults.colDefault?.[position.col] ?? defaults.sheetDefault;
53231
+ const styleValue = defaults.rowDefault?.[position.row] ?? defaults.colDefault?.[position.col] ?? defaults.sheetDefault;
53232
+ if (styleValue !== void 0) style[key] = styleValue;
53130
53233
  }
53131
53234
  return style;
53132
53235
  }
@@ -77061,8 +77164,8 @@ var DefaultClipboardHandler = class extends AbstractCellClipboardHandler {
77061
77164
  for (const key in DEFAULT_STYLE) {
77062
77165
  content.style[key] = {
77063
77166
  sheetDefault: this.getters.getDefaultStyle(data.sheetId, key, "SHEET", void 0) ?? DEFAULT_STYLE[key],
77064
- colDefault: {},
77065
- rowDefault: {}
77167
+ colDefault: [],
77168
+ rowDefault: []
77066
77169
  };
77067
77170
  let colIndex = 0;
77068
77171
  for (const col of data.columnsIndexes) {
@@ -77079,20 +77182,41 @@ var DefaultClipboardHandler = class extends AbstractCellClipboardHandler {
77079
77182
  }
77080
77183
  return content;
77081
77184
  }
77082
- clearStyleFormat(sheetId, zone) {
77083
- this.dispatch("SET_FORMATTING", {
77084
- sheetId,
77085
- target: [zone],
77086
- format: ""
77087
- });
77185
+ adaptContentToZone(zone, content) {
77186
+ const colRepetition = Math.max(Math.floor((zone.right - zone.left + 1) / content.width), 1);
77187
+ const rowRepetition = Math.max(Math.floor((zone.bottom - zone.top + 1) / content.height), 1);
77188
+ if (colRepetition === 1 && rowRepetition === 1) return content;
77189
+ const newContent = deepCopy(content);
77190
+ newContent.height *= rowRepetition;
77191
+ newContent.width *= colRepetition;
77192
+ if (rowRepetition > 1 && newContent.format.rowDefault) {
77193
+ newContent.format.rowDefault.length = content.height;
77194
+ newContent.format.rowDefault = repeat(newContent.format.rowDefault, rowRepetition);
77195
+ }
77196
+ if (colRepetition > 1 && newContent.format.colDefault) {
77197
+ newContent.format.colDefault.length = content.width;
77198
+ newContent.format.colDefault = repeat(newContent.format.colDefault, colRepetition);
77199
+ }
77200
+ for (const key in content.style) {
77201
+ if (rowRepetition > 1 && newContent.style[key].rowDefault) {
77202
+ newContent.style[key].rowDefault.length = content.height;
77203
+ newContent.style[key].rowDefault = repeat(newContent.style[key].rowDefault, rowRepetition);
77204
+ }
77205
+ if (colRepetition > 1 && newContent.style[key].colDefault) {
77206
+ newContent.style[key].colDefault.length = content.width;
77207
+ newContent.style[key].colDefault = repeat(newContent.style[key].colDefault, colRepetition);
77208
+ }
77209
+ }
77210
+ return newContent;
77088
77211
  }
77089
77212
  paste(target, content, options) {
77090
77213
  const sheetId = target.sheetId;
77091
77214
  if (options.pasteOption === "asValue") return;
77092
77215
  const zones = target.zones;
77093
- if (!options.isCutOperation) for (const zone of zones) for (const pasteZone of splitZoneForPaste(zone, content.width, content.height)) {
77094
- this.pasteStyle(sheetId, pasteZone.left, pasteZone.top, content.width, content.height, content.style);
77095
- this.pasteFormat(sheetId, pasteZone.left, pasteZone.top, content.width, content.height, content.format);
77216
+ if (!options.isCutOperation) for (const zone of zones) {
77217
+ const newContent = this.adaptContentToZone(zone, content);
77218
+ this.pasteStyle(sheetId, zone.left, zone.top, newContent.width, newContent.height, newContent.style);
77219
+ this.pasteFormat(sheetId, zone.left, zone.top, newContent.width, newContent.height, newContent.format);
77096
77220
  }
77097
77221
  else {
77098
77222
  this.clearClippedZones(content);
@@ -77205,7 +77329,7 @@ var DefaultClipboardHandler = class extends AbstractCellClipboardHandler {
77205
77329
  const commands = [];
77206
77330
  for (const [zoneStr, [zone, priority]] of Object.entries(zones)) {
77207
77331
  const format = updateCells[zoneStr];
77208
- commands.push([
77332
+ if (format !== void 0) commands.push([
77209
77333
  priority,
77210
77334
  zone,
77211
77335
  format
@@ -87540,6 +87664,6 @@ const chartHelpers = {
87540
87664
  //#endregion
87541
87665
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, BadExpressionError, CHART_TYPES, CellErrorType, CellValueType, CircularDependencyError, ClientDisconnectedError, ClipboardMIMEType, CommandResult, CompiledFormula, CorePlugin, CoreViewPlugin, DEFAULT_LOCALE, DEFAULT_LOCALES, DEFAULT_LOCALE_DIGIT_GROUPING, DIRECTION, DispatchResult, DivisionByZeroError, EvaluationError, InvalidReferenceError, LocalTransportService, Model, NEXT_VALUE, NotAvailableError, NumberTooLargeError, OrderedLayers, PREVIOUS_VALUE, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, SplillBlockedError, Spreadsheet, SpreadsheetPivotTable, UIPlugin, UnknownFunctionError, __info__, addFunction, addRenderingLayer, astToFormula, availableConditionalFormatOperators, availableDataValidationOperators, availableFiltersOperators, borderPositions, borderStyles, canExecuteInReadonly, categories, chartHelpers, compatibility, components, composerFocusTypes, constants, convertAstNodes, coreTypes, createAutocompleteArgumentsProvider, errorTypes, filterDateCriterionOperators, filterNumberCriterionOperators, filterTextCriterionOperators, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidSubtotalFormulasCommands, invalidateBordersCommands, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, isCoreCommand, isHeadersDependant, isMatrix, isPositionDependent, isRangeDependant, isSheetDependent, isTargetDependent, isZoneDependent, iterateAstNodes, links, load, lockedSheetAllowedCommands, parse, parseTokens, readonlyAllowedCommands, registries, schemeToColorScale, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
87542
87666
 
87543
- __info__.version = "19.5.0-alpha.2";
87544
- __info__.date = "2026-07-13T06:26:20.354Z";
87545
- __info__.hash = "a4d2f90";
87667
+ __info__.version = "19.5.0-alpha.3";
87668
+ __info__.date = "2026-07-14T10:17:06.949Z";
87669
+ __info__.hash = "c029184";