blob: b46af7f12c5de046b8686634d2ecfd106409d357 [file] [log] [blame]
{"version":3,"sources":["src/cdk/cdk-portal.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","portal","core","common","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","constructor","create","Portal","attach","host","_attachedHost","detach","defineProperty","get","enumerable","configurable","setAttachedHost","ComponentPortal","_super","component","viewContainerRef","injector","componentFactoryResolver","_this","TemplatePortal","template","context","templateRef","elementRef","undefined","DomPortal","element","ElementRef","nativeElement","BasePortalOutlet","_isDisposed","attachDomPortal","hasAttached","_attachedPortal","attachComponentPortal","attachTemplatePortal","ngDevMode","_invokeDisposeFn","dispose","setDisposeFn","fn","_disposeFn","BasePortalHost","apply","arguments","DomPortalOutlet","outletElement","_componentFactoryResolver","_appRef","_defaultInjector","_document","anchorNode","createComment","parentNode","insertBefore","appendChild","replaceChild","componentRef","componentFactory","resolveComponentFactory","createComponent","length","destroy","attachView","hostView","detachView","_getComponentRootNode","viewContainer","viewRef","createEmbeddedView","rootNodes","forEach","rootNode","detectChanges","index","indexOf","remove","removeChild","DomPortalHost","CdkPortal","decorators","type","Directive","args","selector","exportAs","ctorParameters","TemplateRef","ViewContainerRef","TemplatePortalDirective","providers","provide","useExisting","CdkPortalOutlet","_viewContainerRef","_isInitialized","attached","EventEmitter","_getRootNode","set","_attachedRef","ngOnInit","ngOnDestroy","ref","emit","clear","nodeType","ELEMENT_NODE","inputs","ComponentFactoryResolver","Inject","DOCUMENT","propDecorators","Output","PortalModule","PortalHostDirective","NgModule","declarations","PortalInjector","_parentInjector","_customTokens","token","notFoundValue","value"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,iBAAkBA,QAAQ,oBAChG,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,sBAAuB,CAAC,UAAW,gBAAiB,mBAAoBJ,GAClG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zB9C,EAAQoH,wBAA0BA,EAElCrG,OAAOmB,eAAelC,EAAS,aAAc,CAAEsJ,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/portal', ['exports', '@angular/core', '@angular/common'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.portal = {}), global.ng.core, global.ng.common));\n}(this, (function (exports, core, common) { 'use strict';\n\n /*! *****************************************************************************\n Copyright (c) Microsoft Corporation.\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THIS SOFTWARE.\n ***************************************************************************** */\n /* global Reflect, Promise */\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b)\n if (Object.prototype.hasOwnProperty.call(b, p))\n d[p] = b[p]; };\n return extendStatics(d, b);\n };\n function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n var __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n r = Reflect.decorate(decorators, target, key, desc);\n else\n for (var i = decorators.length - 1; i >= 0; i--)\n if (d = decorators[i])\n r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n }\n function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); };\n }\n function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n return Reflect.metadata(metadataKey, metadataValue);\n }\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try {\n step(generator.next(value));\n }\n catch (e) {\n reject(e);\n } }\n function rejected(value) { try {\n step(generator[\"throw\"](value));\n }\n catch (e) {\n reject(e);\n } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function () { if (t[0] & 1)\n throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f)\n throw new TypeError(\"Generator is already executing.\");\n while (_)\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)\n return t;\n if (y = 0, t)\n op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return { value: op[1], done: false };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2])\n _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n }\n catch (e) {\n op = [6, e];\n y = 0;\n }\n finally {\n f = t = 0;\n }\n if (op[0] & 5)\n throw op[1];\n return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n var __createBinding = Object.create ? (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n }) : (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n o[k2] = m[k];\n });\n function __exportStar(m, o) {\n for (var p in m)\n if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p))\n __createBinding(o, m, p);\n }\n function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m)\n return m.call(o);\n if (o && typeof o.length === \"number\")\n return {\n next: function () {\n if (o && i >= o.length)\n o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n }\n function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m)\n return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n ar.push(r.value);\n }\n catch (error) {\n e = { error: error };\n }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"]))\n m.call(i);\n }\n finally {\n if (e)\n throw e.error;\n }\n }\n return ar;\n }\n /** @deprecated */\n function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n }\n /** @deprecated */\n function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n }\n function __spreadArray(to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n }\n function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n }\n function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n])\n i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try {\n step(g[n](v));\n }\n catch (e) {\n settle(q[0][3], e);\n } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length)\n resume(q[0][0], q[0][1]); }\n }\n function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\n }\n function __asyncValues(o) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n }\n function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", { value: raw });\n }\n else {\n cooked.raw = raw;\n }\n return cooked;\n }\n ;\n var __setModuleDefault = Object.create ? (function (o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n }) : function (o, v) {\n o[\"default\"] = v;\n };\n function __importStar(mod) {\n if (mod && mod.__esModule)\n return mod;\n var result = {};\n if (mod != null)\n for (var k in mod)\n if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k))\n __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n }\n function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n }\n function __classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n }\n function __classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n }\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /**\n * Throws an exception when attempting to attach a null portal to a host.\n * @docs-private\n */\n function throwNullPortalError() {\n throw Error('Must provide a portal to attach');\n }\n /**\n * Throws an exception when attempting to attach a portal to a host that is already attached.\n * @docs-private\n */\n function throwPortalAlreadyAttachedError() {\n throw Error('Host already has a portal attached');\n }\n /**\n * Throws an exception when attempting to attach a portal to an already-disposed host.\n * @docs-private\n */\n function throwPortalOutletAlreadyDisposedError() {\n throw Error('This PortalOutlet has already been disposed');\n }\n /**\n * Throws an exception when attempting to attach an unknown portal type.\n * @docs-private\n */\n function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n }\n /**\n * Throws an exception when attempting to attach a portal to a null host.\n * @docs-private\n */\n function throwNullPortalOutletError() {\n throw Error('Attempting to attach a portal to a null PortalOutlet');\n }\n /**\n * Throws an exception when attempting to detach a portal that is not attached.\n * @docs-private\n */\n function throwNoPortalAttachedError() {\n throw Error('Attempting to detach a portal that is not attached to a host');\n }\n\n /**\n * A `Portal` is something that you want to render somewhere else.\n * It can be attach to / detached from a `PortalOutlet`.\n */\n var Portal = /** @class */ (function () {\n function Portal() {\n }\n /** Attach this portal to a host. */\n Portal.prototype.attach = function (host) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (host == null) {\n throwNullPortalOutletError();\n }\n if (host.hasAttached()) {\n throwPortalAlreadyAttachedError();\n }\n }\n this._attachedHost = host;\n return host.attach(this);\n };\n /** Detach this portal from its host */\n Portal.prototype.detach = function () {\n var host = this._attachedHost;\n if (host != null) {\n this._attachedHost = null;\n host.detach();\n }\n else if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throwNoPortalAttachedError();\n }\n };\n Object.defineProperty(Portal.prototype, \"isAttached\", {\n /** Whether this portal is attached to a host. */\n get: function () {\n return this._attachedHost != null;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Sets the PortalOutlet reference without performing `attach()`. This is used directly by\n * the PortalOutlet when it is performing an `attach()` or `detach()`.\n */\n Portal.prototype.setAttachedHost = function (host) {\n this._attachedHost = host;\n };\n return Portal;\n }());\n /**\n * A `ComponentPortal` is a portal that instantiates some Component upon attachment.\n */\n var ComponentPortal = /** @class */ (function (_super) {\n __extends(ComponentPortal, _super);\n function ComponentPortal(component, viewContainerRef, injector, componentFactoryResolver) {\n var _this = _super.call(this) || this;\n _this.component = component;\n _this.viewContainerRef = viewContainerRef;\n _this.injector = injector;\n _this.componentFactoryResolver = componentFactoryResolver;\n return _this;\n }\n return ComponentPortal;\n }(Portal));\n /**\n * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).\n */\n var TemplatePortal = /** @class */ (function (_super) {\n __extends(TemplatePortal, _super);\n function TemplatePortal(template, viewContainerRef, context) {\n var _this = _super.call(this) || this;\n _this.templateRef = template;\n _this.viewContainerRef = viewContainerRef;\n _this.context = context;\n return _this;\n }\n Object.defineProperty(TemplatePortal.prototype, \"origin\", {\n get: function () {\n return this.templateRef.elementRef;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Attach the portal to the provided `PortalOutlet`.\n * When a context is provided it will override the `context` property of the `TemplatePortal`\n * instance.\n */\n TemplatePortal.prototype.attach = function (host, context) {\n if (context === void 0) { context = this.context; }\n this.context = context;\n return _super.prototype.attach.call(this, host);\n };\n TemplatePortal.prototype.detach = function () {\n this.context = undefined;\n return _super.prototype.detach.call(this);\n };\n return TemplatePortal;\n }(Portal));\n /**\n * A `DomPortal` is a portal whose DOM element will be taken from its current position\n * in the DOM and moved into a portal outlet, when it is attached. On detach, the content\n * will be restored to its original position.\n */\n var DomPortal = /** @class */ (function (_super) {\n __extends(DomPortal, _super);\n function DomPortal(element) {\n var _this = _super.call(this) || this;\n _this.element = element instanceof core.ElementRef ? element.nativeElement : element;\n return _this;\n }\n return DomPortal;\n }(Portal));\n /**\n * Partial implementation of PortalOutlet that handles attaching\n * ComponentPortal and TemplatePortal.\n */\n var BasePortalOutlet = /** @class */ (function () {\n function BasePortalOutlet() {\n /** Whether this host has already been permanently disposed. */\n this._isDisposed = false;\n // @breaking-change 10.0.0 `attachDomPortal` to become a required abstract method.\n this.attachDomPortal = null;\n }\n /** Whether this host has an attached portal. */\n BasePortalOutlet.prototype.hasAttached = function () {\n return !!this._attachedPortal;\n };\n /** Attaches a portal. */\n BasePortalOutlet.prototype.attach = function (portal) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!portal) {\n throwNullPortalError();\n }\n if (this.hasAttached()) {\n throwPortalAlreadyAttachedError();\n }\n if (this._isDisposed) {\n throwPortalOutletAlreadyDisposedError();\n }\n }\n if (portal instanceof ComponentPortal) {\n this._attachedPortal = portal;\n return this.attachComponentPortal(portal);\n }\n else if (portal instanceof TemplatePortal) {\n this._attachedPortal = portal;\n return this.attachTemplatePortal(portal);\n // @breaking-change 10.0.0 remove null check for `this.attachDomPortal`.\n }\n else if (this.attachDomPortal && portal instanceof DomPortal) {\n this._attachedPortal = portal;\n return this.attachDomPortal(portal);\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throwUnknownPortalTypeError();\n }\n };\n /** Detaches a previously attached portal. */\n BasePortalOutlet.prototype.detach = function () {\n if (this._attachedPortal) {\n this._attachedPortal.setAttachedHost(null);\n this._attachedPortal = null;\n }\n this._invokeDisposeFn();\n };\n /** Permanently dispose of this portal host. */\n BasePortalOutlet.prototype.dispose = function () {\n if (this.hasAttached()) {\n this.detach();\n }\n this._invokeDisposeFn();\n this._isDisposed = true;\n };\n /** @docs-private */\n BasePortalOutlet.prototype.setDisposeFn = function (fn) {\n this._disposeFn = fn;\n };\n BasePortalOutlet.prototype._invokeDisposeFn = function () {\n if (this._disposeFn) {\n this._disposeFn();\n this._disposeFn = null;\n }\n };\n return BasePortalOutlet;\n }());\n /**\n * @deprecated Use `BasePortalOutlet` instead.\n * @breaking-change 9.0.0\n */\n var BasePortalHost = /** @class */ (function (_super) {\n __extends(BasePortalHost, _super);\n function BasePortalHost() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return BasePortalHost;\n }(BasePortalOutlet));\n\n /**\n * A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular\n * application context.\n */\n var DomPortalOutlet = /** @class */ (function (_super) {\n __extends(DomPortalOutlet, _super);\n function DomPortalOutlet(\n /** Element into which the content is projected. */\n outletElement, _componentFactoryResolver, _appRef, _defaultInjector, \n /**\n * @deprecated `_document` Parameter to be made required.\n * @breaking-change 10.0.0\n */\n _document) {\n var _this = _super.call(this) || this;\n _this.outletElement = outletElement;\n _this._componentFactoryResolver = _componentFactoryResolver;\n _this._appRef = _appRef;\n _this._defaultInjector = _defaultInjector;\n /**\n * Attaches a DOM portal by transferring its content into the outlet.\n * @param portal Portal to be attached.\n * @deprecated To be turned into a method.\n * @breaking-change 10.0.0\n */\n _this.attachDomPortal = function (portal) {\n // @breaking-change 10.0.0 Remove check and error once the\n // `_document` constructor parameter is required.\n if (!_this._document && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Cannot attach DOM portal without _document constructor parameter');\n }\n var element = portal.element;\n if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('DOM portal content must be attached to a parent node.');\n }\n // Anchor used to save the element's previous position so\n // that we can restore it when the portal is detached.\n var anchorNode = _this._document.createComment('dom-portal');\n element.parentNode.insertBefore(anchorNode, element);\n _this.outletElement.appendChild(element);\n _this._attachedPortal = portal;\n _super.prototype.setDisposeFn.call(_this, function () {\n // We can't use `replaceWith` here because IE doesn't support it.\n if (anchorNode.parentNode) {\n anchorNode.parentNode.replaceChild(element, anchorNode);\n }\n });\n };\n _this._document = _document;\n return _this;\n }\n /**\n * Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.\n * @param portal Portal to be attached\n * @returns Reference to the created component.\n */\n DomPortalOutlet.prototype.attachComponentPortal = function (portal) {\n var _this = this;\n var resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n var componentFactory = resolver.resolveComponentFactory(portal.component);\n var componentRef;\n // If the portal specifies a ViewContainerRef, we will use that as the attachment point\n // for the component (in terms of Angular's component tree, not rendering).\n // When the ViewContainerRef is missing, we use the factory to create the component directly\n // and then manually attach the view to the application.\n if (portal.viewContainerRef) {\n componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.injector);\n this.setDisposeFn(function () { return componentRef.destroy(); });\n }\n else {\n componentRef = componentFactory.create(portal.injector || this._defaultInjector);\n this._appRef.attachView(componentRef.hostView);\n this.setDisposeFn(function () {\n _this._appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n });\n }\n // At this point the component has been instantiated, so we move it to the location in the DOM\n // where we want it to be rendered.\n this.outletElement.appendChild(this._getComponentRootNode(componentRef));\n this._attachedPortal = portal;\n return componentRef;\n };\n /**\n * Attaches a template portal to the DOM as an embedded view.\n * @param portal Portal to be attached.\n * @returns Reference to the created embedded view.\n */\n DomPortalOutlet.prototype.attachTemplatePortal = function (portal) {\n var _this = this;\n var viewContainer = portal.viewContainerRef;\n var viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalOutlet the view can be added everywhere in the DOM\n // (e.g Overlay Container) To move the view to the specified host element. We just\n // re-append the existing root nodes.\n viewRef.rootNodes.forEach(function (rootNode) { return _this.outletElement.appendChild(rootNode); });\n // Note that we want to detect changes after the nodes have been moved so that\n // any directives inside the portal that are looking at the DOM inside a lifecycle\n // hook won't be invoked too early.\n viewRef.detectChanges();\n this.setDisposeFn((function () {\n var index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n this._attachedPortal = portal;\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n };\n /**\n * Clears out a portal from the DOM.\n */\n DomPortalOutlet.prototype.dispose = function () {\n _super.prototype.dispose.call(this);\n if (this.outletElement.parentNode != null) {\n this.outletElement.parentNode.removeChild(this.outletElement);\n }\n };\n /** Gets the root HTMLElement for an instantiated component. */\n DomPortalOutlet.prototype._getComponentRootNode = function (componentRef) {\n return componentRef.hostView.rootNodes[0];\n };\n return DomPortalOutlet;\n }(BasePortalOutlet));\n /**\n * @deprecated Use `DomPortalOutlet` instead.\n * @breaking-change 9.0.0\n */\n var DomPortalHost = /** @class */ (function (_super) {\n __extends(DomPortalHost, _super);\n function DomPortalHost() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return DomPortalHost;\n }(DomPortalOutlet));\n\n /**\n * Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,\n * the directive instance itself can be attached to a host, enabling declarative use of portals.\n */\n var CdkPortal = /** @class */ (function (_super) {\n __extends(CdkPortal, _super);\n function CdkPortal(templateRef, viewContainerRef) {\n return _super.call(this, templateRef, viewContainerRef) || this;\n }\n return CdkPortal;\n }(TemplatePortal));\n CdkPortal.decorators = [\n { type: core.Directive, args: [{\n selector: '[cdkPortal]',\n exportAs: 'cdkPortal',\n },] }\n ];\n CdkPortal.ctorParameters = function () { return [\n { type: core.TemplateRef },\n { type: core.ViewContainerRef }\n ]; };\n /**\n * @deprecated Use `CdkPortal` instead.\n * @breaking-change 9.0.0\n */\n var TemplatePortalDirective = /** @class */ (function (_super) {\n __extends(TemplatePortalDirective, _super);\n function TemplatePortalDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return TemplatePortalDirective;\n }(CdkPortal));\n TemplatePortalDirective.decorators = [\n { type: core.Directive, args: [{\n selector: '[cdk-portal], [portal]',\n exportAs: 'cdkPortal',\n providers: [{\n provide: CdkPortal,\n useExisting: TemplatePortalDirective\n }]\n },] }\n ];\n /**\n * Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be\n * directly attached to it, enabling declarative use.\n *\n * Usage:\n * `<ng-template [cdkPortalOutlet]=\"greeting\"></ng-template>`\n */\n var CdkPortalOutlet = /** @class */ (function (_super) {\n __extends(CdkPortalOutlet, _super);\n function CdkPortalOutlet(_componentFactoryResolver, _viewContainerRef, \n /**\n * @deprecated `_document` parameter to be made required.\n * @breaking-change 9.0.0\n */\n _document) {\n var _this = _super.call(this) || this;\n _this._componentFactoryResolver = _componentFactoryResolver;\n _this._viewContainerRef = _viewContainerRef;\n /** Whether the portal component is initialized. */\n _this._isInitialized = false;\n /** Emits when a portal is attached to the outlet. */\n _this.attached = new core.EventEmitter();\n /**\n * Attaches the given DomPortal to this PortalHost by moving all of the portal content into it.\n * @param portal Portal to be attached.\n * @deprecated To be turned into a method.\n * @breaking-change 10.0.0\n */\n _this.attachDomPortal = function (portal) {\n // @breaking-change 9.0.0 Remove check and error once the\n // `_document` constructor parameter is required.\n if (!_this._document && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Cannot attach DOM portal without _document constructor parameter');\n }\n var element = portal.element;\n if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('DOM portal content must be attached to a parent node.');\n }\n // Anchor used to save the element's previous position so\n // that we can restore it when the portal is detached.\n var anchorNode = _this._document.createComment('dom-portal');\n portal.setAttachedHost(_this);\n element.parentNode.insertBefore(anchorNode, element);\n _this._getRootNode().appendChild(element);\n _this._attachedPortal = portal;\n _super.prototype.setDisposeFn.call(_this, function () {\n if (anchorNode.parentNode) {\n anchorNode.parentNode.replaceChild(element, anchorNode);\n }\n });\n };\n _this._document = _document;\n return _this;\n }\n Object.defineProperty(CdkPortalOutlet.prototype, \"portal\", {\n /** Portal associated with the Portal outlet. */\n get: function () {\n return this._attachedPortal;\n },\n set: function (portal) {\n // Ignore the cases where the `portal` is set to a falsy value before the lifecycle hooks have\n // run. This handles the cases where the user might do something like `<div cdkPortalOutlet>`\n // and attach a portal programmatically in the parent component. When Angular does the first CD\n // round, it will fire the setter with empty string, causing the user's content to be cleared.\n if (this.hasAttached() && !portal && !this._isInitialized) {\n return;\n }\n if (this.hasAttached()) {\n _super.prototype.detach.call(this);\n }\n if (portal) {\n _super.prototype.attach.call(this, portal);\n }\n this._attachedPortal = portal;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkPortalOutlet.prototype, \"attachedRef\", {\n /** Component or view reference that is attached to the portal. */\n get: function () {\n return this._attachedRef;\n },\n enumerable: false,\n configurable: true\n });\n CdkPortalOutlet.prototype.ngOnInit = function () {\n this._isInitialized = true;\n };\n CdkPortalOutlet.prototype.ngOnDestroy = function () {\n _super.prototype.dispose.call(this);\n this._attachedPortal = null;\n this._attachedRef = null;\n };\n /**\n * Attach the given ComponentPortal to this PortalOutlet using the ComponentFactoryResolver.\n *\n * @param portal Portal to be attached to the portal outlet.\n * @returns Reference to the created component.\n */\n CdkPortalOutlet.prototype.attachComponentPortal = function (portal) {\n portal.setAttachedHost(this);\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalOutlet.\n var viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n var resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n var componentFactory = resolver.resolveComponentFactory(portal.component);\n var ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector);\n // If we're using a view container that's different from the injected one (e.g. when the portal\n // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered\n // inside of the alternate view container.\n if (viewContainerRef !== this._viewContainerRef) {\n this._getRootNode().appendChild(ref.hostView.rootNodes[0]);\n }\n _super.prototype.setDisposeFn.call(this, function () { return ref.destroy(); });\n this._attachedPortal = portal;\n this._attachedRef = ref;\n this.attached.emit(ref);\n return ref;\n };\n /**\n * Attach the given TemplatePortal to this PortalHost as an embedded View.\n * @param portal Portal to be attached.\n * @returns Reference to the created embedded view.\n */\n CdkPortalOutlet.prototype.attachTemplatePortal = function (portal) {\n var _this = this;\n portal.setAttachedHost(this);\n var viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n _super.prototype.setDisposeFn.call(this, function () { return _this._viewContainerRef.clear(); });\n this._attachedPortal = portal;\n this._attachedRef = viewRef;\n this.attached.emit(viewRef);\n return viewRef;\n };\n /** Gets the root node of the portal outlet. */\n CdkPortalOutlet.prototype._getRootNode = function () {\n var nativeElement = this._viewContainerRef.element.nativeElement;\n // The directive could be set on a template which will result in a comment\n // node being the root. Use the comment's parent node if that is the case.\n return (nativeElement.nodeType === nativeElement.ELEMENT_NODE ?\n nativeElement : nativeElement.parentNode);\n };\n return CdkPortalOutlet;\n }(BasePortalOutlet));\n CdkPortalOutlet.decorators = [\n { type: core.Directive, args: [{\n selector: '[cdkPortalOutlet]',\n exportAs: 'cdkPortalOutlet',\n inputs: ['portal: cdkPortalOutlet']\n },] }\n ];\n CdkPortalOutlet.ctorParameters = function () { return [\n { type: core.ComponentFactoryResolver },\n { type: core.ViewContainerRef },\n { type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] }\n ]; };\n CdkPortalOutlet.propDecorators = {\n attached: [{ type: core.Output }]\n };\n /**\n * @deprecated Use `CdkPortalOutlet` instead.\n * @breaking-change 9.0.0\n */\n var PortalHostDirective = /** @class */ (function (_super) {\n __extends(PortalHostDirective, _super);\n function PortalHostDirective() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return PortalHostDirective;\n }(CdkPortalOutlet));\n PortalHostDirective.decorators = [\n { type: core.Directive, args: [{\n selector: '[cdkPortalHost], [portalHost]',\n exportAs: 'cdkPortalHost',\n inputs: ['portal: cdkPortalHost'],\n providers: [{\n provide: CdkPortalOutlet,\n useExisting: PortalHostDirective\n }]\n },] }\n ];\n var PortalModule = /** @class */ (function () {\n function PortalModule() {\n }\n return PortalModule;\n }());\n PortalModule.decorators = [\n { type: core.NgModule, args: [{\n exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],\n declarations: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],\n },] }\n ];\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /**\n * Custom injector to be used when providing custom\n * injection tokens to components inside a portal.\n * @docs-private\n * @deprecated Use `Injector.create` instead.\n * @breaking-change 11.0.0\n */\n var PortalInjector = /** @class */ (function () {\n function PortalInjector(_parentInjector, _customTokens) {\n this._parentInjector = _parentInjector;\n this._customTokens = _customTokens;\n }\n PortalInjector.prototype.get = function (token, notFoundValue) {\n var value = this._customTokens.get(token);\n if (typeof value !== 'undefined') {\n return value;\n }\n return this._parentInjector.get(token, notFoundValue);\n };\n return PortalInjector;\n }());\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n /**\n * Generated bundle index. Do not edit.\n */\n\n exports.BasePortalHost = BasePortalHost;\n exports.BasePortalOutlet = BasePortalOutlet;\n exports.CdkPortal = CdkPortal;\n exports.CdkPortalOutlet = CdkPortalOutlet;\n exports.ComponentPortal = ComponentPortal;\n exports.DomPortal = DomPortal;\n exports.DomPortalHost = DomPortalHost;\n exports.DomPortalOutlet = DomPortalOutlet;\n exports.Portal = Portal;\n exports.PortalHostDirective = PortalHostDirective;\n exports.PortalInjector = PortalInjector;\n exports.PortalModule = PortalModule;\n exports.TemplatePortal = TemplatePortal;\n exports.TemplatePortalDirective = TemplatePortalDirective;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-portal.umd.js.map\n"]}