UNPKG

ng-zorro-antd-yj

Version:

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

118 lines 7.74 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Directive, ElementRef, Inject, InjectionToken, Input, NgZone, Optional } from '@angular/core'; import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations'; import { NzWaveRenderer } from './nz-wave-renderer'; /** * @record */ export function NzWaveConfig() { } if (false) { /** @type {?|undefined} */ NzWaveConfig.prototype.disabled; } /** @type {?} */ export const NZ_WAVE_GLOBAL_DEFAULT_CONFIG = { disabled: false }; /** @type {?} */ export const NZ_WAVE_GLOBAL_CONFIG = new InjectionToken('nz-wave-global-options', { providedIn: 'root', factory: NZ_WAVE_GLOBAL_CONFIG_FACTORY }); /** * @return {?} */ export function NZ_WAVE_GLOBAL_CONFIG_FACTORY() { return NZ_WAVE_GLOBAL_DEFAULT_CONFIG; } export class NzWaveDirective { /** * @param {?} ngZone * @param {?} elementRef * @param {?} config * @param {?} animationType */ constructor(ngZone, elementRef, config, animationType) { this.ngZone = ngZone; this.elementRef = elementRef; this.animationType = animationType; this.nzWaveExtraNode = false; this.waveDisabled = false; if (config && typeof config.disabled === 'boolean') { this.waveDisabled = config.disabled; } if (this.animationType === 'NoopAnimations') { this.waveDisabled = true; } } /** * @return {?} */ ngOnDestroy() { if (this.waveRenderer) { this.waveRenderer.destroy(); } } /** * @return {?} */ ngOnInit() { this.renderWaveIfEnabled(); } /** * @return {?} */ renderWaveIfEnabled() { if (!this.waveDisabled && this.elementRef.nativeElement) { this.waveRenderer = new NzWaveRenderer(this.elementRef.nativeElement, this.ngZone, this.nzWaveExtraNode); } } } NzWaveDirective.decorators = [ { type: Directive, args: [{ selector: '[nz-wave]' },] } ]; /** @nocollapse */ NzWaveDirective.ctorParameters = () => [ { type: NgZone }, { type: ElementRef }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [NZ_WAVE_GLOBAL_CONFIG,] }] }, { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] } ]; NzWaveDirective.propDecorators = { nzWaveExtraNode: [{ type: Input }] }; if (false) { /** @type {?} */ NzWaveDirective.prototype.nzWaveExtraNode; /** * @type {?} * @private */ NzWaveDirective.prototype.waveRenderer; /** * @type {?} * @private */ NzWaveDirective.prototype.waveDisabled; /** * @type {?} * @private */ NzWaveDirective.prototype.ngZone; /** * @type {?} * @private */ NzWaveDirective.prototype.elementRef; /** * @type {?} * @private */ NzWaveDirective.prototype.animationType; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotd2F2ZS5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy16b3Jyby1hbnRkLXlqLyIsInNvdXJjZXMiOlsiY29yZS93YXZlL256LXdhdmUuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQ0wsU0FBUyxFQUNULFVBQVUsRUFDVixNQUFNLEVBQ04sY0FBYyxFQUNkLEtBQUssRUFDTCxNQUFNLEVBR04sUUFBUSxFQUNULE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBQzdFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQzs7OztBQUVwRCxrQ0FFQzs7O0lBREMsZ0NBQW1COzs7QUFHckIsTUFBTSxPQUFPLDZCQUE2QixHQUFpQjtJQUN6RCxRQUFRLEVBQUUsS0FBSztDQUNoQjs7QUFFRCxNQUFNLE9BQU8scUJBQXFCLEdBQUcsSUFBSSxjQUFjLENBQWUsd0JBQXdCLEVBQUU7SUFDOUYsVUFBVSxFQUFFLE1BQU07SUFDbEIsT0FBTyxFQUFFLDZCQUE2QjtDQUN2QyxDQUFDO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