@odoo/o-spreadsheet 16.2.0-alpha.2 → 16.2.0-alpha.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.
@@ -350,11 +350,16 @@ interface SelectionProcessor {
350
350
  }
351
351
  declare type SelectionStreamProcessor = SelectionProcessor & StatefulStream<SelectionEvent, AnchorZone>;
352
352
 
353
- interface XLSXExportFile {
353
+ declare type XLSXExportFile = XLSXExportImageFile | XLSXExportXMLFile;
354
+ interface XLSXExportXMLFile {
354
355
  path: string;
355
356
  content: string;
356
357
  contentType?: string;
357
358
  }
359
+ interface XLSXExportImageFile {
360
+ path: string;
361
+ imagePath: string;
362
+ }
358
363
  interface XLSXExport {
359
364
  name: string;
360
365
  files: XLSXExportFile[];
@@ -613,6 +618,25 @@ interface IconSetRule {
613
618
  declare type ConditionalFormattingOperatorValues = "BeginsWith" | "Between" | "ContainsText" | "IsEmpty" | "IsNotEmpty" | "EndsWith" | "Equal" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual" | "NotBetween" | "NotContains" | "NotEqual";
614
619
  declare type UpDown = "up" | "down";
615
620
 
621
+ interface Figure {
622
+ id: UID;
623
+ x: Pixel;
624
+ y: Pixel;
625
+ width: Pixel;
626
+ height: Pixel;
627
+ tag: string;
628
+ }
629
+ interface FigureSize {
630
+ width: Pixel;
631
+ height: Pixel;
632
+ }
633
+ declare type ResizeDirection = -1 | 0 | 1;
634
+
635
+ interface Image {
636
+ path: string;
637
+ size: FigureSize;
638
+ }
639
+
616
640
  interface CellData {
617
641
  content?: string;
618
642
  style?: number;
@@ -672,6 +696,7 @@ interface WorkbookData {
672
696
  };
673
697
  };
674
698
  revisionId: UID;
699
+ uniqueFigureIds: boolean;
675
700
  }
676
701
  interface ExcelWorkbookData extends WorkbookData {
677
702
  sheets: ExcelSheetData[];
@@ -685,6 +710,7 @@ interface ExcelSheetData extends Omit<SheetData, "figureTables"> {
685
710
  [key: string]: ExcelCellData | undefined;
686
711
  };
687
712
  charts: FigureData<ExcelChartDefinition>[];
713
+ images: FigureData<Image>[];
688
714
  filterTables: ExcelFilterTableData[];
689
715
  }
690
716
  interface FilterTableData {
@@ -834,25 +860,6 @@ interface TransportService<T = any> {
834
860
  leave: (id: UID) => void;
835
861
  }
836
862
 
837
- interface Figure {
838
- id: UID;
839
- x: Pixel;
840
- y: Pixel;
841
- width: Pixel;
842
- height: Pixel;
843
- tag: string;
844
- }
845
- interface FigureSize {
846
- width: Pixel;
847
- height: Pixel;
848
- }
849
- declare type ResizeDirection = -1 | 0 | 1;
850
-
851
- interface Image {
852
- path: string;
853
- size: FigureSize;
854
- }
855
-
856
863
  declare type FilePath = string;
857
864
  /**
858
865
  * FileStore manage the transfer of file with the server.
@@ -1350,12 +1357,6 @@ declare class EditionPlugin extends UIPlugin {
1350
1357
  private getTokensInSelection;
1351
1358
  }
1352
1359
 
1353
- declare type Rect = {
1354
- x: Pixel;
1355
- y: Pixel;
1356
- width: Pixel;
1357
- height: Pixel;
1358
- };
1359
1360
  /**
1360
1361
  * Coordinate in pixels
1361
1362
  */
@@ -1367,6 +1368,7 @@ interface DOMDimension {
1367
1368
  width: Pixel;
1368
1369
  height: Pixel;
1369
1370
  }
1371
+ declare type Rect = DOMCoordinates & DOMDimension;
1370
1372
  /**
1371
1373
  * The viewport is the visible area of a sheet.
1372
1374
  * Column and row headers are not included in the viewport.
@@ -1865,7 +1867,7 @@ interface FocusInputCommand {
1865
1867
  /**
1866
1868
  * Range to focus
1867
1869
  */
1868
- rangeId: string;
1870
+ rangeId: number;
1869
1871
  }
1870
1872
  /**
1871
1873
  * Add an empty range at the end of a SelectionComponent state
@@ -1884,7 +1886,7 @@ interface RemoveRangeCommand {
1884
1886
  /** SelectionComponent id */
1885
1887
  id: string;
1886
1888
  /** The range to be removed */
1887
- rangeId: string;
1889
+ rangeId: number;
1888
1890
  }
1889
1891
  /**
1890
1892
  * Set a new value for a given range of a SelectionComponent state.
@@ -1894,7 +1896,7 @@ interface ChangeRangeCommand {
1894
1896
  /** SelectionComponent id */
1895
1897
  id: string;
1896
1898
  /** The range to be changed */
1897
- rangeId: string;
1899
+ rangeId: number;
1898
1900
  /**
1899
1901
  * Range to set in the input. Invalid ranges are also accepted.
1900
1902
  * e.g. "B2:B3" or the invalid "A5:"
@@ -2076,7 +2078,7 @@ declare const enum CommandResult {
2076
2078
  InvalidRange = 25,
2077
2079
  InvalidZones = 26,
2078
2080
  InvalidSheetId = 27,
2079
- DuplicatedImageId = 28,
2081
+ InvalidFigureId = 28,
2080
2082
  InputAlreadyFocused = 29,
2081
2083
  MaximumRangesReached = 30,
2082
2084
  InvalidChartDefinition = 31,
@@ -2132,7 +2134,8 @@ declare const enum CommandResult {
2132
2134
  NonContinuousTargets = 81,
2133
2135
  DuplicatedFigureId = 82,
2134
2136
  InvalidSelectionStep = 83,
2135
- DuplicatedChartId = 84
2137
+ DuplicatedChartId = 84,
2138
+ ChartDoesNotExist = 85
2136
2139
  }
2137
2140
  interface CommandHandler<T> {
2138
2141
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -2214,8 +2217,8 @@ interface UnboundedZone {
2214
2217
  hasHeader?: boolean;
2215
2218
  }
2216
2219
  interface ZoneDimension {
2217
- height: HeaderIndex;
2218
- width: HeaderIndex;
2220
+ numberOfRows: HeaderIndex;
2221
+ numberOfCols: HeaderIndex;
2219
2222
  }
2220
2223
  declare type Align = "left" | "right" | "center" | undefined;
2221
2224
  declare type VerticalAlign = "top" | "middle" | "bottom" | undefined;
@@ -3179,24 +3182,22 @@ declare abstract class AbstractChart {
3179
3182
  * This plugin manages charts
3180
3183
  * */
3181
3184
  interface ChartState {
3182
- readonly charts: {
3183
- [sheetId: UID]: Record<UID, AbstractChart | undefined> | undefined;
3184
- };
3185
+ readonly charts: Record<UID, AbstractChart | undefined>;
3185
3186
  }
3186
3187
  declare class ChartPlugin extends CorePlugin<ChartState> implements ChartState {
3187
3188
  static getters: readonly ["isChartDefined", "getChartDefinition", "getChartType", "getChartIds", "getChart", "getContextCreationChart"];
3188
- readonly charts: ChartState["charts"];
3189
+ readonly charts: Record<UID, AbstractChart | undefined>;
3189
3190
  private createChart;
3190
3191
  private validateChartDefinition;
3191
3192
  adaptRanges(applyChange: ApplyRangeChange): void;
3192
3193
  allowDispatch(cmd: Command): CommandResult | CommandResult[];
3193
3194
  handle(cmd: CoreCommand): void;
3194
- getContextCreationChart(sheetId: UID, figureId: UID): ChartCreationContext | undefined;
3195
- getChart(sheetId: UID, figureId: UID): AbstractChart | undefined;
3196
- getChartType(sheetId: UID, figureId: UID): ChartType;
3197
- isChartDefined(sheetId: UID, figureId: UID): boolean;
3195
+ getContextCreationChart(figureId: UID): ChartCreationContext | undefined;
3196
+ getChart(figureId: UID): AbstractChart | undefined;
3197
+ getChartType(figureId: UID): ChartType;
3198
+ isChartDefined(figureId: UID): boolean;
3198
3199
  getChartIds(sheetId: UID): string[];
3199
- getChartDefinition(sheetId: UID, figureId: UID): ChartDefinition;
3200
+ getChartDefinition(figureId: UID): ChartDefinition;
3200
3201
  import(data: WorkbookData): void;
3201
3202
  export(data: WorkbookData): void;
3202
3203
  exportForExcel(data: ExcelWorkbookData): void;
@@ -3210,6 +3211,7 @@ declare class ChartPlugin extends CorePlugin<ChartState> implements ChartState {
3210
3211
  */
3211
3212
  private addChart;
3212
3213
  private checkChartDuplicate;
3214
+ private checkChartExists;
3213
3215
  }
3214
3216
 
3215
3217
  interface ConditionalFormatState {
@@ -3260,12 +3262,14 @@ declare class ConditionalFormatPlugin extends CorePlugin<ConditionalFormatState>
3260
3262
 
3261
3263
  interface FigureState {
3262
3264
  readonly figures: {
3263
- [sheet: UID]: Record<UID, Figure | undefined> | undefined;
3265
+ [sheet: string]: Record<UID, Figure | undefined> | undefined;
3264
3266
  };
3265
3267
  }
3266
3268
  declare class FigurePlugin extends CorePlugin<FigureState> implements FigureState {
3267
- static getters: readonly ["getFigures", "getFigure"];
3268
- readonly figures: FigureState["figures"];
3269
+ static getters: readonly ["getFigures", "getFigure", "getFigureSheetId"];
3270
+ readonly figures: {
3271
+ [sheet: string]: Record<UID, Figure | undefined> | undefined;
3272
+ };
3269
3273
  allowDispatch(cmd: CoreCommand): CommandResult;
3270
3274
  handle(cmd: CoreCommand): void;
3271
3275
  private updateFigure;
@@ -3276,6 +3280,7 @@ declare class FigurePlugin extends CorePlugin<FigureState> implements FigureStat
3276
3280
  private checkFigureDuplicate;
3277
3281
  getFigures(sheetId: UID): Figure[];
3278
3282
  getFigure(sheetId: string, figureId: string): Figure | undefined;
3283
+ getFigureSheetId(figureId: string): UID | undefined;
3279
3284
  import(data: WorkbookData): void;
3280
3285
  export(data: WorkbookData): void;
3281
3286
  exportForExcel(data: ExcelWorkbookData): void;
@@ -3396,7 +3401,7 @@ interface ImageState {
3396
3401
  readonly images: Record<UID, Record<UID, Image | undefined> | undefined>;
3397
3402
  }
3398
3403
  declare class ImagePlugin extends CorePlugin<ImageState> implements ImageState {
3399
- static getters: readonly ["getImage"];
3404
+ static getters: readonly ["getImage", "getImagePath", "getImageSize"];
3400
3405
  readonly fileStore?: FileStore;
3401
3406
  readonly images: Record<UID, Record<UID, Image | undefined> | undefined>;
3402
3407
  /**
@@ -3404,16 +3409,19 @@ declare class ImagePlugin extends CorePlugin<ImageState> implements ImageState {
3404
3409
  */
3405
3410
  readonly syncedImages: Set<Image["path"]>;
3406
3411
  constructor(config: CorePluginConfig);
3407
- allowDispatch(cmd: CoreCommand): CommandResult.Success | CommandResult.DuplicatedImageId;
3412
+ allowDispatch(cmd: CoreCommand): CommandResult.Success | CommandResult.InvalidFigureId;
3408
3413
  handle(cmd: CoreCommand): void;
3409
3414
  /**
3410
3415
  * Delete unused images from the file store
3411
3416
  */
3412
3417
  garbageCollectExternalResources(): void;
3413
- getImage(sheetId: UID, figureId: UID): Image;
3418
+ getImage(figureId: UID): Image;
3419
+ getImagePath(figureId: UID): string;
3420
+ getImageSize(figureId: UID): FigureSize;
3414
3421
  private addFigure;
3415
3422
  import(data: WorkbookData): void;
3416
3423
  export(data: WorkbookData): void;
3424
+ exportForExcel(data: ExcelWorkbookData): void;
3417
3425
  private getAllImages;
3418
3426
  }
3419
3427
 
@@ -3705,12 +3713,10 @@ declare class EvaluationPlugin extends UIPlugin {
3705
3713
 
3706
3714
  declare class EvaluationChartPlugin extends UIPlugin {
3707
3715
  static getters: readonly ["getChartRuntime", "getBackgroundOfSingleCellChart"];
3708
- readonly charts: {
3709
- [sheetId: UID]: Record<UID, ChartRuntime | undefined> | undefined;
3710
- };
3716
+ readonly charts: Record<UID, ChartRuntime | undefined>;
3711
3717
  private createRuntimeChart;
3712
3718
  handle(cmd: Command): void;
3713
- getChartRuntime(sheetId: UID, figureId: UID): ChartRuntime;
3719
+ getChartRuntime(figureId: UID): ChartRuntime;
3714
3720
  /**
3715
3721
  * Get the background color of a chart based on the color of the first cell of the main range
3716
3722
  * of the chart. In order of priority, it will return :
@@ -3814,7 +3820,7 @@ declare class InternalViewport {
3814
3820
  x: Pixel;
3815
3821
  y: Pixel;
3816
3822
  });
3817
- getMaxSize(): ZoneDimension;
3823
+ getMaxSize(): DOMDimension;
3818
3824
  /**
3819
3825
  * Return the index of a column given an offset x, based on the pane left
3820
3826
  * visible cell.
@@ -3942,8 +3948,8 @@ declare class SheetViewPlugin extends UIPlugin {
3942
3948
  * It returns -1 if no row is found.
3943
3949
  */
3944
3950
  getRowIndex(y: Pixel): HeaderIndex;
3945
- getSheetViewDimensionWithHeaders(): ZoneDimension;
3946
- getSheetViewDimension(): ZoneDimension;
3951
+ getSheetViewDimensionWithHeaders(): DOMDimension;
3952
+ getSheetViewDimension(): DOMDimension;
3947
3953
  /** type as pane, not viewport but basically pane extends viewport */
3948
3954
  getActiveMainViewport(): Viewport;
3949
3955
  /**
@@ -4252,7 +4258,7 @@ declare class RendererPlugin extends UIPlugin {
4252
4258
  }
4253
4259
 
4254
4260
  interface RangeInputValue {
4255
- id: UID;
4261
+ id: number;
4256
4262
  xc: string;
4257
4263
  color: string;
4258
4264
  }
@@ -4315,7 +4321,7 @@ declare class SelectionInputPlugin extends UIPlugin implements StreamCallbacks<S
4315
4321
  * Return the index of a range given its id
4316
4322
  * or `null` if the range is not found.
4317
4323
  */
4318
- getIndex(rangeId: string | null): number | null;
4324
+ getIndex(rangeId: number | null): number | null;
4319
4325
  }
4320
4326
 
4321
4327
  /**
@@ -4889,15 +4895,14 @@ declare class SelectionInput extends Component<Props$B, SpreadsheetChildEnv> {
4889
4895
  getColor(range: SelectionRange): string;
4890
4896
  private triggerChange;
4891
4897
  onKeydown(ev: KeyboardEvent): void;
4892
- focus(rangeId: string): void;
4898
+ focus(rangeId: number): void;
4893
4899
  addEmptyInput(): void;
4894
- removeInput(rangeId: string): void;
4895
- onInputChanged(rangeId: string, ev: InputEvent): void;
4896
- disable(): void;
4900
+ removeInput(rangeId: number): void;
4901
+ onInputChanged(rangeId: number, ev: InputEvent): void;
4902
+ confirm(): void;
4897
4903
  }
4898
4904
 
4899
4905
  interface Props$A {
4900
- sheetId: UID;
4901
4906
  figureId: UID;
4902
4907
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
4903
4908
  updateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
@@ -4936,9 +4941,42 @@ declare class BarConfigPanel extends LineBarPieConfigPanel {
4936
4941
  onUpdateAggregated(ev: any): void;
4937
4942
  }
4938
4943
 
4944
+ interface PopoverProps {
4945
+ /**
4946
+ * Rectangle around which the popover is displayed.
4947
+ * Coordinates are expressed as absolute DOM position.
4948
+ */
4949
+ anchorRect: Rect;
4950
+ /** The popover can be positioned below the anchor Rectangle, or to the right of the rectangle */
4951
+ positioning: PopoverPropsPosition;
4952
+ maxWidth?: Pixel;
4953
+ maxHeight?: Pixel;
4954
+ /** Offset to apply to the vertical position of the popover.*/
4955
+ verticalOffset: number;
4956
+ onMouseWheel?: () => void;
4957
+ onPopoverMoved?: () => void;
4958
+ onPopoverHidden?: () => void;
4959
+ }
4960
+ declare class Popover extends Component<PopoverProps, SpreadsheetChildEnv> {
4961
+ static template: string;
4962
+ static defaultProps: {
4963
+ positioning: string;
4964
+ verticalOffset: number;
4965
+ onMouseWheel: () => void;
4966
+ onPopoverMoved: () => void;
4967
+ onPopoverHidden: () => void;
4968
+ };
4969
+ private popoverRef;
4970
+ private currentPosition;
4971
+ private currentDisplayValue;
4972
+ private spreadsheetRect;
4973
+ private containerRect;
4974
+ setup(): void;
4975
+ }
4976
+
4939
4977
  interface ColorPickerProps {
4978
+ anchorRect: Rect;
4940
4979
  maxHeight?: Pixel;
4941
- dropdownDirection?: "left" | "right" | "center";
4942
4980
  onColorPicked: (color: Color) => void;
4943
4981
  currentColor: Color;
4944
4982
  }
@@ -4947,9 +4985,13 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
4947
4985
  static defaultProps: {
4948
4986
  currentColor: string;
4949
4987
  };
4988
+ static components: {
4989
+ Popover: typeof Popover;
4990
+ };
4950
4991
  COLORS: string[];
4951
4992
  private state;
4952
4993
  get colorPickerStyle(): string;
4994
+ get popoverProps(): PopoverProps;
4953
4995
  onColorClick(color: Color): void;
4954
4996
  getCheckMarkColor(): Color;
4955
4997
  resetColor(): void;
@@ -4968,7 +5010,6 @@ interface Props$z {
4968
5010
  showColorPicker: boolean;
4969
5011
  onColorPicked: (color: string) => void;
4970
5012
  icon: string;
4971
- dropdownDirection?: "left" | "right" | "center";
4972
5013
  title?: string;
4973
5014
  disabled?: boolean;
4974
5015
  dropdownMaxHeight?: Pixel;
@@ -4979,7 +5020,11 @@ declare class ColorPickerWidget extends Component<Props$z, SpreadsheetChildEnv>
4979
5020
  static components: {
4980
5021
  ColorPicker: typeof ColorPicker;
4981
5022
  };
5023
+ colorPickerButtonRef: {
5024
+ el: HTMLElement | null;
5025
+ };
4982
5026
  get iconStyle(): string;
5027
+ get colorPickerAnchorRect(): Rect;
4983
5028
  }
4984
5029
 
4985
5030
  interface Props$y {
@@ -5002,7 +5047,6 @@ declare class LineBarPieDesignPanel extends Component<Props$y, SpreadsheetChildE
5002
5047
  }
5003
5048
 
5004
5049
  interface Props$x {
5005
- sheetId: UID;
5006
5050
  figureId: UID;
5007
5051
  definition: GaugeChartDefinition;
5008
5052
  updateChart: (definition: Partial<GaugeChartDefinition>) => DispatchResult;
@@ -5059,7 +5103,6 @@ declare class LineConfigPanel extends LineBarPieConfigPanel {
5059
5103
  }
5060
5104
 
5061
5105
  interface Props$v {
5062
- sheetId: UID;
5063
5106
  figureId: UID;
5064
5107
  definition: ScorecardChartDefinition;
5065
5108
  updateChart: (definition: Partial<ScorecardChartDefinition>) => DispatchResult;
@@ -5107,26 +5150,6 @@ interface ChartSidePanel {
5107
5150
  design: new (...args: any) => Component;
5108
5151
  }
5109
5152
 
5110
- /**
5111
- * This registry is intended to map a type of figure (tag) to a class of
5112
- * component, that will be used in the UI to represent the figure.
5113
- *
5114
- * The most important type of figure will be the Chart
5115
- */
5116
- interface FigureContent {
5117
- Component: any;
5118
- SidePanelComponent?: string;
5119
- keepRatio?: boolean;
5120
- minFigSize?: number;
5121
- borderWidth?: number;
5122
- }
5123
-
5124
- interface SidePanelContent {
5125
- title: string | ((env: SpreadsheetChildEnv) => string);
5126
- Body: any;
5127
- Footer?: any;
5128
- }
5129
-
5130
5153
  /**
5131
5154
  * An ActionMenuItem represent a menu item for the menus of the topbar.
5132
5155
  * and the context menu in the grid.
@@ -5194,6 +5217,27 @@ declare class MenuItemRegistry extends Registry<MenuItemSpec> {
5194
5217
  getMenuItems(): MenuItem[];
5195
5218
  }
5196
5219
 
5220
+ /**
5221
+ * This registry is intended to map a type of figure (tag) to a class of
5222
+ * component, that will be used in the UI to represent the figure.
5223
+ *
5224
+ * The most important type of figure will be the Chart
5225
+ */
5226
+ interface FigureContent {
5227
+ Component: any;
5228
+ menuBuilder: (figureId: UID, onFigureDeleted: () => void, env: SpreadsheetChildEnv) => MenuItem[];
5229
+ SidePanelComponent?: string;
5230
+ keepRatio?: boolean;
5231
+ minFigSize?: number;
5232
+ borderWidth?: number;
5233
+ }
5234
+
5235
+ interface SidePanelContent {
5236
+ title: string | ((env: SpreadsheetChildEnv) => string);
5237
+ Body: any;
5238
+ Footer?: any;
5239
+ }
5240
+
5197
5241
  /**
5198
5242
  * An AutofillRule is used to generate what to do when we need to autofill
5199
5243
  * a cell. (In a AutofillGenerator, see plugins/autofill.ts)
@@ -5214,7 +5258,7 @@ declare class ChartJsComponent extends Component<Props$t, SpreadsheetChildEnv> {
5214
5258
  static template: string;
5215
5259
  private canvas;
5216
5260
  private chart?;
5217
- get background(): Color;
5261
+ get background(): string;
5218
5262
  get canvasStyle(): string;
5219
5263
  get chartRuntime(): ChartJSRuntime;
5220
5264
  setup(): void;
@@ -5236,7 +5280,7 @@ declare class ScorecardChart extends Component<Props$s, SpreadsheetChildEnv> {
5236
5280
  get baselineArrowDirection(): BaselineArrowDirection;
5237
5281
  get backgroundColor(): string;
5238
5282
  get primaryFontColor(): string;
5239
- get secondaryFontColor(): "#757575" | "#bbbbbb";
5283
+ get secondaryFontColor(): "#525252" | "#C8C8C8";
5240
5284
  get figure(): Figure;
5241
5285
  get chartStyle(): string;
5242
5286
  get chartContentStyle(): string;
@@ -5256,120 +5300,18 @@ declare class ScorecardChart extends Component<Props$s, SpreadsheetChildEnv> {
5256
5300
  private getWidestElement;
5257
5301
  }
5258
5302
 
5259
- interface PopoverProps {
5260
- /**
5261
- * Rectangle around which the popover is displayed.
5262
- * Coordinates are expressed as absolute DOM position.
5263
- */
5264
- anchorRect: Rect;
5265
- /** The popover can be positioned below the anchor Rectangle, or to the right of the rectangle */
5266
- positioning: PopoverPropsPosition;
5267
- maxWidth?: Pixel;
5268
- maxHeight?: Pixel;
5269
- /** Offset to apply to the vertical position of the popover.*/
5270
- verticalOffset: number;
5271
- onMouseWheel?: () => void;
5272
- onPopoverMoved?: () => void;
5273
- onPopoverHidden?: () => void;
5274
- }
5275
- declare class Popover extends Component<PopoverProps, SpreadsheetChildEnv> {
5276
- static template: string;
5277
- static defaultProps: {
5278
- positioning: string;
5279
- verticalOffset: number;
5280
- onMouseWheel: () => void;
5281
- onPopoverMoved: () => void;
5282
- onPopoverHidden: () => void;
5283
- };
5284
- private popoverRef;
5285
- private currentPosition;
5286
- private currentDisplayValue;
5287
- private spreadsheetRect;
5288
- private containerRect;
5289
- setup(): void;
5290
- }
5291
-
5292
5303
  interface Props$r {
5293
- position: DOMCoordinates;
5294
- menuItems: MenuItem[];
5295
- depth: number;
5296
- maxHeight?: Pixel;
5297
- onClose: () => void;
5298
- onMenuClicked?: (ev: CustomEvent) => void;
5299
- menuId?: UID;
5300
- }
5301
- interface MenuState {
5302
- isOpen: boolean;
5303
- parentMenu?: MenuItem;
5304
- position: null | DOMCoordinates;
5305
- scrollOffset?: Pixel;
5306
- menuItems: MenuItem[];
5307
- }
5308
- declare class Menu extends Component<Props$r, SpreadsheetChildEnv> {
5309
- static template: string;
5310
- static components: {
5311
- Menu: typeof Menu;
5312
- Popover: typeof Popover;
5313
- };
5314
- static defaultProps: {
5315
- depth: number;
5316
- };
5317
- private subMenu;
5318
- private menuRef;
5319
- private position;
5320
- setup(): void;
5321
- get visibleMenuItems(): MenuItem[];
5322
- get subMenuPosition(): DOMCoordinates;
5323
- get menuHeight(): Pixel;
5324
- get popoverProps(): PopoverProps;
5325
- getColor(menu: MenuItem): string | undefined;
5326
- activateMenu(menu: MenuItem): Promise<void>;
5327
- private close;
5328
- /**
5329
- * Return the number of pixels between the top of the menu
5330
- * and the menu item at a given index.
5331
- */
5332
- private subMenuVerticalPosition;
5333
- private onExternalClick;
5334
- private getMenuItemsHeight;
5335
- getName(menu: MenuItem): string;
5336
- isRoot(menu: MenuItem): boolean;
5337
- isEnabled(menu: MenuItem): boolean;
5338
- onScroll(ev: any): void;
5339
- /**
5340
- * If the given menu is not disabled, open it's submenu at the
5341
- * correct position according to available surrounding space.
5342
- */
5343
- openSubMenu(menu: MenuItem, menuIndex: number): void;
5344
- isParentMenu(subMenu: MenuState, menuItem: MenuItem): boolean;
5345
- closeSubMenu(): void;
5346
- onClickMenu(menu: MenuItem, menuIndex: number): void;
5347
- onMouseOver(menu: MenuItem, position: Pixel): void;
5348
- }
5349
-
5350
- interface Props$q {
5351
5304
  figure: Figure;
5352
5305
  onFigureDeleted: () => void;
5353
5306
  }
5354
- declare class ChartFigure extends Component<Props$q, SpreadsheetChildEnv> {
5307
+ declare class ChartFigure extends Component<Props$r, SpreadsheetChildEnv> {
5355
5308
  static template: string;
5356
- static components: {
5357
- Menu: typeof Menu;
5358
- };
5359
- private menuState;
5360
- private chartContainerRef;
5361
- private menuButtonRef;
5362
- private menuButtonRect;
5363
- private position;
5364
- private getMenuItemRegistry;
5309
+ static components: {};
5365
5310
  get chartType(): ChartType;
5366
- onContextMenu(ev: MouseEvent): void;
5367
- showMenu(): void;
5368
- private openContextMenu;
5369
5311
  get chartComponent(): new (...args: any) => Component;
5370
5312
  }
5371
5313
 
5372
- interface Props$p {
5314
+ interface Props$q {
5373
5315
  isVisible: boolean;
5374
5316
  position: Position;
5375
5317
  }
@@ -5381,7 +5323,7 @@ interface State$3 {
5381
5323
  position: Position;
5382
5324
  handler: boolean;
5383
5325
  }
5384
- declare class Autofill extends Component<Props$p, SpreadsheetChildEnv> {
5326
+ declare class Autofill extends Component<Props$q, SpreadsheetChildEnv> {
5385
5327
  static template: string;
5386
5328
  state: State$3;
5387
5329
  get style(): string;
@@ -5455,13 +5397,13 @@ declare class Ripple extends Component<RippleProps, SpreadsheetChildEnv> {
5455
5397
  getRippleEffectProps(id: number): RippleEffectProps;
5456
5398
  }
5457
5399
 
5458
- interface Props$o {
5400
+ interface Props$p {
5459
5401
  sheetId: string;
5460
5402
  openContextMenu: (registry: MenuItemRegistry, ev: MouseEvent) => void;
5461
5403
  style?: string;
5462
5404
  onMouseDown: (ev: MouseEvent) => void;
5463
5405
  }
5464
- declare class BottomBarSheet extends Component<Props$o, SpreadsheetChildEnv> {
5406
+ declare class BottomBarSheet extends Component<Props$p, SpreadsheetChildEnv> {
5465
5407
  static template: string;
5466
5408
  static components: {
5467
5409
  Ripple: typeof Ripple;
@@ -5495,11 +5437,11 @@ declare class BottomBarSheet extends Component<Props$o, SpreadsheetChildEnv> {
5495
5437
  get sheetName(): string;
5496
5438
  }
5497
5439
 
5498
- interface Props$n {
5440
+ interface Props$o {
5499
5441
  openContextMenu: (x: number, y: number, registry: MenuItemRegistry) => void;
5500
5442
  closeContextMenu: () => void;
5501
5443
  }
5502
- declare class BottomBarStatistic extends Component<Props$n, SpreadsheetChildEnv> {
5444
+ declare class BottomBarStatistic extends Component<Props$o, SpreadsheetChildEnv> {
5503
5445
  static template: string;
5504
5446
  static components: {
5505
5447
  Ripple: typeof Ripple;
@@ -5512,6 +5454,64 @@ declare class BottomBarStatistic extends Component<Props$n, SpreadsheetChildEnv>
5512
5454
  private getComposedFnName;
5513
5455
  }
5514
5456
 
5457
+ interface Props$n {
5458
+ position: DOMCoordinates;
5459
+ menuItems: MenuItem[];
5460
+ depth: number;
5461
+ maxHeight?: Pixel;
5462
+ onClose: () => void;
5463
+ onMenuClicked?: (ev: CustomEvent) => void;
5464
+ menuId?: UID;
5465
+ }
5466
+ interface MenuState {
5467
+ isOpen: boolean;
5468
+ parentMenu?: MenuItem;
5469
+ position: null | DOMCoordinates;
5470
+ scrollOffset?: Pixel;
5471
+ menuItems: MenuItem[];
5472
+ }
5473
+ declare class Menu extends Component<Props$n, SpreadsheetChildEnv> {
5474
+ static template: string;
5475
+ static components: {
5476
+ Menu: typeof Menu;
5477
+ Popover: typeof Popover;
5478
+ };
5479
+ static defaultProps: {
5480
+ depth: number;
5481
+ };
5482
+ private subMenu;
5483
+ private menuRef;
5484
+ private position;
5485
+ setup(): void;
5486
+ get visibleMenuItems(): MenuItem[];
5487
+ get subMenuPosition(): DOMCoordinates;
5488
+ get menuHeight(): Pixel;
5489
+ get popoverProps(): PopoverProps;
5490
+ getColor(menu: MenuItem): string | undefined;
5491
+ activateMenu(menu: MenuItem): Promise<void>;
5492
+ private close;
5493
+ /**
5494
+ * Return the number of pixels between the top of the menu
5495
+ * and the menu item at a given index.
5496
+ */
5497
+ private subMenuVerticalPosition;
5498
+ private onExternalClick;
5499
+ private getMenuItemsHeight;
5500
+ getName(menu: MenuItem): string;
5501
+ isRoot(menu: MenuItem): boolean;
5502
+ isEnabled(menu: MenuItem): boolean;
5503
+ onScroll(ev: any): void;
5504
+ /**
5505
+ * If the given menu is not disabled, open it's submenu at the
5506
+ * correct position according to available surrounding space.
5507
+ */
5508
+ openSubMenu(menu: MenuItem, menuIndex: number): void;
5509
+ isParentMenu(subMenu: MenuState, menuItem: MenuItem): boolean;
5510
+ closeSubMenu(): void;
5511
+ onClickMenu(menu: MenuItem, menuIndex: number): void;
5512
+ onMouseOver(menu: MenuItem, position: Pixel): void;
5513
+ }
5514
+
5515
5515
  interface BottomBarSheetItem {
5516
5516
  id: UID;
5517
5517
  name: string;
@@ -5580,14 +5580,19 @@ interface Props$l {
5580
5580
  }
5581
5581
  declare class FigureComponent extends Component<Props$l, SpreadsheetChildEnv> {
5582
5582
  static template: string;
5583
- static components: {};
5583
+ static components: {
5584
+ Menu: typeof Menu;
5585
+ };
5584
5586
  static defaultProps: {
5585
5587
  onFigureDeleted: () => void;
5586
5588
  onMouseDown: () => void;
5587
5589
  onClickAnchor: () => void;
5588
5590
  };
5589
- private borderWidth;
5591
+ private menuState;
5590
5592
  private figureRef;
5593
+ private menuButtonRef;
5594
+ private menuButtonRect;
5595
+ private borderWidth;
5591
5596
  get isSelected(): boolean;
5592
5597
  get figureRegistry(): Registry<FigureContent>;
5593
5598
  private getBorderWidth;
@@ -5598,6 +5603,9 @@ declare class FigureComponent extends Component<Props$l, SpreadsheetChildEnv> {
5598
5603
  clickAnchor(dirX: ResizeDirection, dirY: ResizeDirection, ev: MouseEvent): void;
5599
5604
  onMouseDown(ev: MouseEvent): void;
5600
5605
  onKeyDown(ev: KeyboardEvent): void;
5606
+ onContextMenu(ev: MouseEvent): void;
5607
+ showMenu(): void;
5608
+ private openContextMenu;
5601
5609
  }
5602
5610
 
5603
5611
  declare type ContainerType = "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "dnd";
@@ -6242,7 +6250,7 @@ interface Props$5 {
6242
6250
  focus: ComposerFocusType;
6243
6251
  onComposerUnmounted: () => void;
6244
6252
  onComposerContentFocused: (selection: ComposerSelection) => void;
6245
- gridDims: ZoneDimension;
6253
+ gridDims: DOMDimension;
6246
6254
  }
6247
6255
  /**
6248
6256
  * This component is a composer which positions itself on the grid at the anchor cell.