@bifrostui/react 1.2.9-beta.0 → 1.3.1-beta.0
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 +6 -3
- package/dist/ActionSheet/ActionSheetItem.css +10 -6
- package/dist/Alert/index.css +14 -8
- package/dist/Avatar/Avatar.css +13 -9
- package/dist/Avatar/AvatarGroup.css +15 -8
- package/dist/Backdrop/Backdrop.css +2 -1
- package/dist/Badge/Badge.css +27 -17
- package/dist/Breadcrumb/Breadcrumb.css +34 -0
- package/dist/Breadcrumb/Breadcrumb.d.ts +5 -0
- package/dist/Breadcrumb/Breadcrumb.js +128 -0
- package/dist/Breadcrumb/Breadcrumb.types.d.ts +49 -0
- package/dist/Breadcrumb/Breadcrumb.types.js +15 -0
- package/dist/Breadcrumb/BreadcrumbItem.d.ts +4 -0
- package/dist/Breadcrumb/BreadcrumbItem.js +78 -0
- package/dist/Breadcrumb/index.d.ts +4 -0
- package/dist/Breadcrumb/index.js +45 -0
- package/dist/Button/Button.css +26 -17
- package/dist/Calendar/Calendar.css +33 -18
- package/dist/Calendar/Calendar.d.ts +1 -1
- package/dist/Calendar/Calendar.js +85 -18
- package/dist/Calendar/Calendar.types.d.ts +33 -0
- package/dist/Card/CardFooter.css +2 -1
- package/dist/Card/CardHeader.css +3 -1
- package/dist/Checkbox/Checkbox.css +7 -5
- package/dist/CitySelector/CitySelector.css +29 -15
- package/dist/CitySelector/CitySelectorCore.js +25 -16
- package/dist/CitySelector/Selector/index.css +4 -4
- package/dist/Collapse/Collapse.css +6 -0
- package/dist/Collapse/Collapse.d.ts +5 -0
- package/dist/Collapse/Collapse.js +165 -0
- package/dist/Collapse/Collapse.types.d.ts +16 -0
- package/dist/Collapse/Collapse.types.js +15 -0
- package/dist/Collapse/index.d.ts +2 -0
- package/dist/Collapse/index.js +41 -0
- package/dist/CollapsePanel/CollapsePanel.css +32 -0
- package/dist/CollapsePanel/CollapsePanel.d.ts +5 -0
- package/dist/CollapsePanel/CollapsePanel.js +159 -0
- package/dist/CollapsePanel/CollapsePanel.types.d.ts +64 -0
- package/dist/CollapsePanel/CollapsePanel.types.js +15 -0
- package/dist/CollapsePanel/CollapsePanelItem.d.ts +4 -0
- package/dist/CollapsePanel/CollapsePanelItem.js +112 -0
- package/dist/CollapsePanel/index.d.ts +4 -0
- package/dist/CollapsePanel/index.js +45 -0
- package/dist/Countdown/Countdown.css +2 -1
- package/dist/Countdown/Countdown.js +3 -0
- package/dist/Dialog/Dialog.d.ts +5 -0
- package/dist/Dialog/Dialog.js +152 -0
- package/dist/Dialog/Dialog.types.d.ts +109 -0
- package/dist/Dialog/Dialog.types.js +15 -0
- package/dist/Dialog/FunctionalDialog.d.ts +3 -0
- package/dist/Dialog/FunctionalDialog.js +204 -0
- package/dist/Dialog/index.css +75 -0
- package/dist/Dialog/index.d.ts +2 -0
- package/dist/Dialog/index.js +41 -0
- package/dist/Divider/Divider.css +6 -4
- package/dist/IconButton/IconButton.css +9 -7
- package/dist/Image/index.css +2 -1
- package/dist/Input/Input.css +10 -5
- package/dist/List/List.css +3 -0
- package/dist/List/ListItem.css +3 -3
- package/dist/List/ListItemContent.css +1 -1
- package/dist/Loading/Loading.css +4 -2
- package/dist/Modal/Modal.miniapp.d.ts +1 -1
- package/dist/NavBar/NavBar.css +9 -5
- package/dist/Picker/Picker.css +25 -29
- package/dist/Picker/Picker.js +31 -11
- package/dist/Picker/Picker.types.d.ts +4 -0
- package/dist/Picker/PickerPanel.css +8 -8
- package/dist/Picker/PickerPanel.js +14 -8
- package/dist/Picker/utils.d.ts +16 -0
- package/dist/Picker/utils.js +32 -2
- package/dist/Popover/Popover.css +97 -0
- package/dist/Popover/Popover.d.ts +5 -0
- package/dist/Popover/Popover.js +186 -0
- package/dist/Popover/Popover.types.d.ts +60 -0
- package/dist/Popover/Popover.types.js +15 -0
- package/dist/Popover/index.d.ts +2 -0
- package/dist/Popover/index.js +41 -0
- package/dist/Portal/Portal.types.d.ts +4 -0
- package/dist/Portal/PortalCore.js +8 -1
- package/dist/Progress/Progress.css +8 -6
- package/dist/Radio/Radio.css +2 -1
- package/dist/Radio/Radio.js +1 -1
- package/dist/Radio/RadioButtonIcon.d.ts +1 -6
- package/dist/Radio/RadioButtonIcon.js +0 -3
- package/dist/Rating/Rating.css +8 -4
- package/dist/Select/Select.css +21 -10
- package/dist/Select/Select.js +1 -1
- package/dist/Select/SelectOption.js +3 -0
- package/dist/Skeleton/Skeleton.css +3 -2
- package/dist/Slider/Slider.css +24 -13
- package/dist/Steps/Step.css +11 -11
- package/dist/Steps/Steps.css +14 -5
- package/dist/Swiper/Swiper.css +2 -1
- package/dist/Switch/Switch.css +31 -16
- package/dist/TabBar/TabBar.css +7 -3
- package/dist/TabBar/TabBarItem.css +0 -1
- package/dist/Tabs/Tab.css +2 -6
- package/dist/Tabs/Tabs.css +7 -4
- package/dist/Tag/Tag.css +7 -10
- package/dist/Tag/TagGroup.css +9 -1
- package/dist/TextArea/TextArea.css +14 -8
- package/dist/ThemeProvider/ThemeProvider.d.ts +4 -0
- package/dist/ThemeProvider/ThemeProvider.js +90 -0
- package/dist/ThemeProvider/ThemeProvider.types.d.ts +127 -0
- package/dist/ThemeProvider/ThemeProvider.types.js +27 -0
- package/dist/ThemeProvider/hooks/ThemeContext.d.ts +4 -0
- package/dist/ThemeProvider/hooks/ThemeContext.js +35 -0
- package/dist/ThemeProvider/hooks/createTheme.d.ts +2 -0
- package/dist/ThemeProvider/hooks/createTheme.js +55 -0
- package/dist/ThemeProvider/hooks/index.d.ts +4 -0
- package/dist/ThemeProvider/hooks/index.js +43 -0
- package/dist/ThemeProvider/hooks/useTheme.d.ts +1 -0
- package/dist/ThemeProvider/hooks/useTheme.js +39 -0
- package/dist/ThemeProvider/index.d.ts +4 -0
- package/dist/ThemeProvider/index.js +45 -0
- package/dist/ThemeProvider/utils/constants.d.ts +38 -0
- package/dist/ThemeProvider/utils/constants.js +65 -0
- package/dist/ThemeProvider/utils/index.d.ts +2 -0
- package/dist/ThemeProvider/utils/index.js +23 -0
- package/dist/ThemeProvider/utils/mountTokens.d.ts +26 -0
- package/dist/ThemeProvider/utils/mountTokens.js +123 -0
- package/dist/Toast/FunctionalToast.d.ts +3 -0
- package/dist/Toast/FunctionalToast.js +177 -0
- package/dist/Toast/Toast.css +56 -0
- package/dist/Toast/Toast.d.ts +5 -0
- package/dist/Toast/Toast.js +121 -0
- package/dist/Toast/Toast.types.d.ts +101 -0
- package/dist/Toast/Toast.types.js +15 -0
- package/dist/Toast/index.d.ts +2 -0
- package/dist/Toast/index.js +41 -0
- package/dist/Tooltip/Tooltip.css +91 -0
- package/dist/Tooltip/Tooltip.d.ts +5 -0
- package/dist/Tooltip/Tooltip.js +177 -0
- package/dist/Tooltip/Tooltip.types.d.ts +51 -0
- package/dist/Tooltip/Tooltip.types.js +15 -0
- package/dist/Tooltip/index.d.ts +2 -0
- package/dist/Tooltip/index.js +41 -0
- package/dist/Transition/Transition.miniapp.js +7 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +19 -1
- package/dist/locales/base.d.ts +40 -0
- package/dist/locales/base.js +15 -0
- package/dist/locales/en-US.d.ts +3 -0
- package/dist/locales/en-US.js +69 -0
- package/dist/locales/hooks/useLocaleText.d.ts +3 -0
- package/dist/locales/hooks/useLocaleText.js +43 -0
- package/dist/locales/index.d.ts +5 -0
- package/dist/locales/index.js +49 -0
- package/dist/locales/zh-CN.d.ts +3 -0
- package/dist/locales/zh-CN.js +51 -0
- package/dist/locales/zh-TW.d.ts +3 -0
- package/dist/locales/zh-TW.js +51 -0
- package/es/ActionSheet/ActionSheet.css +6 -3
- package/es/ActionSheet/ActionSheetItem.css +10 -6
- package/es/Alert/index.css +14 -8
- package/es/Avatar/Avatar.css +13 -9
- package/es/Avatar/AvatarGroup.css +15 -8
- package/es/Backdrop/Backdrop.css +2 -1
- package/es/Badge/Badge.css +27 -17
- package/es/Breadcrumb/Breadcrumb.css +34 -0
- package/es/Breadcrumb/Breadcrumb.d.ts +5 -0
- package/es/Breadcrumb/Breadcrumb.js +101 -0
- package/es/Breadcrumb/Breadcrumb.types.d.ts +49 -0
- package/es/Breadcrumb/Breadcrumb.types.js +1 -0
- package/es/Breadcrumb/BreadcrumbItem.d.ts +4 -0
- package/es/Breadcrumb/BreadcrumbItem.js +51 -0
- package/es/Breadcrumb/index.d.ts +4 -0
- package/es/Breadcrumb/index.js +9 -0
- package/es/Button/Button.css +26 -17
- package/es/Calendar/Calendar.css +33 -18
- package/es/Calendar/Calendar.d.ts +1 -1
- package/es/Calendar/Calendar.js +91 -19
- package/es/Calendar/Calendar.types.d.ts +33 -0
- package/es/Card/CardFooter.css +2 -1
- package/es/Card/CardHeader.css +3 -1
- package/es/Checkbox/Checkbox.css +7 -5
- package/es/CitySelector/CitySelector.css +29 -15
- package/es/CitySelector/CitySelectorCore.js +25 -16
- package/es/CitySelector/Selector/index.css +4 -4
- package/es/Collapse/Collapse.css +6 -0
- package/es/Collapse/Collapse.d.ts +5 -0
- package/es/Collapse/Collapse.js +144 -0
- package/es/Collapse/Collapse.types.d.ts +16 -0
- package/es/Collapse/Collapse.types.js +1 -0
- package/es/Collapse/index.d.ts +2 -0
- package/es/Collapse/index.js +6 -0
- package/es/CollapsePanel/CollapsePanel.css +32 -0
- package/es/CollapsePanel/CollapsePanel.d.ts +5 -0
- package/es/CollapsePanel/CollapsePanel.js +132 -0
- package/es/CollapsePanel/CollapsePanel.types.d.ts +64 -0
- package/es/CollapsePanel/CollapsePanel.types.js +1 -0
- package/es/CollapsePanel/CollapsePanelItem.d.ts +4 -0
- package/es/CollapsePanel/CollapsePanelItem.js +85 -0
- package/es/CollapsePanel/index.d.ts +4 -0
- package/es/CollapsePanel/index.js +9 -0
- package/es/Countdown/Countdown.css +2 -1
- package/es/Countdown/Countdown.js +3 -0
- package/es/Dialog/Dialog.d.ts +5 -0
- package/es/Dialog/Dialog.js +125 -0
- package/es/Dialog/Dialog.types.d.ts +109 -0
- package/es/Dialog/Dialog.types.js +1 -0
- package/es/Dialog/FunctionalDialog.d.ts +3 -0
- package/es/Dialog/FunctionalDialog.js +177 -0
- package/es/Dialog/index.css +75 -0
- package/es/Dialog/index.d.ts +2 -0
- package/es/Dialog/index.js +6 -0
- package/es/Divider/Divider.css +6 -4
- package/es/IconButton/IconButton.css +9 -7
- package/es/Image/index.css +2 -1
- package/es/Input/Input.css +10 -5
- package/es/List/List.css +3 -0
- package/es/List/ListItem.css +3 -3
- package/es/List/ListItemContent.css +1 -1
- package/es/Loading/Loading.css +4 -2
- package/es/Modal/Modal.miniapp.d.ts +1 -1
- package/es/NavBar/NavBar.css +9 -5
- package/es/Picker/Picker.css +25 -29
- package/es/Picker/Picker.js +32 -12
- package/es/Picker/Picker.types.d.ts +4 -0
- package/es/Picker/PickerPanel.css +8 -8
- package/es/Picker/PickerPanel.js +14 -8
- package/es/Picker/utils.d.ts +16 -0
- package/es/Picker/utils.js +29 -1
- package/es/Popover/Popover.css +97 -0
- package/es/Popover/Popover.d.ts +5 -0
- package/es/Popover/Popover.js +159 -0
- package/es/Popover/Popover.types.d.ts +60 -0
- package/es/Popover/Popover.types.js +1 -0
- package/es/Popover/index.d.ts +2 -0
- package/es/Popover/index.js +6 -0
- package/es/Portal/Portal.types.d.ts +4 -0
- package/es/Portal/PortalCore.js +8 -1
- package/es/Progress/Progress.css +8 -6
- package/es/Radio/Radio.css +2 -1
- package/es/Radio/Radio.js +1 -1
- package/es/Radio/RadioButtonIcon.d.ts +1 -6
- package/es/Radio/RadioButtonIcon.js +0 -3
- package/es/Rating/Rating.css +8 -4
- package/es/Select/Select.css +21 -10
- package/es/Select/Select.js +1 -1
- package/es/Select/SelectOption.js +3 -0
- package/es/Skeleton/Skeleton.css +3 -2
- package/es/Slider/Slider.css +24 -13
- package/es/Steps/Step.css +11 -11
- package/es/Steps/Steps.css +14 -5
- package/es/Swiper/Swiper.css +2 -1
- package/es/Switch/Switch.css +31 -16
- package/es/TabBar/TabBar.css +7 -3
- package/es/TabBar/TabBarItem.css +0 -1
- package/es/Tabs/Tab.css +2 -6
- package/es/Tabs/Tabs.css +7 -4
- package/es/Tag/Tag.css +7 -10
- package/es/Tag/TagGroup.css +9 -1
- package/es/TextArea/TextArea.css +14 -8
- package/es/ThemeProvider/ThemeProvider.d.ts +4 -0
- package/es/ThemeProvider/ThemeProvider.js +61 -0
- package/es/ThemeProvider/ThemeProvider.types.d.ts +127 -0
- package/es/ThemeProvider/ThemeProvider.types.js +1 -0
- package/es/ThemeProvider/hooks/ThemeContext.d.ts +4 -0
- package/es/ThemeProvider/hooks/ThemeContext.js +6 -0
- package/es/ThemeProvider/hooks/createTheme.d.ts +2 -0
- package/es/ThemeProvider/hooks/createTheme.js +38 -0
- package/es/ThemeProvider/hooks/index.d.ts +4 -0
- package/es/ThemeProvider/hooks/index.js +8 -0
- package/es/ThemeProvider/hooks/useTheme.d.ts +1 -0
- package/es/ThemeProvider/hooks/useTheme.js +10 -0
- package/es/ThemeProvider/index.d.ts +4 -0
- package/es/ThemeProvider/index.js +8 -0
- package/es/ThemeProvider/utils/constants.d.ts +38 -0
- package/es/ThemeProvider/utils/constants.js +40 -0
- package/es/ThemeProvider/utils/index.d.ts +2 -0
- package/es/ThemeProvider/utils/index.js +2 -0
- package/es/ThemeProvider/utils/mountTokens.d.ts +26 -0
- package/es/ThemeProvider/utils/mountTokens.js +88 -0
- package/es/Toast/FunctionalToast.d.ts +3 -0
- package/es/Toast/FunctionalToast.js +150 -0
- package/es/Toast/Toast.css +56 -0
- package/es/Toast/Toast.d.ts +5 -0
- package/es/Toast/Toast.js +99 -0
- package/es/Toast/Toast.types.d.ts +101 -0
- package/es/Toast/Toast.types.js +1 -0
- package/es/Toast/index.d.ts +2 -0
- package/es/Toast/index.js +6 -0
- package/es/Tooltip/Tooltip.css +91 -0
- package/es/Tooltip/Tooltip.d.ts +5 -0
- package/es/Tooltip/Tooltip.js +150 -0
- package/es/Tooltip/Tooltip.types.d.ts +51 -0
- package/es/Tooltip/Tooltip.types.js +1 -0
- package/es/Tooltip/index.d.ts +2 -0
- package/es/Tooltip/index.js +6 -0
- package/es/Transition/Transition.miniapp.js +7 -1
- package/es/index.d.ts +9 -0
- package/es/index.js +9 -0
- package/es/locales/base.d.ts +40 -0
- package/es/locales/base.js +0 -0
- package/es/locales/en-US.d.ts +3 -0
- package/es/locales/en-US.js +50 -0
- package/es/locales/hooks/useLocaleText.d.ts +3 -0
- package/es/locales/hooks/useLocaleText.js +26 -0
- package/es/locales/index.d.ts +5 -0
- package/es/locales/index.js +11 -0
- package/es/locales/zh-CN.d.ts +3 -0
- package/es/locales/zh-CN.js +32 -0
- package/es/locales/zh-TW.d.ts +3 -0
- package/es/locales/zh-TW.js +32 -0
- package/package.json +5 -5
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
.bui-dialog {
|
|
2
|
+
--max-width: var(--bui-dialog-max-width, 300px);
|
|
3
|
+
--border-radius: var(--bui-dialog-border-radius, var(--bui-shape-radius-drawer));
|
|
4
|
+
--title-padding: var(--bui-dialog-title-padding, 0 40px 9px);
|
|
5
|
+
--desc-padding: var(--bui-dialog-desc-padding, 0 24px);
|
|
6
|
+
--footer-margin-top: var(--bui-dialog-footer-margin-top, 15px);
|
|
7
|
+
--button-height: var(--bui-dialog-button-height, 53px);
|
|
8
|
+
--button-line-height: var(--bui-dialog-button-line-height, 25px);
|
|
9
|
+
--button-padding: var(--bui-dialog-button-padding, 12px 0 13px);
|
|
10
|
+
--button-font-size: var(--bui-dialog-button-font-size, 17px);
|
|
11
|
+
--button-border-left: var(--bui-dialog-button-border-left, 1px solid rgba(0, 0, 0, 0.05));
|
|
12
|
+
--button-active-background-color: var(--bui-dialog-button-active-background-color, rgba(54, 57, 64, 0.05));
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
.bui-dialog-body {
|
|
18
|
+
padding-top: 21px;
|
|
19
|
+
min-width: var(--max-width);
|
|
20
|
+
margin: 0 auto;
|
|
21
|
+
border-radius: var(--border-radius);
|
|
22
|
+
background-clip: padding-box;
|
|
23
|
+
background-color: var(--bui-color-bg-view);
|
|
24
|
+
line-height: 21px;
|
|
25
|
+
}
|
|
26
|
+
.bui-dialog-body-title {
|
|
27
|
+
padding: var(--title-padding);
|
|
28
|
+
font-size: var(--bui-title-size-2);
|
|
29
|
+
text-align: center;
|
|
30
|
+
color: var(--bui-color-fg-default);
|
|
31
|
+
font-weight: var(--bui-font-weight-medium);
|
|
32
|
+
}
|
|
33
|
+
.bui-dialog-body-title + .bui-dialog-body-footer {
|
|
34
|
+
margin-top: var(--bui-spacing-sm);
|
|
35
|
+
}
|
|
36
|
+
.bui-dialog-body-desc {
|
|
37
|
+
padding: var(--desc-padding);
|
|
38
|
+
color: var(--bui-color-fg-muted);
|
|
39
|
+
font-size: var(--bui-title-size-4);
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
42
|
+
.bui-dialog-body-desc:first-child {
|
|
43
|
+
padding-top: 0;
|
|
44
|
+
}
|
|
45
|
+
.bui-dialog-body-footer {
|
|
46
|
+
margin-top: var(--footer-margin-top);
|
|
47
|
+
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
|
48
|
+
display: -webkit-box;
|
|
49
|
+
display: flex;
|
|
50
|
+
}
|
|
51
|
+
.bui-dialog-body-input {
|
|
52
|
+
width: calc(100% - 48px);
|
|
53
|
+
margin: 14px 24px 0;
|
|
54
|
+
}
|
|
55
|
+
.bui-dialog-body-button {
|
|
56
|
+
flex: 1;
|
|
57
|
+
display: block;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: var(--button-height);
|
|
60
|
+
line-height: var(--button-line-height);
|
|
61
|
+
padding: var(--button-padding);
|
|
62
|
+
font-size: var(--button-font-size);
|
|
63
|
+
border: 0;
|
|
64
|
+
outline: 0;
|
|
65
|
+
border-left: var(--button-border-left);
|
|
66
|
+
border-radius: 0;
|
|
67
|
+
text-align: center;
|
|
68
|
+
box-sizing: border-box;
|
|
69
|
+
}
|
|
70
|
+
.bui-dialog-body-button:first-child {
|
|
71
|
+
border: none;
|
|
72
|
+
}
|
|
73
|
+
.bui-dialog-body-button:active {
|
|
74
|
+
background-color: var(--button-active-background-color);
|
|
75
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var Dialog_exports = {};
|
|
30
|
+
__export(Dialog_exports, {
|
|
31
|
+
Dialog: () => import_FunctionalDialog.default,
|
|
32
|
+
default: () => import_FunctionalDialog.default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Dialog_exports);
|
|
35
|
+
var import_FunctionalDialog = __toESM(require("./FunctionalDialog"));
|
|
36
|
+
__reExport(Dialog_exports, require("./Dialog.types"), module.exports);
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
Dialog,
|
|
40
|
+
...require("./Dialog.types")
|
|
41
|
+
});
|
package/dist/Divider/Divider.css
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
.bui-divider {
|
|
2
2
|
--height: var(--bui-divider-height, 100%);
|
|
3
3
|
--width: var(--bui-divider-width, 100%);
|
|
4
|
+
--border-width: var(--bui-divider-border-width, 1px);
|
|
5
|
+
--line-width: var(--bui-divider-line-width, 40px);
|
|
4
6
|
border-color: var(--bui-color-border-default);
|
|
5
7
|
font-family: var(--bui-font-family);
|
|
6
8
|
}
|
|
7
9
|
.bui-divider-vertical {
|
|
8
10
|
height: var(--height);
|
|
9
11
|
display: inline-block;
|
|
10
|
-
border-right-width:
|
|
12
|
+
border-right-width: var(--border-width);
|
|
11
13
|
border-right-style: solid;
|
|
12
14
|
}
|
|
13
15
|
.bui-divider-horizontal {
|
|
14
16
|
width: var(--width);
|
|
15
|
-
border-bottom-width:
|
|
17
|
+
border-bottom-width: var(--border-width);
|
|
16
18
|
border-bottom-style: solid;
|
|
17
19
|
}
|
|
18
20
|
.bui-divider-vertical-dashed {
|
|
@@ -29,8 +31,8 @@
|
|
|
29
31
|
justify-content: center;
|
|
30
32
|
}
|
|
31
33
|
.bui-divider-line {
|
|
32
|
-
width:
|
|
33
|
-
border-bottom-width:
|
|
34
|
+
width: var(--line-width);
|
|
35
|
+
border-bottom-width: var(--border-width);
|
|
34
36
|
border-bottom-style: solid;
|
|
35
37
|
border-color: var(--bui-color-border-default);
|
|
36
38
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
.bui-icon-btn {
|
|
2
|
-
--bg-color: var(--bui-color-neutral-5);
|
|
3
|
-
--color: var(--bui-color-fg-muted);
|
|
4
|
-
--icon-size: 17px;
|
|
5
|
-
--user-area: 5px;
|
|
2
|
+
--bg-color: var(--bui-icon-btn-bg-color, var(--bui-color-neutral-5));
|
|
3
|
+
--color: var(--bui-icon-btn-color, var(--bui-color-fg-muted));
|
|
4
|
+
--icon-size: var(--bui-icon-btn-font-size, 17px);
|
|
5
|
+
--user-area: var(--bui-icon-btn-padding, 5px);
|
|
6
|
+
--large-font-size: var(--bui-icon-btn-large-font-size, 23px);
|
|
7
|
+
--disabled-opacity: var(--bui-icon-btn-disabled-opacity, 0.5);
|
|
6
8
|
position: relative;
|
|
7
9
|
display: inline-flex;
|
|
8
10
|
height: auto;
|
|
@@ -47,10 +49,10 @@
|
|
|
47
49
|
}
|
|
48
50
|
.bui-icon-btn-medium.bui-icon-btn-outlined,
|
|
49
51
|
.bui-icon-btn-medium.bui-icon-btn-contained {
|
|
50
|
-
padding:
|
|
52
|
+
padding: var(--user-area);
|
|
51
53
|
}
|
|
52
54
|
.bui-icon-btn-large {
|
|
53
|
-
font-size:
|
|
55
|
+
font-size: var(--large-font-size);
|
|
54
56
|
padding: var(--bui-spacing-sm);
|
|
55
57
|
}
|
|
56
58
|
.bui-icon-btn-large.bui-icon-btn-outlined,
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
}
|
|
60
62
|
.bui-icon-btn-disabled {
|
|
61
63
|
pointer-events: none;
|
|
62
|
-
opacity:
|
|
64
|
+
opacity: var(--disabled-opacity);
|
|
63
65
|
}
|
|
64
66
|
.bui-icon-btn-circular {
|
|
65
67
|
border-radius: 100%;
|
package/dist/Image/index.css
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.bui-image {
|
|
2
|
+
--default-background-color: var(--bui-image-default-background-color, rgba(127, 127, 127, 0.2));
|
|
2
3
|
width: auto;
|
|
3
4
|
height: auto;
|
|
4
5
|
display: inline-block;
|
|
@@ -31,5 +32,5 @@
|
|
|
31
32
|
.bui-image-default-icon-item {
|
|
32
33
|
width: 100%;
|
|
33
34
|
height: 100%;
|
|
34
|
-
background-color:
|
|
35
|
+
background-color: var(--default-background-color);
|
|
35
36
|
}
|
package/dist/Input/Input.css
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
.bui-input {
|
|
2
|
+
--height: var(--bui-input-height, 32px);
|
|
3
|
+
--padding: var(--bui-input-padding, 4px 10px);
|
|
4
|
+
--icon-start-margin-right: var(--bui-input-icon-start-margin-right, 3px);
|
|
5
|
+
--icon-end-margin-left: var(--bui-input-icon-end-margin-left, 3px);
|
|
6
|
+
--disabled-background-color: var(--bui-input-disabled-background-color, rgba(0, 0, 0, 0.04));
|
|
2
7
|
position: relative;
|
|
3
8
|
display: flex;
|
|
4
9
|
align-items: center;
|
|
5
|
-
height:
|
|
6
|
-
padding:
|
|
10
|
+
height: var(--height);
|
|
11
|
+
padding: var(--padding);
|
|
7
12
|
box-sizing: border-box;
|
|
8
13
|
border-radius: var(--bui-shape-radius-default);
|
|
9
14
|
border: 1px solid var(--bui-color-border-default);
|
|
@@ -16,10 +21,10 @@
|
|
|
16
21
|
font-size: var(--bui-title-size-3);
|
|
17
22
|
}
|
|
18
23
|
.bui-input-icon-start {
|
|
19
|
-
margin-right:
|
|
24
|
+
margin-right: var(--icon-start-margin-right);
|
|
20
25
|
}
|
|
21
26
|
.bui-input-icon-end {
|
|
22
|
-
margin-left:
|
|
27
|
+
margin-left: var(--icon-end-margin-left);
|
|
23
28
|
}
|
|
24
29
|
.bui-input-input {
|
|
25
30
|
flex: 1;
|
|
@@ -38,7 +43,7 @@
|
|
|
38
43
|
}
|
|
39
44
|
.bui-input-disabled {
|
|
40
45
|
pointer-events: none;
|
|
41
|
-
background-color:
|
|
46
|
+
background-color: var(--disabled-background-color);
|
|
42
47
|
}
|
|
43
48
|
.bui-input-disabled .bui-input-input {
|
|
44
49
|
color: var(--bui-color-fg-disabled);
|
package/dist/List/List.css
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
.bui-list {
|
|
2
|
+
--small-item-padding: var(--bui-list-small-item-padding, 5px 12px);
|
|
3
|
+
--medium-item-padding: var(--bui-list-medium-item-padding, 18px 12px);
|
|
4
|
+
--large-item-padding: var(--bui-list-large-item-padding, 20px 12px);
|
|
2
5
|
background: var(--bui-color-bg-view);
|
|
3
6
|
font-size: var(--bui-title-size-3);
|
|
4
7
|
font-family: var(--bui-font-family);
|
package/dist/List/ListItem.css
CHANGED
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
color: var(--bui-color-fg-subtle);
|
|
11
11
|
}
|
|
12
12
|
.bui-list-small .bui-list-item {
|
|
13
|
-
padding:
|
|
13
|
+
padding: var(--small-item-padding);
|
|
14
14
|
}
|
|
15
15
|
.bui-list-medium .bui-list-item {
|
|
16
|
-
padding:
|
|
16
|
+
padding: var(--medium-item-padding);
|
|
17
17
|
}
|
|
18
18
|
.bui-list-large .bui-list-item {
|
|
19
|
-
padding:
|
|
19
|
+
padding: var(--large-item-padding);
|
|
20
20
|
}
|
|
21
21
|
.bui-list-item-divider:not(:last-child) {
|
|
22
22
|
border-bottom: 1px solid var(--bui-color-border-default);
|
package/dist/Loading/Loading.css
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
.bui-loading {
|
|
2
|
+
--icon-font-size: var(--bui-loading-icon-font-size, 30px);
|
|
3
|
+
--text-padding: var(--bui-loading-text-padding, 10px);
|
|
2
4
|
--animation-duration: var(--bui-loading-animation-duration, 1.6s);
|
|
3
5
|
width: fit-content;
|
|
4
6
|
display: flex;
|
|
@@ -8,11 +10,11 @@
|
|
|
8
10
|
font-family: var(--bui-font-family);
|
|
9
11
|
}
|
|
10
12
|
.bui-loading-icon {
|
|
11
|
-
font-size:
|
|
13
|
+
font-size: var(--icon-font-size);
|
|
12
14
|
animation: loading var(--animation-duration) linear infinite;
|
|
13
15
|
}
|
|
14
16
|
.bui-loading-text {
|
|
15
|
-
padding:
|
|
17
|
+
padding: var(--text-padding);
|
|
16
18
|
font-size: var(--bui-title-size-3);
|
|
17
19
|
}
|
|
18
20
|
.bui-loading-vertical {
|
|
@@ -12,5 +12,5 @@ declare const Modal: React.ForwardRefExoticComponent<Omit<ViewProps & {
|
|
|
12
12
|
keepMounted?: boolean;
|
|
13
13
|
} & import("@bifrostui/types").ICommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
14
14
|
ref?: React.Ref<HTMLDivElement>;
|
|
15
|
-
}, "open" | keyof import("@bifrostui/types").ICommonProps | "
|
|
15
|
+
}, "open" | "container" | "disablePortal" | keyof import("@bifrostui/types").ICommonProps | "hideBackdrop" | "BackdropProps" | "onClose" | "disableScrollLock" | "keepMounted">, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
export default Modal;
|
package/dist/NavBar/NavBar.css
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
.bui-navbar {
|
|
2
|
+
--width: var(--bui-navbar-width, 100%);
|
|
2
3
|
--height: var(--bui-navbar-height, 45px);
|
|
4
|
+
--padding: var(--bui-navbar-padding, 0 8px);
|
|
3
5
|
--icon-size: var(--bui-navbar-icon-size, 24px);
|
|
6
|
+
--icon-font-size: var(--bui-navbar-icon-font-size, var(--bui-title-size-3));
|
|
4
7
|
--background-color: var(--bui-navbar-background-color, var(--bui-color-white));
|
|
5
8
|
--border-bottom: var(--bui-navbar-border-bottom, none);
|
|
6
9
|
--z-index: var(--bui-navbar-z-index, auto);
|
|
10
|
+
--title-max-width: var(--bui-navbar-title-max-width, 60%);
|
|
7
11
|
position: relative;
|
|
8
|
-
width:
|
|
12
|
+
width: var(--width);
|
|
9
13
|
height: var(--height);
|
|
10
14
|
box-sizing: border-box;
|
|
11
|
-
padding:
|
|
15
|
+
padding: var(--padding);
|
|
12
16
|
display: flex;
|
|
13
17
|
justify-content: center;
|
|
14
18
|
align-items: center;
|
|
@@ -25,8 +29,8 @@
|
|
|
25
29
|
width: 100%;
|
|
26
30
|
}
|
|
27
31
|
.bui-navbar-title {
|
|
28
|
-
max-width:
|
|
29
|
-
padding:
|
|
32
|
+
max-width: var(--title-max-width);
|
|
33
|
+
padding: var(--padding);
|
|
30
34
|
font-size: var(--bui-title-size-2);
|
|
31
35
|
width: auto;
|
|
32
36
|
overflow: hidden;
|
|
@@ -38,7 +42,7 @@
|
|
|
38
42
|
flex: 1;
|
|
39
43
|
display: flex;
|
|
40
44
|
align-items: center;
|
|
41
|
-
font-size: var(--
|
|
45
|
+
font-size: var(--icon-font-size);
|
|
42
46
|
}
|
|
43
47
|
.bui-navbar-left {
|
|
44
48
|
justify-content: flex-start;
|
package/dist/Picker/Picker.css
CHANGED
|
@@ -1,53 +1,49 @@
|
|
|
1
1
|
.bui-picker {
|
|
2
|
-
--
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--indicator-height: 36px;
|
|
12
|
-
--indicator-border-color: var(--bui-color-border-default);
|
|
13
|
-
--option-color: var(--bui-color-fg-default);
|
|
14
|
-
--option-font-size: var(--bui-title-size-4);
|
|
15
|
-
--option-height: 36px;
|
|
2
|
+
--header-height: var(--bui-picker-header-height, 50px);
|
|
3
|
+
--header-padding: var(--bui-picker-header-padding, 0 var(--bui-spacing-lg));
|
|
4
|
+
--cancel-height: var(--bui-picker-cancel-height, 100%);
|
|
5
|
+
--cancel-line-height: var(--bui-picker-cancel-line-height, 50px);
|
|
6
|
+
--confirm-height: var(--bui-picker-confirm-height, 100%);
|
|
7
|
+
--confirm-line-height: var(--bui-picker-confirm-line-height, 50px);
|
|
8
|
+
--panel-container-height: var(--bui-picker-panel-height, 260px);
|
|
9
|
+
--indicator-top: var(--bui-picker-indicator-top, 108px);
|
|
10
|
+
--option-height: var(--bui-picker-option-height, 36px);
|
|
16
11
|
font-family: var(--bui-font-family);
|
|
17
12
|
}
|
|
18
13
|
.bui-picker .bui-drawer-content {
|
|
19
14
|
border-radius: var(--bui-shape-radius-drawer) var(--bui-shape-radius-drawer) 0 0;
|
|
20
15
|
}
|
|
21
16
|
.bui-picker-header {
|
|
22
|
-
height:
|
|
17
|
+
height: var(--header-height);
|
|
23
18
|
display: flex;
|
|
24
19
|
align-items: center;
|
|
25
20
|
justify-content: space-between;
|
|
26
|
-
padding:
|
|
21
|
+
padding: var(--header-padding);
|
|
27
22
|
}
|
|
28
23
|
.bui-picker-cancel {
|
|
29
|
-
|
|
30
|
-
height:
|
|
31
|
-
font-size: var(--
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
height: var(--cancel-height);
|
|
26
|
+
font-size: var(--bui-title-size-4);
|
|
32
27
|
text-align: center;
|
|
33
|
-
line-height:
|
|
34
|
-
color: var(--
|
|
28
|
+
line-height: var(--cancel-line-height);
|
|
29
|
+
color: var(--bui-color-fg-default);
|
|
35
30
|
}
|
|
36
31
|
.bui-picker-title {
|
|
37
|
-
font-size: var(--title-
|
|
38
|
-
color: var(--
|
|
39
|
-
font-weight: var(--
|
|
32
|
+
font-size: var(--bui-title-size-3);
|
|
33
|
+
color: var(--bui-color-fg-default);
|
|
34
|
+
font-weight: var(--bui-font-weight-medium);
|
|
40
35
|
}
|
|
41
36
|
.bui-picker-confirm {
|
|
42
|
-
|
|
43
|
-
height:
|
|
44
|
-
font-size: var(--
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
height: var(--confirm-height);
|
|
39
|
+
font-size: var(--bui-title-size-4);
|
|
45
40
|
text-align: center;
|
|
46
|
-
line-height:
|
|
47
|
-
color: var(--
|
|
41
|
+
line-height: var(--confirm-line-height);
|
|
42
|
+
color: var(--bui-color-primary);
|
|
48
43
|
}
|
|
49
44
|
.bui-picker-container {
|
|
50
45
|
width: 100%;
|
|
51
46
|
height: var(--panel-container-height);
|
|
52
47
|
display: flex;
|
|
48
|
+
overflow: hidden;
|
|
53
49
|
}
|
package/dist/Picker/Picker.js
CHANGED
|
@@ -63,6 +63,7 @@ var import_clsx = __toESM(require("clsx"));
|
|
|
63
63
|
var import_react = __toESM(require("react"));
|
|
64
64
|
var import_Drawer = __toESM(require("../Drawer"));
|
|
65
65
|
var import_PickerPanel = __toESM(require("./PickerPanel"));
|
|
66
|
+
var import_locales = require("../locales");
|
|
66
67
|
var import_utils = require("./utils");
|
|
67
68
|
var import_Picker2 = require("./Picker.css");
|
|
68
69
|
const prefixCls = "bui-picker";
|
|
@@ -94,6 +95,7 @@ const Picker = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
94
95
|
const rollerRefs = (0, import_react.useRef)([]);
|
|
95
96
|
const [columns, setColumns] = (0, import_react.useState)([]);
|
|
96
97
|
const [internalValue, setInternalValue] = (0, import_react.useState)([]);
|
|
98
|
+
const { cancel: cancelText, confirm: confirmText } = (0, import_locales.useLocaleText)("picker");
|
|
97
99
|
(0, import_react.useEffect)(() => {
|
|
98
100
|
if (!open)
|
|
99
101
|
return;
|
|
@@ -115,13 +117,18 @@ const Picker = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
115
117
|
}
|
|
116
118
|
}, [value, options]);
|
|
117
119
|
const confirm = (e) => {
|
|
118
|
-
const payload = {
|
|
119
|
-
value: internalValue,
|
|
120
|
-
options: columns
|
|
121
|
-
};
|
|
122
120
|
const isMoving = rollerRefs.current.some((roller) => roller == null ? void 0 : roller.isMoving);
|
|
123
121
|
if (isMoving)
|
|
124
122
|
return;
|
|
123
|
+
const { safeValue } = (0, import_utils.safeData)({
|
|
124
|
+
value: internalValue,
|
|
125
|
+
formatted: columns,
|
|
126
|
+
options
|
|
127
|
+
});
|
|
128
|
+
const payload = {
|
|
129
|
+
value: safeValue,
|
|
130
|
+
options: columns
|
|
131
|
+
};
|
|
125
132
|
onConfirm == null ? void 0 : onConfirm(e, payload);
|
|
126
133
|
onClose == null ? void 0 : onClose(e, __spreadValues({
|
|
127
134
|
from: "confirm"
|
|
@@ -129,11 +136,18 @@ const Picker = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
129
136
|
};
|
|
130
137
|
const cancel = (e) => {
|
|
131
138
|
onCancel == null ? void 0 : onCancel(e);
|
|
132
|
-
|
|
133
|
-
from: "cancel",
|
|
139
|
+
const { safeValue } = (0, import_utils.safeData)({
|
|
134
140
|
value: internalValue,
|
|
135
|
-
|
|
141
|
+
formatted: columns,
|
|
142
|
+
options
|
|
136
143
|
});
|
|
144
|
+
const payload = {
|
|
145
|
+
value: safeValue,
|
|
146
|
+
options: columns
|
|
147
|
+
};
|
|
148
|
+
onClose == null ? void 0 : onClose(e, __spreadValues({
|
|
149
|
+
from: "cancel"
|
|
150
|
+
}, payload));
|
|
137
151
|
};
|
|
138
152
|
const updateItem = (e, columnOption, columnIndex) => {
|
|
139
153
|
var _a2, _b, _c;
|
|
@@ -166,7 +180,7 @@ const Picker = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
166
180
|
currentOption: columnOption
|
|
167
181
|
});
|
|
168
182
|
} else {
|
|
169
|
-
const result = internalValue;
|
|
183
|
+
const result = [...internalValue];
|
|
170
184
|
result[columnIndex] = columnOption.value;
|
|
171
185
|
setInternalValue(result);
|
|
172
186
|
onOptionChange == null ? void 0 : onOptionChange(e, {
|
|
@@ -181,8 +195,13 @@ const Picker = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
181
195
|
updateItem(e, columnOption, columnIndex);
|
|
182
196
|
};
|
|
183
197
|
const handleClose = (e, data) => {
|
|
184
|
-
|
|
198
|
+
const { safeValue } = (0, import_utils.safeData)({
|
|
185
199
|
value: internalValue,
|
|
200
|
+
formatted: columns,
|
|
201
|
+
options
|
|
202
|
+
});
|
|
203
|
+
onClose == null ? void 0 : onClose(e, __spreadValues({
|
|
204
|
+
value: safeValue,
|
|
186
205
|
options: columns
|
|
187
206
|
}, data));
|
|
188
207
|
};
|
|
@@ -206,7 +225,7 @@ const Picker = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
206
225
|
__spreadProps(__spreadValues({}, contentProps), {
|
|
207
226
|
className: (0, import_clsx.default)(`${prefixCls}-content`, contentProps == null ? void 0 : contentProps.className)
|
|
208
227
|
}),
|
|
209
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-header` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-cancel`, onClick: cancel },
|
|
228
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-header` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-cancel`, onClick: cancel }, cancelText), title && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-title` }, title), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-confirm`, onClick: confirm }, confirmText)),
|
|
210
229
|
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-container` }, columns.map((column, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
211
230
|
import_PickerPanel.default,
|
|
212
231
|
{
|
|
@@ -215,7 +234,8 @@ const Picker = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
|
215
234
|
options: column,
|
|
216
235
|
columnIndex: index,
|
|
217
236
|
defaultValue: internalValue == null ? void 0 : internalValue[index],
|
|
218
|
-
onSelect: handleSelect
|
|
237
|
+
onSelect: handleSelect,
|
|
238
|
+
pickerStyle: others == null ? void 0 : others.style
|
|
219
239
|
}
|
|
220
240
|
)))
|
|
221
241
|
)
|
|
@@ -86,6 +86,10 @@ export type PickerPanelProps<D extends React.ElementType = 'div', P = {}> = Over
|
|
|
86
86
|
* 列索引
|
|
87
87
|
*/
|
|
88
88
|
columnIndex?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Piker组件的样式,PickerPanel的主题定制与css变量传入的Tokens有关,需要透传计算
|
|
91
|
+
*/
|
|
92
|
+
pickerStyle?: React.CSSProperties;
|
|
89
93
|
/**
|
|
90
94
|
* 选择选项时的回调
|
|
91
95
|
*/
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
background-image:
|
|
22
22
|
linear-gradient(
|
|
23
23
|
180deg,
|
|
24
|
-
var(--bui-color-bg-
|
|
25
|
-
var(--bui-color-bg-
|
|
24
|
+
var(--bui-color-bg-alpha-light-9),
|
|
25
|
+
var(--bui-color-bg-alpha-light-3)),
|
|
26
26
|
linear-gradient(
|
|
27
27
|
0deg,
|
|
28
|
-
var(--bui-color-bg-
|
|
29
|
-
var(--bui-color-bg-
|
|
28
|
+
var(--bui-color-bg-alpha-light-9),
|
|
29
|
+
var(--bui-color-bg-alpha-light-3));
|
|
30
30
|
background-position: top, bottom;
|
|
31
31
|
background-size: 100% var(--indicator-top);
|
|
32
32
|
background-repeat: no-repeat;
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
.bui-picker-panel-indicator {
|
|
36
36
|
position: absolute;
|
|
37
37
|
top: var(--indicator-top);
|
|
38
|
-
height: var(--
|
|
38
|
+
height: var(--option-height);
|
|
39
39
|
width: 100%;
|
|
40
|
-
border-top: 1px solid var(--
|
|
41
|
-
border-bottom: 1px solid var(--
|
|
40
|
+
border-top: 1px solid var(--bui-color-border-default);
|
|
41
|
+
border-bottom: 1px solid var(--bui-color-border-default);
|
|
42
42
|
}
|
|
43
43
|
.bui-picker-panel-option {
|
|
44
44
|
position: absolute;
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
text-align: center;
|
|
48
48
|
height: var(--option-height);
|
|
49
49
|
line-height: var(--option-height);
|
|
50
|
-
color: var(--
|
|
50
|
+
color: var(--bui-color-fg-default);
|
|
51
51
|
font-size: var(--option-font-size);
|
|
52
52
|
backface-visibility: hidden;
|
|
53
53
|
width: auto;
|
|
@@ -63,25 +63,31 @@ var import_PickerPanel = require("./PickerPanel.css");
|
|
|
63
63
|
const prefixCls = "bui-picker-panel";
|
|
64
64
|
const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
65
65
|
(props, ref) => {
|
|
66
|
+
var _b;
|
|
66
67
|
const _a = props, {
|
|
67
68
|
options = [],
|
|
68
69
|
defaultValue,
|
|
69
70
|
onSelect,
|
|
70
|
-
columnIndex
|
|
71
|
+
columnIndex,
|
|
72
|
+
pickerStyle
|
|
71
73
|
} = _a, others = __objRest(_a, [
|
|
72
74
|
"options",
|
|
73
75
|
"defaultValue",
|
|
74
76
|
"onSelect",
|
|
75
|
-
"columnIndex"
|
|
77
|
+
"columnIndex",
|
|
78
|
+
"pickerStyle"
|
|
76
79
|
]);
|
|
77
80
|
const touch = (0, import_utils.useTouch)();
|
|
78
81
|
let timer;
|
|
79
82
|
const INERTIA_TIME = 200;
|
|
80
83
|
const INERTIA_DISTANCE = 15;
|
|
81
84
|
const DEFAULT_DURATION = 200;
|
|
82
|
-
const LINE_SPACING = 36;
|
|
83
85
|
const ROTATION = 20;
|
|
84
86
|
const TOUCH_END = "end";
|
|
87
|
+
const DEFAULT_LINE_SPACING = 36;
|
|
88
|
+
const LINE_SPACING_STR = (_b = ((pickerStyle == null ? void 0 : pickerStyle["--option-height"]) ? `${pickerStyle == null ? void 0 : pickerStyle["--option-height"]}` : `${DEFAULT_LINE_SPACING}`).match(/\d+/)) == null ? void 0 : _b[0];
|
|
89
|
+
const LINE_SPACING = parseInt(LINE_SPACING_STR, 10);
|
|
90
|
+
const INDICATOR_OFFSET = LINE_SPACING * 108 / DEFAULT_LINE_SPACING;
|
|
85
91
|
const [startY, setStartY] = (0, import_react.useState)(0);
|
|
86
92
|
const [currIndex, setCurrIndex] = (0, import_react.useState)(1);
|
|
87
93
|
const [startTime, setStartTime] = (0, import_react.useState)(0);
|
|
@@ -197,17 +203,17 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
197
203
|
}, 0);
|
|
198
204
|
};
|
|
199
205
|
(0, import_react.useEffect)(() => {
|
|
200
|
-
var _a2,
|
|
206
|
+
var _a2, _b2, _c;
|
|
201
207
|
(_a2 = PickerPanelRef.current) == null ? void 0 : _a2.addEventListener("touchstart", panelTouchStart);
|
|
202
|
-
(
|
|
208
|
+
(_b2 = PickerPanelRef.current) == null ? void 0 : _b2.addEventListener("touchmove", panelTouchMove);
|
|
203
209
|
(_c = PickerPanelRef.current) == null ? void 0 : _c.addEventListener("touchend", panelTouchEnd);
|
|
204
210
|
return () => {
|
|
205
|
-
var _a3,
|
|
211
|
+
var _a3, _b3, _c2;
|
|
206
212
|
(_a3 = PickerPanelRef.current) == null ? void 0 : _a3.removeEventListener(
|
|
207
213
|
"touchstart",
|
|
208
214
|
panelTouchStart
|
|
209
215
|
);
|
|
210
|
-
(
|
|
216
|
+
(_b3 = PickerPanelRef.current) == null ? void 0 : _b3.removeEventListener(
|
|
211
217
|
"touchmove",
|
|
212
218
|
panelTouchMove
|
|
213
219
|
);
|
|
@@ -253,7 +259,7 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
253
259
|
}),
|
|
254
260
|
key: `${item == null ? void 0 : item.value}-${i}`,
|
|
255
261
|
style: {
|
|
256
|
-
transform: `rotate3d(1, 0, 0, ${-ROTATION * (i + 1)}deg) translate3d(0px, 0px,
|
|
262
|
+
transform: `rotate3d(1, 0, 0, ${-ROTATION * (i + 1)}deg) translate3d(0px, 0px, ${INDICATOR_OFFSET}px)`
|
|
257
263
|
}
|
|
258
264
|
},
|
|
259
265
|
item == null ? void 0 : item.label
|