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.
Files changed (55) hide show
  1. package/README.md +226 -150
  2. package/components/Button.vue.js +1 -1
  3. package/components/Chip/Chip.vue.js +15 -15
  4. package/components/DataTable/DataTable.vue.js +2 -2
  5. package/components/DataTable/DataTable.vue2.js +41 -39
  6. package/components/DataTable/types.d.ts +1 -0
  7. package/components/DatePicker.vue.d.ts +12 -3
  8. package/components/DatePicker.vue.js +80 -39
  9. package/components/Dropdown/DropdownMenu.vue.js +48 -47
  10. package/components/Form/Form.vue.d.ts +2 -0
  11. package/components/Form/Form.vue.js +2 -2
  12. package/components/Form/Form.vue2.js +104 -101
  13. package/components/Form/FormField.vue.d.ts +4 -0
  14. package/components/Form/FormField.vue.js +248 -148
  15. package/components/Form/FormFields.vue.d.ts +2 -0
  16. package/components/Form/FormFields.vue.js +2 -2
  17. package/components/Form/FormFields.vue2.js +45 -39
  18. package/components/Form/types.d.ts +24 -4
  19. package/components/Form/utils/form.utils.d.ts +5 -1
  20. package/components/Form/utils/form.utils.js +69 -60
  21. package/components/GoogleLogin.vue.d.ts +41 -0
  22. package/components/GoogleLogin.vue.js +60 -0
  23. package/components/GoogleLogin.vue2.js +4 -0
  24. package/components/Input.vue.js +120 -111
  25. package/components/NumberInput.vue.d.ts +38 -0
  26. package/components/NumberInput.vue.js +7 -0
  27. package/components/NumberInput.vue2.js +191 -0
  28. package/components/Pagination/Pagination.vue.d.ts +1 -0
  29. package/components/Pagination/Pagination.vue.js +60 -46
  30. package/components/ProgressBar/ProgressBar.vue.d.ts +12 -0
  31. package/components/ProgressBar/ProgressBar.vue.js +7 -0
  32. package/components/ProgressBar/ProgressBar.vue2.js +158 -0
  33. package/components/ProgressBar/index.d.ts +3 -0
  34. package/components/Spinner/Spinner.vue.d.ts +8 -0
  35. package/components/Spinner/Spinner.vue.js +89 -0
  36. package/components/Spinner/Spinner.vue2.js +4 -0
  37. package/components/Spinner/index.d.ts +2 -0
  38. package/components/Spinner/types.d.ts +9 -0
  39. package/components/Tabes/Tabes.vue.d.ts +3 -1
  40. package/components/Tabes/Tabes.vue.js +103 -44
  41. package/directives/vScrollReveal.d.ts +2 -0
  42. package/directives/vScrollReveal.js +48 -0
  43. package/index.d.ts +8 -0
  44. package/index.js +180 -147
  45. package/package.json +6 -3
  46. package/style.css +56 -4
  47. package/types/form.type.d.ts +2 -2
  48. package/types/progressbar.d.ts +75 -0
  49. package/utils/env.d.ts +14 -0
  50. package/utils/env.js +4 -0
  51. package/utils/functions.d.ts +99 -0
  52. package/utils/functions.js +91 -7
  53. package/utils/index.d.ts +2 -0
  54. package/utils/search.util.d.ts +127 -0
  55. package/utils/search.util.js +363 -0
@@ -1,97 +1,106 @@
1
- function u(e, i) {
2
- if (!i || !e) return;
3
- const n = i.split(".");
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 t of n) {
8
+ for (const r of t) {
6
9
  if (f == null) return;
7
- f = f[t];
10
+ f = f[r];
8
11
  }
9
12
  return f;
10
13
  }
11
- function m(e, i, n) {
12
- if (!i) return e;
13
- const f = i.split("."), t = { ...e };
14
- let r = t;
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 a = f[o];
17
- Array.isArray(r[a]) ? r[a] = [...r[a]] : r[a] = r[a] ? { ...r[a] } : {}, r = r[a];
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 r[f[f.length - 1]] = n, t;
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 v(e, i) {
22
- const n = i ? c(i) : {}, f = Array.isArray(e[0]) ? e.flat() : e;
23
- for (const t of f) {
24
- if (!t.name) continue;
25
- if (u(n, t.name) === void 0) {
26
- const o = typeof t.value == "function" ? t.value() : t.value;
27
- o !== void 0 && Object.assign(n, m(n, t.name, 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 n;
38
+ return t;
31
39
  }
32
- function A(e, i) {
33
- return e === void 0 ? !1 : typeof e == "boolean" ? e : typeof e == "function" ? e(i) : !1;
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 g(e, i) {
36
- return Array.isArray(e) ? e.filter((n) => n ? !i.every((t) => {
37
- const r = n[t.name];
38
- return r == null || r === "";
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 h(e, i) {
42
- const n = [], f = Array.isArray(e[0]) ? e.flat() : e;
43
- for (const t of f) {
44
- if (!t.name) continue;
45
- const r = t.type;
46
- if (r === "file" || r === "avatarUpload" || r === "fileUploader") {
47
- const o = u(i, t.name);
48
- o && n.push({
49
- name: t.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: r
59
+ type: i
52
60
  });
53
61
  }
54
- if (r === "customFields" && t.props?.schema) {
55
- const o = u(i, t.name);
62
+ if (i === "customFields" && r.props?.schema) {
63
+ const o = s(n, r.name);
56
64
  if (Array.isArray(o)) {
57
- const y = t.props.schema.filter(
58
- (l) => l.type === "file" || l.type === "avatarUpload" || l.type === "fileUploader"
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((l, d) => {
61
- y.forEach((s) => {
62
- const p = l?.[s.name];
63
- p && n.push({
64
- name: `${t.name}.${d}.${s.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: s.type
74
+ type: u.type
67
75
  });
68
76
  });
69
77
  });
70
78
  }
71
79
  }
72
80
  }
73
- return n;
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((n) => c(n));
80
- const i = {};
81
- for (const n in e)
82
- Object.prototype.hasOwnProperty.call(e, n) && (i[n] = c(e[n]));
83
- return i;
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 F(e) {
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
- h as collectFileFields,
97
+ V as collectFileFields,
90
98
  c as deepClone,
91
- A as evaluateConditional,
92
- g as filterNullCustomFields,
93
- u as getNestedValue,
94
- v as initializeFormValues,
95
- F as isComponent,
96
- m as setNestedValue
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
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./GoogleLogin.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,8 +1,8 @@
1
- import { defineComponent as G, useSlots as J, ref as v, computed as u, onMounted as K, nextTick as A, openBlock as d, createElementBlock as i, normalizeClass as s, createBlock as C, withCtx as O, createTextVNode as k, toDisplayString as V, createCommentVNode as c, createElementVNode as B, renderSlot as F, createVNode as x } from "vue";
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(t, { emit: I }) {
36
- const e = t, r = I, m = J(), y = v(null), b = v(!1), M = u(() => e.type === "password" && b.value ? "text" : e.type), j = u(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), g = u(() => !!e.addonLeft || !!m["addon-left"]), h = u(() => !!e.addonRight || !!m["addon-right"]), N = u(() => [
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 = u(() => ["relative flex w-full items-stretch", e.labelPosition !== "top" ? "flex-1" : ""].join(
41
+ ].join(" ")), T = r(() => ["relative flex w-full items-stretch", e.labelPosition !== "top" ? "flex-1" : ""].join(
42
42
  " "
43
- )), R = u(() => {
44
- const l = "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", o = {
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
- }, a = {
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
- let n = $[e.rounded];
63
- g.value && (n = n.replace("rounded-", "rounded-r-").replace("rounded-l-", ""), e.rounded === "md" && (n = "rounded-r-md rounded-l-none"), e.rounded === "sm" && (n = "rounded-r-sm rounded-l-none"), e.rounded === "lg" && (n = "rounded-r-lg rounded-l-none"), e.rounded === "full" && (n = "rounded-r-full rounded-l-none")), h.value && ($[e.rounded], g.value ? n = "rounded-none" : (e.rounded === "md" && (n = "rounded-l-md rounded-r-none"), e.rounded === "sm" && (n = "rounded-l-sm rounded-r-none"), e.rounded === "lg" && (n = "rounded-l-lg rounded-r-none"), e.rounded === "full" && (n = "rounded-l-full rounded-r-none"))), e.variant === "outline-b" && (n = "rounded-none");
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
- l,
66
+ t,
67
67
  o[e.variant],
68
- a[e.size],
69
- n,
68
+ i[e.size],
69
+ l,
70
70
  e.error ? "border-destructive focus-visible:ring-destructive" : "",
71
- // Left Padding
72
- e.icon ? "pl-9" : L && !g.value ? "pl-0" : "",
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
- }), z = {
75
+ }), R = {
78
76
  sm: "text-xs",
79
77
  md: "text-sm",
80
78
  lg: "text-base"
81
- }, E = u(() => {
82
- const l = {
83
- sm: "rounded-l-sm",
84
- md: "rounded-l-md",
85
- lg: "rounded-l-lg",
86
- full: "rounded-l-full",
87
- none: "rounded-none",
88
- xl: "rounded-l-xl",
89
- "2xl": "rounded-l-2xl"
90
- }, o = !!m["addon-left"];
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
- o ? "border-none" : "bg-muted border border-input border-r-0! px-3 text-muted-foreground",
94
- o ? "" : z[e.size],
95
- l[e.rounded] || "rounded-l-md",
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 = u(() => {
100
- const l = {
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
- o ? "border-none" : "bg-muted border border-input border-l-0! px-3 text-muted-foreground",
112
- o ? "" : z[e.size],
113
- l[e.rounded] || "rounded-r-md",
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 = (l) => {
127
+ }), H = (t) => {
118
128
  if (e.lazy) return;
119
- const o = l.target;
120
- r("update:modelValue", o.value);
121
- }, U = (l) => {
122
- const o = l.target;
123
- e.lazy && r("update:modelValue", o.value), r("change", o.value);
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
- r("update:modelValue", ""), A(() => {
137
+ u("update:modelValue", ""), A(() => {
128
138
  y.value?.focus();
129
139
  });
130
- }, p = v(!1), w = v(!1), P = (l) => {
131
- p.value = !0, r("focus", l);
132
- }, S = (l) => {
133
- p.value = !1, r("blur", l);
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
- }), (l, o) => (d(), i("div", {
140
- class: s(N.value)
149
+ }), (t, o) => (d(), s("div", {
150
+ class: a(N.value)
141
151
  }, [
142
- t.label ? (d(), C(Q, {
152
+ n.label ? (d(), C(Q, {
143
153
  key: 0,
144
- for: t.label,
145
- class: s(["mb-1.5", t.labelPosition !== "top" ? "mb-0" : ""].join(" "))
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(t.label), 1)
158
+ k(V(n.label), 1)
149
159
  ]),
150
160
  _: 1
151
161
  }, 8, ["for", "class"])) : c("", !0),
152
- B("div", {
153
- class: s(T.value)
162
+ z("div", {
163
+ class: a(T.value)
154
164
  }, [
155
- g.value ? (d(), i("div", {
165
+ g.value ? (d(), s("div", {
156
166
  key: 0,
157
- class: s(E.value)
167
+ class: a(E.value)
158
168
  }, [
159
- F(l.$slots, "addon-left", {}, () => [
160
- k(V(t.addonLeft), 1)
169
+ F(t.$slots, "addon-left", {}, () => [
170
+ k(V(n.addonLeft), 1)
161
171
  ])
162
172
  ], 2)) : c("", !0),
163
- B("div", {
173
+ z("div", {
164
174
  class: "relative w-full",
165
- onMouseenter: o[3] || (o[3] = (a) => w.value = !0),
166
- onMouseleave: o[4] || (o[4] = (a) => w.value = !1)
175
+ onMouseenter: o[2] || (o[2] = (i) => w.value = !0),
176
+ onMouseleave: o[3] || (o[3] = (i) => w.value = !1)
167
177
  }, [
168
- t.type === "textarea" ? (d(), C(X, {
178
+ n.type === "textarea" ? (d(), C(X, {
169
179
  key: 0,
170
- "model-value": String(t.modelValue),
171
- placeholder: t.placeholder,
172
- disabled: t.disabled,
173
- rows: t.rows,
174
- class: s(R.value),
175
- "onUpdate:modelValue": o[0] || (o[0] = (a) => r("update:modelValue", a)),
176
- onBlur: S,
177
- onFocus: P
178
- }, null, 8, ["model-value", "placeholder", "disabled", "rows", "class"])) : (d(), i("input", {
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: t.modelValue,
184
- placeholder: t.placeholder,
185
- disabled: t.disabled,
186
- min: t.min,
187
- max: t.max,
188
- class: s(R.value),
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: S,
192
- onFocus: P
201
+ onBlur: L,
202
+ onFocus: S
193
203
  }, null, 42, Y)),
194
- t.icon ? (d(), i("div", {
204
+ n.icon ? (d(), s("div", {
195
205
  key: 2,
196
206
  tabindex: "-1",
197
- class: s([
198
- "absolute left-3 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground",
199
- t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:text-foreground"
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: t.icon,
213
+ icon: n.icon,
205
214
  class: "h-4 w-4"
206
215
  }, null, 8, ["icon"])
207
216
  ], 2)) : c("", !0),
208
- B("div", Z, [
209
- t.loading ? (d(), C(f, {
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
- })) : t.iconRight ? (d(), i("div", {
222
+ })) : n.iconRight ? (d(), s("div", {
214
223
  key: 1,
215
224
  tabindex: "-1",
216
- class: s([
225
+ class: a([
217
226
  "flex items-center justify-center text-muted-foreground",
218
- t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:text-foreground"
227
+ n.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:text-foreground"
219
228
  ]),
220
- onClick: o[2] || (o[2] = (a) => !t.disabled && r("click:icon-right", a))
229
+ onClick: o[1] || (o[1] = (i) => !n.disabled && u("click:icon-right", i))
221
230
  }, [
222
231
  x(f, {
223
- icon: t.iconRight,
232
+ icon: n.iconRight,
224
233
  class: "h-4 w-4"
225
234
  }, null, 8, ["icon"])
226
235
  ], 2)) : c("", !0),
227
- t.type === "password" && !t.disabled ? (d(), i("button", {
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
- t.showClearButton && j.value && !t.disabled && !t.loading && t.type !== "textarea" && t.type !== "password" && (p.value || w.value) ? (d(), i("button", {
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
- h.value ? (d(), i("div", {
262
+ p.value ? (d(), s("div", {
254
263
  key: 1,
255
- class: s(D.value)
264
+ class: a(D.value)
256
265
  }, [
257
- F(l.$slots, "addon-right", {}, () => [
258
- k(V(t.addonRight), 1)
266
+ F(t.$slots, "addon-right", {}, () => [
267
+ k(V(n.addonRight), 1)
259
268
  ])
260
269
  ], 2)) : c("", !0)
261
270
  ], 2)