Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue3-star-ratings-ksh

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-star-ratings-ksh - npm Package Compare versions

Comparing version 1.0.7 to 2.0.0

15

dist/vue3-star-ratings.esm.js

@@ -143,3 +143,8 @@ import { defineComponent, openBlock, createBlock, createVNode, pushScopeId, popScopeId, resolveComponent, createCommentVNode, Fragment, renderList, withScopeId } from 'vue';

starsCont.addEventListener("click", function (e) {
const relativeX = e.pageX - this.offsetLeft;
var relativeX = e.pageX - this.offsetLeft;
if (this.offsetParent != null) {
relativeX -= this.offsetParent.offsetLeft;
}
self.rating = relativeX / this.offsetWidth * self.numberOfStars;

@@ -151,5 +156,5 @@ });

const _withId = /*#__PURE__*/withScopeId("data-v-76dea496");
const _withId = /*#__PURE__*/withScopeId("data-v-6a2fd860");
pushScopeId("data-v-76dea496");
pushScopeId("data-v-6a2fd860");

@@ -259,7 +264,7 @@ const _hoisted_1 = {

var css_248z = "\n.vue3-star-ratings__wrapper[data-v-76dea496] {\n display: block;\n margin: 25px auto;\n text-align: center;\n padding: 25px;\n}\n.vue3-star-ratings[data-v-76dea496] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.vue3-star-ratings button[data-v-76dea496] {\n border: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n cursor: pointer;\n}\n.vue3-star-ratings button svg[data-v-76dea496] {\n fill: currentColor;\n}\n.stars[data-v-76dea496] {\n display: inline-block;\n position: relative;\n overflow: hidden;\n margin: 0 auto;\n}\n.stars-outer[data-v-76dea496],\n.stars-inner[data-v-76dea496] {\n height: inherit;\n}\n.stars-inner[data-v-76dea496] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n max-width: 100%;\n min-width: 0;\n white-space: nowrap;\n transition: 320ms cubic-bezier(0.075, 0.82, 0.165, 1);\n overflow: hidden;\n}\n.stars svg[data-v-76dea496] {\n display: inline-block;\n fill: currentColor;\n cursor: pointer;\n}\n";
var css_248z = "\n.vue3-star-ratings__wrapper[data-v-6a2fd860] {\r\n display: block;\r\n margin: 25px auto;\r\n text-align: center;\r\n padding: 25px;\n}\n.vue3-star-ratings[data-v-6a2fd860] {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.vue3-star-ratings button[data-v-6a2fd860] {\r\n border: 0;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n border-radius: 50%;\r\n cursor: pointer;\n}\n.vue3-star-ratings button svg[data-v-6a2fd860] {\r\n fill: currentColor;\n}\n.stars[data-v-6a2fd860] {\r\n display: inline-block;\r\n position: relative;\r\n overflow: hidden;\r\n margin: 0 auto;\n}\n.stars-outer[data-v-6a2fd860],\r\n.stars-inner[data-v-6a2fd860] {\r\n height: inherit;\n}\n.stars-inner[data-v-6a2fd860] {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 0;\r\n max-width: 100%;\r\n min-width: 0;\r\n white-space: nowrap;\r\n transition: 320ms cubic-bezier(0.075, 0.82, 0.165, 1);\r\n overflow: hidden;\n}\n.stars svg[data-v-6a2fd860] {\r\n display: inline-block;\r\n fill: currentColor;\r\n cursor: pointer;\n}\r\n";
styleInject(css_248z);
script.render = render;
script.__scopeId = "data-v-76dea496";
script.__scopeId = "data-v-6a2fd860";

@@ -266,0 +271,0 @@ // Import vue component

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

var Vue3StarRatings=function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?t(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var i=e.defineComponent({name:"StarIcon"}),s={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512.002 512.002"},l=e.createVNode("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);i.render=function(t,n,r,a,o,i){return e.openBlock(),e.createBlock("svg",s,[l])};var c=e.defineComponent({components:{StarIcon:i},name:"Vue3StarRatings",props:{starColor:{type:String,default:"#ff9800"},inactiveColor:{type:String,default:"#333"},starSize:{type:String,default:"32"},controlBg:{type:String,default:"#2e5090"},controlColor:{type:String,default:"#fff"},controlSize:{type:String,default:"24"},numberOfStars:{type:Number,default:5},showControl:{type:Boolean,default:!0},modelValue:{type:Number},disableClick:{type:Boolean,default:!1},step:{type:Number,default:.5}},data:function(){return{rating:this.modelValue||0}},watch:{roundedRating:function(){this.$emit("update:modelValue",this.roundedRating)}},computed:{roundedRating:function(){return this.rounded(this.rating,1)},percent:function(){return this.roundedRating/this.numberOfStars*100+"%"}},methods:{increaseRating:function(){this.rating<this.numberOfStars?this.rating+=this.step:this.rating>this.numberOfStars&&(this.rating=this.numberOfStars),this.rating>this.numberOfStars&&(this.rating=this.numberOfStars)},decreaseRating:function(){this.rating<=0||(this.rating-=this.step,this.rating<0&&(this.rating=0))},rounded:function(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n},numberMinusFifteenPercent:function(e){var t=+e;return this.rounded(t-.15*t,0)},generateSameWidthAndHeight:function(e){return{width:e+"px",height:e+"px"}}},mounted:function(){var e=this.$refs.starsContainer,t=this;e.addEventListener("click",(function(e){var n=e.pageX-this.offsetLeft;t.rating=n/this.offsetWidth*t.numberOfStars}))}}),u=e.withScopeId("data-v-76dea496");e.pushScopeId("data-v-76dea496");var d={class:"vue3-star-ratings__wrapper"},f={class:"vue3-star-ratings"},p=e.createVNode("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),g=e.createVNode("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);e.popScopeId();var h=u((function(t,r,a,o,i,s){var l=e.resolveComponent("star-icon");return e.openBlock(),e.createBlock("div",d,[e.createVNode("div",f,[t.showControl?(e.openBlock(),e.createBlock("button",{key:0,onClick:r[1]||(r[1]=function(){return t.decreaseRating&&t.decreaseRating.apply(t,arguments)}),style:n(n({},t.generateSameWidthAndHeight(t.controlSize)),{},{backgroundColor:t.controlBg,color:t.controlColor})},[(e.openBlock(),e.createBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 792.082 792.082",style:n({},t.generateSameWidthAndHeight(t.numberMinusFifteenPercent(t.controlSize)))},[p],4))],4)):e.createCommentVNode("",!0),e.createVNode("div",{class:"stars",ref:"starsContainer",style:{pointerEvents:t.disableClick?"none":"auto"}},[e.createVNode("div",{class:"stars-outer",style:{color:t.inactiveColor}},[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(t.numberOfStars,(function(r){return e.openBlock(),e.createBlock(l,{key:r,style:n({},t.generateSameWidthAndHeight(t.starSize))},null,8,["style"])})),128))],4),e.createVNode("div",{class:"stars-inner",style:{width:t.percent,color:t.starColor}},[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(t.numberOfStars,(function(r){return e.openBlock(),e.createBlock(l,{key:r,style:n({},t.generateSameWidthAndHeight(t.starSize))},null,8,["style"])})),128))],4)],4),t.showControl?(e.openBlock(),e.createBlock("button",{key:1,onClick:r[2]||(r[2]=function(){return t.increaseRating&&t.increaseRating.apply(t,arguments)}),style:n(n({},t.generateSameWidthAndHeight(t.starSize)),{},{backgroundColor:t.controlBg,color:t.controlColor})},[(e.openBlock(),e.createBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 792.082 792.082",style:n({},t.generateSameWidthAndHeight(t.numberMinusFifteenPercent(t.controlSize)))},[g],4))],4)):e.createCommentVNode("",!0)])])}));!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("\n.vue3-star-ratings__wrapper[data-v-76dea496] {\n display: block;\n margin: 25px auto;\n text-align: center;\n padding: 25px;\n}\n.vue3-star-ratings[data-v-76dea496] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.vue3-star-ratings button[data-v-76dea496] {\n border: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n cursor: pointer;\n}\n.vue3-star-ratings button svg[data-v-76dea496] {\n fill: currentColor;\n}\n.stars[data-v-76dea496] {\n display: inline-block;\n position: relative;\n overflow: hidden;\n margin: 0 auto;\n}\n.stars-outer[data-v-76dea496],\n.stars-inner[data-v-76dea496] {\n height: inherit;\n}\n.stars-inner[data-v-76dea496] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n max-width: 100%;\n min-width: 0;\n white-space: nowrap;\n transition: 320ms cubic-bezier(0.075, 0.82, 0.165, 1);\n overflow: hidden;\n}\n.stars svg[data-v-76dea496] {\n display: inline-block;\n fill: currentColor;\n cursor: pointer;\n}\n"),c.render=h,c.__scopeId="data-v-76dea496";var m=function(){var e=c;return e.install=function(t){t.component("Vue3StarRatings",e)},e}(),v=Object.freeze({__proto__:null,default:m});return Object.entries(v).forEach((function(e){var t=a(e,2),n=t[0],r=t[1];"default"!==n&&(m[n]=r)})),m}(Vue);
var Vue3StarRatings=function(t){"use strict";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?e(Object(a),!0).forEach((function(e){r(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==n)return;var r,a,o=[],i=!0,s=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var i=t.defineComponent({name:"StarIcon"}),s={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512.002 512.002"},l=t.createVNode("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);i.render=function(e,n,r,a,o,i){return t.openBlock(),t.createBlock("svg",s,[l])};var c=t.defineComponent({components:{StarIcon:i},name:"Vue3StarRatings",props:{starColor:{type:String,default:"#ff9800"},inactiveColor:{type:String,default:"#333"},starSize:{type:String,default:"32"},controlBg:{type:String,default:"#2e5090"},controlColor:{type:String,default:"#fff"},controlSize:{type:String,default:"24"},numberOfStars:{type:Number,default:5},showControl:{type:Boolean,default:!0},modelValue:{type:Number},disableClick:{type:Boolean,default:!1},step:{type:Number,default:.5}},data:function(){return{rating:this.modelValue||0}},watch:{roundedRating:function(){this.$emit("update:modelValue",this.roundedRating)}},computed:{roundedRating:function(){return this.rounded(this.rating,1)},percent:function(){return this.roundedRating/this.numberOfStars*100+"%"}},methods:{increaseRating:function(){this.rating<this.numberOfStars?this.rating+=this.step:this.rating>this.numberOfStars&&(this.rating=this.numberOfStars),this.rating>this.numberOfStars&&(this.rating=this.numberOfStars)},decreaseRating:function(){this.rating<=0||(this.rating-=this.step,this.rating<0&&(this.rating=0))},rounded:function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n},numberMinusFifteenPercent:function(t){var e=+t;return this.rounded(e-.15*e,0)},generateSameWidthAndHeight:function(t){return{width:t+"px",height:t+"px"}}},mounted:function(){var t=this.$refs.starsContainer,e=this;t.addEventListener("click",(function(t){var n=t.pageX-this.offsetLeft;null!=this.offsetParent&&(n-=this.offsetParent.offsetLeft),e.rating=n/this.offsetWidth*e.numberOfStars}))}}),u=t.withScopeId("data-v-6a2fd860");t.pushScopeId("data-v-6a2fd860");var d={class:"vue3-star-ratings__wrapper"},f={class:"vue3-star-ratings"},p=t.createVNode("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),h=t.createVNode("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);t.popScopeId();var g=u((function(e,r,a,o,i,s){var l=t.resolveComponent("star-icon");return t.openBlock(),t.createBlock("div",d,[t.createVNode("div",f,[e.showControl?(t.openBlock(),t.createBlock("button",{key:0,onClick:r[1]||(r[1]=function(){return e.decreaseRating&&e.decreaseRating.apply(e,arguments)}),style:n(n({},e.generateSameWidthAndHeight(e.controlSize)),{},{backgroundColor:e.controlBg,color:e.controlColor})},[(t.openBlock(),t.createBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 792.082 792.082",style:n({},e.generateSameWidthAndHeight(e.numberMinusFifteenPercent(e.controlSize)))},[p],4))],4)):t.createCommentVNode("",!0),t.createVNode("div",{class:"stars",ref:"starsContainer",style:{pointerEvents:e.disableClick?"none":"auto"}},[t.createVNode("div",{class:"stars-outer",style:{color:e.inactiveColor}},[(t.openBlock(!0),t.createBlock(t.Fragment,null,t.renderList(e.numberOfStars,(function(r){return t.openBlock(),t.createBlock(l,{key:r,style:n({},e.generateSameWidthAndHeight(e.starSize))},null,8,["style"])})),128))],4),t.createVNode("div",{class:"stars-inner",style:{width:e.percent,color:e.starColor}},[(t.openBlock(!0),t.createBlock(t.Fragment,null,t.renderList(e.numberOfStars,(function(r){return t.openBlock(),t.createBlock(l,{key:r,style:n({},e.generateSameWidthAndHeight(e.starSize))},null,8,["style"])})),128))],4)],4),e.showControl?(t.openBlock(),t.createBlock("button",{key:1,onClick:r[2]||(r[2]=function(){return e.increaseRating&&e.increaseRating.apply(e,arguments)}),style:n(n({},e.generateSameWidthAndHeight(e.starSize)),{},{backgroundColor:e.controlBg,color:e.controlColor})},[(t.openBlock(),t.createBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 792.082 792.082",style:n({},e.generateSameWidthAndHeight(e.numberMinusFifteenPercent(e.controlSize)))},[h],4))],4)):t.createCommentVNode("",!0)])])}));!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t))}}("\n.vue3-star-ratings__wrapper[data-v-6a2fd860] {\r\n display: block;\r\n margin: 25px auto;\r\n text-align: center;\r\n padding: 25px;\n}\n.vue3-star-ratings[data-v-6a2fd860] {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.vue3-star-ratings button[data-v-6a2fd860] {\r\n border: 0;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n border-radius: 50%;\r\n cursor: pointer;\n}\n.vue3-star-ratings button svg[data-v-6a2fd860] {\r\n fill: currentColor;\n}\n.stars[data-v-6a2fd860] {\r\n display: inline-block;\r\n position: relative;\r\n overflow: hidden;\r\n margin: 0 auto;\n}\n.stars-outer[data-v-6a2fd860],\r\n.stars-inner[data-v-6a2fd860] {\r\n height: inherit;\n}\n.stars-inner[data-v-6a2fd860] {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 0;\r\n max-width: 100%;\r\n min-width: 0;\r\n white-space: nowrap;\r\n transition: 320ms cubic-bezier(0.075, 0.82, 0.165, 1);\r\n overflow: hidden;\n}\n.stars svg[data-v-6a2fd860] {\r\n display: inline-block;\r\n fill: currentColor;\r\n cursor: pointer;\n}\r\n"),c.render=g,c.__scopeId="data-v-6a2fd860";var m=function(){var t=c;return t.install=function(e){e.component("Vue3StarRatings",t)},t}(),v=Object.freeze({__proto__:null,default:m});return Object.entries(v).forEach((function(t){var e=a(t,2),n=e[0],r=e[1];"default"!==n&&(m[n]=r)})),m}(Vue);

@@ -235,8 +235,13 @@ 'use strict';var vue=require('vue');function ownKeys(object, enumerableOnly) {

var relativeX = e.pageX - this.offsetLeft;
if (this.offsetParent != null) {
relativeX -= this.offsetParent.offsetLeft;
}
self.rating = relativeX / this.offsetWidth * self.numberOfStars;
});
}
});var _withId = /*#__PURE__*/vue.withScopeId("data-v-76dea496");
});var _withId = /*#__PURE__*/vue.withScopeId("data-v-6a2fd860");
vue.pushScopeId("data-v-76dea496");
vue.pushScopeId("data-v-6a2fd860");

@@ -342,5 +347,5 @@ var _hoisted_1 = {

}
}var css_248z = "\n.vue3-star-ratings__wrapper[data-v-76dea496] {\n display: block;\n margin: 25px auto;\n text-align: center;\n padding: 25px;\n}\n.vue3-star-ratings[data-v-76dea496] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.vue3-star-ratings button[data-v-76dea496] {\n border: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n cursor: pointer;\n}\n.vue3-star-ratings button svg[data-v-76dea496] {\n fill: currentColor;\n}\n.stars[data-v-76dea496] {\n display: inline-block;\n position: relative;\n overflow: hidden;\n margin: 0 auto;\n}\n.stars-outer[data-v-76dea496],\n.stars-inner[data-v-76dea496] {\n height: inherit;\n}\n.stars-inner[data-v-76dea496] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n max-width: 100%;\n min-width: 0;\n white-space: nowrap;\n transition: 320ms cubic-bezier(0.075, 0.82, 0.165, 1);\n overflow: hidden;\n}\n.stars svg[data-v-76dea496] {\n display: inline-block;\n fill: currentColor;\n cursor: pointer;\n}\n";
}var css_248z = "\n.vue3-star-ratings__wrapper[data-v-6a2fd860] {\r\n display: block;\r\n margin: 25px auto;\r\n text-align: center;\r\n padding: 25px;\n}\n.vue3-star-ratings[data-v-6a2fd860] {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.vue3-star-ratings button[data-v-6a2fd860] {\r\n border: 0;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n border-radius: 50%;\r\n cursor: pointer;\n}\n.vue3-star-ratings button svg[data-v-6a2fd860] {\r\n fill: currentColor;\n}\n.stars[data-v-6a2fd860] {\r\n display: inline-block;\r\n position: relative;\r\n overflow: hidden;\r\n margin: 0 auto;\n}\n.stars-outer[data-v-6a2fd860],\r\n.stars-inner[data-v-6a2fd860] {\r\n height: inherit;\n}\n.stars-inner[data-v-6a2fd860] {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 0;\r\n max-width: 100%;\r\n min-width: 0;\r\n white-space: nowrap;\r\n transition: 320ms cubic-bezier(0.075, 0.82, 0.165, 1);\r\n overflow: hidden;\n}\n.stars svg[data-v-6a2fd860] {\r\n display: inline-block;\r\n fill: currentColor;\r\n cursor: pointer;\n}\r\n";
styleInject(css_248z);script.render = render;
script.__scopeId = "data-v-76dea496";// Import vue component
script.__scopeId = "data-v-6a2fd860";// Import vue component

@@ -347,0 +352,0 @@ // Default export is installable instance of component.

{
"name": "vue3-star-ratings-ksh",
"version": "1.0.7",
"version": "2.0.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "A simple, customizable vue3 component for star ratings",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc