mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Rename dropdown type enum & add pass as variable to use like an Enum
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<div class="btn-group" ngbDropdown role="group" (openChange)="dropdownOpenChange($event)" #dropdown="ngbDropdown">
|
||||
<button class="btn btn-sm" id="dropdown{{title}}" ngbDropdownToggle [ngClass]="type !== 'actions' && itemsSelected?.length > 0 ? 'btn-primary' : 'btn-outline-primary'">
|
||||
<button class="btn btn-sm" id="dropdown{{title}}" ngbDropdownToggle [ngClass]="type !== types.Editing && itemsSelected?.length > 0 ? 'btn-primary' : 'btn-outline-primary'">
|
||||
<div class="d-none d-md-inline">{{title}}</div>
|
||||
<div class="d-inline-block d-md-none">
|
||||
<svg class="toolbaricon" fill="currentColor">
|
||||
<use attr.xlink:href="assets/bootstrap-icons.svg#{{icon}}" />
|
||||
</svg>
|
||||
</div>
|
||||
<ng-container *ngIf="type !== 'actions' && itemsSelected?.length > 0">
|
||||
<ng-container *ngIf="type !== types.Editing && itemsSelected?.length > 0">
|
||||
<div class="badge bg-secondary text-light rounded-pill badge-corner">
|
||||
{{itemsSelected?.length}}
|
||||
</div>
|
||||
|
@@ -19,7 +19,7 @@ export enum SelectableItemState {
|
||||
|
||||
export enum FilterableDropdownType {
|
||||
Filtering = 'filtering',
|
||||
Actions = 'actions'
|
||||
Editing = 'editing'
|
||||
}
|
||||
|
||||
@Component({
|
||||
@@ -47,7 +47,7 @@ export class FilterableDropdownComponent {
|
||||
|
||||
@Input()
|
||||
set selectableItems (selectableItems: SelectableItem[]) {
|
||||
if (this.type == FilterableDropdownType.Actions && this.dropdown?.isOpen()) return
|
||||
if (this.type == FilterableDropdownType.Editing && this.dropdown?.isOpen()) return
|
||||
else this._selectableItems = selectableItems
|
||||
}
|
||||
|
||||
@@ -75,6 +75,8 @@ export class FilterableDropdownComponent {
|
||||
@Input()
|
||||
type: FilterableDropdownType = FilterableDropdownType.Filtering
|
||||
|
||||
types = FilterableDropdownType
|
||||
|
||||
@Input()
|
||||
singular: boolean = false
|
||||
|
||||
|
Reference in New Issue
Block a user