@odoo/o-spreadsheet 17.1.3 → 17.1.4

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.
@@ -33,8 +33,8 @@ interface EnrichedToken extends Token {
33
33
 
34
34
  type TokenType = "OPERATOR" | "NUMBER" | "STRING" | "SYMBOL" | "SPACE" | "DEBUGGER" | "ARG_SEPARATOR" | "LEFT_PAREN" | "RIGHT_PAREN" | "REFERENCE" | "INVALID_REFERENCE" | "UNKNOWN";
35
35
  interface Token {
36
- type: TokenType;
37
- value: string;
36
+ readonly type: TokenType;
37
+ readonly value: string;
38
38
  }
39
39
  declare function tokenize(str: string, locale?: Locale): Token[];
40
40
 
@@ -3007,6 +3007,12 @@ interface ClipboardInterface {
3007
3007
  readText(): Promise<ClipboardReadResult>;
3008
3008
  }
3009
3009
 
3010
+ declare class FocusableElement {
3011
+ private focusableElement;
3012
+ setFocusableElement(element: HTMLElement): void;
3013
+ focus(): void;
3014
+ }
3015
+
3010
3016
  type NotificationType = "danger" | "info" | "success" | "warning";
3011
3017
  interface InformationNotification {
3012
3018
  text: string;
@@ -3028,6 +3034,7 @@ interface SpreadsheetChildEnv extends SpreadsheetEnv {
3028
3034
  startCellEdition: (content?: string) => void;
3029
3035
  loadCurrencies?: () => Promise<Currency[]>;
3030
3036
  loadLocales: () => Promise<Locale[]>;
3037
+ focusableElement: FocusableElement;
3031
3038
  }
3032
3039
 
3033
3040
  declare class RangeAdapter implements CommandHandler<CoreCommand> {
@@ -7809,11 +7816,12 @@ interface AutocompleteValue {
7809
7816
  }
7810
7817
  interface ComposerProps {
7811
7818
  focus: ComposerFocusType;
7812
- onComposerContentFocused: (selection: ComposerSelection) => void;
7813
7819
  inputStyle?: string;
7814
7820
  rect?: Rect;
7815
7821
  delimitation?: DOMDimension;
7816
- onComposerUnmounted?: () => void;
7822
+ onComposerContentFocused: () => void;
7823
+ onComposerCellFocused?: (content: String) => void;
7824
+ isDefaultFocus?: boolean;
7817
7825
  }
7818
7826
  interface ComposerState$1 {
7819
7827
  positionStart: number;
@@ -7838,7 +7846,6 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
7838
7846
  focus: {
7839
7847
  validate: (value: string) => boolean;
7840
7848
  };
7841
- onComposerContentFocused: FunctionConstructor;
7842
7849
  inputStyle: {
7843
7850
  type: StringConstructor;
7844
7851
  optional: boolean;
@@ -7851,10 +7858,15 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
7851
7858
  type: ObjectConstructor;
7852
7859
  optional: boolean;
7853
7860
  };
7854
- onComposerUnmounted: {
7861
+ onComposerCellFocused: {
7855
7862
  type: FunctionConstructor;
7856
7863
  optional: boolean;
7857
7864
  };
7865
+ onComposerContentFocused: FunctionConstructor;
7866
+ isDefaultFocus: {
7867
+ type: BooleanConstructor;
7868
+ optional: boolean;
7869
+ };
7858
7870
  };
7859
7871
  static components: {
7860
7872
  TextValueProvider: typeof TextValueProvider;
@@ -7862,6 +7874,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
7862
7874
  };
7863
7875
  static defaultProps: {
7864
7876
  inputStyle: string;
7877
+ isDefaultFocus: boolean;
7865
7878
  };
7866
7879
  composerRef: {
7867
7880
  el: HTMLElement | null;
@@ -7884,7 +7897,6 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
7884
7897
  private processArrowKeys;
7885
7898
  private handleArrowKeysForAutocomplete;
7886
7899
  private processTabKey;
7887
- processSpaceKey(ev: KeyboardEvent): void;
7888
7900
  private processEnterKey;
7889
7901
  private processNewLineEvent;
7890
7902
  private processEscapeKey;
@@ -7893,6 +7905,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
7893
7905
  onCompositionStart(): void;
7894
7906
  onCompositionEnd(): void;
7895
7907
  onKeydown(ev: KeyboardEvent): void;
7908
+ onPaste(ev: ClipboardEvent): void;
7896
7909
  onInput(ev: InputEvent): void;
7897
7910
  onKeyup(ev: KeyboardEvent): void;
7898
7911
  showFunctionAutocomplete(searchTerm: string): void;
@@ -8101,7 +8114,7 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
8101
8114
  focusGrid(): void;
8102
8115
  onKeydown(ev: KeyboardEvent): void;
8103
8116
  onTopBarComposerFocused(selection: ComposerSelection): void;
8104
- onGridComposerContentFocused(): void;
8117
+ onGridComposerContentFocused(selection: ComposerSelection): void;
8105
8118
  onGridComposerCellFocused(content?: string, selection?: ComposerSelection): void;
8106
8119
  /**
8107
8120
  * Start the edition or update the content if it's already started.
@@ -8115,8 +8128,8 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
8115
8128
 
8116
8129
  interface Props$5 {
8117
8130
  focus: ComposerFocusType;
8118
- onComposerUnmounted: () => void;
8119
- onComposerContentFocused: (selection: ComposerSelection) => void;
8131
+ onComposerContentFocused: () => void;
8132
+ onComposerCellFocused: () => void;
8120
8133
  gridDims: DOMDimension;
8121
8134
  }
8122
8135
  /**
@@ -8129,24 +8142,30 @@ declare class GridComposer extends Component<Props$5, SpreadsheetChildEnv> {
8129
8142
  focus: {
8130
8143
  validate: (value: string) => boolean;
8131
8144
  };
8132
- onComposerUnmounted: FunctionConstructor;
8145
+ onComposerCellFocused: FunctionConstructor;
8133
8146
  onComposerContentFocused: FunctionConstructor;
8134
8147
  gridDims: ObjectConstructor;
8135
8148
  };
8136
8149
  static components: {
8137
8150
  Composer: typeof Composer;
8138
8151
  };
8139
- private gridComposerRef;
8140
- private zone;
8141
8152
  private rect;
8153
+ private isEditing;
8142
8154
  private isCellReferenceVisible;
8143
- private composerState;
8155
+ get defaultRect(): {
8156
+ x: number;
8157
+ y: number;
8158
+ width: number;
8159
+ height: number;
8160
+ };
8144
8161
  setup(): void;
8145
8162
  get shouldDisplayCellReference(): boolean;
8146
8163
  get cellReference(): string;
8147
8164
  get cellReferenceStyle(): string;
8165
+ get composerProps(): ComposerProps;
8148
8166
  get containerStyle(): string;
8149
- get composerStyle(): string;
8167
+ private updateComponentPosition;
8168
+ private updateCellReferenceVisibility;
8150
8169
  }
8151
8170
 
8152
8171
  interface ResizerState {
@@ -8382,7 +8401,6 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
8382
8401
  readonly HEADER_WIDTH = 48;
8383
8402
  private menuState;
8384
8403
  private gridRef;
8385
- private hiddenInput;
8386
8404
  onMouseWheel: (ev: WheelEvent) => void;
8387
8405
  canvasPosition: DOMCoordinates;
8388
8406
  hoveredCell: Partial<Position$1>;
@@ -8394,7 +8412,7 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
8394
8412
  get gridOverlayDimensions(): string;
8395
8413
  onClosePopover(): void;
8396
8414
  private keyDownMapping;
8397
- focus(): void;
8415
+ focusDefaultElement(): void;
8398
8416
  get gridEl(): HTMLElement;
8399
8417
  getAutofillPosition(): {
8400
8418
  left: number;
@@ -8414,7 +8432,6 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
8414
8432
  closeOpenedPopover(): void;
8415
8433
  processArrows(ev: KeyboardEvent): void;
8416
8434
  onKeydown(ev: KeyboardEvent): void;
8417
- onInput(ev: InputEvent): void;
8418
8435
  onInputContextMenu(ev: MouseEvent): void;
8419
8436
  onCellRightClicked(col: HeaderIndex, row: HeaderIndex, { x, y }: DOMCoordinates): void;
8420
8437
  toggleContextMenu(type: ContextMenuType, x: Pixel, y: Pixel): void;