Skip to content

Commit cd23e33

Browse files
feat(module:spin): support standalone component (#8217)
1 parent 3f6a9ed commit cd23e33

4 files changed

Lines changed: 24 additions & 25 deletions

File tree

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ import { NzSpinModule } from 'ng-zorro-antd/spin';
1717

1818
## API
1919

20-
### nz-spin
20+
### nz-spin:standalone
2121

22-
| Property | Description | Type | Default Value | Global Config |
23-
| -------- | ----------- | ---- | ------------- | ------------- |
24-
| `[nzDelay]` | specifies a delay in milliseconds for loading state (prevent flush), unit: milliseconds | `number` | - |
25-
| `[nzIndicator]` | the spinning indicator | `TemplateRef<void>` | - ||
26-
| `[nzSize]` | size of Spin | `'large' \| 'small' \| 'default'` | `'default'` |
27-
| `[nzSpinning]` | whether Spin is spinning | `boolean` | `true` |
28-
| `[nzSimple]` | whether Spin has no children | `boolean` | `false` |
29-
| `[nzTip]` | customize description content when Spin has children | `string` | - |
22+
| Property | Description | Type | Default Value | Global Config |
23+
| --------------- | --------------------------------------------------------------------------------------- | --------------------------------- | ------------- | ------------- |
24+
| `[nzDelay]` | specifies a delay in milliseconds for loading state (prevent flush), unit: milliseconds | `number` | - |
25+
| `[nzIndicator]` | the spinning indicator | `TemplateRef<void>` | - | |
26+
| `[nzSize]` | size of Spin | `'large' \| 'small' \| 'default'` | `'default'` |
27+
| `[nzSpinning]` | whether Spin is spinning | `boolean` | `true` |
28+
| `[nzSimple]` | whether Spin has no children | `boolean` | `false` |
29+
| `[nzTip]` | customize description content when Spin has children | `string` | - |

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

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

1919
## API
2020

21-
### nz-spin
21+
### nz-spin:standalone
2222

23-
| 参数 | 说明 | 类型 | 默认值 | 全局配置 |
24-
| --- | --- | --- | --- | --- |
25-
| `[nzDelay]` | 延迟显示加载效果的时间(防止闪烁),单位:毫秒 | `number` | - |
26-
| `[nzIndicator]` | 加载指示符 | `TemplateRef<void>` | - ||
27-
| `[nzSize]` | 组件大小 | `'large' \| 'small' \| 'default'` | `'default'` |
28-
| `[nzSpinning]` | 是否旋转 | `boolean` | `true` |
29-
| `[nzSimple]` | 是否包裹元素 | `boolean` | `false` |
30-
| `[nzTip]` | 当作为包裹元素时,可以自定义描述文案 | `string` | - |
23+
| 参数 | 说明 | 类型 | 默认值 | 全局配置 |
24+
| --------------- | ---------------------------------------------- | --------------------------------- | ----------- | -------- |
25+
| `[nzDelay]` | 延迟显示加载效果的时间(防止闪烁),单位:毫秒 | `number` | - |
26+
| `[nzIndicator]` | 加载指示符 | `TemplateRef<void>` | - | |
27+
| `[nzSize]` | 组件大小 | `'large' \| 'small' \| 'default'` | `'default'` |
28+
| `[nzSpinning]` | 是否旋转 | `boolean` | `true` |
29+
| `[nzSimple]` | 是否包裹元素 | `boolean` | `false` |
30+
| `[nzTip]` | 当作为包裹元素时,可以自定义描述文案 | `string` | - |

components/spin/spin.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
import { Direction, Directionality } from '@angular/cdk/bidi';
7+
import { NgIf, NgTemplateOutlet } from '@angular/common';
78
import {
89
ChangeDetectorRef,
910
Component,
@@ -58,7 +59,9 @@ const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'spin';
5859
`,
5960
host: {
6061
'[class.ant-spin-nested-loading]': '!nzSimple'
61-
}
62+
},
63+
imports: [NgIf, NgTemplateOutlet],
64+
standalone: true
6265
})
6366
export class NzSpinComponent implements OnChanges, OnDestroy, OnInit {
6467
readonly _nzModuleName: NzConfigKey = NZ_CONFIG_MODULE_NAME;

components/spin/spin.module.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
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 { ObserversModule } from '@angular/cdk/observers';
8-
import { CommonModule } from '@angular/common';
96
import { NgModule } from '@angular/core';
107

118
import { NzSpinComponent } from './spin.component';
129

1310
@NgModule({
14-
exports: [NzSpinComponent],
15-
declarations: [NzSpinComponent],
16-
imports: [BidiModule, CommonModule, ObserversModule]
11+
imports: [NzSpinComponent],
12+
exports: [NzSpinComponent]
1713
})
1814
export class NzSpinModule {}

0 commit comments

Comments
 (0)