Skip to content

Commit

Permalink
feat(module:timeline): allow custom color (#8335)
Browse files Browse the repository at this point in the history
* feat(module:timeline): allow custom color pick

* feat(module:timeline): allow custom color pick
  • Loading branch information
ParsaArvanehPA committed Jan 17, 2024
1 parent b050474 commit 66a88db
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
12 changes: 6 additions & 6 deletions components/timeline/doc/index.en-US.md
Expand Up @@ -42,9 +42,9 @@ Timeline

Node of timeline

| Property | Description | Type | Default |
| -------------- | ---------------------------------------------------------------- | ----------------------------- | ------- |
| `[nzColor]` | Set the circle's color to `'blue' \| 'red' \| 'green' \| 'gray'` | `string` | `blue` |
| `[nzDot]` | Customize timeline dot | `string \| TemplateRef<void>` | - |
| `[nzPosition]` | Customize position, only works when `nzMode` is `custom` | `'left' \| 'right'` | - |
| `[nzLabel]` | Set the label | `string \| TemplateRef<void>` | - |
| Property | Description | Type | Default |
| -------------- | --------------------------------------------------------------------------------------- | ----------------------------- | ------- |
| `[nzColor]` | Set the circle's color to `'blue' \| 'red' \| 'green' \| 'gray'` or other custom colors | `string` | `blue` |
| `[nzDot]` | Customize timeline dot | `string \| TemplateRef<void>` | - |
| `[nzPosition]` | Customize position, only works when `nzMode` is `custom` | `'left' \| 'right'` | - |
| `[nzLabel]` | Set the label | `string \| TemplateRef<void>` | - |
12 changes: 6 additions & 6 deletions components/timeline/doc/index.zh-CN.md
Expand Up @@ -43,9 +43,9 @@ import { NzTimelineModule } from 'ng-zorro-antd/timeline';

时间轴的每一个节点。

| 参数 | 说明 | 类型 | 默认值 |
| -------------- | --------------------------------------------------- | ----------------------------- | ------ |
| `[nzColor]` | 指定圆圈颜色 `'blue' \| 'red' \| 'green' \| 'gray'` | `string` | blue |
| `[nzDot]` | 自定义时间轴点 | `string \| TemplateRef<void>` | - |
| `[nzPosition]` | 自定义节点位置,仅当 `nzMode``custom` 时有效 | `'left' \| 'right'` | - |
| `[nzLabel]` | 设置标签 | `string \| TemplateRef<void>` | - |
| 参数 | 说明 | 类型 | 默认值 |
| -------------- | ------------------------------------------------------------------ | ----------------------------- | ------ |
| `[nzColor]` | 指定圆圈颜色 `'blue' \| 'red' \| 'green' \| 'gray'` 或自定义的色值 | `string` | blue |
| `[nzDot]` | 自定义时间轴点 | `string \| TemplateRef<void>` | - |
| `[nzPosition]` | 自定义节点位置,仅当 `nzMode``custom` 时有效 | `'left' \| 'right'` | - |
| `[nzLabel]` | 设置标签 | `string \| TemplateRef<void>` | - |
3 changes: 2 additions & 1 deletion components/timeline/typings.ts
Expand Up @@ -9,5 +9,6 @@ export type NzTimelineMode = (typeof TimelineModes)[number];
const TimelinePositions = ['left', 'right'] as const;
export type NzTimelinePosition = (typeof TimelinePositions)[number];

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

0 comments on commit 66a88db

Please sign in to comment.