Skip to content

Commit

Permalink
feat(abc:page-header): support standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jan 11, 2024
1 parent 90a1392 commit f296dea
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 16 deletions.
3 changes: 2 additions & 1 deletion packages/abc/onboarding/onboarding.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '@angular/core';

import { NzButtonComponent } from 'ng-zorro-antd/button';
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
import { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet';
import type { NzSafeAny } from 'ng-zorro-antd/core/types';
import { NzPopoverDirective } from 'ng-zorro-antd/popover';
Expand Down Expand Up @@ -44,7 +45,7 @@ interface OnboardingLightData {
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [NzPopoverDirective, NzStringTemplateOutletDirective, NzButtonComponent]
imports: [NzPopoverDirective, NzStringTemplateOutletDirective, NzButtonComponent, NzNoAnimationDirective]
})
export class OnboardingComponent implements OnDestroy, AfterViewInit {
private time: NzSafeAny;
Expand Down
4 changes: 2 additions & 2 deletions packages/abc/page-header/demo/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bg: f2f4f5
```ts
import { Component } from '@angular/core';

import { PageHeaderModule } from '@delon/abc/page-header';
import { PageHeaderComponent } from '@delon/abc/page-header';
import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';

@Component({
Expand Down Expand Up @@ -50,7 +50,7 @@ import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
</page-header>
`,
standalone: true,
imports: [PageHeaderModule, NzBreadCrumbModule]
imports: [PageHeaderComponent, NzBreadCrumbModule]
})
export class DemoComponent {}
```
4 changes: 2 additions & 2 deletions packages/abc/page-header/demo/simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bg: f2f4f5
```ts
import { Component } from '@angular/core';

import { PageHeaderModule } from '@delon/abc/page-header';
import { PageHeaderComponent } from '@delon/abc/page-header';
import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';

@Component({
Expand All @@ -26,7 +26,7 @@ import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
</page-header>
`,
standalone: true,
imports: [PageHeaderModule, NzBreadCrumbModule]
imports: [PageHeaderComponent, NzBreadCrumbModule]
})
export class DemoComponent {}
```
4 changes: 2 additions & 2 deletions packages/abc/page-header/demo/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bg: f2f4f5
```ts
import { Component, inject } from '@angular/core';

import { PageHeaderModule } from '@delon/abc/page-header';
import { PageHeaderComponent } from '@delon/abc/page-header';
import { SVModule } from '@delon/abc/sv';
import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
import { NzButtonModule } from 'ng-zorro-antd/button';
Expand Down Expand Up @@ -90,7 +90,7 @@ import { NzTabsModule } from 'ng-zorro-antd/tabs';
`,
standalone: true,
imports: [
PageHeaderModule,
PageHeaderComponent,
NzBreadCrumbModule,
NzButtonModule,
NzDropDownModule,
Expand Down
4 changes: 2 additions & 2 deletions packages/abc/page-header/demo/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bg: f2f4f5
```ts
import { Component, ViewEncapsulation } from '@angular/core';

import { PageHeaderModule } from '@delon/abc/page-header';
import { PageHeaderComponent } from '@delon/abc/page-header';
import { NzTabsModule } from 'ng-zorro-antd/tabs';

@Component({
Expand Down Expand Up @@ -62,7 +62,7 @@ import { NzTabsModule } from 'ng-zorro-antd/tabs';
],
encapsulation: ViewEncapsulation.Emulated,
standalone: true,
imports: [PageHeaderModule, NzTabsModule]
imports: [PageHeaderComponent, NzTabsModule]
})
export class DemoComponent {}
```
2 changes: 1 addition & 1 deletion packages/abc/page-header/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The page header is used to declare the subject of the page and contains the most

## API

### page-header
### page-header:standalone

| Property | Description | Type | Default | Global Config |
|----------|-------------|------|---------|---------------|
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/page-header/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module: import { PageHeaderModule } from '@delon/abc/page-header';

## API

### page-header
### page-header:standalone

| 成员 | 说明 | 类型 | 默认值 | 全局配置 |
|----|----|----|-----|------|
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/page-header/page-header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}
<ng-template #phTpl>
<div class="page-header" [class.page-header-rtl]="dir === 'rtl'">
<div [ngClass]="{ 'page-header__wide': wide }">
<div [class.page-header__wide]="wide">
<nz-skeleton
[nzLoading]="loading"
[nzTitle]="false"
Expand Down
19 changes: 17 additions & 2 deletions packages/abc/page-header/page-header.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Direction, Directionality } from '@angular/cdk/bidi';
import { ObserversModule } from '@angular/cdk/observers';
import { Platform } from '@angular/cdk/platform';
import { NgTemplateOutlet } from '@angular/common';
import {
AfterViewInit,
ChangeDetectionStrategy,
Expand All @@ -17,7 +19,7 @@ import {
ViewEncapsulation
} from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { NavigationEnd, Router } from '@angular/router';
import { NavigationEnd, Router, RouterLink } from '@angular/router';
import { merge, filter } from 'rxjs';

import { ReuseTabService } from '@delon/abc/reuse-tab';
Expand All @@ -26,7 +28,10 @@ import { isEmpty } from '@delon/util/browser';
import { AlainConfigService } from '@delon/util/config';
import { BooleanInput, InputBoolean, InputNumber, NumberInput } from '@delon/util/decorator';
import { NzAffixComponent } from 'ng-zorro-antd/affix';
import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
import { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet';
import type { NzSafeAny } from 'ng-zorro-antd/core/types';
import { NzSkeletonModule } from 'ng-zorro-antd/skeleton';

interface PageHeaderPath {
title?: string;
Expand All @@ -39,7 +44,17 @@ interface PageHeaderPath {
templateUrl: './page-header.component.html',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [
NzAffixComponent,
NgTemplateOutlet,
NzSkeletonModule,
NzBreadCrumbModule,
RouterLink,
NzStringTemplateOutletDirective,
ObserversModule
]
})
export class PageHeaderComponent implements OnInit, OnChanges, AfterViewInit {
static ngAcceptInputType_loading: BooleanInput;
Expand Down
4 changes: 2 additions & 2 deletions packages/abc/page-header/page-header.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ const COMPONENTS = [PageHeaderComponent];
NzAffixModule,
NzSkeletonModule,
NzBreadCrumbModule,
NzOutletModule
NzOutletModule,
...COMPONENTS
],
declarations: COMPONENTS,
exports: COMPONENTS
})
export class PageHeaderModule {}

0 comments on commit f296dea

Please sign in to comment.