@bifrostui/react 1.3.1-beta.1 → 1.3.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/ActionSheet.css +3 -6
- package/dist/ActionSheet/ActionSheetItem.css +6 -10
- package/dist/Alert/index.css +8 -14
- package/dist/Avatar/Avatar.css +9 -13
- package/dist/Avatar/AvatarGroup.css +8 -15
- package/dist/Backdrop/Backdrop.css +1 -2
- package/dist/Badge/Badge.css +17 -27
- package/dist/Button/Button.css +17 -26
- package/dist/Calendar/Calendar.css +18 -33
- package/dist/Calendar/Calendar.d.ts +1 -1
- package/dist/Calendar/Calendar.js +17 -38
- package/dist/Calendar/Calendar.types.d.ts +0 -21
- package/dist/Card/CardFooter.css +1 -2
- package/dist/Card/CardHeader.css +1 -3
- package/dist/Checkbox/Checkbox.css +5 -7
- package/dist/CitySelector/CitySelector.css +15 -29
- package/dist/CitySelector/CitySelectorCore.js +16 -25
- package/dist/CitySelector/Selector/index.css +4 -4
- package/dist/Countdown/Countdown.css +1 -2
- package/dist/Dialog/Dialog.d.ts +2 -2
- package/dist/Dialog/Dialog.js +8 -20
- package/dist/Dialog/Dialog.types.d.ts +1 -12
- package/dist/Dialog/FunctionalDialog.js +2 -38
- package/dist/Dialog/index.css +18 -27
- package/dist/Divider/Divider.css +4 -6
- package/dist/IconButton/IconButton.css +7 -9
- package/dist/Image/index.css +1 -2
- package/dist/Input/Input.css +5 -10
- package/dist/List/List.css +0 -3
- package/dist/List/ListItem.css +3 -3
- package/dist/List/ListItemContent.css +1 -1
- package/dist/Loading/Loading.css +2 -4
- package/dist/Modal/Modal.miniapp.d.ts +1 -1
- package/dist/NavBar/NavBar.css +5 -9
- package/dist/Picker/Picker.css +29 -25
- package/dist/Picker/Picker.js +11 -31
- package/dist/Picker/Picker.types.d.ts +0 -4
- package/dist/Picker/PickerPanel.css +8 -8
- package/dist/Picker/PickerPanel.js +8 -14
- package/dist/Picker/utils.d.ts +0 -16
- package/dist/Picker/utils.js +2 -32
- package/dist/Portal/Portal.types.d.ts +0 -4
- package/dist/Portal/PortalCore.js +1 -8
- package/dist/Progress/Progress.css +6 -8
- package/dist/Radio/Radio.css +1 -2
- package/dist/Rating/Rating.css +4 -8
- package/dist/Select/Select.css +10 -21
- package/dist/Select/Select.js +1 -1
- package/dist/Select/SelectOption.js +0 -3
- package/dist/Skeleton/Skeleton.css +2 -3
- package/dist/Slider/Slider.css +13 -24
- package/dist/Steps/Step.css +11 -11
- package/dist/Steps/Steps.css +5 -14
- package/dist/Swiper/Swiper.css +1 -2
- package/dist/Switch/Switch.css +16 -31
- package/dist/TabBar/TabBar.css +3 -7
- package/dist/TabBar/TabBarItem.css +1 -0
- package/dist/Tabs/Tab.css +6 -2
- package/dist/Tabs/Tabs.css +4 -7
- package/dist/Tag/Tag.css +10 -7
- package/dist/Tag/TagGroup.css +1 -9
- package/dist/TextArea/TextArea.css +8 -14
- package/dist/Toast/FunctionalToast.js +0 -18
- package/dist/Toast/Toast.css +14 -15
- package/dist/Toast/Toast.d.ts +2 -2
- package/dist/Toast/Toast.js +48 -52
- package/dist/Toast/Toast.types.d.ts +1 -15
- package/dist/index.d.ts +0 -7
- package/dist/index.js +1 -15
- package/es/ActionSheet/ActionSheet.css +3 -6
- package/es/ActionSheet/ActionSheetItem.css +6 -10
- package/es/Alert/index.css +8 -14
- package/es/Avatar/Avatar.css +9 -13
- package/es/Avatar/AvatarGroup.css +8 -15
- package/es/Backdrop/Backdrop.css +1 -2
- package/es/Badge/Badge.css +17 -27
- package/es/Button/Button.css +17 -26
- package/es/Calendar/Calendar.css +18 -33
- package/es/Calendar/Calendar.d.ts +1 -1
- package/es/Calendar/Calendar.js +17 -38
- package/es/Calendar/Calendar.types.d.ts +0 -21
- package/es/Card/CardFooter.css +1 -2
- package/es/Card/CardHeader.css +1 -3
- package/es/Checkbox/Checkbox.css +5 -7
- package/es/CitySelector/CitySelector.css +15 -29
- package/es/CitySelector/CitySelectorCore.js +16 -25
- package/es/CitySelector/Selector/index.css +4 -4
- package/es/Countdown/Countdown.css +1 -2
- package/es/Dialog/Dialog.d.ts +2 -2
- package/es/Dialog/Dialog.js +8 -20
- package/es/Dialog/Dialog.types.d.ts +1 -12
- package/es/Dialog/FunctionalDialog.js +2 -38
- package/es/Dialog/index.css +18 -27
- package/es/Divider/Divider.css +4 -6
- package/es/IconButton/IconButton.css +7 -9
- package/es/Image/index.css +1 -2
- package/es/Input/Input.css +5 -10
- package/es/List/List.css +0 -3
- package/es/List/ListItem.css +3 -3
- package/es/List/ListItemContent.css +1 -1
- package/es/Loading/Loading.css +2 -4
- package/es/Modal/Modal.miniapp.d.ts +1 -1
- package/es/NavBar/NavBar.css +5 -9
- package/es/Picker/Picker.css +29 -25
- package/es/Picker/Picker.js +12 -32
- package/es/Picker/Picker.types.d.ts +0 -4
- package/es/Picker/PickerPanel.css +8 -8
- package/es/Picker/PickerPanel.js +8 -14
- package/es/Picker/utils.d.ts +0 -16
- package/es/Picker/utils.js +1 -29
- package/es/Portal/Portal.types.d.ts +0 -4
- package/es/Portal/PortalCore.js +1 -8
- package/es/Progress/Progress.css +6 -8
- package/es/Radio/Radio.css +1 -2
- package/es/Rating/Rating.css +4 -8
- package/es/Select/Select.css +10 -21
- package/es/Select/Select.js +1 -1
- package/es/Select/SelectOption.js +0 -3
- package/es/Skeleton/Skeleton.css +2 -3
- package/es/Slider/Slider.css +13 -24
- package/es/Steps/Step.css +11 -11
- package/es/Steps/Steps.css +5 -14
- package/es/Swiper/Swiper.css +1 -2
- package/es/Switch/Switch.css +16 -31
- package/es/TabBar/TabBar.css +3 -7
- package/es/TabBar/TabBarItem.css +1 -0
- package/es/Tabs/Tab.css +6 -2
- package/es/Tabs/Tabs.css +4 -7
- package/es/Tag/Tag.css +10 -7
- package/es/Tag/TagGroup.css +1 -9
- package/es/TextArea/TextArea.css +8 -14
- package/es/Toast/FunctionalToast.js +0 -18
- package/es/Toast/Toast.css +14 -15
- package/es/Toast/Toast.d.ts +2 -2
- package/es/Toast/Toast.js +49 -53
- package/es/Toast/Toast.types.d.ts +1 -15
- package/es/index.d.ts +0 -7
- package/es/index.js +0 -7
- package/package.json +5 -5
- package/dist/Breadcrumb/Breadcrumb.css +0 -34
- package/dist/Breadcrumb/Breadcrumb.d.ts +0 -5
- package/dist/Breadcrumb/Breadcrumb.js +0 -128
- package/dist/Breadcrumb/Breadcrumb.types.d.ts +0 -49
- package/dist/Breadcrumb/Breadcrumb.types.js +0 -15
- package/dist/Breadcrumb/BreadcrumbItem.d.ts +0 -4
- package/dist/Breadcrumb/BreadcrumbItem.js +0 -78
- package/dist/Breadcrumb/index.d.ts +0 -4
- package/dist/Breadcrumb/index.js +0 -45
- package/dist/Collapse/Collapse.css +0 -6
- package/dist/Collapse/Collapse.d.ts +0 -5
- package/dist/Collapse/Collapse.js +0 -165
- package/dist/Collapse/Collapse.types.d.ts +0 -16
- package/dist/Collapse/Collapse.types.js +0 -15
- package/dist/Collapse/index.d.ts +0 -2
- package/dist/Collapse/index.js +0 -41
- package/dist/CollapsePanel/CollapsePanel.css +0 -32
- package/dist/CollapsePanel/CollapsePanel.d.ts +0 -5
- package/dist/CollapsePanel/CollapsePanel.js +0 -159
- package/dist/CollapsePanel/CollapsePanel.types.d.ts +0 -64
- package/dist/CollapsePanel/CollapsePanel.types.js +0 -15
- package/dist/CollapsePanel/CollapsePanelItem.d.ts +0 -4
- package/dist/CollapsePanel/CollapsePanelItem.js +0 -112
- package/dist/CollapsePanel/index.d.ts +0 -4
- package/dist/CollapsePanel/index.js +0 -45
- package/dist/Popover/Popover.css +0 -97
- package/dist/Popover/Popover.d.ts +0 -5
- package/dist/Popover/Popover.js +0 -186
- package/dist/Popover/Popover.types.d.ts +0 -59
- package/dist/Popover/Popover.types.js +0 -15
- package/dist/Popover/index.d.ts +0 -2
- package/dist/Popover/index.js +0 -41
- package/dist/ThemeProvider/ThemeProvider.d.ts +0 -4
- package/dist/ThemeProvider/ThemeProvider.js +0 -91
- package/dist/ThemeProvider/ThemeProvider.types.d.ts +0 -127
- package/dist/ThemeProvider/ThemeProvider.types.js +0 -27
- package/dist/ThemeProvider/hooks/ThemeContext.d.ts +0 -4
- package/dist/ThemeProvider/hooks/ThemeContext.js +0 -35
- package/dist/ThemeProvider/hooks/createTheme.d.ts +0 -2
- package/dist/ThemeProvider/hooks/createTheme.js +0 -55
- package/dist/ThemeProvider/hooks/index.d.ts +0 -4
- package/dist/ThemeProvider/hooks/index.js +0 -43
- package/dist/ThemeProvider/hooks/useTheme.d.ts +0 -1
- package/dist/ThemeProvider/hooks/useTheme.js +0 -39
- package/dist/ThemeProvider/index.d.ts +0 -4
- package/dist/ThemeProvider/index.js +0 -45
- package/dist/ThemeProvider/utils/constants.d.ts +0 -38
- package/dist/ThemeProvider/utils/constants.js +0 -65
- package/dist/ThemeProvider/utils/index.d.ts +0 -2
- package/dist/ThemeProvider/utils/index.js +0 -23
- package/dist/ThemeProvider/utils/mountTokens.d.ts +0 -26
- package/dist/ThemeProvider/utils/mountTokens.js +0 -123
- package/dist/Tooltip/Tooltip.css +0 -91
- package/dist/Tooltip/Tooltip.d.ts +0 -5
- package/dist/Tooltip/Tooltip.js +0 -175
- package/dist/Tooltip/Tooltip.types.d.ts +0 -50
- package/dist/Tooltip/Tooltip.types.js +0 -15
- package/dist/Tooltip/index.d.ts +0 -2
- package/dist/Tooltip/index.js +0 -41
- package/dist/locales/base.d.ts +0 -40
- package/dist/locales/base.js +0 -15
- package/dist/locales/en-US.d.ts +0 -3
- package/dist/locales/en-US.js +0 -69
- package/dist/locales/hooks/useLocaleText.d.ts +0 -3
- package/dist/locales/hooks/useLocaleText.js +0 -43
- package/dist/locales/index.d.ts +0 -5
- package/dist/locales/index.js +0 -49
- package/dist/locales/zh-CN.d.ts +0 -3
- package/dist/locales/zh-CN.js +0 -51
- package/dist/locales/zh-TW.d.ts +0 -3
- package/dist/locales/zh-TW.js +0 -51
- package/es/Breadcrumb/Breadcrumb.css +0 -34
- package/es/Breadcrumb/Breadcrumb.d.ts +0 -5
- package/es/Breadcrumb/Breadcrumb.js +0 -101
- package/es/Breadcrumb/Breadcrumb.types.d.ts +0 -49
- package/es/Breadcrumb/Breadcrumb.types.js +0 -1
- package/es/Breadcrumb/BreadcrumbItem.d.ts +0 -4
- package/es/Breadcrumb/BreadcrumbItem.js +0 -51
- package/es/Breadcrumb/index.d.ts +0 -4
- package/es/Breadcrumb/index.js +0 -9
- package/es/Collapse/Collapse.css +0 -6
- package/es/Collapse/Collapse.d.ts +0 -5
- package/es/Collapse/Collapse.js +0 -144
- package/es/Collapse/Collapse.types.d.ts +0 -16
- package/es/Collapse/Collapse.types.js +0 -1
- package/es/Collapse/index.d.ts +0 -2
- package/es/Collapse/index.js +0 -6
- package/es/CollapsePanel/CollapsePanel.css +0 -32
- package/es/CollapsePanel/CollapsePanel.d.ts +0 -5
- package/es/CollapsePanel/CollapsePanel.js +0 -132
- package/es/CollapsePanel/CollapsePanel.types.d.ts +0 -64
- package/es/CollapsePanel/CollapsePanel.types.js +0 -1
- package/es/CollapsePanel/CollapsePanelItem.d.ts +0 -4
- package/es/CollapsePanel/CollapsePanelItem.js +0 -85
- package/es/CollapsePanel/index.d.ts +0 -4
- package/es/CollapsePanel/index.js +0 -9
- package/es/Popover/Popover.css +0 -97
- package/es/Popover/Popover.d.ts +0 -5
- package/es/Popover/Popover.js +0 -163
- package/es/Popover/Popover.types.d.ts +0 -59
- package/es/Popover/Popover.types.js +0 -1
- package/es/Popover/index.d.ts +0 -2
- package/es/Popover/index.js +0 -6
- package/es/ThemeProvider/ThemeProvider.d.ts +0 -4
- package/es/ThemeProvider/ThemeProvider.js +0 -62
- package/es/ThemeProvider/ThemeProvider.types.d.ts +0 -127
- package/es/ThemeProvider/ThemeProvider.types.js +0 -1
- package/es/ThemeProvider/hooks/ThemeContext.d.ts +0 -4
- package/es/ThemeProvider/hooks/ThemeContext.js +0 -6
- package/es/ThemeProvider/hooks/createTheme.d.ts +0 -2
- package/es/ThemeProvider/hooks/createTheme.js +0 -38
- package/es/ThemeProvider/hooks/index.d.ts +0 -4
- package/es/ThemeProvider/hooks/index.js +0 -8
- package/es/ThemeProvider/hooks/useTheme.d.ts +0 -1
- package/es/ThemeProvider/hooks/useTheme.js +0 -10
- package/es/ThemeProvider/index.d.ts +0 -4
- package/es/ThemeProvider/index.js +0 -8
- package/es/ThemeProvider/utils/constants.d.ts +0 -38
- package/es/ThemeProvider/utils/constants.js +0 -40
- package/es/ThemeProvider/utils/index.d.ts +0 -2
- package/es/ThemeProvider/utils/index.js +0 -2
- package/es/ThemeProvider/utils/mountTokens.d.ts +0 -26
- package/es/ThemeProvider/utils/mountTokens.js +0 -88
- package/es/Tooltip/Tooltip.css +0 -91
- package/es/Tooltip/Tooltip.d.ts +0 -5
- package/es/Tooltip/Tooltip.js +0 -152
- package/es/Tooltip/Tooltip.types.d.ts +0 -50
- package/es/Tooltip/Tooltip.types.js +0 -1
- package/es/Tooltip/index.d.ts +0 -2
- package/es/Tooltip/index.js +0 -6
- package/es/locales/base.d.ts +0 -40
- package/es/locales/base.js +0 -0
- package/es/locales/en-US.d.ts +0 -3
- package/es/locales/en-US.js +0 -50
- package/es/locales/hooks/useLocaleText.d.ts +0 -3
- package/es/locales/hooks/useLocaleText.js +0 -26
- package/es/locales/index.d.ts +0 -5
- package/es/locales/index.js +0 -11
- package/es/locales/zh-CN.d.ts +0 -3
- package/es/locales/zh-CN.js +0 -32
- package/es/locales/zh-TW.d.ts +0 -3
- package/es/locales/zh-TW.js +0 -32
package/es/Calendar/Calendar.css
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
.bui-calendar {
|
|
2
|
-
--padding: var(--bui-calendar-padding, 6px 12px 7px);
|
|
3
|
-
--week-height: var(--bui-calendar-week-height, 30px);
|
|
4
|
-
--handler-height: var(--bui-calendar-handler-height, 28px);
|
|
5
|
-
--handler-margin-bottom: var(--bui-calendar-handler-margin-bottom, 7px);
|
|
6
|
-
--handler-text-width: var(--bui-calendar-handler-text-width, 80px);
|
|
7
|
-
--handler-btn-width: var(--bui-calendar-handler-btn-width, 46px);
|
|
8
|
-
--handler-btn-height: var(--bui-calendar-handler-btn-height, 100%);
|
|
9
|
-
--handler-btn-icon-font-size: var(--bui-calendar-handler-btn-icon-font-size, 28px);
|
|
10
|
-
--day-box-height: var(--bui-calendar-day-box-height, 30px);
|
|
11
|
-
--day-box-margin-bottom: var(--bui-calendar-day-box-margin-bottom, 7px);
|
|
12
|
-
--day-disabled-color: var(--bui-calendar-day-disabled-color, #9c9ca5);
|
|
13
|
-
--middle-color: var(--bui-calendar-middle-color, #000);
|
|
14
|
-
--middle-background-color: var(--bui-calendar-middle-background-color, #ffeaf1);
|
|
15
|
-
--range-both-ends-color: var(--bui-calendar-range-both-ends-color, #000);
|
|
16
|
-
--range-both-ends-background-color: var(--bui-calendar-range-both-ends-background-color, #ffc7da);
|
|
17
2
|
overflow: hidden;
|
|
18
3
|
display: flex;
|
|
19
4
|
flex-direction: column;
|
|
@@ -21,11 +6,11 @@
|
|
|
21
6
|
position: relative;
|
|
22
7
|
width: 100%;
|
|
23
8
|
box-sizing: border-box;
|
|
24
|
-
padding:
|
|
9
|
+
padding: 6px 12px 7px;
|
|
25
10
|
font-family: var(--bui-font-family);
|
|
26
11
|
}
|
|
27
12
|
.bui-calendar-week {
|
|
28
|
-
height:
|
|
13
|
+
height: 30px;
|
|
29
14
|
font-size: var(--bui-text-size-2);
|
|
30
15
|
font-weight: var(--bui-font-weight-medium);
|
|
31
16
|
color: var(--bui-color-fg-default);
|
|
@@ -44,29 +29,29 @@
|
|
|
44
29
|
color: var(--bui-color-primary);
|
|
45
30
|
}
|
|
46
31
|
.bui-calendar-handler {
|
|
47
|
-
height:
|
|
32
|
+
height: 28px;
|
|
48
33
|
display: flex;
|
|
49
34
|
align-items: center;
|
|
50
35
|
justify-content: center;
|
|
51
|
-
margin-bottom:
|
|
36
|
+
margin-bottom: 7px;
|
|
52
37
|
}
|
|
53
38
|
.bui-calendar-handler-text {
|
|
54
|
-
width:
|
|
39
|
+
width: 80px;
|
|
55
40
|
font-size: var(--bui-title-size-3);
|
|
56
41
|
font-weight: var(--bui-font-weight-medium);
|
|
57
42
|
text-align: center;
|
|
58
43
|
}
|
|
59
44
|
.bui-calendar-handler-btn {
|
|
60
45
|
font-size: 16px;
|
|
61
|
-
height:
|
|
62
|
-
width:
|
|
46
|
+
height: 100%;
|
|
47
|
+
width: 46px;
|
|
63
48
|
cursor: pointer;
|
|
64
49
|
display: flex;
|
|
65
50
|
align-items: center;
|
|
66
51
|
justify-content: center;
|
|
67
52
|
}
|
|
68
53
|
.bui-calendar-handler-btn-icon {
|
|
69
|
-
font-size:
|
|
54
|
+
font-size: 28px;
|
|
70
55
|
}
|
|
71
56
|
.bui-calendar-month {
|
|
72
57
|
display: flex;
|
|
@@ -75,8 +60,8 @@
|
|
|
75
60
|
}
|
|
76
61
|
.bui-calendar-day-box {
|
|
77
62
|
width: 14.28%;
|
|
78
|
-
height:
|
|
79
|
-
margin-bottom:
|
|
63
|
+
height: 30px;
|
|
64
|
+
margin-bottom: 7px;
|
|
80
65
|
}
|
|
81
66
|
.bui-calendar-highlight-day .bui-calendar-day {
|
|
82
67
|
color: var(--bui-color-primary);
|
|
@@ -87,34 +72,34 @@
|
|
|
87
72
|
display: flex;
|
|
88
73
|
align-items: center;
|
|
89
74
|
justify-content: center;
|
|
90
|
-
border-radius:
|
|
75
|
+
border-radius: 6px;
|
|
91
76
|
font-size: var(--bui-title-size-4);
|
|
92
77
|
font-weight: var(--bui-font-weight-medium);
|
|
93
78
|
color: var(--bui-color-fg-default);
|
|
94
79
|
cursor: pointer;
|
|
95
80
|
}
|
|
96
81
|
.bui-calendar-day.bui-calendar-disabled {
|
|
97
|
-
color:
|
|
82
|
+
color: #9c9ca5;
|
|
98
83
|
}
|
|
99
84
|
.bui-calendar-today {
|
|
100
85
|
color: var(--bui-color-primary);
|
|
101
86
|
}
|
|
102
87
|
.bui-calendar-middle {
|
|
103
|
-
color:
|
|
88
|
+
color: #000;
|
|
104
89
|
border-radius: 0;
|
|
105
|
-
background-color:
|
|
90
|
+
background-color: #ffeaf1;
|
|
106
91
|
}
|
|
107
92
|
.bui-calendar-start {
|
|
108
|
-
color:
|
|
109
|
-
background-color:
|
|
93
|
+
color: #000;
|
|
94
|
+
background-color: #ffc7da;
|
|
110
95
|
}
|
|
111
96
|
.bui-calendar-range {
|
|
112
97
|
border-top-right-radius: 0;
|
|
113
98
|
border-bottom-right-radius: 0;
|
|
114
99
|
}
|
|
115
100
|
.bui-calendar-end {
|
|
116
|
-
color:
|
|
117
|
-
background-color:
|
|
101
|
+
color: #000;
|
|
102
|
+
background-color: #ffc7da;
|
|
118
103
|
border-top-left-radius: 0;
|
|
119
104
|
border-bottom-left-radius: 0;
|
|
120
105
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CalendarProps } from './Calendar.types';
|
|
3
2
|
import './Calendar.less';
|
|
3
|
+
import { CalendarProps } from './Calendar.types';
|
|
4
4
|
declare const Calendar: React.ForwardRefExoticComponent<Omit<CalendarProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default Calendar;
|
package/es/Calendar/Calendar.js
CHANGED
|
@@ -40,11 +40,11 @@ import React, {
|
|
|
40
40
|
useMemo,
|
|
41
41
|
useState
|
|
42
42
|
} from "react";
|
|
43
|
-
import { formatDate, isRange, isSame } from "./utils";
|
|
44
|
-
import { useLocaleText } from "../locales";
|
|
45
43
|
import "./Calendar.css";
|
|
44
|
+
import { formatDate, isRange, isSame } from "./utils";
|
|
46
45
|
const Picker = lazy(() => import("../Picker"));
|
|
47
46
|
dayjs.extend(isoWeek);
|
|
47
|
+
const SUNDAY_WEEK_DATA = ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
48
48
|
const classes = {
|
|
49
49
|
root: "bui-calendar",
|
|
50
50
|
handler: "bui-calendar-handler",
|
|
@@ -62,9 +62,6 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
62
62
|
maxDate,
|
|
63
63
|
mode,
|
|
64
64
|
hideDaysOutsideCurrentMonth,
|
|
65
|
-
headerBarFormat,
|
|
66
|
-
headerBarLeftIcon,
|
|
67
|
-
headerBarRightIcon,
|
|
68
65
|
disabledDate,
|
|
69
66
|
enableSelectYear,
|
|
70
67
|
highlightDate,
|
|
@@ -81,9 +78,6 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
81
78
|
"maxDate",
|
|
82
79
|
"mode",
|
|
83
80
|
"hideDaysOutsideCurrentMonth",
|
|
84
|
-
"headerBarFormat",
|
|
85
|
-
"headerBarLeftIcon",
|
|
86
|
-
"headerBarRightIcon",
|
|
87
81
|
"disabledDate",
|
|
88
82
|
"enableSelectYear",
|
|
89
83
|
"highlightDate",
|
|
@@ -93,16 +87,6 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
93
87
|
"onYearChange",
|
|
94
88
|
"onChange"
|
|
95
89
|
]);
|
|
96
|
-
const { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } = useLocaleText("calendar");
|
|
97
|
-
const SUNDAY_WEEK_DATA = [
|
|
98
|
-
Sunday,
|
|
99
|
-
Monday,
|
|
100
|
-
Tuesday,
|
|
101
|
-
Wednesday,
|
|
102
|
-
Thursday,
|
|
103
|
-
Friday,
|
|
104
|
-
Saturday
|
|
105
|
-
];
|
|
106
90
|
const isRangeMode = mode === "range";
|
|
107
91
|
const formattedValue = formatDate(mode, value, minDate, maxDate);
|
|
108
92
|
const formattedDefaultValue = formatDate(
|
|
@@ -129,22 +113,6 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
129
113
|
}, [calendarValue]);
|
|
130
114
|
const isMinMonth = dayjs(minDate).isSame(renderMonth, "month");
|
|
131
115
|
const isMaxMonth = dayjs(maxDate).isSame(renderMonth, "month");
|
|
132
|
-
const headerBarIcon = {
|
|
133
|
-
left: headerBarLeftIcon ? headerBarLeftIcon({ isMinMonth }) : /* @__PURE__ */ React.createElement(
|
|
134
|
-
CaretLeftIcon,
|
|
135
|
-
{
|
|
136
|
-
className: `${classes.handler}-btn-icon`,
|
|
137
|
-
htmlColor: isMinMonth && "#cccccc"
|
|
138
|
-
}
|
|
139
|
-
),
|
|
140
|
-
right: headerBarRightIcon ? headerBarRightIcon({ isMaxMonth }) : /* @__PURE__ */ React.createElement(
|
|
141
|
-
CaretRightIcon,
|
|
142
|
-
{
|
|
143
|
-
className: `${classes.handler}-btn-icon`,
|
|
144
|
-
htmlColor: isMaxMonth && "#cccccc"
|
|
145
|
-
}
|
|
146
|
-
)
|
|
147
|
-
};
|
|
148
116
|
useDidMountEffect(() => {
|
|
149
117
|
const initMonth = formattedValue === void 0 ? formattedDefaultValue == null ? void 0 : formattedDefaultValue[0] : formattedValue == null ? void 0 : formattedValue[0];
|
|
150
118
|
setRenderMonth(dayjs(initMonth || minDate).toDate());
|
|
@@ -281,7 +249,7 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
281
249
|
setRenderMonth(month);
|
|
282
250
|
onMonthChange == null ? void 0 : onMonthChange(e, {
|
|
283
251
|
type: "prev",
|
|
284
|
-
month: dayjs(month).format(
|
|
252
|
+
month: dayjs(month).format("YYYY/MM")
|
|
285
253
|
});
|
|
286
254
|
}
|
|
287
255
|
};
|
|
@@ -291,7 +259,7 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
291
259
|
setRenderMonth(month);
|
|
292
260
|
onMonthChange == null ? void 0 : onMonthChange(e, {
|
|
293
261
|
type: "next",
|
|
294
|
-
month: dayjs(month).format(
|
|
262
|
+
month: dayjs(month).format("YYYY/MM")
|
|
295
263
|
});
|
|
296
264
|
}
|
|
297
265
|
};
|
|
@@ -333,7 +301,19 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
333
301
|
}, others), {
|
|
334
302
|
"data-mode": mode
|
|
335
303
|
}), data),
|
|
336
|
-
/* @__PURE__ */ React.createElement("div", { className: classes.handler }, /* @__PURE__ */ React.createElement("div", { onClick: onClickPrev, className: `${classes.handler}-btn` },
|
|
304
|
+
/* @__PURE__ */ React.createElement("div", { className: classes.handler }, /* @__PURE__ */ React.createElement("div", { onClick: onClickPrev, className: `${classes.handler}-btn` }, /* @__PURE__ */ React.createElement(
|
|
305
|
+
CaretLeftIcon,
|
|
306
|
+
{
|
|
307
|
+
className: `${classes.handler}-btn-icon`,
|
|
308
|
+
htmlColor: isMinMonth && "#cccccc"
|
|
309
|
+
}
|
|
310
|
+
)), /* @__PURE__ */ React.createElement("div", { className: `${classes.handler}-text`, onClick: onClickDate }, dayjs(renderMonth).format("YYYY/MM")), /* @__PURE__ */ React.createElement("div", { onClick: onClickNext, className: `${classes.handler}-btn` }, /* @__PURE__ */ React.createElement(
|
|
311
|
+
CaretRightIcon,
|
|
312
|
+
{
|
|
313
|
+
className: `${classes.handler}-btn-icon`,
|
|
314
|
+
htmlColor: isMaxMonth && "#cccccc"
|
|
315
|
+
}
|
|
316
|
+
))),
|
|
337
317
|
/* @__PURE__ */ React.createElement("div", { className: classes.week }, SUNDAY_WEEK_DATA == null ? void 0 : SUNDAY_WEEK_DATA.map((w) => {
|
|
338
318
|
return weekRender ? weekRender(w) : /* @__PURE__ */ React.createElement("div", { key: w, className: `${classes.week}-item` }, w);
|
|
339
319
|
})),
|
|
@@ -353,7 +333,6 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
353
333
|
Calendar.displayName = "BuiCalendar";
|
|
354
334
|
Calendar.defaultProps = {
|
|
355
335
|
hideDaysOutsideCurrentMonth: false,
|
|
356
|
-
headerBarFormat: "YYYY/MM",
|
|
357
336
|
enableSelectYear: false,
|
|
358
337
|
mode: "single",
|
|
359
338
|
minDate: dayjs(dayjs().format("YYYYMMDD")).add(0, "month").toDate(),
|
|
@@ -16,12 +16,6 @@ export interface ICalendarYearChangeData {
|
|
|
16
16
|
/** 切换后的年份 */
|
|
17
17
|
year: number;
|
|
18
18
|
}
|
|
19
|
-
export interface ICustomIconProps {
|
|
20
|
-
/** 是否为可选范围内的最小月份 */
|
|
21
|
-
isMinMonth?: boolean;
|
|
22
|
-
/** 是否为可选范围内的最大月份 */
|
|
23
|
-
isMaxMonth?: boolean;
|
|
24
|
-
}
|
|
25
19
|
export type ICalendarMode = 'single' | 'range';
|
|
26
20
|
export type ICalendarValue = Date | Date[] | null;
|
|
27
21
|
export type CalendarProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
@@ -53,21 +47,6 @@ export type CalendarProps<D extends React.ElementType = 'div', P = {}> = Overrid
|
|
|
53
47
|
* 是否隐藏当前月之外的日期,默认为false
|
|
54
48
|
*/
|
|
55
49
|
hideDaysOutsideCurrentMonth?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* 头部操作栏日期显示格式
|
|
58
|
-
* @default YYYY/MM
|
|
59
|
-
*/
|
|
60
|
-
headerBarFormat?: string;
|
|
61
|
-
/**
|
|
62
|
-
* 头部操作栏左边图标
|
|
63
|
-
* @defaultReturn <CaretLeftIcon />
|
|
64
|
-
*/
|
|
65
|
-
headerBarLeftIcon?: (options: ICustomIconProps) => React.ReactNode;
|
|
66
|
-
/**
|
|
67
|
-
* 头部操作栏右边图标
|
|
68
|
-
* @defaultReturn <CaretRightIcon />
|
|
69
|
-
*/
|
|
70
|
-
headerBarRightIcon?: (options: ICustomIconProps) => React.ReactNode;
|
|
71
50
|
/**
|
|
72
51
|
* 不可选择的日期
|
|
73
52
|
*/
|
package/es/Card/CardFooter.css
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
.bui-card-footer {
|
|
2
|
-
--padding: var(--bui-card-footer-padding, var(--bui-spacing-md) var(--bui-spacing-lg));
|
|
3
2
|
color: var(--bui-color-fg-muted);
|
|
4
3
|
font-size: var(--bui-text-size-1);
|
|
5
4
|
display: flex;
|
|
6
5
|
align-items: center;
|
|
7
|
-
padding: var(--
|
|
6
|
+
padding: var(--bui-spacing-md) var(--bui-spacing-lg);
|
|
8
7
|
font-family: var(--bui-font-family);
|
|
9
8
|
}
|
package/es/Card/CardHeader.css
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
.bui-card-header {
|
|
2
|
-
--padding: var(--bui-card-header-padding, var(--bui-spacing-md) var(--bui-spacing-lg));
|
|
3
|
-
--end-icon-margin-left: var(--bui-card-header-end-icon-margin-left, 2px);
|
|
4
2
|
display: flex;
|
|
5
3
|
align-items: center;
|
|
6
4
|
flex-direction: row;
|
|
7
5
|
position: relative;
|
|
8
6
|
padding: var(--bui-spacing-md) var(--bui-spacing-lg);
|
|
9
7
|
font-size: var(--bui-title-size-4);
|
|
10
|
-
font-weight:
|
|
8
|
+
font-weight: 500;
|
|
11
9
|
color: var(--bui-color-fg-default);
|
|
12
10
|
font-family: var(--bui-font-family);
|
|
13
11
|
}
|
package/es/Checkbox/Checkbox.css
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
.bui-checkbox {
|
|
2
|
-
--label-color: var(--bui-
|
|
3
|
-
--label-font-size: var(--bui-
|
|
4
|
-
--icon-font-size: var(--bui-
|
|
5
|
-
--disabled-opacity: var(--bui-checkbox-disabled-opacity, 0.5);
|
|
6
|
-
--icon-padding: var(--bui-checkbox-icon-padding, 5px);
|
|
2
|
+
--label-color: var(--bui-color-fg-default);
|
|
3
|
+
--label-font-size: var(--bui-text-size-1);
|
|
4
|
+
--icon-font-size: var(--bui-title-size-2);
|
|
7
5
|
display: inline-flex;
|
|
8
6
|
align-items: center;
|
|
9
7
|
position: relative;
|
|
@@ -11,7 +9,7 @@
|
|
|
11
9
|
}
|
|
12
10
|
.bui-checkbox.bui-checkbox-disabled {
|
|
13
11
|
pointer-events: none;
|
|
14
|
-
opacity:
|
|
12
|
+
opacity: 0.5;
|
|
15
13
|
}
|
|
16
14
|
.bui-checkbox-label-left {
|
|
17
15
|
flex-direction: row-reverse;
|
|
@@ -37,7 +35,7 @@
|
|
|
37
35
|
align-items: center;
|
|
38
36
|
justify-content: center;
|
|
39
37
|
flex-shrink: 0;
|
|
40
|
-
padding:
|
|
38
|
+
padding: 5px;
|
|
41
39
|
box-sizing: border-box;
|
|
42
40
|
font-size: var(--icon-font-size);
|
|
43
41
|
}
|
|
@@ -1,29 +1,14 @@
|
|
|
1
1
|
.bui-city-selector {
|
|
2
|
-
--select-item-width: var(--bui-city-selector-item-width, 111px);
|
|
3
|
-
--select-item-height: var(--bui-city-selector-item-height, 36px);
|
|
4
|
-
--select-item-border-radius: var(--bui-city-selector-item-border-radius, 20px);
|
|
5
|
-
--select-item-margin: var(--bui-city-selector-item-margin, 4.5px 0 4.5px 9px);
|
|
6
|
-
--title-height: var(--bui-city-selector-title-height, 45px);
|
|
7
|
-
--title-line-height: var(--bui-city-selector-title-line-height, 45px);
|
|
8
|
-
--btn-close-size: var(--bui-city-selector-btn-close-size, 45px);
|
|
9
|
-
--btn-close-font-size: var(--bui-city-selector-btn-close-font-size, 20px);
|
|
10
|
-
--container-with-title-height: var(--bui-city-selector-container-with-title-height, calc(100% - var(--title-height)));
|
|
11
|
-
--city-container-min-height: var(--bui-city-selector-city-container-min-height, 500px);
|
|
12
|
-
--select-city-buttons-padding: var(--bui-city-selector-select-city-buttons-padding, 7.5px 0 0 3px);
|
|
13
|
-
--select-city-title-line-height: var(--bui-city-selector-select-city-title-line-height, 15px);
|
|
14
|
-
--list-item-height: var(--bui-city-selector-list-item-height, 45px);
|
|
15
|
-
--city-index-has-title-top: var(--bui-city-selector-city-index-has-title-top, calc(50% + var(--title-height) / 2));
|
|
16
|
-
--index-item-height: var(--bui-city-selector-index-item-height, 20px);
|
|
17
2
|
font-family: var(--bui-font-family);
|
|
18
3
|
height: 100%;
|
|
19
4
|
position: relative;
|
|
20
5
|
}
|
|
21
6
|
.bui-city-selector-title {
|
|
22
7
|
width: 100%;
|
|
23
|
-
height:
|
|
8
|
+
height: 45px;
|
|
24
9
|
color: var(--bui-color-fg-default);
|
|
25
10
|
font-size: var(--bui-title-size-3);
|
|
26
|
-
line-height:
|
|
11
|
+
line-height: 45px;
|
|
27
12
|
text-align: center;
|
|
28
13
|
position: sticky;
|
|
29
14
|
top: 0;
|
|
@@ -35,20 +20,20 @@
|
|
|
35
20
|
position: absolute;
|
|
36
21
|
top: 0;
|
|
37
22
|
right: 0;
|
|
38
|
-
width:
|
|
39
|
-
height:
|
|
23
|
+
width: 45px;
|
|
24
|
+
height: 45px;
|
|
40
25
|
color: var(--bui-color-fg-muted);
|
|
41
26
|
text-align: center;
|
|
42
|
-
font-size:
|
|
27
|
+
font-size: 20px;
|
|
43
28
|
}
|
|
44
29
|
.bui-city-selector-scroll-view-container {
|
|
45
30
|
height: 100%;
|
|
46
31
|
}
|
|
47
32
|
.bui-city-selector-scroll-view-container.container-has-title {
|
|
48
|
-
height:
|
|
33
|
+
height: calc(100% - 45px);
|
|
49
34
|
}
|
|
50
35
|
.bui-city-selector-all-city {
|
|
51
|
-
min-height:
|
|
36
|
+
min-height: 500px;
|
|
52
37
|
font-size: var(--bui-text-size-2);
|
|
53
38
|
width: 100%;
|
|
54
39
|
background: var(--bui-color-bg-view);
|
|
@@ -57,21 +42,22 @@
|
|
|
57
42
|
.bui-city-selector-all-city .select-city-buttons {
|
|
58
43
|
display: flex;
|
|
59
44
|
flex-flow: wrap;
|
|
60
|
-
padding:
|
|
45
|
+
padding-left: 3px;
|
|
46
|
+
padding-top: 7.5px;
|
|
61
47
|
}
|
|
62
48
|
.bui-city-selector-all-city .select-city-title {
|
|
63
49
|
font-size: var(--bui-title-size-4);
|
|
64
|
-
line-height:
|
|
65
|
-
font-weight:
|
|
50
|
+
line-height: 15px;
|
|
51
|
+
font-weight: 600;
|
|
66
52
|
padding-left: var(--bui-spacing-lg);
|
|
67
|
-
padding-top:
|
|
53
|
+
padding-top: 9px;
|
|
68
54
|
}
|
|
69
55
|
.bui-city-selector-list {
|
|
70
56
|
padding-left: var(--bui-spacing-lg);
|
|
71
57
|
list-style-type: none;
|
|
72
58
|
}
|
|
73
59
|
.bui-city-selector-list-item {
|
|
74
|
-
height:
|
|
60
|
+
height: 45px;
|
|
75
61
|
font-size: var(--bui-title-size-4);
|
|
76
62
|
display: flex;
|
|
77
63
|
align-items: center;
|
|
@@ -95,7 +81,7 @@
|
|
|
95
81
|
transform: translate(0, -50%);
|
|
96
82
|
}
|
|
97
83
|
.bui-city-selector-index-container.city-index-has-title {
|
|
98
|
-
top:
|
|
84
|
+
top: calc(50% + 22.5px);
|
|
99
85
|
}
|
|
100
86
|
.bui-city-selector-index-container ul {
|
|
101
87
|
margin: 0;
|
|
@@ -106,7 +92,7 @@
|
|
|
106
92
|
}
|
|
107
93
|
.bui-city-selector-index-container li {
|
|
108
94
|
list-style: none;
|
|
109
|
-
height:
|
|
95
|
+
height: 20px;
|
|
110
96
|
text-align: center;
|
|
111
97
|
font-size: var(--bui-text-size-3);
|
|
112
98
|
color: var(--bui-color-info, --bui-color-info);
|
|
@@ -29,31 +29,34 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
import React, { useState, useEffect, useRef } from "react";
|
|
30
30
|
import clsx from "clsx";
|
|
31
31
|
import { throttle, useForkRef, useTouchEmulator } from "@bifrostui/utils";
|
|
32
|
-
import { useLocaleText } from "../locales";
|
|
33
32
|
import ScrollView from "../ScrollView";
|
|
34
33
|
import Selector from "./Selector";
|
|
35
34
|
import "./CitySelector.css";
|
|
36
35
|
const DEVIATION_HEIGHT = "6vmin";
|
|
36
|
+
const GPS_TYPE = {
|
|
37
|
+
title: "\u5B9A\u4F4D",
|
|
38
|
+
code: "GPS"
|
|
39
|
+
};
|
|
40
|
+
const CURRENT_TYPE = {
|
|
41
|
+
title: "\u5F53\u524D",
|
|
42
|
+
code: "CRRT"
|
|
43
|
+
};
|
|
44
|
+
const HOT_CITY_TYPE = {
|
|
45
|
+
title: "\u70ED\u95E8",
|
|
46
|
+
code: "HOT"
|
|
47
|
+
};
|
|
37
48
|
const prefixCls = "bui-city-selector";
|
|
38
49
|
const CitySelector = /* @__PURE__ */ React.forwardRef(
|
|
39
50
|
(props, ref) => {
|
|
40
|
-
const {
|
|
41
|
-
selectedCityGroupName: selectedCityGroupLocaleName,
|
|
42
|
-
currentCityGroupName: currentCityGroupLocaleName,
|
|
43
|
-
hotCitiesGroupName: hotCitiesGroupLocaleName,
|
|
44
|
-
located,
|
|
45
|
-
current,
|
|
46
|
-
hot
|
|
47
|
-
} = useLocaleText("citySelector");
|
|
48
51
|
const _a = props, {
|
|
49
52
|
className,
|
|
50
53
|
title: pageTitle,
|
|
51
54
|
selectedCity,
|
|
52
|
-
selectedCityGroupName =
|
|
55
|
+
selectedCityGroupName = "\u5F53\u524D\u57CE\u5E02",
|
|
53
56
|
currentCity,
|
|
54
|
-
currentCityGroupName =
|
|
57
|
+
currentCityGroupName = "\u5B9A\u4F4D\u57CE\u5E02",
|
|
55
58
|
hotCities,
|
|
56
|
-
hotCitiesGroupName =
|
|
59
|
+
hotCitiesGroupName = "\u70ED\u95E8\u57CE\u5E02",
|
|
57
60
|
cities,
|
|
58
61
|
disableIndex,
|
|
59
62
|
touchHandler,
|
|
@@ -76,18 +79,6 @@ const CitySelector = /* @__PURE__ */ React.forwardRef(
|
|
|
76
79
|
"onSelect",
|
|
77
80
|
"onClose"
|
|
78
81
|
]);
|
|
79
|
-
const GPS_TYPE = {
|
|
80
|
-
title: located,
|
|
81
|
-
code: "GPS"
|
|
82
|
-
};
|
|
83
|
-
const CURRENT_TYPE = {
|
|
84
|
-
title: current,
|
|
85
|
-
code: "CRRT"
|
|
86
|
-
};
|
|
87
|
-
const HOT_CITY_TYPE = {
|
|
88
|
-
title: hot,
|
|
89
|
-
code: "HOT"
|
|
90
|
-
};
|
|
91
82
|
const cityRef = useRef(null);
|
|
92
83
|
const nodeRef = useForkRef(ref, cityRef);
|
|
93
84
|
useTouchEmulator(cityRef.current);
|
|
@@ -146,7 +137,7 @@ const CitySelector = /* @__PURE__ */ React.forwardRef(
|
|
|
146
137
|
};
|
|
147
138
|
const renderTitile = (title, titleCode) => {
|
|
148
139
|
const parseTitle = (titleCode || title).toUpperCase();
|
|
149
|
-
return /* @__PURE__ */ React.createElement("div", { className: "select-city-title", id: disableIndex ? "" : parseTitle }, title
|
|
140
|
+
return /* @__PURE__ */ React.createElement("div", { className: "select-city-title", id: disableIndex ? "" : parseTitle }, title.toUpperCase());
|
|
150
141
|
};
|
|
151
142
|
const renderCity = (citys, title, titleCode) => {
|
|
152
143
|
return /* @__PURE__ */ React.createElement("div", null, renderTitile(title, titleCode), /* @__PURE__ */ React.createElement("div", { className: "select-city-buttons" }, citys.map((city, index) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
.bui-city-selector-item {
|
|
2
|
-
width:
|
|
3
|
-
height:
|
|
2
|
+
width: 111px;
|
|
3
|
+
height: 36px;
|
|
4
4
|
display: inline-flex;
|
|
5
5
|
justify-content: center;
|
|
6
6
|
align-items: center;
|
|
7
|
-
border-radius:
|
|
8
|
-
margin:
|
|
7
|
+
border-radius: 20px;
|
|
8
|
+
margin: 4.5px 0 4.5px 9px;
|
|
9
9
|
background-color: var(--bui-color-bg-default);
|
|
10
10
|
font-size: var(--bui-text-size-2);
|
|
11
11
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
--font-size: var(--bui-countdown-font-size, var(--bui-text-size-1));
|
|
3
3
|
--color: var(--bui-countdown-color, var(--bui-color-fg-default));
|
|
4
4
|
--font-weight: var(--bui-countdown-font-weight, var(--bui-font-weight-normal));
|
|
5
|
-
--slice-unit-margin: var(--bui-countdown-slice-unit-margin, 0 2px);
|
|
6
5
|
display: flex;
|
|
7
6
|
flex-direction: row;
|
|
8
7
|
align-items: center;
|
|
@@ -35,5 +34,5 @@
|
|
|
35
34
|
sans-serif;
|
|
36
35
|
}
|
|
37
36
|
.bui-countdown-slice-unit {
|
|
38
|
-
margin:
|
|
37
|
+
margin: 0 2px;
|
|
39
38
|
}
|
package/es/Dialog/Dialog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DialogProps
|
|
2
|
+
import { DialogProps } from './Dialog.types';
|
|
3
3
|
import './index.less';
|
|
4
|
-
declare const Dialog: React.ForwardRefExoticComponent<Omit<DialogProps, "ref"> & React.RefAttributes<
|
|
4
|
+
declare const Dialog: React.ForwardRefExoticComponent<Omit<DialogProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default Dialog;
|
package/es/Dialog/Dialog.js
CHANGED
|
@@ -29,13 +29,11 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
+
import React, { useRef } from "react";
|
|
32
33
|
import clsx from "clsx";
|
|
33
|
-
import React, { useImperativeHandle, useRef } from "react";
|
|
34
34
|
import { Input } from "../Input";
|
|
35
35
|
import { Button } from "../Button";
|
|
36
|
-
import { useLocaleText } from "../locales";
|
|
37
36
|
import Modal from "../Modal";
|
|
38
|
-
import { useTheme } from "../ThemeProvider";
|
|
39
37
|
import "./index.css";
|
|
40
38
|
const prefixCls = "bui-dialog";
|
|
41
39
|
const Dialog = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
@@ -50,8 +48,7 @@ const Dialog = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
50
48
|
cancelText,
|
|
51
49
|
placeholder,
|
|
52
50
|
InputProps,
|
|
53
|
-
className
|
|
54
|
-
theme
|
|
51
|
+
className
|
|
55
52
|
} = _a, others = __objRest(_a, [
|
|
56
53
|
"open",
|
|
57
54
|
"onOk",
|
|
@@ -63,19 +60,9 @@ const Dialog = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
63
60
|
"cancelText",
|
|
64
61
|
"placeholder",
|
|
65
62
|
"InputProps",
|
|
66
|
-
"className"
|
|
67
|
-
"theme"
|
|
63
|
+
"className"
|
|
68
64
|
]);
|
|
69
65
|
const InputRef = useRef(null);
|
|
70
|
-
const themeConfig = useTheme(theme);
|
|
71
|
-
const {
|
|
72
|
-
cancel,
|
|
73
|
-
confirm,
|
|
74
|
-
placeholder: placeholderLocaleName
|
|
75
|
-
} = useLocaleText("dialog", themeConfig);
|
|
76
|
-
useImperativeHandle(ref, () => {
|
|
77
|
-
return { theme: themeConfig };
|
|
78
|
-
});
|
|
79
66
|
const footerNode = /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-body-footer` }, /* @__PURE__ */ React.createElement(
|
|
80
67
|
Button,
|
|
81
68
|
{
|
|
@@ -83,7 +70,7 @@ const Dialog = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
83
70
|
onClick: onClose,
|
|
84
71
|
className: `${prefixCls}-body-button`
|
|
85
72
|
},
|
|
86
|
-
cancelText ||
|
|
73
|
+
cancelText || "\u53D6\u6D88"
|
|
87
74
|
), /* @__PURE__ */ React.createElement(
|
|
88
75
|
Button,
|
|
89
76
|
{
|
|
@@ -95,14 +82,14 @@ const Dialog = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
95
82
|
},
|
|
96
83
|
className: `${prefixCls}-body-button`
|
|
97
84
|
},
|
|
98
|
-
confirmText ||
|
|
85
|
+
confirmText || "\u786E\u5B9A"
|
|
99
86
|
));
|
|
100
87
|
const inputNode = type === "prompt" && /* @__PURE__ */ React.createElement(
|
|
101
88
|
Input,
|
|
102
89
|
__spreadProps(__spreadValues({}, InputProps), {
|
|
103
90
|
inputRef: InputRef,
|
|
104
91
|
className: `${prefixCls}-body-input`,
|
|
105
|
-
placeholder: `${placeholder ||
|
|
92
|
+
placeholder: `${placeholder || "\u8BF7\u5728\u6B64\u5904\u8F93\u5165"}`
|
|
106
93
|
})
|
|
107
94
|
);
|
|
108
95
|
if (!open)
|
|
@@ -113,7 +100,8 @@ const Dialog = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
113
100
|
open: true,
|
|
114
101
|
className: clsx(prefixCls, className),
|
|
115
102
|
disablePortal: true,
|
|
116
|
-
onClose
|
|
103
|
+
onClose,
|
|
104
|
+
ref
|
|
117
105
|
}),
|
|
118
106
|
/* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-body` }, header && /* @__PURE__ */ React.createElement("h1", { className: `${prefixCls}-body-title` }, header), message && /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-body-desc` }, message), inputNode, footerNode)
|
|
119
107
|
);
|