import dndod from './dndod';
export class Dialog {
    constructor() {
        this.index = 0;
        this.confirmLabel = 'Ok';
        this.cancelLabel = 'Cancel';
        this.continueLabel = 'Yes';
        this.allowClose = true;
    }
    getOptions() {
        return {
            confirmLabel: this.confirmLabel,
            cancelLabel: this.cancelLabel,
            continueLabel: this.continueLabel,
            allowClose: this.allowClose,
            disableCloseBtn: !this.allowClose,
            enableHTML: true,
            hostElement: this.host
        };
    }
    async popup(options = {}) {
        options = Object.assign(options, this.getOptions());
        dndod.popup(options);
    }
    async notice(msg = "", options = {}) {
        options = Object.assign(options, this.getOptions());
        dndod.notice(msg, options);
    }
    async alert(msg = "", options = {}) {
        options = Object.assign(options, this.getOptions());
        dndod.alert(msg, options);
    }
    ;
    async confirm(msg = "", calllback = this.dialogConfirmHandler, options = {}) {
        options = Object.assign(options, this.getOptions());
        dndod.confirm(msg, calllback, options);
    }
    async setConfirmHandler(callBackHandler) {
        this.dialogConfirmHandler = callBackHandler;
    }
    dialogConfirmHandler() {
        if (this && this.dialogConfirmCallback) {
            this.dialogConfirmCallback();
        }
    }
    render() {
        return (h("div", null));
    }
    static get is() { return "ema-dialog"; }
    static get properties() { return {
        "alert": {
            "method": true
        },
        "allowClose": {
            "type": Boolean,
            "attr": "allow-close"
        },
        "cancelLabel": {
            "type": String,
            "attr": "cancel-label"
        },
        "confirm": {
            "method": true
        },
        "confirmLabel": {
            "type": String,
            "attr": "confirm-label"
        },
        "continueLabel": {
            "type": String,
            "attr": "continue-label"
        },
        "host": {
            "elementRef": true
        },
        "index": {
            "state": true
        },
        "notice": {
            "method": true
        },
        "popup": {
            "method": true
        },
        "setConfirmHandler": {
            "method": true
        }
    }; }
    static get style() { return "/**style-placeholder:ema-dialog:**/"; }
}
