Add inputType option to search control component

This commit is contained in:
Will Abson
2016-06-01 16:33:54 +01:00
parent d3c7bacc0a
commit bf63eace1b
3 changed files with 7 additions and 2 deletions

View File

@@ -82,6 +82,7 @@ Also make sure you include these dependencies in your .html page:
```html
<alfresco-search-control [searchTerm]="searchTerm"
inputType="search"
(searchChange)="customMethod($event);">
</alfresco-search-control>
```
@@ -141,7 +142,8 @@ bootstrap(SearchDemo, [
#### Options
**searchTerm**: {string} optional) default "". Search term to pre-populate the field with<br />
**searchTerm**: {string} (optional) default "". Search term to pre-populate the field with<br />
**inputType**: {string} (optional) default "text". Type of the input field to render, e.g. "search" or "text" (default)<br />
### Search results

View File

@@ -4,7 +4,7 @@
<i class="material-icons">search</i>
</label>
<div class="mdl-textfield__expandable-holder">
<input class="mdl-textfield__input" type="text" id="searchTerm" [ngFormControl]="searchControl" [(ngModel)]="searchTerm">
<input class="mdl-textfield__input" [type]="inputType" id="searchTerm" [ngFormControl]="searchControl" [(ngModel)]="searchTerm">
<label class="mdl-textfield__label" for="searchTerm">Search content</label>
</div>
</div>

View File

@@ -35,6 +35,9 @@ export class AlfrescoSearchControlComponent {
@Input()
searchTerm = '';
@Input()
inputType = 'text';
@Output()
searchChange = new EventEmitter();