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