@bulmil/core
Version:

74 lines (73 loc) • 1.8 kB
JavaScript
/*!
* Bulmil - MIT License
*/
import { h } from '@stencil/core';
export class Modal {
constructor() {
this.handleCloseButtonClick = () => {
this.isActive = false;
};
this.isActive = false;
this.hasModalCard = false;
}
render() {
return (h("div", { class: {
modal: true,
'is-active': this.isActive,
} }, h("div", { class: "modal-background" }), h("div", { class: {
'modal-content': !this.hasModalCard,
'modal-card': this.hasModalCard,
} }, h("slot", null)), h("button", { slot: "close", class: "modal-close is-large", "aria-label": "close", onClick: this.handleCloseButtonClick })));
}
static get is() { return "bm-modal"; }
static get originalStyleUrls() {
return {
"$": ["modal.scss"]
};
}
static get styleUrls() {
return {
"$": ["modal.css"]
};
}
static get properties() {
return {
"isActive": {
"type": "boolean",
"mutable": true,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Is Active"
},
"attribute": "is-active",
"reflect": true,
"defaultValue": "false"
},
"hasModalCard": {
"type": "boolean",
"mutable": false,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Modal Card"
},
"attribute": "has-modal-card",
"reflect": false,
"defaultValue": "false"
}
};
}
}