@odoo/o-spreadsheet 16.3.0-alpha.1 → 16.3.0-alpha.2

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.
@@ -2304,6 +2304,10 @@ interface Position$1 {
2304
2304
  col: HeaderIndex;
2305
2305
  row: HeaderIndex;
2306
2306
  }
2307
+ interface PixelPosition {
2308
+ x: Pixel;
2309
+ y: Pixel;
2310
+ }
2307
2311
  interface Merge extends Zone {
2308
2312
  id: number;
2309
2313
  topLeft: Position$1;
@@ -2868,6 +2872,7 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
2868
2872
  * Get a Xc string that represent a part of a range
2869
2873
  */
2870
2874
  private getRangePartString;
2875
+ private getInvalidRange;
2871
2876
  }
2872
2877
 
2873
2878
  interface CorePluginConfig {
@@ -3918,7 +3923,7 @@ declare type SheetViewports = {
3918
3923
  *
3919
3924
  */
3920
3925
  declare class SheetViewPlugin extends UIPlugin {
3921
- static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio"];
3926
+ static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
3922
3927
  readonly viewports: Record<UID, SheetViewports | undefined>;
3923
3928
  /**
3924
3929
  * The viewport dimensions are usually set by one of the components
@@ -4018,6 +4023,7 @@ declare class SheetViewPlugin extends UIPlugin {
4018
4023
  */
4019
4024
  private shiftVertically;
4020
4025
  getVisibleFigures(): Figure[];
4026
+ isPositionVisible(position: PixelPosition): boolean;
4021
4027
  getFrozenSheetViewRatio(sheetId: UID): {
4022
4028
  xRatio: number;
4023
4029
  yRatio: number;
@@ -5403,6 +5409,7 @@ interface Props$p {
5403
5409
  declare class ChartFigure extends Component<Props$p, SpreadsheetChildEnv> {
5404
5410
  static template: string;
5405
5411
  static components: {};
5412
+ onDoubleClick(): void;
5406
5413
  get chartType(): ChartType;
5407
5414
  get chartComponent(): new (...args: any) => Component;
5408
5415
  }
@@ -5608,14 +5615,16 @@ declare class BottomBar extends Component<Props$l, SpreadsheetChildEnv> {
5608
5615
  get sheetListMaxScroll(): number;
5609
5616
  }
5610
5617
 
5611
- declare type ContainerType = "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "dnd";
5612
- interface DndState {
5613
- figId: string | undefined;
5614
- x: Pixel;
5615
- y: Pixel;
5616
- width: Pixel;
5617
- height: Pixel;
5618
+ declare type HFigureAxisType = "top" | "bottom" | "vCenter";
5619
+ declare type VFigureAxisType = "right" | "left" | "hCenter";
5620
+ interface SnapLine<T extends HFigureAxisType | VFigureAxisType> {
5621
+ matchedFigIds: UID[];
5622
+ snapOffset: number;
5623
+ snappedAxisType: T;
5624
+ position: Pixel;
5618
5625
  }
5626
+
5627
+ declare type ContainerType = "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "dnd";
5619
5628
  interface Props$k {
5620
5629
  onFigureDeleted: () => void;
5621
5630
  }
@@ -5625,6 +5634,16 @@ interface Container {
5625
5634
  style: string;
5626
5635
  inverseViewportStyle: string;
5627
5636
  }
5637
+ interface Snap<T extends HFigureAxisType | VFigureAxisType> {
5638
+ line: SnapLine<T>;
5639
+ lineStyle: string;
5640
+ containerStyle: string;
5641
+ }
5642
+ interface DndState {
5643
+ draggedFigure?: Figure;
5644
+ horizontalSnap?: Snap<HFigureAxisType>;
5645
+ verticalSnap?: Snap<VFigureAxisType>;
5646
+ }
5628
5647
  /**
5629
5648
  * Each figure ⭐ is positioned inside a container `div` placed and sized
5630
5649
  * according to the split pane the figure is part of, or a separate container for the figure
@@ -5695,14 +5714,26 @@ declare class FiguresContainer extends Component<Props$k, SpreadsheetChildEnv> {
5695
5714
  private getVisibleFigures;
5696
5715
  get containers(): Container[];
5697
5716
  private getContainerStyle;
5717
+ private rectToCss;
5718
+ private getContainerRect;
5698
5719
  private getInverseViewportPositionStyle;
5699
5720
  private getFigureContainer;
5700
5721
  startDraggingFigure(figure: Figure, ev: MouseEvent): void;
5722
+ /**
5723
+ * Initialize the resize of a figure with mouse movements
5724
+ *
5725
+ * @param dirX X direction of the resize. -1 : resize from the left border of the figure, 0 : no resize in X, 1 :
5726
+ * resize from the right border of the figure
5727
+ * @param dirY Y direction of the resize. -1 : resize from the top border of the figure, 0 : no resize in Y, 1 :
5728
+ * resize from the bottom border of the figure
5729
+ * @param ev Mouse Event
5730
+ */
5701
5731
  startResize(figure: Figure, dirX: ResizeDirection, dirY: ResizeDirection, ev: MouseEvent): void;
5732
+ private getOtherFigures;
5702
5733
  private getDndFigure;
5703
5734
  getFigureStyle(figure: Figure): string;
5704
- private internalToScreenCoordinates;
5705
- private screenCoordinatesToInternal;
5735
+ private getSnap;
5736
+ private getSnapLineStyle;
5706
5737
  }
5707
5738
 
5708
5739
  interface Props$j {