srcdev-nuxt-components 2.5.18 → 4.0.0
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.
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script setup lang="ts">
|
|
55
|
-
import { type IGalleryData } from '
|
|
55
|
+
import { type IGalleryData } from '@/types/gallery-data';
|
|
56
56
|
|
|
57
57
|
const props = defineProps({
|
|
58
58
|
autoRun: {
|
|
@@ -106,12 +106,10 @@ onMounted(async () => {
|
|
|
106
106
|
|
|
107
107
|
const promise = new Promise<void>((resolve) => {
|
|
108
108
|
img.onload = () => {
|
|
109
|
-
console.log('Image preloaded:', firstImageIndex);
|
|
110
109
|
loadedImages.value.add(firstImageIndex);
|
|
111
110
|
resolve();
|
|
112
111
|
};
|
|
113
112
|
img.onerror = () => {
|
|
114
|
-
console.error('Failed to preload image:', firstImageIndex);
|
|
115
113
|
loadedImages.value.add(firstImageIndex); // Count as loaded anyway
|
|
116
114
|
resolve();
|
|
117
115
|
};
|
|
@@ -162,26 +160,34 @@ function showSlider(type: string) {
|
|
|
162
160
|
if (type === 'next') {
|
|
163
161
|
if (currentSliderItems.length) {
|
|
164
162
|
const firstItem = currentSliderItems[0];
|
|
165
|
-
|
|
163
|
+
if (firstItem) {
|
|
164
|
+
sliderGalleryImagesList.value?.appendChild(firstItem);
|
|
165
|
+
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
if (currentThumbnailItems.length) {
|
|
169
169
|
const firstThumb = currentThumbnailItems[0];
|
|
170
|
-
|
|
170
|
+
if (firstThumb) {
|
|
171
|
+
sliderGalleryThumbnailsList.value?.appendChild(firstThumb);
|
|
172
|
+
}
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
sliderGalleryWrapper.value?.classList.add('next');
|
|
174
176
|
} else {
|
|
175
177
|
if (currentSliderItems.length) {
|
|
176
178
|
const lastItem = currentSliderItems[currentSliderItems.length - 1];
|
|
177
|
-
lastItem
|
|
178
|
-
|
|
179
|
+
if (lastItem) {
|
|
180
|
+
lastItem.classList.add('prepend-item');
|
|
181
|
+
sliderGalleryImagesList.value?.prepend(lastItem);
|
|
182
|
+
}
|
|
179
183
|
}
|
|
180
184
|
|
|
181
185
|
if (currentThumbnailItems.length) {
|
|
182
186
|
const lastThumb = currentThumbnailItems[currentThumbnailItems.length - 1];
|
|
183
|
-
lastThumb
|
|
184
|
-
|
|
187
|
+
if (lastThumb) {
|
|
188
|
+
lastThumb.classList.add('prepend-item');
|
|
189
|
+
sliderGalleryThumbnailsList.value?.prepend(lastThumb);
|
|
190
|
+
}
|
|
185
191
|
}
|
|
186
192
|
|
|
187
193
|
sliderGalleryWrapper.value?.offsetWidth; // Force reflow
|
package/nuxt.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "srcdev-nuxt-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"main": "nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@nuxt/icon": "1.12.0",
|
|
33
33
|
"@nuxt/image": "1.10.0",
|
|
34
34
|
"happy-dom": "16.8.1",
|
|
35
|
-
"nuxt": "3.17.
|
|
35
|
+
"nuxt": "3.17.5",
|
|
36
36
|
"release-it": "18.1.2",
|
|
37
37
|
"typescript": "5.8.3"
|
|
38
38
|
},
|