@odoo/o-spreadsheet 16.0.34 → 16.0.36

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.
@@ -20437,6 +20437,10 @@ class Composer extends owl.Component {
20437
20437
  if (!this.isKeyStillDown) {
20438
20438
  this.processContent();
20439
20439
  }
20440
+ // Required because typing '=SUM' and double-clicking another cell leaves ShowProvider and ShowDescription true
20441
+ if (this.env.model.getters.getEditionMode() === "inactive") {
20442
+ this.processTokenAtCursor();
20443
+ }
20440
20444
  });
20441
20445
  }
20442
20446
  // ---------------------------------------------------------------------------
@@ -21149,6 +21153,9 @@ class FigureComponent extends owl.Component {
21149
21153
  el === null || el === void 0 ? void 0 : el.focus({ preventScroll: true });
21150
21154
  }
21151
21155
  }, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
21156
+ owl.onWillUnmount(() => {
21157
+ this.props.onFigureDeleted();
21158
+ });
21152
21159
  }
21153
21160
  clickAnchor(dirX, dirY, ev) {
21154
21161
  this.props.onClickAnchor(dirX, dirY, ev);
@@ -21166,6 +21173,7 @@ class FigureComponent extends owl.Component {
21166
21173
  });
21167
21174
  this.props.onFigureDeleted();
21168
21175
  ev.preventDefault();
21176
+ ev.stopPropagation();
21169
21177
  break;
21170
21178
  case "ArrowDown":
21171
21179
  case "ArrowLeft":
@@ -21185,6 +21193,7 @@ class FigureComponent extends owl.Component {
21185
21193
  y: figure.y + delta[1],
21186
21194
  });
21187
21195
  ev.preventDefault();
21196
+ ev.stopPropagation();
21188
21197
  break;
21189
21198
  }
21190
21199
  }
@@ -21409,6 +21418,7 @@ class FiguresContainer extends owl.Component {
21409
21418
  ev.stopPropagation();
21410
21419
  const initialX = ev.clientX;
21411
21420
  const initialY = ev.clientY;
21421
+ const { scrollX, scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
21412
21422
  const { x: dndInitialX, y: dndInitialY } = this.internalToScreenCoordinates(figure);
21413
21423
  this.dnd.x = dndInitialX;
21414
21424
  this.dnd.y = dndInitialY;
@@ -21427,13 +21437,14 @@ class FiguresContainer extends owl.Component {
21427
21437
  if (dirY < 0) {
21428
21438
  this.dnd.y = dndInitialY - deltaY;
21429
21439
  }
21430
- if (this.dnd.x < 0) {
21431
- this.dnd.width += this.dnd.x;
21432
- this.dnd.x = 0;
21440
+ // Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
21441
+ if (this.dnd.x + scrollX <= 0) {
21442
+ this.dnd.width = this.dnd.width + this.dnd.x + scrollX;
21443
+ this.dnd.x = -scrollX;
21433
21444
  }
21434
- if (this.dnd.y < 0) {
21435
- this.dnd.height += this.dnd.y;
21436
- this.dnd.y = 0;
21445
+ if (this.dnd.y + scrollY <= 0) {
21446
+ this.dnd.height = this.dnd.height + this.dnd.y + scrollY;
21447
+ this.dnd.y = -scrollY;
21437
21448
  }
21438
21449
  };
21439
21450
  const onMouseUp = (ev) => {
@@ -28803,6 +28814,15 @@ class FigurePlugin extends CorePlugin {
28803
28814
  return 0 /* CommandResult.Success */;
28804
28815
  }
28805
28816
  }
28817
+ beforeHandle(cmd) {
28818
+ switch (cmd.type) {
28819
+ case "DELETE_SHEET":
28820
+ this.getters.getFigures(cmd.sheetId).forEach((figure) => {
28821
+ this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
28822
+ });
28823
+ break;
28824
+ }
28825
+ }
28806
28826
  handle(cmd) {
28807
28827
  switch (cmd.type) {
28808
28828
  case "CREATE_SHEET":
@@ -34951,6 +34971,7 @@ class GridSelectionPlugin extends UIPlugin {
34951
34971
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
34952
34972
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
34953
34973
  this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
34974
+ this.selectedFigureId = null;
34954
34975
  break;
34955
34976
  }
34956
34977
  /** Any change to the selection has to be reflected in the selection processor. */
@@ -43274,6 +43295,6 @@ exports.setTranslationMethod = setTranslationMethod;
43274
43295
  exports.tokenize = tokenize;
43275
43296
 
43276
43297
 
43277
- __info__.version = '16.0.34';
43278
- __info__.date = '2024-03-12T07:54:05.304Z';
43279
- __info__.hash = 'e923ddd';
43298
+ __info__.version = '16.0.36';
43299
+ __info__.date = '2024-03-25T09:36:40.811Z';
43300
+ __info__.hash = '2c2117b';
@@ -3328,6 +3328,7 @@ declare class FigurePlugin extends CorePlugin<FigureState> implements FigureStat
3328
3328
  [sheet: string]: Record<UID, Figure | undefined> | undefined;
3329
3329
  };
3330
3330
  allowDispatch(cmd: CoreCommand): CommandResult;
3331
+ beforeHandle(cmd: CoreCommand): void;
3331
3332
  handle(cmd: CoreCommand): void;
3332
3333
  private updateFigure;
3333
3334
  private addFigure;
@@ -20433,6 +20433,10 @@ class Composer extends Component {
20433
20433
  if (!this.isKeyStillDown) {
20434
20434
  this.processContent();
20435
20435
  }
20436
+ // Required because typing '=SUM' and double-clicking another cell leaves ShowProvider and ShowDescription true
20437
+ if (this.env.model.getters.getEditionMode() === "inactive") {
20438
+ this.processTokenAtCursor();
20439
+ }
20436
20440
  });
20437
20441
  }
20438
20442
  // ---------------------------------------------------------------------------
@@ -21145,6 +21149,9 @@ class FigureComponent extends Component {
21145
21149
  el === null || el === void 0 ? void 0 : el.focus({ preventScroll: true });
21146
21150
  }
21147
21151
  }, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
21152
+ onWillUnmount(() => {
21153
+ this.props.onFigureDeleted();
21154
+ });
21148
21155
  }
21149
21156
  clickAnchor(dirX, dirY, ev) {
21150
21157
  this.props.onClickAnchor(dirX, dirY, ev);
@@ -21162,6 +21169,7 @@ class FigureComponent extends Component {
21162
21169
  });
21163
21170
  this.props.onFigureDeleted();
21164
21171
  ev.preventDefault();
21172
+ ev.stopPropagation();
21165
21173
  break;
21166
21174
  case "ArrowDown":
21167
21175
  case "ArrowLeft":
@@ -21181,6 +21189,7 @@ class FigureComponent extends Component {
21181
21189
  y: figure.y + delta[1],
21182
21190
  });
21183
21191
  ev.preventDefault();
21192
+ ev.stopPropagation();
21184
21193
  break;
21185
21194
  }
21186
21195
  }
@@ -21405,6 +21414,7 @@ class FiguresContainer extends Component {
21405
21414
  ev.stopPropagation();
21406
21415
  const initialX = ev.clientX;
21407
21416
  const initialY = ev.clientY;
21417
+ const { scrollX, scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
21408
21418
  const { x: dndInitialX, y: dndInitialY } = this.internalToScreenCoordinates(figure);
21409
21419
  this.dnd.x = dndInitialX;
21410
21420
  this.dnd.y = dndInitialY;
@@ -21423,13 +21433,14 @@ class FiguresContainer extends Component {
21423
21433
  if (dirY < 0) {
21424
21434
  this.dnd.y = dndInitialY - deltaY;
21425
21435
  }
21426
- if (this.dnd.x < 0) {
21427
- this.dnd.width += this.dnd.x;
21428
- this.dnd.x = 0;
21436
+ // Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
21437
+ if (this.dnd.x + scrollX <= 0) {
21438
+ this.dnd.width = this.dnd.width + this.dnd.x + scrollX;
21439
+ this.dnd.x = -scrollX;
21429
21440
  }
21430
- if (this.dnd.y < 0) {
21431
- this.dnd.height += this.dnd.y;
21432
- this.dnd.y = 0;
21441
+ if (this.dnd.y + scrollY <= 0) {
21442
+ this.dnd.height = this.dnd.height + this.dnd.y + scrollY;
21443
+ this.dnd.y = -scrollY;
21433
21444
  }
21434
21445
  };
21435
21446
  const onMouseUp = (ev) => {
@@ -28799,6 +28810,15 @@ class FigurePlugin extends CorePlugin {
28799
28810
  return 0 /* CommandResult.Success */;
28800
28811
  }
28801
28812
  }
28813
+ beforeHandle(cmd) {
28814
+ switch (cmd.type) {
28815
+ case "DELETE_SHEET":
28816
+ this.getters.getFigures(cmd.sheetId).forEach((figure) => {
28817
+ this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
28818
+ });
28819
+ break;
28820
+ }
28821
+ }
28802
28822
  handle(cmd) {
28803
28823
  switch (cmd.type) {
28804
28824
  case "CREATE_SHEET":
@@ -34947,6 +34967,7 @@ class GridSelectionPlugin extends UIPlugin {
34947
34967
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
34948
34968
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
34949
34969
  this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
34970
+ this.selectedFigureId = null;
34950
34971
  break;
34951
34972
  }
34952
34973
  /** Any change to the selection has to be reflected in the selection processor. */
@@ -43242,6 +43263,6 @@ function addFunction(functionName, functionDescription) {
43242
43263
  export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
43243
43264
 
43244
43265
 
43245
- __info__.version = '16.0.34';
43246
- __info__.date = '2024-03-12T07:54:05.304Z';
43247
- __info__.hash = 'e923ddd';
43266
+ __info__.version = '16.0.36';
43267
+ __info__.date = '2024-03-25T09:36:40.811Z';
43268
+ __info__.hash = '2c2117b';
@@ -20434,6 +20434,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20434
20434
  if (!this.isKeyStillDown) {
20435
20435
  this.processContent();
20436
20436
  }
20437
+ // Required because typing '=SUM' and double-clicking another cell leaves ShowProvider and ShowDescription true
20438
+ if (this.env.model.getters.getEditionMode() === "inactive") {
20439
+ this.processTokenAtCursor();
20440
+ }
20437
20441
  });
20438
20442
  }
20439
20443
  // ---------------------------------------------------------------------------
@@ -21146,6 +21150,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21146
21150
  el === null || el === void 0 ? void 0 : el.focus({ preventScroll: true });
21147
21151
  }
21148
21152
  }, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
21153
+ owl.onWillUnmount(() => {
21154
+ this.props.onFigureDeleted();
21155
+ });
21149
21156
  }
21150
21157
  clickAnchor(dirX, dirY, ev) {
21151
21158
  this.props.onClickAnchor(dirX, dirY, ev);
@@ -21163,6 +21170,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21163
21170
  });
21164
21171
  this.props.onFigureDeleted();
21165
21172
  ev.preventDefault();
21173
+ ev.stopPropagation();
21166
21174
  break;
21167
21175
  case "ArrowDown":
21168
21176
  case "ArrowLeft":
@@ -21182,6 +21190,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21182
21190
  y: figure.y + delta[1],
21183
21191
  });
21184
21192
  ev.preventDefault();
21193
+ ev.stopPropagation();
21185
21194
  break;
21186
21195
  }
21187
21196
  }
@@ -21406,6 +21415,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21406
21415
  ev.stopPropagation();
21407
21416
  const initialX = ev.clientX;
21408
21417
  const initialY = ev.clientY;
21418
+ const { scrollX, scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
21409
21419
  const { x: dndInitialX, y: dndInitialY } = this.internalToScreenCoordinates(figure);
21410
21420
  this.dnd.x = dndInitialX;
21411
21421
  this.dnd.y = dndInitialY;
@@ -21424,13 +21434,14 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21424
21434
  if (dirY < 0) {
21425
21435
  this.dnd.y = dndInitialY - deltaY;
21426
21436
  }
21427
- if (this.dnd.x < 0) {
21428
- this.dnd.width += this.dnd.x;
21429
- this.dnd.x = 0;
21437
+ // Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
21438
+ if (this.dnd.x + scrollX <= 0) {
21439
+ this.dnd.width = this.dnd.width + this.dnd.x + scrollX;
21440
+ this.dnd.x = -scrollX;
21430
21441
  }
21431
- if (this.dnd.y < 0) {
21432
- this.dnd.height += this.dnd.y;
21433
- this.dnd.y = 0;
21442
+ if (this.dnd.y + scrollY <= 0) {
21443
+ this.dnd.height = this.dnd.height + this.dnd.y + scrollY;
21444
+ this.dnd.y = -scrollY;
21434
21445
  }
21435
21446
  };
21436
21447
  const onMouseUp = (ev) => {
@@ -28800,6 +28811,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28800
28811
  return 0 /* CommandResult.Success */;
28801
28812
  }
28802
28813
  }
28814
+ beforeHandle(cmd) {
28815
+ switch (cmd.type) {
28816
+ case "DELETE_SHEET":
28817
+ this.getters.getFigures(cmd.sheetId).forEach((figure) => {
28818
+ this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
28819
+ });
28820
+ break;
28821
+ }
28822
+ }
28803
28823
  handle(cmd) {
28804
28824
  switch (cmd.type) {
28805
28825
  case "CREATE_SHEET":
@@ -34948,6 +34968,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
34948
34968
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
34949
34969
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
34950
34970
  this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
34971
+ this.selectedFigureId = null;
34951
34972
  break;
34952
34973
  }
34953
34974
  /** Any change to the selection has to be reflected in the selection processor. */
@@ -43273,9 +43294,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43273
43294
  Object.defineProperty(exports, '__esModule', { value: true });
43274
43295
 
43275
43296
 
43276
- __info__.version = '16.0.34';
43277
- __info__.date = '2024-03-12T07:54:05.304Z';
43278
- __info__.hash = 'e923ddd';
43297
+ __info__.version = '16.0.36';
43298
+ __info__.date = '2024-03-25T09:36:40.811Z';
43299
+ __info__.hash = '2c2117b';
43279
43300
 
43280
43301
 
43281
43302
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);