@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.
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/chunks/helper-oZuRnF9g.js +81 -0
- package/dist/components/Buttons/CLButton/CLButton.js +1 -1
- package/dist/components/Buttons/CLButton/CLButton.vue.d.ts +4 -4
- package/dist/components/CLIcon/CLIcon.js +1 -1
- 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 +248 -213
- package/dist/components/Containers/CLDisclosure/CLDisclosure.js +14 -15
- package/dist/components/Containers/CLDisclosure/CLDisclosure.vue.d.ts +3 -5
- 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/Indicators/CLPill/CLPill.vue.d.ts +3 -0
- package/dist/components/Modals/CLModal/CLModal.js +2 -2
- 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 +149 -151
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.vue.d.ts +5 -8
- package/dist/components/Popups/CLToast/CLToast.js +1 -1
- package/dist/components/Popups/CLToast/CLToast.vue.d.ts +1 -0
- package/dist/components/Providers/CLThemeProvider/CLThemeProvider.js +1 -1
- package/dist/components/Providers/CLToastProvider/CLToastProvider.js +1 -1
- package/dist/composables/useDropdown.js +1 -1
- package/dist/composables/useEsc.js +1 -1
- package/dist/index.js +3 -3
- package/dist/types.d.ts +3 -0
- package/dist/utils/helper.d.ts +4 -1
- package/package.json +1 -1
- 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
|
|
4
|
-
import { _ as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { CLPaginationType as
|
|
7
|
-
import { i as _, d as Ae, e as Ve } from "../../../chunks/helper-
|
|
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 =
|
|
30
|
+
const l = t, n = w(() => [
|
|
31
31
|
`${l.prefix}__dots-container`
|
|
32
|
-
]),
|
|
32
|
+
]), V = w(() => [
|
|
33
|
+
`${l.prefix}__arrows-container`
|
|
34
|
+
]), B = w(() => [
|
|
33
35
|
`${l.prefix}__numbered-container`
|
|
34
|
-
]),
|
|
36
|
+
]), p = w(() => [
|
|
35
37
|
`${l.prefix}__inline-container`
|
|
36
|
-
]),
|
|
38
|
+
]), c = w(() => [
|
|
37
39
|
`${l.prefix}__prev-page`
|
|
38
|
-
]),
|
|
40
|
+
]), $ = w(() => [
|
|
39
41
|
`${l.prefix}__next-page`
|
|
40
|
-
]),
|
|
42
|
+
]), F = w(() => [
|
|
41
43
|
`${l.prefix}__page-indicator`
|
|
42
|
-
]),
|
|
44
|
+
]), W = w(() => [
|
|
43
45
|
`${l.prefix}__show-more`
|
|
44
|
-
]),
|
|
45
|
-
return (
|
|
46
|
-
t.paginationType === e(
|
|
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
|
-
(
|
|
51
|
-
key: `dot-${
|
|
52
|
-
"aria-label": `Show page ${
|
|
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:
|
|
56
|
+
disabled: L(b),
|
|
55
57
|
height: "0.75rem",
|
|
56
|
-
"on-click": () => t.gotoPage(
|
|
58
|
+
"on-click": () => t.gotoPage(b),
|
|
57
59
|
width: "0.75rem",
|
|
58
|
-
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)) :
|
|
62
|
-
t.paginationType === e(
|
|
63
|
+
], 2)) : P("", !0),
|
|
64
|
+
t.paginationType === e(E).Numbered ? (f(), h("div", {
|
|
63
65
|
key: 1,
|
|
64
|
-
class: r(e(
|
|
66
|
+
class: r(e(B))
|
|
65
67
|
}, [
|
|
66
|
-
|
|
67
|
-
class: r(e(
|
|
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
73
|
color: t.color,
|
|
72
|
-
disabled: e(
|
|
73
|
-
"icon-before": e(
|
|
74
|
-
"icon-size": e(
|
|
75
|
-
size: e(
|
|
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(
|
|
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: r(e(
|
|
82
|
+
x("div", {
|
|
83
|
+
class: r(e(F))
|
|
82
84
|
}, [
|
|
83
|
-
|
|
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
|
-
|
|
93
|
-
class: r(e(
|
|
94
|
+
x("div", {
|
|
95
|
+
class: r(e($))
|
|
94
96
|
}, [
|
|
95
|
-
|
|
97
|
+
y(e(M), {
|
|
96
98
|
"aria-label": "Show next page of slides",
|
|
97
99
|
color: t.color,
|
|
98
|
-
disabled: e(
|
|
99
|
-
"icon-before": e(
|
|
100
|
-
"icon-size": e(
|
|
101
|
-
size: e(
|
|
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(
|
|
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 ? (
|
|
108
|
+
t.showMore ? (f(), h("div", {
|
|
107
109
|
key: 0,
|
|
108
|
-
class: r(e(
|
|
110
|
+
class: r(e(W))
|
|
109
111
|
}, [
|
|
110
|
-
|
|
112
|
+
y(e(M), {
|
|
111
113
|
"aria-label": t.moreAriaLabel,
|
|
112
114
|
color: t.color,
|
|
113
|
-
size: e(
|
|
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)) :
|
|
123
|
-
], 2)) :
|
|
124
|
-
t.paginationType === e(
|
|
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(
|
|
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
|
-
|
|
129
|
-
class: r(e(
|
|
163
|
+
x("div", {
|
|
164
|
+
class: r(e(c))
|
|
130
165
|
}, [
|
|
131
|
-
|
|
166
|
+
y(e(M), {
|
|
132
167
|
"aria-label": "Show previous page of slides",
|
|
133
|
-
"align-content": e(
|
|
168
|
+
"align-content": e(Q).Center,
|
|
134
169
|
color: t.color,
|
|
135
|
-
disabled: e(
|
|
136
|
-
"icon-before": e(
|
|
137
|
-
"icon-size": e(
|
|
138
|
-
size: e(
|
|
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(
|
|
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: r(e(
|
|
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(
|
|
186
|
+
"align-content": e(Q).Center,
|
|
152
187
|
color: t.color,
|
|
153
|
-
disabled: e(
|
|
154
|
-
"icon-before": e(
|
|
155
|
-
"icon-size": e(
|
|
156
|
-
size: e(
|
|
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(
|
|
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
|
-
}), De = ["data-testid"],
|
|
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:
|
|
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:
|
|
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:
|
|
218
|
+
variant: { default: A.Soft },
|
|
184
219
|
width: { default: "100%" }
|
|
185
220
|
},
|
|
186
221
|
setup(t) {
|
|
187
222
|
Ie((o) => ({
|
|
188
|
-
|
|
189
|
-
|
|
223
|
+
v3ba68b74: o.width,
|
|
224
|
+
v1ab12a15: e(oe)
|
|
190
225
|
}));
|
|
191
|
-
const l = "clll-carousel", n = t,
|
|
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 (
|
|
199
|
-
const a = Math.ceil(
|
|
200
|
-
|
|
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
|
-
},
|
|
203
|
-
|
|
237
|
+
}, Se = () => {
|
|
238
|
+
W.value || Y(() => {
|
|
204
239
|
let o, a;
|
|
205
|
-
const i =
|
|
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 &&
|
|
211
|
-
const u = i.offsetWidth,
|
|
212
|
-
let
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
if (
|
|
216
|
-
if (d <
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
i.scrollTo({ left:
|
|
220
|
-
|
|
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 >=
|
|
223
|
-
|
|
224
|
-
const
|
|
225
|
-
i.scrollTo({ left:
|
|
226
|
-
|
|
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 =
|
|
232
|
-
for (let
|
|
233
|
-
const d = c.value * (
|
|
234
|
-
Ve({ parent: i, child:
|
|
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 && (
|
|
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
|
-
|
|
242
|
-
const a = Ae(
|
|
243
|
-
!a && (o.title || o.controlPosition === Z.Before) ?
|
|
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 =
|
|
281
|
+
const a = z?.value, i = a.offsetWidth;
|
|
247
282
|
if (a && i)
|
|
248
|
-
if (n.infinite && n.enabled &&
|
|
249
|
-
const s = i / c.value, u =
|
|
250
|
-
a.scrollTo({ left:
|
|
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
|
-
|
|
291
|
+
k.value = !0;
|
|
257
292
|
const o = c.value;
|
|
258
|
-
fe(),
|
|
259
|
-
const a =
|
|
293
|
+
fe(), we(), ge();
|
|
294
|
+
const a = z?.value, i = a.offsetWidth;
|
|
260
295
|
if (a)
|
|
261
|
-
if (n.infinite && n.enabled &&
|
|
262
|
-
const s = i / c.value, u = i / o,
|
|
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
|
|
299
|
+
const K = a.querySelectorAll(
|
|
265
300
|
`div[class="${l}__slides"] > *`
|
|
266
|
-
), Ce = Array.from(
|
|
267
|
-
a.innerHTML = "",
|
|
268
|
-
const
|
|
269
|
-
|
|
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,
|
|
272
|
-
}),
|
|
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
|
-
}),
|
|
310
|
+
}), $.value = X * 2);
|
|
276
311
|
}
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
a.scrollLeft =
|
|
312
|
+
const O = $.value / 2, G = s * O + I;
|
|
313
|
+
Y(() => {
|
|
314
|
+
a.scrollLeft = G;
|
|
280
315
|
});
|
|
281
316
|
} else {
|
|
282
|
-
|
|
283
|
-
const s =
|
|
317
|
+
p.value = 1;
|
|
318
|
+
const s = p.value - 1, u = i * s;
|
|
284
319
|
a.scrollLeft = u;
|
|
285
320
|
}
|
|
286
|
-
_ &&
|
|
287
|
-
|
|
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
|
-
|
|
291
|
-
|
|
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
|
-
|
|
295
|
-
},
|
|
296
|
-
const o =
|
|
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
|
-
|
|
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 =
|
|
337
|
+
const o = z?.value, a = o.offsetWidth;
|
|
303
338
|
if (o && a)
|
|
304
|
-
if (n.infinite && n.enabled &&
|
|
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 =
|
|
343
|
+
const i = p.value, s = a * i;
|
|
309
344
|
o.scrollTo({ left: s, behavior: "smooth" });
|
|
310
345
|
}
|
|
311
346
|
}, ie = () => {
|
|
312
|
-
const o =
|
|
347
|
+
const o = z?.value, a = o.offsetWidth;
|
|
313
348
|
if (o && a)
|
|
314
|
-
if (n.infinite && n.enabled &&
|
|
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 =
|
|
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 =
|
|
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 (
|
|
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
|
|
334
|
-
o.insertBefore(
|
|
368
|
+
const S = d.cloneNode(!0);
|
|
369
|
+
o.insertBefore(S, i[0]);
|
|
335
370
|
}), i.slice(0, s).forEach((d) => {
|
|
336
|
-
const
|
|
337
|
-
o.appendChild(
|
|
338
|
-
}),
|
|
339
|
-
const
|
|
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(),
|
|
380
|
+
he(n), fe(), we(), ge();
|
|
346
381
|
}
|
|
347
382
|
}), We(() => {
|
|
348
383
|
if (_) {
|
|
349
|
-
window.removeEventListener("resize", me),
|
|
350
|
-
const o =
|
|
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
|
|
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
|
-
|
|
395
|
+
B.value ? "" : `${l}--hastitle`,
|
|
361
396
|
n.onShowMore ? `${l}--has-more` : ""
|
|
362
|
-
]), $e =
|
|
397
|
+
]), $e = w(() => [
|
|
363
398
|
`${l}__slide-controls`,
|
|
364
|
-
|
|
365
|
-
]), Le =
|
|
399
|
+
F.value ? `${l}__slide-controls--hascustomtitle` : ""
|
|
400
|
+
]), Le = w(() => [
|
|
366
401
|
`${l}__slides`,
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
]),
|
|
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) => (
|
|
378
|
-
class: r(e(
|
|
412
|
+
}), (o, a) => (f(), h("div", {
|
|
413
|
+
class: r(e(Pe)),
|
|
379
414
|
"data-testid": t.testId
|
|
380
415
|
}, [
|
|
381
|
-
|
|
416
|
+
x("div", {
|
|
382
417
|
ref_key: "beforeControls",
|
|
383
|
-
ref:
|
|
418
|
+
ref: V,
|
|
384
419
|
class: r(e($e)),
|
|
385
|
-
hidden: e(
|
|
420
|
+
hidden: e(B)
|
|
386
421
|
}, [
|
|
387
|
-
|
|
422
|
+
x("div", {
|
|
388
423
|
class: r(`${l}__custom-title`)
|
|
389
424
|
}, [
|
|
390
425
|
ve(o.$slots, "title")
|
|
391
426
|
], 2),
|
|
392
|
-
t.title ? (
|
|
427
|
+
t.title ? (f(), h("div", {
|
|
393
428
|
key: 0,
|
|
394
429
|
class: r(`${l}__title`)
|
|
395
430
|
}, [
|
|
396
|
-
|
|
397
|
-
align: e(
|
|
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)) :
|
|
407
|
-
t.controlPosition === e(Z).Before && ![e(
|
|
408
|
-
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", {
|
|
409
444
|
key: 0,
|
|
410
|
-
class: r(e(
|
|
445
|
+
class: r(e(pe))
|
|
411
446
|
}, [
|
|
412
|
-
|
|
447
|
+
y(ce, {
|
|
413
448
|
color: t.color,
|
|
414
|
-
"current-page": e(
|
|
415
|
-
enabled: !e(
|
|
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(
|
|
453
|
+
"next-page-enabled": e(L),
|
|
419
454
|
"pagination-type": t.paginationType,
|
|
420
|
-
"prev-page-enabled": e(
|
|
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(
|
|
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)) :
|
|
429
|
-
], 64)) :
|
|
430
|
-
], 10,
|
|
431
|
-
|
|
463
|
+
], 2)) : P("", !0)
|
|
464
|
+
], 64)) : P("", !0)
|
|
465
|
+
], 10, Re),
|
|
466
|
+
x("div", {
|
|
432
467
|
ref_key: "scrollContainer",
|
|
433
|
-
ref:
|
|
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(
|
|
440
|
-
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", {
|
|
441
476
|
key: 0,
|
|
442
477
|
class: r(`${l}__slide-controls`)
|
|
443
478
|
}, [
|
|
444
|
-
|
|
445
|
-
class: r(e(
|
|
479
|
+
x("div", {
|
|
480
|
+
class: r(e(pe))
|
|
446
481
|
}, [
|
|
447
|
-
|
|
482
|
+
y(ce, {
|
|
448
483
|
color: t.color,
|
|
449
|
-
"current-page": e(
|
|
450
|
-
enabled: !e(
|
|
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(
|
|
488
|
+
"next-page-enabled": e(L),
|
|
454
489
|
"pagination-type": t.paginationType,
|
|
455
490
|
prefix: l,
|
|
456
|
-
"prev-page-enabled": e(
|
|
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(
|
|
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)) :
|
|
465
|
-
], 64)) :
|
|
466
|
-
t.paginationType === e(
|
|
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
|
-
|
|
505
|
+
x("div", {
|
|
471
506
|
class: r(`${l}__navigation`)
|
|
472
507
|
}, [
|
|
473
|
-
|
|
508
|
+
y(ce, {
|
|
474
509
|
color: t.color,
|
|
475
|
-
"current-page": e(
|
|
476
|
-
enabled: !e(
|
|
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(
|
|
514
|
+
"next-page-enabled": e(L),
|
|
480
515
|
"pagination-type": t.paginationType,
|
|
481
516
|
prefix: l,
|
|
482
|
-
"prev-page-enabled": e(
|
|
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(
|
|
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)) :
|
|
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 [
|
|
496
|
-
n[
|
|
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
|
|
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 =
|
|
541
|
+
const Ue = /* @__PURE__ */ je(qe, [["render", Je]]), Ge = He;
|
|
507
542
|
Ge.Slide = Ue;
|
|
508
543
|
export {
|
|
509
544
|
Ge as CLCarousel,
|