x-ui-design 0.9.12 → 0.9.13
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 +2 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/lib/hooks/usePopupPosition.ts +2 -7
- package/package.json +1 -1
- package/src/app/page.tsx +4 -4
|
@@ -96,11 +96,11 @@ export const usePopupPosition = ({
|
|
|
96
96
|
newPlacement = newPlacement.replace('top', 'bottom') as Placement;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
if (availableSpace.left < 0 && availableSpace.right > 0) {
|
|
99
|
+
if (availableSpace.left < 0 && (availableSpace.right > 0 || availableSpace.right < popupRect.width)) {
|
|
100
100
|
newPlacement = newPlacement.replace('Right', 'Left') as Placement;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
if (availableSpace.right < 0 && availableSpace.left > 0) {
|
|
103
|
+
if (availableSpace.right < 0 && (availableSpace.left > 0 || availableSpace.left < popupRect.width)) {
|
|
104
104
|
newPlacement = newPlacement.replace('Left', 'Right') as Placement;
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -114,11 +114,6 @@ export const usePopupPosition = ({
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
console.log({
|
|
118
|
-
newPlacement,
|
|
119
|
-
availableSpace
|
|
120
|
-
});
|
|
121
|
-
|
|
122
117
|
_setPlacement(newPlacement);
|
|
123
118
|
}
|
|
124
119
|
|
package/package.json
CHANGED
package/src/app/page.tsx
CHANGED
|
@@ -143,15 +143,15 @@ export default function Home() {
|
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
<div className='dsfdf' style={{ display: 'flex', width: 1200, border: '1px solid', overflow: 'scroll', height: 700 }}>
|
|
146
|
-
<div style={{ minWidth:
|
|
147
|
-
<div style={{ height:
|
|
146
|
+
<div style={{ minWidth: 100 }} />
|
|
147
|
+
<div style={{ height: 700, border: '1px solid',
|
|
148
148
|
position: 'relative'
|
|
149
149
|
}}>
|
|
150
|
-
<div style={{ height:
|
|
150
|
+
<div style={{ height: 700,
|
|
151
151
|
position: 'relative'
|
|
152
152
|
}} />
|
|
153
153
|
<Popover
|
|
154
|
-
placement='
|
|
154
|
+
placement='bottomLeft'
|
|
155
155
|
content={
|
|
156
156
|
<Suspense>
|
|
157
157
|
<Result
|