@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: 'd72cb11e07eb2ddce3705c3503e6a9f6091776a5' }, h("div", { key: '81f98d9f7fc78612e5b288589f840930535a31e7', class: "tag-status" }, h("div", { key: '17aae4217a9da721799bfa3c2aac6e05ef9842d4', class: {
icon: true,
[`icon--state-${this.state}`]: true
} }, h("kv-icon", { key: '8f170ee4dbfcc8d6c226fca238fa30eed2d8b4d0', name: this.icon, exportparts: "icon" })), !isEmpty(this.label) && (h("div", { key: '4fce98332e117953001903f04099454e39910c65', 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
}
};
}
}