12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. var __extends = (this && this.__extends) || (function () {
  2. var extendStatics = Object.setPrototypeOf ||
  3. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5. return function (d, b) {
  6. extendStatics(d, b);
  7. function __() { this.constructor = d; }
  8. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9. };
  10. })();
  11. import { ComponentFactoryResolver, Directive, ElementRef, ErrorHandler, Inject, Input, NgZone, Optional, Renderer, ViewContainerRef, forwardRef } from '@angular/core';
  12. import { App } from './app';
  13. import { Config } from '../../config/config';
  14. import { DeepLinker } from '../../navigation/deep-linker';
  15. import { DomController } from '../../platform/dom-controller';
  16. import { GestureController } from '../../gestures/gesture-controller';
  17. import { NavControllerBase } from '../../navigation/nav-controller-base';
  18. import { Platform } from '../../platform/platform';
  19. import { TransitionController } from '../../transitions/transition-controller';
  20. /**
  21. * @hidden
  22. */
  23. var OverlayPortal = (function (_super) {
  24. __extends(OverlayPortal, _super);
  25. function OverlayPortal(app, config, plt, elementRef, zone, renderer, cfr, gestureCtrl, transCtrl, linker, viewPort, domCtrl, errHandler) {
  26. var _this = _super.call(this, null, app, config, plt, elementRef, zone, renderer, cfr, gestureCtrl, transCtrl, linker, domCtrl, errHandler) || this;
  27. _this._isPortal = true;
  28. _this._init = true;
  29. _this.setViewport(viewPort);
  30. // on every page change make sure the portal has
  31. // dismissed any views that should be auto dismissed on page change
  32. app.viewDidLeave.subscribe(function (view) {
  33. if (!view.isOverlay) {
  34. _this.dismissPageChangeViews();
  35. }
  36. });
  37. return _this;
  38. }
  39. Object.defineProperty(OverlayPortal.prototype, "_overlayPortal", {
  40. set: function (val) {
  41. this._zIndexOffset = (val || 0);
  42. },
  43. enumerable: true,
  44. configurable: true
  45. });
  46. OverlayPortal.prototype.ngOnDestroy = function () {
  47. this.destroy();
  48. };
  49. /*
  50. * @private
  51. */
  52. OverlayPortal.prototype.getType = function () {
  53. return 'portal';
  54. };
  55. /*
  56. * @private
  57. */
  58. OverlayPortal.prototype.getSecondaryIdentifier = function () {
  59. return null;
  60. };
  61. OverlayPortal.decorators = [
  62. { type: Directive, args: [{
  63. selector: '[overlay-portal]',
  64. },] },
  65. ];
  66. /** @nocollapse */
  67. OverlayPortal.ctorParameters = function () { return [
  68. { type: App, decorators: [{ type: Inject, args: [forwardRef(function () { return App; }),] },] },
  69. { type: Config, },
  70. { type: Platform, },
  71. { type: ElementRef, },
  72. { type: NgZone, },
  73. { type: Renderer, },
  74. { type: ComponentFactoryResolver, },
  75. { type: GestureController, },
  76. { type: TransitionController, },
  77. { type: DeepLinker, decorators: [{ type: Optional },] },
  78. { type: ViewContainerRef, },
  79. { type: DomController, },
  80. { type: ErrorHandler, },
  81. ]; };
  82. OverlayPortal.propDecorators = {
  83. '_overlayPortal': [{ type: Input, args: ['overlay-portal',] },],
  84. };
  85. return OverlayPortal;
  86. }(NavControllerBase));
  87. export { OverlayPortal };
  88. //# sourceMappingURL=overlay-portal.js.map