UNPKG

ng-zorro-antd

Version:

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

1 lines 3.93 kB
{"version":3,"file":"ng-zorro-antd-core-no-animation.mjs","sources":["../../components/core/no-animation/nz-no-animation.directive.ts","../../components/core/no-animation/nz-no-animation.module.ts","../../components/core/no-animation/public-api.ts","../../components/core/no-animation/ng-zorro-antd-core-no-animation.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { coerceElement } from '@angular/cdk/coercion';\nimport { AfterViewInit, Directive, ElementRef, Inject, Input, OnChanges, Optional, Renderer2 } from '@angular/core';\nimport { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';\n\nimport { BooleanInput } from 'ng-zorro-antd/core/types';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\n\nconst DISABLED_CLASSNAME = 'nz-animate-disabled';\n\n@Directive({\n selector: '[nzNoAnimation]',\n exportAs: 'nzNoAnimation'\n})\nexport class NzNoAnimationDirective implements OnChanges, AfterViewInit {\n static ngAcceptInputType_nzNoAnimation: BooleanInput;\n\n @Input() @InputBoolean() nzNoAnimation: boolean = false;\n\n constructor(\n private element: ElementRef,\n private renderer: Renderer2,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) private animationType: string\n ) {}\n\n ngOnChanges(): void {\n this.updateClass();\n }\n\n ngAfterViewInit(): void {\n this.updateClass();\n }\n\n private updateClass(): void {\n const element = coerceElement(this.element);\n if (!element) {\n return;\n }\n if (this.nzNoAnimation || this.animationType === 'NoopAnimations') {\n this.renderer.addClass(element, DISABLED_CLASSNAME);\n } else {\n this.renderer.removeClass(element, DISABLED_CLASSNAME);\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzNoAnimationDirective } from './nz-no-animation.directive';\n\n@NgModule({\n declarations: [NzNoAnimationDirective],\n exports: [NzNoAnimationDirective],\n imports: [CommonModule]\n})\nexport class NzNoAnimationModule {}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport { NzNoAnimationModule } from './nz-no-animation.module';\nexport { NzNoAnimationDirective } from './nz-no-animation.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAYA,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;MAMpC,sBAAsB;IAKjC,YACU,OAAmB,EACnB,QAAmB,EACwB,aAAqB;QAFhE,YAAO,GAAP,OAAO,CAAY;QACnB,aAAQ,GAAR,QAAQ,CAAW;QACwB,kBAAa,GAAb,aAAa,CAAQ;QALjD,kBAAa,GAAY,KAAK,CAAC;KAMpD;IAEJ,WAAW;QACT,IAAI,CAAC,WAAW,EAAE,CAAC;KACpB;IAED,eAAe;QACb,IAAI,CAAC,WAAW,EAAE,CAAC;KACpB;IAEO,WAAW;QACjB,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO;SACR;QACD,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,KAAK,gBAAgB,EAAE;YACjE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;SACrD;aAAM;YACL,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;SACxD;KACF;;mHA7BU,sBAAsB,qEAQX,qBAAqB;uGARhC,sBAAsB;AAGR;IAAf,YAAY,EAAE;6DAAgC;2FAH7C,sBAAsB;kBAJlC,SAAS;mBAAC;oBACT,QAAQ,EAAE,iBAAiB;oBA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