Skip to content

Commit

Permalink
Release v0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchin committed Jun 13, 2016
1 parent 43d8b6f commit 6e7ee89
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 28 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dist/react-input-range.js",
"dist/react-input-range.css"
],
"version": "0.8.0",
"version": "0.9.0",
"description": "React component for inputting numeric values within a range",
"homepage": "https://github.com/davidchin/react-input-range",
"authors": [
Expand Down
3 changes: 2 additions & 1 deletion dist/react-input-range.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
.InputRange-label {
color: #aaaaaa;
font-family: "Helvetica Neue", san-serif;
font-size: 0.8rem; }
font-size: 0.8rem;
white-space: nowrap; }

.InputRange-label--min,
.InputRange-label--max {
Expand Down
70 changes: 47 additions & 23 deletions dist/react-input-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ function renderSliders(inputRange) {
ariaLabelledby: inputRange.props.ariaLabelledby,
ariaControls: inputRange.props.ariaControls,
classNames: classNames,
formatLabel: inputRange.formatLabel,
key: key,
maxValue: maxValue,
minValue: minValue,
Expand Down Expand Up @@ -231,7 +232,7 @@ var InputRange = (function (_React$Component) {

internals.set(this, {});

(0, _util.autobind)(['handleInteractionEnd', 'handleInteractionStart', 'handleKeyDown', 'handleKeyUp', 'handleMouseDown', 'handleMouseUp', 'handleSliderKeyDown', 'handleSliderMouseMove', 'handleTouchStart', 'handleTouchEnd', 'handleTrackMouseDown'], this);
(0, _util.autobind)(['formatLabel', 'handleInteractionEnd', 'handleInteractionStart', 'handleKeyDown', 'handleKeyUp', 'handleMouseDown', 'handleMouseUp', 'handleSliderKeyDown', 'handleSliderMouseMove', 'handleTouchStart', 'handleTouchEnd', 'handleTrackMouseDown'], this);
}

_createClass(InputRange, [{
Expand Down Expand Up @@ -297,6 +298,20 @@ var InputRange = (function (_React$Component) {

this.updateValue(key, value);
}
}, {
key: 'formatLabel',
value: function formatLabel(labelValue) {
var _props = this.props;
var formatLabel = _props.formatLabel;
var labelPrefix = _props.labelPrefix;
var labelSuffix = _props.labelSuffix;

if (formatLabel) {
return formatLabel(labelValue, { labelPrefix: labelPrefix, labelSuffix: labelSuffix });
}

return '' + labelPrefix + labelValue + labelSuffix;
}
}, {
key: 'handleSliderMouseMove',
value: function handleSliderMouseMove(event, slider) {
Expand Down Expand Up @@ -443,7 +458,8 @@ var InputRange = (function (_React$Component) {
_Label2['default'],
{
className: classNames.labelMin,
containerClassName: classNames.labelContainer },
containerClassName: classNames.labelContainer,
formatLabel: this.formatLabel },
this.props.minValue
),
_react2['default'].createElement(
Expand All @@ -459,7 +475,8 @@ var InputRange = (function (_React$Component) {
_Label2['default'],
{
className: classNames.labelMax,
containerClassName: classNames.labelContainer },
containerClassName: classNames.labelContainer,
formatLabel: this.formatLabel },
this.props.maxValue
),
renderHiddenInputs(this)
Expand Down Expand Up @@ -499,6 +516,9 @@ InputRange.propTypes = {
classNames: _react2['default'].PropTypes.objectOf(_react2['default'].PropTypes.string),
defaultValue: _propTypes.maxMinValuePropType,
disabled: _react2['default'].PropTypes.bool,
formatLabel: _react2['default'].PropTypes.func,
labelPrefix: _react2['default'].PropTypes.string,
labelSuffix: _react2['default'].PropTypes.string,
maxValue: _propTypes.maxMinValuePropType,
minValue: _propTypes.maxMinValuePropType,
name: _react2['default'].PropTypes.string,
Expand All @@ -512,6 +532,8 @@ InputRange.defaultProps = {
classNames: _defaultClassNames2['default'],
defaultValue: 0,
disabled: false,
labelPrefix: '',
labelSuffix: '',
maxValue: 10,
minValue: 0,
step: 1,
Expand Down Expand Up @@ -558,13 +580,15 @@ var Label = (function (_React$Component) {
var className = _props.className;
var containerClassName = _props.containerClassName;

var labelValue = this.props.formatLabel ? this.props.formatLabel(this.props.children) : this.props.children;

return _react2['default'].createElement(
'span',
{ className: className },
_react2['default'].createElement(
'span',
{ className: containerClassName },
this.props.children
labelValue
)
);
}
Expand All @@ -578,7 +602,8 @@ exports['default'] = Label;
Label.propTypes = {
children: _react2['default'].PropTypes.node,
className: _react2['default'].PropTypes.string,
containerClassName: _react2['default'].PropTypes.string
containerClassName: _react2['default'].PropTypes.string,
formatLabel: _react2['default'].PropTypes.func
};
module.exports = exports['default'];

Expand Down Expand Up @@ -710,7 +735,8 @@ var Slider = (function (_React$Component) {
_Label2['default'],
{
className: classNames.labelValue,
containerClassName: classNames.labelContainer },
containerClassName: classNames.labelContainer,
formatLabel: this.props.formatLabel },
this.props.value
),
_react2['default'].createElement('a', {
Expand Down Expand Up @@ -740,6 +766,7 @@ Slider.propTypes = {
ariaLabelledby: _react2['default'].PropTypes.string,
ariaControls: _react2['default'].PropTypes.string,
classNames: _react2['default'].PropTypes.objectOf(_react2['default'].PropTypes.string),
formatLabel: _react2['default'].PropTypes.func,
maxValue: _react2['default'].PropTypes.number,
minValue: _react2['default'].PropTypes.number,
onSliderKeyDown: _react2['default'].PropTypes.func.isRequired,
Expand Down Expand Up @@ -933,6 +960,20 @@ function maxMinValuePropType(props) {
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.clamp = clamp;
exports.extend = extend;
exports.includes = includes;
exports.omit = omit;
exports.captialize = captialize;
exports.distanceTo = distanceTo;
exports.length = length;
exports.isNumber = isNumber;
exports.isObject = isObject;
exports.isDefined = isDefined;
exports.isEmpty = isEmpty;
exports.arrayOf = arrayOf;
exports.objectOf = objectOf;
exports.autobind = autobind;

function clamp(value, min, max) {
return Math.min(Math.max(value, min), max);
Expand Down Expand Up @@ -1033,23 +1074,6 @@ function autobind(methodNames, instance) {
});
}

exports['default'] = {
arrayOf: arrayOf,
autobind: autobind,
captialize: captialize,
clamp: clamp,
distanceTo: distanceTo,
extend: extend,
isDefined: isDefined,
isEmpty: isEmpty,
isNumber: isNumber,
isObject: isObject,
length: length,
objectOf: objectOf,
omit: omit
};
module.exports = exports['default'];

},{}],8:[function(require,module,exports){
'use strict';

Expand Down
2 changes: 1 addition & 1 deletion dist/react-input-range.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/react-input-range.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-input-range",
"version": "0.8.0",
"version": "0.9.0",
"description": "React component for inputting numeric values within a range",
"keywords": [
"react",
Expand Down

0 comments on commit 6e7ee89

Please sign in to comment.