first commit
This commit is contained in:
28
frontend/node_modules/rc-steps/es/Step.d.ts
generated
vendored
Normal file
28
frontend/node_modules/rc-steps/es/Step.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import * as React from 'react';
|
||||
import type { Status, Icons } from './interface';
|
||||
import type { StepIconRender, ProgressDotRender } from './Steps';
|
||||
export interface StepProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
wrapperStyle?: React.CSSProperties;
|
||||
iconPrefix?: string;
|
||||
active?: boolean;
|
||||
disabled?: boolean;
|
||||
stepIndex?: number;
|
||||
stepNumber?: number;
|
||||
status?: Status;
|
||||
title?: React.ReactNode;
|
||||
subTitle?: React.ReactNode;
|
||||
description?: React.ReactNode;
|
||||
tailContent?: React.ReactNode;
|
||||
icon?: React.ReactNode;
|
||||
icons?: Icons;
|
||||
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
||||
onStepClick?: (index: number) => void;
|
||||
progressDot?: ProgressDotRender | boolean;
|
||||
stepIcon?: StepIconRender;
|
||||
render?: (stepItem: React.ReactElement) => React.ReactNode;
|
||||
}
|
||||
declare function Step(props: StepProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
||||
export default Step;
|
||||
141
frontend/node_modules/rc-steps/es/Step.js
generated
vendored
Normal file
141
frontend/node_modules/rc-steps/es/Step.js
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
||||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
||||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
||||
var _excluded = ["className", "prefixCls", "style", "active", "status", "iconPrefix", "icon", "wrapperStyle", "stepNumber", "disabled", "description", "title", "subTitle", "progressDot", "stepIcon", "tailContent", "icons", "stepIndex", "onStepClick", "onClick", "render"];
|
||||
/* eslint react/prop-types: 0 */
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import KeyCode from "rc-util/es/KeyCode";
|
||||
function isString(str) {
|
||||
return typeof str === 'string';
|
||||
}
|
||||
function Step(props) {
|
||||
var _classNames2;
|
||||
var className = props.className,
|
||||
prefixCls = props.prefixCls,
|
||||
style = props.style,
|
||||
active = props.active,
|
||||
status = props.status,
|
||||
iconPrefix = props.iconPrefix,
|
||||
icon = props.icon,
|
||||
wrapperStyle = props.wrapperStyle,
|
||||
stepNumber = props.stepNumber,
|
||||
disabled = props.disabled,
|
||||
description = props.description,
|
||||
title = props.title,
|
||||
subTitle = props.subTitle,
|
||||
progressDot = props.progressDot,
|
||||
stepIcon = props.stepIcon,
|
||||
tailContent = props.tailContent,
|
||||
icons = props.icons,
|
||||
stepIndex = props.stepIndex,
|
||||
onStepClick = props.onStepClick,
|
||||
onClick = props.onClick,
|
||||
render = props.render,
|
||||
restProps = _objectWithoutProperties(props, _excluded);
|
||||
|
||||
// ========================= Click ==========================
|
||||
var clickable = !!onStepClick && !disabled;
|
||||
var accessibilityProps = {};
|
||||
if (clickable) {
|
||||
accessibilityProps.role = 'button';
|
||||
accessibilityProps.tabIndex = 0;
|
||||
accessibilityProps.onClick = function (e) {
|
||||
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
||||
onStepClick(stepIndex);
|
||||
};
|
||||
accessibilityProps.onKeyDown = function (e) {
|
||||
var which = e.which;
|
||||
if (which === KeyCode.ENTER || which === KeyCode.SPACE) {
|
||||
onStepClick(stepIndex);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// ========================= Render =========================
|
||||
var renderIconNode = function renderIconNode() {
|
||||
var _classNames;
|
||||
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 || !icons)), _defineProperty(_classNames, "".concat(iconPrefix, "icon-cross"), !icon && status === 'error' && (icons && !icons.error || !icons)), _classNames));
|
||||
var iconDot = /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon-dot")
|
||||
});
|
||||
// `progressDot` enjoy the highest priority
|
||||
if (progressDot) {
|
||||
if (typeof progressDot === 'function') {
|
||||
iconNode = /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, progressDot(iconDot, {
|
||||
index: stepNumber - 1,
|
||||
status: status,
|
||||
title: title,
|
||||
description: description
|
||||
}));
|
||||
} else {
|
||||
iconNode = /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, iconDot);
|
||||
}
|
||||
} else if (icon && !isString(icon)) {
|
||||
iconNode = /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, icon);
|
||||
} else if (icons && icons.finish && status === 'finish') {
|
||||
iconNode = /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, icons.finish);
|
||||
} else if (icons && icons.error && status === 'error') {
|
||||
iconNode = /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, icons.error);
|
||||
} else if (icon || status === 'finish' || status === 'error') {
|
||||
iconNode = /*#__PURE__*/React.createElement("span", {
|
||||
className: iconClassName
|
||||
});
|
||||
} else {
|
||||
iconNode = /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, stepNumber);
|
||||
}
|
||||
if (stepIcon) {
|
||||
iconNode = stepIcon({
|
||||
index: stepNumber - 1,
|
||||
status: status,
|
||||
title: title,
|
||||
description: description,
|
||||
node: iconNode
|
||||
});
|
||||
}
|
||||
return iconNode;
|
||||
};
|
||||
var mergedStatus = status || 'wait';
|
||||
var classString = classNames("".concat(prefixCls, "-item"), "".concat(prefixCls, "-item-").concat(mergedStatus), 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);
|
||||
var stepNode = /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
|
||||
className: classString,
|
||||
style: stepItemStyle
|
||||
}), /*#__PURE__*/React.createElement("div", _extends({
|
||||
onClick: onClick
|
||||
}, accessibilityProps, {
|
||||
className: "".concat(prefixCls, "-item-container")
|
||||
}), /*#__PURE__*/React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-item-tail")
|
||||
}, tailContent), /*#__PURE__*/React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-item-icon")
|
||||
}, renderIconNode()), /*#__PURE__*/React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-item-content")
|
||||
}, /*#__PURE__*/React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-item-title")
|
||||
}, title, subTitle && /*#__PURE__*/React.createElement("div", {
|
||||
title: typeof subTitle === 'string' ? subTitle : undefined,
|
||||
className: "".concat(prefixCls, "-item-subtitle")
|
||||
}, subTitle)), description && /*#__PURE__*/React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-item-description")
|
||||
}, description))));
|
||||
if (render) {
|
||||
stepNode = render(stepNode) || null;
|
||||
}
|
||||
return stepNode;
|
||||
}
|
||||
export default Step;
|
||||
41
frontend/node_modules/rc-steps/es/Steps.d.ts
generated
vendored
Normal file
41
frontend/node_modules/rc-steps/es/Steps.d.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import React from 'react';
|
||||
import type { Icons, Status } from './interface';
|
||||
import type { StepProps } from './Step';
|
||||
export declare type StepIconRender = (info: {
|
||||
index: number;
|
||||
status: Status;
|
||||
title: React.ReactNode;
|
||||
description: React.ReactNode;
|
||||
node: React.ReactNode;
|
||||
}) => React.ReactNode;
|
||||
export declare type ProgressDotRender = (iconDot: any, info: {
|
||||
index: number;
|
||||
status: Status;
|
||||
title: React.ReactNode;
|
||||
description: React.ReactNode;
|
||||
}) => React.ReactNode;
|
||||
export interface StepsProps {
|
||||
prefixCls?: string;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
children?: React.ReactNode;
|
||||
direction?: 'horizontal' | 'vertical';
|
||||
type?: 'default' | 'navigation' | 'inline';
|
||||
labelPlacement?: 'horizontal' | 'vertical';
|
||||
iconPrefix?: string;
|
||||
status?: Status;
|
||||
size?: 'default' | 'small';
|
||||
current?: number;
|
||||
progressDot?: ProgressDotRender | boolean;
|
||||
stepIcon?: StepIconRender;
|
||||
initial?: number;
|
||||
icons?: Icons;
|
||||
items?: StepProps[];
|
||||
itemRender?: (item: StepProps, stepItem: React.ReactElement) => React.ReactNode;
|
||||
onChange?: (current: number) => void;
|
||||
}
|
||||
declare function Steps(props: StepsProps): React.JSX.Element;
|
||||
declare namespace Steps {
|
||||
var Step: typeof import("./Step").default;
|
||||
}
|
||||
export default Steps;
|
||||
103
frontend/node_modules/rc-steps/es/Steps.js
generated
vendored
Normal file
103
frontend/node_modules/rc-steps/es/Steps.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
||||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
||||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
||||
var _excluded = ["prefixCls", "style", "className", "children", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "stepIcon", "initial", "icons", "onChange", "itemRender", "items"];
|
||||
/* eslint react/no-did-mount-set-state: 0, react/prop-types: 0 */
|
||||
import classNames from 'classnames';
|
||||
import React from 'react';
|
||||
import Step from "./Step";
|
||||
function Steps(props) {
|
||||
var _classNames;
|
||||
var _props$prefixCls = props.prefixCls,
|
||||
prefixCls = _props$prefixCls === void 0 ? 'rc-steps' : _props$prefixCls,
|
||||
_props$style = props.style,
|
||||
style = _props$style === void 0 ? {} : _props$style,
|
||||
className = props.className,
|
||||
children = props.children,
|
||||
_props$direction = props.direction,
|
||||
direction = _props$direction === void 0 ? 'horizontal' : _props$direction,
|
||||
_props$type = props.type,
|
||||
type = _props$type === void 0 ? 'default' : _props$type,
|
||||
_props$labelPlacement = props.labelPlacement,
|
||||
labelPlacement = _props$labelPlacement === void 0 ? 'horizontal' : _props$labelPlacement,
|
||||
_props$iconPrefix = props.iconPrefix,
|
||||
iconPrefix = _props$iconPrefix === void 0 ? 'rc' : _props$iconPrefix,
|
||||
_props$status = props.status,
|
||||
status = _props$status === void 0 ? 'process' : _props$status,
|
||||
size = props.size,
|
||||
_props$current = props.current,
|
||||
current = _props$current === void 0 ? 0 : _props$current,
|
||||
_props$progressDot = props.progressDot,
|
||||
progressDot = _props$progressDot === void 0 ? false : _props$progressDot,
|
||||
stepIcon = props.stepIcon,
|
||||
_props$initial = props.initial,
|
||||
initial = _props$initial === void 0 ? 0 : _props$initial,
|
||||
icons = props.icons,
|
||||
onChange = props.onChange,
|
||||
itemRender = props.itemRender,
|
||||
_props$items = props.items,
|
||||
items = _props$items === void 0 ? [] : _props$items,
|
||||
restProps = _objectWithoutProperties(props, _excluded);
|
||||
var isNav = type === 'navigation';
|
||||
var isInline = type === 'inline';
|
||||
|
||||
// inline type requires fixed progressDot direction size.
|
||||
var mergedProgressDot = isInline || progressDot;
|
||||
var mergedDirection = isInline ? 'horizontal' : direction;
|
||||
var mergedSize = isInline ? undefined : size;
|
||||
var adjustedLabelPlacement = mergedProgressDot ? 'vertical' : labelPlacement;
|
||||
var classString = classNames(prefixCls, "".concat(prefixCls, "-").concat(mergedDirection), className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(mergedSize), mergedSize), _defineProperty(_classNames, "".concat(prefixCls, "-label-").concat(adjustedLabelPlacement), mergedDirection === 'horizontal'), _defineProperty(_classNames, "".concat(prefixCls, "-dot"), !!mergedProgressDot), _defineProperty(_classNames, "".concat(prefixCls, "-navigation"), isNav), _defineProperty(_classNames, "".concat(prefixCls, "-inline"), isInline), _classNames));
|
||||
var onStepClick = function onStepClick(next) {
|
||||
if (onChange && current !== next) {
|
||||
onChange(next);
|
||||
}
|
||||
};
|
||||
var renderStep = function renderStep(item, index) {
|
||||
var mergedItem = _objectSpread({}, item);
|
||||
var stepNumber = initial + index;
|
||||
// fix tail color
|
||||
if (status === 'error' && index === current - 1) {
|
||||
mergedItem.className = "".concat(prefixCls, "-next-error");
|
||||
}
|
||||
if (!mergedItem.status) {
|
||||
if (stepNumber === current) {
|
||||
mergedItem.status = status;
|
||||
} else if (stepNumber < current) {
|
||||
mergedItem.status = 'finish';
|
||||
} else {
|
||||
mergedItem.status = 'wait';
|
||||
}
|
||||
}
|
||||
if (isInline) {
|
||||
mergedItem.icon = undefined;
|
||||
mergedItem.subTitle = undefined;
|
||||
}
|
||||
if (!mergedItem.render && itemRender) {
|
||||
mergedItem.render = function (stepItem) {
|
||||
return itemRender(mergedItem, stepItem);
|
||||
};
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(Step, _extends({}, mergedItem, {
|
||||
active: stepNumber === current,
|
||||
stepNumber: stepNumber + 1,
|
||||
stepIndex: stepNumber,
|
||||
key: stepNumber,
|
||||
prefixCls: prefixCls,
|
||||
iconPrefix: iconPrefix,
|
||||
wrapperStyle: style,
|
||||
progressDot: mergedProgressDot,
|
||||
stepIcon: stepIcon,
|
||||
icons: icons,
|
||||
onStepClick: onChange && onStepClick
|
||||
}));
|
||||
};
|
||||
return /*#__PURE__*/React.createElement("div", _extends({
|
||||
className: classString,
|
||||
style: style
|
||||
}, restProps), items.filter(function (item) {
|
||||
return item;
|
||||
}).map(renderStep));
|
||||
}
|
||||
Steps.Step = Step;
|
||||
export default Steps;
|
||||
4
frontend/node_modules/rc-steps/es/index.d.ts
generated
vendored
Normal file
4
frontend/node_modules/rc-steps/es/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import Steps from './Steps';
|
||||
import Step from './Step';
|
||||
export { Step };
|
||||
export default Steps;
|
||||
4
frontend/node_modules/rc-steps/es/index.js
generated
vendored
Normal file
4
frontend/node_modules/rc-steps/es/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import Steps from "./Steps";
|
||||
import Step from "./Step";
|
||||
export { Step };
|
||||
export default Steps;
|
||||
6
frontend/node_modules/rc-steps/es/interface.d.ts
generated
vendored
Normal file
6
frontend/node_modules/rc-steps/es/interface.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/// <reference types="react" />
|
||||
export declare type Status = 'error' | 'process' | 'finish' | 'wait';
|
||||
export interface Icons {
|
||||
finish: React.ReactNode;
|
||||
error: React.ReactNode;
|
||||
}
|
||||
1
frontend/node_modules/rc-steps/es/interface.js
generated
vendored
Normal file
1
frontend/node_modules/rc-steps/es/interface.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
Reference in New Issue
Block a user