@bobbykim/mcl-collapse 0.6.0 → 0.7.1
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 +206 -0
- package/dist/mcl-collapse.js +193 -0
- package/dist/mcl-collapse.umd.cjs +1 -0
- package/package.json +27 -6
- package/CHANGELOG.md +0 -61
- package/index.d.ts +0 -3
- package/index.js +0 -3
- package/index.ts +0 -4
- package/lib/mcl-collapse-a/MclCollapseA.vue +0 -163
- package/lib/mcl-collapse-a/MclCollapseA.vue.d.ts +0 -98
- package/lib/mcl-collapse-b/MclCollapseB.vue +0 -149
- package/lib/mcl-collapse-b/MclCollapseB.vue.d.ts +0 -91
- package/tsconfig.json +0 -5
- package/tsconfig.ts.json +0 -9
- package/tsconfig.vue.json +0 -9
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { ColorPalette } from '@bobbykim/manguito-theme';
|
|
2
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
3
|
+
import { DefineComponent } from 'vue';
|
|
4
|
+
import { ExtractPropTypes } from 'vue';
|
|
5
|
+
import { HeadingSize } from '@bobbykim/manguito-theme';
|
|
6
|
+
import { PropType } from 'vue';
|
|
7
|
+
import { PublicProps } from 'vue';
|
|
8
|
+
|
|
9
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
10
|
+
|
|
11
|
+
declare type __VLS_NonUndefinedable_2<T> = T extends undefined ? never : T;
|
|
12
|
+
|
|
13
|
+
declare type __VLS_Prettify<T> = {
|
|
14
|
+
[K in keyof T]: T[K];
|
|
15
|
+
} & {};
|
|
16
|
+
|
|
17
|
+
declare type __VLS_Prettify_2<T> = {
|
|
18
|
+
[K in keyof T]: T[K];
|
|
19
|
+
} & {};
|
|
20
|
+
|
|
21
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
22
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
+
} : {
|
|
25
|
+
type: PropType<T[K]>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
declare type __VLS_TypePropsToRuntimeProps_2<T> = {
|
|
31
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
32
|
+
type: PropType<__VLS_NonUndefinedable_2<T[K]>>;
|
|
33
|
+
} : {
|
|
34
|
+
type: PropType<T[K]>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
40
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
41
|
+
default: D[K];
|
|
42
|
+
}> : P[K];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
declare type __VLS_WithDefaults_2<P, D> = {
|
|
46
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify_2<P[K] & {
|
|
47
|
+
default: D[K];
|
|
48
|
+
}> : P[K];
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
52
|
+
new (): {
|
|
53
|
+
$slots: S;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
|
|
58
|
+
new (): {
|
|
59
|
+
$slots: S;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export declare const MclCollapseA: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
64
|
+
collapseId: string;
|
|
65
|
+
borderColor?: ColorPalette | undefined;
|
|
66
|
+
rounded?: boolean | undefined;
|
|
67
|
+
displayHighlight?: boolean | undefined;
|
|
68
|
+
highlightColor?: ColorPalette | undefined;
|
|
69
|
+
title: string;
|
|
70
|
+
titleSize?: HeadingSize | undefined;
|
|
71
|
+
titleColor?: ColorPalette | undefined;
|
|
72
|
+
visible?: boolean | undefined;
|
|
73
|
+
iconColor?: ColorPalette | undefined;
|
|
74
|
+
bgColor?: ColorPalette | undefined;
|
|
75
|
+
slotBgColor?: ColorPalette | undefined;
|
|
76
|
+
accordion?: string | undefined;
|
|
77
|
+
}>, {
|
|
78
|
+
borderColor: string;
|
|
79
|
+
rounded: boolean;
|
|
80
|
+
displayHighlight: boolean;
|
|
81
|
+
highlightColor: string;
|
|
82
|
+
titleSize: string;
|
|
83
|
+
titleColor: string;
|
|
84
|
+
visible: boolean;
|
|
85
|
+
iconColor: string;
|
|
86
|
+
bgColor: string;
|
|
87
|
+
slotBgColor: string;
|
|
88
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
89
|
+
"collapse-open": (visible: boolean, title: string) => void;
|
|
90
|
+
"collapse-close": (visible: boolean, title: string) => void;
|
|
91
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
92
|
+
collapseId: string;
|
|
93
|
+
borderColor?: ColorPalette | undefined;
|
|
94
|
+
rounded?: boolean | undefined;
|
|
95
|
+
displayHighlight?: boolean | undefined;
|
|
96
|
+
highlightColor?: ColorPalette | undefined;
|
|
97
|
+
title: string;
|
|
98
|
+
titleSize?: HeadingSize | undefined;
|
|
99
|
+
titleColor?: ColorPalette | undefined;
|
|
100
|
+
visible?: boolean | undefined;
|
|
101
|
+
iconColor?: ColorPalette | undefined;
|
|
102
|
+
bgColor?: ColorPalette | undefined;
|
|
103
|
+
slotBgColor?: ColorPalette | undefined;
|
|
104
|
+
accordion?: string | undefined;
|
|
105
|
+
}>, {
|
|
106
|
+
borderColor: string;
|
|
107
|
+
rounded: boolean;
|
|
108
|
+
displayHighlight: boolean;
|
|
109
|
+
highlightColor: string;
|
|
110
|
+
titleSize: string;
|
|
111
|
+
titleColor: string;
|
|
112
|
+
visible: boolean;
|
|
113
|
+
iconColor: string;
|
|
114
|
+
bgColor: string;
|
|
115
|
+
slotBgColor: string;
|
|
116
|
+
}>>> & {
|
|
117
|
+
"onCollapse-open"?: ((visible: boolean, title: string) => any) | undefined;
|
|
118
|
+
"onCollapse-close"?: ((visible: boolean, title: string) => any) | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
borderColor: ColorPalette;
|
|
121
|
+
rounded: boolean;
|
|
122
|
+
displayHighlight: boolean;
|
|
123
|
+
highlightColor: ColorPalette;
|
|
124
|
+
titleSize: HeadingSize;
|
|
125
|
+
titleColor: ColorPalette;
|
|
126
|
+
visible: boolean;
|
|
127
|
+
iconColor: ColorPalette;
|
|
128
|
+
bgColor: ColorPalette;
|
|
129
|
+
slotBgColor: ColorPalette;
|
|
130
|
+
}, {}>, Readonly<{
|
|
131
|
+
content: any;
|
|
132
|
+
tab: any;
|
|
133
|
+
}> & {
|
|
134
|
+
content: any;
|
|
135
|
+
tab: any;
|
|
136
|
+
}>;
|
|
137
|
+
|
|
138
|
+
export declare const MclCollapseB: __VLS_WithTemplateSlots_2<DefineComponent<__VLS_WithDefaults_2<__VLS_TypePropsToRuntimeProps_2<{
|
|
139
|
+
collapseId: string;
|
|
140
|
+
title: string;
|
|
141
|
+
titleColor?: ColorPalette | undefined;
|
|
142
|
+
titleSize?: HeadingSize | undefined;
|
|
143
|
+
borderColor?: ColorPalette | undefined;
|
|
144
|
+
bgColor?: ColorPalette | undefined;
|
|
145
|
+
btnColor?: ColorPalette | undefined;
|
|
146
|
+
iconColor?: ColorPalette | undefined;
|
|
147
|
+
rounded?: boolean | undefined;
|
|
148
|
+
displayShadow?: boolean | undefined;
|
|
149
|
+
visible?: boolean | undefined;
|
|
150
|
+
accordion?: string | undefined;
|
|
151
|
+
}>, {
|
|
152
|
+
titleColor: string;
|
|
153
|
+
titleSize: string;
|
|
154
|
+
borderColor: string;
|
|
155
|
+
bgColor: string;
|
|
156
|
+
btnColor: string;
|
|
157
|
+
iconColor: string;
|
|
158
|
+
rounded: boolean;
|
|
159
|
+
displayShadow: boolean;
|
|
160
|
+
visible: boolean;
|
|
161
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
162
|
+
"collapse-open": (visible: boolean, title: string) => void;
|
|
163
|
+
"collapse-close": (visible: boolean, title: string) => void;
|
|
164
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_2<__VLS_TypePropsToRuntimeProps_2<{
|
|
165
|
+
collapseId: string;
|
|
166
|
+
title: string;
|
|
167
|
+
titleColor?: ColorPalette | undefined;
|
|
168
|
+
titleSize?: HeadingSize | undefined;
|
|
169
|
+
borderColor?: ColorPalette | undefined;
|
|
170
|
+
bgColor?: ColorPalette | undefined;
|
|
171
|
+
btnColor?: ColorPalette | undefined;
|
|
172
|
+
iconColor?: ColorPalette | undefined;
|
|
173
|
+
rounded?: boolean | undefined;
|
|
174
|
+
displayShadow?: boolean | undefined;
|
|
175
|
+
visible?: boolean | undefined;
|
|
176
|
+
accordion?: string | undefined;
|
|
177
|
+
}>, {
|
|
178
|
+
titleColor: string;
|
|
179
|
+
titleSize: string;
|
|
180
|
+
borderColor: string;
|
|
181
|
+
bgColor: string;
|
|
182
|
+
btnColor: string;
|
|
183
|
+
iconColor: string;
|
|
184
|
+
rounded: boolean;
|
|
185
|
+
displayShadow: boolean;
|
|
186
|
+
visible: boolean;
|
|
187
|
+
}>>> & {
|
|
188
|
+
"onCollapse-open"?: ((visible: boolean, title: string) => any) | undefined;
|
|
189
|
+
"onCollapse-close"?: ((visible: boolean, title: string) => any) | undefined;
|
|
190
|
+
}, {
|
|
191
|
+
borderColor: ColorPalette;
|
|
192
|
+
rounded: boolean;
|
|
193
|
+
titleSize: HeadingSize;
|
|
194
|
+
titleColor: ColorPalette;
|
|
195
|
+
visible: boolean;
|
|
196
|
+
iconColor: ColorPalette;
|
|
197
|
+
bgColor: ColorPalette;
|
|
198
|
+
btnColor: ColorPalette;
|
|
199
|
+
displayShadow: boolean;
|
|
200
|
+
}, {}>, Readonly<{
|
|
201
|
+
default: any;
|
|
202
|
+
}> & {
|
|
203
|
+
default: any;
|
|
204
|
+
}>;
|
|
205
|
+
|
|
206
|
+
export { }
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { defineComponent as B, ref as O, useSlots as R, watch as L, openBlock as n, createElementBlock as d, normalizeClass as r, withDirectives as b, unref as s, createElementVNode as c, toDisplayString as A, withModifiers as $, renderSlot as y, createCommentVNode as z, createVNode as S, withCtx as E } from "vue";
|
|
2
|
+
import l, { vCollapse as w, Collapse as I } from "@bobbykim/manguito-theme";
|
|
3
|
+
const D = { class: "flex justify-between items-center" }, G = /* @__PURE__ */ c("path", { d: "M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z" }, null, -1), M = [
|
|
4
|
+
G
|
|
5
|
+
], q = /* @__PURE__ */ B({
|
|
6
|
+
__name: "MclCollapseA",
|
|
7
|
+
props: {
|
|
8
|
+
collapseId: {},
|
|
9
|
+
borderColor: { default: "light-4" },
|
|
10
|
+
rounded: { type: Boolean, default: !1 },
|
|
11
|
+
displayHighlight: { type: Boolean, default: !0 },
|
|
12
|
+
highlightColor: { default: "secondary" },
|
|
13
|
+
title: {},
|
|
14
|
+
titleSize: { default: "sm" },
|
|
15
|
+
titleColor: { default: "dark-3" },
|
|
16
|
+
visible: { type: Boolean, default: !1 },
|
|
17
|
+
iconColor: { default: "dark-3" },
|
|
18
|
+
bgColor: { default: "white" },
|
|
19
|
+
slotBgColor: { default: "light-2" },
|
|
20
|
+
accordion: {}
|
|
21
|
+
},
|
|
22
|
+
emits: ["collapse-open", "collapse-close"],
|
|
23
|
+
setup(m, { emit: g }) {
|
|
24
|
+
const u = m, i = O(u.visible), f = R(), p = g, C = (e) => {
|
|
25
|
+
const { title: t } = u;
|
|
26
|
+
i.value = e, p(e === !0 ? "collapse-open" : "collapse-close", e, t);
|
|
27
|
+
}, v = (e, t, h) => {
|
|
28
|
+
const a = ["border", l("BORDER", e)];
|
|
29
|
+
return t && [l("BORDERL", h)].forEach((j) => {
|
|
30
|
+
a.push(j), a.push("border-l-8");
|
|
31
|
+
}), a.join(" ");
|
|
32
|
+
}, o = (e, t) => [
|
|
33
|
+
l("H3", e),
|
|
34
|
+
l("TEXTCOLOR", t)
|
|
35
|
+
].join(" ");
|
|
36
|
+
return L(
|
|
37
|
+
() => u.visible,
|
|
38
|
+
(e) => {
|
|
39
|
+
i.value = e;
|
|
40
|
+
}
|
|
41
|
+
), (e, t) => (n(), d("div", {
|
|
42
|
+
class: r(["overflow-hidden w-full", [
|
|
43
|
+
e.rounded ? "rounded-lg" : "rounded-sm",
|
|
44
|
+
v(e.borderColor, e.displayHighlight, e.highlightColor)
|
|
45
|
+
]])
|
|
46
|
+
}, [
|
|
47
|
+
b((n(), d("div", {
|
|
48
|
+
class: r(["py-xs px-sm cursor-pointer transition-[border] duration-500", [
|
|
49
|
+
i.value ? `border-b ${s(l)("BORDERB", e.borderColor)} ease-in` : "ease-out",
|
|
50
|
+
s(l)("BGCOLOR", e.bgColor)
|
|
51
|
+
]])
|
|
52
|
+
}, [
|
|
53
|
+
c("div", D, [
|
|
54
|
+
c("h3", {
|
|
55
|
+
class: r(o(e.titleSize, e.titleColor))
|
|
56
|
+
}, A(e.title), 3),
|
|
57
|
+
s(f).tab ? (n(), d("div", {
|
|
58
|
+
key: 0,
|
|
59
|
+
onClick: t[0] || (t[0] = $(() => {
|
|
60
|
+
}, ["stop"])),
|
|
61
|
+
class: "cursor-default"
|
|
62
|
+
}, [
|
|
63
|
+
y(e.$slots, "tab")
|
|
64
|
+
])) : z("", !0)
|
|
65
|
+
])
|
|
66
|
+
], 2)), [
|
|
67
|
+
[s(w), void 0, e.collapseId]
|
|
68
|
+
]),
|
|
69
|
+
c("div", {
|
|
70
|
+
class: r(["overflow-hidden", s(l)("BGCOLOR", e.slotBgColor)])
|
|
71
|
+
}, [
|
|
72
|
+
S(s(I), {
|
|
73
|
+
id: e.collapseId,
|
|
74
|
+
visible: e.visible,
|
|
75
|
+
"class-name": "py-sm px-xs",
|
|
76
|
+
onOpen: C,
|
|
77
|
+
onClose: C,
|
|
78
|
+
accordion: e.accordion
|
|
79
|
+
}, {
|
|
80
|
+
default: E(() => [
|
|
81
|
+
y(e.$slots, "content")
|
|
82
|
+
]),
|
|
83
|
+
_: 3
|
|
84
|
+
}, 8, ["id", "visible", "accordion"])
|
|
85
|
+
], 2),
|
|
86
|
+
b((n(), d("div", {
|
|
87
|
+
class: r(["py-1.5 px-sm cursor-pointer transition-all duration-500 flex justify-center items-center border-t", [
|
|
88
|
+
s(l)("BGCOLOR", e.bgColor),
|
|
89
|
+
s(l)("BORDERT", e.borderColor)
|
|
90
|
+
]])
|
|
91
|
+
}, [
|
|
92
|
+
(n(), d("svg", {
|
|
93
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
94
|
+
viewBox: "0 0 448 512",
|
|
95
|
+
class: r(["h-xs", [
|
|
96
|
+
i.value ? "rotate-180" : "rotate-0",
|
|
97
|
+
"transition-transform duration-300 ease-in",
|
|
98
|
+
s(l)("SVGFILL", e.iconColor)
|
|
99
|
+
]])
|
|
100
|
+
}, M, 2))
|
|
101
|
+
], 2)), [
|
|
102
|
+
[s(w), void 0, e.collapseId]
|
|
103
|
+
])
|
|
104
|
+
], 2));
|
|
105
|
+
}
|
|
106
|
+
}), T = { class: "flex justify-center items-center ml-xs md:ml-sm lg:ml-md" }, k = /* @__PURE__ */ c("path", { d: "M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z" }, null, -1), V = [
|
|
107
|
+
k
|
|
108
|
+
], H = { class: "overflow-hidden" }, J = /* @__PURE__ */ B({
|
|
109
|
+
__name: "MclCollapseB",
|
|
110
|
+
props: {
|
|
111
|
+
collapseId: {},
|
|
112
|
+
title: {},
|
|
113
|
+
titleColor: { default: "light-1" },
|
|
114
|
+
titleSize: { default: "md" },
|
|
115
|
+
borderColor: { default: "light-3" },
|
|
116
|
+
bgColor: { default: "light-1" },
|
|
117
|
+
btnColor: { default: "primary" },
|
|
118
|
+
iconColor: { default: "light-1" },
|
|
119
|
+
rounded: { type: Boolean, default: !0 },
|
|
120
|
+
displayShadow: { type: Boolean, default: !0 },
|
|
121
|
+
visible: { type: Boolean, default: !1 },
|
|
122
|
+
accordion: {}
|
|
123
|
+
},
|
|
124
|
+
emits: ["collapse-open", "collapse-close"],
|
|
125
|
+
setup(m, { emit: g }) {
|
|
126
|
+
const u = m;
|
|
127
|
+
R();
|
|
128
|
+
const i = O(u.visible), f = g, p = (o) => {
|
|
129
|
+
const { title: e } = u;
|
|
130
|
+
i.value = o, f(o === !0 ? "collapse-open" : "collapse-close", o, e);
|
|
131
|
+
}, C = (o, e, t, h) => {
|
|
132
|
+
let a = [
|
|
133
|
+
"border",
|
|
134
|
+
l("BORDER", o),
|
|
135
|
+
l("BGCOLOR", e)
|
|
136
|
+
];
|
|
137
|
+
return h && a.push("shadow-md"), t ? a.push("rounded-2xl") : a.push("rounded-sm"), a.join(" ");
|
|
138
|
+
}, v = (o, e) => [
|
|
139
|
+
l("H3", o),
|
|
140
|
+
l("TEXTCOLOR", e)
|
|
141
|
+
].join(" ");
|
|
142
|
+
return L(
|
|
143
|
+
() => u.visible,
|
|
144
|
+
(o) => {
|
|
145
|
+
i.value = o;
|
|
146
|
+
}
|
|
147
|
+
), (o, e) => (n(), d("div", {
|
|
148
|
+
class: r(["w-full overflow-hidden p-2xs", C(o.borderColor, o.bgColor, o.rounded, o.displayShadow)])
|
|
149
|
+
}, [
|
|
150
|
+
b((n(), d("div", {
|
|
151
|
+
class: r(["flex justify-between items-center w-full px-4 py-2 cursor-pointer hover:bg-opacity-70 transition duration-200 ease-in", [
|
|
152
|
+
o.rounded ? "rounded-lg" : "rounded-sm",
|
|
153
|
+
s(l)("BGCOLOR", o.btnColor)
|
|
154
|
+
]])
|
|
155
|
+
}, [
|
|
156
|
+
c("h3", {
|
|
157
|
+
class: r(v(o.titleSize, o.titleColor))
|
|
158
|
+
}, A(o.title), 3),
|
|
159
|
+
c("div", T, [
|
|
160
|
+
(n(), d("svg", {
|
|
161
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
162
|
+
viewBox: "0 0 448 512",
|
|
163
|
+
class: r(["h-xs transition-transform duration-300 ease-in", [
|
|
164
|
+
i.value ? "rotate-180" : "rotate-0",
|
|
165
|
+
s(l)("SVGFILL", o.iconColor)
|
|
166
|
+
]])
|
|
167
|
+
}, V, 2))
|
|
168
|
+
])
|
|
169
|
+
], 2)), [
|
|
170
|
+
[s(w), void 0, o.collapseId]
|
|
171
|
+
]),
|
|
172
|
+
c("div", H, [
|
|
173
|
+
S(s(I), {
|
|
174
|
+
id: o.collapseId,
|
|
175
|
+
visible: o.visible,
|
|
176
|
+
"class-name": "px-xs pt-xs pb-2xs",
|
|
177
|
+
accordion: o.accordion,
|
|
178
|
+
onOpen: p,
|
|
179
|
+
onClose: p
|
|
180
|
+
}, {
|
|
181
|
+
default: E(() => [
|
|
182
|
+
y(o.$slots, "default")
|
|
183
|
+
]),
|
|
184
|
+
_: 3
|
|
185
|
+
}, 8, ["id", "visible", "accordion"])
|
|
186
|
+
])
|
|
187
|
+
], 2));
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
export {
|
|
191
|
+
q as MclCollapseA,
|
|
192
|
+
J as MclCollapseB
|
|
193
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(s,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("@bobbykim/manguito-theme")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme"],o):(s=typeof globalThis<"u"?globalThis:s||self,o(s.MclCollapse={},s.Vue,s.ManguitoTheme))})(this,function(s,o,t){"use strict";const u={class:"flex justify-between items-center"},b=[o.createElementVNode("path",{d:"M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"},null,-1)],B=o.defineComponent({__name:"MclCollapseA",props:{collapseId:{},borderColor:{default:"light-4"},rounded:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"secondary"},title:{},titleSize:{default:"sm"},titleColor:{default:"dark-3"},visible:{type:Boolean,default:!1},iconColor:{default:"dark-3"},bgColor:{default:"white"},slotBgColor:{default:"light-2"},accordion:{}},emits:["collapse-open","collapse-close"],setup(m,{emit:h}){const d=m,i=o.ref(d.visible),c=o.useSlots(),a=h,p=e=>{const{title:r}=d;i.value=e,a(e===!0?"collapse-open":"collapse-close",e,r)},C=(e,r,f)=>{const n=["border",t("BORDER",e)];return r&&[t("BORDERL",f)].forEach(k=>{n.push(k),n.push("border-l-8")}),n.join(" ")},l=(e,r)=>[t("H3",e),t("TEXTCOLOR",r)].join(" ");return o.watch(()=>d.visible,e=>{i.value=e}),(e,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["overflow-hidden w-full",[e.rounded?"rounded-lg":"rounded-sm",C(e.borderColor,e.displayHighlight,e.highlightColor)]])},[o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["py-xs px-sm cursor-pointer transition-[border] duration-500",[i.value?`border-b ${o.unref(t)("BORDERB",e.borderColor)} ease-in`:"ease-out",o.unref(t)("BGCOLOR",e.bgColor)]])},[o.createElementVNode("div",u,[o.createElementVNode("h3",{class:o.normalizeClass(l(e.titleSize,e.titleColor))},o.toDisplayString(e.title),3),o.unref(c).tab?(o.openBlock(),o.createElementBlock("div",{key:0,onClick:r[0]||(r[0]=o.withModifiers(()=>{},["stop"])),class:"cursor-default"},[o.renderSlot(e.$slots,"tab")])):o.createCommentVNode("",!0)])],2)),[[o.unref(t.vCollapse),void 0,e.collapseId]]),o.createElementVNode("div",{class:o.normalizeClass(["overflow-hidden",o.unref(t)("BGCOLOR",e.slotBgColor)])},[o.createVNode(o.unref(t.Collapse),{id:e.collapseId,visible:e.visible,"class-name":"py-sm px-xs",onOpen:p,onClose:p,accordion:e.accordion},{default:o.withCtx(()=>[o.renderSlot(e.$slots,"content")]),_:3},8,["id","visible","accordion"])],2),o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["py-1.5 px-sm cursor-pointer transition-all duration-500 flex justify-center items-center border-t",[o.unref(t)("BGCOLOR",e.bgColor),o.unref(t)("BORDERT",e.borderColor)]])},[(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:o.normalizeClass(["h-xs",[i.value?"rotate-180":"rotate-0","transition-transform duration-300 ease-in",o.unref(t)("SVGFILL",e.iconColor)]])},b,2))],2)),[[o.unref(t.vCollapse),void 0,e.collapseId]])],2))}}),y={class:"flex justify-center items-center ml-xs md:ml-sm lg:ml-md"},w=[o.createElementVNode("path",{d:"M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"},null,-1)],g={class:"overflow-hidden"},E=o.defineComponent({__name:"MclCollapseB",props:{collapseId:{},title:{},titleColor:{default:"light-1"},titleSize:{default:"md"},borderColor:{default:"light-3"},bgColor:{default:"light-1"},btnColor:{default:"primary"},iconColor:{default:"light-1"},rounded:{type:Boolean,default:!0},displayShadow:{type:Boolean,default:!0},visible:{type:Boolean,default:!1},accordion:{}},emits:["collapse-open","collapse-close"],setup(m,{emit:h}){const d=m;o.useSlots();const i=o.ref(d.visible),c=h,a=l=>{const{title:e}=d;i.value=l,c(l===!0?"collapse-open":"collapse-close",l,e)},p=(l,e,r,f)=>{let n=["border",t("BORDER",l),t("BGCOLOR",e)];return f&&n.push("shadow-md"),r?n.push("rounded-2xl"):n.push("rounded-sm"),n.join(" ")},C=(l,e)=>[t("H3",l),t("TEXTCOLOR",e)].join(" ");return o.watch(()=>d.visible,l=>{i.value=l}),(l,e)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["w-full overflow-hidden p-2xs",p(l.borderColor,l.bgColor,l.rounded,l.displayShadow)])},[o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex justify-between items-center w-full px-4 py-2 cursor-pointer hover:bg-opacity-70 transition duration-200 ease-in",[l.rounded?"rounded-lg":"rounded-sm",o.unref(t)("BGCOLOR",l.btnColor)]])},[o.createElementVNode("h3",{class:o.normalizeClass(C(l.titleSize,l.titleColor))},o.toDisplayString(l.title),3),o.createElementVNode("div",y,[(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:o.normalizeClass(["h-xs transition-transform duration-300 ease-in",[i.value?"rotate-180":"rotate-0",o.unref(t)("SVGFILL",l.iconColor)]])},w,2))])],2)),[[o.unref(t.vCollapse),void 0,l.collapseId]]),o.createElementVNode("div",g,[o.createVNode(o.unref(t.Collapse),{id:l.collapseId,visible:l.visible,"class-name":"px-xs pt-xs pb-2xs",accordion:l.accordion,onOpen:a,onClose:a},{default:o.withCtx(()=>[o.renderSlot(l.$slots,"default")]),_:3},8,["id","visible","accordion"])])],2))}});s.MclCollapseA=B,s.MclCollapseB=E,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/mcl-collapse",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"description": "collapse component built on top of @bobbykim/manguito-theme",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"main": "./dist/mcl-collapse.umd.cjs",
|
|
10
|
+
"module": "./dist/mcl-collapse.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/mcl-collapse.js",
|
|
15
|
+
"require": "./dist/mcl-collapse.umd.cjs",
|
|
16
|
+
"types": "./dist/index.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
7
19
|
"scripts": {
|
|
8
|
-
"build": "
|
|
20
|
+
"build": "vite build"
|
|
9
21
|
},
|
|
10
22
|
"author": {
|
|
11
23
|
"name": "Bobby Kim",
|
|
@@ -21,7 +33,16 @@
|
|
|
21
33
|
},
|
|
22
34
|
"license": "MIT",
|
|
23
35
|
"dependencies": {
|
|
24
|
-
"@bobbykim/manguito-theme": "
|
|
36
|
+
"@bobbykim/manguito-theme": "0.20.0",
|
|
37
|
+
"vue": "^3.3.10"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@vitejs/plugin-vue": "^4.5.2",
|
|
41
|
+
"typescript": "^5.3.3",
|
|
42
|
+
"vite": "^4.5.1",
|
|
43
|
+
"vite-plugin-css-injected-by-js": "^3.5.0",
|
|
44
|
+
"vite-plugin-dts": "^3.8.3",
|
|
45
|
+
"vue-tsc": "^1.8.25"
|
|
25
46
|
},
|
|
26
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "2e677770b8628a9616237cd3812af2dcb20ee5bb"
|
|
27
48
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# [0.6.0](https://github.com/bobbykim89/manguito-component-library/compare/@bobbykim/mcl-collapse@0.5.0...@bobbykim/mcl-collapse@0.6.0) (2024-04-01)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Features
|
|
10
|
-
|
|
11
|
-
* ready for production ([4e2fc04](https://github.com/bobbykim89/manguito-component-library/commit/4e2fc048edd67791b4e917e0a764f301d4c610cb))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# [0.5.0](https://github.com/bobbykim89/manguito-component-library/compare/@bobbykim/mcl-collapse@0.3.0...@bobbykim/mcl-collapse@0.5.0) (2024-03-24)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Features
|
|
21
|
-
|
|
22
|
-
* build and release ([a372086](https://github.com/bobbykim89/manguito-component-library/commit/a3720861fb40dd6ec1d0e3dda1f06e2479967432))
|
|
23
|
-
* **components/*:** prepublish build ([c8eb95a](https://github.com/bobbykim89/manguito-component-library/commit/c8eb95a0ede6727bf183d2e9ad634ae64af1411d))
|
|
24
|
-
* **mcl-header:** move deprecated items to deprecated folder in root dir, update configs, init mcl-header-b component ([19aa842](https://github.com/bobbykim89/manguito-component-library/commit/19aa842faa7f1594f7be030b97d5093014efe7cb))
|
|
25
|
-
* tsconfig update, slots and emits update ([c30ff80](https://github.com/bobbykim89/manguito-component-library/commit/c30ff804c961d205ac097e20cd51285a15ca8966))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
# [0.4.0](https://github.com/bobbykim89/manguito-component-library/compare/@bobbykim/mcl-collapse@0.3.0...@bobbykim/mcl-collapse@0.4.0) (2024-03-21)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### Features
|
|
35
|
-
|
|
36
|
-
* **mcl-header:** move deprecated items to deprecated folder in root dir, update configs, init mcl-header-b component ([19aa842](https://github.com/bobbykim89/manguito-component-library/commit/19aa842faa7f1594f7be030b97d5093014efe7cb))
|
|
37
|
-
* tsconfig update, slots and emits update ([c30ff80](https://github.com/bobbykim89/manguito-component-library/commit/c30ff804c961d205ac097e20cd51285a15ca8966))
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
# [0.3.0](https://github.com/bobbykim89/manguito-component-library/compare/@bobbykim/mcl-collapse@0.2.0...@bobbykim/mcl-collapse@0.3.0) (2024-02-27)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### Features
|
|
47
|
-
|
|
48
|
-
* **/components/**/README.md,/deprecated:** update readme files, move deprecated packages to deprecated folder ([c0f8f7d](https://github.com/bobbykim89/manguito-component-library/commit/c0f8f7df158b8fcd99b4e3d191e02e3c8a9c144d))
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
# 0.2.0 (2024-02-27)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### Features
|
|
58
|
-
|
|
59
|
-
* **mcl-collapse:** add mcl-collapse component library and add story for mcl-collapse-a ([397b63e](https://github.com/bobbykim89/manguito-component-library/commit/397b63e00b83801bdf1cd2c6710d0ba876c6bf87))
|
|
60
|
-
* **mcl-collapse:** add story for mcl-collapse-b ([6edbc56](https://github.com/bobbykim89/manguito-component-library/commit/6edbc569833aae3f1aef65634987157b38956f83))
|
|
61
|
-
* **stories:** add story for mcl-card-b ([7470f0d](https://github.com/bobbykim89/manguito-component-library/commit/7470f0ddee5b3ba3c9f5c37e52bd37f6a1a75202))
|
package/index.d.ts
DELETED
package/index.js
DELETED
package/index.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { ColorPalette, HeadingSize } from '@bobbykim/manguito-theme'
|
|
3
|
-
import generateClass, { Collapse, vCollapse } from '@bobbykim/manguito-theme'
|
|
4
|
-
import { ref, watch } from 'vue'
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(
|
|
7
|
-
defineProps<{
|
|
8
|
-
collapseId: string
|
|
9
|
-
borderColor?: ColorPalette
|
|
10
|
-
rounded?: boolean
|
|
11
|
-
displayHighlight?: boolean
|
|
12
|
-
highlightColor?: ColorPalette
|
|
13
|
-
title: string
|
|
14
|
-
titleSize?: HeadingSize
|
|
15
|
-
titleColor?: ColorPalette
|
|
16
|
-
visible?: boolean
|
|
17
|
-
iconColor?: ColorPalette
|
|
18
|
-
bgColor?: ColorPalette
|
|
19
|
-
slotBgColor?: ColorPalette
|
|
20
|
-
accordion?: string
|
|
21
|
-
}>(),
|
|
22
|
-
{
|
|
23
|
-
borderColor: 'light-4',
|
|
24
|
-
rounded: false,
|
|
25
|
-
displayHighlight: true,
|
|
26
|
-
highlightColor: 'secondary',
|
|
27
|
-
titleSize: 'sm',
|
|
28
|
-
titleColor: 'dark-3',
|
|
29
|
-
visible: false,
|
|
30
|
-
iconColor: 'dark-3',
|
|
31
|
-
bgColor: 'white',
|
|
32
|
-
slotBgColor: 'light-2',
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
const toggle = ref(props.visible)
|
|
37
|
-
const slots = defineSlots<{
|
|
38
|
-
content: any
|
|
39
|
-
tab: any
|
|
40
|
-
}>()
|
|
41
|
-
const emit = defineEmits<{
|
|
42
|
-
(e: 'collapse-open', visible: boolean, title: string): void
|
|
43
|
-
(e: 'collapse-close', visible: boolean, title: string): void
|
|
44
|
-
}>()
|
|
45
|
-
|
|
46
|
-
const toggleAction = (visible: boolean): void => {
|
|
47
|
-
const { title } = props
|
|
48
|
-
toggle.value = visible
|
|
49
|
-
if (visible === true) {
|
|
50
|
-
emit('collapse-open', visible, title)
|
|
51
|
-
} else {
|
|
52
|
-
emit('collapse-close', visible, title)
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const getBorderClass = (
|
|
57
|
-
bColor: ColorPalette,
|
|
58
|
-
dHl: boolean,
|
|
59
|
-
hlColor: ColorPalette
|
|
60
|
-
): string => {
|
|
61
|
-
/**
|
|
62
|
-
* @param {ColorPalette} bColor - borderColor
|
|
63
|
-
* @param {boolean} dHl - displayHighlight
|
|
64
|
-
* @param {ColorPalette} hlColor - highlightColor
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
const classArray: string[] = ['border', generateClass('BORDER', bColor)]
|
|
68
|
-
|
|
69
|
-
if (dHl) {
|
|
70
|
-
const borderArray: string[] = [generateClass('BORDERL', hlColor)]
|
|
71
|
-
borderArray.forEach((item) => {
|
|
72
|
-
classArray.push(item), classArray.push('border-l-8')
|
|
73
|
-
})
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return classArray.join(' ')
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const getTitleClass = (size: HeadingSize, color: ColorPalette): string => {
|
|
80
|
-
/**
|
|
81
|
-
* @param {HeadingSize} size - titleSize
|
|
82
|
-
* @param {ColorPalette} color - titleColor
|
|
83
|
-
*/
|
|
84
|
-
const classArray: string[] = [
|
|
85
|
-
generateClass('H3', size),
|
|
86
|
-
generateClass('TEXTCOLOR', color),
|
|
87
|
-
]
|
|
88
|
-
return classArray.join(' ')
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
watch(
|
|
92
|
-
() => props.visible,
|
|
93
|
-
(newValue) => {
|
|
94
|
-
toggle.value = newValue
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<template>
|
|
100
|
-
<div
|
|
101
|
-
class="overflow-hidden w-full"
|
|
102
|
-
:class="[
|
|
103
|
-
rounded ? 'rounded-lg' : 'rounded-sm',
|
|
104
|
-
getBorderClass(borderColor, displayHighlight, highlightColor),
|
|
105
|
-
]"
|
|
106
|
-
>
|
|
107
|
-
<div
|
|
108
|
-
class="py-xs px-sm cursor-pointer transition-[border] duration-500"
|
|
109
|
-
:class="[
|
|
110
|
-
toggle
|
|
111
|
-
? `border-b ${generateClass('BORDERB', borderColor)} ease-in`
|
|
112
|
-
: 'ease-out',
|
|
113
|
-
generateClass('BGCOLOR', bgColor),
|
|
114
|
-
]"
|
|
115
|
-
v-collapse:[collapseId]
|
|
116
|
-
>
|
|
117
|
-
<div class="flex justify-between items-center">
|
|
118
|
-
<h3 :class="getTitleClass(titleSize, titleColor)">
|
|
119
|
-
{{ title }}
|
|
120
|
-
</h3>
|
|
121
|
-
<div @click.stop class="cursor-default" v-if="slots['tab']">
|
|
122
|
-
<slot name="tab"></slot>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
<div class="overflow-hidden" :class="generateClass('BGCOLOR', slotBgColor)">
|
|
127
|
-
<collapse
|
|
128
|
-
:id="collapseId"
|
|
129
|
-
:visible="visible"
|
|
130
|
-
class-name="py-sm px-xs"
|
|
131
|
-
@open="toggleAction"
|
|
132
|
-
@close="toggleAction"
|
|
133
|
-
:accordion="accordion"
|
|
134
|
-
>
|
|
135
|
-
<slot name="content"></slot>
|
|
136
|
-
</collapse>
|
|
137
|
-
</div>
|
|
138
|
-
<div
|
|
139
|
-
class="py-1.5 px-sm cursor-pointer transition-all duration-500 flex justify-center items-center border-t"
|
|
140
|
-
:class="[
|
|
141
|
-
generateClass('BGCOLOR', bgColor),
|
|
142
|
-
generateClass('BORDERT', borderColor),
|
|
143
|
-
]"
|
|
144
|
-
v-collapse:[collapseId]
|
|
145
|
-
>
|
|
146
|
-
<svg
|
|
147
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
148
|
-
viewBox="0 0 448 512"
|
|
149
|
-
class="h-xs"
|
|
150
|
-
:class="[
|
|
151
|
-
!toggle ? 'rotate-0' : 'rotate-180',
|
|
152
|
-
'transition-transform duration-300 ease-in',
|
|
153
|
-
generateClass('SVGFILL', iconColor),
|
|
154
|
-
]"
|
|
155
|
-
>
|
|
156
|
-
<!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. -->
|
|
157
|
-
<path
|
|
158
|
-
d="M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"
|
|
159
|
-
/>
|
|
160
|
-
</svg>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
</template>
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type { ColorPalette, HeadingSize } from '@bobbykim/manguito-theme';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
-
collapseId: string;
|
|
4
|
-
borderColor?: ColorPalette | undefined;
|
|
5
|
-
rounded?: boolean | undefined;
|
|
6
|
-
displayHighlight?: boolean | undefined;
|
|
7
|
-
highlightColor?: ColorPalette | undefined;
|
|
8
|
-
title: string;
|
|
9
|
-
titleSize?: HeadingSize | undefined;
|
|
10
|
-
titleColor?: ColorPalette | undefined;
|
|
11
|
-
visible?: boolean | undefined;
|
|
12
|
-
iconColor?: ColorPalette | undefined;
|
|
13
|
-
bgColor?: ColorPalette | undefined;
|
|
14
|
-
slotBgColor?: ColorPalette | undefined;
|
|
15
|
-
accordion?: string | undefined;
|
|
16
|
-
}>, {
|
|
17
|
-
borderColor: string;
|
|
18
|
-
rounded: boolean;
|
|
19
|
-
displayHighlight: boolean;
|
|
20
|
-
highlightColor: string;
|
|
21
|
-
titleSize: string;
|
|
22
|
-
titleColor: string;
|
|
23
|
-
visible: boolean;
|
|
24
|
-
iconColor: string;
|
|
25
|
-
bgColor: string;
|
|
26
|
-
slotBgColor: string;
|
|
27
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
-
"collapse-open": (visible: boolean, title: string) => void;
|
|
29
|
-
"collapse-close": (visible: boolean, title: string) => void;
|
|
30
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
31
|
-
collapseId: string;
|
|
32
|
-
borderColor?: ColorPalette | undefined;
|
|
33
|
-
rounded?: boolean | undefined;
|
|
34
|
-
displayHighlight?: boolean | undefined;
|
|
35
|
-
highlightColor?: ColorPalette | undefined;
|
|
36
|
-
title: string;
|
|
37
|
-
titleSize?: HeadingSize | undefined;
|
|
38
|
-
titleColor?: ColorPalette | undefined;
|
|
39
|
-
visible?: boolean | undefined;
|
|
40
|
-
iconColor?: ColorPalette | undefined;
|
|
41
|
-
bgColor?: ColorPalette | undefined;
|
|
42
|
-
slotBgColor?: ColorPalette | undefined;
|
|
43
|
-
accordion?: string | undefined;
|
|
44
|
-
}>, {
|
|
45
|
-
borderColor: string;
|
|
46
|
-
rounded: boolean;
|
|
47
|
-
displayHighlight: boolean;
|
|
48
|
-
highlightColor: string;
|
|
49
|
-
titleSize: string;
|
|
50
|
-
titleColor: string;
|
|
51
|
-
visible: boolean;
|
|
52
|
-
iconColor: string;
|
|
53
|
-
bgColor: string;
|
|
54
|
-
slotBgColor: string;
|
|
55
|
-
}>>> & {
|
|
56
|
-
"onCollapse-open"?: ((visible: boolean, title: string) => any) | undefined;
|
|
57
|
-
"onCollapse-close"?: ((visible: boolean, title: string) => any) | undefined;
|
|
58
|
-
}, {
|
|
59
|
-
rounded: boolean;
|
|
60
|
-
visible: boolean;
|
|
61
|
-
bgColor: ColorPalette;
|
|
62
|
-
titleColor: ColorPalette;
|
|
63
|
-
borderColor: ColorPalette;
|
|
64
|
-
displayHighlight: boolean;
|
|
65
|
-
highlightColor: ColorPalette;
|
|
66
|
-
titleSize: HeadingSize;
|
|
67
|
-
iconColor: ColorPalette;
|
|
68
|
-
slotBgColor: ColorPalette;
|
|
69
|
-
}, {}>, Readonly<{
|
|
70
|
-
content: any;
|
|
71
|
-
tab: any;
|
|
72
|
-
}> & {
|
|
73
|
-
content: any;
|
|
74
|
-
tab: any;
|
|
75
|
-
}>;
|
|
76
|
-
export default _default;
|
|
77
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
78
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
79
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
80
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
81
|
-
} : {
|
|
82
|
-
type: import('vue').PropType<T[K]>;
|
|
83
|
-
required: true;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
type __VLS_WithDefaults<P, D> = {
|
|
87
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
88
|
-
default: D[K];
|
|
89
|
-
}> : P[K];
|
|
90
|
-
};
|
|
91
|
-
type __VLS_Prettify<T> = {
|
|
92
|
-
[K in keyof T]: T[K];
|
|
93
|
-
} & {};
|
|
94
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
95
|
-
new (): {
|
|
96
|
-
$slots: S;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { ColorPalette, HeadingSize } from '@bobbykim/manguito-theme'
|
|
3
|
-
import generateClass, { Collapse, vCollapse } from '@bobbykim/manguito-theme'
|
|
4
|
-
import { ref, watch } from 'vue'
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(
|
|
7
|
-
defineProps<{
|
|
8
|
-
collapseId: string
|
|
9
|
-
title: string
|
|
10
|
-
titleColor?: ColorPalette
|
|
11
|
-
titleSize?: HeadingSize
|
|
12
|
-
borderColor?: ColorPalette
|
|
13
|
-
bgColor?: ColorPalette
|
|
14
|
-
btnColor?: ColorPalette
|
|
15
|
-
iconColor?: ColorPalette
|
|
16
|
-
rounded?: boolean
|
|
17
|
-
displayShadow?: boolean
|
|
18
|
-
visible?: boolean
|
|
19
|
-
accordion?: string
|
|
20
|
-
}>(),
|
|
21
|
-
{
|
|
22
|
-
titleColor: 'light-1',
|
|
23
|
-
titleSize: 'md',
|
|
24
|
-
borderColor: 'light-3',
|
|
25
|
-
bgColor: 'light-1',
|
|
26
|
-
btnColor: 'primary',
|
|
27
|
-
iconColor: 'light-1',
|
|
28
|
-
rounded: true,
|
|
29
|
-
displayShadow: true,
|
|
30
|
-
visible: false,
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
const slots = defineSlots<{
|
|
35
|
-
default: any
|
|
36
|
-
}>()
|
|
37
|
-
const toggle = ref(props.visible)
|
|
38
|
-
const emit = defineEmits<{
|
|
39
|
-
(e: 'collapse-open', visible: boolean, title: string): void
|
|
40
|
-
(e: 'collapse-close', visible: boolean, title: string): void
|
|
41
|
-
}>()
|
|
42
|
-
|
|
43
|
-
const toggleAction = (visible: boolean): void => {
|
|
44
|
-
const { title } = props
|
|
45
|
-
toggle.value = visible
|
|
46
|
-
if (visible === true) {
|
|
47
|
-
emit('collapse-open', visible, title)
|
|
48
|
-
} else {
|
|
49
|
-
emit('collapse-close', visible, title)
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const getBorderClass = (
|
|
54
|
-
bColor: ColorPalette,
|
|
55
|
-
bgColor: ColorPalette,
|
|
56
|
-
rounded: boolean,
|
|
57
|
-
dShadow: boolean
|
|
58
|
-
): string => {
|
|
59
|
-
/**
|
|
60
|
-
* @param {ColorPalette} bColor - borderColor
|
|
61
|
-
* @param {ColorPalette} bgColor - bgColor
|
|
62
|
-
* @param {boolean} rounded - rounded
|
|
63
|
-
* @param {boolean} dShadow - displayShadow
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
let borderInfo: string[] = [
|
|
67
|
-
'border',
|
|
68
|
-
generateClass('BORDER', bColor),
|
|
69
|
-
generateClass('BGCOLOR', bgColor),
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
if (dShadow) {
|
|
73
|
-
borderInfo.push('shadow-md')
|
|
74
|
-
}
|
|
75
|
-
if (rounded) {
|
|
76
|
-
borderInfo.push('rounded-2xl')
|
|
77
|
-
} else {
|
|
78
|
-
borderInfo.push('rounded-sm')
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return borderInfo.join(' ')
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const getTitleClass = (size: HeadingSize, color: ColorPalette): string => {
|
|
85
|
-
/**
|
|
86
|
-
* @param {HeadingSize} size - titleSize
|
|
87
|
-
* @param {ColorPalette} color - titleColor
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
const classArray: string[] = [
|
|
91
|
-
generateClass('H3', size),
|
|
92
|
-
generateClass('TEXTCOLOR', color),
|
|
93
|
-
]
|
|
94
|
-
return classArray.join(' ')
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
watch(
|
|
98
|
-
() => props.visible,
|
|
99
|
-
(newValue) => {
|
|
100
|
-
toggle.value = newValue
|
|
101
|
-
}
|
|
102
|
-
)
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<template>
|
|
106
|
-
<div
|
|
107
|
-
class="w-full overflow-hidden p-2xs"
|
|
108
|
-
:class="getBorderClass(borderColor, bgColor, rounded, displayShadow)"
|
|
109
|
-
>
|
|
110
|
-
<div
|
|
111
|
-
v-collapse:[collapseId]
|
|
112
|
-
class="flex justify-between items-center w-full px-4 py-2 cursor-pointer hover:bg-opacity-70 transition duration-200 ease-in"
|
|
113
|
-
:class="[
|
|
114
|
-
rounded ? 'rounded-lg' : 'rounded-sm',
|
|
115
|
-
generateClass('BGCOLOR', btnColor),
|
|
116
|
-
]"
|
|
117
|
-
>
|
|
118
|
-
<h3 :class="getTitleClass(titleSize, titleColor)">{{ title }}</h3>
|
|
119
|
-
<div class="flex justify-center items-center ml-xs md:ml-sm lg:ml-md">
|
|
120
|
-
<svg
|
|
121
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
122
|
-
viewBox="0 0 448 512"
|
|
123
|
-
class="h-xs transition-transform duration-300 ease-in"
|
|
124
|
-
:class="[
|
|
125
|
-
!toggle ? 'rotate-0' : 'rotate-180',
|
|
126
|
-
generateClass('SVGFILL', iconColor),
|
|
127
|
-
]"
|
|
128
|
-
>
|
|
129
|
-
<!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. -->
|
|
130
|
-
<path
|
|
131
|
-
d="M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"
|
|
132
|
-
/>
|
|
133
|
-
</svg>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
<div class="overflow-hidden">
|
|
137
|
-
<collapse
|
|
138
|
-
:id="collapseId"
|
|
139
|
-
:visible="visible"
|
|
140
|
-
class-name="px-xs pt-xs pb-2xs"
|
|
141
|
-
:accordion="accordion"
|
|
142
|
-
@open="toggleAction"
|
|
143
|
-
@close="toggleAction"
|
|
144
|
-
>
|
|
145
|
-
<slot></slot>
|
|
146
|
-
</collapse>
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
</template>
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { ColorPalette, HeadingSize } from '@bobbykim/manguito-theme';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
-
collapseId: string;
|
|
4
|
-
title: string;
|
|
5
|
-
titleColor?: ColorPalette | undefined;
|
|
6
|
-
titleSize?: HeadingSize | undefined;
|
|
7
|
-
borderColor?: ColorPalette | undefined;
|
|
8
|
-
bgColor?: ColorPalette | undefined;
|
|
9
|
-
btnColor?: ColorPalette | undefined;
|
|
10
|
-
iconColor?: ColorPalette | undefined;
|
|
11
|
-
rounded?: boolean | undefined;
|
|
12
|
-
displayShadow?: boolean | undefined;
|
|
13
|
-
visible?: boolean | undefined;
|
|
14
|
-
accordion?: string | undefined;
|
|
15
|
-
}>, {
|
|
16
|
-
titleColor: string;
|
|
17
|
-
titleSize: string;
|
|
18
|
-
borderColor: string;
|
|
19
|
-
bgColor: string;
|
|
20
|
-
btnColor: string;
|
|
21
|
-
iconColor: string;
|
|
22
|
-
rounded: boolean;
|
|
23
|
-
displayShadow: boolean;
|
|
24
|
-
visible: boolean;
|
|
25
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
|
-
"collapse-open": (visible: boolean, title: string) => void;
|
|
27
|
-
"collapse-close": (visible: boolean, title: string) => void;
|
|
28
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
29
|
-
collapseId: string;
|
|
30
|
-
title: string;
|
|
31
|
-
titleColor?: ColorPalette | undefined;
|
|
32
|
-
titleSize?: HeadingSize | undefined;
|
|
33
|
-
borderColor?: ColorPalette | undefined;
|
|
34
|
-
bgColor?: ColorPalette | undefined;
|
|
35
|
-
btnColor?: ColorPalette | undefined;
|
|
36
|
-
iconColor?: ColorPalette | undefined;
|
|
37
|
-
rounded?: boolean | undefined;
|
|
38
|
-
displayShadow?: boolean | undefined;
|
|
39
|
-
visible?: boolean | undefined;
|
|
40
|
-
accordion?: string | undefined;
|
|
41
|
-
}>, {
|
|
42
|
-
titleColor: string;
|
|
43
|
-
titleSize: string;
|
|
44
|
-
borderColor: string;
|
|
45
|
-
bgColor: string;
|
|
46
|
-
btnColor: string;
|
|
47
|
-
iconColor: string;
|
|
48
|
-
rounded: boolean;
|
|
49
|
-
displayShadow: boolean;
|
|
50
|
-
visible: boolean;
|
|
51
|
-
}>>> & {
|
|
52
|
-
"onCollapse-open"?: ((visible: boolean, title: string) => any) | undefined;
|
|
53
|
-
"onCollapse-close"?: ((visible: boolean, title: string) => any) | undefined;
|
|
54
|
-
}, {
|
|
55
|
-
rounded: boolean;
|
|
56
|
-
visible: boolean;
|
|
57
|
-
bgColor: ColorPalette;
|
|
58
|
-
titleColor: ColorPalette;
|
|
59
|
-
borderColor: ColorPalette;
|
|
60
|
-
titleSize: HeadingSize;
|
|
61
|
-
iconColor: ColorPalette;
|
|
62
|
-
btnColor: ColorPalette;
|
|
63
|
-
displayShadow: boolean;
|
|
64
|
-
}, {}>, Readonly<{
|
|
65
|
-
default: any;
|
|
66
|
-
}> & {
|
|
67
|
-
default: any;
|
|
68
|
-
}>;
|
|
69
|
-
export default _default;
|
|
70
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
71
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
72
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
73
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
74
|
-
} : {
|
|
75
|
-
type: import('vue').PropType<T[K]>;
|
|
76
|
-
required: true;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
type __VLS_WithDefaults<P, D> = {
|
|
80
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
81
|
-
default: D[K];
|
|
82
|
-
}> : P[K];
|
|
83
|
-
};
|
|
84
|
-
type __VLS_Prettify<T> = {
|
|
85
|
-
[K in keyof T]: T[K];
|
|
86
|
-
} & {};
|
|
87
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
88
|
-
new (): {
|
|
89
|
-
$slots: S;
|
|
90
|
-
};
|
|
91
|
-
};
|
package/tsconfig.json
DELETED
package/tsconfig.ts.json
DELETED