ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
1 lines • 4.48 kB
Source Map (JSON)
{"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-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(\n private elementRef: ElementRef,\n private renderer: Renderer2\n ) {\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 { NgModule } from '@angular/core';\n\nimport { NzTransitionPatchDirective } from './transition-patch.directive';\n\n@NgModule({\n imports: [NzTransitionPatchDirective],\n exports: [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;;;AAGG;AAMH;;;;AAIG;MAKU,0BAA0B,CAAA;AAe3B,IAAA,UAAA;AACA,IAAA,QAAA;IAfD,MAAM,GAAc,IAAI;IACjC,kBAAkB,GAAA;AAChB,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE;AACf,YAAA,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE;AACnC,gBAAA,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;;iBAC3E;AACL,gBAAA,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,EAAE,CAAC;;;aAEpE;AACL,YAAA,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,CAAC;;;IAI1E,WACU,CAAA,UAAsB,EACtB,QAAmB,EAAA;QADnB,IAAU,CAAA,UAAA,GAAV,UAAU;QACV,IAAQ,CAAA,QAAA,GAAR,QAAQ;AAEhB,QAAA,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,EAAE,CAAC;;IAGzE,WAAW,GAAA;QACT,IAAI,CAAC,kBAAkB,EAAE;;IAG3B,eAAe,GAAA;QACb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