Socket
Socket
Sign inDemoInstall

vue3-star-ratings

Package Overview
Dependencies
21
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.3 to 2.0.4

1

dist/vue3-star-ratings.iife.js

@@ -0,1 +1,2 @@

(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".vue3-star-ratings__wrapper[data-v-786b615e]{display:block;text-align:center}.vue3-star-ratings__wrapper *[data-v-786b615e]{box-sizing:border-box;margin:0;padding:0}.vue3-star-ratings[data-v-786b615e]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.vue3-star-ratings button[data-v-786b615e]{border:0;display:flex;justify-content:center;align-items:center;border-radius:50%;cursor:pointer;outline:none}.vue3-star-ratings button svg[data-v-786b615e]{fill:currentColor}.stars[data-v-786b615e]{display:inline-block;position:relative;overflow:hidden}.stars-outer[data-v-786b615e],.stars-inner[data-v-786b615e]{height:inherit}.stars-inner[data-v-786b615e]{position:absolute;top:0;left:0;width:0;max-width:100%;min-width:0;white-space:nowrap;transition:.32s cubic-bezier(.075,.82,.165,1);overflow:hidden}.stars svg[data-v-786b615e]{display:inline-block;fill:currentColor;cursor:pointer}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
var Vue3StarRatings=function(e){"use strict";const d=(t,a)=>{const o=t.__vccOpts||t;for(const[l,f]of a)o[l]=f;return o},h={},_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 792.082 792.082"},k=[e.createElementVNode("path",{d:"M317.896 396.024l304.749-276.467c27.36-27.36 27.36-71.677 0-99.037s-71.677-27.36-99.036 0L169.11 342.161c-14.783 14.783-21.302 34.538-20.084 53.897-1.218 19.359 5.301 39.114 20.084 53.897l354.531 321.606c27.36 27.36 71.677 27.36 99.037 0s27.36-71.677 0-99.036L317.896 396.024z"},null,-1)];function y(t,a){return e.openBlock(),e.createElementBlock("svg",_,k)}const S=d(h,[["render",y]]),B={},w={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 792.082 792.082"},C=[e.createElementVNode("path",{d:"M622.955 342.127L268.424 20.521c-27.36-27.36-71.677-27.36-99.037 0s-27.36 71.676 0 99.037l304.749 276.468-304.749 276.466c-27.36 27.359-27.36 71.676 0 99.036s71.677 27.36 99.037 0l354.531-321.606c14.783-14.783 21.302-34.538 20.084-53.897 1.186-19.36-5.301-39.114-20.084-53.898z"},null,-1)];function V(t,a){return e.openBlock(),e.createElementBlock("svg",w,C)}const z=d(B,[["render",V]]),E={},$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512.002 512.002"},b=[e.createElementVNode("path",{d:"M511.267 197.258a14.995 14.995 0 00-12.107-10.209l-158.723-23.065-70.985-143.827a14.998 14.998 0 00-26.901 0l-70.988 143.827-158.72 23.065a14.998 14.998 0 00-8.312 25.585l114.848 111.954-27.108 158.083a14.999 14.999 0 0021.763 15.812l141.967-74.638 141.961 74.637a15 15 0 0021.766-15.813l-27.117-158.081 114.861-111.955a14.994 14.994 0 003.795-15.375z"},null,-1)];function x(t,a){return e.openBlock(),e.createElementBlock("svg",$,b)}const m=d(E,[["render",x]]),R={class:"vue3-star-ratings__wrapper"},N={class:"vue3-star-ratings"},p=e.defineComponent({__name:"Vue3StarRatings",props:{modelValue:null,starColor:{default:"#ff9800"},inactiveColor:{default:"#333333"},starSize:{default:"32"},controlBg:{default:"#2e5090"},controlColor:{default:"#fff"},controlSize:{default:"32"},numberOfStars:{default:5},showControl:{type:Boolean,default:!0},disableClick:{type:Boolean,default:!1},step:{default:.5}},emits:["update:modelValue"],setup(t,{emit:a}){const o=t,l=e.ref(o.modelValue||0);function f(n,c){const r=10**c;return Math.round(n*r)/r}function s(n){return{width:`${n}px`,height:`${n}px`}}function L(){const n=o.numberOfStars,c=l.value+o.step;l.value=c>=n?n:c}function O(){const n=l.value-o.step;l.value=n<=0?0:n}const u=e.computed(()=>f(l.value,1)),M=e.computed(()=>u.value/o.numberOfStars*100+"%"),i=e.ref();function g(n){const c=n.pageX-this.offsetLeft,r=o.numberOfStars;l.value=c/this.offsetWidth*r}return e.onMounted(()=>{i.value&&i.value.addEventListener("click",g)}),e.onBeforeUnmount(()=>{i.value&&i.value.removeEventListener("click",g)}),e.watch(u,n=>{a("update:modelValue",n)}),(n,c)=>(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",N,[t.showControl?(e.openBlock(),e.createElementBlock("button",{key:0,style:e.normalizeStyle({...s(t.controlSize),backgroundColor:t.controlBg,color:t.controlColor}),onClick:O},[e.createVNode(S,{style:e.normalizeStyle({...s(+t.controlSize-16)})},null,8,["style"])],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"stars",ref_key:"starsContainer",ref:i,style:e.normalizeStyle({pointerEvents:t.disableClick?"none":"auto"})},[e.createElementVNode("div",{class:"stars-outer",style:e.normalizeStyle({color:t.inactiveColor})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.numberOfStars,r=>(e.openBlock(),e.createBlock(m,{key:r,style:e.normalizeStyle({...s(t.starSize)})},null,8,["style"]))),128))],4),e.createElementVNode("div",{class:"stars-inner",style:e.normalizeStyle({width:e.unref(M),color:t.starColor})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.numberOfStars,r=>(e.openBlock(),e.createBlock(m,{key:r,style:e.normalizeStyle({...s(t.starSize)})},null,8,["style"]))),128))],4)],4),t.showControl?(e.openBlock(),e.createElementBlock("button",{key:1,style:e.normalizeStyle({...s(t.controlSize),backgroundColor:t.controlBg,color:t.controlColor}),onClick:L},[e.createVNode(z,{style:e.normalizeStyle({...s(+t.controlSize-16)})},null,8,["style"])],4)):e.createCommentVNode("",!0)])]))}}),W="";return d(p,[["__scopeId","data-v-786b615e"]])}(Vue);

@@ -0,1 +1,2 @@

(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".vue3-star-ratings__wrapper[data-v-786b615e]{display:block;text-align:center}.vue3-star-ratings__wrapper *[data-v-786b615e]{box-sizing:border-box;margin:0;padding:0}.vue3-star-ratings[data-v-786b615e]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.vue3-star-ratings button[data-v-786b615e]{border:0;display:flex;justify-content:center;align-items:center;border-radius:50%;cursor:pointer;outline:none}.vue3-star-ratings button svg[data-v-786b615e]{fill:currentColor}.stars[data-v-786b615e]{display:inline-block;position:relative;overflow:hidden}.stars-outer[data-v-786b615e],.stars-inner[data-v-786b615e]{height:inherit}.stars-inner[data-v-786b615e]{position:absolute;top:0;left:0;width:0;max-width:100%;min-width:0;white-space:nowrap;transition:.32s cubic-bezier(.075,.82,.165,1);overflow:hidden}.stars svg[data-v-786b615e]{display:inline-block;fill:currentColor;cursor:pointer}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
import { openBlock as n, createElementBlock as a, createElementVNode as u, defineComponent as R, ref as _, computed as w, onMounted as V, onBeforeUnmount as O, watch as L, normalizeStyle as l, createVNode as y, createCommentVNode as S, Fragment as C, renderList as k, createBlock as b, unref as E } from "vue";

@@ -2,0 +3,0 @@ const v = (t, i) => {

3

package.json
{
"name": "vue3-star-ratings",
"version": "2.0.3",
"version": "2.0.4",
"license": "MIT",

@@ -46,2 +46,3 @@ "type": "module",

"vite": "^4.3.2",
"vite-plugin-css-injected-by-js": "^3.1.0",
"vite-plugin-dts": "^2.3.0",

@@ -48,0 +49,0 @@ "vue-tsc": "^1.4.2"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc