@salla.sa/twilight-components
Version:
Salla Web Component
43 lines (38 loc) • 2.11 kB
JavaScript
/*!
* Crafted with ❤ by Salla
*/
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
const sallaLoyaltyPrizeItemCss = "salla-loyalty-prize-item:hover{box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";
const SallaLoyaltyPrizeItem$1 = /*@__PURE__*/ proxyCustomElement(class SallaLoyaltyPrizeItem extends HTMLElement {
constructor() {
super();
this.__registerHost();
this.prizeItemSelected = createEvent(this, "prizeItemSelected", 7);
}
onPrizeItemClick() {
this.prizeItemSelected.emit(this.item);
}
render() {
return (h(Host, { key: '91162ebf1e2f76c4b90df9518d57a136e71fa573' }, h("div", { key: '80416871b0f60857b3279525bdaa87327b75890a', onClick: this.onPrizeItemClick.bind(this) }, h("img", { key: 'd7afdc106a822c0f7640136bec591bfa48fe1802', class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), h("div", { key: '727f131b7fa00b75aab57f2bb5ea4616f0d3929a', class: "s-loyalty-prize-item-title" }, this.item.name), h("div", { key: '6e2b9263b7d2c1b7a9e372ede63a6b10a23b0d1d', class: "s-loyalty-prize-item-subtitle" }, this.item.description), h("div", { key: '97b7710e76e3d73afe68abe6e8094483960884da', class: "s-loyalty-prize-item-points" }, this.item.cost_points, " ", salla.lang.get('pages.loyalty_program.point')))));
}
static get style() { return sallaLoyaltyPrizeItemCss; }
}, [0, "salla-loyalty-prize-item", {
"item": [16]
}]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["salla-loyalty-prize-item"];
components.forEach(tagName => { switch (tagName) {
case "salla-loyalty-prize-item":
if (!customElements.get(tagName)) {
customElements.define(tagName, SallaLoyaltyPrizeItem$1);
}
break;
} });
}
defineCustomElement$1();
const SallaLoyaltyPrizeItem = SallaLoyaltyPrizeItem$1;
const defineCustomElement = defineCustomElement$1;
export { SallaLoyaltyPrizeItem, defineCustomElement };