@odoo/o-spreadsheet 18.2.14 → 18.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/o-spreadsheet.cjs.js +105 -31
- package/dist/o-spreadsheet.d.ts +5 -2
- package/dist/o-spreadsheet.esm.js +105 -31
- package/dist/o-spreadsheet.iife.js +105 -31
- package/dist/o-spreadsheet.iife.min.js +382 -382
- package/dist/o_spreadsheet.xml +4 -4
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.2.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.16
|
|
6
|
+
* @date 2025-06-06T09:32:04.909Z
|
|
7
|
+
* @hash 7ee118c
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -8304,9 +8304,10 @@ const AGGREGATOR_NAMES = {
|
|
|
8304
8304
|
avg: _t("Average"),
|
|
8305
8305
|
sum: _t("Sum"),
|
|
8306
8306
|
};
|
|
8307
|
+
const NUMBER_CHAR_AGGREGATORS = ["max", "min", "avg", "sum", "count_distinct", "count"];
|
|
8307
8308
|
const AGGREGATORS_BY_FIELD_TYPE = {
|
|
8308
|
-
integer:
|
|
8309
|
-
char:
|
|
8309
|
+
integer: NUMBER_CHAR_AGGREGATORS,
|
|
8310
|
+
char: NUMBER_CHAR_AGGREGATORS,
|
|
8310
8311
|
boolean: ["count_distinct", "count", "bool_and", "bool_or"],
|
|
8311
8312
|
datetime: ["max", "min", "count_distinct", "count"],
|
|
8312
8313
|
};
|
|
@@ -10371,8 +10372,6 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
10371
10372
|
if (isNaN(value)) {
|
|
10372
10373
|
continue;
|
|
10373
10374
|
}
|
|
10374
|
-
const axisId = chart.config.type === "radar" ? dataset.rAxisID : dataset.yAxisID;
|
|
10375
|
-
const displayValue = options.callback(Number(value), axisId);
|
|
10376
10375
|
const point = dataset.data[i];
|
|
10377
10376
|
const xPosition = point.x;
|
|
10378
10377
|
let yPosition = 0;
|
|
@@ -10396,7 +10395,8 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
10396
10395
|
textsPositions[xPosition].push(yPosition);
|
|
10397
10396
|
ctx.fillStyle = point.options.backgroundColor;
|
|
10398
10397
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10399
|
-
|
|
10398
|
+
const valueToDisplay = options.callback(Number(value), dataset, i);
|
|
10399
|
+
drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
|
|
10400
10400
|
}
|
|
10401
10401
|
}
|
|
10402
10402
|
}
|
|
@@ -10413,7 +10413,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
|
10413
10413
|
if (isNaN(value)) {
|
|
10414
10414
|
continue;
|
|
10415
10415
|
}
|
|
10416
|
-
const displayValue = options.callback(value, dataset
|
|
10416
|
+
const displayValue = options.callback(value, dataset, i);
|
|
10417
10417
|
const point = dataset.data[i];
|
|
10418
10418
|
const yPosition = point.y;
|
|
10419
10419
|
let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
|
|
@@ -10451,7 +10451,7 @@ function drawPieChartValues(chart, options, ctx) {
|
|
|
10451
10451
|
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
10452
10452
|
ctx.fillStyle = chartFontColor(options.background);
|
|
10453
10453
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10454
|
-
const displayValue = options.callback(value,
|
|
10454
|
+
const displayValue = options.callback(value, dataset, i);
|
|
10455
10455
|
drawTextWithBackground(displayValue, x, y, ctx);
|
|
10456
10456
|
}
|
|
10457
10457
|
}
|
|
@@ -30084,9 +30084,51 @@ function getChartShowValues(definition, args) {
|
|
|
30084
30084
|
horizontal: "horizontal" in definition && definition.horizontal,
|
|
30085
30085
|
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30086
30086
|
background: definition.background,
|
|
30087
|
-
callback:
|
|
30087
|
+
callback: (value, dataset) => {
|
|
30088
|
+
const axisId = getDatasetAxisId(definition, dataset);
|
|
30089
|
+
return formatChartDatasetValue(axisFormats, locale)(value, axisId);
|
|
30090
|
+
},
|
|
30091
|
+
};
|
|
30092
|
+
}
|
|
30093
|
+
function getPyramidChartShowValues(definition, args) {
|
|
30094
|
+
const { axisFormats, locale } = args;
|
|
30095
|
+
return {
|
|
30096
|
+
horizontal: true,
|
|
30097
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30098
|
+
background: definition.background,
|
|
30099
|
+
callback: (value, dataset) => {
|
|
30100
|
+
value = Math.abs(Number(value));
|
|
30101
|
+
return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
|
|
30102
|
+
},
|
|
30103
|
+
};
|
|
30104
|
+
}
|
|
30105
|
+
function getWaterfallChartShowValues(definition, args) {
|
|
30106
|
+
const { axisFormats, locale, dataSetsValues } = args;
|
|
30107
|
+
const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
|
|
30108
|
+
subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
|
|
30109
|
+
return subtotalIndexes;
|
|
30110
|
+
}, []);
|
|
30111
|
+
return {
|
|
30112
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30113
|
+
background: definition.background,
|
|
30114
|
+
callback: (value, dataset, index) => {
|
|
30115
|
+
const raw = dataset._dataset.data[index];
|
|
30116
|
+
const delta = raw[1] - raw[0];
|
|
30117
|
+
let sign = delta >= 0 ? "+" : "";
|
|
30118
|
+
if (definition.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
|
|
30119
|
+
sign = "";
|
|
30120
|
+
}
|
|
30121
|
+
return `${sign}${formatChartDatasetValue(axisFormats, locale)(delta, dataset.yAxisID)}`;
|
|
30122
|
+
},
|
|
30088
30123
|
};
|
|
30089
30124
|
}
|
|
30125
|
+
function getDatasetAxisId(definition, dataset) {
|
|
30126
|
+
if (dataset.rAxisID) {
|
|
30127
|
+
return dataset.rAxisID;
|
|
30128
|
+
}
|
|
30129
|
+
const axisId = "horizontal" in definition && definition.horizontal ? dataset.xAxisID : dataset.yAxisID;
|
|
30130
|
+
return axisId || "y";
|
|
30131
|
+
}
|
|
30090
30132
|
|
|
30091
30133
|
function getChartTitle(definition) {
|
|
30092
30134
|
const chartTitle = definition.title;
|
|
@@ -30410,6 +30452,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
30410
30452
|
getPieChartTooltip: getPieChartTooltip,
|
|
30411
30453
|
getPyramidChartData: getPyramidChartData,
|
|
30412
30454
|
getPyramidChartScales: getPyramidChartScales,
|
|
30455
|
+
getPyramidChartShowValues: getPyramidChartShowValues,
|
|
30413
30456
|
getPyramidChartTooltip: getPyramidChartTooltip,
|
|
30414
30457
|
getRadarChartData: getRadarChartData,
|
|
30415
30458
|
getRadarChartDatasets: getRadarChartDatasets,
|
|
@@ -30423,6 +30466,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
30423
30466
|
getTrendDatasetForLineChart: getTrendDatasetForLineChart,
|
|
30424
30467
|
getWaterfallChartLegend: getWaterfallChartLegend,
|
|
30425
30468
|
getWaterfallChartScales: getWaterfallChartScales,
|
|
30469
|
+
getWaterfallChartShowValues: getWaterfallChartShowValues,
|
|
30426
30470
|
getWaterfallChartTooltip: getWaterfallChartTooltip,
|
|
30427
30471
|
getWaterfallDatasetAndLabels: getWaterfallDatasetAndLabels
|
|
30428
30472
|
});
|
|
@@ -31555,7 +31599,7 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
31555
31599
|
title: getChartTitle(definition),
|
|
31556
31600
|
legend: getBarChartLegend(definition),
|
|
31557
31601
|
tooltip: getPyramidChartTooltip(definition, chartData),
|
|
31558
|
-
chartShowValuesPlugin:
|
|
31602
|
+
chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
|
|
31559
31603
|
},
|
|
31560
31604
|
},
|
|
31561
31605
|
};
|
|
@@ -32018,7 +32062,7 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
32018
32062
|
title: getChartTitle(definition),
|
|
32019
32063
|
legend: getWaterfallChartLegend(definition),
|
|
32020
32064
|
tooltip: getWaterfallChartTooltip(definition, chartData),
|
|
32021
|
-
chartShowValuesPlugin:
|
|
32065
|
+
chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
|
|
32022
32066
|
waterfallLinesPlugin: { showConnectorLines: definition.showConnectorLines },
|
|
32023
32067
|
},
|
|
32024
32068
|
},
|
|
@@ -44664,13 +44708,15 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
44664
44708
|
if (this.selectedMatchIndex === null) {
|
|
44665
44709
|
return;
|
|
44666
44710
|
}
|
|
44711
|
+
this.preserveSelectedMatchIndex = true;
|
|
44712
|
+
this.shouldFinalizeUpdateSelection = true;
|
|
44667
44713
|
this.model.dispatch("REPLACE_SEARCH", {
|
|
44668
44714
|
searchString: this.toSearch,
|
|
44669
44715
|
replaceWith: this.toReplace,
|
|
44670
44716
|
matches: [this.searchMatches[this.selectedMatchIndex]],
|
|
44671
44717
|
searchOptions: this.searchOptions,
|
|
44672
44718
|
});
|
|
44673
|
-
this.
|
|
44719
|
+
this.preserveSelectedMatchIndex = false;
|
|
44674
44720
|
}
|
|
44675
44721
|
/**
|
|
44676
44722
|
* Apply the replace function to all the matches one time.
|
|
@@ -47096,12 +47142,7 @@ class SpreadsheetPivot {
|
|
|
47096
47142
|
entry[field.name] = { value: null, type: CellValueType.empty, formattedValue: "" };
|
|
47097
47143
|
}
|
|
47098
47144
|
else {
|
|
47099
|
-
|
|
47100
|
-
entry[field.name] = { ...cell, value: cell.formattedValue || null };
|
|
47101
|
-
}
|
|
47102
|
-
else {
|
|
47103
|
-
entry[field.name] = cell;
|
|
47104
|
-
}
|
|
47145
|
+
entry[field.name] = cell;
|
|
47105
47146
|
}
|
|
47106
47147
|
}
|
|
47107
47148
|
entry["__count"] = { value: 1, type: CellValueType.number, formattedValue: "1" };
|
|
@@ -52276,6 +52317,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
52276
52317
|
let deltaX = lastX - clientX;
|
|
52277
52318
|
let deltaY = lastY - clientY;
|
|
52278
52319
|
const elapsedTime = currentTime - lastTime;
|
|
52320
|
+
if (!elapsedTime) {
|
|
52321
|
+
return;
|
|
52322
|
+
}
|
|
52279
52323
|
velocityX = deltaX / elapsedTime;
|
|
52280
52324
|
velocityY = deltaY / elapsedTime;
|
|
52281
52325
|
lastX = clientX;
|
|
@@ -52296,6 +52340,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
52296
52340
|
function onTouchEnd(ev) {
|
|
52297
52341
|
isMouseDown = false;
|
|
52298
52342
|
lastX = lastY = 0;
|
|
52343
|
+
if (resetTimeout) {
|
|
52344
|
+
clearTimeout(resetTimeout);
|
|
52345
|
+
}
|
|
52346
|
+
velocityX *= 1.2;
|
|
52347
|
+
velocityY *= 1.2;
|
|
52299
52348
|
requestAnimationFrame(scroll);
|
|
52300
52349
|
}
|
|
52301
52350
|
function scroll() {
|
|
@@ -59436,7 +59485,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
59436
59485
|
break;
|
|
59437
59486
|
}
|
|
59438
59487
|
case "UPDATE_PIVOT": {
|
|
59439
|
-
this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
|
|
59488
|
+
this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
|
|
59440
59489
|
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
59441
59490
|
break;
|
|
59442
59491
|
}
|
|
@@ -59507,7 +59556,10 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
59507
59556
|
// Private
|
|
59508
59557
|
// -------------------------------------------------------------------------
|
|
59509
59558
|
addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
|
|
59510
|
-
this.history.update("pivots", pivotId, {
|
|
59559
|
+
this.history.update("pivots", pivotId, {
|
|
59560
|
+
definition: this.repairSortedColumn(deepCopy(pivot)),
|
|
59561
|
+
formulaId,
|
|
59562
|
+
});
|
|
59511
59563
|
this.compileCalculatedMeasures(pivot.measures);
|
|
59512
59564
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
59513
59565
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
@@ -59600,6 +59652,26 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
59600
59652
|
}
|
|
59601
59653
|
return "Success" /* CommandResult.Success */;
|
|
59602
59654
|
}
|
|
59655
|
+
repairSortedColumn(definition) {
|
|
59656
|
+
if (definition.sortedColumn) {
|
|
59657
|
+
// Fix for an upgrade issue: the sortedColumn measure was not updated
|
|
59658
|
+
// from using fieldName to using id. If the sortedColumn measure matches
|
|
59659
|
+
// a measure fieldName in the definition, update it to use the measure's id instead
|
|
59660
|
+
// of its fieldName.
|
|
59661
|
+
// TODO: add an upgrade step to fix this in master and remove this code
|
|
59662
|
+
const sortedMeasure = definition.measures.find((measure) => measure.fieldName === definition.sortedColumn?.measure);
|
|
59663
|
+
if (sortedMeasure) {
|
|
59664
|
+
return {
|
|
59665
|
+
...definition,
|
|
59666
|
+
sortedColumn: {
|
|
59667
|
+
...definition.sortedColumn,
|
|
59668
|
+
measure: sortedMeasure.id,
|
|
59669
|
+
},
|
|
59670
|
+
};
|
|
59671
|
+
}
|
|
59672
|
+
}
|
|
59673
|
+
return definition;
|
|
59674
|
+
}
|
|
59603
59675
|
// ---------------------------------------------------------------------
|
|
59604
59676
|
// Import/Export
|
|
59605
59677
|
// ---------------------------------------------------------------------
|
|
@@ -68511,11 +68583,6 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68511
68583
|
},
|
|
68512
68584
|
];
|
|
68513
68585
|
const sheetId = this.getActiveSheetId();
|
|
68514
|
-
const handler = new CellClipboardHandler(this.getters, this.dispatch);
|
|
68515
|
-
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
68516
|
-
if (!data) {
|
|
68517
|
-
return;
|
|
68518
|
-
}
|
|
68519
68586
|
const base = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
68520
68587
|
const pasteTarget = [
|
|
68521
68588
|
{
|
|
@@ -68525,7 +68592,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68525
68592
|
bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
68526
68593
|
},
|
|
68527
68594
|
];
|
|
68528
|
-
|
|
68595
|
+
for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
|
|
68596
|
+
const handler = new Handler(this.getters, this.dispatch);
|
|
68597
|
+
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
68598
|
+
if (!data) {
|
|
68599
|
+
continue;
|
|
68600
|
+
}
|
|
68601
|
+
handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
|
|
68602
|
+
}
|
|
68529
68603
|
const selection = pasteTarget[0];
|
|
68530
68604
|
const col = selection.left;
|
|
68531
68605
|
const row = selection.top;
|
|
@@ -76915,6 +76989,6 @@ exports.tokenColors = tokenColors;
|
|
|
76915
76989
|
exports.tokenize = tokenize;
|
|
76916
76990
|
|
|
76917
76991
|
|
|
76918
|
-
__info__.version = "18.2.
|
|
76919
|
-
__info__.date = "2025-
|
|
76920
|
-
__info__.hash = "
|
|
76992
|
+
__info__.version = "18.2.16";
|
|
76993
|
+
__info__.date = "2025-06-06T09:32:04.909Z";
|
|
76994
|
+
__info__.hash = "7ee118c";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as chart_js from 'chart.js';
|
|
2
|
-
import { ChartConfiguration, Point, Chart, Color as Color$1, ChartType as ChartType$1 } from 'chart.js';
|
|
2
|
+
import { ChartConfiguration, Point, Chart, Color as Color$1, ChartType as ChartType$1, ChartMeta } from 'chart.js';
|
|
3
3
|
import * as ChartGeo from 'chartjs-chart-geo';
|
|
4
4
|
import * as GeoJSON$1 from 'geojson';
|
|
5
5
|
import * as _odoo_owl from '@odoo/owl';
|
|
@@ -4834,6 +4834,7 @@ declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState
|
|
|
4834
4834
|
private compileMeasureFormula;
|
|
4835
4835
|
private replaceMeasureFormula;
|
|
4836
4836
|
private checkDuplicatedMeasureIds;
|
|
4837
|
+
private repairSortedColumn;
|
|
4837
4838
|
/**
|
|
4838
4839
|
* Import the pivots
|
|
4839
4840
|
*/
|
|
@@ -6286,7 +6287,7 @@ interface ChartShowValuesPluginOptions {
|
|
|
6286
6287
|
showValues: boolean;
|
|
6287
6288
|
background?: Color;
|
|
6288
6289
|
horizontal?: boolean;
|
|
6289
|
-
callback: (value: number | string,
|
|
6290
|
+
callback: (value: number | string, dataset: ChartMeta, index: number) => string;
|
|
6290
6291
|
}
|
|
6291
6292
|
declare module "chart.js" {
|
|
6292
6293
|
interface PluginOptionsByType<TType extends ChartType$1> {
|
|
@@ -13433,6 +13434,8 @@ declare const chartHelpers: {
|
|
|
13433
13434
|
[key: string]: chart_js.ScaleOptionsByType<"projection" | keyof chart_js.ColorScaleTypeRegistry>;
|
|
13434
13435
|
}>;
|
|
13435
13436
|
getChartShowValues(definition: ChartWithDataSetDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
|
|
13437
|
+
getPyramidChartShowValues(definition: ChartWithDataSetDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
|
|
13438
|
+
getWaterfallChartShowValues(definition: WaterfallChartDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
|
|
13436
13439
|
getChartTitle(definition: ChartWithDataSetDefinition): chart_js_dist_types_utils._DeepPartialObject<chart_js.TitleOptions>;
|
|
13437
13440
|
getBarChartTooltip(definition: GenericDefinition<BarChartDefinition>, args: ChartRuntimeGenerationArgs): chart_js_dist_types_utils._DeepPartialObject<chart_js.TooltipOptions<any>>;
|
|
13438
13441
|
getLineChartTooltip(definition: GenericDefinition<LineChartDefinition>, args: ChartRuntimeGenerationArgs): chart_js_dist_types_utils._DeepPartialObject<chart_js.TooltipOptions<any>>;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.2.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.16
|
|
6
|
+
* @date 2025-06-06T09:32:04.909Z
|
|
7
|
+
* @hash 7ee118c
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -8302,9 +8302,10 @@ const AGGREGATOR_NAMES = {
|
|
|
8302
8302
|
avg: _t("Average"),
|
|
8303
8303
|
sum: _t("Sum"),
|
|
8304
8304
|
};
|
|
8305
|
+
const NUMBER_CHAR_AGGREGATORS = ["max", "min", "avg", "sum", "count_distinct", "count"];
|
|
8305
8306
|
const AGGREGATORS_BY_FIELD_TYPE = {
|
|
8306
|
-
integer:
|
|
8307
|
-
char:
|
|
8307
|
+
integer: NUMBER_CHAR_AGGREGATORS,
|
|
8308
|
+
char: NUMBER_CHAR_AGGREGATORS,
|
|
8308
8309
|
boolean: ["count_distinct", "count", "bool_and", "bool_or"],
|
|
8309
8310
|
datetime: ["max", "min", "count_distinct", "count"],
|
|
8310
8311
|
};
|
|
@@ -10369,8 +10370,6 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
10369
10370
|
if (isNaN(value)) {
|
|
10370
10371
|
continue;
|
|
10371
10372
|
}
|
|
10372
|
-
const axisId = chart.config.type === "radar" ? dataset.rAxisID : dataset.yAxisID;
|
|
10373
|
-
const displayValue = options.callback(Number(value), axisId);
|
|
10374
10373
|
const point = dataset.data[i];
|
|
10375
10374
|
const xPosition = point.x;
|
|
10376
10375
|
let yPosition = 0;
|
|
@@ -10394,7 +10393,8 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
10394
10393
|
textsPositions[xPosition].push(yPosition);
|
|
10395
10394
|
ctx.fillStyle = point.options.backgroundColor;
|
|
10396
10395
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10397
|
-
|
|
10396
|
+
const valueToDisplay = options.callback(Number(value), dataset, i);
|
|
10397
|
+
drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
|
|
10398
10398
|
}
|
|
10399
10399
|
}
|
|
10400
10400
|
}
|
|
@@ -10411,7 +10411,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
|
10411
10411
|
if (isNaN(value)) {
|
|
10412
10412
|
continue;
|
|
10413
10413
|
}
|
|
10414
|
-
const displayValue = options.callback(value, dataset
|
|
10414
|
+
const displayValue = options.callback(value, dataset, i);
|
|
10415
10415
|
const point = dataset.data[i];
|
|
10416
10416
|
const yPosition = point.y;
|
|
10417
10417
|
let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
|
|
@@ -10449,7 +10449,7 @@ function drawPieChartValues(chart, options, ctx) {
|
|
|
10449
10449
|
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
10450
10450
|
ctx.fillStyle = chartFontColor(options.background);
|
|
10451
10451
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10452
|
-
const displayValue = options.callback(value,
|
|
10452
|
+
const displayValue = options.callback(value, dataset, i);
|
|
10453
10453
|
drawTextWithBackground(displayValue, x, y, ctx);
|
|
10454
10454
|
}
|
|
10455
10455
|
}
|
|
@@ -30082,9 +30082,51 @@ function getChartShowValues(definition, args) {
|
|
|
30082
30082
|
horizontal: "horizontal" in definition && definition.horizontal,
|
|
30083
30083
|
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30084
30084
|
background: definition.background,
|
|
30085
|
-
callback:
|
|
30085
|
+
callback: (value, dataset) => {
|
|
30086
|
+
const axisId = getDatasetAxisId(definition, dataset);
|
|
30087
|
+
return formatChartDatasetValue(axisFormats, locale)(value, axisId);
|
|
30088
|
+
},
|
|
30089
|
+
};
|
|
30090
|
+
}
|
|
30091
|
+
function getPyramidChartShowValues(definition, args) {
|
|
30092
|
+
const { axisFormats, locale } = args;
|
|
30093
|
+
return {
|
|
30094
|
+
horizontal: true,
|
|
30095
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30096
|
+
background: definition.background,
|
|
30097
|
+
callback: (value, dataset) => {
|
|
30098
|
+
value = Math.abs(Number(value));
|
|
30099
|
+
return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
|
|
30100
|
+
},
|
|
30101
|
+
};
|
|
30102
|
+
}
|
|
30103
|
+
function getWaterfallChartShowValues(definition, args) {
|
|
30104
|
+
const { axisFormats, locale, dataSetsValues } = args;
|
|
30105
|
+
const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
|
|
30106
|
+
subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
|
|
30107
|
+
return subtotalIndexes;
|
|
30108
|
+
}, []);
|
|
30109
|
+
return {
|
|
30110
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30111
|
+
background: definition.background,
|
|
30112
|
+
callback: (value, dataset, index) => {
|
|
30113
|
+
const raw = dataset._dataset.data[index];
|
|
30114
|
+
const delta = raw[1] - raw[0];
|
|
30115
|
+
let sign = delta >= 0 ? "+" : "";
|
|
30116
|
+
if (definition.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
|
|
30117
|
+
sign = "";
|
|
30118
|
+
}
|
|
30119
|
+
return `${sign}${formatChartDatasetValue(axisFormats, locale)(delta, dataset.yAxisID)}`;
|
|
30120
|
+
},
|
|
30086
30121
|
};
|
|
30087
30122
|
}
|
|
30123
|
+
function getDatasetAxisId(definition, dataset) {
|
|
30124
|
+
if (dataset.rAxisID) {
|
|
30125
|
+
return dataset.rAxisID;
|
|
30126
|
+
}
|
|
30127
|
+
const axisId = "horizontal" in definition && definition.horizontal ? dataset.xAxisID : dataset.yAxisID;
|
|
30128
|
+
return axisId || "y";
|
|
30129
|
+
}
|
|
30088
30130
|
|
|
30089
30131
|
function getChartTitle(definition) {
|
|
30090
30132
|
const chartTitle = definition.title;
|
|
@@ -30408,6 +30450,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
30408
30450
|
getPieChartTooltip: getPieChartTooltip,
|
|
30409
30451
|
getPyramidChartData: getPyramidChartData,
|
|
30410
30452
|
getPyramidChartScales: getPyramidChartScales,
|
|
30453
|
+
getPyramidChartShowValues: getPyramidChartShowValues,
|
|
30411
30454
|
getPyramidChartTooltip: getPyramidChartTooltip,
|
|
30412
30455
|
getRadarChartData: getRadarChartData,
|
|
30413
30456
|
getRadarChartDatasets: getRadarChartDatasets,
|
|
@@ -30421,6 +30464,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
30421
30464
|
getTrendDatasetForLineChart: getTrendDatasetForLineChart,
|
|
30422
30465
|
getWaterfallChartLegend: getWaterfallChartLegend,
|
|
30423
30466
|
getWaterfallChartScales: getWaterfallChartScales,
|
|
30467
|
+
getWaterfallChartShowValues: getWaterfallChartShowValues,
|
|
30424
30468
|
getWaterfallChartTooltip: getWaterfallChartTooltip,
|
|
30425
30469
|
getWaterfallDatasetAndLabels: getWaterfallDatasetAndLabels
|
|
30426
30470
|
});
|
|
@@ -31553,7 +31597,7 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
31553
31597
|
title: getChartTitle(definition),
|
|
31554
31598
|
legend: getBarChartLegend(definition),
|
|
31555
31599
|
tooltip: getPyramidChartTooltip(definition, chartData),
|
|
31556
|
-
chartShowValuesPlugin:
|
|
31600
|
+
chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
|
|
31557
31601
|
},
|
|
31558
31602
|
},
|
|
31559
31603
|
};
|
|
@@ -32016,7 +32060,7 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
32016
32060
|
title: getChartTitle(definition),
|
|
32017
32061
|
legend: getWaterfallChartLegend(definition),
|
|
32018
32062
|
tooltip: getWaterfallChartTooltip(definition, chartData),
|
|
32019
|
-
chartShowValuesPlugin:
|
|
32063
|
+
chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
|
|
32020
32064
|
waterfallLinesPlugin: { showConnectorLines: definition.showConnectorLines },
|
|
32021
32065
|
},
|
|
32022
32066
|
},
|
|
@@ -44662,13 +44706,15 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
44662
44706
|
if (this.selectedMatchIndex === null) {
|
|
44663
44707
|
return;
|
|
44664
44708
|
}
|
|
44709
|
+
this.preserveSelectedMatchIndex = true;
|
|
44710
|
+
this.shouldFinalizeUpdateSelection = true;
|
|
44665
44711
|
this.model.dispatch("REPLACE_SEARCH", {
|
|
44666
44712
|
searchString: this.toSearch,
|
|
44667
44713
|
replaceWith: this.toReplace,
|
|
44668
44714
|
matches: [this.searchMatches[this.selectedMatchIndex]],
|
|
44669
44715
|
searchOptions: this.searchOptions,
|
|
44670
44716
|
});
|
|
44671
|
-
this.
|
|
44717
|
+
this.preserveSelectedMatchIndex = false;
|
|
44672
44718
|
}
|
|
44673
44719
|
/**
|
|
44674
44720
|
* Apply the replace function to all the matches one time.
|
|
@@ -47094,12 +47140,7 @@ class SpreadsheetPivot {
|
|
|
47094
47140
|
entry[field.name] = { value: null, type: CellValueType.empty, formattedValue: "" };
|
|
47095
47141
|
}
|
|
47096
47142
|
else {
|
|
47097
|
-
|
|
47098
|
-
entry[field.name] = { ...cell, value: cell.formattedValue || null };
|
|
47099
|
-
}
|
|
47100
|
-
else {
|
|
47101
|
-
entry[field.name] = cell;
|
|
47102
|
-
}
|
|
47143
|
+
entry[field.name] = cell;
|
|
47103
47144
|
}
|
|
47104
47145
|
}
|
|
47105
47146
|
entry["__count"] = { value: 1, type: CellValueType.number, formattedValue: "1" };
|
|
@@ -52274,6 +52315,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
52274
52315
|
let deltaX = lastX - clientX;
|
|
52275
52316
|
let deltaY = lastY - clientY;
|
|
52276
52317
|
const elapsedTime = currentTime - lastTime;
|
|
52318
|
+
if (!elapsedTime) {
|
|
52319
|
+
return;
|
|
52320
|
+
}
|
|
52277
52321
|
velocityX = deltaX / elapsedTime;
|
|
52278
52322
|
velocityY = deltaY / elapsedTime;
|
|
52279
52323
|
lastX = clientX;
|
|
@@ -52294,6 +52338,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
52294
52338
|
function onTouchEnd(ev) {
|
|
52295
52339
|
isMouseDown = false;
|
|
52296
52340
|
lastX = lastY = 0;
|
|
52341
|
+
if (resetTimeout) {
|
|
52342
|
+
clearTimeout(resetTimeout);
|
|
52343
|
+
}
|
|
52344
|
+
velocityX *= 1.2;
|
|
52345
|
+
velocityY *= 1.2;
|
|
52297
52346
|
requestAnimationFrame(scroll);
|
|
52298
52347
|
}
|
|
52299
52348
|
function scroll() {
|
|
@@ -59434,7 +59483,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
59434
59483
|
break;
|
|
59435
59484
|
}
|
|
59436
59485
|
case "UPDATE_PIVOT": {
|
|
59437
|
-
this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
|
|
59486
|
+
this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
|
|
59438
59487
|
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
59439
59488
|
break;
|
|
59440
59489
|
}
|
|
@@ -59505,7 +59554,10 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
59505
59554
|
// Private
|
|
59506
59555
|
// -------------------------------------------------------------------------
|
|
59507
59556
|
addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
|
|
59508
|
-
this.history.update("pivots", pivotId, {
|
|
59557
|
+
this.history.update("pivots", pivotId, {
|
|
59558
|
+
definition: this.repairSortedColumn(deepCopy(pivot)),
|
|
59559
|
+
formulaId,
|
|
59560
|
+
});
|
|
59509
59561
|
this.compileCalculatedMeasures(pivot.measures);
|
|
59510
59562
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
59511
59563
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
@@ -59598,6 +59650,26 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
59598
59650
|
}
|
|
59599
59651
|
return "Success" /* CommandResult.Success */;
|
|
59600
59652
|
}
|
|
59653
|
+
repairSortedColumn(definition) {
|
|
59654
|
+
if (definition.sortedColumn) {
|
|
59655
|
+
// Fix for an upgrade issue: the sortedColumn measure was not updated
|
|
59656
|
+
// from using fieldName to using id. If the sortedColumn measure matches
|
|
59657
|
+
// a measure fieldName in the definition, update it to use the measure's id instead
|
|
59658
|
+
// of its fieldName.
|
|
59659
|
+
// TODO: add an upgrade step to fix this in master and remove this code
|
|
59660
|
+
const sortedMeasure = definition.measures.find((measure) => measure.fieldName === definition.sortedColumn?.measure);
|
|
59661
|
+
if (sortedMeasure) {
|
|
59662
|
+
return {
|
|
59663
|
+
...definition,
|
|
59664
|
+
sortedColumn: {
|
|
59665
|
+
...definition.sortedColumn,
|
|
59666
|
+
measure: sortedMeasure.id,
|
|
59667
|
+
},
|
|
59668
|
+
};
|
|
59669
|
+
}
|
|
59670
|
+
}
|
|
59671
|
+
return definition;
|
|
59672
|
+
}
|
|
59601
59673
|
// ---------------------------------------------------------------------
|
|
59602
59674
|
// Import/Export
|
|
59603
59675
|
// ---------------------------------------------------------------------
|
|
@@ -68509,11 +68581,6 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68509
68581
|
},
|
|
68510
68582
|
];
|
|
68511
68583
|
const sheetId = this.getActiveSheetId();
|
|
68512
|
-
const handler = new CellClipboardHandler(this.getters, this.dispatch);
|
|
68513
|
-
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
68514
|
-
if (!data) {
|
|
68515
|
-
return;
|
|
68516
|
-
}
|
|
68517
68584
|
const base = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
68518
68585
|
const pasteTarget = [
|
|
68519
68586
|
{
|
|
@@ -68523,7 +68590,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68523
68590
|
bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
68524
68591
|
},
|
|
68525
68592
|
];
|
|
68526
|
-
|
|
68593
|
+
for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
|
|
68594
|
+
const handler = new Handler(this.getters, this.dispatch);
|
|
68595
|
+
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
68596
|
+
if (!data) {
|
|
68597
|
+
continue;
|
|
68598
|
+
}
|
|
68599
|
+
handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
|
|
68600
|
+
}
|
|
68527
68601
|
const selection = pasteTarget[0];
|
|
68528
68602
|
const col = selection.left;
|
|
68529
68603
|
const row = selection.top;
|
|
@@ -76868,6 +76942,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
76868
76942
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
76869
76943
|
|
|
76870
76944
|
|
|
76871
|
-
__info__.version = "18.2.
|
|
76872
|
-
__info__.date = "2025-
|
|
76873
|
-
__info__.hash = "
|
|
76945
|
+
__info__.version = "18.2.16";
|
|
76946
|
+
__info__.date = "2025-06-06T09:32:04.909Z";
|
|
76947
|
+
__info__.hash = "7ee118c";
|