Skip to content

Commit

Permalink
chore(module:divider): sync style with antd (#3627)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenqi73 authored and vthinkxie committed Jun 22, 2019
1 parent ade1abd commit 0b234d6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/divider/divider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('divider', () => {
});

describe('#nzOrientation', () => {
['left', 'right'].forEach(type => {
['center', 'left', 'right'].forEach(type => {
it(`with ${type}`, () => {
context.nzOrientation = type;
fixture.detectChanges();
Expand Down
2 changes: 1 addition & 1 deletion components/divider/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ import { NzDividerModule } from 'ng-zorro-antd/divider';
| `[nzDashed]` | whether line is dasded | `boolean` | `false` |
| `[nzType]` | direction type of divider | `'horizontal' \| 'vertical'` | `'horizontal'` |
| `[nzText]` | inner text of divider | `string \| TemplateRef<void>` | - |
| `[nzOrientation]` | inner text orientation | `'left' \| 'right'` | - |
| `[nzOrientation]` | inner text orientation | `'center' \| 'left' \| 'right'` | `'center'` |
2 changes: 1 addition & 1 deletion components/divider/doc/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ import { NzDividerModule } from 'ng-zorro-antd/divider';
| `[nzDashed]` | 是否虚线 | `boolean` | `false` |
| `[nzType]` | 水平还是垂直类型 | `'horizontal' \| 'vertical'` | `'horizontal'` |
| `[nzText]` | 中间文字 | `string \| TemplateRef<void>` | - |
| `[nzOrientation]` | 中间文字方向 | `'left' \| 'right'` | - |
| `[nzOrientation]` | 中间文字方向 | `'center' \| 'left' \| 'right'` | `'center'` |
5 changes: 2 additions & 3 deletions components/divider/nz-divider.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ import { InputBoolean, NzUpdateHostClassService } from 'ng-zorro-antd/core';
export class NzDividerComponent implements OnChanges, OnInit {
@Input() nzText: string | TemplateRef<void>;
@Input() nzType: 'horizontal' | 'vertical' = 'horizontal';
@Input() nzOrientation: 'left' | 'right' | '' = '';
@Input() nzOrientation: 'left' | 'right' | 'center' = 'center';
@Input() @InputBoolean() nzDashed = false;

private setClass(): void {
const orientationPrefix = this.nzOrientation.length > 0 ? '-' + this.nzOrientation : this.nzOrientation;
this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, {
['ant-divider']: true,
[`ant-divider-${this.nzType}`]: true,
[`ant-divider-with-text${orientationPrefix}`]: this.nzText,
[`ant-divider-with-text-${this.nzOrientation}`]: this.nzText,
[`ant-divider-dashed`]: this.nzDashed
});
}
Expand Down

0 comments on commit 0b234d6

Please sign in to comment.