-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d237269
commit 314df47
Showing
55 changed files
with
3,079 additions
and
3,256 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
88 changes: 34 additions & 54 deletions
88
demo/app/components/autocomplete/autocomplete.component.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 |
---|---|---|
@@ -1,61 +1,41 @@ | ||
<ts-card tsVerticalSpacing> | ||
<h3 tsCardTitle tsVerticalSpacing="small--0">Demo Controls</h3> | ||
|
||
<div tsVerticalSpacing> | ||
<ts-checkbox [(ngModel)]="delayApiResponse" tsVerticalSpacing> | ||
Delay API response | ||
</ts-checkbox> | ||
<ts-card tsVerticalSpacing fxFlex> | ||
<form | ||
novalidate | ||
fxLayout="column" | ||
fxLayout.gt-sm="row" | ||
fxLayoutGap="1rem" | ||
> | ||
<h3 tsCardTitle tsVerticalSpacing="small--1"> | ||
Autocomplete | ||
</h3> | ||
|
||
<div> | ||
<label> | ||
Minimum characters required: | ||
<input type="text" [(ngModel)]="minCharacters"> | ||
</label> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<button (click)="updateSelections()">Dynamically update selections</button> | ||
<br> | ||
<button (click)="log(myForm.value)">Log form value</button> | ||
</div> | ||
</ts-card> | ||
|
||
<ts-card> | ||
<form name="myForm" novalidate> | ||
<ts-autocomplete | ||
label="Autocomplete Example" | ||
hint="Begin typing to select.." | ||
[formControl]="stateCtrl" | ||
[allowMultiple]="true" | ||
[allowDuplicateSelections]="true" | ||
[reopenAfterSelection]="false" | ||
[showProgress]="fakeAsync" | ||
(queryChange)="queryHasChanged($event)" | ||
(duplicateSelection)="duplicate($event)" | ||
tsVerticalSpacing | ||
[options]="users$ | async" | ||
[selectionsControl]="myForm.get('selections')" | ||
[displayWith]="displayFn" | ||
[initialSelections]="null" | ||
[minimumCharacters]="minCharacters" | ||
[showProgress]="inProgress" | ||
label="Single selection" | ||
hint="Begin typing to search..." | ||
theme="primary" | ||
(optionSelected)="added($event)" | ||
(optionRemoved)="removed($event)" | ||
(selection)="selection($event)" | ||
#auto="tsAutocomplete" | ||
></ts-autocomplete> | ||
> | ||
|
||
<ts-autocomplete | ||
tsVerticalSpacing | ||
[options]="users$ | async" | ||
[selectionsControl]="myForm.get('selectionsMultiple')" | ||
[displayWith]="displayFn" | ||
[initialSelections]="null" | ||
[minimumCharacters]="minCharacters" | ||
[multiple]="comparator" | ||
[showProgress]="inProgress" | ||
label="Multiple selections" | ||
hint="Begin typing to search..." | ||
theme="primary" | ||
(optionSelected)="added($event)" | ||
(optionRemoved)="removed($event)" | ||
(selection)="selection($event)" | ||
#auto="tsAutocomplete" | ||
></ts-autocomplete> | ||
<ts-option | ||
[value]="state.name" | ||
[option]="state" | ||
*ngFor="let state of filteredStates | async" | ||
> | ||
{{ state.name }} | ||
</ts-option> | ||
|
||
</ts-autocomplete> | ||
|
||
<div> | ||
FormControl value: {{ stateCtrl.value | json }} | ||
</div> | ||
</form> | ||
</ts-card> | ||
|
Oops, something went wrong.