[FIX] spreadsheet: update o_spreadsheet to latest version

### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/ed67be7d1 [REL] 17.0.13
https://github.com/odoo/o-spreadsheet/commit/895edf0f0 [FIX] Migration: Propagate datafilter correction on every version Task: 3728009
https://github.com/odoo/o-spreadsheet/commit/b16809114 [FIX] migration: Fix migration steps Task: 3771209
https://github.com/odoo/o-spreadsheet/commit/fd9e140a7 [IMP] cssPropertiesToCss: don't use `Object.entries()`
https://github.com/odoo/o-spreadsheet/commit/df828b3d1 [FIX] selection_inputs_manager: arrow keys when broken ranges
https://github.com/odoo/o-spreadsheet/commit/799b7575e [IMP] formula: add INT function Task: 3756478

closes odoo/odoo#155731

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
This commit is contained in:
Pierre Rousseau
2024-02-28 19:49:14 +00:00
parent 440e6a5b86
commit c85efc0473
2 changed files with 71 additions and 46 deletions
@@ -2,9 +2,9 @@
/**
* This file is generated by o-spreadsheet build tools. Do not edit it.
* @see https://github.com/odoo/o-spreadsheet
* @version 17.0.12
* @date 2024-02-16T15:05:31.161Z
* @hash 8fa2bab99
* @version 17.0.13
* @date 2024-02-28T12:48:27.246Z
* @hash ed67be7d1
*/
(function (exports, owl) {
@@ -6283,11 +6283,14 @@
* Transform CSS properties into a CSS string.
*/
function cssPropertiesToCss(attributes) {
const str = Object.entries(attributes)
.filter(([attName, attValue]) => attValue !== undefined)
.map(([attName, attValue]) => `${attName}:${attValue};`)
.join(" ");
return str;
let styleStr = "";
for (const attName in attributes) {
if (!attributes[attName]) {
continue;
}
styleStr += `${attName}:${attributes[attName]}; `;
}
return styleStr;
}
function getElementMargins(el) {
const style = window.getComputedStyle(el);
@@ -12924,6 +12927,18 @@
},
isExported: true,
};
// -----------------------------------------------------------------------------
// INT
// -----------------------------------------------------------------------------
const INT = {
description: _t("Rounds a number down to the nearest integer that is less than or equal to it."),
args: [arg("value (number)", _t("The number to round down to the nearest integer."))],
returns: ["NUMBER"],
compute: function (value) {
return Math.floor(toNumber(value, this.locale));
},
isExported: true,
};
var math = /*#__PURE__*/Object.freeze({
__proto__: null,
@@ -12957,6 +12972,7 @@
FLOOR: FLOOR,
FLOOR_MATH: FLOOR_MATH,
FLOOR_PRECISE: FLOOR_PRECISE,
INT: INT,
ISEVEN: ISEVEN,
ISODD: ISODD,
ISO_CEILING: ISO_CEILING,
@@ -21395,7 +21411,7 @@
? existingSelectionRanges
: this.props.ranges().map((xc, id) => ({
xc,
id,
id: id + 1,
isFocused: false,
}));
return ranges.map((range) => ({
@@ -33828,29 +33844,12 @@
from: 12,
to: 12.5,
applyMigration(data) {
for (let sheet of data.sheets || []) {
let knownDataFilterZones = [];
for (let filterTable of sheet.filterTables || []) {
const zone = toZone(filterTable.range);
// See commit message for the details
const intersectZoneIndex = knownDataFilterZones.findIndex((knownZone) => overlap(knownZone, zone));
if (intersectZoneIndex !== -1) {
knownDataFilterZones[intersectZoneIndex] = zone;
}
else {
knownDataFilterZones.push(zone);
}
}
sheet.filterTables = knownDataFilterZones.map((zone) => ({
range: zoneToXc(zone),
}));
}
return data;
return fixOverlappingFilters(data);
},
},
{
description: "Change Border description structure",
from: 12,
from: 12.5,
to: 13,
applyMigration(data) {
for (const borderId in data.borders) {
@@ -33881,6 +33880,14 @@
return data;
},
},
{
description: "Fix datafilter duplication (post saas-16.4)",
from: 14,
to: 14.5,
applyMigration(data) {
return fixOverlappingFilters(data);
},
},
];
/**
* This function is used to repair faulty data independently of the migration.
@@ -34038,6 +34045,26 @@
}
return messages;
}
function fixOverlappingFilters(data) {
for (let sheet of data.sheets || []) {
let knownDataFilterZones = [];
for (let filterTable of sheet.filterTables || []) {
const zone = toZone(filterTable.range);
// See commit message of https://github.com/odoo/o-spreadsheet/pull/3632 of more details
const intersectZoneIndex = knownDataFilterZones.findIndex((knownZone) => overlap(knownZone, zone));
if (intersectZoneIndex !== -1) {
knownDataFilterZones[intersectZoneIndex] = zone;
}
else {
knownDataFilterZones.push(zone);
}
}
sheet.filterTables = knownDataFilterZones.map((zone) => ({
range: zoneToXc(zone),
}));
}
return data;
}
// -----------------------------------------------------------------------------
// Helpers
// -----------------------------------------------------------------------------
@@ -46428,19 +46455,17 @@
break;
case "FOCUS_RANGE":
case "CHANGE_RANGE":
if (cmd.id !== this.focusedInputId) {
const input = this.inputs[cmd.id];
const range = input.ranges.find((range) => range.id === cmd.rangeId);
if (this.isRangeValid(range?.xc || "A1")) {
const sheetId = this.getters.getActiveSheetId();
const zone = this.getters.getRangeFromSheetXC(sheetId, range?.xc || "A1").zone;
this.selection.capture(input, { cell: { col: zone.left, row: zone.top }, zone }, {
handleEvent: input.handleEvent.bind(input),
release: () => (this.focusedInputId = null),
});
}
this.focusedInputId = cmd.id;
const input = this.inputs[cmd.id];
const range = input.ranges.find((range) => range.id === cmd.rangeId);
if (range) {
const sheetId = this.getters.getActiveSheetId();
const zone = this.getters.getRangeFromSheetXC(sheetId, range?.xc || "A1").zone;
this.selection.capture(input, { cell: { col: zone.left, row: zone.top }, zone }, {
handleEvent: input.handleEvent.bind(input),
release: () => (this.focusedInputId = null),
});
}
this.focusedInputId = cmd.id;
break;
}
this.currentInput?.handle(cmd);
@@ -56915,9 +56940,9 @@
exports.tokenize = tokenize;
__info__.version = "17.0.12";
__info__.date = "2024-02-16T15:05:31.161Z";
__info__.hash = "8fa2bab99";
__info__.version = "17.0.13";
__info__.date = "2024-02-28T12:48:27.246Z";
__info__.hash = "ed67be7d1";
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -1,9 +1,9 @@
<!--
This file is generated by o-spreadsheet build tools. Do not edit it.
@see https://github.com/odoo/o-spreadsheet
@version 17.0.12
@date 2024-02-16T15:05:35.986Z
@hash 8fa2bab99
@version 17.0.13
@date 2024-02-28T12:48:30.083Z
@hash ed67be7d1
-->
<odoo>
<t t-name="o-spreadsheet-ActionButton">