x-ui-design 0.9.13 → 0.9.14
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 +7 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/lib/hooks/usePopupPosition.ts +7 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2668,22 +2668,29 @@ const usePopupPosition = ({
|
|
|
2668
2668
|
};
|
|
2669
2669
|
let newPlacement = _placement;
|
|
2670
2670
|
if (availableSpace.bottom < 0 && availableSpace.top > 0) {
|
|
2671
|
+
console.info(0);
|
|
2671
2672
|
newPlacement = newPlacement.replace('bottom', 'top');
|
|
2672
2673
|
}
|
|
2673
2674
|
if (availableSpace.top < 0 && availableSpace.bottom > 0) {
|
|
2675
|
+
console.info(1);
|
|
2674
2676
|
newPlacement = newPlacement.replace('top', 'bottom');
|
|
2675
2677
|
}
|
|
2676
2678
|
if (availableSpace.left < 0 && (availableSpace.right > 0 || availableSpace.right < popupRect.width)) {
|
|
2679
|
+
console.info(2);
|
|
2677
2680
|
newPlacement = newPlacement.replace('Right', 'Left');
|
|
2678
2681
|
}
|
|
2679
2682
|
if (availableSpace.right < 0 && (availableSpace.left > 0 || availableSpace.left < popupRect.width)) {
|
|
2683
|
+
console.info(3);
|
|
2680
2684
|
newPlacement = newPlacement.replace('Left', 'Right');
|
|
2681
2685
|
}
|
|
2682
2686
|
if (availableSpace.right < 0 && availableSpace.left < 0) {
|
|
2687
|
+
console.info(4);
|
|
2683
2688
|
if (newPlacement.includes('Right')) {
|
|
2689
|
+
console.info(5);
|
|
2684
2690
|
positions.left = popupRef.current.clientWidth - positions.left + container.left;
|
|
2685
2691
|
}
|
|
2686
2692
|
if (newPlacement.includes('Left')) {
|
|
2693
|
+
console.info(6);
|
|
2687
2694
|
positions.left = positions.left - popupRef.current.clientWidth + container.width;
|
|
2688
2695
|
}
|
|
2689
2696
|
}
|