@bulmil/core
Version:

192 lines (191 loc) • 6.54 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: '90d25d64a89bb9f25427fee01d726d298abeb457', class: {
control: true,
'has-icons-left': Boolean(this.icon),
[this.controlClass]: Boolean(this.controlClass),
} }, h("div", { key: 'f7ca616bd2c6ae3da41410abc7b9a6570dd93696', 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: 'b795679b37bdb3d2fa041752f00059e9686a237e', multiple: this.isMultiple, class: {
[this.state]: Boolean(this.state),
} }, h("slot", { key: '20db1a512295e48e8fd8d71cd3fb766a6da89f90' }))), Boolean(this.icon) && (h("span", { class: {
icon: true,
'is-left': true,
[this.size]: Boolean(this.size),
} }, h("i", { 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
}
};
}
}