ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
136 lines (130 loc) • 4.25 kB
JavaScript
import { CommonModule } from '@angular/common';
import { Directive, ElementRef, Renderer2, Optional, Inject, Input, NgModule } from '@angular/core';
import { __decorate, __metadata } 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';
/**
* @fileoverview added by tsickle
* Generated from: nz-no-animation.directive.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var DISABLED_CLASSNAME = 'nz-animate-disabled';
var NzNoAnimationDirective = /** @class */ (function () {
function NzNoAnimationDirective(element, renderer, animationType) {
this.element = element;
this.renderer = renderer;
this.animationType = animationType;
this.nzNoAnimation = false;
}
/**
* @return {?}
*/
NzNoAnimationDirective.prototype.ngOnChanges = /**
* @return {?}
*/
function () {
this.updateClass();
};
/**
* @return {?}
*/
NzNoAnimationDirective.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
this.updateClass();
};
/**
* @private
* @return {?}
*/
NzNoAnimationDirective.prototype.updateClass = /**
* @private
* @return {?}
*/
function () {
/** @type {?} */
var 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);
}
};
NzNoAnimationDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzNoAnimation]',
exportAs: 'nzNoAnimation'
},] }
];
/** @nocollapse */
NzNoAnimationDirective.ctorParameters = function () { return [
{ type: ElementRef },
{ type: Renderer2 },
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
]; };
NzNoAnimationDirective.propDecorators = {
nzNoAnimation: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzNoAnimationDirective.prototype, "nzNoAnimation", void 0);
return NzNoAnimationDirective;
}());
if (false) {
/** @type {?} */
NzNoAnimationDirective.ngAcceptInputType_nzNoAnimation;
/** @type {?} */
NzNoAnimationDirective.prototype.nzNoAnimation;
/**
* @type {?}
* @private
*/
NzNoAnimationDirective.prototype.element;
/**
* @type {?}
* @private
*/
NzNoAnimationDirective.prototype.renderer;
/**
* @type {?}
* @private
*/
NzNoAnimationDirective.prototype.animationType;
}
/**
* @fileoverview added by tsickle
* Generated from: nz-no-animation.module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzNoAnimationModule = /** @class */ (function () {
function NzNoAnimationModule() {
}
NzNoAnimationModule.decorators = [
{ type: NgModule, args: [{
declarations: [NzNoAnimationDirective],
exports: [NzNoAnimationDirective],
imports: [CommonModule]
},] }
];
return NzNoAnimationModule;
}());
/**
* @fileoverview added by tsickle
* Generated from: public-api.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* Generated from: ng-zorro-antd-core-no-animation.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
export { NzNoAnimationDirective, NzNoAnimationModule };
//# sourceMappingURL=ng-zorro-antd-core-no-animation.js.map