UNPKG

@tapsellorg/angular-material-library

Version:

Angular library for Tapsell

68 lines (63 loc) 3.44 kB
import * as i0 from '@angular/core'; import { input, HostBinding, Directive, NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; class PghSmoothHeightDirective { constructor(element) { this.element = element; /** * This triggers the ngOnChanges method */ this.smoothHeight = input.required({ alias: 'pghSmoothHeight', }); this.pulse = false; this.startHeight = 0; this.styleOverflow = 'hidden'; } get smoothHeightAnimation() { return { value: this.pulse, params: { startHeight: this.startHeight, duration: this.smoothHeight()?.params?.duration ?? '0.4s', }, }; } ngOnChanges(changes) { this.startHeight = this.element.nativeElement.clientHeight; this.pulse = !this.pulse; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: PghSmoothHeightDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: PghSmoothHeightDirective, isStandalone: false, selector: "[pghSmoothHeight]", inputs: { smoothHeight: { classPropertyName: "smoothHeight", publicName: "pghSmoothHeight", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style.overflow": "this.styleOverflow", "@smoothHeight": "this.smoothHeightAnimation" } }, usesOnChanges: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: PghSmoothHeightDirective, decorators: [{ type: Directive, args: [{ selector: '[pghSmoothHeight]', standalone: false, }] }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { styleOverflow: [{ type: HostBinding, args: ['style.overflow'] }], smoothHeightAnimation: [{ type: HostBinding, args: ['@smoothHeight'] }] } }); class PghSmoothHeightModule { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: PghSmoothHeightModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: PghSmoothHeightModule, declarations: [PghSmoothHeightDirective], imports: [CommonModule], exports: [PghSmoothHeightDirective] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: PghSmoothHeightModule, imports: [CommonModule] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: PghSmoothHeightModule, decorators: [{ type: NgModule, args: [{ declarations: [PghSmoothHeightDirective], imports: [CommonModule], exports: [PghSmoothHeightDirective], }] }] }); /** * Generated bundle index. Do not edit. */ export { PghSmoothHeightDirective, PghSmoothHeightModule }; //# sourceMappingURL=tapsellorg-angular-material-library-src-lib-smooth-height.mjs.map