Skip to content

Commit

Permalink
docs(module:message,notification): update import usages (#8802)
Browse files Browse the repository at this point in the history
  • Loading branch information
HyperLife1119 authored Nov 20, 2024
1 parent 22ce17c commit f695882
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 104 deletions.
38 changes: 20 additions & 18 deletions components/message/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ Display global messages as feedback in response to user operations.
- A message is displayed at top and center and will be dismissed automatically, as a non-interrupting light-weighted prompt.

```ts
import { NzMessageModule } from 'ng-zorro-antd/message';
import { NzMessageService } from 'ng-zorro-antd/message';

private readonly message = inject(NzMessageService);
```

## API
Expand All @@ -29,18 +31,18 @@ This components provides some service methods, with usage and arguments as follo
- `NzMessageService.warning(content, [options])`
- `NzMessageService.loading(content, [options])`

| Argument | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| content | The content of message | `string \| TemplateRef<void>` | - |
| options | Support setting the parameters for the current message box, see the table below | `object` | - |
| Argument | Description | Type | Default |
| -------- | ------------------------------------------------------------------------------- | ----------------------------- | ------- |
| content | The content of message | `string \| TemplateRef<void>` | - |
| options | Support setting the parameters for the current message box, see the table below | `object` | - |

The parameters that are set by the `options` support are as follows:

| Argument | Description | Type |
| --- | --- | --- |
| nzDuration | Duration (milliseconds), does not disappear when set to 0 | `number` |
| nzPauseOnHover | Do not remove automatically when mouse is over while setting to `true` | `boolean` |
| nzAnimate | Whether to turn on animation | `boolean` |
| Argument | Description | Type |
| -------------- | ---------------------------------------------------------------------- | --------- |
| nzDuration | Duration (milliseconds), does not disappear when set to 0 | `number` |
| nzPauseOnHover | Do not remove automatically when mouse is over while setting to `true` | `boolean` |
| nzAnimate | Whether to turn on animation | `boolean` |

Methods for destruction are also provided:

Expand All @@ -50,14 +52,14 @@ Methods for destruction are also provided:

You can use `NzConfigService` to configure this component globally. Please check the [Global Configuration](/docs/global-config/en) chapter for more information.

| Argument | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| nzDuration | Duration (milliseconds), does not disappear when set to 0 | `number` | `3000` |
| nzMaxStack | The maximum number of messages that can be displayed at the same time | `number` | `7` |
| nzPauseOnHover | Do not remove automatically when mouse is over while setting to `true` | `boolean` | `true` |
| nzAnimate | Whether to turn on animation | `boolean` | `true` |
| nzTop | Distance from top | `number \| string` | `24` |
| nzDirection | Direction of the text in the messages | `'ltr' \| 'rtl'` | - |
| Argument | Description | Type | Default |
| -------------- | ---------------------------------------------------------------------- | ------------------ | ------- |
| nzDuration | Duration (milliseconds), does not disappear when set to 0 | `number` | `3000` |
| nzMaxStack | The maximum number of messages that can be displayed at the same time | `number` | `7` |
| nzPauseOnHover | Do not remove automatically when mouse is over while setting to `true` | `boolean` | `true` |
| nzAnimate | Whether to turn on animation | `boolean` | `true` |
| nzTop | Distance from top | `number \| string` | `24` |
| nzDirection | Direction of the text in the messages | `'ltr' \| 'rtl'` | - |

### NzMessageRef

Expand Down
40 changes: 21 additions & 19 deletions components/message/doc/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ cover: https://gw.alipayobjects.com/zos/alicdn/hAkKTIW0K/Message.svg
- 顶部居中显示并自动消失,是一种不打断用户操作的轻量级提示方式。

```ts
import { NzMessageModule } from 'ng-zorro-antd/message';
import { NzMessageService } from 'ng-zorro-antd/message';

private readonly message = inject(NzMessageService);
```

## API
Expand All @@ -30,18 +32,18 @@ import { NzMessageModule } from 'ng-zorro-antd/message';
- `NzMessageService.warning(content, [options])`
- `NzMessageService.loading(content, [options])`

| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| content | 提示内容 | `string \| TemplateRef<void>` | - |
| options | 支持设置针对当前提示框的参数,见下方表格 | `object` | - |
| 参数 | 说明 | 类型 | 默认值 |
| ------- | ---------------------------------------- | ----------------------------- | ------ |
| content | 提示内容 | `string \| TemplateRef<void>` | - |
| options | 支持设置针对当前提示框的参数,见下方表格 | `object` | - |

`options` 支持设置的参数如下:

| 参数 | 说明 | 类型 |
| --- | --- | --- |
| nzDuration | 持续时间(毫秒),当设置为0时不消失 | `number` |
| nzPauseOnHover | 鼠标移上时禁止自动移除 | `boolean` |
| nzAnimate | 开关动画效果 | `boolean` |
| 参数 | 说明 | 类型 |
| -------------- | --------------------------------- | --------- |
| nzDuration | 持续时间(毫秒),当设置为0时不消失 | `number` |
| nzPauseOnHover | 鼠标移上时禁止自动移除 | `boolean` |
| nzAnimate | 开关动画效果 | `boolean` |

还提供了全局销毁方法:

Expand All @@ -51,14 +53,14 @@ import { NzMessageModule } from 'ng-zorro-antd/message';

可以通过 `NzConfigService` 进行全局配置,详情请见文档中 [全局配置项](/docs/global-config/zh) 章节。

| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| nzDuration | 持续时间(毫秒),当设置为 0 时不消失 | `number` | `3000` |
| nzMaxStack | 同一时间可展示的最大提示数量 | `number` | `7` |
| nzPauseOnHover | 鼠标移上时禁止自动移除 | `boolean` | `true` |
| nzAnimate | 开关动画效果 | `boolean` | `true` |
| nzTop | 消息距离顶部的位置 | `number \| string` | `24` |
| nzDirection | 消息文字方向 | `'ltr' \| 'rtl'` | - |
| 参数 | 说明 | 类型 | 默认值 |
| -------------- | ----------------------------------- | ------------------ | ------ |
| nzDuration | 持续时间(毫秒),当设置为 0 时不消失 | `number` | `3000` |
| nzMaxStack | 同一时间可展示的最大提示数量 | `number` | `7` |
| nzPauseOnHover | 鼠标移上时禁止自动移除 | `boolean` | `true` |
| nzAnimate | 开关动画效果 | `boolean` | `true` |
| nzTop | 消息距离顶部的位置 | `number \| string` | `24` |
| nzDirection | 消息文字方向 | `'ltr' \| 'rtl'` | - |

### NzMessageRef

Expand All @@ -69,4 +71,4 @@ export interface NzMessageRef {
messageId: string;
onClose: Subject<false>; // 当 message 关闭时它会派发一个事件
}
```
```
3 changes: 3 additions & 0 deletions components/message/message.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { NgModule } from '@angular/core';
import { NzMessageContainerComponent } from './message-container.component';
import { NzMessageComponent } from './message.component';

/**
* @deprecated This module is no longer needed, will be removed in v20, please remove its import.
*/
@NgModule({
imports: [NzMessageContainerComponent, NzMessageComponent]
})
Expand Down
56 changes: 29 additions & 27 deletions components/notification/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ used in the following cases:
- A notification that is pushed by the application.

```ts
import { NzNotificationModule } from 'ng-zorro-antd/notification';
import { NzNotificationService } from 'ng-zorro-antd/notification';

private readonly notification = inject(NzNotificationService);
```

## API
Expand All @@ -34,25 +36,25 @@ The component provides a number of service methods using the following methods a
- `NzNotificationService.info(title, content, [options])`
- `NzNotificationService.warning(title, content, [options])`

| Argument | Description | Type | Default |
| --- | --- | --- | --- |
| title | Title | `string \| TemplateRef<void>` | - |
| content | Notification content | `string \| TemplateRef<void>` | - |
| options | Support setting the parameters for the current notification box, see the table below | `object` | - |
| Argument | Description | Type | Default |
| -------- | ------------------------------------------------------------------------------------ | ----------------------------- | ------- |
| title | Title | `string \| TemplateRef<void>` | - |
| content | Notification content | `string \| TemplateRef<void>` | - |
| options | Support setting the parameters for the current notification box, see the table below | `object` | - |

The parameters that are set by the `options` support are as follows:

| Argument | Description | Type |
| --- | --- | --- |
| nzKey | The unique identifier of the Notification | `string` |
| nzDuration | Duration (milliseconds), does not disappear when set to 0 | `number` |
| nzPauseOnHover | Do not remove automatically when mouse is over while setting to `true` | `boolean` |
| nzAnimate | Whether to turn on animation | `boolean` |
| nzStyle | Custom inline style | `object` |
| nzClass | Custom CSS class | `object` |
| nzData | Anything that would be used as template context | `any` |
| nzCloseIcon | Custom close icon | `TemplateRef<void> \| string` |
| nzButton | Custom button | `TemplateRef<{ $implicit: NzNotificationComponent }> \| string` |
| Argument | Description | Type |
| -------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------- |
| nzKey | The unique identifier of the Notification | `string` |
| nzDuration | Duration (milliseconds), does not disappear when set to 0 | `number` |
| nzPauseOnHover | Do not remove automatically when mouse is over while setting to `true` | `boolean` |
| nzAnimate | Whether to turn on animation | `boolean` |
| nzStyle | Custom inline style | `object` |
| nzClass | Custom CSS class | `object` |
| nzData | Anything that would be used as template context | `any` |
| nzCloseIcon | Custom close icon | `TemplateRef<void> \| string` |
| nzButton | Custom button | `TemplateRef<{ $implicit: NzNotificationComponent }> \| string` |

Methods for destruction are also provided:

Expand All @@ -62,16 +64,16 @@ Methods for destruction are also provided:

You can use `NzConfigService` to configure this component globally. Please check the [Global Configuration](/docs/global-config/en) chapter for more information.

| Parameter | Description | Type | Default |
| --- | --- | --- | --- |
| nzDuration | Duration (milliseconds), does not disappear when set to 0 | `number` | 4500 |
| nzMaxStack | The maximum number of notifications that can be displayed at the same time | `number` | 8 |
| nzPauseOnHover | Do not remove automatically when mouse is over while setting to `true` | `boolean` | `true` |
| nzAnimate | Whether to turn on animation | `boolean` | `true` |
| nzTop | The top of the notification when it pops up from the top. | `string` | 24px |
| nzBottom | The bottom of the notification when it pops up from the bottom. | `string` | 24px |
| nzPlacement | Popup position, optional `topLeft` `topRight` `bottomLeft` `bottomRight` `top` `bottom` | `string` | `topRight` |
| nzDirection | Direction of the text in the notification | `'ltr' \| 'rtl'` | - |
| Parameter | Description | Type | Default |
| -------------- | --------------------------------------------------------------------------------------- | ---------------- | ---------- |
| nzDuration | Duration (milliseconds), does not disappear when set to 0 | `number` | 4500 |
| nzMaxStack | The maximum number of notifications that can be displayed at the same time | `number` | 8 |
| nzPauseOnHover | Do not remove automatically when mouse is over while setting to `true` | `boolean` | `true` |
| nzAnimate | Whether to turn on animation | `boolean` | `true` |
| nzTop | The top of the notification when it pops up from the top. | `string` | 24px |
| nzBottom | The bottom of the notification when it pops up from the bottom. | `string` | 24px |
| nzPlacement | Popup position, optional `topLeft` `topRight` `bottomLeft` `bottomRight` `top` `bottom` | `string` | `topRight` |
| nzDirection | Direction of the text in the notification | `'ltr' \| 'rtl'` | - |

### NzNotificationRef

Expand Down
Loading

0 comments on commit f695882

Please sign in to comment.