@odoo/o-spreadsheet 16.3.24 → 16.3.25

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.
@@ -1519,7 +1519,7 @@ declare class EditionPlugin extends UIPlugin {
1519
1519
  getEditionMode(): EditionMode;
1520
1520
  getCurrentContent(): string;
1521
1521
  getComposerSelection(): ComposerSelection;
1522
- getCurrentEditedCell(): CellPosition;
1522
+ getCurrentEditedCell(): CellPosition | undefined;
1523
1523
  isSelectingForComposer(): boolean;
1524
1524
  showSelectionIndicator(): boolean;
1525
1525
  getCurrentTokens(): EnrichedToken[];
@@ -2808,6 +2808,12 @@ interface ClipboardInterface {
2808
2808
  readText(): Promise<ClipboardReadResult>;
2809
2809
  }
2810
2810
 
2811
+ declare class FocusableElement {
2812
+ private focusableElement;
2813
+ setFocusableElement(element: HTMLElement): void;
2814
+ focus(): void;
2815
+ }
2816
+
2811
2817
  type TranslationFunction = (string: string, ...values: string[] | [{
2812
2818
  [key: string]: string;
2813
2819
  }]) => string;
@@ -2841,6 +2847,7 @@ interface SpreadsheetChildEnv extends SpreadsheetEnv {
2841
2847
  _t: TranslationFunction;
2842
2848
  startCellEdition: (content: string) => void;
2843
2849
  loadCurrencies?: () => Promise<Currency[]>;
2850
+ focusableElement: FocusableElement;
2844
2851
  }
2845
2852
 
2846
2853
  type ArgType = "ANY" | "BOOLEAN" | "NUMBER" | "STRING" | "DATE" | "RANGE" | "RANGE<BOOLEAN>" | "RANGE<NUMBER>" | "RANGE<DATE>" | "RANGE<STRING>" | "META";
@@ -6556,11 +6563,12 @@ interface AutocompleteValue {
6556
6563
  }
6557
6564
  interface ComposerProps {
6558
6565
  focus: ComposerFocusType;
6559
- onComposerContentFocused: (selection: ComposerSelection) => void;
6560
6566
  inputStyle?: string;
6561
6567
  rect?: Rect;
6562
6568
  delimitation?: DOMDimension;
6563
- onComposerUnmounted?: () => void;
6569
+ onComposerContentFocused: () => void;
6570
+ onComposerCellFocused?: (content: String) => void;
6571
+ isDefaultFocus?: boolean;
6564
6572
  }
6565
6573
  interface ComposerState$1 {
6566
6574
  positionStart: number;
@@ -6585,6 +6593,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6585
6593
  };
6586
6594
  static defaultProps: {
6587
6595
  inputStyle: string;
6596
+ isDefaultFocus: boolean;
6588
6597
  };
6589
6598
  composerRef: {
6590
6599
  el: HTMLElement | null;
@@ -6612,7 +6621,8 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6612
6621
  onCompositionEnd(): void;
6613
6622
  onKeydown(ev: KeyboardEvent): void;
6614
6623
  private updateCursorIfNeeded;
6615
- onInput(): void;
6624
+ onPaste(ev: ClipboardEvent): void;
6625
+ onInput(ev: InputEvent): void;
6616
6626
  onKeyup(ev: KeyboardEvent): void;
6617
6627
  showAutocomplete(searchTerm: string): void;
6618
6628
  onMousedown(ev: MouseEvent): void;
@@ -6771,7 +6781,7 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
6771
6781
  focusGrid(): void;
6772
6782
  onKeydown(ev: KeyboardEvent): void;
6773
6783
  onTopBarComposerFocused(selection: ComposerSelection): void;
6774
- onGridComposerContentFocused(): void;
6784
+ onGridComposerContentFocused(selection: ComposerSelection): void;
6775
6785
  onGridComposerCellFocused(content?: string, selection?: ComposerSelection): void;
6776
6786
  /**
6777
6787
  * Start the edition or update the content if it's already started.
@@ -6782,8 +6792,8 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
6782
6792
 
6783
6793
  interface Props$5 {
6784
6794
  focus: ComposerFocusType;
6785
- onComposerUnmounted: () => void;
6786
- onComposerContentFocused: (selection: ComposerSelection) => void;
6795
+ onComposerContentFocused: () => void;
6796
+ onComposerCellFocused: () => void;
6787
6797
  gridDims: DOMDimension;
6788
6798
  }
6789
6799
  /**
@@ -6795,17 +6805,23 @@ declare class GridComposer extends Component<Props$5, SpreadsheetChildEnv> {
6795
6805
  static components: {
6796
6806
  Composer: typeof Composer;
6797
6807
  };
6798
- private gridComposerRef;
6799
- private zone;
6800
6808
  private rect;
6809
+ private isEditing;
6801
6810
  private isCellReferenceVisible;
6802
- private composerState;
6811
+ get defaultRect(): {
6812
+ x: number;
6813
+ y: number;
6814
+ width: number;
6815
+ height: number;
6816
+ };
6803
6817
  setup(): void;
6804
6818
  get shouldDisplayCellReference(): boolean;
6805
6819
  get cellReference(): string;
6806
6820
  get cellReferenceStyle(): string;
6821
+ get composerProps(): ComposerProps;
6807
6822
  get containerStyle(): string;
6808
- get composerStyle(): string;
6823
+ private updateComponentPosition;
6824
+ private updateCellReferenceVisibility;
6809
6825
  }
6810
6826
 
6811
6827
  interface ResizerState {
@@ -7005,7 +7021,6 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
7005
7021
  readonly HEADER_WIDTH = 48;
7006
7022
  private menuState;
7007
7023
  private gridRef;
7008
- private hiddenInput;
7009
7024
  onMouseWheel: (ev: WheelEvent) => void;
7010
7025
  canvasPosition: DOMCoordinates;
7011
7026
  hoveredCell: Partial<Position$1>;
@@ -7017,7 +7032,7 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
7017
7032
  get gridOverlayDimensions(): string;
7018
7033
  onClosePopover(): void;
7019
7034
  private keyDownMapping;
7020
- focus(): void;
7035
+ focusDefaultElement(): void;
7021
7036
  get gridEl(): HTMLElement;
7022
7037
  getAutofillPosition(): {
7023
7038
  left: number;
@@ -7037,7 +7052,6 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
7037
7052
  closeOpenedPopover(): void;
7038
7053
  processArrows(ev: KeyboardEvent): void;
7039
7054
  onKeydown(ev: KeyboardEvent): void;
7040
- onInput(ev: InputEvent): void;
7041
7055
  onInputContextMenu(ev: MouseEvent): void;
7042
7056
  onCellRightClicked(col: HeaderIndex, row: HeaderIndex, { x, y }: DOMCoordinates): void;
7043
7057
  toggleContextMenu(type: ContextMenuType, x: Pixel, y: Pixel): void;