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.
- package/components/Accordion/Accordion.vue.js +35 -22
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionContent.vue2.js +1 -1
- package/components/Breadcrumb/Breadcrumb.vue.js +2 -2
- package/components/Breadcrumb/Breadcrumb.vue2.js +44 -44
- package/components/Carousel/Carousel.vue.js +1 -1
- package/components/Carousel/Carousel.vue2.js +3 -3
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue.js +1 -1
- package/components/CommandPalette/CommandPaletteContent.vue2.js +2 -2
- package/components/Dropdown/DropdownTrigger.vue.js +1 -1
- package/components/FilePicker/FilePicker.vue.js +16 -16
- package/components/FileTree/FileTree.vue.js +5 -147
- package/components/FileTree/FileTree.vue2.js +164 -2
- package/components/FileTree/FileTreeNode.vue.js +89 -84
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +1 -1
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +133 -129
- package/components/Form/FormField.vue.d.ts +3 -0
- package/components/Form/FormField.vue.js +85 -82
- package/components/Form/FormFields.vue.d.ts +2 -0
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +55 -52
- package/components/Form/composables/useForm.d.ts +2 -0
- package/components/Form/composables/useForm.js +113 -107
- package/components/ImportData/ImportData.vue.js +157 -142
- package/components/ImportData/ImportStep1.vue.d.ts +6 -0
- package/components/ImportData/ImportStep1.vue.js +69 -61
- package/components/ImportData/ImportStep2.vue.js +5 -98
- package/components/ImportData/ImportStep2.vue2.js +105 -2
- package/components/Kanban/Kanban.vue.js +1 -1
- package/components/Kanban/Kanban.vue2.js +1 -1
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +92 -83
- package/components/Kanban/useKanbanBoard.d.ts +1 -1
- package/components/Kanban/useKanbanBoard.js +17 -17
- package/components/List/ListFieldRow.vue.js +4 -6
- package/components/MultiSelect/MultiSelect.vue.js +10 -4
- package/components/NavbarCommandPalette.vue.js +2 -2
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +1 -1
- package/components/PermissionMatrix/PermissionEditor.vue.d.ts +2 -0
- package/components/PermissionMatrix/PermissionEditor.vue.js +25 -23
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.d.ts +4 -1
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +2 -2
- package/components/PermissionMatrix/PermissionEditorMatrix.vue2.js +48 -45
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/Timeline/Timeline.vue.js +62 -57
- package/components/ToastNotification.vue.js +2 -2
- package/components/ToastNotification.vue2.js +103 -88
- package/components/Workbook/Workbook.vue.js +5 -152
- package/components/Workbook/Workbook.vue2.js +166 -2
- package/package.json +1 -1
- package/style.css +3 -3
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
|
@@ -1,119 +1,124 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { initializeFormValues as
|
|
3
|
-
import { useFileUpload as
|
|
4
|
-
import { $t as
|
|
5
|
-
function
|
|
6
|
-
const { schema: f, values:
|
|
7
|
-
|
|
8
|
-
() =>
|
|
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 =
|
|
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
|
|
14
|
+
const g = () => ({
|
|
15
15
|
values: i.value,
|
|
16
|
-
isUpdate:
|
|
17
|
-
}),
|
|
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
|
-
},
|
|
19
|
+
}, U = () => {
|
|
20
20
|
d.value = {};
|
|
21
|
-
},
|
|
22
|
-
const l =
|
|
23
|
-
let
|
|
24
|
-
const
|
|
25
|
-
if (e.required && (l == null || l === "" || Array.isArray(l) && l.length === 0) && (
|
|
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
|
|
29
|
-
for (const
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
|
|
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 (!
|
|
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 && (
|
|
40
|
+
n && Array.isArray(l) && l.length > n && (t = `Maximum ${n} files allowed`);
|
|
41
41
|
}
|
|
42
|
-
return !
|
|
42
|
+
return !t && e.validation && (t = e.validation({
|
|
43
43
|
value: l,
|
|
44
44
|
values: i.value,
|
|
45
|
-
isUpdate:
|
|
46
|
-
})),
|
|
47
|
-
},
|
|
48
|
-
|
|
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
|
|
51
|
-
if (!
|
|
52
|
-
|
|
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
|
-
},
|
|
56
|
-
i.value =
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
const n =
|
|
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:
|
|
62
|
-
isUpdate:
|
|
63
|
-
updateError:
|
|
61
|
+
data: t,
|
|
62
|
+
isUpdate: h,
|
|
63
|
+
updateError: $
|
|
64
64
|
});
|
|
65
65
|
n && typeof n == "object" && (i.value = { ...i.value, ...n });
|
|
66
66
|
}
|
|
67
|
-
},
|
|
68
|
-
const e =
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
...typeof
|
|
73
|
-
fileName:
|
|
74
|
-
fileUrl:
|
|
75
|
-
fileType:
|
|
76
|
-
fileSize:
|
|
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
|
|
79
|
-
},
|
|
80
|
-
const { name:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
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
|
-
|
|
107
|
+
} finally {
|
|
108
|
+
B && (w.value[o] = !1);
|
|
104
109
|
}
|
|
105
110
|
});
|
|
106
|
-
return (await Promise.all(
|
|
107
|
-
|
|
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
|
-
},
|
|
114
|
+
}, K = (e) => {
|
|
110
115
|
const l = { ...e };
|
|
111
|
-
for (const
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
114
|
-
if (Array.isArray(
|
|
115
|
-
const n =
|
|
116
|
-
Object.assign(l,
|
|
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:
|
|
125
|
-
isDirty:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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 =
|
|
143
|
+
i.value = b(z.value), U(), y.value = !1;
|
|
138
144
|
},
|
|
139
145
|
handleSubmit: async () => {
|
|
140
|
-
if (
|
|
141
|
-
|
|
146
|
+
if (k()) {
|
|
147
|
+
j.value = !0;
|
|
142
148
|
try {
|
|
143
|
-
let l = await
|
|
144
|
-
l =
|
|
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
|
-
),
|
|
155
|
+
), I && await I({
|
|
150
156
|
values: l,
|
|
151
|
-
isUpdate:
|
|
152
|
-
}),
|
|
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
|
-
|
|
162
|
+
j.value = !1;
|
|
157
163
|
}
|
|
158
164
|
}
|
|
159
165
|
},
|
|
160
|
-
flatSchema:
|
|
166
|
+
flatSchema: V
|
|
161
167
|
};
|
|
162
168
|
}
|
|
163
169
|
export {
|
|
164
|
-
|
|
170
|
+
ue as useForm
|
|
165
171
|
};
|