Comparing version 2.0.0-alpha-7 to 2.0.0-alpha-8
@@ -102,9 +102,9 @@ 'use strict'; | ||
var _props2 = this.props, | ||
componentClass = _props2.componentClass, | ||
prefixClass = _props2.prefixClass, | ||
active = _props2.active, | ||
block = _props2.block, | ||
elementProps = _objectWithoutProperties(_props2, ['componentClass', 'prefixClass', 'active', 'block']); | ||
href = _props2.href, | ||
props = _objectWithoutProperties(_props2, ['href']); | ||
return _react2.default.createElement(_SafeAnchor2.default, _extends({}, elementProps, { | ||
var elementProps = _lodash2.default.omit(props, Object.keys(propTypes)); | ||
return _react2.default.createElement(_SafeAnchor2.default, _extends({ | ||
href: href | ||
}, elementProps, { | ||
className: this.getClassNames() | ||
@@ -117,11 +117,12 @@ })); | ||
var _props3 = this.props, | ||
componentClass = _props3.componentClass, | ||
prefixClass = _props3.prefixClass, | ||
active = _props3.active, | ||
block = _props3.block, | ||
elementProps = _objectWithoutProperties(_props3, ['componentClass', 'prefixClass', 'active', 'block']); | ||
Component = _props3.componentClass, | ||
disabled = _props3.disabled, | ||
type = _props3.type, | ||
props = _objectWithoutProperties(_props3, ['componentClass', 'disabled', 'type']); | ||
var Component = componentClass || 'button'; | ||
var elementProps = _lodash2.default.omit(props, Object.keys(propTypes)); | ||
return _react2.default.createElement(Component, _extends({}, elementProps, { | ||
type: type, | ||
disabled: disabled, | ||
className: this.getClassNames() | ||
@@ -152,4 +153,4 @@ })); | ||
oneOf: [].concat(_toConsumableArray(_lodash2.default.values(_decorate.STATE)), _toConsumableArray(_lodash2.default.values(_decorate.STYLES))), | ||
default: _decorate.STATE.default | ||
default: _decorate.STYLES.DEFAULT | ||
} | ||
})(Button); |
@@ -7,6 +7,6 @@ 'use strict'; | ||
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 _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 _react = require('react'); | ||
@@ -68,3 +68,3 @@ | ||
var propTypes = { | ||
var propTypes = _extends({}, _DropdownToggle2.default.propTypes, { | ||
disabled: _propTypes2.default.bool, | ||
@@ -85,6 +85,4 @@ block: _propTypes2.default.bool, | ||
menuStyle: _propTypes2.default.object, | ||
title: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]), | ||
autoClose: _propTypes2.default.bool, | ||
useAnchor: _propTypes2.default.bool | ||
}; | ||
autoClose: _propTypes2.default.bool | ||
}); | ||
@@ -214,17 +212,15 @@ var defaultProps = { | ||
Component = _props3.componentClass, | ||
props = _objectWithoutProperties(_props3, ['title', 'children', 'className', 'activeKey', 'dropup', 'bothEnds', 'menuStyle', 'block', 'useAnchor', 'disabled', 'componentClass']); | ||
noCaret = _props3.noCaret, | ||
props = _objectWithoutProperties(_props3, ['title', 'children', 'className', 'activeKey', 'dropup', 'bothEnds', 'menuStyle', 'block', 'useAnchor', 'disabled', 'componentClass', 'noCaret']); | ||
var buttonProps = { block: block, useAnchor: useAnchor, disabled: disabled }; | ||
var elementProps = _lodash2.default.omit(props, ['select', 'onClose', 'onOpen', 'onToggle', 'autoClose']); | ||
if (Component.displayName === 'ButtonGroup') { | ||
elementProps.block = block; | ||
} | ||
var Toggle = _react2.default.createElement( | ||
_DropdownToggle2.default, | ||
_extends({}, buttonProps, { | ||
{ | ||
block: block, | ||
useAnchor: useAnchor, | ||
disabled: disabled, | ||
noCaret: noCaret, | ||
className: (0, _classnames2.default)((0, _decorate.getClassNames)(props, 'btn')), | ||
onClick: this.handleClick | ||
}), | ||
}, | ||
this.state.title || title | ||
@@ -257,2 +253,7 @@ ); | ||
var elementProps = _lodash2.default.omit(props, ['select', 'onClose', 'onOpen', 'onToggle', 'autoClose']); | ||
if (Component.displayName === 'ButtonGroup') { | ||
elementProps.block = block; | ||
} | ||
return _react2.default.createElement( | ||
@@ -259,0 +260,0 @@ Component, |
@@ -47,12 +47,6 @@ 'use strict'; | ||
noCaret: _propTypes2.default.bool, | ||
title: _propTypes2.default.string, | ||
title: _propTypes2.default.node, | ||
useAnchor: _propTypes2.default.bool | ||
}; | ||
var defaultProps = { | ||
noCaret: false, | ||
title: null, | ||
useAnchor: false | ||
}; | ||
var DorpdownToggle = function (_React$Component) { | ||
@@ -97,4 +91,3 @@ _inherits(DorpdownToggle, _React$Component); | ||
DorpdownToggle.propTypes = propTypes; | ||
DorpdownToggle.defaultProps = defaultProps; | ||
exports.default = DorpdownToggle; |
{ | ||
"name": "rsuite", | ||
"version": "2.0.0-alpha-7", | ||
"version": "2.0.0-alpha-8", | ||
"description": "A suite of react components", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
288137
5191