vlite3 1.0.4 → 1.0.6

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 (49) hide show
  1. package/components/AttachmentsList/AttachmentsList.vue.d.ts +19 -3
  2. package/components/AttachmentsList/AttachmentsList.vue.js +274 -111
  3. package/components/AttachmentsList/fileTypeIcon.d.ts +16 -0
  4. package/components/AttachmentsList/fileTypeIcon.js +127 -0
  5. package/components/AttachmentsList/index.d.ts +1 -0
  6. package/components/AttachmentsList/types.d.ts +74 -2
  7. package/components/Avatar.vue.js +2 -2
  8. package/components/Badge.vue.js +7 -7
  9. package/components/Button.vue.js +36 -43
  10. package/components/ButtonGroup.vue.js +2 -2
  11. package/components/ButtonGroup.vue2.js +8 -8
  12. package/components/CategoryManager/CategoryManager.vue.d.ts +36 -0
  13. package/components/CategoryManager/CategoryNode.vue.d.ts +15 -0
  14. package/components/CategoryManager/index.d.ts +2 -0
  15. package/components/CategoryManager/types.d.ts +43 -0
  16. package/components/Chat/ChatBubble.vue.js +70 -56
  17. package/components/Chat/ChatInterface.vue.js +182 -142
  18. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  19. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  20. package/components/Dropdown/DropdownMenu.vue.js +2 -2
  21. package/components/Dropdown/DropdownMenu.vue2.js +1 -0
  22. package/components/FilePicker/FilePicker.vue.js +117 -122
  23. package/components/Input.vue.js +28 -26
  24. package/components/Kanban/Kanban.vue.d.ts +7 -16
  25. package/components/Kanban/Kanban.vue.js +1 -1
  26. package/components/Kanban/Kanban.vue2.js +79 -47
  27. package/components/Kanban/KanbanBoard.vue.js +2 -2
  28. package/components/Kanban/KanbanBoard.vue2.js +21 -21
  29. package/components/Kanban/types.d.ts +3 -0
  30. package/components/List/List.vue.js +89 -85
  31. package/components/Navbar/Navbar.vue.d.ts +4 -0
  32. package/components/Navbar/Navbar.vue.js +196 -173
  33. package/components/Navbar/NavbarTabs.vue.js +72 -66
  34. package/components/NavbarCommandPalette.vue.js +11 -11
  35. package/components/NumberInput.vue.js +2 -2
  36. package/components/NumberInput.vue2.js +144 -104
  37. package/components/Screen/Screen.vue.d.ts +12 -29
  38. package/components/Screen/Screen.vue.js +228 -195
  39. package/components/Screen/components/ScreenViewToggle.vue.d.ts +6 -3
  40. package/components/Screen/components/ScreenViewToggle.vue.js +29 -34
  41. package/components/Screen/types.d.ts +59 -7
  42. package/components/Stats/Stats.vue.d.ts +1 -0
  43. package/components/Stats/Stats.vue.js +184 -156
  44. package/components/Stats/types.d.ts +1 -0
  45. package/components/Workbook/Sheet.vue.d.ts +1 -1
  46. package/directives/vRipple.js +28 -9
  47. package/index.js +87 -85
  48. package/package.json +1 -1
  49. package/style.css +1 -1
@@ -1,26 +1,23 @@
1
- import { defineComponent as Z, computed as m, ref as C, useSlots as _, openBlock as a, createElementBlock as u, createElementVNode as s, renderSlot as ee, normalizeClass as T, createBlock as b, withModifiers as F, createVNode as k, toDisplayString as h, createTextVNode as le, createCommentVNode as S, Fragment as te, renderList as ie } from "vue";
1
+ import { defineComponent as Z, computed as m, ref as A, useSlots as _, openBlock as r, createElementBlock as f, createElementVNode as s, renderSlot as ee, normalizeClass as C, createBlock as v, withModifiers as V, createVNode as F, toDisplayString as h, createTextVNode as le, createCommentVNode as T, Fragment as te, renderList as ie } from "vue";
2
2
  import p from "../Icon.vue.js";
3
3
  import N from "../Button.vue.js";
4
- import { $t as w } from "../../utils/i18n.js";
5
- const oe = { class: "w-full" }, re = ["multiple", "accept"], ae = ["value", "placeholder", "disabled"], se = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 bg-background" }, ne = { class: "p-3 bg-muted rounded-full text-muted-foreground" }, de = { class: "space-y-1" }, ue = { class: "text-sm font-medium text-foreground" }, ce = { class: "text-primary hover:underline" }, fe = {
4
+ import { $t as k } from "../../utils/i18n.js";
5
+ const oe = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "placeholder", "disabled"], ne = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 bg-background" }, se = { class: "p-3 bg-muted rounded-full text-muted-foreground" }, de = { class: "space-y-1" }, ue = { class: "text-sm font-medium text-foreground" }, ce = { class: "text-primary hover:underline" }, fe = {
6
6
  key: 0,
7
7
  class: "text-xs text-muted-foreground"
8
8
  }, me = {
9
9
  key: 1,
10
10
  class: "space-y-2"
11
- }, ge = { class: "shrink-0 mr-3" }, pe = { class: "p-2 bg-primary-light rounded text-primary-fg-light" }, he = { class: "flex-1 min-w-0 flex flex-col items-start overflow-hidden" }, ve = {
11
+ }, ge = { class: "shrink-0 mr-3" }, pe = { class: "p-2 bg-primary-light rounded text-primary-fg-light" }, ve = { class: "flex-1 min-w-0 flex flex-col items-start overflow-hidden" }, he = {
12
12
  key: 0,
13
13
  class: "inline-flex items-center group/rename w-fit max-w-full mb-0.5"
14
14
  }, ye = { class: "grid relative w-fit max-w-full items-center -ml-1" }, xe = { class: "invisible whitespace-pre col-start-1 row-start-1 text-sm font-medium px-1 py-0.5 max-w-full overflow-hidden text-ellipsis" }, be = ["value", "onInput"], ke = {
15
15
  key: 1,
16
16
  class: "text-sm font-medium text-foreground truncate w-full"
17
- }, we = { class: "text-xs text-muted-foreground" }, Ve = { class: "flex-shrink-0 ml-3 flex gap-2" }, Fe = {
17
+ }, we = { class: "text-xs text-muted-foreground -mt-1" }, Ve = { class: "flex-shrink-0 ml-3 flex gap-2 items-center" }, Fe = {
18
18
  key: 0,
19
19
  class: "flex gap-2"
20
- }, Se = {
21
- key: 2,
22
- class: "absolute inset-0 bg-white/80 flex items-center justify-center rounded-lg z-10"
23
- }, Ae = { class: "bg-white p-2 rounded-full" }, Be = /* @__PURE__ */ Z({
20
+ }, ze = /* @__PURE__ */ Z({
24
21
  name: "FilePicker",
25
22
  __name: "FilePicker",
26
23
  props: {
@@ -42,21 +39,21 @@ const oe = { class: "w-full" }, re = ["multiple", "accept"], ae = ["value", "pla
42
39
  },
43
40
  emits: ["update:modelValue", "change", "error"],
44
41
  setup(o, { emit: M }) {
45
- const e = o, d = M, P = m(
46
- () => e.placeholderI18n ? w(e.placeholderI18n) : e.placeholder !== void 0 ? e.placeholder : "Select file..."
42
+ const e = o, u = M, P = m(
43
+ () => e.placeholderI18n ? k(e.placeholderI18n) : e.placeholder !== void 0 ? e.placeholder : "Select file..."
47
44
  ), $ = m(() => {
48
- if (e.textI18n) return w(e.textI18n);
49
- const l = w("vlite.filePicker.clickToUpload");
45
+ if (e.textI18n) return k(e.textI18n);
46
+ const l = k("vlite.filePicker.clickToUpload");
50
47
  return l !== "vlite.filePicker.clickToUpload" ? l : "Click to upload";
51
48
  }), j = m(() => {
52
- const l = w("vlite.filePicker.dragAndDrop");
49
+ const l = k("vlite.filePicker.dragAndDrop");
53
50
  return l !== "vlite.filePicker.dragAndDrop" ? l : "or drag and drop";
54
51
  }), U = m(() => {
55
- const l = w("vlite.filePicker.addMore");
52
+ const l = k("vlite.filePicker.addMore");
56
53
  return l !== "vlite.filePicker.addMore" ? l : "Add more";
57
- }), z = C(null), v = C(!1), c = C(!1);
54
+ }), z = A(null), y = A(!1), n = A(!1);
58
55
  _();
59
- const E = m(() => e.fileTypes.join(",")), A = m(() => Array.isArray(e.modelValue) ? e.modelValue.length > 0 : e.modelValue !== null), V = m(() => {
56
+ const E = m(() => e.fileTypes.join(",")), S = m(() => Array.isArray(e.modelValue) ? e.modelValue.length > 0 : e.modelValue !== null), w = m(() => {
60
57
  let l = [];
61
58
  return Array.isArray(e.modelValue) ? l = e.modelValue : e.modelValue && (l = [e.modelValue]), l.map((t) => {
62
59
  if (typeof t == "string") {
@@ -72,96 +69,96 @@ const oe = { class: "w-full" }, re = ["multiple", "accept"], ae = ["value", "pla
72
69
  }
73
70
  return t;
74
71
  });
75
- }), y = () => {
76
- if (!(e.disabled || e.loading || c.value)) {
72
+ }), x = () => {
73
+ if (!(e.disabled || e.loading || n.value)) {
77
74
  if (e.multiSelect && e.maxFiles && (Array.isArray(e.modelValue) ? e.modelValue.length : e.modelValue ? 1 : 0) >= e.maxFiles) {
78
- d("error", `Maximum ${e.maxFiles} files allowed`);
75
+ u("error", `Maximum ${e.maxFiles} files allowed`);
79
76
  return;
80
77
  }
81
78
  z.value?.click();
82
79
  }
83
80
  }, L = (l) => {
84
- l.preventDefault(), !(e.disabled || e.loading) && (v.value = !0);
81
+ l.preventDefault(), !(e.disabled || e.loading) && (y.value = !0);
85
82
  }, R = (l) => {
86
- l.preventDefault(), v.value = !1;
83
+ l.preventDefault(), y.value = !1;
87
84
  }, W = (l) => {
88
- l.preventDefault(), v.value = !1, !(e.disabled || e.loading || c.value) && l.dataTransfer?.files && D(l.dataTransfer.files);
85
+ l.preventDefault(), y.value = !1, !(e.disabled || e.loading || n.value) && l.dataTransfer?.files && D(l.dataTransfer.files);
89
86
  }, O = (l) => {
90
87
  const t = l.target;
91
88
  t.files && D(t.files), t.value = "";
92
89
  }, q = (l) => {
93
90
  if (l === 0 || !l) return "";
94
- const t = 1024, i = ["Bytes", "KB", "MB", "GB", "TB"], n = Math.floor(Math.log(l) / Math.log(t));
95
- return parseFloat((l / Math.pow(t, n)).toFixed(2)) + " " + i[n];
91
+ const t = 1024, i = ["Bytes", "KB", "MB", "GB", "TB"], d = Math.floor(Math.log(l) / Math.log(t));
92
+ return parseFloat((l / Math.pow(t, d)).toFixed(2)) + " " + i[d];
96
93
  }, G = (l) => new Promise((t, i) => {
97
- const n = new FileReader();
98
- n.readAsDataURL(l), n.onload = () => {
99
- typeof n.result == "string" ? t(n.result) : i(new Error("Failed to read file as base64"));
100
- }, n.onerror = (f) => i(f);
94
+ const d = new FileReader();
95
+ d.readAsDataURL(l), d.onload = () => {
96
+ typeof d.result == "string" ? t(d.result) : i(new Error("Failed to read file as base64"));
97
+ }, d.onerror = (c) => i(c);
101
98
  }), D = async (l) => {
102
99
  if (l.length === 0) return;
103
- c.value = !0;
104
- const t = [], i = [], n = Array.from(l);
105
- let f = e.multiSelect ? n : [n[0]];
100
+ n.value = !0;
101
+ const t = [], i = [], d = Array.from(l);
102
+ let c = e.multiSelect ? d : [d[0]];
106
103
  if (e.multiSelect && e.maxFiles) {
107
- const r = Array.isArray(e.modelValue) ? e.modelValue.length : e.modelValue ? 1 : 0, g = e.maxFiles - r;
104
+ const a = Array.isArray(e.modelValue) ? e.modelValue.length : e.modelValue ? 1 : 0, g = e.maxFiles - a;
108
105
  if (g <= 0) {
109
- d("error", `Maximum ${e.maxFiles} files allowed`), c.value = !1;
106
+ u("error", `Maximum ${e.maxFiles} files allowed`), n.value = !1;
110
107
  return;
111
108
  }
112
- f.length > g && (i.push(`Only ${g} more file(s) allowed. Maximum ${e.maxFiles} files.`), f = f.slice(0, g));
109
+ c.length > g && (i.push(`Only ${g} more file(s) allowed. Maximum ${e.maxFiles} files.`), c = c.slice(0, g));
113
110
  }
114
111
  try {
115
- for (const r of f) {
116
- if (e.fileTypes.length > 0 && !e.fileTypes.some((x) => {
117
- if (x.startsWith("."))
118
- return r.name.toLowerCase().endsWith(x.toLowerCase());
119
- if (x.endsWith("/*")) {
120
- const Y = x.split("/")[0];
121
- return r.type.startsWith(Y);
112
+ for (const a of c) {
113
+ if (e.fileTypes.length > 0 && !e.fileTypes.some((b) => {
114
+ if (b.startsWith("."))
115
+ return a.name.toLowerCase().endsWith(b.toLowerCase());
116
+ if (b.endsWith("/*")) {
117
+ const Y = b.split("/")[0];
118
+ return a.type.startsWith(Y);
122
119
  }
123
- return r.type === x;
120
+ return a.type === b;
124
121
  })) {
125
- i.push(`File type not allowed: ${r.name}`);
122
+ i.push(`File type not allowed: ${a.name}`);
126
123
  continue;
127
124
  }
128
125
  let g = !1;
129
- e.maxSize && r.size > e.maxSize && (i.push(`File too large: ${r.name}`), g = !0);
126
+ e.maxSize && a.size > e.maxSize && (i.push(`File too large: ${a.name}`), g = !0);
130
127
  let B = "";
131
128
  if (e.returnFormat === "base64" && !g)
132
129
  try {
133
- B = await G(r);
130
+ B = await G(a);
134
131
  } catch (I) {
135
132
  console.error("Base64 read failed", I);
136
133
  }
137
134
  t.push({
138
- fileName: r.name,
139
- fileType: r.type,
140
- fileSize: r.size,
141
- file: r,
135
+ fileName: a.name,
136
+ fileType: a.type,
137
+ fileSize: a.size,
138
+ file: a,
142
139
  base64: B
143
140
  });
144
141
  }
145
- if (i.length > 0 && d("error", i.join("; ")), t.length > 0) {
146
- let r;
147
- e.multiSelect ? r = [...Array.isArray(e.modelValue) ? e.modelValue : e.modelValue ? [e.modelValue] : [], ...t] : r = t[0], d("update:modelValue", r), d("change", r);
142
+ if (i.length > 0 && u("error", i.join("; ")), t.length > 0) {
143
+ let a;
144
+ e.multiSelect ? a = [...Array.isArray(e.modelValue) ? e.modelValue : e.modelValue ? [e.modelValue] : [], ...t] : a = t[0], u("update:modelValue", a), u("change", a);
148
145
  }
149
- } catch (r) {
150
- console.error("Error processing files:", r), d("error", "Failed to process files");
146
+ } catch (a) {
147
+ console.error("Error processing files:", a), u("error", "Failed to process files");
151
148
  } finally {
152
- c.value = !1;
149
+ n.value = !1;
153
150
  }
154
151
  }, K = (l) => {
155
152
  if (!(e.disabled || e.loading))
156
153
  if (e.multiSelect && Array.isArray(e.modelValue)) {
157
154
  const t = [...e.modelValue];
158
- t.splice(l, 1), d("update:modelValue", t), d("change", t);
155
+ t.splice(l, 1), u("update:modelValue", t), u("change", t);
159
156
  } else
160
- d("update:modelValue", null), d("change", null);
157
+ u("update:modelValue", null), u("change", null);
161
158
  }, H = () => {
162
- e.disabled || e.loading || (d("update:modelValue", null), d("change", null));
159
+ e.disabled || e.loading || (u("update:modelValue", null), u("change", null));
163
160
  }, J = (l, t) => {
164
- if (e.disabled || e.loading) return;
161
+ if (e.disabled || e.loading || n.value) return;
165
162
  let i;
166
163
  e.multiSelect && Array.isArray(e.modelValue) ? (i = [...e.modelValue], typeof i[l] == "object" && i[l] !== null ? i[l] = { ...i[l], fileName: t } : typeof i[l] == "string" && (i[l] = {
167
164
  fileName: t,
@@ -177,8 +174,8 @@ const oe = { class: "w-full" }, re = ["multiple", "accept"], ae = ["value", "pla
177
174
  file: null,
178
175
  base64: e.modelValue,
179
176
  isUrl: !0
180
- }), i !== void 0 && (d("update:modelValue", i), d("change", i));
181
- }, Q = m(() => A.value ? V.value.map((t) => t.fileName).join(", ") : ""), X = m(() => {
177
+ }), i !== void 0 && (u("update:modelValue", i), u("change", i));
178
+ }, Q = m(() => S.value ? w.value.map((t) => t.fileName).join(", ") : ""), X = m(() => {
182
179
  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 disabled:cursor-not-allowed disabled:opacity-50 transition-all focus-visible:outline-none cursor-pointer", t = {
183
180
  sm: "h-8 text-xs",
184
181
  md: "h-10 text-sm",
@@ -203,7 +200,7 @@ const oe = { class: "w-full" }, re = ["multiple", "accept"], ae = ["value", "pla
203
200
  e.disabled ? "cursor-not-allowed opacity-50" : ""
204
201
  ].join(" ");
205
202
  });
206
- return (l, t) => (a(), u("div", oe, [
203
+ return (l, t) => (r(), f("div", oe, [
207
204
  s("input", {
208
205
  ref_key: "fileInput",
209
206
  ref: z,
@@ -212,133 +209,139 @@ const oe = { class: "w-full" }, re = ["multiple", "accept"], ae = ["value", "pla
212
209
  accept: E.value,
213
210
  class: "hidden",
214
211
  onChange: O
215
- }, null, 40, re),
212
+ }, null, 40, ae),
216
213
  ee(l.$slots, "trigger", {
217
- trigger: y,
218
- isDragging: v.value,
219
- isLoading: o.loading || c.value,
220
- files: V.value
214
+ trigger: x,
215
+ isDragging: y.value,
216
+ isLoading: o.loading || n.value,
217
+ files: w.value
221
218
  }, () => [
222
- o.variant === "input" ? (a(), u("div", {
219
+ o.variant === "input" ? (r(), f("div", {
223
220
  key: 0,
224
221
  class: "relative",
225
- onClick: y
222
+ onClick: x
226
223
  }, [
227
224
  s("input", {
228
225
  type: "text",
229
226
  value: Q.value,
230
227
  placeholder: P.value,
231
228
  readonly: "",
232
- class: T(X.value),
233
- disabled: o.disabled || o.loading || c.value
234
- }, null, 10, ae),
235
- s("div", se, [
236
- o.loading || c.value ? (a(), b(p, {
229
+ class: C(X.value),
230
+ disabled: o.disabled || o.loading || n.value
231
+ }, null, 10, re),
232
+ s("div", ne, [
233
+ o.loading || n.value ? (r(), v(p, {
237
234
  key: 0,
238
235
  icon: "lucide:loader-2",
239
236
  class: "h-4 w-4 animate-spin text-muted-foreground"
240
- })) : A.value && !o.disabled ? (a(), u("button", {
237
+ })) : S.value && !o.disabled ? (r(), f("button", {
241
238
  key: 1,
242
239
  type: "button",
243
240
  class: "text-muted-foreground hover:text-foreground focus:outline-none",
244
- onClick: F(H, ["stop"])
241
+ onClick: V(H, ["stop"])
245
242
  }, [
246
- k(p, {
243
+ F(p, {
247
244
  icon: "lucide:x-circle",
248
245
  class: "h-4 w-4"
249
246
  })
250
- ])) : (a(), b(p, {
247
+ ])) : (r(), v(p, {
251
248
  key: 2,
252
249
  icon: "lucide:upload",
253
250
  class: "h-4 w-4 text-muted-foreground"
254
251
  }))
255
252
  ])
256
- ])) : (a(), u("div", {
253
+ ])) : (r(), f("div", {
257
254
  key: 1,
258
255
  class: "relative",
259
256
  onDragover: L,
260
257
  onDragleave: R,
261
258
  onDrop: W
262
259
  }, [
263
- A.value ? (a(), u("div", me, [
264
- (a(!0), u(te, null, ie(V.value, (i, n) => (a(), u("div", {
265
- key: n,
266
- class: T(["relative flex items-center p-3 border border-border rounded-lg bg-body transition-colors group", [!o.multiSelect && !o.disabled ? "cursor-pointer hover:border-primary/50" : ""]]),
267
- onClick: t[2] || (t[2] = (f) => !o.multiSelect && !o.disabled ? y() : null)
260
+ S.value ? (r(), f("div", me, [
261
+ (r(!0), f(te, null, ie(w.value, (i, d) => (r(), f("div", {
262
+ key: d,
263
+ class: C(["relative flex items-center p-3 border border-border rounded-lg bg-body transition-colors group", [
264
+ !o.multiSelect && !o.disabled && !o.loading && !n.value ? "cursor-pointer hover:border-primary/50" : ""
265
+ ]]),
266
+ onClick: t[2] || (t[2] = (c) => !o.multiSelect && !o.disabled && !o.loading && !n.value ? x() : null)
268
267
  }, [
269
268
  s("div", ge, [
270
269
  s("div", pe, [
271
- k(p, {
270
+ F(p, {
272
271
  icon: "lucide:file-text",
273
272
  class: "w-5 h-5"
274
273
  })
275
274
  ])
276
275
  ]),
277
- s("div", he, [
278
- o.allowRename && !o.disabled ? (a(), u("div", ve, [
276
+ s("div", ve, [
277
+ o.allowRename && !o.disabled && !o.loading && !n.value ? (r(), f("div", he, [
279
278
  s("div", ye, [
280
279
  s("span", xe, h(i.fileName || "Enter file name"), 1),
281
280
  s("input", {
282
281
  value: i.fileName,
283
- onClick: t[0] || (t[0] = F(() => {
282
+ onClick: t[0] || (t[0] = V(() => {
284
283
  }, ["stop"])),
285
- onInput: (f) => J(n, f.target.value),
284
+ onInput: (c) => J(d, c.target.value),
286
285
  class: "col-start-1 row-start-1 w-auto min-w-[2ch] text-sm font-medium text-foreground bg-transparent border-b border-transparent hover:border-border focus:border-primary outline-none transition-colors py-0.5 px-1",
287
286
  placeholder: "Enter file name"
288
287
  }, null, 40, be)
289
288
  ]),
290
289
  s("div", {
291
290
  class: "flex-shrink-0 ml-1 text-muted-foreground/50 group-hover/rename:text-foreground transition-colors cursor-text",
292
- onClick: t[1] || (t[1] = F(
293
- (f) => f.currentTarget.previousElementSibling?.querySelector("input")?.focus(),
291
+ onClick: t[1] || (t[1] = V(
292
+ (c) => c.currentTarget.previousElementSibling?.querySelector("input")?.focus(),
294
293
  ["stop"]
295
294
  )),
296
295
  title: "Rename file"
297
296
  }, [
298
- k(p, {
297
+ F(p, {
299
298
  icon: "lucide:pencil",
300
- class: "w-3.5 h-3.5"
299
+ class: "w-3 h-3"
301
300
  })
302
301
  ])
303
- ])) : (a(), u("p", ke, h(i.fileName), 1)),
302
+ ])) : (r(), f("p", ke, h(i.fileName), 1)),
304
303
  s("p", we, h(q(i.fileSize)), 1)
305
304
  ]),
306
305
  s("div", Ve, [
307
- !o.disabled && !o.loading ? (a(), b(N, {
306
+ o.loading || n.value ? (r(), v(p, {
308
307
  key: 0,
308
+ icon: "lucide:loader-2",
309
+ class: "w-4 h-4 animate-spin text-primary"
310
+ })) : o.disabled ? T("", !0) : (r(), v(N, {
311
+ key: 1,
309
312
  size: "xs",
310
313
  variant: "ghost",
311
314
  icon: "lucide:x",
312
315
  rounded: "full",
313
316
  class: "text-muted-foreground hover:text-destructive hover:bg-destructive/10",
314
- onClick: F((f) => K(n), ["stop"])
315
- }, null, 8, ["onClick"])) : S("", !0)
317
+ onClick: V((c) => K(d), ["stop"])
318
+ }, null, 8, ["onClick"]))
316
319
  ])
317
320
  ], 2))), 128)),
318
- o.multiSelect && (!o.maxFiles || V.value.length < o.maxFiles) ? (a(), u("div", Fe, [
319
- k(N, {
321
+ o.multiSelect && (!o.maxFiles || w.value.length < o.maxFiles) ? (r(), f("div", Fe, [
322
+ F(N, {
320
323
  size: "sm",
321
324
  variant: "outline",
322
325
  icon: "lucide:plus",
323
326
  text: U.value,
324
- disabled: o.disabled || o.loading || c.value,
325
- onClick: y
327
+ disabled: o.disabled || o.loading || n.value,
328
+ onClick: x
326
329
  }, null, 8, ["text", "disabled"])
327
- ])) : S("", !0)
328
- ])) : (a(), u("div", {
330
+ ])) : T("", !0)
331
+ ])) : (r(), f("div", {
329
332
  key: 0,
330
- class: T(["border-2 bg-body border-dashed border-border rounded-lg p-6 transition-all duration-200 ease-in-out cursor-pointer flex flex-col items-center justify-center text-center gap-2", [
331
- v.value ? "border-primary bg-primary/5" : "hover:border-primary/50 ",
332
- o.disabled || o.loading || c.value ? "opacity-50 cursor-not-allowed" : ""
333
+ class: C(["border-2 bg-body border-dashed border-border rounded-lg p-6 transition-all duration-200 ease-in-out cursor-pointer flex flex-col items-center justify-center text-center gap-2", [
334
+ y.value ? "border-primary bg-primary/5" : "hover:border-primary/50 ",
335
+ o.disabled || o.loading || n.value ? "opacity-50 cursor-not-allowed" : ""
333
336
  ]]),
334
- onClick: y
337
+ onClick: x
335
338
  }, [
336
- s("div", ne, [
337
- o.loading || c.value ? (a(), b(p, {
339
+ s("div", se, [
340
+ o.loading || n.value ? (r(), v(p, {
338
341
  key: 0,
339
342
  icon: "lucide:loader-2",
340
343
  class: "w-6 h-6 animate-spin"
341
- })) : (a(), b(p, {
344
+ })) : (r(), v(p, {
342
345
  key: 1,
343
346
  icon: "lucide:upload-cloud",
344
347
  class: "w-6 h-6"
@@ -349,22 +352,14 @@ const oe = { class: "w-full" }, re = ["multiple", "accept"], ae = ["value", "pla
349
352
  s("span", ce, h($.value), 1),
350
353
  le(" " + h(j.value), 1)
351
354
  ]),
352
- o.fileTypes.length ? (a(), u("p", fe, h(o.fileTypes.join(", ")), 1)) : S("", !0)
355
+ o.fileTypes.length ? (r(), f("p", fe, h(o.fileTypes.join(", ")), 1)) : T("", !0)
353
356
  ])
354
- ], 2)),
355
- o.loading || c.value ? (a(), u("div", Se, [
356
- s("div", Ae, [
357
- k(p, {
358
- icon: "lucide:loader-2",
359
- class: "w-6 h-6 animate-spin text-primary"
360
- })
361
- ])
362
- ])) : S("", !0)
357
+ ], 2))
363
358
  ], 32))
364
359
  ])
365
360
  ]));
366
361
  }
367
362
  });
368
363
  export {
369
- Be as default
364
+ ze as default
370
365
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as Y, computed as a, useSlots as Z, ref as b, onMounted as _, nextTick as z, openBlock as d, createElementBlock as u, normalizeClass as r, createBlock as R, withCtx as ee, createTextVNode as $, toDisplayString as w, createCommentVNode as i, createElementVNode as A, renderSlot as T, createVNode as k } from "vue";
2
- import v from "./Icon.vue.js";
1
+ import { defineComponent as Y, computed as a, useSlots as Z, ref as v, onMounted as _, nextTick as z, openBlock as d, createElementBlock as u, normalizeClass as r, createBlock as R, withCtx as ee, createTextVNode as $, toDisplayString as w, createCommentVNode as i, createElementVNode as A, renderSlot as M, createVNode as k } from "vue";
2
+ import g from "./Icon.vue.js";
3
3
  import te from "./Label.vue.js";
4
4
  import le from "./Textarea.vue.js";
5
5
  import { $t as E } from "../utils/i18n.js";
@@ -41,7 +41,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
41
41
  setup(t, { emit: D }) {
42
42
  const e = t, c = D, s = a(() => e.labelI18n ? E(e.labelI18n) : e.label), I = a(
43
43
  () => e.placeholderI18n ? E(e.placeholderI18n) : e.placeholder
44
- ), g = Z(), m = b(null), x = b(!1), y = b(!1), H = a(() => e.type === "password" && x.value ? "text" : e.type), C = a(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), V = a(() => p.value || C.value || y.value), h = a(() => !!e.addonLeft || !!g["addon-left"]), B = a(() => !!e.addonRight || !!g["addon-right"]), U = a(() => [
44
+ ), x = Z(), m = v(null), y = v(!1), h = v(!1), H = a(() => e.type === "password" && y.value ? "text" : e.type), C = a(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), V = a(() => b.value || C.value || h.value), p = a(() => !!e.addonLeft || !!x["addon-left"]), B = a(() => !!e.addonRight || !!x["addon-right"]), U = a(() => [
45
45
  "relative w-full",
46
46
  e.class,
47
47
  e.labelPosition === "left" ? "flex items-center gap-4" : "",
@@ -69,16 +69,16 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
69
69
  "2xl": "rounded-2xl",
70
70
  full: "rounded-full"
71
71
  }[e.rounded];
72
- h.value && (e.rounded === "md" ? o = "rounded-r-md rounded-l-none" : e.rounded === "sm" ? o = "rounded-r-sm rounded-l-none" : e.rounded === "lg" ? o = "rounded-r-lg rounded-l-none" : e.rounded === "full" ? o = "rounded-r-full rounded-l-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-r-").replace("rounded-l-", ""))), B.value && (h.value ? o = "rounded-none" : e.rounded === "md" ? o = "rounded-l-md rounded-r-none" : e.rounded === "sm" ? o = "rounded-l-sm rounded-r-none" : e.rounded === "lg" ? o = "rounded-l-lg rounded-r-none" : e.rounded === "full" ? o = "rounded-l-full rounded-r-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-l-").replace("rounded-r-", ""))), e.variant === "outline-b" && (o = "rounded-none");
73
- const M = e.variant === "outline-b" || e.variant === "transparent";
72
+ p.value && (e.rounded === "md" ? o = "rounded-r-md rounded-l-none" : e.rounded === "sm" ? o = "rounded-r-sm rounded-l-none" : e.rounded === "lg" ? o = "rounded-r-lg rounded-l-none" : e.rounded === "full" ? o = "rounded-r-full rounded-l-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-r-").replace("rounded-l-", ""))), B.value && (p.value ? o = "rounded-none" : e.rounded === "md" ? o = "rounded-l-md rounded-r-none" : e.rounded === "sm" ? o = "rounded-l-sm rounded-r-none" : e.rounded === "lg" ? o = "rounded-l-lg rounded-r-none" : e.rounded === "full" ? o = "rounded-l-full rounded-r-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-l-").replace("rounded-r-", ""))), e.variant === "outline-b" && (o = "rounded-none");
73
+ const T = e.variant === "outline-b" || e.variant === "transparent";
74
74
  return e.variant, [
75
75
  l,
76
76
  n[e.variant],
77
77
  e.type === "textarea" ? "" : f[e.size],
78
78
  o,
79
79
  e.error ? "border-destructive focus-visible:ring-destructive" : "",
80
- e.icon ? "pl-9" : M && !h.value ? "pl-0" : "",
81
- e.showClearButton && C.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : M && !B.value ? "pr-0" : "",
80
+ e.icon ? "pl-9" : T && !p.value ? "pl-0" : "",
81
+ e.showClearButton && C.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : T && !B.value ? "pr-0" : "",
82
82
  // Keyframe name used to detect browser autofill via animationstart event
83
83
  e.variant === "floating" ? "autofill-detect" : "",
84
84
  e.inputClass
@@ -97,7 +97,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
97
97
  "z-10"
98
98
  ].join(" ");
99
99
  }, q = a(() => {
100
- const l = !!g["addon-left"];
100
+ const l = !!x["addon-left"];
101
101
  return [
102
102
  "flex items-center justify-center whitespace-nowrap",
103
103
  l ? `border-none ${P("left")}` : `bg-muted border border-input border-r-0! px-3 text-muted-foreground ${{
@@ -114,7 +114,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
114
114
  e.disabled ? "opacity-50 cursor-not-allowed" : ""
115
115
  ].join(" ");
116
116
  }), G = a(() => {
117
- const l = !!g["addon-right"];
117
+ const l = !!x["addon-right"];
118
118
  return [
119
119
  "flex items-center justify-center whitespace-nowrap",
120
120
  l ? `border-none ${P("right")}` : `bg-muted border border-input border-l-0! px-3 text-muted-foreground ${{
@@ -137,23 +137,25 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
137
137
  const n = l.target;
138
138
  c("change", n.value);
139
139
  }, O = () => {
140
- e.disabled || e.readonly || (x.value = !x.value);
140
+ e.disabled || e.readonly || (y.value = !y.value);
141
141
  }, Q = () => {
142
142
  e.disabled || e.readonly || (c("update:modelValue", ""), z(() => {
143
143
  m.value?.focus();
144
144
  }));
145
- }, p = b(!1), j = b(!1), F = (l) => {
146
- p.value = !0, c("focus", l);
145
+ }, b = v(!1), j = v(!1), F = (l) => {
146
+ b.value = !0, c("focus", l);
147
147
  }, N = (l) => {
148
- p.value = !1, c("blur", l);
148
+ b.value = !1, c("blur", l);
149
149
  }, X = (l) => {
150
- l.animationName === "onAutoFillStart" ? y.value = !0 : l.animationName === "onAutoFillCancel" && (y.value = !1);
150
+ l.animationName === "onAutoFillStart" ? h.value = !0 : l.animationName === "onAutoFillCancel" && (h.value = !1);
151
151
  };
152
152
  return _(() => {
153
153
  e.autofocus && z(() => {
154
- m.value?.focus();
154
+ setTimeout(() => {
155
+ m.value?.focus(), b.value = !0;
156
+ }, 100);
155
157
  }), z(() => {
156
- m.value && m.value.value && !e.modelValue && (y.value = !0);
158
+ m.value && m.value.value && !e.modelValue && (h.value = !0);
157
159
  });
158
160
  }), (l, n) => (d(), u("div", {
159
161
  class: r(U.value)
@@ -171,11 +173,11 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
171
173
  A("div", {
172
174
  class: r(W.value)
173
175
  }, [
174
- h.value ? (d(), u("div", {
176
+ p.value ? (d(), u("div", {
175
177
  key: 0,
176
178
  class: r(q.value)
177
179
  }, [
178
- T(l.$slots, "addon-left", {}, () => [
180
+ M(l.$slots, "addon-left", {}, () => [
179
181
  $(w(t.addonLeft), 1)
180
182
  ])
181
183
  ], 2)) : i("", !0),
@@ -229,13 +231,13 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
229
231
  t.disabled ? "opacity-50" : ""
230
232
  ])
231
233
  }, [
232
- k(v, {
234
+ k(g, {
233
235
  icon: t.icon,
234
236
  class: r(["h-4 w-4", t.iconClass])
235
237
  }, null, 8, ["icon", "class"])
236
238
  ], 2)) : i("", !0),
237
239
  A("div", ae, [
238
- t.loading ? (d(), R(v, {
240
+ t.loading ? (d(), R(g, {
239
241
  key: 0,
240
242
  icon: "lucide:loader-2",
241
243
  class: "h-4 w-4 animate-spin text-muted-foreground"
@@ -248,7 +250,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
248
250
  ]),
249
251
  onClick: n[1] || (n[1] = (f) => !t.disabled && !t.readonly && c("click:icon-right", f))
250
252
  }, [
251
- k(v, {
253
+ k(g, {
252
254
  icon: t.iconRight,
253
255
  class: r(["h-4 w-4", t.iconRightClass])
254
256
  }, null, 8, ["icon", "class"])
@@ -260,19 +262,19 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
260
262
  class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none",
261
263
  onClick: O
262
264
  }, [
263
- k(v, {
264
- icon: x.value ? "lucide:eye-off" : "lucide:eye",
265
+ k(g, {
266
+ icon: y.value ? "lucide:eye-off" : "lucide:eye",
265
267
  class: "h-4 w-4"
266
268
  }, null, 8, ["icon"])
267
269
  ])) : i("", !0),
268
- t.showClearButton && C.value && !t.disabled && !t.readonly && !t.loading && t.type !== "textarea" && t.type !== "password" && (p.value || j.value) ? (d(), u("button", {
270
+ t.showClearButton && C.value && !t.disabled && !t.readonly && !t.loading && t.type !== "textarea" && t.type !== "password" && (b.value || j.value) ? (d(), u("button", {
269
271
  key: 3,
270
272
  type: "button",
271
273
  tabindex: "-1",
272
274
  class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none transition-opacity duration-200",
273
275
  onClick: Q
274
276
  }, [
275
- k(v, {
277
+ k(g, {
276
278
  icon: "lucide:x-circle",
277
279
  class: "h-4 w-4"
278
280
  })
@@ -283,7 +285,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
283
285
  key: 1,
284
286
  class: r(G.value)
285
287
  }, [
286
- T(l.$slots, "addon-right", {}, () => [
288
+ M(l.$slots, "addon-right", {}, () => [
287
289
  $(w(t.addonRight), 1)
288
290
  ])
289
291
  ], 2)) : i("", !0)