UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

84 lines (78 loc) 3.9 kB
import * as i0 from '@angular/core'; import { Directive, Optional, Inject, Input, NgModule } from '@angular/core'; import { __decorate } from 'tslib'; import { coerceElement } from '@angular/cdk/coercion'; import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations'; import { InputBoolean } from 'ng-zorro-antd/core/util'; const DISABLED_CLASSNAME = 'nz-animate-disabled'; class NzNoAnimationDirective { constructor(element, renderer, animationType) { this.element = element; this.renderer = renderer; this.animationType = animationType; this.nzNoAnimation = false; } ngOnChanges() { this.updateClass(); } ngAfterViewInit() { this.updateClass(); } updateClass() { const element = coerceElement(this.element); if (!element) { return; } if (this.nzNoAnimation || this.animationType === 'NoopAnimations') { this.renderer.addClass(element, DISABLED_CLASSNAME); } else { this.renderer.removeClass(element, DISABLED_CLASSNAME); } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: NzNoAnimationDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.7", type: NzNoAnimationDirective, isStandalone: true, selector: "[nzNoAnimation]", inputs: { nzNoAnimation: "nzNoAnimation" }, exportAs: ["nzNoAnimation"], usesOnChanges: true, ngImport: i0 }); } } __decorate([ InputBoolean() ], NzNoAnimationDirective.prototype, "nzNoAnimation", void 0); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: NzNoAnimationDirective, decorators: [{ type: Directive, args: [{ selector: '[nzNoAnimation]', exportAs: 'nzNoAnimation', standalone: true }] }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE] }] }], propDecorators: { nzNoAnimation: [{ type: Input }] } }); /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ class NzNoAnimationModule { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: NzNoAnimationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.7", ngImport: i0, type: NzNoAnimationModule, imports: [NzNoAnimationDirective], exports: [NzNoAnimationDirective] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: NzNoAnimationModule }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: NzNoAnimationModule, decorators: [{ type: NgModule, args: [{ imports: [NzNoAnimationDirective], exports: [NzNoAnimationDirective] }] }] }); /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ /** * Generated bundle index. Do not edit. */ export { NzNoAnimationDirective, NzNoAnimationModule }; //# sourceMappingURL=ng-zorro-antd-core-no-animation.mjs.map