@bifrostui/react 1.4.6 → 1.4.7-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/Calendar/Calendar.js +5 -1
- package/dist/Calendar/Calendar.types.d.ts +5 -0
- package/dist/CitySelector/CitySelectorCore.js +3 -3
- package/dist/Collapse/Collapse.css +0 -1
- package/dist/Collapse/Collapse.d.ts +1 -1
- package/dist/Collapse/Collapse.js +11 -8
- package/dist/Collapse/Collapse.miniapp.d.ts +5 -0
- package/dist/Collapse/Collapse.miniapp.js +177 -0
- package/dist/CollapsePanel/CollapsePanel.css +4 -2
- package/dist/DatePicker/DatePicker.d.ts +4 -0
- package/dist/DatePicker/DatePicker.js +335 -0
- package/dist/DatePicker/DatePicker.types.d.ts +43 -0
- package/dist/DatePicker/DatePicker.types.js +35 -0
- package/dist/DatePicker/index.d.ts +2 -0
- package/dist/DatePicker/index.js +41 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +5 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.js +280 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +163 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.types.js +15 -0
- package/dist/DesktopDatePicker/deskTopPickerContainer.css +100 -0
- package/dist/DesktopDatePicker/index.css +61 -0
- package/dist/DesktopDatePicker/index.d.ts +2 -0
- package/dist/DesktopDatePicker/index.js +41 -0
- package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +6 -0
- package/dist/DesktopDatePicker/useGetDatePickerContent.js +343 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +5 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +322 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +163 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +15 -0
- package/dist/DesktopDateTimePicker/index.css +66 -0
- package/dist/DesktopDateTimePicker/index.d.ts +2 -0
- package/dist/DesktopDateTimePicker/index.js +41 -0
- package/dist/DesktopPicker/DesktopPicker.d.ts +5 -0
- package/dist/DesktopPicker/DesktopPicker.js +238 -0
- package/dist/DesktopPicker/DesktopPicker.types.d.ts +57 -0
- package/dist/DesktopPicker/DesktopPicker.types.js +15 -0
- package/dist/DesktopPicker/index.css +37 -0
- package/dist/DesktopPicker/index.d.ts +2 -0
- package/dist/DesktopPicker/index.js +41 -0
- package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +2 -0
- package/dist/{Tabs/utils/bound.js → DesktopPicker/utils/calcAfterMounted.js} +7 -14
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +2 -0
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +38 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +5 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.js +288 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +182 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.types.js +15 -0
- package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +4 -0
- package/dist/DesktopTimePicker/DesktopTimePickerList.js +111 -0
- package/dist/DesktopTimePicker/index.css +170 -0
- package/dist/DesktopTimePicker/index.d.ts +2 -0
- package/dist/DesktopTimePicker/index.js +41 -0
- package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +6 -0
- package/dist/DesktopTimePicker/useGetTimePickerContent.js +246 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +2 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.js +27 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +2 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +51 -0
- package/dist/DesktopTimePicker/utils/utils.d.ts +28 -0
- package/dist/DesktopTimePicker/utils/utils.js +408 -0
- package/dist/Dialog/FunctionalDialog.js +1 -1
- package/dist/ItemSelector/ItemSelector.css +120 -0
- package/dist/ItemSelector/ItemSelector.d.ts +4 -0
- package/dist/ItemSelector/ItemSelector.js +84 -0
- package/dist/ItemSelector/ItemSelector.miniapp.d.ts +5 -0
- package/dist/ItemSelector/ItemSelector.miniapp.js +125 -0
- package/dist/ItemSelector/ItemSelector.types.d.ts +40 -0
- package/dist/ItemSelector/ItemSelector.types.js +15 -0
- package/dist/ItemSelector/ItemSelectorCore.d.ts +5 -0
- package/dist/ItemSelector/ItemSelectorCore.js +217 -0
- package/dist/ItemSelector/Selector/index.css +11 -0
- package/dist/ItemSelector/Selector/index.d.ts +9 -0
- package/dist/ItemSelector/Selector/index.js +48 -0
- package/dist/ItemSelector/index.d.ts +2 -0
- package/dist/ItemSelector/index.js +41 -0
- package/dist/ItemSelector/miniapp.css +4 -0
- package/dist/Modal/Modal.miniapp.d.ts +1 -1
- package/dist/Picker/Picker.css +5 -0
- package/dist/Picker/Picker.js +27 -5
- package/dist/Picker/Picker.types.d.ts +15 -2
- package/dist/Picker/PickerPanel.css +4 -0
- package/dist/Picker/PickerPanel.js +7 -6
- package/dist/Popover/Popover.js +70 -27
- package/dist/Portal/Portal.miniapp.js +7 -4
- package/dist/ScrollView/ScrollView.js +24 -11
- package/dist/ScrollView/ScrollView.types.d.ts +0 -1
- package/dist/Select/Select.css +1 -4
- package/dist/Select/Select.js +63 -40
- package/dist/Slider/Slider.js +13 -5
- package/dist/SwipeAction/SwipeAction.css +79 -0
- package/dist/SwipeAction/SwipeAction.d.ts +5 -0
- package/dist/SwipeAction/SwipeAction.js +349 -0
- package/dist/SwipeAction/SwipeAction.types.d.ts +83 -0
- package/dist/SwipeAction/SwipeAction.types.js +39 -0
- package/dist/SwipeAction/SwipeActionContext.d.ts +4 -0
- package/dist/SwipeAction/SwipeActionContext.js +30 -0
- package/dist/SwipeAction/SwipeActionItem.css +31 -0
- package/dist/SwipeAction/SwipeActionItem.d.ts +5 -0
- package/dist/SwipeAction/SwipeActionItem.js +105 -0
- package/dist/SwipeAction/index.d.ts +4 -0
- package/dist/SwipeAction/index.js +45 -0
- package/dist/Tabs/Tab.js +13 -4
- package/dist/Tabs/Tabs.js +30 -15
- package/dist/Tabs/utils/scroll.d.ts +2 -0
- package/dist/Tabs/utils/scroll.js +55 -0
- package/dist/Toast/FunctionalToast.js +1 -1
- package/dist/Toast/Toast.css +0 -1
- package/dist/Tooltip/Tooltip.js +70 -27
- package/dist/index.d.ts +7 -0
- package/dist/index.js +15 -1
- package/dist/locales/base.d.ts +11 -0
- package/dist/locales/en-US.js +24 -0
- package/dist/locales/zh-CN.js +24 -0
- package/dist/locales/zh-TW.js +24 -0
- package/es/Calendar/Calendar.js +5 -1
- package/es/Calendar/Calendar.types.d.ts +5 -0
- package/es/CitySelector/CitySelectorCore.js +3 -3
- package/es/Collapse/Collapse.css +0 -1
- package/es/Collapse/Collapse.d.ts +1 -1
- package/es/Collapse/Collapse.js +11 -8
- package/es/Collapse/Collapse.miniapp.d.ts +5 -0
- package/es/Collapse/Collapse.miniapp.js +157 -0
- package/es/CollapsePanel/CollapsePanel.css +4 -2
- package/es/DatePicker/DatePicker.d.ts +4 -0
- package/es/DatePicker/DatePicker.js +310 -0
- package/es/DatePicker/DatePicker.types.d.ts +43 -0
- package/es/DatePicker/DatePicker.types.js +1 -0
- package/es/DatePicker/index.d.ts +2 -0
- package/es/DatePicker/index.js +6 -0
- package/es/DesktopDatePicker/DesktopDatePicker.d.ts +5 -0
- package/es/DesktopDatePicker/DesktopDatePicker.js +253 -0
- package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +163 -0
- package/es/DesktopDatePicker/DesktopDatePicker.types.js +1 -0
- package/es/DesktopDatePicker/deskTopPickerContainer.css +100 -0
- package/es/DesktopDatePicker/index.css +61 -0
- package/es/DesktopDatePicker/index.d.ts +2 -0
- package/es/DesktopDatePicker/index.js +6 -0
- package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +6 -0
- package/es/DesktopDatePicker/useGetDatePickerContent.js +316 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +5 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +295 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +163 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +1 -0
- package/es/DesktopDateTimePicker/index.css +66 -0
- package/es/DesktopDateTimePicker/index.d.ts +2 -0
- package/es/DesktopDateTimePicker/index.js +9 -0
- package/es/DesktopPicker/DesktopPicker.d.ts +5 -0
- package/es/DesktopPicker/DesktopPicker.js +221 -0
- package/es/DesktopPicker/DesktopPicker.types.d.ts +57 -0
- package/es/DesktopPicker/DesktopPicker.types.js +1 -0
- package/es/DesktopPicker/index.css +37 -0
- package/es/DesktopPicker/index.d.ts +2 -0
- package/es/DesktopPicker/index.js +6 -0
- package/es/DesktopPicker/utils/calcAfterMounted.d.ts +2 -0
- package/es/DesktopPicker/utils/calcAfterMounted.js +6 -0
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +2 -0
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +9 -0
- package/es/DesktopTimePicker/DesktopTimePicker.d.ts +5 -0
- package/es/DesktopTimePicker/DesktopTimePicker.js +261 -0
- package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +182 -0
- package/es/DesktopTimePicker/DesktopTimePicker.types.js +1 -0
- package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +4 -0
- package/es/DesktopTimePicker/DesktopTimePickerList.js +84 -0
- package/es/DesktopTimePicker/index.css +170 -0
- package/es/DesktopTimePicker/index.d.ts +2 -0
- package/es/DesktopTimePicker/index.js +6 -0
- package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +6 -0
- package/es/DesktopTimePicker/useGetTimePickerContent.js +223 -0
- package/es/DesktopTimePicker/utils/scrollUtil.d.ts +2 -0
- package/es/DesktopTimePicker/utils/scrollUtil.js +8 -0
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +2 -0
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +22 -0
- package/es/DesktopTimePicker/utils/utils.d.ts +28 -0
- package/es/DesktopTimePicker/utils/utils.js +365 -0
- package/es/Dialog/FunctionalDialog.js +2 -2
- package/es/ItemSelector/ItemSelector.css +120 -0
- package/es/ItemSelector/ItemSelector.d.ts +4 -0
- package/es/ItemSelector/ItemSelector.js +57 -0
- package/es/ItemSelector/ItemSelector.miniapp.d.ts +5 -0
- package/es/ItemSelector/ItemSelector.miniapp.js +98 -0
- package/es/ItemSelector/ItemSelector.types.d.ts +40 -0
- package/es/ItemSelector/ItemSelector.types.js +1 -0
- package/es/ItemSelector/ItemSelectorCore.d.ts +5 -0
- package/es/ItemSelector/ItemSelectorCore.js +190 -0
- package/es/ItemSelector/Selector/index.css +11 -0
- package/es/ItemSelector/Selector/index.d.ts +9 -0
- package/es/ItemSelector/Selector/index.js +19 -0
- package/es/ItemSelector/index.d.ts +2 -0
- package/es/ItemSelector/index.js +6 -0
- package/es/ItemSelector/miniapp.css +4 -0
- package/es/Modal/Modal.miniapp.d.ts +1 -1
- package/es/Picker/Picker.css +5 -0
- package/es/Picker/Picker.js +27 -5
- package/es/Picker/Picker.types.d.ts +15 -2
- package/es/Picker/PickerPanel.css +4 -0
- package/es/Picker/PickerPanel.js +7 -6
- package/es/Popover/Popover.js +73 -29
- package/es/Portal/Portal.miniapp.js +8 -5
- package/es/ScrollView/ScrollView.js +24 -11
- package/es/ScrollView/ScrollView.types.d.ts +0 -1
- package/es/Select/Select.css +1 -4
- package/es/Select/Select.js +63 -41
- package/es/Slider/Slider.js +16 -6
- package/es/SwipeAction/SwipeAction.css +79 -0
- package/es/SwipeAction/SwipeAction.d.ts +5 -0
- package/es/SwipeAction/SwipeAction.js +337 -0
- package/es/SwipeAction/SwipeAction.types.d.ts +83 -0
- package/es/SwipeAction/SwipeAction.types.js +1 -0
- package/es/SwipeAction/SwipeActionContext.d.ts +4 -0
- package/es/SwipeAction/SwipeActionContext.js +11 -0
- package/es/SwipeAction/SwipeActionItem.css +31 -0
- package/es/SwipeAction/SwipeActionItem.d.ts +5 -0
- package/es/SwipeAction/SwipeActionItem.js +78 -0
- package/es/SwipeAction/index.d.ts +4 -0
- package/es/SwipeAction/index.js +9 -0
- package/es/Tabs/Tab.js +13 -4
- package/es/Tabs/Tabs.js +30 -15
- package/es/Tabs/utils/scroll.d.ts +2 -0
- package/es/Tabs/utils/scroll.js +36 -0
- package/es/Toast/FunctionalToast.js +2 -2
- package/es/Toast/Toast.css +0 -1
- package/es/Tooltip/Tooltip.js +73 -29
- package/es/index.d.ts +7 -0
- package/es/index.js +7 -0
- package/es/locales/base.d.ts +11 -0
- package/es/locales/en-US.js +24 -0
- package/es/locales/zh-CN.js +24 -0
- package/es/locales/zh-TW.js +24 -0
- package/package.json +5 -5
- package/dist/Tabs/utils/bound.d.ts +0 -1
- package/es/Tabs/utils/bound.d.ts +0 -1
- package/es/Tabs/utils/bound.js +0 -13
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const root = window || global;
|
|
2
|
+
let rafId;
|
|
3
|
+
let prev = Date.now();
|
|
4
|
+
const rafPolyfill = (fn) => {
|
|
5
|
+
const curr = Date.now();
|
|
6
|
+
const ms = Math.max(0, 16 - (curr - prev));
|
|
7
|
+
const id = setTimeout(fn, ms);
|
|
8
|
+
prev = curr + ms;
|
|
9
|
+
return id;
|
|
10
|
+
};
|
|
11
|
+
const cancelRaf = (id) => {
|
|
12
|
+
const cancelAnimationFrame = (root == null ? void 0 : root.cancelAnimationFrame) || (root == null ? void 0 : root.clearTimeout) || clearTimeout;
|
|
13
|
+
cancelAnimationFrame.call(root, id);
|
|
14
|
+
};
|
|
15
|
+
const raf = (fn) => {
|
|
16
|
+
const requestAnimationFrame = (root == null ? void 0 : root.requestAnimationFrame) || rafPolyfill;
|
|
17
|
+
return requestAnimationFrame.call(root, fn);
|
|
18
|
+
};
|
|
19
|
+
const scrollLeftTo = (scroller, to, duration) => {
|
|
20
|
+
cancelRaf(rafId);
|
|
21
|
+
let count = 0;
|
|
22
|
+
const from = scroller.scrollLeft;
|
|
23
|
+
const frames = duration === 0 ? 1 : Math.round(duration / 16);
|
|
24
|
+
function animate() {
|
|
25
|
+
scroller.scrollLeft += (to - from) / frames;
|
|
26
|
+
count += 1;
|
|
27
|
+
if (count < frames) {
|
|
28
|
+
rafId = raf(animate);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
animate();
|
|
32
|
+
};
|
|
33
|
+
var scroll_default = scrollLeftTo;
|
|
34
|
+
export {
|
|
35
|
+
scroll_default as default
|
|
36
|
+
};
|
|
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { render, unmount,
|
|
32
|
+
import { render, unmount, getRootContainer } from "@bifrostui/utils";
|
|
33
33
|
import React, { useCallback, useEffect, useState } from "react";
|
|
34
34
|
import ToastView from "./Toast";
|
|
35
35
|
let toastCloses = [];
|
|
@@ -70,7 +70,7 @@ const functionalToast = (props) => {
|
|
|
70
70
|
rootWrapper.style[property] = styles[property];
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
const rootElement =
|
|
73
|
+
const rootElement = getRootContainer();
|
|
74
74
|
rootElement.appendChild(rootWrapper);
|
|
75
75
|
const ToastComponent = () => {
|
|
76
76
|
const _a = options, { duration, allowMultiple, onClose } = _a, others = __objRest(_a, ["duration", "allowMultiple", "onClose"]);
|
package/es/Toast/Toast.css
CHANGED
package/es/Tooltip/Tooltip.js
CHANGED
|
@@ -26,14 +26,35 @@ var __objRest = (source, exclude) => {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
};
|
|
29
|
+
var __async = (__this, __arguments, generator) => {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
var fulfilled = (value) => {
|
|
32
|
+
try {
|
|
33
|
+
step(generator.next(value));
|
|
34
|
+
} catch (e) {
|
|
35
|
+
reject(e);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var rejected = (value) => {
|
|
39
|
+
try {
|
|
40
|
+
step(generator.throw(value));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
reject(e);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
46
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
29
49
|
import clsx from "clsx";
|
|
30
50
|
import React, { useState, useRef, useEffect } from "react";
|
|
31
51
|
import {
|
|
32
52
|
getStylesAndLocation,
|
|
33
53
|
triggerEventTransform,
|
|
34
54
|
parsePlacement,
|
|
35
|
-
|
|
36
|
-
|
|
55
|
+
throttle,
|
|
56
|
+
useForkRef,
|
|
57
|
+
isMini
|
|
37
58
|
} from "@bifrostui/utils";
|
|
38
59
|
import Portal from "../Portal";
|
|
39
60
|
import "./Tooltip.css";
|
|
@@ -48,8 +69,8 @@ const Tooltip = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
48
69
|
offsetSpacing = 0,
|
|
49
70
|
placement = "top",
|
|
50
71
|
trigger = "click",
|
|
51
|
-
|
|
52
|
-
|
|
72
|
+
open,
|
|
73
|
+
onOpenChange
|
|
53
74
|
} = _a, others = __objRest(_a, [
|
|
54
75
|
"className",
|
|
55
76
|
"style",
|
|
@@ -59,8 +80,8 @@ const Tooltip = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
59
80
|
"offsetSpacing",
|
|
60
81
|
"placement",
|
|
61
82
|
"trigger",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
83
|
+
"open",
|
|
84
|
+
"onOpenChange"
|
|
64
85
|
]);
|
|
65
86
|
const controlByUser = typeof open !== "undefined";
|
|
66
87
|
const { direction, location = "center" } = parsePlacement(placement);
|
|
@@ -68,11 +89,18 @@ const Tooltip = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
68
89
|
const [openStatus, setOpenStatus] = useState(defaultOpen);
|
|
69
90
|
const [arrowDirection, setArrowDirection] = useState(direction);
|
|
70
91
|
const [arrowLocation, setArrowLocation] = useState(location);
|
|
71
|
-
const [
|
|
72
|
-
const
|
|
92
|
+
const [toolStyles, setToolStyles] = useState({});
|
|
93
|
+
const tipRef = useRef(null);
|
|
94
|
+
const nodeRef = useForkRef(ref, tipRef);
|
|
95
|
+
const clearRef = (status) => {
|
|
96
|
+
if (status === false) {
|
|
97
|
+
tipRef.current = null;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
73
100
|
const changeOpenStatus = (event, status) => {
|
|
74
101
|
if (controlByUser)
|
|
75
102
|
return;
|
|
103
|
+
clearRef(status);
|
|
76
104
|
setOpenStatus(status);
|
|
77
105
|
onOpenChange == null ? void 0 : onOpenChange(event, { open: status });
|
|
78
106
|
};
|
|
@@ -91,23 +119,33 @@ const Tooltip = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
91
119
|
if (!controlByUser)
|
|
92
120
|
return;
|
|
93
121
|
setOpenStatus(open);
|
|
122
|
+
clearRef(open);
|
|
94
123
|
}, [open]);
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (!openStatus) {
|
|
126
|
+
setToolStyles({
|
|
127
|
+
visibility: "hidden"
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}, [openStatus]);
|
|
95
131
|
const clickEventHandler = (event) => {
|
|
96
132
|
if (trigger === "hover" || (trigger == null ? void 0 : trigger.length) === 1 && (trigger == null ? void 0 : trigger[0]) === "hover")
|
|
97
133
|
return;
|
|
98
134
|
hideTooltip(event);
|
|
99
135
|
};
|
|
100
|
-
const onRootElementMouted = throttle(() => {
|
|
136
|
+
const onRootElementMouted = throttle(() => __async(void 0, null, function* () {
|
|
137
|
+
if (!tipRef.current)
|
|
138
|
+
return;
|
|
101
139
|
const {
|
|
102
140
|
direction: newParsedDirection,
|
|
103
141
|
location: newParsedLocation = "center"
|
|
104
142
|
} = parsePlacement(placement);
|
|
105
|
-
const result = getStylesAndLocation({
|
|
143
|
+
const result = yield getStylesAndLocation({
|
|
106
144
|
childrenRef,
|
|
107
145
|
arrowDirection: newParsedDirection,
|
|
108
146
|
arrowLocation: newParsedLocation,
|
|
109
147
|
offsetSpacing,
|
|
110
|
-
|
|
148
|
+
tipRef
|
|
111
149
|
});
|
|
112
150
|
if (!result)
|
|
113
151
|
return;
|
|
@@ -118,26 +156,32 @@ const Tooltip = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
118
156
|
if (newArrowLocation !== arrowLocation) {
|
|
119
157
|
setArrowLocation(newArrowLocation);
|
|
120
158
|
}
|
|
121
|
-
|
|
122
|
-
}, 100);
|
|
123
|
-
const bindEvent = () => {
|
|
124
|
-
if (!controlByUser) {
|
|
125
|
-
document.addEventListener("click", clickEventHandler);
|
|
126
|
-
}
|
|
127
|
-
window.addEventListener("resize", onRootElementMouted);
|
|
128
|
-
};
|
|
129
|
-
const unbindEvent = () => {
|
|
130
|
-
if (!controlByUser) {
|
|
131
|
-
document.removeEventListener("click", clickEventHandler);
|
|
132
|
-
}
|
|
133
|
-
window.removeEventListener("resize", onRootElementMouted);
|
|
134
|
-
};
|
|
159
|
+
setToolStyles(styles);
|
|
160
|
+
}), 100);
|
|
135
161
|
useEffect(() => {
|
|
162
|
+
const bindEvent = () => {
|
|
163
|
+
if (!openStatus)
|
|
164
|
+
return;
|
|
165
|
+
if (!controlByUser) {
|
|
166
|
+
document.addEventListener("click", clickEventHandler);
|
|
167
|
+
}
|
|
168
|
+
if (!isMini) {
|
|
169
|
+
window.addEventListener("resize", onRootElementMouted);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const unbindEvent = () => {
|
|
173
|
+
if (!controlByUser) {
|
|
174
|
+
document.removeEventListener("click", clickEventHandler);
|
|
175
|
+
}
|
|
176
|
+
if (!isMini) {
|
|
177
|
+
window.removeEventListener("resize", onRootElementMouted);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
136
180
|
bindEvent();
|
|
137
181
|
return () => {
|
|
138
182
|
unbindEvent();
|
|
139
183
|
};
|
|
140
|
-
}, []);
|
|
184
|
+
}, [openStatus]);
|
|
141
185
|
let triggerEventOption;
|
|
142
186
|
if (!controlByUser) {
|
|
143
187
|
triggerEventOption = triggerEventTransform({
|
|
@@ -150,12 +194,12 @@ const Tooltip = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
150
194
|
const childrenOptions = __spreadValues({
|
|
151
195
|
ref: childrenRef
|
|
152
196
|
}, triggerEventOption);
|
|
153
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, (open || openStatus) && title ? /* @__PURE__ */ React.createElement(Portal, { onRootElementMouted
|
|
197
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, (open || openStatus) && title ? /* @__PURE__ */ React.createElement(Portal, { onRootElementMouted }, /* @__PURE__ */ React.createElement(
|
|
154
198
|
"div",
|
|
155
199
|
__spreadValues({
|
|
156
200
|
className: clsx(prefixCls, className, `tooltip-${arrowDirection}`),
|
|
157
|
-
style: __spreadValues(__spreadValues({}, style),
|
|
158
|
-
|
|
201
|
+
style: __spreadValues(__spreadValues({}, style), toolStyles),
|
|
202
|
+
ref: nodeRef
|
|
159
203
|
}, others),
|
|
160
204
|
/* @__PURE__ */ React.createElement(
|
|
161
205
|
"div",
|
package/es/index.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export * from './Calendar';
|
|
|
8
8
|
export * from './Card';
|
|
9
9
|
export * from './Checkbox';
|
|
10
10
|
export * from './Collapse';
|
|
11
|
+
export * from './DatePicker';
|
|
12
|
+
export * from './DesktopDatePicker';
|
|
13
|
+
export * from './DesktopTimePicker';
|
|
14
|
+
export * from './DesktopDateTimePicker';
|
|
15
|
+
export * from './DesktopPicker';
|
|
11
16
|
export * from './Divider';
|
|
12
17
|
export * from './Drawer';
|
|
13
18
|
export * from './Fade';
|
|
@@ -40,6 +45,7 @@ export * from './Loading';
|
|
|
40
45
|
export * from './TabBar';
|
|
41
46
|
export * from './Countdown';
|
|
42
47
|
export * from './CitySelector';
|
|
48
|
+
export * from './ItemSelector';
|
|
43
49
|
export * from './Picker';
|
|
44
50
|
export * from './CollapsePanel';
|
|
45
51
|
export * from './Breadcrumb';
|
|
@@ -47,3 +53,4 @@ export * from './Toast';
|
|
|
47
53
|
export * from './Dialog';
|
|
48
54
|
export * from './ThemeProvider';
|
|
49
55
|
export * from './locales';
|
|
56
|
+
export * from './SwipeAction';
|
package/es/index.js
CHANGED
|
@@ -8,6 +8,11 @@ export * from "./Calendar";
|
|
|
8
8
|
export * from "./Card";
|
|
9
9
|
export * from "./Checkbox";
|
|
10
10
|
export * from "./Collapse";
|
|
11
|
+
export * from "./DatePicker";
|
|
12
|
+
export * from "./DesktopDatePicker";
|
|
13
|
+
export * from "./DesktopTimePicker";
|
|
14
|
+
export * from "./DesktopDateTimePicker";
|
|
15
|
+
export * from "./DesktopPicker";
|
|
11
16
|
export * from "./Divider";
|
|
12
17
|
export * from "./Drawer";
|
|
13
18
|
export * from "./Fade";
|
|
@@ -40,6 +45,7 @@ export * from "./Loading";
|
|
|
40
45
|
export * from "./TabBar";
|
|
41
46
|
export * from "./Countdown";
|
|
42
47
|
export * from "./CitySelector";
|
|
48
|
+
export * from "./ItemSelector";
|
|
43
49
|
export * from "./Picker";
|
|
44
50
|
export * from "./CollapsePanel";
|
|
45
51
|
export * from "./Breadcrumb";
|
|
@@ -47,3 +53,4 @@ export * from "./Toast";
|
|
|
47
53
|
export * from "./Dialog";
|
|
48
54
|
export * from "./ThemeProvider";
|
|
49
55
|
export * from "./locales";
|
|
56
|
+
export * from "./SwipeAction";
|
package/es/locales/base.d.ts
CHANGED
|
@@ -37,4 +37,15 @@ export interface BaseLang {
|
|
|
37
37
|
currentType?: Record<string, string>;
|
|
38
38
|
hotCityType?: Record<string, string>;
|
|
39
39
|
};
|
|
40
|
+
desktopDatePicker?: {
|
|
41
|
+
month?: Record<number, string>;
|
|
42
|
+
};
|
|
43
|
+
datePicker?: {
|
|
44
|
+
year: string;
|
|
45
|
+
month: string;
|
|
46
|
+
day: string;
|
|
47
|
+
hour: string;
|
|
48
|
+
minute: string;
|
|
49
|
+
second: string;
|
|
50
|
+
};
|
|
40
51
|
}
|
package/es/locales/en-US.js
CHANGED
|
@@ -42,6 +42,30 @@ const enUS = {
|
|
|
42
42
|
title: "Hot",
|
|
43
43
|
code: "HOT"
|
|
44
44
|
}
|
|
45
|
+
},
|
|
46
|
+
desktopDatePicker: {
|
|
47
|
+
month: {
|
|
48
|
+
1: "Jan",
|
|
49
|
+
2: "Feb",
|
|
50
|
+
3: "Mar",
|
|
51
|
+
4: "Apr",
|
|
52
|
+
5: "May",
|
|
53
|
+
6: "Jun",
|
|
54
|
+
7: "Jul",
|
|
55
|
+
8: "Aug",
|
|
56
|
+
9: "Sep",
|
|
57
|
+
10: "Oct",
|
|
58
|
+
11: "Nov",
|
|
59
|
+
12: "Dec"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
datePicker: {
|
|
63
|
+
year: "Year",
|
|
64
|
+
month: "Month",
|
|
65
|
+
day: "Day",
|
|
66
|
+
hour: "Hour",
|
|
67
|
+
minute: "Minute",
|
|
68
|
+
second: "Second"
|
|
45
69
|
}
|
|
46
70
|
};
|
|
47
71
|
var en_US_default = enUS;
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -24,6 +24,30 @@ const zhCN = {
|
|
|
24
24
|
located: "\u5B9A\u4F4D",
|
|
25
25
|
current: "\u5F53\u524D",
|
|
26
26
|
hot: "\u70ED\u95E8"
|
|
27
|
+
},
|
|
28
|
+
desktopDatePicker: {
|
|
29
|
+
month: {
|
|
30
|
+
1: "1\u6708",
|
|
31
|
+
2: "2\u6708",
|
|
32
|
+
3: "3\u6708",
|
|
33
|
+
4: "4\u6708",
|
|
34
|
+
5: "5\u6708",
|
|
35
|
+
6: "6\u6708",
|
|
36
|
+
7: "7\u6708",
|
|
37
|
+
8: "8\u6708",
|
|
38
|
+
9: "9\u6708",
|
|
39
|
+
10: "10\u6708",
|
|
40
|
+
11: "11\u6708",
|
|
41
|
+
12: "12\u6708"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
datePicker: {
|
|
45
|
+
year: "\u5E74",
|
|
46
|
+
month: "\u6708",
|
|
47
|
+
day: "\u65E5",
|
|
48
|
+
hour: "\u65F6",
|
|
49
|
+
minute: "\u5206",
|
|
50
|
+
second: "\u79D2"
|
|
27
51
|
}
|
|
28
52
|
};
|
|
29
53
|
var zh_CN_default = zhCN;
|
package/es/locales/zh-TW.js
CHANGED
|
@@ -24,6 +24,30 @@ const zhTW = {
|
|
|
24
24
|
located: "\u5B9A\u4F4D",
|
|
25
25
|
current: "\u76EE\u524D",
|
|
26
26
|
hot: "\u71B1\u9580"
|
|
27
|
+
},
|
|
28
|
+
desktopDatePicker: {
|
|
29
|
+
month: {
|
|
30
|
+
1: "1\u6708",
|
|
31
|
+
2: "2\u6708",
|
|
32
|
+
3: "3\u6708",
|
|
33
|
+
4: "4\u6708",
|
|
34
|
+
5: "5\u6708",
|
|
35
|
+
6: "6\u6708",
|
|
36
|
+
7: "7\u6708",
|
|
37
|
+
8: "8\u6708",
|
|
38
|
+
9: "9\u6708",
|
|
39
|
+
10: "10\u6708",
|
|
40
|
+
11: "11\u6708",
|
|
41
|
+
12: "12\u6708"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
datePicker: {
|
|
45
|
+
year: "\u5E74",
|
|
46
|
+
month: "\u6708",
|
|
47
|
+
day: "\u65E5",
|
|
48
|
+
hour: "\u6642",
|
|
49
|
+
minute: "\u5206",
|
|
50
|
+
second: "\u79D2"
|
|
27
51
|
}
|
|
28
52
|
};
|
|
29
53
|
var zh_TW_default = zhTW;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bifrostui/react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.7-beta.0",
|
|
4
4
|
"description": "React components for building mobile application",
|
|
5
5
|
"homepage": "http://bui.taopiaopiao.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"clsx": "^1.2.1",
|
|
34
34
|
"dayjs": "^1.11.7",
|
|
35
35
|
"swiper": "^8.1.5",
|
|
36
|
-
"@bifrostui/icons": "1.4.
|
|
37
|
-
"@bifrostui/
|
|
38
|
-
"@bifrostui/
|
|
39
|
-
"@bifrostui/
|
|
36
|
+
"@bifrostui/icons": "1.4.7-beta.0",
|
|
37
|
+
"@bifrostui/types": "1.4.7-beta.0",
|
|
38
|
+
"@bifrostui/styles": "1.4.7-beta.0",
|
|
39
|
+
"@bifrostui/utils": "1.4.7-beta.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@tarojs/components": "^3.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function bound(position: number, min: number | undefined, max: number | undefined): number;
|
package/es/Tabs/utils/bound.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function bound(position: number, min: number | undefined, max: number | undefined): number;
|
package/es/Tabs/utils/bound.js
DELETED