component-loader.class.d.ts 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import { ApplicationRef, ComponentFactoryResolver, ComponentRef, ElementRef, EmbeddedViewRef, EventEmitter, Injector, NgZone, Renderer2, StaticProvider, TemplateRef, Type, ViewContainerRef } from '@angular/core';
  2. import { PositioningOptions, PositioningService } from 'ngx-bootstrap/positioning';
  3. import { ListenOptions } from './listen-options.model';
  4. export declare class ComponentLoader<T> {
  5. private _viewContainerRef;
  6. private _renderer;
  7. private _elementRef;
  8. private _injector;
  9. private _componentFactoryResolver;
  10. private _ngZone;
  11. private _applicationRef;
  12. private _posService;
  13. onBeforeShow: EventEmitter<void>;
  14. onShown: EventEmitter<any>;
  15. onBeforeHide: EventEmitter<any>;
  16. onHidden: EventEmitter<boolean>;
  17. instance: T;
  18. _componentRef: ComponentRef<T>;
  19. _inlineViewRef: EmbeddedViewRef<T>;
  20. private _providers;
  21. private _componentFactory;
  22. private _zoneSubscription;
  23. private _contentRef;
  24. private _innerComponent;
  25. private _unregisterListenersFn;
  26. readonly isShown: boolean;
  27. private _isHiding;
  28. /**
  29. * Placement of a component. Accepts: "top", "bottom", "left", "right"
  30. */
  31. private attachment;
  32. /**
  33. * A selector specifying the element the popover should be appended to.
  34. */
  35. private container;
  36. /**
  37. * A selector used if container element was not found
  38. */
  39. private containerDefaultSelector;
  40. /**
  41. * Specifies events that should trigger. Supports a space separated list of
  42. * event names.
  43. */
  44. private triggers;
  45. private _listenOpts;
  46. private _globalListener;
  47. /**
  48. * Do not use this directly, it should be instanced via
  49. * `ComponentLoadFactory.attach`
  50. * @internal
  51. */
  52. constructor(_viewContainerRef: ViewContainerRef, _renderer: Renderer2, _elementRef: ElementRef, _injector: Injector, _componentFactoryResolver: ComponentFactoryResolver, _ngZone: NgZone, _applicationRef: ApplicationRef, _posService: PositioningService);
  53. attach(compType: Type<T>): ComponentLoader<T>;
  54. to(container?: string | ElementRef): ComponentLoader<T>;
  55. position(opts?: PositioningOptions): ComponentLoader<T>;
  56. provide(provider: StaticProvider): ComponentLoader<T>;
  57. show(opts?: {
  58. content?: string | TemplateRef<any>;
  59. context?: any;
  60. initialState?: any;
  61. [key: string]: any;
  62. }): ComponentRef<T>;
  63. hide(): ComponentLoader<T>;
  64. toggle(): void;
  65. dispose(): void;
  66. listen(listenOpts: ListenOptions): ComponentLoader<T>;
  67. _removeGlobalListener(): void;
  68. attachInline(vRef: ViewContainerRef, template: TemplateRef<any>): ComponentLoader<T>;
  69. _registerOutsideClick(): void;
  70. getInnerComponent(): ComponentRef<T>;
  71. private _subscribePositioning;
  72. private _unsubscribePositioning;
  73. private _getContentRef;
  74. }