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