@salla.sa/twilight-components
Version:
Salla Web Component
76 lines (75 loc) • 3.05 kB
JavaScript
/*!
* Crafted with ❤ by Salla
*/
import { h, Host } from "@stencil/core";
export class SallaLoyaltyPrizeItem {
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 is() { return "salla-loyalty-prize-item"; }
static get originalStyleUrls() {
return {
"$": ["salla-loyalty-prize-item.scss"]
};
}
static get styleUrls() {
return {
"$": ["salla-loyalty-prize-item.css"]
};
}
static get properties() {
return {
"item": {
"type": "unknown",
"attribute": "item",
"mutable": false,
"complexType": {
"original": "Item",
"resolved": "Item",
"references": {
"Item": {
"location": "import",
"path": "./loyalty-schema",
"id": "src/components/salla-loyalty/loyalty-schema.ts::Item"
}
}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Prize item to be displayed in this component."
},
"getter": false,
"setter": false
}
};
}
static get events() {
return [{
"method": "prizeItemSelected",
"name": "prizeItemSelected",
"bubbles": true,
"cancelable": true,
"composed": true,
"docs": {
"tags": [],
"text": "Event emmited when the user select this item."
},
"complexType": {
"original": "Item",
"resolved": "Item",
"references": {
"Item": {
"location": "import",
"path": "./loyalty-schema",
"id": "src/components/salla-loyalty/loyalty-schema.ts::Item"
}
}
}
}];
}
}