Comparing version 2.1.5 to 2.2.0
# History | ||
---- | ||
## 2.2.0 | ||
* `icon` can be React.Node now. | ||
## 2.1.0 | ||
@@ -5,0 +9,0 @@ |
@@ -19,2 +19,6 @@ 'use strict'; | ||
function isString(str) { | ||
return typeof str === 'string'; | ||
} | ||
function Step(props) { | ||
@@ -40,8 +44,21 @@ var _classNames, _classNames2; | ||
var iconClassName = (0, _classnames2["default"])((_classNames = {}, _defineProperty(_classNames, prefixCls + '-icon', true), _defineProperty(_classNames, iconPrefix + 'icon', true), _defineProperty(_classNames, iconPrefix + 'icon-' + icon, icon), _defineProperty(_classNames, iconPrefix + 'icon-check', !icon && status === 'finish'), _defineProperty(_classNames, iconPrefix + 'icon-cross', !icon && status === 'error'), _classNames)); | ||
var iconNode = icon || status === 'finish' || status === 'error' ? _react2["default"].createElement('span', { className: iconClassName }) : _react2["default"].createElement( | ||
'span', | ||
{ className: prefixCls + '-icon' }, | ||
stepNumber | ||
); | ||
var iconClassName = (0, _classnames2["default"])((_classNames = {}, _defineProperty(_classNames, prefixCls + '-icon', true), _defineProperty(_classNames, iconPrefix + 'icon', true), _defineProperty(_classNames, iconPrefix + 'icon-' + icon, icon && isString(icon)), _defineProperty(_classNames, iconPrefix + 'icon-check', !icon && status === 'finish'), _defineProperty(_classNames, iconPrefix + 'icon-cross', !icon && status === 'error'), _classNames)); | ||
var iconNode = void 0; | ||
if (icon && !isString(icon)) { | ||
iconNode = _react2["default"].createElement( | ||
'span', | ||
{ className: prefixCls + '-icon' }, | ||
icon | ||
); | ||
} else if (icon || status === 'finish' || status === 'error') { | ||
iconNode = _react2["default"].createElement('span', { className: iconClassName }); | ||
} else { | ||
iconNode = _react2["default"].createElement( | ||
'span', | ||
{ className: prefixCls + '-icon' }, | ||
stepNumber | ||
); | ||
} | ||
var classString = (0, _classnames2["default"])((_classNames2 = {}, _defineProperty(_classNames2, prefixCls + '-item', true), _defineProperty(_classNames2, prefixCls + '-item-last', stepLast), _defineProperty(_classNames2, prefixCls + '-status-' + status, true), _defineProperty(_classNames2, prefixCls + '-custom', icon), _defineProperty(_classNames2, className, !!className), _classNames2)); | ||
@@ -103,3 +120,3 @@ return _react2["default"].createElement( | ||
iconPrefix: _react.PropTypes.string, | ||
icon: _react.PropTypes.string, | ||
icon: _react.PropTypes.node, | ||
adjustMarginRight: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]), | ||
@@ -106,0 +123,0 @@ stepLast: _react.PropTypes.bool, |
{ | ||
"name": "rc-steps", | ||
"version": "2.1.5", | ||
"version": "2.2.0", | ||
"description": "steps ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
32231
1043