@odoo/o-spreadsheet 17.0.14 → 17.0.16

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.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.0.14
6
- * @date 2024-03-12T07:56:15.364Z
7
- * @hash 6f6e1b9
5
+ * @version 17.0.16
6
+ * @date 2024-03-25T09:42:01.717Z
7
+ * @hash 9b128f8
8
8
  */
9
9
 
10
10
  'use strict';
@@ -11057,6 +11057,9 @@ function makeArg(str, description) {
11057
11057
  result.default = true;
11058
11058
  result.defaultValue = defaultValue;
11059
11059
  }
11060
+ if (types.some((t) => t.startsWith("RANGE"))) {
11061
+ result.acceptMatrix = true;
11062
+ }
11060
11063
  return result;
11061
11064
  }
11062
11065
  /**
@@ -19422,11 +19425,27 @@ class FunctionRegistry extends Registry {
19422
19425
  }
19423
19426
  const descr = addMetaInfoFromArg(addDescr);
19424
19427
  validateArguments(descr.args);
19425
- this.mapping[name] = createComputeFunctionFromDescription(descr);
19428
+ this.mapping[name] = addInputHandling(descr, createComputeFunctionFromDescription(descr));
19426
19429
  super.add(name, descr);
19427
19430
  return this;
19428
19431
  }
19429
19432
  }
19433
+ function addInputHandling(descr, computeFunction) {
19434
+ function computeWithInputHandling(...args) {
19435
+ for (let i = 0; i < args.length; i++) {
19436
+ const argDefinition = descr.args[descr.getArgToFocus(i + 1) - 1];
19437
+ const arg = args[i];
19438
+ if (isMatrix(arg) && !argDefinition.acceptMatrix) {
19439
+ if (arg.length !== 1 || arg[0].length !== 1) {
19440
+ throw new EvaluationError(CellErrorType.GenericError, _t("Function [[FUNCTION_NAME]] expects the parameter '%s' to be a single value or a single cell reference, not a range.", argDefinition.name));
19441
+ }
19442
+ args[i] = arg[0][0];
19443
+ }
19444
+ }
19445
+ return computeFunction.apply(this, args);
19446
+ }
19447
+ return computeWithInputHandling;
19448
+ }
19430
19449
  function createComputeFunctionFromDescription(descr) {
19431
19450
  const computeValueAndFormat = "computeValueAndFormat" in descr;
19432
19451
  const computeValue = "compute" in descr;
@@ -19677,14 +19696,19 @@ const categorieFunctionAll = {
19677
19696
  children: [allFunctionListMenuBuilder],
19678
19697
  };
19679
19698
  function allFunctionListMenuBuilder() {
19680
- const fnNames = functionRegistry.getKeys();
19699
+ const fnNames = functionRegistry.getKeys().filter((key) => !functionRegistry.get(key).hidden);
19681
19700
  return createFormulaFunctions(fnNames);
19682
19701
  }
19683
19702
  const categoriesFunctionListMenuBuilder = () => {
19684
19703
  const functions = functionRegistry.content;
19685
- const categories = [...new Set(functionRegistry.getAll().map((fn) => fn.category))].filter(isDefined$1);
19704
+ const categories = [
19705
+ ...new Set(functionRegistry
19706
+ .getAll()
19707
+ .filter((fn) => !fn.hidden)
19708
+ .map((fn) => fn.category)),
19709
+ ].filter(isDefined$1);
19686
19710
  return categories.sort().map((category, i) => {
19687
- const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category);
19711
+ const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category && !functions[key].hidden);
19688
19712
  return {
19689
19713
  name: category,
19690
19714
  children: createFormulaFunctions(functionsInCategory),
@@ -23337,11 +23361,9 @@ css /* scss */ `
23337
23361
  }
23338
23362
  .o-cell-is-operator {
23339
23363
  margin-bottom: 5px;
23340
- width: 96%;
23341
23364
  }
23342
23365
  .o-cell-is-value {
23343
23366
  margin-bottom: 5px;
23344
- width: 96%;
23345
23367
  }
23346
23368
  .o-color-picker-widget .o-color-picker-button {
23347
23369
  pointer-events: all;
@@ -25707,6 +25729,9 @@ class FigureComponent extends owl.Component {
25707
25729
  el?.focus({ preventScroll: true });
25708
25730
  }
25709
25731
  }, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
25732
+ owl.onWillUnmount(() => {
25733
+ this.props.onFigureDeleted();
25734
+ });
25710
25735
  }
25711
25736
  clickAnchor(dirX, dirY, ev) {
25712
25737
  this.props.onClickAnchor(dirX, dirY, ev);
@@ -25725,6 +25750,7 @@ class FigureComponent extends owl.Component {
25725
25750
  this.props.onFigureDeleted();
25726
25751
  ev.stopPropagation();
25727
25752
  ev.preventDefault();
25753
+ ev.stopPropagation();
25728
25754
  break;
25729
25755
  case "ArrowDown":
25730
25756
  case "ArrowLeft":
@@ -25745,6 +25771,7 @@ class FigureComponent extends owl.Component {
25745
25771
  });
25746
25772
  ev.stopPropagation();
25747
25773
  ev.preventDefault();
25774
+ ev.stopPropagation();
25748
25775
  break;
25749
25776
  }
25750
25777
  }
@@ -26426,6 +26453,7 @@ function compareContentToSpanElement(content, node) {
26426
26453
  // -----------------------------------------------------------------------------
26427
26454
  css /* scss */ `
26428
26455
  .o-formula-assistant {
26456
+ background: #ffffff;
26429
26457
  .o-formula-assistant-head {
26430
26458
  background-color: #f2f2f2;
26431
26459
  padding: 10px;
@@ -26476,6 +26504,9 @@ class FunctionDescriptionProvider extends owl.Component {
26476
26504
  this.assistantState.allowCellSelectionBehind = false;
26477
26505
  }, 2000);
26478
26506
  }
26507
+ get formulaArgSeparator() {
26508
+ return this.env.model.getters.getLocale().formulaArgSeparator + " ";
26509
+ }
26479
26510
  }
26480
26511
  FunctionDescriptionProvider.props = {
26481
26512
  functionName: String,
@@ -26627,6 +26658,12 @@ class Composer extends owl.Component {
26627
26658
  owl.useEffect(() => {
26628
26659
  this.processContent();
26629
26660
  });
26661
+ owl.onPatched(() => {
26662
+ // Required because typing '=SUM' and double-clicking another cell leaves ShowProvider/ShowDescription true
26663
+ if (this.env.model.getters.getEditionMode() === "inactive") {
26664
+ this.processTokenAtCursor();
26665
+ }
26666
+ });
26630
26667
  }
26631
26668
  // ---------------------------------------------------------------------------
26632
26669
  // Handlers
@@ -27544,7 +27581,7 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
27544
27581
  function clamp(value, min, max) {
27545
27582
  return Math.min(Math.max(value, min), max);
27546
27583
  }
27547
- function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
27584
+ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
27548
27585
  let { x, y, width, height } = initialFigure;
27549
27586
  if (keepRatio && dirX != 0 && dirY != 0) {
27550
27587
  const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
@@ -27571,14 +27608,14 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
27571
27608
  y = initialFigure.y - deltaY;
27572
27609
  }
27573
27610
  }
27574
- // Restrict resizing if x or y reaches header boundaries
27575
- if (x < 0) {
27576
- width += x;
27577
- x = 0;
27611
+ // Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
27612
+ if (x + scrollX <= 0) {
27613
+ width = width + x + scrollX;
27614
+ x = -scrollX;
27578
27615
  }
27579
- if (y < 0) {
27580
- height += y;
27581
- y = 0;
27616
+ if (y + scrollY <= 0) {
27617
+ height = height + y + scrollY;
27618
+ y = -scrollY;
27582
27619
  }
27583
27620
  return { ...initialFigure, x, y, width, height };
27584
27621
  }
@@ -27995,7 +28032,7 @@ class FiguresContainer extends owl.Component {
27995
28032
  const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
27996
28033
  const onMouseMove = (ev) => {
27997
28034
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
27998
- const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
28035
+ const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
27999
28036
  const otherFigures = this.getOtherFigures(figure.id);
28000
28037
  const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
28001
28038
  this.dnd.draggedFigure = snapResult.snappedFigure;
@@ -36825,6 +36862,15 @@ class FigurePlugin extends CorePlugin {
36825
36862
  return "Success" /* CommandResult.Success */;
36826
36863
  }
36827
36864
  }
36865
+ beforeHandle(cmd) {
36866
+ switch (cmd.type) {
36867
+ case "DELETE_SHEET":
36868
+ this.getters.getFigures(cmd.sheetId).forEach((figure) => {
36869
+ this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
36870
+ });
36871
+ break;
36872
+ }
36873
+ }
36828
36874
  handle(cmd) {
36829
36875
  switch (cmd.type) {
36830
36876
  case "CREATE_SHEET":
@@ -41578,7 +41624,7 @@ class EvaluationPlugin extends UIPlugin {
41578
41624
  ? getItemId(newFormat, data.formats)
41579
41625
  : exportedCellData.format;
41580
41626
  let content;
41581
- if (formulaCell instanceof FormulaCellWithDependencies) {
41627
+ if (isFormula && formulaCell instanceof FormulaCellWithDependencies) {
41582
41628
  content = this.getters.getFormulaCellContent(exportedSheetData.id, formulaCell.compiledFormula, formulaCell.compiledFormula.dependencies, true);
41583
41629
  }
41584
41630
  else {
@@ -49288,6 +49334,7 @@ class GridSelectionPlugin extends UIPlugin {
49288
49334
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
49289
49335
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
49290
49336
  this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
49337
+ this.selectedFigureId = null;
49291
49338
  break;
49292
49339
  }
49293
49340
  /** Any change to the selection has to be reflected in the selection processor. */
@@ -51182,6 +51229,9 @@ class BottomBarSheet extends owl.Component {
51182
51229
  this.scrollToSheet();
51183
51230
  }
51184
51231
  onDblClick() {
51232
+ if (this.env.model.getters.isReadonly()) {
51233
+ return;
51234
+ }
51185
51235
  this.startEdition();
51186
51236
  }
51187
51237
  onKeyDown(ev) {
@@ -52862,9 +52912,6 @@ css /* scss */ `
52862
52912
  .text-muted {
52863
52913
  color: grey !important;
52864
52914
  }
52865
- button {
52866
- color: #333;
52867
- }
52868
52915
  .o-disabled {
52869
52916
  opacity: 0.4;
52870
52917
  pointer: default;
@@ -52985,17 +53032,17 @@ css /* scss */ `
52985
53032
  }
52986
53033
 
52987
53034
  .o-button {
52988
- border: 1px solid lightgrey;
53035
+ border: 1px solid;
52989
53036
  padding: 0px 20px 0px 20px;
52990
53037
  border-radius: 4px;
52991
53038
  font-weight: 500;
52992
53039
  font-size: 14px;
52993
53040
  height: 30px;
52994
53041
  line-height: 16px;
52995
- background: white;
52996
53042
  margin-right: 8px;
52997
- &:hover:enabled {
52998
- background-color: rgba(0, 0, 0, 0.08);
53043
+
53044
+ &:not(:hover) {
53045
+ background-color: transparent;
52999
53046
  }
53000
53047
 
53001
53048
  &:enabled {
@@ -53009,6 +53056,15 @@ css /* scss */ `
53009
53056
  &:last-child {
53010
53057
  margin-right: 0px;
53011
53058
  }
53059
+
53060
+ &.o-button-grey {
53061
+ border-color: lightgrey;
53062
+ background: #ffffff;
53063
+ color: #333;
53064
+ &:hover:enabled {
53065
+ background-color: rgba(0, 0, 0, 0.08);
53066
+ }
53067
+ }
53012
53068
  }
53013
53069
 
53014
53070
  .o-input {
@@ -56956,6 +57012,6 @@ exports.setTranslationMethod = setTranslationMethod;
56956
57012
  exports.tokenize = tokenize;
56957
57013
 
56958
57014
 
56959
- __info__.version = "17.0.14";
56960
- __info__.date = "2024-03-12T07:56:15.364Z";
56961
- __info__.hash = "6f6e1b9";
57015
+ __info__.version = "17.0.16";
57016
+ __info__.date = "2024-03-25T09:42:01.717Z";
57017
+ __info__.hash = "9b128f8";
@@ -3122,6 +3122,7 @@ interface SpreadsheetChildEnv extends SpreadsheetEnv {
3122
3122
 
3123
3123
  type ArgType = "ANY" | "BOOLEAN" | "NUMBER" | "STRING" | "DATE" | "RANGE" | "RANGE<BOOLEAN>" | "RANGE<NUMBER>" | "RANGE<DATE>" | "RANGE<STRING>" | "RANGE<ANY>" | "META";
3124
3124
  interface ArgDefinition {
3125
+ acceptMatrix?: boolean;
3125
3126
  repeating?: boolean;
3126
3127
  optional?: boolean;
3127
3128
  lazy?: boolean;
@@ -3660,6 +3661,7 @@ declare class FigurePlugin extends CorePlugin<FigureState> implements FigureStat
3660
3661
  [sheet: string]: Record<UID, Figure | undefined> | undefined;
3661
3662
  };
3662
3663
  allowDispatch(cmd: CoreCommand): CommandResult;
3664
+ beforeHandle(cmd: CoreCommand): void;
3663
3665
  handle(cmd: CoreCommand): void;
3664
3666
  private onRowColDelete;
3665
3667
  private onRowDeletion;
@@ -7179,13 +7181,14 @@ interface Props$a {
7179
7181
  interface AssistantState {
7180
7182
  allowCellSelectionBehind: boolean;
7181
7183
  }
7182
- declare class FunctionDescriptionProvider extends Component<Props$a> {
7184
+ declare class FunctionDescriptionProvider extends Component<Props$a, SpreadsheetChildEnv> {
7183
7185
  static template: string;
7184
7186
  assistantState: AssistantState;
7185
7187
  private timeOutId;
7186
7188
  setup(): void;
7187
7189
  getContext(): Props$a;
7188
7190
  onMouseMove(): void;
7191
+ get formulaArgSeparator(): string;
7189
7192
  }
7190
7193
 
7191
7194
  type HtmlContent = {
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.0.14
6
- * @date 2024-03-12T07:56:15.364Z
7
- * @hash 6f6e1b9
5
+ * @version 17.0.16
6
+ * @date 2024-03-25T09:42:01.717Z
7
+ * @hash 9b128f8
8
8
  */
9
9
 
10
10
  import { Component, useRef, onMounted, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillUnmount, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
@@ -11055,6 +11055,9 @@ function makeArg(str, description) {
11055
11055
  result.default = true;
11056
11056
  result.defaultValue = defaultValue;
11057
11057
  }
11058
+ if (types.some((t) => t.startsWith("RANGE"))) {
11059
+ result.acceptMatrix = true;
11060
+ }
11058
11061
  return result;
11059
11062
  }
11060
11063
  /**
@@ -19420,11 +19423,27 @@ class FunctionRegistry extends Registry {
19420
19423
  }
19421
19424
  const descr = addMetaInfoFromArg(addDescr);
19422
19425
  validateArguments(descr.args);
19423
- this.mapping[name] = createComputeFunctionFromDescription(descr);
19426
+ this.mapping[name] = addInputHandling(descr, createComputeFunctionFromDescription(descr));
19424
19427
  super.add(name, descr);
19425
19428
  return this;
19426
19429
  }
19427
19430
  }
19431
+ function addInputHandling(descr, computeFunction) {
19432
+ function computeWithInputHandling(...args) {
19433
+ for (let i = 0; i < args.length; i++) {
19434
+ const argDefinition = descr.args[descr.getArgToFocus(i + 1) - 1];
19435
+ const arg = args[i];
19436
+ if (isMatrix(arg) && !argDefinition.acceptMatrix) {
19437
+ if (arg.length !== 1 || arg[0].length !== 1) {
19438
+ throw new EvaluationError(CellErrorType.GenericError, _t("Function [[FUNCTION_NAME]] expects the parameter '%s' to be a single value or a single cell reference, not a range.", argDefinition.name));
19439
+ }
19440
+ args[i] = arg[0][0];
19441
+ }
19442
+ }
19443
+ return computeFunction.apply(this, args);
19444
+ }
19445
+ return computeWithInputHandling;
19446
+ }
19428
19447
  function createComputeFunctionFromDescription(descr) {
19429
19448
  const computeValueAndFormat = "computeValueAndFormat" in descr;
19430
19449
  const computeValue = "compute" in descr;
@@ -19675,14 +19694,19 @@ const categorieFunctionAll = {
19675
19694
  children: [allFunctionListMenuBuilder],
19676
19695
  };
19677
19696
  function allFunctionListMenuBuilder() {
19678
- const fnNames = functionRegistry.getKeys();
19697
+ const fnNames = functionRegistry.getKeys().filter((key) => !functionRegistry.get(key).hidden);
19679
19698
  return createFormulaFunctions(fnNames);
19680
19699
  }
19681
19700
  const categoriesFunctionListMenuBuilder = () => {
19682
19701
  const functions = functionRegistry.content;
19683
- const categories = [...new Set(functionRegistry.getAll().map((fn) => fn.category))].filter(isDefined$1);
19702
+ const categories = [
19703
+ ...new Set(functionRegistry
19704
+ .getAll()
19705
+ .filter((fn) => !fn.hidden)
19706
+ .map((fn) => fn.category)),
19707
+ ].filter(isDefined$1);
19684
19708
  return categories.sort().map((category, i) => {
19685
- const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category);
19709
+ const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category && !functions[key].hidden);
19686
19710
  return {
19687
19711
  name: category,
19688
19712
  children: createFormulaFunctions(functionsInCategory),
@@ -23335,11 +23359,9 @@ css /* scss */ `
23335
23359
  }
23336
23360
  .o-cell-is-operator {
23337
23361
  margin-bottom: 5px;
23338
- width: 96%;
23339
23362
  }
23340
23363
  .o-cell-is-value {
23341
23364
  margin-bottom: 5px;
23342
- width: 96%;
23343
23365
  }
23344
23366
  .o-color-picker-widget .o-color-picker-button {
23345
23367
  pointer-events: all;
@@ -25705,6 +25727,9 @@ class FigureComponent extends Component {
25705
25727
  el?.focus({ preventScroll: true });
25706
25728
  }
25707
25729
  }, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
25730
+ onWillUnmount(() => {
25731
+ this.props.onFigureDeleted();
25732
+ });
25708
25733
  }
25709
25734
  clickAnchor(dirX, dirY, ev) {
25710
25735
  this.props.onClickAnchor(dirX, dirY, ev);
@@ -25723,6 +25748,7 @@ class FigureComponent extends Component {
25723
25748
  this.props.onFigureDeleted();
25724
25749
  ev.stopPropagation();
25725
25750
  ev.preventDefault();
25751
+ ev.stopPropagation();
25726
25752
  break;
25727
25753
  case "ArrowDown":
25728
25754
  case "ArrowLeft":
@@ -25743,6 +25769,7 @@ class FigureComponent extends Component {
25743
25769
  });
25744
25770
  ev.stopPropagation();
25745
25771
  ev.preventDefault();
25772
+ ev.stopPropagation();
25746
25773
  break;
25747
25774
  }
25748
25775
  }
@@ -26424,6 +26451,7 @@ function compareContentToSpanElement(content, node) {
26424
26451
  // -----------------------------------------------------------------------------
26425
26452
  css /* scss */ `
26426
26453
  .o-formula-assistant {
26454
+ background: #ffffff;
26427
26455
  .o-formula-assistant-head {
26428
26456
  background-color: #f2f2f2;
26429
26457
  padding: 10px;
@@ -26474,6 +26502,9 @@ class FunctionDescriptionProvider extends Component {
26474
26502
  this.assistantState.allowCellSelectionBehind = false;
26475
26503
  }, 2000);
26476
26504
  }
26505
+ get formulaArgSeparator() {
26506
+ return this.env.model.getters.getLocale().formulaArgSeparator + " ";
26507
+ }
26477
26508
  }
26478
26509
  FunctionDescriptionProvider.props = {
26479
26510
  functionName: String,
@@ -26625,6 +26656,12 @@ class Composer extends Component {
26625
26656
  useEffect(() => {
26626
26657
  this.processContent();
26627
26658
  });
26659
+ onPatched(() => {
26660
+ // Required because typing '=SUM' and double-clicking another cell leaves ShowProvider/ShowDescription true
26661
+ if (this.env.model.getters.getEditionMode() === "inactive") {
26662
+ this.processTokenAtCursor();
26663
+ }
26664
+ });
26628
26665
  }
26629
26666
  // ---------------------------------------------------------------------------
26630
26667
  // Handlers
@@ -27542,7 +27579,7 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
27542
27579
  function clamp(value, min, max) {
27543
27580
  return Math.min(Math.max(value, min), max);
27544
27581
  }
27545
- function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
27582
+ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
27546
27583
  let { x, y, width, height } = initialFigure;
27547
27584
  if (keepRatio && dirX != 0 && dirY != 0) {
27548
27585
  const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
@@ -27569,14 +27606,14 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
27569
27606
  y = initialFigure.y - deltaY;
27570
27607
  }
27571
27608
  }
27572
- // Restrict resizing if x or y reaches header boundaries
27573
- if (x < 0) {
27574
- width += x;
27575
- x = 0;
27609
+ // Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
27610
+ if (x + scrollX <= 0) {
27611
+ width = width + x + scrollX;
27612
+ x = -scrollX;
27576
27613
  }
27577
- if (y < 0) {
27578
- height += y;
27579
- y = 0;
27614
+ if (y + scrollY <= 0) {
27615
+ height = height + y + scrollY;
27616
+ y = -scrollY;
27580
27617
  }
27581
27618
  return { ...initialFigure, x, y, width, height };
27582
27619
  }
@@ -27993,7 +28030,7 @@ class FiguresContainer extends Component {
27993
28030
  const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
27994
28031
  const onMouseMove = (ev) => {
27995
28032
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
27996
- const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
28033
+ const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
27997
28034
  const otherFigures = this.getOtherFigures(figure.id);
27998
28035
  const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
27999
28036
  this.dnd.draggedFigure = snapResult.snappedFigure;
@@ -36823,6 +36860,15 @@ class FigurePlugin extends CorePlugin {
36823
36860
  return "Success" /* CommandResult.Success */;
36824
36861
  }
36825
36862
  }
36863
+ beforeHandle(cmd) {
36864
+ switch (cmd.type) {
36865
+ case "DELETE_SHEET":
36866
+ this.getters.getFigures(cmd.sheetId).forEach((figure) => {
36867
+ this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
36868
+ });
36869
+ break;
36870
+ }
36871
+ }
36826
36872
  handle(cmd) {
36827
36873
  switch (cmd.type) {
36828
36874
  case "CREATE_SHEET":
@@ -41576,7 +41622,7 @@ class EvaluationPlugin extends UIPlugin {
41576
41622
  ? getItemId(newFormat, data.formats)
41577
41623
  : exportedCellData.format;
41578
41624
  let content;
41579
- if (formulaCell instanceof FormulaCellWithDependencies) {
41625
+ if (isFormula && formulaCell instanceof FormulaCellWithDependencies) {
41580
41626
  content = this.getters.getFormulaCellContent(exportedSheetData.id, formulaCell.compiledFormula, formulaCell.compiledFormula.dependencies, true);
41581
41627
  }
41582
41628
  else {
@@ -49286,6 +49332,7 @@ class GridSelectionPlugin extends UIPlugin {
49286
49332
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
49287
49333
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
49288
49334
  this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
49335
+ this.selectedFigureId = null;
49289
49336
  break;
49290
49337
  }
49291
49338
  /** Any change to the selection has to be reflected in the selection processor. */
@@ -51180,6 +51227,9 @@ class BottomBarSheet extends Component {
51180
51227
  this.scrollToSheet();
51181
51228
  }
51182
51229
  onDblClick() {
51230
+ if (this.env.model.getters.isReadonly()) {
51231
+ return;
51232
+ }
51183
51233
  this.startEdition();
51184
51234
  }
51185
51235
  onKeyDown(ev) {
@@ -52860,9 +52910,6 @@ css /* scss */ `
52860
52910
  .text-muted {
52861
52911
  color: grey !important;
52862
52912
  }
52863
- button {
52864
- color: #333;
52865
- }
52866
52913
  .o-disabled {
52867
52914
  opacity: 0.4;
52868
52915
  pointer: default;
@@ -52983,17 +53030,17 @@ css /* scss */ `
52983
53030
  }
52984
53031
 
52985
53032
  .o-button {
52986
- border: 1px solid lightgrey;
53033
+ border: 1px solid;
52987
53034
  padding: 0px 20px 0px 20px;
52988
53035
  border-radius: 4px;
52989
53036
  font-weight: 500;
52990
53037
  font-size: 14px;
52991
53038
  height: 30px;
52992
53039
  line-height: 16px;
52993
- background: white;
52994
53040
  margin-right: 8px;
52995
- &:hover:enabled {
52996
- background-color: rgba(0, 0, 0, 0.08);
53041
+
53042
+ &:not(:hover) {
53043
+ background-color: transparent;
52997
53044
  }
52998
53045
 
52999
53046
  &:enabled {
@@ -53007,6 +53054,15 @@ css /* scss */ `
53007
53054
  &:last-child {
53008
53055
  margin-right: 0px;
53009
53056
  }
53057
+
53058
+ &.o-button-grey {
53059
+ border-color: lightgrey;
53060
+ background: #ffffff;
53061
+ color: #333;
53062
+ &:hover:enabled {
53063
+ background-color: rgba(0, 0, 0, 0.08);
53064
+ }
53065
+ }
53010
53066
  }
53011
53067
 
53012
53068
  .o-input {
@@ -56919,6 +56975,6 @@ const constants = {
56919
56975
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
56920
56976
 
56921
56977
 
56922
- __info__.version = "17.0.14";
56923
- __info__.date = "2024-03-12T07:56:15.364Z";
56924
- __info__.hash = "6f6e1b9";
56978
+ __info__.version = "17.0.16";
56979
+ __info__.date = "2024-03-25T09:42:01.717Z";
56980
+ __info__.hash = "9b128f8";