@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>
61 lines (57 loc) • 3.32 kB
JavaScript
import { trigger, transition, style, animate } from '@angular/animations';
import * as i0 from '@angular/core';
import { Component, ChangeDetectionStrategy, Input, HostBinding } from '@angular/core';
class NgDocSmoothResizeComponent {
constructor(element) {
this.element = element;
this.animateOpacity = true;
this.resizeAnimation = {
value: 0,
params: { startHeight: 0, startWidth: 0 },
};
}
ngOnChanges() {
this.resizeAnimation = {
value: this.trigger,
params: {
startHeight: this.element.nativeElement.clientHeight || 0,
startWidth: this.element.nativeElement.clientWidth || 0,
},
};
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocSmoothResizeComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: NgDocSmoothResizeComponent, isStandalone: true, selector: "ng-doc-smooth-resize", inputs: { trigger: "trigger", animateOpacity: "animateOpacity" }, host: { properties: { "@resizeAnimation": "this.resizeAnimation" } }, usesOnChanges: true, ngImport: i0, template: ` <ng-content></ng-content>`, isInline: true, styles: [":host{display:block;overflow:hidden;height:var(--ng-doc-smooth-resize-height);max-height:var(--ng-doc-smooth-resize-max-height)}\n"], animations: [
trigger('resizeAnimation', [
transition('void <=> *', []),
transition('* <=> *', [
style({ height: '{{startHeight}}px', width: '{{startWidth}}px' }),
animate('.225s ease-in-out'),
]),
]),
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocSmoothResizeComponent, decorators: [{
type: Component,
args: [{ animations: [
trigger('resizeAnimation', [
transition('void <=> *', []),
transition('* <=> *', [
style({ height: '{{startHeight}}px', width: '{{startWidth}}px' }),
animate('.225s ease-in-out'),
]),
]),
], selector: 'ng-doc-smooth-resize', template: ` <ng-content></ng-content>`, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, styles: [":host{display:block;overflow:hidden;height:var(--ng-doc-smooth-resize-height);max-height:var(--ng-doc-smooth-resize-max-height)}\n"] }]
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { trigger: [{
type: Input,
args: [{ required: true }]
}], animateOpacity: [{
type: Input
}], resizeAnimation: [{
type: HostBinding,
args: ['@resizeAnimation']
}] } });
/**
* Generated bundle index. Do not edit.
*/
export { NgDocSmoothResizeComponent };
//# sourceMappingURL=ng-doc-ui-kit-components-smooth-resize.mjs.map