vlite3 0.1.10 → 0.2.2
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 +226 -150
- package/components/Button.vue.js +1 -1
- package/components/Chip/Chip.vue.js +15 -15
- package/components/DataTable/DataTable.vue.js +2 -2
- package/components/DataTable/DataTable.vue2.js +41 -39
- package/components/DataTable/types.d.ts +1 -0
- package/components/DatePicker.vue.d.ts +12 -3
- package/components/DatePicker.vue.js +80 -39
- package/components/Dropdown/DropdownMenu.vue.js +48 -47
- package/components/Form/Form.vue.d.ts +2 -0
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +104 -101
- package/components/Form/FormField.vue.d.ts +4 -0
- package/components/Form/FormField.vue.js +248 -148
- package/components/Form/FormFields.vue.d.ts +2 -0
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +45 -39
- package/components/Form/types.d.ts +24 -4
- package/components/Form/utils/form.utils.d.ts +5 -1
- package/components/Form/utils/form.utils.js +69 -60
- package/components/GoogleLogin.vue.d.ts +41 -0
- package/components/GoogleLogin.vue.js +60 -0
- package/components/GoogleLogin.vue2.js +4 -0
- package/components/Input.vue.js +120 -111
- package/components/NumberInput.vue.d.ts +38 -0
- package/components/NumberInput.vue.js +7 -0
- package/components/NumberInput.vue2.js +191 -0
- package/components/Pagination/Pagination.vue.d.ts +1 -0
- package/components/Pagination/Pagination.vue.js +60 -46
- package/components/ProgressBar/ProgressBar.vue.d.ts +12 -0
- package/components/ProgressBar/ProgressBar.vue.js +7 -0
- package/components/ProgressBar/ProgressBar.vue2.js +158 -0
- package/components/ProgressBar/index.d.ts +3 -0
- package/components/Spinner/Spinner.vue.d.ts +8 -0
- package/components/Spinner/Spinner.vue.js +89 -0
- package/components/Spinner/Spinner.vue2.js +4 -0
- package/components/Spinner/index.d.ts +2 -0
- package/components/Spinner/types.d.ts +9 -0
- package/components/Tabes/Tabes.vue.d.ts +3 -1
- package/components/Tabes/Tabes.vue.js +103 -44
- package/directives/vScrollReveal.d.ts +2 -0
- package/directives/vScrollReveal.js +48 -0
- package/index.d.ts +8 -0
- package/index.js +180 -147
- package/package.json +6 -3
- package/style.css +56 -4
- package/types/form.type.d.ts +2 -2
- package/types/progressbar.d.ts +75 -0
- package/utils/env.d.ts +14 -0
- package/utils/env.js +4 -0
- package/utils/functions.d.ts +99 -0
- package/utils/functions.js +91 -7
- package/utils/index.d.ts +2 -0
- package/utils/search.util.d.ts +127 -0
- package/utils/search.util.js +363 -0
|
@@ -1,97 +1,106 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function v(e) {
|
|
2
|
+
return !!e && typeof e == "object";
|
|
3
|
+
}
|
|
4
|
+
function s(e, n) {
|
|
5
|
+
if (!n || !e) return;
|
|
6
|
+
const t = n.split(".");
|
|
4
7
|
let f = e;
|
|
5
|
-
for (const
|
|
8
|
+
for (const r of t) {
|
|
6
9
|
if (f == null) return;
|
|
7
|
-
f = f[
|
|
10
|
+
f = f[r];
|
|
8
11
|
}
|
|
9
12
|
return f;
|
|
10
13
|
}
|
|
11
|
-
function
|
|
12
|
-
if (!
|
|
13
|
-
const f =
|
|
14
|
-
let
|
|
14
|
+
function d(e, n, t) {
|
|
15
|
+
if (!n) return e;
|
|
16
|
+
const f = n.split("."), r = { ...e };
|
|
17
|
+
let i = r;
|
|
15
18
|
for (let o = 0; o < f.length - 1; o++) {
|
|
16
|
-
const
|
|
17
|
-
Array.isArray(
|
|
19
|
+
const l = f[o];
|
|
20
|
+
Array.isArray(i[l]) ? i[l] = [...i[l]] : i[l] = i[l] ? { ...i[l] } : {}, i = i[l];
|
|
18
21
|
}
|
|
19
|
-
return
|
|
22
|
+
return i[f[f.length - 1]] = t, r;
|
|
23
|
+
}
|
|
24
|
+
function m(e, n) {
|
|
25
|
+
return !v(n) || !n.name ? e : s(e, n.name) === void 0 && n.value !== void 0 ? d(e, n.name, n.value) : e;
|
|
20
26
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
o
|
|
27
|
+
function g(e, n) {
|
|
28
|
+
let t = n ? c(n) : {};
|
|
29
|
+
const f = Array.isArray(e[0]) ? e.flat() : e;
|
|
30
|
+
for (const r of f) {
|
|
31
|
+
if (!r.name) continue;
|
|
32
|
+
if (s(t, r.name) === void 0) {
|
|
33
|
+
const o = typeof r.value == "function" ? r.value() : r.value;
|
|
34
|
+
o !== void 0 && Object.assign(t, d(t, r.name, o));
|
|
28
35
|
}
|
|
36
|
+
t = m(t, r.addonLeft), t = m(t, r.addonRight);
|
|
29
37
|
}
|
|
30
|
-
return
|
|
38
|
+
return t;
|
|
31
39
|
}
|
|
32
|
-
function
|
|
33
|
-
return e === void 0 ? !1 : typeof e == "boolean" ? e : typeof e == "function" ? e(
|
|
40
|
+
function h(e, n) {
|
|
41
|
+
return e === void 0 ? !1 : typeof e == "boolean" ? e : typeof e == "function" ? e(n) : !1;
|
|
34
42
|
}
|
|
35
|
-
function
|
|
36
|
-
return Array.isArray(e) ? e.filter((
|
|
37
|
-
const
|
|
38
|
-
return
|
|
43
|
+
function F(e, n) {
|
|
44
|
+
return Array.isArray(e) ? e.filter((t) => t ? !n.every((r) => {
|
|
45
|
+
const i = t[r.name];
|
|
46
|
+
return i == null || i === "";
|
|
39
47
|
}) : !1) : [];
|
|
40
48
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
for (const
|
|
44
|
-
if (!
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
const o =
|
|
48
|
-
o &&
|
|
49
|
-
name:
|
|
49
|
+
function V(e, n) {
|
|
50
|
+
const t = [], f = Array.isArray(e[0]) ? e.flat() : e;
|
|
51
|
+
for (const r of f) {
|
|
52
|
+
if (!r.name) continue;
|
|
53
|
+
const i = r.type;
|
|
54
|
+
if (i === "file" || i === "avatarUpload" || i === "fileUploader") {
|
|
55
|
+
const o = s(n, r.name);
|
|
56
|
+
o && t.push({
|
|
57
|
+
name: r.name,
|
|
50
58
|
value: o,
|
|
51
|
-
type:
|
|
59
|
+
type: i
|
|
52
60
|
});
|
|
53
61
|
}
|
|
54
|
-
if (
|
|
55
|
-
const o =
|
|
62
|
+
if (i === "customFields" && r.props?.schema) {
|
|
63
|
+
const o = s(n, r.name);
|
|
56
64
|
if (Array.isArray(o)) {
|
|
57
|
-
const y =
|
|
58
|
-
(
|
|
65
|
+
const y = r.props.schema.filter(
|
|
66
|
+
(a) => a.type === "file" || a.type === "avatarUpload" || a.type === "fileUploader"
|
|
59
67
|
);
|
|
60
|
-
y.length > 0 && o.forEach((
|
|
61
|
-
y.forEach((
|
|
62
|
-
const p =
|
|
63
|
-
p &&
|
|
64
|
-
name: `${
|
|
68
|
+
y.length > 0 && o.forEach((a, A) => {
|
|
69
|
+
y.forEach((u) => {
|
|
70
|
+
const p = a?.[u.name];
|
|
71
|
+
p && t.push({
|
|
72
|
+
name: `${r.name}.${A}.${u.name}`,
|
|
65
73
|
value: p,
|
|
66
|
-
type:
|
|
74
|
+
type: u.type
|
|
67
75
|
});
|
|
68
76
|
});
|
|
69
77
|
});
|
|
70
78
|
}
|
|
71
79
|
}
|
|
72
80
|
}
|
|
73
|
-
return
|
|
81
|
+
return t;
|
|
74
82
|
}
|
|
75
83
|
function c(e) {
|
|
76
84
|
if (e === null || typeof e != "object") return e;
|
|
77
85
|
if (e instanceof Date) return new Date(e.getTime());
|
|
78
86
|
if (e instanceof File) return e;
|
|
79
|
-
if (Array.isArray(e)) return e.map((
|
|
80
|
-
const
|
|
81
|
-
for (const
|
|
82
|
-
Object.prototype.hasOwnProperty.call(e,
|
|
83
|
-
return
|
|
87
|
+
if (Array.isArray(e)) return e.map((t) => c(t));
|
|
88
|
+
const n = {};
|
|
89
|
+
for (const t in e)
|
|
90
|
+
Object.prototype.hasOwnProperty.call(e, t) && (n[t] = c(e[t]));
|
|
91
|
+
return n;
|
|
84
92
|
}
|
|
85
|
-
function
|
|
93
|
+
function k(e) {
|
|
86
94
|
return e ? typeof e == "object" && (typeof e.render == "function" || typeof e.setup == "function" || e.__name !== void 0 || e.name !== void 0) : !1;
|
|
87
95
|
}
|
|
88
96
|
export {
|
|
89
|
-
|
|
97
|
+
V as collectFileFields,
|
|
90
98
|
c as deepClone,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
h as evaluateConditional,
|
|
100
|
+
F as filterNullCustomFields,
|
|
101
|
+
s as getNestedValue,
|
|
102
|
+
g as initializeFormValues,
|
|
103
|
+
v as isAddonObject,
|
|
104
|
+
k as isComponent,
|
|
105
|
+
d as setNestedValue
|
|
97
106
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface GoogleLoginProps {
|
|
2
|
+
buttonText?: string;
|
|
3
|
+
btnClass?: string;
|
|
4
|
+
variant?: any;
|
|
5
|
+
size?: any;
|
|
6
|
+
rounded?: any;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function __VLS_template(): {
|
|
10
|
+
attrs: Partial<{}>;
|
|
11
|
+
slots: {
|
|
12
|
+
default?(_: {
|
|
13
|
+
login: () => void;
|
|
14
|
+
loading: boolean;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
}): any;
|
|
17
|
+
};
|
|
18
|
+
refs: {};
|
|
19
|
+
rootEl: HTMLDivElement;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
22
|
+
declare const __VLS_component: import('vue').DefineComponent<GoogleLoginProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
23
|
+
success: (response: any) => any;
|
|
24
|
+
error: (error: any) => any;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<GoogleLoginProps> & Readonly<{
|
|
26
|
+
onSuccess?: (response: any) => any;
|
|
27
|
+
onError?: (error: any) => any;
|
|
28
|
+
}>, {
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
size: any;
|
|
31
|
+
variant: any;
|
|
32
|
+
rounded: any;
|
|
33
|
+
buttonText: string;
|
|
34
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
35
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineComponent as d, ref as u, openBlock as c, createElementBlock as f, renderSlot as m, createVNode as g, normalizeClass as v, unref as b, withCtx as C, createElementVNode as h, toDisplayString as k } from "vue";
|
|
2
|
+
import { useTokenClient as w } from "../node_modules/vue3-google-signin/dist/index.es.js";
|
|
3
|
+
import z from "./Button.vue.js";
|
|
4
|
+
const x = { class: "google-login-wrapper inline-block w-full" }, y = { class: "font-medium" }, L = /* @__PURE__ */ d({
|
|
5
|
+
__name: "GoogleLogin",
|
|
6
|
+
props: {
|
|
7
|
+
buttonText: { default: "Sign in with Google" },
|
|
8
|
+
btnClass: {},
|
|
9
|
+
variant: { default: "outline" },
|
|
10
|
+
size: { default: "md" },
|
|
11
|
+
rounded: { default: "md" },
|
|
12
|
+
disabled: { type: Boolean, default: !1 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["success", "error"],
|
|
15
|
+
setup(e, { emit: n }) {
|
|
16
|
+
const s = e, o = n, l = u(!1), { login: i, isReady: r } = w({
|
|
17
|
+
onSuccess: (a) => {
|
|
18
|
+
l.value = !1, o("success", a);
|
|
19
|
+
},
|
|
20
|
+
onError: (a) => {
|
|
21
|
+
l.value = !1, o("error", a);
|
|
22
|
+
}
|
|
23
|
+
}), t = () => {
|
|
24
|
+
if (!(s.disabled || l.value)) {
|
|
25
|
+
l.value = !0;
|
|
26
|
+
try {
|
|
27
|
+
i();
|
|
28
|
+
} catch (a) {
|
|
29
|
+
l.value = !1, o("error", a);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return (a, S) => (c(), f("div", x, [
|
|
34
|
+
m(a.$slots, "default", {
|
|
35
|
+
login: t,
|
|
36
|
+
loading: l.value,
|
|
37
|
+
disabled: e.disabled
|
|
38
|
+
}, () => [
|
|
39
|
+
g(z, {
|
|
40
|
+
variant: e.variant,
|
|
41
|
+
size: e.size,
|
|
42
|
+
rounded: e.rounded,
|
|
43
|
+
disabled: !b(r) || e.disabled || l.value,
|
|
44
|
+
loading: l.value,
|
|
45
|
+
class: v([e.btnClass, "w-full"]),
|
|
46
|
+
icon: "flat-color-icons:google",
|
|
47
|
+
onClick: t
|
|
48
|
+
}, {
|
|
49
|
+
default: C(() => [
|
|
50
|
+
h("span", y, k(e.buttonText), 1)
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
}, 8, ["variant", "size", "rounded", "disabled", "loading", "class"])
|
|
54
|
+
])
|
|
55
|
+
]));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
L as default
|
|
60
|
+
};
|
package/components/Input.vue.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as G, useSlots as J, ref as v, computed as
|
|
1
|
+
import { defineComponent as G, useSlots as J, ref as v, computed as r, onMounted as K, nextTick as A, openBlock as d, createElementBlock as s, normalizeClass as a, createBlock as C, withCtx as O, createTextVNode as k, toDisplayString as V, createCommentVNode as c, createElementVNode as z, renderSlot as F, createVNode as x } from "vue";
|
|
2
2
|
import f from "./Icon.vue.js";
|
|
3
3
|
import Q from "./Label.vue.js";
|
|
4
4
|
import X from "./Textarea.vue.js";
|
|
5
|
-
const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2" }, le = /* @__PURE__ */ G({
|
|
5
|
+
const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 z-20" }, le = /* @__PURE__ */ G({
|
|
6
6
|
__name: "Input",
|
|
7
7
|
props: {
|
|
8
8
|
modelValue: { default: "" },
|
|
@@ -32,25 +32,26 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
32
32
|
max: {}
|
|
33
33
|
},
|
|
34
34
|
emits: ["update:modelValue", "focus", "blur", "change", "click:icon", "click:icon-right"],
|
|
35
|
-
setup(
|
|
36
|
-
const e =
|
|
35
|
+
setup(n, { emit: I }) {
|
|
36
|
+
const e = n, u = I, m = J(), y = v(null), b = v(!1), M = r(() => e.type === "password" && b.value ? "text" : e.type), B = r(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), g = r(() => !!e.addonLeft || !!m["addon-left"]), p = r(() => !!e.addonRight || !!m["addon-right"]), N = r(() => [
|
|
37
37
|
"relative w-full",
|
|
38
38
|
e.class,
|
|
39
39
|
e.labelPosition === "left" ? "flex items-center gap-4" : "",
|
|
40
40
|
e.labelPosition === "right" ? "flex flex-row-reverse items-center gap-4" : "space-y-2"
|
|
41
|
-
].join(" ")), T =
|
|
41
|
+
].join(" ")), T = r(() => ["relative flex w-full items-stretch", e.labelPosition !== "top" ? "flex-1" : ""].join(
|
|
42
42
|
" "
|
|
43
|
-
)),
|
|
44
|
-
const
|
|
43
|
+
)), j = r(() => {
|
|
44
|
+
const t = "block w-full bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/50 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none relative focus:z-10", o = {
|
|
45
45
|
solid: "bg-muted border-transparent focus-visible:border-primary",
|
|
46
46
|
outline: "border border-input focus-visible:border-primary",
|
|
47
47
|
"outline-b": "border-b border-input bg-transparent rounded-none focus-visible:border-primary",
|
|
48
48
|
transparent: "border-none bg-transparent shadow-none"
|
|
49
|
-
},
|
|
49
|
+
}, i = {
|
|
50
50
|
sm: "h-8 text-xs",
|
|
51
51
|
md: "h-9 text-sm",
|
|
52
52
|
lg: "h-10 text-base"
|
|
53
|
-
}
|
|
53
|
+
};
|
|
54
|
+
let l = {
|
|
54
55
|
none: "rounded-none",
|
|
55
56
|
sm: "rounded-sm",
|
|
56
57
|
md: "rounded-md",
|
|
@@ -58,173 +59,181 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
58
59
|
xl: "rounded-xl",
|
|
59
60
|
"2xl": "rounded-2xl",
|
|
60
61
|
full: "rounded-full"
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const L = e.variant === "outline-b" || e.variant === "transparent";
|
|
62
|
+
}[e.rounded];
|
|
63
|
+
g.value && (e.rounded === "md" ? l = "rounded-r-md rounded-l-none" : e.rounded === "sm" ? l = "rounded-r-sm rounded-l-none" : e.rounded === "lg" ? l = "rounded-r-lg rounded-l-none" : e.rounded === "full" ? l = "rounded-r-full rounded-l-none" : e.rounded !== "none" && (l = l.replace("rounded-", "rounded-r-").replace("rounded-l-", ""))), p.value && (g.value ? l = "rounded-none" : e.rounded === "md" ? l = "rounded-l-md rounded-r-none" : e.rounded === "sm" ? l = "rounded-l-sm rounded-r-none" : e.rounded === "lg" ? l = "rounded-l-lg rounded-r-none" : e.rounded === "full" ? l = "rounded-l-full rounded-r-none" : e.rounded !== "none" && (l = l.replace("rounded-", "rounded-l-").replace("rounded-r-", ""))), e.variant === "outline-b" && (l = "rounded-none");
|
|
64
|
+
const P = e.variant === "outline-b" || e.variant === "transparent";
|
|
65
65
|
return [
|
|
66
|
-
|
|
66
|
+
t,
|
|
67
67
|
o[e.variant],
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
i[e.size],
|
|
69
|
+
l,
|
|
70
70
|
e.error ? "border-destructive focus-visible:ring-destructive" : "",
|
|
71
|
-
|
|
72
|
-
e.
|
|
73
|
-
// Right Padding
|
|
74
|
-
e.showClearButton && j.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : L && !h.value ? "pr-0" : "",
|
|
71
|
+
e.icon ? "pl-9" : P && !g.value ? "pl-0" : "",
|
|
72
|
+
e.showClearButton && B.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : P && !p.value ? "pr-0" : "",
|
|
75
73
|
e.inputClass
|
|
76
74
|
].join(" ");
|
|
77
|
-
}),
|
|
75
|
+
}), R = {
|
|
78
76
|
sm: "text-xs",
|
|
79
77
|
md: "text-sm",
|
|
80
78
|
lg: "text-base"
|
|
81
|
-
},
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
none: "rounded-none",
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
|
|
79
|
+
}, $ = (t) => {
|
|
80
|
+
const o = t === "left";
|
|
81
|
+
return [
|
|
82
|
+
// Ensure height matches
|
|
83
|
+
"[&_button]:w-full [&_a]:w-full! [&_.v-btn]:w-full! [&_.tooltip-trigger]:w-full",
|
|
84
|
+
// Handle borders (Connect sides)
|
|
85
|
+
o ? "[&_button]:rounded-r-none [&_a]:rounded-r-none [&_.v-btn]:rounded-r-none" : "[&_button]:rounded-l-none [&_a]:rounded-l-none [&_.v-btn]:rounded-l-none",
|
|
86
|
+
// Ensure focus ring appears on top
|
|
87
|
+
"[&_button]:relative [&_button]:focus:z-20",
|
|
88
|
+
// Merge borders (Negative margin to overlap single pixels)
|
|
89
|
+
o ? "-mr-px" : "-ml-px",
|
|
90
|
+
"z-10"
|
|
91
|
+
// Ensure addons sit visually above input border if needed
|
|
92
|
+
].join(" ");
|
|
93
|
+
}, E = r(() => {
|
|
94
|
+
const t = !!m["addon-left"];
|
|
91
95
|
return [
|
|
92
96
|
"flex items-center justify-center whitespace-nowrap",
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
t ? `border-none ${$("left")}` : `bg-muted border border-input border-r-0! px-3 text-muted-foreground ${{
|
|
98
|
+
sm: "rounded-l-sm",
|
|
99
|
+
md: "rounded-l-md",
|
|
100
|
+
lg: "rounded-l-lg",
|
|
101
|
+
full: "rounded-l-full",
|
|
102
|
+
none: "rounded-none",
|
|
103
|
+
xl: "rounded-l-xl",
|
|
104
|
+
"2xl": "rounded-l-2xl"
|
|
105
|
+
}[e.rounded] || "rounded-l-md"}`,
|
|
106
|
+
t ? "" : R[e.size],
|
|
96
107
|
e.addonLeftClass,
|
|
97
108
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
98
109
|
].join(" ");
|
|
99
|
-
}), D =
|
|
100
|
-
const
|
|
101
|
-
sm: "rounded-r-sm",
|
|
102
|
-
md: "rounded-r-md",
|
|
103
|
-
lg: "rounded-r-lg",
|
|
104
|
-
full: "rounded-r-full",
|
|
105
|
-
none: "rounded-none",
|
|
106
|
-
xl: "rounded-r-xl",
|
|
107
|
-
"2xl": "rounded-r-2xl"
|
|
108
|
-
}, o = !!m["addon-right"];
|
|
110
|
+
}), D = r(() => {
|
|
111
|
+
const t = !!m["addon-right"];
|
|
109
112
|
return [
|
|
110
113
|
"flex items-center justify-center whitespace-nowrap",
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
t ? `border-none ${$("right")}` : `bg-muted border border-input border-l-0! px-3 text-muted-foreground ${{
|
|
115
|
+
sm: "rounded-r-sm",
|
|
116
|
+
md: "rounded-r-md",
|
|
117
|
+
lg: "rounded-r-lg",
|
|
118
|
+
full: "rounded-r-full",
|
|
119
|
+
none: "rounded-none",
|
|
120
|
+
xl: "rounded-r-xl",
|
|
121
|
+
"2xl": "rounded-r-2xl"
|
|
122
|
+
}[e.rounded] || "rounded-r-md"}`,
|
|
123
|
+
t ? "" : R[e.size],
|
|
114
124
|
e.addonRightClass,
|
|
115
125
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
116
126
|
].join(" ");
|
|
117
|
-
}), H = (
|
|
127
|
+
}), H = (t) => {
|
|
118
128
|
if (e.lazy) return;
|
|
119
|
-
const o =
|
|
120
|
-
|
|
121
|
-
}, U = (
|
|
122
|
-
const o =
|
|
123
|
-
e.lazy &&
|
|
129
|
+
const o = t.target;
|
|
130
|
+
u("update:modelValue", o.value);
|
|
131
|
+
}, U = (t) => {
|
|
132
|
+
const o = t.target;
|
|
133
|
+
e.lazy && u("update:modelValue", o.value), u("change", o.value);
|
|
124
134
|
}, W = () => {
|
|
125
135
|
b.value = !b.value;
|
|
126
136
|
}, q = () => {
|
|
127
|
-
|
|
137
|
+
u("update:modelValue", ""), A(() => {
|
|
128
138
|
y.value?.focus();
|
|
129
139
|
});
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
|
|
140
|
+
}, h = v(!1), w = v(!1), S = (t) => {
|
|
141
|
+
h.value = !0, u("focus", t);
|
|
142
|
+
}, L = (t) => {
|
|
143
|
+
h.value = !1, u("blur", t);
|
|
134
144
|
};
|
|
135
145
|
return K(() => {
|
|
136
146
|
e.autofocus && A(() => {
|
|
137
147
|
y.value?.focus();
|
|
138
148
|
});
|
|
139
|
-
}), (
|
|
140
|
-
class:
|
|
149
|
+
}), (t, o) => (d(), s("div", {
|
|
150
|
+
class: a(N.value)
|
|
141
151
|
}, [
|
|
142
|
-
|
|
152
|
+
n.label ? (d(), C(Q, {
|
|
143
153
|
key: 0,
|
|
144
|
-
for:
|
|
145
|
-
class:
|
|
154
|
+
for: n.label,
|
|
155
|
+
class: a(["mb-1.5", n.labelPosition !== "top" ? "mb-0" : ""].join(" "))
|
|
146
156
|
}, {
|
|
147
157
|
default: O(() => [
|
|
148
|
-
k(V(
|
|
158
|
+
k(V(n.label), 1)
|
|
149
159
|
]),
|
|
150
160
|
_: 1
|
|
151
161
|
}, 8, ["for", "class"])) : c("", !0),
|
|
152
|
-
|
|
153
|
-
class:
|
|
162
|
+
z("div", {
|
|
163
|
+
class: a(T.value)
|
|
154
164
|
}, [
|
|
155
|
-
g.value ? (d(),
|
|
165
|
+
g.value ? (d(), s("div", {
|
|
156
166
|
key: 0,
|
|
157
|
-
class:
|
|
167
|
+
class: a(E.value)
|
|
158
168
|
}, [
|
|
159
|
-
F(
|
|
160
|
-
k(V(
|
|
169
|
+
F(t.$slots, "addon-left", {}, () => [
|
|
170
|
+
k(V(n.addonLeft), 1)
|
|
161
171
|
])
|
|
162
172
|
], 2)) : c("", !0),
|
|
163
|
-
|
|
173
|
+
z("div", {
|
|
164
174
|
class: "relative w-full",
|
|
165
|
-
onMouseenter: o[
|
|
166
|
-
onMouseleave: o[
|
|
175
|
+
onMouseenter: o[2] || (o[2] = (i) => w.value = !0),
|
|
176
|
+
onMouseleave: o[3] || (o[3] = (i) => w.value = !1)
|
|
167
177
|
}, [
|
|
168
|
-
|
|
178
|
+
n.type === "textarea" ? (d(), C(X, {
|
|
169
179
|
key: 0,
|
|
170
|
-
"model-value": String(
|
|
171
|
-
placeholder:
|
|
172
|
-
disabled:
|
|
173
|
-
rows:
|
|
174
|
-
class:
|
|
175
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
176
|
-
onBlur:
|
|
177
|
-
onFocus:
|
|
178
|
-
}, null, 8, ["model-value", "placeholder", "disabled", "rows", "class"])) : (d(),
|
|
180
|
+
"model-value": String(n.modelValue),
|
|
181
|
+
placeholder: n.placeholder,
|
|
182
|
+
disabled: n.disabled,
|
|
183
|
+
rows: n.rows,
|
|
184
|
+
class: a(j.value),
|
|
185
|
+
"onUpdate:modelValue": o[0] || (o[0] = (i) => u("update:modelValue", i)),
|
|
186
|
+
onBlur: L,
|
|
187
|
+
onFocus: S
|
|
188
|
+
}, null, 8, ["model-value", "placeholder", "disabled", "rows", "class"])) : (d(), s("input", {
|
|
179
189
|
key: 1,
|
|
180
190
|
ref_key: "inputRef",
|
|
181
191
|
ref: y,
|
|
182
192
|
type: M.value,
|
|
183
|
-
value:
|
|
184
|
-
placeholder:
|
|
185
|
-
disabled:
|
|
186
|
-
min:
|
|
187
|
-
max:
|
|
188
|
-
class:
|
|
193
|
+
value: n.modelValue,
|
|
194
|
+
placeholder: n.placeholder,
|
|
195
|
+
disabled: n.disabled,
|
|
196
|
+
min: n.min,
|
|
197
|
+
max: n.max,
|
|
198
|
+
class: a(j.value),
|
|
189
199
|
onInput: H,
|
|
190
200
|
onChange: U,
|
|
191
|
-
onBlur:
|
|
192
|
-
onFocus:
|
|
201
|
+
onBlur: L,
|
|
202
|
+
onFocus: S
|
|
193
203
|
}, null, 42, Y)),
|
|
194
|
-
|
|
204
|
+
n.icon ? (d(), s("div", {
|
|
195
205
|
key: 2,
|
|
196
206
|
tabindex: "-1",
|
|
197
|
-
class:
|
|
198
|
-
"absolute left-3 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground",
|
|
199
|
-
|
|
200
|
-
])
|
|
201
|
-
onClick: o[1] || (o[1] = (a) => !t.disabled && r("click:icon", a))
|
|
207
|
+
class: a([
|
|
208
|
+
"absolute left-3 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground z-20 pointer-events-none",
|
|
209
|
+
n.disabled ? "opacity-50" : ""
|
|
210
|
+
])
|
|
202
211
|
}, [
|
|
203
212
|
x(f, {
|
|
204
|
-
icon:
|
|
213
|
+
icon: n.icon,
|
|
205
214
|
class: "h-4 w-4"
|
|
206
215
|
}, null, 8, ["icon"])
|
|
207
216
|
], 2)) : c("", !0),
|
|
208
|
-
|
|
209
|
-
|
|
217
|
+
z("div", Z, [
|
|
218
|
+
n.loading ? (d(), C(f, {
|
|
210
219
|
key: 0,
|
|
211
220
|
icon: "lucide:loader-2",
|
|
212
221
|
class: "h-4 w-4 animate-spin text-muted-foreground"
|
|
213
|
-
})) :
|
|
222
|
+
})) : n.iconRight ? (d(), s("div", {
|
|
214
223
|
key: 1,
|
|
215
224
|
tabindex: "-1",
|
|
216
|
-
class:
|
|
225
|
+
class: a([
|
|
217
226
|
"flex items-center justify-center text-muted-foreground",
|
|
218
|
-
|
|
227
|
+
n.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:text-foreground"
|
|
219
228
|
]),
|
|
220
|
-
onClick: o[
|
|
229
|
+
onClick: o[1] || (o[1] = (i) => !n.disabled && u("click:icon-right", i))
|
|
221
230
|
}, [
|
|
222
231
|
x(f, {
|
|
223
|
-
icon:
|
|
232
|
+
icon: n.iconRight,
|
|
224
233
|
class: "h-4 w-4"
|
|
225
234
|
}, null, 8, ["icon"])
|
|
226
235
|
], 2)) : c("", !0),
|
|
227
|
-
|
|
236
|
+
n.type === "password" && !n.disabled ? (d(), s("button", {
|
|
228
237
|
key: 2,
|
|
229
238
|
type: "button",
|
|
230
239
|
tabindex: "-1",
|
|
@@ -236,7 +245,7 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
236
245
|
class: "h-4 w-4"
|
|
237
246
|
}, null, 8, ["icon"])
|
|
238
247
|
])) : c("", !0),
|
|
239
|
-
|
|
248
|
+
n.showClearButton && B.value && !n.disabled && !n.loading && n.type !== "textarea" && n.type !== "password" && (h.value || w.value) ? (d(), s("button", {
|
|
240
249
|
key: 3,
|
|
241
250
|
type: "button",
|
|
242
251
|
tabindex: "-1",
|
|
@@ -250,12 +259,12 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
250
259
|
])) : c("", !0)
|
|
251
260
|
])
|
|
252
261
|
], 32),
|
|
253
|
-
|
|
262
|
+
p.value ? (d(), s("div", {
|
|
254
263
|
key: 1,
|
|
255
|
-
class:
|
|
264
|
+
class: a(D.value)
|
|
256
265
|
}, [
|
|
257
|
-
F(
|
|
258
|
-
k(V(
|
|
266
|
+
F(t.$slots, "addon-right", {}, () => [
|
|
267
|
+
k(V(n.addonRight), 1)
|
|
259
268
|
])
|
|
260
269
|
], 2)) : c("", !0)
|
|
261
270
|
], 2)
|