@wireapp/react-ui-kit
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -54,5 +54,3 @@ 'use strict'; | ||
_this.setState({ values: values }, _this.handleCompleteCode); | ||
if (value.length) { | ||
_this.nextField(num); | ||
} | ||
_this.nextField(num); | ||
} | ||
@@ -92,3 +90,2 @@ }; | ||
_this.handleKeyDown = function (fieldNum, event) { | ||
var preventDefault = true; | ||
switch (event.key) { | ||
@@ -106,6 +103,8 @@ case 'Backspace': | ||
default: | ||
preventDefault = false; | ||
event.target.select(); | ||
} | ||
if (preventDefault) { | ||
if (!/^[0-9]$/.test(event.key)) { | ||
event.preventDefault(); | ||
} else { | ||
_this.setValue(fieldNum, event.key); | ||
} | ||
@@ -122,2 +121,8 @@ }; | ||
_createClass(CodeInput, [{ | ||
key: 'forceSelection', | ||
value: function forceSelection(event) { | ||
event.target.select(); | ||
event.preventDefault(); | ||
} | ||
}, { | ||
key: 'render', | ||
@@ -135,14 +140,13 @@ value: function render() { | ||
key: index, | ||
onChange: function onChange(event) { | ||
return _this2.setValue(index, event.target.value); | ||
}, | ||
onPaste: function onPaste(event) { | ||
return _this2.handlePaste(index, event.clipboardData.getData('Text')); | ||
}, | ||
onFocus: function onFocus(event) { | ||
return event.target.select(); | ||
}, | ||
onFocus: _this2.forceSelection, | ||
onMouseDown: _this2.forceSelection, | ||
onTouchStart: _this2.forceSelection, | ||
onKeyDown: function onKeyDown(event) { | ||
return _this2.handleKeyDown(index, event); | ||
}, | ||
onKeyPress: _this2.forceSelection, | ||
onKeyUp: _this2.forceSelection, | ||
innerRef: function innerRef(node) { | ||
@@ -149,0 +153,0 @@ return _this2.inputs[index] = node; |
@@ -10,3 +10,3 @@ 'use strict'; | ||
var _templateObject = _taggedTemplateLiteral(['\n display: block;\n margin-top: 12px;\n a {\n color: inherit;\n }\n'], ['\n display: block;\n margin-top: 12px;\n a {\n color: inherit;\n }\n']); | ||
var _templateObject = _taggedTemplateLiteral(['\n display: block;\n margin-top: 12px;\n a {\n color: ', ';\n text-decoration: none;\n }\n'], ['\n display: block;\n margin-top: 12px;\n a {\n color: ', ';\n text-decoration: none;\n }\n']); | ||
@@ -19,3 +19,3 @@ var _Identity = require('../Identity'); | ||
var ErrorMessage = _Text.Text.extend(_templateObject); | ||
var ErrorMessage = _Text.Text.extend(_templateObject, _Identity.COLOR.LINK); | ||
@@ -22,0 +22,0 @@ ErrorMessage.defaultProps = _extends({}, _Text.Text.defaultProps, { |
@@ -52,3 +52,3 @@ 'use strict'; | ||
props, | ||
icon === 'plane' ? _react2.default.createElement(_Icon.PlaneIcon, { color: iconColor, height: iconHeight, width: iconWidth }) : _react2.default.createElement(_Icon.ArrowIcon, { color: iconColor, height: iconHeight, width: iconWidth }) | ||
icon === 'plane' ? _react2.default.createElement(_Icon.PlaneIcon, { color: iconColor, height: iconHeight, width: iconWidth, style: { marginLeft: 2 } }) : _react2.default.createElement(_Icon.ArrowIcon, { color: iconColor, height: iconHeight, width: iconWidth }) | ||
); | ||
@@ -55,0 +55,0 @@ }; |
@@ -49,2 +49,3 @@ 'use strict'; | ||
scale = _props.scale, | ||
style = _props.style, | ||
width = _props.width; | ||
@@ -58,7 +59,7 @@ | ||
} | ||
return this.renderSVG(this.width * newScale, this.height * newScale, color); | ||
return this.renderSVG(this.width * newScale, this.height * newScale, color, style); | ||
} | ||
}, { | ||
key: 'renderSVG', | ||
value: function renderSVG(width, height, color) { | ||
value: function renderSVG(width, height, color, style) { | ||
return null; | ||
@@ -75,2 +76,3 @@ } | ||
scale: _propTypes2.default.number, | ||
style: _propTypes2.default.object, | ||
width: _propTypes2.default.number | ||
@@ -82,4 +84,5 @@ }; | ||
scale: 1, | ||
style: null, | ||
width: null | ||
}; | ||
exports.default = IconBase; |
@@ -45,6 +45,6 @@ 'use strict'; | ||
key: 'renderSVG', | ||
value: function renderSVG(width, height, color) { | ||
value: function renderSVG(width, height, color, style) { | ||
return _react2.default.createElement( | ||
'svg', | ||
{ width: width, height: height, viewBox: '0 0 12 12' }, | ||
{ width: width, height: height, style: style, viewBox: '0 0 12 12' }, | ||
_react2.default.createElement('path', { fill: color, d: 'M0 10.7c0 1 .8 1.6 1.8 1L11.3 7c1-.6 1-1.4 0-2L1.8.3C.8-.3 0 .3 0 1.3V6h9L0 7.5v3.2z' }) | ||
@@ -51,0 +51,0 @@ ); |
@@ -31,3 +31,3 @@ { | ||
"repository": "https://github.com/wireapp/wire-web-packages/tree/master/packages/react-ui-kit", | ||
"version": "0.0.13" | ||
"version": "0.0.14" | ||
} |
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
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
96935
1838