@salla.sa/twilight-components
Version:
Salla Web Component
77 lines (76 loc) • 2.24 kB
JavaScript
/*!
* Crafted with ❤ by Salla
*/
import { h, Host } from "@stencil/core";
export class SallaLoyaltyPrizeItem {
constructor() {
this.item = undefined;
}
onPrizeItemClick() {
this.prizeItemSelected.emit(this.item);
}
render() {
return (h(Host, null, h("div", { onClick: this.onPrizeItemClick.bind(this) }, h("img", { class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), h("div", { class: "s-loyalty-prize-item-title" }, this.item.name), h("div", { class: "s-loyalty-prize-item-subtitle" }, this.item.description), h("div", { class: "s-loyalty-prize-item-points" }, this.item.cost_points, " Points"))));
}
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",
"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."
}
}
};
}
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"
}
}
}
}];
}
}
//# sourceMappingURL=salla-loyalty-prize-item.js.map