{"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, inject, 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-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  private elementRef = inject(ElementRef<HTMLElement>);\n  private renderer = inject(Renderer2);\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    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;AAC7B,IAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;AAC5C,IAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;IAC3B,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;YAClF;iBAAO;AACL,gBAAA,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,EAAE,CAAC;YACzE;QACF;aAAO;AACL,YAAA,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,CAAC;QACxE;IACF;AAEA,IAAA,WAAA,GAAA;AACE,QAAA,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,EAAE,CAAC;IACzE;IAEA,WAAW,GAAA;QACT,IAAI,CAAC,kBAAkB,EAAE;IAC3B;IAEA,eAAe,GAAA;QACb,IAAI,CAAC,kBAAkB,EAAE;IAC3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