@odoo/o-spreadsheet 18.3.6 → 18.3.7
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 +103 -24
- package/dist/o-spreadsheet.d.ts +5 -2
- package/dist/o-spreadsheet.esm.js +103 -24
- package/dist/o-spreadsheet.iife.js +103 -24
- package/dist/o-spreadsheet.iife.min.js +366 -366
- package/dist/o_spreadsheet.xml +3 -3
- 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.3.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.7
|
|
6
|
+
* @date 2025-06-06T09:31:27.123Z
|
|
7
|
+
* @hash 05333f1
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -20957,8 +20957,6 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
20957
20957
|
if (isNaN(value)) {
|
|
20958
20958
|
continue;
|
|
20959
20959
|
}
|
|
20960
|
-
const axisId = chart.config.type === "radar" ? dataset.rAxisID : dataset.yAxisID;
|
|
20961
|
-
const displayValue = options.callback(Number(value), axisId);
|
|
20962
20960
|
const point = dataset.data[i];
|
|
20963
20961
|
const xPosition = point.x;
|
|
20964
20962
|
let yPosition = 0;
|
|
@@ -20982,7 +20980,8 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
20982
20980
|
textsPositions[xPosition].push(yPosition);
|
|
20983
20981
|
ctx.fillStyle = point.options.backgroundColor;
|
|
20984
20982
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
20985
|
-
|
|
20983
|
+
const valueToDisplay = options.callback(Number(value), dataset, i);
|
|
20984
|
+
drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
|
|
20986
20985
|
}
|
|
20987
20986
|
}
|
|
20988
20987
|
}
|
|
@@ -20999,7 +20998,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
|
20999
20998
|
if (isNaN(value)) {
|
|
21000
20999
|
continue;
|
|
21001
21000
|
}
|
|
21002
|
-
const displayValue = options.callback(value, dataset
|
|
21001
|
+
const displayValue = options.callback(value, dataset, i);
|
|
21003
21002
|
const point = dataset.data[i];
|
|
21004
21003
|
const yPosition = point.y;
|
|
21005
21004
|
let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
|
|
@@ -21037,7 +21036,7 @@ function drawPieChartValues(chart, options, ctx) {
|
|
|
21037
21036
|
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
21038
21037
|
ctx.fillStyle = chartFontColor(options.background);
|
|
21039
21038
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
21040
|
-
const displayValue = options.callback(value,
|
|
21039
|
+
const displayValue = options.callback(value, dataset, i);
|
|
21041
21040
|
drawTextWithBackground(displayValue, x, y, ctx);
|
|
21042
21041
|
}
|
|
21043
21042
|
}
|
|
@@ -26358,7 +26357,10 @@ function getChartShowValues(definition, args) {
|
|
|
26358
26357
|
horizontal: "horizontal" in definition && definition.horizontal,
|
|
26359
26358
|
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
26360
26359
|
background: definition.background,
|
|
26361
|
-
callback:
|
|
26360
|
+
callback: (value, dataset) => {
|
|
26361
|
+
const axisId = getDatasetAxisId(definition, dataset);
|
|
26362
|
+
return formatChartDatasetValue(axisFormats, locale)(value, axisId);
|
|
26363
|
+
},
|
|
26362
26364
|
};
|
|
26363
26365
|
}
|
|
26364
26366
|
function getSunburstShowValues(definition, args) {
|
|
@@ -26376,6 +26378,45 @@ function getSunburstShowValues(definition, args) {
|
|
|
26376
26378
|
},
|
|
26377
26379
|
};
|
|
26378
26380
|
}
|
|
26381
|
+
function getPyramidChartShowValues(definition, args) {
|
|
26382
|
+
const { axisFormats, locale } = args;
|
|
26383
|
+
return {
|
|
26384
|
+
horizontal: true,
|
|
26385
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
26386
|
+
background: definition.background,
|
|
26387
|
+
callback: (value, dataset) => {
|
|
26388
|
+
value = Math.abs(Number(value));
|
|
26389
|
+
return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
|
|
26390
|
+
},
|
|
26391
|
+
};
|
|
26392
|
+
}
|
|
26393
|
+
function getWaterfallChartShowValues(definition, args) {
|
|
26394
|
+
const { axisFormats, locale, dataSetsValues } = args;
|
|
26395
|
+
const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
|
|
26396
|
+
subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
|
|
26397
|
+
return subtotalIndexes;
|
|
26398
|
+
}, []);
|
|
26399
|
+
return {
|
|
26400
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
26401
|
+
background: definition.background,
|
|
26402
|
+
callback: (value, dataset, index) => {
|
|
26403
|
+
const raw = dataset._dataset.data[index];
|
|
26404
|
+
const delta = raw[1] - raw[0];
|
|
26405
|
+
let sign = delta >= 0 ? "+" : "";
|
|
26406
|
+
if (definition.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
|
|
26407
|
+
sign = "";
|
|
26408
|
+
}
|
|
26409
|
+
return `${sign}${formatChartDatasetValue(axisFormats, locale)(delta, dataset.yAxisID)}`;
|
|
26410
|
+
},
|
|
26411
|
+
};
|
|
26412
|
+
}
|
|
26413
|
+
function getDatasetAxisId(definition, dataset) {
|
|
26414
|
+
if (dataset.rAxisID) {
|
|
26415
|
+
return dataset.rAxisID;
|
|
26416
|
+
}
|
|
26417
|
+
const axisId = "horizontal" in definition && definition.horizontal ? dataset.xAxisID : dataset.yAxisID;
|
|
26418
|
+
return axisId || "y";
|
|
26419
|
+
}
|
|
26379
26420
|
|
|
26380
26421
|
function getChartTitle(definition) {
|
|
26381
26422
|
const chartTitle = definition.title;
|
|
@@ -26778,6 +26819,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
26778
26819
|
getPieChartTooltip: getPieChartTooltip,
|
|
26779
26820
|
getPyramidChartData: getPyramidChartData,
|
|
26780
26821
|
getPyramidChartScales: getPyramidChartScales,
|
|
26822
|
+
getPyramidChartShowValues: getPyramidChartShowValues,
|
|
26781
26823
|
getPyramidChartTooltip: getPyramidChartTooltip,
|
|
26782
26824
|
getRadarChartData: getRadarChartData,
|
|
26783
26825
|
getRadarChartDatasets: getRadarChartDatasets,
|
|
@@ -26797,6 +26839,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
26797
26839
|
getTrendDatasetForLineChart: getTrendDatasetForLineChart,
|
|
26798
26840
|
getWaterfallChartLegend: getWaterfallChartLegend,
|
|
26799
26841
|
getWaterfallChartScales: getWaterfallChartScales,
|
|
26842
|
+
getWaterfallChartShowValues: getWaterfallChartShowValues,
|
|
26800
26843
|
getWaterfallChartTooltip: getWaterfallChartTooltip,
|
|
26801
26844
|
getWaterfallDatasetAndLabels: getWaterfallDatasetAndLabels,
|
|
26802
26845
|
makeDatasetsCumulative: makeDatasetsCumulative
|
|
@@ -28076,7 +28119,7 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
28076
28119
|
title: getChartTitle(definition),
|
|
28077
28120
|
legend: getBarChartLegend(definition),
|
|
28078
28121
|
tooltip: getPyramidChartTooltip(definition, chartData),
|
|
28079
|
-
chartShowValuesPlugin:
|
|
28122
|
+
chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
|
|
28080
28123
|
},
|
|
28081
28124
|
},
|
|
28082
28125
|
};
|
|
@@ -28817,7 +28860,7 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
28817
28860
|
title: getChartTitle(definition),
|
|
28818
28861
|
legend: getWaterfallChartLegend(definition),
|
|
28819
28862
|
tooltip: getWaterfallChartTooltip(definition, chartData),
|
|
28820
|
-
chartShowValuesPlugin:
|
|
28863
|
+
chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
|
|
28821
28864
|
waterfallLinesPlugin: { showConnectorLines: definition.showConnectorLines },
|
|
28822
28865
|
},
|
|
28823
28866
|
},
|
|
@@ -47369,13 +47412,15 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
47369
47412
|
if (this.selectedMatchIndex === null) {
|
|
47370
47413
|
return;
|
|
47371
47414
|
}
|
|
47415
|
+
this.preserveSelectedMatchIndex = true;
|
|
47416
|
+
this.shouldFinalizeUpdateSelection = true;
|
|
47372
47417
|
this.model.dispatch("REPLACE_SEARCH", {
|
|
47373
47418
|
searchString: this.toSearch,
|
|
47374
47419
|
replaceWith: this.toReplace,
|
|
47375
47420
|
matches: [this.searchMatches[this.selectedMatchIndex]],
|
|
47376
47421
|
searchOptions: this.searchOptions,
|
|
47377
47422
|
});
|
|
47378
|
-
this.
|
|
47423
|
+
this.preserveSelectedMatchIndex = false;
|
|
47379
47424
|
}
|
|
47380
47425
|
/**
|
|
47381
47426
|
* Apply the replace function to all the matches one time.
|
|
@@ -53531,7 +53576,7 @@ class HoveredTableStore extends SpreadsheetStore {
|
|
|
53531
53576
|
}
|
|
53532
53577
|
}
|
|
53533
53578
|
hover(position) {
|
|
53534
|
-
if (position.col === this.col && position.row === this.row) {
|
|
53579
|
+
if (!this.getters.isDashboard() || (position.col === this.col && position.row === this.row)) {
|
|
53535
53580
|
return "noStateChange";
|
|
53536
53581
|
}
|
|
53537
53582
|
this.col = position.col;
|
|
@@ -55207,6 +55252,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
55207
55252
|
let deltaX = lastX - clientX;
|
|
55208
55253
|
let deltaY = lastY - clientY;
|
|
55209
55254
|
const elapsedTime = currentTime - lastTime;
|
|
55255
|
+
if (!elapsedTime) {
|
|
55256
|
+
return;
|
|
55257
|
+
}
|
|
55210
55258
|
velocityX = deltaX / elapsedTime;
|
|
55211
55259
|
velocityY = deltaY / elapsedTime;
|
|
55212
55260
|
lastX = clientX;
|
|
@@ -55227,6 +55275,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
55227
55275
|
function onTouchEnd(ev) {
|
|
55228
55276
|
isMouseDown = false;
|
|
55229
55277
|
lastX = lastY = 0;
|
|
55278
|
+
if (resetTimeout) {
|
|
55279
|
+
clearTimeout(resetTimeout);
|
|
55280
|
+
}
|
|
55281
|
+
velocityX *= 1.2;
|
|
55282
|
+
velocityY *= 1.2;
|
|
55230
55283
|
requestAnimationFrame(scroll);
|
|
55231
55284
|
}
|
|
55232
55285
|
function scroll() {
|
|
@@ -62317,7 +62370,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62317
62370
|
break;
|
|
62318
62371
|
}
|
|
62319
62372
|
case "UPDATE_PIVOT": {
|
|
62320
|
-
this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
|
|
62373
|
+
this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
|
|
62321
62374
|
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
62322
62375
|
break;
|
|
62323
62376
|
}
|
|
@@ -62388,7 +62441,10 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62388
62441
|
// Private
|
|
62389
62442
|
// -------------------------------------------------------------------------
|
|
62390
62443
|
addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
|
|
62391
|
-
this.history.update("pivots", pivotId, {
|
|
62444
|
+
this.history.update("pivots", pivotId, {
|
|
62445
|
+
definition: this.repairSortedColumn(deepCopy(pivot)),
|
|
62446
|
+
formulaId,
|
|
62447
|
+
});
|
|
62392
62448
|
this.compileCalculatedMeasures(pivot.measures);
|
|
62393
62449
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
62394
62450
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
@@ -62477,6 +62533,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62477
62533
|
}
|
|
62478
62534
|
}
|
|
62479
62535
|
checkSortedColumnInMeasures(definition) {
|
|
62536
|
+
definition = this.repairSortedColumn(definition);
|
|
62480
62537
|
const measures = definition.measures.map((measure) => measure.id);
|
|
62481
62538
|
if (definition.sortedColumn && !measures.includes(definition.sortedColumn.measure)) {
|
|
62482
62539
|
return "InvalidDefinition" /* CommandResult.InvalidDefinition */;
|
|
@@ -62490,6 +62547,26 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62490
62547
|
}
|
|
62491
62548
|
return "Success" /* CommandResult.Success */;
|
|
62492
62549
|
}
|
|
62550
|
+
repairSortedColumn(definition) {
|
|
62551
|
+
if (definition.sortedColumn) {
|
|
62552
|
+
// Fix for an upgrade issue: the sortedColumn measure was not updated
|
|
62553
|
+
// from using fieldName to using id. If the sortedColumn measure matches
|
|
62554
|
+
// a measure fieldName in the definition, update it to use the measure's id instead
|
|
62555
|
+
// of its fieldName.
|
|
62556
|
+
// TODO: add an upgrade step to fix this in master and remove this code
|
|
62557
|
+
const sortedMeasure = definition.measures.find((measure) => measure.fieldName === definition.sortedColumn?.measure);
|
|
62558
|
+
if (sortedMeasure) {
|
|
62559
|
+
return {
|
|
62560
|
+
...definition,
|
|
62561
|
+
sortedColumn: {
|
|
62562
|
+
...definition.sortedColumn,
|
|
62563
|
+
measure: sortedMeasure.id,
|
|
62564
|
+
},
|
|
62565
|
+
};
|
|
62566
|
+
}
|
|
62567
|
+
}
|
|
62568
|
+
return definition;
|
|
62569
|
+
}
|
|
62493
62570
|
// ---------------------------------------------------------------------
|
|
62494
62571
|
// Import/Export
|
|
62495
62572
|
// ---------------------------------------------------------------------
|
|
@@ -71649,11 +71726,6 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
71649
71726
|
},
|
|
71650
71727
|
];
|
|
71651
71728
|
const sheetId = this.getActiveSheetId();
|
|
71652
|
-
const handler = new CellClipboardHandler(this.getters, this.dispatch);
|
|
71653
|
-
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
71654
|
-
if (!data) {
|
|
71655
|
-
return;
|
|
71656
|
-
}
|
|
71657
71729
|
const base = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
71658
71730
|
const pasteTarget = [
|
|
71659
71731
|
{
|
|
@@ -71663,7 +71735,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
71663
71735
|
bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
71664
71736
|
},
|
|
71665
71737
|
];
|
|
71666
|
-
|
|
71738
|
+
for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
|
|
71739
|
+
const handler = new Handler(this.getters, this.dispatch);
|
|
71740
|
+
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
71741
|
+
if (!data) {
|
|
71742
|
+
continue;
|
|
71743
|
+
}
|
|
71744
|
+
handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
|
|
71745
|
+
}
|
|
71667
71746
|
const selection = pasteTarget[0];
|
|
71668
71747
|
const col = selection.left;
|
|
71669
71748
|
const row = selection.top;
|
|
@@ -80563,6 +80642,6 @@ exports.tokenColors = tokenColors;
|
|
|
80563
80642
|
exports.tokenize = tokenize;
|
|
80564
80643
|
|
|
80565
80644
|
|
|
80566
|
-
__info__.version = "18.3.
|
|
80567
|
-
__info__.date = "2025-
|
|
80568
|
-
__info__.hash = "
|
|
80645
|
+
__info__.version = "18.3.7";
|
|
80646
|
+
__info__.date = "2025-06-06T09:31:27.123Z";
|
|
80647
|
+
__info__.hash = "05333f1";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as chart_js from 'chart.js';
|
|
2
|
-
import { ChartConfiguration, ChartDataset, CoreChartOptions, Scriptable, Color as Color$1, ScriptableContext, FontSpec, Point, ChartType as ChartType$1 } from 'chart.js';
|
|
2
|
+
import { ChartConfiguration, ChartDataset, CoreChartOptions, Scriptable, Color as Color$1, ScriptableContext, FontSpec, Point, 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';
|
|
@@ -5064,6 +5064,7 @@ declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState
|
|
|
5064
5064
|
private replaceMeasureFormula;
|
|
5065
5065
|
private checkSortedColumnInMeasures;
|
|
5066
5066
|
private checkDuplicatedMeasureIds;
|
|
5067
|
+
private repairSortedColumn;
|
|
5067
5068
|
/**
|
|
5068
5069
|
* Import the pivots
|
|
5069
5070
|
*/
|
|
@@ -6531,7 +6532,7 @@ interface ChartShowValuesPluginOptions {
|
|
|
6531
6532
|
showValues: boolean;
|
|
6532
6533
|
background?: Color;
|
|
6533
6534
|
horizontal?: boolean;
|
|
6534
|
-
callback: (value: number | string,
|
|
6535
|
+
callback: (value: number | string, dataset: ChartMeta, index: number) => string;
|
|
6535
6536
|
}
|
|
6536
6537
|
declare module "chart.js" {
|
|
6537
6538
|
interface PluginOptionsByType<TType extends ChartType$1> {
|
|
@@ -12524,6 +12525,8 @@ declare const chartHelpers: {
|
|
|
12524
12525
|
}>;
|
|
12525
12526
|
getChartShowValues(definition: ChartWithDataSetDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
|
|
12526
12527
|
getSunburstShowValues(definition: SunburstChartDefinition, args: ChartRuntimeGenerationArgs): ChartSunburstLabelsPluginOptions;
|
|
12528
|
+
getPyramidChartShowValues(definition: ChartWithDataSetDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
|
|
12529
|
+
getWaterfallChartShowValues(definition: WaterfallChartDefinition, args: ChartRuntimeGenerationArgs): ChartShowValuesPluginOptions;
|
|
12527
12530
|
getChartTitle(definition: ChartWithDataSetDefinition): chart_js_dist_types_utils._DeepPartialObject<chart_js.TitleOptions>;
|
|
12528
12531
|
getBarChartTooltip(definition: GenericDefinition<BarChartDefinition>, args: ChartRuntimeGenerationArgs): chart_js_dist_types_utils._DeepPartialObject<chart_js.TooltipOptions<any>>;
|
|
12529
12532
|
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.3.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.7
|
|
6
|
+
* @date 2025-06-06T09:31:27.123Z
|
|
7
|
+
* @hash 05333f1
|
|
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';
|
|
@@ -20955,8 +20955,6 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
20955
20955
|
if (isNaN(value)) {
|
|
20956
20956
|
continue;
|
|
20957
20957
|
}
|
|
20958
|
-
const axisId = chart.config.type === "radar" ? dataset.rAxisID : dataset.yAxisID;
|
|
20959
|
-
const displayValue = options.callback(Number(value), axisId);
|
|
20960
20958
|
const point = dataset.data[i];
|
|
20961
20959
|
const xPosition = point.x;
|
|
20962
20960
|
let yPosition = 0;
|
|
@@ -20980,7 +20978,8 @@ function drawLineOrBarOrRadarChartValues(chart, options, ctx) {
|
|
|
20980
20978
|
textsPositions[xPosition].push(yPosition);
|
|
20981
20979
|
ctx.fillStyle = point.options.backgroundColor;
|
|
20982
20980
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
20983
|
-
|
|
20981
|
+
const valueToDisplay = options.callback(Number(value), dataset, i);
|
|
20982
|
+
drawTextWithBackground(valueToDisplay, xPosition, yPosition, ctx);
|
|
20984
20983
|
}
|
|
20985
20984
|
}
|
|
20986
20985
|
}
|
|
@@ -20997,7 +20996,7 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
|
20997
20996
|
if (isNaN(value)) {
|
|
20998
20997
|
continue;
|
|
20999
20998
|
}
|
|
21000
|
-
const displayValue = options.callback(value, dataset
|
|
20999
|
+
const displayValue = options.callback(value, dataset, i);
|
|
21001
21000
|
const point = dataset.data[i];
|
|
21002
21001
|
const yPosition = point.y;
|
|
21003
21002
|
let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
|
|
@@ -21035,7 +21034,7 @@ function drawPieChartValues(chart, options, ctx) {
|
|
|
21035
21034
|
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
21036
21035
|
ctx.fillStyle = chartFontColor(options.background);
|
|
21037
21036
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
21038
|
-
const displayValue = options.callback(value,
|
|
21037
|
+
const displayValue = options.callback(value, dataset, i);
|
|
21039
21038
|
drawTextWithBackground(displayValue, x, y, ctx);
|
|
21040
21039
|
}
|
|
21041
21040
|
}
|
|
@@ -26356,7 +26355,10 @@ function getChartShowValues(definition, args) {
|
|
|
26356
26355
|
horizontal: "horizontal" in definition && definition.horizontal,
|
|
26357
26356
|
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
26358
26357
|
background: definition.background,
|
|
26359
|
-
callback:
|
|
26358
|
+
callback: (value, dataset) => {
|
|
26359
|
+
const axisId = getDatasetAxisId(definition, dataset);
|
|
26360
|
+
return formatChartDatasetValue(axisFormats, locale)(value, axisId);
|
|
26361
|
+
},
|
|
26360
26362
|
};
|
|
26361
26363
|
}
|
|
26362
26364
|
function getSunburstShowValues(definition, args) {
|
|
@@ -26374,6 +26376,45 @@ function getSunburstShowValues(definition, args) {
|
|
|
26374
26376
|
},
|
|
26375
26377
|
};
|
|
26376
26378
|
}
|
|
26379
|
+
function getPyramidChartShowValues(definition, args) {
|
|
26380
|
+
const { axisFormats, locale } = args;
|
|
26381
|
+
return {
|
|
26382
|
+
horizontal: true,
|
|
26383
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
26384
|
+
background: definition.background,
|
|
26385
|
+
callback: (value, dataset) => {
|
|
26386
|
+
value = Math.abs(Number(value));
|
|
26387
|
+
return formatChartDatasetValue(axisFormats, locale)(value, dataset.xAxisID || "x");
|
|
26388
|
+
},
|
|
26389
|
+
};
|
|
26390
|
+
}
|
|
26391
|
+
function getWaterfallChartShowValues(definition, args) {
|
|
26392
|
+
const { axisFormats, locale, dataSetsValues } = args;
|
|
26393
|
+
const subtotalIndexes = dataSetsValues.reduce((subtotalIndexes, ds) => {
|
|
26394
|
+
subtotalIndexes.push((subtotalIndexes.at(-1) || -1) + ds.data.length + 1);
|
|
26395
|
+
return subtotalIndexes;
|
|
26396
|
+
}, []);
|
|
26397
|
+
return {
|
|
26398
|
+
showValues: "showValues" in definition ? !!definition.showValues : false,
|
|
26399
|
+
background: definition.background,
|
|
26400
|
+
callback: (value, dataset, index) => {
|
|
26401
|
+
const raw = dataset._dataset.data[index];
|
|
26402
|
+
const delta = raw[1] - raw[0];
|
|
26403
|
+
let sign = delta >= 0 ? "+" : "";
|
|
26404
|
+
if (definition.showSubTotals && subtotalIndexes.includes(index) && sign === "+") {
|
|
26405
|
+
sign = "";
|
|
26406
|
+
}
|
|
26407
|
+
return `${sign}${formatChartDatasetValue(axisFormats, locale)(delta, dataset.yAxisID)}`;
|
|
26408
|
+
},
|
|
26409
|
+
};
|
|
26410
|
+
}
|
|
26411
|
+
function getDatasetAxisId(definition, dataset) {
|
|
26412
|
+
if (dataset.rAxisID) {
|
|
26413
|
+
return dataset.rAxisID;
|
|
26414
|
+
}
|
|
26415
|
+
const axisId = "horizontal" in definition && definition.horizontal ? dataset.xAxisID : dataset.yAxisID;
|
|
26416
|
+
return axisId || "y";
|
|
26417
|
+
}
|
|
26377
26418
|
|
|
26378
26419
|
function getChartTitle(definition) {
|
|
26379
26420
|
const chartTitle = definition.title;
|
|
@@ -26776,6 +26817,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
26776
26817
|
getPieChartTooltip: getPieChartTooltip,
|
|
26777
26818
|
getPyramidChartData: getPyramidChartData,
|
|
26778
26819
|
getPyramidChartScales: getPyramidChartScales,
|
|
26820
|
+
getPyramidChartShowValues: getPyramidChartShowValues,
|
|
26779
26821
|
getPyramidChartTooltip: getPyramidChartTooltip,
|
|
26780
26822
|
getRadarChartData: getRadarChartData,
|
|
26781
26823
|
getRadarChartDatasets: getRadarChartDatasets,
|
|
@@ -26795,6 +26837,7 @@ var CHART_RUNTIME_HELPERS = /*#__PURE__*/Object.freeze({
|
|
|
26795
26837
|
getTrendDatasetForLineChart: getTrendDatasetForLineChart,
|
|
26796
26838
|
getWaterfallChartLegend: getWaterfallChartLegend,
|
|
26797
26839
|
getWaterfallChartScales: getWaterfallChartScales,
|
|
26840
|
+
getWaterfallChartShowValues: getWaterfallChartShowValues,
|
|
26798
26841
|
getWaterfallChartTooltip: getWaterfallChartTooltip,
|
|
26799
26842
|
getWaterfallDatasetAndLabels: getWaterfallDatasetAndLabels,
|
|
26800
26843
|
makeDatasetsCumulative: makeDatasetsCumulative
|
|
@@ -28074,7 +28117,7 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
28074
28117
|
title: getChartTitle(definition),
|
|
28075
28118
|
legend: getBarChartLegend(definition),
|
|
28076
28119
|
tooltip: getPyramidChartTooltip(definition, chartData),
|
|
28077
|
-
chartShowValuesPlugin:
|
|
28120
|
+
chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
|
|
28078
28121
|
},
|
|
28079
28122
|
},
|
|
28080
28123
|
};
|
|
@@ -28815,7 +28858,7 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
28815
28858
|
title: getChartTitle(definition),
|
|
28816
28859
|
legend: getWaterfallChartLegend(definition),
|
|
28817
28860
|
tooltip: getWaterfallChartTooltip(definition, chartData),
|
|
28818
|
-
chartShowValuesPlugin:
|
|
28861
|
+
chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
|
|
28819
28862
|
waterfallLinesPlugin: { showConnectorLines: definition.showConnectorLines },
|
|
28820
28863
|
},
|
|
28821
28864
|
},
|
|
@@ -47367,13 +47410,15 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
47367
47410
|
if (this.selectedMatchIndex === null) {
|
|
47368
47411
|
return;
|
|
47369
47412
|
}
|
|
47413
|
+
this.preserveSelectedMatchIndex = true;
|
|
47414
|
+
this.shouldFinalizeUpdateSelection = true;
|
|
47370
47415
|
this.model.dispatch("REPLACE_SEARCH", {
|
|
47371
47416
|
searchString: this.toSearch,
|
|
47372
47417
|
replaceWith: this.toReplace,
|
|
47373
47418
|
matches: [this.searchMatches[this.selectedMatchIndex]],
|
|
47374
47419
|
searchOptions: this.searchOptions,
|
|
47375
47420
|
});
|
|
47376
|
-
this.
|
|
47421
|
+
this.preserveSelectedMatchIndex = false;
|
|
47377
47422
|
}
|
|
47378
47423
|
/**
|
|
47379
47424
|
* Apply the replace function to all the matches one time.
|
|
@@ -53529,7 +53574,7 @@ class HoveredTableStore extends SpreadsheetStore {
|
|
|
53529
53574
|
}
|
|
53530
53575
|
}
|
|
53531
53576
|
hover(position) {
|
|
53532
|
-
if (position.col === this.col && position.row === this.row) {
|
|
53577
|
+
if (!this.getters.isDashboard() || (position.col === this.col && position.row === this.row)) {
|
|
53533
53578
|
return "noStateChange";
|
|
53534
53579
|
}
|
|
53535
53580
|
this.col = position.col;
|
|
@@ -55205,6 +55250,9 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
55205
55250
|
let deltaX = lastX - clientX;
|
|
55206
55251
|
let deltaY = lastY - clientY;
|
|
55207
55252
|
const elapsedTime = currentTime - lastTime;
|
|
55253
|
+
if (!elapsedTime) {
|
|
55254
|
+
return;
|
|
55255
|
+
}
|
|
55208
55256
|
velocityX = deltaX / elapsedTime;
|
|
55209
55257
|
velocityY = deltaY / elapsedTime;
|
|
55210
55258
|
lastX = clientX;
|
|
@@ -55225,6 +55273,11 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
55225
55273
|
function onTouchEnd(ev) {
|
|
55226
55274
|
isMouseDown = false;
|
|
55227
55275
|
lastX = lastY = 0;
|
|
55276
|
+
if (resetTimeout) {
|
|
55277
|
+
clearTimeout(resetTimeout);
|
|
55278
|
+
}
|
|
55279
|
+
velocityX *= 1.2;
|
|
55280
|
+
velocityY *= 1.2;
|
|
55228
55281
|
requestAnimationFrame(scroll);
|
|
55229
55282
|
}
|
|
55230
55283
|
function scroll() {
|
|
@@ -62315,7 +62368,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62315
62368
|
break;
|
|
62316
62369
|
}
|
|
62317
62370
|
case "UPDATE_PIVOT": {
|
|
62318
|
-
this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
|
|
62371
|
+
this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
|
|
62319
62372
|
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
62320
62373
|
break;
|
|
62321
62374
|
}
|
|
@@ -62386,7 +62439,10 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62386
62439
|
// Private
|
|
62387
62440
|
// -------------------------------------------------------------------------
|
|
62388
62441
|
addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
|
|
62389
|
-
this.history.update("pivots", pivotId, {
|
|
62442
|
+
this.history.update("pivots", pivotId, {
|
|
62443
|
+
definition: this.repairSortedColumn(deepCopy(pivot)),
|
|
62444
|
+
formulaId,
|
|
62445
|
+
});
|
|
62390
62446
|
this.compileCalculatedMeasures(pivot.measures);
|
|
62391
62447
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
62392
62448
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
@@ -62475,6 +62531,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62475
62531
|
}
|
|
62476
62532
|
}
|
|
62477
62533
|
checkSortedColumnInMeasures(definition) {
|
|
62534
|
+
definition = this.repairSortedColumn(definition);
|
|
62478
62535
|
const measures = definition.measures.map((measure) => measure.id);
|
|
62479
62536
|
if (definition.sortedColumn && !measures.includes(definition.sortedColumn.measure)) {
|
|
62480
62537
|
return "InvalidDefinition" /* CommandResult.InvalidDefinition */;
|
|
@@ -62488,6 +62545,26 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
62488
62545
|
}
|
|
62489
62546
|
return "Success" /* CommandResult.Success */;
|
|
62490
62547
|
}
|
|
62548
|
+
repairSortedColumn(definition) {
|
|
62549
|
+
if (definition.sortedColumn) {
|
|
62550
|
+
// Fix for an upgrade issue: the sortedColumn measure was not updated
|
|
62551
|
+
// from using fieldName to using id. If the sortedColumn measure matches
|
|
62552
|
+
// a measure fieldName in the definition, update it to use the measure's id instead
|
|
62553
|
+
// of its fieldName.
|
|
62554
|
+
// TODO: add an upgrade step to fix this in master and remove this code
|
|
62555
|
+
const sortedMeasure = definition.measures.find((measure) => measure.fieldName === definition.sortedColumn?.measure);
|
|
62556
|
+
if (sortedMeasure) {
|
|
62557
|
+
return {
|
|
62558
|
+
...definition,
|
|
62559
|
+
sortedColumn: {
|
|
62560
|
+
...definition.sortedColumn,
|
|
62561
|
+
measure: sortedMeasure.id,
|
|
62562
|
+
},
|
|
62563
|
+
};
|
|
62564
|
+
}
|
|
62565
|
+
}
|
|
62566
|
+
return definition;
|
|
62567
|
+
}
|
|
62491
62568
|
// ---------------------------------------------------------------------
|
|
62492
62569
|
// Import/Export
|
|
62493
62570
|
// ---------------------------------------------------------------------
|
|
@@ -71647,11 +71724,6 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
71647
71724
|
},
|
|
71648
71725
|
];
|
|
71649
71726
|
const sheetId = this.getActiveSheetId();
|
|
71650
|
-
const handler = new CellClipboardHandler(this.getters, this.dispatch);
|
|
71651
|
-
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
71652
|
-
if (!data) {
|
|
71653
|
-
return;
|
|
71654
|
-
}
|
|
71655
71727
|
const base = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
71656
71728
|
const pasteTarget = [
|
|
71657
71729
|
{
|
|
@@ -71661,7 +71733,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
71661
71733
|
bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
71662
71734
|
},
|
|
71663
71735
|
];
|
|
71664
|
-
|
|
71736
|
+
for (const Handler of clipboardHandlersRegistries.cellHandlers.getAll()) {
|
|
71737
|
+
const handler = new Handler(this.getters, this.dispatch);
|
|
71738
|
+
const data = handler.copy(getClipboardDataPositions(sheetId, target));
|
|
71739
|
+
if (!data) {
|
|
71740
|
+
continue;
|
|
71741
|
+
}
|
|
71742
|
+
handler.paste({ zones: pasteTarget, sheetId }, data, { isCutOperation: true });
|
|
71743
|
+
}
|
|
71665
71744
|
const selection = pasteTarget[0];
|
|
71666
71745
|
const col = selection.left;
|
|
71667
71746
|
const row = selection.top;
|
|
@@ -80515,6 +80594,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
80515
80594
|
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, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
80516
80595
|
|
|
80517
80596
|
|
|
80518
|
-
__info__.version = "18.3.
|
|
80519
|
-
__info__.date = "2025-
|
|
80520
|
-
__info__.hash = "
|
|
80597
|
+
__info__.version = "18.3.7";
|
|
80598
|
+
__info__.date = "2025-06-06T09:31:27.123Z";
|
|
80599
|
+
__info__.hash = "05333f1";
|