@doctolib/react-form
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -79,4 +79,5 @@ 'use strict'; | ||
var value = _props2.value; | ||
var disabled = _props2.disabled; | ||
return { className: className, id: this.getId(), name: name, value: value }; | ||
return { className: className, id: this.getId(), name: name, value: value, disabled: disabled }; | ||
}, | ||
@@ -83,0 +84,0 @@ getWrapperProps: function getWrapperProps() { |
'use strict'; | ||
exports.__esModule = true; | ||
exports.addValidationRule = exports.Form = exports.InputAddon = exports.CheckboxGroup = exports.RadioGroup = exports.Textarea = exports.Select = exports.Input = undefined; | ||
exports.addValidationRule = exports.Form = exports.InputAddon = exports.CheckboxGroup = exports.RadioGroup = exports.Textarea = exports.Select = exports.Input = exports.ControlWrapper = undefined; | ||
var _ControlWrapper = require('./ControlWrapper'); | ||
Object.defineProperty(exports, 'ControlWrapper', { | ||
enumerable: true, | ||
get: function get() { | ||
return _ControlWrapper.default; | ||
} | ||
}); | ||
var _Input = require('./Input'); | ||
@@ -7,0 +16,0 @@ |
@@ -72,2 +72,4 @@ 'use strict'; | ||
var type = _props.type; | ||
var leftAddon = _props.leftAddon; | ||
var rightAddon = _props.rightAddon; | ||
var onChange = this.onChange; | ||
@@ -86,7 +88,7 @@ | ||
wrapperProps, | ||
this.props.leftAddon, | ||
leftAddon ? _react2.default.cloneElement(leftAddon, { control: this }) : null, | ||
_react2.default.createElement('input', controlProps), | ||
this.props.rightAddon | ||
rightAddon ? _react2.default.cloneElement(rightAddon, { control: this }) : null | ||
); | ||
} | ||
}); |
@@ -9,2 +9,6 @@ 'use strict'; | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _react = require('react'); | ||
@@ -22,2 +26,6 @@ | ||
var _Input = require('./Input'); | ||
var _Input2 = _interopRequireDefault(_Input); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -30,2 +38,3 @@ | ||
children: _react.PropTypes.node, | ||
control: _react.PropTypes.instanceOf(_Input2.default), | ||
className: _react.PropTypes.string | ||
@@ -37,4 +46,10 @@ }, | ||
render: function render() { | ||
var props = (0, _extends3.default)({}, this.props, { | ||
className: (0, _classnames2.default)('input-group-addon', this.props.className) | ||
var _props = this.props; | ||
var children = _props.children; | ||
var className = _props.className; | ||
var control = _props.control; | ||
var props = (0, _objectWithoutProperties3.default)(_props, ['children', 'className', 'control']); | ||
var spanProps = (0, _extends3.default)({}, props, { | ||
className: (0, _classnames2.default)('input-group-addon', className) | ||
}); | ||
@@ -44,6 +59,6 @@ | ||
'span', | ||
props, | ||
this.props.children | ||
spanProps, | ||
children | ||
); | ||
} | ||
}); |
@@ -29,2 +29,6 @@ 'use strict'; | ||
var _classnames = require('classnames'); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -106,2 +110,5 @@ | ||
var controlProps = this.getControlProps(); | ||
var className = (0, _classnames2.default)(controlProps.className, { placeholder: !this.getValue() }); | ||
return _react2.default.createElement( | ||
@@ -112,3 +119,3 @@ _ControlWrapper2.default, | ||
'select', | ||
(0, _extends3.default)({}, this.getControlProps(), { onChange: onChange }), | ||
(0, _extends3.default)({}, controlProps, { onChange: onChange, className: className }), | ||
this.renderPlaceHolder(), | ||
@@ -115,0 +122,0 @@ this.renderOptions() |
{ | ||
"name": "@doctolib/react-form", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Set of React form components based on react-formsy.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
25145
595