ng-devui
Version:
DevUI components based on Angular
61 lines (56 loc) • 2.92 kB
JavaScript
import * as i0 from '@angular/core';
import { Injectable, NgModule } from '@angular/core';
import * as i1 from 'ng-devui/window-ref';
import { WindowRefModule } from 'ng-devui/window-ref';
class OverlayContainerRef {
constructor(_appRef, documentRef, _injector) {
this._appRef = _appRef;
this.documentRef = documentRef;
this._injector = _injector;
}
insert(viewRef) {
this._appRef.attachView(viewRef);
this.documentRef.body.appendChild(viewRef.rootNodes[0]);
return viewRef;
}
remove(viewRef) {
viewRef.destroy();
}
createEmbeddedView(templateRef, context) {
const viewRef = templateRef.createEmbeddedView(context || {});
return this.insert(viewRef);
}
createComponent(componentFactory, injector, projectableNodes) {
const componentRef = componentFactory.create(injector || this._injector, projectableNodes);
this.insert(componentRef.hostView);
return componentRef;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OverlayContainerRef, deps: [{ token: i0.ApplicationRef }, { token: i1.DocumentRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OverlayContainerRef }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OverlayContainerRef, decorators: [{
type: Injectable
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i1.DocumentRef }, { type: i0.Injector }] });
class OverlayContainerModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OverlayContainerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: OverlayContainerModule, imports: [WindowRefModule] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OverlayContainerModule, providers: [
OverlayContainerRef,
], imports: [WindowRefModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OverlayContainerModule, decorators: [{
type: NgModule,
args: [{
imports: [WindowRefModule],
exports: [],
declarations: [],
providers: [
OverlayContainerRef,
],
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { OverlayContainerModule, OverlayContainerRef };
//# sourceMappingURL=ng-devui-overlay-container.mjs.map