@odoo/o-spreadsheet 16.2.29 → 16.2.31

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.
@@ -1316,7 +1316,7 @@ declare class EditionPlugin extends UIPlugin {
1316
1316
  getCurrentContent(): string;
1317
1317
  getEditionSheet(): string;
1318
1318
  getComposerSelection(): ComposerSelection;
1319
- getCurrentEditedCell(): CellPosition;
1319
+ getCurrentEditedCell(): CellPosition | undefined;
1320
1320
  isSelectingForComposer(): boolean;
1321
1321
  showSelectionIndicator(): boolean;
1322
1322
  getCurrentTokens(): EnrichedToken[];
@@ -2567,6 +2567,12 @@ interface ClipboardInterface {
2567
2567
  readText(): Promise<ClipboardReadResult>;
2568
2568
  }
2569
2569
 
2570
+ declare class FocusableElement {
2571
+ private focusableElement;
2572
+ setFocusableElement(element: HTMLElement): void;
2573
+ focus(): void;
2574
+ }
2575
+
2570
2576
  type TranslationFunction = (string: string, ...values: string[] | [{
2571
2577
  [key: string]: string;
2572
2578
  }]) => string;
@@ -2600,6 +2606,7 @@ interface SpreadsheetChildEnv extends SpreadsheetEnv {
2600
2606
  _t: TranslationFunction;
2601
2607
  startCellEdition: (content: string) => void;
2602
2608
  loadCurrencies?: () => Promise<Currency[]>;
2609
+ focusableElement: FocusableElement;
2603
2610
  }
2604
2611
 
2605
2612
  type ArgType = "ANY" | "BOOLEAN" | "NUMBER" | "STRING" | "DATE" | "RANGE" | "RANGE<BOOLEAN>" | "RANGE<NUMBER>" | "RANGE<DATE>" | "RANGE<STRING>" | "META";
@@ -2895,8 +2902,9 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
2895
2902
  *
2896
2903
  * @param range the range (received from getRangeFromXC or getRangeFromZone)
2897
2904
  * @param forSheetId the id of the sheet where the range string is supposed to be used.
2905
+ * @param [useFixedZone=false] if true, the range will be returned with fixed row and column
2898
2906
  */
2899
- getRangeString(range: Range, forSheetId: UID): string;
2907
+ getRangeString(range: Range, forSheetId: UID, useFixedZone?: boolean): string;
2900
2908
  getRangeDataFromXc(sheetId: UID, xc: string): RangeData;
2901
2909
  getRangeDataFromZone(sheetId: UID, zone: Zone): RangeData;
2902
2910
  getRangeFromRangeData(data: RangeData): Range;
@@ -3114,7 +3122,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3114
3122
  * starting an async evaluation even if it has been moved or re-allocated
3115
3123
  */
3116
3124
  getCellById(cellId: UID): Cell | undefined;
3117
- buildFormulaContent(sheetId: UID, cell: Pick<FormulaCell, "dependencies" | "compiledFormula">, dependencies?: Range[]): string;
3125
+ buildFormulaContent(sheetId: UID, cell: Pick<FormulaCell, "dependencies" | "compiledFormula">, dependencies?: Range[], useFixedZone?: boolean): string;
3118
3126
  getFormulaCellContent(sheetId: UID, cell: FormulaCell): string;
3119
3127
  getCellStyle(position: CellPosition): Style;
3120
3128
  /**
@@ -6075,11 +6083,12 @@ interface AutocompleteValue {
6075
6083
  }
6076
6084
  interface ComposerProps {
6077
6085
  focus: ComposerFocusType;
6078
- onComposerContentFocused: (selection: ComposerSelection) => void;
6079
6086
  inputStyle?: string;
6080
6087
  rect?: Rect;
6081
6088
  delimitation?: DOMDimension;
6082
- onComposerUnmounted?: () => void;
6089
+ onComposerContentFocused: () => void;
6090
+ onComposerCellFocused?: (content: String) => void;
6091
+ isDefaultFocus?: boolean;
6083
6092
  }
6084
6093
  interface ComposerState$1 {
6085
6094
  positionStart: number;
@@ -6104,6 +6113,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6104
6113
  };
6105
6114
  static defaultProps: {
6106
6115
  inputStyle: string;
6116
+ isDefaultFocus: boolean;
6107
6117
  };
6108
6118
  composerRef: {
6109
6119
  el: HTMLElement | null;
@@ -6131,7 +6141,8 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6131
6141
  onCompositionEnd(): void;
6132
6142
  onKeydown(ev: KeyboardEvent): void;
6133
6143
  private updateCursorIfNeeded;
6134
- onInput(): void;
6144
+ onPaste(ev: ClipboardEvent): void;
6145
+ onInput(ev: InputEvent): void;
6135
6146
  onKeyup(ev: KeyboardEvent): void;
6136
6147
  showAutocomplete(searchTerm: string): void;
6137
6148
  onMousedown(ev: MouseEvent): void;
@@ -6324,7 +6335,7 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
6324
6335
  focusGrid(): void;
6325
6336
  onKeydown(ev: KeyboardEvent): void;
6326
6337
  onTopBarComposerFocused(selection: ComposerSelection): void;
6327
- onGridComposerContentFocused(): void;
6338
+ onGridComposerContentFocused(selection: ComposerSelection): void;
6328
6339
  onGridComposerCellFocused(content?: string, selection?: ComposerSelection): void;
6329
6340
  /**
6330
6341
  * Start the edition or update the content if it's already started.
@@ -6335,8 +6346,8 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
6335
6346
 
6336
6347
  interface Props$5 {
6337
6348
  focus: ComposerFocusType;
6338
- onComposerUnmounted: () => void;
6339
- onComposerContentFocused: (selection: ComposerSelection) => void;
6349
+ onComposerContentFocused: () => void;
6350
+ onComposerCellFocused: () => void;
6340
6351
  gridDims: DOMDimension;
6341
6352
  }
6342
6353
  /**
@@ -6348,17 +6359,23 @@ declare class GridComposer extends Component<Props$5, SpreadsheetChildEnv> {
6348
6359
  static components: {
6349
6360
  Composer: typeof Composer;
6350
6361
  };
6351
- private gridComposerRef;
6352
- private zone;
6353
6362
  private rect;
6363
+ private isEditing;
6354
6364
  private isCellReferenceVisible;
6355
- private composerState;
6365
+ get defaultRect(): {
6366
+ x: number;
6367
+ y: number;
6368
+ width: number;
6369
+ height: number;
6370
+ };
6356
6371
  setup(): void;
6357
6372
  get shouldDisplayCellReference(): boolean;
6358
6373
  get cellReference(): string;
6359
6374
  get cellReferenceStyle(): string;
6375
+ get composerProps(): ComposerProps;
6360
6376
  get containerStyle(): string;
6361
- get composerStyle(): string;
6377
+ private updateComponentPosition;
6378
+ private updateCellReferenceVisibility;
6362
6379
  }
6363
6380
 
6364
6381
  interface ResizerState {
@@ -6558,7 +6575,6 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
6558
6575
  readonly HEADER_WIDTH = 48;
6559
6576
  private menuState;
6560
6577
  private gridRef;
6561
- private hiddenInput;
6562
6578
  onMouseWheel: (ev: WheelEvent) => void;
6563
6579
  canvasPosition: DOMCoordinates;
6564
6580
  hoveredCell: Partial<Position$1>;
@@ -6570,7 +6586,7 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
6570
6586
  get gridOverlayDimensions(): string;
6571
6587
  onClosePopover(): void;
6572
6588
  private keyDownMapping;
6573
- focus(): void;
6589
+ focusDefaultElement(): void;
6574
6590
  get gridEl(): HTMLElement;
6575
6591
  getAutofillPosition(): {
6576
6592
  left: number;
@@ -6590,7 +6606,6 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
6590
6606
  closeOpenedPopover(): void;
6591
6607
  processArrows(ev: KeyboardEvent): void;
6592
6608
  onKeydown(ev: KeyboardEvent): void;
6593
- onInput(ev: InputEvent): void;
6594
6609
  onInputContextMenu(ev: MouseEvent): void;
6595
6610
  onCellRightClicked(col: HeaderIndex, row: HeaderIndex, { x, y }: DOMCoordinates): void;
6596
6611
  toggleContextMenu(type: ContextMenuType, x: Pixel, y: Pixel): void;