-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dropdown): provide focus out event (#836)
* feat(dropdown): provide focus out event api * feat(multi-select): provide focus out event api * feat(dropdown): add focus out example * Update dropdown.md * docs(dropdown): change description Co-authored-by: [email protected] <[email protected]>
- Loading branch information
1 parent
747b314
commit eccc424
Showing
7 changed files
with
67 additions
and
0 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
Empty file.
24 changes: 24 additions & 0 deletions
24
...aquila/documentation/examples/dropdown/dropdown-focus-out/dropdown-focus-out-example.html
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,24 @@ | ||
<form [formGroup]="form"> | ||
<div nxLayout="grid"> | ||
<div nxRow> | ||
<div nxCol="12,12,6"> | ||
<nx-formfield nxLabel="Car brand"> | ||
<nx-dropdown | ||
formControlName="dropdown" | ||
(focusOut)="onFocusOut()" | ||
(focus)="onFocus()" | ||
> | ||
<nx-dropdown-item>CLEAR VALUE</nx-dropdown-item> | ||
<nx-dropdown-item nxValue="BMW"></nx-dropdown-item> | ||
<nx-dropdown-item nxValue="Audi"></nx-dropdown-item> | ||
<nx-dropdown-item nxValue="Volvo"></nx-dropdown-item> | ||
<nx-dropdown-item nxValue="Mini"></nx-dropdown-item> | ||
</nx-dropdown> | ||
<nx-message nxContext="info" nxFormfieldNote> | ||
Focusing: {{focusing}} | ||
</nx-message> | ||
</nx-formfield> | ||
</div> | ||
</div> | ||
</div> | ||
</form> |
26 changes: 26 additions & 0 deletions
26
...g-aquila/documentation/examples/dropdown/dropdown-focus-out/dropdown-focus-out-example.ts
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,26 @@ | ||
import { Component } from '@angular/core'; | ||
import { UntypedFormBuilder } from '@angular/forms'; | ||
|
||
/** | ||
* @title Focus out example | ||
*/ | ||
@Component({ | ||
selector: 'dropdown-focus-out-example', | ||
templateUrl: './dropdown-focus-out-example.html', | ||
styleUrls: ['./dropdown-focus-out-example.css'], | ||
}) | ||
export class DropdownFocusOutExampleComponent { | ||
form = new UntypedFormBuilder().group({ | ||
dropdown: ['BMW'], | ||
}); | ||
|
||
focusing = false; | ||
|
||
onFocusOut() { | ||
this.focusing = false; | ||
} | ||
|
||
onFocus() { | ||
this.focusing = true; | ||
} | ||
} |
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