diff options
Diffstat (limited to 'client/src/app/shared/buttons/action-dropdown.component.ts')
-rw-r--r-- | client/src/app/shared/buttons/action-dropdown.component.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/buttons/action-dropdown.component.ts index a8b3ab16c..15f9556dc 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.ts +++ b/client/src/app/shared/buttons/action-dropdown.component.ts | |||
@@ -9,6 +9,7 @@ export type DropdownAction<T> = { | |||
9 | handler?: (a: T) => any | 9 | handler?: (a: T) => any |
10 | linkBuilder?: (a: T) => (string | number)[] | 10 | linkBuilder?: (a: T) => (string | number)[] |
11 | isDisplayed?: (a: T) => boolean | 11 | isDisplayed?: (a: T) => boolean |
12 | isHeader?: boolean | ||
12 | } | 13 | } |
13 | 14 | ||
14 | export type DropdownButtonSize = 'normal' | 'small' | 15 | export type DropdownButtonSize = 'normal' | 'small' |
@@ -26,6 +27,7 @@ export class ActionDropdownComponent<T> { | |||
26 | @Input() entry: T | 27 | @Input() entry: T |
27 | 28 | ||
28 | @Input() placement = 'bottom-left auto' | 29 | @Input() placement = 'bottom-left auto' |
30 | @Input() container: null | 'body' | ||
29 | 31 | ||
30 | @Input() buttonSize: DropdownButtonSize = 'normal' | 32 | @Input() buttonSize: DropdownButtonSize = 'normal' |
31 | @Input() buttonDirection: DropdownDirection = 'horizontal' | 33 | @Input() buttonDirection: DropdownDirection = 'horizontal' |
@@ -34,10 +36,10 @@ export class ActionDropdownComponent<T> { | |||
34 | @Input() label: string | 36 | @Input() label: string |
35 | @Input() theme: DropdownTheme = 'grey' | 37 | @Input() theme: DropdownTheme = 'grey' |
36 | 38 | ||
37 | getActions () { | 39 | getActions (): DropdownAction<T>[][] { |
38 | if (this.actions.length !== 0 && Array.isArray(this.actions[0])) return this.actions | 40 | if (this.actions.length !== 0 && Array.isArray(this.actions[0])) return this.actions as DropdownAction<T>[][] |
39 | 41 | ||
40 | return [ this.actions ] | 42 | return [ this.actions as DropdownAction<T>[] ] |
41 | } | 43 | } |
42 | 44 | ||
43 | areActionsDisplayed (actions: Array<DropdownAction<T> | DropdownAction<T>[]>, entry: T): boolean { | 45 | areActionsDisplayed (actions: Array<DropdownAction<T> | DropdownAction<T>[]>, entry: T): boolean { |