LP1803787 Grid toolbar action separators
authorBill Erickson <berickxx@gmail.com>
Mon, 26 Nov 2018 18:20:47 +0000 (18:20 +0000)
committerJane Sandberg <sandbej@linnbenton.edu>
Mon, 17 Jun 2019 21:20:56 +0000 (14:20 -0700)
Add support for "separator" toolbar actions so the action menu may be
divided into groups.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts
Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html
Open-ILS/src/eg2/src/app/share/grid/grid.ts

index 2cab7f9..7901035 100644 (file)
@@ -35,6 +35,8 @@ export class GridToolbarActionComponent implements OnInit {
     // (default behavior), the action will be enabled.
     @Input() disableOnRows: (rows: any[]) => boolean;
 
+    // If true, render a separator bar only, no action link.
+    @Input() separator: boolean;
 
     // get a reference to our container grid.
     constructor(@Host() private grid: GridComponent) {
index 0de7ede..a5aa235 100644 (file)
         <ng-container *ngIf="action.isGroup">
           <span class="ml-2 font-weight-bold font-italic">{{action.label}}</span>
         </ng-container>
+        <ng-container *ngIf="action.separator">
+          <div class="dropdown-divider"></div>
+        </ng-container>
         <ng-container *ngIf="action.group && !action.isGroup">
           <!-- grouped entries are indented -->
           <span class="ml-4">{{action.label}}</span>
         </ng-container>
-        <ng-container *ngIf="!action.group && !action.isGroup">
+        <ng-container 
+          *ngIf="!action.group && !action.isGroup && !action.separator">
           <span class="ml-2">{{action.label}}</span>
         </ng-container>
       </button>
index b133d1a..ae61187 100644 (file)
@@ -1028,6 +1028,7 @@ export class GridToolbarAction {
     group: string;
     disabled: boolean;
     isGroup: boolean; // used for group placeholder entries
+    separator: boolean;
     disableOnRows: (rows: any[]) => boolean;
 }