@odoo/o-spreadsheet 17.4.31 → 17.4.33
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 +73 -48
- package/dist/o-spreadsheet.d.ts +3 -1
- package/dist/o-spreadsheet.esm.js +73 -48
- package/dist/o-spreadsheet.iife.js +73 -48
- package/dist/o-spreadsheet.iife.min.js +9 -10
- package/dist/o_spreadsheet.xml +61 -54
- 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 17.4.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.33
|
|
6
|
+
* @date 2025-05-02T12:30:31.263Z
|
|
7
|
+
* @hash 3ba00e6
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -2362,6 +2362,7 @@ exports.CommandResult = void 0;
|
|
|
2362
2362
|
CommandResult["InvalidTableResize"] = "InvalidTableResize";
|
|
2363
2363
|
CommandResult["PivotIdNotFound"] = "PivotIdNotFound";
|
|
2364
2364
|
CommandResult["EmptyName"] = "EmptyName";
|
|
2365
|
+
CommandResult["InvalidPivotDataSet"] = "InvalidPivotDataSet";
|
|
2365
2366
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
2366
2367
|
|
|
2367
2368
|
const PLAIN_TEXT_FORMAT = "@"; // see OpenXML spec §18.8.31
|
|
@@ -10947,9 +10948,11 @@ const GAUGE_TITLE_PADDING_LEFT = DEFAULT_CHART_PADDING;
|
|
|
10947
10948
|
const GAUGE_TITLE_PADDING_TOP = DEFAULT_CHART_PADDING;
|
|
10948
10949
|
function drawGaugeChart(canvas, runtime) {
|
|
10949
10950
|
const canvasBoundingRect = canvas.getBoundingClientRect();
|
|
10950
|
-
|
|
10951
|
-
canvas.
|
|
10951
|
+
const dpr = window.devicePixelRatio || 1;
|
|
10952
|
+
canvas.width = dpr * canvasBoundingRect.width;
|
|
10953
|
+
canvas.height = dpr * canvasBoundingRect.height;
|
|
10952
10954
|
const ctx = canvas.getContext("2d");
|
|
10955
|
+
ctx.scale(dpr, dpr);
|
|
10953
10956
|
const config = getGaugeRenderingConfig(canvasBoundingRect, runtime, ctx);
|
|
10954
10957
|
drawBackground(ctx, config);
|
|
10955
10958
|
drawGauge(ctx, config);
|
|
@@ -11506,9 +11509,11 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
11506
11509
|
};
|
|
11507
11510
|
function drawScoreChart(structure, canvas) {
|
|
11508
11511
|
const ctx = canvas.getContext("2d");
|
|
11509
|
-
|
|
11510
|
-
|
|
11511
|
-
canvas.height = structure.canvas.height;
|
|
11512
|
+
const dpr = window.devicePixelRatio || 1;
|
|
11513
|
+
canvas.width = dpr * structure.canvas.width;
|
|
11514
|
+
canvas.height = dpr * structure.canvas.height;
|
|
11515
|
+
ctx.scale(dpr, dpr);
|
|
11516
|
+
const availableWidth = structure.canvas.width - DEFAULT_CHART_PADDING;
|
|
11512
11517
|
ctx.fillStyle = structure.canvas.backgroundColor;
|
|
11513
11518
|
ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
|
|
11514
11519
|
if (structure.title) {
|
|
@@ -12239,6 +12244,7 @@ class ChartJsComponent extends owl.Component {
|
|
|
12239
12244
|
canvas = owl.useRef("graphContainer");
|
|
12240
12245
|
chart;
|
|
12241
12246
|
currentRuntime;
|
|
12247
|
+
currentDevicePixelRatio = window.devicePixelRatio;
|
|
12242
12248
|
get background() {
|
|
12243
12249
|
return this.chartRuntime.background;
|
|
12244
12250
|
}
|
|
@@ -12272,6 +12278,10 @@ class ChartJsComponent extends owl.Component {
|
|
|
12272
12278
|
}
|
|
12273
12279
|
this.currentRuntime = runtime;
|
|
12274
12280
|
}
|
|
12281
|
+
else if (this.currentDevicePixelRatio !== window.devicePixelRatio) {
|
|
12282
|
+
this.currentDevicePixelRatio = window.devicePixelRatio;
|
|
12283
|
+
this.updateChartJs(deepCopy(this.currentRuntime));
|
|
12284
|
+
}
|
|
12275
12285
|
});
|
|
12276
12286
|
}
|
|
12277
12287
|
createChart(chartData) {
|
|
@@ -12314,7 +12324,7 @@ class ScorecardChart extends owl.Component {
|
|
|
12314
12324
|
owl.useEffect(this.createChart.bind(this), () => {
|
|
12315
12325
|
const canvas = this.canvas.el;
|
|
12316
12326
|
const rect = canvas.getBoundingClientRect();
|
|
12317
|
-
return [rect.width, rect.height, this.runtime, this.canvas.el];
|
|
12327
|
+
return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
|
|
12318
12328
|
});
|
|
12319
12329
|
}
|
|
12320
12330
|
createChart() {
|
|
@@ -22734,18 +22744,28 @@ linkMenuRegistry.add("sheet", {
|
|
|
22734
22744
|
function useInterval(callback, delay) {
|
|
22735
22745
|
let intervalId;
|
|
22736
22746
|
const { setInterval, clearInterval } = window;
|
|
22747
|
+
const pause = () => {
|
|
22748
|
+
clearInterval(intervalId);
|
|
22749
|
+
intervalId = undefined;
|
|
22750
|
+
};
|
|
22751
|
+
const safeCallback = () => {
|
|
22752
|
+
try {
|
|
22753
|
+
callback();
|
|
22754
|
+
}
|
|
22755
|
+
catch (e) {
|
|
22756
|
+
pause();
|
|
22757
|
+
throw e;
|
|
22758
|
+
}
|
|
22759
|
+
};
|
|
22737
22760
|
owl.useEffect(() => {
|
|
22738
|
-
intervalId = setInterval(
|
|
22761
|
+
intervalId = setInterval(safeCallback, delay);
|
|
22739
22762
|
return () => clearInterval(intervalId);
|
|
22740
22763
|
}, () => [delay]);
|
|
22741
22764
|
return {
|
|
22742
|
-
pause
|
|
22743
|
-
clearInterval(intervalId);
|
|
22744
|
-
intervalId = undefined;
|
|
22745
|
-
},
|
|
22765
|
+
pause,
|
|
22746
22766
|
resume: () => {
|
|
22747
22767
|
if (intervalId === undefined) {
|
|
22748
|
-
intervalId = setInterval(
|
|
22768
|
+
intervalId = setInterval(safeCallback, delay);
|
|
22749
22769
|
}
|
|
22750
22770
|
},
|
|
22751
22771
|
};
|
|
@@ -25203,7 +25223,7 @@ class GaugeChartComponent extends owl.Component {
|
|
|
25203
25223
|
owl.useEffect(() => drawGaugeChart(this.canvas.el, this.runtime), () => {
|
|
25204
25224
|
const canvas = this.canvas.el;
|
|
25205
25225
|
const rect = canvas.getBoundingClientRect();
|
|
25206
|
-
return [rect.width, rect.height, this.runtime, this.canvas.el];
|
|
25226
|
+
return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
|
|
25207
25227
|
});
|
|
25208
25228
|
}
|
|
25209
25229
|
}
|
|
@@ -25328,9 +25348,6 @@ class BarChart extends AbstractChart {
|
|
|
25328
25348
|
};
|
|
25329
25349
|
}
|
|
25330
25350
|
getDefinitionForExcel() {
|
|
25331
|
-
// Excel does not support aggregating labels
|
|
25332
|
-
if (this.aggregated)
|
|
25333
|
-
return undefined;
|
|
25334
25351
|
const dataSets = this.dataSets
|
|
25335
25352
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
25336
25353
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -26407,9 +26424,6 @@ class LineChart extends AbstractChart {
|
|
|
26407
26424
|
return new LineChart(definition, this.sheetId, this.getters);
|
|
26408
26425
|
}
|
|
26409
26426
|
getDefinitionForExcel() {
|
|
26410
|
-
// Excel does not support aggregating labels
|
|
26411
|
-
if (this.aggregated)
|
|
26412
|
-
return undefined;
|
|
26413
26427
|
const dataSets = this.dataSets
|
|
26414
26428
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
26415
26429
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -26520,9 +26534,6 @@ class PieChart extends AbstractChart {
|
|
|
26520
26534
|
return new PieChart(definition, sheetId, this.getters);
|
|
26521
26535
|
}
|
|
26522
26536
|
getDefinitionForExcel() {
|
|
26523
|
-
// Excel does not support aggregating labels
|
|
26524
|
-
if (this.aggregated)
|
|
26525
|
-
return undefined;
|
|
26526
26537
|
const dataSets = this.dataSets
|
|
26527
26538
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
26528
26539
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -32369,7 +32380,7 @@ class ColorPicker extends owl.Component {
|
|
|
32369
32380
|
}
|
|
32370
32381
|
setHexColor(ev) {
|
|
32371
32382
|
// only support HEX code input
|
|
32372
|
-
const val = ev.target.value.slice(0, 7);
|
|
32383
|
+
const val = ev.target.value.replace("##", "#").slice(0, 7);
|
|
32373
32384
|
this.state.customHexColor = val;
|
|
32374
32385
|
if (!isColorValid(val)) ;
|
|
32375
32386
|
else {
|
|
@@ -40992,7 +41003,7 @@ css /* scss */ `
|
|
|
40992
41003
|
position: absolute;
|
|
40993
41004
|
top: 0;
|
|
40994
41005
|
left: ${HEADER_WIDTH}px;
|
|
40995
|
-
right:
|
|
41006
|
+
right: ${SCROLLBAR_WIDTH}px;
|
|
40996
41007
|
height: ${HEADER_HEIGHT}px;
|
|
40997
41008
|
&.o-dragging {
|
|
40998
41009
|
cursor: grabbing;
|
|
@@ -41158,9 +41169,8 @@ css /* scss */ `
|
|
|
41158
41169
|
position: absolute;
|
|
41159
41170
|
top: ${HEADER_HEIGHT}px;
|
|
41160
41171
|
left: 0;
|
|
41161
|
-
|
|
41172
|
+
bottom: ${SCROLLBAR_WIDTH}px;
|
|
41162
41173
|
width: ${HEADER_WIDTH}px;
|
|
41163
|
-
height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px);
|
|
41164
41174
|
&.o-dragging {
|
|
41165
41175
|
cursor: grabbing;
|
|
41166
41176
|
}
|
|
@@ -53125,6 +53135,15 @@ function adaptPivotRange(range, applyChange) {
|
|
|
53125
53135
|
}
|
|
53126
53136
|
}
|
|
53127
53137
|
class SpreadsheetPivotCorePlugin extends CorePlugin {
|
|
53138
|
+
allowDispatch(cmd) {
|
|
53139
|
+
switch (cmd.type) {
|
|
53140
|
+
case "ADD_PIVOT":
|
|
53141
|
+
case "UPDATE_PIVOT":
|
|
53142
|
+
const definition = cmd.pivot;
|
|
53143
|
+
return this.checkDataSetValidity(definition);
|
|
53144
|
+
}
|
|
53145
|
+
return "Success" /* CommandResult.Success */;
|
|
53146
|
+
}
|
|
53128
53147
|
adaptRanges(applyChange) {
|
|
53129
53148
|
for (const pivotId of this.getters.getPivotIds()) {
|
|
53130
53149
|
const definition = this.getters.getPivotCoreDefinition(pivotId);
|
|
@@ -53143,6 +53162,16 @@ class SpreadsheetPivotCorePlugin extends CorePlugin {
|
|
|
53143
53162
|
}
|
|
53144
53163
|
}
|
|
53145
53164
|
}
|
|
53165
|
+
checkDataSetValidity(definition) {
|
|
53166
|
+
if (definition.type === "SPREADSHEET" && definition.dataSet) {
|
|
53167
|
+
const { zone, sheetId } = definition.dataSet;
|
|
53168
|
+
if (!sheetId || !this.getters.tryGetSheet(sheetId) || !zone || !isZoneValid(zone)) {
|
|
53169
|
+
return "InvalidDataSet" /* CommandResult.InvalidDataSet */;
|
|
53170
|
+
}
|
|
53171
|
+
return this.getters.checkZonesExistInSheet(sheetId, [zone]);
|
|
53172
|
+
}
|
|
53173
|
+
return "Success" /* CommandResult.Success */;
|
|
53174
|
+
}
|
|
53146
53175
|
}
|
|
53147
53176
|
|
|
53148
53177
|
class TableStylePlugin extends CorePlugin {
|
|
@@ -55978,7 +56007,7 @@ class DynamicTablesPlugin extends UIPlugin {
|
|
|
55978
56007
|
tables = {};
|
|
55979
56008
|
handle(cmd) {
|
|
55980
56009
|
if (invalidateEvaluationCommands.has(cmd.type) ||
|
|
55981
|
-
(cmd.type === "UPDATE_CELL" && "content" in cmd) ||
|
|
56010
|
+
(cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
|
|
55982
56011
|
cmd.type === "EVALUATE_CELLS") {
|
|
55983
56012
|
this.tables = {};
|
|
55984
56013
|
return;
|
|
@@ -59115,7 +59144,7 @@ class TableComputedStylePlugin extends UIPlugin {
|
|
|
59115
59144
|
tableStyles = {};
|
|
59116
59145
|
handle(cmd) {
|
|
59117
59146
|
if (invalidateEvaluationCommands.has(cmd.type) ||
|
|
59118
|
-
(cmd.type === "UPDATE_CELL" && "content" in cmd) ||
|
|
59147
|
+
(cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
|
|
59119
59148
|
cmd.type === "EVALUATE_CELLS") {
|
|
59120
59149
|
this.tableStyles = {};
|
|
59121
59150
|
return;
|
|
@@ -61086,6 +61115,8 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
61086
61115
|
});
|
|
61087
61116
|
this.selectCell(col, row);
|
|
61088
61117
|
}
|
|
61118
|
+
const { col, row } = this.gridSelection.anchor.cell;
|
|
61119
|
+
this.moveClient({ sheetId: this.activeSheet.id, col, row });
|
|
61089
61120
|
}
|
|
61090
61121
|
/**
|
|
61091
61122
|
* Ensure selections are not outside sheet boundaries.
|
|
@@ -61818,8 +61849,11 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
61818
61849
|
case "REMOVE_TABLE":
|
|
61819
61850
|
case "UPDATE_TABLE":
|
|
61820
61851
|
case "UPDATE_FILTER":
|
|
61821
|
-
|
|
61822
|
-
|
|
61852
|
+
case "UNFREEZE_ROWS":
|
|
61853
|
+
case "UNFREEZE_COLUMNS":
|
|
61854
|
+
case "FREEZE_COLUMNS":
|
|
61855
|
+
case "FREEZE_ROWS":
|
|
61856
|
+
case "UNFREEZE_COLUMNS_ROWS":
|
|
61823
61857
|
case "REMOVE_COLUMNS_ROWS":
|
|
61824
61858
|
case "RESIZE_COLUMNS_ROWS":
|
|
61825
61859
|
case "HIDE_COLUMNS_ROWS":
|
|
@@ -61832,11 +61866,9 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
61832
61866
|
case "FOLD_HEADER_GROUPS_IN_ZONE":
|
|
61833
61867
|
case "UNFOLD_HEADER_GROUPS_IN_ZONE":
|
|
61834
61868
|
case "UNFOLD_ALL_HEADER_GROUPS":
|
|
61835
|
-
case "FOLD_ALL_HEADER_GROUPS":
|
|
61836
|
-
|
|
61837
|
-
this.sheetsWithDirtyViewports.add(sheetId);
|
|
61869
|
+
case "FOLD_ALL_HEADER_GROUPS":
|
|
61870
|
+
this.sheetsWithDirtyViewports.add(cmd.sheetId);
|
|
61838
61871
|
break;
|
|
61839
|
-
}
|
|
61840
61872
|
case "UPDATE_CELL":
|
|
61841
61873
|
// update cell content or format can change hidden rows because of data filters
|
|
61842
61874
|
if ("content" in cmd || "format" in cmd || cmd.style?.fontSize !== undefined) {
|
|
@@ -61852,13 +61884,6 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
61852
61884
|
case "ACTIVATE_SHEET":
|
|
61853
61885
|
this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
|
|
61854
61886
|
break;
|
|
61855
|
-
case "UNFREEZE_ROWS":
|
|
61856
|
-
case "UNFREEZE_COLUMNS":
|
|
61857
|
-
case "FREEZE_COLUMNS":
|
|
61858
|
-
case "FREEZE_ROWS":
|
|
61859
|
-
case "UNFREEZE_COLUMNS_ROWS":
|
|
61860
|
-
this.resetViewports(this.getters.getActiveSheetId());
|
|
61861
|
-
break;
|
|
61862
61887
|
case "DELETE_SHEET":
|
|
61863
61888
|
this.sheetsWithDirtyViewports.delete(cmd.sheetId);
|
|
61864
61889
|
break;
|
|
@@ -63014,7 +63039,7 @@ class AggregateStatisticsStore extends SpreadsheetStore {
|
|
|
63014
63039
|
}
|
|
63015
63040
|
handle(cmd) {
|
|
63016
63041
|
if (invalidateEvaluationCommands.has(cmd.type) ||
|
|
63017
|
-
(cmd.type === "UPDATE_CELL" && "content" in cmd)) {
|
|
63042
|
+
(cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd))) {
|
|
63018
63043
|
this.isDirty = true;
|
|
63019
63044
|
}
|
|
63020
63045
|
switch (cmd.type) {
|
|
@@ -69381,6 +69406,6 @@ exports.tokenColors = tokenColors;
|
|
|
69381
69406
|
exports.tokenize = tokenize;
|
|
69382
69407
|
|
|
69383
69408
|
|
|
69384
|
-
__info__.version = "17.4.
|
|
69385
|
-
__info__.date = "2025-
|
|
69386
|
-
__info__.hash = "
|
|
69409
|
+
__info__.version = "17.4.33";
|
|
69410
|
+
__info__.date = "2025-05-02T12:30:31.263Z";
|
|
69411
|
+
__info__.hash = "3ba00e6";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1462,7 +1462,8 @@ declare const enum CommandResult {
|
|
|
1462
1462
|
SheetIsHidden = "SheetIsHidden",
|
|
1463
1463
|
InvalidTableResize = "InvalidTableResize",
|
|
1464
1464
|
PivotIdNotFound = "PivotIdNotFound",
|
|
1465
|
-
EmptyName = "EmptyName"
|
|
1465
|
+
EmptyName = "EmptyName",
|
|
1466
|
+
InvalidPivotDataSet = "InvalidPivotDataSet"
|
|
1466
1467
|
}
|
|
1467
1468
|
interface CommandHandler<T> {
|
|
1468
1469
|
allowDispatch(command: T): CommandResult | CommandResult[];
|
|
@@ -7989,6 +7990,7 @@ declare class ChartJsComponent extends Component<Props$J, SpreadsheetChildEnv> {
|
|
|
7989
7990
|
private canvas;
|
|
7990
7991
|
private chart?;
|
|
7991
7992
|
private currentRuntime;
|
|
7993
|
+
private currentDevicePixelRatio;
|
|
7992
7994
|
get background(): string;
|
|
7993
7995
|
get canvasStyle(): string;
|
|
7994
7996
|
get chartRuntime(): ChartJSRuntime;
|
|
@@ -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 17.4.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.33
|
|
6
|
+
* @date 2025-05-02T12:30:31.263Z
|
|
7
|
+
* @hash 3ba00e6
|
|
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';
|
|
@@ -2360,6 +2360,7 @@ var CommandResult;
|
|
|
2360
2360
|
CommandResult["InvalidTableResize"] = "InvalidTableResize";
|
|
2361
2361
|
CommandResult["PivotIdNotFound"] = "PivotIdNotFound";
|
|
2362
2362
|
CommandResult["EmptyName"] = "EmptyName";
|
|
2363
|
+
CommandResult["InvalidPivotDataSet"] = "InvalidPivotDataSet";
|
|
2363
2364
|
})(CommandResult || (CommandResult = {}));
|
|
2364
2365
|
|
|
2365
2366
|
const PLAIN_TEXT_FORMAT = "@"; // see OpenXML spec §18.8.31
|
|
@@ -10945,9 +10946,11 @@ const GAUGE_TITLE_PADDING_LEFT = DEFAULT_CHART_PADDING;
|
|
|
10945
10946
|
const GAUGE_TITLE_PADDING_TOP = DEFAULT_CHART_PADDING;
|
|
10946
10947
|
function drawGaugeChart(canvas, runtime) {
|
|
10947
10948
|
const canvasBoundingRect = canvas.getBoundingClientRect();
|
|
10948
|
-
|
|
10949
|
-
canvas.
|
|
10949
|
+
const dpr = window.devicePixelRatio || 1;
|
|
10950
|
+
canvas.width = dpr * canvasBoundingRect.width;
|
|
10951
|
+
canvas.height = dpr * canvasBoundingRect.height;
|
|
10950
10952
|
const ctx = canvas.getContext("2d");
|
|
10953
|
+
ctx.scale(dpr, dpr);
|
|
10951
10954
|
const config = getGaugeRenderingConfig(canvasBoundingRect, runtime, ctx);
|
|
10952
10955
|
drawBackground(ctx, config);
|
|
10953
10956
|
drawGauge(ctx, config);
|
|
@@ -11504,9 +11507,11 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
|
|
|
11504
11507
|
};
|
|
11505
11508
|
function drawScoreChart(structure, canvas) {
|
|
11506
11509
|
const ctx = canvas.getContext("2d");
|
|
11507
|
-
|
|
11508
|
-
|
|
11509
|
-
canvas.height = structure.canvas.height;
|
|
11510
|
+
const dpr = window.devicePixelRatio || 1;
|
|
11511
|
+
canvas.width = dpr * structure.canvas.width;
|
|
11512
|
+
canvas.height = dpr * structure.canvas.height;
|
|
11513
|
+
ctx.scale(dpr, dpr);
|
|
11514
|
+
const availableWidth = structure.canvas.width - DEFAULT_CHART_PADDING;
|
|
11510
11515
|
ctx.fillStyle = structure.canvas.backgroundColor;
|
|
11511
11516
|
ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
|
|
11512
11517
|
if (structure.title) {
|
|
@@ -12237,6 +12242,7 @@ class ChartJsComponent extends Component {
|
|
|
12237
12242
|
canvas = useRef("graphContainer");
|
|
12238
12243
|
chart;
|
|
12239
12244
|
currentRuntime;
|
|
12245
|
+
currentDevicePixelRatio = window.devicePixelRatio;
|
|
12240
12246
|
get background() {
|
|
12241
12247
|
return this.chartRuntime.background;
|
|
12242
12248
|
}
|
|
@@ -12270,6 +12276,10 @@ class ChartJsComponent extends Component {
|
|
|
12270
12276
|
}
|
|
12271
12277
|
this.currentRuntime = runtime;
|
|
12272
12278
|
}
|
|
12279
|
+
else if (this.currentDevicePixelRatio !== window.devicePixelRatio) {
|
|
12280
|
+
this.currentDevicePixelRatio = window.devicePixelRatio;
|
|
12281
|
+
this.updateChartJs(deepCopy(this.currentRuntime));
|
|
12282
|
+
}
|
|
12273
12283
|
});
|
|
12274
12284
|
}
|
|
12275
12285
|
createChart(chartData) {
|
|
@@ -12312,7 +12322,7 @@ class ScorecardChart extends Component {
|
|
|
12312
12322
|
useEffect(this.createChart.bind(this), () => {
|
|
12313
12323
|
const canvas = this.canvas.el;
|
|
12314
12324
|
const rect = canvas.getBoundingClientRect();
|
|
12315
|
-
return [rect.width, rect.height, this.runtime, this.canvas.el];
|
|
12325
|
+
return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
|
|
12316
12326
|
});
|
|
12317
12327
|
}
|
|
12318
12328
|
createChart() {
|
|
@@ -22732,18 +22742,28 @@ linkMenuRegistry.add("sheet", {
|
|
|
22732
22742
|
function useInterval(callback, delay) {
|
|
22733
22743
|
let intervalId;
|
|
22734
22744
|
const { setInterval, clearInterval } = window;
|
|
22745
|
+
const pause = () => {
|
|
22746
|
+
clearInterval(intervalId);
|
|
22747
|
+
intervalId = undefined;
|
|
22748
|
+
};
|
|
22749
|
+
const safeCallback = () => {
|
|
22750
|
+
try {
|
|
22751
|
+
callback();
|
|
22752
|
+
}
|
|
22753
|
+
catch (e) {
|
|
22754
|
+
pause();
|
|
22755
|
+
throw e;
|
|
22756
|
+
}
|
|
22757
|
+
};
|
|
22735
22758
|
useEffect(() => {
|
|
22736
|
-
intervalId = setInterval(
|
|
22759
|
+
intervalId = setInterval(safeCallback, delay);
|
|
22737
22760
|
return () => clearInterval(intervalId);
|
|
22738
22761
|
}, () => [delay]);
|
|
22739
22762
|
return {
|
|
22740
|
-
pause
|
|
22741
|
-
clearInterval(intervalId);
|
|
22742
|
-
intervalId = undefined;
|
|
22743
|
-
},
|
|
22763
|
+
pause,
|
|
22744
22764
|
resume: () => {
|
|
22745
22765
|
if (intervalId === undefined) {
|
|
22746
|
-
intervalId = setInterval(
|
|
22766
|
+
intervalId = setInterval(safeCallback, delay);
|
|
22747
22767
|
}
|
|
22748
22768
|
},
|
|
22749
22769
|
};
|
|
@@ -25201,7 +25221,7 @@ class GaugeChartComponent extends Component {
|
|
|
25201
25221
|
useEffect(() => drawGaugeChart(this.canvas.el, this.runtime), () => {
|
|
25202
25222
|
const canvas = this.canvas.el;
|
|
25203
25223
|
const rect = canvas.getBoundingClientRect();
|
|
25204
|
-
return [rect.width, rect.height, this.runtime, this.canvas.el];
|
|
25224
|
+
return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
|
|
25205
25225
|
});
|
|
25206
25226
|
}
|
|
25207
25227
|
}
|
|
@@ -25326,9 +25346,6 @@ class BarChart extends AbstractChart {
|
|
|
25326
25346
|
};
|
|
25327
25347
|
}
|
|
25328
25348
|
getDefinitionForExcel() {
|
|
25329
|
-
// Excel does not support aggregating labels
|
|
25330
|
-
if (this.aggregated)
|
|
25331
|
-
return undefined;
|
|
25332
25349
|
const dataSets = this.dataSets
|
|
25333
25350
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
25334
25351
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -26405,9 +26422,6 @@ class LineChart extends AbstractChart {
|
|
|
26405
26422
|
return new LineChart(definition, this.sheetId, this.getters);
|
|
26406
26423
|
}
|
|
26407
26424
|
getDefinitionForExcel() {
|
|
26408
|
-
// Excel does not support aggregating labels
|
|
26409
|
-
if (this.aggregated)
|
|
26410
|
-
return undefined;
|
|
26411
26425
|
const dataSets = this.dataSets
|
|
26412
26426
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
26413
26427
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -26518,9 +26532,6 @@ class PieChart extends AbstractChart {
|
|
|
26518
26532
|
return new PieChart(definition, sheetId, this.getters);
|
|
26519
26533
|
}
|
|
26520
26534
|
getDefinitionForExcel() {
|
|
26521
|
-
// Excel does not support aggregating labels
|
|
26522
|
-
if (this.aggregated)
|
|
26523
|
-
return undefined;
|
|
26524
26535
|
const dataSets = this.dataSets
|
|
26525
26536
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
26526
26537
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -32367,7 +32378,7 @@ class ColorPicker extends Component {
|
|
|
32367
32378
|
}
|
|
32368
32379
|
setHexColor(ev) {
|
|
32369
32380
|
// only support HEX code input
|
|
32370
|
-
const val = ev.target.value.slice(0, 7);
|
|
32381
|
+
const val = ev.target.value.replace("##", "#").slice(0, 7);
|
|
32371
32382
|
this.state.customHexColor = val;
|
|
32372
32383
|
if (!isColorValid(val)) ;
|
|
32373
32384
|
else {
|
|
@@ -40990,7 +41001,7 @@ css /* scss */ `
|
|
|
40990
41001
|
position: absolute;
|
|
40991
41002
|
top: 0;
|
|
40992
41003
|
left: ${HEADER_WIDTH}px;
|
|
40993
|
-
right:
|
|
41004
|
+
right: ${SCROLLBAR_WIDTH}px;
|
|
40994
41005
|
height: ${HEADER_HEIGHT}px;
|
|
40995
41006
|
&.o-dragging {
|
|
40996
41007
|
cursor: grabbing;
|
|
@@ -41156,9 +41167,8 @@ css /* scss */ `
|
|
|
41156
41167
|
position: absolute;
|
|
41157
41168
|
top: ${HEADER_HEIGHT}px;
|
|
41158
41169
|
left: 0;
|
|
41159
|
-
|
|
41170
|
+
bottom: ${SCROLLBAR_WIDTH}px;
|
|
41160
41171
|
width: ${HEADER_WIDTH}px;
|
|
41161
|
-
height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px);
|
|
41162
41172
|
&.o-dragging {
|
|
41163
41173
|
cursor: grabbing;
|
|
41164
41174
|
}
|
|
@@ -53123,6 +53133,15 @@ function adaptPivotRange(range, applyChange) {
|
|
|
53123
53133
|
}
|
|
53124
53134
|
}
|
|
53125
53135
|
class SpreadsheetPivotCorePlugin extends CorePlugin {
|
|
53136
|
+
allowDispatch(cmd) {
|
|
53137
|
+
switch (cmd.type) {
|
|
53138
|
+
case "ADD_PIVOT":
|
|
53139
|
+
case "UPDATE_PIVOT":
|
|
53140
|
+
const definition = cmd.pivot;
|
|
53141
|
+
return this.checkDataSetValidity(definition);
|
|
53142
|
+
}
|
|
53143
|
+
return "Success" /* CommandResult.Success */;
|
|
53144
|
+
}
|
|
53126
53145
|
adaptRanges(applyChange) {
|
|
53127
53146
|
for (const pivotId of this.getters.getPivotIds()) {
|
|
53128
53147
|
const definition = this.getters.getPivotCoreDefinition(pivotId);
|
|
@@ -53141,6 +53160,16 @@ class SpreadsheetPivotCorePlugin extends CorePlugin {
|
|
|
53141
53160
|
}
|
|
53142
53161
|
}
|
|
53143
53162
|
}
|
|
53163
|
+
checkDataSetValidity(definition) {
|
|
53164
|
+
if (definition.type === "SPREADSHEET" && definition.dataSet) {
|
|
53165
|
+
const { zone, sheetId } = definition.dataSet;
|
|
53166
|
+
if (!sheetId || !this.getters.tryGetSheet(sheetId) || !zone || !isZoneValid(zone)) {
|
|
53167
|
+
return "InvalidDataSet" /* CommandResult.InvalidDataSet */;
|
|
53168
|
+
}
|
|
53169
|
+
return this.getters.checkZonesExistInSheet(sheetId, [zone]);
|
|
53170
|
+
}
|
|
53171
|
+
return "Success" /* CommandResult.Success */;
|
|
53172
|
+
}
|
|
53144
53173
|
}
|
|
53145
53174
|
|
|
53146
53175
|
class TableStylePlugin extends CorePlugin {
|
|
@@ -55976,7 +56005,7 @@ class DynamicTablesPlugin extends UIPlugin {
|
|
|
55976
56005
|
tables = {};
|
|
55977
56006
|
handle(cmd) {
|
|
55978
56007
|
if (invalidateEvaluationCommands.has(cmd.type) ||
|
|
55979
|
-
(cmd.type === "UPDATE_CELL" && "content" in cmd) ||
|
|
56008
|
+
(cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
|
|
55980
56009
|
cmd.type === "EVALUATE_CELLS") {
|
|
55981
56010
|
this.tables = {};
|
|
55982
56011
|
return;
|
|
@@ -59113,7 +59142,7 @@ class TableComputedStylePlugin extends UIPlugin {
|
|
|
59113
59142
|
tableStyles = {};
|
|
59114
59143
|
handle(cmd) {
|
|
59115
59144
|
if (invalidateEvaluationCommands.has(cmd.type) ||
|
|
59116
|
-
(cmd.type === "UPDATE_CELL" && "content" in cmd) ||
|
|
59145
|
+
(cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd)) ||
|
|
59117
59146
|
cmd.type === "EVALUATE_CELLS") {
|
|
59118
59147
|
this.tableStyles = {};
|
|
59119
59148
|
return;
|
|
@@ -61084,6 +61113,8 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
61084
61113
|
});
|
|
61085
61114
|
this.selectCell(col, row);
|
|
61086
61115
|
}
|
|
61116
|
+
const { col, row } = this.gridSelection.anchor.cell;
|
|
61117
|
+
this.moveClient({ sheetId: this.activeSheet.id, col, row });
|
|
61087
61118
|
}
|
|
61088
61119
|
/**
|
|
61089
61120
|
* Ensure selections are not outside sheet boundaries.
|
|
@@ -61816,8 +61847,11 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
61816
61847
|
case "REMOVE_TABLE":
|
|
61817
61848
|
case "UPDATE_TABLE":
|
|
61818
61849
|
case "UPDATE_FILTER":
|
|
61819
|
-
|
|
61820
|
-
|
|
61850
|
+
case "UNFREEZE_ROWS":
|
|
61851
|
+
case "UNFREEZE_COLUMNS":
|
|
61852
|
+
case "FREEZE_COLUMNS":
|
|
61853
|
+
case "FREEZE_ROWS":
|
|
61854
|
+
case "UNFREEZE_COLUMNS_ROWS":
|
|
61821
61855
|
case "REMOVE_COLUMNS_ROWS":
|
|
61822
61856
|
case "RESIZE_COLUMNS_ROWS":
|
|
61823
61857
|
case "HIDE_COLUMNS_ROWS":
|
|
@@ -61830,11 +61864,9 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
61830
61864
|
case "FOLD_HEADER_GROUPS_IN_ZONE":
|
|
61831
61865
|
case "UNFOLD_HEADER_GROUPS_IN_ZONE":
|
|
61832
61866
|
case "UNFOLD_ALL_HEADER_GROUPS":
|
|
61833
|
-
case "FOLD_ALL_HEADER_GROUPS":
|
|
61834
|
-
|
|
61835
|
-
this.sheetsWithDirtyViewports.add(sheetId);
|
|
61867
|
+
case "FOLD_ALL_HEADER_GROUPS":
|
|
61868
|
+
this.sheetsWithDirtyViewports.add(cmd.sheetId);
|
|
61836
61869
|
break;
|
|
61837
|
-
}
|
|
61838
61870
|
case "UPDATE_CELL":
|
|
61839
61871
|
// update cell content or format can change hidden rows because of data filters
|
|
61840
61872
|
if ("content" in cmd || "format" in cmd || cmd.style?.fontSize !== undefined) {
|
|
@@ -61850,13 +61882,6 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
61850
61882
|
case "ACTIVATE_SHEET":
|
|
61851
61883
|
this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
|
|
61852
61884
|
break;
|
|
61853
|
-
case "UNFREEZE_ROWS":
|
|
61854
|
-
case "UNFREEZE_COLUMNS":
|
|
61855
|
-
case "FREEZE_COLUMNS":
|
|
61856
|
-
case "FREEZE_ROWS":
|
|
61857
|
-
case "UNFREEZE_COLUMNS_ROWS":
|
|
61858
|
-
this.resetViewports(this.getters.getActiveSheetId());
|
|
61859
|
-
break;
|
|
61860
61885
|
case "DELETE_SHEET":
|
|
61861
61886
|
this.sheetsWithDirtyViewports.delete(cmd.sheetId);
|
|
61862
61887
|
break;
|
|
@@ -63012,7 +63037,7 @@ class AggregateStatisticsStore extends SpreadsheetStore {
|
|
|
63012
63037
|
}
|
|
63013
63038
|
handle(cmd) {
|
|
63014
63039
|
if (invalidateEvaluationCommands.has(cmd.type) ||
|
|
63015
|
-
(cmd.type === "UPDATE_CELL" && "content" in cmd)) {
|
|
63040
|
+
(cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd))) {
|
|
63016
63041
|
this.isDirty = true;
|
|
63017
63042
|
}
|
|
63018
63043
|
switch (cmd.type) {
|
|
@@ -69336,6 +69361,6 @@ const constants = {
|
|
|
69336
69361
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, 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 };
|
|
69337
69362
|
|
|
69338
69363
|
|
|
69339
|
-
__info__.version = "17.4.
|
|
69340
|
-
__info__.date = "2025-
|
|
69341
|
-
__info__.hash = "
|
|
69364
|
+
__info__.version = "17.4.33";
|
|
69365
|
+
__info__.date = "2025-05-02T12:30:31.263Z";
|
|
69366
|
+
__info__.hash = "3ba00e6";
|