@fy-/fws-vue 2.3.27 → 2.3.28
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/components/ui/DefaultGallery.vue +46 -10
- package/package.json +1 -1
|
@@ -131,6 +131,17 @@ const currentIndex = computed(() => modelValue.value + 1)
|
|
|
131
131
|
|
|
132
132
|
// Simple direct approach that correctly handles the info panel
|
|
133
133
|
const updateImageSizes = useDebounceFn(() => {
|
|
134
|
+
// First immediately run to prevent lag in calculations
|
|
135
|
+
forceUpdateImageSizes()
|
|
136
|
+
|
|
137
|
+
// Then run again after a short delay to ensure all DOM updates are applied
|
|
138
|
+
setTimeout(() => {
|
|
139
|
+
forceUpdateImageSizes()
|
|
140
|
+
}, 10)
|
|
141
|
+
}, 50)
|
|
142
|
+
|
|
143
|
+
// Directly update image sizes without debounce to ensure immediate layout updates
|
|
144
|
+
function forceUpdateImageSizes() {
|
|
134
145
|
// Get the main image
|
|
135
146
|
const mainImage = document.querySelector('.image-display img') as HTMLImageElement
|
|
136
147
|
if (!mainImage) return
|
|
@@ -138,13 +149,18 @@ const updateImageSizes = useDebounceFn(() => {
|
|
|
138
149
|
// Get exact measurements of all UI elements
|
|
139
150
|
const topHeight = topControlsRef.value?.offsetHeight || 0
|
|
140
151
|
|
|
141
|
-
// CRITICAL:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
152
|
+
// CRITICAL: Get actual DOM measurement for info panel, not just reactive ref value
|
|
153
|
+
let infoHeight = 0
|
|
154
|
+
if (infoPanel.value && infoPanelRef.value) {
|
|
155
|
+
infoHeight = infoPanelRef.value.offsetHeight
|
|
156
|
+
// Ensure we have a real measurement
|
|
157
|
+
if (infoHeight < 5 && infoPanelRef.value.firstElementChild) {
|
|
158
|
+
infoHeight = (infoPanelRef.value.firstElementChild as HTMLElement).offsetHeight + 24 // Add padding
|
|
159
|
+
}
|
|
160
|
+
}
|
|
145
161
|
|
|
146
|
-
// Standard padding
|
|
147
|
-
const padding =
|
|
162
|
+
// Standard padding with extra safety margin
|
|
163
|
+
const padding = 40
|
|
148
164
|
|
|
149
165
|
// Calculate available height by subtracting ALL elements
|
|
150
166
|
const availableHeight = windowHeight.value - topHeight - infoHeight - padding
|
|
@@ -159,7 +175,7 @@ const updateImageSizes = useDebounceFn(() => {
|
|
|
159
175
|
mainImage.style.maxWidth = windowWidth.value <= 768
|
|
160
176
|
? '90vw'
|
|
161
177
|
: `${availableWidth}px`
|
|
162
|
-
}
|
|
178
|
+
}
|
|
163
179
|
|
|
164
180
|
// Modal controls
|
|
165
181
|
function setModal(value: boolean) {
|
|
@@ -261,9 +277,16 @@ function toggleInfoPanel() {
|
|
|
261
277
|
infoPanel.value = !infoPanel.value
|
|
262
278
|
resetControlsTimer()
|
|
263
279
|
|
|
264
|
-
// Update layout after
|
|
280
|
+
// Update layout immediately AND after nextTick to ensure DOM updates
|
|
281
|
+
updateImageSizes()
|
|
282
|
+
|
|
283
|
+
// Schedule multiple updates to handle any transition effects
|
|
265
284
|
nextTick(() => {
|
|
266
285
|
updateImageSizes()
|
|
286
|
+
|
|
287
|
+
// Additional delayed updates to catch transitions
|
|
288
|
+
setTimeout(() => updateImageSizes(), 50)
|
|
289
|
+
setTimeout(() => updateImageSizes(), 300)
|
|
267
290
|
})
|
|
268
291
|
}
|
|
269
292
|
|
|
@@ -659,7 +682,7 @@ onUnmounted(() => {
|
|
|
659
682
|
</div>
|
|
660
683
|
</transition>
|
|
661
684
|
|
|
662
|
-
<!-- Info Panel Below Image -->
|
|
685
|
+
<!-- Info Panel Below Image positioned to not overlap with image -->
|
|
663
686
|
<transition
|
|
664
687
|
enter-active-class="transition-all duration-300 ease-out"
|
|
665
688
|
enter-from-class="opacity-0 transform translate-y-4"
|
|
@@ -667,12 +690,20 @@ onUnmounted(() => {
|
|
|
667
690
|
leave-active-class="transition-all duration-300 ease-in"
|
|
668
691
|
leave-from-class="opacity-100 transform translate-y-0"
|
|
669
692
|
leave-to-class="opacity-0 transform translate-y-4"
|
|
693
|
+
@before-enter="updateImageSizes"
|
|
694
|
+
@enter="updateImageSizes"
|
|
695
|
+
@after-enter="updateImageSizes"
|
|
696
|
+
@before-leave="updateImageSizes"
|
|
697
|
+
@leave="updateImageSizes"
|
|
698
|
+
@after-leave="updateImageSizes"
|
|
670
699
|
>
|
|
671
700
|
<div
|
|
672
701
|
v-if="infoPanel && images[modelValue]"
|
|
673
702
|
ref="infoPanelRef"
|
|
674
|
-
class="info-panel
|
|
703
|
+
class="info-panel px-4 py-3 backdrop-blur-md bg-fv-neutral-900/80"
|
|
704
|
+
@transitionstart="updateImageSizes"
|
|
675
705
|
@transitionend="updateImageSizes"
|
|
706
|
+
@transitionrun="updateImageSizes"
|
|
676
707
|
@resize="updateImageSizes"
|
|
677
708
|
>
|
|
678
709
|
<slot :value="images[modelValue]" />
|
|
@@ -923,6 +954,11 @@ onUnmounted(() => {
|
|
|
923
954
|
width: 100%;
|
|
924
955
|
border-top-left-radius: 0.5rem;
|
|
925
956
|
border-top-right-radius: 0.5rem;
|
|
957
|
+
position: absolute;
|
|
958
|
+
bottom: 0;
|
|
959
|
+
left: 0;
|
|
960
|
+
right: 0;
|
|
961
|
+
z-index: 50;
|
|
926
962
|
}
|
|
927
963
|
|
|
928
964
|
/* Transition styles for next (right) navigation */
|