@bifrostui/react 1.4.8-beta.0 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionSheet/ActionSheet.css +2 -2
- package/dist/ActionSheet/ActionSheetItem.js +3 -8
- package/dist/Avatar/Avatar.js +3 -8
- package/dist/Avatar/AvatarGroup.js +2 -6
- package/dist/Badge/Badge.js +3 -8
- package/dist/Button/Button.css +77 -78
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +4 -10
- package/dist/Button/Button.types.d.ts +8 -7
- package/dist/Calendar/Calendar.js +7 -19
- package/dist/Calendar/Calendar.types.d.ts +0 -5
- package/dist/Card/Card.css +1 -1
- package/dist/Card/CardContent.css +1 -2
- package/dist/Card/CardFooter.css +2 -4
- package/dist/Card/CardHeader.css +4 -5
- package/dist/Checkbox/Checkbox.js +2 -6
- package/dist/Checkbox/CheckboxGroup.js +4 -7
- package/dist/Collapse/Collapse.css +1 -0
- package/dist/Collapse/Collapse.d.ts +1 -1
- package/dist/Collapse/Collapse.js +8 -11
- package/dist/CollapsePanel/CollapsePanel.css +2 -4
- package/dist/CollapsePanel/CollapsePanelItem.js +45 -46
- package/dist/Countdown/Countdown.js +5 -12
- package/dist/Dialog/FunctionalDialog.js +1 -1
- package/dist/Divider/Divider.js +8 -5
- package/dist/Drawer/Drawer.js +4 -10
- package/dist/Fade/Fade.js +52 -56
- package/dist/IconButton/IconButton.js +5 -12
- package/dist/Image/Image.js +112 -119
- package/dist/Input/Input.js +4 -10
- package/dist/List/List.js +3 -8
- package/dist/List/ListItem.js +42 -44
- package/dist/List/ListItemContent.js +1 -4
- package/dist/List/ListItemExtra.js +9 -4
- package/dist/List/ListItemFooter.js +9 -4
- package/dist/List/ListItemHeader.js +9 -4
- package/dist/Loading/Loading.js +13 -4
- package/dist/Modal/Modal.js +0 -6
- package/dist/Modal/Modal.miniapp.js +4 -10
- package/dist/NavBar/NavBar.js +0 -1
- package/dist/Picker/Picker.css +0 -5
- package/dist/Picker/Picker.js +5 -27
- package/dist/Picker/Picker.types.d.ts +2 -15
- package/dist/Picker/PickerPanel.css +0 -4
- package/dist/Picker/PickerPanel.js +6 -7
- package/dist/Popover/Popover.css +5 -5
- package/dist/Popover/Popover.js +27 -70
- package/dist/Portal/Portal.miniapp.js +4 -7
- package/dist/Radio/Radio.css +0 -1
- package/dist/Radio/Radio.js +2 -6
- package/dist/Radio/RadioGroup.js +0 -3
- package/dist/Rating/Rating.js +8 -18
- package/dist/ScrollView/ScrollView.js +11 -24
- package/dist/ScrollView/ScrollView.types.d.ts +1 -0
- package/dist/Select/Select.css +4 -1
- package/dist/Select/Select.js +41 -68
- package/dist/Skeleton/Skeleton.js +5 -9
- package/dist/Slide/Slide.js +69 -74
- package/dist/Slider/Slider.js +11 -27
- package/dist/Steps/Step.js +81 -82
- package/dist/Steps/Steps.d.ts +1 -1
- package/dist/Steps/Steps.js +57 -60
- package/dist/Switch/Switch.js +75 -78
- package/dist/TabBar/TabBar.js +3 -8
- package/dist/Tabs/Tab.css +10 -16
- package/dist/Tabs/Tab.js +2 -3
- package/dist/Tabs/Tabs.css +13 -22
- package/dist/Tabs/Tabs.js +39 -70
- package/dist/Tabs/Tabs.types.d.ts +0 -10
- package/dist/Tabs/utils/bound.d.ts +1 -0
- package/dist/{DesktopPicker/utils/calcAfterMounted.js → Tabs/utils/bound.js} +14 -7
- package/dist/Tag/Tag.css +1 -1
- package/dist/Tag/Tag.js +2 -6
- package/dist/TextArea/TextArea.js +5 -12
- package/dist/Toast/FunctionalToast.js +1 -1
- package/dist/Toast/Toast.css +1 -0
- package/dist/Tooltip/Tooltip.css +5 -5
- package/dist/Tooltip/Tooltip.js +27 -70
- package/dist/Transition/TransitionCore.js +3 -8
- package/dist/index.d.ts +0 -6
- package/dist/index.js +1 -13
- package/dist/locales/base.d.ts +0 -11
- package/dist/locales/en-US.js +0 -24
- package/dist/locales/zh-CN.js +0 -24
- package/dist/locales/zh-TW.js +0 -24
- package/es/ActionSheet/ActionSheet.css +2 -2
- package/es/ActionSheet/ActionSheetItem.js +3 -8
- package/es/Avatar/Avatar.js +3 -8
- package/es/Avatar/AvatarGroup.js +2 -6
- package/es/Badge/Badge.js +3 -8
- package/es/Button/Button.css +77 -78
- package/es/Button/Button.d.ts +1 -1
- package/es/Button/Button.js +3 -9
- package/es/Button/Button.types.d.ts +8 -7
- package/es/Calendar/Calendar.js +7 -19
- package/es/Calendar/Calendar.types.d.ts +0 -5
- package/es/Card/Card.css +1 -1
- package/es/Card/CardContent.css +1 -2
- package/es/Card/CardFooter.css +2 -4
- package/es/Card/CardHeader.css +4 -5
- package/es/Checkbox/Checkbox.js +2 -6
- package/es/Checkbox/CheckboxGroup.js +4 -7
- package/es/Collapse/Collapse.css +1 -0
- package/es/Collapse/Collapse.d.ts +1 -1
- package/es/Collapse/Collapse.js +8 -11
- package/es/CollapsePanel/CollapsePanel.css +2 -4
- package/es/CollapsePanel/CollapsePanelItem.js +45 -46
- package/es/Countdown/Countdown.js +5 -12
- package/es/Dialog/FunctionalDialog.js +2 -2
- package/es/Divider/Divider.js +8 -5
- package/es/Drawer/Drawer.js +4 -10
- package/es/Fade/Fade.js +52 -56
- package/es/IconButton/IconButton.js +5 -12
- package/es/Image/Image.js +112 -119
- package/es/Input/Input.js +4 -10
- package/es/List/List.js +3 -8
- package/es/List/ListItem.js +42 -44
- package/es/List/ListItemContent.js +1 -4
- package/es/List/ListItemExtra.js +9 -4
- package/es/List/ListItemFooter.js +9 -4
- package/es/List/ListItemHeader.js +9 -4
- package/es/Loading/Loading.js +13 -4
- package/es/Modal/Modal.js +0 -6
- package/es/Modal/Modal.miniapp.d.ts +1 -1
- package/es/Modal/Modal.miniapp.js +4 -10
- package/es/NavBar/NavBar.js +0 -1
- package/es/Picker/Picker.css +0 -5
- package/es/Picker/Picker.js +5 -27
- package/es/Picker/Picker.types.d.ts +2 -15
- package/es/Picker/PickerPanel.css +0 -4
- package/es/Picker/PickerPanel.js +6 -7
- package/es/Popover/Popover.css +5 -5
- package/es/Popover/Popover.js +29 -73
- package/es/Portal/Portal.miniapp.js +5 -8
- package/es/Radio/Radio.css +0 -1
- package/es/Radio/Radio.js +2 -6
- package/es/Radio/RadioGroup.js +0 -3
- package/es/Rating/Rating.js +8 -18
- package/es/ScrollView/ScrollView.js +11 -24
- package/es/ScrollView/ScrollView.types.d.ts +1 -0
- package/es/Select/Select.css +4 -1
- package/es/Select/Select.js +42 -68
- package/es/Skeleton/Skeleton.js +5 -9
- package/es/Slide/Slide.js +69 -74
- package/es/Slider/Slider.js +12 -30
- package/es/Steps/Step.js +81 -82
- package/es/Steps/Steps.d.ts +1 -1
- package/es/Steps/Steps.js +57 -60
- package/es/Switch/Switch.js +75 -78
- package/es/TabBar/TabBar.js +3 -8
- package/es/Tabs/Tab.css +10 -16
- package/es/Tabs/Tab.js +2 -3
- package/es/Tabs/Tabs.css +13 -22
- package/es/Tabs/Tabs.js +41 -83
- package/es/Tabs/Tabs.types.d.ts +0 -10
- package/es/Tabs/utils/bound.d.ts +1 -0
- package/es/Tabs/utils/bound.js +13 -0
- package/es/Tag/Tag.css +1 -1
- package/es/Tag/Tag.js +2 -6
- package/es/TextArea/TextArea.js +5 -12
- package/es/Toast/FunctionalToast.js +2 -2
- package/es/Toast/Toast.css +1 -0
- package/es/Tooltip/Tooltip.css +5 -5
- package/es/Tooltip/Tooltip.js +29 -73
- package/es/Transition/TransitionCore.js +3 -8
- package/es/index.d.ts +0 -6
- package/es/index.js +0 -6
- package/es/locales/base.d.ts +0 -11
- package/es/locales/en-US.js +0 -24
- package/es/locales/zh-CN.js +0 -24
- package/es/locales/zh-TW.js +0 -24
- package/package.json +6 -6
- package/dist/Collapse/Collapse.miniapp.d.ts +0 -5
- package/dist/Collapse/Collapse.miniapp.js +0 -177
- package/dist/DatePicker/DatePicker.d.ts +0 -4
- package/dist/DatePicker/DatePicker.js +0 -335
- package/dist/DatePicker/DatePicker.types.d.ts +0 -36
- package/dist/DatePicker/DatePicker.types.js +0 -15
- package/dist/DatePicker/constants.d.ts +0 -9
- package/dist/DatePicker/constants.js +0 -37
- package/dist/DatePicker/index.d.ts +0 -3
- package/dist/DatePicker/index.js +0 -44
- package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
- package/dist/DesktopDatePicker/DesktopDatePicker.js +0 -280
- package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
- package/dist/DesktopDatePicker/DesktopDatePicker.types.js +0 -15
- package/dist/DesktopDatePicker/deskTopPickerContainer.css +0 -100
- package/dist/DesktopDatePicker/index.css +0 -61
- package/dist/DesktopDatePicker/index.d.ts +0 -2
- package/dist/DesktopDatePicker/index.js +0 -41
- package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
- package/dist/DesktopDatePicker/useGetDatePickerContent.js +0 -343
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -322
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -15
- package/dist/DesktopDateTimePicker/index.css +0 -66
- package/dist/DesktopDateTimePicker/index.d.ts +0 -2
- package/dist/DesktopDateTimePicker/index.js +0 -41
- package/dist/DesktopPicker/DesktopPicker.d.ts +0 -5
- package/dist/DesktopPicker/DesktopPicker.js +0 -238
- package/dist/DesktopPicker/DesktopPicker.types.d.ts +0 -57
- package/dist/DesktopPicker/DesktopPicker.types.js +0 -15
- package/dist/DesktopPicker/index.css +0 -37
- package/dist/DesktopPicker/index.d.ts +0 -2
- package/dist/DesktopPicker/index.js +0 -41
- package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -38
- package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
- package/dist/DesktopTimePicker/DesktopTimePicker.js +0 -288
- package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
- package/dist/DesktopTimePicker/DesktopTimePicker.types.js +0 -15
- package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
- package/dist/DesktopTimePicker/DesktopTimePickerList.js +0 -111
- package/dist/DesktopTimePicker/index.css +0 -170
- package/dist/DesktopTimePicker/index.d.ts +0 -2
- package/dist/DesktopTimePicker/index.js +0 -41
- package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
- package/dist/DesktopTimePicker/useGetTimePickerContent.js +0 -249
- package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
- package/dist/DesktopTimePicker/utils/scrollUtil.js +0 -27
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -51
- package/dist/DesktopTimePicker/utils/utils.d.ts +0 -28
- package/dist/DesktopTimePicker/utils/utils.js +0 -408
- package/dist/SwipeAction/SwipeAction.css +0 -79
- package/dist/SwipeAction/SwipeAction.d.ts +0 -5
- package/dist/SwipeAction/SwipeAction.js +0 -349
- package/dist/SwipeAction/SwipeAction.types.d.ts +0 -75
- package/dist/SwipeAction/SwipeAction.types.js +0 -15
- package/dist/SwipeAction/SwipeActionContext.d.ts +0 -4
- package/dist/SwipeAction/SwipeActionContext.js +0 -30
- package/dist/SwipeAction/SwipeActionItem.css +0 -31
- package/dist/SwipeAction/SwipeActionItem.d.ts +0 -5
- package/dist/SwipeAction/SwipeActionItem.js +0 -105
- package/dist/SwipeAction/constants.d.ts +0 -9
- package/dist/SwipeAction/constants.js +0 -39
- package/dist/SwipeAction/index.d.ts +0 -5
- package/dist/SwipeAction/index.js +0 -50
- package/dist/Tabs/utils/scroll.d.ts +0 -2
- package/dist/Tabs/utils/scroll.js +0 -55
- package/es/Collapse/Collapse.miniapp.d.ts +0 -5
- package/es/Collapse/Collapse.miniapp.js +0 -157
- package/es/DatePicker/DatePicker.d.ts +0 -4
- package/es/DatePicker/DatePicker.js +0 -308
- package/es/DatePicker/DatePicker.types.d.ts +0 -36
- package/es/DatePicker/DatePicker.types.js +0 -1
- package/es/DatePicker/constants.d.ts +0 -9
- package/es/DatePicker/constants.js +0 -14
- package/es/DatePicker/index.d.ts +0 -3
- package/es/DatePicker/index.js +0 -8
- package/es/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
- package/es/DesktopDatePicker/DesktopDatePicker.js +0 -253
- package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
- package/es/DesktopDatePicker/DesktopDatePicker.types.js +0 -1
- package/es/DesktopDatePicker/deskTopPickerContainer.css +0 -100
- package/es/DesktopDatePicker/index.css +0 -61
- package/es/DesktopDatePicker/index.d.ts +0 -2
- package/es/DesktopDatePicker/index.js +0 -6
- package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
- package/es/DesktopDatePicker/useGetDatePickerContent.js +0 -316
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -295
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -1
- package/es/DesktopDateTimePicker/index.css +0 -66
- package/es/DesktopDateTimePicker/index.d.ts +0 -2
- package/es/DesktopDateTimePicker/index.js +0 -9
- package/es/DesktopPicker/DesktopPicker.d.ts +0 -5
- package/es/DesktopPicker/DesktopPicker.js +0 -221
- package/es/DesktopPicker/DesktopPicker.types.d.ts +0 -57
- package/es/DesktopPicker/DesktopPicker.types.js +0 -1
- package/es/DesktopPicker/index.css +0 -37
- package/es/DesktopPicker/index.d.ts +0 -2
- package/es/DesktopPicker/index.js +0 -6
- package/es/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
- package/es/DesktopPicker/utils/calcAfterMounted.js +0 -6
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -9
- package/es/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
- package/es/DesktopTimePicker/DesktopTimePicker.js +0 -261
- package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
- package/es/DesktopTimePicker/DesktopTimePicker.types.js +0 -1
- package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
- package/es/DesktopTimePicker/DesktopTimePickerList.js +0 -84
- package/es/DesktopTimePicker/index.css +0 -170
- package/es/DesktopTimePicker/index.d.ts +0 -2
- package/es/DesktopTimePicker/index.js +0 -6
- package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
- package/es/DesktopTimePicker/useGetTimePickerContent.js +0 -226
- package/es/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
- package/es/DesktopTimePicker/utils/scrollUtil.js +0 -8
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -22
- package/es/DesktopTimePicker/utils/utils.d.ts +0 -28
- package/es/DesktopTimePicker/utils/utils.js +0 -365
- package/es/SwipeAction/SwipeAction.css +0 -79
- package/es/SwipeAction/SwipeAction.d.ts +0 -5
- package/es/SwipeAction/SwipeAction.js +0 -334
- package/es/SwipeAction/SwipeAction.types.d.ts +0 -75
- package/es/SwipeAction/SwipeAction.types.js +0 -1
- package/es/SwipeAction/SwipeActionContext.d.ts +0 -4
- package/es/SwipeAction/SwipeActionContext.js +0 -11
- package/es/SwipeAction/SwipeActionItem.css +0 -31
- package/es/SwipeAction/SwipeActionItem.d.ts +0 -5
- package/es/SwipeAction/SwipeActionItem.js +0 -78
- package/es/SwipeAction/constants.d.ts +0 -9
- package/es/SwipeAction/constants.js +0 -15
- package/es/SwipeAction/index.d.ts +0 -5
- package/es/SwipeAction/index.js +0 -12
- package/es/Tabs/utils/scroll.d.ts +0 -2
- package/es/Tabs/utils/scroll.js +0 -36
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __export = (target, all) => {
|
|
25
|
-
for (var name in all)
|
|
26
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
-
};
|
|
28
|
-
var __copyProps = (to, from, except, desc) => {
|
|
29
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
-
for (let key of __getOwnPropNames(from))
|
|
31
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
-
}
|
|
34
|
-
return to;
|
|
35
|
-
};
|
|
36
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
37
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
38
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
39
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
40
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
41
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
42
|
-
mod
|
|
43
|
-
));
|
|
44
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
|
-
var DesktopTimePickerList_exports = {};
|
|
46
|
-
__export(DesktopTimePickerList_exports, {
|
|
47
|
-
default: () => DesktopTimePickerList_default
|
|
48
|
-
});
|
|
49
|
-
module.exports = __toCommonJS(DesktopTimePickerList_exports);
|
|
50
|
-
var import_react = __toESM(require("react"));
|
|
51
|
-
var import_utils = require("@bifrostui/utils");
|
|
52
|
-
var import_clsx = __toESM(require("clsx"));
|
|
53
|
-
var import_ScrollView = require("../ScrollView");
|
|
54
|
-
var import_scrollUtil = __toESM(require("./utils/scrollUtil"));
|
|
55
|
-
const DesktopTimePickerList = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
56
|
-
const {
|
|
57
|
-
timeValue,
|
|
58
|
-
type,
|
|
59
|
-
dataList,
|
|
60
|
-
selectedValue,
|
|
61
|
-
prefixCls,
|
|
62
|
-
handleClick,
|
|
63
|
-
timeRender
|
|
64
|
-
} = props;
|
|
65
|
-
const ulRef = (0, import_react.useRef)(null);
|
|
66
|
-
const [scrollTop, setScrollTop] = (0, import_react.useState)(0);
|
|
67
|
-
(0, import_react.useEffect)(() => {
|
|
68
|
-
if (!ulRef.current)
|
|
69
|
-
return;
|
|
70
|
-
const elementName = `.${prefixCls}-${type}-active`;
|
|
71
|
-
if (!import_utils.isMini) {
|
|
72
|
-
(0, import_scrollUtil.default)(elementName, setScrollTop);
|
|
73
|
-
} else {
|
|
74
|
-
const index = dataList.findIndex((item) => item.value === selectedValue);
|
|
75
|
-
if (index === -1)
|
|
76
|
-
return;
|
|
77
|
-
(0, import_scrollUtil.default)(elementName, setScrollTop, index);
|
|
78
|
-
}
|
|
79
|
-
}, [timeValue]);
|
|
80
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
81
|
-
import_ScrollView.ScrollView,
|
|
82
|
-
{
|
|
83
|
-
scrollY: true,
|
|
84
|
-
scrollWithAnimation: true,
|
|
85
|
-
className: (0, import_clsx.default)(`${prefixCls}-${type}-ul`),
|
|
86
|
-
key: type,
|
|
87
|
-
scrollTop,
|
|
88
|
-
scrollAnimationDuration: 300,
|
|
89
|
-
ref: ulRef
|
|
90
|
-
},
|
|
91
|
-
dataList.map((item, index) => {
|
|
92
|
-
const { value, label, disabled } = item;
|
|
93
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
94
|
-
"div",
|
|
95
|
-
{
|
|
96
|
-
key: index,
|
|
97
|
-
className: (0, import_clsx.default)(`${prefixCls}-${type}-li`, {
|
|
98
|
-
[`${prefixCls}-${type}-active`]: value === selectedValue,
|
|
99
|
-
[`${prefixCls}-${type}-disabled`]: disabled
|
|
100
|
-
}),
|
|
101
|
-
onClick: (e) => {
|
|
102
|
-
handleClick(e, disabled, item);
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
(timeRender == null ? void 0 : timeRender(__spreadProps(__spreadValues({}, item), { disabled }))) || label
|
|
106
|
-
);
|
|
107
|
-
})
|
|
108
|
-
);
|
|
109
|
-
});
|
|
110
|
-
DesktopTimePickerList.displayName = "BuiDesktopTimePickerList";
|
|
111
|
-
var DesktopTimePickerList_default = DesktopTimePickerList;
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
:root,
|
|
2
|
-
page,
|
|
3
|
-
xhs-page {
|
|
4
|
-
--bui-d-time-picker-height: var(--bui-input-height, 32px);
|
|
5
|
-
--bui-d-time-picker-min-width: var(--bui-input-min-width, 100px);
|
|
6
|
-
--bui-d-time-picker-font-size: var(--bui-title-size-3, 16px);
|
|
7
|
-
--bui-d-time-picker-icon-size: var(--bui-title-size-3, 16px);
|
|
8
|
-
--bui-d-time-picker-container-padding: var(--bui-spacing-md, 9px);
|
|
9
|
-
--bui-d-time-picker-bg: var(--bui-color-bg-view);
|
|
10
|
-
--bui-d-time-picker-font-family: var(--bui-font-family);
|
|
11
|
-
--bui-d-time-picker-border: 1px solid var(--bui-color-border-default);
|
|
12
|
-
--bui-d-time-picker-border-invalid: 1px solid var(--bui-color-danger);
|
|
13
|
-
--bui-d-time-picker-shadow: 0 0 0 2px var(--bui-color-bg-default);
|
|
14
|
-
--bui-d-time-picker-disabled-color: var(--bui-color-fg-subtle);
|
|
15
|
-
--bui-d-time-picker-container-main-radius: 3px;
|
|
16
|
-
--bui-d-time-picker-container-li-padding: 8px;
|
|
17
|
-
--bui-d-time-picker-container-li-height: 24px;
|
|
18
|
-
--bui-d-time-picker-container-li-line-height: 24px;
|
|
19
|
-
--bui-d-time-picker-container-li-width: 24px;
|
|
20
|
-
--bui-d-time-picker-container-li-radius: var(--bui-shape-radius-default, 6px);
|
|
21
|
-
--bui-d-time-picker-container-li-font-size: var(--bui-title-size-4);
|
|
22
|
-
--bui-d-time-picker-container-li-color: var(--bui-color-fg-default);
|
|
23
|
-
--bui-d-time-picker-container-li-color-active: var(--bui-color-fg-default);
|
|
24
|
-
--bui-d-time-picker-container-li-bg-active: #ffc7da;
|
|
25
|
-
}
|
|
26
|
-
.bui-d-time-picker {
|
|
27
|
-
position: relative;
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
vertical-align: middle;
|
|
30
|
-
height: var(--bui-d-time-picker-height);
|
|
31
|
-
min-width: var(--bui-d-time-picker-min-width);
|
|
32
|
-
font-size: var(--bui-d-time-picker-font-size);
|
|
33
|
-
border-radius: 5px;
|
|
34
|
-
background-color: var(--bui-d-time-picker-bg);
|
|
35
|
-
font-family: var(--bui-d-time-picker-font-family);
|
|
36
|
-
border: var(--bui-d-time-picker-border);
|
|
37
|
-
}
|
|
38
|
-
.bui-d-time-picker:active,
|
|
39
|
-
.bui-d-time-picker-active {
|
|
40
|
-
box-shadow: var(--bui-d-time-picker-shadow);
|
|
41
|
-
}
|
|
42
|
-
.bui-d-time-picker-invalid {
|
|
43
|
-
border: var(--bui-d-time-picker-border-invalid);
|
|
44
|
-
}
|
|
45
|
-
.bui-d-time-picker-icon {
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
font-size: var(--bui-d-time-picker-icon-size);
|
|
49
|
-
}
|
|
50
|
-
.bui-d-time-picker-container {
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
padding: 0 var(--bui-d-time-picker-container-padding);
|
|
54
|
-
height: 100%;
|
|
55
|
-
}
|
|
56
|
-
.bui-d-time-picker-placeholder {
|
|
57
|
-
color: var(--bui-color-fg-disabled);
|
|
58
|
-
}
|
|
59
|
-
.bui-d-time-picker-content {
|
|
60
|
-
display: flex;
|
|
61
|
-
justify-content: space-between;
|
|
62
|
-
align-items: center;
|
|
63
|
-
flex: 1;
|
|
64
|
-
height: 100%;
|
|
65
|
-
background-color: transparent;
|
|
66
|
-
outline: none;
|
|
67
|
-
border: 0;
|
|
68
|
-
}
|
|
69
|
-
.bui-d-time-picker-container-top {
|
|
70
|
-
bottom: 100%;
|
|
71
|
-
margin-bottom: 6px;
|
|
72
|
-
}
|
|
73
|
-
.bui-d-time-picker-container-bottom {
|
|
74
|
-
top: 100%;
|
|
75
|
-
margin-top: 6px;
|
|
76
|
-
}
|
|
77
|
-
.bui-d-time-picker-main {
|
|
78
|
-
border-radius: var(--bui-d-time-picker-container-main-radius);
|
|
79
|
-
padding: 3px 0;
|
|
80
|
-
height: 308px;
|
|
81
|
-
overflow: hidden;
|
|
82
|
-
}
|
|
83
|
-
.bui-d-time-picker-table {
|
|
84
|
-
height: 100%;
|
|
85
|
-
overflow: hidden;
|
|
86
|
-
display: flex;
|
|
87
|
-
}
|
|
88
|
-
.bui-d-time-picker-hour-ul,
|
|
89
|
-
.bui-d-time-picker-minute-ul,
|
|
90
|
-
.bui-d-time-picker-second-ul,
|
|
91
|
-
.bui-d-time-picker-meridiem-ul {
|
|
92
|
-
padding: 0;
|
|
93
|
-
border-radius: 0;
|
|
94
|
-
text-align: center;
|
|
95
|
-
border: none;
|
|
96
|
-
border-right: 1px solid var(--bui-color-border-default);
|
|
97
|
-
overflow-y: auto;
|
|
98
|
-
list-style: none;
|
|
99
|
-
scrollbar-width: thin;
|
|
100
|
-
scrollbar-color: #888 transparent;
|
|
101
|
-
}
|
|
102
|
-
.bui-d-time-picker-hour-li,
|
|
103
|
-
.bui-d-time-picker-minute-li,
|
|
104
|
-
.bui-d-time-picker-second-li,
|
|
105
|
-
.bui-d-time-picker-meridiem-li {
|
|
106
|
-
box-sizing: content-box;
|
|
107
|
-
width: var(--bui-d-time-picker-container-li-width);
|
|
108
|
-
height: var(--bui-d-time-picker-container-li-height);
|
|
109
|
-
line-height: var(--bui-d-time-picker-container-li-line-height);
|
|
110
|
-
padding: var(--bui-d-time-picker-container-li-padding);
|
|
111
|
-
margin: 0 4px;
|
|
112
|
-
border-radius: var(--bui-d-time-picker-container-li-radius);
|
|
113
|
-
font-size: var(--bui-d-time-picker-container-li-font-size);
|
|
114
|
-
font-family: var(--bui-d-time-picker-lay-font-family);
|
|
115
|
-
color: var(--bui-d-time-picker-container-li-color);
|
|
116
|
-
font-weight: var(--bui-font-weight-medium);
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
}
|
|
119
|
-
.bui-d-time-picker-hour:last-child,
|
|
120
|
-
.bui-d-time-picker-minute:last-child,
|
|
121
|
-
.bui-d-time-picker-second:last-child,
|
|
122
|
-
.bui-d-time-picker-meridiem:last-child {
|
|
123
|
-
border-right: none;
|
|
124
|
-
}
|
|
125
|
-
.bui-d-time-picker-hour-li:hover,
|
|
126
|
-
.bui-d-time-picker-minute-li:hover,
|
|
127
|
-
.bui-d-time-picker-second-li:hover,
|
|
128
|
-
.bui-d-time-picker-meridiem-li:hover {
|
|
129
|
-
background-color: var(--bui-color-bg-default);
|
|
130
|
-
}
|
|
131
|
-
.bui-d-time-picker-hour-active,
|
|
132
|
-
.bui-d-time-picker-minute-active,
|
|
133
|
-
.bui-d-time-picker-second-active,
|
|
134
|
-
.bui-d-time-picker-meridiem-active {
|
|
135
|
-
color: var(--bui-d-time-picker-container-li-color-active);
|
|
136
|
-
background-color: var(--bui-d-time-picker-container-li-bg-active);
|
|
137
|
-
}
|
|
138
|
-
.bui-d-time-picker-hour-disabled,
|
|
139
|
-
.bui-d-time-picker-minute-disabled,
|
|
140
|
-
.bui-d-time-picker-second-disabled,
|
|
141
|
-
.bui-d-time-picker-meridiem-disabled {
|
|
142
|
-
opacity: 0.38;
|
|
143
|
-
}
|
|
144
|
-
.bui-d-time-picker-hour .bui-d-time-picker-hour-disabled:hover,
|
|
145
|
-
.bui-d-time-picker-hour .bui-d-time-picker-minute-disabled:hover,
|
|
146
|
-
.bui-d-time-picker-hour .bui-d-time-picker-second-disabled:hover,
|
|
147
|
-
.bui-d-time-picker-hour .bui-d-time-picker-meridiem-disabled:hover,
|
|
148
|
-
.bui-d-time-picker-minute .bui-d-time-picker-hour-disabled:hover,
|
|
149
|
-
.bui-d-time-picker-minute .bui-d-time-picker-minute-disabled:hover,
|
|
150
|
-
.bui-d-time-picker-minute .bui-d-time-picker-second-disabled:hover,
|
|
151
|
-
.bui-d-time-picker-minute .bui-d-time-picker-meridiem-disabled:hover,
|
|
152
|
-
.bui-d-time-picker-second .bui-d-time-picker-hour-disabled:hover,
|
|
153
|
-
.bui-d-time-picker-second .bui-d-time-picker-minute-disabled:hover,
|
|
154
|
-
.bui-d-time-picker-second .bui-d-time-picker-second-disabled:hover,
|
|
155
|
-
.bui-d-time-picker-second .bui-d-time-picker-meridiem-disabled:hover,
|
|
156
|
-
.bui-d-time-picker-meridiem .bui-d-time-picker-hour-disabled:hover,
|
|
157
|
-
.bui-d-time-picker-meridiem .bui-d-time-picker-minute-disabled:hover,
|
|
158
|
-
.bui-d-time-picker-meridiem .bui-d-time-picker-second-disabled:hover,
|
|
159
|
-
.bui-d-time-picker-meridiem .bui-d-time-picker-meridiem-disabled:hover {
|
|
160
|
-
opacity: 0.38;
|
|
161
|
-
cursor: default;
|
|
162
|
-
}
|
|
163
|
-
.bui-d-time-picker.bui-d-time-picker-disabled {
|
|
164
|
-
pointer-events: none;
|
|
165
|
-
box-shadow: none;
|
|
166
|
-
background-color: rgba(188, 188, 188, 0.2);
|
|
167
|
-
}
|
|
168
|
-
.bui-d-time-picker.bui-d-time-picker-disabled input {
|
|
169
|
-
color: var(--bui-d-time-picker-disabled-color);
|
|
170
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
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 DesktopTimePicker_exports = {};
|
|
30
|
-
__export(DesktopTimePicker_exports, {
|
|
31
|
-
DesktopTimePicker: () => import_DesktopTimePicker.default,
|
|
32
|
-
default: () => import_DesktopTimePicker.default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(DesktopTimePicker_exports);
|
|
35
|
-
var import_DesktopTimePicker = __toESM(require("./DesktopTimePicker"));
|
|
36
|
-
__reExport(DesktopTimePicker_exports, require("./DesktopTimePicker.types"), module.exports);
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
DesktopTimePicker,
|
|
40
|
-
...require("./DesktopTimePicker.types")
|
|
41
|
-
});
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __export = (target, all) => {
|
|
25
|
-
for (var name in all)
|
|
26
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
-
};
|
|
28
|
-
var __copyProps = (to, from, except, desc) => {
|
|
29
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
-
for (let key of __getOwnPropNames(from))
|
|
31
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
-
}
|
|
34
|
-
return to;
|
|
35
|
-
};
|
|
36
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
37
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
38
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
39
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
40
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
41
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
42
|
-
mod
|
|
43
|
-
));
|
|
44
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
|
-
var useGetTimePickerContent_exports = {};
|
|
46
|
-
__export(useGetTimePickerContent_exports, {
|
|
47
|
-
default: () => useGetTimePickerContent_default
|
|
48
|
-
});
|
|
49
|
-
module.exports = __toCommonJS(useGetTimePickerContent_exports);
|
|
50
|
-
var import_clsx = __toESM(require("clsx"));
|
|
51
|
-
var import_react = __toESM(require("react"));
|
|
52
|
-
var import_DesktopTimePickerList = __toESM(require("./DesktopTimePickerList"));
|
|
53
|
-
var import_utils = require("./utils/utils");
|
|
54
|
-
const prefixCls = "bui-d-time-picker";
|
|
55
|
-
const useGetTimePickerContent = (props) => {
|
|
56
|
-
const {
|
|
57
|
-
views = ["hour", "minute", "second"],
|
|
58
|
-
timeSteps = {
|
|
59
|
-
hour: 1,
|
|
60
|
-
minute: 1,
|
|
61
|
-
second: 1
|
|
62
|
-
},
|
|
63
|
-
ampm = false,
|
|
64
|
-
disabledTimeView = () => ({
|
|
65
|
-
hour: () => [],
|
|
66
|
-
minute: () => [],
|
|
67
|
-
second: () => []
|
|
68
|
-
}),
|
|
69
|
-
minTime,
|
|
70
|
-
maxTime,
|
|
71
|
-
timeValue,
|
|
72
|
-
closeOnSelect,
|
|
73
|
-
setIsOpen,
|
|
74
|
-
triggerChange,
|
|
75
|
-
timeRender,
|
|
76
|
-
setIsInvalid
|
|
77
|
-
} = props;
|
|
78
|
-
(0, import_react.useEffect)(() => {
|
|
79
|
-
if ((0, import_utils.isDisabledTime)(timeValue, minTime, maxTime, disabledTimeView)) {
|
|
80
|
-
setIsInvalid(true);
|
|
81
|
-
} else {
|
|
82
|
-
setIsInvalid(false);
|
|
83
|
-
}
|
|
84
|
-
}, [timeValue]);
|
|
85
|
-
const getViewListData = (type, timeStep = 1) => {
|
|
86
|
-
if (type === "meridiem") {
|
|
87
|
-
return [
|
|
88
|
-
{ label: "AM", value: "AM" },
|
|
89
|
-
{ label: "PM", value: "PM" }
|
|
90
|
-
];
|
|
91
|
-
}
|
|
92
|
-
let maxNum;
|
|
93
|
-
if (type === "hour") {
|
|
94
|
-
maxNum = ampm ? 12 : 24;
|
|
95
|
-
} else {
|
|
96
|
-
maxNum = 60;
|
|
97
|
-
}
|
|
98
|
-
const list = [];
|
|
99
|
-
if (timeStep <= 0) {
|
|
100
|
-
timeStep = 1;
|
|
101
|
-
}
|
|
102
|
-
for (let i = 0; i < maxNum; i += timeStep) {
|
|
103
|
-
const value = i;
|
|
104
|
-
let label = value < 10 ? `0${value}` : `${value}`;
|
|
105
|
-
if (type === "hour" && ampm && value === 0) {
|
|
106
|
-
label = "12";
|
|
107
|
-
}
|
|
108
|
-
list.push({ label, value });
|
|
109
|
-
}
|
|
110
|
-
return list;
|
|
111
|
-
};
|
|
112
|
-
const renderViewsFunc = () => {
|
|
113
|
-
const lists = ampm ? [...views, "meridiem"] : views;
|
|
114
|
-
return lists.map((type, index) => {
|
|
115
|
-
var _a;
|
|
116
|
-
const dataList = getViewListData(type, timeSteps[type]);
|
|
117
|
-
const disabledTime = (0, import_utils.getdisabledTime)(
|
|
118
|
-
type,
|
|
119
|
-
timeValue,
|
|
120
|
-
minTime,
|
|
121
|
-
maxTime,
|
|
122
|
-
dataList,
|
|
123
|
-
disabledTimeView,
|
|
124
|
-
timeSteps,
|
|
125
|
-
ampm
|
|
126
|
-
);
|
|
127
|
-
dataList.forEach((item, idx) => {
|
|
128
|
-
const { value } = item;
|
|
129
|
-
const disabled = disabledTime == null ? void 0 : disabledTime.includes(value);
|
|
130
|
-
dataList[idx] = __spreadProps(__spreadValues({}, item), { disabled });
|
|
131
|
-
});
|
|
132
|
-
const isLastList = index === lists.length - 1;
|
|
133
|
-
let selectedValue;
|
|
134
|
-
if (timeValue) {
|
|
135
|
-
if (type === "meridiem") {
|
|
136
|
-
selectedValue = timeValue.format("A");
|
|
137
|
-
} else if (type === "hour" && ampm) {
|
|
138
|
-
selectedValue = timeValue.hour() % 12;
|
|
139
|
-
} else {
|
|
140
|
-
selectedValue = (_a = timeValue[type]) == null ? void 0 : _a.call(timeValue);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
const handleClick = (e, disabled, item) => {
|
|
144
|
-
e.stopPropagation();
|
|
145
|
-
if (disabled || selectedValue === item.value)
|
|
146
|
-
return;
|
|
147
|
-
let validTime = timeValue;
|
|
148
|
-
if (!timeValue) {
|
|
149
|
-
const validMinTime = (0, import_utils.calculateValidMinTime)(disabledTimeView, minTime);
|
|
150
|
-
validTime = validMinTime;
|
|
151
|
-
}
|
|
152
|
-
const updateHour = (hour) => validTime.format("A") === "PM" ? hour + 12 : hour;
|
|
153
|
-
const getValidTimeValue = (view, newTimeValue) => {
|
|
154
|
-
var _a2, _b;
|
|
155
|
-
let viewDisabledTime = (0, import_utils.getdisabledTime)(
|
|
156
|
-
view,
|
|
157
|
-
newTimeValue,
|
|
158
|
-
minTime,
|
|
159
|
-
maxTime,
|
|
160
|
-
getViewListData(view, timeSteps[view]),
|
|
161
|
-
disabledTimeView,
|
|
162
|
-
timeSteps,
|
|
163
|
-
ampm
|
|
164
|
-
);
|
|
165
|
-
let viewDataList = getViewListData(view, timeSteps[view]);
|
|
166
|
-
if (view === "hour" && ampm && newTimeValue.format("A") === "PM") {
|
|
167
|
-
viewDataList = viewDataList.map((el) => __spreadProps(__spreadValues({}, el), {
|
|
168
|
-
value: el.value + 12
|
|
169
|
-
}));
|
|
170
|
-
viewDisabledTime = viewDisabledTime.map(
|
|
171
|
-
(el) => el + 12
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
const validValues = viewDataList.map((i) => i.value).filter((el) => !viewDisabledTime.includes(el));
|
|
175
|
-
const curViewValue = (_b = (_a2 = newTimeValue[view]) == null ? void 0 : _a2.call(newTimeValue)) != null ? _b : 0;
|
|
176
|
-
const nearestValue = validValues.reduce(
|
|
177
|
-
(prev, curr) => Math.abs(curr - curViewValue) < Math.abs(prev - curViewValue) ? curr : prev,
|
|
178
|
-
validValues[0]
|
|
179
|
-
);
|
|
180
|
-
return nearestValue !== void 0 ? nearestValue : curViewValue;
|
|
181
|
-
};
|
|
182
|
-
const handleNewTimeValue = (newTimeValue, event) => {
|
|
183
|
-
const isDisabledNewTime = (0, import_utils.isDisabledTime)(
|
|
184
|
-
newTimeValue,
|
|
185
|
-
minTime,
|
|
186
|
-
maxTime,
|
|
187
|
-
disabledTimeView
|
|
188
|
-
);
|
|
189
|
-
if (isDisabledNewTime) {
|
|
190
|
-
views.forEach((view) => {
|
|
191
|
-
if (view !== type) {
|
|
192
|
-
const validValue = getValidTimeValue(view, newTimeValue);
|
|
193
|
-
newTimeValue = newTimeValue.set(view, validValue);
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
triggerChange(event, newTimeValue.toDate());
|
|
198
|
-
};
|
|
199
|
-
const calculateNewValue = (view, el) => {
|
|
200
|
-
if (view === "hour" && ampm) {
|
|
201
|
-
return updateHour(item.value);
|
|
202
|
-
}
|
|
203
|
-
return el.value;
|
|
204
|
-
};
|
|
205
|
-
if (type === "meridiem") {
|
|
206
|
-
const newHour = item.value === "PM" ? validTime.hour() + 12 : validTime.hour() - 12;
|
|
207
|
-
const newTimeValue = validTime.set("hour", newHour);
|
|
208
|
-
handleNewTimeValue(newTimeValue, e);
|
|
209
|
-
} else {
|
|
210
|
-
const newValue = calculateNewValue(type, item);
|
|
211
|
-
const newTimeValue = validTime.set(type, newValue);
|
|
212
|
-
handleNewTimeValue(newTimeValue, e);
|
|
213
|
-
}
|
|
214
|
-
if (isLastList && closeOnSelect) {
|
|
215
|
-
setIsOpen(false);
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
219
|
-
import_DesktopTimePickerList.default,
|
|
220
|
-
{
|
|
221
|
-
timeValue,
|
|
222
|
-
type,
|
|
223
|
-
dataList,
|
|
224
|
-
selectedValue,
|
|
225
|
-
prefixCls,
|
|
226
|
-
handleClick,
|
|
227
|
-
key: type,
|
|
228
|
-
timeRender
|
|
229
|
-
}
|
|
230
|
-
);
|
|
231
|
-
});
|
|
232
|
-
};
|
|
233
|
-
const desktopTimePanel = () => {
|
|
234
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
235
|
-
"div",
|
|
236
|
-
{
|
|
237
|
-
className: (0, import_clsx.default)(`${prefixCls}-main`),
|
|
238
|
-
onClick: (e) => {
|
|
239
|
-
e.stopPropagation();
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_clsx.default)(`${prefixCls}-table`) }, renderViewsFunc())
|
|
243
|
-
);
|
|
244
|
-
};
|
|
245
|
-
return {
|
|
246
|
-
desktopTimePanel
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
var useGetTimePickerContent_default = useGetTimePickerContent;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var scrollUtil_exports = {};
|
|
19
|
-
__export(scrollUtil_exports, {
|
|
20
|
-
default: () => scrollUtil_default
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(scrollUtil_exports);
|
|
23
|
-
const handleScroll = (elementName, setScrollTop, index) => {
|
|
24
|
-
const selectedLi = document.querySelector(elementName);
|
|
25
|
-
setScrollTop(selectedLi == null ? void 0 : selectedLi.offsetTop);
|
|
26
|
-
};
|
|
27
|
-
var scrollUtil_default = handleScroll;
|
|
@@ -1,51 +0,0 @@
|
|
|
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var scrollUtil_miniapp_exports = {};
|
|
29
|
-
__export(scrollUtil_miniapp_exports, {
|
|
30
|
-
default: () => scrollUtil_miniapp_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(scrollUtil_miniapp_exports);
|
|
33
|
-
var import_taro = __toESM(require("@tarojs/taro"));
|
|
34
|
-
const handleScroll = (elementName, setScrollTop, index) => {
|
|
35
|
-
var _a;
|
|
36
|
-
const query = import_taro.default.createSelectorQuery();
|
|
37
|
-
(_a = query.select(elementName)) == null ? void 0 : _a.fields({
|
|
38
|
-
computedStyle: ["height", "paddingTop", "paddingBottom"]
|
|
39
|
-
});
|
|
40
|
-
query.exec((res) => {
|
|
41
|
-
if (!res[0])
|
|
42
|
-
return;
|
|
43
|
-
const { height, paddingTop, paddingBottom } = res[0];
|
|
44
|
-
function parsePx(str) {
|
|
45
|
-
return str ? parseFloat(str.replace(/px$/, "")) : 0;
|
|
46
|
-
}
|
|
47
|
-
const targetHeight = parsePx(height) + parsePx(paddingTop) + parsePx(paddingBottom);
|
|
48
|
-
setScrollTop(index * targetHeight);
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
var scrollUtil_miniapp_default = handleScroll;
|