-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(module:divider): refactor divider (#4780)
- Loading branch information
Yadong Xie
authored
Feb 13, 2020
1 parent
7f1a76c
commit 51eb8bd
Showing
8 changed files
with
48 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* @license | ||
* Copyright Alibaba.com All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE | ||
*/ | ||
|
||
import { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewEncapsulation } from '@angular/core'; | ||
|
||
import { InputBoolean } from 'ng-zorro-antd/core'; | ||
|
||
@Component({ | ||
selector: 'nz-divider', | ||
exportAs: 'nzDivider', | ||
preserveWhitespaces: false, | ||
encapsulation: ViewEncapsulation.None, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
template: ` | ||
<span *ngIf="nzText" class="ant-divider-inner-text"> | ||
<ng-container *nzStringTemplateOutlet="nzText">{{ nzText }}</ng-container> | ||
</span> | ||
`, | ||
host: { | ||
'[class.ant-divider]': 'true', | ||
'[class.ant-divider-horizontal]': `nzType === 'horizontal'`, | ||
'[class.ant-divider-vertical]': `nzType === 'vertical'`, | ||
'[class.ant-divider-with-text-left]': `nzText && nzOrientation === 'left'`, | ||
'[class.ant-divider-with-text-right]': `nzText && nzOrientation === 'right'`, | ||
'[class.ant-divider-with-text-center]': `nzText && nzOrientation === 'center'`, | ||
'[class.ant-divider-dashed]': `nzDashed` | ||
} | ||
}) | ||
export class NzDividerComponent { | ||
@Input() nzText: string | TemplateRef<void>; | ||
@Input() nzType: 'horizontal' | 'vertical' = 'horizontal'; | ||
@Input() nzOrientation: 'left' | 'right' | 'center' = 'center'; | ||
@Input() @InputBoolean() nzDashed = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters