@eric-emg/symphiq-components 1.2.62 → 1.2.64
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.
|
@@ -11192,8 +11192,21 @@ class TooltipContainerComponent {
|
|
|
11192
11192
|
const padding = 10;
|
|
11193
11193
|
const bounds = this.viewportBounds();
|
|
11194
11194
|
// Calculate effective viewport boundaries
|
|
11195
|
-
|
|
11195
|
+
// Only use actual window edges (0 and window.innerWidth) for constraints
|
|
11196
|
+
// Don't let container bounds force tooltips away from edges
|
|
11197
|
+
const effectiveLeft = 0;
|
|
11196
11198
|
const effectiveRight = bounds?.right ?? window.innerWidth;
|
|
11199
|
+
console.log('🔍 [Tooltip calculateLeft]', {
|
|
11200
|
+
position,
|
|
11201
|
+
'rect.left': rect.left,
|
|
11202
|
+
'rect.right': rect.right,
|
|
11203
|
+
'rect.width': rect.width,
|
|
11204
|
+
tooltipWidth,
|
|
11205
|
+
bounds,
|
|
11206
|
+
effectiveLeft,
|
|
11207
|
+
effectiveRight,
|
|
11208
|
+
'window.innerWidth': window.innerWidth
|
|
11209
|
+
});
|
|
11197
11210
|
// Handle 'auto' positioning with mouse coordinates
|
|
11198
11211
|
if (position === 'auto' && mousePos) {
|
|
11199
11212
|
const halfWidth = tooltipWidth / 2;
|
|
@@ -11215,16 +11228,31 @@ class TooltipContainerComponent {
|
|
|
11215
11228
|
// Check if centered tooltip would go off bounds
|
|
11216
11229
|
const wouldGoOffLeft = centerPosition - halfWidth < effectiveLeft + padding;
|
|
11217
11230
|
const wouldGoOffRight = centerPosition + halfWidth > effectiveRight - padding;
|
|
11231
|
+
console.log('📍 [Tooltip top/bottom calculation]', {
|
|
11232
|
+
centerPosition,
|
|
11233
|
+
halfWidth,
|
|
11234
|
+
'centerPosition - halfWidth': centerPosition - halfWidth,
|
|
11235
|
+
'centerPosition + halfWidth': centerPosition + halfWidth,
|
|
11236
|
+
wouldGoOffLeft,
|
|
11237
|
+
wouldGoOffRight,
|
|
11238
|
+
'effectiveLeft + padding': effectiveLeft + padding,
|
|
11239
|
+
'effectiveRight - padding': effectiveRight - padding
|
|
11240
|
+
});
|
|
11218
11241
|
if (wouldGoOffLeft) {
|
|
11219
11242
|
// Align to left edge with padding
|
|
11220
|
-
|
|
11243
|
+
const result = effectiveLeft + padding + halfWidth;
|
|
11244
|
+
console.log('⬅️ [Tooltip adjusting LEFT]', { result });
|
|
11245
|
+
return result;
|
|
11221
11246
|
}
|
|
11222
11247
|
else if (wouldGoOffRight) {
|
|
11223
11248
|
// Align to right edge with padding
|
|
11224
|
-
|
|
11249
|
+
const result = effectiveRight - padding - halfWidth;
|
|
11250
|
+
console.log('➡️ [Tooltip adjusting RIGHT]', { result });
|
|
11251
|
+
return result;
|
|
11225
11252
|
}
|
|
11226
11253
|
else {
|
|
11227
11254
|
// Center normally (transform will be applied)
|
|
11255
|
+
console.log('🎯 [Tooltip centered]', { centerPosition });
|
|
11228
11256
|
return centerPosition;
|
|
11229
11257
|
}
|
|
11230
11258
|
}
|
|
@@ -11232,20 +11260,28 @@ class TooltipContainerComponent {
|
|
|
11232
11260
|
const leftPosition = rect.left - tooltipWidth - 8;
|
|
11233
11261
|
// If tooltip would go off left edge, position it to the right instead
|
|
11234
11262
|
if (leftPosition < effectiveLeft + padding) {
|
|
11235
|
-
|
|
11263
|
+
const result = rect.right + 8;
|
|
11264
|
+
console.log('⬅️➡️ [Tooltip LEFT flipped to RIGHT]', { leftPosition, result });
|
|
11265
|
+
return result;
|
|
11236
11266
|
}
|
|
11267
|
+
console.log('⬅️ [Tooltip LEFT]', { leftPosition });
|
|
11237
11268
|
return leftPosition;
|
|
11238
11269
|
}
|
|
11239
11270
|
case 'right': {
|
|
11240
11271
|
const rightPosition = rect.right + 8;
|
|
11241
11272
|
// If tooltip would go off right edge, position it to the left instead
|
|
11242
11273
|
if (rightPosition + tooltipWidth > effectiveRight - padding) {
|
|
11243
|
-
|
|
11274
|
+
const result = rect.left - tooltipWidth - 8;
|
|
11275
|
+
console.log('➡️⬅️ [Tooltip RIGHT flipped to LEFT]', { rightPosition, result });
|
|
11276
|
+
return result;
|
|
11244
11277
|
}
|
|
11278
|
+
console.log('➡️ [Tooltip RIGHT]', { rightPosition });
|
|
11245
11279
|
return rightPosition;
|
|
11246
11280
|
}
|
|
11247
11281
|
default:
|
|
11248
|
-
|
|
11282
|
+
const defaultResult = rect.left + rect.width / 2;
|
|
11283
|
+
console.log('🔄 [Tooltip DEFAULT]', { defaultResult });
|
|
11284
|
+
return defaultResult;
|
|
11249
11285
|
}
|
|
11250
11286
|
}
|
|
11251
11287
|
calculateTop() {
|
|
@@ -11258,7 +11294,8 @@ class TooltipContainerComponent {
|
|
|
11258
11294
|
const padding = 10;
|
|
11259
11295
|
const bounds = this.viewportBounds();
|
|
11260
11296
|
// Calculate effective viewport boundaries
|
|
11261
|
-
|
|
11297
|
+
// Use actual window edges for constraints
|
|
11298
|
+
const effectiveTop = 0;
|
|
11262
11299
|
const effectiveBottom = bounds?.bottom ?? window.innerHeight;
|
|
11263
11300
|
// Estimate tooltip height based on type
|
|
11264
11301
|
let estimatedHeight = 100;
|