@kelvininc/ui-components
Version:
Kelvin UI Components
143 lines (142 loc) • 5.04 kB
JavaScript
import { Host, h } from "@stencil/core";
export class KvTimePickerSelectOption {
constructor() {
/** @inheritdoc */
this.selected = false;
this.onItemClick = () => {
this.itemSelected.emit(this.value);
};
}
render() {
return (h(Host, { key: '7f62a8510634b1eff4535512d3bb2b1c316a90a3' }, h("div", { key: 'd2e483e533a97fe88deadd559c91f853cdfd2074', class: {
'select-option': true,
'selected': this.selected
}, onClick: this.onItemClick }, h("div", { key: '6e16b68eb42a675684099a0fc55edf4567007074', class: "text-container" }, h("div", { key: '6cf98b835e0902838c47dc8581586d91f5757329', class: "item-label" }, this.label), h("div", { key: '949d759df54a9a539612290fafa3bb709b387ebb', class: "item-description" }, this.description)))));
}
static get is() { return "kv-time-picker-select-option"; }
static get encapsulation() { return "shadow"; }
static get originalStyleUrls() {
return {
"$": ["time-picker-select-option.scss"]
};
}
static get styleUrls() {
return {
"$": ["time-picker-select-option.css"]
};
}
static get properties() {
return {
"label": {
"type": "string",
"attribute": "label",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": true,
"optional": false,
"docs": {
"tags": [{
"name": "inheritdoc",
"text": undefined
}],
"text": "(required) The text to display on the item"
},
"getter": false,
"setter": false,
"reflect": true
},
"description": {
"type": "string",
"attribute": "description",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": true,
"docs": {
"tags": [{
"name": "inheritdoc",
"text": undefined
}],
"text": "(optional) The description of the text displayed"
},
"getter": false,
"setter": false,
"reflect": true
},
"value": {
"type": "string",
"attribute": "value",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": true,
"optional": false,
"docs": {
"tags": [{
"name": "inheritdoc",
"text": undefined
}],
"text": "(required) The item value"
},
"getter": false,
"setter": false,
"reflect": true
},
"selected": {
"type": "boolean",
"attribute": "selected",
"mutable": false,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": true,
"docs": {
"tags": [{
"name": "inheritdoc",
"text": undefined
}],
"text": "(optional) If `true` the item is selected"
},
"getter": false,
"setter": false,
"reflect": true,
"defaultValue": "false"
}
};
}
static get events() {
return [{
"method": "itemSelected",
"name": "itemSelected",
"bubbles": true,
"cancelable": true,
"composed": true,
"docs": {
"tags": [{
"name": "inheritdoc",
"text": undefined
}],
"text": "Emitted when the user clicks on the item"
},
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
}
}];
}
}