srcdev-nuxt-components 6.1.21 → 6.1.22
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/app/components/accordian/AccordianCore.vue +1 -1
- package/app/components/animated-svg-text/AnimatedSvgText.vue +5 -5
- package/app/components/carousel-basic/CarouselBasic.vue +1 -1
- package/app/components/carousel-basic/CarouselFlip.vue +154 -133
- package/app/components/carousel-basic/CarouselInfinite.vue +120 -89
- package/app/components/clip-element/ClipElement.vue +18 -28
- package/app/components/clipped-panels/ClippedPanel.vue +1 -1
- package/app/components/container-glow/ContainerGlowCore.vue +62 -39
- package/app/components/deep-expanding-menu/DeepExpandingMenu.vue +1 -1
- package/app/components/deep-expanding-menu/DeepExpandingMenuOld.vue +1 -1
- package/app/components/display-banner/DisplayBanner.vue +1 -1
- package/app/components/display-card/DisplayCard.vue +1 -1
- package/app/components/display-details/DisplayDetailsCore.vue +1 -1
- package/app/components/display-dialog/DisplayDialogCore.vue +1 -1
- package/app/components/display-dialog/variants/DisplayDialogConfirm.vue +2 -2
- package/app/components/display-dialog/variants/DisplayDialogScrollableContent.vue +2 -2
- package/app/components/display-grid/DisplayGridCore.vue +4 -4
- package/app/components/display-prompt/DisplayPromptCore.vue +1 -1
- package/app/components/display-prompt/variants/DisplayPromptError.vue +1 -1
- package/app/components/display-toast/DisplayToast.vue +1 -1
- package/app/components/expanding-panel/ExpandingPanel.vue +1 -1
- package/app/components/glowing-border/GlowingBorder.vue +1 -1
- package/app/components/image-galleries/SliderGallery.vue +104 -103
- package/app/components/layout-grids/LayoutGridA.vue +5 -5
- package/app/components/layout-grids/LayoutGridB.vue +10 -10
- package/app/components/layout-row/LayoutRow.vue +1 -1
- package/app/components/magnetic-navigation/MagneticNavigation.vue +1 -1
- package/app/components/masonry-grid/MasonryGrid.vue +12 -8
- package/app/components/masonry-grid-ordered/MasonryGridOrdered.vue +1 -1
- package/app/components/masonry-grid-sorted/MasonryGridSorted.vue +26 -21
- package/app/components/parallax/SectionParallax.vue +1 -1
- package/app/components/pop-over/PopOver.vue +4 -4
- package/app/components/responsive-header/NavigationItems.vue +1 -1
- package/app/components/responsive-header/ResponsiveHeader.vue +1 -1
- package/app/components/rotating-carousel/RotatingCarouselImage.vue +1 -1
- package/app/components/tabs/TabsCore.vue +41 -20
- package/app/composables/useStyleClassPassthrough.ts +19 -22
- package/package.json +1 -1
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
19
|
const props = defineProps({
|
|
20
20
|
styleClassPassthrough: {
|
|
21
|
-
type: Array as PropType<string[]>,
|
|
21
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
22
22
|
default: () => [],
|
|
23
23
|
},
|
|
24
24
|
dataDialogId: {
|
|
25
25
|
type: String,
|
|
26
26
|
required: true,
|
|
27
27
|
},
|
|
28
|
-
})
|
|
28
|
+
})
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
31
|
<style lang="css">
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
19
|
const props = defineProps({
|
|
20
20
|
styleClassPassthrough: {
|
|
21
|
-
type: Array as PropType<string[]>,
|
|
21
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
22
22
|
default: () => [],
|
|
23
23
|
},
|
|
24
24
|
allowContentScroll: {
|
|
@@ -29,7 +29,7 @@ const props = defineProps({
|
|
|
29
29
|
type: String,
|
|
30
30
|
required: true,
|
|
31
31
|
},
|
|
32
|
-
})
|
|
32
|
+
})
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<style lang="css">
|
|
@@ -11,12 +11,12 @@ const props = defineProps({
|
|
|
11
11
|
default: {},
|
|
12
12
|
},
|
|
13
13
|
styleClassPassthrough: {
|
|
14
|
-
type: Array as PropType<string[]>,
|
|
14
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
15
15
|
default: () => [],
|
|
16
16
|
},
|
|
17
|
-
})
|
|
17
|
+
})
|
|
18
18
|
|
|
19
|
-
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
19
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
20
20
|
|
|
21
|
-
const gridData = toRef(() => props.gridData)
|
|
21
|
+
const gridData = toRef(() => props.gridData)
|
|
22
22
|
</script>
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
<div v-show="item.stylist !== ''" class="author" :class="item.textBrightness">{{ item.stylist }}</div>
|
|
14
14
|
<div v-show="item.title !== ''" class="title" :class="item.textBrightness">{{ item.title }}</div>
|
|
15
15
|
<div v-show="item.category !== ''" class="topic" :class="item.textBrightness">{{ item.category }}</div>
|
|
16
|
-
<div v-show="item.description !== ''" class="description" :class="item.textBrightness">
|
|
17
|
-
}}
|
|
16
|
+
<div v-show="item.description !== ''" class="description" :class="item.textBrightness">
|
|
17
|
+
{{ item.description }}
|
|
18
|
+
</div>
|
|
18
19
|
<div class="buttons" :class="item.textBrightness">
|
|
19
20
|
<button>SEE MORE</button>
|
|
20
21
|
</div>
|
|
@@ -27,10 +28,11 @@
|
|
|
27
28
|
<div class="inner">
|
|
28
29
|
<NuxtImg :src="item.src" :alt="item.alt" />
|
|
29
30
|
<div class="content" :class="item.textBrightness">
|
|
30
|
-
<div v-show="item.thumbnail?.title !== ''" class="title" :class="item.textBrightness">
|
|
31
|
-
item.thumbnail?.title }}
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
<div v-show="item.thumbnail?.title !== ''" class="title" :class="item.textBrightness">
|
|
32
|
+
{{ item.thumbnail?.title }}
|
|
33
|
+
</div>
|
|
34
|
+
<div v-show="item.thumbnail?.description !== ''" class="description" :class="item.textBrightness">
|
|
35
|
+
{{ item.thumbnail?.description }}
|
|
34
36
|
</div>
|
|
35
37
|
</div>
|
|
36
38
|
</div>
|
|
@@ -52,7 +54,7 @@
|
|
|
52
54
|
</template>
|
|
53
55
|
|
|
54
56
|
<script setup lang="ts">
|
|
55
|
-
import { type IGalleryData } from
|
|
57
|
+
import { type IGalleryData } from "@/types/gallery-data"
|
|
56
58
|
|
|
57
59
|
const props = defineProps({
|
|
58
60
|
autoRun: {
|
|
@@ -68,198 +70,197 @@ const props = defineProps({
|
|
|
68
70
|
default: 3000,
|
|
69
71
|
},
|
|
70
72
|
styleClassPassthrough: {
|
|
71
|
-
type: Array as PropType<string[]>,
|
|
73
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
72
74
|
default: () => [],
|
|
73
75
|
},
|
|
74
|
-
})
|
|
76
|
+
})
|
|
75
77
|
|
|
76
|
-
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
77
|
-
const galleryData = defineModel<IGalleryData[]>(
|
|
78
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
79
|
+
const galleryData = defineModel<IGalleryData[]>("galleryData")
|
|
78
80
|
|
|
79
|
-
const sliderGalleryWrapper = useTemplateRef(
|
|
80
|
-
const sliderGalleryImagesList = useTemplateRef(
|
|
81
|
-
const sliderGalleryThumbnailsList = useTemplateRef(
|
|
81
|
+
const sliderGalleryWrapper = useTemplateRef("sliderGalleryWrapper")
|
|
82
|
+
const sliderGalleryImagesList = useTemplateRef("sliderGalleryImagesList")
|
|
83
|
+
const sliderGalleryThumbnailsList = useTemplateRef("sliderGalleryThumbnailsList")
|
|
82
84
|
|
|
83
|
-
const transitionRunning = ref(false)
|
|
84
|
-
const galleryLoaded = ref(true)
|
|
85
|
-
const showGallery = ref(false)
|
|
86
|
-
const loadedImages = ref<Set<number>>(new Set())
|
|
87
|
-
const preloadedImages = ref<Array<HTMLImageElement>>([])
|
|
85
|
+
const transitionRunning = ref(false)
|
|
86
|
+
const galleryLoaded = ref(true)
|
|
87
|
+
const showGallery = ref(false)
|
|
88
|
+
const loadedImages = ref<Set<number>>(new Set())
|
|
89
|
+
const preloadedImages = ref<Array<HTMLImageElement>>([])
|
|
88
90
|
|
|
89
91
|
onMounted(async () => {
|
|
90
|
-
await nextTick()
|
|
92
|
+
await nextTick()
|
|
91
93
|
|
|
92
94
|
// If no images or galleryData is empty, stop loading
|
|
93
95
|
if (!galleryData.value || galleryData.value.length === 0) {
|
|
94
|
-
galleryLoaded.value = false
|
|
95
|
-
return
|
|
96
|
+
galleryLoaded.value = false
|
|
97
|
+
return
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
// Create an array to hold image loading promises
|
|
99
|
-
const imageLoadPromises: Promise<void>[] = []
|
|
101
|
+
const imageLoadPromises: Promise<void>[] = []
|
|
100
102
|
|
|
101
103
|
// Preload the first image at minimum
|
|
102
|
-
const firstImageIndex = 0
|
|
104
|
+
const firstImageIndex = 0
|
|
103
105
|
if (galleryData.value[firstImageIndex]) {
|
|
104
|
-
const img = new Image()
|
|
105
|
-
img.src = galleryData.value[firstImageIndex].src
|
|
106
|
+
const img = new Image()
|
|
107
|
+
img.src = galleryData.value[firstImageIndex].src
|
|
106
108
|
|
|
107
109
|
const promise = new Promise<void>((resolve) => {
|
|
108
110
|
img.onload = () => {
|
|
109
|
-
loadedImages.value.add(firstImageIndex)
|
|
110
|
-
resolve()
|
|
111
|
-
}
|
|
111
|
+
loadedImages.value.add(firstImageIndex)
|
|
112
|
+
resolve()
|
|
113
|
+
}
|
|
112
114
|
img.onerror = () => {
|
|
113
|
-
loadedImages.value.add(firstImageIndex)
|
|
114
|
-
resolve()
|
|
115
|
-
}
|
|
116
|
-
})
|
|
115
|
+
loadedImages.value.add(firstImageIndex) // Count as loaded anyway
|
|
116
|
+
resolve()
|
|
117
|
+
}
|
|
118
|
+
})
|
|
117
119
|
|
|
118
|
-
imageLoadPromises.push(promise)
|
|
119
|
-
preloadedImages.value.push(img)
|
|
120
|
+
imageLoadPromises.push(promise)
|
|
121
|
+
preloadedImages.value.push(img)
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
// Wait for at least the first image to load
|
|
123
|
-
await Promise.race(imageLoadPromises)
|
|
125
|
+
await Promise.race(imageLoadPromises)
|
|
124
126
|
|
|
125
127
|
setTimeout(() => {
|
|
126
|
-
galleryLoaded.value = false
|
|
127
|
-
}, 500)
|
|
128
|
+
galleryLoaded.value = false
|
|
129
|
+
}, 500)
|
|
128
130
|
|
|
129
|
-
showGallery.value = true
|
|
130
|
-
window.addEventListener(
|
|
131
|
-
})
|
|
131
|
+
showGallery.value = true
|
|
132
|
+
window.addEventListener("keydown", handleKeyDown)
|
|
133
|
+
})
|
|
132
134
|
|
|
133
135
|
const handleImageLoad = (index: number) => {
|
|
134
|
-
loadedImages.value.add(index)
|
|
135
|
-
}
|
|
136
|
+
loadedImages.value.add(index)
|
|
137
|
+
}
|
|
136
138
|
|
|
137
139
|
const handleImageError = (index: number) => {
|
|
138
|
-
loadedImages.value.add(index)
|
|
139
|
-
}
|
|
140
|
+
loadedImages.value.add(index)
|
|
141
|
+
}
|
|
140
142
|
|
|
141
143
|
const doNext = () => {
|
|
142
|
-
if (transitionRunning.value) return
|
|
143
|
-
showSlider(
|
|
144
|
-
}
|
|
144
|
+
if (transitionRunning.value) return
|
|
145
|
+
showSlider("next")
|
|
146
|
+
}
|
|
145
147
|
|
|
146
148
|
const doPrevious = () => {
|
|
147
|
-
if (transitionRunning.value) return
|
|
148
|
-
showSlider(
|
|
149
|
-
}
|
|
149
|
+
if (transitionRunning.value) return
|
|
150
|
+
showSlider("prev")
|
|
151
|
+
}
|
|
150
152
|
|
|
151
|
-
let runTimeOut: any
|
|
152
|
-
let runNextAuto: any = null
|
|
153
|
+
let runTimeOut: any
|
|
154
|
+
let runNextAuto: any = null
|
|
153
155
|
|
|
154
156
|
function showSlider(type: string) {
|
|
155
|
-
transitionRunning.value = true
|
|
157
|
+
transitionRunning.value = true
|
|
156
158
|
|
|
157
|
-
const currentSliderItems = Array.from(sliderGalleryImagesList.value?.children || [])
|
|
158
|
-
const currentThumbnailItems = Array.from(sliderGalleryThumbnailsList.value?.children || [])
|
|
159
|
+
const currentSliderItems = Array.from(sliderGalleryImagesList.value?.children || [])
|
|
160
|
+
const currentThumbnailItems = Array.from(sliderGalleryThumbnailsList.value?.children || [])
|
|
159
161
|
|
|
160
|
-
if (type ===
|
|
162
|
+
if (type === "next") {
|
|
161
163
|
if (currentSliderItems.length) {
|
|
162
|
-
const firstItem = currentSliderItems[0]
|
|
164
|
+
const firstItem = currentSliderItems[0]
|
|
163
165
|
if (firstItem) {
|
|
164
|
-
sliderGalleryImagesList.value?.appendChild(firstItem)
|
|
166
|
+
sliderGalleryImagesList.value?.appendChild(firstItem)
|
|
165
167
|
}
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
if (currentThumbnailItems.length) {
|
|
169
|
-
const firstThumb = currentThumbnailItems[0]
|
|
171
|
+
const firstThumb = currentThumbnailItems[0]
|
|
170
172
|
if (firstThumb) {
|
|
171
|
-
sliderGalleryThumbnailsList.value?.appendChild(firstThumb)
|
|
173
|
+
sliderGalleryThumbnailsList.value?.appendChild(firstThumb)
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
|
|
175
|
-
sliderGalleryWrapper.value?.classList.add(
|
|
177
|
+
sliderGalleryWrapper.value?.classList.add("next")
|
|
176
178
|
} else {
|
|
177
179
|
if (currentSliderItems.length) {
|
|
178
|
-
const lastItem = currentSliderItems[currentSliderItems.length - 1]
|
|
180
|
+
const lastItem = currentSliderItems[currentSliderItems.length - 1]
|
|
179
181
|
if (lastItem) {
|
|
180
|
-
lastItem.classList.add(
|
|
181
|
-
sliderGalleryImagesList.value?.prepend(lastItem)
|
|
182
|
+
lastItem.classList.add("prepend-item")
|
|
183
|
+
sliderGalleryImagesList.value?.prepend(lastItem)
|
|
182
184
|
}
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
if (currentThumbnailItems.length) {
|
|
186
|
-
const lastThumb = currentThumbnailItems[currentThumbnailItems.length - 1]
|
|
188
|
+
const lastThumb = currentThumbnailItems[currentThumbnailItems.length - 1]
|
|
187
189
|
if (lastThumb) {
|
|
188
|
-
lastThumb.classList.add(
|
|
189
|
-
sliderGalleryThumbnailsList.value?.prepend(lastThumb)
|
|
190
|
+
lastThumb.classList.add("prepend-item")
|
|
191
|
+
sliderGalleryThumbnailsList.value?.prepend(lastThumb)
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
194
|
|
|
193
|
-
sliderGalleryWrapper.value?.offsetWidth
|
|
194
|
-
sliderGalleryWrapper.value?.classList.add(
|
|
195
|
+
sliderGalleryWrapper.value?.offsetWidth // Force reflow
|
|
196
|
+
sliderGalleryWrapper.value?.classList.add("prev")
|
|
195
197
|
}
|
|
196
198
|
|
|
197
|
-
clearTimeout(runTimeOut)
|
|
199
|
+
clearTimeout(runTimeOut)
|
|
198
200
|
runTimeOut = setTimeout(() => {
|
|
199
|
-
|
|
200
201
|
if (sliderGalleryWrapper.value) {
|
|
201
|
-
sliderGalleryWrapper.value.classList.remove(
|
|
202
|
-
sliderGalleryWrapper.value.classList.remove(
|
|
202
|
+
sliderGalleryWrapper.value.classList.remove("next")
|
|
203
|
+
sliderGalleryWrapper.value.classList.remove("prev")
|
|
203
204
|
|
|
204
|
-
const items = sliderGalleryImagesList.value?.querySelectorAll(
|
|
205
|
-
items?.forEach((item) => item.classList.remove(
|
|
205
|
+
const items = sliderGalleryImagesList.value?.querySelectorAll(".prepend-item")
|
|
206
|
+
items?.forEach((item) => item.classList.remove("prepend-item"))
|
|
206
207
|
|
|
207
|
-
const thumbs = sliderGalleryThumbnailsList.value?.querySelectorAll(
|
|
208
|
-
thumbs?.forEach((thumb) => thumb.classList.remove(
|
|
208
|
+
const thumbs = sliderGalleryThumbnailsList.value?.querySelectorAll(".prepend-item")
|
|
209
|
+
thumbs?.forEach((thumb) => thumb.classList.remove("prepend-item"))
|
|
209
210
|
}
|
|
210
|
-
transitionRunning.value = false
|
|
211
|
-
}, props.animationDuration)
|
|
211
|
+
transitionRunning.value = false
|
|
212
|
+
}, props.animationDuration)
|
|
212
213
|
|
|
213
214
|
// Reset auto-run timer
|
|
214
|
-
clearTimeout(runNextAuto)
|
|
215
|
+
clearTimeout(runNextAuto)
|
|
215
216
|
runNextAuto = setTimeout(() => {
|
|
216
|
-
if (!props.autoRun || galleryLoaded.value) return
|
|
217
|
-
doNext()
|
|
218
|
-
}, props.autoRunInterval)
|
|
217
|
+
if (!props.autoRun || galleryLoaded.value) return
|
|
218
|
+
doNext()
|
|
219
|
+
}, props.autoRunInterval)
|
|
219
220
|
}
|
|
220
221
|
|
|
221
222
|
// Add keyboard navigation event handlers
|
|
222
223
|
const handleKeyDown = (event: KeyboardEvent) => {
|
|
223
224
|
// Don't process key events if transition is running or gallery isn't loaded
|
|
224
225
|
if (transitionRunning.value || galleryLoaded.value) {
|
|
225
|
-
return
|
|
226
|
+
return
|
|
226
227
|
}
|
|
227
228
|
|
|
228
|
-
if (event.key ===
|
|
229
|
-
doPrevious()
|
|
230
|
-
} else if (event.key ===
|
|
231
|
-
doNext()
|
|
229
|
+
if (event.key === "ArrowLeft") {
|
|
230
|
+
doPrevious()
|
|
231
|
+
} else if (event.key === "ArrowRight") {
|
|
232
|
+
doNext()
|
|
232
233
|
}
|
|
233
|
-
}
|
|
234
|
+
}
|
|
234
235
|
|
|
235
236
|
// Initialize auto-run only after loading completes
|
|
236
237
|
watch(galleryLoaded, (previousValue, currentValue) => {
|
|
237
238
|
if (!currentValue && props.autoRun) {
|
|
238
|
-
clearTimeout(runNextAuto)
|
|
239
|
+
clearTimeout(runNextAuto)
|
|
239
240
|
runNextAuto = setTimeout(() => {
|
|
240
|
-
doNext()
|
|
241
|
-
}, props.autoRunInterval)
|
|
241
|
+
doNext()
|
|
242
|
+
}, props.autoRunInterval)
|
|
242
243
|
}
|
|
243
|
-
})
|
|
244
|
+
})
|
|
244
245
|
|
|
245
246
|
watch(
|
|
246
247
|
() => props.styleClassPassthrough,
|
|
247
248
|
() => {
|
|
248
|
-
resetElementClasses(props.styleClassPassthrough)
|
|
249
|
+
resetElementClasses(props.styleClassPassthrough)
|
|
249
250
|
}
|
|
250
|
-
)
|
|
251
|
+
)
|
|
251
252
|
|
|
252
253
|
onBeforeUnmount(() => {
|
|
253
|
-
showGallery.value = false
|
|
254
|
-
clearTimeout(runTimeOut)
|
|
255
|
-
clearTimeout(runNextAuto)
|
|
256
|
-
window.removeEventListener(
|
|
257
|
-
})
|
|
254
|
+
showGallery.value = false
|
|
255
|
+
clearTimeout(runTimeOut)
|
|
256
|
+
clearTimeout(runNextAuto)
|
|
257
|
+
window.removeEventListener("keydown", handleKeyDown)
|
|
258
|
+
})
|
|
258
259
|
</script>
|
|
259
260
|
|
|
260
261
|
<style lang="css">
|
|
261
262
|
.slider-gallery {
|
|
262
|
-
--_animationDuration: v-bind(animationDuration +
|
|
263
|
+
--_animationDuration: v-bind(animationDuration + "ms");
|
|
263
264
|
|
|
264
265
|
--_thumbnailAspectRatio: 150 /220;
|
|
265
266
|
|
|
@@ -498,7 +499,7 @@ onBeforeUnmount(() => {
|
|
|
498
499
|
}
|
|
499
500
|
&.dark {
|
|
500
501
|
color: #000;
|
|
501
|
-
}
|
|
502
|
+
}
|
|
502
503
|
}
|
|
503
504
|
|
|
504
505
|
.description {
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
<script setup lang="ts">
|
|
21
21
|
const props = defineProps({
|
|
22
22
|
styleClassPassthrough: {
|
|
23
|
-
type: Array as PropType<string[]>,
|
|
23
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
24
24
|
default: () => [],
|
|
25
25
|
},
|
|
26
|
-
})
|
|
26
|
+
})
|
|
27
27
|
|
|
28
|
-
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
28
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
29
29
|
|
|
30
30
|
watch(
|
|
31
31
|
() => props.styleClassPassthrough,
|
|
32
32
|
() => {
|
|
33
|
-
resetElementClasses(props.styleClassPassthrough)
|
|
33
|
+
resetElementClasses(props.styleClassPassthrough)
|
|
34
34
|
}
|
|
35
|
-
)
|
|
35
|
+
)
|
|
36
36
|
</script>
|
|
37
37
|
|
|
38
38
|
<style lang="css">
|
|
@@ -40,19 +40,19 @@ const props = defineProps({
|
|
|
40
40
|
default: 4,
|
|
41
41
|
},
|
|
42
42
|
styleClassPassthrough: {
|
|
43
|
-
type: Array as PropType<string[]>,
|
|
43
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
44
44
|
default: () => [],
|
|
45
45
|
},
|
|
46
|
-
})
|
|
46
|
+
})
|
|
47
47
|
|
|
48
|
-
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
48
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
49
49
|
|
|
50
50
|
watch(
|
|
51
51
|
() => props.styleClassPassthrough,
|
|
52
52
|
() => {
|
|
53
|
-
resetElementClasses(props.styleClassPassthrough)
|
|
53
|
+
resetElementClasses(props.styleClassPassthrough)
|
|
54
54
|
}
|
|
55
|
-
)
|
|
55
|
+
)
|
|
56
56
|
</script>
|
|
57
57
|
|
|
58
58
|
<style lang="css">
|
|
@@ -82,15 +82,15 @@ watch(
|
|
|
82
82
|
|
|
83
83
|
grid-template-columns: 1fr;
|
|
84
84
|
grid-template-areas:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
"slot1"
|
|
86
|
+
"slot2"
|
|
87
|
+
"slot3";
|
|
88
88
|
|
|
89
89
|
@container (min-width: 1024px) {
|
|
90
90
|
grid-template-columns: 1fr minmax(460px, 33%);
|
|
91
91
|
grid-template-areas:
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
"slot1 slot2"
|
|
93
|
+
"slot3 slot2";
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="masonry-grid-wrapper"
|
|
4
|
+
:class="[elementClasses]"
|
|
5
|
+
:style="`--_masonry-grid-gap: ${gap}${unit}; --_item-min-width: ${itemMinWidth}px`"
|
|
6
|
+
>
|
|
3
7
|
<template v-for="item in gridData" :key="item.id">
|
|
4
8
|
<div class="masonry-grid-item">
|
|
5
9
|
<slot :name="item.id"></slot>
|
|
@@ -24,24 +28,24 @@ const props = defineProps({
|
|
|
24
28
|
},
|
|
25
29
|
unit: {
|
|
26
30
|
type: String,
|
|
27
|
-
default:
|
|
31
|
+
default: "rem",
|
|
28
32
|
},
|
|
29
33
|
styleClassPassthrough: {
|
|
30
|
-
type: Array as PropType<string[]>,
|
|
34
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
31
35
|
default: () => [],
|
|
32
36
|
},
|
|
33
|
-
})
|
|
37
|
+
})
|
|
34
38
|
|
|
35
|
-
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
39
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
36
40
|
|
|
37
|
-
const gridData = toRef(() => props.gridData)
|
|
41
|
+
const gridData = toRef(() => props.gridData)
|
|
38
42
|
|
|
39
43
|
watch(
|
|
40
44
|
() => props.styleClassPassthrough,
|
|
41
45
|
() => {
|
|
42
|
-
resetElementClasses(props.styleClassPassthrough)
|
|
46
|
+
resetElementClasses(props.styleClassPassthrough)
|
|
43
47
|
}
|
|
44
|
-
)
|
|
48
|
+
)
|
|
45
49
|
</script>
|
|
46
50
|
|
|
47
51
|
<style lang="css">
|