From 07ec60ddea4fc279fd26a70e85640da0d89a8eb0 Mon Sep 17 00:00:00 2001 From: Bill Erickson <berickxx@gmail.com> Date: Mon, 26 Nov 2018 18:20:47 +0000 Subject: [PATCH] LP1803787 Grid toolbar action separators 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> --- .../src/eg2/src/app/share/grid/grid-toolbar-action.component.ts | 2 ++ Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html | 6 +++++- Open-ILS/src/eg2/src/app/share/grid/grid.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts index 2cab7f9a20..7901035139 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts @@ -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) { diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html index 0de7ede362..a5aa235400 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html @@ -45,11 +45,15 @@ <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> diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.ts index b133d1ad13..ae611875c3 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts @@ -1028,6 +1028,7 @@ export class GridToolbarAction { group: string; disabled: boolean; isGroup: boolean; // used for group placeholder entries + separator: boolean; disableOnRows: (rows: any[]) => boolean; } -- 2.11.0