adverich-kun-ui 0.1.643 → 0.1.644
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/AGENTS.md +4 -0
- package/dist/AGENTS.md +4 -0
- package/dist/components/KunCarousel/src/components/KunCarousel.js +77 -67
- package/dist/components/KunCarousel/src/composables/kunCarouselContext.js +8 -0
- package/dist/components/KunCarousel/src/composables/useKunCarouselEngine.js +186 -180
- package/dist/index.js +129 -128
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -811,6 +811,10 @@ autoplay:play, autoplay:stop, autoplay:interaction
|
|
|
811
811
|
|
|
812
812
|
**Slots:** default (slides), #prev, #next, #dots
|
|
813
813
|
|
|
814
|
+
**Clicks post-drag:** se suprimen automáticamente en captura; el contenido
|
|
815
|
+
puede usar `useKunCarousel()` (inyecta `{ api, didDrag, selectedIndex,
|
|
816
|
+
isDragging, isSettled }`) para no cablear refs en grillas/cards.
|
|
817
|
+
|
|
814
818
|
**Showcase:** `/examples/KunCarousel` es una única página con todos los demos
|
|
815
819
|
juntos, uno debajo del otro (Default, Loop, RightToLeft, SlidesToScroll,
|
|
816
820
|
DragFree, Align, VariableWidths, YAxis, SlidesPerView, Thumbnails,
|
package/dist/AGENTS.md
CHANGED
|
@@ -811,6 +811,10 @@ autoplay:play, autoplay:stop, autoplay:interaction
|
|
|
811
811
|
|
|
812
812
|
**Slots:** default (slides), #prev, #next, #dots
|
|
813
813
|
|
|
814
|
+
**Clicks post-drag:** se suprimen automáticamente en captura; el contenido
|
|
815
|
+
puede usar `useKunCarousel()` (inyecta `{ api, didDrag, selectedIndex,
|
|
816
|
+
isDragging, isSettled }`) para no cablear refs en grillas/cards.
|
|
817
|
+
|
|
814
818
|
**Showcase:** `/examples/KunCarousel` es una única página con todos los demos
|
|
815
819
|
juntos, uno debajo del otro (Default, Loop, RightToLeft, SlidesToScroll,
|
|
816
820
|
DragFree, Align, VariableWidths, YAxis, SlidesPerView, Thumbnails,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { __exportAll as e } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import t from "../composables/kunCarouselProps.js";
|
|
3
3
|
import n from "../composables/useKunCarouselEngine.js";
|
|
4
|
+
import { KUN_CAROUSEL_KEY as r } from "../composables/kunCarouselContext.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
import { Fragment as
|
|
6
|
+
import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, normalizeClass as l, normalizeStyle as u, openBlock as d, provide as f, ref as p, renderList as m, renderSlot as h, unref as g } from "vue";
|
|
6
7
|
//#region src/components/KunCarousel/src/components/KunCarousel.vue
|
|
7
|
-
var
|
|
8
|
+
var _ = /* @__PURE__ */ e({ default: () => k }), v = ["aria-label"], y = ["disabled", "aria-label"], b = {
|
|
8
9
|
key: 1,
|
|
9
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
11
|
viewBox: "0 0 24 24",
|
|
@@ -14,7 +15,7 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
14
15
|
"stroke-linecap": "round",
|
|
15
16
|
"stroke-linejoin": "round",
|
|
16
17
|
class: "w-5 h-5"
|
|
17
|
-
},
|
|
18
|
+
}, x = ["disabled", "aria-label"], S = {
|
|
18
19
|
key: 1,
|
|
19
20
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20
21
|
viewBox: "0 0 24 24",
|
|
@@ -24,10 +25,10 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
24
25
|
"stroke-linecap": "round",
|
|
25
26
|
"stroke-linejoin": "round",
|
|
26
27
|
class: "w-5 h-5"
|
|
27
|
-
},
|
|
28
|
+
}, ee = {
|
|
28
29
|
key: 1,
|
|
29
30
|
class: "mt-3 flex items-center justify-center gap-3"
|
|
30
|
-
},
|
|
31
|
+
}, te = ["disabled", "aria-label"], C = {
|
|
31
32
|
key: 0,
|
|
32
33
|
d: "m15 18-6-6 6-6"
|
|
33
34
|
}, w = {
|
|
@@ -77,17 +78,25 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
77
78
|
"autoplay:stop",
|
|
78
79
|
"autoplay:interaction"
|
|
79
80
|
],
|
|
80
|
-
setup(e, { expose: t, emit:
|
|
81
|
-
let k = e, A =
|
|
81
|
+
setup(e, { expose: t, emit: _ }) {
|
|
82
|
+
let k = e, A = _, j = p(null), M = p(null), { api: N, selectedIndex: P, previousIndex: F, snaps: I, inView: L, scrollProgress: R, canPrev: z, canNext: B, isDragging: V, isSettled: H, didDrag: U, autoplayPlaying: W, effectiveOptions: G, reInit: ne } = n({
|
|
82
83
|
props: k,
|
|
83
84
|
emit: A,
|
|
84
85
|
viewportRef: j,
|
|
85
86
|
containerRef: M
|
|
86
|
-
})
|
|
87
|
+
});
|
|
88
|
+
f(r, {
|
|
89
|
+
api: N,
|
|
90
|
+
didDrag: U,
|
|
91
|
+
selectedIndex: P,
|
|
92
|
+
isDragging: V,
|
|
93
|
+
isSettled: H
|
|
94
|
+
});
|
|
95
|
+
let K = a(() => G.value.axis === "y"), q = a(() => !K.value && G.value.direction === "rtl"), J = a(() => ({
|
|
87
96
|
...K.value ? { height: k.height } : {},
|
|
88
97
|
direction: q.value ? "rtl" : "ltr",
|
|
89
98
|
touchAction: K.value ? "pan-x" : "pan-y"
|
|
90
|
-
})), Y =
|
|
99
|
+
})), Y = a(() => ({
|
|
91
100
|
"--kun-slide-size": k.slideSize,
|
|
92
101
|
gap: k.gap
|
|
93
102
|
}));
|
|
@@ -140,42 +149,43 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
140
149
|
canNext: B,
|
|
141
150
|
isDragging: V,
|
|
142
151
|
isSettled: H,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
152
|
+
didDrag: U,
|
|
153
|
+
autoplayPlaying: W,
|
|
154
|
+
options: G
|
|
155
|
+
}), (t, n) => (d(), s("div", { class: l(["kun-carousel relative w-full", k.wrapperClass]) }, [
|
|
156
|
+
c("div", {
|
|
147
157
|
ref_key: "viewportRef",
|
|
148
158
|
ref: j,
|
|
149
159
|
tabindex: "0",
|
|
150
|
-
class:
|
|
160
|
+
class: l([
|
|
151
161
|
"kun-carousel__viewport overflow-hidden outline-none select-none",
|
|
152
162
|
K.value ? "" : "w-full",
|
|
153
163
|
t.axis === "x" ? "kun-carousel__viewport--x" : "kun-carousel__viewport--y",
|
|
154
|
-
|
|
164
|
+
g(V) ? "cursor-grabbing" : "cursor-grab",
|
|
155
165
|
k.viewportClass
|
|
156
166
|
]),
|
|
157
|
-
style:
|
|
167
|
+
style: u(J.value),
|
|
158
168
|
role: "region",
|
|
159
169
|
"aria-roledescription": "carousel",
|
|
160
170
|
"aria-label": e.ariaLabel
|
|
161
|
-
}, [
|
|
171
|
+
}, [c("div", {
|
|
162
172
|
ref_key: "containerRef",
|
|
163
173
|
ref: M,
|
|
164
|
-
class:
|
|
174
|
+
class: l([
|
|
165
175
|
"kun-carousel__container flex will-change-transform",
|
|
166
176
|
K.value ? "flex-col" : "flex-row",
|
|
167
177
|
k.containerClass
|
|
168
178
|
]),
|
|
169
|
-
style:
|
|
170
|
-
}, [
|
|
171
|
-
k.showArrows && k.arrowsPosition === "sides" ? (
|
|
179
|
+
style: u(Y.value)
|
|
180
|
+
}, [h(t.$slots, "default")], 6)], 14, v),
|
|
181
|
+
k.showArrows && k.arrowsPosition === "sides" ? (d(), s(i, { key: 0 }, [h(t.$slots, "prev", {
|
|
172
182
|
goToPrev: Z,
|
|
173
|
-
disabled: !
|
|
174
|
-
canGoToPrev:
|
|
175
|
-
}, () => [
|
|
183
|
+
disabled: !g(z),
|
|
184
|
+
canGoToPrev: g(z)
|
|
185
|
+
}, () => [c("button", {
|
|
176
186
|
type: "button",
|
|
177
|
-
disabled: !
|
|
178
|
-
class:
|
|
187
|
+
disabled: !g(z),
|
|
188
|
+
class: l([
|
|
179
189
|
"kun-carousel__arrow kun-carousel__arrow--prev",
|
|
180
190
|
"absolute top-1/2 -translate-y-1/2 left-2 z-10",
|
|
181
191
|
"flex items-center justify-center w-9 h-9 rounded-full",
|
|
@@ -185,7 +195,7 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
185
195
|
]),
|
|
186
196
|
"aria-label": e.prevLabel,
|
|
187
197
|
onClick: Z
|
|
188
|
-
}, [K.value ? (
|
|
198
|
+
}, [K.value ? (d(), s("svg", b, [...n[1] ||= [c("path", { d: "m18 15-6-6-6 6" }, null, -1)]])) : (d(), s("svg", {
|
|
189
199
|
key: 0,
|
|
190
200
|
xmlns: "http://www.w3.org/2000/svg",
|
|
191
201
|
viewBox: "0 0 24 24",
|
|
@@ -194,15 +204,15 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
194
204
|
"stroke-width": "2",
|
|
195
205
|
"stroke-linecap": "round",
|
|
196
206
|
"stroke-linejoin": "round",
|
|
197
|
-
class:
|
|
198
|
-
}, [...n[0] ||= [
|
|
207
|
+
class: l(["w-5 h-5", { "rotate-180": q.value }])
|
|
208
|
+
}, [...n[0] ||= [c("path", { d: "m15 18-6-6 6-6" }, null, -1)]], 2))], 10, y)]), h(t.$slots, "next", {
|
|
199
209
|
goToNext: Q,
|
|
200
|
-
disabled: !
|
|
201
|
-
canGoToNext:
|
|
202
|
-
}, () => [
|
|
210
|
+
disabled: !g(B),
|
|
211
|
+
canGoToNext: g(B)
|
|
212
|
+
}, () => [c("button", {
|
|
203
213
|
type: "button",
|
|
204
|
-
disabled: !
|
|
205
|
-
class:
|
|
214
|
+
disabled: !g(B),
|
|
215
|
+
class: l([
|
|
206
216
|
"kun-carousel__arrow kun-carousel__arrow--next",
|
|
207
217
|
"absolute top-1/2 -translate-y-1/2 right-2 z-10",
|
|
208
218
|
"flex items-center justify-center w-9 h-9 rounded-full",
|
|
@@ -212,7 +222,7 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
212
222
|
]),
|
|
213
223
|
"aria-label": e.nextLabel,
|
|
214
224
|
onClick: Q
|
|
215
|
-
}, [K.value ? (
|
|
225
|
+
}, [K.value ? (d(), s("svg", S, [...n[3] ||= [c("path", { d: "m6 9 6 6 6-6" }, null, -1)]])) : (d(), s("svg", {
|
|
216
226
|
key: 0,
|
|
217
227
|
xmlns: "http://www.w3.org/2000/svg",
|
|
218
228
|
viewBox: "0 0 24 24",
|
|
@@ -221,17 +231,17 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
221
231
|
"stroke-width": "2",
|
|
222
232
|
"stroke-linecap": "round",
|
|
223
233
|
"stroke-linejoin": "round",
|
|
224
|
-
class:
|
|
225
|
-
}, [...n[2] ||= [
|
|
226
|
-
k.showArrows && k.arrowsPosition === "bottom" || k.showDots ? (
|
|
227
|
-
k.showArrows && k.arrowsPosition === "bottom" ?
|
|
234
|
+
class: l(["w-5 h-5", { "rotate-180": q.value }])
|
|
235
|
+
}, [...n[2] ||= [c("path", { d: "m9 18 6-6-6-6" }, null, -1)]], 2))], 10, x)])], 64)) : o("", !0),
|
|
236
|
+
k.showArrows && k.arrowsPosition === "bottom" || k.showDots ? (d(), s("div", ee, [
|
|
237
|
+
k.showArrows && k.arrowsPosition === "bottom" ? h(t.$slots, "prev", {
|
|
228
238
|
goToPrev: Z,
|
|
229
|
-
disabled: !
|
|
230
|
-
canGoToPrev:
|
|
231
|
-
}, () => [
|
|
239
|
+
disabled: !g(z),
|
|
240
|
+
canGoToPrev: g(z)
|
|
241
|
+
}, () => [c("button", {
|
|
232
242
|
type: "button",
|
|
233
|
-
disabled: !
|
|
234
|
-
class:
|
|
243
|
+
disabled: !g(z),
|
|
244
|
+
class: l([
|
|
235
245
|
"kun-carousel__arrow kun-carousel__arrow--prev",
|
|
236
246
|
"flex items-center justify-center w-8 h-8 rounded-full",
|
|
237
247
|
"bg-surface-dark text-ui border border-surface cursor-pointer",
|
|
@@ -240,7 +250,7 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
240
250
|
]),
|
|
241
251
|
"aria-label": e.prevLabel,
|
|
242
252
|
onClick: Z
|
|
243
|
-
}, [(
|
|
253
|
+
}, [(d(), s("svg", {
|
|
244
254
|
xmlns: "http://www.w3.org/2000/svg",
|
|
245
255
|
viewBox: "0 0 24 24",
|
|
246
256
|
fill: "none",
|
|
@@ -248,33 +258,33 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
248
258
|
"stroke-width": "2",
|
|
249
259
|
"stroke-linecap": "round",
|
|
250
260
|
"stroke-linejoin": "round",
|
|
251
|
-
class:
|
|
252
|
-
}, [K.value ? (
|
|
253
|
-
k.showDots ?
|
|
254
|
-
snaps:
|
|
255
|
-
selectedIndex:
|
|
261
|
+
class: l(["w-4 h-4", { "rotate-180": q.value && !K.value }])
|
|
262
|
+
}, [K.value ? (d(), s("path", w)) : (d(), s("path", C))], 2))], 10, te)], void 0, 0) : o("", !0),
|
|
263
|
+
k.showDots ? h(t.$slots, "dots", {
|
|
264
|
+
snaps: g(I),
|
|
265
|
+
selectedIndex: g(P),
|
|
256
266
|
goTo: $
|
|
257
|
-
}, () => [
|
|
258
|
-
class:
|
|
267
|
+
}, () => [c("div", {
|
|
268
|
+
class: l(["flex items-center gap-2", k.dotsClass]),
|
|
259
269
|
role: "tablist",
|
|
260
270
|
"aria-label": "Slides"
|
|
261
|
-
}, [(
|
|
271
|
+
}, [(d(!0), s(i, null, m(g(I), (e, t) => (d(), s("button", {
|
|
262
272
|
key: t,
|
|
263
273
|
type: "button",
|
|
264
274
|
role: "tab",
|
|
265
|
-
"aria-selected": t ===
|
|
275
|
+
"aria-selected": t === g(P),
|
|
266
276
|
"aria-label": `Ir al slide ${t + 1}`,
|
|
267
|
-
class:
|
|
277
|
+
class: l(["h-2 rounded-full transition-all cursor-pointer", t === g(P) ? "w-6 bg-primary" : "w-2 bg-surface-light hover:bg-surface"]),
|
|
268
278
|
onClick: (e) => $(t)
|
|
269
|
-
}, null, 10, T))), 128))], 2)], void 0, 1) :
|
|
270
|
-
k.showArrows && k.arrowsPosition === "bottom" ?
|
|
279
|
+
}, null, 10, T))), 128))], 2)], void 0, 1) : o("", !0),
|
|
280
|
+
k.showArrows && k.arrowsPosition === "bottom" ? h(t.$slots, "next", {
|
|
271
281
|
goToNext: Q,
|
|
272
|
-
disabled: !
|
|
273
|
-
canGoToNext:
|
|
274
|
-
}, () => [
|
|
282
|
+
disabled: !g(B),
|
|
283
|
+
canGoToNext: g(B)
|
|
284
|
+
}, () => [c("button", {
|
|
275
285
|
type: "button",
|
|
276
|
-
disabled: !
|
|
277
|
-
class:
|
|
286
|
+
disabled: !g(B),
|
|
287
|
+
class: l([
|
|
278
288
|
"kun-carousel__arrow kun-carousel__arrow--next",
|
|
279
289
|
"flex items-center justify-center w-8 h-8 rounded-full",
|
|
280
290
|
"bg-surface-dark text-ui border border-surface cursor-pointer",
|
|
@@ -283,7 +293,7 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
283
293
|
]),
|
|
284
294
|
"aria-label": e.nextLabel,
|
|
285
295
|
onClick: Q
|
|
286
|
-
}, [(
|
|
296
|
+
}, [(d(), s("svg", {
|
|
287
297
|
xmlns: "http://www.w3.org/2000/svg",
|
|
288
298
|
viewBox: "0 0 24 24",
|
|
289
299
|
fill: "none",
|
|
@@ -291,11 +301,11 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
|
|
|
291
301
|
"stroke-width": "2",
|
|
292
302
|
"stroke-linecap": "round",
|
|
293
303
|
"stroke-linejoin": "round",
|
|
294
|
-
class:
|
|
295
|
-
}, [K.value ? (
|
|
296
|
-
])) :
|
|
304
|
+
class: l(["w-4 h-4", { "rotate-180": q.value && !K.value }])
|
|
305
|
+
}, [K.value ? (d(), s("path", O)) : (d(), s("path", D))], 2))], 10, E)], void 0, 2) : o("", !0)
|
|
306
|
+
])) : o("", !0)
|
|
297
307
|
], 2));
|
|
298
308
|
}
|
|
299
309
|
};
|
|
300
310
|
//#endregion
|
|
301
|
-
export {
|
|
311
|
+
export { _ as KunCarousel_exports, k as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { inject as e } from "vue";
|
|
2
|
+
//#region src/components/KunCarousel/src/composables/kunCarouselContext.js
|
|
3
|
+
var t = Symbol("kun-carousel");
|
|
4
|
+
function n() {
|
|
5
|
+
return e(t, null);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as KUN_CAROUSEL_KEY, n as default, n as useKunCarousel };
|