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