@fy-/fws-vue 2.3.25 → 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 +55 -18
- package/package.json +1 -1
|
@@ -129,36 +129,53 @@ const currentImage = computed(() => {
|
|
|
129
129
|
const imageCount = computed(() => props.images.length)
|
|
130
130
|
const currentIndex = computed(() => modelValue.value + 1)
|
|
131
131
|
|
|
132
|
-
// Simple
|
|
132
|
+
// Simple direct approach that correctly handles the info panel
|
|
133
133
|
const updateImageSizes = useDebounceFn(() => {
|
|
134
|
-
//
|
|
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() {
|
|
145
|
+
// Get the main image
|
|
135
146
|
const mainImage = document.querySelector('.image-display img') as HTMLImageElement
|
|
136
147
|
if (!mainImage) return
|
|
137
148
|
|
|
138
|
-
//
|
|
149
|
+
// Get exact measurements of all UI elements
|
|
139
150
|
const topHeight = topControlsRef.value?.offsetHeight || 0
|
|
140
151
|
|
|
141
|
-
//
|
|
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
|
-
//
|
|
147
|
-
const
|
|
162
|
+
// Standard padding with extra safety margin
|
|
163
|
+
const padding = 40
|
|
148
164
|
|
|
149
|
-
// Calculate
|
|
150
|
-
const availableHeight = windowHeight.value - topHeight - infoHeight -
|
|
165
|
+
// Calculate available height by subtracting ALL elements
|
|
166
|
+
const availableHeight = windowHeight.value - topHeight - infoHeight - padding
|
|
151
167
|
|
|
152
|
-
// Apply
|
|
168
|
+
// Apply the exact height constraint to the image
|
|
153
169
|
mainImage.style.maxHeight = `${availableHeight}px`
|
|
154
170
|
mainImage.style.width = 'auto'
|
|
155
171
|
|
|
156
172
|
// Handle width constraints
|
|
157
173
|
const sidebarWidth = sidePanel.value ? 256 : 0
|
|
174
|
+
const availableWidth = windowWidth.value - sidebarWidth - padding * 2
|
|
158
175
|
mainImage.style.maxWidth = windowWidth.value <= 768
|
|
159
|
-
? '
|
|
160
|
-
: `${
|
|
161
|
-
}
|
|
176
|
+
? '90vw'
|
|
177
|
+
: `${availableWidth}px`
|
|
178
|
+
}
|
|
162
179
|
|
|
163
180
|
// Modal controls
|
|
164
181
|
function setModal(value: boolean) {
|
|
@@ -260,9 +277,16 @@ function toggleInfoPanel() {
|
|
|
260
277
|
infoPanel.value = !infoPanel.value
|
|
261
278
|
resetControlsTimer()
|
|
262
279
|
|
|
263
|
-
// 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
|
|
264
284
|
nextTick(() => {
|
|
265
285
|
updateImageSizes()
|
|
286
|
+
|
|
287
|
+
// Additional delayed updates to catch transitions
|
|
288
|
+
setTimeout(() => updateImageSizes(), 50)
|
|
289
|
+
setTimeout(() => updateImageSizes(), 300)
|
|
266
290
|
})
|
|
267
291
|
}
|
|
268
292
|
|
|
@@ -658,7 +682,7 @@ onUnmounted(() => {
|
|
|
658
682
|
</div>
|
|
659
683
|
</transition>
|
|
660
684
|
|
|
661
|
-
<!-- Info Panel Below Image -->
|
|
685
|
+
<!-- Info Panel Below Image positioned to not overlap with image -->
|
|
662
686
|
<transition
|
|
663
687
|
enter-active-class="transition-all duration-300 ease-out"
|
|
664
688
|
enter-from-class="opacity-0 transform translate-y-4"
|
|
@@ -666,12 +690,20 @@ onUnmounted(() => {
|
|
|
666
690
|
leave-active-class="transition-all duration-300 ease-in"
|
|
667
691
|
leave-from-class="opacity-100 transform translate-y-0"
|
|
668
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"
|
|
669
699
|
>
|
|
670
700
|
<div
|
|
671
701
|
v-if="infoPanel && images[modelValue]"
|
|
672
702
|
ref="infoPanelRef"
|
|
673
|
-
class="info-panel
|
|
703
|
+
class="info-panel px-4 py-3 backdrop-blur-md bg-fv-neutral-900/80"
|
|
704
|
+
@transitionstart="updateImageSizes"
|
|
674
705
|
@transitionend="updateImageSizes"
|
|
706
|
+
@transitionrun="updateImageSizes"
|
|
675
707
|
@resize="updateImageSizes"
|
|
676
708
|
>
|
|
677
709
|
<slot :value="images[modelValue]" />
|
|
@@ -922,6 +954,11 @@ onUnmounted(() => {
|
|
|
922
954
|
width: 100%;
|
|
923
955
|
border-top-left-radius: 0.5rem;
|
|
924
956
|
border-top-right-radius: 0.5rem;
|
|
957
|
+
position: absolute;
|
|
958
|
+
bottom: 0;
|
|
959
|
+
left: 0;
|
|
960
|
+
right: 0;
|
|
961
|
+
z-index: 50;
|
|
925
962
|
}
|
|
926
963
|
|
|
927
964
|
/* Transition styles for next (right) navigation */
|