mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
remove componentHandler.upgradeAllRegistered
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
<form (submit)="onSearch($event)">
|
<form (submit)="onSearch($event)">
|
||||||
<div [class]="getTextFieldClassName()">
|
<div [class]="getTextFieldClassName()">
|
||||||
<label *ngIf="expandable" class="mdl-button mdl-js-button mdl-button--icon" for="searchControl">
|
<label *ngIf="expandable" class="mdl-button mdl-js-button mdl-button--icon" for="searchControl">
|
||||||
<i class="material-icons">search</i>
|
<i mdl-upgrade class="material-icons">search</i>
|
||||||
</label>
|
</label>
|
||||||
<div [class]="getTextFieldHolderClassName()">
|
<div [class]="getTextFieldHolderClassName()">
|
||||||
<input class="mdl-textfield__input" [type]="inputType" [autocomplete]="getAutoComplete()" data-automation-id="search_input"
|
<input mdl-upgrade class="mdl-textfield__input" [type]="inputType" [autocomplete]="getAutoComplete()" data-automation-id="search_input"
|
||||||
#searchInput id="searchControl" [ngFormControl]="searchControl" [(ngModel)]="searchTerm" (focus)="onFocus($event)"
|
#searchInput id="searchControl" [ngFormControl]="searchControl" [(ngModel)]="searchTerm" (focus)="onFocus($event)"
|
||||||
(blur)="onBlur($event)" aria-labelledby="searchLabel">
|
(blur)="onBlur($event)" aria-labelledby="searchLabel">
|
||||||
<label id="searchLabel" class="mdl-textfield__label" for="searchControl">{{'SEARCH.CONTROL.LABEL' | translate}}</label>
|
<label id="searchLabel" class="mdl-textfield__label" for="searchControl">{{'SEARCH.CONTROL.LABEL' | translate}}</label>
|
||||||
|
@@ -16,25 +16,22 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Control, Validators } from '@angular/common';
|
import { Control, Validators } from '@angular/common';
|
||||||
import { Component, Input, Output, ElementRef, EventEmitter, AfterViewInit, ViewChild } from '@angular/core';
|
import { Component, Input, Output, ElementRef, EventEmitter, ViewChild } from '@angular/core';
|
||||||
import { AlfrescoPipeTranslate, AlfrescoTranslationService } from 'ng2-alfresco-core';
|
import { AlfrescoPipeTranslate, AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||||
import { AlfrescoSearchAutocompleteComponent } from './alfresco-search-autocomplete.component';
|
import { AlfrescoSearchAutocompleteComponent } from './alfresco-search-autocomplete.component';
|
||||||
import { SearchTermValidator } from './../forms/search-term-validator';
|
import { SearchTermValidator } from './../forms/search-term-validator';
|
||||||
|
|
||||||
declare let __moduleName: string;
|
declare let __moduleName: string;
|
||||||
declare var componentHandler: any;
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
moduleId: __moduleName,
|
moduleId: __moduleName,
|
||||||
selector: 'alfresco-search-control',
|
selector: 'alfresco-search-control',
|
||||||
styles: [
|
|
||||||
],
|
|
||||||
templateUrl: './alfresco-search-control.component.html',
|
templateUrl: './alfresco-search-control.component.html',
|
||||||
styleUrls: ['./alfresco-search-control.component.css'],
|
styleUrls: ['./alfresco-search-control.component.css'],
|
||||||
directives: [AlfrescoSearchAutocompleteComponent],
|
directives: [AlfrescoSearchAutocompleteComponent],
|
||||||
pipes: [AlfrescoPipeTranslate]
|
pipes: [AlfrescoPipeTranslate]
|
||||||
})
|
})
|
||||||
export class AlfrescoSearchControlComponent implements AfterViewInit {
|
export class AlfrescoSearchControlComponent {
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
searchTerm = '';
|
searchTerm = '';
|
||||||
@@ -77,21 +74,15 @@ export class AlfrescoSearchControlComponent implements AfterViewInit {
|
|||||||
|
|
||||||
this.searchControl.valueChanges.map(value => this.searchControl.valid ? value : '')
|
this.searchControl.valueChanges.map(value => this.searchControl.valid ? value : '')
|
||||||
.debounceTime(400).distinctUntilChanged().subscribe(
|
.debounceTime(400).distinctUntilChanged().subscribe(
|
||||||
(value: string) => {
|
(value: string) => {
|
||||||
this.autocompleteSearchTerm = value;
|
this.autocompleteSearchTerm = value;
|
||||||
this.searchValid = this.searchControl.valid;
|
this.searchValid = this.searchControl.valid;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
translate.addTranslationFolder('node_modules/ng2-alfresco-search/dist/src');
|
translate.addTranslationFolder('node_modules/ng2-alfresco-search/dist/src');
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
|
||||||
if (componentHandler) {
|
|
||||||
componentHandler.upgradeAllRegistered();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getTextFieldClassName(): string {
|
getTextFieldClassName(): string {
|
||||||
return 'mdl-textfield mdl-js-textfield' + (this.expandable ? ' mdl-textfield--expandable' : '');
|
return 'mdl-textfield mdl-js-textfield' + (this.expandable ? ' mdl-textfield--expandable' : '');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user