FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
collection
/
components
/
ui
/
line-item
Edit File: sc-line-item.js
import{h}from"@stencil/core";import{isRtl}from"../../../functions/page-align";export class ScLineItem{constructor(){this.price=void 0,this.currency=void 0,this.hasImageSlot=void 0,this.hasTitleSlot=void 0,this.hasDescriptionSlot=void 0,this.hasPriceSlot=void 0,this.hasPriceDescriptionSlot=void 0,this.hasCurrencySlot=void 0}componentWillLoad(){this.hasImageSlot=!!this.hostElement.querySelector('[slot="image"]'),this.hasTitleSlot=!!this.hostElement.querySelector('[slot="title"]'),this.hasDescriptionSlot=!!this.hostElement.querySelector('[slot="description"]'),this.hasPriceSlot=!!this.hostElement.querySelector('[slot="price"]'),this.hasPriceDescriptionSlot=!!this.hostElement.querySelector('[slot="price-description"]'),this.hasCurrencySlot=!!this.hostElement.querySelector('[slot="currency"]')}render(){return h("div",{key:"a70753f7731f83b4ab2fba64d350cdbf49eeed2c",part:"base",class:{item:!0,"item--has-image":this.hasImageSlot,"item--has-title":this.hasTitleSlot,"item--has-description":this.hasDescriptionSlot,"item--has-price":this.hasPriceSlot,"item--has-price-description":this.hasPriceDescriptionSlot,"item--has-price-currency":this.hasCurrencySlot,"item--is-rtl":isRtl()}},h("div",{key:"57713051e8ba5e48c074039df492e20b74e43b86",class:"item__image",part:"image"},h("slot",{key:"a261fc5009ece04feb6e36f768cbbdd24038708c",name:"image"})),h("div",{key:"95b8f2f9ef3fc4e15b306b978efb42a8a0752c4b",class:"item__text",part:"text"},h("div",{key:"d3f75f880a1040d7e1ab8eae18cf07dc94baa828",class:"item__title",part:"title"},h("slot",{key:"303be1f91e673e5993470d7ef80fa0ae7c55abbd",name:"title"})),h("div",{key:"7436044cc38969c5f99ca54d375d7a6c3a2bcff4",class:"item__description",part:"description"},h("slot",{key:"33cf68faff2769f8da148346c38391db4c6aeafe",name:"description"}))),h("div",{key:"39027e10bfb8d80f7c91c06383f0ec3cdec5d443",class:"item__end",part:"price"},h("div",{key:"47122c9b3629b49423ea2bb69aed28c6b7efa32d",class:"item__price-currency",part:"currency"},h("slot",{key:"b600d66b4a1e4827c481c69d894f0749bb6cb162",name:"currency"})),h("div",{key:"ea85e7e0a5361dee3edf62c9194be7febc4e90c0",class:"item__price-text",part:"price-text"},h("div",{key:"41ebd1ab2522ac683ac420c27b761fac52615662",class:"item__price",part:"price"},h("slot",{key:"8af3955a76ccd3a732c830067d15dab72259f3a0",name:"price"})),h("div",{key:"8b15e813632bc800ae2809f8c6b70d99f1c9c10d",class:"item__price-description",part:"price-description"},h("slot",{key:"d099806eddbbea6e81b2f976eccb007f23635915",name:"price-description"})))))}static get is(){return"sc-line-item"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-line-item.scss"]}}static get styleUrls(){return{$:["sc-line-item.css"]}}static get properties(){return{price:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Price of the item"},attribute:"price",reflect:!1},currency:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Currency symbol"},attribute:"currency",reflect:!1}}}static get states(){return{hasImageSlot:{},hasTitleSlot:{},hasDescriptionSlot:{},hasPriceSlot:{},hasPriceDescriptionSlot:{},hasCurrencySlot:{}}}static get elementRef(){return"hostElement"}}
Save
Back