@salla.sa/twilight-components
Version:
Salla Web Component
88 lines (87 loc) • 3.77 kB
JavaScript
/*!
* Crafted with ❤ by Salla
*/
import { Host, h } from "@stencil/core";
/**
* @slot icon - An icon to display before the title.
* @slot title - The primary content of the list tile.
* @slot subtitle - Additional content displayed below the title.
* @slot action - An element to display after the title.
*/
export class SallaListTile {
constructor() {
/**
* Designates the component as anchor and applies the `href` attribute.
*/
this.href = undefined;
/**
* Designates the target attribute. This should only be applied when using the `href` prop.
*/
this.target = "_self";
}
generateClass() {
return {
"s-list-tile-item": true,
"s-list-tile-item-href": !!this.href
};
}
render() {
return (h(Host, { key: 'ae953ec0fc15f697f830dc9542a1c4a861bc8f82' }, h("a", { key: '9a49318ef335e13a762ce6179ab4aa5df7a08876', class: this.generateClass(), href: this.href, target: this.target }, h("div", { key: '120f667c5b4e275afb1e494d5faef09882afd918', class: "s-list-tile-item-icon" }, h("slot", { key: '35cc900e850702bb153ed30e7d4b3d0ee560016b', name: 'icon' })), h("div", { key: '9e2c2bba573f4782f67e875a3e0ebec3f57b9207', class: "s-list-tile-item-content" }, h("div", { key: '5c02e2355172a475291c42faf5bfdf2dce7d36be', class: "s-list-tile-item-title" }, h("slot", { key: '622075b1245b8afe52bd50539fe3d0ec5dfc3869', name: 'title' })), h("div", { key: '4bef105bcb3171e3b59e4d81db5605e06a08b7e1', class: "s-list-tile-item-subtitle" }, h("slot", { key: 'e9893b4967364b006105b788d1f81dbb71971495', name: "subtitle" }))), h("div", { key: '9c4e72e82af93219d26a4e08274394ee428d55a8', class: "s-list-tile-item-action" }, h("slot", { key: 'e2f54d79037820c10657f37e2c30619a39bd056b', name: 'action' })))));
}
static get is() { return "salla-list-tile"; }
static get originalStyleUrls() {
return {
"$": ["salla-list-tile.scss"]
};
}
static get styleUrls() {
return {
"$": ["salla-list-tile.css"]
};
}
static get properties() {
return {
"href": {
"type": "string",
"attribute": "href",
"mutable": false,
"complexType": {
"original": "string | undefined",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Designates the component as anchor and applies the `href` attribute."
},
"getter": false,
"setter": false,
"reflect": false,
"defaultValue": "undefined"
},
"target": {
"type": "string",
"attribute": "target",
"mutable": false,
"complexType": {
"original": "\"_blank\" | \"_self\" | \"_parent\" | \"_top\" | \"framename\"",
"resolved": "\"_blank\" | \"_parent\" | \"_self\" | \"_top\" | \"framename\"",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Designates the target attribute. This should only be applied when using the `href` prop."
},
"getter": false,
"setter": false,
"reflect": false,
"defaultValue": "\"_self\""
}
};
}
}
//# sourceMappingURL=salla-list-tile.js.map