@odoo/o-spreadsheet 18.0.1 → 18.0.2
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 +182 -131
- package/dist/o-spreadsheet.d.ts +26 -12
- package/dist/o-spreadsheet.esm.js +182 -131
- package/dist/o-spreadsheet.iife.js +182 -131
- package/dist/o-spreadsheet.iife.min.js +341 -340
- package/dist/o_spreadsheet.xml +36 -30
- 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.0.
|
|
6
|
-
* @date 2024-10-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.2
|
|
6
|
+
* @date 2024-10-24T08:54:21.934Z
|
|
7
|
+
* @hash 788df92
|
|
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';
|
|
@@ -374,7 +374,7 @@ const PIVOT_TABLE_CONFIG = {
|
|
|
374
374
|
bandedRows: true,
|
|
375
375
|
bandedColumns: false,
|
|
376
376
|
styleId: "TableStyleMedium5",
|
|
377
|
-
automaticAutofill:
|
|
377
|
+
automaticAutofill: false,
|
|
378
378
|
};
|
|
379
379
|
const DEFAULT_CURRENCY = {
|
|
380
380
|
symbol: "$",
|
|
@@ -9409,70 +9409,114 @@ const chartShowValuesPlugin = {
|
|
|
9409
9409
|
ctx.save();
|
|
9410
9410
|
ctx.textAlign = "center";
|
|
9411
9411
|
ctx.textBaseline = "middle";
|
|
9412
|
-
ctx.
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
const midRadius = (innerRadius + outerRadius) / 2;
|
|
9426
|
-
const x = bar.x + midRadius * Math.cos(midAngle);
|
|
9427
|
-
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
9428
|
-
ctx.fillStyle = chartFontColor(bar.options.backgroundColor);
|
|
9429
|
-
ctx.strokeStyle = chartFontColor(ctx.fillStyle);
|
|
9430
|
-
const value = options.callback(dataset._parsed[i]);
|
|
9431
|
-
ctx.strokeText(value, x, y);
|
|
9432
|
-
ctx.fillText(value, x, y);
|
|
9433
|
-
}
|
|
9434
|
-
break;
|
|
9435
|
-
}
|
|
9436
|
-
case "bar":
|
|
9437
|
-
case "line": {
|
|
9438
|
-
const yOffset = dataset.type === "bar" && !options.horizontal ? 0 : 3;
|
|
9439
|
-
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
9440
|
-
const point = dataset.data[i];
|
|
9441
|
-
const value = options.horizontal ? dataset._parsed[i].x : dataset._parsed[i].y;
|
|
9442
|
-
const displayedValue = options.callback(value - 0);
|
|
9443
|
-
let xPosition = 0, yPosition = 0;
|
|
9444
|
-
if (options.horizontal) {
|
|
9445
|
-
yPosition = point.y;
|
|
9446
|
-
if (value < 0) {
|
|
9447
|
-
ctx.textAlign = "right";
|
|
9448
|
-
xPosition = point.x - yOffset;
|
|
9449
|
-
}
|
|
9450
|
-
else {
|
|
9451
|
-
ctx.textAlign = "left";
|
|
9452
|
-
xPosition = point.x + yOffset;
|
|
9453
|
-
}
|
|
9454
|
-
}
|
|
9455
|
-
else {
|
|
9456
|
-
xPosition = point.x;
|
|
9457
|
-
if (value < 0) {
|
|
9458
|
-
ctx.textBaseline = "top";
|
|
9459
|
-
yPosition = point.y + yOffset;
|
|
9460
|
-
}
|
|
9461
|
-
else {
|
|
9462
|
-
ctx.textBaseline = "bottom";
|
|
9463
|
-
yPosition = point.y - yOffset;
|
|
9464
|
-
}
|
|
9465
|
-
}
|
|
9466
|
-
ctx.strokeText(displayedValue, xPosition, yPosition);
|
|
9467
|
-
ctx.fillText(displayedValue, xPosition, yPosition);
|
|
9468
|
-
}
|
|
9469
|
-
break;
|
|
9470
|
-
}
|
|
9471
|
-
}
|
|
9472
|
-
});
|
|
9412
|
+
ctx.miterLimit = 1; // Avoid sharp artifacts on strokeText
|
|
9413
|
+
switch (chart.config.type) {
|
|
9414
|
+
case "pie":
|
|
9415
|
+
case "doughnut":
|
|
9416
|
+
drawPieChartValues(chart, options, ctx);
|
|
9417
|
+
break;
|
|
9418
|
+
case "bar":
|
|
9419
|
+
case "line":
|
|
9420
|
+
options.horizontal
|
|
9421
|
+
? drawHorizontalBarChartValues(chart, options, ctx)
|
|
9422
|
+
: drawLineOrBarChartValues(chart, options, ctx);
|
|
9423
|
+
break;
|
|
9424
|
+
}
|
|
9473
9425
|
ctx.restore();
|
|
9474
9426
|
},
|
|
9475
9427
|
};
|
|
9428
|
+
function drawTextWithBackground(text, x, y, ctx) {
|
|
9429
|
+
ctx.lineWidth = 3; // Stroke the text with a big lineWidth width to have some kind of background
|
|
9430
|
+
ctx.strokeText(text, x, y);
|
|
9431
|
+
ctx.lineWidth = 1;
|
|
9432
|
+
ctx.fillText(text, x, y);
|
|
9433
|
+
}
|
|
9434
|
+
function drawLineOrBarChartValues(chart, options, ctx) {
|
|
9435
|
+
const yMax = chart.chartArea.bottom;
|
|
9436
|
+
const yMin = chart.chartArea.top;
|
|
9437
|
+
const textsPositions = {};
|
|
9438
|
+
for (const dataset of chart._metasets) {
|
|
9439
|
+
if (dataset.xAxisID === TREND_LINE_XAXIS_ID) {
|
|
9440
|
+
return; // ignore trend lines
|
|
9441
|
+
}
|
|
9442
|
+
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
9443
|
+
const value = dataset._parsed[i].y;
|
|
9444
|
+
const point = dataset.data[i];
|
|
9445
|
+
const xPosition = point.x;
|
|
9446
|
+
let yPosition = 0;
|
|
9447
|
+
if (chart.config.type === "line") {
|
|
9448
|
+
yPosition = point.y - 10;
|
|
9449
|
+
}
|
|
9450
|
+
else {
|
|
9451
|
+
yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
|
|
9452
|
+
}
|
|
9453
|
+
yPosition = Math.min(yPosition, yMax);
|
|
9454
|
+
yPosition = Math.max(yPosition, yMin);
|
|
9455
|
+
// Avoid overlapping texts with same X
|
|
9456
|
+
if (!textsPositions[xPosition]) {
|
|
9457
|
+
textsPositions[xPosition] = [];
|
|
9458
|
+
}
|
|
9459
|
+
for (const otherPosition of textsPositions[xPosition] || []) {
|
|
9460
|
+
if (Math.abs(otherPosition - yPosition) < 13) {
|
|
9461
|
+
yPosition = otherPosition - 13;
|
|
9462
|
+
}
|
|
9463
|
+
}
|
|
9464
|
+
textsPositions[xPosition].push(yPosition);
|
|
9465
|
+
ctx.fillStyle = point.options.backgroundColor;
|
|
9466
|
+
ctx.strokeStyle = options.background || "#ffffff";
|
|
9467
|
+
drawTextWithBackground(options.callback(value - 0), xPosition, yPosition, ctx);
|
|
9468
|
+
}
|
|
9469
|
+
}
|
|
9470
|
+
}
|
|
9471
|
+
function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
9472
|
+
const xMax = chart.chartArea.right;
|
|
9473
|
+
const xMin = chart.chartArea.left;
|
|
9474
|
+
const textsPositions = {};
|
|
9475
|
+
for (const dataset of chart._metasets) {
|
|
9476
|
+
if (dataset.xAxisID === TREND_LINE_XAXIS_ID) {
|
|
9477
|
+
return; // ignore trend lines
|
|
9478
|
+
}
|
|
9479
|
+
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
9480
|
+
const value = dataset._parsed[i].x;
|
|
9481
|
+
const displayValue = options.callback(value - 0);
|
|
9482
|
+
const point = dataset.data[i];
|
|
9483
|
+
const yPosition = point.y;
|
|
9484
|
+
let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
|
|
9485
|
+
xPosition = Math.min(xPosition, xMax);
|
|
9486
|
+
xPosition = Math.max(xPosition, xMin);
|
|
9487
|
+
// Avoid overlapping texts with same Y
|
|
9488
|
+
if (!textsPositions[yPosition]) {
|
|
9489
|
+
textsPositions[yPosition] = [];
|
|
9490
|
+
}
|
|
9491
|
+
const textWidth = computeTextWidth(ctx, displayValue, { fontSize: 12 }, "px");
|
|
9492
|
+
for (const otherPosition of textsPositions[yPosition]) {
|
|
9493
|
+
if (Math.abs(otherPosition - xPosition) < textWidth) {
|
|
9494
|
+
xPosition = otherPosition + textWidth + 3;
|
|
9495
|
+
}
|
|
9496
|
+
}
|
|
9497
|
+
textsPositions[yPosition].push(xPosition);
|
|
9498
|
+
ctx.fillStyle = point.options.backgroundColor;
|
|
9499
|
+
ctx.strokeStyle = options.background || "#ffffff";
|
|
9500
|
+
drawTextWithBackground(displayValue, xPosition, yPosition, ctx);
|
|
9501
|
+
}
|
|
9502
|
+
}
|
|
9503
|
+
}
|
|
9504
|
+
function drawPieChartValues(chart, options, ctx) {
|
|
9505
|
+
for (const dataset of chart._metasets) {
|
|
9506
|
+
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
9507
|
+
const bar = dataset.data[i];
|
|
9508
|
+
const { startAngle, endAngle, innerRadius, outerRadius } = bar;
|
|
9509
|
+
const midAngle = (startAngle + endAngle) / 2;
|
|
9510
|
+
const midRadius = (innerRadius + outerRadius) / 2;
|
|
9511
|
+
const x = bar.x + midRadius * Math.cos(midAngle);
|
|
9512
|
+
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
9513
|
+
ctx.fillStyle = chartFontColor(options.background);
|
|
9514
|
+
ctx.strokeStyle = options.background || "#ffffff";
|
|
9515
|
+
const value = options.callback(dataset._parsed[i]);
|
|
9516
|
+
drawTextWithBackground(value, x, y, ctx);
|
|
9517
|
+
}
|
|
9518
|
+
}
|
|
9519
|
+
}
|
|
9476
9520
|
|
|
9477
9521
|
/** This is a chartJS plugin that will draw connector lines between the bars of a Waterfall chart */
|
|
9478
9522
|
const waterfallLinesPlugin = {
|
|
@@ -21735,9 +21779,13 @@ autoCompleteProviders.add("pivot_group_fields", {
|
|
|
21735
21779
|
const colFields = columns.map((groupBy) => groupBy.nameWithGranularity);
|
|
21736
21780
|
const rowFields = rows.map((groupBy) => groupBy.nameWithGranularity);
|
|
21737
21781
|
const proposals = [];
|
|
21738
|
-
|
|
21782
|
+
let previousGroupBy = ["ARG_SEPARATOR", "SPACE"].includes(tokenAtCursor.type)
|
|
21739
21783
|
? argGroupBys.at(-1)
|
|
21740
21784
|
: argGroupBys.at(-2);
|
|
21785
|
+
const isPositionalSupported = supportedPivotPositionalFormulaRegistry.get(pivot.type);
|
|
21786
|
+
if (isPositionalSupported && previousGroupBy?.startsWith("#")) {
|
|
21787
|
+
previousGroupBy = previousGroupBy.slice(1);
|
|
21788
|
+
}
|
|
21741
21789
|
if (previousGroupBy === undefined) {
|
|
21742
21790
|
proposals.push(colFields[0]);
|
|
21743
21791
|
proposals.push(rowFields[0]);
|
|
@@ -21759,7 +21807,7 @@ autoCompleteProviders.add("pivot_group_fields", {
|
|
|
21759
21807
|
return field ? makeFieldProposal(field, granularity) : undefined;
|
|
21760
21808
|
})
|
|
21761
21809
|
.concat(groupBys.map((groupBy) => {
|
|
21762
|
-
if (!
|
|
21810
|
+
if (!isPositionalSupported) {
|
|
21763
21811
|
return undefined;
|
|
21764
21812
|
}
|
|
21765
21813
|
const fieldName = groupBy.split(":")[0];
|
|
@@ -27455,7 +27503,7 @@ function load(data, verboseImport) {
|
|
|
27455
27503
|
if (!data) {
|
|
27456
27504
|
return createEmptyWorkbookData();
|
|
27457
27505
|
}
|
|
27458
|
-
console.
|
|
27506
|
+
console.debug("### Loading data ###");
|
|
27459
27507
|
const start = performance.now();
|
|
27460
27508
|
if (data["[Content_Types].xml"]) {
|
|
27461
27509
|
const reader = new XlsxReader(data);
|
|
@@ -27469,13 +27517,13 @@ function load(data, verboseImport) {
|
|
|
27469
27517
|
// apply migrations, if needed
|
|
27470
27518
|
if ("version" in data) {
|
|
27471
27519
|
if (data.version < CURRENT_VERSION) {
|
|
27472
|
-
console.
|
|
27520
|
+
console.debug("Migrating data from version", data.version);
|
|
27473
27521
|
data = migrate(data);
|
|
27474
27522
|
}
|
|
27475
27523
|
}
|
|
27476
27524
|
data = repairData(data);
|
|
27477
|
-
console.
|
|
27478
|
-
console.
|
|
27525
|
+
console.debug("Data loaded in", performance.now() - start, "ms");
|
|
27526
|
+
console.debug("###");
|
|
27479
27527
|
return data;
|
|
27480
27528
|
}
|
|
27481
27529
|
// -----------------------------------------------------------------------------
|
|
@@ -27505,7 +27553,7 @@ function migrate(data) {
|
|
|
27505
27553
|
for (let i = index; i < steps.length; i++) {
|
|
27506
27554
|
data = steps[i].migrate(data);
|
|
27507
27555
|
}
|
|
27508
|
-
console.
|
|
27556
|
+
console.debug("Data migrated in", performance.now() - start, "ms");
|
|
27509
27557
|
return data;
|
|
27510
27558
|
}
|
|
27511
27559
|
/**
|
|
@@ -28084,7 +28132,7 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
|
|
|
28084
28132
|
const xLabel = tooltipItem.dataset?.label || tooltipItem.label;
|
|
28085
28133
|
// tooltipItem.parsed can be an object or a number for pie charts
|
|
28086
28134
|
let yLabel = horizontalChart ? tooltipItem.parsed.x : tooltipItem.parsed.y;
|
|
28087
|
-
if (
|
|
28135
|
+
if (yLabel === undefined || yLabel === null) {
|
|
28088
28136
|
yLabel = tooltipItem.parsed;
|
|
28089
28137
|
}
|
|
28090
28138
|
const toolTipFormat = !format && Math.abs(yLabel) >= 1000 ? "#,##" : format;
|
|
@@ -28525,13 +28573,10 @@ function createBarChartRuntime(chart, getters) {
|
|
|
28525
28573
|
* datasets to ensure the way we distinguish the originals and trendLine datasets after
|
|
28526
28574
|
*/
|
|
28527
28575
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
28528
|
-
const originalTooltipTitle = config.options.plugins.tooltip.callbacks.title;
|
|
28529
28576
|
config.options.plugins.tooltip.callbacks.title = function (tooltipItems) {
|
|
28530
|
-
|
|
28531
|
-
|
|
28532
|
-
|
|
28533
|
-
}
|
|
28534
|
-
return "";
|
|
28577
|
+
return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID)
|
|
28578
|
+
? undefined
|
|
28579
|
+
: "";
|
|
28535
28580
|
};
|
|
28536
28581
|
}
|
|
28537
28582
|
return { chartJsConfig: config, background: chart.background || BACKGROUND_CHART_COLOR };
|
|
@@ -28901,7 +28946,6 @@ function createLineOrScatterChartRuntime(chart, getters) {
|
|
|
28901
28946
|
else if (axisType === "linear") {
|
|
28902
28947
|
config.options.scales.x.type = "linear";
|
|
28903
28948
|
config.options.scales.x.ticks.callback = (value) => formatValue(value, { format: labelFormat, locale });
|
|
28904
|
-
config.options.plugins.tooltip.callbacks.title = () => "";
|
|
28905
28949
|
config.options.plugins.tooltip.callbacks.label = (tooltipItem) => {
|
|
28906
28950
|
const dataSetPoint = dataSetsValues[tooltipItem.datasetIndex].data[tooltipItem.dataIndex];
|
|
28907
28951
|
let label = tooltipItem.label || labelValues.values[tooltipItem.dataIndex];
|
|
@@ -28989,15 +29033,12 @@ function createLineOrScatterChartRuntime(chart, getters) {
|
|
|
28989
29033
|
* distinguish the originals and trendLine datasets after
|
|
28990
29034
|
*/
|
|
28991
29035
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
28992
|
-
const originalTooltipTitle = config.options.plugins.tooltip.callbacks.title;
|
|
28993
|
-
config.options.plugins.tooltip.callbacks.title = function (tooltipItems) {
|
|
28994
|
-
if (tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID)) {
|
|
28995
|
-
// @ts-expect-error
|
|
28996
|
-
return originalTooltipTitle?.(tooltipItems);
|
|
28997
|
-
}
|
|
28998
|
-
return "";
|
|
28999
|
-
};
|
|
29000
29036
|
}
|
|
29037
|
+
config.options.plugins.tooltip.callbacks.title = function (tooltipItems) {
|
|
29038
|
+
const displayTooltipTitle = axisType !== "linear" &&
|
|
29039
|
+
tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID);
|
|
29040
|
+
return displayTooltipTitle ? undefined : "";
|
|
29041
|
+
};
|
|
29001
29042
|
return {
|
|
29002
29043
|
chartJsConfig: config,
|
|
29003
29044
|
background: chart.background || BACKGROUND_CHART_COLOR,
|
|
@@ -29261,13 +29302,10 @@ function createComboChartRuntime(chart, getters) {
|
|
|
29261
29302
|
* distinguish the originals and trendLine datasets after
|
|
29262
29303
|
*/
|
|
29263
29304
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
29264
|
-
const originalTooltipTitle = config.options.plugins.tooltip.callbacks.title;
|
|
29265
29305
|
config.options.plugins.tooltip.callbacks.title = function (tooltipItems) {
|
|
29266
|
-
|
|
29267
|
-
|
|
29268
|
-
|
|
29269
|
-
}
|
|
29270
|
-
return "";
|
|
29306
|
+
return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID)
|
|
29307
|
+
? undefined
|
|
29308
|
+
: "";
|
|
29271
29309
|
};
|
|
29272
29310
|
}
|
|
29273
29311
|
return { chartJsConfig: config, background: chart.background || BACKGROUND_CHART_COLOR };
|
|
@@ -36257,7 +36295,6 @@ class BarConfigPanel extends GenericChartConfigPanel {
|
|
|
36257
36295
|
css /* scss */ `
|
|
36258
36296
|
.o_side_panel_collapsible_title {
|
|
36259
36297
|
font-size: 16px;
|
|
36260
|
-
font-weight: bold;
|
|
36261
36298
|
cursor: pointer;
|
|
36262
36299
|
padding: 6px 0px 6px 6px !important;
|
|
36263
36300
|
|
|
@@ -37237,6 +37274,9 @@ class ChartWithAxisDesignPanel extends Component {
|
|
|
37237
37274
|
getDataSeries() {
|
|
37238
37275
|
return this.props.definition.dataSets.map((d, i) => d.label ?? `${ChartTerms.Series} ${i + 1}`);
|
|
37239
37276
|
}
|
|
37277
|
+
getPolynomialDegrees() {
|
|
37278
|
+
return range(1, this.getMaxPolynomialDegree() + 1);
|
|
37279
|
+
}
|
|
37240
37280
|
updateSerieEditor(ev) {
|
|
37241
37281
|
const chartId = this.props.figureId;
|
|
37242
37282
|
const selectedIndex = ev.target.selectedIndex;
|
|
@@ -37353,12 +37393,7 @@ class ChartWithAxisDesignPanel extends Component {
|
|
|
37353
37393
|
}
|
|
37354
37394
|
onChangePolynomialDegree(ev) {
|
|
37355
37395
|
const element = ev.target;
|
|
37356
|
-
|
|
37357
|
-
if (order < 2) {
|
|
37358
|
-
element.value = `${this.getTrendLineConfiguration()?.order ?? 2}`;
|
|
37359
|
-
return;
|
|
37360
|
-
}
|
|
37361
|
-
this.updateTrendLineValue({ order });
|
|
37396
|
+
this.updateTrendLineValue({ order: parseInt(element.value) });
|
|
37362
37397
|
}
|
|
37363
37398
|
getTrendLineColor() {
|
|
37364
37399
|
return this.getTrendLineConfiguration()?.color ?? setColorAlpha(this.getDataSerieColor(), 0.5);
|
|
@@ -37380,6 +37415,10 @@ class ChartWithAxisDesignPanel extends Component {
|
|
|
37380
37415
|
};
|
|
37381
37416
|
this.props.updateChart(this.props.figureId, { dataSets });
|
|
37382
37417
|
}
|
|
37418
|
+
getMaxPolynomialDegree() {
|
|
37419
|
+
const runtime = this.env.model.getters.getChartRuntime(this.props.figureId);
|
|
37420
|
+
return Math.min(10, runtime.chartJsConfig.data.datasets[this.state.index].data.length - 1);
|
|
37421
|
+
}
|
|
37383
37422
|
}
|
|
37384
37423
|
|
|
37385
37424
|
class ComboChartDesignPanel extends ChartWithAxisDesignPanel {
|
|
@@ -39208,7 +39247,6 @@ css /* scss */ `
|
|
|
39208
39247
|
width: 142px;
|
|
39209
39248
|
.o-cf-preview-description-rule {
|
|
39210
39249
|
margin-bottom: 4px;
|
|
39211
|
-
font-weight: 600;
|
|
39212
39250
|
max-height: 2.8em;
|
|
39213
39251
|
line-height: 1.4em;
|
|
39214
39252
|
}
|
|
@@ -42210,7 +42248,6 @@ function createMeasureAutoComplete(pivot, forComputedMeasure) {
|
|
|
42210
42248
|
sequence: 0,
|
|
42211
42249
|
autoSelectFirstProposal: true,
|
|
42212
42250
|
getProposals(tokenAtCursor) {
|
|
42213
|
-
// return []
|
|
42214
42251
|
const measureProposals = pivot.measures
|
|
42215
42252
|
.filter((m) => m !== forComputedMeasure)
|
|
42216
42253
|
.map((measure) => {
|
|
@@ -47151,6 +47188,7 @@ class PaintFormatStore extends SpreadsheetStore {
|
|
|
47151
47188
|
new CellClipboardHandler(this.getters, this.model.dispatch),
|
|
47152
47189
|
new BorderClipboardHandler(this.getters, this.model.dispatch),
|
|
47153
47190
|
new TableClipboardHandler(this.getters, this.model.dispatch),
|
|
47191
|
+
new ConditionalFormatClipboardHandler(this.getters, this.model.dispatch),
|
|
47154
47192
|
];
|
|
47155
47193
|
status = "inactive";
|
|
47156
47194
|
copiedData;
|
|
@@ -47161,6 +47199,13 @@ class PaintFormatStore extends SpreadsheetStore {
|
|
|
47161
47199
|
this.highlightStore.unRegister(this);
|
|
47162
47200
|
});
|
|
47163
47201
|
}
|
|
47202
|
+
handle(cmd) {
|
|
47203
|
+
switch (cmd.type) {
|
|
47204
|
+
case "PAINT_FORMAT":
|
|
47205
|
+
this.paintFormat(cmd.sheetId, cmd.target);
|
|
47206
|
+
break;
|
|
47207
|
+
}
|
|
47208
|
+
}
|
|
47164
47209
|
activate(args) {
|
|
47165
47210
|
this.copiedData = this.copyFormats();
|
|
47166
47211
|
this.status = args.persistent ? "persistent" : "oneOff";
|
|
@@ -47170,18 +47215,7 @@ class PaintFormatStore extends SpreadsheetStore {
|
|
|
47170
47215
|
this.copiedData = undefined;
|
|
47171
47216
|
}
|
|
47172
47217
|
pasteFormat(target) {
|
|
47173
|
-
|
|
47174
|
-
const sheetId = this.getters.getActiveSheetId();
|
|
47175
|
-
for (const handler of this.clipboardHandlers) {
|
|
47176
|
-
handler.paste({ zones: target, sheetId }, this.copiedData, {
|
|
47177
|
-
isCutOperation: false,
|
|
47178
|
-
pasteOption: "onlyFormat",
|
|
47179
|
-
});
|
|
47180
|
-
}
|
|
47181
|
-
}
|
|
47182
|
-
if (this.status === "oneOff") {
|
|
47183
|
-
this.cancel();
|
|
47184
|
-
}
|
|
47218
|
+
this.model.dispatch("PAINT_FORMAT", { target, sheetId: this.getters.getActiveSheetId() });
|
|
47185
47219
|
}
|
|
47186
47220
|
get isActive() {
|
|
47187
47221
|
return this.status !== "inactive";
|
|
@@ -47195,6 +47229,19 @@ class PaintFormatStore extends SpreadsheetStore {
|
|
|
47195
47229
|
}
|
|
47196
47230
|
return copiedData;
|
|
47197
47231
|
}
|
|
47232
|
+
paintFormat(sheetId, target) {
|
|
47233
|
+
if (this.copiedData) {
|
|
47234
|
+
for (const handler of this.clipboardHandlers) {
|
|
47235
|
+
handler.paste({ zones: target, sheetId }, this.copiedData, {
|
|
47236
|
+
isCutOperation: false,
|
|
47237
|
+
pasteOption: "onlyFormat",
|
|
47238
|
+
});
|
|
47239
|
+
}
|
|
47240
|
+
}
|
|
47241
|
+
if (this.status === "oneOff") {
|
|
47242
|
+
this.cancel();
|
|
47243
|
+
}
|
|
47244
|
+
}
|
|
47198
47245
|
get highlights() {
|
|
47199
47246
|
const data = this.copiedData;
|
|
47200
47247
|
if (!data) {
|
|
@@ -55438,7 +55485,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
55438
55485
|
case "DUPLICATE_PIVOT": {
|
|
55439
55486
|
const { pivotId, newPivotId } = cmd;
|
|
55440
55487
|
const pivot = deepCopy(this.getPivotCore(pivotId).definition);
|
|
55441
|
-
pivot.name =
|
|
55488
|
+
pivot.name = cmd.duplicatedPivotName ?? pivot.name + " (copy)";
|
|
55442
55489
|
this.addPivot(newPivotId, pivot);
|
|
55443
55490
|
break;
|
|
55444
55491
|
}
|
|
@@ -55478,7 +55525,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
55478
55525
|
return `(#${formulaId}) ${this.getPivotName(pivotId)}`;
|
|
55479
55526
|
}
|
|
55480
55527
|
getPivotName(pivotId) {
|
|
55481
|
-
return
|
|
55528
|
+
return this.getPivotCore(pivotId).definition.name;
|
|
55482
55529
|
}
|
|
55483
55530
|
/**
|
|
55484
55531
|
* Returns the pivot core definition of the pivot with the given id.
|
|
@@ -57120,7 +57167,7 @@ class Evaluator {
|
|
|
57120
57167
|
cellsToCompute.addMany(arrayFormulasPositions);
|
|
57121
57168
|
cellsToCompute.addMany(this.getCellsDependingOn(arrayFormulasPositions));
|
|
57122
57169
|
this.evaluate(cellsToCompute);
|
|
57123
|
-
console.
|
|
57170
|
+
console.debug("evaluate Cells", performance.now() - start, "ms");
|
|
57124
57171
|
}
|
|
57125
57172
|
getArrayFormulasImpactedByChangesOf(positions) {
|
|
57126
57173
|
const impactedPositions = this.createEmptyPositionSet();
|
|
@@ -57164,7 +57211,7 @@ class Evaluator {
|
|
|
57164
57211
|
const start = performance.now();
|
|
57165
57212
|
this.evaluatedCells = new PositionMap();
|
|
57166
57213
|
this.evaluate(this.getAllCells());
|
|
57167
|
-
console.
|
|
57214
|
+
console.debug("evaluate all cells", performance.now() - start, "ms");
|
|
57168
57215
|
}
|
|
57169
57216
|
evaluateFormulaResult(sheetId, formulaString) {
|
|
57170
57217
|
const compiledFormula = compile(formulaString);
|
|
@@ -60910,7 +60957,7 @@ class Session extends EventBus {
|
|
|
60910
60957
|
this.onMessageReceived(message);
|
|
60911
60958
|
}
|
|
60912
60959
|
this.isReplayingInitialRevisions = false;
|
|
60913
|
-
console.
|
|
60960
|
+
console.debug("Replayed", numberOfCommands, "commands in", performance.now() - start, "ms");
|
|
60914
60961
|
}
|
|
60915
60962
|
/**
|
|
60916
60963
|
* Notify the server that the user client left the collaborative session
|
|
@@ -61707,6 +61754,7 @@ class InsertPivotPlugin extends UIPlugin {
|
|
|
61707
61754
|
this.dispatch("DUPLICATE_PIVOT", {
|
|
61708
61755
|
pivotId,
|
|
61709
61756
|
newPivotId,
|
|
61757
|
+
duplicatedPivotName: _t("%s (copy)", this.getters.getPivotCoreDefinition(pivotId).name),
|
|
61710
61758
|
});
|
|
61711
61759
|
const activeSheetId = this.getters.getActiveSheetId();
|
|
61712
61760
|
const position = this.getters.getSheetIds().indexOf(activeSheetId) + 1;
|
|
@@ -66840,10 +66888,9 @@ css /* scss */ `
|
|
|
66840
66888
|
user-select: none;
|
|
66841
66889
|
color: ${TEXT_BODY};
|
|
66842
66890
|
|
|
66843
|
-
.o-
|
|
66891
|
+
.o-sidePanelTitle {
|
|
66844
66892
|
line-height: 20px;
|
|
66845
66893
|
font-size: 16px;
|
|
66846
|
-
font-weight: 600;
|
|
66847
66894
|
}
|
|
66848
66895
|
|
|
66849
66896
|
.o-sidePanelHeader {
|
|
@@ -66928,6 +66975,10 @@ css /* scss */ `
|
|
|
66928
66975
|
}
|
|
66929
66976
|
}
|
|
66930
66977
|
}
|
|
66978
|
+
|
|
66979
|
+
.o-fw-bold {
|
|
66980
|
+
font-weight: 500;
|
|
66981
|
+
}
|
|
66931
66982
|
`;
|
|
66932
66983
|
class SidePanel extends Component {
|
|
66933
66984
|
static template = "o-spreadsheet-SidePanel";
|
|
@@ -71697,7 +71748,7 @@ class Model extends EventBus {
|
|
|
71697
71748
|
coreHandlers = [];
|
|
71698
71749
|
constructor(data = {}, config = {}, stateUpdateMessages = [], uuidGenerator = new UuidGenerator(), verboseImport = false) {
|
|
71699
71750
|
const start = performance.now();
|
|
71700
|
-
console.
|
|
71751
|
+
console.debug("##### Model creation #####");
|
|
71701
71752
|
super();
|
|
71702
71753
|
setDefaultTranslationMethod();
|
|
71703
71754
|
stateUpdateMessages = repairInitialMessages(data, stateUpdateMessages);
|
|
@@ -71769,16 +71820,16 @@ class Model extends EventBus {
|
|
|
71769
71820
|
this.joinSession();
|
|
71770
71821
|
if (config.snapshotRequested) {
|
|
71771
71822
|
const startSnapshot = performance.now();
|
|
71772
|
-
console.
|
|
71823
|
+
console.debug("Snapshot requested");
|
|
71773
71824
|
this.session.snapshot(this.exportData());
|
|
71774
71825
|
this.garbageCollectExternalResources();
|
|
71775
|
-
console.
|
|
71826
|
+
console.debug("Snapshot taken in", performance.now() - startSnapshot, "ms");
|
|
71776
71827
|
}
|
|
71777
71828
|
// mark all models as "raw", so they will not be turned into reactive objects
|
|
71778
71829
|
// by owl, since we do not rely on reactivity
|
|
71779
71830
|
markRaw(this);
|
|
71780
|
-
console.
|
|
71781
|
-
console.
|
|
71831
|
+
console.debug("Model created in", performance.now() - start, "ms");
|
|
71832
|
+
console.debug("######");
|
|
71782
71833
|
}
|
|
71783
71834
|
joinSession() {
|
|
71784
71835
|
this.session.join(this.config.client);
|
|
@@ -72002,7 +72053,7 @@ class Model extends EventBus {
|
|
|
72002
72053
|
this.finalize();
|
|
72003
72054
|
const time = performance.now() - start;
|
|
72004
72055
|
if (time > 5) {
|
|
72005
|
-
console.
|
|
72056
|
+
console.debug(type, time, "ms");
|
|
72006
72057
|
}
|
|
72007
72058
|
});
|
|
72008
72059
|
this.session.save(command, commands, changes);
|
|
@@ -72354,6 +72405,6 @@ const constants = {
|
|
|
72354
72405
|
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 };
|
|
72355
72406
|
|
|
72356
72407
|
|
|
72357
|
-
__info__.version = "18.0.
|
|
72358
|
-
__info__.date = "2024-10-
|
|
72359
|
-
__info__.hash = "
|
|
72408
|
+
__info__.version = "18.0.2";
|
|
72409
|
+
__info__.date = "2024-10-24T08:54:21.934Z";
|
|
72410
|
+
__info__.hash = "788df92";
|