-
Notifications
You must be signed in to change notification settings - Fork 1
/
default-node_modules_angular_cdk_fesm2022_portal_mjs.8595ece33599054c.js
2 lines (2 loc) · 5.48 KB
/
default-node_modules_angular_cdk_fesm2022_portal_mjs.8595ece33599054c.js
1
2
"use strict";(self.webpackChunksite=self.webpackChunksite||[]).push([["default-node_modules_angular_cdk_fesm2022_portal_mjs"],{6886:(C,_,d)=>{d.d(_,{CC:()=>u,Ef:()=>p,IP:()=>w,KC:()=>f,S4:()=>m,YT:()=>D,g$:()=>y});var n=d(5460),v=d(3267);class h{attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;null!=t&&(this._attachedHost=null,t.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class f extends h{constructor(t,a,e,o,l){super(),this.component=t,this.viewContainerRef=a,this.injector=e,this.componentFactoryResolver=o,this.projectableNodes=l}}class u extends h{constructor(t,a,e,o){super(),this.templateRef=t,this.viewContainerRef=a,this.context=e,this.injector=o}get origin(){return this.templateRef.elementRef}attach(t,a=this.context){return this.context=a,super.attach(t)}detach(){return this.context=void 0,super.detach()}}class P extends h{constructor(t){super(),this.element=t instanceof n.GMv?t.nativeElement:t}}class p{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){return t instanceof f?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof u?(this._attachedPortal=t,this.attachTemplatePortal(t)):this.attachDomPortal&&t instanceof P?(this._attachedPortal=t,this.attachDomPortal(t)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class m extends p{constructor(t,a,e,o,l){super(),this.outletElement=t,this._componentFactoryResolver=a,this._appRef=e,this._defaultInjector=o,this.attachDomPortal=c=>{const i=c.element,s=this._document.createComment("dom-portal");i.parentNode.insertBefore(s,i),this.outletElement.appendChild(i),this._attachedPortal=c,super.setDisposeFn(()=>{s.parentNode&&s.parentNode.replaceChild(i,s)})},this._document=l}attachComponentPortal(t){const e=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component);let o;return t.viewContainerRef?(o=t.viewContainerRef.createComponent(e,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector,t.projectableNodes||void 0),this.setDisposeFn(()=>o.destroy())):(o=e.create(t.injector||this._defaultInjector||n.zZn.NULL),this._appRef.attachView(o.hostView),this.setDisposeFn(()=>{this._appRef.viewCount>0&&this._appRef.detachView(o.hostView),o.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(o)),this._attachedPortal=t,o}attachTemplatePortal(t){let a=t.viewContainerRef,e=a.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return e.rootNodes.forEach(o=>this.outletElement.appendChild(o)),e.detectChanges(),this.setDisposeFn(()=>{let o=a.indexOf(e);-1!==o&&a.remove(o)}),this._attachedPortal=t,e}dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}let D=(()=>{var r;class t extends u{constructor(e,o){super(e,o)}}return(r=t).\u0275fac=function(e){return new(e||r)(n.GI1(n.Yw2),n.GI1(n.y8U))},r.\u0275dir=n.Sc5({type:r,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],standalone:!0,features:[n.eg9]}),t})(),w=(()=>{var r;class t extends p{constructor(e,o,l){super(),this._componentFactoryResolver=e,this._viewContainerRef=o,this._isInitialized=!1,this.attached=new n._w7,this.attachDomPortal=c=>{const i=c.element,s=this._document.createComment("dom-portal");c.setAttachedHost(this),i.parentNode.insertBefore(s,i),this._getRootNode().appendChild(i),this._attachedPortal=c,super.setDisposeFn(()=>{s.parentNode&&s.parentNode.replaceChild(i,s)})},this._document=l}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);const o=null!=e.viewContainerRef?e.viewContainerRef:this._viewContainerRef,c=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component),i=o.createComponent(c,o.length,e.injector||o.injector,e.projectableNodes||void 0);return o!==this._viewContainerRef&&this._getRootNode().appendChild(i.hostView.rootNodes[0]),super.setDisposeFn(()=>i.destroy()),this._attachedPortal=e,this._attachedRef=i,this.attached.emit(i),i}attachTemplatePortal(e){e.setAttachedHost(this);const o=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=o,this.attached.emit(o),o}_getRootNode(){const e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}}return(r=t).\u0275fac=function(e){return new(e||r)(n.GI1(n.ce5),n.GI1(n.y8U),n.GI1(v.Ud))},r.\u0275dir=n.Sc5({type:r,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[n.Wk5.None,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],standalone:!0,features:[n.eg9]}),t})(),y=(()=>{var r;class t{}return(r=t).\u0275fac=function(e){return new(e||r)},r.\u0275mod=n.a4G({type:r}),r.\u0275inj=n.s3X({}),t})()}}]);
//# sourceMappingURL=default-node_modules_angular_cdk_fesm2022_portal_mjs.8595ece33599054c.js.map