UNPKG

@digix-ui/dialog

Version:

Stencil Component Starter

178 lines (177 loc) 5.6 kB
import { Component, Prop, h, Method } from '@stencil/core'; import DialogUtils from './utils.js'; export class DxDialog { constructor() { this.dialogUtils = new DialogUtils(); this.textoBotaoSalvar = 'Salvar'; this.textoBotaoCancelar = 'Cancelar'; this.tamanho = 'medio'; } async fechar() { this.dialogUtils.fecharDialogo(); } async abrir() { this.dialogUtils.mostrarDialogo(this.idDialogo); } render() { return (h("div", { class: `dialogo dialogo_${this.tamanho}`, id: this.idDialogo }, h("div", { class: "dialogo__container" }, h("div", { class: "dialogo__cabecalho" }, h("h2", { class: "dialogo__titulo" }, this.titulo), h("p", { class: "dialogo__subtitulo" }, this.descricao)), h("div", { class: "dialogo__corpo" }, h("slot", { name: "conteudo" })), h("div", { class: "dialogo__rodape" }, h("slot", { name: "rodape" })), h("button", { class: "dialogo__botao-fechar", type: "button", onClick: () => this.fechar(), "aria-label": "Fechar di\u00E1logo" }, h("i", { class: "far fa-times", "aria-label": "hidden" }))))); } static get is() { return "dx-dialog"; } static get originalStyleUrls() { return { "$": ["./style.scss"] }; } static get styleUrls() { return { "$": ["style.css"] }; } static get properties() { return { "titulo": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "titulo", "reflect": false }, "descricao": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "descricao", "reflect": false }, "idDialogo": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "id-dialogo", "reflect": false }, "textoBotaoSalvar": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "texto-botao-salvar", "reflect": false, "defaultValue": "'Salvar'" }, "textoBotaoCancelar": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "texto-botao-cancelar", "reflect": false, "defaultValue": "'Cancelar'" }, "tamanho": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "tamanho", "reflect": false, "defaultValue": "'medio'" } }; } static get methods() { return { "fechar": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global" } }, "return": "Promise<void>" }, "docs": { "text": "", "tags": [] } }, "abrir": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global" } }, "return": "Promise<void>" }, "docs": { "text": "", "tags": [] } } }; } }