UNPKG

ng-zorro-antd

Version:

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

1 lines 4.06 kB
{"version":3,"file":"ng-zorro-antd-core-transition-patch.mjs","sources":["../../components/core/transition-patch/transition-patch.directive.ts","../../components/core/transition-patch/transition-patch.module.ts","../../components/core/transition-patch/public-api.ts","../../components/core/transition-patch/ng-zorro-antd-core-transition-patch.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 { AfterViewInit, Directive, ElementRef, Input, OnChanges, Renderer2 } from '@angular/core';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\n/**\n * hack the bug\n * angular router change with unexpected transition trigger after calling applicationRef.attachView\n * https://github.com/angular/angular/issues/34718\n */\n@Directive({\n selector:\n '[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group'\n})\nexport class NzTransitionPatchDirective implements AfterViewInit, OnChanges {\n @Input() hidden: NzSafeAny = null;\n setHiddenAttribute(): void {\n if (this.hidden) {\n if (typeof this.hidden === 'string') {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'hidden', this.hidden);\n } else {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'hidden', '');\n }\n } else {\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'hidden');\n }\n }\n\n constructor(private elementRef: ElementRef, private renderer: Renderer2) {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'hidden', '');\n }\n\n ngOnChanges(): void {\n this.setHiddenAttribute();\n }\n\n ngAfterViewInit(): void {\n this.setHiddenAttribute();\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 { PlatformModule } from '@angular/cdk/platform';\nimport { NgModule } from '@angular/core';\n\nimport { NzTransitionPatchDirective } from './transition-patch.directive';\n\n@NgModule({\n imports: [PlatformModule],\n exports: [NzTransitionPatchDirective],\n declarations: [NzTransitionPatchDirective]\n})\nexport class NzTransitionPatchModule {}\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 { NzTransitionPatchModule as ɵNzTransitionPatchModule } from './transition-patch.module';\nexport { NzTransitionPatchDirective as ɵNzTransitionPatchDirective } from './transition-patch.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;AASA;;;;;MASa,0BAA0B;IAcrC,YAAoB,UAAsB,EAAU,QAAmB;QAAnD,eAAU,GAAV,UAAU,CAAY;QAAU,aAAQ,GAAR,QAAQ,CAAW;QAb9D,WAAM,GAAc,IAAI,CAAC;QAchC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;KACzE;IAdD,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE;gBACnC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;aAClF;iBAAM;gBACL,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;aACzE;SACF;aAAM;YACL,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;SACxE;KACF;IAMD,WAAW;QACT,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAED,eAAe;QACb,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3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