Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module:input): support setting status (#7472)
* feat(module:input): support setting status * feat(module:input): add tests * feat(module:input): add tests for rtl * feat(module:input): move input group tests to correct spec file
- Loading branch information
1 parent
0d8249b
commit 999215e
Showing
9 changed files
with
239 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 13 | ||
title: | ||
zh-CN: 自定义状态 | ||
en-US: Status | ||
--- | ||
|
||
## zh-CN | ||
|
||
使用 `nzStatus` 为 Input 添加状态,可选 `error` 或者 `warning`。 | ||
|
||
## en-US | ||
|
||
Add status to Input with `nzStatus`, which could be `error` or `warning`. |
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,21 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-input-status', | ||
template: ` | ||
<nz-space nzDirection="vertical" style="width: 100%"> | ||
<input *nzSpaceItem nz-input placeholder="Error" [(ngModel)]="value" nzStatus="error" /> | ||
<input *nzSpaceItem nz-input placeholder="Warning" [(ngModel)]="value" nzStatus="warning" /> | ||
<nz-input-group *nzSpaceItem [nzPrefix]="prefixTemplateClock" nzStatus="error"> | ||
<input type="text" nz-input placeholder="Error with prefix" /> | ||
</nz-input-group> | ||
<nz-input-group *nzSpaceItem [nzPrefix]="prefixTemplateClock" nzStatus="warning"> | ||
<input type="text" nz-input placeholder="Warning with prefix" /> | ||
</nz-input-group> | ||
<ng-template #prefixTemplateClock><i nz-icon nzType="clock-circle" nzTheme="outline"></i></ng-template> | ||
</nz-space> | ||
` | ||
}) | ||
export class NzDemoInputStatusComponent { | ||
value?: string; | ||
} |
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
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
Oops, something went wrong.