@bifrostui/react 1.4.7-beta.0 → 2.0.0-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 +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.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 -43
- package/dist/DatePicker/DatePicker.types.js +0 -35
- package/dist/DatePicker/index.d.ts +0 -2
- package/dist/DatePicker/index.js +0 -41
- 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 -246
- 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 -83
- package/dist/SwipeAction/SwipeAction.types.js +0 -39
- 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/index.d.ts +0 -4
- package/dist/SwipeAction/index.js +0 -45
- 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 -310
- package/es/DatePicker/DatePicker.types.d.ts +0 -43
- package/es/DatePicker/DatePicker.types.js +0 -1
- package/es/DatePicker/index.d.ts +0 -2
- package/es/DatePicker/index.js +0 -6
- 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 -223
- 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 -337
- package/es/SwipeAction/SwipeAction.types.d.ts +0 -83
- 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/index.d.ts +0 -4
- package/es/SwipeAction/index.js +0 -9
- package/es/Tabs/utils/scroll.d.ts +0 -2
- package/es/Tabs/utils/scroll.js +0 -36
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import React, { Ref } from 'react';
|
|
2
|
-
import { OverrideProps } from '@bifrostui/types';
|
|
3
|
-
import { DesktopPickerProps } from '../DesktopPicker';
|
|
4
|
-
import { CalendarProps } from '../Calendar';
|
|
5
|
-
export type IDateTimePickerValue = Date | null;
|
|
6
|
-
export interface IDateTimePickerInstance {
|
|
7
|
-
/** 日期对象 */
|
|
8
|
-
day: Date;
|
|
9
|
-
/** 是否禁用 */
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface IDateTimePickerCustomIconProps {
|
|
13
|
-
/**
|
|
14
|
-
* 是否是最小时间
|
|
15
|
-
*/
|
|
16
|
-
isMinMonth?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* 是否是最大时间
|
|
19
|
-
*/
|
|
20
|
-
isMaxMonth?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface IDateTimePickerCalendarProps {
|
|
23
|
-
/**
|
|
24
|
-
* 是否隐藏当前月之外的日期,默认为false
|
|
25
|
-
*/
|
|
26
|
-
hideDaysOutsideCurrentMonth?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* 高亮的日期,默认为today
|
|
29
|
-
* today 若选中的非当天,则当天高亮显示,若选中的是当天,则当天展示选中态
|
|
30
|
-
* weekend 可选的周末高亮显示
|
|
31
|
-
*/
|
|
32
|
-
highlightDate?: 'today' | 'weekend';
|
|
33
|
-
/**
|
|
34
|
-
* 自定义日期单元格的内容
|
|
35
|
-
*/
|
|
36
|
-
dateRender?: (currentDate: IDateTimePickerInstance) => React.ReactNode;
|
|
37
|
-
/**
|
|
38
|
-
* 自定义周单元格的内容
|
|
39
|
-
*/
|
|
40
|
-
weekRender?: (week: string) => React.ReactNode;
|
|
41
|
-
}
|
|
42
|
-
export type DateTimePickerProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
43
|
-
props: P & {
|
|
44
|
-
/**
|
|
45
|
-
* 默认选中的值,当组件非受控时使用
|
|
46
|
-
*/
|
|
47
|
-
defaultValue?: IDateTimePickerValue;
|
|
48
|
-
/**
|
|
49
|
-
* 选中的值,当组件受控时使用
|
|
50
|
-
*/
|
|
51
|
-
value?: IDateTimePickerValue;
|
|
52
|
-
/**
|
|
53
|
-
* 输入框占位内容
|
|
54
|
-
*/
|
|
55
|
-
placeholder?: string;
|
|
56
|
-
/**
|
|
57
|
-
* 可选择的最小日期,默认为当前日期
|
|
58
|
-
* 渲染指定月时:value=null并指定minDate
|
|
59
|
-
*/
|
|
60
|
-
minDate?: Date;
|
|
61
|
-
/**
|
|
62
|
-
* 可选择的最大日期,默认为当前日期的一年后
|
|
63
|
-
*/
|
|
64
|
-
maxDate?: Date;
|
|
65
|
-
/**
|
|
66
|
-
* 弹层是否打开
|
|
67
|
-
*/
|
|
68
|
-
open?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* 输入框icon
|
|
71
|
-
*/
|
|
72
|
-
icon?: React.ReactNode;
|
|
73
|
-
/**
|
|
74
|
-
* inputRef
|
|
75
|
-
*/
|
|
76
|
-
inputRef?: Ref<HTMLInputElement>;
|
|
77
|
-
/**
|
|
78
|
-
* inputProp
|
|
79
|
-
*/
|
|
80
|
-
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
81
|
-
/**
|
|
82
|
-
* 选择器类型
|
|
83
|
-
*/
|
|
84
|
-
views?: Array<'year' | 'month' | 'day' | 'hour' | 'minute' | 'second'>;
|
|
85
|
-
/**
|
|
86
|
-
* 头部操作栏左边图标
|
|
87
|
-
*/
|
|
88
|
-
headerBarLeftIcon?: (options: IDateTimePickerCustomIconProps) => React.ReactNode;
|
|
89
|
-
/**
|
|
90
|
-
* 头部操作栏右边图标
|
|
91
|
-
*/
|
|
92
|
-
headerBarRightIcon?: (options: IDateTimePickerCustomIconProps) => React.ReactNode;
|
|
93
|
-
/**
|
|
94
|
-
* 是否禁用日期选择器
|
|
95
|
-
*/
|
|
96
|
-
disabled?: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* 不可选择的日期
|
|
99
|
-
*/
|
|
100
|
-
disabledDate?: (currentDate: Date) => boolean;
|
|
101
|
-
/**
|
|
102
|
-
* 自定义月份单元格的内容
|
|
103
|
-
*/
|
|
104
|
-
monthRender?: ({ month, currentDate, }: {
|
|
105
|
-
month: string | number;
|
|
106
|
-
currentDate: IDateTimePickerInstance;
|
|
107
|
-
}) => React.ReactNode;
|
|
108
|
-
/**
|
|
109
|
-
* 自定义年份单元格的内容
|
|
110
|
-
*/
|
|
111
|
-
yearRender?: ({ year, currentDate, }: {
|
|
112
|
-
year: string | number;
|
|
113
|
-
currentDate: IDateTimePickerInstance;
|
|
114
|
-
}) => React.ReactNode;
|
|
115
|
-
/**
|
|
116
|
-
* 日期发生变化的回调
|
|
117
|
-
*/
|
|
118
|
-
onChange?: (e: React.SyntheticEvent, data: {
|
|
119
|
-
value: IDateTimePickerValue;
|
|
120
|
-
}) => void;
|
|
121
|
-
/**
|
|
122
|
-
* 选择日期后是否立刻关闭
|
|
123
|
-
*/
|
|
124
|
-
closeOnSelect?: boolean;
|
|
125
|
-
/**
|
|
126
|
-
* 禁用弹层选择功能
|
|
127
|
-
*/
|
|
128
|
-
disableOpenPicker?: boolean;
|
|
129
|
-
/**
|
|
130
|
-
* 日期格式化
|
|
131
|
-
*/
|
|
132
|
-
format?: string;
|
|
133
|
-
/**
|
|
134
|
-
* 弹层关闭的回调
|
|
135
|
-
*/
|
|
136
|
-
onClose?: () => void;
|
|
137
|
-
/**
|
|
138
|
-
* 弹层打开的回调
|
|
139
|
-
*/
|
|
140
|
-
onOpen?: () => void;
|
|
141
|
-
/**
|
|
142
|
-
* 月份切换的回调
|
|
143
|
-
*/
|
|
144
|
-
onMonthChange?: (e: React.SyntheticEvent, data: {
|
|
145
|
-
value: Date;
|
|
146
|
-
}) => void;
|
|
147
|
-
/**
|
|
148
|
-
* 年份切换的回调
|
|
149
|
-
*/
|
|
150
|
-
onYearChange?: (e: React.SyntheticEvent, data: {
|
|
151
|
-
value: Date;
|
|
152
|
-
}) => void;
|
|
153
|
-
/**
|
|
154
|
-
* DesktopPickerProps
|
|
155
|
-
*/
|
|
156
|
-
DesktopPickerProps?: DesktopPickerProps;
|
|
157
|
-
/**
|
|
158
|
-
* CalendarProps
|
|
159
|
-
*/
|
|
160
|
-
CalendarProps?: CalendarProps;
|
|
161
|
-
};
|
|
162
|
-
defaultComponent: D;
|
|
163
|
-
}, D>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
:root,
|
|
2
|
-
page,
|
|
3
|
-
xhs-page {
|
|
4
|
-
--bui-datetime-picker-height: var(--bui-input-height, 32px);
|
|
5
|
-
--bui-datetime-picker-min-width: var(--bui-input-min-width, 100px);
|
|
6
|
-
--bui-datetime-picker-icon-size: var(--bui-title-size-3, 16px);
|
|
7
|
-
--bui-datetime-picker-font-size: var(--bui-title-size-3, 16px);
|
|
8
|
-
--bui-datetime-picker-container-padding: var(--bui-spacing-md, 9px);
|
|
9
|
-
--bui-datetime-picker-bg: var(--bui-color-bg-view);
|
|
10
|
-
--bui-datetime-picker-font-family: var(--bui-font-family);
|
|
11
|
-
--bui-datetime-picker-border: 1px solid var(--bui-color-border-default);
|
|
12
|
-
--bui-datetime-picker-shadow: 0 0 0 2px var(--bui-color-bg-default);
|
|
13
|
-
--bui-datetime-picker-disabled-color: var(--bui-color-fg-subtle);
|
|
14
|
-
}
|
|
15
|
-
.bui-datetime-picker {
|
|
16
|
-
position: relative;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
height: var(--bui-datetime-picker-height);
|
|
19
|
-
min-width: 100px;
|
|
20
|
-
font-size: var(--bui-datetime-picker-font-size);
|
|
21
|
-
border-radius: 5px;
|
|
22
|
-
background-color: var(--bui-datetime-picker-bg);
|
|
23
|
-
font-family: var(--bui-datetime-picker-font-family);
|
|
24
|
-
box-sizing: border-box;
|
|
25
|
-
border: var(--bui-datetime-picker-border);
|
|
26
|
-
}
|
|
27
|
-
.bui-datetime-picker:active,
|
|
28
|
-
.bui-datetime-picker-active {
|
|
29
|
-
box-shadow: var(--bui-datetime-picker-shadow);
|
|
30
|
-
}
|
|
31
|
-
.bui-datetime-picker-invalid {
|
|
32
|
-
border: 1px solid var(--bui-color-danger);
|
|
33
|
-
}
|
|
34
|
-
.bui-datetime-picker-icon {
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
font-size: var(--bui-datetime-picker-icon-size);
|
|
38
|
-
}
|
|
39
|
-
.bui-datetime-picker-container {
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
padding: 0 10px;
|
|
43
|
-
height: 100%;
|
|
44
|
-
}
|
|
45
|
-
.bui-datetime-picker-input {
|
|
46
|
-
display: flex;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
align-items: center;
|
|
49
|
-
flex: 1;
|
|
50
|
-
height: 100%;
|
|
51
|
-
background-color: transparent;
|
|
52
|
-
outline: none;
|
|
53
|
-
border: 0;
|
|
54
|
-
}
|
|
55
|
-
.bui-datetime-picker-box {
|
|
56
|
-
display: flex;
|
|
57
|
-
width: 420px;
|
|
58
|
-
}
|
|
59
|
-
.bui-datetime-picker.bui-datetime-picker-disabled {
|
|
60
|
-
pointer-events: none;
|
|
61
|
-
box-shadow: none;
|
|
62
|
-
background-color: rgba(188, 188, 188, 0.2);
|
|
63
|
-
}
|
|
64
|
-
.bui-datetime-picker.bui-datetime-picker-disabled input {
|
|
65
|
-
color: var(--bui-datetime-picker-disabled-color);
|
|
66
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DesktopPickerProps } from './DesktopPicker.types';
|
|
3
|
-
import './index.less';
|
|
4
|
-
declare const DesktopPicker: React.ForwardRefExoticComponent<Omit<DesktopPickerProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
export default DesktopPicker;
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __async = (__this, __arguments, generator) => {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
var fulfilled = (value) => {
|
|
35
|
-
try {
|
|
36
|
-
step(generator.next(value));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
reject(e);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var rejected = (value) => {
|
|
42
|
-
try {
|
|
43
|
-
step(generator.throw(value));
|
|
44
|
-
} catch (e) {
|
|
45
|
-
reject(e);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
import clsx from "clsx";
|
|
53
|
-
import React, {
|
|
54
|
-
useEffect,
|
|
55
|
-
useMemo,
|
|
56
|
-
useRef,
|
|
57
|
-
useState
|
|
58
|
-
} from "react";
|
|
59
|
-
import {
|
|
60
|
-
getStylesAndLocation,
|
|
61
|
-
isMini,
|
|
62
|
-
getRootContainer,
|
|
63
|
-
useDidMountEffect
|
|
64
|
-
} from "@bifrostui/utils";
|
|
65
|
-
import Backdrop from "../Backdrop";
|
|
66
|
-
import Portal from "../Portal";
|
|
67
|
-
import calcAfterMounted from "./utils/calcAfterMounted";
|
|
68
|
-
import "./index.css";
|
|
69
|
-
const prefixCls = "bui-desktop-picker";
|
|
70
|
-
const directionMap = {
|
|
71
|
-
bottom: "top",
|
|
72
|
-
top: "bottom"
|
|
73
|
-
};
|
|
74
|
-
const DesktopPicker = /* @__PURE__ */ React.forwardRef(
|
|
75
|
-
(props, ref) => {
|
|
76
|
-
const _a = props, {
|
|
77
|
-
className,
|
|
78
|
-
open,
|
|
79
|
-
container,
|
|
80
|
-
children,
|
|
81
|
-
defaultDirection = "bottom",
|
|
82
|
-
inheritWidth = true,
|
|
83
|
-
content,
|
|
84
|
-
miniBackdropInvisible = false,
|
|
85
|
-
onClose,
|
|
86
|
-
onMount,
|
|
87
|
-
onUnmounted,
|
|
88
|
-
containerWidth = "auto",
|
|
89
|
-
BackdropProps
|
|
90
|
-
} = _a, others = __objRest(_a, [
|
|
91
|
-
"className",
|
|
92
|
-
"open",
|
|
93
|
-
"container",
|
|
94
|
-
"children",
|
|
95
|
-
"defaultDirection",
|
|
96
|
-
"inheritWidth",
|
|
97
|
-
"content",
|
|
98
|
-
"miniBackdropInvisible",
|
|
99
|
-
"onClose",
|
|
100
|
-
"onMount",
|
|
101
|
-
"onUnmounted",
|
|
102
|
-
"containerWidth",
|
|
103
|
-
"BackdropProps"
|
|
104
|
-
]);
|
|
105
|
-
const contentRef = useRef(null);
|
|
106
|
-
const nodeRef = useRef(null);
|
|
107
|
-
const renderChildren = React.cloneElement(children, {
|
|
108
|
-
ref: nodeRef
|
|
109
|
-
});
|
|
110
|
-
const [contentPosition, setContentPosition] = useState(
|
|
111
|
-
"bottom"
|
|
112
|
-
);
|
|
113
|
-
const [transform, setTransform] = useState(false);
|
|
114
|
-
const getContentDirection = () => __async(void 0, null, function* () {
|
|
115
|
-
const curScrollRoot = getRootContainer(container);
|
|
116
|
-
const result = yield getStylesAndLocation({
|
|
117
|
-
scrollRoot: container && curScrollRoot,
|
|
118
|
-
childrenRef: nodeRef,
|
|
119
|
-
arrowDirection: defaultDirection,
|
|
120
|
-
arrowLocation: "none",
|
|
121
|
-
offsetSpacing: 0,
|
|
122
|
-
tipRef: contentRef
|
|
123
|
-
});
|
|
124
|
-
if (!result)
|
|
125
|
-
return;
|
|
126
|
-
const { newArrowDirection, styles, childrenStyle } = result;
|
|
127
|
-
const element = contentRef.current;
|
|
128
|
-
element.style.transform = styles == null ? void 0 : styles.transform;
|
|
129
|
-
element.style.visibility = styles == null ? void 0 : styles.visibility;
|
|
130
|
-
element.style.top = styles == null ? void 0 : styles.top;
|
|
131
|
-
element.style.left = styles == null ? void 0 : styles.left;
|
|
132
|
-
if (inheritWidth) {
|
|
133
|
-
element.style.width = childrenStyle == null ? void 0 : childrenStyle.width;
|
|
134
|
-
}
|
|
135
|
-
setContentPosition(newArrowDirection);
|
|
136
|
-
});
|
|
137
|
-
useEffect(() => {
|
|
138
|
-
if (!isMini && open) {
|
|
139
|
-
const addEventListenerClick = (e) => {
|
|
140
|
-
var _a2;
|
|
141
|
-
if (!((_a2 = nodeRef.current) == null ? void 0 : _a2.contains(e.target))) {
|
|
142
|
-
onClose(null, { value: !open });
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
getContentDirection();
|
|
146
|
-
const containerDom = getRootContainer(container, window);
|
|
147
|
-
containerDom.addEventListener("scroll", getContentDirection);
|
|
148
|
-
window.addEventListener("resize", getContentDirection);
|
|
149
|
-
window.addEventListener("click", addEventListenerClick);
|
|
150
|
-
return () => {
|
|
151
|
-
containerDom.removeEventListener("scroll", getContentDirection);
|
|
152
|
-
window.removeEventListener("resize", getContentDirection);
|
|
153
|
-
window.removeEventListener("click", addEventListenerClick);
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
if (isMini && open) {
|
|
157
|
-
calcAfterMounted(getContentDirection);
|
|
158
|
-
}
|
|
159
|
-
}, [container, open]);
|
|
160
|
-
const renderContent = () => {
|
|
161
|
-
return /* @__PURE__ */ React.createElement(
|
|
162
|
-
"div",
|
|
163
|
-
{
|
|
164
|
-
className: clsx(
|
|
165
|
-
`${prefixCls}-container`,
|
|
166
|
-
`${prefixCls}-${contentPosition}`
|
|
167
|
-
),
|
|
168
|
-
style: {
|
|
169
|
-
width: containerWidth
|
|
170
|
-
},
|
|
171
|
-
ref: contentRef
|
|
172
|
-
},
|
|
173
|
-
/* @__PURE__ */ React.createElement(
|
|
174
|
-
"div",
|
|
175
|
-
{
|
|
176
|
-
className: `${prefixCls}-container-${transform && open ? "open" : "close"} ${prefixCls}-container-content`,
|
|
177
|
-
style: {
|
|
178
|
-
transformOrigin: `${directionMap[contentPosition]} center`
|
|
179
|
-
},
|
|
180
|
-
onTransitionEnd: () => {
|
|
181
|
-
if (!open) {
|
|
182
|
-
setTransform(false);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
content
|
|
187
|
-
)
|
|
188
|
-
);
|
|
189
|
-
};
|
|
190
|
-
useEffect(() => {
|
|
191
|
-
if (open) {
|
|
192
|
-
calcAfterMounted(() => {
|
|
193
|
-
setTransform(true);
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
}, [open]);
|
|
197
|
-
const renderContainer = useMemo(() => {
|
|
198
|
-
return open || transform;
|
|
199
|
-
}, [open, transform]);
|
|
200
|
-
useDidMountEffect(() => {
|
|
201
|
-
if (!renderContainer) {
|
|
202
|
-
onUnmounted == null ? void 0 : onUnmounted();
|
|
203
|
-
} else {
|
|
204
|
-
onMount == null ? void 0 : onMount();
|
|
205
|
-
}
|
|
206
|
-
}, [renderContainer]);
|
|
207
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", __spreadValues({ ref, className: clsx(prefixCls, className) }, others), renderChildren), !isMini && renderContainer && /* @__PURE__ */ React.createElement(Portal, null, renderContent()), isMini && renderContainer && /* @__PURE__ */ React.createElement(Portal, null, renderContent(), !miniBackdropInvisible && /* @__PURE__ */ React.createElement(
|
|
208
|
-
Backdrop,
|
|
209
|
-
__spreadProps(__spreadValues({}, BackdropProps), {
|
|
210
|
-
invisible: true,
|
|
211
|
-
open,
|
|
212
|
-
onClick: (e) => onClose(e, { value: !open })
|
|
213
|
-
})
|
|
214
|
-
)));
|
|
215
|
-
}
|
|
216
|
-
);
|
|
217
|
-
DesktopPicker.displayName = "BUIDesktopPicker";
|
|
218
|
-
var DesktopPicker_default = DesktopPicker;
|
|
219
|
-
export {
|
|
220
|
-
DesktopPicker_default as default
|
|
221
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { OverrideProps } from '@bifrostui/types';
|
|
3
|
-
import { BackdropProps } from '../Backdrop/Backdrop.types';
|
|
4
|
-
export type DesktopPickerProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
5
|
-
props: P & {
|
|
6
|
-
/**
|
|
7
|
-
* 是否继承宽度
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
inheritWidth?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* 是否打开
|
|
13
|
-
*/
|
|
14
|
-
open: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* 浮层的内容
|
|
17
|
-
*/
|
|
18
|
-
content?: React.ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
* 浮层宽度
|
|
21
|
-
*/
|
|
22
|
-
containerWidth?: number;
|
|
23
|
-
/**
|
|
24
|
-
* 是否指定滚动容器
|
|
25
|
-
*/
|
|
26
|
-
container?: HTMLElement | (() => HTMLElement);
|
|
27
|
-
/**
|
|
28
|
-
* 小程序是否使用backdrop
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
miniBackdropInvisible?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* 关闭浮层
|
|
34
|
-
*/
|
|
35
|
-
onClose?: (e: React.MouseEvent<any>, data: {
|
|
36
|
-
value: boolean;
|
|
37
|
-
}) => void;
|
|
38
|
-
/**
|
|
39
|
-
* 打开后动画开始的回调
|
|
40
|
-
*/
|
|
41
|
-
onMount?: () => void;
|
|
42
|
-
/**
|
|
43
|
-
* 卸载后动画结束的回调
|
|
44
|
-
*/
|
|
45
|
-
onUnmounted?: () => void;
|
|
46
|
-
/**
|
|
47
|
-
* 默认的浮层位置
|
|
48
|
-
* @default bottom
|
|
49
|
-
*/
|
|
50
|
-
defaultDirection?: 'top' | 'bottom';
|
|
51
|
-
/**
|
|
52
|
-
* 透传浮层的Props
|
|
53
|
-
*/
|
|
54
|
-
BackdropProps?: BackdropProps;
|
|
55
|
-
};
|
|
56
|
-
defaultComponent: D;
|
|
57
|
-
}, D>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
:root,
|
|
2
|
-
page,
|
|
3
|
-
xhs-page {
|
|
4
|
-
--bui-desktop-picker-zindex: var(--bui-z-index-tooltip);
|
|
5
|
-
--bui-desktop-picker-bg: var(--bui-color-bg-view);
|
|
6
|
-
--bui-desktop-picker-shadow: 0 0 0 2px var(--bui-color-bg-default);
|
|
7
|
-
}
|
|
8
|
-
.bui-desktop-picker {
|
|
9
|
-
position: relative;
|
|
10
|
-
height: 100%;
|
|
11
|
-
}
|
|
12
|
-
.bui-desktop-picker-container {
|
|
13
|
-
position: absolute;
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
visibility: hidden;
|
|
16
|
-
z-index: var(--bui-desktop-picker-zindex);
|
|
17
|
-
}
|
|
18
|
-
.bui-desktop-picker-container-content {
|
|
19
|
-
border-radius: 3px;
|
|
20
|
-
background-color: var(--bui-desktop-picker-bg);
|
|
21
|
-
box-shadow: var(--bui-desktop-picker-shadow);
|
|
22
|
-
}
|
|
23
|
-
.bui-desktop-picker-container-open {
|
|
24
|
-
transform: none;
|
|
25
|
-
transition: opacity 321ms cubic-bezier(0.4, 0, 0.2, 1), transform 214ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
26
|
-
}
|
|
27
|
-
.bui-desktop-picker-container-close {
|
|
28
|
-
opacity: 0;
|
|
29
|
-
transform: scale(0.75, 0.5625);
|
|
30
|
-
transition: opacity 321ms cubic-bezier(0.4, 0, 0.2, 1), transform 214ms cubic-bezier(0.4, 0, 0.2, 1) 107ms;
|
|
31
|
-
}
|
|
32
|
-
.bui-desktop-picker-top {
|
|
33
|
-
margin-top: -6px;
|
|
34
|
-
}
|
|
35
|
-
.bui-desktop-picker-bottom {
|
|
36
|
-
margin-top: 6px;
|
|
37
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TimePickerProps } from './DesktopTimePicker.types';
|
|
3
|
-
import './index.less';
|
|
4
|
-
declare const DesktopTimePicker: React.ForwardRefExoticComponent<Omit<TimePickerProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
export default DesktopTimePicker;
|