@bifrostui/react 1.4.5-beta.1 → 1.4.5-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionSheet/ActionSheetItem.js +3 -8
- package/dist/Avatar/Avatar.js +3 -8
- package/dist/Avatar/AvatarGroup.js +2 -6
- package/dist/Badge/Badge.js +3 -8
- package/dist/Button/Button.css +0 -10
- package/dist/Button/Button.js +3 -8
- package/dist/Calendar/Calendar.js +6 -14
- package/dist/Card/Card.css +0 -3
- package/dist/Card/CardContent.css +1 -0
- package/dist/Card/CardFooter.css +1 -0
- package/dist/Card/CardHeader.css +1 -0
- package/dist/Checkbox/Checkbox.js +2 -6
- package/dist/Checkbox/CheckboxGroup.js +4 -7
- package/dist/CollapsePanel/CollapsePanelItem.js +45 -46
- package/dist/Countdown/Countdown.js +5 -12
- package/dist/Divider/Divider.js +8 -5
- package/dist/Drawer/Drawer.js +4 -10
- package/dist/Fade/Fade.js +52 -56
- package/dist/IconButton/IconButton.js +5 -12
- package/dist/Image/Image.js +112 -119
- package/dist/Input/Input.js +4 -10
- package/dist/List/List.js +3 -8
- package/dist/List/ListItem.js +42 -44
- package/dist/List/ListItemContent.js +1 -4
- package/dist/List/ListItemExtra.js +9 -4
- package/dist/List/ListItemFooter.js +9 -4
- package/dist/List/ListItemHeader.js +9 -4
- package/dist/Loading/Loading.js +13 -4
- package/dist/Modal/Modal.js +0 -6
- package/dist/Modal/Modal.miniapp.d.ts +1 -1
- package/dist/Modal/Modal.miniapp.js +4 -10
- package/dist/NavBar/NavBar.js +0 -1
- package/dist/Radio/Radio.js +2 -6
- package/dist/Radio/RadioGroup.js +0 -3
- package/dist/Rating/Rating.js +8 -18
- package/dist/Select/Select.js +4 -8
- package/dist/Skeleton/Skeleton.js +5 -9
- package/dist/Slide/Slide.js +69 -74
- package/dist/Slider/Slider.js +6 -14
- package/dist/Steps/Step.js +81 -82
- package/dist/Steps/Steps.d.ts +1 -1
- package/dist/Steps/Steps.js +57 -60
- package/dist/Switch/Switch.js +75 -78
- package/dist/TabBar/TabBar.js +3 -8
- package/dist/Tabs/Tab.css +3 -6
- package/dist/Tabs/Tab.js +14 -6
- package/dist/Tabs/Tabs.css +3 -17
- package/dist/Tabs/Tabs.js +15 -31
- package/dist/Tabs/Tabs.types.d.ts +0 -4
- package/dist/Tag/Tag.js +2 -6
- package/dist/TextArea/TextArea.js +5 -12
- package/dist/Transition/TransitionCore.js +3 -8
- package/es/ActionSheet/ActionSheetItem.js +3 -8
- package/es/Avatar/Avatar.js +3 -8
- package/es/Avatar/AvatarGroup.js +2 -6
- package/es/Badge/Badge.js +3 -8
- package/es/Button/Button.css +0 -10
- package/es/Button/Button.js +3 -8
- package/es/Calendar/Calendar.js +6 -14
- package/es/Card/Card.css +0 -3
- package/es/Card/CardContent.css +1 -0
- package/es/Card/CardFooter.css +1 -0
- package/es/Card/CardHeader.css +1 -0
- package/es/Checkbox/Checkbox.js +2 -6
- package/es/Checkbox/CheckboxGroup.js +4 -7
- package/es/CollapsePanel/CollapsePanelItem.js +45 -46
- package/es/Countdown/Countdown.js +5 -12
- package/es/Divider/Divider.js +8 -5
- package/es/Drawer/Drawer.js +4 -10
- package/es/Fade/Fade.js +52 -56
- package/es/IconButton/IconButton.js +5 -12
- package/es/Image/Image.js +112 -119
- package/es/Input/Input.js +4 -10
- package/es/List/List.js +3 -8
- package/es/List/ListItem.js +42 -44
- package/es/List/ListItemContent.js +1 -4
- package/es/List/ListItemExtra.js +9 -4
- package/es/List/ListItemFooter.js +9 -4
- package/es/List/ListItemHeader.js +9 -4
- package/es/Loading/Loading.js +13 -4
- package/es/Modal/Modal.js +0 -6
- package/es/Modal/Modal.miniapp.d.ts +1 -1
- package/es/Modal/Modal.miniapp.js +4 -10
- package/es/NavBar/NavBar.js +0 -1
- package/es/Radio/Radio.js +2 -6
- package/es/Radio/RadioGroup.js +0 -3
- package/es/Rating/Rating.js +8 -18
- package/es/Select/Select.js +4 -8
- package/es/Skeleton/Skeleton.js +5 -9
- package/es/Slide/Slide.js +69 -74
- package/es/Slider/Slider.js +6 -14
- package/es/Steps/Step.js +81 -82
- package/es/Steps/Steps.d.ts +1 -1
- package/es/Steps/Steps.js +57 -60
- package/es/Switch/Switch.js +75 -78
- package/es/TabBar/TabBar.js +3 -8
- package/es/Tabs/Tab.css +3 -6
- package/es/Tabs/Tab.js +14 -6
- package/es/Tabs/Tabs.css +3 -17
- package/es/Tabs/Tabs.js +17 -44
- package/es/Tabs/Tabs.types.d.ts +0 -4
- package/es/Tag/Tag.js +2 -6
- package/es/TextArea/TextArea.js +5 -12
- package/es/Transition/TransitionCore.js +3 -8
- package/package.json +5 -5
package/es/Select/Select.js
CHANGED
|
@@ -57,12 +57,14 @@ const Select = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
57
57
|
inputProps,
|
|
58
58
|
BackdropProps,
|
|
59
59
|
value,
|
|
60
|
-
defaultValue,
|
|
60
|
+
defaultValue = "",
|
|
61
61
|
disabled,
|
|
62
62
|
placeholder,
|
|
63
63
|
icon,
|
|
64
64
|
open,
|
|
65
|
-
scrollContainer
|
|
65
|
+
scrollContainer = () => {
|
|
66
|
+
return isMini ? null : document.body;
|
|
67
|
+
},
|
|
66
68
|
onChange,
|
|
67
69
|
onClose,
|
|
68
70
|
onOpen,
|
|
@@ -248,12 +250,6 @@ const Select = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
248
250
|
));
|
|
249
251
|
});
|
|
250
252
|
Select.displayName = "BuiSelect";
|
|
251
|
-
Select.defaultProps = {
|
|
252
|
-
defaultValue: "",
|
|
253
|
-
scrollContainer: () => {
|
|
254
|
-
return isMini ? null : document.body;
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
253
|
var Select_default = Select;
|
|
258
254
|
export {
|
|
259
255
|
Select_default as default
|
package/es/Skeleton/Skeleton.js
CHANGED
|
@@ -31,16 +31,16 @@ import React from "react";
|
|
|
31
31
|
import "./Skeleton.css";
|
|
32
32
|
const prefixCls = "bui-skeleton";
|
|
33
33
|
const Skeleton = /* @__PURE__ */ React.forwardRef(
|
|
34
|
-
(
|
|
35
|
-
|
|
34
|
+
(_a, ref) => {
|
|
35
|
+
var _b = _a, {
|
|
36
36
|
className,
|
|
37
37
|
style,
|
|
38
|
-
animation,
|
|
38
|
+
animation = "wave",
|
|
39
39
|
width,
|
|
40
40
|
height,
|
|
41
|
-
variant,
|
|
41
|
+
variant = "text",
|
|
42
42
|
children
|
|
43
|
-
} =
|
|
43
|
+
} = _b, others = __objRest(_b, [
|
|
44
44
|
"className",
|
|
45
45
|
"style",
|
|
46
46
|
"animation",
|
|
@@ -69,10 +69,6 @@ const Skeleton = /* @__PURE__ */ React.forwardRef(
|
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
Skeleton.displayName = "BuiSkeleton";
|
|
72
|
-
Skeleton.defaultProps = {
|
|
73
|
-
animation: "wave",
|
|
74
|
-
variant: "text"
|
|
75
|
-
};
|
|
76
72
|
var Skeleton_default = Skeleton;
|
|
77
73
|
export {
|
|
78
74
|
Skeleton_default as default
|
package/es/Slide/Slide.js
CHANGED
|
@@ -46,82 +46,77 @@ const defaultTimeout = {
|
|
|
46
46
|
enter: duration.enteringScreen,
|
|
47
47
|
exit: duration.leavingScreen
|
|
48
48
|
};
|
|
49
|
-
const Slide = /* @__PURE__ */ React.forwardRef(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
children,
|
|
54
|
-
style,
|
|
55
|
-
easing: easingProp,
|
|
56
|
-
timeout,
|
|
57
|
-
direction,
|
|
58
|
-
delay
|
|
59
|
-
} = _a, others = __objRest(_a, [
|
|
60
|
-
"appear",
|
|
61
|
-
"in",
|
|
62
|
-
"children",
|
|
63
|
-
"style",
|
|
64
|
-
"easing",
|
|
65
|
-
"timeout",
|
|
66
|
-
"direction",
|
|
67
|
-
"delay"
|
|
68
|
-
]);
|
|
69
|
-
const transitions = createTransitions();
|
|
70
|
-
const nodeRef = useForkRef(ref, children == null ? void 0 : children.ref);
|
|
71
|
-
const getTranslateValue = (_direction) => {
|
|
72
|
-
if (_direction === "left") {
|
|
73
|
-
return "translateX(100%)";
|
|
74
|
-
}
|
|
75
|
-
if (_direction === "right") {
|
|
76
|
-
return "translateX(-100%)";
|
|
77
|
-
}
|
|
78
|
-
if (_direction === "up") {
|
|
79
|
-
return "translateY(100%)";
|
|
80
|
-
}
|
|
81
|
-
return "translateY(-100%)";
|
|
82
|
-
};
|
|
83
|
-
if (!children)
|
|
84
|
-
return null;
|
|
85
|
-
return /* @__PURE__ */ React.createElement(
|
|
86
|
-
Transition,
|
|
87
|
-
__spreadProps(__spreadValues({}, others), {
|
|
88
|
-
appear,
|
|
49
|
+
const Slide = /* @__PURE__ */ React.forwardRef(
|
|
50
|
+
(_a, ref) => {
|
|
51
|
+
var _b = _a, {
|
|
52
|
+
appear = true,
|
|
89
53
|
in: inProp,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
54
|
+
children,
|
|
55
|
+
style,
|
|
56
|
+
easing: easingProp = defaultEasing,
|
|
57
|
+
timeout = defaultTimeout,
|
|
58
|
+
direction = "down",
|
|
59
|
+
delay = 0
|
|
60
|
+
} = _b, others = __objRest(_b, [
|
|
61
|
+
"appear",
|
|
62
|
+
"in",
|
|
63
|
+
"children",
|
|
64
|
+
"style",
|
|
65
|
+
"easing",
|
|
66
|
+
"timeout",
|
|
67
|
+
"direction",
|
|
68
|
+
"delay"
|
|
69
|
+
]);
|
|
70
|
+
const transitions = createTransitions();
|
|
71
|
+
const nodeRef = useForkRef(ref, children == null ? void 0 : children.ref);
|
|
72
|
+
const getTranslateValue = (_direction) => {
|
|
73
|
+
if (_direction === "left") {
|
|
74
|
+
return "translateX(100%)";
|
|
75
|
+
}
|
|
76
|
+
if (_direction === "right") {
|
|
77
|
+
return "translateX(-100%)";
|
|
78
|
+
}
|
|
79
|
+
if (_direction === "up") {
|
|
80
|
+
return "translateY(100%)";
|
|
81
|
+
}
|
|
82
|
+
return "translateY(-100%)";
|
|
83
|
+
};
|
|
84
|
+
if (!children)
|
|
85
|
+
return null;
|
|
86
|
+
return /* @__PURE__ */ React.createElement(
|
|
87
|
+
Transition,
|
|
88
|
+
__spreadProps(__spreadValues({}, others), {
|
|
89
|
+
appear,
|
|
90
|
+
in: inProp,
|
|
91
|
+
timeout,
|
|
92
|
+
delay,
|
|
93
|
+
ref: nodeRef
|
|
94
|
+
}),
|
|
95
|
+
(state, childProps) => {
|
|
96
|
+
const transition = transitions.create(
|
|
97
|
+
"transform",
|
|
98
|
+
getTransitionProps(
|
|
99
|
+
{ timeout, style, easing: easingProp, delay },
|
|
100
|
+
{
|
|
101
|
+
mode: state
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
);
|
|
105
|
+
const transform = state === "entering" || state === "entered" ? "none" : getTranslateValue(direction);
|
|
106
|
+
return React.cloneElement(children, __spreadValues({
|
|
107
|
+
style: __spreadValues(__spreadValues({
|
|
108
|
+
visibility: state === "exited" ? "hidden" : "visible",
|
|
109
|
+
transition,
|
|
110
|
+
WebkitTransition: transition,
|
|
111
|
+
transform,
|
|
112
|
+
WebkitTransform: transform
|
|
113
|
+
}, style), children.props.style)
|
|
114
|
+
}, childProps));
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
);
|
|
117
119
|
Slide.displayName = "BuiSlide";
|
|
118
|
-
Slide.defaultProps = {
|
|
119
|
-
appear: true,
|
|
120
|
-
easing: defaultEasing,
|
|
121
|
-
timeout: defaultTimeout,
|
|
122
|
-
direction: "down",
|
|
123
|
-
delay: 0
|
|
124
|
-
};
|
|
125
120
|
var Slide_default = Slide;
|
|
126
121
|
export {
|
|
127
122
|
Slide_default as default
|
package/es/Slider/Slider.js
CHANGED
|
@@ -79,15 +79,15 @@ const Slider = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
79
79
|
className,
|
|
80
80
|
defaultValue,
|
|
81
81
|
value: valueProp,
|
|
82
|
-
min,
|
|
83
|
-
max,
|
|
84
|
-
step,
|
|
85
|
-
tipVisible,
|
|
86
|
-
tooltipRender,
|
|
82
|
+
min = 0,
|
|
83
|
+
max = 100,
|
|
84
|
+
step = 1,
|
|
85
|
+
tipVisible = false,
|
|
86
|
+
tooltipRender = (value2) => value2,
|
|
87
87
|
disabled,
|
|
88
88
|
startIcon,
|
|
89
89
|
endIcon,
|
|
90
|
-
disableSwap,
|
|
90
|
+
disableSwap = false,
|
|
91
91
|
onChange
|
|
92
92
|
} = _a, others = __objRest(_a, [
|
|
93
93
|
"className",
|
|
@@ -296,14 +296,6 @@ const Slider = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
296
296
|
);
|
|
297
297
|
});
|
|
298
298
|
Slider.displayName = "BuiSlider";
|
|
299
|
-
Slider.defaultProps = {
|
|
300
|
-
min: 0,
|
|
301
|
-
max: 100,
|
|
302
|
-
step: 1,
|
|
303
|
-
disableSwap: false,
|
|
304
|
-
tipVisible: false,
|
|
305
|
-
tooltipRender: (value) => value
|
|
306
|
-
};
|
|
307
299
|
var Slider_default = Slider;
|
|
308
300
|
export {
|
|
309
301
|
Slider_default as default
|
package/es/Steps/Step.js
CHANGED
|
@@ -42,99 +42,98 @@ const classes = {
|
|
|
42
42
|
title: "bui-step-title",
|
|
43
43
|
subtitle: "bui-step-subtitle"
|
|
44
44
|
};
|
|
45
|
-
const Step = forwardRef(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const renderIcon = () => {
|
|
75
|
-
const icons = {
|
|
76
|
-
active: /* @__PURE__ */ React.createElement("div", { className: `${classes.icon}-active` }),
|
|
77
|
-
wait: /* @__PURE__ */ React.createElement(CircleOutlinedIcon, { htmlColor: "#ced1d6" }),
|
|
78
|
-
finish: /* @__PURE__ */ React.createElement(SuccessCircleFilledIcon, { color: "primary" }),
|
|
79
|
-
error: /* @__PURE__ */ React.createElement(ErrorCircleFilledIcon, { color: "primary" })
|
|
45
|
+
const Step = forwardRef(
|
|
46
|
+
(_a, ref) => {
|
|
47
|
+
var _b = _a, {
|
|
48
|
+
className,
|
|
49
|
+
description,
|
|
50
|
+
icon,
|
|
51
|
+
title,
|
|
52
|
+
subtitle,
|
|
53
|
+
status,
|
|
54
|
+
disabled = false,
|
|
55
|
+
onClick
|
|
56
|
+
} = _b, others = __objRest(_b, [
|
|
57
|
+
"className",
|
|
58
|
+
"description",
|
|
59
|
+
"icon",
|
|
60
|
+
"title",
|
|
61
|
+
"subtitle",
|
|
62
|
+
"status",
|
|
63
|
+
"disabled",
|
|
64
|
+
"onClick"
|
|
65
|
+
]);
|
|
66
|
+
const stepsContext = useContext(StepsContext);
|
|
67
|
+
const { direction, labelPlacement, current, onChange } = stepsContext;
|
|
68
|
+
const isTitleVertical = labelPlacement === "vertical";
|
|
69
|
+
const handleClick = (e) => {
|
|
70
|
+
if (disabled)
|
|
71
|
+
return;
|
|
72
|
+
onClick == null ? void 0 : onClick(e, { current });
|
|
73
|
+
onChange == null ? void 0 : onChange(e, { current });
|
|
80
74
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
ref,
|
|
94
|
-
onClick: handleClick
|
|
95
|
-
}, others),
|
|
96
|
-
/* @__PURE__ */ React.createElement(
|
|
97
|
-
"div",
|
|
98
|
-
{
|
|
99
|
-
className: clsx(classes.line, {
|
|
100
|
-
[`${classes.line}-${status}`]: status
|
|
101
|
-
})
|
|
102
|
-
}
|
|
103
|
-
),
|
|
104
|
-
/* @__PURE__ */ React.createElement("div", { className: classes.icon }, renderIcon()),
|
|
105
|
-
/* @__PURE__ */ React.createElement("div", { className: `${classes.root}-content` }, /* @__PURE__ */ React.createElement(
|
|
75
|
+
const renderIcon = () => {
|
|
76
|
+
const icons = {
|
|
77
|
+
active: /* @__PURE__ */ React.createElement("div", { className: `${classes.icon}-active` }),
|
|
78
|
+
wait: /* @__PURE__ */ React.createElement(CircleOutlinedIcon, { htmlColor: "#ced1d6" }),
|
|
79
|
+
finish: /* @__PURE__ */ React.createElement(SuccessCircleFilledIcon, { color: "primary" }),
|
|
80
|
+
error: /* @__PURE__ */ React.createElement(ErrorCircleFilledIcon, { color: "primary" })
|
|
81
|
+
};
|
|
82
|
+
if (icon)
|
|
83
|
+
return icon;
|
|
84
|
+
return icons[status];
|
|
85
|
+
};
|
|
86
|
+
return /* @__PURE__ */ React.createElement(
|
|
106
87
|
"div",
|
|
107
|
-
{
|
|
108
|
-
className: clsx(
|
|
109
|
-
[`${classes.
|
|
110
|
-
[`${classes.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
88
|
+
__spreadValues({
|
|
89
|
+
className: clsx(classes.root, className, {
|
|
90
|
+
[`${classes.root}-${direction}`]: direction,
|
|
91
|
+
[`${classes.root}-label-${labelPlacement}`]: labelPlacement,
|
|
92
|
+
[`${classes.root}-disabled`]: disabled
|
|
93
|
+
}),
|
|
94
|
+
ref,
|
|
95
|
+
onClick: handleClick
|
|
96
|
+
}, others),
|
|
97
|
+
/* @__PURE__ */ React.createElement(
|
|
114
98
|
"div",
|
|
115
99
|
{
|
|
116
|
-
className: clsx(classes.
|
|
117
|
-
[`${classes.
|
|
100
|
+
className: clsx(classes.line, {
|
|
101
|
+
[`${classes.line}-${status}`]: status
|
|
118
102
|
})
|
|
119
|
-
}
|
|
120
|
-
title
|
|
103
|
+
}
|
|
121
104
|
),
|
|
122
|
-
|
|
105
|
+
/* @__PURE__ */ React.createElement("div", { className: classes.icon }, renderIcon()),
|
|
106
|
+
/* @__PURE__ */ React.createElement("div", { className: `${classes.root}-content` }, /* @__PURE__ */ React.createElement(
|
|
123
107
|
"div",
|
|
124
108
|
{
|
|
125
|
-
className: clsx(classes.
|
|
126
|
-
[`${classes.
|
|
109
|
+
className: clsx(`${classes.title}-wrapper`, {
|
|
110
|
+
[`${classes.title}-wrapper-vertical`]: isTitleVertical,
|
|
111
|
+
[`${classes.title}-wrapper-line-${status}`]: status
|
|
127
112
|
})
|
|
128
113
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
114
|
+
!!title && /* @__PURE__ */ React.createElement(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
className: clsx(classes.title, `${classes.title}-${status}`, {
|
|
118
|
+
[`${classes.title}-${labelPlacement}`]: labelPlacement
|
|
119
|
+
})
|
|
120
|
+
},
|
|
121
|
+
title
|
|
122
|
+
),
|
|
123
|
+
!!subtitle && /* @__PURE__ */ React.createElement(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
className: clsx(classes.subtitle, {
|
|
127
|
+
[`${classes.subtitle}-${labelPlacement}`]: labelPlacement
|
|
128
|
+
})
|
|
129
|
+
},
|
|
130
|
+
subtitle
|
|
131
|
+
)
|
|
132
|
+
), !!description && /* @__PURE__ */ React.createElement("div", { className: `${classes.root}-desc` }, description))
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
);
|
|
134
136
|
Step.displayName = "Step";
|
|
135
|
-
Step.defaultProps = {
|
|
136
|
-
disabled: false
|
|
137
|
-
};
|
|
138
137
|
var Step_default = Step;
|
|
139
138
|
export {
|
|
140
139
|
Step_default as default
|
package/es/Steps/Steps.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import './Steps.less';
|
|
3
2
|
import { StepsProps } from './Steps.types';
|
|
3
|
+
import './Steps.less';
|
|
4
4
|
declare const Steps: React.ForwardRefExoticComponent<Omit<StepsProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default Steps;
|
package/es/Steps/Steps.js
CHANGED
|
@@ -29,70 +29,67 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
import { toArray } from "@bifrostui/utils";
|
|
30
30
|
import clsx from "clsx";
|
|
31
31
|
import React, { cloneElement, forwardRef } from "react";
|
|
32
|
-
import "./Steps.css";
|
|
33
32
|
import { StepsContextProvider } from "./StepsContext";
|
|
33
|
+
import "./Steps.css";
|
|
34
34
|
const prefixCls = "bui-steps";
|
|
35
|
-
const Steps = forwardRef(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
35
|
+
const Steps = forwardRef(
|
|
36
|
+
(_a, ref) => {
|
|
37
|
+
var _b = _a, {
|
|
38
|
+
className,
|
|
39
|
+
children,
|
|
40
|
+
direction = "vertical",
|
|
41
|
+
current = 0,
|
|
42
|
+
labelPlacement = "horizontal",
|
|
43
|
+
onChange
|
|
44
|
+
} = _b, others = __objRest(_b, [
|
|
45
|
+
"className",
|
|
46
|
+
"children",
|
|
47
|
+
"direction",
|
|
48
|
+
"current",
|
|
49
|
+
"labelPlacement",
|
|
50
|
+
"onChange"
|
|
51
|
+
]);
|
|
52
|
+
const renderStep = () => {
|
|
53
|
+
return toArray(children).map((child, index) => {
|
|
54
|
+
const childProps = __spreadValues({
|
|
55
|
+
key: index
|
|
56
|
+
}, child.props);
|
|
57
|
+
if (!child.props.status) {
|
|
58
|
+
if (index === current) {
|
|
59
|
+
childProps.status = "active";
|
|
60
|
+
} else if (index < current) {
|
|
61
|
+
childProps.status = "finish";
|
|
62
|
+
} else {
|
|
63
|
+
childProps.status = "wait";
|
|
64
|
+
}
|
|
63
65
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
|
|
66
|
+
return cloneElement(child, childProps);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ React.createElement(
|
|
70
|
+
StepsContextProvider,
|
|
71
|
+
{
|
|
72
|
+
value: {
|
|
73
|
+
direction,
|
|
74
|
+
current,
|
|
75
|
+
labelPlacement,
|
|
76
|
+
onChange
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
/* @__PURE__ */ React.createElement(
|
|
80
|
+
"div",
|
|
81
|
+
__spreadValues({
|
|
82
|
+
className: clsx(prefixCls, className, {
|
|
83
|
+
[`${prefixCls}-${direction}`]: direction
|
|
84
|
+
}),
|
|
85
|
+
ref
|
|
86
|
+
}, others),
|
|
87
|
+
renderStep()
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
);
|
|
90
92
|
Steps.displayName = "Steps";
|
|
91
|
-
Steps.defaultProps = {
|
|
92
|
-
current: 0,
|
|
93
|
-
direction: "vertical",
|
|
94
|
-
labelPlacement: "horizontal"
|
|
95
|
-
};
|
|
96
93
|
var Steps_default = Steps;
|
|
97
94
|
export {
|
|
98
95
|
Steps_default as default
|