@kelvininc/ui-components
Version:
Kelvin UI Components
108 lines (107 loc) • 4.04 kB
JavaScript
import { Host, h } from "@stencil/core";
import { isEmpty } from "lodash-es";
/**
* @part label - The label element.
*/
export class KvTagStatus {
render() {
return (h(Host, { key: '7bae64f67b6da6b2964aa1e0b6f21e77d99f2499' }, h("div", { key: '60c08c5b865f04e3235979b20cb866ec3d66b956', class: "tag-status" }, h("div", { key: '436a030d498c89fc1eef85584398b2dbf5a0ba90', class: {
icon: true,
[`icon--state-${this.state}`]: true
} }, h("kv-icon", { key: '0c581ced88ff24c71469c0dcb4f5c133a9b76cb1', name: this.icon, exportparts: "icon" })), !isEmpty(this.label) && (h("div", { key: '7c73bfe2a3ec90b0fc8700696167f9015dcb9adc', class: "label", part: "label" }, this.label)))));
}
static get is() { return "kv-tag-status"; }
static get encapsulation() { return "shadow"; }
static get originalStyleUrls() {
return {
"$": ["tag-status.scss"]
};
}
static get styleUrls() {
return {
"$": ["tag-status.css"]
};
}
static get properties() {
return {
"state": {
"type": "string",
"attribute": "state",
"mutable": false,
"complexType": {
"original": "ETagState",
"resolved": "ETagState.Error | ETagState.Info | ETagState.Success | ETagState.Unknown | ETagState.Warning",
"references": {
"ETagState": {
"location": "import",
"path": "./tag-status.types",
"id": "src/components/tag-status/tag-status.types.ts::ETagState"
}
}
},
"required": true,
"optional": false,
"docs": {
"tags": [{
"name": "inheritdoc",
"text": undefined
}],
"text": "(required) Defines the color of the icon."
},
"getter": false,
"setter": false,
"reflect": true
},
"icon": {
"type": "string",
"attribute": "icon",
"mutable": false,
"complexType": {
"original": "EIconName",
"resolved": "EIconName",
"references": {
"EIconName": {
"location": "import",
"path": "../icon/icon.types",
"id": "src/components/icon/icon.types.ts::EIconName"
}
}
},
"required": true,
"optional": false,
"docs": {
"tags": [{
"name": "inheritdoc",
"text": undefined
}],
"text": "(required) Defines the icon to be displayed."
},
"getter": false,
"setter": false,
"reflect": true
},
"label": {
"type": "string",
"attribute": "label",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": true,
"docs": {
"tags": [{
"name": "inheritdoc",
"text": undefined
}],
"text": "(optional) Defines the content of the label."
},
"getter": false,
"setter": false,
"reflect": true
}
};
}
}