@odoo/o-spreadsheet 17.0.10 → 17.0.13

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.
@@ -44,8 +44,8 @@ interface EnrichedToken extends Token {
44
44
 
45
45
  type TokenType = "OPERATOR" | "NUMBER" | "STRING" | "SYMBOL" | "SPACE" | "DEBUGGER" | "ARG_SEPARATOR" | "LEFT_PAREN" | "RIGHT_PAREN" | "REFERENCE" | "INVALID_REFERENCE" | "UNKNOWN";
46
46
  interface Token {
47
- type: TokenType;
48
- value: string;
47
+ readonly type: TokenType;
48
+ readonly value: string;
49
49
  }
50
50
  declare function tokenize(str: string, locale?: Locale): Token[];
51
51
 
@@ -3090,6 +3090,12 @@ interface ClipboardInterface {
3090
3090
  readText(): Promise<ClipboardReadResult>;
3091
3091
  }
3092
3092
 
3093
+ declare class FocusableElement {
3094
+ private focusableElement;
3095
+ setFocusableElement(element: HTMLElement): void;
3096
+ focus(): void;
3097
+ }
3098
+
3093
3099
  type NotificationType = "danger" | "info" | "success" | "warning";
3094
3100
  interface InformationNotification {
3095
3101
  text: string;
@@ -3111,6 +3117,7 @@ interface SpreadsheetChildEnv extends SpreadsheetEnv {
3111
3117
  startCellEdition: (content?: string) => void;
3112
3118
  loadCurrencies?: () => Promise<Currency[]>;
3113
3119
  loadLocales: () => Promise<Locale[]>;
3120
+ focusableElement: FocusableElement;
3114
3121
  }
3115
3122
 
3116
3123
  type ArgType = "ANY" | "BOOLEAN" | "NUMBER" | "STRING" | "DATE" | "RANGE" | "RANGE<BOOLEAN>" | "RANGE<NUMBER>" | "RANGE<DATE>" | "RANGE<STRING>" | "RANGE<ANY>" | "META";
@@ -3469,6 +3476,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3469
3476
  private createErrorFormula;
3470
3477
  private checkCellOutOfSheet;
3471
3478
  private checkUselessClearCell;
3479
+ private checkUselessUpdateCell;
3472
3480
  }
3473
3481
 
3474
3482
  /**
@@ -7093,6 +7101,8 @@ interface Props$b {
7093
7101
  }
7094
7102
  declare class TextValueProvider extends Component<Props$b> {
7095
7103
  static template: string;
7104
+ private autoCompleteListRef;
7105
+ setup(): void;
7096
7106
  }
7097
7107
 
7098
7108
  declare class ContentEditableHelper {
@@ -7183,11 +7193,12 @@ interface AutocompleteValue {
7183
7193
  }
7184
7194
  interface ComposerProps {
7185
7195
  focus: ComposerFocusType;
7186
- onComposerContentFocused: (selection: ComposerSelection) => void;
7187
7196
  inputStyle?: string;
7188
7197
  rect?: Rect;
7189
7198
  delimitation?: DOMDimension;
7190
- onComposerUnmounted?: () => void;
7199
+ onComposerContentFocused: () => void;
7200
+ onComposerCellFocused?: (content: String) => void;
7201
+ isDefaultFocus?: boolean;
7191
7202
  }
7192
7203
  interface ComposerState$1 {
7193
7204
  positionStart: number;
@@ -7214,6 +7225,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
7214
7225
  };
7215
7226
  static defaultProps: {
7216
7227
  inputStyle: string;
7228
+ isDefaultFocus: boolean;
7217
7229
  };
7218
7230
  composerRef: {
7219
7231
  el: HTMLElement | null;
@@ -7236,7 +7248,6 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
7236
7248
  private processArrowKeys;
7237
7249
  private handleArrowKeysForAutocomplete;
7238
7250
  private processTabKey;
7239
- processSpaceKey(ev: KeyboardEvent): void;
7240
7251
  private processEnterKey;
7241
7252
  private processEscapeKey;
7242
7253
  private processF4Key;
@@ -7244,6 +7255,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
7244
7255
  onCompositionStart(): void;
7245
7256
  onCompositionEnd(): void;
7246
7257
  onKeydown(ev: KeyboardEvent): void;
7258
+ onPaste(ev: ClipboardEvent): void;
7247
7259
  onInput(ev: InputEvent): void;
7248
7260
  onKeyup(ev: KeyboardEvent): void;
7249
7261
  showFunctionAutocomplete(searchTerm: string): void;
@@ -7423,7 +7435,7 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
7423
7435
  focusGrid(): void;
7424
7436
  onKeydown(ev: KeyboardEvent): void;
7425
7437
  onTopBarComposerFocused(selection: ComposerSelection): void;
7426
- onGridComposerContentFocused(): void;
7438
+ onGridComposerContentFocused(selection: ComposerSelection): void;
7427
7439
  onGridComposerCellFocused(content?: string, selection?: ComposerSelection): void;
7428
7440
  /**
7429
7441
  * Start the edition or update the content if it's already started.
@@ -7437,8 +7449,8 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
7437
7449
 
7438
7450
  interface Props$5 {
7439
7451
  focus: ComposerFocusType;
7440
- onComposerUnmounted: () => void;
7441
- onComposerContentFocused: (selection: ComposerSelection) => void;
7452
+ onComposerContentFocused: () => void;
7453
+ onComposerCellFocused: () => void;
7442
7454
  gridDims: DOMDimension;
7443
7455
  }
7444
7456
  /**
@@ -7450,17 +7462,23 @@ declare class GridComposer extends Component<Props$5, SpreadsheetChildEnv> {
7450
7462
  static components: {
7451
7463
  Composer: typeof Composer;
7452
7464
  };
7453
- private gridComposerRef;
7454
- private zone;
7455
7465
  private rect;
7466
+ private isEditing;
7456
7467
  private isCellReferenceVisible;
7457
- private composerState;
7468
+ get defaultRect(): {
7469
+ x: number;
7470
+ y: number;
7471
+ width: number;
7472
+ height: number;
7473
+ };
7458
7474
  setup(): void;
7459
7475
  get shouldDisplayCellReference(): boolean;
7460
7476
  get cellReference(): string;
7461
7477
  get cellReferenceStyle(): string;
7478
+ get composerProps(): ComposerProps;
7462
7479
  get containerStyle(): string;
7463
- get composerStyle(): string;
7480
+ private updateComponentPosition;
7481
+ private updateCellReferenceVisibility;
7464
7482
  }
7465
7483
 
7466
7484
  interface ResizerState {
@@ -7660,7 +7678,6 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
7660
7678
  readonly HEADER_WIDTH = 48;
7661
7679
  private menuState;
7662
7680
  private gridRef;
7663
- private hiddenInput;
7664
7681
  onMouseWheel: (ev: WheelEvent) => void;
7665
7682
  canvasPosition: DOMCoordinates;
7666
7683
  hoveredCell: Partial<Position$1>;
@@ -7672,7 +7689,7 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
7672
7689
  get gridOverlayDimensions(): string;
7673
7690
  onClosePopover(): void;
7674
7691
  private keyDownMapping;
7675
- focus(): void;
7692
+ focusDefaultElement(): void;
7676
7693
  get gridEl(): HTMLElement;
7677
7694
  getAutofillPosition(): {
7678
7695
  left: number;
@@ -7692,7 +7709,6 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
7692
7709
  closeOpenedPopover(): void;
7693
7710
  processArrows(ev: KeyboardEvent): void;
7694
7711
  onKeydown(ev: KeyboardEvent): void;
7695
- onInput(ev: InputEvent): void;
7696
7712
  onInputContextMenu(ev: MouseEvent): void;
7697
7713
  onCellRightClicked(col: HeaderIndex, row: HeaderIndex, { x, y }: DOMCoordinates): void;
7698
7714
  toggleContextMenu(type: ContextMenuType, x: Pixel, y: Pixel): void;