@odoo/o-spreadsheet 16.3.33 → 16.3.35
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.
|
@@ -6871,7 +6871,7 @@ function truncateLabel(label) {
|
|
|
6871
6871
|
/**
|
|
6872
6872
|
* Get a default chart js configuration
|
|
6873
6873
|
*/
|
|
6874
|
-
function getDefaultChartJsRuntime(chart, labels, fontColor, dataSetsFormat) {
|
|
6874
|
+
function getDefaultChartJsRuntime(chart, labels, fontColor, dataSetsFormat, truncateLabels = true) {
|
|
6875
6875
|
return {
|
|
6876
6876
|
type: chart.type,
|
|
6877
6877
|
options: {
|
|
@@ -6924,7 +6924,7 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, dataSetsFormat) {
|
|
|
6924
6924
|
},
|
|
6925
6925
|
},
|
|
6926
6926
|
data: {
|
|
6927
|
-
labels: labels.map(truncateLabel),
|
|
6927
|
+
labels: truncateLabels ? labels.map(truncateLabel) : labels,
|
|
6928
6928
|
datasets: [],
|
|
6929
6929
|
},
|
|
6930
6930
|
};
|
|
@@ -7763,9 +7763,9 @@ function canBeLinearChart(labelRange, getters) {
|
|
|
7763
7763
|
}
|
|
7764
7764
|
return true;
|
|
7765
7765
|
}
|
|
7766
|
-
function getLineConfiguration(chart, labels, dataSetFormat) {
|
|
7766
|
+
function getLineConfiguration(chart, labels, dataSetFormat, truncateLabels) {
|
|
7767
7767
|
const fontColor = chartFontColor(chart.background);
|
|
7768
|
-
const config = getDefaultChartJsRuntime(chart, labels, fontColor, dataSetFormat);
|
|
7768
|
+
const config = getDefaultChartJsRuntime(chart, labels, fontColor, dataSetFormat, truncateLabels);
|
|
7769
7769
|
const legend = {
|
|
7770
7770
|
labels: {
|
|
7771
7771
|
fontColor,
|
|
@@ -7840,8 +7840,9 @@ function createLineChartRuntime(chart, getters) {
|
|
|
7840
7840
|
if (chart.aggregated) {
|
|
7841
7841
|
({ labels, dataSetsValues } = aggregateDataForLabels(labels, dataSetsValues));
|
|
7842
7842
|
}
|
|
7843
|
+
const truncateLabels = axisType === "category";
|
|
7843
7844
|
const dataSetFormat = getChartDatasetFormat(getters, chart.dataSets);
|
|
7844
|
-
const config = getLineConfiguration(chart, labels, dataSetFormat);
|
|
7845
|
+
const config = getLineConfiguration(chart, labels, dataSetFormat, truncateLabels);
|
|
7845
7846
|
const labelFormat = getChartLabelFormat(getters, chart.labelRange);
|
|
7846
7847
|
if (axisType === "time") {
|
|
7847
7848
|
config.options.scales.xAxes[0].type = "time";
|
|
@@ -25961,7 +25962,7 @@ const machine = {
|
|
|
25961
25962
|
function matchReference(tokens) {
|
|
25962
25963
|
let head = 0;
|
|
25963
25964
|
let transitions = machine[State.LeftRef];
|
|
25964
|
-
|
|
25965
|
+
let matchedTokens = "";
|
|
25965
25966
|
while (transitions !== undefined) {
|
|
25966
25967
|
const token = tokens[head++];
|
|
25967
25968
|
if (!token) {
|
|
@@ -25973,15 +25974,15 @@ function matchReference(tokens) {
|
|
|
25973
25974
|
case undefined:
|
|
25974
25975
|
return null;
|
|
25975
25976
|
case State.Found:
|
|
25976
|
-
matchedTokens.
|
|
25977
|
+
matchedTokens += token.value;
|
|
25977
25978
|
tokens.splice(0, head);
|
|
25978
25979
|
return {
|
|
25979
25980
|
type: "REFERENCE",
|
|
25980
|
-
value:
|
|
25981
|
+
value: matchedTokens,
|
|
25981
25982
|
};
|
|
25982
25983
|
default:
|
|
25983
25984
|
transitions = machine[nextState];
|
|
25984
|
-
matchedTokens.
|
|
25985
|
+
matchedTokens += token.value;
|
|
25985
25986
|
break;
|
|
25986
25987
|
}
|
|
25987
25988
|
}
|
|
@@ -29250,7 +29251,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
29250
29251
|
this.clearBorders(cmd.sheetId, cmd.target);
|
|
29251
29252
|
break;
|
|
29252
29253
|
case "REMOVE_COLUMNS_ROWS":
|
|
29253
|
-
for (let el of cmd.elements) {
|
|
29254
|
+
for (let el of [...cmd.elements].sort((a, b) => b - a)) {
|
|
29254
29255
|
if (cmd.dimension === "COL") {
|
|
29255
29256
|
this.shiftBordersHorizontally(cmd.sheetId, el + 1, -1);
|
|
29256
29257
|
}
|
|
@@ -48092,6 +48093,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
48092
48093
|
exports.tokenize = tokenize;
|
|
48093
48094
|
|
|
48094
48095
|
|
|
48095
|
-
__info__.version = '16.3.
|
|
48096
|
-
__info__.date = '2024-
|
|
48097
|
-
__info__.hash = '
|
|
48096
|
+
__info__.version = '16.3.35';
|
|
48097
|
+
__info__.date = '2024-05-15T09:15:19.399Z';
|
|
48098
|
+
__info__.hash = '255caa0';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -7098,7 +7098,7 @@ declare function chartFontColor(backgroundColor: Color | undefined): Color;
|
|
|
7098
7098
|
/**
|
|
7099
7099
|
* Get a default chart js configuration
|
|
7100
7100
|
*/
|
|
7101
|
-
declare function getDefaultChartJsRuntime(chart: AbstractChart, labels: string[], fontColor: Color, dataSetsFormat?: Format | undefined): ChartConfiguration;
|
|
7101
|
+
declare function getDefaultChartJsRuntime(chart: AbstractChart, labels: string[], fontColor: Color, dataSetsFormat?: Format | undefined, truncateLabels?: boolean): ChartConfiguration;
|
|
7102
7102
|
/** See https://www.chartjs.org/docs/latest/charts/area.html#filling-modes */
|
|
7103
7103
|
declare function getFillingMode(index: number): "origin" | number;
|
|
7104
7104
|
|
|
@@ -6867,7 +6867,7 @@ function truncateLabel(label) {
|
|
|
6867
6867
|
/**
|
|
6868
6868
|
* Get a default chart js configuration
|
|
6869
6869
|
*/
|
|
6870
|
-
function getDefaultChartJsRuntime(chart, labels, fontColor, dataSetsFormat) {
|
|
6870
|
+
function getDefaultChartJsRuntime(chart, labels, fontColor, dataSetsFormat, truncateLabels = true) {
|
|
6871
6871
|
return {
|
|
6872
6872
|
type: chart.type,
|
|
6873
6873
|
options: {
|
|
@@ -6920,7 +6920,7 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, dataSetsFormat) {
|
|
|
6920
6920
|
},
|
|
6921
6921
|
},
|
|
6922
6922
|
data: {
|
|
6923
|
-
labels: labels.map(truncateLabel),
|
|
6923
|
+
labels: truncateLabels ? labels.map(truncateLabel) : labels,
|
|
6924
6924
|
datasets: [],
|
|
6925
6925
|
},
|
|
6926
6926
|
};
|
|
@@ -7759,9 +7759,9 @@ function canBeLinearChart(labelRange, getters) {
|
|
|
7759
7759
|
}
|
|
7760
7760
|
return true;
|
|
7761
7761
|
}
|
|
7762
|
-
function getLineConfiguration(chart, labels, dataSetFormat) {
|
|
7762
|
+
function getLineConfiguration(chart, labels, dataSetFormat, truncateLabels) {
|
|
7763
7763
|
const fontColor = chartFontColor(chart.background);
|
|
7764
|
-
const config = getDefaultChartJsRuntime(chart, labels, fontColor, dataSetFormat);
|
|
7764
|
+
const config = getDefaultChartJsRuntime(chart, labels, fontColor, dataSetFormat, truncateLabels);
|
|
7765
7765
|
const legend = {
|
|
7766
7766
|
labels: {
|
|
7767
7767
|
fontColor,
|
|
@@ -7836,8 +7836,9 @@ function createLineChartRuntime(chart, getters) {
|
|
|
7836
7836
|
if (chart.aggregated) {
|
|
7837
7837
|
({ labels, dataSetsValues } = aggregateDataForLabels(labels, dataSetsValues));
|
|
7838
7838
|
}
|
|
7839
|
+
const truncateLabels = axisType === "category";
|
|
7839
7840
|
const dataSetFormat = getChartDatasetFormat(getters, chart.dataSets);
|
|
7840
|
-
const config = getLineConfiguration(chart, labels, dataSetFormat);
|
|
7841
|
+
const config = getLineConfiguration(chart, labels, dataSetFormat, truncateLabels);
|
|
7841
7842
|
const labelFormat = getChartLabelFormat(getters, chart.labelRange);
|
|
7842
7843
|
if (axisType === "time") {
|
|
7843
7844
|
config.options.scales.xAxes[0].type = "time";
|
|
@@ -25957,7 +25958,7 @@ const machine = {
|
|
|
25957
25958
|
function matchReference(tokens) {
|
|
25958
25959
|
let head = 0;
|
|
25959
25960
|
let transitions = machine[State.LeftRef];
|
|
25960
|
-
|
|
25961
|
+
let matchedTokens = "";
|
|
25961
25962
|
while (transitions !== undefined) {
|
|
25962
25963
|
const token = tokens[head++];
|
|
25963
25964
|
if (!token) {
|
|
@@ -25969,15 +25970,15 @@ function matchReference(tokens) {
|
|
|
25969
25970
|
case undefined:
|
|
25970
25971
|
return null;
|
|
25971
25972
|
case State.Found:
|
|
25972
|
-
matchedTokens.
|
|
25973
|
+
matchedTokens += token.value;
|
|
25973
25974
|
tokens.splice(0, head);
|
|
25974
25975
|
return {
|
|
25975
25976
|
type: "REFERENCE",
|
|
25976
|
-
value:
|
|
25977
|
+
value: matchedTokens,
|
|
25977
25978
|
};
|
|
25978
25979
|
default:
|
|
25979
25980
|
transitions = machine[nextState];
|
|
25980
|
-
matchedTokens.
|
|
25981
|
+
matchedTokens += token.value;
|
|
25981
25982
|
break;
|
|
25982
25983
|
}
|
|
25983
25984
|
}
|
|
@@ -29246,7 +29247,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
29246
29247
|
this.clearBorders(cmd.sheetId, cmd.target);
|
|
29247
29248
|
break;
|
|
29248
29249
|
case "REMOVE_COLUMNS_ROWS":
|
|
29249
|
-
for (let el of cmd.elements) {
|
|
29250
|
+
for (let el of [...cmd.elements].sort((a, b) => b - a)) {
|
|
29250
29251
|
if (cmd.dimension === "COL") {
|
|
29251
29252
|
this.shiftBordersHorizontally(cmd.sheetId, el + 1, -1);
|
|
29252
29253
|
}
|
|
@@ -48060,6 +48061,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
48060
48061
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
48061
48062
|
|
|
48062
48063
|
|
|
48063
|
-
__info__.version = '16.3.
|
|
48064
|
-
__info__.date = '2024-
|
|
48065
|
-
__info__.hash = '
|
|
48064
|
+
__info__.version = '16.3.35';
|
|
48065
|
+
__info__.date = '2024-05-15T09:15:19.399Z';
|
|
48066
|
+
__info__.hash = '255caa0';
|
|
@@ -6868,7 +6868,7 @@
|
|
|
6868
6868
|
/**
|
|
6869
6869
|
* Get a default chart js configuration
|
|
6870
6870
|
*/
|
|
6871
|
-
function getDefaultChartJsRuntime(chart, labels, fontColor, dataSetsFormat) {
|
|
6871
|
+
function getDefaultChartJsRuntime(chart, labels, fontColor, dataSetsFormat, truncateLabels = true) {
|
|
6872
6872
|
return {
|
|
6873
6873
|
type: chart.type,
|
|
6874
6874
|
options: {
|
|
@@ -6921,7 +6921,7 @@
|
|
|
6921
6921
|
},
|
|
6922
6922
|
},
|
|
6923
6923
|
data: {
|
|
6924
|
-
labels: labels.map(truncateLabel),
|
|
6924
|
+
labels: truncateLabels ? labels.map(truncateLabel) : labels,
|
|
6925
6925
|
datasets: [],
|
|
6926
6926
|
},
|
|
6927
6927
|
};
|
|
@@ -7760,9 +7760,9 @@
|
|
|
7760
7760
|
}
|
|
7761
7761
|
return true;
|
|
7762
7762
|
}
|
|
7763
|
-
function getLineConfiguration(chart, labels, dataSetFormat) {
|
|
7763
|
+
function getLineConfiguration(chart, labels, dataSetFormat, truncateLabels) {
|
|
7764
7764
|
const fontColor = chartFontColor(chart.background);
|
|
7765
|
-
const config = getDefaultChartJsRuntime(chart, labels, fontColor, dataSetFormat);
|
|
7765
|
+
const config = getDefaultChartJsRuntime(chart, labels, fontColor, dataSetFormat, truncateLabels);
|
|
7766
7766
|
const legend = {
|
|
7767
7767
|
labels: {
|
|
7768
7768
|
fontColor,
|
|
@@ -7837,8 +7837,9 @@
|
|
|
7837
7837
|
if (chart.aggregated) {
|
|
7838
7838
|
({ labels, dataSetsValues } = aggregateDataForLabels(labels, dataSetsValues));
|
|
7839
7839
|
}
|
|
7840
|
+
const truncateLabels = axisType === "category";
|
|
7840
7841
|
const dataSetFormat = getChartDatasetFormat(getters, chart.dataSets);
|
|
7841
|
-
const config = getLineConfiguration(chart, labels, dataSetFormat);
|
|
7842
|
+
const config = getLineConfiguration(chart, labels, dataSetFormat, truncateLabels);
|
|
7842
7843
|
const labelFormat = getChartLabelFormat(getters, chart.labelRange);
|
|
7843
7844
|
if (axisType === "time") {
|
|
7844
7845
|
config.options.scales.xAxes[0].type = "time";
|
|
@@ -25958,7 +25959,7 @@
|
|
|
25958
25959
|
function matchReference(tokens) {
|
|
25959
25960
|
let head = 0;
|
|
25960
25961
|
let transitions = machine[State.LeftRef];
|
|
25961
|
-
|
|
25962
|
+
let matchedTokens = "";
|
|
25962
25963
|
while (transitions !== undefined) {
|
|
25963
25964
|
const token = tokens[head++];
|
|
25964
25965
|
if (!token) {
|
|
@@ -25970,15 +25971,15 @@
|
|
|
25970
25971
|
case undefined:
|
|
25971
25972
|
return null;
|
|
25972
25973
|
case State.Found:
|
|
25973
|
-
matchedTokens.
|
|
25974
|
+
matchedTokens += token.value;
|
|
25974
25975
|
tokens.splice(0, head);
|
|
25975
25976
|
return {
|
|
25976
25977
|
type: "REFERENCE",
|
|
25977
|
-
value:
|
|
25978
|
+
value: matchedTokens,
|
|
25978
25979
|
};
|
|
25979
25980
|
default:
|
|
25980
25981
|
transitions = machine[nextState];
|
|
25981
|
-
matchedTokens.
|
|
25982
|
+
matchedTokens += token.value;
|
|
25982
25983
|
break;
|
|
25983
25984
|
}
|
|
25984
25985
|
}
|
|
@@ -29247,7 +29248,7 @@
|
|
|
29247
29248
|
this.clearBorders(cmd.sheetId, cmd.target);
|
|
29248
29249
|
break;
|
|
29249
29250
|
case "REMOVE_COLUMNS_ROWS":
|
|
29250
|
-
for (let el of cmd.elements) {
|
|
29251
|
+
for (let el of [...cmd.elements].sort((a, b) => b - a)) {
|
|
29251
29252
|
if (cmd.dimension === "COL") {
|
|
29252
29253
|
this.shiftBordersHorizontally(cmd.sheetId, el + 1, -1);
|
|
29253
29254
|
}
|
|
@@ -48091,9 +48092,9 @@
|
|
|
48091
48092
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
48092
48093
|
|
|
48093
48094
|
|
|
48094
|
-
__info__.version = '16.3.
|
|
48095
|
-
__info__.date = '2024-
|
|
48096
|
-
__info__.hash = '
|
|
48095
|
+
__info__.version = '16.3.35';
|
|
48096
|
+
__info__.date = '2024-05-15T09:15:19.399Z';
|
|
48097
|
+
__info__.hash = '255caa0';
|
|
48097
48098
|
|
|
48098
48099
|
|
|
48099
48100
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|