@bifrostui/react 1.4.8-beta.0 → 2.0.0-beta.1
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/ActionSheet.css +2 -2
- 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 +77 -78
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +4 -10
- package/dist/Button/Button.types.d.ts +8 -7
- package/dist/Calendar/Calendar.js +7 -19
- package/dist/Calendar/Calendar.types.d.ts +0 -5
- package/dist/Card/Card.css +1 -1
- package/dist/Card/CardContent.css +1 -2
- package/dist/Card/CardFooter.css +2 -4
- package/dist/Card/CardHeader.css +4 -5
- package/dist/Checkbox/Checkbox.js +2 -6
- package/dist/Checkbox/CheckboxGroup.js +4 -7
- package/dist/Collapse/Collapse.css +1 -0
- package/dist/Collapse/Collapse.d.ts +1 -1
- package/dist/Collapse/Collapse.js +8 -11
- package/dist/CollapsePanel/CollapsePanel.css +2 -4
- package/dist/CollapsePanel/CollapsePanelItem.js +45 -46
- package/dist/Countdown/Countdown.js +5 -12
- package/dist/Dialog/FunctionalDialog.js +1 -1
- 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.js +4 -10
- package/dist/NavBar/NavBar.js +0 -1
- package/dist/Picker/Picker.css +0 -5
- package/dist/Picker/Picker.js +5 -27
- package/dist/Picker/Picker.types.d.ts +2 -15
- package/dist/Picker/PickerPanel.css +0 -4
- package/dist/Picker/PickerPanel.js +6 -7
- package/dist/Popover/Popover.css +5 -5
- package/dist/Popover/Popover.js +27 -70
- package/dist/Portal/Portal.miniapp.js +4 -7
- package/dist/Radio/Radio.css +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/ScrollView/ScrollView.js +11 -24
- package/dist/ScrollView/ScrollView.types.d.ts +1 -0
- package/dist/Select/Select.css +4 -1
- package/dist/Select/Select.js +41 -68
- package/dist/Skeleton/Skeleton.js +5 -9
- package/dist/Slide/Slide.js +69 -74
- package/dist/Slider/Slider.js +11 -27
- 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 +10 -16
- package/dist/Tabs/Tab.js +2 -3
- package/dist/Tabs/Tabs.css +13 -22
- package/dist/Tabs/Tabs.js +39 -70
- package/dist/Tabs/Tabs.types.d.ts +0 -10
- package/dist/Tabs/utils/bound.d.ts +1 -0
- package/dist/{DesktopPicker/utils/calcAfterMounted.js → Tabs/utils/bound.js} +14 -7
- package/dist/Tag/Tag.css +1 -1
- package/dist/Tag/Tag.js +2 -6
- package/dist/TextArea/TextArea.js +5 -12
- package/dist/Toast/FunctionalToast.js +1 -1
- package/dist/Toast/Toast.css +1 -0
- package/dist/Tooltip/Tooltip.css +5 -5
- package/dist/Tooltip/Tooltip.js +27 -70
- package/dist/Transition/TransitionCore.js +3 -8
- package/dist/index.d.ts +0 -6
- package/dist/index.js +1 -13
- package/dist/locales/base.d.ts +0 -11
- package/dist/locales/en-US.js +0 -24
- package/dist/locales/zh-CN.js +0 -24
- package/dist/locales/zh-TW.js +0 -24
- package/es/ActionSheet/ActionSheet.css +2 -2
- 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 +77 -78
- package/es/Button/Button.d.ts +1 -1
- package/es/Button/Button.js +3 -9
- package/es/Button/Button.types.d.ts +8 -7
- package/es/Calendar/Calendar.js +7 -19
- package/es/Calendar/Calendar.types.d.ts +0 -5
- package/es/Card/Card.css +1 -1
- package/es/Card/CardContent.css +1 -2
- package/es/Card/CardFooter.css +2 -4
- package/es/Card/CardHeader.css +4 -5
- package/es/Checkbox/Checkbox.js +2 -6
- package/es/Checkbox/CheckboxGroup.js +4 -7
- package/es/Collapse/Collapse.css +1 -0
- package/es/Collapse/Collapse.d.ts +1 -1
- package/es/Collapse/Collapse.js +8 -11
- package/es/CollapsePanel/CollapsePanel.css +2 -4
- package/es/CollapsePanel/CollapsePanelItem.js +45 -46
- package/es/Countdown/Countdown.js +5 -12
- package/es/Dialog/FunctionalDialog.js +2 -2
- 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/Picker/Picker.css +0 -5
- package/es/Picker/Picker.js +5 -27
- package/es/Picker/Picker.types.d.ts +2 -15
- package/es/Picker/PickerPanel.css +0 -4
- package/es/Picker/PickerPanel.js +6 -7
- package/es/Popover/Popover.css +5 -5
- package/es/Popover/Popover.js +29 -73
- package/es/Portal/Portal.miniapp.js +5 -8
- package/es/Radio/Radio.css +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/ScrollView/ScrollView.js +11 -24
- package/es/ScrollView/ScrollView.types.d.ts +1 -0
- package/es/Select/Select.css +4 -1
- package/es/Select/Select.js +42 -68
- package/es/Skeleton/Skeleton.js +5 -9
- package/es/Slide/Slide.js +69 -74
- package/es/Slider/Slider.js +12 -30
- 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 +10 -16
- package/es/Tabs/Tab.js +2 -3
- package/es/Tabs/Tabs.css +13 -22
- package/es/Tabs/Tabs.js +41 -83
- package/es/Tabs/Tabs.types.d.ts +0 -10
- package/es/Tabs/utils/bound.d.ts +1 -0
- package/es/Tabs/utils/bound.js +13 -0
- package/es/Tag/Tag.css +1 -1
- package/es/Tag/Tag.js +2 -6
- package/es/TextArea/TextArea.js +5 -12
- package/es/Toast/FunctionalToast.js +2 -2
- package/es/Toast/Toast.css +1 -0
- package/es/Tooltip/Tooltip.css +5 -5
- package/es/Tooltip/Tooltip.js +29 -73
- package/es/Transition/TransitionCore.js +3 -8
- package/es/index.d.ts +0 -6
- package/es/index.js +0 -6
- package/es/locales/base.d.ts +0 -11
- package/es/locales/en-US.js +0 -24
- package/es/locales/zh-CN.js +0 -24
- package/es/locales/zh-TW.js +0 -24
- package/package.json +6 -6
- package/dist/Collapse/Collapse.miniapp.d.ts +0 -5
- package/dist/Collapse/Collapse.miniapp.js +0 -177
- package/dist/DatePicker/DatePicker.d.ts +0 -4
- package/dist/DatePicker/DatePicker.js +0 -335
- package/dist/DatePicker/DatePicker.types.d.ts +0 -36
- package/dist/DatePicker/DatePicker.types.js +0 -15
- package/dist/DatePicker/constants.d.ts +0 -9
- package/dist/DatePicker/constants.js +0 -37
- package/dist/DatePicker/index.d.ts +0 -3
- package/dist/DatePicker/index.js +0 -44
- package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
- package/dist/DesktopDatePicker/DesktopDatePicker.js +0 -280
- package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
- package/dist/DesktopDatePicker/DesktopDatePicker.types.js +0 -15
- package/dist/DesktopDatePicker/deskTopPickerContainer.css +0 -100
- package/dist/DesktopDatePicker/index.css +0 -61
- package/dist/DesktopDatePicker/index.d.ts +0 -2
- package/dist/DesktopDatePicker/index.js +0 -41
- package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
- package/dist/DesktopDatePicker/useGetDatePickerContent.js +0 -343
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -322
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -15
- package/dist/DesktopDateTimePicker/index.css +0 -66
- package/dist/DesktopDateTimePicker/index.d.ts +0 -2
- package/dist/DesktopDateTimePicker/index.js +0 -41
- package/dist/DesktopPicker/DesktopPicker.d.ts +0 -5
- package/dist/DesktopPicker/DesktopPicker.js +0 -238
- package/dist/DesktopPicker/DesktopPicker.types.d.ts +0 -57
- package/dist/DesktopPicker/DesktopPicker.types.js +0 -15
- package/dist/DesktopPicker/index.css +0 -37
- package/dist/DesktopPicker/index.d.ts +0 -2
- package/dist/DesktopPicker/index.js +0 -41
- package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -38
- package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
- package/dist/DesktopTimePicker/DesktopTimePicker.js +0 -288
- package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
- package/dist/DesktopTimePicker/DesktopTimePicker.types.js +0 -15
- package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
- package/dist/DesktopTimePicker/DesktopTimePickerList.js +0 -111
- package/dist/DesktopTimePicker/index.css +0 -170
- package/dist/DesktopTimePicker/index.d.ts +0 -2
- package/dist/DesktopTimePicker/index.js +0 -41
- package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
- package/dist/DesktopTimePicker/useGetTimePickerContent.js +0 -249
- package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
- package/dist/DesktopTimePicker/utils/scrollUtil.js +0 -27
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -51
- package/dist/DesktopTimePicker/utils/utils.d.ts +0 -28
- package/dist/DesktopTimePicker/utils/utils.js +0 -408
- package/dist/SwipeAction/SwipeAction.css +0 -79
- package/dist/SwipeAction/SwipeAction.d.ts +0 -5
- package/dist/SwipeAction/SwipeAction.js +0 -349
- package/dist/SwipeAction/SwipeAction.types.d.ts +0 -75
- package/dist/SwipeAction/SwipeAction.types.js +0 -15
- package/dist/SwipeAction/SwipeActionContext.d.ts +0 -4
- package/dist/SwipeAction/SwipeActionContext.js +0 -30
- package/dist/SwipeAction/SwipeActionItem.css +0 -31
- package/dist/SwipeAction/SwipeActionItem.d.ts +0 -5
- package/dist/SwipeAction/SwipeActionItem.js +0 -105
- package/dist/SwipeAction/constants.d.ts +0 -9
- package/dist/SwipeAction/constants.js +0 -39
- package/dist/SwipeAction/index.d.ts +0 -5
- package/dist/SwipeAction/index.js +0 -50
- package/dist/Tabs/utils/scroll.d.ts +0 -2
- package/dist/Tabs/utils/scroll.js +0 -55
- package/es/Collapse/Collapse.miniapp.d.ts +0 -5
- package/es/Collapse/Collapse.miniapp.js +0 -157
- package/es/DatePicker/DatePicker.d.ts +0 -4
- package/es/DatePicker/DatePicker.js +0 -308
- package/es/DatePicker/DatePicker.types.d.ts +0 -36
- package/es/DatePicker/DatePicker.types.js +0 -1
- package/es/DatePicker/constants.d.ts +0 -9
- package/es/DatePicker/constants.js +0 -14
- package/es/DatePicker/index.d.ts +0 -3
- package/es/DatePicker/index.js +0 -8
- package/es/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
- package/es/DesktopDatePicker/DesktopDatePicker.js +0 -253
- package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
- package/es/DesktopDatePicker/DesktopDatePicker.types.js +0 -1
- package/es/DesktopDatePicker/deskTopPickerContainer.css +0 -100
- package/es/DesktopDatePicker/index.css +0 -61
- package/es/DesktopDatePicker/index.d.ts +0 -2
- package/es/DesktopDatePicker/index.js +0 -6
- package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
- package/es/DesktopDatePicker/useGetDatePickerContent.js +0 -316
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -295
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -1
- package/es/DesktopDateTimePicker/index.css +0 -66
- package/es/DesktopDateTimePicker/index.d.ts +0 -2
- package/es/DesktopDateTimePicker/index.js +0 -9
- package/es/DesktopPicker/DesktopPicker.d.ts +0 -5
- package/es/DesktopPicker/DesktopPicker.js +0 -221
- package/es/DesktopPicker/DesktopPicker.types.d.ts +0 -57
- package/es/DesktopPicker/DesktopPicker.types.js +0 -1
- package/es/DesktopPicker/index.css +0 -37
- package/es/DesktopPicker/index.d.ts +0 -2
- package/es/DesktopPicker/index.js +0 -6
- package/es/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
- package/es/DesktopPicker/utils/calcAfterMounted.js +0 -6
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -9
- package/es/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
- package/es/DesktopTimePicker/DesktopTimePicker.js +0 -261
- package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
- package/es/DesktopTimePicker/DesktopTimePicker.types.js +0 -1
- package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
- package/es/DesktopTimePicker/DesktopTimePickerList.js +0 -84
- package/es/DesktopTimePicker/index.css +0 -170
- package/es/DesktopTimePicker/index.d.ts +0 -2
- package/es/DesktopTimePicker/index.js +0 -6
- package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
- package/es/DesktopTimePicker/useGetTimePickerContent.js +0 -226
- package/es/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
- package/es/DesktopTimePicker/utils/scrollUtil.js +0 -8
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -22
- package/es/DesktopTimePicker/utils/utils.d.ts +0 -28
- package/es/DesktopTimePicker/utils/utils.js +0 -365
- package/es/SwipeAction/SwipeAction.css +0 -79
- package/es/SwipeAction/SwipeAction.d.ts +0 -5
- package/es/SwipeAction/SwipeAction.js +0 -334
- package/es/SwipeAction/SwipeAction.types.d.ts +0 -75
- package/es/SwipeAction/SwipeAction.types.js +0 -1
- package/es/SwipeAction/SwipeActionContext.d.ts +0 -4
- package/es/SwipeAction/SwipeActionContext.js +0 -11
- package/es/SwipeAction/SwipeActionItem.css +0 -31
- package/es/SwipeAction/SwipeActionItem.d.ts +0 -5
- package/es/SwipeAction/SwipeActionItem.js +0 -78
- package/es/SwipeAction/constants.d.ts +0 -9
- package/es/SwipeAction/constants.js +0 -15
- package/es/SwipeAction/index.d.ts +0 -5
- package/es/SwipeAction/index.js +0 -12
- package/es/Tabs/utils/scroll.d.ts +0 -2
- package/es/Tabs/utils/scroll.js +0 -36
package/es/Switch/Switch.js
CHANGED
|
@@ -34,85 +34,82 @@ import clsx from "clsx";
|
|
|
34
34
|
import React, { forwardRef } from "react";
|
|
35
35
|
import "./Switch.css";
|
|
36
36
|
const prefixCls = "bui-switch";
|
|
37
|
-
const Switch = forwardRef(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
37
|
+
const Switch = forwardRef(
|
|
38
|
+
(_a, ref) => {
|
|
39
|
+
var _b = _a, {
|
|
40
|
+
className,
|
|
41
|
+
checked,
|
|
42
|
+
defaultChecked,
|
|
43
|
+
inputProps,
|
|
44
|
+
inputRef,
|
|
45
|
+
name,
|
|
46
|
+
checkedChildren,
|
|
47
|
+
unCheckedChildren,
|
|
48
|
+
disabled = false,
|
|
49
|
+
size = "medium",
|
|
50
|
+
color = "primary",
|
|
51
|
+
onChange
|
|
52
|
+
} = _b, others = __objRest(_b, [
|
|
53
|
+
"className",
|
|
54
|
+
"checked",
|
|
55
|
+
"defaultChecked",
|
|
56
|
+
"inputProps",
|
|
57
|
+
"inputRef",
|
|
58
|
+
"name",
|
|
59
|
+
"checkedChildren",
|
|
60
|
+
"unCheckedChildren",
|
|
61
|
+
"disabled",
|
|
62
|
+
"size",
|
|
63
|
+
"color",
|
|
64
|
+
"onChange"
|
|
65
|
+
]);
|
|
66
|
+
const [switchChecked, triggerChange] = useValue({
|
|
67
|
+
value: checked,
|
|
68
|
+
defaultValue: !!defaultChecked
|
|
69
|
+
});
|
|
70
|
+
const changeAction = (e, isChecked) => {
|
|
71
|
+
triggerChange(e, isChecked);
|
|
72
|
+
onChange == null ? void 0 : onChange(e, { checked: isChecked });
|
|
73
|
+
};
|
|
74
|
+
const handleChange = (e) => {
|
|
75
|
+
var _a2;
|
|
76
|
+
const isChecked = !switchChecked;
|
|
77
|
+
changeAction(e, isChecked);
|
|
78
|
+
(_a2 = inputProps == null ? void 0 : inputProps.onChange) == null ? void 0 : _a2.call(inputProps, e);
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ React.createElement(
|
|
81
|
+
"div",
|
|
82
|
+
__spreadValues({
|
|
83
|
+
ref,
|
|
84
|
+
className: clsx(
|
|
85
|
+
`${prefixCls}`,
|
|
86
|
+
`${prefixCls}-${size}`,
|
|
87
|
+
`${prefixCls}-${color}`,
|
|
88
|
+
{
|
|
89
|
+
[`${prefixCls}-checked`]: switchChecked,
|
|
90
|
+
[`${prefixCls}-disabled`]: disabled
|
|
91
|
+
},
|
|
92
|
+
className
|
|
93
|
+
)
|
|
94
|
+
}, others),
|
|
95
|
+
/* @__PURE__ */ React.createElement(
|
|
96
|
+
"input",
|
|
97
|
+
__spreadProps(__spreadValues({
|
|
98
|
+
ref: inputRef,
|
|
99
|
+
type: "checkbox",
|
|
100
|
+
name,
|
|
101
|
+
checked: switchChecked,
|
|
102
|
+
disabled
|
|
103
|
+
}, inputProps), {
|
|
104
|
+
onChange: handleChange,
|
|
105
|
+
className: clsx(`${prefixCls}-input`, inputProps == null ? void 0 : inputProps.className)
|
|
106
|
+
})
|
|
107
|
+
),
|
|
108
|
+
(checkedChildren || unCheckedChildren) && /* @__PURE__ */ React.createElement("span", { className: `${prefixCls}-inner` }, switchChecked ? checkedChildren : unCheckedChildren)
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
110
112
|
Switch.displayName = "BuiSwitch";
|
|
111
|
-
Switch.defaultProps = {
|
|
112
|
-
disabled: false,
|
|
113
|
-
size: "medium",
|
|
114
|
-
color: "primary"
|
|
115
|
-
};
|
|
116
113
|
var Switch_default = Switch;
|
|
117
114
|
export {
|
|
118
115
|
Switch_default as default
|
package/es/TabBar/TabBar.js
CHANGED
|
@@ -33,9 +33,9 @@ import "./TabBar.css";
|
|
|
33
33
|
const prefixCls = "bui-tab-bar";
|
|
34
34
|
const TabBar = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
35
35
|
const _a = props || {}, {
|
|
36
|
-
current,
|
|
37
|
-
activeColor,
|
|
38
|
-
color,
|
|
36
|
+
current = 0,
|
|
37
|
+
activeColor = "primary",
|
|
38
|
+
color = "default",
|
|
39
39
|
children,
|
|
40
40
|
className,
|
|
41
41
|
onChange
|
|
@@ -67,11 +67,6 @@ const TabBar = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
67
67
|
);
|
|
68
68
|
});
|
|
69
69
|
TabBar.displayName = "BuiTabBar";
|
|
70
|
-
TabBar.defaultProps = {
|
|
71
|
-
activeColor: "primary",
|
|
72
|
-
color: "default",
|
|
73
|
-
current: 0
|
|
74
|
-
};
|
|
75
70
|
var TabBar_default = TabBar;
|
|
76
71
|
export {
|
|
77
72
|
TabBar_default as default
|
package/es/Tabs/Tab.css
CHANGED
|
@@ -4,31 +4,25 @@
|
|
|
4
4
|
justify-content: center;
|
|
5
5
|
white-space: nowrap;
|
|
6
6
|
width: min-content;
|
|
7
|
-
height:
|
|
7
|
+
height: 100%;
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
position: relative;
|
|
10
10
|
cursor: pointer;
|
|
11
|
-
font-size: var(--font-size);
|
|
11
|
+
font-size: var(--bui-tabs-font-size);
|
|
12
12
|
line-height: var(--bui-line-height);
|
|
13
|
-
color: var(--color);
|
|
14
|
-
padding: var(--tab-padding);
|
|
15
|
-
font-family: var(--bui-font-family);
|
|
13
|
+
color: var(--bui-tabs-color);
|
|
14
|
+
padding: var(--bui-tab-padding);
|
|
15
|
+
font-family: var(--bui-tabs-font-family);
|
|
16
16
|
}
|
|
17
17
|
.bui-tab-active {
|
|
18
|
-
font-
|
|
19
|
-
|
|
20
|
-
font-weight:
|
|
21
|
-
color: var(--active-color);
|
|
22
|
-
}
|
|
23
|
-
.bui-tab-center {
|
|
24
|
-
flex: 1 0 0;
|
|
25
|
-
margin: 0 auto;
|
|
18
|
+
--bui-tabs-font-family: var(--bui-font-family-accent, inherit);
|
|
19
|
+
--bui-tabs-color: var(--bui-color-fg-default);
|
|
20
|
+
font-weight: 600;
|
|
26
21
|
}
|
|
27
22
|
.bui-tab-miniapp-active {
|
|
28
|
-
|
|
23
|
+
--bui-tabs-color: var(--bui-color-fg-default);
|
|
29
24
|
line-height: 1.5;
|
|
30
25
|
font-weight: var(--bui-font-weight-medium);
|
|
31
|
-
color: var(--active-color);
|
|
32
26
|
position: relative;
|
|
33
27
|
}
|
|
34
28
|
.bui-tab-miniapp-active-line {
|
|
@@ -46,7 +40,7 @@
|
|
|
46
40
|
opacity: 0.5;
|
|
47
41
|
pointer-events: none;
|
|
48
42
|
}
|
|
49
|
-
.bui-
|
|
43
|
+
.bui-indicator-invisible {
|
|
50
44
|
visibility: hidden;
|
|
51
45
|
background-color: transparent;
|
|
52
46
|
}
|
package/es/Tabs/Tab.js
CHANGED
|
@@ -50,14 +50,13 @@ const Tab = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
50
50
|
"onClick"
|
|
51
51
|
]);
|
|
52
52
|
const tabsContext = React.useContext(TabsContext);
|
|
53
|
-
const { value,
|
|
53
|
+
const { value, triggerChange } = tabsContext;
|
|
54
54
|
return /* @__PURE__ */ React.createElement(
|
|
55
55
|
"div",
|
|
56
56
|
__spreadProps(__spreadValues({
|
|
57
57
|
ref,
|
|
58
58
|
className: clsx(
|
|
59
59
|
prefixCls,
|
|
60
|
-
align !== "start" && `${prefixCls}-${align}`,
|
|
61
60
|
{
|
|
62
61
|
[`${prefixCls}-active`]: !isMini && index === value,
|
|
63
62
|
[`${prefixCls}-miniapp-active`]: isMini && index === value,
|
|
@@ -79,7 +78,7 @@ const Tab = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
79
78
|
"div",
|
|
80
79
|
{
|
|
81
80
|
className: clsx(`${prefixCls}-miniapp-active-line`, {
|
|
82
|
-
"bui-
|
|
81
|
+
"bui-indicator-invisible": index !== value
|
|
83
82
|
})
|
|
84
83
|
}
|
|
85
84
|
)
|
package/es/Tabs/Tabs.css
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
.bui-tabs {
|
|
2
|
-
--height: var(--bui-tabs-height, 39px);
|
|
3
|
-
--color: var(--bui-tabs-color, var(--bui-color-fg-subtle));
|
|
4
|
-
--active-color: var(--bui-tabs-active-color, var(--bui-color-fg-default));
|
|
5
|
-
--line-color: var(--bui-tabs-line-color, var(--bui-color-primary));
|
|
6
|
-
--line-height: var(--bui-tabs-line-height, 3PX);
|
|
7
|
-
--line-width: var(--bui-tabs-line-width, 18px);
|
|
8
|
-
--mask-width: var(--bui-tabs-mask-width, 12px);
|
|
9
|
-
--mask-height: var(--bui-tabs-mask-height, 100%);
|
|
10
|
-
--tab-height: var(--bui-tab-height, 100%);
|
|
11
|
-
--tab-padding: var(--bui-tab-padding, var(--bui-spacing-lg) var(--bui-spacing-lg) 10px);
|
|
12
|
-
--font-size: var(--bui-tab-font-size, var(--bui-text-size-1));
|
|
13
2
|
position: relative;
|
|
14
|
-
font-family: var(--bui-font-family);
|
|
3
|
+
font-family: var(--bui-tabs-font-family);
|
|
4
|
+
font-weight: var(--bui-tabs-font-weight);
|
|
15
5
|
}
|
|
16
6
|
.bui-tabs-tabs {
|
|
17
|
-
height: var(--height);
|
|
7
|
+
height: var(--bui-tabs-height);
|
|
18
8
|
display: flex;
|
|
19
9
|
flex-wrap: nowrap;
|
|
20
10
|
justify-content: flex-start;
|
|
@@ -26,14 +16,15 @@
|
|
|
26
16
|
.bui-tabs-tabs::-webkit-scrollbar {
|
|
27
17
|
display: none;
|
|
28
18
|
}
|
|
29
|
-
.bui-tabs-
|
|
19
|
+
.bui-tabs-indicator {
|
|
30
20
|
position: absolute;
|
|
31
|
-
width: var(--
|
|
32
|
-
bottom:
|
|
33
|
-
height: var(--
|
|
21
|
+
width: var(--bui-tabs-indicator-width);
|
|
22
|
+
bottom: var(--bui-tabs-indicator-bottom);
|
|
23
|
+
height: var(--bui-tabs-indicator-height);
|
|
34
24
|
color: var(--bui-color-primary);
|
|
35
|
-
background: var(--
|
|
36
|
-
border-radius: var(--bui-
|
|
25
|
+
background: var(--bui-tabs-indicator-bg);
|
|
26
|
+
border-radius: var(--bui-tabs-indicator-border-radius);
|
|
27
|
+
box-shadow: var(--bui-tabs-indicator-box-shadow);
|
|
37
28
|
}
|
|
38
29
|
.bui-tabs-content {
|
|
39
30
|
padding: var(--bui-spacing-lg);
|
|
@@ -43,8 +34,8 @@
|
|
|
43
34
|
top: 0;
|
|
44
35
|
bottom: 0;
|
|
45
36
|
z-index: 1;
|
|
46
|
-
width:
|
|
47
|
-
height:
|
|
37
|
+
width: 12px;
|
|
38
|
+
height: 100%;
|
|
48
39
|
pointer-events: none;
|
|
49
40
|
}
|
|
50
41
|
.bui-tabs-mask-left {
|
|
@@ -63,7 +54,7 @@
|
|
|
63
54
|
var(--bui-color-bg-view),
|
|
64
55
|
rgba(255, 255, 255, 0));
|
|
65
56
|
}
|
|
66
|
-
.bui-
|
|
57
|
+
.bui-indicator-invisible {
|
|
67
58
|
visibility: hidden;
|
|
68
59
|
background-color: transparent;
|
|
69
60
|
}
|
package/es/Tabs/Tabs.js
CHANGED
|
@@ -26,45 +26,34 @@ var __objRest = (source, exclude) => {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
};
|
|
29
|
-
import {
|
|
30
|
-
debounce,
|
|
31
|
-
isMini,
|
|
32
|
-
throttle,
|
|
33
|
-
useDidMountEffect
|
|
34
|
-
} from "@bifrostui/utils";
|
|
29
|
+
import { debounce, isMini, throttle, useEventCallback } from "@bifrostui/utils";
|
|
35
30
|
import clsx from "clsx";
|
|
36
|
-
import React, {
|
|
37
|
-
useEffect,
|
|
38
|
-
useLayoutEffect,
|
|
39
|
-
useMemo,
|
|
40
|
-
useRef,
|
|
41
|
-
useState
|
|
42
|
-
} from "react";
|
|
31
|
+
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
43
32
|
import Tab from "./Tab";
|
|
44
33
|
import { TabsContextProvider } from "./TabsContext";
|
|
45
|
-
import
|
|
34
|
+
import bound from "./utils/bound";
|
|
46
35
|
import "./Tabs.css";
|
|
47
36
|
const prefixCls = "bui-tabs";
|
|
48
|
-
const duration = 300;
|
|
49
37
|
const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
50
|
-
const _a = props, { children, className, value, tabs
|
|
51
|
-
const [active, setActive] = useState("");
|
|
38
|
+
const _a = props, { children, className, value, tabs = [], onChange } = _a, others = __objRest(_a, ["children", "className", "value", "tabs", "onChange"]);
|
|
52
39
|
const tabsRef = useRef(null);
|
|
53
40
|
const activeLineRef = useRef(null);
|
|
54
|
-
const [
|
|
41
|
+
const [indicatorData, setIndicatorData] = useState({
|
|
55
42
|
x: 0,
|
|
56
|
-
transitionInUse: false,
|
|
57
43
|
hasActiveTab: false
|
|
58
44
|
});
|
|
59
45
|
const [maskData, setMaskData] = useState({
|
|
60
46
|
leftMaskOpacity: 0,
|
|
61
47
|
rightMaskOpacity: 0
|
|
62
48
|
});
|
|
63
|
-
const
|
|
49
|
+
const animate = useEventCallback(() => {
|
|
64
50
|
const container = tabsRef.current;
|
|
65
51
|
if (!container)
|
|
66
|
-
return
|
|
67
|
-
const activeIndex = !!tabs.length && tabs.findIndex((item) => item.index ===
|
|
52
|
+
return;
|
|
53
|
+
const activeIndex = !!tabs.length && tabs.findIndex((item) => item.index === value);
|
|
54
|
+
const activeLine = activeLineRef.current;
|
|
55
|
+
if (!activeLine)
|
|
56
|
+
return;
|
|
68
57
|
let activeTab;
|
|
69
58
|
if (tabs.length) {
|
|
70
59
|
activeTab = activeIndex > -1 ? container.childNodes[activeIndex + 1] : void 0;
|
|
@@ -78,25 +67,6 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
78
67
|
return [...child.classList].includes("bui-tab-active");
|
|
79
68
|
});
|
|
80
69
|
}
|
|
81
|
-
return activeTab;
|
|
82
|
-
};
|
|
83
|
-
const scrollIntoView = () => {
|
|
84
|
-
const tabsContainer = tabsRef.current;
|
|
85
|
-
const activeTab = getActiveTabElement();
|
|
86
|
-
if (!tabsContainer || !activeTab) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const to = activeTab.offsetLeft - (tabsContainer.offsetWidth - activeTab.offsetWidth) / 2;
|
|
90
|
-
scrollLeftTo(tabsContainer, to, duration);
|
|
91
|
-
};
|
|
92
|
-
const animate = ({ transitionInUse }) => {
|
|
93
|
-
const container = tabsRef.current;
|
|
94
|
-
if (!container)
|
|
95
|
-
return;
|
|
96
|
-
const activeLine = activeLineRef.current;
|
|
97
|
-
if (!activeLine)
|
|
98
|
-
return;
|
|
99
|
-
const activeTab = getActiveTabElement();
|
|
100
70
|
let activeTabLeft = 0;
|
|
101
71
|
let activeTabWidth = 0;
|
|
102
72
|
let containerWidth = 0;
|
|
@@ -111,37 +81,22 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
111
81
|
activeLineWidth = activeLine.offsetWidth;
|
|
112
82
|
x = activeTabLeft + (activeTabWidth - activeLineWidth) / 2;
|
|
113
83
|
}
|
|
114
|
-
|
|
84
|
+
setIndicatorData({
|
|
115
85
|
x,
|
|
116
|
-
transitionInUse,
|
|
117
86
|
hasActiveTab: !!activeTab
|
|
118
87
|
});
|
|
119
88
|
const maxScrollDistance = containerScrollWidth - containerWidth;
|
|
120
89
|
if (maxScrollDistance <= 0 || !activeTab)
|
|
121
90
|
return;
|
|
122
|
-
|
|
123
|
-
|
|
91
|
+
const nextScrollLeft = bound(
|
|
92
|
+
activeTabLeft - (containerWidth - activeTabWidth) / 2,
|
|
93
|
+
0,
|
|
94
|
+
containerScrollWidth - containerWidth
|
|
95
|
+
);
|
|
96
|
+
if (tabsRef.current) {
|
|
97
|
+
tabsRef.current.scrollLeft = nextScrollLeft;
|
|
124
98
|
}
|
|
125
|
-
};
|
|
126
|
-
useEffect(() => {
|
|
127
|
-
setActive(value);
|
|
128
|
-
}, [value]);
|
|
129
|
-
useLayoutEffect(() => {
|
|
130
|
-
animate({ transitionInUse: false });
|
|
131
|
-
}, []);
|
|
132
|
-
useEffect(() => {
|
|
133
|
-
const handleResize = debounce(() => {
|
|
134
|
-
animate({ transitionInUse: true });
|
|
135
|
-
updateMask();
|
|
136
|
-
}, 100);
|
|
137
|
-
window.addEventListener("resize", handleResize);
|
|
138
|
-
return () => {
|
|
139
|
-
window.removeEventListener("resize", handleResize);
|
|
140
|
-
};
|
|
141
|
-
}, [active]);
|
|
142
|
-
useDidMountEffect(() => {
|
|
143
|
-
animate({ transitionInUse: true });
|
|
144
|
-
}, [active, tabs, children]);
|
|
99
|
+
});
|
|
145
100
|
const updateMask = useMemo(
|
|
146
101
|
() => throttle(
|
|
147
102
|
() => {
|
|
@@ -150,10 +105,7 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
150
105
|
return;
|
|
151
106
|
const scrollLeft = container == null ? void 0 : container.scrollLeft;
|
|
152
107
|
const showLeftMask = scrollLeft > 0;
|
|
153
|
-
const
|
|
154
|
-
container.scrollWidth - (scrollLeft + container.offsetWidth)
|
|
155
|
-
);
|
|
156
|
-
const showRightMask = rightRange > 1;
|
|
108
|
+
const showRightMask = scrollLeft + container.offsetWidth < container.scrollWidth;
|
|
157
109
|
setMaskData({
|
|
158
110
|
leftMaskOpacity: showLeftMask ? 1 : 0,
|
|
159
111
|
rightMaskOpacity: showRightMask ? 1 : 0
|
|
@@ -167,7 +119,20 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
167
119
|
),
|
|
168
120
|
[]
|
|
169
121
|
);
|
|
170
|
-
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
animate();
|
|
124
|
+
}, [value, tabs.length, React.Children.toArray(children).length]);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
const handleResize = debounce(() => {
|
|
127
|
+
animate();
|
|
128
|
+
updateMask();
|
|
129
|
+
}, 100);
|
|
130
|
+
window.addEventListener("resize", handleResize);
|
|
131
|
+
return () => {
|
|
132
|
+
window.removeEventListener("resize", handleResize);
|
|
133
|
+
};
|
|
134
|
+
}, []);
|
|
135
|
+
useEffect(() => {
|
|
171
136
|
updateMask();
|
|
172
137
|
}, []);
|
|
173
138
|
const handleClick = (e, item) => {
|
|
@@ -177,16 +142,13 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
177
142
|
if (index === void 0 || index === null) {
|
|
178
143
|
return;
|
|
179
144
|
}
|
|
180
|
-
if (active !== value) {
|
|
181
|
-
setActive(index);
|
|
182
|
-
}
|
|
183
145
|
if (index !== value) {
|
|
184
146
|
onChange == null ? void 0 : onChange(e, { index });
|
|
185
147
|
}
|
|
186
148
|
};
|
|
187
149
|
const providerValue = useMemo(() => {
|
|
188
|
-
return { value,
|
|
189
|
-
}, [value,
|
|
150
|
+
return { value, triggerChange: handleClick };
|
|
151
|
+
}, [value, children, handleClick]);
|
|
190
152
|
return /* @__PURE__ */ React.createElement("div", __spreadValues({ ref, className: clsx(prefixCls, className) }, others), /* @__PURE__ */ React.createElement(
|
|
191
153
|
"div",
|
|
192
154
|
{
|
|
@@ -207,12 +169,12 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
207
169
|
"div",
|
|
208
170
|
{
|
|
209
171
|
ref: activeLineRef,
|
|
210
|
-
className: clsx(`${prefixCls}-
|
|
211
|
-
"bui-
|
|
172
|
+
className: clsx(`${prefixCls}-indicator`, {
|
|
173
|
+
"bui-indicator-invisible": isMini || !indicatorData.hasActiveTab
|
|
212
174
|
}),
|
|
213
175
|
style: {
|
|
214
|
-
transition:
|
|
215
|
-
transform: `translate3d(${
|
|
176
|
+
transition: "transform 0.3s ease-in-out",
|
|
177
|
+
transform: `translate3d(${indicatorData.x}px, 0px, 0px)`
|
|
216
178
|
}
|
|
217
179
|
}
|
|
218
180
|
), /* @__PURE__ */ React.createElement(TabsContextProvider, { value: providerValue }, !!tabs.length && tabs.map((item) => {
|
|
@@ -228,10 +190,6 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
228
190
|
}), children)));
|
|
229
191
|
});
|
|
230
192
|
Tabs.displayName = "BuiTabs";
|
|
231
|
-
Tabs.defaultProps = {
|
|
232
|
-
align: "center",
|
|
233
|
-
tabs: []
|
|
234
|
-
};
|
|
235
193
|
var Tabs_default = Tabs;
|
|
236
194
|
export {
|
|
237
195
|
Tabs_default as default
|
package/es/Tabs/Tabs.types.d.ts
CHANGED
|
@@ -3,9 +3,6 @@ import React, { SyntheticEvent } from 'react';
|
|
|
3
3
|
export interface TabHeaderItem {
|
|
4
4
|
title: React.ReactNode;
|
|
5
5
|
index: string;
|
|
6
|
-
/**
|
|
7
|
-
* 是否禁止点击
|
|
8
|
-
*/
|
|
9
6
|
disabled?: boolean;
|
|
10
7
|
}
|
|
11
8
|
export interface ITabsChangeData {
|
|
@@ -14,11 +11,8 @@ export interface ITabsChangeData {
|
|
|
14
11
|
}
|
|
15
12
|
export type TabChangeEvent = (e?: SyntheticEvent, data?: ITabsChangeData) => void;
|
|
16
13
|
export interface ITabItem {
|
|
17
|
-
/** 面板标题 */
|
|
18
14
|
title: React.ReactNode;
|
|
19
|
-
/** 面板的索引值 */
|
|
20
15
|
index: string;
|
|
21
|
-
/** 面板是否禁用 */
|
|
22
16
|
disabled?: boolean;
|
|
23
17
|
}
|
|
24
18
|
export type ITabAlign = 'start' | 'center';
|
|
@@ -32,10 +26,6 @@ export type TabsProps<D extends React.ElementType = 'div', P = {}> = OverridePro
|
|
|
32
26
|
* 切换面板的数据
|
|
33
27
|
*/
|
|
34
28
|
tabs?: ITabItem[];
|
|
35
|
-
/**
|
|
36
|
-
* 对齐方式,默认为center
|
|
37
|
-
*/
|
|
38
|
-
align?: ITabAlign;
|
|
39
29
|
/**
|
|
40
30
|
* 切换面板的回调
|
|
41
31
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function bound(position: number, min: number | undefined, max: number | undefined): number;
|
package/es/Tag/Tag.css
CHANGED
package/es/Tag/Tag.js
CHANGED
|
@@ -47,9 +47,9 @@ const Tag = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
47
47
|
const _a = props, {
|
|
48
48
|
className,
|
|
49
49
|
style,
|
|
50
|
-
color,
|
|
50
|
+
color = "default",
|
|
51
51
|
htmlColor,
|
|
52
|
-
variant,
|
|
52
|
+
variant = "outlined",
|
|
53
53
|
onClick,
|
|
54
54
|
children
|
|
55
55
|
} = _a, others = __objRest(_a, [
|
|
@@ -98,10 +98,6 @@ const Tag = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
98
98
|
);
|
|
99
99
|
});
|
|
100
100
|
Tag.displayName = "BuiTag";
|
|
101
|
-
Tag.defaultProps = {
|
|
102
|
-
variant: "outlined",
|
|
103
|
-
color: "default"
|
|
104
|
-
};
|
|
105
101
|
var Tag_default = Tag;
|
|
106
102
|
export {
|
|
107
103
|
Tag_default as default
|
package/es/TextArea/TextArea.js
CHANGED
|
@@ -40,17 +40,17 @@ const TextArea = /* @__PURE__ */ React.forwardRef(
|
|
|
40
40
|
const _a = props, {
|
|
41
41
|
className,
|
|
42
42
|
value,
|
|
43
|
-
defaultValue,
|
|
43
|
+
defaultValue = "",
|
|
44
44
|
textareaProps,
|
|
45
45
|
textareaRef,
|
|
46
46
|
name,
|
|
47
47
|
placeholder,
|
|
48
48
|
disabled,
|
|
49
|
-
rows,
|
|
49
|
+
rows = DEFAULT_ROWS,
|
|
50
50
|
maxLength,
|
|
51
|
-
autoSize,
|
|
52
|
-
autoFocus,
|
|
53
|
-
showCount,
|
|
51
|
+
autoSize = false,
|
|
52
|
+
autoFocus = false,
|
|
53
|
+
showCount = false,
|
|
54
54
|
onChange
|
|
55
55
|
} = _a, others = __objRest(_a, [
|
|
56
56
|
"className",
|
|
@@ -175,13 +175,6 @@ const TextArea = /* @__PURE__ */ React.forwardRef(
|
|
|
175
175
|
}
|
|
176
176
|
);
|
|
177
177
|
TextArea.displayName = "BuiTextArea";
|
|
178
|
-
TextArea.defaultProps = {
|
|
179
|
-
defaultValue: "",
|
|
180
|
-
rows: DEFAULT_ROWS,
|
|
181
|
-
autoSize: false,
|
|
182
|
-
autoFocus: false,
|
|
183
|
-
showCount: false
|
|
184
|
-
};
|
|
185
178
|
var TextArea_default = TextArea;
|
|
186
179
|
export {
|
|
187
180
|
TextArea_default as default
|
|
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { render, unmount,
|
|
32
|
+
import { render, unmount, getRootElement } from "@bifrostui/utils";
|
|
33
33
|
import React, { useCallback, useEffect, useState } from "react";
|
|
34
34
|
import ToastView from "./Toast";
|
|
35
35
|
let toastCloses = [];
|
|
@@ -70,7 +70,7 @@ const functionalToast = (props) => {
|
|
|
70
70
|
rootWrapper.style[property] = styles[property];
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
const rootElement =
|
|
73
|
+
const rootElement = getRootElement();
|
|
74
74
|
rootElement.appendChild(rootWrapper);
|
|
75
75
|
const ToastComponent = () => {
|
|
76
76
|
const _a = options, { duration, allowMultiple, onClose } = _a, others = __objRest(_a, ["duration", "allowMultiple", "onClose"]);
|