UNPKG

@ng-doc/ui-kit

Version:

<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>

41 lines (37 loc) 1.94 kB
import * as i0 from '@angular/core'; import { InjectionToken, inject, Injectable } from '@angular/core'; import { asArray } from '@ng-doc/core/helpers/as-array'; import { NgDocOverlayContainerComponent } from '@ng-doc/ui-kit/components/overlay-container'; import { NgDocOverlayService } from '@ng-doc/ui-kit/services/overlay'; const NG_DOC_DIALOG_DATA = new InjectionToken('NG_DOC_DIALOG_DATA'); class NgDocDialogService { constructor() { this.overlayService = inject(NgDocOverlayService); } open(content, config) { return this.overlayService.open(content, { overlayContainer: NgDocOverlayContainerComponent, positionStrategy: config?.positionStrategy ?? this.overlayService.globalPositionStrategy().centerHorizontally().centerVertically(), scrollStrategy: config?.scrollStrategy ?? this.overlayService.scrollStrategy().block(), ...config, panelClass: ['ng-doc-dialog', ...asArray(config?.panelClass)], }, [{ provide: NG_DOC_DIALOG_DATA, useValue: config?.data }]); } positionStrategy() { return this.overlayService.globalPositionStrategy(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); } static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocDialogService, providedIn: 'root' }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocDialogService, decorators: [{ type: Injectable, args: [{ providedIn: 'root', }] }] }); /** * Generated bundle index. Do not edit. */ export { NG_DOC_DIALOG_DATA, NgDocDialogService }; //# sourceMappingURL=ng-doc-ui-kit-services-dialog.mjs.map