@odoo/o-spreadsheet 17.4.10 → 17.4.12
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 +52 -21
- package/dist/o-spreadsheet.d.ts +13 -0
- package/dist/o-spreadsheet.esm.js +52 -21
- package/dist/o-spreadsheet.iife.js +52 -21
- package/dist/o-spreadsheet.iife.min.js +338 -338
- package/dist/o_spreadsheet.xml +12 -8
- 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 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.12
|
|
6
|
+
* @date 2024-11-13T15:06:56.109Z
|
|
7
|
+
* @hash 5cde4be
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -7627,7 +7627,10 @@ function parseOperand(tokens) {
|
|
|
7627
7627
|
case "STRING":
|
|
7628
7628
|
return { type: "STRING", value: removeStringQuotes(current.value) };
|
|
7629
7629
|
case "INVALID_REFERENCE":
|
|
7630
|
-
|
|
7630
|
+
return {
|
|
7631
|
+
type: "REFERENCE",
|
|
7632
|
+
value: CellErrorType.InvalidReference,
|
|
7633
|
+
};
|
|
7631
7634
|
case "REFERENCE":
|
|
7632
7635
|
if (tokens[0]?.value === ":" && tokens[1]?.type === "REFERENCE") {
|
|
7633
7636
|
tokens.shift();
|
|
@@ -8431,6 +8434,7 @@ const ChartTerms = {
|
|
|
8431
8434
|
StackedBarChart: _t("Stacked bar chart"),
|
|
8432
8435
|
StackedLineChart: _t("Stacked line chart"),
|
|
8433
8436
|
StackedAreaChart: _t("Stacked area chart"),
|
|
8437
|
+
StackedColumnChart: _t("Stacked column chart"),
|
|
8434
8438
|
CumulativeData: _t("Cumulative data"),
|
|
8435
8439
|
TreatLabelsAsText: _t("Treat labels as text"),
|
|
8436
8440
|
AggregatedChart: _t("Aggregate"),
|
|
@@ -10714,6 +10718,10 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
|
10714
10718
|
function drawPieChartValues(chart, options, ctx) {
|
|
10715
10719
|
for (const dataset of chart._metasets) {
|
|
10716
10720
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10721
|
+
const value = Number(dataset._parsed[i]);
|
|
10722
|
+
if (isNaN(value) || value === 0) {
|
|
10723
|
+
continue;
|
|
10724
|
+
}
|
|
10717
10725
|
const bar = dataset.data[i];
|
|
10718
10726
|
const { startAngle, endAngle, innerRadius, outerRadius } = bar;
|
|
10719
10727
|
const midAngle = (startAngle + endAngle) / 2;
|
|
@@ -10722,8 +10730,8 @@ function drawPieChartValues(chart, options, ctx) {
|
|
|
10722
10730
|
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
10723
10731
|
ctx.fillStyle = chartFontColor(options.background);
|
|
10724
10732
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10725
|
-
const
|
|
10726
|
-
drawTextWithBackground(
|
|
10733
|
+
const displayValue = options.callback(value);
|
|
10734
|
+
drawTextWithBackground(displayValue, x, y, ctx);
|
|
10727
10735
|
}
|
|
10728
10736
|
}
|
|
10729
10737
|
}
|
|
@@ -23481,11 +23489,14 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
|
|
|
23481
23489
|
function getChartLabelFormat(getters, range) {
|
|
23482
23490
|
if (!range)
|
|
23483
23491
|
return undefined;
|
|
23484
|
-
|
|
23485
|
-
|
|
23486
|
-
col:
|
|
23487
|
-
|
|
23488
|
-
|
|
23492
|
+
const { sheetId, zone: { left, top, bottom }, } = range;
|
|
23493
|
+
for (let row = top; row <= bottom; row++) {
|
|
23494
|
+
const format = getters.getEvaluatedCell({ sheetId, col: left, row }).format;
|
|
23495
|
+
if (format) {
|
|
23496
|
+
return format;
|
|
23497
|
+
}
|
|
23498
|
+
}
|
|
23499
|
+
return undefined;
|
|
23489
23500
|
}
|
|
23490
23501
|
function getChartLabelValues(getters, dataSets, labelRange) {
|
|
23491
23502
|
let labels = { values: [], formattedValues: [] };
|
|
@@ -24024,11 +24035,7 @@ function canBeDateChart(labelRange, getters) {
|
|
|
24024
24035
|
if (!labelRange || !canBeLinearChart(labelRange, getters)) {
|
|
24025
24036
|
return false;
|
|
24026
24037
|
}
|
|
24027
|
-
const labelFormat = getters
|
|
24028
|
-
sheetId: labelRange.sheetId,
|
|
24029
|
-
col: labelRange.zone.left,
|
|
24030
|
-
row: labelRange.zone.top,
|
|
24031
|
-
}).format;
|
|
24038
|
+
const labelFormat = getChartLabelFormat(getters, labelRange);
|
|
24032
24039
|
return Boolean(labelFormat && timeFormatLuxonCompatible.test(labelFormat));
|
|
24033
24040
|
}
|
|
24034
24041
|
function canBeLinearChart(labelRange, getters) {
|
|
@@ -31627,6 +31634,12 @@ class GenericChartConfigPanel extends owl.Component {
|
|
|
31627
31634
|
|
|
31628
31635
|
class BarConfigPanel extends GenericChartConfigPanel {
|
|
31629
31636
|
static template = "o-spreadsheet-BarConfigPanel";
|
|
31637
|
+
get stackedLabel() {
|
|
31638
|
+
const definition = this.props.definition;
|
|
31639
|
+
return definition.horizontal
|
|
31640
|
+
? this.chartTerms.StackedBarChart
|
|
31641
|
+
: this.chartTerms.StackedColumnChart;
|
|
31642
|
+
}
|
|
31630
31643
|
onUpdateStacked(stacked) {
|
|
31631
31644
|
this.props.updateChart(this.props.figureId, {
|
|
31632
31645
|
stacked,
|
|
@@ -32055,6 +32068,7 @@ class ColorPicker extends owl.Component {
|
|
|
32055
32068
|
currentColor: { type: String, optional: true },
|
|
32056
32069
|
maxHeight: { type: Number, optional: true },
|
|
32057
32070
|
anchorRect: Object,
|
|
32071
|
+
disableNoColor: { type: Boolean, optional: true },
|
|
32058
32072
|
};
|
|
32059
32073
|
static defaultProps = { currentColor: "" };
|
|
32060
32074
|
static components = { Popover };
|
|
@@ -32280,6 +32294,7 @@ class RoundColorPicker extends owl.Component {
|
|
|
32280
32294
|
currentColor: { type: String, optional: true },
|
|
32281
32295
|
title: { type: String, optional: true },
|
|
32282
32296
|
onColorPicked: Function,
|
|
32297
|
+
disableNoColor: { type: Boolean, optional: true },
|
|
32283
32298
|
};
|
|
32284
32299
|
colorPickerButtonRef = owl.useRef("colorPickerButton");
|
|
32285
32300
|
state;
|
|
@@ -32795,7 +32810,9 @@ class LineConfigPanel extends GenericChartConfigPanel {
|
|
|
32795
32810
|
}
|
|
32796
32811
|
get stackedLabel() {
|
|
32797
32812
|
const definition = this.props.definition;
|
|
32798
|
-
return definition.fillArea
|
|
32813
|
+
return definition.fillArea
|
|
32814
|
+
? this.chartTerms.StackedAreaChart
|
|
32815
|
+
: this.chartTerms.StackedLineChart;
|
|
32799
32816
|
}
|
|
32800
32817
|
getLabelRangeOptions() {
|
|
32801
32818
|
const options = super.getLabelRangeOptions();
|
|
@@ -34339,6 +34356,9 @@ class ConditionalFormattingEditor extends owl.Component {
|
|
|
34339
34356
|
}
|
|
34340
34357
|
}
|
|
34341
34358
|
setColorScaleColor(target, color) {
|
|
34359
|
+
if (!isColorValid(color)) {
|
|
34360
|
+
return;
|
|
34361
|
+
}
|
|
34342
34362
|
const point = this.state.rules.colorScale[target];
|
|
34343
34363
|
if (point) {
|
|
34344
34364
|
point.color = Number.parseInt(color.substr(1), 16);
|
|
@@ -56023,6 +56043,10 @@ class PivotUIPlugin extends UIPlugin {
|
|
|
56023
56043
|
if (!pivot.isValid()) {
|
|
56024
56044
|
return EMPTY_PIVOT_CELL;
|
|
56025
56045
|
}
|
|
56046
|
+
if (functionName === "PIVOT" &&
|
|
56047
|
+
!cell.content.replaceAll(" ", "").toUpperCase().startsWith("=PIVOT")) {
|
|
56048
|
+
return EMPTY_PIVOT_CELL;
|
|
56049
|
+
}
|
|
56026
56050
|
if (functionName === "PIVOT") {
|
|
56027
56051
|
const includeTotal = args[2] === false ? false : undefined;
|
|
56028
56052
|
const includeColumnHeaders = args[3] === false ? false : undefined;
|
|
@@ -66614,7 +66638,8 @@ function addFormula(cell) {
|
|
|
66614
66638
|
}
|
|
66615
66639
|
const attrs = [["t", type]];
|
|
66616
66640
|
const XlsxFormula = adaptFormulaToExcel(formula);
|
|
66617
|
-
const
|
|
66641
|
+
const exportedValue = adaptFormulaValueToExcel(cell.value);
|
|
66642
|
+
const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${exportedValue}</v>`;
|
|
66618
66643
|
return { attrs, node };
|
|
66619
66644
|
}
|
|
66620
66645
|
function addContent(content, sharedStrings, forceString = false) {
|
|
@@ -66649,8 +66674,14 @@ function adaptFormulaToExcel(formulaText) {
|
|
|
66649
66674
|
ast = addMissingRequiredArgs(ast);
|
|
66650
66675
|
return ast;
|
|
66651
66676
|
});
|
|
66677
|
+
ast = convertAstNodes(ast, "REFERENCE", (ast) => {
|
|
66678
|
+
return ast.value === CellErrorType.InvalidReference ? { ...ast, value: "#REF!" } : ast;
|
|
66679
|
+
});
|
|
66652
66680
|
return ast ? astToFormula(ast) : formulaText;
|
|
66653
66681
|
}
|
|
66682
|
+
function adaptFormulaValueToExcel(formulaValue) {
|
|
66683
|
+
return formulaValue === CellErrorType.InvalidReference ? "#REF!" : formulaValue;
|
|
66684
|
+
}
|
|
66654
66685
|
/**
|
|
66655
66686
|
* Some Excel function need required args that might not be mandatory in o-spreadsheet.
|
|
66656
66687
|
* This adds those missing args.
|
|
@@ -68651,6 +68682,6 @@ exports.tokenColors = tokenColors;
|
|
|
68651
68682
|
exports.tokenize = tokenize;
|
|
68652
68683
|
|
|
68653
68684
|
|
|
68654
|
-
__info__.version = "17.4.
|
|
68655
|
-
__info__.date = "2024-
|
|
68656
|
-
__info__.hash = "
|
|
68685
|
+
__info__.version = "17.4.12";
|
|
68686
|
+
__info__.date = "2024-11-13T15:06:56.109Z";
|
|
68687
|
+
__info__.hash = "5cde4be";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -6714,6 +6714,7 @@ declare class GenericChartConfigPanel extends Component<Props$W, SpreadsheetChil
|
|
|
6714
6714
|
StackedBarChart: string;
|
|
6715
6715
|
StackedLineChart: string;
|
|
6716
6716
|
StackedAreaChart: string;
|
|
6717
|
+
StackedColumnChart: string;
|
|
6717
6718
|
CumulativeData: string;
|
|
6718
6719
|
TreatLabelsAsText: string;
|
|
6719
6720
|
AggregatedChart: string;
|
|
@@ -6766,6 +6767,7 @@ declare class GenericChartConfigPanel extends Component<Props$W, SpreadsheetChil
|
|
|
6766
6767
|
|
|
6767
6768
|
declare class BarConfigPanel extends GenericChartConfigPanel {
|
|
6768
6769
|
static template: string;
|
|
6770
|
+
get stackedLabel(): string;
|
|
6769
6771
|
onUpdateStacked(stacked: boolean): void;
|
|
6770
6772
|
onUpdateAggregated(aggregated: boolean): void;
|
|
6771
6773
|
}
|
|
@@ -6885,6 +6887,7 @@ interface ColorPickerProps {
|
|
|
6885
6887
|
maxHeight?: Pixel;
|
|
6886
6888
|
onColorPicked: (color: Color) => void;
|
|
6887
6889
|
currentColor: Color;
|
|
6890
|
+
disableNoColor?: boolean;
|
|
6888
6891
|
}
|
|
6889
6892
|
declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEnv> {
|
|
6890
6893
|
static template: string;
|
|
@@ -6899,6 +6902,10 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
|
|
|
6899
6902
|
optional: boolean;
|
|
6900
6903
|
};
|
|
6901
6904
|
anchorRect: ObjectConstructor;
|
|
6905
|
+
disableNoColor: {
|
|
6906
|
+
type: BooleanConstructor;
|
|
6907
|
+
optional: boolean;
|
|
6908
|
+
};
|
|
6902
6909
|
};
|
|
6903
6910
|
static defaultProps: {
|
|
6904
6911
|
currentColor: string;
|
|
@@ -6982,6 +6989,7 @@ interface Props$U {
|
|
|
6982
6989
|
currentColor?: string;
|
|
6983
6990
|
onColorPicked: (color: string) => void;
|
|
6984
6991
|
title?: string;
|
|
6992
|
+
disableNoColor?: boolean;
|
|
6985
6993
|
}
|
|
6986
6994
|
declare class RoundColorPicker extends Component<Props$U, SpreadsheetChildEnv> {
|
|
6987
6995
|
static template: string;
|
|
@@ -7000,6 +7008,10 @@ declare class RoundColorPicker extends Component<Props$U, SpreadsheetChildEnv> {
|
|
|
7000
7008
|
optional: boolean;
|
|
7001
7009
|
};
|
|
7002
7010
|
onColorPicked: FunctionConstructor;
|
|
7011
|
+
disableNoColor: {
|
|
7012
|
+
type: BooleanConstructor;
|
|
7013
|
+
optional: boolean;
|
|
7014
|
+
};
|
|
7003
7015
|
};
|
|
7004
7016
|
colorPickerButtonRef: {
|
|
7005
7017
|
el: HTMLElement | null;
|
|
@@ -11615,6 +11627,7 @@ declare const constants: {
|
|
|
11615
11627
|
StackedBarChart: string;
|
|
11616
11628
|
StackedLineChart: string;
|
|
11617
11629
|
StackedAreaChart: string;
|
|
11630
|
+
StackedColumnChart: string;
|
|
11618
11631
|
CumulativeData: string;
|
|
11619
11632
|
TreatLabelsAsText: string;
|
|
11620
11633
|
AggregatedChart: string;
|
|
@@ -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 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.12
|
|
6
|
+
* @date 2024-11-13T15:06:56.109Z
|
|
7
|
+
* @hash 5cde4be
|
|
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';
|
|
@@ -7625,7 +7625,10 @@ function parseOperand(tokens) {
|
|
|
7625
7625
|
case "STRING":
|
|
7626
7626
|
return { type: "STRING", value: removeStringQuotes(current.value) };
|
|
7627
7627
|
case "INVALID_REFERENCE":
|
|
7628
|
-
|
|
7628
|
+
return {
|
|
7629
|
+
type: "REFERENCE",
|
|
7630
|
+
value: CellErrorType.InvalidReference,
|
|
7631
|
+
};
|
|
7629
7632
|
case "REFERENCE":
|
|
7630
7633
|
if (tokens[0]?.value === ":" && tokens[1]?.type === "REFERENCE") {
|
|
7631
7634
|
tokens.shift();
|
|
@@ -8429,6 +8432,7 @@ const ChartTerms = {
|
|
|
8429
8432
|
StackedBarChart: _t("Stacked bar chart"),
|
|
8430
8433
|
StackedLineChart: _t("Stacked line chart"),
|
|
8431
8434
|
StackedAreaChart: _t("Stacked area chart"),
|
|
8435
|
+
StackedColumnChart: _t("Stacked column chart"),
|
|
8432
8436
|
CumulativeData: _t("Cumulative data"),
|
|
8433
8437
|
TreatLabelsAsText: _t("Treat labels as text"),
|
|
8434
8438
|
AggregatedChart: _t("Aggregate"),
|
|
@@ -10712,6 +10716,10 @@ function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
|
10712
10716
|
function drawPieChartValues(chart, options, ctx) {
|
|
10713
10717
|
for (const dataset of chart._metasets) {
|
|
10714
10718
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10719
|
+
const value = Number(dataset._parsed[i]);
|
|
10720
|
+
if (isNaN(value) || value === 0) {
|
|
10721
|
+
continue;
|
|
10722
|
+
}
|
|
10715
10723
|
const bar = dataset.data[i];
|
|
10716
10724
|
const { startAngle, endAngle, innerRadius, outerRadius } = bar;
|
|
10717
10725
|
const midAngle = (startAngle + endAngle) / 2;
|
|
@@ -10720,8 +10728,8 @@ function drawPieChartValues(chart, options, ctx) {
|
|
|
10720
10728
|
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
10721
10729
|
ctx.fillStyle = chartFontColor(options.background);
|
|
10722
10730
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10723
|
-
const
|
|
10724
|
-
drawTextWithBackground(
|
|
10731
|
+
const displayValue = options.callback(value);
|
|
10732
|
+
drawTextWithBackground(displayValue, x, y, ctx);
|
|
10725
10733
|
}
|
|
10726
10734
|
}
|
|
10727
10735
|
}
|
|
@@ -23479,11 +23487,14 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
|
|
|
23479
23487
|
function getChartLabelFormat(getters, range) {
|
|
23480
23488
|
if (!range)
|
|
23481
23489
|
return undefined;
|
|
23482
|
-
|
|
23483
|
-
|
|
23484
|
-
col:
|
|
23485
|
-
|
|
23486
|
-
|
|
23490
|
+
const { sheetId, zone: { left, top, bottom }, } = range;
|
|
23491
|
+
for (let row = top; row <= bottom; row++) {
|
|
23492
|
+
const format = getters.getEvaluatedCell({ sheetId, col: left, row }).format;
|
|
23493
|
+
if (format) {
|
|
23494
|
+
return format;
|
|
23495
|
+
}
|
|
23496
|
+
}
|
|
23497
|
+
return undefined;
|
|
23487
23498
|
}
|
|
23488
23499
|
function getChartLabelValues(getters, dataSets, labelRange) {
|
|
23489
23500
|
let labels = { values: [], formattedValues: [] };
|
|
@@ -24022,11 +24033,7 @@ function canBeDateChart(labelRange, getters) {
|
|
|
24022
24033
|
if (!labelRange || !canBeLinearChart(labelRange, getters)) {
|
|
24023
24034
|
return false;
|
|
24024
24035
|
}
|
|
24025
|
-
const labelFormat = getters
|
|
24026
|
-
sheetId: labelRange.sheetId,
|
|
24027
|
-
col: labelRange.zone.left,
|
|
24028
|
-
row: labelRange.zone.top,
|
|
24029
|
-
}).format;
|
|
24036
|
+
const labelFormat = getChartLabelFormat(getters, labelRange);
|
|
24030
24037
|
return Boolean(labelFormat && timeFormatLuxonCompatible.test(labelFormat));
|
|
24031
24038
|
}
|
|
24032
24039
|
function canBeLinearChart(labelRange, getters) {
|
|
@@ -31625,6 +31632,12 @@ class GenericChartConfigPanel extends Component {
|
|
|
31625
31632
|
|
|
31626
31633
|
class BarConfigPanel extends GenericChartConfigPanel {
|
|
31627
31634
|
static template = "o-spreadsheet-BarConfigPanel";
|
|
31635
|
+
get stackedLabel() {
|
|
31636
|
+
const definition = this.props.definition;
|
|
31637
|
+
return definition.horizontal
|
|
31638
|
+
? this.chartTerms.StackedBarChart
|
|
31639
|
+
: this.chartTerms.StackedColumnChart;
|
|
31640
|
+
}
|
|
31628
31641
|
onUpdateStacked(stacked) {
|
|
31629
31642
|
this.props.updateChart(this.props.figureId, {
|
|
31630
31643
|
stacked,
|
|
@@ -32053,6 +32066,7 @@ class ColorPicker extends Component {
|
|
|
32053
32066
|
currentColor: { type: String, optional: true },
|
|
32054
32067
|
maxHeight: { type: Number, optional: true },
|
|
32055
32068
|
anchorRect: Object,
|
|
32069
|
+
disableNoColor: { type: Boolean, optional: true },
|
|
32056
32070
|
};
|
|
32057
32071
|
static defaultProps = { currentColor: "" };
|
|
32058
32072
|
static components = { Popover };
|
|
@@ -32278,6 +32292,7 @@ class RoundColorPicker extends Component {
|
|
|
32278
32292
|
currentColor: { type: String, optional: true },
|
|
32279
32293
|
title: { type: String, optional: true },
|
|
32280
32294
|
onColorPicked: Function,
|
|
32295
|
+
disableNoColor: { type: Boolean, optional: true },
|
|
32281
32296
|
};
|
|
32282
32297
|
colorPickerButtonRef = useRef("colorPickerButton");
|
|
32283
32298
|
state;
|
|
@@ -32793,7 +32808,9 @@ class LineConfigPanel extends GenericChartConfigPanel {
|
|
|
32793
32808
|
}
|
|
32794
32809
|
get stackedLabel() {
|
|
32795
32810
|
const definition = this.props.definition;
|
|
32796
|
-
return definition.fillArea
|
|
32811
|
+
return definition.fillArea
|
|
32812
|
+
? this.chartTerms.StackedAreaChart
|
|
32813
|
+
: this.chartTerms.StackedLineChart;
|
|
32797
32814
|
}
|
|
32798
32815
|
getLabelRangeOptions() {
|
|
32799
32816
|
const options = super.getLabelRangeOptions();
|
|
@@ -34337,6 +34354,9 @@ class ConditionalFormattingEditor extends Component {
|
|
|
34337
34354
|
}
|
|
34338
34355
|
}
|
|
34339
34356
|
setColorScaleColor(target, color) {
|
|
34357
|
+
if (!isColorValid(color)) {
|
|
34358
|
+
return;
|
|
34359
|
+
}
|
|
34340
34360
|
const point = this.state.rules.colorScale[target];
|
|
34341
34361
|
if (point) {
|
|
34342
34362
|
point.color = Number.parseInt(color.substr(1), 16);
|
|
@@ -56021,6 +56041,10 @@ class PivotUIPlugin extends UIPlugin {
|
|
|
56021
56041
|
if (!pivot.isValid()) {
|
|
56022
56042
|
return EMPTY_PIVOT_CELL;
|
|
56023
56043
|
}
|
|
56044
|
+
if (functionName === "PIVOT" &&
|
|
56045
|
+
!cell.content.replaceAll(" ", "").toUpperCase().startsWith("=PIVOT")) {
|
|
56046
|
+
return EMPTY_PIVOT_CELL;
|
|
56047
|
+
}
|
|
56024
56048
|
if (functionName === "PIVOT") {
|
|
56025
56049
|
const includeTotal = args[2] === false ? false : undefined;
|
|
56026
56050
|
const includeColumnHeaders = args[3] === false ? false : undefined;
|
|
@@ -66612,7 +66636,8 @@ function addFormula(cell) {
|
|
|
66612
66636
|
}
|
|
66613
66637
|
const attrs = [["t", type]];
|
|
66614
66638
|
const XlsxFormula = adaptFormulaToExcel(formula);
|
|
66615
|
-
const
|
|
66639
|
+
const exportedValue = adaptFormulaValueToExcel(cell.value);
|
|
66640
|
+
const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${exportedValue}</v>`;
|
|
66616
66641
|
return { attrs, node };
|
|
66617
66642
|
}
|
|
66618
66643
|
function addContent(content, sharedStrings, forceString = false) {
|
|
@@ -66647,8 +66672,14 @@ function adaptFormulaToExcel(formulaText) {
|
|
|
66647
66672
|
ast = addMissingRequiredArgs(ast);
|
|
66648
66673
|
return ast;
|
|
66649
66674
|
});
|
|
66675
|
+
ast = convertAstNodes(ast, "REFERENCE", (ast) => {
|
|
66676
|
+
return ast.value === CellErrorType.InvalidReference ? { ...ast, value: "#REF!" } : ast;
|
|
66677
|
+
});
|
|
66650
66678
|
return ast ? astToFormula(ast) : formulaText;
|
|
66651
66679
|
}
|
|
66680
|
+
function adaptFormulaValueToExcel(formulaValue) {
|
|
66681
|
+
return formulaValue === CellErrorType.InvalidReference ? "#REF!" : formulaValue;
|
|
66682
|
+
}
|
|
66652
66683
|
/**
|
|
66653
66684
|
* Some Excel function need required args that might not be mandatory in o-spreadsheet.
|
|
66654
66685
|
* This adds those missing args.
|
|
@@ -68606,6 +68637,6 @@ const constants = {
|
|
|
68606
68637
|
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 };
|
|
68607
68638
|
|
|
68608
68639
|
|
|
68609
|
-
__info__.version = "17.4.
|
|
68610
|
-
__info__.date = "2024-
|
|
68611
|
-
__info__.hash = "
|
|
68640
|
+
__info__.version = "17.4.12";
|
|
68641
|
+
__info__.date = "2024-11-13T15:06:56.109Z";
|
|
68642
|
+
__info__.hash = "5cde4be";
|
|
@@ -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 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.12
|
|
6
|
+
* @date 2024-11-13T15:06:56.109Z
|
|
7
|
+
* @hash 5cde4be
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -7626,7 +7626,10 @@
|
|
|
7626
7626
|
case "STRING":
|
|
7627
7627
|
return { type: "STRING", value: removeStringQuotes(current.value) };
|
|
7628
7628
|
case "INVALID_REFERENCE":
|
|
7629
|
-
|
|
7629
|
+
return {
|
|
7630
|
+
type: "REFERENCE",
|
|
7631
|
+
value: CellErrorType.InvalidReference,
|
|
7632
|
+
};
|
|
7630
7633
|
case "REFERENCE":
|
|
7631
7634
|
if (tokens[0]?.value === ":" && tokens[1]?.type === "REFERENCE") {
|
|
7632
7635
|
tokens.shift();
|
|
@@ -8430,6 +8433,7 @@
|
|
|
8430
8433
|
StackedBarChart: _t("Stacked bar chart"),
|
|
8431
8434
|
StackedLineChart: _t("Stacked line chart"),
|
|
8432
8435
|
StackedAreaChart: _t("Stacked area chart"),
|
|
8436
|
+
StackedColumnChart: _t("Stacked column chart"),
|
|
8433
8437
|
CumulativeData: _t("Cumulative data"),
|
|
8434
8438
|
TreatLabelsAsText: _t("Treat labels as text"),
|
|
8435
8439
|
AggregatedChart: _t("Aggregate"),
|
|
@@ -10713,6 +10717,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10713
10717
|
function drawPieChartValues(chart, options, ctx) {
|
|
10714
10718
|
for (const dataset of chart._metasets) {
|
|
10715
10719
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10720
|
+
const value = Number(dataset._parsed[i]);
|
|
10721
|
+
if (isNaN(value) || value === 0) {
|
|
10722
|
+
continue;
|
|
10723
|
+
}
|
|
10716
10724
|
const bar = dataset.data[i];
|
|
10717
10725
|
const { startAngle, endAngle, innerRadius, outerRadius } = bar;
|
|
10718
10726
|
const midAngle = (startAngle + endAngle) / 2;
|
|
@@ -10721,8 +10729,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10721
10729
|
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
10722
10730
|
ctx.fillStyle = chartFontColor(options.background);
|
|
10723
10731
|
ctx.strokeStyle = options.background || "#ffffff";
|
|
10724
|
-
const
|
|
10725
|
-
drawTextWithBackground(
|
|
10732
|
+
const displayValue = options.callback(value);
|
|
10733
|
+
drawTextWithBackground(displayValue, x, y, ctx);
|
|
10726
10734
|
}
|
|
10727
10735
|
}
|
|
10728
10736
|
}
|
|
@@ -23480,11 +23488,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23480
23488
|
function getChartLabelFormat(getters, range) {
|
|
23481
23489
|
if (!range)
|
|
23482
23490
|
return undefined;
|
|
23483
|
-
|
|
23484
|
-
|
|
23485
|
-
col:
|
|
23486
|
-
|
|
23487
|
-
|
|
23491
|
+
const { sheetId, zone: { left, top, bottom }, } = range;
|
|
23492
|
+
for (let row = top; row <= bottom; row++) {
|
|
23493
|
+
const format = getters.getEvaluatedCell({ sheetId, col: left, row }).format;
|
|
23494
|
+
if (format) {
|
|
23495
|
+
return format;
|
|
23496
|
+
}
|
|
23497
|
+
}
|
|
23498
|
+
return undefined;
|
|
23488
23499
|
}
|
|
23489
23500
|
function getChartLabelValues(getters, dataSets, labelRange) {
|
|
23490
23501
|
let labels = { values: [], formattedValues: [] };
|
|
@@ -24023,11 +24034,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24023
24034
|
if (!labelRange || !canBeLinearChart(labelRange, getters)) {
|
|
24024
24035
|
return false;
|
|
24025
24036
|
}
|
|
24026
|
-
const labelFormat = getters
|
|
24027
|
-
sheetId: labelRange.sheetId,
|
|
24028
|
-
col: labelRange.zone.left,
|
|
24029
|
-
row: labelRange.zone.top,
|
|
24030
|
-
}).format;
|
|
24037
|
+
const labelFormat = getChartLabelFormat(getters, labelRange);
|
|
24031
24038
|
return Boolean(labelFormat && timeFormatLuxonCompatible.test(labelFormat));
|
|
24032
24039
|
}
|
|
24033
24040
|
function canBeLinearChart(labelRange, getters) {
|
|
@@ -31626,6 +31633,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31626
31633
|
|
|
31627
31634
|
class BarConfigPanel extends GenericChartConfigPanel {
|
|
31628
31635
|
static template = "o-spreadsheet-BarConfigPanel";
|
|
31636
|
+
get stackedLabel() {
|
|
31637
|
+
const definition = this.props.definition;
|
|
31638
|
+
return definition.horizontal
|
|
31639
|
+
? this.chartTerms.StackedBarChart
|
|
31640
|
+
: this.chartTerms.StackedColumnChart;
|
|
31641
|
+
}
|
|
31629
31642
|
onUpdateStacked(stacked) {
|
|
31630
31643
|
this.props.updateChart(this.props.figureId, {
|
|
31631
31644
|
stacked,
|
|
@@ -32054,6 +32067,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32054
32067
|
currentColor: { type: String, optional: true },
|
|
32055
32068
|
maxHeight: { type: Number, optional: true },
|
|
32056
32069
|
anchorRect: Object,
|
|
32070
|
+
disableNoColor: { type: Boolean, optional: true },
|
|
32057
32071
|
};
|
|
32058
32072
|
static defaultProps = { currentColor: "" };
|
|
32059
32073
|
static components = { Popover };
|
|
@@ -32279,6 +32293,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32279
32293
|
currentColor: { type: String, optional: true },
|
|
32280
32294
|
title: { type: String, optional: true },
|
|
32281
32295
|
onColorPicked: Function,
|
|
32296
|
+
disableNoColor: { type: Boolean, optional: true },
|
|
32282
32297
|
};
|
|
32283
32298
|
colorPickerButtonRef = owl.useRef("colorPickerButton");
|
|
32284
32299
|
state;
|
|
@@ -32794,7 +32809,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32794
32809
|
}
|
|
32795
32810
|
get stackedLabel() {
|
|
32796
32811
|
const definition = this.props.definition;
|
|
32797
|
-
return definition.fillArea
|
|
32812
|
+
return definition.fillArea
|
|
32813
|
+
? this.chartTerms.StackedAreaChart
|
|
32814
|
+
: this.chartTerms.StackedLineChart;
|
|
32798
32815
|
}
|
|
32799
32816
|
getLabelRangeOptions() {
|
|
32800
32817
|
const options = super.getLabelRangeOptions();
|
|
@@ -34338,6 +34355,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
34338
34355
|
}
|
|
34339
34356
|
}
|
|
34340
34357
|
setColorScaleColor(target, color) {
|
|
34358
|
+
if (!isColorValid(color)) {
|
|
34359
|
+
return;
|
|
34360
|
+
}
|
|
34341
34361
|
const point = this.state.rules.colorScale[target];
|
|
34342
34362
|
if (point) {
|
|
34343
34363
|
point.color = Number.parseInt(color.substr(1), 16);
|
|
@@ -56022,6 +56042,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56022
56042
|
if (!pivot.isValid()) {
|
|
56023
56043
|
return EMPTY_PIVOT_CELL;
|
|
56024
56044
|
}
|
|
56045
|
+
if (functionName === "PIVOT" &&
|
|
56046
|
+
!cell.content.replaceAll(" ", "").toUpperCase().startsWith("=PIVOT")) {
|
|
56047
|
+
return EMPTY_PIVOT_CELL;
|
|
56048
|
+
}
|
|
56025
56049
|
if (functionName === "PIVOT") {
|
|
56026
56050
|
const includeTotal = args[2] === false ? false : undefined;
|
|
56027
56051
|
const includeColumnHeaders = args[3] === false ? false : undefined;
|
|
@@ -66613,7 +66637,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66613
66637
|
}
|
|
66614
66638
|
const attrs = [["t", type]];
|
|
66615
66639
|
const XlsxFormula = adaptFormulaToExcel(formula);
|
|
66616
|
-
const
|
|
66640
|
+
const exportedValue = adaptFormulaValueToExcel(cell.value);
|
|
66641
|
+
const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${exportedValue}</v>`;
|
|
66617
66642
|
return { attrs, node };
|
|
66618
66643
|
}
|
|
66619
66644
|
function addContent(content, sharedStrings, forceString = false) {
|
|
@@ -66648,8 +66673,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66648
66673
|
ast = addMissingRequiredArgs(ast);
|
|
66649
66674
|
return ast;
|
|
66650
66675
|
});
|
|
66676
|
+
ast = convertAstNodes(ast, "REFERENCE", (ast) => {
|
|
66677
|
+
return ast.value === CellErrorType.InvalidReference ? { ...ast, value: "#REF!" } : ast;
|
|
66678
|
+
});
|
|
66651
66679
|
return ast ? astToFormula(ast) : formulaText;
|
|
66652
66680
|
}
|
|
66681
|
+
function adaptFormulaValueToExcel(formulaValue) {
|
|
66682
|
+
return formulaValue === CellErrorType.InvalidReference ? "#REF!" : formulaValue;
|
|
66683
|
+
}
|
|
66653
66684
|
/**
|
|
66654
66685
|
* Some Excel function need required args that might not be mandatory in o-spreadsheet.
|
|
66655
66686
|
* This adds those missing args.
|
|
@@ -68650,9 +68681,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68650
68681
|
exports.tokenize = tokenize;
|
|
68651
68682
|
|
|
68652
68683
|
|
|
68653
|
-
__info__.version = "17.4.
|
|
68654
|
-
__info__.date = "2024-
|
|
68655
|
-
__info__.hash = "
|
|
68684
|
+
__info__.version = "17.4.12";
|
|
68685
|
+
__info__.date = "2024-11-13T15:06:56.109Z";
|
|
68686
|
+
__info__.hash = "5cde4be";
|
|
68656
68687
|
|
|
68657
68688
|
|
|
68658
68689
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|