mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
@@ -166,6 +166,7 @@ bootstrap(SearchDemo, [
|
||||
**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 />
|
||||
**expandable** {boolean} (optional) default true. Whether to use an expanding search control, if false then a regular input is used.
|
||||
**autocomplete** {boolean} (optional) default true. Whether the browser should offer field auto-completion for the input field to the user.
|
||||
|
||||
### Search results
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<i class="material-icons">search</i>
|
||||
</label>
|
||||
<div [class]="getTextFieldHolderClassName()">
|
||||
<input class="mdl-textfield__input" [type]="inputType" id="searchTerm" [ngFormControl]="searchControl" [(ngModel)]="searchTerm">
|
||||
<input class="mdl-textfield__input" [type]="inputType" [autocomplete]="getAutoComplete()" id="searchTerm" [ngFormControl]="searchControl" [(ngModel)]="searchTerm">
|
||||
<label class="mdl-textfield__label" for="searchTerm">Search content</label>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -38,6 +38,9 @@ export class AlfrescoSearchControlComponent {
|
||||
@Input()
|
||||
inputType = 'text';
|
||||
|
||||
@Input()
|
||||
autocomplete: boolean = true;
|
||||
|
||||
@Input()
|
||||
expandable: boolean = true;
|
||||
|
||||
@@ -67,6 +70,10 @@ export class AlfrescoSearchControlComponent {
|
||||
return this.expandable ? ' mdl-textfield__expandable-holder' : '';
|
||||
}
|
||||
|
||||
getAutoComplete(): string {
|
||||
return this.autocomplete ? 'on' : 'off';
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called on form submit, i.e. when the user has hit enter
|
||||
*
|
||||
|
Reference in New Issue
Block a user