Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(module:descriptions): add nzColon to toggle colon #3923

Merged
merged 2 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/descriptions/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions components/descriptions/doc/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions components/descriptions/nz-descriptions.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ng-container *ngFor="let item of row; let isLast = last">
<!-- Horizontal & NOT Bordered -->
<ng-container *ngIf="!nzBordered">
<td class="ant-descriptions-item" [colSpan]="item.span">
<td class="ant-descriptions-item" [class.ant-descriptions-item-colon]="nzColon" [colSpan]="item.span">
<span class="ant-descriptions-item-label">{{ item.title }}</span>
<span class="ant-descriptions-item-content">
<ng-template [ngTemplateOutlet]="item.content"></ng-template>
Expand All @@ -34,7 +34,7 @@
<ng-container *ngFor="let row of itemMatrix; let i = index">
<tr class="ant-descriptions-row">
<ng-container *ngFor="let item of row; let isLast = last">
<td class="ant-descriptions-item" [colSpan]="item.span">
<td class="ant-descriptions-item" [class.ant-descriptions-item-colon]="nzColon" [colSpan]="item.span">
<span class="ant-descriptions-item-label">{{ item.title }}</span>
</td>
</ng-container>
Expand Down
1 change: 1 addition & 0 deletions components/descriptions/nz-descriptions.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> = '';
@Input() @InputBoolean() nzColon: boolean = true;
wzhudev marked this conversation as resolved.
Show resolved Hide resolved

itemMatrix: NzDescriptionsItemRenderProps[][] = [];

Expand Down