FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
components
Edit File: sc-review-stars.js
import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{d as defineCustomElement$2}from"./sc-icon2.js";const scReviewStarsCss=":host{display:flex;gap:var(--star-gap, 2px);--sc-review-stars-primary:var(--sc-color-gray-500)}sc-icon.full-star::part(svg){fill:var(--sc-review-stars-primary);stroke:var(--sc-review-stars-primary);color:var(--sc-review-stars-primary)}sc-icon.half-star::part(svg){stroke:var(--sc-review-stars-primary);color:var(--sc-review-stars-primary)}sc-icon.empty-star::part(svg){color:var(--sc-review-stars-primary)}",ScReviewStarsStyle0=scReviewStarsCss,ScReviewStars$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.rating=0,this.size=20}render(){const e=Math.floor(this.rating),s=e<this.rating,t=Array.from({length:5}).map(((t,r)=>{const a=r+1,i=a<=e,c=s&&a===e+1;return h("sc-icon",{name:c?"half-star":"star",class:{"full-star":i,"half-star":c,"empty-star":!i&&!c},style:{width:`${this.size}px`,height:`${this.size}px`}})}));return h("div",{part:"base"},t)}static get style(){return ScReviewStarsStyle0}},[1,"sc-review-stars",{rating:[2],size:[2]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["sc-review-stars","sc-icon"].forEach((e=>{switch(e){case"sc-review-stars":customElements.get(e)||customElements.define(e,ScReviewStars$1);break;case"sc-icon":customElements.get(e)||defineCustomElement$2()}}))}const ScReviewStars=ScReviewStars$1,defineCustomElement=defineCustomElement$1;export{ScReviewStars,defineCustomElement};
Save
Back