@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: 'c66af50f4293094425640dd48246a973a240687b' }, h("a", { key: '5f2969fa28b312b2df0aa8f4ea93476f3d46f415', class: this.generateClass(), href: this.href || "#", target: this.target, "aria-label": "List Tile Link" }, h("div", { key: '4b92b66742957d2cb1d0961f78912ee28fd156d2', class: "s-list-tile-item-icon" }, h("slot", { key: '8593c413f0f7ed60d5f5b2e80a1e10880b6fd063', name: 'icon' })), h("div", { key: '469efd30ddfd208c1b73b6fc4485ae7fae11f914', class: "s-list-tile-item-content" }, h("div", { key: 'e5bebc43345b3921597d73020948ed5f913974e8', class: "s-list-tile-item-title" }, h("slot", { key: '306e82cccd99c6a8341c23fc5f8f35c5a656a088', name: 'title' })), h("div", { key: 'b148fbbc417ff3e174833a91c8b852525f6cacc1', class: "s-list-tile-item-subtitle" }, h("slot", { key: '44ef5d6b3aae8a7b511244be00c12700605c596a', name: "subtitle" }))), h("div", { key: '8cfd1fa5145a3b2adf7eb1da27f1cf96d7d96780', class: "s-list-tile-item-action" }, h("slot", { key: '47db71ae396cfc1cbdeb9fd7fd643afefd1af5db', 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 };