Comparing version 3.2.1 to 3.3.0
@@ -34,6 +34,7 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
icon = _props.icon, | ||
iconPrefix = _props.iconPrefix; | ||
iconPrefix = _props.iconPrefix, | ||
icons = _props.icons; | ||
var iconNode = void 0; | ||
var iconClassName = classNames(prefixCls + '-icon', iconPrefix + 'icon', (_classNames = {}, _classNames[iconPrefix + 'icon-' + icon] = icon && isString(icon), _classNames[iconPrefix + 'icon-check'] = !icon && status === 'finish', _classNames[iconPrefix + 'icon-cross'] = !icon && status === 'error', _classNames)); | ||
var iconClassName = classNames(prefixCls + '-icon', iconPrefix + 'icon', (_classNames = {}, _classNames[iconPrefix + 'icon-' + icon] = icon && isString(icon), _classNames[iconPrefix + 'icon-check'] = !icon && status === 'finish' && icons && !icons.finish, _classNames[iconPrefix + 'icon-close'] = !icon && status === 'error' && icons && !icons.error, _classNames)); | ||
var iconDot = React.createElement('span', { className: prefixCls + '-icon-dot' }); | ||
@@ -61,2 +62,14 @@ // `progressDot` enjoy the highest priority | ||
); | ||
} else if (icons && icons.finish && status === 'finish') { | ||
iconNode = React.createElement( | ||
'span', | ||
{ className: prefixCls + '-icon' }, | ||
icons.finish | ||
); | ||
} else if (icons && icons.error && status === 'error') { | ||
iconNode = React.createElement( | ||
'span', | ||
{ className: prefixCls + '-icon' }, | ||
icons.error | ||
); | ||
} else if (icon || status === 'finish' || status === 'error') { | ||
@@ -71,2 +84,3 @@ iconNode = React.createElement('span', { className: iconClassName }); | ||
} | ||
return iconNode; | ||
@@ -94,3 +108,4 @@ }; | ||
tailContent = _props2.tailContent, | ||
restProps = _objectWithoutProperties(_props2, ['className', 'prefixCls', 'style', 'itemWidth', 'status', 'iconPrefix', 'icon', 'wrapperStyle', 'adjustMarginRight', 'stepNumber', 'description', 'title', 'progressDot', 'tailContent']); | ||
icons = _props2.icons, | ||
restProps = _objectWithoutProperties(_props2, ['className', 'prefixCls', 'style', 'itemWidth', 'status', 'iconPrefix', 'icon', 'wrapperStyle', 'adjustMarginRight', 'stepNumber', 'description', 'title', 'progressDot', 'tailContent', 'icons']); | ||
@@ -155,4 +170,8 @@ var classString = classNames(prefixCls + '-item', prefixCls + '-item-' + status, className, (_classNames2 = {}, _classNames2[prefixCls + '-item-custom'] = icon, _classNames2)); | ||
progressDot: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]), | ||
tailContent: PropTypes.any | ||
tailContent: PropTypes.any, | ||
icons: PropTypes.shape({ | ||
finish: PropTypes.node, | ||
error: PropTypes.node | ||
}) | ||
}; | ||
export default Step; |
@@ -91,3 +91,4 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
initial = _props.initial, | ||
restProps = _objectWithoutProperties(_props, ['prefixCls', 'style', 'className', 'children', 'direction', 'labelPlacement', 'iconPrefix', 'status', 'size', 'current', 'progressDot', 'initial']); | ||
icons = _props.icons, | ||
restProps = _objectWithoutProperties(_props, ['prefixCls', 'style', 'className', 'children', 'direction', 'labelPlacement', 'iconPrefix', 'status', 'size', 'current', 'progressDot', 'initial', 'icons']); | ||
@@ -118,3 +119,4 @@ var _state = this.state, | ||
wrapperStyle: style, | ||
progressDot: progressDot | ||
progressDot: progressDot, | ||
icons: icons | ||
}, child.props); | ||
@@ -158,3 +160,7 @@ if (!flexSupported && direction !== 'vertical' && index !== lastIndex) { | ||
initial: PropTypes.number, | ||
current: PropTypes.number | ||
current: PropTypes.number, | ||
icons: PropTypes.shape({ | ||
finish: PropTypes.node, | ||
error: PropTypes.node | ||
}) | ||
}; | ||
@@ -161,0 +167,0 @@ Steps.defaultProps = { |
# History | ||
---- | ||
## 3.230 | ||
- Add `icons` prop for change preset icon. | ||
## 3.2.0 | ||
@@ -5,0 +9,0 @@ |
@@ -62,6 +62,7 @@ 'use strict'; | ||
icon = _props.icon, | ||
iconPrefix = _props.iconPrefix; | ||
iconPrefix = _props.iconPrefix, | ||
icons = _props.icons; | ||
var iconNode = void 0; | ||
var iconClassName = (0, _classnames2['default'])(prefixCls + '-icon', iconPrefix + 'icon', (_classNames = {}, _classNames[iconPrefix + 'icon-' + icon] = icon && isString(icon), _classNames[iconPrefix + 'icon-check'] = !icon && status === 'finish', _classNames[iconPrefix + 'icon-cross'] = !icon && status === 'error', _classNames)); | ||
var iconClassName = (0, _classnames2['default'])(prefixCls + '-icon', iconPrefix + 'icon', (_classNames = {}, _classNames[iconPrefix + 'icon-' + icon] = icon && isString(icon), _classNames[iconPrefix + 'icon-check'] = !icon && status === 'finish' && icons && !icons.finish, _classNames[iconPrefix + 'icon-close'] = !icon && status === 'error' && icons && !icons.error, _classNames)); | ||
var iconDot = _react2['default'].createElement('span', { className: prefixCls + '-icon-dot' }); | ||
@@ -89,2 +90,14 @@ // `progressDot` enjoy the highest priority | ||
); | ||
} else if (icons && icons.finish && status === 'finish') { | ||
iconNode = _react2['default'].createElement( | ||
'span', | ||
{ className: prefixCls + '-icon' }, | ||
icons.finish | ||
); | ||
} else if (icons && icons.error && status === 'error') { | ||
iconNode = _react2['default'].createElement( | ||
'span', | ||
{ className: prefixCls + '-icon' }, | ||
icons.error | ||
); | ||
} else if (icon || status === 'finish' || status === 'error') { | ||
@@ -99,2 +112,3 @@ iconNode = _react2['default'].createElement('span', { className: iconClassName }); | ||
} | ||
return iconNode; | ||
@@ -122,3 +136,4 @@ }; | ||
tailContent = _props2.tailContent, | ||
restProps = (0, _objectWithoutProperties3['default'])(_props2, ['className', 'prefixCls', 'style', 'itemWidth', 'status', 'iconPrefix', 'icon', 'wrapperStyle', 'adjustMarginRight', 'stepNumber', 'description', 'title', 'progressDot', 'tailContent']); | ||
icons = _props2.icons, | ||
restProps = (0, _objectWithoutProperties3['default'])(_props2, ['className', 'prefixCls', 'style', 'itemWidth', 'status', 'iconPrefix', 'icon', 'wrapperStyle', 'adjustMarginRight', 'stepNumber', 'description', 'title', 'progressDot', 'tailContent', 'icons']); | ||
@@ -184,5 +199,9 @@ | ||
progressDot: _propTypes2['default'].oneOfType([_propTypes2['default'].bool, _propTypes2['default'].func]), | ||
tailContent: _propTypes2['default'].any | ||
tailContent: _propTypes2['default'].any, | ||
icons: _propTypes2['default'].shape({ | ||
finish: _propTypes2['default'].node, | ||
error: _propTypes2['default'].node | ||
}) | ||
}; | ||
exports['default'] = Step; | ||
module.exports = exports['default']; |
@@ -125,3 +125,4 @@ 'use strict'; | ||
initial = _props.initial, | ||
restProps = (0, _objectWithoutProperties3['default'])(_props, ['prefixCls', 'style', 'className', 'children', 'direction', 'labelPlacement', 'iconPrefix', 'status', 'size', 'current', 'progressDot', 'initial']); | ||
icons = _props.icons, | ||
restProps = (0, _objectWithoutProperties3['default'])(_props, ['prefixCls', 'style', 'className', 'children', 'direction', 'labelPlacement', 'iconPrefix', 'status', 'size', 'current', 'progressDot', 'initial', 'icons']); | ||
var _state = this.state, | ||
@@ -151,3 +152,4 @@ lastStepOffsetWidth = _state.lastStepOffsetWidth, | ||
wrapperStyle: style, | ||
progressDot: progressDot | ||
progressDot: progressDot, | ||
icons: icons | ||
}, child.props); | ||
@@ -191,3 +193,7 @@ if (!flexSupported && direction !== 'vertical' && index !== lastIndex) { | ||
initial: _propTypes2['default'].number, | ||
current: _propTypes2['default'].number | ||
current: _propTypes2['default'].number, | ||
icons: _propTypes2['default'].shape({ | ||
finish: _propTypes2['default'].node, | ||
error: _propTypes2['default'].node | ||
}) | ||
}; | ||
@@ -194,0 +200,0 @@ Steps.defaultProps = { |
{ | ||
"name": "rc-steps", | ||
"version": "3.2.1", | ||
"version": "3.3.0", | ||
"description": "steps ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -89,2 +89,8 @@ # rc-steps | ||
</tr> | ||
<tr> | ||
<td>icons</td> | ||
<td>{ finish: ReactNode, error: ReactNode }</td> | ||
<td></td> | ||
<td>spicify the default finish icon and error icon</td> | ||
</tr> | ||
</tbody> | ||
@@ -91,0 +97,0 @@ </table> |
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
54096
1560
153