Latest updates from IceHrmPro
This commit is contained in:
235
web/node_modules/rc-steps/es/Step.js
generated
vendored
Normal file
235
web/node_modules/rc-steps/es/Step.js
generated
vendored
Normal file
@@ -0,0 +1,235 @@
|
||||
function _extends() { _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; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
|
||||
function isString(str) {
|
||||
return typeof str === 'string';
|
||||
}
|
||||
|
||||
var Step =
|
||||
/*#__PURE__*/
|
||||
function (_React$Component) {
|
||||
_inherits(Step, _React$Component);
|
||||
|
||||
function Step() {
|
||||
var _getPrototypeOf2;
|
||||
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Step);
|
||||
|
||||
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
_args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Step)).call.apply(_getPrototypeOf2, [this].concat(_args)));
|
||||
|
||||
_defineProperty(_assertThisInitialized(_this), "onClick", function () {
|
||||
var _this$props = _this.props,
|
||||
onClick = _this$props.onClick,
|
||||
onStepClick = _this$props.onStepClick,
|
||||
stepIndex = _this$props.stepIndex;
|
||||
|
||||
if (onClick) {
|
||||
onClick.apply(void 0, arguments);
|
||||
}
|
||||
|
||||
onStepClick(stepIndex);
|
||||
});
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Step, [{
|
||||
key: "renderIconNode",
|
||||
value: function renderIconNode() {
|
||||
var _classNames;
|
||||
|
||||
var _this$props2 = this.props,
|
||||
prefixCls = _this$props2.prefixCls,
|
||||
progressDot = _this$props2.progressDot,
|
||||
stepNumber = _this$props2.stepNumber,
|
||||
status = _this$props2.status,
|
||||
title = _this$props2.title,
|
||||
description = _this$props2.description,
|
||||
icon = _this$props2.icon,
|
||||
iconPrefix = _this$props2.iconPrefix,
|
||||
icons = _this$props2.icons;
|
||||
var iconNode;
|
||||
var iconClassName = classNames("".concat(prefixCls, "-icon"), "".concat(iconPrefix, "icon"), (_classNames = {}, _defineProperty(_classNames, "".concat(iconPrefix, "icon-").concat(icon), icon && isString(icon)), _defineProperty(_classNames, "".concat(iconPrefix, "icon-check"), !icon && status === 'finish' && icons && !icons.finish), _defineProperty(_classNames, "".concat(iconPrefix, "icon-close"), !icon && status === 'error' && icons && !icons.error), _classNames));
|
||||
var iconDot = React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon-dot")
|
||||
}); // `progressDot` enjoy the highest priority
|
||||
|
||||
if (progressDot) {
|
||||
if (typeof progressDot === 'function') {
|
||||
iconNode = React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, progressDot(iconDot, {
|
||||
index: stepNumber - 1,
|
||||
status: status,
|
||||
title: title,
|
||||
description: description
|
||||
}));
|
||||
} else {
|
||||
iconNode = React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, iconDot);
|
||||
}
|
||||
} else if (icon && !isString(icon)) {
|
||||
iconNode = React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, icon);
|
||||
} else if (icons && icons.finish && status === 'finish') {
|
||||
iconNode = React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, icons.finish);
|
||||
} else if (icons && icons.error && status === 'error') {
|
||||
iconNode = React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, icons.error);
|
||||
} else if (icon || status === 'finish' || status === 'error') {
|
||||
iconNode = React.createElement("span", {
|
||||
className: iconClassName
|
||||
});
|
||||
} else {
|
||||
iconNode = React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, stepNumber);
|
||||
}
|
||||
|
||||
return iconNode;
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _classNames2;
|
||||
|
||||
var _this$props3 = this.props,
|
||||
className = _this$props3.className,
|
||||
prefixCls = _this$props3.prefixCls,
|
||||
style = _this$props3.style,
|
||||
itemWidth = _this$props3.itemWidth,
|
||||
active = _this$props3.active,
|
||||
_this$props3$status = _this$props3.status,
|
||||
status = _this$props3$status === void 0 ? 'wait' : _this$props3$status,
|
||||
iconPrefix = _this$props3.iconPrefix,
|
||||
icon = _this$props3.icon,
|
||||
wrapperStyle = _this$props3.wrapperStyle,
|
||||
adjustMarginRight = _this$props3.adjustMarginRight,
|
||||
stepNumber = _this$props3.stepNumber,
|
||||
disabled = _this$props3.disabled,
|
||||
description = _this$props3.description,
|
||||
title = _this$props3.title,
|
||||
subTitle = _this$props3.subTitle,
|
||||
progressDot = _this$props3.progressDot,
|
||||
tailContent = _this$props3.tailContent,
|
||||
icons = _this$props3.icons,
|
||||
stepIndex = _this$props3.stepIndex,
|
||||
onStepClick = _this$props3.onStepClick,
|
||||
onClick = _this$props3.onClick,
|
||||
restProps = _objectWithoutProperties(_this$props3, ["className", "prefixCls", "style", "itemWidth", "active", "status", "iconPrefix", "icon", "wrapperStyle", "adjustMarginRight", "stepNumber", "disabled", "description", "title", "subTitle", "progressDot", "tailContent", "icons", "stepIndex", "onStepClick", "onClick"]);
|
||||
|
||||
var classString = classNames("".concat(prefixCls, "-item"), "".concat(prefixCls, "-item-").concat(status), className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-item-custom"), icon), _defineProperty(_classNames2, "".concat(prefixCls, "-item-active"), active), _defineProperty(_classNames2, "".concat(prefixCls, "-item-disabled"), disabled === true), _classNames2));
|
||||
|
||||
var stepItemStyle = _objectSpread({}, style);
|
||||
|
||||
if (itemWidth) {
|
||||
stepItemStyle.width = itemWidth;
|
||||
}
|
||||
|
||||
if (adjustMarginRight) {
|
||||
stepItemStyle.marginRight = adjustMarginRight;
|
||||
}
|
||||
|
||||
var accessibilityProps = {};
|
||||
|
||||
if (onStepClick && !disabled) {
|
||||
accessibilityProps.role = 'button';
|
||||
accessibilityProps.tabIndex = 0;
|
||||
accessibilityProps.onClick = this.onClick;
|
||||
}
|
||||
|
||||
return React.createElement("div", _extends({}, restProps, {
|
||||
className: classString,
|
||||
style: stepItemStyle
|
||||
}), React.createElement("div", _extends({
|
||||
onClick: onClick
|
||||
}, accessibilityProps, {
|
||||
className: "".concat(prefixCls, "-item-container")
|
||||
}), React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-item-tail")
|
||||
}, tailContent), React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-item-icon")
|
||||
}, this.renderIconNode()), React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-item-content")
|
||||
}, React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-item-title")
|
||||
}, title, subTitle && React.createElement("div", {
|
||||
title: subTitle,
|
||||
className: "".concat(prefixCls, "-item-subtitle")
|
||||
}, subTitle)), description && React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-item-description")
|
||||
}, description))));
|
||||
}
|
||||
}]);
|
||||
|
||||
return Step;
|
||||
}(React.Component);
|
||||
|
||||
_defineProperty(Step, "propTypes", {
|
||||
className: PropTypes.string,
|
||||
prefixCls: PropTypes.string,
|
||||
style: PropTypes.object,
|
||||
wrapperStyle: PropTypes.object,
|
||||
itemWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
active: PropTypes.bool,
|
||||
disabled: PropTypes.bool,
|
||||
status: PropTypes.string,
|
||||
iconPrefix: PropTypes.string,
|
||||
icon: PropTypes.node,
|
||||
adjustMarginRight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
stepNumber: PropTypes.string,
|
||||
stepIndex: PropTypes.number,
|
||||
description: PropTypes.any,
|
||||
title: PropTypes.any,
|
||||
subTitle: PropTypes.any,
|
||||
progressDot: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
|
||||
tailContent: PropTypes.any,
|
||||
icons: PropTypes.shape({
|
||||
finish: PropTypes.node,
|
||||
error: PropTypes.node
|
||||
}),
|
||||
onClick: PropTypes.func,
|
||||
onStepClick: PropTypes.func
|
||||
});
|
||||
|
||||
export { Step as default };
|
||||
247
web/node_modules/rc-steps/es/Steps.js
generated
vendored
Normal file
247
web/node_modules/rc-steps/es/Steps.js
generated
vendored
Normal file
@@ -0,0 +1,247 @@
|
||||
function _extends() { _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; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/* eslint react/no-did-mount-set-state: 0 */
|
||||
import React, { cloneElement, Children, Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
import classNames from 'classnames';
|
||||
import debounce from 'lodash/debounce';
|
||||
import { isFlexSupported } from './utils';
|
||||
|
||||
var Steps =
|
||||
/*#__PURE__*/
|
||||
function (_Component) {
|
||||
_inherits(Steps, _Component);
|
||||
|
||||
function Steps(props) {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Steps);
|
||||
|
||||
_this = _possibleConstructorReturn(this, _getPrototypeOf(Steps).call(this, props));
|
||||
|
||||
_defineProperty(_assertThisInitialized(_this), "onStepClick", function (next) {
|
||||
var _this$props = _this.props,
|
||||
onChange = _this$props.onChange,
|
||||
current = _this$props.current;
|
||||
|
||||
if (onChange && current !== next) {
|
||||
onChange(next);
|
||||
}
|
||||
});
|
||||
|
||||
_defineProperty(_assertThisInitialized(_this), "calcStepOffsetWidth", function () {
|
||||
if (isFlexSupported()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var lastStepOffsetWidth = _this.state.lastStepOffsetWidth; // Just for IE9
|
||||
|
||||
var domNode = findDOMNode(_assertThisInitialized(_this));
|
||||
|
||||
if (domNode.children.length > 0) {
|
||||
if (_this.calcTimeout) {
|
||||
clearTimeout(_this.calcTimeout);
|
||||
}
|
||||
|
||||
_this.calcTimeout = setTimeout(function () {
|
||||
// +1 for fit edge bug of digit width, like 35.4px
|
||||
var offsetWidth = (domNode.lastChild.offsetWidth || 0) + 1; // Reduce shake bug
|
||||
|
||||
if (lastStepOffsetWidth === offsetWidth || Math.abs(lastStepOffsetWidth - offsetWidth) <= 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this.setState({
|
||||
lastStepOffsetWidth: offsetWidth
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
_this.state = {
|
||||
flexSupported: true,
|
||||
lastStepOffsetWidth: 0
|
||||
};
|
||||
_this.calcStepOffsetWidth = debounce(_this.calcStepOffsetWidth, 150);
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Steps, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
this.calcStepOffsetWidth();
|
||||
|
||||
if (!isFlexSupported()) {
|
||||
this.setState({
|
||||
flexSupported: false
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate() {
|
||||
this.calcStepOffsetWidth();
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
if (this.calcTimeout) {
|
||||
clearTimeout(this.calcTimeout);
|
||||
}
|
||||
|
||||
if (this.calcStepOffsetWidth && this.calcStepOffsetWidth.cancel) {
|
||||
this.calcStepOffsetWidth.cancel();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
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 isNav = type === 'navigation';
|
||||
var _this$state = this.state,
|
||||
lastStepOffsetWidth = _this$state.lastStepOffsetWidth,
|
||||
flexSupported = _this$state.flexSupported;
|
||||
var filteredChildren = React.Children.toArray(children).filter(function (c) {
|
||||
return !!c;
|
||||
});
|
||||
var lastIndex = filteredChildren.length - 1;
|
||||
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), _defineProperty(_classNames, "".concat(prefixCls, "-flex-not-supported"), !flexSupported), _classNames));
|
||||
return React.createElement("div", _extends({
|
||||
className: classString,
|
||||
style: style
|
||||
}, restProps), Children.map(filteredChildren, function (child, index) {
|
||||
if (!child) {
|
||||
return null;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (!flexSupported && direction !== 'vertical') {
|
||||
if (isNav) {
|
||||
childProps.itemWidth = "".concat(100 / (lastIndex + 1), "%");
|
||||
childProps.adjustMarginRight = 0;
|
||||
} else if (index !== lastIndex) {
|
||||
childProps.itemWidth = "".concat(100 / lastIndex, "%");
|
||||
childProps.adjustMarginRight = -Math.round(lastStepOffsetWidth / lastIndex + 1);
|
||||
}
|
||||
} // 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 cloneElement(child, childProps);
|
||||
}));
|
||||
}
|
||||
}]);
|
||||
|
||||
return Steps;
|
||||
}(Component);
|
||||
|
||||
_defineProperty(Steps, "propTypes", {
|
||||
type: PropTypes.string,
|
||||
prefixCls: PropTypes.string,
|
||||
className: PropTypes.string,
|
||||
iconPrefix: PropTypes.string,
|
||||
direction: PropTypes.string,
|
||||
labelPlacement: PropTypes.string,
|
||||
children: PropTypes.any,
|
||||
status: PropTypes.string,
|
||||
size: PropTypes.string,
|
||||
progressDot: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
|
||||
style: PropTypes.object,
|
||||
initial: PropTypes.number,
|
||||
current: PropTypes.number,
|
||||
icons: PropTypes.shape({
|
||||
finish: PropTypes.node,
|
||||
error: PropTypes.node
|
||||
}),
|
||||
onChange: PropTypes.func
|
||||
});
|
||||
|
||||
_defineProperty(Steps, "defaultProps", {
|
||||
type: 'default',
|
||||
prefixCls: 'rc-steps',
|
||||
iconPrefix: 'rc',
|
||||
direction: 'horizontal',
|
||||
labelPlacement: 'horizontal',
|
||||
initial: 0,
|
||||
current: 0,
|
||||
status: 'process',
|
||||
size: '',
|
||||
progressDot: false
|
||||
});
|
||||
|
||||
export { Steps as default };
|
||||
5
web/node_modules/rc-steps/es/index.js
generated
vendored
Normal file
5
web/node_modules/rc-steps/es/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import Steps from './Steps';
|
||||
import Step from './Step';
|
||||
Steps.Step = Step;
|
||||
export { Step };
|
||||
export default Steps;
|
||||
9
web/node_modules/rc-steps/es/utils.js
generated
vendored
Normal file
9
web/node_modules/rc-steps/es/utils.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export function isFlexSupported() {
|
||||
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
|
||||
var documentElement = window.document.documentElement;
|
||||
return 'flex' in documentElement.style || 'webkitFlex' in documentElement.style || 'Flex' in documentElement.style || 'msFlex' in documentElement.style;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user