{"version":3,"file":"ng-zorro-antd-page-header.mjs","sources":["../../components/page-header/page-header-cells.ts","../../components/page-header/page-header.component.ts","../../components/page-header/page-header.module.ts","../../components/page-header/public-api.ts","../../components/page-header/ng-zorro-antd-page-header.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 { Directive } from '@angular/core';\n\n@Directive({\n  selector: 'nz-page-header-title, [nz-page-header-title]',\n  exportAs: 'nzPageHeaderTitle',\n  host: {\n    class: 'ant-page-header-heading-title'\n  }\n})\nexport class NzPageHeaderTitleDirective {}\n\n@Directive({\n  selector: 'nz-page-header-subtitle, [nz-page-header-subtitle]',\n  exportAs: 'nzPageHeaderSubtitle',\n  host: {\n    class: 'ant-page-header-heading-sub-title'\n  }\n})\nexport class NzPageHeaderSubtitleDirective {}\n\n@Directive({\n  selector: 'nz-page-header-content, [nz-page-header-content]',\n  exportAs: 'nzPageHeaderContent',\n  host: {\n    class: 'ant-page-header-content'\n  }\n})\nexport class NzPageHeaderContentDirective {}\n\n@Directive({\n  selector: 'nz-page-header-tags, [nz-page-header-tags]',\n  exportAs: 'nzPageHeaderTags',\n  host: {\n    class: 'ant-page-header-heading-tags'\n  }\n})\nexport class NzPageHeaderTagDirective {}\n\n@Directive({\n  selector: 'nz-page-header-extra, [nz-page-header-extra]',\n  exportAs: 'nzPageHeaderExtra',\n  host: {\n    class: 'ant-page-header-heading-extra'\n  }\n})\nexport class NzPageHeaderExtraDirective {}\n\n@Directive({\n  selector: 'nz-page-header-footer, [nz-page-header-footer]',\n  exportAs: 'nzPageHeaderFooter',\n  host: {\n    class: 'ant-page-header-footer'\n  }\n})\nexport class NzPageHeaderFooterDirective {}\n\n@Directive({\n  selector: 'nz-breadcrumb[nz-page-header-breadcrumb]',\n  exportAs: 'nzPageHeaderBreadcrumb'\n})\nexport class NzPageHeaderBreadcrumbDirective {}\n\n@Directive({\n  selector: 'nz-avatar[nz-page-header-avatar]',\n  exportAs: 'nzPageHeaderAvatar'\n})\nexport class NzPageHeaderAvatarDirective {}\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 { Direction, Directionality } from '@angular/cdk/bidi';\nimport { Location } from '@angular/common';\nimport {\n  AfterViewInit,\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  ContentChild,\n  ElementRef,\n  EventEmitter,\n  Input,\n  OnDestroy,\n  OnInit,\n  Optional,\n  Output,\n  TemplateRef,\n  ViewEncapsulation\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { map, takeUntil } from 'rxjs/operators';\n\nimport { NzResizeObserver } from 'ng-zorro-antd/cdk/resize-observer';\nimport { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';\nimport { PREFIX } from 'ng-zorro-antd/core/logger';\n\nimport { NzPageHeaderBreadcrumbDirective, NzPageHeaderFooterDirective } from './page-header-cells';\n\nconst NZ_CONFIG_MODULE_NAME: NzConfigKey = 'pageHeader';\n\n@Component({\n  selector: 'nz-page-header',\n  exportAs: 'nzPageHeader',\n  template: `\n    <ng-content select=\"nz-breadcrumb[nz-page-header-breadcrumb]\"></ng-content>\n\n    <div class=\"ant-page-header-heading\">\n      <div class=\"ant-page-header-heading-left\">\n        <!--back-->\n        <div *ngIf=\"nzBackIcon !== null\" (click)=\"onBack()\" class=\"ant-page-header-back\">\n          <div role=\"button\" tabindex=\"0\" class=\"ant-page-header-back-button\">\n            <ng-container *nzStringTemplateOutlet=\"nzBackIcon; let backIcon\">\n              <i nz-icon [nzType]=\"backIcon || getBackIcon()\" nzTheme=\"outline\"></i>\n            </ng-container>\n          </div>\n        </div>\n        <!--avatar-->\n        <ng-content select=\"nz-avatar[nz-page-header-avatar]\"></ng-content>\n        <!--title-->\n        <span class=\"ant-page-header-heading-title\" *ngIf=\"nzTitle\">\n          <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n        </span>\n        <ng-content *ngIf=\"!nzTitle\" select=\"nz-page-header-title, [nz-page-header-title]\"></ng-content>\n        <!--subtitle-->\n        <span class=\"ant-page-header-heading-sub-title\" *ngIf=\"nzSubtitle\">\n          <ng-container *nzStringTemplateOutlet=\"nzSubtitle\">{{ nzSubtitle }}</ng-container>\n        </span>\n        <ng-content *ngIf=\"!nzSubtitle\" select=\"nz-page-header-subtitle, [nz-page-header-subtitle]\"></ng-content>\n        <ng-content select=\"nz-page-header-tags, [nz-page-header-tags]\"></ng-content>\n      </div>\n\n      <ng-content select=\"nz-page-header-extra, [nz-page-header-extra]\"></ng-content>\n    </div>\n\n    <ng-content select=\"nz-page-header-content, [nz-page-header-content]\"></ng-content>\n    <ng-content select=\"nz-page-header-footer, [nz-page-header-footer]\"></ng-content>\n  `,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  encapsulation: ViewEncapsulation.None,\n  host: {\n    class: 'ant-page-header',\n    '[class.has-footer]': 'nzPageHeaderFooter',\n    '[class.ant-page-header-ghost]': 'nzGhost',\n    '[class.has-breadcrumb]': 'nzPageHeaderBreadcrumb',\n    '[class.ant-page-header-compact]': 'compact',\n    '[class.ant-page-header-rtl]': `dir === 'rtl'`\n  }\n})\nexport class NzPageHeaderComponent implements AfterViewInit, OnDestroy, OnInit {\n  readonly _nzModuleName: NzConfigKey = NZ_CONFIG_MODULE_NAME;\n\n  @Input() nzBackIcon: string | TemplateRef<void> | null = null;\n  @Input() nzTitle?: string | TemplateRef<void>;\n  @Input() nzSubtitle?: string | TemplateRef<void>;\n  @Input() @WithConfig() nzGhost: boolean = true;\n  @Output() readonly nzBack = new EventEmitter<void>();\n\n  @ContentChild(NzPageHeaderFooterDirective, { static: false })\n  nzPageHeaderFooter?: ElementRef<NzPageHeaderFooterDirective>;\n  @ContentChild(NzPageHeaderBreadcrumbDirective, { static: false })\n  nzPageHeaderBreadcrumb?: ElementRef<NzPageHeaderBreadcrumbDirective>;\n\n  compact = false;\n  destroy$ = new Subject<void>();\n  dir: Direction = 'ltr';\n\n  constructor(\n    @Optional() private location: Location,\n    public nzConfigService: NzConfigService,\n    private elementRef: ElementRef,\n    private nzResizeObserver: NzResizeObserver,\n    private cdr: ChangeDetectorRef,\n    @Optional() private directionality: Directionality\n  ) {}\n\n  ngOnInit(): void {\n    this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe((direction: Direction) => {\n      this.dir = direction;\n      this.cdr.detectChanges();\n    });\n\n    this.dir = this.directionality.value;\n  }\n\n  ngAfterViewInit(): void {\n    this.nzResizeObserver\n      .observe(this.elementRef)\n      .pipe(\n        map(([entry]) => entry.contentRect.width),\n        takeUntil(this.destroy$)\n      )\n      .subscribe((width: number) => {\n        this.compact = width < 768;\n        this.cdr.markForCheck();\n      });\n  }\n\n  onBack(): void {\n    if (this.nzBack.observers.length) {\n      this.nzBack.emit();\n    } else {\n      if (!this.location) {\n        throw new Error(\n          `${PREFIX} you should import 'RouterModule' or register 'Location' if you want to use 'nzBack' default event!`\n        );\n      }\n      this.location.back();\n    }\n  }\n\n  ngOnDestroy(): void {\n    this.destroy$.next();\n    this.destroy$.complete();\n  }\n\n  getBackIcon(): string {\n    if (this.dir === 'rtl') {\n      return 'arrow-right';\n    }\n    return 'arrow-left';\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 { BidiModule } from '@angular/cdk/bidi';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\nimport {\n  NzPageHeaderAvatarDirective,\n  NzPageHeaderBreadcrumbDirective,\n  NzPageHeaderContentDirective,\n  NzPageHeaderExtraDirective,\n  NzPageHeaderFooterDirective,\n  NzPageHeaderSubtitleDirective,\n  NzPageHeaderTagDirective,\n  NzPageHeaderTitleDirective\n} from './page-header-cells';\nimport { NzPageHeaderComponent } from './page-header.component';\n\nconst NzPageHeaderCells = [\n  NzPageHeaderTitleDirective,\n  NzPageHeaderSubtitleDirective,\n  NzPageHeaderContentDirective,\n  NzPageHeaderTagDirective,\n  NzPageHeaderExtraDirective,\n  NzPageHeaderFooterDirective,\n  NzPageHeaderBreadcrumbDirective,\n  NzPageHeaderAvatarDirective\n];\n\n@NgModule({\n  imports: [BidiModule, CommonModule, NzOutletModule, NzIconModule],\n  exports: [NzPageHeaderComponent, NzPageHeaderCells],\n  declarations: [NzPageHeaderComponent, NzPageHeaderCells]\n})\nexport class NzPageHeaderModule {}\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 * from './page-header.module';\nexport * from './page-header.component';\nexport * from './page-header-cells';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;MAca,0BAA0B;;uHAA1B,0BAA0B;2GAA1B,0BAA0B;2FAA1B,0BAA0B;kBAPtC,SAAS;mBAAC;oBACT,QAAQ,EAAE,8CAA8C;oBACxD,QAAQ,EAAE,mBAAmB;oBAC7B,IAAI,EAAE;wBACJ,KAAK,EAAE,+BAA+B;qBACvC;iBACF;;MAUY,6BAA6B;;0HAA7B,6BAA6B;8GAA7B,6BAA6B;2FAA7B,6BAA6B;kBAPzC,SAAS;mBAAC;oBACT,QAAQ,EAAE,oDAAoD;oBAC9D,QAAQ,EAAE,sBAAsB;oBAChC,IAAI,EAAE;wBACJ,KAAK,EAAE,mCAAmC;qBAC3C;iBACF;;MAUY,4BAA4B;;yHAA5B,4BAA4B;6GAA5B,4BAA4B;2FAA5B,4BAA4B;kBAPxC,SAAS;mBAAC;oBACT,QAAQ,EAAE,kDAAkD;oBAC5D,QAAQ,EAAE,qBAA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