@odoo/o-spreadsheet 16.4.25 → 16.4.27

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.
@@ -19042,14 +19042,19 @@ const categorieFunctionAll = {
19042
19042
  children: [allFunctionListMenuBuilder],
19043
19043
  };
19044
19044
  function allFunctionListMenuBuilder() {
19045
- const fnNames = functionRegistry.getKeys();
19045
+ const fnNames = functionRegistry.getKeys().filter((key) => !functionRegistry.get(key).hidden);
19046
19046
  return createFormulaFunctions(fnNames);
19047
19047
  }
19048
19048
  const categoriesFunctionListMenuBuilder = () => {
19049
19049
  const functions = functionRegistry.content;
19050
- const categories = [...new Set(functionRegistry.getAll().map((fn) => fn.category))].filter(isDefined$1);
19050
+ const categories = [
19051
+ ...new Set(functionRegistry
19052
+ .getAll()
19053
+ .filter((fn) => !fn.hidden)
19054
+ .map((fn) => fn.category)),
19055
+ ].filter(isDefined$1);
19051
19056
  return categories.sort().map((category, i) => {
19052
- const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category);
19057
+ const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category && !functions[key].hidden);
19053
19058
  return {
19054
19059
  name: category,
19055
19060
  children: createFormulaFunctions(functionsInCategory),
@@ -23390,6 +23395,9 @@ class FigureComponent extends owl.Component {
23390
23395
  el?.focus({ preventScroll: true });
23391
23396
  }
23392
23397
  }, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
23398
+ owl.onWillUnmount(() => {
23399
+ this.props.onFigureDeleted();
23400
+ });
23393
23401
  }
23394
23402
  clickAnchor(dirX, dirY, ev) {
23395
23403
  this.props.onClickAnchor(dirX, dirY, ev);
@@ -23408,6 +23416,7 @@ class FigureComponent extends owl.Component {
23408
23416
  this.props.onFigureDeleted();
23409
23417
  ev.stopPropagation();
23410
23418
  ev.preventDefault();
23419
+ ev.stopPropagation();
23411
23420
  break;
23412
23421
  case "ArrowDown":
23413
23422
  case "ArrowLeft":
@@ -23428,6 +23437,7 @@ class FigureComponent extends owl.Component {
23428
23437
  });
23429
23438
  ev.stopPropagation();
23430
23439
  ev.preventDefault();
23440
+ ev.stopPropagation();
23431
23441
  break;
23432
23442
  }
23433
23443
  }
@@ -24030,6 +24040,9 @@ class FunctionDescriptionProvider extends owl.Component {
24030
24040
  this.assistantState.allowCellSelectionBehind = false;
24031
24041
  }, 2000);
24032
24042
  }
24043
+ get formulaArgSeparator() {
24044
+ return this.env.model.getters.getLocale().formulaArgSeparator + " ";
24045
+ }
24033
24046
  }
24034
24047
  FunctionDescriptionProvider.props = {
24035
24048
  functionName: String,
@@ -24164,6 +24177,12 @@ class Composer extends owl.Component {
24164
24177
  owl.useEffect(() => {
24165
24178
  this.processContent();
24166
24179
  });
24180
+ owl.onPatched(() => {
24181
+ // Required because typing '=SUM' and double-clicking another cell leaves ShowProvider/ShowDescription true
24182
+ if (this.env.model.getters.getEditionMode() === "inactive") {
24183
+ this.processTokenAtCursor();
24184
+ }
24185
+ });
24167
24186
  }
24168
24187
  // ---------------------------------------------------------------------------
24169
24188
  // Handlers
@@ -24951,7 +24970,7 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
24951
24970
  function clamp(value, min, max) {
24952
24971
  return Math.min(Math.max(value, min), max);
24953
24972
  }
24954
- function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
24973
+ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
24955
24974
  let { x, y, width, height } = initialFigure;
24956
24975
  if (keepRatio && dirX != 0 && dirY != 0) {
24957
24976
  const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
@@ -24978,14 +24997,14 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
24978
24997
  y = initialFigure.y - deltaY;
24979
24998
  }
24980
24999
  }
24981
- // Restrict resizing if x or y reaches header boundaries
24982
- if (x < 0) {
24983
- width += x;
24984
- x = 0;
25000
+ // Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
25001
+ if (x + scrollX <= 0) {
25002
+ width = width + x + scrollX;
25003
+ x = -scrollX;
24985
25004
  }
24986
- if (y < 0) {
24987
- height += y;
24988
- y = 0;
25005
+ if (y + scrollY <= 0) {
25006
+ height = height + y + scrollY;
25007
+ y = -scrollY;
24989
25008
  }
24990
25009
  return { ...initialFigure, x, y, width, height };
24991
25010
  }
@@ -25402,7 +25421,7 @@ class FiguresContainer extends owl.Component {
25402
25421
  const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
25403
25422
  const onMouseMove = (ev) => {
25404
25423
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
25405
- const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
25424
+ const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
25406
25425
  const otherFigures = this.getOtherFigures(figure.id);
25407
25426
  const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
25408
25427
  this.dnd.draggedFigure = snapResult.snappedFigure;
@@ -32909,6 +32928,15 @@ class FigurePlugin extends CorePlugin {
32909
32928
  return 0 /* CommandResult.Success */;
32910
32929
  }
32911
32930
  }
32931
+ beforeHandle(cmd) {
32932
+ switch (cmd.type) {
32933
+ case "DELETE_SHEET":
32934
+ this.getters.getFigures(cmd.sheetId).forEach((figure) => {
32935
+ this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
32936
+ });
32937
+ break;
32938
+ }
32939
+ }
32912
32940
  handle(cmd) {
32913
32941
  switch (cmd.type) {
32914
32942
  case "CREATE_SHEET":
@@ -44391,6 +44419,7 @@ class GridSelectionPlugin extends UIPlugin {
44391
44419
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
44392
44420
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
44393
44421
  this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
44422
+ this.selectedFigureId = null;
44394
44423
  break;
44395
44424
  }
44396
44425
  /** Any change to the selection has to be reflected in the selection processor. */
@@ -46100,6 +46129,9 @@ class BottomBarSheet extends owl.Component {
46100
46129
  this.scrollToSheet();
46101
46130
  }
46102
46131
  onDblClick() {
46132
+ if (this.env.model.getters.isReadonly()) {
46133
+ return;
46134
+ }
46103
46135
  this.startEdition();
46104
46136
  }
46105
46137
  onKeyDown(ev) {
@@ -51722,6 +51754,6 @@ exports.setTranslationMethod = setTranslationMethod;
51722
51754
  exports.tokenize = tokenize;
51723
51755
 
51724
51756
 
51725
- __info__.version = '16.4.25';
51726
- __info__.date = '2024-03-12T07:54:10.025Z';
51727
- __info__.hash = '182ad16';
51757
+ __info__.version = '16.4.27';
51758
+ __info__.date = '2024-03-25T09:41:12.743Z';
51759
+ __info__.hash = '42e4252';
@@ -3409,6 +3409,7 @@ declare class FigurePlugin extends CorePlugin<FigureState> implements FigureStat
3409
3409
  [sheet: string]: Record<UID, Figure | undefined> | undefined;
3410
3410
  };
3411
3411
  allowDispatch(cmd: CoreCommand): CommandResult;
3412
+ beforeHandle(cmd: CoreCommand): void;
3412
3413
  handle(cmd: CoreCommand): void;
3413
3414
  private onRowColDelete;
3414
3415
  private onRowDeletion;
@@ -6662,13 +6663,14 @@ interface Props$a {
6662
6663
  interface AssistantState {
6663
6664
  allowCellSelectionBehind: boolean;
6664
6665
  }
6665
- declare class FunctionDescriptionProvider extends Component<Props$a> {
6666
+ declare class FunctionDescriptionProvider extends Component<Props$a, SpreadsheetChildEnv> {
6666
6667
  static template: string;
6667
6668
  assistantState: AssistantState;
6668
6669
  private timeOutId;
6669
6670
  setup(): void;
6670
6671
  getContext(): Props$a;
6671
6672
  onMouseMove(): void;
6673
+ get formulaArgSeparator(): string;
6672
6674
  }
6673
6675
 
6674
6676
  type HtmlContent = {
@@ -19038,14 +19038,19 @@ const categorieFunctionAll = {
19038
19038
  children: [allFunctionListMenuBuilder],
19039
19039
  };
19040
19040
  function allFunctionListMenuBuilder() {
19041
- const fnNames = functionRegistry.getKeys();
19041
+ const fnNames = functionRegistry.getKeys().filter((key) => !functionRegistry.get(key).hidden);
19042
19042
  return createFormulaFunctions(fnNames);
19043
19043
  }
19044
19044
  const categoriesFunctionListMenuBuilder = () => {
19045
19045
  const functions = functionRegistry.content;
19046
- const categories = [...new Set(functionRegistry.getAll().map((fn) => fn.category))].filter(isDefined$1);
19046
+ const categories = [
19047
+ ...new Set(functionRegistry
19048
+ .getAll()
19049
+ .filter((fn) => !fn.hidden)
19050
+ .map((fn) => fn.category)),
19051
+ ].filter(isDefined$1);
19047
19052
  return categories.sort().map((category, i) => {
19048
- const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category);
19053
+ const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category && !functions[key].hidden);
19049
19054
  return {
19050
19055
  name: category,
19051
19056
  children: createFormulaFunctions(functionsInCategory),
@@ -23386,6 +23391,9 @@ class FigureComponent extends Component {
23386
23391
  el?.focus({ preventScroll: true });
23387
23392
  }
23388
23393
  }, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
23394
+ onWillUnmount(() => {
23395
+ this.props.onFigureDeleted();
23396
+ });
23389
23397
  }
23390
23398
  clickAnchor(dirX, dirY, ev) {
23391
23399
  this.props.onClickAnchor(dirX, dirY, ev);
@@ -23404,6 +23412,7 @@ class FigureComponent extends Component {
23404
23412
  this.props.onFigureDeleted();
23405
23413
  ev.stopPropagation();
23406
23414
  ev.preventDefault();
23415
+ ev.stopPropagation();
23407
23416
  break;
23408
23417
  case "ArrowDown":
23409
23418
  case "ArrowLeft":
@@ -23424,6 +23433,7 @@ class FigureComponent extends Component {
23424
23433
  });
23425
23434
  ev.stopPropagation();
23426
23435
  ev.preventDefault();
23436
+ ev.stopPropagation();
23427
23437
  break;
23428
23438
  }
23429
23439
  }
@@ -24026,6 +24036,9 @@ class FunctionDescriptionProvider extends Component {
24026
24036
  this.assistantState.allowCellSelectionBehind = false;
24027
24037
  }, 2000);
24028
24038
  }
24039
+ get formulaArgSeparator() {
24040
+ return this.env.model.getters.getLocale().formulaArgSeparator + " ";
24041
+ }
24029
24042
  }
24030
24043
  FunctionDescriptionProvider.props = {
24031
24044
  functionName: String,
@@ -24160,6 +24173,12 @@ class Composer extends Component {
24160
24173
  useEffect(() => {
24161
24174
  this.processContent();
24162
24175
  });
24176
+ onPatched(() => {
24177
+ // Required because typing '=SUM' and double-clicking another cell leaves ShowProvider/ShowDescription true
24178
+ if (this.env.model.getters.getEditionMode() === "inactive") {
24179
+ this.processTokenAtCursor();
24180
+ }
24181
+ });
24163
24182
  }
24164
24183
  // ---------------------------------------------------------------------------
24165
24184
  // Handlers
@@ -24947,7 +24966,7 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
24947
24966
  function clamp(value, min, max) {
24948
24967
  return Math.min(Math.max(value, min), max);
24949
24968
  }
24950
- function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
24969
+ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
24951
24970
  let { x, y, width, height } = initialFigure;
24952
24971
  if (keepRatio && dirX != 0 && dirY != 0) {
24953
24972
  const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
@@ -24974,14 +24993,14 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
24974
24993
  y = initialFigure.y - deltaY;
24975
24994
  }
24976
24995
  }
24977
- // Restrict resizing if x or y reaches header boundaries
24978
- if (x < 0) {
24979
- width += x;
24980
- x = 0;
24996
+ // Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
24997
+ if (x + scrollX <= 0) {
24998
+ width = width + x + scrollX;
24999
+ x = -scrollX;
24981
25000
  }
24982
- if (y < 0) {
24983
- height += y;
24984
- y = 0;
25001
+ if (y + scrollY <= 0) {
25002
+ height = height + y + scrollY;
25003
+ y = -scrollY;
24985
25004
  }
24986
25005
  return { ...initialFigure, x, y, width, height };
24987
25006
  }
@@ -25398,7 +25417,7 @@ class FiguresContainer extends Component {
25398
25417
  const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
25399
25418
  const onMouseMove = (ev) => {
25400
25419
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
25401
- const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
25420
+ const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
25402
25421
  const otherFigures = this.getOtherFigures(figure.id);
25403
25422
  const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
25404
25423
  this.dnd.draggedFigure = snapResult.snappedFigure;
@@ -32905,6 +32924,15 @@ class FigurePlugin extends CorePlugin {
32905
32924
  return 0 /* CommandResult.Success */;
32906
32925
  }
32907
32926
  }
32927
+ beforeHandle(cmd) {
32928
+ switch (cmd.type) {
32929
+ case "DELETE_SHEET":
32930
+ this.getters.getFigures(cmd.sheetId).forEach((figure) => {
32931
+ this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
32932
+ });
32933
+ break;
32934
+ }
32935
+ }
32908
32936
  handle(cmd) {
32909
32937
  switch (cmd.type) {
32910
32938
  case "CREATE_SHEET":
@@ -44387,6 +44415,7 @@ class GridSelectionPlugin extends UIPlugin {
44387
44415
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
44388
44416
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
44389
44417
  this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
44418
+ this.selectedFigureId = null;
44390
44419
  break;
44391
44420
  }
44392
44421
  /** Any change to the selection has to be reflected in the selection processor. */
@@ -46096,6 +46125,9 @@ class BottomBarSheet extends Component {
46096
46125
  this.scrollToSheet();
46097
46126
  }
46098
46127
  onDblClick() {
46128
+ if (this.env.model.getters.isReadonly()) {
46129
+ return;
46130
+ }
46099
46131
  this.startEdition();
46100
46132
  }
46101
46133
  onKeyDown(ev) {
@@ -51686,6 +51718,6 @@ const constants = {
51686
51718
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
51687
51719
 
51688
51720
 
51689
- __info__.version = '16.4.25';
51690
- __info__.date = '2024-03-12T07:54:10.025Z';
51691
- __info__.hash = '182ad16';
51721
+ __info__.version = '16.4.27';
51722
+ __info__.date = '2024-03-25T09:41:12.743Z';
51723
+ __info__.hash = '42e4252';
@@ -19039,14 +19039,19 @@
19039
19039
  children: [allFunctionListMenuBuilder],
19040
19040
  };
19041
19041
  function allFunctionListMenuBuilder() {
19042
- const fnNames = functionRegistry.getKeys();
19042
+ const fnNames = functionRegistry.getKeys().filter((key) => !functionRegistry.get(key).hidden);
19043
19043
  return createFormulaFunctions(fnNames);
19044
19044
  }
19045
19045
  const categoriesFunctionListMenuBuilder = () => {
19046
19046
  const functions = functionRegistry.content;
19047
- const categories = [...new Set(functionRegistry.getAll().map((fn) => fn.category))].filter(isDefined$1);
19047
+ const categories = [
19048
+ ...new Set(functionRegistry
19049
+ .getAll()
19050
+ .filter((fn) => !fn.hidden)
19051
+ .map((fn) => fn.category)),
19052
+ ].filter(isDefined$1);
19048
19053
  return categories.sort().map((category, i) => {
19049
- const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category);
19054
+ const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category && !functions[key].hidden);
19050
19055
  return {
19051
19056
  name: category,
19052
19057
  children: createFormulaFunctions(functionsInCategory),
@@ -23387,6 +23392,9 @@
23387
23392
  el?.focus({ preventScroll: true });
23388
23393
  }
23389
23394
  }, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
23395
+ owl.onWillUnmount(() => {
23396
+ this.props.onFigureDeleted();
23397
+ });
23390
23398
  }
23391
23399
  clickAnchor(dirX, dirY, ev) {
23392
23400
  this.props.onClickAnchor(dirX, dirY, ev);
@@ -23405,6 +23413,7 @@
23405
23413
  this.props.onFigureDeleted();
23406
23414
  ev.stopPropagation();
23407
23415
  ev.preventDefault();
23416
+ ev.stopPropagation();
23408
23417
  break;
23409
23418
  case "ArrowDown":
23410
23419
  case "ArrowLeft":
@@ -23425,6 +23434,7 @@
23425
23434
  });
23426
23435
  ev.stopPropagation();
23427
23436
  ev.preventDefault();
23437
+ ev.stopPropagation();
23428
23438
  break;
23429
23439
  }
23430
23440
  }
@@ -24027,6 +24037,9 @@
24027
24037
  this.assistantState.allowCellSelectionBehind = false;
24028
24038
  }, 2000);
24029
24039
  }
24040
+ get formulaArgSeparator() {
24041
+ return this.env.model.getters.getLocale().formulaArgSeparator + " ";
24042
+ }
24030
24043
  }
24031
24044
  FunctionDescriptionProvider.props = {
24032
24045
  functionName: String,
@@ -24161,6 +24174,12 @@
24161
24174
  owl.useEffect(() => {
24162
24175
  this.processContent();
24163
24176
  });
24177
+ owl.onPatched(() => {
24178
+ // Required because typing '=SUM' and double-clicking another cell leaves ShowProvider/ShowDescription true
24179
+ if (this.env.model.getters.getEditionMode() === "inactive") {
24180
+ this.processTokenAtCursor();
24181
+ }
24182
+ });
24164
24183
  }
24165
24184
  // ---------------------------------------------------------------------------
24166
24185
  // Handlers
@@ -24948,7 +24967,7 @@
24948
24967
  function clamp(value, min, max) {
24949
24968
  return Math.min(Math.max(value, min), max);
24950
24969
  }
24951
- function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
24970
+ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
24952
24971
  let { x, y, width, height } = initialFigure;
24953
24972
  if (keepRatio && dirX != 0 && dirY != 0) {
24954
24973
  const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
@@ -24975,14 +24994,14 @@
24975
24994
  y = initialFigure.y - deltaY;
24976
24995
  }
24977
24996
  }
24978
- // Restrict resizing if x or y reaches header boundaries
24979
- if (x < 0) {
24980
- width += x;
24981
- x = 0;
24997
+ // Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
24998
+ if (x + scrollX <= 0) {
24999
+ width = width + x + scrollX;
25000
+ x = -scrollX;
24982
25001
  }
24983
- if (y < 0) {
24984
- height += y;
24985
- y = 0;
25002
+ if (y + scrollY <= 0) {
25003
+ height = height + y + scrollY;
25004
+ y = -scrollY;
24986
25005
  }
24987
25006
  return { ...initialFigure, x, y, width, height };
24988
25007
  }
@@ -25399,7 +25418,7 @@
25399
25418
  const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
25400
25419
  const onMouseMove = (ev) => {
25401
25420
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
25402
- const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
25421
+ const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
25403
25422
  const otherFigures = this.getOtherFigures(figure.id);
25404
25423
  const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
25405
25424
  this.dnd.draggedFigure = snapResult.snappedFigure;
@@ -32906,6 +32925,15 @@
32906
32925
  return 0 /* CommandResult.Success */;
32907
32926
  }
32908
32927
  }
32928
+ beforeHandle(cmd) {
32929
+ switch (cmd.type) {
32930
+ case "DELETE_SHEET":
32931
+ this.getters.getFigures(cmd.sheetId).forEach((figure) => {
32932
+ this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
32933
+ });
32934
+ break;
32935
+ }
32936
+ }
32909
32937
  handle(cmd) {
32910
32938
  switch (cmd.type) {
32911
32939
  case "CREATE_SHEET":
@@ -44388,6 +44416,7 @@
44388
44416
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
44389
44417
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
44390
44418
  this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
44419
+ this.selectedFigureId = null;
44391
44420
  break;
44392
44421
  }
44393
44422
  /** Any change to the selection has to be reflected in the selection processor. */
@@ -46097,6 +46126,9 @@
46097
46126
  this.scrollToSheet();
46098
46127
  }
46099
46128
  onDblClick() {
46129
+ if (this.env.model.getters.isReadonly()) {
46130
+ return;
46131
+ }
46100
46132
  this.startEdition();
46101
46133
  }
46102
46134
  onKeyDown(ev) {
@@ -51721,9 +51753,9 @@
51721
51753
  Object.defineProperty(exports, '__esModule', { value: true });
51722
51754
 
51723
51755
 
51724
- __info__.version = '16.4.25';
51725
- __info__.date = '2024-03-12T07:54:10.025Z';
51726
- __info__.hash = '182ad16';
51756
+ __info__.version = '16.4.27';
51757
+ __info__.date = '2024-03-25T09:41:12.743Z';
51758
+ __info__.hash = '42e4252';
51727
51759
 
51728
51760
 
51729
51761
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);