popupService.d.ts 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import { GridCore } from "../gridCore";
  2. import { RowNode } from "../entities/rowNode";
  3. import { Column } from "../entities/column";
  4. import { BeanStub } from "../context/beanStub";
  5. export interface PopupEventParams {
  6. originalMouseEvent?: MouseEvent | Touch;
  7. mouseEvent?: MouseEvent;
  8. touchEvent?: TouchEvent;
  9. keyboardEvent?: KeyboardEvent;
  10. }
  11. export declare class PopupService extends BeanStub {
  12. private gridOptionsWrapper;
  13. private environment;
  14. private gridCore;
  15. private popupList;
  16. private init;
  17. registerGridCore(gridCore: GridCore): void;
  18. getPopupParent(): HTMLElement;
  19. positionPopupForMenu(params: {
  20. eventSource: HTMLElement;
  21. ePopup: HTMLElement;
  22. }): void;
  23. positionPopupUnderMouseEvent(params: {
  24. rowNode?: RowNode;
  25. column?: Column;
  26. type: string;
  27. mouseEvent: MouseEvent | Touch;
  28. nudgeX?: number;
  29. nudgeY?: number;
  30. ePopup: HTMLElement;
  31. }): void;
  32. private calculatePointerAlign;
  33. positionPopupUnderComponent(params: {
  34. type: string;
  35. eventSource: HTMLElement;
  36. ePopup: HTMLElement;
  37. column?: Column;
  38. rowNode?: RowNode;
  39. minWidth?: number;
  40. minHeight?: number;
  41. nudgeX?: number;
  42. nudgeY?: number;
  43. alignSide?: 'left' | 'right';
  44. keepWithinBounds?: boolean;
  45. }): void;
  46. positionPopupOverComponent(params: {
  47. type: string;
  48. eventSource: HTMLElement;
  49. ePopup: HTMLElement | null;
  50. column: Column;
  51. rowNode: RowNode;
  52. minWidth?: number;
  53. nudgeX?: number;
  54. nudgeY?: number;
  55. keepWithinBounds?: boolean;
  56. }): void;
  57. private callPostProcessPopup;
  58. positionPopup(params: {
  59. ePopup: HTMLElement | null;
  60. minWidth?: number;
  61. minHeight?: number;
  62. nudgeX?: number;
  63. nudgeY?: number;
  64. x: number;
  65. y: number;
  66. keepWithinBounds?: boolean;
  67. }): void;
  68. getActivePopups(): HTMLElement[];
  69. private getParentRect;
  70. private keepYWithinBounds;
  71. private keepXWithinBounds;
  72. addAsModalPopup(eChild: any, closeOnEsc: boolean, closedCallback?: (e?: MouseEvent | TouchEvent | KeyboardEvent) => void, click?: MouseEvent | Touch | null): (event?: any) => void;
  73. addPopup(modal: boolean, eChild: any, closeOnEsc: boolean, closedCallback?: (e?: MouseEvent | TouchEvent | KeyboardEvent) => void, click?: MouseEvent | Touch | null, alwaysOnTop?: boolean): (params?: PopupEventParams) => void;
  74. private isEventFromCurrentPopup;
  75. isElementWithinCustomPopup(el: HTMLElement): boolean;
  76. private isEventSameChainAsOriginalEvent;
  77. private getWrapper;
  78. setAlwaysOnTop(ePopup: HTMLElement, alwaysOnTop?: boolean): void;
  79. bringPopupToFront(ePopup: HTMLElement): void;
  80. }