@odoo/o-spreadsheet 16.0.30 → 16.0.32

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.
@@ -204,7 +204,7 @@
204
204
  const BOTTOMBAR_HEIGHT = 36;
205
205
  const DEFAULT_CELL_WIDTH = 96;
206
206
  const DEFAULT_CELL_HEIGHT = 23;
207
- const SCROLLBAR_WIDTH$1 = 15;
207
+ const SCROLLBAR_WIDTH = 15;
208
208
  const AUTOFILL_EDGE_LENGTH = 8;
209
209
  const ICON_EDGE_LENGTH = 18;
210
210
  const UNHIDE_ICON_EDGE_LENGTH = 14;
@@ -1608,6 +1608,9 @@
1608
1608
  function formatValue(value, format) {
1609
1609
  switch (typeof value) {
1610
1610
  case "string":
1611
+ if (value.includes('\\"')) {
1612
+ return value.replace(/\\"/g, '"');
1613
+ }
1611
1614
  return value;
1612
1615
  case "boolean":
1613
1616
  return value ? "TRUE" : "FALSE";
@@ -4072,7 +4075,7 @@
4072
4075
  this.spreadsheetPosition = useSpreadsheetPosition();
4073
4076
  }
4074
4077
  get maxHeight() {
4075
- return Math.max(0, this.viewportDimension.height - BOTTOMBAR_HEIGHT - SCROLLBAR_WIDTH$1);
4078
+ return Math.max(0, this.viewportDimension.height - BOTTOMBAR_HEIGHT - SCROLLBAR_WIDTH);
4076
4079
  }
4077
4080
  get style() {
4078
4081
  // the props's position is expressed relative to the "body" element
@@ -5580,6 +5583,12 @@
5580
5583
  let { col, row } = env.model.getters.getPosition();
5581
5584
  env.model.dispatch("OPEN_CELL_POPOVER", { col, row, popoverType: "LinkEditor" });
5582
5585
  };
5586
+ const INSERT_LINK_NAME = (env) => {
5587
+ const sheetId = env.model.getters.getActiveSheetId();
5588
+ const { col, row } = env.model.getters.getPosition();
5589
+ const cell = env.model.getters.getCell(sheetId, col, row);
5590
+ return cell && cell.isLink() ? _lt("Edit link") : _lt("Insert link");
5591
+ };
5583
5592
  //------------------------------------------------------------------------------
5584
5593
  // Filters action
5585
5594
  //------------------------------------------------------------------------------
@@ -5717,7 +5726,7 @@
5717
5726
  action: DELETE_CELL_SHIFT_LEFT,
5718
5727
  })
5719
5728
  .add("insert_link", {
5720
- name: _lt("Insert link"),
5729
+ name: INSERT_LINK_NAME,
5721
5730
  separator: true,
5722
5731
  sequence: 150,
5723
5732
  action: INSERT_LINK,
@@ -19512,9 +19521,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19512
19521
  break;
19513
19522
  }
19514
19523
  }
19515
- unsubscribe() {
19516
- this.mode = "inactive";
19517
- }
19518
19524
  // ---------------------------------------------------------------------------
19519
19525
  // Getters
19520
19526
  // ---------------------------------------------------------------------------
@@ -20415,13 +20421,12 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20415
20421
  setup() {
20416
20422
  owl.onMounted(() => {
20417
20423
  const el = this.composerRef.el;
20424
+ if (this.props.isDefaultFocus) {
20425
+ this.env.focusableElement.setFocusableElement(el);
20426
+ }
20418
20427
  this.contentHelper.updateEl(el);
20419
20428
  this.processContent();
20420
20429
  });
20421
- owl.onWillUnmount(() => {
20422
- var _a, _b;
20423
- (_b = (_a = this.props).onComposerUnmounted) === null || _b === void 0 ? void 0 : _b.call(_a);
20424
- });
20425
20430
  owl.onPatched(() => {
20426
20431
  if (!this.isKeyStillDown) {
20427
20432
  this.processContent();
@@ -20432,7 +20437,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20432
20437
  // Handlers
20433
20438
  // ---------------------------------------------------------------------------
20434
20439
  processArrowKeys(ev) {
20435
- if (this.env.model.getters.isSelectingForComposer()) {
20440
+ if (this.env.model.getters.isSelectingForComposer() ||
20441
+ this.env.model.getters.getEditionMode() === "inactive") {
20436
20442
  this.functionDescriptionState.showDescription = false;
20437
20443
  // Prevent the default content editable behavior which moves the cursor
20438
20444
  // but don't stop the event and let it bubble to the grid which will
@@ -20465,21 +20471,23 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20465
20471
  processTabKey(ev) {
20466
20472
  ev.preventDefault();
20467
20473
  ev.stopPropagation();
20468
- if (this.autoCompleteState.showProvider && this.autocompleteAPI) {
20469
- const autoCompleteValue = this.autocompleteAPI.getValueToFill();
20470
- if (autoCompleteValue) {
20471
- this.autoComplete(autoCompleteValue);
20472
- return;
20474
+ if (this.env.model.getters.getEditionMode() !== "inactive") {
20475
+ if (this.autoCompleteState.showProvider && this.autocompleteAPI) {
20476
+ const autoCompleteValue = this.autocompleteAPI.getValueToFill();
20477
+ if (autoCompleteValue) {
20478
+ this.autoComplete(autoCompleteValue);
20479
+ return;
20480
+ }
20473
20481
  }
20474
- }
20475
- else {
20476
- // when completing with tab, if there is no value to complete, the active cell will be moved to the right.
20477
- // we can't let the model think that it is for a ref selection.
20478
- // todo: check if this can be removed someday
20479
- this.env.model.dispatch("STOP_COMPOSER_RANGE_SELECTION");
20482
+ else {
20483
+ // when completing with tab, if there is no value to complete, the active cell will be moved to the right.
20484
+ // we can't let the model think that it is for a ref selection.
20485
+ // todo: check if this can be removed someday
20486
+ this.env.model.dispatch("STOP_COMPOSER_RANGE_SELECTION");
20487
+ }
20488
+ this.env.model.dispatch("STOP_EDITION");
20480
20489
  }
20481
20490
  const direction = ev.shiftKey ? "left" : "right";
20482
- this.env.model.dispatch("STOP_EDITION");
20483
20491
  this.env.model.selection.moveAnchorCell(direction, 1);
20484
20492
  }
20485
20493
  processEnterKey(ev) {
@@ -20511,6 +20519,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20511
20519
  this.compositionActive = false;
20512
20520
  }
20513
20521
  onKeydown(ev) {
20522
+ if (this.env.model.getters.getEditionMode() === "inactive") {
20523
+ return;
20524
+ }
20514
20525
  let handler = this.keyMapping[ev.key];
20515
20526
  if (handler) {
20516
20527
  handler.call(this, ev);
@@ -20521,23 +20532,46 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20521
20532
  }
20522
20533
  }
20523
20534
  updateCursorIfNeeded() {
20524
- if (!this.env.model.getters.isSelectingForComposer()) {
20535
+ const moveCursor = !this.env.model.getters.isSelectingForComposer() &&
20536
+ !(this.env.model.getters.getEditionMode() === "inactive");
20537
+ if (moveCursor) {
20525
20538
  const { start, end } = this.contentHelper.getCurrentSelection();
20526
20539
  this.env.model.dispatch("CHANGE_COMPOSER_CURSOR_SELECTION", { start, end });
20527
20540
  this.isKeyStillDown = true;
20528
20541
  }
20529
20542
  }
20543
+ onPaste(ev) {
20544
+ if (this.env.model.getters.getEditionMode() !== "inactive") {
20545
+ ev.stopPropagation();
20546
+ }
20547
+ }
20530
20548
  /*
20531
20549
  * Triggered automatically by the content-editable between the keydown and key up
20532
20550
  * */
20533
- onInput() {
20534
- if (this.props.focus === "inactive" || !this.shouldProcessInputEvents) {
20551
+ onInput(ev) {
20552
+ var _a, _b;
20553
+ if (!this.shouldProcessInputEvents) {
20554
+ return;
20555
+ }
20556
+ if (ev.inputType === "insertFromPaste" &&
20557
+ this.env.model.getters.getEditionMode() === "inactive") {
20535
20558
  return;
20536
20559
  }
20560
+ ev.stopPropagation();
20561
+ let content;
20562
+ if (this.env.model.getters.getEditionMode() === "inactive") {
20563
+ content = ev.data || "";
20564
+ }
20565
+ else {
20566
+ const el = this.composerRef.el;
20567
+ content = el.childNodes.length ? el.textContent : "";
20568
+ }
20569
+ if (this.props.focus === "inactive") {
20570
+ return (_b = (_a = this.props).onComposerCellFocused) === null || _b === void 0 ? void 0 : _b.call(_a, content);
20571
+ }
20537
20572
  this.env.model.dispatch("STOP_COMPOSER_RANGE_SELECTION");
20538
- const el = this.composerRef.el;
20539
20573
  this.env.model.dispatch("SET_CURRENT_CONTENT", {
20540
- content: el.childNodes.length ? el.textContent : "",
20574
+ content,
20541
20575
  selection: this.contentHelper.getCurrentSelection(),
20542
20576
  });
20543
20577
  }
@@ -20584,9 +20618,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20584
20618
  }
20585
20619
  const newSelection = this.contentHelper.getCurrentSelection();
20586
20620
  this.env.model.dispatch("STOP_COMPOSER_RANGE_SELECTION");
20587
- if (this.props.focus === "inactive") {
20588
- this.props.onComposerContentFocused(newSelection);
20589
- }
20621
+ this.props.onComposerContentFocused();
20622
+ if (this.props.focus === "inactive") ;
20590
20623
  this.env.model.dispatch("CHANGE_COMPOSER_CURSOR_SELECTION", newSelection);
20591
20624
  this.processTokenAtCursor();
20592
20625
  }
@@ -20606,6 +20639,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20606
20639
  this.contentHelper.removeAll(); // removes the content of the composer, to be added just after
20607
20640
  this.shouldProcessInputEvents = false;
20608
20641
  if (this.props.focus !== "inactive") {
20642
+ this.contentHelper.el.focus();
20609
20643
  this.contentHelper.selectRange(0, 0); // move the cursor inside the composer at 0 0.
20610
20644
  }
20611
20645
  const content = this.getContent();
@@ -20774,10 +20808,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20774
20808
  Composer.defaultProps = {
20775
20809
  inputStyle: "",
20776
20810
  focus: "inactive",
20811
+ isDefaultFocus: false,
20777
20812
  };
20778
20813
 
20779
- const SCROLLBAR_WIDTH = 14;
20780
- const SCROLLBAR_HIGHT = 15;
20781
20814
  const COMPOSER_BORDER_WIDTH = 3 * 0.4 * window.devicePixelRatio || 1;
20782
20815
  css /* scss */ `
20783
20816
  div.o-grid-composer {
@@ -20792,40 +20825,52 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20792
20825
  * It also applies the style of the cell to the composer input.
20793
20826
  */
20794
20827
  class GridComposer extends owl.Component {
20828
+ constructor() {
20829
+ super(...arguments);
20830
+ this.rect = undefined;
20831
+ this.isEditing = false;
20832
+ }
20833
+ get defaultRect() {
20834
+ return { x: 0, y: 0, width: 0, height: 0 };
20835
+ }
20795
20836
  setup() {
20796
- this.gridComposerRef = owl.useRef("gridComposer");
20797
- this.composerState = owl.useState({
20798
- rect: null,
20799
- delimitation: null,
20800
- });
20801
- const { col, row } = this.env.model.getters.getPosition();
20802
- this.zone = this.env.model.getters.expandZone(this.env.model.getters.getActiveSheetId(), {
20803
- left: col,
20804
- right: col,
20805
- top: row,
20806
- bottom: row,
20807
- });
20808
- this.rect = this.env.model.getters.getVisibleRect(this.zone);
20809
- owl.onMounted(() => {
20810
- const el = this.gridComposerRef.el;
20811
- //TODO Should be more correct to have a props that give the parent's clientHeight and clientWidth
20812
- const maxHeight = el.parentElement.clientHeight - this.rect.y - SCROLLBAR_HIGHT;
20813
- el.style.maxHeight = (maxHeight + "px");
20814
- const maxWidth = el.parentElement.clientWidth - this.rect.x - SCROLLBAR_WIDTH;
20815
- el.style.maxWidth = (maxWidth + "px");
20816
- this.composerState.rect = {
20817
- x: this.rect.x,
20818
- y: this.rect.y,
20819
- width: el.clientWidth,
20820
- height: el.clientHeight,
20821
- };
20822
- this.composerState.delimitation = {
20823
- width: el.parentElement.clientWidth,
20824
- height: el.parentElement.clientHeight,
20825
- };
20837
+ owl.onWillUpdateProps(() => {
20838
+ const isEditing = this.env.model.getters.getEditionMode() !== "inactive";
20839
+ if (this.isEditing !== isEditing) {
20840
+ this.isEditing = isEditing;
20841
+ if (!isEditing) {
20842
+ this.rect = undefined;
20843
+ this.env.focusableElement.focus();
20844
+ return;
20845
+ }
20846
+ const position = this.env.model.getters.getPosition();
20847
+ const zone = this.env.model.getters.expandZone(this.env.model.getters.getActiveSheetId(), positionToZone(position));
20848
+ this.rect = this.env.model.getters.getVisibleRect(zone);
20849
+ }
20826
20850
  });
20827
20851
  }
20852
+ get composerProps() {
20853
+ const { width, height } = this.env.model.getters.getSheetViewDimensionWithHeaders();
20854
+ return {
20855
+ rect: this.rect && { ...this.rect },
20856
+ delimitation: {
20857
+ width,
20858
+ height,
20859
+ },
20860
+ inputStyle: this.composerStyle,
20861
+ focus: this.props.focus,
20862
+ isDefaultFocus: true,
20863
+ onComposerContentFocused: this.props.onComposerContentFocused,
20864
+ onComposerCellFocused: this.props.onComposerCellFocused,
20865
+ };
20866
+ }
20828
20867
  get containerStyle() {
20868
+ if (this.env.model.getters.getEditionMode() === "inactive" || !this.rect) {
20869
+ return `
20870
+ position: absolute;
20871
+ z-index: -1000;
20872
+ `;
20873
+ }
20829
20874
  const isFormula = this.env.model.getters.getCurrentContent().startsWith("=");
20830
20875
  const cell = this.env.model.getters.getActiveCell();
20831
20876
  let style = {};
@@ -20848,12 +20893,18 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20848
20893
  if (!isFormula) {
20849
20894
  textAlign = style.align || (cell === null || cell === void 0 ? void 0 : cell.defaultAlign) || "left";
20850
20895
  }
20896
+ const sheetDimensions = this.env.model.getters.getSheetViewDimensionWithHeaders();
20897
+ const maxWidth = sheetDimensions.width - this.rect.x;
20898
+ const maxHeight = sheetDimensions.height - this.rect.y;
20851
20899
  return `
20852
20900
  left: ${left - 1}px;
20853
20901
  top: ${top}px;
20854
20902
  min-width: ${width + 2}px;
20855
20903
  min-height: ${height + 1}px;
20856
20904
 
20905
+ max-width: ${maxWidth}px;
20906
+ max-height: ${maxHeight}px;
20907
+
20857
20908
  background: ${background};
20858
20909
  color: ${color};
20859
20910
 
@@ -22490,8 +22541,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
22490
22541
  &.corner {
22491
22542
  right: 0px;
22492
22543
  bottom: 0px;
22493
- height: ${SCROLLBAR_WIDTH$1}px;
22494
- width: ${SCROLLBAR_WIDTH$1}px;
22544
+ height: ${SCROLLBAR_WIDTH}px;
22545
+ width: ${SCROLLBAR_WIDTH}px;
22495
22546
  border-top: 1px solid #e2e3e3;
22496
22547
  border-left: 1px solid #e2e3e3;
22497
22548
  }
@@ -22556,7 +22607,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
22556
22607
  return {
22557
22608
  left: `${this.props.position.left + x}px`,
22558
22609
  bottom: "0px",
22559
- height: `${SCROLLBAR_WIDTH$1}px`,
22610
+ height: `${SCROLLBAR_WIDTH}px`,
22560
22611
  right: `0px`,
22561
22612
  };
22562
22613
  }
@@ -22598,7 +22649,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
22598
22649
  return {
22599
22650
  top: `${this.props.position.top + y}px`,
22600
22651
  right: "0px",
22601
- width: `${SCROLLBAR_WIDTH$1}px`,
22652
+ width: `${SCROLLBAR_WIDTH}px`,
22602
22653
  bottom: `0px`,
22603
22654
  };
22604
22655
  }
@@ -22756,16 +22807,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
22756
22807
  menuItems: [],
22757
22808
  });
22758
22809
  this.gridRef = owl.useRef("grid");
22759
- this.hiddenInput = owl.useRef("hiddenInput");
22760
22810
  this.canvasPosition = useAbsolutePosition(this.gridRef);
22761
22811
  this.hoveredCell = owl.useState({ col: undefined, row: undefined });
22762
22812
  owl.useExternalListener(document.body, "cut", this.copy.bind(this, true));
22763
22813
  owl.useExternalListener(document.body, "copy", this.copy.bind(this, false));
22764
22814
  owl.useExternalListener(document.body, "paste", this.paste);
22765
- owl.onMounted(() => this.focus());
22766
- this.props.exposeFocus(() => this.focus());
22815
+ owl.onMounted(() => this.focusDefaultElement());
22816
+ this.props.exposeFocus(() => this.focusDefaultElement());
22767
22817
  useGridDrawing("canvas", this.env.model, () => this.env.model.getters.getSheetViewDimensionWithHeaders());
22768
- owl.useEffect(() => this.focus(), () => [this.env.model.getters.getActiveSheetId()]);
22818
+ owl.useEffect(() => this.focusDefaultElement(), () => [this.env.model.getters.getActiveSheetId()]);
22769
22819
  this.onMouseWheel = useWheelHandler((deltaX, deltaY) => {
22770
22820
  this.moveCanvas(deltaX, deltaY);
22771
22821
  this.hoveredCell.col = undefined;
@@ -22780,19 +22830,18 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
22780
22830
  return `
22781
22831
  top: ${HEADER_HEIGHT}px;
22782
22832
  left: ${HEADER_WIDTH}px;
22783
- height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH$1}px);
22784
- width: calc(100% - ${HEADER_WIDTH + SCROLLBAR_WIDTH$1}px);
22833
+ height: calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px);
22834
+ width: calc(100% - ${HEADER_WIDTH + SCROLLBAR_WIDTH}px);
22785
22835
  `;
22786
22836
  }
22787
22837
  onClosePopover() {
22788
22838
  this.closeOpenedPopover();
22789
- this.focus();
22839
+ this.focusDefaultElement();
22790
22840
  }
22791
- focus() {
22792
- var _a;
22841
+ focusDefaultElement() {
22793
22842
  if (!this.env.model.getters.getSelectedFigureId() &&
22794
22843
  this.env.model.getters.getEditionMode() === "inactive") {
22795
- (_a = this.hiddenInput.el) === null || _a === void 0 ? void 0 : _a.focus();
22844
+ this.env.focusableElement.focus();
22796
22845
  }
22797
22846
  }
22798
22847
  get gridEl() {
@@ -22941,19 +22990,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
22941
22990
  return;
22942
22991
  }
22943
22992
  }
22944
- onInput(ev) {
22945
- // the user meant to paste in the sheet, not open the composer with the pasted content
22946
- if (!ev.isComposing && ev.inputType === "insertFromPaste") {
22947
- return;
22948
- }
22949
- if (ev.data) {
22950
- // if the user types a character on the grid, it means he wants to start composing the selected cell with that
22951
- // character
22952
- ev.preventDefault();
22953
- ev.stopPropagation();
22954
- this.props.onGridComposerCellFocused(ev.data);
22955
- }
22956
- }
22957
22993
  // ---------------------------------------------------------------------------
22958
22994
  // Context Menu
22959
22995
  // ---------------------------------------------------------------------------
@@ -23034,7 +23070,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
23034
23070
  }
23035
23071
  closeMenu() {
23036
23072
  this.menuState.isOpen = false;
23037
- this.focus();
23073
+ this.focusDefaultElement();
23038
23074
  }
23039
23075
  }
23040
23076
  Grid.template = "o-spreadsheet-Grid";
@@ -26730,7 +26766,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
26730
26766
  * a breaking change is made in the way the state is handled, and an upgrade
26731
26767
  * function should be defined
26732
26768
  */
26733
- const CURRENT_VERSION = 12;
26769
+ const CURRENT_VERSION = 12.5;
26734
26770
  const INITIAL_SHEET_ID = "Sheet1";
26735
26771
  /**
26736
26772
  * This function tries to load anything that could look like a valid
@@ -26996,6 +27032,31 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
26996
27032
  return data;
26997
27033
  },
26998
27034
  },
27035
+ {
27036
+ description: "Fix datafilter duplication",
27037
+ from: 12,
27038
+ to: 12.5,
27039
+ applyMigration(data) {
27040
+ for (let sheet of data.sheets || []) {
27041
+ let knownDataFilterZones = [];
27042
+ for (let filterTable of sheet.filterTables || []) {
27043
+ const zone = toZone(filterTable.range);
27044
+ // See commit message for the details
27045
+ const intersectZoneIndex = knownDataFilterZones.findIndex((knownZone) => overlap(knownZone, zone));
27046
+ if (intersectZoneIndex !== -1) {
27047
+ knownDataFilterZones[intersectZoneIndex] = zone;
27048
+ }
27049
+ else {
27050
+ knownDataFilterZones.push(zone);
27051
+ }
27052
+ }
27053
+ sheet.filterTables = knownDataFilterZones.map((zone) => ({
27054
+ range: zoneToXc(zone),
27055
+ }));
27056
+ }
27057
+ return data;
27058
+ },
27059
+ },
26999
27060
  ];
27000
27061
  /**
27001
27062
  * This function is used to repair faulty data independently of the migration.
@@ -27891,9 +27952,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27891
27952
  format: cell.format ? getItemId(cell.format, formats) : undefined,
27892
27953
  content: cell.content || undefined,
27893
27954
  };
27894
- if (cell.isFormula()) {
27895
- cells[xc].content = this.buildFormulaContent(_sheet.id, cell, cell.dependencies, true);
27896
- }
27897
27955
  }
27898
27956
  _sheet.cells = cells;
27899
27957
  }
@@ -27916,6 +27974,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27916
27974
  const exportedCellData = sheet.cells[xc];
27917
27975
  exportedCellData.value = cell.evaluated.value;
27918
27976
  exportedCellData.isFormula = cell.isFormula();
27977
+ if (cell.isFormula()) {
27978
+ exportedCellData.content = this.buildFormulaContent(sheet.id, cell, cell.dependencies, true);
27979
+ }
27919
27980
  if (cell.format !== cell.evaluated.format) {
27920
27981
  exportedCellData.computedFormat = cell.evaluated.format;
27921
27982
  }
@@ -35358,9 +35419,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35358
35419
  }
35359
35420
  }
35360
35421
  }
35361
- unsubscribe() {
35362
- this.unfocus();
35363
- }
35364
35422
  // ---------------------------------------------------------------------------
35365
35423
  // Getters || only callable by the parent
35366
35424
  // ---------------------------------------------------------------------------
@@ -35572,9 +35630,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35572
35630
  }
35573
35631
  (_a = this.currentInput) === null || _a === void 0 ? void 0 : _a.handle(cmd);
35574
35632
  }
35575
- unsubscribe() {
35576
- this.unfocus();
35577
- }
35578
35633
  // ---------------------------------------------------------------------------
35579
35634
  // Getters
35580
35635
  // ---------------------------------------------------------------------------
@@ -37973,6 +38028,19 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37973
38028
  sequence: 5,
37974
38029
  });
37975
38030
 
38031
+ class FocusableElement {
38032
+ constructor() {
38033
+ this.focusableElement = undefined;
38034
+ }
38035
+ setFocusableElement(element) {
38036
+ this.focusableElement = element;
38037
+ }
38038
+ focus() {
38039
+ var _a;
38040
+ (_a = this.focusableElement) === null || _a === void 0 ? void 0 : _a.focus();
38041
+ }
38042
+ }
38043
+
37976
38044
  // -----------------------------------------------------------------------------
37977
38045
  // SpreadSheet
37978
38046
  // -----------------------------------------------------------------------------
@@ -39116,8 +39184,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
39116
39184
  &.corner {
39117
39185
  right: 0px;
39118
39186
  bottom: 0px;
39119
- height: ${SCROLLBAR_WIDTH$1}px;
39120
- width: ${SCROLLBAR_WIDTH$1}px;
39187
+ height: ${SCROLLBAR_WIDTH}px;
39188
+ width: ${SCROLLBAR_WIDTH}px;
39121
39189
  border-top: 1px solid #e2e3e3;
39122
39190
  border-left: 1px solid #e2e3e3;
39123
39191
  }
@@ -39161,6 +39229,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
39161
39229
  toggleSidePanel: this.toggleSidePanel.bind(this),
39162
39230
  _t: Spreadsheet._t,
39163
39231
  clipboard: navigator.clipboard,
39232
+ focusableElement: new FocusableElement(),
39164
39233
  });
39165
39234
  owl.useExternalListener(window, "resize", () => this.render(true));
39166
39235
  owl.useExternalListener(window, "beforeunload", this.unbindModelEvents.bind(this));
@@ -39263,17 +39332,18 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
39263
39332
  this.model.dispatch("UNFOCUS_SELECTION_INPUT");
39264
39333
  this.composer.topBarFocus = "contentFocus";
39265
39334
  this.composer.gridFocusMode = "inactive";
39266
- this.setComposerContent({ selection } || {});
39335
+ this.setComposerContent({ selection });
39267
39336
  }
39268
- onGridComposerContentFocused() {
39337
+ onGridComposerContentFocused(selection) {
39269
39338
  if (this.model.getters.isReadonly()) {
39270
39339
  return;
39271
39340
  }
39272
39341
  this.model.dispatch("UNFOCUS_SELECTION_INPUT");
39273
39342
  this.composer.topBarFocus = "inactive";
39274
39343
  this.composer.gridFocusMode = "contentFocus";
39275
- this.setComposerContent({});
39344
+ this.setComposerContent({ selection });
39276
39345
  }
39346
+ // TODO: either both are defined or none of them. change those args to an object
39277
39347
  onGridComposerCellFocused(content, selection) {
39278
39348
  if (this.model.getters.isReadonly()) {
39279
39349
  return;
@@ -40646,18 +40716,17 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40646
40716
  if (this.observers.find((sub) => sub.owner === owner)) {
40647
40717
  throw new Error("You are already subscribed forever");
40648
40718
  }
40649
- if ((_a = this.mainSubscription) === null || _a === void 0 ? void 0 : _a.owner) {
40719
+ if (((_a = this.mainSubscription) === null || _a === void 0 ? void 0 : _a.owner) && this.mainSubscription.owner !== owner) {
40650
40720
  (_c = (_b = this.mainSubscription.callbacks).release) === null || _c === void 0 ? void 0 : _c.call(_b);
40651
40721
  }
40652
40722
  this.mainSubscription = { owner, callbacks };
40653
40723
  }
40654
40724
  release(owner) {
40655
- var _a, _b, _c, _d;
40725
+ var _a;
40656
40726
  if (((_a = this.mainSubscription) === null || _a === void 0 ? void 0 : _a.owner) !== owner ||
40657
40727
  this.observers.find((sub) => sub.owner === owner)) {
40658
40728
  return;
40659
40729
  }
40660
- (_d = (_b = this.mainSubscription) === null || _b === void 0 ? void 0 : (_c = _b.callbacks).release) === null || _d === void 0 ? void 0 : _d.call(_c);
40661
40730
  this.mainSubscription = this.defaultSubscription;
40662
40731
  }
40663
40732
  /**
@@ -43076,7 +43145,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43076
43145
  BOTTOMBAR_HEIGHT,
43077
43146
  DEFAULT_CELL_WIDTH,
43078
43147
  DEFAULT_CELL_HEIGHT,
43079
- SCROLLBAR_WIDTH: SCROLLBAR_WIDTH$1,
43148
+ SCROLLBAR_WIDTH,
43080
43149
  };
43081
43150
  const registries = {
43082
43151
  autofillModifiersRegistry,
@@ -43189,9 +43258,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43189
43258
  Object.defineProperty(exports, '__esModule', { value: true });
43190
43259
 
43191
43260
 
43192
- __info__.version = '16.0.30';
43193
- __info__.date = '2024-01-29T13:49:32.243Z';
43194
- __info__.hash = '49966d6';
43261
+ __info__.version = '16.0.32';
43262
+ __info__.date = '2024-02-09T13:05:36.074Z';
43263
+ __info__.hash = '452dce2';
43195
43264
 
43196
43265
 
43197
43266
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);