From 700f4244b20fe9a3ef187ac357e5bda298819e8d Mon Sep 17 00:00:00 2001 From: Vincent Schippefilt Date: Fri, 15 Mar 2024 13:12:11 +0100 Subject: [PATCH] [FIX] spreadsheet: update o_spreadsheet to latest version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Contains the following commits: https://github.com/odoo/o-spreadsheet/commit/e02add99e [REL] 17.0.15 https://github.com/odoo/o-spreadsheet/commit/0695b634e [FIX] figures: deleting a sheet will remove all figures https://github.com/odoo/o-spreadsheet/commit/6d5aea9bd [FIX] FiguresContainer: chart resizing broken https://github.com/odoo/o-spreadsheet/commit/1e7367209 [FIX] sheet_interactive: rename sheet in readonly mode closes odoo/odoo#157855 Signed-off-by: Lucas Lefèvre (lul) --- .../static/src/o_spreadsheet/o_spreadsheet.js | 42 ++++++++++++------- .../src/o_spreadsheet/o_spreadsheet.xml | 6 +-- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js b/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js index 112d959f3cb..a9f6e836698 100644 --- a/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js +++ b/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js @@ -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.14 - * @date 2024-03-12T08:05:09.046Z - * @hash 6f6e1b9dd + * @version 17.0.15 + * @date 2024-03-15T12:12:08.617Z + * @hash e02add99e */ (function (exports, owl) { @@ -27543,7 +27543,7 @@ function clamp(value, min, max) { return Math.min(Math.max(value, min), max); } - function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) { + function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) { let { x, y, width, height } = initialFigure; if (keepRatio && dirX != 0 && dirY != 0) { const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize); @@ -27570,14 +27570,14 @@ y = initialFigure.y - deltaY; } } - // Restrict resizing if x or y reaches header boundaries - if (x < 0) { - width += x; - x = 0; + // Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing. + if (x + scrollX <= 0) { + width = width + x + scrollX; + x = -scrollX; } - if (y < 0) { - height += y; - y = 0; + if (y + scrollY <= 0) { + height = height + y + scrollY; + y = -scrollY; } return { ...initialFigure, x, y, width, height }; } @@ -27994,7 +27994,7 @@ const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE; const onMouseMove = (ev) => { const currentMousePosition = { x: ev.clientX, y: ev.clientY }; - const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize); + const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo()); const otherFigures = this.getOtherFigures(figure.id); const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures); this.dnd.draggedFigure = snapResult.snappedFigure; @@ -36824,6 +36824,15 @@ return "Success" /* CommandResult.Success */; } } + beforeHandle(cmd) { + switch (cmd.type) { + case "DELETE_SHEET": + this.getters.getFigures(cmd.sheetId).forEach((figure) => { + this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId }); + }); + break; + } + } handle(cmd) { switch (cmd.type) { case "CREATE_SHEET": @@ -51181,6 +51190,9 @@ this.scrollToSheet(); } onDblClick() { + if (this.env.model.getters.isReadonly()) { + return; + } this.startEdition(); } onKeyDown(ev) { @@ -56955,9 +56967,9 @@ exports.tokenize = tokenize; - __info__.version = "17.0.14"; - __info__.date = "2024-03-12T08:05:09.046Z"; - __info__.hash = "6f6e1b9dd"; + __info__.version = "17.0.15"; + __info__.date = "2024-03-15T12:12:08.617Z"; + __info__.hash = "e02add99e"; })(this.o_spreadsheet = this.o_spreadsheet || {}, owl); diff --git a/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.xml b/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.xml index 34f09ea472c..0fcd6068504 100644 --- a/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.xml +++ b/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.xml @@ -1,9 +1,9 @@