From 459793ec6fb163e4f2ac9ac82cb7163657de07c4 Mon Sep 17 00:00:00 2001 From: Wendell Date: Mon, 5 Aug 2019 09:39:26 +0800 Subject: [PATCH 1/2] feat(module:descriptions): add nzColon to toggle colon --- components/descriptions/doc/index.en-US.md | 1 + components/descriptions/doc/index.zh-CN.md | 1 + components/descriptions/nz-descriptions.component.html | 4 ++-- components/descriptions/nz-descriptions.component.ts | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/descriptions/doc/index.en-US.md b/components/descriptions/doc/index.en-US.md index 47e367886a5..ab8accc7215 100644 --- a/components/descriptions/doc/index.en-US.md +++ b/components/descriptions/doc/index.en-US.md @@ -29,6 +29,7 @@ import { NzDescriptionsModule } from 'ng-zorro-antd/descriptions'; | `[nzBordered]` | Whether to display the border | `boolean` | `false` | | `[nzColumn]` | The number of `nz-descriptions-item` in a row. It could be a number or a object like `{ xs: 8, sm: 16, md: 24}` | `number\|object` | `{ xxl: 3, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }` | | `[nzSize]` | Set the size of the list. Only works when `nzBordered` is set | `'default' \| 'middle' \| 'small'` | `'default'` | +| `[nzColon]` | Show colon after title | `boolean` | `true` | ### nz-descriptions-item diff --git a/components/descriptions/doc/index.zh-CN.md b/components/descriptions/doc/index.zh-CN.md index 78ff5182a89..b2c735ac9d5 100644 --- a/components/descriptions/doc/index.zh-CN.md +++ b/components/descriptions/doc/index.zh-CN.md @@ -30,6 +30,7 @@ import { NzDescriptionsModule } from 'ng-zorro-antd/descriptions'; | `[nzBorderer]` | 是否展示边框 | `boolean` | `false` | | `[nzColumn]` | 一行的 `nz-descriptions-item` 的数量,可以写成像素值或支持响应式的对象写法 `{ xs: 8, sm: 16, md: 24}` | `number\|object` | `{ xxl: 3, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }` | | `[nzSize]` | 设置列表的大小(只有设置 `nzBordered` 时生效) | `'default' \| 'middle' \| 'small'` | `'default'` | +| `[nzColon]` | 在标题后显示冒号 | `boolean` | `true` | ### nz-descriptions-item diff --git a/components/descriptions/nz-descriptions.component.html b/components/descriptions/nz-descriptions.component.html index c94004b4705..090bd9ff4ac 100644 --- a/components/descriptions/nz-descriptions.component.html +++ b/components/descriptions/nz-descriptions.component.html @@ -10,7 +10,7 @@ - + {{ item.title }} @@ -34,7 +34,7 @@ - + {{ item.title }} diff --git a/components/descriptions/nz-descriptions.component.ts b/components/descriptions/nz-descriptions.component.ts index 1a49c5dfb2c..1aa1d4f75c9 100644 --- a/components/descriptions/nz-descriptions.component.ts +++ b/components/descriptions/nz-descriptions.component.ts @@ -67,6 +67,7 @@ export class NzDescriptionsComponent implements OnChanges, OnDestroy, AfterConte @Input() nzColumn: number | { [key in Breakpoint]: number } = defaultColumnMap; @Input() nzSize: NzDescriptionsSize = 'default'; @Input() nzTitle: string | TemplateRef = ''; + @Input() @InputBoolean() nzColon: boolean = true; itemMatrix: NzDescriptionsItemRenderProps[][] = []; From aac803adf284c0e2b492eb0162d526aad8fc3ebb Mon Sep 17 00:00:00 2001 From: Wendell Date: Tue, 6 Aug 2019 13:08:13 +0800 Subject: [PATCH 2/2] feat: add styles --- .../nz-descriptions.component.html | 30 ++++++++++++------- components/descriptions/style/index.less | 6 ++++ .../progress/nz-progress.component.html | 2 +- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/components/descriptions/nz-descriptions.component.html b/components/descriptions/nz-descriptions.component.html index 090bd9ff4ac..6f3bcee4d72 100644 --- a/components/descriptions/nz-descriptions.component.html +++ b/components/descriptions/nz-descriptions.component.html @@ -6,12 +6,15 @@ - + - - + @@ -34,14 +39,17 @@ - - - - diff --git a/components/descriptions/style/index.less b/components/descriptions/style/index.less index c29fceae218..074522aa2db 100644 --- a/components/descriptions/style/index.less +++ b/components/descriptions/style/index.less @@ -47,6 +47,12 @@ position: relative; top: -0.5px; margin: 0 8px 0 2px; + content: ' '; + } + } + + &-item-colon { + &::after { content: ':'; } } diff --git a/components/progress/nz-progress.component.html b/components/progress/nz-progress.component.html index e28984bc8d5..3608367550c 100644 --- a/components/progress/nz-progress.component.html +++ b/components/progress/nz-progress.component.html @@ -44,7 +44,7 @@ class="ant-progress-inner" *ngIf="isCircleStyle" > - +
- {{ item.title }} + + {{ item.title }} @@ -19,8 +22,10 @@ - {{ item.title }} + {{ item.title }}
- {{ item.title }} + + {{ item.title }}
+ @@ -55,14 +63,16 @@
+ {{ item.title }}
+