UNPKG

ng-devui

Version:

DevUI components based on Angular

87 lines (81 loc) 3.4 kB
import * as i0 from '@angular/core'; import { Injectable, Inject, NgModule } from '@angular/core'; import { DOCUMENT } from '@angular/common'; class DocumentRef { constructor(doc) { this.doc = doc; } get document() { return this.doc; } get body() { return this.document.body; } get documentElement() { return this.document.documentElement; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DocumentRef, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); } static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DocumentRef }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DocumentRef, decorators: [{ type: Injectable }], ctorParameters: () => [{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT] }] }] }); class WindowRef { constructor(documentRef) { this.documentRef = documentRef; } get window() { return this.document.defaultView; } get document() { return this.documentRef.document; } get pageXOffset() { return this.window.pageXOffset; } get pageYOffset() { return this.window.pageYOffset; } get innerHeight() { return this.window.innerHeight; } get innerWidth() { return this.window.innerWidth; } getComputedStyle(element) { return this.window.getComputedStyle(element); } getBoundingClientRect(elementRef) { return elementRef.nativeElement && elementRef.nativeElement.getBoundingClientRect(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WindowRef, deps: [{ token: DocumentRef }], target: i0.ɵɵFactoryTarget.Injectable }); } static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WindowRef }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WindowRef, decorators: [{ type: Injectable }], ctorParameters: () => [{ type: DocumentRef }] }); class WindowRefModule { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WindowRefModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: WindowRefModule }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WindowRefModule, providers: [ WindowRef, DocumentRef, ] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WindowRefModule, decorators: [{ type: NgModule, args: [{ providers: [ WindowRef, DocumentRef, ], }] }] }); /** * Generated bundle index. Do not edit. */ export { DocumentRef, WindowRef, WindowRefModule }; //# sourceMappingURL=ng-devui-window-ref.mjs.map