modal.directive.d.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { ComponentRef, ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2, ViewContainerRef } from '@angular/core';
  2. import { ModalBackdropComponent } from './modal-backdrop.component';
  3. import { ModalOptions } from './modal-options.class';
  4. import { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';
  5. /** Mark any code with directive to show it's content in modal */
  6. export declare class ModalDirective implements OnDestroy, OnInit {
  7. private _element;
  8. private _renderer;
  9. /** allows to set modal configuration via element property */
  10. config: ModalOptions;
  11. /** This event fires immediately when the `show` instance method is called. */
  12. onShow: EventEmitter<ModalDirective>;
  13. /** This event is fired when the modal has been made visible to the user
  14. * (will wait for CSS transitions to complete)
  15. */
  16. onShown: EventEmitter<ModalDirective>;
  17. /** This event is fired immediately when
  18. * the hide instance method has been called.
  19. */
  20. onHide: EventEmitter<ModalDirective>;
  21. /** This event is fired when the modal has finished being
  22. * hidden from the user (will wait for CSS transitions to complete).
  23. */
  24. onHidden: EventEmitter<ModalDirective>;
  25. /** This field contains last dismiss reason.
  26. * Possible values: `backdrop-click`, `esc` and `null`
  27. * (if modal was closed by direct call of `.hide()`).
  28. */
  29. dismissReason: string;
  30. readonly isShown: boolean;
  31. protected _config: ModalOptions;
  32. protected _isShown: boolean;
  33. protected isBodyOverflowing: boolean;
  34. protected originalBodyPadding: number;
  35. protected scrollbarWidth: number;
  36. protected timerHideModal: number;
  37. protected timerRmBackDrop: number;
  38. protected backdrop: ComponentRef<ModalBackdropComponent>;
  39. private _backdrop;
  40. private isNested;
  41. constructor(_element: ElementRef, _viewContainerRef: ViewContainerRef, _renderer: Renderer2, clf: ComponentLoaderFactory);
  42. onClick(event: MouseEvent): void;
  43. onEsc(event: KeyboardEvent): void;
  44. ngOnDestroy(): void;
  45. ngOnInit(): void;
  46. /** Allows to manually toggle modal visibility */
  47. toggle(): void;
  48. /** Allows to manually open modal */
  49. show(): void;
  50. /** Allows to manually close modal */
  51. hide(event?: Event): void;
  52. /** Private methods @internal */
  53. protected getConfig(config?: ModalOptions): ModalOptions;
  54. /**
  55. * Show dialog
  56. * @internal
  57. */
  58. protected showElement(): void;
  59. /** @internal */
  60. protected hideModal(): void;
  61. /** @internal */
  62. protected showBackdrop(callback?: Function): void;
  63. /** @internal */
  64. protected removeBackdrop(): void;
  65. /** Events tricks */
  66. protected focusOtherModal(): void;
  67. /** @internal */
  68. protected resetAdjustments(): void;
  69. /** Scroll bar tricks */
  70. /** @internal */
  71. protected checkScrollbar(): void;
  72. protected setScrollbar(): void;
  73. protected resetScrollbar(): void;
  74. protected getScrollbarWidth(): number;
  75. }