Comparing version 4.1.4 to 5.0.0-alpha.0
import * as React from 'react'; | ||
import { Status, Icons } from './interface'; | ||
import { StepIconRender, ProgressDotRender } from './Steps'; | ||
import type { Status, Icons } from './interface'; | ||
import type { StepIconRender, ProgressDotRender } from './Steps'; | ||
export interface StepProps { | ||
@@ -5,0 +5,0 @@ prefixCls?: string; |
@@ -0,1 +1,2 @@ | ||
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
@@ -28,4 +29,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
_this = _super.apply(this, arguments); | ||
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
_args[_key] = arguments[_key]; | ||
} | ||
_this = _super.call.apply(_super, [this].concat(_args)); | ||
_this.onClick = function () { | ||
@@ -159,6 +164,6 @@ var _this$props = _this.props, | ||
return /*#__PURE__*/React.createElement("div", Object.assign({}, restProps, { | ||
return /*#__PURE__*/React.createElement("div", _extends({}, restProps, { | ||
className: classString, | ||
style: stepItemStyle | ||
}), /*#__PURE__*/React.createElement("div", Object.assign({ | ||
}), /*#__PURE__*/React.createElement("div", _extends({ | ||
onClick: onClick | ||
@@ -165,0 +170,0 @@ }, accessibilityProps, { |
import React from 'react'; | ||
import { Status, Icons } from './interface'; | ||
import type { Status, Icons } from './interface'; | ||
import Step from './Step'; | ||
import type { StepProps } from './Step'; | ||
export declare type StepIconRender = (info: { | ||
@@ -33,2 +34,3 @@ index: number; | ||
icons?: Icons; | ||
items?: StepProps[]; | ||
onChange?: (current: number) => void; | ||
@@ -35,0 +37,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
@@ -8,7 +8,6 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
import _createSuper from "@babel/runtime/helpers/esm/createSuper"; | ||
var _excluded = ["prefixCls", "style", "className", "children", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "stepIcon", "initial", "icons", "onChange"]; | ||
var _excluded = ["prefixCls", "style", "className", "children", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "stepIcon", "initial", "icons", "onChange", "items"]; | ||
/* eslint react/no-did-mount-set-state: 0, react/prop-types: 0 */ | ||
import React, { cloneElement } from 'react'; | ||
import toArray from "rc-util/es/Children/toArray"; | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
@@ -27,4 +26,8 @@ import Step from './Step'; | ||
_this = _super.apply(this, arguments); | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this = _super.call.apply(_super, [this].concat(args)); | ||
_this.onStepClick = function (next) { | ||
@@ -67,2 +70,4 @@ var _this$props = _this.props, | ||
onChange = _this$props2.onChange, | ||
_this$props2$items = _this$props2.items, | ||
items = _this$props2$items === void 0 ? [] : _this$props2$items, | ||
restProps = _objectWithoutProperties(_this$props2, _excluded); | ||
@@ -73,10 +78,27 @@ | ||
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 /*#__PURE__*/React.createElement("div", Object.assign({ | ||
return /*#__PURE__*/React.createElement("div", _extends({ | ||
className: classString, | ||
style: style | ||
}, restProps), toArray(children).map(function (child, index) { | ||
var stepNumber = initial + index; | ||
}, restProps), (items || []).filter(function (item) { | ||
return item; | ||
}).map(function (item, index) { | ||
var stepNumber = initial + index; // fix tail color | ||
var childProps = _objectSpread({ | ||
stepNumber: "".concat(stepNumber + 1), | ||
if (status === 'error' && index === current - 1) { | ||
item.className = "".concat(prefixCls, "-next-error"); | ||
} | ||
if (!item.status) { | ||
if (stepNumber === current) { | ||
item.status = status; | ||
} else if (stepNumber < current) { | ||
item.status = 'finish'; | ||
} else { | ||
item.status = 'wait'; | ||
} | ||
} | ||
return /*#__PURE__*/React.createElement(Step, _extends({}, item, { | ||
active: stepNumber === current, | ||
stepNumber: stepNumber + 1, | ||
stepIndex: stepNumber, | ||
@@ -91,21 +113,3 @@ key: stepNumber, | ||
onStepClick: onChange && _this2.onStepClick | ||
}, child.props); // fix tail color | ||
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'; | ||
} | ||
} | ||
childProps.active = stepNumber === current; | ||
return /*#__PURE__*/cloneElement(child, childProps); | ||
})); | ||
})); | ||
@@ -118,3 +122,2 @@ } | ||
export { Steps as default }; | ||
Steps.Step = Step; | ||
@@ -132,2 +135,3 @@ Steps.defaultProps = { | ||
progressDot: false | ||
}; | ||
}; | ||
export { Steps as default }; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
@@ -5,0 +5,0 @@ Object.defineProperty(exports, "__esModule", { |
@@ -1,1 +0,5 @@ | ||
"use strict"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); |
import * as React from 'react'; | ||
import { Status, Icons } from './interface'; | ||
import { StepIconRender, ProgressDotRender } from './Steps'; | ||
import type { Status, Icons } from './interface'; | ||
import type { StepIconRender, ProgressDotRender } from './Steps'; | ||
export interface StepProps { | ||
@@ -5,0 +5,0 @@ prefixCls?: string; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default; | ||
@@ -12,2 +12,4 @@ Object.defineProperty(exports, "__esModule", { | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
@@ -46,4 +48,9 @@ | ||
(0, _classCallCheck2.default)(this, Step); | ||
_this = _super.apply(this, arguments); | ||
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
_args[_key] = arguments[_key]; | ||
} | ||
_this = _super.call.apply(_super, [this].concat(_args)); | ||
_this.onClick = function () { | ||
@@ -174,6 +181,6 @@ var _this$props = _this.props, | ||
return /*#__PURE__*/React.createElement("div", Object.assign({}, restProps, { | ||
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({}, restProps, { | ||
className: classString, | ||
style: stepItemStyle | ||
}), /*#__PURE__*/React.createElement("div", Object.assign({ | ||
}), /*#__PURE__*/React.createElement("div", (0, _extends2.default)({ | ||
onClick: onClick | ||
@@ -180,0 +187,0 @@ }, accessibilityProps, { |
import React from 'react'; | ||
import { Status, Icons } from './interface'; | ||
import type { Status, Icons } from './interface'; | ||
import Step from './Step'; | ||
import type { StepProps } from './Step'; | ||
export declare type StepIconRender = (info: { | ||
@@ -33,2 +34,3 @@ index: number; | ||
icons?: Icons; | ||
items?: StepProps[]; | ||
onChange?: (current: number) => void; | ||
@@ -35,0 +37,0 @@ } |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -12,3 +10,3 @@ value: true | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
@@ -27,6 +25,4 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _react = _interopRequireWildcard(require("react")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray")); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
@@ -36,3 +32,3 @@ | ||
var _excluded = ["prefixCls", "style", "className", "children", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "stepIcon", "initial", "icons", "onChange"]; | ||
var _excluded = ["prefixCls", "style", "className", "children", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "stepIcon", "initial", "icons", "onChange", "items"]; | ||
@@ -48,4 +44,9 @@ var Steps = /*#__PURE__*/function (_React$Component) { | ||
(0, _classCallCheck2.default)(this, Steps); | ||
_this = _super.apply(this, arguments); | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this = _super.call.apply(_super, [this].concat(args)); | ||
_this.onStepClick = function (next) { | ||
@@ -88,2 +89,4 @@ var _this$props = _this.props, | ||
onChange = _this$props2.onChange, | ||
_this$props2$items = _this$props2.items, | ||
items = _this$props2$items === void 0 ? [] : _this$props2$items, | ||
restProps = (0, _objectWithoutProperties2.default)(_this$props2, _excluded); | ||
@@ -93,36 +96,37 @@ var isNav = type === 'navigation'; | ||
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 /*#__PURE__*/_react.default.createElement("div", Object.assign({ | ||
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({ | ||
className: classString, | ||
style: style | ||
}, restProps), (0, _toArray.default)(children).map(function (child, index) { | ||
var stepNumber = initial + index; | ||
var childProps = (0, _objectSpread2.default)({ | ||
stepNumber: "".concat(stepNumber + 1), | ||
stepIndex: stepNumber, | ||
key: stepNumber, | ||
prefixCls: prefixCls, | ||
iconPrefix: iconPrefix, | ||
wrapperStyle: style, | ||
progressDot: progressDot, | ||
stepIcon: stepIcon, | ||
icons: icons, | ||
onStepClick: onChange && _this2.onStepClick | ||
}, child.props); // fix tail color | ||
}, restProps), (items || []).filter(function (item) { | ||
return item; | ||
}).map(function (item, index) { | ||
var stepNumber = initial + index; // fix tail color | ||
if (status === 'error' && index === current - 1) { | ||
childProps.className = "".concat(prefixCls, "-next-error"); | ||
item.className = "".concat(prefixCls, "-next-error"); | ||
} | ||
if (!child.props.status) { | ||
if (!item.status) { | ||
if (stepNumber === current) { | ||
childProps.status = status; | ||
item.status = status; | ||
} else if (stepNumber < current) { | ||
childProps.status = 'finish'; | ||
item.status = 'finish'; | ||
} else { | ||
childProps.status = 'wait'; | ||
item.status = 'wait'; | ||
} | ||
} | ||
childProps.active = stepNumber === current; | ||
return /*#__PURE__*/(0, _react.cloneElement)(child, childProps); | ||
return /*#__PURE__*/_react.default.createElement(_Step.default, (0, _extends2.default)({}, item, { | ||
active: stepNumber === current, | ||
stepNumber: stepNumber + 1, | ||
stepIndex: stepNumber, | ||
key: stepNumber, | ||
prefixCls: prefixCls, | ||
iconPrefix: iconPrefix, | ||
wrapperStyle: style, | ||
progressDot: progressDot, | ||
stepIcon: stepIcon, | ||
icons: icons, | ||
onStepClick: onChange && _this2.onStepClick | ||
})); | ||
})); | ||
@@ -129,0 +133,0 @@ } |
{ | ||
"name": "rc-steps", | ||
"version": "4.1.4", | ||
"version": "5.0.0-alpha.0", | ||
"description": "steps ui component for react", | ||
@@ -37,8 +37,5 @@ "engines": { | ||
"license": "MIT", | ||
"config": { | ||
"port": 8002 | ||
}, | ||
"scripts": { | ||
"start": "cross-env NODE_ENV=development father doc dev --storybook", | ||
"build": "father doc build --storybook", | ||
"start": "dumi dev", | ||
"build": "dumi build", | ||
"compile": "father build && lessc assets/index.less assets/index.css", | ||
@@ -59,8 +56,9 @@ "gh-pages": "npm run build && father doc deploy", | ||
"@types/classnames": "^2.2.9", | ||
"@types/enzyme": "^3.10.5", | ||
"@types/enzyme": "^3.10.11", | ||
"@types/jest": "^26.0.5", | ||
"@types/react": "^16.9.2", | ||
"@types/react-dom": "^16.9.0", | ||
"@umijs/fabric": "^2.0.9", | ||
"@umijs/fabric": "^2.10.0", | ||
"cross-env": "^7.0.0", | ||
"dumi": "^1.1.38", | ||
"enzyme": "^3.1.0", | ||
@@ -70,6 +68,6 @@ "enzyme-adapter-react-16": "^1.0.1", | ||
"eslint": "^7.1.0", | ||
"father": "^2.22.0", | ||
"father": "^2.30.13", | ||
"less": "^3.11.2", | ||
"np": "^7.0.0", | ||
"prettier": "^2.0.5", | ||
"np": "^7.6.0", | ||
"prettier": "^2.5.1", | ||
"querystring": "^0.2.0", | ||
@@ -80,9 +78,9 @@ "rc-dialog": "8.x", | ||
"react-dom": "^16.0.0", | ||
"typescript": "^4.0.3" | ||
"typescript": "^4.5.4" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.10.2", | ||
"@babel/runtime": "^7.16.7", | ||
"classnames": "^2.2.3", | ||
"rc-util": "^5.0.1" | ||
"rc-util": "^5.16.1" | ||
} | ||
} |
@@ -36,3 +36,3 @@ # rc-steps | ||
```jsx | ||
```jsx | pure | ||
<Steps current={1}> | ||
@@ -39,0 +39,0 @@ <Steps.Step title="first" /> |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
1214
50173
22
20
1
Updated@babel/runtime@^7.16.7
Updatedrc-util@^5.16.1