@x-plat/design-system 0.15.1 → 0.15.2
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/components/Dropdown/index.cjs +2 -10
- package/dist/components/Dropdown/index.js +2 -10
- package/dist/components/PopOver/index.cjs +2 -10
- package/dist/components/PopOver/index.js +2 -10
- package/dist/components/Select/index.cjs +2 -10
- package/dist/components/Select/index.js +2 -10
- package/dist/components/TimePicker/index.cjs +2 -10
- package/dist/components/TimePicker/index.js +2 -10
- package/dist/components/index.cjs +2 -10
- package/dist/components/index.js +2 -10
- package/dist/index.cjs +2 -10
- package/dist/index.js +2 -10
- package/package.json +1 -1
|
@@ -86,18 +86,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
86
86
|
left = triggerRect.right - popW;
|
|
87
87
|
}
|
|
88
88
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
89
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
90
89
|
return {
|
|
91
90
|
direction,
|
|
92
91
|
top,
|
|
93
92
|
left,
|
|
94
|
-
maxHeight
|
|
95
|
-
over: {
|
|
96
|
-
top: Math.max(0, clip.top - top),
|
|
97
|
-
right: Math.max(0, left + popW - clip.right),
|
|
98
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
99
|
-
left: Math.max(0, clip.left - left)
|
|
100
|
-
}
|
|
93
|
+
maxHeight
|
|
101
94
|
};
|
|
102
95
|
};
|
|
103
96
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -141,7 +134,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
141
134
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
142
135
|
const frozen = frozenMaxRef.current;
|
|
143
136
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
144
|
-
const { direction: next, top, left,
|
|
137
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
145
138
|
triggerRect,
|
|
146
139
|
popW,
|
|
147
140
|
effectiveH,
|
|
@@ -153,7 +146,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
153
146
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
154
147
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
155
148
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
156
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
157
149
|
directionRef.current = next;
|
|
158
150
|
pop.classList.toggle("top", next === "top");
|
|
159
151
|
pop.classList.toggle("bottom", next === "bottom");
|
|
@@ -50,18 +50,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
50
50
|
left = triggerRect.right - popW;
|
|
51
51
|
}
|
|
52
52
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
53
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
54
53
|
return {
|
|
55
54
|
direction,
|
|
56
55
|
top,
|
|
57
56
|
left,
|
|
58
|
-
maxHeight
|
|
59
|
-
over: {
|
|
60
|
-
top: Math.max(0, clip.top - top),
|
|
61
|
-
right: Math.max(0, left + popW - clip.right),
|
|
62
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
63
|
-
left: Math.max(0, clip.left - left)
|
|
64
|
-
}
|
|
57
|
+
maxHeight
|
|
65
58
|
};
|
|
66
59
|
};
|
|
67
60
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -105,7 +98,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
105
98
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
106
99
|
const frozen = frozenMaxRef.current;
|
|
107
100
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
108
|
-
const { direction: next, top, left,
|
|
101
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
109
102
|
triggerRect,
|
|
110
103
|
popW,
|
|
111
104
|
effectiveH,
|
|
@@ -117,7 +110,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
117
110
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
118
111
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
119
112
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
120
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
121
113
|
directionRef.current = next;
|
|
122
114
|
pop.classList.toggle("top", next === "top");
|
|
123
115
|
pop.classList.toggle("bottom", next === "bottom");
|
|
@@ -86,18 +86,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
86
86
|
left = triggerRect.right - popW;
|
|
87
87
|
}
|
|
88
88
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
89
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
90
89
|
return {
|
|
91
90
|
direction,
|
|
92
91
|
top,
|
|
93
92
|
left,
|
|
94
|
-
maxHeight
|
|
95
|
-
over: {
|
|
96
|
-
top: Math.max(0, clip.top - top),
|
|
97
|
-
right: Math.max(0, left + popW - clip.right),
|
|
98
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
99
|
-
left: Math.max(0, clip.left - left)
|
|
100
|
-
}
|
|
93
|
+
maxHeight
|
|
101
94
|
};
|
|
102
95
|
};
|
|
103
96
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -141,7 +134,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
141
134
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
142
135
|
const frozen = frozenMaxRef.current;
|
|
143
136
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
144
|
-
const { direction: next, top, left,
|
|
137
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
145
138
|
triggerRect,
|
|
146
139
|
popW,
|
|
147
140
|
effectiveH,
|
|
@@ -153,7 +146,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
153
146
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
154
147
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
155
148
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
156
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
157
149
|
directionRef.current = next;
|
|
158
150
|
pop.classList.toggle("top", next === "top");
|
|
159
151
|
pop.classList.toggle("bottom", next === "bottom");
|
|
@@ -50,18 +50,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
50
50
|
left = triggerRect.right - popW;
|
|
51
51
|
}
|
|
52
52
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
53
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
54
53
|
return {
|
|
55
54
|
direction,
|
|
56
55
|
top,
|
|
57
56
|
left,
|
|
58
|
-
maxHeight
|
|
59
|
-
over: {
|
|
60
|
-
top: Math.max(0, clip.top - top),
|
|
61
|
-
right: Math.max(0, left + popW - clip.right),
|
|
62
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
63
|
-
left: Math.max(0, clip.left - left)
|
|
64
|
-
}
|
|
57
|
+
maxHeight
|
|
65
58
|
};
|
|
66
59
|
};
|
|
67
60
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -105,7 +98,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
105
98
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
106
99
|
const frozen = frozenMaxRef.current;
|
|
107
100
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
108
|
-
const { direction: next, top, left,
|
|
101
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
109
102
|
triggerRect,
|
|
110
103
|
popW,
|
|
111
104
|
effectiveH,
|
|
@@ -117,7 +110,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
117
110
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
118
111
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
119
112
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
120
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
121
113
|
directionRef.current = next;
|
|
122
114
|
pop.classList.toggle("top", next === "top");
|
|
123
115
|
pop.classList.toggle("bottom", next === "bottom");
|
|
@@ -87,18 +87,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
87
87
|
left = triggerRect.right - popW;
|
|
88
88
|
}
|
|
89
89
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
90
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
91
90
|
return {
|
|
92
91
|
direction,
|
|
93
92
|
top,
|
|
94
93
|
left,
|
|
95
|
-
maxHeight
|
|
96
|
-
over: {
|
|
97
|
-
top: Math.max(0, clip.top - top),
|
|
98
|
-
right: Math.max(0, left + popW - clip.right),
|
|
99
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
100
|
-
left: Math.max(0, clip.left - left)
|
|
101
|
-
}
|
|
94
|
+
maxHeight
|
|
102
95
|
};
|
|
103
96
|
};
|
|
104
97
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -142,7 +135,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
142
135
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
143
136
|
const frozen = frozenMaxRef.current;
|
|
144
137
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
145
|
-
const { direction: next, top, left,
|
|
138
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
146
139
|
triggerRect,
|
|
147
140
|
popW,
|
|
148
141
|
effectiveH,
|
|
@@ -154,7 +147,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
154
147
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
155
148
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
156
149
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
157
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
158
150
|
directionRef.current = next;
|
|
159
151
|
pop.classList.toggle("top", next === "top");
|
|
160
152
|
pop.classList.toggle("bottom", next === "bottom");
|
|
@@ -50,18 +50,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
50
50
|
left = triggerRect.right - popW;
|
|
51
51
|
}
|
|
52
52
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
53
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
54
53
|
return {
|
|
55
54
|
direction,
|
|
56
55
|
top,
|
|
57
56
|
left,
|
|
58
|
-
maxHeight
|
|
59
|
-
over: {
|
|
60
|
-
top: Math.max(0, clip.top - top),
|
|
61
|
-
right: Math.max(0, left + popW - clip.right),
|
|
62
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
63
|
-
left: Math.max(0, clip.left - left)
|
|
64
|
-
}
|
|
57
|
+
maxHeight
|
|
65
58
|
};
|
|
66
59
|
};
|
|
67
60
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -105,7 +98,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
105
98
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
106
99
|
const frozen = frozenMaxRef.current;
|
|
107
100
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
108
|
-
const { direction: next, top, left,
|
|
101
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
109
102
|
triggerRect,
|
|
110
103
|
popW,
|
|
111
104
|
effectiveH,
|
|
@@ -117,7 +110,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
117
110
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
118
111
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
119
112
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
120
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
121
113
|
directionRef.current = next;
|
|
122
114
|
pop.classList.toggle("top", next === "top");
|
|
123
115
|
pop.classList.toggle("bottom", next === "bottom");
|
|
@@ -86,18 +86,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
86
86
|
left = triggerRect.right - popW;
|
|
87
87
|
}
|
|
88
88
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
89
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
90
89
|
return {
|
|
91
90
|
direction,
|
|
92
91
|
top,
|
|
93
92
|
left,
|
|
94
|
-
maxHeight
|
|
95
|
-
over: {
|
|
96
|
-
top: Math.max(0, clip.top - top),
|
|
97
|
-
right: Math.max(0, left + popW - clip.right),
|
|
98
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
99
|
-
left: Math.max(0, clip.left - left)
|
|
100
|
-
}
|
|
93
|
+
maxHeight
|
|
101
94
|
};
|
|
102
95
|
};
|
|
103
96
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -141,7 +134,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
141
134
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
142
135
|
const frozen = frozenMaxRef.current;
|
|
143
136
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
144
|
-
const { direction: next, top, left,
|
|
137
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
145
138
|
triggerRect,
|
|
146
139
|
popW,
|
|
147
140
|
effectiveH,
|
|
@@ -153,7 +146,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
153
146
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
154
147
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
155
148
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
156
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
157
149
|
directionRef.current = next;
|
|
158
150
|
pop.classList.toggle("top", next === "top");
|
|
159
151
|
pop.classList.toggle("bottom", next === "bottom");
|
|
@@ -50,18 +50,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
50
50
|
left = triggerRect.right - popW;
|
|
51
51
|
}
|
|
52
52
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
53
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
54
53
|
return {
|
|
55
54
|
direction,
|
|
56
55
|
top,
|
|
57
56
|
left,
|
|
58
|
-
maxHeight
|
|
59
|
-
over: {
|
|
60
|
-
top: Math.max(0, clip.top - top),
|
|
61
|
-
right: Math.max(0, left + popW - clip.right),
|
|
62
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
63
|
-
left: Math.max(0, clip.left - left)
|
|
64
|
-
}
|
|
57
|
+
maxHeight
|
|
65
58
|
};
|
|
66
59
|
};
|
|
67
60
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -105,7 +98,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
105
98
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
106
99
|
const frozen = frozenMaxRef.current;
|
|
107
100
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
108
|
-
const { direction: next, top, left,
|
|
101
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
109
102
|
triggerRect,
|
|
110
103
|
popW,
|
|
111
104
|
effectiveH,
|
|
@@ -117,7 +110,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
117
110
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
118
111
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
119
112
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
120
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
121
113
|
directionRef.current = next;
|
|
122
114
|
pop.classList.toggle("top", next === "top");
|
|
123
115
|
pop.classList.toggle("bottom", next === "bottom");
|
|
@@ -3272,18 +3272,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
3272
3272
|
left = triggerRect.right - popW;
|
|
3273
3273
|
}
|
|
3274
3274
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
3275
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
3276
3275
|
return {
|
|
3277
3276
|
direction,
|
|
3278
3277
|
top,
|
|
3279
3278
|
left,
|
|
3280
|
-
maxHeight
|
|
3281
|
-
over: {
|
|
3282
|
-
top: Math.max(0, clip.top - top),
|
|
3283
|
-
right: Math.max(0, left + popW - clip.right),
|
|
3284
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
3285
|
-
left: Math.max(0, clip.left - left)
|
|
3286
|
-
}
|
|
3279
|
+
maxHeight
|
|
3287
3280
|
};
|
|
3288
3281
|
};
|
|
3289
3282
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -3327,7 +3320,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3327
3320
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
3328
3321
|
const frozen = frozenMaxRef.current;
|
|
3329
3322
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
3330
|
-
const { direction: next, top, left,
|
|
3323
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
3331
3324
|
triggerRect,
|
|
3332
3325
|
popW,
|
|
3333
3326
|
effectiveH,
|
|
@@ -3339,7 +3332,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3339
3332
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
3340
3333
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
3341
3334
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
3342
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
3343
3335
|
directionRef.current = next;
|
|
3344
3336
|
pop.classList.toggle("top", next === "top");
|
|
3345
3337
|
pop.classList.toggle("bottom", next === "bottom");
|
package/dist/components/index.js
CHANGED
|
@@ -3170,18 +3170,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
3170
3170
|
left = triggerRect.right - popW;
|
|
3171
3171
|
}
|
|
3172
3172
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
3173
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
3174
3173
|
return {
|
|
3175
3174
|
direction,
|
|
3176
3175
|
top,
|
|
3177
3176
|
left,
|
|
3178
|
-
maxHeight
|
|
3179
|
-
over: {
|
|
3180
|
-
top: Math.max(0, clip.top - top),
|
|
3181
|
-
right: Math.max(0, left + popW - clip.right),
|
|
3182
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
3183
|
-
left: Math.max(0, clip.left - left)
|
|
3184
|
-
}
|
|
3177
|
+
maxHeight
|
|
3185
3178
|
};
|
|
3186
3179
|
};
|
|
3187
3180
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -3225,7 +3218,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3225
3218
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
3226
3219
|
const frozen = frozenMaxRef.current;
|
|
3227
3220
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
3228
|
-
const { direction: next, top, left,
|
|
3221
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
3229
3222
|
triggerRect,
|
|
3230
3223
|
popW,
|
|
3231
3224
|
effectiveH,
|
|
@@ -3237,7 +3230,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3237
3230
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
3238
3231
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
3239
3232
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
3240
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
3241
3233
|
directionRef.current = next;
|
|
3242
3234
|
pop.classList.toggle("top", next === "top");
|
|
3243
3235
|
pop.classList.toggle("bottom", next === "bottom");
|
package/dist/index.cjs
CHANGED
|
@@ -7684,18 +7684,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
7684
7684
|
left = triggerRect.right - popW;
|
|
7685
7685
|
}
|
|
7686
7686
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
7687
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
7688
7687
|
return {
|
|
7689
7688
|
direction,
|
|
7690
7689
|
top,
|
|
7691
7690
|
left,
|
|
7692
|
-
maxHeight
|
|
7693
|
-
over: {
|
|
7694
|
-
top: Math.max(0, clip.top - top),
|
|
7695
|
-
right: Math.max(0, left + popW - clip.right),
|
|
7696
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
7697
|
-
left: Math.max(0, clip.left - left)
|
|
7698
|
-
}
|
|
7691
|
+
maxHeight
|
|
7699
7692
|
};
|
|
7700
7693
|
};
|
|
7701
7694
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -7739,7 +7732,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7739
7732
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
7740
7733
|
const frozen = frozenMaxRef.current;
|
|
7741
7734
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
7742
|
-
const { direction: next, top, left,
|
|
7735
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
7743
7736
|
triggerRect,
|
|
7744
7737
|
popW,
|
|
7745
7738
|
effectiveH,
|
|
@@ -7751,7 +7744,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7751
7744
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
7752
7745
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
7753
7746
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
7754
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
7755
7747
|
directionRef.current = next;
|
|
7756
7748
|
pop.classList.toggle("top", next === "top");
|
|
7757
7749
|
pop.classList.toggle("bottom", next === "bottom");
|
package/dist/index.js
CHANGED
|
@@ -7273,18 +7273,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
|
|
|
7273
7273
|
left = triggerRect.right - popW;
|
|
7274
7274
|
}
|
|
7275
7275
|
if (left < clip.left + 8) left = clip.left + 8;
|
|
7276
|
-
const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
|
|
7277
7276
|
return {
|
|
7278
7277
|
direction,
|
|
7279
7278
|
top,
|
|
7280
7279
|
left,
|
|
7281
|
-
maxHeight
|
|
7282
|
-
over: {
|
|
7283
|
-
top: Math.max(0, clip.top - top),
|
|
7284
|
-
right: Math.max(0, left + popW - clip.right),
|
|
7285
|
-
bottom: Math.max(0, top + drawnH - clip.bottom),
|
|
7286
|
-
left: Math.max(0, clip.left - left)
|
|
7287
|
-
}
|
|
7280
|
+
maxHeight
|
|
7288
7281
|
};
|
|
7289
7282
|
};
|
|
7290
7283
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
@@ -7328,7 +7321,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7328
7321
|
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
7329
7322
|
const frozen = frozenMaxRef.current;
|
|
7330
7323
|
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
7331
|
-
const { direction: next, top, left,
|
|
7324
|
+
const { direction: next, top, left, maxHeight: suggested } = computePlacement(
|
|
7332
7325
|
triggerRect,
|
|
7333
7326
|
popW,
|
|
7334
7327
|
effectiveH,
|
|
@@ -7340,7 +7333,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7340
7333
|
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
7341
7334
|
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
7342
7335
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
7343
|
-
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
7344
7336
|
directionRef.current = next;
|
|
7345
7337
|
pop.classList.toggle("top", next === "top");
|
|
7346
7338
|
pop.classList.toggle("bottom", next === "bottom");
|