mirror of https://github.com/abpframework/abp.git
3 changed files with 172 additions and 149 deletions
@ -1,45 +1,61 @@ |
|||||
<div class="abp-lookup-container position-relative"> |
<div class="abp-lookup-container position-relative"> |
||||
@if (label()) { |
@if (label()) { |
||||
<label class="form-label">{{ label() | abpLocalization }}</label> |
<label class="form-label">{{ label() | abpLocalization }}</label> |
||||
} |
} |
||||
|
|
||||
<div class="input-group"> |
<div class="input-group"> |
||||
<input type="text" class="form-control" [placeholder]="placeholder() | abpLocalization" [ngModel]="displayValue()" |
<input |
||||
(ngModelChange)="onSearchInput($event)" (focus)="onSearchFocus()" (blur)="onSearchBlur($event)" |
type="text" |
||||
[disabled]="disabled()" /> |
class="form-control" |
||||
|
[placeholder]="placeholder() | abpLocalization" |
||||
|
[ngModel]="displayValue()" |
||||
|
(ngModelChange)="onSearchInput($event)" |
||||
|
(focus)="onSearchFocus()" |
||||
|
(blur)="onSearchBlur($event)" |
||||
|
[disabled]="disabled()" |
||||
|
/> |
||||
@if (displayValue() && !disabled()) { |
@if (displayValue() && !disabled()) { |
||||
<button type="button" class="btn btn-outline-secondary" (mousedown)="clearSelection()" tabindex="-1"> |
<button |
||||
<i class="fa fa-times"></i> |
type="button" |
||||
</button> |
class="btn btn-outline-secondary" |
||||
|
(mousedown)="clearSelection()" |
||||
|
tabindex="-1" |
||||
|
> |
||||
|
<i class="fa fa-times"></i> |
||||
|
</button> |
||||
} |
} |
||||
</div> |
</div> |
||||
|
|
||||
@if (showDropdown() && !disabled()) { |
@if (showDropdown() && !disabled()) { |
||||
<div class="abp-lookup-dropdown list-group position-absolute w-100 shadow"> |
<div class="abp-lookup-dropdown list-group position-absolute w-100"> |
||||
@if (isLoading()) { |
@if (isLoading()) { |
||||
<div class="list-group-item text-center py-3"> |
<div class="list-group-item text-center py-3"> |
||||
<i class="fa fa-spinner fa-spin me-2"></i> |
<i class="fa fa-spinner fa-spin me-2"></i> |
||||
{{ 'AbpUi::Loading' | abpLocalization }} |
{{ 'AbpUi::Loading' | abpLocalization }} |
||||
</div> |
</div> |
||||
} @else if (searchResults().length > 0) { |
} @else if (searchResults().length > 0) { |
||||
@for (item of searchResults(); track item.key) { |
@for (item of searchResults(); track item.key) { |
||||
<button type="button" class="list-group-item list-group-item-action" (mousedown)="selectItem(item)"> |
<button |
||||
@if (itemTemplate()) { |
type="button" |
||||
<ng-container *ngTemplateOutlet="itemTemplate()!; context: { $implicit: item }" /> |
class="list-group-item list-group-item-action" |
||||
} @else { |
(mousedown)="selectItem(item)" |
||||
{{ getDisplayValue(item) }} |
> |
||||
|
@if (itemTemplate()) { |
||||
|
<ng-container *ngTemplateOutlet="itemTemplate()!; context: { $implicit: item }" /> |
||||
|
} @else { |
||||
|
{{ getDisplayValue(item) }} |
||||
|
} |
||||
|
</button> |
||||
|
} |
||||
|
} @else if (displayValue()) { |
||||
|
@if (noResultsTemplate()) { |
||||
|
<ng-container *ngTemplateOutlet="noResultsTemplate()!" /> |
||||
|
} @else { |
||||
|
<div class="list-group-item text-muted"> |
||||
|
{{ 'AbpUi::NoDataAvailableInDatatable' | abpLocalization }} |
||||
|
</div> |
||||
|
} |
||||
} |
} |
||||
</button> |
|
||||
} |
|
||||
} @else if (displayValue()) { |
|
||||
@if (noResultsTemplate()) { |
|
||||
<ng-container *ngTemplateOutlet="noResultsTemplate()!" /> |
|
||||
} @else { |
|
||||
<div class="list-group-item text-muted"> |
|
||||
{{ 'AbpUi::NoRecordsFound' | abpLocalization }} |
|
||||
</div> |
</div> |
||||
} |
|
||||
} |
|
||||
</div> |
|
||||
} |
} |
||||
</div> |
</div> |
||||
|
|||||
@ -1,5 +1,8 @@ |
|||||
.abp-lookup-dropdown { |
.abp-lookup-dropdown { |
||||
z-index: 1050; |
z-index: 1060; |
||||
max-height: 200px; |
max-height: 200px; |
||||
overflow-y: auto; |
overflow-y: auto; |
||||
|
top: 100%; |
||||
|
margin-top: 0.25rem; |
||||
|
background-color: var(--lpx-content-bg); |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue