vlite3 0.1.8 → 0.1.10

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 CHANGED
@@ -73,6 +73,7 @@ You can customize these colors in your CSS by overriding the variables in `:root
73
73
  | `--secondary` | `bg-secondary` | Secondary background | Used for secondary actions or muted sections. |
74
74
  | `--secondary-foreground` | `text-secondary-foreground` | Secondary text color | Text color for content on top of secondary background. |
75
75
  | `--muted` | `bg-muted` | Muted background | Subtle backgrounds (e.g., table headers, disabled states). |
76
+ | `--muted` | `text-muted` | Muted Text | Secondary text, Unactive Link, description. |
76
77
  | `--muted-foreground` | `text-muted-foreground` | Muted text color | Secondary text, hints, placeholders. |
77
78
  | `--accent` | `bg-accent` | Accent background | Used for hover states, selection highlights. |
78
79
  | `--accent-foreground` | `text-accent-foreground` | Accent text color | Text color on accent backgrounds. |
@@ -1,7 +1,7 @@
1
- import { defineComponent as f, openBlock as m, createBlock as u, withCtx as a, createElementVNode as x, createVNode as d, renderSlot as r } from "vue";
1
+ import { defineComponent as f, openBlock as m, createBlock as u, withCtx as a, createElementVNode as x, createVNode as r, renderSlot as d } from "vue";
2
2
  import g from "./Modal.vue.js";
3
- import s from "./Button.vue.js";
4
- const w = { class: "flex w-full items-center justify-end space-x-2 pt-4" }, p = /* @__PURE__ */ f({
3
+ import c from "./Button.vue.js";
4
+ const w = { class: "flex w-full items-center justify-end space-x-2" }, k = /* @__PURE__ */ f({
5
5
  __name: "ConfirmationModal",
6
6
  props: {
7
7
  show: { type: Boolean, default: !1 },
@@ -13,36 +13,39 @@ const w = { class: "flex w-full items-center justify-end space-x-2 pt-4" }, p =
13
13
  variant: { default: "danger" }
14
14
  },
15
15
  emits: ["cancel", "confirm"],
16
- setup(e, { emit: c }) {
17
- const i = c, n = () => {
16
+ setup(e, { emit: s }) {
17
+ const i = s, n = () => {
18
18
  i("cancel");
19
19
  };
20
20
  return (l, t) => (m(), u(g, {
21
21
  show: e.show,
22
22
  title: e.title,
23
23
  description: e.description,
24
+ footerClass: "border-t-0! pt-0! pb-3.5!",
24
25
  "max-width": "max-w-[400px]",
25
26
  onClose: n,
26
27
  "onUpdate:show": t[1] || (t[1] = (o) => !o && n())
27
28
  }, {
28
29
  trigger: a(() => [
29
- r(l.$slots, "trigger", {}, () => [
30
- r(l.$slots, "default")
30
+ d(l.$slots, "trigger", {}, () => [
31
+ d(l.$slots, "default")
31
32
  ])
32
33
  ]),
33
- default: a(() => [
34
+ footer: a(({ close: o }) => [
34
35
  x("div", w, [
35
- d(s, {
36
+ r(c, {
36
37
  variant: "outline",
37
38
  text: e.cancelText,
38
39
  disabled: e.loading,
39
- onClick: n
40
- }, null, 8, ["text", "disabled"]),
41
- d(s, {
40
+ onClick: () => {
41
+ o?.(), n?.();
42
+ }
43
+ }, null, 8, ["text", "disabled", "onClick"]),
44
+ r(c, {
42
45
  variant: e.variant,
43
46
  text: e.confirmText,
44
47
  loading: e.loading,
45
- onClick: t[0] || (t[0] = (o) => i("confirm"))
48
+ onClick: t[0] || (t[0] = (C) => i("confirm"))
46
49
  }, null, 8, ["variant", "text", "loading"])
47
50
  ])
48
51
  ]),
@@ -51,5 +54,5 @@ const w = { class: "flex w-full items-center justify-end space-x-2 pt-4" }, p =
51
54
  }
52
55
  });
53
56
  export {
54
- p as default
57
+ k as default
55
58
  };
@@ -1,4 +1,4 @@
1
- import { IDropdownOptions, IDropdownOption } from '../../types/styles';
1
+ import { IDropdownOptions, IDropdownOption } from '../../types';
2
2
  import { TooltTipPlacement } from 'v-tooltip-lite/types';
3
3
  type __VLS_Props = {
4
4
  selected?: any;
@@ -1,4 +1,4 @@
1
- import { defineComponent as z, ref as d, computed as C, watch as $, reactive as D, toRefs as R, openBlock as S, createElementBlock as j, normalizeStyle as E, createVNode as h, unref as v, withCtx as r, renderSlot as c, createBlock as U, normalizeClass as q, createSlots as F, normalizeProps as k, guardReactiveProps as w, createCommentVNode as G } from "vue";
1
+ import { defineComponent as z, ref as d, computed as C, watch as $, reactive as D, toRefs as R, openBlock as k, createElementBlock as j, normalizeStyle as E, createVNode as h, unref as v, withCtx as r, renderSlot as c, createBlock as U, normalizeClass as q, createSlots as F, normalizeProps as S, guardReactiveProps as w, createCommentVNode as G } from "vue";
2
2
  import J from "v-tooltip-lite";
3
3
  import "v-tooltip-lite/style.css";
4
4
  import K from "./DropdownMenu.vue.js";
@@ -48,15 +48,15 @@ const se = /* @__PURE__ */ z({
48
48
  confirmText: "Confirm",
49
49
  cancelText: "Cancel",
50
50
  variant: "primary"
51
- }), I = C(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), T = C(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"), p = d(l.isOpen || !1);
51
+ }), I = C(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), T = C(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"), y = d(l.isOpen || !1);
52
52
  $(
53
53
  () => l.isOpen,
54
54
  (e) => {
55
- e !== void 0 && (p.value = e);
55
+ e !== void 0 && (y.value = e);
56
56
  }
57
57
  );
58
58
  const O = (e) => {
59
- p.value = e, f("update:isOpen", e), f(e ? "onOpen" : "onClose");
59
+ y.value = e, f("update:isOpen", e), f(e ? "onOpen" : "onClose");
60
60
  }, s = d([]);
61
61
  $(
62
62
  () => l.options,
@@ -95,17 +95,17 @@ const se = /* @__PURE__ */ z({
95
95
  confirmText: "Confirm",
96
96
  cancelText: "Cancel",
97
97
  variant: "primary"
98
- }, m.value = !0, y()) : (b(e), l.closeOnSelect && y());
98
+ }, m.value = !0, p()) : (b(e), l.closeOnSelect && p());
99
99
  }, b = (e) => {
100
100
  M(e);
101
101
  }, A = () => {
102
102
  u.value && (b(u.value), u.value = null, m.value = !1);
103
103
  }, V = () => {
104
104
  u.value = null, m.value = !1;
105
- }, y = () => {
105
+ }, p = () => {
106
106
  O(!1);
107
107
  };
108
- return (e, n) => (S(), j("div", {
108
+ return (e, n) => (k(), j("div", {
109
109
  class: "relative inline-block text-left",
110
110
  style: E({ direction: t.direction })
111
111
  }, [
@@ -116,7 +116,7 @@ const se = /* @__PURE__ */ z({
116
116
  teleport: t.teleport,
117
117
  offset: t.offset,
118
118
  placement: I.value,
119
- isOpen: p.value,
119
+ isOpen: y.value,
120
120
  menuId: t.menuId,
121
121
  ignoreClickOutside: H.value,
122
122
  class: "w-full",
@@ -128,7 +128,7 @@ const se = /* @__PURE__ */ z({
128
128
  styles: { padding: "0" }
129
129
  }, {
130
130
  trigger: r(({ isOpen: o }) => [
131
- c(e.$slots, "trigger", k(w({ selectedLabel: v(g), isOpen: o })), () => [
131
+ c(e.$slots, "trigger", S(w({ selectedLabel: v(g), isOpen: o })), () => [
132
132
  h(Q, {
133
133
  "selected-label": v(g),
134
134
  "is-open": o,
@@ -139,7 +139,7 @@ const se = /* @__PURE__ */ z({
139
139
  ]),
140
140
  default: r(() => [
141
141
  c(e.$slots, "default"),
142
- t.options?.length || s.value.length || e.$slots.menu || e.$slots.item || t.remote || t.searchable ? (S(), U(K, {
142
+ t.options?.length || s.value.length || e.$slots.menu || e.$slots.item || t.remote || t.searchable ? (k(), U(K, {
143
143
  key: 0,
144
144
  options: t.options,
145
145
  cachedOptions: s.value,
@@ -158,31 +158,37 @@ const se = /* @__PURE__ */ z({
158
158
  searchable: t.searchable,
159
159
  remote: t.remote,
160
160
  onSelect: L,
161
- onClose: y,
161
+ onClose: p,
162
162
  onLoadMore: n[0] || (n[0] = (o) => e.$emit("load-more")),
163
163
  onSearch: n[1] || (n[1] = (o) => e.$emit("search", o))
164
- }, F({
165
- menu: r(() => [
166
- c(e.$slots, "menu")
167
- ]),
168
- item: r((o) => [
169
- c(e.$slots, "item", k(w(o)))
170
- ]),
171
- _: 2
172
- }, [
164
+ }, F({ _: 2 }, [
165
+ e.$slots.menu ? {
166
+ name: "menu",
167
+ fn: r(() => [
168
+ c(e.$slots, "menu")
169
+ ]),
170
+ key: "0"
171
+ } : void 0,
172
+ e.$slots.item ? {
173
+ name: "item",
174
+ fn: r((o) => [
175
+ c(e.$slots, "item", S(w(o)))
176
+ ]),
177
+ key: "1"
178
+ } : void 0,
173
179
  e.$slots.header ? {
174
180
  name: "header",
175
181
  fn: r(() => [
176
182
  c(e.$slots, "header")
177
183
  ]),
178
- key: "0"
184
+ key: "2"
179
185
  } : void 0,
180
186
  e.$slots.footer ? {
181
187
  name: "footer",
182
188
  fn: r(() => [
183
189
  c(e.$slots, "footer")
184
190
  ]),
185
- key: "1"
191
+ key: "3"
186
192
  } : void 0
187
193
  ]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote"])) : G("", !0)
188
194
  ]),
@@ -1,30 +1,30 @@
1
- import { defineComponent as G, defineAsyncComponent as J, ref as B, computed as I, watch as C, toRef as Q, onMounted as W, onBeforeUnmount as X, openBlock as o, createElementBlock as c, createVNode as p, createCommentVNode as u, renderSlot as v, createElementVNode as g, unref as n, normalizeStyle as Y, normalizeClass as T, createBlock as m, Fragment as _, renderList as Z, withCtx as N, toDisplayString as ee, mergeProps as te, nextTick as le } from "vue";
2
- import M from "../Icon.vue.js";
3
- import se from "../Input.vue.js";
4
- import oe from "./DropdownItem.vue.js";
5
- import ne from "./DropdownBooleanItem.vue.js";
6
- import re from "./DropdownGroupedLayout.vue.js";
7
- import { useDropdownNavigation as de } from "./composables/useDropdownNavigation.js";
8
- import { useDropdownIds as ce } from "./composables/useDropdownIds.js";
9
- const ae = ["dir"], ie = {
1
+ import { defineComponent as G, defineAsyncComponent as J, ref as B, computed as I, watch as C, toRef as Q, onMounted as W, onBeforeUnmount as X, openBlock as o, createElementBlock as c, createVNode as p, createCommentVNode as u, renderSlot as v, createElementVNode as g, unref as n, normalizeStyle as Y, normalizeClass as T, createBlock as m, Fragment as N, renderList as Z, withCtx as V, toDisplayString as ee, createSlots as te, mergeProps as le, nextTick as se } from "vue";
2
+ import S from "../Icon.vue.js";
3
+ import oe from "../Input.vue.js";
4
+ import ne from "./DropdownItem.vue.js";
5
+ import re from "./DropdownBooleanItem.vue.js";
6
+ import de from "./DropdownGroupedLayout.vue.js";
7
+ import { useDropdownNavigation as ce } from "./composables/useDropdownNavigation.js";
8
+ import { useDropdownIds as ae } from "./composables/useDropdownIds.js";
9
+ const ie = ["dir"], ue = {
10
10
  key: 0,
11
11
  class: "bg-body border-b mb-1 z-10 rounded-t-md shrink-0"
12
- }, ue = {
12
+ }, fe = {
13
13
  key: 1,
14
14
  class: "shrink-0"
15
- }, fe = {
15
+ }, me = {
16
16
  key: 0,
17
17
  class: "px-2 py-6 text-center text-sm text-muted-foreground"
18
- }, me = {
18
+ }, he = {
19
19
  key: 0,
20
20
  class: "h-px bg-border my-1 mx-1"
21
- }, he = ["onMouseenter"], ye = { class: "flex items-center gap-2 flex-1 min-w-0" }, ve = { class: "truncate" }, ge = {
21
+ }, ye = ["onMouseenter"], ve = { class: "flex items-center gap-2 flex-1 min-w-0" }, ge = { class: "truncate" }, ke = {
22
22
  key: 3,
23
23
  class: "flex justify-center py-2"
24
- }, ke = {
24
+ }, be = {
25
25
  key: 2,
26
26
  class: "shrink-0 border-t mt-1 pt-1"
27
- }, Be = /* @__PURE__ */ G({
27
+ }, Ie = /* @__PURE__ */ G({
28
28
  __name: "DropdownMenu",
29
29
  props: {
30
30
  options: { default: () => [] },
@@ -45,8 +45,8 @@ const ae = ["dir"], ie = {
45
45
  direction: { default: "ltr" }
46
46
  },
47
47
  emits: ["select", "close", "load-more", "search"],
48
- setup(r, { emit: V }) {
49
- const j = J(() => import("./Dropdown.vue2.js")), t = r, i = V, S = B(null), f = B(""), { getMenuId: D, getAllRecursiveIds: E } = ce(), P = I(() => t.remote ? t.searchable : t.searchable && (t.options?.length || 0) > 9);
48
+ setup(r, { emit: _ }) {
49
+ const j = J(() => import("./Dropdown.vue2.js")), t = r, i = _, M = B(null), f = B(""), { getMenuId: D, getAllRecursiveIds: E } = ae(), P = I(() => t.remote ? t.searchable : t.searchable && (t.options?.length || 0) > 9);
50
50
  let k = null;
51
51
  C(f, (e) => {
52
52
  t.remote && (k && clearTimeout(k), k = setTimeout(() => {
@@ -63,14 +63,14 @@ const ae = ["dir"], ie = {
63
63
  isKeyboardMode: w,
64
64
  filteredOptions: R,
65
65
  // rename
66
- handleKeyDown: O,
67
- handleMouseMove: $,
66
+ handleKeyDown: $,
67
+ handleMouseMove: O,
68
68
  onMouseEnterItem: x,
69
69
  scrollToIndex: z
70
- } = de({
70
+ } = ce({
71
71
  options: Q(t, "options"),
72
72
  searchQuery: f,
73
- containerRef: S,
73
+ containerRef: M,
74
74
  emit: (e, ...s) => i(e, ...s),
75
75
  handleSelect: (e, s) => b(e)
76
76
  }), y = I(() => t.remote ? f.value ? t.options : t.cachedOptions.length ? t.cachedOptions : t.options : R.value), A = (e) => {
@@ -96,7 +96,7 @@ const ae = ["dir"], ie = {
96
96
  };
97
97
  i("select", d);
98
98
  }, q = async () => {
99
- await le();
99
+ await se();
100
100
  let e = -1;
101
101
  t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = t.options.findIndex((s) => s.value === t.selected)), e !== -1 && z(e));
102
102
  };
@@ -106,15 +106,15 @@ const ae = ["dir"], ie = {
106
106
  h.value = -1;
107
107
  }
108
108
  ), W(() => {
109
- q(), window.addEventListener("keydown", O);
109
+ q(), window.addEventListener("keydown", $);
110
110
  }), X(() => {
111
- window.removeEventListener("keydown", O);
111
+ window.removeEventListener("keydown", $);
112
112
  }), (e, s) => (o(), c("div", {
113
113
  class: "dropdown-menu w-full min-w-[150px] flex flex-col",
114
114
  dir: r.direction
115
115
  }, [
116
- P.value ? (o(), c("div", ie, [
117
- p(se, {
116
+ P.value ? (o(), c("div", ue, [
117
+ p(oe, {
118
118
  modelValue: f.value,
119
119
  "onUpdate:modelValue": s[0] || (s[0] = (l) => f.value = l),
120
120
  placeholder: "Search...",
@@ -125,12 +125,12 @@ const ae = ["dir"], ie = {
125
125
  "show-clear-button": !1
126
126
  }, null, 8, ["modelValue"])
127
127
  ])) : u("", !0),
128
- e.$slots.header ? (o(), c("div", ue, [
128
+ e.$slots.header ? (o(), c("div", fe, [
129
129
  v(e.$slots, "header")
130
130
  ])) : u("", !0),
131
131
  g("div", {
132
132
  ref_key: "containerRef",
133
- ref: S,
133
+ ref: M,
134
134
  tabindex: "0",
135
135
  role: "menu",
136
136
  class: T([
@@ -139,19 +139,19 @@ const ae = ["dir"], ie = {
139
139
  ]),
140
140
  style: Y({ maxHeight: t.maxHeight }),
141
141
  onMousemove: s[1] || (s[1] = //@ts-ignore
142
- (...l) => n($) && n($)(...l)),
142
+ (...l) => n(O) && n(O)(...l)),
143
143
  onScroll: H
144
144
  }, [
145
- y.value.length === 0 && r.options?.length > 0 && !r.loading ? (o(), c("div", fe, " No options found ")) : u("", !0),
146
- r.layout === "grouped" ? (o(), m(re, {
145
+ y.value.length === 0 && r.options?.length > 0 && !r.loading ? (o(), c("div", me, " No options found ")) : u("", !0),
146
+ r.layout === "grouped" ? (o(), m(de, {
147
147
  key: 1,
148
148
  options: y.value,
149
149
  selected: r.selected,
150
150
  selectable: r.selectable,
151
151
  columns: r.columns,
152
152
  onSelect: b
153
- }, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(_, { key: 2 }, Z(y.value, (l, d) => (o(), c(_, { key: d }, [
154
- l.label === "---" ? (o(), c("div", me)) : l.data?.isBoolean ? (o(), m(ne, {
153
+ }, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(N, { key: 2 }, Z(y.value, (l, d) => (o(), c(N, { key: d }, [
154
+ l.label === "---" ? (o(), c("div", he)) : l.data?.isBoolean ? (o(), m(re, {
155
155
  key: 1,
156
156
  option: l,
157
157
  value: F(l),
@@ -173,7 +173,7 @@ const ae = ["dir"], ie = {
173
173
  direction: r.direction,
174
174
  onOnSelect: (a) => U(l, a)
175
175
  }, {
176
- trigger: N(() => [
176
+ trigger: V(() => [
177
177
  g("div", {
178
178
  "data-dropdown-item": "",
179
179
  class: T(["relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none transition-colors justify-between w-full", [
@@ -182,22 +182,22 @@ const ae = ["dir"], ie = {
182
182
  ]]),
183
183
  onMouseenter: (a) => n(x)(d)
184
184
  }, [
185
- g("div", ye, [
186
- l.icon ? (o(), m(M, {
185
+ g("div", ve, [
186
+ l.icon ? (o(), m(S, {
187
187
  key: 0,
188
188
  icon: l.icon,
189
189
  class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
190
190
  }, null, 8, ["icon"])) : u("", !0),
191
- g("span", ve, ee(l.label), 1)
191
+ g("span", ge, ee(l.label), 1)
192
192
  ]),
193
- p(M, {
193
+ p(S, {
194
194
  icon: r.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
195
195
  class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
196
196
  }, null, 8, ["icon"])
197
- ], 42, he)
197
+ ], 42, ye)
198
198
  ]),
199
199
  _: 2
200
- }, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(oe, {
200
+ }, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(ne, {
201
201
  key: 3,
202
202
  option: l,
203
203
  index: d,
@@ -206,27 +206,30 @@ const ae = ["dir"], ie = {
206
206
  selectable: r.selectable,
207
207
  onClick: (a) => b(l),
208
208
  onMouseenter: (a) => n(x)(d)
209
- }, {
210
- default: N((a) => [
211
- v(e.$slots, "item", te({ ref_for: !0 }, a))
212
- ]),
213
- _: 3
214
- }, 8, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
209
+ }, te({ _: 2 }, [
210
+ e.$slots.item ? {
211
+ name: "default",
212
+ fn: V((a) => [
213
+ v(e.$slots, "item", le({ ref_for: !0 }, a))
214
+ ]),
215
+ key: "0"
216
+ } : void 0
217
+ ]), 1032, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
215
218
  ], 64))), 128)),
216
- r.loading ? (o(), c("div", ge, [
217
- p(M, {
219
+ r.loading ? (o(), c("div", ke, [
220
+ p(S, {
218
221
  icon: "lucide:loader-2",
219
222
  class: "w-4 h-4 animate-spin text-muted-foreground"
220
223
  })
221
224
  ])) : u("", !0),
222
225
  v(e.$slots, "menu")
223
226
  ], 38),
224
- e.$slots.footer ? (o(), c("div", ke, [
227
+ e.$slots.footer ? (o(), c("div", be, [
225
228
  v(e.$slots, "footer")
226
229
  ])) : u("", !0)
227
- ], 8, ae));
230
+ ], 8, ie));
228
231
  }
229
232
  });
230
233
  export {
231
- Be as default
234
+ Ie as default
232
235
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./Form.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9ccf0187"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-353f6094"]]);
5
5
  export {
6
- f as default
6
+ p as default
7
7
  };
@@ -204,7 +204,7 @@ const le = {
204
204
  class: h([
205
205
  "form-footer flex items-center justify-end gap-3",
206
206
  e.footerClass,
207
- $.value ? "sticky bottom-0 z-20 bg-body pt-4 border-t border-border -mx-4 px-4 mt-4" : "mt-6"
207
+ $.value ? "sticky bottom-0 z-20 bg-body pt-4 border-t border-border/40 -mx-4 px-4 mt-4" : "mt-6"
208
208
  ])
209
209
  }, [
210
210
  G.value ? (s(), p(N, {
@@ -1,12 +1,13 @@
1
- import { defineComponent as k, defineAsyncComponent as t, computed as i, markRaw as V, openBlock as w, createBlock as x, resolveDynamicComponent as C, mergeProps as P, toHandlers as U } from "vue";
1
+ import { defineComponent as b, defineAsyncComponent as t, computed as i, markRaw as k, openBlock as V, createBlock as x, resolveDynamicComponent as w, mergeProps as C, toHandlers as P } from "vue";
2
2
  import { isComponent as o } from "./utils/form.utils.js";
3
3
  import d from "../Input.vue.js";
4
- import z from "../Switch.vue.js";
5
- import S from "../CheckBox.vue.js";
6
- import F from "../Textarea.vue.js";
7
- import $ from "../FilePicker/FilePicker.vue.js";
8
- import A from "../AvatarUploader/AvatarUploader.vue.js";
9
- const M = /* @__PURE__ */ k({
4
+ import U from "../Switch.vue.js";
5
+ import z from "../CheckBox.vue.js";
6
+ import S from "../Textarea.vue.js";
7
+ import F from "../FilePicker/FilePicker.vue.js";
8
+ import $ from "../AvatarUploader/AvatarUploader.vue.js";
9
+ import A from "../Dropdown/Dropdown.vue.js";
10
+ const O = /* @__PURE__ */ b({
10
11
  __name: "FormField",
11
12
  props: {
12
13
  field: {},
@@ -22,14 +23,14 @@ const M = /* @__PURE__ */ k({
22
23
  },
23
24
  emits: ["change"],
24
25
  setup(n, { emit: c }) {
25
- const u = t(() => import("../Dropdown/Dropdown.vue2.js")), f = t(() => import("../MultiSelect/MultiSelect.vue2.js")), p = t(() => import("../DatePicker.vue2.js")), m = t(() => import("../ColorPicker/ColorPicker.vue2.js")), h = t(() => import("../IconPicker.vue2.js")), v = t(() => import("./CustomFields.vue.js")), r = n, s = c, l = (e, a) => {
26
+ const u = t(() => import("../MultiSelect/MultiSelect.vue2.js")), f = t(() => import("../DatePicker.vue2.js")), m = t(() => import("../ColorPicker/ColorPicker.vue2.js")), p = t(() => import("../IconPicker.vue2.js")), h = t(() => import("./CustomFields.vue.js")), r = n, s = c, l = (e, a) => {
26
27
  s("change", { value: e, data: a });
27
- }, y = (e) => {
28
+ }, v = (e) => {
28
29
  s("change", { value: e });
29
- }, g = i(() => {
30
+ }, _ = i(() => {
30
31
  const e = r.field.type;
31
32
  if (o(e))
32
- return V(e);
33
+ return k(e);
33
34
  switch (e) {
34
35
  case "text":
35
36
  case "email":
@@ -40,33 +41,33 @@ const M = /* @__PURE__ */ k({
40
41
  case "search":
41
42
  return d;
42
43
  case "textarea":
43
- return F;
44
+ return S;
44
45
  case "switch":
45
- return z;
46
+ return U;
46
47
  case "check":
47
- return S;
48
+ return z;
48
49
  case "select":
49
- return u;
50
+ return A;
50
51
  case "multiSelect":
51
- return f;
52
+ return u;
52
53
  case "date":
53
54
  case "time":
54
- return p;
55
+ return f;
55
56
  case "file":
56
57
  case "fileUploader":
57
- return $;
58
+ return F;
58
59
  case "avatarUpload":
59
- return A;
60
+ return $;
60
61
  case "color":
61
62
  return m;
62
63
  case "iconPicker":
63
- return h;
64
+ return p;
64
65
  case "customFields":
65
- return v;
66
+ return h;
66
67
  default:
67
68
  return d;
68
69
  }
69
- }), _ = i(() => {
70
+ }), y = i(() => {
70
71
  const e = r.field.type, a = {
71
72
  disabled: r.disabled || r.field.disabled === !0,
72
73
  ...r.field.props || {}
@@ -155,10 +156,10 @@ const M = /* @__PURE__ */ k({
155
156
  value: r.value,
156
157
  values: r.values
157
158
  } : a;
158
- }), b = i(() => {
159
+ }), g = i(() => {
159
160
  const e = r.field.type;
160
161
  return e === "text" || e === "email" || e === "password" || e === "number" || e === "tel" || e === "url" || e === "search" || e === "textarea" || e === "switch" || e === "check" || !e ? {
161
- "update:modelValue": y
162
+ "update:modelValue": v
162
163
  } : e === "select" ? {
163
164
  onSelect: (a) => {
164
165
  l(a.value, a.data);
@@ -187,12 +188,12 @@ const M = /* @__PURE__ */ k({
187
188
  }
188
189
  } : {};
189
190
  });
190
- return (e, a) => (w(), x(C(g.value), P({
191
- ..._.value,
191
+ return (e, a) => (V(), x(w(_.value), C({
192
+ ...y.value,
192
193
  ...n.field?.props || {}
193
- }, U(b.value)), null, 16));
194
+ }, P(g.value)), null, 16));
194
195
  }
195
196
  });
196
197
  export {
197
- M as default
198
+ O as default
198
199
  };
@@ -4,6 +4,7 @@ function g() {
4
4
  const s = u(!1), a = u(null), i = d(), c = async (r, t) => {
5
5
  try {
6
6
  const e = r instanceof File ? r : r.file;
7
+ if (!e) return null;
7
8
  if (i.services?.upload)
8
9
  try {
9
10
  return await i.services.upload(e, t);