@odoo/o-spreadsheet 18.4.16 → 18.4.18

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 18.4.16
6
- * @date 2025-11-03T12:31:57.153Z
7
- * @hash 1ba569f
5
+ * @version 18.4.18
6
+ * @date 2025-11-24T07:42:07.821Z
7
+ * @hash 4f83667
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, useExternalListener, onWillUpdateProps, onWillStart, onWillPatch, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -5926,7 +5926,10 @@ function isInside(col, row, zone) {
5926
5926
  * Check if a zone is inside another
5927
5927
  */
5928
5928
  function isZoneInside(smallZone, biggerZone) {
5929
- return isEqual(union(biggerZone, smallZone), biggerZone);
5929
+ return (smallZone.left >= biggerZone.left &&
5930
+ smallZone.right <= biggerZone.right &&
5931
+ smallZone.top >= biggerZone.top &&
5932
+ smallZone.bottom <= biggerZone.bottom);
5930
5933
  }
5931
5934
  function zoneToDimension(zone) {
5932
5935
  return {
@@ -6487,7 +6490,7 @@ function getRangeString(range, forSheetId, getSheetName, options = { useBoundedR
6487
6490
  let sheetName = "";
6488
6491
  if (prefixSheet) {
6489
6492
  if (range.invalidSheetName) {
6490
- sheetName = range.invalidSheetName;
6493
+ sheetName = getCanonicalSymbolName(range.invalidSheetName);
6491
6494
  }
6492
6495
  else {
6493
6496
  sheetName = getCanonicalSymbolName(getSheetName(range.sheetId));
@@ -18538,7 +18541,7 @@ function getTokenNextReferenceType(xc) {
18538
18541
  function setXcToFixedReferenceType(xc, referenceType) {
18539
18542
  let sheetName;
18540
18543
  ({ sheetName, xc } = splitReference(xc));
18541
- sheetName = sheetName ? sheetName + "!" : "";
18544
+ sheetName = sheetName ? getCanonicalSymbolName(sheetName) + "!" : "";
18542
18545
  xc = xc.replace(/\$/g, "");
18543
18546
  const splitIndex = xc.indexOf(":");
18544
18547
  if (splitIndex >= 0) {
@@ -23105,7 +23108,7 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
23105
23108
  return {
23106
23109
  background: context.background,
23107
23110
  type: "scorecard",
23108
- keyValue: context.range ? context.range[0].dataRange : undefined,
23111
+ keyValue: context.range?.[0]?.dataRange,
23109
23112
  title: context.title || { text: "" },
23110
23113
  baselineMode: DEFAULT_SCORECARD_BASELINE_MODE,
23111
23114
  baselineColorUp: DEFAULT_SCORECARD_BASELINE_COLOR_UP,
@@ -27426,7 +27429,7 @@ class GaugeChart extends AbstractChart {
27426
27429
  background: context.background,
27427
27430
  title: context.title || { text: "" },
27428
27431
  type: "gauge",
27429
- dataRange: context.range ? context.range[0].dataRange : undefined,
27432
+ dataRange: context.range?.[0]?.dataRange,
27430
27433
  sectionRule: {
27431
27434
  colors: {
27432
27435
  lowerColor: DEFAULT_GAUGE_LOWER_COLOR,
@@ -32604,6 +32607,7 @@ class AbstractComposerStore extends SpreadsheetStore {
32604
32607
  this.highlightStore.register(this);
32605
32608
  this.onDispose(() => {
32606
32609
  this.highlightStore.unRegister(this);
32610
+ this._cancelEdition();
32607
32611
  });
32608
32612
  }
32609
32613
  handleEvent(event) {
@@ -32638,6 +32642,7 @@ class AbstractComposerStore extends SpreadsheetStore {
32638
32642
  }
32639
32643
  this.selectionStart = start;
32640
32644
  this.selectionEnd = end;
32645
+ this.editionMode = "editing";
32641
32646
  this.computeFormulaCursorContext();
32642
32647
  this.computeParenthesisRelatedToCursor();
32643
32648
  this.updateAutoCompleteProvider();
@@ -33313,10 +33318,13 @@ class AbstractComposerStore extends SpreadsheetStore {
33313
33318
  hideHelp() {
33314
33319
  this.autoComplete.hide();
33315
33320
  }
33316
- autoCompleteOrStop(direction) {
33321
+ autoCompleteOrStop(direction, assistantForcedClosed = false) {
33317
33322
  if (this.editionMode !== "inactive") {
33318
33323
  const autoComplete = this.autoComplete;
33319
- if (autoComplete.provider && autoComplete.selectedIndex !== undefined) {
33324
+ const suppressAutocomplete = assistantForcedClosed && this.canBeToggled;
33325
+ if (!suppressAutocomplete &&
33326
+ autoComplete.provider &&
33327
+ autoComplete.selectedIndex !== undefined) {
33320
33328
  const autoCompleteValue = autoComplete.provider.proposals[autoComplete.selectedIndex]?.text;
33321
33329
  if (autoCompleteValue) {
33322
33330
  this.autoComplete.provider?.selectProposal(autoCompleteValue);
@@ -33659,16 +33667,12 @@ class Composer extends Component {
33659
33667
  processTabKey(ev, direction) {
33660
33668
  ev.preventDefault();
33661
33669
  ev.stopPropagation();
33662
- if (!this.assistant.forcedClosed) {
33663
- this.props.composerStore.autoCompleteOrStop(direction);
33664
- }
33670
+ this.props.composerStore.autoCompleteOrStop(direction, this.assistant.forcedClosed);
33665
33671
  }
33666
33672
  processEnterKey(ev, direction) {
33667
33673
  ev.preventDefault();
33668
33674
  ev.stopPropagation();
33669
- if (!this.assistant.forcedClosed) {
33670
- this.props.composerStore.autoCompleteOrStop(direction);
33671
- }
33675
+ this.props.composerStore.autoCompleteOrStop(direction, this.assistant.forcedClosed);
33672
33676
  }
33673
33677
  processNewLineEvent(ev) {
33674
33678
  ev.preventDefault();
@@ -33844,7 +33848,6 @@ class Composer extends Component {
33844
33848
  return;
33845
33849
  }
33846
33850
  const newSelection = this.contentHelper.getCurrentSelection();
33847
- this.props.composerStore.stopComposerRangeSelection();
33848
33851
  this.props.onComposerContentFocused();
33849
33852
  this.props.composerStore.changeComposerCursorSelection(newSelection.start, newSelection.end);
33850
33853
  this.processTokenAtCursor();
@@ -47365,10 +47368,11 @@ class AbstractResizer extends Component {
47365
47368
  this.state.waitingForMove = false;
47366
47369
  }
47367
47370
  onMouseMove(ev) {
47368
- if (this.env.isMobile()) {
47369
- return;
47370
- }
47371
- if (this.state.isResizing || this.state.isMoving || this.state.isSelecting) {
47371
+ if (this.env.isMobile() ||
47372
+ this.env.model.getters.isReadonly() ||
47373
+ this.state.isResizing ||
47374
+ this.state.isMoving ||
47375
+ this.state.isSelecting) {
47372
47376
  return;
47373
47377
  }
47374
47378
  this._computeHandleDisplay(ev);
@@ -47435,6 +47439,10 @@ class AbstractResizer extends Component {
47435
47439
  if (index < 0) {
47436
47440
  return;
47437
47441
  }
47442
+ if (this.env.model.getters.isReadonly()) {
47443
+ this._selectElement(index, false);
47444
+ return;
47445
+ }
47438
47446
  if (this.state.waitingForMove) {
47439
47447
  if (!this.env.model.getters.isGridSelectionActive()) {
47440
47448
  this._selectElement(index, false);
@@ -47994,6 +48002,9 @@ class GridRenderer extends SpreadsheetStore {
47994
48002
  break;
47995
48003
  }
47996
48004
  }
48005
+ finalize() {
48006
+ this.zonesWithPreventedAnimationsInNextFrame = recomputeZones(this.zonesWithPreventedAnimationsInNextFrame);
48007
+ }
47997
48008
  get renderingLayers() {
47998
48009
  return ["Background", "Headers"];
47999
48010
  }
@@ -48792,7 +48803,7 @@ const friction = 0.95;
48792
48803
  const verticalScrollFactor = 1;
48793
48804
  const horizontalScrollFactor = 1;
48794
48805
  const resetTimeoutDuration = 100;
48795
- function useTouchScroll(ref, updateScroll, canMoveUp) {
48806
+ function useTouchScroll(ref, updateScroll, canMoveUp, canMoveDown) {
48796
48807
  let lastX = 0;
48797
48808
  let lastY = 0;
48798
48809
  let velocityX = 0;
@@ -48829,7 +48840,7 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
48829
48840
  lastX = clientX;
48830
48841
  lastY = clientY;
48831
48842
  lastTime = currentTime;
48832
- if (canMoveUp()) {
48843
+ if ((deltaY < 0 && canMoveUp()) || (deltaY > 0 && canMoveDown())) {
48833
48844
  if (event.cancelable) {
48834
48845
  event.preventDefault();
48835
48846
  }
@@ -54729,7 +54740,6 @@ function insertTokenAfterArgSeparator(tokenAtCursor, value) {
54729
54740
  // replace the whole token
54730
54741
  start = tokenAtCursor.start;
54731
54742
  }
54732
- this.composer.stopComposerRangeSelection();
54733
54743
  this.composer.changeComposerCursorSelection(start, end);
54734
54744
  this.composer.replaceComposerCursorSelection(value);
54735
54745
  }
@@ -54747,7 +54757,6 @@ function insertTokenAfterLeftParenthesis(tokenAtCursor, value) {
54747
54757
  // replace the whole token
54748
54758
  start = tokenAtCursor.start;
54749
54759
  }
54750
- this.composer.stopComposerRangeSelection();
54751
54760
  this.composer.changeComposerCursorSelection(start, end);
54752
54761
  this.composer.replaceComposerCursorSelection(value);
54753
54762
  }
@@ -57446,6 +57455,7 @@ class SidePanelStore extends SpreadsheetStore {
57446
57455
  getPanelProps(panelInfo) {
57447
57456
  const state = this.computeState(panelInfo);
57448
57457
  if (state.isOpen) {
57458
+ panelInfo.currentPanelProps = state.props ?? panelInfo.currentPanelProps;
57449
57459
  return state.props ?? {};
57450
57460
  }
57451
57461
  return {};
@@ -57457,11 +57467,11 @@ class SidePanelStore extends SpreadsheetStore {
57457
57467
  }
57458
57468
  return undefined;
57459
57469
  }
57460
- open(componentTag, initialPanelProps = {}) {
57470
+ open(componentTag, currentPanelProps = {}) {
57461
57471
  if (this.screenWidthStore.isSmall) {
57462
57472
  return;
57463
57473
  }
57464
- const newPanelInfo = { initialPanelProps, componentTag, size: DEFAULT_SIDE_PANEL_SIZE };
57474
+ const newPanelInfo = { currentPanelProps, componentTag, size: DEFAULT_SIDE_PANEL_SIZE };
57465
57475
  const state = this.computeState(newPanelInfo);
57466
57476
  if (!state.isOpen) {
57467
57477
  return;
@@ -57485,8 +57495,8 @@ class SidePanelStore extends SpreadsheetStore {
57485
57495
  }
57486
57496
  this._openPanel("secondaryPanel", newPanelInfo, state);
57487
57497
  }
57488
- replace(componentTag, currentPanelKey, initialPanelProps = {}) {
57489
- const newPanelInfo = { initialPanelProps, componentTag, size: DEFAULT_SIDE_PANEL_SIZE };
57498
+ replace(componentTag, currentPanelKey, currentPanelProps = {}) {
57499
+ const newPanelInfo = { currentPanelProps, componentTag, size: DEFAULT_SIDE_PANEL_SIZE };
57490
57500
  const state = this.computeState(newPanelInfo);
57491
57501
  if (!state.isOpen) {
57492
57502
  return;
@@ -57516,10 +57526,10 @@ class SidePanelStore extends SpreadsheetStore {
57516
57526
  _openPanel(panel, newPanel, state) {
57517
57527
  const currentPanel = this[panel];
57518
57528
  if (currentPanel && newPanel.componentTag !== currentPanel.componentTag) {
57519
- currentPanel.initialPanelProps?.onCloseSidePanel?.();
57529
+ currentPanel.currentPanelProps?.onCloseSidePanel?.();
57520
57530
  }
57521
57531
  this[panel] = {
57522
- initialPanelProps: state.props ?? {},
57532
+ currentPanelProps: state.props ?? {},
57523
57533
  componentTag: newPanel.componentTag,
57524
57534
  size: currentPanel?.size || DEFAULT_SIDE_PANEL_SIZE,
57525
57535
  isCollapsed: currentPanel?.isCollapsed || false,
@@ -57541,16 +57551,16 @@ class SidePanelStore extends SpreadsheetStore {
57541
57551
  close() {
57542
57552
  if (this.mainPanel?.isPinned) {
57543
57553
  if (this.secondaryPanel) {
57544
- this.secondaryPanel.initialPanelProps.onCloseSidePanel?.();
57554
+ this.secondaryPanel.currentPanelProps.onCloseSidePanel?.();
57545
57555
  this.secondaryPanel = undefined;
57546
57556
  }
57547
57557
  return;
57548
57558
  }
57549
- this.mainPanel?.initialPanelProps.onCloseSidePanel?.();
57559
+ this.mainPanel?.currentPanelProps.onCloseSidePanel?.();
57550
57560
  this.mainPanel = undefined;
57551
57561
  }
57552
57562
  closeMainPanel() {
57553
- this.mainPanel?.initialPanelProps.onCloseSidePanel?.();
57563
+ this.mainPanel?.currentPanelProps.onCloseSidePanel?.();
57554
57564
  this.mainPanel = this.secondaryPanel || undefined;
57555
57565
  this.secondaryPanel = undefined;
57556
57566
  }
@@ -57582,7 +57592,7 @@ class SidePanelStore extends SpreadsheetStore {
57582
57592
  }
57583
57593
  this.mainPanel.isPinned = !this.mainPanel.isPinned;
57584
57594
  if (!this.mainPanel.isPinned && this.secondaryPanel) {
57585
- this.secondaryPanel?.initialPanelProps.onCloseSidePanel?.();
57595
+ this.secondaryPanel?.currentPanelProps.onCloseSidePanel?.();
57586
57596
  this.mainPanel = this.secondaryPanel;
57587
57597
  this.secondaryPanel = undefined;
57588
57598
  }
@@ -57601,7 +57611,7 @@ class SidePanelStore extends SpreadsheetStore {
57601
57611
  panelInfo.size = COLLAPSED_SIDE_PANEL_SIZE;
57602
57612
  }
57603
57613
  }
57604
- computeState({ componentTag, initialPanelProps }) {
57614
+ computeState({ componentTag, currentPanelProps: initialPanelProps, }) {
57605
57615
  const customComputeState = sidePanelRegistry.get(componentTag).computeState;
57606
57616
  const state = customComputeState
57607
57617
  ? customComputeState(this.getters, initialPanelProps)
@@ -57611,7 +57621,7 @@ class SidePanelStore extends SpreadsheetStore {
57611
57621
  changeSpreadsheetWidth(width) {
57612
57622
  this.availableWidth = width - MIN_SHEET_VIEW_WIDTH;
57613
57623
  if (this.secondaryPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) {
57614
- this.secondaryPanel?.initialPanelProps.onCloseSidePanel?.();
57624
+ this.secondaryPanel?.currentPanelProps.onCloseSidePanel?.();
57615
57625
  this.secondaryPanel = undefined;
57616
57626
  }
57617
57627
  if (this.mainPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) {
@@ -57771,6 +57781,10 @@ class Grid extends Component {
57771
57781
  useTouchScroll(this.gridRef, this.moveCanvas.bind(this), () => {
57772
57782
  const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
57773
57783
  return scrollY > 0;
57784
+ }, () => {
57785
+ const { maxOffsetY } = this.env.model.getters.getMaximumSheetOffset();
57786
+ const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
57787
+ return scrollY < maxOffsetY;
57774
57788
  });
57775
57789
  }
57776
57790
  get highlights() {
@@ -74992,6 +75006,7 @@ class SheetViewPlugin extends UIPlugin {
74992
75006
  "getFigureUI",
74993
75007
  "getPositionAnchorOffset",
74994
75008
  "getGridOffset",
75009
+ "getMaximumSheetOffset",
74995
75010
  ];
74996
75011
  viewports = {};
74997
75012
  /**
@@ -76595,6 +76610,7 @@ topbarMenuRegistry
76595
76610
  .add("file", {
76596
76611
  name: _t("File"),
76597
76612
  sequence: 10,
76613
+ isReadonlyAllowed: true,
76598
76614
  })
76599
76615
  .addChild("settings", ["file"], {
76600
76616
  name: _t("Settings"),
@@ -76609,6 +76625,7 @@ topbarMenuRegistry
76609
76625
  .add("edit", {
76610
76626
  name: _t("Edit"),
76611
76627
  sequence: 20,
76628
+ isReadonlyAllowed: true,
76612
76629
  })
76613
76630
  .addChild("undo", ["edit"], {
76614
76631
  ...undo,
@@ -76693,6 +76710,7 @@ topbarMenuRegistry
76693
76710
  .add("view", {
76694
76711
  name: _t("View"),
76695
76712
  sequence: 30,
76713
+ isReadonlyAllowed: true,
76696
76714
  })
76697
76715
  .addChild("unfreeze_panes", ["view"], {
76698
76716
  ...unFreezePane,
@@ -76784,6 +76802,7 @@ topbarMenuRegistry
76784
76802
  .add("insert", {
76785
76803
  name: _t("Insert"),
76786
76804
  sequence: 40,
76805
+ isReadonlyAllowed: true,
76787
76806
  })
76788
76807
  .addChild("insert_row", ["insert"], {
76789
76808
  ...insertRow,
@@ -76891,7 +76910,11 @@ topbarMenuRegistry
76891
76910
  // ---------------------------------------------------------------------
76892
76911
  // FORMAT MENU ITEMS
76893
76912
  // ---------------------------------------------------------------------
76894
- .add("format", { name: _t("Format"), sequence: 50 })
76913
+ .add("format", {
76914
+ name: _t("Format"),
76915
+ sequence: 50,
76916
+ isReadonlyAllowed: true,
76917
+ })
76895
76918
  .addChild("format_number", ["format"], {
76896
76919
  ...formatNumberMenuItemSpec,
76897
76920
  name: _t("Number"),
@@ -76983,6 +77006,7 @@ topbarMenuRegistry
76983
77006
  .add("data", {
76984
77007
  name: _t("Data"),
76985
77008
  sequence: 60,
77009
+ isReadonlyAllowed: true,
76986
77010
  })
76987
77011
  .addChild("sort_range", ["data"], {
76988
77012
  ...sortRange,
@@ -78073,6 +78097,10 @@ class SpreadsheetDashboard extends Component {
78073
78097
  useTouchScroll(this.gridRef, this.moveCanvas.bind(this), () => {
78074
78098
  const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
78075
78099
  return scrollY > 0;
78100
+ }, () => {
78101
+ const { maxOffsetY } = this.env.model.getters.getMaximumSheetOffset();
78102
+ const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
78103
+ return scrollY < maxOffsetY;
78076
78104
  });
78077
78105
  }
78078
78106
  get gridContainer() {
@@ -80116,7 +80144,7 @@ css /* scss */ `
80116
80144
  border-radius: 4px;
80117
80145
  font-weight: 500;
80118
80146
  font-size: 14px;
80119
- height: 32px;
80147
+ min-height: 32px;
80120
80148
  line-height: 16px;
80121
80149
  flex-grow: 1;
80122
80150
  background-color: ${BUTTON_BG};
@@ -84872,6 +84900,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
84872
84900
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
84873
84901
 
84874
84902
 
84875
- __info__.version = "18.4.16";
84876
- __info__.date = "2025-11-03T12:31:57.153Z";
84877
- __info__.hash = "1ba569f";
84903
+ __info__.version = "18.4.18";
84904
+ __info__.date = "2025-11-24T07:42:07.821Z";
84905
+ __info__.hash = "4f83667";