@codeandfunction/callaloo 3.21.0 → 3.22.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.
Files changed (31) hide show
  1. package/dist/chunks/{CLButton.vue_vue_type_style_index_0_lang-B3AdartN.js → CLButton.vue_vue_type_style_index_0_lang-kYdsi6-T.js} +1 -1
  2. package/dist/chunks/{CLCard.vue_vue_type_style_index_0_lang-TOjjxtJt.js → CLCard.vue_vue_type_style_index_0_lang-C8dDRXYZ.js} +1 -1
  3. package/dist/chunks/CLIcon.vue_vue_type_style_index_0_lang-CduBjI1N.js +109 -0
  4. package/dist/chunks/{CLLink.vue_vue_type_style_index_0_lang-M6vqUSDq.js → CLLink.vue_vue_type_style_index_0_lang-BDgJvHNE.js} +1 -1
  5. package/dist/chunks/{CLNavLink.vue_vue_type_script_setup_true_lang-8u8OhF4q.js → CLNavLink.vue_vue_type_script_setup_true_lang-CMUfxGA3.js} +1 -1
  6. package/dist/chunks/{CLPill.vue_vue_type_style_index_0_lang-C8_aZqPJ.js → CLPill.vue_vue_type_style_index_0_lang-BPOoZ5_q.js} +2 -2
  7. package/dist/chunks/{CLToast.vue_vue_type_style_index_0_lang-DIi8ikHj.js → CLToast.vue_vue_type_style_index_0_lang-BH6Tnr-h.js} +2 -2
  8. package/dist/chunks/icons-6Fm4EZ4Y.js +4 -0
  9. package/dist/components/Buttons/CLButton/CLButton.js +1 -1
  10. package/dist/components/CLIcon/CLIcon.js +1 -1
  11. package/dist/components/CLIcon/CLIcon.vue.d.ts +3 -0
  12. package/dist/components/Containers/CLCard/CLCard.js +1 -1
  13. package/dist/components/Containers/CLCarousel/CLCarousel.css +1 -1
  14. package/dist/components/Containers/CLCarousel/CLCarousel.js +377 -303
  15. package/dist/components/Containers/CLCarousel/CLCarousel.vue.d.ts +3 -0
  16. package/dist/components/Containers/CLDisclosure/CLDisclosure.js +2 -2
  17. package/dist/components/Form/CLCheckbox/CLCheckbox.js +1 -1
  18. package/dist/components/Form/CLInput/CLInput.js +3 -3
  19. package/dist/components/Form/CLSelect/CLSelect.js +1 -1
  20. package/dist/components/Indicators/CLBanner/CLBanner.js +1 -1
  21. package/dist/components/Indicators/CLPill/CLPill.js +1 -1
  22. package/dist/components/Modals/CLModal/CLModal.js +1 -1
  23. package/dist/components/Navigation/CLLink/CLLink.js +1 -1
  24. package/dist/components/Navigation/CLNavLink/CLNavLink.js +1 -1
  25. package/dist/components/Navigation/CLNavSection/CLNavSection.js +1 -1
  26. package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.js +2 -2
  27. package/dist/components/Popups/CLToast/CLToast.js +1 -1
  28. package/dist/components/Providers/CLToastProvider/CLToastProvider.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/CLIcon.vue_vue_type_style_index_0_lang-BBPM6q0l.js +0 -85
  31. package/dist/chunks/icons-DnOYbuR5.js +0 -4
@@ -1,12 +1,12 @@
1
1
  import '../../../assets/core.css';
2
2
  import './CLCarousel.css';
3
- import { defineComponent as re, computed as u, createElementBlock as c, openBlock as s, Fragment as F, createCommentVNode as C, unref as e, normalizeClass as l, renderList as me, createBlock as he, createElementVNode as y, createVNode as x, withCtx as X, createTextVNode as Y, toDisplayString as q, useCssVars as be, ref as r, onMounted as we, onUnmounted as pe, watch as Ce, renderSlot as Z, nextTick as se } from "vue";
4
- import { _ as E } from "../../../chunks/CLButton.vue_vue_type_style_index_0_lang-B3AdartN.js";
5
- import { _ as ce } from "../../../chunks/CLText.vue_vue_type_style_index_0_lang-DVwTAVXM.js";
6
- import { CLPaginationType as $, CLColorVariants as B, CLSizes as W, CLIconSizes as D, CLIconNames as O, CLTextTypes as xe, CLAlign as A, CLOrder as R, CLColors as ye } from "../../../index.js";
7
- import { i as H, d as Pe, e as $e } from "../../../chunks/helper-BYpahJAh.js";
8
- import { useHasSlotContent as Te } from "../../../composables/useHasSlotContent.js";
9
- const Q = /* @__PURE__ */ re({
3
+ import { defineComponent as xe, computed as b, createElementBlock as m, openBlock as g, Fragment as te, createCommentVNode as L, unref as e, normalizeClass as r, renderList as ke, createBlock as ze, createElementVNode as z, createVNode as k, withCtx as de, createTextVNode as ue, toDisplayString as ee, useCssVars as Ie, ref as v, onMounted as Ee, nextTick as Q, onUnmounted as We, watch as Be, renderSlot as ve } from "vue";
4
+ import { _ as D } from "../../../chunks/CLButton.vue_vue_type_style_index_0_lang-kYdsi6-T.js";
5
+ import { _ as Se } from "../../../chunks/CLText.vue_vue_type_style_index_0_lang-DVwTAVXM.js";
6
+ import { CLPaginationType as I, CLColorVariants as H, CLSizes as U, CLIconSizes as X, CLIconNames as Y, CLTextTypes as Ne, CLAlign as G, CLOrder as Z, CLColors as Me } from "../../../index.js";
7
+ import { i as _, d as Ae, e as Ve } from "../../../chunks/helper-BYpahJAh.js";
8
+ import { useHasSlotContent as Oe } from "../../../composables/useHasSlotContent.js";
9
+ const ce = /* @__PURE__ */ xe({
10
10
  name: "CLCarouselNavigation",
11
11
  __name: "CLCarouselNavigation",
12
12
  props: {
@@ -26,412 +26,486 @@ const Q = /* @__PURE__ */ re({
26
26
  totalPages: {},
27
27
  variant: {}
28
28
  },
29
- setup(a) {
30
- const o = a, i = u(() => [
31
- `${o.prefix}__dots-container`
32
- ]), I = u(() => [
33
- `${o.prefix}__numbered-container`
34
- ]), T = u(() => [
35
- `${o.prefix}__inline-container`
36
- ]), f = u(() => [
37
- `${o.prefix}__prev-page`
38
- ]), g = u(() => [
39
- `${o.prefix}__next-page`
40
- ]), N = u(() => [
41
- `${o.prefix}__page-indicator`
42
- ]), k = u(() => [
43
- `${o.prefix}__show-more`
44
- ]), L = (m) => o.currentPage === m, v = u(() => !o.enabled || !o.prevPageEnabled), w = u(() => !o.enabled || !o.nextPageEnabled);
45
- return (m, h) => (s(), c(F, null, [
46
- a.paginationType === e($).Dots ? (s(), c("div", {
29
+ setup(t) {
30
+ const l = t, n = b(() => [
31
+ `${l.prefix}__dots-container`
32
+ ]), A = b(() => [
33
+ `${l.prefix}__numbered-container`
34
+ ]), E = b(() => [
35
+ `${l.prefix}__inline-container`
36
+ ]), h = b(() => [
37
+ `${l.prefix}__prev-page`
38
+ ]), c = b(() => [
39
+ `${l.prefix}__next-page`
40
+ ]), W = b(() => [
41
+ `${l.prefix}__page-indicator`
42
+ ]), R = b(() => [
43
+ `${l.prefix}__show-more`
44
+ ]), S = (P) => l.currentPage === P, p = b(() => !l.enabled || !l.prevPageEnabled), w = b(() => !l.enabled || !l.nextPageEnabled);
45
+ return (P, B) => (g(), m(te, null, [
46
+ t.paginationType === e(I).Dots ? (g(), m("div", {
47
47
  key: 0,
48
- class: l(e(i))
48
+ class: r(e(n))
49
49
  }, [
50
- (s(!0), c(F, null, me(a.totalPages, (b) => (s(), he(e(E), {
51
- key: `dot-${b}`,
52
- "aria-label": `Show page ${b}`,
53
- color: a.color,
54
- disabled: L(b),
50
+ (g(!0), m(te, null, ke(t.totalPages, (C) => (g(), ze(e(D), {
51
+ key: `dot-${C}`,
52
+ "aria-label": `Show page ${C}`,
53
+ color: t.color,
54
+ disabled: S(C),
55
55
  height: "0.75rem",
56
- "on-click": () => a.gotoPage(b),
56
+ "on-click": () => t.gotoPage(C),
57
57
  width: "0.75rem",
58
- variant: L(b) ? e(B).Outline : a.variant,
58
+ variant: S(C) ? e(H).Outline : t.variant,
59
59
  wrap: ""
60
60
  }, null, 8, ["aria-label", "color", "disabled", "on-click", "variant"]))), 128))
61
- ], 2)) : C("", !0),
62
- a.paginationType === e($).Numbered ? (s(), c("div", {
61
+ ], 2)) : L("", !0),
62
+ t.paginationType === e(I).Numbered ? (g(), m("div", {
63
63
  key: 1,
64
- class: l(e(I))
64
+ class: r(e(A))
65
65
  }, [
66
- y("div", {
67
- class: l(e(f))
66
+ z("div", {
67
+ class: r(e(h))
68
68
  }, [
69
- x(e(E), {
69
+ k(e(D), {
70
70
  "aria-label": "Show previous page of slides",
71
- color: a.color,
72
- disabled: e(v),
73
- "icon-before": e(O).ChevronLeft,
74
- "icon-size": e(D).Tiny,
75
- size: e(W).Tiny,
76
- "on-click": a.showPrevItems,
77
- variant: e(v) ? e(B).Text : a.variant
71
+ color: t.color,
72
+ disabled: e(p),
73
+ "icon-before": e(Y).ChevronLeft,
74
+ "icon-size": e(X).Tiny,
75
+ size: e(U).Tiny,
76
+ "on-click": t.showPrevItems,
77
+ variant: e(p) ? e(H).Text : t.variant
78
78
  }, null, 8, ["color", "disabled", "icon-before", "icon-size", "size", "on-click", "variant"])
79
79
  ], 2),
80
- y("div", {
81
- class: l(e(N))
80
+ z("div", {
81
+ class: r(e(W))
82
82
  }, [
83
- x(e(ce), {
84
- type: e(xe).Small
83
+ k(e(Se), {
84
+ type: e(Ne).Small
85
85
  }, {
86
- default: X(() => [
87
- Y(q(a.currentPage) + " / " + q(a.totalPages), 1)
86
+ default: de(() => [
87
+ ue(ee(t.currentPage) + " / " + ee(t.totalPages), 1)
88
88
  ]),
89
89
  _: 1
90
90
  }, 8, ["type"])
91
91
  ], 2),
92
- y("div", {
93
- class: l(e(g))
92
+ z("div", {
93
+ class: r(e(c))
94
94
  }, [
95
- x(e(E), {
95
+ k(e(D), {
96
96
  "aria-label": "Show next page of slides",
97
- color: a.color,
97
+ color: t.color,
98
98
  disabled: e(w),
99
- "icon-before": e(O).ChevronRight,
100
- "icon-size": e(D).Tiny,
101
- size: e(W).Tiny,
102
- "on-click": a.showNextItems,
103
- variant: e(w) ? e(B).Text : a.variant
99
+ "icon-before": e(Y).ChevronRight,
100
+ "icon-size": e(X).Tiny,
101
+ size: e(U).Tiny,
102
+ "on-click": t.showNextItems,
103
+ variant: e(w) ? e(H).Text : t.variant
104
104
  }, null, 8, ["color", "disabled", "icon-before", "icon-size", "size", "on-click", "variant"])
105
105
  ], 2),
106
- a.showMore ? (s(), c("div", {
106
+ t.showMore ? (g(), m("div", {
107
107
  key: 0,
108
- class: l(e(k))
108
+ class: r(e(R))
109
109
  }, [
110
- x(e(E), {
111
- "aria-label": a.moreAriaLabel,
112
- color: a.color,
113
- size: e(W).Small,
114
- "on-click": a.showMore,
115
- variant: a.variant
110
+ k(e(D), {
111
+ "aria-label": t.moreAriaLabel,
112
+ color: t.color,
113
+ size: e(U).Small,
114
+ "on-click": t.showMore,
115
+ variant: t.variant
116
116
  }, {
117
- default: X(() => [
118
- Y(q(a.moreLabel), 1)
117
+ default: de(() => [
118
+ ue(ee(t.moreLabel), 1)
119
119
  ]),
120
120
  _: 1
121
121
  }, 8, ["aria-label", "color", "size", "on-click", "variant"])
122
- ], 2)) : C("", !0)
123
- ], 2)) : C("", !0),
124
- a.paginationType === e($).Inline ? (s(), c("div", {
122
+ ], 2)) : L("", !0)
123
+ ], 2)) : L("", !0),
124
+ t.paginationType === e(I).Inline ? (g(), m("div", {
125
125
  key: 2,
126
- class: l(e(T))
126
+ class: r(e(E))
127
127
  }, [
128
- y("div", {
129
- class: l(e(f))
128
+ z("div", {
129
+ class: r(e(h))
130
130
  }, [
131
- x(e(E), {
131
+ k(e(D), {
132
132
  "aria-label": "Show previous page of slides",
133
- "align-content": e(A).Center,
134
- color: a.color,
135
- disabled: e(v),
136
- "icon-before": e(O).ChevronLeft,
137
- "icon-size": e(D).Small,
138
- size: e(W).Tiny,
139
- "on-click": a.showPrevItems,
140
- variant: e(v) ? e(B).Text : a.variant,
133
+ "align-content": e(G).Center,
134
+ color: t.color,
135
+ disabled: e(p),
136
+ "icon-before": e(Y).ChevronLeft,
137
+ "icon-size": e(X).Small,
138
+ size: e(U).Tiny,
139
+ "on-click": t.showPrevItems,
140
+ variant: e(p) ? e(H).Text : t.variant,
141
141
  width: "30px",
142
142
  height: "30px",
143
143
  wrap: ""
144
144
  }, null, 8, ["align-content", "color", "disabled", "icon-before", "icon-size", "size", "on-click", "variant"])
145
145
  ], 2),
146
- y("div", {
147
- class: l(e(g))
146
+ z("div", {
147
+ class: r(e(c))
148
148
  }, [
149
- x(e(E), {
149
+ k(e(D), {
150
150
  "aria-label": "Show next page of slides",
151
- "align-content": e(A).Center,
152
- color: a.color,
151
+ "align-content": e(G).Center,
152
+ color: t.color,
153
153
  disabled: e(w),
154
- "icon-before": e(O).ChevronRight,
155
- "icon-size": e(D).Small,
156
- size: e(W).Tiny,
157
- "on-click": a.showNextItems,
158
- variant: e(w) ? e(B).Text : a.variant,
154
+ "icon-before": e(Y).ChevronRight,
155
+ "icon-size": e(X).Small,
156
+ size: e(U).Tiny,
157
+ "on-click": t.showNextItems,
158
+ variant: e(w) ? e(H).Text : t.variant,
159
159
  width: "30px",
160
160
  height: "30px",
161
161
  wrap: ""
162
162
  }, null, 8, ["align-content", "color", "disabled", "icon-before", "icon-size", "size", "on-click", "variant"])
163
163
  ], 2)
164
- ], 2)) : C("", !0)
164
+ ], 2)) : L("", !0)
165
165
  ], 64));
166
166
  }
167
- }), ke = ["data-testid"], Le = ["hidden"], Se = /* @__PURE__ */ re({
167
+ }), De = ["data-testid"], He = ["hidden"], Re = /* @__PURE__ */ xe({
168
168
  name: "CLCarousel",
169
169
  __name: "CLCarousel",
170
170
  props: {
171
- color: { default: ye.Neutral },
172
- controlAlign: { default: A.Right },
173
- controlPosition: { default: R.Before },
171
+ color: { default: Me.Neutral },
172
+ controlAlign: { default: G.Right },
173
+ controlPosition: { default: Z.Before },
174
174
  enabled: { type: Boolean, default: !0 },
175
+ infinite: { type: Boolean, default: !1 },
175
176
  moreLabel: { default: "More" },
176
177
  onShowMore: {},
177
- paginationType: { default: $.Numbered },
178
+ paginationType: { default: I.Numbered },
178
179
  perPage: { default: 3 },
179
180
  perPageByBreakpoints: {},
180
181
  testId: { default: "clll-carousel" },
181
182
  title: {},
182
- variant: { default: B.Soft },
183
+ variant: { default: H.Soft },
183
184
  width: { default: "100%" }
184
185
  },
185
- setup(a) {
186
- be((t) => ({
187
- v512ef87c: t.width,
188
- v34e944c2: e(U)
186
+ setup(t) {
187
+ Ie((o) => ({
188
+ v59ef4984: o.width,
189
+ v294b641d: e(oe)
189
190
  }));
190
- const o = "clll-carousel", i = a, I = r(), T = r(!1), f = r(1), g = r(i.perPage), N = Te("title"), k = r(!1), L = r(!1), v = r(!1), w = r(), m = r(!1), h = r(), b = r(), U = r("100%"), P = r(0), S = r(0), _ = () => {
191
- if (i.perPageByBreakpoints?.length) {
192
- g.value = i.perPage;
193
- for (const [t, n] of i.perPageByBreakpoints)
194
- window.matchMedia(`(min-width: ${t}px)`).matches && (g.value = n);
191
+ const l = "clll-carousel", n = t, A = v(), E = v(!1), h = v(1), c = v(n.perPage), W = v(0), R = Oe("title"), S = v(!1), p = v(!1), w = v(!1), P = v(0), B = v(!1), C = v(), N = v(!1), T = v(), j = v(), oe = v("100%"), y = v(0), M = v(0), fe = () => {
192
+ if (n.perPageByBreakpoints?.length) {
193
+ c.value = n.perPage;
194
+ for (const [o, a] of n.perPageByBreakpoints)
195
+ window.matchMedia(`(min-width: ${o}px)`).matches && (c.value = a);
195
196
  }
196
- }, ee = () => {
197
- if (h?.value && S.value) {
198
- const n = Math.ceil(S.value / g.value);
199
- P.value = n, n > 1 && (k.value = !0);
197
+ }, ge = () => {
198
+ if (T?.value && M.value) {
199
+ const a = Math.ceil(M.value / c.value);
200
+ y.value = a, n.infinite ? (p.value = !0, w.value = !0) : a > 1 && (p.value = !0);
200
201
  }
201
- }, de = () => {
202
- se(() => {
203
- let t, n;
204
- const d = h?.value;
205
- if (d) {
206
- const p = d?.querySelectorAll(
207
- `div[class="${o}__slides"] > *`
208
- ) ?? [], z = S.value - 1;
209
- for (let M = 0; M < P.value; M++) {
210
- const V = g.value * (M + 1) - 1, ge = V < z ? p[V] : p[z], ie = V < z ? V : z;
211
- $e({ parent: d, child: ge, leftOffset: 40, rightOffset: 40, threshold: 0.5 }) && (ie === z ? (n = z, t = M + 1) : (n = ie, t = M + 1));
202
+ }, Pe = () => {
203
+ S.value || Q(() => {
204
+ let o, a;
205
+ const i = T?.value;
206
+ if (i) {
207
+ const s = i?.querySelectorAll(
208
+ `div[class="${l}__slides"] > *`
209
+ ) ?? [];
210
+ if (n.infinite && n.enabled && P.value > 0) {
211
+ const u = i.offsetWidth, f = u / c.value, d = i.scrollLeft, x = W.value / 2, $ = f * x, V = f * P.value;
212
+ let q = d - $;
213
+ q < 0 && (q = V + q);
214
+ const F = Math.floor(q / u) + 1;
215
+ if (F < 1 ? h.value = y.value : F > y.value ? h.value = 1 : h.value = F, !S.value) {
216
+ if (d < $) {
217
+ S.value = !0;
218
+ const J = d + V;
219
+ i.scrollTo({ left: J, behavior: "auto" }), setTimeout(() => {
220
+ S.value = !1;
221
+ }, 50);
222
+ } else if (d >= $ + V) {
223
+ S.value = !0;
224
+ const J = d - V;
225
+ i.scrollTo({ left: J, behavior: "auto" }), setTimeout(() => {
226
+ S.value = !1;
227
+ }, 50);
228
+ }
229
+ }
230
+ } else {
231
+ const u = M.value - 1;
232
+ for (let f = 0; f < y.value; f++) {
233
+ const d = c.value * (f + 1) - 1, x = d < u ? s[d] : s[u], $ = d < u ? d : u;
234
+ Ve({ parent: i, child: x, leftOffset: 40, rightOffset: 40, threshold: 0.5 }) && ($ === u ? (a = u, o = f + 1) : (a = $, o = f + 1));
235
+ }
236
+ a !== void 0 && a > -1 && o && (h.value = o, o > 1 && (w.value = !0), o === 1 && (w.value = !1), o < y.value && (p.value = !0), o === y.value && (p.value = !1));
212
237
  }
213
- n !== void 0 && n > -1 && t && (f.value = t, t > 1 && (L.value = !0), t === 1 && (L.value = !1), t < P.value && (k.value = !0), t === P.value && (k.value = !1));
214
238
  }
215
239
  });
216
- }, ae = (t) => {
217
- I.value && se(() => {
218
- const n = Pe(I.value) && !N.value;
219
- !n && (t.title || t.controlPosition === R.Before) ? T.value = !1 : T.value = n;
240
+ }, he = (o) => {
241
+ A.value && Q(() => {
242
+ const a = Ae(A.value) && !R.value;
243
+ !a && (o.title || o.controlPosition === Z.Before) ? E.value = !1 : E.value = a;
220
244
  });
221
- }, j = (t) => {
222
- const n = h?.value, d = n.offsetWidth;
223
- if (n && d) {
224
- const p = t - 1, z = d * p;
225
- n.scrollTo({ left: z, behavior: "smooth" });
226
- }
227
- }, te = () => {
228
- v.value = !0, f.value = 1, _(), ne(), ee();
229
- const t = h?.value, n = t.offsetWidth;
230
- if (t) {
231
- const d = f.value - 1, p = n * d;
232
- t.scrollLeft = p;
233
- }
234
- H && v.value && (window.clearTimeout(w.value), w.value = window.setTimeout(() => {
235
- v.value && (v.value = !1), window.clearTimeout(w.value);
245
+ }, le = (o) => {
246
+ const a = T?.value, i = a.offsetWidth;
247
+ if (a && i)
248
+ if (n.infinite && n.enabled && P.value > 0) {
249
+ const s = i / c.value, u = W.value / 2, f = s * u, d = o - 1, x = f + i * d;
250
+ a.scrollTo({ left: x, behavior: "smooth" });
251
+ } else {
252
+ const s = o - 1, u = i * s;
253
+ a.scrollTo({ left: u, behavior: "smooth" });
254
+ }
255
+ }, me = () => {
256
+ B.value = !0;
257
+ const o = c.value;
258
+ fe(), pe(), ge();
259
+ const a = T?.value, i = a.offsetWidth;
260
+ if (a)
261
+ if (n.infinite && n.enabled && P.value > 0) {
262
+ const s = i / c.value, u = i / o, f = W.value / 2, d = u * f, $ = a.scrollLeft - d;
263
+ if (o !== c.value) {
264
+ const J = a.querySelectorAll(
265
+ `div[class="${l}__slides"] > *`
266
+ ), Ce = Array.from(J), O = Ce.slice(f, Ce.length - f);
267
+ a.innerHTML = "", O.forEach((ye) => a.appendChild(ye));
268
+ const K = Math.min(c.value, O.length);
269
+ K > 0 && O.length > 0 && (O.slice(-K).forEach((se) => {
270
+ const re = se.cloneNode(!0);
271
+ a.insertBefore(re, O[0]);
272
+ }), O.slice(0, K).forEach((se) => {
273
+ const re = se.cloneNode(!0);
274
+ a.appendChild(re);
275
+ }), W.value = K * 2);
276
+ }
277
+ const V = W.value / 2, F = s * V + $;
278
+ Q(() => {
279
+ a.scrollLeft = F;
280
+ });
281
+ } else {
282
+ h.value = 1;
283
+ const s = h.value - 1, u = i * s;
284
+ a.scrollLeft = u;
285
+ }
286
+ _ && B.value && (window.clearTimeout(C.value), C.value = window.setTimeout(() => {
287
+ B.value && (B.value = !1), window.clearTimeout(C.value);
236
288
  }, 300));
237
- }, oe = () => {
238
- v.value || (m.value = !0, H && m.value && (window.clearTimeout(b.value), b.value = window.setTimeout(() => {
239
- m.value && G(), window.clearTimeout(b.value);
289
+ }, be = () => {
290
+ B.value || (N.value = !0, _ && N.value && (window.clearTimeout(j.value), j.value = window.setTimeout(() => {
291
+ N.value && ae(), window.clearTimeout(j.value);
240
292
  }, 200)));
241
- }, G = () => {
242
- v.value || (m.value = !1, de());
243
- }, ne = () => {
244
- const t = h?.value;
245
- if (t) {
246
- const n = t.offsetWidth;
247
- S.value >= g.value ? U.value = `${n / g.value}px` : U.value = `${n / S.value}px`;
248
- }
249
- }, J = () => {
250
- const t = h?.value, n = t.offsetWidth;
251
- if (t && n) {
252
- const d = f.value, p = n * d;
253
- t.scrollTo({ left: p, behavior: "smooth" });
254
- }
255
- }, K = () => {
256
- const t = h?.value, n = t.offsetWidth;
257
- if (t && n) {
258
- const d = f.value - 1, p = n * (d - 1);
259
- t.scrollTo({ left: p, behavior: "smooth" });
293
+ }, ae = () => {
294
+ B.value || (N.value = !1, Pe());
295
+ }, pe = () => {
296
+ const o = T?.value;
297
+ if (o) {
298
+ const a = o.offsetWidth;
299
+ M.value >= c.value ? oe.value = `${a / c.value}px` : oe.value = `${a / M.value}px`;
260
300
  }
301
+ }, ne = () => {
302
+ const o = T?.value, a = o.offsetWidth;
303
+ if (o && a)
304
+ if (n.infinite && n.enabled && P.value > 0) {
305
+ const s = o.scrollLeft + a;
306
+ o.scrollTo({ left: s, behavior: "smooth" });
307
+ } else {
308
+ const i = h.value, s = a * i;
309
+ o.scrollTo({ left: s, behavior: "smooth" });
310
+ }
311
+ }, ie = () => {
312
+ const o = T?.value, a = o.offsetWidth;
313
+ if (o && a)
314
+ if (n.infinite && n.enabled && P.value > 0) {
315
+ const s = o.scrollLeft - a;
316
+ o.scrollTo({ left: s, behavior: "smooth" });
317
+ } else {
318
+ const i = h.value - 1, s = a * (i - 1);
319
+ o.scrollTo({ left: s, behavior: "smooth" });
320
+ }
261
321
  };
262
- we(() => {
263
- if (H) {
264
- window.addEventListener("resize", te);
265
- const t = h?.value;
266
- if (t) {
267
- const n = t?.querySelectorAll(
268
- `div[class="${o}__slides"] > *`
322
+ Ee(() => {
323
+ if (_) {
324
+ window.addEventListener("resize", me);
325
+ const o = T?.value;
326
+ if (o) {
327
+ const a = o?.querySelectorAll(
328
+ `div[class="${l}__slides"] > *`
269
329
  ) ?? [];
270
- S.value = n.length, t.addEventListener("scroll", oe), t.addEventListener("scrollend", G);
330
+ if (P.value = a.length, M.value = a.length, n.infinite && n.enabled && a.length > 0) {
331
+ const i = Array.from(a), s = Math.min(c.value, i.length);
332
+ i.slice(-s).forEach((d) => {
333
+ const x = d.cloneNode(!0);
334
+ o.insertBefore(x, i[0]);
335
+ }), i.slice(0, s).forEach((d) => {
336
+ const x = d.cloneNode(!0);
337
+ o.appendChild(x);
338
+ }), W.value = s * 2, Q(() => {
339
+ const $ = o.offsetWidth / c.value * s;
340
+ o.scrollLeft = $;
341
+ });
342
+ }
343
+ o.addEventListener("scroll", be), o.addEventListener("scrollend", ae);
271
344
  }
272
- ae(i), _(), ne(), ee();
345
+ he(n), fe(), pe(), ge();
273
346
  }
274
- }), pe(() => {
275
- if (H) {
276
- window.removeEventListener("resize", te), w.value && window.clearTimeout(w.value), b.value && window.clearTimeout(b.value);
277
- const t = h?.value;
278
- t && (t.removeEventListener("scroll", oe), t.removeEventListener("scrollend", G));
347
+ }), We(() => {
348
+ if (_) {
349
+ window.removeEventListener("resize", me), C.value && window.clearTimeout(C.value), j.value && window.clearTimeout(j.value);
350
+ const o = T?.value;
351
+ o && (o.removeEventListener("scroll", be), o.removeEventListener("scrollend", ae));
279
352
  }
280
353
  });
281
- const ue = u(() => [
282
- o,
283
- `${o}--${i.controlAlign}`,
284
- `${o}--${i.controlPosition}`,
285
- `${o}--${i.paginationType}`,
286
- i.enabled ? `${o}--enabled` : `${o}--disabled`,
287
- T.value ? "" : `${o}--hastitle`,
288
- i.onShowMore ? `${o}--has-more` : ""
289
- ]), ve = u(() => [
290
- `${o}__slide-controls`,
291
- N.value ? `${o}__slide-controls--hascustomtitle` : ""
292
- ]), fe = u(() => [
293
- `${o}__slides`,
294
- v.value ? `${o}__slides--resizing` : "",
295
- m.value ? `${o}__slides--scrolling` : ""
296
- ]), le = u(() => [
297
- `${o}__navigation`,
298
- `${o}__navigation--${i.controlAlign}`,
299
- `${o}__navigation--${i.controlPosition}`
354
+ const Te = b(() => [
355
+ l,
356
+ `${l}--${n.controlAlign}`,
357
+ `${l}--${n.controlPosition}`,
358
+ `${l}--${n.paginationType}`,
359
+ n.enabled ? `${l}--enabled` : `${l}--disabled`,
360
+ E.value ? "" : `${l}--hastitle`,
361
+ n.onShowMore ? `${l}--has-more` : ""
362
+ ]), $e = b(() => [
363
+ `${l}__slide-controls`,
364
+ R.value ? `${l}__slide-controls--hascustomtitle` : ""
365
+ ]), Le = b(() => [
366
+ `${l}__slides`,
367
+ B.value ? `${l}__slides--resizing` : "",
368
+ N.value ? `${l}__slides--scrolling` : "",
369
+ S.value ? `${l}__slides--jumping` : ""
370
+ ]), we = b(() => [
371
+ `${l}__navigation`,
372
+ `${l}__navigation--${n.controlAlign}`,
373
+ `${l}__navigation--${n.controlPosition}`
300
374
  ]);
301
- return Ce(i, (t) => {
302
- ae(t);
303
- }), (t, n) => (s(), c("div", {
304
- class: l(e(ue)),
305
- "data-testid": a.testId
375
+ return Be(n, (o) => {
376
+ he(o);
377
+ }), (o, a) => (g(), m("div", {
378
+ class: r(e(Te)),
379
+ "data-testid": t.testId
306
380
  }, [
307
- y("div", {
381
+ z("div", {
308
382
  ref_key: "beforeControls",
309
- ref: I,
310
- class: l(e(ve)),
311
- hidden: e(T)
383
+ ref: A,
384
+ class: r(e($e)),
385
+ hidden: e(E)
312
386
  }, [
313
- y("div", {
314
- class: l(`${o}__custom-title`)
387
+ z("div", {
388
+ class: r(`${l}__custom-title`)
315
389
  }, [
316
- Z(t.$slots, "title")
390
+ ve(o.$slots, "title")
317
391
  ], 2),
318
- a.title ? (s(), c("div", {
392
+ t.title ? (g(), m("div", {
319
393
  key: 0,
320
- class: l(`${o}__title`)
394
+ class: r(`${l}__title`)
321
395
  }, [
322
- x(e(ce), {
323
- align: e(N) ? e(A).Center : e(A).Left,
396
+ k(e(Se), {
397
+ align: e(R) ? e(G).Center : e(G).Left,
324
398
  label: "",
325
399
  truncate: ""
326
400
  }, {
327
- default: X(() => [
328
- Y(q(a.title), 1)
401
+ default: de(() => [
402
+ ue(ee(t.title), 1)
329
403
  ]),
330
404
  _: 1
331
405
  }, 8, ["align"])
332
- ], 2)) : C("", !0),
333
- a.controlPosition === e(R).Before && ![e($).Inline, e($).Hidden].includes(a.paginationType) ? (s(), c(F, { key: 1 }, [
334
- e(P) && e(S) > e(g) ? (s(), c("div", {
406
+ ], 2)) : L("", !0),
407
+ t.controlPosition === e(Z).Before && ![e(I).Inline, e(I).Hidden].includes(t.paginationType) ? (g(), m(te, { key: 1 }, [
408
+ e(y) && e(M) > e(c) ? (g(), m("div", {
335
409
  key: 0,
336
- class: l(e(le))
410
+ class: r(e(we))
337
411
  }, [
338
- x(Q, {
339
- color: a.color,
340
- "current-page": e(f),
341
- enabled: !e(m),
342
- "goto-page": j,
343
- "more-label": a.moreLabel,
344
- "next-page-enabled": e(k),
345
- "pagination-type": a.paginationType,
346
- "prev-page-enabled": e(L),
347
- prefix: o,
348
- "show-more": a.onShowMore,
349
- "show-next-items": J,
350
- "show-prev-items": K,
351
- "total-pages": e(P),
352
- variant: a.variant
412
+ k(ce, {
413
+ color: t.color,
414
+ "current-page": e(h),
415
+ enabled: !e(N),
416
+ "goto-page": le,
417
+ "more-label": t.moreLabel,
418
+ "next-page-enabled": e(p),
419
+ "pagination-type": t.paginationType,
420
+ "prev-page-enabled": e(w),
421
+ prefix: l,
422
+ "show-more": t.onShowMore,
423
+ "show-next-items": ne,
424
+ "show-prev-items": ie,
425
+ "total-pages": e(y),
426
+ variant: t.variant
353
427
  }, null, 8, ["color", "current-page", "enabled", "more-label", "next-page-enabled", "pagination-type", "prev-page-enabled", "show-more", "total-pages", "variant"])
354
- ], 2)) : C("", !0)
355
- ], 64)) : C("", !0)
356
- ], 10, Le),
357
- y("div", {
428
+ ], 2)) : L("", !0)
429
+ ], 64)) : L("", !0)
430
+ ], 10, He),
431
+ z("div", {
358
432
  ref_key: "scrollContainer",
359
- ref: h,
360
- class: l(e(fe)),
433
+ ref: T,
434
+ class: r(e(Le)),
361
435
  tabindex: "0"
362
436
  }, [
363
- Z(t.$slots, "default")
437
+ ve(o.$slots, "default")
364
438
  ], 2),
365
- a.controlPosition === e(R).After && ![e($).Inline, e($).Hidden].includes(a.paginationType) ? (s(), c(F, { key: 0 }, [
366
- e(P) && e(S) > e(g) ? (s(), c("div", {
439
+ t.controlPosition === e(Z).After && ![e(I).Inline, e(I).Hidden].includes(t.paginationType) ? (g(), m(te, { key: 0 }, [
440
+ e(y) && e(M) > e(c) ? (g(), m("div", {
367
441
  key: 0,
368
- class: l(`${o}__slide-controls`)
442
+ class: r(`${l}__slide-controls`)
369
443
  }, [
370
- y("div", {
371
- class: l(e(le))
444
+ z("div", {
445
+ class: r(e(we))
372
446
  }, [
373
- x(Q, {
374
- color: a.color,
375
- "current-page": e(f),
376
- enabled: !e(m),
377
- "goto-page": j,
378
- "more-label": a.moreLabel,
379
- "next-page-enabled": e(k),
380
- "pagination-type": a.paginationType,
381
- prefix: o,
382
- "prev-page-enabled": e(L),
383
- "show-more": a.onShowMore,
384
- "show-next-items": J,
385
- "show-prev-items": K,
386
- "total-pages": e(P),
387
- variant: a.variant
447
+ k(ce, {
448
+ color: t.color,
449
+ "current-page": e(h),
450
+ enabled: !e(N),
451
+ "goto-page": le,
452
+ "more-label": t.moreLabel,
453
+ "next-page-enabled": e(p),
454
+ "pagination-type": t.paginationType,
455
+ prefix: l,
456
+ "prev-page-enabled": e(w),
457
+ "show-more": t.onShowMore,
458
+ "show-next-items": ne,
459
+ "show-prev-items": ie,
460
+ "total-pages": e(y),
461
+ variant: t.variant
388
462
  }, null, 8, ["color", "current-page", "enabled", "more-label", "next-page-enabled", "pagination-type", "prev-page-enabled", "show-more", "total-pages", "variant"])
389
463
  ], 2)
390
- ], 2)) : C("", !0)
391
- ], 64)) : C("", !0),
392
- a.paginationType === e($).Inline ? (s(), c("div", {
464
+ ], 2)) : L("", !0)
465
+ ], 64)) : L("", !0),
466
+ t.paginationType === e(I).Inline ? (g(), m("div", {
393
467
  key: 1,
394
- class: l(`${o}__slide-controls ${o}__slide-controls--inline`)
468
+ class: r(`${l}__slide-controls ${l}__slide-controls--inline`)
395
469
  }, [
396
- y("div", {
397
- class: l(`${o}__navigation`)
470
+ z("div", {
471
+ class: r(`${l}__navigation`)
398
472
  }, [
399
- x(Q, {
400
- color: a.color,
401
- "current-page": e(f),
402
- enabled: !e(m),
403
- "goto-page": j,
404
- "more-label": a.moreLabel,
405
- "next-page-enabled": e(k),
406
- "pagination-type": a.paginationType,
407
- prefix: o,
408
- "prev-page-enabled": e(L),
409
- "show-more": a.onShowMore,
410
- "show-next-items": J,
411
- "show-prev-items": K,
412
- "total-pages": e(P),
413
- variant: a.variant
473
+ k(ce, {
474
+ color: t.color,
475
+ "current-page": e(h),
476
+ enabled: !e(N),
477
+ "goto-page": le,
478
+ "more-label": t.moreLabel,
479
+ "next-page-enabled": e(p),
480
+ "pagination-type": t.paginationType,
481
+ prefix: l,
482
+ "prev-page-enabled": e(w),
483
+ "show-more": t.onShowMore,
484
+ "show-next-items": ne,
485
+ "show-prev-items": ie,
486
+ "total-pages": e(y),
487
+ variant: t.variant
414
488
  }, null, 8, ["color", "current-page", "enabled", "more-label", "next-page-enabled", "pagination-type", "prev-page-enabled", "show-more", "total-pages", "variant"])
415
489
  ], 2)
416
- ], 2)) : C("", !0)
417
- ], 10, ke));
490
+ ], 2)) : L("", !0)
491
+ ], 10, De));
418
492
  }
419
- }), ze = (a, o) => {
420
- const i = a.__vccOpts || a;
421
- for (const [I, T] of o)
422
- i[I] = T;
423
- return i;
424
- }, Ie = {}, Ee = {
425
- class: /* @__PURE__ */ l(["clll-carousel__slide"])
493
+ }), je = (t, l) => {
494
+ const n = t.__vccOpts || t;
495
+ for (const [A, E] of l)
496
+ n[A] = E;
497
+ return n;
498
+ }, qe = {}, Fe = {
499
+ class: /* @__PURE__ */ r(["clll-carousel__slide"])
426
500
  };
427
- function Be(a, o) {
428
- return s(), c("div", Ee, [
429
- Z(a.$slots, "default")
501
+ function Je(t, l) {
502
+ return g(), m("div", Fe, [
503
+ ve(t.$slots, "default")
430
504
  ]);
431
505
  }
432
- const Ne = /* @__PURE__ */ ze(Ie, [["render", Be]]), Me = Se;
433
- Me.Slide = Ne;
506
+ const Ue = /* @__PURE__ */ je(qe, [["render", Je]]), Ge = Re;
507
+ Ge.Slide = Ue;
434
508
  export {
435
- Me as CLCarousel,
436
- Me as default
509
+ Ge as CLCarousel,
510
+ Ge as default
437
511
  };