@bobbykim/mcl-carousel 0.7.2 → 0.8.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/index.d.ts +59 -95
- package/dist/mcl-carousel.js +66 -66
- package/dist/mcl-carousel.umd.cjs +1 -1
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,106 +1,52 @@
|
|
|
1
1
|
import { BodyText } from '@bobbykim/manguito-theme';
|
|
2
2
|
import { ColorPalette } from '@bobbykim/manguito-theme';
|
|
3
3
|
import { ComponentOptionsMixin } from 'vue';
|
|
4
|
+
import { ComponentProvideOptions } from 'vue';
|
|
4
5
|
import { ComponentPublicInstance } from 'vue';
|
|
5
6
|
import { DefineComponent } from 'vue';
|
|
6
|
-
import { ExtractPropTypes } from 'vue';
|
|
7
7
|
import { HeadingSize } from '@bobbykim/manguito-theme';
|
|
8
|
-
import { PropType } from 'vue';
|
|
9
8
|
import { PublicProps } from 'vue';
|
|
10
9
|
import { SpacingLevel } from '@bobbykim/manguito-theme';
|
|
11
10
|
|
|
12
|
-
declare
|
|
13
|
-
|
|
14
|
-
declare type __VLS_Prettify<T> = {
|
|
15
|
-
[K in keyof T]: T[K];
|
|
16
|
-
} & {};
|
|
17
|
-
|
|
18
|
-
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
19
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
20
|
-
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
21
|
-
} : {
|
|
22
|
-
type: PropType<T[K]>;
|
|
23
|
-
required: true;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
declare type __VLS_WithDefaults<P, D> = {
|
|
28
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
29
|
-
default: D[K];
|
|
30
|
-
}> : P[K];
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
34
|
-
new (): {
|
|
35
|
-
$slots: S;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export declare const MclCarouselA: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
11
|
+
declare const __VLS_component: DefineComponent< {
|
|
40
12
|
title: string;
|
|
41
|
-
titleSize?: HeadingSize
|
|
42
|
-
titleColor?: ColorPalette
|
|
43
|
-
bgColor?: ColorPalette
|
|
44
|
-
displayTagLine?: boolean
|
|
45
|
-
tagLineUpperCase?: boolean
|
|
46
|
-
tagLine?: string
|
|
47
|
-
tagLineSize?: BodyText
|
|
48
|
-
tagLineColor?: ColorPalette
|
|
49
|
-
displayHighlight?: boolean
|
|
50
|
-
highlightColor?: ColorPalette
|
|
51
|
-
btnColor?: ColorPalette
|
|
52
|
-
btnBgColor?: ColorPalette
|
|
13
|
+
titleSize?: HeadingSize;
|
|
14
|
+
titleColor?: ColorPalette;
|
|
15
|
+
bgColor?: ColorPalette;
|
|
16
|
+
displayTagLine?: boolean;
|
|
17
|
+
tagLineUpperCase?: boolean;
|
|
18
|
+
tagLine?: string;
|
|
19
|
+
tagLineSize?: BodyText;
|
|
20
|
+
tagLineColor?: ColorPalette;
|
|
21
|
+
displayHighlight?: boolean;
|
|
22
|
+
highlightColor?: ColorPalette;
|
|
23
|
+
btnColor?: ColorPalette;
|
|
24
|
+
btnBgColor?: ColorPalette;
|
|
53
25
|
content: any[];
|
|
54
|
-
cardsGap?: SpacingLevel
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
displayTagLine: boolean;
|
|
60
|
-
tagLineUpperCase: boolean;
|
|
61
|
-
tagLineSize: string;
|
|
62
|
-
tagLineColor: string;
|
|
63
|
-
displayHighlight: boolean;
|
|
64
|
-
highlightColor: string;
|
|
65
|
-
btnColor: string;
|
|
66
|
-
btnBgColor: string;
|
|
67
|
-
cardsGap: string;
|
|
68
|
-
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
69
|
-
"btn-prev": (event: Event) => void;
|
|
70
|
-
"btn-next": (event: Event) => void;
|
|
71
|
-
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
26
|
+
cardsGap?: SpacingLevel;
|
|
27
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
28
|
+
"btn-prev": (event: Event) => any;
|
|
29
|
+
"btn-next": (event: Event) => any;
|
|
30
|
+
}, string, PublicProps, Readonly<{
|
|
72
31
|
title: string;
|
|
73
|
-
titleSize?: HeadingSize
|
|
74
|
-
titleColor?: ColorPalette
|
|
75
|
-
bgColor?: ColorPalette
|
|
76
|
-
displayTagLine?: boolean
|
|
77
|
-
tagLineUpperCase?: boolean
|
|
78
|
-
tagLine?: string
|
|
79
|
-
tagLineSize?: BodyText
|
|
80
|
-
tagLineColor?: ColorPalette
|
|
81
|
-
displayHighlight?: boolean
|
|
82
|
-
highlightColor?: ColorPalette
|
|
83
|
-
btnColor?: ColorPalette
|
|
84
|
-
btnBgColor?: ColorPalette
|
|
32
|
+
titleSize?: HeadingSize;
|
|
33
|
+
titleColor?: ColorPalette;
|
|
34
|
+
bgColor?: ColorPalette;
|
|
35
|
+
displayTagLine?: boolean;
|
|
36
|
+
tagLineUpperCase?: boolean;
|
|
37
|
+
tagLine?: string;
|
|
38
|
+
tagLineSize?: BodyText;
|
|
39
|
+
tagLineColor?: ColorPalette;
|
|
40
|
+
displayHighlight?: boolean;
|
|
41
|
+
highlightColor?: ColorPalette;
|
|
42
|
+
btnColor?: ColorPalette;
|
|
43
|
+
btnBgColor?: ColorPalette;
|
|
85
44
|
content: any[];
|
|
86
|
-
cardsGap?: SpacingLevel
|
|
87
|
-
}
|
|
88
|
-
titleSize: string;
|
|
89
|
-
titleColor: string;
|
|
90
|
-
bgColor: string;
|
|
91
|
-
displayTagLine: boolean;
|
|
92
|
-
tagLineUpperCase: boolean;
|
|
93
|
-
tagLineSize: string;
|
|
94
|
-
tagLineColor: string;
|
|
95
|
-
displayHighlight: boolean;
|
|
96
|
-
highlightColor: string;
|
|
97
|
-
btnColor: string;
|
|
98
|
-
btnBgColor: string;
|
|
99
|
-
cardsGap: string;
|
|
100
|
-
}>>> & {
|
|
45
|
+
cardsGap?: SpacingLevel;
|
|
46
|
+
}> & Readonly<{
|
|
101
47
|
"onBtn-prev"?: ((event: Event) => any) | undefined;
|
|
102
48
|
"onBtn-next"?: ((event: Event) => any) | undefined;
|
|
103
|
-
}
|
|
49
|
+
}>, {
|
|
104
50
|
titleSize: HeadingSize;
|
|
105
51
|
titleColor: ColorPalette;
|
|
106
52
|
bgColor: ColorPalette;
|
|
@@ -113,12 +59,30 @@ highlightColor: ColorPalette;
|
|
|
113
59
|
btnColor: ColorPalette;
|
|
114
60
|
btnBgColor: ColorPalette;
|
|
115
61
|
cardsGap: SpacingLevel;
|
|
116
|
-
}, {}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
62
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
63
|
+
|
|
64
|
+
declare function __VLS_template(): {
|
|
65
|
+
slots: {
|
|
66
|
+
description?(_: {}): any;
|
|
67
|
+
carousel?(_: {
|
|
68
|
+
cards: any[];
|
|
69
|
+
setRef: (el: ComponentPublicInstance | Element | null) => void;
|
|
70
|
+
}): any;
|
|
71
|
+
};
|
|
72
|
+
refs: {
|
|
73
|
+
slideContainer: HTMLDivElement;
|
|
74
|
+
};
|
|
75
|
+
attrs: Partial<{}>;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
79
|
+
|
|
80
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
81
|
+
new (): {
|
|
82
|
+
$slots: S;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export declare const MclCarouselA: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
123
87
|
|
|
124
88
|
export { }
|
package/dist/mcl-carousel.js
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as G, ref as o, onMounted as S, openBlock as p, createElementBlock as f, normalizeClass as r, unref as g, createElementVNode as s, createCommentVNode as x, renderSlot as y } from "vue";
|
|
2
2
|
import n from "@bobbykim/manguito-theme";
|
|
3
|
-
import { useEventListener as L, useIntersectionObserver as
|
|
4
|
-
const
|
|
5
|
-
class: "w-xs h-xs",
|
|
6
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
-
viewBox: "0 0 384 512",
|
|
8
|
-
fill: "currentColor"
|
|
9
|
-
}, [
|
|
10
|
-
/* @__PURE__ */ t("path", { d: "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 278.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z" })
|
|
11
|
-
], -1), P = [
|
|
12
|
-
V
|
|
13
|
-
], W = ["disabled"], Y = /* @__PURE__ */ t("svg", {
|
|
14
|
-
class: "w-xs h-xs",
|
|
15
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
16
|
-
viewBox: "0 0 384 512",
|
|
17
|
-
fill: "currentColor"
|
|
18
|
-
}, [
|
|
19
|
-
/* @__PURE__ */ t("path", { d: "M342.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L274.7 256 105.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z" })
|
|
20
|
-
], -1), q = [
|
|
21
|
-
Y
|
|
22
|
-
], F = { class: "container mt-md sm:mt-lg lg:mt-xl" }, Z = /* @__PURE__ */ A({
|
|
3
|
+
import { useEventListener as L, useIntersectionObserver as z } from "@vueuse/core";
|
|
4
|
+
const H = { class: "container px-xs sm:px-md text-center sm:text-left" }, j = { class: "relative" }, X = { class: "relative" }, $ = ["innerHTML"], I = ["innerHTML"], N = { class: "relative flex flex-wrap sm:flex-nowrap justify-center sm:justify-start items-center space-x-4 space-y-4" }, D = { class: "max-w-xl" }, U = { class: "flex space-x-4" }, V = ["disabled"], _ = ["disabled"], P = { class: "container mt-md sm:mt-lg lg:mt-xl" }, F = /* @__PURE__ */ G({
|
|
23
5
|
__name: "MclCarouselA",
|
|
24
6
|
props: {
|
|
25
7
|
title: {},
|
|
@@ -40,7 +22,7 @@ const z = { class: "container px-xs sm:px-md text-center sm:text-left" }, H = {
|
|
|
40
22
|
},
|
|
41
23
|
emits: ["btn-prev", "btn-next"],
|
|
42
24
|
setup(w, { emit: B }) {
|
|
43
|
-
const T = w,
|
|
25
|
+
const T = w, a = o(null), i = o([]), v = o(), m = B, d = o(0), c = o(!1);
|
|
44
26
|
let u = !1;
|
|
45
27
|
const O = (e) => {
|
|
46
28
|
switch (e) {
|
|
@@ -67,84 +49,102 @@ const z = { class: "container px-xs sm:px-md text-center sm:text-left" }, H = {
|
|
|
67
49
|
}
|
|
68
50
|
}, k = (e) => {
|
|
69
51
|
i.value.push(e);
|
|
70
|
-
},
|
|
52
|
+
}, h = (e, t) => {
|
|
71
53
|
var l;
|
|
72
|
-
u || (u = !0,
|
|
73
|
-
},
|
|
54
|
+
u || (u = !0, t === "prev" && (d.value--, m("btn-prev", e)), t === "next" && (d.value++, m("btn-next", e)), (l = a.value) == null || l.dispatchEvent(new Event("sliderMove")));
|
|
55
|
+
}, M = (e, t) => [
|
|
74
56
|
n("H2", e),
|
|
75
|
-
n("TEXTCOLOR",
|
|
76
|
-
].join(" "),
|
|
57
|
+
n("TEXTCOLOR", t)
|
|
58
|
+
].join(" "), E = (e, t, l) => {
|
|
77
59
|
const b = [
|
|
78
60
|
n("BODYTEXT", e),
|
|
79
|
-
n("TEXTCOLOR",
|
|
61
|
+
n("TEXTCOLOR", t)
|
|
80
62
|
];
|
|
81
63
|
return l && b.push("uppercase"), b.join(" ");
|
|
82
|
-
}, C = (e,
|
|
64
|
+
}, C = (e, t) => [
|
|
83
65
|
n("TEXTCOLOR", e),
|
|
84
|
-
n("BGCOLOR",
|
|
85
|
-
n("RINGCOLOR",
|
|
86
|
-
].join(" "),
|
|
87
|
-
|
|
88
|
-
},
|
|
66
|
+
n("BGCOLOR", t),
|
|
67
|
+
n("RINGCOLOR", t)
|
|
68
|
+
].join(" "), R = () => {
|
|
69
|
+
a.value.style.transform = `translateX(-${d.value * (i.value[0].$el.clientWidth + O(T.cardsGap) + 2)}px)`, c.value = !1;
|
|
70
|
+
}, A = () => {
|
|
89
71
|
u = !1;
|
|
90
72
|
};
|
|
91
|
-
return L(
|
|
92
|
-
|
|
73
|
+
return L(a, "sliderMove", R), L(a, "transitionend", A), z(
|
|
74
|
+
v,
|
|
93
75
|
(e) => {
|
|
94
76
|
e[0].isIntersecting && (c.value = !0);
|
|
95
77
|
},
|
|
96
78
|
{ threshold: 0.75 }
|
|
97
|
-
),
|
|
98
|
-
|
|
99
|
-
}), (e,
|
|
100
|
-
class:
|
|
79
|
+
), S(() => {
|
|
80
|
+
v.value = i.value[i.value.length - 1].$el;
|
|
81
|
+
}), (e, t) => (p(), f("section", {
|
|
82
|
+
class: r(["py-lg lg:py-xl overflow-hidden", g(n)("BGCOLOR", e.bgColor)])
|
|
101
83
|
}, [
|
|
102
|
-
|
|
103
|
-
|
|
84
|
+
s("div", H, [
|
|
85
|
+
s("div", j, [
|
|
104
86
|
e.displayHighlight ? (p(), f("div", {
|
|
105
87
|
key: 0,
|
|
106
|
-
class:
|
|
88
|
+
class: r(["hidden sm:block absolute w-md bg-opacity-25 -left-4 h-full", g(n)("BGCOLOR", e.highlightColor)])
|
|
107
89
|
}, null, 2)) : x("", !0),
|
|
108
|
-
|
|
90
|
+
s("div", X, [
|
|
109
91
|
e.displayTagLine ? (p(), f("span", {
|
|
110
92
|
key: 0,
|
|
111
|
-
class:
|
|
93
|
+
class: r([
|
|
112
94
|
"tracking-widest",
|
|
113
|
-
|
|
95
|
+
E(e.tagLineSize, e.tagLineColor, e.tagLineUpperCase)
|
|
114
96
|
]),
|
|
115
97
|
innerHTML: e.tagLine
|
|
116
|
-
}, null, 10,
|
|
117
|
-
|
|
118
|
-
class:
|
|
98
|
+
}, null, 10, $)) : x("", !0),
|
|
99
|
+
s("h2", {
|
|
100
|
+
class: r(["tracking-wide", M(e.titleSize, e.titleColor)]),
|
|
119
101
|
innerHTML: e.title
|
|
120
|
-
}, null, 10,
|
|
102
|
+
}, null, 10, I)
|
|
121
103
|
]),
|
|
122
|
-
|
|
123
|
-
|
|
104
|
+
s("div", N, [
|
|
105
|
+
s("div", D, [
|
|
124
106
|
y(e.$slots, "description")
|
|
125
107
|
]),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
class:
|
|
108
|
+
s("div", U, [
|
|
109
|
+
s("button", {
|
|
110
|
+
class: r(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200", C(e.btnColor, e.btnBgColor)]),
|
|
129
111
|
disabled: d.value === 0,
|
|
130
|
-
onClick:
|
|
112
|
+
onClick: t[0] || (t[0] = (l) => h(l, "prev")),
|
|
131
113
|
"aria-label": "previous"
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
114
|
+
}, t[2] || (t[2] = [
|
|
115
|
+
s("svg", {
|
|
116
|
+
class: "w-xs h-xs",
|
|
117
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
118
|
+
viewBox: "0 0 384 512",
|
|
119
|
+
fill: "currentColor"
|
|
120
|
+
}, [
|
|
121
|
+
s("path", { d: "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 278.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z" })
|
|
122
|
+
], -1)
|
|
123
|
+
]), 10, V),
|
|
124
|
+
s("button", {
|
|
125
|
+
class: r(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200", C(e.btnColor, e.btnBgColor)]),
|
|
135
126
|
disabled: c.value,
|
|
136
|
-
onClick:
|
|
127
|
+
onClick: t[1] || (t[1] = (l) => h(l, "next")),
|
|
137
128
|
"aria-label": "next"
|
|
138
|
-
},
|
|
129
|
+
}, t[3] || (t[3] = [
|
|
130
|
+
s("svg", {
|
|
131
|
+
class: "w-xs h-xs",
|
|
132
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
133
|
+
viewBox: "0 0 384 512",
|
|
134
|
+
fill: "currentColor"
|
|
135
|
+
}, [
|
|
136
|
+
s("path", { d: "M342.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L274.7 256 105.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z" })
|
|
137
|
+
], -1)
|
|
138
|
+
]), 10, _)
|
|
139
139
|
])
|
|
140
140
|
])
|
|
141
141
|
])
|
|
142
142
|
]),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
class:
|
|
143
|
+
s("div", P, [
|
|
144
|
+
s("div", {
|
|
145
|
+
class: r(["flex transition-transform duration-500 px-xs gap-xs", g(n)("GAP", e.cardsGap)]),
|
|
146
146
|
ref_key: "slideContainer",
|
|
147
|
-
ref:
|
|
147
|
+
ref: a
|
|
148
148
|
}, [
|
|
149
149
|
y(e.$slots, "carousel", {
|
|
150
150
|
cards: e.content,
|
|
@@ -156,5 +156,5 @@ const z = { class: "container px-xs sm:px-md text-center sm:text-left" }, H = {
|
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
export {
|
|
159
|
-
|
|
159
|
+
F as MclCarouselA
|
|
160
160
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@bobbykim/manguito-theme"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme","@vueuse/core"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.MclCarousel={},o.Vue,o.ManguitoTheme,o.core))})(this,function(o,e,
|
|
1
|
+
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@bobbykim/manguito-theme"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme","@vueuse/core"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.MclCarousel={},o.Vue,o.ManguitoTheme,o.core))})(this,function(o,e,s,d){"use strict";const C={class:"container px-xs sm:px-md text-center sm:text-left"},b={class:"relative"},y={class:"relative"},x=["innerHTML"],E=["innerHTML"],L={class:"relative flex flex-wrap sm:flex-nowrap justify-center sm:justify-start items-center space-x-4 space-y-4"},w={class:"max-w-xl"},B={class:"flex space-x-4"},T=["disabled"],k=["disabled"],N={class:"container mt-md sm:mt-lg lg:mt-xl"},V=e.defineComponent({__name:"MclCarouselA",props:{title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},bgColor:{default:"light-1"},displayTagLine:{type:Boolean,default:!0},tagLineUpperCase:{type:Boolean,default:!0},tagLine:{},tagLineSize:{default:"md"},tagLineColor:{default:"dark-1"},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},btnColor:{default:"dark-3"},btnBgColor:{default:"light-4"},content:{},cardsGap:{default:"xs"}},emits:["btn-prev","btn-next"],setup(O,{emit:M}){const z=O,r=e.ref(null),i=e.ref([]),u=e.ref(),m=M,a=e.ref(0),c=e.ref(!1);let f=!1;const v=t=>{switch(t){case"0":return 0;case"3xs":return 4;case"2xs":return 8;case"xs":return 16;case"sm":return 24;case"md":return 32;case"lg":return 48;case"xl":return 64;case"2xl":return 96;case"3xl":return 128}},S=t=>{i.value.push(t)},p=(t,n)=>{var l;f||(f=!0,n==="prev"&&(a.value--,m("btn-prev",t)),n==="next"&&(a.value++,m("btn-next",t)),(l=r.value)==null||l.dispatchEvent(new Event("sliderMove")))},R=(t,n)=>[s("H2",t),s("TEXTCOLOR",n)].join(" "),A=(t,n,l)=>{const h=[s("BODYTEXT",t),s("TEXTCOLOR",n)];return l&&h.push("uppercase"),h.join(" ")},g=(t,n)=>[s("TEXTCOLOR",t),s("BGCOLOR",n),s("RINGCOLOR",n)].join(" "),G=()=>{r.value.style.transform=`translateX(-${a.value*(i.value[0].$el.clientWidth+v(z.cardsGap)+2)}px)`,c.value=!1},j=()=>{f=!1};return d.useEventListener(r,"sliderMove",G),d.useEventListener(r,"transitionend",j),d.useIntersectionObserver(u,t=>{t[0].isIntersecting&&(c.value=!0)},{threshold:.75}),e.onMounted(()=>{u.value=i.value[i.value.length-1].$el}),(t,n)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["py-lg lg:py-xl overflow-hidden",e.unref(s)("BGCOLOR",t.bgColor)])},[e.createElementVNode("div",C,[e.createElementVNode("div",b,[t.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["hidden sm:block absolute w-md bg-opacity-25 -left-4 h-full",e.unref(s)("BGCOLOR",t.highlightColor)])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",y,[t.displayTagLine?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["tracking-widest",A(t.tagLineSize,t.tagLineColor,t.tagLineUpperCase)]),innerHTML:t.tagLine},null,10,x)):e.createCommentVNode("",!0),e.createElementVNode("h2",{class:e.normalizeClass(["tracking-wide",R(t.titleSize,t.titleColor)]),innerHTML:t.title},null,10,E)]),e.createElementVNode("div",L,[e.createElementVNode("div",w,[e.renderSlot(t.$slots,"description")]),e.createElementVNode("div",B,[e.createElementVNode("button",{class:e.normalizeClass(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200",g(t.btnColor,t.btnBgColor)]),disabled:a.value===0,onClick:n[0]||(n[0]=l=>p(l,"prev")),"aria-label":"previous"},n[2]||(n[2]=[e.createElementVNode("svg",{class:"w-xs h-xs",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor"},[e.createElementVNode("path",{d:"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 278.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})],-1)]),10,T),e.createElementVNode("button",{class:e.normalizeClass(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200",g(t.btnColor,t.btnBgColor)]),disabled:c.value,onClick:n[1]||(n[1]=l=>p(l,"next")),"aria-label":"next"},n[3]||(n[3]=[e.createElementVNode("svg",{class:"w-xs h-xs",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor"},[e.createElementVNode("path",{d:"M342.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L274.7 256 105.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})],-1)]),10,k)])])])]),e.createElementVNode("div",N,[e.createElementVNode("div",{class:e.normalizeClass(["flex transition-transform duration-500 px-xs gap-xs",e.unref(s)("GAP",t.cardsGap)]),ref_key:"slideContainer",ref:r},[e.renderSlot(t.$slots,"carousel",{cards:t.content,setRef:S})],2)])],2))}});o.MclCarouselA=V,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/mcl-carousel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "carousel component based on @bobbykim/manguito-theme",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@bobbykim/manguito-theme": "0.
|
|
37
|
-
"@vueuse/core": "^
|
|
38
|
-
"vue": "^3.
|
|
36
|
+
"@bobbykim/manguito-theme": "0.23.0",
|
|
37
|
+
"@vueuse/core": "^12.0.0",
|
|
38
|
+
"vue": "^3.5.13"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@vitejs/plugin-vue": "^
|
|
42
|
-
"typescript": "^5.
|
|
43
|
-
"vite": "^
|
|
44
|
-
"vite-plugin-css-injected-by-js": "^3.5.
|
|
45
|
-
"vite-plugin-dts": "^3.
|
|
46
|
-
"vue-tsc": "^1.
|
|
41
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
42
|
+
"typescript": "^5.7.2",
|
|
43
|
+
"vite": "^6.0.3",
|
|
44
|
+
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
45
|
+
"vite-plugin-dts": "^4.3.0",
|
|
46
|
+
"vue-tsc": "^2.1.10"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "0c86a1a70a33446112dafbaf5fce5fdcb5fdf755"
|
|
49
49
|
}
|