vlite3 0.7.15 → 0.8.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 (57) hide show
  1. package/components/Accordion/Accordion.vue.js +35 -22
  2. package/components/Accordion/AccordionContent.vue.js +2 -2
  3. package/components/Accordion/AccordionContent.vue2.js +1 -1
  4. package/components/Breadcrumb/Breadcrumb.vue.js +2 -2
  5. package/components/Breadcrumb/Breadcrumb.vue2.js +44 -44
  6. package/components/Carousel/Carousel.vue.js +1 -1
  7. package/components/Carousel/Carousel.vue2.js +3 -3
  8. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  9. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  10. package/components/CommandPalette/CommandPaletteContent.vue.js +1 -1
  11. package/components/CommandPalette/CommandPaletteContent.vue2.js +2 -2
  12. package/components/Dropdown/DropdownTrigger.vue.js +1 -1
  13. package/components/FilePicker/FilePicker.vue.js +16 -16
  14. package/components/FileTree/FileTree.vue.js +5 -147
  15. package/components/FileTree/FileTree.vue2.js +164 -2
  16. package/components/FileTree/FileTreeNode.vue.js +89 -84
  17. package/components/Form/CustomFields.vue.js +2 -2
  18. package/components/Form/CustomFields.vue2.js +1 -1
  19. package/components/Form/Form.vue.js +1 -1
  20. package/components/Form/Form.vue2.js +133 -129
  21. package/components/Form/FormField.vue.d.ts +3 -0
  22. package/components/Form/FormField.vue.js +85 -82
  23. package/components/Form/FormFields.vue.d.ts +2 -0
  24. package/components/Form/FormFields.vue.js +2 -2
  25. package/components/Form/FormFields.vue2.js +55 -52
  26. package/components/Form/composables/useForm.d.ts +2 -0
  27. package/components/Form/composables/useForm.js +113 -107
  28. package/components/ImportData/ImportData.vue.js +157 -142
  29. package/components/ImportData/ImportStep1.vue.d.ts +6 -0
  30. package/components/ImportData/ImportStep1.vue.js +69 -61
  31. package/components/ImportData/ImportStep2.vue.js +5 -98
  32. package/components/ImportData/ImportStep2.vue2.js +105 -2
  33. package/components/Kanban/Kanban.vue.js +1 -1
  34. package/components/Kanban/Kanban.vue2.js +1 -1
  35. package/components/Kanban/KanbanBoard.vue.js +1 -1
  36. package/components/Kanban/KanbanBoard.vue2.js +92 -83
  37. package/components/Kanban/useKanbanBoard.d.ts +1 -1
  38. package/components/Kanban/useKanbanBoard.js +17 -17
  39. package/components/List/ListFieldRow.vue.js +4 -6
  40. package/components/MultiSelect/MultiSelect.vue.js +10 -4
  41. package/components/NavbarCommandPalette.vue.js +2 -2
  42. package/components/NumberInput.vue.js +2 -2
  43. package/components/NumberInput.vue2.js +1 -1
  44. package/components/PermissionMatrix/PermissionEditor.vue.d.ts +2 -0
  45. package/components/PermissionMatrix/PermissionEditor.vue.js +25 -23
  46. package/components/PermissionMatrix/PermissionEditorMatrix.vue.d.ts +4 -1
  47. package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +2 -2
  48. package/components/PermissionMatrix/PermissionEditorMatrix.vue2.js +48 -45
  49. package/components/Screen/ScreenFilter.vue.js +1 -1
  50. package/components/Timeline/Timeline.vue.js +62 -57
  51. package/components/ToastNotification.vue.js +2 -2
  52. package/components/ToastNotification.vue2.js +103 -88
  53. package/components/Workbook/Workbook.vue.js +5 -152
  54. package/components/Workbook/Workbook.vue2.js +166 -2
  55. package/package.json +1 -1
  56. package/style.css +3 -3
  57. /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
@@ -1,119 +1,124 @@
1
- import { ref as y, computed as J, watch as K } from "vue";
2
- import { initializeFormValues as B, deepClone as F, cleanSubmitValues as Q, getNestedValue as M, evaluateConditional as j, setNestedValue as V, collectFileFields as W, filterNullCustomFields as X } from "../utils/form.utils.js";
3
- import { useFileUpload as Y } from "./useFileUpload.js";
4
- import { $t as Z } from "../../../utils/i18n.js";
5
- function ne(S) {
6
- const { schema: f, values: x, isUpdate: b = !1, folderId: U, onSubmit: E } = S, { handleUploadFile: C } = Y(), i = y(B(f, x)), d = y({}), A = y(!1), v = y(!1), z = y(F(i.value)), h = J(() => f ? Array.isArray(f[0]) ? f.flat() : f : []);
7
- K(
8
- () => x,
1
+ import { ref as m, shallowRef as Q, computed as W, watch as X } from "vue";
2
+ import { initializeFormValues as L, deepClone as b, cleanSubmitValues as Y, getNestedValue as M, evaluateConditional as x, setNestedValue as A, collectFileFields as Z, filterNullCustomFields as _ } from "../utils/form.utils.js";
3
+ import { useFileUpload as ee } from "./useFileUpload.js";
4
+ import { $t as le } from "../../../utils/i18n.js";
5
+ function ue(S) {
6
+ const { schema: f, values: E, isUpdate: h = !1, folderId: C, onSubmit: I } = S, { handleUploadFile: N } = ee(), i = m(L(f, E)), d = m({}), j = m(!1), y = m(!1), w = m({}), z = Q(b(i.value)), V = W(() => f ? Array.isArray(f[0]) ? f.flat() : f : []);
7
+ X(
8
+ () => E,
9
9
  (e) => {
10
- e && (i.value = B(f, e), z.value = F(i.value), v.value = !1);
10
+ e && (i.value = L(f, e), z.value = b(i.value), y.value = !1);
11
11
  },
12
12
  { deep: !0 }
13
13
  );
14
- const w = () => ({
14
+ const g = () => ({
15
15
  values: i.value,
16
- isUpdate: b
17
- }), I = (e) => M(i.value, e), T = (e) => d.value[e] || "", N = (e, l) => {
16
+ isUpdate: h
17
+ }), O = (e) => M(i.value, e), R = (e) => d.value[e] || "", $ = (e, l) => {
18
18
  l ? d.value[e] = l : delete d.value[e];
19
- }, g = () => {
19
+ }, U = () => {
20
20
  d.value = {};
21
- }, O = (e) => e.when ? j(e.when, w()) : !0, $ = (e) => j(e.disabled, w()), L = (e) => j(e.readonly, w()), D = (e) => {
22
- const l = I(e.name);
23
- let a = "";
24
- const o = e.labelI18n ? Z(e.labelI18n) : typeof e.label == "string" ? e.label : e.name;
25
- if (e.required && (l == null || l === "" || Array.isArray(l) && l.length === 0) && (a = `${o} is required`), !a && e.maxFileSize) {
21
+ }, D = (e) => e.when ? x(e.when, g()) : !0, P = (e) => x(e.disabled, g()), G = (e) => x(e.readonly, g()), T = (e) => {
22
+ const l = O(e.name);
23
+ let t = "";
24
+ const r = e.labelI18n ? le(e.labelI18n) : typeof e.label == "string" ? e.label : e.name;
25
+ if (e.required && (l == null || l === "" || Array.isArray(l) && l.length === 0) && (t = `${r} is required`), !t && e.maxFileSize) {
26
26
  const n = e.maxFileSize * 1024 * 1024;
27
27
  if (l != null && l !== "") {
28
- const t = Array.isArray(l) ? l : [l];
29
- for (const r of t) {
30
- const s = r instanceof File ? r.size : r?.fileSize || r?.file?.size || r?.size;
31
- if (s !== void 0 && s > n) {
32
- a = `${o} size must be less than ${e.maxFileSize}MB`;
28
+ const s = Array.isArray(l) ? l : [l];
29
+ for (const o of s) {
30
+ const a = o instanceof File ? o.size : o?.fileSize || o?.file?.size || o?.size;
31
+ if (a !== void 0 && a > n) {
32
+ t = `${r} size must be less than ${e.maxFileSize}MB`;
33
33
  break;
34
34
  }
35
35
  }
36
36
  }
37
37
  }
38
- if (!a && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
38
+ if (!t && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
39
39
  const n = e.maxFiles || e.props?.maxFiles;
40
- n && Array.isArray(l) && l.length > n && (a = `Maximum ${n} files allowed`);
40
+ n && Array.isArray(l) && l.length > n && (t = `Maximum ${n} files allowed`);
41
41
  }
42
- return !a && e.validation && (a = e.validation({
42
+ return !t && e.validation && (t = e.validation({
43
43
  value: l,
44
44
  values: i.value,
45
- isUpdate: b
46
- })), a ? d.value[e.name] = a : delete d.value[e.name], a;
47
- }, P = () => {
48
- g();
45
+ isUpdate: h
46
+ })), t ? d.value[e.name] = t : delete d.value[e.name], t;
47
+ }, k = () => {
48
+ U();
49
49
  let e = !0;
50
- for (const l of h.value) {
51
- if (!O(l) || $(l)) continue;
52
- D(l) && (e = !1);
50
+ for (const l of V.value) {
51
+ if (!D(l) || P(l)) continue;
52
+ T(l) && (e = !1);
53
53
  }
54
54
  return e;
55
- }, R = (e, l, a) => {
56
- i.value = V(i.value, e, l), v.value = !0, delete d.value[e];
57
- const o = h.value.find((n) => n.name === e);
58
- if (o?.updateValues) {
59
- const n = o.updateValues({
55
+ }, H = (e, l, t) => {
56
+ i.value = A(i.value, e, l), y.value = !0, delete d.value[e];
57
+ const r = V.value.find((n) => n.name === e);
58
+ if (r?.updateValues) {
59
+ const n = r.updateValues({
60
60
  values: i.value,
61
- data: a,
62
- isUpdate: b,
63
- updateError: N
61
+ data: t,
62
+ isUpdate: h,
63
+ updateError: $
64
64
  });
65
65
  n && typeof n == "object" && (i.value = { ...i.value, ...n });
66
66
  }
67
- }, G = async () => {
68
- const e = F(i.value), l = W(f, e), a = (t, r) => {
69
- let s = null;
70
- t instanceof File ? s = t : t && typeof t == "object" && t.file instanceof File && (s = t.file);
71
- const m = {
72
- ...typeof t == "object" ? t : {},
73
- fileName: t?.fileName || s?.name || r.split("/").pop() || "unknown",
74
- fileUrl: r,
75
- fileType: t?.fileType || s?.type || "application/octet-stream",
76
- fileSize: t?.fileSize || s?.size || 0
67
+ }, J = async () => {
68
+ const e = b(i.value), l = Z(f, e), t = (s, o) => {
69
+ let a = null;
70
+ s instanceof File ? a = s : s && typeof s == "object" && s.file instanceof File && (a = s.file);
71
+ const F = {
72
+ ...typeof s == "object" ? s : {},
73
+ fileName: s?.fileName || a?.name || o.split("/").pop() || "unknown",
74
+ fileUrl: o,
75
+ fileType: s?.fileType || a?.type || "application/octet-stream",
76
+ fileSize: s?.fileSize || a?.size || 0
77
77
  };
78
- return delete m.file, delete m.base64, m;
79
- }, o = l.map(async (t) => {
80
- const { name: r, value: s, field: m } = t, k = m.returnFileObject === !0;
81
- if (Array.isArray(s)) {
82
- const q = s.map(async (u) => {
83
- if (u instanceof File || u && typeof u == "object" && u.file instanceof File) {
84
- const p = await C(u, U);
85
- return p ? k ? a(u, p) : p : null;
78
+ return delete F.file, delete F.base64, F;
79
+ }, r = l.map(async (s) => {
80
+ const { name: o, value: a, field: F } = s, q = F.returnFileObject === !0, B = Array.isArray(a) ? a.some((p) => p instanceof File || p && typeof p == "object" && p.file instanceof File) : a instanceof File || a && typeof a == "object" && a.file instanceof File;
81
+ B && (w.value[o] = !0);
82
+ try {
83
+ if (Array.isArray(a)) {
84
+ const p = a.map(async (u) => {
85
+ if (u instanceof File || u && typeof u == "object" && u.file instanceof File) {
86
+ const v = await N(u, C);
87
+ return v ? q ? t(u, v) : v : null;
88
+ }
89
+ if (u && typeof u == "object") {
90
+ const v = { ...u };
91
+ return delete v.file, delete v.base64, v;
92
+ }
93
+ return u;
94
+ }), c = await Promise.all(p);
95
+ return { name: o, value: c };
96
+ } else {
97
+ if (a instanceof File || a && typeof a == "object" && a.file instanceof File) {
98
+ const c = await N(a, C);
99
+ if (c)
100
+ return { name: o, value: q ? t(a, c) : c };
101
+ } else if (a && typeof a == "object") {
102
+ const c = { ...a };
103
+ return delete c.file, delete c.base64, { name: o, value: c };
86
104
  }
87
- if (u && typeof u == "object") {
88
- const p = { ...u };
89
- return delete p.file, delete p.base64, p;
90
- }
91
- return u;
92
- }), c = await Promise.all(q);
93
- return { name: r, value: c };
94
- } else {
95
- if (s instanceof File || s && typeof s == "object" && s.file instanceof File) {
96
- const c = await C(s, U);
97
- if (c)
98
- return { name: r, value: k ? a(s, c) : c };
99
- } else if (s && typeof s == "object") {
100
- const c = { ...s };
101
- return delete c.file, delete c.base64, { name: r, value: c };
105
+ return null;
102
106
  }
103
- return null;
107
+ } finally {
108
+ B && (w.value[o] = !1);
104
109
  }
105
110
  });
106
- return (await Promise.all(o)).forEach((t) => {
107
- t && (Object.assign(e, V(e, t.name, t.value)), i.value = V(i.value, t.name, t.value));
111
+ return (await Promise.all(r)).forEach((s) => {
112
+ s && (Object.assign(e, A(e, s.name, s.value)), i.value = A(i.value, s.name, s.value));
108
113
  }), e;
109
- }, H = (e) => {
114
+ }, K = (e) => {
110
115
  const l = { ...e };
111
- for (const a of h.value)
112
- if (a.type === "customFields" && a.props?.schema) {
113
- const o = M(l, a.name);
114
- if (Array.isArray(o)) {
115
- const n = X(o, a.props.schema);
116
- Object.assign(l, V(l, a.name, n));
116
+ for (const t of V.value)
117
+ if (t.type === "customFields" && t.props?.schema) {
118
+ const r = M(l, t.name);
119
+ if (Array.isArray(r)) {
120
+ const n = _(r, t.props.schema);
121
+ Object.assign(l, A(l, t.name, n));
117
122
  }
118
123
  }
119
124
  return l;
@@ -121,45 +126,46 @@ function ne(S) {
121
126
  return {
122
127
  formValues: i,
123
128
  errors: d,
124
- isSubmitting: A,
125
- isDirty: v,
126
- handleFieldChange: R,
127
- validateField: D,
128
- validateAll: P,
129
- isFieldVisible: O,
130
- isFieldDisabled: $,
131
- isFieldReadonly: L,
132
- getFieldValue: I,
133
- getFieldError: T,
134
- setFieldError: N,
135
- clearErrors: g,
129
+ isSubmitting: j,
130
+ isDirty: y,
131
+ fieldLoading: w,
132
+ handleFieldChange: H,
133
+ validateField: T,
134
+ validateAll: k,
135
+ isFieldVisible: D,
136
+ isFieldDisabled: P,
137
+ isFieldReadonly: G,
138
+ getFieldValue: O,
139
+ getFieldError: R,
140
+ setFieldError: $,
141
+ clearErrors: U,
136
142
  resetForm: () => {
137
- i.value = F(z.value), g(), v.value = !1;
143
+ i.value = b(z.value), U(), y.value = !1;
138
144
  },
139
145
  handleSubmit: async () => {
140
- if (P()) {
141
- A.value = !0;
146
+ if (k()) {
147
+ j.value = !0;
142
148
  try {
143
- let l = await G();
144
- l = H(l), l = Q(
149
+ let l = await J();
150
+ l = K(l), l = Y(
145
151
  l,
146
152
  f,
147
153
  S.emitFields,
148
154
  S.emitFields
149
- ), E && await E({
155
+ ), I && await I({
150
156
  values: l,
151
- isUpdate: b
152
- }), v.value = !1, z.value = F(l);
157
+ isUpdate: h
158
+ }), y.value = !1, z.value = b(l);
153
159
  } catch (l) {
154
160
  throw console.error("[useForm] Submit error:", l), l;
155
161
  } finally {
156
- A.value = !1;
162
+ j.value = !1;
157
163
  }
158
164
  }
159
165
  },
160
- flatSchema: h
166
+ flatSchema: V
161
167
  };
162
168
  }
163
169
  export {
164
- ne as useForm
170
+ ue as useForm
165
171
  };