all files / component/popup/model/ popup-action.model.ts

35% Statements 7/20
0% Branches 0/8
50% Functions 2/4
23.53% Lines 4/17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41                                                                         
/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
export class DejaPopupAction {
    public refreshDrawer = true;
    public isFinalAction = false;
    public panelClass?: string;
    public data?: any;
    public icon?: string;
    public label?: string;
 
    constructor(
        public name: string,
        public target?: string,
    ) {
        if (!this.icon) {
            this.icon = name;
        }
        if (!this.label) {
            this.label = name;
        }
    }
 
}
 
export class DejaPopupButton extends DejaPopupAction {
    constructor(
        public name: string,
        public label?: string,
        public icon?: string,
        public isFinalAction = true,
    ) {
        super(name);
    }
}