x-ui-design 0.7.50 → 0.7.51
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/index.esm.js +17 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -10
- package/dist/index.js.map +1 -1
- package/lib/components/DatePicker/TimePicker/TimePicker.tsx +17 -11
- package/package.json +1 -1
- package/src/app/page.tsx +6 -2
package/dist/index.esm.js
CHANGED
|
@@ -2849,10 +2849,22 @@ const TimePicker = ({
|
|
|
2849
2849
|
const shouldShowAbove = offsetHeight - (inputRef.current?.getBoundingClientRect().bottom || 0) < 230;
|
|
2850
2850
|
const shouldShowBelow = inputRef.current?.getBoundingClientRect().top < 230;
|
|
2851
2851
|
if (open && !shouldShowBelow && !shouldShowAbove) {
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2852
|
+
setDropdownPosition(previousDropdownPosition => {
|
|
2853
|
+
if (!Object.keys(previousDropdownPosition).length) {
|
|
2854
|
+
if (getPopupContainer) {
|
|
2855
|
+
return {
|
|
2856
|
+
top: (inputRef.current?.getBoundingClientRect().top || 0) + document.documentElement.scrollTop - 230,
|
|
2857
|
+
left: (inputRef.current?.getBoundingClientRect().left || 0) + document.documentElement.scrollLeft
|
|
2858
|
+
};
|
|
2859
|
+
} else {
|
|
2860
|
+
return {
|
|
2861
|
+
top: (inputRef.current?.offsetTop || 0) + (inputRef.current?.offsetHeight || 0),
|
|
2862
|
+
left: inputRef.current?.offsetLeft
|
|
2863
|
+
};
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
return previousDropdownPosition;
|
|
2867
|
+
});
|
|
2856
2868
|
}
|
|
2857
2869
|
if (getPopupContainer) {
|
|
2858
2870
|
if (!shouldShowBelow) {
|
|
@@ -2863,11 +2875,6 @@ const TimePicker = ({
|
|
|
2863
2875
|
toAbove();
|
|
2864
2876
|
}
|
|
2865
2877
|
} else {
|
|
2866
|
-
console.log({
|
|
2867
|
-
offsetHeight: scrollableParents?.offsetHeight,
|
|
2868
|
-
shouldShowBelow,
|
|
2869
|
-
shouldShowAbove
|
|
2870
|
-
});
|
|
2871
2878
|
if (shouldShowBelow) {
|
|
2872
2879
|
setDropdownPosition({
|
|
2873
2880
|
top: inputRef.current.offsetTop + inputRef.current.offsetHeight,
|
|
@@ -3041,7 +3048,7 @@ const TimePicker = ({
|
|
|
3041
3048
|
ref: popupRef,
|
|
3042
3049
|
style: {
|
|
3043
3050
|
...dropdownPosition,
|
|
3044
|
-
opacity:
|
|
3051
|
+
opacity: Object.keys(dropdownPosition).length ? 1 : 0
|
|
3045
3052
|
},
|
|
3046
3053
|
className: clsx([`${prefixCls}-popup`, {
|
|
3047
3054
|
[`${prefixCls}-popup-up`]: openUpward
|