@bobbykim/mcl-forms 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 +610 -0
- package/dist/mcl-forms.js +589 -0
- package/dist/mcl-forms.umd.cjs +2 -0
- package/package.json +29 -6
- package/CHANGELOG.md +0 -69
- package/index.d.ts +0 -10
- package/index.js +0 -10
- package/index.ts +0 -19
- package/lib/assets/CaretDown.vue +0 -14
- package/lib/assets/CaretDown.vue.d.ts +0 -2
- package/lib/common/InputHighlight.vue +0 -46
- package/lib/common/InputHighlight.vue.d.ts +0 -41
- package/lib/common/index.types.d.ts +0 -4
- package/lib/common/index.types.js +0 -1
- package/lib/common/index.types.ts +0 -5
- package/lib/mcl-form-group/MclFormGroup.vue +0 -48
- package/lib/mcl-form-group/MclFormGroup.vue.d.ts +0 -52
- package/lib/mcl-input-file/MclInputFile.vue +0 -151
- package/lib/mcl-input-file/MclInputFile.vue.d.ts +0 -93
- package/lib/mcl-input-radio/MclInputRadio.vue +0 -91
- package/lib/mcl-input-radio/MclInputRadio.vue.d.ts +0 -62
- package/lib/mcl-input-radio/index.types.d.ts +0 -1
- package/lib/mcl-input-radio/index.types.js +0 -1
- package/lib/mcl-input-radio/index.types.ts +0 -1
- package/lib/mcl-input-switch/MclInputSwitch.vue +0 -147
- package/lib/mcl-input-switch/MclInputSwitch.vue.d.ts +0 -59
- package/lib/mcl-input-switch/index.types.d.ts +0 -1
- package/lib/mcl-input-switch/index.types.js +0 -1
- package/lib/mcl-input-switch/index.types.ts +0 -1
- package/lib/mcl-input-text/MclInputText.vue +0 -113
- package/lib/mcl-input-text/MclInputText.vue.d.ts +0 -103
- package/lib/mcl-select/MclSelect.vue +0 -287
- package/lib/mcl-select/MclSelect.vue.d.ts +0 -108
- package/lib/mcl-select/index.types.d.ts +0 -5
- package/lib/mcl-select/index.types.js +0 -1
- package/lib/mcl-select/index.types.ts +0 -6
- package/lib/mcl-text-area/MclTextArea.vue +0 -100
- package/lib/mcl-text-area/MclTextArea.vue.d.ts +0 -88
- package/tsconfig.json +0 -5
- package/tsconfig.ts.json +0 -9
- package/tsconfig.vue.json +0 -9
|
@@ -0,0 +1,589 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.switch[data-v-8df11a40]{width:var(--switch-width);height:var(--switch-height)}.slider[data-v-8df11a40]:before{content:"";height:var(--slider-size);width:var(--slider-size);left:var(--gutter-size);bottom:var(--gutter-size)}input:checked+.slider[data-v-8df11a40]:before{transform:translate(var(--slider-size))}.options-enter-active[data-v-aa593ff3],.options-leave-active[data-v-aa593ff3]{opacity:1;transition:all .3s}.options-enter-from[data-v-aa593ff3],.options-leave-to[data-v-aa593ff3]{opacity:0;transform:translateY(-10px)}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { defineComponent as R, useSlots as K, computed as h, openBlock as p, createElementBlock as y, createElementVNode as c, renderSlot as z, normalizeClass as m, toDisplayString as E, ref as B, unref as L, createCommentVNode as F, normalizeStyle as M, withDirectives as I, vModelCheckbox as W, vModelDynamic as Y, createBlock as A, withKeys as J, vModelText as H, createVNode as P, Transition as Q, withCtx as Z, Fragment as ee, renderList as te, pushScopeId as le, popScopeId as oe } from "vue";
|
|
3
|
+
import o, { vClickOutside as re } from "@bobbykim/manguito-theme";
|
|
4
|
+
import { useResizeObserver as ae } from "@vueuse/core";
|
|
5
|
+
const se = ["for"], Ve = /* @__PURE__ */ R({
|
|
6
|
+
__name: "MclFormGroup",
|
|
7
|
+
props: {
|
|
8
|
+
labelFor: {},
|
|
9
|
+
textColor: { default: "dark-3" },
|
|
10
|
+
textSize: { default: "md" },
|
|
11
|
+
textBold: { type: Boolean, default: !1 },
|
|
12
|
+
label: {}
|
|
13
|
+
},
|
|
14
|
+
setup(u) {
|
|
15
|
+
const f = u;
|
|
16
|
+
K();
|
|
17
|
+
const r = h(() => {
|
|
18
|
+
const { textColor: i, textSize: n, textBold: v } = f, e = [
|
|
19
|
+
o("TEXTCOLOR", i),
|
|
20
|
+
o("BODYTEXT", n)
|
|
21
|
+
];
|
|
22
|
+
return v && e.push("font-bold"), e.join(" ");
|
|
23
|
+
});
|
|
24
|
+
return (i, n) => (p(), y("div", null, [
|
|
25
|
+
c("label", {
|
|
26
|
+
for: i.labelFor,
|
|
27
|
+
class: "inline-block"
|
|
28
|
+
}, [
|
|
29
|
+
z(i.$slots, "label", {}, () => [
|
|
30
|
+
c("p", {
|
|
31
|
+
class: m(["mb-2xs", r.value])
|
|
32
|
+
}, E(i.label), 3)
|
|
33
|
+
])
|
|
34
|
+
], 8, se),
|
|
35
|
+
z(i.$slots, "default")
|
|
36
|
+
]));
|
|
37
|
+
}
|
|
38
|
+
}), ne = { class: "shrink-0 my-3xs ml-3xs mr-xs" }, ie = ["id", "required", "accept"], de = /* @__PURE__ */ c("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z" }, null, -1), ue = [
|
|
39
|
+
de
|
|
40
|
+
], Te = /* @__PURE__ */ R({
|
|
41
|
+
__name: "MclInputFile",
|
|
42
|
+
props: {
|
|
43
|
+
id: {},
|
|
44
|
+
displayBorder: { type: Boolean, default: !1 },
|
|
45
|
+
borderColor: { default: "light-4" },
|
|
46
|
+
rounded: { type: Boolean, default: !1 },
|
|
47
|
+
bgColor: { default: "light-1" },
|
|
48
|
+
buttonText: { default: "Browse File" },
|
|
49
|
+
buttonTextColor: { default: "dark-3" },
|
|
50
|
+
buttonColor: { default: "light-4" },
|
|
51
|
+
displayShadow: { type: Boolean, default: !0 },
|
|
52
|
+
textColor: { default: "black" },
|
|
53
|
+
displayClear: { type: Boolean, default: !1 },
|
|
54
|
+
isRequired: { type: Boolean, default: !1 },
|
|
55
|
+
accept: { default: "image/jpg,image/jpeg,image/png" },
|
|
56
|
+
modelValue: {}
|
|
57
|
+
},
|
|
58
|
+
emits: ["update:modelValue"],
|
|
59
|
+
setup(u, { emit: f }) {
|
|
60
|
+
const r = u, i = f, n = B(), v = B(0), e = () => {
|
|
61
|
+
n.value.click();
|
|
62
|
+
}, s = (t) => {
|
|
63
|
+
const k = t.target.files[0];
|
|
64
|
+
i("update:modelValue", k);
|
|
65
|
+
}, d = () => {
|
|
66
|
+
i("update:modelValue", null), v.value++;
|
|
67
|
+
}, x = h(() => {
|
|
68
|
+
const { rounded: t, displayBorder: k, borderColor: _, displayShadow: V, bgColor: G } = r, O = [o("BGCOLOR", G)];
|
|
69
|
+
return t && O.push("rounded-md"), k && (O.push("border-2"), O.push(o("BORDER", _))), V && O.push("shadow-md"), O.join(" ");
|
|
70
|
+
}), l = h(() => {
|
|
71
|
+
const { textColor: t } = r;
|
|
72
|
+
return [o("TEXTCOLOR", t)].join(" ");
|
|
73
|
+
}), C = h(() => {
|
|
74
|
+
const { buttonColor: t, buttonTextColor: k, rounded: _ } = r, V = [
|
|
75
|
+
o("BGCOLOR", t),
|
|
76
|
+
o("TEXTCOLOR", k)
|
|
77
|
+
];
|
|
78
|
+
return _ && V.push("rounded-l-md"), V.join(" ");
|
|
79
|
+
}), w = h(() => {
|
|
80
|
+
const { buttonColor: t, rounded: k } = r, _ = [o("BGCOLOR", t)];
|
|
81
|
+
return k && _.push("rounded-r-md"), _.join(" ");
|
|
82
|
+
});
|
|
83
|
+
return (t, k) => (p(), y("div", {
|
|
84
|
+
class: m(["flex items-center overflow-hidden", x.value])
|
|
85
|
+
}, [
|
|
86
|
+
c("div", ne, [
|
|
87
|
+
c("button", {
|
|
88
|
+
class: m(["px-xs py-2xs hover:bg-opacity-70 transition-all duration-200 ease-linear max-w-full", C.value]),
|
|
89
|
+
onClick: e
|
|
90
|
+
}, E(t.buttonText), 3)
|
|
91
|
+
]),
|
|
92
|
+
(p(), y("input", {
|
|
93
|
+
type: "file",
|
|
94
|
+
id: t.id,
|
|
95
|
+
ref_key: "inputRef",
|
|
96
|
+
ref: n,
|
|
97
|
+
class: m(["file:hidden w-full bg-transparent", [l.value]]),
|
|
98
|
+
required: t.isRequired,
|
|
99
|
+
accept: t.accept,
|
|
100
|
+
key: v.value,
|
|
101
|
+
onChange: s
|
|
102
|
+
}, null, 42, ie)),
|
|
103
|
+
t.displayClear ? (p(), y("div", {
|
|
104
|
+
key: 0,
|
|
105
|
+
class: "self-stretch my-3xs mr-3xs",
|
|
106
|
+
onClick: d
|
|
107
|
+
}, [
|
|
108
|
+
c("button", {
|
|
109
|
+
class: m(["px-xs py-2xs h-full flex items-center hover:bg-opacity-70 transition-all duration-200 ease-linear", [w.value]]),
|
|
110
|
+
"aria-label": "clear"
|
|
111
|
+
}, [
|
|
112
|
+
(p(), y("svg", {
|
|
113
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
114
|
+
viewBox: "0 0 384 512",
|
|
115
|
+
class: m(["h-xs", L(o)("SVGFILL", t.buttonTextColor)])
|
|
116
|
+
}, ue, 2))
|
|
117
|
+
], 2)
|
|
118
|
+
])) : F("", !0)
|
|
119
|
+
], 2));
|
|
120
|
+
}
|
|
121
|
+
}), ce = { class: "flex items-center" }, pe = ["id", "value", "checked"], Fe = /* @__PURE__ */ R({
|
|
122
|
+
__name: "MclInputRadio",
|
|
123
|
+
props: {
|
|
124
|
+
id: {},
|
|
125
|
+
radioSize: { default: "md" },
|
|
126
|
+
bgColor: { default: "success" },
|
|
127
|
+
checkedColor: { default: "light-1" },
|
|
128
|
+
displayShadow: { type: Boolean, default: !1 },
|
|
129
|
+
value: { default: "" },
|
|
130
|
+
checked: { type: Boolean, default: !1 }
|
|
131
|
+
},
|
|
132
|
+
emits: ["change"],
|
|
133
|
+
setup(u, { emit: f }) {
|
|
134
|
+
const r = u, i = B(), n = f, v = () => {
|
|
135
|
+
var l;
|
|
136
|
+
(l = i.value) == null || l.click();
|
|
137
|
+
}, e = h(() => {
|
|
138
|
+
const { radioSize: l } = r;
|
|
139
|
+
return l === "sm" ? "h-xs w-xs" : l === "lg" ? "h-md w-md" : "h-sm w-sm";
|
|
140
|
+
}), s = h(() => {
|
|
141
|
+
const { radioSize: l } = r;
|
|
142
|
+
return l === "sm" ? "peer-checked:before:h-2xs peer-checked:before:w-2xs" : l === "lg" ? "peer-checked:before:h-xs peer-checked:before:w-xs" : "peer-checked:before:h-[12px] peer-checked:before:w-[12px]";
|
|
143
|
+
}), d = h(() => {
|
|
144
|
+
const { bgColor: l, checkedColor: C, displayShadow: w } = r, t = [
|
|
145
|
+
o("BGCOLOR", l),
|
|
146
|
+
o("BEFOREBG", C)
|
|
147
|
+
];
|
|
148
|
+
return w && t.push("drop-shadow-md"), t.join(" ");
|
|
149
|
+
}), x = (l) => {
|
|
150
|
+
const C = l.target.value;
|
|
151
|
+
n("change", l, C);
|
|
152
|
+
};
|
|
153
|
+
return (l, C) => (p(), y("div", ce, [
|
|
154
|
+
c("input", {
|
|
155
|
+
id: l.id,
|
|
156
|
+
type: "radio",
|
|
157
|
+
class: "appearance-none peer",
|
|
158
|
+
ref_key: "radioRef",
|
|
159
|
+
ref: i,
|
|
160
|
+
value: l.value,
|
|
161
|
+
checked: l.checked,
|
|
162
|
+
onChange: x
|
|
163
|
+
}, null, 40, pe),
|
|
164
|
+
c("span", {
|
|
165
|
+
class: m(["rounded-full inline-block relative before:absolute before:rounded-full before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2", [e.value, s.value, d.value]]),
|
|
166
|
+
onClick: v
|
|
167
|
+
}, null, 2)
|
|
168
|
+
]));
|
|
169
|
+
}
|
|
170
|
+
}), he = ["id"], fe = /* @__PURE__ */ R({
|
|
171
|
+
__name: "MclInputSwitch",
|
|
172
|
+
props: {
|
|
173
|
+
id: {},
|
|
174
|
+
sliderColor: { default: "light-1" },
|
|
175
|
+
onColor: { default: "success" },
|
|
176
|
+
offColor: { default: "dark-1" },
|
|
177
|
+
switchSize: { default: "md" },
|
|
178
|
+
rounded: { type: Boolean, default: !0 },
|
|
179
|
+
modelValue: { type: Boolean }
|
|
180
|
+
},
|
|
181
|
+
emits: ["update:modelValue"],
|
|
182
|
+
setup(u, { emit: f }) {
|
|
183
|
+
const r = u, i = f, n = B(), v = {
|
|
184
|
+
primary: "peer-checked/input:bg-primary",
|
|
185
|
+
secondary: "peer-checked/input:bg-secondary",
|
|
186
|
+
success: "peer-checked/input:bg-success",
|
|
187
|
+
info: "peer-checked/input:bg-info",
|
|
188
|
+
warning: "peer-checked/input:bg-warning",
|
|
189
|
+
danger: "peer-checked/input:bg-danger",
|
|
190
|
+
"light-1": "peer-checked/input:bg-light-1",
|
|
191
|
+
"light-2": "peer-checked/input:bg-light-2",
|
|
192
|
+
"light-3": "peer-checked/input:bg-light-3",
|
|
193
|
+
"light-4": "peer-checked/input:bg-light-4",
|
|
194
|
+
"dark-1": "peer-checked/input:bg-dark-1",
|
|
195
|
+
"dark-2": "peer-checked/input:bg-dark-2",
|
|
196
|
+
"dark-3": "peer-checked/input:bg-dark-3",
|
|
197
|
+
"dark-4": "peer-checked/input:bg-dark-1",
|
|
198
|
+
transparent: "peer-checked/input:bg-transparent",
|
|
199
|
+
black: "peer-checked/input:bg-black",
|
|
200
|
+
white: "peer-checked/input:bg-white"
|
|
201
|
+
}, e = () => {
|
|
202
|
+
var l;
|
|
203
|
+
(l = n.value) == null || l.click();
|
|
204
|
+
}, s = h({
|
|
205
|
+
get() {
|
|
206
|
+
return r.modelValue;
|
|
207
|
+
},
|
|
208
|
+
set(l) {
|
|
209
|
+
i("update:modelValue", l);
|
|
210
|
+
}
|
|
211
|
+
}), d = h(() => r.switchSize === "sm" ? {
|
|
212
|
+
"--switch-width": "30px",
|
|
213
|
+
"--switch-height": "17px",
|
|
214
|
+
"--slider-size": "13px",
|
|
215
|
+
"--gutter-size": "2px"
|
|
216
|
+
} : r.switchSize === "lg" ? {
|
|
217
|
+
"--switch-width": "60px",
|
|
218
|
+
"--switch-height": "34px",
|
|
219
|
+
"--slider-size": "26px",
|
|
220
|
+
"--gutter-size": "4px"
|
|
221
|
+
} : {
|
|
222
|
+
"--switch-width": "45px",
|
|
223
|
+
"--switch-height": "25.5px",
|
|
224
|
+
"--slider-size": "19.5px",
|
|
225
|
+
"--gutter-size": "3px"
|
|
226
|
+
}), x = h(() => {
|
|
227
|
+
const { sliderColor: l, onColor: C, offColor: w, rounded: t } = r, k = [
|
|
228
|
+
o("BGCOLOR", w),
|
|
229
|
+
o("BEFOREBG", l),
|
|
230
|
+
v[C]
|
|
231
|
+
];
|
|
232
|
+
return t && k.push("rounded-full before:rounded-full"), k.join(" ");
|
|
233
|
+
});
|
|
234
|
+
return (l, C) => (p(), y("div", {
|
|
235
|
+
class: "switch relative",
|
|
236
|
+
style: M(d.value),
|
|
237
|
+
onClick: e
|
|
238
|
+
}, [
|
|
239
|
+
I(c("input", {
|
|
240
|
+
id: l.id,
|
|
241
|
+
class: "hidden peer/input",
|
|
242
|
+
"onUpdate:modelValue": C[0] || (C[0] = (w) => s.value = w),
|
|
243
|
+
ref_key: "inputRef",
|
|
244
|
+
ref: n,
|
|
245
|
+
type: "checkbox"
|
|
246
|
+
}, null, 8, he), [
|
|
247
|
+
[W, s.value]
|
|
248
|
+
]),
|
|
249
|
+
c("span", {
|
|
250
|
+
class: m(["slider absolute inset-0 cursor-pointer transition-all duration-300 before:absolute before:transition-all before:duration-300", x.value])
|
|
251
|
+
}, null, 2)
|
|
252
|
+
], 4));
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
const j = (u, f) => {
|
|
256
|
+
const r = u.__vccOpts || u;
|
|
257
|
+
for (const [i, n] of f)
|
|
258
|
+
r[i] = n;
|
|
259
|
+
return r;
|
|
260
|
+
}, $e = /* @__PURE__ */ j(fe, [["__scopeId", "data-v-8df11a40"]]), q = /* @__PURE__ */ R({
|
|
261
|
+
__name: "InputHighlight",
|
|
262
|
+
props: {
|
|
263
|
+
color: { default: "primary" },
|
|
264
|
+
rounded: { type: Boolean, default: !1 },
|
|
265
|
+
offset: { default: 1 }
|
|
266
|
+
},
|
|
267
|
+
setup(u) {
|
|
268
|
+
const f = u, r = {
|
|
269
|
+
1: "-top-1",
|
|
270
|
+
2.5: "-top-2.5"
|
|
271
|
+
}, i = h(() => {
|
|
272
|
+
const n = [o("BEFOREBG", f.color)];
|
|
273
|
+
return f.rounded && n.push("rounded-b-md"), n.push(r[f.offset]), n.join(" ");
|
|
274
|
+
});
|
|
275
|
+
return (n, v) => (p(), y("div", {
|
|
276
|
+
class: m(["relative h-3xs overflow-hidden before:absolute before:bottom-0 before:left-0 before:h-full before:w-0 peer-focus:before:w-full before:transition-[width] before:duration-300 before:ease-linear", i.value])
|
|
277
|
+
}, null, 2));
|
|
278
|
+
}
|
|
279
|
+
}), ge = ["id", "type", "placeholder", "required", "minlength", "maxlength", "pattern"], me = { class: "peer-valid/validation:hidden peer-inavlid/validation:block ml-3xs" }, be = { class: "text-xs text-danger" }, Ee = /* @__PURE__ */ R({
|
|
280
|
+
__name: "MclInputText",
|
|
281
|
+
props: {
|
|
282
|
+
id: {},
|
|
283
|
+
displayBorder: { type: Boolean, default: !1 },
|
|
284
|
+
borderColor: { default: "light-4" },
|
|
285
|
+
rounded: { type: Boolean, default: !1 },
|
|
286
|
+
displayHighlight: { type: Boolean, default: !0 },
|
|
287
|
+
highlightColor: { default: "primary" },
|
|
288
|
+
textcolor: { default: "black" },
|
|
289
|
+
bgColor: { default: "light-1" },
|
|
290
|
+
placeholder: { default: "" },
|
|
291
|
+
type: { default: "text" },
|
|
292
|
+
displayShadow: { type: Boolean, default: !0 },
|
|
293
|
+
required: { type: Boolean, default: !1 },
|
|
294
|
+
modelValue: {},
|
|
295
|
+
invalidFeedback: {},
|
|
296
|
+
minLength: {},
|
|
297
|
+
maxLength: {},
|
|
298
|
+
pattern: {}
|
|
299
|
+
},
|
|
300
|
+
emits: ["update:modelValue"],
|
|
301
|
+
setup(u, { emit: f }) {
|
|
302
|
+
const r = u, i = f, n = h({
|
|
303
|
+
get() {
|
|
304
|
+
return r.modelValue;
|
|
305
|
+
},
|
|
306
|
+
set(e) {
|
|
307
|
+
i("update:modelValue", e);
|
|
308
|
+
}
|
|
309
|
+
}), v = h(() => {
|
|
310
|
+
const {
|
|
311
|
+
bgColor: e,
|
|
312
|
+
displayBorder: s,
|
|
313
|
+
borderColor: d,
|
|
314
|
+
displayHighlight: x,
|
|
315
|
+
displayShadow: l,
|
|
316
|
+
rounded: C,
|
|
317
|
+
textcolor: w
|
|
318
|
+
} = r, t = [
|
|
319
|
+
o("BGCOLOR", e),
|
|
320
|
+
o("TEXTCOLOR", w)
|
|
321
|
+
];
|
|
322
|
+
return s && (t.push("border-2"), t.push(o("BORDER", d))), x || (t.push(
|
|
323
|
+
"focus:ring-4 ring-offset-2 transition-all duration-300 ease-linear"
|
|
324
|
+
), t.push(o("FOCUSRING", d))), l && t.push("shadow-md"), C && t.push("rounded-md"), t.join(" ");
|
|
325
|
+
});
|
|
326
|
+
return (e, s) => (p(), y("div", null, [
|
|
327
|
+
I(c("input", {
|
|
328
|
+
id: e.id,
|
|
329
|
+
type: e.type,
|
|
330
|
+
class: m(["w-full p-2xs outline-none peer peer/validation", v.value]),
|
|
331
|
+
"onUpdate:modelValue": s[0] || (s[0] = (d) => n.value = d),
|
|
332
|
+
placeholder: e.placeholder,
|
|
333
|
+
required: e.required,
|
|
334
|
+
minlength: e.minLength,
|
|
335
|
+
maxlength: e.maxLength,
|
|
336
|
+
pattern: e.pattern
|
|
337
|
+
}, null, 10, ge), [
|
|
338
|
+
[Y, n.value]
|
|
339
|
+
]),
|
|
340
|
+
e.displayHighlight ? (p(), A(q, {
|
|
341
|
+
key: 0,
|
|
342
|
+
color: e.highlightColor,
|
|
343
|
+
rounded: e.rounded
|
|
344
|
+
}, null, 8, ["color", "rounded"])) : F("", !0),
|
|
345
|
+
c("div", me, [
|
|
346
|
+
z(e.$slots, "invalid-feedback", {}, () => [
|
|
347
|
+
c("span", be, E(e.invalidFeedback), 1)
|
|
348
|
+
])
|
|
349
|
+
])
|
|
350
|
+
]));
|
|
351
|
+
}
|
|
352
|
+
}), D = (u) => (le("data-v-aa593ff3"), u = u(), oe(), u), ye = ["id", "placeholder", "aria-expanded"], ve = /* @__PURE__ */ D(() => /* @__PURE__ */ c("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z" }, null, -1)), Ce = [
|
|
353
|
+
ve
|
|
354
|
+
], ke = /* @__PURE__ */ D(() => /* @__PURE__ */ c("path", { d: "M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z" }, null, -1)), we = [
|
|
355
|
+
ke
|
|
356
|
+
], xe = {
|
|
357
|
+
key: 0,
|
|
358
|
+
class: "absolute"
|
|
359
|
+
}, Be = ["onClick"], _e = /* @__PURE__ */ R({
|
|
360
|
+
__name: "MclSelect",
|
|
361
|
+
props: {
|
|
362
|
+
id: {},
|
|
363
|
+
displayBorder: { type: Boolean, default: !1 },
|
|
364
|
+
borderColor: { default: "light-4" },
|
|
365
|
+
rounded: { type: Boolean, default: !1 },
|
|
366
|
+
displayHighlight: { type: Boolean, default: !0 },
|
|
367
|
+
highlightColor: { default: "primary" },
|
|
368
|
+
textcolor: { default: "black" },
|
|
369
|
+
bgColor: { default: "light-1" },
|
|
370
|
+
iconColor: { default: "dark-4" },
|
|
371
|
+
placeholder: { default: "" },
|
|
372
|
+
displayShadow: { type: Boolean, default: !0 },
|
|
373
|
+
required: { type: Boolean, default: !1 },
|
|
374
|
+
options: {},
|
|
375
|
+
selectColor: { default: "primary" },
|
|
376
|
+
invalidFeedback: { default: "No match." },
|
|
377
|
+
modelValue: {}
|
|
378
|
+
},
|
|
379
|
+
emits: ["update:modelValue"],
|
|
380
|
+
setup(u, { emit: f }) {
|
|
381
|
+
const r = u, i = f, n = B(), v = B(), e = B(), s = B(!1), d = B(""), x = () => {
|
|
382
|
+
s.value = !0;
|
|
383
|
+
}, l = () => {
|
|
384
|
+
var a;
|
|
385
|
+
d.value = "", s.value = !1, (a = v.value) == null || a.blur(), i("update:modelValue", "");
|
|
386
|
+
}, C = () => {
|
|
387
|
+
s.value = !1;
|
|
388
|
+
}, w = () => {
|
|
389
|
+
var a;
|
|
390
|
+
s.value = !s.value, s.value === !0 && ((a = v.value) == null || a.focus());
|
|
391
|
+
}, t = (a) => {
|
|
392
|
+
a.preventDefault(), d.value !== "" && (d.value = ""), i("update:modelValue", "");
|
|
393
|
+
}, k = (a, g) => {
|
|
394
|
+
a.preventDefault(), d.value = typeof g == "string" ? g : g.text;
|
|
395
|
+
const b = typeof g == "string" ? g : g.value;
|
|
396
|
+
i("update:modelValue", b), s.value = !1;
|
|
397
|
+
}, _ = h(() => {
|
|
398
|
+
const {
|
|
399
|
+
bgColor: a,
|
|
400
|
+
displayBorder: g,
|
|
401
|
+
borderColor: b,
|
|
402
|
+
displayHighlight: $,
|
|
403
|
+
displayShadow: S,
|
|
404
|
+
rounded: U,
|
|
405
|
+
textcolor: X
|
|
406
|
+
} = r, T = [
|
|
407
|
+
o("BGCOLOR", a),
|
|
408
|
+
o("TEXTCOLOR", X)
|
|
409
|
+
];
|
|
410
|
+
return g && (T.push("border-2"), T.push(o("BORDER", b))), $ || T.push("ring-offset-2 transition-all duration-300 ease-linear"), S && T.push("shadow-md"), U && T.push("rounded-md"), T.join(" ");
|
|
411
|
+
}), V = (a, g) => {
|
|
412
|
+
const b = [o("BEFOREBG", a)];
|
|
413
|
+
return g && b.push("rounded-b-md"), b.join(" ");
|
|
414
|
+
}, G = h(() => {
|
|
415
|
+
const { displayHighlight: a, bgColor: g, borderColor: b, rounded: $ } = r, S = [
|
|
416
|
+
o("BGCOLOR", g),
|
|
417
|
+
o("BORDER", b)
|
|
418
|
+
];
|
|
419
|
+
return a || S.push("mt-2xs"), $ && S.push("rounded-md"), S.join(" ");
|
|
420
|
+
}), O = h(() => d.value === "" ? r.options : r.options.filter((g) => {
|
|
421
|
+
const b = new RegExp(`${d.value}`, "gi");
|
|
422
|
+
return typeof g == "string" ? g.match(b) : g.text.match(b);
|
|
423
|
+
})), N = h(() => ({ width: `${e.value}px` }));
|
|
424
|
+
return ae(n, () => {
|
|
425
|
+
n.value && (e.value = n.value.clientWidth);
|
|
426
|
+
}), (a, g) => I((p(), y("div", {
|
|
427
|
+
onKeyup: J(l, ["esc"]),
|
|
428
|
+
ref_key: "componentRef",
|
|
429
|
+
ref: n
|
|
430
|
+
}, [
|
|
431
|
+
c("div", {
|
|
432
|
+
class: m(["p-2xs flex relative gap-3xs", [
|
|
433
|
+
!a.displayHighlight && s.value && L(o)("RINGCOLOR", a.borderColor) + " ring-4",
|
|
434
|
+
_.value
|
|
435
|
+
]])
|
|
436
|
+
}, [
|
|
437
|
+
I(c("input", {
|
|
438
|
+
id: a.id,
|
|
439
|
+
type: "text",
|
|
440
|
+
class: "w-full bg-transparent outline-none",
|
|
441
|
+
"onUpdate:modelValue": g[0] || (g[0] = (b) => d.value = b),
|
|
442
|
+
ref_key: "inputBox",
|
|
443
|
+
ref: v,
|
|
444
|
+
role: "combobox",
|
|
445
|
+
placeholder: a.placeholder,
|
|
446
|
+
"aria-autocomplete": "list",
|
|
447
|
+
"aria-expanded": s.value,
|
|
448
|
+
onFocus: x
|
|
449
|
+
}, null, 40, ye), [
|
|
450
|
+
[H, d.value]
|
|
451
|
+
]),
|
|
452
|
+
c("div", {
|
|
453
|
+
class: m(["flex items-center px-3xs", [
|
|
454
|
+
d.value === "" ? "hidden cursor-text" : "block cursor-pointer"
|
|
455
|
+
]]),
|
|
456
|
+
onClick: t
|
|
457
|
+
}, [
|
|
458
|
+
(p(), y("svg", {
|
|
459
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
460
|
+
viewBox: "0 0 384 512",
|
|
461
|
+
class: m(["h-xs opacity-70", [L(o)("SVGFILL", a.iconColor)]])
|
|
462
|
+
}, Ce, 2))
|
|
463
|
+
], 2),
|
|
464
|
+
c("div", {
|
|
465
|
+
class: "flex items-center px-3xs",
|
|
466
|
+
onClick: w
|
|
467
|
+
}, [
|
|
468
|
+
(p(), y("svg", {
|
|
469
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
470
|
+
viewBox: "0 0 320 512",
|
|
471
|
+
class: m(["h-xs", [
|
|
472
|
+
s.value ? "rotate-180" : "rotate-0",
|
|
473
|
+
"transition-transform duration-300 ease-in",
|
|
474
|
+
L(o)("SVGFILL", a.iconColor)
|
|
475
|
+
]])
|
|
476
|
+
}, we, 2))
|
|
477
|
+
])
|
|
478
|
+
], 2),
|
|
479
|
+
a.displayHighlight ? (p(), y("div", {
|
|
480
|
+
key: 0,
|
|
481
|
+
class: m(["relative h-3xs overflow-hidden before:absolute before:bottom-0 before:left-0 before:h-full before:w-0 before:transition-[width] before:duration-300 before:ease-linear -top-1", [
|
|
482
|
+
s.value ? "before:w-full" : "before:w-0",
|
|
483
|
+
V(a.highlightColor, a.rounded)
|
|
484
|
+
]])
|
|
485
|
+
}, null, 2)) : F("", !0),
|
|
486
|
+
P(Q, { name: "options" }, {
|
|
487
|
+
default: Z(() => [
|
|
488
|
+
s.value ? (p(), y("div", xe, [
|
|
489
|
+
c("ul", {
|
|
490
|
+
class: m([[G.value], "max-h-[200px] overflow-y-auto border-2"]),
|
|
491
|
+
style: M(N.value),
|
|
492
|
+
role: "listbox"
|
|
493
|
+
}, [
|
|
494
|
+
(p(!0), y(ee, null, te(O.value, (b, $) => (p(), y("li", {
|
|
495
|
+
key: $,
|
|
496
|
+
class: m(["p-2xs cursor-pointer", [L(o)("HVBGCOLOR", a.highlightColor)]]),
|
|
497
|
+
role: "option",
|
|
498
|
+
onClick: (S) => k(S, b)
|
|
499
|
+
}, E(typeof b == "string" ? b : b.text), 11, Be))), 128)),
|
|
500
|
+
d.value !== "" && O.value.length === 0 ? (p(), y("li", {
|
|
501
|
+
key: 0,
|
|
502
|
+
class: m(["p-2xs cursor-pointer", [L(o)("HVBGCOLOR", a.selectColor)]])
|
|
503
|
+
}, [
|
|
504
|
+
z(a.$slots, "no-match", {}, () => [
|
|
505
|
+
c("span", null, E(a.invalidFeedback), 1)
|
|
506
|
+
], !0)
|
|
507
|
+
], 2)) : F("", !0)
|
|
508
|
+
], 6)
|
|
509
|
+
])) : F("", !0)
|
|
510
|
+
]),
|
|
511
|
+
_: 3
|
|
512
|
+
})
|
|
513
|
+
], 32)), [
|
|
514
|
+
[L(re), C]
|
|
515
|
+
]);
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
const Ie = /* @__PURE__ */ j(_e, [["__scopeId", "data-v-aa593ff3"]]), Oe = ["id", "placeholder", "required", "rows"], ze = /* @__PURE__ */ R({
|
|
519
|
+
__name: "MclTextArea",
|
|
520
|
+
props: {
|
|
521
|
+
id: {},
|
|
522
|
+
displayBorder: { type: Boolean, default: !1 },
|
|
523
|
+
borderColor: { default: "light-4" },
|
|
524
|
+
rounded: { type: Boolean, default: !1 },
|
|
525
|
+
displayHighlight: { type: Boolean, default: !0 },
|
|
526
|
+
highlightColor: { default: "primary" },
|
|
527
|
+
bgColor: { default: "light-1" },
|
|
528
|
+
textcolor: { default: "black" },
|
|
529
|
+
placeholder: { default: "" },
|
|
530
|
+
displayShadow: { type: Boolean, default: !0 },
|
|
531
|
+
required: { type: Boolean, default: !1 },
|
|
532
|
+
rows: { default: 5 },
|
|
533
|
+
modelValue: {}
|
|
534
|
+
},
|
|
535
|
+
emits: ["update:modelValue"],
|
|
536
|
+
setup(u, { emit: f }) {
|
|
537
|
+
const r = u, i = f, n = h({
|
|
538
|
+
get() {
|
|
539
|
+
return r.modelValue;
|
|
540
|
+
},
|
|
541
|
+
set(e) {
|
|
542
|
+
i("update:modelValue", e);
|
|
543
|
+
}
|
|
544
|
+
}), v = h(() => {
|
|
545
|
+
const {
|
|
546
|
+
bgColor: e,
|
|
547
|
+
displayBorder: s,
|
|
548
|
+
borderColor: d,
|
|
549
|
+
displayHighlight: x,
|
|
550
|
+
displayShadow: l,
|
|
551
|
+
rounded: C,
|
|
552
|
+
textcolor: w
|
|
553
|
+
} = r, t = [
|
|
554
|
+
o("BGCOLOR", e),
|
|
555
|
+
o("TEXTCOLOR", w)
|
|
556
|
+
];
|
|
557
|
+
return s && (t.push("border-2"), t.push(o("BORDER", d))), x || (t.push(
|
|
558
|
+
"focus:ring-4 ring-offset-2 transition-all duration-300 ease-linear"
|
|
559
|
+
), t.push(o("FOCUSRING", d))), l && t.push("shadow-md"), C && t.push("rounded-md"), t.join(" ");
|
|
560
|
+
});
|
|
561
|
+
return (e, s) => (p(), y("div", null, [
|
|
562
|
+
I(c("textarea", {
|
|
563
|
+
id: e.id,
|
|
564
|
+
class: m(["w-full p-2xs outline-none input__text peer", v.value]),
|
|
565
|
+
"onUpdate:modelValue": s[0] || (s[0] = (d) => n.value = d),
|
|
566
|
+
placeholder: e.placeholder,
|
|
567
|
+
required: e.required,
|
|
568
|
+
rows: e.rows
|
|
569
|
+
}, null, 10, Oe), [
|
|
570
|
+
[H, n.value]
|
|
571
|
+
]),
|
|
572
|
+
e.displayHighlight ? (p(), A(q, {
|
|
573
|
+
key: 0,
|
|
574
|
+
color: e.highlightColor,
|
|
575
|
+
rounded: e.rounded,
|
|
576
|
+
offset: 2.5
|
|
577
|
+
}, null, 8, ["color", "rounded"])) : F("", !0)
|
|
578
|
+
]));
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
export {
|
|
582
|
+
Ve as MclFormGroup,
|
|
583
|
+
Te as MclInputFile,
|
|
584
|
+
Fe as MclInputRadio,
|
|
585
|
+
$e as MclInputSwitch,
|
|
586
|
+
Ee as MclInputText,
|
|
587
|
+
Ie as MclSelect,
|
|
588
|
+
ze as MclTextArea
|
|
589
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.switch[data-v-8df11a40]{width:var(--switch-width);height:var(--switch-height)}.slider[data-v-8df11a40]:before{content:"";height:var(--slider-size);width:var(--slider-size);left:var(--gutter-size);bottom:var(--gutter-size)}input:checked+.slider[data-v-8df11a40]:before{transform:translate(var(--slider-size))}.options-enter-active[data-v-aa593ff3],.options-leave-active[data-v-aa593ff3]{opacity:1;transition:all .3s}.options-enter-from[data-v-aa593ff3],.options-leave-to[data-v-aa593ff3]{opacity:0;transform:translateY(-10px)}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(b,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):(b=typeof globalThis<"u"?globalThis:b||self,e(b.MclForms={},b.Vue,b.ManguitoTheme,b.core))})(this,function(b,e,l,L){"use strict";const N=["for"],T=e.defineComponent({__name:"MclFormGroup",props:{labelFor:{},textColor:{default:"dark-3"},textSize:{default:"md"},textBold:{type:Boolean,default:!1},label:{}},setup(p){const u=p;e.useSlots();const n=e.computed(()=>{const{textColor:d,textSize:s,textBold:m}=u,o=[l("TEXTCOLOR",d),l("BODYTEXT",s)];return m&&o.push("font-bold"),o.join(" ")});return(d,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("label",{for:d.labelFor,class:"inline-block"},[e.renderSlot(d.$slots,"label",{},()=>[e.createElementVNode("p",{class:e.normalizeClass(["mb-2xs",n.value])},e.toDisplayString(d.label),3)])],8,N),e.renderSlot(d.$slots,"default")]))}}),M={class:"shrink-0 my-3xs ml-3xs mr-xs"},F=["id","required","accept"],$=[e.createElementVNode("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"},null,-1)],I=e.defineComponent({__name:"MclInputFile",props:{id:{},displayBorder:{type:Boolean,default:!1},borderColor:{default:"light-4"},rounded:{type:Boolean,default:!1},bgColor:{default:"light-1"},buttonText:{default:"Browse File"},buttonTextColor:{default:"dark-3"},buttonColor:{default:"light-4"},displayShadow:{type:Boolean,default:!0},textColor:{default:"black"},displayClear:{type:Boolean,default:!1},isRequired:{type:Boolean,default:!1},accept:{default:"image/jpg,image/jpeg,image/png"},modelValue:{}},emits:["update:modelValue"],setup(p,{emit:u}){const n=p,d=u,s=e.ref(),m=e.ref(0),o=()=>{s.value.click()},i=t=>{const y=t.target.files[0];d("update:modelValue",y)},c=()=>{d("update:modelValue",null),m.value++},B=e.computed(()=>{const{rounded:t,displayBorder:y,borderColor:C,displayShadow:_,bgColor:O}=n,w=[l("BGCOLOR",O)];return t&&w.push("rounded-md"),y&&(w.push("border-2"),w.push(l("BORDER",C))),_&&w.push("shadow-md"),w.join(" ")}),r=e.computed(()=>{const{textColor:t}=n;return[l("TEXTCOLOR",t)].join(" ")}),g=e.computed(()=>{const{buttonColor:t,buttonTextColor:y,rounded:C}=n,_=[l("BGCOLOR",t),l("TEXTCOLOR",y)];return C&&_.push("rounded-l-md"),_.join(" ")}),k=e.computed(()=>{const{buttonColor:t,rounded:y}=n,C=[l("BGCOLOR",t)];return y&&C.push("rounded-r-md"),C.join(" ")});return(t,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center overflow-hidden",B.value])},[e.createElementVNode("div",M,[e.createElementVNode("button",{class:e.normalizeClass(["px-xs py-2xs hover:bg-opacity-70 transition-all duration-200 ease-linear max-w-full",g.value]),onClick:o},e.toDisplayString(t.buttonText),3)]),(e.openBlock(),e.createElementBlock("input",{type:"file",id:t.id,ref_key:"inputRef",ref:s,class:e.normalizeClass(["file:hidden w-full bg-transparent",[r.value]]),required:t.isRequired,accept:t.accept,key:m.value,onChange:i},null,42,F)),t.displayClear?(e.openBlock(),e.createElementBlock("div",{key:0,class:"self-stretch my-3xs mr-3xs",onClick:c},[e.createElementVNode("button",{class:e.normalizeClass(["px-xs py-2xs h-full flex items-center hover:bg-opacity-70 transition-all duration-200 ease-linear",[k.value]]),"aria-label":"clear"},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",class:e.normalizeClass(["h-xs",e.unref(l)("SVGFILL",t.buttonTextColor)])},$,2))],2)])):e.createCommentVNode("",!0)],2))}}),G={class:"flex items-center"},D=["id","value","checked"],j=e.defineComponent({__name:"MclInputRadio",props:{id:{},radioSize:{default:"md"},bgColor:{default:"success"},checkedColor:{default:"light-1"},displayShadow:{type:Boolean,default:!1},value:{default:""},checked:{type:Boolean,default:!1}},emits:["change"],setup(p,{emit:u}){const n=p,d=e.ref(),s=u,m=()=>{var r;(r=d.value)==null||r.click()},o=e.computed(()=>{const{radioSize:r}=n;return r==="sm"?"h-xs w-xs":r==="lg"?"h-md w-md":"h-sm w-sm"}),i=e.computed(()=>{const{radioSize:r}=n;return r==="sm"?"peer-checked:before:h-2xs peer-checked:before:w-2xs":r==="lg"?"peer-checked:before:h-xs peer-checked:before:w-xs":"peer-checked:before:h-[12px] peer-checked:before:w-[12px]"}),c=e.computed(()=>{const{bgColor:r,checkedColor:g,displayShadow:k}=n,t=[l("BGCOLOR",r),l("BEFOREBG",g)];return k&&t.push("drop-shadow-md"),t.join(" ")}),B=r=>{const g=r.target.value;s("change",r,g)};return(r,g)=>(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("input",{id:r.id,type:"radio",class:"appearance-none peer",ref_key:"radioRef",ref:d,value:r.value,checked:r.checked,onChange:B},null,40,D),e.createElementVNode("span",{class:e.normalizeClass(["rounded-full inline-block relative before:absolute before:rounded-full before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2",[o.value,i.value,c.value]]),onClick:m},null,2)]))}}),q=["id"],A=e.defineComponent({__name:"MclInputSwitch",props:{id:{},sliderColor:{default:"light-1"},onColor:{default:"success"},offColor:{default:"dark-1"},switchSize:{default:"md"},rounded:{type:Boolean,default:!0},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(p,{emit:u}){const n=p,d=u,s=e.ref(),m={primary:"peer-checked/input:bg-primary",secondary:"peer-checked/input:bg-secondary",success:"peer-checked/input:bg-success",info:"peer-checked/input:bg-info",warning:"peer-checked/input:bg-warning",danger:"peer-checked/input:bg-danger","light-1":"peer-checked/input:bg-light-1","light-2":"peer-checked/input:bg-light-2","light-3":"peer-checked/input:bg-light-3","light-4":"peer-checked/input:bg-light-4","dark-1":"peer-checked/input:bg-dark-1","dark-2":"peer-checked/input:bg-dark-2","dark-3":"peer-checked/input:bg-dark-3","dark-4":"peer-checked/input:bg-dark-1",transparent:"peer-checked/input:bg-transparent",black:"peer-checked/input:bg-black",white:"peer-checked/input:bg-white"},o=()=>{var r;(r=s.value)==null||r.click()},i=e.computed({get(){return n.modelValue},set(r){d("update:modelValue",r)}}),c=e.computed(()=>n.switchSize==="sm"?{"--switch-width":"30px","--switch-height":"17px","--slider-size":"13px","--gutter-size":"2px"}:n.switchSize==="lg"?{"--switch-width":"60px","--switch-height":"34px","--slider-size":"26px","--gutter-size":"4px"}:{"--switch-width":"45px","--switch-height":"25.5px","--slider-size":"19.5px","--gutter-size":"3px"}),B=e.computed(()=>{const{sliderColor:r,onColor:g,offColor:k,rounded:t}=n,y=[l("BGCOLOR",k),l("BEFOREBG",r),m[g]];return t&&y.push("rounded-full before:rounded-full"),y.join(" ")});return(r,g)=>(e.openBlock(),e.createElementBlock("div",{class:"switch relative",style:e.normalizeStyle(c.value),onClick:o},[e.withDirectives(e.createElementVNode("input",{id:r.id,class:"hidden peer/input","onUpdate:modelValue":g[0]||(g[0]=k=>i.value=k),ref_key:"inputRef",ref:s,type:"checkbox"},null,8,q),[[e.vModelCheckbox,i.value]]),e.createElementVNode("span",{class:e.normalizeClass(["slider absolute inset-0 cursor-pointer transition-all duration-300 before:absolute before:transition-all before:duration-300",B.value])},null,2)],4))}}),ie="",S=(p,u)=>{const n=p.__vccOpts||p;for(const[d,s]of u)n[d]=s;return n},H=S(A,[["__scopeId","data-v-8df11a40"]]),R=e.defineComponent({__name:"InputHighlight",props:{color:{default:"primary"},rounded:{type:Boolean,default:!1},offset:{default:1}},setup(p){const u=p,n={1:"-top-1",2.5:"-top-2.5"},d=e.computed(()=>{const s=[l("BEFOREBG",u.color)];return u.rounded&&s.push("rounded-b-md"),s.push(n[u.offset]),s.join(" ")});return(s,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative h-3xs overflow-hidden before:absolute before:bottom-0 before:left-0 before:h-full before:w-0 peer-focus:before:w-full before:transition-[width] before:duration-300 before:ease-linear",d.value])},null,2))}}),U=["id","type","placeholder","required","minlength","maxlength","pattern"],X={class:"peer-valid/validation:hidden peer-inavlid/validation:block ml-3xs"},K={class:"text-xs text-danger"},W=e.defineComponent({__name:"MclInputText",props:{id:{},displayBorder:{type:Boolean,default:!1},borderColor:{default:"light-4"},rounded:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},textcolor:{default:"black"},bgColor:{default:"light-1"},placeholder:{default:""},type:{default:"text"},displayShadow:{type:Boolean,default:!0},required:{type:Boolean,default:!1},modelValue:{},invalidFeedback:{},minLength:{},maxLength:{},pattern:{}},emits:["update:modelValue"],setup(p,{emit:u}){const n=p,d=u,s=e.computed({get(){return n.modelValue},set(o){d("update:modelValue",o)}}),m=e.computed(()=>{const{bgColor:o,displayBorder:i,borderColor:c,displayHighlight:B,displayShadow:r,rounded:g,textcolor:k}=n,t=[l("BGCOLOR",o),l("TEXTCOLOR",k)];return i&&(t.push("border-2"),t.push(l("BORDER",c))),B||(t.push("focus:ring-4 ring-offset-2 transition-all duration-300 ease-linear"),t.push(l("FOCUSRING",c))),r&&t.push("shadow-md"),g&&t.push("rounded-md"),t.join(" ")});return(o,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("input",{id:o.id,type:o.type,class:e.normalizeClass(["w-full p-2xs outline-none peer peer/validation",m.value]),"onUpdate:modelValue":i[0]||(i[0]=c=>s.value=c),placeholder:o.placeholder,required:o.required,minlength:o.minLength,maxlength:o.maxLength,pattern:o.pattern},null,10,U),[[e.vModelDynamic,s.value]]),o.displayHighlight?(e.openBlock(),e.createBlock(R,{key:0,color:o.highlightColor,rounded:o.rounded},null,8,["color","rounded"])):e.createCommentVNode("",!0),e.createElementVNode("div",X,[e.renderSlot(o.$slots,"invalid-feedback",{},()=>[e.createElementVNode("span",K,e.toDisplayString(o.invalidFeedback),1)])])]))}}),z=p=>(e.pushScopeId("data-v-aa593ff3"),p=p(),e.popScopeId(),p),P=["id","placeholder","aria-expanded"],Y=[z(()=>e.createElementVNode("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"},null,-1))],J=[z(()=>e.createElementVNode("path",{d:"M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"},null,-1))],Q={key:0,class:"absolute"},Z=["onClick"],v=e.defineComponent({__name:"MclSelect",props:{id:{},displayBorder:{type:Boolean,default:!1},borderColor:{default:"light-4"},rounded:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},textcolor:{default:"black"},bgColor:{default:"light-1"},iconColor:{default:"dark-4"},placeholder:{default:""},displayShadow:{type:Boolean,default:!0},required:{type:Boolean,default:!1},options:{},selectColor:{default:"primary"},invalidFeedback:{default:"No match."},modelValue:{}},emits:["update:modelValue"],setup(p,{emit:u}){const n=p,d=u,s=e.ref(),m=e.ref(),o=e.ref(),i=e.ref(!1),c=e.ref(""),B=()=>{i.value=!0},r=()=>{var a;c.value="",i.value=!1,(a=m.value)==null||a.blur(),d("update:modelValue","")},g=()=>{i.value=!1},k=()=>{var a;i.value=!i.value,i.value===!0&&((a=m.value)==null||a.focus())},t=a=>{a.preventDefault(),c.value!==""&&(c.value=""),d("update:modelValue","")},y=(a,f)=>{a.preventDefault(),c.value=typeof f=="string"?f:f.text;const h=typeof f=="string"?f:f.value;d("update:modelValue",h),i.value=!1},C=e.computed(()=>{const{bgColor:a,displayBorder:f,borderColor:h,displayHighlight:E,displayShadow:x,rounded:re,textcolor:ne}=n,V=[l("BGCOLOR",a),l("TEXTCOLOR",ne)];return f&&(V.push("border-2"),V.push(l("BORDER",h))),E||V.push("ring-offset-2 transition-all duration-300 ease-linear"),x&&V.push("shadow-md"),re&&V.push("rounded-md"),V.join(" ")}),_=(a,f)=>{const h=[l("BEFOREBG",a)];return f&&h.push("rounded-b-md"),h.join(" ")},O=e.computed(()=>{const{displayHighlight:a,bgColor:f,borderColor:h,rounded:E}=n,x=[l("BGCOLOR",f),l("BORDER",h)];return a||x.push("mt-2xs"),E&&x.push("rounded-md"),x.join(" ")}),w=e.computed(()=>c.value===""?n.options:n.options.filter(f=>{const h=new RegExp(`${c.value}`,"gi");return typeof f=="string"?f.match(h):f.text.match(h)})),le=e.computed(()=>({width:`${o.value}px`}));return L.useResizeObserver(s,()=>{s.value&&(o.value=s.value.clientWidth)}),(a,f)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{onKeyup:e.withKeys(r,["esc"]),ref_key:"componentRef",ref:s},[e.createElementVNode("div",{class:e.normalizeClass(["p-2xs flex relative gap-3xs",[!a.displayHighlight&&i.value&&e.unref(l)("RINGCOLOR",a.borderColor)+" ring-4",C.value]])},[e.withDirectives(e.createElementVNode("input",{id:a.id,type:"text",class:"w-full bg-transparent outline-none","onUpdate:modelValue":f[0]||(f[0]=h=>c.value=h),ref_key:"inputBox",ref:m,role:"combobox",placeholder:a.placeholder,"aria-autocomplete":"list","aria-expanded":i.value,onFocus:B},null,40,P),[[e.vModelText,c.value]]),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center px-3xs",[c.value===""?"hidden cursor-text":"block cursor-pointer"]]),onClick:t},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",class:e.normalizeClass(["h-xs opacity-70",[e.unref(l)("SVGFILL",a.iconColor)]])},Y,2))],2),e.createElementVNode("div",{class:"flex items-center px-3xs",onClick:k},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",class:e.normalizeClass(["h-xs",[i.value?"rotate-180":"rotate-0","transition-transform duration-300 ease-in",e.unref(l)("SVGFILL",a.iconColor)]])},J,2))])],2),a.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["relative h-3xs overflow-hidden before:absolute before:bottom-0 before:left-0 before:h-full before:w-0 before:transition-[width] before:duration-300 before:ease-linear -top-1",[i.value?"before:w-full":"before:w-0",_(a.highlightColor,a.rounded)]])},null,2)):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"options"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",Q,[e.createElementVNode("ul",{class:e.normalizeClass([[O.value],"max-h-[200px] overflow-y-auto border-2"]),style:e.normalizeStyle(le.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(h,E)=>(e.openBlock(),e.createElementBlock("li",{key:E,class:e.normalizeClass(["p-2xs cursor-pointer",[e.unref(l)("HVBGCOLOR",a.highlightColor)]]),role:"option",onClick:x=>y(x,h)},e.toDisplayString(typeof h=="string"?h:h.text),11,Z))),128)),c.value!==""&&w.value.length===0?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass(["p-2xs cursor-pointer",[e.unref(l)("HVBGCOLOR",a.selectColor)]])},[e.renderSlot(a.$slots,"no-match",{},()=>[e.createElementVNode("span",null,e.toDisplayString(a.invalidFeedback),1)],!0)],2)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]),_:3})],32)),[[e.unref(l.vClickOutside),g]])}}),ce="",ee=S(v,[["__scopeId","data-v-aa593ff3"]]),oe=["id","placeholder","required","rows"],te=e.defineComponent({__name:"MclTextArea",props:{id:{},displayBorder:{type:Boolean,default:!1},borderColor:{default:"light-4"},rounded:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},bgColor:{default:"light-1"},textcolor:{default:"black"},placeholder:{default:""},displayShadow:{type:Boolean,default:!0},required:{type:Boolean,default:!1},rows:{default:5},modelValue:{}},emits:["update:modelValue"],setup(p,{emit:u}){const n=p,d=u,s=e.computed({get(){return n.modelValue},set(o){d("update:modelValue",o)}}),m=e.computed(()=>{const{bgColor:o,displayBorder:i,borderColor:c,displayHighlight:B,displayShadow:r,rounded:g,textcolor:k}=n,t=[l("BGCOLOR",o),l("TEXTCOLOR",k)];return i&&(t.push("border-2"),t.push(l("BORDER",c))),B||(t.push("focus:ring-4 ring-offset-2 transition-all duration-300 ease-linear"),t.push(l("FOCUSRING",c))),r&&t.push("shadow-md"),g&&t.push("rounded-md"),t.join(" ")});return(o,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{id:o.id,class:e.normalizeClass(["w-full p-2xs outline-none input__text peer",m.value]),"onUpdate:modelValue":i[0]||(i[0]=c=>s.value=c),placeholder:o.placeholder,required:o.required,rows:o.rows},null,10,oe),[[e.vModelText,s.value]]),o.displayHighlight?(e.openBlock(),e.createBlock(R,{key:0,color:o.highlightColor,rounded:o.rounded,offset:2.5},null,8,["color","rounded"])):e.createCommentVNode("",!0)]))}});b.MclFormGroup=T,b.MclInputFile=I,b.MclInputRadio=j,b.MclInputSwitch=H,b.MclInputText=W,b.MclSelect=ee,b.MclTextArea=te,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|