@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: '601dbcf73e68678eecc912c14c2b1be612a78551' }, h("div", { key: '074f8b4cb736bfabd5885d9df77bf74e7c4829a1', onClick: this.onPrizeItemClick.bind(this) }, h("img", { key: '4bec672992f7e998bde639295831a5c9ad5f5088', class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), h("div", { key: 'c8f858a7f406fe8e9123c57df627a4b6a2cbd719', class: "s-loyalty-prize-item-title" }, this.item.name), h("div", { key: '81b954aa730e07c7f32ee538692581dede3543db', class: "s-loyalty-prize-item-subtitle" }, this.item.description), h("div", { key: 'b7baeada2da364fec6ee7bd606b595b1f652d8a8', 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"
}
}
}
}];
}
}