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: '0839f257631eb37be76a13f42d33374e64a1fe83' }, h("div", { key: '61ba30e1d78acfbeb95fc871e99a4efa95c58bc4', class: "background-overlay", onClick: e => this.handleDismiss(e) }, h("div", { key: 'b40c16f7bf527685959ad228a17ee8eedb364450', class: "dialog" }, h("div", { key: '11e283a9f70b537351f39b77b7cee64d5fa49fe1', class: "close-button", onClick: () => this.exit.emit() }, h("svg", { key: '00749c1c583c287757cb726c6217ad628dea0e49', width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '45f2216bd40c5fd265d406daefbc6a775477b6b9', d: "M18 6L6 18", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { key: '6e7ceadce6c3635d4332e3dbb70521fc086bf6e4', d: "M6 6L18 18", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("slot", { key: '1ac770d584d3e4d15217478e5a6800ce60a33435', name: "heading" }, h("div", { key: 'e2f4b368d1bbf301b0e8851b314ccc0d50fe5913', class: "heading" })), h("slot", { key: '6d35c3af3bc2377a62caa8f51c1739f28df4507b', name: "content" }, h("div", { key: '1131fd3d9d286da0334574aeccdb11851283b974', class: "content" })), h("slot", { key: '3a053aee5523a8bddb8e309e3375c1009cd9410c', name: "footer" }, h("div", { key: '8b7b186b3d4833006f87c9fb177d44c785e35867', 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
