Comparing version 4.0.0 to 4.0.1
197
es/Steps.js
@@ -23,122 +23,117 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
var Steps = | ||
/** @class */ | ||
function () { | ||
var Steps = /*#__PURE__*/function (_React$Component) { | ||
_inherits(Steps, _React$Component); | ||
var Steps = /*#__PURE__*/function (_React$Component) { | ||
_inherits(Steps, _React$Component); | ||
var _super = _createSuper(Steps); | ||
var _super = _createSuper(Steps); | ||
function Steps() { | ||
var _this; | ||
function Steps() { | ||
var _this; | ||
_classCallCheck(this, Steps); | ||
_classCallCheck(this, Steps); | ||
_this = _super.apply(this, arguments); | ||
_this = _super.apply(this, arguments); | ||
_this.onStepClick = function (next) { | ||
var _this$props = _this.props, | ||
onChange = _this$props.onChange, | ||
current = _this$props.current; | ||
_this.onStepClick = function (next) { | ||
var _this$props = _this.props, | ||
onChange = _this$props.onChange, | ||
current = _this$props.current; | ||
if (onChange && current !== next) { | ||
onChange(next); | ||
} | ||
}; | ||
if (onChange && current !== next) { | ||
onChange(next); | ||
} | ||
}; | ||
return _this; | ||
} | ||
return _this; | ||
} | ||
_createClass(Steps, [{ | ||
key: "render", | ||
value: function render() { | ||
var _classNames, | ||
_this2 = this; | ||
_createClass(Steps, [{ | ||
key: "render", | ||
value: function render() { | ||
var _classNames, | ||
_this2 = this; | ||
var _this$props2 = this.props, | ||
prefixCls = _this$props2.prefixCls, | ||
_this$props2$style = _this$props2.style, | ||
style = _this$props2$style === void 0 ? {} : _this$props2$style, | ||
className = _this$props2.className, | ||
children = _this$props2.children, | ||
direction = _this$props2.direction, | ||
type = _this$props2.type, | ||
labelPlacement = _this$props2.labelPlacement, | ||
iconPrefix = _this$props2.iconPrefix, | ||
status = _this$props2.status, | ||
size = _this$props2.size, | ||
current = _this$props2.current, | ||
progressDot = _this$props2.progressDot, | ||
initial = _this$props2.initial, | ||
icons = _this$props2.icons, | ||
onChange = _this$props2.onChange, | ||
restProps = _objectWithoutProperties(_this$props2, ["prefixCls", "style", "className", "children", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "initial", "icons", "onChange"]); | ||
var _this$props2 = this.props, | ||
prefixCls = _this$props2.prefixCls, | ||
_this$props2$style = _this$props2.style, | ||
style = _this$props2$style === void 0 ? {} : _this$props2$style, | ||
className = _this$props2.className, | ||
children = _this$props2.children, | ||
direction = _this$props2.direction, | ||
type = _this$props2.type, | ||
labelPlacement = _this$props2.labelPlacement, | ||
iconPrefix = _this$props2.iconPrefix, | ||
status = _this$props2.status, | ||
size = _this$props2.size, | ||
current = _this$props2.current, | ||
progressDot = _this$props2.progressDot, | ||
initial = _this$props2.initial, | ||
icons = _this$props2.icons, | ||
onChange = _this$props2.onChange, | ||
restProps = _objectWithoutProperties(_this$props2, ["prefixCls", "style", "className", "children", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "initial", "icons", "onChange"]); | ||
var isNav = type === 'navigation'; | ||
var filteredChildren = React.Children.toArray(children).filter(function (c) { | ||
return !!c; | ||
}); | ||
var adjustedLabelPlacement = progressDot ? 'vertical' : labelPlacement; | ||
var classString = classNames(prefixCls, "".concat(prefixCls, "-").concat(direction), className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(size), size), _defineProperty(_classNames, "".concat(prefixCls, "-label-").concat(adjustedLabelPlacement), direction === 'horizontal'), _defineProperty(_classNames, "".concat(prefixCls, "-dot"), !!progressDot), _defineProperty(_classNames, "".concat(prefixCls, "-navigation"), isNav), _classNames)); | ||
return React.createElement("div", Object.assign({ | ||
className: classString, | ||
style: style | ||
}, restProps), toArray(filteredChildren).map(function (child, index) { | ||
if (!child) { | ||
return null; | ||
} | ||
var isNav = type === 'navigation'; | ||
var filteredChildren = React.Children.toArray(children).filter(function (c) { | ||
return !!c; | ||
}); | ||
var adjustedLabelPlacement = progressDot ? 'vertical' : labelPlacement; | ||
var classString = classNames(prefixCls, "".concat(prefixCls, "-").concat(direction), className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(size), size), _defineProperty(_classNames, "".concat(prefixCls, "-label-").concat(adjustedLabelPlacement), direction === 'horizontal'), _defineProperty(_classNames, "".concat(prefixCls, "-dot"), !!progressDot), _defineProperty(_classNames, "".concat(prefixCls, "-navigation"), isNav), _classNames)); | ||
return React.createElement("div", Object.assign({ | ||
className: classString, | ||
style: style | ||
}, restProps), toArray(filteredChildren).map(function (child, index) { | ||
if (!child) { | ||
return null; | ||
} | ||
var stepNumber = initial + index; | ||
var stepNumber = initial + index; | ||
var childProps = _objectSpread({ | ||
stepNumber: "".concat(stepNumber + 1), | ||
stepIndex: stepNumber, | ||
prefixCls: prefixCls, | ||
iconPrefix: iconPrefix, | ||
wrapperStyle: style, | ||
progressDot: progressDot, | ||
icons: icons, | ||
onStepClick: onChange && _this2.onStepClick | ||
}, child.props); // fix tail color | ||
var childProps = _objectSpread({ | ||
stepNumber: "".concat(stepNumber + 1), | ||
stepIndex: stepNumber, | ||
key: stepNumber, | ||
prefixCls: prefixCls, | ||
iconPrefix: iconPrefix, | ||
wrapperStyle: style, | ||
progressDot: progressDot, | ||
icons: icons, | ||
onStepClick: onChange && _this2.onStepClick | ||
}, child.props); // fix tail color | ||
if (status === 'error' && index === current - 1) { | ||
childProps.className = "".concat(prefixCls, "-next-error"); | ||
} | ||
if (status === 'error' && index === current - 1) { | ||
childProps.className = "".concat(prefixCls, "-next-error"); | ||
} | ||
if (!child.props.status) { | ||
if (stepNumber === current) { | ||
childProps.status = status; | ||
} else if (stepNumber < current) { | ||
childProps.status = 'finish'; | ||
} else { | ||
childProps.status = 'wait'; | ||
} | ||
if (!child.props.status) { | ||
if (stepNumber === current) { | ||
childProps.status = status; | ||
} else if (stepNumber < current) { | ||
childProps.status = 'finish'; | ||
} else { | ||
childProps.status = 'wait'; | ||
} | ||
} | ||
childProps.active = stepNumber === current; | ||
return cloneElement(child, childProps); | ||
})); | ||
} | ||
}]); | ||
childProps.active = stepNumber === current; | ||
return cloneElement(child, childProps); | ||
})); | ||
} | ||
}]); | ||
return Steps; | ||
}(React.Component); | ||
Steps.Step = Step; | ||
Steps.defaultProps = { | ||
type: 'default', | ||
prefixCls: 'rc-steps', | ||
iconPrefix: 'rc', | ||
direction: 'horizontal', | ||
labelPlacement: 'horizontal', | ||
initial: 0, | ||
current: 0, | ||
status: 'process', | ||
size: '', | ||
progressDot: false | ||
}; | ||
return Steps; | ||
}(); | ||
}(React.Component); | ||
export default Steps; | ||
export { Steps as default }; | ||
Steps.Step = Step; | ||
Steps.defaultProps = { | ||
type: 'default', | ||
prefixCls: 'rc-steps', | ||
iconPrefix: 'rc', | ||
direction: 'horizontal', | ||
labelPlacement: 'horizontal', | ||
initial: 0, | ||
current: 0, | ||
status: 'process', | ||
size: '', | ||
progressDot: false | ||
}; |
198
lib/Steps.js
@@ -42,122 +42,116 @@ "use strict"; | ||
var Steps = | ||
/** @class */ | ||
function () { | ||
var Steps = /*#__PURE__*/function (_React$Component) { | ||
(0, _inherits2.default)(Steps, _React$Component); | ||
var Steps = /*#__PURE__*/function (_React$Component) { | ||
(0, _inherits2.default)(Steps, _React$Component); | ||
var _super = _createSuper(Steps); | ||
var _super = _createSuper(Steps); | ||
function Steps() { | ||
var _this; | ||
function Steps() { | ||
var _this; | ||
(0, _classCallCheck2.default)(this, Steps); | ||
_this = _super.apply(this, arguments); | ||
(0, _classCallCheck2.default)(this, Steps); | ||
_this = _super.apply(this, arguments); | ||
_this.onStepClick = function (next) { | ||
var _this$props = _this.props, | ||
onChange = _this$props.onChange, | ||
current = _this$props.current; | ||
_this.onStepClick = function (next) { | ||
var _this$props = _this.props, | ||
onChange = _this$props.onChange, | ||
current = _this$props.current; | ||
if (onChange && current !== next) { | ||
onChange(next); | ||
} | ||
}; | ||
if (onChange && current !== next) { | ||
onChange(next); | ||
} | ||
}; | ||
return _this; | ||
} | ||
return _this; | ||
} | ||
(0, _createClass2.default)(Steps, [{ | ||
key: "render", | ||
value: function render() { | ||
var _classNames, | ||
_this2 = this; | ||
(0, _createClass2.default)(Steps, [{ | ||
key: "render", | ||
value: function render() { | ||
var _classNames, | ||
_this2 = this; | ||
var _this$props2 = this.props, | ||
prefixCls = _this$props2.prefixCls, | ||
_this$props2$style = _this$props2.style, | ||
style = _this$props2$style === void 0 ? {} : _this$props2$style, | ||
className = _this$props2.className, | ||
children = _this$props2.children, | ||
direction = _this$props2.direction, | ||
type = _this$props2.type, | ||
labelPlacement = _this$props2.labelPlacement, | ||
iconPrefix = _this$props2.iconPrefix, | ||
status = _this$props2.status, | ||
size = _this$props2.size, | ||
current = _this$props2.current, | ||
progressDot = _this$props2.progressDot, | ||
initial = _this$props2.initial, | ||
icons = _this$props2.icons, | ||
onChange = _this$props2.onChange, | ||
restProps = (0, _objectWithoutProperties2.default)(_this$props2, ["prefixCls", "style", "className", "children", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "initial", "icons", "onChange"]); | ||
var isNav = type === 'navigation'; | ||
var _this$props2 = this.props, | ||
prefixCls = _this$props2.prefixCls, | ||
_this$props2$style = _this$props2.style, | ||
style = _this$props2$style === void 0 ? {} : _this$props2$style, | ||
className = _this$props2.className, | ||
children = _this$props2.children, | ||
direction = _this$props2.direction, | ||
type = _this$props2.type, | ||
labelPlacement = _this$props2.labelPlacement, | ||
iconPrefix = _this$props2.iconPrefix, | ||
status = _this$props2.status, | ||
size = _this$props2.size, | ||
current = _this$props2.current, | ||
progressDot = _this$props2.progressDot, | ||
initial = _this$props2.initial, | ||
icons = _this$props2.icons, | ||
onChange = _this$props2.onChange, | ||
restProps = (0, _objectWithoutProperties2.default)(_this$props2, ["prefixCls", "style", "className", "children", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "initial", "icons", "onChange"]); | ||
var isNav = type === 'navigation'; | ||
var filteredChildren = _react.default.Children.toArray(children).filter(function (c) { | ||
return !!c; | ||
}); | ||
var filteredChildren = _react.default.Children.toArray(children).filter(function (c) { | ||
return !!c; | ||
}); | ||
var adjustedLabelPlacement = progressDot ? 'vertical' : labelPlacement; | ||
var classString = (0, _classnames.default)(prefixCls, "".concat(prefixCls, "-").concat(direction), className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-").concat(size), size), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-label-").concat(adjustedLabelPlacement), direction === 'horizontal'), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-dot"), !!progressDot), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-navigation"), isNav), _classNames)); | ||
return _react.default.createElement("div", Object.assign({ | ||
className: classString, | ||
style: style | ||
}, restProps), (0, _toArray.default)(filteredChildren).map(function (child, index) { | ||
if (!child) { | ||
return null; | ||
} | ||
var adjustedLabelPlacement = progressDot ? 'vertical' : labelPlacement; | ||
var classString = (0, _classnames.default)(prefixCls, "".concat(prefixCls, "-").concat(direction), className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-").concat(size), size), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-label-").concat(adjustedLabelPlacement), direction === 'horizontal'), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-dot"), !!progressDot), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-navigation"), isNav), _classNames)); | ||
return _react.default.createElement("div", Object.assign({ | ||
className: classString, | ||
style: style | ||
}, restProps), (0, _toArray.default)(filteredChildren).map(function (child, index) { | ||
if (!child) { | ||
return null; | ||
} | ||
var stepNumber = initial + index; | ||
var stepNumber = initial + index; | ||
var childProps = _objectSpread({ | ||
stepNumber: "".concat(stepNumber + 1), | ||
stepIndex: stepNumber, | ||
prefixCls: prefixCls, | ||
iconPrefix: iconPrefix, | ||
wrapperStyle: style, | ||
progressDot: progressDot, | ||
icons: icons, | ||
onStepClick: onChange && _this2.onStepClick | ||
}, child.props); // fix tail color | ||
var childProps = _objectSpread({ | ||
stepNumber: "".concat(stepNumber + 1), | ||
stepIndex: stepNumber, | ||
key: stepNumber, | ||
prefixCls: prefixCls, | ||
iconPrefix: iconPrefix, | ||
wrapperStyle: style, | ||
progressDot: progressDot, | ||
icons: icons, | ||
onStepClick: onChange && _this2.onStepClick | ||
}, child.props); // fix tail color | ||
if (status === 'error' && index === current - 1) { | ||
childProps.className = "".concat(prefixCls, "-next-error"); | ||
} | ||
if (status === 'error' && index === current - 1) { | ||
childProps.className = "".concat(prefixCls, "-next-error"); | ||
} | ||
if (!child.props.status) { | ||
if (stepNumber === current) { | ||
childProps.status = status; | ||
} else if (stepNumber < current) { | ||
childProps.status = 'finish'; | ||
} else { | ||
childProps.status = 'wait'; | ||
} | ||
if (!child.props.status) { | ||
if (stepNumber === current) { | ||
childProps.status = status; | ||
} else if (stepNumber < current) { | ||
childProps.status = 'finish'; | ||
} else { | ||
childProps.status = 'wait'; | ||
} | ||
} | ||
childProps.active = stepNumber === current; | ||
return (0, _react.cloneElement)(child, childProps); | ||
})); | ||
} | ||
}]); | ||
return Steps; | ||
}(_react.default.Component); | ||
Steps.Step = _Step.default; | ||
Steps.defaultProps = { | ||
type: 'default', | ||
prefixCls: 'rc-steps', | ||
iconPrefix: 'rc', | ||
direction: 'horizontal', | ||
labelPlacement: 'horizontal', | ||
initial: 0, | ||
current: 0, | ||
status: 'process', | ||
size: '', | ||
progressDot: false | ||
}; | ||
childProps.active = stepNumber === current; | ||
return (0, _react.cloneElement)(child, childProps); | ||
})); | ||
} | ||
}]); | ||
return Steps; | ||
}(); | ||
}(_react.default.Component); | ||
var _default = Steps; | ||
exports.default = _default; | ||
exports.default = Steps; | ||
Steps.Step = _Step.default; | ||
Steps.defaultProps = { | ||
type: 'default', | ||
prefixCls: 'rc-steps', | ||
iconPrefix: 'rc', | ||
direction: 'horizontal', | ||
labelPlacement: 'horizontal', | ||
initial: 0, | ||
current: 0, | ||
status: 'process', | ||
size: '', | ||
progressDot: false | ||
}; |
{ | ||
"name": "rc-steps", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "steps ui component for react", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -46,6 +46,4 @@ # rc-steps | ||
http://localhost:8002/examples | ||
https://react-component.github.io/steps/ | ||
online example: http://react-component.github.io/steps/examples/ | ||
## API | ||
@@ -52,0 +50,0 @@ |
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
55480
1183
184