import { MDCDialog } from "@material/dialog";
import { h } from "@stencil/core";
export class NKDialog {
  constructor() {
    this.dialogTitle = '';
    this.open = false;
    this.buttonText = 'Confirm';
  }
  componentDidLoad() {
    this.dialog = new MDCDialog(this.container);
    if (this.open) {
      this.dialog.open();
    }
  }
  componentDidUpdate() {
    if (this.open) {
      this.dialog.open();
    }
  }
  render() {
    return (h("div", { class: "mdc-dialog", ref: (el) => (this.container = el) }, h("div", { class: "mdc-dialog__container" }, h("div", { class: "mdc-dialog__surface", role: "alertdialog", "aria-modal": "true", "aria-labelledby": "my-dialog-title", "aria-describedby": "my-dialog-content" }, this.dialogTitle.length > 0 && (h("h2", { class: "mdc-dialog__title", id: "my-dialog-title" }, this.dialogTitle)), h("div", { class: "mdc-dialog__content", id: "my-dialog-content" }, h("slot", null)), h("div", { class: "mdc-dialog__actions" }, h("button", { type: "button", class: "mdc-button mdc-dialog__button", "data-mdc-dialog-action": "discard" }, h("div", { class: "mdc-button__ripple" }), h("span", { class: "mdc-button__label" }, this.buttonText))))), h("div", { class: "mdc-dialog__scrim" })));
  }
  static get is() { return "nk-dialog"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() {
    return {
      "$": ["nk-dialog.scss"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["nk-dialog.css"]
    };
  }
  static get properties() {
    return {
      "dialogTitle": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "dialog-title",
        "reflect": false,
        "defaultValue": "''"
      },
      "open": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "open",
        "reflect": false,
        "defaultValue": "false"
      },
      "buttonText": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "button-text",
        "reflect": false,
        "defaultValue": "'Confirm'"
      }
    };
  }
}
//# sourceMappingURL=nk-dialog.js.map
