react-flex-rating
Advanced tools
Comparing version 0.0.31 to 1.0.0
@@ -15,3 +15,2 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
import noop from './util/noop.util'; | ||
// import './styles/react-flex-rating.scss' | ||
@@ -18,0 +17,0 @@ var ReactFlexRating = (_temp = _class = function (_React$Component) { |
import React from 'react'; | ||
import FontIcon from 'material-ui/FontIcon'; | ||
import classNameBuilder from './util/class-name-builder.util'; | ||
@@ -12,3 +11,2 @@ import noop from './util/noop.util'; | ||
}; | ||
var handleSelect = function handleSelect(e, _ref2) { | ||
@@ -20,3 +18,2 @@ var value = _ref2.value, | ||
}; | ||
var generateClasses = function generateClasses(_ref3) { | ||
@@ -34,15 +31,4 @@ var _ref3$active = _ref3.active, | ||
var renderFontIcon = function renderFontIcon(iconName) { | ||
return React.createElement( | ||
FontIcon, | ||
{ | ||
className: 'material-icons' | ||
}, | ||
iconName | ||
); | ||
}; | ||
var RatingIcon = function RatingIcon(props) { | ||
var _props$activeIcon = props.activeIcon, | ||
activeIcon = _props$activeIcon === undefined ? renderFontIcon('star') : _props$activeIcon, | ||
var activeIcon = props.activeIcon, | ||
inactiveIcon = props.inactiveIcon, | ||
@@ -55,4 +41,4 @@ active = props.active, | ||
var backgroundIcon = inactiveIcon || renderFontIcon('star_border'); | ||
var displayIcon = inactive && half && highlight ? inactiveIcon || renderFontIcon('star_border') : active || half ? activeIcon : inactiveIcon || renderFontIcon('star_border'); | ||
var backgroundIcon = inactiveIcon; | ||
var displayIcon = inactive && half && highlight ? inactiveIcon : active || half ? activeIcon : inactiveIcon; | ||
@@ -59,0 +45,0 @@ var iconContainerStyle = { |
@@ -34,4 +34,2 @@ 'use strict'; | ||
// import './styles/react-flex-rating.scss' | ||
var ReactFlexRating = (_temp = _class = function (_React$Component) { | ||
@@ -38,0 +36,0 @@ _inherits(ReactFlexRating, _React$Component); |
@@ -9,6 +9,2 @@ 'use strict'; | ||
var _FontIcon = require('material-ui/FontIcon'); | ||
var _FontIcon2 = _interopRequireDefault(_FontIcon); | ||
var _classNameBuilder = require('./util/class-name-builder.util'); | ||
@@ -30,3 +26,2 @@ | ||
}; | ||
var handleSelect = function handleSelect(e, _ref2) { | ||
@@ -38,3 +33,2 @@ var value = _ref2.value, | ||
}; | ||
var generateClasses = function generateClasses(_ref3) { | ||
@@ -52,15 +46,4 @@ var _ref3$active = _ref3.active, | ||
var renderFontIcon = function renderFontIcon(iconName) { | ||
return _react2.default.createElement( | ||
_FontIcon2.default, | ||
{ | ||
className: 'material-icons' | ||
}, | ||
iconName | ||
); | ||
}; | ||
var RatingIcon = function RatingIcon(props) { | ||
var _props$activeIcon = props.activeIcon, | ||
activeIcon = _props$activeIcon === undefined ? renderFontIcon('star') : _props$activeIcon, | ||
var activeIcon = props.activeIcon, | ||
inactiveIcon = props.inactiveIcon, | ||
@@ -73,4 +56,4 @@ active = props.active, | ||
var backgroundIcon = inactiveIcon || renderFontIcon('star_border'); | ||
var displayIcon = inactive && half && highlight ? inactiveIcon || renderFontIcon('star_border') : active || half ? activeIcon : inactiveIcon || renderFontIcon('star_border'); | ||
var backgroundIcon = inactiveIcon; | ||
var displayIcon = inactive && half && highlight ? inactiveIcon : active || half ? activeIcon : inactiveIcon; | ||
@@ -77,0 +60,0 @@ var iconContainerStyle = { |
{ | ||
"name": "react-flex-rating", | ||
"version": "0.0.31", | ||
"description": "react-flex-rating React component", | ||
"version": "1.0.0", | ||
"description": "react-flex-rating Flexable React Component for ratings", | ||
"main": "lib/index.js", | ||
@@ -20,7 +20,6 @@ "module": "es/index.js", | ||
"test:coverage": "nwb test-react --coverage", | ||
"test:watch": "nwb test-react --server" | ||
"test:watch": "nwb test-react --server", | ||
"publish-demo": "nwb build-demo && gh-pages -d demo/dist" | ||
}, | ||
"dependencies": { | ||
"material-ui": "0.20.0" | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
@@ -30,2 +29,4 @@ "react": "16.x" | ||
"devDependencies": { | ||
"@material-ui/core": "^1.5.0", | ||
"gh-pages": "^1.2.0", | ||
"nwb": "0.21.x", | ||
@@ -37,3 +38,3 @@ "nwb-sass": "^0.8.4", | ||
"author": "RavenHursT", | ||
"homepage": "https://23m6jr1v5y.codesandbox.io/", | ||
"homepage": "https://ravenhurst.github.io/react-flex-rating/", | ||
"license": "MIT", | ||
@@ -40,0 +41,0 @@ "repository": "https://github.com/RavenHursT/react-flex-rating", |
@@ -23,3 +23,3 @@ # react-flex-rating | ||
Check out the demo here! https://23m6jr1v5y.codesandbox.io/ | ||
Check out the demo here! https://ravenhurst.github.io/react-flex-rating/ | ||
@@ -40,31 +40,17 @@ ## Installation | ||
```javascript | ||
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' | ||
import FontIcon from 'material-ui/FontIcon' | ||
import Rating from 'react-flex-rating' | ||
// Inside React component render(): | ||
<MuiThemeProvider> | ||
<Rating | ||
{...{ | ||
className: `custom-class`, | ||
value: rating, | ||
allowHalfs, | ||
maxValue, | ||
disabled, | ||
iconCount: starCount, | ||
activeIcon: ( | ||
<FontIcon className="material-icons font-size-2-5"> | ||
star | ||
</FontIcon> | ||
), | ||
inactiveIcon: ( | ||
<FontIcon className="material-icons font-size-2-5"> | ||
star_border | ||
</FontIcon> | ||
), | ||
onSelect: rating => this.setState({ rating }) | ||
}} /> | ||
</MuiThemeProvider> | ||
<Rating {...{ | ||
className: `html-entities-rating`, | ||
value: rating, | ||
allowHalfs, | ||
maxValue, | ||
disabled, | ||
iconCount: starCount, | ||
activeIcon: <span>★</span>, // https://www.toptal.com/designers/htmlarrows/symbols/black-star/ | ||
inactiveIcon: <span>☆</span>, // https://www.toptal.com/designers/htmlarrows/symbols/white-star/ | ||
onSelect: rating => this.setState({ rating }) | ||
}} /> | ||
``` | ||
(Note: currently only built and tested w/ [material-ui 1.4.x](https://material-ui.com/) `FontIcon`. Not sure if it will work w/ other `ReactElement`s.) | ||
@@ -71,0 +57,0 @@ ## Component Properties: |
/*! | ||
* react-flex-rating v0.0.1 - https://github.com/RavenHursT/react-flex-rating | ||
* react-flex-rating v1.0.0 - https://ravenhurst.github.io/react-flex-rating/ | ||
* MIT Licensed | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactFlexRating=e(require("react")):t.ReactFlexRating=e(t.React)}("undefined"!=typeof self?self:this,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=45)}([function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(1),o=n(0),i=n(31),u=n(6),c=n(5),a=function(t,e,n){var f,s,l,p=t&a.F,v=t&a.G,d=t&a.S,h=t&a.P,y=t&a.B,b=t&a.W,_=v?o:o[e]||(o[e]={}),g=_.prototype,m=v?r:d?r[e]:(r[e]||{}).prototype;for(f in v&&(n=e),n)(s=!p&&m&&void 0!==m[f])&&c(_,f)||(l=s?m[f]:n[f],_[f]=v&&"function"!=typeof m[f]?n[f]:y&&s?i(l,r):b&&m[f]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):h&&"function"==typeof l?i(Function.call,l):l,h&&((_.virtual||(_.virtual={}))[f]=l,t&a.R&&g&&!g[f]&&u(g,f,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,n){var r=n(11),o=n(32),i=n(18),u=Object.defineProperty;e.f=n(4)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(8)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(3),o=n(12);t.exports=n(4)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(35),o=n(19);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(22)("wks"),o=n(15),i=n(1).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,e,n){var r=n(7);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(34),o=n(23);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){t.exports=!0},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){e.f={}.propertyIsEnumerable},function(e,n){e.exports=t},function(t,e,n){var r=n(7);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(22)("keys"),o=n(15);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(0),o=n(1),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(14)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(19);t.exports=function(t){return Object(r(t))}},function(t,e){t.exports={}},function(t,e,n){var r=n(11),o=n(75),i=n(23),u=n(21)("IE_PROTO"),c=function(){},a=function(){var t,e=n(33)("iframe"),r=i.length;for(e.style.display="none",n(76).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;r--;)delete a.prototype[i[r]];return a()};t.exports=Object.create||function(t,e){var n;return null!==t?(c.prototype=r(t),n=new c,c.prototype=null,n[u]=t):n=a(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(3).f,o=n(5),i=n(10)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){e.f=n(10)},function(t,e,n){var r=n(1),o=n(0),i=n(14),u=n(29),c=n(3).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||c(e,t,{value:u.f(t)})}},function(t,e,n){var r=n(54);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){t.exports=!n(4)&&!n(8)(function(){return 7!=Object.defineProperty(n(33)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(7),o=n(1).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(5),o=n(9),i=n(56)(!1),u=n(21)("IE_PROTO");t.exports=function(t,e){var n,c=o(t),a=0,f=[];for(n in c)n!=u&&r(c,n)&&f.push(n);for(;e.length>a;)r(c,n=e[a++])&&(~i(f,n)||f.push(n));return f}},function(t,e,n){var r=n(36);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(5),o=n(25),i=n(21)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){"use strict";e.__esModule=!0;var r=u(n(70)),o=u(n(81)),i="function"==typeof o.default&&"symbol"==typeof r.default?function(t){return typeof t}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default&&t!==o.default.prototype?"symbol":typeof t};function u(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof o.default&&"symbol"===i(r.default)?function(t){return void 0===t?"undefined":i(t)}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default&&t!==o.default.prototype?"symbol":void 0===t?"undefined":i(t)}},function(t,e,n){"use strict";var r=n(14),o=n(2),i=n(40),u=n(6),c=n(26),a=n(74),f=n(28),s=n(37),l=n(10)("iterator"),p=!([].keys&&"next"in[].keys()),v=function(){return this};t.exports=function(t,e,n,d,h,y,b){a(n,e,d);var _,g,m,O=function(t){if(!p&&t in T)return T[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",x="values"==h,E=!1,T=t.prototype,j=T[l]||T["@@iterator"]||h&&T[h],w=j||O(h),M=h?x?O("entries"):w:void 0,P="Array"==e&&T.entries||j;if(P&&(m=s(P.call(new t)))!==Object.prototype&&m.next&&(f(m,S,!0),r||"function"==typeof m[l]||u(m,l,v)),x&&j&&"values"!==j.name&&(E=!0,w=function(){return j.call(this)}),r&&!b||!p&&!E&&T[l]||u(T,l,w),c[e]=w,c[S]=v,h)if(_={values:x?w:O("values"),keys:y?w:O("keys"),entries:M},b)for(g in _)g in T||i(T,g,_[g]);else o(o.P+o.F*(p||E),e,_);return _}},function(t,e,n){t.exports=n(6)},function(t,e,n){var r=n(34),o=n(23).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){var r=n(16),o=n(12),i=n(9),u=n(18),c=n(5),a=n(32),f=Object.getOwnPropertyDescriptor;e.f=n(4)?f:function(t,e){if(t=i(t),e=u(e,!0),a)try{return f(t,e)}catch(t){}if(c(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e,n){"use strict";e.a=function(t,e){return(t||"")+(e?" "+e:"")}},function(t,e,n){"use strict";e.a=function(){}},function(t,e,n){t.exports=n(46)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"default",function(){return l});var r,o,i=n(17),u=n.n(i),c=n(47),a=n(43),f=n(44),s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};var l=(o=r=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return r.state=s({},e.initialState),r.renderIcons=r.renderIcons.bind(r),r.getIconConfigs=r.getIconConfigs.bind(r),r.onMove=r.onMove.bind(r),r.onSelect=r.onSelect.bind(r),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.getIconConfigs=function(){for(var t=this.props,n=t.allowHalfs,r=void 0===n?e.defaultProps.allowHalfs:n,o=t.iconCount,i=void 0===o?e.defaultProps.iconCount:o,u=t.value,a=void 0===u?e.defaultProps.value:u,f=t.maxValue,s=void 0===f?e.defaultProps.maxValue:f,l=this.state,d=l.highlightCount,h=l.hoverPercent,y=s/i,b=[],_=0,g=1;g<=i;g++){var m,O=g*y,S=v(O,a);_=S?O:_;var x=r&&d===g&&h<.5&&g*y<=a,E=S&&!x?c.a.ACTIVE_STATE_KEY:p(r,O,_,y,a)||x?c.a.HALF_STATE_KEY:c.a.INACTIVE_STATE_KEY;b.push(((m={})[E]=!0,m.half=E===c.a.HALF_STATE_KEY||E===c.a.INACTIVE_STATE_KEY&&d===g&&h<.5||void 0,m.highlight=d>=g||void 0,m.highlightBackgroundIcon=d>g||d===g&&h>=.5,m.value=O,m))}return b},e.calculateInteractPercentage=function(t,e){if(!e.allowHalfs)return 1;var n=t.nativeEvent.type.indexOf("touch")>-1?t.nativeEvent.type.indexOf("touchend")>-1?t.changedTouches[0].clientX:t.touches[0].clientX:t.clientX,r=t.target.getBoundingClientRect(),o=n-r.left;return o<0?0:o/r.width},e.prototype.renderIcons=function(){var t=this,e=this.props,n=e.activeIcon,r=e.inactiveIcon,o=e.halfIcon,i=e.highlightIcon,a=e.disabled;return this.getIconConfigs().map(function(e,f){return u.a.createElement(c.a,s({activeIcon:n,inactiveIcon:r,halfIcon:o,highlightIcon:i,key:f,onMove:a?void 0:t.onMove,onSelect:a?void 0:t.onSelect},e))})},e.prototype.onMove=function(t,n){var r=this.props,o=r.iconCount,i=r.maxValue/o,u=e.calculateInteractPercentage(t,this.props);this.setState({highlightCount:n/i,hoverPercent:u})},e.prototype.onSelect=function(t,n){var r=this.props,o=r.iconCount,i=r.maxValue,u=r.onSelect,c=void 0===u?f.a:u;c(n=e.calculateInteractPercentage(t,this.props)<.5?n-i/o/2:n,t),this.setState.apply(this,e.initialState)},e.prototype.render=function(){var t=this,n=this.props,r=n.className,o=n.disabled;return u.a.createElement("span",{style:{display:"inline-block",direction:"ltr"},className:Object(a.a)(Object(a.a)("rating",o&&"disabled"),r),onMouseLeave:function(){return!o&&t.setState(s({},e.initialState))}},this.renderIcons())},e}(u.a.Component),r.initialState={highlightCount:0,hoverPercent:0},r.defaultProps={iconCount:5,value:0,maxValue:100,allowHalfs:!1,disabled:!1},o),p=function(t,e,n,r,o){return t&&e-n===r&&e>o&&o%r},v=function(t,e){return t<=e}},function(t,e,n){"use strict";var r=n(17),o=n.n(r),i=n(48),u=n.n(i),c=n(43),a=n(44),f=function(t,e){var n=e.value,r=e.onMove;return(void 0===r?a.a:r)(t,n)},s=function(t,e){var n=e.value,r=e.onSelect;return(void 0===r?a.a:r)(t,n)},l=function(t){var e=t.active,n=void 0===e?"":e,r=t.inactive,o=void 0===r?"":r,i=t.half,u=void 0===i?"":i,c=t.highlight,a=void 0===c?"":c;return[""+(n&&v.ACTIVE_STATE_KEY+" "),""+(o&&v.INACTIVE_STATE_KEY+" "),""+(u&&v.HALF_STATE_KEY+" "),""+(a&&v.HIGHLIGHT_STATE_KEY+" ")].join("")},p=function(t){return o.a.createElement(u.a,{className:"material-icons"},t)},v=function t(e){var n=e.activeIcon,r=void 0===n?p("star"):n,i=e.inactiveIcon,u=e.active,a=e.inactive,v=e.half,d=e.highlight,h=e.highlightBackgroundIcon,y=i||p("star_border"),b=a&&v&&d?i||p("star_border"):u||v?r:i||p("star_border"),_={display:"inline-block",position:"absolute",overflow:"hidden",top:0,left:0,width:(v?50:100)+"%"};return o.a.createElement("span",{style:{display:"inline-block",position:"relative"},className:Object(c.a)("rating-icon",l({active:u,inactive:a,half:v,highlight:d})),onMouseMove:function(t){return f(t,e)},onTouchMove:function(t){return f(t,e)},onClick:function(t){return t.preventDefault(),s(t,e)},onTouchEnd:function(t){return t.preventDefault(),s(t,e)}},o.a.createElement("span",{className:Object(c.a)("background-icon",h?t.HIGHLIGHT_STATE_KEY:"")},y),o.a.createElement("span",{className:"display-icon",style:_},b))};v.ACTIVE_STATE_KEY="active",v.INACTIVE_STATE_KEY="inactive",v.HALF_STATE_KEY="half",v.HIGHLIGHT_STATE_KEY="highlight",e.a=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,o=n(49),i=(r=o)&&r.__esModule?r:{default:r};e.default=i.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=h(n(50)),o=h(n(59)),i=h(n(60)),u=h(n(64)),c=h(n(65)),a=h(n(69)),f=h(n(91)),s=h(n(99)),l=n(17),p=h(l),v=h(n(100)),d=h(n(103));function h(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(){var t,n,r,o;(0,u.default)(this,e);for(var c=arguments.length,f=Array(c),s=0;s<c;s++)f[s]=arguments[s];return n=r=(0,a.default)(this,(t=e.__proto__||(0,i.default)(e)).call.apply(t,[this].concat(f))),r.state={hovered:!1},r.handleMouseLeave=function(t){void 0!==r.props.hoverColor&&r.setState({hovered:!1}),r.props.onMouseLeave&&r.props.onMouseLeave(t)},r.handleMouseEnter=function(t){void 0!==r.props.hoverColor&&r.setState({hovered:!0}),r.props.onMouseEnter&&r.props.onMouseEnter(t)},o=n,(0,a.default)(r,o)}return(0,f.default)(e,t),(0,c.default)(e,[{key:"render",value:function(){var t=this.props,e=(t.hoverColor,t.onMouseLeave,t.onMouseEnter,t.style),n=(0,o.default)(t,["hoverColor","onMouseLeave","onMouseEnter","style"]),i=this.context.muiTheme.prepareStyles,u=function(t,e,n){var r=t.color,o=t.hoverColor,i=e.muiTheme.baseTheme,u=r||i.palette.textColor,c=o||u;return{root:{color:n.hovered?c:u,position:"relative",fontSize:i.spacing.iconSize,display:"inline-block",userSelect:"none",transition:d.default.easeOut()}}}(this.props,this.context,this.state);return p.default.createElement("span",(0,r.default)({},n,{onMouseLeave:this.handleMouseLeave,onMouseEnter:this.handleMouseEnter,style:i((0,s.default)(u.root,e))}))}}]),e}(l.Component);y.muiName="FontIcon",y.defaultProps={onMouseEnter:function(){},onMouseLeave:function(){}},y.contextTypes={muiTheme:v.default.object.isRequired},y.propTypes={},e.default=y},function(t,e,n){"use strict";e.__esModule=!0;var r,o=n(51),i=(r=o)&&r.__esModule?r:{default:r};e.default=i.default||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}},function(t,e,n){t.exports={default:n(52),__esModule:!0}},function(t,e,n){n(53),t.exports=n(0).Object.assign},function(t,e,n){var r=n(2);r(r.S+r.F,"Object",{assign:n(55)})},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(13),o=n(24),i=n(16),u=n(25),c=n(35),a=Object.assign;t.exports=!a||n(8)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=a({},t)[n]||Object.keys(a({},e)).join("")!=r})?function(t,e){for(var n=u(t),a=arguments.length,f=1,s=o.f,l=i.f;a>f;)for(var p,v=c(arguments[f++]),d=s?r(v).concat(s(v)):r(v),h=d.length,y=0;h>y;)l.call(v,p=d[y++])&&(n[p]=v[p]);return n}:a},function(t,e,n){var r=n(9),o=n(57),i=n(58);t.exports=function(t){return function(e,n,u){var c,a=r(e),f=o(a.length),s=i(u,f);if(t&&n!=n){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}}},function(t,e,n){var r=n(20),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(20),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}},function(t,e,n){t.exports={default:n(61),__esModule:!0}},function(t,e,n){n(62),t.exports=n(0).Object.getPrototypeOf},function(t,e,n){var r=n(25),o=n(37);n(63)("getPrototypeOf",function(){return function(t){return o(r(t))}})},function(t,e,n){var r=n(2),o=n(0),i=n(8);t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],u={};u[t]=e(n),r(r.S+r.F*i(function(){n(1)}),"Object",u)}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var r,o=n(66),i=(r=o)&&r.__esModule?r:{default:r};e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},function(t,e,n){t.exports={default:n(67),__esModule:!0}},function(t,e,n){n(68);var r=n(0).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){var r=n(2);r(r.S+r.F*!n(4),"Object",{defineProperty:n(3).f})},function(t,e,n){"use strict";e.__esModule=!0;var r,o=n(38),i=(r=o)&&r.__esModule?r:{default:r};e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,i.default)(e))&&"function"!=typeof e?t:e}},function(t,e,n){t.exports={default:n(71),__esModule:!0}},function(t,e,n){n(72),n(77),t.exports=n(29).f("iterator")},function(t,e,n){"use strict";var r=n(73)(!0);n(39)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(20),o=n(19);t.exports=function(t){return function(e,n){var i,u,c=String(o(e)),a=r(n),f=c.length;return a<0||a>=f?t?"":void 0:(i=c.charCodeAt(a))<55296||i>56319||a+1===f||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):u-56320+(i-55296<<10)+65536}}},function(t,e,n){"use strict";var r=n(27),o=n(12),i=n(28),u={};n(6)(u,n(10)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(3),o=n(11),i=n(13);t.exports=n(4)?Object.defineProperties:function(t,e){o(t);for(var n,u=i(e),c=u.length,a=0;c>a;)r.f(t,n=u[a++],e[n]);return t}},function(t,e,n){var r=n(1).document;t.exports=r&&r.documentElement},function(t,e,n){n(78);for(var r=n(1),o=n(6),i=n(26),u=n(10)("toStringTag"),c="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),a=0;a<c.length;a++){var f=c[a],s=r[f],l=s&&s.prototype;l&&!l[u]&&o(l,u,f),i[f]=i.Array}},function(t,e,n){"use strict";var r=n(79),o=n(80),i=n(26),u=n(9);t.exports=n(39)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports={default:n(82),__esModule:!0}},function(t,e,n){n(83),n(88),n(89),n(90),t.exports=n(0).Symbol},function(t,e,n){"use strict";var r=n(1),o=n(5),i=n(4),u=n(2),c=n(40),a=n(84).KEY,f=n(8),s=n(22),l=n(28),p=n(15),v=n(10),d=n(29),h=n(30),y=n(85),b=n(86),_=n(11),g=n(7),m=n(9),O=n(18),S=n(12),x=n(27),E=n(87),T=n(42),j=n(3),w=n(13),M=T.f,P=j.f,I=E.f,C=r.Symbol,A=r.JSON,L=A&&A.stringify,k=v("_hidden"),F=v("toPrimitive"),N={}.propertyIsEnumerable,R=s("symbol-registry"),H=s("symbols"),V=s("op-symbols"),K=Object.prototype,Y="function"==typeof C,G=r.QObject,D=!G||!G.prototype||!G.prototype.findChild,z=i&&f(function(){return 7!=x(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=M(K,e);r&&delete K[e],P(t,e,n),r&&t!==K&&P(K,e,r)}:P,B=function(t){var e=H[t]=x(C.prototype);return e._k=t,e},W=Y&&"symbol"==typeof C.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof C},q=function(t,e,n){return t===K&&q(V,e,n),_(t),e=O(e,!0),_(n),o(H,e)?(n.enumerable?(o(t,k)&&t[k][e]&&(t[k][e]=!1),n=x(n,{enumerable:S(0,!1)})):(o(t,k)||P(t,k,S(1,{})),t[k][e]=!0),z(t,e,n)):P(t,e,n)},J=function(t,e){_(t);for(var n,r=y(e=m(e)),o=0,i=r.length;i>o;)q(t,n=r[o++],e[n]);return t},U=function(t){var e=N.call(this,t=O(t,!0));return!(this===K&&o(H,t)&&!o(V,t))&&(!(e||!o(this,t)||!o(H,t)||o(this,k)&&this[k][t])||e)},X=function(t,e){if(t=m(t),e=O(e,!0),t!==K||!o(H,e)||o(V,e)){var n=M(t,e);return!n||!o(H,e)||o(t,k)&&t[k][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=I(m(t)),r=[],i=0;n.length>i;)o(H,e=n[i++])||e==k||e==a||r.push(e);return r},Z=function(t){for(var e,n=t===K,r=I(n?V:m(t)),i=[],u=0;r.length>u;)!o(H,e=r[u++])||n&&!o(K,e)||i.push(H[e]);return i};Y||(c((C=function(){if(this instanceof C)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===K&&e.call(V,n),o(this,k)&&o(this[k],t)&&(this[k][t]=!1),z(this,t,S(1,n))};return i&&D&&z(K,t,{configurable:!0,set:e}),B(t)}).prototype,"toString",function(){return this._k}),T.f=X,j.f=q,n(41).f=E.f=Q,n(16).f=U,n(24).f=Z,i&&!n(14)&&c(K,"propertyIsEnumerable",U,!0),d.f=function(t){return B(v(t))}),u(u.G+u.W+u.F*!Y,{Symbol:C});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;$.length>tt;)v($[tt++]);for(var et=w(v.store),nt=0;et.length>nt;)h(et[nt++]);u(u.S+u.F*!Y,"Symbol",{for:function(t){return o(R,t+="")?R[t]:R[t]=C(t)},keyFor:function(t){if(!W(t))throw TypeError(t+" is not a symbol!");for(var e in R)if(R[e]===t)return e},useSetter:function(){D=!0},useSimple:function(){D=!1}}),u(u.S+u.F*!Y,"Object",{create:function(t,e){return void 0===e?x(t):J(x(t),e)},defineProperty:q,defineProperties:J,getOwnPropertyDescriptor:X,getOwnPropertyNames:Q,getOwnPropertySymbols:Z}),A&&u(u.S+u.F*(!Y||f(function(){var t=C();return"[null]"!=L([t])||"{}"!=L({a:t})||"{}"!=L(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(g(e)||void 0!==t)&&!W(t))return b(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!W(e))return e}),r[1]=e,L.apply(A,r)}}),C.prototype[F]||n(6)(C.prototype,F,C.prototype.valueOf),l(C,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(15)("meta"),o=n(7),i=n(5),u=n(3).f,c=0,a=Object.isExtensible||function(){return!0},f=!n(8)(function(){return a(Object.preventExtensions({}))}),s=function(t){u(t,r,{value:{i:"O"+ ++c,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!a(t))return"F";if(!e)return"E";s(t)}return t[r].i},getWeak:function(t,e){if(!i(t,r)){if(!a(t))return!0;if(!e)return!1;s(t)}return t[r].w},onFreeze:function(t){return f&&l.NEED&&a(t)&&!i(t,r)&&s(t),t}}},function(t,e,n){var r=n(13),o=n(24),i=n(16);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var u,c=n(t),a=i.f,f=0;c.length>f;)a.call(t,u=c[f++])&&e.push(u);return e}},function(t,e,n){var r=n(36);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(9),o=n(41).f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return u.slice()}}(t):o(r(t))}},function(t,e){},function(t,e,n){n(30)("asyncIterator")},function(t,e,n){n(30)("observable")},function(t,e,n){"use strict";e.__esModule=!0;var r=u(n(92)),o=u(n(96)),i=u(n(38));function u(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,i.default)(e)));t.prototype=(0,o.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(r.default?(0,r.default)(t,e):t.__proto__=e)}},function(t,e,n){t.exports={default:n(93),__esModule:!0}},function(t,e,n){n(94),t.exports=n(0).Object.setPrototypeOf},function(t,e,n){var r=n(2);r(r.S,"Object",{setPrototypeOf:n(95).set})},function(t,e,n){var r=n(7),o=n(11),i=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(31)(Function.call,n(42).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:i}},function(t,e,n){t.exports={default:n(97),__esModule:!0}},function(t,e,n){n(98);var r=n(0).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){var r=n(2);r(r.S,"Object",{create:n(27)})},function(t,e){t.exports=function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}},function(t,e,n){t.exports=n(101)()},function(t,e,n){"use strict";var r=n(102);function o(){}t.exports=function(){function t(t,e,n,o,i,u){if(u!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=o,n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={easeOutFunction:"cubic-bezier(0.23, 1, 0.32, 1)",easeInOutFunction:"cubic-bezier(0.445, 0.05, 0.55, 0.95)",easeOut:function(t,e,n,r){if(r=r||this.easeOutFunction,e&&"[object Array]"===Object.prototype.toString.call(e)){for(var o="",i=0;i<e.length;i++)o&&(o+=","),o+=this.create(t,e[i],n,r);return o}return this.create(t,e,n,r)},create:function(t,e,n,r){return t=t||"450ms",e=e||"all",n=n||"0ms",e+" "+t+" "+(r=r||"linear")+" "+n}}}]).default}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactFlexRating=t(require("react")):e.ReactFlexRating=t(e.React)}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(t,n){t.exports=e},function(e,t,n){"use strict";t.a=function(e,t){return(e||"")+(t?" "+t:"")}},function(e,t,n){"use strict";t.a=function(){}},function(e,t,n){e.exports=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"default",function(){return f});var o,i,r=n(0),a=n.n(r),c=n(5),u=n(1),l=n(2),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};var f=(i=o=function(e){function t(n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));return o.state=s({},t.initialState),o.renderIcons=o.renderIcons.bind(o),o.getIconConfigs=o.getIconConfigs.bind(o),o.onMove=o.onMove.bind(o),o.onSelect=o.onSelect.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getIconConfigs=function(){for(var e=this.props,n=e.allowHalfs,o=void 0===n?t.defaultProps.allowHalfs:n,i=e.iconCount,r=void 0===i?t.defaultProps.iconCount:i,a=e.value,u=void 0===a?t.defaultProps.value:a,l=e.maxValue,s=void 0===l?t.defaultProps.maxValue:l,f=this.state,v=f.highlightCount,d=f.hoverPercent,g=s/r,E=[],T=0,I=1;I<=r;I++){var b,y=I*g,_=h(y,u);T=_?y:T;var S=o&&v===I&&d<.5&&I*g<=u,A=_&&!S?c.a.ACTIVE_STATE_KEY:p(o,y,T,g,u)||S?c.a.HALF_STATE_KEY:c.a.INACTIVE_STATE_KEY;E.push(((b={})[A]=!0,b.half=A===c.a.HALF_STATE_KEY||A===c.a.INACTIVE_STATE_KEY&&v===I&&d<.5||void 0,b.highlight=v>=I||void 0,b.highlightBackgroundIcon=v>I||v===I&&d>=.5,b.value=y,b))}return E},t.calculateInteractPercentage=function(e,t){if(!t.allowHalfs)return 1;var n=e.nativeEvent.type.indexOf("touch")>-1?e.nativeEvent.type.indexOf("touchend")>-1?e.changedTouches[0].clientX:e.touches[0].clientX:e.clientX,o=e.target.getBoundingClientRect(),i=n-o.left;return i<0?0:i/o.width},t.prototype.renderIcons=function(){var e=this,t=this.props,n=t.activeIcon,o=t.inactiveIcon,i=t.halfIcon,r=t.highlightIcon,u=t.disabled;return this.getIconConfigs().map(function(t,l){return a.a.createElement(c.a,s({activeIcon:n,inactiveIcon:o,halfIcon:i,highlightIcon:r,key:l,onMove:u?void 0:e.onMove,onSelect:u?void 0:e.onSelect},t))})},t.prototype.onMove=function(e,n){var o=this.props,i=o.iconCount,r=o.maxValue/i,a=t.calculateInteractPercentage(e,this.props);this.setState({highlightCount:n/r,hoverPercent:a})},t.prototype.onSelect=function(e,n){var o=this.props,i=o.iconCount,r=o.maxValue,a=o.onSelect,c=void 0===a?l.a:a;c(n=t.calculateInteractPercentage(e,this.props)<.5?n-r/i/2:n,e),this.setState.apply(this,t.initialState)},t.prototype.render=function(){var e=this,n=this.props,o=n.className,i=n.disabled;return a.a.createElement("span",{style:{display:"inline-block",direction:"ltr"},className:Object(u.a)(Object(u.a)("rating",i&&"disabled"),o),onMouseLeave:function(){return!i&&e.setState(s({},t.initialState))}},this.renderIcons())},t}(a.a.Component),o.initialState={highlightCount:0,hoverPercent:0},o.defaultProps={iconCount:5,value:0,maxValue:100,allowHalfs:!1,disabled:!1},i),p=function(e,t,n,o,i){return e&&t-n===o&&t>i&&i%o},h=function(e,t){return e<=t}},function(e,t,n){"use strict";var o=n(0),i=n.n(o),r=n(1),a=n(2),c=function(e,t){var n=t.value,o=t.onMove;return(void 0===o?a.a:o)(e,n)},u=function(e,t){var n=t.value,o=t.onSelect;return(void 0===o?a.a:o)(e,n)},l=function(e){var t=e.active,n=void 0===t?"":t,o=e.inactive,i=void 0===o?"":o,r=e.half,a=void 0===r?"":r,c=e.highlight,u=void 0===c?"":c;return[""+(n&&s.ACTIVE_STATE_KEY+" "),""+(i&&s.INACTIVE_STATE_KEY+" "),""+(a&&s.HALF_STATE_KEY+" "),""+(u&&s.HIGHLIGHT_STATE_KEY+" ")].join("")},s=function e(t){var n=t.activeIcon,o=t.inactiveIcon,a=t.active,s=t.inactive,f=t.half,p=t.highlight,h=t.highlightBackgroundIcon,v=o,d=s&&f&&p?o:a||f?n:o,g={display:"inline-block",position:"absolute",overflow:"hidden",top:0,left:0,width:(f?50:100)+"%"};return i.a.createElement("span",{style:{display:"inline-block",position:"relative"},className:Object(r.a)("rating-icon",l({active:a,inactive:s,half:f,highlight:p})),onMouseMove:function(e){return c(e,t)},onTouchMove:function(e){return c(e,t)},onClick:function(e){return e.preventDefault(),u(e,t)},onTouchEnd:function(e){return e.preventDefault(),u(e,t)}},i.a.createElement("span",{className:Object(r.a)("background-icon",h?e.HIGHLIGHT_STATE_KEY:"")},v),i.a.createElement("span",{className:"display-icon",style:g},d))};s.ACTIVE_STATE_KEY="active",s.INACTIVE_STATE_KEY="inactive",s.HALF_STATE_KEY="half",s.HIGHLIGHT_STATE_KEY="highlight",t.a=s}]).default}); | ||
//# sourceMappingURL=react-flex-rating.min.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
1
1
70535
6
876
64
- Removedmaterial-ui@0.20.0
- Removed@babel/runtime@7.0.0-beta.427.25.6(transitive)
- Removedasap@2.0.6(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedbowser@1.9.4(transitive)
- Removedchain-function@1.0.1(transitive)
- Removedchange-emitter@0.1.6(transitive)
- Removedcore-js@1.2.72.6.12(transitive)
- Removedcss-in-js-utils@2.0.1(transitive)
- Removeddom-helpers@3.4.0(transitive)
- Removedencoding@0.1.13(transitive)
- Removedfbjs@0.8.18(transitive)
- Removedhoist-non-react-statics@2.5.5(transitive)
- Removedhyphenate-style-name@1.1.0(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedinline-style-prefixer@3.0.8(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisobject@3.0.1(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removedkeycode@2.2.1(transitive)
- Removedlodash.merge@4.6.2(transitive)
- Removedlodash.throttle@4.1.1(transitive)
- Removedmaterial-ui@0.20.0(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedpromise@7.3.1(transitive)
- Removedreact-dom@16.14.0(transitive)
- Removedreact-event-listener@0.5.10(transitive)
- Removedreact-transition-group@1.2.1(transitive)
- Removedrecompose@0.26.0(transitive)
- Removedregenerator-runtime@0.11.10.14.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedscheduler@0.19.1(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedsimple-assign@0.1.0(transitive)
- Removedsymbol-observable@1.2.0(transitive)
- Removedua-parser-js@0.7.39(transitive)
- Removedwarning@3.0.0(transitive)
- Removedwhatwg-fetch@3.6.20(transitive)