@odoo/o-spreadsheet 18.1.22 → 18.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +377 -377
- 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.1.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.1.24
|
|
6
|
+
* @date 2025-06-06T09:31:57.011Z
|
|
7
|
+
* @hash 0e386b2
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -8295,9 +8295,10 @@ const AGGREGATOR_NAMES = {
|
|
|
8295
8295
|
avg: _t("Average"),
|
|
8296
8296
|
sum: _t("Sum"),
|
|
8297
8297
|
};
|
|
8298
|
+
const NUMBER_CHAR_AGGREGATORS = ["max", "min", "avg", "sum", "count_distinct", "count"];
|
|
8298
8299
|
const AGGREGATORS_BY_FIELD_TYPE = {
|
|
8299
|
-
integer:
|
|
8300
|
-
char:
|
|
8300
|
+
integer: NUMBER_CHAR_AGGREGATORS,
|
|
8301
|
+
char: NUMBER_CHAR_AGGREGATORS,
|
|
8301
8302
|
boolean: ["count_distinct", "count", "bool_and", "bool_or"],
|
|
8302
8303
|
};
|
|
8303
8304
|
const AGGREGATORS = {};
|
|
@@ -10207,8 +10208,6 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
10207
10208
|
if (isNaN(value)) {
|
|
10208
10209
|
continue;
|
|
10209
10210
|
}
|
|
10210
|
-
const axisId = chart.config.type === "radar" ? dataset.rAxisID : dataset.yAxisID;
|
|
10211
|
-
const displayValue = options.callback(Number(value), axisId);
|
|
10212
10211
|
const point = dataset.data[i];
|
|
10213
10212
|
const xPosition = point.x;
|
|
10214
10213
|
let yPosition = 0;
|
|
@@ -10232,7 +10231,8 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
10232
10231
|
textsPositions[xPosition].push(yPosition);
|
|
10233
10232
|
ctx.fillStyle = point.options.backgroundColor;
|
|
10234
10233
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10235
|
-
|
|
10234
|
+
const valueToDisplay = options.callback(Number(value), dataset, i);
|
|
10235
|
+
drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
|
|
10236
10236
|
}
|
|
10237
10237
|
}
|
|
10238
10238
|
}
|
|
@@ -10249,7 +10249,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
|
10249
10249
|
if (isNaN(value)) {
|
|
10250
10250
|
continue;
|
|
10251
10251
|
}
|
|
10252
|
-
const displayValue = options.callback(value, dataset
|
|
10252
|
+
const displayValue = options.callback(value, dataset, i);
|
|
10253
10253
|
const point = dataset.data[i];
|
|
10254
10254
|
const yPosition = point.y;
|
|
10255
10255
|
let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
|
|
@@ -10287,7 +10287,7 @@ function drawPieChartValues(chart, options, ctx) {
|
|
|
10287
10287
|
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
10288
10288
|
ctx.fillStyle = chartFontColor(options.background);
|
|
10289
10289
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10290
|
-
const displayValue = options.callback(value,
|
|
10290
|
+
const displayValue = options.callback(value, dataset, i);
|
|
10291
10291
|
drawTextWithBackground(displayValue, x, y, ctx);
|
|
10292
10292
|
}
|
|
10293
10293
|
}
|
|
@@ -30052,9 +30052,51 @@ function getChartShowValues(definition, args) {
|
|
|
30052
30052
|
horizontal: "horizontal" in definition && definition.horizontal,
|
|
30053
30053
|
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30054
30054
|
background: definition.background,
|
|
30055
|
-
callback:
|
|
30055
|
+
callback: (value, dataset) => {
|
|
30056
|
+
const axisId = getDatasetAxisId(definition, dataset);
|
|
30057
|
+
return formatChartDatasetValue(axisFormats, locale)(value, axisId);
|
|
30058
|
+
},
|
|
30059
|
+
};
|
|
30060
|
+
}
|
|
30061
|
+
function getPyramidChartShowValues(definition, args) {
|
|
30062
|
+
const { axisFormats, locale } = args;
|
|
30063
|
+
return {
|
|
30064
|
+
horizontal: true,
|
|
30065
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30066
|
+
background: definition.background,
|
|
30067
|
+
callback: (value, dataset) => {
|
|
30068
|
+
value = Math.abs(Number(value));
|
|
30069
|
+
return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
|
|
30070
|
+
},
|
|
30071
|
+
};
|
|
30072
|
+
}
|
|
30073
|
+
function getWaterfallChartShowValues(definition, args) {
|
|
30074
|
+
const { axisFormats, locale, dataSetsValues } = args;
|
|
30075
|
+
const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
|
|
30076
|
+
subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
|
|
30077
|
+
return subtotalIndexes;
|
|
30078
|
+
}, []);
|
|
30079
|
+
return {
|
|
30080
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30081
|
+
background: definition.background,
|
|
30082
|
+
callback: (value, dataset, index) => {
|
|
30083
|
+
const raw = dataset._dataset.data[index];
|
|
30084
|
+
const delta = raw[1] - raw[0];
|
|
30085
|
+
let sign = delta >= 0 ? "+" : "";
|
|
30086
|
+
if (definition.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
|
|
30087
|
+
sign = "";
|
|
30088
|
+
}
|
|
30089
|
+
return `${sign}${formatChartDatasetValue(axisFormats, locale)(delta, dataset.yAxisID)}`;
|
|
30090
|
+
},
|
|
30056
30091
|
};
|
|
30057
30092
|
}
|
|
30093
|
+
function getDatasetAxisId(definition, dataset) {
|
|
30094
|
+
if (dataset.rAxisID) {
|
|
30095
|
+
return dataset.rAxisID;
|
|
30096
|
+
}
|
|
30097
|
+
const axisId = "horizontal" in definition && definition.horizontal ? dataset.xAxisID : dataset.yAxisID;
|
|
30098
|
+
return axisId || "y";
|
|
30099
|
+
}
|
|
30058
30100
|
|
|
30059
30101
|
function getChartTitle(definition) {
|
|
30060
30102
|
const chartTitle = definition.title;
|
|
@@ -30263,6 +30305,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
30263
30305
|
getPieChartTooltip: getPieChartTooltip,
|
|
30264
30306
|
getPyramidChartData: getPyramidChartData,
|
|
30265
30307
|
getPyramidChartScales: getPyramidChartScales,
|
|
30308
|
+
getPyramidChartShowValues: getPyramidChartShowValues,
|
|
30266
30309
|
getPyramidChartTooltip: getPyramidChartTooltip,
|
|
30267
30310
|
getRadarChartData: getRadarChartData,
|
|
30268
30311
|
getRadarChartDatasets: getRadarChartDatasets,
|
|
@@ -30276,6 +30319,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
30276
30319
|
getTrendDatasetForLineChart: getTrendDatasetForLineChart,
|
|
30277
30320
|
getWaterfallChartLegend: getWaterfallChartLegend,
|
|
30278
30321
|
getWaterfallChartScales: getWaterfallChartScales,
|
|
30322
|
+
getWaterfallChartShowValues: getWaterfallChartShowValues,
|
|
30279
30323
|
getWaterfallChartTooltip: getWaterfallChartTooltip,
|
|
30280
30324
|
getWaterfallDatasetAndLabels: getWaterfallDatasetAndLabels
|
|
30281
30325
|
});
|
|
@@ -31374,7 +31418,7 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
31374
31418
|
title: getChartTitle(definition),
|
|
31375
31419
|
legend: getBarChartLegend(definition),
|
|
31376
31420
|
tooltip: getPyramidChartTooltip(definition, chartData),
|
|
31377
|
-
chartShowValuesPlugin:
|
|
31421
|
+
chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
|
|
31378
31422
|
},
|
|
31379
31423
|
},
|
|
31380
31424
|
};
|
|
@@ -31837,7 +31881,7 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
31837
31881
|
title: getChartTitle(definition),
|
|
31838
31882
|
legend: getWaterfallChartLegend(definition),
|
|
31839
31883
|
tooltip: getWaterfallChartTooltip(definition, chartData),
|
|
31840
|
-
chartShowValuesPlugin:
|
|
31884
|
+
chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
|
|
31841
31885
|
waterfallLinesPlugin: { showConnectorLines: definition.showConnectorLines },
|
|
31842
31886
|
},
|
|
31843
31887
|
},
|
|
@@ -44320,13 +44364,15 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
44320
44364
|
if (this.selectedMatchIndex === null) {
|
|
44321
44365
|
return;
|
|
44322
44366
|
}
|
|
44367
|
+
this.preserveSelectedMatchIndex = true;
|
|
44368
|
+
this.shouldFinalizeUpdateSelection = true;
|
|
44323
44369
|
this.model.dispatch("REPLACE_SEARCH", {
|
|
44324
44370
|
searchString: this.toSearch,
|
|
44325
44371
|
replaceWith: this.toReplace,
|
|
44326
44372
|
matches: [this.searchMatches[this.selectedMatchIndex]],
|
|
44327
44373
|
searchOptions: this.searchOptions,
|
|
44328
44374
|
});
|
|
44329
|
-
this.
|
|
44375
|
+
this.preserveSelectedMatchIndex = false;
|
|
44330
44376
|
}
|
|
44331
44377
|
/**
|
|
44332
44378
|
* Apply the replace function to all the matches one time.
|
|
@@ -46756,12 +46802,7 @@ class SpreadsheetPivot {
|
|
|
46756
46802
|
entry[field.name] = { value: null, type: CellValueType.empty, formattedValue: "" };
|
|
46757
46803
|
}
|
|
46758
46804
|
else {
|
|
46759
|
-
|
|
46760
|
-
entry[field.name] = { ...cell, value: cell.formattedValue || null };
|
|
46761
|
-
}
|
|
46762
|
-
else {
|
|
46763
|
-
entry[field.name] = cell;
|
|
46764
|
-
}
|
|
46805
|
+
entry[field.name] = cell;
|
|
46765
46806
|
}
|
|
46766
46807
|
}
|
|
46767
46808
|
entry["__count"] = { value: 1, type: CellValueType.number, formattedValue: "1" };
|
|
@@ -51827,6 +51868,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
51827
51868
|
let deltaX = lastX - clientX;
|
|
51828
51869
|
let deltaY = lastY - clientY;
|
|
51829
51870
|
const elapsedTime = currentTime - lastTime;
|
|
51871
|
+
if (!elapsedTime) {
|
|
51872
|
+
return;
|
|
51873
|
+
}
|
|
51830
51874
|
velocityX = deltaX / elapsedTime;
|
|
51831
51875
|
velocityY = deltaY / elapsedTime;
|
|
51832
51876
|
lastX = clientX;
|
|
@@ -51847,6 +51891,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
51847
51891
|
function onTouchEnd(ev) {
|
|
51848
51892
|
isMouseDown = false;
|
|
51849
51893
|
lastX = lastY = 0;
|
|
51894
|
+
if (resetTimeout) {
|
|
51895
|
+
clearTimeout(resetTimeout);
|
|
51896
|
+
}
|
|
51897
|
+
velocityX *= 1.2;
|
|
51898
|
+
velocityY *= 1.2;
|
|
51850
51899
|
requestAnimationFrame(scroll);
|
|
51851
51900
|
}
|
|
51852
51901
|
function scroll() {
|
|
@@ -58948,7 +58997,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
58948
58997
|
break;
|
|
58949
58998
|
}
|
|
58950
58999
|
case "UPDATE_PIVOT": {
|
|
58951
|
-
this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
|
|
59000
|
+
this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
|
|
58952
59001
|
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
58953
59002
|
break;
|
|
58954
59003
|
}
|
|
@@ -59019,7 +59068,10 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
59019
59068
|
// Private
|
|
59020
59069
|
// -------------------------------------------------------------------------
|
|
59021
59070
|
addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
|
|
59022
|
-
this.history.update("pivots", pivotId, {
|
|
59071
|
+
this.history.update("pivots", pivotId, {
|
|
59072
|
+
definition: this.repairSortedColumn(deepCopy(pivot)),
|
|
59073
|
+
formulaId,
|
|
59074
|
+
});
|
|
59023
59075
|
this.compileCalculatedMeasures(pivot.measures);
|
|
59024
59076
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
59025
59077
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
@@ -59112,6 +59164,26 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
59112
59164
|
}
|
|
59113
59165
|
return "Success" /* CommandResult.Success */;
|
|
59114
59166
|
}
|
|
59167
|
+
repairSortedColumn(definition) {
|
|
59168
|
+
if (definition.sortedColumn) {
|
|
59169
|
+
// Fix for an upgrade issue: the sortedColumn measure was not updated
|
|
59170
|
+
// from using fieldName to using id. If the sortedColumn measure matches
|
|
59171
|
+
// a measure fieldName in the definition, update it to use the measure's id instead
|
|
59172
|
+
// of its fieldName.
|
|
59173
|
+
// TODO: add an upgrade step to fix this in master and remove this code
|
|
59174
|
+
const sortedMeasure = definition.measures.find((measure) => measure.fieldName === definition.sortedColumn?.measure);
|
|
59175
|
+
if (sortedMeasure) {
|
|
59176
|
+
return {
|
|
59177
|
+
...definition,
|
|
59178
|
+
sortedColumn: {
|
|
59179
|
+
...definition.sortedColumn,
|
|
59180
|
+
measure: sortedMeasure.id,
|
|
59181
|
+
},
|
|
59182
|
+
};
|
|
59183
|
+
}
|
|
59184
|
+
}
|
|
59185
|
+
return definition;
|
|
59186
|
+
}
|
|
59115
59187
|
// ---------------------------------------------------------------------
|
|
59116
59188
|
// Import/Export
|
|
59117
59189
|
// ---------------------------------------------------------------------
|
|
@@ -68020,11 +68092,6 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68020
68092
|
},
|
|
68021
68093
|
];
|
|
68022
68094
|
const sheetId = this.getActiveSheetId();
|
|
68023
|
-
const handler = new CellClipboardHandler(this.getters, this.dispatch);
|
|
68024
|
-
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
68025
|
-
if (!data) {
|
|
68026
|
-
return;
|
|
68027
|
-
}
|
|
68028
68095
|
const base = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
68029
68096
|
const pasteTarget = [
|
|
68030
68097
|
{
|
|
@@ -68034,7 +68101,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68034
68101
|
bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
68035
68102
|
},
|
|
68036
68103
|
];
|
|
68037
|
-
|
|
68104
|
+
for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
|
|
68105
|
+
const handler = new Handler(this.getters, this.dispatch);
|
|
68106
|
+
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
68107
|
+
if (!data) {
|
|
68108
|
+
continue;
|
|
68109
|
+
}
|
|
68110
|
+
handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
|
|
68111
|
+
}
|
|
68038
68112
|
const selection = pasteTarget[0];
|
|
68039
68113
|
const col = selection.left;
|
|
68040
68114
|
const row = selection.top;
|
|
@@ -76437,6 +76511,6 @@ exports.tokenColors = tokenColors;
|
|
|
76437
76511
|
exports.tokenize = tokenize;
|
|
76438
76512
|
|
|
76439
76513
|
|
|
76440
|
-
__info__.version = "18.1.
|
|
76441
|
-
__info__.date = "2025-
|
|
76442
|
-
__info__.hash = "
|
|
76514
|
+
__info__.version = "18.1.24";
|
|
76515
|
+
__info__.date = "2025-06-06T09:31:57.011Z";
|
|
76516
|
+
__info__.hash = "0e386b2";
|
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';
|
|
@@ -4822,6 +4822,7 @@ declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState
|
|
|
4822
4822
|
private compileMeasureFormula;
|
|
4823
4823
|
private replaceMeasureFormula;
|
|
4824
4824
|
private checkDuplicatedMeasureIds;
|
|
4825
|
+
private repairSortedColumn;
|
|
4825
4826
|
/**
|
|
4826
4827
|
* Import the pivots
|
|
4827
4828
|
*/
|
|
@@ -6262,7 +6263,7 @@ interface ChartShowValuesPluginOptions {
|
|
|
6262
6263
|
showValues: boolean;
|
|
6263
6264
|
background?: Color;
|
|
6264
6265
|
horizontal?: boolean;
|
|
6265
|
-
callback: (value: number | string,
|
|
6266
|
+
callback: (value: number | string, dataset: ChartMeta, index: number) => string;
|
|
6266
6267
|
}
|
|
6267
6268
|
declare module "chart.js" {
|
|
6268
6269
|
interface PluginOptionsByType<TType extends ChartType$1> {
|
|
@@ -13276,6 +13277,8 @@ declare const chartHelpers: {
|
|
|
13276
13277
|
[key: string]: chart_js.ScaleOptionsByType<"projection" | keyof chart_js.ColorScaleTypeRegistry>;
|
|
13277
13278
|
}>;
|
|
13278
13279
|
getChartShowValues(definition: ChartWithDataSetDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
|
|
13280
|
+
getPyramidChartShowValues(definition: ChartWithDataSetDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
|
|
13281
|
+
getWaterfallChartShowValues(definition: WaterfallChartDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
|
|
13279
13282
|
getChartTitle(definition: ChartWithDataSetDefinition): chart_js_dist_types_utils._DeepPartialObject<chart_js.TitleOptions>;
|
|
13280
13283
|
getBarChartTooltip(definition: GenericDefinition<BarChartDefinition>, args: ChartRuntimeGenerationArgs): chart_js_dist_types_utils._DeepPartialObject<chart_js.TooltipOptions<any>>;
|
|
13281
13284
|
getLineChartTooltip(definition: GenericDefinition<LineChartDefinition>, args: ChartRuntimeGenerationArgs): chart_js_dist_types_utils._DeepPartialObject<chart_js.TooltipOptions<any>>;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.1.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.1.24
|
|
6
|
+
* @date 2025-06-06T09:31:57.011Z
|
|
7
|
+
* @hash 0e386b2
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -8293,9 +8293,10 @@ const AGGREGATOR_NAMES = {
|
|
|
8293
8293
|
avg: _t("Average"),
|
|
8294
8294
|
sum: _t("Sum"),
|
|
8295
8295
|
};
|
|
8296
|
+
const NUMBER_CHAR_AGGREGATORS = ["max", "min", "avg", "sum", "count_distinct", "count"];
|
|
8296
8297
|
const AGGREGATORS_BY_FIELD_TYPE = {
|
|
8297
|
-
integer:
|
|
8298
|
-
char:
|
|
8298
|
+
integer: NUMBER_CHAR_AGGREGATORS,
|
|
8299
|
+
char: NUMBER_CHAR_AGGREGATORS,
|
|
8299
8300
|
boolean: ["count_distinct", "count", "bool_and", "bool_or"],
|
|
8300
8301
|
};
|
|
8301
8302
|
const AGGREGATORS = {};
|
|
@@ -10205,8 +10206,6 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
10205
10206
|
if (isNaN(value)) {
|
|
10206
10207
|
continue;
|
|
10207
10208
|
}
|
|
10208
|
-
const axisId = chart.config.type === "radar" ? dataset.rAxisID : dataset.yAxisID;
|
|
10209
|
-
const displayValue = options.callback(Number(value), axisId);
|
|
10210
10209
|
const point = dataset.data[i];
|
|
10211
10210
|
const xPosition = point.x;
|
|
10212
10211
|
let yPosition = 0;
|
|
@@ -10230,7 +10229,8 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
10230
10229
|
textsPositions[xPosition].push(yPosition);
|
|
10231
10230
|
ctx.fillStyle = point.options.backgroundColor;
|
|
10232
10231
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10233
|
-
|
|
10232
|
+
const valueToDisplay = options.callback(Number(value), dataset, i);
|
|
10233
|
+
drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
|
|
10234
10234
|
}
|
|
10235
10235
|
}
|
|
10236
10236
|
}
|
|
@@ -10247,7 +10247,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
|
10247
10247
|
if (isNaN(value)) {
|
|
10248
10248
|
continue;
|
|
10249
10249
|
}
|
|
10250
|
-
const displayValue = options.callback(value, dataset
|
|
10250
|
+
const displayValue = options.callback(value, dataset, i);
|
|
10251
10251
|
const point = dataset.data[i];
|
|
10252
10252
|
const yPosition = point.y;
|
|
10253
10253
|
let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
|
|
@@ -10285,7 +10285,7 @@ function drawPieChartValues(chart, options, ctx) {
|
|
|
10285
10285
|
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
10286
10286
|
ctx.fillStyle = chartFontColor(options.background);
|
|
10287
10287
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10288
|
-
const displayValue = options.callback(value,
|
|
10288
|
+
const displayValue = options.callback(value, dataset, i);
|
|
10289
10289
|
drawTextWithBackground(displayValue, x, y, ctx);
|
|
10290
10290
|
}
|
|
10291
10291
|
}
|
|
@@ -30050,9 +30050,51 @@ function getChartShowValues(definition, args) {
|
|
|
30050
30050
|
horizontal: "horizontal" in definition && definition.horizontal,
|
|
30051
30051
|
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30052
30052
|
background: definition.background,
|
|
30053
|
-
callback:
|
|
30053
|
+
callback: (value, dataset) => {
|
|
30054
|
+
const axisId = getDatasetAxisId(definition, dataset);
|
|
30055
|
+
return formatChartDatasetValue(axisFormats, locale)(value, axisId);
|
|
30056
|
+
},
|
|
30057
|
+
};
|
|
30058
|
+
}
|
|
30059
|
+
function getPyramidChartShowValues(definition, args) {
|
|
30060
|
+
const { axisFormats, locale } = args;
|
|
30061
|
+
return {
|
|
30062
|
+
horizontal: true,
|
|
30063
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30064
|
+
background: definition.background,
|
|
30065
|
+
callback: (value, dataset) => {
|
|
30066
|
+
value = Math.abs(Number(value));
|
|
30067
|
+
return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
|
|
30068
|
+
},
|
|
30069
|
+
};
|
|
30070
|
+
}
|
|
30071
|
+
function getWaterfallChartShowValues(definition, args) {
|
|
30072
|
+
const { axisFormats, locale, dataSetsValues } = args;
|
|
30073
|
+
const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
|
|
30074
|
+
subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
|
|
30075
|
+
return subtotalIndexes;
|
|
30076
|
+
}, []);
|
|
30077
|
+
return {
|
|
30078
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
30079
|
+
background: definition.background,
|
|
30080
|
+
callback: (value, dataset, index) => {
|
|
30081
|
+
const raw = dataset._dataset.data[index];
|
|
30082
|
+
const delta = raw[1] - raw[0];
|
|
30083
|
+
let sign = delta >= 0 ? "+" : "";
|
|
30084
|
+
if (definition.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
|
|
30085
|
+
sign = "";
|
|
30086
|
+
}
|
|
30087
|
+
return `${sign}${formatChartDatasetValue(axisFormats, locale)(delta, dataset.yAxisID)}`;
|
|
30088
|
+
},
|
|
30054
30089
|
};
|
|
30055
30090
|
}
|
|
30091
|
+
function getDatasetAxisId(definition, dataset) {
|
|
30092
|
+
if (dataset.rAxisID) {
|
|
30093
|
+
return dataset.rAxisID;
|
|
30094
|
+
}
|
|
30095
|
+
const axisId = "horizontal" in definition && definition.horizontal ? dataset.xAxisID : dataset.yAxisID;
|
|
30096
|
+
return axisId || "y";
|
|
30097
|
+
}
|
|
30056
30098
|
|
|
30057
30099
|
function getChartTitle(definition) {
|
|
30058
30100
|
const chartTitle = definition.title;
|
|
@@ -30261,6 +30303,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
30261
30303
|
getPieChartTooltip: getPieChartTooltip,
|
|
30262
30304
|
getPyramidChartData: getPyramidChartData,
|
|
30263
30305
|
getPyramidChartScales: getPyramidChartScales,
|
|
30306
|
+
getPyramidChartShowValues: getPyramidChartShowValues,
|
|
30264
30307
|
getPyramidChartTooltip: getPyramidChartTooltip,
|
|
30265
30308
|
getRadarChartData: getRadarChartData,
|
|
30266
30309
|
getRadarChartDatasets: getRadarChartDatasets,
|
|
@@ -30274,6 +30317,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
30274
30317
|
getTrendDatasetForLineChart: getTrendDatasetForLineChart,
|
|
30275
30318
|
getWaterfallChartLegend: getWaterfallChartLegend,
|
|
30276
30319
|
getWaterfallChartScales: getWaterfallChartScales,
|
|
30320
|
+
getWaterfallChartShowValues: getWaterfallChartShowValues,
|
|
30277
30321
|
getWaterfallChartTooltip: getWaterfallChartTooltip,
|
|
30278
30322
|
getWaterfallDatasetAndLabels: getWaterfallDatasetAndLabels
|
|
30279
30323
|
});
|
|
@@ -31372,7 +31416,7 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
31372
31416
|
title: getChartTitle(definition),
|
|
31373
31417
|
legend: getBarChartLegend(definition),
|
|
31374
31418
|
tooltip: getPyramidChartTooltip(definition, chartData),
|
|
31375
|
-
chartShowValuesPlugin:
|
|
31419
|
+
chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
|
|
31376
31420
|
},
|
|
31377
31421
|
},
|
|
31378
31422
|
};
|
|
@@ -31835,7 +31879,7 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
31835
31879
|
title: getChartTitle(definition),
|
|
31836
31880
|
legend: getWaterfallChartLegend(definition),
|
|
31837
31881
|
tooltip: getWaterfallChartTooltip(definition, chartData),
|
|
31838
|
-
chartShowValuesPlugin:
|
|
31882
|
+
chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
|
|
31839
31883
|
waterfallLinesPlugin: { showConnectorLines: definition.showConnectorLines },
|
|
31840
31884
|
},
|
|
31841
31885
|
},
|
|
@@ -44318,13 +44362,15 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
44318
44362
|
if (this.selectedMatchIndex === null) {
|
|
44319
44363
|
return;
|
|
44320
44364
|
}
|
|
44365
|
+
this.preserveSelectedMatchIndex = true;
|
|
44366
|
+
this.shouldFinalizeUpdateSelection = true;
|
|
44321
44367
|
this.model.dispatch("REPLACE_SEARCH", {
|
|
44322
44368
|
searchString: this.toSearch,
|
|
44323
44369
|
replaceWith: this.toReplace,
|
|
44324
44370
|
matches: [this.searchMatches[this.selectedMatchIndex]],
|
|
44325
44371
|
searchOptions: this.searchOptions,
|
|
44326
44372
|
});
|
|
44327
|
-
this.
|
|
44373
|
+
this.preserveSelectedMatchIndex = false;
|
|
44328
44374
|
}
|
|
44329
44375
|
/**
|
|
44330
44376
|
* Apply the replace function to all the matches one time.
|
|
@@ -46754,12 +46800,7 @@ class SpreadsheetPivot {
|
|
|
46754
46800
|
entry[field.name] = { value: null, type: CellValueType.empty, formattedValue: "" };
|
|
46755
46801
|
}
|
|
46756
46802
|
else {
|
|
46757
|
-
|
|
46758
|
-
entry[field.name] = { ...cell, value: cell.formattedValue || null };
|
|
46759
|
-
}
|
|
46760
|
-
else {
|
|
46761
|
-
entry[field.name] = cell;
|
|
46762
|
-
}
|
|
46803
|
+
entry[field.name] = cell;
|
|
46763
46804
|
}
|
|
46764
46805
|
}
|
|
46765
46806
|
entry["__count"] = { value: 1, type: CellValueType.number, formattedValue: "1" };
|
|
@@ -51825,6 +51866,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
51825
51866
|
let deltaX = lastX - clientX;
|
|
51826
51867
|
let deltaY = lastY - clientY;
|
|
51827
51868
|
const elapsedTime = currentTime - lastTime;
|
|
51869
|
+
if (!elapsedTime) {
|
|
51870
|
+
return;
|
|
51871
|
+
}
|
|
51828
51872
|
velocityX = deltaX / elapsedTime;
|
|
51829
51873
|
velocityY = deltaY / elapsedTime;
|
|
51830
51874
|
lastX = clientX;
|
|
@@ -51845,6 +51889,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
51845
51889
|
function onTouchEnd(ev) {
|
|
51846
51890
|
isMouseDown = false;
|
|
51847
51891
|
lastX = lastY = 0;
|
|
51892
|
+
if (resetTimeout) {
|
|
51893
|
+
clearTimeout(resetTimeout);
|
|
51894
|
+
}
|
|
51895
|
+
velocityX *= 1.2;
|
|
51896
|
+
velocityY *= 1.2;
|
|
51848
51897
|
requestAnimationFrame(scroll);
|
|
51849
51898
|
}
|
|
51850
51899
|
function scroll() {
|
|
@@ -58946,7 +58995,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
58946
58995
|
break;
|
|
58947
58996
|
}
|
|
58948
58997
|
case "UPDATE_PIVOT": {
|
|
58949
|
-
this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
|
|
58998
|
+
this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
|
|
58950
58999
|
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
58951
59000
|
break;
|
|
58952
59001
|
}
|
|
@@ -59017,7 +59066,10 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
59017
59066
|
// Private
|
|
59018
59067
|
// -------------------------------------------------------------------------
|
|
59019
59068
|
addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
|
|
59020
|
-
this.history.update("pivots", pivotId, {
|
|
59069
|
+
this.history.update("pivots", pivotId, {
|
|
59070
|
+
definition: this.repairSortedColumn(deepCopy(pivot)),
|
|
59071
|
+
formulaId,
|
|
59072
|
+
});
|
|
59021
59073
|
this.compileCalculatedMeasures(pivot.measures);
|
|
59022
59074
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
59023
59075
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
@@ -59110,6 +59162,26 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
59110
59162
|
}
|
|
59111
59163
|
return "Success" /* CommandResult.Success */;
|
|
59112
59164
|
}
|
|
59165
|
+
repairSortedColumn(definition) {
|
|
59166
|
+
if (definition.sortedColumn) {
|
|
59167
|
+
// Fix for an upgrade issue: the sortedColumn measure was not updated
|
|
59168
|
+
// from using fieldName to using id. If the sortedColumn measure matches
|
|
59169
|
+
// a measure fieldName in the definition, update it to use the measure's id instead
|
|
59170
|
+
// of its fieldName.
|
|
59171
|
+
// TODO: add an upgrade step to fix this in master and remove this code
|
|
59172
|
+
const sortedMeasure = definition.measures.find((measure) => measure.fieldName === definition.sortedColumn?.measure);
|
|
59173
|
+
if (sortedMeasure) {
|
|
59174
|
+
return {
|
|
59175
|
+
...definition,
|
|
59176
|
+
sortedColumn: {
|
|
59177
|
+
...definition.sortedColumn,
|
|
59178
|
+
measure: sortedMeasure.id,
|
|
59179
|
+
},
|
|
59180
|
+
};
|
|
59181
|
+
}
|
|
59182
|
+
}
|
|
59183
|
+
return definition;
|
|
59184
|
+
}
|
|
59113
59185
|
// ---------------------------------------------------------------------
|
|
59114
59186
|
// Import/Export
|
|
59115
59187
|
// ---------------------------------------------------------------------
|
|
@@ -68018,11 +68090,6 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68018
68090
|
},
|
|
68019
68091
|
];
|
|
68020
68092
|
const sheetId = this.getActiveSheetId();
|
|
68021
|
-
const handler = new CellClipboardHandler(this.getters, this.dispatch);
|
|
68022
|
-
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
68023
|
-
if (!data) {
|
|
68024
|
-
return;
|
|
68025
|
-
}
|
|
68026
68093
|
const base = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
68027
68094
|
const pasteTarget = [
|
|
68028
68095
|
{
|
|
@@ -68032,7 +68099,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68032
68099
|
bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
68033
68100
|
},
|
|
68034
68101
|
];
|
|
68035
|
-
|
|
68102
|
+
for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
|
|
68103
|
+
const handler = new Handler(this.getters, this.dispatch);
|
|
68104
|
+
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
68105
|
+
if (!data) {
|
|
68106
|
+
continue;
|
|
68107
|
+
}
|
|
68108
|
+
handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
|
|
68109
|
+
}
|
|
68036
68110
|
const selection = pasteTarget[0];
|
|
68037
68111
|
const col = selection.left;
|
|
68038
68112
|
const row = selection.top;
|
|
@@ -76391,6 +76465,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
76391
76465
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
76392
76466
|
|
|
76393
76467
|
|
|
76394
|
-
__info__.version = "18.1.
|
|
76395
|
-
__info__.date = "2025-
|
|
76396
|
-
__info__.hash = "
|
|
76468
|
+
__info__.version = "18.1.24";
|
|
76469
|
+
__info__.date = "2025-06-06T09:31:57.011Z";
|
|
76470
|
+
__info__.hash = "0e386b2";
|