bruno-ui
Version:
Bruno UI Kit
58 lines (57 loc) • 1.65 kB
JavaScript
import { h } from "@stencil/core";
export class ColumnComponent {
render() {
this._el.style.width = `${this.CalculateWidth()}%`;
return (h("div", null,
h("slot", null)));
}
CalculateWidth() {
return this.total > 0 && this.columns > 0
? (this.columns * 100) / this.total
: 0;
}
static get is() { return "brn-column"; }
static get originalStyleUrls() { return {
"$": ["column.component.scss"]
}; }
static get styleUrls() { return {
"$": ["column.component.css"]
}; }
static get properties() { return {
"columns": {
"type": "number",
"mutable": false,
"complexType": {
"original": "number",
"resolved": "number",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "columns",
"reflect": false
},
"total": {
"type": "number",
"mutable": false,
"complexType": {
"original": "number",
"resolved": "number",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "total",
"reflect": false
}
}; }
static get elementRef() { return "_el"; }
}