@bulmil/core
Version:

192 lines (191 loc) • 6.63 kB
JavaScript
/*!
* Bulmil - MIT License
*/
import { h } from "@stencil/core";
export class Select {
constructor() {
this.controlClass = '';
this.color = undefined;
this.size = undefined;
this.state = undefined;
this.isMultiple = false;
this.isLoading = false;
this.isRounded = false;
this.icon = undefined;
}
render() {
return (h("div", { key: 'c9f90d1df4acd7f20b17814d50da76f7487df68a', class: {
control: true,
'has-icons-left': Boolean(this.icon),
[this.controlClass]: Boolean(this.controlClass),
} }, h("div", { key: '26e2304b8bc30ed43aa1bca8d43096973f5d3d0f', class: {
select: true,
[this.color]: Boolean(this.color),
[this.size]: Boolean(this.size),
'is-multiple': this.isMultiple,
'is-rounded': this.isRounded,
'is-loading': this.isLoading,
} }, h("select", { key: '9b4c64f3ec45c570057c4418576fddfb30a4178a', multiple: this.isMultiple, class: {
[this.state]: Boolean(this.state),
} }, h("slot", { key: 'fe34fe173d4f9f68b3458bf6269dd490c68550bf' }))), Boolean(this.icon) && (h("span", { key: '8ce00bf2e2bd31474e1adef9377875a354c570c2', class: {
icon: true,
'is-left': true,
[this.size]: Boolean(this.size),
} }, h("i", { key: '937d9c153c859afe26ef50101f188b7662b96d7d', class: this.icon })))));
}
static get is() { return "bm-select"; }
static get originalStyleUrls() {
return {
"$": ["select.scss"]
};
}
static get styleUrls() {
return {
"$": ["select.css"]
};
}
static get properties() {
return {
"controlClass": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Control classes"
},
"attribute": "control-class",
"reflect": false,
"defaultValue": "''"
},
"color": {
"type": "string",
"mutable": false,
"complexType": {
"original": "'is-primary' | 'is-info' | 'is-success' | 'is-warning' | 'is-danger'",
"resolved": "\"is-danger\" | \"is-info\" | \"is-primary\" | \"is-success\" | \"is-warning\"",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Color"
},
"attribute": "color",
"reflect": false
},
"size": {
"type": "string",
"mutable": false,
"complexType": {
"original": "'is-small' | 'is-normal' | 'is-medium' | 'is-large'",
"resolved": "\"is-large\" | \"is-medium\" | \"is-normal\" | \"is-small\"",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Size"
},
"attribute": "size",
"reflect": false
},
"state": {
"type": "string",
"mutable": false,
"complexType": {
"original": "'is-hovered' | 'is-focused'",
"resolved": "\"is-focused\" | \"is-hovered\"",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "State"
},
"attribute": "state",
"reflect": false
},
"isMultiple": {
"type": "boolean",
"mutable": false,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Allows multiple selection"
},
"attribute": "is-multiple",
"reflect": false,
"defaultValue": "false"
},
"isLoading": {
"type": "boolean",
"mutable": false,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Loading state"
},
"attribute": "is-loading",
"reflect": false,
"defaultValue": "false"
},
"isRounded": {
"type": "boolean",
"mutable": false,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Rounded"
},
"attribute": "is-rounded",
"reflect": false,
"defaultValue": "false"
},
"icon": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Icon"
},
"attribute": "icon",
"reflect": false
}
};
}
}