@fy-/fws-vue 2.3.28 → 2.3.30
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 +19 -57
- package/package.json +1 -1
|
@@ -129,53 +129,30 @@ 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 image sizing that relies on flexbox layout to handle 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() {
|
|
145
134
|
// Get the main image
|
|
146
135
|
const mainImage = document.querySelector('.image-display img') as HTMLImageElement
|
|
147
136
|
if (!mainImage) return
|
|
148
137
|
|
|
149
|
-
//
|
|
150
|
-
const
|
|
151
|
-
|
|
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
|
-
}
|
|
161
|
-
|
|
162
|
-
// Standard padding with extra safety margin
|
|
163
|
-
const padding = 40
|
|
164
|
-
|
|
165
|
-
// Calculate available height by subtracting ALL elements
|
|
166
|
-
const availableHeight = windowHeight.value - topHeight - infoHeight - padding
|
|
167
|
-
|
|
168
|
-
// Apply the exact height constraint to the image
|
|
169
|
-
mainImage.style.maxHeight = `${availableHeight}px`
|
|
170
|
-
mainImage.style.width = 'auto'
|
|
138
|
+
// Standard padding
|
|
139
|
+
const padding = 24
|
|
171
140
|
|
|
172
141
|
// Handle width constraints
|
|
173
142
|
const sidebarWidth = sidePanel.value ? 256 : 0
|
|
174
143
|
const availableWidth = windowWidth.value - sidebarWidth - padding * 2
|
|
144
|
+
|
|
145
|
+
// Set width constraints
|
|
175
146
|
mainImage.style.maxWidth = windowWidth.value <= 768
|
|
176
147
|
? '90vw'
|
|
177
148
|
: `${availableWidth}px`
|
|
178
|
-
|
|
149
|
+
|
|
150
|
+
// Let height be auto to preserve aspect ratio and fit in flexbox container
|
|
151
|
+
mainImage.style.height = 'auto'
|
|
152
|
+
|
|
153
|
+
// Set a reasonable max-height if needed
|
|
154
|
+
mainImage.style.maxHeight = '75vh'
|
|
155
|
+
}, 50)
|
|
179
156
|
|
|
180
157
|
// Modal controls
|
|
181
158
|
function setModal(value: boolean) {
|
|
@@ -579,9 +556,9 @@ onUnmounted(() => {
|
|
|
579
556
|
ref="galleryContentRef"
|
|
580
557
|
class="w-full h-full flex flex-col lg:flex-row"
|
|
581
558
|
>
|
|
582
|
-
<!-- Main Image Area
|
|
559
|
+
<!-- Main Image Area with flex column layout -->
|
|
583
560
|
<div
|
|
584
|
-
class="relative flex-1 h-full flex
|
|
561
|
+
class="relative flex-1 h-full flex flex-col"
|
|
585
562
|
:style="{ paddingTop: `${topControlsHeight}px` }"
|
|
586
563
|
:class="{ 'lg:pr-64': sidePanel, 'lg:max-w-[calc(100%-16rem)]': sidePanel }"
|
|
587
564
|
style="max-width: 100%;"
|
|
@@ -609,10 +586,10 @@ onUnmounted(() => {
|
|
|
609
586
|
</div>
|
|
610
587
|
</transition>
|
|
611
588
|
|
|
612
|
-
<!-- Image
|
|
589
|
+
<!-- Image Container - flex-grow to fill available space -->
|
|
613
590
|
<div
|
|
614
591
|
ref="imageContainerRef"
|
|
615
|
-
class="
|
|
592
|
+
class="flex-grow flex items-center justify-center"
|
|
616
593
|
@touchstart="touchStart"
|
|
617
594
|
@touchend="touchEnd"
|
|
618
595
|
>
|
|
@@ -682,7 +659,7 @@ onUnmounted(() => {
|
|
|
682
659
|
</div>
|
|
683
660
|
</transition>
|
|
684
661
|
|
|
685
|
-
<!-- Info Panel
|
|
662
|
+
<!-- Info Panel directly in flex column flow -->
|
|
686
663
|
<transition
|
|
687
664
|
enter-active-class="transition-all duration-300 ease-out"
|
|
688
665
|
enter-from-class="opacity-0 transform translate-y-4"
|
|
@@ -690,21 +667,11 @@ onUnmounted(() => {
|
|
|
690
667
|
leave-active-class="transition-all duration-300 ease-in"
|
|
691
668
|
leave-from-class="opacity-100 transform translate-y-0"
|
|
692
669
|
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"
|
|
699
670
|
>
|
|
700
671
|
<div
|
|
701
672
|
v-if="infoPanel && images[modelValue]"
|
|
702
673
|
ref="infoPanelRef"
|
|
703
|
-
class="
|
|
704
|
-
@transitionstart="updateImageSizes"
|
|
705
|
-
@transitionend="updateImageSizes"
|
|
706
|
-
@transitionrun="updateImageSizes"
|
|
707
|
-
@resize="updateImageSizes"
|
|
674
|
+
class="w-full px-4 py-3 backdrop-blur-md bg-fv-neutral-900/80 border-t border-fv-neutral-800"
|
|
708
675
|
>
|
|
709
676
|
<slot :value="images[modelValue]" />
|
|
710
677
|
</div>
|
|
@@ -723,7 +690,7 @@ onUnmounted(() => {
|
|
|
723
690
|
<div
|
|
724
691
|
v-if="sidePanel"
|
|
725
692
|
ref="sidePanelRef"
|
|
726
|
-
class="side-panel hidden lg:block absolute right-0 top-0 bottom-0 w-64
|
|
693
|
+
class="side-panel hidden lg:block absolute right-0 top-0 bottom-0 w-64 overflow-y-auto z-40 cool-scroll"
|
|
727
694
|
:style="{ paddingTop: `${topControlsHeight + 8}px` }"
|
|
728
695
|
>
|
|
729
696
|
<!-- Paging Controls if needed -->
|
|
@@ -954,11 +921,6 @@ onUnmounted(() => {
|
|
|
954
921
|
width: 100%;
|
|
955
922
|
border-top-left-radius: 0.5rem;
|
|
956
923
|
border-top-right-radius: 0.5rem;
|
|
957
|
-
position: absolute;
|
|
958
|
-
bottom: 0;
|
|
959
|
-
left: 0;
|
|
960
|
-
right: 0;
|
|
961
|
-
z-index: 50;
|
|
962
924
|
}
|
|
963
925
|
|
|
964
926
|
/* Transition styles for next (right) navigation */
|