radh-ui
Version:
Stencil Component Starter
49 lines (48 loc) • 1.45 kB
JavaScript
import { Component, Element, h, Method, State } from "@stencil/core";
export class RadhToast {
async launchToast(desc) {
this.desc = desc;
var toast = this.element.querySelector("#toast");
toast.className = "show";
setTimeout(function () {
toast.className = toast.className.replace("show", "");
}, 5000);
}
render() {
return (h("div", { id: "toast" },
h("div", { id: "img" }, "Icon"),
h("div", { id: "desc" }, this.desc)));
}
static get is() { return "radh-toast"; }
static get originalStyleUrls() { return {
"$": ["radh-toast.css"]
}; }
static get styleUrls() { return {
"$": ["radh-toast.css"]
}; }
static get states() { return {
"desc": {}
}; }
static get methods() { return {
"launchToast": {
"complexType": {
"signature": "(desc: string) => Promise<void>",
"parameters": [{
"tags": [],
"text": ""
}],
"references": {
"Promise": {
"location": "global"
}
},
"return": "Promise<void>"
},
"docs": {
"text": "",
"tags": []
}
}
}; }
static get elementRef() { return "element"; }
}