@salla.sa/twilight-components
Version:
Salla Web Component
51 lines (47 loc) • 2.44 kB
JavaScript
/*!
* Crafted with ❤ by Salla
*/
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
const sallaListTileCss = "";
const SallaListTile = /*@__PURE__*/ proxyCustomElement(class SallaListTile extends HTMLElement {
constructor() {
super();
this.__registerHost();
/**
* 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: 'bb33776d01406ff1e04bbdc741312f1a17ac3b7b' }, h("a", { key: '386b417c954bf4b2bac34e40d9bae19db7f61ec3', class: this.generateClass(), href: this.href || "#", target: this.target, "aria-label": "List Tile Link" }, h("div", { key: 'cbcd8c6f92a4cbe7afbd8797c36ae6f529abed1c', class: "s-list-tile-item-icon" }, h("slot", { key: 'bff76fdb467b2491f0c3b40bd7f475eda23fa9c8', name: 'icon' })), h("div", { key: 'c80e7c032abedea8d5929d8bb36a642336724fe1', class: "s-list-tile-item-content" }, h("div", { key: '2bea0273bb4c012e0f9f7ee948b14bc9ea8afc2a', class: "s-list-tile-item-title" }, h("slot", { key: '60c872b9ec9b369ba65452abad7860b3ba6ba640', name: 'title' })), h("div", { key: 'fbb1b6e49284c74f2933f056aa16fcbc25526703', class: "s-list-tile-item-subtitle" }, h("slot", { key: '5ad1bba1b71db13d4deb594ccb0f5898f24d2f23', name: "subtitle" }))), h("div", { key: '96358bf7ed34907a799efd8c6fb2caae6ca02f43', class: "s-list-tile-item-action" }, h("slot", { key: '8d496724103f0c3959845c8f5d4e662a3095c09e', name: 'action' })))));
}
static get style() { return sallaListTileCss; }
}, [4, "salla-list-tile", {
"href": [1],
"target": [1]
}]);
function defineCustomElement() {
if (typeof customElements === "undefined") {
return;
}
const components = ["salla-list-tile"];
components.forEach(tagName => { switch (tagName) {
case "salla-list-tile":
if (!customElements.get(tagName)) {
customElements.define(tagName, SallaListTile);
}
break;
} });
}
defineCustomElement();
export { SallaListTile as S, defineCustomElement as d };