@leaflink/stash 42.5.2 → 42.6.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.
- package/dist/Carousel.js +180 -176
- package/dist/Carousel.js.map +1 -1
- package/dist/Carousel.vue.d.ts +6 -0
- package/dist/components.css +1 -1
- package/package.json +1 -1
package/dist/Carousel.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Y, inject as b, reactive as M, ref as d, h as S, provide as A, onMounted as
|
|
1
|
+
import { defineComponent as Y, inject as b, reactive as M, ref as d, h as S, provide as A, onMounted as Ie, nextTick as Ee, onUnmounted as je, computed as xe, watch as ae, cloneVNode as _e, Fragment as j, useAttrs as Be, openBlock as x, createElementBlock as T, createVNode as De, unref as _, mergeProps as Re, withCtx as oe, createBlock as ke, createCommentVNode as Ae, renderList as le, renderSlot as Pe, createElementVNode as Te, normalizeClass as H } from "vue";
|
|
2
2
|
import { t as E } from "./locale.js";
|
|
3
3
|
import { _ as Ve } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
4
|
import "lodash-es/get";
|
|
@@ -32,7 +32,7 @@ const p = {
|
|
|
32
32
|
iconArrowRight: "Arrow pointing to the right",
|
|
33
33
|
iconArrowLeft: "Arrow pointing to the left"
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, Ce = {
|
|
36
36
|
// count of items to showed per view
|
|
37
37
|
itemsToShow: {
|
|
38
38
|
default: p.itemsToShow,
|
|
@@ -116,105 +116,105 @@ const p = {
|
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
118
|
function $e({ config: t, slidesCount: n }) {
|
|
119
|
-
const { snapAlign: e, wrapAround:
|
|
120
|
-
if (
|
|
119
|
+
const { snapAlign: e, wrapAround: o, itemsToShow: s = 1 } = t;
|
|
120
|
+
if (o)
|
|
121
121
|
return Math.max(n - 1, 0);
|
|
122
|
-
let
|
|
122
|
+
let i;
|
|
123
123
|
switch (e) {
|
|
124
124
|
case "start":
|
|
125
|
-
|
|
125
|
+
i = n - s;
|
|
126
126
|
break;
|
|
127
127
|
case "end":
|
|
128
|
-
|
|
128
|
+
i = n - 1;
|
|
129
129
|
break;
|
|
130
130
|
case "center":
|
|
131
131
|
case "center-odd":
|
|
132
|
-
|
|
132
|
+
i = n - Math.ceil((s - 0.5) / 2);
|
|
133
133
|
break;
|
|
134
134
|
case "center-even":
|
|
135
|
-
|
|
135
|
+
i = n - Math.ceil(s / 2);
|
|
136
136
|
break;
|
|
137
137
|
default:
|
|
138
|
-
|
|
138
|
+
i = 0;
|
|
139
139
|
break;
|
|
140
140
|
}
|
|
141
|
-
return Math.max(
|
|
141
|
+
return Math.max(i, 0);
|
|
142
142
|
}
|
|
143
143
|
function Ue({ config: t, slidesCount: n }) {
|
|
144
|
-
const { wrapAround: e, snapAlign:
|
|
145
|
-
let
|
|
144
|
+
const { wrapAround: e, snapAlign: o, itemsToShow: s = 1 } = t;
|
|
145
|
+
let i = 0;
|
|
146
146
|
if (e || s > n)
|
|
147
|
-
return
|
|
148
|
-
switch (
|
|
147
|
+
return i;
|
|
148
|
+
switch (o) {
|
|
149
149
|
case "start":
|
|
150
|
-
|
|
150
|
+
i = 0;
|
|
151
151
|
break;
|
|
152
152
|
case "end":
|
|
153
|
-
|
|
153
|
+
i = s - 1;
|
|
154
154
|
break;
|
|
155
155
|
case "center":
|
|
156
156
|
case "center-odd":
|
|
157
|
-
|
|
157
|
+
i = Math.floor((s - 1) / 2);
|
|
158
158
|
break;
|
|
159
159
|
case "center-even":
|
|
160
|
-
|
|
160
|
+
i = Math.floor((s - 2) / 2);
|
|
161
161
|
break;
|
|
162
162
|
default:
|
|
163
|
-
|
|
163
|
+
i = 0;
|
|
164
164
|
break;
|
|
165
165
|
}
|
|
166
|
-
return
|
|
166
|
+
return i;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function ie({ val: t, max: n, min: e }) {
|
|
169
169
|
return n < e ? t : Math.min(Math.max(t, e), n);
|
|
170
170
|
}
|
|
171
171
|
function Xe({ config: t, currentSlide: n, slidesCount: e }) {
|
|
172
|
-
const { snapAlign:
|
|
172
|
+
const { snapAlign: o, wrapAround: s, itemsToShow: i = 1 } = t;
|
|
173
173
|
let c = n;
|
|
174
|
-
switch (
|
|
174
|
+
switch (o) {
|
|
175
175
|
case "center":
|
|
176
176
|
case "center-odd":
|
|
177
|
-
c -= (
|
|
177
|
+
c -= (i - 1) / 2;
|
|
178
178
|
break;
|
|
179
179
|
case "center-even":
|
|
180
|
-
c -= (
|
|
180
|
+
c -= (i - 2) / 2;
|
|
181
181
|
break;
|
|
182
182
|
case "end":
|
|
183
|
-
c -=
|
|
183
|
+
c -= i - 1;
|
|
184
184
|
break;
|
|
185
185
|
}
|
|
186
|
-
return s ? c :
|
|
186
|
+
return s ? c : ie({
|
|
187
187
|
val: c,
|
|
188
|
-
max: e -
|
|
188
|
+
max: e - i,
|
|
189
189
|
min: 0
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function Ne(t) {
|
|
193
193
|
return t ? t.reduce((n, e) => {
|
|
194
|
-
var
|
|
195
|
-
return e.type ===
|
|
194
|
+
var o;
|
|
195
|
+
return e.type === j ? [...n, ...Ne(e.children)] : ((o = e.type) === null || o === void 0 ? void 0 : o.name) === "CarouselSlide" ? [...n, e] : n;
|
|
196
196
|
}, []) : [];
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
return t > n ?
|
|
198
|
+
function re({ val: t, max: n, min: e = 0 }) {
|
|
199
|
+
return t > n ? re({ val: t - (n + 1), max: n, min: e }) : t < e ? re({ val: t + (n + 1), max: n, min: e }) : t;
|
|
200
200
|
}
|
|
201
201
|
function ze(t, n) {
|
|
202
202
|
let e;
|
|
203
|
-
return n ? function(...
|
|
203
|
+
return n ? function(...o) {
|
|
204
204
|
const s = this;
|
|
205
|
-
e || (t.apply(s,
|
|
205
|
+
e || (t.apply(s, o), e = !0, setTimeout(() => e = !1, n));
|
|
206
206
|
} : t;
|
|
207
207
|
}
|
|
208
208
|
function He(t, n) {
|
|
209
209
|
let e;
|
|
210
|
-
return function(...
|
|
210
|
+
return function(...o) {
|
|
211
211
|
e && clearTimeout(e), e = setTimeout(() => {
|
|
212
|
-
t(...
|
|
212
|
+
t(...o), e = null;
|
|
213
213
|
}, n);
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
function Ye(t = "", n = {}) {
|
|
217
|
-
return Object.entries(n).reduce((e, [
|
|
217
|
+
return Object.entries(n).reduce((e, [o, s]) => e.replace(`{${o}}`, String(s)), t);
|
|
218
218
|
}
|
|
219
219
|
var We = Y({
|
|
220
220
|
name: "ARIA",
|
|
@@ -231,14 +231,14 @@ var We = Y({
|
|
|
231
231
|
}
|
|
232
232
|
}), Ge = Y({
|
|
233
233
|
name: "Carousel",
|
|
234
|
-
props:
|
|
235
|
-
setup(t, { slots: n, emit: e, expose:
|
|
234
|
+
props: Ce,
|
|
235
|
+
setup(t, { slots: n, emit: e, expose: o }) {
|
|
236
236
|
var s;
|
|
237
|
-
const
|
|
237
|
+
const i = d(null), c = d([]), h = d(0), v = d(0), l = M(Object.assign({}, p));
|
|
238
238
|
let u = Object.assign({}, p), w;
|
|
239
|
-
const
|
|
239
|
+
const r = d((s = t.modelValue) !== null && s !== void 0 ? s : 0), g = d(0), B = d(0), C = d(0), D = d(0);
|
|
240
240
|
let I, W;
|
|
241
|
-
A("config",
|
|
241
|
+
A("config", l), A("slidesCount", v), A("currentSlide", r), A("maxSlide", C), A("minSlide", D), A("slideWidth", h);
|
|
242
242
|
function G() {
|
|
243
243
|
w = Object.assign({}, t.breakpoints), u = Object.assign(Object.assign(Object.assign({}, u), t), { i18n: Object.assign(Object.assign({}, u.i18n), t.i18n), breakpoints: void 0 }), ce(u);
|
|
244
244
|
}
|
|
@@ -253,35 +253,35 @@ var We = Y({
|
|
|
253
253
|
}), ce(m);
|
|
254
254
|
}
|
|
255
255
|
function ce(a) {
|
|
256
|
-
Object.entries(a).forEach(([m, f]) =>
|
|
256
|
+
Object.entries(a).forEach(([m, f]) => l[m] = f);
|
|
257
257
|
}
|
|
258
258
|
const de = He(() => {
|
|
259
|
-
V(),
|
|
259
|
+
V(), R();
|
|
260
260
|
}, 16);
|
|
261
|
-
function
|
|
262
|
-
if (!
|
|
261
|
+
function R() {
|
|
262
|
+
if (!i.value)
|
|
263
263
|
return;
|
|
264
|
-
const a =
|
|
265
|
-
h.value = a.width /
|
|
264
|
+
const a = i.value.getBoundingClientRect();
|
|
265
|
+
h.value = a.width / l.itemsToShow;
|
|
266
266
|
}
|
|
267
267
|
function F() {
|
|
268
|
-
v.value <= 0 || (
|
|
269
|
-
val:
|
|
270
|
-
max:
|
|
268
|
+
v.value <= 0 || (B.value = Math.ceil((v.value - 1) / 2), C.value = $e({ config: l, slidesCount: v.value }), D.value = Ue({ config: l, slidesCount: v.value }), l.wrapAround || (r.value = ie({
|
|
269
|
+
val: r.value,
|
|
270
|
+
max: C.value,
|
|
271
271
|
min: D.value
|
|
272
272
|
})));
|
|
273
273
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}),
|
|
274
|
+
Ie(() => {
|
|
275
|
+
Ee(() => R()), setTimeout(() => R(), 1e3), V(), ge(), window.addEventListener("resize", de, { passive: !0 }), e("init");
|
|
276
|
+
}), je(() => {
|
|
277
277
|
W && clearTimeout(W), I && clearInterval(I), window.removeEventListener("resize", de, {
|
|
278
278
|
passive: !0
|
|
279
279
|
});
|
|
280
280
|
});
|
|
281
281
|
let y = !1;
|
|
282
|
-
const $ = { x: 0, y: 0 }, U = { x: 0, y: 0 }, N = M({ x: 0, y: 0 }), X = d(!1), q = d(!1),
|
|
282
|
+
const $ = { x: 0, y: 0 }, U = { x: 0, y: 0 }, N = M({ x: 0, y: 0 }), X = d(!1), q = d(!1), Oe = () => {
|
|
283
283
|
X.value = !0;
|
|
284
|
-
},
|
|
284
|
+
}, Le = () => {
|
|
285
285
|
X.value = !1;
|
|
286
286
|
};
|
|
287
287
|
function ve(a) {
|
|
@@ -291,103 +291,103 @@ var We = Y({
|
|
|
291
291
|
q.value = !0, U.x = y ? a.touches[0].clientX : a.clientX, U.y = y ? a.touches[0].clientY : a.clientY;
|
|
292
292
|
const m = U.x - $.x, f = U.y - $.y;
|
|
293
293
|
N.y = f, N.x = m;
|
|
294
|
-
},
|
|
294
|
+
}, l.throttle);
|
|
295
295
|
function pe() {
|
|
296
|
-
const a =
|
|
296
|
+
const a = l.dir === "rtl" ? -1 : 1, m = Math.sign(N.x) * 0.4, f = Math.round(N.x / h.value + m) * a;
|
|
297
297
|
if (f && !y) {
|
|
298
298
|
const k = (Z) => {
|
|
299
299
|
Z.stopPropagation(), window.removeEventListener("click", k, !0);
|
|
300
300
|
};
|
|
301
301
|
window.addEventListener("click", k, !0);
|
|
302
302
|
}
|
|
303
|
-
L(
|
|
303
|
+
L(r.value - f), N.x = 0, N.y = 0, q.value = !1, document.removeEventListener(y ? "touchmove" : "mousemove", fe, !0), document.removeEventListener(y ? "touchend" : "mouseup", pe, !0);
|
|
304
304
|
}
|
|
305
305
|
function ge() {
|
|
306
|
-
!
|
|
307
|
-
|
|
308
|
-
},
|
|
306
|
+
!l.autoplay || l.autoplay <= 0 || (I = setInterval(() => {
|
|
307
|
+
l.pauseAutoplayOnHover && X.value || z();
|
|
308
|
+
}, l.autoplay));
|
|
309
309
|
}
|
|
310
310
|
function me() {
|
|
311
311
|
I && (clearInterval(I), I = null), ge();
|
|
312
312
|
}
|
|
313
313
|
const O = d(!1);
|
|
314
314
|
function L(a) {
|
|
315
|
-
const m =
|
|
315
|
+
const m = l.wrapAround ? a : ie({
|
|
316
316
|
val: a,
|
|
317
|
-
max:
|
|
317
|
+
max: C.value,
|
|
318
318
|
min: D.value
|
|
319
319
|
});
|
|
320
|
-
|
|
320
|
+
r.value === m || O.value || (e("slide-start", {
|
|
321
321
|
slidingToIndex: a,
|
|
322
|
-
currentSlideIndex:
|
|
322
|
+
currentSlideIndex: r.value,
|
|
323
323
|
prevSlideIndex: g.value,
|
|
324
324
|
slidesCount: v.value
|
|
325
|
-
}), O.value = !0, g.value =
|
|
326
|
-
if (
|
|
327
|
-
const f =
|
|
325
|
+
}), O.value = !0, g.value = r.value, r.value = m, W = setTimeout(() => {
|
|
326
|
+
if (l.wrapAround) {
|
|
327
|
+
const f = re({
|
|
328
328
|
val: m,
|
|
329
|
-
max:
|
|
329
|
+
max: C.value,
|
|
330
330
|
min: 0
|
|
331
331
|
});
|
|
332
|
-
f !==
|
|
333
|
-
currentSlideIndex:
|
|
332
|
+
f !== r.value && (r.value = f, e("loop", {
|
|
333
|
+
currentSlideIndex: r.value,
|
|
334
334
|
slidingToIndex: a
|
|
335
335
|
}));
|
|
336
336
|
}
|
|
337
|
-
e("update:modelValue",
|
|
338
|
-
currentSlideIndex:
|
|
337
|
+
e("update:modelValue", r.value), e("slide-end", {
|
|
338
|
+
currentSlideIndex: r.value,
|
|
339
339
|
prevSlideIndex: g.value,
|
|
340
340
|
slidesCount: v.value
|
|
341
341
|
}), O.value = !1, me();
|
|
342
|
-
},
|
|
342
|
+
}, l.transition));
|
|
343
343
|
}
|
|
344
344
|
function z() {
|
|
345
|
-
L(
|
|
345
|
+
L(r.value + l.itemsToScroll);
|
|
346
346
|
}
|
|
347
347
|
function J() {
|
|
348
|
-
L(
|
|
348
|
+
L(r.value - l.itemsToScroll);
|
|
349
349
|
}
|
|
350
350
|
const he = { slideTo: L, next: z, prev: J };
|
|
351
351
|
A("nav", he), A("isSliding", O);
|
|
352
352
|
const we = xe(() => Xe({
|
|
353
|
-
config:
|
|
354
|
-
currentSlide:
|
|
353
|
+
config: l,
|
|
354
|
+
currentSlide: r.value,
|
|
355
355
|
slidesCount: v.value
|
|
356
356
|
}));
|
|
357
357
|
A("slidesToScroll", we);
|
|
358
|
-
const
|
|
359
|
-
const a =
|
|
358
|
+
const Me = xe(() => {
|
|
359
|
+
const a = l.dir === "rtl" ? -1 : 1, m = we.value * h.value * a;
|
|
360
360
|
return {
|
|
361
361
|
transform: `translateX(${N.x - m}px)`,
|
|
362
|
-
transition: `${O.value ?
|
|
363
|
-
margin:
|
|
362
|
+
transition: `${O.value ? l.transition : 0}ms`,
|
|
363
|
+
margin: l.wrapAround ? `0 -${v.value * h.value}px` : "",
|
|
364
364
|
width: "100%"
|
|
365
365
|
};
|
|
366
366
|
});
|
|
367
367
|
function be() {
|
|
368
|
-
G(), V(), F(),
|
|
368
|
+
G(), V(), F(), R(), me();
|
|
369
369
|
}
|
|
370
|
-
Object.keys(
|
|
370
|
+
Object.keys(Ce).forEach((a) => {
|
|
371
371
|
["modelValue"].includes(a) || ae(() => t[a], be);
|
|
372
372
|
}), ae(() => t.modelValue, (a) => {
|
|
373
|
-
a !==
|
|
373
|
+
a !== r.value && L(Number(a));
|
|
374
374
|
}), ae(v, F), e("before-init"), G();
|
|
375
375
|
const Se = {
|
|
376
|
-
config:
|
|
376
|
+
config: l,
|
|
377
377
|
slidesCount: v,
|
|
378
378
|
slideWidth: h,
|
|
379
379
|
next: z,
|
|
380
380
|
prev: J,
|
|
381
381
|
slideTo: L,
|
|
382
|
-
currentSlide:
|
|
383
|
-
maxSlide:
|
|
382
|
+
currentSlide: r,
|
|
383
|
+
maxSlide: C,
|
|
384
384
|
minSlide: D,
|
|
385
|
-
middleSlide:
|
|
385
|
+
middleSlide: B
|
|
386
386
|
};
|
|
387
|
-
|
|
387
|
+
o({
|
|
388
388
|
updateBreakpointsConfigs: V,
|
|
389
389
|
updateSlidesData: F,
|
|
390
|
-
updateSlideWidth:
|
|
390
|
+
updateSlideWidth: R,
|
|
391
391
|
initDefaultConfigs: G,
|
|
392
392
|
restartCarousel: be,
|
|
393
393
|
slideTo: L,
|
|
@@ -398,42 +398,42 @@ var We = Y({
|
|
|
398
398
|
});
|
|
399
399
|
const K = n.default || n.slides, Q = n.addons, ye = M(Se);
|
|
400
400
|
return () => {
|
|
401
|
-
const a =
|
|
401
|
+
const a = Ne(K == null ? void 0 : K(ye)), m = (Q == null ? void 0 : Q(ye)) || [];
|
|
402
402
|
a.forEach((ee, te) => ee.props.index = te);
|
|
403
403
|
let f = a;
|
|
404
|
-
if (
|
|
405
|
-
const ee = a.map((ne,
|
|
406
|
-
index: -a.length +
|
|
404
|
+
if (l.wrapAround) {
|
|
405
|
+
const ee = a.map((ne, P) => _e(ne, {
|
|
406
|
+
index: -a.length + P,
|
|
407
407
|
isClone: !0,
|
|
408
|
-
key: `clone-before-${
|
|
409
|
-
})), te = a.map((ne,
|
|
410
|
-
index: a.length +
|
|
408
|
+
key: `clone-before-${P}`
|
|
409
|
+
})), te = a.map((ne, P) => _e(ne, {
|
|
410
|
+
index: a.length + P,
|
|
411
411
|
isClone: !0,
|
|
412
|
-
key: `clone-after-${
|
|
412
|
+
key: `clone-after-${P}`
|
|
413
413
|
}));
|
|
414
414
|
f = [...ee, ...a, ...te];
|
|
415
415
|
}
|
|
416
416
|
c.value = a, v.value = Math.max(a.length, 1);
|
|
417
417
|
const k = S("ol", {
|
|
418
418
|
class: "carousel__track",
|
|
419
|
-
style:
|
|
420
|
-
onMousedownCapture:
|
|
421
|
-
onTouchstartPassiveCapture:
|
|
419
|
+
style: Me.value,
|
|
420
|
+
onMousedownCapture: l.mouseDrag ? ve : null,
|
|
421
|
+
onTouchstartPassiveCapture: l.touchDrag ? ve : null
|
|
422
422
|
}, f), Z = S("div", { class: "carousel__viewport" }, k);
|
|
423
423
|
return S("section", {
|
|
424
|
-
ref:
|
|
424
|
+
ref: i,
|
|
425
425
|
class: {
|
|
426
426
|
carousel: !0,
|
|
427
427
|
"is-sliding": O.value,
|
|
428
428
|
"is-dragging": q.value,
|
|
429
429
|
"is-hover": X.value,
|
|
430
|
-
"carousel--rtl":
|
|
430
|
+
"carousel--rtl": l.dir === "rtl"
|
|
431
431
|
},
|
|
432
|
-
dir:
|
|
433
|
-
"aria-label":
|
|
432
|
+
dir: l.dir,
|
|
433
|
+
"aria-label": l.i18n.ariaGallery,
|
|
434
434
|
tabindex: "0",
|
|
435
|
-
onMouseenter:
|
|
436
|
-
onMouseleave:
|
|
435
|
+
onMouseenter: Oe,
|
|
436
|
+
onMouseleave: Le
|
|
437
437
|
}, [Z, m, S(We)]);
|
|
438
438
|
};
|
|
439
439
|
}
|
|
@@ -451,39 +451,39 @@ function qe(t) {
|
|
|
451
451
|
return t in se;
|
|
452
452
|
}
|
|
453
453
|
const ue = (t) => {
|
|
454
|
-
const n = b("config", M(Object.assign({}, p))), e = String(t.name),
|
|
454
|
+
const n = b("config", M(Object.assign({}, p))), e = String(t.name), o = `icon${e.charAt(0).toUpperCase() + e.slice(1)}`;
|
|
455
455
|
if (!e || typeof e != "string" || !qe(e))
|
|
456
456
|
return;
|
|
457
|
-
const s = Fe[e],
|
|
457
|
+
const s = Fe[e], i = S("path", { d: s }), c = n.i18n[o] || t.title || e, h = S("title", c);
|
|
458
458
|
return S("svg", {
|
|
459
459
|
class: "carousel__icon",
|
|
460
460
|
viewBox: "0 0 24 24",
|
|
461
461
|
role: "img",
|
|
462
462
|
"aria-label": c
|
|
463
|
-
}, [h,
|
|
463
|
+
}, [h, i]);
|
|
464
464
|
};
|
|
465
465
|
ue.props = { name: String, title: String };
|
|
466
466
|
const Je = (t, { slots: n, attrs: e }) => {
|
|
467
|
-
const { next:
|
|
467
|
+
const { next: o, prev: s } = n || {}, i = b("config", M(Object.assign({}, p))), c = b("maxSlide", d(1)), h = b("minSlide", d(1)), v = b("currentSlide", d(1)), l = b("nav", {}), { dir: u, wrapAround: w, i18n: r } = i, g = u === "rtl", B = S("button", {
|
|
468
468
|
type: "button",
|
|
469
469
|
class: [
|
|
470
470
|
"carousel__prev",
|
|
471
471
|
!w && v.value <= h.value && "carousel__prev--disabled",
|
|
472
472
|
e == null ? void 0 : e.class
|
|
473
473
|
],
|
|
474
|
-
"aria-label":
|
|
475
|
-
onClick:
|
|
476
|
-
}, (s == null ? void 0 : s()) || S(ue, { name: g ? "arrowRight" : "arrowLeft" })),
|
|
474
|
+
"aria-label": r.ariaPreviousSlide,
|
|
475
|
+
onClick: l.prev
|
|
476
|
+
}, (s == null ? void 0 : s()) || S(ue, { name: g ? "arrowRight" : "arrowLeft" })), C = S("button", {
|
|
477
477
|
type: "button",
|
|
478
478
|
class: [
|
|
479
479
|
"carousel__next",
|
|
480
480
|
!w && v.value >= c.value && "carousel__next--disabled",
|
|
481
481
|
e == null ? void 0 : e.class
|
|
482
482
|
],
|
|
483
|
-
"aria-label":
|
|
484
|
-
onClick:
|
|
485
|
-
}, (
|
|
486
|
-
return [
|
|
483
|
+
"aria-label": r.ariaNextSlide,
|
|
484
|
+
onClick: l.next
|
|
485
|
+
}, (o == null ? void 0 : o()) || S(ue, { name: g ? "arrowLeft" : "arrowRight" }));
|
|
486
|
+
return [B, C];
|
|
487
487
|
};
|
|
488
488
|
var Ke = Y({
|
|
489
489
|
name: "CarouselSlide",
|
|
@@ -498,7 +498,7 @@ var Ke = Y({
|
|
|
498
498
|
}
|
|
499
499
|
},
|
|
500
500
|
setup(t, { slots: n }) {
|
|
501
|
-
const e = b("config", M(Object.assign({}, p))),
|
|
501
|
+
const e = b("config", M(Object.assign({}, p))), o = b("currentSlide", d(0)), s = b("slidesToScroll", d(0)), i = b("isSliding", d(!1)), c = () => t.index === o.value, h = () => t.index === o.value - 1, v = () => t.index === o.value + 1, l = () => {
|
|
502
502
|
const u = Math.floor(s.value), w = Math.ceil(s.value + e.itemsToShow - 1);
|
|
503
503
|
return t.index >= u && t.index <= w;
|
|
504
504
|
};
|
|
@@ -509,13 +509,13 @@ var Ke = Y({
|
|
|
509
509
|
class: {
|
|
510
510
|
carousel__slide: !0,
|
|
511
511
|
"carousel__slide--clone": t.isClone,
|
|
512
|
-
"carousel__slide--visible":
|
|
512
|
+
"carousel__slide--visible": l(),
|
|
513
513
|
"carousel__slide--active": c(),
|
|
514
514
|
"carousel__slide--prev": h(),
|
|
515
515
|
"carousel__slide--next": v(),
|
|
516
|
-
"carousel__slide--sliding":
|
|
516
|
+
"carousel__slide--sliding": i.value
|
|
517
517
|
},
|
|
518
|
-
"aria-hidden": !
|
|
518
|
+
"aria-hidden": !l()
|
|
519
519
|
}, (u = n.default) === null || u === void 0 ? void 0 : u.call(n));
|
|
520
520
|
};
|
|
521
521
|
}
|
|
@@ -529,6 +529,8 @@ const Qe = ["src", "title"], Ze = {
|
|
|
529
529
|
props: {
|
|
530
530
|
slides: { default: () => [] },
|
|
531
531
|
autoplayInterval: { default: 0 },
|
|
532
|
+
hideNavigation: { type: Boolean, default: !1 },
|
|
533
|
+
hidePagination: { type: Boolean, default: !1 },
|
|
532
534
|
loop: { type: Boolean, default: !1 },
|
|
533
535
|
pagination: { default: "tile" },
|
|
534
536
|
paginationTileRadius: { default: "standard" },
|
|
@@ -538,30 +540,30 @@ const Qe = ["src", "title"], Ze = {
|
|
|
538
540
|
},
|
|
539
541
|
emits: ["click", "transition"],
|
|
540
542
|
setup(t, { expose: n, emit: e }) {
|
|
541
|
-
const
|
|
543
|
+
const o = t, s = Be(), i = d();
|
|
542
544
|
n({
|
|
543
545
|
next: () => {
|
|
544
546
|
var u;
|
|
545
|
-
return (u =
|
|
547
|
+
return (u = i.value) == null ? void 0 : u.next();
|
|
546
548
|
},
|
|
547
549
|
prev: () => {
|
|
548
550
|
var u;
|
|
549
|
-
return (u =
|
|
551
|
+
return (u = i.value) == null ? void 0 : u.prev();
|
|
550
552
|
}
|
|
551
553
|
});
|
|
552
554
|
const c = d(0), h = () => {
|
|
553
|
-
|
|
555
|
+
l();
|
|
554
556
|
}, v = () => {
|
|
555
|
-
e("click",
|
|
556
|
-
},
|
|
557
|
-
e("transition",
|
|
557
|
+
e("click", o.slides[c.value]);
|
|
558
|
+
}, l = () => {
|
|
559
|
+
e("transition", o.slides[c.value]);
|
|
558
560
|
};
|
|
559
|
-
return (u, w) => (x(),
|
|
560
|
-
De(_(Ge),
|
|
561
|
+
return (u, w) => (x(), T(j, null, [
|
|
562
|
+
De(_(Ge), Re(_(s), {
|
|
561
563
|
ref_key: "carouselRef",
|
|
562
|
-
ref:
|
|
564
|
+
ref: i,
|
|
563
565
|
modelValue: c.value,
|
|
564
|
-
"onUpdate:modelValue": w[0] || (w[0] = (
|
|
566
|
+
"onUpdate:modelValue": w[0] || (w[0] = (r) => c.value = r),
|
|
565
567
|
"aria-live": "polite",
|
|
566
568
|
"aria-roledescription": "carousel",
|
|
567
569
|
class: "stash-carousel tw-mb-6",
|
|
@@ -574,28 +576,28 @@ const Qe = ["src", "title"], Ze = {
|
|
|
574
576
|
},
|
|
575
577
|
autoplay: u.autoplayInterval,
|
|
576
578
|
"pause-autoplay-on-hover": u.pauseAutoplayOnHover,
|
|
577
|
-
"wrap-around":
|
|
579
|
+
"wrap-around": o.loop,
|
|
578
580
|
onInit: h,
|
|
579
|
-
onSlideEnd:
|
|
581
|
+
onSlideEnd: l
|
|
580
582
|
}), {
|
|
581
583
|
addons: oe(() => [
|
|
582
|
-
|
|
584
|
+
o.slides.length > 1 && !o.hideNavigation ? (x(), ke(_(Je), { key: 0 })) : Ae("", !0)
|
|
583
585
|
]),
|
|
584
586
|
default: oe(() => [
|
|
585
|
-
(x(!0),
|
|
586
|
-
key:
|
|
587
|
+
(x(!0), T(j, null, le(o.slides, (r, g) => (x(), ke(_(Ke), {
|
|
588
|
+
key: r.id,
|
|
587
589
|
"data-test": "stash-carousel|slide",
|
|
588
590
|
class: "tw-cursor-pointer",
|
|
589
591
|
onClick: v
|
|
590
592
|
}, {
|
|
591
593
|
default: oe(() => [
|
|
592
594
|
Pe(u.$slots, "slide", {
|
|
593
|
-
slide:
|
|
595
|
+
slide: r,
|
|
594
596
|
index: g
|
|
595
597
|
}, () => [
|
|
596
|
-
|
|
597
|
-
class: H(["tw-h-full tw-w-full", [{ "tw-rounded":
|
|
598
|
-
src:
|
|
598
|
+
Te("img", {
|
|
599
|
+
class: H(["tw-h-full tw-w-full", [{ "tw-rounded": o.roundBorders }]]),
|
|
600
|
+
src: r.imageUrl,
|
|
599
601
|
title: _(E)("ll.carousel.imageLabel", { index: g + 1, total: u.slides.length })
|
|
600
602
|
}, null, 10, Qe)
|
|
601
603
|
], !0)
|
|
@@ -605,40 +607,42 @@ const Qe = ["src", "title"], Ze = {
|
|
|
605
607
|
]),
|
|
606
608
|
_: 3
|
|
607
609
|
}, 16, ["modelValue", "i18n", "autoplay", "pause-autoplay-on-hover", "wrap-around"]),
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
610
|
+
o.hidePagination ? Ae("", !0) : (x(), T(j, { key: 0 }, [
|
|
611
|
+
o.pagination === "tile" ? (x(), T("ul", Ze, [
|
|
612
|
+
(x(!0), T(j, null, le(u.slides, (r, g) => (x(), T("li", {
|
|
613
|
+
key: r.imageUrl,
|
|
614
|
+
class: "tw-mr-3 tw-cursor-pointer",
|
|
615
|
+
"aria-current": c.value === g,
|
|
616
|
+
onClick: (B) => c.value = g
|
|
617
|
+
}, [
|
|
618
|
+
Te("img", {
|
|
619
|
+
class: H(["tw-rounded pagination-tile", [
|
|
620
|
+
{
|
|
621
|
+
"is-current-tile": c.value === g,
|
|
622
|
+
"tw-rounded-full": o.paginationTileRadius === "full"
|
|
623
|
+
}
|
|
624
|
+
]]),
|
|
625
|
+
"data-test": `stash-carousel|pagination-tile-${g}`,
|
|
626
|
+
src: r.imageUrl,
|
|
627
|
+
title: _(E)("ll.carousel.paginationLabel", { index: g + 1 })
|
|
628
|
+
}, null, 10, tt)
|
|
629
|
+
], 8, et))), 128))
|
|
630
|
+
])) : (x(), T("ul", {
|
|
631
|
+
key: 1,
|
|
632
|
+
class: H(["tw-text-center", [!u.staticPaginationDots && "lg:tw-hidden"]]),
|
|
633
|
+
"data-test": "stash-carousel|pagination-dots"
|
|
614
634
|
}, [
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
]]),
|
|
622
|
-
"data-test": `stash-carousel|pagination-tile-${g}`,
|
|
623
|
-
src: i.imageUrl,
|
|
624
|
-
title: _(E)("ll.carousel.paginationLabel", { index: g + 1 })
|
|
625
|
-
}, null, 10, tt)
|
|
626
|
-
], 8, et))), 128))
|
|
627
|
-
])) : (x(), C("ul", {
|
|
628
|
-
key: 1,
|
|
629
|
-
class: H(["tw-text-center", [!u.staticPaginationDots && "lg:tw-hidden"]]),
|
|
630
|
-
"data-test": "stash-carousel|pagination-dots"
|
|
631
|
-
}, [
|
|
632
|
-
(x(!0), C(P, null, le(u.slides, (i, g) => (x(), C("li", {
|
|
633
|
-
key: i.imageUrl,
|
|
634
|
-
class: H(["tw-rounded-full tw-inline-block", ["pagination-dot", [c.value === g ? "tw-bg-blue-500" : "tw-bg-blue-100"]]])
|
|
635
|
-
}, null, 2))), 128))
|
|
636
|
-
], 2))
|
|
635
|
+
(x(!0), T(j, null, le(u.slides, (r, g) => (x(), T("li", {
|
|
636
|
+
key: r.imageUrl,
|
|
637
|
+
class: H(["tw-rounded-full tw-inline-block", ["pagination-dot", [c.value === g ? "tw-bg-blue-500" : "tw-bg-blue-100"]]])
|
|
638
|
+
}, null, 2))), 128))
|
|
639
|
+
], 2))
|
|
640
|
+
], 64))
|
|
637
641
|
], 64));
|
|
638
642
|
}
|
|
639
643
|
});
|
|
640
|
-
const
|
|
644
|
+
const rt = /* @__PURE__ */ Ve(nt, [["__scopeId", "data-v-f2ea2bc7"]]);
|
|
641
645
|
export {
|
|
642
|
-
|
|
646
|
+
rt as default
|
|
643
647
|
};
|
|
644
648
|
//# sourceMappingURL=Carousel.js.map
|