@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: 'e1528afcea1eda05a5ce206e95791e7611d24dd0' }, h("a", { key: '749a73c76d68ad36f1a6609ada69778662d56566', class: this.generateClass(), href: this.href || "#", target: this.target, "aria-label": "List Tile Link" }, h("div", { key: '7bfd448f86790b2afe0b7a5b8a5460c3b2be66ee', class: "s-list-tile-item-icon" }, h("slot", { key: '383e28a8832483e8ecc61e4f48a3ff1fe5db1038', name: 'icon' })), h("div", { key: 'c42bf126a9ff4014a4e2d85ff12b41d1a88a0e03', class: "s-list-tile-item-content" }, h("div", { key: '18a4a9ebd39e3a710f70dc33554d24e3c2850e53', class: "s-list-tile-item-title" }, h("slot", { key: '7211d627511bf2448cf161f40cc82b1822dd1e7a', name: 'title' })), h("div", { key: '044a7d76e05841f484387c7ed299107f33c9bc21', class: "s-list-tile-item-subtitle" }, h("slot", { key: 'df131034f1c5434722543e25552caed142794d55', name: "subtitle" }))), h("div", { key: '37abe0abab720da11cd55660578ec256c062e763', class: "s-list-tile-item-action" }, h("slot", { key: 'fcac02da17981ef4c6fa3cea50c551e3010352d9', 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 };