Skip to content

Commit a84ddef

Browse files
feat(module:space): support standalone component (#8218)
1 parent b7c6859 commit a84ddef

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

components/space/doc/index.en-US.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ import { NzSpaceModule } from 'ng-zorro-antd/space';
1818

1919
## API
2020

21-
### nz-space
22-
23-
24-
| Property | Description | Type | Default | Global Config |
25-
| --- | --- | --- | --- | --- |
26-
| `[nzSize]` | The space size | `'small' \| 'middle' \| 'large' \| number` | `small` ||
27-
| `[nzDirection]` | The space direction | `'vertical' \| 'horizontal'` | `horizontal` | |
28-
| `[nzAlign]` | Align items | `'start' \| 'end' \| 'baseline' \| 'center'` | - | |
29-
| `[nzWrap]` | Auto wrap line, when `horizontal` effective| `boolean` | `false` | |
30-
| `[nzSplit]` | Set split | `TemplateRef` | - | |
21+
### nz-space:standalone
22+
23+
| Property | Description | Type | Default | Global Config |
24+
| --------------- | ------------------------------------------- | -------------------------------------------- | ------------ | ------------- |
25+
| `[nzSize]` | The space size | `'small' \| 'middle' \| 'large' \| number` | `small` ||
26+
| `[nzDirection]` | The space direction | `'vertical' \| 'horizontal'` | `horizontal` | |
27+
| `[nzAlign]` | Align items | `'start' \| 'end' \| 'baseline' \| 'center'` | - | |
28+
| `[nzWrap]` | Auto wrap line, when `horizontal` effective | `boolean` | `false` | |
29+
| `[nzSplit]` | Set split | `TemplateRef` | - | |

components/space/doc/index.zh-CN.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ import { NzSpaceModule } from 'ng-zorro-antd/space';
2222

2323
## API
2424

25-
### nz-space
26-
27-
| 参数 | 说明 | 类型 | 默认值 | 支持全局配置 |
28-
| --------- | -------- | ------------------------------------------ | ------------ | -- |
29-
| `[nzSize]` | 间距大小 | `'small' \| 'middle' \| 'large' \| number` | `'small'` ||
30-
| `[nzDirection]` | 间距方向 | `'vertical' \| 'horizontal'` | `horizontal` | |
31-
| `[nzAlign]` | 对齐方式 | `'start' \| 'end' \| 'baseline' \| 'center'` | - | |
32-
| `[nzWrap]` | 是否自动换行,仅在 `horizontal` 时有效 | `boolean` | `false` | |
33-
| `[nzSplit]` | 设置分隔符 | `TemplateRef` | - | |
25+
### nz-space:standalone
26+
27+
| 参数 | 说明 | 类型 | 默认值 | 支持全局配置 |
28+
| --------------- | -------------------------------------- | -------------------------------------------- | ------------ | ------------ |
29+
| `[nzSize]` | 间距大小 | `'small' \| 'middle' \| 'large' \| number` | `'small'` | |
30+
| `[nzDirection]` | 间距方向 | `'vertical' \| 'horizontal'` | `horizontal` | |
31+
| `[nzAlign]` | 对齐方式 | `'start' \| 'end' \| 'baseline' \| 'center'` | - | |
32+
| `[nzWrap]` | 是否自动换行,仅在 `horizontal` 时有效 | `boolean` | `false` | |
33+
| `[nzSplit]` | 设置分隔符 | `TemplateRef` | - | |

components/space/space-item.directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
import { Directive } from '@angular/core';
77

88
@Directive({
9-
selector: '[nzSpaceItem]'
9+
selector: '[nzSpaceItem]',
10+
standalone: true
1011
})
1112
export class NzSpaceItemDirective {
1213
constructor() {}

components/space/space.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
44
*/
55

6+
import { NgForOf, NgIf, NgTemplateOutlet } from '@angular/common';
67
import {
78
AfterContentInit,
89
ChangeDetectionStrategy,
@@ -67,7 +68,9 @@ const SPACE_SIZE: {
6768
'[class.ant-space-align-center]': 'mergedAlign === "center"',
6869
'[class.ant-space-align-baseline]': 'mergedAlign === "baseline"',
6970
'[style.flex-wrap]': 'nzWrap ? "wrap" : null'
70-
}
71+
},
72+
imports: [NgTemplateOutlet, NgIf, NgForOf],
73+
standalone: true
7174
})
7275
export class NzSpaceComponent implements OnChanges, OnDestroy, AfterContentInit {
7376
static ngAcceptInputType_nzWrap: BooleanInput;

components/space/space.module.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
44
*/
55

6-
import { BidiModule } from '@angular/cdk/bidi';
7-
import { CommonModule } from '@angular/common';
86
import { NgModule } from '@angular/core';
97

108
import { NzSpaceItemDirective } from './space-item.directive';
119
import { NzSpaceComponent } from './space.component';
1210

1311
@NgModule({
14-
declarations: [NzSpaceComponent, NzSpaceItemDirective],
15-
exports: [NzSpaceComponent, NzSpaceItemDirective],
16-
imports: [BidiModule, CommonModule]
12+
imports: [NzSpaceComponent, NzSpaceItemDirective],
13+
exports: [NzSpaceComponent, NzSpaceItemDirective]
1714
})
1815
export class NzSpaceModule {}

0 commit comments

Comments
 (0)