import { h, Host } from "@stencil/core";
/**
 * Display a simple dialog where the contents are provided via slots.
 */
export class VerdocsDialog {
    constructor() {
        /**
         * If true, clicking on the background overlay will not close the dialog.
         */
        this.persistent = false;
    }
    // We need a separate event handler for clicking the background because it can
    // receive events "through" other child components
    handleDismiss(e) {
        var _a;
        if (this.persistent) {
            return;
        }
        if (e.target.className === 'background-overlay') {
            e.preventDefault();
            (_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit();
        }
    }
    render() {
        return (h(Host, { key: 'c0bbf9d0b98ef1edb56c78fcde37efed3095f3e7' }, h("div", { key: '79064bfe3d7f35ebcd1dbcf68d917a939c962fcb', class: "background-overlay", onClick: e => this.handleDismiss(e) }, h("div", { key: 'cdd2c2bf76710306ff3ca1c2fa34932cdb2229ad', class: "dialog" }, h("div", { key: '7216dee5318fddbca48b051292f10672d0346659', class: "close-button", onClick: () => this.exit.emit() }, h("svg", { key: '8c910737a56f46a23fc16e8e9bbddeeb1ca3825f', width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '0473a116470924f7b7cf2dc4cc9600e596f615aa', d: "M18 6L6 18", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { key: '39eb283bee004b3590b649fdc52dc1333e9d8c72', d: "M6 6L18 18", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("slot", { key: 'd58ae6e6d88facd46e68e539379119debd3f2a6f', name: "heading" }, h("div", { key: '7407b12ddad232179a11e4ca576833e479d07cfa', class: "heading" })), h("slot", { key: 'efd98513e2295661a456a01c8ea8b4367c927843', name: "content" }, h("div", { key: '3b2dcd5b11c51e05fe83777fe98d7fd61d77a6ec', class: "content" })), h("slot", { key: 'f2346f379e1ec745acdded3874b79ecca57e6d16', name: "footer" }, h("div", { key: 'd0290f63c01e38ef6df7339cc0c36b56044fb34a', class: "footer" }))))));
    }
    static get is() { return "verdocs-dialog"; }
    static get originalStyleUrls() {
        return {
            "$": ["verdocs-dialog.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["verdocs-dialog.css"]
        };
    }
    static get properties() {
        return {
            "persistent": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If true, clicking on the background overlay will not close the dialog."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "persistent",
                "defaultValue": "false"
            }
        };
    }
    static get events() {
        return [{
                "method": "exit",
                "name": "exit",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Event fired when the dialog is dismissed by clicking the background overlay."
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=verdocs-dialog.js.map
