@leaflink/stash 50.4.0 → 50.5.1

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 CHANGED
@@ -1,6 +1,8 @@
1
- import { defineComponent as G, inject as b, reactive as I, ref as c, h as y, provide as C, onMounted as Ie, nextTick as Ee, onUnmounted as je, computed as R, watch as oe, cloneVNode as xe, Fragment as D, useAttrs as Be, useCssModule as De, openBlock as k, createElementBlock as N, createVNode as Re, unref as _, mergeProps as Pe, withCtx as le, createBlock as ke, createCommentVNode as Te, renderList as ae, renderSlot as Ve, createElementVNode as Ae, normalizeClass as W } from "vue";
2
- import { t as B } from "./locale.js";
3
- import { _ as ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
1
+ import { defineComponent as F, inject as b, reactive as j, ref as d, h as _, provide as N, onMounted as Ie, nextTick as Le, onUnmounted as Ee, computed as D, watch as ae, cloneVNode as Te, Fragment as B, useAttrs as je, useCssModule as Be, openBlock as k, createElementBlock as E, createVNode as De, unref as A, mergeProps as Re, withCtx as G, createBlock as W, createCommentVNode as ke, renderList as le, renderSlot as Pe, createElementVNode as Ve, normalizeClass as ie } from "vue";
2
+ import { t as V } from "./locale.js";
3
+ import Ue from "./Thumbnail.js";
4
+ import $e from "./ThumbnailGroup.js";
5
+ import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
6
  /**
5
7
  * Vue 3 Carousel 0.3.4
6
8
  * (c) 2024
@@ -31,7 +33,7 @@ const p = {
31
33
  iconArrowRight: "Arrow pointing to the right",
32
34
  iconArrowLeft: "Arrow pointing to the left"
33
35
  }
34
- }, Ce = {
36
+ }, Ae = {
35
37
  // count of items to showed per view
36
38
  itemsToShow: {
37
39
  default: p.itemsToShow,
@@ -114,377 +116,377 @@ const p = {
114
116
  type: Object
115
117
  }
116
118
  };
117
- function $e({ config: e, slidesCount: n }) {
118
- const { snapAlign: t, wrapAround: l, itemsToShow: s = 1 } = e;
119
- if (l)
119
+ function ze({ config: e, slidesCount: n }) {
120
+ const { snapAlign: t, wrapAround: a, itemsToShow: r = 1 } = e;
121
+ if (a)
120
122
  return Math.max(n - 1, 0);
121
- let r;
123
+ let i;
122
124
  switch (t) {
123
125
  case "start":
124
- r = n - s;
126
+ i = n - r;
125
127
  break;
126
128
  case "end":
127
- r = n - 1;
129
+ i = n - 1;
128
130
  break;
129
131
  case "center":
130
132
  case "center-odd":
131
- r = n - Math.ceil((s - 0.5) / 2);
133
+ i = n - Math.ceil((r - 0.5) / 2);
132
134
  break;
133
135
  case "center-even":
134
- r = n - Math.ceil(s / 2);
136
+ i = n - Math.ceil(r / 2);
135
137
  break;
136
138
  default:
137
- r = 0;
139
+ i = 0;
138
140
  break;
139
141
  }
140
- return Math.max(r, 0);
142
+ return Math.max(i, 0);
141
143
  }
142
- function Ue({ config: e, slidesCount: n }) {
143
- const { wrapAround: t, snapAlign: l, itemsToShow: s = 1 } = e;
144
- let r = 0;
145
- if (t || s > n)
146
- return r;
147
- switch (l) {
144
+ function He({ config: e, slidesCount: n }) {
145
+ const { wrapAround: t, snapAlign: a, itemsToShow: r = 1 } = e;
146
+ let i = 0;
147
+ if (t || r > n)
148
+ return i;
149
+ switch (a) {
148
150
  case "start":
149
- r = 0;
151
+ i = 0;
150
152
  break;
151
153
  case "end":
152
- r = s - 1;
154
+ i = r - 1;
153
155
  break;
154
156
  case "center":
155
157
  case "center-odd":
156
- r = Math.floor((s - 1) / 2);
158
+ i = Math.floor((r - 1) / 2);
157
159
  break;
158
160
  case "center-even":
159
- r = Math.floor((s - 2) / 2);
161
+ i = Math.floor((r - 2) / 2);
160
162
  break;
161
163
  default:
162
- r = 0;
164
+ i = 0;
163
165
  break;
164
166
  }
165
- return r;
167
+ return i;
166
168
  }
167
- function ie({ val: e, max: n, min: t }) {
169
+ function re({ val: e, max: n, min: t }) {
168
170
  return n < t ? e : Math.min(Math.max(e, t), n);
169
171
  }
170
- function Xe({ config: e, currentSlide: n, slidesCount: t }) {
171
- const { snapAlign: l, wrapAround: s, itemsToShow: r = 1 } = e;
172
- let d = n;
173
- switch (l) {
172
+ function Ye({ config: e, currentSlide: n, slidesCount: t }) {
173
+ const { snapAlign: a, wrapAround: r, itemsToShow: i = 1 } = e;
174
+ let v = n;
175
+ switch (a) {
174
176
  case "center":
175
177
  case "center-odd":
176
- d -= (r - 1) / 2;
178
+ v -= (i - 1) / 2;
177
179
  break;
178
180
  case "center-even":
179
- d -= (r - 2) / 2;
181
+ v -= (i - 2) / 2;
180
182
  break;
181
183
  case "end":
182
- d -= r - 1;
184
+ v -= i - 1;
183
185
  break;
184
186
  }
185
- return s ? d : ie({
186
- val: d,
187
- max: t - r,
187
+ return r ? v : re({
188
+ val: v,
189
+ max: t - i,
188
190
  min: 0
189
191
  });
190
192
  }
191
- function Ne(e) {
193
+ function Ce(e) {
192
194
  return e ? e.reduce((n, t) => {
193
- var l;
194
- return t.type === D ? [...n, ...Ne(t.children)] : ((l = t.type) === null || l === void 0 ? void 0 : l.name) === "CarouselSlide" ? [...n, t] : n;
195
+ var a;
196
+ return t.type === B ? [...n, ...Ce(t.children)] : ((a = t.type) === null || a === void 0 ? void 0 : a.name) === "CarouselSlide" ? [...n, t] : n;
195
197
  }, []) : [];
196
198
  }
197
- function re({ val: e, max: n, min: t = 0 }) {
198
- return e > n ? re({ val: e - (n + 1), max: n, min: t }) : e < t ? re({ val: e + (n + 1), max: n, min: t }) : e;
199
+ function se({ val: e, max: n, min: t = 0 }) {
200
+ return e > n ? se({ val: e - (n + 1), max: n, min: t }) : e < t ? se({ val: e + (n + 1), max: n, min: t }) : e;
199
201
  }
200
- function He(e, n) {
202
+ function Ge(e, n) {
201
203
  let t;
202
- return n ? function(...l) {
203
- const s = this;
204
- t || (e.apply(s, l), t = !0, setTimeout(() => t = !1, n));
204
+ return n ? function(...a) {
205
+ const r = this;
206
+ t || (e.apply(r, a), t = !0, setTimeout(() => t = !1, n));
205
207
  } : e;
206
208
  }
207
- function Ye(e, n) {
209
+ function We(e, n) {
208
210
  let t;
209
- return function(...l) {
211
+ return function(...a) {
210
212
  t && clearTimeout(t), t = setTimeout(() => {
211
- e(...l), t = null;
213
+ e(...a), t = null;
212
214
  }, n);
213
215
  };
214
216
  }
215
- function We(e = "", n = {}) {
216
- return Object.entries(n).reduce((t, [l, s]) => t.replace(`{${l}}`, String(s)), e);
217
+ function Fe(e = "", n = {}) {
218
+ return Object.entries(n).reduce((t, [a, r]) => t.replace(`{${a}}`, String(r)), e);
217
219
  }
218
- var Ge = G({
220
+ var qe = F({
219
221
  name: "ARIA",
220
222
  setup() {
221
- const e = b("config", I(Object.assign({}, p))), n = b("currentSlide", c(0)), t = b("slidesCount", c(0));
222
- return () => y("div", {
223
+ const e = b("config", j(Object.assign({}, p))), n = b("currentSlide", d(0)), t = b("slidesCount", d(0));
224
+ return () => _("div", {
223
225
  class: ["carousel__liveregion", "carousel__sr-only"],
224
226
  "aria-live": "polite",
225
227
  "aria-atomic": "true"
226
- }, We(e.i18n.itemXofY, {
228
+ }, Fe(e.i18n.itemXofY, {
227
229
  currentSlide: n.value + 1,
228
230
  slidesCount: t.value
229
231
  }));
230
232
  }
231
- }), Fe = G({
233
+ }), Je = F({
232
234
  name: "Carousel",
233
- props: Ce,
234
- setup(e, { slots: n, emit: t, expose: l }) {
235
- var s;
236
- const r = c(null), d = c([]), m = c(0), u = c(0), a = I(Object.assign({}, p));
237
- let h = Object.assign({}, p), S;
238
- const i = c((s = e.modelValue) !== null && s !== void 0 ? s : 0), T = c(0), w = c(0), v = c(0), E = c(0);
239
- let j, F;
240
- C("config", a), C("slidesCount", u), C("currentSlide", i), C("maxSlide", v), C("minSlide", E), C("slideWidth", m);
241
- function q() {
242
- S = Object.assign({}, e.breakpoints), h = Object.assign(Object.assign(Object.assign({}, h), e), { i18n: Object.assign(Object.assign({}, h.i18n), e.i18n), breakpoints: void 0 }), ce(h);
235
+ props: Ae,
236
+ setup(e, { slots: n, emit: t, expose: a }) {
237
+ var r;
238
+ const i = d(null), v = d([]), m = d(0), s = d(0), l = j(Object.assign({}, p));
239
+ let g = Object.assign({}, p), S;
240
+ const c = d((r = e.modelValue) !== null && r !== void 0 ? r : 0), C = d(0), u = d(0), y = d(0), w = d(0);
241
+ let T, q;
242
+ N("config", l), N("slidesCount", s), N("currentSlide", c), N("maxSlide", y), N("minSlide", w), N("slideWidth", m);
243
+ function J() {
244
+ S = Object.assign({}, e.breakpoints), g = Object.assign(Object.assign(Object.assign({}, g), e), { i18n: Object.assign(Object.assign({}, g.i18n), e.i18n), breakpoints: void 0 }), de(g);
243
245
  }
244
- function z() {
246
+ function U() {
245
247
  if (!S || !Object.keys(S).length)
246
248
  return;
247
- const o = Object.keys(S).map((f) => Number(f)).sort((f, A) => +A - +f);
248
- let g = Object.assign({}, h);
249
+ const o = Object.keys(S).map((f) => Number(f)).sort((f, M) => +M - +f);
250
+ let h = Object.assign({}, g);
249
251
  o.some((f) => {
250
- const A = window.matchMedia(`(min-width: ${f}px)`).matches;
251
- return A && (g = Object.assign(Object.assign({}, g), S[f])), A;
252
- }), ce(g);
252
+ const M = window.matchMedia(`(min-width: ${f}px)`).matches;
253
+ return M && (h = Object.assign(Object.assign({}, h), S[f])), M;
254
+ }), de(h);
253
255
  }
254
- function ce(o) {
255
- Object.entries(o).forEach(([g, f]) => a[g] = f);
256
+ function de(o) {
257
+ Object.entries(o).forEach(([h, f]) => l[h] = f);
256
258
  }
257
- const de = Ye(() => {
258
- z(), $(), P();
259
+ const ve = We(() => {
260
+ U(), $(), R();
259
261
  }, 16);
260
- function P() {
261
- if (!r.value)
262
+ function R() {
263
+ if (!i.value)
262
264
  return;
263
- const o = r.value.getBoundingClientRect();
264
- m.value = o.width / a.itemsToShow;
265
+ const o = i.value.getBoundingClientRect();
266
+ m.value = o.width / l.itemsToShow;
265
267
  }
266
268
  function $() {
267
- u.value <= 0 || (w.value = Math.ceil((u.value - 1) / 2), v.value = $e({ config: a, slidesCount: u.value }), E.value = Ue({ config: a, slidesCount: u.value }), a.wrapAround || (i.value = ie({
268
- val: i.value,
269
- max: v.value,
270
- min: E.value
269
+ s.value <= 0 || (u.value = Math.ceil((s.value - 1) / 2), y.value = ze({ config: l, slidesCount: s.value }), w.value = He({ config: l, slidesCount: s.value }), l.wrapAround || (c.value = re({
270
+ val: c.value,
271
+ max: y.value,
272
+ min: w.value
271
273
  })));
272
274
  }
273
275
  Ie(() => {
274
- Ee(() => P()), setTimeout(() => P(), 1e3), z(), me(), window.addEventListener("resize", de, { passive: !0 }), t("init");
275
- }), je(() => {
276
- F && clearTimeout(F), j && clearInterval(j), window.removeEventListener("resize", de, {
276
+ Le(() => R()), setTimeout(() => R(), 1e3), U(), ge(), window.addEventListener("resize", ve, { passive: !0 }), t("init");
277
+ }), Ee(() => {
278
+ q && clearTimeout(q), T && clearInterval(T), window.removeEventListener("resize", ve, {
277
279
  passive: !0
278
280
  });
279
281
  });
280
282
  let x = !1;
281
- const U = { x: 0, y: 0 }, X = { x: 0, y: 0 }, M = I({ x: 0, y: 0 }), H = c(!1), J = c(!1), Me = () => {
283
+ const X = { x: 0, y: 0 }, z = { x: 0, y: 0 }, O = j({ x: 0, y: 0 }), H = d(!1), K = d(!1), Me = () => {
282
284
  H.value = !0;
283
- }, Oe = () => {
285
+ }, Ne = () => {
284
286
  H.value = !1;
285
287
  };
286
- function ve(o) {
287
- ["INPUT", "TEXTAREA", "SELECT"].includes(o.target.tagName) || (x = o.type === "touchstart", x || o.preventDefault(), !(!x && o.button !== 0 || O.value) && (U.x = x ? o.touches[0].clientX : o.clientX, U.y = x ? o.touches[0].clientY : o.clientY, document.addEventListener(x ? "touchmove" : "mousemove", fe, !0), document.addEventListener(x ? "touchend" : "mouseup", pe, !0)));
288
+ function fe(o) {
289
+ ["INPUT", "TEXTAREA", "SELECT"].includes(o.target.tagName) || (x = o.type === "touchstart", x || o.preventDefault(), !(!x && o.button !== 0 || I.value) && (X.x = x ? o.touches[0].clientX : o.clientX, X.y = x ? o.touches[0].clientY : o.clientY, document.addEventListener(x ? "touchmove" : "mousemove", pe, !0), document.addEventListener(x ? "touchend" : "mouseup", me, !0)));
288
290
  }
289
- const fe = He((o) => {
290
- J.value = !0, X.x = x ? o.touches[0].clientX : o.clientX, X.y = x ? o.touches[0].clientY : o.clientY;
291
- const g = X.x - U.x, f = X.y - U.y;
292
- M.y = f, M.x = g;
293
- }, a.throttle);
294
- function pe() {
295
- const o = a.dir === "rtl" ? -1 : 1, g = Math.sign(M.x) * 0.4, f = Math.round(M.x / m.value + g) * o;
291
+ const pe = Ge((o) => {
292
+ K.value = !0, z.x = x ? o.touches[0].clientX : o.clientX, z.y = x ? o.touches[0].clientY : o.clientY;
293
+ const h = z.x - X.x, f = z.y - X.y;
294
+ O.y = f, O.x = h;
295
+ }, l.throttle);
296
+ function me() {
297
+ const o = l.dir === "rtl" ? -1 : 1, h = Math.sign(O.x) * 0.4, f = Math.round(O.x / m.value + h) * o;
296
298
  if (f && !x) {
297
- const A = (ye) => {
298
- window.removeEventListener("click", A, !0);
299
+ const M = (xe) => {
300
+ window.removeEventListener("click", M, !0);
299
301
  };
300
- window.addEventListener("click", A, !0);
302
+ window.addEventListener("click", M, !0);
301
303
  }
302
- L(i.value - f), M.x = 0, M.y = 0, J.value = !1, document.removeEventListener(x ? "touchmove" : "mousemove", fe, !0), document.removeEventListener(x ? "touchend" : "mouseup", pe, !0);
303
- }
304
- function me() {
305
- !a.autoplay || a.autoplay <= 0 || (j = setInterval(() => {
306
- a.pauseAutoplayOnHover && H.value || Y();
307
- }, a.autoplay));
304
+ L(c.value - f), O.x = 0, O.y = 0, K.value = !1, document.removeEventListener(x ? "touchmove" : "mousemove", pe, !0), document.removeEventListener(x ? "touchend" : "mouseup", me, !0);
308
305
  }
309
306
  function ge() {
310
- j && (clearInterval(j), j = null), me();
307
+ !l.autoplay || l.autoplay <= 0 || (T = setInterval(() => {
308
+ l.pauseAutoplayOnHover && H.value || Y();
309
+ }, l.autoplay));
310
+ }
311
+ function he() {
312
+ T && (clearInterval(T), T = null), ge();
311
313
  }
312
- const O = c(!1);
314
+ const I = d(!1);
313
315
  function L(o) {
314
- const g = a.wrapAround ? o : ie({
316
+ const h = l.wrapAround ? o : re({
315
317
  val: o,
316
- max: v.value,
317
- min: E.value
318
+ max: y.value,
319
+ min: w.value
318
320
  });
319
- i.value === g || O.value || (t("slide-start", {
321
+ c.value === h || I.value || (t("slide-start", {
320
322
  slidingToIndex: o,
321
- currentSlideIndex: i.value,
322
- prevSlideIndex: T.value,
323
- slidesCount: u.value
324
- }), O.value = !0, T.value = i.value, i.value = g, F = setTimeout(() => {
325
- if (a.wrapAround) {
326
- const f = re({
327
- val: g,
328
- max: v.value,
323
+ currentSlideIndex: c.value,
324
+ prevSlideIndex: C.value,
325
+ slidesCount: s.value
326
+ }), I.value = !0, C.value = c.value, c.value = h, q = setTimeout(() => {
327
+ if (l.wrapAround) {
328
+ const f = se({
329
+ val: h,
330
+ max: y.value,
329
331
  min: 0
330
332
  });
331
- f !== i.value && (i.value = f, t("loop", {
332
- currentSlideIndex: i.value,
333
+ f !== c.value && (c.value = f, t("loop", {
334
+ currentSlideIndex: c.value,
333
335
  slidingToIndex: o
334
336
  }));
335
337
  }
336
- t("update:modelValue", i.value), t("slide-end", {
337
- currentSlideIndex: i.value,
338
- prevSlideIndex: T.value,
339
- slidesCount: u.value
340
- }), O.value = !1, ge();
341
- }, a.transition));
338
+ t("update:modelValue", c.value), t("slide-end", {
339
+ currentSlideIndex: c.value,
340
+ prevSlideIndex: C.value,
341
+ slidesCount: s.value
342
+ }), I.value = !1, he();
343
+ }, l.transition));
342
344
  }
343
345
  function Y() {
344
- L(i.value + a.itemsToScroll);
346
+ L(c.value + l.itemsToScroll);
345
347
  }
346
- function K() {
347
- L(i.value - a.itemsToScroll);
348
+ function Q() {
349
+ L(c.value - l.itemsToScroll);
348
350
  }
349
- const he = { slideTo: L, next: Y, prev: K };
350
- C("nav", he), C("isSliding", O);
351
- const we = R(() => Xe({
352
- config: a,
353
- currentSlide: i.value,
354
- slidesCount: u.value
351
+ const we = { slideTo: L, next: Y, prev: Q };
352
+ N("nav", we), N("isSliding", I);
353
+ const be = D(() => Ye({
354
+ config: l,
355
+ currentSlide: c.value,
356
+ slidesCount: s.value
355
357
  }));
356
- C("slidesToScroll", we);
357
- const Le = R(() => {
358
- const o = a.dir === "rtl" ? -1 : 1, g = we.value * m.value * o;
358
+ N("slidesToScroll", be);
359
+ const Oe = D(() => {
360
+ const o = l.dir === "rtl" ? -1 : 1, h = be.value * m.value * o;
359
361
  return {
360
- transform: `translateX(${M.x - g}px)`,
361
- transition: `${O.value ? a.transition : 0}ms`,
362
- margin: a.wrapAround ? `0 -${u.value * m.value}px` : "",
362
+ transform: `translateX(${O.x - h}px)`,
363
+ transition: `${I.value ? l.transition : 0}ms`,
364
+ margin: l.wrapAround ? `0 -${s.value * m.value}px` : "",
363
365
  width: "100%"
364
366
  };
365
367
  });
366
368
  function _e() {
367
- q(), z(), $(), P(), ge();
369
+ J(), U(), $(), R(), he();
368
370
  }
369
- Object.keys(Ce).forEach((o) => {
370
- ["modelValue"].includes(o) || oe(() => e[o], _e);
371
- }), oe(() => e.modelValue, (o) => {
372
- o !== i.value && L(Number(o));
373
- }), oe(u, $), t("before-init"), q();
371
+ Object.keys(Ae).forEach((o) => {
372
+ ["modelValue"].includes(o) || ae(() => e[o], _e);
373
+ }), ae(() => e.modelValue, (o) => {
374
+ o !== c.value && L(Number(o));
375
+ }), ae(s, $), t("before-init"), J();
374
376
  const Se = {
375
- config: a,
376
- slidesCount: u,
377
+ config: l,
378
+ slidesCount: s,
377
379
  slideWidth: m,
378
380
  next: Y,
379
- prev: K,
381
+ prev: Q,
380
382
  slideTo: L,
381
- currentSlide: i,
382
- maxSlide: v,
383
- minSlide: E,
384
- middleSlide: w
383
+ currentSlide: c,
384
+ maxSlide: y,
385
+ minSlide: w,
386
+ middleSlide: u
385
387
  };
386
- l({
387
- updateBreakpointsConfigs: z,
388
+ a({
389
+ updateBreakpointsConfigs: U,
388
390
  updateSlidesData: $,
389
- updateSlideWidth: P,
390
- initDefaultConfigs: q,
391
+ updateSlideWidth: R,
392
+ initDefaultConfigs: J,
391
393
  restartCarousel: _e,
392
394
  slideTo: L,
393
395
  next: Y,
394
- prev: K,
395
- nav: he,
396
+ prev: Q,
397
+ nav: we,
396
398
  data: Se
397
399
  });
398
- const Q = n.default || n.slides, Z = n.addons, be = I(Se);
400
+ const Z = n.default || n.slides, ee = n.addons, ye = j(Se);
399
401
  return () => {
400
- const o = Ne(Q == null ? void 0 : Q(be)), g = (Z == null ? void 0 : Z(be)) || [];
401
- o.forEach((ee, te) => ee.props.index = te);
402
+ const o = Ce(Z == null ? void 0 : Z(ye)), h = (ee == null ? void 0 : ee(ye)) || [];
403
+ o.forEach((te, ne) => te.props.index = ne);
402
404
  let f = o;
403
- if (a.wrapAround) {
404
- const ee = o.map((ne, V) => xe(ne, {
405
- index: -o.length + V,
405
+ if (l.wrapAround) {
406
+ const te = o.map((oe, P) => Te(oe, {
407
+ index: -o.length + P,
406
408
  isClone: !0,
407
- key: `clone-before-${V}`
408
- })), te = o.map((ne, V) => xe(ne, {
409
- index: o.length + V,
409
+ key: `clone-before-${P}`
410
+ })), ne = o.map((oe, P) => Te(oe, {
411
+ index: o.length + P,
410
412
  isClone: !0,
411
- key: `clone-after-${V}`
413
+ key: `clone-after-${P}`
412
414
  }));
413
- f = [...ee, ...o, ...te];
415
+ f = [...te, ...o, ...ne];
414
416
  }
415
- d.value = o, u.value = Math.max(o.length, 1);
416
- const A = y("ol", {
417
+ v.value = o, s.value = Math.max(o.length, 1);
418
+ const M = _("ol", {
417
419
  class: "carousel__track",
418
- style: Le.value,
419
- onMousedownCapture: a.mouseDrag ? ve : null,
420
- onTouchstartPassiveCapture: a.touchDrag ? ve : null
421
- }, f), ye = y("div", { class: "carousel__viewport" }, A);
422
- return y("section", {
423
- ref: r,
420
+ style: Oe.value,
421
+ onMousedownCapture: l.mouseDrag ? fe : null,
422
+ onTouchstartPassiveCapture: l.touchDrag ? fe : null
423
+ }, f), xe = _("div", { class: "carousel__viewport" }, M);
424
+ return _("section", {
425
+ ref: i,
424
426
  class: {
425
427
  carousel: !0,
426
- "is-sliding": O.value,
427
- "is-dragging": J.value,
428
+ "is-sliding": I.value,
429
+ "is-dragging": K.value,
428
430
  "is-hover": H.value,
429
- "carousel--rtl": a.dir === "rtl"
431
+ "carousel--rtl": l.dir === "rtl"
430
432
  },
431
- dir: a.dir,
432
- "aria-label": a.i18n.ariaGallery,
433
+ dir: l.dir,
434
+ "aria-label": l.i18n.ariaGallery,
433
435
  tabindex: "0",
434
436
  onMouseenter: Me,
435
- onMouseleave: Oe
436
- }, [ye, g, y(Ge)]);
437
+ onMouseleave: Ne
438
+ }, [xe, h, _(qe)]);
437
439
  };
438
440
  }
439
- }), se;
441
+ }), ue;
440
442
  (function(e) {
441
443
  e.arrowUp = "arrowUp", e.arrowDown = "arrowDown", e.arrowRight = "arrowRight", e.arrowLeft = "arrowLeft";
442
- })(se || (se = {}));
443
- const qe = {
444
+ })(ue || (ue = {}));
445
+ const Ke = {
444
446
  arrowUp: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z",
445
447
  arrowDown: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",
446
448
  arrowRight: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",
447
449
  arrowLeft: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"
448
450
  };
449
- function Je(e) {
450
- return e in se;
451
+ function Qe(e) {
452
+ return e in ue;
451
453
  }
452
- const ue = (e) => {
453
- const n = b("config", I(Object.assign({}, p))), t = String(e.name), l = `icon${t.charAt(0).toUpperCase() + t.slice(1)}`;
454
- if (!t || typeof t != "string" || !Je(t))
454
+ const ce = (e) => {
455
+ const n = b("config", j(Object.assign({}, p))), t = String(e.name), a = `icon${t.charAt(0).toUpperCase() + t.slice(1)}`;
456
+ if (!t || typeof t != "string" || !Qe(t))
455
457
  return;
456
- const s = qe[t], r = y("path", { d: s }), d = n.i18n[l] || e.title || t, m = y("title", d);
457
- return y("svg", {
458
+ const r = Ke[t], i = _("path", { d: r }), v = n.i18n[a] || e.title || t, m = _("title", v);
459
+ return _("svg", {
458
460
  class: "carousel__icon",
459
461
  viewBox: "0 0 24 24",
460
462
  role: "img",
461
- "aria-label": d
462
- }, [m, r]);
463
+ "aria-label": v
464
+ }, [m, i]);
463
465
  };
464
- ue.props = { name: String, title: String };
465
- const Ke = (e, { slots: n, attrs: t }) => {
466
- const { next: l, prev: s } = n || {}, r = b("config", I(Object.assign({}, p))), d = b("maxSlide", c(1)), m = b("minSlide", c(1)), u = b("currentSlide", c(1)), a = b("nav", {}), { dir: h, wrapAround: S, i18n: i } = r, T = h === "rtl", w = y("button", {
466
+ ce.props = { name: String, title: String };
467
+ const Ze = (e, { slots: n, attrs: t }) => {
468
+ const { next: a, prev: r } = n || {}, i = b("config", j(Object.assign({}, p))), v = b("maxSlide", d(1)), m = b("minSlide", d(1)), s = b("currentSlide", d(1)), l = b("nav", {}), { dir: g, wrapAround: S, i18n: c } = i, C = g === "rtl", u = _("button", {
467
469
  type: "button",
468
470
  class: [
469
471
  "carousel__prev",
470
- !S && u.value <= m.value && "carousel__prev--disabled",
472
+ !S && s.value <= m.value && "carousel__prev--disabled",
471
473
  t == null ? void 0 : t.class
472
474
  ],
473
- "aria-label": i.ariaPreviousSlide,
474
- onClick: a.prev
475
- }, (s == null ? void 0 : s()) || y(ue, { name: T ? "arrowRight" : "arrowLeft" })), v = y("button", {
475
+ "aria-label": c.ariaPreviousSlide,
476
+ onClick: l.prev
477
+ }, (r == null ? void 0 : r()) || _(ce, { name: C ? "arrowRight" : "arrowLeft" })), y = _("button", {
476
478
  type: "button",
477
479
  class: [
478
480
  "carousel__next",
479
- !S && u.value >= d.value && "carousel__next--disabled",
481
+ !S && s.value >= v.value && "carousel__next--disabled",
480
482
  t == null ? void 0 : t.class
481
483
  ],
482
- "aria-label": i.ariaNextSlide,
483
- onClick: a.next
484
- }, (l == null ? void 0 : l()) || y(ue, { name: T ? "arrowLeft" : "arrowRight" }));
485
- return [w, v];
484
+ "aria-label": c.ariaNextSlide,
485
+ onClick: l.next
486
+ }, (a == null ? void 0 : a()) || _(ce, { name: C ? "arrowLeft" : "arrowRight" }));
487
+ return [u, y];
486
488
  };
487
- var Qe = G({
489
+ var et = F({
488
490
  name: "CarouselSlide",
489
491
  props: {
490
492
  index: {
@@ -497,40 +499,36 @@ var Qe = G({
497
499
  }
498
500
  },
499
501
  setup(e, { slots: n }) {
500
- const t = b("config", I(Object.assign({}, p))), l = b("currentSlide", c(0)), s = b("slidesToScroll", c(0)), r = b("isSliding", c(!1)), d = R(() => e.index === l.value), m = R(() => e.index === l.value - 1), u = R(() => e.index === l.value + 1), a = R(() => {
501
- const h = Math.floor(s.value), S = Math.ceil(s.value + t.itemsToShow - 1);
502
- return e.index >= h && e.index <= S;
502
+ const t = b("config", j(Object.assign({}, p))), a = b("currentSlide", d(0)), r = b("slidesToScroll", d(0)), i = b("isSliding", d(!1)), v = D(() => e.index === a.value), m = D(() => e.index === a.value - 1), s = D(() => e.index === a.value + 1), l = D(() => {
503
+ const g = Math.floor(r.value), S = Math.ceil(r.value + t.itemsToShow - 1);
504
+ return e.index >= g && e.index <= S;
503
505
  });
504
506
  return () => {
505
- var h;
506
- return y("li", {
507
+ var g;
508
+ return _("li", {
507
509
  style: { width: `${100 / t.itemsToShow}%` },
508
510
  class: {
509
511
  carousel__slide: !0,
510
512
  "carousel__slide--clone": e.isClone,
511
- "carousel__slide--visible": a.value,
512
- "carousel__slide--active": d.value,
513
+ "carousel__slide--visible": l.value,
514
+ "carousel__slide--active": v.value,
513
515
  "carousel__slide--prev": m.value,
514
- "carousel__slide--next": u.value,
515
- "carousel__slide--sliding": r.value
516
+ "carousel__slide--next": s.value,
517
+ "carousel__slide--sliding": i.value
516
518
  },
517
- "aria-hidden": !a.value
518
- }, (h = n.default) === null || h === void 0 ? void 0 : h.call(n, {
519
- isActive: d.value,
519
+ "aria-hidden": !l.value
520
+ }, (g = n.default) === null || g === void 0 ? void 0 : g.call(n, {
521
+ isActive: v.value,
520
522
  isClone: e.isClone,
521
523
  isPrev: m.value,
522
- isNext: u.value,
523
- isSliding: r.value,
524
- isVisible: a.value
524
+ isNext: s.value,
525
+ isSliding: i.value,
526
+ isVisible: l.value
525
527
  }));
526
528
  };
527
529
  }
528
530
  });
529
- const Ze = ["src", "title"], et = {
530
- key: 0,
531
- class: "tw-flex tw-list-none",
532
- "data-test": "stash-carousel|pagination-tiles"
533
- }, tt = ["aria-current", "onClick"], nt = ["data-test", "src", "title"], ot = /* @__PURE__ */ G({
531
+ const tt = ["src", "title"], nt = /* @__PURE__ */ F({
534
532
  inheritAttrs: !1,
535
533
  __name: "Carousel",
536
534
  props: {
@@ -549,132 +547,131 @@ const Ze = ["src", "title"], et = {
549
547
  },
550
548
  emits: ["click", "transition", "transition:multi"],
551
549
  setup(e, { expose: n, emit: t }) {
552
- const l = e, s = Be(), r = De(), d = c();
553
- n({
554
- next: () => {
555
- var i;
556
- return (i = d.value) == null ? void 0 : i.next();
557
- },
558
- prev: () => {
559
- var i;
560
- return (i = d.value) == null ? void 0 : i.prev();
561
- }
562
- });
563
- const m = t, u = c(0), a = () => {
564
- S();
565
- }, h = () => {
566
- m("click", l.slides[u.value]);
550
+ const a = e, r = je(), i = Be(), v = d(), m = t, s = d(0);
551
+ function l(...u) {
552
+ const [y] = u;
553
+ y !== void 0 && g(y);
554
+ }
555
+ const g = (u) => {
556
+ s.value = u;
567
557
  }, S = () => {
568
- if (l.itemsToShow === 1) {
569
- m("transition", l.slides[u.value]);
558
+ C();
559
+ }, c = () => {
560
+ m("click", a.slides[s.value]);
561
+ }, C = () => {
562
+ if (a.itemsToShow === 1) {
563
+ m("transition", a.slides[s.value]);
570
564
  return;
571
565
  }
572
- const i = l.slides.slice(u.value, u.value + l.itemsToShow);
573
- m("transition:multi", i);
566
+ const u = a.slides.slice(s.value, s.value + a.itemsToShow);
567
+ m("transition:multi", u);
574
568
  };
575
- return (i, T) => (k(), N(D, null, [
576
- Re(_(Fe), Pe({
569
+ return n({
570
+ next: () => {
571
+ var u;
572
+ return (u = v.value) == null ? void 0 : u.next();
573
+ },
574
+ prev: () => {
575
+ var u;
576
+ return (u = v.value) == null ? void 0 : u.prev();
577
+ },
578
+ slideTo: g
579
+ }), (u, y) => (k(), E(B, null, [
580
+ De(A(Je), Re({
577
581
  ref_key: "carouselRef",
578
- ref: d,
579
- modelValue: u.value,
580
- "onUpdate:modelValue": T[0] || (T[0] = (w) => u.value = w),
582
+ ref: v,
583
+ "model-value": s.value,
581
584
  "aria-live": "polite",
582
585
  "aria-roledescription": "carousel",
583
- class: ["stash-carousel tw-mb-6", _(r).root],
586
+ class: ["stash-carousel tw-mb-6", A(i).root],
584
587
  "data-test": "stash-carousel",
585
- autoplay: i.autoplayInterval,
588
+ autoplay: u.autoplayInterval,
586
589
  i18n: {
587
- ariaNextSlide: _(B)("ll.next"),
588
- ariaPreviousSlide: _(B)("ll.previous"),
589
- iconArrowLeft: _(B)("ll.previous"),
590
- iconArrowRight: _(B)("ll.next")
590
+ ariaNextSlide: A(V)("ll.next"),
591
+ ariaPreviousSlide: A(V)("ll.previous"),
592
+ iconArrowLeft: A(V)("ll.previous"),
593
+ iconArrowRight: A(V)("ll.next")
591
594
  },
592
- "items-to-scroll": l.itemsToScroll,
593
- "items-to-show": l.itemsToShow,
594
- "pause-autoplay-on-hover": i.pauseAutoplayOnHover,
595
- "wrap-around": l.loop
596
- }, _(s), {
597
- onInit: a,
598
- onSlideEnd: S
595
+ "items-to-scroll": a.itemsToScroll,
596
+ "items-to-show": a.itemsToShow,
597
+ "pause-autoplay-on-hover": u.pauseAutoplayOnHover,
598
+ "wrap-around": a.loop
599
+ }, A(r), {
600
+ onInit: S,
601
+ onSlideEnd: C,
602
+ "onUpdate:modelValue": l
599
603
  }), {
600
- addons: le(() => [
601
- l.slides.length > 1 && !l.hideNavigation ? (k(), ke(_(Ke), { key: 0 })) : Te("", !0)
604
+ addons: G(() => [
605
+ a.slides.length > 1 && !a.hideNavigation ? (k(), W(A(Ze), { key: 0 })) : ke("", !0)
602
606
  ]),
603
- default: le(() => [
604
- (k(!0), N(D, null, ae(l.slides, (w, v) => (k(), ke(_(Qe), {
607
+ default: G(() => [
608
+ (k(!0), E(B, null, le(a.slides, (w, T) => (k(), W(A(et), {
605
609
  key: w.id,
606
610
  "data-test": "stash-carousel|slide",
607
611
  class: "tw-cursor-pointer",
608
- onClick: h
612
+ onClick: c
609
613
  }, {
610
- default: le(() => [
611
- Ve(i.$slots, "slide", {
614
+ default: G(() => [
615
+ Pe(u.$slots, "slide", {
612
616
  slide: w,
613
- index: v
617
+ index: T
614
618
  }, () => [
615
- Ae("img", {
616
- class: W(["tw-h-full tw-w-full", [{ "tw-rounded": l.roundBorders }]]),
619
+ Ve("img", {
620
+ class: ie(["tw-h-full tw-w-full", [{ "tw-rounded": a.roundBorders }]]),
617
621
  src: w.imageUrl,
618
- title: _(B)("ll.carousel.imageLabel", {
619
- index: v + 1,
620
- total: i.slides.length
622
+ title: A(V)("ll.carousel.imageLabel", {
623
+ index: T + 1,
624
+ total: u.slides.length
621
625
  })
622
- }, null, 10, Ze)
626
+ }, null, 10, tt)
623
627
  ])
624
628
  ]),
625
629
  _: 2
626
630
  }, 1024))), 128))
627
631
  ]),
628
632
  _: 3
629
- }, 16, ["modelValue", "autoplay", "class", "i18n", "items-to-scroll", "items-to-show", "pause-autoplay-on-hover", "wrap-around"]),
630
- l.hidePagination ? Te("", !0) : (k(), N(D, { key: 0 }, [
631
- l.pagination === "tile" ? (k(), N("ul", et, [
632
- (k(!0), N(D, null, ae(i.slides, (w, v) => (k(), N("li", {
633
- key: w.imageUrl,
634
- class: "tw-mr-3 tw-cursor-pointer",
635
- "aria-current": u.value === v,
636
- onClick: (E) => u.value = v
637
- }, [
638
- Ae("img", {
639
- class: W(["tw-rounded", [
640
- _(r)["pagination-tile"],
641
- {
642
- [_(r)["is-current-tile"]]: u.value === v,
643
- "tw-rounded-full": l.paginationTileRadius === "full"
644
- }
645
- ]]),
646
- "data-test": `stash-carousel|pagination-tile-${v}`,
647
- src: w.imageUrl,
648
- title: _(B)("ll.carousel.paginationLabel", { index: v + 1 })
649
- }, null, 10, nt)
650
- ], 8, tt))), 128))
651
- ])) : (k(), N("ul", {
633
+ }, 16, ["model-value", "autoplay", "class", "i18n", "items-to-scroll", "items-to-show", "pause-autoplay-on-hover", "wrap-around"]),
634
+ a.hidePagination ? ke("", !0) : (k(), E(B, { key: 0 }, [
635
+ a.pagination === "tile" ? (k(), W($e, {
636
+ key: 0,
637
+ "active-thumbnail": s.value,
638
+ thumbnails: u.slides,
639
+ radius: a.paginationTileRadius === "full" ? "circle" : "rounded",
640
+ "onUpdate:activeThumbnail": g
641
+ }, {
642
+ default: G(() => [
643
+ (k(!0), E(B, null, le(u.slides, (w) => (k(), W(Ue, {
644
+ key: w.id,
645
+ thumbnail: w,
646
+ variant: "translucent"
647
+ }, null, 8, ["thumbnail"]))), 128))
648
+ ]),
649
+ _: 1
650
+ }, 8, ["active-thumbnail", "thumbnails", "radius"])) : (k(), E("ul", {
652
651
  key: 1,
653
- class: W(["tw-text-center", [!i.staticPaginationDots && "lg:tw-hidden"]]),
652
+ class: ie(["tw-text-center", [!u.staticPaginationDots && "lg:tw-hidden"]]),
654
653
  "data-test": "stash-carousel|pagination-dots"
655
654
  }, [
656
- (k(!0), N(D, null, ae(i.slides, (w, v) => (k(), N("li", {
655
+ (k(!0), E(B, null, le(u.slides, (w, T) => (k(), E("li", {
657
656
  key: w.imageUrl,
658
- class: W(["tw-inline-block tw-rounded-full", [_(r)["pagination-dot"], [u.value === v ? "tw-bg-blue-500" : "tw-bg-blue-100"]]])
657
+ class: ie(["tw-inline-block tw-rounded-full", [A(i)["pagination-dot"], [s.value === T ? "tw-bg-blue-500" : "tw-bg-blue-100"]]])
659
658
  }, null, 2))), 128))
660
659
  ], 2))
661
660
  ], 64))
662
661
  ], 64));
663
662
  }
664
- }), lt = "_root_17zfe_2", at = "_carousel__icon_17zfe_2", it = "_carousel__next_17zfe_18", rt = "_carousel__prev_17zfe_26", st = {
665
- root: lt,
663
+ }), ot = "_root_4piw3_2", at = "_carousel__icon_4piw3_2", lt = "_carousel__next_4piw3_18", it = "_carousel__prev_4piw3_26", rt = {
664
+ root: ot,
666
665
  carousel__icon: at,
667
- carousel__next: it,
668
- "carousel__next--disabled": "_carousel__next--disabled_17zfe_22",
669
- carousel__prev: rt,
670
- "carousel__prev--disabled": "_carousel__prev--disabled_17zfe_30",
671
- "pagination-dot": "_pagination-dot_17zfe_34",
672
- "pagination-tile": "_pagination-tile_17zfe_40",
673
- "is-current-tile": "_is-current-tile_17zfe_46"
674
- }, ut = {
675
- $style: st
676
- }, ft = /* @__PURE__ */ ze(ot, [["__cssModules", ut]]);
666
+ carousel__next: lt,
667
+ "carousel__next--disabled": "_carousel__next--disabled_4piw3_22",
668
+ carousel__prev: it,
669
+ "carousel__prev--disabled": "_carousel__prev--disabled_4piw3_30",
670
+ "pagination-dot": "_pagination-dot_4piw3_34"
671
+ }, st = {
672
+ $style: rt
673
+ }, pt = /* @__PURE__ */ Xe(nt, [["__cssModules", st]]);
677
674
  export {
678
- ft as default
675
+ pt as default
679
676
  };
680
677
  //# sourceMappingURL=Carousel.js.map