mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
* upgrade to HttpClient * upgrade to Renderer2 * upgrade Document reference * remove useless test with deprecated ReflectiveInjector * upgrade to latest typescript * upgrade libs * upgrade package scripts * remove rxjs blacklists and duplicate rules * add rxjs compat to help with migration * fix breaking changes * fix breaking changes in material * fix breaking changes (material 6) * upgrade rxjs, ngx-translate and flex layout * update unit tests * restore providers * upgrade deprecated Observable.error * rebase fix first configuration problems * fix style issues commented * fix core build * fix lib template errors * move lib test execution in angular.json * ignore * karma conf files * fix import statement test * single run option * update packages reporter * restore report * increase timeout * improve karma conf test configuration * fix test issues about lint * fix test analytics * fix process service test * content service fix test * fix logout directive test * fix core test * fix build * update node-sass to latest * update angular cli dependencies * improve build script create directorites and move files only if previous command succeded * upgrade individual libs to 6.0 * remove old webpack files * revert sass change * fix type issues fix style issues * fix tslint demo shell issue * fix peerdependencies * fix test e2e BC * package upate * fix style import issue * extract-text-webpack-plugin beta * fix test dist build command * remove alpha js-api * fix tslint issue add banner tslint rule * upload service fix * change BC script * fix test dist script * increase demo shell timeout test * verbose copy * path absolute * fix script bc * fix copy part * fix path warning fix monaco editor * remove duplicate header * remove unused import * fix align and check ago tests * add missing import * fix notification button selector * [ANGULAR6] fixed core tests * fix CS test * fix cs test step 2 * increase travis_wait for dist * fix attachment PS * fix checklist test * use pdf min
83 lines
3.8 KiB
HTML
83 lines
3.8 KiB
HTML
<div class="adf-search-container">
|
|
<div *ngIf="isLoggedIn()" [@transitionMessages]="subscriptAnimationState"
|
|
(@transitionMessages.done)="applySearchFocus($event)">
|
|
<button mat-icon-button
|
|
*ngIf="expandable"
|
|
id="adf-search-button"
|
|
class="adf-search-button"
|
|
[title]="'SEARCH.BUTTON.TOOLTIP' | translate"
|
|
(click)="toggleSearchBar()"
|
|
(keyup.enter)="toggleSearchBar()">
|
|
<mat-icon [attr.aria-label]="'SEARCH.BUTTON.ARIA-LABEL' | translate">search</mat-icon>
|
|
</button>
|
|
<mat-form-field class="adf-input-form-field-divider">
|
|
<input matInput
|
|
#searchInput
|
|
[attr.aria-label]="'SEARCH.INPUT.ARIA-LABEL' | translate"
|
|
[attr.type]="inputType"
|
|
[autocomplete]="getAutoComplete()"
|
|
id="adf-control-input"
|
|
[(ngModel)]="searchTerm"
|
|
(focus)="activateToolbar()"
|
|
(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 #search
|
|
#auto="searchAutocomplete"
|
|
class="adf-search-result-autocomplete"
|
|
[maxResults]="liveSearchMaxResults"
|
|
[queryBody]="customQueryBody">
|
|
<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}}"
|
|
[attr.data-automation-id]="'autocomplete_for_' + item.entry.name"
|
|
[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)"
|
|
(touchend)="elementClicked(item)">
|
|
<!-- This is a comment -->
|
|
<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">
|
|
<ng-content
|
|
selector="adf-empty-search-result"
|
|
*ngIf="isNoSearchTemplatePresent() else defaultNoResult">
|
|
</ng-content>
|
|
<ng-template #defaultNoResult>
|
|
<p mat-line class="adf-search-fixed-text">{{ 'SEARCH.RESULTS.NONE' | translate:{searchTerm:
|
|
searchTerm} }}</p>
|
|
</ng-template>
|
|
</mat-list-item>
|
|
</mat-list>
|
|
</ng-template>
|
|
</adf-search>
|