@bagelink/vue 1.5.28 → 1.5.32
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/package.json
CHANGED
|
@@ -22,14 +22,14 @@ function close() {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function next() {
|
|
25
|
-
if (
|
|
25
|
+
if (group.length > 1) {
|
|
26
26
|
currentIndex = (currentIndex + 1) % group.length
|
|
27
27
|
currentItem = group[currentIndex]
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function prev() {
|
|
32
|
-
if (
|
|
32
|
+
if (group.length > 1) {
|
|
33
33
|
currentIndex = (currentIndex - 1 + group.length) % group.length
|
|
34
34
|
currentItem = group[currentIndex]
|
|
35
35
|
}
|
|
@@ -41,16 +41,16 @@ function selectItem(index: number) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
watch(() => isOpen, (val) => {
|
|
44
|
-
if (val) {document.body.style.overflow = 'hidden'}
|
|
45
|
-
else {document.body.style.overflow = ''}
|
|
44
|
+
if (val) { document.body.style.overflow = 'hidden' }
|
|
45
|
+
else { document.body.style.overflow = '' }
|
|
46
46
|
})
|
|
47
47
|
|
|
48
48
|
function handleKeydown(event: KeyboardEvent) {
|
|
49
|
-
if ('Escape'
|
|
49
|
+
if (event.key === 'Escape') {
|
|
50
50
|
close()
|
|
51
|
-
} else if ('ArrowLeft'
|
|
51
|
+
} else if (event.key === 'ArrowLeft') {
|
|
52
52
|
prev()
|
|
53
|
-
} else if ('ArrowRight'
|
|
53
|
+
} else if (event.key === 'ArrowRight') {
|
|
54
54
|
next()
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -58,7 +58,7 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
58
58
|
const zoom = $ref(1)
|
|
59
59
|
|
|
60
60
|
function clickOutside() {
|
|
61
|
-
if (
|
|
61
|
+
if (zoom === 1) { close() }
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
defineExpose({ open, close })
|
|
@@ -69,25 +69,15 @@ defineExpose({ open, close })
|
|
|
69
69
|
<div
|
|
70
70
|
v-if="isOpen"
|
|
71
71
|
class="bgl-lightbox-overlay fixed w-100 h-100 flex justify-content-center z-9999 inset mx-auto"
|
|
72
|
-
@keydown.esc="close"
|
|
73
|
-
@keydown.left="prev"
|
|
74
|
-
@keydown.right="next"
|
|
75
|
-
@click="clickOutside"
|
|
72
|
+
@keydown.esc="close" @keydown.left="prev" @keydown.right="next" @click="clickOutside"
|
|
76
73
|
>
|
|
77
|
-
<div
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/>
|
|
84
|
-
|
|
85
|
-
<Btn
|
|
86
|
-
class="oval opacity-8"
|
|
87
|
-
icon="arrow_forward"
|
|
88
|
-
color="black"
|
|
89
|
-
@click="next"
|
|
90
|
-
/>
|
|
74
|
+
<div
|
|
75
|
+
v-if="group && group.length > 1"
|
|
76
|
+
class="navigation flex space-between px-3 w-100 absolute m_px-1 m_none z-9"
|
|
77
|
+
>
|
|
78
|
+
<Btn class="oval opacity-8" icon="arrow_back" color="black" @click="prev" />
|
|
79
|
+
|
|
80
|
+
<Btn class="oval opacity-8" icon="arrow_forward" color="black" @click="next" />
|
|
91
81
|
</div>
|
|
92
82
|
<div class="bgl-lightbox relative txt-center" @click.stop>
|
|
93
83
|
<div class="flex start fixed top-1 w-100 space-between px-1 z-9">
|
|
@@ -98,44 +88,37 @@ defineExpose({ open, close })
|
|
|
98
88
|
<Btn flat class="color-white" icon="add" :disabled="zoom === 3" @click="zoom++" />
|
|
99
89
|
</div>
|
|
100
90
|
<Btn
|
|
101
|
-
v-if="currentItem?.openFile && currentItem?.src" class="color-white" round thin flat
|
|
102
|
-
value="Open File"
|
|
103
|
-
:href="currentItem?.src"
|
|
104
|
-
target="_blank"
|
|
91
|
+
v-if="currentItem?.openFile && currentItem?.src" class="color-white" round thin flat
|
|
92
|
+
iconEnd="arrow_outward" value="Open File" :href="currentItem?.src" target="_blank"
|
|
105
93
|
/>
|
|
106
94
|
<Btn
|
|
107
|
-
v-if="currentItem?.download && currentItem?.src" class="color-white" round thin flat
|
|
108
|
-
value="Download File"
|
|
109
|
-
@click="downloadFile(currentItem?.src)"
|
|
95
|
+
v-if="currentItem?.download && currentItem?.src" class="color-white" round thin flat
|
|
96
|
+
icon="download" value="Download File" @click="downloadFile(currentItem?.src)"
|
|
110
97
|
/>
|
|
111
98
|
<div v-if="!currentItem?.openFile && !currentItem?.download" />
|
|
112
99
|
</div>
|
|
113
100
|
|
|
114
|
-
<Carousel
|
|
101
|
+
<Carousel
|
|
102
|
+
v-model:index="currentIndex" :items="1" class="bgl-lightbox-item"
|
|
103
|
+
:class="{ zoomed: zoom > 1 }" :freeDrag="zoom === 1"
|
|
104
|
+
>
|
|
115
105
|
<template v-for="item in group" :key="item.src">
|
|
116
|
-
<Zoomer
|
|
106
|
+
<Zoomer
|
|
107
|
+
v-if="item.type === 'image'" v-model:zoom="zoom" :disabled="!item?.enableZoom"
|
|
108
|
+
:mouse-wheel-to-zoom="false"
|
|
109
|
+
>
|
|
117
110
|
<Image :draggable="false" :src="item?.src" alt="Preview" class="vw90 lightbox-image" />
|
|
118
111
|
</Zoomer>
|
|
119
112
|
|
|
120
113
|
<BglVideo
|
|
121
|
-
v-else-if="item?.type === 'video' && item?.src"
|
|
122
|
-
:src="item?.src"
|
|
123
|
-
autoplay
|
|
124
|
-
controls
|
|
114
|
+
v-else-if="item?.type === 'video' && item?.src" :src="item?.src" autoplay controls
|
|
125
115
|
class="vw90"
|
|
126
116
|
/>
|
|
127
117
|
|
|
128
|
-
<div
|
|
129
|
-
v-else-if="item?.type === 'pdf' && item?.src"
|
|
130
|
-
class="vw90"
|
|
131
|
-
>
|
|
118
|
+
<div v-else-if="item?.type === 'pdf' && item?.src" class="vw90">
|
|
132
119
|
<embed
|
|
133
|
-
:src="normalizeURL(item?.src)"
|
|
134
|
-
|
|
135
|
-
width="100%"
|
|
136
|
-
height="1080"
|
|
137
|
-
:title="item?.name"
|
|
138
|
-
class="vw90"
|
|
120
|
+
:src="normalizeURL(item?.src)" type="application/pdf" width="100%" height="1080"
|
|
121
|
+
:title="item?.name" class="vw90"
|
|
139
122
|
>
|
|
140
123
|
</div>
|
|
141
124
|
<div v-else class="vw90">
|
|
@@ -164,30 +147,19 @@ defineExpose({ open, close })
|
|
|
164
147
|
</template>
|
|
165
148
|
</Carousel>
|
|
166
149
|
<div
|
|
167
|
-
v-if="group && group.length > 1"
|
|
168
|
-
class="flex justify-content-center mt-2 overflow
|
|
150
|
+
v-if="group && group.length > 1" class="flex justify-content-center mt-2 overflow
|
|
169
151
|
p-1 fixed bottom start end gap-1 m_justify-content-start"
|
|
170
152
|
>
|
|
171
|
-
<template
|
|
172
|
-
v-for="(item, index) in group"
|
|
173
|
-
:key="index"
|
|
174
|
-
>
|
|
153
|
+
<template v-for="(item, index) in group" :key="index">
|
|
175
154
|
<Image
|
|
176
|
-
v-if="item.type === 'image'"
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
:src="item.src"
|
|
180
|
-
alt=""
|
|
181
|
-
:class="{ active: currentIndex === index }"
|
|
182
|
-
@click="selectItem(index)"
|
|
155
|
+
v-if="item.type === 'image'" class="thumbnail object-fit-cover hover
|
|
156
|
+
opacity-5 rounded flex bg-popup justify-content-center align-items-center flex-shrink-0" :src="item.src" alt=""
|
|
157
|
+
:class="{ active: currentIndex === index }" @click="selectItem(index)"
|
|
183
158
|
/>
|
|
184
159
|
<Icon
|
|
185
|
-
v-else
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
icon="description"
|
|
189
|
-
:class="{ active: currentIndex === index }"
|
|
190
|
-
@click="selectItem(index)"
|
|
160
|
+
v-else class="thumbnail object-fit-cover hover
|
|
161
|
+
opacity-5 ed flex bg-popup justify-content-center align-items-center flex-shrink-0" icon="description"
|
|
162
|
+
:class="{ active: currentIndex === index }" @click="selectItem(index)"
|
|
191
163
|
/>
|
|
192
164
|
</template>
|
|
193
165
|
</div>
|
|
@@ -200,15 +172,18 @@ defineExpose({ open, close })
|
|
|
200
172
|
.bgl-lightbox:has(.bgl_vid) {
|
|
201
173
|
width: 90vw;
|
|
202
174
|
}
|
|
175
|
+
|
|
203
176
|
.bgl-lightbox:has(.vid_short) {
|
|
204
177
|
width: auto;
|
|
205
178
|
aspect-ratio: 9/16;
|
|
206
179
|
height: 90vh;
|
|
207
180
|
}
|
|
181
|
+
|
|
208
182
|
.bgl-lightbox:has(.vid_short) .bgl-lightbox-item * {
|
|
209
|
-
|
|
183
|
+
max-height: unset !important;
|
|
210
184
|
}
|
|
211
|
-
|
|
185
|
+
|
|
186
|
+
.lightbox-image {
|
|
212
187
|
object-fit: contain;
|
|
213
188
|
width: fit-content;
|
|
214
189
|
}
|
|
@@ -221,18 +196,19 @@ defineExpose({ open, close })
|
|
|
221
196
|
max-height: 90%;
|
|
222
197
|
}
|
|
223
198
|
|
|
224
|
-
.bgl-lightbox-item{
|
|
199
|
+
.bgl-lightbox-item {
|
|
225
200
|
animation: 500ms ease bgl-lightbox-load;
|
|
226
201
|
}
|
|
202
|
+
|
|
227
203
|
@keyframes bgl-lightbox-load {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
204
|
+
from {
|
|
205
|
+
scale: 0.7;
|
|
206
|
+
}
|
|
231
207
|
|
|
232
|
-
|
|
233
|
-
|
|
208
|
+
to {
|
|
209
|
+
scale: 1;
|
|
234
210
|
|
|
235
|
-
|
|
211
|
+
}
|
|
236
212
|
}
|
|
237
213
|
|
|
238
214
|
.bgl-lightbox-item * {
|
|
@@ -248,6 +224,14 @@ defineExpose({ open, close })
|
|
|
248
224
|
height: calc(100vh - 90px);
|
|
249
225
|
}
|
|
250
226
|
|
|
227
|
+
.bgl-lightbox-item.zoomed {
|
|
228
|
+
pointer-events: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.bgl-lightbox-item.zoomed .vue-zoomer {
|
|
232
|
+
pointer-events: auto;
|
|
233
|
+
}
|
|
234
|
+
|
|
251
235
|
.navigation {
|
|
252
236
|
top: 50%;
|
|
253
237
|
transform: translateY(-50%);
|
|
@@ -257,9 +241,11 @@ defineExpose({ open, close })
|
|
|
257
241
|
height: 50px;
|
|
258
242
|
width: 50px;
|
|
259
243
|
}
|
|
244
|
+
|
|
260
245
|
.thumbnail:hover {
|
|
261
246
|
opacity: 1;
|
|
262
247
|
}
|
|
248
|
+
|
|
263
249
|
.thumbnail:active {
|
|
264
250
|
opacity: 0.8;
|
|
265
251
|
}
|
|
@@ -268,18 +254,21 @@ defineExpose({ open, close })
|
|
|
268
254
|
opacity: 1;
|
|
269
255
|
outline: 2px solid white;
|
|
270
256
|
}
|
|
271
|
-
|
|
257
|
+
|
|
258
|
+
.file-info {
|
|
272
259
|
max-width: 420px
|
|
273
260
|
}
|
|
261
|
+
|
|
274
262
|
@media screen and (max-width: 910px) {
|
|
275
|
-
.file-info{
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
263
|
+
.file-info {
|
|
264
|
+
max-width: 220px;
|
|
265
|
+
text-align: center !important;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.file-info * {
|
|
269
|
+
text-align: center !important;
|
|
270
|
+
margin-inline: 0 !important;
|
|
271
|
+
max-width: 100% !important;
|
|
272
|
+
}
|
|
284
273
|
}
|
|
285
274
|
</style>
|