Skip to content

Commit 66a88db

Browse files
feat(module:timeline): allow custom color (#8335)
* feat(module:timeline): allow custom color pick * feat(module:timeline): allow custom color pick
1 parent b050474 commit 66a88db

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ Timeline
4242

4343
Node of timeline
4444

45-
| Property | Description | Type | Default |
46-
| -------------- | ---------------------------------------------------------------- | ----------------------------- | ------- |
47-
| `[nzColor]` | Set the circle's color to `'blue' \| 'red' \| 'green' \| 'gray'` | `string` | `blue` |
48-
| `[nzDot]` | Customize timeline dot | `string \| TemplateRef<void>` | - |
49-
| `[nzPosition]` | Customize position, only works when `nzMode` is `custom` | `'left' \| 'right'` | - |
50-
| `[nzLabel]` | Set the label | `string \| TemplateRef<void>` | - |
45+
| Property | Description | Type | Default |
46+
| -------------- | --------------------------------------------------------------------------------------- | ----------------------------- | ------- |
47+
| `[nzColor]` | Set the circle's color to `'blue' \| 'red' \| 'green' \| 'gray'` or other custom colors | `string` | `blue` |
48+
| `[nzDot]` | Customize timeline dot | `string \| TemplateRef<void>` | - |
49+
| `[nzPosition]` | Customize position, only works when `nzMode` is `custom` | `'left' \| 'right'` | - |
50+
| `[nzLabel]` | Set the label | `string \| TemplateRef<void>` | - |

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ import { NzTimelineModule } from 'ng-zorro-antd/timeline';
4343

4444
时间轴的每一个节点。
4545

46-
| 参数 | 说明 | 类型 | 默认值 |
47-
| -------------- | --------------------------------------------------- | ----------------------------- | ------ |
48-
| `[nzColor]` | 指定圆圈颜色 `'blue' \| 'red' \| 'green' \| 'gray'` | `string` | blue |
49-
| `[nzDot]` | 自定义时间轴点 | `string \| TemplateRef<void>` | - |
50-
| `[nzPosition]` | 自定义节点位置,仅当 `nzMode``custom` 时有效 | `'left' \| 'right'` | - |
51-
| `[nzLabel]` | 设置标签 | `string \| TemplateRef<void>` | - |
46+
| 参数 | 说明 | 类型 | 默认值 |
47+
| -------------- | ------------------------------------------------------------------ | ----------------------------- | ------ |
48+
| `[nzColor]` | 指定圆圈颜色 `'blue' \| 'red' \| 'green' \| 'gray'` 或自定义的色值 | `string` | blue |
49+
| `[nzDot]` | 自定义时间轴点 | `string \| TemplateRef<void>` | - |
50+
| `[nzPosition]` | 自定义节点位置,仅当 `nzMode``custom` 时有效 | `'left' \| 'right'` | - |
51+
| `[nzLabel]` | 设置标签 | `string \| TemplateRef<void>` | - |

components/timeline/typings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ export type NzTimelineMode = (typeof TimelineModes)[number];
99
const TimelinePositions = ['left', 'right'] as const;
1010
export type NzTimelinePosition = (typeof TimelinePositions)[number];
1111

12+
type NzCustomColor = string;
1213
export const TimelineTimeDefaultColors = ['red', 'blue', 'green', 'grey', 'gray'] as const;
13-
export type NzTimelineItemColor = (typeof TimelineTimeDefaultColors)[number];
14+
export type NzTimelineItemColor = (typeof TimelineTimeDefaultColors)[number] | NzCustomColor;

0 commit comments

Comments
 (0)