Comparing version 2.0.5 to 2.0.6
@@ -7,2 +7,7 @@ # Change Log | ||
## 2.0.6 - 2016-04-05 | ||
### Fixed | ||
- [Rating] Fixed an issue in Safari where selecting a rating was not possible [#277](https://github.com/nikgraf/belle/issues/277) | ||
## 2.0.5 - 2016-03-28 | ||
@@ -9,0 +14,0 @@ |
@@ -156,4 +156,5 @@ 'use strict'; | ||
var childProps = _objectWithoutProperties(properties, ['style']); | ||
var childProps = _objectWithoutProperties(properties, ['style']); // eslint-disable-line no-unused-vars | ||
_this.childProps = childProps; | ||
@@ -173,4 +174,5 @@ return _this; | ||
var childProps = _objectWithoutProperties(properties, ['style']); | ||
var childProps = _objectWithoutProperties(properties, ['style']); // eslint-disable-line no-unused-vars | ||
this.childProps = childProps; | ||
@@ -177,0 +179,0 @@ } |
@@ -7,6 +7,6 @@ 'use strict'; | ||
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; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
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; }; | ||
var _react = require('react'); | ||
@@ -16,8 +16,2 @@ | ||
var _helpers = require('../../utils/helpers'); | ||
var _styles = require('./styles'); | ||
var _styles2 = _interopRequireDefault(_styles); | ||
var _unionClassNames = require('../../utils/union-class-names'); | ||
@@ -27,10 +21,6 @@ | ||
var _injectStyle = require('../../utils/inject-style'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _config = require('./config'); | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
var _config2 = _interopRequireDefault(_config); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -42,79 +32,8 @@ | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
var buttonTypes = ['button', 'submit', 'reset']; // eslint-disable-line no-unused-vars | ||
var buttonTypes = ['button', 'submit', 'reset']; | ||
/** | ||
* Returns an object with properties that are relevant for the button element. | ||
* | ||
* In case a wrong or no type is defined the type of the child button will be | ||
* set to `button`. | ||
*/ | ||
function sanitizeChildProps(properties) { | ||
var className = properties.className; | ||
var style = properties.style; | ||
var hoverStyle = properties.hoverStyle; | ||
var focusStyle = properties.focusStyle; | ||
var activeStyle = properties.activeStyle; | ||
var disabledStyle = properties.disabledStyle; | ||
var disabledHoverStyle = properties.disabledHoverStyle; | ||
var primary = properties.primary; | ||
var onTouchStart = properties.onTouchStart; | ||
var onTouchEnd = properties.onTouchEnd; | ||
var onTouchCancel = properties.onTouchCancel; | ||
var onMouseDown = properties.onMouseDown; | ||
var onMouseEnter = properties.onMouseEnter; | ||
var onMouseLeave = properties.onMouseLeave; | ||
var onFocus = properties.onFocus; | ||
var onBlur = properties.onBlur; | ||
var childProps = _objectWithoutProperties(properties, ['className', 'style', 'hoverStyle', 'focusStyle', 'activeStyle', 'disabledStyle', 'disabledHoverStyle', 'primary', 'onTouchStart', 'onTouchEnd', 'onTouchCancel', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur']); | ||
return childProps; | ||
} | ||
/** | ||
* Update hover, focus & active style for the speficied styleId. | ||
* | ||
* @param styleId {string} - a unique id that exists as class attribute in the DOM | ||
* @param properties {object} - the components properties optionally containing custom styles | ||
*/ | ||
function updatePseudoClassStyle(styleId, properties, preventFocusStyleForTouchAndClick) { | ||
var baseStyle = properties.primary ? _styles2.default.primaryStyle : _styles2.default.style; | ||
var baseDisabledStyle = properties.primary ? _styles2.default.primaryDisabledStyle : _styles2.default.disabledStyle; | ||
var disabledStyle = _extends({}, baseStyle, properties.style, baseDisabledStyle, properties.disabledStyle); | ||
var baseActiveStyle = properties.primary ? _styles2.default.primaryActiveStyle : _styles2.default.activeStyle; | ||
var activeStyle = _extends({}, baseActiveStyle, properties.activeStyle); | ||
var focusStyle = undefined; | ||
if (preventFocusStyleForTouchAndClick) { | ||
focusStyle = { outline: 0 }; | ||
} else { | ||
var baseFocusStyle = properties.primary ? _styles2.default.primaryFocusStyle : _styles2.default.focusStyle; | ||
focusStyle = _extends({}, baseFocusStyle, properties.focusStyle); | ||
} | ||
var styles = [{ | ||
id: styleId, | ||
style: activeStyle, | ||
pseudoClass: 'active' | ||
}, { | ||
id: styleId, | ||
style: disabledStyle, | ||
pseudoClass: 'active', | ||
disabled: true | ||
}, { | ||
id: styleId, | ||
style: focusStyle, | ||
pseudoClass: 'focus' | ||
}]; | ||
(0, _injectStyle.injectStyles)(styles); | ||
} | ||
/** | ||
* Button component | ||
* | ||
* The button behaves exactly like a normal html button except: | ||
* - Once a user clicks on the button it will loose focus | ||
* - By default every button is of type="button" instead of "submit" | ||
@@ -126,256 +45,20 @@ */ | ||
function Button(properties) { | ||
function Button() { | ||
_classCallCheck(this, Button); | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Button).call(this, properties)); | ||
_this._onFocus = function (event) { | ||
_this.focused = true; | ||
_this.forceUpdate(); | ||
if (_this.props.onFocus) { | ||
_this.props.onFocus(event); | ||
} | ||
}; | ||
_this._onBlur = function (event) { | ||
_this.focused = false; | ||
_this.setState({ isActive: false }); | ||
if (_this.props.onBlur) { | ||
_this.props.onBlur(event); | ||
} | ||
}; | ||
_this._onMouseDown = function (event) { | ||
if (event.button === 0 && !_this.props.disabled) { | ||
_this.mouseDownOnButton = true; | ||
} | ||
if (_this.props.onMouseDown) { | ||
_this.props.onMouseDown(event); | ||
} | ||
}; | ||
_this._onTouchStart = function (event) { | ||
if (!_this.props.disabled && event.touches.length === 1) { | ||
_this.setState({ | ||
isActive: true, | ||
isIgnoringHover: true | ||
}); | ||
} | ||
if (_this.props.onTouchStart) { | ||
_this.props.onTouchStart(event); | ||
} | ||
}; | ||
_this._onTouchEnd = function (event) { | ||
_this.setState({ | ||
isActive: false, | ||
isIgnoringHover: true | ||
}); | ||
if (_this.props.onTouchEnd) { | ||
_this.props.onTouchEnd(event); | ||
} | ||
}; | ||
_this._onTouchCancel = function (event) { | ||
_this.setState({ | ||
isActive: false, | ||
isIgnoringHover: true | ||
}); | ||
if (_this.props.onTouchEnd) { | ||
_this.props.onTouchEnd(event); | ||
} | ||
}; | ||
_this._onMouseEnter = function (event) { | ||
if (!_this.state.isIgnoringHover) { | ||
_this.setState({ | ||
isHovered: true, | ||
isIgnoringHover: false | ||
}); | ||
} | ||
if (_this.props.onMouseEnter) { | ||
_this.props.onMouseEnter(event); | ||
} | ||
}; | ||
_this._onMouseLeave = function (event) { | ||
_this.setState({ | ||
isHovered: false | ||
}); | ||
if (_this.props.onMouseLeave) { | ||
_this.props.onMouseLeave(event); | ||
} | ||
}; | ||
_this.preventFocusStyleForTouchAndClick = (0, _helpers.has)(properties, 'preventFocusStyleForTouchAndClick') ? properties.preventFocusStyleForTouchAndClick : _config2.default.preventFocusStyleForTouchAndClick; | ||
_this.state = { | ||
childProps: sanitizeChildProps(properties), | ||
// used for touch devices like iOS Chrome/Safari where the active | ||
// pseudoClass is not supported on touch | ||
isActive: false, | ||
isHovered: false, | ||
// Note: On touch devices mouseEnter is fired while mouseLeave is not. | ||
// This would result in a hover effect that keeps active until another | ||
// element is focused on. This would result in the same behaviour as using | ||
// the :hover pseudo class. To prevent it from happening activating the | ||
// hover state is prevented when a touch event has been triggered before. | ||
// source: http://stackoverflow.com/a/22444532/837709 | ||
isIgnoringHover: false | ||
}; | ||
// The focused attribute is used to apply the one-time focus animation. | ||
// As it is reset after every render it can't be set inside state as this | ||
// would trigger an endless loop. | ||
_this.focused = false; | ||
// This used to determine if the one-time focus animation should be prevented. | ||
_this.mouseDownOnButton = false; | ||
return _this; | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(Button).apply(this, arguments)); | ||
} | ||
_createClass(Button, [{ | ||
key: 'componentWillMount', | ||
/** | ||
* Generates the style-id & inject the focus & active style. | ||
* | ||
* The style-id is based on React's unique DOM node id. | ||
*/ | ||
value: function componentWillMount() { | ||
var id = this._reactInternalInstance._rootNodeID.replace(/[\.\:\$\/\=]/g, '-'); | ||
this.styleId = 'style-id' + id; | ||
updatePseudoClassStyle(this.styleId, this.props, this.preventFocusStyleForTouchAndClick); | ||
} | ||
/** | ||
* Update the childProps based on the updated properties of the button. | ||
*/ | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
value: function componentWillReceiveProps(properties) { | ||
this.preventFocusStyleForTouchAndClick = (0, _helpers.has)(properties, 'preventFocusStyleForTouchAndClick') ? properties.preventFocusStyleForTouchAndClick : _config2.default.preventFocusStyleForTouchAndClick; | ||
this.setState({ | ||
childProps: sanitizeChildProps(properties) | ||
}); | ||
(0, _injectStyle.removeStyle)(this.styleId); | ||
updatePseudoClassStyle(this.styleId, properties, this.preventFocusStyleForTouchAndClick); | ||
} | ||
/** | ||
* Deactivate the focused attribute in order to make sure the focus animation | ||
* only runs once when the component is focused on & not after re-rendering | ||
* e.g when the user clicks the button. | ||
*/ | ||
}, { | ||
key: 'componentDidUpdate', | ||
value: function componentDidUpdate() { | ||
this.focused = false; | ||
this.mouseDownOnButton = false; | ||
} | ||
/** | ||
* Remove a component's associated styles whenever it gets removed from the DOM. | ||
*/ | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
(0, _injectStyle.removeStyle)(this.styleId); | ||
} | ||
/** | ||
* Activate the focused attribute used to determine when to show the | ||
* one-time focus animation and trigger a render. | ||
*/ | ||
/** | ||
* Deactivate the focused attribute used to determine when to show the | ||
* one-time focus animation and trigger a render. | ||
*/ | ||
/** | ||
* Updates the button to be pressed. | ||
*/ | ||
/** | ||
* Updates the button to be release. | ||
*/ | ||
/** | ||
* Updates the button to be release. | ||
*/ | ||
/** | ||
* As soon as the mouse enters the component the isHovered state is activated. | ||
*/ | ||
/** | ||
* Deactivate the isHovered state. | ||
*/ | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
var baseStyle = this.props.primary ? _styles2.default.primaryStyle : _styles2.default.style; | ||
var combinedStyle = _extends({}, baseStyle, this.props.style); | ||
var _props = this.props; | ||
var theme = _props.theme; | ||
var className = _props.className; | ||
if (this.state.isHovered) { | ||
var baseHoverStyle = this.props.primary ? _styles2.default.primaryHoverStyle : _styles2.default.hoverStyle; | ||
combinedStyle = _extends({}, combinedStyle, baseHoverStyle, this.props.hoverStyle); | ||
} | ||
var otherProps = _objectWithoutProperties(_props, ['theme', 'className']); | ||
if (this.props.disabled) { | ||
var baseDisabledStyle = this.props.primary ? _styles2.default.primaryDisabledStyle : _styles2.default.disabledStyle; | ||
combinedStyle = _extends({}, combinedStyle, baseDisabledStyle, this.props.disabledStyle); | ||
if (this.state.isHovered) { | ||
var baseDisabledHoverStyle = this.props.primary ? _styles2.default.primaryDisabledHoverStyle : _styles2.default.disabledHoverStyle; | ||
combinedStyle = _extends({}, combinedStyle, baseDisabledHoverStyle, this.props.disabledHoverStyle); | ||
} | ||
} else { | ||
if (this.state.isActive) { | ||
var baseActiveStyle = this.props.primary ? _styles2.default.primaryActiveStyle : _styles2.default.activeStyle; | ||
combinedStyle = _extends({}, combinedStyle, baseActiveStyle, this.props.activeStyle); | ||
} else if (this.focused && !this.state.isActive && !this.mouseDownOnButton && this.preventFocusStyleForTouchAndClick) { | ||
var baseFocusStyle = this.props.primary ? _styles2.default.primaryFocusStyle : _styles2.default.focusStyle; | ||
combinedStyle = _extends({}, combinedStyle, baseFocusStyle, this.props.focusStyle); | ||
} | ||
} | ||
return _react2.default.createElement( | ||
'button', | ||
_extends({ | ||
style: combinedStyle, | ||
className: (0, _unionClassNames2.default)(this.props.className, this.styleId), | ||
onTouchStart: this._onTouchStart, | ||
onTouchEnd: this._onTouchEnd, | ||
onTouchCancel: this._onTouchCancel, | ||
onFocus: this._onFocus, | ||
onBlur: this._onBlur, | ||
onMouseDown: this._onMouseDown, | ||
onMouseEnter: this._onMouseEnter, | ||
onMouseLeave: this._onMouseLeave | ||
}, this.state.childProps), | ||
this.props.children | ||
); | ||
return _react2.default.createElement('button', _extends({ | ||
className: (0, _unionClassNames2.default)(theme.base, className) | ||
}, otherProps)); | ||
} | ||
@@ -389,28 +72,11 @@ }]); | ||
Button.propTypes = { | ||
activeStyle: _react.PropTypes.object, | ||
children: _react.PropTypes.oneOfType([_react.PropTypes.arrayOf(_react.PropTypes.node), _react.PropTypes.node]), | ||
className: _react.PropTypes.string, | ||
disabled: _react.PropTypes.bool, | ||
type: _react.PropTypes.oneOf(buttonTypes), | ||
style: _react.PropTypes.object, | ||
focusStyle: _react.PropTypes.object, | ||
hoverStyle: _react.PropTypes.object, | ||
disabledStyle: _react.PropTypes.object, | ||
disabledHoverStyle: _react.PropTypes.object, | ||
onTouchStart: _react.PropTypes.func, | ||
onTouchEnd: _react.PropTypes.func, | ||
onTouchCancel: _react.PropTypes.func, | ||
onMouseDown: _react.PropTypes.func, | ||
onMouseEnter: _react.PropTypes.func, | ||
onMouseLeave: _react.PropTypes.func, | ||
onFocus: _react.PropTypes.func, | ||
onBlur: _react.PropTypes.func, | ||
preventFocusStyleForTouchAndClick: _react.PropTypes.bool, | ||
primary: _react.PropTypes.bool | ||
theme: _react.PropTypes.objectOf(_react.PropTypes.string).isRequired, | ||
className: _react.PropTypes.string | ||
}; | ||
Button.defaultProps = { | ||
primary: false, | ||
disabled: false, | ||
type: 'button' | ||
type: 'button', | ||
theme: {} | ||
}; | ||
exports.default = Button; |
@@ -54,2 +54,5 @@ 'use strict'; | ||
} | ||
// to avoid the app breaking | ||
}]); | ||
@@ -63,5 +66,8 @@ | ||
children: _react.PropTypes.node, | ||
theme: _react.PropTypes.objectOf(_react.PropTypes.string), | ||
theme: _react.PropTypes.objectOf(_react.PropTypes.string).isRequired, | ||
className: _react.PropTypes.string | ||
}; | ||
Card.defaultProps = { | ||
theme: {} | ||
}; | ||
exports.default = Card; |
@@ -28,6 +28,6 @@ 'use strict'; | ||
function Choice(properties) { | ||
function Choice() { | ||
_classCallCheck(this, Choice); | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(Choice).call(this, properties)); | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(Choice).apply(this, arguments)); | ||
} | ||
@@ -34,0 +34,0 @@ |
@@ -268,3 +268,3 @@ 'use strict'; | ||
var inputValue = undefined; | ||
var inputValue = void 0; | ||
@@ -296,3 +296,3 @@ if ((0, _helpers.has)(properties, 'valueLink')) { | ||
value: function getChildContext() { | ||
var value = undefined; | ||
var value = void 0; | ||
if (typeof this.state.focusedOptionIndex !== 'undefined') { | ||
@@ -326,3 +326,3 @@ value = this.filteredOptions[this.state.focusedOptionIndex].props.value; | ||
if (filteredOptions && filteredOptions.length > 0) { | ||
var hint = undefined; | ||
var hint = void 0; | ||
var focusedOptionIndex = this.state.focusedOptionIndex; | ||
@@ -350,2 +350,4 @@ var inputValue = this.state.inputValue; | ||
} | ||
return undefined; | ||
} | ||
@@ -355,3 +357,2 @@ | ||
* Generates the style-id & inject the focus & hover style. | ||
* The style-id is based on React's unique DOM node id. | ||
*/ | ||
@@ -362,3 +363,3 @@ | ||
value: function componentWillMount() { | ||
var id = this._reactInternalInstance._rootNodeID.replace(/[\.\:\$\/\=]/g, '-'); | ||
var id = (0, _helpers.uniqueId)(); | ||
this._styleId = 'style-id' + id; | ||
@@ -561,3 +562,3 @@ this._caretStyleId = 'caretStyle-id' + id; | ||
value: function _getValueForIndex(index) { | ||
return this.props.children[index].props.value; | ||
return this.filteredOptions[index].props.value; | ||
} | ||
@@ -636,3 +637,3 @@ | ||
// todo: Currently there are no different hover styles for caret, like select they are probably not really needed. | ||
var caretStyle = undefined; | ||
var caretStyle = void 0; | ||
if (this.props.displayCaret) { | ||
@@ -639,0 +640,0 @@ if (this.props.disabled) { |
@@ -93,3 +93,3 @@ 'use strict'; | ||
width: 0, | ||
content: ' ', | ||
content: '-', // Avoid this warning: was passed a numeric string value for CSS property `content` (value: ` `) | ||
position: 'absolute', | ||
@@ -107,3 +107,3 @@ top: 15, | ||
width: 0, | ||
content: ' ', | ||
content: '-', // Avoid this warning: was passed a numeric string value for CSS property `content` (value: ` `) | ||
position: 'absolute', | ||
@@ -110,0 +110,0 @@ top: 15, |
@@ -17,2 +17,4 @@ 'use strict'; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -64,5 +66,7 @@ | ||
value: function render() { | ||
var _extends2; | ||
return _react2.default.createElement( | ||
'span', | ||
_extends({ | ||
_extends((_extends2 = { | ||
style: this.props.style, | ||
@@ -76,6 +80,4 @@ onMouseEnter: this._onMouseEnter, | ||
onTouchCancel: this._onTouchCancel, | ||
'aria-selected': this.props.selected, | ||
style: this.props.style, | ||
role: 'gridcell' | ||
}, this.props.dayProps), | ||
'aria-selected': this.props.selected | ||
}, _defineProperty(_extends2, 'style', this.props.style), _defineProperty(_extends2, 'role', 'gridcell'), _extends2), this.props.dayProps), | ||
this.props.children | ||
@@ -82,0 +84,0 @@ ); |
@@ -131,3 +131,3 @@ 'use strict'; | ||
}]; | ||
var focusStyle = undefined; | ||
var focusStyle = void 0; | ||
if (preventFocusStyleForTouchAndClick) { | ||
@@ -164,5 +164,5 @@ focusStyle = { outline: 0 }; | ||
var selectedDate = undefined; | ||
var month = undefined; | ||
var year = undefined; | ||
var selectedDate = void 0; | ||
var month = void 0; | ||
var year = void 0; | ||
@@ -229,3 +229,3 @@ if ((0, _helpers.has)(properties, 'valueLink')) { | ||
value: function componentWillMount() { | ||
var id = this._reactInternalInstance._rootNodeID.replace(/[\.\:\$\/\=]/g, '-'); | ||
var id = (0, _helpers.uniqueId)(); | ||
this.pseudoStyleIds = {}; | ||
@@ -410,5 +410,5 @@ this.pseudoStyleIds.styleId = 'wrapper-style-id' + id; | ||
if (!this.props.disabled && !this.props.readOnly) { | ||
var day = undefined; | ||
var month = undefined; | ||
var year = undefined; | ||
var day = void 0; | ||
var month = void 0; | ||
var year = void 0; | ||
if (this.state.selectedDate && date && this.state.selectedDate.getDate() === date.getDate() && this.state.selectedDate.getMonth() === date.getMonth() && this.state.selectedDate.getFullYear() === date.getFullYear()) { | ||
@@ -482,4 +482,4 @@ day = undefined; | ||
value: function _decreaseMonthYear() { | ||
var newMonth = undefined; | ||
var newYear = undefined; | ||
var newMonth = void 0; | ||
var newYear = void 0; | ||
if (this.state.month === 0) { | ||
@@ -511,4 +511,4 @@ newMonth = 11; | ||
value: function _increaseMonthYear() { | ||
var newMonth = undefined; | ||
var newYear = undefined; | ||
var newMonth = void 0; | ||
var newYear = void 0; | ||
if (this.state.month === 11) { | ||
@@ -1099,11 +1099,11 @@ newMonth = 0; | ||
event.preventDefault(); | ||
var date = (0, _dateHelpers.getDateForDateKey)(_this4.state.focusedDateKey); | ||
if (_this4._isWithinMinAndMax(date)) { | ||
_this4._triggerSelectDate(date.getDate(), date.getMonth(), date.getFullYear()); | ||
var _date = (0, _dateHelpers.getDateForDateKey)(_this4.state.focusedDateKey); | ||
if (_this4._isWithinMinAndMax(_date)) { | ||
_this4._triggerSelectDate(_date.getDate(), _date.getMonth(), _date.getFullYear()); | ||
} | ||
} else if (event.key === ' ') { | ||
event.preventDefault(); | ||
var date = (0, _dateHelpers.getDateForDateKey)(_this4.state.focusedDateKey); | ||
if (_this4._isWithinMinAndMax(date)) { | ||
_this4._triggerToggleDate(date); | ||
var _date2 = (0, _dateHelpers.getDateForDateKey)(_this4.state.focusedDateKey); | ||
if (_this4._isWithinMinAndMax(_date2)) { | ||
_this4._triggerToggleDate(_date2); | ||
} | ||
@@ -1129,3 +1129,3 @@ } | ||
// TODO extract this to a helper function and test various edge cases | ||
var date = undefined; | ||
var date = void 0; | ||
var lastDayInMonth = (0, _dateHelpers.getLastDayForMonth)(_this4.state.year, _this4.state.month - 1); | ||
@@ -1155,3 +1155,3 @@ var focusedDate = (0, _dateHelpers.getDateForDateKey)(_this4.state.focusedDateKey); | ||
// TODO extract this to a helper function and test various edge cases | ||
var date = undefined; | ||
var date = void 0; | ||
var lastDayInMonth = (0, _dateHelpers.getLastDayForMonth)(_this4.state.year, _this4.state.month + 1); | ||
@@ -1158,0 +1158,0 @@ var focusedDate = (0, _dateHelpers.getDateForDateKey)(_this4.state.focusedDateKey); |
@@ -70,3 +70,3 @@ 'use strict'; | ||
value: function render() { | ||
var optionStyle = undefined; | ||
var optionStyle = void 0; | ||
@@ -73,0 +73,0 @@ if (this.props._isDisplayedAsSelected) { |
@@ -513,3 +513,3 @@ 'use strict'; | ||
this._onMouseDown = function (event) { | ||
if (!_this3.props.disabled && event.buttons === 1) { | ||
if (!_this3.props.disabled && event.button === 0) { | ||
_this3.setState({ isActive: true }); | ||
@@ -516,0 +516,0 @@ _this3.preventNextMouseUpTriggerUpdate = false; |
@@ -61,3 +61,3 @@ 'use strict'; | ||
function updatePseudoClassStyle(ratingWrapperStyleId, properties, preventFocusStyleForTouchAndClick) { | ||
var ratingFocusStyle = undefined; | ||
var ratingFocusStyle = void 0; | ||
if (preventFocusStyleForTouchAndClick) { | ||
@@ -94,3 +94,3 @@ ratingFocusStyle = { outline: 0 }; | ||
var value = undefined; | ||
var value = void 0; | ||
@@ -131,3 +131,3 @@ if ((0, _helpers.has)(properties, 'valueLink')) { | ||
value: function componentWillMount() { | ||
var id = this._reactInternalInstance._rootNodeID.replace(/[\.\:\$\/\=]/g, '-'); | ||
var id = (0, _helpers.uniqueId)(); | ||
this.ratingWrapperStyleId = 'rating-wrapper-style-id' + id; | ||
@@ -272,3 +272,3 @@ updatePseudoClassStyle(this.ratingWrapperStyleId, this.props, this.preventFocusStyleForTouchAndClick); | ||
value: function _getCurrentValue() { | ||
var value = undefined; | ||
var value = void 0; | ||
if (this.state.focusedValue !== undefined) { | ||
@@ -680,3 +680,3 @@ value = this.state.focusedValue; | ||
this._onEnterSpaceKeyDown = function () { | ||
var newValue = undefined; | ||
var newValue = void 0; | ||
if (_this3.state.focusedValue !== undefined) { | ||
@@ -683,0 +683,0 @@ if (_this3.state.focusedValue === 0) { |
@@ -58,5 +58,3 @@ 'use strict'; | ||
// In case of a placeholder no option is focused on initially | ||
var option = undefined; | ||
var optionIndex = undefined; | ||
var optionIndex = void 0; | ||
if (selectComponent.state.selectedValue) { | ||
@@ -68,3 +66,3 @@ optionIndex = findIndexOfSelectedOption(selectComponent); | ||
option = menuNode.childNodes[optionIndex]; | ||
var option = menuNode.childNodes[optionIndex]; | ||
@@ -71,0 +69,0 @@ var menuHeight = parseFloat(menuStyle.getPropertyValue('height')); |
@@ -104,2 +104,4 @@ 'use strict'; | ||
} | ||
return undefined; | ||
} | ||
@@ -446,4 +448,4 @@ | ||
var selectedValue = undefined; | ||
var focusedOptionValue = undefined; | ||
var selectedValue = void 0; | ||
var focusedOptionValue = void 0; | ||
@@ -469,4 +471,4 @@ if (properties.children) { | ||
} else if (!(0, _helpers.isEmpty)(_this.children)) { | ||
var firstOption = (0, _helpers.first)(_this.options); | ||
focusedOptionValue = firstOption ? firstOption.props.value : void 0; | ||
var _firstOption = (0, _helpers.first)(_this.options); | ||
focusedOptionValue = _firstOption ? _firstOption.props.value : void 0; | ||
} | ||
@@ -499,4 +501,2 @@ | ||
* Generates the style-id & inject the focus & hover style. | ||
* | ||
* The style-id is based on React's unique DOM node id. | ||
*/ | ||
@@ -507,3 +507,3 @@ | ||
value: function componentWillMount() { | ||
var id = this._getId(); | ||
var id = (0, _helpers.uniqueId)(); | ||
@@ -778,12 +778,2 @@ // Note: To ensure server side rendering creates the same results React's internal | ||
/** | ||
* Returns a in the DOM unique ID based on React's internal id. | ||
*/ | ||
}, { | ||
key: '_getId', | ||
value: function _getId() { | ||
return this._reactInternalInstance._rootNodeID.replace(/[\.\:\$\/\=]/g, '-'); | ||
} | ||
/** | ||
* After an option has been selected the menu gets closed and the | ||
@@ -860,2 +850,4 @@ * selection processed. | ||
} | ||
return null; | ||
}); | ||
@@ -880,3 +872,3 @@ } | ||
var selectedOptionOrPlaceholder = undefined; | ||
var selectedOptionOrPlaceholder = void 0; | ||
if (this.state.selectedValue !== void 0) { | ||
@@ -902,3 +894,3 @@ var selectedEntry = (0, _helpers.find)(this.children, function (entry) { | ||
var selectedOptionWrapperStyle = undefined; | ||
var selectedOptionWrapperStyle = void 0; | ||
if (this.props.disabled) { | ||
@@ -924,3 +916,3 @@ if (this.state.isTouchedToToggle) { | ||
var caretStyle = undefined; | ||
var caretStyle = void 0; | ||
if (this.props.disabled) { | ||
@@ -927,0 +919,0 @@ caretStyle = disabledCaretToOpenStyle; |
@@ -91,3 +91,3 @@ 'use strict'; | ||
width: 0, | ||
content: ' ', | ||
content: '-', // Avoid this warning: was passed a numeric string value for CSS property `content` (value: ` `) | ||
position: 'absolute', | ||
@@ -104,3 +104,3 @@ top: 15, | ||
width: 0, | ||
content: ' ', | ||
content: '-', // Avoid this warning: was passed a numeric string value for CSS property `content` (value: ` `) | ||
position: 'absolute', | ||
@@ -107,0 +107,0 @@ top: 15, |
@@ -59,4 +59,5 @@ 'use strict'; | ||
var childProps = _objectWithoutProperties(_props, ['style', 'characterProps', 'characterStyle']); | ||
var childProps = _objectWithoutProperties(_props, ['style', 'characterProps', 'characterStyle']); // eslint-disable-line no-use-before-define | ||
var computedCharStyle = _extends({}, _styles2.default.characterStyle, characterStyle); | ||
@@ -63,0 +64,0 @@ return _react2.default.createElement( |
@@ -146,3 +146,3 @@ 'use strict'; | ||
var inputValue = undefined; | ||
var inputValue = void 0; | ||
@@ -171,7 +171,5 @@ if ((0, _helpers.has)(properties, 'valueLink')) { | ||
* Generates the style-id & inject the focus & hover style. | ||
* | ||
* The style-id is based on React's unique DOM node id. | ||
*/ | ||
value: function componentWillMount() { | ||
var id = this._reactInternalInstance._rootNodeID.replace(/[\.\:\$\/\=]/g, '-'); | ||
var id = (0, _helpers.uniqueId)(); | ||
this._styleId = 'style-id' + id; | ||
@@ -178,0 +176,0 @@ updatePseudoClassStyle(this._styleId, this.props); |
@@ -27,3 +27,3 @@ 'use strict'; | ||
boxSizing: 'border-box', | ||
minHeight: '0', | ||
minHeight: '0px', | ||
@@ -30,0 +30,0 @@ /* animations */ |
@@ -80,2 +80,4 @@ 'use strict'; | ||
} | ||
return undefined; | ||
} | ||
@@ -98,2 +100,4 @@ | ||
} | ||
return undefined; | ||
} | ||
@@ -108,3 +112,3 @@ | ||
function updatePseudoClassStyle(styleId, properties, preventFocusStyleForTouchAndClick) { | ||
var focusStyle = undefined; | ||
var focusStyle = void 0; | ||
if (preventFocusStyleForTouchAndClick) { | ||
@@ -139,3 +143,3 @@ focusStyle = { outline: 0 }; | ||
var value = undefined; | ||
var value = void 0; | ||
if ((0, _helpers.has)(properties, 'valueLink')) { | ||
@@ -189,7 +193,5 @@ value = properties.valueLink.value; | ||
* Generates the style-id & inject the focus style. | ||
* | ||
* The style-id is based on React's unique DOM node id. | ||
*/ | ||
value: function componentWillMount() { | ||
var id = this._reactInternalInstance._rootNodeID.replace(/[\.\:\$\/\=]/g, '-'); | ||
var id = (0, _helpers.uniqueId)(); | ||
this.styleId = 'style-id' + id; | ||
@@ -417,4 +419,4 @@ updatePseudoClassStyle(this.styleId, this.props, this.preventFocusStyleForTouchAndClick); | ||
var computedSliderStyle = undefined; | ||
var handleStyle = undefined; | ||
var computedSliderStyle = void 0; | ||
var handleStyle = void 0; | ||
@@ -421,0 +423,0 @@ var sliderWrapperStyle = _extends({}, _styles2.default.sliderWrapperStyle, this.props.sliderWrapperStyle); |
{ | ||
"name": "belle", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "Configurable React Components with great UX", | ||
@@ -5,0 +5,0 @@ "author": { |
646407
15411