mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
* [ADF-2002] added arrow up and down feature * [ADF-2002] fixed search bar animation and added arrow support * [ADF-2002] added some test for arrow manage
69 lines
3.0 KiB
HTML
69 lines
3.0 KiB
HTML
<div class="adf-search-container">
|
|
<div *ngIf="isLoggedIn()" [@transitionMessages]="subscriptAnimationState">
|
|
<a mat-icon-button
|
|
*ngIf="expandable"
|
|
id="adf-search-button"
|
|
class="adf-search-button"
|
|
(click)="toggleSearchBar($event)"
|
|
(keyup.enter)="toggleSearchBar($event)">
|
|
<mat-icon aria-label="search button">search</mat-icon>
|
|
</a>
|
|
<mat-form-field class="adf-input-form-field-divider">
|
|
<input matInput
|
|
#inputSearch
|
|
[type]="inputType"
|
|
[autocomplete]="getAutoComplete()"
|
|
id="adf-control-input"
|
|
[(ngModel)]="searchTerm"
|
|
(focus)="activateToolbar($event)"
|
|
(blur)="onBlur($event)"
|
|
(keyup.escape)="toggleSearchBar()"
|
|
(keyup.arrowdown)="selectFirstResult()"
|
|
(ngModelChange)="inputChange($event)"
|
|
[searchAutocomplete]="auto"
|
|
(keyup.enter)="searchSubmit($event)">
|
|
</mat-form-field>
|
|
</div>
|
|
</div>
|
|
|
|
<adf-search #auto="searchAutocomplete"
|
|
class="adf-search-result-autocomplete"
|
|
[searchNode]="customSearchNode"
|
|
[maxResults]="liveSearchMaxResults">
|
|
<ng-template let-data>
|
|
<mat-list *ngIf="isSearchBarActive()" id="autocomplete-search-result-list">
|
|
<mat-list-item
|
|
*ngFor="let item of data?.list?.entries; let idx = index"
|
|
id="result_option_{{idx}}"
|
|
[tabindex]="0"
|
|
(focus)="onFocus($event)"
|
|
(blur)="onBlur($event)"
|
|
(keyup.arrowdown)="onRowArrowDown($event)"
|
|
(keyup.arrowup)="onRowArrowUp($event)"
|
|
class="adf-search-autocomplete-item"
|
|
(click)="elementClicked(item)"
|
|
(keyup.enter)="elementClicked(item)">
|
|
<mat-icon mat-list-icon>
|
|
<img [src]="getMimeTypeIcon(item)" />
|
|
</mat-icon>
|
|
<h4 mat-line id="result_name_{{idx}}"
|
|
*ngIf="highlight; else elseBlock"
|
|
class="adf-search-fixed-text"
|
|
[innerHtml]="item.entry.name | highlight: searchTerm">
|
|
{{ item?.entry.name }}
|
|
</h4>
|
|
<ng-template #elseBlock>
|
|
<h4 class="adf-search-fixed-text" mat-line id="result_name_{{idx}}" [innerHtml]="item.entry.name"></h4>
|
|
</ng-template>
|
|
<p mat-line class="adf-search-fixed-text"> {{item?.entry.createdByUser.displayName}} </p>
|
|
</mat-list-item>
|
|
<mat-list-item
|
|
id="search_no_result"
|
|
data-automation-id="search_no_result_found"
|
|
*ngIf="data?.list?.entries.length === 0">
|
|
<p mat-line class="adf-search-fixed-text">{{ 'SEARCH.RESULTS.NONE' | translate:{searchTerm: searchTerm} }}</p>
|
|
</mat-list-item>
|
|
</mat-list>
|
|
</ng-template>
|
|
</adf-search>
|