mirror of https://github.com/abpframework/abp.git
2 changed files with 80 additions and 49 deletions
@ -1,46 +1,64 @@ |
|||
<div class="abp-lookup-container position-relative"> |
|||
@if (label()) { |
|||
@if (label()) { |
|||
<label class="form-label">{{ label() | abpLocalization }}</label> |
|||
} |
|||
} |
|||
|
|||
<div class="input-group"> |
|||
<input type="text" class="form-control" [placeholder]="placeholder() | abpLocalization" |
|||
[ngModel]="displayValue()" (ngModelChange)="onSearchInput($event)" (focus)="onSearchFocus()" |
|||
(blur)="onSearchBlur($event)" [disabled]="disabled()" /> |
|||
@if (displayValue() && !disabled()) { |
|||
<button type="button" class="btn btn-outline-secondary" (mousedown)="clearSelection()" tabindex="-1"> |
|||
<i class="fa fa-times"></i> |
|||
</button> |
|||
} |
|||
</div> |
|||
<div class="input-group"> |
|||
<input |
|||
type="text" |
|||
class="form-control" |
|||
[placeholder]="placeholder() | abpLocalization" |
|||
[ngModel]="displayValue()" |
|||
(ngModelChange)="onSearchInput($event)" |
|||
(focus)="onSearchFocus()" |
|||
(blur)="onSearchBlur($event)" |
|||
[disabled]="disabled()" |
|||
/> |
|||
@if (displayValue() && !disabled()) { |
|||
<button |
|||
type="button" |
|||
class="btn btn-outline-secondary" |
|||
(mousedown)="clearSelection()" |
|||
tabindex="-1" |
|||
> |
|||
<i class="fa fa-times"></i> |
|||
</button> |
|||
} |
|||
</div> |
|||
|
|||
@if (showDropdown() && !disabled()) { |
|||
<div class="abp-lookup-dropdown list-group position-absolute w-100 shadow" |
|||
style="z-index: 1050; max-height: 200px; overflow-y: auto;"> |
|||
@if (isLoading()) { |
|||
@if (showDropdown() && !disabled()) { |
|||
<div |
|||
class="abp-lookup-dropdown list-group position-absolute w-100 shadow" |
|||
style="z-index: 1050; max-height: 200px; overflow-y: auto" |
|||
> |
|||
@if (isLoading()) { |
|||
<div class="list-group-item text-center py-3"> |
|||
<i class="fa fa-spinner fa-spin me-2"></i> |
|||
{{ 'AbpUi::Loading' | abpLocalization }} |
|||
<i class="fa fa-spinner fa-spin me-2"></i> |
|||
{{ 'AbpUi::Loading' | abpLocalization }} |
|||
</div> |
|||
} @else if (searchResults().length > 0) { |
|||
} @else if (searchResults().length > 0) { |
|||
@for (item of searchResults(); track item.key) { |
|||
<button type="button" class="list-group-item list-group-item-action" (mousedown)="selectItem(item)"> |
|||
<button |
|||
type="button" |
|||
class="list-group-item list-group-item-action" |
|||
(mousedown)="selectItem(item)" |
|||
> |
|||
@if (itemTemplate()) { |
|||
<ng-container *ngTemplateOutlet="itemTemplate()!; context: { $implicit: item }"></ng-container> |
|||
<ng-container *ngTemplateOutlet="itemTemplate()!; context: { $implicit: item }" /> |
|||
} @else { |
|||
{{ getDisplayValue(item) }} |
|||
{{ getDisplayValue(item) }} |
|||
} |
|||
</button> |
|||
</button> |
|||
} |
|||
} @else if (displayValue()) { |
|||
} @else if (displayValue()) { |
|||
@if (noResultsTemplate()) { |
|||
<ng-container *ngTemplateOutlet="noResultsTemplate()!"></ng-container> |
|||
<ng-container *ngTemplateOutlet="noResultsTemplate()!" /> |
|||
} @else { |
|||
<div class="list-group-item text-muted"> |
|||
<div class="list-group-item text-muted"> |
|||
{{ 'AbpUi::NoRecordsFound' | abpLocalization }} |
|||
</div> |
|||
} |
|||
</div> |
|||
} |
|||
} |
|||
</div> |
|||
} |
|||
</div> |
|||
} |
|||
</div> |
|||
|
|||
@ -1,28 +1,41 @@ |
|||
<div class="d-grid gap-2 mb-3 d-md-flex justify-content-md-end"> |
|||
<button class="btn btn-sm btn-primary" type="button" (click)="addClicked.emit()"> |
|||
<i class="fa fa-plus me-1"></i> |
|||
{{ 'AbpPermissionManagement::AddResourcePermission' | abpLocalization }} |
|||
</button> |
|||
<button class="btn btn-sm btn-primary" type="button" (click)="addClicked.emit()"> |
|||
<i class="fa fa-plus me-1"></i> |
|||
{{ 'AbpPermissionManagement::AddResourcePermission' | abpLocalization }} |
|||
</button> |
|||
</div> |
|||
|
|||
<ng-template #actionsTemplate let-row> |
|||
<div class="btn-group btn-group-sm" role="group"> |
|||
<button class="btn btn-outline-primary" type="button" (click)="editClicked.emit(row)" |
|||
[title]="'AbpUi::Edit' | abpLocalization"> |
|||
<i class="fa fa-edit"></i> |
|||
</button> |
|||
<button class="btn btn-outline-danger" type="button" (click)="deleteClicked.emit(row)" |
|||
[title]="'AbpUi::Delete' | abpLocalization"> |
|||
<i class="fa fa-trash"></i> |
|||
</button> |
|||
</div> |
|||
<div class="btn-group btn-group-sm" role="group"> |
|||
<button |
|||
class="btn btn-outline-primary" |
|||
type="button" |
|||
(click)="editClicked.emit(row)" |
|||
[title]="'AbpUi::Edit' | abpLocalization" |
|||
> |
|||
<i class="fa fa-edit"></i> |
|||
</button> |
|||
<button |
|||
class="btn btn-outline-danger" |
|||
type="button" |
|||
(click)="deleteClicked.emit(row)" |
|||
[title]="'AbpUi::Delete' | abpLocalization" |
|||
> |
|||
<i class="fa fa-trash"></i> |
|||
</button> |
|||
</div> |
|||
</ng-template> |
|||
|
|||
@if (state.resourcePermissions().length > 0) { |
|||
<abp-extensible-table [data]="state.resourcePermissions()" [recordsTotal]="state.totalCount()" [list]="list" |
|||
[actionsTemplate]="actionsTemplate" actionsText="AbpUi::Actions"></abp-extensible-table> |
|||
<abp-extensible-table |
|||
[data]="state.resourcePermissions()" |
|||
[recordsTotal]="state.totalCount()" |
|||
[list]="list" |
|||
[actionsTemplate]="actionsTemplate" |
|||
actionsText="AbpUi::Actions" |
|||
/> |
|||
} @else { |
|||
<div class="alert alert-info"> |
|||
<div class="alert alert-info"> |
|||
{{ 'AbpPermissionManagement::NoPermissionsAssigned' | abpLocalization }} |
|||
</div> |
|||
} |
|||
</div> |
|||
} |
|||
|
|||
Loading…
Reference in new issue